@bpmn-io/form-js-playground 0.13.1 → 0.14.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.
@@ -49256,25 +49256,25 @@
49256
49256
  this._eventBus = eventBus;
49257
49257
  }
49258
49258
 
49259
- /**
49260
- * Determines if the given string is a FEEL expression.
49261
- *
49262
- * @param {string} value
49263
- * @returns {boolean}
49264
- *
49259
+ /**
49260
+ * Determines if the given string is a FEEL expression.
49261
+ *
49262
+ * @param {string} value
49263
+ * @returns {boolean}
49264
+ *
49265
49265
  */
49266
49266
  isExpression(value) {
49267
49267
  return isString$4(value) && value.startsWith('=');
49268
49268
  }
49269
49269
 
49270
- /**
49271
- * Retrieve variable names from a given FEEL expression.
49272
- *
49273
- * @param {string} expression
49274
- * @param {object} [options]
49275
- * @param {string} [options.type]
49276
- *
49277
- * @returns {string[]}
49270
+ /**
49271
+ * Retrieve variable names from a given FEEL expression.
49272
+ *
49273
+ * @param {string} expression
49274
+ * @param {object} [options]
49275
+ * @param {string} [options.type]
49276
+ *
49277
+ * @returns {string[]}
49278
49278
  */
49279
49279
  getVariableNames(expression, options = {}) {
49280
49280
  const {
@@ -49291,13 +49291,13 @@
49291
49291
  throw new Error('Unknown expression type: ' + options.type);
49292
49292
  }
49293
49293
 
49294
- /**
49295
- * Evaluate an expression.
49296
- *
49297
- * @param {string} expression
49298
- * @param {import('../../types').Data} [data]
49299
- *
49300
- * @returns {any}
49294
+ /**
49295
+ * Evaluate an expression.
49296
+ *
49297
+ * @param {string} expression
49298
+ * @param {import('../../types').Data} [data]
49299
+ *
49300
+ * @returns {any}
49301
49301
  */
49302
49302
  evaluate(expression, data = {}) {
49303
49303
  if (!expression) {
@@ -49348,17 +49348,17 @@
49348
49348
  return isString$4(value) && (value.startsWith('=') || /{{/.test(value));
49349
49349
  }
49350
49350
 
49351
- /**
49352
- * Evaluate a template.
49353
- *
49354
- * @param {string} template
49355
- * @param {Object<string, any>} context
49356
- * @param {Object} options
49357
- * @param {boolean} [options.debug = false]
49358
- * @param {boolean} [options.strict = false]
49359
- * @param {Function} [options.buildDebugString]
49360
- *
49361
- * @returns
49351
+ /**
49352
+ * Evaluate a template.
49353
+ *
49354
+ * @param {string} template
49355
+ * @param {Object<string, any>} context
49356
+ * @param {Object} options
49357
+ * @param {boolean} [options.debug = false]
49358
+ * @param {boolean} [options.strict = false]
49359
+ * @param {Function} [options.buildDebugString]
49360
+ *
49361
+ * @returns
49362
49362
  */
49363
49363
  evaluate(template, context = {}, options = {}) {
49364
49364
  const {
@@ -49375,9 +49375,9 @@
49375
49375
  }
49376
49376
  FeelersTemplating.$inject = [];
49377
49377
 
49378
- /**
49379
- * @typedef {object} Condition
49380
- * @property {string} [hide]
49378
+ /**
49379
+ * @typedef {object} Condition
49380
+ * @property {string} [hide]
49381
49381
  */
49382
49382
 
49383
49383
  class ConditionChecker {
@@ -49386,11 +49386,11 @@
49386
49386
  this._eventBus = eventBus;
49387
49387
  }
49388
49388
 
49389
- /**
49390
- * For given data, remove properties based on condition.
49391
- *
49392
- * @param {Object<string, any>} properties
49393
- * @param {Object<string, any>} data
49389
+ /**
49390
+ * For given data, remove properties based on condition.
49391
+ *
49392
+ * @param {Object<string, any>} properties
49393
+ * @param {Object<string, any>} data
49394
49394
  */
49395
49395
  applyConditions(properties, data = {}) {
49396
49396
  const conditions = this._getConditions();
@@ -49409,13 +49409,13 @@
49409
49409
  return newProperties;
49410
49410
  }
49411
49411
 
49412
- /**
49413
- * Check if given condition is met. Returns null for invalid/missing conditions.
49414
- *
49415
- * @param {string} condition
49416
- * @param {import('../../types').Data} [data]
49417
- *
49418
- * @returns {boolean|null}
49412
+ /**
49413
+ * Check if given condition is met. Returns null for invalid/missing conditions.
49414
+ *
49415
+ * @param {string} condition
49416
+ * @param {import('../../types').Data} [data]
49417
+ *
49418
+ * @returns {boolean|null}
49419
49419
  */
49420
49420
  check(condition, data = {}) {
49421
49421
  if (!condition) {
@@ -49436,12 +49436,12 @@
49436
49436
  }
49437
49437
  }
49438
49438
 
49439
- /**
49440
- * Check if hide condition is met.
49441
- *
49442
- * @param {Condition} condition
49443
- * @param {Object<string, any>} data
49444
- * @returns {boolean}
49439
+ /**
49440
+ * Check if hide condition is met.
49441
+ *
49442
+ * @param {Condition} condition
49443
+ * @param {Object<string, any>} data
49444
+ * @returns {boolean}
49445
49445
  */
49446
49446
  _checkHideCondition(condition, data) {
49447
49447
  if (!condition.hide) {
@@ -49482,12 +49482,12 @@
49482
49482
  this._converter = new showdownExports.Converter();
49483
49483
  }
49484
49484
 
49485
- /**
49486
- * Render markdown to HTML.
49487
- *
49488
- * @param {string} markdown - The markdown to render
49489
- *
49490
- * @returns {string} HTML
49485
+ /**
49486
+ * Render markdown to HTML.
49487
+ *
49488
+ * @param {string} markdown - The markdown to render
49489
+ *
49490
+ * @returns {string} HTML
49491
49491
  */
49492
49492
  render(markdown) {
49493
49493
  return this._converter.makeHtml(markdown);
@@ -49992,8 +49992,13 @@
49992
49992
  if (validate.pattern && value && !new RegExp(validate.pattern).test(value)) {
49993
49993
  errors = [...errors, `Field must match pattern ${validate.pattern}.`];
49994
49994
  }
49995
- if (validate.required && (isNil$1(value) || value === '')) {
49996
- errors = [...errors, 'Field is required.'];
49995
+ if (validate.required) {
49996
+ const isUncheckedCheckbox = type === 'checkbox' && value === false;
49997
+ const isUnsetValue = isNil$1(value) || value === '';
49998
+ const isEmptyMultiselect = Array.isArray(value) && value.length === 0;
49999
+ if (isUncheckedCheckbox || isUnsetValue || isEmptyMultiselect) {
50000
+ errors = [...errors, 'Field is required.'];
50001
+ }
49997
50002
  }
49998
50003
  if ('min' in validate && (value || value === 0) && value < validate.min) {
49999
50004
  errors = [...errors, `Field must have minimum value of ${validate.min}.`];
@@ -50066,23 +50071,23 @@
50066
50071
  };
50067
50072
  FormFieldRegistry$1.$inject = ['eventBus'];
50068
50073
 
50069
- /**
50070
- * @typedef { { id: String, components: Array<String> } } FormRow
50071
- * @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
50074
+ /**
50075
+ * @typedef { { id: String, components: Array<String> } } FormRow
50076
+ * @typedef { { formFieldId: String, rows: Array<FormRow> } } FormRows
50072
50077
  */
50073
50078
 
50074
- /**
50075
- * Maintains the Form layout in a given structure, for example
50076
- *
50077
- * [
50078
- * {
50079
- * formFieldId: 'FormField_1',
50080
- * rows: [
50081
- * { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
50082
- * ]
50083
- * }
50084
- * ]
50085
- *
50079
+ /**
50080
+ * Maintains the Form layout in a given structure, for example
50081
+ *
50082
+ * [
50083
+ * {
50084
+ * formFieldId: 'FormField_1',
50085
+ * rows: [
50086
+ * { id: 'Row_1', components: [ 'Text_1', 'Textdield_1', ... ] }
50087
+ * ]
50088
+ * }
50089
+ * ]
50090
+ *
50086
50091
  */
50087
50092
  class FormLayouter {
50088
50093
  constructor(eventBus) {
@@ -50092,8 +50097,8 @@
50092
50097
  this._eventBus = eventBus;
50093
50098
  }
50094
50099
 
50095
- /**
50096
- * @param {FormRow} row
50100
+ /**
50101
+ * @param {FormRow} row
50097
50102
  */
50098
50103
  addRow(formFieldId, row) {
50099
50104
  let rowsPerComponent = this._rows.find(r => r.formFieldId === formFieldId);
@@ -50107,18 +50112,18 @@
50107
50112
  rowsPerComponent.rows.push(row);
50108
50113
  }
50109
50114
 
50110
- /**
50111
- * @param {String} id
50112
- * @returns {FormRow}
50115
+ /**
50116
+ * @param {String} id
50117
+ * @returns {FormRow}
50113
50118
  */
50114
50119
  getRow(id) {
50115
50120
  const rows = allRows(this._rows);
50116
50121
  return rows.find(r => r.id === id);
50117
50122
  }
50118
50123
 
50119
- /**
50120
- * @param {any} formField
50121
- * @returns {FormRow}
50124
+ /**
50125
+ * @param {any} formField
50126
+ * @returns {FormRow}
50122
50127
  */
50123
50128
  getRowForField(formField) {
50124
50129
  return allRows(this._rows).find(r => {
@@ -50129,9 +50134,9 @@
50129
50134
  });
50130
50135
  }
50131
50136
 
50132
- /**
50133
- * @param {String} formFieldId
50134
- * @returns { Array<FormRow> }
50137
+ /**
50138
+ * @param {String} formFieldId
50139
+ * @returns { Array<FormRow> }
50135
50140
  */
50136
50141
  getRows(formFieldId) {
50137
50142
  const rowsForField = this._rows.find(r => formFieldId === r.formFieldId);
@@ -50141,15 +50146,15 @@
50141
50146
  return rowsForField.rows;
50142
50147
  }
50143
50148
 
50144
- /**
50145
- * @returns {string}
50149
+ /**
50150
+ * @returns {string}
50146
50151
  */
50147
50152
  nextRowId() {
50148
50153
  return this._ids.nextPrefixed('Row_');
50149
50154
  }
50150
50155
 
50151
- /**
50152
- * @param {any} formField
50156
+ /**
50157
+ * @param {any} formField
50153
50158
  */
50154
50159
  calculateLayout(formField) {
50155
50160
  const {
@@ -50203,9 +50208,9 @@
50203
50208
  });
50204
50209
  }
50205
50210
 
50206
- /**
50207
- * @param {Array<FormRows>} formRows
50208
- * @returns {Array<FormRow>}
50211
+ /**
50212
+ * @param {Array<FormRows>} formRows
50213
+ * @returns {Array<FormRow>}
50209
50214
  */
50210
50215
  function allRows(formRows) {
50211
50216
  return flatten$3(formRows.map(c => c.rows));
@@ -50281,10 +50286,10 @@
50281
50286
  return injector;
50282
50287
  }
50283
50288
 
50284
- /**
50285
- * @param {string?} prefix
50286
- *
50287
- * @returns Element
50289
+ /**
50290
+ * @param {string?} prefix
50291
+ *
50292
+ * @returns Element
50288
50293
  */
50289
50294
  function createFormContainer(prefix = 'fjs') {
50290
50295
  const container = document.createElement('div');
@@ -50314,22 +50319,22 @@
50314
50319
  return `${type}${generateIndexForType(type)}`;
50315
50320
  }
50316
50321
 
50317
- /**
50318
- * @template T
50319
- * @param {T} data
50320
- * @param {(this: any, key: string, value: any) => any} [replacer]
50321
- * @return {T}
50322
+ /**
50323
+ * @template T
50324
+ * @param {T} data
50325
+ * @param {(this: any, key: string, value: any) => any} [replacer]
50326
+ * @return {T}
50322
50327
  */
50323
50328
  function clone(data, replacer) {
50324
50329
  return JSON.parse(JSON.stringify(data, replacer));
50325
50330
  }
50326
50331
 
50327
- /**
50328
- * Parse the schema for input variables a form might make use of
50329
- *
50330
- * @param {any} schema
50331
- *
50332
- * @return {string[]}
50332
+ /**
50333
+ * Parse the schema for input variables a form might make use of
50334
+ *
50335
+ * @param {any} schema
50336
+ *
50337
+ * @return {string[]}
50333
50338
  */
50334
50339
  function getSchemaVariables(schema, expressionLanguage = new FeelExpressionLanguage(null)) {
50335
50340
  if (!schema.components) {
@@ -50373,11 +50378,11 @@
50373
50378
  return Array.from(new Set(variables));
50374
50379
  }
50375
50380
  let Importer$1 = class Importer {
50376
- /**
50377
- * @constructor
50378
- * @param { import('../core').FormFieldRegistry } formFieldRegistry
50379
- * @param { import('../render/FormFields').default } formFields
50380
- * @param { import('../core').FormLayouter } formLayouter
50381
+ /**
50382
+ * @constructor
50383
+ * @param { import('../core').FormFieldRegistry } formFieldRegistry
50384
+ * @param { import('../render/FormFields').default } formFields
50385
+ * @param { import('../core').FormLayouter } formLayouter
50381
50386
  */
50382
50387
  constructor(formFieldRegistry, formFields, formLayouter) {
50383
50388
  this._formFieldRegistry = formFieldRegistry;
@@ -50385,15 +50390,15 @@
50385
50390
  this._formLayouter = formLayouter;
50386
50391
  }
50387
50392
 
50388
- /**
50389
- * Import schema adding `id`, `_parent` and `_path`
50390
- * information to each field and adding it to the
50391
- * form field registry.
50392
- *
50393
- * @param {any} schema
50394
- * @param {any} [data]
50395
- *
50396
- * @return { { warnings: Array<any>, schema: any, data: any } }
50393
+ /**
50394
+ * Import schema adding `id`, `_parent` and `_path`
50395
+ * information to each field and adding it to the
50396
+ * form field registry.
50397
+ *
50398
+ * @param {any} schema
50399
+ * @param {any} [data]
50400
+ *
50401
+ * @return { { warnings: Array<any>, schema: any, data: any } }
50397
50402
  */
50398
50403
  importSchema(schema, data = {}) {
50399
50404
  // TODO: Add warnings - https://github.com/bpmn-io/form-js/issues/289
@@ -50414,11 +50419,11 @@
50414
50419
  }
50415
50420
  }
50416
50421
 
50417
- /**
50418
- * @param {any} formField
50419
- * @param {string} [parentId]
50420
- *
50421
- * @return {any} importedField
50422
+ /**
50423
+ * @param {any} formField
50424
+ * @param {string} [parentId]
50425
+ *
50426
+ * @return {any} importedField
50422
50427
  */
50423
50428
  importFormField(formField, parentId) {
50424
50429
  const {
@@ -50469,10 +50474,10 @@
50469
50474
  });
50470
50475
  }
50471
50476
 
50472
- /**
50473
- * @param {Object} data
50474
- *
50475
- * @return {Object} initializedData
50477
+ /**
50478
+ * @param {Object} data
50479
+ *
50480
+ * @return {Object} initializedData
50476
50481
  */
50477
50482
  initializeFieldValues(data) {
50478
50483
  return this._formFieldRegistry.getAll().reduce((initializedData, formField) => {
@@ -50600,11 +50605,11 @@
50600
50605
  });
50601
50606
  var FormRenderContext$1 = FormRenderContext;
50602
50607
 
50603
- /**
50604
- * @param {string} type
50605
- * @param {boolean} [strict]
50606
- *
50607
- * @returns {any}
50608
+ /**
50609
+ * @param {string} type
50610
+ * @param {boolean} [strict]
50611
+ *
50612
+ * @returns {any}
50608
50613
  */
50609
50614
  function getService$2(type, strict) {}
50610
50615
  const FormContext = D$1({
@@ -50671,8 +50676,12 @@
50671
50676
  const {
50672
50677
  description,
50673
50678
  id,
50674
- label
50679
+ label,
50680
+ validate = {}
50675
50681
  } = field;
50682
+ const {
50683
+ required
50684
+ } = validate;
50676
50685
  const onChange = ({
50677
50686
  target
50678
50687
  }) => {
@@ -50694,7 +50703,7 @@
50694
50703
  children: [e$1(Label$1, {
50695
50704
  id: prefixId(id, formId),
50696
50705
  label: label,
50697
- required: false,
50706
+ required: required,
50698
50707
  children: e$1("input", {
50699
50708
  checked: value,
50700
50709
  class: "fjs-input",
@@ -50774,8 +50783,8 @@
50774
50783
  return getService(type, strict);
50775
50784
  }
50776
50785
 
50777
- /**
50778
- * @enum { String }
50786
+ /**
50787
+ * @enum { String }
50779
50788
  */
50780
50789
  const LOAD_STATES = {
50781
50790
  LOADING: 'loading',
@@ -50783,17 +50792,17 @@
50783
50792
  ERROR: 'error'
50784
50793
  };
50785
50794
 
50786
- /**
50787
- * @typedef {Object} ValuesGetter
50788
- * @property {Object[]} values - The values data
50789
- * @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
50795
+ /**
50796
+ * @typedef {Object} ValuesGetter
50797
+ * @property {Object[]} values - The values data
50798
+ * @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
50790
50799
  */
50791
50800
 
50792
- /**
50793
- * A hook to load values for single and multiselect components.
50794
- *
50795
- * @param {Object} field - The form field to handle values for
50796
- * @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
50801
+ /**
50802
+ * A hook to load values for single and multiselect components.
50803
+ *
50804
+ * @param {Object} field - The form field to handle values for
50805
+ * @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
50797
50806
  */
50798
50807
  function useValuesAsync(field) {
50799
50808
  const {
@@ -51057,8 +51066,12 @@
51057
51066
  const {
51058
51067
  description,
51059
51068
  id,
51060
- label
51069
+ label,
51070
+ validate = {}
51061
51071
  } = field;
51072
+ const {
51073
+ required
51074
+ } = validate;
51062
51075
  const toggleCheckbox = v => {
51063
51076
  let newValue = [...value];
51064
51077
  if (!newValue.includes(v)) {
@@ -51084,7 +51097,8 @@
51084
51097
  disabled
51085
51098
  })),
51086
51099
  children: [e$1(Label$1, {
51087
- label: label
51100
+ label: label,
51101
+ required: required
51088
51102
  }), loadState == LOAD_STATES.LOADED && options.map((v, index) => {
51089
51103
  return e$1(Label$1, {
51090
51104
  id: prefixId(`${id}-${index}`, formId),
@@ -51131,10 +51145,10 @@
51131
51145
  Checklist.sanitizeValue = sanitizeMultiSelectValue;
51132
51146
  Checklist.group = 'selection';
51133
51147
 
51134
- /**
51135
- * Returns the conditionally filtered data of a form reactively.
51136
- * Memoised to minimize re-renders
51137
- *
51148
+ /**
51149
+ * Returns the conditionally filtered data of a form reactively.
51150
+ * Memoised to minimize re-renders
51151
+ *
51138
51152
  */
51139
51153
  function useFilteredFormData() {
51140
51154
  const {
@@ -51151,12 +51165,12 @@
51151
51165
  }, [conditionChecker, data, initialData]);
51152
51166
  }
51153
51167
 
51154
- /**
51155
- * Evaluate if condition is met reactively based on the conditionChecker and form data.
51156
- *
51157
- * @param {string | undefined} condition
51158
- *
51159
- * @returns {boolean} true if condition is met or no condition or condition checker exists
51168
+ /**
51169
+ * Evaluate if condition is met reactively based on the conditionChecker and form data.
51170
+ *
51171
+ * @param {string | undefined} condition
51172
+ *
51173
+ * @returns {boolean} true if condition is met or no condition or condition checker exists
51160
51174
  */
51161
51175
  function useCondition(condition) {
51162
51176
  const conditionChecker = useService$2('conditionChecker', false);
@@ -51166,13 +51180,13 @@
51166
51180
  }, [conditionChecker, condition, filteredData]);
51167
51181
  }
51168
51182
 
51169
- /**
51170
- * Evaluate a string reactively based on the expressionLanguage and form data.
51171
- * If the string is not an expression, it is returned as is.
51172
- * Memoised to minimize re-renders.
51173
- *
51174
- * @param {string} value
51175
- *
51183
+ /**
51184
+ * Evaluate a string reactively based on the expressionLanguage and form data.
51185
+ * If the string is not an expression, it is returned as is.
51186
+ * Memoised to minimize re-renders.
51187
+ *
51188
+ * @param {string} value
51189
+ *
51176
51190
  */
51177
51191
  function useExpressionEvaluation(value) {
51178
51192
  const formData = useFilteredFormData();
@@ -51200,16 +51214,16 @@
51200
51214
  });
51201
51215
  }
51202
51216
 
51203
- /**
51204
- * Template a string reactively based on form data. If the string is not a template, it is returned as is.
51205
- * Memoised to minimize re-renders
51206
- *
51207
- * @param {string} value
51208
- * @param {Object} options
51209
- * @param {boolean} [options.debug = false]
51210
- * @param {boolean} [options.strict = false]
51211
- * @param {Function} [options.buildDebugString]
51212
- *
51217
+ /**
51218
+ * Template a string reactively based on form data. If the string is not a template, it is returned as is.
51219
+ * Memoised to minimize re-renders
51220
+ *
51221
+ * @param {string} value
51222
+ * @param {Object} options
51223
+ * @param {boolean} [options.debug = false]
51224
+ * @param {boolean} [options.strict = false]
51225
+ * @param {Function} [options.buildDebugString]
51226
+ *
51213
51227
  */
51214
51228
  function useTemplateEvaluation(value, options) {
51215
51229
  const filteredData = useFilteredFormData();
@@ -51978,10 +51992,10 @@
51978
51992
  Datetime.label = 'Date time';
51979
51993
  Datetime.group = 'basic-input';
51980
51994
 
51981
- /**
51982
- * This file must not be changed or exchanged.
51983
- *
51984
- * @see http://bpmn.io/license for more information.
51995
+ /**
51996
+ * This file must not be changed or exchanged.
51997
+ *
51998
+ * @see http://bpmn.io/license for more information.
51985
51999
  */
51986
52000
  function Logo() {
51987
52001
  return e$1("svg", {
@@ -52106,11 +52120,11 @@
52106
52120
 
52107
52121
  const FORM_ELEMENT = document.createElement('form');
52108
52122
 
52109
- /**
52110
- * Sanitize a HTML string and return the cleaned, safe version.
52111
- *
52112
- * @param {string} html
52113
- * @return {string}
52123
+ /**
52124
+ * Sanitize a HTML string and return the cleaned, safe version.
52125
+ *
52126
+ * @param {string} html
52127
+ * @return {string}
52114
52128
  */
52115
52129
 
52116
52130
  // see https://github.com/developit/snarkdown/issues/70
@@ -52128,29 +52142,29 @@
52128
52142
  }
52129
52143
  }
52130
52144
 
52131
- /**
52132
- * Sanitizes an image source to ensure we only allow for data URI and links
52133
- * that start with http(s).
52134
- *
52135
- * Note: Most browsers anyway do not support script execution in <img> elements.
52136
- *
52137
- * @param {string} src
52138
- * @returns {string}
52145
+ /**
52146
+ * Sanitizes an image source to ensure we only allow for data URI and links
52147
+ * that start with http(s).
52148
+ *
52149
+ * Note: Most browsers anyway do not support script execution in <img> elements.
52150
+ *
52151
+ * @param {string} src
52152
+ * @returns {string}
52139
52153
  */
52140
52154
  function sanitizeImageSource(src) {
52141
52155
  const valid = ALLOWED_IMAGE_SRC_PATTERN.test(src);
52142
52156
  return valid ? src : '';
52143
52157
  }
52144
52158
 
52145
- /**
52146
- * Recursively sanitize a HTML node, potentially
52147
- * removing it, its children or attributes.
52148
- *
52149
- * Inspired by https://github.com/developit/snarkdown/issues/70
52150
- * and https://github.com/cure53/DOMPurify. Simplified
52151
- * for our use-case.
52152
- *
52153
- * @param {Element} node
52159
+ /**
52160
+ * Recursively sanitize a HTML node, potentially
52161
+ * removing it, its children or attributes.
52162
+ *
52163
+ * Inspired by https://github.com/developit/snarkdown/issues/70
52164
+ * and https://github.com/cure53/DOMPurify. Simplified
52165
+ * for our use-case.
52166
+ *
52167
+ * @param {Element} node
52154
52168
  */
52155
52169
  function sanitizeNode(node) {
52156
52170
  // allow text nodes
@@ -52194,13 +52208,13 @@
52194
52208
  }
52195
52209
  }
52196
52210
 
52197
- /**
52198
- * Validates attributes for validity.
52199
- *
52200
- * @param {string} lcTag
52201
- * @param {string} lcName
52202
- * @param {string} value
52203
- * @return {boolean}
52211
+ /**
52212
+ * Validates attributes for validity.
52213
+ *
52214
+ * @param {string} lcTag
52215
+ * @param {string} lcName
52216
+ * @param {string} value
52217
+ * @return {boolean}
52204
52218
  */
52205
52219
  function isValidAttribute(lcTag, lcName, value) {
52206
52220
  // disallow most attributes based on whitelist
@@ -53011,8 +53025,12 @@
53011
53025
  const {
53012
53026
  description,
53013
53027
  id,
53014
- label
53028
+ label,
53029
+ validate = {}
53015
53030
  } = field;
53031
+ const {
53032
+ required
53033
+ } = validate;
53016
53034
  const {
53017
53035
  formId
53018
53036
  } = F$1(FormContext$1);
@@ -53111,6 +53129,7 @@
53111
53129
  }),
53112
53130
  children: [e$1(Label$1, {
53113
53131
  label: label,
53132
+ required: required,
53114
53133
  id: prefixId(`${id}-search`, formId)
53115
53134
  }), e$1("div", {
53116
53135
  class: classNames('fjs-taglist', {
@@ -58064,10 +58083,10 @@
58064
58083
  return fn.apply(null, args);
58065
58084
  }
58066
58085
 
58067
- /**
58068
- * A factory to create a configurable debouncer.
58069
- *
58070
- * @param {number|boolean} [config=true]
58086
+ /**
58087
+ * A factory to create a configurable debouncer.
58088
+ *
58089
+ * @param {number|boolean} [config=true]
58071
58090
  */
58072
58091
  function DebounceFactory(config = true) {
58073
58092
  const timeout = typeof config === 'number' ? config : config ? 300 : 0;
@@ -58079,11 +58098,11 @@
58079
58098
  }
58080
58099
  DebounceFactory.$inject = ['config.debounce'];
58081
58100
  class FieldFactory {
58082
- /**
58083
- * @constructor
58084
- *
58085
- * @param { import('./FormFieldRegistry').default } formFieldRegistry
58086
- * @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
58101
+ /**
58102
+ * @constructor
58103
+ *
58104
+ * @param { import('./FormFieldRegistry').default } formFieldRegistry
58105
+ * @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
58087
58106
  */
58088
58107
  constructor(formFieldRegistry, formFields) {
58089
58108
  this._formFieldRegistry = formFieldRegistry;
@@ -58142,11 +58161,11 @@
58142
58161
  }
58143
58162
  FieldFactory.$inject = ['formFieldRegistry', 'formFields'];
58144
58163
  class FormFieldRegistry extends FormFieldRegistry$1 {
58145
- /**
58146
- * Updates a form fields id.
58147
- *
58148
- * @param {Object} formField
58149
- * @param {string} newId
58164
+ /**
58165
+ * Updates a form fields id.
58166
+ *
58167
+ * @param {Object} formField
58168
+ * @param {string} newId
58150
58169
  */
58151
58170
  updateId(formField, newId) {
58152
58171
  this._validateId(newId);
@@ -58167,13 +58186,13 @@
58167
58186
  }
58168
58187
  }
58169
58188
 
58170
- /**
58171
- * Validate the suitability of the given id and signals a problem
58172
- * with an exception.
58173
- *
58174
- * @param {string} id
58175
- *
58176
- * @throws {Error} if id is empty or already assigned
58189
+ /**
58190
+ * Validate the suitability of the given id and signals a problem
58191
+ * with an exception.
58192
+ *
58193
+ * @param {string} id
58194
+ *
58195
+ * @throws {Error} if id is empty or already assigned
58177
58196
  */
58178
58197
  _validateId(id) {
58179
58198
  if (!id) {
@@ -58185,11 +58204,11 @@
58185
58204
  }
58186
58205
  }
58187
58206
  class FormLayoutValidator {
58188
- /**
58189
- * @constructor
58190
- *
58191
- * @param { import('./FormLayouter').default } formLayouter
58192
- * @param { import('./FormFieldRegistry').default } formFieldRegistry
58207
+ /**
58208
+ * @constructor
58209
+ *
58210
+ * @param { import('./FormLayouter').default } formLayouter
58211
+ * @param { import('./FormFieldRegistry').default } formFieldRegistry
58193
58212
  */
58194
58213
  constructor(formLayouter, formFieldRegistry) {
58195
58214
  this._formLayouter = formLayouter;
@@ -58241,11 +58260,11 @@
58241
58260
  }
58242
58261
  FormLayoutValidator.$inject = ['formLayouter', 'formFieldRegistry'];
58243
58262
  class Importer {
58244
- /**
58245
- * @constructor
58246
- * @param { import('../core/FormFieldRegistry').default } formFieldRegistry
58247
- * @param { import('../core/FieldFactory').default } fieldFactory
58248
- * @param { import('../core/FormLayouter').default } formLayouter
58263
+ /**
58264
+ * @constructor
58265
+ * @param { import('../core/FormFieldRegistry').default } formFieldRegistry
58266
+ * @param { import('../core/FieldFactory').default } fieldFactory
58267
+ * @param { import('../core/FormLayouter').default } formLayouter
58249
58268
  */
58250
58269
  constructor(formFieldRegistry, fieldFactory, formLayouter) {
58251
58270
  this._formFieldRegistry = formFieldRegistry;
@@ -58253,21 +58272,21 @@
58253
58272
  this._formLayouter = formLayouter;
58254
58273
  }
58255
58274
 
58256
- /**
58257
- * Import schema creating rows, fields, attaching additional
58258
- * information to each field and adding fields to the
58259
- * field registry.
58260
- *
58261
- * Additional information attached:
58262
- *
58263
- * * `id` (unless present)
58264
- * * `_parent`
58265
- * * `_path`
58266
- *
58267
- * @param {any} schema
58268
- *
58269
- * @typedef {{ warnings: Error[], schema: any }} ImportResult
58270
- * @returns {ImportResult}
58275
+ /**
58276
+ * Import schema creating rows, fields, attaching additional
58277
+ * information to each field and adding fields to the
58278
+ * field registry.
58279
+ *
58280
+ * Additional information attached:
58281
+ *
58282
+ * * `id` (unless present)
58283
+ * * `_parent`
58284
+ * * `_path`
58285
+ *
58286
+ * @param {any} schema
58287
+ *
58288
+ * @typedef {{ warnings: Error[], schema: any }} ImportResult
58289
+ * @returns {ImportResult}
58271
58290
  */
58272
58291
  importSchema(schema) {
58273
58292
  // TODO: Add warnings
@@ -58285,12 +58304,12 @@
58285
58304
  }
58286
58305
  }
58287
58306
 
58288
- /**
58289
- * @param {{[x: string]: any}} fieldAttrs
58290
- * @param {String} [parentId]
58291
- * @param {number} [index]
58292
- *
58293
- * @return {any} field
58307
+ /**
58308
+ * @param {{[x: string]: any}} fieldAttrs
58309
+ * @param {String} [parentId]
58310
+ * @param {number} [index]
58311
+ *
58312
+ * @return {any} field
58294
58313
  */
58295
58314
  importFormField(fieldAttrs, parentId, index) {
58296
58315
  const {
@@ -58327,11 +58346,11 @@
58327
58346
  return field;
58328
58347
  }
58329
58348
 
58330
- /**
58331
- * @param {Array<any>} components
58332
- * @param {string} parentId
58333
- *
58334
- * @return {Array<any>} imported components
58349
+ /**
58350
+ * @param {Array<any>} components
58351
+ * @param {string} parentId
58352
+ *
58353
+ * @return {Array<any>} imported components
58335
58354
  */
58336
58355
  importFormFields(components, parentId) {
58337
58356
  return components.map((component, index) => {
@@ -58358,11 +58377,11 @@
58358
58377
  });
58359
58378
  var DragAndDropContext$1 = DragAndDropContext;
58360
58379
 
58361
- /**
58362
- * @param {string} type
58363
- * @param {boolean} [strict]
58364
- *
58365
- * @returns {any}
58380
+ /**
58381
+ * @param {string} type
58382
+ * @param {boolean} [strict]
58383
+ *
58384
+ * @returns {any}
58366
58385
  */
58367
58386
  function getService$1(type, strict) {}
58368
58387
  const FormEditorContext = D$1({
@@ -58696,19 +58715,19 @@
58696
58715
  const DRAG_NO_MOVE_CLS = 'fjs-no-move';
58697
58716
  const ERROR_DROP_CLS = 'fjs-error-drop';
58698
58717
 
58699
- /**
58700
- * @typedef { { id: String, components: Array<any> } } FormRow
58718
+ /**
58719
+ * @typedef { { id: String, components: Array<any> } } FormRow
58701
58720
  */
58702
58721
 
58703
58722
  class Dragging {
58704
- /**
58705
- * @constructor
58706
- *
58707
- * @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
58708
- * @param { import('../../core/FormLayouter').default } formLayouter
58709
- * @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
58710
- * @param { import('../../core/EventBus').default } eventBus
58711
- * @param { import('../modeling/Modeling').default } modeling
58723
+ /**
58724
+ * @constructor
58725
+ *
58726
+ * @param { import('../../core/FormFieldRegistry').default } formFieldRegistry
58727
+ * @param { import('../../core/FormLayouter').default } formLayouter
58728
+ * @param { import('../../core/FormLayoutValidator').default } formLayoutValidator
58729
+ * @param { import('../../core/EventBus').default } eventBus
58730
+ * @param { import('../modeling/Modeling').default } modeling
58712
58731
  */
58713
58732
  constructor(formFieldRegistry, formLayouter, formLayoutValidator, eventBus, modeling) {
58714
58733
  this._formFieldRegistry = formFieldRegistry;
@@ -58718,13 +58737,13 @@
58718
58737
  this._modeling = modeling;
58719
58738
  }
58720
58739
 
58721
- /**
58722
- * Calculcates position in form schema given the dropped place.
58723
- *
58724
- * @param { FormRow } targetRow
58725
- * @param { any } targetFormField
58726
- * @param { HTMLElement } sibling
58727
- * @returns { number }
58740
+ /**
58741
+ * Calculcates position in form schema given the dropped place.
58742
+ *
58743
+ * @param { FormRow } targetRow
58744
+ * @param { any } targetFormField
58745
+ * @param { HTMLElement } sibling
58746
+ * @returns { number }
58728
58747
  */
58729
58748
  getTargetIndex(targetRow, targetFormField, sibling) {
58730
58749
  /** @type HTMLElement */
@@ -58826,8 +58845,8 @@
58826
58845
  }
58827
58846
  }
58828
58847
 
58829
- /**
58830
- * @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
58848
+ /**
58849
+ * @param { { container: Array<string>, direction: string, mirrorContainer: string } } options
58831
58850
  */
58832
58851
  createDragulaInstance(options) {
58833
58852
  const {
@@ -59070,7 +59089,7 @@
59070
59089
  return null;
59071
59090
  }
59072
59091
  return e$1("div", {
59073
- 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;",
59092
+ 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;",
59074
59093
  class: "fjs-debug-columns",
59075
59094
  children: (field.layout || {}).columns || 'auto'
59076
59095
  });
@@ -60101,10 +60120,10 @@
60101
60120
  return formField;
60102
60121
  }
60103
60122
  class AddFormFieldHandler {
60104
- /**
60105
- * @constructor
60106
- * @param { import('../../../FormEditor').default } formEditor
60107
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60123
+ /**
60124
+ * @constructor
60125
+ * @param { import('../../../FormEditor').default } formEditor
60126
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60108
60127
  */
60109
60128
  constructor(formEditor, formFieldRegistry) {
60110
60129
  this._formEditor = formEditor;
@@ -60164,10 +60183,10 @@
60164
60183
  }
60165
60184
  AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
60166
60185
  class EditFormFieldHandler {
60167
- /**
60168
- * @constructor
60169
- * @param { import('../../../FormEditor').default } formEditor
60170
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60186
+ /**
60187
+ * @constructor
60188
+ * @param { import('../../../FormEditor').default } formEditor
60189
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60171
60190
  */
60172
60191
  constructor(formEditor, formFieldRegistry) {
60173
60192
  this._formEditor = formEditor;
@@ -60229,10 +60248,10 @@
60229
60248
  }
60230
60249
  EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
60231
60250
  class MoveFormFieldHandler {
60232
- /**
60233
- * @constructor
60234
- * @param { import('../../../FormEditor').default } formEditor
60235
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60251
+ /**
60252
+ * @constructor
60253
+ * @param { import('../../../FormEditor').default } formEditor
60254
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60236
60255
  */
60237
60256
  constructor(formEditor, formFieldRegistry) {
60238
60257
  this._formEditor = formEditor;
@@ -60320,10 +60339,10 @@
60320
60339
  }
60321
60340
  MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
60322
60341
  class RemoveFormFieldHandler {
60323
- /**
60324
- * @constructor
60325
- * @param { import('../../../FormEditor').default } formEditor
60326
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60342
+ /**
60343
+ * @constructor
60344
+ * @param { import('../../../FormEditor').default } formEditor
60345
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60327
60346
  */
60328
60347
  constructor(formEditor, formFieldRegistry) {
60329
60348
  this._formEditor = formEditor;
@@ -60382,9 +60401,9 @@
60382
60401
  }
60383
60402
  RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
60384
60403
  class UpdateIdClaimHandler {
60385
- /**
60386
- * @constructor
60387
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60404
+ /**
60405
+ * @constructor
60406
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60388
60407
  */
60389
60408
  constructor(formFieldRegistry) {
60390
60409
  this._formFieldRegistry = formFieldRegistry;
@@ -60416,9 +60435,9 @@
60416
60435
  }
60417
60436
  UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
60418
60437
  class UpdateKeyClaimHandler {
60419
- /**
60420
- * @constructor
60421
- * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60438
+ /**
60439
+ * @constructor
60440
+ * @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
60422
60441
  */
60423
60442
  constructor(formFieldRegistry) {
60424
60443
  this._formFieldRegistry = formFieldRegistry;
@@ -60762,8 +60781,8 @@
60762
60781
  constructor(eventBus) {
60763
60782
  super(eventBus);
60764
60783
 
60765
- /**
60766
- * Remove custom validation if <validationType> is about to be added.
60784
+ /**
60785
+ * Remove custom validation if <validationType> is about to be added.
60767
60786
  */
60768
60787
  // @ts-ignore-next-line
60769
60788
  this.preExecute('formField.edit', function (context) {
@@ -61301,10 +61320,10 @@
61301
61320
  });
61302
61321
  }
61303
61322
 
61304
- /**
61305
- * Attach the palette to a parent node.
61306
- *
61307
- * @param {HTMLElement} container
61323
+ /**
61324
+ * Attach the palette to a parent node.
61325
+ *
61326
+ * @param {HTMLElement} container
61308
61327
  */
61309
61328
  attachTo(container) {
61310
61329
  if (!container) {
@@ -61324,8 +61343,8 @@
61324
61343
  this._eventBus.fire('palette.attach');
61325
61344
  }
61326
61345
 
61327
- /**
61328
- * Detach the palette from its parent node.
61346
+ /**
61347
+ * Detach the palette from its parent node.
61329
61348
  */
61330
61349
  detach() {
61331
61350
  const parentNode = this._container.parentNode;
@@ -63680,11 +63699,11 @@
63680
63699
  return `bio-properties-panel-${id}`;
63681
63700
  }
63682
63701
 
63683
- /**
63684
- * @param {string} type
63685
- * @param {boolean} [strict]
63686
- *
63687
- * @returns {any}
63702
+ /**
63703
+ * @param {string} type
63704
+ * @param {boolean} [strict]
63705
+ *
63706
+ * @returns {any}
63688
63707
  */
63689
63708
  function getService(type, strict) {}
63690
63709
  const PropertiesPanelContext = D$1({
@@ -63771,8 +63790,8 @@
63771
63790
  }
63772
63791
  };
63773
63792
 
63774
- /**
63775
- * Provide placeholders for empty and multiple state.
63793
+ /**
63794
+ * Provide placeholders for empty and multiple state.
63776
63795
  */
63777
63796
  const PropertiesPanelPlaceholderProvider = {
63778
63797
  getEmpty: () => {
@@ -63842,10 +63861,10 @@
63842
63861
  return getService(type, strict);
63843
63862
  }
63844
63863
 
63845
- /**
63846
- * Retrieve list of variables from the form schema.
63847
- *
63848
- * @returns { string[] } list of variables used in form schema
63864
+ /**
63865
+ * Retrieve list of variables from the form schema.
63866
+ *
63867
+ * @returns { string[] } list of variables used in form schema
63849
63868
  */
63850
63869
  function useVariables() {
63851
63870
  const form = useService('formEditor');
@@ -65218,14 +65237,14 @@
65218
65237
 
65219
65238
  // helpers //////////
65220
65239
 
65221
- /**
65222
- * Returns copy of object with updated value.
65223
- *
65224
- * @param {Object} properties
65225
- * @param {string} key
65226
- * @param {string} value
65227
- *
65228
- * @returns {Object}
65240
+ /**
65241
+ * Returns copy of object with updated value.
65242
+ *
65243
+ * @param {Object} properties
65244
+ * @param {string} key
65245
+ * @param {string} value
65246
+ *
65247
+ * @returns {Object}
65229
65248
  */
65230
65249
  function updateValue(properties, key, value) {
65231
65250
  return {
@@ -65234,14 +65253,14 @@
65234
65253
  };
65235
65254
  }
65236
65255
 
65237
- /**
65238
- * Returns copy of object with updated key.
65239
- *
65240
- * @param {Object} properties
65241
- * @param {string} oldKey
65242
- * @param {string} newKey
65243
- *
65244
- * @returns {Object}
65256
+ /**
65257
+ * Returns copy of object with updated key.
65258
+ *
65259
+ * @param {Object} properties
65260
+ * @param {string} oldKey
65261
+ * @param {string} newKey
65262
+ *
65263
+ * @returns {Object}
65245
65264
  */
65246
65265
  function updateKey(properties, oldKey, newKey) {
65247
65266
  return Object.entries(properties).reduce((newProperties, entry) => {
@@ -65645,7 +65664,7 @@
65645
65664
  } = field;
65646
65665
  const validate = get(field, ['validate'], {});
65647
65666
  const isCustomValidation = [undefined, VALIDATION_TYPE_OPTIONS.custom.value].includes(validate.validationType);
65648
- if (!(INPUTS.includes(type) && type !== 'checkbox' && type !== 'checklist' && type !== 'taglist')) {
65667
+ if (!INPUTS.includes(type)) {
65649
65668
  return null;
65650
65669
  }
65651
65670
  const onChange = key => {
@@ -65867,8 +65886,8 @@
65867
65886
  };
65868
65887
  const valuesSourceId = `${fieldId}-valuesSource`;
65869
65888
 
65870
- /**
65871
- * @type {Array<Group|ListGroup>}
65889
+ /**
65890
+ * @type {Array<Group|ListGroup>}
65872
65891
  */
65873
65892
  const groups = [{
65874
65893
  id: valuesSourceId,
@@ -65968,13 +65987,13 @@
65968
65987
 
65969
65988
  // helpers //////////
65970
65989
 
65971
- /**
65972
- * Returns copy of object without key.
65973
- *
65974
- * @param {Object} properties
65975
- * @param {string} oldKey
65976
- *
65977
- * @returns {Object}
65990
+ /**
65991
+ * Returns copy of object without key.
65992
+ *
65993
+ * @param {Object} properties
65994
+ * @param {string} oldKey
65995
+ *
65996
+ * @returns {Object}
65978
65997
  */
65979
65998
  function removeKey(properties, oldKey) {
65980
65999
  return Object.entries(properties).reduce((newProperties, entry) => {
@@ -66084,9 +66103,9 @@
66084
66103
  }, []);
66085
66104
  h(() => {
66086
66105
  const onFieldChanged = () => {
66087
- /**
66088
- * TODO(pinussilvestrus): update with actual updated element,
66089
- * once we have a proper updater/change support
66106
+ /**
66107
+ * TODO(pinussilvestrus): update with actual updated element,
66108
+ * once we have a proper updater/change support
66090
66109
  */
66091
66110
  _update(selection.get() || schema);
66092
66111
  };
@@ -66136,10 +66155,10 @@
66136
66155
  });
66137
66156
  }
66138
66157
 
66139
- /**
66140
- * Attach the properties panel to a parent node.
66141
- *
66142
- * @param {HTMLElement} container
66158
+ /**
66159
+ * Attach the properties panel to a parent node.
66160
+ *
66161
+ * @param {HTMLElement} container
66143
66162
  */
66144
66163
  attachTo(container) {
66145
66164
  if (!container) {
@@ -66159,8 +66178,8 @@
66159
66178
  this._eventBus.fire('propertiesPanel.attach');
66160
66179
  }
66161
66180
 
66162
- /**
66163
- * Detach the properties panel from its parent node.
66181
+ /**
66182
+ * Detach the properties panel from its parent node.
66164
66183
  */
66165
66184
  detach() {
66166
66185
  const parentNode = this._container.parentNode;
@@ -66195,48 +66214,48 @@
66195
66214
  };
66196
66215
  const ids = new Ids([32, 36, 1]);
66197
66216
 
66198
- /**
66199
- * @typedef { import('./types').Injector } Injector
66200
- * @typedef { import('./types').Module } Module
66201
- * @typedef { import('./types').Schema } Schema
66202
- *
66203
- * @typedef { import('./types').FormEditorOptions } FormEditorOptions
66204
- * @typedef { import('./types').FormEditorProperties } FormEditorProperties
66205
- *
66206
- * @typedef { {
66207
- * properties: FormEditorProperties,
66208
- * schema: Schema
66209
- * } } State
66210
- *
66211
- * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
66212
- * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
66213
- * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
66217
+ /**
66218
+ * @typedef { import('./types').Injector } Injector
66219
+ * @typedef { import('./types').Module } Module
66220
+ * @typedef { import('./types').Schema } Schema
66221
+ *
66222
+ * @typedef { import('./types').FormEditorOptions } FormEditorOptions
66223
+ * @typedef { import('./types').FormEditorProperties } FormEditorProperties
66224
+ *
66225
+ * @typedef { {
66226
+ * properties: FormEditorProperties,
66227
+ * schema: Schema
66228
+ * } } State
66229
+ *
66230
+ * @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
66231
+ * @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
66232
+ * @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
66214
66233
  */
66215
66234
 
66216
- /**
66217
- * The form editor.
66235
+ /**
66236
+ * The form editor.
66218
66237
  */
66219
66238
  class FormEditor {
66220
- /**
66221
- * @constructor
66222
- * @param {FormEditorOptions} options
66239
+ /**
66240
+ * @constructor
66241
+ * @param {FormEditorOptions} options
66223
66242
  */
66224
66243
  constructor(options = {}) {
66225
- /**
66226
- * @public
66227
- * @type {OnEventType}
66244
+ /**
66245
+ * @public
66246
+ * @type {OnEventType}
66228
66247
  */
66229
66248
  this.on = this._onEvent;
66230
66249
 
66231
- /**
66232
- * @public
66233
- * @type {String}
66250
+ /**
66251
+ * @public
66252
+ * @type {String}
66234
66253
  */
66235
66254
  this._id = ids.next();
66236
66255
 
66237
- /**
66238
- * @private
66239
- * @type {Element}
66256
+ /**
66257
+ * @private
66258
+ * @type {Element}
66240
66259
  */
66241
66260
  this._container = createFormContainer();
66242
66261
  this._container.setAttribute('input-handle-modified-keys', 'z,y');
@@ -66247,15 +66266,15 @@
66247
66266
  properties = {}
66248
66267
  } = options;
66249
66268
 
66250
- /**
66251
- * @private
66252
- * @type {any}
66269
+ /**
66270
+ * @private
66271
+ * @type {any}
66253
66272
  */
66254
66273
  this.exporter = exporter;
66255
66274
 
66256
- /**
66257
- * @private
66258
- * @type {State}
66275
+ /**
66276
+ * @private
66277
+ * @type {State}
66259
66278
  */
66260
66279
  this._state = {
66261
66280
  properties,
@@ -66284,10 +66303,10 @@
66284
66303
  this._detach(false);
66285
66304
  }
66286
66305
 
66287
- /**
66288
- * @param {Schema} schema
66289
- *
66290
- * @return {Promise<{ warnings: Array<any> }>}
66306
+ /**
66307
+ * @param {Schema} schema
66308
+ *
66309
+ * @return {Promise<{ warnings: Array<any> }>}
66291
66310
  */
66292
66311
  importSchema(schema) {
66293
66312
  return new Promise((resolve, reject) => {
@@ -66316,15 +66335,15 @@
66316
66335
  });
66317
66336
  }
66318
66337
 
66319
- /**
66320
- * @returns {Schema}
66338
+ /**
66339
+ * @returns {Schema}
66321
66340
  */
66322
66341
  saveSchema() {
66323
66342
  return this.getSchema();
66324
66343
  }
66325
66344
 
66326
- /**
66327
- * @returns {Schema}
66345
+ /**
66346
+ * @returns {Schema}
66328
66347
  */
66329
66348
  getSchema() {
66330
66349
  const {
@@ -66333,8 +66352,8 @@
66333
66352
  return exportSchema(schema, this.exporter, schemaVersion);
66334
66353
  }
66335
66354
 
66336
- /**
66337
- * @param {Element|string} parentNode
66355
+ /**
66356
+ * @param {Element|string} parentNode
66338
66357
  */
66339
66358
  attachTo(parentNode) {
66340
66359
  if (!parentNode) {
@@ -66352,10 +66371,10 @@
66352
66371
  this._detach();
66353
66372
  }
66354
66373
 
66355
- /**
66356
- * @internal
66357
- *
66358
- * @param {boolean} [emit]
66374
+ /**
66375
+ * @internal
66376
+ *
66377
+ * @param {boolean} [emit]
66359
66378
  */
66360
66379
  _detach(emit = true) {
66361
66380
  const container = this._container,
@@ -66369,9 +66388,9 @@
66369
66388
  parentNode.removeChild(container);
66370
66389
  }
66371
66390
 
66372
- /**
66373
- * @param {any} property
66374
- * @param {any} value
66391
+ /**
66392
+ * @param {any} property
66393
+ * @param {any} value
66375
66394
  */
66376
66395
  setProperty(property, value) {
66377
66396
  const properties = set$1(this._getState().properties, [property], value);
@@ -66380,21 +66399,21 @@
66380
66399
  });
66381
66400
  }
66382
66401
 
66383
- /**
66384
- * @param {string} type
66385
- * @param {Function} handler
66402
+ /**
66403
+ * @param {string} type
66404
+ * @param {Function} handler
66386
66405
  */
66387
66406
  off(type, handler) {
66388
66407
  this.get('eventBus').off(type, handler);
66389
66408
  }
66390
66409
 
66391
- /**
66392
- * @internal
66393
- *
66394
- * @param {FormEditorOptions} options
66395
- * @param {Element} container
66396
- *
66397
- * @returns {Injector}
66410
+ /**
66411
+ * @internal
66412
+ *
66413
+ * @param {FormEditorOptions} options
66414
+ * @param {Element} container
66415
+ *
66416
+ * @returns {Injector}
66398
66417
  */
66399
66418
  _createInjector(options, container) {
66400
66419
  const {
@@ -66416,22 +66435,22 @@
66416
66435
  }, core, ...modules, ...additionalModules]);
66417
66436
  }
66418
66437
 
66419
- /**
66420
- * @internal
66438
+ /**
66439
+ * @internal
66421
66440
  */
66422
66441
  _emit(type, data) {
66423
66442
  this.get('eventBus').fire(type, data);
66424
66443
  }
66425
66444
 
66426
- /**
66427
- * @internal
66445
+ /**
66446
+ * @internal
66428
66447
  */
66429
66448
  _getState() {
66430
66449
  return this._state;
66431
66450
  }
66432
66451
 
66433
- /**
66434
- * @internal
66452
+ /**
66453
+ * @internal
66435
66454
  */
66436
66455
  _setState(state) {
66437
66456
  this._state = {
@@ -66441,15 +66460,15 @@
66441
66460
  this._emit('changed', this._getState());
66442
66461
  }
66443
66462
 
66444
- /**
66445
- * @internal
66463
+ /**
66464
+ * @internal
66446
66465
  */
66447
66466
  _getModules() {
66448
66467
  return [ModelingModule, EditorActionsModule, DraggingModule, KeyboardModule, SelectionModule, PaletteModule, ExpressionLanguageModule, MarkdownModule, PropertiesPanelModule];
66449
66468
  }
66450
66469
 
66451
- /**
66452
- * @internal
66470
+ /**
66471
+ * @internal
66453
66472
  */
66454
66473
  _onEvent(type, priority, handler) {
66455
66474
  this.get('eventBus').on(type, priority, handler);
@@ -67952,8 +67971,8 @@
67952
67971
  return new LanguageSupport(jsonLanguage);
67953
67972
  }
67954
67973
 
67955
- /**
67956
- * @type {Facet<import('..').Variables>} Variables
67974
+ /**
67975
+ * @type {Facet<import('..').Variables>} Variables
67957
67976
  */
67958
67977
  const variablesFacet = Facet.define();
67959
67978
 
@@ -67992,8 +68011,8 @@
67992
68011
  let language = new Compartment().of(json());
67993
68012
  let tabSize = new Compartment().of(EditorState.tabSize.of(2));
67994
68013
 
67995
- /**
67996
- * @typedef {Array<string>} Variables
68014
+ /**
68015
+ * @typedef {Array<string>} Variables
67997
68016
  */
67998
68017
 
67999
68018
  const autocompletionConf = new Compartment();
@@ -68032,8 +68051,8 @@
68032
68051
  return view.state.doc.toString();
68033
68052
  };
68034
68053
 
68035
- /**
68036
- * @param {Variables} variables
68054
+ /**
68055
+ * @param {Variables} variables
68037
68056
  */
68038
68057
  this.setVariables = function (variables) {
68039
68058
  view.setVariables(variables);