@bpmn-io/form-js-editor 1.3.1 → 1.3.2
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 +116 -116
- package/dist/assets/form-js-editor-base.css +797 -797
- package/dist/index.cjs +284 -287
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +284 -287
- package/dist/index.es.js.map +1 -1
- package/dist/types/features/properties-panel/entries/InputKeyValuesSourceEntry.d.ts +0 -2
- package/dist/types/features/properties-panel/entries/ValuesExpressionEntry.d.ts +0 -1
- package/dist/types/types.d.ts +28 -28
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -537,10 +537,10 @@ function invokeFunction(fn, args) {
|
|
|
537
537
|
return fn.apply(null, args);
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
/**
|
|
541
|
-
* A factory to create a configurable debouncer.
|
|
542
|
-
*
|
|
543
|
-
* @param {number|boolean} [config=true]
|
|
540
|
+
/**
|
|
541
|
+
* A factory to create a configurable debouncer.
|
|
542
|
+
*
|
|
543
|
+
* @param {number|boolean} [config=true]
|
|
544
544
|
*/
|
|
545
545
|
function DebounceFactory(config = true) {
|
|
546
546
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -553,11 +553,11 @@ function DebounceFactory(config = true) {
|
|
|
553
553
|
DebounceFactory.$inject = ['config.debounce'];
|
|
554
554
|
|
|
555
555
|
class FormFieldRegistry extends formJsViewer.FormFieldRegistry {
|
|
556
|
-
/**
|
|
557
|
-
* Updates a form fields id.
|
|
558
|
-
*
|
|
559
|
-
* @param {Object} formField
|
|
560
|
-
* @param {string} newId
|
|
556
|
+
/**
|
|
557
|
+
* Updates a form fields id.
|
|
558
|
+
*
|
|
559
|
+
* @param {Object} formField
|
|
560
|
+
* @param {string} newId
|
|
561
561
|
*/
|
|
562
562
|
updateId(formField, newId) {
|
|
563
563
|
this._validateId(newId);
|
|
@@ -578,13 +578,13 @@ class FormFieldRegistry extends formJsViewer.FormFieldRegistry {
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
/**
|
|
582
|
-
* Validate the suitability of the given id and signals a problem
|
|
583
|
-
* with an exception.
|
|
584
|
-
*
|
|
585
|
-
* @param {string} id
|
|
586
|
-
*
|
|
587
|
-
* @throws {Error} if id is empty or already assigned
|
|
581
|
+
/**
|
|
582
|
+
* Validate the suitability of the given id and signals a problem
|
|
583
|
+
* with an exception.
|
|
584
|
+
*
|
|
585
|
+
* @param {string} id
|
|
586
|
+
*
|
|
587
|
+
* @throws {Error} if id is empty or already assigned
|
|
588
588
|
*/
|
|
589
589
|
_validateId(id) {
|
|
590
590
|
if (!id) {
|
|
@@ -601,11 +601,11 @@ const MAX_COLUMNS = 16;
|
|
|
601
601
|
const MIN_COLUMNS = 2;
|
|
602
602
|
const MAX_FIELDS_PER_ROW = 4;
|
|
603
603
|
class FormLayoutValidator {
|
|
604
|
-
/**
|
|
605
|
-
* @constructor
|
|
606
|
-
*
|
|
607
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
608
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
604
|
+
/**
|
|
605
|
+
* @constructor
|
|
606
|
+
*
|
|
607
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
608
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
609
609
|
*/
|
|
610
610
|
constructor(formLayouter, formFieldRegistry) {
|
|
611
611
|
this._formLayouter = formLayouter;
|
|
@@ -676,21 +676,21 @@ function editorFormFieldClasses(type, {
|
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
-
/**
|
|
680
|
-
* Add a dragger that calls back the passed function with
|
|
681
|
-
* { event, delta } on drag.
|
|
682
|
-
*
|
|
683
|
-
* @example
|
|
684
|
-
*
|
|
685
|
-
* function dragMove(event, delta) {
|
|
686
|
-
* // we are dragging (!!)
|
|
687
|
-
* }
|
|
688
|
-
*
|
|
689
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
690
|
-
*
|
|
691
|
-
* @param {Function} fn
|
|
692
|
-
*
|
|
693
|
-
* @return {Function} drag start callback function
|
|
679
|
+
/**
|
|
680
|
+
* Add a dragger that calls back the passed function with
|
|
681
|
+
* { event, delta } on drag.
|
|
682
|
+
*
|
|
683
|
+
* @example
|
|
684
|
+
*
|
|
685
|
+
* function dragMove(event, delta) {
|
|
686
|
+
* // we are dragging (!!)
|
|
687
|
+
* }
|
|
688
|
+
*
|
|
689
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
690
|
+
*
|
|
691
|
+
* @param {Function} fn
|
|
692
|
+
*
|
|
693
|
+
* @return {Function} drag start callback function
|
|
694
694
|
*/
|
|
695
695
|
function createDragger$1(fn) {
|
|
696
696
|
let self;
|
|
@@ -731,12 +731,12 @@ function createDragger$1(fn) {
|
|
|
731
731
|
return onDragStart;
|
|
732
732
|
}
|
|
733
733
|
|
|
734
|
-
/**
|
|
735
|
-
* Throttle function call according UI update cycle.
|
|
736
|
-
*
|
|
737
|
-
* @param {Function} fn
|
|
738
|
-
*
|
|
739
|
-
* @return {Function} throttled fn
|
|
734
|
+
/**
|
|
735
|
+
* Throttle function call according UI update cycle.
|
|
736
|
+
*
|
|
737
|
+
* @param {Function} fn
|
|
738
|
+
*
|
|
739
|
+
* @return {Function} throttled fn
|
|
740
740
|
*/
|
|
741
741
|
function throttle(fn) {
|
|
742
742
|
let active = false;
|
|
@@ -770,11 +770,11 @@ const DragAndDropContext = preact.createContext({
|
|
|
770
770
|
});
|
|
771
771
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
772
772
|
|
|
773
|
-
/**
|
|
774
|
-
* @param {string} type
|
|
775
|
-
* @param {boolean} [strict]
|
|
776
|
-
*
|
|
777
|
-
* @returns {any}
|
|
773
|
+
/**
|
|
774
|
+
* @param {string} type
|
|
775
|
+
* @param {boolean} [strict]
|
|
776
|
+
*
|
|
777
|
+
* @returns {any}
|
|
778
778
|
*/
|
|
779
779
|
function getService$1(type, strict) {}
|
|
780
780
|
const FormEditorContext = preact.createContext({
|
|
@@ -1124,23 +1124,23 @@ var Slot = (props => {
|
|
|
1124
1124
|
return fillsAndSeparators;
|
|
1125
1125
|
});
|
|
1126
1126
|
|
|
1127
|
-
/**
|
|
1128
|
-
* Creates a Fragment for a fill.
|
|
1129
|
-
*
|
|
1130
|
-
* @param {Object} fill Fill to be rendered
|
|
1131
|
-
* @returns {Object} Preact Fragment containing fill's children
|
|
1127
|
+
/**
|
|
1128
|
+
* Creates a Fragment for a fill.
|
|
1129
|
+
*
|
|
1130
|
+
* @param {Object} fill Fill to be rendered
|
|
1131
|
+
* @returns {Object} Preact Fragment containing fill's children
|
|
1132
1132
|
*/
|
|
1133
1133
|
const FillFragment = fill => jsxRuntime.jsx(preact.Fragment, {
|
|
1134
1134
|
children: fill.children
|
|
1135
1135
|
}, fill.id);
|
|
1136
1136
|
|
|
1137
|
-
/**
|
|
1138
|
-
* Creates an array of fills, with separators inserted between groups.
|
|
1139
|
-
*
|
|
1140
|
-
* @param {Array} groups Groups of fills
|
|
1141
|
-
* @param {Function} fillRenderer Function to create a fill
|
|
1142
|
-
* @param {Function} separatorRenderer Function to create a separator
|
|
1143
|
-
* @returns {Array} Array of fills and separators
|
|
1137
|
+
/**
|
|
1138
|
+
* Creates an array of fills, with separators inserted between groups.
|
|
1139
|
+
*
|
|
1140
|
+
* @param {Array} groups Groups of fills
|
|
1141
|
+
* @param {Function} fillRenderer Function to create a fill
|
|
1142
|
+
* @param {Function} separatorRenderer Function to create a separator
|
|
1143
|
+
* @returns {Array} Array of fills and separators
|
|
1144
1144
|
*/
|
|
1145
1145
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
1146
1146
|
const result = [];
|
|
@@ -1158,8 +1158,8 @@ const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
|
1158
1158
|
return result;
|
|
1159
1159
|
};
|
|
1160
1160
|
|
|
1161
|
-
/**
|
|
1162
|
-
* Groups fills by group name property.
|
|
1161
|
+
/**
|
|
1162
|
+
* Groups fills by group name property.
|
|
1163
1163
|
*/
|
|
1164
1164
|
const _groupByGroupName = fills => {
|
|
1165
1165
|
const groups = [];
|
|
@@ -1179,8 +1179,8 @@ const _groupByGroupName = fills => {
|
|
|
1179
1179
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
1180
1180
|
};
|
|
1181
1181
|
|
|
1182
|
-
/**
|
|
1183
|
-
* Compares fills by priority.
|
|
1182
|
+
/**
|
|
1183
|
+
* Compares fills by priority.
|
|
1184
1184
|
*/
|
|
1185
1185
|
const _comparePriority = (a, b) => {
|
|
1186
1186
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -1408,20 +1408,20 @@ const DRAG_NO_DROP_CLS = 'fjs-no-drop';
|
|
|
1408
1408
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
1409
1409
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
1410
1410
|
|
|
1411
|
-
/**
|
|
1412
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1411
|
+
/**
|
|
1412
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1413
1413
|
*/
|
|
1414
1414
|
|
|
1415
1415
|
class Dragging {
|
|
1416
|
-
/**
|
|
1417
|
-
* @constructor
|
|
1418
|
-
*
|
|
1419
|
-
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1420
|
-
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1421
|
-
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1422
|
-
* @param { import('../../core/EventBus').default } eventBus
|
|
1423
|
-
* @param { import('../modeling/Modeling').default } modeling
|
|
1424
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
1416
|
+
/**
|
|
1417
|
+
* @constructor
|
|
1418
|
+
*
|
|
1419
|
+
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1420
|
+
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1421
|
+
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1422
|
+
* @param { import('../../core/EventBus').default } eventBus
|
|
1423
|
+
* @param { import('../modeling/Modeling').default } modeling
|
|
1424
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
1425
1425
|
*/
|
|
1426
1426
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling, pathRegistry) {
|
|
1427
1427
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -1432,13 +1432,13 @@ class Dragging {
|
|
|
1432
1432
|
this._pathRegistry = pathRegistry;
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
|
-
/**
|
|
1436
|
-
* Calculcates position in form schema given the dropped place.
|
|
1437
|
-
*
|
|
1438
|
-
* @param { FormRow } targetRow
|
|
1439
|
-
* @param { any } targetFormField
|
|
1440
|
-
* @param { HTMLElement } sibling
|
|
1441
|
-
* @returns { number }
|
|
1435
|
+
/**
|
|
1436
|
+
* Calculcates position in form schema given the dropped place.
|
|
1437
|
+
*
|
|
1438
|
+
* @param { FormRow } targetRow
|
|
1439
|
+
* @param { any } targetFormField
|
|
1440
|
+
* @param { HTMLElement } sibling
|
|
1441
|
+
* @returns { number }
|
|
1442
1442
|
*/
|
|
1443
1443
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
1444
1444
|
/** @type HTMLElement */
|
|
@@ -1579,8 +1579,8 @@ class Dragging {
|
|
|
1579
1579
|
}
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
-
/**
|
|
1583
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1582
|
+
/**
|
|
1583
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1584
1584
|
*/
|
|
1585
1585
|
createDragulaInstance(options) {
|
|
1586
1586
|
const {
|
|
@@ -1994,7 +1994,7 @@ function DebugColumns(props) {
|
|
|
1994
1994
|
return null;
|
|
1995
1995
|
}
|
|
1996
1996
|
return jsxRuntime.jsx("div", {
|
|
1997
|
-
style: "width: fit-content
|
|
1997
|
+
style: "width: fit-content;\r padding: 2px 6px;\r height: 16px;\r background: var(--color-blue-205-100-95);\r display: flex;\r justify-content: center;\r align-items: center;\r position: absolute;\r bottom: -2px;\r z-index: 2;\r font-size: 10px;\r right: 3px;",
|
|
1998
1998
|
class: "fjs-debug-columns",
|
|
1999
1999
|
children: (field.layout || {}).columns || 'auto'
|
|
2000
2000
|
});
|
|
@@ -3065,10 +3065,10 @@ function updateRow(formField, rowId) {
|
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
3067
|
class AddFormFieldHandler {
|
|
3068
|
-
/**
|
|
3069
|
-
* @constructor
|
|
3070
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3071
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3068
|
+
/**
|
|
3069
|
+
* @constructor
|
|
3070
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3071
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3072
3072
|
*/
|
|
3073
3073
|
constructor(formEditor, formFieldRegistry) {
|
|
3074
3074
|
this._formEditor = formEditor;
|
|
@@ -3129,10 +3129,10 @@ class AddFormFieldHandler {
|
|
|
3129
3129
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3130
3130
|
|
|
3131
3131
|
class EditFormFieldHandler {
|
|
3132
|
-
/**
|
|
3133
|
-
* @constructor
|
|
3134
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3135
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3132
|
+
/**
|
|
3133
|
+
* @constructor
|
|
3134
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3135
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3136
3136
|
*/
|
|
3137
3137
|
constructor(formEditor, formFieldRegistry) {
|
|
3138
3138
|
this._formEditor = formEditor;
|
|
@@ -3195,11 +3195,11 @@ class EditFormFieldHandler {
|
|
|
3195
3195
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3196
3196
|
|
|
3197
3197
|
class MoveFormFieldHandler {
|
|
3198
|
-
/**
|
|
3199
|
-
* @constructor
|
|
3200
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3201
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3202
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3198
|
+
/**
|
|
3199
|
+
* @constructor
|
|
3200
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3201
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3202
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3203
3203
|
*/
|
|
3204
3204
|
constructor(formEditor, formFieldRegistry, pathRegistry) {
|
|
3205
3205
|
this._formEditor = formEditor;
|
|
@@ -3304,10 +3304,10 @@ class MoveFormFieldHandler {
|
|
|
3304
3304
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry', 'pathRegistry'];
|
|
3305
3305
|
|
|
3306
3306
|
class RemoveFormFieldHandler {
|
|
3307
|
-
/**
|
|
3308
|
-
* @constructor
|
|
3309
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3310
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3307
|
+
/**
|
|
3308
|
+
* @constructor
|
|
3309
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3310
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3311
3311
|
*/
|
|
3312
3312
|
constructor(formEditor, formFieldRegistry) {
|
|
3313
3313
|
this._formEditor = formEditor;
|
|
@@ -3367,9 +3367,9 @@ class RemoveFormFieldHandler {
|
|
|
3367
3367
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3368
3368
|
|
|
3369
3369
|
class UpdateIdClaimHandler {
|
|
3370
|
-
/**
|
|
3371
|
-
* @constructor
|
|
3372
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3370
|
+
/**
|
|
3371
|
+
* @constructor
|
|
3372
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3373
3373
|
*/
|
|
3374
3374
|
constructor(formFieldRegistry) {
|
|
3375
3375
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -3402,9 +3402,9 @@ class UpdateIdClaimHandler {
|
|
|
3402
3402
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
3403
3403
|
|
|
3404
3404
|
class UpdateKeyClaimHandler {
|
|
3405
|
-
/**
|
|
3406
|
-
* @constructor
|
|
3407
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3405
|
+
/**
|
|
3406
|
+
* @constructor
|
|
3407
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3408
3408
|
*/
|
|
3409
3409
|
constructor(pathRegistry) {
|
|
3410
3410
|
this._pathRegistry = pathRegistry;
|
|
@@ -3445,9 +3445,9 @@ class UpdateKeyClaimHandler {
|
|
|
3445
3445
|
UpdateKeyClaimHandler.$inject = ['pathRegistry'];
|
|
3446
3446
|
|
|
3447
3447
|
class UpdatePathClaimHandler {
|
|
3448
|
-
/**
|
|
3449
|
-
* @constructor
|
|
3450
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3448
|
+
/**
|
|
3449
|
+
* @constructor
|
|
3450
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3451
3451
|
*/
|
|
3452
3452
|
constructor(pathRegistry) {
|
|
3453
3453
|
this._pathRegistry = pathRegistry;
|
|
@@ -4009,8 +4009,8 @@ class ValidateBehavior extends CommandInterceptor {
|
|
|
4009
4009
|
constructor(eventBus) {
|
|
4010
4010
|
super(eventBus);
|
|
4011
4011
|
|
|
4012
|
-
/**
|
|
4013
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
4012
|
+
/**
|
|
4013
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
4014
4014
|
*/
|
|
4015
4015
|
this.preExecute('formField.edit', function (context) {
|
|
4016
4016
|
const {
|
|
@@ -4590,22 +4590,22 @@ var SelectionModule = {
|
|
|
4590
4590
|
selectionBehavior: ['type', SelectionBehavior]
|
|
4591
4591
|
};
|
|
4592
4592
|
|
|
4593
|
-
/**
|
|
4594
|
-
* Base class for sectionable UI modules.
|
|
4595
|
-
*
|
|
4596
|
-
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
4597
|
-
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
4598
|
-
*
|
|
4599
|
-
* @class SectionModuleBase
|
|
4593
|
+
/**
|
|
4594
|
+
* Base class for sectionable UI modules.
|
|
4595
|
+
*
|
|
4596
|
+
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
4597
|
+
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
4598
|
+
*
|
|
4599
|
+
* @class SectionModuleBase
|
|
4600
4600
|
*/
|
|
4601
4601
|
class SectionModuleBase {
|
|
4602
|
-
/**
|
|
4603
|
-
* Create a SectionModuleBase instance.
|
|
4604
|
-
*
|
|
4605
|
-
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
4606
|
-
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
4607
|
-
*
|
|
4608
|
-
* @constructor
|
|
4602
|
+
/**
|
|
4603
|
+
* Create a SectionModuleBase instance.
|
|
4604
|
+
*
|
|
4605
|
+
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
4606
|
+
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
4607
|
+
*
|
|
4608
|
+
* @constructor
|
|
4609
4609
|
*/
|
|
4610
4610
|
constructor(eventBus, sectionKey) {
|
|
4611
4611
|
this._eventBus = eventBus;
|
|
@@ -4618,10 +4618,10 @@ class SectionModuleBase {
|
|
|
4618
4618
|
});
|
|
4619
4619
|
}
|
|
4620
4620
|
|
|
4621
|
-
/**
|
|
4622
|
-
* Attach the managed section to a parent node.
|
|
4623
|
-
*
|
|
4624
|
-
* @param {HTMLElement} container - The parent node to attach to.
|
|
4621
|
+
/**
|
|
4622
|
+
* Attach the managed section to a parent node.
|
|
4623
|
+
*
|
|
4624
|
+
* @param {HTMLElement} container - The parent node to attach to.
|
|
4625
4625
|
*/
|
|
4626
4626
|
attachTo(container) {
|
|
4627
4627
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -4629,22 +4629,22 @@ class SectionModuleBase {
|
|
|
4629
4629
|
}));
|
|
4630
4630
|
}
|
|
4631
4631
|
|
|
4632
|
-
/**
|
|
4633
|
-
* Detach the managed section from its parent node.
|
|
4632
|
+
/**
|
|
4633
|
+
* Detach the managed section from its parent node.
|
|
4634
4634
|
*/
|
|
4635
4635
|
detach() {
|
|
4636
4636
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
4637
4637
|
}
|
|
4638
4638
|
|
|
4639
|
-
/**
|
|
4640
|
-
* Reset the managed section to its initial state.
|
|
4639
|
+
/**
|
|
4640
|
+
* Reset the managed section to its initial state.
|
|
4641
4641
|
*/
|
|
4642
4642
|
reset() {
|
|
4643
4643
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
4644
4644
|
}
|
|
4645
4645
|
|
|
4646
|
-
/**
|
|
4647
|
-
* Circumvents timing issues.
|
|
4646
|
+
/**
|
|
4647
|
+
* Circumvents timing issues.
|
|
4648
4648
|
*/
|
|
4649
4649
|
_onceSectionRendered(callback) {
|
|
4650
4650
|
if (this.isSectionRendered) {
|
|
@@ -8266,11 +8266,11 @@ var index = {
|
|
|
8266
8266
|
feelPopup: ['type', FeelPopupModule]
|
|
8267
8267
|
};
|
|
8268
8268
|
|
|
8269
|
-
/**
|
|
8270
|
-
* @param {string} type
|
|
8271
|
-
* @param {boolean} [strict]
|
|
8272
|
-
*
|
|
8273
|
-
* @returns {any}
|
|
8269
|
+
/**
|
|
8270
|
+
* @param {string} type
|
|
8271
|
+
* @param {boolean} [strict]
|
|
8272
|
+
*
|
|
8273
|
+
* @returns {any}
|
|
8274
8274
|
*/
|
|
8275
8275
|
function getService(type, strict) {}
|
|
8276
8276
|
const PropertiesPanelContext = preact.createContext({
|
|
@@ -8367,8 +8367,8 @@ const PropertiesPanelHeaderProvider = {
|
|
|
8367
8367
|
}
|
|
8368
8368
|
};
|
|
8369
8369
|
|
|
8370
|
-
/**
|
|
8371
|
-
* Provide placeholders for empty and multiple state.
|
|
8370
|
+
/**
|
|
8371
|
+
* Provide placeholders for empty and multiple state.
|
|
8372
8372
|
*/
|
|
8373
8373
|
const PropertiesPanelPlaceholderProvider = {
|
|
8374
8374
|
getEmpty: () => {
|
|
@@ -8440,10 +8440,10 @@ function useService (type, strict) {
|
|
|
8440
8440
|
return getService(type, strict);
|
|
8441
8441
|
}
|
|
8442
8442
|
|
|
8443
|
-
/**
|
|
8444
|
-
* Retrieve list of variables from the form schema.
|
|
8445
|
-
*
|
|
8446
|
-
* @returns { string[] } list of variables used in form schema
|
|
8443
|
+
/**
|
|
8444
|
+
* Retrieve list of variables from the form schema.
|
|
8445
|
+
*
|
|
8446
|
+
* @returns { string[] } list of variables used in form schema
|
|
8447
8447
|
*/
|
|
8448
8448
|
function useVariables() {
|
|
8449
8449
|
const form = useService('formEditor');
|
|
@@ -10094,14 +10094,14 @@ function Value(props) {
|
|
|
10094
10094
|
|
|
10095
10095
|
// helpers //////////
|
|
10096
10096
|
|
|
10097
|
-
/**
|
|
10098
|
-
* Returns copy of object with updated value.
|
|
10099
|
-
*
|
|
10100
|
-
* @param {Object} properties
|
|
10101
|
-
* @param {string} key
|
|
10102
|
-
* @param {string} value
|
|
10103
|
-
*
|
|
10104
|
-
* @returns {Object}
|
|
10097
|
+
/**
|
|
10098
|
+
* Returns copy of object with updated value.
|
|
10099
|
+
*
|
|
10100
|
+
* @param {Object} properties
|
|
10101
|
+
* @param {string} key
|
|
10102
|
+
* @param {string} value
|
|
10103
|
+
*
|
|
10104
|
+
* @returns {Object}
|
|
10105
10105
|
*/
|
|
10106
10106
|
function updateValue(properties, key, value) {
|
|
10107
10107
|
return {
|
|
@@ -10110,14 +10110,14 @@ function updateValue(properties, key, value) {
|
|
|
10110
10110
|
};
|
|
10111
10111
|
}
|
|
10112
10112
|
|
|
10113
|
-
/**
|
|
10114
|
-
* Returns copy of object with updated key.
|
|
10115
|
-
*
|
|
10116
|
-
* @param {Object} properties
|
|
10117
|
-
* @param {string} oldKey
|
|
10118
|
-
* @param {string} newKey
|
|
10119
|
-
*
|
|
10120
|
-
* @returns {Object}
|
|
10113
|
+
/**
|
|
10114
|
+
* Returns copy of object with updated key.
|
|
10115
|
+
*
|
|
10116
|
+
* @param {Object} properties
|
|
10117
|
+
* @param {string} oldKey
|
|
10118
|
+
* @param {string} newKey
|
|
10119
|
+
*
|
|
10120
|
+
* @returns {Object}
|
|
10121
10121
|
*/
|
|
10122
10122
|
function updateKey(properties, oldKey, newKey) {
|
|
10123
10123
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -10226,19 +10226,9 @@ function InputKeyValuesSourceEntry(props) {
|
|
|
10226
10226
|
field,
|
|
10227
10227
|
id
|
|
10228
10228
|
} = props;
|
|
10229
|
-
const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
|
|
10230
|
-
const description = jsxRuntime.jsxs("div", {
|
|
10231
|
-
children: ["Define which input property to populate the values from.", jsxRuntime.jsx("br", {}), jsxRuntime.jsx("br", {}), "The input property may be an array of simple values or alternatively follow this schema:", jsxRuntime.jsx("pre", {
|
|
10232
|
-
children: jsxRuntime.jsx("code", {
|
|
10233
|
-
children: schema
|
|
10234
|
-
})
|
|
10235
|
-
})]
|
|
10236
|
-
});
|
|
10237
10229
|
return [{
|
|
10238
10230
|
id: id + '-key',
|
|
10239
10231
|
component: InputValuesKey,
|
|
10240
|
-
label: 'Input values key',
|
|
10241
|
-
description,
|
|
10242
10232
|
isEdited: isEdited,
|
|
10243
10233
|
editField,
|
|
10244
10234
|
field
|
|
@@ -10248,12 +10238,18 @@ function InputValuesKey(props) {
|
|
|
10248
10238
|
const {
|
|
10249
10239
|
editField,
|
|
10250
10240
|
field,
|
|
10251
|
-
id
|
|
10252
|
-
label,
|
|
10253
|
-
description
|
|
10241
|
+
id
|
|
10254
10242
|
} = props;
|
|
10255
10243
|
const debounce = useService('debounce');
|
|
10256
10244
|
const path = formJsViewer.VALUES_SOURCES_PATHS[formJsViewer.VALUES_SOURCES.INPUT];
|
|
10245
|
+
const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
|
|
10246
|
+
const tooltip = jsxRuntime.jsxs("div", {
|
|
10247
|
+
children: ["The input property may be an array of simple values or alternatively follow this schema:", jsxRuntime.jsx("pre", {
|
|
10248
|
+
children: jsxRuntime.jsx("code", {
|
|
10249
|
+
children: schema
|
|
10250
|
+
})
|
|
10251
|
+
})]
|
|
10252
|
+
});
|
|
10257
10253
|
const getValue = () => minDash.get(field, path, '');
|
|
10258
10254
|
const setValue = (value, error) => {
|
|
10259
10255
|
if (error) {
|
|
@@ -10272,11 +10268,12 @@ function InputValuesKey(props) {
|
|
|
10272
10268
|
};
|
|
10273
10269
|
return TextfieldEntry({
|
|
10274
10270
|
debounce,
|
|
10275
|
-
description,
|
|
10271
|
+
description: 'Define which input property to populate the values from',
|
|
10272
|
+
tooltip,
|
|
10276
10273
|
element: field,
|
|
10277
10274
|
getValue,
|
|
10278
10275
|
id,
|
|
10279
|
-
label,
|
|
10276
|
+
label: 'Input values key',
|
|
10280
10277
|
setValue,
|
|
10281
10278
|
validate
|
|
10282
10279
|
});
|
|
@@ -10552,7 +10549,6 @@ function ValuesExpressionEntry(props) {
|
|
|
10552
10549
|
return [{
|
|
10553
10550
|
id: id + '-expression',
|
|
10554
10551
|
component: ValuesExpression,
|
|
10555
|
-
label: 'Values expression',
|
|
10556
10552
|
isEdited: isEdited$6,
|
|
10557
10553
|
editField,
|
|
10558
10554
|
field
|
|
@@ -10570,8 +10566,8 @@ function ValuesExpression(props) {
|
|
|
10570
10566
|
}));
|
|
10571
10567
|
const path = formJsViewer.VALUES_SOURCES_PATHS[formJsViewer.VALUES_SOURCES.EXPRESSION];
|
|
10572
10568
|
const schema = '[\n {\n "label": "dollar",\n "value": "$"\n }\n]';
|
|
10573
|
-
const
|
|
10574
|
-
children: ["
|
|
10569
|
+
const tooltip = jsxRuntime.jsxs("div", {
|
|
10570
|
+
children: ["The expression may result in an array of simple values or alternatively follow this schema:", jsxRuntime.jsx("pre", {
|
|
10575
10571
|
children: jsxRuntime.jsx("code", {
|
|
10576
10572
|
children: schema
|
|
10577
10573
|
})
|
|
@@ -10581,7 +10577,8 @@ function ValuesExpression(props) {
|
|
|
10581
10577
|
const setValue = value => editField(field, path, value || '');
|
|
10582
10578
|
return FeelEntry({
|
|
10583
10579
|
debounce,
|
|
10584
|
-
description,
|
|
10580
|
+
description: 'Define an expression to populate the options from.',
|
|
10581
|
+
tooltip,
|
|
10585
10582
|
element: field,
|
|
10586
10583
|
feel: 'required',
|
|
10587
10584
|
getValue,
|
|
@@ -10950,8 +10947,8 @@ function ValuesGroups(field, editField) {
|
|
|
10950
10947
|
};
|
|
10951
10948
|
const valuesSourceId = `${fieldId}-valuesSource`;
|
|
10952
10949
|
|
|
10953
|
-
/**
|
|
10954
|
-
* @type {Array<Group|ListGroup>}
|
|
10950
|
+
/**
|
|
10951
|
+
* @type {Array<Group|ListGroup>}
|
|
10955
10952
|
*/
|
|
10956
10953
|
const groups = [{
|
|
10957
10954
|
id: valuesSourceId,
|
|
@@ -11072,13 +11069,13 @@ function CustomPropertiesGroup(field, editField) {
|
|
|
11072
11069
|
|
|
11073
11070
|
// helpers //////////
|
|
11074
11071
|
|
|
11075
|
-
/**
|
|
11076
|
-
* Returns copy of object without key.
|
|
11077
|
-
*
|
|
11078
|
-
* @param {Object} properties
|
|
11079
|
-
* @param {string} oldKey
|
|
11080
|
-
*
|
|
11081
|
-
* @returns {Object}
|
|
11072
|
+
/**
|
|
11073
|
+
* Returns copy of object without key.
|
|
11074
|
+
*
|
|
11075
|
+
* @param {Object} properties
|
|
11076
|
+
* @param {string} oldKey
|
|
11077
|
+
*
|
|
11078
|
+
* @returns {Object}
|
|
11082
11079
|
*/
|
|
11083
11080
|
function removeKey(properties, oldKey) {
|
|
11084
11081
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -11185,9 +11182,9 @@ function FormPropertiesPanel(props) {
|
|
|
11185
11182
|
});
|
|
11186
11183
|
}, [eventBus, formEditor, selectionModule]);
|
|
11187
11184
|
hooks.useLayoutEffect(() => {
|
|
11188
|
-
/**
|
|
11189
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
11190
|
-
* once we have a proper updater/change support
|
|
11185
|
+
/**
|
|
11186
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
11187
|
+
* once we have a proper updater/change support
|
|
11191
11188
|
*/
|
|
11192
11189
|
eventBus.on('changed', refresh);
|
|
11193
11190
|
eventBus.on('import.done', refresh);
|
|
@@ -11240,10 +11237,10 @@ class PropertiesPanelRenderer {
|
|
|
11240
11237
|
});
|
|
11241
11238
|
}
|
|
11242
11239
|
|
|
11243
|
-
/**
|
|
11244
|
-
* Attach the properties panel to a parent node.
|
|
11245
|
-
*
|
|
11246
|
-
* @param {HTMLElement} container
|
|
11240
|
+
/**
|
|
11241
|
+
* Attach the properties panel to a parent node.
|
|
11242
|
+
*
|
|
11243
|
+
* @param {HTMLElement} container
|
|
11247
11244
|
*/
|
|
11248
11245
|
attachTo(container) {
|
|
11249
11246
|
if (!container) {
|
|
@@ -11263,8 +11260,8 @@ class PropertiesPanelRenderer {
|
|
|
11263
11260
|
this._eventBus.fire('propertiesPanel.attach');
|
|
11264
11261
|
}
|
|
11265
11262
|
|
|
11266
|
-
/**
|
|
11267
|
-
* Detach the properties panel from its parent node.
|
|
11263
|
+
/**
|
|
11264
|
+
* Detach the properties panel from its parent node.
|
|
11268
11265
|
*/
|
|
11269
11266
|
detach() {
|
|
11270
11267
|
const parentNode = this._container.parentNode;
|
|
@@ -11295,10 +11292,10 @@ var PropertiesPanelModule = {
|
|
|
11295
11292
|
propertiesPanel: ['type', PropertiesPanelRenderer]
|
|
11296
11293
|
};
|
|
11297
11294
|
|
|
11298
|
-
/**
|
|
11299
|
-
* Manages the rendering of visual plugins.
|
|
11300
|
-
* @constructor
|
|
11301
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
11295
|
+
/**
|
|
11296
|
+
* Manages the rendering of visual plugins.
|
|
11297
|
+
* @constructor
|
|
11298
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
11302
11299
|
*/
|
|
11303
11300
|
class RenderInjector extends SectionModuleBase {
|
|
11304
11301
|
constructor(eventBus) {
|
|
@@ -11307,10 +11304,10 @@ class RenderInjector extends SectionModuleBase {
|
|
|
11307
11304
|
this.registeredRenderers = [];
|
|
11308
11305
|
}
|
|
11309
11306
|
|
|
11310
|
-
/**
|
|
11311
|
-
* Inject a new renderer into the injector.
|
|
11312
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
11313
|
-
* @param {Function} Renderer - The renderer function.
|
|
11307
|
+
/**
|
|
11308
|
+
* Inject a new renderer into the injector.
|
|
11309
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
11310
|
+
* @param {Function} Renderer - The renderer function.
|
|
11314
11311
|
*/
|
|
11315
11312
|
attachRenderer(identifier, Renderer) {
|
|
11316
11313
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -11319,17 +11316,17 @@ class RenderInjector extends SectionModuleBase {
|
|
|
11319
11316
|
}];
|
|
11320
11317
|
}
|
|
11321
11318
|
|
|
11322
|
-
/**
|
|
11323
|
-
* Detach a renderer from the by key injector.
|
|
11324
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
11319
|
+
/**
|
|
11320
|
+
* Detach a renderer from the by key injector.
|
|
11321
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
11325
11322
|
*/
|
|
11326
11323
|
detachRenderer(identifier) {
|
|
11327
11324
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
11328
11325
|
}
|
|
11329
11326
|
|
|
11330
|
-
/**
|
|
11331
|
-
* Returns the registered renderers.
|
|
11332
|
-
* @returns {Array} Array of registered renderers.
|
|
11327
|
+
/**
|
|
11328
|
+
* Returns the registered renderers.
|
|
11329
|
+
* @returns {Array} Array of registered renderers.
|
|
11333
11330
|
*/
|
|
11334
11331
|
fetchRenderers() {
|
|
11335
11332
|
return this.registeredRenderers;
|
|
@@ -11363,48 +11360,48 @@ var ExpressionLanguageModule = {
|
|
|
11363
11360
|
|
|
11364
11361
|
const ids = new Ids([32, 36, 1]);
|
|
11365
11362
|
|
|
11366
|
-
/**
|
|
11367
|
-
* @typedef { import('./types').Injector } Injector
|
|
11368
|
-
* @typedef { import('./types').Module } Module
|
|
11369
|
-
* @typedef { import('./types').Schema } Schema
|
|
11370
|
-
*
|
|
11371
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
11372
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
11373
|
-
*
|
|
11374
|
-
* @typedef { {
|
|
11375
|
-
* properties: FormEditorProperties,
|
|
11376
|
-
* schema: Schema
|
|
11377
|
-
* } } State
|
|
11378
|
-
*
|
|
11379
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
11380
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
11381
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
11363
|
+
/**
|
|
11364
|
+
* @typedef { import('./types').Injector } Injector
|
|
11365
|
+
* @typedef { import('./types').Module } Module
|
|
11366
|
+
* @typedef { import('./types').Schema } Schema
|
|
11367
|
+
*
|
|
11368
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
11369
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
11370
|
+
*
|
|
11371
|
+
* @typedef { {
|
|
11372
|
+
* properties: FormEditorProperties,
|
|
11373
|
+
* schema: Schema
|
|
11374
|
+
* } } State
|
|
11375
|
+
*
|
|
11376
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
11377
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
11378
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
11382
11379
|
*/
|
|
11383
11380
|
|
|
11384
|
-
/**
|
|
11385
|
-
* The form editor.
|
|
11381
|
+
/**
|
|
11382
|
+
* The form editor.
|
|
11386
11383
|
*/
|
|
11387
11384
|
class FormEditor {
|
|
11388
|
-
/**
|
|
11389
|
-
* @constructor
|
|
11390
|
-
* @param {FormEditorOptions} options
|
|
11385
|
+
/**
|
|
11386
|
+
* @constructor
|
|
11387
|
+
* @param {FormEditorOptions} options
|
|
11391
11388
|
*/
|
|
11392
11389
|
constructor(options = {}) {
|
|
11393
|
-
/**
|
|
11394
|
-
* @public
|
|
11395
|
-
* @type {OnEventType}
|
|
11390
|
+
/**
|
|
11391
|
+
* @public
|
|
11392
|
+
* @type {OnEventType}
|
|
11396
11393
|
*/
|
|
11397
11394
|
this.on = this._onEvent;
|
|
11398
11395
|
|
|
11399
|
-
/**
|
|
11400
|
-
* @public
|
|
11401
|
-
* @type {String}
|
|
11396
|
+
/**
|
|
11397
|
+
* @public
|
|
11398
|
+
* @type {String}
|
|
11402
11399
|
*/
|
|
11403
11400
|
this._id = ids.next();
|
|
11404
11401
|
|
|
11405
|
-
/**
|
|
11406
|
-
* @private
|
|
11407
|
-
* @type {Element}
|
|
11402
|
+
/**
|
|
11403
|
+
* @private
|
|
11404
|
+
* @type {Element}
|
|
11408
11405
|
*/
|
|
11409
11406
|
this._container = formJsViewer.createFormContainer();
|
|
11410
11407
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -11415,15 +11412,15 @@ class FormEditor {
|
|
|
11415
11412
|
properties = {}
|
|
11416
11413
|
} = options;
|
|
11417
11414
|
|
|
11418
|
-
/**
|
|
11419
|
-
* @private
|
|
11420
|
-
* @type {any}
|
|
11415
|
+
/**
|
|
11416
|
+
* @private
|
|
11417
|
+
* @type {any}
|
|
11421
11418
|
*/
|
|
11422
11419
|
this.exporter = exporter;
|
|
11423
11420
|
|
|
11424
|
-
/**
|
|
11425
|
-
* @private
|
|
11426
|
-
* @type {State}
|
|
11421
|
+
/**
|
|
11422
|
+
* @private
|
|
11423
|
+
* @type {State}
|
|
11427
11424
|
*/
|
|
11428
11425
|
this._state = {
|
|
11429
11426
|
properties,
|
|
@@ -11452,10 +11449,10 @@ class FormEditor {
|
|
|
11452
11449
|
this._detach(false);
|
|
11453
11450
|
}
|
|
11454
11451
|
|
|
11455
|
-
/**
|
|
11456
|
-
* @param {Schema} schema
|
|
11457
|
-
*
|
|
11458
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
11452
|
+
/**
|
|
11453
|
+
* @param {Schema} schema
|
|
11454
|
+
*
|
|
11455
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
11459
11456
|
*/
|
|
11460
11457
|
importSchema(schema) {
|
|
11461
11458
|
return new Promise((resolve, reject) => {
|
|
@@ -11484,15 +11481,15 @@ class FormEditor {
|
|
|
11484
11481
|
});
|
|
11485
11482
|
}
|
|
11486
11483
|
|
|
11487
|
-
/**
|
|
11488
|
-
* @returns {Schema}
|
|
11484
|
+
/**
|
|
11485
|
+
* @returns {Schema}
|
|
11489
11486
|
*/
|
|
11490
11487
|
saveSchema() {
|
|
11491
11488
|
return this.getSchema();
|
|
11492
11489
|
}
|
|
11493
11490
|
|
|
11494
|
-
/**
|
|
11495
|
-
* @returns {Schema}
|
|
11491
|
+
/**
|
|
11492
|
+
* @returns {Schema}
|
|
11496
11493
|
*/
|
|
11497
11494
|
getSchema() {
|
|
11498
11495
|
const {
|
|
@@ -11501,8 +11498,8 @@ class FormEditor {
|
|
|
11501
11498
|
return exportSchema(schema, this.exporter, formJsViewer.schemaVersion);
|
|
11502
11499
|
}
|
|
11503
11500
|
|
|
11504
|
-
/**
|
|
11505
|
-
* @param {Element|string} parentNode
|
|
11501
|
+
/**
|
|
11502
|
+
* @param {Element|string} parentNode
|
|
11506
11503
|
*/
|
|
11507
11504
|
attachTo(parentNode) {
|
|
11508
11505
|
if (!parentNode) {
|
|
@@ -11520,10 +11517,10 @@ class FormEditor {
|
|
|
11520
11517
|
this._detach();
|
|
11521
11518
|
}
|
|
11522
11519
|
|
|
11523
|
-
/**
|
|
11524
|
-
* @internal
|
|
11525
|
-
*
|
|
11526
|
-
* @param {boolean} [emit]
|
|
11520
|
+
/**
|
|
11521
|
+
* @internal
|
|
11522
|
+
*
|
|
11523
|
+
* @param {boolean} [emit]
|
|
11527
11524
|
*/
|
|
11528
11525
|
_detach(emit = true) {
|
|
11529
11526
|
const container = this._container,
|
|
@@ -11537,9 +11534,9 @@ class FormEditor {
|
|
|
11537
11534
|
parentNode.removeChild(container);
|
|
11538
11535
|
}
|
|
11539
11536
|
|
|
11540
|
-
/**
|
|
11541
|
-
* @param {any} property
|
|
11542
|
-
* @param {any} value
|
|
11537
|
+
/**
|
|
11538
|
+
* @param {any} property
|
|
11539
|
+
* @param {any} value
|
|
11543
11540
|
*/
|
|
11544
11541
|
setProperty(property, value) {
|
|
11545
11542
|
const properties = minDash.set(this._getState().properties, [property], value);
|
|
@@ -11548,21 +11545,21 @@ class FormEditor {
|
|
|
11548
11545
|
});
|
|
11549
11546
|
}
|
|
11550
11547
|
|
|
11551
|
-
/**
|
|
11552
|
-
* @param {string} type
|
|
11553
|
-
* @param {Function} handler
|
|
11548
|
+
/**
|
|
11549
|
+
* @param {string} type
|
|
11550
|
+
* @param {Function} handler
|
|
11554
11551
|
*/
|
|
11555
11552
|
off(type, handler) {
|
|
11556
11553
|
this.get('eventBus').off(type, handler);
|
|
11557
11554
|
}
|
|
11558
11555
|
|
|
11559
|
-
/**
|
|
11560
|
-
* @internal
|
|
11561
|
-
*
|
|
11562
|
-
* @param {FormEditorOptions} options
|
|
11563
|
-
* @param {Element} container
|
|
11564
|
-
*
|
|
11565
|
-
* @returns {Injector}
|
|
11556
|
+
/**
|
|
11557
|
+
* @internal
|
|
11558
|
+
*
|
|
11559
|
+
* @param {FormEditorOptions} options
|
|
11560
|
+
* @param {Element} container
|
|
11561
|
+
*
|
|
11562
|
+
* @returns {Injector}
|
|
11566
11563
|
*/
|
|
11567
11564
|
_createInjector(options, container) {
|
|
11568
11565
|
const {
|
|
@@ -11584,22 +11581,22 @@ class FormEditor {
|
|
|
11584
11581
|
}, core, ...modules, ...additionalModules]);
|
|
11585
11582
|
}
|
|
11586
11583
|
|
|
11587
|
-
/**
|
|
11588
|
-
* @internal
|
|
11584
|
+
/**
|
|
11585
|
+
* @internal
|
|
11589
11586
|
*/
|
|
11590
11587
|
_emit(type, data) {
|
|
11591
11588
|
this.get('eventBus').fire(type, data);
|
|
11592
11589
|
}
|
|
11593
11590
|
|
|
11594
|
-
/**
|
|
11595
|
-
* @internal
|
|
11591
|
+
/**
|
|
11592
|
+
* @internal
|
|
11596
11593
|
*/
|
|
11597
11594
|
_getState() {
|
|
11598
11595
|
return this._state;
|
|
11599
11596
|
}
|
|
11600
11597
|
|
|
11601
|
-
/**
|
|
11602
|
-
* @internal
|
|
11598
|
+
/**
|
|
11599
|
+
* @internal
|
|
11603
11600
|
*/
|
|
11604
11601
|
_setState(state) {
|
|
11605
11602
|
this._state = {
|
|
@@ -11609,15 +11606,15 @@ class FormEditor {
|
|
|
11609
11606
|
this._emit('changed', this._getState());
|
|
11610
11607
|
}
|
|
11611
11608
|
|
|
11612
|
-
/**
|
|
11613
|
-
* @internal
|
|
11609
|
+
/**
|
|
11610
|
+
* @internal
|
|
11614
11611
|
*/
|
|
11615
11612
|
_getModules() {
|
|
11616
11613
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, formJsViewer.MarkdownModule, PropertiesPanelModule, RenderInjectionModule];
|
|
11617
11614
|
}
|
|
11618
11615
|
|
|
11619
|
-
/**
|
|
11620
|
-
* @internal
|
|
11616
|
+
/**
|
|
11617
|
+
* @internal
|
|
11621
11618
|
*/
|
|
11622
11619
|
_onEvent(type, priority, handler) {
|
|
11623
11620
|
this.get('eventBus').on(type, priority, handler);
|