@formio/js 5.0.0-dev.5704.492ccdf → 5.0.0-dev.5704.50db01f
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 +47 -0
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.form.js +55 -131
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -0
- package/dist/formio.full.js +61 -41
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -0
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +25 -5
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -0
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Form.d.ts +2 -2
- package/lib/cjs/Form.js +11 -5
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +2 -1
- package/lib/cjs/Webform.js +3 -6
- package/lib/cjs/WebformBuilder.js +13 -3
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +2 -1
- package/lib/cjs/components/_classes/component/Component.js +25 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +43 -25
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
- package/lib/cjs/components/address/Address.d.ts +6 -0
- package/lib/cjs/components/address/Address.js +7 -1
- package/lib/cjs/components/currency/Currency.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +2 -1
- package/lib/cjs/components/datagrid/DataGrid.js +40 -35
- package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -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/Day.d.ts +3 -4
- package/lib/cjs/components/day/Day.js +31 -10
- package/lib/cjs/components/editgrid/EditGrid.js +14 -6
- 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/comp17.d.ts +80 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
- package/lib/cjs/components/file/File.d.ts +2 -2
- package/lib/cjs/components/file/File.js +13 -2
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/form/fixtures/index.js +3 -1
- package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
- 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/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/radio/Radio.d.ts +2 -18
- package/lib/cjs/components/radio/Radio.js +29 -27
- 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/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
- package/lib/cjs/components/select/Select.d.ts +38 -0
- package/lib/cjs/components/select/Select.js +13 -3
- package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/cjs/components/select/fixtures/comp25.js +66 -0
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/cjs/components/tags/Tags.js +3 -3
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.form.js +2 -2
- package/lib/cjs/components/time/Time.js +3 -7
- 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/templates/Templates.js +1 -1
- package/lib/cjs/translations/en.d.ts +1 -0
- package/lib/cjs/translations/en.js +1 -0
- package/lib/cjs/utils/utils.d.ts +9 -1
- package/lib/cjs/utils/utils.js +14 -13
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Form.d.ts +2 -2
- package/lib/mjs/Form.js +11 -5
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -1
- package/lib/mjs/Webform.js +7 -6
- package/lib/mjs/WebformBuilder.js +12 -3
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +2 -1
- package/lib/mjs/components/_classes/component/Component.js +11 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +43 -25
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
- package/lib/mjs/components/address/Address.d.ts +6 -0
- package/lib/mjs/components/address/Address.js +10 -1
- package/lib/mjs/components/currency/Currency.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +2 -1
- package/lib/mjs/components/datagrid/DataGrid.js +39 -34
- package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -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 +2 -2
- package/lib/mjs/components/day/Day.d.ts +3 -4
- package/lib/mjs/components/day/Day.js +30 -10
- package/lib/mjs/components/editgrid/EditGrid.js +14 -6
- 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/comp17.d.ts +80 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
- package/lib/mjs/components/file/File.d.ts +2 -2
- package/lib/mjs/components/file/File.js +13 -2
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/form/fixtures/index.js +2 -1
- package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
- 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/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/radio/Radio.d.ts +2 -18
- package/lib/mjs/components/radio/Radio.js +32 -30
- 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/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
- package/lib/mjs/components/select/Select.d.ts +38 -0
- package/lib/mjs/components/select/Select.js +16 -4
- package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/mjs/components/select/fixtures/comp25.js +64 -0
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/mjs/components/tags/Tags.js +3 -3
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.form.js +2 -2
- package/lib/mjs/components/time/Time.js +3 -13
- 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/templates/Templates.js +1 -1
- package/lib/mjs/translations/en.d.ts +1 -0
- package/lib/mjs/translations/en.js +1 -0
- package/lib/mjs/utils/utils.d.ts +9 -1
- package/lib/mjs/utils/utils.js +14 -2
- package/package.json +4 -4
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
"type": "form",
|
|
5
|
+
"display": "wizard",
|
|
6
|
+
"components": [
|
|
7
|
+
{
|
|
8
|
+
"title": "Page 1",
|
|
9
|
+
"breadcrumbClickable": true,
|
|
10
|
+
"buttonSettings": {
|
|
11
|
+
"previous": true,
|
|
12
|
+
"cancel": true,
|
|
13
|
+
"next": true
|
|
14
|
+
},
|
|
15
|
+
"navigateOnEnter": false,
|
|
16
|
+
"saveOnEnter": false,
|
|
17
|
+
"scrollToTop": false,
|
|
18
|
+
"collapsible": false,
|
|
19
|
+
"key": "page1",
|
|
20
|
+
"type": "panel",
|
|
21
|
+
"label": "Page 1",
|
|
22
|
+
"components": [
|
|
23
|
+
{
|
|
24
|
+
"label": "Time",
|
|
25
|
+
"disabled": true,
|
|
26
|
+
"alwaysEnabled": false,
|
|
27
|
+
"tableView": true,
|
|
28
|
+
"defaultValue": "03:03 PM",
|
|
29
|
+
"key": "time1",
|
|
30
|
+
"type": "time",
|
|
31
|
+
"input": true,
|
|
32
|
+
"inputMask": "99:99",
|
|
33
|
+
"hideOnChildrenHidden": false,
|
|
34
|
+
"id": "efw9yyq",
|
|
35
|
+
"placeholder": "",
|
|
36
|
+
"prefix": "",
|
|
37
|
+
"customClass": "",
|
|
38
|
+
"suffix": "",
|
|
39
|
+
"multiple": false,
|
|
40
|
+
"protected": false,
|
|
41
|
+
"unique": false,
|
|
42
|
+
"persistent": true,
|
|
43
|
+
"hidden": false,
|
|
44
|
+
"clearOnHide": true,
|
|
45
|
+
"refreshOn": "",
|
|
46
|
+
"redrawOn": "",
|
|
47
|
+
"modalEdit": false,
|
|
48
|
+
"dataGridLabel": false,
|
|
49
|
+
"labelPosition": "top",
|
|
50
|
+
"description": "",
|
|
51
|
+
"errorLabel": "",
|
|
52
|
+
"tooltip": "",
|
|
53
|
+
"hideLabel": false,
|
|
54
|
+
"tabindex": "",
|
|
55
|
+
"autofocus": false,
|
|
56
|
+
"dbIndex": false,
|
|
57
|
+
"customDefaultValue": "",
|
|
58
|
+
"calculateValue": "",
|
|
59
|
+
"calculateServer": false,
|
|
60
|
+
"widget": {
|
|
61
|
+
"type": "input"
|
|
62
|
+
},
|
|
63
|
+
"attributes": {},
|
|
64
|
+
"validateOn": "change",
|
|
65
|
+
"validate": {
|
|
66
|
+
"required": false,
|
|
67
|
+
"custom": "",
|
|
68
|
+
"customPrivate": false,
|
|
69
|
+
"strictDateValidation": false,
|
|
70
|
+
"multiple": false,
|
|
71
|
+
"unique": false,
|
|
72
|
+
"minLength": "",
|
|
73
|
+
"maxLength": "",
|
|
74
|
+
"pattern": ""
|
|
75
|
+
},
|
|
76
|
+
"conditional": {
|
|
77
|
+
"show": null,
|
|
78
|
+
"when": null,
|
|
79
|
+
"eq": ""
|
|
80
|
+
},
|
|
81
|
+
"overlay": {
|
|
82
|
+
"style": "",
|
|
83
|
+
"left": "",
|
|
84
|
+
"top": "",
|
|
85
|
+
"width": "",
|
|
86
|
+
"height": ""
|
|
87
|
+
},
|
|
88
|
+
"allowCalculateOverride": false,
|
|
89
|
+
"encrypted": false,
|
|
90
|
+
"showCharCount": false,
|
|
91
|
+
"showWordCount": false,
|
|
92
|
+
"properties": {},
|
|
93
|
+
"allowMultipleMasks": false,
|
|
94
|
+
"addons": [],
|
|
95
|
+
"mask": false,
|
|
96
|
+
"inputType": "time",
|
|
97
|
+
"inputFormat": "plain",
|
|
98
|
+
"displayMask": "",
|
|
99
|
+
"spellcheck": true,
|
|
100
|
+
"truncateMultipleSpaces": false,
|
|
101
|
+
"format": "HH:mm",
|
|
102
|
+
"dataFormat": "HH:mm:ss"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"input": false,
|
|
106
|
+
"tableView": false,
|
|
107
|
+
"id": "e7vej1d",
|
|
108
|
+
"placeholder": "",
|
|
109
|
+
"prefix": "",
|
|
110
|
+
"customClass": "",
|
|
111
|
+
"suffix": "",
|
|
112
|
+
"multiple": false,
|
|
113
|
+
"defaultValue": null,
|
|
114
|
+
"protected": false,
|
|
115
|
+
"unique": false,
|
|
116
|
+
"persistent": false,
|
|
117
|
+
"hidden": false,
|
|
118
|
+
"clearOnHide": false,
|
|
119
|
+
"refreshOn": "",
|
|
120
|
+
"redrawOn": "",
|
|
121
|
+
"modalEdit": false,
|
|
122
|
+
"dataGridLabel": false,
|
|
123
|
+
"labelPosition": "top",
|
|
124
|
+
"description": "",
|
|
125
|
+
"errorLabel": "",
|
|
126
|
+
"tooltip": "",
|
|
127
|
+
"hideLabel": false,
|
|
128
|
+
"tabindex": "",
|
|
129
|
+
"disabled": false,
|
|
130
|
+
"autofocus": false,
|
|
131
|
+
"dbIndex": false,
|
|
132
|
+
"customDefaultValue": "",
|
|
133
|
+
"calculateValue": "",
|
|
134
|
+
"calculateServer": false,
|
|
135
|
+
"widget": null,
|
|
136
|
+
"attributes": {},
|
|
137
|
+
"validateOn": "change",
|
|
138
|
+
"validate": {
|
|
139
|
+
"required": false,
|
|
140
|
+
"custom": "",
|
|
141
|
+
"customPrivate": false,
|
|
142
|
+
"strictDateValidation": false,
|
|
143
|
+
"multiple": false,
|
|
144
|
+
"unique": false
|
|
145
|
+
},
|
|
146
|
+
"conditional": {
|
|
147
|
+
"show": null,
|
|
148
|
+
"when": null,
|
|
149
|
+
"eq": ""
|
|
150
|
+
},
|
|
151
|
+
"overlay": {
|
|
152
|
+
"style": "",
|
|
153
|
+
"left": "",
|
|
154
|
+
"top": "",
|
|
155
|
+
"width": "",
|
|
156
|
+
"height": ""
|
|
157
|
+
},
|
|
158
|
+
"allowCalculateOverride": false,
|
|
159
|
+
"encrypted": false,
|
|
160
|
+
"showCharCount": false,
|
|
161
|
+
"showWordCount": false,
|
|
162
|
+
"properties": {},
|
|
163
|
+
"allowMultipleMasks": false,
|
|
164
|
+
"addons": [],
|
|
165
|
+
"tree": false,
|
|
166
|
+
"lazyLoad": false,
|
|
167
|
+
"theme": "default",
|
|
168
|
+
"breadcrumb": "default"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
};
|
|
@@ -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 };
|
|
@@ -3,13 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.timeForm2 = exports.timeForm = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.timeForm2 = exports.timeForm = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
10
10
|
exports.comp2 = comp2_1.default;
|
|
11
11
|
const comp3_1 = __importDefault(require("./comp3"));
|
|
12
12
|
exports.comp3 = comp3_1.default;
|
|
13
|
+
const comp4_1 = __importDefault(require("./comp4"));
|
|
14
|
+
exports.comp4 = comp4_1.default;
|
|
13
15
|
const timeForm_1 = __importDefault(require("./timeForm"));
|
|
14
16
|
exports.timeForm = timeForm_1.default;
|
|
15
17
|
const timeForm2_1 = __importDefault(require("./timeForm2"));
|
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const index_1 = __importDefault(require("./index"));
|
|
7
7
|
const experimental_1 = require("@formio/core/experimental");
|
|
8
8
|
experimental_1.Template.addTemplates(index_1.default);
|
|
9
|
-
experimental_1.Template.defaultTemplates =
|
|
9
|
+
experimental_1.Template.defaultTemplates = experimental_1.Template.templates.bootstrap;
|
|
10
10
|
exports.default = experimental_1.Template;
|
|
@@ -77,6 +77,7 @@ exports.default = {
|
|
|
77
77
|
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
|
78
78
|
typeCount: '{{ count }} {{ type }}',
|
|
79
79
|
requiredDayField: '{{ field }} is required',
|
|
80
|
+
requiredDayEmpty: '{{ field }} is required',
|
|
80
81
|
requiredMonthField: '{{ field }} is required',
|
|
81
82
|
requiredYearField: '{{ field }} is required'
|
|
82
83
|
};
|
package/lib/cjs/utils/utils.d.ts
CHANGED
|
@@ -56,6 +56,14 @@ 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
|
+
*
|
|
61
|
+
* @param component
|
|
62
|
+
* @param condition
|
|
63
|
+
* @param row
|
|
64
|
+
* @param data
|
|
65
|
+
* @param instance
|
|
66
|
+
*/
|
|
59
67
|
export function checkSimpleConditional(component: any, condition: any, row: any, data: any, instance: any): boolean;
|
|
60
68
|
/**
|
|
61
69
|
* Returns a components normalized value.
|
|
@@ -523,4 +531,4 @@ import jsonLogic from 'json-logic-js';
|
|
|
523
531
|
import ConditionOperators from './conditionOperators';
|
|
524
532
|
import { Evaluator } from './Evaluator';
|
|
525
533
|
export const interpolate: typeof Evaluator.interpolate;
|
|
526
|
-
export { jsonLogic, ConditionOperators, Evaluator, _ };
|
|
534
|
+
export { jsonLogic, ConditionOperators, moment, Evaluator, _ };
|
package/lib/cjs/utils/utils.js
CHANGED
|
@@ -11,21 +11,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
11
11
|
if (k2 === undefined) k2 = k;
|
|
12
12
|
o[k2] = m[k];
|
|
13
13
|
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
14
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
16
|
};
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
17
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
19
|
};
|
|
@@ -37,6 +25,7 @@ exports._ = lodash_1.default;
|
|
|
37
25
|
const json_logic_js_1 = __importDefault(require("json-logic-js"));
|
|
38
26
|
exports.jsonLogic = json_logic_js_1.default;
|
|
39
27
|
const moment_timezone_1 = __importDefault(require("moment-timezone/moment-timezone"));
|
|
28
|
+
exports.moment = moment_timezone_1.default;
|
|
40
29
|
const jstimezonedetect_1 = __importDefault(require("jstimezonedetect"));
|
|
41
30
|
const operators_1 = require("./jsonlogic/operators");
|
|
42
31
|
const dompurify_1 = __importDefault(require("dompurify"));
|
|
@@ -62,7 +51,6 @@ json_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {
|
|
|
62
51
|
json_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {
|
|
63
52
|
return (0, moment_timezone_1.default)().add(relativeMaxDate, 'days').toISOString();
|
|
64
53
|
});
|
|
65
|
-
exports.moment = __importStar(require("moment-timezone/moment-timezone"));
|
|
66
54
|
/**
|
|
67
55
|
* Sets the path to the component and parent schema.
|
|
68
56
|
* @param {import('@formio/core').Component} component - The component to set the path for.
|
|
@@ -190,6 +178,11 @@ exports.checkCalculated = checkCalculated;
|
|
|
190
178
|
* @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.
|
|
191
179
|
* @returns {boolean} - TRUE if the condition is true; FALSE otherwise.
|
|
192
180
|
*/
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* @param conditionPaths
|
|
184
|
+
* @param data
|
|
185
|
+
*/
|
|
193
186
|
function getConditionalPathsRecursive(conditionPaths, data) {
|
|
194
187
|
let currentGlobalIndex = 0;
|
|
195
188
|
const conditionalPathsArray = [];
|
|
@@ -228,6 +221,14 @@ function getConditionalPathsRecursive(conditionPaths, data) {
|
|
|
228
221
|
getConditionalPaths(data);
|
|
229
222
|
return conditionalPathsArray;
|
|
230
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* @param component
|
|
227
|
+
* @param condition
|
|
228
|
+
* @param row
|
|
229
|
+
* @param data
|
|
230
|
+
* @param instance
|
|
231
|
+
*/
|
|
231
232
|
function checkSimpleConditional(component, condition, row, data, instance) {
|
|
232
233
|
if (condition.when) {
|
|
233
234
|
const value = getComponentActualValue(condition.when, data, row);
|
package/lib/mjs/CDN.d.ts
CHANGED
package/lib/mjs/CDN.js
CHANGED
|
@@ -16,6 +16,7 @@ class CDN {
|
|
|
16
16
|
'bootswatch': '5.3.3',
|
|
17
17
|
'bootstrap-icons': '1.11.1',
|
|
18
18
|
'ckeditor': '19.0.0',
|
|
19
|
+
'dragula': '3.7.3',
|
|
19
20
|
'flatpickr': '4.6.8',
|
|
20
21
|
'flatpickr-formio': '4.6.13-formio.3',
|
|
21
22
|
'font-awesome': '4.7.0',
|
|
@@ -62,8 +63,7 @@ class CDN {
|
|
|
62
63
|
url += `/${lib}`;
|
|
63
64
|
}
|
|
64
65
|
// Only attach the version if this is the hosted cdn.
|
|
65
|
-
if (cdnUrl.
|
|
66
|
-
version && version !== 'latest') {
|
|
66
|
+
if (cdnUrl.match(/cdn\.(test-)?form.io/) && version && version !== 'latest') {
|
|
67
67
|
url += `/${version}`;
|
|
68
68
|
}
|
|
69
69
|
return url;
|
package/lib/mjs/Form.d.ts
CHANGED
|
@@ -398,10 +398,10 @@ export default class Form extends Element {
|
|
|
398
398
|
getFormInitOptions(url: string, form: import('@formio/core').Form): object;
|
|
399
399
|
/**
|
|
400
400
|
* Sets the form to the JSON schema of a form.
|
|
401
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
401
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
402
402
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
403
403
|
*/
|
|
404
|
-
setForm(formParam: import('@formio/core').Form): Promise<Webform | Wizard | PDF>;
|
|
404
|
+
setForm(formParam: import('@formio/core').Form | string): Promise<Webform | Wizard | PDF>;
|
|
405
405
|
_form: any;
|
|
406
406
|
getSubmission(formio: any, opts: any): any;
|
|
407
407
|
/**
|
package/lib/mjs/Form.js
CHANGED
|
@@ -134,13 +134,13 @@ export default class Form extends Element {
|
|
|
134
134
|
else {
|
|
135
135
|
this.element = null;
|
|
136
136
|
}
|
|
137
|
+
this.options = formOptions;
|
|
138
|
+
this.options.events = this.events;
|
|
137
139
|
if (form) {
|
|
138
140
|
this.setForm(form)
|
|
139
141
|
.then(() => this.readyResolve(this.instance))
|
|
140
142
|
.catch(this.readyReject);
|
|
141
143
|
}
|
|
142
|
-
this.options = formOptions;
|
|
143
|
-
this.options.events = this.events;
|
|
144
144
|
this.display = '';
|
|
145
145
|
}
|
|
146
146
|
createElement(tag, attrs, children) {
|
|
@@ -264,7 +264,7 @@ export default class Form extends Element {
|
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
266
|
* Sets the form to the JSON schema of a form.
|
|
267
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
267
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
268
268
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
269
269
|
*/
|
|
270
270
|
setForm(formParam) {
|
|
@@ -291,8 +291,14 @@ export default class Form extends Element {
|
|
|
291
291
|
}
|
|
292
292
|
this.loading = false;
|
|
293
293
|
this.instance = this.instance || this.create(form.display);
|
|
294
|
-
|
|
295
|
-
this.instance.setUrl
|
|
294
|
+
// If we're in builder mode, instance.setUrl is not a function, so just manually set the URL.
|
|
295
|
+
if (this.instance.setUrl) {
|
|
296
|
+
const options = this.getFormInitOptions(formParam, form);
|
|
297
|
+
this.instance.setUrl(formParam, options);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
this.instance.url = formParam;
|
|
301
|
+
}
|
|
296
302
|
this.instance.nosubmit = false;
|
|
297
303
|
this._form = this.instance.form = form;
|
|
298
304
|
if (submission) {
|
package/lib/mjs/PDF.js
CHANGED
|
@@ -65,7 +65,7 @@ export default class PDF extends Webform {
|
|
|
65
65
|
super.destroy(all);
|
|
66
66
|
}
|
|
67
67
|
rebuild() {
|
|
68
|
-
if (this.
|
|
68
|
+
if (this.builderMode && this.component.components) {
|
|
69
69
|
this.destroyComponents();
|
|
70
70
|
this.addComponents();
|
|
71
71
|
return Promise.resolve();
|
package/lib/mjs/PDFBuilder.js
CHANGED
|
@@ -429,7 +429,7 @@ export default class PDFBuilder extends WebformBuilder {
|
|
|
429
429
|
_.merge(schema, info);
|
|
430
430
|
}
|
|
431
431
|
// Set a unique key for this component.
|
|
432
|
-
BuilderUtils.uniquify(
|
|
432
|
+
BuilderUtils.uniquify(this.webform._form?.components || [], schema);
|
|
433
433
|
this.webform._form.components.push(schema);
|
|
434
434
|
schema.overlay = {
|
|
435
435
|
top: layerY ? (layerY - this.itemOffsetY + HEIGHT) : (e.clientY - iframeRect.top - (this.itemOffsetY - HEIGHT) * 2),
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -12,7 +12,6 @@ import { eachComponent } from "./utils/formUtils";
|
|
|
12
12
|
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
|
13
13
|
window.global = window;
|
|
14
14
|
}
|
|
15
|
-
import dragula from "dragula";
|
|
16
15
|
// Initialize the available forms.
|
|
17
16
|
Formio.forms = {};
|
|
18
17
|
// Allow people to register components.
|
|
@@ -286,7 +285,6 @@ export default class Webform extends NestedDataComponent {
|
|
|
286
285
|
// Ensure the root is set to this component.
|
|
287
286
|
this.root = this;
|
|
288
287
|
this.localRoot = this;
|
|
289
|
-
this.root.dragulaLib = dragula;
|
|
290
288
|
}
|
|
291
289
|
/* eslint-enable max-statements */
|
|
292
290
|
get language() {
|
|
@@ -832,7 +830,6 @@ export default class Webform extends NestedDataComponent {
|
|
|
832
830
|
if (!submission || !submission.data) {
|
|
833
831
|
submission = {
|
|
834
832
|
data: {},
|
|
835
|
-
metadata: submission.metadata,
|
|
836
833
|
};
|
|
837
834
|
}
|
|
838
835
|
// Metadata needs to be available before setValue
|
|
@@ -1139,7 +1136,7 @@ export default class Webform extends NestedDataComponent {
|
|
|
1139
1136
|
});
|
|
1140
1137
|
const displayedErrors = [];
|
|
1141
1138
|
if (errors.length) {
|
|
1142
|
-
errors = _.uniqBy(errors, (error) => error.message);
|
|
1139
|
+
errors = _.uniqBy(errors, (error) => [error.message, error.component?.id, error.context?.path].join());
|
|
1143
1140
|
const createListItem = (message, index) => {
|
|
1144
1141
|
const err = errors[index];
|
|
1145
1142
|
const messageFromIndex = !_.isUndefined(index) && errors && errors[index];
|
|
@@ -1253,10 +1250,14 @@ export default class Webform extends NestedDataComponent {
|
|
|
1253
1250
|
}
|
|
1254
1251
|
this.checkData(value.data, flags);
|
|
1255
1252
|
const shouldValidate = !flags.noValidate ||
|
|
1256
|
-
flags.
|
|
1253
|
+
flags.fromIframe ||
|
|
1257
1254
|
(flags.fromSubmission && this.rootPristine && this.pristine && flags.changed);
|
|
1258
1255
|
const errors = shouldValidate
|
|
1259
|
-
? this.validate(value.data, {
|
|
1256
|
+
? this.validate(value.data, {
|
|
1257
|
+
...flags,
|
|
1258
|
+
noValidate: false,
|
|
1259
|
+
process: 'change'
|
|
1260
|
+
})
|
|
1260
1261
|
: [];
|
|
1261
1262
|
value.isValid = errors.length === 0;
|
|
1262
1263
|
this.loading = false;
|
|
@@ -187,7 +187,8 @@ export default class WebformBuilder extends Component {
|
|
|
187
187
|
params: {
|
|
188
188
|
type: 'resource',
|
|
189
189
|
limit: 1000000,
|
|
190
|
-
select: '_id,title,name,components'
|
|
190
|
+
select: '_id,title,name,components',
|
|
191
|
+
'tags__ne': 'noBuilderResource'
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
194
|
if (this.options && this.options.resourceTag) {
|
|
@@ -892,7 +893,11 @@ export default class WebformBuilder extends Component {
|
|
|
892
893
|
if (form && form.properties) {
|
|
893
894
|
this.options.properties = form.properties;
|
|
894
895
|
}
|
|
895
|
-
|
|
896
|
+
let keyboardActionsEnabled = _.get(this.options, 'keyboardBuilder', false) || this.options.properties?.keyboardBuilder;
|
|
897
|
+
if (typeof keyboardActionsEnabled === 'string') {
|
|
898
|
+
keyboardActionsEnabled = keyboardActionsEnabled === 'true';
|
|
899
|
+
}
|
|
900
|
+
this.keyboardActionsEnabled = keyboardActionsEnabled;
|
|
896
901
|
const isShowSubmitButton = !this.options.noDefaultSubmitButton
|
|
897
902
|
&& (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
|
|
898
903
|
// Ensure there is at least a submit button.
|
|
@@ -1044,7 +1049,10 @@ export default class WebformBuilder extends Component {
|
|
|
1044
1049
|
'calculateValue',
|
|
1045
1050
|
'conditional',
|
|
1046
1051
|
'customConditional',
|
|
1047
|
-
'id'
|
|
1052
|
+
'id',
|
|
1053
|
+
'fields.day.required',
|
|
1054
|
+
'fields.month.required',
|
|
1055
|
+
'fields.year.required',
|
|
1048
1056
|
]));
|
|
1049
1057
|
const parentComponent = defaultValueComponent.parent;
|
|
1050
1058
|
let tabIndex = -1;
|
|
@@ -1231,6 +1239,7 @@ export default class WebformBuilder extends Component {
|
|
|
1231
1239
|
helplinks: this.helplinks,
|
|
1232
1240
|
}));
|
|
1233
1241
|
this.editForm.attach(this.componentEdit.querySelector(`[${this._referenceAttributeName}="editForm"]`));
|
|
1242
|
+
this.updateComponent(this.editForm.submission.data ?? component);
|
|
1234
1243
|
this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);
|
|
1235
1244
|
});
|
|
1236
1245
|
});
|
package/lib/mjs/Wizard.js
CHANGED
|
@@ -13,7 +13,7 @@ export default class Wizard extends Webform {
|
|
|
13
13
|
*/
|
|
14
14
|
constructor(elementOrOptions = undefined, _options = undefined) {
|
|
15
15
|
let element, options;
|
|
16
|
-
if (elementOrOptions instanceof HTMLElement ||
|
|
16
|
+
if (elementOrOptions instanceof HTMLElement || _options) {
|
|
17
17
|
element = elementOrOptions;
|
|
18
18
|
options = _options || {};
|
|
19
19
|
}
|
|
@@ -830,6 +830,7 @@ declare class Component extends Element {
|
|
|
830
830
|
quill: any;
|
|
831
831
|
get shouldSanitizeValue(): boolean;
|
|
832
832
|
addAce(element: any, settings: any, onChange: any): any;
|
|
833
|
+
getDragula(): Promise<any>;
|
|
833
834
|
get tree(): any;
|
|
834
835
|
/**
|
|
835
836
|
* The empty value for this component.
|
|
@@ -1075,7 +1076,7 @@ declare class Component extends Element {
|
|
|
1075
1076
|
elementInfo(): any;
|
|
1076
1077
|
autofocus(): void;
|
|
1077
1078
|
scrollIntoView(element?: any): void;
|
|
1078
|
-
focus(index
|
|
1079
|
+
focus(index: any): void;
|
|
1079
1080
|
/**
|
|
1080
1081
|
* Get `Formio` instance for working with files
|
|
1081
1082
|
* @returns {import('@formio/core').Formio} - The Formio instance file service.
|
|
@@ -2351,6 +2351,13 @@ export default class Component extends Element {
|
|
|
2351
2351
|
return editor;
|
|
2352
2352
|
});
|
|
2353
2353
|
}
|
|
2354
|
+
async getDragula() {
|
|
2355
|
+
return new Promise((resolve) => {
|
|
2356
|
+
return Formio.requireLibrary('dragula', 'dragula', `${Formio.cdn.dragula}/dragula.js`, true, (ready) => {
|
|
2357
|
+
return ready.then(resolve);
|
|
2358
|
+
});
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2354
2361
|
get tree() {
|
|
2355
2362
|
return this.component.tree || false;
|
|
2356
2363
|
}
|
|
@@ -2981,7 +2988,7 @@ export default class Component extends Element {
|
|
|
2981
2988
|
this.parent.childErrors.push(...errors);
|
|
2982
2989
|
}
|
|
2983
2990
|
else {
|
|
2984
|
-
_.remove(this.parent.childErrors, (err) => err
|
|
2991
|
+
_.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
|
|
2985
2992
|
}
|
|
2986
2993
|
}
|
|
2987
2994
|
this.showValidationErrors(errors, data, row, flags);
|
|
@@ -2997,7 +3004,7 @@ export default class Component extends Element {
|
|
|
2997
3004
|
this.parent.childErrors.push(...errors);
|
|
2998
3005
|
}
|
|
2999
3006
|
else {
|
|
3000
|
-
_.remove(this.parent.childErrors, (err) => err
|
|
3007
|
+
_.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
|
|
3001
3008
|
}
|
|
3002
3009
|
}
|
|
3003
3010
|
return errors.length === 0;
|
|
@@ -3418,10 +3425,11 @@ export default class Component extends Element {
|
|
|
3418
3425
|
const { left, top } = element.getBoundingClientRect();
|
|
3419
3426
|
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
|
3420
3427
|
}
|
|
3421
|
-
focus(index
|
|
3428
|
+
focus(index) {
|
|
3422
3429
|
if ('beforeFocus' in this.parent) {
|
|
3423
3430
|
this.parent.beforeFocus(this);
|
|
3424
3431
|
}
|
|
3432
|
+
index = index || this.refs.input?.length - 1;
|
|
3425
3433
|
if (this.refs.input?.length) {
|
|
3426
3434
|
const focusingInput = this.refs.input[index];
|
|
3427
3435
|
if (this.component.widget?.type === 'calendar') {
|