@bpmn-io/form-js-playground 1.6.0 → 1.6.1
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 +928 -928
- 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
|
@@ -50434,26 +50434,26 @@
|
|
|
50434
50434
|
return [...new Set(variables)];
|
|
50435
50435
|
};
|
|
50436
50436
|
|
|
50437
|
-
/**
|
|
50438
|
-
* Get the variable name at the specified index in a given path expression.
|
|
50439
|
-
*
|
|
50440
|
-
* @param {Object} root - The root node of the path expression tree.
|
|
50441
|
-
* @param {number} index - The index of the variable name to retrieve.
|
|
50442
|
-
* @returns {string|null} The variable name at the specified index or null if index is out of bounds.
|
|
50437
|
+
/**
|
|
50438
|
+
* Get the variable name at the specified index in a given path expression.
|
|
50439
|
+
*
|
|
50440
|
+
* @param {Object} root - The root node of the path expression tree.
|
|
50441
|
+
* @param {number} index - The index of the variable name to retrieve.
|
|
50442
|
+
* @returns {string|null} The variable name at the specified index or null if index is out of bounds.
|
|
50443
50443
|
*/
|
|
50444
50444
|
const _getVariableNameAtPathIndex = (root, index) => {
|
|
50445
50445
|
const nodes = _linearizePathExpression(root);
|
|
50446
50446
|
return nodes[index].variableName || null;
|
|
50447
50447
|
};
|
|
50448
50448
|
|
|
50449
|
-
/**
|
|
50450
|
-
* Extracts the variables which are required of the external context for a given path expression.
|
|
50451
|
-
* This is done by traversing the path expression tree and keeping track of the current depth relative to the external context.
|
|
50452
|
-
*
|
|
50453
|
-
* @param {Object} node - The root node of the path expression tree.
|
|
50454
|
-
* @param {number} initialDepth - The depth at which the root node is located in the outer context.
|
|
50455
|
-
* @param {Object} specialDepthAccessors - Definitions of special keywords which represent more complex accesses of the outer context.
|
|
50456
|
-
* @returns {Set} - A set containing the extracted variable names.
|
|
50449
|
+
/**
|
|
50450
|
+
* Extracts the variables which are required of the external context for a given path expression.
|
|
50451
|
+
* This is done by traversing the path expression tree and keeping track of the current depth relative to the external context.
|
|
50452
|
+
*
|
|
50453
|
+
* @param {Object} node - The root node of the path expression tree.
|
|
50454
|
+
* @param {number} initialDepth - The depth at which the root node is located in the outer context.
|
|
50455
|
+
* @param {Object} specialDepthAccessors - Definitions of special keywords which represent more complex accesses of the outer context.
|
|
50456
|
+
* @returns {Set} - A set containing the extracted variable names.
|
|
50457
50457
|
*/
|
|
50458
50458
|
const _smartExtractVariableNames = (node, initialDepth, specialDepthAccessors) => {
|
|
50459
50459
|
// depth info represents the previous (initialised as null) and current depth of the current accessor in the path expression
|
|
@@ -50499,11 +50499,11 @@
|
|
|
50499
50499
|
return new Set(extractedVariables);
|
|
50500
50500
|
};
|
|
50501
50501
|
|
|
50502
|
-
/**
|
|
50503
|
-
* Deconstructs a path expression tree into an array of components.
|
|
50504
|
-
*
|
|
50505
|
-
* @param {Object} root - The root node of the path expression tree.
|
|
50506
|
-
* @returns {Array<object>} An array of components in the path expression, in the correct order.
|
|
50502
|
+
/**
|
|
50503
|
+
* Deconstructs a path expression tree into an array of components.
|
|
50504
|
+
*
|
|
50505
|
+
* @param {Object} root - The root node of the path expression tree.
|
|
50506
|
+
* @returns {Array<object>} An array of components in the path expression, in the correct order.
|
|
50507
50507
|
*/
|
|
50508
50508
|
const _linearizePathExpression = root => {
|
|
50509
50509
|
let node = root;
|
|
@@ -50522,13 +50522,13 @@
|
|
|
50522
50522
|
return parts.reverse();
|
|
50523
50523
|
};
|
|
50524
50524
|
|
|
50525
|
-
/**
|
|
50526
|
-
* Builds a simplified feel structure tree from the given parse tree and feel string.
|
|
50527
|
-
* The nodes follow this structure: `{ name: string, children: Array, variableName?: string }`
|
|
50528
|
-
*
|
|
50529
|
-
* @param {Object} parseTree - The parse tree generated by a parser.
|
|
50530
|
-
* @param {string} feelString - The feel string used for parsing.
|
|
50531
|
-
* @returns {Object} The simplified feel structure tree.
|
|
50525
|
+
/**
|
|
50526
|
+
* Builds a simplified feel structure tree from the given parse tree and feel string.
|
|
50527
|
+
* The nodes follow this structure: `{ name: string, children: Array, variableName?: string }`
|
|
50528
|
+
*
|
|
50529
|
+
* @param {Object} parseTree - The parse tree generated by a parser.
|
|
50530
|
+
* @param {string} feelString - The feel string used for parsing.
|
|
50531
|
+
* @returns {Object} The simplified feel structure tree.
|
|
50532
50532
|
*/
|
|
50533
50533
|
const _buildSimpleFeelStructureTree = (parseTree, feelString) => {
|
|
50534
50534
|
const stack = [{
|
|
@@ -50554,9 +50554,9 @@
|
|
|
50554
50554
|
return _extractFilterExpressions(stack[0].children[0]);
|
|
50555
50555
|
};
|
|
50556
50556
|
|
|
50557
|
-
/**
|
|
50558
|
-
* Restructure the tree in such a way to bring filters (which create new contexts) to the root of the tree.
|
|
50559
|
-
* This is done to simplify the extraction of variables and match the context hierarchy.
|
|
50557
|
+
/**
|
|
50558
|
+
* Restructure the tree in such a way to bring filters (which create new contexts) to the root of the tree.
|
|
50559
|
+
* This is done to simplify the extraction of variables and match the context hierarchy.
|
|
50560
50560
|
*/
|
|
50561
50561
|
const _extractFilterExpressions = tree => {
|
|
50562
50562
|
const flattenedExpressionTree = {
|
|
@@ -50596,25 +50596,25 @@
|
|
|
50596
50596
|
this._eventBus = eventBus;
|
|
50597
50597
|
}
|
|
50598
50598
|
|
|
50599
|
-
/**
|
|
50600
|
-
* Determines if the given value is a FEEL expression.
|
|
50601
|
-
*
|
|
50602
|
-
* @param {any} value
|
|
50603
|
-
* @returns {boolean}
|
|
50604
|
-
*
|
|
50599
|
+
/**
|
|
50600
|
+
* Determines if the given value is a FEEL expression.
|
|
50601
|
+
*
|
|
50602
|
+
* @param {any} value
|
|
50603
|
+
* @returns {boolean}
|
|
50604
|
+
*
|
|
50605
50605
|
*/
|
|
50606
50606
|
isExpression(value) {
|
|
50607
50607
|
return isString$4(value) && value.startsWith('=');
|
|
50608
50608
|
}
|
|
50609
50609
|
|
|
50610
|
-
/**
|
|
50611
|
-
* Retrieve variable names from a given FEEL expression.
|
|
50612
|
-
*
|
|
50613
|
-
* @param {string} expression
|
|
50614
|
-
* @param {object} [options]
|
|
50615
|
-
* @param {string} [options.type]
|
|
50616
|
-
*
|
|
50617
|
-
* @returns {string[]}
|
|
50610
|
+
/**
|
|
50611
|
+
* Retrieve variable names from a given FEEL expression.
|
|
50612
|
+
*
|
|
50613
|
+
* @param {string} expression
|
|
50614
|
+
* @param {object} [options]
|
|
50615
|
+
* @param {string} [options.type]
|
|
50616
|
+
*
|
|
50617
|
+
* @returns {string[]}
|
|
50618
50618
|
*/
|
|
50619
50619
|
getVariableNames(expression, options = {}) {
|
|
50620
50620
|
const {
|
|
@@ -50629,13 +50629,13 @@
|
|
|
50629
50629
|
return getFlavouredFeelVariableNames(expression, type);
|
|
50630
50630
|
}
|
|
50631
50631
|
|
|
50632
|
-
/**
|
|
50633
|
-
* Evaluate an expression.
|
|
50634
|
-
*
|
|
50635
|
-
* @param {string} expression
|
|
50636
|
-
* @param {import('../../types').Data} [data]
|
|
50637
|
-
*
|
|
50638
|
-
* @returns {any}
|
|
50632
|
+
/**
|
|
50633
|
+
* Evaluate an expression.
|
|
50634
|
+
*
|
|
50635
|
+
* @param {string} expression
|
|
50636
|
+
* @param {import('../../types').Data} [data]
|
|
50637
|
+
*
|
|
50638
|
+
* @returns {any}
|
|
50639
50639
|
*/
|
|
50640
50640
|
evaluate(expression, data = {}) {
|
|
50641
50641
|
if (!expression) {
|
|
@@ -50659,23 +50659,23 @@
|
|
|
50659
50659
|
class FeelersTemplating {
|
|
50660
50660
|
constructor() {}
|
|
50661
50661
|
|
|
50662
|
-
/**
|
|
50663
|
-
* Determines if the given value is a feelers template.
|
|
50664
|
-
*
|
|
50665
|
-
* @param {any} value
|
|
50666
|
-
* @returns {boolean}
|
|
50667
|
-
*
|
|
50662
|
+
/**
|
|
50663
|
+
* Determines if the given value is a feelers template.
|
|
50664
|
+
*
|
|
50665
|
+
* @param {any} value
|
|
50666
|
+
* @returns {boolean}
|
|
50667
|
+
*
|
|
50668
50668
|
*/
|
|
50669
50669
|
isTemplate(value) {
|
|
50670
50670
|
return isString$4(value) && (value.startsWith('=') || /{{.*?}}/.test(value));
|
|
50671
50671
|
}
|
|
50672
50672
|
|
|
50673
|
-
/**
|
|
50674
|
-
* Retrieve variable names from a given feelers template.
|
|
50675
|
-
*
|
|
50676
|
-
* @param {string} template
|
|
50677
|
-
*
|
|
50678
|
-
* @returns {string[]}
|
|
50673
|
+
/**
|
|
50674
|
+
* Retrieve variable names from a given feelers template.
|
|
50675
|
+
*
|
|
50676
|
+
* @param {string} template
|
|
50677
|
+
*
|
|
50678
|
+
* @returns {string[]}
|
|
50679
50679
|
*/
|
|
50680
50680
|
getVariableNames(template) {
|
|
50681
50681
|
if (!this.isTemplate(template)) {
|
|
@@ -50701,17 +50701,17 @@
|
|
|
50701
50701
|
}, []);
|
|
50702
50702
|
}
|
|
50703
50703
|
|
|
50704
|
-
/**
|
|
50705
|
-
* Evaluate a template.
|
|
50706
|
-
*
|
|
50707
|
-
* @param {string} template
|
|
50708
|
-
* @param {Object<string, any>} context
|
|
50709
|
-
* @param {Object} options
|
|
50710
|
-
* @param {boolean} [options.debug = false]
|
|
50711
|
-
* @param {boolean} [options.strict = false]
|
|
50712
|
-
* @param {Function} [options.buildDebugString]
|
|
50713
|
-
*
|
|
50714
|
-
* @returns
|
|
50704
|
+
/**
|
|
50705
|
+
* Evaluate a template.
|
|
50706
|
+
*
|
|
50707
|
+
* @param {string} template
|
|
50708
|
+
* @param {Object<string, any>} context
|
|
50709
|
+
* @param {Object} options
|
|
50710
|
+
* @param {boolean} [options.debug = false]
|
|
50711
|
+
* @param {boolean} [options.strict = false]
|
|
50712
|
+
* @param {Function} [options.buildDebugString]
|
|
50713
|
+
*
|
|
50714
|
+
* @returns
|
|
50715
50715
|
*/
|
|
50716
50716
|
evaluate(template, context = {}, options = {}) {
|
|
50717
50717
|
const {
|
|
@@ -50726,22 +50726,22 @@
|
|
|
50726
50726
|
});
|
|
50727
50727
|
}
|
|
50728
50728
|
|
|
50729
|
-
/**
|
|
50730
|
-
* @typedef {Object} ExpressionWithDepth
|
|
50731
|
-
* @property {number} depth - The depth of the expression in the syntax tree.
|
|
50732
|
-
* @property {string} expression - The extracted expression
|
|
50729
|
+
/**
|
|
50730
|
+
* @typedef {Object} ExpressionWithDepth
|
|
50731
|
+
* @property {number} depth - The depth of the expression in the syntax tree.
|
|
50732
|
+
* @property {string} expression - The extracted expression
|
|
50733
50733
|
*/
|
|
50734
50734
|
|
|
50735
|
-
/**
|
|
50736
|
-
* Extracts all feel expressions in the template along with their depth in the syntax tree.
|
|
50737
|
-
* The depth is incremented for child expressions of loops to account for context drilling.
|
|
50738
|
-
|
|
50739
|
-
* @param {string} template - A feelers template string.
|
|
50740
|
-
* @returns {Array<ExpressionWithDepth>} An array of objects, each containing the depth and the extracted expression.
|
|
50741
|
-
*
|
|
50742
|
-
* @example
|
|
50743
|
-
* const template = "Hello {{user}}, you have:{{#loop items}}\n- {{amount}} {{name}}{{/loop}}.";
|
|
50744
|
-
* const extractedExpressions = _extractExpressionsWithDepth(template);
|
|
50735
|
+
/**
|
|
50736
|
+
* Extracts all feel expressions in the template along with their depth in the syntax tree.
|
|
50737
|
+
* The depth is incremented for child expressions of loops to account for context drilling.
|
|
50738
|
+
* @name extractExpressionsWithDepth
|
|
50739
|
+
* @param {string} template - A feelers template string.
|
|
50740
|
+
* @returns {Array<ExpressionWithDepth>} An array of objects, each containing the depth and the extracted expression.
|
|
50741
|
+
*
|
|
50742
|
+
* @example
|
|
50743
|
+
* const template = "Hello {{user}}, you have:{{#loop items}}\n- {{amount}} {{name}}{{/loop}}.";
|
|
50744
|
+
* const extractedExpressions = _extractExpressionsWithDepth(template);
|
|
50745
50745
|
*/
|
|
50746
50746
|
_extractExpressionsWithDepth(template) {
|
|
50747
50747
|
// build simplified feelers syntax tree
|
|
@@ -50846,10 +50846,10 @@
|
|
|
50846
50846
|
return injector;
|
|
50847
50847
|
}
|
|
50848
50848
|
|
|
50849
|
-
/**
|
|
50850
|
-
* @param {string?} prefix
|
|
50851
|
-
*
|
|
50852
|
-
* @returns Element
|
|
50849
|
+
/**
|
|
50850
|
+
* @param {string?} prefix
|
|
50851
|
+
*
|
|
50852
|
+
* @returns Element
|
|
50853
50853
|
*/
|
|
50854
50854
|
function createFormContainer(prefix = 'fjs') {
|
|
50855
50855
|
const container = document.createElement('div');
|
|
@@ -50976,11 +50976,11 @@
|
|
|
50976
50976
|
});
|
|
50977
50977
|
var LocalExpressionContext$1 = LocalExpressionContext;
|
|
50978
50978
|
|
|
50979
|
-
/**
|
|
50980
|
-
* @param {string} type
|
|
50981
|
-
* @param {boolean} [strict]
|
|
50982
|
-
*
|
|
50983
|
-
* @returns {any}
|
|
50979
|
+
/**
|
|
50980
|
+
* @param {string} type
|
|
50981
|
+
* @param {boolean} [strict]
|
|
50982
|
+
*
|
|
50983
|
+
* @returns {any}
|
|
50984
50984
|
*/
|
|
50985
50985
|
function getService$2(type, strict) {}
|
|
50986
50986
|
const FormContext = D$2({
|
|
@@ -50995,21 +50995,21 @@
|
|
|
50995
50995
|
return getService(type, strict);
|
|
50996
50996
|
}
|
|
50997
50997
|
|
|
50998
|
-
/**
|
|
50999
|
-
* @template T
|
|
51000
|
-
* @param {T} data
|
|
51001
|
-
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
51002
|
-
* @return {T}
|
|
50998
|
+
/**
|
|
50999
|
+
* @template T
|
|
51000
|
+
* @param {T} data
|
|
51001
|
+
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
51002
|
+
* @return {T}
|
|
51003
51003
|
*/
|
|
51004
51004
|
function clone(data, replacer) {
|
|
51005
51005
|
return JSON.parse(JSON.stringify(data, replacer));
|
|
51006
51006
|
}
|
|
51007
51007
|
|
|
51008
|
-
/**
|
|
51009
|
-
* Transform a LocalExpressionContext object into a usable FEEL context.
|
|
51010
|
-
*
|
|
51011
|
-
* @param {Object} context - The LocalExpressionContext object.
|
|
51012
|
-
* @returns {Object} The usable FEEL context.
|
|
51008
|
+
/**
|
|
51009
|
+
* Transform a LocalExpressionContext object into a usable FEEL context.
|
|
51010
|
+
*
|
|
51011
|
+
* @param {Object} context - The LocalExpressionContext object.
|
|
51012
|
+
* @returns {Object} The usable FEEL context.
|
|
51013
51013
|
*/
|
|
51014
51014
|
|
|
51015
51015
|
function buildExpressionContext(context) {
|
|
@@ -51041,12 +51041,12 @@
|
|
|
51041
51041
|
return newObj;
|
|
51042
51042
|
}
|
|
51043
51043
|
|
|
51044
|
-
/**
|
|
51045
|
-
* Evaluate if condition is met reactively based on the conditionChecker and form data.
|
|
51046
|
-
*
|
|
51047
|
-
* @param {string | undefined} condition
|
|
51048
|
-
*
|
|
51049
|
-
* @returns {boolean} true if condition is met or no condition or condition checker exists
|
|
51044
|
+
/**
|
|
51045
|
+
* Evaluate if condition is met reactively based on the conditionChecker and form data.
|
|
51046
|
+
*
|
|
51047
|
+
* @param {string | undefined} condition
|
|
51048
|
+
*
|
|
51049
|
+
* @returns {boolean} true if condition is met or no condition or condition checker exists
|
|
51050
51050
|
*/
|
|
51051
51051
|
function useCondition(condition) {
|
|
51052
51052
|
const conditionChecker = useService$2('conditionChecker', false);
|
|
@@ -51056,17 +51056,17 @@
|
|
|
51056
51056
|
}, [conditionChecker, condition, expressionContextInfo]);
|
|
51057
51057
|
}
|
|
51058
51058
|
|
|
51059
|
-
/**
|
|
51060
|
-
* Custom hook to scroll an element into view only when it is not visible within the viewport.
|
|
51061
|
-
*
|
|
51062
|
-
* @param {Object} targetRef - A ref pointing to the DOM element to scroll into view.
|
|
51063
|
-
* @param {Array} deps - An array of dependencies that trigger the effect.
|
|
51064
|
-
* @param {Array} flagRefs - An array of refs that are used as flags to control when to scroll.
|
|
51065
|
-
* @param {Object} [scrollOptions={}] - Options defining the behavior of the scrolling.
|
|
51066
|
-
* @param {String} [scrollOptions.align='center'] - The alignment of the element within the viewport.
|
|
51067
|
-
* @param {String} [scrollOptions.behavior='auto'] - The scrolling behavior.
|
|
51068
|
-
* @param {Number} [scrollOptions.offset=0] - An offset that is added to the scroll position.
|
|
51069
|
-
* @param {Boolean} [scrollOptions.scrollIfVisible=false] - Whether to scroll even if the element is visible.
|
|
51059
|
+
/**
|
|
51060
|
+
* Custom hook to scroll an element into view only when it is not visible within the viewport.
|
|
51061
|
+
*
|
|
51062
|
+
* @param {Object} targetRef - A ref pointing to the DOM element to scroll into view.
|
|
51063
|
+
* @param {Array} deps - An array of dependencies that trigger the effect.
|
|
51064
|
+
* @param {Array} flagRefs - An array of refs that are used as flags to control when to scroll.
|
|
51065
|
+
* @param {Object} [scrollOptions={}] - Options defining the behavior of the scrolling.
|
|
51066
|
+
* @param {String} [scrollOptions.align='center'] - The alignment of the element within the viewport.
|
|
51067
|
+
* @param {String} [scrollOptions.behavior='auto'] - The scrolling behavior.
|
|
51068
|
+
* @param {Number} [scrollOptions.offset=0] - An offset that is added to the scroll position.
|
|
51069
|
+
* @param {Boolean} [scrollOptions.scrollIfVisible=false] - Whether to scroll even if the element is visible.
|
|
51070
51070
|
*/
|
|
51071
51071
|
function useScrollIntoView(targetRef, deps, scrollOptions = null, flagRefs = []) {
|
|
51072
51072
|
y(() => {
|
|
@@ -51131,13 +51131,13 @@
|
|
|
51131
51131
|
return 0;
|
|
51132
51132
|
}
|
|
51133
51133
|
|
|
51134
|
-
/**
|
|
51135
|
-
* Evaluate a string reactively based on the expressionLanguage and form data.
|
|
51136
|
-
* If the string is not an expression, it is returned as is.
|
|
51137
|
-
* The function is memoized to minimize re-renders.
|
|
51138
|
-
*
|
|
51139
|
-
* @param {string} value - The string to evaluate.
|
|
51140
|
-
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
51134
|
+
/**
|
|
51135
|
+
* Evaluate a string reactively based on the expressionLanguage and form data.
|
|
51136
|
+
* If the string is not an expression, it is returned as is.
|
|
51137
|
+
* The function is memoized to minimize re-renders.
|
|
51138
|
+
*
|
|
51139
|
+
* @param {string} value - The string to evaluate.
|
|
51140
|
+
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
51141
51141
|
*/
|
|
51142
51142
|
function useExpressionEvaluation(value) {
|
|
51143
51143
|
const expressionLanguage = useService$2('expressionLanguage');
|
|
@@ -51150,11 +51150,11 @@
|
|
|
51150
51150
|
}, [expressionLanguage, expressionContextInfo, value]);
|
|
51151
51151
|
}
|
|
51152
51152
|
|
|
51153
|
-
/**
|
|
51154
|
-
* Returns the conditionally filtered data of a form reactively.
|
|
51155
|
-
* Memoised to minimize re-renders
|
|
51156
|
-
*
|
|
51157
|
-
* Warning: costly operation, use with care
|
|
51153
|
+
/**
|
|
51154
|
+
* Returns the conditionally filtered data of a form reactively.
|
|
51155
|
+
* Memoised to minimize re-renders
|
|
51156
|
+
*
|
|
51157
|
+
* Warning: costly operation, use with care
|
|
51158
51158
|
*/
|
|
51159
51159
|
function useFilteredFormData() {
|
|
51160
51160
|
const {
|
|
@@ -51186,16 +51186,16 @@
|
|
|
51186
51186
|
});
|
|
51187
51187
|
}
|
|
51188
51188
|
|
|
51189
|
-
/**
|
|
51190
|
-
* Retrieve readonly value of a form field, given it can be an
|
|
51191
|
-
* expression optionally or configured globally.
|
|
51192
|
-
*
|
|
51193
|
-
* @typedef { import('../../types').FormProperties } FormProperties
|
|
51194
|
-
*
|
|
51195
|
-
* @param {any} formField
|
|
51196
|
-
* @param {FormProperties} properties
|
|
51197
|
-
*
|
|
51198
|
-
* @returns {boolean}
|
|
51189
|
+
/**
|
|
51190
|
+
* Retrieve readonly value of a form field, given it can be an
|
|
51191
|
+
* expression optionally or configured globally.
|
|
51192
|
+
*
|
|
51193
|
+
* @typedef { import('../../types').FormProperties } FormProperties
|
|
51194
|
+
*
|
|
51195
|
+
* @param {any} formField
|
|
51196
|
+
* @param {FormProperties} properties
|
|
51197
|
+
*
|
|
51198
|
+
* @returns {boolean}
|
|
51199
51199
|
*/
|
|
51200
51200
|
function useReadonly(formField, properties = {}) {
|
|
51201
51201
|
const expressionLanguage = useService$2('expressionLanguage');
|
|
@@ -51218,12 +51218,12 @@
|
|
|
51218
51218
|
return ref.current;
|
|
51219
51219
|
}
|
|
51220
51220
|
|
|
51221
|
-
/**
|
|
51222
|
-
* A custom hook to manage state changes with deep comparison.
|
|
51223
|
-
*
|
|
51224
|
-
* @param {any} value - The current value to manage.
|
|
51225
|
-
* @param {any} defaultValue - The initial default value for the state.
|
|
51226
|
-
* @returns {any} - Returns the current state.
|
|
51221
|
+
/**
|
|
51222
|
+
* A custom hook to manage state changes with deep comparison.
|
|
51223
|
+
*
|
|
51224
|
+
* @param {any} value - The current value to manage.
|
|
51225
|
+
* @param {any} defaultValue - The initial default value for the state.
|
|
51226
|
+
* @returns {any} - Returns the current state.
|
|
51227
51227
|
*/
|
|
51228
51228
|
function useDeepCompareState(value, defaultValue) {
|
|
51229
51229
|
const [state, setState] = l$2(defaultValue);
|
|
@@ -51243,16 +51243,16 @@
|
|
|
51243
51243
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
51244
51244
|
}
|
|
51245
51245
|
|
|
51246
|
-
/**
|
|
51247
|
-
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
51248
|
-
* Memoised to minimize re-renders
|
|
51249
|
-
*
|
|
51250
|
-
* @param {string} value
|
|
51251
|
-
* @param {Object} options
|
|
51252
|
-
* @param {boolean} [options.debug = false]
|
|
51253
|
-
* @param {boolean} [options.strict = false]
|
|
51254
|
-
* @param {Function} [options.buildDebugString]
|
|
51255
|
-
*
|
|
51246
|
+
/**
|
|
51247
|
+
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
51248
|
+
* Memoised to minimize re-renders
|
|
51249
|
+
*
|
|
51250
|
+
* @param {string} value
|
|
51251
|
+
* @param {Object} options
|
|
51252
|
+
* @param {boolean} [options.debug = false]
|
|
51253
|
+
* @param {boolean} [options.strict = false]
|
|
51254
|
+
* @param {Function} [options.buildDebugString]
|
|
51255
|
+
*
|
|
51256
51256
|
*/
|
|
51257
51257
|
function useTemplateEvaluation(value, options = {}) {
|
|
51258
51258
|
const templating = useService$2('templating');
|
|
@@ -51265,17 +51265,17 @@
|
|
|
51265
51265
|
}, [templating, value, expressionContextInfo, options]);
|
|
51266
51266
|
}
|
|
51267
51267
|
|
|
51268
|
-
/**
|
|
51269
|
-
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
51270
|
-
* If the string contains multiple lines, only the first line is returned.
|
|
51271
|
-
* Memoised to minimize re-renders
|
|
51272
|
-
*
|
|
51273
|
-
* @param {string} value
|
|
51274
|
-
* @param {Object} [options]
|
|
51275
|
-
* @param {boolean} [options.debug = false]
|
|
51276
|
-
* @param {boolean} [options.strict = false]
|
|
51277
|
-
* @param {Function} [options.buildDebugString]
|
|
51278
|
-
*
|
|
51268
|
+
/**
|
|
51269
|
+
* Template a string reactively based on form data. If the string is not a template, it is returned as is.
|
|
51270
|
+
* If the string contains multiple lines, only the first line is returned.
|
|
51271
|
+
* Memoised to minimize re-renders
|
|
51272
|
+
*
|
|
51273
|
+
* @param {string} value
|
|
51274
|
+
* @param {Object} [options]
|
|
51275
|
+
* @param {boolean} [options.debug = false]
|
|
51276
|
+
* @param {boolean} [options.strict = false]
|
|
51277
|
+
* @param {Function} [options.buildDebugString]
|
|
51278
|
+
*
|
|
51279
51279
|
*/
|
|
51280
51280
|
function useSingleLineTemplateEvaluation(value, options = {}) {
|
|
51281
51281
|
const evaluatedTemplate = useTemplateEvaluation(value, options);
|
|
@@ -51474,8 +51474,8 @@
|
|
|
51474
51474
|
};
|
|
51475
51475
|
}
|
|
51476
51476
|
|
|
51477
|
-
/**
|
|
51478
|
-
* @enum { String }
|
|
51477
|
+
/**
|
|
51478
|
+
* @enum { String }
|
|
51479
51479
|
*/
|
|
51480
51480
|
const LOAD_STATES = {
|
|
51481
51481
|
LOADING: 'loading',
|
|
@@ -51483,17 +51483,17 @@
|
|
|
51483
51483
|
ERROR: 'error'
|
|
51484
51484
|
};
|
|
51485
51485
|
|
|
51486
|
-
/**
|
|
51487
|
-
* @typedef {Object} OptionsGetter
|
|
51488
|
-
* @property {Object[]} options - The options data
|
|
51489
|
-
* @property {(LOAD_STATES)} loadState - The options data's loading state, to use for conditional rendering
|
|
51486
|
+
/**
|
|
51487
|
+
* @typedef {Object} OptionsGetter
|
|
51488
|
+
* @property {Object[]} options - The options data
|
|
51489
|
+
* @property {(LOAD_STATES)} loadState - The options data's loading state, to use for conditional rendering
|
|
51490
51490
|
*/
|
|
51491
51491
|
|
|
51492
|
-
/**
|
|
51493
|
-
* A hook to load options for single and multiselect components.
|
|
51494
|
-
*
|
|
51495
|
-
* @param {Object} field - The form field to handle options for
|
|
51496
|
-
* @return {OptionsGetter} optionsGetter - A options getter object providing loading state and options
|
|
51492
|
+
/**
|
|
51493
|
+
* A hook to load options for single and multiselect components.
|
|
51494
|
+
*
|
|
51495
|
+
* @param {Object} field - The form field to handle options for
|
|
51496
|
+
* @return {OptionsGetter} optionsGetter - A options getter object providing loading state and options
|
|
51497
51497
|
*/
|
|
51498
51498
|
function useOptionsAsync(field) {
|
|
51499
51499
|
const {
|
|
@@ -52130,12 +52130,12 @@
|
|
|
52130
52130
|
})
|
|
52131
52131
|
};
|
|
52132
52132
|
|
|
52133
|
-
/**
|
|
52134
|
-
* Returns date format for the provided locale.
|
|
52135
|
-
* If the locale is not provided, uses the browser's locale.
|
|
52136
|
-
*
|
|
52137
|
-
* @param {string} [locale] - The locale to get date format for.
|
|
52138
|
-
* @returns {string} The date format for the locale.
|
|
52133
|
+
/**
|
|
52134
|
+
* Returns date format for the provided locale.
|
|
52135
|
+
* If the locale is not provided, uses the browser's locale.
|
|
52136
|
+
*
|
|
52137
|
+
* @param {string} [locale] - The locale to get date format for.
|
|
52138
|
+
* @returns {string} The date format for the locale.
|
|
52139
52139
|
*/
|
|
52140
52140
|
function getLocaleDateFormat(locale = 'default') {
|
|
52141
52141
|
const parts = new Intl.DateTimeFormat(locale).formatToParts(new Date(Date.UTC(2020, 5, 5)));
|
|
@@ -52154,12 +52154,12 @@
|
|
|
52154
52154
|
}).join('');
|
|
52155
52155
|
}
|
|
52156
52156
|
|
|
52157
|
-
/**
|
|
52158
|
-
* Returns readable date format for the provided locale.
|
|
52159
|
-
* If the locale is not provided, uses the browser's locale.
|
|
52160
|
-
*
|
|
52161
|
-
* @param {string} [locale] - The locale to get readable date format for.
|
|
52162
|
-
* @returns {string} The readable date format for the locale.
|
|
52157
|
+
/**
|
|
52158
|
+
* Returns readable date format for the provided locale.
|
|
52159
|
+
* If the locale is not provided, uses the browser's locale.
|
|
52160
|
+
*
|
|
52161
|
+
* @param {string} [locale] - The locale to get readable date format for.
|
|
52162
|
+
* @returns {string} The readable date format for the locale.
|
|
52163
52163
|
*/
|
|
52164
52164
|
function getLocaleReadableDateFormat(locale) {
|
|
52165
52165
|
let format = getLocaleDateFormat(locale).toLowerCase();
|
|
@@ -52176,12 +52176,12 @@
|
|
|
52176
52176
|
return format;
|
|
52177
52177
|
}
|
|
52178
52178
|
|
|
52179
|
-
/**
|
|
52180
|
-
* Returns flatpickr config for the provided locale.
|
|
52181
|
-
* If the locale is not provided, uses the browser's locale.
|
|
52182
|
-
*
|
|
52183
|
-
* @param {string} [locale] - The locale to get flatpickr config for.
|
|
52184
|
-
* @returns {object} The flatpickr config for the locale.
|
|
52179
|
+
/**
|
|
52180
|
+
* Returns flatpickr config for the provided locale.
|
|
52181
|
+
* If the locale is not provided, uses the browser's locale.
|
|
52182
|
+
*
|
|
52183
|
+
* @param {string} [locale] - The locale to get flatpickr config for.
|
|
52184
|
+
* @returns {object} The flatpickr config for the locale.
|
|
52185
52185
|
*/
|
|
52186
52186
|
function getLocaleDateFlatpickrConfig(locale) {
|
|
52187
52187
|
return flatpickerizeDateFormat(getLocaleDateFormat(locale));
|
|
@@ -52913,10 +52913,10 @@
|
|
|
52913
52913
|
}
|
|
52914
52914
|
};
|
|
52915
52915
|
|
|
52916
|
-
/**
|
|
52917
|
-
* This file must not be changed or exchanged.
|
|
52918
|
-
*
|
|
52919
|
-
* @see http://bpmn.io/license for more information.
|
|
52916
|
+
/**
|
|
52917
|
+
* This file must not be changed or exchanged.
|
|
52918
|
+
*
|
|
52919
|
+
* @see http://bpmn.io/license for more information.
|
|
52920
52920
|
*/
|
|
52921
52921
|
function Logo() {
|
|
52922
52922
|
return e$1("svg", {
|
|
@@ -53099,11 +53099,11 @@
|
|
|
53099
53099
|
|
|
53100
53100
|
const FORM_ELEMENT = document.createElement('form');
|
|
53101
53101
|
|
|
53102
|
-
/**
|
|
53103
|
-
* Sanitize a HTML string and return the cleaned, safe version.
|
|
53104
|
-
*
|
|
53105
|
-
* @param {string} html
|
|
53106
|
-
* @return {string}
|
|
53102
|
+
/**
|
|
53103
|
+
* Sanitize a HTML string and return the cleaned, safe version.
|
|
53104
|
+
*
|
|
53105
|
+
* @param {string} html
|
|
53106
|
+
* @return {string}
|
|
53107
53107
|
*/
|
|
53108
53108
|
|
|
53109
53109
|
// see https://github.com/developit/snarkdown/issues/70
|
|
@@ -53121,41 +53121,41 @@
|
|
|
53121
53121
|
}
|
|
53122
53122
|
}
|
|
53123
53123
|
|
|
53124
|
-
/**
|
|
53125
|
-
* Sanitizes an image source to ensure we only allow for data URI and links
|
|
53126
|
-
* that start with http(s).
|
|
53127
|
-
*
|
|
53128
|
-
* Note: Most browsers anyway do not support script execution in <img> elements.
|
|
53129
|
-
*
|
|
53130
|
-
* @param {string} src
|
|
53131
|
-
* @returns {string}
|
|
53124
|
+
/**
|
|
53125
|
+
* Sanitizes an image source to ensure we only allow for data URI and links
|
|
53126
|
+
* that start with http(s).
|
|
53127
|
+
*
|
|
53128
|
+
* Note: Most browsers anyway do not support script execution in <img> elements.
|
|
53129
|
+
*
|
|
53130
|
+
* @param {string} src
|
|
53131
|
+
* @returns {string}
|
|
53132
53132
|
*/
|
|
53133
53133
|
function sanitizeImageSource(src) {
|
|
53134
53134
|
const valid = ALLOWED_IMAGE_SRC_PATTERN.test(src);
|
|
53135
53135
|
return valid ? src : '';
|
|
53136
53136
|
}
|
|
53137
53137
|
|
|
53138
|
-
/**
|
|
53139
|
-
* Sanitizes an iframe source to ensure we only allow for links
|
|
53140
|
-
* that start with http(s).
|
|
53141
|
-
*
|
|
53142
|
-
* @param {string} src
|
|
53143
|
-
* @returns {string}
|
|
53138
|
+
/**
|
|
53139
|
+
* Sanitizes an iframe source to ensure we only allow for links
|
|
53140
|
+
* that start with http(s).
|
|
53141
|
+
*
|
|
53142
|
+
* @param {string} src
|
|
53143
|
+
* @returns {string}
|
|
53144
53144
|
*/
|
|
53145
53145
|
function sanitizeIFrameSource(src) {
|
|
53146
53146
|
const valid = ALLOWED_IFRAME_SRC_PATTERN.test(src);
|
|
53147
53147
|
return valid ? src : '';
|
|
53148
53148
|
}
|
|
53149
53149
|
|
|
53150
|
-
/**
|
|
53151
|
-
* Recursively sanitize a HTML node, potentially
|
|
53152
|
-
* removing it, its children or attributes.
|
|
53153
|
-
*
|
|
53154
|
-
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
53155
|
-
* and https://github.com/cure53/DOMPurify. Simplified
|
|
53156
|
-
* for our use-case.
|
|
53157
|
-
*
|
|
53158
|
-
* @param {Element} node
|
|
53150
|
+
/**
|
|
53151
|
+
* Recursively sanitize a HTML node, potentially
|
|
53152
|
+
* removing it, its children or attributes.
|
|
53153
|
+
*
|
|
53154
|
+
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
53155
|
+
* and https://github.com/cure53/DOMPurify. Simplified
|
|
53156
|
+
* for our use-case.
|
|
53157
|
+
*
|
|
53158
|
+
* @param {Element} node
|
|
53159
53159
|
*/
|
|
53160
53160
|
function sanitizeNode(node) {
|
|
53161
53161
|
// allow text nodes
|
|
@@ -53199,13 +53199,13 @@
|
|
|
53199
53199
|
}
|
|
53200
53200
|
}
|
|
53201
53201
|
|
|
53202
|
-
/**
|
|
53203
|
-
* Validates attributes for validity.
|
|
53204
|
-
*
|
|
53205
|
-
* @param {string} lcTag
|
|
53206
|
-
* @param {string} lcName
|
|
53207
|
-
* @param {string} value
|
|
53208
|
-
* @return {boolean}
|
|
53202
|
+
/**
|
|
53203
|
+
* Validates attributes for validity.
|
|
53204
|
+
*
|
|
53205
|
+
* @param {string} lcTag
|
|
53206
|
+
* @param {string} lcName
|
|
53207
|
+
* @param {string} value
|
|
53208
|
+
* @return {boolean}
|
|
53209
53209
|
*/
|
|
53210
53210
|
function isValidAttribute(lcTag, lcName, value) {
|
|
53211
53211
|
// disallow most attributes based on whitelist
|
|
@@ -53267,7 +53267,7 @@
|
|
|
53267
53267
|
height: height,
|
|
53268
53268
|
class: "fjs-iframe",
|
|
53269
53269
|
id: prefixId$2(id, formId),
|
|
53270
|
-
sandbox: ""
|
|
53270
|
+
sandbox: "allow-scripts"
|
|
53271
53271
|
}), evaluatedUrl && !safeUrl && e$1(IFramePlaceholder, {
|
|
53272
53272
|
text: "External content couldn't be loaded."
|
|
53273
53273
|
})]
|
|
@@ -54953,28 +54953,28 @@
|
|
|
54953
54953
|
var CaretRightIcon = SvgCaretRight;
|
|
54954
54954
|
const type = 'table';
|
|
54955
54955
|
|
|
54956
|
-
/**
|
|
54957
|
-
* @typedef {('asc'|'desc')} Direction
|
|
54958
|
-
*
|
|
54959
|
-
* @typedef Sorting
|
|
54960
|
-
* @property {string} key
|
|
54961
|
-
* @property {Direction} direction
|
|
54962
|
-
*
|
|
54963
|
-
* @typedef Column
|
|
54964
|
-
* @property {string} label
|
|
54965
|
-
* @property {string} key
|
|
54966
|
-
*
|
|
54967
|
-
* @typedef Props
|
|
54968
|
-
* @property {Object} field
|
|
54969
|
-
* @property {string} field.id
|
|
54970
|
-
* @property {Array<Column>} [field.columns]
|
|
54971
|
-
* @property {string} [field.columnsExpression]
|
|
54972
|
-
* @property {string} [field.label]
|
|
54973
|
-
* @property {number} [field.rowCount]
|
|
54974
|
-
* @property {string} [field.dataSource]
|
|
54975
|
-
*
|
|
54976
|
-
* @param {Props} props
|
|
54977
|
-
* @returns {import("preact").JSX.Element}
|
|
54956
|
+
/**
|
|
54957
|
+
* @typedef {('asc'|'desc')} Direction
|
|
54958
|
+
*
|
|
54959
|
+
* @typedef Sorting
|
|
54960
|
+
* @property {string} key
|
|
54961
|
+
* @property {Direction} direction
|
|
54962
|
+
*
|
|
54963
|
+
* @typedef Column
|
|
54964
|
+
* @property {string} label
|
|
54965
|
+
* @property {string} key
|
|
54966
|
+
*
|
|
54967
|
+
* @typedef Props
|
|
54968
|
+
* @property {Object} field
|
|
54969
|
+
* @property {string} field.id
|
|
54970
|
+
* @property {Array<Column>} [field.columns]
|
|
54971
|
+
* @property {string} [field.columnsExpression]
|
|
54972
|
+
* @property {string} [field.label]
|
|
54973
|
+
* @property {number} [field.rowCount]
|
|
54974
|
+
* @property {string} [field.dataSource]
|
|
54975
|
+
*
|
|
54976
|
+
* @param {Props} props
|
|
54977
|
+
* @returns {import("preact").JSX.Element}
|
|
54978
54978
|
*/
|
|
54979
54979
|
function Table(props) {
|
|
54980
54980
|
const {
|
|
@@ -55184,10 +55184,10 @@
|
|
|
55184
55184
|
|
|
55185
55185
|
// helpers /////////////////////////////
|
|
55186
55186
|
|
|
55187
|
-
/**
|
|
55188
|
-
* @param {string|void} columnsExpression
|
|
55189
|
-
* @param {Column[]} fallbackColumns
|
|
55190
|
-
* @returns {Column[]}
|
|
55187
|
+
/**
|
|
55188
|
+
* @param {string|void} columnsExpression
|
|
55189
|
+
* @param {Column[]} fallbackColumns
|
|
55190
|
+
* @returns {Column[]}
|
|
55191
55191
|
*/
|
|
55192
55192
|
function useEvaluatedColumns(columnsExpression, fallbackColumns) {
|
|
55193
55193
|
/** @type {Column[]|null} */
|
|
@@ -55195,18 +55195,18 @@
|
|
|
55195
55195
|
return Array.isArray(evaluation) && evaluation.every(isColumn) ? evaluation : fallbackColumns;
|
|
55196
55196
|
}
|
|
55197
55197
|
|
|
55198
|
-
/**
|
|
55199
|
-
* @param {any} column
|
|
55200
|
-
* @returns {column is Column}
|
|
55198
|
+
/**
|
|
55199
|
+
* @param {any} column
|
|
55200
|
+
* @returns {column is Column}
|
|
55201
55201
|
*/
|
|
55202
55202
|
function isColumn(column) {
|
|
55203
55203
|
return isObject$1(column) && isString$4(column['label']) && isString$4(column['key']);
|
|
55204
55204
|
}
|
|
55205
55205
|
|
|
55206
|
-
/**
|
|
55207
|
-
* @param {Array} array
|
|
55208
|
-
* @param {number} size
|
|
55209
|
-
* @returns {Array}
|
|
55206
|
+
/**
|
|
55207
|
+
* @param {Array} array
|
|
55208
|
+
* @param {number} size
|
|
55209
|
+
* @returns {Array}
|
|
55210
55210
|
*/
|
|
55211
55211
|
function chunk(array, size) {
|
|
55212
55212
|
return array.reduce((chunks, item, index) => {
|
|
@@ -55219,11 +55219,11 @@
|
|
|
55219
55219
|
}, []);
|
|
55220
55220
|
}
|
|
55221
55221
|
|
|
55222
|
-
/**
|
|
55223
|
-
* @param {unknown[]} array
|
|
55224
|
-
* @param {string} key
|
|
55225
|
-
* @param {Direction} direction
|
|
55226
|
-
* @returns {unknown[]}
|
|
55222
|
+
/**
|
|
55223
|
+
* @param {unknown[]} array
|
|
55224
|
+
* @param {string} key
|
|
55225
|
+
* @param {Direction} direction
|
|
55226
|
+
* @returns {unknown[]}
|
|
55227
55227
|
*/
|
|
55228
55228
|
function sortByColumn(array, key, direction) {
|
|
55229
55229
|
return [...array].sort((a, b) => {
|
|
@@ -55237,10 +55237,10 @@
|
|
|
55237
55237
|
});
|
|
55238
55238
|
}
|
|
55239
55239
|
|
|
55240
|
-
/**
|
|
55241
|
-
* @param {null|Sorting} sortBy
|
|
55242
|
-
* @param {string} key
|
|
55243
|
-
* @param {string} label
|
|
55240
|
+
/**
|
|
55241
|
+
* @param {null|Sorting} sortBy
|
|
55242
|
+
* @param {string} key
|
|
55243
|
+
* @param {string} label
|
|
55244
55244
|
*/
|
|
55245
55245
|
function getHeaderAriaLabel(sortBy, key, label) {
|
|
55246
55246
|
if (sortBy === null || sortBy.key !== key) {
|
|
@@ -55839,37 +55839,37 @@
|
|
|
55839
55839
|
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'];
|
|
55840
55840
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'url'];
|
|
55841
55841
|
|
|
55842
|
-
/**
|
|
55843
|
-
* @typedef { import('../types').Schema } Schema
|
|
55842
|
+
/**
|
|
55843
|
+
* @typedef { import('../types').Schema } Schema
|
|
55844
55844
|
*/
|
|
55845
55845
|
|
|
55846
|
-
/**
|
|
55847
|
-
* Parse the schema for variables a form might make use of.
|
|
55848
|
-
*
|
|
55849
|
-
* @example
|
|
55850
|
-
*
|
|
55851
|
-
* // retrieve variables from schema
|
|
55852
|
-
* const variables = getSchemaVariables(schema);
|
|
55853
|
-
*
|
|
55854
|
-
* @example
|
|
55855
|
-
*
|
|
55856
|
-
* // retrieve input variables from schema
|
|
55857
|
-
* const inputVariables = getSchemaVariables(schema, { outputs: false });
|
|
55858
|
-
*
|
|
55859
|
-
* @example
|
|
55860
|
-
*
|
|
55861
|
-
* // retrieve output variables from schema
|
|
55862
|
-
* const outputVariables = getSchemaVariables(schema, { inputs: false });
|
|
55863
|
-
*
|
|
55864
|
-
* @param {Schema} schema
|
|
55865
|
-
* @param {object} [options]
|
|
55866
|
-
* @param {any} [options.expressionLanguage]
|
|
55867
|
-
* @param {any} [options.templating]
|
|
55868
|
-
* @param {any} [options.formFields]
|
|
55869
|
-
* @param {boolean} [options.inputs=true]
|
|
55870
|
-
* @param {boolean} [options.outputs=true]
|
|
55871
|
-
*
|
|
55872
|
-
* @return {string[]}
|
|
55846
|
+
/**
|
|
55847
|
+
* Parse the schema for variables a form might make use of.
|
|
55848
|
+
*
|
|
55849
|
+
* @example
|
|
55850
|
+
*
|
|
55851
|
+
* // retrieve variables from schema
|
|
55852
|
+
* const variables = getSchemaVariables(schema);
|
|
55853
|
+
*
|
|
55854
|
+
* @example
|
|
55855
|
+
*
|
|
55856
|
+
* // retrieve input variables from schema
|
|
55857
|
+
* const inputVariables = getSchemaVariables(schema, { outputs: false });
|
|
55858
|
+
*
|
|
55859
|
+
* @example
|
|
55860
|
+
*
|
|
55861
|
+
* // retrieve output variables from schema
|
|
55862
|
+
* const outputVariables = getSchemaVariables(schema, { inputs: false });
|
|
55863
|
+
*
|
|
55864
|
+
* @param {Schema} schema
|
|
55865
|
+
* @param {object} [options]
|
|
55866
|
+
* @param {any} [options.expressionLanguage]
|
|
55867
|
+
* @param {any} [options.templating]
|
|
55868
|
+
* @param {any} [options.formFields]
|
|
55869
|
+
* @param {boolean} [options.inputs=true]
|
|
55870
|
+
* @param {boolean} [options.outputs=true]
|
|
55871
|
+
*
|
|
55872
|
+
* @return {string[]}
|
|
55873
55873
|
*/
|
|
55874
55874
|
function getSchemaVariables(schema, options = {}) {
|
|
55875
55875
|
const {
|
|
@@ -55945,13 +55945,13 @@
|
|
|
55945
55945
|
return Array.from(new Set(variables));
|
|
55946
55946
|
}
|
|
55947
55947
|
|
|
55948
|
-
/**
|
|
55949
|
-
* Get the ancestry list of a form field.
|
|
55950
|
-
*
|
|
55951
|
-
* @param {string} formFieldId
|
|
55952
|
-
* @param {import('../core/FormFieldRegistry').default} formFieldRegistry
|
|
55953
|
-
*
|
|
55954
|
-
* @return {Array<string>} ancestry list
|
|
55948
|
+
/**
|
|
55949
|
+
* Get the ancestry list of a form field.
|
|
55950
|
+
*
|
|
55951
|
+
* @param {string} formFieldId
|
|
55952
|
+
* @param {import('../core/FormFieldRegistry').default} formFieldRegistry
|
|
55953
|
+
*
|
|
55954
|
+
* @return {Array<string>} ancestry list
|
|
55955
55955
|
*/
|
|
55956
55956
|
const getAncestryList = (formFieldId, formFieldRegistry) => {
|
|
55957
55957
|
const ids = [];
|
|
@@ -55963,9 +55963,9 @@
|
|
|
55963
55963
|
return ids;
|
|
55964
55964
|
};
|
|
55965
55965
|
|
|
55966
|
-
/**
|
|
55967
|
-
* @typedef {object} Condition
|
|
55968
|
-
* @property {string} [hide]
|
|
55966
|
+
/**
|
|
55967
|
+
* @typedef {object} Condition
|
|
55968
|
+
* @property {string} [hide]
|
|
55969
55969
|
*/
|
|
55970
55970
|
|
|
55971
55971
|
class ConditionChecker {
|
|
@@ -55975,14 +55975,14 @@
|
|
|
55975
55975
|
this._eventBus = eventBus;
|
|
55976
55976
|
}
|
|
55977
55977
|
|
|
55978
|
-
/**
|
|
55979
|
-
* For given data, remove properties based on condition.
|
|
55980
|
-
*
|
|
55981
|
-
* @param {Object<string, any>} data
|
|
55982
|
-
* @param {Object<string, any>} contextData
|
|
55983
|
-
* @param {Object} [options]
|
|
55984
|
-
* @param {Function} [options.getFilterPath]
|
|
55985
|
-
* @param {boolean} [options.leafNodeDeletionOnly]
|
|
55978
|
+
/**
|
|
55979
|
+
* For given data, remove properties based on condition.
|
|
55980
|
+
*
|
|
55981
|
+
* @param {Object<string, any>} data
|
|
55982
|
+
* @param {Object<string, any>} contextData
|
|
55983
|
+
* @param {Object} [options]
|
|
55984
|
+
* @param {Function} [options.getFilterPath]
|
|
55985
|
+
* @param {boolean} [options.leafNodeDeletionOnly]
|
|
55986
55986
|
*/
|
|
55987
55987
|
applyConditions(data, contextData = {}, options = {}) {
|
|
55988
55988
|
const workingData = clone(data);
|
|
@@ -56076,13 +56076,13 @@
|
|
|
56076
56076
|
return workingData;
|
|
56077
56077
|
}
|
|
56078
56078
|
|
|
56079
|
-
/**
|
|
56080
|
-
* Check if given condition is met. Returns null for invalid/missing conditions.
|
|
56081
|
-
*
|
|
56082
|
-
* @param {string} condition
|
|
56083
|
-
* @param {import('../../types').Data} [data]
|
|
56084
|
-
*
|
|
56085
|
-
* @returns {boolean|null}
|
|
56079
|
+
/**
|
|
56080
|
+
* Check if given condition is met. Returns null for invalid/missing conditions.
|
|
56081
|
+
*
|
|
56082
|
+
* @param {string} condition
|
|
56083
|
+
* @param {import('../../types').Data} [data]
|
|
56084
|
+
*
|
|
56085
|
+
* @returns {boolean|null}
|
|
56086
56086
|
*/
|
|
56087
56087
|
check(condition, data = {}) {
|
|
56088
56088
|
if (!condition) {
|
|
@@ -56103,12 +56103,12 @@
|
|
|
56103
56103
|
}
|
|
56104
56104
|
}
|
|
56105
56105
|
|
|
56106
|
-
/**
|
|
56107
|
-
* Check if hide condition is met.
|
|
56108
|
-
*
|
|
56109
|
-
* @param {Condition} condition
|
|
56110
|
-
* @param {Object<string, any>} data
|
|
56111
|
-
* @returns {boolean}
|
|
56106
|
+
/**
|
|
56107
|
+
* Check if hide condition is met.
|
|
56108
|
+
*
|
|
56109
|
+
* @param {Condition} condition
|
|
56110
|
+
* @param {Object<string, any>} data
|
|
56111
|
+
* @returns {boolean}
|
|
56112
56112
|
*/
|
|
56113
56113
|
_checkHideCondition(condition, data) {
|
|
56114
56114
|
if (!condition.hide) {
|
|
@@ -56149,12 +56149,12 @@
|
|
|
56149
56149
|
this._converter = new showdown.Converter();
|
|
56150
56150
|
}
|
|
56151
56151
|
|
|
56152
|
-
/**
|
|
56153
|
-
* Render markdown to HTML.
|
|
56154
|
-
*
|
|
56155
|
-
* @param {string} markdown - The markdown to render
|
|
56156
|
-
*
|
|
56157
|
-
* @returns {string} HTML
|
|
56152
|
+
/**
|
|
56153
|
+
* Render markdown to HTML.
|
|
56154
|
+
*
|
|
56155
|
+
* @param {string} markdown - The markdown to render
|
|
56156
|
+
*
|
|
56157
|
+
* @returns {string} HTML
|
|
56158
56158
|
*/
|
|
56159
56159
|
render(markdown) {
|
|
56160
56160
|
return this._converter.makeHtml(markdown);
|
|
@@ -56819,11 +56819,11 @@
|
|
|
56819
56819
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
56820
56820
|
}
|
|
56821
56821
|
|
|
56822
|
-
/**
|
|
56823
|
-
* Checks whether a field is currently repeating its children.
|
|
56824
|
-
*
|
|
56825
|
-
* @param {string} id - The id of the field to check
|
|
56826
|
-
* @returns {boolean} - True if repeatable, false otherwise
|
|
56822
|
+
/**
|
|
56823
|
+
* Checks whether a field is currently repeating its children.
|
|
56824
|
+
*
|
|
56825
|
+
* @param {string} id - The id of the field to check
|
|
56826
|
+
* @returns {boolean} - True if repeatable, false otherwise
|
|
56827
56827
|
*/
|
|
56828
56828
|
isFieldRepeating(id) {
|
|
56829
56829
|
if (!id) {
|
|
@@ -57580,8 +57580,8 @@
|
|
|
57580
57580
|
|
|
57581
57581
|
// helpers //////////
|
|
57582
57582
|
|
|
57583
|
-
/**
|
|
57584
|
-
* Helper function to evaluate optional FEEL validation values.
|
|
57583
|
+
/**
|
|
57584
|
+
* Helper function to evaluate optional FEEL validation values.
|
|
57585
57585
|
*/
|
|
57586
57586
|
function evaluateFEELValues(validate, expressionLanguage, conditionChecker, form) {
|
|
57587
57587
|
const evaluatedValidate = {
|
|
@@ -57614,12 +57614,12 @@
|
|
|
57614
57614
|
return evaluatedValidate;
|
|
57615
57615
|
}
|
|
57616
57616
|
class Importer {
|
|
57617
|
-
/**
|
|
57618
|
-
* @constructor
|
|
57619
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
57620
|
-
* @param { import('./PathRegistry').default } pathRegistry
|
|
57621
|
-
* @param { import('./FieldFactory').default } fieldFactory
|
|
57622
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
57617
|
+
/**
|
|
57618
|
+
* @constructor
|
|
57619
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
57620
|
+
* @param { import('./PathRegistry').default } pathRegistry
|
|
57621
|
+
* @param { import('./FieldFactory').default } fieldFactory
|
|
57622
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
57623
57623
|
*/
|
|
57624
57624
|
constructor(formFieldRegistry, pathRegistry, fieldFactory, formLayouter) {
|
|
57625
57625
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -57628,21 +57628,21 @@
|
|
|
57628
57628
|
this._formLayouter = formLayouter;
|
|
57629
57629
|
}
|
|
57630
57630
|
|
|
57631
|
-
/**
|
|
57632
|
-
* Import schema creating rows, fields, attaching additional
|
|
57633
|
-
* information to each field and adding fields to the
|
|
57634
|
-
* field registry.
|
|
57635
|
-
*
|
|
57636
|
-
* Additional information attached:
|
|
57637
|
-
*
|
|
57638
|
-
* * `id` (unless present)
|
|
57639
|
-
* * `_parent`
|
|
57640
|
-
* * `_path`
|
|
57641
|
-
*
|
|
57642
|
-
* @param {any} schema
|
|
57643
|
-
*
|
|
57644
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
57645
|
-
* @returns {ImportResult}
|
|
57631
|
+
/**
|
|
57632
|
+
* Import schema creating rows, fields, attaching additional
|
|
57633
|
+
* information to each field and adding fields to the
|
|
57634
|
+
* field registry.
|
|
57635
|
+
*
|
|
57636
|
+
* Additional information attached:
|
|
57637
|
+
*
|
|
57638
|
+
* * `id` (unless present)
|
|
57639
|
+
* * `_parent`
|
|
57640
|
+
* * `_path`
|
|
57641
|
+
*
|
|
57642
|
+
* @param {any} schema
|
|
57643
|
+
*
|
|
57644
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
57645
|
+
* @returns {ImportResult}
|
|
57646
57646
|
*/
|
|
57647
57647
|
importSchema(schema) {
|
|
57648
57648
|
// TODO: Add warnings
|
|
@@ -57667,12 +57667,12 @@
|
|
|
57667
57667
|
this._pathRegistry.clear();
|
|
57668
57668
|
}
|
|
57669
57669
|
|
|
57670
|
-
/**
|
|
57671
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
57672
|
-
* @param {String} [parentId]
|
|
57673
|
-
* @param {number} [index]
|
|
57674
|
-
*
|
|
57675
|
-
* @return {any} field
|
|
57670
|
+
/**
|
|
57671
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
57672
|
+
* @param {String} [parentId]
|
|
57673
|
+
* @param {number} [index]
|
|
57674
|
+
*
|
|
57675
|
+
* @return {any} field
|
|
57676
57676
|
*/
|
|
57677
57677
|
importFormField(fieldAttrs, parentId, index) {
|
|
57678
57678
|
const {
|
|
@@ -57697,11 +57697,11 @@
|
|
|
57697
57697
|
return field;
|
|
57698
57698
|
}
|
|
57699
57699
|
|
|
57700
|
-
/**
|
|
57701
|
-
* @param {Array<any>} components
|
|
57702
|
-
* @param {string} parentId
|
|
57703
|
-
*
|
|
57704
|
-
* @return {Array<any>} imported components
|
|
57700
|
+
/**
|
|
57701
|
+
* @param {Array<any>} components
|
|
57702
|
+
* @param {string} parentId
|
|
57703
|
+
*
|
|
57704
|
+
* @return {Array<any>} imported components
|
|
57705
57705
|
*/
|
|
57706
57706
|
importFormFields(components, parentId) {
|
|
57707
57707
|
return components.map((component, index) => {
|
|
@@ -57711,11 +57711,11 @@
|
|
|
57711
57711
|
}
|
|
57712
57712
|
Importer.$inject = ['formFieldRegistry', 'pathRegistry', 'fieldFactory', 'formLayouter'];
|
|
57713
57713
|
class FieldFactory {
|
|
57714
|
-
/**
|
|
57715
|
-
* @constructor
|
|
57716
|
-
*
|
|
57717
|
-
* @param formFieldRegistry
|
|
57718
|
-
* @param formFields
|
|
57714
|
+
/**
|
|
57715
|
+
* @constructor
|
|
57716
|
+
*
|
|
57717
|
+
* @param formFieldRegistry
|
|
57718
|
+
* @param formFields
|
|
57719
57719
|
*/
|
|
57720
57720
|
constructor(formFieldRegistry, pathRegistry, formFields) {
|
|
57721
57721
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -57825,36 +57825,36 @@
|
|
|
57825
57825
|
}
|
|
57826
57826
|
FieldFactory.$inject = ['formFieldRegistry', 'pathRegistry', 'formFields'];
|
|
57827
57827
|
|
|
57828
|
-
/**
|
|
57829
|
-
* The PathRegistry class manages a hierarchical structure of paths associated with form fields.
|
|
57830
|
-
* It enables claiming, unclaiming, and validating paths within this structure.
|
|
57831
|
-
*
|
|
57832
|
-
* Example Tree Structure:
|
|
57833
|
-
*
|
|
57834
|
-
* [
|
|
57835
|
-
* {
|
|
57836
|
-
* segment: 'root',
|
|
57837
|
-
* claimCount: 1,
|
|
57838
|
-
* children: [
|
|
57839
|
-
* {
|
|
57840
|
-
* segment: 'child1',
|
|
57841
|
-
* claimCount: 2,
|
|
57842
|
-
* children: null // A leaf node (closed path)
|
|
57843
|
-
* },
|
|
57844
|
-
* {
|
|
57845
|
-
* segment: 'child2',
|
|
57846
|
-
* claimCount: 1,
|
|
57847
|
-
* children: [
|
|
57848
|
-
* {
|
|
57849
|
-
* segment: 'subChild1',
|
|
57850
|
-
* claimCount: 1,
|
|
57851
|
-
* children: [] // An open node (open path)
|
|
57852
|
-
* }
|
|
57853
|
-
* ]
|
|
57854
|
-
* }
|
|
57855
|
-
* ]
|
|
57856
|
-
* }
|
|
57857
|
-
* ]
|
|
57828
|
+
/**
|
|
57829
|
+
* The PathRegistry class manages a hierarchical structure of paths associated with form fields.
|
|
57830
|
+
* It enables claiming, unclaiming, and validating paths within this structure.
|
|
57831
|
+
*
|
|
57832
|
+
* Example Tree Structure:
|
|
57833
|
+
*
|
|
57834
|
+
* [
|
|
57835
|
+
* {
|
|
57836
|
+
* segment: 'root',
|
|
57837
|
+
* claimCount: 1,
|
|
57838
|
+
* children: [
|
|
57839
|
+
* {
|
|
57840
|
+
* segment: 'child1',
|
|
57841
|
+
* claimCount: 2,
|
|
57842
|
+
* children: null // A leaf node (closed path)
|
|
57843
|
+
* },
|
|
57844
|
+
* {
|
|
57845
|
+
* segment: 'child2',
|
|
57846
|
+
* claimCount: 1,
|
|
57847
|
+
* children: [
|
|
57848
|
+
* {
|
|
57849
|
+
* segment: 'subChild1',
|
|
57850
|
+
* claimCount: 1,
|
|
57851
|
+
* children: [] // An open node (open path)
|
|
57852
|
+
* }
|
|
57853
|
+
* ]
|
|
57854
|
+
* }
|
|
57855
|
+
* ]
|
|
57856
|
+
* }
|
|
57857
|
+
* ]
|
|
57858
57858
|
*/
|
|
57859
57859
|
class PathRegistry {
|
|
57860
57860
|
constructor(formFieldRegistry, formFields, injector) {
|
|
@@ -57970,16 +57970,16 @@
|
|
|
57970
57970
|
}
|
|
57971
57971
|
}
|
|
57972
57972
|
|
|
57973
|
-
/**
|
|
57974
|
-
* Applies a function (fn) recursively on a given field and its children.
|
|
57975
|
-
*
|
|
57976
|
-
* - `field`: Starting field object.
|
|
57977
|
-
* - `fn`: Function to apply.
|
|
57978
|
-
* - `context`: Optional object for passing data between calls.
|
|
57979
|
-
*
|
|
57980
|
-
* Stops early if `fn` returns `false`. Useful for traversing the form field tree.
|
|
57981
|
-
*
|
|
57982
|
-
* @returns {boolean} Success status based on function execution.
|
|
57973
|
+
/**
|
|
57974
|
+
* Applies a function (fn) recursively on a given field and its children.
|
|
57975
|
+
*
|
|
57976
|
+
* - `field`: Starting field object.
|
|
57977
|
+
* - `fn`: Function to apply.
|
|
57978
|
+
* - `context`: Optional object for passing data between calls.
|
|
57979
|
+
*
|
|
57980
|
+
* Stops early if `fn` returns `false`. Useful for traversing the form field tree.
|
|
57981
|
+
*
|
|
57982
|
+
* @returns {boolean} Success status based on function execution.
|
|
57983
57983
|
*/
|
|
57984
57984
|
executeRecursivelyOnFields(field, fn, context = {}) {
|
|
57985
57985
|
let result = true;
|
|
@@ -58020,16 +58020,16 @@
|
|
|
58020
58020
|
return result;
|
|
58021
58021
|
}
|
|
58022
58022
|
|
|
58023
|
-
/**
|
|
58024
|
-
* Generates an array representing the binding path to an underlying data object for a form field.
|
|
58025
|
-
*
|
|
58026
|
-
* @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
|
|
58027
|
-
* @param {Object} [options={}] - Configuration options.
|
|
58028
|
-
* @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
|
|
58029
|
-
* @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.
|
|
58030
|
-
* @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
|
|
58031
|
-
*
|
|
58032
|
-
* @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
|
|
58023
|
+
/**
|
|
58024
|
+
* Generates an array representing the binding path to an underlying data object for a form field.
|
|
58025
|
+
*
|
|
58026
|
+
* @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
|
|
58027
|
+
* @param {Object} [options={}] - Configuration options.
|
|
58028
|
+
* @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
|
|
58029
|
+
* @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.
|
|
58030
|
+
* @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
|
|
58031
|
+
*
|
|
58032
|
+
* @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
|
|
58033
58033
|
*/
|
|
58034
58034
|
getValuePath(field, options = {}) {
|
|
58035
58035
|
const {
|
|
@@ -58090,23 +58090,23 @@
|
|
|
58090
58090
|
};
|
|
58091
58091
|
PathRegistry.$inject = ['formFieldRegistry', 'formFields', 'injector'];
|
|
58092
58092
|
|
|
58093
|
-
/**
|
|
58094
|
-
* @typedef { { id: String, components: Array<String> } } FormRow
|
|
58095
|
-
* @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
|
|
58093
|
+
/**
|
|
58094
|
+
* @typedef { { id: String, components: Array<String> } } FormRow
|
|
58095
|
+
* @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
|
|
58096
58096
|
*/
|
|
58097
58097
|
|
|
58098
|
-
/**
|
|
58099
|
-
* Maintains the Form layout in a given structure, for example
|
|
58100
|
-
*
|
|
58101
|
-
* [
|
|
58102
|
-
* {
|
|
58103
|
-
* formFieldId: 'FormField_1',
|
|
58104
|
-
* rows: [
|
|
58105
|
-
* { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
|
|
58106
|
-
* ]
|
|
58107
|
-
* }
|
|
58108
|
-
* ]
|
|
58109
|
-
*
|
|
58098
|
+
/**
|
|
58099
|
+
* Maintains the Form layout in a given structure, for example
|
|
58100
|
+
*
|
|
58101
|
+
* [
|
|
58102
|
+
* {
|
|
58103
|
+
* formFieldId: 'FormField_1',
|
|
58104
|
+
* rows: [
|
|
58105
|
+
* { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
|
|
58106
|
+
* ]
|
|
58107
|
+
* }
|
|
58108
|
+
* ]
|
|
58109
|
+
*
|
|
58110
58110
|
*/
|
|
58111
58111
|
class FormLayouter {
|
|
58112
58112
|
constructor(eventBus) {
|
|
@@ -58116,8 +58116,8 @@
|
|
|
58116
58116
|
this._eventBus = eventBus;
|
|
58117
58117
|
}
|
|
58118
58118
|
|
|
58119
|
-
/**
|
|
58120
|
-
* @param {FormRow} row
|
|
58119
|
+
/**
|
|
58120
|
+
* @param {FormRow} row
|
|
58121
58121
|
*/
|
|
58122
58122
|
addRow(formFieldId, row) {
|
|
58123
58123
|
let rowsPerComponent = this._rows.find(r => r.formFieldId === formFieldId);
|
|
@@ -58131,18 +58131,18 @@
|
|
|
58131
58131
|
rowsPerComponent.rows.push(row);
|
|
58132
58132
|
}
|
|
58133
58133
|
|
|
58134
|
-
/**
|
|
58135
|
-
* @param {String} id
|
|
58136
|
-
* @returns {FormRow}
|
|
58134
|
+
/**
|
|
58135
|
+
* @param {String} id
|
|
58136
|
+
* @returns {FormRow}
|
|
58137
58137
|
*/
|
|
58138
58138
|
getRow(id) {
|
|
58139
58139
|
const rows = allRows(this._rows);
|
|
58140
58140
|
return rows.find(r => r.id === id);
|
|
58141
58141
|
}
|
|
58142
58142
|
|
|
58143
|
-
/**
|
|
58144
|
-
* @param {any} formField
|
|
58145
|
-
* @returns {FormRow}
|
|
58143
|
+
/**
|
|
58144
|
+
* @param {any} formField
|
|
58145
|
+
* @returns {FormRow}
|
|
58146
58146
|
*/
|
|
58147
58147
|
getRowForField(formField) {
|
|
58148
58148
|
return allRows(this._rows).find(r => {
|
|
@@ -58153,9 +58153,9 @@
|
|
|
58153
58153
|
});
|
|
58154
58154
|
}
|
|
58155
58155
|
|
|
58156
|
-
/**
|
|
58157
|
-
* @param {String} formFieldId
|
|
58158
|
-
* @returns { Array<FormRow> }
|
|
58156
|
+
/**
|
|
58157
|
+
* @param {String} formFieldId
|
|
58158
|
+
* @returns { Array<FormRow> }
|
|
58159
58159
|
*/
|
|
58160
58160
|
getRows(formFieldId) {
|
|
58161
58161
|
const rowsForField = this._rows.find(r => formFieldId === r.formFieldId);
|
|
@@ -58165,15 +58165,15 @@
|
|
|
58165
58165
|
return rowsForField.rows;
|
|
58166
58166
|
}
|
|
58167
58167
|
|
|
58168
|
-
/**
|
|
58169
|
-
* @returns {string}
|
|
58168
|
+
/**
|
|
58169
|
+
* @returns {string}
|
|
58170
58170
|
*/
|
|
58171
58171
|
nextRowId() {
|
|
58172
58172
|
return this._ids.nextPrefixed('Row_');
|
|
58173
58173
|
}
|
|
58174
58174
|
|
|
58175
|
-
/**
|
|
58176
|
-
* @param {any} formField
|
|
58175
|
+
/**
|
|
58176
|
+
* @param {any} formField
|
|
58177
58177
|
*/
|
|
58178
58178
|
calculateLayout(formField) {
|
|
58179
58179
|
const {
|
|
@@ -58227,9 +58227,9 @@
|
|
|
58227
58227
|
});
|
|
58228
58228
|
}
|
|
58229
58229
|
|
|
58230
|
-
/**
|
|
58231
|
-
* @param {Array<FormRows>} formRows
|
|
58232
|
-
* @returns {Array<FormRow>}
|
|
58230
|
+
/**
|
|
58231
|
+
* @param {Array<FormRows>} formRows
|
|
58232
|
+
* @returns {Array<FormRow>}
|
|
58233
58233
|
*/
|
|
58234
58234
|
function allRows(formRows) {
|
|
58235
58235
|
return flatten$3(formRows.map(c => c.rows));
|
|
@@ -58350,55 +58350,55 @@
|
|
|
58350
58350
|
validator: ['type', Validator]
|
|
58351
58351
|
};
|
|
58352
58352
|
|
|
58353
|
-
/**
|
|
58354
|
-
* @typedef { import('./types').Injector } Injector
|
|
58355
|
-
* @typedef { import('./types').Data } Data
|
|
58356
|
-
* @typedef { import('./types').Errors } Errors
|
|
58357
|
-
* @typedef { import('./types').Schema } Schema
|
|
58358
|
-
* @typedef { import('./types').FormProperties } FormProperties
|
|
58359
|
-
* @typedef { import('./types').FormProperty } FormProperty
|
|
58360
|
-
* @typedef { import('./types').FormEvent } FormEvent
|
|
58361
|
-
* @typedef { import('./types').FormOptions } FormOptions
|
|
58362
|
-
*
|
|
58363
|
-
* @typedef { {
|
|
58364
|
-
* data: Data,
|
|
58365
|
-
* initialData: Data,
|
|
58366
|
-
* errors: Errors,
|
|
58367
|
-
* properties: FormProperties,
|
|
58368
|
-
* schema: Schema
|
|
58369
|
-
* } } State
|
|
58370
|
-
*
|
|
58371
|
-
* @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
|
|
58372
|
-
* @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
|
|
58373
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
58353
|
+
/**
|
|
58354
|
+
* @typedef { import('./types').Injector } Injector
|
|
58355
|
+
* @typedef { import('./types').Data } Data
|
|
58356
|
+
* @typedef { import('./types').Errors } Errors
|
|
58357
|
+
* @typedef { import('./types').Schema } Schema
|
|
58358
|
+
* @typedef { import('./types').FormProperties } FormProperties
|
|
58359
|
+
* @typedef { import('./types').FormProperty } FormProperty
|
|
58360
|
+
* @typedef { import('./types').FormEvent } FormEvent
|
|
58361
|
+
* @typedef { import('./types').FormOptions } FormOptions
|
|
58362
|
+
*
|
|
58363
|
+
* @typedef { {
|
|
58364
|
+
* data: Data,
|
|
58365
|
+
* initialData: Data,
|
|
58366
|
+
* errors: Errors,
|
|
58367
|
+
* properties: FormProperties,
|
|
58368
|
+
* schema: Schema
|
|
58369
|
+
* } } State
|
|
58370
|
+
*
|
|
58371
|
+
* @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
|
|
58372
|
+
* @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
|
|
58373
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
58374
58374
|
*/
|
|
58375
58375
|
|
|
58376
58376
|
const ids$1 = new Ids([32, 36, 1]);
|
|
58377
58377
|
|
|
58378
|
-
/**
|
|
58379
|
-
* The form.
|
|
58378
|
+
/**
|
|
58379
|
+
* The form.
|
|
58380
58380
|
*/
|
|
58381
58381
|
class Form {
|
|
58382
|
-
/**
|
|
58383
|
-
* @constructor
|
|
58384
|
-
* @param {FormOptions} options
|
|
58382
|
+
/**
|
|
58383
|
+
* @constructor
|
|
58384
|
+
* @param {FormOptions} options
|
|
58385
58385
|
*/
|
|
58386
58386
|
constructor(options = {}) {
|
|
58387
|
-
/**
|
|
58388
|
-
* @public
|
|
58389
|
-
* @type {OnEventType}
|
|
58387
|
+
/**
|
|
58388
|
+
* @public
|
|
58389
|
+
* @type {OnEventType}
|
|
58390
58390
|
*/
|
|
58391
58391
|
this.on = this._onEvent;
|
|
58392
58392
|
|
|
58393
|
-
/**
|
|
58394
|
-
* @public
|
|
58395
|
-
* @type {String}
|
|
58393
|
+
/**
|
|
58394
|
+
* @public
|
|
58395
|
+
* @type {String}
|
|
58396
58396
|
*/
|
|
58397
58397
|
this._id = ids$1.next();
|
|
58398
58398
|
|
|
58399
|
-
/**
|
|
58400
|
-
* @private
|
|
58401
|
-
* @type {Element}
|
|
58399
|
+
/**
|
|
58400
|
+
* @private
|
|
58401
|
+
* @type {Element}
|
|
58402
58402
|
*/
|
|
58403
58403
|
this._container = createFormContainer();
|
|
58404
58404
|
const {
|
|
@@ -58407,9 +58407,9 @@
|
|
|
58407
58407
|
properties = {}
|
|
58408
58408
|
} = options;
|
|
58409
58409
|
|
|
58410
|
-
/**
|
|
58411
|
-
* @private
|
|
58412
|
-
* @type {State}
|
|
58410
|
+
/**
|
|
58411
|
+
* @private
|
|
58412
|
+
* @type {State}
|
|
58413
58413
|
*/
|
|
58414
58414
|
this._state = {
|
|
58415
58415
|
initialData: null,
|
|
@@ -58433,9 +58433,9 @@
|
|
|
58433
58433
|
this._emit('form.clear');
|
|
58434
58434
|
}
|
|
58435
58435
|
|
|
58436
|
-
/**
|
|
58437
|
-
* Destroy the form, removing it from DOM,
|
|
58438
|
-
* if attached.
|
|
58436
|
+
/**
|
|
58437
|
+
* Destroy the form, removing it from DOM,
|
|
58438
|
+
* if attached.
|
|
58439
58439
|
*/
|
|
58440
58440
|
destroy() {
|
|
58441
58441
|
// destroy form services
|
|
@@ -58445,14 +58445,14 @@
|
|
|
58445
58445
|
this.get('eventBus').fire('diagram.destroy');
|
|
58446
58446
|
this._detach(false);
|
|
58447
58447
|
}
|
|
58448
|
-
|
|
58449
|
-
/**
|
|
58450
|
-
* Open a form schema with the given initial data.
|
|
58451
|
-
*
|
|
58452
|
-
* @param {Schema} schema
|
|
58453
|
-
* @param {Data} [data]
|
|
58454
|
-
*
|
|
58455
|
-
* @return Promise<{ warnings: Array<any> }>
|
|
58448
|
+
|
|
58449
|
+
/**
|
|
58450
|
+
* Open a form schema with the given initial data.
|
|
58451
|
+
*
|
|
58452
|
+
* @param {Schema} schema
|
|
58453
|
+
* @param {Data} [data]
|
|
58454
|
+
*
|
|
58455
|
+
* @return Promise<{ warnings: Array<any> }>
|
|
58456
58456
|
*/
|
|
58457
58457
|
importSchema(schema, data = {}) {
|
|
58458
58458
|
return new Promise((resolve, reject) => {
|
|
@@ -58485,10 +58485,10 @@
|
|
|
58485
58485
|
});
|
|
58486
58486
|
}
|
|
58487
58487
|
|
|
58488
|
-
/**
|
|
58489
|
-
* Submit the form, triggering all field validations.
|
|
58490
|
-
*
|
|
58491
|
-
* @returns { { data: Data, errors: Errors } }
|
|
58488
|
+
/**
|
|
58489
|
+
* Submit the form, triggering all field validations.
|
|
58490
|
+
*
|
|
58491
|
+
* @returns { { data: Data, errors: Errors } }
|
|
58492
58492
|
*/
|
|
58493
58493
|
submit() {
|
|
58494
58494
|
const {
|
|
@@ -58514,8 +58514,8 @@
|
|
|
58514
58514
|
});
|
|
58515
58515
|
}
|
|
58516
58516
|
|
|
58517
|
-
/**
|
|
58518
|
-
* @returns {Errors}
|
|
58517
|
+
/**
|
|
58518
|
+
* @returns {Errors}
|
|
58519
58519
|
*/
|
|
58520
58520
|
validate() {
|
|
58521
58521
|
const formFields = this.get('formFields'),
|
|
@@ -58587,8 +58587,8 @@
|
|
|
58587
58587
|
return filteredErrors;
|
|
58588
58588
|
}
|
|
58589
58589
|
|
|
58590
|
-
/**
|
|
58591
|
-
* @param {Element|string} parentNode
|
|
58590
|
+
/**
|
|
58591
|
+
* @param {Element|string} parentNode
|
|
58592
58592
|
*/
|
|
58593
58593
|
attachTo(parentNode) {
|
|
58594
58594
|
if (!parentNode) {
|
|
@@ -58606,10 +58606,10 @@
|
|
|
58606
58606
|
this._detach();
|
|
58607
58607
|
}
|
|
58608
58608
|
|
|
58609
|
-
/**
|
|
58610
|
-
* @private
|
|
58611
|
-
*
|
|
58612
|
-
* @param {boolean} [emit]
|
|
58609
|
+
/**
|
|
58610
|
+
* @private
|
|
58611
|
+
*
|
|
58612
|
+
* @param {boolean} [emit]
|
|
58613
58613
|
*/
|
|
58614
58614
|
_detach(emit = true) {
|
|
58615
58615
|
const container = this._container,
|
|
@@ -58623,9 +58623,9 @@
|
|
|
58623
58623
|
parentNode.removeChild(container);
|
|
58624
58624
|
}
|
|
58625
58625
|
|
|
58626
|
-
/**
|
|
58627
|
-
* @param {FormProperty} property
|
|
58628
|
-
* @param {any} value
|
|
58626
|
+
/**
|
|
58627
|
+
* @param {FormProperty} property
|
|
58628
|
+
* @param {any} value
|
|
58629
58629
|
*/
|
|
58630
58630
|
setProperty(property, value) {
|
|
58631
58631
|
const properties = set$3(this._getState().properties, [property], value);
|
|
@@ -58634,21 +58634,21 @@
|
|
|
58634
58634
|
});
|
|
58635
58635
|
}
|
|
58636
58636
|
|
|
58637
|
-
/**
|
|
58638
|
-
* @param {FormEvent} type
|
|
58639
|
-
* @param {Function} handler
|
|
58637
|
+
/**
|
|
58638
|
+
* @param {FormEvent} type
|
|
58639
|
+
* @param {Function} handler
|
|
58640
58640
|
*/
|
|
58641
58641
|
off(type, handler) {
|
|
58642
58642
|
this.get('eventBus').off(type, handler);
|
|
58643
58643
|
}
|
|
58644
58644
|
|
|
58645
|
-
/**
|
|
58646
|
-
* @private
|
|
58647
|
-
*
|
|
58648
|
-
* @param {FormOptions} options
|
|
58649
|
-
* @param {Element} container
|
|
58650
|
-
*
|
|
58651
|
-
* @returns {Injector}
|
|
58645
|
+
/**
|
|
58646
|
+
* @private
|
|
58647
|
+
*
|
|
58648
|
+
* @param {FormOptions} options
|
|
58649
|
+
* @param {Element} container
|
|
58650
|
+
*
|
|
58651
|
+
* @returns {Injector}
|
|
58652
58652
|
*/
|
|
58653
58653
|
_createInjector(options, container) {
|
|
58654
58654
|
const {
|
|
@@ -58667,17 +58667,17 @@
|
|
|
58667
58667
|
}, core$1, ...modules, ...additionalModules]);
|
|
58668
58668
|
}
|
|
58669
58669
|
|
|
58670
|
-
/**
|
|
58671
|
-
* @private
|
|
58670
|
+
/**
|
|
58671
|
+
* @private
|
|
58672
58672
|
*/
|
|
58673
58673
|
_emit(type, data) {
|
|
58674
58674
|
this.get('eventBus').fire(type, data);
|
|
58675
58675
|
}
|
|
58676
58676
|
|
|
58677
|
-
/**
|
|
58678
|
-
* @internal
|
|
58679
|
-
*
|
|
58680
|
-
* @param { { add?: boolean, field: any, indexes: object, remove?: number, value?: any } } update
|
|
58677
|
+
/**
|
|
58678
|
+
* @internal
|
|
58679
|
+
*
|
|
58680
|
+
* @param { { add?: boolean, field: any, indexes: object, remove?: number, value?: any } } update
|
|
58681
58681
|
*/
|
|
58682
58682
|
_update(update) {
|
|
58683
58683
|
const {
|
|
@@ -58703,15 +58703,15 @@
|
|
|
58703
58703
|
});
|
|
58704
58704
|
}
|
|
58705
58705
|
|
|
58706
|
-
/**
|
|
58707
|
-
* @internal
|
|
58706
|
+
/**
|
|
58707
|
+
* @internal
|
|
58708
58708
|
*/
|
|
58709
58709
|
_getState() {
|
|
58710
58710
|
return this._state;
|
|
58711
58711
|
}
|
|
58712
58712
|
|
|
58713
|
-
/**
|
|
58714
|
-
* @internal
|
|
58713
|
+
/**
|
|
58714
|
+
* @internal
|
|
58715
58715
|
*/
|
|
58716
58716
|
_setState(state) {
|
|
58717
58717
|
this._state = {
|
|
@@ -58721,22 +58721,22 @@
|
|
|
58721
58721
|
this._emit('changed', this._getState());
|
|
58722
58722
|
}
|
|
58723
58723
|
|
|
58724
|
-
/**
|
|
58725
|
-
* @internal
|
|
58724
|
+
/**
|
|
58725
|
+
* @internal
|
|
58726
58726
|
*/
|
|
58727
58727
|
_getModules() {
|
|
58728
58728
|
return [ExpressionLanguageModule$1, MarkdownModule, ViewerCommandsModule, RepeatRenderModule];
|
|
58729
58729
|
}
|
|
58730
58730
|
|
|
58731
|
-
/**
|
|
58732
|
-
* @internal
|
|
58731
|
+
/**
|
|
58732
|
+
* @internal
|
|
58733
58733
|
*/
|
|
58734
58734
|
_onEvent(type, priority, handler) {
|
|
58735
58735
|
this.get('eventBus').on(type, priority, handler);
|
|
58736
58736
|
}
|
|
58737
58737
|
|
|
58738
|
-
/**
|
|
58739
|
-
* @internal
|
|
58738
|
+
/**
|
|
58739
|
+
* @internal
|
|
58740
58740
|
*/
|
|
58741
58741
|
_getSubmitData() {
|
|
58742
58742
|
const formFieldRegistry = this.get('formFieldRegistry');
|
|
@@ -58793,16 +58793,16 @@
|
|
|
58793
58793
|
return this._applyConditions(workingSubmitData, formData);
|
|
58794
58794
|
}
|
|
58795
58795
|
|
|
58796
|
-
/**
|
|
58797
|
-
* @internal
|
|
58796
|
+
/**
|
|
58797
|
+
* @internal
|
|
58798
58798
|
*/
|
|
58799
58799
|
_applyConditions(toFilter, data, options = {}) {
|
|
58800
58800
|
const conditionChecker = this.get('conditionChecker');
|
|
58801
58801
|
return conditionChecker.applyConditions(toFilter, data, options);
|
|
58802
58802
|
}
|
|
58803
58803
|
|
|
58804
|
-
/**
|
|
58805
|
-
* @internal
|
|
58804
|
+
/**
|
|
58805
|
+
* @internal
|
|
58806
58806
|
*/
|
|
58807
58807
|
_getInitializedFieldData(data, options = {}) {
|
|
58808
58808
|
const formFieldRegistry = this.get('formFieldRegistry');
|
|
@@ -63938,10 +63938,10 @@
|
|
|
63938
63938
|
return fn.apply(null, args);
|
|
63939
63939
|
}
|
|
63940
63940
|
|
|
63941
|
-
/**
|
|
63942
|
-
* A factory to create a configurable debouncer.
|
|
63943
|
-
*
|
|
63944
|
-
* @param {number|boolean} [config=true]
|
|
63941
|
+
/**
|
|
63942
|
+
* A factory to create a configurable debouncer.
|
|
63943
|
+
*
|
|
63944
|
+
* @param {number|boolean} [config=true]
|
|
63945
63945
|
*/
|
|
63946
63946
|
function DebounceFactory(config = true) {
|
|
63947
63947
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -63953,11 +63953,11 @@
|
|
|
63953
63953
|
}
|
|
63954
63954
|
DebounceFactory.$inject = ['config.debounce'];
|
|
63955
63955
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
63956
|
-
/**
|
|
63957
|
-
* Updates a form fields id.
|
|
63958
|
-
*
|
|
63959
|
-
* @param {Object} formField
|
|
63960
|
-
* @param {string} newId
|
|
63956
|
+
/**
|
|
63957
|
+
* Updates a form fields id.
|
|
63958
|
+
*
|
|
63959
|
+
* @param {Object} formField
|
|
63960
|
+
* @param {string} newId
|
|
63961
63961
|
*/
|
|
63962
63962
|
updateId(formField, newId) {
|
|
63963
63963
|
this._validateId(newId);
|
|
@@ -63978,13 +63978,13 @@
|
|
|
63978
63978
|
}
|
|
63979
63979
|
}
|
|
63980
63980
|
|
|
63981
|
-
/**
|
|
63982
|
-
* Validate the suitability of the given id and signals a problem
|
|
63983
|
-
* with an exception.
|
|
63984
|
-
*
|
|
63985
|
-
* @param {string} id
|
|
63986
|
-
*
|
|
63987
|
-
* @throws {Error} if id is empty or already assigned
|
|
63981
|
+
/**
|
|
63982
|
+
* Validate the suitability of the given id and signals a problem
|
|
63983
|
+
* with an exception.
|
|
63984
|
+
*
|
|
63985
|
+
* @param {string} id
|
|
63986
|
+
*
|
|
63987
|
+
* @throws {Error} if id is empty or already assigned
|
|
63988
63988
|
*/
|
|
63989
63989
|
_validateId(id) {
|
|
63990
63990
|
if (!id) {
|
|
@@ -64000,11 +64000,11 @@
|
|
|
64000
64000
|
const MIN_COLUMNS = 2;
|
|
64001
64001
|
const MAX_FIELDS_PER_ROW = 4;
|
|
64002
64002
|
class FormLayoutValidator {
|
|
64003
|
-
/**
|
|
64004
|
-
* @constructor
|
|
64005
|
-
*
|
|
64006
|
-
* @param { import('./FormLayouter').default } formLayouter
|
|
64007
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
64003
|
+
/**
|
|
64004
|
+
* @constructor
|
|
64005
|
+
*
|
|
64006
|
+
* @param { import('./FormLayouter').default } formLayouter
|
|
64007
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
64008
64008
|
*/
|
|
64009
64009
|
constructor(formLayouter, formFieldRegistry) {
|
|
64010
64010
|
this._formLayouter = formLayouter;
|
|
@@ -64074,21 +64074,21 @@
|
|
|
64074
64074
|
});
|
|
64075
64075
|
}
|
|
64076
64076
|
|
|
64077
|
-
/**
|
|
64078
|
-
* Add a dragger that calls back the passed function with
|
|
64079
|
-
* { event, delta } on drag.
|
|
64080
|
-
*
|
|
64081
|
-
* @example
|
|
64082
|
-
*
|
|
64083
|
-
* function dragMove(event, delta) {
|
|
64084
|
-
* // we are dragging (!!)
|
|
64085
|
-
* }
|
|
64086
|
-
*
|
|
64087
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
64088
|
-
*
|
|
64089
|
-
* @param {Function} fn
|
|
64090
|
-
*
|
|
64091
|
-
* @return {Function} drag start callback function
|
|
64077
|
+
/**
|
|
64078
|
+
* Add a dragger that calls back the passed function with
|
|
64079
|
+
* { event, delta } on drag.
|
|
64080
|
+
*
|
|
64081
|
+
* @example
|
|
64082
|
+
*
|
|
64083
|
+
* function dragMove(event, delta) {
|
|
64084
|
+
* // we are dragging (!!)
|
|
64085
|
+
* }
|
|
64086
|
+
*
|
|
64087
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
64088
|
+
*
|
|
64089
|
+
* @param {Function} fn
|
|
64090
|
+
*
|
|
64091
|
+
* @return {Function} drag start callback function
|
|
64092
64092
|
*/
|
|
64093
64093
|
function createDragger$1(fn) {
|
|
64094
64094
|
let self;
|
|
@@ -64129,12 +64129,12 @@
|
|
|
64129
64129
|
return onDragStart;
|
|
64130
64130
|
}
|
|
64131
64131
|
|
|
64132
|
-
/**
|
|
64133
|
-
* Throttle function call according UI update cycle.
|
|
64134
|
-
*
|
|
64135
|
-
* @param {Function} fn
|
|
64136
|
-
*
|
|
64137
|
-
* @return {Function} throttled fn
|
|
64132
|
+
/**
|
|
64133
|
+
* Throttle function call according UI update cycle.
|
|
64134
|
+
*
|
|
64135
|
+
* @param {Function} fn
|
|
64136
|
+
*
|
|
64137
|
+
* @return {Function} throttled fn
|
|
64138
64138
|
*/
|
|
64139
64139
|
function throttle(fn) {
|
|
64140
64140
|
let active = false;
|
|
@@ -64188,11 +64188,11 @@
|
|
|
64188
64188
|
});
|
|
64189
64189
|
var DragAndDropContext$1 = DragAndDropContext;
|
|
64190
64190
|
|
|
64191
|
-
/**
|
|
64192
|
-
* @param {string} type
|
|
64193
|
-
* @param {boolean} [strict]
|
|
64194
|
-
*
|
|
64195
|
-
* @returns {any}
|
|
64191
|
+
/**
|
|
64192
|
+
* @param {string} type
|
|
64193
|
+
* @param {boolean} [strict]
|
|
64194
|
+
*
|
|
64195
|
+
* @returns {any}
|
|
64196
64196
|
*/
|
|
64197
64197
|
function getService$1(type, strict) {}
|
|
64198
64198
|
const FormEditorContext = D$2({
|
|
@@ -64656,23 +64656,23 @@
|
|
|
64656
64656
|
return fillsAndSeparators;
|
|
64657
64657
|
};
|
|
64658
64658
|
|
|
64659
|
-
/**
|
|
64660
|
-
* Creates a Fragment for a fill.
|
|
64661
|
-
*
|
|
64662
|
-
* @param {Object} fill Fill to be rendered
|
|
64663
|
-
* @returns {Object} Preact Fragment containing fill's children
|
|
64659
|
+
/**
|
|
64660
|
+
* Creates a Fragment for a fill.
|
|
64661
|
+
*
|
|
64662
|
+
* @param {Object} fill Fill to be rendered
|
|
64663
|
+
* @returns {Object} Preact Fragment containing fill's children
|
|
64664
64664
|
*/
|
|
64665
64665
|
const FillFragment = fill => e$1(d$1, {
|
|
64666
64666
|
children: fill.children
|
|
64667
64667
|
}, fill.id);
|
|
64668
64668
|
|
|
64669
|
-
/**
|
|
64670
|
-
* Creates an array of fills, with separators inserted between groups.
|
|
64671
|
-
*
|
|
64672
|
-
* @param {Array} groups Groups of fills
|
|
64673
|
-
* @param {Function} fillRenderer Function to create a fill
|
|
64674
|
-
* @param {Function} separatorRenderer Function to create a separator
|
|
64675
|
-
* @returns {Array} Array of fills and separators
|
|
64669
|
+
/**
|
|
64670
|
+
* Creates an array of fills, with separators inserted between groups.
|
|
64671
|
+
*
|
|
64672
|
+
* @param {Array} groups Groups of fills
|
|
64673
|
+
* @param {Function} fillRenderer Function to create a fill
|
|
64674
|
+
* @param {Function} separatorRenderer Function to create a separator
|
|
64675
|
+
* @returns {Array} Array of fills and separators
|
|
64676
64676
|
*/
|
|
64677
64677
|
const buildFills = (groups, fillRenderer, separatorRenderer) => {
|
|
64678
64678
|
const result = [];
|
|
@@ -64690,8 +64690,8 @@
|
|
|
64690
64690
|
return result;
|
|
64691
64691
|
};
|
|
64692
64692
|
|
|
64693
|
-
/**
|
|
64694
|
-
* Groups fills by group name property.
|
|
64693
|
+
/**
|
|
64694
|
+
* Groups fills by group name property.
|
|
64695
64695
|
*/
|
|
64696
64696
|
const _groupByGroupName = fills => {
|
|
64697
64697
|
const groups = [];
|
|
@@ -64711,8 +64711,8 @@
|
|
|
64711
64711
|
return Object.keys(groupsById).sort().map(id => groupsById[id]);
|
|
64712
64712
|
};
|
|
64713
64713
|
|
|
64714
|
-
/**
|
|
64715
|
-
* Compares fills by priority.
|
|
64714
|
+
/**
|
|
64715
|
+
* Compares fills by priority.
|
|
64716
64716
|
*/
|
|
64717
64717
|
const _comparePriority = (a, b) => {
|
|
64718
64718
|
return (b.priority || 0) - (a.priority || 0);
|
|
@@ -64927,11 +64927,11 @@
|
|
|
64927
64927
|
return groups.filter(g => g.entries.length);
|
|
64928
64928
|
}
|
|
64929
64929
|
|
|
64930
|
-
/**
|
|
64931
|
-
* Returns a list of palette entries.
|
|
64932
|
-
*
|
|
64933
|
-
* @param {FormFields} formFields
|
|
64934
|
-
* @returns {Array<PaletteEntry>}
|
|
64930
|
+
/**
|
|
64931
|
+
* Returns a list of palette entries.
|
|
64932
|
+
*
|
|
64933
|
+
* @param {FormFields} formFields
|
|
64934
|
+
* @returns {Array<PaletteEntry>}
|
|
64935
64935
|
*/
|
|
64936
64936
|
function collectPaletteEntries(formFields) {
|
|
64937
64937
|
return Object.entries(formFields._formFields).map(([type, formField]) => {
|
|
@@ -64950,12 +64950,12 @@
|
|
|
64950
64950
|
}) => type !== 'default');
|
|
64951
64951
|
}
|
|
64952
64952
|
|
|
64953
|
-
/**
|
|
64954
|
-
* There are various options to specify an icon for a palette entry.
|
|
64955
|
-
*
|
|
64956
|
-
* a) via `iconUrl` property in a form field config
|
|
64957
|
-
* b) via `icon` property in a form field config
|
|
64958
|
-
* c) via statically defined iconsByType (fallback)
|
|
64953
|
+
/**
|
|
64954
|
+
* There are various options to specify an icon for a palette entry.
|
|
64955
|
+
*
|
|
64956
|
+
* a) via `iconUrl` property in a form field config
|
|
64957
|
+
* b) via `icon` property in a form field config
|
|
64958
|
+
* c) via statically defined iconsByType (fallback)
|
|
64959
64959
|
*/
|
|
64960
64960
|
function getPaletteIcon(entry) {
|
|
64961
64961
|
const {
|
|
@@ -65019,20 +65019,20 @@
|
|
|
65019
65019
|
const DRAG_NO_MOVE_CLS = 'fjs-no-move';
|
|
65020
65020
|
const ERROR_DROP_CLS = 'fjs-error-drop';
|
|
65021
65021
|
|
|
65022
|
-
/**
|
|
65023
|
-
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
65022
|
+
/**
|
|
65023
|
+
* @typedef { { id: String, components: Array<any> } } FormRow
|
|
65024
65024
|
*/
|
|
65025
65025
|
|
|
65026
65026
|
class Dragging {
|
|
65027
|
-
/**
|
|
65028
|
-
* @constructor
|
|
65029
|
-
*
|
|
65030
|
-
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
65031
|
-
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
65032
|
-
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
65033
|
-
* @param { import('../../core/EventBus').default } eventBus
|
|
65034
|
-
* @param { import('../modeling/Modeling').default } modeling
|
|
65035
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
65027
|
+
/**
|
|
65028
|
+
* @constructor
|
|
65029
|
+
*
|
|
65030
|
+
* @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
|
|
65031
|
+
* @param { import('../../core/FormLayouter').default } formLayouter
|
|
65032
|
+
* @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
|
|
65033
|
+
* @param { import('../../core/EventBus').default } eventBus
|
|
65034
|
+
* @param { import('../modeling/Modeling').default } modeling
|
|
65035
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
65036
65036
|
*/
|
|
65037
65037
|
constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling, pathRegistry) {
|
|
65038
65038
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -65043,13 +65043,13 @@
|
|
|
65043
65043
|
this._pathRegistry = pathRegistry;
|
|
65044
65044
|
}
|
|
65045
65045
|
|
|
65046
|
-
/**
|
|
65047
|
-
* Calculates position in form schema given the dropped place.
|
|
65048
|
-
*
|
|
65049
|
-
* @param { FormRow } targetRow
|
|
65050
|
-
* @param { any } targetFormField
|
|
65051
|
-
* @param { HTMLElement } sibling
|
|
65052
|
-
* @returns { number }
|
|
65046
|
+
/**
|
|
65047
|
+
* Calculates position in form schema given the dropped place.
|
|
65048
|
+
*
|
|
65049
|
+
* @param { FormRow } targetRow
|
|
65050
|
+
* @param { any } targetFormField
|
|
65051
|
+
* @param { HTMLElement } sibling
|
|
65052
|
+
* @returns { number }
|
|
65053
65053
|
*/
|
|
65054
65054
|
getTargetIndex(targetRow, targetFormField, sibling) {
|
|
65055
65055
|
/** @type HTMLElement */
|
|
@@ -65195,8 +65195,8 @@
|
|
|
65195
65195
|
}
|
|
65196
65196
|
}
|
|
65197
65197
|
|
|
65198
|
-
/**
|
|
65199
|
-
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
65198
|
+
/**
|
|
65199
|
+
* @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
|
|
65200
65200
|
*/
|
|
65201
65201
|
createDragulaInstance(options) {
|
|
65202
65202
|
const {
|
|
@@ -65632,7 +65632,7 @@
|
|
|
65632
65632
|
return null;
|
|
65633
65633
|
}
|
|
65634
65634
|
return e$1("div", {
|
|
65635
|
-
style: "width: fit-content
|
|
65635
|
+
style: "width: fit-content;\r padding: 2px 6px;\r height: 16px;\r background: var(--color-blue-205-100-95);\r display: flex;\r justify-content: center;\r align-items: center;\r position: absolute;\r bottom: -2px;\r z-index: 2;\r font-size: 10px;\r right: 3px;",
|
|
65636
65636
|
class: "fjs-debug-columns",
|
|
65637
65637
|
children: (field.layout || {}).columns || 'auto'
|
|
65638
65638
|
});
|
|
@@ -66747,10 +66747,10 @@
|
|
|
66747
66747
|
return formField;
|
|
66748
66748
|
}
|
|
66749
66749
|
class AddFormFieldHandler {
|
|
66750
|
-
/**
|
|
66751
|
-
* @constructor
|
|
66752
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
66753
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66750
|
+
/**
|
|
66751
|
+
* @constructor
|
|
66752
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
66753
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66754
66754
|
*/
|
|
66755
66755
|
constructor(formEditor, formFieldRegistry) {
|
|
66756
66756
|
this._formEditor = formEditor;
|
|
@@ -66810,10 +66810,10 @@
|
|
|
66810
66810
|
}
|
|
66811
66811
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
66812
66812
|
class EditFormFieldHandler {
|
|
66813
|
-
/**
|
|
66814
|
-
* @constructor
|
|
66815
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
66816
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66813
|
+
/**
|
|
66814
|
+
* @constructor
|
|
66815
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
66816
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66817
66817
|
*/
|
|
66818
66818
|
constructor(formEditor, formFieldRegistry) {
|
|
66819
66819
|
this._formEditor = formEditor;
|
|
@@ -66875,12 +66875,12 @@
|
|
|
66875
66875
|
}
|
|
66876
66876
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
66877
66877
|
class MoveFormFieldHandler {
|
|
66878
|
-
/**
|
|
66879
|
-
* @constructor
|
|
66880
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
66881
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66882
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
66883
|
-
* @param { import('@bpmn-io/form-js-viewer').FormLayouter } formLayouter
|
|
66878
|
+
/**
|
|
66879
|
+
* @constructor
|
|
66880
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
66881
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66882
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
66883
|
+
* @param { import('@bpmn-io/form-js-viewer').FormLayouter } formLayouter
|
|
66884
66884
|
*/
|
|
66885
66885
|
constructor(formEditor, formFieldRegistry, pathRegistry, formLayouter) {
|
|
66886
66886
|
this._formEditor = formEditor;
|
|
@@ -66990,10 +66990,10 @@
|
|
|
66990
66990
|
}
|
|
66991
66991
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry', 'pathRegistry', 'formLayouter'];
|
|
66992
66992
|
class RemoveFormFieldHandler {
|
|
66993
|
-
/**
|
|
66994
|
-
* @constructor
|
|
66995
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
66996
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66993
|
+
/**
|
|
66994
|
+
* @constructor
|
|
66995
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
66996
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
66997
66997
|
*/
|
|
66998
66998
|
constructor(formEditor, formFieldRegistry) {
|
|
66999
66999
|
this._formEditor = formEditor;
|
|
@@ -67052,9 +67052,9 @@
|
|
|
67052
67052
|
}
|
|
67053
67053
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
67054
67054
|
class UpdateIdClaimHandler {
|
|
67055
|
-
/**
|
|
67056
|
-
* @constructor
|
|
67057
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
67055
|
+
/**
|
|
67056
|
+
* @constructor
|
|
67057
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
67058
67058
|
*/
|
|
67059
67059
|
constructor(formFieldRegistry) {
|
|
67060
67060
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -67086,9 +67086,9 @@
|
|
|
67086
67086
|
}
|
|
67087
67087
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
67088
67088
|
class UpdateKeyClaimHandler {
|
|
67089
|
-
/**
|
|
67090
|
-
* @constructor
|
|
67091
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
67089
|
+
/**
|
|
67090
|
+
* @constructor
|
|
67091
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
67092
67092
|
*/
|
|
67093
67093
|
constructor(pathRegistry) {
|
|
67094
67094
|
this._pathRegistry = pathRegistry;
|
|
@@ -67135,9 +67135,9 @@
|
|
|
67135
67135
|
}
|
|
67136
67136
|
UpdateKeyClaimHandler.$inject = ['pathRegistry'];
|
|
67137
67137
|
class UpdatePathClaimHandler {
|
|
67138
|
-
/**
|
|
67139
|
-
* @constructor
|
|
67140
|
-
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
67138
|
+
/**
|
|
67139
|
+
* @constructor
|
|
67140
|
+
* @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
|
|
67141
67141
|
*/
|
|
67142
67142
|
constructor(pathRegistry) {
|
|
67143
67143
|
this._pathRegistry = pathRegistry;
|
|
@@ -67718,8 +67718,8 @@
|
|
|
67718
67718
|
constructor(eventBus) {
|
|
67719
67719
|
super(eventBus);
|
|
67720
67720
|
|
|
67721
|
-
/**
|
|
67722
|
-
* Remove custom validation if <validationType> is about to be added.
|
|
67721
|
+
/**
|
|
67722
|
+
* Remove custom validation if <validationType> is about to be added.
|
|
67723
67723
|
*/
|
|
67724
67724
|
this.preExecute('formField.edit', function (context) {
|
|
67725
67725
|
const {
|
|
@@ -67745,11 +67745,11 @@
|
|
|
67745
67745
|
constructor(eventBus) {
|
|
67746
67746
|
super(eventBus);
|
|
67747
67747
|
|
|
67748
|
-
/**
|
|
67749
|
-
* Cleanup properties on changing the values source.
|
|
67750
|
-
*
|
|
67751
|
-
* 1) Remove other sources, e.g. set `values` => remove `valuesKey` and `valuesExpression`
|
|
67752
|
-
* 2) Remove default values for all other values sources
|
|
67748
|
+
/**
|
|
67749
|
+
* Cleanup properties on changing the values source.
|
|
67750
|
+
*
|
|
67751
|
+
* 1) Remove other sources, e.g. set `values` => remove `valuesKey` and `valuesExpression`
|
|
67752
|
+
* 2) Remove default values for all other values sources
|
|
67753
67753
|
*/
|
|
67754
67754
|
this.preExecute('formField.edit', function (context) {
|
|
67755
67755
|
const {
|
|
@@ -68402,22 +68402,22 @@
|
|
|
68402
68402
|
selectionBehavior: ['type', SelectionBehavior]
|
|
68403
68403
|
};
|
|
68404
68404
|
|
|
68405
|
-
/**
|
|
68406
|
-
* Base class for sectionable UI modules.
|
|
68407
|
-
*
|
|
68408
|
-
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
68409
|
-
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
68410
|
-
*
|
|
68411
|
-
* @class SectionModuleBase
|
|
68405
|
+
/**
|
|
68406
|
+
* Base class for sectionable UI modules.
|
|
68407
|
+
*
|
|
68408
|
+
* @property {EventBus} _eventBus - EventBus instance used for event handling.
|
|
68409
|
+
* @property {string} managerType - Type of the render manager. Used to form event names.
|
|
68410
|
+
*
|
|
68411
|
+
* @class SectionModuleBase
|
|
68412
68412
|
*/
|
|
68413
68413
|
class SectionModuleBase {
|
|
68414
|
-
/**
|
|
68415
|
-
* Create a SectionModuleBase instance.
|
|
68416
|
-
*
|
|
68417
|
-
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
68418
|
-
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
68419
|
-
*
|
|
68420
|
-
* @constructor
|
|
68414
|
+
/**
|
|
68415
|
+
* Create a SectionModuleBase instance.
|
|
68416
|
+
*
|
|
68417
|
+
* @param {any} eventBus - The EventBus instance used for event handling.
|
|
68418
|
+
* @param {string} sectionKey - The type of render manager. Used to form event names.
|
|
68419
|
+
*
|
|
68420
|
+
* @constructor
|
|
68421
68421
|
*/
|
|
68422
68422
|
constructor(eventBus, sectionKey) {
|
|
68423
68423
|
this._eventBus = eventBus;
|
|
@@ -68430,10 +68430,10 @@
|
|
|
68430
68430
|
});
|
|
68431
68431
|
}
|
|
68432
68432
|
|
|
68433
|
-
/**
|
|
68434
|
-
* Attach the managed section to a parent node.
|
|
68435
|
-
*
|
|
68436
|
-
* @param {HTMLElement} container - The parent node to attach to.
|
|
68433
|
+
/**
|
|
68434
|
+
* Attach the managed section to a parent node.
|
|
68435
|
+
*
|
|
68436
|
+
* @param {HTMLElement} container - The parent node to attach to.
|
|
68437
68437
|
*/
|
|
68438
68438
|
attachTo(container) {
|
|
68439
68439
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
|
|
@@ -68441,22 +68441,22 @@
|
|
|
68441
68441
|
}));
|
|
68442
68442
|
}
|
|
68443
68443
|
|
|
68444
|
-
/**
|
|
68445
|
-
* Detach the managed section from its parent node.
|
|
68444
|
+
/**
|
|
68445
|
+
* Detach the managed section from its parent node.
|
|
68446
68446
|
*/
|
|
68447
68447
|
detach() {
|
|
68448
68448
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
|
|
68449
68449
|
}
|
|
68450
68450
|
|
|
68451
|
-
/**
|
|
68452
|
-
* Reset the managed section to its initial state.
|
|
68451
|
+
/**
|
|
68452
|
+
* Reset the managed section to its initial state.
|
|
68453
68453
|
*/
|
|
68454
68454
|
reset() {
|
|
68455
68455
|
this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
|
|
68456
68456
|
}
|
|
68457
68457
|
|
|
68458
|
-
/**
|
|
68459
|
-
* Circumvents timing issues.
|
|
68458
|
+
/**
|
|
68459
|
+
* Circumvents timing issues.
|
|
68460
68460
|
*/
|
|
68461
68461
|
_onceSectionRendered(callback) {
|
|
68462
68462
|
if (this.isSectionRendered) {
|
|
@@ -72131,11 +72131,11 @@
|
|
|
72131
72131
|
feelPopup: ['type', FeelPopupModule]
|
|
72132
72132
|
};
|
|
72133
72133
|
|
|
72134
|
-
/**
|
|
72135
|
-
* @param {string} type
|
|
72136
|
-
* @param {boolean} [strict]
|
|
72137
|
-
*
|
|
72138
|
-
* @returns {any}
|
|
72134
|
+
/**
|
|
72135
|
+
* @param {string} type
|
|
72136
|
+
* @param {boolean} [strict]
|
|
72137
|
+
*
|
|
72138
|
+
* @returns {any}
|
|
72139
72139
|
*/
|
|
72140
72140
|
function getService(type, strict) {}
|
|
72141
72141
|
const PropertiesPanelContext = D$2({
|
|
@@ -72168,8 +72168,8 @@
|
|
|
72168
72168
|
return null;
|
|
72169
72169
|
}
|
|
72170
72170
|
|
|
72171
|
-
/**
|
|
72172
|
-
* @param {string} path
|
|
72171
|
+
/**
|
|
72172
|
+
* @param {string} path
|
|
72173
72173
|
*/
|
|
72174
72174
|
function isValidDotPath(path) {
|
|
72175
72175
|
return /^\w+(\.\w+)*$/.test(path);
|
|
@@ -72195,8 +72195,8 @@
|
|
|
72195
72195
|
return propertiesPanelEntries.some(id => id === 'values');
|
|
72196
72196
|
}
|
|
72197
72197
|
|
|
72198
|
-
/**
|
|
72199
|
-
* @param {string} path
|
|
72198
|
+
/**
|
|
72199
|
+
* @param {string} path
|
|
72200
72200
|
*/
|
|
72201
72201
|
function hasIntegerPathSegment(path) {
|
|
72202
72202
|
return path.split('.').some(segment => /^\d+$/.test(segment));
|
|
@@ -72208,10 +72208,10 @@
|
|
|
72208
72208
|
return getService(type, strict);
|
|
72209
72209
|
}
|
|
72210
72210
|
|
|
72211
|
-
/**
|
|
72212
|
-
* Retrieve list of variables from the form schema.
|
|
72213
|
-
*
|
|
72214
|
-
* @returns { string[] } list of variables used in form schema
|
|
72211
|
+
/**
|
|
72212
|
+
* Retrieve list of variables from the form schema.
|
|
72213
|
+
*
|
|
72214
|
+
* @returns { string[] } list of variables used in form schema
|
|
72215
72215
|
*/
|
|
72216
72216
|
function useVariables() {
|
|
72217
72217
|
const form = useService('formEditor');
|
|
@@ -72276,8 +72276,8 @@
|
|
|
72276
72276
|
}
|
|
72277
72277
|
};
|
|
72278
72278
|
|
|
72279
|
-
/**
|
|
72280
|
-
* Provide placeholders for empty and multiple state.
|
|
72279
|
+
/**
|
|
72280
|
+
* Provide placeholders for empty and multiple state.
|
|
72281
72281
|
*/
|
|
72282
72282
|
const PropertiesPanelPlaceholderProvider = {
|
|
72283
72283
|
getEmpty: () => {
|
|
@@ -72321,9 +72321,9 @@
|
|
|
72321
72321
|
});
|
|
72322
72322
|
}, [eventBus, formEditor, selectionModule]);
|
|
72323
72323
|
h$1(() => {
|
|
72324
|
-
/**
|
|
72325
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
72326
|
-
* once we have a proper updater/change support
|
|
72324
|
+
/**
|
|
72325
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
72326
|
+
* once we have a proper updater/change support
|
|
72327
72327
|
*/
|
|
72328
72328
|
eventBus.on('changed', refresh);
|
|
72329
72329
|
eventBus.on('import.done', refresh);
|
|
@@ -72374,17 +72374,17 @@
|
|
|
72374
72374
|
}
|
|
72375
72375
|
const DEFAULT_PRIORITY = 1000;
|
|
72376
72376
|
|
|
72377
|
-
/**
|
|
72378
|
-
* @typedef { { parent: Element } } PropertiesPanelConfig
|
|
72379
|
-
* @typedef { import('../../core/EventBus').default } EventBus
|
|
72380
|
-
* @typedef { import('../../types').Injector } Injector
|
|
72381
|
-
* @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
|
|
72377
|
+
/**
|
|
72378
|
+
* @typedef { { parent: Element } } PropertiesPanelConfig
|
|
72379
|
+
* @typedef { import('../../core/EventBus').default } EventBus
|
|
72380
|
+
* @typedef { import('../../types').Injector } Injector
|
|
72381
|
+
* @typedef { { getGroups: ({ formField, editFormField }) => ({ groups}) => Array } } PropertiesProvider
|
|
72382
72382
|
*/
|
|
72383
72383
|
|
|
72384
|
-
/**
|
|
72385
|
-
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
72386
|
-
* @param {Injector} injector
|
|
72387
|
-
* @param {EventBus} eventBus
|
|
72384
|
+
/**
|
|
72385
|
+
* @param {PropertiesPanelConfig} propertiesPanelConfig
|
|
72386
|
+
* @param {Injector} injector
|
|
72387
|
+
* @param {EventBus} eventBus
|
|
72388
72388
|
*/
|
|
72389
72389
|
class PropertiesPanelRenderer {
|
|
72390
72390
|
constructor(propertiesPanelConfig, injector, eventBus) {
|
|
@@ -72402,10 +72402,10 @@
|
|
|
72402
72402
|
});
|
|
72403
72403
|
}
|
|
72404
72404
|
|
|
72405
|
-
/**
|
|
72406
|
-
* Attach the properties panel to a parent node.
|
|
72407
|
-
*
|
|
72408
|
-
* @param {HTMLElement} container
|
|
72405
|
+
/**
|
|
72406
|
+
* Attach the properties panel to a parent node.
|
|
72407
|
+
*
|
|
72408
|
+
* @param {HTMLElement} container
|
|
72409
72409
|
*/
|
|
72410
72410
|
attachTo(container) {
|
|
72411
72411
|
if (!container) {
|
|
@@ -72425,8 +72425,8 @@
|
|
|
72425
72425
|
this._eventBus.fire('propertiesPanel.attach');
|
|
72426
72426
|
}
|
|
72427
72427
|
|
|
72428
|
-
/**
|
|
72429
|
-
* Detach the properties panel from its parent node.
|
|
72428
|
+
/**
|
|
72429
|
+
* Detach the properties panel from its parent node.
|
|
72430
72430
|
*/
|
|
72431
72431
|
detach() {
|
|
72432
72432
|
const parentNode = this._container.parentNode;
|
|
@@ -72450,11 +72450,11 @@
|
|
|
72450
72450
|
}
|
|
72451
72451
|
}
|
|
72452
72452
|
|
|
72453
|
-
/**
|
|
72454
|
-
* Register a new properties provider to the properties panel.
|
|
72455
|
-
*
|
|
72456
|
-
* @param {PropertiesProvider} provider
|
|
72457
|
-
* @param {Number} [priority]
|
|
72453
|
+
/**
|
|
72454
|
+
* Register a new properties provider to the properties panel.
|
|
72455
|
+
*
|
|
72456
|
+
* @param {PropertiesProvider} provider
|
|
72457
|
+
* @param {Number} [priority]
|
|
72458
72458
|
*/
|
|
72459
72459
|
registerProvider(provider, priority) {
|
|
72460
72460
|
if (!priority) {
|
|
@@ -73520,9 +73520,9 @@
|
|
|
73520
73520
|
|
|
73521
73521
|
// helpers //////////
|
|
73522
73522
|
|
|
73523
|
-
/**
|
|
73524
|
-
* @param {string} type
|
|
73525
|
-
* @returns {string}
|
|
73523
|
+
/**
|
|
73524
|
+
* @param {string} type
|
|
73525
|
+
* @returns {string}
|
|
73526
73526
|
*/
|
|
73527
73527
|
function getLabelText(type) {
|
|
73528
73528
|
switch (type) {
|
|
@@ -74323,14 +74323,14 @@
|
|
|
74323
74323
|
|
|
74324
74324
|
// helpers //////////
|
|
74325
74325
|
|
|
74326
|
-
/**
|
|
74327
|
-
* Returns copy of object with updated value.
|
|
74328
|
-
*
|
|
74329
|
-
* @param {Object} properties
|
|
74330
|
-
* @param {string} key
|
|
74331
|
-
* @param {string} value
|
|
74332
|
-
*
|
|
74333
|
-
* @returns {Object}
|
|
74326
|
+
/**
|
|
74327
|
+
* Returns copy of object with updated value.
|
|
74328
|
+
*
|
|
74329
|
+
* @param {Object} properties
|
|
74330
|
+
* @param {string} key
|
|
74331
|
+
* @param {string} value
|
|
74332
|
+
*
|
|
74333
|
+
* @returns {Object}
|
|
74334
74334
|
*/
|
|
74335
74335
|
function updateValue(properties, key, value) {
|
|
74336
74336
|
return {
|
|
@@ -74339,14 +74339,14 @@
|
|
|
74339
74339
|
};
|
|
74340
74340
|
}
|
|
74341
74341
|
|
|
74342
|
-
/**
|
|
74343
|
-
* Returns copy of object with updated key.
|
|
74344
|
-
*
|
|
74345
|
-
* @param {Object} properties
|
|
74346
|
-
* @param {string} oldKey
|
|
74347
|
-
* @param {string} newKey
|
|
74348
|
-
*
|
|
74349
|
-
* @returns {Object}
|
|
74342
|
+
/**
|
|
74343
|
+
* Returns copy of object with updated key.
|
|
74344
|
+
*
|
|
74345
|
+
* @param {Object} properties
|
|
74346
|
+
* @param {string} oldKey
|
|
74347
|
+
* @param {string} newKey
|
|
74348
|
+
*
|
|
74349
|
+
* @returns {Object}
|
|
74350
74350
|
*/
|
|
74351
74351
|
function updateKey(properties, oldKey, newKey) {
|
|
74352
74352
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -74903,9 +74903,9 @@
|
|
|
74903
74903
|
editField(field, path, value);
|
|
74904
74904
|
};
|
|
74905
74905
|
|
|
74906
|
-
/**
|
|
74907
|
-
* @param {string|void} value
|
|
74908
|
-
* @returns {string|null}
|
|
74906
|
+
/**
|
|
74907
|
+
* @param {string|void} value
|
|
74908
|
+
* @returns {string|null}
|
|
74909
74909
|
*/
|
|
74910
74910
|
const validate = value => {
|
|
74911
74911
|
if (!isString(value) || value.length === 0) {
|
|
@@ -74965,8 +74965,8 @@
|
|
|
74965
74965
|
return isNumber(get(field, path));
|
|
74966
74966
|
};
|
|
74967
74967
|
|
|
74968
|
-
/**
|
|
74969
|
-
* @param {boolean} value
|
|
74968
|
+
/**
|
|
74969
|
+
* @param {boolean} value
|
|
74970
74970
|
*/
|
|
74971
74971
|
const setValue = value => {
|
|
74972
74972
|
value ? editField(field, path, defaultRowCount) : editField(field, path, undefined);
|
|
@@ -75006,10 +75006,10 @@
|
|
|
75006
75006
|
const debounce = useService('debounce');
|
|
75007
75007
|
const getValue = () => get(field, path$2);
|
|
75008
75008
|
|
|
75009
|
-
/**
|
|
75010
|
-
* @param {number|void} value
|
|
75011
|
-
* @param {string|null} error
|
|
75012
|
-
* @returns {void}
|
|
75009
|
+
/**
|
|
75010
|
+
* @param {number|void} value
|
|
75011
|
+
* @param {string|null} error
|
|
75012
|
+
* @returns {void}
|
|
75013
75013
|
*/
|
|
75014
75014
|
const setValue = (value, error) => {
|
|
75015
75015
|
if (error) {
|
|
@@ -75018,9 +75018,9 @@
|
|
|
75018
75018
|
editField(field, path$2, value);
|
|
75019
75019
|
};
|
|
75020
75020
|
|
|
75021
|
-
/**
|
|
75022
|
-
* @param {string|void} value
|
|
75023
|
-
* @returns {string|null}
|
|
75021
|
+
/**
|
|
75022
|
+
* @param {string|void} value
|
|
75023
|
+
* @returns {string|null}
|
|
75024
75024
|
*/
|
|
75025
75025
|
const validate = value => {
|
|
75026
75026
|
if (isNil(value)) {
|
|
@@ -75081,8 +75081,8 @@
|
|
|
75081
75081
|
id
|
|
75082
75082
|
} = props;
|
|
75083
75083
|
|
|
75084
|
-
/**
|
|
75085
|
-
* @returns {string|void}
|
|
75084
|
+
/**
|
|
75085
|
+
* @returns {string|void}
|
|
75086
75086
|
*/
|
|
75087
75087
|
const getValue = () => {
|
|
75088
75088
|
const columns = get(field, COLUMNS_PATH);
|
|
@@ -75095,8 +75095,8 @@
|
|
|
75095
75095
|
}
|
|
75096
75096
|
};
|
|
75097
75097
|
|
|
75098
|
-
/**
|
|
75099
|
-
* @param {string|void} value
|
|
75098
|
+
/**
|
|
75099
|
+
* @param {string|void} value
|
|
75100
75100
|
*/
|
|
75101
75101
|
const setValue = value => {
|
|
75102
75102
|
switch (value) {
|
|
@@ -75173,10 +75173,10 @@
|
|
|
75173
75173
|
return get(field, PATH);
|
|
75174
75174
|
};
|
|
75175
75175
|
|
|
75176
|
-
/**
|
|
75177
|
-
* @param {string|void} value
|
|
75178
|
-
* @param {string|void} error
|
|
75179
|
-
* @returns {void}
|
|
75176
|
+
/**
|
|
75177
|
+
* @param {string|void} value
|
|
75178
|
+
* @param {string|void} error
|
|
75179
|
+
* @returns {void}
|
|
75180
75180
|
*/
|
|
75181
75181
|
const setValue = (value, error) => {
|
|
75182
75182
|
if (error) {
|
|
@@ -75185,9 +75185,9 @@
|
|
|
75185
75185
|
editField(field, PATH, value);
|
|
75186
75186
|
};
|
|
75187
75187
|
|
|
75188
|
-
/**
|
|
75189
|
-
* @param {string|void} value
|
|
75190
|
-
* @returns {string|null}
|
|
75188
|
+
/**
|
|
75189
|
+
* @param {string|void} value
|
|
75190
|
+
* @returns {string|null}
|
|
75191
75191
|
*/
|
|
75192
75192
|
const validate = value => {
|
|
75193
75193
|
if (!isString(value) || value.length === 0 || value === '=') {
|
|
@@ -75257,10 +75257,10 @@
|
|
|
75257
75257
|
} = props;
|
|
75258
75258
|
const debounce = useService('debounce');
|
|
75259
75259
|
|
|
75260
|
-
/**
|
|
75261
|
-
* @param {string|void} value
|
|
75262
|
-
* @param {string|void} error
|
|
75263
|
-
* @returns {void}
|
|
75260
|
+
/**
|
|
75261
|
+
* @param {string|void} value
|
|
75262
|
+
* @param {string|void} error
|
|
75263
|
+
* @returns {void}
|
|
75264
75264
|
*/
|
|
75265
75265
|
const setValue = (value, error) => {
|
|
75266
75266
|
if (error) {
|
|
@@ -75290,10 +75290,10 @@
|
|
|
75290
75290
|
} = props;
|
|
75291
75291
|
const debounce = useService('debounce');
|
|
75292
75292
|
|
|
75293
|
-
/**
|
|
75294
|
-
* @param {string|void} value
|
|
75295
|
-
* @param {string|void} error
|
|
75296
|
-
* @returns {void}
|
|
75293
|
+
/**
|
|
75294
|
+
* @param {string|void} value
|
|
75295
|
+
* @param {string|void} error
|
|
75296
|
+
* @returns {void}
|
|
75297
75297
|
*/
|
|
75298
75298
|
const setValue = (value, error) => {
|
|
75299
75299
|
if (error) {
|
|
@@ -75318,9 +75318,9 @@
|
|
|
75318
75318
|
|
|
75319
75319
|
// helpers //////////////////////
|
|
75320
75320
|
|
|
75321
|
-
/**
|
|
75322
|
-
* @param {string|void} value
|
|
75323
|
-
* @returns {string|null}
|
|
75321
|
+
/**
|
|
75322
|
+
* @param {string|void} value
|
|
75323
|
+
* @returns {string|null}
|
|
75324
75324
|
*/
|
|
75325
75325
|
function validate(value) {
|
|
75326
75326
|
if (!isString(value) || value.length === 0) {
|
|
@@ -75742,8 +75742,8 @@
|
|
|
75742
75742
|
};
|
|
75743
75743
|
const id = 'valuesSource';
|
|
75744
75744
|
|
|
75745
|
-
/**
|
|
75746
|
-
* @type {Array<Group|ListGroup>}
|
|
75745
|
+
/**
|
|
75746
|
+
* @type {Array<Group|ListGroup>}
|
|
75747
75747
|
*/
|
|
75748
75748
|
const groups = [{
|
|
75749
75749
|
id,
|
|
@@ -75863,13 +75863,13 @@
|
|
|
75863
75863
|
|
|
75864
75864
|
// helpers //////////
|
|
75865
75865
|
|
|
75866
|
-
/**
|
|
75867
|
-
* Returns copy of object without key.
|
|
75868
|
-
*
|
|
75869
|
-
* @param {Object} properties
|
|
75870
|
-
* @param {string} oldKey
|
|
75871
|
-
*
|
|
75872
|
-
* @returns {Object}
|
|
75866
|
+
/**
|
|
75867
|
+
* Returns copy of object without key.
|
|
75868
|
+
*
|
|
75869
|
+
* @param {Object} properties
|
|
75870
|
+
* @param {string} oldKey
|
|
75871
|
+
*
|
|
75872
|
+
* @returns {Object}
|
|
75873
75873
|
*/
|
|
75874
75874
|
function removeKey(properties, oldKey) {
|
|
75875
75875
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -75950,8 +75950,8 @@
|
|
|
75950
75950
|
}
|
|
75951
75951
|
const areStaticColumnsEnabled = isArray(get(field, ['columns']));
|
|
75952
75952
|
|
|
75953
|
-
/**
|
|
75954
|
-
* @type {Array<Group>}
|
|
75953
|
+
/**
|
|
75954
|
+
* @type {Array<Group>}
|
|
75955
75955
|
*/
|
|
75956
75956
|
const groups = [{
|
|
75957
75957
|
id: `${fieldId}-columnsSource`,
|
|
@@ -76041,10 +76041,10 @@
|
|
|
76041
76041
|
propertiesProvider: ['type', PropertiesProvider]
|
|
76042
76042
|
};
|
|
76043
76043
|
|
|
76044
|
-
/**
|
|
76045
|
-
* Manages the rendering of visual plugins.
|
|
76046
|
-
* @constructor
|
|
76047
|
-
* @param {Object} eventBus - Event bus for the application.
|
|
76044
|
+
/**
|
|
76045
|
+
* Manages the rendering of visual plugins.
|
|
76046
|
+
* @constructor
|
|
76047
|
+
* @param {Object} eventBus - Event bus for the application.
|
|
76048
76048
|
*/
|
|
76049
76049
|
class RenderInjector extends SectionModuleBase {
|
|
76050
76050
|
constructor(eventBus) {
|
|
@@ -76053,10 +76053,10 @@
|
|
|
76053
76053
|
this.registeredRenderers = [];
|
|
76054
76054
|
}
|
|
76055
76055
|
|
|
76056
|
-
/**
|
|
76057
|
-
* Inject a new renderer into the injector.
|
|
76058
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
76059
|
-
* @param {Function} Renderer - The renderer function.
|
|
76056
|
+
/**
|
|
76057
|
+
* Inject a new renderer into the injector.
|
|
76058
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
76059
|
+
* @param {Function} Renderer - The renderer function.
|
|
76060
76060
|
*/
|
|
76061
76061
|
attachRenderer(identifier, Renderer) {
|
|
76062
76062
|
this.registeredRenderers = [...this.registeredRenderers, {
|
|
@@ -76065,17 +76065,17 @@
|
|
|
76065
76065
|
}];
|
|
76066
76066
|
}
|
|
76067
76067
|
|
|
76068
|
-
/**
|
|
76069
|
-
* Detach a renderer from the by key injector.
|
|
76070
|
-
* @param {string} identifier - Identifier for the renderer.
|
|
76068
|
+
/**
|
|
76069
|
+
* Detach a renderer from the by key injector.
|
|
76070
|
+
* @param {string} identifier - Identifier for the renderer.
|
|
76071
76071
|
*/
|
|
76072
76072
|
detachRenderer(identifier) {
|
|
76073
76073
|
this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
|
|
76074
76074
|
}
|
|
76075
76075
|
|
|
76076
|
-
/**
|
|
76077
|
-
* Returns the registered renderers.
|
|
76078
|
-
* @returns {Array} Array of registered renderers.
|
|
76076
|
+
/**
|
|
76077
|
+
* Returns the registered renderers.
|
|
76078
|
+
* @returns {Array} Array of registered renderers.
|
|
76079
76079
|
*/
|
|
76080
76080
|
fetchRenderers() {
|
|
76081
76081
|
return this.registeredRenderers;
|
|
@@ -76120,11 +76120,11 @@
|
|
|
76120
76120
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
76121
76121
|
}
|
|
76122
76122
|
|
|
76123
|
-
/**
|
|
76124
|
-
* Checks whether a field should be repeatable.
|
|
76125
|
-
*
|
|
76126
|
-
* @param {string} id - The id of the field to check
|
|
76127
|
-
* @returns {boolean} - True if repeatable, false otherwise
|
|
76123
|
+
/**
|
|
76124
|
+
* Checks whether a field should be repeatable.
|
|
76125
|
+
*
|
|
76126
|
+
* @param {string} id - The id of the field to check
|
|
76127
|
+
* @returns {boolean} - True if repeatable, false otherwise
|
|
76128
76128
|
*/
|
|
76129
76129
|
isFieldRepeating(id) {
|
|
76130
76130
|
if (!id) {
|
|
@@ -76167,48 +76167,48 @@
|
|
|
76167
76167
|
};
|
|
76168
76168
|
const ids = new Ids([32, 36, 1]);
|
|
76169
76169
|
|
|
76170
|
-
/**
|
|
76171
|
-
* @typedef { import('./types').Injector } Injector
|
|
76172
|
-
* @typedef { import('./types').Module } Module
|
|
76173
|
-
* @typedef { import('./types').Schema } Schema
|
|
76174
|
-
*
|
|
76175
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
76176
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
76177
|
-
*
|
|
76178
|
-
* @typedef { {
|
|
76179
|
-
* properties: FormEditorProperties,
|
|
76180
|
-
* schema: Schema
|
|
76181
|
-
* } } State
|
|
76182
|
-
*
|
|
76183
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
76184
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
76185
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
76170
|
+
/**
|
|
76171
|
+
* @typedef { import('./types').Injector } Injector
|
|
76172
|
+
* @typedef { import('./types').Module } Module
|
|
76173
|
+
* @typedef { import('./types').Schema } Schema
|
|
76174
|
+
*
|
|
76175
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
76176
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
76177
|
+
*
|
|
76178
|
+
* @typedef { {
|
|
76179
|
+
* properties: FormEditorProperties,
|
|
76180
|
+
* schema: Schema
|
|
76181
|
+
* } } State
|
|
76182
|
+
*
|
|
76183
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
76184
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
76185
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
76186
76186
|
*/
|
|
76187
76187
|
|
|
76188
|
-
/**
|
|
76189
|
-
* The form editor.
|
|
76188
|
+
/**
|
|
76189
|
+
* The form editor.
|
|
76190
76190
|
*/
|
|
76191
76191
|
class FormEditor {
|
|
76192
|
-
/**
|
|
76193
|
-
* @constructor
|
|
76194
|
-
* @param {FormEditorOptions} options
|
|
76192
|
+
/**
|
|
76193
|
+
* @constructor
|
|
76194
|
+
* @param {FormEditorOptions} options
|
|
76195
76195
|
*/
|
|
76196
76196
|
constructor(options = {}) {
|
|
76197
|
-
/**
|
|
76198
|
-
* @public
|
|
76199
|
-
* @type {OnEventType}
|
|
76197
|
+
/**
|
|
76198
|
+
* @public
|
|
76199
|
+
* @type {OnEventType}
|
|
76200
76200
|
*/
|
|
76201
76201
|
this.on = this._onEvent;
|
|
76202
76202
|
|
|
76203
|
-
/**
|
|
76204
|
-
* @public
|
|
76205
|
-
* @type {String}
|
|
76203
|
+
/**
|
|
76204
|
+
* @public
|
|
76205
|
+
* @type {String}
|
|
76206
76206
|
*/
|
|
76207
76207
|
this._id = ids.next();
|
|
76208
76208
|
|
|
76209
|
-
/**
|
|
76210
|
-
* @private
|
|
76211
|
-
* @type {Element}
|
|
76209
|
+
/**
|
|
76210
|
+
* @private
|
|
76211
|
+
* @type {Element}
|
|
76212
76212
|
*/
|
|
76213
76213
|
this._container = createFormContainer();
|
|
76214
76214
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -76219,15 +76219,15 @@
|
|
|
76219
76219
|
properties = {}
|
|
76220
76220
|
} = options;
|
|
76221
76221
|
|
|
76222
|
-
/**
|
|
76223
|
-
* @private
|
|
76224
|
-
* @type {any}
|
|
76222
|
+
/**
|
|
76223
|
+
* @private
|
|
76224
|
+
* @type {any}
|
|
76225
76225
|
*/
|
|
76226
76226
|
this.exporter = exporter;
|
|
76227
76227
|
|
|
76228
|
-
/**
|
|
76229
|
-
* @private
|
|
76230
|
-
* @type {State}
|
|
76228
|
+
/**
|
|
76229
|
+
* @private
|
|
76230
|
+
* @type {State}
|
|
76231
76231
|
*/
|
|
76232
76232
|
this._state = {
|
|
76233
76233
|
properties,
|
|
@@ -76256,10 +76256,10 @@
|
|
|
76256
76256
|
this._detach(false);
|
|
76257
76257
|
}
|
|
76258
76258
|
|
|
76259
|
-
/**
|
|
76260
|
-
* @param {Schema} schema
|
|
76261
|
-
*
|
|
76262
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
76259
|
+
/**
|
|
76260
|
+
* @param {Schema} schema
|
|
76261
|
+
*
|
|
76262
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
76263
76263
|
*/
|
|
76264
76264
|
importSchema(schema) {
|
|
76265
76265
|
return new Promise((resolve, reject) => {
|
|
@@ -76288,15 +76288,15 @@
|
|
|
76288
76288
|
});
|
|
76289
76289
|
}
|
|
76290
76290
|
|
|
76291
|
-
/**
|
|
76292
|
-
* @returns {Schema}
|
|
76291
|
+
/**
|
|
76292
|
+
* @returns {Schema}
|
|
76293
76293
|
*/
|
|
76294
76294
|
saveSchema() {
|
|
76295
76295
|
return this.getSchema();
|
|
76296
76296
|
}
|
|
76297
76297
|
|
|
76298
|
-
/**
|
|
76299
|
-
* @returns {Schema}
|
|
76298
|
+
/**
|
|
76299
|
+
* @returns {Schema}
|
|
76300
76300
|
*/
|
|
76301
76301
|
getSchema() {
|
|
76302
76302
|
const {
|
|
@@ -76305,8 +76305,8 @@
|
|
|
76305
76305
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
76306
76306
|
}
|
|
76307
76307
|
|
|
76308
|
-
/**
|
|
76309
|
-
* @param {Element|string} parentNode
|
|
76308
|
+
/**
|
|
76309
|
+
* @param {Element|string} parentNode
|
|
76310
76310
|
*/
|
|
76311
76311
|
attachTo(parentNode) {
|
|
76312
76312
|
if (!parentNode) {
|
|
@@ -76324,10 +76324,10 @@
|
|
|
76324
76324
|
this._detach();
|
|
76325
76325
|
}
|
|
76326
76326
|
|
|
76327
|
-
/**
|
|
76328
|
-
* @internal
|
|
76329
|
-
*
|
|
76330
|
-
* @param {boolean} [emit]
|
|
76327
|
+
/**
|
|
76328
|
+
* @internal
|
|
76329
|
+
*
|
|
76330
|
+
* @param {boolean} [emit]
|
|
76331
76331
|
*/
|
|
76332
76332
|
_detach(emit = true) {
|
|
76333
76333
|
const container = this._container,
|
|
@@ -76341,9 +76341,9 @@
|
|
|
76341
76341
|
parentNode.removeChild(container);
|
|
76342
76342
|
}
|
|
76343
76343
|
|
|
76344
|
-
/**
|
|
76345
|
-
* @param {any} property
|
|
76346
|
-
* @param {any} value
|
|
76344
|
+
/**
|
|
76345
|
+
* @param {any} property
|
|
76346
|
+
* @param {any} value
|
|
76347
76347
|
*/
|
|
76348
76348
|
setProperty(property, value) {
|
|
76349
76349
|
const properties = set$2(this._getState().properties, [property], value);
|
|
@@ -76352,21 +76352,21 @@
|
|
|
76352
76352
|
});
|
|
76353
76353
|
}
|
|
76354
76354
|
|
|
76355
|
-
/**
|
|
76356
|
-
* @param {string} type
|
|
76357
|
-
* @param {Function} handler
|
|
76355
|
+
/**
|
|
76356
|
+
* @param {string} type
|
|
76357
|
+
* @param {Function} handler
|
|
76358
76358
|
*/
|
|
76359
76359
|
off(type, handler) {
|
|
76360
76360
|
this.get('eventBus').off(type, handler);
|
|
76361
76361
|
}
|
|
76362
76362
|
|
|
76363
|
-
/**
|
|
76364
|
-
* @internal
|
|
76365
|
-
*
|
|
76366
|
-
* @param {FormEditorOptions} options
|
|
76367
|
-
* @param {Element} container
|
|
76368
|
-
*
|
|
76369
|
-
* @returns {Injector}
|
|
76363
|
+
/**
|
|
76364
|
+
* @internal
|
|
76365
|
+
*
|
|
76366
|
+
* @param {FormEditorOptions} options
|
|
76367
|
+
* @param {Element} container
|
|
76368
|
+
*
|
|
76369
|
+
* @returns {Injector}
|
|
76370
76370
|
*/
|
|
76371
76371
|
_createInjector(options, container) {
|
|
76372
76372
|
const {
|
|
@@ -76388,22 +76388,22 @@
|
|
|
76388
76388
|
}, core, ...modules, ...additionalModules]);
|
|
76389
76389
|
}
|
|
76390
76390
|
|
|
76391
|
-
/**
|
|
76392
|
-
* @internal
|
|
76391
|
+
/**
|
|
76392
|
+
* @internal
|
|
76393
76393
|
*/
|
|
76394
76394
|
_emit(type, data) {
|
|
76395
76395
|
this.get('eventBus').fire(type, data);
|
|
76396
76396
|
}
|
|
76397
76397
|
|
|
76398
|
-
/**
|
|
76399
|
-
* @internal
|
|
76398
|
+
/**
|
|
76399
|
+
* @internal
|
|
76400
76400
|
*/
|
|
76401
76401
|
_getState() {
|
|
76402
76402
|
return this._state;
|
|
76403
76403
|
}
|
|
76404
76404
|
|
|
76405
|
-
/**
|
|
76406
|
-
* @internal
|
|
76405
|
+
/**
|
|
76406
|
+
* @internal
|
|
76407
76407
|
*/
|
|
76408
76408
|
_setState(state) {
|
|
76409
76409
|
this._state = {
|
|
@@ -76413,15 +76413,15 @@
|
|
|
76413
76413
|
this._emit('changed', this._getState());
|
|
76414
76414
|
}
|
|
76415
76415
|
|
|
76416
|
-
/**
|
|
76417
|
-
* @internal
|
|
76416
|
+
/**
|
|
76417
|
+
* @internal
|
|
76418
76418
|
*/
|
|
76419
76419
|
_getModules() {
|
|
76420
76420
|
return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule, RenderInjectionModule, RepeatRenderManagerModule];
|
|
76421
76421
|
}
|
|
76422
76422
|
|
|
76423
|
-
/**
|
|
76424
|
-
* @internal
|
|
76423
|
+
/**
|
|
76424
|
+
* @internal
|
|
76425
76425
|
*/
|
|
76426
76426
|
_onEvent(type, priority, handler) {
|
|
76427
76427
|
this.get('eventBus').on(type, priority, handler);
|
|
@@ -77924,8 +77924,8 @@
|
|
|
77924
77924
|
return new LanguageSupport(jsonLanguage);
|
|
77925
77925
|
}
|
|
77926
77926
|
|
|
77927
|
-
/**
|
|
77928
|
-
* @type {Facet<import('..').Variables>} Variables
|
|
77927
|
+
/**
|
|
77928
|
+
* @type {Facet<import('..').Variables>} Variables
|
|
77929
77929
|
*/
|
|
77930
77930
|
const variablesFacet = Facet.define();
|
|
77931
77931
|
|
|
@@ -78102,11 +78102,11 @@
|
|
|
78102
78102
|
|
|
78103
78103
|
const NO_LINT_CLS = 'fjs-no-json-lint';
|
|
78104
78104
|
|
|
78105
|
-
/**
|
|
78106
|
-
* @param {object} options
|
|
78107
|
-
* @param {boolean} [options.readonly]
|
|
78108
|
-
* @param {object} [options.contentAttributes]
|
|
78109
|
-
* @param {string | HTMLElement} [options.placeholder]
|
|
78105
|
+
/**
|
|
78106
|
+
* @param {object} options
|
|
78107
|
+
* @param {boolean} [options.readonly]
|
|
78108
|
+
* @param {object} [options.contentAttributes]
|
|
78109
|
+
* @param {string | HTMLElement} [options.placeholder]
|
|
78110
78110
|
*/
|
|
78111
78111
|
function JSONEditor(options = {}) {
|
|
78112
78112
|
const {
|
|
@@ -78119,8 +78119,8 @@
|
|
|
78119
78119
|
let tabSize = new Compartment().of(EditorState.tabSize.of(2));
|
|
78120
78120
|
let container = null;
|
|
78121
78121
|
|
|
78122
|
-
/**
|
|
78123
|
-
* @typedef {Array<string>} Variables
|
|
78122
|
+
/**
|
|
78123
|
+
* @typedef {Array<string>} Variables
|
|
78124
78124
|
*/
|
|
78125
78125
|
|
|
78126
78126
|
const autocompletionConf = new Compartment();
|
|
@@ -78171,8 +78171,8 @@
|
|
|
78171
78171
|
return view.state.doc.toString();
|
|
78172
78172
|
};
|
|
78173
78173
|
|
|
78174
|
-
/**
|
|
78175
|
-
* @param {Variables} variables
|
|
78174
|
+
/**
|
|
78175
|
+
* @param {Variables} variables
|
|
78176
78176
|
*/
|
|
78177
78177
|
this.setVariables = function (variables) {
|
|
78178
78178
|
view.setVariables(variables);
|