@bpmn-io/form-js-playground 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/dist/assets/form-js-playground.css +259 -259
- package/dist/form-playground.umd.js +979 -988
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +11 -11
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
|
@@ -52693,26 +52693,26 @@
|
|
|
52693
52693
|
return [...new Set(variables)];
|
|
52694
52694
|
};
|
|
52695
52695
|
|
|
52696
|
-
/**
|
|
52697
|
-
* Get the variable name at the specified index in a given path expression.
|
|
52698
|
-
*
|
|
52699
|
-
* @param {Object} root - The root node of the path expression tree.
|
|
52700
|
-
* @param {number} index - The index of the variable name to retrieve.
|
|
52701
|
-
* @returns {string|null} The variable name at the specified index or null if index is out of bounds.
|
|
52696
|
+
/**
|
|
52697
|
+
* Get the variable name at the specified index in a given path expression.
|
|
52698
|
+
*
|
|
52699
|
+
* @param {Object} root - The root node of the path expression tree.
|
|
52700
|
+
* @param {number} index - The index of the variable name to retrieve.
|
|
52701
|
+
* @returns {string|null} The variable name at the specified index or null if index is out of bounds.
|
|
52702
52702
|
*/
|
|
52703
52703
|
const _getVariableNameAtPathIndex = (root, index) => {
|
|
52704
52704
|
const nodes = _linearizePathExpression(root);
|
|
52705
52705
|
return nodes[index].variableName || null;
|
|
52706
52706
|
};
|
|
52707
52707
|
|
|
52708
|
-
/**
|
|
52709
|
-
* Extracts the variables which are required of the external context for a given path expression.
|
|
52710
|
-
* This is done by traversing the path expression tree and keeping track of the current depth relative to the external context.
|
|
52711
|
-
*
|
|
52712
|
-
* @param {Object} node - The root node of the path expression tree.
|
|
52713
|
-
* @param {number} initialDepth - The depth at which the root node is located in the outer context.
|
|
52714
|
-
* @param {Object} specialDepthAccessors - Definitions of special keywords which represent more complex accesses of the outer context.
|
|
52715
|
-
* @returns {Set} - A set containing the extracted variable names.
|
|
52708
|
+
/**
|
|
52709
|
+
* Extracts the variables which are required of the external context for a given path expression.
|
|
52710
|
+
* This is done by traversing the path expression tree and keeping track of the current depth relative to the external context.
|
|
52711
|
+
*
|
|
52712
|
+
* @param {Object} node - The root node of the path expression tree.
|
|
52713
|
+
* @param {number} initialDepth - The depth at which the root node is located in the outer context.
|
|
52714
|
+
* @param {Object} specialDepthAccessors - Definitions of special keywords which represent more complex accesses of the outer context.
|
|
52715
|
+
* @returns {Set} - A set containing the extracted variable names.
|
|
52716
52716
|
*/
|
|
52717
52717
|
const _smartExtractVariableNames = (node, initialDepth, specialDepthAccessors) => {
|
|
52718
52718
|
// depth info represents the previous (initialised as null) and current depth of the current accessor in the path expression
|
|
@@ -52758,11 +52758,11 @@
|
|
|
52758
52758
|
return new Set(extractedVariables);
|
|
52759
52759
|
};
|
|
52760
52760
|
|
|
52761
|
-
/**
|
|
52762
|
-
* Deconstructs a path expression tree into an array of components.
|
|
52763
|
-
*
|
|
52764
|
-
* @param {Object} root - The root node of the path expression tree.
|
|
52765
|
-
* @returns {Array<object>} An array of components in the path expression, in the correct order.
|
|
52761
|
+
/**
|
|
52762
|
+
* Deconstructs a path expression tree into an array of components.
|
|
52763
|
+
*
|
|
52764
|
+
* @param {Object} root - The root node of the path expression tree.
|
|
52765
|
+
* @returns {Array<object>} An array of components in the path expression, in the correct order.
|
|
52766
52766
|
*/
|
|
52767
52767
|
const _linearizePathExpression = root => {
|
|
52768
52768
|
let node = root;
|
|
@@ -52781,13 +52781,13 @@
|
|
|
52781
52781
|
return parts.reverse();
|
|
52782
52782
|
};
|
|
52783
52783
|
|
|
52784
|
-
/**
|
|
52785
|
-
* Builds a simplified feel structure tree from the given parse tree and feel string.
|
|
52786
|
-
* The nodes follow this structure: `{ name: string, children: Array, variableName?: string }`
|
|
52787
|
-
*
|
|
52788
|
-
* @param {Object} parseTree - The parse tree generated by a parser.
|
|
52789
|
-
* @param {string} feelString - The feel string used for parsing.
|
|
52790
|
-
* @returns {Object} The simplified feel structure tree.
|
|
52784
|
+
/**
|
|
52785
|
+
* Builds a simplified feel structure tree from the given parse tree and feel string.
|
|
52786
|
+
* The nodes follow this structure: `{ name: string, children: Array, variableName?: string }`
|
|
52787
|
+
*
|
|
52788
|
+
* @param {Object} parseTree - The parse tree generated by a parser.
|
|
52789
|
+
* @param {string} feelString - The feel string used for parsing.
|
|
52790
|
+
* @returns {Object} The simplified feel structure tree.
|
|
52791
52791
|
*/
|
|
52792
52792
|
const _buildSimpleFeelStructureTree = (parseTree, feelString) => {
|
|
52793
52793
|
const stack = [{
|
|
@@ -52813,9 +52813,9 @@
|
|
|
52813
52813
|
return _extractFilterExpressions(stack[0].children[0]);
|
|
52814
52814
|
};
|
|
52815
52815
|
|
|
52816
|
-
/**
|
|
52817
|
-
* Restructure the tree in such a way to bring filters (which create new contexts) to the root of the tree.
|
|
52818
|
-
* This is done to simplify the extraction of variables and match the context hierarchy.
|
|
52816
|
+
/**
|
|
52817
|
+
* Restructure the tree in such a way to bring filters (which create new contexts) to the root of the tree.
|
|
52818
|
+
* This is done to simplify the extraction of variables and match the context hierarchy.
|
|
52819
52819
|
*/
|
|
52820
52820
|
const _extractFilterExpressions = tree => {
|
|
52821
52821
|
const flattenedExpressionTree = {
|
|
@@ -52855,25 +52855,25 @@
|
|
|
52855
52855
|
this._eventBus = eventBus;
|
|
52856
52856
|
}
|
|
52857
52857
|
|
|
52858
|
-
/**
|
|
52859
|
-
* Determines if the given value is a FEEL expression.
|
|
52860
|
-
*
|
|
52861
|
-
* @param {any} value
|
|
52862
|
-
* @returns {boolean}
|
|
52863
|
-
*
|
|
52858
|
+
/**
|
|
52859
|
+
* Determines if the given value is a FEEL expression.
|
|
52860
|
+
*
|
|
52861
|
+
* @param {any} value
|
|
52862
|
+
* @returns {boolean}
|
|
52863
|
+
*
|
|
52864
52864
|
*/
|
|
52865
52865
|
isExpression(value) {
|
|
52866
52866
|
return isString$4(value) && value.startsWith('=');
|
|
52867
52867
|
}
|
|
52868
52868
|
|
|
52869
|
-
/**
|
|
52870
|
-
* Retrieve variable names from a given FEEL expression.
|
|
52871
|
-
*
|
|
52872
|
-
* @param {string} expression
|
|
52873
|
-
* @param {object} [options]
|
|
52874
|
-
* @param {string} [options.type]
|
|
52875
|
-
*
|
|
52876
|
-
* @returns {string[]}
|
|
52869
|
+
/**
|
|
52870
|
+
* Retrieve variable names from a given FEEL expression.
|
|
52871
|
+
*
|
|
52872
|
+
* @param {string} expression
|
|
52873
|
+
* @param {object} [options]
|
|
52874
|
+
* @param {string} [options.type]
|
|
52875
|
+
*
|
|
52876
|
+
* @returns {string[]}
|
|
52877
52877
|
*/
|
|
52878
52878
|
getVariableNames(expression, options = {}) {
|
|
52879
52879
|
const {
|
|
@@ -52888,13 +52888,13 @@
|
|
|
52888
52888
|
return getFlavouredFeelVariableNames(expression, type);
|
|
52889
52889
|
}
|
|
52890
52890
|
|
|
52891
|
-
/**
|
|
52892
|
-
* Evaluate an expression.
|
|
52893
|
-
*
|
|
52894
|
-
* @param {string} expression
|
|
52895
|
-
* @param {import('../../types').Data} [data]
|
|
52896
|
-
*
|
|
52897
|
-
* @returns {any}
|
|
52891
|
+
/**
|
|
52892
|
+
* Evaluate an expression.
|
|
52893
|
+
*
|
|
52894
|
+
* @param {string} expression
|
|
52895
|
+
* @param {import('../../types').Data} [data]
|
|
52896
|
+
*
|
|
52897
|
+
* @returns {any}
|
|
52898
52898
|
*/
|
|
52899
52899
|
evaluate(expression, data = {}) {
|
|
52900
52900
|
if (!expression) {
|
|
@@ -52918,23 +52918,23 @@
|
|
|
52918
52918
|
class FeelersTemplating {
|
|
52919
52919
|
constructor() {}
|
|
52920
52920
|
|
|
52921
|
-
/**
|
|
52922
|
-
* Determines if the given value is a feelers template.
|
|
52923
|
-
*
|
|
52924
|
-
* @param {any} value
|
|
52925
|
-
* @returns {boolean}
|
|
52926
|
-
*
|
|
52921
|
+
/**
|
|
52922
|
+
* Determines if the given value is a feelers template.
|
|
52923
|
+
*
|
|
52924
|
+
* @param {any} value
|
|
52925
|
+
* @returns {boolean}
|
|
52926
|
+
*
|
|
52927
52927
|
*/
|
|
52928
52928
|
isTemplate(value) {
|
|
52929
52929
|
return isString$4(value) && (value.startsWith('=') || /{{.*?}}/.test(value));
|
|
52930
52930
|
}
|
|
52931
52931
|
|
|
52932
|
-
/**
|
|
52933
|
-
* Retrieve variable names from a given feelers template.
|
|
52934
|
-
*
|
|
52935
|
-
* @param {string} template
|
|
52936
|
-
*
|
|
52937
|
-
* @returns {string[]}
|
|
52932
|
+
/**
|
|
52933
|
+
* Retrieve variable names from a given feelers template.
|
|
52934
|
+
*
|
|
52935
|
+
* @param {string} template
|
|
52936
|
+
*
|
|
52937
|
+
* @returns {string[]}
|
|
52938
52938
|
*/
|
|
52939
52939
|
getVariableNames(template) {
|
|
52940
52940
|
if (!this.isTemplate(template)) {
|
|
@@ -52960,17 +52960,17 @@
|
|
|
52960
52960
|
}, []);
|
|
52961
52961
|
}
|
|
52962
52962
|
|
|
52963
|
-
/**
|
|
52964
|
-
* Evaluate a template.
|
|
52965
|
-
*
|
|
52966
|
-
* @param {string} template
|
|
52967
|
-
* @param {Object<string, any>} context
|
|
52968
|
-
* @param {Object} options
|
|
52969
|
-
* @param {boolean} [options.debug = false]
|
|
52970
|
-
* @param {boolean} [options.strict = false]
|
|
52971
|
-
* @param {Function} [options.buildDebugString]
|
|
52972
|
-
*
|
|
52973
|
-
* @returns
|
|
52963
|
+
/**
|
|
52964
|
+
* Evaluate a template.
|
|
52965
|
+
*
|
|
52966
|
+
* @param {string} template
|
|
52967
|
+
* @param {Object<string, any>} context
|
|
52968
|
+
* @param {Object} options
|
|
52969
|
+
* @param {boolean} [options.debug = false]
|
|
52970
|
+
* @param {boolean} [options.strict = false]
|
|
52971
|
+
* @param {Function} [options.buildDebugString]
|
|
52972
|
+
*
|
|
52973
|
+
* @returns
|
|
52974
52974
|
*/
|
|
52975
52975
|
evaluate(template, context = {}, options = {}) {
|
|
52976
52976
|
const {
|
|
@@ -52985,22 +52985,22 @@
|
|
|
52985
52985
|
});
|
|
52986
52986
|
}
|
|
52987
52987
|
|
|
52988
|
-
/**
|
|
52989
|
-
* @typedef {Object} ExpressionWithDepth
|
|
52990
|
-
* @property {number} depth - The depth of the expression in the syntax tree.
|
|
52991
|
-
* @property {string} expression - The extracted expression
|
|
52988
|
+
/**
|
|
52989
|
+
* @typedef {Object} ExpressionWithDepth
|
|
52990
|
+
* @property {number} depth - The depth of the expression in the syntax tree.
|
|
52991
|
+
* @property {string} expression - The extracted expression
|
|
52992
52992
|
*/
|
|
52993
52993
|
|
|
52994
|
-
/**
|
|
52995
|
-
* Extracts all feel expressions in the template along with their depth in the syntax tree.
|
|
52996
|
-
* The depth is incremented for child expressions of loops to account for context drilling.
|
|
52997
|
-
|
|
52998
|
-
* @param {string} template - A feelers template string.
|
|
52999
|
-
* @returns {Array<ExpressionWithDepth>} An array of objects, each containing the depth and the extracted expression.
|
|
53000
|
-
*
|
|
53001
|
-
* @example
|
|
53002
|
-
* const template = "Hello {{user}}, you have:{{#loop items}}\n- {{amount}} {{name}}{{/loop}}.";
|
|
53003
|
-
* const extractedExpressions = _extractExpressionsWithDepth(template);
|
|
52994
|
+
/**
|
|
52995
|
+
* Extracts all feel expressions in the template along with their depth in the syntax tree.
|
|
52996
|
+
* The depth is incremented for child expressions of loops to account for context drilling.
|
|
52997
|
+
* @name extractExpressionsWithDepth
|
|
52998
|
+
* @param {string} template - A feelers template string.
|
|
52999
|
+
* @returns {Array<ExpressionWithDepth>} An array of objects, each containing the depth and the extracted expression.
|
|
53000
|
+
*
|
|
53001
|
+
* @example
|
|
53002
|
+
* const template = "Hello {{user}}, you have:{{#loop items}}\n- {{amount}} {{name}}{{/loop}}.";
|
|
53003
|
+
* const extractedExpressions = _extractExpressionsWithDepth(template);
|
|
53004
53004
|
*/
|
|
53005
53005
|
_extractExpressionsWithDepth(template) {
|
|
53006
53006
|
// build simplified feelers syntax tree
|
|
@@ -53105,10 +53105,10 @@
|
|
|
53105
53105
|
return injector;
|
|
53106
53106
|
}
|
|
53107
53107
|
|
|
53108
|
-
/**
|
|
53109
|
-
* @param {string?} prefix
|
|
53110
|
-
*
|
|
53111
|
-
* @returns Element
|
|
53108
|
+
/**
|
|
53109
|
+
* @param {string?} prefix
|
|
53110
|
+
*
|
|
53111
|
+
* @returns Element
|
|
53112
53112
|
*/
|
|
53113
53113
|
function createFormContainer(prefix = 'fjs') {
|
|
53114
53114
|
const container = document.createElement('div');
|
|
@@ -53235,11 +53235,11 @@
|
|
|
53235
53235
|
});
|
|
53236
53236
|
var LocalExpressionContext$1 = LocalExpressionContext;
|
|
53237
53237
|
|
|
53238
|
-
/**
|
|
53239
|
-
* @param {string} type
|
|
53240
|
-
* @param {boolean} [strict]
|
|
53241
|
-
*
|
|
53242
|
-
* @returns {any}
|
|
53238
|
+
/**
|
|
53239
|
+
* @param {string} type
|
|
53240
|
+
* @param {boolean} [strict]
|
|
53241
|
+
*
|
|
53242
|
+
* @returns {any}
|
|
53243
53243
|
*/
|
|
53244
53244
|
function getService$2(type, strict) {}
|
|
53245
53245
|
const FormContext = D$2({
|
|
@@ -53254,21 +53254,21 @@
|
|
|
53254
53254
|
return getService(type, strict);
|
|
53255
53255
|
}
|
|
53256
53256
|
|
|
53257
|
-
/**
|
|
53258
|
-
* @template T
|
|
53259
|
-
* @param {T} data
|
|
53260
|
-
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
53261
|
-
* @return {T}
|
|
53257
|
+
/**
|
|
53258
|
+
* @template T
|
|
53259
|
+
* @param {T} data
|
|
53260
|
+
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
53261
|
+
* @return {T}
|
|
53262
53262
|
*/
|
|
53263
53263
|
function clone(data, replacer) {
|
|
53264
53264
|
return JSON.parse(JSON.stringify(data, replacer));
|
|
53265
53265
|
}
|
|
53266
53266
|
|
|
53267
|
-
/**
|
|
53268
|
-
* Transform a LocalExpressionContext object into a usable FEEL context.
|
|
53269
|
-
*
|
|
53270
|
-
* @param {Object} context - The LocalExpressionContext object.
|
|
53271
|
-
* @returns {Object} The usable FEEL context.
|
|
53267
|
+
/**
|
|
53268
|
+
* Transform a LocalExpressionContext object into a usable FEEL context.
|
|
53269
|
+
*
|
|
53270
|
+
* @param {Object} context - The LocalExpressionContext object.
|
|
53271
|
+
* @returns {Object} The usable FEEL context.
|
|
53272
53272
|
*/
|
|
53273
53273
|
|
|
53274
53274
|
function buildExpressionContext(context) {
|
|
@@ -53300,12 +53300,12 @@
|
|
|
53300
53300
|
return newObj;
|
|
53301
53301
|
}
|
|
53302
53302
|
|
|
53303
|
-
/**
|
|
53304
|
-
* Evaluate if condition is met reactively based on the conditionChecker and form data.
|
|
53305
|
-
*
|
|
53306
|
-
* @param {string | undefined} condition
|
|
53307
|
-
*
|
|
53308
|
-
* @returns {boolean} true if condition is met or no condition or condition checker exists
|
|
53303
|
+
/**
|
|
53304
|
+
* Evaluate if condition is met reactively based on the conditionChecker and form data.
|
|
53305
|
+
*
|
|
53306
|
+
* @param {string | undefined} condition
|
|
53307
|
+
*
|
|
53308
|
+
* @returns {boolean} true if condition is met or no condition or condition checker exists
|
|
53309
53309
|
*/
|
|
53310
53310
|
function useCondition(condition) {
|
|
53311
53311
|
const conditionChecker = useService$2('conditionChecker', false);
|
|
@@ -53315,17 +53315,17 @@
|
|
|
53315
53315
|
}, [conditionChecker, condition, expressionContextInfo]);
|
|
53316
53316
|
}
|
|
53317
53317
|
|
|
53318
|
-
/**
|
|
53319
|
-
* Custom hook to scroll an element into view only when it is not visible within the viewport.
|
|
53320
|
-
*
|
|
53321
|
-
* @param {Object} targetRef - A ref pointing to the DOM element to scroll into view.
|
|
53322
|
-
* @param {Array} deps - An array of dependencies that trigger the effect.
|
|
53323
|
-
* @param {Array} flagRefs - An array of refs that are used as flags to control when to scroll.
|
|
53324
|
-
* @param {Object} [scrollOptions={}] - Options defining the behavior of the scrolling.
|
|
53325
|
-
* @param {String} [scrollOptions.align='center'] - The alignment of the element within the viewport.
|
|
53326
|
-
* @param {String} [scrollOptions.behavior='auto'] - The scrolling behavior.
|
|
53327
|
-
* @param {Number} [scrollOptions.offset=0] - An offset that is added to the scroll position.
|
|
53328
|
-
* @param {Boolean} [scrollOptions.scrollIfVisible=false] - Whether to scroll even if the element is visible.
|
|
53318
|
+
/**
|
|
53319
|
+
* Custom hook to scroll an element into view only when it is not visible within the viewport.
|
|
53320
|
+
*
|
|
53321
|
+
* @param {Object} targetRef - A ref pointing to the DOM element to scroll into view.
|
|
53322
|
+
* @param {Array} deps - An array of dependencies that trigger the effect.
|
|
53323
|
+
* @param {Array} flagRefs - An array of refs that are used as flags to control when to scroll.
|
|
53324
|
+
* @param {Object} [scrollOptions={}] - Options defining the behavior of the scrolling.
|
|
53325
|
+
* @param {String} [scrollOptions.align='center'] - The alignment of the element within the viewport.
|
|
53326
|
+
* @param {String} [scrollOptions.behavior='auto'] - The scrolling behavior.
|
|
53327
|
+
* @param {Number} [scrollOptions.offset=0] - An offset that is added to the scroll position.
|
|
53328
|
+
* @param {Boolean} [scrollOptions.scrollIfVisible=false] - Whether to scroll even if the element is visible.
|
|
53329
53329
|
*/
|
|
53330
53330
|
function useScrollIntoView(targetRef, deps, scrollOptions = null, flagRefs = []) {
|
|
53331
53331
|
y(() => {
|
|
@@ -53390,13 +53390,13 @@
|
|
|
53390
53390
|
return 0;
|
|
53391
53391
|
}
|
|
53392
53392
|
|
|
53393
|
-
/**
|
|
53394
|
-
* Evaluate a string reactively based on the expressionLanguage and form data.
|
|
53395
|
-
* If the string is not an expression, it is returned as is.
|
|
53396
|
-
* The function is memoized to minimize re-renders.
|
|
53397
|
-
*
|
|
53398
|
-
* @param {string} value - The string to evaluate.
|
|
53399
|
-
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
53393
|
+
/**
|
|
53394
|
+
* Evaluate a string reactively based on the expressionLanguage and form data.
|
|
53395
|
+
* If the string is not an expression, it is returned as is.
|
|
53396
|
+
* The function is memoized to minimize re-renders.
|
|
53397
|
+
*
|
|
53398
|
+
* @param {string} value - The string to evaluate.
|
|
53399
|
+
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
53400
53400
|
*/
|
|
53401
53401
|
function useExpressionEvaluation(value) {
|
|
53402
53402
|
const expressionLanguage = useService$2('expressionLanguage');
|
|
@@ -53409,11 +53409,11 @@
|
|
|
53409
53409
|
}, [expressionLanguage, expressionContextInfo, value]);
|
|
53410
53410
|
}
|
|
53411
53411
|
|
|
53412
|
-
/**
|
|
53413
|
-
* Returns the conditionally filtered data of a form reactively.
|
|
53414
|
-
* Memoised to minimize re-renders
|
|
53415
|
-
*
|
|
53416
|
-
* Warning: costly operation, use with care
|
|
53412
|
+
/**
|
|
53413
|
+
* Returns the conditionally filtered data of a form reactively.
|
|
53414
|
+
* Memoised to minimize re-renders
|
|
53415
|
+
*
|
|
53416
|
+
* Warning: costly operation, use with care
|
|
53417
53417
|
*/
|
|
53418
53418
|
function useFilteredFormData() {
|
|
53419
53419
|
const {
|
|
@@ -53445,16 +53445,16 @@
|
|
|
53445
53445
|
});
|
|
53446
53446
|
}
|
|
53447
53447
|
|
|
53448
|
-
/**
|
|
53449
|
-
* Retrieve readonly value of a form field, given it can be an
|
|
53450
|
-
* expression optionally or configured globally.
|
|
53451
|
-
*
|
|
53452
|
-
* @typedef { import('../../types').FormProperties } FormProperties
|
|
53453
|
-
*
|
|
53454
|
-
* @param {any} formField
|
|
53455
|
-
* @param {FormProperties} properties
|
|
53456
|
-
*
|
|
53457
|
-
* @returns {boolean}
|
|
53448
|
+
/**
|
|
53449
|
+
* Retrieve readonly value of a form field, given it can be an
|
|
53450
|
+
* expression optionally or configured globally.
|
|
53451
|
+
*
|
|
53452
|
+
* @typedef { import('../../types').FormProperties } FormProperties
|
|
53453
|
+
*
|
|
53454
|
+
* @param {any} formField
|
|
53455
|
+
* @param {FormProperties} properties
|
|
53456
|
+
*
|
|
53457
|
+
* @returns {boolean}
|
|
53458
53458
|
*/
|
|
53459
53459
|
function useReadonly(formField, properties = {}) {
|
|
53460
53460
|
const expressionLanguage = useService$2('expressionLanguage');
|
|
@@ -53477,12 +53477,12 @@
|
|
|
53477
53477
|
return ref.current;
|
|
53478
53478
|
}
|
|
53479
53479
|
|
|
53480
|
-
/**
|
|
53481
|
-
* A custom hook to manage state changes with deep comparison.
|
|
53482
|
-
*
|
|
53483
|
-
* @param {any} value - The current value to manage.
|
|
53484
|
-
* @param {any} defaultValue - The initial default value for the state.
|
|
53485
|
-
* @returns {any} - Returns the current state.
|
|
53480
|
+
/**
|
|
53481
|
+
* A custom hook to manage state changes with deep comparison.
|
|
53482
|
+
*
|
|
53483
|
+
* @param {any} value - The current value to manage.
|
|
53484
|
+
* @param {any} defaultValue - The initial default value for the state.
|
|
53485
|
+
* @returns {any} - Returns the current state.
|
|
53486
53486
|
*/
|
|
53487
53487
|
function useDeepCompareState(value, defaultValue) {
|
|
53488
53488
|
const [state, setState] = l$2(defaultValue);
|
|
@@ -53502,16 +53502,16 @@
|
|
|
53502
53502
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
53503
53503
|
}
|
|
53504
53504
|
|
|
53505
|
-
/**
|
|
53506
|
-
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
53507
|
-
* Memoised to minimize re-renders
|
|
53508
|
-
*
|
|
53509
|
-
* @param {string} value
|
|
53510
|
-
* @param {Object} options
|
|
53511
|
-
* @param {boolean} [options.debug = false]
|
|
53512
|
-
* @param {boolean} [options.strict = false]
|
|
53513
|
-
* @param {Function} [options.buildDebugString]
|
|
53514
|
-
*
|
|
53505
|
+
/**
|
|
53506
|
+
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
53507
|
+
* Memoised to minimize re-renders
|
|
53508
|
+
*
|
|
53509
|
+
* @param {string} value
|
|
53510
|
+
* @param {Object} options
|
|
53511
|
+
* @param {boolean} [options.debug = false]
|
|
53512
|
+
* @param {boolean} [options.strict = false]
|
|
53513
|
+
* @param {Function} [options.buildDebugString]
|
|
53514
|
+
*
|
|
53515
53515
|
*/
|
|
53516
53516
|
function useTemplateEvaluation(value, options = {}) {
|
|
53517
53517
|
const templating = useService$2('templating');
|
|
@@ -53524,17 +53524,17 @@
|
|
|
53524
53524
|
}, [templating, value, expressionContextInfo, options]);
|
|
53525
53525
|
}
|
|
53526
53526
|
|
|
53527
|
-
/**
|
|
53528
|
-
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
53529
|
-
* If the string contains multiple lines, only the first line is returned.
|
|
53530
|
-
* Memoised to minimize re-renders
|
|
53531
|
-
*
|
|
53532
|
-
* @param {string} value
|
|
53533
|
-
* @param {Object} [options]
|
|
53534
|
-
* @param {boolean} [options.debug = false]
|
|
53535
|
-
* @param {boolean} [options.strict = false]
|
|
53536
|
-
* @param {Function} [options.buildDebugString]
|
|
53537
|
-
*
|
|
53527
|
+
/**
|
|
53528
|
+
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
53529
|
+
* If the string contains multiple lines, only the first line is returned.
|
|
53530
|
+
* Memoised to minimize re-renders
|
|
53531
|
+
*
|
|
53532
|
+
* @param {string} value
|
|
53533
|
+
* @param {Object} [options]
|
|
53534
|
+
* @param {boolean} [options.debug = false]
|
|
53535
|
+
* @param {boolean} [options.strict = false]
|
|
53536
|
+
* @param {Function} [options.buildDebugString]
|
|
53537
|
+
*
|
|
53538
53538
|
*/
|
|
53539
53539
|
function useSingleLineTemplateEvaluation(value, options = {}) {
|
|
53540
53540
|
const evaluatedTemplate = useTemplateEvaluation(value, options);
|
|
@@ -53686,15 +53686,15 @@
|
|
|
53686
53686
|
return optionsData.filter(_isAllowedValue).map(_normalizeOption).filter(o => !isNil$1(o));
|
|
53687
53687
|
}
|
|
53688
53688
|
|
|
53689
|
-
/**
|
|
53690
|
-
* Converts the provided option to a normalized format.
|
|
53691
|
-
* If the option is not valid, null is returned.
|
|
53692
|
-
*
|
|
53693
|
-
* @param {object} option
|
|
53694
|
-
* @param {string} option.label
|
|
53695
|
-
* @param {*} option.value
|
|
53696
|
-
*
|
|
53697
|
-
* @returns
|
|
53689
|
+
/**
|
|
53690
|
+
* Converts the provided option to a normalized format.
|
|
53691
|
+
* If the option is not valid, null is returned.
|
|
53692
|
+
*
|
|
53693
|
+
* @param {object} option
|
|
53694
|
+
* @param {string} option.label
|
|
53695
|
+
* @param {*} option.value
|
|
53696
|
+
*
|
|
53697
|
+
* @returns
|
|
53698
53698
|
*/
|
|
53699
53699
|
function _normalizeOption(option) {
|
|
53700
53700
|
// (1) simple primitive case, use it as both label and value
|
|
@@ -53752,8 +53752,8 @@
|
|
|
53752
53752
|
};
|
|
53753
53753
|
}
|
|
53754
53754
|
|
|
53755
|
-
/**
|
|
53756
|
-
* @enum { String }
|
|
53755
|
+
/**
|
|
53756
|
+
* @enum { String }
|
|
53757
53757
|
*/
|
|
53758
53758
|
const LOAD_STATES = {
|
|
53759
53759
|
LOADING: 'loading',
|
|
@@ -53761,17 +53761,17 @@
|
|
|
53761
53761
|
ERROR: 'error'
|
|
53762
53762
|
};
|
|
53763
53763
|
|
|
53764
|
-
/**
|
|
53765
|
-
* @typedef {Object} OptionsGetter
|
|
53766
|
-
* @property {Object[]} options - The options data
|
|
53767
|
-
* @property {(LOAD_STATES)} loadState - The options data's loading state, to use for conditional rendering
|
|
53764
|
+
/**
|
|
53765
|
+
* @typedef {Object} OptionsGetter
|
|
53766
|
+
* @property {Object[]} options - The options data
|
|
53767
|
+
* @property {(LOAD_STATES)} loadState - The options data's loading state, to use for conditional rendering
|
|
53768
53768
|
*/
|
|
53769
53769
|
|
|
53770
|
-
/**
|
|
53771
|
-
* A hook to load options for single and multiselect components.
|
|
53772
|
-
*
|
|
53773
|
-
* @param {Object} field - The form field to handle options for
|
|
53774
|
-
* @return {OptionsGetter} optionsGetter - A options getter object providing loading state and options
|
|
53770
|
+
/**
|
|
53771
|
+
* A hook to load options for single and multiselect components.
|
|
53772
|
+
*
|
|
53773
|
+
* @param {Object} field - The form field to handle options for
|
|
53774
|
+
* @return {OptionsGetter} optionsGetter - A options getter object providing loading state and options
|
|
53775
53775
|
*/
|
|
53776
53776
|
function useOptionsAsync(field) {
|
|
53777
53777
|
const {
|
|
@@ -54411,12 +54411,12 @@
|
|
|
54411
54411
|
})
|
|
54412
54412
|
};
|
|
54413
54413
|
|
|
54414
|
-
/**
|
|
54415
|
-
* Returns date format for the provided locale.
|
|
54416
|
-
* If the locale is not provided, uses the browser's locale.
|
|
54417
|
-
*
|
|
54418
|
-
* @param {string} [locale] - The locale to get date format for.
|
|
54419
|
-
* @returns {string} The date format for the locale.
|
|
54414
|
+
/**
|
|
54415
|
+
* Returns date format for the provided locale.
|
|
54416
|
+
* If the locale is not provided, uses the browser's locale.
|
|
54417
|
+
*
|
|
54418
|
+
* @param {string} [locale] - The locale to get date format for.
|
|
54419
|
+
* @returns {string} The date format for the locale.
|
|
54420
54420
|
*/
|
|
54421
54421
|
function getLocaleDateFormat(locale = 'default') {
|
|
54422
54422
|
const parts = new Intl.DateTimeFormat(locale).formatToParts(new Date(Date.UTC(2020, 5, 5)));
|
|
@@ -54435,12 +54435,12 @@
|
|
|
54435
54435
|
}).join('');
|
|
54436
54436
|
}
|
|
54437
54437
|
|
|
54438
|
-
/**
|
|
54439
|
-
* Returns readable date format for the provided locale.
|
|
54440
|
-
* If the locale is not provided, uses the browser's locale.
|
|
54441
|
-
*
|
|
54442
|
-
* @param {string} [locale] - The locale to get readable date format for.
|
|
54443
|
-
* @returns {string} The readable date format for the locale.
|
|
54438
|
+
/**
|
|
54439
|
+
* Returns readable date format for the provided locale.
|
|
54440
|
+
* If the locale is not provided, uses the browser's locale.
|
|
54441
|
+
*
|
|
54442
|
+
* @param {string} [locale] - The locale to get readable date format for.
|
|
54443
|
+
* @returns {string} The readable date format for the locale.
|
|
54444
54444
|
*/
|
|
54445
54445
|
function getLocaleReadableDateFormat(locale) {
|
|
54446
54446
|
let format = getLocaleDateFormat(locale).toLowerCase();
|
|
@@ -54457,12 +54457,12 @@
|
|
|
54457
54457
|
return format;
|
|
54458
54458
|
}
|
|
54459
54459
|
|
|
54460
|
-
/**
|
|
54461
|
-
* Returns flatpickr config for the provided locale.
|
|
54462
|
-
* If the locale is not provided, uses the browser's locale.
|
|
54463
|
-
*
|
|
54464
|
-
* @param {string} [locale] - The locale to get flatpickr config for.
|
|
54465
|
-
* @returns {object} The flatpickr config for the locale.
|
|
54460
|
+
/**
|
|
54461
|
+
* Returns flatpickr config for the provided locale.
|
|
54462
|
+
* If the locale is not provided, uses the browser's locale.
|
|
54463
|
+
*
|
|
54464
|
+
* @param {string} [locale] - The locale to get flatpickr config for.
|
|
54465
|
+
* @returns {object} The flatpickr config for the locale.
|
|
54466
54466
|
*/
|
|
54467
54467
|
function getLocaleDateFlatpickrConfig(locale) {
|
|
54468
54468
|
return flatpickerizeDateFormat(getLocaleDateFormat(locale));
|
|
@@ -55194,10 +55194,10 @@
|
|
|
55194
55194
|
}
|
|
55195
55195
|
};
|
|
55196
55196
|
|
|
55197
|
-
/**
|
|
55198
|
-
* This file must not be changed or exchanged.
|
|
55199
|
-
*
|
|
55200
|
-
* @see http://bpmn.io/license for more information.
|
|
55197
|
+
/**
|
|
55198
|
+
* This file must not be changed or exchanged.
|
|
55199
|
+
*
|
|
55200
|
+
* @see http://bpmn.io/license for more information.
|
|
55201
55201
|
*/
|
|
55202
55202
|
function Logo() {
|
|
55203
55203
|
return e$1("svg", {
|
|
@@ -55380,11 +55380,11 @@
|
|
|
55380
55380
|
|
|
55381
55381
|
const FORM_ELEMENT = document.createElement('form');
|
|
55382
55382
|
|
|
55383
|
-
/**
|
|
55384
|
-
* Sanitize a HTML string and return the cleaned, safe version.
|
|
55385
|
-
*
|
|
55386
|
-
* @param {string} html
|
|
55387
|
-
* @return {string}
|
|
55383
|
+
/**
|
|
55384
|
+
* Sanitize a HTML string and return the cleaned, safe version.
|
|
55385
|
+
*
|
|
55386
|
+
* @param {string} html
|
|
55387
|
+
* @return {string}
|
|
55388
55388
|
*/
|
|
55389
55389
|
|
|
55390
55390
|
// see https://github.com/developit/snarkdown/issues/70
|
|
@@ -55402,41 +55402,41 @@
|
|
|
55402
55402
|
}
|
|
55403
55403
|
}
|
|
55404
55404
|
|
|
55405
|
-
/**
|
|
55406
|
-
* Sanitizes an image source to ensure we only allow for data URI and links
|
|
55407
|
-
* that start with http(s).
|
|
55408
|
-
*
|
|
55409
|
-
* Note: Most browsers anyway do not support script execution in <img> elements.
|
|
55410
|
-
*
|
|
55411
|
-
* @param {string} src
|
|
55412
|
-
* @returns {string}
|
|
55405
|
+
/**
|
|
55406
|
+
* Sanitizes an image source to ensure we only allow for data URI and links
|
|
55407
|
+
* that start with http(s).
|
|
55408
|
+
*
|
|
55409
|
+
* Note: Most browsers anyway do not support script execution in <img> elements.
|
|
55410
|
+
*
|
|
55411
|
+
* @param {string} src
|
|
55412
|
+
* @returns {string}
|
|
55413
55413
|
*/
|
|
55414
55414
|
function sanitizeImageSource(src) {
|
|
55415
55415
|
const valid = ALLOWED_IMAGE_SRC_PATTERN.test(src);
|
|
55416
55416
|
return valid ? src : '';
|
|
55417
55417
|
}
|
|
55418
55418
|
|
|
55419
|
-
/**
|
|
55420
|
-
* Sanitizes an iframe source to ensure we only allow for links
|
|
55421
|
-
* that start with http(s).
|
|
55422
|
-
*
|
|
55423
|
-
* @param {string} src
|
|
55424
|
-
* @returns {string}
|
|
55419
|
+
/**
|
|
55420
|
+
* Sanitizes an iframe source to ensure we only allow for links
|
|
55421
|
+
* that start with http(s).
|
|
55422
|
+
*
|
|
55423
|
+
* @param {string} src
|
|
55424
|
+
* @returns {string}
|
|
55425
55425
|
*/
|
|
55426
55426
|
function sanitizeIFrameSource(src) {
|
|
55427
55427
|
const valid = ALLOWED_IFRAME_SRC_PATTERN.test(src);
|
|
55428
55428
|
return valid ? src : '';
|
|
55429
55429
|
}
|
|
55430
55430
|
|
|
55431
|
-
/**
|
|
55432
|
-
* Recursively sanitize a HTML node, potentially
|
|
55433
|
-
* removing it, its children or attributes.
|
|
55434
|
-
*
|
|
55435
|
-
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
55436
|
-
* and https://github.com/cure53/DOMPurify. Simplified
|
|
55437
|
-
* for our use-case.
|
|
55438
|
-
*
|
|
55439
|
-
* @param {Element} node
|
|
55431
|
+
/**
|
|
55432
|
+
* Recursively sanitize a HTML node, potentially
|
|
55433
|
+
* removing it, its children or attributes.
|
|
55434
|
+
*
|
|
55435
|
+
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
55436
|
+
* and https://github.com/cure53/DOMPurify. Simplified
|
|
55437
|
+
* for our use-case.
|
|
55438
|
+
*
|
|
55439
|
+
* @param {Element} node
|
|
55440
55440
|
*/
|
|
55441
55441
|
function sanitizeNode(node) {
|
|
55442
55442
|
// allow text nodes
|
|
@@ -55480,13 +55480,13 @@
|
|
|
55480
55480
|
}
|
|
55481
55481
|
}
|
|
55482
55482
|
|
|
55483
|
-
/**
|
|
55484
|
-
* Validates attributes for validity.
|
|
55485
|
-
*
|
|
55486
|
-
* @param {string} lcTag
|
|
55487
|
-
* @param {string} lcName
|
|
55488
|
-
* @param {string} value
|
|
55489
|
-
* @return {boolean}
|
|
55483
|
+
/**
|
|
55484
|
+
* Validates attributes for validity.
|
|
55485
|
+
*
|
|
55486
|
+
* @param {string} lcTag
|
|
55487
|
+
* @param {string} lcName
|
|
55488
|
+
* @param {string} value
|
|
55489
|
+
* @return {boolean}
|
|
55490
55490
|
*/
|
|
55491
55491
|
function isValidAttribute(lcTag, lcName, value) {
|
|
55492
55492
|
// disallow most attributes based on whitelist
|
|
@@ -55675,39 +55675,6 @@
|
|
|
55675
55675
|
...options
|
|
55676
55676
|
})
|
|
55677
55677
|
};
|
|
55678
|
-
function useFlushDebounce(func, additionalDeps = []) {
|
|
55679
|
-
const timeoutRef = s$1(null);
|
|
55680
|
-
const lastArgsRef = s$1(null);
|
|
55681
|
-
const config = useService$2('config', false);
|
|
55682
|
-
const debounce = config && config.debounce;
|
|
55683
|
-
const shouldDebounce = debounce !== false && debounce !== 0;
|
|
55684
|
-
const delay = typeof debounce === 'number' ? debounce : 300;
|
|
55685
|
-
const debounceFunc = A$1((...args) => {
|
|
55686
|
-
if (!shouldDebounce) {
|
|
55687
|
-
func(...args);
|
|
55688
|
-
return;
|
|
55689
|
-
}
|
|
55690
|
-
lastArgsRef.current = args;
|
|
55691
|
-
if (timeoutRef.current) {
|
|
55692
|
-
clearTimeout(timeoutRef.current);
|
|
55693
|
-
}
|
|
55694
|
-
timeoutRef.current = setTimeout(() => {
|
|
55695
|
-
func(...lastArgsRef.current);
|
|
55696
|
-
lastArgsRef.current = null;
|
|
55697
|
-
}, delay);
|
|
55698
|
-
}, [func, delay, shouldDebounce, ...additionalDeps]);
|
|
55699
|
-
const flushFunc = A$1(() => {
|
|
55700
|
-
if (timeoutRef.current) {
|
|
55701
|
-
clearTimeout(timeoutRef.current);
|
|
55702
|
-
if (lastArgsRef.current !== null) {
|
|
55703
|
-
func(...lastArgsRef.current);
|
|
55704
|
-
lastArgsRef.current = null;
|
|
55705
|
-
}
|
|
55706
|
-
timeoutRef.current = null;
|
|
55707
|
-
}
|
|
55708
|
-
}, [func, ...additionalDeps]);
|
|
55709
|
-
return [debounceFunc, flushFunc];
|
|
55710
|
-
}
|
|
55711
55678
|
function TemplatedInputAdorner(props) {
|
|
55712
55679
|
const {
|
|
55713
55680
|
pre,
|
|
@@ -55820,7 +55787,8 @@
|
|
|
55820
55787
|
onFocus,
|
|
55821
55788
|
field,
|
|
55822
55789
|
value,
|
|
55823
|
-
readonly
|
|
55790
|
+
readonly,
|
|
55791
|
+
onChange
|
|
55824
55792
|
} = props;
|
|
55825
55793
|
const {
|
|
55826
55794
|
description,
|
|
@@ -55840,16 +55808,6 @@
|
|
|
55840
55808
|
} = validate;
|
|
55841
55809
|
const inputRef = s$1();
|
|
55842
55810
|
const [stringValueCache, setStringValueCache] = l$2('');
|
|
55843
|
-
const [onChangeDebounced, flushOnChange] = useFlushDebounce(params => {
|
|
55844
|
-
props.onChange(params);
|
|
55845
|
-
}, [props.onChange]);
|
|
55846
|
-
const onInputBlur = () => {
|
|
55847
|
-
flushOnChange && flushOnChange();
|
|
55848
|
-
onBlur && onBlur();
|
|
55849
|
-
};
|
|
55850
|
-
const onInputFocus = () => {
|
|
55851
|
-
onFocus && onFocus();
|
|
55852
|
-
};
|
|
55853
55811
|
|
|
55854
55812
|
// checks whether the value currently in the form data is practically different from the one in the input field cache
|
|
55855
55813
|
// this allows us to guarantee the field always displays valid form data, but without auto-simplifying values like 1.000 to 1
|
|
@@ -55873,7 +55831,7 @@
|
|
|
55873
55831
|
const setValue = A$1(stringValue => {
|
|
55874
55832
|
if (isNullEquivalentValue(stringValue)) {
|
|
55875
55833
|
setStringValueCache('');
|
|
55876
|
-
|
|
55834
|
+
onChange({
|
|
55877
55835
|
field,
|
|
55878
55836
|
value: null
|
|
55879
55837
|
});
|
|
@@ -55888,18 +55846,18 @@
|
|
|
55888
55846
|
}
|
|
55889
55847
|
if (isNaN(Number(stringValue))) {
|
|
55890
55848
|
setStringValueCache('NaN');
|
|
55891
|
-
|
|
55849
|
+
onChange({
|
|
55892
55850
|
field,
|
|
55893
55851
|
value: 'NaN'
|
|
55894
55852
|
});
|
|
55895
55853
|
return;
|
|
55896
55854
|
}
|
|
55897
55855
|
setStringValueCache(stringValue);
|
|
55898
|
-
|
|
55856
|
+
onChange({
|
|
55899
55857
|
field,
|
|
55900
55858
|
value: serializeToString ? stringValue : Number(stringValue)
|
|
55901
55859
|
});
|
|
55902
|
-
}, [field,
|
|
55860
|
+
}, [field, onChange, serializeToString]);
|
|
55903
55861
|
const increment = () => {
|
|
55904
55862
|
if (readonly) {
|
|
55905
55863
|
return;
|
|
@@ -55983,8 +55941,8 @@
|
|
|
55983
55941
|
id: domId,
|
|
55984
55942
|
onKeyDown: onKeyDown,
|
|
55985
55943
|
onKeyPress: onKeyPress,
|
|
55986
|
-
onBlur:
|
|
55987
|
-
onFocus:
|
|
55944
|
+
onBlur: onBlur,
|
|
55945
|
+
onFocus: onFocus
|
|
55988
55946
|
|
|
55989
55947
|
// @ts-ignore
|
|
55990
55948
|
,
|
|
@@ -56173,9 +56131,9 @@
|
|
|
56173
56131
|
create: createEmptyOptions
|
|
56174
56132
|
};
|
|
56175
56133
|
|
|
56176
|
-
/**
|
|
56177
|
-
* This hook allows us to retrieve the label from a value in linear time by caching it in a map
|
|
56178
|
-
* @param {Array} options
|
|
56134
|
+
/**
|
|
56135
|
+
* This hook allows us to retrieve the label from a value in linear time by caching it in a map
|
|
56136
|
+
* @param {Array} options
|
|
56179
56137
|
*/
|
|
56180
56138
|
function useGetLabelCorrelation(options) {
|
|
56181
56139
|
// This allows us to retrieve the label from a value in linear time
|
|
@@ -56995,6 +56953,39 @@
|
|
|
56995
56953
|
children: children
|
|
56996
56954
|
});
|
|
56997
56955
|
}
|
|
56956
|
+
function useFlushDebounce(func, additionalDeps = []) {
|
|
56957
|
+
const timeoutRef = s$1(null);
|
|
56958
|
+
const lastArgsRef = s$1(null);
|
|
56959
|
+
const config = useService$2('config', false);
|
|
56960
|
+
const debounce = config && config.debounce;
|
|
56961
|
+
const shouldDebounce = debounce !== false && debounce !== 0;
|
|
56962
|
+
const delay = typeof debounce === 'number' ? debounce : 300;
|
|
56963
|
+
const debounceFunc = A$1((...args) => {
|
|
56964
|
+
if (!shouldDebounce) {
|
|
56965
|
+
func(...args);
|
|
56966
|
+
return;
|
|
56967
|
+
}
|
|
56968
|
+
lastArgsRef.current = args;
|
|
56969
|
+
if (timeoutRef.current) {
|
|
56970
|
+
clearTimeout(timeoutRef.current);
|
|
56971
|
+
}
|
|
56972
|
+
timeoutRef.current = setTimeout(() => {
|
|
56973
|
+
func(...lastArgsRef.current);
|
|
56974
|
+
lastArgsRef.current = null;
|
|
56975
|
+
}, delay);
|
|
56976
|
+
}, [func, delay, shouldDebounce, ...additionalDeps]);
|
|
56977
|
+
const flushFunc = A$1(() => {
|
|
56978
|
+
if (timeoutRef.current) {
|
|
56979
|
+
clearTimeout(timeoutRef.current);
|
|
56980
|
+
if (lastArgsRef.current !== null) {
|
|
56981
|
+
func(...lastArgsRef.current);
|
|
56982
|
+
lastArgsRef.current = null;
|
|
56983
|
+
}
|
|
56984
|
+
timeoutRef.current = null;
|
|
56985
|
+
}
|
|
56986
|
+
}, [func, ...additionalDeps]);
|
|
56987
|
+
return [debounceFunc, flushFunc];
|
|
56988
|
+
}
|
|
56998
56989
|
const type$2 = 'textfield';
|
|
56999
56990
|
function Textfield$1(props) {
|
|
57000
56991
|
const {
|
|
@@ -57301,28 +57292,28 @@
|
|
|
57301
57292
|
var CaretRightIcon = SvgCaretRight;
|
|
57302
57293
|
const type = 'table';
|
|
57303
57294
|
|
|
57304
|
-
/**
|
|
57305
|
-
* @typedef {('asc'|'desc')} Direction
|
|
57306
|
-
*
|
|
57307
|
-
* @typedef Sorting
|
|
57308
|
-
* @property {string} key
|
|
57309
|
-
* @property {Direction} direction
|
|
57310
|
-
*
|
|
57311
|
-
* @typedef Column
|
|
57312
|
-
* @property {string} label
|
|
57313
|
-
* @property {string} key
|
|
57314
|
-
*
|
|
57315
|
-
* @typedef Props
|
|
57316
|
-
* @property {Object} field
|
|
57317
|
-
* @property {string} field.id
|
|
57318
|
-
* @property {Array<Column>} [field.columns]
|
|
57319
|
-
* @property {string} [field.columnsExpression]
|
|
57320
|
-
* @property {string} [field.label]
|
|
57321
|
-
* @property {number} [field.rowCount]
|
|
57322
|
-
* @property {string} [field.dataSource]
|
|
57323
|
-
*
|
|
57324
|
-
* @param {Props} props
|
|
57325
|
-
* @returns {import("preact").JSX.Element}
|
|
57295
|
+
/**
|
|
57296
|
+
* @typedef {('asc'|'desc')} Direction
|
|
57297
|
+
*
|
|
57298
|
+
* @typedef Sorting
|
|
57299
|
+
* @property {string} key
|
|
57300
|
+
* @property {Direction} direction
|
|
57301
|
+
*
|
|
57302
|
+
* @typedef Column
|
|
57303
|
+
* @property {string} label
|
|
57304
|
+
* @property {string} key
|
|
57305
|
+
*
|
|
57306
|
+
* @typedef Props
|
|
57307
|
+
* @property {Object} field
|
|
57308
|
+
* @property {string} field.id
|
|
57309
|
+
* @property {Array<Column>} [field.columns]
|
|
57310
|
+
* @property {string} [field.columnsExpression]
|
|
57311
|
+
* @property {string} [field.label]
|
|
57312
|
+
* @property {number} [field.rowCount]
|
|
57313
|
+
* @property {string} [field.dataSource]
|
|
57314
|
+
*
|
|
57315
|
+
* @param {Props} props
|
|
57316
|
+
* @returns {import("preact").JSX.Element}
|
|
57326
57317
|
*/
|
|
57327
57318
|
function Table(props) {
|
|
57328
57319
|
const {
|
|
@@ -57532,10 +57523,10 @@
|
|
|
57532
57523
|
|
|
57533
57524
|
// helpers /////////////////////////////
|
|
57534
57525
|
|
|
57535
|
-
/**
|
|
57536
|
-
* @param {string|void} columnsExpression
|
|
57537
|
-
* @param {Column[]} fallbackColumns
|
|
57538
|
-
* @returns {Column[]}
|
|
57526
|
+
/**
|
|
57527
|
+
* @param {string|void} columnsExpression
|
|
57528
|
+
* @param {Column[]} fallbackColumns
|
|
57529
|
+
* @returns {Column[]}
|
|
57539
57530
|
*/
|
|
57540
57531
|
function useEvaluatedColumns(columnsExpression, fallbackColumns) {
|
|
57541
57532
|
/** @type {Column[]|null} */
|
|
@@ -57543,18 +57534,18 @@
|
|
|
57543
57534
|
return Array.isArray(evaluation) && evaluation.every(isColumn) ? evaluation : fallbackColumns;
|
|
57544
57535
|
}
|
|
57545
57536
|
|
|
57546
|
-
/**
|
|
57547
|
-
* @param {any} column
|
|
57548
|
-
* @returns {column is Column}
|
|
57537
|
+
/**
|
|
57538
|
+
* @param {any} column
|
|
57539
|
+
* @returns {column is Column}
|
|
57549
57540
|
*/
|
|
57550
57541
|
function isColumn(column) {
|
|
57551
57542
|
return isObject$4(column) && isString$4(column['label']) && isString$4(column['key']);
|
|
57552
57543
|
}
|
|
57553
57544
|
|
|
57554
|
-
/**
|
|
57555
|
-
* @param {Array} array
|
|
57556
|
-
* @param {number} size
|
|
57557
|
-
* @returns {Array}
|
|
57545
|
+
/**
|
|
57546
|
+
* @param {Array} array
|
|
57547
|
+
* @param {number} size
|
|
57548
|
+
* @returns {Array}
|
|
57558
57549
|
*/
|
|
57559
57550
|
function chunk(array, size) {
|
|
57560
57551
|
return array.reduce((chunks, item, index) => {
|
|
@@ -57567,11 +57558,11 @@
|
|
|
57567
57558
|
}, []);
|
|
57568
57559
|
}
|
|
57569
57560
|
|
|
57570
|
-
/**
|
|
57571
|
-
* @param {unknown[]} array
|
|
57572
|
-
* @param {string} key
|
|
57573
|
-
* @param {Direction} direction
|
|
57574
|
-
* @returns {unknown[]}
|
|
57561
|
+
/**
|
|
57562
|
+
* @param {unknown[]} array
|
|
57563
|
+
* @param {string} key
|
|
57564
|
+
* @param {Direction} direction
|
|
57565
|
+
* @returns {unknown[]}
|
|
57575
57566
|
*/
|
|
57576
57567
|
function sortByColumn(array, key, direction) {
|
|
57577
57568
|
return [...array].sort((a, b) => {
|
|
@@ -57585,10 +57576,10 @@
|
|
|
57585
57576
|
});
|
|
57586
57577
|
}
|
|
57587
57578
|
|
|
57588
|
-
/**
|
|
57589
|
-
* @param {null|Sorting} sortBy
|
|
57590
|
-
* @param {string} key
|
|
57591
|
-
* @param {string} label
|
|
57579
|
+
/**
|
|
57580
|
+
* @param {null|Sorting} sortBy
|
|
57581
|
+
* @param {string} key
|
|
57582
|
+
* @param {string} label
|
|
57592
57583
|
*/
|
|
57593
57584
|
function getHeaderAriaLabel(sortBy, key, label) {
|
|
57594
57585
|
if (sortBy === null || sortBy.key !== key) {
|
|
@@ -58187,37 +58178,37 @@
|
|
|
58187
58178
|
const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression', 'url', 'dataSource', 'columnsExpression'];
|
|
58188
58179
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'url'];
|
|
58189
58180
|
|
|
58190
|
-
/**
|
|
58191
|
-
* @typedef { import('../types').Schema } Schema
|
|
58181
|
+
/**
|
|
58182
|
+
* @typedef { import('../types').Schema } Schema
|
|
58192
58183
|
*/
|
|
58193
58184
|
|
|
58194
|
-
/**
|
|
58195
|
-
* Parse the schema for variables a form might make use of.
|
|
58196
|
-
*
|
|
58197
|
-
* @example
|
|
58198
|
-
*
|
|
58199
|
-
* // retrieve variables from schema
|
|
58200
|
-
* const variables = getSchemaVariables(schema);
|
|
58201
|
-
*
|
|
58202
|
-
* @example
|
|
58203
|
-
*
|
|
58204
|
-
* // retrieve input variables from schema
|
|
58205
|
-
* const inputVariables = getSchemaVariables(schema, { outputs: false });
|
|
58206
|
-
*
|
|
58207
|
-
* @example
|
|
58208
|
-
*
|
|
58209
|
-
* // retrieve output variables from schema
|
|
58210
|
-
* const outputVariables = getSchemaVariables(schema, { inputs: false });
|
|
58211
|
-
*
|
|
58212
|
-
* @param {Schema} schema
|
|
58213
|
-
* @param {object} [options]
|
|
58214
|
-
* @param {any} [options.expressionLanguage]
|
|
58215
|
-
* @param {any} [options.templating]
|
|
58216
|
-
* @param {any} [options.formFields]
|
|
58217
|
-
* @param {boolean} [options.inputs=true]
|
|
58218
|
-
* @param {boolean} [options.outputs=true]
|
|
58219
|
-
*
|
|
58220
|
-
* @return {string[]}
|
|
58185
|
+
/**
|
|
58186
|
+
* Parse the schema for variables a form might make use of.
|
|
58187
|
+
*
|
|
58188
|
+
* @example
|
|
58189
|
+
*
|
|
58190
|
+
* // retrieve variables from schema
|
|
58191
|
+
* const variables = getSchemaVariables(schema);
|
|
58192
|
+
*
|
|
58193
|
+
* @example
|
|
58194
|
+
*
|
|
58195
|
+
* // retrieve input variables from schema
|
|
58196
|
+
* const inputVariables = getSchemaVariables(schema, { outputs: false });
|
|
58197
|
+
*
|
|
58198
|
+
* @example
|
|
58199
|
+
*
|
|
58200
|
+
* // retrieve output variables from schema
|
|
58201
|
+
* const outputVariables = getSchemaVariables(schema, { inputs: false });
|
|
58202
|
+
*
|
|
58203
|
+
* @param {Schema} schema
|
|
58204
|
+
* @param {object} [options]
|
|
58205
|
+
* @param {any} [options.expressionLanguage]
|
|
58206
|
+
* @param {any} [options.templating]
|
|
58207
|
+
* @param {any} [options.formFields]
|
|
58208
|
+
* @param {boolean} [options.inputs=true]
|
|
58209
|
+
* @param {boolean} [options.outputs=true]
|
|
58210
|
+
*
|
|
58211
|
+
* @return {string[]}
|
|
58221
58212
|
*/
|
|
58222
58213
|
function getSchemaVariables(schema, options = {}) {
|
|
58223
58214
|
const {
|
|
@@ -58293,13 +58284,13 @@
|
|
|
58293
58284
|
return Array.from(new Set(variables));
|
|
58294
58285
|
}
|
|
58295
58286
|
|
|
58296
|
-
/**
|
|
58297
|
-
* Get the ancestry list of a form field.
|
|
58298
|
-
*
|
|
58299
|
-
* @param {string} formFieldId
|
|
58300
|
-
* @param {import('../core/FormFieldRegistry').default} formFieldRegistry
|
|
58301
|
-
*
|
|
58302
|
-
* @return {Array<string>} ancestry list
|
|
58287
|
+
/**
|
|
58288
|
+
* Get the ancestry list of a form field.
|
|
58289
|
+
*
|
|
58290
|
+
* @param {string} formFieldId
|
|
58291
|
+
* @param {import('../core/FormFieldRegistry').default} formFieldRegistry
|
|
58292
|
+
*
|
|
58293
|
+
* @return {Array<string>} ancestry list
|
|
58303
58294
|
*/
|
|
58304
58295
|
const getAncestryList = (formFieldId, formFieldRegistry) => {
|
|
58305
58296
|
const ids = [];
|
|
@@ -58311,9 +58302,9 @@
|
|
|
58311
58302
|
return ids;
|
|
58312
58303
|
};
|
|
58313
58304
|
|
|
58314
|
-
/**
|
|
58315
|
-
* @typedef {object} Condition
|
|
58316
|
-
* @property {string} [hide]
|
|
58305
|
+
/**
|
|
58306
|
+
* @typedef {object} Condition
|
|
58307
|
+
* @property {string} [hide]
|
|
58317
58308
|
*/
|
|
58318
58309
|
|
|
58319
58310
|
class ConditionChecker {
|
|
@@ -58323,14 +58314,14 @@
|
|
|
58323
58314
|
this._eventBus = eventBus;
|
|
58324
58315
|
}
|
|
58325
58316
|
|
|
58326
|
-
/**
|
|
58327
|
-
* For given data, remove properties based on condition.
|
|
58328
|
-
*
|
|
58329
|
-
* @param {Object<string, any>} data
|
|
58330
|
-
* @param {Object<string, any>} contextData
|
|
58331
|
-
* @param {Object} [options]
|
|
58332
|
-
* @param {Function} [options.getFilterPath]
|
|
58333
|
-
* @param {boolean} [options.leafNodeDeletionOnly]
|
|
58317
|
+
/**
|
|
58318
|
+
* For given data, remove properties based on condition.
|
|
58319
|
+
*
|
|
58320
|
+
* @param {Object<string, any>} data
|
|
58321
|
+
* @param {Object<string, any>} contextData
|
|
58322
|
+
* @param {Object} [options]
|
|
58323
|
+
* @param {Function} [options.getFilterPath]
|
|
58324
|
+
* @param {boolean} [options.leafNodeDeletionOnly]
|
|
58334
58325
|
*/
|
|
58335
58326
|
applyConditions(data, contextData = {}, options = {}) {
|
|
58336
58327
|
const workingData = clone(data);
|
|
@@ -58424,13 +58415,13 @@
|
|
|
58424
58415
|
return workingData;
|
|
58425
58416
|
}
|
|
58426
58417
|
|
|
58427
|
-
/**
|
|
58428
|
-
* Check if given condition is met. Returns null for invalid/missing conditions.
|
|
58429
|
-
*
|
|
58430
|
-
* @param {string} condition
|
|
58431
|
-
* @param {import('../../types').Data} [data]
|
|
58432
|
-
*
|
|
58433
|
-
* @returns {boolean|null}
|
|
58418
|
+
/**
|
|
58419
|
+
* Check if given condition is met. Returns null for invalid/missing conditions.
|
|
58420
|
+
*
|
|
58421
|
+
* @param {string} condition
|
|
58422
|
+
* @param {import('../../types').Data} [data]
|
|
58423
|
+
*
|
|
58424
|
+
* @returns {boolean|null}
|
|
58434
58425
|
*/
|
|
58435
58426
|
check(condition, data = {}) {
|
|
58436
58427
|
if (!condition) {
|
|
@@ -58451,12 +58442,12 @@
|
|
|
58451
58442
|
}
|
|
58452
58443
|
}
|
|
58453
58444
|
|
|
58454
|
-
/**
|
|
58455
|
-
* Check if hide condition is met.
|
|
58456
|
-
*
|
|
58457
|
-
* @param {Condition} condition
|
|
58458
|
-
* @param {Object<string, any>} data
|
|
58459
|
-
* @returns {boolean}
|
|
58445
|
+
/**
|
|
58446
|
+
* Check if hide condition is met.
|
|
58447
|
+
*
|
|
58448
|
+
* @param {Condition} condition
|
|
58449
|
+
* @param {Object<string, any>} data
|
|
58450
|
+
* @returns {boolean}
|
|
58460
58451
|
*/
|
|
58461
58452
|
_checkHideCondition(condition, data) {
|
|
58462
58453
|
if (!condition.hide) {
|
|
@@ -58497,12 +58488,12 @@
|
|
|
58497
58488
|
this._converter = new showdown.Converter();
|
|
58498
58489
|
}
|
|
58499
58490
|
|
|
58500
|
-
/**
|
|
58501
|
-
* Render markdown to HTML.
|
|
58502
|
-
*
|
|
58503
|
-
* @param {string} markdown - The markdown to render
|
|
58504
|
-
*
|
|
58505
|
-
* @returns {string} HTML
|
|
58491
|
+
/**
|
|
58492
|
+
* Render markdown to HTML.
|
|
58493
|
+
*
|
|
58494
|
+
* @param {string} markdown - The markdown to render
|
|
58495
|
+
*
|
|
58496
|
+
* @returns {string} HTML
|
|
58506
58497
|
*/
|
|
58507
58498
|
render(markdown) {
|
|
58508
58499
|
return this._converter.makeHtml(markdown);
|
|
@@ -59167,11 +59158,11 @@
|
|
|
59167
59158
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
59168
59159
|
}
|
|
59169
59160
|
|
|
59170
|
-
/**
|
|
59171
|
-
* Checks whether a field is currently repeating its children.
|
|
59172
|
-
*
|
|
59173
|
-
* @param {string} id - The id of the field to check
|
|
59174
|
-
* @returns {boolean} - True if repeatable, false otherwise
|
|
59161
|
+
/**
|
|
59162
|
+
* Checks whether a field is currently repeating its children.
|
|
59163
|
+
*
|
|
59164
|
+
* @param {string} id - The id of the field to check
|
|
59165
|
+
* @returns {boolean} - True if repeatable, false otherwise
|
|
59175
59166
|
*/
|
|
59176
59167
|
isFieldRepeating(id) {
|
|
59177
59168
|
if (!id) {
|
|
@@ -59928,8 +59919,8 @@
|
|
|
59928
59919
|
|
|
59929
59920
|
// helpers //////////
|
|
59930
59921
|
|
|
59931
|
-
/**
|
|
59932
|
-
* Helper function to evaluate optional FEEL validation values.
|
|
59922
|
+
/**
|
|
59923
|
+
* Helper function to evaluate optional FEEL validation values.
|
|
59933
59924
|
*/
|
|
59934
59925
|
function evaluateFEELValues(validate, expressionLanguage, conditionChecker, form) {
|
|
59935
59926
|
const evaluatedValidate = {
|
|
@@ -59962,12 +59953,12 @@
|
|
|
59962
59953
|
return evaluatedValidate;
|
|
59963
59954
|
}
|
|
59964
59955
|
class Importer {
|
|
59965
|
-
/**
|
|
59966
|
-
* @constructor
|
|
59967
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
59968
|
-
* @param { import('./PathRegistry').default } pathRegistry
|
|
59969
|
-
* @param { import('./FieldFactory').default } fieldFactory
|
|
59970
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
59956
|
+
/**
|
|
59957
|
+
* @constructor
|
|
59958
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
59959
|
+
* @param { import('./PathRegistry').default } pathRegistry
|
|
59960
|
+
* @param { import('./FieldFactory').default } fieldFactory
|
|
59961
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
59971
59962
|
*/
|
|
59972
59963
|
constructor(formFieldRegistry, pathRegistry, fieldFactory, formLayouter) {
|
|
59973
59964
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -59976,21 +59967,21 @@
|
|
|
59976
59967
|
this._formLayouter = formLayouter;
|
|
59977
59968
|
}
|
|
59978
59969
|
|
|
59979
|
-
/**
|
|
59980
|
-
* Import schema creating rows, fields, attaching additional
|
|
59981
|
-
* information to each field and adding fields to the
|
|
59982
|
-
* field registry.
|
|
59983
|
-
*
|
|
59984
|
-
* Additional information attached:
|
|
59985
|
-
*
|
|
59986
|
-
* * `id` (unless present)
|
|
59987
|
-
* * `_parent`
|
|
59988
|
-
* * `_path`
|
|
59989
|
-
*
|
|
59990
|
-
* @param {any} schema
|
|
59991
|
-
*
|
|
59992
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
59993
|
-
* @returns {ImportResult}
|
|
59970
|
+
/**
|
|
59971
|
+
* Import schema creating rows, fields, attaching additional
|
|
59972
|
+
* information to each field and adding fields to the
|
|
59973
|
+
* field registry.
|
|
59974
|
+
*
|
|
59975
|
+
* Additional information attached:
|
|
59976
|
+
*
|
|
59977
|
+
* * `id` (unless present)
|
|
59978
|
+
* * `_parent`
|
|
59979
|
+
* * `_path`
|
|
59980
|
+
*
|
|
59981
|
+
* @param {any} schema
|
|
59982
|
+
*
|
|
59983
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
59984
|
+
* @returns {ImportResult}
|
|
59994
59985
|
*/
|
|
59995
59986
|
importSchema(schema) {
|
|
59996
59987
|
// TODO: Add warnings
|
|
@@ -60015,12 +60006,12 @@
|
|
|
60015
60006
|
this._pathRegistry.clear();
|
|
60016
60007
|
}
|
|
60017
60008
|
|
|
60018
|
-
/**
|
|
60019
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
60020
|
-
* @param {String} [parentId]
|
|
60021
|
-
* @param {number} [index]
|
|
60022
|
-
*
|
|
60023
|
-
* @return {any} field
|
|
60009
|
+
/**
|
|
60010
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
60011
|
+
* @param {String} [parentId]
|
|
60012
|
+
* @param {number} [index]
|
|
60013
|
+
*
|
|
60014
|
+
* @return {any} field
|
|
60024
60015
|
*/
|
|
60025
60016
|
importFormField(fieldAttrs, parentId, index) {
|
|
60026
60017
|
const {
|
|
@@ -60045,11 +60036,11 @@
|
|
|
60045
60036
|
return field;
|
|
60046
60037
|
}
|
|
60047
60038
|
|
|
60048
|
-
/**
|
|
60049
|
-
* @param {Array<any>} components
|
|
60050
|
-
* @param {string} parentId
|
|
60051
|
-
*
|
|
60052
|
-
* @return {Array<any>} imported components
|
|
60039
|
+
/**
|
|
60040
|
+
* @param {Array<any>} components
|
|
60041
|
+
* @param {string} parentId
|
|
60042
|
+
*
|
|
60043
|
+
* @return {Array<any>} imported components
|
|
60053
60044
|
*/
|
|
60054
60045
|
importFormFields(components, parentId) {
|
|
60055
60046
|
return components.map((component, index) => {
|
|
@@ -60059,11 +60050,11 @@
|
|
|
60059
60050
|
}
|
|
60060
60051
|
Importer.$inject = ['formFieldRegistry', 'pathRegistry', 'fieldFactory', 'formLayouter'];
|
|
60061
60052
|
class FieldFactory {
|
|
60062
|
-
/**
|
|
60063
|
-
* @constructor
|
|
60064
|
-
*
|
|
60065
|
-
* @param formFieldRegistry
|
|
60066
|
-
* @param formFields
|
|
60053
|
+
/**
|
|
60054
|
+
* @constructor
|
|
60055
|
+
*
|
|
60056
|
+
* @param formFieldRegistry
|
|
60057
|
+
* @param formFields
|
|
60067
60058
|
*/
|
|
60068
60059
|
constructor(formFieldRegistry, pathRegistry, formFields) {
|
|
60069
60060
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -60173,36 +60164,36 @@
|
|
|
60173
60164
|
}
|
|
60174
60165
|
FieldFactory.$inject = ['formFieldRegistry', 'pathRegistry', 'formFields'];
|
|
60175
60166
|
|
|
60176
|
-
/**
|
|
60177
|
-
* The PathRegistry class manages a hierarchical structure of paths associated with form fields.
|
|
60178
|
-
* It enables claiming, unclaiming, and validating paths within this structure.
|
|
60179
|
-
*
|
|
60180
|
-
* Example Tree Structure:
|
|
60181
|
-
*
|
|
60182
|
-
* [
|
|
60183
|
-
* {
|
|
60184
|
-
* segment: 'root',
|
|
60185
|
-
* claimCount: 1,
|
|
60186
|
-
* children: [
|
|
60187
|
-
* {
|
|
60188
|
-
* segment: 'child1',
|
|
60189
|
-
* claimCount: 2,
|
|
60190
|
-
* children: null // A leaf node (closed path)
|
|
60191
|
-
* },
|
|
60192
|
-
* {
|
|
60193
|
-
* segment: 'child2',
|
|
60194
|
-
* claimCount: 1,
|
|
60195
|
-
* children: [
|
|
60196
|
-
* {
|
|
60197
|
-
* segment: 'subChild1',
|
|
60198
|
-
* claimCount: 1,
|
|
60199
|
-
* children: [] // An open node (open path)
|
|
60200
|
-
* }
|
|
60201
|
-
* ]
|
|
60202
|
-
* }
|
|
60203
|
-
* ]
|
|
60204
|
-
* }
|
|
60205
|
-
* ]
|
|
60167
|
+
/**
|
|
60168
|
+
* The PathRegistry class manages a hierarchical structure of paths associated with form fields.
|
|
60169
|
+
* It enables claiming, unclaiming, and validating paths within this structure.
|
|
60170
|
+
*
|
|
60171
|
+
* Example Tree Structure:
|
|
60172
|
+
*
|
|
60173
|
+
* [
|
|
60174
|
+
* {
|
|
60175
|
+
* segment: 'root',
|
|
60176
|
+
* claimCount: 1,
|
|
60177
|
+
* children: [
|
|
60178
|
+
* {
|
|
60179
|
+
* segment: 'child1',
|
|
60180
|
+
* claimCount: 2,
|
|
60181
|
+
* children: null // A leaf node (closed path)
|
|
60182
|
+
* },
|
|
60183
|
+
* {
|
|
60184
|
+
* segment: 'child2',
|
|
60185
|
+
* claimCount: 1,
|
|
60186
|
+
* children: [
|
|
60187
|
+
* {
|
|
60188
|
+
* segment: 'subChild1',
|
|
60189
|
+
* claimCount: 1,
|
|
60190
|
+
* children: [] // An open node (open path)
|
|
60191
|
+
* }
|
|
60192
|
+
* ]
|
|
60193
|
+
* }
|
|
60194
|
+
* ]
|
|
60195
|
+
* }
|
|
60196
|
+
* ]
|
|
60206
60197
|
*/
|
|
60207
60198
|
class PathRegistry {
|
|
60208
60199
|
constructor(formFieldRegistry, formFields, injector) {
|
|
@@ -60318,16 +60309,16 @@
|
|
|
60318
60309
|
}
|
|
60319
60310
|
}
|
|
60320
60311
|
|
|
60321
|
-
/**
|
|
60322
|
-
* Applies a function (fn) recursively on a given field and its children.
|
|
60323
|
-
*
|
|
60324
|
-
* - `field`: Starting field object.
|
|
60325
|
-
* - `fn`: Function to apply.
|
|
60326
|
-
* - `context`: Optional object for passing data between calls.
|
|
60327
|
-
*
|
|
60328
|
-
* Stops early if `fn` returns `false`. Useful for traversing the form field tree.
|
|
60329
|
-
*
|
|
60330
|
-
* @returns {boolean} Success status based on function execution.
|
|
60312
|
+
/**
|
|
60313
|
+
* Applies a function (fn) recursively on a given field and its children.
|
|
60314
|
+
*
|
|
60315
|
+
* - `field`: Starting field object.
|
|
60316
|
+
* - `fn`: Function to apply.
|
|
60317
|
+
* - `context`: Optional object for passing data between calls.
|
|
60318
|
+
*
|
|
60319
|
+
* Stops early if `fn` returns `false`. Useful for traversing the form field tree.
|
|
60320
|
+
*
|
|
60321
|
+
* @returns {boolean} Success status based on function execution.
|
|
60331
60322
|
*/
|
|
60332
60323
|
executeRecursivelyOnFields(field, fn, context = {}) {
|
|
60333
60324
|
let result = true;
|
|
@@ -60368,16 +60359,16 @@
|
|
|
60368
60359
|
return result;
|
|
60369
60360
|
}
|
|
60370
60361
|
|
|
60371
|
-
/**
|
|
60372
|
-
* Generates an array representing the binding path to an underlying data object for a form field.
|
|
60373
|
-
*
|
|
60374
|
-
* @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
|
|
60375
|
-
* @param {Object} [options={}] - Configuration options.
|
|
60376
|
-
* @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
|
|
60377
|
-
* @param {Object} [options.indexes=null] - A map of parent IDs to the index of the field within said parent, leave null to get an unindexed path.
|
|
60378
|
-
* @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
|
|
60379
|
-
*
|
|
60380
|
-
* @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
|
|
60362
|
+
/**
|
|
60363
|
+
* Generates an array representing the binding path to an underlying data object for a form field.
|
|
60364
|
+
*
|
|
60365
|
+
* @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
|
|
60366
|
+
* @param {Object} [options={}] - Configuration options.
|
|
60367
|
+
* @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
|
|
60368
|
+
* @param {Object} [options.indexes=null] - A map of parent IDs to the index of the field within said parent, leave null to get an unindexed path.
|
|
60369
|
+
* @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
|
|
60370
|
+
*
|
|
60371
|
+
* @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
|
|
60381
60372
|
*/
|
|
60382
60373
|
getValuePath(field, options = {}) {
|
|
60383
60374
|
const {
|
|
@@ -60438,23 +60429,23 @@
|
|
|
60438
60429
|
};
|
|
60439
60430
|
PathRegistry.$inject = ['formFieldRegistry', 'formFields', 'injector'];
|
|
60440
60431
|
|
|
60441
|
-
/**
|
|
60442
|
-
* @typedef { { id: String, components: Array<String> } } FormRow
|
|
60443
|
-
* @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
|
|
60432
|
+
/**
|
|
60433
|
+
* @typedef { { id: String, components: Array<String> } } FormRow
|
|
60434
|
+
* @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
|
|
60444
60435
|
*/
|
|
60445
60436
|
|
|
60446
|
-
/**
|
|
60447
|
-
* Maintains the Form layout in a given structure, for example
|
|
60448
|
-
*
|
|
60449
|
-
* [
|
|
60450
|
-
* {
|
|
60451
|
-
* formFieldId: 'FormField_1',
|
|
60452
|
-
* rows: [
|
|
60453
|
-
* { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
|
|
60454
|
-
* ]
|
|
60455
|
-
* }
|
|
60456
|
-
* ]
|
|
60457
|
-
*
|
|
60437
|
+
/**
|
|
60438
|
+
* Maintains the Form layout in a given structure, for example
|
|
60439
|
+
*
|
|
60440
|
+
* [
|
|
60441
|
+
* {
|
|
60442
|
+
* formFieldId: 'FormField_1',
|
|
60443
|
+
* rows: [
|
|
60444
|
+
* { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
|
|
60445
|
+
* ]
|
|
60446
|
+
* }
|
|
60447
|
+
* ]
|
|
60448
|
+
*
|
|
60458
60449
|
*/
|
|
60459
60450
|
class FormLayouter {
|
|
60460
60451
|
constructor(eventBus) {
|
|
@@ -60464,8 +60455,8 @@
|
|
|
60464
60455
|
this._eventBus = eventBus;
|
|
60465
60456
|
}
|
|
60466
60457
|
|
|
60467
|
-
/**
|
|
60468
|
-
* @param {FormRow} row
|
|
60458
|
+
/**
|
|
60459
|
+
* @param {FormRow} row
|
|
60469
60460
|
*/
|
|
60470
60461
|
addRow(formFieldId, row) {
|
|
60471
60462
|
let rowsPerComponent = this._rows.find(r => r.formFieldId === formFieldId);
|
|
@@ -60479,18 +60470,18 @@
|
|
|
60479
60470
|
rowsPerComponent.rows.push(row);
|
|
60480
60471
|
}
|
|
60481
60472
|
|
|
60482
|
-
/**
|
|
60483
|
-
* @param {String} id
|
|
60484
|
-
* @returns {FormRow}
|
|
60473
|
+
/**
|
|
60474
|
+
* @param {String} id
|
|
60475
|
+
* @returns {FormRow}
|
|
60485
60476
|
*/
|
|
60486
60477
|
getRow(id) {
|
|
60487
60478
|
const rows = allRows(this._rows);
|
|
60488
60479
|
return rows.find(r => r.id === id);
|
|
60489
60480
|
}
|
|
60490
60481
|
|
|
60491
|
-
/**
|
|
60492
|
-
* @param {any} formField
|
|
60493
|
-
* @returns {FormRow}
|
|
60482
|
+
/**
|
|
60483
|
+
* @param {any} formField
|
|
60484
|
+
* @returns {FormRow}
|
|
60494
60485
|
*/
|
|
60495
60486
|
getRowForField(formField) {
|
|
60496
60487
|
return allRows(this._rows).find(r => {
|
|
@@ -60501,9 +60492,9 @@
|
|
|
60501
60492
|
});
|
|
60502
60493
|
}
|
|
60503
60494
|
|
|
60504
|
-
/**
|
|
60505
|
-
* @param {String} formFieldId
|
|
60506
|
-
* @returns { Array<FormRow> }
|
|
60495
|
+
/**
|
|
60496
|
+
* @param {String} formFieldId
|
|
60497
|
+
* @returns { Array<FormRow> }
|
|
60507
60498
|
*/
|
|
60508
60499
|
getRows(formFieldId) {
|
|
60509
60500
|
const rowsForField = this._rows.find(r => formFieldId === r.formFieldId);
|
|
@@ -60513,15 +60504,15 @@
|
|
|
60513
60504
|
return rowsForField.rows;
|
|
60514
60505
|
}
|
|
60515
60506
|
|
|
60516
|
-
/**
|
|
60517
|
-
* @returns {string}
|
|
60507
|
+
/**
|
|
60508
|
+
* @returns {string}
|
|
60518
60509
|
*/
|
|
60519
60510
|
nextRowId() {
|
|
60520
60511
|
return this._ids.nextPrefixed('Row_');
|
|
60521
60512
|
}
|
|
60522
60513
|
|
|
60523
|
-
/**
|
|
60524
|
-
* @param {any} formField
|
|
60514
|
+
/**
|
|
60515
|
+
* @param {any} formField
|
|
60525
60516
|
*/
|
|
60526
60517
|
calculateLayout(formField) {
|
|
60527
60518
|
const {
|
|
@@ -60575,9 +60566,9 @@
|
|
|
60575
60566
|
});
|
|
60576
60567
|
}
|
|
60577
60568
|
|
|
60578
|
-
/**
|
|
60579
|
-
* @param {Array<FormRows>} formRows
|
|
60580
|
-
* @returns {Array<FormRow>}
|
|
60569
|
+
/**
|
|
60570
|
+
* @param {Array<FormRows>} formRows
|
|
60571
|
+
* @returns {Array<FormRow>}
|
|
60581
60572
|
*/
|
|
60582
60573
|
function allRows(formRows) {
|
|
60583
60574
|
return flatten$3(formRows.map(c => c.rows));
|
|
@@ -60698,55 +60689,55 @@
|
|
|
60698
60689
|
validator: ['type', Validator]
|
|
60699
60690
|
};
|
|
60700
60691
|
|
|
60701
|
-
/**
|
|
60702
|
-
* @typedef { import('./types').Injector } Injector
|
|
60703
|
-
* @typedef { import('./types').Data } Data
|
|
60704
|
-
* @typedef { import('./types').Errors } Errors
|
|
60705
|
-
* @typedef { import('./types').Schema } Schema
|
|
60706
|
-
* @typedef { import('./types').FormProperties } FormProperties
|
|
60707
|
-
* @typedef { import('./types').FormProperty } FormProperty
|
|
60708
|
-
* @typedef { import('./types').FormEvent } FormEvent
|
|
60709
|
-
* @typedef { import('./types').FormOptions } FormOptions
|
|
60710
|
-
*
|
|
60711
|
-
* @typedef { {
|
|
60712
|
-
* data: Data,
|
|
60713
|
-
* initialData: Data,
|
|
60714
|
-
* errors: Errors,
|
|
60715
|
-
* properties: FormProperties,
|
|
60716
|
-
* schema: Schema
|
|
60717
|
-
* } } State
|
|
60718
|
-
*
|
|
60719
|
-
* @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
|
|
60720
|
-
* @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
|
|
60721
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
60692
|
+
/**
|
|
60693
|
+
* @typedef { import('./types').Injector } Injector
|
|
60694
|
+
* @typedef { import('./types').Data } Data
|
|
60695
|
+
* @typedef { import('./types').Errors } Errors
|
|
60696
|
+
* @typedef { import('./types').Schema } Schema
|
|
60697
|
+
* @typedef { import('./types').FormProperties } FormProperties
|
|
60698
|
+
* @typedef { import('./types').FormProperty } FormProperty
|
|
60699
|
+
* @typedef { import('./types').FormEvent } FormEvent
|
|
60700
|
+
* @typedef { import('./types').FormOptions } FormOptions
|
|
60701
|
+
*
|
|
60702
|
+
* @typedef { {
|
|
60703
|
+
* data: Data,
|
|
60704
|
+
* initialData: Data,
|
|
60705
|
+
* errors: Errors,
|
|
60706
|
+
* properties: FormProperties,
|
|
60707
|
+
* schema: Schema
|
|
60708
|
+
* } } State
|
|
60709
|
+
*
|
|
60710
|
+
* @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
|
|
60711
|
+
* @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
|
|
60712
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
60722
60713
|
*/
|
|
60723
60714
|
|
|
60724
60715
|
const ids$1 = new Ids([32, 36, 1]);
|
|
60725
60716
|
|
|
60726
|
-
/**
|
|
60727
|
-
* The form.
|
|
60717
|
+
/**
|
|
60718
|
+
* The form.
|
|
60728
60719
|
*/
|
|
60729
60720
|
class Form {
|
|
60730
|
-
/**
|
|
60731
|
-
* @constructor
|
|
60732
|
-
* @param {FormOptions} options
|
|
60721
|
+
/**
|
|
60722
|
+
* @constructor
|
|
60723
|
+
* @param {FormOptions} options
|
|
60733
60724
|
*/
|
|
60734
60725
|
constructor(options = {}) {
|
|
60735
|
-
/**
|
|
60736
|
-
* @public
|
|
60737
|
-
* @type {OnEventType}
|
|
60726
|
+
/**
|
|
60727
|
+
* @public
|
|
60728
|
+
* @type {OnEventType}
|
|
60738
60729
|
*/
|
|
60739
60730
|
this.on = this._onEvent;
|
|
60740
60731
|
|
|
60741
|
-
/**
|
|
60742
|
-
* @public
|
|
60743
|
-
* @type {String}
|
|
60732
|
+
/**
|
|
60733
|
+
* @public
|
|
60734
|
+
* @type {String}
|
|
60744
60735
|
*/
|
|
60745
60736
|
this._id = ids$1.next();
|
|
60746
60737
|
|
|
60747
|
-
/**
|
|
60748
|
-
* @private
|
|
60749
|
-
* @type {Element}
|
|
60738
|
+
/**
|
|
60739
|
+
* @private
|
|
60740
|
+
* @type {Element}
|
|
60750
60741
|
*/
|
|
60751
60742
|
this._container = createFormContainer();
|
|
60752
60743
|
const {
|
|
@@ -60755,9 +60746,9 @@
|
|
|
60755
60746
|
properties = {}
|
|
60756
60747
|
} = options;
|
|
60757
60748
|
|
|
60758
|
-
/**
|
|
60759
|
-
* @private
|
|
60760
|
-
* @type {State}
|
|
60749
|
+
/**
|
|
60750
|
+
* @private
|
|
60751
|
+
* @type {State}
|
|
60761
60752
|
*/
|
|
60762
60753
|
this._state = {
|
|
60763
60754
|
initialData: null,
|
|
@@ -60781,9 +60772,9 @@
|
|
|
60781
60772
|
this._emit('form.clear');
|
|
60782
60773
|
}
|
|
60783
60774
|
|
|
60784
|
-
/**
|
|
60785
|
-
* Destroy the form, removing it from DOM,
|
|
60786
|
-
* if attached.
|
|
60775
|
+
/**
|
|
60776
|
+
* Destroy the form, removing it from DOM,
|
|
60777
|
+
* if attached.
|
|
60787
60778
|
*/
|
|
60788
60779
|
destroy() {
|
|
60789
60780
|
// destroy form services
|
|
@@ -60794,13 +60785,13 @@
|
|
|
60794
60785
|
this._detach(false);
|
|
60795
60786
|
}
|
|
60796
60787
|
|
|
60797
|
-
/**
|
|
60798
|
-
* Open a form schema with the given initial data.
|
|
60799
|
-
*
|
|
60800
|
-
* @param {Schema} schema
|
|
60801
|
-
* @param {Data} [data]
|
|
60802
|
-
*
|
|
60803
|
-
* @return Promise<{ warnings: Array<any> }>
|
|
60788
|
+
/**
|
|
60789
|
+
* Open a form schema with the given initial data.
|
|
60790
|
+
*
|
|
60791
|
+
* @param {Schema} schema
|
|
60792
|
+
* @param {Data} [data]
|
|
60793
|
+
*
|
|
60794
|
+
* @return Promise<{ warnings: Array<any> }>
|
|
60804
60795
|
*/
|
|
60805
60796
|
importSchema(schema, data = {}) {
|
|
60806
60797
|
return new Promise((resolve, reject) => {
|
|
@@ -60833,10 +60824,10 @@
|
|
|
60833
60824
|
});
|
|
60834
60825
|
}
|
|
60835
60826
|
|
|
60836
|
-
/**
|
|
60837
|
-
* Submit the form, triggering all field validations.
|
|
60838
|
-
*
|
|
60839
|
-
* @returns { { data: Data, errors: Errors } }
|
|
60827
|
+
/**
|
|
60828
|
+
* Submit the form, triggering all field validations.
|
|
60829
|
+
*
|
|
60830
|
+
* @returns { { data: Data, errors: Errors } }
|
|
60840
60831
|
*/
|
|
60841
60832
|
submit() {
|
|
60842
60833
|
const {
|
|
@@ -60862,8 +60853,8 @@
|
|
|
60862
60853
|
});
|
|
60863
60854
|
}
|
|
60864
60855
|
|
|
60865
|
-
/**
|
|
60866
|
-
* @returns {Errors}
|
|
60856
|
+
/**
|
|
60857
|
+
* @returns {Errors}
|
|
60867
60858
|
*/
|
|
60868
60859
|
validate() {
|
|
60869
60860
|
const formFields = this.get('formFields'),
|
|
@@ -60935,8 +60926,8 @@
|
|
|
60935
60926
|
return filteredErrors;
|
|
60936
60927
|
}
|
|
60937
60928
|
|
|
60938
|
-
/**
|
|
60939
|
-
* @param {Element|string} parentNode
|
|
60929
|
+
/**
|
|
60930
|
+
* @param {Element|string} parentNode
|
|
60940
60931
|
*/
|
|
60941
60932
|
attachTo(parentNode) {
|
|
60942
60933
|
if (!parentNode) {
|
|
@@ -60954,10 +60945,10 @@
|
|
|
60954
60945
|
this._detach();
|
|
60955
60946
|
}
|
|
60956
60947
|
|
|
60957
|
-
/**
|
|
60958
|
-
* @private
|
|
60959
|
-
*
|
|
60960
|
-
* @param {boolean} [emit]
|
|
60948
|
+
/**
|
|
60949
|
+
* @private
|
|
60950
|
+
*
|
|
60951
|
+
* @param {boolean} [emit]
|
|
60961
60952
|
*/
|
|
60962
60953
|
_detach(emit = true) {
|
|
60963
60954
|
const container = this._container,
|
|
@@ -60971,9 +60962,9 @@
|
|
|
60971
60962
|
parentNode.removeChild(container);
|
|
60972
60963
|
}
|
|
60973
60964
|
|
|
60974
|
-
/**
|
|
60975
|
-
* @param {FormProperty} property
|
|
60976
|
-
* @param {any} value
|
|
60965
|
+
/**
|
|
60966
|
+
* @param {FormProperty} property
|
|
60967
|
+
* @param {any} value
|
|
60977
60968
|
*/
|
|
60978
60969
|
setProperty(property, value) {
|
|
60979
60970
|
const properties = set$3(this._getState().properties, [property], value);
|
|
@@ -60982,21 +60973,21 @@
|
|
|
60982
60973
|
});
|
|
60983
60974
|
}
|
|
60984
60975
|
|
|
60985
|
-
/**
|
|
60986
|
-
* @param {FormEvent} type
|
|
60987
|
-
* @param {Function} handler
|
|
60976
|
+
/**
|
|
60977
|
+
* @param {FormEvent} type
|
|
60978
|
+
* @param {Function} handler
|
|
60988
60979
|
*/
|
|
60989
60980
|
off(type, handler) {
|
|
60990
60981
|
this.get('eventBus').off(type, handler);
|
|
60991
60982
|
}
|
|
60992
60983
|
|
|
60993
|
-
/**
|
|
60994
|
-
* @private
|
|
60995
|
-
*
|
|
60996
|
-
* @param {FormOptions} options
|
|
60997
|
-
* @param {Element} container
|
|
60998
|
-
*
|
|
60999
|
-
* @returns {Injector}
|
|
60984
|
+
/**
|
|
60985
|
+
* @private
|
|
60986
|
+
*
|
|
60987
|
+
* @param {FormOptions} options
|
|
60988
|
+
* @param {Element} container
|
|
60989
|
+
*
|
|
60990
|
+
* @returns {Injector}
|
|
61000
60991
|
*/
|
|
61001
60992
|
_createInjector(options, container) {
|
|
61002
60993
|
const {
|
|
@@ -61017,17 +61008,17 @@
|
|
|
61017
61008
|
}, core$1, ...modules, ...additionalModules]);
|
|
61018
61009
|
}
|
|
61019
61010
|
|
|
61020
|
-
/**
|
|
61021
|
-
* @private
|
|
61011
|
+
/**
|
|
61012
|
+
* @private
|
|
61022
61013
|
*/
|
|
61023
61014
|
_emit(type, data) {
|
|
61024
61015
|
this.get('eventBus').fire(type, data);
|
|
61025
61016
|
}
|
|
61026
61017
|
|
|
61027
|
-
/**
|
|
61028
|
-
* @internal
|
|
61029
|
-
*
|
|
61030
|
-
* @param { { add?: boolean, field: any, indexes: object, remove?: number, value?: any } } update
|
|
61018
|
+
/**
|
|
61019
|
+
* @internal
|
|
61020
|
+
*
|
|
61021
|
+
* @param { { add?: boolean, field: any, indexes: object, remove?: number, value?: any } } update
|
|
61031
61022
|
*/
|
|
61032
61023
|
_update(update) {
|
|
61033
61024
|
const {
|
|
@@ -61053,15 +61044,15 @@
|
|
|
61053
61044
|
});
|
|
61054
61045
|
}
|
|
61055
61046
|
|
|
61056
|
-
/**
|
|
61057
|
-
* @internal
|
|
61047
|
+
/**
|
|
61048
|
+
* @internal
|
|
61058
61049
|
*/
|
|
61059
61050
|
_getState() {
|
|
61060
61051
|
return this._state;
|
|
61061
61052
|
}
|
|
61062
61053
|
|
|
61063
|
-
/**
|
|
61064
|
-
* @internal
|
|
61054
|
+
/**
|
|
61055
|
+
* @internal
|
|
61065
61056
|
*/
|
|
61066
61057
|
_setState(state) {
|
|
61067
61058
|
this._state = {
|
|
@@ -61071,22 +61062,22 @@
|
|
|
61071
61062
|
this._emit('changed', this._getState());
|
|
61072
61063
|
}
|
|
61073
61064
|
|
|
61074
|
-
/**
|
|
61075
|
-
* @internal
|
|
61065
|
+
/**
|
|
61066
|
+
* @internal
|
|
61076
61067
|
*/
|
|
61077
61068
|
_getModules() {
|
|
61078
61069
|
return [ExpressionLanguageModule$1, MarkdownModule, ViewerCommandsModule, RepeatRenderModule];
|
|
61079
61070
|
}
|
|
61080
61071
|
|
|
61081
|
-
/**
|
|
61082
|
-
* @internal
|
|
61072
|
+
/**
|
|
61073
|
+
* @internal
|
|
61083
61074
|
*/
|
|
61084
61075
|
_onEvent(type, priority, handler) {
|
|
61085
61076
|
this.get('eventBus').on(type, priority, handler);
|
|
61086
61077
|
}
|
|
61087
61078
|
|
|
61088
|
-
/**
|
|
61089
|
-
* @internal
|
|
61079
|
+
/**
|
|
61080
|
+
* @internal
|
|
61090
61081
|
*/
|
|
61091
61082
|
_getSubmitData() {
|
|
61092
61083
|
const formFieldRegistry = this.get('formFieldRegistry');
|
|
@@ -61143,16 +61134,16 @@
|
|
|
61143
61134
|
return this._applyConditions(workingSubmitData, formData);
|
|
61144
61135
|
}
|
|
61145
61136
|
|
|
61146
|
-
/**
|
|
61147
|
-
* @internal
|
|
61137
|
+
/**
|
|
61138
|
+
* @internal
|
|
61148
61139
|
*/
|
|
61149
61140
|
_applyConditions(toFilter, data, options = {}) {
|
|
61150
61141
|
const conditionChecker = this.get('conditionChecker');
|
|
61151
61142
|
return conditionChecker.applyConditions(toFilter, data, options);
|
|
61152
61143
|
}
|
|
61153
61144
|
|
|
61154
|
-
/**
|
|
61155
|
-
* @internal
|
|
61145
|
+
/**
|
|
61146
|
+
* @internal
|
|
61156
61147
|
*/
|
|
61157
61148
|
_getInitializedFieldData(data, options = {}) {
|
|
61158
61149
|
const formFieldRegistry = this.get('formFieldRegistry');
|
|
@@ -66288,10 +66279,10 @@
|
|
|
66288
66279
|
return fn.apply(null, args);
|
|
66289
66280
|
}
|
|
66290
66281
|
|
|
66291
|
-
/**
|
|
66292
|
-
* A factory to create a configurable debouncer.
|
|
66293
|
-
*
|
|
66294
|
-
* @param {number|boolean} [config=true]
|
|
66282
|
+
/**
|
|
66283
|
+
* A factory to create a configurable debouncer.
|
|
66284
|
+
*
|
|
66285
|
+
* @param {number|boolean} [config=true]
|
|
66295
66286
|
*/
|
|
66296
66287
|
function DebounceFactory(config = true) {
|
|
66297
66288
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -66303,11 +66294,11 @@
|
|
|
66303
66294
|
}
|
|
66304
66295
|
DebounceFactory.$inject = ['config.debounce'];
|
|
66305
66296
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
66306
|
-
/**
|
|
66307
|
-
* Updates a form fields id.
|
|
66308
|
-
*
|
|
66309
|
-
* @param {Object} formField
|
|
66310
|
-
* @param {string} newId
|
|
66297
|
+
/**
|
|
66298
|
+
* Updates a form fields id.
|
|
66299
|
+
*
|
|
66300
|
+
* @param {Object} formField
|
|
66301
|
+
* @param {string} newId
|
|
66311
66302
|
*/
|
|
66312
66303
|
updateId(formField, newId) {
|
|
66313
66304
|
this._validateId(newId);
|
|
@@ -66328,13 +66319,13 @@
|
|
|
66328
66319
|
}
|
|
66329
66320
|
}
|
|
66330
66321
|
|
|
66331
|
-
/**
|
|
66332
|
-
* Validate the suitability of the given id and signals a problem
|
|
66333
|
-
* with an exception.
|
|
66334
|
-
*
|
|
66335
|
-
* @param {string} id
|
|
66336
|
-
*
|
|
66337
|
-
* @throws {Error} if id is empty or already assigned
|
|
66322
|
+
/**
|
|
66323
|
+
* Validate the suitability of the given id and signals a problem
|
|
66324
|
+
* with an exception.
|
|
66325
|
+
*
|
|
66326
|
+
* @param {string} id
|
|
66327
|
+
*
|
|
66328
|
+
* @throws {Error} if id is empty or already assigned
|
|
66338
66329
|
*/
|
|
66339
66330
|
_validateId(id) {
|
|
66340
66331
|
if (!id) {
|
|
@@ -66350,11 +66341,11 @@
|
|
|
66350
66341
|
const MIN_COLUMNS = 2;
|
|
66351
66342
|
const MAX_FIELDS_PER_ROW = 4;
|
|
66352
66343
|
class FormLayoutValidator {
|
|
66353
|
-
/**
|
|
66354
|
-
* @constructor
|
|
66355
|
-
*
|
|
66356
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
66357
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
66344
|
+
/**
|
|
66345
|
+
* @constructor
|
|
66346
|
+
*
|
|
66347
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
66348
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
66358
66349
|
*/
|
|
66359
66350
|
constructor(formLayouter, formFieldRegistry) {
|
|
66360
66351
|
this._formLayouter = formLayouter;
|
|
@@ -66424,21 +66415,21 @@
|
|
|
66424
66415
|
});
|
|
66425
66416
|
}
|
|
66426
66417
|
|
|
66427
|
-
/**
|
|
66428
|
-
* Add a dragger that calls back the passed function with
|
|
66429
|
-
* { event, delta } on drag.
|
|
66430
|
-
*
|
|
66431
|
-
* @example
|
|
66432
|
-
*
|
|
66433
|
-
* function dragMove(event, delta) {
|
|
66434
|
-
* // we are dragging (!!)
|
|
66435
|
-
* }
|
|
66436
|
-
*
|
|
66437
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
66438
|
-
*
|
|
66439
|
-
* @param {Function} fn
|
|
66440
|
-
*
|
|
66441
|
-
* @return {Function} drag start callback function
|
|
66418
|
+
/**
|
|
66419
|
+
* Add a dragger that calls back the passed function with
|
|
66420
|
+
* { event, delta } on drag.
|
|
66421
|
+
*
|
|
66422
|
+
* @example
|
|
66423
|
+
*
|
|
66424
|
+
* function dragMove(event, delta) {
|
|
66425
|
+
* // we are dragging (!!)
|
|
66426
|
+
* }
|
|
66427
|
+
*
|
|
66428
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
66429
|
+
*
|
|
66430
|
+
* @param {Function} fn
|
|
66431
|
+
*
|
|
66432
|
+
* @return {Function} drag start callback function
|
|
66442
66433
|
*/
|
|
66443
66434
|
function createDragger$1(fn) {
|
|
66444
66435
|
let self;
|
|
@@ -66479,12 +66470,12 @@
|
|
|
66479
66470
|
return onDragStart;
|
|
66480
66471
|
}
|
|
66481
66472
|
|
|
66482
|
-
/**
|
|
66483
|
-
* Throttle function call according UI update cycle.
|
|
66484
|
-
*
|
|
66485
|
-
* @param {Function} fn
|
|
66486
|
-
*
|
|
66487
|
-
* @return {Function} throttled fn
|
|
66473
|
+
/**
|
|
66474
|
+
* Throttle function call according UI update cycle.
|
|
66475
|
+
*
|
|
66476
|
+
* @param {Function} fn
|
|
66477
|
+
*
|
|
66478
|
+
* @return {Function} throttled fn
|
|
66488
66479
|
*/
|
|
66489
66480
|
function throttle(fn) {
|
|
66490
66481
|
let active = false;
|
|
@@ -66538,11 +66529,11 @@
|
|
|
66538
66529
|
});
|
|
66539
66530
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
66540
66531
|
|
|
66541
|
-
/**
|
|
66542
|
-
* @param {string} type
|
|
66543
|
-
* @param {boolean} [strict]
|
|
66544
|
-
*
|
|
66545
|
-
* @returns {any}
|
|
66532
|
+
/**
|
|
66533
|
+
* @param {string} type
|
|
66534
|
+
* @param {boolean} [strict]
|
|
66535
|
+
*
|
|
66536
|
+
* @returns {any}
|
|
66546
66537
|
*/
|
|
66547
66538
|
function getService$1(type, strict) {}
|
|
66548
66539
|
const FormEditorContext = D$2({
|
|
@@ -67006,23 +66997,23 @@
|
|
|
67006
66997
|
return fillsAndSeparators;
|
|
67007
66998
|
};
|
|
67008
66999
|
|
|
67009
|
-
/**
|
|
67010
|
-
* Creates a Fragment for a fill.
|
|
67011
|
-
*
|
|
67012
|
-
* @param {Object} fill Fill to be rendered
|
|
67013
|
-
* @returns {Object} Preact Fragment containing fill's children
|
|
67000
|
+
/**
|
|
67001
|
+
* Creates a Fragment for a fill.
|
|
67002
|
+
*
|
|
67003
|
+
* @param {Object} fill Fill to be rendered
|
|
67004
|
+
* @returns {Object} Preact Fragment containing fill's children
|
|
67014
67005
|
*/
|
|
67015
67006
|
const FillFragment = fill => e$1(d$1, {
|
|
67016
67007
|
children: fill.children
|
|
67017
67008
|
}, fill.id);
|
|
67018
67009
|
|
|
67019
|
-
/**
|
|
67020
|
-
* Creates an array of fills, with separators inserted between groups.
|
|
67021
|
-
*
|
|
67022
|
-
* @param {Array} groups Groups of fills
|
|
67023
|
-
* @param {Function} fillRenderer Function to create a fill
|
|
67024
|
-
* @param {Function} separatorRenderer Function to create a separator
|
|
67025
|
-
* @returns {Array} Array of fills and separators
|
|
67010
|
+
/**
|
|
67011
|
+
* Creates an array of fills, with separators inserted between groups.
|
|
67012
|
+
*
|
|
67013
|
+
* @param {Array} groups Groups of fills
|
|
67014
|
+
* @param {Function} fillRenderer Function to create a fill
|
|
67015
|
+
* @param {Function} separatorRenderer Function to create a separator
|
|
67016
|
+
* @returns {Array} Array of fills and separators
|
|
67026
67017
|
*/
|
|
67027
67018
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
67028
67019
|
const result = [];
|
|
@@ -67040,8 +67031,8 @@
|
|
|
67040
67031
|
return result;
|
|
67041
67032
|
};
|
|
67042
67033
|
|
|
67043
|
-
/**
|
|
67044
|
-
* Groups fills by group name property.
|
|
67034
|
+
/**
|
|
67035
|
+
* Groups fills by group name property.
|
|
67045
67036
|
*/
|
|
67046
67037
|
const _groupByGroupName = fills => {
|
|
67047
67038
|
const groups = [];
|
|
@@ -67061,8 +67052,8 @@
|
|
|
67061
67052
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
67062
67053
|
};
|
|
67063
67054
|
|
|
67064
|
-
/**
|
|
67065
|
-
* Compares fills by priority.
|
|
67055
|
+
/**
|
|
67056
|
+
* Compares fills by priority.
|
|
67066
67057
|
*/
|
|
67067
67058
|
const _comparePriority = (a, b) => {
|
|
67068
67059
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -67277,11 +67268,11 @@
|
|
|
67277
67268
|
return groups.filter(g => g.entries.length);
|
|
67278
67269
|
}
|
|
67279
67270
|
|
|
67280
|
-
/**
|
|
67281
|
-
* Returns a list of palette entries.
|
|
67282
|
-
*
|
|
67283
|
-
* @param {FormFields} formFields
|
|
67284
|
-
* @returns {Array<PaletteEntry>}
|
|
67271
|
+
/**
|
|
67272
|
+
* Returns a list of palette entries.
|
|
67273
|
+
*
|
|
67274
|
+
* @param {FormFields} formFields
|
|
67275
|
+
* @returns {Array<PaletteEntry>}
|
|
67285
67276
|
*/
|
|
67286
67277
|
function collectPaletteEntries(formFields) {
|
|
67287
67278
|
return Object.entries(formFields._formFields).map(([type, formField]) => {
|
|
@@ -67300,12 +67291,12 @@
|
|
|
67300
67291
|
}) => type !== 'default');
|
|
67301
67292
|
}
|
|
67302
67293
|
|
|
67303
|
-
/**
|
|
67304
|
-
* There are various options to specify an icon for a palette entry.
|
|
67305
|
-
*
|
|
67306
|
-
* a) via `iconUrl` property in a form field config
|
|
67307
|
-
* b) via `icon` property in a form field config
|
|
67308
|
-
* c) via statically defined iconsByType (fallback)
|
|
67294
|
+
/**
|
|
67295
|
+
* There are various options to specify an icon for a palette entry.
|
|
67296
|
+
*
|
|
67297
|
+
* a) via `iconUrl` property in a form field config
|
|
67298
|
+
* b) via `icon` property in a form field config
|
|
67299
|
+
* c) via statically defined iconsByType (fallback)
|
|
67309
67300
|
*/
|
|
67310
67301
|
function getPaletteIcon(entry) {
|
|
67311
67302
|
const {
|
|
@@ -67369,20 +67360,20 @@
|
|
|
67369
67360
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
67370
67361
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
67371
67362
|
|
|
67372
|
-
/**
|
|
67373
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
67363
|
+
/**
|
|
67364
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
67374
67365
|
*/
|
|
67375
67366
|
|
|
67376
67367
|
class Dragging {
|
|
67377
|
-
/**
|
|
67378
|
-
* @constructor
|
|
67379
|
-
*
|
|
67380
|
-
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
67381
|
-
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
67382
|
-
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
67383
|
-
* @param { import('../../core/EventBus').default } eventBus
|
|
67384
|
-
* @param { import('../modeling/Modeling').default } modeling
|
|
67385
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
67368
|
+
/**
|
|
67369
|
+
* @constructor
|
|
67370
|
+
*
|
|
67371
|
+
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
67372
|
+
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
67373
|
+
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
67374
|
+
* @param { import('../../core/EventBus').default } eventBus
|
|
67375
|
+
* @param { import('../modeling/Modeling').default } modeling
|
|
67376
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
67386
67377
|
*/
|
|
67387
67378
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling, pathRegistry) {
|
|
67388
67379
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -67393,13 +67384,13 @@
|
|
|
67393
67384
|
this._pathRegistry = pathRegistry;
|
|
67394
67385
|
}
|
|
67395
67386
|
|
|
67396
|
-
/**
|
|
67397
|
-
* Calculates position in form schema given the dropped place.
|
|
67398
|
-
*
|
|
67399
|
-
* @param { FormRow } targetRow
|
|
67400
|
-
* @param { any } targetFormField
|
|
67401
|
-
* @param { HTMLElement } sibling
|
|
67402
|
-
* @returns { number }
|
|
67387
|
+
/**
|
|
67388
|
+
* Calculates position in form schema given the dropped place.
|
|
67389
|
+
*
|
|
67390
|
+
* @param { FormRow } targetRow
|
|
67391
|
+
* @param { any } targetFormField
|
|
67392
|
+
* @param { HTMLElement } sibling
|
|
67393
|
+
* @returns { number }
|
|
67403
67394
|
*/
|
|
67404
67395
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
67405
67396
|
/** @type HTMLElement */
|
|
@@ -67545,8 +67536,8 @@
|
|
|
67545
67536
|
}
|
|
67546
67537
|
}
|
|
67547
67538
|
|
|
67548
|
-
/**
|
|
67549
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
67539
|
+
/**
|
|
67540
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
67550
67541
|
*/
|
|
67551
67542
|
createDragulaInstance(options) {
|
|
67552
67543
|
const {
|
|
@@ -67982,7 +67973,7 @@
|
|
|
67982
67973
|
return null;
|
|
67983
67974
|
}
|
|
67984
67975
|
return e$1("div", {
|
|
67985
|
-
style: "width: fit-content
|
|
67976
|
+
style: "width: fit-content; padding: 2px 6px; height: 16px; background: var(--color-blue-205-100-95); display: flex; justify-content: center; align-items: center; position: absolute; bottom: -2px; z-index: 2; font-size: 10px; right: 3px;",
|
|
67986
67977
|
class: "fjs-debug-columns",
|
|
67987
67978
|
children: (field.layout || {}).columns || 'auto'
|
|
67988
67979
|
});
|
|
@@ -69097,10 +69088,10 @@
|
|
|
69097
69088
|
return formField;
|
|
69098
69089
|
}
|
|
69099
69090
|
class AddFormFieldHandler {
|
|
69100
|
-
/**
|
|
69101
|
-
* @constructor
|
|
69102
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69103
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69091
|
+
/**
|
|
69092
|
+
* @constructor
|
|
69093
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69094
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69104
69095
|
*/
|
|
69105
69096
|
constructor(formEditor, formFieldRegistry) {
|
|
69106
69097
|
this._formEditor = formEditor;
|
|
@@ -69160,10 +69151,10 @@
|
|
|
69160
69151
|
}
|
|
69161
69152
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
69162
69153
|
class EditFormFieldHandler {
|
|
69163
|
-
/**
|
|
69164
|
-
* @constructor
|
|
69165
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69166
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69154
|
+
/**
|
|
69155
|
+
* @constructor
|
|
69156
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69157
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69167
69158
|
*/
|
|
69168
69159
|
constructor(formEditor, formFieldRegistry) {
|
|
69169
69160
|
this._formEditor = formEditor;
|
|
@@ -69225,12 +69216,12 @@
|
|
|
69225
69216
|
}
|
|
69226
69217
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
69227
69218
|
class MoveFormFieldHandler {
|
|
69228
|
-
/**
|
|
69229
|
-
* @constructor
|
|
69230
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69231
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69232
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69233
|
-
* @param { import('@bpmn-io/form-js-viewer').FormLayouter } formLayouter
|
|
69219
|
+
/**
|
|
69220
|
+
* @constructor
|
|
69221
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69222
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69223
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69224
|
+
* @param { import('@bpmn-io/form-js-viewer').FormLayouter } formLayouter
|
|
69234
69225
|
*/
|
|
69235
69226
|
constructor(formEditor, formFieldRegistry, pathRegistry, formLayouter) {
|
|
69236
69227
|
this._formEditor = formEditor;
|
|
@@ -69340,10 +69331,10 @@
|
|
|
69340
69331
|
}
|
|
69341
69332
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry', 'pathRegistry', 'formLayouter'];
|
|
69342
69333
|
class RemoveFormFieldHandler {
|
|
69343
|
-
/**
|
|
69344
|
-
* @constructor
|
|
69345
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69346
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69334
|
+
/**
|
|
69335
|
+
* @constructor
|
|
69336
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69337
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69347
69338
|
*/
|
|
69348
69339
|
constructor(formEditor, formFieldRegistry) {
|
|
69349
69340
|
this._formEditor = formEditor;
|
|
@@ -69402,9 +69393,9 @@
|
|
|
69402
69393
|
}
|
|
69403
69394
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
69404
69395
|
class UpdateIdClaimHandler {
|
|
69405
|
-
/**
|
|
69406
|
-
* @constructor
|
|
69407
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69396
|
+
/**
|
|
69397
|
+
* @constructor
|
|
69398
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69408
69399
|
*/
|
|
69409
69400
|
constructor(formFieldRegistry) {
|
|
69410
69401
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -69436,9 +69427,9 @@
|
|
|
69436
69427
|
}
|
|
69437
69428
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
69438
69429
|
class UpdateKeyClaimHandler {
|
|
69439
|
-
/**
|
|
69440
|
-
* @constructor
|
|
69441
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69430
|
+
/**
|
|
69431
|
+
* @constructor
|
|
69432
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69442
69433
|
*/
|
|
69443
69434
|
constructor(pathRegistry) {
|
|
69444
69435
|
this._pathRegistry = pathRegistry;
|
|
@@ -69485,9 +69476,9 @@
|
|
|
69485
69476
|
}
|
|
69486
69477
|
UpdateKeyClaimHandler.$inject = ['pathRegistry'];
|
|
69487
69478
|
class UpdatePathClaimHandler {
|
|
69488
|
-
/**
|
|
69489
|
-
* @constructor
|
|
69490
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69479
|
+
/**
|
|
69480
|
+
* @constructor
|
|
69481
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69491
69482
|
*/
|
|
69492
69483
|
constructor(pathRegistry) {
|
|
69493
69484
|
this._pathRegistry = pathRegistry;
|
|
@@ -70068,8 +70059,8 @@
|
|
|
70068
70059
|
constructor(eventBus) {
|
|
70069
70060
|
super(eventBus);
|
|
70070
70061
|
|
|
70071
|
-
/**
|
|
70072
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
70062
|
+
/**
|
|
70063
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
70073
70064
|
*/
|
|
70074
70065
|
this.preExecute('formField.edit', function (context) {
|
|
70075
70066
|
const {
|
|
@@ -70095,11 +70086,11 @@
|
|
|
70095
70086
|
constructor(eventBus) {
|
|
70096
70087
|
super(eventBus);
|
|
70097
70088
|
|
|
70098
|
-
/**
|
|
70099
|
-
* Cleanup properties on changing the values source.
|
|
70100
|
-
*
|
|
70101
|
-
* 1) Remove other sources, e.g. set `values` => remove `valuesKey` and `valuesExpression`
|
|
70102
|
-
* 2) Remove default values for all other values sources
|
|
70089
|
+
/**
|
|
70090
|
+
* Cleanup properties on changing the values source.
|
|
70091
|
+
*
|
|
70092
|
+
* 1) Remove other sources, e.g. set `values` => remove `valuesKey` and `valuesExpression`
|
|
70093
|
+
* 2) Remove default values for all other values sources
|
|
70103
70094
|
*/
|
|
70104
70095
|
this.preExecute('formField.edit', function (context) {
|
|
70105
70096
|
const {
|
|
@@ -70752,22 +70743,22 @@
|
|
|
70752
70743
|
selectionBehavior: ['type', SelectionBehavior]
|
|
70753
70744
|
};
|
|
70754
70745
|
|
|
70755
|
-
/**
|
|
70756
|
-
* Base class for sectionable UI modules.
|
|
70757
|
-
*
|
|
70758
|
-
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
70759
|
-
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
70760
|
-
*
|
|
70761
|
-
* @class SectionModuleBase
|
|
70746
|
+
/**
|
|
70747
|
+
* Base class for sectionable UI modules.
|
|
70748
|
+
*
|
|
70749
|
+
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
70750
|
+
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
70751
|
+
*
|
|
70752
|
+
* @class SectionModuleBase
|
|
70762
70753
|
*/
|
|
70763
70754
|
class SectionModuleBase {
|
|
70764
|
-
/**
|
|
70765
|
-
* Create a SectionModuleBase instance.
|
|
70766
|
-
*
|
|
70767
|
-
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
70768
|
-
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
70769
|
-
*
|
|
70770
|
-
* @constructor
|
|
70755
|
+
/**
|
|
70756
|
+
* Create a SectionModuleBase instance.
|
|
70757
|
+
*
|
|
70758
|
+
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
70759
|
+
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
70760
|
+
*
|
|
70761
|
+
* @constructor
|
|
70771
70762
|
*/
|
|
70772
70763
|
constructor(eventBus, sectionKey) {
|
|
70773
70764
|
this._eventBus = eventBus;
|
|
@@ -70780,10 +70771,10 @@
|
|
|
70780
70771
|
});
|
|
70781
70772
|
}
|
|
70782
70773
|
|
|
70783
|
-
/**
|
|
70784
|
-
* Attach the managed section to a parent node.
|
|
70785
|
-
*
|
|
70786
|
-
* @param {HTMLElement} container - The parent node to attach to.
|
|
70774
|
+
/**
|
|
70775
|
+
* Attach the managed section to a parent node.
|
|
70776
|
+
*
|
|
70777
|
+
* @param {HTMLElement} container - The parent node to attach to.
|
|
70787
70778
|
*/
|
|
70788
70779
|
attachTo(container) {
|
|
70789
70780
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -70791,22 +70782,22 @@
|
|
|
70791
70782
|
}));
|
|
70792
70783
|
}
|
|
70793
70784
|
|
|
70794
|
-
/**
|
|
70795
|
-
* Detach the managed section from its parent node.
|
|
70785
|
+
/**
|
|
70786
|
+
* Detach the managed section from its parent node.
|
|
70796
70787
|
*/
|
|
70797
70788
|
detach() {
|
|
70798
70789
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
70799
70790
|
}
|
|
70800
70791
|
|
|
70801
|
-
/**
|
|
70802
|
-
* Reset the managed section to its initial state.
|
|
70792
|
+
/**
|
|
70793
|
+
* Reset the managed section to its initial state.
|
|
70803
70794
|
*/
|
|
70804
70795
|
reset() {
|
|
70805
70796
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
70806
70797
|
}
|
|
70807
70798
|
|
|
70808
|
-
/**
|
|
70809
|
-
* Circumvents timing issues.
|
|
70799
|
+
/**
|
|
70800
|
+
* Circumvents timing issues.
|
|
70810
70801
|
*/
|
|
70811
70802
|
_onceSectionRendered(callback) {
|
|
70812
70803
|
if (this.isSectionRendered) {
|
|
@@ -74481,11 +74472,11 @@
|
|
|
74481
74472
|
feelPopup: ['type', FeelPopupModule]
|
|
74482
74473
|
};
|
|
74483
74474
|
|
|
74484
|
-
/**
|
|
74485
|
-
* @param {string} type
|
|
74486
|
-
* @param {boolean} [strict]
|
|
74487
|
-
*
|
|
74488
|
-
* @returns {any}
|
|
74475
|
+
/**
|
|
74476
|
+
* @param {string} type
|
|
74477
|
+
* @param {boolean} [strict]
|
|
74478
|
+
*
|
|
74479
|
+
* @returns {any}
|
|
74489
74480
|
*/
|
|
74490
74481
|
function getService(type, strict) {}
|
|
74491
74482
|
const PropertiesPanelContext = D$2({
|
|
@@ -74518,8 +74509,8 @@
|
|
|
74518
74509
|
return null;
|
|
74519
74510
|
}
|
|
74520
74511
|
|
|
74521
|
-
/**
|
|
74522
|
-
* @param {string} path
|
|
74512
|
+
/**
|
|
74513
|
+
* @param {string} path
|
|
74523
74514
|
*/
|
|
74524
74515
|
function isValidDotPath(path) {
|
|
74525
74516
|
return /^\w+(\.\w+)*$/.test(path);
|
|
@@ -74545,8 +74536,8 @@
|
|
|
74545
74536
|
return propertiesPanelEntries.some(id => id === 'values');
|
|
74546
74537
|
}
|
|
74547
74538
|
|
|
74548
|
-
/**
|
|
74549
|
-
* @param {string} path
|
|
74539
|
+
/**
|
|
74540
|
+
* @param {string} path
|
|
74550
74541
|
*/
|
|
74551
74542
|
function hasIntegerPathSegment(path) {
|
|
74552
74543
|
return path.split('.').some(segment => /^\d+$/.test(segment));
|
|
@@ -74558,10 +74549,10 @@
|
|
|
74558
74549
|
return getService(type, strict);
|
|
74559
74550
|
}
|
|
74560
74551
|
|
|
74561
|
-
/**
|
|
74562
|
-
* Retrieve list of variables from the form schema.
|
|
74563
|
-
*
|
|
74564
|
-
* @returns { string[] } list of variables used in form schema
|
|
74552
|
+
/**
|
|
74553
|
+
* Retrieve list of variables from the form schema.
|
|
74554
|
+
*
|
|
74555
|
+
* @returns { string[] } list of variables used in form schema
|
|
74565
74556
|
*/
|
|
74566
74557
|
function useVariables() {
|
|
74567
74558
|
const form = useService('formEditor');
|
|
@@ -74626,8 +74617,8 @@
|
|
|
74626
74617
|
}
|
|
74627
74618
|
};
|
|
74628
74619
|
|
|
74629
|
-
/**
|
|
74630
|
-
* Provide placeholders for empty and multiple state.
|
|
74620
|
+
/**
|
|
74621
|
+
* Provide placeholders for empty and multiple state.
|
|
74631
74622
|
*/
|
|
74632
74623
|
const PropertiesPanelPlaceholderProvider = {
|
|
74633
74624
|
getEmpty: () => {
|
|
@@ -74671,9 +74662,9 @@
|
|
|
74671
74662
|
});
|
|
74672
74663
|
}, [eventBus, formEditor, selectionModule]);
|
|
74673
74664
|
h$1(() => {
|
|
74674
|
-
/**
|
|
74675
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
74676
|
-
* once we have a proper updater/change support
|
|
74665
|
+
/**
|
|
74666
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
74667
|
+
* once we have a proper updater/change support
|
|
74677
74668
|
*/
|
|
74678
74669
|
eventBus.on('changed', refresh);
|
|
74679
74670
|
eventBus.on('import.done', refresh);
|
|
@@ -74724,17 +74715,17 @@
|
|
|
74724
74715
|
}
|
|
74725
74716
|
const DEFAULT_PRIORITY = 1000;
|
|
74726
74717
|
|
|
74727
|
-
/**
|
|
74728
|
-
* @typedef { { parent: Element } } PropertiesPanelConfig
|
|
74729
|
-
* @typedef { import('../../core/EventBus').default } EventBus
|
|
74730
|
-
* @typedef { import('../../types').Injector } Injector
|
|
74731
|
-
* @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
|
|
74718
|
+
/**
|
|
74719
|
+
* @typedef { { parent: Element } } PropertiesPanelConfig
|
|
74720
|
+
* @typedef { import('../../core/EventBus').default } EventBus
|
|
74721
|
+
* @typedef { import('../../types').Injector } Injector
|
|
74722
|
+
* @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
|
|
74732
74723
|
*/
|
|
74733
74724
|
|
|
74734
|
-
/**
|
|
74735
|
-
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
74736
|
-
* @param {Injector} injector
|
|
74737
|
-
* @param {EventBus} eventBus
|
|
74725
|
+
/**
|
|
74726
|
+
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
74727
|
+
* @param {Injector} injector
|
|
74728
|
+
* @param {EventBus} eventBus
|
|
74738
74729
|
*/
|
|
74739
74730
|
class PropertiesPanelRenderer {
|
|
74740
74731
|
constructor(propertiesPanelConfig, injector, eventBus) {
|
|
@@ -74752,10 +74743,10 @@
|
|
|
74752
74743
|
});
|
|
74753
74744
|
}
|
|
74754
74745
|
|
|
74755
|
-
/**
|
|
74756
|
-
* Attach the properties panel to a parent node.
|
|
74757
|
-
*
|
|
74758
|
-
* @param {HTMLElement} container
|
|
74746
|
+
/**
|
|
74747
|
+
* Attach the properties panel to a parent node.
|
|
74748
|
+
*
|
|
74749
|
+
* @param {HTMLElement} container
|
|
74759
74750
|
*/
|
|
74760
74751
|
attachTo(container) {
|
|
74761
74752
|
if (!container) {
|
|
@@ -74775,8 +74766,8 @@
|
|
|
74775
74766
|
this._eventBus.fire('propertiesPanel.attach');
|
|
74776
74767
|
}
|
|
74777
74768
|
|
|
74778
|
-
/**
|
|
74779
|
-
* Detach the properties panel from its parent node.
|
|
74769
|
+
/**
|
|
74770
|
+
* Detach the properties panel from its parent node.
|
|
74780
74771
|
*/
|
|
74781
74772
|
detach() {
|
|
74782
74773
|
const parentNode = this._container.parentNode;
|
|
@@ -74800,11 +74791,11 @@
|
|
|
74800
74791
|
}
|
|
74801
74792
|
}
|
|
74802
74793
|
|
|
74803
|
-
/**
|
|
74804
|
-
* Register a new properties provider to the properties panel.
|
|
74805
|
-
*
|
|
74806
|
-
* @param {PropertiesProvider} provider
|
|
74807
|
-
* @param {Number} [priority]
|
|
74794
|
+
/**
|
|
74795
|
+
* Register a new properties provider to the properties panel.
|
|
74796
|
+
*
|
|
74797
|
+
* @param {PropertiesProvider} provider
|
|
74798
|
+
* @param {Number} [priority]
|
|
74808
74799
|
*/
|
|
74809
74800
|
registerProvider(provider, priority) {
|
|
74810
74801
|
if (!priority) {
|
|
@@ -75870,9 +75861,9 @@
|
|
|
75870
75861
|
|
|
75871
75862
|
// helpers //////////
|
|
75872
75863
|
|
|
75873
|
-
/**
|
|
75874
|
-
* @param {string} type
|
|
75875
|
-
* @returns {string}
|
|
75864
|
+
/**
|
|
75865
|
+
* @param {string} type
|
|
75866
|
+
* @returns {string}
|
|
75876
75867
|
*/
|
|
75877
75868
|
function getLabelText(type) {
|
|
75878
75869
|
switch (type) {
|
|
@@ -76673,14 +76664,14 @@
|
|
|
76673
76664
|
|
|
76674
76665
|
// helpers //////////
|
|
76675
76666
|
|
|
76676
|
-
/**
|
|
76677
|
-
* Returns copy of object with updated value.
|
|
76678
|
-
*
|
|
76679
|
-
* @param {Object} properties
|
|
76680
|
-
* @param {string} key
|
|
76681
|
-
* @param {string} value
|
|
76682
|
-
*
|
|
76683
|
-
* @returns {Object}
|
|
76667
|
+
/**
|
|
76668
|
+
* Returns copy of object with updated value.
|
|
76669
|
+
*
|
|
76670
|
+
* @param {Object} properties
|
|
76671
|
+
* @param {string} key
|
|
76672
|
+
* @param {string} value
|
|
76673
|
+
*
|
|
76674
|
+
* @returns {Object}
|
|
76684
76675
|
*/
|
|
76685
76676
|
function updateValue(properties, key, value) {
|
|
76686
76677
|
return {
|
|
@@ -76689,14 +76680,14 @@
|
|
|
76689
76680
|
};
|
|
76690
76681
|
}
|
|
76691
76682
|
|
|
76692
|
-
/**
|
|
76693
|
-
* Returns copy of object with updated key.
|
|
76694
|
-
*
|
|
76695
|
-
* @param {Object} properties
|
|
76696
|
-
* @param {string} oldKey
|
|
76697
|
-
* @param {string} newKey
|
|
76698
|
-
*
|
|
76699
|
-
* @returns {Object}
|
|
76683
|
+
/**
|
|
76684
|
+
* Returns copy of object with updated key.
|
|
76685
|
+
*
|
|
76686
|
+
* @param {Object} properties
|
|
76687
|
+
* @param {string} oldKey
|
|
76688
|
+
* @param {string} newKey
|
|
76689
|
+
*
|
|
76690
|
+
* @returns {Object}
|
|
76700
76691
|
*/
|
|
76701
76692
|
function updateKey(properties, oldKey, newKey) {
|
|
76702
76693
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -77253,9 +77244,9 @@
|
|
|
77253
77244
|
editField(field, path, value);
|
|
77254
77245
|
};
|
|
77255
77246
|
|
|
77256
|
-
/**
|
|
77257
|
-
* @param {string|void} value
|
|
77258
|
-
* @returns {string|null}
|
|
77247
|
+
/**
|
|
77248
|
+
* @param {string|void} value
|
|
77249
|
+
* @returns {string|null}
|
|
77259
77250
|
*/
|
|
77260
77251
|
const validate = value => {
|
|
77261
77252
|
if (!isString(value) || value.length === 0) {
|
|
@@ -77315,8 +77306,8 @@
|
|
|
77315
77306
|
return isNumber(get(field, path));
|
|
77316
77307
|
};
|
|
77317
77308
|
|
|
77318
|
-
/**
|
|
77319
|
-
* @param {boolean} value
|
|
77309
|
+
/**
|
|
77310
|
+
* @param {boolean} value
|
|
77320
77311
|
*/
|
|
77321
77312
|
const setValue = value => {
|
|
77322
77313
|
value ? editField(field, path, defaultRowCount) : editField(field, path, undefined);
|
|
@@ -77356,10 +77347,10 @@
|
|
|
77356
77347
|
const debounce = useService('debounce');
|
|
77357
77348
|
const getValue = () => get(field, path$2);
|
|
77358
77349
|
|
|
77359
|
-
/**
|
|
77360
|
-
* @param {number|void} value
|
|
77361
|
-
* @param {string|null} error
|
|
77362
|
-
* @returns {void}
|
|
77350
|
+
/**
|
|
77351
|
+
* @param {number|void} value
|
|
77352
|
+
* @param {string|null} error
|
|
77353
|
+
* @returns {void}
|
|
77363
77354
|
*/
|
|
77364
77355
|
const setValue = (value, error) => {
|
|
77365
77356
|
if (error) {
|
|
@@ -77368,9 +77359,9 @@
|
|
|
77368
77359
|
editField(field, path$2, value);
|
|
77369
77360
|
};
|
|
77370
77361
|
|
|
77371
|
-
/**
|
|
77372
|
-
* @param {string|void} value
|
|
77373
|
-
* @returns {string|null}
|
|
77362
|
+
/**
|
|
77363
|
+
* @param {string|void} value
|
|
77364
|
+
* @returns {string|null}
|
|
77374
77365
|
*/
|
|
77375
77366
|
const validate = value => {
|
|
77376
77367
|
if (isNil(value)) {
|
|
@@ -77431,8 +77422,8 @@
|
|
|
77431
77422
|
id
|
|
77432
77423
|
} = props;
|
|
77433
77424
|
|
|
77434
|
-
/**
|
|
77435
|
-
* @returns {string|void}
|
|
77425
|
+
/**
|
|
77426
|
+
* @returns {string|void}
|
|
77436
77427
|
*/
|
|
77437
77428
|
const getValue = () => {
|
|
77438
77429
|
const columns = get(field, COLUMNS_PATH);
|
|
@@ -77445,8 +77436,8 @@
|
|
|
77445
77436
|
}
|
|
77446
77437
|
};
|
|
77447
77438
|
|
|
77448
|
-
/**
|
|
77449
|
-
* @param {string|void} value
|
|
77439
|
+
/**
|
|
77440
|
+
* @param {string|void} value
|
|
77450
77441
|
*/
|
|
77451
77442
|
const setValue = value => {
|
|
77452
77443
|
switch (value) {
|
|
@@ -77523,10 +77514,10 @@
|
|
|
77523
77514
|
return get(field, PATH);
|
|
77524
77515
|
};
|
|
77525
77516
|
|
|
77526
|
-
/**
|
|
77527
|
-
* @param {string|void} value
|
|
77528
|
-
* @param {string|void} error
|
|
77529
|
-
* @returns {void}
|
|
77517
|
+
/**
|
|
77518
|
+
* @param {string|void} value
|
|
77519
|
+
* @param {string|void} error
|
|
77520
|
+
* @returns {void}
|
|
77530
77521
|
*/
|
|
77531
77522
|
const setValue = (value, error) => {
|
|
77532
77523
|
if (error) {
|
|
@@ -77535,9 +77526,9 @@
|
|
|
77535
77526
|
editField(field, PATH, value);
|
|
77536
77527
|
};
|
|
77537
77528
|
|
|
77538
|
-
/**
|
|
77539
|
-
* @param {string|void} value
|
|
77540
|
-
* @returns {string|null}
|
|
77529
|
+
/**
|
|
77530
|
+
* @param {string|void} value
|
|
77531
|
+
* @returns {string|null}
|
|
77541
77532
|
*/
|
|
77542
77533
|
const validate = value => {
|
|
77543
77534
|
if (!isString(value) || value.length === 0 || value === '=') {
|
|
@@ -77607,10 +77598,10 @@
|
|
|
77607
77598
|
} = props;
|
|
77608
77599
|
const debounce = useService('debounce');
|
|
77609
77600
|
|
|
77610
|
-
/**
|
|
77611
|
-
* @param {string|void} value
|
|
77612
|
-
* @param {string|void} error
|
|
77613
|
-
* @returns {void}
|
|
77601
|
+
/**
|
|
77602
|
+
* @param {string|void} value
|
|
77603
|
+
* @param {string|void} error
|
|
77604
|
+
* @returns {void}
|
|
77614
77605
|
*/
|
|
77615
77606
|
const setValue = (value, error) => {
|
|
77616
77607
|
if (error) {
|
|
@@ -77640,10 +77631,10 @@
|
|
|
77640
77631
|
} = props;
|
|
77641
77632
|
const debounce = useService('debounce');
|
|
77642
77633
|
|
|
77643
|
-
/**
|
|
77644
|
-
* @param {string|void} value
|
|
77645
|
-
* @param {string|void} error
|
|
77646
|
-
* @returns {void}
|
|
77634
|
+
/**
|
|
77635
|
+
* @param {string|void} value
|
|
77636
|
+
* @param {string|void} error
|
|
77637
|
+
* @returns {void}
|
|
77647
77638
|
*/
|
|
77648
77639
|
const setValue = (value, error) => {
|
|
77649
77640
|
if (error) {
|
|
@@ -77668,9 +77659,9 @@
|
|
|
77668
77659
|
|
|
77669
77660
|
// helpers //////////////////////
|
|
77670
77661
|
|
|
77671
|
-
/**
|
|
77672
|
-
* @param {string|void} value
|
|
77673
|
-
* @returns {string|null}
|
|
77662
|
+
/**
|
|
77663
|
+
* @param {string|void} value
|
|
77664
|
+
* @returns {string|null}
|
|
77674
77665
|
*/
|
|
77675
77666
|
function validate(value) {
|
|
77676
77667
|
if (!isString(value) || value.length === 0) {
|
|
@@ -78092,8 +78083,8 @@
|
|
|
78092
78083
|
};
|
|
78093
78084
|
const id = 'valuesSource';
|
|
78094
78085
|
|
|
78095
|
-
/**
|
|
78096
|
-
* @type {Array<Group|ListGroup>}
|
|
78086
|
+
/**
|
|
78087
|
+
* @type {Array<Group|ListGroup>}
|
|
78097
78088
|
*/
|
|
78098
78089
|
const groups = [{
|
|
78099
78090
|
id,
|
|
@@ -78213,13 +78204,13 @@
|
|
|
78213
78204
|
|
|
78214
78205
|
// helpers //////////
|
|
78215
78206
|
|
|
78216
|
-
/**
|
|
78217
|
-
* Returns copy of object without key.
|
|
78218
|
-
*
|
|
78219
|
-
* @param {Object} properties
|
|
78220
|
-
* @param {string} oldKey
|
|
78221
|
-
*
|
|
78222
|
-
* @returns {Object}
|
|
78207
|
+
/**
|
|
78208
|
+
* Returns copy of object without key.
|
|
78209
|
+
*
|
|
78210
|
+
* @param {Object} properties
|
|
78211
|
+
* @param {string} oldKey
|
|
78212
|
+
*
|
|
78213
|
+
* @returns {Object}
|
|
78223
78214
|
*/
|
|
78224
78215
|
function removeKey(properties, oldKey) {
|
|
78225
78216
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -78300,8 +78291,8 @@
|
|
|
78300
78291
|
}
|
|
78301
78292
|
const areStaticColumnsEnabled = isArray(get(field, ['columns']));
|
|
78302
78293
|
|
|
78303
|
-
/**
|
|
78304
|
-
* @type {Array<Group>}
|
|
78294
|
+
/**
|
|
78295
|
+
* @type {Array<Group>}
|
|
78305
78296
|
*/
|
|
78306
78297
|
const groups = [{
|
|
78307
78298
|
id: `${fieldId}-columnsSource`,
|
|
@@ -78391,10 +78382,10 @@
|
|
|
78391
78382
|
propertiesProvider: ['type', PropertiesProvider]
|
|
78392
78383
|
};
|
|
78393
78384
|
|
|
78394
|
-
/**
|
|
78395
|
-
* Manages the rendering of visual plugins.
|
|
78396
|
-
* @constructor
|
|
78397
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
78385
|
+
/**
|
|
78386
|
+
* Manages the rendering of visual plugins.
|
|
78387
|
+
* @constructor
|
|
78388
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
78398
78389
|
*/
|
|
78399
78390
|
class RenderInjector extends SectionModuleBase {
|
|
78400
78391
|
constructor(eventBus) {
|
|
@@ -78403,10 +78394,10 @@
|
|
|
78403
78394
|
this.registeredRenderers = [];
|
|
78404
78395
|
}
|
|
78405
78396
|
|
|
78406
|
-
/**
|
|
78407
|
-
* Inject a new renderer into the injector.
|
|
78408
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
78409
|
-
* @param {Function} Renderer - The renderer function.
|
|
78397
|
+
/**
|
|
78398
|
+
* Inject a new renderer into the injector.
|
|
78399
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
78400
|
+
* @param {Function} Renderer - The renderer function.
|
|
78410
78401
|
*/
|
|
78411
78402
|
attachRenderer(identifier, Renderer) {
|
|
78412
78403
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -78415,17 +78406,17 @@
|
|
|
78415
78406
|
}];
|
|
78416
78407
|
}
|
|
78417
78408
|
|
|
78418
|
-
/**
|
|
78419
|
-
* Detach a renderer from the by key injector.
|
|
78420
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
78409
|
+
/**
|
|
78410
|
+
* Detach a renderer from the by key injector.
|
|
78411
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
78421
78412
|
*/
|
|
78422
78413
|
detachRenderer(identifier) {
|
|
78423
78414
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
78424
78415
|
}
|
|
78425
78416
|
|
|
78426
|
-
/**
|
|
78427
|
-
* Returns the registered renderers.
|
|
78428
|
-
* @returns {Array} Array of registered renderers.
|
|
78417
|
+
/**
|
|
78418
|
+
* Returns the registered renderers.
|
|
78419
|
+
* @returns {Array} Array of registered renderers.
|
|
78429
78420
|
*/
|
|
78430
78421
|
fetchRenderers() {
|
|
78431
78422
|
return this.registeredRenderers;
|
|
@@ -78470,11 +78461,11 @@
|
|
|
78470
78461
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
78471
78462
|
}
|
|
78472
78463
|
|
|
78473
|
-
/**
|
|
78474
|
-
* Checks whether a field should be repeatable.
|
|
78475
|
-
*
|
|
78476
|
-
* @param {string} id - The id of the field to check
|
|
78477
|
-
* @returns {boolean} - True if repeatable, false otherwise
|
|
78464
|
+
/**
|
|
78465
|
+
* Checks whether a field should be repeatable.
|
|
78466
|
+
*
|
|
78467
|
+
* @param {string} id - The id of the field to check
|
|
78468
|
+
* @returns {boolean} - True if repeatable, false otherwise
|
|
78478
78469
|
*/
|
|
78479
78470
|
isFieldRepeating(id) {
|
|
78480
78471
|
if (!id) {
|
|
@@ -78517,48 +78508,48 @@
|
|
|
78517
78508
|
};
|
|
78518
78509
|
const ids = new Ids([32, 36, 1]);
|
|
78519
78510
|
|
|
78520
|
-
/**
|
|
78521
|
-
* @typedef { import('./types').Injector } Injector
|
|
78522
|
-
* @typedef { import('./types').Module } Module
|
|
78523
|
-
* @typedef { import('./types').Schema } Schema
|
|
78524
|
-
*
|
|
78525
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
78526
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
78527
|
-
*
|
|
78528
|
-
* @typedef { {
|
|
78529
|
-
* properties: FormEditorProperties,
|
|
78530
|
-
* schema: Schema
|
|
78531
|
-
* } } State
|
|
78532
|
-
*
|
|
78533
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
78534
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
78535
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
78511
|
+
/**
|
|
78512
|
+
* @typedef { import('./types').Injector } Injector
|
|
78513
|
+
* @typedef { import('./types').Module } Module
|
|
78514
|
+
* @typedef { import('./types').Schema } Schema
|
|
78515
|
+
*
|
|
78516
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
78517
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
78518
|
+
*
|
|
78519
|
+
* @typedef { {
|
|
78520
|
+
* properties: FormEditorProperties,
|
|
78521
|
+
* schema: Schema
|
|
78522
|
+
* } } State
|
|
78523
|
+
*
|
|
78524
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
78525
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
78526
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
78536
78527
|
*/
|
|
78537
78528
|
|
|
78538
|
-
/**
|
|
78539
|
-
* The form editor.
|
|
78529
|
+
/**
|
|
78530
|
+
* The form editor.
|
|
78540
78531
|
*/
|
|
78541
78532
|
class FormEditor {
|
|
78542
|
-
/**
|
|
78543
|
-
* @constructor
|
|
78544
|
-
* @param {FormEditorOptions} options
|
|
78533
|
+
/**
|
|
78534
|
+
* @constructor
|
|
78535
|
+
* @param {FormEditorOptions} options
|
|
78545
78536
|
*/
|
|
78546
78537
|
constructor(options = {}) {
|
|
78547
|
-
/**
|
|
78548
|
-
* @public
|
|
78549
|
-
* @type {OnEventType}
|
|
78538
|
+
/**
|
|
78539
|
+
* @public
|
|
78540
|
+
* @type {OnEventType}
|
|
78550
78541
|
*/
|
|
78551
78542
|
this.on = this._onEvent;
|
|
78552
78543
|
|
|
78553
|
-
/**
|
|
78554
|
-
* @public
|
|
78555
|
-
* @type {String}
|
|
78544
|
+
/**
|
|
78545
|
+
* @public
|
|
78546
|
+
* @type {String}
|
|
78556
78547
|
*/
|
|
78557
78548
|
this._id = ids.next();
|
|
78558
78549
|
|
|
78559
|
-
/**
|
|
78560
|
-
* @private
|
|
78561
|
-
* @type {Element}
|
|
78550
|
+
/**
|
|
78551
|
+
* @private
|
|
78552
|
+
* @type {Element}
|
|
78562
78553
|
*/
|
|
78563
78554
|
this._container = createFormContainer();
|
|
78564
78555
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -78569,15 +78560,15 @@
|
|
|
78569
78560
|
properties = {}
|
|
78570
78561
|
} = options;
|
|
78571
78562
|
|
|
78572
|
-
/**
|
|
78573
|
-
* @private
|
|
78574
|
-
* @type {any}
|
|
78563
|
+
/**
|
|
78564
|
+
* @private
|
|
78565
|
+
* @type {any}
|
|
78575
78566
|
*/
|
|
78576
78567
|
this.exporter = exporter;
|
|
78577
78568
|
|
|
78578
|
-
/**
|
|
78579
|
-
* @private
|
|
78580
|
-
* @type {State}
|
|
78569
|
+
/**
|
|
78570
|
+
* @private
|
|
78571
|
+
* @type {State}
|
|
78581
78572
|
*/
|
|
78582
78573
|
this._state = {
|
|
78583
78574
|
properties,
|
|
@@ -78606,10 +78597,10 @@
|
|
|
78606
78597
|
this._detach(false);
|
|
78607
78598
|
}
|
|
78608
78599
|
|
|
78609
|
-
/**
|
|
78610
|
-
* @param {Schema} schema
|
|
78611
|
-
*
|
|
78612
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
78600
|
+
/**
|
|
78601
|
+
* @param {Schema} schema
|
|
78602
|
+
*
|
|
78603
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
78613
78604
|
*/
|
|
78614
78605
|
importSchema(schema) {
|
|
78615
78606
|
return new Promise((resolve, reject) => {
|
|
@@ -78638,15 +78629,15 @@
|
|
|
78638
78629
|
});
|
|
78639
78630
|
}
|
|
78640
78631
|
|
|
78641
|
-
/**
|
|
78642
|
-
* @returns {Schema}
|
|
78632
|
+
/**
|
|
78633
|
+
* @returns {Schema}
|
|
78643
78634
|
*/
|
|
78644
78635
|
saveSchema() {
|
|
78645
78636
|
return this.getSchema();
|
|
78646
78637
|
}
|
|
78647
78638
|
|
|
78648
|
-
/**
|
|
78649
|
-
* @returns {Schema}
|
|
78639
|
+
/**
|
|
78640
|
+
* @returns {Schema}
|
|
78650
78641
|
*/
|
|
78651
78642
|
getSchema() {
|
|
78652
78643
|
const {
|
|
@@ -78655,8 +78646,8 @@
|
|
|
78655
78646
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
78656
78647
|
}
|
|
78657
78648
|
|
|
78658
|
-
/**
|
|
78659
|
-
* @param {Element|string} parentNode
|
|
78649
|
+
/**
|
|
78650
|
+
* @param {Element|string} parentNode
|
|
78660
78651
|
*/
|
|
78661
78652
|
attachTo(parentNode) {
|
|
78662
78653
|
if (!parentNode) {
|
|
@@ -78674,10 +78665,10 @@
|
|
|
78674
78665
|
this._detach();
|
|
78675
78666
|
}
|
|
78676
78667
|
|
|
78677
|
-
/**
|
|
78678
|
-
* @internal
|
|
78679
|
-
*
|
|
78680
|
-
* @param {boolean} [emit]
|
|
78668
|
+
/**
|
|
78669
|
+
* @internal
|
|
78670
|
+
*
|
|
78671
|
+
* @param {boolean} [emit]
|
|
78681
78672
|
*/
|
|
78682
78673
|
_detach(emit = true) {
|
|
78683
78674
|
const container = this._container,
|
|
@@ -78691,9 +78682,9 @@
|
|
|
78691
78682
|
parentNode.removeChild(container);
|
|
78692
78683
|
}
|
|
78693
78684
|
|
|
78694
|
-
/**
|
|
78695
|
-
* @param {any} property
|
|
78696
|
-
* @param {any} value
|
|
78685
|
+
/**
|
|
78686
|
+
* @param {any} property
|
|
78687
|
+
* @param {any} value
|
|
78697
78688
|
*/
|
|
78698
78689
|
setProperty(property, value) {
|
|
78699
78690
|
const properties = set$2(this._getState().properties, [property], value);
|
|
@@ -78702,21 +78693,21 @@
|
|
|
78702
78693
|
});
|
|
78703
78694
|
}
|
|
78704
78695
|
|
|
78705
|
-
/**
|
|
78706
|
-
* @param {string} type
|
|
78707
|
-
* @param {Function} handler
|
|
78696
|
+
/**
|
|
78697
|
+
* @param {string} type
|
|
78698
|
+
* @param {Function} handler
|
|
78708
78699
|
*/
|
|
78709
78700
|
off(type, handler) {
|
|
78710
78701
|
this.get('eventBus').off(type, handler);
|
|
78711
78702
|
}
|
|
78712
78703
|
|
|
78713
|
-
/**
|
|
78714
|
-
* @internal
|
|
78715
|
-
*
|
|
78716
|
-
* @param {FormEditorOptions} options
|
|
78717
|
-
* @param {Element} container
|
|
78718
|
-
*
|
|
78719
|
-
* @returns {Injector}
|
|
78704
|
+
/**
|
|
78705
|
+
* @internal
|
|
78706
|
+
*
|
|
78707
|
+
* @param {FormEditorOptions} options
|
|
78708
|
+
* @param {Element} container
|
|
78709
|
+
*
|
|
78710
|
+
* @returns {Injector}
|
|
78720
78711
|
*/
|
|
78721
78712
|
_createInjector(options, container) {
|
|
78722
78713
|
const {
|
|
@@ -78739,22 +78730,22 @@
|
|
|
78739
78730
|
}, core, ...modules, ...additionalModules]);
|
|
78740
78731
|
}
|
|
78741
78732
|
|
|
78742
|
-
/**
|
|
78743
|
-
* @internal
|
|
78733
|
+
/**
|
|
78734
|
+
* @internal
|
|
78744
78735
|
*/
|
|
78745
78736
|
_emit(type, data) {
|
|
78746
78737
|
this.get('eventBus').fire(type, data);
|
|
78747
78738
|
}
|
|
78748
78739
|
|
|
78749
|
-
/**
|
|
78750
|
-
* @internal
|
|
78740
|
+
/**
|
|
78741
|
+
* @internal
|
|
78751
78742
|
*/
|
|
78752
78743
|
_getState() {
|
|
78753
78744
|
return this._state;
|
|
78754
78745
|
}
|
|
78755
78746
|
|
|
78756
|
-
/**
|
|
78757
|
-
* @internal
|
|
78747
|
+
/**
|
|
78748
|
+
* @internal
|
|
78758
78749
|
*/
|
|
78759
78750
|
_setState(state) {
|
|
78760
78751
|
this._state = {
|
|
@@ -78764,15 +78755,15 @@
|
|
|
78764
78755
|
this._emit('changed', this._getState());
|
|
78765
78756
|
}
|
|
78766
78757
|
|
|
78767
|
-
/**
|
|
78768
|
-
* @internal
|
|
78758
|
+
/**
|
|
78759
|
+
* @internal
|
|
78769
78760
|
*/
|
|
78770
78761
|
_getModules() {
|
|
78771
78762
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule, RenderInjectionModule, RepeatRenderManagerModule];
|
|
78772
78763
|
}
|
|
78773
78764
|
|
|
78774
|
-
/**
|
|
78775
|
-
* @internal
|
|
78765
|
+
/**
|
|
78766
|
+
* @internal
|
|
78776
78767
|
*/
|
|
78777
78768
|
_onEvent(type, priority, handler) {
|
|
78778
78769
|
this.get('eventBus').on(type, priority, handler);
|
|
@@ -80275,8 +80266,8 @@
|
|
|
80275
80266
|
return new LanguageSupport(jsonLanguage);
|
|
80276
80267
|
}
|
|
80277
80268
|
|
|
80278
|
-
/**
|
|
80279
|
-
* @type {Facet<import('..').Variables>} Variables
|
|
80269
|
+
/**
|
|
80270
|
+
* @type {Facet<import('..').Variables>} Variables
|
|
80280
80271
|
*/
|
|
80281
80272
|
const variablesFacet = Facet.define();
|
|
80282
80273
|
|
|
@@ -80453,11 +80444,11 @@
|
|
|
80453
80444
|
|
|
80454
80445
|
const NO_LINT_CLS = 'fjs-no-json-lint';
|
|
80455
80446
|
|
|
80456
|
-
/**
|
|
80457
|
-
* @param {object} options
|
|
80458
|
-
* @param {boolean} [options.readonly]
|
|
80459
|
-
* @param {object} [options.contentAttributes]
|
|
80460
|
-
* @param {string | HTMLElement} [options.placeholder]
|
|
80447
|
+
/**
|
|
80448
|
+
* @param {object} options
|
|
80449
|
+
* @param {boolean} [options.readonly]
|
|
80450
|
+
* @param {object} [options.contentAttributes]
|
|
80451
|
+
* @param {string | HTMLElement} [options.placeholder]
|
|
80461
80452
|
*/
|
|
80462
80453
|
function JSONEditor(options = {}) {
|
|
80463
80454
|
const {
|
|
@@ -80470,8 +80461,8 @@
|
|
|
80470
80461
|
let tabSize = new Compartment().of(EditorState.tabSize.of(2));
|
|
80471
80462
|
let container = null;
|
|
80472
80463
|
|
|
80473
|
-
/**
|
|
80474
|
-
* @typedef {Array<string>} Variables
|
|
80464
|
+
/**
|
|
80465
|
+
* @typedef {Array<string>} Variables
|
|
80475
80466
|
*/
|
|
80476
80467
|
|
|
80477
80468
|
const autocompletionConf = new Compartment();
|
|
@@ -80522,8 +80513,8 @@
|
|
|
80522
80513
|
return view.state.doc.toString();
|
|
80523
80514
|
};
|
|
80524
80515
|
|
|
80525
|
-
/**
|
|
80526
|
-
* @param {Variables} variables
|
|
80516
|
+
/**
|
|
80517
|
+
* @param {Variables} variables
|
|
80527
80518
|
*/
|
|
80528
80519
|
this.setVariables = function (variables) {
|
|
80529
80520
|
view.setVariables(variables);
|