@formio/js 5.0.0-dev.5944.74e70b0 → 5.0.0-dev.5948.072adfa
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/Changelog.md +1 -0
- package/dist/formio.form.js +583 -593
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -3
- package/dist/formio.full.js +584 -594
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -3
- package/dist/formio.js +3006 -287
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +12 -0
- package/dist/formio.utils.js +41 -51
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -3
- package/lib/cjs/Webform.d.ts +1 -1
- package/lib/cjs/Webform.js +27 -28
- package/lib/cjs/WebformBuilder.js +6 -13
- package/lib/cjs/Wizard.js +4 -11
- package/lib/cjs/components/Components.d.ts +0 -7
- package/lib/cjs/components/Components.js +1 -33
- package/lib/cjs/components/_classes/component/Component.d.ts +39 -7
- package/lib/cjs/components/_classes/component/Component.js +97 -29
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +2 -2
- package/lib/cjs/components/_classes/componentModal/ComponentModal.d.ts +1 -0
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +1 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +4 -19
- package/lib/cjs/components/_classes/nested/NestedComponent.js +54 -60
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +9 -46
- package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -1
- package/lib/cjs/components/datagrid/DataGrid.js +1 -45
- package/lib/cjs/components/datamap/DataMap.js +2 -3
- package/lib/cjs/components/editgrid/EditGrid.js +13 -13
- package/lib/cjs/components/form/Form.d.ts +1 -3
- package/lib/cjs/components/form/Form.js +21 -28
- package/lib/cjs/components/html/HTML.js +15 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.js +0 -1
- package/lib/cjs/formio.form.js +1 -0
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +2 -2
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.d.ts +2 -2
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/cjs/utils/conditionOperators/IsEqualTo.d.ts +2 -2
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/cjs/utils/formUtils.d.ts +25 -14
- package/lib/cjs/utils/formUtils.js +11 -16
- package/lib/cjs/utils/utils.d.ts +1 -2
- package/lib/cjs/utils/utils.js +15 -31
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +24 -27
- package/lib/mjs/WebformBuilder.js +6 -13
- package/lib/mjs/Wizard.js +2 -8
- package/lib/mjs/components/Components.d.ts +0 -7
- package/lib/mjs/components/Components.js +1 -32
- package/lib/mjs/components/_classes/component/Component.d.ts +39 -7
- package/lib/mjs/components/_classes/component/Component.js +99 -30
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +2 -2
- package/lib/mjs/components/_classes/componentModal/ComponentModal.d.ts +1 -0
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +1 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +4 -19
- package/lib/mjs/components/_classes/nested/NestedComponent.js +55 -61
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +8 -43
- package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -1
- package/lib/mjs/components/datagrid/DataGrid.js +1 -45
- package/lib/mjs/components/datamap/DataMap.js +2 -3
- package/lib/mjs/components/editgrid/EditGrid.js +15 -12
- package/lib/mjs/components/form/Form.d.ts +1 -3
- package/lib/mjs/components/form/Form.js +22 -28
- package/lib/mjs/components/html/HTML.js +15 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.js +0 -1
- package/lib/mjs/formio.form.js +1 -0
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +2 -2
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.d.ts +2 -2
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/mjs/utils/conditionOperators/IsEqualTo.d.ts +2 -2
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/mjs/utils/formUtils.d.ts +25 -14
- package/lib/mjs/utils/formUtils.js +2 -12
- package/lib/mjs/utils/utils.d.ts +1 -2
- package/lib/mjs/utils/utils.js +14 -29
- package/package.json +4 -4
package/lib/mjs/utils/utils.js
CHANGED
@@ -25,17 +25,6 @@ jsonLogic.add_operation('relativeMaxDate', (relativeMaxDate) => {
|
|
25
25
|
return moment().add(relativeMaxDate, 'days').toISOString();
|
26
26
|
});
|
27
27
|
export { jsonLogic, ConditionOperators, moment };
|
28
|
-
/**
|
29
|
-
* Sets the path to the component and parent schema.
|
30
|
-
* @param {import('@formio/core').Component} component - The component to set the path for.
|
31
|
-
*/
|
32
|
-
function setPathToComponentAndPerentSchema(component) {
|
33
|
-
component.path = getComponentPath(component);
|
34
|
-
const dataParent = getDataParentComponent(component);
|
35
|
-
if (dataParent && typeof dataParent === 'object') {
|
36
|
-
dataParent.path = getComponentPath(dataParent);
|
37
|
-
}
|
38
|
-
}
|
39
28
|
/**
|
40
29
|
* Evaluate a method.
|
41
30
|
* @param {Function|string|object} func - The function to evaluate.
|
@@ -227,7 +216,7 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
227
216
|
const value = getComponentActualValue(path, data, row);
|
228
217
|
const ConditionOperator = ConditionOperators[operator];
|
229
218
|
return ConditionOperator
|
230
|
-
? new ConditionOperator().getResult({ value, comparedValue, instance, component,
|
219
|
+
? new ConditionOperator().getResult({ value, comparedValue, instance, component, path })
|
231
220
|
: true;
|
232
221
|
});
|
233
222
|
}
|
@@ -235,7 +224,7 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
235
224
|
const value = getComponentActualValue(conditionComponentPath, data, row);
|
236
225
|
const СonditionOperator = ConditionOperators[operator];
|
237
226
|
return СonditionOperator
|
238
|
-
? new СonditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
|
227
|
+
? new СonditionOperator().getResult({ value, comparedValue, instance, component, path: conditionComponentPath })
|
239
228
|
: true;
|
240
229
|
}
|
241
230
|
});
|
@@ -332,17 +321,18 @@ function getRow(component, row, instance, conditional) {
|
|
332
321
|
// If no component's instance passed (happens only in 6.x server), calculate its path based on the schema
|
333
322
|
if (!instance) {
|
334
323
|
instance = _.cloneDeep(component);
|
335
|
-
setPathToComponentAndPerentSchema(instance);
|
336
324
|
}
|
337
325
|
const dataParent = getDataParentComponent(instance);
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
326
|
+
if (dataParent) {
|
327
|
+
const parentPath = dataParent.paths?.localDataPath;
|
328
|
+
const isTriggerCondtionComponentPath = condition.when || !condition.conditions
|
329
|
+
? condition.when?.startsWith(dataParent.paths?.localPath)
|
330
|
+
: _.some(condition.conditions, cond => cond.component.startsWith(dataParent.paths?.localPath));
|
331
|
+
if (isTriggerCondtionComponentPath) {
|
332
|
+
const newRow = {};
|
333
|
+
_.set(newRow, parentPath, row);
|
334
|
+
row = newRow;
|
335
|
+
}
|
346
336
|
}
|
347
337
|
return row;
|
348
338
|
}
|
@@ -1478,15 +1468,10 @@ export function getComponentPathWithoutIndicies(path = '') {
|
|
1478
1468
|
/**
|
1479
1469
|
* Returns a path to the component which based on its schema
|
1480
1470
|
* @param {import('@formio/core').Component} component - Component containing link to its parent's schema in the 'parent' property
|
1481
|
-
* @param {string} path - Path to the component
|
1482
1471
|
* @returns {string} - Path to the component
|
1483
1472
|
*/
|
1484
|
-
export function getComponentPath(component
|
1485
|
-
|
1486
|
-
return path;
|
1487
|
-
}
|
1488
|
-
path = component.isInputComponent || component.input === true ? `${component.key}${path ? '.' : ''}${path}` : path;
|
1489
|
-
return getComponentPath(component.parent, path);
|
1473
|
+
export function getComponentPath(component) {
|
1474
|
+
return component.paths.localDataPath;
|
1490
1475
|
}
|
1491
1476
|
/**
|
1492
1477
|
* Returns a parent component of the passed component instance skipping all the Layout components
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.0.0-dev.
|
3
|
+
"version": "5.0.0-dev.5948.072adfa",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -80,10 +80,10 @@
|
|
80
80
|
},
|
81
81
|
"homepage": "https://github.com/formio/formio.js#readme",
|
82
82
|
"dependencies": {
|
83
|
-
"@formio/bootstrap": "3.0.0-dev.
|
83
|
+
"@formio/bootstrap": "3.0.0-dev.118.f146cb4",
|
84
84
|
"@formio/choices.js": "^10.2.1",
|
85
|
-
"@formio/core": "2.1.0-dev.
|
86
|
-
"@formio/text-mask-addons": "
|
85
|
+
"@formio/core": "2.1.0-dev.193.68cf8c3",
|
86
|
+
"@formio/text-mask-addons": "3.8.0-formio.4",
|
87
87
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
88
88
|
"abortcontroller-polyfill": "^1.7.5",
|
89
89
|
"autocompleter": "^8.0.4",
|