@bpmn-io/form-js-editor 1.6.3 → 1.6.4
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 +152 -152
- package/dist/assets/form-js-editor-base.css +863 -863
- package/dist/index.cjs +347 -347
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +347 -347
- package/dist/index.es.js.map +1 -1
- package/dist/types/FormEditor.d.ts +0 -20
- package/dist/types/types.d.ts +28 -28
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -517,10 +517,10 @@ function invokeFunction(fn, args) {
|
|
|
517
517
|
return fn.apply(null, args);
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
/**
|
|
521
|
-
* A factory to create a configurable debouncer.
|
|
522
|
-
*
|
|
523
|
-
* @param {number|boolean} [config=true]
|
|
520
|
+
/**
|
|
521
|
+
* A factory to create a configurable debouncer.
|
|
522
|
+
*
|
|
523
|
+
* @param {number|boolean} [config=true]
|
|
524
524
|
*/
|
|
525
525
|
function DebounceFactory(config = true) {
|
|
526
526
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -533,11 +533,11 @@ function DebounceFactory(config = true) {
|
|
|
533
533
|
DebounceFactory.$inject = ['config.debounce'];
|
|
534
534
|
|
|
535
535
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
536
|
-
/**
|
|
537
|
-
* Updates a form fields id.
|
|
538
|
-
*
|
|
539
|
-
* @param {Object} formField
|
|
540
|
-
* @param {string} newId
|
|
536
|
+
/**
|
|
537
|
+
* Updates a form fields id.
|
|
538
|
+
*
|
|
539
|
+
* @param {Object} formField
|
|
540
|
+
* @param {string} newId
|
|
541
541
|
*/
|
|
542
542
|
updateId(formField, newId) {
|
|
543
543
|
this._validateId(newId);
|
|
@@ -558,13 +558,13 @@ class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
-
/**
|
|
562
|
-
* Validate the suitability of the given id and signals a problem
|
|
563
|
-
* with an exception.
|
|
564
|
-
*
|
|
565
|
-
* @param {string} id
|
|
566
|
-
*
|
|
567
|
-
* @throws {Error} if id is empty or already assigned
|
|
561
|
+
/**
|
|
562
|
+
* Validate the suitability of the given id and signals a problem
|
|
563
|
+
* with an exception.
|
|
564
|
+
*
|
|
565
|
+
* @param {string} id
|
|
566
|
+
*
|
|
567
|
+
* @throws {Error} if id is empty or already assigned
|
|
568
568
|
*/
|
|
569
569
|
_validateId(id) {
|
|
570
570
|
if (!id) {
|
|
@@ -581,11 +581,11 @@ const MAX_COLUMNS = 16;
|
|
|
581
581
|
const MIN_COLUMNS = 2;
|
|
582
582
|
const MAX_FIELDS_PER_ROW = 4;
|
|
583
583
|
class FormLayoutValidator {
|
|
584
|
-
/**
|
|
585
|
-
* @constructor
|
|
586
|
-
*
|
|
587
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
588
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
584
|
+
/**
|
|
585
|
+
* @constructor
|
|
586
|
+
*
|
|
587
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
588
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
589
589
|
*/
|
|
590
590
|
constructor(formLayouter, formFieldRegistry) {
|
|
591
591
|
this._formLayouter = formLayouter;
|
|
@@ -656,21 +656,21 @@ function editorFormFieldClasses(type, {
|
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
658
|
|
|
659
|
-
/**
|
|
660
|
-
* Add a dragger that calls back the passed function with
|
|
661
|
-
* { event, delta } on drag.
|
|
662
|
-
*
|
|
663
|
-
* @example
|
|
664
|
-
*
|
|
665
|
-
* function dragMove(event, delta) {
|
|
666
|
-
* // we are dragging (!!)
|
|
667
|
-
* }
|
|
668
|
-
*
|
|
669
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
670
|
-
*
|
|
671
|
-
* @param {Function} fn
|
|
672
|
-
*
|
|
673
|
-
* @return {Function} drag start callback function
|
|
659
|
+
/**
|
|
660
|
+
* Add a dragger that calls back the passed function with
|
|
661
|
+
* { event, delta } on drag.
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
*
|
|
665
|
+
* function dragMove(event, delta) {
|
|
666
|
+
* // we are dragging (!!)
|
|
667
|
+
* }
|
|
668
|
+
*
|
|
669
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
670
|
+
*
|
|
671
|
+
* @param {Function} fn
|
|
672
|
+
*
|
|
673
|
+
* @return {Function} drag start callback function
|
|
674
674
|
*/
|
|
675
675
|
function createDragger$1(fn) {
|
|
676
676
|
let self;
|
|
@@ -711,12 +711,12 @@ function createDragger$1(fn) {
|
|
|
711
711
|
return onDragStart;
|
|
712
712
|
}
|
|
713
713
|
|
|
714
|
-
/**
|
|
715
|
-
* Throttle function call according UI update cycle.
|
|
716
|
-
*
|
|
717
|
-
* @param {Function} fn
|
|
718
|
-
*
|
|
719
|
-
* @return {Function} throttled fn
|
|
714
|
+
/**
|
|
715
|
+
* Throttle function call according UI update cycle.
|
|
716
|
+
*
|
|
717
|
+
* @param {Function} fn
|
|
718
|
+
*
|
|
719
|
+
* @return {Function} throttled fn
|
|
720
720
|
*/
|
|
721
721
|
function throttle(fn) {
|
|
722
722
|
let active = false;
|
|
@@ -772,11 +772,11 @@ const DragAndDropContext = createContext({
|
|
|
772
772
|
});
|
|
773
773
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
774
774
|
|
|
775
|
-
/**
|
|
776
|
-
* @param {string} type
|
|
777
|
-
* @param {boolean} [strict]
|
|
778
|
-
*
|
|
779
|
-
* @returns {any}
|
|
775
|
+
/**
|
|
776
|
+
* @param {string} type
|
|
777
|
+
* @param {boolean} [strict]
|
|
778
|
+
*
|
|
779
|
+
* @returns {any}
|
|
780
780
|
*/
|
|
781
781
|
function getService$1(type, strict) {}
|
|
782
782
|
const FormEditorContext = createContext({
|
|
@@ -1211,23 +1211,23 @@ var Slot = (props => {
|
|
|
1211
1211
|
return fillsAndSeparators;
|
|
1212
1212
|
});
|
|
1213
1213
|
|
|
1214
|
-
/**
|
|
1215
|
-
* Creates a Fragment for a fill.
|
|
1216
|
-
*
|
|
1217
|
-
* @param {Object} fill Fill to be rendered
|
|
1218
|
-
* @returns {Object} Preact Fragment containing fill's children
|
|
1214
|
+
/**
|
|
1215
|
+
* Creates a Fragment for a fill.
|
|
1216
|
+
*
|
|
1217
|
+
* @param {Object} fill Fill to be rendered
|
|
1218
|
+
* @returns {Object} Preact Fragment containing fill's children
|
|
1219
1219
|
*/
|
|
1220
1220
|
const FillFragment = fill => jsx(Fragment, {
|
|
1221
1221
|
children: fill.children
|
|
1222
1222
|
}, fill.id);
|
|
1223
1223
|
|
|
1224
|
-
/**
|
|
1225
|
-
* Creates an array of fills, with separators inserted between groups.
|
|
1226
|
-
*
|
|
1227
|
-
* @param {Array} groups Groups of fills
|
|
1228
|
-
* @param {Function} fillRenderer Function to create a fill
|
|
1229
|
-
* @param {Function} separatorRenderer Function to create a separator
|
|
1230
|
-
* @returns {Array} Array of fills and separators
|
|
1224
|
+
/**
|
|
1225
|
+
* Creates an array of fills, with separators inserted between groups.
|
|
1226
|
+
*
|
|
1227
|
+
* @param {Array} groups Groups of fills
|
|
1228
|
+
* @param {Function} fillRenderer Function to create a fill
|
|
1229
|
+
* @param {Function} separatorRenderer Function to create a separator
|
|
1230
|
+
* @returns {Array} Array of fills and separators
|
|
1231
1231
|
*/
|
|
1232
1232
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
1233
1233
|
const result = [];
|
|
@@ -1245,8 +1245,8 @@ const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
|
1245
1245
|
return result;
|
|
1246
1246
|
};
|
|
1247
1247
|
|
|
1248
|
-
/**
|
|
1249
|
-
* Groups fills by group name property.
|
|
1248
|
+
/**
|
|
1249
|
+
* Groups fills by group name property.
|
|
1250
1250
|
*/
|
|
1251
1251
|
const _groupByGroupName = fills => {
|
|
1252
1252
|
const groups = [];
|
|
@@ -1266,8 +1266,8 @@ const _groupByGroupName = fills => {
|
|
|
1266
1266
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
1267
1267
|
};
|
|
1268
1268
|
|
|
1269
|
-
/**
|
|
1270
|
-
* Compares fills by priority.
|
|
1269
|
+
/**
|
|
1270
|
+
* Compares fills by priority.
|
|
1271
1271
|
*/
|
|
1272
1272
|
const _comparePriority = (a, b) => {
|
|
1273
1273
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -1485,11 +1485,11 @@ function groupEntries(entries) {
|
|
|
1485
1485
|
return groups.filter(g => g.entries.length);
|
|
1486
1486
|
}
|
|
1487
1487
|
|
|
1488
|
-
/**
|
|
1489
|
-
* Returns a list of palette entries.
|
|
1490
|
-
*
|
|
1491
|
-
* @param {FormFields} formFields
|
|
1492
|
-
* @returns {Array<PaletteEntry>}
|
|
1488
|
+
/**
|
|
1489
|
+
* Returns a list of palette entries.
|
|
1490
|
+
*
|
|
1491
|
+
* @param {FormFields} formFields
|
|
1492
|
+
* @returns {Array<PaletteEntry>}
|
|
1493
1493
|
*/
|
|
1494
1494
|
function collectPaletteEntries(formFields) {
|
|
1495
1495
|
return Object.entries(formFields._formFields).map(([type, formField]) => {
|
|
@@ -1508,12 +1508,12 @@ function collectPaletteEntries(formFields) {
|
|
|
1508
1508
|
}) => type !== 'default');
|
|
1509
1509
|
}
|
|
1510
1510
|
|
|
1511
|
-
/**
|
|
1512
|
-
* There are various options to specify an icon for a palette entry.
|
|
1513
|
-
*
|
|
1514
|
-
* a) via `iconUrl` property in a form field config
|
|
1515
|
-
* b) via `icon` property in a form field config
|
|
1516
|
-
* c) via statically defined iconsByType (fallback)
|
|
1511
|
+
/**
|
|
1512
|
+
* There are various options to specify an icon for a palette entry.
|
|
1513
|
+
*
|
|
1514
|
+
* a) via `iconUrl` property in a form field config
|
|
1515
|
+
* b) via `icon` property in a form field config
|
|
1516
|
+
* c) via statically defined iconsByType (fallback)
|
|
1517
1517
|
*/
|
|
1518
1518
|
function getPaletteIcon(entry) {
|
|
1519
1519
|
const {
|
|
@@ -1580,20 +1580,20 @@ const DRAG_NO_DROP_CLS = 'fjs-no-drop';
|
|
|
1580
1580
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
1581
1581
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
1582
1582
|
|
|
1583
|
-
/**
|
|
1584
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1583
|
+
/**
|
|
1584
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1585
1585
|
*/
|
|
1586
1586
|
|
|
1587
1587
|
class Dragging {
|
|
1588
|
-
/**
|
|
1589
|
-
* @constructor
|
|
1590
|
-
*
|
|
1591
|
-
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1592
|
-
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1593
|
-
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1594
|
-
* @param { import('../../core/EventBus').default } eventBus
|
|
1595
|
-
* @param { import('../modeling/Modeling').default } modeling
|
|
1596
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
1588
|
+
/**
|
|
1589
|
+
* @constructor
|
|
1590
|
+
*
|
|
1591
|
+
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1592
|
+
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1593
|
+
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1594
|
+
* @param { import('../../core/EventBus').default } eventBus
|
|
1595
|
+
* @param { import('../modeling/Modeling').default } modeling
|
|
1596
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
1597
1597
|
*/
|
|
1598
1598
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling, pathRegistry) {
|
|
1599
1599
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -1604,13 +1604,13 @@ class Dragging {
|
|
|
1604
1604
|
this._pathRegistry = pathRegistry;
|
|
1605
1605
|
}
|
|
1606
1606
|
|
|
1607
|
-
/**
|
|
1608
|
-
* Calculates position in form schema given the dropped place.
|
|
1609
|
-
*
|
|
1610
|
-
* @param { FormRow } targetRow
|
|
1611
|
-
* @param { any } targetFormField
|
|
1612
|
-
* @param { HTMLElement } sibling
|
|
1613
|
-
* @returns { number }
|
|
1607
|
+
/**
|
|
1608
|
+
* Calculates position in form schema given the dropped place.
|
|
1609
|
+
*
|
|
1610
|
+
* @param { FormRow } targetRow
|
|
1611
|
+
* @param { any } targetFormField
|
|
1612
|
+
* @param { HTMLElement } sibling
|
|
1613
|
+
* @returns { number }
|
|
1614
1614
|
*/
|
|
1615
1615
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
1616
1616
|
/** @type HTMLElement */
|
|
@@ -1756,8 +1756,8 @@ class Dragging {
|
|
|
1756
1756
|
}
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
|
-
/**
|
|
1760
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1759
|
+
/**
|
|
1760
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1761
1761
|
*/
|
|
1762
1762
|
createDragulaInstance(options) {
|
|
1763
1763
|
const {
|
|
@@ -2196,7 +2196,7 @@ function DebugColumns(props) {
|
|
|
2196
2196
|
return null;
|
|
2197
2197
|
}
|
|
2198
2198
|
return jsx("div", {
|
|
2199
|
-
style: "width: fit-content
|
|
2199
|
+
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;",
|
|
2200
2200
|
class: "fjs-debug-columns",
|
|
2201
2201
|
children: (field.layout || {}).columns || 'auto'
|
|
2202
2202
|
});
|
|
@@ -3323,10 +3323,10 @@ function updateRow(formField, rowId) {
|
|
|
3323
3323
|
}
|
|
3324
3324
|
|
|
3325
3325
|
class AddFormFieldHandler {
|
|
3326
|
-
/**
|
|
3327
|
-
* @constructor
|
|
3328
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3329
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3326
|
+
/**
|
|
3327
|
+
* @constructor
|
|
3328
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3329
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3330
3330
|
*/
|
|
3331
3331
|
constructor(formEditor, formFieldRegistry) {
|
|
3332
3332
|
this._formEditor = formEditor;
|
|
@@ -3387,10 +3387,10 @@ class AddFormFieldHandler {
|
|
|
3387
3387
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3388
3388
|
|
|
3389
3389
|
class EditFormFieldHandler {
|
|
3390
|
-
/**
|
|
3391
|
-
* @constructor
|
|
3392
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3393
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3390
|
+
/**
|
|
3391
|
+
* @constructor
|
|
3392
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3393
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3394
3394
|
*/
|
|
3395
3395
|
constructor(formEditor, formFieldRegistry) {
|
|
3396
3396
|
this._formEditor = formEditor;
|
|
@@ -3453,12 +3453,12 @@ class EditFormFieldHandler {
|
|
|
3453
3453
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3454
3454
|
|
|
3455
3455
|
class MoveFormFieldHandler {
|
|
3456
|
-
/**
|
|
3457
|
-
* @constructor
|
|
3458
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3459
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3460
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3461
|
-
* @param { import('@bpmn-io/form-js-viewer').FormLayouter } formLayouter
|
|
3456
|
+
/**
|
|
3457
|
+
* @constructor
|
|
3458
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3459
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3460
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3461
|
+
* @param { import('@bpmn-io/form-js-viewer').FormLayouter } formLayouter
|
|
3462
3462
|
*/
|
|
3463
3463
|
constructor(formEditor, formFieldRegistry, pathRegistry, formLayouter) {
|
|
3464
3464
|
this._formEditor = formEditor;
|
|
@@ -3569,10 +3569,10 @@ class MoveFormFieldHandler {
|
|
|
3569
3569
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry', 'pathRegistry', 'formLayouter'];
|
|
3570
3570
|
|
|
3571
3571
|
class RemoveFormFieldHandler {
|
|
3572
|
-
/**
|
|
3573
|
-
* @constructor
|
|
3574
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3575
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3572
|
+
/**
|
|
3573
|
+
* @constructor
|
|
3574
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3575
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3576
3576
|
*/
|
|
3577
3577
|
constructor(formEditor, formFieldRegistry) {
|
|
3578
3578
|
this._formEditor = formEditor;
|
|
@@ -3632,9 +3632,9 @@ class RemoveFormFieldHandler {
|
|
|
3632
3632
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3633
3633
|
|
|
3634
3634
|
class UpdateIdClaimHandler {
|
|
3635
|
-
/**
|
|
3636
|
-
* @constructor
|
|
3637
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3635
|
+
/**
|
|
3636
|
+
* @constructor
|
|
3637
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3638
3638
|
*/
|
|
3639
3639
|
constructor(formFieldRegistry) {
|
|
3640
3640
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -3667,9 +3667,9 @@ class UpdateIdClaimHandler {
|
|
|
3667
3667
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
3668
3668
|
|
|
3669
3669
|
class UpdateKeyClaimHandler {
|
|
3670
|
-
/**
|
|
3671
|
-
* @constructor
|
|
3672
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3670
|
+
/**
|
|
3671
|
+
* @constructor
|
|
3672
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3673
3673
|
*/
|
|
3674
3674
|
constructor(pathRegistry) {
|
|
3675
3675
|
this._pathRegistry = pathRegistry;
|
|
@@ -3717,9 +3717,9 @@ class UpdateKeyClaimHandler {
|
|
|
3717
3717
|
UpdateKeyClaimHandler.$inject = ['pathRegistry'];
|
|
3718
3718
|
|
|
3719
3719
|
class UpdatePathClaimHandler {
|
|
3720
|
-
/**
|
|
3721
|
-
* @constructor
|
|
3722
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3720
|
+
/**
|
|
3721
|
+
* @constructor
|
|
3722
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
3723
3723
|
*/
|
|
3724
3724
|
constructor(pathRegistry) {
|
|
3725
3725
|
this._pathRegistry = pathRegistry;
|
|
@@ -4306,8 +4306,8 @@ class ValidateBehavior extends CommandInterceptor {
|
|
|
4306
4306
|
constructor(eventBus) {
|
|
4307
4307
|
super(eventBus);
|
|
4308
4308
|
|
|
4309
|
-
/**
|
|
4310
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
4309
|
+
/**
|
|
4310
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
4311
4311
|
*/
|
|
4312
4312
|
this.preExecute('formField.edit', function (context) {
|
|
4313
4313
|
const {
|
|
@@ -4334,11 +4334,11 @@ class OptionsSourceBehavior extends CommandInterceptor {
|
|
|
4334
4334
|
constructor(eventBus) {
|
|
4335
4335
|
super(eventBus);
|
|
4336
4336
|
|
|
4337
|
-
/**
|
|
4338
|
-
* Cleanup properties on changing the values source.
|
|
4339
|
-
*
|
|
4340
|
-
* 1) Remove other sources, e.g. set `values` => remove `valuesKey` and `valuesExpression`
|
|
4341
|
-
* 2) Remove default values for all other values sources
|
|
4337
|
+
/**
|
|
4338
|
+
* Cleanup properties on changing the values source.
|
|
4339
|
+
*
|
|
4340
|
+
* 1) Remove other sources, e.g. set `values` => remove `valuesKey` and `valuesExpression`
|
|
4341
|
+
* 2) Remove default values for all other values sources
|
|
4342
4342
|
*/
|
|
4343
4343
|
this.preExecute('formField.edit', function (context) {
|
|
4344
4344
|
const {
|
|
@@ -4998,22 +4998,22 @@ var SelectionModule = {
|
|
|
4998
4998
|
selectionBehavior: ['type', SelectionBehavior]
|
|
4999
4999
|
};
|
|
5000
5000
|
|
|
5001
|
-
/**
|
|
5002
|
-
* Base class for sectionable UI modules.
|
|
5003
|
-
*
|
|
5004
|
-
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
5005
|
-
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
5006
|
-
*
|
|
5007
|
-
* @class SectionModuleBase
|
|
5001
|
+
/**
|
|
5002
|
+
* Base class for sectionable UI modules.
|
|
5003
|
+
*
|
|
5004
|
+
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
5005
|
+
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
5006
|
+
*
|
|
5007
|
+
* @class SectionModuleBase
|
|
5008
5008
|
*/
|
|
5009
5009
|
class SectionModuleBase {
|
|
5010
|
-
/**
|
|
5011
|
-
* Create a SectionModuleBase instance.
|
|
5012
|
-
*
|
|
5013
|
-
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
5014
|
-
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
5015
|
-
*
|
|
5016
|
-
* @constructor
|
|
5010
|
+
/**
|
|
5011
|
+
* Create a SectionModuleBase instance.
|
|
5012
|
+
*
|
|
5013
|
+
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
5014
|
+
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
5015
|
+
*
|
|
5016
|
+
* @constructor
|
|
5017
5017
|
*/
|
|
5018
5018
|
constructor(eventBus, sectionKey) {
|
|
5019
5019
|
this._eventBus = eventBus;
|
|
@@ -5026,10 +5026,10 @@ class SectionModuleBase {
|
|
|
5026
5026
|
});
|
|
5027
5027
|
}
|
|
5028
5028
|
|
|
5029
|
-
/**
|
|
5030
|
-
* Attach the managed section to a parent node.
|
|
5031
|
-
*
|
|
5032
|
-
* @param {HTMLElement} container - The parent node to attach to.
|
|
5029
|
+
/**
|
|
5030
|
+
* Attach the managed section to a parent node.
|
|
5031
|
+
*
|
|
5032
|
+
* @param {HTMLElement} container - The parent node to attach to.
|
|
5033
5033
|
*/
|
|
5034
5034
|
attachTo(container) {
|
|
5035
5035
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -5037,22 +5037,22 @@ class SectionModuleBase {
|
|
|
5037
5037
|
}));
|
|
5038
5038
|
}
|
|
5039
5039
|
|
|
5040
|
-
/**
|
|
5041
|
-
* Detach the managed section from its parent node.
|
|
5040
|
+
/**
|
|
5041
|
+
* Detach the managed section from its parent node.
|
|
5042
5042
|
*/
|
|
5043
5043
|
detach() {
|
|
5044
5044
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
5045
5045
|
}
|
|
5046
5046
|
|
|
5047
|
-
/**
|
|
5048
|
-
* Reset the managed section to its initial state.
|
|
5047
|
+
/**
|
|
5048
|
+
* Reset the managed section to its initial state.
|
|
5049
5049
|
*/
|
|
5050
5050
|
reset() {
|
|
5051
5051
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
5052
5052
|
}
|
|
5053
5053
|
|
|
5054
|
-
/**
|
|
5055
|
-
* Circumvents timing issues.
|
|
5054
|
+
/**
|
|
5055
|
+
* Circumvents timing issues.
|
|
5056
5056
|
*/
|
|
5057
5057
|
_onceSectionRendered(callback) {
|
|
5058
5058
|
if (this.isSectionRendered) {
|
|
@@ -8730,11 +8730,11 @@ var index = {
|
|
|
8730
8730
|
feelPopup: ['type', FeelPopupModule]
|
|
8731
8731
|
};
|
|
8732
8732
|
|
|
8733
|
-
/**
|
|
8734
|
-
* @param {string} type
|
|
8735
|
-
* @param {boolean} [strict]
|
|
8736
|
-
*
|
|
8737
|
-
* @returns {any}
|
|
8733
|
+
/**
|
|
8734
|
+
* @param {string} type
|
|
8735
|
+
* @param {boolean} [strict]
|
|
8736
|
+
*
|
|
8737
|
+
* @returns {any}
|
|
8738
8738
|
*/
|
|
8739
8739
|
function getService(type, strict) {}
|
|
8740
8740
|
const PropertiesPanelContext = createContext({
|
|
@@ -8768,8 +8768,8 @@ function textToLabel(text) {
|
|
|
8768
8768
|
return null;
|
|
8769
8769
|
}
|
|
8770
8770
|
|
|
8771
|
-
/**
|
|
8772
|
-
* @param {string} path
|
|
8771
|
+
/**
|
|
8772
|
+
* @param {string} path
|
|
8773
8773
|
*/
|
|
8774
8774
|
function isValidDotPath(path) {
|
|
8775
8775
|
return /^\w+(\.\w+)*$/.test(path);
|
|
@@ -8795,8 +8795,8 @@ function hasOptionsGroupsConfigured(formFieldDefinition) {
|
|
|
8795
8795
|
return propertiesPanelEntries.some(id => id === 'values');
|
|
8796
8796
|
}
|
|
8797
8797
|
|
|
8798
|
-
/**
|
|
8799
|
-
* @param {string} path
|
|
8798
|
+
/**
|
|
8799
|
+
* @param {string} path
|
|
8800
8800
|
*/
|
|
8801
8801
|
function hasIntegerPathSegment(path) {
|
|
8802
8802
|
return path.split('.').some(segment => /^\d+$/.test(segment));
|
|
@@ -8809,10 +8809,10 @@ function useService (type, strict) {
|
|
|
8809
8809
|
return getService(type, strict);
|
|
8810
8810
|
}
|
|
8811
8811
|
|
|
8812
|
-
/**
|
|
8813
|
-
* Retrieve list of variables from the form schema.
|
|
8814
|
-
*
|
|
8815
|
-
* @returns { string[] } list of variables used in form schema
|
|
8812
|
+
/**
|
|
8813
|
+
* Retrieve list of variables from the form schema.
|
|
8814
|
+
*
|
|
8815
|
+
* @returns { string[] } list of variables used in form schema
|
|
8816
8816
|
*/
|
|
8817
8817
|
function useVariables() {
|
|
8818
8818
|
const form = useService('formEditor');
|
|
@@ -8878,8 +8878,8 @@ const PropertiesPanelHeaderProvider = {
|
|
|
8878
8878
|
}
|
|
8879
8879
|
};
|
|
8880
8880
|
|
|
8881
|
-
/**
|
|
8882
|
-
* Provide placeholders for empty and multiple state.
|
|
8881
|
+
/**
|
|
8882
|
+
* Provide placeholders for empty and multiple state.
|
|
8883
8883
|
*/
|
|
8884
8884
|
const PropertiesPanelPlaceholderProvider = {
|
|
8885
8885
|
getEmpty: () => {
|
|
@@ -8924,9 +8924,9 @@ function FormPropertiesPanel(props) {
|
|
|
8924
8924
|
});
|
|
8925
8925
|
}, [eventBus, formEditor, selectionModule]);
|
|
8926
8926
|
useLayoutEffect(() => {
|
|
8927
|
-
/**
|
|
8928
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
8929
|
-
* once we have a proper updater/change support
|
|
8927
|
+
/**
|
|
8928
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
8929
|
+
* once we have a proper updater/change support
|
|
8930
8930
|
*/
|
|
8931
8931
|
eventBus.on('changed', refresh);
|
|
8932
8932
|
eventBus.on('import.done', refresh);
|
|
@@ -8978,17 +8978,17 @@ function FormPropertiesPanel(props) {
|
|
|
8978
8978
|
|
|
8979
8979
|
const DEFAULT_PRIORITY = 1000;
|
|
8980
8980
|
|
|
8981
|
-
/**
|
|
8982
|
-
* @typedef { { parent: Element } } PropertiesPanelConfig
|
|
8983
|
-
* @typedef { import('../../core/EventBus').default } EventBus
|
|
8984
|
-
* @typedef { import('../../types').Injector } Injector
|
|
8985
|
-
* @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
|
|
8981
|
+
/**
|
|
8982
|
+
* @typedef { { parent: Element } } PropertiesPanelConfig
|
|
8983
|
+
* @typedef { import('../../core/EventBus').default } EventBus
|
|
8984
|
+
* @typedef { import('../../types').Injector } Injector
|
|
8985
|
+
* @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
|
|
8986
8986
|
*/
|
|
8987
8987
|
|
|
8988
|
-
/**
|
|
8989
|
-
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
8990
|
-
* @param {Injector} injector
|
|
8991
|
-
* @param {EventBus} eventBus
|
|
8988
|
+
/**
|
|
8989
|
+
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
8990
|
+
* @param {Injector} injector
|
|
8991
|
+
* @param {EventBus} eventBus
|
|
8992
8992
|
*/
|
|
8993
8993
|
class PropertiesPanelRenderer {
|
|
8994
8994
|
constructor(propertiesPanelConfig, injector, eventBus) {
|
|
@@ -9006,10 +9006,10 @@ class PropertiesPanelRenderer {
|
|
|
9006
9006
|
});
|
|
9007
9007
|
}
|
|
9008
9008
|
|
|
9009
|
-
/**
|
|
9010
|
-
* Attach the properties panel to a parent node.
|
|
9011
|
-
*
|
|
9012
|
-
* @param {HTMLElement} container
|
|
9009
|
+
/**
|
|
9010
|
+
* Attach the properties panel to a parent node.
|
|
9011
|
+
*
|
|
9012
|
+
* @param {HTMLElement} container
|
|
9013
9013
|
*/
|
|
9014
9014
|
attachTo(container) {
|
|
9015
9015
|
if (!container) {
|
|
@@ -9029,8 +9029,8 @@ class PropertiesPanelRenderer {
|
|
|
9029
9029
|
this._eventBus.fire('propertiesPanel.attach');
|
|
9030
9030
|
}
|
|
9031
9031
|
|
|
9032
|
-
/**
|
|
9033
|
-
* Detach the properties panel from its parent node.
|
|
9032
|
+
/**
|
|
9033
|
+
* Detach the properties panel from its parent node.
|
|
9034
9034
|
*/
|
|
9035
9035
|
detach() {
|
|
9036
9036
|
const parentNode = this._container.parentNode;
|
|
@@ -9054,11 +9054,11 @@ class PropertiesPanelRenderer {
|
|
|
9054
9054
|
}
|
|
9055
9055
|
}
|
|
9056
9056
|
|
|
9057
|
-
/**
|
|
9058
|
-
* Register a new properties provider to the properties panel.
|
|
9059
|
-
*
|
|
9060
|
-
* @param {PropertiesProvider} provider
|
|
9061
|
-
* @param {Number} [priority]
|
|
9057
|
+
/**
|
|
9058
|
+
* Register a new properties provider to the properties panel.
|
|
9059
|
+
*
|
|
9060
|
+
* @param {PropertiesProvider} provider
|
|
9061
|
+
* @param {Number} [priority]
|
|
9062
9062
|
*/
|
|
9063
9063
|
registerProvider(provider, priority) {
|
|
9064
9064
|
if (!priority) {
|
|
@@ -10138,9 +10138,9 @@ function TimeLabel(props) {
|
|
|
10138
10138
|
|
|
10139
10139
|
// helpers //////////
|
|
10140
10140
|
|
|
10141
|
-
/**
|
|
10142
|
-
* @param {string} type
|
|
10143
|
-
* @returns {string}
|
|
10141
|
+
/**
|
|
10142
|
+
* @param {string} type
|
|
10143
|
+
* @returns {string}
|
|
10144
10144
|
*/
|
|
10145
10145
|
function getLabelText(type) {
|
|
10146
10146
|
switch (type) {
|
|
@@ -10954,14 +10954,14 @@ function Value(props) {
|
|
|
10954
10954
|
|
|
10955
10955
|
// helpers //////////
|
|
10956
10956
|
|
|
10957
|
-
/**
|
|
10958
|
-
* Returns copy of object with updated value.
|
|
10959
|
-
*
|
|
10960
|
-
* @param {Object} properties
|
|
10961
|
-
* @param {string} key
|
|
10962
|
-
* @param {string} value
|
|
10963
|
-
*
|
|
10964
|
-
* @returns {Object}
|
|
10957
|
+
/**
|
|
10958
|
+
* Returns copy of object with updated value.
|
|
10959
|
+
*
|
|
10960
|
+
* @param {Object} properties
|
|
10961
|
+
* @param {string} key
|
|
10962
|
+
* @param {string} value
|
|
10963
|
+
*
|
|
10964
|
+
* @returns {Object}
|
|
10965
10965
|
*/
|
|
10966
10966
|
function updateValue(properties, key, value) {
|
|
10967
10967
|
return {
|
|
@@ -10970,14 +10970,14 @@ function updateValue(properties, key, value) {
|
|
|
10970
10970
|
};
|
|
10971
10971
|
}
|
|
10972
10972
|
|
|
10973
|
-
/**
|
|
10974
|
-
* Returns copy of object with updated key.
|
|
10975
|
-
*
|
|
10976
|
-
* @param {Object} properties
|
|
10977
|
-
* @param {string} oldKey
|
|
10978
|
-
* @param {string} newKey
|
|
10979
|
-
*
|
|
10980
|
-
* @returns {Object}
|
|
10973
|
+
/**
|
|
10974
|
+
* Returns copy of object with updated key.
|
|
10975
|
+
*
|
|
10976
|
+
* @param {Object} properties
|
|
10977
|
+
* @param {string} oldKey
|
|
10978
|
+
* @param {string} newKey
|
|
10979
|
+
*
|
|
10980
|
+
* @returns {Object}
|
|
10981
10981
|
*/
|
|
10982
10982
|
function updateKey(properties, oldKey, newKey) {
|
|
10983
10983
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -11545,9 +11545,9 @@ function Source(props) {
|
|
|
11545
11545
|
editField(field, path, value);
|
|
11546
11546
|
};
|
|
11547
11547
|
|
|
11548
|
-
/**
|
|
11549
|
-
* @param {string|void} value
|
|
11550
|
-
* @returns {string|null}
|
|
11548
|
+
/**
|
|
11549
|
+
* @param {string|void} value
|
|
11550
|
+
* @returns {string|null}
|
|
11551
11551
|
*/
|
|
11552
11552
|
const validate = value => {
|
|
11553
11553
|
if (!isString(value) || value.length === 0) {
|
|
@@ -11608,8 +11608,8 @@ function Pagination(props) {
|
|
|
11608
11608
|
return isNumber(get(field, path));
|
|
11609
11609
|
};
|
|
11610
11610
|
|
|
11611
|
-
/**
|
|
11612
|
-
* @param {boolean} value
|
|
11611
|
+
/**
|
|
11612
|
+
* @param {boolean} value
|
|
11613
11613
|
*/
|
|
11614
11614
|
const setValue = value => {
|
|
11615
11615
|
value ? editField(field, path, defaultRowCount) : editField(field, path, undefined);
|
|
@@ -11650,10 +11650,10 @@ function RowCount(props) {
|
|
|
11650
11650
|
const debounce = useService('debounce');
|
|
11651
11651
|
const getValue = () => get(field, path$2);
|
|
11652
11652
|
|
|
11653
|
-
/**
|
|
11654
|
-
* @param {number|void} value
|
|
11655
|
-
* @param {string|null} error
|
|
11656
|
-
* @returns {void}
|
|
11653
|
+
/**
|
|
11654
|
+
* @param {number|void} value
|
|
11655
|
+
* @param {string|null} error
|
|
11656
|
+
* @returns {void}
|
|
11657
11657
|
*/
|
|
11658
11658
|
const setValue = (value, error) => {
|
|
11659
11659
|
if (error) {
|
|
@@ -11662,9 +11662,9 @@ function RowCount(props) {
|
|
|
11662
11662
|
editField(field, path$2, value);
|
|
11663
11663
|
};
|
|
11664
11664
|
|
|
11665
|
-
/**
|
|
11666
|
-
* @param {string|void} value
|
|
11667
|
-
* @returns {string|null}
|
|
11665
|
+
/**
|
|
11666
|
+
* @param {string|void} value
|
|
11667
|
+
* @returns {string|null}
|
|
11668
11668
|
*/
|
|
11669
11669
|
const validate = value => {
|
|
11670
11670
|
if (isNil(value)) {
|
|
@@ -11726,8 +11726,8 @@ function HeadersSourceSelect(props) {
|
|
|
11726
11726
|
id
|
|
11727
11727
|
} = props;
|
|
11728
11728
|
|
|
11729
|
-
/**
|
|
11730
|
-
* @returns {string|void}
|
|
11729
|
+
/**
|
|
11730
|
+
* @returns {string|void}
|
|
11731
11731
|
*/
|
|
11732
11732
|
const getValue = () => {
|
|
11733
11733
|
const columns = get(field, COLUMNS_PATH);
|
|
@@ -11740,8 +11740,8 @@ function HeadersSourceSelect(props) {
|
|
|
11740
11740
|
}
|
|
11741
11741
|
};
|
|
11742
11742
|
|
|
11743
|
-
/**
|
|
11744
|
-
* @param {string|void} value
|
|
11743
|
+
/**
|
|
11744
|
+
* @param {string|void} value
|
|
11745
11745
|
*/
|
|
11746
11746
|
const setValue = value => {
|
|
11747
11747
|
switch (value) {
|
|
@@ -11819,10 +11819,10 @@ function ColumnsExpression(props) {
|
|
|
11819
11819
|
return get(field, PATH);
|
|
11820
11820
|
};
|
|
11821
11821
|
|
|
11822
|
-
/**
|
|
11823
|
-
* @param {string|void} value
|
|
11824
|
-
* @param {string|void} error
|
|
11825
|
-
* @returns {void}
|
|
11822
|
+
/**
|
|
11823
|
+
* @param {string|void} value
|
|
11824
|
+
* @param {string|void} error
|
|
11825
|
+
* @returns {void}
|
|
11826
11826
|
*/
|
|
11827
11827
|
const setValue = (value, error) => {
|
|
11828
11828
|
if (error) {
|
|
@@ -11831,9 +11831,9 @@ function ColumnsExpression(props) {
|
|
|
11831
11831
|
editField(field, PATH, value);
|
|
11832
11832
|
};
|
|
11833
11833
|
|
|
11834
|
-
/**
|
|
11835
|
-
* @param {string|void} value
|
|
11836
|
-
* @returns {string|null}
|
|
11834
|
+
/**
|
|
11835
|
+
* @param {string|void} value
|
|
11836
|
+
* @returns {string|null}
|
|
11837
11837
|
*/
|
|
11838
11838
|
const validate = value => {
|
|
11839
11839
|
if (!isString(value) || value.length === 0 || value === '=') {
|
|
@@ -11904,10 +11904,10 @@ function Label(props) {
|
|
|
11904
11904
|
} = props;
|
|
11905
11905
|
const debounce = useService('debounce');
|
|
11906
11906
|
|
|
11907
|
-
/**
|
|
11908
|
-
* @param {string|void} value
|
|
11909
|
-
* @param {string|void} error
|
|
11910
|
-
* @returns {void}
|
|
11907
|
+
/**
|
|
11908
|
+
* @param {string|void} value
|
|
11909
|
+
* @param {string|void} error
|
|
11910
|
+
* @returns {void}
|
|
11911
11911
|
*/
|
|
11912
11912
|
const setValue = (value, error) => {
|
|
11913
11913
|
if (error) {
|
|
@@ -11937,10 +11937,10 @@ function Key(props) {
|
|
|
11937
11937
|
} = props;
|
|
11938
11938
|
const debounce = useService('debounce');
|
|
11939
11939
|
|
|
11940
|
-
/**
|
|
11941
|
-
* @param {string|void} value
|
|
11942
|
-
* @param {string|void} error
|
|
11943
|
-
* @returns {void}
|
|
11940
|
+
/**
|
|
11941
|
+
* @param {string|void} value
|
|
11942
|
+
* @param {string|void} error
|
|
11943
|
+
* @returns {void}
|
|
11944
11944
|
*/
|
|
11945
11945
|
const setValue = (value, error) => {
|
|
11946
11946
|
if (error) {
|
|
@@ -11965,9 +11965,9 @@ function Key(props) {
|
|
|
11965
11965
|
|
|
11966
11966
|
// helpers //////////////////////
|
|
11967
11967
|
|
|
11968
|
-
/**
|
|
11969
|
-
* @param {string|void} value
|
|
11970
|
-
* @returns {string|null}
|
|
11968
|
+
/**
|
|
11969
|
+
* @param {string|void} value
|
|
11970
|
+
* @returns {string|null}
|
|
11971
11971
|
*/
|
|
11972
11972
|
function validate(value) {
|
|
11973
11973
|
if (!isString(value) || value.length === 0) {
|
|
@@ -12395,8 +12395,8 @@ function OptionsGroups(field, editField, getService) {
|
|
|
12395
12395
|
};
|
|
12396
12396
|
const id = 'valuesSource';
|
|
12397
12397
|
|
|
12398
|
-
/**
|
|
12399
|
-
* @type {Array<Group|ListGroup>}
|
|
12398
|
+
/**
|
|
12399
|
+
* @type {Array<Group|ListGroup>}
|
|
12400
12400
|
*/
|
|
12401
12401
|
const groups = [{
|
|
12402
12402
|
id,
|
|
@@ -12517,13 +12517,13 @@ function CustomPropertiesGroup(field, editField) {
|
|
|
12517
12517
|
|
|
12518
12518
|
// helpers //////////
|
|
12519
12519
|
|
|
12520
|
-
/**
|
|
12521
|
-
* Returns copy of object without key.
|
|
12522
|
-
*
|
|
12523
|
-
* @param {Object} properties
|
|
12524
|
-
* @param {string} oldKey
|
|
12525
|
-
*
|
|
12526
|
-
* @returns {Object}
|
|
12520
|
+
/**
|
|
12521
|
+
* Returns copy of object without key.
|
|
12522
|
+
*
|
|
12523
|
+
* @param {Object} properties
|
|
12524
|
+
* @param {string} oldKey
|
|
12525
|
+
*
|
|
12526
|
+
* @returns {Object}
|
|
12527
12527
|
*/
|
|
12528
12528
|
function removeKey(properties, oldKey) {
|
|
12529
12529
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -12608,8 +12608,8 @@ function TableHeaderGroups(field, editField) {
|
|
|
12608
12608
|
}
|
|
12609
12609
|
const areStaticColumnsEnabled = isArray(get(field, ['columns']));
|
|
12610
12610
|
|
|
12611
|
-
/**
|
|
12612
|
-
* @type {Array<Group>}
|
|
12611
|
+
/**
|
|
12612
|
+
* @type {Array<Group>}
|
|
12613
12613
|
*/
|
|
12614
12614
|
const groups = [{
|
|
12615
12615
|
id: `${fieldId}-columnsSource`,
|
|
@@ -12701,10 +12701,10 @@ var PropertiesPanelModule = {
|
|
|
12701
12701
|
propertiesProvider: ['type', PropertiesProvider]
|
|
12702
12702
|
};
|
|
12703
12703
|
|
|
12704
|
-
/**
|
|
12705
|
-
* Manages the rendering of visual plugins.
|
|
12706
|
-
* @constructor
|
|
12707
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
12704
|
+
/**
|
|
12705
|
+
* Manages the rendering of visual plugins.
|
|
12706
|
+
* @constructor
|
|
12707
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
12708
12708
|
*/
|
|
12709
12709
|
class RenderInjector extends SectionModuleBase {
|
|
12710
12710
|
constructor(eventBus) {
|
|
@@ -12713,10 +12713,10 @@ class RenderInjector extends SectionModuleBase {
|
|
|
12713
12713
|
this.registeredRenderers = [];
|
|
12714
12714
|
}
|
|
12715
12715
|
|
|
12716
|
-
/**
|
|
12717
|
-
* Inject a new renderer into the injector.
|
|
12718
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
12719
|
-
* @param {Function} Renderer - The renderer function.
|
|
12716
|
+
/**
|
|
12717
|
+
* Inject a new renderer into the injector.
|
|
12718
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
12719
|
+
* @param {Function} Renderer - The renderer function.
|
|
12720
12720
|
*/
|
|
12721
12721
|
attachRenderer(identifier, Renderer) {
|
|
12722
12722
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -12725,17 +12725,17 @@ class RenderInjector extends SectionModuleBase {
|
|
|
12725
12725
|
}];
|
|
12726
12726
|
}
|
|
12727
12727
|
|
|
12728
|
-
/**
|
|
12729
|
-
* Detach a renderer from the by key injector.
|
|
12730
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
12728
|
+
/**
|
|
12729
|
+
* Detach a renderer from the by key injector.
|
|
12730
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
12731
12731
|
*/
|
|
12732
12732
|
detachRenderer(identifier) {
|
|
12733
12733
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
12734
12734
|
}
|
|
12735
12735
|
|
|
12736
|
-
/**
|
|
12737
|
-
* Returns the registered renderers.
|
|
12738
|
-
* @returns {Array} Array of registered renderers.
|
|
12736
|
+
/**
|
|
12737
|
+
* Returns the registered renderers.
|
|
12738
|
+
* @returns {Array} Array of registered renderers.
|
|
12739
12739
|
*/
|
|
12740
12740
|
fetchRenderers() {
|
|
12741
12741
|
return this.registeredRenderers;
|
|
@@ -12770,11 +12770,11 @@ class RepeatRenderManager {
|
|
|
12770
12770
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
12771
12771
|
}
|
|
12772
12772
|
|
|
12773
|
-
/**
|
|
12774
|
-
* Checks whether a field should be repeatable.
|
|
12775
|
-
*
|
|
12776
|
-
* @param {string} id - The id of the field to check
|
|
12777
|
-
* @returns {boolean} - True if repeatable, false otherwise
|
|
12773
|
+
/**
|
|
12774
|
+
* Checks whether a field should be repeatable.
|
|
12775
|
+
*
|
|
12776
|
+
* @param {string} id - The id of the field to check
|
|
12777
|
+
* @returns {boolean} - True if repeatable, false otherwise
|
|
12778
12778
|
*/
|
|
12779
12779
|
isFieldRepeating(id) {
|
|
12780
12780
|
if (!id) {
|
|
@@ -12821,48 +12821,48 @@ var ExpressionLanguageModule = {
|
|
|
12821
12821
|
|
|
12822
12822
|
const ids = new Ids([32, 36, 1]);
|
|
12823
12823
|
|
|
12824
|
-
/**
|
|
12825
|
-
* @typedef { import('./types').Injector } Injector
|
|
12826
|
-
* @typedef { import('./types').Module } Module
|
|
12827
|
-
* @typedef { import('./types').Schema } Schema
|
|
12828
|
-
*
|
|
12829
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
12830
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
12831
|
-
*
|
|
12832
|
-
* @typedef { {
|
|
12833
|
-
* properties: FormEditorProperties,
|
|
12834
|
-
* schema: Schema
|
|
12835
|
-
* } } State
|
|
12836
|
-
*
|
|
12837
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
12838
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
12839
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
12824
|
+
/**
|
|
12825
|
+
* @typedef { import('./types').Injector } Injector
|
|
12826
|
+
* @typedef { import('./types').Module } Module
|
|
12827
|
+
* @typedef { import('./types').Schema } Schema
|
|
12828
|
+
*
|
|
12829
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
12830
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
12831
|
+
*
|
|
12832
|
+
* @typedef { {
|
|
12833
|
+
* properties: FormEditorProperties,
|
|
12834
|
+
* schema: Schema
|
|
12835
|
+
* } } State
|
|
12836
|
+
*
|
|
12837
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
12838
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
12839
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
12840
12840
|
*/
|
|
12841
12841
|
|
|
12842
|
-
/**
|
|
12843
|
-
* The form editor.
|
|
12842
|
+
/**
|
|
12843
|
+
* The form editor.
|
|
12844
12844
|
*/
|
|
12845
12845
|
class FormEditor {
|
|
12846
|
-
/**
|
|
12847
|
-
* @constructor
|
|
12848
|
-
* @param {FormEditorOptions} options
|
|
12846
|
+
/**
|
|
12847
|
+
* @constructor
|
|
12848
|
+
* @param {FormEditorOptions} options
|
|
12849
12849
|
*/
|
|
12850
12850
|
constructor(options = {}) {
|
|
12851
|
-
/**
|
|
12852
|
-
* @public
|
|
12853
|
-
* @type {OnEventType}
|
|
12851
|
+
/**
|
|
12852
|
+
* @public
|
|
12853
|
+
* @type {OnEventType}
|
|
12854
12854
|
*/
|
|
12855
12855
|
this.on = this._onEvent;
|
|
12856
12856
|
|
|
12857
|
-
/**
|
|
12858
|
-
* @public
|
|
12859
|
-
* @type {String}
|
|
12857
|
+
/**
|
|
12858
|
+
* @public
|
|
12859
|
+
* @type {String}
|
|
12860
12860
|
*/
|
|
12861
12861
|
this._id = ids.next();
|
|
12862
12862
|
|
|
12863
|
-
/**
|
|
12864
|
-
* @private
|
|
12865
|
-
* @type {Element}
|
|
12863
|
+
/**
|
|
12864
|
+
* @private
|
|
12865
|
+
* @type {Element}
|
|
12866
12866
|
*/
|
|
12867
12867
|
this._container = createFormContainer();
|
|
12868
12868
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -12873,15 +12873,15 @@ class FormEditor {
|
|
|
12873
12873
|
properties = {}
|
|
12874
12874
|
} = options;
|
|
12875
12875
|
|
|
12876
|
-
/**
|
|
12877
|
-
* @private
|
|
12878
|
-
* @type {any}
|
|
12876
|
+
/**
|
|
12877
|
+
* @private
|
|
12878
|
+
* @type {any}
|
|
12879
12879
|
*/
|
|
12880
12880
|
this.exporter = exporter;
|
|
12881
12881
|
|
|
12882
|
-
/**
|
|
12883
|
-
* @private
|
|
12884
|
-
* @type {State}
|
|
12882
|
+
/**
|
|
12883
|
+
* @private
|
|
12884
|
+
* @type {State}
|
|
12885
12885
|
*/
|
|
12886
12886
|
this._state = {
|
|
12887
12887
|
properties,
|
|
@@ -12910,10 +12910,10 @@ class FormEditor {
|
|
|
12910
12910
|
this._detach(false);
|
|
12911
12911
|
}
|
|
12912
12912
|
|
|
12913
|
-
/**
|
|
12914
|
-
* @param {Schema} schema
|
|
12915
|
-
*
|
|
12916
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
12913
|
+
/**
|
|
12914
|
+
* @param {Schema} schema
|
|
12915
|
+
*
|
|
12916
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
12917
12917
|
*/
|
|
12918
12918
|
importSchema(schema) {
|
|
12919
12919
|
return new Promise((resolve, reject) => {
|
|
@@ -12942,15 +12942,15 @@ class FormEditor {
|
|
|
12942
12942
|
});
|
|
12943
12943
|
}
|
|
12944
12944
|
|
|
12945
|
-
/**
|
|
12946
|
-
* @returns {Schema}
|
|
12945
|
+
/**
|
|
12946
|
+
* @returns {Schema}
|
|
12947
12947
|
*/
|
|
12948
12948
|
saveSchema() {
|
|
12949
12949
|
return this.getSchema();
|
|
12950
12950
|
}
|
|
12951
12951
|
|
|
12952
|
-
/**
|
|
12953
|
-
* @returns {Schema}
|
|
12952
|
+
/**
|
|
12953
|
+
* @returns {Schema}
|
|
12954
12954
|
*/
|
|
12955
12955
|
getSchema() {
|
|
12956
12956
|
const {
|
|
@@ -12959,8 +12959,8 @@ class FormEditor {
|
|
|
12959
12959
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
12960
12960
|
}
|
|
12961
12961
|
|
|
12962
|
-
/**
|
|
12963
|
-
* @param {Element|string} parentNode
|
|
12962
|
+
/**
|
|
12963
|
+
* @param {Element|string} parentNode
|
|
12964
12964
|
*/
|
|
12965
12965
|
attachTo(parentNode) {
|
|
12966
12966
|
if (!parentNode) {
|
|
@@ -12978,10 +12978,10 @@ class FormEditor {
|
|
|
12978
12978
|
this._detach();
|
|
12979
12979
|
}
|
|
12980
12980
|
|
|
12981
|
-
/**
|
|
12982
|
-
* @internal
|
|
12983
|
-
*
|
|
12984
|
-
* @param {boolean} [emit]
|
|
12981
|
+
/**
|
|
12982
|
+
* @internal
|
|
12983
|
+
*
|
|
12984
|
+
* @param {boolean} [emit]
|
|
12985
12985
|
*/
|
|
12986
12986
|
_detach(emit = true) {
|
|
12987
12987
|
const container = this._container,
|
|
@@ -12995,9 +12995,9 @@ class FormEditor {
|
|
|
12995
12995
|
parentNode.removeChild(container);
|
|
12996
12996
|
}
|
|
12997
12997
|
|
|
12998
|
-
/**
|
|
12999
|
-
* @param {any} property
|
|
13000
|
-
* @param {any} value
|
|
12998
|
+
/**
|
|
12999
|
+
* @param {any} property
|
|
13000
|
+
* @param {any} value
|
|
13001
13001
|
*/
|
|
13002
13002
|
setProperty(property, value) {
|
|
13003
13003
|
const properties = set$1(this._getState().properties, [property], value);
|
|
@@ -13006,21 +13006,21 @@ class FormEditor {
|
|
|
13006
13006
|
});
|
|
13007
13007
|
}
|
|
13008
13008
|
|
|
13009
|
-
/**
|
|
13010
|
-
* @param {string} type
|
|
13011
|
-
* @param {Function} handler
|
|
13009
|
+
/**
|
|
13010
|
+
* @param {string} type
|
|
13011
|
+
* @param {Function} handler
|
|
13012
13012
|
*/
|
|
13013
13013
|
off(type, handler) {
|
|
13014
13014
|
this.get('eventBus').off(type, handler);
|
|
13015
13015
|
}
|
|
13016
13016
|
|
|
13017
|
-
/**
|
|
13018
|
-
* @internal
|
|
13019
|
-
*
|
|
13020
|
-
* @param {FormEditorOptions} options
|
|
13021
|
-
* @param {Element} container
|
|
13022
|
-
*
|
|
13023
|
-
* @returns {Injector}
|
|
13017
|
+
/**
|
|
13018
|
+
* @internal
|
|
13019
|
+
*
|
|
13020
|
+
* @param {FormEditorOptions} options
|
|
13021
|
+
* @param {Element} container
|
|
13022
|
+
*
|
|
13023
|
+
* @returns {Injector}
|
|
13024
13024
|
*/
|
|
13025
13025
|
_createInjector(options, container) {
|
|
13026
13026
|
const {
|
|
@@ -13043,22 +13043,22 @@ class FormEditor {
|
|
|
13043
13043
|
}, core, ...modules, ...additionalModules]);
|
|
13044
13044
|
}
|
|
13045
13045
|
|
|
13046
|
-
/**
|
|
13047
|
-
* @internal
|
|
13046
|
+
/**
|
|
13047
|
+
* @internal
|
|
13048
13048
|
*/
|
|
13049
13049
|
_emit(type, data) {
|
|
13050
13050
|
this.get('eventBus').fire(type, data);
|
|
13051
13051
|
}
|
|
13052
13052
|
|
|
13053
|
-
/**
|
|
13054
|
-
* @internal
|
|
13053
|
+
/**
|
|
13054
|
+
* @internal
|
|
13055
13055
|
*/
|
|
13056
13056
|
_getState() {
|
|
13057
13057
|
return this._state;
|
|
13058
13058
|
}
|
|
13059
13059
|
|
|
13060
|
-
/**
|
|
13061
|
-
* @internal
|
|
13060
|
+
/**
|
|
13061
|
+
* @internal
|
|
13062
13062
|
*/
|
|
13063
13063
|
_setState(state) {
|
|
13064
13064
|
this._state = {
|
|
@@ -13068,15 +13068,15 @@ class FormEditor {
|
|
|
13068
13068
|
this._emit('changed', this._getState());
|
|
13069
13069
|
}
|
|
13070
13070
|
|
|
13071
|
-
/**
|
|
13072
|
-
* @internal
|
|
13071
|
+
/**
|
|
13072
|
+
* @internal
|
|
13073
13073
|
*/
|
|
13074
13074
|
_getModules() {
|
|
13075
13075
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule, RenderInjectionModule, RepeatRenderManagerModule];
|
|
13076
13076
|
}
|
|
13077
13077
|
|
|
13078
|
-
/**
|
|
13079
|
-
* @internal
|
|
13078
|
+
/**
|
|
13079
|
+
* @internal
|
|
13080
13080
|
*/
|
|
13081
13081
|
_onEvent(type, priority, handler) {
|
|
13082
13082
|
this.get('eventBus').on(type, priority, handler);
|