@bpmn-io/form-js-playground 1.3.0-alpha.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19392,8 +19392,8 @@
19392
19392
  let sharedChunks = findSharedChunks(a, b, textDiff);
19393
19393
  let sideA = new SpanCursor(a, sharedChunks, minPointSize);
19394
19394
  let sideB = new SpanCursor(b, sharedChunks, minPointSize);
19395
- textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));
19396
- if (textDiff.empty && textDiff.length == 0) compare(sideA, 0, sideB, 0, 0, comparator);
19395
+ textDiff.iterGaps((fromA, fromB, length) => compare$1(sideA, fromA, sideB, fromB, length, comparator));
19396
+ if (textDiff.empty && textDiff.length == 0) compare$1(sideA, 0, sideB, 0, 0, comparator);
19397
19397
  }
19398
19398
  /**
19399
19399
  Compare the contents of two groups of range sets, returning true
@@ -19824,7 +19824,7 @@
19824
19824
  return open;
19825
19825
  }
19826
19826
  }
19827
- function compare(a, startA, b, startB, length, comparator) {
19827
+ function compare$1(a, startA, b, startB, length, comparator) {
19828
19828
  a.goto(startA);
19829
19829
  b.goto(startB);
19830
19830
  let endB = startB + length;
@@ -47571,26 +47571,26 @@
47571
47571
  return [...new Set(variables)];
47572
47572
  };
47573
47573
 
47574
- /**
47575
- * Get the variable name at the specified index in a given path expression.
47576
- *
47577
- * @param {Object} root - The root node of the path expression tree.
47578
- * @param {number} index - The index of the variable name to retrieve.
47579
- * @returns {string|null} The variable name at the specified index or null if index is out of bounds.
47574
+ /**
47575
+ * Get the variable name at the specified index in a given path expression.
47576
+ *
47577
+ * @param {Object} root - The root node of the path expression tree.
47578
+ * @param {number} index - The index of the variable name to retrieve.
47579
+ * @returns {string|null} The variable name at the specified index or null if index is out of bounds.
47580
47580
  */
47581
47581
  const _getVariableNameAtPathIndex = (root, index) => {
47582
47582
  const accessors = _deconstructPathExpression(root);
47583
47583
  return accessors[index] || null;
47584
47584
  };
47585
47585
 
47586
- /**
47587
- * Extracts the variables which are required of the external context for a given path expression.
47588
- * This is done by traversing the path expression tree and keeping track of the current depth relative to the external context.
47589
- *
47590
- * @param {Object} node - The root node of the path expression tree.
47591
- * @param {number} initialDepth - The depth at which the root node is located in the outer context.
47592
- * @param {Object} specialDepthAccessors - Definitions of special keywords which represent more complex accesses of the outer context.
47593
- * @returns {Set} - A set containing the extracted variable names.
47586
+ /**
47587
+ * Extracts the variables which are required of the external context for a given path expression.
47588
+ * This is done by traversing the path expression tree and keeping track of the current depth relative to the external context.
47589
+ *
47590
+ * @param {Object} node - The root node of the path expression tree.
47591
+ * @param {number} initialDepth - The depth at which the root node is located in the outer context.
47592
+ * @param {Object} specialDepthAccessors - Definitions of special keywords which represent more complex accesses of the outer context.
47593
+ * @returns {Set} - A set containing the extracted variable names.
47594
47594
  */
47595
47595
  const _smartExtractVariableNames = (node, initialDepth, specialDepthAccessors) => {
47596
47596
  // depth info represents the previous (initialised as null) and current depth of the current accessor in the path expression
@@ -47636,11 +47636,11 @@
47636
47636
  return new Set(extractedVariables);
47637
47637
  };
47638
47638
 
47639
- /**
47640
- * Deconstructs a path expression tree into an array of components.
47641
- *
47642
- * @param {Object} root - The root node of the path expression tree.
47643
- * @returns {Array<string>} An array of components in the path expression, in the correct order.
47639
+ /**
47640
+ * Deconstructs a path expression tree into an array of components.
47641
+ *
47642
+ * @param {Object} root - The root node of the path expression tree.
47643
+ * @returns {Array<string>} An array of components in the path expression, in the correct order.
47644
47644
  */
47645
47645
  const _deconstructPathExpression = root => {
47646
47646
  let node = root;
@@ -47659,13 +47659,13 @@
47659
47659
  return parts.reverse();
47660
47660
  };
47661
47661
 
47662
- /**
47663
- * Builds a simplified feel structure tree from the given parse tree and feel string.
47664
- * The nodes follow this structure: `{ name: string, children: Array, variableName?: string }`
47665
- *
47666
- * @param {Object} parseTree - The parse tree generated by a parser.
47667
- * @param {string} feelString - The feel string used for parsing.
47668
- * @returns {Object} The simplified feel structure tree.
47662
+ /**
47663
+ * Builds a simplified feel structure tree from the given parse tree and feel string.
47664
+ * The nodes follow this structure: `{ name: string, children: Array, variableName?: string }`
47665
+ *
47666
+ * @param {Object} parseTree - The parse tree generated by a parser.
47667
+ * @param {string} feelString - The feel string used for parsing.
47668
+ * @returns {Object} The simplified feel structure tree.
47669
47669
  */
