@formio/js 5.2.4-rc.0 → 5.2.5
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 +50 -161
- 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 +49 -158
- package/dist/formio.form.js +108 -152
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.css +50 -161
- package/dist/formio.full.js +227 -401
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +18 -51
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +14 -47
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/CDN.js +12 -12
- package/lib/cjs/Element.d.ts +2 -3
- package/lib/cjs/Element.js +26 -29
- package/lib/cjs/Embed.js +42 -75
- package/lib/cjs/EventEmitter.js +1 -1
- package/lib/cjs/Form.d.ts +341 -371
- package/lib/cjs/Form.js +39 -153
- package/lib/cjs/FormBuilder.d.ts +3 -3
- package/lib/cjs/FormBuilder.js +3 -2
- package/lib/cjs/Formio.js +23 -26
- package/lib/cjs/InlineEmbed.js +17 -23
- package/lib/cjs/PDF.d.ts +0 -1
- package/lib/cjs/PDF.js +15 -18
- package/lib/cjs/PDFBuilder.js +36 -51
- package/lib/cjs/Webform.d.ts +366 -8
- package/lib/cjs/Webform.js +238 -177
- package/lib/cjs/WebformBuilder.js +152 -221
- package/lib/cjs/Wizard.js +65 -95
- package/lib/cjs/WizardBuilder.js +19 -27
- package/lib/cjs/addons/FormioAddon.js +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +57 -59
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +16 -24
- package/lib/cjs/addons/index.js +3 -3
- package/lib/cjs/components/Components.js +4 -0
- package/lib/cjs/components/_classes/component/Component.form.js +11 -11
- package/lib/cjs/components/_classes/component/Component.js +198 -309
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +4 -2
- package/lib/cjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +11 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +0 -37
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +25 -39
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +29 -47
- package/lib/cjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +7 -5
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +34 -37
- package/lib/cjs/components/_classes/component/editForm/utils.js +16 -12
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +6 -6
- package/lib/cjs/components/_classes/field/Field.js +1 -7
- package/lib/cjs/components/_classes/input/Input.js +26 -30
- package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +18 -27
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +9 -36
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +13 -32
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +1 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.js +75 -67
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +14 -19
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +17 -19
- package/lib/cjs/components/address/Address.d.ts +0 -1
- package/lib/cjs/components/address/Address.js +52 -57
- package/lib/cjs/components/address/editForm/Address.edit.data.js +2 -2
- package/lib/cjs/components/address/editForm/Address.edit.display.js +2 -2
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +11 -53
- package/lib/cjs/components/alert/Alert.js +15 -21
- package/lib/cjs/components/button/Button.form.js +1 -1
- package/lib/cjs/components/button/Button.js +47 -64
- package/lib/cjs/components/button/editForm/Button.edit.display.js +9 -49
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.form.js +3 -3
- package/lib/cjs/components/checkbox/Checkbox.js +20 -28
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +3 -13
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
- package/lib/cjs/components/columns/Columns.form.js +1 -1
- package/lib/cjs/components/columns/Columns.js +12 -24
- package/lib/cjs/components/columns/editForm/Columns.edit.display.js +17 -17
- package/lib/cjs/components/container/Container.form.js +2 -2
- package/lib/cjs/components/container/Container.js +4 -6
- package/lib/cjs/components/container/editForm/Container.edit.data.js +3 -3
- package/lib/cjs/components/container/editForm/Container.edit.display.js +4 -4
- package/lib/cjs/components/content/Content.form.js +2 -4
- package/lib/cjs/components/content/Content.js +8 -10
- package/lib/cjs/components/content/editForm/Content.edit.display.js +10 -10
- package/lib/cjs/components/currency/Currency.form.js +3 -3
- package/lib/cjs/components/currency/Currency.js +10 -19
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +5 -5
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +8 -8
- package/lib/cjs/components/datagrid/DataGrid.form.js +3 -3
- package/lib/cjs/components/datagrid/DataGrid.js +42 -92
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
- package/lib/cjs/components/datamap/DataMap.form.js +2 -2
- package/lib/cjs/components/datamap/DataMap.js +35 -46
- package/lib/cjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
- package/lib/cjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
- package/lib/cjs/components/datetime/DateTime.form.js +5 -5
- package/lib/cjs/components/datetime/DateTime.js +15 -30
- package/lib/cjs/components/datetime/editForm/DateTime.edit.data.js +3 -4
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +17 -22
- package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
- package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
- package/lib/cjs/components/day/Day.form.js +5 -5
- package/lib/cjs/components/day/Day.js +58 -147
- package/lib/cjs/components/day/editForm/Day.edit.day.js +9 -13
- package/lib/cjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.month.js +8 -12
- package/lib/cjs/components/day/editForm/Day.edit.validation.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.year.js +8 -8
- package/lib/cjs/components/editgrid/EditGrid.form.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.js +96 -142
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -7
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
- package/lib/cjs/components/email/Email.js +4 -4
- package/lib/cjs/components/email/editForm/Email.edit.display.js +3 -3
- package/lib/cjs/components/email/editForm/Email.edit.validation.js +6 -6
- package/lib/cjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/cjs/components/fieldset/Fieldset.js +2 -2
- package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
- package/lib/cjs/components/file/File.form.js +4 -4
- package/lib/cjs/components/file/File.js +90 -131
- package/lib/cjs/components/file/editForm/File.edit.display.js +5 -9
- package/lib/cjs/components/file/editForm/File.edit.file.js +53 -97
- package/lib/cjs/components/file/editForm/File.edit.validation.js +2 -2
- package/lib/cjs/components/form/Form.form.js +3 -3
- package/lib/cjs/components/form/Form.js +58 -68
- package/lib/cjs/components/form/editForm/Form.edit.data.js +3 -1
- package/lib/cjs/components/form/editForm/Form.edit.display.js +7 -6
- package/lib/cjs/components/form/editForm/Form.edit.form.js +9 -11
- package/lib/cjs/components/hidden/Hidden.form.js +4 -4
- package/lib/cjs/components/hidden/Hidden.js +2 -2
- package/lib/cjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
- package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
- package/lib/cjs/components/html/HTML.js +17 -23
- package/lib/cjs/components/html/editForm/HTML.edit.display.js +17 -17
- package/lib/cjs/components/html/editForm/HTML.edit.logic.js +2 -2
- package/lib/cjs/components/number/Number.form.js +3 -3
- package/lib/cjs/components/number/Number.js +11 -27
- package/lib/cjs/components/number/editForm/Number.edit.data.js +3 -3
- package/lib/cjs/components/number/editForm/Number.edit.display.js +4 -4
- package/lib/cjs/components/number/editForm/Number.edit.validation.js +9 -9
- package/lib/cjs/components/panel/Panel.form.js +1 -1
- package/lib/cjs/components/panel/Panel.js +2 -2
- package/lib/cjs/components/panel/editForm/Panel.edit.conditional.js +7 -5
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +29 -55
- package/lib/cjs/components/password/Password.form.js +3 -3
- package/lib/cjs/components/password/Password.js +2 -5
- package/lib/cjs/components/password/editForm/Password.edit.data.js +11 -11
- package/lib/cjs/components/password/editForm/Password.edit.display.js +3 -3
- package/lib/cjs/components/password/editForm/Password.edit.validation.js +3 -3
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +8 -8
- package/lib/cjs/components/phonenumber/PhoneNumber.js +3 -3
- package/lib/cjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
- package/lib/cjs/components/radio/Radio.form.js +3 -3
- package/lib/cjs/components/radio/Radio.js +32 -58
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +9 -23
- package/lib/cjs/components/radio/editForm/Radio.edit.display.js +6 -6
- package/lib/cjs/components/radio/editForm/Radio.edit.validation.js +2 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -5
- package/lib/cjs/components/recaptcha/ReCaptcha.js +10 -10
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
- package/lib/cjs/components/select/Select.form.js +3 -3
- package/lib/cjs/components/select/Select.js +140 -235
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +57 -191
- package/lib/cjs/components/select/editForm/Select.edit.display.js +2 -2
- package/lib/cjs/components/select/editForm/Select.edit.validation.js +4 -4
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +3 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.js +16 -29
- package/lib/cjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
- package/lib/cjs/components/signature/Signature.form.js +3 -3
- package/lib/cjs/components/signature/Signature.js +17 -26
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +10 -19
- package/lib/cjs/components/survey/Survey.form.js +3 -3
- package/lib/cjs/components/survey/Survey.js +17 -30
- package/lib/cjs/components/survey/editForm/Survey.edit.data.js +11 -23
- package/lib/cjs/components/survey/editForm/Survey.edit.display.js +1 -1
- package/lib/cjs/components/survey/editForm/Survey.edit.validation.js +1 -1
- package/lib/cjs/components/table/Table.form.js +1 -1
- package/lib/cjs/components/table/Table.js +7 -8
- package/lib/cjs/components/table/editForm/Table.edit.display.js +22 -22
- package/lib/cjs/components/tabs/Tabs.form.js +1 -1
- package/lib/cjs/components/tabs/Tabs.js +10 -27
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +17 -21
- package/lib/cjs/components/tags/Tags.form.js +1 -1
- package/lib/cjs/components/tags/Tags.js +12 -28
- package/lib/cjs/components/tags/editForm/Tags.edit.data.js +7 -7
- package/lib/cjs/components/textarea/TextArea.form.js +2 -2
- package/lib/cjs/components/textarea/TextArea.js +45 -63
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +72 -96
- package/lib/cjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
- package/lib/cjs/components/textfield/TextField.form.js +3 -3
- package/lib/cjs/components/textfield/TextField.js +21 -32
- package/lib/cjs/components/textfield/editForm/TextField.edit.data.js +13 -15
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +21 -31
- package/lib/cjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/cjs/components/time/Time.js +10 -17
- package/lib/cjs/components/time/editForm/Time.edit.display.js +2 -2
- package/lib/cjs/components/unknown/Unknown.form.js +5 -5
- package/lib/cjs/components/unknown/Unknown.js +2 -2
- package/lib/cjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
- package/lib/cjs/components/url/Url.form.js +3 -3
- package/lib/cjs/components/url/Url.js +2 -2
- package/lib/cjs/components/url/editForm/Url.edit.display.js +3 -3
- package/lib/cjs/components/url/editForm/Url.edit.validation.js +1 -1
- package/lib/cjs/components/well/Well.form.js +1 -1
- package/lib/cjs/components/well/Well.js +2 -2
- package/lib/cjs/components/well/editForm/Well.edit.display.js +10 -10
- package/lib/cjs/formio.form.d.ts +1 -2
- package/lib/cjs/formio.form.js +12 -38
- package/lib/cjs/i18n.d.ts +0 -4
- package/lib/cjs/i18n.js +3 -7
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/pdf.image.d.ts +2 -0
- package/lib/cjs/pdf.image.js +94 -0
- package/lib/cjs/providers/address/AddressProvider.js +5 -8
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/cjs/providers/address/GoogleAddressProvider.js +13 -24
- package/lib/cjs/providers/processor/fileProcessor.js +1 -3
- package/lib/cjs/providers/storage/azure.js +2 -5
- package/lib/cjs/providers/storage/dropbox.js +5 -4
- package/lib/cjs/providers/storage/googleDrive.js +4 -3
- package/lib/cjs/providers/storage/index.js +1 -1
- package/lib/cjs/providers/storage/indexeddb.js +6 -16
- package/lib/cjs/providers/storage/s3.js +6 -17
- package/lib/cjs/providers/storage/uploadAdapter.js +11 -17
- package/lib/cjs/providers/storage/url.js +11 -13
- package/lib/cjs/providers/storage/xhr.js +9 -17
- package/lib/cjs/templates/index.js +1 -1
- package/lib/cjs/translations/en.d.ts +2 -0
- package/lib/cjs/translations/en.js +9 -7
- package/lib/cjs/utils/ChoicesWrapper.js +2 -2
- package/lib/cjs/utils/builder.js +7 -31
- package/lib/cjs/utils/calendarUtils.js +5 -7
- package/lib/cjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +4 -12
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +1 -3
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +6 -10
- package/lib/cjs/utils/conditionOperators/index.js +1 -1
- package/lib/cjs/utils/formUtils.js +1 -1
- package/lib/cjs/utils/i18n.js +1 -7
- package/lib/cjs/utils/index.d.ts +1 -2
- package/lib/cjs/utils/index.js +2 -2
- package/lib/cjs/utils/jsonlogic/operators.d.ts +1 -0
- package/lib/cjs/utils/jsonlogic/operators.js +265 -0
- package/lib/cjs/utils/utils.d.ts +1 -10
- package/lib/cjs/utils/utils.js +92 -175
- package/lib/cjs/widgets/CalendarWidget.js +49 -66
- package/lib/cjs/widgets/InputWidget.js +4 -6
- package/lib/cjs/widgets/index.js +1 -1
- package/lib/mjs/CDN.js +12 -12
- package/lib/mjs/Element.d.ts +2 -3
- package/lib/mjs/Element.js +23 -29
- package/lib/mjs/Embed.js +43 -77
- package/lib/mjs/EventEmitter.js +1 -1
- package/lib/mjs/Form.d.ts +341 -371
- package/lib/mjs/Form.js +126 -142
- package/lib/mjs/FormBuilder.d.ts +3 -3
- package/lib/mjs/FormBuilder.js +3 -2
- package/lib/mjs/Formio.js +23 -26
- package/lib/mjs/InlineEmbed.js +17 -23
- package/lib/mjs/PDF.d.ts +0 -1
- package/lib/mjs/PDF.js +15 -18
- package/lib/mjs/PDFBuilder.js +36 -51
- package/lib/mjs/Webform.d.ts +366 -8
- package/lib/mjs/Webform.js +251 -184
- package/lib/mjs/WebformBuilder.js +151 -224
- package/lib/mjs/Wizard.js +64 -94
- package/lib/mjs/WizardBuilder.js +19 -27
- package/lib/mjs/addons/FormioAddon.js +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +57 -59
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +16 -24
- package/lib/mjs/addons/index.js +3 -3
- package/lib/mjs/components/Components.js +4 -0
- package/lib/mjs/components/_classes/component/Component.form.js +11 -11
- package/lib/mjs/components/_classes/component/Component.js +194 -313
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +4 -2
- package/lib/mjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +11 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +0 -37
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +25 -39
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +29 -47
- package/lib/mjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +7 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +34 -37
- package/lib/mjs/components/_classes/component/editForm/utils.js +16 -12
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +2 -2
- package/lib/mjs/components/_classes/field/Field.js +2 -8
- package/lib/mjs/components/_classes/input/Input.js +23 -27
- package/lib/mjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +18 -27
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +9 -36
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +13 -32
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +1 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.js +33 -41
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +15 -20
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +17 -19
- package/lib/mjs/components/address/Address.d.ts +0 -1
- package/lib/mjs/components/address/Address.js +49 -60
- package/lib/mjs/components/address/editForm/Address.edit.data.js +2 -2
- package/lib/mjs/components/address/editForm/Address.edit.display.js +2 -2
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +11 -53
- package/lib/mjs/components/alert/Alert.js +16 -22
- package/lib/mjs/components/button/Button.form.js +1 -1
- package/lib/mjs/components/button/Button.js +42 -65
- package/lib/mjs/components/button/editForm/Button.edit.display.js +9 -49
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.form.js +3 -3
- package/lib/mjs/components/checkbox/Checkbox.js +21 -29
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +3 -13
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
- package/lib/mjs/components/columns/Columns.form.js +1 -1
- package/lib/mjs/components/columns/Columns.js +12 -24
- package/lib/mjs/components/columns/editForm/Columns.edit.display.js +17 -17
- package/lib/mjs/components/container/Container.form.js +2 -2
- package/lib/mjs/components/container/Container.js +4 -6
- package/lib/mjs/components/container/editForm/Container.edit.data.js +3 -3
- package/lib/mjs/components/container/editForm/Container.edit.display.js +4 -4
- package/lib/mjs/components/content/Content.form.js +2 -4
- package/lib/mjs/components/content/Content.js +8 -10
- package/lib/mjs/components/content/editForm/Content.edit.display.js +10 -10
- package/lib/mjs/components/currency/Currency.form.js +3 -3
- package/lib/mjs/components/currency/Currency.js +10 -19
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +5 -5
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +8 -8
- package/lib/mjs/components/datagrid/DataGrid.form.js +3 -3
- package/lib/mjs/components/datagrid/DataGrid.js +41 -92
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
- package/lib/mjs/components/datamap/DataMap.form.js +2 -2
- package/lib/mjs/components/datamap/DataMap.js +33 -46
- package/lib/mjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
- package/lib/mjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
- package/lib/mjs/components/datetime/DateTime.form.js +5 -5
- package/lib/mjs/components/datetime/DateTime.js +16 -31
- package/lib/mjs/components/datetime/editForm/DateTime.edit.data.js +3 -4
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +17 -22
- package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
- package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
- package/lib/mjs/components/day/Day.form.js +5 -5
- package/lib/mjs/components/day/Day.js +58 -148
- package/lib/mjs/components/day/editForm/Day.edit.day.js +9 -13
- package/lib/mjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.month.js +8 -12
- package/lib/mjs/components/day/editForm/Day.edit.validation.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.year.js +8 -8
- package/lib/mjs/components/editgrid/EditGrid.form.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.js +92 -140
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -7
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
- package/lib/mjs/components/email/Email.js +4 -4
- package/lib/mjs/components/email/editForm/Email.edit.display.js +3 -3
- package/lib/mjs/components/email/editForm/Email.edit.validation.js +6 -6
- package/lib/mjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/mjs/components/fieldset/Fieldset.js +2 -2
- package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
- package/lib/mjs/components/file/File.form.js +4 -4
- package/lib/mjs/components/file/File.js +89 -136
- package/lib/mjs/components/file/editForm/File.edit.display.js +5 -9
- package/lib/mjs/components/file/editForm/File.edit.file.js +53 -97
- package/lib/mjs/components/file/editForm/File.edit.validation.js +2 -2
- package/lib/mjs/components/form/Form.form.js +3 -3
- package/lib/mjs/components/form/Form.js +55 -68
- package/lib/mjs/components/form/editForm/Form.edit.data.js +3 -1
- package/lib/mjs/components/form/editForm/Form.edit.display.js +7 -6
- package/lib/mjs/components/form/editForm/Form.edit.form.js +8 -10
- package/lib/mjs/components/hidden/Hidden.form.js +4 -4
- package/lib/mjs/components/hidden/Hidden.js +2 -2
- package/lib/mjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
- package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
- package/lib/mjs/components/html/HTML.js +17 -23
- package/lib/mjs/components/html/editForm/HTML.edit.display.js +17 -17
- package/lib/mjs/components/html/editForm/HTML.edit.logic.js +2 -2
- package/lib/mjs/components/number/Number.form.js +3 -3
- package/lib/mjs/components/number/Number.js +12 -28
- package/lib/mjs/components/number/editForm/Number.edit.data.js +3 -3
- package/lib/mjs/components/number/editForm/Number.edit.display.js +4 -4
- package/lib/mjs/components/number/editForm/Number.edit.validation.js +9 -9
- package/lib/mjs/components/panel/Panel.form.js +1 -1
- package/lib/mjs/components/panel/Panel.js +2 -2
- package/lib/mjs/components/panel/editForm/Panel.edit.conditional.js +8 -6
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +29 -55
- package/lib/mjs/components/password/Password.form.js +3 -3
- package/lib/mjs/components/password/Password.js +2 -5
- package/lib/mjs/components/password/editForm/Password.edit.data.js +11 -11
- package/lib/mjs/components/password/editForm/Password.edit.display.js +3 -3
- package/lib/mjs/components/password/editForm/Password.edit.validation.js +3 -3
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +8 -8
- package/lib/mjs/components/phonenumber/PhoneNumber.js +3 -3
- package/lib/mjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
- package/lib/mjs/components/radio/Radio.form.js +3 -3
- package/lib/mjs/components/radio/Radio.js +30 -59
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +9 -23
- package/lib/mjs/components/radio/editForm/Radio.edit.display.js +6 -6
- package/lib/mjs/components/radio/editForm/Radio.edit.validation.js +2 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -5
- package/lib/mjs/components/recaptcha/ReCaptcha.js +8 -10
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
- package/lib/mjs/components/select/Select.form.js +3 -3
- package/lib/mjs/components/select/Select.js +145 -240
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +57 -191
- package/lib/mjs/components/select/editForm/Select.edit.display.js +2 -2
- package/lib/mjs/components/select/editForm/Select.edit.validation.js +4 -4
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +3 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -30
- package/lib/mjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
- package/lib/mjs/components/signature/Signature.form.js +3 -3
- package/lib/mjs/components/signature/Signature.js +16 -26
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +10 -19
- package/lib/mjs/components/survey/Survey.form.js +3 -3
- package/lib/mjs/components/survey/Survey.js +17 -30
- package/lib/mjs/components/survey/editForm/Survey.edit.data.js +11 -23
- package/lib/mjs/components/survey/editForm/Survey.edit.display.js +1 -1
- package/lib/mjs/components/survey/editForm/Survey.edit.validation.js +1 -1
- package/lib/mjs/components/table/Table.form.js +1 -1
- package/lib/mjs/components/table/Table.js +6 -8
- package/lib/mjs/components/table/editForm/Table.edit.display.js +22 -22
- package/lib/mjs/components/tabs/Tabs.form.js +1 -1
- package/lib/mjs/components/tabs/Tabs.js +9 -27
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +17 -21
- package/lib/mjs/components/tags/Tags.form.js +1 -1
- package/lib/mjs/components/tags/Tags.js +12 -28
- package/lib/mjs/components/tags/editForm/Tags.edit.data.js +7 -7
- package/lib/mjs/components/textarea/TextArea.form.js +2 -2
- package/lib/mjs/components/textarea/TextArea.js +51 -75
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +72 -96
- package/lib/mjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
- package/lib/mjs/components/textfield/TextField.form.js +3 -3
- package/lib/mjs/components/textfield/TextField.js +23 -34
- package/lib/mjs/components/textfield/editForm/TextField.edit.data.js +13 -15
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +21 -31
- package/lib/mjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/mjs/components/time/Time.js +10 -17
- package/lib/mjs/components/time/editForm/Time.edit.display.js +2 -2
- package/lib/mjs/components/unknown/Unknown.form.js +5 -5
- package/lib/mjs/components/unknown/Unknown.js +2 -2
- package/lib/mjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
- package/lib/mjs/components/url/Url.form.js +3 -3
- package/lib/mjs/components/url/Url.js +2 -2
- package/lib/mjs/components/url/editForm/Url.edit.display.js +3 -3
- package/lib/mjs/components/url/editForm/Url.edit.validation.js +1 -1
- package/lib/mjs/components/well/Well.form.js +1 -1
- package/lib/mjs/components/well/Well.js +2 -2
- package/lib/mjs/components/well/editForm/Well.edit.display.js +10 -10
- package/lib/mjs/formio.form.d.ts +1 -2
- package/lib/mjs/formio.form.js +8 -10
- package/lib/mjs/i18n.d.ts +0 -4
- package/lib/mjs/i18n.js +3 -7
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/pdf.image.d.ts +2 -0
- package/lib/mjs/pdf.image.js +94 -0
- package/lib/mjs/providers/address/AddressProvider.js +5 -8
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/mjs/providers/address/GoogleAddressProvider.js +13 -24
- package/lib/mjs/providers/processor/fileProcessor.js +1 -3
- package/lib/mjs/providers/storage/azure.js +2 -5
- package/lib/mjs/providers/storage/dropbox.js +5 -4
- package/lib/mjs/providers/storage/googleDrive.js +4 -3
- package/lib/mjs/providers/storage/index.js +1 -1
- package/lib/mjs/providers/storage/indexeddb.js +6 -16
- package/lib/mjs/providers/storage/s3.js +8 -19
- package/lib/mjs/providers/storage/uploadAdapter.js +11 -17
- package/lib/mjs/providers/storage/url.js +11 -13
- package/lib/mjs/providers/storage/xhr.js +9 -17
- package/lib/mjs/templates/index.js +1 -1
- package/lib/mjs/translations/en.d.ts +2 -0
- package/lib/mjs/translations/en.js +9 -7
- package/lib/mjs/utils/ChoicesWrapper.js +2 -2
- package/lib/mjs/utils/builder.js +7 -31
- package/lib/mjs/utils/calendarUtils.js +5 -7
- package/lib/mjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +5 -16
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +1 -3
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +6 -10
- package/lib/mjs/utils/conditionOperators/index.js +1 -1
- package/lib/mjs/utils/formUtils.js +2 -2
- package/lib/mjs/utils/i18n.js +1 -7
- package/lib/mjs/utils/index.d.ts +1 -2
- package/lib/mjs/utils/index.js +3 -3
- package/lib/mjs/utils/jsonlogic/operators.d.ts +1 -0
- package/lib/mjs/utils/jsonlogic/operators.js +262 -0
- package/lib/mjs/utils/utils.d.ts +1 -10
- package/lib/mjs/utils/utils.js +91 -178
- package/lib/mjs/widgets/CalendarWidget.js +50 -67
- package/lib/mjs/widgets/InputWidget.js +4 -6
- package/lib/mjs/widgets/index.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/translations/de.d.ts +0 -80
- package/lib/cjs/translations/de.js +0 -81
- package/lib/mjs/translations/de.d.ts +0 -80
- package/lib/mjs/translations/de.js +0 -79
|
@@ -12,6 +12,7 @@ const DEFAULT_FORMAT = 'yyyy-MM-dd hh:mm a';
|
|
|
12
12
|
const ISO_8601_FORMAT = 'yyyy-MM-ddTHH:mm:ssZ';
|
|
13
13
|
const isIEBrowser = (0, utils_1.getBrowserInfo)().ie;
|
|
14
14
|
class CalendarWidget extends InputWidget_1.default {
|
|
15
|
+
/* eslint-disable camelcase */
|
|
15
16
|
static get defaultSettings() {
|
|
16
17
|
return {
|
|
17
18
|
type: 'calendar',
|
|
@@ -34,9 +35,10 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
34
35
|
timezone: '',
|
|
35
36
|
disable: [],
|
|
36
37
|
minDate: '',
|
|
37
|
-
maxDate: ''
|
|
38
|
+
maxDate: ''
|
|
38
39
|
};
|
|
39
40
|
}
|
|
41
|
+
/* eslint-enable camelcase */
|
|
40
42
|
constructor(settings, component, instance, index) {
|
|
41
43
|
super(settings, component, instance, index);
|
|
42
44
|
// Change the format to map to the settings.
|
|
@@ -79,24 +81,20 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
79
81
|
const dateFormatInfo = (0, utils_1.getLocaleDateFormatInfo)(this.settings.language);
|
|
80
82
|
this.defaultFormat = {
|
|
81
83
|
date: dateFormatInfo.dayFirst ? 'd/m/Y ' : 'm/d/Y ',
|
|
82
|
-
time: 'G:i K'
|
|
84
|
+
time: 'G:i K'
|
|
83
85
|
};
|
|
84
86
|
this.closedOn = 0;
|
|
85
|
-
this.valueFormat =
|
|
86
|
-
this.settings.saveAs === 'date'
|
|
87
|
-
? ISO_8601_FORMAT
|
|
88
|
-
: this.settings.dateFormat || ISO_8601_FORMAT;
|
|
87
|
+
this.valueFormat = (this.settings.saveAs === 'date') ? ISO_8601_FORMAT : this.settings.dateFormat || ISO_8601_FORMAT;
|
|
89
88
|
this.valueMomentFormat = (0, utils_1.convertFormatToMoment)(this.valueFormat);
|
|
90
89
|
const isReadOnly = this.settings.readOnly;
|
|
91
90
|
this.settings.minDate = isReadOnly ? null : (0, utils_1.getDateSetting)(this.settings.minDate);
|
|
92
91
|
this.settings.maxDate = isReadOnly ? null : (0, utils_1.getDateSetting)(this.settings.maxDate);
|
|
93
|
-
if (this.settings.maxDate || this.settings.minDate) {
|
|
94
|
-
this.settings.allowInvalidPreload = true;
|
|
95
|
-
}
|
|
96
92
|
this.settings.disable = this.disabledDates;
|
|
97
93
|
this.settings.disableWeekends ? this.settings.disable.push(this.disableWeekends) : '';
|
|
98
94
|
this.settings.disableWeekdays ? this.settings.disable.push(this.disableWeekdays) : '';
|
|
99
95
|
this.settings.disableFunction ? this.settings.disable.push(this.disableFunction) : '';
|
|
96
|
+
this.settings.wasDefaultValueChanged = false;
|
|
97
|
+
this.settings.defaultValue = '';
|
|
100
98
|
this.settings.manualInputValue = '';
|
|
101
99
|
this.settings.isManuallyOverriddenValue = false;
|
|
102
100
|
this.settings.currentValue = '';
|
|
@@ -124,22 +122,23 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
124
122
|
this.settings.isManuallyOverriddenValue = false;
|
|
125
123
|
this.emit('update');
|
|
126
124
|
}
|
|
125
|
+
if (this.settings.wasDefaultValueChanged) {
|
|
126
|
+
this.calendar._input.value = this.settings.defaultValue;
|
|
127
|
+
this.settings.wasDefaultValueChanged = false;
|
|
128
|
+
}
|
|
127
129
|
if (this.calendar) {
|
|
128
130
|
this.emit('blur');
|
|
129
131
|
}
|
|
130
132
|
};
|
|
131
133
|
Formio_1.Formio.requireLibrary('flatpickr-css', 'flatpickr', [
|
|
132
|
-
{ type: 'styles', src: `${Formio_1.Formio.cdn['flatpickr-formio']}/flatpickr.min.css` }
|
|
134
|
+
{ type: 'styles', src: `${Formio_1.Formio.cdn['flatpickr-formio']}/flatpickr.min.css` }
|
|
133
135
|
], true);
|
|
134
136
|
if (this.component.shortcutButtons) {
|
|
135
137
|
this.component.shortcutButtons = this.component.shortcutButtons.filter((btn) => btn.label && btn.onClick);
|
|
136
138
|
}
|
|
137
139
|
if ((_a = this.component.shortcutButtons) === null || _a === void 0 ? void 0 : _a.length) {
|
|
138
140
|
Formio_1.Formio.requireLibrary('shortcut-buttons-flatpickr-css', 'ShortcutButtonsPlugin', [
|
|
139
|
-
{
|
|
140
|
-
type: 'styles',
|
|
141
|
-
src: `${Formio_1.Formio.cdn['shortcut-buttons-flatpickr']}/themes/light.min.css`,
|
|
142
|
-
},
|
|
141
|
+
{ type: 'styles', src: `${Formio_1.Formio.cdn['shortcut-buttons-flatpickr']}/themes/light.min.css` }
|
|
143
142
|
], true);
|
|
144
143
|
}
|
|
145
144
|
return superAttach
|
|
@@ -150,7 +149,8 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
150
149
|
}
|
|
151
150
|
})
|
|
152
151
|
.then((ShortcutButtonsPlugin) => {
|
|
153
|
-
return Formio_1.Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio_1.Formio.cdn['flatpickr-formio']}/flatpickr.min.js`, true)
|
|
152
|
+
return Formio_1.Formio.requireLibrary('flatpickr', 'flatpickr', `${Formio_1.Formio.cdn['flatpickr-formio']}/flatpickr.min.js`, true)
|
|
153
|
+
.then((Flatpickr) => {
|
|
154
154
|
var _a;
|
|
155
155
|
if (((_a = this.component.shortcutButtons) === null || _a === void 0 ? void 0 : _a.length) && ShortcutButtonsPlugin) {
|
|
156
156
|
this.initShortcutButtonsPlugin(ShortcutButtonsPlugin);
|
|
@@ -180,7 +180,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
180
180
|
}
|
|
181
181
|
get disableWeekends() {
|
|
182
182
|
return function (date) {
|
|
183
|
-
return date.getDay() === 0 || date.getDay() === 6;
|
|
183
|
+
return (date.getDay() === 0 || date.getDay() === 6);
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
get disableWeekdays() {
|
|
@@ -188,7 +188,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
188
188
|
}
|
|
189
189
|
get disableFunction() {
|
|
190
190
|
return (date) => this.evaluate(`return ${this.settings.disableFunction}`, {
|
|
191
|
-
date
|
|
191
|
+
date
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
get timezone() {
|
|
@@ -201,7 +201,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
201
201
|
this.addEventListener(suffix, 'click', () => {
|
|
202
202
|
setTimeout(() => {
|
|
203
203
|
if (this.calendar) {
|
|
204
|
-
if (!this.calendar.isOpen && Date.now() - this.closedOn > 200) {
|
|
204
|
+
if (!this.calendar.isOpen && ((Date.now() - this.closedOn) > 200)) {
|
|
205
205
|
this.calendar.open();
|
|
206
206
|
}
|
|
207
207
|
else if (this.calendar.isOpen) {
|
|
@@ -235,12 +235,10 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
235
235
|
const dateMask = /\d{4}-\d{2}-\d{2}/g;
|
|
236
236
|
const dates = item.match(dateMask);
|
|
237
237
|
if (dates && dates.length) {
|
|
238
|
-
return dates.length === 1
|
|
239
|
-
|
|
240
|
-
:
|
|
241
|
-
|
|
242
|
-
to: item.match(dateMask)[1],
|
|
243
|
-
};
|
|
238
|
+
return dates.length === 1 ? item.match(dateMask)[0] : {
|
|
239
|
+
from: item.match(dateMask)[0],
|
|
240
|
+
to: item.match(dateMask)[1],
|
|
241
|
+
};
|
|
244
242
|
}
|
|
245
243
|
});
|
|
246
244
|
}
|
|
@@ -257,9 +255,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
257
255
|
return format;
|
|
258
256
|
}
|
|
259
257
|
get dateTimeFormat() {
|
|
260
|
-
return this.settings.useLocaleSettings
|
|
261
|
-
? this.localeFormat
|
|
262
|
-
: (0, utils_1.convertFormatToFlatpickr)(this.dateFormat);
|
|
258
|
+
return this.settings.useLocaleSettings ? this.localeFormat : (0, utils_1.convertFormatToFlatpickr)(this.dateFormat);
|
|
263
259
|
}
|
|
264
260
|
get dateFormat() {
|
|
265
261
|
return lodash_1.default.get(this.settings, 'format', DEFAULT_FORMAT);
|
|
@@ -294,10 +290,10 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
294
290
|
if (!(dates[0] instanceof Date)) {
|
|
295
291
|
return 'Invalid Date';
|
|
296
292
|
}
|
|
297
|
-
return this.getDateValue(dates[0], this.valueFormat, this.settings.saveAs === 'date');
|
|
293
|
+
return this.getDateValue(dates[0], this.valueFormat, (this.settings.saveAs === 'date'));
|
|
298
294
|
}
|
|
299
295
|
isValueISO8601(value) {
|
|
300
|
-
return value && typeof value === 'string' && value.match(/-[0-9]{2}T[0-9]{2}:/);
|
|
296
|
+
return value && (typeof value === 'string') && value.match(/-[0-9]{2}T[0-9]{2}:/);
|
|
301
297
|
}
|
|
302
298
|
/**
|
|
303
299
|
* Set the selected date value.
|
|
@@ -305,16 +301,11 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
305
301
|
* @returns {void}
|
|
306
302
|
*/
|
|
307
303
|
setValue(value) {
|
|
308
|
-
const saveAsText = this.settings.saveAs === 'text';
|
|
304
|
+
const saveAsText = (this.settings.saveAs === 'text');
|
|
309
305
|
if (!this.calendar) {
|
|
310
|
-
value = value
|
|
311
|
-
? (0, utils_1.formatDate)(this.timezonesUrl, value, (0, utils_1.convertFormatToMoment)(this.settings.format), this.timezone, (0, utils_1.convertFormatToMoment)(this.valueMomentFormat))
|
|
312
|
-
: value;
|
|
306
|
+
value = value ? (0, utils_1.formatDate)(this.timezonesUrl, value, (0, utils_1.convertFormatToMoment)(this.settings.format), this.timezone, (0, utils_1.convertFormatToMoment)(this.valueMomentFormat)) : value;
|
|
313
307
|
return super.setValue(value);
|
|
314
308
|
}
|
|
315
|
-
// If the component is a textfield that does not have timezone information included in the string value then skip
|
|
316
|
-
// the timezone offset
|
|
317
|
-
this.settings.skipOffset = this.component.type === 'textfield' && !(0, utils_1.hasEncodedTimezone)(value);
|
|
318
309
|
const zonesLoading = this.loadZones();
|
|
319
310
|
if (value) {
|
|
320
311
|
if (!saveAsText && this.settings.readOnly && !zonesLoading) {
|
|
@@ -334,9 +325,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
334
325
|
getValueAsString(value, format = '') {
|
|
335
326
|
const inputFormat = format || this.dateFormat;
|
|
336
327
|
const valueFormat = this.calendar ? this.valueFormat : this.settings.dateFormat;
|
|
337
|
-
if (this.settings.saveAs === 'text' &&
|
|
338
|
-
this.componentInstance.parent &&
|
|
339
|
-
!this.settings.readOnly) {
|
|
328
|
+
if (this.settings.saveAs === 'text' && this.componentInstance.parent && !this.settings.readOnly) {
|
|
340
329
|
return (0, moment_1.default)(value, (0, utils_1.convertFormatToMoment)(valueFormat)).format((0, utils_1.convertFormatToMoment)(valueFormat));
|
|
341
330
|
}
|
|
342
331
|
return (0, utils_1.formatDate)(this.timezonesUrl, value, inputFormat, this.timezone, (0, utils_1.convertFormatToMoment)(valueFormat));
|
|
@@ -359,7 +348,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
359
348
|
if (typeof value === 'string') {
|
|
360
349
|
return new Date(value);
|
|
361
350
|
}
|
|
362
|
-
return value.map(
|
|
351
|
+
return value.map(val => new Date(val));
|
|
363
352
|
}
|
|
364
353
|
isCalendarElement(element) {
|
|
365
354
|
var _a, _b, _c, _d, _e;
|
|
@@ -380,6 +369,14 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
380
369
|
this.settings.isManuallyOverriddenValue = true;
|
|
381
370
|
this.settings.currentValue = event.target.value;
|
|
382
371
|
}
|
|
372
|
+
if (event.target.value === '' && this.calendar.selectedDates.length > 0) {
|
|
373
|
+
this.settings.wasDefaultValueChanged = true;
|
|
374
|
+
this.settings.defaultValue = event.target.value;
|
|
375
|
+
this.calendar.clear();
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
this.settings.wasDefaultValueChanged = false;
|
|
379
|
+
}
|
|
383
380
|
});
|
|
384
381
|
// Move input attributes to altInput.
|
|
385
382
|
const labelledbyIds = this.calendar.input.getAttribute('aria-labelledby');
|
|
@@ -390,11 +387,8 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
390
387
|
this._input.removeAttribute('id');
|
|
391
388
|
this._input.removeAttribute('aria-labelledby');
|
|
392
389
|
this._input.removeAttribute('aria-required');
|
|
393
|
-
const excludedFromMaskFormats = [
|
|
394
|
-
|
|
395
|
-
];
|
|
396
|
-
if (!this.settings.readOnly &&
|
|
397
|
-
!lodash_1.default.some(excludedFromMaskFormats, (format) => lodash_1.default.includes(this.settings.format, format))) {
|
|
390
|
+
const excludedFromMaskFormats = ['MMMM'];
|
|
391
|
+
if (!this.settings.readOnly && !lodash_1.default.some(excludedFromMaskFormats, format => lodash_1.default.includes(this.settings.format, format))) {
|
|
398
392
|
// Enforce the input mask of the format.
|
|
399
393
|
this.setInputMask(this.calendar._input, (0, utils_1.convertFormatToMask)(this.settings.format));
|
|
400
394
|
}
|
|
@@ -406,9 +400,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
406
400
|
this.calendar._input.removeEventListener('blur', originalBlurListener.handler);
|
|
407
401
|
// Add the same event listener as in the original library, but with workaround for IE11 issue
|
|
408
402
|
this.addEventListener(this.calendar._input, 'blur', (event) => {
|
|
409
|
-
const activeElement = this.settings.shadowRoot
|
|
410
|
-
? this.settings.shadowRoot.activeElement
|
|
411
|
-
: document.activeElement;
|
|
403
|
+
const activeElement = this.settings.shadowRoot ? this.settings.shadowRoot.activeElement : document.activeElement;
|
|
412
404
|
const relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;
|
|
413
405
|
const isInput = event.target === this.calendar._input;
|
|
414
406
|
if (isInput && !this.isCalendarElement(relatedTarget)) {
|
|
@@ -421,22 +413,15 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
421
413
|
// Make sure we commit the value after a blur event occurs.
|
|
422
414
|
this.addEventListener(this.calendar._input, 'blur', (event) => {
|
|
423
415
|
var _a, _b, _c, _d;
|
|
424
|
-
const activeElement = this.settings.shadowRoot
|
|
425
|
-
? this.settings.shadowRoot.activeElement
|
|
426
|
-
: document.activeElement;
|
|
416
|
+
const activeElement = this.settings.shadowRoot ? this.settings.shadowRoot.activeElement : document.activeElement;
|
|
427
417
|
const relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;
|
|
428
418
|
if (!(isIEBrowser && !relatedTarget) && !this.isCalendarElement(relatedTarget)) {
|
|
429
419
|
const inputValue = this.calendar.input.value;
|
|
430
|
-
const dateValue = inputValue
|
|
431
|
-
? (0, moment_1.default)(this.calendar.input.value, (0, utils_1.convertFormatToMoment)(this.valueFormat)).toDate()
|
|
432
|
-
: inputValue;
|
|
420
|
+
const dateValue = inputValue ? (0, moment_1.default)(this.calendar.input.value, (0, utils_1.convertFormatToMoment)(this.valueFormat)).toDate() : inputValue;
|
|
433
421
|
this.calendar.setDate(dateValue, true, this.settings.altFormat);
|
|
434
422
|
}
|
|
435
423
|
else if (!this.calendar.input.value && this.calendar.config.noCalendar) {
|
|
436
|
-
const value = (0, moment_1.default)({
|
|
437
|
-
hour: (_b = (_a = this.calendar) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.defaultHour,
|
|
438
|
-
minute: (_d = (_c = this.calendar) === null || _c === void 0 ? void 0 : _c.config) === null || _d === void 0 ? void 0 : _d.defaultMinute,
|
|
439
|
-
}).toDate();
|
|
424
|
+
const value = (0, moment_1.default)({ hour: (_b = (_a = this.calendar) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.defaultHour, minute: (_d = (_c = this.calendar) === null || _c === void 0 ? void 0 : _c.config) === null || _d === void 0 ? void 0 : _d.defaultMinute }).toDate();
|
|
440
425
|
this.calendar.setDate(value, true, this.settings.format);
|
|
441
426
|
}
|
|
442
427
|
});
|
|
@@ -463,17 +448,15 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
463
448
|
}
|
|
464
449
|
initShortcutButtonsPlugin(ShortcutButtonsPlugin) {
|
|
465
450
|
this.settings.plugins = [
|
|
451
|
+
// eslint-disable-next-line new-cap
|
|
466
452
|
ShortcutButtonsPlugin({
|
|
467
|
-
button: this.component.shortcutButtons.map((btn) => ({
|
|
468
|
-
label: btn.label,
|
|
469
|
-
attributes: btn.attribute,
|
|
470
|
-
})),
|
|
453
|
+
button: this.component.shortcutButtons.map((btn) => ({ label: btn.label, attributes: btn.attribute })),
|
|
471
454
|
onClick: (index) => {
|
|
472
455
|
const getValue = this.component.shortcutButtons[index].onClick;
|
|
473
456
|
const date = this.evaluate(getValue, { date: new Date() }, 'date');
|
|
474
457
|
this.calendar.setDate(date, true);
|
|
475
|
-
}
|
|
476
|
-
})
|
|
458
|
+
}
|
|
459
|
+
})
|
|
477
460
|
];
|
|
478
461
|
}
|
|
479
462
|
get componentValue() {
|
|
@@ -486,8 +469,8 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
486
469
|
getFlatpickrFormatDate(Flatpickr) {
|
|
487
470
|
return (date, format) => {
|
|
488
471
|
// Only format this if this is the altFormat and the form is readOnly.
|
|
489
|
-
if (this.settings.readOnly && format === this.settings.altFormat) {
|
|
490
|
-
if (!this.settings.enableTime || this.loadZones()
|
|
472
|
+
if (this.settings.readOnly && (format === this.settings.altFormat)) {
|
|
473
|
+
if (!this.settings.enableTime || this.loadZones()) {
|
|
491
474
|
return Flatpickr.formatDate(date, format);
|
|
492
475
|
}
|
|
493
476
|
const currentValue = new Date(this.getValue());
|
|
@@ -8,7 +8,7 @@ const Element_1 = __importDefault(require("../Element"));
|
|
|
8
8
|
class InputWidget extends Element_1.default {
|
|
9
9
|
static get defaultSettings() {
|
|
10
10
|
return {
|
|
11
|
-
type: 'input'
|
|
11
|
+
type: 'input'
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
constructor(settings, component, instance, index) {
|
|
@@ -63,11 +63,9 @@ class InputWidget extends Element_1.default {
|
|
|
63
63
|
data: this.componentInstance.rootValue,
|
|
64
64
|
value: this.componentInstance.dataValue,
|
|
65
65
|
t: this.t.bind(this),
|
|
66
|
-
submission: this.componentInstance.root
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
data: this.componentInstance.rootValue,
|
|
70
|
-
},
|
|
66
|
+
submission: (this.componentInstance.root ? this.componentInstance.root._submission : {
|
|
67
|
+
data: this.componentInstance.rootValue
|
|
68
|
+
}),
|
|
71
69
|
form: this.componentInstance.root ? this.componentInstance.root._form : {},
|
|
72
70
|
options: this.options,
|
|
73
71
|
}, additional));
|
package/lib/cjs/widgets/index.js
CHANGED
|
@@ -7,5 +7,5 @@ const InputWidget_1 = __importDefault(require("./InputWidget"));
|
|
|
7
7
|
const CalendarWidget_1 = __importDefault(require("./CalendarWidget"));
|
|
8
8
|
exports.default = {
|
|
9
9
|
input: InputWidget_1.default,
|
|
10
|
-
calendar: CalendarWidget_1.default
|
|
10
|
+
calendar: CalendarWidget_1.default
|
|
11
11
|
};
|
package/lib/mjs/CDN.js
CHANGED
|
@@ -8,23 +8,23 @@ class CDN {
|
|
|
8
8
|
this.baseUrl = baseUrl || CDN.defaultCDN;
|
|
9
9
|
this.overrides = overrides;
|
|
10
10
|
this.libs = {
|
|
11
|
-
js: '',
|
|
12
|
-
ace: '1.4.12',
|
|
13
|
-
bootstrap: '5.3.3',
|
|
14
|
-
bootstrap4: '4.6.2',
|
|
15
|
-
bootstrap5: '5.3.3',
|
|
16
|
-
bootswatch: '5.3.3',
|
|
11
|
+
'js': '',
|
|
12
|
+
'ace': '1.4.12',
|
|
13
|
+
'bootstrap': '5.3.3',
|
|
14
|
+
'bootstrap4': '4.6.2',
|
|
15
|
+
'bootstrap5': '5.3.3',
|
|
16
|
+
'bootswatch': '5.3.3',
|
|
17
17
|
'bootstrap-icons': '1.11.1',
|
|
18
|
-
ckeditor: '19.0.0',
|
|
19
|
-
flatpickr: '4.6.8',
|
|
18
|
+
'ckeditor': '19.0.0',
|
|
19
|
+
'flatpickr': '4.6.8',
|
|
20
20
|
'flatpickr-formio': '4.6.13-formio.3',
|
|
21
21
|
'font-awesome': '4.7.0',
|
|
22
|
-
grid: 'latest',
|
|
22
|
+
'grid': 'latest',
|
|
23
23
|
'moment-timezone': 'latest',
|
|
24
|
-
quill: '2.0.0-dev.3',
|
|
24
|
+
'quill': '2.0.0-dev.3',
|
|
25
25
|
'shortcut-buttons-flatpickr': '0.4.0',
|
|
26
|
-
uswds: '2.4.8',
|
|
27
|
-
core: ''
|
|
26
|
+
'uswds': '2.4.8',
|
|
27
|
+
'core': ''
|
|
28
28
|
};
|
|
29
29
|
this.updateUrls();
|
|
30
30
|
}
|
package/lib/mjs/Element.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The root component for all elements within the Form.io renderer.
|
|
3
|
-
* @property {object} options - The options for this component. Subclasses should override this type with more specific options.
|
|
4
3
|
*/
|
|
5
4
|
export default class Element {
|
|
6
5
|
constructor(options: any);
|
|
7
6
|
/**
|
|
8
7
|
* The options for this component.
|
|
9
|
-
* @type {
|
|
8
|
+
* @type {{}}
|
|
10
9
|
*/
|
|
11
|
-
options:
|
|
10
|
+
options: {};
|
|
12
11
|
/**
|
|
13
12
|
* The ID of this component. This value is auto-generated when the component is created, but
|
|
14
13
|
* can also be provided from the component.id value passed into the constructor.
|
package/lib/mjs/Element.js
CHANGED
|
@@ -7,13 +7,12 @@ import { I18n } from './utils/i18n';
|
|
|
7
7
|
import FormioUtils from './utils';
|
|
8
8
|
/**
|
|
9
9
|
* The root component for all elements within the Form.io renderer.
|
|
10
|
-
* @property {object} options - The options for this component. Subclasses should override this type with more specific options.
|
|
11
10
|
*/
|
|
12
11
|
export default class Element {
|
|
13
12
|
constructor(options) {
|
|
14
13
|
/**
|
|
15
14
|
* The options for this component.
|
|
16
|
-
* @type {
|
|
15
|
+
* @type {{}}
|
|
17
16
|
*/
|
|
18
17
|
this.options = Object.assign({
|
|
19
18
|
language: 'en',
|
|
@@ -21,7 +20,7 @@ export default class Element {
|
|
|
21
20
|
componentErrorClass: 'formio-error-wrapper',
|
|
22
21
|
componentWarningClass: 'formio-warning-wrapper',
|
|
23
22
|
row: '',
|
|
24
|
-
namespace: 'formio'
|
|
23
|
+
namespace: 'formio'
|
|
25
24
|
}, options || {});
|
|
26
25
|
/**
|
|
27
26
|
* The ID of this component. This value is auto-generated when the component is created, but
|
|
@@ -44,14 +43,13 @@ export default class Element {
|
|
|
44
43
|
* An instance of the EventEmitter class to handle the emitting and registration of events.
|
|
45
44
|
* @type {EventEmitter}
|
|
46
45
|
*/
|
|
47
|
-
this.events = options && options.events ? options.events : new EventEmitter();
|
|
46
|
+
this.events = (options && options.events) ? options.events : new EventEmitter();
|
|
48
47
|
this.defaultMask = null;
|
|
49
48
|
/**
|
|
50
49
|
* Conditional to show or hide helplinks in editForm
|
|
51
50
|
* @type {*|boolean}
|
|
52
51
|
*/
|
|
53
|
-
this.helplinks =
|
|
54
|
-
this.options.helplinks === 'false' ? false : this.options.helplinks || 'https://help.form.io';
|
|
52
|
+
this.helplinks = (this.options.helplinks === 'false') ? false : (this.options.helplinks || 'https://help.form.io');
|
|
55
53
|
}
|
|
56
54
|
/**
|
|
57
55
|
* Register for a new event within this component.
|
|
@@ -124,7 +122,7 @@ export default class Element {
|
|
|
124
122
|
return;
|
|
125
123
|
}
|
|
126
124
|
const type = `${this.options.namespace}.${event}`;
|
|
127
|
-
this.events
|
|
125
|
+
this.events?.listeners(type).forEach((listener) => {
|
|
128
126
|
// Ensure the listener is for this element
|
|
129
127
|
if (!listener || listener.id !== this.id) {
|
|
130
128
|
return;
|
|
@@ -133,7 +131,7 @@ export default class Element {
|
|
|
133
131
|
if (cb && cb !== listener) {
|
|
134
132
|
return;
|
|
135
133
|
}
|
|
136
|
-
this.events
|
|
134
|
+
this.events?.off(type, listener);
|
|
137
135
|
});
|
|
138
136
|
}
|
|
139
137
|
/**
|
|
@@ -200,10 +198,10 @@ export default class Element {
|
|
|
200
198
|
return;
|
|
201
199
|
}
|
|
202
200
|
this.eventHandlers.forEach((handler, index) => {
|
|
203
|
-
if (handler.id === this.id
|
|
204
|
-
obj.removeEventListener
|
|
205
|
-
handler.type === type
|
|
206
|
-
(!func || handler.func === func)) {
|
|
201
|
+
if ((handler.id === this.id)
|
|
202
|
+
&& obj.removeEventListener
|
|
203
|
+
&& (handler.type === type)
|
|
204
|
+
&& (!func || handler.func === func)) {
|
|
207
205
|
obj.removeEventListener(type, handler.func);
|
|
208
206
|
indexes.push(index);
|
|
209
207
|
}
|
|
@@ -214,11 +212,8 @@ export default class Element {
|
|
|
214
212
|
return this;
|
|
215
213
|
}
|
|
216
214
|
removeEventListeners() {
|
|
217
|
-
this.eventHandlers.forEach(
|
|
218
|
-
if (this.id === handler.id &&
|
|
219
|
-
handler.type &&
|
|
220
|
-
handler.obj &&
|
|
221
|
-
handler.obj.removeEventListener) {
|
|
215
|
+
this.eventHandlers.forEach(handler => {
|
|
216
|
+
if ((this.id === handler.id) && handler.type && handler.obj && handler.obj.removeEventListener) {
|
|
222
217
|
handler.obj.removeEventListener(handler.type, handler.func);
|
|
223
218
|
}
|
|
224
219
|
});
|
|
@@ -228,7 +223,7 @@ export default class Element {
|
|
|
228
223
|
if (this.events) {
|
|
229
224
|
_.each(this.events._events, (events, type) => {
|
|
230
225
|
_.each(events, (listener) => {
|
|
231
|
-
if (listener && this.id === listener.id && (includeExternal || listener.internal)) {
|
|
226
|
+
if (listener && (this.id === listener.id) && (includeExternal || listener.internal)) {
|
|
232
227
|
this.events.off(type, listener);
|
|
233
228
|
}
|
|
234
229
|
});
|
|
@@ -343,7 +338,7 @@ export default class Element {
|
|
|
343
338
|
* @returns {string} - The placeholder that will exist within the input as they type.
|
|
344
339
|
*/
|
|
345
340
|
maskPlaceholder(mask) {
|
|
346
|
-
return mask.map((char) => (char instanceof RegExp ? this.placeholderChar : char)
|
|
341
|
+
return mask.map((char) => (char instanceof RegExp) ? this.placeholderChar : char).join('');
|
|
347
342
|
}
|
|
348
343
|
/**
|
|
349
344
|
* Get the placeholder character for the input mask.
|
|
@@ -371,7 +366,7 @@ export default class Element {
|
|
|
371
366
|
inputElement: input,
|
|
372
367
|
mask,
|
|
373
368
|
placeholderChar: this.placeholderChar,
|
|
374
|
-
shadowRoot: this.root ? this.root
|
|
369
|
+
shadowRoot: this.root ? this.root?.shadowRoot : null,
|
|
375
370
|
});
|
|
376
371
|
}
|
|
377
372
|
catch (e) {
|
|
@@ -440,7 +435,7 @@ export default class Element {
|
|
|
440
435
|
}
|
|
441
436
|
// Allow templates to intercept.
|
|
442
437
|
className = ` ${className} `;
|
|
443
|
-
return ` ${element.className}
|
|
438
|
+
return ((` ${element.className} `).replace(/[\n\t\r]/g, ' ').indexOf(className) > -1);
|
|
444
439
|
}
|
|
445
440
|
/**
|
|
446
441
|
* Adds a class to a DOM element.
|
|
@@ -503,7 +498,7 @@ export default class Element {
|
|
|
503
498
|
instance: this,
|
|
504
499
|
self: this,
|
|
505
500
|
token: Formio.getToken({
|
|
506
|
-
decode: true
|
|
501
|
+
decode: true
|
|
507
502
|
}),
|
|
508
503
|
options: this.options,
|
|
509
504
|
config: this.root && this.root.form && this.root.form.config
|
|
@@ -521,9 +516,8 @@ export default class Element {
|
|
|
521
516
|
* @returns {XML|string|*|void} - The interpolated string.
|
|
522
517
|
*/
|
|
523
518
|
interpolate(string, data, options = {}) {
|
|
524
|
-
if (typeof string !== 'function' &&
|
|
525
|
-
|
|
526
|
-
!FormioUtils.Evaluator.templateSettings.interpolate.test(string)) {
|
|
519
|
+
if (typeof string !== 'function' && (this.component.content || this.component.html)
|
|
520
|
+
&& !FormioUtils.Evaluator.templateSettings.interpolate.test(string)) {
|
|
527
521
|
string = FormioUtils.translateHTMLTemplate(String(string), (value) => this.t(value));
|
|
528
522
|
}
|
|
529
523
|
if (this.component.filter === string && !this.options.building) {
|
|
@@ -551,14 +545,14 @@ export default class Element {
|
|
|
551
545
|
*/
|
|
552
546
|
hook() {
|
|
553
547
|
const name = arguments[0];
|
|
554
|
-
if (this.options &&
|
|
548
|
+
if (this.options &&
|
|
549
|
+
this.options.hooks &&
|
|
550
|
+
this.options.hooks[name]) {
|
|
555
551
|
return this.options.hooks[name].apply(this, Array.prototype.slice.call(arguments, 1));
|
|
556
552
|
}
|
|
557
553
|
else {
|
|
558
554
|
// If this is an async hook instead of a sync.
|
|
559
|
-
const fn = typeof arguments[arguments.length - 1] === 'function'
|
|
560
|
-
? arguments[arguments.length - 1]
|
|
561
|
-
: null;
|
|
555
|
+
const fn = (typeof arguments[arguments.length - 1] === 'function') ? arguments[arguments.length - 1] : null;
|
|
562
556
|
if (fn) {
|
|
563
557
|
return fn(null, arguments[1]);
|
|
564
558
|
}
|