@bpmn-io/form-js-editor 1.1.0 → 1.2.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/dragula.css +1 -1
- package/dist/assets/form-js-editor-base.css +758 -758
- package/dist/assets/form-js-editor.css +76 -0
- package/dist/assets/properties-panel.css +77 -1
- package/dist/index.cjs +685 -368
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +685 -368
- package/dist/index.es.js.map +1 -1
- package/dist/types/features/properties-panel/groups/{CustomValuesGroup.d.ts → CustomPropertiesGroup.d.ts} +2 -1
- package/dist/types/features/properties-panel/groups/index.d.ts +1 -1
- package/dist/types/types.d.ts +28 -28
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var jsxRuntime = require('preact/jsx-runtime');
|
|
|
8
8
|
var hooks = require('preact/hooks');
|
|
9
9
|
var preact = require('preact');
|
|
10
10
|
var React = require('preact/compat');
|
|
11
|
-
var dragula = require('
|
|
11
|
+
var dragula = require('@bpmn-io/draggle');
|
|
12
12
|
var minDom = require('min-dom');
|
|
13
13
|
var arrayMove = require('array-move');
|
|
14
14
|
var feelers = require('feelers');
|
|
@@ -534,10 +534,10 @@ function invokeFunction(fn, args) {
|
|
|
534
534
|
return fn.apply(null, args);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
|
-
/**
|
|
538
|
-
* A factory to create a configurable debouncer.
|
|
539
|
-
*
|
|
540
|
-
* @param {number|boolean} [config=true]
|
|
537
|
+
/**
|
|
538
|
+
* A factory to create a configurable debouncer.
|
|
539
|
+
*
|
|
540
|
+
* @param {number|boolean} [config=true]
|
|
541
541
|
*/
|
|
542
542
|
function DebounceFactory(config = true) {
|
|
543
543
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -550,11 +550,11 @@ function DebounceFactory(config = true) {
|
|
|
550
550
|
DebounceFactory.$inject = ['config.debounce'];
|
|
551
551
|
|
|
552
552
|
class FieldFactory {
|
|
553
|
-
/**
|
|
554
|
-
* @constructor
|
|
555
|
-
*
|
|
556
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
557
|
-
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
553
|
+
/**
|
|
554
|
+
* @constructor
|
|
555
|
+
*
|
|
556
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
557
|
+
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
558
558
|
*/
|
|
559
559
|
constructor(formFieldRegistry, formFields) {
|
|
560
560
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -617,11 +617,11 @@ class FieldFactory {
|
|
|
617
617
|
FieldFactory.$inject = ['formFieldRegistry', 'formFields'];
|
|
618
618
|
|
|
619
619
|
class FormFieldRegistry extends formJsViewer.FormFieldRegistry {
|
|
620
|
-
/**
|
|
621
|
-
* Updates a form fields id.
|
|
622
|
-
*
|
|
623
|
-
* @param {Object} formField
|
|
624
|
-
* @param {string} newId
|
|
620
|
+
/**
|
|
621
|
+
* Updates a form fields id.
|
|
622
|
+
*
|
|
623
|
+
* @param {Object} formField
|
|
624
|
+
* @param {string} newId
|
|
625
625
|
*/
|
|
626
626
|
updateId(formField, newId) {
|
|
627
627
|
this._validateId(newId);
|
|
@@ -642,13 +642,13 @@ class FormFieldRegistry extends formJsViewer.FormFieldRegistry {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
|
|
645
|
-
/**
|
|
646
|
-
* Validate the suitability of the given id and signals a problem
|
|
647
|
-
* with an exception.
|
|
648
|
-
*
|
|
649
|
-
* @param {string} id
|
|
650
|
-
*
|
|
651
|
-
* @throws {Error} if id is empty or already assigned
|
|
645
|
+
/**
|
|
646
|
+
* Validate the suitability of the given id and signals a problem
|
|
647
|
+
* with an exception.
|
|
648
|
+
*
|
|
649
|
+
* @param {string} id
|
|
650
|
+
*
|
|
651
|
+
* @throws {Error} if id is empty or already assigned
|
|
652
652
|
*/
|
|
653
653
|
_validateId(id) {
|
|
654
654
|
if (!id) {
|
|
@@ -665,11 +665,11 @@ const MAX_COLUMNS = 16;
|
|
|
665
665
|
const MIN_COLUMNS = 2;
|
|
666
666
|
const MAX_FIELDS_PER_ROW = 4;
|
|
667
667
|
class FormLayoutValidator {
|
|
668
|
-
/**
|
|
669
|
-
* @constructor
|
|
670
|
-
*
|
|
671
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
672
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
668
|
+
/**
|
|
669
|
+
* @constructor
|
|
670
|
+
*
|
|
671
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
672
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
673
673
|
*/
|
|
674
674
|
constructor(formLayouter, formFieldRegistry) {
|
|
675
675
|
this._formLayouter = formLayouter;
|
|
@@ -729,11 +729,11 @@ function calculateMaxColumnsWithAuto(autoCols) {
|
|
|
729
729
|
}
|
|
730
730
|
|
|
731
731
|
class Importer {
|
|
732
|
-
/**
|
|
733
|
-
* @constructor
|
|
734
|
-
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
735
|
-
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
736
|
-
* @param { import('../core/FormLayouter').default } formLayouter
|
|
732
|
+
/**
|
|
733
|
+
* @constructor
|
|
734
|
+
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
735
|
+
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
736
|
+
* @param { import('../core/FormLayouter').default } formLayouter
|
|
737
737
|
*/
|
|
738
738
|
constructor(formFieldRegistry, fieldFactory, formLayouter) {
|
|
739
739
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -741,21 +741,21 @@ class Importer {
|
|
|
741
741
|
this._formLayouter = formLayouter;
|
|
742
742
|
}
|
|
743
743
|
|
|
744
|
-
/**
|
|
745
|
-
* Import schema creating rows, fields, attaching additional
|
|
746
|
-
* information to each field and adding fields to the
|
|
747
|
-
* field registry.
|
|
748
|
-
*
|
|
749
|
-
* Additional information attached:
|
|
750
|
-
*
|
|
751
|
-
* * `id` (unless present)
|
|
752
|
-
* * `_parent`
|
|
753
|
-
* * `_path`
|
|
754
|
-
*
|
|
755
|
-
* @param {any} schema
|
|
756
|
-
*
|
|
757
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
758
|
-
* @returns {ImportResult}
|
|
744
|
+
/**
|
|
745
|
+
* Import schema creating rows, fields, attaching additional
|
|
746
|
+
* information to each field and adding fields to the
|
|
747
|
+
* field registry.
|
|
748
|
+
*
|
|
749
|
+
* Additional information attached:
|
|
750
|
+
*
|
|
751
|
+
* * `id` (unless present)
|
|
752
|
+
* * `_parent`
|
|
753
|
+
* * `_path`
|
|
754
|
+
*
|
|
755
|
+
* @param {any} schema
|
|
756
|
+
*
|
|
757
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
758
|
+
* @returns {ImportResult}
|
|
759
759
|
*/
|
|
760
760
|
importSchema(schema) {
|
|
761
761
|
// TODO: Add warnings
|
|
@@ -773,12 +773,12 @@ class Importer {
|
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
/**
|
|
777
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
778
|
-
* @param {String} [parentId]
|
|
779
|
-
* @param {number} [index]
|
|
780
|
-
*
|
|
781
|
-
* @return {any} field
|
|
776
|
+
/**
|
|
777
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
778
|
+
* @param {String} [parentId]
|
|
779
|
+
* @param {number} [index]
|
|
780
|
+
*
|
|
781
|
+
* @return {any} field
|
|
782
782
|
*/
|
|
783
783
|
importFormField(fieldAttrs, parentId, index) {
|
|
784
784
|
const {
|
|
@@ -815,11 +815,11 @@ class Importer {
|
|
|
815
815
|
return field;
|
|
816
816
|
}
|
|
817
817
|
|
|
818
|
-
/**
|
|
819
|
-
* @param {Array<any>} components
|
|
820
|
-
* @param {string} parentId
|
|
821
|
-
*
|
|
822
|
-
* @return {Array<any>} imported components
|
|
818
|
+
/**
|
|
819
|
+
* @param {Array<any>} components
|
|
820
|
+
* @param {string} parentId
|
|
821
|
+
*
|
|
822
|
+
* @return {Array<any>} imported components
|
|
823
823
|
*/
|
|
824
824
|
importFormFields(components, parentId) {
|
|
825
825
|
return components.map((component, index) => {
|
|
@@ -844,22 +844,22 @@ function editorFormFieldClasses(type, {
|
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
846
|
|
|
847
|
-
/**
|
|
848
|
-
* Add a dragger that calls back the passed function with
|
|
849
|
-
* { event, delta } on drag.
|
|
850
|
-
*
|
|
851
|
-
* @example
|
|
852
|
-
*
|
|
853
|
-
* function dragMove(event, delta) {
|
|
854
|
-
* // we are dragging (!!)
|
|
855
|
-
* }
|
|
856
|
-
*
|
|
857
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
858
|
-
*
|
|
859
|
-
* @param {Function} fn
|
|
860
|
-
* @param {Element} dragPreview
|
|
861
|
-
*
|
|
862
|
-
* @return {Function} drag start callback function
|
|
847
|
+
/**
|
|
848
|
+
* Add a dragger that calls back the passed function with
|
|
849
|
+
* { event, delta } on drag.
|
|
850
|
+
*
|
|
851
|
+
* @example
|
|
852
|
+
*
|
|
853
|
+
* function dragMove(event, delta) {
|
|
854
|
+
* // we are dragging (!!)
|
|
855
|
+
* }
|
|
856
|
+
*
|
|
857
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
858
|
+
*
|
|
859
|
+
* @param {Function} fn
|
|
860
|
+
* @param {Element} dragPreview
|
|
861
|
+
*
|
|
862
|
+
* @return {Function} drag start callback function
|
|
863
863
|
*/
|
|
864
864
|
function createDragger(fn, dragPreview) {
|
|
865
865
|
let self;
|
|
@@ -900,12 +900,12 @@ function createDragger(fn, dragPreview) {
|
|
|
900
900
|
return onDragStart;
|
|
901
901
|
}
|
|
902
902
|
|
|
903
|
-
/**
|
|
904
|
-
* Throttle function call according UI update cycle.
|
|
905
|
-
*
|
|
906
|
-
* @param {Function} fn
|
|
907
|
-
*
|
|
908
|
-
* @return {Function} throttled fn
|
|
903
|
+
/**
|
|
904
|
+
* Throttle function call according UI update cycle.
|
|
905
|
+
*
|
|
906
|
+
* @param {Function} fn
|
|
907
|
+
*
|
|
908
|
+
* @return {Function} throttled fn
|
|
909
909
|
*/
|
|
910
910
|
function throttle(fn) {
|
|
911
911
|
let active = false;
|
|
@@ -934,11 +934,11 @@ const DragAndDropContext = preact.createContext({
|
|
|
934
934
|
});
|
|
935
935
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
936
936
|
|
|
937
|
-
/**
|
|
938
|
-
* @param {string} type
|
|
939
|
-
* @param {boolean} [strict]
|
|
940
|
-
*
|
|
941
|
-
* @returns {any}
|
|
937
|
+
/**
|
|
938
|
+
* @param {string} type
|
|
939
|
+
* @param {boolean} [strict]
|
|
940
|
+
*
|
|
941
|
+
* @returns {any}
|
|
942
942
|
*/
|
|
943
943
|
function getService$1(type, strict) {}
|
|
944
944
|
const FormEditorContext = preact.createContext({
|
|
@@ -1288,23 +1288,23 @@ var Slot = (props => {
|
|
|
1288
1288
|
return fillsAndSeparators;
|
|
1289
1289
|
});
|
|
1290
1290
|
|
|
1291
|
-
/**
|
|
1292
|
-
* Creates a Fragment for a fill.
|
|
1293
|
-
*
|
|
1294
|
-
* @param {Object} fill Fill to be rendered
|
|
1295
|
-
* @returns {Object} Preact Fragment containing fill's children
|
|
1291
|
+
/**
|
|
1292
|
+
* Creates a Fragment for a fill.
|
|
1293
|
+
*
|
|
1294
|
+
* @param {Object} fill Fill to be rendered
|
|
1295
|
+
* @returns {Object} Preact Fragment containing fill's children
|
|
1296
1296
|
*/
|
|
1297
1297
|
const FillFragment = fill => jsxRuntime.jsx(preact.Fragment, {
|
|
1298
1298
|
children: fill.children
|
|
1299
1299
|
}, fill.id);
|
|
1300
1300
|
|
|
1301
|
-
/**
|
|
1302
|
-
* Creates an array of fills, with separators inserted between groups.
|
|
1303
|
-
*
|
|
1304
|
-
* @param {Array} groups Groups of fills
|
|
1305
|
-
* @param {Function} fillRenderer Function to create a fill
|
|
1306
|
-
* @param {Function} separatorRenderer Function to create a separator
|
|
1307
|
-
* @returns {Array} Array of fills and separators
|
|
1301
|
+
/**
|
|
1302
|
+
* Creates an array of fills, with separators inserted between groups.
|
|
1303
|
+
*
|
|
1304
|
+
* @param {Array} groups Groups of fills
|
|
1305
|
+
* @param {Function} fillRenderer Function to create a fill
|
|
1306
|
+
* @param {Function} separatorRenderer Function to create a separator
|
|
1307
|
+
* @returns {Array} Array of fills and separators
|
|
1308
1308
|
*/
|
|
1309
1309
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
1310
1310
|
const result = [];
|
|
@@ -1322,8 +1322,8 @@ const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
|
1322
1322
|
return result;
|
|
1323
1323
|
};
|
|
1324
1324
|
|
|
1325
|
-
/**
|
|
1326
|
-
* Groups fills by group name property.
|
|
1325
|
+
/**
|
|
1326
|
+
* Groups fills by group name property.
|
|
1327
1327
|
*/
|
|
1328
1328
|
const _groupByGroupName = fills => {
|
|
1329
1329
|
const groups = [];
|
|
@@ -1343,8 +1343,8 @@ const _groupByGroupName = fills => {
|
|
|
1343
1343
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
1344
1344
|
};
|
|
1345
1345
|
|
|
1346
|
-
/**
|
|
1347
|
-
* Compares fills by priority.
|
|
1346
|
+
/**
|
|
1347
|
+
* Compares fills by priority.
|
|
1348
1348
|
*/
|
|
1349
1349
|
const _comparePriority = (a, b) => {
|
|
1350
1350
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -1572,19 +1572,19 @@ const DRAG_NO_DROP_CLS = 'fjs-no-drop';
|
|
|
1572
1572
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
1573
1573
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
1574
1574
|
|
|
1575
|
-
/**
|
|
1576
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1575
|
+
/**
|
|
1576
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1577
1577
|
*/
|
|
1578
1578
|
|
|
1579
1579
|
class Dragging {
|
|
1580
|
-
/**
|
|
1581
|
-
* @constructor
|
|
1582
|
-
*
|
|
1583
|
-
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1584
|
-
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1585
|
-
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1586
|
-
* @param { import('../../core/EventBus').default } eventBus
|
|
1587
|
-
* @param { import('../modeling/Modeling').default } modeling
|
|
1580
|
+
/**
|
|
1581
|
+
* @constructor
|
|
1582
|
+
*
|
|
1583
|
+
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1584
|
+
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1585
|
+
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1586
|
+
* @param { import('../../core/EventBus').default } eventBus
|
|
1587
|
+
* @param { import('../modeling/Modeling').default } modeling
|
|
1588
1588
|
*/
|
|
1589
1589
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling) {
|
|
1590
1590
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -1594,13 +1594,13 @@ class Dragging {
|
|
|
1594
1594
|
this._modeling = modeling;
|
|
1595
1595
|
}
|
|
1596
1596
|
|
|
1597
|
-
/**
|
|
1598
|
-
* Calculcates position in form schema given the dropped place.
|
|
1599
|
-
*
|
|
1600
|
-
* @param { FormRow } targetRow
|
|
1601
|
-
* @param { any } targetFormField
|
|
1602
|
-
* @param { HTMLElement } sibling
|
|
1603
|
-
* @returns { number }
|
|
1597
|
+
/**
|
|
1598
|
+
* Calculcates position in form schema given the dropped place.
|
|
1599
|
+
*
|
|
1600
|
+
* @param { FormRow } targetRow
|
|
1601
|
+
* @param { any } targetFormField
|
|
1602
|
+
* @param { HTMLElement } sibling
|
|
1603
|
+
* @returns { number }
|
|
1604
1604
|
*/
|
|
1605
1605
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
1606
1606
|
/** @type HTMLElement */
|
|
@@ -1702,17 +1702,21 @@ class Dragging {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
1704
|
|
|
1705
|
-
/**
|
|
1706
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1705
|
+
/**
|
|
1706
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1707
1707
|
*/
|
|
1708
1708
|
createDragulaInstance(options) {
|
|
1709
1709
|
const {
|
|
1710
1710
|
container,
|
|
1711
|
-
direction,
|
|
1712
1711
|
mirrorContainer
|
|
1713
1712
|
} = options || {};
|
|
1714
|
-
|
|
1715
|
-
direction,
|
|
1713
|
+
let dragulaOptions = {
|
|
1714
|
+
direction: function (el, target) {
|
|
1715
|
+
if (isRow(target)) {
|
|
1716
|
+
return 'horizontal';
|
|
1717
|
+
}
|
|
1718
|
+
return 'vertical';
|
|
1719
|
+
},
|
|
1716
1720
|
mirrorContainer,
|
|
1717
1721
|
isContainer(el) {
|
|
1718
1722
|
return container.some(cls => el.classList.contains(cls));
|
|
@@ -1743,7 +1747,8 @@ class Dragging {
|
|
|
1743
1747
|
},
|
|
1744
1748
|
slideFactorX: 10,
|
|
1745
1749
|
slideFactorY: 5
|
|
1746
|
-
}
|
|
1750
|
+
};
|
|
1751
|
+
const dragulaInstance = dragula(dragulaOptions);
|
|
1747
1752
|
|
|
1748
1753
|
// bind life cycle events
|
|
1749
1754
|
dragulaInstance.on('drag', (element, source) => {
|
|
@@ -2112,7 +2117,7 @@ function DebugColumns(props) {
|
|
|
2112
2117
|
return null;
|
|
2113
2118
|
}
|
|
2114
2119
|
return jsxRuntime.jsx("div", {
|
|
2115
|
-
style: "width: fit-content
|
|
2120
|
+
style: "width: fit-content;\r padding: 2px 6px;\r height: 16px;\r background: var(--color-blue-205-100-95);\r display: flex;\r justify-content: center;\r align-items: center;\r position: absolute;\r bottom: -2px;\r z-index: 2;\r font-size: 10px;\r right: 3px;",
|
|
2116
2121
|
class: "fjs-debug-columns",
|
|
2117
2122
|
children: (field.layout || {}).columns || 'auto'
|
|
2118
2123
|
});
|
|
@@ -2209,7 +2214,6 @@ function FormEditor$1(props) {
|
|
|
2209
2214
|
hooks.useEffect(() => {
|
|
2210
2215
|
let dragulaInstance = dragging.createDragulaInstance({
|
|
2211
2216
|
container: [DRAG_CONTAINER_CLS, DROP_CONTAINER_VERTICAL_CLS, DROP_CONTAINER_HORIZONTAL_CLS],
|
|
2212
|
-
direction: 'vertical',
|
|
2213
2217
|
mirrorContainer: formContainerRef.current
|
|
2214
2218
|
});
|
|
2215
2219
|
setDrake(dragulaInstance);
|
|
@@ -2223,7 +2227,6 @@ function FormEditor$1(props) {
|
|
|
2223
2227
|
onDetach();
|
|
2224
2228
|
dragulaInstance = dragging.createDragulaInstance({
|
|
2225
2229
|
container: [DRAG_CONTAINER_CLS, DROP_CONTAINER_VERTICAL_CLS, DROP_CONTAINER_HORIZONTAL_CLS],
|
|
2226
|
-
direction: 'vertical',
|
|
2227
2230
|
mirrorContainer: formContainerRef.current
|
|
2228
2231
|
});
|
|
2229
2232
|
setDrake(dragulaInstance);
|
|
@@ -3171,10 +3174,10 @@ function updateRow(formField, rowId) {
|
|
|
3171
3174
|
}
|
|
3172
3175
|
|
|
3173
3176
|
class AddFormFieldHandler {
|
|
3174
|
-
/**
|
|
3175
|
-
* @constructor
|
|
3176
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3177
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3177
|
+
/**
|
|
3178
|
+
* @constructor
|
|
3179
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3180
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3178
3181
|
*/
|
|
3179
3182
|
constructor(formEditor, formFieldRegistry) {
|
|
3180
3183
|
this._formEditor = formEditor;
|
|
@@ -3235,10 +3238,10 @@ class AddFormFieldHandler {
|
|
|
3235
3238
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3236
3239
|
|
|
3237
3240
|
class EditFormFieldHandler {
|
|
3238
|
-
/**
|
|
3239
|
-
* @constructor
|
|
3240
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3241
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3241
|
+
/**
|
|
3242
|
+
* @constructor
|
|
3243
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3244
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3242
3245
|
*/
|
|
3243
3246
|
constructor(formEditor, formFieldRegistry) {
|
|
3244
3247
|
this._formEditor = formEditor;
|
|
@@ -3301,10 +3304,10 @@ class EditFormFieldHandler {
|
|
|
3301
3304
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3302
3305
|
|
|
3303
3306
|
class MoveFormFieldHandler {
|
|
3304
|
-
/**
|
|
3305
|
-
* @constructor
|
|
3306
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3307
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3307
|
+
/**
|
|
3308
|
+
* @constructor
|
|
3309
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3310
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3308
3311
|
*/
|
|
3309
3312
|
constructor(formEditor, formFieldRegistry) {
|
|
3310
3313
|
this._formEditor = formEditor;
|
|
@@ -3393,10 +3396,10 @@ class MoveFormFieldHandler {
|
|
|
3393
3396
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3394
3397
|
|
|
3395
3398
|
class RemoveFormFieldHandler {
|
|
3396
|
-
/**
|
|
3397
|
-
* @constructor
|
|
3398
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3399
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3399
|
+
/**
|
|
3400
|
+
* @constructor
|
|
3401
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3402
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3400
3403
|
*/
|
|
3401
3404
|
constructor(formEditor, formFieldRegistry) {
|
|
3402
3405
|
this._formEditor = formEditor;
|
|
@@ -3456,9 +3459,9 @@ class RemoveFormFieldHandler {
|
|
|
3456
3459
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3457
3460
|
|
|
3458
3461
|
class UpdateIdClaimHandler {
|
|
3459
|
-
/**
|
|
3460
|
-
* @constructor
|
|
3461
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3462
|
+
/**
|
|
3463
|
+
* @constructor
|
|
3464
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3462
3465
|
*/
|
|
3463
3466
|
constructor(formFieldRegistry) {
|
|
3464
3467
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -3491,9 +3494,9 @@ class UpdateIdClaimHandler {
|
|
|
3491
3494
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
3492
3495
|
|
|
3493
3496
|
class UpdateKeyClaimHandler {
|
|
3494
|
-
/**
|
|
3495
|
-
* @constructor
|
|
3496
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3497
|
+
/**
|
|
3498
|
+
* @constructor
|
|
3499
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3497
3500
|
*/
|
|
3498
3501
|
constructor(formFieldRegistry) {
|
|
3499
3502
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -3959,8 +3962,8 @@ class ValidateBehavior extends CommandInterceptor {
|
|
|
3959
3962
|
constructor(eventBus) {
|
|
3960
3963
|
super(eventBus);
|
|
3961
3964
|
|
|
3962
|
-
/**
|
|
3963
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
3965
|
+
/**
|
|
3966
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
3964
3967
|
*/
|
|
3965
3968
|
// @ts-ignore-next-line
|
|
3966
3969
|
this.preExecute('formField.edit', function (context) {
|
|
@@ -4540,22 +4543,22 @@ var SelectionModule = {
|
|
|
4540
4543
|
selectionBehavior: ['type', SelectionBehavior]
|
|
4541
4544
|
};
|
|
4542
4545
|
|
|
4543
|
-
/**
|
|
4544
|
-
* Base class for sectionable UI modules.
|
|
4545
|
-
*
|
|
4546
|
-
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
4547
|
-
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
4548
|
-
*
|
|
4549
|
-
* @class SectionModuleBase
|
|
4546
|
+
/**
|
|
4547
|
+
* Base class for sectionable UI modules.
|
|
4548
|
+
*
|
|
4549
|
+
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
4550
|
+
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
4551
|
+
*
|
|
4552
|
+
* @class SectionModuleBase
|
|
4550
4553
|
*/
|
|
4551
4554
|
class SectionModuleBase {
|
|
4552
|
-
/**
|
|
4553
|
-
* Create a SectionModuleBase instance.
|
|
4554
|
-
*
|
|
4555
|
-
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
4556
|
-
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
4557
|
-
*
|
|
4558
|
-
* @constructor
|
|
4555
|
+
/**
|
|
4556
|
+
* Create a SectionModuleBase instance.
|
|
4557
|
+
*
|
|
4558
|
+
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
4559
|
+
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
4560
|
+
*
|
|
4561
|
+
* @constructor
|
|
4559
4562
|
*/
|
|
4560
4563
|
constructor(eventBus, sectionKey) {
|
|
4561
4564
|
this._eventBus = eventBus;
|
|
@@ -4568,10 +4571,10 @@ class SectionModuleBase {
|
|
|
4568
4571
|
});
|
|
4569
4572
|
}
|
|
4570
4573
|
|
|
4571
|
-
/**
|
|
4572
|
-
* Attach the managed section to a parent node.
|
|
4573
|
-
*
|
|
4574
|
-
* @param {HTMLElement} container - The parent node to attach to.
|
|
4574
|
+
/**
|
|
4575
|
+
* Attach the managed section to a parent node.
|
|
4576
|
+
*
|
|
4577
|
+
* @param {HTMLElement} container - The parent node to attach to.
|
|
4575
4578
|
*/
|
|
4576
4579
|
attachTo(container) {
|
|
4577
4580
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -4579,22 +4582,22 @@ class SectionModuleBase {
|
|
|
4579
4582
|
}));
|
|
4580
4583
|
}
|
|
4581
4584
|
|
|
4582
|
-
/**
|
|
4583
|
-
* Detach the managed section from its parent node.
|
|
4585
|
+
/**
|
|
4586
|
+
* Detach the managed section from its parent node.
|
|
4584
4587
|
*/
|
|
4585
4588
|
detach() {
|
|
4586
4589
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
4587
4590
|
}
|
|
4588
4591
|
|
|
4589
|
-
/**
|
|
4590
|
-
* Reset the managed section to its initial state.
|
|
4592
|
+
/**
|
|
4593
|
+
* Reset the managed section to its initial state.
|
|
4591
4594
|
*/
|
|
4592
4595
|
reset() {
|
|
4593
4596
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
4594
4597
|
}
|
|
4595
4598
|
|
|
4596
|
-
/**
|
|
4597
|
-
* Circumvents timing issues.
|
|
4599
|
+
/**
|
|
4600
|
+
* Circumvents timing issues.
|
|
4598
4601
|
*/
|
|
4599
4602
|
_onceSectionRendered(callback) {
|
|
4600
4603
|
if (this.isSectionRendered) {
|
|
@@ -4769,6 +4772,166 @@ const LayoutContext = preact.createContext({
|
|
|
4769
4772
|
getLayoutForKey: () => {},
|
|
4770
4773
|
setLayoutForKey: () => {}
|
|
4771
4774
|
});
|
|
4775
|
+
const TooltipContext = preact.createContext({
|
|
4776
|
+
tooltip: {},
|
|
4777
|
+
getTooltipForId: () => {}
|
|
4778
|
+
});
|
|
4779
|
+
|
|
4780
|
+
/**
|
|
4781
|
+
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
4782
|
+
*
|
|
4783
|
+
* @example
|
|
4784
|
+
* ```jsx
|
|
4785
|
+
* function TextField(props) {
|
|
4786
|
+
* const tooltip = useTooltipContext('input1', element);
|
|
4787
|
+
* }
|
|
4788
|
+
* ```
|
|
4789
|
+
*
|
|
4790
|
+
* @param {string} id
|
|
4791
|
+
* @param {object} element
|
|
4792
|
+
*
|
|
4793
|
+
* @returns {string}
|
|
4794
|
+
*/
|
|
4795
|
+
function useTooltipContext(id, element) {
|
|
4796
|
+
const {
|
|
4797
|
+
getTooltipForId
|
|
4798
|
+
} = hooks.useContext(TooltipContext);
|
|
4799
|
+
return getTooltipForId(id, element);
|
|
4800
|
+
}
|
|
4801
|
+
function TooltipWrapper(props) {
|
|
4802
|
+
const {
|
|
4803
|
+
forId,
|
|
4804
|
+
element
|
|
4805
|
+
} = props;
|
|
4806
|
+
const contextDescription = useTooltipContext(forId, element);
|
|
4807
|
+
const value = props.value || contextDescription;
|
|
4808
|
+
if (!value) {
|
|
4809
|
+
return props.children;
|
|
4810
|
+
}
|
|
4811
|
+
return jsxRuntime.jsx(Tooltip, {
|
|
4812
|
+
...props,
|
|
4813
|
+
value: value,
|
|
4814
|
+
forId: prefixId$8(forId)
|
|
4815
|
+
});
|
|
4816
|
+
}
|
|
4817
|
+
function Tooltip(props) {
|
|
4818
|
+
const {
|
|
4819
|
+
forId,
|
|
4820
|
+
value,
|
|
4821
|
+
parent
|
|
4822
|
+
} = props;
|
|
4823
|
+
const [visible, setShow] = hooks.useState(false);
|
|
4824
|
+
let timeout = null;
|
|
4825
|
+
const wrapperRef = hooks.useRef(null);
|
|
4826
|
+
const tooltipRef = hooks.useRef(null);
|
|
4827
|
+
const showTooltip = async event => {
|
|
4828
|
+
const show = () => !visible && setShow(true);
|
|
4829
|
+
if (event instanceof MouseEvent) {
|
|
4830
|
+
timeout = setTimeout(show, 200);
|
|
4831
|
+
} else {
|
|
4832
|
+
show();
|
|
4833
|
+
}
|
|
4834
|
+
};
|
|
4835
|
+
const hideTooltip = () => setShow(false);
|
|
4836
|
+
const hideTooltipViaEscape = e => {
|
|
4837
|
+
e.code === 'Escape' && hideTooltip();
|
|
4838
|
+
};
|
|
4839
|
+
const isTooltipHovered = ({
|
|
4840
|
+
x,
|
|
4841
|
+
y
|
|
4842
|
+
}) => {
|
|
4843
|
+
const tooltip = tooltipRef.current;
|
|
4844
|
+
const wrapper = wrapperRef.current;
|
|
4845
|
+
return tooltip && (inBounds(x, y, wrapper.getBoundingClientRect()) || inBounds(x, y, tooltip.getBoundingClientRect()));
|
|
4846
|
+
};
|
|
4847
|
+
hooks.useEffect(() => {
|
|
4848
|
+
const {
|
|
4849
|
+
current
|
|
4850
|
+
} = wrapperRef;
|
|
4851
|
+
if (!current) {
|
|
4852
|
+
return;
|
|
4853
|
+
}
|
|
4854
|
+
const hideHoveredTooltip = e => {
|
|
4855
|
+
const isFocused = document.activeElement === wrapperRef.current || document.activeElement.closest('.bio-properties-panel-tooltip');
|
|
4856
|
+
if (visible && !isTooltipHovered({
|
|
4857
|
+
x: e.x,
|
|
4858
|
+
y: e.y
|
|
4859
|
+
}) && !isFocused) {
|
|
4860
|
+
hideTooltip();
|
|
4861
|
+
}
|
|
4862
|
+
};
|
|
4863
|
+
const hideFocusedTooltip = e => {
|
|
4864
|
+
const {
|
|
4865
|
+
relatedTarget
|
|
4866
|
+
} = e;
|
|
4867
|
+
const isTooltipChild = el => el && !!el.closest('.bio-properties-panel-tooltip');
|
|
4868
|
+
if (visible && !isHovered(wrapperRef.current) && !isTooltipChild(relatedTarget)) {
|
|
4869
|
+
hideTooltip();
|
|
4870
|
+
}
|
|
4871
|
+
};
|
|
4872
|
+
document.addEventListener('wheel', hideHoveredTooltip);
|
|
4873
|
+
document.addEventListener('focusout', hideFocusedTooltip);
|
|
4874
|
+
document.addEventListener('mousemove', hideHoveredTooltip);
|
|
4875
|
+
return () => {
|
|
4876
|
+
document.removeEventListener('wheel', hideHoveredTooltip);
|
|
4877
|
+
document.removeEventListener('mousemove', hideHoveredTooltip);
|
|
4878
|
+
document.removeEventListener('focusout', hideFocusedTooltip);
|
|
4879
|
+
};
|
|
4880
|
+
}, [wrapperRef.current, visible]);
|
|
4881
|
+
const renderTooltip = () => {
|
|
4882
|
+
return jsxRuntime.jsxs("div", {
|
|
4883
|
+
class: "bio-properties-panel-tooltip",
|
|
4884
|
+
role: "tooltip",
|
|
4885
|
+
id: "bio-properties-panel-tooltip",
|
|
4886
|
+
"aria-labelledby": forId,
|
|
4887
|
+
style: getTooltipPosition(wrapperRef.current),
|
|
4888
|
+
ref: tooltipRef,
|
|
4889
|
+
onClick: e => e.stopPropagation(),
|
|
4890
|
+
children: [jsxRuntime.jsx("div", {
|
|
4891
|
+
class: "bio-properties-panel-tooltip-content",
|
|
4892
|
+
children: value
|
|
4893
|
+
}), jsxRuntime.jsx("div", {
|
|
4894
|
+
class: "bio-properties-panel-tooltip-arrow"
|
|
4895
|
+
})]
|
|
4896
|
+
});
|
|
4897
|
+
};
|
|
4898
|
+
return jsxRuntime.jsxs("div", {
|
|
4899
|
+
class: "bio-properties-panel-tooltip-wrapper",
|
|
4900
|
+
tabIndex: "0",
|
|
4901
|
+
ref: wrapperRef,
|
|
4902
|
+
onMouseEnter: showTooltip,
|
|
4903
|
+
onMouseLeave: () => clearTimeout(timeout),
|
|
4904
|
+
onFocus: showTooltip,
|
|
4905
|
+
onKeyDown: hideTooltipViaEscape,
|
|
4906
|
+
onMouseDown: e => {
|
|
4907
|
+
e.preventDefault();
|
|
4908
|
+
},
|
|
4909
|
+
children: [props.children, visible ? parent ? React.createPortal(renderTooltip(), parent.current) : renderTooltip() : null]
|
|
4910
|
+
});
|
|
4911
|
+
}
|
|
4912
|
+
|
|
4913
|
+
// helper
|
|
4914
|
+
function inBounds(x, y, bounds) {
|
|
4915
|
+
const {
|
|
4916
|
+
top,
|
|
4917
|
+
right,
|
|
4918
|
+
bottom,
|
|
4919
|
+
left
|
|
4920
|
+
} = bounds;
|
|
4921
|
+
return x >= left && x <= right && y >= top && y <= bottom;
|
|
4922
|
+
}
|
|
4923
|
+
function getTooltipPosition(refElement) {
|
|
4924
|
+
const refPosition = refElement.getBoundingClientRect();
|
|
4925
|
+
const right = `calc(100% - ${refPosition.x}px)`;
|
|
4926
|
+
const top = `${refPosition.top - 10}px`;
|
|
4927
|
+
return `right: ${right}; top: ${top};`;
|
|
4928
|
+
}
|
|
4929
|
+
function isHovered(element) {
|
|
4930
|
+
return element.matches(':hover');
|
|
4931
|
+
}
|
|
4932
|
+
function prefixId$8(id) {
|
|
4933
|
+
return `bio-properties-panel-${id}`;
|
|
4934
|
+
}
|
|
4772
4935
|
|
|
4773
4936
|
/**
|
|
4774
4937
|
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
@@ -4797,6 +4960,12 @@ function useError(id) {
|
|
|
4797
4960
|
} = hooks.useContext(ErrorsContext);
|
|
4798
4961
|
return errors[id];
|
|
4799
4962
|
}
|
|
4963
|
+
function useErrors() {
|
|
4964
|
+
const {
|
|
4965
|
+
errors
|
|
4966
|
+
} = hooks.useContext(ErrorsContext);
|
|
4967
|
+
return errors;
|
|
4968
|
+
}
|
|
4800
4969
|
|
|
4801
4970
|
/**
|
|
4802
4971
|
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
@@ -5028,6 +5197,10 @@ function Group(props) {
|
|
|
5028
5197
|
setEdited(hasOneEditedEntry);
|
|
5029
5198
|
}, [entries]);
|
|
5030
5199
|
|
|
5200
|
+
// set error state depending on all entries
|
|
5201
|
+
const allErrors = useErrors();
|
|
5202
|
+
const hasErrors = entries.some(entry => allErrors[entry.id]);
|
|
5203
|
+
|
|
5031
5204
|
// set css class when group is sticky to top
|
|
5032
5205
|
useStickyIntersectionObserver(groupRef, 'div.bio-properties-panel-scroll-container', setSticky);
|
|
5033
5206
|
const propertiesPanelContext = {
|
|
@@ -5044,10 +5217,19 @@ function Group(props) {
|
|
|
5044
5217
|
children: [jsxRuntime.jsx("div", {
|
|
5045
5218
|
title: label,
|
|
5046
5219
|
class: "bio-properties-panel-group-header-title",
|
|
5047
|
-
children:
|
|
5220
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
5221
|
+
value: props.tooltip,
|
|
5222
|
+
forId: 'group-' + id,
|
|
5223
|
+
element: element,
|
|
5224
|
+
parent: groupRef,
|
|
5225
|
+
children: label
|
|
5226
|
+
})
|
|
5048
5227
|
}), jsxRuntime.jsxs("div", {
|
|
5049
5228
|
class: "bio-properties-panel-group-header-buttons",
|
|
5050
|
-
children: [
|
|
5229
|
+
children: [jsxRuntime.jsx(DataMarker, {
|
|
5230
|
+
edited: edited,
|
|
5231
|
+
hasErrors: hasErrors
|
|
5232
|
+
}), jsxRuntime.jsx("button", {
|
|
5051
5233
|
title: "Toggle section",
|
|
5052
5234
|
class: "bio-properties-panel-group-header-button bio-properties-panel-arrow",
|
|
5053
5235
|
children: jsxRuntime.jsx(ArrowIcon, {
|
|
@@ -5074,11 +5256,24 @@ function Group(props) {
|
|
|
5074
5256
|
})]
|
|
5075
5257
|
});
|
|
5076
5258
|
}
|
|
5077
|
-
function DataMarker() {
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
}
|
|
5259
|
+
function DataMarker(props) {
|
|
5260
|
+
const {
|
|
5261
|
+
edited,
|
|
5262
|
+
hasErrors
|
|
5263
|
+
} = props;
|
|
5264
|
+
if (hasErrors) {
|
|
5265
|
+
return jsxRuntime.jsx("div", {
|
|
5266
|
+
title: "Section contains an error",
|
|
5267
|
+
class: "bio-properties-panel-dot bio-properties-panel-dot--error"
|
|
5268
|
+
});
|
|
5269
|
+
}
|
|
5270
|
+
if (edited) {
|
|
5271
|
+
return jsxRuntime.jsx("div", {
|
|
5272
|
+
title: "Section contains data",
|
|
5273
|
+
class: "bio-properties-panel-dot"
|
|
5274
|
+
});
|
|
5275
|
+
}
|
|
5276
|
+
return null;
|
|
5082
5277
|
}
|
|
5083
5278
|
|
|
5084
5279
|
/**
|
|
@@ -5109,6 +5304,7 @@ function Placeholder(props) {
|
|
|
5109
5304
|
}
|
|
5110
5305
|
const DEFAULT_LAYOUT = {};
|
|
5111
5306
|
const DEFAULT_DESCRIPTION = {};
|
|
5307
|
+
const DEFAULT_TOOLTIP = {};
|
|
5112
5308
|
|
|
5113
5309
|
/**
|
|
5114
5310
|
* @typedef { {
|
|
@@ -5149,12 +5345,22 @@ const DEFAULT_DESCRIPTION = {};
|
|
|
5149
5345
|
* [id: String]: GetDescriptionFunction
|
|
5150
5346
|
* } } DescriptionConfig
|
|
5151
5347
|
*
|
|
5348
|
+
* @typedef { {
|
|
5349
|
+
* [id: String]: GetTooltipFunction
|
|
5350
|
+
* } } TooltipConfig
|
|
5351
|
+
*
|
|
5152
5352
|
* @callback { {
|
|
5153
5353
|
* @param {string} id
|
|
5154
5354
|
* @param {Object} element
|
|
5155
5355
|
* @returns {string}
|
|
5156
5356
|
* } } GetDescriptionFunction
|
|
5157
5357
|
*
|
|
5358
|
+
* @callback { {
|
|
5359
|
+
* @param {string} id
|
|
5360
|
+
* @param {Object} element
|
|
5361
|
+
* @returns {string}
|
|
5362
|
+
* } } GetTooltipFunction
|
|
5363
|
+
*
|
|
5158
5364
|
* @typedef { {
|
|
5159
5365
|
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
5160
5366
|
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
@@ -5175,6 +5381,8 @@ const DEFAULT_DESCRIPTION = {};
|
|
|
5175
5381
|
* @param {Function} [props.layoutChanged]
|
|
5176
5382
|
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
5177
5383
|
* @param {Function} [props.descriptionLoaded]
|
|
5384
|
+
* @param {TooltipConfig} [props.tooltipConfig]
|
|
5385
|
+
* @param {Function} [props.tooltipLoaded]
|
|
5178
5386
|
* @param {Object} [props.eventBus]
|
|
5179
5387
|
*/
|
|
5180
5388
|
function PropertiesPanel(props) {
|
|
@@ -5187,6 +5395,8 @@ function PropertiesPanel(props) {
|
|
|
5187
5395
|
layoutChanged,
|
|
5188
5396
|
descriptionConfig,
|
|
5189
5397
|
descriptionLoaded,
|
|
5398
|
+
tooltipConfig,
|
|
5399
|
+
tooltipLoaded,
|
|
5190
5400
|
eventBus
|
|
5191
5401
|
} = props;
|
|
5192
5402
|
|
|
@@ -5232,6 +5442,21 @@ function PropertiesPanel(props) {
|
|
|
5232
5442
|
description,
|
|
5233
5443
|
getDescriptionForId
|
|
5234
5444
|
};
|
|
5445
|
+
|
|
5446
|
+
// set-up tooltip context
|
|
5447
|
+
const tooltip = hooks.useMemo(() => createTooltipContext(tooltipConfig), [tooltipConfig]);
|
|
5448
|
+
hooks.useEffect(() => {
|
|
5449
|
+
if (typeof tooltipLoaded === 'function') {
|
|
5450
|
+
tooltipLoaded(tooltip);
|
|
5451
|
+
}
|
|
5452
|
+
}, [tooltip, tooltipLoaded]);
|
|
5453
|
+
const getTooltipForId = (id, element) => {
|
|
5454
|
+
return tooltip[id] && tooltip[id](element);
|
|
5455
|
+
};
|
|
5456
|
+
const tooltipContext = {
|
|
5457
|
+
tooltip,
|
|
5458
|
+
getTooltipForId
|
|
5459
|
+
};
|
|
5235
5460
|
const [errors, setErrors] = hooks.useState({});
|
|
5236
5461
|
const onSetErrors = ({
|
|
5237
5462
|
errors
|
|
@@ -5266,29 +5491,32 @@ function PropertiesPanel(props) {
|
|
|
5266
5491
|
value: errorsContext,
|
|
5267
5492
|
children: jsxRuntime.jsx(DescriptionContext.Provider, {
|
|
5268
5493
|
value: descriptionContext,
|
|
5269
|
-
children: jsxRuntime.jsx(
|
|
5270
|
-
value:
|
|
5271
|
-
children: jsxRuntime.jsx(
|
|
5272
|
-
value:
|
|
5273
|
-
children: jsxRuntime.
|
|
5274
|
-
|
|
5275
|
-
children:
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5494
|
+
children: jsxRuntime.jsx(TooltipContext.Provider, {
|
|
5495
|
+
value: tooltipContext,
|
|
5496
|
+
children: jsxRuntime.jsx(LayoutContext.Provider, {
|
|
5497
|
+
value: layoutContext,
|
|
5498
|
+
children: jsxRuntime.jsx(EventContext.Provider, {
|
|
5499
|
+
value: eventContext,
|
|
5500
|
+
children: jsxRuntime.jsxs("div", {
|
|
5501
|
+
class: "bio-properties-panel",
|
|
5502
|
+
children: [jsxRuntime.jsx(Header, {
|
|
5503
|
+
element: element,
|
|
5504
|
+
headerProvider: headerProvider
|
|
5505
|
+
}), jsxRuntime.jsx("div", {
|
|
5506
|
+
class: "bio-properties-panel-scroll-container",
|
|
5507
|
+
children: groups.map(group => {
|
|
5508
|
+
const {
|
|
5509
|
+
component: Component = Group,
|
|
5510
|
+
id
|
|
5511
|
+
} = group;
|
|
5512
|
+
return preact.createElement(Component, {
|
|
5513
|
+
...group,
|
|
5514
|
+
key: id,
|
|
5515
|
+
element: element
|
|
5516
|
+
});
|
|
5517
|
+
})
|
|
5518
|
+
})]
|
|
5519
|
+
})
|
|
5292
5520
|
})
|
|
5293
5521
|
})
|
|
5294
5522
|
})
|
|
@@ -5311,6 +5539,12 @@ function createDescriptionContext(overrides = {}) {
|
|
|
5311
5539
|
...overrides
|
|
5312
5540
|
};
|
|
5313
5541
|
}
|
|
5542
|
+
function createTooltipContext(overrides = {}) {
|
|
5543
|
+
return {
|
|
5544
|
+
...DEFAULT_TOOLTIP,
|
|
5545
|
+
...overrides
|
|
5546
|
+
};
|
|
5547
|
+
}
|
|
5314
5548
|
|
|
5315
5549
|
// hooks //////////////////
|
|
5316
5550
|
|
|
@@ -5541,6 +5775,18 @@ function ListGroup(props) {
|
|
|
5541
5775
|
setAddTriggered(true);
|
|
5542
5776
|
add(e);
|
|
5543
5777
|
};
|
|
5778
|
+
const allErrors = useErrors();
|
|
5779
|
+
const hasError = items.some(item => {
|
|
5780
|
+
if (allErrors[item.id]) {
|
|
5781
|
+
return true;
|
|
5782
|
+
}
|
|
5783
|
+
if (!item.entries) {
|
|
5784
|
+
return;
|
|
5785
|
+
}
|
|
5786
|
+
|
|
5787
|
+
// also check if the error is nested, e.g. for name-value entries
|
|
5788
|
+
return item.entries.some(entry => allErrors[entry.id]);
|
|
5789
|
+
});
|
|
5544
5790
|
return jsxRuntime.jsxs("div", {
|
|
5545
5791
|
class: "bio-properties-panel-group",
|
|
5546
5792
|
"data-group-id": 'group-' + id,
|
|
@@ -5551,7 +5797,13 @@ function ListGroup(props) {
|
|
|
5551
5797
|
children: [jsxRuntime.jsx("div", {
|
|
5552
5798
|
title: label,
|
|
5553
5799
|
class: "bio-properties-panel-group-header-title",
|
|
5554
|
-
children:
|
|
5800
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
5801
|
+
value: props.tooltip,
|
|
5802
|
+
forId: 'group-' + id,
|
|
5803
|
+
element: element,
|
|
5804
|
+
parent: groupRef,
|
|
5805
|
+
children: label
|
|
5806
|
+
})
|
|
5555
5807
|
}), jsxRuntime.jsxs("div", {
|
|
5556
5808
|
class: "bio-properties-panel-group-header-buttons",
|
|
5557
5809
|
children: [add ? jsxRuntime.jsxs("button", {
|
|
@@ -5564,7 +5816,7 @@ function ListGroup(props) {
|
|
|
5564
5816
|
}) : null]
|
|
5565
5817
|
}) : null, hasItems ? jsxRuntime.jsx("div", {
|
|
5566
5818
|
title: `List contains ${items.length} item${items.length != 1 ? 's' : ''}`,
|
|
5567
|
-
class:
|
|
5819
|
+
class: classnames('bio-properties-panel-list-badge', hasError ? 'bio-properties-panel-list-badge--error' : ''),
|
|
5568
5820
|
children: items.length
|
|
5569
5821
|
}) : null, hasItems ? jsxRuntime.jsx("button", {
|
|
5570
5822
|
title: "Toggle section",
|
|
@@ -5640,7 +5892,8 @@ function Checkbox(props) {
|
|
|
5640
5892
|
disabled,
|
|
5641
5893
|
value = false,
|
|
5642
5894
|
onFocus,
|
|
5643
|
-
onBlur
|
|
5895
|
+
onBlur,
|
|
5896
|
+
tooltip
|
|
5644
5897
|
} = props;
|
|
5645
5898
|
const [localValue, setLocalValue] = hooks.useState(value);
|
|
5646
5899
|
const handleChangeCallback = ({
|
|
@@ -5675,7 +5928,12 @@ function Checkbox(props) {
|
|
|
5675
5928
|
}), jsxRuntime.jsx("label", {
|
|
5676
5929
|
for: prefixId$7(id),
|
|
5677
5930
|
class: "bio-properties-panel-label",
|
|
5678
|
-
children:
|
|
5931
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
5932
|
+
value: tooltip,
|
|
5933
|
+
forId: id,
|
|
5934
|
+
element: props.element,
|
|
5935
|
+
children: label
|
|
5936
|
+
})
|
|
5679
5937
|
})]
|
|
5680
5938
|
});
|
|
5681
5939
|
}
|
|
@@ -5690,6 +5948,7 @@ function Checkbox(props) {
|
|
|
5690
5948
|
* @param {Function} props.setValue
|
|
5691
5949
|
* @param {Function} props.onFocus
|
|
5692
5950
|
* @param {Function} props.onBlur
|
|
5951
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
5693
5952
|
* @param {boolean} [props.disabled]
|
|
5694
5953
|
*/
|
|
5695
5954
|
function CheckboxEntry(props) {
|
|
@@ -5702,7 +5961,8 @@ function CheckboxEntry(props) {
|
|
|
5702
5961
|
setValue,
|
|
5703
5962
|
disabled,
|
|
5704
5963
|
onFocus,
|
|
5705
|
-
onBlur
|
|
5964
|
+
onBlur,
|
|
5965
|
+
tooltip
|
|
5706
5966
|
} = props;
|
|
5707
5967
|
const value = getValue(element);
|
|
5708
5968
|
const error = useError(id);
|
|
@@ -5716,7 +5976,9 @@ function CheckboxEntry(props) {
|
|
|
5716
5976
|
onChange: setValue,
|
|
5717
5977
|
onFocus: onFocus,
|
|
5718
5978
|
onBlur: onBlur,
|
|
5719
|
-
value: value
|
|
5979
|
+
value: value,
|
|
5980
|
+
tooltip: tooltip,
|
|
5981
|
+
element: element
|
|
5720
5982
|
}, element), error && jsxRuntime.jsx("div", {
|
|
5721
5983
|
class: "bio-properties-panel-error",
|
|
5722
5984
|
children: error
|
|
@@ -5973,7 +6235,8 @@ function ToggleSwitch(props) {
|
|
|
5973
6235
|
inline,
|
|
5974
6236
|
onFocus,
|
|
5975
6237
|
onBlur,
|
|
5976
|
-
inputRef
|
|
6238
|
+
inputRef,
|
|
6239
|
+
tooltip
|
|
5977
6240
|
} = props;
|
|
5978
6241
|
const [localValue, setLocalValue] = hooks.useState(value);
|
|
5979
6242
|
const handleInputCallback = async () => {
|
|
@@ -5996,7 +6259,12 @@ function ToggleSwitch(props) {
|
|
|
5996
6259
|
children: [jsxRuntime.jsx("label", {
|
|
5997
6260
|
class: "bio-properties-panel-label",
|
|
5998
6261
|
for: prefixId$6(id),
|
|
5999
|
-
children:
|
|
6262
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
6263
|
+
value: tooltip,
|
|
6264
|
+
forId: id,
|
|
6265
|
+
element: props.element,
|
|
6266
|
+
children: label
|
|
6267
|
+
})
|
|
6000
6268
|
}), jsxRuntime.jsxs("div", {
|
|
6001
6269
|
class: "bio-properties-panel-field-wrapper",
|
|
6002
6270
|
children: [jsxRuntime.jsxs("label", {
|
|
@@ -6034,6 +6302,7 @@ function ToggleSwitch(props) {
|
|
|
6034
6302
|
* @param {Function} props.setValue
|
|
6035
6303
|
* @param {Function} props.onFocus
|
|
6036
6304
|
* @param {Function} props.onBlur
|
|
6305
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
6037
6306
|
*/
|
|
6038
6307
|
function ToggleSwitchEntry(props) {
|
|
6039
6308
|
const {
|
|
@@ -6046,7 +6315,8 @@ function ToggleSwitchEntry(props) {
|
|
|
6046
6315
|
getValue,
|
|
6047
6316
|
setValue,
|
|
6048
6317
|
onFocus,
|
|
6049
|
-
onBlur
|
|
6318
|
+
onBlur,
|
|
6319
|
+
tooltip
|
|
6050
6320
|
} = props;
|
|
6051
6321
|
const value = getValue(element);
|
|
6052
6322
|
return jsxRuntime.jsxs("div", {
|
|
@@ -6060,7 +6330,9 @@ function ToggleSwitchEntry(props) {
|
|
|
6060
6330
|
onFocus: onFocus,
|
|
6061
6331
|
onBlur: onBlur,
|
|
6062
6332
|
switcherLabel: switcherLabel,
|
|
6063
|
-
inline: inline
|
|
6333
|
+
inline: inline,
|
|
6334
|
+
tooltip: tooltip,
|
|
6335
|
+
element: element
|
|
6064
6336
|
}), jsxRuntime.jsx(Description$1, {
|
|
6065
6337
|
forId: id,
|
|
6066
6338
|
element: element,
|
|
@@ -6240,7 +6512,8 @@ function FeelTextfield(props) {
|
|
|
6240
6512
|
disabled = false,
|
|
6241
6513
|
variables,
|
|
6242
6514
|
tooltipContainer,
|
|
6243
|
-
OptionalComponent = OptionalFeelInput
|
|
6515
|
+
OptionalComponent = OptionalFeelInput,
|
|
6516
|
+
tooltip
|
|
6244
6517
|
} = props;
|
|
6245
6518
|
const [localValue, _setLocalValue] = hooks.useState(value);
|
|
6246
6519
|
const editorRef = useShowEntryEvent(id);
|
|
@@ -6356,7 +6629,12 @@ function FeelTextfield(props) {
|
|
|
6356
6629
|
for: prefixId$4(id),
|
|
6357
6630
|
class: "bio-properties-panel-label",
|
|
6358
6631
|
onClick: () => setFocus(),
|
|
6359
|
-
children: [
|
|
6632
|
+
children: [jsxRuntime.jsx(TooltipWrapper, {
|
|
6633
|
+
value: tooltip,
|
|
6634
|
+
forId: id,
|
|
6635
|
+
element: props.element,
|
|
6636
|
+
children: label
|
|
6637
|
+
}), jsxRuntime.jsx(FeelIcon, {
|
|
6360
6638
|
label: label,
|
|
6361
6639
|
feel: feel,
|
|
6362
6640
|
onClick: handleFeelToggle,
|
|
@@ -6616,6 +6894,7 @@ React.forwardRef((props, ref) => {
|
|
|
6616
6894
|
* @param {Function} props.variables
|
|
6617
6895
|
* @param {Function} props.onFocus
|
|
6618
6896
|
* @param {Function} props.onBlur
|
|
6897
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
6619
6898
|
*/
|
|
6620
6899
|
function FeelEntry(props) {
|
|
6621
6900
|
const {
|
|
@@ -6636,7 +6915,8 @@ function FeelEntry(props) {
|
|
|
6636
6915
|
example,
|
|
6637
6916
|
variables,
|
|
6638
6917
|
onFocus,
|
|
6639
|
-
onBlur
|
|
6918
|
+
onBlur,
|
|
6919
|
+
tooltip
|
|
6640
6920
|
} = props;
|
|
6641
6921
|
const [validationError, setValidationError] = hooks.useState(null);
|
|
6642
6922
|
const [localError, setLocalError] = hooks.useState(null);
|
|
@@ -6686,7 +6966,8 @@ function FeelEntry(props) {
|
|
|
6686
6966
|
value: value,
|
|
6687
6967
|
variables: variables,
|
|
6688
6968
|
tooltipContainer: tooltipContainer,
|
|
6689
|
-
OptionalComponent: props.OptionalComponent
|
|
6969
|
+
OptionalComponent: props.OptionalComponent,
|
|
6970
|
+
tooltip: tooltip
|
|
6690
6971
|
}), error && jsxRuntime.jsx("div", {
|
|
6691
6972
|
class: "bio-properties-panel-error",
|
|
6692
6973
|
children: error
|
|
@@ -6807,7 +7088,8 @@ function Select(props) {
|
|
|
6807
7088
|
value = '',
|
|
6808
7089
|
disabled,
|
|
6809
7090
|
onFocus,
|
|
6810
|
-
onBlur
|
|
7091
|
+
onBlur,
|
|
7092
|
+
tooltip
|
|
6811
7093
|
} = props;
|
|
6812
7094
|
const ref = useShowEntryEvent(id);
|
|
6813
7095
|
const [localValue, setLocalValue] = hooks.useState(value);
|
|
@@ -6831,7 +7113,12 @@ function Select(props) {
|
|
|
6831
7113
|
children: [jsxRuntime.jsx("label", {
|
|
6832
7114
|
for: prefixId$3(id),
|
|
6833
7115
|
class: "bio-properties-panel-label",
|
|
6834
|
-
children:
|
|
7116
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
7117
|
+
value: tooltip,
|
|
7118
|
+
forId: id,
|
|
7119
|
+
element: props.element,
|
|
7120
|
+
children: label
|
|
7121
|
+
})
|
|
6835
7122
|
}), jsxRuntime.jsx("select", {
|
|
6836
7123
|
ref: ref,
|
|
6837
7124
|
id: prefixId$3(id),
|
|
@@ -6876,6 +7163,7 @@ function Select(props) {
|
|
|
6876
7163
|
* @param {Function} props.getOptions
|
|
6877
7164
|
* @param {boolean} [props.disabled]
|
|
6878
7165
|
* @param {Function} [props.validate]
|
|
7166
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
6879
7167
|
*/
|
|
6880
7168
|
function SelectEntry(props) {
|
|
6881
7169
|
const {
|
|
@@ -6889,7 +7177,8 @@ function SelectEntry(props) {
|
|
|
6889
7177
|
disabled,
|
|
6890
7178
|
onFocus,
|
|
6891
7179
|
onBlur,
|
|
6892
|
-
validate
|
|
7180
|
+
validate,
|
|
7181
|
+
tooltip
|
|
6893
7182
|
} = props;
|
|
6894
7183
|
const options = getOptions(element);
|
|
6895
7184
|
const globalError = useError(id);
|
|
@@ -6921,7 +7210,9 @@ function SelectEntry(props) {
|
|
|
6921
7210
|
onFocus: onFocus,
|
|
6922
7211
|
onBlur: onBlur,
|
|
6923
7212
|
options: options,
|
|
6924
|
-
disabled: disabled
|
|
7213
|
+
disabled: disabled,
|
|
7214
|
+
tooltip: tooltip,
|
|
7215
|
+
element: element
|
|
6925
7216
|
}, element), error && jsxRuntime.jsx("div", {
|
|
6926
7217
|
class: "bio-properties-panel-error",
|
|
6927
7218
|
children: error
|
|
@@ -6960,7 +7251,8 @@ function TextArea(props) {
|
|
|
6960
7251
|
onFocus,
|
|
6961
7252
|
onBlur,
|
|
6962
7253
|
autoResize,
|
|
6963
|
-
rows = autoResize ? 1 : 2
|
|
7254
|
+
rows = autoResize ? 1 : 2,
|
|
7255
|
+
tooltip
|
|
6964
7256
|
} = props;
|
|
6965
7257
|
const [localValue, setLocalValue] = hooks.useState(value);
|
|
6966
7258
|
const ref = useShowEntryEvent(id);
|
|
@@ -6988,7 +7280,12 @@ function TextArea(props) {
|
|
|
6988
7280
|
children: [jsxRuntime.jsx("label", {
|
|
6989
7281
|
for: prefixId$1(id),
|
|
6990
7282
|
class: "bio-properties-panel-label",
|
|
6991
|
-
children:
|
|
7283
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
7284
|
+
value: tooltip,
|
|
7285
|
+
forId: id,
|
|
7286
|
+
element: props.element,
|
|
7287
|
+
children: label
|
|
7288
|
+
})
|
|
6992
7289
|
}), jsxRuntime.jsx("textarea", {
|
|
6993
7290
|
ref: ref,
|
|
6994
7291
|
id: prefixId$1(id),
|
|
@@ -7037,7 +7334,8 @@ function TextAreaEntry(props) {
|
|
|
7037
7334
|
validate,
|
|
7038
7335
|
onFocus,
|
|
7039
7336
|
onBlur,
|
|
7040
|
-
autoResize
|
|
7337
|
+
autoResize,
|
|
7338
|
+
tooltip
|
|
7041
7339
|
} = props;
|
|
7042
7340
|
const globalError = useError(id);
|
|
7043
7341
|
const [localError, setLocalError] = hooks.useState(null);
|
|
@@ -7071,7 +7369,9 @@ function TextAreaEntry(props) {
|
|
|
7071
7369
|
debounce: debounce,
|
|
7072
7370
|
monospace: monospace,
|
|
7073
7371
|
disabled: disabled,
|
|
7074
|
-
autoResize: autoResize
|
|
7372
|
+
autoResize: autoResize,
|
|
7373
|
+
tooltip: tooltip,
|
|
7374
|
+
element: element
|
|
7075
7375
|
}, element), error && jsxRuntime.jsx("div", {
|
|
7076
7376
|
class: "bio-properties-panel-error",
|
|
7077
7377
|
children: error
|
|
@@ -7100,7 +7400,8 @@ function Textfield(props) {
|
|
|
7100
7400
|
onInput,
|
|
7101
7401
|
onFocus,
|
|
7102
7402
|
onBlur,
|
|
7103
|
-
value = ''
|
|
7403
|
+
value = '',
|
|
7404
|
+
tooltip
|
|
7104
7405
|
} = props;
|
|
7105
7406
|
const [localValue, setLocalValue] = hooks.useState(value || '');
|
|
7106
7407
|
const ref = useShowEntryEvent(id);
|
|
@@ -7124,7 +7425,12 @@ function Textfield(props) {
|
|
|
7124
7425
|
children: [jsxRuntime.jsx("label", {
|
|
7125
7426
|
for: prefixId(id),
|
|
7126
7427
|
class: "bio-properties-panel-label",
|
|
7127
|
-
children:
|
|
7428
|
+
children: jsxRuntime.jsx(TooltipWrapper, {
|
|
7429
|
+
value: tooltip,
|
|
7430
|
+
forId: id,
|
|
7431
|
+
element: props.element,
|
|
7432
|
+
children: label
|
|
7433
|
+
})
|
|
7128
7434
|
}), jsxRuntime.jsx("input", {
|
|
7129
7435
|
ref: ref,
|
|
7130
7436
|
id: prefixId(id),
|
|
@@ -7154,6 +7460,7 @@ function Textfield(props) {
|
|
|
7154
7460
|
* @param {Function} props.setValue
|
|
7155
7461
|
* @param {Function} props.onFocus
|
|
7156
7462
|
* @param {Function} props.onBlur
|
|
7463
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
7157
7464
|
* @param {Function} props.validate
|
|
7158
7465
|
*/
|
|
7159
7466
|
function TextfieldEntry(props) {
|
|
@@ -7168,7 +7475,8 @@ function TextfieldEntry(props) {
|
|
|
7168
7475
|
setValue,
|
|
7169
7476
|
validate,
|
|
7170
7477
|
onFocus,
|
|
7171
|
-
onBlur
|
|
7478
|
+
onBlur,
|
|
7479
|
+
tooltip
|
|
7172
7480
|
} = props;
|
|
7173
7481
|
const globalError = useError(id);
|
|
7174
7482
|
const [localError, setLocalError] = hooks.useState(null);
|
|
@@ -7199,7 +7507,9 @@ function TextfieldEntry(props) {
|
|
|
7199
7507
|
onInput: onInput,
|
|
7200
7508
|
onFocus: onFocus,
|
|
7201
7509
|
onBlur: onBlur,
|
|
7202
|
-
value: value
|
|
7510
|
+
value: value,
|
|
7511
|
+
tooltip: tooltip,
|
|
7512
|
+
element: element
|
|
7203
7513
|
}, element), error && jsxRuntime.jsx("div", {
|
|
7204
7514
|
class: "bio-properties-panel-error",
|
|
7205
7515
|
children: error
|
|
@@ -7220,11 +7530,11 @@ function prefixId(id) {
|
|
|
7220
7530
|
return `bio-properties-panel-${id}`;
|
|
7221
7531
|
}
|
|
7222
7532
|
|
|
7223
|
-
/**
|
|
7224
|
-
* @param {string} type
|
|
7225
|
-
* @param {boolean} [strict]
|
|
7226
|
-
*
|
|
7227
|
-
* @returns {any}
|
|
7533
|
+
/**
|
|
7534
|
+
* @param {string} type
|
|
7535
|
+
* @param {boolean} [strict]
|
|
7536
|
+
*
|
|
7537
|
+
* @returns {any}
|
|
7228
7538
|
*/
|
|
7229
7539
|
function getService(type, strict) {}
|
|
7230
7540
|
const PropertiesPanelContext = preact.createContext({
|
|
@@ -7314,8 +7624,8 @@ const PropertiesPanelHeaderProvider = {
|
|
|
7314
7624
|
}
|
|
7315
7625
|
};
|
|
7316
7626
|
|
|
7317
|
-
/**
|
|
7318
|
-
* Provide placeholders for empty and multiple state.
|
|
7627
|
+
/**
|
|
7628
|
+
* Provide placeholders for empty and multiple state.
|
|
7319
7629
|
*/
|
|
7320
7630
|
const PropertiesPanelPlaceholderProvider = {
|
|
7321
7631
|
getEmpty: () => {
|
|
@@ -7387,10 +7697,10 @@ function useService (type, strict) {
|
|
|
7387
7697
|
return getService(type, strict);
|
|
7388
7698
|
}
|
|
7389
7699
|
|
|
7390
|
-
/**
|
|
7391
|
-
* Retrieve list of variables from the form schema.
|
|
7392
|
-
*
|
|
7393
|
-
* @returns { string[] } list of variables used in form schema
|
|
7700
|
+
/**
|
|
7701
|
+
* Retrieve list of variables from the form schema.
|
|
7702
|
+
*
|
|
7703
|
+
* @returns { string[] } list of variables used in form schema
|
|
7394
7704
|
*/
|
|
7395
7705
|
function useVariables() {
|
|
7396
7706
|
const form = useService('formEditor');
|
|
@@ -7442,6 +7752,7 @@ function AltText(props) {
|
|
|
7442
7752
|
getValue,
|
|
7443
7753
|
id,
|
|
7444
7754
|
label: 'Alternative text',
|
|
7755
|
+
tooltip: 'Descriptive text for screen reader accessibility.',
|
|
7445
7756
|
setValue,
|
|
7446
7757
|
singleLine: true,
|
|
7447
7758
|
variables
|
|
@@ -7845,6 +8156,7 @@ function Disabled(props) {
|
|
|
7845
8156
|
getValue,
|
|
7846
8157
|
id,
|
|
7847
8158
|
label: 'Disabled',
|
|
8159
|
+
tooltip: 'Field cannot be edited by the end-user, and the data is not submitted.',
|
|
7848
8160
|
inline: true,
|
|
7849
8161
|
setValue
|
|
7850
8162
|
});
|
|
@@ -7988,6 +8300,7 @@ function Key$1(props) {
|
|
|
7988
8300
|
getValue,
|
|
7989
8301
|
id,
|
|
7990
8302
|
label: 'Key',
|
|
8303
|
+
tooltip: 'Use a unique "key" to link the form element and the related input/output data. When dealing with nested data, break it down in the user task\'s input mapping before using it.',
|
|
7991
8304
|
setValue,
|
|
7992
8305
|
validate
|
|
7993
8306
|
});
|
|
@@ -8048,7 +8361,7 @@ function Label$1(props) {
|
|
|
8048
8361
|
return minDash.get(field, path, '');
|
|
8049
8362
|
};
|
|
8050
8363
|
const setValue = value => {
|
|
8051
|
-
return editField(field, path, value);
|
|
8364
|
+
return editField(field, path, value || '');
|
|
8052
8365
|
};
|
|
8053
8366
|
return FeelTemplatingEntry({
|
|
8054
8367
|
debounce,
|
|
@@ -8076,7 +8389,7 @@ function DateLabel(props) {
|
|
|
8076
8389
|
return minDash.get(field, path, '');
|
|
8077
8390
|
};
|
|
8078
8391
|
const setValue = value => {
|
|
8079
|
-
return editField(field, path, value);
|
|
8392
|
+
return editField(field, path, value || '');
|
|
8080
8393
|
};
|
|
8081
8394
|
return FeelTemplatingEntry({
|
|
8082
8395
|
debounce,
|
|
@@ -8104,7 +8417,7 @@ function TimeLabel(props) {
|
|
|
8104
8417
|
return minDash.get(field, path, '');
|
|
8105
8418
|
};
|
|
8106
8419
|
const setValue = value => {
|
|
8107
|
-
return editField(field, path, value);
|
|
8420
|
+
return editField(field, path, value || '');
|
|
8108
8421
|
};
|
|
8109
8422
|
return FeelTemplatingEntry({
|
|
8110
8423
|
debounce,
|
|
@@ -8163,6 +8476,7 @@ function Source(props) {
|
|
|
8163
8476
|
getValue,
|
|
8164
8477
|
id,
|
|
8165
8478
|
label: 'Image source',
|
|
8479
|
+
tooltip: 'Link referring to a hosted image, or use a data URI directly to embed image data into the form.',
|
|
8166
8480
|
setValue,
|
|
8167
8481
|
singleLine: true,
|
|
8168
8482
|
variables
|
|
@@ -8924,14 +9238,14 @@ function Value(props) {
|
|
|
8924
9238
|
|
|
8925
9239
|
// helpers //////////
|
|
8926
9240
|
|
|
8927
|
-
/**
|
|
8928
|
-
* Returns copy of object with updated value.
|
|
8929
|
-
*
|
|
8930
|
-
* @param {Object} properties
|
|
8931
|
-
* @param {string} key
|
|
8932
|
-
* @param {string} value
|
|
8933
|
-
*
|
|
8934
|
-
* @returns {Object}
|
|
9241
|
+
/**
|
|
9242
|
+
* Returns copy of object with updated value.
|
|
9243
|
+
*
|
|
9244
|
+
* @param {Object} properties
|
|
9245
|
+
* @param {string} key
|
|
9246
|
+
* @param {string} value
|
|
9247
|
+
*
|
|
9248
|
+
* @returns {Object}
|
|
8935
9249
|
*/
|
|
8936
9250
|
function updateValue(properties, key, value) {
|
|
8937
9251
|
return {
|
|
@@ -8940,14 +9254,14 @@ function updateValue(properties, key, value) {
|
|
|
8940
9254
|
};
|
|
8941
9255
|
}
|
|
8942
9256
|
|
|
8943
|
-
/**
|
|
8944
|
-
* Returns copy of object with updated key.
|
|
8945
|
-
*
|
|
8946
|
-
* @param {Object} properties
|
|
8947
|
-
* @param {string} oldKey
|
|
8948
|
-
* @param {string} newKey
|
|
8949
|
-
*
|
|
8950
|
-
* @returns {Object}
|
|
9257
|
+
/**
|
|
9258
|
+
* Returns copy of object with updated key.
|
|
9259
|
+
*
|
|
9260
|
+
* @param {Object} properties
|
|
9261
|
+
* @param {string} oldKey
|
|
9262
|
+
* @param {string} newKey
|
|
9263
|
+
*
|
|
9264
|
+
* @returns {Object}
|
|
8951
9265
|
*/
|
|
8952
9266
|
function updateKey(properties, oldKey, newKey) {
|
|
8953
9267
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -9319,6 +9633,7 @@ function Readonly(props) {
|
|
|
9319
9633
|
getValue,
|
|
9320
9634
|
id,
|
|
9321
9635
|
label: 'Read only',
|
|
9636
|
+
tooltip: 'Field cannot be edited by the end-user, but the data will still be submitted.',
|
|
9322
9637
|
setValue,
|
|
9323
9638
|
variables
|
|
9324
9639
|
});
|
|
@@ -9772,12 +10087,13 @@ function ValuesGroups(field, editField) {
|
|
|
9772
10087
|
};
|
|
9773
10088
|
const valuesSourceId = `${fieldId}-valuesSource`;
|
|
9774
10089
|
|
|
9775
|
-
/**
|
|
9776
|
-
* @type {Array<Group|ListGroup>}
|
|
10090
|
+
/**
|
|
10091
|
+
* @type {Array<Group|ListGroup>}
|
|
9777
10092
|
*/
|
|
9778
10093
|
const groups = [{
|
|
9779
10094
|
id: valuesSourceId,
|
|
9780
10095
|
label: 'Options source',
|
|
10096
|
+
tooltip: '"Static" defines a constant, predefined set of form options.\n"Dynamic" defines options that are populated dynamically, adjusting based on variable data for flexible responses to different conditions or inputs.',
|
|
9781
10097
|
component: Group,
|
|
9782
10098
|
entries: ValuesSourceSelectEntry({
|
|
9783
10099
|
...context,
|
|
@@ -9822,7 +10138,7 @@ function ValuesGroups(field, editField) {
|
|
|
9822
10138
|
return groups;
|
|
9823
10139
|
}
|
|
9824
10140
|
|
|
9825
|
-
function
|
|
10141
|
+
function CustomPropertiesGroup(field, editField) {
|
|
9826
10142
|
const {
|
|
9827
10143
|
properties = {},
|
|
9828
10144
|
type
|
|
@@ -9880,19 +10196,20 @@ function CustomValuesGroup(field, editField) {
|
|
|
9880
10196
|
id: 'custom-values',
|
|
9881
10197
|
items,
|
|
9882
10198
|
label: 'Custom properties',
|
|
10199
|
+
tooltip: 'Add properties directly to the form schema, useful to configure functionality in custom-built task applications and form renderers.',
|
|
9883
10200
|
shouldSort: false
|
|
9884
10201
|
};
|
|
9885
10202
|
}
|
|
9886
10203
|
|
|
9887
10204
|
// helpers //////////
|
|
9888
10205
|
|
|
9889
|
-
/**
|
|
9890
|
-
* Returns copy of object without key.
|
|
9891
|
-
*
|
|
9892
|
-
* @param {Object} properties
|
|
9893
|
-
* @param {string} oldKey
|
|
9894
|
-
*
|
|
9895
|
-
* @returns {Object}
|
|
10206
|
+
/**
|
|
10207
|
+
* Returns copy of object without key.
|
|
10208
|
+
*
|
|
10209
|
+
* @param {Object} properties
|
|
10210
|
+
* @param {string} oldKey
|
|
10211
|
+
*
|
|
10212
|
+
* @returns {Object}
|
|
9896
10213
|
*/
|
|
9897
10214
|
function removeKey(properties, oldKey) {
|
|
9898
10215
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -9965,7 +10282,7 @@ function getGroups(field, editField, getService) {
|
|
|
9965
10282
|
if (!field) {
|
|
9966
10283
|
return [];
|
|
9967
10284
|
}
|
|
9968
|
-
const groups = [GeneralGroup(field, editField, getService), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ...ValuesGroups(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField),
|
|
10285
|
+
const groups = [GeneralGroup(field, editField, getService), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ...ValuesGroups(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)];
|
|
9969
10286
|
|
|
9970
10287
|
// contract: if a group returns null, it should not be displayed at all
|
|
9971
10288
|
return groups.filter(group => group !== null);
|
|
@@ -9995,9 +10312,9 @@ function FormPropertiesPanel(props) {
|
|
|
9995
10312
|
});
|
|
9996
10313
|
}, [eventBus, formEditor, selectionModule]);
|
|
9997
10314
|
hooks.useLayoutEffect(() => {
|
|
9998
|
-
/**
|
|
9999
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
10000
|
-
* once we have a proper updater/change support
|
|
10315
|
+
/**
|
|
10316
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
10317
|
+
* once we have a proper updater/change support
|
|
10001
10318
|
*/
|
|
10002
10319
|
eventBus.on('changed', refresh);
|
|
10003
10320
|
eventBus.on('import.done', refresh);
|
|
@@ -10049,10 +10366,10 @@ class PropertiesPanelRenderer {
|
|
|
10049
10366
|
});
|
|
10050
10367
|
}
|
|
10051
10368
|
|
|
10052
|
-
/**
|
|
10053
|
-
* Attach the properties panel to a parent node.
|
|
10054
|
-
*
|
|
10055
|
-
* @param {HTMLElement} container
|
|
10369
|
+
/**
|
|
10370
|
+
* Attach the properties panel to a parent node.
|
|
10371
|
+
*
|
|
10372
|
+
* @param {HTMLElement} container
|
|
10056
10373
|
*/
|
|
10057
10374
|
attachTo(container) {
|
|
10058
10375
|
if (!container) {
|
|
@@ -10072,8 +10389,8 @@ class PropertiesPanelRenderer {
|
|
|
10072
10389
|
this._eventBus.fire('propertiesPanel.attach');
|
|
10073
10390
|
}
|
|
10074
10391
|
|
|
10075
|
-
/**
|
|
10076
|
-
* Detach the properties panel from its parent node.
|
|
10392
|
+
/**
|
|
10393
|
+
* Detach the properties panel from its parent node.
|
|
10077
10394
|
*/
|
|
10078
10395
|
detach() {
|
|
10079
10396
|
const parentNode = this._container.parentNode;
|
|
@@ -10103,10 +10420,10 @@ var PropertiesPanelModule = {
|
|
|
10103
10420
|
propertiesPanel: ['type', PropertiesPanelRenderer]
|
|
10104
10421
|
};
|
|
10105
10422
|
|
|
10106
|
-
/**
|
|
10107
|
-
* Manages the rendering of visual plugins.
|
|
10108
|
-
* @constructor
|
|
10109
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
10423
|
+
/**
|
|
10424
|
+
* Manages the rendering of visual plugins.
|
|
10425
|
+
* @constructor
|
|
10426
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
10110
10427
|
*/
|
|
10111
10428
|
class RenderInjector extends SectionModuleBase {
|
|
10112
10429
|
constructor(eventBus) {
|
|
@@ -10115,10 +10432,10 @@ class RenderInjector extends SectionModuleBase {
|
|
|
10115
10432
|
this.registeredRenderers = [];
|
|
10116
10433
|
}
|
|
10117
10434
|
|
|
10118
|
-
/**
|
|
10119
|
-
* Inject a new renderer into the injector.
|
|
10120
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
10121
|
-
* @param {Function} Renderer - The renderer function.
|
|
10435
|
+
/**
|
|
10436
|
+
* Inject a new renderer into the injector.
|
|
10437
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
10438
|
+
* @param {Function} Renderer - The renderer function.
|
|
10122
10439
|
*/
|
|
10123
10440
|
attachRenderer(identifier, Renderer) {
|
|
10124
10441
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -10127,17 +10444,17 @@ class RenderInjector extends SectionModuleBase {
|
|
|
10127
10444
|
}];
|
|
10128
10445
|
}
|
|
10129
10446
|
|
|
10130
|
-
/**
|
|
10131
|
-
* Detach a renderer from the by key injector.
|
|
10132
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
10447
|
+
/**
|
|
10448
|
+
* Detach a renderer from the by key injector.
|
|
10449
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
10133
10450
|
*/
|
|
10134
10451
|
detachRenderer(identifier) {
|
|
10135
10452
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
10136
10453
|
}
|
|
10137
10454
|
|
|
10138
|
-
/**
|
|
10139
|
-
* Returns the registered renderers.
|
|
10140
|
-
* @returns {Array} Array of registered renderers.
|
|
10455
|
+
/**
|
|
10456
|
+
* Returns the registered renderers.
|
|
10457
|
+
* @returns {Array} Array of registered renderers.
|
|
10141
10458
|
*/
|
|
10142
10459
|
fetchRenderers() {
|
|
10143
10460
|
return this.registeredRenderers;
|
|
@@ -10171,48 +10488,48 @@ var ExpressionLanguageModule = {
|
|
|
10171
10488
|
|
|
10172
10489
|
const ids = new Ids([32, 36, 1]);
|
|
10173
10490
|
|
|
10174
|
-
/**
|
|
10175
|
-
* @typedef { import('./types').Injector } Injector
|
|
10176
|
-
* @typedef { import('./types').Module } Module
|
|
10177
|
-
* @typedef { import('./types').Schema } Schema
|
|
10178
|
-
*
|
|
10179
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
10180
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
10181
|
-
*
|
|
10182
|
-
* @typedef { {
|
|
10183
|
-
* properties: FormEditorProperties,
|
|
10184
|
-
* schema: Schema
|
|
10185
|
-
* } } State
|
|
10186
|
-
*
|
|
10187
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
10188
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
10189
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
10491
|
+
/**
|
|
10492
|
+
* @typedef { import('./types').Injector } Injector
|
|
10493
|
+
* @typedef { import('./types').Module } Module
|
|
10494
|
+
* @typedef { import('./types').Schema } Schema
|
|
10495
|
+
*
|
|
10496
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
10497
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
10498
|
+
*
|
|
10499
|
+
* @typedef { {
|
|
10500
|
+
* properties: FormEditorProperties,
|
|
10501
|
+
* schema: Schema
|
|
10502
|
+
* } } State
|
|
10503
|
+
*
|
|
10504
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
10505
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
10506
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
10190
10507
|
*/
|
|
10191
10508
|
|
|
10192
|
-
/**
|
|
10193
|
-
* The form editor.
|
|
10509
|
+
/**
|
|
10510
|
+
* The form editor.
|
|
10194
10511
|
*/
|
|
10195
10512
|
class FormEditor {
|
|
10196
|
-
/**
|
|
10197
|
-
* @constructor
|
|
10198
|
-
* @param {FormEditorOptions} options
|
|
10513
|
+
/**
|
|
10514
|
+
* @constructor
|
|
10515
|
+
* @param {FormEditorOptions} options
|
|
10199
10516
|
*/
|
|
10200
10517
|
constructor(options = {}) {
|
|
10201
|
-
/**
|
|
10202
|
-
* @public
|
|
10203
|
-
* @type {OnEventType}
|
|
10518
|
+
/**
|
|
10519
|
+
* @public
|
|
10520
|
+
* @type {OnEventType}
|
|
10204
10521
|
*/
|
|
10205
10522
|
this.on = this._onEvent;
|
|
10206
10523
|
|
|
10207
|
-
/**
|
|
10208
|
-
* @public
|
|
10209
|
-
* @type {String}
|
|
10524
|
+
/**
|
|
10525
|
+
* @public
|
|
10526
|
+
* @type {String}
|
|
10210
10527
|
*/
|
|
10211
10528
|
this._id = ids.next();
|
|
10212
10529
|
|
|
10213
|
-
/**
|
|
10214
|
-
* @private
|
|
10215
|
-
* @type {Element}
|
|
10530
|
+
/**
|
|
10531
|
+
* @private
|
|
10532
|
+
* @type {Element}
|
|
10216
10533
|
*/
|
|
10217
10534
|
this._container = formJsViewer.createFormContainer();
|
|
10218
10535
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -10223,15 +10540,15 @@ class FormEditor {
|
|
|
10223
10540
|
properties = {}
|
|
10224
10541
|
} = options;
|
|
10225
10542
|
|
|
10226
|
-
/**
|
|
10227
|
-
* @private
|
|
10228
|
-
* @type {any}
|
|
10543
|
+
/**
|
|
10544
|
+
* @private
|
|
10545
|
+
* @type {any}
|
|
10229
10546
|
*/
|
|
10230
10547
|
this.exporter = exporter;
|
|
10231
10548
|
|
|
10232
|
-
/**
|
|
10233
|
-
* @private
|
|
10234
|
-
* @type {State}
|
|
10549
|
+
/**
|
|
10550
|
+
* @private
|
|
10551
|
+
* @type {State}
|
|
10235
10552
|
*/
|
|
10236
10553
|
this._state = {
|
|
10237
10554
|
properties,
|
|
@@ -10260,10 +10577,10 @@ class FormEditor {
|
|
|
10260
10577
|
this._detach(false);
|
|
10261
10578
|
}
|
|
10262
10579
|
|
|
10263
|
-
/**
|
|
10264
|
-
* @param {Schema} schema
|
|
10265
|
-
*
|
|
10266
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
10580
|
+
/**
|
|
10581
|
+
* @param {Schema} schema
|
|
10582
|
+
*
|
|
10583
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
10267
10584
|
*/
|
|
10268
10585
|
importSchema(schema) {
|
|
10269
10586
|
return new Promise((resolve, reject) => {
|
|
@@ -10292,15 +10609,15 @@ class FormEditor {
|
|
|
10292
10609
|
});
|
|
10293
10610
|
}
|
|
10294
10611
|
|
|
10295
|
-
/**
|
|
10296
|
-
* @returns {Schema}
|
|
10612
|
+
/**
|
|
10613
|
+
* @returns {Schema}
|
|
10297
10614
|
*/
|
|
10298
10615
|
saveSchema() {
|
|
10299
10616
|
return this.getSchema();
|
|
10300
10617
|
}
|
|
10301
10618
|
|
|
10302
|
-
/**
|
|
10303
|
-
* @returns {Schema}
|
|
10619
|
+
/**
|
|
10620
|
+
* @returns {Schema}
|
|
10304
10621
|
*/
|
|
10305
10622
|
getSchema() {
|
|
10306
10623
|
const {
|
|
@@ -10309,8 +10626,8 @@ class FormEditor {
|
|
|
10309
10626
|
return exportSchema(schema, this.exporter, formJsViewer.schemaVersion);
|
|
10310
10627
|
}
|
|
10311
10628
|
|
|
10312
|
-
/**
|
|
10313
|
-
* @param {Element|string} parentNode
|
|
10629
|
+
/**
|
|
10630
|
+
* @param {Element|string} parentNode
|
|
10314
10631
|
*/
|
|
10315
10632
|
attachTo(parentNode) {
|
|
10316
10633
|
if (!parentNode) {
|
|
@@ -10328,10 +10645,10 @@ class FormEditor {
|
|
|
10328
10645
|
this._detach();
|
|
10329
10646
|
}
|
|
10330
10647
|
|
|
10331
|
-
/**
|
|
10332
|
-
* @internal
|
|
10333
|
-
*
|
|
10334
|
-
* @param {boolean} [emit]
|
|
10648
|
+
/**
|
|
10649
|
+
* @internal
|
|
10650
|
+
*
|
|
10651
|
+
* @param {boolean} [emit]
|
|
10335
10652
|
*/
|
|
10336
10653
|
_detach(emit = true) {
|
|
10337
10654
|
const container = this._container,
|
|
@@ -10345,9 +10662,9 @@ class FormEditor {
|
|
|
10345
10662
|
parentNode.removeChild(container);
|
|
10346
10663
|
}
|
|
10347
10664
|
|
|
10348
|
-
/**
|
|
10349
|
-
* @param {any} property
|
|
10350
|
-
* @param {any} value
|
|
10665
|
+
/**
|
|
10666
|
+
* @param {any} property
|
|
10667
|
+
* @param {any} value
|
|
10351
10668
|
*/
|
|
10352
10669
|
setProperty(property, value) {
|
|
10353
10670
|
const properties = minDash.set(this._getState().properties, [property], value);
|
|
@@ -10356,21 +10673,21 @@ class FormEditor {
|
|
|
10356
10673
|
});
|
|
10357
10674
|
}
|
|
10358
10675
|
|
|
10359
|
-
/**
|
|
10360
|
-
* @param {string} type
|
|
10361
|
-
* @param {Function} handler
|
|
10676
|
+
/**
|
|
10677
|
+
* @param {string} type
|
|
10678
|
+
* @param {Function} handler
|
|
10362
10679
|
*/
|
|
10363
10680
|
off(type, handler) {
|
|
10364
10681
|
this.get('eventBus').off(type, handler);
|
|
10365
10682
|
}
|
|
10366
10683
|
|
|
10367
|
-
/**
|
|
10368
|
-
* @internal
|
|
10369
|
-
*
|
|
10370
|
-
* @param {FormEditorOptions} options
|
|
10371
|
-
* @param {Element} container
|
|
10372
|
-
*
|
|
10373
|
-
* @returns {Injector}
|
|
10684
|
+
/**
|
|
10685
|
+
* @internal
|
|
10686
|
+
*
|
|
10687
|
+
* @param {FormEditorOptions} options
|
|
10688
|
+
* @param {Element} container
|
|
10689
|
+
*
|
|
10690
|
+
* @returns {Injector}
|
|
10374
10691
|
*/
|
|
10375
10692
|
_createInjector(options, container) {
|
|
10376
10693
|
const {
|
|
@@ -10392,22 +10709,22 @@ class FormEditor {
|
|
|
10392
10709
|
}, core, ...modules, ...additionalModules]);
|
|
10393
10710
|
}
|
|
10394
10711
|
|
|
10395
|
-
/**
|
|
10396
|
-
* @internal
|
|
10712
|
+
/**
|
|
10713
|
+
* @internal
|
|
10397
10714
|
*/
|
|
10398
10715
|
_emit(type, data) {
|
|
10399
10716
|
this.get('eventBus').fire(type, data);
|
|
10400
10717
|
}
|
|
10401
10718
|
|
|
10402
|
-
/**
|
|
10403
|
-
* @internal
|
|
10719
|
+
/**
|
|
10720
|
+
* @internal
|
|
10404
10721
|
*/
|
|
10405
10722
|
_getState() {
|
|
10406
10723
|
return this._state;
|
|
10407
10724
|
}
|
|
10408
10725
|
|
|
10409
|
-
/**
|
|
10410
|
-
* @internal
|
|
10726
|
+
/**
|
|
10727
|
+
* @internal
|
|
10411
10728
|
*/
|
|
10412
10729
|
_setState(state) {
|
|
10413
10730
|
this._state = {
|
|
@@ -10417,15 +10734,15 @@ class FormEditor {
|
|
|
10417
10734
|
this._emit('changed', this._getState());
|
|
10418
10735
|
}
|
|
10419
10736
|
|
|
10420
|
-
/**
|
|
10421
|
-
* @internal
|
|
10737
|
+
/**
|
|
10738
|
+
* @internal
|
|
10422
10739
|
*/
|
|
10423
10740
|
_getModules() {
|
|
10424
10741
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, formJsViewer.MarkdownModule, PropertiesPanelModule, RenderInjectionModule];
|
|
10425
10742
|
}
|
|
10426
10743
|
|
|
10427
|
-
/**
|
|
10428
|
-
* @internal
|
|
10744
|
+
/**
|
|
10745
|
+
* @internal
|
|
10429
10746
|
*/
|
|
10430
10747
|
_onEvent(type, priority, handler) {
|
|
10431
10748
|
this.get('eventBus').on(type, priority, handler);
|