@formio/js 5.4.1 → 5.4.2
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 +11 -5
- package/dist/formio.builder.css +1 -0
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +1 -0
- package/dist/formio.form.js +131 -109
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +2 -2
- package/dist/formio.full.css +1 -0
- package/dist/formio.full.js +155 -133
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +2 -2
- package/dist/formio.js +26 -26
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -2
- package/dist/formio.utils.js +19 -19
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -2
- package/lib/cjs/Embed.js +8 -16
- package/lib/cjs/Form.js +4 -4
- package/lib/cjs/Formio.js +2 -9
- package/lib/cjs/InlineEmbed.js +1 -4
- package/lib/cjs/PDF.js +28 -8
- package/lib/cjs/PDFBuilder.js +6 -10
- package/lib/cjs/Webform.d.ts +1 -0
- package/lib/cjs/Webform.js +19 -34
- package/lib/cjs/WebformBuilder.js +27 -68
- package/lib/cjs/Wizard.d.ts +1 -0
- package/lib/cjs/Wizard.js +44 -31
- package/lib/cjs/WizardBuilder.js +5 -15
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +2 -6
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -9
- package/lib/cjs/addons/index.js +1 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +5 -5
- package/lib/cjs/components/_classes/component/Component.js +60 -132
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +2 -4
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +4 -16
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +1 -4
- package/lib/cjs/components/_classes/field/Field.js +1 -4
- package/lib/cjs/components/_classes/input/Input.js +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +6 -28
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +8 -26
- package/lib/cjs/components/_classes/nested/NestedComponent.js +1 -4
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +5 -9
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +1 -3
- package/lib/cjs/components/address/Address.js +10 -30
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +8 -32
- package/lib/cjs/components/alert/Alert.js +3 -6
- package/lib/cjs/components/button/Button.js +10 -17
- package/lib/cjs/components/button/editForm/Button.edit.display.js +8 -32
- package/lib/cjs/components/checkbox/Checkbox.js +4 -10
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +2 -8
- package/lib/cjs/components/columns/Columns.js +5 -17
- package/lib/cjs/components/container/Container.js +1 -3
- package/lib/cjs/components/currency/Currency.js +2 -7
- package/lib/cjs/components/datagrid/DataGrid.js +23 -63
- package/lib/cjs/components/datamap/DataMap.js +4 -16
- package/lib/cjs/components/datetime/DateTime.js +2 -6
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +1 -4
- package/lib/cjs/components/day/Day.js +12 -70
- package/lib/cjs/components/day/editForm/Day.edit.day.js +1 -3
- package/lib/cjs/components/day/editForm/Day.edit.month.js +1 -3
- package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -0
- package/lib/cjs/components/editgrid/EditGrid.js +18 -44
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -4
- package/lib/cjs/components/file/File.js +40 -70
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -5
- package/lib/cjs/components/file/editForm/File.edit.file.js +8 -30
- package/lib/cjs/components/form/Form.js +5 -7
- package/lib/cjs/components/html/HTML.js +1 -5
- package/lib/cjs/components/number/Number.js +2 -4
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +3 -12
- package/lib/cjs/components/password/Password.js +1 -4
- package/lib/cjs/components/radio/Radio.js +7 -17
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +4 -14
- package/lib/cjs/components/recaptcha/ReCaptcha.js +3 -6
- package/lib/cjs/components/select/Select.js +48 -92
- package/lib/cjs/components/select/editForm/Select.edit.data.js +37 -182
- package/lib/cjs/components/select/editForm/Select.edit.validation.js +1 -9
- package/lib/cjs/components/selectboxes/SelectBoxes.js +3 -6
- package/lib/cjs/components/signature/Signature.d.ts +1 -1
- package/lib/cjs/components/signature/Signature.js +5 -10
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +2 -6
- package/lib/cjs/components/survey/Survey.js +6 -17
- package/lib/cjs/components/survey/editForm/Survey.edit.data.js +4 -12
- package/lib/cjs/components/table/editForm/Table.edit.display.js +3 -3
- package/lib/cjs/components/tabs/Tabs.js +4 -19
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +1 -3
- package/lib/cjs/components/tags/Tags.js +4 -14
- package/lib/cjs/components/textarea/TextArea.js +8 -15
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +14 -56
- package/lib/cjs/components/textfield/TextField.js +4 -4
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +2 -8
- package/lib/cjs/components/time/Time.js +1 -4
- package/lib/cjs/components/time/editForm/Time.edit.display.js +1 -4
- package/lib/cjs/formio.form.js +5 -5
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/providers/address/AddressProvider.js +1 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.js +1 -3
- package/lib/cjs/providers/processor/fileProcessor.js +1 -3
- package/lib/cjs/providers/storage/azure.js +5 -6
- package/lib/cjs/providers/storage/indexeddb.js +5 -15
- package/lib/cjs/providers/storage/s3.js +3 -14
- package/lib/cjs/providers/storage/xhr.js +19 -28
- package/lib/cjs/templates/Templates.js +1 -0
- package/lib/cjs/translations/en.d.ts +237 -82
- package/lib/cjs/translations/en.js +9 -82
- package/lib/cjs/utils/ChoicesWrapper.js +1 -1
- package/lib/cjs/utils/builder.js +5 -26
- package/lib/cjs/utils/i18n.d.ts +5 -2
- package/lib/cjs/utils/i18n.js +33 -12
- package/lib/cjs/utils/utils.js +37 -47
- package/lib/cjs/widgets/CalendarWidget.js +2 -6
- package/lib/mjs/Embed.js +8 -16
- package/lib/mjs/Form.js +4 -4
- package/lib/mjs/Formio.js +2 -9
- package/lib/mjs/InlineEmbed.js +1 -4
- package/lib/mjs/PDF.js +27 -8
- package/lib/mjs/PDFBuilder.js +6 -10
- package/lib/mjs/Webform.d.ts +1 -0
- package/lib/mjs/Webform.js +19 -31
- package/lib/mjs/WebformBuilder.js +27 -68
- package/lib/mjs/Wizard.d.ts +1 -0
- package/lib/mjs/Wizard.js +39 -27
- package/lib/mjs/WizardBuilder.js +5 -15
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +2 -6
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +3 -9
- package/lib/mjs/addons/index.js +1 -3
- package/lib/mjs/components/_classes/component/Component.d.ts +5 -5
- package/lib/mjs/components/_classes/component/Component.js +59 -132
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +2 -4
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +4 -16
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +1 -4
- package/lib/mjs/components/_classes/field/Field.js +1 -4
- package/lib/mjs/components/_classes/input/Input.js +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +6 -28
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +8 -26
- package/lib/mjs/components/_classes/nested/NestedComponent.js +1 -4
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +5 -9
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +1 -3
- package/lib/mjs/components/address/Address.js +10 -30
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +8 -32
- package/lib/mjs/components/alert/Alert.js +3 -6
- package/lib/mjs/components/button/Button.js +9 -16
- package/lib/mjs/components/button/editForm/Button.edit.display.js +8 -32
- package/lib/mjs/components/checkbox/Checkbox.js +4 -10
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +2 -8
- package/lib/mjs/components/columns/Columns.js +5 -17
- package/lib/mjs/components/container/Container.js +1 -3
- package/lib/mjs/components/currency/Currency.js +2 -7
- package/lib/mjs/components/datagrid/DataGrid.js +23 -63
- package/lib/mjs/components/datamap/DataMap.js +12 -18
- package/lib/mjs/components/datetime/DateTime.js +2 -6
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +1 -4
- package/lib/mjs/components/day/Day.js +12 -70
- package/lib/mjs/components/day/editForm/Day.edit.day.js +1 -3
- package/lib/mjs/components/day/editForm/Day.edit.month.js +1 -3
- package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -0
- package/lib/mjs/components/editgrid/EditGrid.js +18 -44
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +1 -4
- package/lib/mjs/components/file/File.js +40 -70
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -5
- package/lib/mjs/components/file/editForm/File.edit.file.js +8 -30
- package/lib/mjs/components/form/Form.js +5 -7
- package/lib/mjs/components/html/HTML.js +1 -5
- package/lib/mjs/components/number/Number.js +2 -4
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +3 -12
- package/lib/mjs/components/password/Password.js +1 -4
- package/lib/mjs/components/radio/Radio.js +7 -17
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +4 -14
- package/lib/mjs/components/recaptcha/ReCaptcha.js +3 -6
- package/lib/mjs/components/select/Select.js +51 -95
- package/lib/mjs/components/select/editForm/Select.edit.data.js +37 -182
- package/lib/mjs/components/select/editForm/Select.edit.validation.js +1 -9
- package/lib/mjs/components/selectboxes/SelectBoxes.js +3 -6
- package/lib/mjs/components/signature/Signature.d.ts +1 -1
- package/lib/mjs/components/signature/Signature.js +5 -10
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +2 -6
- package/lib/mjs/components/survey/Survey.js +6 -17
- package/lib/mjs/components/survey/editForm/Survey.edit.data.js +4 -12
- package/lib/mjs/components/table/editForm/Table.edit.display.js +3 -3
- package/lib/mjs/components/tabs/Tabs.js +4 -19
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +1 -3
- package/lib/mjs/components/tags/Tags.js +4 -14
- package/lib/mjs/components/textarea/TextArea.js +8 -15
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +14 -56
- package/lib/mjs/components/textfield/TextField.js +4 -4
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +2 -8
- package/lib/mjs/components/time/Time.js +1 -4
- package/lib/mjs/components/time/editForm/Time.edit.display.js +1 -4
- package/lib/mjs/formio.form.js +6 -6
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/providers/address/AddressProvider.js +1 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.js +1 -3
- package/lib/mjs/providers/processor/fileProcessor.js +1 -3
- package/lib/mjs/providers/storage/azure.js +5 -6
- package/lib/mjs/providers/storage/indexeddb.js +5 -15
- package/lib/mjs/providers/storage/s3.js +3 -14
- package/lib/mjs/providers/storage/xhr.js +19 -32
- package/lib/mjs/templates/Templates.js +1 -0
- package/lib/mjs/translations/en.d.ts +237 -82
- package/lib/mjs/translations/en.js +88 -0
- package/lib/mjs/utils/ChoicesWrapper.js +1 -1
- package/lib/mjs/utils/builder.js +5 -26
- package/lib/mjs/utils/i18n.d.ts +5 -2
- package/lib/mjs/utils/i18n.js +33 -12
- package/lib/mjs/utils/utils.js +37 -47
- package/lib/mjs/widgets/CalendarWidget.js +2 -6
- package/package.json +6 -4
|
@@ -1,83 +1,238 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
fileTooSmall: string;
|
|
80
|
+
fileTooBig: string;
|
|
81
|
+
formNotReady: string;
|
|
82
|
+
noFormElement: string;
|
|
83
|
+
notUniqueKey: string;
|
|
84
|
+
newFormSchema: string;
|
|
85
|
+
missingUrl: string;
|
|
86
|
+
urlNotAttachedToBtn: string;
|
|
87
|
+
loadingProjectSettingsError: string;
|
|
88
|
+
sessionStorageSupportError: string;
|
|
89
|
+
builderUniqueError: string;
|
|
90
|
+
pageNotFound: string;
|
|
91
|
+
noDragInfoError: string;
|
|
92
|
+
addonSupportTypeError: string;
|
|
93
|
+
setPathError: string;
|
|
94
|
+
calculatedPathDeprecation: string;
|
|
95
|
+
unknownTemplate: string;
|
|
96
|
+
unknownComponent: string;
|
|
97
|
+
renderTemplateFunctionDeprecation: string;
|
|
98
|
+
whenReadyDeprecation: string;
|
|
99
|
+
loadResourcesError: string;
|
|
100
|
+
noSelectDataConfiguration: string;
|
|
101
|
+
indexedDBSupportError: string;
|
|
102
|
+
caretPositionSavingError: string;
|
|
103
|
+
iteratableRowsError: string;
|
|
104
|
+
checkRowDeprecation: string;
|
|
105
|
+
noOAuthBtn: string;
|
|
106
|
+
noOAuthConfiguration: string;
|
|
107
|
+
oAuthErrorsTitle: string;
|
|
108
|
+
noOAuthFormUrl: string;
|
|
109
|
+
oAuthStateError: string;
|
|
110
|
+
componentInvalidRowValidation: string;
|
|
111
|
+
videoPlayerNotFound: string;
|
|
112
|
+
synchronizationFailed: string;
|
|
113
|
+
fileWithDuplicatedNameInProgress: string;
|
|
114
|
+
fileWithDuplicatedNameLoaded: string;
|
|
115
|
+
nestedForm: string;
|
|
116
|
+
noDataProvided: string;
|
|
117
|
+
subformSubmissionLoadingError: string;
|
|
118
|
+
noDelimiterSet: string;
|
|
119
|
+
noSiteKey: string;
|
|
120
|
+
failedToNormalize: string;
|
|
121
|
+
failedToCompareItems: string;
|
|
122
|
+
editorFocusError: string;
|
|
123
|
+
quillImageUploadFailed: string;
|
|
124
|
+
noFilesSelected: string;
|
|
125
|
+
needConfigurationForQuill: string;
|
|
126
|
+
waitPdfConverting: string;
|
|
127
|
+
uploading: string;
|
|
128
|
+
pasteBelow: string;
|
|
129
|
+
copy: string;
|
|
130
|
+
move: string;
|
|
131
|
+
edit: string;
|
|
132
|
+
editJson: string;
|
|
133
|
+
remove: string;
|
|
134
|
+
clickToSetValue: string;
|
|
135
|
+
words: string;
|
|
136
|
+
characters: string;
|
|
137
|
+
addAnother: string;
|
|
138
|
+
yes: string;
|
|
139
|
+
no: string;
|
|
140
|
+
wantToClearData: string;
|
|
141
|
+
yesDelete: string;
|
|
142
|
+
waitFileProcessing: string;
|
|
143
|
+
wrongFileType: 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
|
+
confirmComponentRemoveWithChildren: string;
|
|
162
|
+
confirmComponentRemove: string;
|
|
163
|
+
requestAborted: string;
|
|
164
|
+
checkEnteredParameters: string;
|
|
165
|
+
oauthSessionExpired: string;
|
|
166
|
+
help: string;
|
|
167
|
+
component: string;
|
|
168
|
+
save: string;
|
|
169
|
+
preview: string;
|
|
170
|
+
dragAndDropComponent: string;
|
|
171
|
+
searchFields: string;
|
|
172
|
+
noMatchesFound: string;
|
|
173
|
+
fileName: string;
|
|
174
|
+
size: string;
|
|
175
|
+
type: string;
|
|
176
|
+
gallery: string;
|
|
177
|
+
camera: string;
|
|
178
|
+
dropFilesToAttach: string;
|
|
179
|
+
useCamera: string;
|
|
180
|
+
browse: string;
|
|
181
|
+
takePicture: string;
|
|
182
|
+
switchToFileUpload: string;
|
|
183
|
+
completeStatus: string;
|
|
184
|
+
noStorageSet: string;
|
|
185
|
+
noFileApiSupport: string;
|
|
186
|
+
noFormDataSupport: string;
|
|
187
|
+
noProgressSupport: string;
|
|
188
|
+
close: string;
|
|
189
|
+
addResource: string;
|
|
190
|
+
autocomplete: string;
|
|
191
|
+
showPreview: string;
|
|
192
|
+
hidePreview: string;
|
|
193
|
+
createPage: string;
|
|
194
|
+
page: string;
|
|
195
|
+
closeBtnDescription: string;
|
|
196
|
+
cancelBtnDescription: string;
|
|
197
|
+
saveBtnDescription: string;
|
|
198
|
+
addOrRemove: string;
|
|
199
|
+
anyFileTypesAllowed: string;
|
|
200
|
+
allowedFileTypes: string;
|
|
201
|
+
syncing: string;
|
|
202
|
+
syncNow: string;
|
|
203
|
+
pressToOpen: string;
|
|
204
|
+
browseToAttachFileFor: string;
|
|
205
|
+
or: string;
|
|
206
|
+
numericOnly: string;
|
|
207
|
+
uploadPdfFile: string;
|
|
208
|
+
dropToStart: string;
|
|
209
|
+
expand: string;
|
|
210
|
+
collapse: string;
|
|
211
|
+
add: string;
|
|
212
|
+
delete: string;
|
|
213
|
+
revert: string;
|
|
214
|
+
removeBtnPressToRemove: string;
|
|
215
|
+
file: string;
|
|
216
|
+
captureVideo: string;
|
|
217
|
+
captureAudio: string;
|
|
218
|
+
captureImage: string;
|
|
219
|
+
browseFiles: string;
|
|
220
|
+
noComponentsSetInGrid: string;
|
|
221
|
+
sortAscending: string;
|
|
222
|
+
sortDescending: string;
|
|
223
|
+
filter: string;
|
|
224
|
+
clear: string;
|
|
225
|
+
showItemsWithValue: string;
|
|
226
|
+
gridItemsPerPage: string;
|
|
227
|
+
gridAllItems: string;
|
|
228
|
+
recordsSelectedOnPage: string;
|
|
229
|
+
recordsSelectedInTable: string;
|
|
230
|
+
gridSelectAll: string;
|
|
231
|
+
itemsInTable: string;
|
|
232
|
+
clearSelection: string;
|
|
233
|
+
editGridRow: string;
|
|
234
|
+
deleteGridRow: string;
|
|
235
|
+
selected: string;
|
|
236
|
+
actions: string;
|
|
237
|
+
};
|
|
83
238
|
export default _default;
|
|
@@ -1,85 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a;
|
|
2
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
invalidOption: '{{field}} is an invalid value.',
|
|
8
|
-
invalidDay: '{{field}} is not a valid day.',
|
|
9
|
-
complete: 'Submission Complete',
|
|
10
|
-
error: 'Please fix the following errors before submitting.',
|
|
11
|
-
errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.',
|
|
12
|
-
errorsListNavigationMessage: 'Click to navigate to the field with following error.',
|
|
13
|
-
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',
|
|
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
|
-
maxDate: '{{field}} should not contain date after {{maxDate}}',
|
|
28
|
-
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.',
|
|
34
|
-
invalid_url: '{{field}} must be a valid url.',
|
|
35
|
-
invalid_regex: '{{field}} does not match the pattern {{regex}}.',
|
|
36
|
-
invalid_date: '{{field}} is not a valid date.',
|
|
37
|
-
invalid_day: '{{field}} is not a valid day.',
|
|
38
|
-
invalidValueProperty: 'Invalid Value Property',
|
|
39
|
-
mask: '{{field}} does not match the mask.',
|
|
40
|
-
valueIsNotAvailable: '{{ field }} is an invalid value.',
|
|
41
|
-
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
|
-
next: 'Next',
|
|
58
|
-
previous: 'Previous',
|
|
59
|
-
cancel: 'Cancel',
|
|
60
|
-
submit: 'Submit Form',
|
|
61
|
-
confirmCancel: 'Are you sure you want to cancel?',
|
|
62
|
-
saveDraftInstanceError: 'Cannot save draft because there is no formio instance.',
|
|
63
|
-
saveDraftAuthError: 'Cannot save draft unless a user is authenticated.',
|
|
64
|
-
restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.',
|
|
65
|
-
saveDraftError: 'Unable to save draft.',
|
|
66
|
-
restoreDraftError: 'Unable to restore draft.',
|
|
67
|
-
time: 'Invalid time',
|
|
68
|
-
cancelButtonAriaLabel: 'Cancel button. Click to reset the form',
|
|
69
|
-
previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab',
|
|
70
|
-
nextButtonAriaLabel: 'Next button. Click to go to the next tab',
|
|
71
|
-
submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
|
|
72
|
-
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
|
73
|
-
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
|
74
|
-
apiKey: 'API Key is not unique: {{key}}',
|
|
75
|
-
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
|
76
|
-
typeCount: '{{ count }} {{ type }}',
|
|
77
|
-
requiredDayField: '{{ field }} is required',
|
|
78
|
-
requiredDayEmpty: '{{ field }} is required',
|
|
79
|
-
requiredMonthField: '{{ field }} is required',
|
|
80
|
-
requiredYearField: '{{ field }} is required',
|
|
81
|
-
fileTooSmall: 'File is too small; it must be at least {{ size }}',
|
|
82
|
-
fileTooBig: 'File is too big; it must be at most {{ size }}',
|
|
7
|
+
const bootstrap_1 = __importDefault(require("@formio/bootstrap"));
|
|
8
|
+
exports.default = Object.assign(Object.assign({}, (((_a = bootstrap_1.default === null || bootstrap_1.default === void 0 ? void 0 : bootstrap_1.default.translations) === null || _a === void 0 ? void 0 : _a.en) || {})), { unsavedRowsError: 'Please save all rows before proceeding.', invalidRowsError: 'Please correct invalid rows before proceeding.', invalidRowError: 'Invalid row. Please correct it or delete.', invalidOption: '{{field}} is an invalid value.', invalidDay: '{{field}} is not a valid day.', complete: 'Submission Complete', error: 'Please fix the following errors before submitting.', errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.', errorsListNavigationMessage: 'Click to navigate to the field with following error.', submitError: 'Please check the form and correct all errors before submitting.', required: '{{field}} is required', unique: '{{field}} must be unique', array: '{{field}} must be an array', array_nonempty: '{{field}} must be a non-empty array', nonarray: '{{field}} must not be an array', select: '{{field}} contains an invalid selection', pattern: '{{field}} does not match the pattern {{pattern}}', minLength: '{{field}} must have at least {{length}} characters.', maxLength: '{{field}} must have no more than {{length}} characters.', minWords: '{{field}} must have at least {{length}} words.', maxWords: '{{field}} must have no more than {{length}} words.', min: '{{field}} cannot be less than {{min}}.', max: '{{field}} cannot be greater than {{max}}.', maxDate: '{{field}} should not contain date after {{maxDate}}', minDate: '{{field}} should not contain date before {{minDate}}', maxYear: '{{field}} should not contain year greater than {{maxYear}}', minYear: '{{field}} should not contain year less than {{minYear}}', minSelectedCount: 'You must select at least {{minCount}} items', maxSelectedCount: 'You may only select up to {{maxCount}} items', invalid_email: '{{field}} must be a valid email.', invalid_url: '{{field}} must be a valid url.', invalid_regex: '{{field}} does not match the pattern {{regex}}.', invalid_date: '{{field}} is not a valid date.', invalid_day: '{{field}} is not a valid day.', invalidValueProperty: 'Invalid Value Property', mask: '{{field}} does not match the mask.', valueIsNotAvailable: '{{ field }} is an invalid value.', stripe: '{{stripe}}', month: 'Month', day: 'Day', year: 'Year', january: 'January', february: 'February', march: 'March', april: 'April', may: 'May', june: 'June', july: 'July', august: 'August', september: 'September', october: 'October', november: 'November', december: 'December', next: 'Next', previous: 'Previous', cancel: 'Cancel', submit: 'Submit Form', confirmCancel: 'Are you sure you want to cancel?', saveDraftInstanceError: 'Cannot save draft because there is no formio instance.', saveDraftAuthError: 'Cannot save draft unless a user is authenticated.', restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.', saveDraftError: 'Unable to save draft.', restoreDraftError: 'Unable to restore draft.', time: 'Invalid time', cancelButtonAriaLabel: 'Cancel button. Click to reset the form', previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab', nextButtonAriaLabel: 'Next button. Click to go to the next tab', submitButtonAriaLabel: 'Submit Form button. Click to submit the form', reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error', reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission', apiKey: 'API Key is not unique: {{key}}', typeRemaining: '{{ remaining }} {{ type }} remaining.', typeCount: '{{ count }} {{ type }}', requiredDayField: '{{ field }} is required', requiredDayEmpty: '{{ field }} is required', requiredMonthField: '{{ field }} is required', requiredYearField: '{{ field }} is required', fileTooSmall: 'File is too small; it must be at least {{ size }}', fileTooBig: 'File is too big; it must be at most {{ size }}', formNotReady: 'Form not ready. Use form.ready promise', noFormElement: 'No DOM element for form.', notUniqueKey: 'API Key is not unique', newFormSchema: 'Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.', missingUrl: 'Missing URL argument', urlNotAttachedToBtn: 'You should add a URL to this button.', loadingProjectSettingsError: 'Could not load project settings', sessionStorageSupportError: 'Session storage is not supported in this browser.', builderUniqueError: `You cannot add more than one {{componentKeyOrTitle}} component to one page.`, pageNotFound: 'Page not found', noDragInfoError: 'There is no Drag Info available for either dragged or sibling element', addonSupportTypeError: 'Addon {{label}} does not support component of type {{type}}', setPathError: 'Should not be setting the path of a component.', calculatedPathDeprecation: 'component.calculatedPath was deprecated, use component.path instead.', unknownTemplate: 'Unknown template: {{name}}', unknownComponent: 'Unknown component: {{type}}', renderTemplateFunctionDeprecation: `Form.io 'render' template function is deprecated.
|
|
9
|
+
If you need to render template (template A) inside of another template (template B),
|
|
10
|
+
pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B`, whenReadyDeprecation: 'The whenReady() method has been deprecated. Please use the dataReady property instead.', loadResourcesError: 'Unable to load resources for {{componentKey}}', noSelectDataConfiguration: 'Select component {{componentKey}} does not have data configuration.', indexedDBSupportError: "Your browser doesn't support current version of indexedDB", caretPositionSavingError: 'An error occurred while trying to save caret position', iteratableRowsError: 'Getter #iteratableRows() is not implemented', checkRowDeprecation: 'Deprecation Warning: checkRow method has been replaced with processRow', noOAuthBtn: 'You must add the OAuth button to a form for it to function properly', noOAuthConfiguration: 'OAuth not configured. You must configure oauth for your project before it will work.', oAuthErrorsTitle: 'The Following Error Has Occured', noOAuthFormUrl: 'You must attach a Form API url to your form in order to use OAuth buttons.', oAuthStateError: 'OAuth state does not match. Please try logging in again.', componentInvalidRowValidation: 'Invalid row validation for {{componentKey}}', videoPlayerNotFound: 'Video player not found in template.', synchronizationFailed: 'Synchronization is failed', fileWithDuplicatedNameInProgress: 'File with the same name is already being uploaded', fileWithDuplicatedNameLoaded: 'File with the same name is already uploaded', nestedForm: 'Nested form', noDataProvided: 'No data provided', subformSubmissionLoadingError: 'Unable to load subform submission {{submissionId}}:', noDelimiterSet: 'In order for thousands separator to work properly, you must set the delimiter to true in the component json', noSiteKey: 'There is no Site Key specified in settings in form JSON', failedToNormalize: 'Failed to normalize value', failedToCompareItems: 'Error while comparing items', editorFocusError: 'An editor did not initialize properly when trying to focus:', quillImageUploadFailed: 'Quill image upload failed', noFilesSelected: 'No files selected', needConfigurationForQuill: 'The WYSIWYG settings are configured for CKEditor. For this renderer, you will need to use configurations for the Quill Editor. See https://quilljs.com/docs/configuration for more information.', waitPdfConverting: 'Converting PDF. Please wait.', uploading: 'Uploading', pasteBelow: 'Paste below', copy: 'Copy', move: 'Move', edit: 'Edit', editJson: 'Edit JSON', remove: 'Remove', clickToSetValue: 'Click to set value', words: 'words', characters: 'characters', addAnother: 'Add Another', yes: 'Yes', no: 'No', wantToClearData: 'Do you want to clear data?', yesDelete: 'Yes, delete it', waitFileProcessing: 'Processing file. Please wait...', wrongFileType: 'File is the wrong type; it must be {{ pattern }}', noFileService: 'File Service not provided.', fileProcessingFailed: 'File processing has been failed.', readyForUpload: 'Ready to be uploaded into storage', readyForRemovingFromStorage: 'Ready to be removed from storage', preparingFileToRemove: 'Preparing file to remove', succefullyRemoved: 'Succefully removed', succefullyUploaded: 'Succefully uploaded', maxSelectItems: 'You may only select up to {{maxCount}} items', minSelectItems: 'You must select at least {{minCount}} items', clickToSign: 'Click to Sign', surveyQuestion: 'Question', surveyQuestionValue: 'Value', success: 'Success', noResultsFound: 'No results found', noChoices: 'No choices to choose from', typeToSearch: 'Type to search', loading: 'Loading', confirmComponentRemoveWithChildren: 'Removing this component will also remove all of its children. Are you sure you want to do this?', confirmComponentRemove: 'Are you sure you want to remove this component?', requestAborted: 'Request was aborted', checkEnteredParameters: 'Please, check the entered parameters',
|
|
83
11
|
// when temp document storing oauth state and code verifier is cleared by ttl before the user completes login
|
|
84
|
-
oauthSessionExpired: 'Login attempt expired; please try again. Refreshing...'
|
|
85
|
-
};
|
|
12
|
+
oauthSessionExpired: 'Login attempt expired; please try again. Refreshing...' });
|
|
@@ -52,7 +52,7 @@ class ChoicesWrapper extends choices_js_1.default {
|
|
|
52
52
|
this._wasTap = true;
|
|
53
53
|
}
|
|
54
54
|
_onEnterKey(...args) {
|
|
55
|
-
const [event
|
|
55
|
+
const [event] = args;
|
|
56
56
|
// Prevent dropdown form opening when removeItemButton was pressed using 'Enter' on keyboard
|
|
57
57
|
if (event.target.className === 'choices__button') {
|
|
58
58
|
this.shouldOpenDropDown = false;
|
package/lib/cjs/utils/builder.js
CHANGED
|
@@ -17,23 +17,14 @@ exports.default = {
|
|
|
17
17
|
const formKeys = {};
|
|
18
18
|
(0, index_1.eachComponent)(container, (comp) => {
|
|
19
19
|
formKeys[comp.key] = true;
|
|
20
|
-
if ([
|
|
21
|
-
'address',
|
|
22
|
-
'container',
|
|
23
|
-
'datagrid',
|
|
24
|
-
'editgrid',
|
|
25
|
-
'dynamicWizard',
|
|
26
|
-
'tree',
|
|
27
|
-
].includes(comp.type) ||
|
|
20
|
+
if (['address', 'container', 'datagrid', 'editgrid', 'dynamicWizard', 'tree'].includes(comp.type) ||
|
|
28
21
|
comp.tree ||
|
|
29
22
|
comp.arrayTree) {
|
|
30
23
|
return true;
|
|
31
24
|
}
|
|
32
25
|
}, true);
|
|
33
26
|
// Recurse into all child components.
|
|
34
|
-
(0, index_1.eachComponent)([
|
|
35
|
-
component,
|
|
36
|
-
], (component) => {
|
|
27
|
+
(0, index_1.eachComponent)([component], (component) => {
|
|
37
28
|
// Skip key uniquification if this component doesn't have a key.
|
|
38
29
|
if (!component.key) {
|
|
39
30
|
return;
|
|
@@ -44,14 +35,7 @@ exports.default = {
|
|
|
44
35
|
changed = true;
|
|
45
36
|
}
|
|
46
37
|
formKeys[newKey] = true;
|
|
47
|
-
if ([
|
|
48
|
-
'address',
|
|
49
|
-
'container',
|
|
50
|
-
'datagrid',
|
|
51
|
-
'editgrid',
|
|
52
|
-
'dynamicWizard',
|
|
53
|
-
'tree',
|
|
54
|
-
].includes(component.type) ||
|
|
38
|
+
if (['address', 'container', 'datagrid', 'editgrid', 'dynamicWizard', 'tree'].includes(component.type) ||
|
|
55
39
|
component.tree ||
|
|
56
40
|
component.arrayTree) {
|
|
57
41
|
return true;
|
|
@@ -63,10 +47,7 @@ exports.default = {
|
|
|
63
47
|
* Additional shortcuts for the builder.
|
|
64
48
|
*/
|
|
65
49
|
additionalShortcuts: {
|
|
66
|
-
button: [
|
|
67
|
-
'Enter',
|
|
68
|
-
'Esc',
|
|
69
|
-
],
|
|
50
|
+
button: ['Enter', 'Esc'],
|
|
70
51
|
},
|
|
71
52
|
/**
|
|
72
53
|
* Returns the alpha character shortcuts.
|
|
@@ -101,9 +82,7 @@ exports.default = {
|
|
|
101
82
|
if (!component) {
|
|
102
83
|
return [];
|
|
103
84
|
}
|
|
104
|
-
return [
|
|
105
|
-
'',
|
|
106
|
-
]
|
|
85
|
+
return ['']
|
|
107
86
|
.concat(lodash_1.default.difference(this.getAlphaShortcuts().concat(this.getAdditionalShortcuts(component.type)), this.getBindedShortcuts(form.components, component)))
|
|
108
87
|
.map((shortcut) => ({
|
|
109
88
|
label: shortcut,
|
package/lib/cjs/utils/i18n.d.ts
CHANGED
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
* This file is used to mimic the i18n library interface.
|
|
3
3
|
*/
|
|
4
4
|
export class I18n {
|
|
5
|
+
static languages: {};
|
|
6
|
+
static setDefaultTranslations(languages: any): void;
|
|
5
7
|
static init(languages?: {}): I18n;
|
|
6
8
|
static createInstance(): I18n;
|
|
7
9
|
constructor(languages?: {});
|
|
8
|
-
languages:
|
|
10
|
+
languages: any;
|
|
11
|
+
defaultKeys: any;
|
|
9
12
|
language: string;
|
|
10
13
|
originalLanguage: string;
|
|
11
14
|
currentLanguage: any;
|
|
12
|
-
setLanguages(languages: any): void;
|
|
15
|
+
setLanguages(languages: any, noDefaultOverride: any): void;
|
|
13
16
|
dir(lang?: string): "rtl" | "ltr";
|
|
14
17
|
changeLanguage(language: any, ready?: null): void;
|
|
15
18
|
addResourceBundle(language: any, type: any, strings: any): void;
|
package/lib/cjs/utils/i18n.js
CHANGED
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.I18n = void 0;
|
|
7
7
|
const Evaluator_1 = require("./Evaluator");
|
|
8
8
|
const i18n_1 = __importDefault(require("../i18n"));
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const core_1 = require("@formio/core");
|
|
9
11
|
const i18Defaults = {};
|
|
10
12
|
for (const lang in i18n_1.default.resources) {
|
|
11
13
|
if (i18n_1.default.resources.hasOwnProperty(lang)) {
|
|
@@ -17,14 +19,29 @@ for (const lang in i18n_1.default.resources) {
|
|
|
17
19
|
*/
|
|
18
20
|
class I18n {
|
|
19
21
|
constructor(languages = {}) {
|
|
20
|
-
|
|
22
|
+
var _a;
|
|
23
|
+
this.languages = (0, core_1.fastCloneDeep)(I18n.languages || {});
|
|
24
|
+
this.defaultKeys = ((_a = I18n.languages) === null || _a === void 0 ? void 0 : _a.en) || {};
|
|
21
25
|
this.language = 'en';
|
|
22
26
|
this.originalLanguage = 'en';
|
|
23
27
|
this.currentLanguage = i18Defaults.en;
|
|
24
28
|
this.setLanguages(languages);
|
|
25
29
|
this.changeLanguage(this.language);
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
static setDefaultTranslations(languages) {
|
|
32
|
+
if ((0, lodash_1.isEmpty)(languages)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
for (const lang in languages) {
|
|
36
|
+
if (lang !== 'language' && languages.hasOwnProperty(lang)) {
|
|
37
|
+
if (!this.languages[lang]) {
|
|
38
|
+
this.languages[lang] = {};
|
|
39
|
+
}
|
|
40
|
+
this.languages[lang] = Object.assign(Object.assign({}, languages[lang]), this.languages[lang]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
setLanguages(languages, noDefaultOverride) {
|
|
28
45
|
if (languages.resources) {
|
|
29
46
|
for (const lang in languages.resources) {
|
|
30
47
|
if (languages.resources.hasOwnProperty(lang)) {
|
|
@@ -51,7 +68,8 @@ class I18n {
|
|
|
51
68
|
if (!this.languages[lang]) {
|
|
52
69
|
this.languages[lang] = {};
|
|
53
70
|
}
|
|
54
|
-
this.languages[lang] =
|
|
71
|
+
this.languages[lang] = noDefaultOverride
|
|
72
|
+
? Object.assign(Object.assign({}, languages[lang]), this.languages[lang]) : Object.assign(Object.assign({}, this.languages[lang]), languages[lang]);
|
|
55
73
|
}
|
|
56
74
|
}
|
|
57
75
|
}
|
|
@@ -60,13 +78,7 @@ class I18n {
|
|
|
60
78
|
}
|
|
61
79
|
dir(lang = '') {
|
|
62
80
|
lang = lang || this.language;
|
|
63
|
-
const rtls = [
|
|
64
|
-
'ar',
|
|
65
|
-
'he',
|
|
66
|
-
'fa',
|
|
67
|
-
'ps',
|
|
68
|
-
'ur',
|
|
69
|
-
];
|
|
81
|
+
const rtls = ['ar', 'he', 'fa', 'ps', 'ur'];
|
|
70
82
|
return rtls.includes(lang) ? 'rtl' : 'ltr';
|
|
71
83
|
}
|
|
72
84
|
static createInstance() {
|
|
@@ -88,14 +100,23 @@ class I18n {
|
|
|
88
100
|
}
|
|
89
101
|
t(text, ...args) {
|
|
90
102
|
var _a;
|
|
91
|
-
|
|
103
|
+
let currentTranslation = this.currentLanguage[text];
|
|
104
|
+
// provide compatibility with cases where the entire phrase is used as a key
|
|
105
|
+
// get the phrase that is possibly being used as a key
|
|
106
|
+
const defaultKey = this.defaultKeys[text];
|
|
107
|
+
if (defaultKey && this.currentLanguage[defaultKey]) {
|
|
108
|
+
// get translation using the phrase as a key
|
|
109
|
+
currentTranslation = this.currentLanguage[defaultKey];
|
|
110
|
+
}
|
|
111
|
+
if (currentTranslation) {
|
|
92
112
|
const customTranslationFieldName = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.field;
|
|
93
113
|
if (customTranslationFieldName && this.currentLanguage[customTranslationFieldName]) {
|
|
94
114
|
args[0].field = this.currentLanguage[customTranslationFieldName];
|
|
95
115
|
}
|
|
96
|
-
return Evaluator_1.Evaluator.interpolateString(
|
|
116
|
+
return Evaluator_1.Evaluator.interpolateString(currentTranslation, ...args);
|
|
97
117
|
}
|
|
98
118
|
return Evaluator_1.Evaluator.interpolateString(text, ...args);
|
|
99
119
|
}
|
|
100
120
|
}
|
|
101
121
|
exports.I18n = I18n;
|
|
122
|
+
I18n.languages = i18Defaults;
|