@formio/js 5.5.0 → 5.5.1-api99.0
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/README.md +1 -0
- 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 +912 -912
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +1205 -1205
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +820 -820
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +763 -763
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/PDF.js +2 -0
- package/lib/cjs/Wizard.js +5 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +7 -0
- package/lib/cjs/components/_classes/component/Component.js +37 -5
- package/lib/cjs/components/_classes/input/Input.js +1 -0
- package/lib/cjs/components/address/Address.d.ts +2 -0
- package/lib/cjs/components/address/Address.js +21 -16
- package/lib/cjs/components/editgrid/EditGrid.js +13 -1
- package/lib/cjs/components/form/Form.js +10 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +67 -109
- package/lib/cjs/components/select/editForm/Select.edit.data.js +0 -42
- package/lib/cjs/components/textarea/TextArea.js +4 -0
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.d.ts +75 -5
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +13 -0
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.js +14 -2
- package/lib/cjs/utils/index.d.ts +1 -0
- package/lib/cjs/utils/utils.d.ts +7 -0
- package/lib/cjs/utils/utils.js +32 -5
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/PDF.js +2 -0
- package/lib/mjs/Wizard.js +5 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +7 -0
- package/lib/mjs/components/_classes/component/Component.js +37 -5
- package/lib/mjs/components/_classes/input/Input.js +1 -0
- package/lib/mjs/components/address/Address.d.ts +2 -0
- package/lib/mjs/components/address/Address.js +19 -7
- package/lib/mjs/components/editgrid/EditGrid.js +13 -1
- package/lib/mjs/components/form/Form.js +10 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +67 -109
- package/lib/mjs/components/select/editForm/Select.edit.data.js +0 -42
- package/lib/mjs/components/textarea/TextArea.js +4 -0
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.d.ts +75 -5
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +13 -0
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +1 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.js +13 -2
- package/lib/mjs/utils/index.d.ts +1 -0
- package/lib/mjs/utils/utils.d.ts +7 -0
- package/lib/mjs/utils/utils.js +29 -3
- package/package.json +5 -4
|
@@ -10,6 +10,9 @@ declare const _default: ({
|
|
|
10
10
|
defaultValue?: undefined;
|
|
11
11
|
dataSrc?: undefined;
|
|
12
12
|
data?: undefined;
|
|
13
|
+
tag?: undefined;
|
|
14
|
+
className?: undefined;
|
|
15
|
+
content?: undefined;
|
|
13
16
|
conditional?: undefined;
|
|
14
17
|
valueProperty?: undefined;
|
|
15
18
|
rows?: undefined;
|
|
@@ -29,6 +32,9 @@ declare const _default: ({
|
|
|
29
32
|
defaultValue?: undefined;
|
|
30
33
|
dataSrc?: undefined;
|
|
31
34
|
data?: undefined;
|
|
35
|
+
tag?: undefined;
|
|
36
|
+
className?: undefined;
|
|
37
|
+
content?: undefined;
|
|
32
38
|
conditional?: undefined;
|
|
33
39
|
valueProperty?: undefined;
|
|
34
40
|
rows?: undefined;
|
|
@@ -48,6 +54,9 @@ declare const _default: ({
|
|
|
48
54
|
placeholder?: undefined;
|
|
49
55
|
dataSrc?: undefined;
|
|
50
56
|
data?: undefined;
|
|
57
|
+
tag?: undefined;
|
|
58
|
+
className?: undefined;
|
|
59
|
+
content?: undefined;
|
|
51
60
|
conditional?: undefined;
|
|
52
61
|
valueProperty?: undefined;
|
|
53
62
|
rows?: undefined;
|
|
@@ -73,6 +82,9 @@ declare const _default: ({
|
|
|
73
82
|
ignore?: undefined;
|
|
74
83
|
placeholder?: undefined;
|
|
75
84
|
defaultValue?: undefined;
|
|
85
|
+
tag?: undefined;
|
|
86
|
+
className?: undefined;
|
|
87
|
+
content?: undefined;
|
|
76
88
|
conditional?: undefined;
|
|
77
89
|
valueProperty?: undefined;
|
|
78
90
|
rows?: undefined;
|
|
@@ -80,6 +92,37 @@ declare const _default: ({
|
|
|
80
92
|
clearOnHide?: undefined;
|
|
81
93
|
as?: undefined;
|
|
82
94
|
customDefaultValue?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
key: string;
|
|
97
|
+
weight: number;
|
|
98
|
+
type: string;
|
|
99
|
+
tag: string;
|
|
100
|
+
className: string;
|
|
101
|
+
content: string;
|
|
102
|
+
conditional: {
|
|
103
|
+
json: {
|
|
104
|
+
'===': (string | {
|
|
105
|
+
var: string;
|
|
106
|
+
})[];
|
|
107
|
+
'=='?: undefined;
|
|
108
|
+
or?: undefined;
|
|
109
|
+
and?: undefined;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
ignore?: undefined;
|
|
113
|
+
input?: undefined;
|
|
114
|
+
label?: undefined;
|
|
115
|
+
tooltip?: undefined;
|
|
116
|
+
placeholder?: undefined;
|
|
117
|
+
defaultValue?: undefined;
|
|
118
|
+
dataSrc?: undefined;
|
|
119
|
+
data?: undefined;
|
|
120
|
+
valueProperty?: undefined;
|
|
121
|
+
rows?: undefined;
|
|
122
|
+
editor?: undefined;
|
|
123
|
+
clearOnHide?: undefined;
|
|
124
|
+
as?: undefined;
|
|
125
|
+
customDefaultValue?: undefined;
|
|
83
126
|
} | {
|
|
84
127
|
type: string;
|
|
85
128
|
input: boolean;
|
|
@@ -92,8 +135,8 @@ declare const _default: ({
|
|
|
92
135
|
'==': (string | {
|
|
93
136
|
var: string;
|
|
94
137
|
})[];
|
|
95
|
-
or?: undefined;
|
|
96
138
|
'==='?: undefined;
|
|
139
|
+
or?: undefined;
|
|
97
140
|
and?: undefined;
|
|
98
141
|
};
|
|
99
142
|
};
|
|
@@ -102,6 +145,9 @@ declare const _default: ({
|
|
|
102
145
|
defaultValue?: undefined;
|
|
103
146
|
dataSrc?: undefined;
|
|
104
147
|
data?: undefined;
|
|
148
|
+
tag?: undefined;
|
|
149
|
+
className?: undefined;
|
|
150
|
+
content?: undefined;
|
|
105
151
|
valueProperty?: undefined;
|
|
106
152
|
rows?: undefined;
|
|
107
153
|
editor?: undefined;
|
|
@@ -121,8 +167,8 @@ declare const _default: ({
|
|
|
121
167
|
var: string;
|
|
122
168
|
})[];
|
|
123
169
|
}[];
|
|
124
|
-
'=='?: undefined;
|
|
125
170
|
'==='?: undefined;
|
|
171
|
+
'=='?: undefined;
|
|
126
172
|
and?: undefined;
|
|
127
173
|
};
|
|
128
174
|
};
|
|
@@ -132,6 +178,9 @@ declare const _default: ({
|
|
|
132
178
|
defaultValue?: undefined;
|
|
133
179
|
dataSrc?: undefined;
|
|
134
180
|
data?: undefined;
|
|
181
|
+
tag?: undefined;
|
|
182
|
+
className?: undefined;
|
|
183
|
+
content?: undefined;
|
|
135
184
|
valueProperty?: undefined;
|
|
136
185
|
rows?: undefined;
|
|
137
186
|
editor?: undefined;
|
|
@@ -164,6 +213,9 @@ declare const _default: ({
|
|
|
164
213
|
};
|
|
165
214
|
ignore?: undefined;
|
|
166
215
|
defaultValue?: undefined;
|
|
216
|
+
tag?: undefined;
|
|
217
|
+
className?: undefined;
|
|
218
|
+
content?: undefined;
|
|
167
219
|
rows?: undefined;
|
|
168
220
|
editor?: undefined;
|
|
169
221
|
clearOnHide?: undefined;
|
|
@@ -191,6 +243,9 @@ declare const _default: ({
|
|
|
191
243
|
defaultValue?: undefined;
|
|
192
244
|
dataSrc?: undefined;
|
|
193
245
|
data?: undefined;
|
|
246
|
+
tag?: undefined;
|
|
247
|
+
className?: undefined;
|
|
248
|
+
content?: undefined;
|
|
194
249
|
valueProperty?: undefined;
|
|
195
250
|
rows?: undefined;
|
|
196
251
|
editor?: undefined;
|
|
@@ -221,6 +276,9 @@ declare const _default: ({
|
|
|
221
276
|
defaultValue?: undefined;
|
|
222
277
|
dataSrc?: undefined;
|
|
223
278
|
data?: undefined;
|
|
279
|
+
tag?: undefined;
|
|
280
|
+
className?: undefined;
|
|
281
|
+
content?: undefined;
|
|
224
282
|
valueProperty?: undefined;
|
|
225
283
|
clearOnHide?: undefined;
|
|
226
284
|
as?: undefined;
|
|
@@ -247,6 +305,9 @@ declare const _default: ({
|
|
|
247
305
|
defaultValue?: undefined;
|
|
248
306
|
dataSrc?: undefined;
|
|
249
307
|
data?: undefined;
|
|
308
|
+
tag?: undefined;
|
|
309
|
+
className?: undefined;
|
|
310
|
+
content?: undefined;
|
|
250
311
|
valueProperty?: undefined;
|
|
251
312
|
rows?: undefined;
|
|
252
313
|
editor?: undefined;
|
|
@@ -273,15 +334,18 @@ declare const _default: ({
|
|
|
273
334
|
var: string;
|
|
274
335
|
})[];
|
|
275
336
|
})[];
|
|
337
|
+
'==='?: undefined;
|
|
276
338
|
'=='?: undefined;
|
|
277
339
|
or?: undefined;
|
|
278
|
-
'==='?: undefined;
|
|
279
340
|
};
|
|
280
341
|
};
|
|
281
342
|
ignore?: undefined;
|
|
282
343
|
defaultValue?: undefined;
|
|
283
344
|
dataSrc?: undefined;
|
|
284
345
|
data?: undefined;
|
|
346
|
+
tag?: undefined;
|
|
347
|
+
className?: undefined;
|
|
348
|
+
content?: undefined;
|
|
285
349
|
valueProperty?: undefined;
|
|
286
350
|
editor?: undefined;
|
|
287
351
|
clearOnHide?: undefined;
|
|
@@ -309,8 +373,8 @@ declare const _default: ({
|
|
|
309
373
|
var: string;
|
|
310
374
|
})[];
|
|
311
375
|
}[];
|
|
312
|
-
'=='?: undefined;
|
|
313
376
|
'==='?: undefined;
|
|
377
|
+
'=='?: undefined;
|
|
314
378
|
and?: undefined;
|
|
315
379
|
};
|
|
316
380
|
};
|
|
@@ -318,6 +382,9 @@ declare const _default: ({
|
|
|
318
382
|
ignore?: undefined;
|
|
319
383
|
placeholder?: undefined;
|
|
320
384
|
defaultValue?: undefined;
|
|
385
|
+
tag?: undefined;
|
|
386
|
+
className?: undefined;
|
|
387
|
+
content?: undefined;
|
|
321
388
|
valueProperty?: undefined;
|
|
322
389
|
rows?: undefined;
|
|
323
390
|
editor?: undefined;
|
|
@@ -340,8 +407,8 @@ declare const _default: ({
|
|
|
340
407
|
var: string;
|
|
341
408
|
})[];
|
|
342
409
|
}[];
|
|
343
|
-
'=='?: undefined;
|
|
344
410
|
'==='?: undefined;
|
|
411
|
+
'=='?: undefined;
|
|
345
412
|
and?: undefined;
|
|
346
413
|
};
|
|
347
414
|
};
|
|
@@ -351,6 +418,9 @@ declare const _default: ({
|
|
|
351
418
|
defaultValue?: undefined;
|
|
352
419
|
dataSrc?: undefined;
|
|
353
420
|
data?: undefined;
|
|
421
|
+
tag?: undefined;
|
|
422
|
+
className?: undefined;
|
|
423
|
+
content?: undefined;
|
|
354
424
|
valueProperty?: undefined;
|
|
355
425
|
clearOnHide?: undefined;
|
|
356
426
|
})[];
|
|
@@ -52,6 +52,19 @@ exports.default = [
|
|
|
52
52
|
},
|
|
53
53
|
weight: 415,
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
key: 'quillInfo',
|
|
57
|
+
weight: 415,
|
|
58
|
+
type: 'htmlelement',
|
|
59
|
+
tag: 'div',
|
|
60
|
+
className: 'alert alert-info',
|
|
61
|
+
content: '<i class="fa fa-info-circle" aria-hidden="true" style="margin-right: 0.5rem;"></i>Quill will be deprecated in an upcoming release. It is recommended to select another Editor.',
|
|
62
|
+
conditional: {
|
|
63
|
+
json: {
|
|
64
|
+
'===': [{ var: 'data.editor' }, 'quill'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
55
68
|
{
|
|
56
69
|
type: 'checkbox',
|
|
57
70
|
input: true,
|
package/lib/cjs/package.json
CHANGED
|
@@ -78,7 +78,7 @@ export class GoogleAddressProvider extends AddressProvider {
|
|
|
78
78
|
*/
|
|
79
79
|
addRequiredProviderOptions(options: AutocompleteOptions): void;
|
|
80
80
|
filterPlace(place: any): {};
|
|
81
|
-
attachAutocomplete(elem: any, index: any, onSelectAddress: any):
|
|
81
|
+
attachAutocomplete(elem: any, index: any, onSelectAddress: any): any;
|
|
82
82
|
search(): Promise<void>;
|
|
83
83
|
makeRequest(): Promise<void>;
|
|
84
84
|
getDisplayValue(address: any): any;
|
|
@@ -175,13 +175,25 @@ class GoogleAddressProvider extends AddressProvider_1.AddressProvider {
|
|
|
175
175
|
return filteredPlace;
|
|
176
176
|
}
|
|
177
177
|
attachAutocomplete(elem, index, onSelectAddress) {
|
|
178
|
-
Formio_1.Formio.libraryReady(this.getLibraryName()).then(() => {
|
|
178
|
+
return Formio_1.Formio.libraryReady(this.getLibraryName()).then(() => {
|
|
179
179
|
const autocomplete = new google.maps.places.Autocomplete(elem, this.autocompleteOptions);
|
|
180
|
-
autocomplete.addListener('place_changed', () => {
|
|
180
|
+
const listener = autocomplete.addListener('place_changed', () => {
|
|
181
181
|
const place = this.filterPlace(autocomplete.getPlace());
|
|
182
182
|
place.formattedPlace = lodash_1.default.get(autocomplete, 'gm_accessors_.place.se.formattedPrediction', place[this.alternativeDisplayValueProperty]);
|
|
183
183
|
onSelectAddress(place, elem, index);
|
|
184
184
|
});
|
|
185
|
+
return () => {
|
|
186
|
+
var _a;
|
|
187
|
+
if ((_a = google === null || google === void 0 ? void 0 : google.maps) === null || _a === void 0 ? void 0 : _a.event) {
|
|
188
|
+
google.maps.event.clearInstanceListeners(autocomplete);
|
|
189
|
+
google.maps.event.removeListener(listener);
|
|
190
|
+
}
|
|
191
|
+
document.querySelectorAll('.pac-container').forEach((node) => {
|
|
192
|
+
if (node.parentNode) {
|
|
193
|
+
node.parentNode.removeChild(node);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
};
|
|
185
197
|
});
|
|
186
198
|
}
|
|
187
199
|
search() {
|
package/lib/cjs/utils/index.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ declare const FormioUtils: {
|
|
|
84
84
|
checkJsonConditional(component: import("@formio/core").Component, json: import("@formio/core").JSONConditional, row: any, data: any, form: import("@formio/core").Form, onError: any): boolean;
|
|
85
85
|
checkCondition(component: import("@formio/core").Component, row: any, data: any, form: import("@formio/core").Form, instance: any): boolean;
|
|
86
86
|
checkTrigger(component: import("@formio/core").Component, trigger: any, row: import("@formio/core").DataObject, data: import("@formio/core").DataObject, form: import("@formio/core").Form, instance: any): boolean;
|
|
87
|
+
escapeInterpolationDataStrings(obj: any): any;
|
|
87
88
|
setActionProperty(component: import("@formio/core").Component, action: any, result: string, row: import("@formio/core").DataObject, data: import("@formio/core").DataObject, instance: any): import("@formio/core").Component;
|
|
88
89
|
removeHTML(str: string): string;
|
|
89
90
|
unescapeHTML(str: string): string;
|
package/lib/cjs/utils/utils.d.ts
CHANGED
|
@@ -118,6 +118,13 @@ export function checkCondition(component: import('@formio/core').Component, row:
|
|
|
118
118
|
* @returns {boolean} - TRUE if the trigger should fire; FALSE otherwise.
|
|
119
119
|
*/
|
|
120
120
|
export function checkTrigger(component: import('@formio/core').Component, trigger: any, row: import('@formio/core').DataObject, data: import('@formio/core').DataObject, form: import('@formio/core').Form, instance: any): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Recursively HTML-escape strings in submission-like objects so logic templates
|
|
123
|
+
* (e.g. dynamic labels) cannot treat user-entered values as HTML.
|
|
124
|
+
* @param {*} obj - The value to escape.
|
|
125
|
+
* @returns {*} - The same structure with strings escaped.
|
|
126
|
+
*/
|
|
127
|
+
export function escapeInterpolationDataStrings(obj: any): any;
|
|
121
128
|
/**
|
|
122
129
|
* Sets a property on a component via an executed Logic action.
|
|
123
130
|
* @param {import('@formio/core').Component} component - The component to set the property on.
|
package/lib/cjs/utils/utils.js
CHANGED
|
@@ -3,8 +3,8 @@ 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.
|
|
7
|
-
exports.screenReaderSpeech = exports.announceScreenReaderMessage = exports.hasEncodedTimezone = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports.getFocusableElements = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = void 0;
|
|
6
|
+
exports.observeOverload = exports.withSwitch = exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.removeHTML = exports.setActionProperty = exports.escapeInterpolationDataStrings = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.getScriptPlugin = exports.getElementRect = exports.getPropertyValue = exports.getRandomComponentId = exports.evaluate = void 0;
|
|
7
|
+
exports.screenReaderSpeech = exports.announceScreenReaderMessage = exports.hasEncodedTimezone = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports.getFocusableElements = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = exports.getContextComponents = void 0;
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const moment_timezone_1 = __importDefault(require("moment-timezone/moment-timezone"));
|
|
10
10
|
const jstimezonedetect_1 = __importDefault(require("jstimezonedetect"));
|
|
@@ -427,6 +427,28 @@ function checkTrigger(component, trigger, row, data, form, instance) {
|
|
|
427
427
|
return false;
|
|
428
428
|
}
|
|
429
429
|
exports.checkTrigger = checkTrigger;
|
|
430
|
+
/**
|
|
431
|
+
* Recursively HTML-escape strings in submission-like objects so logic templates
|
|
432
|
+
* (e.g. dynamic labels) cannot treat user-entered values as HTML.
|
|
433
|
+
* @param {*} obj - The value to escape.
|
|
434
|
+
* @returns {*} - The same structure with strings escaped.
|
|
435
|
+
*/
|
|
436
|
+
function escapeInterpolationDataStrings(obj) {
|
|
437
|
+
if (obj === null || obj === undefined) {
|
|
438
|
+
return obj;
|
|
439
|
+
}
|
|
440
|
+
if (typeof obj === 'string') {
|
|
441
|
+
return lodash_1.default.escape(obj);
|
|
442
|
+
}
|
|
443
|
+
if (Array.isArray(obj)) {
|
|
444
|
+
return obj.map(escapeInterpolationDataStrings);
|
|
445
|
+
}
|
|
446
|
+
if (lodash_1.default.isPlainObject(obj)) {
|
|
447
|
+
return lodash_1.default.mapValues(obj, escapeInterpolationDataStrings);
|
|
448
|
+
}
|
|
449
|
+
return obj;
|
|
450
|
+
}
|
|
451
|
+
exports.escapeInterpolationDataStrings = escapeInterpolationDataStrings;
|
|
430
452
|
/**
|
|
431
453
|
* Sets a property on a component via an executed Logic action.
|
|
432
454
|
* @param {import('@formio/core').Component} component - The component to set the property on.
|
|
@@ -449,11 +471,16 @@ function setActionProperty(component, action, result, row, data, instance) {
|
|
|
449
471
|
break;
|
|
450
472
|
}
|
|
451
473
|
case 'string': {
|
|
474
|
+
const safeData = escapeInterpolationDataStrings(data);
|
|
475
|
+
const safeRow = escapeInterpolationDataStrings(row);
|
|
476
|
+
const safeResult = typeof result === 'string'
|
|
477
|
+
? lodash_1.default.escape(result)
|
|
478
|
+
: escapeInterpolationDataStrings(result);
|
|
452
479
|
const evalData = {
|
|
453
|
-
data,
|
|
454
|
-
row,
|
|
480
|
+
data: safeData,
|
|
481
|
+
row: safeRow,
|
|
455
482
|
component,
|
|
456
|
-
result,
|
|
483
|
+
result: safeResult,
|
|
457
484
|
};
|
|
458
485
|
const textValue = action.property.component ? action[action.property.component] : action.text;
|
|
459
486
|
const currentValue = lodash_1.default.get(component, property, '');
|
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.5.0';
|
|
17
|
+
static version = '5.5.1-api99.0';
|
|
18
18
|
static setLicense(license, norecurse = false) {
|
|
19
19
|
Formio.license = license;
|
|
20
20
|
if (!norecurse && Formio.FormioClass) {
|
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.5.0';
|
|
7
|
+
FormioCore.version = '5.5.1-api99.0';
|
|
8
8
|
CDN.defaultCDN = FormioCore.version.includes('rc')
|
|
9
9
|
? 'https://cdn.test-form.io'
|
|
10
10
|
: 'https://cdn.form.io';
|
package/lib/mjs/PDF.js
CHANGED
|
@@ -53,6 +53,8 @@ export default class PDF extends Webform {
|
|
|
53
53
|
});
|
|
54
54
|
// Trigger when this form is ready.
|
|
55
55
|
this.on('iframe-ready', () => this.iframeReadyResolve(), true);
|
|
56
|
+
// Re-emit pageEnd without the iframe- prefix for consumers tracking PDF scroll position.
|
|
57
|
+
this.on('iframe-pageEnd', (data) => this.emit('pageEnd', data), true);
|
|
56
58
|
}
|
|
57
59
|
render() {
|
|
58
60
|
this.submitButton = this.addComponent({
|
package/lib/mjs/Wizard.js
CHANGED
|
@@ -122,7 +122,10 @@ export default class Wizard extends Webform {
|
|
|
122
122
|
{ name: 'cancel', method: 'cancel' },
|
|
123
123
|
{ name: 'previous', method: 'prevPage' },
|
|
124
124
|
{ name: 'next', method: 'nextPage' },
|
|
125
|
-
{ name: 'submit', method: 'submit'
|
|
125
|
+
{ name: 'submit', method: 'submit', args: [false, {
|
|
126
|
+
state: 'submitted',
|
|
127
|
+
}],
|
|
128
|
+
},
|
|
126
129
|
].forEach((button) => {
|
|
127
130
|
if (this.hasButton(button.name)) {
|
|
128
131
|
buttons[button.name] = button;
|
|
@@ -345,7 +348,7 @@ export default class Wizard extends Webform {
|
|
|
345
348
|
buttonElement.setAttribute('disabled', 'disabled');
|
|
346
349
|
this.setLoading(buttonElement, true);
|
|
347
350
|
// Call the button method, then re-enable the button.
|
|
348
|
-
this[button.method]()
|
|
351
|
+
this[button.method](...(button.args || []))
|
|
349
352
|
.then(() => {
|
|
350
353
|
buttonElement.removeAttribute('disabled');
|
|
351
354
|
this.setLoading(buttonElement, false);
|
|
@@ -196,7 +196,14 @@ declare class Component extends Element {
|
|
|
196
196
|
tooltipClass: string;
|
|
197
197
|
for: any;
|
|
198
198
|
};
|
|
199
|
+
getFieldsetLegendData(): {
|
|
200
|
+
legendIds: string[];
|
|
201
|
+
legendLabels: string[];
|
|
202
|
+
};
|
|
199
203
|
getFieldsetLegendIds(): string;
|
|
204
|
+
getViewAccessibleLabel(): string;
|
|
205
|
+
getFormattedViewAccessibleLabel(): string;
|
|
206
|
+
applyViewAccessibleAriaLabel(attributes?: {}): void;
|
|
200
207
|
init(): void;
|
|
201
208
|
/**
|
|
202
209
|
* Disable this component.
|
|
@@ -526,16 +526,42 @@ export default class Component extends Element {
|
|
|
526
526
|
}
|
|
527
527
|
return label;
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
getFieldsetLegendData() {
|
|
530
530
|
const legendIds = [];
|
|
531
|
+
const legendLabels = [];
|
|
531
532
|
let currentParent = this.parent;
|
|
532
533
|
while (currentParent) {
|
|
533
534
|
if (currentParent.component?.type === 'fieldset' && currentParent.component?.legend) {
|
|
534
535
|
legendIds.push(`l-${currentParent.id}-legend`);
|
|
536
|
+
legendLabels.push(this.t(currentParent.component.legend, { _userInput: true }));
|
|
535
537
|
}
|
|
536
538
|
currentParent = currentParent.parent;
|
|
537
539
|
}
|
|
538
|
-
|
|
540
|
+
legendIds.reverse();
|
|
541
|
+
legendLabels.reverse();
|
|
542
|
+
return { legendIds, legendLabels };
|
|
543
|
+
}
|
|
544
|
+
getFieldsetLegendIds() {
|
|
545
|
+
return this.getFieldsetLegendData().legendIds.join(' ');
|
|
546
|
+
}
|
|
547
|
+
getViewAccessibleLabel() {
|
|
548
|
+
const { legendLabels } = this.getFieldsetLegendData();
|
|
549
|
+
if (legendLabels.length === 0) {
|
|
550
|
+
return '';
|
|
551
|
+
}
|
|
552
|
+
return legendLabels.join(', ');
|
|
553
|
+
}
|
|
554
|
+
getFormattedViewAccessibleLabel() {
|
|
555
|
+
const label = this.getViewAccessibleLabel();
|
|
556
|
+
return label ? this.getFormattedAttribute(label) : '';
|
|
557
|
+
}
|
|
558
|
+
applyViewAccessibleAriaLabel(attributes = {}) {
|
|
559
|
+
if ((this.options.readOnly || this.options.pdf) && !attributes['aria-label']) {
|
|
560
|
+
const viewAccessibleLabel = this.getFormattedViewAccessibleLabel();
|
|
561
|
+
if (viewAccessibleLabel) {
|
|
562
|
+
attributes['aria-label'] = viewAccessibleLabel;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
539
565
|
}
|
|
540
566
|
init() {
|
|
541
567
|
this.disabled = this.shouldDisabled;
|
|
@@ -2244,12 +2270,17 @@ export default class Component extends Element {
|
|
|
2244
2270
|
break;
|
|
2245
2271
|
}
|
|
2246
2272
|
case 'mergeComponentSchema': {
|
|
2273
|
+
const safeData = FormioUtils.escapeInterpolationDataStrings(data);
|
|
2274
|
+
const safeRow = FormioUtils.escapeInterpolationDataStrings(row);
|
|
2275
|
+
const safeResult = typeof result === 'string'
|
|
2276
|
+
? _.escape(result)
|
|
2277
|
+
: FormioUtils.escapeInterpolationDataStrings(result);
|
|
2247
2278
|
const schema = this.evaluate(action.schemaDefinition, {
|
|
2248
2279
|
value: _.clone(this.getValue()),
|
|
2249
|
-
data,
|
|
2250
|
-
row,
|
|
2280
|
+
data: safeData,
|
|
2281
|
+
row: safeRow,
|
|
2251
2282
|
component: newComponent,
|
|
2252
|
-
result,
|
|
2283
|
+
result: safeResult,
|
|
2253
2284
|
}, 'schema');
|
|
2254
2285
|
_.assign(newComponent, schema);
|
|
2255
2286
|
if (!_.isEqual(this.component, newComponent)) {
|
|
@@ -3767,6 +3798,7 @@ export default class Component extends Element {
|
|
|
3767
3798
|
if (this.disabled) {
|
|
3768
3799
|
attributes.disabled = 'disabled';
|
|
3769
3800
|
}
|
|
3801
|
+
this.applyViewAccessibleAriaLabel(attributes);
|
|
3770
3802
|
_.defaults(attributes, this.component.attributes);
|
|
3771
3803
|
return {
|
|
3772
3804
|
type: 'input',
|
|
@@ -41,6 +41,7 @@ export default class Input extends Multivalue {
|
|
|
41
41
|
if (this.component.autocomplete) {
|
|
42
42
|
attr.autocomplete = this.component.autocomplete;
|
|
43
43
|
}
|
|
44
|
+
this.applyViewAccessibleAriaLabel(attr);
|
|
44
45
|
_.defaults(attr, this.component.attributes);
|
|
45
46
|
return {
|
|
46
47
|
id: this.key,
|
|
@@ -73,6 +73,8 @@ export default class AddressComponent extends ContainerComponent {
|
|
|
73
73
|
onSelectAddress(address: any, element: any, index: any): void;
|
|
74
74
|
addRow(): void;
|
|
75
75
|
attach(element: any): Promise<void>;
|
|
76
|
+
googlePlacesCleanups: any[] | undefined;
|
|
77
|
+
autocompleterWidget: import("autocompleter").AutocompleteResult | undefined;
|
|
76
78
|
addChildComponent(component: any): void;
|
|
77
79
|
clearAddress(element: any, index: any): void;
|
|
78
80
|
getDisplayValue(value?: any): any;
|
|
@@ -411,19 +411,21 @@ export default class AddressComponent extends ContainerComponent {
|
|
|
411
411
|
const target = shadowRoot.querySelector('.formio-form-wrapper');
|
|
412
412
|
target.appendChild(container);
|
|
413
413
|
}
|
|
414
|
-
else {
|
|
415
|
-
container = document.createElement('div');
|
|
416
|
-
document.body.appendChild(container);
|
|
417
|
-
}
|
|
418
414
|
this.searchInput.forEach((element, index) => {
|
|
419
415
|
if (!this.builderMode && element && this.provider) {
|
|
420
416
|
if (this.component.provider === 'google') {
|
|
421
|
-
this.
|
|
417
|
+
this.googlePlacesCleanups = [];
|
|
418
|
+
this.provider.attachAutocomplete(element, index, this.onSelectAddress.bind(this))
|
|
419
|
+
.then((cleanup) => {
|
|
420
|
+
if (typeof cleanup === 'function') {
|
|
421
|
+
this.googlePlacesCleanups.push(cleanup);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
422
424
|
}
|
|
423
425
|
else {
|
|
424
|
-
autocompleter({
|
|
426
|
+
this.autocompleterWidget = autocompleter({
|
|
425
427
|
input: element,
|
|
426
|
-
container,
|
|
428
|
+
...(container ? { container } : {}),
|
|
427
429
|
debounceWaitMs: 300,
|
|
428
430
|
fetch: (text, update) => {
|
|
429
431
|
const query = text;
|
|
@@ -510,6 +512,16 @@ export default class AddressComponent extends ContainerComponent {
|
|
|
510
512
|
}
|
|
511
513
|
return result;
|
|
512
514
|
}
|
|
515
|
+
detach() {
|
|
516
|
+
if (this.autocompleterWidget && typeof this.autocompleterWidget.destroy === 'function') {
|
|
517
|
+
this.autocompleterWidget.destroy();
|
|
518
|
+
}
|
|
519
|
+
;
|
|
520
|
+
(this.googlePlacesCleanups || []).forEach((cleanup) => {
|
|
521
|
+
cleanup();
|
|
522
|
+
});
|
|
523
|
+
super.detach();
|
|
524
|
+
}
|
|
513
525
|
addChildComponent(component) {
|
|
514
526
|
component.customConditional = ChildConditional;
|
|
515
527
|
}
|
|
@@ -521,6 +521,18 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
521
521
|
else {
|
|
522
522
|
const flattenedComponents = this.flattenComponents(rowIndex);
|
|
523
523
|
const rowTemplate = this.rowTemplate;
|
|
524
|
+
_.each(flattenedComponents, (instance) => {
|
|
525
|
+
const needsItemLoad = instance &&
|
|
526
|
+
instance.itemsFromUrl &&
|
|
527
|
+
!instance.editGridItemsRequested &&
|
|
528
|
+
!instance.isEmpty(instance.dataValue) &&
|
|
529
|
+
_.isEmpty(instance.selectData);
|
|
530
|
+
if (needsItemLoad) {
|
|
531
|
+
instance.editGridItemsRequested = true;
|
|
532
|
+
instance.triggerUpdate(null, true);
|
|
533
|
+
instance.itemsLoaded.then(() => this.redraw());
|
|
534
|
+
}
|
|
535
|
+
});
|
|
524
536
|
return this.renderString(rowTemplate, {
|
|
525
537
|
row: dataValue[rowIndex] || {},
|
|
526
538
|
data: this.data,
|
|
@@ -964,7 +976,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
964
976
|
if (this.inlineEditMode) {
|
|
965
977
|
return;
|
|
966
978
|
}
|
|
967
|
-
const editRow = this.editRows[rowIndex];
|
|
979
|
+
const editRow = this.editRows[this.type === 'datatable' ? 0 : rowIndex];
|
|
968
980
|
if (editRow) {
|
|
969
981
|
this.processRow('checkData', null, {
|
|
970
982
|
...flags,
|
|
@@ -283,7 +283,16 @@ export default class FormComponent extends Component {
|
|
|
283
283
|
}, this.text(this.formObj.title)));
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
-
|
|
286
|
+
// element is already this component's wrapper — inject the sub-form directly
|
|
287
|
+
// instead of re-rendering the component into itself (which duplicates the id).
|
|
288
|
+
let content;
|
|
289
|
+
if (this.component.modalEdit) {
|
|
290
|
+
content = this.render();
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
content = this.subForm ? this.subForm.render() : this.renderTemplate('loading');
|
|
294
|
+
}
|
|
295
|
+
this.setContent(element, content);
|
|
287
296
|
const postAttach = () => {
|
|
288
297
|
if (!this.builderMode && this.component.modalEdit) {
|
|
289
298
|
const modalShouldBeOpened = this.componentModal ? this.componentModal.isOpened : false;
|