47670
47670
  const _buildSimpleFeelStructureTree = (parseTree, feelString) => {
47671
47671
  const stack = [{
@@ -47691,9 +47691,9 @@
47691
47691
  return _extractFilterExpressions(stack[0].children[0]);
47692
47692
  };
47693
47693
 
47694
- /**
47695
- * Restructure the tree in such a way to bring filters (which create new contexts) to the root of the tree.
47696
- * This is done to simplify the extraction of variables and match the context hierarchy.
47694
+ /**
47695
+ * Restructure the tree in such a way to bring filters (which create new contexts) to the root of the tree.
47696
+ * This is done to simplify the extraction of variables and match the context hierarchy.
47697
47697
  */
47698
47698
  const _extractFilterExpressions = tree => {
47699
47699
  const flattenedExpressionTree = {
@@ -47733,25 +47733,25 @@
47733
47733
  this._eventBus = eventBus;
47734
47734
  }
47735
47735
 
47736
- /**
47737
- * Determines if the given value is a FEEL expression.
47738
- *
47739
- * @param {any} value
47740
- * @returns {boolean}
47741
- *
47736
+ /**
47737
+ * Determines if the given value is a FEEL expression.
47738
+ *
47739
+ * @param {any} value
47740
+ * @returns {boolean}
47741
+ *
47742
47742
  */
47743
47743
  isExpression(value) {
47744
47744
  return isString$3(value) && value.startsWith('=');
47745
47745
  }
47746
47746
 
47747
- /**
47748
- * Retrieve variable names from a given FEEL expression.
47749
- *
47750
- * @param {string} expression
47751
- * @param {object} [options]
47752
- * @param {string} [options.type]
47753
- *
47754
- * @returns {string[]}
47747
+ /**
47748
+ * Retrieve variable names from a given FEEL expression.
47749
+ *
47750
+ * @param {string} expression
47751
+ * @param {object} [options]
47752
+ * @param {string} [options.type]
47753
+ *
47754
+ * @returns {string[]}
47755
47755
  */
47756
47756
  getVariableNames(expression, options = {}) {
47757
47757
  const {
@@ -47766,13 +47766,13 @@
47766
47766
  return getFlavouredFeelVariableNames(expression, type);
47767
47767
  }
47768
47768
 
47769
- /**
47770
- * Evaluate an expression.
47771
- *
47772
- * @param {string} expression
47773
- * @param {import('../../types').Data} [data]
47774
- *
47775
- * @returns {any}
47769
+ /**
47770
+ * Evaluate an expression.
47771
+ *
47772
+ * @param {string} expression
47773
+ * @param {import('../../types').Data} [data]
47774
+ *
47775
+ * @returns {any}
47776
47776
  */
47777
47777
  evaluate(expression, data = {}) {
47778
47778
  if (!expression) {
@@ -47796,23 +47796,23 @@
47796
47796
  class FeelersTemplating {
47797
47797
  constructor() {}
47798
47798
 
47799
- /**
47800
- * Determines if the given value is a feelers template.
47801
- *
47802
- * @param {any} value
47803
- * @returns {boolean}
47804
- *
47799
+ /**
47800
+ * Determines if the given value is a feelers template.
47801
+ *
47802
+ * @param {any} value
47803
+ * @returns {boolean}
47804
+ *
47805
47805
  */
47806
47806
  isTemplate(value) {
47807
47807
  return isString$3(value) && (value.startsWith('=') || /{{.*?}}/.test(value));
47808
47808
  }
47809
47809
 
47810
- /**
47811
- * Retrieve variable names from a given feelers template.
47812
- *
47813
- * @param {string} template
47814
- *
47815
- * @returns {string[]}
47810
+ /**
47811
+ * Retrieve variable names from a given feelers template.
47812
+ *
47813
+ * @param {string} template
47814
+ *
47815
+ * @returns {string[]}
47816
47816
  */
47817
47817
  getVariableNames(template) {
47818
47818
  if (!this.isTemplate(template)) {
@@ -47838,17 +47838,17 @@
47838
47838
  }, []);
47839
47839
  }
47840
47840
 
47841
- /**
47842
- * Evaluate a template.
47843
- *
47844
- * @param {string} template
47845
- * @param {Object<string, any>} context
47846
- * @param {Object} options
47847
- * @param {boolean} [options.debug = false]
47848
- * @param {boolean} [options.strict = false]
47849
- * @param {Function} [options.buildDebugString]
47850
- *
47851
- * @returns
47841
+ /**
47842
+ * Evaluate a template.
47843
+ *
47844
+ * @param {string} template
47845
+ * @param {Object<string, any>} context
47846
+ * @param {Object} options
47847
+ * @param {boolean} [options.debug = false]
47848
+ * @param {boolean} [options.strict = false]
47849
+ * @param {Function} [options.buildDebugString]
47850
+ *
47851
+ * @returns
47852
47852
  */
47853
47853
  evaluate(template, context = {}, options = {}) {
47854
47854
  const {
@@ -47863,22 +47863,22 @@
47863
47863
  });
47864
47864
  }
47865
47865
 
47866
- /**
47867
- * @typedef {Object} ExpressionWithDepth
47868
- * @property {number} depth - The depth of the expression in the syntax tree.
47869
- * @property {string} expression - The extracted expression
47866
+ /**
47867
+ * @typedef {Object} ExpressionWithDepth
47868
+ * @property {number} depth - The depth of the expression in the syntax tree.
47869
+ * @property {string} expression - The extracted expression
47870
47870
  */
47871
47871
 
47872
- /**
47873
- * Extracts all feel expressions in the template along with their depth in the syntax tree.
47874
- * The depth is incremented for child expressions of loops to account for context drilling.
47875
- * @name extractExpressionsWithDepth
47876
- * @param {string} template - A feelers template string.
47877
- * @returns {Array<ExpressionWithDepth>} An array of objects, each containing the depth and the extracted expression.
47878
- *
47879
- * @example
47880
- * const template = "Hello {{user}}, you have:{{#loop items}}\n- {{amount}} {{name}}{{/loop}}.";
47881
- * const extractedExpressions = _extractExpressionsWithDepth(template);
47872
+ /**
47873
+ * Extracts all feel expressions in the template along with their depth in the syntax tree.
47874
+ * The depth is incremented for child expressions of loops to account for context drilling.
47875
+ * @name extractExpressionsWithDepth
47876
+ * @param {string} template - A feelers template string.
47877
+ * @returns {Array<ExpressionWithDepth>} An array of objects, each containing the depth and the extracted expression.
47878
+ *
47879
+ * @example
47880
+ * const template = "Hello {{user}}, you have:{{#loop items}}\n- {{amount}} {{name}}{{/loop}}.";
47881
+ * const extractedExpressions = _extractExpressionsWithDepth(template);
47882
47882
  */
47883
47883
  _extractExpressionsWithDepth(template) {
47884
47884
  // build simplified feelers syntax tree
@@ -47983,10 +47983,10 @@
47983
47983
  return injector;
47984
47984
  }
47985
47985
 
47986
- /**
47987
- * @param {string?} prefix
47988
- *
47989
- * @returns Element
47986
+ /**
47987
+ * @param {string?} prefix
47988
+ *
47989
+ * @returns Element
47990
47990
  */
47991
47991
  function createFormContainer(prefix = 'fjs') {
47992
47992
  const container = document.createElement('div');
@@ -47996,22 +47996,22 @@
47996
47996
  const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression'];
47997
47997
  const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text'];
47998
47998
 
47999
- /**
48000
- * @template T
48001
- * @param {T} data
48002
- * @param {(this: any, key: string, value: any) => any} [replacer]
48003
- * @return {T}
47999
+ /**
48000
+ * @template T
48001
+ * @param {T} data
48002
+ * @param {(this: any, key: string, value: any) => any} [replacer]
48003
+ * @return {T}
48004
48004
  */
48005
48005
  function clone(data, replacer) {
48006
48006
  return JSON.parse(JSON.stringify(data, replacer));
48007
48007
  }
48008
48008
 
48009
- /**
48010
- * Parse the schema for input variables a form might make use of
48011
- *
48012
- * @param {any} schema
48013
- *
48014
- * @return {string[]}
48009
+ /**
48010
+ * Parse the schema for input variables a form might make use of
48011
+ *
48012
+ * @param {any} schema
48013
+ *
48014
+ * @return {string[]}
48015
48015
  */
48016
48016
  function getSchemaVariables(schema, options = {}) {
48017
48017
  const {
@@ -48096,9 +48096,9 @@
48096
48096
  fn(formField);
48097
48097
  }
48098
48098
 
48099
- /**
48100
- * @typedef {object} Condition
48101
- * @property {string} [hide]
48099
+ /**
48100
+ * @typedef {object} Condition
48101
+ * @property {string} [hide]
48102
48102
  */
48103
48103
 
48104
48104
  class ConditionChecker {
@@ -48108,11 +48108,11 @@
48108
48108
  this._eventBus = eventBus;
48109
48109
  }
48110
48110
 
48111
- /**
48112
- * For given data, remove properties based on condition.
48113
- *
48114
- * @param {Object<string, any>} properties
48115
- * @param {Object<string, any>} data
48111
+ /**
48112
+ * For given data, remove properties based on condition.
48113
+ *
48114
+ * @param {Object<string, any>} properties
48115
+ * @param {Object<string, any>} data
48116
48116
  */
48117
48117
  applyConditions(properties, data = {}) {
48118
48118
  const newProperties = clone(properties);
@@ -48139,13 +48139,13 @@
48139
48139
  return newProperties;
48140
48140
  }
48141
48141
 
48142
- /**
48143
- * Check if given condition is met. Returns null for invalid/missing conditions.
48144
- *
48145
- * @param {string} condition
48146
- * @param {import('../../types').Data} [data]
48147
- *
48148
- * @returns {boolean|null}
48142
+ /**
48143
+ * Check if given condition is met. Returns null for invalid/missing conditions.
48144
+ *
48145
+ * @param {string} condition
48146
+ * @param {import('../../types').Data} [data]
48147
+ *
48148
+ * @returns {boolean|null}
48149
48149
  */
48150
48150
  check(condition, data = {}) {
48151
48151
  if (!condition) {
@@ -48166,12 +48166,12 @@
48166
48166
  }
48167
48167
  }
48168
48168
 
48169
- /**
48170
- * Check if hide condition is met.
48171
- *
48172
- * @param {Condition} condition
48173
- * @param {Object<string, any>} data
48174
- * @returns {boolean}
48169
+ /**
48170
+ * Check if hide condition is met.
48171
+ *
48172
+ * @param {Condition} condition
48173
+ * @param {Object<string, any>} data
48174
+ * @returns {boolean}
48175
48175
  */
48176
48176
  _checkHideCondition(condition, data) {
48177
48177
  if (!condition.hide) {
@@ -48206,12 +48206,12 @@
48206
48206
  this._converter = new showdown.Converter();
48207
48207
  }
48208
48208
 
48209
- /**
48210
- * Render markdown to HTML.
48211
- *
48212
- * @param {string} markdown - The markdown to render
48213
- *
48214
- * @returns {string} HTML
48209
+ /**
48210
+ * Render markdown to HTML.
48211
+ *
48212
+ * @param {string} markdown - The markdown to render
48213
+ *
48214
+ * @returns {string} HTML
48215
48215
  */
48216
48216
  render(markdown) {
48217
48217
  return this._converter.makeHtml(markdown);
@@ -49352,8 +49352,8 @@
49352
49352
 
49353
49353
  // helpers //////////
49354
49354
 
49355
- /**
49356
- * Helper function to evaluate optional FEEL validation values.
49355
+ /**
49356
+ * Helper function to evaluate optional FEEL validation values.
49357
49357
  */
49358
49358
  function evaluateFEELValues(validate, expressionLanguage, conditionChecker, form) {
49359
49359
  const evaluatedValidate = {
@@ -49386,12 +49386,12 @@
49386
49386
  return evaluatedValidate;
49387
49387
  }
49388
49388
  class Importer {
49389
- /**
49390
- * @constructor
49391
- * @param { import('./FormFieldRegistry').default } formFieldRegistry
49392
- * @param { import('./PathRegistry').default } pathRegistry
49393
- * @param { import('./FieldFactory').default } fieldFactory
49394
- * @param { import('./FormLayouter').default } formLayouter
49389
+ /**
49390
+ * @constructor
49391
+ * @param { import('./FormFieldRegistry').default } formFieldRegistry
49392
+ * @param { import('./PathRegistry').default } pathRegistry
49393
+ * @param { import('./FieldFactory').default } fieldFactory
49394
+ * @param { import('./FormLayouter').default } formLayouter
49395
49395
  */
49396
49396
  constructor(formFieldRegistry, pathRegistry, fieldFactory, formLayouter) {
49397
49397
  this._formFieldRegistry = formFieldRegistry;
@@ -49400,21 +49400,21 @@
49400
49400
  this._formLayouter = formLayouter;
49401
49401
  }
49402
49402
 
49403
- /**
49404
- * Import schema creating rows, fields, attaching additional
49405
- * information to each field and adding fields to the
49406
- * field registry.
49407
- *
49408
- * Additional information attached:
49409
- *
49410
- * * `id` (unless present)
49411
- * * `_parent`
49412
- * * `_path`
49413
- *
49414
- * @param {any} schema
49415
- *
49416
- * @typedef {{ warnings: Error[], schema: any }} ImportResult
49417
- * @returns {ImportResult}
49403
+ /**
49404
+ * Import schema creating rows, fields, attaching additional
49405
+ * information to each field and adding fields to the
49406
+ * field registry.
49407
+ *
49408
+ * Additional information attached:
49409
+ *
49410
+ * * `id` (unless present)
49411
+ * * `_parent`
49412
+ * * `_path`
49413
+ *
49414
+ * @param {any} schema
49415
+ *
49416
+ * @typedef {{ warnings: Error[], schema: any }} ImportResult
49417
+ * @returns {ImportResult}
49418
49418
  */
49419
49419
  importSchema(schema) {
49420
49420
  // TODO: Add warnings
@@ -49439,12 +49439,12 @@
49439
49439
  this._pathRegistry.clear();
49440
49440
  }
49441
49441
 
49442
- /**
49443
- * @param {{[x: string]: any}} fieldAttrs
49444
- * @param {String} [parentId]
49445
- * @param {number} [index]
49446
- *
49447
- * @return {any} field
49442
+ /**
49443
+ * @param {{[x: string]: any}} fieldAttrs
49444
+ * @param {String} [parentId]
49445
+ * @param {number} [index]
49446
+ *
49447
+ * @return {any} field
49448
49448
  */
49449
49449
  importFormField(fieldAttrs, parentId, index) {
49450
49450
  const {
@@ -49469,11 +49469,11 @@
49469
49469
  return field;
49470
49470
  }
49471
49471
 
49472
- /**
49473
- * @param {Array<any>} components
49474
- * @param {string} parentId
49475
- *
49476
- * @return {Array<any>} imported components
49472
+ /**
49473
+ * @param {Array<any>} components
49474
+ * @param {string} parentId
49475
+ *
49476
+ * @return {Array<any>} imported components
49477
49477
  */
49478
49478
  importFormFields(components, parentId) {
49479
49479
  return components.map((component, index) => {
@@ -49483,11 +49483,11 @@
49483
49483
  }
49484
49484
  Importer.$inject = ['formFieldRegistry', 'pathRegistry', 'fieldFactory', 'formLayouter'];
49485
49485
  class FieldFactory {
49486
- /**
49487
- * @constructor
49488
- *
49489
- * @param formFieldRegistry
49490
- * @param formFields
49486
+ /**
49487
+ * @constructor
49488
+ *
49489
+ * @param formFieldRegistry
49490
+ * @param formFields
49491
49491
  */
49492
49492
  constructor(formFieldRegistry, pathRegistry, formFields) {
49493
49493
  this._formFieldRegistry = formFieldRegistry;
@@ -49569,36 +49569,36 @@
49569
49569
  }
49570
49570
  FieldFactory.$inject = ['formFieldRegistry', 'pathRegistry', 'formFields'];
49571
49571
 
49572
- /**
49573
- * The PathRegistry class manages a hierarchical structure of paths associated with form fields.
49574
- * It enables claiming, unclaiming, and validating paths within this structure.
49575
- *
49576
- * Example Tree Structure:
49577
- *
49578
- * [
49579
- * {
49580
- * segment: 'root',
49581
- * claimCount: 1,
49582
- * children: [
49583
- * {
49584
- * segment: 'child1',
49585
- * claimCount: 2,
49586
- * children: null // A leaf node (closed path)
49587
- * },
49588
- * {
49589
- * segment: 'child2',
49590
- * claimCount: 1,
49591
- * children: [
49592
- * {
49593
- * segment: 'subChild1',
49594
- * claimCount: 1,
49595
- * children: [] // An open node (open path)
49596
- * }
49597
- * ]
49598
- * }
49599
- * ]
49600
- * }
49601
- * ]
49572
+ /**
49573
+ * The PathRegistry class manages a hierarchical structure of paths associated with form fields.
49574
+ * It enables claiming, unclaiming, and validating paths within this structure.
49575
+ *
49576
+ * Example Tree Structure:
49577
+ *
49578
+ * [
49579
+ * {
49580
+ * segment: 'root',
49581
+ * claimCount: 1,
49582
+ * children: [
49583
+ * {
49584
+ * segment: 'child1',
49585
+ * claimCount: 2,
49586
+ * children: null // A leaf node (closed path)
49587
+ * },
49588
+ * {
49589
+ * segment: 'child2',
49590
+ * claimCount: 1,
49591
+ * children: [
49592
+ * {
49593
+ * segment: 'subChild1',
49594
+ * claimCount: 1,
49595
+ * children: [] // An open node (open path)
49596
+ * }
49597
+ * ]
49598
+ * }
49599
+ * ]
49600
+ * }
49601
+ * ]
49602
49602
  */
49603
49603
  class PathRegistry {
49604
49604
  constructor(formFieldRegistry, formFields) {
@@ -49681,16 +49681,16 @@
49681
49681
  }
49682
49682
  }
49683
49683
 
49684
- /**
49685
- * Applies a function (fn) recursively on a given field and its children.
49686
- *
49687
- * - `field`: Starting field object.
49688
- * - `fn`: Function to apply.
49689
- * - `context`: Optional object for passing data between calls.
49690
- *
49691
- * Stops early if `fn` returns `false`. Useful for traversing the form field tree.
49692
- *
49693
- * @returns {boolean} Success status based on function execution.
49684
+ /**
49685
+ * Applies a function (fn) recursively on a given field and its children.
49686
+ *
49687
+ * - `field`: Starting field object.
49688
+ * - `fn`: Function to apply.
49689
+ * - `context`: Optional object for passing data between calls.
49690
+ *
49691
+ * Stops early if `fn` returns `false`. Useful for traversing the form field tree.
49692
+ *
49693
+ * @returns {boolean} Success status based on function execution.
49694
49694
  */
49695
49695
  executeRecursivelyOnFields(field, fn, context = {}) {
49696
49696
  let result = true;
@@ -49724,15 +49724,15 @@
49724
49724
  return result;
49725
49725
  }
49726
49726
 
49727
- /**
49728
- * Generates an array representing the binding path to an underlying data object for a form field.
49729
- *
49730
- * @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
49731
- * @param {Object} [options={}] - Configuration options.
49732
- * @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
49733
- * @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
49734
- *
49735
- * @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
49727
+ /**
49728
+ * Generates an array representing the binding path to an underlying data object for a form field.
49729
+ *
49730
+ * @param {Object} field - The field object with properties: `key`, `path`, `id`, and optionally `_parent`.
49731
+ * @param {Object} [options={}] - Configuration options.
49732
+ * @param {Object} [options.replacements={}] - A map of field IDs to alternative path arrays.
49733
+ * @param {Object} [options.cutoffNode] - The ID of the parent field at which to stop generating the path.
49734
+ *
49735
+ * @returns {(Array<string>|undefined)} An array of strings representing the binding path, or undefined if not determinable.
49736
49736
  */
49737
49737
  getValuePath(field, options = {}) {
49738
49738
  const {
@@ -49776,23 +49776,23 @@
49776
49776
  };
49777
49777
  PathRegistry.$inject = ['formFieldRegistry', 'formFields'];
49778
49778
 
49779
- /**
49780
- * @typedef { { id: String, components: Array<String> } } FormRow
49781
- * @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
49779
+ /**
49780
+ * @typedef { { id: String, components: Array<String> } } FormRow
49781
+ * @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
49782
49782
  */
49783
49783
 
49784
- /**
49785
- * Maintains the Form layout in a given structure, for example
49786
- *
49787
- * [
49788
- * {
49789
- * formFieldId: 'FormField_1',
49790
- * rows: [
49791
- * { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
49792
- * ]
49793
- * }
49794
- * ]
49795
- *
49784
+ /**
49785
+ * Maintains the Form layout in a given structure, for example
49786
+ *
49787
+ * [
49788
+ * {
49789
+ * formFieldId: 'FormField_1',
49790
+ * rows: [
49791
+ * { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
49792
+ * ]
49793
+ * }
49794
+ * ]
49795
+ *
49796
49796
  */
49797
49797
  class FormLayouter {
49798
49798
  constructor(eventBus) {
@@ -49802,8 +49802,8 @@
49802
49802
  this._eventBus = eventBus;
49803
49803
  }
49804
49804
 
49805
- /**
49806
- * @param {FormRow} row
49805
+ /**
49806
+ * @param {FormRow} row
49807
49807
  */
49808
49808
  addRow(formFieldId, row) {
49809
49809
  let rowsPerComponent = this._rows.find(r => r.formFieldId === formFieldId);
@@ -49817,18 +49817,18 @@
49817
49817
  rowsPerComponent.rows.push(row);
49818
49818
  }
49819
49819
 
49820
- /**
49821
- * @param {String} id
49822
- * @returns {FormRow}
49820
+ /**
49821
+ * @param {String} id
49822
+ * @returns {FormRow}
49823
49823
  */
49824
49824
  getRow(id) {
49825
49825
  const rows = allRows(this._rows);
49826
49826
  return rows.find(r => r.id === id);
49827
49827
  }
49828
49828
 
49829
- /**
49830
- * @param {any} formField
49831
- * @returns {FormRow}
49829
+ /**
49830
+ * @param {any} formField
49831
+ * @returns {FormRow}
49832
49832
  */
49833
49833
  getRowForField(formField) {
49834
49834
  return allRows(this._rows).find(r => {
@@ -49839,9 +49839,9 @@
49839
49839
  });
49840
49840
  }
49841
49841
 
49842
- /**
49843
- * @param {String} formFieldId
49844
- * @returns { Array<FormRow> }
49842
+ /**
49843
+ * @param {String} formFieldId
49844
+ * @returns { Array<FormRow> }
49845
49845
  */
49846
49846
  getRows(formFieldId) {
49847
49847
  const rowsForField = this._rows.find(r => formFieldId === r.formFieldId);
@@ -49851,15 +49851,15 @@
49851
49851
  return rowsForField.rows;
49852
49852
  }
49853
49853
 
49854
- /**
49855
- * @returns {string}
49854
+ /**
49855
+ * @returns {string}
49856
49856
  */
49857
49857
  nextRowId() {
49858
49858
  return this._ids.nextPrefixed('Row_');
49859
49859
  }
49860
49860
 
49861
- /**
49862
- * @param {any} formField
49861
+ /**
49862
+ * @param {any} formField
49863
49863
  */
49864
49864
  calculateLayout(formField) {
49865
49865
  const {
@@ -49913,9 +49913,9 @@
49913
49913
  });
49914
49914
  }
49915
49915
 
49916
- /**
49917
- * @param {Array<FormRows>} formRows
49918
- * @returns {Array<FormRow>}
49916
+ /**
49917
+ * @param {Array<FormRows>} formRows
49918
+ * @returns {Array<FormRow>}
49919
49919
  */
49920
49920
  function allRows(formRows) {
49921
49921
  return flatten$2(formRows.map(c => c.rows));
@@ -50067,11 +50067,11 @@
50067
50067
  });
50068
50068
  var FormRenderContext$1 = FormRenderContext;
50069
50069
 
50070
- /**
50071
- * @param {string} type
50072
- * @param {boolean} [strict]
50073
- *
50074
- * @returns {any}
50070
+ /**
50071
+ * @param {string} type
50072
+ * @param {boolean} [strict]
50073
+ *
50074
+ * @returns {any}
50075
50075
  */
50076
50076
  function getService$2(type, strict) {}
50077
50077
  const FormContext = D$2({
@@ -50086,10 +50086,10 @@
50086
50086
  return getService(type, strict);
50087
50087
  }
50088
50088
 
50089
- /**
50090
- * Returns the conditionally filtered data of a form reactively.
50091
- * Memoised to minimize re-renders
50092
- *
50089
+ /**
50090
+ * Returns the conditionally filtered data of a form reactively.
50091
+ * Memoised to minimize re-renders
50092
+ *
50093
50093
  */
50094
50094
  function useFilteredFormData() {
50095
50095
  const {
@@ -50106,12 +50106,12 @@
50106
50106
  }, [conditionChecker, data, initialData]);
50107
50107
  }
50108
50108
 
50109
- /**
50110
- * Evaluate if condition is met reactively based on the conditionChecker and form data.
50111
- *
50112
- * @param {string | undefined} condition
50113
- *
50114
- * @returns {boolean} true if condition is met or no condition or condition checker exists
50109
+ /**
50110
+ * Evaluate if condition is met reactively based on the conditionChecker and form data.
50111
+ *
50112
+ * @param {string | undefined} condition
50113
+ *
50114
+ * @returns {boolean} true if condition is met or no condition or condition checker exists
50115
50115
  */
50116
50116
  function useCondition(condition) {
50117
50117
  const conditionChecker = useService$2('conditionChecker', false);
@@ -50121,13 +50121,13 @@
50121
50121
  }, [conditionChecker, condition, filteredData]);
50122
50122
  }
50123
50123
 
50124
- /**
50125
- * Evaluate a string reactively based on the expressionLanguage and form data.
50126
- * If the string is not an expression, it is returned as is.
50127
- * Memoised to minimize re-renders.
50128
- *
50129
- * @param {string} value
50130
- *
50124
+ /**
50125
+ * Evaluate a string reactively based on the expressionLanguage and form data.
50126
+ * If the string is not an expression, it is returned as is.
50127
+ * Memoised to minimize re-renders.
50128
+ *
50129
+ * @param {string} value
50130
+ *
50131
50131
  */
50132
50132
  function useExpressionEvaluation(value) {
50133
50133
  const formData = useFilteredFormData();
@@ -50155,16 +50155,16 @@
50155
50155
  });
50156
50156
  }
50157
50157
 
50158
- /**
50159
- * Retrieve readonly value of a form field, given it can be an
50160
- * expression optionally or configured globally.
50161
- *
50162
- * @typedef { import('../../types').FormProperties } FormProperties
50163
- *
50164
- * @param {any} formField
50165
- * @param {FormProperties} properties
50166
- *
50167
- * @returns {boolean}
50158
+ /**
50159
+ * Retrieve readonly value of a form field, given it can be an
50160
+ * expression optionally or configured globally.
50161
+ *
50162
+ * @typedef { import('../../types').FormProperties } FormProperties
50163
+ *
50164
+ * @param {any} formField
50165
+ * @param {FormProperties} properties
50166
+ *
50167
+ * @returns {boolean}
50168
50168
  */
50169
50169
  function useReadonly(formField, properties = {}) {
50170
50170
  const expressionLanguage = useService$2('expressionLanguage');
@@ -50181,17 +50181,47 @@
50181
50181
  }
50182
50182
  return readonly || false;
50183
50183
  }
50184
+ function usePrevious$1(value, defaultValue, dependencies) {
50185
+ const ref = s$1(defaultValue);
50186
+ y(() => ref.current = value, dependencies);
50187
+ return ref.current;
50188
+ }
50184
50189
 
50185
- /**
50186
- * Template a string reactively based on form data. If the string is not a template, it is returned as is.
50187
- * Memoised to minimize re-renders
50188
- *
50189
- * @param {string} value
50190
- * @param {Object} options
50191
- * @param {boolean} [options.debug = false]
50192
- * @param {boolean} [options.strict = false]
50193
- * @param {Function} [options.buildDebugString]
50194
- *
50190
+ /**
50191
+ * A custom hook to manage state changes with deep comparison.
50192
+ *
50193
+ * @param {any} value - The current value to manage.
50194
+ * @param {any} defaultValue - The initial default value for the state.
50195
+ * @returns {any} - Returns the current state.
50196
+ */
50197
+ function useDeepCompareState(value, defaultValue) {
50198
+ const [state, setState] = l$2(defaultValue);
50199
+ const previous = usePrevious$1(value, defaultValue, [value]);
50200
+ const changed = !compare(previous, value);
50201
+ y(() => {
50202
+ if (changed) {
50203
+ setState(value);
50204
+ }
50205
+ }, [changed, value]);
50206
+ return state;
50207
+ }
50208
+
50209
+ // helpers //////////////////////////
50210
+
50211
+ function compare(a, b) {
50212
+ return JSON.stringify(a) === JSON.stringify(b);
50213
+ }
50214
+
50215
+ /**
50216
+ * Template a string reactively based on form data. If the string is not a template, it is returned as is.
50217
+ * Memoised to minimize re-renders
50218
+ *
50219
+ * @param {string} value
50220
+ * @param {Object} options
50221
+ * @param {boolean} [options.debug = false]
50222
+ * @param {boolean} [options.strict = false]
50223
+ * @param {Function} [options.buildDebugString]
50224
+ *
50195
50225
  */
50196
50226
  function useTemplateEvaluation(value, options) {
50197
50227
  const filteredData = useFilteredFormData();
@@ -50204,17 +50234,17 @@
50204
50234
  }, [filteredData, templating, value, options]);
50205
50235
  }
50206
50236
 
50207
- /**
50208
- * Template a string reactively based on form data. If the string is not a template, it is returned as is.
50209
- * If the string contains multiple lines, only the first line is returned.
50210
- * Memoised to minimize re-renders
50211
- *
50212
- * @param {string} value
50213
- * @param {Object} [options]
50214
- * @param {boolean} [options.debug = false]
50215
- * @param {boolean} [options.strict = false]
50216
- * @param {Function} [options.buildDebugString]
50217
- *
50237
+ /**
50238
+ * Template a string reactively based on form data. If the string is not a template, it is returned as is.
50239
+ * If the string contains multiple lines, only the first line is returned.
50240
+ * Memoised to minimize re-renders
50241
+ *
50242
+ * @param {string} value
50243
+ * @param {Object} [options]
50244
+ * @param {boolean} [options.debug = false]
50245
+ * @param {boolean} [options.strict = false]
50246
+ * @param {Function} [options.buildDebugString]
50247
+ *
50218
50248
  */
50219
50249
  function useSingleLineTemplateEvaluation(value, options = {}) {
50220
50250
  const evaluatedTemplate = useTemplateEvaluation(value, options);
@@ -50414,8 +50444,8 @@
50414
50444
  };
50415
50445
  }
50416
50446
 
50417
- /**
50418
- * @enum { String }
50447
+ /**
50448
+ * @enum { String }
50419
50449
  */
50420
50450
  const LOAD_STATES = {
50421
50451
  LOADING: 'loading',
@@ -50423,17 +50453,17 @@
50423
50453
  ERROR: 'error'
50424
50454
  };
50425
50455
 
50426
- /**
50427
- * @typedef {Object} ValuesGetter
50428
- * @property {Object[]} values - The values data
50429
- * @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
50456
+ /**
50457
+ * @typedef {Object} ValuesGetter
50458
+ * @property {Object[]} values - The values data
50459
+ * @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
50430
50460
  */
50431
50461
 
50432
- /**
50433
- * A hook to load values for single and multiselect components.
50434
- *
50435
- * @param {Object} field - The form field to handle values for
50436
- * @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
50462
+ /**
50463
+ * A hook to load values for single and multiselect components.
50464
+ *
50465
+ * @param {Object} field - The form field to handle values for
50466
+ * @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
50437
50467
  */
50438
50468
  function useValuesAsync(field) {
50439
50469
  const {
@@ -50447,11 +50477,8 @@
50447
50477
  state: LOAD_STATES.LOADING
50448
50478
  });
50449
50479
  const initialData = useService$2('form')._getState().initialData;
50450
- const evaluatedValues = d(() => {
50451
- if (valuesExpression) {
50452
- return useExpressionEvaluation(valuesExpression);
50453
- }
50454
- }, [valuesExpression]);
50480
+ const expressionEvaluation = useExpressionEvaluation(valuesExpression);
50481
+ const evaluatedValues = useDeepCompareState(expressionEvaluation || [], []);
50455
50482
  y(() => {
50456
50483
  let values = [];
50457
50484
 
@@ -50467,8 +50494,10 @@
50467
50494
  values = Array.isArray(staticValues) ? staticValues : [];
50468
50495
 
50469
50496
  // expression
50470
- } else if (evaluatedValues && Array.isArray(evaluatedValues)) {
50471
- values = evaluatedValues;
50497
+ } else if (valuesExpression) {
50498
+ if (evaluatedValues && Array.isArray(evaluatedValues)) {
50499
+ values = evaluatedValues;
50500
+ }
50472
50501
  } else {
50473
50502
  setValuesGetter(buildErrorState('No values source defined in the form definition'));
50474
50503
  return;
@@ -50477,7 +50506,7 @@
50477
50506
  // normalize data to support primitives and partially defined objects
50478
50507
  values = normalizeValuesData(values);
50479
50508
  setValuesGetter(buildLoadedState(values));
50480
- }, [valuesKey, staticValues, initialData]);
50509
+ }, [valuesKey, staticValues, initialData, valuesExpression, evaluatedValues]);
50481
50510
  return valuesGetter;
50482
50511
  }
50483
50512
  const buildErrorState = error => ({
@@ -50949,12 +50978,12 @@
50949
50978
  };
50950
50979
  var CalendarIcon = SvgCalendar;
50951
50980
 
50952
- /**
50953
- * Returns date format for the provided locale.
50954
- * If the locale is not provided, uses the browser's locale.
50955
- *
50956
- * @param {string} [locale] - The locale to get date format for.
50957
- * @returns {string} The date format for the locale.
50981
+ /**
50982
+ * Returns date format for the provided locale.
50983
+ * If the locale is not provided, uses the browser's locale.
50984
+ *
50985
+ * @param {string} [locale] - The locale to get date format for.
50986
+ * @returns {string} The date format for the locale.
50958
50987
  */
50959
50988
  function getLocaleDateFormat(locale = 'default') {
50960
50989
  const parts = new Intl.DateTimeFormat(locale).formatToParts(new Date(Date.UTC(2020, 5, 5)));
@@ -50973,12 +51002,12 @@
50973
51002
  }).join('');
50974
51003
  }
50975
51004
 
50976
- /**
50977
- * Returns readable date format for the provided locale.
50978
- * If the locale is not provided, uses the browser's locale.
50979
- *
50980
- * @param {string} [locale] - The locale to get readable date format for.
50981
- * @returns {string} The readable date format for the locale.
51005
+ /**
51006
+ * Returns readable date format for the provided locale.
51007
+ * If the locale is not provided, uses the browser's locale.
51008
+ *
51009
+ * @param {string} [locale] - The locale to get readable date format for.
51010
+ * @returns {string} The readable date format for the locale.
50982
51011
  */
50983
51012
  function getLocaleReadableDateFormat(locale) {
50984
51013
  let format = getLocaleDateFormat(locale).toLowerCase();
@@ -50995,12 +51024,12 @@
50995
51024
  return format;
50996
51025
  }
50997
51026
 
50998
- /**
50999
- * Returns flatpickr config for the provided locale.
51000
- * If the locale is not provided, uses the browser's locale.
51001
- *
51002
- * @param {string} [locale] - The locale to get flatpickr config for.
51003
- * @returns {object} The flatpickr config for the locale.
51027
+ /**
51028
+ * Returns flatpickr config for the provided locale.
51029
+ * If the locale is not provided, uses the browser's locale.
51030
+ *
51031
+ * @param {string} [locale] - The locale to get flatpickr config for.
51032
+ * @returns {object} The flatpickr config for the locale.
51004
51033
  */
51005
51034
  function getLocaleDateFlatpickrConfig(locale) {
51006
51035
  return flatpickerizeDateFormat(getLocaleDateFormat(locale));
@@ -51277,7 +51306,8 @@
51277
51306
  y(() => {
51278
51307
  const individualEntries = dropdownContainer.current.children;
51279
51308
  if (individualEntries.length && !mouseControl) {
51280
- individualEntries[focusedValueIndex].scrollIntoView({
51309
+ const focusedEntry = individualEntries[focusedValueIndex];
51310
+ focusedEntry && focusedEntry.scrollIntoView({
51281
51311
  block: 'nearest',
51282
51312
  inline: 'nearest'
51283
51313
  });
@@ -51687,10 +51717,10 @@
51687
51717
  }
51688
51718
  };
51689
51719
 
51690
- /**
51691
- * This file must not be changed or exchanged.
51692
- *
51693
- * @see http://bpmn.io/license for more information.
51720
+ /**
51721
+ * This file must not be changed or exchanged.
51722
+ *
51723
+ * @see http://bpmn.io/license for more information.
51694
51724
  */
51695
51725
  function Logo() {
51696
51726
  return e$1("svg", {
@@ -51865,11 +51895,11 @@
51865
51895
 
51866
51896
  const FORM_ELEMENT = document.createElement('form');
51867
51897
 
51868
- /**
51869
- * Sanitize a HTML string and return the cleaned, safe version.
51870
- *
51871
- * @param {string} html
51872
- * @return {string}
51898
+ /**
51899
+ * Sanitize a HTML string and return the cleaned, safe version.
51900
+ *
51901
+ * @param {string} html
51902
+ * @return {string}
51873
51903
  */
51874
51904
 
51875
51905
  // see https://github.com/developit/snarkdown/issues/70
@@ -51887,29 +51917,29 @@
51887
51917
  }
51888
51918
  }
51889
51919
 
51890
- /**
51891
- * Sanitizes an image source to ensure we only allow for data URI and links
51892
- * that start with http(s).
51893
- *
51894
- * Note: Most browsers anyway do not support script execution in <img> elements.
51895
- *
51896
- * @param {string} src
51897
- * @returns {string}
51920
+ /**
51921
+ * Sanitizes an image source to ensure we only allow for data URI and links
51922
+ * that start with http(s).
51923
+ *
51924
+ * Note: Most browsers anyway do not support script execution in <img> elements.
51925
+ *
51926
+ * @param {string} src
51927
+ * @returns {string}
51898
51928
  */
51899
51929
  function sanitizeImageSource(src) {
51900
51930
  const valid = ALLOWED_IMAGE_SRC_PATTERN.test(src);
51901
51931
  return valid ? src : '';
51902
51932
  }
51903
51933
 
51904
- /**
51905
- * Recursively sanitize a HTML node, potentially
51906
- * removing it, its children or attributes.
51907
- *
51908
- * Inspired by https://github.com/developit/snarkdown/issues/70
51909
- * and https://github.com/cure53/DOMPurify. Simplified
51910
- * for our use-case.
51911
- *
51912
- * @param {Element} node
51934
+ /**
51935
+ * Recursively sanitize a HTML node, potentially
51936
+ * removing it, its children or attributes.
51937
+ *
51938
+ * Inspired by https://github.com/developit/snarkdown/issues/70
51939
+ * and https://github.com/cure53/DOMPurify. Simplified
51940
+ * for our use-case.
51941
+ *
51942
+ * @param {Element} node
51913
51943
  */
51914
51944
  function sanitizeNode(node) {
51915
51945
  // allow text nodes
@@ -51953,13 +51983,13 @@
51953
51983
  }
51954
51984
  }
51955
51985
 
51956
- /**
51957
- * Validates attributes for validity.
51958
- *
51959
- * @param {string} lcTag
51960
- * @param {string} lcName
51961
- * @param {string} value
51962
- * @return {boolean}
51986
+ /**
51987
+ * Validates attributes for validity.
51988
+ *
51989
+ * @param {string} lcTag
51990
+ * @param {string} lcName
51991
+ * @param {string} value
51992
+ * @return {boolean}
51963
51993
  */
51964
51994
  function isValidAttribute(lcTag, lcName, value) {
51965
51995
  // disallow most attributes based on whitelist
@@ -53898,55 +53928,55 @@
53898
53928
  validator: ['type', Validator]
53899
53929
  };
53900
53930
 
53901
- /**
53902
- * @typedef { import('./types').Injector } Injector
53903
- * @typedef { import('./types').Data } Data
53904
- * @typedef { import('./types').Errors } Errors
53905
- * @typedef { import('./types').Schema } Schema
53906
- * @typedef { import('./types').FormProperties } FormProperties
53907
- * @typedef { import('./types').FormProperty } FormProperty
53908
- * @typedef { import('./types').FormEvent } FormEvent
53909
- * @typedef { import('./types').FormOptions } FormOptions
53910
- *
53911
- * @typedef { {
53912
- * data: Data,
53913
- * initialData: Data,
53914
- * errors: Errors,
53915
- * properties: FormProperties,
53916
- * schema: Schema
53917
- * } } State
53918
- *
53919
- * @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
53920
- * @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
53921
- * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
53931
+ /**
53932
+ * @typedef { import('./types').Injector } Injector
53933
+ * @typedef { import('./types').Data } Data
53934
+ * @typedef { import('./types').Errors } Errors
53935
+ * @typedef { import('./types').Schema } Schema
53936
+ * @typedef { import('./types').FormProperties } FormProperties
53937
+ * @typedef { import('./types').FormProperty } FormProperty
53938
+ * @typedef { import('./types').FormEvent } FormEvent
53939
+ * @typedef { import('./types').FormOptions } FormOptions
53940
+ *
53941
+ * @typedef { {
53942
+ * data: Data,
53943
+ * initialData: Data,
53944
+ * errors: Errors,
53945
+ * properties: FormProperties,
53946
+ * schema: Schema
53947
+ * } } State
53948
+ *
53949
+ * @typedef { (type:FormEvent, priority:number, handler:Function) => void } OnEventWithPriority
53950
+ * @typedef { (type:FormEvent, handler:Function) => void } OnEventWithOutPriority
53951
+ * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
53922
53952
  */
53923
53953
 
53924
53954
  const ids$1 = new Ids([32, 36, 1]);
53925
53955
 
53926
- /**
53927
- * The form.
53956
+ /**
53957
+ * The form.
53928
53958
  */
53929
53959
  class Form {
53930
- /**
53931
- * @constructor
53932
- * @param {FormOptions} options
53960
+ /**
53961
+ * @constructor
53962
+ * @param {FormOptions} options
53933
53963
  */
53934
53964
  constructor(options = {}) {
53935
- /**
53936
- * @public
53937
- * @type {OnEventType}
53965
+ /**
53966
+ * @public
53967
+ * @type {OnEventType}
53938
53968
  */
53939
53969
  this.on = this._onEvent;
53940
53970
 
53941
- /**
53942
- * @public
53943
- * @type {String}
53971
+ /**
53972
+ * @public
53973
+ * @type {String}
53944
53974
  */
53945
53975
  this._id = ids$1.next();
53946
53976
 
53947
- /**
53948
- * @private
53949
- * @type {Element}
53977
+ /**
53978
+ * @private
53979
+ * @type {Element}
53950
53980
  */
53951
53981
  this._container = createFormContainer();
53952
53982
  const {
@@ -53955,9 +53985,9 @@
53955
53985
  properties = {}
53956
53986
  } = options;
53957
53987
 
53958
- /**
53959
- * @private
53960
- * @type {State}
53988
+ /**
53989
+ * @private
53990
+ * @type {State}
53961
53991
  */
53962
53992
  this._state = {
53963
53993
  initialData: null,
@@ -53981,9 +54011,9 @@
53981
54011
  this._emit('form.clear');
53982
54012
  }
53983
54013
 
53984
- /**
53985
- * Destroy the form, removing it from DOM,
53986
- * if attached.
54014
+ /**
54015
+ * Destroy the form, removing it from DOM,
54016
+ * if attached.
53987
54017
  */
53988
54018
  destroy() {
53989
54019
  // destroy form services
@@ -53994,13 +54024,13 @@
53994
54024
  this._detach(false);
53995
54025
  }
53996
54026
 
53997
- /**
53998
- * Open a form schema with the given initial data.
53999
- *
54000
- * @param {Schema} schema
54001
- * @param {Data} [data]
54002
- *
54003
- * @return Promise<{ warnings: Array<any> }>
54027
+ /**
54028
+ * Open a form schema with the given initial data.
54029
+ *
54030
+ * @param {Schema} schema
54031
+ * @param {Data} [data]
54032
+ *
54033
+ * @return Promise<{ warnings: Array<any> }>
54004
54034
  */
54005
54035
  importSchema(schema, data = {}) {
54006
54036
  return new Promise((resolve, reject) => {
@@ -54033,10 +54063,10 @@
54033
54063
  });
54034
54064
  }
54035
54065
 
54036
- /**
54037
- * Submit the form, triggering all field validations.
54038
- *
54039
- * @returns { { data: Data, errors: Errors } }
54066
+ /**
54067
+ * Submit the form, triggering all field validations.
54068
+ *
54069
+ * @returns { { data: Data, errors: Errors } }
54040
54070
  */
54041
54071
  submit() {
54042
54072
  const {
@@ -54063,8 +54093,8 @@
54063
54093
  });
54064
54094
  }
54065
54095
 
54066
- /**
54067
- * @returns {Errors}
54096
+ /**
54097
+ * @returns {Errors}
54068
54098
  */
54069
54099
  validate() {
54070
54100
  const formFieldRegistry = this.get('formFieldRegistry'),
@@ -54090,8 +54120,8 @@
54090
54120
  return errors;
54091
54121
  }
54092
54122
 
54093
- /**
54094
- * @param {Element|string} parentNode
54123
+ /**
54124
+ * @param {Element|string} parentNode
54095
54125
  */
54096
54126
  attachTo(parentNode) {
54097
54127
  if (!parentNode) {
@@ -54109,10 +54139,10 @@
54109
54139
  this._detach();
54110
54140
  }
54111
54141
 
54112
- /**
54113
- * @private
54114
- *
54115
- * @param {boolean} [emit]
54142
+ /**
54143
+ * @private
54144
+ *
54145
+ * @param {boolean} [emit]
54116
54146
  */
54117
54147
  _detach(emit = true) {
54118
54148
  const container = this._container,
@@ -54126,9 +54156,9 @@
54126
54156
  parentNode.removeChild(container);
54127
54157
  }
54128
54158
 
54129
- /**
54130
- * @param {FormProperty} property
54131
- * @param {any} value
54159
+ /**
54160
+ * @param {FormProperty} property
54161
+ * @param {any} value
54132
54162
  */
54133
54163
  setProperty(property, value) {
54134
54164
  const properties = set$3(this._getState().properties, [property], value);
@@ -54137,21 +54167,21 @@
54137
54167
  });
54138
54168
  }
54139
54169
 
54140
- /**
54141
- * @param {FormEvent} type
54142
- * @param {Function} handler
54170
+ /**
54171
+ * @param {FormEvent} type
54172
+ * @param {Function} handler
54143
54173
  */
54144
54174
  off(type, handler) {
54145
54175
  this.get('eventBus').off(type, handler);
54146
54176
  }
54147
54177
 
54148
- /**
54149
- * @private
54150
- *
54151
- * @param {FormOptions} options
54152
- * @param {Element} container
54153
- *
54154
- * @returns {Injector}
54178
+ /**
54179
+ * @private
54180
+ *
54181
+ * @param {FormOptions} options
54182
+ * @param {Element} container
54183
+ *
54184
+ * @returns {Injector}
54155
54185
  */
54156
54186
  _createInjector(options, container) {
54157
54187
  const {
@@ -54170,17 +54200,17 @@
54170
54200
  }, core$1, ...modules, ...additionalModules]);
54171
54201
  }
54172
54202
 
54173
- /**
54174
- * @private
54203
+ /**
54204
+ * @private
54175
54205
  */
54176
54206
  _emit(type, data) {
54177
54207
  this.get('eventBus').fire(type, data);
54178
54208
  }
54179
54209
 
54180
- /**
54181
- * @internal
54182
- *
54183
- * @param { { add?: boolean, field: any, remove?: number, value?: any } } update
54210
+ /**
54211
+ * @internal
54212
+ *
54213
+ * @param { { add?: boolean, field: any, remove?: number, value?: any } } update
54184
54214
  */
54185
54215
  _update(update) {
54186
54216
  const {
@@ -54202,15 +54232,15 @@
54202
54232
  });
54203
54233
  }
54204
54234
 
54205
- /**
54206
- * @internal
54235
+ /**
54236
+ * @internal
54207
54237
  */
54208
54238
  _getState() {
54209
54239
  return this._state;
54210
54240
  }
54211
54241
 
54212
- /**
54213
- * @internal
54242
+ /**
54243
+ * @internal
54214
54244
  */
54215
54245
  _setState(state) {
54216
54246
  this._state = {
@@ -54220,22 +54250,22 @@
54220
54250
  this._emit('changed', this._getState());
54221
54251
  }
54222
54252
 
54223
- /**
54224
- * @internal
54253
+ /**
54254
+ * @internal
54225
54255
  */
54226
54256
  _getModules() {
54227
54257
  return [ExpressionLanguageModule$1, MarkdownModule, ViewerCommandsModule];
54228
54258
  }
54229
54259
 
54230
- /**
54231
- * @internal
54260
+ /**
54261
+ * @internal
54232
54262
  */
54233
54263
  _onEvent(type, priority, handler) {
54234
54264
  this.get('eventBus').on(type, priority, handler);
54235
54265
  }
54236
54266
 
54237
- /**
54238
- * @internal
54267
+ /**
54268
+ * @internal
54239
54269
  */
54240
54270
  _getSubmitData() {
54241
54271
  const formFieldRegistry = this.get('formFieldRegistry'),
@@ -54263,16 +54293,16 @@
54263
54293
  return filteredSubmitData;
54264
54294
  }
54265
54295
 
54266
- /**
54267
- * @internal
54296
+ /**
54297
+ * @internal
54268
54298
  */
54269
54299
  _applyConditions(toFilter, data) {
54270
54300
  const conditionChecker = this.get('conditionChecker');
54271
54301
  return conditionChecker.applyConditions(toFilter, data);
54272
54302
  }
54273
54303
 
54274
- /**
54275
- * @internal
54304
+ /**
54305
+ * @internal
54276
54306
  */
54277
54307
  _initializeFieldData(data) {
54278
54308
  const formFieldRegistry = this.get('formFieldRegistry'),
@@ -60268,10 +60298,10 @@
60268
60298
  return fn.apply(null, args);
60269
60299
  }
60270
60300
 
60271
- /**
60272
- * A factory to create a configurable debouncer.
60273
- *
60274
- * @param {number|boolean} [config=true]
60301
+ /**
60302
+ * A factory to create a configurable debouncer.
60303
+ *
60304
+ * @param {number|boolean} [config=true]
60275
60305
  */
60276
60306
  function DebounceFactory(config = true) {
60277
60307
  const timeout = typeof config === 'number' ? config : config ? 300 : 0;
@@ -60283,11 +60313,11 @@
60283
60313
  }
60284
60314
  DebounceFactory.$inject = ['config.debounce'];
60285
60315
  class FormFieldRegistry extends FormFieldRegistry$1 {
60286
- /**
60287
- * Updates a form fields id.
60288
- *
60289
- * @param {Object} formField
60290
- * @param {string} newId
60316
+ /**
60317
+ * Updates a form fields id.
60318
+ *
60319
+ * @param {Object} formField
60320
+ * @param {string} newId
60291
60321
  */
60292
60322
  updateId(formField, newId) {
60293
60323
  this._validateId(newId);
@@ -60308,13 +60338,13 @@
60308
60338
  }
60309
60339
  }
60310
60340
 
60311
- /**
60312
- * Validate the suitability of the given id and signals a problem
60313
- * with an exception.
60314
- *
60315
- * @param {string} id
60316
- *
60317
- * @throws {Error} if id is empty or already assigned
60341
+ /**
60342
+ * Validate the suitability of the given id and signals a problem
60343
+ * with an exception.
60344
+ *
60345
+ * @param {string} id
60346
+ *
60347
+ * @throws {Error} if id is empty or already assigned
60318
60348
  */
60319
60349
  _validateId(id) {
60320
60350
  if (!id) {
@@ -60330,11 +60360,11 @@
60330
60360
  const MIN_COLUMNS = 2;
60331
60361
  const MAX_FIELDS_PER_ROW = 4;
60332
60362
  class FormLayoutValidator {
60333
- /**
60334
- * @constructor
60335
- *
60336
- * @param { import('./FormLayouter').default } formLayouter
60337
- * @param { import('./FormFieldRegistry').default } formFieldRegistry
60363
+ /**
60364
+ * @constructor
60365
+ *
60366
+ * @param { import('./FormLayouter').default } formLayouter
60367
+ * @param { import('./FormFieldRegistry').default } formFieldRegistry
60338
60368
  */
60339
60369
  constructor(formLayouter, formFieldRegistry) {
60340
60370
  this._formLayouter = formLayouter;
@@ -60404,21 +60434,21 @@
60404
60434
  });
60405
60435
  }
60406
60436
 
60407
- /**
60408
- * Add a dragger that calls back the passed function with
60409
- * { event, delta } on drag.
60410
- *
60411
- * @example
60412
- *
60413
- * function dragMove(event, delta) {
60414
- * // we are dragging (!!)
60415
- * }
60416
- *
60417
- * domElement.addEventListener('dragstart', dragger(dragMove));
60418
- *
60419
- * @param {Function} fn
60420
- *
60421
- * @return {Function} drag start callback function
60437
+ /**
60438
+ * Add a dragger that calls back the passed function with
60439
+ * { event, delta } on drag.
60440
+ *
60441
+ * @example
60442
+ *
60443
+ * function dragMove(event, delta) {
60444
+ * // we are dragging (!!)
60445
+ * }
60446
+ *
60447
+ * domElement.addEventListener('dragstart', dragger(dragMove));
60448
+ *
60449
+ * @param {Function} fn
60450
+ *
60451
+ * @return {Function} drag start callback function
60422
60452
  */
60423
60453
  function createDragger$1(fn) {
60424
60454
  let self;
@@ -60459,12 +60489,12 @@
60459
60489
  return onDragStart;
60460
60490
  }
60461
60491
 
60462
- /**
60463
- * Throttle function call according UI update cycle.
60464
- *
60465
- * @param {Function} fn
60466
- *
60467
- * @return {Function} throttled fn
60492
+ /**
60493
+ * Throttle function call according UI update cycle.
60494
+ *
60495
+ * @param {Function} fn
60496
+ *
60497
+ * @return {Function} throttled fn
60468
60498
  */
60469
60499
  function throttle(fn) {
60470
60500
  let active = false;
@@ -60497,11 +60527,11 @@
60497
60527
  });
60498
60528
  var DragAndDropContext$1 = DragAndDropContext;
60499
60529
 
60500
- /**
60501
- * @param {string} type
60502
- * @param {boolean} [strict]
60503
- *
60504
- * @returns {any}
60530
+ /**
60531
+ * @param {string} type
60532
+ * @param {boolean} [strict]
60533
+ *
60534
+ * @returns {any}
60505
60535
  */
60506
60536
  function getService$1(type, strict) {}
60507
60537
  const FormEditorContext = D$2({
@@ -60902,23 +60932,23 @@
60902
60932
  return fillsAndSeparators;
60903
60933
  };
60904
60934
 
60905
- /**
60906
- * Creates a Fragment for a fill.
60907
- *
60908
- * @param {Object} fill Fill to be rendered
60909
- * @returns {Object} Preact Fragment containing fill's children
60935
+ /**
60936
+ * Creates a Fragment for a fill.
60937
+ *
60938
+ * @param {Object} fill Fill to be rendered
60939
+ * @returns {Object} Preact Fragment containing fill's children
60910
60940
  */
60911
60941
  const FillFragment = fill => e$1(d$1, {
60912
60942
  children: fill.children
60913
60943
  }, fill.id);
60914
60944
 
60915
- /**
60916
- * Creates an array of fills, with separators inserted between groups.
60917
- *
60918
- * @param {Array} groups Groups of fills
60919
- * @param {Function} fillRenderer Function to create a fill
60920
- * @param {Function} separatorRenderer Function to create a separator
60921
- * @returns {Array} Array of fills and separators
60945
+ /**
60946
+ * Creates an array of fills, with separators inserted between groups.
60947
+ *
60948
+ * @param {Array} groups Groups of fills
60949
+ * @param {Function} fillRenderer Function to create a fill
60950
+ * @param {Function} separatorRenderer Function to create a separator
60951
+ * @returns {Array} Array of fills and separators
60922
60952
  */
60923
60953
  const buildFills = (groups, fillRenderer, separatorRenderer) => {
60924
60954
  const result = [];
@@ -60936,8 +60966,8 @@
60936
60966
  return result;
60937
60967
  };
60938
60968
 
60939
- /**
60940
- * Groups fills by group name property.
60969
+ /**
60970
+ * Groups fills by group name property.
60941
60971
  */
60942
60972
  const _groupByGroupName = fills => {
60943
60973
  const groups = [];
@@ -60957,8 +60987,8 @@
60957
60987
  return Object.keys(groupsById).sort().map(id => groupsById[id]);
60958
60988
  };
60959
60989
 
60960
- /**
60961
- * Compares fills by priority.
60990
+ /**
60991
+ * Compares fills by priority.
60962
60992
  */
60963
60993
  const _comparePriority = (a, b) => {
60964
60994
  return (b.priority || 0) - (a.priority || 0);
@@ -61181,20 +61211,20 @@
61181
61211
  const DRAG_NO_MOVE_CLS = 'fjs-no-move';
61182
61212
  const ERROR_DROP_CLS = 'fjs-error-drop';
61183
61213
 
61184
- /**
61185
- * @typedef { { id: String, components: Array<any> } } FormRow
61214
+ /**
61215
+ * @typedef { { id: String, components: Array<any> } } FormRow
61186
61216
  */
61187
61217
 
61188
61218
  class Dragging {
61189
- /**
61190
- * @constructor
61191
- *
61192
- * @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
61193
- * @param { import('../../core/FormLayouter').default } formLayouter
61194
- * @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
61195
- * @param { import('../../core/EventBus').default } eventBus
61196
- * @param { import('../modeling/Modeling').default } modeling
61197
- * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
61219
+ /**
61220
+ * @constructor
61221
+ *
61222
+ * @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
61223
+ * @param { import('../../core/FormLayouter').default } formLayouter
61224
+ * @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
61225
+ * @param { import('../../core/EventBus').default } eventBus
61226
+ * @param { import('../modeling/Modeling').default } modeling
61227
+ * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
61198
61228
  */
61199
61229
  constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling, pathRegistry) {
61200
61230
  this._formFieldRegistry = formFieldRegistry;
@@ -61205,13 +61235,13 @@
61205
61235
  this._pathRegistry = pathRegistry;
61206
61236
  }
61207
61237
 
61208
- /**
61209
- * Calculcates position in form schema given the dropped place.
61210
- *
61211
- * @param { FormRow } targetRow
61212
- * @param { any } targetFormField
61213
- * @param { HTMLElement } sibling
61214
- * @returns { number }
61238
+ /**
61239
+ * Calculcates position in form schema given the dropped place.
61240
+ *
61241
+ * @param { FormRow } targetRow
61242
+ * @param { any } targetFormField
61243
+ * @param { HTMLElement } sibling
61244
+ * @returns { number }
61215
61245
  */
61216
61246
  getTargetIndex(targetRow, targetFormField, sibling) {
61217
61247
  /** @type HTMLElement */
@@ -61352,8 +61382,8 @@
61352
61382
  }
61353
61383
  }
61354
61384
 
61355
- /**
61356
- * @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
61385
+ /**
61386
+ * @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
61357
61387
  */
61358
61388
  createDragulaInstance(options) {
61359
61389
  const {
@@ -61764,7 +61794,7 @@
61764
61794
  return null;
61765
61795
  }
61766
61796
  return e$1("div", {
61767
- 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;",
61797
+ style: "width: fit-content; padding: 2px 6px; height: 16px; background: var(--color-blue-205-100-95); display: flex; justify-content: center; align-items: center; position: absolute; bottom: -2px; z-index: 2; font-size: 10px; right: 3px;",
61768
61798
  class: "fjs-debug-columns",
61769
61799
  children: (field.layout || {}).columns || 'auto'
61770
61800
  });
@@ -62823,10 +62853,10 @@
62823
62853
  return formField;
62824
62854
  }
62825
62855
  class AddFormFieldHandler {
62826
- /**
62827
- * @constructor
62828
- * @param { import('../../../FormEditor').default } formEditor
62829
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
62856
+ /**
62857
+ * @constructor
62858
+ * @param { import('../../../FormEditor').default } formEditor
62859
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
62830
62860
  */
62831
62861
  constructor(formEditor, formFieldRegistry) {
62832
62862
  this._formEditor = formEditor;
@@ -62886,10 +62916,10 @@
62886
62916
  }
62887
62917
  AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
62888
62918
  class EditFormFieldHandler {
62889
- /**
62890
- * @constructor
62891
- * @param { import('../../../FormEditor').default } formEditor
62892
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
62919
+ /**
62920
+ * @constructor
62921
+ * @param { import('../../../FormEditor').default } formEditor
62922
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
62893
62923
  */
62894
62924
  constructor(formEditor, formFieldRegistry) {
62895
62925
  this._formEditor = formEditor;
@@ -62951,11 +62981,11 @@
62951
62981
  }
62952
62982
  EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
62953
62983
  class MoveFormFieldHandler {
62954
- /**
62955
- * @constructor
62956
- * @param { import('../../../FormEditor').default } formEditor
62957
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
62958
- * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
62984
+ /**
62985
+ * @constructor
62986
+ * @param { import('../../../FormEditor').default } formEditor
62987
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
62988
+ * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
62959
62989
  */
62960
62990
  constructor(formEditor, formFieldRegistry, pathRegistry) {
62961
62991
  this._formEditor = formEditor;
@@ -63059,10 +63089,10 @@
63059
63089
  }
63060
63090
  MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry', 'pathRegistry'];
63061
63091
  class RemoveFormFieldHandler {
63062
- /**
63063
- * @constructor
63064
- * @param { import('../../../FormEditor').default } formEditor
63065
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
63092
+ /**
63093
+ * @constructor
63094
+ * @param { import('../../../FormEditor').default } formEditor
63095
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
63066
63096
  */
63067
63097
  constructor(formEditor, formFieldRegistry) {
63068
63098
  this._formEditor = formEditor;
@@ -63121,9 +63151,9 @@
63121
63151
  }
63122
63152
  RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
63123
63153
  class UpdateIdClaimHandler {
63124
- /**
63125
- * @constructor
63126
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
63154
+ /**
63155
+ * @constructor
63156
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
63127
63157
  */
63128
63158
  constructor(formFieldRegistry) {
63129
63159
  this._formFieldRegistry = formFieldRegistry;
@@ -63155,9 +63185,9 @@
63155
63185
  }
63156
63186
  UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
63157
63187
  class UpdateKeyClaimHandler {
63158
- /**
63159
- * @constructor
63160
- * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
63188
+ /**
63189
+ * @constructor
63190
+ * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
63161
63191
  */
63162
63192
  constructor(pathRegistry) {
63163
63193
  this._pathRegistry = pathRegistry;
@@ -63197,9 +63227,9 @@
63197
63227
  }
63198
63228
  UpdateKeyClaimHandler.$inject = ['pathRegistry'];
63199
63229
  class UpdatePathClaimHandler {
63200
- /**
63201
- * @constructor
63202
- * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
63230
+ /**
63231
+ * @constructor
63232
+ * @param { import('@bpmn-io/form-js-viewer').PathRegistry } pathRegistry
63203
63233
  */
63204
63234
  constructor(pathRegistry) {
63205
63235
  this._pathRegistry = pathRegistry;
@@ -63755,8 +63785,8 @@
63755
63785
  constructor(eventBus) {
63756
63786
  super(eventBus);
63757
63787
 
63758
- /**
63759
- * Remove custom validation if <validationType> is about to be added.
63788
+ /**
63789
+ * Remove custom validation if <validationType> is about to be added.
63760
63790
  */
63761
63791
  this.preExecute('formField.edit', function (context) {
63762
63792
  const {
@@ -64331,22 +64361,22 @@
64331
64361
  selectionBehavior: ['type', SelectionBehavior]
64332
64362
  };
64333
64363
 
64334
- /**
64335
- * Base class for sectionable UI modules.
64336
- *
64337
- * @property {EventBus} _eventBus - EventBus instance used for event handling.
64338
- * @property {string} managerType - Type of the render manager. Used to form event names.
64339
- *
64340
- * @class SectionModuleBase
64364
+ /**
64365
+ * Base class for sectionable UI modules.
64366
+ *
64367
+ * @property {EventBus} _eventBus - EventBus instance used for event handling.
64368
+ * @property {string} managerType - Type of the render manager. Used to form event names.
64369
+ *
64370
+ * @class SectionModuleBase
64341
64371
  */
64342
64372
  class SectionModuleBase {
64343
- /**
64344
- * Create a SectionModuleBase instance.
64345
- *
64346
- * @param {any} eventBus - The EventBus instance used for event handling.
64347
- * @param {string} sectionKey - The type of render manager. Used to form event names.
64348
- *
64349
- * @constructor
64373
+ /**
64374
+ * Create a SectionModuleBase instance.
64375
+ *
64376
+ * @param {any} eventBus - The EventBus instance used for event handling.
64377
+ * @param {string} sectionKey - The type of render manager. Used to form event names.
64378
+ *
64379
+ * @constructor
64350
64380
  */
64351
64381
  constructor(eventBus, sectionKey) {
64352
64382
  this._eventBus = eventBus;
@@ -64359,10 +64389,10 @@
64359
64389
  });
64360
64390
  }
64361
64391
 
64362
- /**
64363
- * Attach the managed section to a parent node.
64364
- *
64365
- * @param {HTMLElement} container - The parent node to attach to.
64392
+ /**
64393
+ * Attach the managed section to a parent node.
64394
+ *
64395
+ * @param {HTMLElement} container - The parent node to attach to.
64366
64396
  */
64367
64397
  attachTo(container) {
64368
64398
  this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.attach`, {
@@ -64370,22 +64400,22 @@
64370
64400
  }));
64371
64401
  }
64372
64402
 
64373
- /**
64374
- * Detach the managed section from its parent node.
64403
+ /**
64404
+ * Detach the managed section from its parent node.
64375
64405
  */
64376
64406
  detach() {
64377
64407
  this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.detach`));
64378
64408
  }
64379
64409
 
64380
- /**
64381
- * Reset the managed section to its initial state.
64410
+ /**
64411
+ * Reset the managed section to its initial state.
64382
64412
  */
64383
64413
  reset() {
64384
64414
  this._onceSectionRendered(() => this._eventBus.fire(`${this._sectionKey}.reset`));
64385
64415
  }
64386
64416
 
64387
- /**
64388
- * Circumvents timing issues.
64417
+ /**
64418
+ * Circumvents timing issues.
64389
64419
  */
64390
64420
  _onceSectionRendered(callback) {
64391
64421
  if (this.isSectionRendered) {
@@ -64633,18 +64663,25 @@
64633
64663
  parent
64634
64664
  } = props;
64635
64665
  const [visible, setShow] = l$2(false);
64666
+ const [focusedViaKeyboard, setFocusedViaKeyboard] = l$2(false);
64636
64667
  let timeout = null;
64637
64668
  const wrapperRef = s$1(null);
64638
64669
  const tooltipRef = s$1(null);
64639
64670
  const showTooltip = async event => {
64640
- const show = () => !visible && setShow(true);
64641
- if (event instanceof MouseEvent) {
64642
- timeout = setTimeout(show, 200);
64643
- } else {
64644
- show();
64671
+ const show = () => setShow(true);
64672
+ if (!visible && !timeout) {
64673
+ if (event instanceof MouseEvent) {
64674
+ timeout = setTimeout(show, 200);
64675
+ } else {
64676
+ show();
64677
+ setFocusedViaKeyboard(true);
64678
+ }
64645
64679
  }
64646
64680
  };
64647
- const hideTooltip = () => setShow(false);
64681
+ const hideTooltip = () => {
64682
+ setShow(false);
64683
+ setFocusedViaKeyboard(false);
64684
+ };
64648
64685
  const hideTooltipViaEscape = e => {
64649
64686
  e.code === 'Escape' && hideTooltip();
64650
64687
  };
@@ -64668,7 +64705,7 @@
64668
64705
  if (visible && !isTooltipHovered({
64669
64706
  x: e.x,
64670
64707
  y: e.y
64671
- }) && !isFocused) {
64708
+ }) && !(isFocused && focusedViaKeyboard)) {
64672
64709
  hideTooltip();
64673
64710
  }
64674
64711
  };
@@ -64676,8 +64713,8 @@
64676
64713
  const {
64677
64714
  relatedTarget
64678
64715
  } = e;
64679
- const isTooltipChild = el => el && !!el.closest('.bio-properties-panel-tooltip');
64680
- if (visible && !isHovered(wrapperRef.current) && !isTooltipChild(relatedTarget)) {
64716
+ const isTooltipChild = el => !!el.closest('.bio-properties-panel-tooltip');
64717
+ if (visible && !isHovered(wrapperRef.current) && relatedTarget && !isTooltipChild(relatedTarget)) {
64681
64718
  hideTooltip();
64682
64719
  }
64683
64720
  };
@@ -64689,7 +64726,7 @@
64689
64726
  document.removeEventListener('mousemove', hideHoveredTooltip);
64690
64727
  document.removeEventListener('focusout', hideFocusedTooltip);
64691
64728
  };
64692
- }, [wrapperRef.current, visible]);
64729
+ }, [wrapperRef.current, visible, focusedViaKeyboard]);
64693
64730
  const renderTooltip = () => {
64694
64731
  return e$1("div", {
64695
64732
  class: "bio-properties-panel-tooltip",
@@ -64712,12 +64749,12 @@
64712
64749
  tabIndex: "0",
64713
64750
  ref: wrapperRef,
64714
64751
  onMouseEnter: showTooltip,
64715
- onMouseLeave: () => clearTimeout(timeout),
64752
+ onMouseLeave: () => {
64753
+ clearTimeout(timeout);
64754
+ timeout = null;
64755
+ },
64716
64756
  onFocus: showTooltip,
64717
64757
  onKeyDown: hideTooltipViaEscape,
64718
- onMouseDown: e => {
64719
- e.preventDefault();
64720
- },
64721
64758
  children: [props.children, visible ? parent ? W(renderTooltip(), parent.current) : renderTooltip() : null]
64722
64759
  });
64723
64760
  }
@@ -65027,7 +65064,8 @@
65027
65064
  class: classNames('bio-properties-panel-group-header', edited ? '' : 'empty', open ? 'open' : '', sticky && open ? 'sticky' : ''),
65028
65065
  onClick: toggleOpen,
65029
65066
  children: [e$1("div", {
65030
- title: label,
65067
+ title: props.tooltip ? null : label,
65068
+ "data-title": label,
65031
65069
  class: "bio-properties-panel-group-header-title",
65032
65070
  children: e$1(TooltipWrapper, {
65033
65071
  value: props.tooltip,
@@ -65469,6 +65507,7 @@
65469
65507
  * @param {Object} props
65470
65508
  * @param {HTMLElement} [props.container]
65471
65509
  * @param {string} [props.className]
65510
+ * @param {boolean} [props.delayInitialFocus]
65472
65511
  * @param {{x: number, y: number}} [props.position]
65473
65512
  * @param {number} [props.width]
65474
65513
  * @param {number} [props.height]
@@ -65476,12 +65515,14 @@
65476
65515
  * @param {Function} [props.onPostActivate]
65477
65516
  * @param {Function} [props.onPostDeactivate]
65478
65517
  * @param {boolean} [props.returnFocus]
65518
+ * @param {boolean} [props.closeOnEscape]
65479
65519
  * @param {string} props.title
65480
65520
  */
65481
65521
  function Popup(props) {
65482
65522
  const {
65483
65523
  container,
65484
65524
  className,
65525
+ delayInitialFocus,
65485
65526
  position,
65486
65527
  width,
65487
65528
  height,
@@ -65489,12 +65530,15 @@
65489
65530
  onPostActivate = noop$3,
65490
65531
  onPostDeactivate = noop$3,
65491
65532
  returnFocus = true,
65533
+ closeOnEscape = true,
65492
65534
  title
65493
65535
  } = props;
65494
65536
  const focusTrapRef = s$1(null);
65495
65537
  const popupRef = s$1(null);
65496
- const handleKeyPress = event => {
65497
- if (event.key === 'Escape') {
65538
+ const handleKeydown = event => {
65539
+ // do not allow keyboard events to bubble
65540
+ event.stopPropagation();
65541
+ if (closeOnEscape && event.key === 'Escape') {
65498
65542
  onClose();
65499
65543
  }
65500
65544
  };
@@ -65519,14 +65563,6 @@
65519
65563
  if (height) {
65520
65564
  style.height = height + 'px';
65521
65565
  }
65522
- y(() => {
65523
- if (popupRef.current) {
65524
- popupRef.current.addEventListener('keydown', handleKeyPress);
65525
- }
65526
- return () => {
65527
- popupRef.current.removeEventListener('keydown', handleKeyPress);
65528
- };
65529
- }, [popupRef]);
65530
65566
  y(() => {
65531
65567
  if (popupRef.current) {
65532
65568
  popupRef.current.addEventListener('focusin', handleFocus);
@@ -65539,6 +65575,7 @@
65539
65575
  if (popupRef.current) {
65540
65576
  focusTrapRef.current = createFocusTrap(popupRef.current, {
65541
65577
  clickOutsideDeactivates: true,
65578
+ delayInitialFocus,
65542
65579
  fallbackFocus: popupRef.current,
65543
65580
  onPostActivate,
65544
65581
  onPostDeactivate,
@@ -65552,6 +65589,7 @@
65552
65589
  "aria-label": title,
65553
65590
  tabIndex: -1,
65554
65591
  ref: popupRef,
65592
+ onKeyDown: handleKeydown,
65555
65593
  role: "dialog",
65556
65594
  class: classNames('bio-properties-panel-popup', className),
65557
65595
  style: style,
@@ -65664,22 +65702,36 @@
65664
65702
  */
65665
65703
  function FEELPopupRoot(props) {
65666
65704
  const {
65667
- element
65705
+ element,
65706
+ eventBus = {
65707
+ fire() {},
65708
+ on() {},
65709
+ off() {}
65710
+ },
65711
+ popupContainer
65668
65712
  } = props;
65669
65713
  const prevElement = usePrevious(element);
65670
65714
  const [popupConfig, setPopupConfig] = l$2({});
65671
65715
  const [open, setOpen] = l$2(false);
65672
65716
  const [source, setSource] = l$2(null);
65673
65717
  const [sourceElement, setSourceElement] = l$2(null);
65674
- const handleOpen = (key, config, _sourceElement) => {
65675
- setSource(key);
65718
+ const emit = (type, context) => {
65719
+ eventBus.fire('feelPopup.' + type, context);
65720
+ };
65721
+ const isOpen = A$1(() => {
65722
+ return !!open;
65723
+ }, [open]);
65724
+ const handleOpen = (entryId, config, _sourceElement) => {
65725
+ setSource(entryId);
65676
65726
  setPopupConfig(config);
65677
65727
  setOpen(true);
65678
65728
  setSourceElement(_sourceElement);
65729
+ emit('opened');
65679
65730
  };
65680
65731
  const handleClose = () => {
65681
65732
  setOpen(false);
65682
65733
  setSource(null);
65734
+ emit('closed');
65683
65735
  };
65684
65736
  const feelPopupContext = {
65685
65737
  open: handleOpen,
@@ -65689,14 +65741,38 @@
65689
65741
 
65690
65742
  // close popup on element change, cf. https://github.com/bpmn-io/properties-panel/issues/270
65691
65743
  y(() => {
65692
- if (element && element !== prevElement) {
65744
+ if (element && prevElement && element !== prevElement) {
65693
65745
  handleClose();
65694
65746
  }
65695
65747
  }, [element]);
65748
+
65749
+ // allow close and open via events
65750
+ y(() => {
65751
+ const handlePopupOpen = context => {
65752
+ const {
65753
+ entryId,
65754
+ popupConfig,
65755
+ sourceElement
65756
+ } = context;
65757
+ handleOpen(entryId, popupConfig, sourceElement);
65758
+ };
65759
+ const handleIsOpen = () => {
65760
+ return isOpen();
65761
+ };
65762
+ eventBus.on('feelPopup._close', handleClose);
65763
+ eventBus.on('feelPopup._open', handlePopupOpen);
65764
+ eventBus.on('feelPopup._isOpen', handleIsOpen);
65765
+ return () => {
65766
+ eventBus.off('feelPopup._close', handleClose);
65767
+ eventBus.off('feelPopup._open', handleOpen);
65768
+ eventBus.off('feelPopup._isOpen', handleIsOpen);
65769
+ };
65770
+ }, [eventBus, isOpen]);
65696
65771
  return e$1(FeelPopupContext.Provider, {
65697
65772
  value: feelPopupContext,
65698
65773
  children: [open && e$1(FeelPopupComponent, {
65699
65774
  onClose: handleClose,
65775
+ container: popupContainer,
65700
65776
  sourceElement: sourceElement,
65701
65777
  ...popupConfig
65702
65778
  }), props.children]
@@ -65704,6 +65780,7 @@
65704
65780
  }
65705
65781
  function FeelPopupComponent(props) {
65706
65782
  const {
65783
+ container,
65707
65784
  id,
65708
65785
  hostLanguage,
65709
65786
  onInput,
@@ -65718,16 +65795,30 @@
65718
65795
  variables
65719
65796
  } = props;
65720
65797
  const editorRef = s$1();
65798
+ const isAutoCompletionOpen = s$1(false);
65721
65799
  const handleSetReturnFocus = () => {
65722
65800
  sourceElement && sourceElement.focus();
65723
65801
  };
65724
- y(() => {
65725
- const editor = editorRef.current;
65726
- if (editor) {
65727
- editor.focus();
65802
+ const onKeyDownCapture = event => {
65803
+ // we use capture here to make sure we handle the event before the editor does
65804
+ if (event.key === 'Escape') {
65805
+ isAutoCompletionOpen.current = autoCompletionOpen(event.target);
65806
+ }
65807
+ };
65808
+ const onKeyDown = event => {
65809
+ if (event.key === 'Escape') {
65810
+ // close popup only if auto completion is not open
65811
+ // we need to do check this because the editor is not
65812
+ // stop propagating the keydown event
65813
+ // cf. https://discuss.codemirror.net/t/how-can-i-replace-the-default-autocompletion-keymap-v6/3322/5
65814
+ if (!isAutoCompletionOpen.current) {
65815
+ onClose();
65816
+ isAutoCompletionOpen.current = false;
65817
+ }
65728
65818
  }
65729
- }, [editorRef, id]);
65819
+ };
65730
65820
  return e$1(Popup, {
65821
+ container: container,
65731
65822
  className: "bio-properties-panel-feel-popup",
65732
65823
  position: position,
65733
65824
  title: title,
@@ -65737,6 +65828,8 @@
65737
65828
  ,
65738
65829
 
65739
65830
  returnFocus: false,
65831
+ closeOnEscape: false,
65832
+ delayInitialFocus: false,
65740
65833
  onPostDeactivate: handleSetReturnFocus,
65741
65834
  height: FEEL_POPUP_HEIGHT,
65742
65835
  width: FEEL_POPUP_WIDTH,
@@ -65745,6 +65838,8 @@
65745
65838
  draggable: true
65746
65839
  }), e$1(Popup.Body, {
65747
65840
  children: e$1("div", {
65841
+ onKeyDownCapture: onKeyDownCapture,
65842
+ onKeyDown: onKeyDown,
65748
65843
  class: "bio-properties-panel-feel-popup__body",
65749
65844
  children: [type === 'feel' && e$1(CodeEditor, {
65750
65845
  enableGutters: true,
@@ -65786,6 +65881,9 @@
65786
65881
  function prefixId$8(id) {
65787
65882
  return `bio-properties-panel-${id}`;
65788
65883
  }
65884
+ function autoCompletionOpen(element) {
65885
+ return element.closest('.cm-editor').querySelector('.cm-tooltip-autocomplete');
65886
+ }
65789
65887
  function ToggleSwitch(props) {
65790
65888
  const {
65791
65889
  id,
@@ -66532,7 +66630,7 @@
66532
66630
  setLocalError(err);
66533
66631
  }, []);
66534
66632
  const temporaryError = useError(id);
66535
- const error = localError || temporaryError || validationError;
66633
+ const error = temporaryError || localError || validationError;
66536
66634
  return e$1("div", {
66537
66635
  class: classNames(props.class, 'bio-properties-panel-entry', error ? 'has-error' : ''),
66538
66636
  "data-entry-id": id,
@@ -66768,6 +66866,7 @@
66768
66866
  * @param {Function} [props.descriptionLoaded]
66769
66867
  * @param {TooltipConfig} [props.tooltipConfig]
66770
66868
  * @param {Function} [props.tooltipLoaded]
66869
+ * @param {HTMLElement} [props.feelPopupContainer]
66771
66870
  * @param {Object} [props.eventBus]
66772
66871
  */
66773
66872
  function PropertiesPanel(props) {
@@ -66782,6 +66881,7 @@
66782
66881
  descriptionLoaded,
66783
66882
  tooltipConfig,
66784
66883
  tooltipLoaded,
66884
+ feelPopupContainer,
66785
66885
  eventBus
66786
66886
  } = props;
66787
66887
 
@@ -66884,6 +66984,8 @@
66884
66984
  value: eventContext,
66885
66985
  children: e$1(FEELPopupRoot, {
66886
66986
  element: element,
66987
+ eventBus: eventBus,
66988
+ popupContainer: feelPopupContainer,
66887
66989
  children: e$1("div", {
66888
66990
  class: "bio-properties-panel",
66889
66991
  children: [e$1(Header, {
@@ -67183,7 +67285,8 @@
67183
67285
  class: classNames('bio-properties-panel-group-header', hasItems ? '' : 'empty', hasItems && open ? 'open' : '', sticky && open ? 'sticky' : ''),
67184
67286
  onClick: hasItems ? toggleOpen : noop$1,
67185
67287
  children: [e$1("div", {
67186
- title: label,
67288
+ title: props.tooltip ? null : label,
67289
+ "data-title": label,
67187
67290
  class: "bio-properties-panel-group-header-title",
67188
67291
  children: e$1(TooltipWrapper, {
67189
67292
  value: props.tooltip,
@@ -67821,12 +67924,51 @@
67821
67924
  function prefixId(id) {
67822
67925
  return `bio-properties-panel-${id}`;
67823
67926
  }
67927
+ class FeelPopupModule {
67928
+ constructor(eventBus) {
67929
+ this._eventBus = eventBus;
67930
+ }
67824
67931
 
67825
- /**
67826
- * @param {string} type
67827
- * @param {boolean} [strict]
67828
- *
67829
- * @returns {any}
67932
+ /**
67933
+ * Check if the FEEL popup is open.
67934
+ * @return {Boolean}
67935
+ */
67936
+ isOpen() {
67937
+ return this._eventBus.fire('feelPopup._isOpen');
67938
+ }
67939
+
67940
+ /**
67941
+ * Open the FEEL popup.
67942
+ *
67943
+ * @param {String} entryId
67944
+ * @param {Object} popupConfig
67945
+ * @param {HTMLElement} sourceElement
67946
+ */
67947
+ open(entryId, popupConfig, sourceElement) {
67948
+ return this._eventBus.fire('feelPopup._open', {
67949
+ entryId,
67950
+ popupConfig,
67951
+ sourceElement
67952
+ });
67953
+ }
67954
+
67955
+ /**
67956
+ * Close the FEEL popup.
67957
+ */
67958
+ close() {
67959
+ return this._eventBus.fire('feelPopup._close');
67960
+ }
67961
+ }
67962
+ FeelPopupModule.$inject = ['eventBus'];
67963
+ var index = {
67964
+ feelPopup: ['type', FeelPopupModule]
67965
+ };
67966
+
67967
+ /**
67968
+ * @param {string} type
67969
+ * @param {boolean} [strict]
67970
+ *
67971
+ * @returns {any}
67830
67972
  */
67831
67973
  function getService(type, strict) {}
67832
67974
  const PropertiesPanelContext = D$2({
@@ -67921,8 +68063,8 @@
67921
68063
  }
67922
68064
  };
67923
68065
 
67924
- /**
67925
- * Provide placeholders for empty and multiple state.
68066
+ /**
68067
+ * Provide placeholders for empty and multiple state.
67926
68068
  */
67927
68069
  const PropertiesPanelPlaceholderProvider = {
67928
68070
  getEmpty: () => {
@@ -67992,10 +68134,10 @@
67992
68134
  return getService(type, strict);
67993
68135
  }
67994
68136
 
67995
- /**
67996
- * Retrieve list of variables from the form schema.
67997
- *
67998
- * @returns { string[] } list of variables used in form schema
68137
+ /**
68138
+ * Retrieve list of variables from the form schema.
68139
+ *
68140
+ * @returns { string[] } list of variables used in form schema
67999
68141
  */
68000
68142
  function useVariables() {
68001
68143
  const form = useService('formEditor');
@@ -69624,14 +69766,14 @@
69624
69766
 
69625
69767
  // helpers //////////
69626
69768
 
69627
- /**
69628
- * Returns copy of object with updated value.
69629
- *
69630
- * @param {Object} properties
69631
- * @param {string} key
69632
- * @param {string} value
69633
- *
69634
- * @returns {Object}
69769
+ /**
69770
+ * Returns copy of object with updated value.
69771
+ *
69772
+ * @param {Object} properties
69773
+ * @param {string} key
69774
+ * @param {string} value
69775
+ *
69776
+ * @returns {Object}
69635
69777
  */
69636
69778
  function updateValue(properties, key, value) {
69637
69779
  return {
@@ -69640,14 +69782,14 @@
69640
69782
  };
69641
69783
  }
69642
69784
 
69643
- /**
69644
- * Returns copy of object with updated key.
69645
- *
69646
- * @param {Object} properties
69647
- * @param {string} oldKey
69648
- * @param {string} newKey
69649
- *
69650
- * @returns {Object}
69785
+ /**
69786
+ * Returns copy of object with updated key.
69787
+ *
69788
+ * @param {Object} properties
69789
+ * @param {string} oldKey
69790
+ * @param {string} newKey
69791
+ *
69792
+ * @returns {Object}
69651
69793
  */
69652
69794
  function updateKey(properties, oldKey, newKey) {
69653
69795
  return Object.entries(properties).reduce((newProperties, entry) => {
@@ -70449,7 +70591,8 @@
70449
70591
  id,
70450
70592
  label: 'Validation pattern',
70451
70593
  setValue,
70452
- getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS)
70594
+ getOptions: () => Object.values(VALIDATION_TYPE_OPTIONS),
70595
+ tooltip: getValue('validationType')() === VALIDATION_TYPE_OPTIONS.phone.value ? 'The built-in phone validation pattern is based on the E.164 standard with no spaces. Ex: +491234567890' : undefined
70453
70596
  });
70454
70597
  }
70455
70598
  function ValuesGroups(field, editField) {
@@ -70466,13 +70609,13 @@
70466
70609
  };
70467
70610
  const valuesSourceId = `${fieldId}-valuesSource`;
70468
70611
 
70469
- /**
70470
- * @type {Array<Group|ListGroup>}
70612
+ /**
70613
+ * @type {Array<Group|ListGroup>}
70471
70614
  */
70472
70615
  const groups = [{
70473
70616
  id: valuesSourceId,
70474
70617
  label: 'Options source',
70475
- tooltip: '"Static" defines a constant, predefined set of form options.\n"Dynamic" defines options that are populated dynamically, adjusting based on variable data for flexible responses to different conditions or inputs.',
70618
+ tooltip: getValuesTooltip(),
70476
70619
  component: Group,
70477
70620
  entries: ValuesSourceSelectEntry({
70478
70621
  ...context,
@@ -70516,6 +70659,12 @@
70516
70659
  }
70517
70660
  return groups;
70518
70661
  }
70662
+
70663
+ // helpers //////////
70664
+
70665
+ function getValuesTooltip() {
70666
+ return '"Static" defines a constant, predefined set of form options.\n\n' + '"Input data" defines options that are populated dynamically, adjusting based on variable data for flexible responses to different conditions or inputs.\n\n' + '"Expression" defines options that are populated from a FEEL expression.';
70667
+ }
70519
70668
  function CustomPropertiesGroup(field, editField) {
70520
70669
  const {
70521
70670
  properties = {},
@@ -70581,13 +70730,13 @@
70581
70730
 
70582
70731
  // helpers //////////
70583
70732
 
70584
- /**
70585
- * Returns copy of object without key.
70586
- *
70587
- * @param {Object} properties
70588
- * @param {string} oldKey
70589
- *
70590
- * @returns {Object}
70733
+ /**
70734
+ * Returns copy of object without key.
70735
+ *
70736
+ * @param {Object} properties
70737
+ * @param {string} oldKey
70738
+ *
70739
+ * @returns {Object}
70591
70740
  */
70592
70741
  function removeKey(properties, oldKey) {
70593
70742
  return Object.entries(properties).reduce((newProperties, entry) => {
@@ -70669,6 +70818,10 @@
70669
70818
  const formEditor = injector.get('formEditor');
70670
70819
  const modeling = injector.get('modeling');
70671
70820
  const selectionModule = injector.get('selection');
70821
+ const propertiesPanelConfig = injector.get('config.propertiesPanel') || {};
70822
+ const {
70823
+ feelPopupContainer
70824
+ } = propertiesPanelConfig;
70672
70825
  const [state, setState] = l$2({
70673
70826
  selectedFormField: selectionModule.get() || formEditor._getState().schema
70674
70827
  });
@@ -70686,9 +70839,9 @@
70686
70839
  });
70687
70840
  }, [eventBus, formEditor, selectionModule]);
70688
70841
  h$1(() => {
70689
- /**
70690
- * TODO(pinussilvestrus): update with actual updated element,
70691
- * once we have a proper updater/change support
70842
+ /**
70843
+ * TODO(pinussilvestrus): update with actual updated element,
70844
+ * once we have a proper updater/change support
70692
70845
  */
70693
70846
  eventBus.on('changed', refresh);
70694
70847
  eventBus.on('import.done', refresh);
@@ -70718,7 +70871,8 @@
70718
70871
  eventBus: eventBus,
70719
70872
  groups: getGroups(selectedFormField, editField, getService),
70720
70873
  headerProvider: PropertiesPanelHeaderProvider,
70721
- placeholderProvider: PropertiesPanelPlaceholderProvider
70874
+ placeholderProvider: PropertiesPanelPlaceholderProvider,
70875
+ feelPopupContainer: feelPopupContainer
70722
70876
  })
70723
70877
  })
70724
70878
  });
@@ -70739,10 +70893,10 @@
70739
70893
  });
70740
70894
  }
70741
70895
 
70742
- /**
70743
- * Attach the properties panel to a parent node.
70744
- *
70745
- * @param {HTMLElement} container
70896
+ /**
70897
+ * Attach the properties panel to a parent node.
70898
+ *
70899
+ * @param {HTMLElement} container
70746
70900
  */
70747
70901
  attachTo(container) {
70748
70902
  if (!container) {
@@ -70762,8 +70916,8 @@
70762
70916
  this._eventBus.fire('propertiesPanel.attach');
70763
70917
  }
70764
70918
 
70765
- /**
70766
- * Detach the properties panel from its parent node.
70919
+ /**
70920
+ * Detach the properties panel from its parent node.
70767
70921
  */
70768
70922
  detach() {
70769
70923
  const parentNode = this._container.parentNode;
@@ -70788,14 +70942,15 @@
70788
70942
  }
70789
70943
  PropertiesPanelRenderer.$inject = ['config.propertiesPanel', 'injector', 'eventBus'];
70790
70944
  var PropertiesPanelModule = {
70945
+ __depends__: [index],
70791
70946
  __init__: ['propertiesPanel'],
70792
70947
  propertiesPanel: ['type', PropertiesPanelRenderer]
70793
70948
  };
70794
70949
 
70795
- /**
70796
- * Manages the rendering of visual plugins.
70797
- * @constructor
70798
- * @param {Object} eventBus - Event bus for the application.
70950
+ /**
70951
+ * Manages the rendering of visual plugins.
70952
+ * @constructor
70953
+ * @param {Object} eventBus - Event bus for the application.
70799
70954
  */
70800
70955
  class RenderInjector extends SectionModuleBase {
70801
70956
  constructor(eventBus) {
@@ -70804,10 +70959,10 @@
70804
70959
  this.registeredRenderers = [];
70805
70960
  }
70806
70961
 
70807
- /**
70808
- * Inject a new renderer into the injector.
70809
- * @param {string} identifier - Identifier for the renderer.
70810
- * @param {Function} Renderer - The renderer function.
70962
+ /**
70963
+ * Inject a new renderer into the injector.
70964
+ * @param {string} identifier - Identifier for the renderer.
70965
+ * @param {Function} Renderer - The renderer function.
70811
70966
  */
70812
70967
  attachRenderer(identifier, Renderer) {
70813
70968
  this.registeredRenderers = [...this.registeredRenderers, {
@@ -70816,17 +70971,17 @@
70816
70971
  }];
70817
70972
  }
70818
70973
 
70819
- /**
70820
- * Detach a renderer from the by key injector.
70821
- * @param {string} identifier - Identifier for the renderer.
70974
+ /**
70975
+ * Detach a renderer from the by key injector.
70976
+ * @param {string} identifier - Identifier for the renderer.
70822
70977
  */
70823
70978
  detachRenderer(identifier) {
70824
70979
  this.registeredRenderers = this.registeredRenderers.filter(r => r.identifier !== identifier);
70825
70980
  }
70826
70981
 
70827
- /**
70828
- * Returns the registered renderers.
70829
- * @returns {Array} Array of registered renderers.
70982
+ /**
70983
+ * Returns the registered renderers.
70984
+ * @returns {Array} Array of registered renderers.
70830
70985
  */
70831
70986
  fetchRenderers() {
70832
70987
  return this.registeredRenderers;
@@ -70856,48 +71011,48 @@
70856
71011
  };
70857
71012
  const ids = new Ids([32, 36, 1]);
70858
71013
 
70859
- /**
70860
- * @typedef { import('./types').Injector } Injector
70861
- * @typedef { import('./types').Module } Module
70862
- * @typedef { import('./types').Schema } Schema
70863
- *
70864
- * @typedef { import('./types').FormEditorOptions } FormEditorOptions
70865
- * @typedef { import('./types').FormEditorProperties } FormEditorProperties
70866
- *
70867
- * @typedef { {
70868
- * properties: FormEditorProperties,
70869
- * schema: Schema
70870
- * } } State
70871
- *
70872
- * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
70873
- * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
70874
- * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
71014
+ /**
71015
+ * @typedef { import('./types').Injector } Injector
71016
+ * @typedef { import('./types').Module } Module
71017
+ * @typedef { import('./types').Schema } Schema
71018
+ *
71019
+ * @typedef { import('./types').FormEditorOptions } FormEditorOptions
71020
+ * @typedef { import('./types').FormEditorProperties } FormEditorProperties
71021
+ *
71022
+ * @typedef { {
71023
+ * properties: FormEditorProperties,
71024
+ * schema: Schema
71025
+ * } } State
71026
+ *
71027
+ * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
71028
+ * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
71029
+ * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
70875
71030
  */
70876
71031
 
70877
- /**
70878
- * The form editor.
71032
+ /**
71033
+ * The form editor.
70879
71034
  */
70880
71035
  class FormEditor {
70881
- /**
70882
- * @constructor
70883
- * @param {FormEditorOptions} options
71036
+ /**
71037
+ * @constructor
71038
+ * @param {FormEditorOptions} options
70884
71039
  */
70885
71040
  constructor(options = {}) {
70886
- /**
70887
- * @public
70888
- * @type {OnEventType}
71041
+ /**
71042
+ * @public
71043
+ * @type {OnEventType}
70889
71044
  */
70890
71045
  this.on = this._onEvent;
70891
71046
 
70892
- /**
70893
- * @public
70894
- * @type {String}
71047
+ /**
71048
+ * @public
71049
+ * @type {String}
70895
71050
  */
70896
71051
  this._id = ids.next();
70897
71052
 
70898
- /**
70899
- * @private
70900
- * @type {Element}
71053
+ /**
71054
+ * @private
71055
+ * @type {Element}
70901
71056
  */
70902
71057
  this._container = createFormContainer();
70903
71058
  this._container.setAttribute('input-handle-modified-keys', 'z,y');
@@ -70908,15 +71063,15 @@
70908
71063
  properties = {}
70909
71064
  } = options;
70910
71065
 
70911
- /**
70912
- * @private
70913
- * @type {any}
71066
+ /**
71067
+ * @private
71068
+ * @type {any}
70914
71069
  */
70915
71070
  this.exporter = exporter;
70916
71071
 
70917
- /**
70918
- * @private
70919
- * @type {State}
71072
+ /**
71073
+ * @private
71074
+ * @type {State}
70920
71075
  */
70921
71076
  this._state = {
70922
71077
  properties,
@@ -70945,10 +71100,10 @@
70945
71100
  this._detach(false);
70946
71101
  }
70947
71102
 
70948
- /**
70949
- * @param {Schema} schema
70950
- *
70951
- * @return {Promise<{ warnings: Array<any> }>}
71103
+ /**
71104
+ * @param {Schema} schema
71105
+ *
71106
+ * @return {Promise<{ warnings: Array<any> }>}
70952
71107
  */
70953
71108
  importSchema(schema) {
70954
71109
  return new Promise((resolve, reject) => {
@@ -70977,15 +71132,15 @@
70977
71132
  });
70978
71133
  }
70979
71134
 
70980
- /**
70981
- * @returns {Schema}
71135
+ /**
71136
+ * @returns {Schema}
70982
71137
  */
70983
71138
  saveSchema() {
70984
71139
  return this.getSchema();
70985
71140
  }
70986
71141
 
70987
- /**
70988
- * @returns {Schema}
71142
+ /**
71143
+ * @returns {Schema}
70989
71144
  */
70990
71145
  getSchema() {
70991
71146
  const {
@@ -70994,8 +71149,8 @@
70994
71149
  return exportSchema(schema, this.exporter, schemaVersion);
70995
71150
  }
70996
71151
 
70997
- /**
70998
- * @param {Element|string} parentNode
71152
+ /**
71153
+ * @param {Element|string} parentNode
70999
71154
  */
71000
71155
  attachTo(parentNode) {
71001
71156
  if (!parentNode) {
@@ -71013,10 +71168,10 @@
71013
71168
  this._detach();
71014
71169
  }
71015
71170
 
71016
- /**
71017
- * @internal
71018
- *
71019
- * @param {boolean} [emit]
71171
+ /**
71172
+ * @internal
71173
+ *
71174
+ * @param {boolean} [emit]
71020
71175
  */
71021
71176
  _detach(emit = true) {
71022
71177
  const container = this._container,
@@ -71030,9 +71185,9 @@
71030
71185
  parentNode.removeChild(container);
71031
71186
  }
71032
71187
 
71033
- /**
71034
- * @param {any} property
71035
- * @param {any} value
71188
+ /**
71189
+ * @param {any} property
71190
+ * @param {any} value
71036
71191
  */
71037
71192
  setProperty(property, value) {
71038
71193
  const properties = set$2(this._getState().properties, [property], value);
@@ -71041,21 +71196,21 @@
71041
71196
  });
71042
71197
  }
71043
71198
 
71044
- /**
71045
- * @param {string} type
71046
- * @param {Function} handler
71199
+ /**
71200
+ * @param {string} type
71201
+ * @param {Function} handler
71047
71202
  */
71048
71203
  off(type, handler) {
71049
71204
  this.get('eventBus').off(type, handler);
71050
71205
  }
71051
71206
 
71052
- /**
71053
- * @internal
71054
- *
71055
- * @param {FormEditorOptions} options
71056
- * @param {Element} container
71057
- *
71058
- * @returns {Injector}
71207
+ /**
71208
+ * @internal
71209
+ *
71210
+ * @param {FormEditorOptions} options
71211
+ * @param {Element} container
71212
+ *
71213
+ * @returns {Injector}
71059
71214
  */
71060
71215
  _createInjector(options, container) {
71061
71216
  const {
@@ -71077,22 +71232,22 @@
71077
71232
  }, core, ...modules, ...additionalModules]);
71078
71233
  }
71079
71234
 
71080
- /**
71081
- * @internal
71235
+ /**
71236
+ * @internal
71082
71237
  */
71083
71238
  _emit(type, data) {
71084
71239
  this.get('eventBus').fire(type, data);
71085
71240
  }
71086
71241
 
71087
- /**
71088
- * @internal
71242
+ /**
71243
+ * @internal
71089
71244
  */
71090
71245
  _getState() {
71091
71246
  return this._state;
71092
71247
  }
71093
71248
 
71094
- /**
71095
- * @internal
71249
+ /**
71250
+ * @internal
71096
71251
  */
71097
71252
  _setState(state) {
71098
71253
  this._state = {
@@ -71102,15 +71257,15 @@
71102
71257
  this._emit('changed', this._getState());
71103
71258
  }
71104
71259
 
71105
- /**
71106
- * @internal
71260
+ /**
71261
+ * @internal
71107
71262
  */
71108
71263
  _getModules() {
71109
71264
  return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule, RenderInjectionModule];
71110
71265
  }
71111
71266
 
71112
- /**
71113
- * @internal
71267
+ /**
71268
+ * @internal
71114
71269
  */
71115
71270
  _onEvent(type, priority, handler) {
71116
71271
  this.get('eventBus').on(type, priority, handler);
@@ -72613,8 +72768,8 @@
72613
72768
  return new LanguageSupport(jsonLanguage);
72614
72769
  }
72615
72770
 
72616
- /**
72617
- * @type {Facet<import('..').Variables>} Variables
72771
+ /**
72772
+ * @type {Facet<import('..').Variables>} Variables
72618
72773
  */
72619
72774
  const variablesFacet = Facet.define();
72620
72775
 
@@ -72791,11 +72946,11 @@
72791
72946
 
72792
72947
  const NO_LINT_CLS = 'fjs-no-json-lint';
72793
72948
 
72794
- /**
72795
- * @param {object} options
72796
- * @param {boolean} [options.readonly]
72797
- * @param {object} [options.contentAttributes]
72798
- * @param {string | HTMLElement} [options.placeholder]
72949
+ /**
72950
+ * @param {object} options
72951
+ * @param {boolean} [options.readonly]
72952
+ * @param {object} [options.contentAttributes]
72953
+ * @param {string | HTMLElement} [options.placeholder]
72799
72954
  */
72800
72955
  function JSONEditor(options = {}) {
72801
72956
  const {
@@ -72808,8 +72963,8 @@
72808
72963
  let tabSize = new Compartment().of(EditorState.tabSize.of(2));
72809
72964
  let container = null;
72810
72965
 
72811
- /**
72812
- * @typedef {Array<string>} Variables
72966
+ /**
72967
+ * @typedef {Array<string>} Variables
72813
72968
  */
72814
72969
 
72815
72970
  const autocompletionConf = new Compartment();
@@ -72860,8 +73015,8 @@
72860
73015
  return view.state.doc.toString();
72861
73016
  };
72862
73017
 
72863
- /**
72864
- * @param {Variables} variables
73018
+ /**
73019
+ * @param {Variables} variables
72865
73020
  */
72866
73021
  this.setVariables = function (variables) {
72867
73022
  view.setVariables(variables);
@@ -72931,7 +73086,8 @@
72931
73086
  viewerProperties = {},
72932
73087
  editorProperties = {},
72933
73088
  viewerAdditionalModules = [],
72934
- editorAdditionalModules = []
73089
+ editorAdditionalModules = [],
73090
+ propertiesPanel: propertiesPanelConfig = {}
72935
73091
  } = props;
72936
73092
  const {
72937
73093
  display: displayActions = true
@@ -73007,7 +73163,8 @@
73007
73163
  parent: paletteContainerRef.current
73008
73164
  },
73009
73165
  propertiesPanel: {
73010
- parent: propertiesPanelContainerRef.current
73166
+ parent: propertiesPanelContainerRef.current,
73167
+ ...propertiesPanelConfig
73011
73168
  },
73012
73169
  exporter: exporterConfig,
73013
73170
  properties: {