@formio/js 5.3.1 → 5.3.3
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/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 +928 -919
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -4
- package/dist/formio.full.js +1209 -1200
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -4
- package/dist/formio.js +846 -826
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -2
- package/dist/formio.utils.js +791 -782
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -4
- package/lib/cjs/Embed.js +29 -1
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/Webform.js +26 -0
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.d.ts +18 -1
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +3 -0
- package/lib/cjs/components/datetime/editForm/DateTime.edit.time.d.ts +13 -2
- package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +3 -0
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.d.ts +0 -10
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +9 -23
- package/lib/cjs/package.json +1 -1
- package/lib/mjs/Embed.js +29 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/Webform.js +26 -0
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.d.ts +18 -1
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +3 -0
- package/lib/mjs/components/datetime/editForm/DateTime.edit.time.d.ts +13 -2
- package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +3 -0
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.d.ts +0 -10
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +9 -23
- package/lib/mjs/package.json +1 -1
- package/package.json +4 -4
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
* MIT licensed
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
/*! @license DOMPurify 3.
|
|
21
|
+
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
|
|
22
22
|
|
|
23
|
-
/*!
|
|
24
|
-
|
|
25
|
-
/*! formiojs v5.3.1 | https://unpkg.com/formiojs@5.3.1/LICENSE.txt */
|
|
23
|
+
/*! formiojs v5.3.3 | https://unpkg.com/formiojs@5.3.3/LICENSE.txt */
|
|
26
24
|
|
|
27
25
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
28
26
|
|
package/lib/cjs/Embed.js
CHANGED
|
@@ -154,6 +154,34 @@ class Formio {
|
|
|
154
154
|
if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {
|
|
155
155
|
instance.element.innerHTML = `<div class="alert-success" role="alert">${successMessage}</div>`;
|
|
156
156
|
}
|
|
157
|
+
const announcementMessage = successMessage && successMessage.toLowerCase() !== 'false'
|
|
158
|
+
? successMessage
|
|
159
|
+
: 'Form submission complete';
|
|
160
|
+
let liveRegion = document.getElementById('formio-announcements');
|
|
161
|
+
if (!liveRegion) {
|
|
162
|
+
liveRegion = _a.createElement('div', {
|
|
163
|
+
id: 'formio-announcements',
|
|
164
|
+
'role': 'status',
|
|
165
|
+
'aria-live': 'polite',
|
|
166
|
+
'aria-atomic': 'true',
|
|
167
|
+
style: 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);'
|
|
168
|
+
});
|
|
169
|
+
document.body.appendChild(liveRegion);
|
|
170
|
+
}
|
|
171
|
+
// Announce the submission completion using VPAT clear-and-reset technique
|
|
172
|
+
liveRegion.textContent = '';
|
|
173
|
+
liveRegion.setAttribute('aria-live', 'off');
|
|
174
|
+
requestAnimationFrame(() => {
|
|
175
|
+
setTimeout(() => {
|
|
176
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
177
|
+
liveRegion.textContent = announcementMessage;
|
|
178
|
+
setTimeout(() => {
|
|
179
|
+
if (liveRegion) {
|
|
180
|
+
liveRegion.textContent = '';
|
|
181
|
+
}
|
|
182
|
+
}, 1000);
|
|
183
|
+
}, 100);
|
|
184
|
+
});
|
|
157
185
|
let returnUrl = _a.config.redirect;
|
|
158
186
|
// Allow form based configuration for return url.
|
|
159
187
|
if (!returnUrl &&
|
|
@@ -453,7 +481,7 @@ Formio.formioReady = new Promise((ready, reject) => {
|
|
|
453
481
|
_a._formioReady = ready;
|
|
454
482
|
_a._formioReadyReject = reject;
|
|
455
483
|
});
|
|
456
|
-
Formio.version = '5.3.
|
|
484
|
+
Formio.version = '5.3.3';
|
|
457
485
|
// Create a report.
|
|
458
486
|
Formio.Report = {
|
|
459
487
|
create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
package/lib/cjs/Formio.js
CHANGED
|
@@ -11,7 +11,7 @@ const CDN_1 = __importDefault(require("./CDN"));
|
|
|
11
11
|
const providers_1 = __importDefault(require("./providers"));
|
|
12
12
|
sdk_1.Formio.cdn = new CDN_1.default();
|
|
13
13
|
sdk_1.Formio.Providers = providers_1.default;
|
|
14
|
-
sdk_1.Formio.version = '5.3.
|
|
14
|
+
sdk_1.Formio.version = '5.3.3';
|
|
15
15
|
CDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc')
|
|
16
16
|
? 'https://cdn.test-form.io'
|
|
17
17
|
: 'https://cdn.form.io';
|
package/lib/cjs/Webform.js
CHANGED
|
@@ -1130,6 +1130,32 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
1130
1130
|
if (this.draftEnabled && ((_a = this.triggerSaveDraft) === null || _a === void 0 ? void 0 : _a.cancel)) {
|
|
1131
1131
|
this.triggerSaveDraft.cancel();
|
|
1132
1132
|
}
|
|
1133
|
+
if (typeof document !== 'undefined' && document.body) {
|
|
1134
|
+
const announcementMessage = this.t ? this.t('complete') : 'Form submission complete';
|
|
1135
|
+
// Get or create ARIA live region for announcements
|
|
1136
|
+
let liveRegion = document.getElementById('formio-announcements');
|
|
1137
|
+
if (!liveRegion) {
|
|
1138
|
+
liveRegion = document.createElement('div');
|
|
1139
|
+
liveRegion.id = 'formio-announcements';
|
|
1140
|
+
liveRegion.setAttribute('role', 'status');
|
|
1141
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
1142
|
+
liveRegion.setAttribute('aria-atomic', 'true');
|
|
1143
|
+
liveRegion.style.cssText = 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);';
|
|
1144
|
+
document.body.appendChild(liveRegion);
|
|
1145
|
+
}
|
|
1146
|
+
// Announce the submission completion using VPAT clear-and-reset technique
|
|
1147
|
+
liveRegion.textContent = '';
|
|
1148
|
+
liveRegion.setAttribute('aria-live', 'off');
|
|
1149
|
+
requestAnimationFrame(() => {
|
|
1150
|
+
setTimeout(() => {
|
|
1151
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
1152
|
+
liveRegion.textContent = announcementMessage;
|
|
1153
|
+
setTimeout(() => {
|
|
1154
|
+
liveRegion.textContent = '';
|
|
1155
|
+
}, 1000);
|
|
1156
|
+
}, 100);
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1133
1159
|
this.emit('submit', submission, saved);
|
|
1134
1160
|
if (saved) {
|
|
1135
1161
|
this.emit('submitDone', submission);
|
|
@@ -5,8 +5,10 @@ declare const _default: ({
|
|
|
5
5
|
label: string;
|
|
6
6
|
weight: number;
|
|
7
7
|
tooltip: string;
|
|
8
|
+
validate: {
|
|
9
|
+
custom: string;
|
|
10
|
+
};
|
|
8
11
|
placeholder?: undefined;
|
|
9
|
-
validate?: undefined;
|
|
10
12
|
title?: undefined;
|
|
11
13
|
collapsible?: undefined;
|
|
12
14
|
collapsed?: undefined;
|
|
@@ -57,7 +59,22 @@ declare const _default: ({
|
|
|
57
59
|
label?: undefined;
|
|
58
60
|
weight?: undefined;
|
|
59
61
|
tooltip?: undefined;
|
|
62
|
+
validate?: undefined;
|
|
60
63
|
placeholder?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
input: boolean;
|
|
67
|
+
key: string;
|
|
68
|
+
label: string;
|
|
69
|
+
tooltip: string;
|
|
70
|
+
weight: number;
|
|
61
71
|
validate?: undefined;
|
|
72
|
+
placeholder?: undefined;
|
|
73
|
+
title?: undefined;
|
|
74
|
+
collapsible?: undefined;
|
|
75
|
+
collapsed?: undefined;
|
|
76
|
+
style?: undefined;
|
|
77
|
+
customConditional?: undefined;
|
|
78
|
+
components?: undefined;
|
|
62
79
|
})[];
|
|
63
80
|
export default _default;
|
|
@@ -13,6 +13,9 @@ exports.default = [
|
|
|
13
13
|
label: 'Enable Date Input',
|
|
14
14
|
weight: 0,
|
|
15
15
|
tooltip: 'Enables date input for this field.',
|
|
16
|
+
validate: {
|
|
17
|
+
custom: "valid = !data.enableTime && !input ? 'Cannot disable both Date and Time inputs at the same time' : true",
|
|
18
|
+
},
|
|
16
19
|
},
|
|
17
20
|
{
|
|
18
21
|
type: 'tags',
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
declare const _default: {
|
|
1
|
+
declare const _default: ({
|
|
2
2
|
type: string;
|
|
3
3
|
input: boolean;
|
|
4
4
|
key: string;
|
|
5
5
|
label: string;
|
|
6
6
|
tooltip: string;
|
|
7
7
|
weight: number;
|
|
8
|
-
|
|
8
|
+
validate: {
|
|
9
|
+
custom: string;
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
type: string;
|
|
13
|
+
input: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
tooltip: string;
|
|
17
|
+
weight: number;
|
|
18
|
+
validate?: undefined;
|
|
19
|
+
})[];
|
|
9
20
|
export default _default;
|
|
@@ -8,6 +8,9 @@ exports.default = [
|
|
|
8
8
|
label: 'Enable Time Input',
|
|
9
9
|
tooltip: 'Enables time input for this field.',
|
|
10
10
|
weight: 0,
|
|
11
|
+
validate: {
|
|
12
|
+
custom: "valid = !data.enableDate && !input ? 'Cannot disable both Date and Time inputs at the same time' : true",
|
|
13
|
+
},
|
|
11
14
|
},
|
|
12
15
|
{
|
|
13
16
|
type: 'number',
|
|
@@ -25,7 +25,6 @@ declare const _default: ({
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
clearOnHide?: undefined;
|
|
28
|
-
customDefaultValue?: undefined;
|
|
29
28
|
rows?: undefined;
|
|
30
29
|
editor?: undefined;
|
|
31
30
|
as?: undefined;
|
|
@@ -40,7 +39,6 @@ declare const _default: ({
|
|
|
40
39
|
label: string;
|
|
41
40
|
clearOnHide: boolean;
|
|
42
41
|
onChange: (context: any) => void;
|
|
43
|
-
customDefaultValue: (value: any, component: any, row: any, data: any, instance: any) => any;
|
|
44
42
|
input: boolean;
|
|
45
43
|
rows: number;
|
|
46
44
|
editor: string;
|
|
@@ -79,7 +77,6 @@ declare const _default: ({
|
|
|
79
77
|
data?: undefined;
|
|
80
78
|
conditional?: undefined;
|
|
81
79
|
clearOnHide?: undefined;
|
|
82
|
-
customDefaultValue?: undefined;
|
|
83
80
|
rows?: undefined;
|
|
84
81
|
editor?: undefined;
|
|
85
82
|
as?: undefined;
|
|
@@ -107,7 +104,6 @@ declare const _default: ({
|
|
|
107
104
|
onChange?: undefined;
|
|
108
105
|
conditional?: undefined;
|
|
109
106
|
clearOnHide?: undefined;
|
|
110
|
-
customDefaultValue?: undefined;
|
|
111
107
|
rows?: undefined;
|
|
112
108
|
editor?: undefined;
|
|
113
109
|
as?: undefined;
|
|
@@ -133,7 +129,6 @@ declare const _default: ({
|
|
|
133
129
|
data?: undefined;
|
|
134
130
|
conditional?: undefined;
|
|
135
131
|
clearOnHide?: undefined;
|
|
136
|
-
customDefaultValue?: undefined;
|
|
137
132
|
rows?: undefined;
|
|
138
133
|
editor?: undefined;
|
|
139
134
|
as?: undefined;
|
|
@@ -154,7 +149,6 @@ declare const _default: ({
|
|
|
154
149
|
data?: undefined;
|
|
155
150
|
conditional?: undefined;
|
|
156
151
|
clearOnHide?: undefined;
|
|
157
|
-
customDefaultValue?: undefined;
|
|
158
152
|
rows?: undefined;
|
|
159
153
|
editor?: undefined;
|
|
160
154
|
as?: undefined;
|
|
@@ -177,7 +171,6 @@ declare const _default: ({
|
|
|
177
171
|
data?: undefined;
|
|
178
172
|
conditional?: undefined;
|
|
179
173
|
clearOnHide?: undefined;
|
|
180
|
-
customDefaultValue?: undefined;
|
|
181
174
|
rows?: undefined;
|
|
182
175
|
editor?: undefined;
|
|
183
176
|
as?: undefined;
|
|
@@ -208,7 +201,6 @@ declare const _default: ({
|
|
|
208
201
|
data?: undefined;
|
|
209
202
|
conditional?: undefined;
|
|
210
203
|
clearOnHide?: undefined;
|
|
211
|
-
customDefaultValue?: undefined;
|
|
212
204
|
rows?: undefined;
|
|
213
205
|
editor?: undefined;
|
|
214
206
|
as?: undefined;
|
|
@@ -228,7 +220,6 @@ declare const _default: ({
|
|
|
228
220
|
data?: undefined;
|
|
229
221
|
conditional?: undefined;
|
|
230
222
|
clearOnHide?: undefined;
|
|
231
|
-
customDefaultValue?: undefined;
|
|
232
223
|
rows?: undefined;
|
|
233
224
|
editor?: undefined;
|
|
234
225
|
as?: undefined;
|
|
@@ -251,7 +242,6 @@ declare const _default: ({
|
|
|
251
242
|
data?: undefined;
|
|
252
243
|
conditional?: undefined;
|
|
253
244
|
clearOnHide?: undefined;
|
|
254
|
-
customDefaultValue?: undefined;
|
|
255
245
|
rows?: undefined;
|
|
256
246
|
editor?: undefined;
|
|
257
247
|
as?: undefined;
|
|
@@ -20,19 +20,19 @@ exports.default = [
|
|
|
20
20
|
defaultValue: 'input',
|
|
21
21
|
calculateValue: (context) => {
|
|
22
22
|
var _a;
|
|
23
|
-
let currentType = context.
|
|
23
|
+
let currentType = context.instance._widgetType;
|
|
24
24
|
if (currentType) {
|
|
25
25
|
return currentType;
|
|
26
26
|
}
|
|
27
27
|
const widget = context.data.widget;
|
|
28
28
|
if (isObject(widget) && widget.type) {
|
|
29
|
-
context.
|
|
29
|
+
context.instance._widgetType = widget.type;
|
|
30
30
|
return widget.type;
|
|
31
31
|
}
|
|
32
32
|
if (typeof widget === 'string') {
|
|
33
33
|
const originalType = (_a = getOriginalWidget(context.instance)) === null || _a === void 0 ? void 0 : _a.type;
|
|
34
34
|
if (originalType) {
|
|
35
|
-
context.
|
|
35
|
+
context.instance._widgetType = originalType;
|
|
36
36
|
return originalType;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -40,11 +40,11 @@ exports.default = [
|
|
|
40
40
|
},
|
|
41
41
|
onChange: (context) => {
|
|
42
42
|
var _a;
|
|
43
|
-
const newType = context.
|
|
43
|
+
const newType = context.instance.dataValue;
|
|
44
44
|
const currentWidget = context.data.widget;
|
|
45
45
|
let oldType;
|
|
46
46
|
if (isObject(currentWidget)) {
|
|
47
|
-
oldType =
|
|
47
|
+
oldType = context.instance._widgetType;
|
|
48
48
|
}
|
|
49
49
|
else if (typeof currentWidget === 'string') {
|
|
50
50
|
oldType = (_a = getOriginalWidget(context.instance)) === null || _a === void 0 ? void 0 : _a.type;
|
|
@@ -55,10 +55,12 @@ exports.default = [
|
|
|
55
55
|
if (newType !== oldType) {
|
|
56
56
|
if (newType === 'input') {
|
|
57
57
|
context.data.widget = { type: 'input' };
|
|
58
|
+
context.instance._widgetType = newType;
|
|
58
59
|
}
|
|
59
|
-
else {
|
|
60
|
+
else if (newType) {
|
|
60
61
|
const defaultSettings = getDefaultWidgetSettings(newType);
|
|
61
62
|
context.data.widget = defaultSettings || { type: newType };
|
|
63
|
+
context.instance._widgetType = newType;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
else if (!currentWidget) {
|
|
@@ -94,28 +96,12 @@ exports.default = [
|
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
98
|
if (isObject(currentWidget)) {
|
|
97
|
-
const currentType = context.
|
|
99
|
+
const currentType = context.instance.root.getComponent('widget.type')._widgetType || currentWidget.type;
|
|
98
100
|
if (currentType && currentWidget.type !== currentType) {
|
|
99
101
|
context.data.widget = Object.assign(Object.assign({}, currentWidget), { type: currentType });
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
},
|
|
103
|
-
customDefaultValue: (value, component, row, data, instance) => {
|
|
104
|
-
if (!data.widget) {
|
|
105
|
-
const originalWidget = getOriginalWidget(instance);
|
|
106
|
-
const widgetType = data['widget.type'] || (originalWidget === null || originalWidget === void 0 ? void 0 : originalWidget.type);
|
|
107
|
-
if (widgetType && widgetType !== 'input') {
|
|
108
|
-
if ((originalWidget === null || originalWidget === void 0 ? void 0 : originalWidget.type) === widgetType && !lodash_1.default.isEmpty(lodash_1.default.omit(originalWidget, 'type'))) {
|
|
109
|
-
return lodash_1.default.omit(originalWidget, 'language');
|
|
110
|
-
}
|
|
111
|
-
const defaultSettings = getDefaultWidgetSettings(widgetType);
|
|
112
|
-
if (defaultSettings) {
|
|
113
|
-
return defaultSettings;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return value;
|
|
118
|
-
},
|
|
119
105
|
input: true,
|
|
120
106
|
rows: 5,
|
|
121
107
|
editor: 'ace',
|
package/lib/cjs/package.json
CHANGED
package/lib/mjs/Embed.js
CHANGED
|
@@ -14,7 +14,7 @@ export class Formio {
|
|
|
14
14
|
Formio._formioReady = ready;
|
|
15
15
|
Formio._formioReadyReject = reject;
|
|
16
16
|
});
|
|
17
|
-
static version = '5.3.
|
|
17
|
+
static version = '5.3.3';
|
|
18
18
|
static setLicense(license, norecurse = false) {
|
|
19
19
|
Formio.license = license;
|
|
20
20
|
if (!norecurse && Formio.FormioClass) {
|
|
@@ -148,6 +148,34 @@ export class Formio {
|
|
|
148
148
|
if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {
|
|
149
149
|
instance.element.innerHTML = `<div class="alert-success" role="alert">${successMessage}</div>`;
|
|
150
150
|
}
|
|
151
|
+
const announcementMessage = successMessage && successMessage.toLowerCase() !== 'false'
|
|
152
|
+
? successMessage
|
|
153
|
+
: 'Form submission complete';
|
|
154
|
+
let liveRegion = document.getElementById('formio-announcements');
|
|
155
|
+
if (!liveRegion) {
|
|
156
|
+
liveRegion = Formio.createElement('div', {
|
|
157
|
+
id: 'formio-announcements',
|
|
158
|
+
'role': 'status',
|
|
159
|
+
'aria-live': 'polite',
|
|
160
|
+
'aria-atomic': 'true',
|
|
161
|
+
style: 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);'
|
|
162
|
+
});
|
|
163
|
+
document.body.appendChild(liveRegion);
|
|
164
|
+
}
|
|
165
|
+
// Announce the submission completion using VPAT clear-and-reset technique
|
|
166
|
+
liveRegion.textContent = '';
|
|
167
|
+
liveRegion.setAttribute('aria-live', 'off');
|
|
168
|
+
requestAnimationFrame(() => {
|
|
169
|
+
setTimeout(() => {
|
|
170
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
171
|
+
liveRegion.textContent = announcementMessage;
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
if (liveRegion) {
|
|
174
|
+
liveRegion.textContent = '';
|
|
175
|
+
}
|
|
176
|
+
}, 1000);
|
|
177
|
+
}, 100);
|
|
178
|
+
});
|
|
151
179
|
let returnUrl = Formio.config.redirect;
|
|
152
180
|
// Allow form based configuration for return url.
|
|
153
181
|
if (!returnUrl &&
|
package/lib/mjs/Formio.js
CHANGED
|
@@ -4,7 +4,7 @@ import CDN from './CDN';
|
|
|
4
4
|
import Providers from './providers';
|
|
5
5
|
FormioCore.cdn = new CDN();
|
|
6
6
|
FormioCore.Providers = Providers;
|
|
7
|
-
FormioCore.version = '5.3.
|
|
7
|
+
FormioCore.version = '5.3.3';
|
|
8
8
|
CDN.defaultCDN = FormioCore.version.includes('rc')
|
|
9
9
|
? 'https://cdn.test-form.io'
|
|
10
10
|
: 'https://cdn.form.io';
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -1120,6 +1120,32 @@ export default class Webform extends NestedDataComponent {
|
|
|
1120
1120
|
if (this.draftEnabled && this.triggerSaveDraft?.cancel) {
|
|
1121
1121
|
this.triggerSaveDraft.cancel();
|
|
1122
1122
|
}
|
|
1123
|
+
if (typeof document !== 'undefined' && document.body) {
|
|
1124
|
+
const announcementMessage = this.t ? this.t('complete') : 'Form submission complete';
|
|
1125
|
+
// Get or create ARIA live region for announcements
|
|
1126
|
+
let liveRegion = document.getElementById('formio-announcements');
|
|
1127
|
+
if (!liveRegion) {
|
|
1128
|
+
liveRegion = document.createElement('div');
|
|
1129
|
+
liveRegion.id = 'formio-announcements';
|
|
1130
|
+
liveRegion.setAttribute('role', 'status');
|
|
1131
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
1132
|
+
liveRegion.setAttribute('aria-atomic', 'true');
|
|
1133
|
+
liveRegion.style.cssText = 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);';
|
|
1134
|
+
document.body.appendChild(liveRegion);
|
|
1135
|
+
}
|
|
1136
|
+
// Announce the submission completion using VPAT clear-and-reset technique
|
|
1137
|
+
liveRegion.textContent = '';
|
|
1138
|
+
liveRegion.setAttribute('aria-live', 'off');
|
|
1139
|
+
requestAnimationFrame(() => {
|
|
1140
|
+
setTimeout(() => {
|
|
1141
|
+
liveRegion.setAttribute('aria-live', 'polite');
|
|
1142
|
+
liveRegion.textContent = announcementMessage;
|
|
1143
|
+
setTimeout(() => {
|
|
1144
|
+
liveRegion.textContent = '';
|
|
1145
|
+
}, 1000);
|
|
1146
|
+
}, 100);
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1123
1149
|
this.emit('submit', submission, saved);
|
|
1124
1150
|
if (saved) {
|
|
1125
1151
|
this.emit('submitDone', submission);
|
|
@@ -5,8 +5,10 @@ declare const _default: ({
|
|
|
5
5
|
label: string;
|
|
6
6
|
weight: number;
|
|
7
7
|
tooltip: string;
|
|
8
|
+
validate: {
|
|
9
|
+
custom: string;
|
|
10
|
+
};
|
|
8
11
|
placeholder?: undefined;
|
|
9
|
-
validate?: undefined;
|
|
10
12
|
title?: undefined;
|
|
11
13
|
collapsible?: undefined;
|
|
12
14
|
collapsed?: undefined;
|
|
@@ -57,7 +59,22 @@ declare const _default: ({
|
|
|
57
59
|
label?: undefined;
|
|
58
60
|
weight?: undefined;
|
|
59
61
|
tooltip?: undefined;
|
|
62
|
+
validate?: undefined;
|
|
60
63
|
placeholder?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
type: string;
|
|
66
|
+
input: boolean;
|
|
67
|
+
key: string;
|
|
68
|
+
label: string;
|
|
69
|
+
tooltip: string;
|
|
70
|
+
weight: number;
|
|
61
71
|
validate?: undefined;
|
|
72
|
+
placeholder?: undefined;
|
|
73
|
+
title?: undefined;
|
|
74
|
+
collapsible?: undefined;
|
|
75
|
+
collapsed?: undefined;
|
|
76
|
+
style?: undefined;
|
|
77
|
+
customConditional?: undefined;
|
|
78
|
+
components?: undefined;
|
|
62
79
|
})[];
|
|
63
80
|
export default _default;
|
|
@@ -8,6 +8,9 @@ export default [
|
|
|
8
8
|
label: 'Enable Date Input',
|
|
9
9
|
weight: 0,
|
|
10
10
|
tooltip: 'Enables date input for this field.',
|
|
11
|
+
validate: {
|
|
12
|
+
custom: "valid = !data.enableTime && !input ? 'Cannot disable both Date and Time inputs at the same time' : true",
|
|
13
|
+
},
|
|
11
14
|
},
|
|
12
15
|
{
|
|
13
16
|
type: 'tags',
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
declare const _default: {
|
|
1
|
+
declare const _default: ({
|
|
2
2
|
type: string;
|
|
3
3
|
input: boolean;
|
|
4
4
|
key: string;
|
|
5
5
|
label: string;
|
|
6
6
|
tooltip: string;
|
|
7
7
|
weight: number;
|
|
8
|
-
|
|
8
|
+
validate: {
|
|
9
|
+
custom: string;
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
type: string;
|
|
13
|
+
input: boolean;
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
tooltip: string;
|
|
17
|
+
weight: number;
|
|
18
|
+
validate?: undefined;
|
|
19
|
+
})[];
|
|
9
20
|
export default _default;
|
|
@@ -6,6 +6,9 @@ export default [
|
|
|
6
6
|
label: 'Enable Time Input',
|
|
7
7
|
tooltip: 'Enables time input for this field.',
|
|
8
8
|
weight: 0,
|
|
9
|
+
validate: {
|
|
10
|
+
custom: "valid = !data.enableDate && !input ? 'Cannot disable both Date and Time inputs at the same time' : true",
|
|
11
|
+
},
|
|
9
12
|
},
|
|
10
13
|
{
|
|
11
14
|
type: 'number',
|
|
@@ -25,7 +25,6 @@ declare const _default: ({
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
clearOnHide?: undefined;
|
|
28
|
-
customDefaultValue?: undefined;
|
|
29
28
|
rows?: undefined;
|
|
30
29
|
editor?: undefined;
|
|
31
30
|
as?: undefined;
|
|
@@ -40,7 +39,6 @@ declare const _default: ({
|
|
|
40
39
|
label: string;
|
|
41
40
|
clearOnHide: boolean;
|
|
42
41
|
onChange: (context: any) => void;
|
|
43
|
-
customDefaultValue: (value: any, component: any, row: any, data: any, instance: any) => any;
|
|
44
42
|
input: boolean;
|
|
45
43
|
rows: number;
|
|
46
44
|
editor: string;
|
|
@@ -79,7 +77,6 @@ declare const _default: ({
|
|
|
79
77
|
data?: undefined;
|
|
80
78
|
conditional?: undefined;
|
|
81
79
|
clearOnHide?: undefined;
|
|
82
|
-
customDefaultValue?: undefined;
|
|
83
80
|
rows?: undefined;
|
|
84
81
|
editor?: undefined;
|
|
85
82
|
as?: undefined;
|
|
@@ -107,7 +104,6 @@ declare const _default: ({
|
|
|
107
104
|
onChange?: undefined;
|
|
108
105
|
conditional?: undefined;
|
|
109
106
|
clearOnHide?: undefined;
|
|
110
|
-
customDefaultValue?: undefined;
|
|
111
107
|
rows?: undefined;
|
|
112
108
|
editor?: undefined;
|
|
113
109
|
as?: undefined;
|
|
@@ -133,7 +129,6 @@ declare const _default: ({
|
|
|
133
129
|
data?: undefined;
|
|
134
130
|
conditional?: undefined;
|
|
135
131
|
clearOnHide?: undefined;
|
|
136
|
-
customDefaultValue?: undefined;
|
|
137
132
|
rows?: undefined;
|
|
138
133
|
editor?: undefined;
|
|
139
134
|
as?: undefined;
|
|
@@ -154,7 +149,6 @@ declare const _default: ({
|
|
|
154
149
|
data?: undefined;
|
|
155
150
|
conditional?: undefined;
|
|
156
151
|
clearOnHide?: undefined;
|
|
157
|
-
customDefaultValue?: undefined;
|
|
158
152
|
rows?: undefined;
|
|
159
153
|
editor?: undefined;
|
|
160
154
|
as?: undefined;
|
|
@@ -177,7 +171,6 @@ declare const _default: ({
|
|
|
177
171
|
data?: undefined;
|
|
178
172
|
conditional?: undefined;
|
|
179
173
|
clearOnHide?: undefined;
|
|
180
|
-
customDefaultValue?: undefined;
|
|
181
174
|
rows?: undefined;
|
|
182
175
|
editor?: undefined;
|
|
183
176
|
as?: undefined;
|
|
@@ -208,7 +201,6 @@ declare const _default: ({
|
|
|
208
201
|
data?: undefined;
|
|
209
202
|
conditional?: undefined;
|
|
210
203
|
clearOnHide?: undefined;
|
|
211
|
-
customDefaultValue?: undefined;
|
|
212
204
|
rows?: undefined;
|
|
213
205
|
editor?: undefined;
|
|
214
206
|
as?: undefined;
|
|
@@ -228,7 +220,6 @@ declare const _default: ({
|
|
|
228
220
|
data?: undefined;
|
|
229
221
|
conditional?: undefined;
|
|
230
222
|
clearOnHide?: undefined;
|
|
231
|
-
customDefaultValue?: undefined;
|
|
232
223
|
rows?: undefined;
|
|
233
224
|
editor?: undefined;
|
|
234
225
|
as?: undefined;
|
|
@@ -251,7 +242,6 @@ declare const _default: ({
|
|
|
251
242
|
data?: undefined;
|
|
252
243
|
conditional?: undefined;
|
|
253
244
|
clearOnHide?: undefined;
|
|
254
|
-
customDefaultValue?: undefined;
|
|
255
245
|
rows?: undefined;
|
|
256
246
|
editor?: undefined;
|
|
257
247
|
as?: undefined;
|