@bpmn-io/form-js-editor 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +119 -119
- package/dist/assets/form-js-editor.css +295 -287
- package/dist/index.cjs +202 -202
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +202 -202
- package/dist/index.es.js.map +1 -1
- package/dist/types/FormEditor.d.ts +155 -155
- package/dist/types/core/Debounce.d.ts +10 -10
- package/dist/types/core/EventBus.d.ts +1 -1
- package/dist/types/core/FieldFactory.d.ts +18 -18
- package/dist/types/core/FormFieldRegistry.d.ts +19 -19
- package/dist/types/core/index.d.ts +17 -17
- package/dist/types/features/editor-actions/FormEditorActions.d.ts +8 -8
- package/dist/types/features/editor-actions/index.d.ts +6 -6
- package/dist/types/features/keyboard/FormEditorKeyboardBindings.d.ts +8 -8
- package/dist/types/features/keyboard/index.d.ts +7 -7
- package/dist/types/features/modeling/Modeling.d.ts +34 -34
- package/dist/types/features/modeling/behavior/IdBehavior.d.ts +7 -7
- package/dist/types/features/modeling/behavior/KeyBehavior.d.ts +7 -7
- package/dist/types/features/modeling/behavior/index.d.ts +8 -8
- package/dist/types/features/modeling/cmd/AddFormFieldHandler.d.ts +16 -16
- package/dist/types/features/modeling/cmd/EditFormFieldHandler.d.ts +16 -16
- package/dist/types/features/modeling/cmd/MoveFormFieldHandler.d.ts +17 -17
- package/dist/types/features/modeling/cmd/RemoveFormFieldHandler.d.ts +16 -16
- package/dist/types/features/modeling/cmd/UpdateIdClaimHandler.d.ts +14 -14
- package/dist/types/features/modeling/cmd/UpdateKeyClaimHandler.d.ts +14 -14
- package/dist/types/features/modeling/cmd/Util.d.ts +4 -4
- package/dist/types/features/modeling/index.d.ts +7 -7
- package/dist/types/features/palette/PaletteRenderer.d.ts +33 -33
- package/dist/types/features/palette/components/Palette.d.ts +1 -1
- package/dist/types/features/palette/index.d.ts +5 -5
- package/dist/types/features/properties-panel/PropertiesPanel.d.ts +1 -1
- package/dist/types/features/properties-panel/PropertiesPanelHeaderProvider.d.ts +5 -5
- package/dist/types/features/properties-panel/PropertiesPanelPlaceholderProvider.d.ts +8 -8
- package/dist/types/features/properties-panel/PropertiesPanelRenderer.d.ts +37 -37
- package/dist/types/features/properties-panel/Util.d.ts +9 -9
- package/dist/types/features/properties-panel/context/FormPropertiesPanelContext.d.ts +11 -11
- package/dist/types/features/properties-panel/context/index.d.ts +1 -1
- package/dist/types/features/properties-panel/entries/ActionEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/AdornerEntry.d.ts +11 -11
- package/dist/types/features/properties-panel/entries/AltTextEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/ColumnsEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/ConditionEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/CustomValueEntry.d.ts +11 -11
- package/dist/types/features/properties-panel/entries/DateTimeConstraintsEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/DateTimeEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/DateTimeSerializationEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/DefaultValueEntry.d.ts +1 -1
- package/dist/types/features/properties-panel/entries/DescriptionEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/DisabledEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/IdEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/ImageSourceEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/InputKeyValuesSourceEntry.d.ts +11 -11
- package/dist/types/features/properties-panel/entries/KeyEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/LabelEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/NumberEntries.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/NumberSerializationEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/StaticValuesSourceEntry.d.ts +5 -5
- package/dist/types/features/properties-panel/entries/TextEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/ValueEntry.d.ts +11 -11
- package/dist/types/features/properties-panel/entries/ValuesSourceSelectEntry.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/factories/index.d.ts +1 -1
- package/dist/types/features/properties-panel/entries/factories/simpleStringEntryFactory.d.ts +9 -9
- package/dist/types/features/properties-panel/entries/index.d.ts +23 -23
- package/dist/types/features/properties-panel/groups/AppearanceGroup.d.ts +13 -13
- package/dist/types/features/properties-panel/groups/ConditionGroup.d.ts +11 -11
- package/dist/types/features/properties-panel/groups/ConstraintsGroup.d.ts +11 -11
- package/dist/types/features/properties-panel/groups/CustomValuesGroup.d.ts +31 -31
- package/dist/types/features/properties-panel/groups/GeneralGroup.d.ts +5 -5
- package/dist/types/features/properties-panel/groups/SerializationGroup.d.ts +11 -11
- package/dist/types/features/properties-panel/groups/ValidationGroup.d.ts +14 -14
- package/dist/types/features/properties-panel/groups/ValuesGroups.d.ts +1 -1
- package/dist/types/features/properties-panel/groups/index.d.ts +8 -8
- package/dist/types/features/properties-panel/hooks/index.d.ts +2 -2
- package/dist/types/features/properties-panel/hooks/usePropertiesPanelService.d.ts +1 -1
- package/dist/types/features/properties-panel/hooks/useVariables.d.ts +6 -6
- package/dist/types/features/properties-panel/icons/index.d.ts +1 -1
- package/dist/types/features/properties-panel/index.d.ts +6 -6
- package/dist/types/features/selection/Selection.d.ts +14 -14
- package/dist/types/features/selection/SelectionBehavior.d.ts +7 -7
- package/dist/types/features/selection/index.d.ts +8 -8
- package/dist/types/import/Importer.d.ts +51 -51
- package/dist/types/import/index.d.ts +5 -5
- package/dist/types/index.d.ts +15 -15
- package/dist/types/render/Renderer.d.ts +26 -26
- package/dist/types/render/components/FormEditor.d.ts +1 -1
- package/dist/types/render/components/icons/index.d.ts +1 -1
- package/dist/types/render/context/DragAndDropContext.d.ts +4 -4
- package/dist/types/render/context/FormEditorContext.d.ts +11 -11
- package/dist/types/render/context/index.d.ts +2 -2
- package/dist/types/render/hooks/useService.d.ts +1 -1
- package/dist/types/render/index.d.ts +8 -8
- package/dist/types/src/types.d.ts +28 -28
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -446,10 +446,10 @@ function invokeFunction(fn, args) {
|
|
|
446
446
|
return fn.apply(null, args);
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
/**
|
|
450
|
-
* A factory to create a configurable debouncer.
|
|
451
|
-
*
|
|
452
|
-
* @param {number|boolean} [config=true]
|
|
449
|
+
/**
|
|
450
|
+
* A factory to create a configurable debouncer.
|
|
451
|
+
*
|
|
452
|
+
* @param {number|boolean} [config=true]
|
|
453
453
|
*/
|
|
454
454
|
function DebounceFactory(config = true) {
|
|
455
455
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -462,11 +462,11 @@ function DebounceFactory(config = true) {
|
|
|
462
462
|
DebounceFactory.$inject = ['config.debounce'];
|
|
463
463
|
|
|
464
464
|
class FieldFactory {
|
|
465
|
-
/**
|
|
466
|
-
* @constructor
|
|
467
|
-
*
|
|
468
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
469
|
-
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
465
|
+
/**
|
|
466
|
+
* @constructor
|
|
467
|
+
*
|
|
468
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
469
|
+
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
470
470
|
*/
|
|
471
471
|
constructor(formFieldRegistry, formFields) {
|
|
472
472
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -526,11 +526,11 @@ class FieldFactory {
|
|
|
526
526
|
FieldFactory.$inject = ['formFieldRegistry', 'formFields'];
|
|
527
527
|
|
|
528
528
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
529
|
-
/**
|
|
530
|
-
* Updates a form fields id.
|
|
531
|
-
*
|
|
532
|
-
* @param {Object} formField
|
|
533
|
-
* @param {string} newId
|
|
529
|
+
/**
|
|
530
|
+
* Updates a form fields id.
|
|
531
|
+
*
|
|
532
|
+
* @param {Object} formField
|
|
533
|
+
* @param {string} newId
|
|
534
534
|
*/
|
|
535
535
|
updateId(formField, newId) {
|
|
536
536
|
this._validateId(newId);
|
|
@@ -551,13 +551,13 @@ class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
|
|
554
|
-
/**
|
|
555
|
-
* Validate the suitability of the given id and signals a problem
|
|
556
|
-
* with an exception.
|
|
557
|
-
*
|
|
558
|
-
* @param {string} id
|
|
559
|
-
*
|
|
560
|
-
* @throws {Error} if id is empty or already assigned
|
|
554
|
+
/**
|
|
555
|
+
* Validate the suitability of the given id and signals a problem
|
|
556
|
+
* with an exception.
|
|
557
|
+
*
|
|
558
|
+
* @param {string} id
|
|
559
|
+
*
|
|
560
|
+
* @throws {Error} if id is empty or already assigned
|
|
561
561
|
*/
|
|
562
562
|
_validateId(id) {
|
|
563
563
|
if (!id) {
|
|
@@ -570,31 +570,31 @@ class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
|
570
570
|
}
|
|
571
571
|
|
|
572
572
|
class Importer {
|
|
573
|
-
/**
|
|
574
|
-
* @constructor
|
|
575
|
-
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
576
|
-
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
573
|
+
/**
|
|
574
|
+
* @constructor
|
|
575
|
+
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
576
|
+
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
577
577
|
*/
|
|
578
578
|
constructor(formFieldRegistry, fieldFactory) {
|
|
579
579
|
this._formFieldRegistry = formFieldRegistry;
|
|
580
580
|
this._fieldFactory = fieldFactory;
|
|
581
581
|
}
|
|
582
582
|
|
|
583
|
-
/**
|
|
584
|
-
* Import schema creating fields, attaching additional
|
|
585
|
-
* information to each field and adding fields to the
|
|
586
|
-
* field registry.
|
|
587
|
-
*
|
|
588
|
-
* Additional information attached:
|
|
589
|
-
*
|
|
590
|
-
* * `id` (unless present)
|
|
591
|
-
* * `_parent`
|
|
592
|
-
* * `_path`
|
|
593
|
-
*
|
|
594
|
-
* @param {any} schema
|
|
595
|
-
*
|
|
596
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
597
|
-
* @returns {ImportResult}
|
|
583
|
+
/**
|
|
584
|
+
* Import schema creating fields, attaching additional
|
|
585
|
+
* information to each field and adding fields to the
|
|
586
|
+
* field registry.
|
|
587
|
+
*
|
|
588
|
+
* Additional information attached:
|
|
589
|
+
*
|
|
590
|
+
* * `id` (unless present)
|
|
591
|
+
* * `_parent`
|
|
592
|
+
* * `_path`
|
|
593
|
+
*
|
|
594
|
+
* @param {any} schema
|
|
595
|
+
*
|
|
596
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
597
|
+
* @returns {ImportResult}
|
|
598
598
|
*/
|
|
599
599
|
importSchema(schema) {
|
|
600
600
|
// TODO: Add warnings
|
|
@@ -611,12 +611,12 @@ class Importer {
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
|
|
614
|
-
/**
|
|
615
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
616
|
-
* @param {String} [parentId]
|
|
617
|
-
* @param {number} [index]
|
|
618
|
-
*
|
|
619
|
-
* @return {any} field
|
|
614
|
+
/**
|
|
615
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
616
|
+
* @param {String} [parentId]
|
|
617
|
+
* @param {number} [index]
|
|
618
|
+
*
|
|
619
|
+
* @return {any} field
|
|
620
620
|
*/
|
|
621
621
|
importFormField(fieldAttrs, parentId, index) {
|
|
622
622
|
const {
|
|
@@ -653,11 +653,11 @@ class Importer {
|
|
|
653
653
|
return field;
|
|
654
654
|
}
|
|
655
655
|
|
|
656
|
-
/**
|
|
657
|
-
* @param {Array<any>} components
|
|
658
|
-
* @param {string} parentId
|
|
659
|
-
*
|
|
660
|
-
* @return {Array<any>} imported components
|
|
656
|
+
/**
|
|
657
|
+
* @param {Array<any>} components
|
|
658
|
+
* @param {string} parentId
|
|
659
|
+
*
|
|
660
|
+
* @return {Array<any>} imported components
|
|
661
661
|
*/
|
|
662
662
|
importFormFields(components, parentId) {
|
|
663
663
|
return components.map((component, index) => {
|
|
@@ -675,11 +675,11 @@ const DragAndDropContext = createContext({
|
|
|
675
675
|
drake: null
|
|
676
676
|
});
|
|
677
677
|
|
|
678
|
-
/**
|
|
679
|
-
* @param {string} type
|
|
680
|
-
* @param {boolean} [strict]
|
|
681
|
-
*
|
|
682
|
-
* @returns {any}
|
|
678
|
+
/**
|
|
679
|
+
* @param {string} type
|
|
680
|
+
* @param {boolean} [strict]
|
|
681
|
+
*
|
|
682
|
+
* @returns {any}
|
|
683
683
|
*/
|
|
684
684
|
function getService$1(type, strict) {}
|
|
685
685
|
const FormEditorContext = createContext({
|
|
@@ -1748,10 +1748,10 @@ function updatePath(formFieldRegistry, formField, index) {
|
|
|
1748
1748
|
}
|
|
1749
1749
|
|
|
1750
1750
|
class AddFormFieldHandler {
|
|
1751
|
-
/**
|
|
1752
|
-
* @constructor
|
|
1753
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
1754
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1751
|
+
/**
|
|
1752
|
+
* @constructor
|
|
1753
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
1754
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1755
1755
|
*/
|
|
1756
1756
|
constructor(formEditor, formFieldRegistry) {
|
|
1757
1757
|
this._formEditor = formEditor;
|
|
@@ -1812,10 +1812,10 @@ class AddFormFieldHandler {
|
|
|
1812
1812
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
1813
1813
|
|
|
1814
1814
|
class EditFormFieldHandler {
|
|
1815
|
-
/**
|
|
1816
|
-
* @constructor
|
|
1817
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
1818
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1815
|
+
/**
|
|
1816
|
+
* @constructor
|
|
1817
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
1818
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1819
1819
|
*/
|
|
1820
1820
|
constructor(formEditor, formFieldRegistry) {
|
|
1821
1821
|
this._formEditor = formEditor;
|
|
@@ -1878,10 +1878,10 @@ class EditFormFieldHandler {
|
|
|
1878
1878
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
1879
1879
|
|
|
1880
1880
|
class MoveFormFieldHandler {
|
|
1881
|
-
/**
|
|
1882
|
-
* @constructor
|
|
1883
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
1884
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1881
|
+
/**
|
|
1882
|
+
* @constructor
|
|
1883
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
1884
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1885
1885
|
*/
|
|
1886
1886
|
constructor(formEditor, formFieldRegistry) {
|
|
1887
1887
|
this._formEditor = formEditor;
|
|
@@ -1958,10 +1958,10 @@ class MoveFormFieldHandler {
|
|
|
1958
1958
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
1959
1959
|
|
|
1960
1960
|
class RemoveFormFieldHandler {
|
|
1961
|
-
/**
|
|
1962
|
-
* @constructor
|
|
1963
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
1964
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1961
|
+
/**
|
|
1962
|
+
* @constructor
|
|
1963
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
1964
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1965
1965
|
*/
|
|
1966
1966
|
constructor(formEditor, formFieldRegistry) {
|
|
1967
1967
|
this._formEditor = formEditor;
|
|
@@ -2021,9 +2021,9 @@ class RemoveFormFieldHandler {
|
|
|
2021
2021
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
2022
2022
|
|
|
2023
2023
|
class UpdateIdClaimHandler {
|
|
2024
|
-
/**
|
|
2025
|
-
* @constructor
|
|
2026
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
2024
|
+
/**
|
|
2025
|
+
* @constructor
|
|
2026
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
2027
2027
|
*/
|
|
2028
2028
|
constructor(formFieldRegistry) {
|
|
2029
2029
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -2056,9 +2056,9 @@ class UpdateIdClaimHandler {
|
|
|
2056
2056
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
2057
2057
|
|
|
2058
2058
|
class UpdateKeyClaimHandler {
|
|
2059
|
-
/**
|
|
2060
|
-
* @constructor
|
|
2061
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
2059
|
+
/**
|
|
2060
|
+
* @constructor
|
|
2061
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
2062
2062
|
*/
|
|
2063
2063
|
constructor(formFieldRegistry) {
|
|
2064
2064
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -2956,10 +2956,10 @@ class PaletteRenderer {
|
|
|
2956
2956
|
});
|
|
2957
2957
|
}
|
|
2958
2958
|
|
|
2959
|
-
/**
|
|
2960
|
-
* Attach the palette to a parent node.
|
|
2961
|
-
*
|
|
2962
|
-
* @param {HTMLElement} container
|
|
2959
|
+
/**
|
|
2960
|
+
* Attach the palette to a parent node.
|
|
2961
|
+
*
|
|
2962
|
+
* @param {HTMLElement} container
|
|
2963
2963
|
*/
|
|
2964
2964
|
attachTo(container) {
|
|
2965
2965
|
if (!container) {
|
|
@@ -2979,8 +2979,8 @@ class PaletteRenderer {
|
|
|
2979
2979
|
this._eventBus.fire('palette.attach');
|
|
2980
2980
|
}
|
|
2981
2981
|
|
|
2982
|
-
/**
|
|
2983
|
-
* Detach the palette from its parent node.
|
|
2982
|
+
/**
|
|
2983
|
+
* Detach the palette from its parent node.
|
|
2984
2984
|
*/
|
|
2985
2985
|
detach() {
|
|
2986
2986
|
const parentNode = this._container.parentNode;
|
|
@@ -5117,11 +5117,11 @@ function prefixId$1(id) {
|
|
|
5117
5117
|
return `bio-properties-panel-${id}`;
|
|
5118
5118
|
}
|
|
5119
5119
|
|
|
5120
|
-
/**
|
|
5121
|
-
* @param {string} type
|
|
5122
|
-
* @param {boolean} [strict]
|
|
5123
|
-
*
|
|
5124
|
-
* @returns {any}
|
|
5120
|
+
/**
|
|
5121
|
+
* @param {string} type
|
|
5122
|
+
* @param {boolean} [strict]
|
|
5123
|
+
*
|
|
5124
|
+
* @returns {any}
|
|
5125
5125
|
*/
|
|
5126
5126
|
function getService(type, strict) {}
|
|
5127
5127
|
const PropertiesPanelContext = createContext({
|
|
@@ -5209,8 +5209,8 @@ const PropertiesPanelHeaderProvider = {
|
|
|
5209
5209
|
}
|
|
5210
5210
|
};
|
|
5211
5211
|
|
|
5212
|
-
/**
|
|
5213
|
-
* Provide placeholders for empty and multiple state.
|
|
5212
|
+
/**
|
|
5213
|
+
* Provide placeholders for empty and multiple state.
|
|
5214
5214
|
*/
|
|
5215
5215
|
const PropertiesPanelPlaceholderProvider = {
|
|
5216
5216
|
getEmpty: () => {
|
|
@@ -5282,10 +5282,10 @@ function useService (type, strict) {
|
|
|
5282
5282
|
return getService(type, strict);
|
|
5283
5283
|
}
|
|
5284
5284
|
|
|
5285
|
-
/**
|
|
5286
|
-
* Retrieve list of variables from the form schema.
|
|
5287
|
-
*
|
|
5288
|
-
* @returns { string[] } list of variables used in form schema
|
|
5285
|
+
/**
|
|
5286
|
+
* Retrieve list of variables from the form schema.
|
|
5287
|
+
*
|
|
5288
|
+
* @returns { string[] } list of variables used in form schema
|
|
5289
5289
|
*/
|
|
5290
5290
|
function useVariables() {
|
|
5291
5291
|
const form = useService('formEditor');
|
|
@@ -6570,14 +6570,14 @@ function Value(props) {
|
|
|
6570
6570
|
|
|
6571
6571
|
// helpers //////////
|
|
6572
6572
|
|
|
6573
|
-
/**
|
|
6574
|
-
* Returns copy of object with updated value.
|
|
6575
|
-
*
|
|
6576
|
-
* @param {Object} properties
|
|
6577
|
-
* @param {string} key
|
|
6578
|
-
* @param {string} value
|
|
6579
|
-
*
|
|
6580
|
-
* @returns {Object}
|
|
6573
|
+
/**
|
|
6574
|
+
* Returns copy of object with updated value.
|
|
6575
|
+
*
|
|
6576
|
+
* @param {Object} properties
|
|
6577
|
+
* @param {string} key
|
|
6578
|
+
* @param {string} value
|
|
6579
|
+
*
|
|
6580
|
+
* @returns {Object}
|
|
6581
6581
|
*/
|
|
6582
6582
|
function updateValue(properties, key, value) {
|
|
6583
6583
|
return {
|
|
@@ -6586,14 +6586,14 @@ function updateValue(properties, key, value) {
|
|
|
6586
6586
|
};
|
|
6587
6587
|
}
|
|
6588
6588
|
|
|
6589
|
-
/**
|
|
6590
|
-
* Returns copy of object with updated key.
|
|
6591
|
-
*
|
|
6592
|
-
* @param {Object} properties
|
|
6593
|
-
* @param {string} oldKey
|
|
6594
|
-
* @param {string} newKey
|
|
6595
|
-
*
|
|
6596
|
-
* @returns {Object}
|
|
6589
|
+
/**
|
|
6590
|
+
* Returns copy of object with updated key.
|
|
6591
|
+
*
|
|
6592
|
+
* @param {Object} properties
|
|
6593
|
+
* @param {string} oldKey
|
|
6594
|
+
* @param {string} newKey
|
|
6595
|
+
*
|
|
6596
|
+
* @returns {Object}
|
|
6597
6597
|
*/
|
|
6598
6598
|
function updateKey(properties, oldKey, newKey) {
|
|
6599
6599
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -7218,8 +7218,8 @@ function ValuesGroups(field, editField) {
|
|
|
7218
7218
|
};
|
|
7219
7219
|
const valuesSourceId = `${fieldId}-valuesSource`;
|
|
7220
7220
|
|
|
7221
|
-
/**
|
|
7222
|
-
* @type {Array<Group|ListGroup>}
|
|
7221
|
+
/**
|
|
7222
|
+
* @type {Array<Group|ListGroup>}
|
|
7223
7223
|
*/
|
|
7224
7224
|
const groups = [{
|
|
7225
7225
|
id: valuesSourceId,
|
|
@@ -7320,13 +7320,13 @@ function CustomValuesGroup(field, editField) {
|
|
|
7320
7320
|
|
|
7321
7321
|
// helpers //////////
|
|
7322
7322
|
|
|
7323
|
-
/**
|
|
7324
|
-
* Returns copy of object without key.
|
|
7325
|
-
*
|
|
7326
|
-
* @param {Object} properties
|
|
7327
|
-
* @param {string} oldKey
|
|
7328
|
-
*
|
|
7329
|
-
* @returns {Object}
|
|
7323
|
+
/**
|
|
7324
|
+
* Returns copy of object without key.
|
|
7325
|
+
*
|
|
7326
|
+
* @param {Object} properties
|
|
7327
|
+
* @param {string} oldKey
|
|
7328
|
+
*
|
|
7329
|
+
* @returns {Object}
|
|
7330
7330
|
*/
|
|
7331
7331
|
function removeKey(properties, oldKey) {
|
|
7332
7332
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -7419,9 +7419,9 @@ function FormPropertiesPanel(props) {
|
|
|
7419
7419
|
}, []);
|
|
7420
7420
|
useLayoutEffect(() => {
|
|
7421
7421
|
const onFieldChanged = () => {
|
|
7422
|
-
/**
|
|
7423
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
7424
|
-
* once we have a proper updater/change support
|
|
7422
|
+
/**
|
|
7423
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
7424
|
+
* once we have a proper updater/change support
|
|
7425
7425
|
*/
|
|
7426
7426
|
_update(selection.get() || schema);
|
|
7427
7427
|
};
|
|
@@ -7473,10 +7473,10 @@ class PropertiesPanelRenderer {
|
|
|
7473
7473
|
});
|
|
7474
7474
|
}
|
|
7475
7475
|
|
|
7476
|
-
/**
|
|
7477
|
-
* Attach the properties panel to a parent node.
|
|
7478
|
-
*
|
|
7479
|
-
* @param {HTMLElement} container
|
|
7476
|
+
/**
|
|
7477
|
+
* Attach the properties panel to a parent node.
|
|
7478
|
+
*
|
|
7479
|
+
* @param {HTMLElement} container
|
|
7480
7480
|
*/
|
|
7481
7481
|
attachTo(container) {
|
|
7482
7482
|
if (!container) {
|
|
@@ -7496,8 +7496,8 @@ class PropertiesPanelRenderer {
|
|
|
7496
7496
|
this._eventBus.fire('propertiesPanel.attach');
|
|
7497
7497
|
}
|
|
7498
7498
|
|
|
7499
|
-
/**
|
|
7500
|
-
* Detach the properties panel from its parent node.
|
|
7499
|
+
/**
|
|
7500
|
+
* Detach the properties panel from its parent node.
|
|
7501
7501
|
*/
|
|
7502
7502
|
detach() {
|
|
7503
7503
|
const parentNode = this._container.parentNode;
|
|
@@ -7529,48 +7529,48 @@ var PropertiesPanelModule = {
|
|
|
7529
7529
|
|
|
7530
7530
|
const ids = new Ids([32, 36, 1]);
|
|
7531
7531
|
|
|
7532
|
-
/**
|
|
7533
|
-
* @typedef { import('./types').Injector } Injector
|
|
7534
|
-
* @typedef { import('./types').Module } Module
|
|
7535
|
-
* @typedef { import('./types').Schema } Schema
|
|
7536
|
-
*
|
|
7537
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
7538
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
7539
|
-
*
|
|
7540
|
-
* @typedef { {
|
|
7541
|
-
* properties: FormEditorProperties,
|
|
7542
|
-
* schema: Schema
|
|
7543
|
-
* } } State
|
|
7544
|
-
*
|
|
7545
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
7546
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
7547
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
7532
|
+
/**
|
|
7533
|
+
* @typedef { import('./types').Injector } Injector
|
|
7534
|
+
* @typedef { import('./types').Module } Module
|
|
7535
|
+
* @typedef { import('./types').Schema } Schema
|
|
7536
|
+
*
|
|
7537
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
7538
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
7539
|
+
*
|
|
7540
|
+
* @typedef { {
|
|
7541
|
+
* properties: FormEditorProperties,
|
|
7542
|
+
* schema: Schema
|
|
7543
|
+
* } } State
|
|
7544
|
+
*
|
|
7545
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
7546
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
7547
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
7548
7548
|
*/
|
|
7549
7549
|
|
|
7550
|
-
/**
|
|
7551
|
-
* The form editor.
|
|
7550
|
+
/**
|
|
7551
|
+
* The form editor.
|
|
7552
7552
|
*/
|
|
7553
7553
|
class FormEditor {
|
|
7554
|
-
/**
|
|
7555
|
-
* @constructor
|
|
7556
|
-
* @param {FormEditorOptions} options
|
|
7554
|
+
/**
|
|
7555
|
+
* @constructor
|
|
7556
|
+
* @param {FormEditorOptions} options
|
|
7557
7557
|
*/
|
|
7558
7558
|
constructor(options = {}) {
|
|
7559
|
-
/**
|
|
7560
|
-
* @public
|
|
7561
|
-
* @type {OnEventType}
|
|
7559
|
+
/**
|
|
7560
|
+
* @public
|
|
7561
|
+
* @type {OnEventType}
|
|
7562
7562
|
*/
|
|
7563
7563
|
this.on = this._onEvent;
|
|
7564
7564
|
|
|
7565
|
-
/**
|
|
7566
|
-
* @public
|
|
7567
|
-
* @type {String}
|
|
7565
|
+
/**
|
|
7566
|
+
* @public
|
|
7567
|
+
* @type {String}
|
|
7568
7568
|
*/
|
|
7569
7569
|
this._id = ids.next();
|
|
7570
7570
|
|
|
7571
|
-
/**
|
|
7572
|
-
* @private
|
|
7573
|
-
* @type {Element}
|
|
7571
|
+
/**
|
|
7572
|
+
* @private
|
|
7573
|
+
* @type {Element}
|
|
7574
7574
|
*/
|
|
7575
7575
|
this._container = createFormContainer();
|
|
7576
7576
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -7581,15 +7581,15 @@ class FormEditor {
|
|
|
7581
7581
|
properties = {}
|
|
7582
7582
|
} = options;
|
|
7583
7583
|
|
|
7584
|
-
/**
|
|
7585
|
-
* @private
|
|
7586
|
-
* @type {any}
|
|
7584
|
+
/**
|
|
7585
|
+
* @private
|
|
7586
|
+
* @type {any}
|
|
7587
7587
|
*/
|
|
7588
7588
|
this.exporter = exporter;
|
|
7589
7589
|
|
|
7590
|
-
/**
|
|
7591
|
-
* @private
|
|
7592
|
-
* @type {State}
|
|
7590
|
+
/**
|
|
7591
|
+
* @private
|
|
7592
|
+
* @type {State}
|
|
7593
7593
|
*/
|
|
7594
7594
|
this._state = {
|
|
7595
7595
|
properties,
|
|
@@ -7618,10 +7618,10 @@ class FormEditor {
|
|
|
7618
7618
|
this._detach(false);
|
|
7619
7619
|
}
|
|
7620
7620
|
|
|
7621
|
-
/**
|
|
7622
|
-
* @param {Schema} schema
|
|
7623
|
-
*
|
|
7624
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
7621
|
+
/**
|
|
7622
|
+
* @param {Schema} schema
|
|
7623
|
+
*
|
|
7624
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
7625
7625
|
*/
|
|
7626
7626
|
importSchema(schema) {
|
|
7627
7627
|
return new Promise((resolve, reject) => {
|
|
@@ -7650,15 +7650,15 @@ class FormEditor {
|
|
|
7650
7650
|
});
|
|
7651
7651
|
}
|
|
7652
7652
|
|
|
7653
|
-
/**
|
|
7654
|
-
* @returns {Schema}
|
|
7653
|
+
/**
|
|
7654
|
+
* @returns {Schema}
|
|
7655
7655
|
*/
|
|
7656
7656
|
saveSchema() {
|
|
7657
7657
|
return this.getSchema();
|
|
7658
7658
|
}
|
|
7659
7659
|
|
|
7660
|
-
/**
|
|
7661
|
-
* @returns {Schema}
|
|
7660
|
+
/**
|
|
7661
|
+
* @returns {Schema}
|
|
7662
7662
|
*/
|
|
7663
7663
|
getSchema() {
|
|
7664
7664
|
const {
|
|
@@ -7667,8 +7667,8 @@ class FormEditor {
|
|
|
7667
7667
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
7668
7668
|
}
|
|
7669
7669
|
|
|
7670
|
-
/**
|
|
7671
|
-
* @param {Element|string} parentNode
|
|
7670
|
+
/**
|
|
7671
|
+
* @param {Element|string} parentNode
|
|
7672
7672
|
*/
|
|
7673
7673
|
attachTo(parentNode) {
|
|
7674
7674
|
if (!parentNode) {
|
|
@@ -7686,10 +7686,10 @@ class FormEditor {
|
|
|
7686
7686
|
this._detach();
|
|
7687
7687
|
}
|
|
7688
7688
|
|
|
7689
|
-
/**
|
|
7690
|
-
* @internal
|
|
7691
|
-
*
|
|
7692
|
-
* @param {boolean} [emit]
|
|
7689
|
+
/**
|
|
7690
|
+
* @internal
|
|
7691
|
+
*
|
|
7692
|
+
* @param {boolean} [emit]
|
|
7693
7693
|
*/
|
|
7694
7694
|
_detach(emit = true) {
|
|
7695
7695
|
const container = this._container,
|
|
@@ -7703,9 +7703,9 @@ class FormEditor {
|
|
|
7703
7703
|
parentNode.removeChild(container);
|
|
7704
7704
|
}
|
|
7705
7705
|
|
|
7706
|
-
/**
|
|
7707
|
-
* @param {any} property
|
|
7708
|
-
* @param {any} value
|
|
7706
|
+
/**
|
|
7707
|
+
* @param {any} property
|
|
7708
|
+
* @param {any} value
|
|
7709
7709
|
*/
|
|
7710
7710
|
setProperty(property, value) {
|
|
7711
7711
|
const properties = set(this._getState().properties, [property], value);
|
|
@@ -7714,21 +7714,21 @@ class FormEditor {
|
|
|
7714
7714
|
});
|
|
7715
7715
|
}
|
|
7716
7716
|
|
|
7717
|
-
/**
|
|
7718
|
-
* @param {string} type
|
|
7719
|
-
* @param {Function} handler
|
|
7717
|
+
/**
|
|
7718
|
+
* @param {string} type
|
|
7719
|
+
* @param {Function} handler
|
|
7720
7720
|
*/
|
|
7721
7721
|
off(type, handler) {
|
|
7722
7722
|
this.get('eventBus').off(type, handler);
|
|
7723
7723
|
}
|
|
7724
7724
|
|
|
7725
|
-
/**
|
|
7726
|
-
* @internal
|
|
7727
|
-
*
|
|
7728
|
-
* @param {FormEditorOptions} options
|
|
7729
|
-
* @param {Element} container
|
|
7730
|
-
*
|
|
7731
|
-
* @returns {Injector}
|
|
7725
|
+
/**
|
|
7726
|
+
* @internal
|
|
7727
|
+
*
|
|
7728
|
+
* @param {FormEditorOptions} options
|
|
7729
|
+
* @param {Element} container
|
|
7730
|
+
*
|
|
7731
|
+
* @returns {Injector}
|
|
7732
7732
|
*/
|
|
7733
7733
|
_createInjector(options, container) {
|
|
7734
7734
|
const {
|
|
@@ -7750,22 +7750,22 @@ class FormEditor {
|
|
|
7750
7750
|
}, core, ...modules, ...additionalModules]);
|
|
7751
7751
|
}
|
|
7752
7752
|
|
|
7753
|
-
/**
|
|
7754
|
-
* @internal
|
|
7753
|
+
/**
|
|
7754
|
+
* @internal
|
|
7755
7755
|
*/
|
|
7756
7756
|
_emit(type, data) {
|
|
7757
7757
|
this.get('eventBus').fire(type, data);
|
|
7758
7758
|
}
|
|
7759
7759
|
|
|
7760
|
-
/**
|
|
7761
|
-
* @internal
|
|
7760
|
+
/**
|
|
7761
|
+
* @internal
|
|
7762
7762
|
*/
|
|
7763
7763
|
_getState() {
|
|
7764
7764
|
return this._state;
|
|
7765
7765
|
}
|
|
7766
7766
|
|
|
7767
|
-
/**
|
|
7768
|
-
* @internal
|
|
7767
|
+
/**
|
|
7768
|
+
* @internal
|
|
7769
7769
|
*/
|
|
7770
7770
|
_setState(state) {
|
|
7771
7771
|
this._state = {
|
|
@@ -7775,15 +7775,15 @@ class FormEditor {
|
|
|
7775
7775
|
this._emit('changed', this._getState());
|
|
7776
7776
|
}
|
|
7777
7777
|
|
|
7778
|
-
/**
|
|
7779
|
-
* @internal
|
|
7778
|
+
/**
|
|
7779
|
+
* @internal
|
|
7780
7780
|
*/
|
|
7781
7781
|
_getModules() {
|
|
7782
7782
|
return [ModelingModule, EditorActionsModule, KeyboardModule, SelectionModule, PaletteModule, PropertiesPanelModule];
|
|
7783
7783
|
}
|
|
7784
7784
|
|
|
7785
|
-
/**
|
|
7786
|
-
* @internal
|
|
7785
|
+
/**
|
|
7786
|
+
* @internal
|
|
7787
7787
|
*/
|
|
7788
7788
|
_onEvent(type, priority, handler) {
|
|
7789
7789
|
this.get('eventBus').on(type, priority, handler);
|