@bpmn-io/form-js-playground 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/dist/assets/form-js-playground.css +266 -266
- package/dist/form-playground.umd.js +342 -340
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/types/Playground.d.ts +76 -76
- package/dist/types/components/EmbedModal.d.ts +1 -1
- package/dist/types/components/JSONEditor.d.ts +20 -20
- package/dist/types/components/Modal.d.ts +1 -1
- package/dist/types/components/PlaygroundRoot.d.ts +1 -1
- package/dist/types/components/Section.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -18241,9 +18241,9 @@
|
|
|
18241
18241
|
return value;
|
|
18242
18242
|
}
|
|
18243
18243
|
|
|
18244
|
-
/**
|
|
18245
|
-
* @typedef {object} Condition
|
|
18246
|
-
* @property {string} [hide]
|
|
18244
|
+
/**
|
|
18245
|
+
* @typedef {object} Condition
|
|
18246
|
+
* @property {string} [hide]
|
|
18247
18247
|
*/
|
|
18248
18248
|
|
|
18249
18249
|
class ConditionChecker {
|
|
@@ -18252,11 +18252,11 @@
|
|
|
18252
18252
|
this._eventBus = eventBus;
|
|
18253
18253
|
}
|
|
18254
18254
|
|
|
18255
|
-
/**
|
|
18256
|
-
* For given data, remove properties based on condition.
|
|
18257
|
-
*
|
|
18258
|
-
* @param {Object<string, any>} properties
|
|
18259
|
-
* @param {Object<string, any>} data
|
|
18255
|
+
/**
|
|
18256
|
+
* For given data, remove properties based on condition.
|
|
18257
|
+
*
|
|
18258
|
+
* @param {Object<string, any>} properties
|
|
18259
|
+
* @param {Object<string, any>} data
|
|
18260
18260
|
*/
|
|
18261
18261
|
applyConditions(properties, data = {}) {
|
|
18262
18262
|
const conditions = this._getConditions();
|
|
@@ -18275,13 +18275,13 @@
|
|
|
18275
18275
|
return newProperties;
|
|
18276
18276
|
}
|
|
18277
18277
|
|
|
18278
|
-
/**
|
|
18279
|
-
* Check if given condition is met. Returns null for invalid/missing conditions.
|
|
18280
|
-
*
|
|
18281
|
-
* @param {string} condition
|
|
18282
|
-
* @param {import('../types').Data} [data]
|
|
18283
|
-
*
|
|
18284
|
-
* @returns {boolean|null}
|
|
18278
|
+
/**
|
|
18279
|
+
* Check if given condition is met. Returns null for invalid/missing conditions.
|
|
18280
|
+
*
|
|
18281
|
+
* @param {string} condition
|
|
18282
|
+
* @param {import('../types').Data} [data]
|
|
18283
|
+
*
|
|
18284
|
+
* @returns {boolean|null}
|
|
18285
18285
|
*/
|
|
18286
18286
|
check(condition, data = {}) {
|
|
18287
18287
|
if (!condition) {
|
|
@@ -18302,12 +18302,12 @@
|
|
|
18302
18302
|
}
|
|
18303
18303
|
}
|
|
18304
18304
|
|
|
18305
|
-
/**
|
|
18306
|
-
* Check if hide condition is met.
|
|
18307
|
-
*
|
|
18308
|
-
* @param {Condition} condition
|
|
18309
|
-
* @param {Object<string, any>} data
|
|
18310
|
-
* @returns {boolean}
|
|
18305
|
+
/**
|
|
18306
|
+
* Check if hide condition is met.
|
|
18307
|
+
*
|
|
18308
|
+
* @param {Condition} condition
|
|
18309
|
+
* @param {Object<string, any>} data
|
|
18310
|
+
* @returns {boolean}
|
|
18311
18311
|
*/
|
|
18312
18312
|
_checkHideCondition(condition, data) {
|
|
18313
18313
|
if (!condition.hide) {
|
|
@@ -18317,13 +18317,13 @@
|
|
|
18317
18317
|
return result === true;
|
|
18318
18318
|
}
|
|
18319
18319
|
|
|
18320
|
-
/**
|
|
18321
|
-
* Evaluate an expression.
|
|
18322
|
-
*
|
|
18323
|
-
* @param {string} expression
|
|
18324
|
-
* @param {import('../types').Data} [data]
|
|
18325
|
-
*
|
|
18326
|
-
* @returns {any}
|
|
18320
|
+
/**
|
|
18321
|
+
* Evaluate an expression.
|
|
18322
|
+
*
|
|
18323
|
+
* @param {string} expression
|
|
18324
|
+
* @param {import('../types').Data} [data]
|
|
18325
|
+
*
|
|
18326
|
+
* @returns {any}
|
|
18327
18327
|
*/
|
|
18328
18328
|
evaluate(expression, data = {}) {
|
|
18329
18329
|
if (!expression) {
|
|
@@ -18928,11 +18928,11 @@
|
|
|
18928
18928
|
}
|
|
18929
18929
|
FormFieldRegistry$1.$inject = ['eventBus'];
|
|
18930
18930
|
|
|
18931
|
-
/**
|
|
18932
|
-
* Retrieve variable names from given FEEL unary test.
|
|
18933
|
-
*
|
|
18934
|
-
* @param {string} unaryTest
|
|
18935
|
-
* @returns {string[]}
|
|
18931
|
+
/**
|
|
18932
|
+
* Retrieve variable names from given FEEL unary test.
|
|
18933
|
+
*
|
|
18934
|
+
* @param {string} unaryTest
|
|
18935
|
+
* @returns {string[]}
|
|
18936
18936
|
*/
|
|
18937
18937
|
function getVariableNames(unaryTest) {
|
|
18938
18938
|
const tree = parseUnaryTests(unaryTest);
|
|
@@ -18947,11 +18947,11 @@
|
|
|
18947
18947
|
return Array.from(variables);
|
|
18948
18948
|
}
|
|
18949
18949
|
|
|
18950
|
-
/**
|
|
18951
|
-
* Retrieve variable names from given FEEL expression.
|
|
18952
|
-
*
|
|
18953
|
-
* @param {string} expression
|
|
18954
|
-
* @returns {string[]}
|
|
18950
|
+
/**
|
|
18951
|
+
* Retrieve variable names from given FEEL expression.
|
|
18952
|
+
*
|
|
18953
|
+
* @param {string} expression
|
|
18954
|
+
* @returns {string[]}
|
|
18955
18955
|
*/
|
|
18956
18956
|
function getExpressionVariableNames(expression) {
|
|
18957
18957
|
const tree = parseExpressions(expression);
|
|
@@ -19036,10 +19036,10 @@
|
|
|
19036
19036
|
return injector;
|
|
19037
19037
|
}
|
|
19038
19038
|
|
|
19039
|
-
/**
|
|
19040
|
-
* @param {string?} prefix
|
|
19041
|
-
*
|
|
19042
|
-
* @returns Element
|
|
19039
|
+
/**
|
|
19040
|
+
* @param {string?} prefix
|
|
19041
|
+
*
|
|
19042
|
+
* @returns Element
|
|
19043
19043
|
*/
|
|
19044
19044
|
function createFormContainer(prefix = 'fjs') {
|
|
19045
19045
|
const container = document.createElement('div');
|
|
@@ -19069,22 +19069,22 @@
|
|
|
19069
19069
|
return `${type}${generateIndexForType(type)}`;
|
|
19070
19070
|
}
|
|
19071
19071
|
|
|
19072
|
-
/**
|
|
19073
|
-
* @template T
|
|
19074
|
-
* @param {T} data
|
|
19075
|
-
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
19076
|
-
* @return {T}
|
|
19072
|
+
/**
|
|
19073
|
+
* @template T
|
|
19074
|
+
* @param {T} data
|
|
19075
|
+
* @param {(this: any, key: string, value: any) => any} [replacer]
|
|
19076
|
+
* @return {T}
|
|
19077
19077
|
*/
|
|
19078
19078
|
function clone(data, replacer) {
|
|
19079
19079
|
return JSON.parse(JSON.stringify(data, replacer));
|
|
19080
19080
|
}
|
|
19081
19081
|
|
|
19082
|
-
/**
|
|
19083
|
-
* Parse the schema for input variables a form might make use of
|
|
19084
|
-
*
|
|
19085
|
-
* @param {any} schema
|
|
19086
|
-
*
|
|
19087
|
-
* @return {string[]}
|
|
19082
|
+
/**
|
|
19083
|
+
* Parse the schema for input variables a form might make use of
|
|
19084
|
+
*
|
|
19085
|
+
* @param {any} schema
|
|
19086
|
+
*
|
|
19087
|
+
* @return {string[]}
|
|
19088
19088
|
*/
|
|
19089
19089
|
function getSchemaVariables(schema) {
|
|
19090
19090
|
if (!schema.components) {
|
|
@@ -19132,25 +19132,25 @@
|
|
|
19132
19132
|
return isString$3(value) && value.startsWith('=');
|
|
19133
19133
|
}
|
|
19134
19134
|
class Importer$1 {
|
|
19135
|
-
/**
|
|
19136
|
-
* @constructor
|
|
19137
|
-
* @param { import('../core').FormFieldRegistry } formFieldRegistry
|
|
19138
|
-
* @param { import('../render/FormFields').default } formFields
|
|
19135
|
+
/**
|
|
19136
|
+
* @constructor
|
|
19137
|
+
* @param { import('../core').FormFieldRegistry } formFieldRegistry
|
|
19138
|
+
* @param { import('../render/FormFields').default } formFields
|
|
19139
19139
|
*/
|
|
19140
19140
|
constructor(formFieldRegistry, formFields) {
|
|
19141
19141
|
this._formFieldRegistry = formFieldRegistry;
|
|
19142
19142
|
this._formFields = formFields;
|
|
19143
19143
|
}
|
|
19144
19144
|
|
|
19145
|
-
/**
|
|
19146
|
-
* Import schema adding `id`, `_parent` and `_path`
|
|
19147
|
-
* information to each field and adding it to the
|
|
19148
|
-
* form field registry.
|
|
19149
|
-
*
|
|
19150
|
-
* @param {any} schema
|
|
19151
|
-
* @param {any} [data]
|
|
19152
|
-
*
|
|
19153
|
-
* @return { { warnings: Array<any>, schema: any, data: any } }
|
|
19145
|
+
/**
|
|
19146
|
+
* Import schema adding `id`, `_parent` and `_path`
|
|
19147
|
+
* information to each field and adding it to the
|
|
19148
|
+
* form field registry.
|
|
19149
|
+
*
|
|
19150
|
+
* @param {any} schema
|
|
19151
|
+
* @param {any} [data]
|
|
19152
|
+
*
|
|
19153
|
+
* @return { { warnings: Array<any>, schema: any, data: any } }
|
|
19154
19154
|
*/
|
|
19155
19155
|
importSchema(schema, data = {}) {
|
|
19156
19156
|
// TODO: Add warnings - https://github.com/bpmn-io/form-js/issues/289
|
|
@@ -19169,11 +19169,11 @@
|
|
|
19169
19169
|
}
|
|
19170
19170
|
}
|
|
19171
19171
|
|
|
19172
|
-
/**
|
|
19173
|
-
* @param {any} formField
|
|
19174
|
-
* @param {string} [parentId]
|
|
19175
|
-
*
|
|
19176
|
-
* @return {any} importedField
|
|
19172
|
+
/**
|
|
19173
|
+
* @param {any} formField
|
|
19174
|
+
* @param {string} [parentId]
|
|
19175
|
+
*
|
|
19176
|
+
* @return {any} importedField
|
|
19177
19177
|
*/
|
|
19178
19178
|
importFormField(formField, parentId) {
|
|
19179
19179
|
const {
|
|
@@ -19224,10 +19224,10 @@
|
|
|
19224
19224
|
});
|
|
19225
19225
|
}
|
|
19226
19226
|
|
|
19227
|
-
/**
|
|
19228
|
-
* @param {Object} data
|
|
19229
|
-
*
|
|
19230
|
-
* @return {Object} initializedData
|
|
19227
|
+
/**
|
|
19228
|
+
* @param {Object} data
|
|
19229
|
+
*
|
|
19230
|
+
* @return {Object} initializedData
|
|
19231
19231
|
*/
|
|
19232
19232
|
initializeFieldValues(data) {
|
|
19233
19233
|
return this._formFieldRegistry.getAll().reduce((initializedData, formField) => {
|
|
@@ -19275,11 +19275,11 @@
|
|
|
19275
19275
|
|
|
19276
19276
|
const FORM_ELEMENT = document.createElement('form');
|
|
19277
19277
|
|
|
19278
|
-
/**
|
|
19279
|
-
* Sanitize a HTML string and return the cleaned, safe version.
|
|
19280
|
-
*
|
|
19281
|
-
* @param {string} html
|
|
19282
|
-
* @return {string}
|
|
19278
|
+
/**
|
|
19279
|
+
* Sanitize a HTML string and return the cleaned, safe version.
|
|
19280
|
+
*
|
|
19281
|
+
* @param {string} html
|
|
19282
|
+
* @return {string}
|
|
19283
19283
|
*/
|
|
19284
19284
|
function sanitizeHTML(html) {
|
|
19285
19285
|
const doc = new DOMParser().parseFromString(`<!DOCTYPE html>\n<html><body><div>${html}`, 'text/html');
|
|
@@ -19299,15 +19299,15 @@
|
|
|
19299
19299
|
return valid ? src : '';
|
|
19300
19300
|
}
|
|
19301
19301
|
|
|
19302
|
-
/**
|
|
19303
|
-
* Recursively sanitize a HTML node, potentially
|
|
19304
|
-
* removing it, its children or attributes.
|
|
19305
|
-
*
|
|
19306
|
-
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
19307
|
-
* and https://github.com/cure53/DOMPurify. Simplified
|
|
19308
|
-
* for our use-case.
|
|
19309
|
-
*
|
|
19310
|
-
* @param {Element} node
|
|
19302
|
+
/**
|
|
19303
|
+
* Recursively sanitize a HTML node, potentially
|
|
19304
|
+
* removing it, its children or attributes.
|
|
19305
|
+
*
|
|
19306
|
+
* Inspired by https://github.com/developit/snarkdown/issues/70
|
|
19307
|
+
* and https://github.com/cure53/DOMPurify. Simplified
|
|
19308
|
+
* for our use-case.
|
|
19309
|
+
*
|
|
19310
|
+
* @param {Element} node
|
|
19311
19311
|
*/
|
|
19312
19312
|
function sanitizeNode(node) {
|
|
19313
19313
|
// allow text nodes
|
|
@@ -19351,13 +19351,13 @@
|
|
|
19351
19351
|
}
|
|
19352
19352
|
}
|
|
19353
19353
|
|
|
19354
|
-
/**
|
|
19355
|
-
* Validates attributes for validity.
|
|
19356
|
-
*
|
|
19357
|
-
* @param {string} lcTag
|
|
19358
|
-
* @param {string} lcName
|
|
19359
|
-
* @param {string} value
|
|
19360
|
-
* @return {boolean}
|
|
19354
|
+
/**
|
|
19355
|
+
* Validates attributes for validity.
|
|
19356
|
+
*
|
|
19357
|
+
* @param {string} lcTag
|
|
19358
|
+
* @param {string} lcName
|
|
19359
|
+
* @param {string} value
|
|
19360
|
+
* @return {boolean}
|
|
19361
19361
|
*/
|
|
19362
19362
|
function isValidAttribute(lcTag, lcName, value) {
|
|
19363
19363
|
// disallow most attributes based on whitelist
|
|
@@ -19408,14 +19408,14 @@
|
|
|
19408
19408
|
return sanitizeHTML(html);
|
|
19409
19409
|
}
|
|
19410
19410
|
|
|
19411
|
-
/**
|
|
19412
|
-
* Sanitizes an image source to ensure we only allow for data URI and links
|
|
19413
|
-
* that start with http(s).
|
|
19414
|
-
*
|
|
19415
|
-
* Note: Most browsers anyway do not support script execution in <img> elements.
|
|
19416
|
-
*
|
|
19417
|
-
* @param {string} src
|
|
19418
|
-
* @returns {string}
|
|
19411
|
+
/**
|
|
19412
|
+
* Sanitizes an image source to ensure we only allow for data URI and links
|
|
19413
|
+
* that start with http(s).
|
|
19414
|
+
*
|
|
19415
|
+
* Note: Most browsers anyway do not support script execution in <img> elements.
|
|
19416
|
+
*
|
|
19417
|
+
* @param {string} src
|
|
19418
|
+
* @returns {string}
|
|
19419
19419
|
*/
|
|
19420
19420
|
function safeImageSource(src) {
|
|
19421
19421
|
return sanitizeImageSource(src);
|
|
@@ -19460,11 +19460,11 @@
|
|
|
19460
19460
|
}
|
|
19461
19461
|
});
|
|
19462
19462
|
|
|
19463
|
-
/**
|
|
19464
|
-
* @param {string} type
|
|
19465
|
-
* @param {boolean} [strict]
|
|
19466
|
-
*
|
|
19467
|
-
* @returns {any}
|
|
19463
|
+
/**
|
|
19464
|
+
* @param {string} type
|
|
19465
|
+
* @param {boolean} [strict]
|
|
19466
|
+
*
|
|
19467
|
+
* @returns {any}
|
|
19468
19468
|
*/
|
|
19469
19469
|
function getService$2(type, strict) {}
|
|
19470
19470
|
const FormContext = D$1({
|
|
@@ -19588,8 +19588,8 @@
|
|
|
19588
19588
|
return getService(type, strict);
|
|
19589
19589
|
}
|
|
19590
19590
|
|
|
19591
|
-
/**
|
|
19592
|
-
* @enum { String }
|
|
19591
|
+
/**
|
|
19592
|
+
* @enum { String }
|
|
19593
19593
|
*/
|
|
19594
19594
|
const LOAD_STATES = {
|
|
19595
19595
|
LOADING: 'loading',
|
|
@@ -19597,17 +19597,17 @@
|
|
|
19597
19597
|
ERROR: 'error'
|
|
19598
19598
|
};
|
|
19599
19599
|
|
|
19600
|
-
/**
|
|
19601
|
-
* @typedef {Object} ValuesGetter
|
|
19602
|
-
* @property {Object[]} values - The values data
|
|
19603
|
-
* @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
|
|
19600
|
+
/**
|
|
19601
|
+
* @typedef {Object} ValuesGetter
|
|
19602
|
+
* @property {Object[]} values - The values data
|
|
19603
|
+
* @property {(LOAD_STATES)} state - The values data's loading state, to use for conditional rendering
|
|
19604
19604
|
*/
|
|
19605
19605
|
|
|
19606
|
-
/**
|
|
19607
|
-
* A hook to load values for single and multiselect components.
|
|
19608
|
-
*
|
|
19609
|
-
* @param {Object} field - The form field to handle values for
|
|
19610
|
-
* @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
|
|
19606
|
+
/**
|
|
19607
|
+
* A hook to load values for single and multiselect components.
|
|
19608
|
+
*
|
|
19609
|
+
* @param {Object} field - The form field to handle values for
|
|
19610
|
+
* @return {ValuesGetter} valuesGetter - A values getter object providing loading state and values
|
|
19611
19611
|
*/
|
|
19612
19612
|
function useValuesAsync(field) {
|
|
19613
19613
|
const {
|
|
@@ -19939,13 +19939,13 @@
|
|
|
19939
19939
|
Checklist.emptyValue = [];
|
|
19940
19940
|
Checklist.sanitizeValue = sanitizeMultiSelectValue;
|
|
19941
19941
|
|
|
19942
|
-
/**
|
|
19943
|
-
* Check if condition is met with given variables.
|
|
19944
|
-
*
|
|
19945
|
-
* @param {string | undefined} condition
|
|
19946
|
-
* @param {import('../../types').Data} data
|
|
19947
|
-
*
|
|
19948
|
-
* @returns {boolean} true if condition is met or no condition or condition checker exists
|
|
19942
|
+
/**
|
|
19943
|
+
* Check if condition is met with given variables.
|
|
19944
|
+
*
|
|
19945
|
+
* @param {string | undefined} condition
|
|
19946
|
+
* @param {import('../../types').Data} data
|
|
19947
|
+
*
|
|
19948
|
+
* @returns {boolean} true if condition is met or no condition or condition checker exists
|
|
19949
19949
|
*/
|
|
19950
19950
|
function useCondition(condition, data) {
|
|
19951
19951
|
const initialData = useService$2('form')._getState().initialData;
|
|
@@ -20714,10 +20714,10 @@
|
|
|
20714
20714
|
Datetime.emptyValue = null;
|
|
20715
20715
|
Datetime.sanitizeValue = sanitizeDateTimePickerValue;
|
|
20716
20716
|
|
|
20717
|
-
/**
|
|
20718
|
-
* This file must not be changed or exchanged.
|
|
20719
|
-
*
|
|
20720
|
-
* @see http://bpmn.io/license for more information.
|
|
20717
|
+
/**
|
|
20718
|
+
* This file must not be changed or exchanged.
|
|
20719
|
+
*
|
|
20720
|
+
* @see http://bpmn.io/license for more information.
|
|
20721
20721
|
*/
|
|
20722
20722
|
function Logo() {
|
|
20723
20723
|
return e$1("svg", {
|
|
@@ -20833,10 +20833,10 @@
|
|
|
20833
20833
|
});
|
|
20834
20834
|
}
|
|
20835
20835
|
|
|
20836
|
-
/**
|
|
20837
|
-
*
|
|
20838
|
-
* @param {string | undefined} expression
|
|
20839
|
-
* @param {import('../../types').Data} data
|
|
20836
|
+
/**
|
|
20837
|
+
*
|
|
20838
|
+
* @param {string | undefined} expression
|
|
20839
|
+
* @param {import('../../types').Data} data
|
|
20840
20840
|
*/
|
|
20841
20841
|
function useEvaluation(expression, data) {
|
|
20842
20842
|
const initialData = useService$2('form')._getState().initialData;
|
|
@@ -20853,9 +20853,9 @@
|
|
|
20853
20853
|
return conditionChecker.evaluate(expression, filteredData);
|
|
20854
20854
|
}
|
|
20855
20855
|
|
|
20856
|
-
/**
|
|
20857
|
-
*
|
|
20858
|
-
* @param {string} value
|
|
20856
|
+
/**
|
|
20857
|
+
*
|
|
20858
|
+
* @param {string} value
|
|
20859
20859
|
*/
|
|
20860
20860
|
function useExpressionValue(value) {
|
|
20861
20861
|
const formData = useService$2('form')._getState().data;
|
|
@@ -21120,6 +21120,7 @@
|
|
|
21120
21120
|
}),
|
|
21121
21121
|
children: [e$1("button", {
|
|
21122
21122
|
class: "fjs-number-arrow-up",
|
|
21123
|
+
type: "button",
|
|
21123
21124
|
onClick: () => increment(),
|
|
21124
21125
|
tabIndex: -1,
|
|
21125
21126
|
children: "\u02C4"
|
|
@@ -21127,6 +21128,7 @@
|
|
|
21127
21128
|
class: "fjs-number-arrow-separator"
|
|
21128
21129
|
}), e$1("button", {
|
|
21129
21130
|
class: "fjs-number-arrow-down",
|
|
21131
|
+
type: "button",
|
|
21130
21132
|
onClick: () => decrement(),
|
|
21131
21133
|
tabIndex: -1,
|
|
21132
21134
|
children: "\u02C5"
|
|
@@ -46321,10 +46323,10 @@
|
|
|
46321
46323
|
return fn.apply(null, args);
|
|
46322
46324
|
}
|
|
46323
46325
|
|
|
46324
|
-
/**
|
|
46325
|
-
* A factory to create a configurable debouncer.
|
|
46326
|
-
*
|
|
46327
|
-
* @param {number|boolean} [config=true]
|
|
46326
|
+
/**
|
|
46327
|
+
* A factory to create a configurable debouncer.
|
|
46328
|
+
*
|
|
46329
|
+
* @param {number|boolean} [config=true]
|
|
46328
46330
|
*/
|
|
46329
46331
|
function DebounceFactory(config = true) {
|
|
46330
46332
|
const timeout = typeof config === 'number' ? config : config ? 300 : 0;
|
|
@@ -46336,11 +46338,11 @@
|
|
|
46336
46338
|
}
|
|
46337
46339
|
DebounceFactory.$inject = ['config.debounce'];
|
|
46338
46340
|
class FieldFactory {
|
|
46339
|
-
/**
|
|
46340
|
-
* @constructor
|
|
46341
|
-
*
|
|
46342
|
-
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
46343
|
-
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
46341
|
+
/**
|
|
46342
|
+
* @constructor
|
|
46343
|
+
*
|
|
46344
|
+
* @param { import('./FormFieldRegistry').default } formFieldRegistry
|
|
46345
|
+
* @param { import('@bpmn-io/form-js-viewer').FormFields } formFields
|
|
46344
46346
|
*/
|
|
46345
46347
|
constructor(formFieldRegistry, formFields) {
|
|
46346
46348
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -46399,11 +46401,11 @@
|
|
|
46399
46401
|
}
|
|
46400
46402
|
FieldFactory.$inject = ['formFieldRegistry', 'formFields'];
|
|
46401
46403
|
class FormFieldRegistry extends FormFieldRegistry$1 {
|
|
46402
|
-
/**
|
|
46403
|
-
* Updates a form fields id.
|
|
46404
|
-
*
|
|
46405
|
-
* @param {Object} formField
|
|
46406
|
-
* @param {string} newId
|
|
46404
|
+
/**
|
|
46405
|
+
* Updates a form fields id.
|
|
46406
|
+
*
|
|
46407
|
+
* @param {Object} formField
|
|
46408
|
+
* @param {string} newId
|
|
46407
46409
|
*/
|
|
46408
46410
|
updateId(formField, newId) {
|
|
46409
46411
|
this._validateId(newId);
|
|
@@ -46424,13 +46426,13 @@
|
|
|
46424
46426
|
}
|
|
46425
46427
|
}
|
|
46426
46428
|
|
|
46427
|
-
/**
|
|
46428
|
-
* Validate the suitability of the given id and signals a problem
|
|
46429
|
-
* with an exception.
|
|
46430
|
-
*
|
|
46431
|
-
* @param {string} id
|
|
46432
|
-
*
|
|
46433
|
-
* @throws {Error} if id is empty or already assigned
|
|
46429
|
+
/**
|
|
46430
|
+
* Validate the suitability of the given id and signals a problem
|
|
46431
|
+
* with an exception.
|
|
46432
|
+
*
|
|
46433
|
+
* @param {string} id
|
|
46434
|
+
*
|
|
46435
|
+
* @throws {Error} if id is empty or already assigned
|
|
46434
46436
|
*/
|
|
46435
46437
|
_validateId(id) {
|
|
46436
46438
|
if (!id) {
|
|
@@ -46442,31 +46444,31 @@
|
|
|
46442
46444
|
}
|
|
46443
46445
|
}
|
|
46444
46446
|
class Importer {
|
|
46445
|
-
/**
|
|
46446
|
-
* @constructor
|
|
46447
|
-
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
46448
|
-
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
46447
|
+
/**
|
|
46448
|
+
* @constructor
|
|
46449
|
+
* @param { import('../core/FormFieldRegistry').default } formFieldRegistry
|
|
46450
|
+
* @param { import('../core/FieldFactory').default } fieldFactory
|
|
46449
46451
|
*/
|
|
46450
46452
|
constructor(formFieldRegistry, fieldFactory) {
|
|
46451
46453
|
this._formFieldRegistry = formFieldRegistry;
|
|
46452
46454
|
this._fieldFactory = fieldFactory;
|
|
46453
46455
|
}
|
|
46454
46456
|
|
|
46455
|
-
/**
|
|
46456
|
-
* Import schema creating fields, attaching additional
|
|
46457
|
-
* information to each field and adding fields to the
|
|
46458
|
-
* field registry.
|
|
46459
|
-
*
|
|
46460
|
-
* Additional information attached:
|
|
46461
|
-
*
|
|
46462
|
-
* * `id` (unless present)
|
|
46463
|
-
* * `_parent`
|
|
46464
|
-
* * `_path`
|
|
46465
|
-
*
|
|
46466
|
-
* @param {any} schema
|
|
46467
|
-
*
|
|
46468
|
-
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
46469
|
-
* @returns {ImportResult}
|
|
46457
|
+
/**
|
|
46458
|
+
* Import schema creating fields, attaching additional
|
|
46459
|
+
* information to each field and adding fields to the
|
|
46460
|
+
* field registry.
|
|
46461
|
+
*
|
|
46462
|
+
* Additional information attached:
|
|
46463
|
+
*
|
|
46464
|
+
* * `id` (unless present)
|
|
46465
|
+
* * `_parent`
|
|
46466
|
+
* * `_path`
|
|
46467
|
+
*
|
|
46468
|
+
* @param {any} schema
|
|
46469
|
+
*
|
|
46470
|
+
* @typedef {{ warnings: Error[], schema: any }} ImportResult
|
|
46471
|
+
* @returns {ImportResult}
|
|
46470
46472
|
*/
|
|
46471
46473
|
importSchema(schema) {
|
|
46472
46474
|
// TODO: Add warnings
|
|
@@ -46483,12 +46485,12 @@
|
|
|
46483
46485
|
}
|
|
46484
46486
|
}
|
|
46485
46487
|
|
|
46486
|
-
/**
|
|
46487
|
-
* @param {{[x: string]: any}} fieldAttrs
|
|
46488
|
-
* @param {String} [parentId]
|
|
46489
|
-
* @param {number} [index]
|
|
46490
|
-
*
|
|
46491
|
-
* @return {any} field
|
|
46488
|
+
/**
|
|
46489
|
+
* @param {{[x: string]: any}} fieldAttrs
|
|
46490
|
+
* @param {String} [parentId]
|
|
46491
|
+
* @param {number} [index]
|
|
46492
|
+
*
|
|
46493
|
+
* @return {any} field
|
|
46492
46494
|
*/
|
|
46493
46495
|
importFormField(fieldAttrs, parentId, index) {
|
|
46494
46496
|
const {
|
|
@@ -46525,11 +46527,11 @@
|
|
|
46525
46527
|
return field;
|
|
46526
46528
|
}
|
|
46527
46529
|
|
|
46528
|
-
/**
|
|
46529
|
-
* @param {Array<any>} components
|
|
46530
|
-
* @param {string} parentId
|
|
46531
|
-
*
|
|
46532
|
-
* @return {Array<any>} imported components
|
|
46530
|
+
/**
|
|
46531
|
+
* @param {Array<any>} components
|
|
46532
|
+
* @param {string} parentId
|
|
46533
|
+
*
|
|
46534
|
+
* @return {Array<any>} imported components
|
|
46533
46535
|
*/
|
|
46534
46536
|
importFormFields(components, parentId) {
|
|
46535
46537
|
return components.map((component, index) => {
|
|
@@ -46545,11 +46547,11 @@
|
|
|
46545
46547
|
drake: null
|
|
46546
46548
|
});
|
|
46547
46549
|
|
|
46548
|
-
/**
|
|
46549
|
-
* @param {string} type
|
|
46550
|
-
* @param {boolean} [strict]
|
|
46551
|
-
*
|
|
46552
|
-
* @returns {any}
|
|
46550
|
+
/**
|
|
46551
|
+
* @param {string} type
|
|
46552
|
+
* @param {boolean} [strict]
|
|
46553
|
+
*
|
|
46554
|
+
* @returns {any}
|
|
46553
46555
|
*/
|
|
46554
46556
|
function getService$1(type, strict) {}
|
|
46555
46557
|
const FormEditorContext = D$1({
|
|
@@ -47613,10 +47615,10 @@
|
|
|
47613
47615
|
return formField;
|
|
47614
47616
|
}
|
|
47615
47617
|
class AddFormFieldHandler {
|
|
47616
|
-
/**
|
|
47617
|
-
* @constructor
|
|
47618
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
47619
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47618
|
+
/**
|
|
47619
|
+
* @constructor
|
|
47620
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
47621
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47620
47622
|
*/
|
|
47621
47623
|
constructor(formEditor, formFieldRegistry) {
|
|
47622
47624
|
this._formEditor = formEditor;
|
|
@@ -47676,10 +47678,10 @@
|
|
|
47676
47678
|
}
|
|
47677
47679
|
AddFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
47678
47680
|
class EditFormFieldHandler {
|
|
47679
|
-
/**
|
|
47680
|
-
* @constructor
|
|
47681
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
47682
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47681
|
+
/**
|
|
47682
|
+
* @constructor
|
|
47683
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
47684
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47683
47685
|
*/
|
|
47684
47686
|
constructor(formEditor, formFieldRegistry) {
|
|
47685
47687
|
this._formEditor = formEditor;
|
|
@@ -47741,10 +47743,10 @@
|
|
|
47741
47743
|
}
|
|
47742
47744
|
EditFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
47743
47745
|
class MoveFormFieldHandler {
|
|
47744
|
-
/**
|
|
47745
|
-
* @constructor
|
|
47746
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
47747
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47746
|
+
/**
|
|
47747
|
+
* @constructor
|
|
47748
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
47749
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47748
47750
|
*/
|
|
47749
47751
|
constructor(formEditor, formFieldRegistry) {
|
|
47750
47752
|
this._formEditor = formEditor;
|
|
@@ -47820,10 +47822,10 @@
|
|
|
47820
47822
|
}
|
|
47821
47823
|
MoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
47822
47824
|
class RemoveFormFieldHandler {
|
|
47823
|
-
/**
|
|
47824
|
-
* @constructor
|
|
47825
|
-
* @param { import('../../../FormEditor').default } formEditor
|
|
47826
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47825
|
+
/**
|
|
47826
|
+
* @constructor
|
|
47827
|
+
* @param { import('../../../FormEditor').default } formEditor
|
|
47828
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47827
47829
|
*/
|
|
47828
47830
|
constructor(formEditor, formFieldRegistry) {
|
|
47829
47831
|
this._formEditor = formEditor;
|
|
@@ -47882,9 +47884,9 @@
|
|
|
47882
47884
|
}
|
|
47883
47885
|
RemoveFormFieldHandler.$inject = ['formEditor', 'formFieldRegistry'];
|
|
47884
47886
|
class UpdateIdClaimHandler {
|
|
47885
|
-
/**
|
|
47886
|
-
* @constructor
|
|
47887
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47887
|
+
/**
|
|
47888
|
+
* @constructor
|
|
47889
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47888
47890
|
*/
|
|
47889
47891
|
constructor(formFieldRegistry) {
|
|
47890
47892
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -47916,9 +47918,9 @@
|
|
|
47916
47918
|
}
|
|
47917
47919
|
UpdateIdClaimHandler.$inject = ['formFieldRegistry'];
|
|
47918
47920
|
class UpdateKeyClaimHandler {
|
|
47919
|
-
/**
|
|
47920
|
-
* @constructor
|
|
47921
|
-
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47921
|
+
/**
|
|
47922
|
+
* @constructor
|
|
47923
|
+
* @param { import('../../../core/FormFieldRegistry').default } formFieldRegistry
|
|
47922
47924
|
*/
|
|
47923
47925
|
constructor(formFieldRegistry) {
|
|
47924
47926
|
this._formFieldRegistry = formFieldRegistry;
|
|
@@ -48804,10 +48806,10 @@
|
|
|
48804
48806
|
});
|
|
48805
48807
|
}
|
|
48806
48808
|
|
|
48807
|
-
/**
|
|
48808
|
-
* Attach the palette to a parent node.
|
|
48809
|
-
*
|
|
48810
|
-
* @param {HTMLElement} container
|
|
48809
|
+
/**
|
|
48810
|
+
* Attach the palette to a parent node.
|
|
48811
|
+
*
|
|
48812
|
+
* @param {HTMLElement} container
|
|
48811
48813
|
*/
|
|
48812
48814
|
attachTo(container) {
|
|
48813
48815
|
if (!container) {
|
|
@@ -48827,8 +48829,8 @@
|
|
|
48827
48829
|
this._eventBus.fire('palette.attach');
|
|
48828
48830
|
}
|
|
48829
48831
|
|
|
48830
|
-
/**
|
|
48831
|
-
* Detach the palette from its parent node.
|
|
48832
|
+
/**
|
|
48833
|
+
* Detach the palette from its parent node.
|
|
48832
48834
|
*/
|
|
48833
48835
|
detach() {
|
|
48834
48836
|
const parentNode = this._container.parentNode;
|
|
@@ -50963,11 +50965,11 @@
|
|
|
50963
50965
|
return `bio-properties-panel-${id}`;
|
|
50964
50966
|
}
|
|
50965
50967
|
|
|
50966
|
-
/**
|
|
50967
|
-
* @param {string} type
|
|
50968
|
-
* @param {boolean} [strict]
|
|
50969
|
-
*
|
|
50970
|
-
* @returns {any}
|
|
50968
|
+
/**
|
|
50969
|
+
* @param {string} type
|
|
50970
|
+
* @param {boolean} [strict]
|
|
50971
|
+
*
|
|
50972
|
+
* @returns {any}
|
|
50971
50973
|
*/
|
|
50972
50974
|
function getService(type, strict) {}
|
|
50973
50975
|
const PropertiesPanelContext = D$1({
|
|
@@ -51053,8 +51055,8 @@
|
|
|
51053
51055
|
}
|
|
51054
51056
|
};
|
|
51055
51057
|
|
|
51056
|
-
/**
|
|
51057
|
-
* Provide placeholders for empty and multiple state.
|
|
51058
|
+
/**
|
|
51059
|
+
* Provide placeholders for empty and multiple state.
|
|
51058
51060
|
*/
|
|
51059
51061
|
const PropertiesPanelPlaceholderProvider = {
|
|
51060
51062
|
getEmpty: () => {
|
|
@@ -51124,10 +51126,10 @@
|
|
|
51124
51126
|
return getService(type, strict);
|
|
51125
51127
|
}
|
|
51126
51128
|
|
|
51127
|
-
/**
|
|
51128
|
-
* Retrieve list of variables from the form schema.
|
|
51129
|
-
*
|
|
51130
|
-
* @returns { string[] } list of variables used in form schema
|
|
51129
|
+
/**
|
|
51130
|
+
* Retrieve list of variables from the form schema.
|
|
51131
|
+
*
|
|
51132
|
+
* @returns { string[] } list of variables used in form schema
|
|
51131
51133
|
*/
|
|
51132
51134
|
function useVariables() {
|
|
51133
51135
|
const form = useService('formEditor');
|
|
@@ -52394,14 +52396,14 @@
|
|
|
52394
52396
|
|
|
52395
52397
|
// helpers //////////
|
|
52396
52398
|
|
|
52397
|
-
/**
|
|
52398
|
-
* Returns copy of object with updated value.
|
|
52399
|
-
*
|
|
52400
|
-
* @param {Object} properties
|
|
52401
|
-
* @param {string} key
|
|
52402
|
-
* @param {string} value
|
|
52403
|
-
*
|
|
52404
|
-
* @returns {Object}
|
|
52399
|
+
/**
|
|
52400
|
+
* Returns copy of object with updated value.
|
|
52401
|
+
*
|
|
52402
|
+
* @param {Object} properties
|
|
52403
|
+
* @param {string} key
|
|
52404
|
+
* @param {string} value
|
|
52405
|
+
*
|
|
52406
|
+
* @returns {Object}
|
|
52405
52407
|
*/
|
|
52406
52408
|
function updateValue(properties, key, value) {
|
|
52407
52409
|
return {
|
|
@@ -52410,14 +52412,14 @@
|
|
|
52410
52412
|
};
|
|
52411
52413
|
}
|
|
52412
52414
|
|
|
52413
|
-
/**
|
|
52414
|
-
* Returns copy of object with updated key.
|
|
52415
|
-
*
|
|
52416
|
-
* @param {Object} properties
|
|
52417
|
-
* @param {string} oldKey
|
|
52418
|
-
* @param {string} newKey
|
|
52419
|
-
*
|
|
52420
|
-
* @returns {Object}
|
|
52415
|
+
/**
|
|
52416
|
+
* Returns copy of object with updated key.
|
|
52417
|
+
*
|
|
52418
|
+
* @param {Object} properties
|
|
52419
|
+
* @param {string} oldKey
|
|
52420
|
+
* @param {string} newKey
|
|
52421
|
+
*
|
|
52422
|
+
* @returns {Object}
|
|
52421
52423
|
*/
|
|
52422
52424
|
function updateKey(properties, oldKey, newKey) {
|
|
52423
52425
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -53032,8 +53034,8 @@
|
|
|
53032
53034
|
};
|
|
53033
53035
|
const valuesSourceId = `${fieldId}-valuesSource`;
|
|
53034
53036
|
|
|
53035
|
-
/**
|
|
53036
|
-
* @type {Array<Group|ListGroup>}
|
|
53037
|
+
/**
|
|
53038
|
+
* @type {Array<Group|ListGroup>}
|
|
53037
53039
|
*/
|
|
53038
53040
|
const groups = [{
|
|
53039
53041
|
id: valuesSourceId,
|
|
@@ -53133,13 +53135,13 @@
|
|
|
53133
53135
|
|
|
53134
53136
|
// helpers //////////
|
|
53135
53137
|
|
|
53136
|
-
/**
|
|
53137
|
-
* Returns copy of object without key.
|
|
53138
|
-
*
|
|
53139
|
-
* @param {Object} properties
|
|
53140
|
-
* @param {string} oldKey
|
|
53141
|
-
*
|
|
53142
|
-
* @returns {Object}
|
|
53138
|
+
/**
|
|
53139
|
+
* Returns copy of object without key.
|
|
53140
|
+
*
|
|
53141
|
+
* @param {Object} properties
|
|
53142
|
+
* @param {string} oldKey
|
|
53143
|
+
*
|
|
53144
|
+
* @returns {Object}
|
|
53143
53145
|
*/
|
|
53144
53146
|
function removeKey(properties, oldKey) {
|
|
53145
53147
|
return Object.entries(properties).reduce((newProperties, entry) => {
|
|
@@ -53229,9 +53231,9 @@
|
|
|
53229
53231
|
}, []);
|
|
53230
53232
|
h(() => {
|
|
53231
53233
|
const onFieldChanged = () => {
|
|
53232
|
-
/**
|
|
53233
|
-
* TODO(pinussilvestrus): update with actual updated element,
|
|
53234
|
-
* once we have a proper updater/change support
|
|
53234
|
+
/**
|
|
53235
|
+
* TODO(pinussilvestrus): update with actual updated element,
|
|
53236
|
+
* once we have a proper updater/change support
|
|
53235
53237
|
*/
|
|
53236
53238
|
_update(selection.get() || schema);
|
|
53237
53239
|
};
|
|
@@ -53282,10 +53284,10 @@
|
|
|
53282
53284
|
});
|
|
53283
53285
|
}
|
|
53284
53286
|
|
|
53285
|
-
/**
|
|
53286
|
-
* Attach the properties panel to a parent node.
|
|
53287
|
-
*
|
|
53288
|
-
* @param {HTMLElement} container
|
|
53287
|
+
/**
|
|
53288
|
+
* Attach the properties panel to a parent node.
|
|
53289
|
+
*
|
|
53290
|
+
* @param {HTMLElement} container
|
|
53289
53291
|
*/
|
|
53290
53292
|
attachTo(container) {
|
|
53291
53293
|
if (!container) {
|
|
@@ -53305,8 +53307,8 @@
|
|
|
53305
53307
|
this._eventBus.fire('propertiesPanel.attach');
|
|
53306
53308
|
}
|
|
53307
53309
|
|
|
53308
|
-
/**
|
|
53309
|
-
* Detach the properties panel from its parent node.
|
|
53310
|
+
/**
|
|
53311
|
+
* Detach the properties panel from its parent node.
|
|
53310
53312
|
*/
|
|
53311
53313
|
detach() {
|
|
53312
53314
|
const parentNode = this._container.parentNode;
|
|
@@ -53336,48 +53338,48 @@
|
|
|
53336
53338
|
};
|
|
53337
53339
|
const ids = new Ids([32, 36, 1]);
|
|
53338
53340
|
|
|
53339
|
-
/**
|
|
53340
|
-
* @typedef { import('./types').Injector } Injector
|
|
53341
|
-
* @typedef { import('./types').Module } Module
|
|
53342
|
-
* @typedef { import('./types').Schema } Schema
|
|
53343
|
-
*
|
|
53344
|
-
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
53345
|
-
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
53346
|
-
*
|
|
53347
|
-
* @typedef { {
|
|
53348
|
-
* properties: FormEditorProperties,
|
|
53349
|
-
* schema: Schema
|
|
53350
|
-
* } } State
|
|
53351
|
-
*
|
|
53352
|
-
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
53353
|
-
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
53354
|
-
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
53341
|
+
/**
|
|
53342
|
+
* @typedef { import('./types').Injector } Injector
|
|
53343
|
+
* @typedef { import('./types').Module } Module
|
|
53344
|
+
* @typedef { import('./types').Schema } Schema
|
|
53345
|
+
*
|
|
53346
|
+
* @typedef { import('./types').FormEditorOptions } FormEditorOptions
|
|
53347
|
+
* @typedef { import('./types').FormEditorProperties } FormEditorProperties
|
|
53348
|
+
*
|
|
53349
|
+
* @typedef { {
|
|
53350
|
+
* properties: FormEditorProperties,
|
|
53351
|
+
* schema: Schema
|
|
53352
|
+
* } } State
|
|
53353
|
+
*
|
|
53354
|
+
* @typedef { (type:string, priority:number, handler:Function) => void } OnEventWithPriority
|
|
53355
|
+
* @typedef { (type:string, handler:Function) => void } OnEventWithOutPriority
|
|
53356
|
+
* @typedef { OnEventWithPriority & OnEventWithOutPriority } OnEventType
|
|
53355
53357
|
*/
|
|
53356
53358
|
|
|
53357
|
-
/**
|
|
53358
|
-
* The form editor.
|
|
53359
|
+
/**
|
|
53360
|
+
* The form editor.
|
|
53359
53361
|
*/
|
|
53360
53362
|
class FormEditor {
|
|
53361
|
-
/**
|
|
53362
|
-
* @constructor
|
|
53363
|
-
* @param {FormEditorOptions} options
|
|
53363
|
+
/**
|
|
53364
|
+
* @constructor
|
|
53365
|
+
* @param {FormEditorOptions} options
|
|
53364
53366
|
*/
|
|
53365
53367
|
constructor(options = {}) {
|
|
53366
|
-
/**
|
|
53367
|
-
* @public
|
|
53368
|
-
* @type {OnEventType}
|
|
53368
|
+
/**
|
|
53369
|
+
* @public
|
|
53370
|
+
* @type {OnEventType}
|
|
53369
53371
|
*/
|
|
53370
53372
|
this.on = this._onEvent;
|
|
53371
53373
|
|
|
53372
|
-
/**
|
|
53373
|
-
* @public
|
|
53374
|
-
* @type {String}
|
|
53374
|
+
/**
|
|
53375
|
+
* @public
|
|
53376
|
+
* @type {String}
|
|
53375
53377
|
*/
|
|
53376
53378
|
this._id = ids.next();
|
|
53377
53379
|
|
|
53378
|
-
/**
|
|
53379
|
-
* @private
|
|
53380
|
-
* @type {Element}
|
|
53380
|
+
/**
|
|
53381
|
+
* @private
|
|
53382
|
+
* @type {Element}
|
|
53381
53383
|
*/
|
|
53382
53384
|
this._container = createFormContainer();
|
|
53383
53385
|
this._container.setAttribute('input-handle-modified-keys', 'z,y');
|
|
@@ -53388,15 +53390,15 @@
|
|
|
53388
53390
|
properties = {}
|
|
53389
53391
|
} = options;
|
|
53390
53392
|
|
|
53391
|
-
/**
|
|
53392
|
-
* @private
|
|
53393
|
-
* @type {any}
|
|
53393
|
+
/**
|
|
53394
|
+
* @private
|
|
53395
|
+
* @type {any}
|
|
53394
53396
|
*/
|
|
53395
53397
|
this.exporter = exporter;
|
|
53396
53398
|
|
|
53397
|
-
/**
|
|
53398
|
-
* @private
|
|
53399
|
-
* @type {State}
|
|
53399
|
+
/**
|
|
53400
|
+
* @private
|
|
53401
|
+
* @type {State}
|
|
53400
53402
|
*/
|
|
53401
53403
|
this._state = {
|
|
53402
53404
|
properties,
|
|
@@ -53425,10 +53427,10 @@
|
|
|
53425
53427
|
this._detach(false);
|
|
53426
53428
|
}
|
|
53427
53429
|
|
|
53428
|
-
/**
|
|
53429
|
-
* @param {Schema} schema
|
|
53430
|
-
*
|
|
53431
|
-
* @return {Promise<{ warnings: Array<any> }>}
|
|
53430
|
+
/**
|
|
53431
|
+
* @param {Schema} schema
|
|
53432
|
+
*
|
|
53433
|
+
* @return {Promise<{ warnings: Array<any> }>}
|
|
53432
53434
|
*/
|
|
53433
53435
|
importSchema(schema) {
|
|
53434
53436
|
return new Promise((resolve, reject) => {
|
|
@@ -53457,15 +53459,15 @@
|
|
|
53457
53459
|
});
|
|
53458
53460
|
}
|
|
53459
53461
|
|
|
53460
|
-
/**
|
|
53461
|
-
* @returns {Schema}
|
|
53462
|
+
/**
|
|
53463
|
+
* @returns {Schema}
|
|
53462
53464
|
*/
|
|
53463
53465
|
saveSchema() {
|
|
53464
53466
|
return this.getSchema();
|
|
53465
53467
|
}
|
|
53466
53468
|
|
|
53467
|
-
/**
|
|
53468
|
-
* @returns {Schema}
|
|
53469
|
+
/**
|
|
53470
|
+
* @returns {Schema}
|
|
53469
53471
|
*/
|
|
53470
53472
|
getSchema() {
|
|
53471
53473
|
const {
|
|
@@ -53474,8 +53476,8 @@
|
|
|
53474
53476
|
return exportSchema(schema, this.exporter, schemaVersion);
|
|
53475
53477
|
}
|
|
53476
53478
|
|
|
53477
|
-
/**
|
|
53478
|
-
* @param {Element|string} parentNode
|
|
53479
|
+
/**
|
|
53480
|
+
* @param {Element|string} parentNode
|
|
53479
53481
|
*/
|
|
53480
53482
|
attachTo(parentNode) {
|
|
53481
53483
|
if (!parentNode) {
|
|
@@ -53493,10 +53495,10 @@
|
|
|
53493
53495
|
this._detach();
|
|
53494
53496
|
}
|
|
53495
53497
|
|
|
53496
|
-
/**
|
|
53497
|
-
* @internal
|
|
53498
|
-
*
|
|
53499
|
-
* @param {boolean} [emit]
|
|
53498
|
+
/**
|
|
53499
|
+
* @internal
|
|
53500
|
+
*
|
|
53501
|
+
* @param {boolean} [emit]
|
|
53500
53502
|
*/
|
|
53501
53503
|
_detach(emit = true) {
|
|
53502
53504
|
const container = this._container,
|
|
@@ -53510,9 +53512,9 @@
|
|
|
53510
53512
|
parentNode.removeChild(container);
|
|
53511
53513
|
}
|
|
53512
53514
|
|
|
53513
|
-
/**
|
|
53514
|
-
* @param {any} property
|
|
53515
|
-
* @param {any} value
|
|
53515
|
+
/**
|
|
53516
|
+
* @param {any} property
|
|
53517
|
+
* @param {any} value
|
|
53516
53518
|
*/
|
|
53517
53519
|
setProperty(property, value) {
|
|
53518
53520
|
const properties = set(this._getState().properties, [property], value);
|
|
@@ -53521,21 +53523,21 @@
|
|
|
53521
53523
|
});
|
|
53522
53524
|
}
|
|
53523
53525
|
|
|
53524
|
-
/**
|
|
53525
|
-
* @param {string} type
|
|
53526
|
-
* @param {Function} handler
|
|
53526
|
+
/**
|
|
53527
|
+
* @param {string} type
|
|
53528
|
+
* @param {Function} handler
|
|
53527
53529
|
*/
|
|
53528
53530
|
off(type, handler) {
|
|
53529
53531
|
this.get('eventBus').off(type, handler);
|
|
53530
53532
|
}
|
|
53531
53533
|
|
|
53532
|
-
/**
|
|
53533
|
-
* @internal
|
|
53534
|
-
*
|
|
53535
|
-
* @param {FormEditorOptions} options
|
|
53536
|
-
* @param {Element} container
|
|
53537
|
-
*
|
|
53538
|
-
* @returns {Injector}
|
|
53534
|
+
/**
|
|
53535
|
+
* @internal
|
|
53536
|
+
*
|
|
53537
|
+
* @param {FormEditorOptions} options
|
|
53538
|
+
* @param {Element} container
|
|
53539
|
+
*
|
|
53540
|
+
* @returns {Injector}
|
|
53539
53541
|
*/
|
|
53540
53542
|
_createInjector(options, container) {
|
|
53541
53543
|
const {
|
|
@@ -53557,22 +53559,22 @@
|
|
|
53557
53559
|
}, core, ...modules, ...additionalModules]);
|
|
53558
53560
|
}
|
|
53559
53561
|
|
|
53560
|
-
/**
|
|
53561
|
-
* @internal
|
|
53562
|
+
/**
|
|
53563
|
+
* @internal
|
|
53562
53564
|
*/
|
|
53563
53565
|
_emit(type, data) {
|
|
53564
53566
|
this.get('eventBus').fire(type, data);
|
|
53565
53567
|
}
|
|
53566
53568
|
|
|
53567
|
-
/**
|
|
53568
|
-
* @internal
|
|
53569
|
+
/**
|
|
53570
|
+
* @internal
|
|
53569
53571
|
*/
|
|
53570
53572
|
_getState() {
|
|
53571
53573
|
return this._state;
|
|
53572
53574
|
}
|
|
53573
53575
|
|
|
53574
|
-
/**
|
|
53575
|
-
* @internal
|
|
53576
|
+
/**
|
|
53577
|
+
* @internal
|
|
53576
53578
|
*/
|
|
53577
53579
|
_setState(state) {
|
|
53578
53580
|
this._state = {
|
|
@@ -53582,15 +53584,15 @@
|
|
|
53582
53584
|
this._emit('changed', this._getState());
|
|
53583
53585
|
}
|
|
53584
53586
|
|
|
53585
|
-
/**
|
|
53586
|
-
* @internal
|
|
53587
|
+
/**
|
|
53588
|
+
* @internal
|
|
53587
53589
|
*/
|
|
53588
53590
|
_getModules() {
|
|
53589
53591
|
return [ModelingModule, EditorActionsModule, KeyboardModule, SelectionModule, PaletteModule, PropertiesPanelModule];
|
|
53590
53592
|
}
|
|
53591
53593
|
|
|
53592
|
-
/**
|
|
53593
|
-
* @internal
|
|
53594
|
+
/**
|
|
53595
|
+
* @internal
|
|
53594
53596
|
*/
|
|
53595
53597
|
_onEvent(type, priority, handler) {
|
|
53596
53598
|
this.get('eventBus').on(type, priority, handler);
|