@formio/js 5.0.0-dev.5695.024ad9c → 5.0.0-dev.5696.7642331
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 +14 -0
- package/dist/formio.builder.css +0 -1
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.form.css +0 -1
- package/dist/formio.form.js +68 -124
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.css +0 -1
- package/dist/formio.full.js +49 -29
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +2 -2
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +57 -17
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +1 -0
- package/lib/cjs/Webform.js +5 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/cjs/components/_classes/component/Component.js +18 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +4 -1
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- package/lib/cjs/components/currency/Currency.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.js +38 -26
- package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +3 -1
- package/lib/cjs/components/datamap/DataMap.js +2 -2
- package/lib/cjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/cjs/components/day/fixtures/comp8.js +40 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +12 -1
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
- package/lib/cjs/components/number/Number.d.ts +17 -2
- package/lib/cjs/components/number/Number.js +26 -6
- package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp10.js +21 -0
- package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp9.js +21 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/number/fixtures/index.js +5 -1
- package/lib/cjs/components/radio/Radio.js +7 -6
- package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.js +3 -2
- package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/cjs/components/time/fixtures/comp4.js +171 -0
- package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/time/fixtures/index.js +3 -1
- package/lib/cjs/translations/en.d.ts +3 -0
- package/lib/cjs/translations/en.js +4 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +4 -3
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +3 -3
- package/lib/cjs/utils/utils.d.ts +1 -10
- package/lib/cjs/utils/utils.js +59 -7
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +1 -0
- package/lib/mjs/Webform.js +5 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/mjs/components/_classes/component/Component.js +7 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +4 -1
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- package/lib/mjs/components/currency/Currency.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.js +37 -25
- package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +2 -1
- package/lib/mjs/components/datamap/DataMap.js +1 -1
- package/lib/mjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/mjs/components/day/fixtures/comp8.js +38 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +12 -1
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/mjs/components/number/Number.d.ts +17 -2
- package/lib/mjs/components/number/Number.js +25 -5
- package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp10.js +19 -0
- package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp9.js +19 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/number/fixtures/index.js +3 -1
- package/lib/mjs/components/radio/Radio.js +7 -6
- package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.js +3 -2
- package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/mjs/components/time/fixtures/comp4.js +169 -0
- package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/time/fixtures/index.js +2 -1
- package/lib/mjs/translations/en.d.ts +3 -0
- package/lib/mjs/translations/en.js +4 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +3 -3
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +1 -1
- package/lib/mjs/utils/utils.d.ts +1 -10
- package/lib/mjs/utils/utils.js +58 -7
- package/package.json +2 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let type: string;
|
|
3
|
+
let display: string;
|
|
4
|
+
let components: {
|
|
5
|
+
title: string;
|
|
6
|
+
breadcrumbClickable: boolean;
|
|
7
|
+
buttonSettings: {
|
|
8
|
+
previous: boolean;
|
|
9
|
+
cancel: boolean;
|
|
10
|
+
next: boolean;
|
|
11
|
+
};
|
|
12
|
+
navigateOnEnter: boolean;
|
|
13
|
+
saveOnEnter: boolean;
|
|
14
|
+
scrollToTop: boolean;
|
|
15
|
+
collapsible: boolean;
|
|
16
|
+
key: string;
|
|
17
|
+
type: string;
|
|
18
|
+
label: string;
|
|
19
|
+
components: {
|
|
20
|
+
label: string;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
alwaysEnabled: boolean;
|
|
23
|
+
tableView: boolean;
|
|
24
|
+
defaultValue: string;
|
|
25
|
+
key: string;
|
|
26
|
+
type: string;
|
|
27
|
+
input: boolean;
|
|
28
|
+
inputMask: string;
|
|
29
|
+
hideOnChildrenHidden: boolean;
|
|
30
|
+
id: string;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
prefix: string;
|
|
33
|
+
customClass: string;
|
|
34
|
+
suffix: string;
|
|
35
|
+
multiple: boolean;
|
|
36
|
+
protected: boolean;
|
|
37
|
+
unique: boolean;
|
|
38
|
+
persistent: boolean;
|
|
39
|
+
hidden: boolean;
|
|
40
|
+
clearOnHide: boolean;
|
|
41
|
+
refreshOn: string;
|
|
42
|
+
redrawOn: string;
|
|
43
|
+
modalEdit: boolean;
|
|
44
|
+
dataGridLabel: boolean;
|
|
45
|
+
labelPosition: string;
|
|
46
|
+
description: string;
|
|
47
|
+
errorLabel: string;
|
|
48
|
+
tooltip: string;
|
|
49
|
+
hideLabel: boolean;
|
|
50
|
+
tabindex: string;
|
|
51
|
+
autofocus: boolean;
|
|
52
|
+
dbIndex: boolean;
|
|
53
|
+
customDefaultValue: string;
|
|
54
|
+
calculateValue: string;
|
|
55
|
+
calculateServer: boolean;
|
|
56
|
+
widget: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
attributes: {};
|
|
60
|
+
validateOn: string;
|
|
61
|
+
validate: {
|
|
62
|
+
required: boolean;
|
|
63
|
+
custom: string;
|
|
64
|
+
customPrivate: boolean;
|
|
65
|
+
strictDateValidation: boolean;
|
|
66
|
+
multiple: boolean;
|
|
67
|
+
unique: boolean;
|
|
68
|
+
minLength: string;
|
|
69
|
+
maxLength: string;
|
|
70
|
+
pattern: string;
|
|
71
|
+
};
|
|
72
|
+
conditional: {
|
|
73
|
+
show: null;
|
|
74
|
+
when: null;
|
|
75
|
+
eq: string;
|
|
76
|
+
};
|
|
77
|
+
overlay: {
|
|
78
|
+
style: string;
|
|
79
|
+
left: string;
|
|
80
|
+
top: string;
|
|
81
|
+
width: string;
|
|
82
|
+
height: string;
|
|
83
|
+
};
|
|
84
|
+
allowCalculateOverride: boolean;
|
|
85
|
+
encrypted: boolean;
|
|
86
|
+
showCharCount: boolean;
|
|
87
|
+
showWordCount: boolean;
|
|
88
|
+
properties: {};
|
|
89
|
+
allowMultipleMasks: boolean;
|
|
90
|
+
addons: never[];
|
|
91
|
+
mask: boolean;
|
|
92
|
+
inputType: string;
|
|
93
|
+
inputFormat: string;
|
|
94
|
+
displayMask: string;
|
|
95
|
+
spellcheck: boolean;
|
|
96
|
+
truncateMultipleSpaces: boolean;
|
|
97
|
+
format: string;
|
|
98
|
+
dataFormat: string;
|
|
99
|
+
}[];
|
|
100
|
+
input: boolean;
|
|
101
|
+
tableView: boolean;
|
|
102
|
+
id: string;
|
|
103
|
+
placeholder: string;
|
|
104
|
+
prefix: string;
|
|
105
|
+
customClass: string;
|
|
106
|
+
suffix: string;
|
|
107
|
+
multiple: boolean;
|
|
108
|
+
defaultValue: null;
|
|
109
|
+
protected: boolean;
|
|
110
|
+
unique: boolean;
|
|
111
|
+
persistent: boolean;
|
|
112
|
+
hidden: boolean;
|
|
113
|
+
clearOnHide: boolean;
|
|
114
|
+
refreshOn: string;
|
|
115
|
+
redrawOn: string;
|
|
116
|
+
modalEdit: boolean;
|
|
117
|
+
dataGridLabel: boolean;
|
|
118
|
+
labelPosition: string;
|
|
119
|
+
description: string;
|
|
120
|
+
errorLabel: string;
|
|
121
|
+
tooltip: string;
|
|
122
|
+
hideLabel: boolean;
|
|
123
|
+
tabindex: string;
|
|
124
|
+
disabled: boolean;
|
|
125
|
+
autofocus: boolean;
|
|
126
|
+
dbIndex: boolean;
|
|
127
|
+
customDefaultValue: string;
|
|
128
|
+
calculateValue: string;
|
|
129
|
+
calculateServer: boolean;
|
|
130
|
+
widget: null;
|
|
131
|
+
attributes: {};
|
|
132
|
+
validateOn: string;
|
|
133
|
+
validate: {
|
|
134
|
+
required: boolean;
|
|
135
|
+
custom: string;
|
|
136
|
+
customPrivate: boolean;
|
|
137
|
+
strictDateValidation: boolean;
|
|
138
|
+
multiple: boolean;
|
|
139
|
+
unique: boolean;
|
|
140
|
+
};
|
|
141
|
+
conditional: {
|
|
142
|
+
show: null;
|
|
143
|
+
when: null;
|
|
144
|
+
eq: string;
|
|
145
|
+
};
|
|
146
|
+
overlay: {
|
|
147
|
+
style: string;
|
|
148
|
+
left: string;
|
|
149
|
+
top: string;
|
|
150
|
+
width: string;
|
|
151
|
+
height: string;
|
|
152
|
+
};
|
|
153
|
+
allowCalculateOverride: boolean;
|
|
154
|
+
encrypted: boolean;
|
|
155
|
+
showCharCount: boolean;
|
|
156
|
+
showWordCount: boolean;
|
|
157
|
+
properties: {};
|
|
158
|
+
allowMultipleMasks: boolean;
|
|
159
|
+
addons: never[];
|
|
160
|
+
tree: boolean;
|
|
161
|
+
lazyLoad: boolean;
|
|
162
|
+
theme: string;
|
|
163
|
+
breadcrumb: string;
|
|
164
|
+
}[];
|
|
165
|
+
}
|
|
166
|
+
export default _default;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"type": "form",
|
|
3
|
+
"display": "wizard",
|
|
4
|
+
"components": [
|
|
5
|
+
{
|
|
6
|
+
"title": "Page 1",
|
|
7
|
+
"breadcrumbClickable": true,
|
|
8
|
+
"buttonSettings": {
|
|
9
|
+
"previous": true,
|
|
10
|
+
"cancel": true,
|
|
11
|
+
"next": true
|
|
12
|
+
},
|
|
13
|
+
"navigateOnEnter": false,
|
|
14
|
+
"saveOnEnter": false,
|
|
15
|
+
"scrollToTop": false,
|
|
16
|
+
"collapsible": false,
|
|
17
|
+
"key": "page1",
|
|
18
|
+
"type": "panel",
|
|
19
|
+
"label": "Page 1",
|
|
20
|
+
"components": [
|
|
21
|
+
{
|
|
22
|
+
"label": "Time",
|
|
23
|
+
"disabled": true,
|
|
24
|
+
"alwaysEnabled": false,
|
|
25
|
+
"tableView": true,
|
|
26
|
+
"defaultValue": "03:03 PM",
|
|
27
|
+
"key": "time1",
|
|
28
|
+
"type": "time",
|
|
29
|
+
"input": true,
|
|
30
|
+
"inputMask": "99:99",
|
|
31
|
+
"hideOnChildrenHidden": false,
|
|
32
|
+
"id": "efw9yyq",
|
|
33
|
+
"placeholder": "",
|
|
34
|
+
"prefix": "",
|
|
35
|
+
"customClass": "",
|
|
36
|
+
"suffix": "",
|
|
37
|
+
"multiple": false,
|
|
38
|
+
"protected": false,
|
|
39
|
+
"unique": false,
|
|
40
|
+
"persistent": true,
|
|
41
|
+
"hidden": false,
|
|
42
|
+
"clearOnHide": true,
|
|
43
|
+
"refreshOn": "",
|
|
44
|
+
"redrawOn": "",
|
|
45
|
+
"modalEdit": false,
|
|
46
|
+
"dataGridLabel": false,
|
|
47
|
+
"labelPosition": "top",
|
|
48
|
+
"description": "",
|
|
49
|
+
"errorLabel": "",
|
|
50
|
+
"tooltip": "",
|
|
51
|
+
"hideLabel": false,
|
|
52
|
+
"tabindex": "",
|
|
53
|
+
"autofocus": false,
|
|
54
|
+
"dbIndex": false,
|
|
55
|
+
"customDefaultValue": "",
|
|
56
|
+
"calculateValue": "",
|
|
57
|
+
"calculateServer": false,
|
|
58
|
+
"widget": {
|
|
59
|
+
"type": "input"
|
|
60
|
+
},
|
|
61
|
+
"attributes": {},
|
|
62
|
+
"validateOn": "change",
|
|
63
|
+
"validate": {
|
|
64
|
+
"required": false,
|
|
65
|
+
"custom": "",
|
|
66
|
+
"customPrivate": false,
|
|
67
|
+
"strictDateValidation": false,
|
|
68
|
+
"multiple": false,
|
|
69
|
+
"unique": false,
|
|
70
|
+
"minLength": "",
|
|
71
|
+
"maxLength": "",
|
|
72
|
+
"pattern": ""
|
|
73
|
+
},
|
|
74
|
+
"conditional": {
|
|
75
|
+
"show": null,
|
|
76
|
+
"when": null,
|
|
77
|
+
"eq": ""
|
|
78
|
+
},
|
|
79
|
+
"overlay": {
|
|
80
|
+
"style": "",
|
|
81
|
+
"left": "",
|
|
82
|
+
"top": "",
|
|
83
|
+
"width": "",
|
|
84
|
+
"height": ""
|
|
85
|
+
},
|
|
86
|
+
"allowCalculateOverride": false,
|
|
87
|
+
"encrypted": false,
|
|
88
|
+
"showCharCount": false,
|
|
89
|
+
"showWordCount": false,
|
|
90
|
+
"properties": {},
|
|
91
|
+
"allowMultipleMasks": false,
|
|
92
|
+
"addons": [],
|
|
93
|
+
"mask": false,
|
|
94
|
+
"inputType": "time",
|
|
95
|
+
"inputFormat": "plain",
|
|
96
|
+
"displayMask": "",
|
|
97
|
+
"spellcheck": true,
|
|
98
|
+
"truncateMultipleSpaces": false,
|
|
99
|
+
"format": "HH:mm",
|
|
100
|
+
"dataFormat": "HH:mm:ss"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"input": false,
|
|
104
|
+
"tableView": false,
|
|
105
|
+
"id": "e7vej1d",
|
|
106
|
+
"placeholder": "",
|
|
107
|
+
"prefix": "",
|
|
108
|
+
"customClass": "",
|
|
109
|
+
"suffix": "",
|
|
110
|
+
"multiple": false,
|
|
111
|
+
"defaultValue": null,
|
|
112
|
+
"protected": false,
|
|
113
|
+
"unique": false,
|
|
114
|
+
"persistent": false,
|
|
115
|
+
"hidden": false,
|
|
116
|
+
"clearOnHide": false,
|
|
117
|
+
"refreshOn": "",
|
|
118
|
+
"redrawOn": "",
|
|
119
|
+
"modalEdit": false,
|
|
120
|
+
"dataGridLabel": false,
|
|
121
|
+
"labelPosition": "top",
|
|
122
|
+
"description": "",
|
|
123
|
+
"errorLabel": "",
|
|
124
|
+
"tooltip": "",
|
|
125
|
+
"hideLabel": false,
|
|
126
|
+
"tabindex": "",
|
|
127
|
+
"disabled": false,
|
|
128
|
+
"autofocus": false,
|
|
129
|
+
"dbIndex": false,
|
|
130
|
+
"customDefaultValue": "",
|
|
131
|
+
"calculateValue": "",
|
|
132
|
+
"calculateServer": false,
|
|
133
|
+
"widget": null,
|
|
134
|
+
"attributes": {},
|
|
135
|
+
"validateOn": "change",
|
|
136
|
+
"validate": {
|
|
137
|
+
"required": false,
|
|
138
|
+
"custom": "",
|
|
139
|
+
"customPrivate": false,
|
|
140
|
+
"strictDateValidation": false,
|
|
141
|
+
"multiple": false,
|
|
142
|
+
"unique": false
|
|
143
|
+
},
|
|
144
|
+
"conditional": {
|
|
145
|
+
"show": null,
|
|
146
|
+
"when": null,
|
|
147
|
+
"eq": ""
|
|
148
|
+
},
|
|
149
|
+
"overlay": {
|
|
150
|
+
"style": "",
|
|
151
|
+
"left": "",
|
|
152
|
+
"top": "",
|
|
153
|
+
"width": "",
|
|
154
|
+
"height": ""
|
|
155
|
+
},
|
|
156
|
+
"allowCalculateOverride": false,
|
|
157
|
+
"encrypted": false,
|
|
158
|
+
"showCharCount": false,
|
|
159
|
+
"showWordCount": false,
|
|
160
|
+
"properties": {},
|
|
161
|
+
"allowMultipleMasks": false,
|
|
162
|
+
"addons": [],
|
|
163
|
+
"tree": false,
|
|
164
|
+
"lazyLoad": false,
|
|
165
|
+
"theme": "default",
|
|
166
|
+
"breadcrumb": "default"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
2
|
import comp2 from './comp2';
|
|
3
3
|
import comp3 from './comp3';
|
|
4
|
+
import comp4 from './comp4';
|
|
4
5
|
import timeForm from './timeForm';
|
|
5
6
|
import timeForm2 from './timeForm2';
|
|
6
|
-
export { comp1, comp2, comp3, timeForm, timeForm2 };
|
|
7
|
+
export { comp1, comp2, comp3, comp4, timeForm, timeForm2 };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
2
|
import comp2 from './comp2';
|
|
3
3
|
import comp3 from './comp3';
|
|
4
|
+
import comp4 from './comp4';
|
|
4
5
|
import timeForm from './timeForm';
|
|
5
6
|
import timeForm2 from './timeForm2';
|
|
6
|
-
export { comp1, comp2, comp3, timeForm, timeForm2 };
|
|
7
|
+
export { comp1, comp2, comp3, comp4, timeForm, timeForm2 };
|
|
@@ -73,5 +73,8 @@ export default {
|
|
|
73
73
|
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
|
74
74
|
apiKey: 'API Key is not unique: {{key}}',
|
|
75
75
|
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
|
76
|
-
typeCount: '{{ count }} {{ type }}'
|
|
76
|
+
typeCount: '{{ count }} {{ type }}',
|
|
77
|
+
requiredDayField: '{{ field }} is required',
|
|
78
|
+
requiredMonthField: '{{ field }} is required',
|
|
79
|
+
requiredYearField: '{{ field }} is required'
|
|
77
80
|
};
|
|
@@ -11,10 +11,10 @@ export default class IsEmptyValue extends ConditionOperator {
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
execute({ value, instance, conditionComponentPath }) {
|
|
14
|
-
const isEmptyValue = _.isEmpty(value);
|
|
14
|
+
const isEmptyValue = _.isEmpty(_.isNumber(value) ? String(value) : value);
|
|
15
15
|
if (instance && instance.root) {
|
|
16
|
-
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
17
|
-
return conditionTriggerComponent ? conditionTriggerComponent.isEmpty() : isEmptyValue;
|
|
16
|
+
const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath);
|
|
17
|
+
return conditionTriggerComponent?.isEmpty ? conditionTriggerComponent.isEmpty() : isEmptyValue;
|
|
18
18
|
}
|
|
19
19
|
return isEmptyValue;
|
|
20
20
|
}
|
|
@@ -17,7 +17,7 @@ export default class IsEqualTo extends ConditionOperator {
|
|
|
17
17
|
catch (e) { }
|
|
18
18
|
}
|
|
19
19
|
if (instance && instance.root) {
|
|
20
|
-
const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);
|
|
20
|
+
const conditionTriggerComponent = instance.root?.getComponent && instance.root.getComponent(conditionComponentPath);
|
|
21
21
|
if (conditionTriggerComponent
|
|
22
22
|
&& isSelectResourceWithObjectValue(conditionTriggerComponent.component)
|
|
23
23
|
&& conditionTriggerComponent.component?.template) {
|
package/lib/mjs/utils/utils.d.ts
CHANGED
|
@@ -56,16 +56,7 @@ export function isMongoId(text: string): boolean;
|
|
|
56
56
|
* @param {*} rowData - The contextual row data for the component.
|
|
57
57
|
*/
|
|
58
58
|
export function checkCalculated(component: import('@formio/core').Component, submission: import('@formio/core').Submission, rowData: any): void;
|
|
59
|
-
|
|
60
|
-
* Check if a simple conditional evaluates to true.
|
|
61
|
-
* @param {import('@formio/core').Component} component - The component to check for the conditional.
|
|
62
|
-
* @param {import('@formio/core').SimpleConditional} condition - The condition to check.
|
|
63
|
-
* @param {*} row - The row data for the component.
|
|
64
|
-
* @param {*} data - The full submission data.
|
|
65
|
-
* @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
|
|
66
|
-
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
|
67
|
-
*/
|
|
68
|
-
export function checkSimpleConditional(component: import('@formio/core').Component, condition: import('@formio/core').SimpleConditional, row: any, data: any, instance: any): boolean;
|
|
59
|
+
export function checkSimpleConditional(component: any, condition: any, row: any, data: any, instance: any): boolean;
|
|
69
60
|
/**
|
|
70
61
|
* Returns a components normalized value.
|
|
71
62
|
* @param {string} compPath - The full path to the component.
|
package/lib/mjs/utils/utils.js
CHANGED
|
@@ -145,6 +145,44 @@ export function checkCalculated(component, submission, rowData) {
|
|
|
145
145
|
* @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
|
|
146
146
|
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
|
147
147
|
*/
|
|
148
|
+
function getConditionalPathsRecursive(conditionPaths, data) {
|
|
149
|
+
let currentGlobalIndex = 0;
|
|
150
|
+
const conditionalPathsArray = [];
|
|
151
|
+
const getConditionalPaths = (data, currentPath = '', localIndex = 0) => {
|
|
152
|
+
currentPath = currentPath.replace(/^\.+|\.+$/g, '');
|
|
153
|
+
const currentLocalIndex = localIndex;
|
|
154
|
+
const currentData = _.get(data, currentPath);
|
|
155
|
+
if (Array.isArray(currentData) && currentData.filter(Boolean).length > 0) {
|
|
156
|
+
if (currentData.some(element => typeof element !== 'object')) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const hasInnerDataArray = currentData.find(x => Array.isArray(x[conditionPaths[currentLocalIndex]]));
|
|
160
|
+
if (hasInnerDataArray) {
|
|
161
|
+
currentData.forEach((_, indexOutside) => {
|
|
162
|
+
const innerCompDataPath = `${currentPath}[${indexOutside}].${conditionPaths[currentLocalIndex]}`;
|
|
163
|
+
getConditionalPaths(data, innerCompDataPath, currentLocalIndex + 1);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
currentData.forEach((x, index) => {
|
|
168
|
+
if (!_.isNil(x[conditionPaths[currentLocalIndex]])) {
|
|
169
|
+
const compDataPath = `${currentPath}[${index}].${conditionPaths[currentLocalIndex]}`;
|
|
170
|
+
conditionalPathsArray.push(compDataPath);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
if (!conditionPaths[currentGlobalIndex]) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
currentGlobalIndex = currentGlobalIndex + 1;
|
|
180
|
+
getConditionalPaths(data, `${currentPath}.${conditionPaths[currentGlobalIndex - 1]}`, currentGlobalIndex);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
getConditionalPaths(data);
|
|
184
|
+
return conditionalPathsArray;
|
|
185
|
+
}
|
|
148
186
|
export function checkSimpleConditional(component, condition, row, data, instance) {
|
|
149
187
|
if (condition.when) {
|
|
150
188
|
const value = getComponentActualValue(condition.when, data, row);
|
|
@@ -170,19 +208,32 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
|
170
208
|
if (!conditionComponentPath) {
|
|
171
209
|
return true;
|
|
172
210
|
}
|
|
173
|
-
const
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
211
|
+
const splittedConditionPath = conditionComponentPath.split('.');
|
|
212
|
+
const conditionalPaths = instance?.parent?.type === 'datagrid' || instance?.parent?.type === 'editgrid' ? [] : getConditionalPathsRecursive(splittedConditionPath, data);
|
|
213
|
+
if (conditionalPaths.length > 0) {
|
|
214
|
+
return conditionalPaths.map((path) => {
|
|
215
|
+
const value = getComponentActualValue(path, data, row);
|
|
216
|
+
const ConditionOperator = ConditionOperators[operator];
|
|
217
|
+
return ConditionOperator
|
|
218
|
+
? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
|
|
219
|
+
: true;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
const value = getComponentActualValue(conditionComponentPath, data, row);
|
|
224
|
+
const СonditionOperator = ConditionOperators[operator];
|
|
225
|
+
return СonditionOperator
|
|
226
|
+
? new СonditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })
|
|
227
|
+
: true;
|
|
228
|
+
}
|
|
178
229
|
});
|
|
179
230
|
let result = false;
|
|
180
231
|
switch (conjunction) {
|
|
181
232
|
case 'any':
|
|
182
|
-
result = _.some(conditionsResult, res => !!res);
|
|
233
|
+
result = _.some(conditionsResult.flat(), res => !!res);
|
|
183
234
|
break;
|
|
184
235
|
default:
|
|
185
|
-
result = _.every(conditionsResult, res => !!res);
|
|
236
|
+
result = _.every(conditionsResult.flat(), res => !!res);
|
|
186
237
|
}
|
|
187
238
|
return show ? result : !result;
|
|
188
239
|
}
|
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.5696.7642331",
|
|
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-dev.98.17ba6ea",
|
|
83
83
|
"@formio/choices.js": "^10.2.1",
|
|
84
|
-
"@formio/core": "2.1.0-dev.
|
|
84
|
+
"@formio/core": "2.1.0-dev.105.1bff2e6",
|
|
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",
|