@formio/js 5.0.0-rc.77 → 5.0.0-rc.79
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +21 -21
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -2
- package/dist/formio.full.js +28 -28
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -2
- package/dist/formio.js +3 -3
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +12 -12
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -2
- package/lib/cjs/Webform.js +5 -2
- package/lib/cjs/components/_classes/component/Component.js +2 -2
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +18 -12
- package/lib/cjs/components/day/Day.d.ts +5 -0
- package/lib/cjs/components/day/Day.js +52 -12
- package/lib/cjs/components/day/editForm/Day.edit.day.d.ts +17 -0
- package/lib/cjs/components/day/editForm/Day.edit.day.js +19 -0
- package/lib/cjs/components/day/editForm/Day.edit.month.d.ts +5 -0
- package/lib/cjs/components/day/editForm/Day.edit.month.js +19 -0
- package/lib/cjs/components/day/editForm/Day.edit.year.d.ts +5 -0
- package/lib/cjs/components/day/editForm/Day.edit.year.js +13 -0
- package/lib/cjs/components/radio/Radio.js +1 -1
- package/lib/cjs/components/select/Select.d.ts +38 -0
- package/lib/cjs/components/select/Select.js +15 -2
- package/lib/cjs/components/select/editForm/Select.edit.validation.js +2 -1
- package/lib/cjs/components/select/fixtures/comp25.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp25.js +59 -0
- package/lib/cjs/components/select/fixtures/comp27.d.ts +18 -0
- package/lib/cjs/components/select/fixtures/comp27.js +19 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +7 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.js +1 -1
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +2 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/cjs/utils/formUtils.d.ts +1 -2
- package/lib/cjs/utils/formUtils.js +2 -3
- package/lib/mjs/Webform.js +9 -2
- package/lib/mjs/components/_classes/component/Component.js +2 -2
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +18 -12
- package/lib/mjs/components/day/Day.d.ts +5 -0
- package/lib/mjs/components/day/Day.js +52 -12
- package/lib/mjs/components/day/editForm/Day.edit.day.d.ts +17 -0
- package/lib/mjs/components/day/editForm/Day.edit.day.js +16 -0
- package/lib/mjs/components/day/editForm/Day.edit.month.d.ts +5 -0
- package/lib/mjs/components/day/editForm/Day.edit.month.js +16 -0
- package/lib/mjs/components/day/editForm/Day.edit.year.d.ts +5 -0
- package/lib/mjs/components/day/editForm/Day.edit.year.js +10 -0
- package/lib/mjs/components/radio/Radio.js +1 -1
- package/lib/mjs/components/select/Select.d.ts +38 -0
- package/lib/mjs/components/select/Select.js +18 -3
- package/lib/mjs/components/select/editForm/Select.edit.validation.js +2 -1
- package/lib/mjs/components/select/fixtures/comp25.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp25.js +57 -0
- package/lib/mjs/components/select/fixtures/comp27.d.ts +18 -0
- package/lib/mjs/components/select/fixtures/comp27.js +17 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +4 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.js +1 -1
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +1 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +2 -2
- package/lib/mjs/utils/formUtils.d.ts +1 -2
- package/lib/mjs/utils/formUtils.js +2 -2
- package/package.json +2 -2
@@ -0,0 +1,44 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
let title: string;
|
3
|
+
let name: string;
|
4
|
+
let path: string;
|
5
|
+
let type: string;
|
6
|
+
let display: string;
|
7
|
+
let components: ({
|
8
|
+
label: string;
|
9
|
+
widget: string;
|
10
|
+
tableView: boolean;
|
11
|
+
data: {
|
12
|
+
values: {
|
13
|
+
label: string;
|
14
|
+
value: string;
|
15
|
+
}[];
|
16
|
+
};
|
17
|
+
dataType: string;
|
18
|
+
key: string;
|
19
|
+
type: string;
|
20
|
+
input: boolean;
|
21
|
+
applyMaskOn?: undefined;
|
22
|
+
conditional?: undefined;
|
23
|
+
} | {
|
24
|
+
label: string;
|
25
|
+
applyMaskOn: string;
|
26
|
+
tableView: boolean;
|
27
|
+
key: string;
|
28
|
+
type: string;
|
29
|
+
input: boolean;
|
30
|
+
conditional: {
|
31
|
+
show: boolean;
|
32
|
+
conjunction: string;
|
33
|
+
conditions: {
|
34
|
+
component: string;
|
35
|
+
operator: string;
|
36
|
+
value: number;
|
37
|
+
}[];
|
38
|
+
};
|
39
|
+
widget?: undefined;
|
40
|
+
data?: undefined;
|
41
|
+
dataType?: undefined;
|
42
|
+
})[];
|
43
|
+
}
|
44
|
+
export default _default;
|
@@ -0,0 +1,57 @@
|
|
1
|
+
export default {
|
2
|
+
title: 'FIO-8072',
|
3
|
+
name: 'fio8072',
|
4
|
+
path: 'fio8072',
|
5
|
+
type: 'form',
|
6
|
+
display: 'form',
|
7
|
+
components: [
|
8
|
+
{
|
9
|
+
label: 'Select',
|
10
|
+
widget: 'choicesjs',
|
11
|
+
tableView: true,
|
12
|
+
data: {
|
13
|
+
values: [
|
14
|
+
{
|
15
|
+
label: 'A',
|
16
|
+
value: '1',
|
17
|
+
},
|
18
|
+
{
|
19
|
+
label: 'B',
|
20
|
+
value: '2',
|
21
|
+
},
|
22
|
+
{
|
23
|
+
label: 'C',
|
24
|
+
value: '10',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
label: 'D',
|
28
|
+
value: '1d',
|
29
|
+
},
|
30
|
+
],
|
31
|
+
},
|
32
|
+
dataType: 'number',
|
33
|
+
key: 'select',
|
34
|
+
type: 'select',
|
35
|
+
input: true,
|
36
|
+
},
|
37
|
+
{
|
38
|
+
label: 'Text Field',
|
39
|
+
applyMaskOn: 'change',
|
40
|
+
tableView: true,
|
41
|
+
key: 'textField',
|
42
|
+
type: 'textfield',
|
43
|
+
input: true,
|
44
|
+
conditional: {
|
45
|
+
show: true,
|
46
|
+
conjunction: 'all',
|
47
|
+
conditions: [
|
48
|
+
{
|
49
|
+
component: 'select',
|
50
|
+
operator: 'lessThan',
|
51
|
+
value: 5,
|
52
|
+
},
|
53
|
+
],
|
54
|
+
},
|
55
|
+
},
|
56
|
+
],
|
57
|
+
};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
let type: string;
|
3
|
+
let label: string;
|
4
|
+
let widget: string;
|
5
|
+
let tableView: boolean;
|
6
|
+
let dataSrc: string;
|
7
|
+
namespace data {
|
8
|
+
let custom: string;
|
9
|
+
}
|
10
|
+
let dataType: string;
|
11
|
+
let idPath: string;
|
12
|
+
let valueProperty: string;
|
13
|
+
let template: string;
|
14
|
+
let validateWhenHidden: boolean;
|
15
|
+
let key: string;
|
16
|
+
let input: boolean;
|
17
|
+
}
|
18
|
+
export default _default;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
export default {
|
2
|
+
type: 'select',
|
3
|
+
label: 'Select',
|
4
|
+
widget: 'choicesjs',
|
5
|
+
tableView: true,
|
6
|
+
dataSrc: 'custom',
|
7
|
+
data: {
|
8
|
+
custom: 'values = data.dataSource;'
|
9
|
+
},
|
10
|
+
dataType: 'string',
|
11
|
+
idPath: 'name',
|
12
|
+
valueProperty: 'name',
|
13
|
+
template: '<span>{{ item.name }}</span>',
|
14
|
+
validateWhenHidden: false,
|
15
|
+
key: 'select',
|
16
|
+
input: true
|
17
|
+
};
|
@@ -21,5 +21,7 @@ import comp21 from './comp21';
|
|
21
21
|
import comp22 from './comp22';
|
22
22
|
import comp23 from './comp23';
|
23
23
|
import comp24 from './comp24';
|
24
|
-
|
24
|
+
import comp25 from './comp25';
|
25
|
+
import comp27 from './comp27';
|
26
|
+
export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26, comp27 };
|
25
27
|
export { multiSelect, multiSelectOptions } from "./comp3";
|
@@ -22,4 +22,7 @@ import comp21 from './comp21';
|
|
22
22
|
import comp22 from './comp22';
|
23
23
|
import comp23 from './comp23';
|
24
24
|
import comp24 from './comp24';
|
25
|
-
|
25
|
+
import comp25 from './comp25';
|
26
|
+
import comp26 from './comp26';
|
27
|
+
import comp27 from './comp27';
|
28
|
+
export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26, comp27 };
|
@@ -256,7 +256,7 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
256
256
|
if (!boolValue(setting) || !value) {
|
257
257
|
return true;
|
258
258
|
}
|
259
|
-
const values = this.component.values;
|
259
|
+
const values = this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions;
|
260
260
|
const availableValueKeys = (values || []).map(({ value: optionValue }) => optionValue);
|
261
261
|
const valueKeys = Object.keys(value);
|
262
262
|
return valueKeys.every((key) => availableValueKeys.includes(key));
|
@@ -19,7 +19,7 @@ export default class DateGeaterThan extends ConditionOperator {
|
|
19
19
|
return false;
|
20
20
|
}
|
21
21
|
let conditionTriggerComponent = null;
|
22
|
-
if (instance
|
22
|
+
if (instance?.root?.getComponent) {
|
23
23
|
conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
24
24
|
}
|
25
25
|
if (conditionTriggerComponent && conditionTriggerComponent.isPartialDay && conditionTriggerComponent.isPartialDay(value)) {
|
@@ -12,8 +12,8 @@ export default class IsEmptyValue extends ConditionOperator {
|
|
12
12
|
}
|
13
13
|
execute({ value, instance, conditionComponentPath }) {
|
14
14
|
const isEmptyValue = _.isEmpty(_.isNumber(value) ? String(value) : value);
|
15
|
-
if (instance
|
16
|
-
const conditionTriggerComponent = instance.root
|
15
|
+
if (instance?.root?.getComponent) {
|
16
|
+
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
17
17
|
return conditionTriggerComponent?.isEmpty ? conditionTriggerComponent.isEmpty() : isEmptyValue;
|
18
18
|
}
|
19
19
|
return isEmptyValue;
|
@@ -16,8 +16,8 @@ export default class IsEqualTo extends ConditionOperator {
|
|
16
16
|
// eslint-disable-next-line no-empty
|
17
17
|
catch (e) { }
|
18
18
|
}
|
19
|
-
if (instance
|
20
|
-
const conditionTriggerComponent = instance.root
|
19
|
+
if (instance?.root?.getComponent) {
|
20
|
+
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
21
21
|
if (conditionTriggerComponent
|
22
22
|
&& isSelectResourceWithObjectValue(conditionTriggerComponent.component)
|
23
23
|
&& conditionTriggerComponent.component?.template) {
|
@@ -8,11 +8,10 @@ export function findComponents(components: import('@formio/core').Component[], q
|
|
8
8
|
export const flattenComponents: typeof Utils.flattenComponents;
|
9
9
|
export const guid: typeof Utils.guid;
|
10
10
|
export const uniqueName: typeof Utils.uniqueName;
|
11
|
-
export const MODEL_TYPES:
|
11
|
+
export const MODEL_TYPES: any;
|
12
12
|
export const getModelType: typeof Utils.getModelType;
|
13
13
|
export const getComponentAbsolutePath: typeof Utils.getComponentAbsolutePath;
|
14
14
|
export const getComponentPath: typeof Utils.getComponentPath;
|
15
|
-
export const isComponentModelType: typeof Utils.isComponentModelType;
|
16
15
|
export const isComponentNestedDataType: typeof Utils.isComponentNestedDataType;
|
17
16
|
export const componentPath: typeof Utils.componentPath;
|
18
17
|
export const componentChildPath: any;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Utils } from '@formio/core';
|
2
|
-
const { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath,
|
2
|
+
const { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty } = Utils;
|
3
3
|
/**
|
4
4
|
* Deprecated version of findComponents. Renamed to searchComponents.
|
5
5
|
* @param {import('@formio/core').Component[]} components - The components to find components within.
|
@@ -10,4 +10,4 @@ export function findComponents(components, query) {
|
|
10
10
|
console.warn('formio.js/utils findComponents is deprecated. Use searchComponents instead.');
|
11
11
|
return searchComponents(components, query);
|
12
12
|
}
|
13
|
-
export { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath,
|
13
|
+
export { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.0.0-rc.
|
3
|
+
"version": "5.0.0-rc.79",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"dependencies": {
|
82
82
|
"@formio/bootstrap": "3.0.0-rc.37",
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
84
|
-
"@formio/core": "2.2.
|
84
|
+
"@formio/core": "2.2.3-rc.1",
|
85
85
|
"@formio/text-mask-addons": "^3.8.0-formio.2",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|