@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.es.js
CHANGED
|
@@ -8,7 +8,7 @@ import { useContext, useState, useMemo, useEffect, useCallback, useRef as useRef
|
|
|
8
8
|
import { createContext, Fragment, render, createElement } from 'preact';
|
|
9
9
|
import * as React from 'preact/compat';
|
|
10
10
|
import { createPortal, useRef, useContext as useContext$1, useEffect as useEffect$1, forwardRef } from 'preact/compat';
|
|
11
|
-
import dragula from '
|
|
11
|
+
import dragula from '@bpmn-io/draggle';
|
|
12
12
|
import { classes, query, closest, event, matches, domify } from 'min-dom';
|
|
13
13
|
import { mutate } from 'array-move';
|
|
14
14
|
import { FeelersEditor } from 'feelers';
|
|
@@ -515,10 +515,10 @@ function invokeFunction(fn, args) {
|
|
|
515
515
|
return fn.apply(null, args);
|
|
516
516
|
}
|
|
517
517
|
|
|
518
|
-
/**
|
|
519
|
-
* A factory to create a configurable debouncer.
|
|
520
|
-
*
|
|
521
|
-
* @param {number|boolean} [config=true]
|
|
518
|
+
/**
|
|
519
|
+
* A factory to create a configurable debouncer.
|
|
520
|
+
*
|
|
521
|
+
* @param {number|boolean} [config=true]
|
|
522
522
|
*/
|
|
523
523
|
function DebounceFactory(config = true) {
|
|
524
524
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -531,11 +531,11 @@ function DebounceFactory(config = true) {
|
|
|
531
531
|
DebounceFactory.$inject = ['config.debounce'];
|
|
532
532
|
|
|
533
533
|
class FieldFactory {
|
|
534
|
-
/**
|
|
535
|
-
* @constructor
|
|
536
|
-
*
|
|
537
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
538
|
-
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
534
|
+
/**
|
|
535
|
+
* @constructor
|
|
536
|
+
*
|
|
537
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
538
|
+
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
539
539
|
*/
|
|
540
540
|
constructor(formFieldRegistry, formFields) {
|
|
541
541
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -598,11 +598,11 @@ class FieldFactory {
|
|
|
598
598
|
FieldFactory.$inject = ['formFieldRegistry', 'formFields'];
|
|
599
599
|
|
|
600
600
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
601
|
-
/**
|
|
602
|
-
* Updates a form fields id.
|
|
603
|
-
*
|
|
604
|
-
* @param {Object} formField
|
|
605
|
-
* @param {string} newId
|
|
601
|
+
/**
|
|
602
|
+
* Updates a form fields id.
|
|
603
|
+
*
|
|
604
|
+
* @param {Object} formField
|
|
605
|
+
* @param {string} newId
|
|
606
606
|
*/
|
|
607
607
|
updateId(formField, newId) {
|
|
608
608
|
this._validateId(newId);
|
|
@@ -623,13 +623,13 @@ class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
625
|
|
|
626
|
-
/**
|
|
627
|
-
* Validate the suitability of the given id and signals a problem
|
|
628
|
-
* with an exception.
|
|
629
|
-
*
|
|
630
|
-
* @param {string} id
|
|
631
|
-
*
|
|
632
|
-
* @throws {Error} if id is empty or already assigned
|
|
626
|
+
/**
|
|
627
|
+
* Validate the suitability of the given id and signals a problem
|
|
628
|
+
* with an exception.
|
|
629
|
+
*
|
|
630
|
+
* @param {string} id
|
|
631
|
+
*
|
|
632
|
+
* @throws {Error} if id is empty or already assigned
|
|
633
633
|
*/
|
|
634
634
|
_validateId(id) {
|
|
635
635
|
if (!id) {
|
|
@@ -646,11 +646,11 @@ const MAX_COLUMNS = 16;
|
|
|
646
646
|
const MIN_COLUMNS = 2;
|
|
647
647
|
const MAX_FIELDS_PER_ROW = 4;
|
|
648
648
|
class FormLayoutValidator {
|
|
649
|
-
/**
|
|
650
|
-
* @constructor
|
|
651
|
-
*
|
|
652
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
653
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
649
|
+
/**
|
|
650
|
+
* @constructor
|
|
651
|
+
*
|
|
652
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
653
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
654
654
|
*/
|
|
655
655
|
constructor(formLayouter, formFieldRegistry) {
|
|
656
656
|
this._formLayouter = formLayouter;
|
|
@@ -710,11 +710,11 @@ function calculateMaxColumnsWithAuto(autoCols) {
|
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
class Importer {
|
|
713
|
-
/**
|
|
714
|
-
* @constructor
|
|
715
|
-
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
716
|
-
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
717
|
-
* @param { import('../core/FormLayouter').default } formLayouter
|
|
713
|
+
/**
|
|
714
|
+
* @constructor
|
|
715
|
+
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
716
|
+
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
717
|
+
* @param { import('../core/FormLayouter').default } formLayouter
|
|
718
718
|
*/
|
|
719
719
|
constructor(formFieldRegistry, fieldFactory, formLayouter) {
|
|
720
720
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -722,21 +722,21 @@ class Importer {
|
|
|
722
722
|
this._formLayouter = formLayouter;
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
-
/**
|
|
726
|
-
* Import schema creating rows, fields, attaching additional
|
|
727
|
-
* information to each field and adding fields to the
|
|
728
|
-
* field registry.
|
|
729
|
-
*
|
|
730
|
-
* Additional information attached:
|
|
731
|
-
*
|
|
732
|
-
* * `id` (unless present)
|
|
733
|
-
* * `_parent`
|
|
734
|
-
* * `_path`
|
|
735
|
-
*
|
|
736
|
-
* @param {any} schema
|
|
737
|
-
*
|
|
738
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
739
|
-
* @returns {ImportResult}
|
|
725
|
+
/**
|
|
726
|
+
* Import schema creating rows, fields, attaching additional
|
|
727
|
+
* information to each field and adding fields to the
|
|
728
|
+
* field registry.
|
|
729
|
+
*
|
|
730
|
+
* Additional information attached:
|
|
731
|
+
*
|
|
732
|
+
* * `id` (unless present)
|
|
733
|
+
* * `_parent`
|
|
734
|
+
* * `_path`
|
|
735
|
+
*
|
|
736
|
+
* @param {any} schema
|
|
737
|
+
*
|
|
738
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
739
|
+
* @returns {ImportResult}
|
|
740
740
|
*/
|
|
741
741
|
importSchema(schema) {
|
|
742
742
|
// TODO: Add warnings
|
|
@@ -754,12 +754,12 @@ class Importer {
|
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
|
|
757
|
-
/**
|
|
758
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
759
|
-
* @param {String} [parentId]
|
|
760
|
-
* @param {number} [index]
|
|
761
|
-
*
|
|
762
|
-
* @return {any} field
|
|
757
|
+
/**
|
|
758
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
759
|
+
* @param {String} [parentId]
|
|
760
|
+
* @param {number} [index]
|
|
761
|
+
*
|
|
762
|
+
* @return {any} field
|
|
763
763
|
*/
|
|
764
764
|
importFormField(fieldAttrs, parentId, index) {
|
|
765
765
|
const {
|
|
@@ -796,11 +796,11 @@ class Importer {
|
|
|
796
796
|
return field;
|
|
797
797
|
}
|
|
798
798
|
|
|
799
|
-
/**
|
|
800
|
-
* @param {Array<any>} components
|
|
801
|
-
* @param {string} parentId
|
|
802
|
-
*
|
|
803
|
-
* @return {Array<any>} imported components
|
|
799
|
+
/**
|
|
800
|
+
* @param {Array<any>} components
|
|
801
|
+
* @param {string} parentId
|
|
802
|
+
*
|
|
803
|
+
* @return {Array<any>} imported components
|
|
804
804
|
*/
|
|
805
805
|
importFormFields(components, parentId) {
|
|
806
806
|
return components.map((component, index) => {
|
|
@@ -825,22 +825,22 @@ function editorFormFieldClasses(type, {
|
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
827
|
|
|
828
|
-
/**
|
|
829
|
-
* Add a dragger that calls back the passed function with
|
|
830
|
-
* { event, delta } on drag.
|
|
831
|
-
*
|
|
832
|
-
* @example
|
|
833
|
-
*
|
|
834
|
-
* function dragMove(event, delta) {
|
|
835
|
-
* // we are dragging (!!)
|
|
836
|
-
* }
|
|
837
|
-
*
|
|
838
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
839
|
-
*
|
|
840
|
-
* @param {Function} fn
|
|
841
|
-
* @param {Element} dragPreview
|
|
842
|
-
*
|
|
843
|
-
* @return {Function} drag start callback function
|
|
828
|
+
/**
|
|
829
|
+
* Add a dragger that calls back the passed function with
|
|
830
|
+
* { event, delta } on drag.
|
|
831
|
+
*
|
|
832
|
+
* @example
|
|
833
|
+
*
|
|
834
|
+
* function dragMove(event, delta) {
|
|
835
|
+
* // we are dragging (!!)
|
|
836
|
+
* }
|
|
837
|
+
*
|
|
838
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
839
|
+
*
|
|
840
|
+
* @param {Function} fn
|
|
841
|
+
* @param {Element} dragPreview
|
|
842
|
+
*
|
|
843
|
+
* @return {Function} drag start callback function
|
|
844
844
|
*/
|
|
845
845
|
function createDragger(fn, dragPreview) {
|
|
846
846
|
let self;
|
|
@@ -881,12 +881,12 @@ function createDragger(fn, dragPreview) {
|
|
|
881
881
|
return onDragStart;
|
|
882
882
|
}
|
|
883
883
|
|
|
884
|
-
/**
|
|
885
|
-
* Throttle function call according UI update cycle.
|
|
886
|
-
*
|
|
887
|
-
* @param {Function} fn
|
|
888
|
-
*
|
|
889
|
-
* @return {Function} throttled fn
|
|
884
|
+
/**
|
|
885
|
+
* Throttle function call according UI update cycle.
|
|
886
|
+
*
|
|
887
|
+
* @param {Function} fn
|
|
888
|
+
*
|
|
889
|
+
* @return {Function} throttled fn
|
|
890
890
|
*/
|
|
891
891
|
function throttle(fn) {
|
|
892
892
|
let active = false;
|
|
@@ -915,11 +915,11 @@ const DragAndDropContext = createContext({
|
|
|
915
915
|
});
|
|
916
916
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
917
917
|
|
|
918
|
-
/**
|
|
919
|
-
* @param {string} type
|
|
920
|
-
* @param {boolean} [strict]
|
|
921
|
-
*
|
|
922
|
-
* @returns {any}
|
|
918
|
+
/**
|
|
919
|
+
* @param {string} type
|
|
920
|
+
* @param {boolean} [strict]
|
|
921
|
+
*
|
|
922
|
+
* @returns {any}
|
|
923
923
|
*/
|
|
924
924
|
function getService$1(type, strict) {}
|
|
925
925
|
const FormEditorContext = createContext({
|
|
@@ -1269,23 +1269,23 @@ var Slot = (props => {
|
|
|
1269
1269
|
return fillsAndSeparators;
|
|
1270
1270
|
});
|
|
1271
1271
|
|
|
1272
|
-
/**
|
|
1273
|
-
* Creates a Fragment for a fill.
|
|
1274
|
-
*
|
|
1275
|
-
* @param {Object} fill Fill to be rendered
|
|
1276
|
-
* @returns {Object} Preact Fragment containing fill's children
|
|
1272
|
+
/**
|
|
1273
|
+
* Creates a Fragment for a fill.
|
|
1274
|
+
*
|
|
1275
|
+
* @param {Object} fill Fill to be rendered
|
|
1276
|
+
* @returns {Object} Preact Fragment containing fill's children
|
|
1277
1277
|
*/
|
|
1278
1278
|
const FillFragment = fill => jsx(Fragment, {
|
|
1279
1279
|
children: fill.children
|
|
1280
1280
|
}, fill.id);
|
|
1281
1281
|
|
|
1282
|
-
/**
|
|
1283
|
-
* Creates an array of fills, with separators inserted between groups.
|
|
1284
|
-
*
|
|
1285
|
-
* @param {Array} groups Groups of fills
|
|
1286
|
-
* @param {Function} fillRenderer Function to create a fill
|
|
1287
|
-
* @param {Function} separatorRenderer Function to create a separator
|
|
1288
|
-
* @returns {Array} Array of fills and separators
|
|
1282
|
+
/**
|
|
1283
|
+
* Creates an array of fills, with separators inserted between groups.
|
|
1284
|
+
*
|
|
1285
|
+
* @param {Array} groups Groups of fills
|
|
1286
|
+
* @param {Function} fillRenderer Function to create a fill
|
|
1287
|
+
* @param {Function} separatorRenderer Function to create a separator
|
|
1288
|
+
* @returns {Array} Array of fills and separators
|
|
1289
1289
|
*/
|
|
1290
1290
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
1291
1291
|
const result = [];
|
|
@@ -1303,8 +1303,8 @@ const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
|
1303
1303
|
return result;
|
|
1304
1304
|
};
|
|
1305
1305
|
|
|
1306
|
-
/**
|
|
1307
|
-
* Groups fills by group name property.
|
|
1306
|
+
/**
|
|
1307
|
+
* Groups fills by group name property.
|
|
1308
1308
|
*/
|
|
1309
1309
|
const _groupByGroupName = fills => {
|
|
1310
1310
|
const groups = [];
|
|
@@ -1324,8 +1324,8 @@ const _groupByGroupName = fills => {
|
|
|
1324
1324
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
1325
1325
|
};
|
|
1326
1326
|
|
|
1327
|
-
/**
|
|
1328
|
-
* Compares fills by priority.
|
|
1327
|
+
/**
|
|
1328
|
+
* Compares fills by priority.
|
|
1329
1329
|
*/
|
|
1330
1330
|
const _comparePriority = (a, b) => {
|
|
1331
1331
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -1553,19 +1553,19 @@ const DRAG_NO_DROP_CLS = 'fjs-no-drop';
|
|
|
1553
1553
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
1554
1554
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
1555
1555
|
|
|
1556
|
-
/**
|
|
1557
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1556
|
+
/**
|
|
1557
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
1558
1558
|
*/
|
|
1559
1559
|
|
|
1560
1560
|
class Dragging {
|
|
1561
|
-
/**
|
|
1562
|
-
* @constructor
|
|
1563
|
-
*
|
|
1564
|
-
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1565
|
-
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1566
|
-
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1567
|
-
* @param { import('../../core/EventBus').default } eventBus
|
|
1568
|
-
* @param { import('../modeling/Modeling').default } modeling
|
|
1561
|
+
/**
|
|
1562
|
+
* @constructor
|
|
1563
|
+
*
|
|
1564
|
+
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
1565
|
+
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
1566
|
+
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
1567
|
+
* @param { import('../../core/EventBus').default } eventBus
|
|
1568
|
+
* @param { import('../modeling/Modeling').default } modeling
|
|
1569
1569
|
*/
|
|
1570
1570
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling) {
|
|
1571
1571
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -1575,13 +1575,13 @@ class Dragging {
|
|
|
1575
1575
|
this._modeling = modeling;
|
|
1576
1576
|
}
|
|
1577
1577
|
|
|
1578
|
-
/**
|
|
1579
|
-
* Calculcates position in form schema given the dropped place.
|
|
1580
|
-
*
|
|
1581
|
-
* @param { FormRow } targetRow
|
|
1582
|
-
* @param { any } targetFormField
|
|
1583
|
-
* @param { HTMLElement } sibling
|
|
1584
|
-
* @returns { number }
|
|
1578
|
+
/**
|
|
1579
|
+
* Calculcates position in form schema given the dropped place.
|
|
1580
|
+
*
|
|
1581
|
+
* @param { FormRow } targetRow
|
|
1582
|
+
* @param { any } targetFormField
|
|
1583
|
+
* @param { HTMLElement } sibling
|
|
1584
|
+
* @returns { number }
|
|
1585
1585
|
*/
|
|
1586
1586
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
1587
1587
|
/** @type HTMLElement */
|
|
@@ -1683,17 +1683,21 @@ class Dragging {
|
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
1685
|
|
|
1686
|
-
/**
|
|
1687
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1686
|
+
/**
|
|
1687
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
1688
1688
|
*/
|
|
1689
1689
|
createDragulaInstance(options) {
|
|
1690
1690
|
const {
|
|
1691
1691
|
container,
|
|
1692
|
-
direction,
|
|
1693
1692
|
mirrorContainer
|
|
1694
1693
|
} = options || {};
|
|
1695
|
-
|
|
1696
|
-
direction,
|
|
1694
|
+
let dragulaOptions = {
|
|
1695
|
+
direction: function (el, target) {
|
|
1696
|
+
if (isRow(target)) {
|
|
1697
|
+
return 'horizontal';
|
|
1698
|
+
}
|
|
1699
|
+
return 'vertical';
|
|
1700
|
+
},
|
|
1697
1701
|
mirrorContainer,
|
|
1698
1702
|
isContainer(el) {
|
|
1699
1703
|
return container.some(cls => el.classList.contains(cls));
|
|
@@ -1724,7 +1728,8 @@ class Dragging {
|
|
|
1724
1728
|
},
|
|
1725
1729
|
slideFactorX: 10,
|
|
1726
1730
|
slideFactorY: 5
|
|
1727
|
-
}
|
|
1731
|
+
};
|
|
1732
|
+
const dragulaInstance = dragula(dragulaOptions);
|
|
1728
1733
|
|
|
1729
1734
|
// bind life cycle events
|
|
1730
1735
|
dragulaInstance.on('drag', (element, source) => {
|
|
@@ -2093,7 +2098,7 @@ function DebugColumns(props) {
|
|
|
2093
2098
|
return null;
|
|
2094
2099
|
}
|
|
2095
2100
|
return jsx("div", {
|
|
2096
|
-
style: "width: fit-content
|
|
2101
|
+
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;",
|
|
2097
2102
|
class: "fjs-debug-columns",
|
|
2098
2103
|
children: (field.layout || {}).columns || 'auto'
|
|
2099
2104
|
});
|
|
@@ -2190,7 +2195,6 @@ function FormEditor$1(props) {
|
|
|
2190
2195
|
useEffect(() => {
|
|
2191
2196
|
let dragulaInstance = dragging.createDragulaInstance({
|
|
2192
2197
|
container: [DRAG_CONTAINER_CLS, DROP_CONTAINER_VERTICAL_CLS, DROP_CONTAINER_HORIZONTAL_CLS],
|
|
2193
|
-
direction: 'vertical',
|
|
2194
2198
|
mirrorContainer: formContainerRef.current
|
|
2195
2199
|
});
|
|
2196
2200
|
setDrake(dragulaInstance);
|
|
@@ -2204,7 +2208,6 @@ function FormEditor$1(props) {
|
|
|
2204
2208
|
onDetach();
|
|
2205
2209
|
dragulaInstance = dragging.createDragulaInstance({
|
|
2206
2210
|
container: [DRAG_CONTAINER_CLS, DROP_CONTAINER_VERTICAL_CLS, DROP_CONTAINER_HORIZONTAL_CLS],
|
|
2207
|
-
direction: 'vertical',
|
|
2208
2211
|
mirrorContainer: formContainerRef.current
|
|
2209
2212
|
});
|
|
2210
2213
|
setDrake(dragulaInstance);
|
|
@@ -3152,10 +3155,10 @@ function updateRow(formField, rowId) {
|
|
|
3152
3155
|
}
|
|
3153
3156
|
|
|
3154
3157
|
class AddFormFieldHandler {
|
|
3155
|
-
/**
|
|
3156
|
-
* @constructor
|
|
3157
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3158
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3158
|
+
/**
|
|
3159
|
+
* @constructor
|
|
3160
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3161
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3159
3162
|
*/
|
|
3160
3163
|
constructor(formEditor, formFieldRegistry) {
|
|
3161
3164
|
this._formEditor = formEditor;
|
|
@@ -3216,10 +3219,10 @@ class AddFormFieldHandler {
|
|
|
3216
3219
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3217
3220
|
|
|
3218
3221
|
class EditFormFieldHandler {
|
|
3219
|
-
/**
|
|
3220
|
-
* @constructor
|
|
3221
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3222
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3222
|
+
/**
|
|
3223
|
+
* @constructor
|
|
3224
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3225
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3223
3226
|
*/
|
|
3224
3227
|
constructor(formEditor, formFieldRegistry) {
|
|
3225
3228
|
this._formEditor = formEditor;
|
|
@@ -3282,10 +3285,10 @@ class EditFormFieldHandler {
|
|
|
3282
3285
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3283
3286
|
|
|
3284
3287
|
class MoveFormFieldHandler {
|
|
3285
|
-
/**
|
|
3286
|
-
* @constructor
|
|
3287
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3288
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3288
|
+
/**
|
|
3289
|
+
* @constructor
|
|
3290
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3291
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3289
3292
|
*/
|
|
3290
3293
|
constructor(formEditor, formFieldRegistry) {
|
|
3291
3294
|
this._formEditor = formEditor;
|
|
@@ -3374,10 +3377,10 @@ class MoveFormFieldHandler {
|
|
|
3374
3377
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3375
3378
|
|
|
3376
3379
|
class RemoveFormFieldHandler {
|
|
3377
|
-
/**
|
|
3378
|
-
* @constructor
|
|
3379
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
3380
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3380
|
+
/**
|
|
3381
|
+
* @constructor
|
|
3382
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
3383
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3381
3384
|
*/
|
|
3382
3385
|
constructor(formEditor, formFieldRegistry) {
|
|
3383
3386
|
this._formEditor = formEditor;
|
|
@@ -3437,9 +3440,9 @@ class RemoveFormFieldHandler {
|
|
|
3437
3440
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
3438
3441
|
|
|
3439
3442
|
class UpdateIdClaimHandler {
|
|
3440
|
-
/**
|
|
3441
|
-
* @constructor
|
|
3442
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3443
|
+
/**
|
|
3444
|
+
* @constructor
|
|
3445
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3443
3446
|
*/
|
|
3444
3447
|
constructor(formFieldRegistry) {
|
|
3445
3448
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -3472,9 +3475,9 @@ class UpdateIdClaimHandler {
|
|
|
3472
3475
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
3473
3476
|
|
|
3474
3477
|
class UpdateKeyClaimHandler {
|
|
3475
|
-
/**
|
|
3476
|
-
* @constructor
|
|
3477
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3478
|
+
/**
|
|
3479
|
+
* @constructor
|
|
3480
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
3478
3481
|
*/
|
|
3479
3482
|
constructor(formFieldRegistry) {
|
|
3480
3483
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -3940,8 +3943,8 @@ class ValidateBehavior extends CommandInterceptor {
|
|
|
3940
3943
|
constructor(eventBus) {
|
|
3941
3944
|
super(eventBus);
|
|
3942
3945
|
|
|
3943
|
-
/**
|
|
3944
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
3946
|
+
/**
|
|
3947
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
3945
3948
|
*/
|
|
3946
3949
|
// @ts-ignore-next-line
|
|
3947
3950
|
this.preExecute('formField.edit', function (context) {
|
|
@@ -4521,22 +4524,22 @@ var SelectionModule = {
|
|
|
4521
4524
|
selectionBehavior: ['type', SelectionBehavior]
|
|
4522
4525
|
};
|
|
4523
4526
|
|
|
4524
|
-
/**
|
|
4525
|
-
* Base class for sectionable UI modules.
|
|
4526
|
-
*
|
|
4527
|
-
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
4528
|
-
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
4529
|
-
*
|
|
4530
|
-
* @class SectionModuleBase
|
|
4527
|
+
/**
|
|
4528
|
+
* Base class for sectionable UI modules.
|
|
4529
|
+
*
|
|
4530
|
+
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
4531
|
+
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
4532
|
+
*
|
|
4533
|
+
* @class SectionModuleBase
|
|
4531
4534
|
*/
|
|
4532
4535
|
class SectionModuleBase {
|
|
4533
|
-
/**
|
|
4534
|
-
* Create a SectionModuleBase instance.
|
|
4535
|
-
*
|
|
4536
|
-
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
4537
|
-
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
4538
|
-
*
|
|
4539
|
-
* @constructor
|
|
4536
|
+
/**
|
|
4537
|
+
* Create a SectionModuleBase instance.
|
|
4538
|
+
*
|
|
4539
|
+
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
4540
|
+
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
4541
|
+
*
|
|
4542
|
+
* @constructor
|
|
4540
4543
|
*/
|
|
4541
4544
|
constructor(eventBus, sectionKey) {
|
|
4542
4545
|
this._eventBus = eventBus;
|
|
@@ -4549,10 +4552,10 @@ class SectionModuleBase {
|
|
|
4549
4552
|
});
|
|
4550
4553
|
}
|
|
4551
4554
|
|
|
4552
|
-
/**
|
|
4553
|
-
* Attach the managed section to a parent node.
|
|
4554
|
-
*
|
|
4555
|
-
* @param {HTMLElement} container - The parent node to attach to.
|
|
4555
|
+
/**
|
|
4556
|
+
* Attach the managed section to a parent node.
|
|
4557
|
+
*
|
|
4558
|
+
* @param {HTMLElement} container - The parent node to attach to.
|
|
4556
4559
|
*/
|
|
4557
4560
|
attachTo(container) {
|
|
4558
4561
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -4560,22 +4563,22 @@ class SectionModuleBase {
|
|
|
4560
4563
|
}));
|
|
4561
4564
|
}
|
|
4562
4565
|
|
|
4563
|
-
/**
|
|
4564
|
-
* Detach the managed section from its parent node.
|
|
4566
|
+
/**
|
|
4567
|
+
* Detach the managed section from its parent node.
|
|
4565
4568
|
*/
|
|
4566
4569
|
detach() {
|
|
4567
4570
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
4568
4571
|
}
|
|
4569
4572
|
|
|
4570
|
-
/**
|
|
4571
|
-
* Reset the managed section to its initial state.
|
|
4573
|
+
/**
|
|
4574
|
+
* Reset the managed section to its initial state.
|
|
4572
4575
|
*/
|
|
4573
4576
|
reset() {
|
|
4574
4577
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
4575
4578
|
}
|
|
4576
4579
|
|
|
4577
|
-
/**
|
|
4578
|
-
* Circumvents timing issues.
|
|
4580
|
+
/**
|
|
4581
|
+
* Circumvents timing issues.
|
|
4579
4582
|
*/
|
|
4580
4583
|
_onceSectionRendered(callback) {
|
|
4581
4584
|
if (this.isSectionRendered) {
|
|
@@ -4750,6 +4753,166 @@ const LayoutContext = createContext({
|
|
|
4750
4753
|
getLayoutForKey: () => {},
|
|
4751
4754
|
setLayoutForKey: () => {}
|
|
4752
4755
|
});
|
|
4756
|
+
const TooltipContext = createContext({
|
|
4757
|
+
tooltip: {},
|
|
4758
|
+
getTooltipForId: () => {}
|
|
4759
|
+
});
|
|
4760
|
+
|
|
4761
|
+
/**
|
|
4762
|
+
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
4763
|
+
*
|
|
4764
|
+
* @example
|
|
4765
|
+
* ```jsx
|
|
4766
|
+
* function TextField(props) {
|
|
4767
|
+
* const tooltip = useTooltipContext('input1', element);
|
|
4768
|
+
* }
|
|
4769
|
+
* ```
|
|
4770
|
+
*
|
|
4771
|
+
* @param {string} id
|
|
4772
|
+
* @param {object} element
|
|
4773
|
+
*
|
|
4774
|
+
* @returns {string}
|
|
4775
|
+
*/
|
|
4776
|
+
function useTooltipContext(id, element) {
|
|
4777
|
+
const {
|
|
4778
|
+
getTooltipForId
|
|
4779
|
+
} = useContext(TooltipContext);
|
|
4780
|
+
return getTooltipForId(id, element);
|
|
4781
|
+
}
|
|
4782
|
+
function TooltipWrapper(props) {
|
|
4783
|
+
const {
|
|
4784
|
+
forId,
|
|
4785
|
+
element
|
|
4786
|
+
} = props;
|
|
4787
|
+
const contextDescription = useTooltipContext(forId, element);
|
|
4788
|
+
const value = props.value || contextDescription;
|
|
4789
|
+
if (!value) {
|
|
4790
|
+
return props.children;
|
|
4791
|
+
}
|
|
4792
|
+
return jsx(Tooltip, {
|
|
4793
|
+
...props,
|
|
4794
|
+
value: value,
|
|
4795
|
+
forId: prefixId$8(forId)
|
|
4796
|
+
});
|
|
4797
|
+
}
|
|
4798
|
+
function Tooltip(props) {
|
|
4799
|
+
const {
|
|
4800
|
+
forId,
|
|
4801
|
+
value,
|
|
4802
|
+
parent
|
|
4803
|
+
} = props;
|
|
4804
|
+
const [visible, setShow] = useState(false);
|
|
4805
|
+
let timeout = null;
|
|
4806
|
+
const wrapperRef = useRef$1(null);
|
|
4807
|
+
const tooltipRef = useRef$1(null);
|
|
4808
|
+
const showTooltip = async event => {
|
|
4809
|
+
const show = () => !visible && setShow(true);
|
|
4810
|
+
if (event instanceof MouseEvent) {
|
|
4811
|
+
timeout = setTimeout(show, 200);
|
|
4812
|
+
} else {
|
|
4813
|
+
show();
|
|
4814
|
+
}
|
|
4815
|
+
};
|
|
4816
|
+
const hideTooltip = () => setShow(false);
|
|
4817
|
+
const hideTooltipViaEscape = e => {
|
|
4818
|
+
e.code === 'Escape' && hideTooltip();
|
|
4819
|
+
};
|
|
4820
|
+
const isTooltipHovered = ({
|
|
4821
|
+
x,
|
|
4822
|
+
y
|
|
4823
|
+
}) => {
|
|
4824
|
+
const tooltip = tooltipRef.current;
|
|
4825
|
+
const wrapper = wrapperRef.current;
|
|
4826
|
+
return tooltip && (inBounds(x, y, wrapper.getBoundingClientRect()) || inBounds(x, y, tooltip.getBoundingClientRect()));
|
|
4827
|
+
};
|
|
4828
|
+
useEffect(() => {
|
|
4829
|
+
const {
|
|
4830
|
+
current
|
|
4831
|
+
} = wrapperRef;
|
|
4832
|
+
if (!current) {
|
|
4833
|
+
return;
|
|
4834
|
+
}
|
|
4835
|
+
const hideHoveredTooltip = e => {
|
|
4836
|
+
const isFocused = document.activeElement === wrapperRef.current || document.activeElement.closest('.bio-properties-panel-tooltip');
|
|
4837
|
+
if (visible && !isTooltipHovered({
|
|
4838
|
+
x: e.x,
|
|
4839
|
+
y: e.y
|
|
4840
|
+
}) && !isFocused) {
|
|
4841
|
+
hideTooltip();
|
|
4842
|
+
}
|
|
4843
|
+
};
|
|
4844
|
+
const hideFocusedTooltip = e => {
|
|
4845
|
+
const {
|
|
4846
|
+
relatedTarget
|
|
4847
|
+
} = e;
|
|
4848
|
+
const isTooltipChild = el => el && !!el.closest('.bio-properties-panel-tooltip');
|
|
4849
|
+
if (visible && !isHovered(wrapperRef.current) && !isTooltipChild(relatedTarget)) {
|
|
4850
|
+
hideTooltip();
|
|
4851
|
+
}
|
|
4852
|
+
};
|
|
4853
|
+
document.addEventListener('wheel', hideHoveredTooltip);
|
|
4854
|
+
document.addEventListener('focusout', hideFocusedTooltip);
|
|
4855
|
+
document.addEventListener('mousemove', hideHoveredTooltip);
|
|
4856
|
+
return () => {
|
|
4857
|
+
document.removeEventListener('wheel', hideHoveredTooltip);
|
|
4858
|
+
document.removeEventListener('mousemove', hideHoveredTooltip);
|
|
4859
|
+
document.removeEventListener('focusout', hideFocusedTooltip);
|
|
4860
|
+
};
|
|
4861
|
+
}, [wrapperRef.current, visible]);
|
|
4862
|
+
const renderTooltip = () => {
|
|
4863
|
+
return jsxs("div", {
|
|
4864
|
+
class: "bio-properties-panel-tooltip",
|
|
4865
|
+
role: "tooltip",
|
|
4866
|
+
id: "bio-properties-panel-tooltip",
|
|
4867
|
+
"aria-labelledby": forId,
|
|
4868
|
+
style: getTooltipPosition(wrapperRef.current),
|
|
4869
|
+
ref: tooltipRef,
|
|
4870
|
+
onClick: e => e.stopPropagation(),
|
|
4871
|
+
children: [jsx("div", {
|
|
4872
|
+
class: "bio-properties-panel-tooltip-content",
|
|
4873
|
+
children: value
|
|
4874
|
+
}), jsx("div", {
|
|
4875
|
+
class: "bio-properties-panel-tooltip-arrow"
|
|
4876
|
+
})]
|
|
4877
|
+
});
|
|
4878
|
+
};
|
|
4879
|
+
return jsxs("div", {
|
|
4880
|
+
class: "bio-properties-panel-tooltip-wrapper",
|
|
4881
|
+
tabIndex: "0",
|
|
4882
|
+
ref: wrapperRef,
|
|
4883
|
+
onMouseEnter: showTooltip,
|
|
4884
|
+
onMouseLeave: () => clearTimeout(timeout),
|
|
4885
|
+
onFocus: showTooltip,
|
|
4886
|
+
onKeyDown: hideTooltipViaEscape,
|
|
4887
|
+
onMouseDown: e => {
|
|
4888
|
+
e.preventDefault();
|
|
4889
|
+
},
|
|
4890
|
+
children: [props.children, visible ? parent ? createPortal(renderTooltip(), parent.current) : renderTooltip() : null]
|
|
4891
|
+
});
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4894
|
+
// helper
|
|
4895
|
+
function inBounds(x, y, bounds) {
|
|
4896
|
+
const {
|
|
4897
|
+
top,
|
|
4898
|
+
right,
|
|
4899
|
+
bottom,
|
|
4900
|
+
left
|
|
4901
|
+
} = bounds;
|
|
4902
|
+
return x >= left && x <= right && y >= top && y <= bottom;
|
|
4903
|
+
}
|
|
4904
|
+
function getTooltipPosition(refElement) {
|
|
4905
|
+
const refPosition = refElement.getBoundingClientRect();
|
|
4906
|
+
const right = `calc(100% - ${refPosition.x}px)`;
|
|
4907
|
+
const top = `${refPosition.top - 10}px`;
|
|
4908
|
+
return `right: ${right}; top: ${top};`;
|
|
4909
|
+
}
|
|
4910
|
+
function isHovered(element) {
|
|
4911
|
+
return element.matches(':hover');
|
|
4912
|
+
}
|
|
4913
|
+
function prefixId$8(id) {
|
|
4914
|
+
return `bio-properties-panel-${id}`;
|
|
4915
|
+
}
|
|
4753
4916
|
|
|
4754
4917
|
/**
|
|
4755
4918
|
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
@@ -4778,6 +4941,12 @@ function useError(id) {
|
|
|
4778
4941
|
} = useContext(ErrorsContext);
|
|
4779
4942
|
return errors[id];
|
|
4780
4943
|
}
|
|
4944
|
+
function useErrors() {
|
|
4945
|
+
const {
|
|
4946
|
+
errors
|
|
4947
|
+
} = useContext(ErrorsContext);
|
|
4948
|
+
return errors;
|
|
4949
|
+
}
|
|
4781
4950
|
|
|
4782
4951
|
/**
|
|
4783
4952
|
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
@@ -5009,6 +5178,10 @@ function Group(props) {
|
|
|
5009
5178
|
setEdited(hasOneEditedEntry);
|
|
5010
5179
|
}, [entries]);
|
|
5011
5180
|
|
|
5181
|
+
// set error state depending on all entries
|
|
5182
|
+
const allErrors = useErrors();
|
|
5183
|
+
const hasErrors = entries.some(entry => allErrors[entry.id]);
|
|
5184
|
+
|
|
5012
5185
|
// set css class when group is sticky to top
|
|
5013
5186
|
useStickyIntersectionObserver(groupRef, 'div.bio-properties-panel-scroll-container', setSticky);
|
|
5014
5187
|
const propertiesPanelContext = {
|
|
@@ -5025,10 +5198,19 @@ function Group(props) {
|
|
|
5025
5198
|
children: [jsx("div", {
|
|
5026
5199
|
title: label,
|
|
5027
5200
|
class: "bio-properties-panel-group-header-title",
|
|
5028
|
-
children:
|
|
5201
|
+
children: jsx(TooltipWrapper, {
|
|
5202
|
+
value: props.tooltip,
|
|
5203
|
+
forId: 'group-' + id,
|
|
5204
|
+
element: element,
|
|
5205
|
+
parent: groupRef,
|
|
5206
|
+
children: label
|
|
5207
|
+
})
|
|
5029
5208
|
}), jsxs("div", {
|
|
5030
5209
|
class: "bio-properties-panel-group-header-buttons",
|
|
5031
|
-
children: [
|
|
5210
|
+
children: [jsx(DataMarker, {
|
|
5211
|
+
edited: edited,
|
|
5212
|
+
hasErrors: hasErrors
|
|
5213
|
+
}), jsx("button", {
|
|
5032
5214
|
title: "Toggle section",
|
|
5033
5215
|
class: "bio-properties-panel-group-header-button bio-properties-panel-arrow",
|
|
5034
5216
|
children: jsx(ArrowIcon, {
|
|
@@ -5055,11 +5237,24 @@ function Group(props) {
|
|
|
5055
5237
|
})]
|
|
5056
5238
|
});
|
|
5057
5239
|
}
|
|
5058
|
-
function DataMarker() {
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
}
|
|
5240
|
+
function DataMarker(props) {
|
|
5241
|
+
const {
|
|
5242
|
+
edited,
|
|
5243
|
+
hasErrors
|
|
5244
|
+
} = props;
|
|
5245
|
+
if (hasErrors) {
|
|
5246
|
+
return jsx("div", {
|
|
5247
|
+
title: "Section contains an error",
|
|
5248
|
+
class: "bio-properties-panel-dot bio-properties-panel-dot--error"
|
|
5249
|
+
});
|
|
5250
|
+
}
|
|
5251
|
+
if (edited) {
|
|
5252
|
+
return jsx("div", {
|
|
5253
|
+
title: "Section contains data",
|
|
5254
|
+
class: "bio-properties-panel-dot"
|
|
5255
|
+
});
|
|
5256
|
+
}
|
|
5257
|
+
return null;
|
|
5063
5258
|
}
|
|
5064
5259
|
|
|
5065
5260
|
/**
|
|
@@ -5090,6 +5285,7 @@ function Placeholder(props) {
|
|
|
5090
5285
|
}
|
|
5091
5286
|
const DEFAULT_LAYOUT = {};
|
|
5092
5287
|
const DEFAULT_DESCRIPTION = {};
|
|
5288
|
+
const DEFAULT_TOOLTIP = {};
|
|
5093
5289
|
|
|
5094
5290
|
/**
|
|
5095
5291
|
* @typedef { {
|
|
@@ -5130,12 +5326,22 @@ const DEFAULT_DESCRIPTION = {};
|
|
|
5130
5326
|
* [id: String]: GetDescriptionFunction
|
|
5131
5327
|
* } } DescriptionConfig
|
|
5132
5328
|
*
|
|
5329
|
+
* @typedef { {
|
|
5330
|
+
* [id: String]: GetTooltipFunction
|
|
5331
|
+
* } } TooltipConfig
|
|
5332
|
+
*
|
|
5133
5333
|
* @callback { {
|
|
5134
5334
|
* @param {string} id
|
|
5135
5335
|
* @param {Object} element
|
|
5136
5336
|
* @returns {string}
|
|
5137
5337
|
* } } GetDescriptionFunction
|
|
5138
5338
|
*
|
|
5339
|
+
* @callback { {
|
|
5340
|
+
* @param {string} id
|
|
5341
|
+
* @param {Object} element
|
|
5342
|
+
* @returns {string}
|
|
5343
|
+
* } } GetTooltipFunction
|
|
5344
|
+
*
|
|
5139
5345
|
* @typedef { {
|
|
5140
5346
|
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
5141
5347
|
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
@@ -5156,6 +5362,8 @@ const DEFAULT_DESCRIPTION = {};
|
|
|
5156
5362
|
* @param {Function} [props.layoutChanged]
|
|
5157
5363
|
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
5158
5364
|
* @param {Function} [props.descriptionLoaded]
|
|
5365
|
+
* @param {TooltipConfig} [props.tooltipConfig]
|
|
5366
|
+
* @param {Function} [props.tooltipLoaded]
|
|
5159
5367
|
* @param {Object} [props.eventBus]
|
|
5160
5368
|
*/
|
|
5161
5369
|
function PropertiesPanel(props) {
|
|
@@ -5168,6 +5376,8 @@ function PropertiesPanel(props) {
|
|
|
5168
5376
|
layoutChanged,
|
|
5169
5377
|
descriptionConfig,
|
|
5170
5378
|
descriptionLoaded,
|
|
5379
|
+
tooltipConfig,
|
|
5380
|
+
tooltipLoaded,
|
|
5171
5381
|
eventBus
|
|
5172
5382
|
} = props;
|
|
5173
5383
|
|
|
@@ -5213,6 +5423,21 @@ function PropertiesPanel(props) {
|
|
|
5213
5423
|
description,
|
|
5214
5424
|
getDescriptionForId
|
|
5215
5425
|
};
|
|
5426
|
+
|
|
5427
|
+
// set-up tooltip context
|
|
5428
|
+
const tooltip = useMemo(() => createTooltipContext(tooltipConfig), [tooltipConfig]);
|
|
5429
|
+
useEffect(() => {
|
|
5430
|
+
if (typeof tooltipLoaded === 'function') {
|
|
5431
|
+
tooltipLoaded(tooltip);
|
|
5432
|
+
}
|
|
5433
|
+
}, [tooltip, tooltipLoaded]);
|
|
5434
|
+
const getTooltipForId = (id, element) => {
|
|
5435
|
+
return tooltip[id] && tooltip[id](element);
|
|
5436
|
+
};
|
|
5437
|
+
const tooltipContext = {
|
|
5438
|
+
tooltip,
|
|
5439
|
+
getTooltipForId
|
|
5440
|
+
};
|
|
5216
5441
|
const [errors, setErrors] = useState({});
|
|
5217
5442
|
const onSetErrors = ({
|
|
5218
5443
|
errors
|
|
@@ -5247,29 +5472,32 @@ function PropertiesPanel(props) {
|
|
|
5247
5472
|
value: errorsContext,
|
|
5248
5473
|
children: jsx(DescriptionContext.Provider, {
|
|
5249
5474
|
value: descriptionContext,
|
|
5250
|
-
children: jsx(
|
|
5251
|
-
value:
|
|
5252
|
-
children: jsx(
|
|
5253
|
-
value:
|
|
5254
|
-
children:
|
|
5255
|
-
|
|
5256
|
-
children:
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5475
|
+
children: jsx(TooltipContext.Provider, {
|
|
5476
|
+
value: tooltipContext,
|
|
5477
|
+
children: jsx(LayoutContext.Provider, {
|
|
5478
|
+
value: layoutContext,
|
|
5479
|
+
children: jsx(EventContext.Provider, {
|
|
5480
|
+
value: eventContext,
|
|
5481
|
+
children: jsxs("div", {
|
|
5482
|
+
class: "bio-properties-panel",
|
|
5483
|
+
children: [jsx(Header, {
|
|
5484
|
+
element: element,
|
|
5485
|
+
headerProvider: headerProvider
|
|
5486
|
+
}), jsx("div", {
|
|
5487
|
+
class: "bio-properties-panel-scroll-container",
|
|
5488
|
+
children: groups.map(group => {
|
|
5489
|
+
const {
|
|
5490
|
+
component: Component = Group,
|
|
5491
|
+
id
|
|
5492
|
+
} = group;
|
|
5493
|
+
return createElement(Component, {
|
|
5494
|
+
...group,
|
|
5495
|
+
key: id,
|
|
5496
|
+
element: element
|
|
5497
|
+
});
|
|
5498
|
+
})
|
|
5499
|
+
})]
|
|
5500
|
+
})
|
|
5273
5501
|
})
|
|
5274
5502
|
})
|
|
5275
5503
|
})
|
|
@@ -5292,6 +5520,12 @@ function createDescriptionContext(overrides = {}) {
|
|
|
5292
5520
|
...overrides
|
|
5293
5521
|
};
|
|
5294
5522
|
}
|
|
5523
|
+
function createTooltipContext(overrides = {}) {
|
|
5524
|
+
return {
|
|
5525
|
+
...DEFAULT_TOOLTIP,
|
|
5526
|
+
...overrides
|
|
5527
|
+
};
|
|
5528
|
+
}
|
|
5295
5529
|
|
|
5296
5530
|
// hooks //////////////////
|
|
5297
5531
|
|
|
@@ -5522,6 +5756,18 @@ function ListGroup(props) {
|
|
|
5522
5756
|
setAddTriggered(true);
|
|
5523
5757
|
add(e);
|
|
5524
5758
|
};
|
|
5759
|
+
const allErrors = useErrors();
|
|
5760
|
+
const hasError = items.some(item => {
|
|
5761
|
+
if (allErrors[item.id]) {
|
|
5762
|
+
return true;
|
|
5763
|
+
}
|
|
5764
|
+
if (!item.entries) {
|
|
5765
|
+
return;
|
|
5766
|
+
}
|
|
5767
|
+
|
|
5768
|
+
// also check if the error is nested, e.g. for name-value entries
|
|
5769
|
+
return item.entries.some(entry => allErrors[entry.id]);
|
|
5770
|
+
});
|
|
5525
5771
|
return jsxs("div", {
|
|
5526
5772
|
class: "bio-properties-panel-group",
|
|
5527
5773
|
"data-group-id": 'group-' + id,
|
|
@@ -5532,7 +5778,13 @@ function ListGroup(props) {
|
|
|
5532
5778
|
children: [jsx("div", {
|
|
5533
5779
|
title: label,
|
|
5534
5780
|
class: "bio-properties-panel-group-header-title",
|
|
5535
|
-
children:
|
|
5781
|
+
children: jsx(TooltipWrapper, {
|
|
5782
|
+
value: props.tooltip,
|
|
5783
|
+
forId: 'group-' + id,
|
|
5784
|
+
element: element,
|
|
5785
|
+
parent: groupRef,
|
|
5786
|
+
children: label
|
|
5787
|
+
})
|
|
5536
5788
|
}), jsxs("div", {
|
|
5537
5789
|
class: "bio-properties-panel-group-header-buttons",
|
|
5538
5790
|
children: [add ? jsxs("button", {
|
|
@@ -5545,7 +5797,7 @@ function ListGroup(props) {
|
|
|
5545
5797
|
}) : null]
|
|
5546
5798
|
}) : null, hasItems ? jsx("div", {
|
|
5547
5799
|
title: `List contains ${items.length} item${items.length != 1 ? 's' : ''}`,
|
|
5548
|
-
class:
|
|
5800
|
+
class: classnames('bio-properties-panel-list-badge', hasError ? 'bio-properties-panel-list-badge--error' : ''),
|
|
5549
5801
|
children: items.length
|
|
5550
5802
|
}) : null, hasItems ? jsx("button", {
|
|
5551
5803
|
title: "Toggle section",
|
|
@@ -5621,7 +5873,8 @@ function Checkbox(props) {
|
|
|
5621
5873
|
disabled,
|
|
5622
5874
|
value = false,
|
|
5623
5875
|
onFocus,
|
|
5624
|
-
onBlur
|
|
5876
|
+
onBlur,
|
|
5877
|
+
tooltip
|
|
5625
5878
|
} = props;
|
|
5626
5879
|
const [localValue, setLocalValue] = useState(value);
|
|
5627
5880
|
const handleChangeCallback = ({
|
|
@@ -5656,7 +5909,12 @@ function Checkbox(props) {
|
|
|
5656
5909
|
}), jsx("label", {
|
|
5657
5910
|
for: prefixId$7(id),
|
|
5658
5911
|
class: "bio-properties-panel-label",
|
|
5659
|
-
children:
|
|
5912
|
+
children: jsx(TooltipWrapper, {
|
|
5913
|
+
value: tooltip,
|
|
5914
|
+
forId: id,
|
|
5915
|
+
element: props.element,
|
|
5916
|
+
children: label
|
|
5917
|
+
})
|
|
5660
5918
|
})]
|
|
5661
5919
|
});
|
|
5662
5920
|
}
|
|
@@ -5671,6 +5929,7 @@ function Checkbox(props) {
|
|
|
5671
5929
|
* @param {Function} props.setValue
|
|
5672
5930
|
* @param {Function} props.onFocus
|
|
5673
5931
|
* @param {Function} props.onBlur
|
|
5932
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
5674
5933
|
* @param {boolean} [props.disabled]
|
|
5675
5934
|
*/
|
|
5676
5935
|
function CheckboxEntry(props) {
|
|
@@ -5683,7 +5942,8 @@ function CheckboxEntry(props) {
|
|
|
5683
5942
|
setValue,
|
|
5684
5943
|
disabled,
|
|
5685
5944
|
onFocus,
|
|
5686
|
-
onBlur
|
|
5945
|
+
onBlur,
|
|
5946
|
+
tooltip
|
|
5687
5947
|
} = props;
|
|
5688
5948
|
const value = getValue(element);
|
|
5689
5949
|
const error = useError(id);
|
|
@@ -5697,7 +5957,9 @@ function CheckboxEntry(props) {
|
|
|
5697
5957
|
onChange: setValue,
|
|
5698
5958
|
onFocus: onFocus,
|
|
5699
5959
|
onBlur: onBlur,
|
|
5700
|
-
value: value
|
|
5960
|
+
value: value,
|
|
5961
|
+
tooltip: tooltip,
|
|
5962
|
+
element: element
|
|
5701
5963
|
}, element), error && jsx("div", {
|
|
5702
5964
|
class: "bio-properties-panel-error",
|
|
5703
5965
|
children: error
|
|
@@ -5954,7 +6216,8 @@ function ToggleSwitch(props) {
|
|
|
5954
6216
|
inline,
|
|
5955
6217
|
onFocus,
|
|
5956
6218
|
onBlur,
|
|
5957
|
-
inputRef
|
|
6219
|
+
inputRef,
|
|
6220
|
+
tooltip
|
|
5958
6221
|
} = props;
|
|
5959
6222
|
const [localValue, setLocalValue] = useState(value);
|
|
5960
6223
|
const handleInputCallback = async () => {
|
|
@@ -5977,7 +6240,12 @@ function ToggleSwitch(props) {
|
|
|
5977
6240
|
children: [jsx("label", {
|
|
5978
6241
|
class: "bio-properties-panel-label",
|
|
5979
6242
|
for: prefixId$6(id),
|
|
5980
|
-
children:
|
|
6243
|
+
children: jsx(TooltipWrapper, {
|
|
6244
|
+
value: tooltip,
|
|
6245
|
+
forId: id,
|
|
6246
|
+
element: props.element,
|
|
6247
|
+
children: label
|
|
6248
|
+
})
|
|
5981
6249
|
}), jsxs("div", {
|
|
5982
6250
|
class: "bio-properties-panel-field-wrapper",
|
|
5983
6251
|
children: [jsxs("label", {
|
|
@@ -6015,6 +6283,7 @@ function ToggleSwitch(props) {
|
|
|
6015
6283
|
* @param {Function} props.setValue
|
|
6016
6284
|
* @param {Function} props.onFocus
|
|
6017
6285
|
* @param {Function} props.onBlur
|
|
6286
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
6018
6287
|
*/
|
|
6019
6288
|
function ToggleSwitchEntry(props) {
|
|
6020
6289
|
const {
|
|
@@ -6027,7 +6296,8 @@ function ToggleSwitchEntry(props) {
|
|
|
6027
6296
|
getValue,
|
|
6028
6297
|
setValue,
|
|
6029
6298
|
onFocus,
|
|
6030
|
-
onBlur
|
|
6299
|
+
onBlur,
|
|
6300
|
+
tooltip
|
|
6031
6301
|
} = props;
|
|
6032
6302
|
const value = getValue(element);
|
|
6033
6303
|
return jsxs("div", {
|
|
@@ -6041,7 +6311,9 @@ function ToggleSwitchEntry(props) {
|
|
|
6041
6311
|
onFocus: onFocus,
|
|
6042
6312
|
onBlur: onBlur,
|
|
6043
6313
|
switcherLabel: switcherLabel,
|
|
6044
|
-
inline: inline
|
|
6314
|
+
inline: inline,
|
|
6315
|
+
tooltip: tooltip,
|
|
6316
|
+
element: element
|
|
6045
6317
|
}), jsx(Description$1, {
|
|
6046
6318
|
forId: id,
|
|
6047
6319
|
element: element,
|
|
@@ -6221,7 +6493,8 @@ function FeelTextfield(props) {
|
|
|
6221
6493
|
disabled = false,
|
|
6222
6494
|
variables,
|
|
6223
6495
|
tooltipContainer,
|
|
6224
|
-
OptionalComponent = OptionalFeelInput
|
|
6496
|
+
OptionalComponent = OptionalFeelInput,
|
|
6497
|
+
tooltip
|
|
6225
6498
|
} = props;
|
|
6226
6499
|
const [localValue, _setLocalValue] = useState(value);
|
|
6227
6500
|
const editorRef = useShowEntryEvent(id);
|
|
@@ -6337,7 +6610,12 @@ function FeelTextfield(props) {
|
|
|
6337
6610
|
for: prefixId$4(id),
|
|
6338
6611
|
class: "bio-properties-panel-label",
|
|
6339
6612
|
onClick: () => setFocus(),
|
|
6340
|
-
children: [
|
|
6613
|
+
children: [jsx(TooltipWrapper, {
|
|
6614
|
+
value: tooltip,
|
|
6615
|
+
forId: id,
|
|
6616
|
+
element: props.element,
|
|
6617
|
+
children: label
|
|
6618
|
+
}), jsx(FeelIcon, {
|
|
6341
6619
|
label: label,
|
|
6342
6620
|
feel: feel,
|
|
6343
6621
|
onClick: handleFeelToggle,
|
|
@@ -6597,6 +6875,7 @@ forwardRef((props, ref) => {
|
|
|
6597
6875
|
* @param {Function} props.variables
|
|
6598
6876
|
* @param {Function} props.onFocus
|
|
6599
6877
|
* @param {Function} props.onBlur
|
|
6878
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
6600
6879
|
*/
|
|
6601
6880
|
function FeelEntry(props) {
|
|
6602
6881
|
const {
|
|
@@ -6617,7 +6896,8 @@ function FeelEntry(props) {
|
|
|
6617
6896
|
example,
|
|
6618
6897
|
variables,
|
|
6619
6898
|
onFocus,
|
|
6620
|
-
onBlur
|
|
6899
|
+
onBlur,
|
|
6900
|
+
tooltip
|
|
6621
6901
|
} = props;
|
|
6622
6902
|
const [validationError, setValidationError] = useState(null);
|
|
6623
6903
|
const [localError, setLocalError] = useState(null);
|
|
@@ -6667,7 +6947,8 @@ function FeelEntry(props) {
|
|
|
6667
6947
|
value: value,
|
|
6668
6948
|
variables: variables,
|
|
6669
6949
|
tooltipContainer: tooltipContainer,
|
|
6670
|
-
OptionalComponent: props.OptionalComponent
|
|
6950
|
+
OptionalComponent: props.OptionalComponent,
|
|
6951
|
+
tooltip: tooltip
|
|
6671
6952
|
}), error && jsx("div", {
|
|
6672
6953
|
class: "bio-properties-panel-error",
|
|
6673
6954
|
children: error
|
|
@@ -6788,7 +7069,8 @@ function Select(props) {
|
|
|
6788
7069
|
value = '',
|
|
6789
7070
|
disabled,
|
|
6790
7071
|
onFocus,
|
|
6791
|
-
onBlur
|
|
7072
|
+
onBlur,
|
|
7073
|
+
tooltip
|
|
6792
7074
|
} = props;
|
|
6793
7075
|
const ref = useShowEntryEvent(id);
|
|
6794
7076
|
const [localValue, setLocalValue] = useState(value);
|
|
@@ -6812,7 +7094,12 @@ function Select(props) {
|
|
|
6812
7094
|
children: [jsx("label", {
|
|
6813
7095
|
for: prefixId$3(id),
|
|
6814
7096
|
class: "bio-properties-panel-label",
|
|
6815
|
-
children:
|
|
7097
|
+
children: jsx(TooltipWrapper, {
|
|
7098
|
+
value: tooltip,
|
|
7099
|
+
forId: id,
|
|
7100
|
+
element: props.element,
|
|
7101
|
+
children: label
|
|
7102
|
+
})
|
|
6816
7103
|
}), jsx("select", {
|
|
6817
7104
|
ref: ref,
|
|
6818
7105
|
id: prefixId$3(id),
|
|
@@ -6857,6 +7144,7 @@ function Select(props) {
|
|
|
6857
7144
|
* @param {Function} props.getOptions
|
|
6858
7145
|
* @param {boolean} [props.disabled]
|
|
6859
7146
|
* @param {Function} [props.validate]
|
|
7147
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
6860
7148
|
*/
|
|
6861
7149
|
function SelectEntry(props) {
|
|
6862
7150
|
const {
|
|
@@ -6870,7 +7158,8 @@ function SelectEntry(props) {
|
|
|
6870
7158
|
disabled,
|
|
6871
7159
|
onFocus,
|
|
6872
7160
|
onBlur,
|
|
6873
|
-
validate
|
|
7161
|
+
validate,
|
|
7162
|
+
tooltip
|
|
6874
7163
|
} = props;
|
|
6875
7164
|
const options = getOptions(element);
|
|
6876
7165
|
const globalError = useError(id);
|
|
@@ -6902,7 +7191,9 @@ function SelectEntry(props) {
|
|
|
6902
7191
|
onFocus: onFocus,
|
|
6903
7192
|
onBlur: onBlur,
|
|
6904
7193
|
options: options,
|
|
6905
|
-
disabled: disabled
|
|
7194
|
+
disabled: disabled,
|
|
7195
|
+
tooltip: tooltip,
|
|
7196
|
+
element: element
|
|
6906
7197
|
}, element), error && jsx("div", {
|
|
6907
7198
|
class: "bio-properties-panel-error",
|
|
6908
7199
|
children: error
|
|
@@ -6941,7 +7232,8 @@ function TextArea(props) {
|
|
|
6941
7232
|
onFocus,
|
|
6942
7233
|
onBlur,
|
|
6943
7234
|
autoResize,
|
|
6944
|
-
rows = autoResize ? 1 : 2
|
|
7235
|
+
rows = autoResize ? 1 : 2,
|
|
7236
|
+
tooltip
|
|
6945
7237
|
} = props;
|
|
6946
7238
|
const [localValue, setLocalValue] = useState(value);
|
|
6947
7239
|
const ref = useShowEntryEvent(id);
|
|
@@ -6969,7 +7261,12 @@ function TextArea(props) {
|
|
|
6969
7261
|
children: [jsx("label", {
|
|
6970
7262
|
for: prefixId$1(id),
|
|
6971
7263
|
class: "bio-properties-panel-label",
|
|
6972
|
-
children:
|
|
7264
|
+
children: jsx(TooltipWrapper, {
|
|
7265
|
+
value: tooltip,
|
|
7266
|
+
forId: id,
|
|
7267
|
+
element: props.element,
|
|
7268
|
+
children: label
|
|
7269
|
+
})
|
|
6973
7270
|
}), jsx("textarea", {
|
|
6974
7271
|
ref: ref,
|
|
6975
7272
|
id: prefixId$1(id),
|
|
@@ -7018,7 +7315,8 @@ function TextAreaEntry(props) {
|
|
|
7018
7315
|
validate,
|
|
7019
7316
|
onFocus,
|
|
7020
7317
|
onBlur,
|
|
7021
|
-
autoResize
|
|
7318
|
+
autoResize,
|
|
7319
|
+
tooltip
|
|
7022
7320
|
} = props;
|
|
7023
7321
|
const globalError = useError(id);
|
|
7024
7322
|
const [localError, setLocalError] = useState(null);
|
|
@@ -7052,7 +7350,9 @@ function TextAreaEntry(props) {
|
|
|
7052
7350
|
debounce: debounce,
|
|
7053
7351
|
monospace: monospace,
|
|
7054
7352
|
disabled: disabled,
|
|
7055
|
-
autoResize: autoResize
|
|
7353
|
+
autoResize: autoResize,
|
|
7354
|
+
tooltip: tooltip,
|
|
7355
|
+
element: element
|
|
7056
7356
|
}, element), error && jsx("div", {
|
|
7057
7357
|
class: "bio-properties-panel-error",
|
|
7058
7358
|
children: error
|
|
@@ -7081,7 +7381,8 @@ function Textfield(props) {
|
|
|
7081
7381
|
onInput,
|
|
7082
7382
|
onFocus,
|
|
7083
7383
|
onBlur,
|
|
7084
|
-
value = ''
|
|
7384
|
+
value = '',
|
|
7385
|
+
tooltip
|
|
7085
7386
|
} = props;
|
|
7086
7387
|
const [localValue, setLocalValue] = useState(value || '');
|
|
7087
7388
|
const ref = useShowEntryEvent(id);
|
|
@@ -7105,7 +7406,12 @@ function Textfield(props) {
|
|
|
7105
7406
|
children: [jsx("label", {
|
|
7106
7407
|
for: prefixId(id),
|
|
7107
7408
|
class: "bio-properties-panel-label",
|
|
7108
|
-
children:
|
|
7409
|
+
children: jsx(TooltipWrapper, {
|
|
7410
|
+
value: tooltip,
|
|
7411
|
+
forId: id,
|
|
7412
|
+
element: props.element,
|
|
7413
|
+
children: label
|
|
7414
|
+
})
|
|
7109
7415
|
}), jsx("input", {
|
|
7110
7416
|
ref: ref,
|
|
7111
7417
|
id: prefixId(id),
|
|
@@ -7135,6 +7441,7 @@ function Textfield(props) {
|
|
|
7135
7441
|
* @param {Function} props.setValue
|
|
7136
7442
|
* @param {Function} props.onFocus
|
|
7137
7443
|
* @param {Function} props.onBlur
|
|
7444
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
7138
7445
|
* @param {Function} props.validate
|
|
7139
7446
|
*/
|
|
7140
7447
|
function TextfieldEntry(props) {
|
|
@@ -7149,7 +7456,8 @@ function TextfieldEntry(props) {
|
|
|
7149
7456
|
setValue,
|
|
7150
7457
|
validate,
|
|
7151
7458
|
onFocus,
|
|
7152
|
-
onBlur
|
|
7459
|
+
onBlur,
|
|
7460
|
+
tooltip
|
|
7153
7461
|
} = props;
|
|
7154
7462
|
const globalError = useError(id);
|
|
7155
7463
|
const [localError, setLocalError] = useState(null);
|
|
@@ -7180,7 +7488,9 @@ function TextfieldEntry(props) {
|
|
|
7180
7488
|
onInput: onInput,
|
|
7181
7489
|
onFocus: onFocus,
|
|
7182
7490
|
onBlur: onBlur,
|
|
7183
|
-
value: value
|
|
7491
|
+
value: value,
|
|
7492
|
+
tooltip: tooltip,
|
|
7493
|
+
element: element
|
|
7184
7494
|
}, element), error && jsx("div", {
|
|
7185
7495
|
class: "bio-properties-panel-error",
|
|
7186
7496
|
children: error
|
|
@@ -7201,11 +7511,11 @@ function prefixId(id) {
|
|
|
7201
7511
|
return `bio-properties-panel-${id}`;
|
|
7202
7512
|
}
|
|
7203
7513
|
|
|
7204
|
-
/**
|
|
7205
|
-
* @param {string} type
|
|
7206
|
-
* @param {boolean} [strict]
|
|
7207
|
-
*
|
|
7208
|
-
* @returns {any}
|
|
7514
|
+
/**
|
|
7515
|
+
* @param {string} type
|
|
7516
|
+
* @param {boolean} [strict]
|
|
7517
|
+
*
|
|
7518
|
+
* @returns {any}
|
|
7209
7519
|
*/
|
|
7210
7520
|
function getService(type, strict) {}
|
|
7211
7521
|
const PropertiesPanelContext = createContext({
|
|
@@ -7295,8 +7605,8 @@ const PropertiesPanelHeaderProvider = {
|
|
|
7295
7605
|
}
|
|
7296
7606
|
};
|
|
7297
7607
|
|
|
7298
|
-
/**
|
|
7299
|
-
* Provide placeholders for empty and multiple state.
|
|
7608
|
+
/**
|
|
7609
|
+
* Provide placeholders for empty and multiple state.
|
|
7300
7610
|
*/
|
|
7301
7611
|
const PropertiesPanelPlaceholderProvider = {
|
|
7302
7612
|
getEmpty: () => {
|
|
@@ -7368,10 +7678,10 @@ function useService (type, strict) {
|
|
|
7368
7678
|
return getService(type, strict);
|
|
7369
7679
|
}
|
|
7370
7680
|
|
|
7371
|
-
/**
|
|
7372
|
-
* Retrieve list of variables from the form schema.
|
|
7373
|
-
*
|
|
7374
|
-
* @returns { string[] } list of variables used in form schema
|
|
7681
|
+
/**
|
|
7682
|
+
* Retrieve list of variables from the form schema.
|
|
7683
|
+
*
|
|
7684
|
+
* @returns { string[] } list of variables used in form schema
|
|
7375
7685
|
*/
|
|
7376
7686
|
function useVariables() {
|
|
7377
7687
|
const form = useService('formEditor');
|
|
@@ -7423,6 +7733,7 @@ function AltText(props) {
|
|
|
7423
7733
|
getValue,
|
|
7424
7734
|
id,
|
|
7425
7735
|
label: 'Alternative text',
|
|
7736
|
+
tooltip: 'Descriptive text for screen reader accessibility.',
|
|
7426
7737
|
setValue,
|
|
7427
7738
|
singleLine: true,
|
|
7428
7739
|
variables
|
|
@@ -7826,6 +8137,7 @@ function Disabled(props) {
|
|
|
7826
8137
|
getValue,
|
|
7827
8138
|
id,
|
|
7828
8139
|
label: 'Disabled',
|
|
8140
|
+
tooltip: 'Field cannot be edited by the end-user, and the data is not submitted.',
|
|
7829
8141
|
inline: true,
|
|
7830
8142
|
setValue
|
|
7831
8143
|
});
|
|
@@ -7969,6 +8281,7 @@ function Key$1(props) {
|
|
|
7969
8281
|
getValue,
|
|
7970
8282
|
id,
|
|
7971
8283
|
label: 'Key',
|
|
8284
|
+
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.',
|
|
7972
8285
|
setValue,
|
|
7973
8286
|
validate
|
|
7974
8287
|
});
|
|
@@ -8029,7 +8342,7 @@ function Label$1(props) {
|
|
|
8029
8342
|
return get(field, path, '');
|
|
8030
8343
|
};
|
|
8031
8344
|
const setValue = value => {
|
|
8032
|
-
return editField(field, path, value);
|
|
8345
|
+
return editField(field, path, value || '');
|
|
8033
8346
|
};
|
|
8034
8347
|
return FeelTemplatingEntry({
|
|
8035
8348
|
debounce,
|
|
@@ -8057,7 +8370,7 @@ function DateLabel(props) {
|
|
|
8057
8370
|
return get(field, path, '');
|
|
8058
8371
|
};
|
|
8059
8372
|
const setValue = value => {
|
|
8060
|
-
return editField(field, path, value);
|
|
8373
|
+
return editField(field, path, value || '');
|
|
8061
8374
|
};
|
|
8062
8375
|
return FeelTemplatingEntry({
|
|
8063
8376
|
debounce,
|
|
@@ -8085,7 +8398,7 @@ function TimeLabel(props) {
|
|
|
8085
8398
|
return get(field, path, '');
|
|
8086
8399
|
};
|
|
8087
8400
|
const setValue = value => {
|
|
8088
|
-
return editField(field, path, value);
|
|
8401
|
+
return editField(field, path, value || '');
|
|
8089
8402
|
};
|
|
8090
8403
|
return FeelTemplatingEntry({
|
|
8091
8404
|
debounce,
|
|
@@ -8144,6 +8457,7 @@ function Source(props) {
|
|
|
8144
8457
|
getValue,
|
|
8145
8458
|
id,
|
|
8146
8459
|
label: 'Image source',
|
|
8460
|
+
tooltip: 'Link referring to a hosted image, or use a data URI directly to embed image data into the form.',
|
|
8147
8461
|
setValue,
|
|
8148
8462
|
singleLine: true,
|
|
8149
8463
|
variables
|
|
@@ -8905,14 +9219,14 @@ function Value(props) {
|
|
|
8905
9219
|
|
|
8906
9220
|
// helpers //////////
|
|
8907
9221
|
|
|
8908
|
-
/**
|
|
8909
|
-
* Returns copy of object with updated value.
|
|
8910
|
-
*
|
|
8911
|
-
* @param {Object} properties
|
|
8912
|
-
* @param {string} key
|
|
8913
|
-
* @param {string} value
|
|
8914
|
-
*
|
|
8915
|
-
* @returns {Object}
|
|
9222
|
+
/**
|
|
9223
|
+
* Returns copy of object with updated value.
|
|
9224
|
+
*
|
|
9225
|
+
* @param {Object} properties
|
|
9226
|
+
* @param {string} key
|
|
9227
|
+
* @param {string} value
|
|
9228
|
+
*
|
|
9229
|
+
* @returns {Object}
|
|
8916
9230
|
*/
|
|
8917
9231
|
function updateValue(properties, key, value) {
|
|
8918
9232
|
return {
|
|
@@ -8921,14 +9235,14 @@ function updateValue(properties, key, value) {
|
|
|
8921
9235
|
};
|
|
8922
9236
|
}
|
|
8923
9237
|
|
|
8924
|
-
/**
|
|
8925
|
-
* Returns copy of object with updated key.
|
|
8926
|
-
*
|
|
8927
|
-
* @param {Object} properties
|
|
8928
|
-
* @param {string} oldKey
|
|
8929
|
-
* @param {string} newKey
|
|
8930
|
-
*
|
|
8931
|
-
* @returns {Object}
|
|
9238
|
+
/**
|
|
9239
|
+
* Returns copy of object with updated key.
|
|
9240
|
+
*
|
|
9241
|
+
* @param {Object} properties
|
|
9242
|
+
* @param {string} oldKey
|
|
9243
|
+
* @param {string} newKey
|
|
9244
|
+
*
|
|
9245
|
+
* @returns {Object}
|
|
8932
9246
|
*/
|
|
8933
9247
|
function updateKey(properties, oldKey, newKey) {
|
|
8934
9248
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -9300,6 +9614,7 @@ function Readonly(props) {
|
|
|
9300
9614
|
getValue,
|
|
9301
9615
|
id,
|
|
9302
9616
|
label: 'Read only',
|
|
9617
|
+
tooltip: 'Field cannot be edited by the end-user, but the data will still be submitted.',
|
|
9303
9618
|
setValue,
|
|
9304
9619
|
variables
|
|
9305
9620
|
});
|
|
@@ -9753,12 +10068,13 @@ function ValuesGroups(field, editField) {
|
|
|
9753
10068
|
};
|
|
9754
10069
|
const valuesSourceId = `${fieldId}-valuesSource`;
|
|
9755
10070
|
|
|
9756
|
-
/**
|
|
9757
|
-
* @type {Array<Group|ListGroup>}
|
|
10071
|
+
/**
|
|
10072
|
+
* @type {Array<Group|ListGroup>}
|
|
9758
10073
|
*/
|
|
9759
10074
|
const groups = [{
|
|
9760
10075
|
id: valuesSourceId,
|
|
9761
10076
|
label: 'Options source',
|
|
10077
|
+
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.',
|
|
9762
10078
|
component: Group,
|
|
9763
10079
|
entries: ValuesSourceSelectEntry({
|
|
9764
10080
|
...context,
|
|
@@ -9803,7 +10119,7 @@ function ValuesGroups(field, editField) {
|
|
|
9803
10119
|
return groups;
|
|
9804
10120
|
}
|
|
9805
10121
|
|
|
9806
|
-
function
|
|
10122
|
+
function CustomPropertiesGroup(field, editField) {
|
|
9807
10123
|
const {
|
|
9808
10124
|
properties = {},
|
|
9809
10125
|
type
|
|
@@ -9861,19 +10177,20 @@ function CustomValuesGroup(field, editField) {
|
|
|
9861
10177
|
id: 'custom-values',
|
|
9862
10178
|
items,
|
|
9863
10179
|
label: 'Custom properties',
|
|
10180
|
+
tooltip: 'Add properties directly to the form schema, useful to configure functionality in custom-built task applications and form renderers.',
|
|
9864
10181
|
shouldSort: false
|
|
9865
10182
|
};
|
|
9866
10183
|
}
|
|
9867
10184
|
|
|
9868
10185
|
// helpers //////////
|
|
9869
10186
|
|
|
9870
|
-
/**
|
|
9871
|
-
* Returns copy of object without key.
|
|
9872
|
-
*
|
|
9873
|
-
* @param {Object} properties
|
|
9874
|
-
* @param {string} oldKey
|
|
9875
|
-
*
|
|
9876
|
-
* @returns {Object}
|
|
10187
|
+
/**
|
|
10188
|
+
* Returns copy of object without key.
|
|
10189
|
+
*
|
|
10190
|
+
* @param {Object} properties
|
|
10191
|
+
* @param {string} oldKey
|
|
10192
|
+
*
|
|
10193
|
+
* @returns {Object}
|
|
9877
10194
|
*/
|
|
9878
10195
|
function removeKey(properties, oldKey) {
|
|
9879
10196
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -9946,7 +10263,7 @@ function getGroups(field, editField, getService) {
|
|
|
9946
10263
|
if (!field) {
|
|
9947
10264
|
return [];
|
|
9948
10265
|
}
|
|
9949
|
-
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),
|
|
10266
|
+
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)];
|
|
9950
10267
|
|
|
9951
10268
|
// contract: if a group returns null, it should not be displayed at all
|
|
9952
10269
|
return groups.filter(group => group !== null);
|
|
@@ -9976,9 +10293,9 @@ function FormPropertiesPanel(props) {
|
|
|
9976
10293
|
});
|
|
9977
10294
|
}, [eventBus, formEditor, selectionModule]);
|
|
9978
10295
|
useLayoutEffect(() => {
|
|
9979
|
-
/**
|
|
9980
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
9981
|
-
* once we have a proper updater/change support
|
|
10296
|
+
/**
|
|
10297
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
10298
|
+
* once we have a proper updater/change support
|
|
9982
10299
|
*/
|
|
9983
10300
|
eventBus.on('changed', refresh);
|
|
9984
10301
|
eventBus.on('import.done', refresh);
|
|
@@ -10030,10 +10347,10 @@ class PropertiesPanelRenderer {
|
|
|
10030
10347
|
});
|
|
10031
10348
|
}
|
|
10032
10349
|
|
|
10033
|
-
/**
|
|
10034
|
-
* Attach the properties panel to a parent node.
|
|
10035
|
-
*
|
|
10036
|
-
* @param {HTMLElement} container
|
|
10350
|
+
/**
|
|
10351
|
+
* Attach the properties panel to a parent node.
|
|
10352
|
+
*
|
|
10353
|
+
* @param {HTMLElement} container
|
|
10037
10354
|
*/
|
|
10038
10355
|
attachTo(container) {
|
|
10039
10356
|
if (!container) {
|
|
@@ -10053,8 +10370,8 @@ class PropertiesPanelRenderer {
|
|
|
10053
10370
|
this._eventBus.fire('propertiesPanel.attach');
|
|
10054
10371
|
}
|
|
10055
10372
|
|
|
10056
|
-
/**
|
|
10057
|
-
* Detach the properties panel from its parent node.
|
|
10373
|
+
/**
|
|
10374
|
+
* Detach the properties panel from its parent node.
|
|
10058
10375
|
*/
|
|
10059
10376
|
detach() {
|
|
10060
10377
|
const parentNode = this._container.parentNode;
|
|
@@ -10084,10 +10401,10 @@ var PropertiesPanelModule = {
|
|
|
10084
10401
|
propertiesPanel: ['type', PropertiesPanelRenderer]
|
|
10085
10402
|
};
|
|
10086
10403
|
|
|
10087
|
-
/**
|
|
10088
|
-
* Manages the rendering of visual plugins.
|
|
10089
|
-
* @constructor
|
|
10090
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
10404
|
+
/**
|
|
10405
|
+
* Manages the rendering of visual plugins.
|
|
10406
|
+
* @constructor
|
|
10407
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
10091
10408
|
*/
|
|
10092
10409
|
class RenderInjector extends SectionModuleBase {
|
|
10093
10410
|
constructor(eventBus) {
|
|
@@ -10096,10 +10413,10 @@ class RenderInjector extends SectionModuleBase {
|
|
|
10096
10413
|
this.registeredRenderers = [];
|
|
10097
10414
|
}
|
|
10098
10415
|
|
|
10099
|
-
/**
|
|
10100
|
-
* Inject a new renderer into the injector.
|
|
10101
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
10102
|
-
* @param {Function} Renderer - The renderer function.
|
|
10416
|
+
/**
|
|
10417
|
+
* Inject a new renderer into the injector.
|
|
10418
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
10419
|
+
* @param {Function} Renderer - The renderer function.
|
|
10103
10420
|
*/
|
|
10104
10421
|
attachRenderer(identifier, Renderer) {
|
|
10105
10422
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -10108,17 +10425,17 @@ class RenderInjector extends SectionModuleBase {
|
|
|
10108
10425
|
}];
|
|
10109
10426
|
}
|
|
10110
10427
|
|
|
10111
|
-
/**
|
|
10112
|
-
* Detach a renderer from the by key injector.
|
|
10113
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
10428
|
+
/**
|
|
10429
|
+
* Detach a renderer from the by key injector.
|
|
10430
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
10114
10431
|
*/
|
|
10115
10432
|
detachRenderer(identifier) {
|
|
10116
10433
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
10117
10434
|
}
|
|
10118
10435
|
|
|
10119
|
-
/**
|
|
10120
|
-
* Returns the registered renderers.
|
|
10121
|
-
* @returns {Array} Array of registered renderers.
|
|
10436
|
+
/**
|
|
10437
|
+
* Returns the registered renderers.
|
|
10438
|
+
* @returns {Array} Array of registered renderers.
|
|
10122
10439
|
*/
|
|
10123
10440
|
fetchRenderers() {
|
|
10124
10441
|
return this.registeredRenderers;
|
|
@@ -10152,48 +10469,48 @@ var ExpressionLanguageModule = {
|
|
|
10152
10469
|
|
|
10153
10470
|
const ids = new Ids([32, 36, 1]);
|
|
10154
10471
|
|
|
10155
|
-
/**
|
|
10156
|
-
* @typedef { import('./types').Injector } Injector
|
|
10157
|
-
* @typedef { import('./types').Module } Module
|
|
10158
|
-
* @typedef { import('./types').Schema } Schema
|
|
10159
|
-
*
|
|
10160
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
10161
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
10162
|
-
*
|
|
10163
|
-
* @typedef { {
|
|
10164
|
-
* properties: FormEditorProperties,
|
|
10165
|
-
* schema: Schema
|
|
10166
|
-
* } } State
|
|
10167
|
-
*
|
|
10168
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
10169
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
10170
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
10472
|
+
/**
|
|
10473
|
+
* @typedef { import('./types').Injector } Injector
|
|
10474
|
+
* @typedef { import('./types').Module } Module
|
|
10475
|
+
* @typedef { import('./types').Schema } Schema
|
|
10476
|
+
*
|
|
10477
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
10478
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
10479
|
+
*
|
|
10480
|
+
* @typedef { {
|
|
10481
|
+
* properties: FormEditorProperties,
|
|
10482
|
+
* schema: Schema
|
|
10483
|
+
* } } State
|
|
10484
|
+
*
|
|
10485
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
10486
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
10487
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
10171
10488
|
*/
|
|
10172
10489
|
|
|
10173
|
-
/**
|
|
10174
|
-
* The form editor.
|
|
10490
|
+
/**
|
|
10491
|
+
* The form editor.
|
|
10175
10492
|
*/
|
|
10176
10493
|
class FormEditor {
|
|
10177
|
-
/**
|
|
10178
|
-
* @constructor
|
|
10179
|
-
* @param {FormEditorOptions} options
|
|
10494
|
+
/**
|
|
10495
|
+
* @constructor
|
|
10496
|
+
* @param {FormEditorOptions} options
|
|
10180
10497
|
*/
|
|
10181
10498
|
constructor(options = {}) {
|
|
10182
|
-
/**
|
|
10183
|
-
* @public
|
|
10184
|
-
* @type {OnEventType}
|
|
10499
|
+
/**
|
|
10500
|
+
* @public
|
|
10501
|
+
* @type {OnEventType}
|
|
10185
10502
|
*/
|
|
10186
10503
|
this.on = this._onEvent;
|
|
10187
10504
|
|
|
10188
|
-
/**
|
|
10189
|
-
* @public
|
|
10190
|
-
* @type {String}
|
|
10505
|
+
/**
|
|
10506
|
+
* @public
|
|
10507
|
+
* @type {String}
|
|
10191
10508
|
*/
|
|
10192
10509
|
this._id = ids.next();
|
|
10193
10510
|
|
|
10194
|
-
/**
|
|
10195
|
-
* @private
|
|
10196
|
-
* @type {Element}
|
|
10511
|
+
/**
|
|
10512
|
+
* @private
|
|
10513
|
+
* @type {Element}
|
|
10197
10514
|
*/
|
|
10198
10515
|
this._container = createFormContainer();
|
|
10199
10516
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -10204,15 +10521,15 @@ class FormEditor {
|
|
|
10204
10521
|
properties = {}
|
|
10205
10522
|
} = options;
|
|
10206
10523
|
|
|
10207
|
-
/**
|
|
10208
|
-
* @private
|
|
10209
|
-
* @type {any}
|
|
10524
|
+
/**
|
|
10525
|
+
* @private
|
|
10526
|
+
* @type {any}
|
|
10210
10527
|
*/
|
|
10211
10528
|
this.exporter = exporter;
|
|
10212
10529
|
|
|
10213
|
-
/**
|
|
10214
|
-
* @private
|
|
10215
|
-
* @type {State}
|
|
10530
|
+
/**
|
|
10531
|
+
* @private
|
|
10532
|
+
* @type {State}
|
|
10216
10533
|
*/
|
|
10217
10534
|
this._state = {
|
|
10218
10535
|
properties,
|
|
@@ -10241,10 +10558,10 @@ class FormEditor {
|
|
|
10241
10558
|
this._detach(false);
|
|
10242
10559
|
}
|
|
10243
10560
|
|
|
10244
|
-
/**
|
|
10245
|
-
* @param {Schema} schema
|
|
10246
|
-
*
|
|
10247
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
10561
|
+
/**
|
|
10562
|
+
* @param {Schema} schema
|
|
10563
|
+
*
|
|
10564
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
10248
10565
|
*/
|
|
10249
10566
|
importSchema(schema) {
|
|
10250
10567
|
return new Promise((resolve, reject) => {
|
|
@@ -10273,15 +10590,15 @@ class FormEditor {
|
|
|
10273
10590
|
});
|
|
10274
10591
|
}
|
|
10275
10592
|
|
|
10276
|
-
/**
|
|
10277
|
-
* @returns {Schema}
|
|
10593
|
+
/**
|
|
10594
|
+
* @returns {Schema}
|
|
10278
10595
|
*/
|
|
10279
10596
|
saveSchema() {
|
|
10280
10597
|
return this.getSchema();
|
|
10281
10598
|
}
|
|
10282
10599
|
|
|
10283
|
-
/**
|
|
10284
|
-
* @returns {Schema}
|
|
10600
|
+
/**
|
|
10601
|
+
* @returns {Schema}
|
|
10285
10602
|
*/
|
|
10286
10603
|
getSchema() {
|
|
10287
10604
|
const {
|
|
@@ -10290,8 +10607,8 @@ class FormEditor {
|
|
|
10290
10607
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
10291
10608
|
}
|
|
10292
10609
|
|
|
10293
|
-
/**
|
|
10294
|
-
* @param {Element|string} parentNode
|
|
10610
|
+
/**
|
|
10611
|
+
* @param {Element|string} parentNode
|
|
10295
10612
|
*/
|
|
10296
10613
|
attachTo(parentNode) {
|
|
10297
10614
|
if (!parentNode) {
|
|
@@ -10309,10 +10626,10 @@ class FormEditor {
|
|
|
10309
10626
|
this._detach();
|
|
10310
10627
|
}
|
|
10311
10628
|
|
|
10312
|
-
/**
|
|
10313
|
-
* @internal
|
|
10314
|
-
*
|
|
10315
|
-
* @param {boolean} [emit]
|
|
10629
|
+
/**
|
|
10630
|
+
* @internal
|
|
10631
|
+
*
|
|
10632
|
+
* @param {boolean} [emit]
|
|
10316
10633
|
*/
|
|
10317
10634
|
_detach(emit = true) {
|
|
10318
10635
|
const container = this._container,
|
|
@@ -10326,9 +10643,9 @@ class FormEditor {
|
|
|
10326
10643
|
parentNode.removeChild(container);
|
|
10327
10644
|
}
|
|
10328
10645
|
|
|
10329
|
-
/**
|
|
10330
|
-
* @param {any} property
|
|
10331
|
-
* @param {any} value
|
|
10646
|
+
/**
|
|
10647
|
+
* @param {any} property
|
|
10648
|
+
* @param {any} value
|
|
10332
10649
|
*/
|
|
10333
10650
|
setProperty(property, value) {
|
|
10334
10651
|
const properties = set$1(this._getState().properties, [property], value);
|
|
@@ -10337,21 +10654,21 @@ class FormEditor {
|
|
|
10337
10654
|
});
|
|
10338
10655
|
}
|
|
10339
10656
|
|
|
10340
|
-
/**
|
|
10341
|
-
* @param {string} type
|
|
10342
|
-
* @param {Function} handler
|
|
10657
|
+
/**
|
|
10658
|
+
* @param {string} type
|
|
10659
|
+
* @param {Function} handler
|
|
10343
10660
|
*/
|
|
10344
10661
|
off(type, handler) {
|
|
10345
10662
|
this.get('eventBus').off(type, handler);
|
|
10346
10663
|
}
|
|
10347
10664
|
|
|
10348
|
-
/**
|
|
10349
|
-
* @internal
|
|
10350
|
-
*
|
|
10351
|
-
* @param {FormEditorOptions} options
|
|
10352
|
-
* @param {Element} container
|
|
10353
|
-
*
|
|
10354
|
-
* @returns {Injector}
|
|
10665
|
+
/**
|
|
10666
|
+
* @internal
|
|
10667
|
+
*
|
|
10668
|
+
* @param {FormEditorOptions} options
|
|
10669
|
+
* @param {Element} container
|
|
10670
|
+
*
|
|
10671
|
+
* @returns {Injector}
|
|
10355
10672
|
*/
|
|
10356
10673
|
_createInjector(options, container) {
|
|
10357
10674
|
const {
|
|
@@ -10373,22 +10690,22 @@ class FormEditor {
|
|
|
10373
10690
|
}, core, ...modules, ...additionalModules]);
|
|
10374
10691
|
}
|
|
10375
10692
|
|
|
10376
|
-
/**
|
|
10377
|
-
* @internal
|
|
10693
|
+
/**
|
|
10694
|
+
* @internal
|
|
10378
10695
|
*/
|
|
10379
10696
|
_emit(type, data) {
|
|
10380
10697
|
this.get('eventBus').fire(type, data);
|
|
10381
10698
|
}
|
|
10382
10699
|
|
|
10383
|
-
/**
|
|
10384
|
-
* @internal
|
|
10700
|
+
/**
|
|
10701
|
+
* @internal
|
|
10385
10702
|
*/
|
|
10386
10703
|
_getState() {
|
|
10387
10704
|
return this._state;
|
|
10388
10705
|
}
|
|
10389
10706
|
|
|
10390
|
-
/**
|
|
10391
|
-
* @internal
|
|
10707
|
+
/**
|
|
10708
|
+
* @internal
|
|
10392
10709
|
*/
|
|
10393
10710
|
_setState(state) {
|
|
10394
10711
|
this._state = {
|
|
@@ -10398,15 +10715,15 @@ class FormEditor {
|
|
|
10398
10715
|
this._emit('changed', this._getState());
|
|
10399
10716
|
}
|
|
10400
10717
|
|
|
10401
|
-
/**
|
|
10402
|
-
* @internal
|
|
10718
|
+
/**
|
|
10719
|
+
* @internal
|
|
10403
10720
|
*/
|
|
10404
10721
|
_getModules() {
|
|
10405
10722
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule, RenderInjectionModule];
|
|
10406
10723
|
}
|
|
10407
10724
|
|
|
10408
|
-
/**
|
|
10409
|
-
* @internal
|
|
10725
|
+
/**
|
|
10726
|
+
* @internal
|
|
10410
10727
|
*/
|
|
10411
10728
|
_onEvent(type, priority, handler) {
|
|
10412
10729
|
this.get('eventBus').on(type, priority, handler);
|