{{description}}
" 8 | } 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/components/icons/Close.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/AngelDown.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/AngelUp.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/index.js: -------------------------------------------------------------------------------- 1 | import { EditorFormFields } from './EditorFormFields'; 2 | import { Renderer } from './Renderer'; 3 | 4 | export const RenderModule = { 5 | __init__: ['formFields', 'renderer'], 6 | formFields: ['type', EditorFormFields], 7 | renderer: ['type', Renderer], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/features/repeatRender/index.js: -------------------------------------------------------------------------------- 1 | import { RepeatRenderManager } from './RepeatRenderManager'; 2 | 3 | export const RepeatRenderModule = { 4 | __init__: ['repeatRenderManager'], 5 | repeatRenderManager: ['type', RepeatRenderManager], 6 | }; 7 | 8 | export { RepeatRenderManager }; 9 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/hooks/usePrevious.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'preact/hooks'; 2 | 3 | export function usePrevious(value, defaultValue = null) { 4 | const ref = useRef(defaultValue); 5 | 6 | useEffect(() => (ref.current = value), [value]); 7 | 8 | return ref.current; 9 | } 10 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/hooks/usePrevious.js: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'preact/hooks'; 2 | 3 | export function usePrevious(value, defaultValue = null) { 4 | const ref = useRef(defaultValue); 5 | 6 | useEffect(() => (ref.current = value), [value]); 7 | 8 | return ref.current; 9 | } 10 | -------------------------------------------------------------------------------- /e2e/carbon/index.js: -------------------------------------------------------------------------------- 1 | import '@bpmn-io/form-js/dist/assets/form-js.css'; 2 | import '@bpmn-io/form-js/dist/assets/form-js-editor.css'; 3 | import '@bpmn-io/form-js/dist/assets/form-js-playground.css'; 4 | 5 | import './carbon.scss'; 6 | 7 | import { renderSchema } from '../renderSchema'; 8 | 9 | renderSchema(); 10 | -------------------------------------------------------------------------------- /e2e/theming/index.js: -------------------------------------------------------------------------------- 1 | import '@bpmn-io/form-js/dist/assets/form-js.css'; 2 | import '@bpmn-io/form-js/dist/assets/form-js-editor.css'; 3 | import '@bpmn-io/form-js/dist/assets/form-js-playground.css'; 4 | 5 | import './theme.scss'; 6 | 7 | import { renderSchema } from '../renderSchema'; 8 | 9 | renderSchema(); 10 | -------------------------------------------------------------------------------- /packages/form-js-playground/test/spec/other-form.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../form-json-schema/resources/schema.json", 3 | "components": [ 4 | { 5 | "action": "reset", 6 | "id": "foo", 7 | "label": "Reset", 8 | "type": "button" 9 | } 10 | ], 11 | "type": "default" 12 | } 13 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Radio.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-json-schema/test/fixtures/filepicker.js: -------------------------------------------------------------------------------- 1 | export const form = { 2 | type: 'default', 3 | components: [ 4 | { 5 | type: 'filepicker', 6 | key: 'filepicker', 7 | accept: '.png,.jpg', 8 | multiple: true, 9 | }, 10 | ], 11 | }; 12 | 13 | export const errors = null; 14 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/palette/PaletteRenderer.js: -------------------------------------------------------------------------------- 1 | import { SectionModuleBase } from '../SectionModuleBase'; 2 | 3 | export class PaletteRenderer extends SectionModuleBase { 4 | constructor(eventBus) { 5 | super(eventBus, 'palette'); 6 | } 7 | } 8 | 9 | PaletteRenderer.$inject = ['eventBus']; 10 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/components/icons/Draggable.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/hooks/useService.js: -------------------------------------------------------------------------------- 1 | import { useContext } from 'preact/hooks'; 2 | 3 | import { FormEditorContext } from '../context'; 4 | 5 | export function useService(type, strict) { 6 | const { getService } = useContext(FormEditorContext); 7 | 8 | return getService(type, strict); 9 | } 10 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/util/form.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @param {string?} prefix 3 | * 4 | * @returns Element 5 | */ 6 | export function createFormContainer(prefix = 'fjs') { 7 | const container = document.createElement('div'); 8 | 9 | container.classList.add(`${prefix}-container`); 10 | 11 | return container; 12 | } 13 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/repeat-render/index.js: -------------------------------------------------------------------------------- 1 | import { EditorRepeatRenderManager } from './EditorRepeatRenderManager'; 2 | 3 | export const RepeatRenderModule = { 4 | __init__: ['repeatRenderManager'], 5 | repeatRenderManager: ['type', EditorRepeatRenderManager], 6 | }; 7 | 8 | export { EditorRepeatRenderManager }; 9 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-create.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/features/expressionField/index.js: -------------------------------------------------------------------------------- 1 | import { ExpressionLoopPreventer } from './ExpressionLoopPreventer'; 2 | 3 | export const ExpressionFieldModule = { 4 | __init__: ['expressionLoopPreventer'], 5 | expressionLoopPreventer: ['type', ExpressionLoopPreventer], 6 | }; 7 | 8 | export { ExpressionLoopPreventer }; 9 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/Download.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-json-schema/test/fixtures/documentPreview.js: -------------------------------------------------------------------------------- 1 | export const form = { 2 | type: 'default', 3 | components: [ 4 | { 5 | type: 'documentPreview', 6 | dataSource: '=someSource', 7 | label: 'My documents', 8 | maxHeight: 100, 9 | }, 10 | ], 11 | }; 12 | 13 | export const errors = null; 14 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-checkbox-checked.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Select.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Textfield.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /e2e/carbon/theme.scss: -------------------------------------------------------------------------------- 1 | @use '@carbon/styles' as * with ( 2 | $font-path: '@ibm/plex' 3 | ); 4 | @use '@carbon/styles/scss/themes'; 5 | @use '@carbon/styles/scss/theme'; 6 | 7 | [data-carbon-theme='g10'] { 8 | @include theme.theme(themes.$g10); 9 | } 10 | 11 | [data-carbon-theme='g100'] { 12 | @include theme.theme(themes.$g100); 13 | } 14 | -------------------------------------------------------------------------------- /e2e/theming/theme.scss: -------------------------------------------------------------------------------- 1 | @use '@carbon/styles' as * with ( 2 | $font-path: '@ibm/plex' 3 | ); 4 | @use '@carbon/styles/scss/themes'; 5 | @use '@carbon/styles/scss/theme'; 6 | 7 | [data-carbon-theme='g10'] { 8 | @include theme.theme(themes.$g10); 9 | } 10 | 11 | [data-carbon-theme='g100'] { 12 | @include theme.theme(themes.$g100); 13 | } 14 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/editor-actions/index.js: -------------------------------------------------------------------------------- 1 | import BaseEditorActionsModule from 'diagram-js/lib/features/editor-actions'; 2 | 3 | import { FormEditorActions } from './FormEditorActions'; 4 | 5 | export const EditorActionsModule = { 6 | __depends__: [BaseEditorActionsModule], 7 | editorActions: ['type', FormEditorActions], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/selection/index.js: -------------------------------------------------------------------------------- 1 | import { Selection } from './Selection'; 2 | import { SelectionBehavior } from './SelectionBehavior'; 3 | 4 | export const SelectionModule = { 5 | __init__: ['selection', 'selectionBehavior'], 6 | selection: ['type', Selection], 7 | selectionBehavior: ['type', SelectionBehavior], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/context/FormEditorContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'preact'; 2 | 3 | /** 4 | * @param {string} type 5 | * @param {boolean} [strict] 6 | * 7 | * @returns {any} 8 | */ 9 | function getService(type, strict) {} 10 | 11 | export const FormEditorContext = createContext({ 12 | getService, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/Expand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-json-schema/test/fixtures/layout-empty-row.js: -------------------------------------------------------------------------------- 1 | export const form = { 2 | type: 'default', 3 | components: [ 4 | { 5 | type: 'textfield', 6 | key: 'firstName', 7 | layout: { 8 | row: null, 9 | columns: 12, 10 | }, 11 | }, 12 | ], 13 | }; 14 | 15 | export const errors = null; 16 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/index.js: -------------------------------------------------------------------------------- 1 | import CreateIcon from './pp-create.svg'; 2 | import ListArrowIcon from './pp-list-arrow.svg'; 3 | import ListDeleteIcon from './pp-list-delete.svg'; 4 | import SectionArrowIcon from './pp-section-arrow.svg'; 5 | 6 | export { CreateIcon, ListArrowIcon, ListDeleteIcon, SectionArrowIcon }; 7 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/Collapse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/XMark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/PropertiesPanelModule.js: -------------------------------------------------------------------------------- 1 | import { SectionModuleBase } from '../SectionModuleBase'; 2 | 3 | export class PropertiesPanelModule extends SectionModuleBase { 4 | constructor(eventBus) { 5 | super(eventBus, 'propertiesPanel'); 6 | } 7 | } 8 | 9 | PropertiesPanelModule.$inject = ['eventBus']; 10 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/Add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/context/FormContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'preact'; 2 | 3 | /** 4 | * @param {string} type 5 | * @param {boolean} [strict] 6 | * 7 | * @returns {any} 8 | */ 9 | function getService(type, strict) {} 10 | 11 | export const FormContext = createContext({ 12 | getService, 13 | formId: null, 14 | }); 15 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Number.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/hooks/usePropertiesPanelService.js: -------------------------------------------------------------------------------- 1 | import { useContext } from 'preact/hooks'; 2 | 3 | import { FormPropertiesPanelContext } from '../context'; 4 | 5 | export function useService(type, strict) { 6 | const { getService } = useContext(FormPropertiesPanelContext); 7 | 8 | return getService(type, strict); 9 | } 10 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/Calendar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-carbon-styles/test/spec/theme.scss: -------------------------------------------------------------------------------- 1 | @use '@carbon/react' as * with ( 2 | $font-path: '@ibm/plex' 3 | ); 4 | 5 | @use '@carbon/react/scss/themes'; 6 | @use '@carbon/react/scss/theme'; 7 | 8 | [data-carbon-theme='g10'] { 9 | @include theme.theme(themes.$g10); 10 | } 11 | 12 | [data-carbon-theme='g100'] { 13 | @include theme.theme(themes.$g100); 14 | } 15 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-fullpanel.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/render-injection/slot-fill/FillContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'preact'; 2 | 3 | export const FillContext = createContext({ 4 | addFill(uid, props) { 5 | throw new Error('FillContext.addFill() uninitialized'); 6 | }, 7 | removeFill(uid) { 8 | throw new Error('FillContext.addFill() uninitialized'); 9 | }, 10 | }); 11 | -------------------------------------------------------------------------------- /packages/form-js-carbon-styles/test/test.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: sans-serif; 3 | font-size: 16px; 4 | margin: 1rem; 5 | } 6 | 7 | h1 { 8 | margin: 0 0 1rem 0; 9 | } 10 | 11 | .form-container { 12 | padding: 20px; 13 | } 14 | 15 | .test-container { 16 | height: 100% !important; 17 | } 18 | 19 | .test-content-container { 20 | overflow: auto !important; 21 | } 22 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/context/FormPropertiesPanelContext.js: -------------------------------------------------------------------------------- 1 | import { createContext } from 'preact'; 2 | 3 | /** 4 | * @param {string} type 5 | * @param {boolean} [strict] 6 | * 7 | * @returns {any} 8 | */ 9 | function getService(type, strict) {} 10 | 11 | export const FormPropertiesPanelContext = createContext({ 12 | getService, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-fullpanel-off.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/features/viewerCommands/index.js: -------------------------------------------------------------------------------- 1 | import commandModule from 'diagram-js/lib/command'; 2 | 3 | import { ViewerCommands } from './ViewerCommands'; 4 | 5 | export const ViewerCommandsModule = { 6 | __depends__: [commandModule], 7 | __init__: ['viewerCommands'], 8 | viewerCommands: ['type', ViewerCommands], 9 | }; 10 | 11 | export { ViewerCommands }; 12 | -------------------------------------------------------------------------------- /packages/form-js-viewer/test/spec/custom/custom.css: -------------------------------------------------------------------------------- 1 | .fjs-container .fjs-button.custom-button[type='submit'] { 2 | color: var(--color-text-inverted); 3 | background-color: #10ad73; 4 | border-color: #10ad73; 5 | } 6 | 7 | .fjs-container .fjs-button.custom-button[type='reset'] { 8 | color: #10ad73; 9 | background-color: transparent; 10 | border-color: #10ad73; 11 | } 12 | -------------------------------------------------------------------------------- /tasks/stages/await-published: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eo pipefail 4 | shopt -s inherit_errexit nullglob 5 | 6 | i=0 7 | pkg="$PKG" 8 | until [ $i -gt 10 ] 9 | do 10 | echo "Checking for $pkg in npm registry ($((i+1))/10)" 11 | info=$(npm info $pkg) 12 | if [[ "$info" != "" ]]; then 13 | echo "Found." 14 | break 15 | fi 16 | 17 | i=$((var+1)) 18 | sleep 15s 19 | done -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/entries/IFrameHeightEntry.js: -------------------------------------------------------------------------------- 1 | import { HeightEntry } from './HeightEntry'; 2 | 3 | export function IFrameHeightEntry(props) { 4 | return [ 5 | ...HeightEntry({ 6 | ...props, 7 | description: 'Height of the container in pixels.', 8 | isDefaultVisible: (field) => field.type === 'iframe', 9 | }), 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/keyboard/index.js: -------------------------------------------------------------------------------- 1 | import KeyboardModule from 'diagram-js/lib/features/keyboard'; 2 | 3 | import { FormEditorKeyboardBindings } from './FormEditorKeyboardBindings'; 4 | 5 | export const FormEditorKeyboardModule = { 6 | __depends__: [KeyboardModule], 7 | __init__: ['keyboardBindings'], 8 | keyboardBindings: ['type', FormEditorKeyboardBindings], 9 | }; 10 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-section-arrow.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Separator.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /e2e/visual/fixtures/empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../packages/form-json-schema/resources/schema.json", 3 | "schemaVersion": 8, 4 | "exporter": { 5 | "name": "Camunda Web Modeler", 6 | "version": "0de37f6" 7 | }, 8 | "components": [], 9 | "type": "default", 10 | "id": "form_id", 11 | "executionPlatform": "Camunda Cloud", 12 | "executionPlatformVersion": "8.2.0" 13 | } 14 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/expression-language/index.js: -------------------------------------------------------------------------------- 1 | import { FeelExpressionLanguage } from '@bpmn-io/form-js-viewer'; 2 | import { EditorTemplating } from './EditorTemplating'; 3 | 4 | export const EditorExpressionLanguageModule = { 5 | __init__: ['expressionLanguage', 'templating'], 6 | expressionLanguage: ['type', FeelExpressionLanguage], 7 | templating: ['type', EditorTemplating], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Taglist.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Spacer.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /e2e/carbon/carbon.scss: -------------------------------------------------------------------------------- 1 | @use '@carbon/styles' as * with ( 2 | $font-path: '@ibm/plex' 3 | ); 4 | @use '@carbon/styles/scss/themes'; 5 | @use '@carbon/styles/scss/theme'; 6 | 7 | @import '@bpmn-io/form-js-carbon-styles/src/carbon-styles'; 8 | 9 | [data-carbon-theme='g10'] { 10 | @include theme.theme(themes.$g10); 11 | } 12 | 13 | [data-carbon-theme='g100'] { 14 | @include theme.theme(themes.$g100); 15 | } 16 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/EditorFormFields.js: -------------------------------------------------------------------------------- 1 | import { FormFields } from '@bpmn-io/form-js-viewer'; 2 | import { editorFormFields } from './components/editor-form-fields/'; 3 | 4 | export class EditorFormFields extends FormFields { 5 | constructor() { 6 | super(); 7 | editorFormFields.forEach((formField) => { 8 | this.register(formField.config.type, formField); 9 | }); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-list-delete.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/form-js-viewer/test/spec/documentPreview.json: -------------------------------------------------------------------------------- 1 | { 2 | "components": [ 3 | { 4 | "label": "Case {{case_id}} documents", 5 | "type": "documentPreview", 6 | "id": "Field_0wy8tws", 7 | "dataSource": "=my_documents" 8 | } 9 | ], 10 | "$schema": "../../../form-json-schema/resources/schema.json", 11 | "type": "default", 12 | "id": "Form_1bd2k8m", 13 | "schemaVersion": 18 14 | } 15 | -------------------------------------------------------------------------------- /packages/form-js-viewer/test/spec/labels.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../form-json-schema/resources/schema.json", 3 | "components": [ 4 | { 5 | "type": "textfield", 6 | "label": "{{ foo }} and {{ bar }}", 7 | "key": "template" 8 | }, 9 | { 10 | "type": "textfield", 11 | "label": "=label_var", 12 | "key": "expression" 13 | } 14 | ], 15 | "type": "default" 16 | } 17 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/components/icons/index.js: -------------------------------------------------------------------------------- 1 | import CloseIcon from './Close.svg'; 2 | import DeleteIcon from './Delete.svg'; 3 | import DraggableIcon from './Draggable.svg'; 4 | import SearchIcon from './Search.svg'; 5 | import EmptyFormIcon from './EmptyForm.svg'; 6 | 7 | export { iconsByType } from '@bpmn-io/form-js-viewer'; 8 | 9 | export { CloseIcon, DeleteIcon, DraggableIcon, SearchIcon, EmptyFormIcon }; 10 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/form-fields/icons/Clock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-json-schema/test/fixtures/dynamic-list-properties.js: -------------------------------------------------------------------------------- 1 | export const form = { 2 | type: 'default', 3 | components: [ 4 | { 5 | type: 'dynamiclist', 6 | path: 'myGroup', 7 | isRepeating: true, 8 | defaultRepetitions: 5, 9 | allowAddRemove: true, 10 | disableCollapse: false, 11 | nonCollapsedItems: 3, 12 | }, 13 | ], 14 | }; 15 | 16 | export const errors = null; 17 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/hooks/useService.js: -------------------------------------------------------------------------------- 1 | import { useContext } from 'preact/hooks'; 2 | 3 | import { FormContext } from '../context'; 4 | 5 | /** 6 | * @template T 7 | * @param {string} type 8 | * @param {boolean} [strict=true] 9 | * @returns {T | null} 10 | */ 11 | export function useService(type, strict) { 12 | const { getService } = useContext(FormContext); 13 | 14 | return getService(type, strict); 15 | } 16 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/icons/pp-list-arrow.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /packages/form-js-viewer/src/render/components/icons/Textarea.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/form-json-schema/test/fixtures/schemaVersion-not-supported.js: -------------------------------------------------------------------------------- 1 | export const form = { 2 | type: 'default', 3 | components: [], 4 | schemaVersion: 20, 5 | }; 6 | 7 | export const errors = [ 8 | { 9 | instancePath: '/schemaVersion', 10 | schemaPath: '#/properties/schemaVersion/maximum', 11 | keyword: 'maximum', 12 | params: { comparison: '<=', limit: 19 }, 13 | message: 'must be <= 19', 14 | }, 15 | ]; 16 | -------------------------------------------------------------------------------- /packages/form-js-viewer/test/spec/descriptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../../form-json-schema/resources/schema.json", 3 | "components": [ 4 | { 5 | "type": "textfield", 6 | "description": "{{ foo }} and {{ bar }}", 7 | "key": "template" 8 | }, 9 | { 10 | "type": "textfield", 11 | "description": "=description_var", 12 | "key": "expression" 13 | } 14 | ], 15 | "type": "default" 16 | } 17 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/groups/ConstraintsGroup.js: -------------------------------------------------------------------------------- 1 | import { DateTimeConstraintsEntry } from '../entries'; 2 | 3 | export function ConstraintsGroup(field, editField) { 4 | const entries = [...DateTimeConstraintsEntry({ field, editField })]; 5 | 6 | if (!entries.length) { 7 | return null; 8 | } 9 | 10 | return { 11 | id: 'constraints', 12 | label: 'Constraints', 13 | entries, 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /packages/form-json-schema/src/defs/field-types/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "properties": { 3 | "type": { 4 | "enum": [ 5 | "checkbox", 6 | "checklist", 7 | "datetime", 8 | "number", 9 | "radio", 10 | "select", 11 | "taglist", 12 | "textfield", 13 | "textarea", 14 | "expression", 15 | "filepicker" 16 | ] 17 | } 18 | }, 19 | "required": ["type"] 20 | } 21 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/entries/factories/index.js: -------------------------------------------------------------------------------- 1 | export { simpleStringEntryFactory } from './simpleStringEntryFactory'; 2 | export { simpleBoolEntryFactory } from './simpleBoolEntryFactory'; 3 | export { zeroPositiveIntegerEntryFactory } from './zeroPositiveIntegerEntryFactory'; 4 | export { simpleSelectEntryFactory } from './simpleSelectEntryFactory'; 5 | export { simpleRangeIntegerEntryFactory } from './simpleRangeIntegerEntryFactory'; 6 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/groups/ConditionGroup.js: -------------------------------------------------------------------------------- 1 | import { ConditionEntry } from '../entries'; 2 | 3 | export function ConditionGroup(field, editField) { 4 | const { type } = field; 5 | 6 | if (type === 'default') { 7 | return null; 8 | } 9 | 10 | const entries = [...ConditionEntry({ field, editField })]; 11 | 12 | return { 13 | id: 'condition', 14 | label: 'Condition', 15 | entries, 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /packages/form-js-carbon-styles/src/types/carbon-styles.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * DEPRECATED: This file is deprecated and will be removed with one of the next releases. 3 | */ 4 | 5 | declare module '@bpmn-io/form-js-carbon-styles' { 6 | import { FlattenSimpleInterpolation, GlobalStyleComponent, DefaultTheme } from 'styled-components'; 7 | 8 | const CARBON_STYLES: FlattenSimpleInterpolation; 9 | const GlobalFormStyling: GlobalStyleComponent<{}, DefaultTheme>; 10 | } 11 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/features/properties-panel/entries/SelectEntries.js: -------------------------------------------------------------------------------- 1 | import { simpleBoolEntryFactory } from './factories'; 2 | 3 | export function SelectEntries(props) { 4 | const entries = [ 5 | simpleBoolEntryFactory({ 6 | id: 'searchable', 7 | path: ['searchable'], 8 | label: 'Searchable', 9 | props, 10 | isDefaultVisible: (field) => field.type === 'select', 11 | }), 12 | ]; 13 | 14 | return entries; 15 | } 16 | -------------------------------------------------------------------------------- /packages/form-js-editor/src/render/components/FieldDragPreview.js: -------------------------------------------------------------------------------- 1 | import classNames from 'classnames'; 2 | 3 | export function FieldDragPreview(props) { 4 | const { class: className, Icon, label } = props; 5 | 6 | return ( 7 |
17 |