@formio/js 5.1.0-dev.6059.845a6e3 → 5.1.0-dev.6060.19e3bfc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +131 -13
- package/README.md +28 -1
- package/dist/formio.builder.css +19 -17
- 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 +19 -17
- package/dist/formio.form.js +102 -176
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -3
- package/dist/formio.full.css +19 -17
- package/dist/formio.full.js +123 -101
- package/dist/formio.full.min.css +2 -2
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -3
- package/dist/formio.js +10 -10
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +3 -3
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/CDN.d.ts +1 -1
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Form.d.ts +4 -6
- package/lib/cjs/Form.js +16 -8
- package/lib/cjs/Formio.js +1 -1
- package/lib/cjs/PDFBuilder.js +4 -4
- package/lib/cjs/Webform.d.ts +16 -13
- package/lib/cjs/Webform.js +162 -148
- package/lib/cjs/WebformBuilder.js +17 -28
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/WizardBuilder.js +15 -2
- package/lib/cjs/components/Components.d.ts +3 -0
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/cjs/components/_classes/component/Component.js +38 -11
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +37 -0
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +32 -2
- package/lib/cjs/components/_classes/component/editForm/utils.d.ts +1 -0
- package/lib/cjs/components/_classes/component/editForm/utils.js +3 -0
- package/lib/cjs/components/_classes/input/Input.js +23 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +13 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +52 -31
- package/lib/cjs/components/address/Address.js +14 -1
- package/lib/cjs/components/button/Button.js +6 -6
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +2 -2
- package/lib/cjs/components/content/editForm/Content.edit.display.js +8 -0
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +12 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.js +41 -26
- package/lib/cjs/components/day/Day.js +9 -7
- package/lib/cjs/components/day/editForm/Day.edit.display.js +8 -0
- package/lib/cjs/components/editgrid/EditGrid.d.ts +1 -1
- package/lib/cjs/components/editgrid/EditGrid.js +26 -8
- package/lib/cjs/components/email/editForm/Email.edit.display.js +12 -0
- package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
- package/lib/cjs/components/file/File.d.ts +1 -1
- package/lib/cjs/components/file/File.js +30 -19
- package/lib/cjs/components/form/Form.d.ts +1 -1
- package/lib/cjs/components/form/Form.js +9 -5
- package/lib/cjs/components/form/editForm/Form.edit.form.js +3 -3
- package/lib/cjs/components/hidden/Hidden.d.ts +0 -1
- package/lib/cjs/components/hidden/Hidden.js +1 -1
- package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
- package/lib/cjs/components/html/editForm/HTML.edit.display.js +8 -0
- package/lib/cjs/components/number/Number.js +12 -5
- package/lib/cjs/components/number/editForm/Number.edit.display.js +12 -0
- package/lib/cjs/components/password/editForm/Password.edit.display.js +13 -1
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -1
- package/lib/cjs/components/radio/Radio.js +10 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +2 -2
- package/lib/cjs/components/select/Select.d.ts +0 -1
- package/lib/cjs/components/select/Select.js +12 -33
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +3 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.js +2 -2
- package/lib/cjs/components/signature/Signature.d.ts +1 -1
- package/lib/cjs/components/signature/Signature.js +5 -3
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/cjs/components/survey/Survey.js +2 -2
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
- package/lib/cjs/components/tags/Tags.d.ts +1 -1
- package/lib/cjs/components/tags/Tags.js +2 -2
- package/lib/cjs/components/textarea/TextArea.js +6 -6
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
- package/lib/cjs/components/url/editForm/Url.edit.display.js +12 -0
- package/lib/cjs/components/well/editForm/Well.edit.display.js +8 -0
- package/lib/cjs/formio.form.js +5 -0
- package/lib/cjs/providers/storage/googleDrive.js +3 -2
- package/lib/cjs/providers/storage/s3.js +3 -3
- package/lib/cjs/providers/storage/xhr.d.ts +1 -0
- package/lib/cjs/providers/storage/xhr.js +6 -1
- package/lib/cjs/translations/en.d.ts +234 -81
- package/lib/cjs/translations/en.js +8 -81
- package/lib/cjs/utils/ChoicesWrapper.d.ts +4 -25
- package/lib/cjs/utils/ChoicesWrapper.js +47 -124
- package/lib/cjs/utils/formUtils.d.ts +2 -2
- package/lib/cjs/utils/i18n.d.ts +5 -2
- package/lib/cjs/utils/i18n.js +32 -5
- package/lib/cjs/widgets/CalendarWidget.js +27 -27
- package/lib/mjs/CDN.d.ts +1 -1
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Embed.js +1 -1
- package/lib/mjs/Form.d.ts +4 -6
- package/lib/mjs/Form.js +17 -9
- package/lib/mjs/Formio.js +1 -1
- package/lib/mjs/PDFBuilder.js +4 -4
- package/lib/mjs/Webform.d.ts +16 -13
- package/lib/mjs/Webform.js +171 -158
- package/lib/mjs/WebformBuilder.js +17 -28
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/WizardBuilder.js +15 -2
- package/lib/mjs/components/Components.d.ts +3 -0
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -0
- package/lib/mjs/components/_classes/component/Component.js +27 -11
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +1 -1
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +37 -0
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +32 -2
- package/lib/mjs/components/_classes/component/editForm/utils.d.ts +1 -0
- package/lib/mjs/components/_classes/component/editForm/utils.js +3 -0
- package/lib/mjs/components/_classes/input/Input.js +22 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +4 -4
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +13 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +2 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +53 -31
- package/lib/mjs/components/address/Address.js +14 -1
- package/lib/mjs/components/button/Button.js +6 -6
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.js +2 -2
- package/lib/mjs/components/content/editForm/Content.edit.display.js +8 -0
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +12 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.js +41 -26
- package/lib/mjs/components/day/Day.js +9 -7
- package/lib/mjs/components/day/editForm/Day.edit.display.js +8 -0
- package/lib/mjs/components/editgrid/EditGrid.d.ts +1 -1
- package/lib/mjs/components/editgrid/EditGrid.js +25 -7
- package/lib/mjs/components/email/editForm/Email.edit.display.js +12 -0
- package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
- package/lib/mjs/components/file/File.d.ts +1 -1
- package/lib/mjs/components/file/File.js +30 -19
- package/lib/mjs/components/form/Form.d.ts +1 -1
- package/lib/mjs/components/form/Form.js +8 -5
- package/lib/mjs/components/form/editForm/Form.edit.form.js +3 -3
- package/lib/mjs/components/hidden/Hidden.d.ts +0 -1
- package/lib/mjs/components/hidden/Hidden.js +1 -1
- package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
- package/lib/mjs/components/html/editForm/HTML.edit.display.js +8 -0
- package/lib/mjs/components/number/Number.js +12 -5
- package/lib/mjs/components/number/editForm/Number.edit.display.js +12 -0
- package/lib/mjs/components/password/editForm/Password.edit.display.js +13 -1
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -1
- package/lib/mjs/components/radio/Radio.js +10 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +2 -2
- package/lib/mjs/components/select/Select.d.ts +0 -1
- package/lib/mjs/components/select/Select.js +14 -34
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +3 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.js +2 -2
- package/lib/mjs/components/signature/Signature.d.ts +1 -1
- package/lib/mjs/components/signature/Signature.js +5 -3
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/mjs/components/survey/Survey.js +2 -2
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
- package/lib/mjs/components/tags/Tags.d.ts +1 -1
- package/lib/mjs/components/tags/Tags.js +2 -2
- package/lib/mjs/components/textarea/TextArea.js +6 -6
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
- package/lib/mjs/components/url/editForm/Url.edit.display.js +12 -0
- package/lib/mjs/components/well/editForm/Well.edit.display.js +8 -0
- package/lib/mjs/formio.form.js +5 -0
- package/lib/mjs/providers/storage/googleDrive.js +3 -2
- package/lib/mjs/providers/storage/s3.js +3 -3
- package/lib/mjs/providers/storage/xhr.d.ts +1 -0
- package/lib/mjs/providers/storage/xhr.js +6 -1
- package/lib/mjs/translations/en.d.ts +234 -81
- package/lib/mjs/translations/en.js +87 -1
- package/lib/mjs/utils/ChoicesWrapper.d.ts +4 -25
- package/lib/mjs/utils/ChoicesWrapper.js +26 -119
- package/lib/mjs/utils/formUtils.d.ts +2 -2
- package/lib/mjs/utils/i18n.d.ts +5 -2
- package/lib/mjs/utils/i18n.js +32 -5
- package/lib/mjs/widgets/CalendarWidget.js +27 -27
- package/package.json +27 -11
@@ -1,83 +1,10 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
unsavedRowsError: 'Please save all rows before proceeding.',
|
5
|
-
invalidRowsError: 'Please correct invalid rows before proceeding.',
|
6
|
-
invalidRowError: 'Invalid row. Please correct it or delete.',
|
7
|
-
invalidOption: '{{field}} is an invalid value.',
|
8
|
-
invalidDay: '{{field}} is not a valid day.',
|
9
|
-
alertMessageWithLabel: '{{label}}: {{message}}',
|
10
|
-
alertMessage: '{{message}}',
|
11
|
-
complete: 'Submission Complete',
|
12
|
-
error: 'Please fix the following errors before submitting.',
|
13
|
-
errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.',
|
14
|
-
errorsListNavigationMessage: 'Click to navigate to the field with following error.',
|
15
|
-
submitError: 'Please check the form and correct all errors before submitting.',
|
16
|
-
required: '{{field}} is required',
|
17
|
-
unique: '{{field}} must be unique',
|
18
|
-
array: '{{field}} must be an array',
|
19
|
-
array_nonempty: '{{field}} must be a non-empty array', // eslint-disable-line camelcase
|
20
|
-
nonarray: '{{field}} must not be an array',
|
21
|
-
select: '{{field}} contains an invalid selection',
|
22
|
-
pattern: '{{field}} does not match the pattern {{pattern}}',
|
23
|
-
minLength: '{{field}} must have at least {{length}} characters.',
|
24
|
-
maxLength: '{{field}} must have no more than {{length}} characters.',
|
25
|
-
minWords: '{{field}} must have at least {{length}} words.',
|
26
|
-
maxWords: '{{field}} must have no more than {{length}} words.',
|
27
|
-
min: '{{field}} cannot be less than {{min}}.',
|
28
|
-
max: '{{field}} cannot be greater than {{max}}.',
|
29
|
-
maxDate: '{{field}} should not contain date after {{maxDate}}',
|
30
|
-
minDate: '{{field}} should not contain date before {{minDate}}',
|
31
|
-
maxYear: '{{field}} should not contain year greater than {{maxYear}}',
|
32
|
-
minYear: '{{field}} should not contain year less than {{minYear}}',
|
33
|
-
minSelectedCount: 'You must select at least {{minCount}} items',
|
34
|
-
maxSelectedCount: 'You may only select up to {{maxCount}} items',
|
35
|
-
invalid_email: '{{field}} must be a valid email.', // eslint-disable-line camelcase
|
36
|
-
invalid_url: '{{field}} must be a valid url.', // eslint-disable-line camelcase
|
37
|
-
invalid_regex: '{{field}} does not match the pattern {{regex}}.', // eslint-disable-line camelcase
|
38
|
-
invalid_date: '{{field}} is not a valid date.', // eslint-disable-line camelcase
|
39
|
-
invalid_day: '{{field}} is not a valid day.', // eslint-disable-line camelcase
|
40
|
-
invalidValueProperty: 'Invalid Value Property',
|
41
|
-
mask: '{{field}} does not match the mask.',
|
42
|
-
valueIsNotAvailable: '{{ field }} is an invalid value.',
|
43
|
-
stripe: '{{stripe}}',
|
44
|
-
month: 'Month',
|
45
|
-
day: 'Day',
|
46
|
-
year: 'Year',
|
47
|
-
january: 'January',
|
48
|
-
february: 'February',
|
49
|
-
march: 'March',
|
50
|
-
april: 'April',
|
51
|
-
may: 'May',
|
52
|
-
june: 'June',
|
53
|
-
july: 'July',
|
54
|
-
august: 'August',
|
55
|
-
september: 'September',
|
56
|
-
october: 'October',
|
57
|
-
november: 'November',
|
58
|
-
december: 'December',
|
59
|
-
next: 'Next',
|
60
|
-
previous: 'Previous',
|
61
|
-
cancel: 'Cancel',
|
62
|
-
submit: 'Submit Form',
|
63
|
-
confirmCancel: 'Are you sure you want to cancel?',
|
64
|
-
saveDraftInstanceError: 'Cannot save draft because there is no formio instance.',
|
65
|
-
saveDraftAuthError: 'Cannot save draft unless a user is authenticated.',
|
66
|
-
restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.',
|
67
|
-
saveDraftError: 'Unable to save draft.',
|
68
|
-
restoreDraftError: 'Unable to restore draft.',
|
69
|
-
time: 'Invalid time',
|
70
|
-
cancelButtonAriaLabel: 'Cancel button. Click to reset the form',
|
71
|
-
previousButtonAriaLabel: 'Previous button. Click to go back to the previous tab',
|
72
|
-
nextButtonAriaLabel: 'Next button. Click to go to the next tab',
|
73
|
-
submitButtonAriaLabel: 'Submit Form button. Click to submit the form',
|
74
|
-
reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
|
75
|
-
reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
|
76
|
-
apiKey: 'API Key is not unique: {{key}}',
|
77
|
-
typeRemaining: '{{ remaining }} {{ type }} remaining.',
|
78
|
-
typeCount: '{{ count }} {{ type }}',
|
79
|
-
requiredDayField: '{{ field }} is required',
|
80
|
-
requiredDayEmpty: '{{ field }} is required',
|
81
|
-
requiredMonthField: '{{ field }} is required',
|
82
|
-
requiredYearField: '{{ field }} is required'
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
83
4
|
};
|
5
|
+
var _a;
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
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.', alertMessageWithLabel: '{{label}}: {{message}}', alertMessage: '{{message}}', 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', 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 }}', fileTooSmall: 'File is too small; it must be at least {{ size }}', fileTooBig: 'File is too big; it must be at most {{ size }}', 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' });
|
@@ -1,38 +1,17 @@
|
|
1
|
-
export namespace KEY_CODES {
|
2
|
-
let BACK_KEY: number;
|
3
|
-
let DELETE_KEY: number;
|
4
|
-
let TAB_KEY: number;
|
5
|
-
let ENTER_KEY: number;
|
6
|
-
let A_KEY: number;
|
7
|
-
let ESC_KEY: number;
|
8
|
-
let UP_KEY: number;
|
9
|
-
let DOWN_KEY: number;
|
10
|
-
let PAGE_UP_KEY: number;
|
11
|
-
let PAGE_DOWN_KEY: number;
|
12
|
-
}
|
13
1
|
export default ChoicesWrapper;
|
14
2
|
declare class ChoicesWrapper extends Choices {
|
15
3
|
constructor(...args: any[]);
|
16
|
-
_onTabKey(
|
17
|
-
activeItems: any;
|
18
|
-
hasActiveDropdown: any;
|
19
|
-
}): void;
|
4
|
+
_onTabKey(): void;
|
20
5
|
isDirectionUsing: boolean;
|
21
6
|
shouldOpenDropDown: boolean;
|
22
7
|
_onTouchEnd(event: any): void;
|
23
|
-
|
24
|
-
_onEnterKey(args: any): void;
|
8
|
+
_onEnterKey(...args: any[]): void;
|
25
9
|
_onDirectionKey(...args: any[]): void;
|
26
10
|
timeout: NodeJS.Timeout | undefined;
|
27
11
|
_selectHighlightedChoice(): void;
|
28
12
|
_onKeyDown(event: any): void;
|
29
|
-
onSelectValue(
|
30
|
-
event: any;
|
31
|
-
activeItems: any;
|
32
|
-
hasActiveDropdown: any;
|
33
|
-
}): void;
|
13
|
+
onSelectValue(event: any, hasActiveDropdown: any): void;
|
34
14
|
showDropdown(...args: any[]): void;
|
35
15
|
hideDropdown(...args: any[]): void;
|
36
|
-
_onBlur(...args: any[]): void;
|
37
16
|
}
|
38
|
-
import Choices from '
|
17
|
+
import Choices from 'choices.js';
|
@@ -1,48 +1,30 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
const choices_js_1 = __importDefault(require("@formio/choices.js"));
|
8
|
-
/**
|
9
|
-
* TODO: REMOVE THIS ONCE THE PULL REQUEST HAS BEEN RESOLVED.
|
10
|
-
*
|
11
|
-
* https://github.com/jshjohnson/Choices/pull/788
|
12
|
-
*
|
13
|
-
* This is intentionally not part of the extended class, since other components use Choices and need this fix as well.
|
14
|
-
* @type {Choices._generatePlaceholderValue}
|
15
|
-
* @private
|
16
|
-
*/
|
17
|
-
choices_js_1.default.prototype._generatePlaceholderValue = function () {
|
18
|
-
if (this._isSelectElement && this.passedElement.placeholderOption) {
|
19
|
-
const { placeholderOption } = this.passedElement;
|
20
|
-
return placeholderOption ? placeholderOption.text : false;
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
21
7
|
}
|
22
|
-
|
23
|
-
|
24
|
-
if (
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
ENTER_KEY: 13,
|
39
|
-
A_KEY: 65,
|
40
|
-
ESC_KEY: 27,
|
41
|
-
UP_KEY: 38,
|
42
|
-
DOWN_KEY: 40,
|
43
|
-
PAGE_UP_KEY: 33,
|
44
|
-
PAGE_DOWN_KEY: 34,
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
45
24
|
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const choices_js_1 = __importStar(require("choices.js"));
|
27
|
+
const ExtendedKeyCodeMap = Object.assign(Object.assign({}, choices_js_1.KeyCodeMap), { TAB_KEY: 9 });
|
46
28
|
class ChoicesWrapper extends choices_js_1.default {
|
47
29
|
constructor(...args) {
|
48
30
|
super(...args);
|
@@ -69,24 +51,13 @@ class ChoicesWrapper extends choices_js_1.default {
|
|
69
51
|
}
|
70
52
|
this._wasTap = true;
|
71
53
|
}
|
72
|
-
|
73
|
-
|
74
|
-
return super._handleButtonAction(activeItems, element);
|
75
|
-
}
|
76
|
-
if (!activeItems ||
|
77
|
-
!element ||
|
78
|
-
!this.config.removeItems ||
|
79
|
-
!this.config.removeItemButton) {
|
80
|
-
return;
|
81
|
-
}
|
82
|
-
super._handleButtonAction(activeItems, element);
|
83
|
-
}
|
84
|
-
_onEnterKey(args) {
|
54
|
+
_onEnterKey(...args) {
|
55
|
+
const [event] = args;
|
85
56
|
// Prevent dropdown form opening when removeItemButton was pressed using 'Enter' on keyboard
|
86
|
-
if (
|
57
|
+
if (event.target.className === 'choices__button') {
|
87
58
|
this.shouldOpenDropDown = false;
|
88
59
|
}
|
89
|
-
super._onEnterKey(args);
|
60
|
+
super._onEnterKey(...args);
|
90
61
|
}
|
91
62
|
_onDirectionKey(...args) {
|
92
63
|
if (!this._isSelectOneElement) {
|
@@ -100,17 +71,18 @@ class ChoicesWrapper extends choices_js_1.default {
|
|
100
71
|
this.isDirectionUsing = false;
|
101
72
|
}, 250);
|
102
73
|
}
|
103
|
-
_onTabKey(
|
104
|
-
if (
|
105
|
-
this._selectHighlightedChoice(
|
74
|
+
_onTabKey() {
|
75
|
+
if (this.dropdown.isActive) {
|
76
|
+
this._selectHighlightedChoice();
|
106
77
|
}
|
107
78
|
}
|
108
79
|
_selectHighlightedChoice() {
|
109
|
-
const highlightedChoice = this.dropdown.
|
80
|
+
const highlightedChoice = this.dropdown.element.querySelector(`.${this.config.classNames.highlightedState}`);
|
110
81
|
if (highlightedChoice) {
|
111
82
|
const id = highlightedChoice.dataset.id;
|
112
|
-
const choice = id && this._store.getChoiceById(id);
|
83
|
+
const choice = id && this._store.getChoiceById(Number(id));
|
113
84
|
this._addItem({
|
85
|
+
id: choice.id,
|
114
86
|
value: choice.value,
|
115
87
|
label: choice.label,
|
116
88
|
choiceId: choice.id,
|
@@ -121,61 +93,16 @@ class ChoicesWrapper extends choices_js_1.default {
|
|
121
93
|
});
|
122
94
|
this._triggerChange(choice.value);
|
123
95
|
}
|
124
|
-
event.preventDefault();
|
125
96
|
}
|
126
97
|
_onKeyDown(event) {
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
if (target !== this.input.element &&
|
132
|
-
!this.containerOuter.element.contains(target)) {
|
133
|
-
return;
|
134
|
-
}
|
135
|
-
const activeItems = this._store.activeItems;
|
136
|
-
const hasFocusedInput = this.input.isFocussed;
|
137
|
-
const hasActiveDropdown = this.dropdown.isActive;
|
138
|
-
const hasItems = this.itemList.hasChildren;
|
139
|
-
const keyString = String.fromCharCode(keyCode);
|
140
|
-
const { BACK_KEY, DELETE_KEY, TAB_KEY, ENTER_KEY, A_KEY, ESC_KEY, UP_KEY, DOWN_KEY, PAGE_UP_KEY, PAGE_DOWN_KEY, } = exports.KEY_CODES;
|
141
|
-
const hasCtrlDownKeyPressed = ctrlKey || metaKey;
|
142
|
-
// If a user is typing and the dropdown is not active
|
143
|
-
if (!hasActiveDropdown && !this._isTextElement && /[a-zA-Z0-9-_ ]/.test(keyString)) {
|
144
|
-
const currentValue = this.input.element.value;
|
145
|
-
this.input.element.value = currentValue ? `${currentValue}${keyString}` : keyString;
|
146
|
-
this.showDropdown();
|
147
|
-
}
|
148
|
-
// Map keys to key actions
|
149
|
-
const keyDownActions = {
|
150
|
-
[A_KEY]: this._onAKey,
|
151
|
-
[TAB_KEY]: this._onTabKey,
|
152
|
-
[ENTER_KEY]: this._onEnterKey,
|
153
|
-
[ESC_KEY]: this._onEscapeKey,
|
154
|
-
[UP_KEY]: this._onDirectionKey,
|
155
|
-
[PAGE_UP_KEY]: this._onDirectionKey,
|
156
|
-
[DOWN_KEY]: this._onDirectionKey,
|
157
|
-
[PAGE_DOWN_KEY]: this._onDirectionKey,
|
158
|
-
[DELETE_KEY]: this._onDeleteKey,
|
159
|
-
[BACK_KEY]: this._onDeleteKey,
|
160
|
-
};
|
161
|
-
// If keycode has a function, run it
|
162
|
-
if (keyDownActions[keyCode]) {
|
163
|
-
keyDownActions[keyCode]({
|
164
|
-
event,
|
165
|
-
target,
|
166
|
-
keyCode,
|
167
|
-
metaKey,
|
168
|
-
activeItems,
|
169
|
-
hasFocusedInput,
|
170
|
-
hasActiveDropdown,
|
171
|
-
hasItems,
|
172
|
-
hasCtrlDownKeyPressed,
|
173
|
-
});
|
174
|
-
}
|
98
|
+
const keyCode = event.keyCode;
|
99
|
+
return this._isSelectOneElement && keyCode === ExtendedKeyCodeMap.TAB_KEY
|
100
|
+
? this._onTabKey()
|
101
|
+
: super._onKeyDown(event);
|
175
102
|
}
|
176
|
-
onSelectValue(
|
103
|
+
onSelectValue(event, hasActiveDropdown) {
|
177
104
|
if (hasActiveDropdown) {
|
178
|
-
this._selectHighlightedChoice(
|
105
|
+
this._selectHighlightedChoice();
|
179
106
|
}
|
180
107
|
else if (this._isSelectOneElement) {
|
181
108
|
this.showDropdown();
|
@@ -183,11 +110,13 @@ class ChoicesWrapper extends choices_js_1.default {
|
|
183
110
|
}
|
184
111
|
}
|
185
112
|
showDropdown(...args) {
|
186
|
-
|
187
|
-
this.shouldOpenDropDown
|
188
|
-
|
189
|
-
|
190
|
-
|
113
|
+
setTimeout(() => {
|
114
|
+
if (!this.shouldOpenDropDown) {
|
115
|
+
this.shouldOpenDropDown = true;
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
super.showDropdown(...args);
|
119
|
+
}, 0);
|
191
120
|
}
|
192
121
|
hideDropdown(...args) {
|
193
122
|
if (this.isDirectionUsing) {
|
@@ -195,11 +124,5 @@ class ChoicesWrapper extends choices_js_1.default {
|
|
195
124
|
}
|
196
125
|
super.hideDropdown(...args);
|
197
126
|
}
|
198
|
-
_onBlur(...args) {
|
199
|
-
if (this._isScrollingOnIe) {
|
200
|
-
return;
|
201
|
-
}
|
202
|
-
super._onBlur(...args);
|
203
|
-
}
|
204
127
|
}
|
205
128
|
exports.default = ChoicesWrapper;
|
@@ -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:
|
30
|
-
export const eachComponentData: (components:
|
29
|
+
export const eachComponentDataAsync: (components: Component[], data: DataObject, fn: EachComponentDataAsyncCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: any, parentPaths?: any) => Promise<void>;
|
30
|
+
export const eachComponentData: (components: Component[], data: DataObject, fn: EachComponentDataCallback, includeAll?: boolean | undefined, local?: boolean | undefined, parent?: any, parentPaths?: any) => 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/cjs/utils/i18n.d.ts
CHANGED
@@ -2,13 +2,16 @@
|
|
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
|
currentLanguage: any;
|
11
|
-
setLanguages(languages: any): void;
|
14
|
+
setLanguages(languages: any, noDefaultOverride: any): void;
|
12
15
|
dir(lang?: string): "rtl" | "ltr";
|
13
16
|
changeLanguage(language: any, ready?: null): void;
|
14
17
|
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 utils_1 = require("@formio/core/utils");
|
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,13 +19,28 @@ 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.currentLanguage = i18Defaults.en;
|
23
27
|
this.setLanguages(languages);
|
24
28
|
this.changeLanguage(this.language);
|
25
29
|
}
|
26
|
-
|
30
|
+
static setDefaultTranslations(languages) {
|
31
|
+
if ((0, lodash_1.isEmpty)(languages)) {
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
for (const lang in languages) {
|
35
|
+
if (lang !== 'language' && languages.hasOwnProperty(lang)) {
|
36
|
+
if (!this.languages[lang]) {
|
37
|
+
this.languages[lang] = {};
|
38
|
+
}
|
39
|
+
this.languages[lang] = Object.assign(Object.assign({}, languages[lang]), this.languages[lang]);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
setLanguages(languages, noDefaultOverride) {
|
27
44
|
if (languages.resources) {
|
28
45
|
for (const lang in languages.resources) {
|
29
46
|
if (languages.resources.hasOwnProperty(lang)) {
|
@@ -50,7 +67,8 @@ class I18n {
|
|
50
67
|
if (!this.languages[lang]) {
|
51
68
|
this.languages[lang] = {};
|
52
69
|
}
|
53
|
-
this.languages[lang] =
|
70
|
+
this.languages[lang] = noDefaultOverride
|
71
|
+
? Object.assign(Object.assign({}, languages[lang]), this.languages[lang]) : Object.assign(Object.assign({}, this.languages[lang]), languages[lang]);
|
54
72
|
}
|
55
73
|
}
|
56
74
|
}
|
@@ -80,14 +98,23 @@ class I18n {
|
|
80
98
|
}
|
81
99
|
t(text, ...args) {
|
82
100
|
var _a;
|
83
|
-
|
101
|
+
let currentTranslation = this.currentLanguage[text];
|
102
|
+
// provide compatibility with cases where the entire phrase is used as a key
|
103
|
+
// get the phrase that is possibly being used as a key
|
104
|
+
const defaultKey = this.defaultKeys[text];
|
105
|
+
if (defaultKey && this.currentLanguage[defaultKey]) {
|
106
|
+
// get translation using the phrase as a key
|
107
|
+
currentTranslation = this.currentLanguage[defaultKey];
|
108
|
+
}
|
109
|
+
if (currentTranslation) {
|
84
110
|
const customTranslationFieldName = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.field;
|
85
111
|
if (customTranslationFieldName && this.currentLanguage[customTranslationFieldName]) {
|
86
112
|
args[0].field = this.currentLanguage[customTranslationFieldName];
|
87
113
|
}
|
88
|
-
return utils_1.Evaluator.interpolateString(
|
114
|
+
return utils_1.Evaluator.interpolateString(currentTranslation, ...args);
|
89
115
|
}
|
90
116
|
return utils_1.Evaluator.interpolateString(text, ...args);
|
91
117
|
}
|
92
118
|
}
|
93
119
|
exports.I18n = I18n;
|
120
|
+
I18n.languages = i18Defaults;
|
@@ -93,8 +93,6 @@ class CalendarWidget extends InputWidget_1.default {
|
|
93
93
|
this.settings.disableWeekends ? this.settings.disable.push(this.disableWeekends) : '';
|
94
94
|
this.settings.disableWeekdays ? this.settings.disable.push(this.disableWeekdays) : '';
|
95
95
|
this.settings.disableFunction ? this.settings.disable.push(this.disableFunction) : '';
|
96
|
-
this.settings.wasDefaultValueChanged = false;
|
97
|
-
this.settings.defaultValue = '';
|
98
96
|
this.settings.manualInputValue = '';
|
99
97
|
this.settings.isManuallyOverriddenValue = false;
|
100
98
|
this.settings.currentValue = '';
|
@@ -102,14 +100,8 @@ class CalendarWidget extends InputWidget_1.default {
|
|
102
100
|
this.settings.dateFormat = (0, utils_1.convertFormatToFlatpickr)(this.settings.dateFormat);
|
103
101
|
this.settings.position = 'auto center';
|
104
102
|
this.settings.onChange = () => {
|
105
|
-
if (this.settings.allowInput) {
|
106
|
-
|
107
|
-
this.calendar._input.value = this.settings.manualInputValue;
|
108
|
-
}
|
109
|
-
else {
|
110
|
-
this.settings.manualInputValue = '';
|
111
|
-
}
|
112
|
-
this.settings.isManuallyOverriddenValue = false;
|
103
|
+
if (this.settings.allowInput && this.settings.enableTime) {
|
104
|
+
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
113
105
|
}
|
114
106
|
this.emit('update');
|
115
107
|
};
|
@@ -118,20 +110,15 @@ class CalendarWidget extends InputWidget_1.default {
|
|
118
110
|
this.hook('onCalendarClose');
|
119
111
|
this.closedOn = Date.now();
|
120
112
|
if (this.settings.allowInput && this.settings.enableTime) {
|
121
|
-
this.calendar._input.value = this.settings.manualInputValue
|
122
|
-
this.settings.isManuallyOverriddenValue = false;
|
113
|
+
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
123
114
|
this.emit('update');
|
124
115
|
}
|
125
|
-
if (this.settings.wasDefaultValueChanged) {
|
126
|
-
this.calendar._input.value = this.settings.defaultValue;
|
127
|
-
this.settings.wasDefaultValueChanged = false;
|
128
|
-
}
|
129
116
|
if (this.calendar) {
|
130
117
|
this.emit('blur');
|
131
118
|
}
|
132
119
|
};
|
133
120
|
Formio_1.Formio.requireLibrary('flatpickr-css', 'flatpickr', [
|
134
|
-
{ type: 'styles', src: `${Formio_1.Formio.cdn['flatpickr
|
121
|
+
{ type: 'styles', src: `${Formio_1.Formio.cdn['flatpickr']}/flatpickr.min.css` }
|
135
122
|
], true);
|
136
123
|
if (this.component.shortcutButtons) {
|
137
124
|
this.component.shortcutButtons = this.component.shortcutButtons.filter((btn) => btn.label && btn.onClick);
|
@@ -149,7 +136,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
149
136
|
}
|
150
137
|
})
|
151
138
|
.then((ShortcutButtonsPlugin) => {
|
152
|
-
return Formio_1.Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio_1.Formio.cdn['flatpickr
|
139
|
+
return Formio_1.Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio_1.Formio.cdn['flatpickr']}/flatpickr.min.js`, true)
|
153
140
|
.then((Flatpickr) => {
|
154
141
|
var _a;
|
155
142
|
if (((_a = this.component.shortcutButtons) === null || _a === void 0 ? void 0 : _a.length) && ShortcutButtonsPlugin) {
|
@@ -159,7 +146,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
159
146
|
if (this._input) {
|
160
147
|
const { locale } = this.settings;
|
161
148
|
if (locale && locale.length >= 2 && locale !== 'en') {
|
162
|
-
return Formio_1.Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr
|
149
|
+
return Formio_1.Formio.requireLibrary(`flatpickr-${locale}`, `flatpickr.l10ns.${locale}`, `${Formio_1.Formio.cdn['flatpickr']}/l10n/${locale}.js`, true).then(() => this.initFlatpickr(Flatpickr));
|
163
150
|
}
|
164
151
|
else {
|
165
152
|
this.initFlatpickr(Flatpickr);
|
@@ -358,19 +345,28 @@ class CalendarWidget extends InputWidget_1.default {
|
|
358
345
|
this.calendar = new Flatpickr(this._input, Object.assign(Object.assign({}, this.settings), { disableMobile: true }));
|
359
346
|
this.addEventListener(this.calendar.altInput, 'input', (event) => {
|
360
347
|
if (this.settings.allowInput && this.settings.currentValue !== event.target.value) {
|
348
|
+
if (event.target.mask) {
|
349
|
+
event.target.mask.textMaskInputElement.update();
|
350
|
+
}
|
361
351
|
this.settings.manualInputValue = event.target.value;
|
352
|
+
this._input.value = this.settings.manualInputValue;
|
362
353
|
this.settings.isManuallyOverriddenValue = true;
|
363
354
|
this.settings.currentValue = event.target.value;
|
364
|
-
|
365
|
-
if (event.target.value === '' && this.calendar.selectedDates.length > 0) {
|
366
|
-
this.settings.wasDefaultValueChanged = true;
|
367
|
-
this.settings.defaultValue = event.target.value;
|
368
|
-
this.calendar.clear();
|
369
|
-
}
|
370
|
-
else {
|
371
|
-
this.settings.wasDefaultValueChanged = false;
|
355
|
+
this.emit('update');
|
372
356
|
}
|
373
357
|
});
|
358
|
+
if (this.calendar.daysContainer) {
|
359
|
+
this.calendar.daysContainer.addEventListener('click', () => {
|
360
|
+
this.settings.isManuallyOverriddenValue = false;
|
361
|
+
this.calendar.updateValue(false);
|
362
|
+
});
|
363
|
+
}
|
364
|
+
if (this.calendar.timeContainer) {
|
365
|
+
this.calendar.timeContainer.addEventListener('click', () => {
|
366
|
+
this.settings.isManuallyOverriddenValue = false;
|
367
|
+
this.calendar.updateValue(false);
|
368
|
+
});
|
369
|
+
}
|
374
370
|
const excludedFromMaskFormats = ['MMMM'];
|
375
371
|
if (!this.settings.readOnly && !lodash_1.default.some(excludedFromMaskFormats, format => lodash_1.default.includes(this.settings.format, format))) {
|
376
372
|
// Enforce the input mask of the format.
|
@@ -397,6 +393,10 @@ class CalendarWidget extends InputWidget_1.default {
|
|
397
393
|
// Make sure we commit the value after a blur event occurs.
|
398
394
|
this.addEventListener(this.calendar._input, 'blur', (event) => {
|
399
395
|
var _a, _b, _c, _d;
|
396
|
+
// If we have manually overridden the value then we shouldn't call setDate because this will fill the input mask
|
397
|
+
if (this.settings.isManuallyOverriddenValue) {
|
398
|
+
return;
|
399
|
+
}
|
400
400
|
const activeElement = this.settings.shadowRoot ? this.settings.shadowRoot.activeElement : document.activeElement;
|
401
401
|
const relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;
|
402
402
|
if (!(isIEBrowser && !relatedTarget) && !this.isCalendarElement(relatedTarget)) {
|
package/lib/mjs/CDN.d.ts
CHANGED
package/lib/mjs/CDN.js
CHANGED
@@ -16,8 +16,8 @@ class CDN {
|
|
16
16
|
'bootswatch': '5.3.3',
|
17
17
|
'bootstrap-icons': '1.11.1',
|
18
18
|
'ckeditor': '19.0.0',
|
19
|
-
'
|
20
|
-
'flatpickr
|
19
|
+
'dragula': '3.7.3',
|
20
|
+
'flatpickr': '4.6.13',
|
21
21
|
'font-awesome': '4.7.0',
|
22
22
|
'grid': 'latest',
|
23
23
|
'moment-timezone': 'latest',
|
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.1.0-
|
17
|
+
static version = '5.1.0-dev.2';
|
18
18
|
static setLicense(license, norecurse = false) {
|
19
19
|
Formio.license = license;
|
20
20
|
if (!norecurse && Formio.FormioClass) {
|