@bpmn-io/form-js-editor 1.3.0-alpha.0 → 1.3.0
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 +432 -307
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +432 -307
- package/dist/index.es.js.map +1 -1
- package/dist/types/FormEditor.d.ts +1 -0
- package/dist/types/features/properties-panel/index.d.ts +1 -0
- package/dist/types/types.d.ts +28 -28
- package/package.json +4 -4
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; padding: 2px 6px; height: 16px; background: var(--color-blue-205-100-95); display: flex; justify-content: center; align-items: center; position: absolute; bottom: -2px; z-index: 2; font-size: 10px; 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) {
|
|
@@ -4895,18 +4895,25 @@ function Tooltip(props) {
|
|
|
4895
4895
|
parent
|
|
4896
4896
|
} = props;
|
|
4897
4897
|
const [visible, setShow] = hooks.useState(false);
|
|
4898
|
+
const [focusedViaKeyboard, setFocusedViaKeyboard] = hooks.useState(false);
|
|
4898
4899
|
let timeout = null;
|
|
4899
4900
|
const wrapperRef = hooks.useRef(null);
|
|
4900
4901
|
const tooltipRef = hooks.useRef(null);
|
|
4901
4902
|
const showTooltip = async event => {
|
|
4902
|
-
const show = () =>
|
|
4903
|
-
if (
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4903
|
+
const show = () => setShow(true);
|
|
4904
|
+
if (!visible && !timeout) {
|
|
4905
|
+
if (event instanceof MouseEvent) {
|
|
4906
|
+
timeout = setTimeout(show, 200);
|
|
4907
|
+
} else {
|
|
4908
|
+
show();
|
|
4909
|
+
setFocusedViaKeyboard(true);
|
|
4910
|
+
}
|
|
4907
4911
|
}
|
|
4908
4912
|
};
|
|
4909
|
-
const hideTooltip = () =>
|
|
4913
|
+
const hideTooltip = () => {
|
|
4914
|
+
setShow(false);
|
|
4915
|
+
setFocusedViaKeyboard(false);
|
|
4916
|
+
};
|
|
4910
4917
|
const hideTooltipViaEscape = e => {
|
|
4911
4918
|
e.code === 'Escape' && hideTooltip();
|
|
4912
4919
|
};
|
|
@@ -4930,7 +4937,7 @@ function Tooltip(props) {
|
|
|
4930
4937
|
if (visible && !isTooltipHovered({
|
|
4931
4938
|
x: e.x,
|
|
4932
4939
|
y: e.y
|
|
4933
|
-
}) && !isFocused) {
|
|
4940
|
+
}) && !(isFocused && focusedViaKeyboard)) {
|
|
4934
4941
|
hideTooltip();
|
|
4935
4942
|
}
|
|
4936
4943
|
};
|
|
@@ -4938,8 +4945,8 @@ function Tooltip(props) {
|
|
|
4938
4945
|
const {
|
|
4939
4946
|
relatedTarget
|
|
4940
4947
|
} = e;
|
|
4941
|
-
const isTooltipChild = el =>
|
|
4942
|
-
if (visible && !isHovered(wrapperRef.current) && !isTooltipChild(relatedTarget)) {
|
|
4948
|
+
const isTooltipChild = el => !!el.closest('.bio-properties-panel-tooltip');
|
|
4949
|
+
if (visible && !isHovered(wrapperRef.current) && relatedTarget && !isTooltipChild(relatedTarget)) {
|
|
4943
4950
|
hideTooltip();
|
|
4944
4951
|
}
|
|
4945
4952
|
};
|
|
@@ -4951,7 +4958,7 @@ function Tooltip(props) {
|
|
|
4951
4958
|
document.removeEventListener('mousemove', hideHoveredTooltip);
|
|
4952
4959
|
document.removeEventListener('focusout', hideFocusedTooltip);
|
|
4953
4960
|
};
|
|
4954
|
-
}, [wrapperRef.current, visible]);
|
|
4961
|
+
}, [wrapperRef.current, visible, focusedViaKeyboard]);
|
|
4955
4962
|
const renderTooltip = () => {
|
|
4956
4963
|
return jsxRuntime.jsxs("div", {
|
|
4957
4964
|
class: "bio-properties-panel-tooltip",
|
|
@@ -4974,12 +4981,12 @@ function Tooltip(props) {
|
|
|
4974
4981
|
tabIndex: "0",
|
|
4975
4982
|
ref: wrapperRef,
|
|
4976
4983
|
onMouseEnter: showTooltip,
|
|
4977
|
-
onMouseLeave: () =>
|
|
4984
|
+
onMouseLeave: () => {
|
|
4985
|
+
clearTimeout(timeout);
|
|
4986
|
+
timeout = null;
|
|
4987
|
+
},
|
|
4978
4988
|
onFocus: showTooltip,
|
|
4979
4989
|
onKeyDown: hideTooltipViaEscape,
|
|
4980
|
-
onMouseDown: e => {
|
|
4981
|
-
e.preventDefault();
|
|
4982
|
-
},
|
|
4983
4990
|
children: [props.children, visible ? parent ? React.createPortal(renderTooltip(), parent.current) : renderTooltip() : null]
|
|
4984
4991
|
});
|
|
4985
4992
|
}
|
|
@@ -5289,7 +5296,8 @@ function Group(props) {
|
|
|
5289
5296
|
class: classnames('bio-properties-panel-group-header', edited ? '' : 'empty', open ? 'open' : '', sticky && open ? 'sticky' : ''),
|
|
5290
5297
|
onClick: toggleOpen,
|
|
5291
5298
|
children: [jsxRuntime.jsx("div", {
|
|
5292
|
-
title: label,
|
|
5299
|
+
title: props.tooltip ? null : label,
|
|
5300
|
+
"data-title": label,
|
|
5293
5301
|
class: "bio-properties-panel-group-header-title",
|
|
5294
5302
|
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
5295
5303
|
value: props.tooltip,
|
|
@@ -5731,6 +5739,7 @@ const noop$3 = () => {};
|
|
|
5731
5739
|
* @param {Object} props
|
|
5732
5740
|
* @param {HTMLElement} [props.container]
|
|
5733
5741
|
* @param {string} [props.className]
|
|
5742
|
+
* @param {boolean} [props.delayInitialFocus]
|
|
5734
5743
|
* @param {{x: number, y: number}} [props.position]
|
|
5735
5744
|
* @param {number} [props.width]
|
|
5736
5745
|
* @param {number} [props.height]
|
|
@@ -5738,12 +5747,14 @@ const noop$3 = () => {};
|
|
|
5738
5747
|
* @param {Function} [props.onPostActivate]
|
|
5739
5748
|
* @param {Function} [props.onPostDeactivate]
|
|
5740
5749
|
* @param {boolean} [props.returnFocus]
|
|
5750
|
+
* @param {boolean} [props.closeOnEscape]
|
|
5741
5751
|
* @param {string} props.title
|
|
5742
5752
|
*/
|
|
5743
5753
|
function Popup(props) {
|
|
5744
5754
|
const {
|
|
5745
5755
|
container,
|
|
5746
5756
|
className,
|
|
5757
|
+
delayInitialFocus,
|
|
5747
5758
|
position,
|
|
5748
5759
|
width,
|
|
5749
5760
|
height,
|
|
@@ -5751,12 +5762,15 @@ function Popup(props) {
|
|
|
5751
5762
|
onPostActivate = noop$3,
|
|
5752
5763
|
onPostDeactivate = noop$3,
|
|
5753
5764
|
returnFocus = true,
|
|
5765
|
+
closeOnEscape = true,
|
|
5754
5766
|
title
|
|
5755
5767
|
} = props;
|
|
5756
5768
|
const focusTrapRef = hooks.useRef(null);
|
|
5757
5769
|
const popupRef = hooks.useRef(null);
|
|
5758
|
-
const
|
|
5759
|
-
|
|
5770
|
+
const handleKeydown = event => {
|
|
5771
|
+
// do not allow keyboard events to bubble
|
|
5772
|
+
event.stopPropagation();
|
|
5773
|
+
if (closeOnEscape && event.key === 'Escape') {
|
|
5760
5774
|
onClose();
|
|
5761
5775
|
}
|
|
5762
5776
|
};
|
|
@@ -5781,14 +5795,6 @@ function Popup(props) {
|
|
|
5781
5795
|
if (height) {
|
|
5782
5796
|
style.height = height + 'px';
|
|
5783
5797
|
}
|
|
5784
|
-
hooks.useEffect(() => {
|
|
5785
|
-
if (popupRef.current) {
|
|
5786
|
-
popupRef.current.addEventListener('keydown', handleKeyPress);
|
|
5787
|
-
}
|
|
5788
|
-
return () => {
|
|
5789
|
-
popupRef.current.removeEventListener('keydown', handleKeyPress);
|
|
5790
|
-
};
|
|
5791
|
-
}, [popupRef]);
|
|
5792
5798
|
hooks.useEffect(() => {
|
|
5793
5799
|
if (popupRef.current) {
|
|
5794
5800
|
popupRef.current.addEventListener('focusin', handleFocus);
|
|
@@ -5801,6 +5807,7 @@ function Popup(props) {
|
|
|
5801
5807
|
if (popupRef.current) {
|
|
5802
5808
|
focusTrapRef.current = focusTrap__namespace.createFocusTrap(popupRef.current, {
|
|
5803
5809
|
clickOutsideDeactivates: true,
|
|
5810
|
+
delayInitialFocus,
|
|
5804
5811
|
fallbackFocus: popupRef.current,
|
|
5805
5812
|
onPostActivate,
|
|
5806
5813
|
onPostDeactivate,
|
|
@@ -5814,6 +5821,7 @@ function Popup(props) {
|
|
|
5814
5821
|
"aria-label": title,
|
|
5815
5822
|
tabIndex: -1,
|
|
5816
5823
|
ref: popupRef,
|
|
5824
|
+
onKeyDown: handleKeydown,
|
|
5817
5825
|
role: "dialog",
|
|
5818
5826
|
class: classnames('bio-properties-panel-popup', className),
|
|
5819
5827
|
style: style,
|
|
@@ -5926,22 +5934,36 @@ const FEEL_POPUP_HEIGHT = 250;
|
|
|
5926
5934
|
*/
|
|
5927
5935
|
function FEELPopupRoot(props) {
|
|
5928
5936
|
const {
|
|
5929
|
-
element
|
|
5937
|
+
element,
|
|
5938
|
+
eventBus = {
|
|
5939
|
+
fire() {},
|
|
5940
|
+
on() {},
|
|
5941
|
+
off() {}
|
|
5942
|
+
},
|
|
5943
|
+
popupContainer
|
|
5930
5944
|
} = props;
|
|
5931
5945
|
const prevElement = usePrevious(element);
|
|
5932
5946
|
const [popupConfig, setPopupConfig] = hooks.useState({});
|
|
5933
5947
|
const [open, setOpen] = hooks.useState(false);
|
|
5934
5948
|
const [source, setSource] = hooks.useState(null);
|
|
5935
5949
|
const [sourceElement, setSourceElement] = hooks.useState(null);
|
|
5936
|
-
const
|
|
5937
|
-
|
|
5950
|
+
const emit = (type, context) => {
|
|
5951
|
+
eventBus.fire('feelPopup.' + type, context);
|
|
5952
|
+
};
|
|
5953
|
+
const isOpen = hooks.useCallback(() => {
|
|
5954
|
+
return !!open;
|
|
5955
|
+
}, [open]);
|
|
5956
|
+
const handleOpen = (entryId, config, _sourceElement) => {
|
|
5957
|
+
setSource(entryId);
|
|
5938
5958
|
setPopupConfig(config);
|
|
5939
5959
|
setOpen(true);
|
|
5940
5960
|
setSourceElement(_sourceElement);
|
|
5961
|
+
emit('opened');
|
|
5941
5962
|
};
|
|
5942
5963
|
const handleClose = () => {
|
|
5943
5964
|
setOpen(false);
|
|
5944
5965
|
setSource(null);
|
|
5966
|
+
emit('closed');
|
|
5945
5967
|
};
|
|
5946
5968
|
const feelPopupContext = {
|
|
5947
5969
|
open: handleOpen,
|
|
@@ -5951,14 +5973,38 @@ function FEELPopupRoot(props) {
|
|
|
5951
5973
|
|
|
5952
5974
|
// close popup on element change, cf. https://github.com/bpmn-io/properties-panel/issues/270
|
|
5953
5975
|
hooks.useEffect(() => {
|
|
5954
|
-
if (element && element !== prevElement) {
|
|
5976
|
+
if (element && prevElement && element !== prevElement) {
|
|
5955
5977
|
handleClose();
|
|
5956
5978
|
}
|
|
5957
5979
|
}, [element]);
|
|
5980
|
+
|
|
5981
|
+
// allow close and open via events
|
|
5982
|
+
hooks.useEffect(() => {
|
|
5983
|
+
const handlePopupOpen = context => {
|
|
5984
|
+
const {
|
|
5985
|
+
entryId,
|
|
5986
|
+
popupConfig,
|
|
5987
|
+
sourceElement
|
|
5988
|
+
} = context;
|
|
5989
|
+
handleOpen(entryId, popupConfig, sourceElement);
|
|
5990
|
+
};
|
|
5991
|
+
const handleIsOpen = () => {
|
|
5992
|
+
return isOpen();
|
|
5993
|
+
};
|
|
5994
|
+
eventBus.on('feelPopup._close', handleClose);
|
|
5995
|
+
eventBus.on('feelPopup._open', handlePopupOpen);
|
|
5996
|
+
eventBus.on('feelPopup._isOpen', handleIsOpen);
|
|
5997
|
+
return () => {
|
|
5998
|
+
eventBus.off('feelPopup._close', handleClose);
|
|
5999
|
+
eventBus.off('feelPopup._open', handleOpen);
|
|
6000
|
+
eventBus.off('feelPopup._isOpen', handleIsOpen);
|
|
6001
|
+
};
|
|
6002
|
+
}, [eventBus, isOpen]);
|
|
5958
6003
|
return jsxRuntime.jsxs(FeelPopupContext.Provider, {
|
|
5959
6004
|
value: feelPopupContext,
|
|
5960
6005
|
children: [open && jsxRuntime.jsx(FeelPopupComponent, {
|
|
5961
6006
|
onClose: handleClose,
|
|
6007
|
+
container: popupContainer,
|
|
5962
6008
|
sourceElement: sourceElement,
|
|
5963
6009
|
...popupConfig
|
|
5964
6010
|
}), props.children]
|
|
@@ -5966,6 +6012,7 @@ function FEELPopupRoot(props) {
|
|
|
5966
6012
|
}
|
|
5967
6013
|
function FeelPopupComponent(props) {
|
|
5968
6014
|
const {
|
|
6015
|
+
container,
|
|
5969
6016
|
id,
|
|
5970
6017
|
hostLanguage,
|
|
5971
6018
|
onInput,
|
|
@@ -5980,16 +6027,30 @@ function FeelPopupComponent(props) {
|
|
|
5980
6027
|
variables
|
|
5981
6028
|
} = props;
|
|
5982
6029
|
const editorRef = hooks.useRef();
|
|
6030
|
+
const isAutoCompletionOpen = hooks.useRef(false);
|
|
5983
6031
|
const handleSetReturnFocus = () => {
|
|
5984
6032
|
sourceElement && sourceElement.focus();
|
|
5985
6033
|
};
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
if (
|
|
5989
|
-
|
|
6034
|
+
const onKeyDownCapture = event => {
|
|
6035
|
+
// we use capture here to make sure we handle the event before the editor does
|
|
6036
|
+
if (event.key === 'Escape') {
|
|
6037
|
+
isAutoCompletionOpen.current = autoCompletionOpen(event.target);
|
|
6038
|
+
}
|
|
6039
|
+
};
|
|
6040
|
+
const onKeyDown = event => {
|
|
6041
|
+
if (event.key === 'Escape') {
|
|
6042
|
+
// close popup only if auto completion is not open
|
|
6043
|
+
// we need to do check this because the editor is not
|
|
6044
|
+
// stop propagating the keydown event
|
|
6045
|
+
// cf. https://discuss.codemirror.net/t/how-can-i-replace-the-default-autocompletion-keymap-v6/3322/5
|
|
6046
|
+
if (!isAutoCompletionOpen.current) {
|
|
6047
|
+
onClose();
|
|
6048
|
+
isAutoCompletionOpen.current = false;
|
|
6049
|
+
}
|
|
5990
6050
|
}
|
|
5991
|
-
}
|
|
6051
|
+
};
|
|
5992
6052
|
return jsxRuntime.jsxs(Popup, {
|
|
6053
|
+
container: container,
|
|
5993
6054
|
className: "bio-properties-panel-feel-popup",
|
|
5994
6055
|
position: position,
|
|
5995
6056
|
title: title,
|
|
@@ -5999,6 +6060,8 @@ function FeelPopupComponent(props) {
|
|
|
5999
6060
|
,
|
|
6000
6061
|
|
|
6001
6062
|
returnFocus: false,
|
|
6063
|
+
closeOnEscape: false,
|
|
6064
|
+
delayInitialFocus: false,
|
|
6002
6065
|
onPostDeactivate: handleSetReturnFocus,
|
|
6003
6066
|
height: FEEL_POPUP_HEIGHT,
|
|
6004
6067
|
width: FEEL_POPUP_WIDTH,
|
|
@@ -6007,6 +6070,8 @@ function FeelPopupComponent(props) {
|
|
|
6007
6070
|
draggable: true
|
|
6008
6071
|
}), jsxRuntime.jsx(Popup.Body, {
|
|
6009
6072
|
children: jsxRuntime.jsxs("div", {
|
|
6073
|
+
onKeyDownCapture: onKeyDownCapture,
|
|
6074
|
+
onKeyDown: onKeyDown,
|
|
6010
6075
|
class: "bio-properties-panel-feel-popup__body",
|
|
6011
6076
|
children: [type === 'feel' && jsxRuntime.jsx(CodeEditor, {
|
|
6012
6077
|
enableGutters: true,
|
|
@@ -6048,6 +6113,9 @@ function FeelPopupComponent(props) {
|
|
|
6048
6113
|
function prefixId$8(id) {
|
|
6049
6114
|
return `bio-properties-panel-${id}`;
|
|
6050
6115
|
}
|
|
6116
|
+
function autoCompletionOpen(element) {
|
|
6117
|
+
return element.closest('.cm-editor').querySelector('.cm-tooltip-autocomplete');
|
|
6118
|
+
}
|
|
6051
6119
|
function ToggleSwitch(props) {
|
|
6052
6120
|
const {
|
|
6053
6121
|
id,
|
|
@@ -6794,7 +6862,7 @@ function FeelEntry(props) {
|
|
|
6794
6862
|
setLocalError(err);
|
|
6795
6863
|
}, []);
|
|
6796
6864
|
const temporaryError = useError(id);
|
|
6797
|
-
const error =
|
|
6865
|
+
const error = temporaryError || localError || validationError;
|
|
6798
6866
|
return jsxRuntime.jsxs("div", {
|
|
6799
6867
|
class: classnames(props.class, 'bio-properties-panel-entry', error ? 'has-error' : ''),
|
|
6800
6868
|
"data-entry-id": id,
|
|
@@ -7030,6 +7098,7 @@ const DEFAULT_TOOLTIP = {};
|
|
|
7030
7098
|
* @param {Function} [props.descriptionLoaded]
|
|
7031
7099
|
* @param {TooltipConfig} [props.tooltipConfig]
|
|
7032
7100
|
* @param {Function} [props.tooltipLoaded]
|
|
7101
|
+
* @param {HTMLElement} [props.feelPopupContainer]
|
|
7033
7102
|
* @param {Object} [props.eventBus]
|
|
7034
7103
|
*/
|
|
7035
7104
|
function PropertiesPanel(props) {
|
|
@@ -7044,6 +7113,7 @@ function PropertiesPanel(props) {
|
|
|
7044
7113
|
descriptionLoaded,
|
|
7045
7114
|
tooltipConfig,
|
|
7046
7115
|
tooltipLoaded,
|
|
7116
|
+
feelPopupContainer,
|
|
7047
7117
|
eventBus
|
|
7048
7118
|
} = props;
|
|
7049
7119
|
|
|
@@ -7146,6 +7216,8 @@ function PropertiesPanel(props) {
|
|
|
7146
7216
|
value: eventContext,
|
|
7147
7217
|
children: jsxRuntime.jsx(FEELPopupRoot, {
|
|
7148
7218
|
element: element,
|
|
7219
|
+
eventBus: eventBus,
|
|
7220
|
+
popupContainer: feelPopupContainer,
|
|
7149
7221
|
children: jsxRuntime.jsxs("div", {
|
|
7150
7222
|
class: "bio-properties-panel",
|
|
7151
7223
|
children: [jsxRuntime.jsx(Header, {
|
|
@@ -7445,7 +7517,8 @@ function ListGroup(props) {
|
|
|
7445
7517
|
class: classnames('bio-properties-panel-group-header', hasItems ? '' : 'empty', hasItems && open ? 'open' : '', sticky && open ? 'sticky' : ''),
|
|
7446
7518
|
onClick: hasItems ? toggleOpen : noop$1,
|
|
7447
7519
|
children: [jsxRuntime.jsx("div", {
|
|
7448
|
-
title: label,
|
|
7520
|
+
title: props.tooltip ? null : label,
|
|
7521
|
+
"data-title": label,
|
|
7449
7522
|
class: "bio-properties-panel-group-header-title",
|
|
7450
7523
|
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
7451
7524
|
value: props.tooltip,
|
|
@@ -8083,12 +8156,51 @@ function isEdited(node) {
|
|
|
8083
8156
|
function prefixId(id) {
|
|
8084
8157
|
return `bio-properties-panel-${id}`;
|
|
8085
8158
|
}
|
|
8159
|
+
class FeelPopupModule {
|
|
8160
|
+
constructor(eventBus) {
|
|
8161
|
+
this._eventBus = eventBus;
|
|
8162
|
+
}
|
|
8086
8163
|
|
|
8087
|
-
/**
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8164
|
+
/**
|
|
8165
|
+
* Check if the FEEL popup is open.
|
|
8166
|
+
* @return {Boolean}
|
|
8167
|
+
*/
|
|
8168
|
+
isOpen() {
|
|
8169
|
+
return this._eventBus.fire('feelPopup._isOpen');
|
|
8170
|
+
}
|
|
8171
|
+
|
|
8172
|
+
/**
|
|
8173
|
+
* Open the FEEL popup.
|
|
8174
|
+
*
|
|
8175
|
+
* @param {String} entryId
|
|
8176
|
+
* @param {Object} popupConfig
|
|
8177
|
+
* @param {HTMLElement} sourceElement
|
|
8178
|
+
*/
|
|
8179
|
+
open(entryId, popupConfig, sourceElement) {
|
|
8180
|
+
return this._eventBus.fire('feelPopup._open', {
|
|
8181
|
+
entryId,
|
|
8182
|
+
popupConfig,
|
|
8183
|
+
sourceElement
|
|
8184
|
+
});
|
|
8185
|
+
}
|
|
8186
|
+
|
|
8187
|
+
/**
|
|
8188
|
+
* Close the FEEL popup.
|
|
8189
|
+
*/
|
|
8190
|
+
close() {
|
|
8191
|
+
return this._eventBus.fire('feelPopup._close');
|
|
8192
|
+
}
|
|
8193
|
+
}
|
|
8194
|
+
FeelPopupModule.$inject = ['eventBus'];
|
|
8195
|
+
var index = {
|
|
8196
|
+
feelPopup: ['type', FeelPopupModule]
|
|
8197
|
+
};
|
|
8198
|
+
|
|
8199
|
+
/**
|
|
8200
|
+
* @param {string} type
|
|
8201
|
+
* @param {boolean} [strict]
|
|
8202
|
+
*
|
|
8203
|
+
* @returns {any}
|
|
8092
8204
|
*/
|
|
8093
8205
|
function getService(type, strict) {}
|
|
8094
8206
|
const PropertiesPanelContext = preact.createContext({
|
|
@@ -8185,8 +8297,8 @@ const PropertiesPanelHeaderProvider = {
|
|
|
8185
8297
|
}
|
|
8186
8298
|
};
|
|
8187
8299
|
|
|
8188
|
-
/**
|
|
8189
|
-
* Provide placeholders for empty and multiple state.
|
|
8300
|
+
/**
|
|
8301
|
+
* Provide placeholders for empty and multiple state.
|
|
8190
8302
|
*/
|
|
8191
8303
|
const PropertiesPanelPlaceholderProvider = {
|
|
8192
8304
|
getEmpty: () => {
|
|
@@ -8258,10 +8370,10 @@ function useService (type, strict) {
|
|
|
8258
8370
|
return getService(type, strict);
|
|
8259
8371
|
}
|
|
8260
8372
|
|
|
8261
|
-
/**
|
|
8262
|
-
* Retrieve list of variables from the form schema.
|
|
8263
|
-
*
|
|
8264
|
-
* @returns { string[] } list of variables used in form schema
|
|
8373
|
+
/**
|
|
8374
|
+
* Retrieve list of variables from the form schema.
|
|
8375
|
+
*
|
|
8376
|
+
* @returns { string[] } list of variables used in form schema
|
|
8265
8377
|
*/
|
|
8266
8378
|
function useVariables() {
|
|
8267
8379
|
const form = useService('formEditor');
|
|
@@ -9912,14 +10024,14 @@ function Value(props) {
|
|
|
9912
10024
|
|
|
9913
10025
|
// helpers //////////
|
|
9914
10026
|
|
|
9915
|
-
/**
|
|
9916
|
-
* Returns copy of object with updated value.
|
|
9917
|
-
*
|
|
9918
|
-
* @param {Object} properties
|
|
9919
|
-
* @param {string} key
|
|
9920
|
-
* @param {string} value
|
|
9921
|
-
*
|
|
9922
|
-
* @returns {Object}
|
|
10027
|
+
/**
|
|
10028
|
+
* Returns copy of object with updated value.
|
|
10029
|
+
*
|
|
10030
|
+
* @param {Object} properties
|
|
10031
|
+
* @param {string} key
|
|
10032
|
+
* @param {string} value
|
|
10033
|
+
*
|
|
10034
|
+
* @returns {Object}
|
|
9923
10035
|
*/
|
|
9924
10036
|
function updateValue(properties, key, value) {
|
|
9925
10037
|
return {
|
|
@@ -9928,14 +10040,14 @@ function updateValue(properties, key, value) {
|
|
|
9928
10040
|
};
|
|
9929
10041
|
}
|
|
9930
10042
|
|
|
9931
|
-
/**
|
|
9932
|
-
* Returns copy of object with updated key.
|
|
9933
|
-
*
|
|
9934
|
-
* @param {Object} properties
|
|
9935
|
-
* @param {string} oldKey
|
|
9936
|
-
* @param {string} newKey
|
|
9937
|
-
*
|
|
9938
|
-
* @returns {Object}
|
|
10043
|
+
/**
|
|
10044
|
+
* Returns copy of object with updated key.
|
|
10045
|
+
*
|
|
10046
|
+
* @param {Object} properties
|
|
10047
|
+
* @param {string} oldKey
|
|
10048
|
+
* @param {string} newKey
|
|
10049
|
+
*
|
|
10050
|
+
* @returns {Object}
|
|
9939
10051
|
*/
|
|
9940
10052
|
function updateKey(properties, oldKey, newKey) {
|
|
9941
10053
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -10749,7 +10861,8 @@ function ValidationType(props) {
|
|
|
10749
10861
|
id,
|
|
10750
10862
|
label: 'Validation pattern',
|
|
10751
10863
|
setValue,
|
|
10752
|
-
getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS)
|
|
10864
|
+
getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS),
|
|
10865
|
+
tooltip: getValue('validationType')() === VALIDATION_TYPE_OPTIONS.phone.value ? 'The built-in phone validation pattern is based on the E.164 standard with no spaces. Ex: +491234567890' : undefined
|
|
10753
10866
|
});
|
|
10754
10867
|
}
|
|
10755
10868
|
|
|
@@ -10767,13 +10880,13 @@ function ValuesGroups(field, editField) {
|
|
|
10767
10880
|
};
|
|
10768
10881
|
const valuesSourceId = `${fieldId}-valuesSource`;
|
|
10769
10882
|
|
|
10770
|
-
/**
|
|
10771
|
-
* @type {Array<Group|ListGroup>}
|
|
10883
|
+
/**
|
|
10884
|
+
* @type {Array<Group|ListGroup>}
|
|
10772
10885
|
*/
|
|
10773
10886
|
const groups = [{
|
|
10774
10887
|
id: valuesSourceId,
|
|
10775
10888
|
label: 'Options source',
|
|
10776
|
-
tooltip:
|
|
10889
|
+
tooltip: getValuesTooltip(),
|
|
10777
10890
|
component: Group,
|
|
10778
10891
|
entries: ValuesSourceSelectEntry({
|
|
10779
10892
|
...context,
|
|
@@ -10818,6 +10931,12 @@ function ValuesGroups(field, editField) {
|
|
|
10818
10931
|
return groups;
|
|
10819
10932
|
}
|
|
10820
10933
|
|
|
10934
|
+
// helpers //////////
|
|
10935
|
+
|
|
10936
|
+
function getValuesTooltip() {
|
|
10937
|
+
return '"Static" defines a constant, predefined set of form options.\n\n' + '"Input data" defines options that are populated dynamically, adjusting based on variable data for flexible responses to different conditions or inputs.\n\n' + '"Expression" defines options that are populated from a FEEL expression.';
|
|
10938
|
+
}
|
|
10939
|
+
|
|
10821
10940
|
function CustomPropertiesGroup(field, editField) {
|
|
10822
10941
|
const {
|
|
10823
10942
|
properties = {},
|
|
@@ -10883,13 +11002,13 @@ function CustomPropertiesGroup(field, editField) {
|
|
|
10883
11002
|
|
|
10884
11003
|
// helpers //////////
|
|
10885
11004
|
|
|
10886
|
-
/**
|
|
10887
|
-
* Returns copy of object without key.
|
|
10888
|
-
*
|
|
10889
|
-
* @param {Object} properties
|
|
10890
|
-
* @param {string} oldKey
|
|
10891
|
-
*
|
|
10892
|
-
* @returns {Object}
|
|
11005
|
+
/**
|
|
11006
|
+
* Returns copy of object without key.
|
|
11007
|
+
*
|
|
11008
|
+
* @param {Object} properties
|
|
11009
|
+
* @param {string} oldKey
|
|
11010
|
+
*
|
|
11011
|
+
* @returns {Object}
|
|
10893
11012
|
*/
|
|
10894
11013
|
function removeKey(properties, oldKey) {
|
|
10895
11014
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -10975,6 +11094,10 @@ function FormPropertiesPanel(props) {
|
|
|
10975
11094
|
const formEditor = injector.get('formEditor');
|
|
10976
11095
|
const modeling = injector.get('modeling');
|
|
10977
11096
|
const selectionModule = injector.get('selection');
|
|
11097
|
+
const propertiesPanelConfig = injector.get('config.propertiesPanel') || {};
|
|
11098
|
+
const {
|
|
11099
|
+
feelPopupContainer
|
|
11100
|
+
} = propertiesPanelConfig;
|
|
10978
11101
|
const [state, setState] = hooks.useState({
|
|
10979
11102
|
selectedFormField: selectionModule.get() || formEditor._getState().schema
|
|
10980
11103
|
});
|
|
@@ -10992,9 +11115,9 @@ function FormPropertiesPanel(props) {
|
|
|
10992
11115
|
});
|
|
10993
11116
|
}, [eventBus, formEditor, selectionModule]);
|
|
10994
11117
|
hooks.useLayoutEffect(() => {
|
|
10995
|
-
/**
|
|
10996
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
10997
|
-
* once we have a proper updater/change support
|
|
11118
|
+
/**
|
|
11119
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
11120
|
+
* once we have a proper updater/change support
|
|
10998
11121
|
*/
|
|
10999
11122
|
eventBus.on('changed', refresh);
|
|
11000
11123
|
eventBus.on('import.done', refresh);
|
|
@@ -11024,7 +11147,8 @@ function FormPropertiesPanel(props) {
|
|
|
11024
11147
|
eventBus: eventBus,
|
|
11025
11148
|
groups: getGroups(selectedFormField, editField, getService),
|
|
11026
11149
|
headerProvider: PropertiesPanelHeaderProvider,
|
|
11027
|
-
placeholderProvider: PropertiesPanelPlaceholderProvider
|
|
11150
|
+
placeholderProvider: PropertiesPanelPlaceholderProvider,
|
|
11151
|
+
feelPopupContainer: feelPopupContainer
|
|
11028
11152
|
})
|
|
11029
11153
|
})
|
|
11030
11154
|
});
|
|
@@ -11046,10 +11170,10 @@ class PropertiesPanelRenderer {
|
|
|
11046
11170
|
});
|
|
11047
11171
|
}
|
|
11048
11172
|
|
|
11049
|
-
/**
|
|
11050
|
-
* Attach the properties panel to a parent node.
|
|
11051
|
-
*
|
|
11052
|
-
* @param {HTMLElement} container
|
|
11173
|
+
/**
|
|
11174
|
+
* Attach the properties panel to a parent node.
|
|
11175
|
+
*
|
|
11176
|
+
* @param {HTMLElement} container
|
|
11053
11177
|
*/
|
|
11054
11178
|
attachTo(container) {
|
|
11055
11179
|
if (!container) {
|
|
@@ -11069,8 +11193,8 @@ class PropertiesPanelRenderer {
|
|
|
11069
11193
|
this._eventBus.fire('propertiesPanel.attach');
|
|
11070
11194
|
}
|
|
11071
11195
|
|
|
11072
|
-
/**
|
|
11073
|
-
* Detach the properties panel from its parent node.
|
|
11196
|
+
/**
|
|
11197
|
+
* Detach the properties panel from its parent node.
|
|
11074
11198
|
*/
|
|
11075
11199
|
detach() {
|
|
11076
11200
|
const parentNode = this._container.parentNode;
|
|
@@ -11096,14 +11220,15 @@ class PropertiesPanelRenderer {
|
|
|
11096
11220
|
PropertiesPanelRenderer.$inject = ['config.propertiesPanel', 'injector', 'eventBus'];
|
|
11097
11221
|
|
|
11098
11222
|
var PropertiesPanelModule = {
|
|
11223
|
+
__depends__: [index],
|
|
11099
11224
|
__init__: ['propertiesPanel'],
|
|
11100
11225
|
propertiesPanel: ['type', PropertiesPanelRenderer]
|
|
11101
11226
|
};
|
|
11102
11227
|
|
|
11103
|
-
/**
|
|
11104
|
-
* Manages the rendering of visual plugins.
|
|
11105
|
-
* @constructor
|
|
11106
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
11228
|
+
/**
|
|
11229
|
+
* Manages the rendering of visual plugins.
|
|
11230
|
+
* @constructor
|
|
11231
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
11107
11232
|
*/
|
|
11108
11233
|
class RenderInjector extends SectionModuleBase {
|
|
11109
11234
|
constructor(eventBus) {
|
|
@@ -11112,10 +11237,10 @@ class RenderInjector extends SectionModuleBase {
|
|
|
11112
11237
|
this.registeredRenderers = [];
|
|
11113
11238
|
}
|
|
11114
11239
|
|
|
11115
|
-
/**
|
|
11116
|
-
* Inject a new renderer into the injector.
|
|
11117
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
11118
|
-
* @param {Function} Renderer - The renderer function.
|
|
11240
|
+
/**
|
|
11241
|
+
* Inject a new renderer into the injector.
|
|
11242
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
11243
|
+
* @param {Function} Renderer - The renderer function.
|
|
11119
11244
|
*/
|
|
11120
11245
|
attachRenderer(identifier, Renderer) {
|
|
11121
11246
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -11124,17 +11249,17 @@ class RenderInjector extends SectionModuleBase {
|
|
|
11124
11249
|
}];
|
|
11125
11250
|
}
|
|
11126
11251
|
|
|
11127
|
-
/**
|
|
11128
|
-
* Detach a renderer from the by key injector.
|
|
11129
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
11252
|
+
/**
|
|
11253
|
+
* Detach a renderer from the by key injector.
|
|
11254
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
11130
11255
|
*/
|
|
11131
11256
|
detachRenderer(identifier) {
|
|
11132
11257
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
11133
11258
|
}
|
|
11134
11259
|
|
|
11135
|
-
/**
|
|
11136
|
-
* Returns the registered renderers.
|
|
11137
|
-
* @returns {Array} Array of registered renderers.
|
|
11260
|
+
/**
|
|
11261
|
+
* Returns the registered renderers.
|
|
11262
|
+
* @returns {Array} Array of registered renderers.
|
|
11138
11263
|
*/
|
|
11139
11264
|
fetchRenderers() {
|
|
11140
11265
|
return this.registeredRenderers;
|
|
@@ -11168,48 +11293,48 @@ var ExpressionLanguageModule = {
|
|
|
11168
11293
|
|
|
11169
11294
|
const ids = new Ids([32, 36, 1]);
|
|
11170
11295
|
|
|
11171
|
-
/**
|
|
11172
|
-
* @typedef { import('./types').Injector } Injector
|
|
11173
|
-
* @typedef { import('./types').Module } Module
|
|
11174
|
-
* @typedef { import('./types').Schema } Schema
|
|
11175
|
-
*
|
|
11176
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
11177
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
11178
|
-
*
|
|
11179
|
-
* @typedef { {
|
|
11180
|
-
* properties: FormEditorProperties,
|
|
11181
|
-
* schema: Schema
|
|
11182
|
-
* } } State
|
|
11183
|
-
*
|
|
11184
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
11185
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
11186
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
11296
|
+
/**
|
|
11297
|
+
* @typedef { import('./types').Injector } Injector
|
|
11298
|
+
* @typedef { import('./types').Module } Module
|
|
11299
|
+
* @typedef { import('./types').Schema } Schema
|
|
11300
|
+
*
|
|
11301
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
11302
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
11303
|
+
*
|
|
11304
|
+
* @typedef { {
|
|
11305
|
+
* properties: FormEditorProperties,
|
|
11306
|
+
* schema: Schema
|
|
11307
|
+
* } } State
|
|
11308
|
+
*
|
|
11309
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
11310
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
11311
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
11187
11312
|
*/
|
|
11188
11313
|
|
|
11189
|
-
/**
|
|
11190
|
-
* The form editor.
|
|
11314
|
+
/**
|
|
11315
|
+
* The form editor.
|
|
11191
11316
|
*/
|
|
11192
11317
|
class FormEditor {
|
|
11193
|
-
/**
|
|
11194
|
-
* @constructor
|
|
11195
|
-
* @param {FormEditorOptions} options
|
|
11318
|
+
/**
|
|
11319
|
+
* @constructor
|
|
11320
|
+
* @param {FormEditorOptions} options
|
|
11196
11321
|
*/
|
|
11197
11322
|
constructor(options = {}) {
|
|
11198
|
-
/**
|
|
11199
|
-
* @public
|
|
11200
|
-
* @type {OnEventType}
|
|
11323
|
+
/**
|
|
11324
|
+
* @public
|
|
11325
|
+
* @type {OnEventType}
|
|
11201
11326
|
*/
|
|
11202
11327
|
this.on = this._onEvent;
|
|
11203
11328
|
|
|
11204
|
-
/**
|
|
11205
|
-
* @public
|
|
11206
|
-
* @type {String}
|
|
11329
|
+
/**
|
|
11330
|
+
* @public
|
|
11331
|
+
* @type {String}
|
|
11207
11332
|
*/
|
|
11208
11333
|
this._id = ids.next();
|
|
11209
11334
|
|
|
11210
|
-
/**
|
|
11211
|
-
* @private
|
|
11212
|
-
* @type {Element}
|
|
11335
|
+
/**
|
|
11336
|
+
* @private
|
|
11337
|
+
* @type {Element}
|
|
11213
11338
|
*/
|
|
11214
11339
|
this._container = formJsViewer.createFormContainer();
|
|
11215
11340
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -11220,15 +11345,15 @@ class FormEditor {
|
|
|
11220
11345
|
properties = {}
|
|
11221
11346
|
} = options;
|
|
11222
11347
|
|
|
11223
|
-
/**
|
|
11224
|
-
* @private
|
|
11225
|
-
* @type {any}
|
|
11348
|
+
/**
|
|
11349
|
+
* @private
|
|
11350
|
+
* @type {any}
|
|
11226
11351
|
*/
|
|
11227
11352
|
this.exporter = exporter;
|
|
11228
11353
|
|
|
11229
|
-
/**
|
|
11230
|
-
* @private
|
|
11231
|
-
* @type {State}
|
|
11354
|
+
/**
|
|
11355
|
+
* @private
|
|
11356
|
+
* @type {State}
|
|
11232
11357
|
*/
|
|
11233
11358
|
this._state = {
|
|
11234
11359
|
properties,
|
|
@@ -11257,10 +11382,10 @@ class FormEditor {
|
|
|
11257
11382
|
this._detach(false);
|
|
11258
11383
|
}
|
|
11259
11384
|
|
|
11260
|
-
/**
|
|
11261
|
-
* @param {Schema} schema
|
|
11262
|
-
*
|
|
11263
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
11385
|
+
/**
|
|
11386
|
+
* @param {Schema} schema
|
|
11387
|
+
*
|
|
11388
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
11264
11389
|
*/
|
|
11265
11390
|
importSchema(schema) {
|
|
11266
11391
|
return new Promise((resolve, reject) => {
|
|
@@ -11289,15 +11414,15 @@ class FormEditor {
|
|
|
11289
11414
|
});
|
|
11290
11415
|
}
|
|
11291
11416
|
|
|
11292
|
-
/**
|
|
11293
|
-
* @returns {Schema}
|
|
11417
|
+
/**
|
|
11418
|
+
* @returns {Schema}
|
|
11294
11419
|
*/
|
|
11295
11420
|
saveSchema() {
|
|
11296
11421
|
return this.getSchema();
|
|
11297
11422
|
}
|
|
11298
11423
|
|
|
11299
|
-
/**
|
|
11300
|
-
* @returns {Schema}
|
|
11424
|
+
/**
|
|
11425
|
+
* @returns {Schema}
|
|
11301
11426
|
*/
|
|
11302
11427
|
getSchema() {
|
|
11303
11428
|
const {
|
|
@@ -11306,8 +11431,8 @@ class FormEditor {
|
|
|
11306
11431
|
return exportSchema(schema, this.exporter, formJsViewer.schemaVersion);
|
|
11307
11432
|
}
|
|
11308
11433
|
|
|
11309
|
-
/**
|
|
11310
|
-
* @param {Element|string} parentNode
|
|
11434
|
+
/**
|
|
11435
|
+
* @param {Element|string} parentNode
|
|
11311
11436
|
*/
|
|
11312
11437
|
attachTo(parentNode) {
|
|
11313
11438
|
if (!parentNode) {
|
|
@@ -11325,10 +11450,10 @@ class FormEditor {
|
|
|
11325
11450
|
this._detach();
|
|
11326
11451
|
}
|
|
11327
11452
|
|
|
11328
|
-
/**
|
|
11329
|
-
* @internal
|
|
11330
|
-
*
|
|
11331
|
-
* @param {boolean} [emit]
|
|
11453
|
+
/**
|
|
11454
|
+
* @internal
|
|
11455
|
+
*
|
|
11456
|
+
* @param {boolean} [emit]
|
|
11332
11457
|
*/
|
|
11333
11458
|
_detach(emit = true) {
|
|
11334
11459
|
const container = this._container,
|
|
@@ -11342,9 +11467,9 @@ class FormEditor {
|
|
|
11342
11467
|
parentNode.removeChild(container);
|
|
11343
11468
|
}
|
|
11344
11469
|
|
|
11345
|
-
/**
|
|
11346
|
-
* @param {any} property
|
|
11347
|
-
* @param {any} value
|
|
11470
|
+
/**
|
|
11471
|
+
* @param {any} property
|
|
11472
|
+
* @param {any} value
|
|
11348
11473
|
*/
|
|
11349
11474
|
setProperty(property, value) {
|
|
11350
11475
|
const properties = minDash.set(this._getState().properties, [property], value);
|
|
@@ -11353,21 +11478,21 @@ class FormEditor {
|
|
|
11353
11478
|
});
|
|
11354
11479
|
}
|
|
11355
11480
|
|
|
11356
|
-
/**
|
|
11357
|
-
* @param {string} type
|
|
11358
|
-
* @param {Function} handler
|
|
11481
|
+
/**
|
|
11482
|
+
* @param {string} type
|
|
11483
|
+
* @param {Function} handler
|
|
11359
11484
|
*/
|
|
11360
11485
|
off(type, handler) {
|
|
11361
11486
|
this.get('eventBus').off(type, handler);
|
|
11362
11487
|
}
|
|
11363
11488
|
|
|
11364
|
-
/**
|
|
11365
|
-
* @internal
|
|
11366
|
-
*
|
|
11367
|
-
* @param {FormEditorOptions} options
|
|
11368
|
-
* @param {Element} container
|
|
11369
|
-
*
|
|
11370
|
-
* @returns {Injector}
|
|
11489
|
+
/**
|
|
11490
|
+
* @internal
|
|
11491
|
+
*
|
|
11492
|
+
* @param {FormEditorOptions} options
|
|
11493
|
+
* @param {Element} container
|
|
11494
|
+
*
|
|
11495
|
+
* @returns {Injector}
|
|
11371
11496
|
*/
|
|
11372
11497
|
_createInjector(options, container) {
|
|
11373
11498
|
const {
|
|
@@ -11389,22 +11514,22 @@ class FormEditor {
|
|
|
11389
11514
|
}, core, ...modules, ...additionalModules]);
|
|
11390
11515
|
}
|
|
11391
11516
|
|
|
11392
|
-
/**
|
|
11393
|
-
* @internal
|
|
11517
|
+
/**
|
|
11518
|
+
* @internal
|
|
11394
11519
|
*/
|
|
11395
11520
|
_emit(type, data) {
|
|
11396
11521
|
this.get('eventBus').fire(type, data);
|
|
11397
11522
|
}
|
|
11398
11523
|
|
|
11399
|
-
/**
|
|
11400
|
-
* @internal
|
|
11524
|
+
/**
|
|
11525
|
+
* @internal
|
|
11401
11526
|
*/
|
|
11402
11527
|
_getState() {
|
|
11403
11528
|
return this._state;
|
|
11404
11529
|
}
|
|
11405
11530
|
|
|
11406
|
-
/**
|
|
11407
|
-
* @internal
|
|
11531
|
+
/**
|
|
11532
|
+
* @internal
|
|
11408
11533
|
*/
|
|
11409
11534
|
_setState(state) {
|
|
11410
11535
|
this._state = {
|
|
@@ -11414,15 +11539,15 @@ class FormEditor {
|
|
|
11414
11539
|
this._emit('changed', this._getState());
|
|
11415
11540
|
}
|
|
11416
11541
|
|
|
11417
|
-
/**
|
|
11418
|
-
* @internal
|
|
11542
|
+
/**
|
|
11543
|
+
* @internal
|
|
11419
11544
|
*/
|
|
11420
11545
|
_getModules() {
|
|
11421
11546
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, formJsViewer.MarkdownModule, PropertiesPanelModule, RenderInjectionModule];
|
|
11422
11547
|
}
|
|
11423
11548
|
|
|
11424
|
-
/**
|
|
11425
|
-
* @internal
|
|
11549
|
+
/**
|
|
11550
|
+
* @internal
|
|
11426
11551
|
*/
|
|
11427
11552
|
_onEvent(type, priority, handler) {
|
|
11428
11553
|
this.get('eventBus').on(type, priority, handler);
|