@formio/js 5.1.0-dev.6156.9cd5779 → 5.1.0-dev.6162.d0510e0
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.builder.css +1 -0
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.form.css +1 -0
- package/dist/formio.form.js +21 -43
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.css +1 -0
- package/dist/formio.full.js +23 -45
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +8 -8
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +9 -9
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Element.d.ts +2 -1
- package/lib/cjs/Element.js +6 -4
- package/lib/cjs/PDFBuilder.d.ts +1 -0
- package/lib/cjs/PDFBuilder.js +8 -8
- package/lib/cjs/Webform.d.ts +2 -2
- package/lib/cjs/Webform.js +4 -3
- package/lib/cjs/WebformBuilder.d.ts +1 -1
- package/lib/cjs/WebformBuilder.js +36 -11
- package/lib/cjs/components/Components.js +1 -1
- package/lib/cjs/components/_classes/component/Component.js +10 -5
- package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/cjs/components/_classes/input/Input.js +2 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +2 -2
- package/lib/cjs/components/radio/Radio.d.ts +8 -0
- package/lib/cjs/components/radio/Radio.js +15 -5
- package/lib/cjs/components/select/Select.d.ts +1 -0
- package/lib/cjs/components/select/Select.js +19 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +6 -0
- package/lib/cjs/components/textarea/TextArea.js +6 -1
- package/lib/cjs/components/textfield/TextField.js +6 -1
- package/lib/cjs/formio.form.js +2 -2
- package/lib/cjs/translations/en.d.ts +1 -232
- package/lib/cjs/translations/en.js +4 -2
- package/lib/cjs/utils/formUtils.d.ts +2 -2
- package/lib/cjs/utils/index.d.ts +2 -2
- package/lib/cjs/utils/utils.js +10 -3
- package/lib/mjs/Element.d.ts +2 -1
- package/lib/mjs/Element.js +6 -4
- package/lib/mjs/PDFBuilder.d.ts +1 -0
- package/lib/mjs/PDFBuilder.js +8 -8
- package/lib/mjs/Webform.d.ts +2 -2
- package/lib/mjs/Webform.js +4 -3
- package/lib/mjs/WebformBuilder.d.ts +1 -1
- package/lib/mjs/WebformBuilder.js +36 -12
- package/lib/mjs/components/Components.js +1 -1
- package/lib/mjs/components/_classes/component/Component.js +10 -5
- package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/mjs/components/_classes/input/Input.js +2 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +2 -2
- package/lib/mjs/components/radio/Radio.d.ts +8 -0
- package/lib/mjs/components/radio/Radio.js +15 -5
- package/lib/mjs/components/select/Select.d.ts +1 -0
- package/lib/mjs/components/select/Select.js +19 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +6 -0
- package/lib/mjs/components/textarea/TextArea.js +6 -1
- package/lib/mjs/components/textfield/TextField.js +6 -1
- package/lib/mjs/formio.form.js +1 -1
- package/lib/mjs/translations/en.d.ts +1 -232
- package/lib/mjs/translations/en.js +8 -47
- package/lib/mjs/utils/formUtils.d.ts +2 -2
- package/lib/mjs/utils/index.d.ts +2 -2
- package/lib/mjs/utils/utils.js +10 -2
- package/package.json +2 -2
- package/lib/cjs/i18n.d.ts +0 -13
- package/lib/cjs/i18n.js +0 -19
- package/lib/cjs/utils/i18n.d.ts +0 -19
- package/lib/cjs/utils/i18n.js +0 -120
- package/lib/mjs/i18n.d.ts +0 -13
- package/lib/mjs/i18n.js +0 -14
- package/lib/mjs/utils/i18n.d.ts +0 -19
- package/lib/mjs/utils/i18n.js +0 -112
@@ -659,7 +659,7 @@ export default class NestedComponent extends Field {
|
|
659
659
|
}
|
660
660
|
validationProcessor({ scope, data, row, instance, paths }, flags) {
|
661
661
|
const { dirty } = flags;
|
662
|
-
if (this.root.hasSubWizards && this.page !== this.root.page) {
|
662
|
+
if (this.root && this.root.hasSubWizards && this.page !== this.root.page) {
|
663
663
|
instance = this.componentsMap?.hasOwnProperty(paths.dataPath)
|
664
664
|
? this.componentsMap[paths.dataPath]
|
665
665
|
: this.getComponent(paths.dataPath);
|
@@ -808,7 +808,7 @@ export default class NestedComponent extends Field {
|
|
808
808
|
return false;
|
809
809
|
}
|
810
810
|
if (component.type === 'components') {
|
811
|
-
if (component.tree && component.hasValue(value)) {
|
811
|
+
if ((component.tree || component.hasInput) && component.hasValue(value)) {
|
812
812
|
return component.setValue(_.get(value, component.key), flags);
|
813
813
|
}
|
814
814
|
return component.setValue(value, flags);
|
@@ -28,6 +28,7 @@ export default class RadioComponent extends ListComponent {
|
|
28
28
|
optionsLoaded: boolean | undefined;
|
29
29
|
loadedOptions: any[] | undefined;
|
30
30
|
beforeSubmit(): Promise<any>;
|
31
|
+
convertValues(values: any): any;
|
31
32
|
render(): string;
|
32
33
|
attach(element: any): Promise<void>;
|
33
34
|
detach(element: any): void;
|
@@ -41,5 +42,12 @@ export default class RadioComponent extends ListComponent {
|
|
41
42
|
setSelectedClasses(): void;
|
42
43
|
updateValue(value: any, flags: any): boolean;
|
43
44
|
currentValue: any;
|
45
|
+
/**
|
46
|
+
* Normalize values coming into updateValue. For example, depending on the configuration, string value `"true"` will be normalized to boolean `true`.
|
47
|
+
* @param {*} value - The value to normalize
|
48
|
+
* @returns {*} - Returns the normalized value
|
49
|
+
*/
|
50
|
+
convertByDataType(value: any): any;
|
51
|
+
normalizeValue(value: any): any;
|
44
52
|
}
|
45
53
|
import ListComponent from '../_classes/list/ListComponent';
|
@@ -153,6 +153,12 @@ export default class RadioComponent extends ListComponent {
|
|
153
153
|
this.dataReady.then(() => res(true));
|
154
154
|
});
|
155
155
|
}
|
156
|
+
convertValues(values) {
|
157
|
+
if (this.options.renderMode === 'html' && this.type === 'radio') {
|
158
|
+
return values.map(x => ({ ...x, value: this.convertByDataType(x.value) }));
|
159
|
+
}
|
160
|
+
return values;
|
161
|
+
}
|
156
162
|
render() {
|
157
163
|
if (!this.optionsLoaded) {
|
158
164
|
return super.render(this.renderTemplate('loader'));
|
@@ -160,7 +166,7 @@ export default class RadioComponent extends ListComponent {
|
|
160
166
|
return super.render(this.renderTemplate('radio', {
|
161
167
|
input: this.inputInfo,
|
162
168
|
inline: this.component.inline,
|
163
|
-
values: this.component.dataSrc === 'values' ? this.component.values : this.loadedOptions,
|
169
|
+
values: this.component.dataSrc === 'values' ? this.convertValues(this.component.values) : this.loadedOptions,
|
164
170
|
value: this.dataValue,
|
165
171
|
row: this.row,
|
166
172
|
}));
|
@@ -406,7 +412,7 @@ export default class RadioComponent extends ListComponent {
|
|
406
412
|
* @param {*} value - The value to normalize
|
407
413
|
* @returns {*} - Returns the normalized value
|
408
414
|
*/
|
409
|
-
|
415
|
+
convertByDataType(value) {
|
410
416
|
const dataType = this.component.dataType || 'auto';
|
411
417
|
if (value === this.emptyValue) {
|
412
418
|
return value;
|
@@ -438,13 +444,17 @@ export default class RadioComponent extends ListComponent {
|
|
438
444
|
value = !(!value || value.toString() === 'false');
|
439
445
|
break;
|
440
446
|
}
|
441
|
-
|
447
|
+
return value;
|
448
|
+
}
|
449
|
+
normalizeValue(value) {
|
450
|
+
const valueConverted = this.convertByDataType(value);
|
451
|
+
if (this.isSelectURL && this.templateData && this.templateData[valueConverted]) {
|
442
452
|
const submission = this.root.submission;
|
443
453
|
if (!submission.metadata.selectData) {
|
444
454
|
submission.metadata.selectData = {};
|
445
455
|
}
|
446
|
-
_.set(submission.metadata.selectData, this.path, this.templateData[
|
456
|
+
_.set(submission.metadata.selectData, this.path, this.templateData[valueConverted]);
|
447
457
|
}
|
448
|
-
return super.normalizeValue(
|
458
|
+
return super.normalizeValue(valueConverted);
|
449
459
|
}
|
450
460
|
}
|
@@ -89,6 +89,7 @@ export default class SelectComponent extends ListComponent {
|
|
89
89
|
disableInfiniteScroll(): void;
|
90
90
|
set serverCount(value: any);
|
91
91
|
get serverCount(): any;
|
92
|
+
shouldResetChoicesItems(items: any): boolean;
|
92
93
|
setItems(items: any, fromSearch: any): void;
|
93
94
|
selectItems: any;
|
94
95
|
set downloadedResources(value: any);
|
@@ -359,6 +359,18 @@ export default class SelectComponent extends ListComponent {
|
|
359
359
|
this.downloadedResources.serverCount = this.downloadedResources.length;
|
360
360
|
this.serverCount = this.downloadedResources.length;
|
361
361
|
}
|
362
|
+
shouldResetChoicesItems(items) {
|
363
|
+
if (this.choices._store.choices.length !== items.length) {
|
364
|
+
return true;
|
365
|
+
}
|
366
|
+
for (let item of items) {
|
367
|
+
const choicesItem = this.choices._store.choices.find((i) => i.label === item.label);
|
368
|
+
if (!choicesItem) {
|
369
|
+
return true;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
return false;
|
373
|
+
}
|
362
374
|
/* eslint-disable max-statements */
|
363
375
|
setItems(items, fromSearch) {
|
364
376
|
this.selectItems = items;
|
@@ -444,7 +456,7 @@ export default class SelectComponent extends ListComponent {
|
|
444
456
|
this.addOption(itemValueAndLabel.value, itemValueAndLabel.label, {}, _.get(item, this.component.idPath, String(index)));
|
445
457
|
});
|
446
458
|
if (this.choices) {
|
447
|
-
this.choices.setChoices(this.selectOptions, 'value', 'label', true);
|
459
|
+
this.choices.setChoices(this.selectOptions, 'value', 'label', true, true, !fromSearch && this.shouldResetChoicesItems(this.selectOptions));
|
448
460
|
}
|
449
461
|
else if (this.loading) {
|
450
462
|
// Re-attach select input.
|
@@ -935,8 +947,9 @@ export default class SelectComponent extends ListComponent {
|
|
935
947
|
});
|
936
948
|
}
|
937
949
|
// Add value options.
|
950
|
+
const value = this.undoValueTyping(this.dataValue);
|
938
951
|
this.addValueOptions();
|
939
|
-
this.setChoicesValue(
|
952
|
+
this.setChoicesValue(value);
|
940
953
|
if (this.isSelectResource && this.refs.addResource) {
|
941
954
|
this.addEventListener(this.refs.addResource, 'click', (event) => {
|
942
955
|
event.preventDefault();
|
@@ -1248,7 +1261,7 @@ export default class SelectComponent extends ListComponent {
|
|
1248
1261
|
}
|
1249
1262
|
_.set(submission.metadata.selectData, this.path, templateData);
|
1250
1263
|
}
|
1251
|
-
if (flags.resetValue && this.root?.submission && !this.options.readOnly) {
|
1264
|
+
if (flags.resetValue && !flags.fromSubmission && this.root?.submission && !this.options.readOnly) {
|
1252
1265
|
const submission = this.root.submission;
|
1253
1266
|
if (!submission.metadata) {
|
1254
1267
|
submission.metadata = {};
|
@@ -1312,6 +1325,9 @@ export default class SelectComponent extends ListComponent {
|
|
1312
1325
|
this.lazyLoadInit = true;
|
1313
1326
|
const searchProperty = this.component.searchField || this.component.valueProperty;
|
1314
1327
|
this.triggerUpdate(_.get(value.data || value, searchProperty, value), true);
|
1328
|
+
this.itemsLoaded.then(() => {
|
1329
|
+
this.setChoicesValue(value, hasPreviousValue, flags);
|
1330
|
+
});
|
1315
1331
|
return changed;
|
1316
1332
|
}
|
1317
1333
|
// Add the value options.
|
@@ -8,6 +8,12 @@ export default class SelectBoxesComponent extends RadioComponent {
|
|
8
8
|
* @returns {boolean} - If the value is empty.
|
9
9
|
*/
|
10
10
|
isEmpty(value?: any): boolean;
|
11
|
+
/**
|
12
|
+
* Normalize values coming into updateValue.
|
13
|
+
* @param {any} value - The value to normalize.
|
14
|
+
* @returns {*} - The normalized value
|
15
|
+
*/
|
16
|
+
normalizeValue(value: any): any;
|
11
17
|
setInputsDisabled(value: any, onlyUnchecked: any): void;
|
12
18
|
checkComponentValidity(data: any, dirty: any, rowData: any, options: any, errors?: any[]): boolean;
|
13
19
|
}
|
@@ -188,7 +188,12 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
188
188
|
const editorHeight = (numRows * 31) + 14;
|
189
189
|
editor.ui.view.editable.editableElement.style.height = `${(editorHeight)}px`;
|
190
190
|
}
|
191
|
-
|
191
|
+
if (isReadOnly) {
|
192
|
+
editor.enableReadOnlyMode(this.id);
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
editor.disableReadOnlyMode(this.id);
|
196
|
+
}
|
192
197
|
editor.data.set(value);
|
193
198
|
}
|
194
199
|
editorReady(editor);
|
@@ -114,7 +114,12 @@ export default class TextFieldComponent extends Input {
|
|
114
114
|
// If no value is provided, then set the defaultValue.
|
115
115
|
if (!value.value) {
|
116
116
|
const defaultValue = flags.noDefault ? this.emptyValue : this.defaultValue;
|
117
|
-
|
117
|
+
if (Array.isArray(defaultValue)) {
|
118
|
+
value.value = _.isObject(defaultValue[0]) ? defaultValue[0].value : defaultValue;
|
119
|
+
}
|
120
|
+
else {
|
121
|
+
value.value = _.isObject(defaultValue) ? defaultValue.value : defaultValue;
|
122
|
+
}
|
118
123
|
}
|
119
124
|
return value;
|
120
125
|
}
|
package/lib/mjs/formio.form.js
CHANGED
@@ -11,7 +11,7 @@ import Utils from './utils';
|
|
11
11
|
import Licenses from './licenses';
|
12
12
|
import EventEmitter from './EventEmitter';
|
13
13
|
import Webform from './Webform';
|
14
|
-
import { I18n } from '
|
14
|
+
import { I18n } from '@formio/core';
|
15
15
|
import { Evaluator, registerEvaluator } from './utils';
|
16
16
|
Formio.loadModules = (path = `${Formio.getApiUrl()}/externalModules.js`, name = 'externalModules') => {
|
17
17
|
Formio.requireLibrary(name, name, path, true)
|
@@ -1,233 +1,2 @@
|
|
1
|
-
declare const _default:
|
2
|
-
unsavedRowsError: string;
|
3
|
-
invalidRowsError: string;
|
4
|
-
invalidRowError: string;
|
5
|
-
invalidOption: string;
|
6
|
-
invalidDay: string;
|
7
|
-
complete: string;
|
8
|
-
error: string;
|
9
|
-
errorListHotkey: string;
|
10
|
-
errorsListNavigationMessage: string;
|
11
|
-
submitError: string;
|
12
|
-
required: string;
|
13
|
-
unique: string;
|
14
|
-
array: string;
|
15
|
-
array_nonempty: string;
|
16
|
-
nonarray: string;
|
17
|
-
select: string;
|
18
|
-
pattern: string;
|
19
|
-
minLength: string;
|
20
|
-
maxLength: string;
|
21
|
-
minWords: string;
|
22
|
-
maxWords: string;
|
23
|
-
min: string;
|
24
|
-
max: string;
|
25
|
-
maxDate: string;
|
26
|
-
minDate: string;
|
27
|
-
maxYear: string;
|
28
|
-
minYear: string;
|
29
|
-
minSelectedCount: string;
|
30
|
-
maxSelectedCount: string;
|
31
|
-
invalid_email: string;
|
32
|
-
invalid_url: string;
|
33
|
-
invalid_regex: string;
|
34
|
-
invalid_date: string;
|
35
|
-
invalid_day: string;
|
36
|
-
invalidValueProperty: string;
|
37
|
-
mask: string;
|
38
|
-
valueIsNotAvailable: string;
|
39
|
-
stripe: string;
|
40
|
-
month: string;
|
41
|
-
day: string;
|
42
|
-
year: string;
|
43
|
-
january: string;
|
44
|
-
february: string;
|
45
|
-
march: string;
|
46
|
-
april: string;
|
47
|
-
may: string;
|
48
|
-
june: string;
|
49
|
-
july: string;
|
50
|
-
august: string;
|
51
|
-
september: string;
|
52
|
-
october: string;
|
53
|
-
november: string;
|
54
|
-
december: string;
|
55
|
-
next: string;
|
56
|
-
previous: string;
|
57
|
-
cancel: string;
|
58
|
-
submit: string;
|
59
|
-
confirmCancel: string;
|
60
|
-
saveDraftInstanceError: string;
|
61
|
-
saveDraftAuthError: string;
|
62
|
-
restoreDraftInstanceError: string;
|
63
|
-
saveDraftError: string;
|
64
|
-
restoreDraftError: string;
|
65
|
-
time: string;
|
66
|
-
cancelButtonAriaLabel: string;
|
67
|
-
previousButtonAriaLabel: string;
|
68
|
-
nextButtonAriaLabel: string;
|
69
|
-
submitButtonAriaLabel: string;
|
70
|
-
reCaptchaTokenValidationError: string;
|
71
|
-
reCaptchaTokenNotSpecifiedError: string;
|
72
|
-
apiKey: string;
|
73
|
-
typeRemaining: string;
|
74
|
-
typeCount: string;
|
75
|
-
requiredDayField: string;
|
76
|
-
requiredDayEmpty: string;
|
77
|
-
requiredMonthField: string;
|
78
|
-
requiredYearField: string;
|
79
|
-
formNotReady: string;
|
80
|
-
noFormElement: string;
|
81
|
-
notUniqueKey: string;
|
82
|
-
newFormSchema: string;
|
83
|
-
missingUrl: string;
|
84
|
-
urlNotAttachedToBtn: string;
|
85
|
-
loadingProjectSettingsError: string;
|
86
|
-
sessionStorageSupportError: string;
|
87
|
-
builderUniqueError: string;
|
88
|
-
pageNotFound: string;
|
89
|
-
noDragInfoError: string;
|
90
|
-
addonSupportTypeError: string;
|
91
|
-
setPathError: string;
|
92
|
-
calculatedPathDeprecation: string;
|
93
|
-
unknownTemplate: string;
|
94
|
-
unknownComponent: string;
|
95
|
-
renderTemplateFunctionDeprecation: string;
|
96
|
-
whenReadyDeprecation: string;
|
97
|
-
loadResourcesError: string;
|
98
|
-
noSelectDataConfiguration: string;
|
99
|
-
indexedDBSupportError: string;
|
100
|
-
caretPositionSavingError: string;
|
101
|
-
iteratableRowsError: string;
|
102
|
-
checkRowDeprecation: string;
|
103
|
-
noOAuthBtn: string;
|
104
|
-
noOAuthConfiguration: string;
|
105
|
-
oAuthErrorsTitle: string;
|
106
|
-
noOAuthFormUrl: string;
|
107
|
-
oAuthStateError: string;
|
108
|
-
componentInvalidRowValidation: string;
|
109
|
-
videoPlayerNotFound: string;
|
110
|
-
synchronizationFailed: string;
|
111
|
-
fileWithDuplicatedNameInProgress: string;
|
112
|
-
fileWithDuplicatedNameLoaded: string;
|
113
|
-
nestedForm: string;
|
114
|
-
noDataProvided: string;
|
115
|
-
subformSubmissionLoadingError: string;
|
116
|
-
noDelimiterSet: string;
|
117
|
-
noSiteKey: string;
|
118
|
-
failedToNormalize: string;
|
119
|
-
failedToCompareItems: string;
|
120
|
-
editorFocusError: string;
|
121
|
-
quillImageUploadFailed: string;
|
122
|
-
noFilesSelected: string;
|
123
|
-
needConfigurationForQuill: string;
|
124
|
-
waitPdfConverting: string;
|
125
|
-
uploading: string;
|
126
|
-
pasteBelow: string;
|
127
|
-
copy: string;
|
128
|
-
move: string;
|
129
|
-
edit: string;
|
130
|
-
editJson: string;
|
131
|
-
remove: string;
|
132
|
-
clickToSetValue: string;
|
133
|
-
words: string;
|
134
|
-
characters: string;
|
135
|
-
addAnother: string;
|
136
|
-
yes: string;
|
137
|
-
no: string;
|
138
|
-
wantToClearData: string;
|
139
|
-
yesDelete: string;
|
140
|
-
waitFileProcessing: string;
|
141
|
-
wrongFileType: string;
|
142
|
-
fileTooSmall: string;
|
143
|
-
fileTooBig: string;
|
144
|
-
noFileService: string;
|
145
|
-
fileProcessingFailed: string;
|
146
|
-
readyForUpload: string;
|
147
|
-
readyForRemovingFromStorage: string;
|
148
|
-
preparingFileToRemove: string;
|
149
|
-
succefullyRemoved: string;
|
150
|
-
succefullyUploaded: string;
|
151
|
-
maxSelectItems: string;
|
152
|
-
minSelectItems: string;
|
153
|
-
clickToSign: string;
|
154
|
-
surveyQuestion: string;
|
155
|
-
surveyQuestionValue: string;
|
156
|
-
success: string;
|
157
|
-
noResultsFound: string;
|
158
|
-
noChoices: string;
|
159
|
-
typeToSearch: string;
|
160
|
-
loading: string;
|
161
|
-
help: string;
|
162
|
-
component: string;
|
163
|
-
save: string;
|
164
|
-
preview: string;
|
165
|
-
dragAndDropComponent: string;
|
166
|
-
searchFields: string;
|
167
|
-
noMatchesFound: string;
|
168
|
-
fileName: string;
|
169
|
-
size: string;
|
170
|
-
type: string;
|
171
|
-
gallery: string;
|
172
|
-
camera: string;
|
173
|
-
dropFilesToAttach: string;
|
174
|
-
useCamera: string;
|
175
|
-
browse: string;
|
176
|
-
takePicture: string;
|
177
|
-
switchToFileUpload: string;
|
178
|
-
completeStatus: string;
|
179
|
-
noStorageSet: string;
|
180
|
-
noFileApiSupport: string;
|
181
|
-
noFormDataSupport: string;
|
182
|
-
noProgressSupport: string;
|
183
|
-
close: string;
|
184
|
-
addResource: string;
|
185
|
-
autocomplete: string;
|
186
|
-
showPreview: string;
|
187
|
-
hidePreview: string;
|
188
|
-
createPage: string;
|
189
|
-
page: string;
|
190
|
-
closeBtnDescription: string;
|
191
|
-
cancelBtnDescription: string;
|
192
|
-
saveBtnDescription: string;
|
193
|
-
addOrRemove: string;
|
194
|
-
anyFileTypesAllowed: string;
|
195
|
-
allowedFileTypes: string;
|
196
|
-
syncing: string;
|
197
|
-
syncNow: string;
|
198
|
-
pressToOpen: string;
|
199
|
-
browseToAttachFileFor: string;
|
200
|
-
or: string;
|
201
|
-
numericOnly: string;
|
202
|
-
uploadPdfFile: string;
|
203
|
-
dropToStart: string;
|
204
|
-
expand: string;
|
205
|
-
collapse: string;
|
206
|
-
add: string;
|
207
|
-
delete: string;
|
208
|
-
revert: string;
|
209
|
-
removeBtnPressToRemove: string;
|
210
|
-
file: string;
|
211
|
-
captureVideo: string;
|
212
|
-
captureAudio: string;
|
213
|
-
captureImage: string;
|
214
|
-
browseFiles: string;
|
215
|
-
noComponentsSetInGrid: string;
|
216
|
-
sortAscending: string;
|
217
|
-
sortDescending: string;
|
218
|
-
filter: string;
|
219
|
-
clear: string;
|
220
|
-
showItemsWithValue: string;
|
221
|
-
gridItemsPerPage: string;
|
222
|
-
gridAllItems: string;
|
223
|
-
recordsSelectedOnPage: string;
|
224
|
-
recordsSelectedInTable: string;
|
225
|
-
gridSelectAll: string;
|
226
|
-
itemsInTable: string;
|
227
|
-
clearSelection: string;
|
228
|
-
editGridRow: string;
|
229
|
-
deleteGridRow: string;
|
230
|
-
selected: string;
|
231
|
-
actions: string;
|
232
|
-
};
|
1
|
+
declare const _default: any;
|
233
2
|
export default _default;
|
@@ -1,59 +1,26 @@
|
|
1
1
|
import bootstrap from '@formio/bootstrap';
|
2
|
+
import { coreEnTranslation } from '@formio/core';
|
3
|
+
import _ from 'lodash';
|
2
4
|
export default {
|
3
5
|
...(bootstrap?.translations?.en || {}),
|
6
|
+
// these keys contain a '-' to strip whitespace in core
|
7
|
+
// which is not handled correctly in the renderer, so we redefine them
|
8
|
+
..._.omit(coreEnTranslation, ['maxDate', 'minDate']),
|
4
9
|
unsavedRowsError: 'Please save all rows before proceeding.',
|
5
10
|
invalidRowsError: 'Please correct invalid rows before proceeding.',
|
6
11
|
invalidRowError: 'Invalid row. Please correct it or delete.',
|
7
12
|
invalidOption: '{{field}} is an invalid value.',
|
8
13
|
invalidDay: '{{field}} is not a valid day.',
|
14
|
+
alertMessageWithLabel: '{{label}}: {{message}}',
|
15
|
+
alertMessage: '{{message}}',
|
9
16
|
complete: 'Submission Complete',
|
10
17
|
error: 'Please fix the following errors before submitting.',
|
11
18
|
errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.',
|
12
19
|
errorsListNavigationMessage: 'Click to navigate to the field with following error.',
|
13
20
|
submitError: 'Please check the form and correct all errors before submitting.',
|
14
|
-
required: '{{field}} is required',
|
15
|
-
unique: '{{field}} must be unique',
|
16
|
-
array: '{{field}} must be an array',
|
17
|
-
array_nonempty: '{{field}} must be a non-empty array', // eslint-disable-line camelcase
|
18
|
-
nonarray: '{{field}} must not be an array',
|
19
|
-
select: '{{field}} contains an invalid selection',
|
20
|
-
pattern: '{{field}} does not match the pattern {{pattern}}',
|
21
|
-
minLength: '{{field}} must have at least {{length}} characters.',
|
22
|
-
maxLength: '{{field}} must have no more than {{length}} characters.',
|
23
|
-
minWords: '{{field}} must have at least {{length}} words.',
|
24
|
-
maxWords: '{{field}} must have no more than {{length}} words.',
|
25
|
-
min: '{{field}} cannot be less than {{min}}.',
|
26
|
-
max: '{{field}} cannot be greater than {{max}}.',
|
27
21
|
maxDate: '{{field}} should not contain date after {{maxDate}}',
|
28
22
|
minDate: '{{field}} should not contain date before {{minDate}}',
|
29
|
-
maxYear: '{{field}} should not contain year greater than {{maxYear}}',
|
30
|
-
minYear: '{{field}} should not contain year less than {{minYear}}',
|
31
|
-
minSelectedCount: 'You must select at least {{minCount}} items',
|
32
|
-
maxSelectedCount: 'You may only select up to {{maxCount}} items',
|
33
|
-
invalid_email: '{{field}} must be a valid email.', // eslint-disable-line camelcase
|
34
|
-
invalid_url: '{{field}} must be a valid url.', // eslint-disable-line camelcase
|
35
|
-
invalid_regex: '{{field}} does not match the pattern {{regex}}.', // eslint-disable-line camelcase
|
36
|
-
invalid_date: '{{field}} is not a valid date.', // eslint-disable-line camelcase
|
37
|
-
invalid_day: '{{field}} is not a valid day.', // eslint-disable-line camelcase
|
38
|
-
invalidValueProperty: 'Invalid Value Property',
|
39
|
-
mask: '{{field}} does not match the mask.',
|
40
|
-
valueIsNotAvailable: '{{ field }} is an invalid value.',
|
41
23
|
stripe: '{{stripe}}',
|
42
|
-
month: 'Month',
|
43
|
-
day: 'Day',
|
44
|
-
year: 'Year',
|
45
|
-
january: 'January',
|
46
|
-
february: 'February',
|
47
|
-
march: 'March',
|
48
|
-
april: 'April',
|
49
|
-
may: 'May',
|
50
|
-
june: 'June',
|
51
|
-
july: 'July',
|
52
|
-
august: 'August',
|
53
|
-
september: 'September',
|
54
|
-
october: 'October',
|
55
|
-
november: 'November',
|
56
|
-
december: 'December',
|
57
24
|
next: 'Next',
|
58
25
|
previous: 'Previous',
|
59
26
|
cancel: 'Cancel',
|
@@ -72,12 +39,10 @@ export default {
|
|
72
39
|
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
73
40
|
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
74
41
|
apiKey: 'API Key is not unique: {{key}}',
|
42
|
+
apiKeyNotValid: 'API Key is not valid: {{key}}',
|
75
43
|
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
76
44
|
typeCount: '{{ count }} {{ type }}',
|
77
|
-
requiredDayField: '{{ field }} is required',
|
78
45
|
requiredDayEmpty: '{{ field }} is required',
|
79
|
-
requiredMonthField: '{{ field }} is required',
|
80
|
-
requiredYearField: '{{ field }} is required',
|
81
46
|
formNotReady: 'Form not ready. Use form.ready promise',
|
82
47
|
noFormElement: 'No DOM element for form.',
|
83
48
|
notUniqueKey: 'API Key is not unique',
|
@@ -137,8 +102,6 @@ export default {
|
|
137
102
|
words: 'words',
|
138
103
|
characters: 'characters',
|
139
104
|
addAnother: 'Add Another',
|
140
|
-
yes: 'Yes',
|
141
|
-
no: 'No',
|
142
105
|
wantToClearData: 'Do you want to clear data?',
|
143
106
|
yesDelete: 'Yes, delete it',
|
144
107
|
waitFileProcessing: 'Processing file. Please wait...',
|
@@ -155,8 +118,6 @@ export default {
|
|
155
118
|
maxSelectItems: 'You may only select up to {{maxCount}} items',
|
156
119
|
minSelectItems: 'You must select at least {{minCount}} items',
|
157
120
|
clickToSign: 'Click to Sign',
|
158
|
-
surveyQuestion: 'Question',
|
159
|
-
surveyQuestionValue: 'Value',
|
160
121
|
success: 'Success',
|
161
122
|
noResultsFound: 'No results found',
|
162
123
|
noChoices: 'No choices to choose from',
|
@@ -26,8 +26,8 @@ export const getBestMatch: typeof Utils.getBestMatch;
|
|
26
26
|
export const getComponentFromPath: typeof Utils.getComponentFromPath;
|
27
27
|
export const getComponentValue: typeof Utils.getComponentValue;
|
28
28
|
export const findComponents: typeof Utils.findComponents;
|
29
|
-
export const eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined) => Promise<void>;
|
30
|
-
export const eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined) => void;
|
29
|
+
export const eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => Promise<void>;
|
30
|
+
export const eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => void;
|
31
31
|
export const getComponentKey: typeof Utils.getComponentKey;
|
32
32
|
export const getContextualRowPath: typeof Utils.getContextualRowPath;
|
33
33
|
export const getContextualRowData: typeof Utils.getContextualRowData;
|
package/lib/mjs/utils/index.d.ts
CHANGED
@@ -37,8 +37,8 @@ declare const FormioUtils: {
|
|
37
37
|
getComponentFromPath: typeof import("@formio/core/lib/utils/formUtil").getComponentFromPath;
|
38
38
|
getComponentValue: typeof import("@formio/core/lib/utils/formUtil").getComponentValue;
|
39
39
|
findComponents: typeof import("@formio/core/lib/utils/formUtil").findComponents;
|
40
|
-
eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined) => Promise<void>;
|
41
|
-
eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined) => void;
|
40
|
+
eachComponentDataAsync: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => Promise<void>;
|
41
|
+
eachComponentData: (components: import("@formio/core").Component[], data: import("@formio/core").DataObject, fn: import("@formio/core").EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: import("@formio/core").Component | undefined, parentPaths?: import("@formio/core").ComponentPaths | undefined, noScopeReset?: boolean | undefined) => void;
|
42
42
|
getComponentKey: typeof import("@formio/core/lib/utils/formUtil").getComponentKey;
|
43
43
|
getContextualRowPath: typeof import("@formio/core/lib/utils/formUtil").getContextualRowPath;
|
44
44
|
getContextualRowData: typeof import("@formio/core/lib/utils/formUtil").getContextualRowData;
|
package/lib/mjs/utils/utils.js
CHANGED
@@ -199,7 +199,15 @@ export function checkSimpleConditional(component, condition, row, data, instance
|
|
199
199
|
return true;
|
200
200
|
}
|
201
201
|
const splittedConditionPath = conditionComponentPath.split('.');
|
202
|
-
const
|
202
|
+
const checkParentTypeInTree = (instance, componentType) => {
|
203
|
+
if (!instance?.parent) {
|
204
|
+
return false;
|
205
|
+
}
|
206
|
+
return instance?.parent.type === componentType || checkParentTypeInTree(instance.parent, componentType);
|
207
|
+
};
|
208
|
+
const conditionalPaths = checkParentTypeInTree(instance, 'datagrid') || checkParentTypeInTree(instance, 'editgrid')
|
209
|
+
? []
|
210
|
+
: getConditionalPathsRecursive(splittedConditionPath, data);
|
203
211
|
if (conditionalPaths.length > 0) {
|
204
212
|
return conditionalPaths.map((path) => {
|
205
213
|
const value = getComponentActualValue(path, data, row);
|
@@ -313,7 +321,7 @@ function getRow(component, row, instance, conditional) {
|
|
313
321
|
}
|
314
322
|
const dataParent = getDataParentComponent(instance);
|
315
323
|
if (dataParent) {
|
316
|
-
const parentPath = dataParent.paths?.
|
324
|
+
const parentPath = dataParent.paths?.localPath;
|
317
325
|
const isTriggerCondtionComponentPath = condition.when || !condition.conditions
|
318
326
|
? condition.when?.startsWith(dataParent.paths?.localPath)
|
319
327
|
: _.some(condition.conditions, cond => cond.component.startsWith(dataParent.paths?.localPath));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@formio/js",
|
3
|
-
"version": "5.1.0-dev.
|
3
|
+
"version": "5.1.0-dev.6162.d0510e0",
|
4
4
|
"description": "JavaScript powered Forms with JSON Form Builder",
|
5
5
|
"main": "lib/cjs/index.js",
|
6
6
|
"exports": {
|
@@ -81,7 +81,7 @@
|
|
81
81
|
"homepage": "https://github.com/formio/formio.js#readme",
|
82
82
|
"dependencies": {
|
83
83
|
"@formio/bootstrap": "v3.0.0-dev.121.085d187",
|
84
|
-
"@formio/core": "2.4.0-dev.
|
84
|
+
"@formio/core": "2.4.0-dev.267.2866472",
|
85
85
|
"@formio/text-mask-addons": "3.8.0-formio.4",
|
86
86
|
"@formio/vanilla-text-mask": "^5.1.1-formio.1",
|
87
87
|
"abortcontroller-polyfill": "^1.7.5",
|
package/lib/cjs/i18n.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
declare namespace _default {
|
2
|
-
let lng: string;
|
3
|
-
let nsSeparator: string;
|
4
|
-
let keySeparator: string;
|
5
|
-
let pluralSeparator: string;
|
6
|
-
let contextSeparator: string;
|
7
|
-
namespace resources {
|
8
|
-
namespace en {
|
9
|
-
let translation: any;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
}
|
13
|
-
export default _default;
|
package/lib/cjs/i18n.js
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const en_1 = __importDefault(require("./translations/en"));
|
7
|
-
const utils_1 = require("./utils");
|
8
|
-
exports.default = {
|
9
|
-
lng: 'en',
|
10
|
-
nsSeparator: '::',
|
11
|
-
keySeparator: '.|.',
|
12
|
-
pluralSeparator: '._.',
|
13
|
-
contextSeparator: '._.',
|
14
|
-
resources: {
|
15
|
-
en: {
|
16
|
-
translation: (0, utils_1.fastCloneDeep)(en_1.default)
|
17
|
-
}
|
18
|
-
}
|
19
|
-
};
|