@bpmn-io/form-js-playground 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/dist/assets/form-js-playground.css +259 -259
- package/dist/form-playground.umd.js +938 -938
- 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
|
|
@@ -56131,9 +56131,9 @@
|
|
|
56131
56131
|
create: createEmptyOptions
|
|
56132
56132
|
};
|
|
56133
56133
|
|
|
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
|
|
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
|
|
56137
56137
|
*/
|
|
56138
56138
|
function useGetLabelCorrelation(options) {
|
|
56139
56139
|
// This allows us to retrieve the label from a value in linear time
|
|
@@ -57292,28 +57292,28 @@
|
|
|
57292
57292
|
var CaretRightIcon = SvgCaretRight;
|
|
57293
57293
|
const type = 'table';
|
|
57294
57294
|
|
|
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}
|
|
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}
|
|
57317
57317
|
*/
|
|
57318
57318
|
function Table(props) {
|
|
57319
57319
|
const {
|
|
@@ -57523,10 +57523,10 @@
|
|
|
57523
57523
|
|
|
57524
57524
|
// helpers /////////////////////////////
|
|
57525
57525
|
|
|
57526
|
-
/**
|
|
57527
|
-
* @param {string|void} columnsExpression
|
|
57528
|
-
* @param {Column[]} fallbackColumns
|
|
57529
|
-
* @returns {Column[]}
|
|
57526
|
+
/**
|
|
57527
|
+
* @param {string|void} columnsExpression
|
|
57528
|
+
* @param {Column[]} fallbackColumns
|
|
57529
|
+
* @returns {Column[]}
|
|
57530
57530
|
*/
|
|
57531
57531
|
function useEvaluatedColumns(columnsExpression, fallbackColumns) {
|
|
57532
57532
|
/** @type {Column[]|null} */
|
|
@@ -57534,18 +57534,18 @@
|
|
|
57534
57534
|
return Array.isArray(evaluation) && evaluation.every(isColumn) ? evaluation : fallbackColumns;
|
|
57535
57535
|
}
|
|
57536
57536
|
|
|
57537
|
-
/**
|
|
57538
|
-
* @param {any} column
|
|
57539
|
-
* @returns {column is Column}
|
|
57537
|
+
/**
|
|
57538
|
+
* @param {any} column
|
|
57539
|
+
* @returns {column is Column}
|
|
57540
57540
|
*/
|
|
57541
57541
|
function isColumn(column) {
|
|
57542
57542
|
return isObject$4(column) && isString$4(column['label']) && isString$4(column['key']);
|
|
57543
57543
|
}
|
|
57544
57544
|
|
|
57545
|
-
/**
|
|
57546
|
-
* @param {Array} array
|
|
57547
|
-
* @param {number} size
|
|
57548
|
-
* @returns {Array}
|
|
57545
|
+
/**
|
|
57546
|
+
* @param {Array} array
|
|
57547
|
+
* @param {number} size
|
|
57548
|
+
* @returns {Array}
|
|
57549
57549
|
*/
|
|
57550
57550
|
function chunk(array, size) {
|
|
57551
57551
|
return array.reduce((chunks, item, index) => {
|
|
@@ -57558,11 +57558,11 @@
|
|
|
57558
57558
|
}, []);
|
|
57559
57559
|
}
|
|
57560
57560
|
|
|
57561
|
-
/**
|
|
57562
|
-
* @param {unknown[]} array
|
|
57563
|
-
* @param {string} key
|
|
57564
|
-
* @param {Direction} direction
|
|
57565
|
-
* @returns {unknown[]}
|
|
57561
|
+
/**
|
|
57562
|
+
* @param {unknown[]} array
|
|
57563
|
+
* @param {string} key
|
|
57564
|
+
* @param {Direction} direction
|
|
57565
|
+
* @returns {unknown[]}
|
|
57566
57566
|
*/
|
|
57567
57567
|
function sortByColumn(array, key, direction) {
|
|
57568
57568
|
return [...array].sort((a, b) => {
|
|
@@ -57576,10 +57576,10 @@
|
|
|
57576
57576
|
});
|
|
57577
57577
|
}
|
|
57578
57578
|
|
|
57579
|
-
/**
|
|
57580
|
-
* @param {null|Sorting} sortBy
|
|
57581
|
-
* @param {string} key
|
|
57582
|
-
* @param {string} label
|
|
57579
|
+
/**
|
|
57580
|
+
* @param {null|Sorting} sortBy
|
|
57581
|
+
* @param {string} key
|
|
57582
|
+
* @param {string} label
|
|
57583
57583
|
*/
|
|
57584
57584
|
function getHeaderAriaLabel(sortBy, key, label) {
|
|
57585
57585
|
if (sortBy === null || sortBy.key !== key) {
|
|
@@ -58178,37 +58178,37 @@
|
|
|
58178
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'];
|
|
58179
58179
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'url'];
|
|
58180
58180
|
|
|
58181
|
-
/**
|
|
58182
|
-
* @typedef { import('../types').Schema } Schema
|
|
58181
|
+
/**
|
|
58182
|
+
* @typedef { import('../types').Schema } Schema
|
|
58183
58183
|
*/
|
|
58184
58184
|
|
|
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[]}
|
|
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[]}
|
|
58212
58212
|
*/
|
|
58213
58213
|
function getSchemaVariables(schema, options = {}) {
|
|
58214
58214
|
const {
|
|
@@ -58284,13 +58284,13 @@
|
|
|
58284
58284
|
return Array.from(new Set(variables));
|
|
58285
58285
|
}
|
|
58286
58286
|
|
|
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
|
|
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
|
|
58294
58294
|
*/
|
|
58295
58295
|
const getAncestryList = (formFieldId, formFieldRegistry) => {
|
|
58296
58296
|
const ids = [];
|
|
@@ -58302,9 +58302,9 @@
|
|
|
58302
58302
|
return ids;
|
|
58303
58303
|
};
|
|
58304
58304
|
|
|
58305
|
-
/**
|
|
58306
|
-
* @typedef {object} Condition
|
|
58307
|
-
* @property {string} [hide]
|
|
58305
|
+
/**
|
|
58306
|
+
* @typedef {object} Condition
|
|
58307
|
+
* @property {string} [hide]
|
|
58308
58308
|
*/
|
|
58309
58309
|
|
|
58310
58310
|
class ConditionChecker {
|
|
@@ -58314,14 +58314,14 @@
|
|
|
58314
58314
|
this._eventBus = eventBus;
|
|
58315
58315
|
}
|
|
58316
58316
|
|
|
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]
|
|
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]
|
|
58325
58325
|
*/
|
|
58326
58326
|
applyConditions(data, contextData = {}, options = {}) {
|
|
58327
58327
|
const workingData = clone(data);
|
|
@@ -58415,13 +58415,13 @@
|
|
|
58415
58415
|
return workingData;
|
|
58416
58416
|
}
|
|
58417
58417
|
|
|
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}
|
|
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}
|
|
58425
58425
|
*/
|
|
58426
58426
|
check(condition, data = {}) {
|
|
58427
58427
|
if (!condition) {
|
|
@@ -58442,12 +58442,12 @@
|
|
|
58442
58442
|
}
|
|
58443
58443
|
}
|
|
58444
58444
|
|
|
58445
|
-
/**
|
|
58446
|
-
* Check if hide condition is met.
|
|
58447
|
-
*
|
|
58448
|
-
* @param {Condition} condition
|
|
58449
|
-
* @param {Object<string, any>} data
|
|
58450
|
-
* @returns {boolean}
|
|
58445
|
+
/**
|
|
58446
|
+
* Check if hide condition is met.
|
|
58447
|
+
*
|
|
58448
|
+
* @param {Condition} condition
|
|
58449
|
+
* @param {Object<string, any>} data
|
|
58450
|
+
* @returns {boolean}
|
|
58451
58451
|
*/
|
|
58452
58452
|
_checkHideCondition(condition, data) {
|
|
58453
58453
|
if (!condition.hide) {
|
|
@@ -58488,12 +58488,12 @@
|
|
|
58488
58488
|
this._converter = new showdown.Converter();
|
|
58489
58489
|
}
|
|
58490
58490
|
|
|
58491
|
-
/**
|
|
58492
|
-
* Render markdown to HTML.
|
|
58493
|
-
*
|
|
58494
|
-
* @param {string} markdown - The markdown to render
|
|
58495
|
-
*
|
|
58496
|
-
* @returns {string} HTML
|
|
58491
|
+
/**
|
|
58492
|
+
* Render markdown to HTML.
|
|
58493
|
+
*
|
|
58494
|
+
* @param {string} markdown - The markdown to render
|
|
58495
|
+
*
|
|
58496
|
+
* @returns {string} HTML
|
|
58497
58497
|
*/
|
|
58498
58498
|
render(markdown) {
|
|
58499
58499
|
return this._converter.makeHtml(markdown);
|
|
@@ -59158,11 +59158,11 @@
|
|
|
59158
59158
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
59159
59159
|
}
|
|
59160
59160
|
|
|
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
|
|
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
|
|
59166
59166
|
*/
|
|
59167
59167
|
isFieldRepeating(id) {
|
|
59168
59168
|
if (!id) {
|
|
@@ -59919,8 +59919,8 @@
|
|
|
59919
59919
|
|
|
59920
59920
|
// helpers //////////
|
|
59921
59921
|
|
|
59922
|
-
/**
|
|
59923
|
-
* Helper function to evaluate optional FEEL validation values.
|
|
59922
|
+
/**
|
|
59923
|
+
* Helper function to evaluate optional FEEL validation values.
|
|
59924
59924
|
*/
|
|
59925
59925
|
function evaluateFEELValues(validate, expressionLanguage, conditionChecker, form) {
|
|
59926
59926
|
const evaluatedValidate = {
|
|
@@ -59953,12 +59953,12 @@
|
|
|
59953
59953
|
return evaluatedValidate;
|
|
59954
59954
|
}
|
|
59955
59955
|
class Importer {
|
|
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
|
|
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
|
|
59962
59962
|
*/
|
|
59963
59963
|
constructor(formFieldRegistry, pathRegistry, fieldFactory, formLayouter) {
|
|
59964
59964
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -59967,21 +59967,21 @@
|
|
|
59967
59967
|
this._formLayouter = formLayouter;
|
|
59968
59968
|
}
|
|
59969
59969
|
|
|
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}
|
|
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}
|
|
59985
59985
|
*/
|
|
59986
59986
|
importSchema(schema) {
|
|
59987
59987
|
// TODO: Add warnings
|
|
@@ -60006,12 +60006,12 @@
|
|
|
60006
60006
|
this._pathRegistry.clear();
|
|
60007
60007
|
}
|
|
60008
60008
|
|
|
60009
|
-
/**
|
|
60010
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
60011
|
-
* @param {String} [parentId]
|
|
60012
|
-
* @param {number} [index]
|
|
60013
|
-
*
|
|
60014
|
-
* @return {any} field
|
|
60009
|
+
/**
|
|
60010
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
60011
|
+
* @param {String} [parentId]
|
|
60012
|
+
* @param {number} [index]
|
|
60013
|
+
*
|
|
60014
|
+
* @return {any} field
|
|
60015
60015
|
*/
|
|
60016
60016
|
importFormField(fieldAttrs, parentId, index) {
|
|
60017
60017
|
const {
|
|
@@ -60036,11 +60036,11 @@
|
|
|
60036
60036
|
return field;
|
|
60037
60037
|
}
|
|
60038
60038
|
|
|
60039
|
-
/**
|
|
60040
|
-
* @param {Array<any>} components
|
|
60041
|
-
* @param {string} parentId
|
|
60042
|
-
*
|
|
60043
|
-
* @return {Array<any>} imported components
|
|
60039
|
+
/**
|
|
60040
|
+
* @param {Array<any>} components
|
|
60041
|
+
* @param {string} parentId
|
|
60042
|
+
*
|
|
60043
|
+
* @return {Array<any>} imported components
|
|
60044
60044
|
*/
|
|
60045
60045
|
importFormFields(components, parentId) {
|
|
60046
60046
|
return components.map((component, index) => {
|
|
@@ -60050,11 +60050,11 @@
|
|
|
60050
60050
|
}
|
|
60051
60051
|
Importer.$inject = ['formFieldRegistry', 'pathRegistry', 'fieldFactory', 'formLayouter'];
|
|
60052
60052
|
class FieldFactory {
|
|
60053
|
-
/**
|
|
60054
|
-
* @constructor
|
|
60055
|
-
*
|
|
60056
|
-
* @param formFieldRegistry
|
|
60057
|
-
* @param formFields
|
|
60053
|
+
/**
|
|
60054
|
+
* @constructor
|
|
60055
|
+
*
|
|
60056
|
+
* @param formFieldRegistry
|
|
60057
|
+
* @param formFields
|
|
60058
60058
|
*/
|
|
60059
60059
|
constructor(formFieldRegistry, pathRegistry, formFields) {
|
|
60060
60060
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -60164,36 +60164,36 @@
|
|
|
60164
60164
|
}
|
|
60165
60165
|
FieldFactory.$inject = ['formFieldRegistry', 'pathRegistry', 'formFields'];
|
|
60166
60166
|
|
|
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
|
-
* ]
|
|
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
|
+
* ]
|
|
60197
60197
|
*/
|
|
60198
60198
|
class PathRegistry {
|
|
60199
60199
|
constructor(formFieldRegistry, formFields, injector) {
|
|
@@ -60309,16 +60309,16 @@
|
|
|
60309
60309
|
}
|
|
60310
60310
|
}
|
|
60311
60311
|
|
|
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.
|
|
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.
|
|
60322
60322
|
*/
|
|
60323
60323
|
executeRecursivelyOnFields(field, fn, context = {}) {
|
|
60324
60324
|
let result = true;
|
|
@@ -60359,16 +60359,16 @@
|
|
|
60359
60359
|
return result;
|
|
60360
60360
|
}
|
|
60361
60361
|
|
|
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.
|
|
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.
|
|
60372
60372
|
*/
|
|
60373
60373
|
getValuePath(field, options = {}) {
|
|
60374
60374
|
const {
|
|
@@ -60429,23 +60429,23 @@
|
|
|
60429
60429
|
};
|
|
60430
60430
|
PathRegistry.$inject = ['formFieldRegistry', 'formFields', 'injector'];
|
|
60431
60431
|
|
|
60432
|
-
/**
|
|
60433
|
-
* @typedef { { id: String, components: Array<String> } } FormRow
|
|
60434
|
-
* @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
|
|
60432
|
+
/**
|
|
60433
|
+
* @typedef { { id: String, components: Array<String> } } FormRow
|
|
60434
|
+
* @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
|
|
60435
60435
|
*/
|
|
60436
60436
|
|
|
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
|
-
*
|
|
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
|
+
*
|
|
60449
60449
|
*/
|
|
60450
60450
|
class FormLayouter {
|
|
60451
60451
|
constructor(eventBus) {
|
|
@@ -60455,8 +60455,8 @@
|
|
|
60455
60455
|
this._eventBus = eventBus;
|
|
60456
60456
|
}
|
|
60457
60457
|
|
|
60458
|
-
/**
|
|
60459
|
-
* @param {FormRow} row
|
|
60458
|
+
/**
|
|
60459
|
+
* @param {FormRow} row
|
|
60460
60460
|
*/
|
|
60461
60461
|
addRow(formFieldId, row) {
|
|
60462
60462
|
let rowsPerComponent = this._rows.find(r => r.formFieldId === formFieldId);
|
|
@@ -60470,18 +60470,18 @@
|
|
|
60470
60470
|
rowsPerComponent.rows.push(row);
|
|
60471
60471
|
}
|
|
60472
60472
|
|
|
60473
|
-
/**
|
|
60474
|
-
* @param {String} id
|
|
60475
|
-
* @returns {FormRow}
|
|
60473
|
+
/**
|
|
60474
|
+
* @param {String} id
|
|
60475
|
+
* @returns {FormRow}
|
|
60476
60476
|
*/
|
|
60477
60477
|
getRow(id) {
|
|
60478
60478
|
const rows = allRows(this._rows);
|
|
60479
60479
|
return rows.find(r => r.id === id);
|
|
60480
60480
|
}
|
|
60481
60481
|
|
|
60482
|
-
/**
|
|
60483
|
-
* @param {any} formField
|
|
60484
|
-
* @returns {FormRow}
|
|
60482
|
+
/**
|
|
60483
|
+
* @param {any} formField
|
|
60484
|
+
* @returns {FormRow}
|
|
60485
60485
|
*/
|
|
60486
60486
|
getRowForField(formField) {
|
|
60487
60487
|
return allRows(this._rows).find(r => {
|
|
@@ -60492,9 +60492,9 @@
|
|
|
60492
60492
|
});
|
|
60493
60493
|
}
|
|
60494
60494
|
|
|
60495
|
-
/**
|
|
60496
|
-
* @param {String} formFieldId
|
|
60497
|
-
* @returns { Array<FormRow> }
|
|
60495
|
+
/**
|
|
60496
|
+
* @param {String} formFieldId
|
|
60497
|
+
* @returns { Array<FormRow> }
|
|
60498
60498
|
*/
|
|
60499
60499
|
getRows(formFieldId) {
|
|
60500
60500
|
const rowsForField = this._rows.find(r => formFieldId === r.formFieldId);
|
|
@@ -60504,15 +60504,15 @@
|
|
|
60504
60504
|
return rowsForField.rows;
|
|
60505
60505
|
}
|
|
60506
60506
|
|
|
60507
|
-
/**
|
|
60508
|
-
* @returns {string}
|
|
60507
|
+
/**
|
|
60508
|
+
* @returns {string}
|
|
60509
60509
|
*/
|
|
60510
60510
|
nextRowId() {
|
|
60511
60511
|
return this._ids.nextPrefixed('Row_');
|
|
60512
60512
|
}
|
|
60513
60513
|
|
|
60514
|
-
/**
|
|
60515
|
-
* @param {any} formField
|
|
60514
|
+
/**
|
|
60515
|
+
* @param {any} formField
|
|
60516
60516
|
*/
|
|
60517
60517
|
calculateLayout(formField) {
|
|
60518
60518
|
const {
|
|
@@ -60566,9 +60566,9 @@
|
|
|
60566
60566
|
});
|
|
60567
60567
|
}
|
|
60568
60568
|
|
|
60569
|
-
/**
|
|
60570
|
-
* @param {Array<FormRows>} formRows
|
|
60571
|
-
* @returns {Array<FormRow>}
|
|
60569
|
+
/**
|
|
60570
|
+
* @param {Array<FormRows>} formRows
|
|
60571
|
+
* @returns {Array<FormRow>}
|
|
60572
60572
|
*/
|
|
60573
60573
|
function allRows(formRows) {
|
|
60574
60574
|
return flatten$3(formRows.map(c => c.rows));
|
|
@@ -60689,55 +60689,55 @@
|
|
|
60689
60689
|
validator: ['type', Validator]
|
|
60690
60690
|
};
|
|
60691
60691
|
|
|
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
|
|
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
|
|
60713
60713
|
*/
|
|
60714
60714
|
|
|
60715
60715
|
const ids$1 = new Ids([32, 36, 1]);
|
|
60716
60716
|
|
|
60717
|
-
/**
|
|
60718
|
-
* The form.
|
|
60717
|
+
/**
|
|
60718
|
+
* The form.
|
|
60719
60719
|
*/
|
|
60720
60720
|
class Form {
|
|
60721
|
-
/**
|
|
60722
|
-
* @constructor
|
|
60723
|
-
* @param {FormOptions} options
|
|
60721
|
+
/**
|
|
60722
|
+
* @constructor
|
|
60723
|
+
* @param {FormOptions} options
|
|
60724
60724
|
*/
|
|
60725
60725
|
constructor(options = {}) {
|
|
60726
|
-
/**
|
|
60727
|
-
* @public
|
|
60728
|
-
* @type {OnEventType}
|
|
60726
|
+
/**
|
|
60727
|
+
* @public
|
|
60728
|
+
* @type {OnEventType}
|
|
60729
60729
|
*/
|
|
60730
60730
|
this.on = this._onEvent;
|
|
60731
60731
|
|
|
60732
|
-
/**
|
|
60733
|
-
* @public
|
|
60734
|
-
* @type {String}
|
|
60732
|
+
/**
|
|
60733
|
+
* @public
|
|
60734
|
+
* @type {String}
|
|
60735
60735
|
*/
|
|
60736
60736
|
this._id = ids$1.next();
|
|
60737
60737
|
|
|
60738
|
-
/**
|
|
60739
|
-
* @private
|
|
60740
|
-
* @type {Element}
|
|
60738
|
+
/**
|
|
60739
|
+
* @private
|
|
60740
|
+
* @type {Element}
|
|
60741
60741
|
*/
|
|
60742
60742
|
this._container = createFormContainer();
|
|
60743
60743
|
const {
|
|
@@ -60746,9 +60746,9 @@
|
|
|
60746
60746
|
properties = {}
|
|
60747
60747
|
} = options;
|
|
60748
60748
|
|
|
60749
|
-
/**
|
|
60750
|
-
* @private
|
|
60751
|
-
* @type {State}
|
|
60749
|
+
/**
|
|
60750
|
+
* @private
|
|
60751
|
+
* @type {State}
|
|
60752
60752
|
*/
|
|
60753
60753
|
this._state = {
|
|
60754
60754
|
initialData: null,
|
|
@@ -60772,9 +60772,9 @@
|
|
|
60772
60772
|
this._emit('form.clear');
|
|
60773
60773
|
}
|
|
60774
60774
|
|
|
60775
|
-
/**
|
|
60776
|
-
* Destroy the form, removing it from DOM,
|
|
60777
|
-
* if attached.
|
|
60775
|
+
/**
|
|
60776
|
+
* Destroy the form, removing it from DOM,
|
|
60777
|
+
* if attached.
|
|
60778
60778
|
*/
|
|
60779
60779
|
destroy() {
|
|
60780
60780
|
// destroy form services
|
|
@@ -60785,13 +60785,13 @@
|
|
|
60785
60785
|
this._detach(false);
|
|
60786
60786
|
}
|
|
60787
60787
|
|
|
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> }>
|
|
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> }>
|
|
60795
60795
|
*/
|
|
60796
60796
|
importSchema(schema, data = {}) {
|
|
60797
60797
|
return new Promise((resolve, reject) => {
|
|
@@ -60824,10 +60824,10 @@
|
|
|
60824
60824
|
});
|
|
60825
60825
|
}
|
|
60826
60826
|
|
|
60827
|
-
/**
|
|
60828
|
-
* Submit the form, triggering all field validations.
|
|
60829
|
-
*
|
|
60830
|
-
* @returns { { data: Data, errors: Errors } }
|
|
60827
|
+
/**
|
|
60828
|
+
* Submit the form, triggering all field validations.
|
|
60829
|
+
*
|
|
60830
|
+
* @returns { { data: Data, errors: Errors } }
|
|
60831
60831
|
*/
|
|
60832
60832
|
submit() {
|
|
60833
60833
|
const {
|
|
@@ -60853,8 +60853,8 @@
|
|
|
60853
60853
|
});
|
|
60854
60854
|
}
|
|
60855
60855
|
|
|
60856
|
-
/**
|
|
60857
|
-
* @returns {Errors}
|
|
60856
|
+
/**
|
|
60857
|
+
* @returns {Errors}
|
|
60858
60858
|
*/
|
|
60859
60859
|
validate() {
|
|
60860
60860
|
const formFields = this.get('formFields'),
|
|
@@ -60926,8 +60926,8 @@
|
|
|
60926
60926
|
return filteredErrors;
|
|
60927
60927
|
}
|
|
60928
60928
|
|
|
60929
|
-
/**
|
|
60930
|
-
* @param {Element|string} parentNode
|
|
60929
|
+
/**
|
|
60930
|
+
* @param {Element|string} parentNode
|
|
60931
60931
|
*/
|
|
60932
60932
|
attachTo(parentNode) {
|
|
60933
60933
|
if (!parentNode) {
|
|
@@ -60945,10 +60945,10 @@
|
|
|
60945
60945
|
this._detach();
|
|
60946
60946
|
}
|
|
60947
60947
|
|
|
60948
|
-
/**
|
|
60949
|
-
* @private
|
|
60950
|
-
*
|
|
60951
|
-
* @param {boolean} [emit]
|
|
60948
|
+
/**
|
|
60949
|
+
* @private
|
|
60950
|
+
*
|
|
60951
|
+
* @param {boolean} [emit]
|
|
60952
60952
|
*/
|
|
60953
60953
|
_detach(emit = true) {
|
|
60954
60954
|
const container = this._container,
|
|
@@ -60962,9 +60962,9 @@
|
|
|
60962
60962
|
parentNode.removeChild(container);
|
|
60963
60963
|
}
|
|
60964
60964
|
|
|
60965
|
-
/**
|
|
60966
|
-
* @param {FormProperty} property
|
|
60967
|
-
* @param {any} value
|
|
60965
|
+
/**
|
|
60966
|
+
* @param {FormProperty} property
|
|
60967
|
+
* @param {any} value
|
|
60968
60968
|
*/
|
|
60969
60969
|
setProperty(property, value) {
|
|
60970
60970
|
const properties = set$3(this._getState().properties, [property], value);
|
|
@@ -60973,21 +60973,21 @@
|
|
|
60973
60973
|
});
|
|
60974
60974
|
}
|
|
60975
60975
|
|
|
60976
|
-
/**
|
|
60977
|
-
* @param {FormEvent} type
|
|
60978
|
-
* @param {Function} handler
|
|
60976
|
+
/**
|
|
60977
|
+
* @param {FormEvent} type
|
|
60978
|
+
* @param {Function} handler
|
|
60979
60979
|
*/
|
|
60980
60980
|
off(type, handler) {
|
|
60981
60981
|
this.get('eventBus').off(type, handler);
|
|
60982
60982
|
}
|
|
60983
60983
|
|
|
60984
|
-
/**
|
|
60985
|
-
* @private
|
|
60986
|
-
*
|
|
60987
|
-
* @param {FormOptions} options
|
|
60988
|
-
* @param {Element} container
|
|
60989
|
-
*
|
|
60990
|
-
* @returns {Injector}
|
|
60984
|
+
/**
|
|
60985
|
+
* @private
|
|
60986
|
+
*
|
|
60987
|
+
* @param {FormOptions} options
|
|
60988
|
+
* @param {Element} container
|
|
60989
|
+
*
|
|
60990
|
+
* @returns {Injector}
|
|
60991
60991
|
*/
|
|
60992
60992
|
_createInjector(options, container) {
|
|
60993
60993
|
const {
|
|
@@ -61008,17 +61008,17 @@
|
|
|
61008
61008
|
}, core$1, ...modules, ...additionalModules]);
|
|
61009
61009
|
}
|
|
61010
61010
|
|
|
61011
|
-
/**
|
|
61012
|
-
* @private
|
|
61011
|
+
/**
|
|
61012
|
+
* @private
|
|
61013
61013
|
*/
|
|
61014
61014
|
_emit(type, data) {
|
|
61015
61015
|
this.get('eventBus').fire(type, data);
|
|
61016
61016
|
}
|
|
61017
61017
|
|
|
61018
|
-
/**
|
|
61019
|
-
* @internal
|
|
61020
|
-
*
|
|
61021
|
-
* @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
|
|
61022
61022
|
*/
|
|
61023
61023
|
_update(update) {
|
|
61024
61024
|
const {
|
|
@@ -61044,15 +61044,15 @@
|
|
|
61044
61044
|
});
|
|
61045
61045
|
}
|
|
61046
61046
|
|
|
61047
|
-
/**
|
|
61048
|
-
* @internal
|
|
61047
|
+
/**
|
|
61048
|
+
* @internal
|
|
61049
61049
|
*/
|
|
61050
61050
|
_getState() {
|
|
61051
61051
|
return this._state;
|
|
61052
61052
|
}
|
|
61053
61053
|
|
|
61054
|
-
/**
|
|
61055
|
-
* @internal
|
|
61054
|
+
/**
|
|
61055
|
+
* @internal
|
|
61056
61056
|
*/
|
|
61057
61057
|
_setState(state) {
|
|
61058
61058
|
this._state = {
|
|
@@ -61062,22 +61062,22 @@
|
|
|
61062
61062
|
this._emit('changed', this._getState());
|
|
61063
61063
|
}
|
|
61064
61064
|
|
|
61065
|
-
/**
|
|
61066
|
-
* @internal
|
|
61065
|
+
/**
|
|
61066
|
+
* @internal
|
|
61067
61067
|
*/
|
|
61068
61068
|
_getModules() {
|
|
61069
61069
|
return [ExpressionLanguageModule$1, MarkdownModule, ViewerCommandsModule, RepeatRenderModule];
|
|
61070
61070
|
}
|
|
61071
61071
|
|
|
61072
|
-
/**
|
|
61073
|
-
* @internal
|
|
61072
|
+
/**
|
|
61073
|
+
* @internal
|
|
61074
61074
|
*/
|
|
61075
61075
|
_onEvent(type, priority, handler) {
|
|
61076
61076
|
this.get('eventBus').on(type, priority, handler);
|
|
61077
61077
|
}
|
|
61078
61078
|
|
|
61079
|
-
/**
|
|
61080
|
-
* @internal
|
|
61079
|
+
/**
|
|
61080
|
+
* @internal
|
|
61081
61081
|
*/
|
|
61082
61082
|
_getSubmitData() {
|
|
61083
61083
|
const formFieldRegistry = this.get('formFieldRegistry');
|
|
@@ -61134,16 +61134,16 @@
|
|
|
61134
61134
|
return this._applyConditions(workingSubmitData, formData);
|
|
61135
61135
|
}
|
|
61136
61136
|
|
|
61137
|
-
/**
|
|
61138
|
-
* @internal
|
|
61137
|
+
/**
|
|
61138
|
+
* @internal
|
|
61139
61139
|
*/
|
|
61140
61140
|
_applyConditions(toFilter, data, options = {}) {
|
|
61141
61141
|
const conditionChecker = this.get('conditionChecker');
|
|
61142
61142
|
return conditionChecker.applyConditions(toFilter, data, options);
|
|
61143
61143
|
}
|
|
61144
61144
|
|
|
61145
|
-
/**
|
|
61146
|
-
* @internal
|
|
61145
|
+
/**
|
|
61146
|
+
* @internal
|
|
61147
61147
|
*/
|
|
61148
61148
|
_getInitializedFieldData(data, options = {}) {
|
|
61149
61149
|
const formFieldRegistry = this.get('formFieldRegistry');
|
|
@@ -66279,10 +66279,10 @@
|
|
|
66279
66279
|
return fn.apply(null, args);
|
|
66280
66280
|
}
|
|
66281
66281
|
|
|
66282
|
-
/**
|
|
66283
|
-
* A factory to create a configurable debouncer.
|
|
66284
|
-
*
|
|
66285
|
-
* @param {number|boolean} [config=true]
|
|
66282
|
+
/**
|
|
66283
|
+
* A factory to create a configurable debouncer.
|
|
66284
|
+
*
|
|
66285
|
+
* @param {number|boolean} [config=true]
|
|
66286
66286
|
*/
|
|
66287
66287
|
function DebounceFactory(config = true) {
|
|
66288
66288
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -66294,11 +66294,11 @@
|
|
|
66294
66294
|
}
|
|
66295
66295
|
DebounceFactory.$inject = ['config.debounce'];
|
|
66296
66296
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
66297
|
-
/**
|
|
66298
|
-
* Updates a form fields id.
|
|
66299
|
-
*
|
|
66300
|
-
* @param {Object} formField
|
|
66301
|
-
* @param {string} newId
|
|
66297
|
+
/**
|
|
66298
|
+
* Updates a form fields id.
|
|
66299
|
+
*
|
|
66300
|
+
* @param {Object} formField
|
|
66301
|
+
* @param {string} newId
|
|
66302
66302
|
*/
|
|
66303
66303
|
updateId(formField, newId) {
|
|
66304
66304
|
this._validateId(newId);
|
|
@@ -66319,13 +66319,13 @@
|
|
|
66319
66319
|
}
|
|
66320
66320
|
}
|
|
66321
66321
|
|
|
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
|
|
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
|
|
66329
66329
|
*/
|
|
66330
66330
|
_validateId(id) {
|
|
66331
66331
|
if (!id) {
|
|
@@ -66341,11 +66341,11 @@
|
|
|
66341
66341
|
const MIN_COLUMNS = 2;
|
|
66342
66342
|
const MAX_FIELDS_PER_ROW = 4;
|
|
66343
66343
|
class FormLayoutValidator {
|
|
66344
|
-
/**
|
|
66345
|
-
* @constructor
|
|
66346
|
-
*
|
|
66347
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
66348
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
66344
|
+
/**
|
|
66345
|
+
* @constructor
|
|
66346
|
+
*
|
|
66347
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
66348
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
66349
66349
|
*/
|
|
66350
66350
|
constructor(formLayouter, formFieldRegistry) {
|
|
66351
66351
|
this._formLayouter = formLayouter;
|
|
@@ -66415,21 +66415,21 @@
|
|
|
66415
66415
|
});
|
|
66416
66416
|
}
|
|
66417
66417
|
|
|
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
|
|
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
|
|
66433
66433
|
*/
|
|
66434
66434
|
function createDragger$1(fn) {
|
|
66435
66435
|
let self;
|
|
@@ -66470,12 +66470,12 @@
|
|
|
66470
66470
|
return onDragStart;
|
|
66471
66471
|
}
|
|
66472
66472
|
|
|
66473
|
-
/**
|
|
66474
|
-
* Throttle function call according UI update cycle.
|
|
66475
|
-
*
|
|
66476
|
-
* @param {Function} fn
|
|
66477
|
-
*
|
|
66478
|
-
* @return {Function} throttled fn
|
|
66473
|
+
/**
|
|
66474
|
+
* Throttle function call according UI update cycle.
|
|
66475
|
+
*
|
|
66476
|
+
* @param {Function} fn
|
|
66477
|
+
*
|
|
66478
|
+
* @return {Function} throttled fn
|
|
66479
66479
|
*/
|
|
66480
66480
|
function throttle(fn) {
|
|
66481
66481
|
let active = false;
|
|
@@ -66529,11 +66529,11 @@
|
|
|
66529
66529
|
});
|
|
66530
66530
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
66531
66531
|
|
|
66532
|
-
/**
|
|
66533
|
-
* @param {string} type
|
|
66534
|
-
* @param {boolean} [strict]
|
|
66535
|
-
*
|
|
66536
|
-
* @returns {any}
|
|
66532
|
+
/**
|
|
66533
|
+
* @param {string} type
|
|
66534
|
+
* @param {boolean} [strict]
|
|
66535
|
+
*
|
|
66536
|
+
* @returns {any}
|
|
66537
66537
|
*/
|
|
66538
66538
|
function getService$1(type, strict) {}
|
|
66539
66539
|
const FormEditorContext = D$2({
|
|
@@ -66997,23 +66997,23 @@
|
|
|
66997
66997
|
return fillsAndSeparators;
|
|
66998
66998
|
};
|
|
66999
66999
|
|
|
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
|
|
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
|
|
67005
67005
|
*/
|
|
67006
67006
|
const FillFragment = fill => e$1(d$1, {
|
|
67007
67007
|
children: fill.children
|
|
67008
67008
|
}, fill.id);
|
|
67009
67009
|
|
|
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
|
|
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
|
|
67017
67017
|
*/
|
|
67018
67018
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
67019
67019
|
const result = [];
|
|
@@ -67031,8 +67031,8 @@
|
|
|
67031
67031
|
return result;
|
|
67032
67032
|
};
|
|
67033
67033
|
|
|
67034
|
-
/**
|
|
67035
|
-
* Groups fills by group name property.
|
|
67034
|
+
/**
|
|
67035
|
+
* Groups fills by group name property.
|
|
67036
67036
|
*/
|
|
67037
67037
|
const _groupByGroupName = fills => {
|
|
67038
67038
|
const groups = [];
|
|
@@ -67052,8 +67052,8 @@
|
|
|
67052
67052
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
67053
67053
|
};
|
|
67054
67054
|
|
|
67055
|
-
/**
|
|
67056
|
-
* Compares fills by priority.
|
|
67055
|
+
/**
|
|
67056
|
+
* Compares fills by priority.
|
|
67057
67057
|
*/
|
|
67058
67058
|
const _comparePriority = (a, b) => {
|
|
67059
67059
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -67268,11 +67268,11 @@
|
|
|
67268
67268
|
return groups.filter(g => g.entries.length);
|
|
67269
67269
|
}
|
|
67270
67270
|
|
|
67271
|
-
/**
|
|
67272
|
-
* Returns a list of palette entries.
|
|
67273
|
-
*
|
|
67274
|
-
* @param {FormFields} formFields
|
|
67275
|
-
* @returns {Array<PaletteEntry>}
|
|
67271
|
+
/**
|
|
67272
|
+
* Returns a list of palette entries.
|
|
67273
|
+
*
|
|
67274
|
+
* @param {FormFields} formFields
|
|
67275
|
+
* @returns {Array<PaletteEntry>}
|
|
67276
67276
|
*/
|
|
67277
67277
|
function collectPaletteEntries(formFields) {
|
|
67278
67278
|
return Object.entries(formFields._formFields).map(([type, formField]) => {
|
|
@@ -67291,12 +67291,12 @@
|
|
|
67291
67291
|
}) => type !== 'default');
|
|
67292
67292
|
}
|
|
67293
67293
|
|
|
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)
|
|
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)
|
|
67300
67300
|
*/
|
|
67301
67301
|
function getPaletteIcon(entry) {
|
|
67302
67302
|
const {
|
|
@@ -67360,20 +67360,20 @@
|
|
|
67360
67360
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
67361
67361
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
67362
67362
|
|
|
67363
|
-
/**
|
|
67364
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
67363
|
+
/**
|
|
67364
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
67365
67365
|
*/
|
|
67366
67366
|
|
|
67367
67367
|
class Dragging {
|
|
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
|
|
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
|
|
67377
67377
|
*/
|
|
67378
67378
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling, pathRegistry) {
|
|
67379
67379
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -67384,13 +67384,13 @@
|
|
|
67384
67384
|
this._pathRegistry = pathRegistry;
|
|
67385
67385
|
}
|
|
67386
67386
|
|
|
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 }
|
|
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 }
|
|
67394
67394
|
*/
|
|
67395
67395
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
67396
67396
|
/** @type HTMLElement */
|
|
@@ -67536,8 +67536,8 @@
|
|
|
67536
67536
|
}
|
|
67537
67537
|
}
|
|
67538
67538
|
|
|
67539
|
-
/**
|
|
67540
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
67539
|
+
/**
|
|
67540
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
67541
67541
|
*/
|
|
67542
67542
|
createDragulaInstance(options) {
|
|
67543
67543
|
const {
|
|
@@ -67973,7 +67973,7 @@
|
|
|
67973
67973
|
return null;
|
|
67974
67974
|
}
|
|
67975
67975
|
return e$1("div", {
|
|
67976
|
-
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;",
|
|
67977
67977
|
class: "fjs-debug-columns",
|
|
67978
67978
|
children: (field.layout || {}).columns || 'auto'
|
|
67979
67979
|
});
|
|
@@ -69088,10 +69088,10 @@
|
|
|
69088
69088
|
return formField;
|
|
69089
69089
|
}
|
|
69090
69090
|
class AddFormFieldHandler {
|
|
69091
|
-
/**
|
|
69092
|
-
* @constructor
|
|
69093
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69094
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69091
|
+
/**
|
|
69092
|
+
* @constructor
|
|
69093
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69094
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69095
69095
|
*/
|
|
69096
69096
|
constructor(formEditor, formFieldRegistry) {
|
|
69097
69097
|
this._formEditor = formEditor;
|
|
@@ -69151,10 +69151,10 @@
|
|
|
69151
69151
|
}
|
|
69152
69152
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
69153
69153
|
class EditFormFieldHandler {
|
|
69154
|
-
/**
|
|
69155
|
-
* @constructor
|
|
69156
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69157
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69154
|
+
/**
|
|
69155
|
+
* @constructor
|
|
69156
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69157
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69158
69158
|
*/
|
|
69159
69159
|
constructor(formEditor, formFieldRegistry) {
|
|
69160
69160
|
this._formEditor = formEditor;
|
|
@@ -69216,12 +69216,12 @@
|
|
|
69216
69216
|
}
|
|
69217
69217
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
69218
69218
|
class MoveFormFieldHandler {
|
|
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
|
|
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
|
|
69225
69225
|
*/
|
|
69226
69226
|
constructor(formEditor, formFieldRegistry, pathRegistry, formLayouter) {
|
|
69227
69227
|
this._formEditor = formEditor;
|
|
@@ -69331,10 +69331,10 @@
|
|
|
69331
69331
|
}
|
|
69332
69332
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry', 'pathRegistry', 'formLayouter'];
|
|
69333
69333
|
class RemoveFormFieldHandler {
|
|
69334
|
-
/**
|
|
69335
|
-
* @constructor
|
|
69336
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
69337
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69334
|
+
/**
|
|
69335
|
+
* @constructor
|
|
69336
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
69337
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69338
69338
|
*/
|
|
69339
69339
|
constructor(formEditor, formFieldRegistry) {
|
|
69340
69340
|
this._formEditor = formEditor;
|
|
@@ -69393,9 +69393,9 @@
|
|
|
69393
69393
|
}
|
|
69394
69394
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
69395
69395
|
class UpdateIdClaimHandler {
|
|
69396
|
-
/**
|
|
69397
|
-
* @constructor
|
|
69398
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69396
|
+
/**
|
|
69397
|
+
* @constructor
|
|
69398
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
69399
69399
|
*/
|
|
69400
69400
|
constructor(formFieldRegistry) {
|
|
69401
69401
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -69427,9 +69427,9 @@
|
|
|
69427
69427
|
}
|
|
69428
69428
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
69429
69429
|
class UpdateKeyClaimHandler {
|
|
69430
|
-
/**
|
|
69431
|
-
* @constructor
|
|
69432
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69430
|
+
/**
|
|
69431
|
+
* @constructor
|
|
69432
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69433
69433
|
*/
|
|
69434
69434
|
constructor(pathRegistry) {
|
|
69435
69435
|
this._pathRegistry = pathRegistry;
|
|
@@ -69476,9 +69476,9 @@
|
|
|
69476
69476
|
}
|
|
69477
69477
|
UpdateKeyClaimHandler.$inject = ['pathRegistry'];
|
|
69478
69478
|
class UpdatePathClaimHandler {
|
|
69479
|
-
/**
|
|
69480
|
-
* @constructor
|
|
69481
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69479
|
+
/**
|
|
69480
|
+
* @constructor
|
|
69481
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
69482
69482
|
*/
|
|
69483
69483
|
constructor(pathRegistry) {
|
|
69484
69484
|
this._pathRegistry = pathRegistry;
|
|
@@ -70059,8 +70059,8 @@
|
|
|
70059
70059
|
constructor(eventBus) {
|
|
70060
70060
|
super(eventBus);
|
|
70061
70061
|
|
|
70062
|
-
/**
|
|
70063
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
70062
|
+
/**
|
|
70063
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
70064
70064
|
*/
|
|
70065
70065
|
this.preExecute('formField.edit', function (context) {
|
|
70066
70066
|
const {
|
|
@@ -70086,11 +70086,11 @@
|
|
|
70086
70086
|
constructor(eventBus) {
|
|
70087
70087
|
super(eventBus);
|
|
70088
70088
|
|
|
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
|
|
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
|
|
70094
70094
|
*/
|
|
70095
70095
|
this.preExecute('formField.edit', function (context) {
|
|
70096
70096
|
const {
|
|
@@ -70743,22 +70743,22 @@
|
|
|
70743
70743
|
selectionBehavior: ['type', SelectionBehavior]
|
|
70744
70744
|
};
|
|
70745
70745
|
|
|
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
|
|
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
|
|
70753
70753
|
*/
|
|
70754
70754
|
class SectionModuleBase {
|
|
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
|
|
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
|
|
70762
70762
|
*/
|
|
70763
70763
|
constructor(eventBus, sectionKey) {
|
|
70764
70764
|
this._eventBus = eventBus;
|
|
@@ -70771,10 +70771,10 @@
|
|
|
70771
70771
|
});
|
|
70772
70772
|
}
|
|
70773
70773
|
|
|
70774
|
-
/**
|
|
70775
|
-
* Attach the managed section to a parent node.
|
|
70776
|
-
*
|
|
70777
|
-
* @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.
|
|
70778
70778
|
*/
|
|
70779
70779
|
attachTo(container) {
|
|
70780
70780
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -70782,22 +70782,22 @@
|
|
|
70782
70782
|
}));
|
|
70783
70783
|
}
|
|
70784
70784
|
|
|
70785
|
-
/**
|
|
70786
|
-
* Detach the managed section from its parent node.
|
|
70785
|
+
/**
|
|
70786
|
+
* Detach the managed section from its parent node.
|
|
70787
70787
|
*/
|
|
70788
70788
|
detach() {
|
|
70789
70789
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
70790
70790
|
}
|
|
70791
70791
|
|
|
70792
|
-
/**
|
|
70793
|
-
* Reset the managed section to its initial state.
|
|
70792
|
+
/**
|
|
70793
|
+
* Reset the managed section to its initial state.
|
|
70794
70794
|
*/
|
|
70795
70795
|
reset() {
|
|
70796
70796
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
70797
70797
|
}
|
|
70798
70798
|
|
|
70799
|
-
/**
|
|
70800
|
-
* Circumvents timing issues.
|
|
70799
|
+
/**
|
|
70800
|
+
* Circumvents timing issues.
|
|
70801
70801
|
*/
|
|
70802
70802
|
_onceSectionRendered(callback) {
|
|
70803
70803
|
if (this.isSectionRendered) {
|
|
@@ -74472,11 +74472,11 @@
|
|
|
74472
74472
|
feelPopup: ['type', FeelPopupModule]
|
|
74473
74473
|
};
|
|
74474
74474
|
|
|
74475
|
-
/**
|
|
74476
|
-
* @param {string} type
|
|
74477
|
-
* @param {boolean} [strict]
|
|
74478
|
-
*
|
|
74479
|
-
* @returns {any}
|
|
74475
|
+
/**
|
|
74476
|
+
* @param {string} type
|
|
74477
|
+
* @param {boolean} [strict]
|
|
74478
|
+
*
|
|
74479
|
+
* @returns {any}
|
|
74480
74480
|
*/
|
|
74481
74481
|
function getService(type, strict) {}
|
|
74482
74482
|
const PropertiesPanelContext = D$2({
|
|
@@ -74509,8 +74509,8 @@
|
|
|
74509
74509
|
return null;
|
|
74510
74510
|
}
|
|
74511
74511
|
|
|
74512
|
-
/**
|
|
74513
|
-
* @param {string} path
|
|
74512
|
+
/**
|
|
74513
|
+
* @param {string} path
|
|
74514
74514
|
*/
|
|
74515
74515
|
function isValidDotPath(path) {
|
|
74516
74516
|
return /^\w+(\.\w+)*$/.test(path);
|
|
@@ -74536,8 +74536,8 @@
|
|
|
74536
74536
|
return propertiesPanelEntries.some(id => id === 'values');
|
|
74537
74537
|
}
|
|
74538
74538
|
|
|
74539
|
-
/**
|
|
74540
|
-
* @param {string} path
|
|
74539
|
+
/**
|
|
74540
|
+
* @param {string} path
|
|
74541
74541
|
*/
|
|
74542
74542
|
function hasIntegerPathSegment(path) {
|
|
74543
74543
|
return path.split('.').some(segment => /^\d+$/.test(segment));
|
|
@@ -74549,10 +74549,10 @@
|
|
|
74549
74549
|
return getService(type, strict);
|
|
74550
74550
|
}
|
|
74551
74551
|
|
|
74552
|
-
/**
|
|
74553
|
-
* Retrieve list of variables from the form schema.
|
|
74554
|
-
*
|
|
74555
|
-
* @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
|
|
74556
74556
|
*/
|
|
74557
74557
|
function useVariables() {
|
|
74558
74558
|
const form = useService('formEditor');
|
|
@@ -74617,8 +74617,8 @@
|
|
|
74617
74617
|
}
|
|
74618
74618
|
};
|
|
74619
74619
|
|
|
74620
|
-
/**
|
|
74621
|
-
* Provide placeholders for empty and multiple state.
|
|
74620
|
+
/**
|
|
74621
|
+
* Provide placeholders for empty and multiple state.
|
|
74622
74622
|
*/
|
|
74623
74623
|
const PropertiesPanelPlaceholderProvider = {
|
|
74624
74624
|
getEmpty: () => {
|
|
@@ -74662,9 +74662,9 @@
|
|
|
74662
74662
|
});
|
|
74663
74663
|
}, [eventBus, formEditor, selectionModule]);
|
|
74664
74664
|
h$1(() => {
|
|
74665
|
-
/**
|
|
74666
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
74667
|
-
* 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
|
|
74668
74668
|
*/
|
|
74669
74669
|
eventBus.on('changed', refresh);
|
|
74670
74670
|
eventBus.on('import.done', refresh);
|
|
@@ -74715,17 +74715,17 @@
|
|
|
74715
74715
|
}
|
|
74716
74716
|
const DEFAULT_PRIORITY = 1000;
|
|
74717
74717
|
|
|
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
|
|
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
|
|
74723
74723
|
*/
|
|
74724
74724
|
|
|
74725
|
-
/**
|
|
74726
|
-
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
74727
|
-
* @param {Injector} injector
|
|
74728
|
-
* @param {EventBus} eventBus
|
|
74725
|
+
/**
|
|
74726
|
+
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
74727
|
+
* @param {Injector} injector
|
|
74728
|
+
* @param {EventBus} eventBus
|
|
74729
74729
|
*/
|
|
74730
74730
|
class PropertiesPanelRenderer {
|
|
74731
74731
|
constructor(propertiesPanelConfig, injector, eventBus) {
|
|
@@ -74743,10 +74743,10 @@
|
|
|
74743
74743
|
});
|
|
74744
74744
|
}
|
|
74745
74745
|
|
|
74746
|
-
/**
|
|
74747
|
-
* Attach the properties panel to a parent node.
|
|
74748
|
-
*
|
|
74749
|
-
* @param {HTMLElement} container
|
|
74746
|
+
/**
|
|
74747
|
+
* Attach the properties panel to a parent node.
|
|
74748
|
+
*
|
|
74749
|
+
* @param {HTMLElement} container
|
|
74750
74750
|
*/
|
|
74751
74751
|
attachTo(container) {
|
|
74752
74752
|
if (!container) {
|
|
@@ -74766,8 +74766,8 @@
|
|
|
74766
74766
|
this._eventBus.fire('propertiesPanel.attach');
|
|
74767
74767
|
}
|
|
74768
74768
|
|
|
74769
|
-
/**
|
|
74770
|
-
* Detach the properties panel from its parent node.
|
|
74769
|
+
/**
|
|
74770
|
+
* Detach the properties panel from its parent node.
|
|
74771
74771
|
*/
|
|
74772
74772
|
detach() {
|
|
74773
74773
|
const parentNode = this._container.parentNode;
|
|
@@ -74791,11 +74791,11 @@
|
|
|
74791
74791
|
}
|
|
74792
74792
|
}
|
|
74793
74793
|
|
|
74794
|
-
/**
|
|
74795
|
-
* Register a new properties provider to the properties panel.
|
|
74796
|
-
*
|
|
74797
|
-
* @param {PropertiesProvider} provider
|
|
74798
|
-
* @param {Number} [priority]
|
|
74794
|
+
/**
|
|
74795
|
+
* Register a new properties provider to the properties panel.
|
|
74796
|
+
*
|
|
74797
|
+
* @param {PropertiesProvider} provider
|
|
74798
|
+
* @param {Number} [priority]
|
|
74799
74799
|
*/
|
|
74800
74800
|
registerProvider(provider, priority) {
|
|
74801
74801
|
if (!priority) {
|
|
@@ -75861,9 +75861,9 @@
|
|
|
75861
75861
|
|
|
75862
75862
|
// helpers //////////
|
|
75863
75863
|
|
|
75864
|
-
/**
|
|
75865
|
-
* @param {string} type
|
|
75866
|
-
* @returns {string}
|
|
75864
|
+
/**
|
|
75865
|
+
* @param {string} type
|
|
75866
|
+
* @returns {string}
|
|
75867
75867
|
*/
|
|
75868
75868
|
function getLabelText(type) {
|
|
75869
75869
|
switch (type) {
|
|
@@ -76664,14 +76664,14 @@
|
|
|
76664
76664
|
|
|
76665
76665
|
// helpers //////////
|
|
76666
76666
|
|
|
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}
|
|
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}
|
|
76675
76675
|
*/
|
|
76676
76676
|
function updateValue(properties, key, value) {
|
|
76677
76677
|
return {
|
|
@@ -76680,14 +76680,14 @@
|
|
|
76680
76680
|
};
|
|
76681
76681
|
}
|
|
76682
76682
|
|
|
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}
|
|
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}
|
|
76691
76691
|
*/
|
|
76692
76692
|
function updateKey(properties, oldKey, newKey) {
|
|
76693
76693
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -77244,9 +77244,9 @@
|
|
|
77244
77244
|
editField(field, path, value);
|
|
77245
77245
|
};
|
|
77246
77246
|
|
|
77247
|
-
/**
|
|
77248
|
-
* @param {string|void} value
|
|
77249
|
-
* @returns {string|null}
|
|
77247
|
+
/**
|
|
77248
|
+
* @param {string|void} value
|
|
77249
|
+
* @returns {string|null}
|
|
77250
77250
|
*/
|
|
77251
77251
|
const validate = value => {
|
|
77252
77252
|
if (!isString(value) || value.length === 0) {
|
|
@@ -77306,8 +77306,8 @@
|
|
|
77306
77306
|
return isNumber(get(field, path));
|
|
77307
77307
|
};
|
|
77308
77308
|
|
|
77309
|
-
/**
|
|
77310
|
-
* @param {boolean} value
|
|
77309
|
+
/**
|
|
77310
|
+
* @param {boolean} value
|
|
77311
77311
|
*/
|
|
77312
77312
|
const setValue = value => {
|
|
77313
77313
|
value ? editField(field, path, defaultRowCount) : editField(field, path, undefined);
|
|
@@ -77347,10 +77347,10 @@
|
|
|
77347
77347
|
const debounce = useService('debounce');
|
|
77348
77348
|
const getValue = () => get(field, path$2);
|
|
77349
77349
|
|
|
77350
|
-
/**
|
|
77351
|
-
* @param {number|void} value
|
|
77352
|
-
* @param {string|null} error
|
|
77353
|
-
* @returns {void}
|
|
77350
|
+
/**
|
|
77351
|
+
* @param {number|void} value
|
|
77352
|
+
* @param {string|null} error
|
|
77353
|
+
* @returns {void}
|
|
77354
77354
|
*/
|
|
77355
77355
|
const setValue = (value, error) => {
|
|
77356
77356
|
if (error) {
|
|
@@ -77359,9 +77359,9 @@
|
|
|
77359
77359
|
editField(field, path$2, value);
|
|
77360
77360
|
};
|
|
77361
77361
|
|
|
77362
|
-
/**
|
|
77363
|
-
* @param {string|void} value
|
|
77364
|
-
* @returns {string|null}
|
|
77362
|
+
/**
|
|
77363
|
+
* @param {string|void} value
|
|
77364
|
+
* @returns {string|null}
|
|
77365
77365
|
*/
|
|
77366
77366
|
const validate = value => {
|
|
77367
77367
|
if (isNil(value)) {
|
|
@@ -77422,8 +77422,8 @@
|
|
|
77422
77422
|
id
|
|
77423
77423
|
} = props;
|
|
77424
77424
|
|
|
77425
|
-
/**
|
|
77426
|
-
* @returns {string|void}
|
|
77425
|
+
/**
|
|
77426
|
+
* @returns {string|void}
|
|
77427
77427
|
*/
|
|
77428
77428
|
const getValue = () => {
|
|
77429
77429
|
const columns = get(field, COLUMNS_PATH);
|
|
@@ -77436,8 +77436,8 @@
|
|
|
77436
77436
|
}
|
|
77437
77437
|
};
|
|
77438
77438
|
|
|
77439
|
-
/**
|
|
77440
|
-
* @param {string|void} value
|
|
77439
|
+
/**
|
|
77440
|
+
* @param {string|void} value
|
|
77441
77441
|
*/
|
|
77442
77442
|
const setValue = value => {
|
|
77443
77443
|
switch (value) {
|
|
@@ -77514,10 +77514,10 @@
|
|
|
77514
77514
|
return get(field, PATH);
|
|
77515
77515
|
};
|
|
77516
77516
|
|
|
77517
|
-
/**
|
|
77518
|
-
* @param {string|void} value
|
|
77519
|
-
* @param {string|void} error
|
|
77520
|
-
* @returns {void}
|
|
77517
|
+
/**
|
|
77518
|
+
* @param {string|void} value
|
|
77519
|
+
* @param {string|void} error
|
|
77520
|
+
* @returns {void}
|
|
77521
77521
|
*/
|
|
77522
77522
|
const setValue = (value, error) => {
|
|
77523
77523
|
if (error) {
|
|
@@ -77526,9 +77526,9 @@
|
|
|
77526
77526
|
editField(field, PATH, value);
|
|
77527
77527
|
};
|
|
77528
77528
|
|
|
77529
|
-
/**
|
|
77530
|
-
* @param {string|void} value
|
|
77531
|
-
* @returns {string|null}
|
|
77529
|
+
/**
|
|
77530
|
+
* @param {string|void} value
|
|
77531
|
+
* @returns {string|null}
|
|
77532
77532
|
*/
|
|
77533
77533
|
const validate = value => {
|
|
77534
77534
|
if (!isString(value) || value.length === 0 || value === '=') {
|
|
@@ -77598,10 +77598,10 @@
|
|
|
77598
77598
|
} = props;
|
|
77599
77599
|
const debounce = useService('debounce');
|
|
77600
77600
|
|
|
77601
|
-
/**
|
|
77602
|
-
* @param {string|void} value
|
|
77603
|
-
* @param {string|void} error
|
|
77604
|
-
* @returns {void}
|
|
77601
|
+
/**
|
|
77602
|
+
* @param {string|void} value
|
|
77603
|
+
* @param {string|void} error
|
|
77604
|
+
* @returns {void}
|
|
77605
77605
|
*/
|
|
77606
77606
|
const setValue = (value, error) => {
|
|
77607
77607
|
if (error) {
|
|
@@ -77631,10 +77631,10 @@
|
|
|
77631
77631
|
} = props;
|
|
77632
77632
|
const debounce = useService('debounce');
|
|
77633
77633
|
|
|
77634
|
-
/**
|
|
77635
|
-
* @param {string|void} value
|
|
77636
|
-
* @param {string|void} error
|
|
77637
|
-
* @returns {void}
|
|
77634
|
+
/**
|
|
77635
|
+
* @param {string|void} value
|
|
77636
|
+
* @param {string|void} error
|
|
77637
|
+
* @returns {void}
|
|
77638
77638
|
*/
|
|
77639
77639
|
const setValue = (value, error) => {
|
|
77640
77640
|
if (error) {
|
|
@@ -77659,9 +77659,9 @@
|
|
|
77659
77659
|
|
|
77660
77660
|
// helpers //////////////////////
|
|
77661
77661
|
|
|
77662
|
-
/**
|
|
77663
|
-
* @param {string|void} value
|
|
77664
|
-
* @returns {string|null}
|
|
77662
|
+
/**
|
|
77663
|
+
* @param {string|void} value
|
|
77664
|
+
* @returns {string|null}
|
|
77665
77665
|
*/
|
|
77666
77666
|
function validate(value) {
|
|
77667
77667
|
if (!isString(value) || value.length === 0) {
|
|
@@ -78083,8 +78083,8 @@
|
|
|
78083
78083
|
};
|
|
78084
78084
|
const id = 'valuesSource';
|
|
78085
78085
|
|
|
78086
|
-
/**
|
|
78087
|
-
* @type {Array<Group|ListGroup>}
|
|
78086
|
+
/**
|
|
78087
|
+
* @type {Array<Group|ListGroup>}
|
|
78088
78088
|
*/
|
|
78089
78089
|
const groups = [{
|
|
78090
78090
|
id,
|
|
@@ -78204,13 +78204,13 @@
|
|
|
78204
78204
|
|
|
78205
78205
|
// helpers //////////
|
|
78206
78206
|
|
|
78207
|
-
/**
|
|
78208
|
-
* Returns copy of object without key.
|
|
78209
|
-
*
|
|
78210
|
-
* @param {Object} properties
|
|
78211
|
-
* @param {string} oldKey
|
|
78212
|
-
*
|
|
78213
|
-
* @returns {Object}
|
|
78207
|
+
/**
|
|
78208
|
+
* Returns copy of object without key.
|
|
78209
|
+
*
|
|
78210
|
+
* @param {Object} properties
|
|
78211
|
+
* @param {string} oldKey
|
|
78212
|
+
*
|
|
78213
|
+
* @returns {Object}
|
|
78214
78214
|
*/
|
|
78215
78215
|
function removeKey(properties, oldKey) {
|
|
78216
78216
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -78291,8 +78291,8 @@
|
|
|
78291
78291
|
}
|
|
78292
78292
|
const areStaticColumnsEnabled = isArray(get(field, ['columns']));
|
|
78293
78293
|
|
|
78294
|
-
/**
|
|
78295
|
-
* @type {Array<Group>}
|
|
78294
|
+
/**
|
|
78295
|
+
* @type {Array<Group>}
|
|
78296
78296
|
*/
|
|
78297
78297
|
const groups = [{
|
|
78298
78298
|
id: `${fieldId}-columnsSource`,
|
|
@@ -78382,10 +78382,10 @@
|
|
|
78382
78382
|
propertiesProvider: ['type', PropertiesProvider]
|
|
78383
78383
|
};
|
|
78384
78384
|
|
|
78385
|
-
/**
|
|
78386
|
-
* Manages the rendering of visual plugins.
|
|
78387
|
-
* @constructor
|
|
78388
|
-
* @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.
|
|
78389
78389
|
*/
|
|
78390
78390
|
class RenderInjector extends SectionModuleBase {
|
|
78391
78391
|
constructor(eventBus) {
|
|
@@ -78394,10 +78394,10 @@
|
|
|
78394
78394
|
this.registeredRenderers = [];
|
|
78395
78395
|
}
|
|
78396
78396
|
|
|
78397
|
-
/**
|
|
78398
|
-
* Inject a new renderer into the injector.
|
|
78399
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
78400
|
-
* @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.
|
|
78401
78401
|
*/
|
|
78402
78402
|
attachRenderer(identifier, Renderer) {
|
|
78403
78403
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -78406,17 +78406,17 @@
|
|
|
78406
78406
|
}];
|
|
78407
78407
|
}
|
|
78408
78408
|
|
|
78409
|
-
/**
|
|
78410
|
-
* Detach a renderer from the by key injector.
|
|
78411
|
-
* @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.
|
|
78412
78412
|
*/
|
|
78413
78413
|
detachRenderer(identifier) {
|
|
78414
78414
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
78415
78415
|
}
|
|
78416
78416
|
|
|
78417
|
-
/**
|
|
78418
|
-
* Returns the registered renderers.
|
|
78419
|
-
* @returns {Array} Array of registered renderers.
|
|
78417
|
+
/**
|
|
78418
|
+
* Returns the registered renderers.
|
|
78419
|
+
* @returns {Array} Array of registered renderers.
|
|
78420
78420
|
*/
|
|
78421
78421
|
fetchRenderers() {
|
|
78422
78422
|
return this.registeredRenderers;
|
|
@@ -78461,11 +78461,11 @@
|
|
|
78461
78461
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
78462
78462
|
}
|
|
78463
78463
|
|
|
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
|
|
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
|
|
78469
78469
|
*/
|
|
78470
78470
|
isFieldRepeating(id) {
|
|
78471
78471
|
if (!id) {
|
|
@@ -78508,48 +78508,48 @@
|
|
|
78508
78508
|
};
|
|
78509
78509
|
const ids = new Ids([32, 36, 1]);
|
|
78510
78510
|
|
|
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
|
|
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
|
|
78527
78527
|
*/
|
|
78528
78528
|
|
|
78529
|
-
/**
|
|
78530
|
-
* The form editor.
|
|
78529
|
+
/**
|
|
78530
|
+
* The form editor.
|
|
78531
78531
|
*/
|
|
78532
78532
|
class FormEditor {
|
|
78533
|
-
/**
|
|
78534
|
-
* @constructor
|
|
78535
|
-
* @param {FormEditorOptions} options
|
|
78533
|
+
/**
|
|
78534
|
+
* @constructor
|
|
78535
|
+
* @param {FormEditorOptions} options
|
|
78536
78536
|
*/
|
|
78537
78537
|
constructor(options = {}) {
|
|
78538
|
-
/**
|
|
78539
|
-
* @public
|
|
78540
|
-
* @type {OnEventType}
|
|
78538
|
+
/**
|
|
78539
|
+
* @public
|
|
78540
|
+
* @type {OnEventType}
|
|
78541
78541
|
*/
|
|
78542
78542
|
this.on = this._onEvent;
|
|
78543
78543
|
|
|
78544
|
-
/**
|
|
78545
|
-
* @public
|
|
78546
|
-
* @type {String}
|
|
78544
|
+
/**
|
|
78545
|
+
* @public
|
|
78546
|
+
* @type {String}
|
|
78547
78547
|
*/
|
|
78548
78548
|
this._id = ids.next();
|
|
78549
78549
|
|
|
78550
|
-
/**
|
|
78551
|
-
* @private
|
|
78552
|
-
* @type {Element}
|
|
78550
|
+
/**
|
|
78551
|
+
* @private
|
|
78552
|
+
* @type {Element}
|
|
78553
78553
|
*/
|
|
78554
78554
|
this._container = createFormContainer();
|
|
78555
78555
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -78560,15 +78560,15 @@
|
|
|
78560
78560
|
properties = {}
|
|
78561
78561
|
} = options;
|
|
78562
78562
|
|
|
78563
|
-
/**
|
|
78564
|
-
* @private
|
|
78565
|
-
* @type {any}
|
|
78563
|
+
/**
|
|
78564
|
+
* @private
|
|
78565
|
+
* @type {any}
|
|
78566
78566
|
*/
|
|
78567
78567
|
this.exporter = exporter;
|
|
78568
78568
|
|
|
78569
|
-
/**
|
|
78570
|
-
* @private
|
|
78571
|
-
* @type {State}
|
|
78569
|
+
/**
|
|
78570
|
+
* @private
|
|
78571
|
+
* @type {State}
|
|
78572
78572
|
*/
|
|
78573
78573
|
this._state = {
|
|
78574
78574
|
properties,
|
|
@@ -78597,10 +78597,10 @@
|
|
|
78597
78597
|
this._detach(false);
|
|
78598
78598
|
}
|
|
78599
78599
|
|
|
78600
|
-
/**
|
|
78601
|
-
* @param {Schema} schema
|
|
78602
|
-
*
|
|
78603
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
78600
|
+
/**
|
|
78601
|
+
* @param {Schema} schema
|
|
78602
|
+
*
|
|
78603
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
78604
78604
|
*/
|
|
78605
78605
|
importSchema(schema) {
|
|
78606
78606
|
return new Promise((resolve, reject) => {
|
|
@@ -78629,15 +78629,15 @@
|
|
|
78629
78629
|
});
|
|
78630
78630
|
}
|
|
78631
78631
|
|
|
78632
|
-
/**
|
|
78633
|
-
* @returns {Schema}
|
|
78632
|
+
/**
|
|
78633
|
+
* @returns {Schema}
|
|
78634
78634
|
*/
|
|
78635
78635
|
saveSchema() {
|
|
78636
78636
|
return this.getSchema();
|
|
78637
78637
|
}
|
|
78638
78638
|
|
|
78639
|
-
/**
|
|
78640
|
-
* @returns {Schema}
|
|
78639
|
+
/**
|
|
78640
|
+
* @returns {Schema}
|
|
78641
78641
|
*/
|
|
78642
78642
|
getSchema() {
|
|
78643
78643
|
const {
|
|
@@ -78646,8 +78646,8 @@
|
|
|
78646
78646
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
78647
78647
|
}
|
|
78648
78648
|
|
|
78649
|
-
/**
|
|
78650
|
-
* @param {Element|string} parentNode
|
|
78649
|
+
/**
|
|
78650
|
+
* @param {Element|string} parentNode
|
|
78651
78651
|
*/
|
|
78652
78652
|
attachTo(parentNode) {
|
|
78653
78653
|
if (!parentNode) {
|
|
@@ -78665,10 +78665,10 @@
|
|
|
78665
78665
|
this._detach();
|
|
78666
78666
|
}
|
|
78667
78667
|
|
|
78668
|
-
/**
|
|
78669
|
-
* @internal
|
|
78670
|
-
*
|
|
78671
|
-
* @param {boolean} [emit]
|
|
78668
|
+
/**
|
|
78669
|
+
* @internal
|
|
78670
|
+
*
|
|
78671
|
+
* @param {boolean} [emit]
|
|
78672
78672
|
*/
|
|
78673
78673
|
_detach(emit = true) {
|
|
78674
78674
|
const container = this._container,
|
|
@@ -78682,9 +78682,9 @@
|
|
|
78682
78682
|
parentNode.removeChild(container);
|
|
78683
78683
|
}
|
|
78684
78684
|
|
|
78685
|
-
/**
|
|
78686
|
-
* @param {any} property
|
|
78687
|
-
* @param {any} value
|
|
78685
|
+
/**
|
|
78686
|
+
* @param {any} property
|
|
78687
|
+
* @param {any} value
|
|
78688
78688
|
*/
|
|
78689
78689
|
setProperty(property, value) {
|
|
78690
78690
|
const properties = set$2(this._getState().properties, [property], value);
|
|
@@ -78693,21 +78693,21 @@
|
|
|
78693
78693
|
});
|
|
78694
78694
|
}
|
|
78695
78695
|
|
|
78696
|
-
/**
|
|
78697
|
-
* @param {string} type
|
|
78698
|
-
* @param {Function} handler
|
|
78696
|
+
/**
|
|
78697
|
+
* @param {string} type
|
|
78698
|
+
* @param {Function} handler
|
|
78699
78699
|
*/
|
|
78700
78700
|
off(type, handler) {
|
|
78701
78701
|
this.get('eventBus').off(type, handler);
|
|
78702
78702
|
}
|
|
78703
78703
|
|
|
78704
|
-
/**
|
|
78705
|
-
* @internal
|
|
78706
|
-
*
|
|
78707
|
-
* @param {FormEditorOptions} options
|
|
78708
|
-
* @param {Element} container
|
|
78709
|
-
*
|
|
78710
|
-
* @returns {Injector}
|
|
78704
|
+
/**
|
|
78705
|
+
* @internal
|
|
78706
|
+
*
|
|
78707
|
+
* @param {FormEditorOptions} options
|
|
78708
|
+
* @param {Element} container
|
|
78709
|
+
*
|
|
78710
|
+
* @returns {Injector}
|
|
78711
78711
|
*/
|
|
78712
78712
|
_createInjector(options, container) {
|
|
78713
78713
|
const {
|
|
@@ -78730,22 +78730,22 @@
|
|
|
78730
78730
|
}, core, ...modules, ...additionalModules]);
|
|
78731
78731
|
}
|
|
78732
78732
|
|
|
78733
|
-
/**
|
|
78734
|
-
* @internal
|
|
78733
|
+
/**
|
|
78734
|
+
* @internal
|
|
78735
78735
|
*/
|
|
78736
78736
|
_emit(type, data) {
|
|
78737
78737
|
this.get('eventBus').fire(type, data);
|
|
78738
78738
|
}
|
|
78739
78739
|
|
|
78740
|
-
/**
|
|
78741
|
-
* @internal
|
|
78740
|
+
/**
|
|
78741
|
+
* @internal
|
|
78742
78742
|
*/
|
|
78743
78743
|
_getState() {
|
|
78744
78744
|
return this._state;
|
|
78745
78745
|
}
|
|
78746
78746
|
|
|
78747
|
-
/**
|
|
78748
|
-
* @internal
|
|
78747
|
+
/**
|
|
78748
|
+
* @internal
|
|
78749
78749
|
*/
|
|
78750
78750
|
_setState(state) {
|
|
78751
78751
|
this._state = {
|
|
@@ -78755,15 +78755,15 @@
|
|
|
78755
78755
|
this._emit('changed', this._getState());
|
|
78756
78756
|
}
|
|
78757
78757
|
|
|
78758
|
-
/**
|
|
78759
|
-
* @internal
|
|
78758
|
+
/**
|
|
78759
|
+
* @internal
|
|
78760
78760
|
*/
|
|
78761
78761
|
_getModules() {
|
|
78762
78762
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule, RenderInjectionModule, RepeatRenderManagerModule];
|
|
78763
78763
|
}
|
|
78764
78764
|
|
|
78765
|
-
/**
|
|
78766
|
-
* @internal
|
|
78765
|
+
/**
|
|
78766
|
+
* @internal
|
|
78767
78767
|
*/
|
|
78768
78768
|
_onEvent(type, priority, handler) {
|
|
78769
78769
|
this.get('eventBus').on(type, priority, handler);
|
|
@@ -80266,8 +80266,8 @@
|
|
|
80266
80266
|
return new LanguageSupport(jsonLanguage);
|
|
80267
80267
|
}
|
|
80268
80268
|
|
|
80269
|
-
/**
|
|
80270
|
-
* @type {Facet<import('..').Variables>} Variables
|
|
80269
|
+
/**
|
|
80270
|
+
* @type {Facet<import('..').Variables>} Variables
|
|
80271
80271
|
*/
|
|
80272
80272
|
const variablesFacet = Facet.define();
|
|
80273
80273
|
|
|
@@ -80444,11 +80444,11 @@
|
|
|
80444
80444
|
|
|
80445
80445
|
const NO_LINT_CLS = 'fjs-no-json-lint';
|
|
80446
80446
|
|
|
80447
|
-
/**
|
|
80448
|
-
* @param {object} options
|
|
80449
|
-
* @param {boolean} [options.readonly]
|
|
80450
|
-
* @param {object} [options.contentAttributes]
|
|
80451
|
-
* @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]
|
|
80452
80452
|
*/
|
|
80453
80453
|
function JSONEditor(options = {}) {
|
|
80454
80454
|
const {
|
|
@@ -80461,8 +80461,8 @@
|
|
|
80461
80461
|
let tabSize = new Compartment().of(EditorState.tabSize.of(2));
|
|
80462
80462
|
let container = null;
|
|
80463
80463
|
|
|
80464
|
-
/**
|
|
80465
|
-
* @typedef {Array<string>} Variables
|
|
80464
|
+
/**
|
|
80465
|
+
* @typedef {Array<string>} Variables
|
|
80466
80466
|
*/
|
|
80467
80467
|
|
|
80468
80468
|
const autocompletionConf = new Compartment();
|
|
@@ -80513,8 +80513,8 @@
|
|
|
80513
80513
|
return view.state.doc.toString();
|
|
80514
80514
|
};
|
|
80515
80515
|
|
|
80516
|
-
/**
|
|
80517
|
-
* @param {Variables} variables
|
|
80516
|
+
/**
|
|
80517
|
+
* @param {Variables} variables
|
|
80518
80518
|
*/
|
|
80519
80519
|
this.setVariables = function (variables) {
|
|
80520
80520
|
view.setVariables(variables);
|