@formio/js 5.2.3 → 5.2.4-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/formio.builder.css +161 -50
- 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 +158 -49
- package/dist/formio.form.js +152 -108
- 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 +161 -50
- package/dist/formio.full.js +401 -227
- 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 +51 -18
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +47 -14
- 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 +3 -2
- package/lib/cjs/Element.js +27 -21
- package/lib/cjs/Embed.js +74 -40
- package/lib/cjs/EventEmitter.js +1 -1
- package/lib/cjs/Form.d.ts +371 -341
- package/lib/cjs/Form.js +153 -39
- package/lib/cjs/FormBuilder.d.ts +3 -3
- package/lib/cjs/FormBuilder.js +2 -3
- package/lib/cjs/Formio.js +26 -23
- package/lib/cjs/InlineEmbed.js +23 -17
- package/lib/cjs/PDF.d.ts +1 -0
- package/lib/cjs/PDF.js +18 -15
- package/lib/cjs/PDFBuilder.js +51 -36
- package/lib/cjs/Webform.d.ts +8 -366
- package/lib/cjs/Webform.js +176 -235
- package/lib/cjs/WebformBuilder.js +217 -144
- package/lib/cjs/Wizard.js +92 -62
- package/lib/cjs/WizardBuilder.js +27 -19
- package/lib/cjs/addons/FormioAddon.js +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +59 -57
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +24 -16
- package/lib/cjs/addons/index.js +3 -3
- package/lib/cjs/components/Components.js +0 -4
- package/lib/cjs/components/_classes/component/Component.form.js +11 -11
- package/lib/cjs/components/_classes/component/Component.js +298 -179
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +2 -4
- package/lib/cjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +9 -11
- 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 +39 -25
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +47 -29
- package/lib/cjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +5 -7
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +37 -34
- package/lib/cjs/components/_classes/component/editForm/utils.js +12 -16
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +6 -6
- package/lib/cjs/components/_classes/field/Field.js +7 -1
- package/lib/cjs/components/_classes/input/Input.js +30 -26
- package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +27 -18
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +36 -9
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +32 -13
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.js +36 -32
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +19 -14
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +19 -17
- package/lib/cjs/components/address/Address.js +52 -45
- 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 +53 -11
- package/lib/cjs/components/alert/Alert.js +21 -15
- package/lib/cjs/components/button/Button.form.js +1 -1
- package/lib/cjs/components/button/Button.js +50 -27
- package/lib/cjs/components/button/editForm/Button.edit.display.js +49 -9
- 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 +28 -20
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +13 -3
- 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 +24 -12
- 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 +6 -4
- 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 +4 -2
- package/lib/cjs/components/content/Content.js +10 -8
- 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 +19 -10
- 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 +89 -38
- 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 +44 -31
- 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 +30 -15
- package/lib/cjs/components/datetime/editForm/DateTime.edit.data.js +4 -3
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +22 -17
- 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 +146 -56
- package/lib/cjs/components/day/editForm/Day.edit.day.js +13 -9
- package/lib/cjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.month.js +12 -8
- 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 +137 -89
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +7 -2
- 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 +126 -80
- package/lib/cjs/components/file/editForm/File.edit.display.js +9 -5
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +37 -16
- package/lib/cjs/components/file/editForm/File.edit.file.js +169 -72
- 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 +67 -51
- package/lib/cjs/components/form/editForm/Form.edit.data.js +1 -3
- package/lib/cjs/components/form/editForm/Form.edit.display.js +6 -7
- package/lib/cjs/components/form/editForm/Form.edit.form.js +11 -9
- 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 +23 -17
- 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 +27 -11
- 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 +5 -7
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +55 -29
- package/lib/cjs/components/password/Password.form.js +3 -3
- package/lib/cjs/components/password/Password.js +5 -2
- 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 +55 -26
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +23 -9
- 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 +7 -5
- 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 +235 -129
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +191 -57
- 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 +31 -15
- 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 +25 -15
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +19 -10
- package/lib/cjs/components/survey/Survey.form.js +3 -3
- package/lib/cjs/components/survey/Survey.js +30 -17
- package/lib/cjs/components/survey/editForm/Survey.edit.data.js +23 -11
- 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 -5
- 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 +26 -8
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +21 -17
- package/lib/cjs/components/tags/Tags.form.js +1 -1
- package/lib/cjs/components/tags/Tags.js +28 -12
- 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 +63 -45
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +96 -72
- 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 +32 -21
- package/lib/cjs/components/textfield/editForm/TextField.edit.data.js +15 -13
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +31 -21
- package/lib/cjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/cjs/components/time/Time.js +17 -10
- 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 +2 -1
- package/lib/cjs/formio.form.js +38 -12
- package/lib/cjs/i18n.d.ts +4 -0
- package/lib/cjs/i18n.js +7 -3
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/providers/address/AddressProvider.js +8 -5
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/cjs/providers/address/GoogleAddressProvider.js +24 -13
- package/lib/cjs/providers/processor/fileProcessor.js +3 -1
- package/lib/cjs/providers/storage/azure.js +5 -2
- package/lib/cjs/providers/storage/dropbox.js +4 -5
- package/lib/cjs/providers/storage/googleDrive.js +3 -4
- package/lib/cjs/providers/storage/index.js +1 -1
- package/lib/cjs/providers/storage/indexeddb.js +16 -6
- package/lib/cjs/providers/storage/s3.js +17 -6
- package/lib/cjs/providers/storage/uploadAdapter.js +17 -11
- package/lib/cjs/providers/storage/url.js +13 -11
- package/lib/cjs/providers/storage/xhr.js +17 -9
- package/lib/cjs/templates/index.js +1 -1
- package/lib/cjs/translations/de.d.ts +80 -0
- package/lib/cjs/translations/de.js +81 -0
- package/lib/cjs/translations/en.d.ts +0 -2
- package/lib/cjs/translations/en.js +7 -9
- package/lib/cjs/utils/ChoicesWrapper.js +2 -2
- package/lib/cjs/utils/builder.js +31 -7
- package/lib/cjs/utils/calendarUtils.js +7 -5
- package/lib/cjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +12 -4
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +3 -1
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +10 -6
- package/lib/cjs/utils/conditionOperators/index.js +1 -1
- package/lib/cjs/utils/formUtils.js +1 -1
- package/lib/cjs/utils/i18n.js +7 -1
- package/lib/cjs/utils/index.d.ts +2 -1
- package/lib/cjs/utils/index.js +2 -2
- package/lib/cjs/utils/utils.d.ts +10 -1
- package/lib/cjs/utils/utils.js +175 -92
- package/lib/cjs/widgets/CalendarWidget.js +66 -49
- package/lib/cjs/widgets/InputWidget.js +6 -4
- package/lib/cjs/widgets/index.js +1 -1
- package/lib/mjs/CDN.js +12 -12
- package/lib/mjs/Element.d.ts +3 -2
- package/lib/mjs/Element.js +27 -21
- package/lib/mjs/Embed.js +76 -42
- package/lib/mjs/EventEmitter.js +1 -1
- package/lib/mjs/Form.d.ts +371 -341
- package/lib/mjs/Form.js +142 -126
- package/lib/mjs/FormBuilder.d.ts +3 -3
- package/lib/mjs/FormBuilder.js +2 -3
- package/lib/mjs/Formio.js +26 -23
- package/lib/mjs/InlineEmbed.js +23 -17
- package/lib/mjs/PDF.d.ts +1 -0
- package/lib/mjs/PDF.js +18 -15
- package/lib/mjs/PDFBuilder.js +51 -36
- package/lib/mjs/Webform.d.ts +8 -366
- package/lib/mjs/Webform.js +183 -250
- package/lib/mjs/WebformBuilder.js +220 -147
- package/lib/mjs/Wizard.js +93 -63
- package/lib/mjs/WizardBuilder.js +27 -19
- package/lib/mjs/addons/FormioAddon.js +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +59 -57
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +24 -16
- package/lib/mjs/addons/index.js +3 -3
- package/lib/mjs/components/Components.js +0 -4
- package/lib/mjs/components/_classes/component/Component.form.js +11 -11
- package/lib/mjs/components/_classes/component/Component.js +303 -184
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +2 -4
- package/lib/mjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +9 -11
- 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 +39 -25
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +47 -29
- package/lib/mjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +5 -7
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +37 -34
- package/lib/mjs/components/_classes/component/editForm/utils.js +12 -16
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +2 -2
- package/lib/mjs/components/_classes/field/Field.js +8 -2
- package/lib/mjs/components/_classes/input/Input.js +27 -23
- package/lib/mjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +27 -18
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +36 -9
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +32 -13
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.js +32 -28
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +20 -15
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +19 -17
- package/lib/mjs/components/address/Address.js +57 -46
- 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 +53 -11
- package/lib/mjs/components/alert/Alert.js +22 -16
- package/lib/mjs/components/button/Button.form.js +1 -1
- package/lib/mjs/components/button/Button.js +51 -28
- package/lib/mjs/components/button/editForm/Button.edit.display.js +49 -9
- 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 +29 -21
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +13 -3
- 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 +24 -12
- 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 +6 -4
- 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 +4 -2
- package/lib/mjs/components/content/Content.js +10 -8
- 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 +19 -10
- 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 +90 -39
- 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 +44 -31
- 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 +31 -16
- package/lib/mjs/components/datetime/editForm/DateTime.edit.data.js +4 -3
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +22 -17
- 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 +147 -57
- package/lib/mjs/components/day/editForm/Day.edit.day.js +13 -9
- package/lib/mjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.month.js +12 -8
- 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 +138 -90
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +7 -2
- 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 +131 -84
- package/lib/mjs/components/file/editForm/File.edit.display.js +9 -5
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +37 -16
- package/lib/mjs/components/file/editForm/File.edit.file.js +169 -72
- 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 +67 -51
- package/lib/mjs/components/form/editForm/Form.edit.data.js +1 -3
- package/lib/mjs/components/form/editForm/Form.edit.display.js +6 -7
- package/lib/mjs/components/form/editForm/Form.edit.form.js +10 -8
- 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 +23 -17
- 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 +28 -12
- 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 +6 -8
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +55 -29
- package/lib/mjs/components/password/Password.form.js +3 -3
- package/lib/mjs/components/password/Password.js +5 -2
- 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 +56 -27
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +23 -9
- 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 +7 -5
- 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 +240 -134
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +191 -57
- 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 +32 -16
- 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 +25 -15
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +19 -10
- package/lib/mjs/components/survey/Survey.form.js +3 -3
- package/lib/mjs/components/survey/Survey.js +30 -17
- package/lib/mjs/components/survey/editForm/Survey.edit.data.js +23 -11
- 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 +7 -5
- 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 +26 -8
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +21 -17
- package/lib/mjs/components/tags/Tags.form.js +1 -1
- package/lib/mjs/components/tags/Tags.js +28 -12
- 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 +75 -51
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +96 -72
- 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 +34 -23
- package/lib/mjs/components/textfield/editForm/TextField.edit.data.js +15 -13
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +31 -21
- package/lib/mjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/mjs/components/time/Time.js +17 -10
- 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 +2 -1
- package/lib/mjs/formio.form.js +10 -8
- package/lib/mjs/i18n.d.ts +4 -0
- package/lib/mjs/i18n.js +7 -3
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/providers/address/AddressProvider.js +8 -5
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/mjs/providers/address/GoogleAddressProvider.js +24 -13
- package/lib/mjs/providers/processor/fileProcessor.js +3 -1
- package/lib/mjs/providers/storage/azure.js +5 -2
- package/lib/mjs/providers/storage/dropbox.js +4 -5
- package/lib/mjs/providers/storage/googleDrive.js +3 -4
- package/lib/mjs/providers/storage/index.js +1 -1
- package/lib/mjs/providers/storage/indexeddb.js +16 -6
- package/lib/mjs/providers/storage/s3.js +19 -8
- package/lib/mjs/providers/storage/uploadAdapter.js +17 -11
- package/lib/mjs/providers/storage/url.js +13 -11
- package/lib/mjs/providers/storage/xhr.js +17 -9
- package/lib/mjs/templates/index.js +1 -1
- package/lib/mjs/translations/de.d.ts +80 -0
- package/lib/mjs/translations/de.js +79 -0
- package/lib/mjs/translations/en.d.ts +0 -2
- package/lib/mjs/translations/en.js +7 -9
- package/lib/mjs/utils/ChoicesWrapper.js +2 -2
- package/lib/mjs/utils/builder.js +31 -7
- package/lib/mjs/utils/calendarUtils.js +7 -5
- package/lib/mjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +16 -5
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +3 -1
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +10 -6
- package/lib/mjs/utils/conditionOperators/index.js +1 -1
- package/lib/mjs/utils/formUtils.js +2 -2
- package/lib/mjs/utils/i18n.js +7 -1
- package/lib/mjs/utils/index.d.ts +2 -1
- package/lib/mjs/utils/index.js +3 -3
- package/lib/mjs/utils/utils.d.ts +10 -1
- package/lib/mjs/utils/utils.js +178 -91
- package/lib/mjs/widgets/CalendarWidget.js +67 -50
- package/lib/mjs/widgets/InputWidget.js +6 -4
- package/lib/mjs/widgets/index.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/pdf.image.d.ts +0 -2
- package/lib/cjs/pdf.image.js +0 -94
- package/lib/cjs/utils/jsonlogic/operators.d.ts +0 -1
- package/lib/cjs/utils/jsonlogic/operators.js +0 -265
- package/lib/mjs/pdf.image.d.ts +0 -2
- package/lib/mjs/pdf.image.js +0 -94
- package/lib/mjs/utils/jsonlogic/operators.d.ts +0 -1
- package/lib/mjs/utils/jsonlogic/operators.js +0 -262
package/lib/cjs/PDF.js
CHANGED
|
@@ -16,10 +16,10 @@ class PDF extends Webform_1.default {
|
|
|
16
16
|
super.init();
|
|
17
17
|
// Handle an iframe submission.
|
|
18
18
|
this.on('iframe-submission', (submission) => this.setValue(submission, {
|
|
19
|
-
fromIframe: true
|
|
19
|
+
fromIframe: true,
|
|
20
20
|
}), true);
|
|
21
21
|
this.on('iframe-change', (submission) => this.setValue(submission, {
|
|
22
|
-
fromIframe: true
|
|
22
|
+
fromIframe: true,
|
|
23
23
|
}), true);
|
|
24
24
|
this.on('iframe-getIframePositions', (query) => {
|
|
25
25
|
const iframe = document.getElementById(`iframe-${query.formId}`);
|
|
@@ -30,10 +30,10 @@ class PDF extends Webform_1.default {
|
|
|
30
30
|
data: {
|
|
31
31
|
formId: query.formId,
|
|
32
32
|
iframe: {
|
|
33
|
-
top: iframeBoundingClientRect.top
|
|
33
|
+
top: iframeBoundingClientRect.top,
|
|
34
34
|
},
|
|
35
|
-
scrollY: window.scrollY || window.pageYOffset
|
|
36
|
-
}
|
|
35
|
+
scrollY: window.scrollY || window.pageYOffset,
|
|
36
|
+
},
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
});
|
|
@@ -50,12 +50,12 @@ class PDF extends Webform_1.default {
|
|
|
50
50
|
label: 'Submit',
|
|
51
51
|
key: 'submit',
|
|
52
52
|
ref: 'button',
|
|
53
|
-
hidden: this.isSubmitButtonHidden()
|
|
53
|
+
hidden: this.isSubmitButtonHidden(),
|
|
54
54
|
});
|
|
55
55
|
return this.renderTemplate('pdf', {
|
|
56
56
|
submitButton: this.submitButton.render(),
|
|
57
57
|
classes: 'formio-form-pdf',
|
|
58
|
-
children: this.renderComponents()
|
|
58
|
+
children: this.renderComponents(),
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
redraw() {
|
|
@@ -93,7 +93,7 @@ class PDF extends Webform_1.default {
|
|
|
93
93
|
buttonMessage: 'single',
|
|
94
94
|
zoomIn: 'single',
|
|
95
95
|
zoomOut: 'single',
|
|
96
|
-
iframeContainer: 'single'
|
|
96
|
+
iframeContainer: 'single',
|
|
97
97
|
});
|
|
98
98
|
this.submitButton.refs = Object.assign({}, this.refs);
|
|
99
99
|
this.submitButton.attachButton();
|
|
@@ -107,7 +107,7 @@ class PDF extends Webform_1.default {
|
|
|
107
107
|
src: this.getSrc(),
|
|
108
108
|
id: `iframe-${this.id}`,
|
|
109
109
|
seamless: true,
|
|
110
|
-
class: 'formio-iframe'
|
|
110
|
+
class: 'formio-iframe',
|
|
111
111
|
});
|
|
112
112
|
this.iframeElement.formioContainer = this.component.components;
|
|
113
113
|
this.iframeElement.formioComponent = this;
|
|
@@ -119,7 +119,7 @@ class PDF extends Webform_1.default {
|
|
|
119
119
|
this.form.projectUrl = Formio_1.Formio.getProjectUrl();
|
|
120
120
|
this.postMessage({ name: 'form', data: this.form });
|
|
121
121
|
// Hide the submit button if the associated component is hidden
|
|
122
|
-
const submitButton = this.components.find(c => c.element === this.refs.button);
|
|
122
|
+
const submitButton = this.components.find((c) => c.element === this.refs.button);
|
|
123
123
|
if (submitButton) {
|
|
124
124
|
this.refs.button.classList.toggle('hidden', !submitButton.visible);
|
|
125
125
|
}
|
|
@@ -165,7 +165,9 @@ class PDF extends Webform_1.default {
|
|
|
165
165
|
return '';
|
|
166
166
|
}
|
|
167
167
|
let iframeSrc = `${this._form.settings.pdf.src}.html`;
|
|
168
|
-
const params = [
|
|
168
|
+
const params = [
|
|
169
|
+
`id=${this.id}`,
|
|
170
|
+
];
|
|
169
171
|
if (this.options.showCheckboxBackground || this._form.settings.showCheckboxBackground) {
|
|
170
172
|
params.push('checkboxbackground=1');
|
|
171
173
|
}
|
|
@@ -220,7 +222,9 @@ class PDF extends Webform_1.default {
|
|
|
220
222
|
message.type = 'iframe-data';
|
|
221
223
|
}
|
|
222
224
|
this.iframeReady.then(() => {
|
|
223
|
-
if (this.iframeElement &&
|
|
225
|
+
if (this.iframeElement &&
|
|
226
|
+
this.iframeElement.contentWindow &&
|
|
227
|
+
!(message.name === 'form' && this.iframeFormSetUp)) {
|
|
224
228
|
this.iframeElement.contentWindow.postMessage(JSON.stringify(message), '*');
|
|
225
229
|
this.iframeFormSetUp = message.name === 'form';
|
|
226
230
|
}
|
|
@@ -257,8 +261,7 @@ class PDF extends Webform_1.default {
|
|
|
257
261
|
isSubmitButtonHidden() {
|
|
258
262
|
let hidden = false;
|
|
259
263
|
(0, utils_1.eachComponent)(this.component.components, (component) => {
|
|
260
|
-
if (
|
|
261
|
-
((component.action === 'submit') || !component.action)) {
|
|
264
|
+
if (component.type === 'button' && (component.action === 'submit' || !component.action)) {
|
|
262
265
|
hidden = component.hidden || false;
|
|
263
266
|
}
|
|
264
267
|
});
|
|
@@ -275,7 +278,7 @@ if (typeof window !== 'undefined') {
|
|
|
275
278
|
try {
|
|
276
279
|
eventData = JSON.parse(event.data);
|
|
277
280
|
}
|
|
278
|
-
catch (
|
|
281
|
+
catch (ignoreErr) {
|
|
279
282
|
eventData = null;
|
|
280
283
|
}
|
|
281
284
|
// If this form exists, then emit the event within this form.
|
package/lib/cjs/PDFBuilder.js
CHANGED
|
@@ -50,15 +50,15 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
50
50
|
datetime: true,
|
|
51
51
|
file: true,
|
|
52
52
|
htmlelement: true,
|
|
53
|
-
signrequestsignature: true
|
|
54
|
-
}
|
|
53
|
+
signrequestsignature: true,
|
|
54
|
+
},
|
|
55
55
|
},
|
|
56
56
|
basic: false,
|
|
57
57
|
advanced: false,
|
|
58
58
|
layout: false,
|
|
59
59
|
data: false,
|
|
60
60
|
premium: false,
|
|
61
|
-
resource: false
|
|
61
|
+
resource: false,
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
get hasPDF() {
|
|
@@ -86,13 +86,11 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
86
86
|
group,
|
|
87
87
|
groupKey: group.key,
|
|
88
88
|
groupId: `group-container-${groupKey}`,
|
|
89
|
-
subgroups: []
|
|
89
|
+
subgroups: [],
|
|
90
90
|
})),
|
|
91
91
|
})),
|
|
92
92
|
}),
|
|
93
|
-
form: this.hasPDF ?
|
|
94
|
-
this.webform.render() :
|
|
95
|
-
this.renderTemplate('pdfBuilderUpload', {})
|
|
93
|
+
form: this.hasPDF ? this.webform.render() : this.renderTemplate('pdfBuilderUpload', {}),
|
|
96
94
|
});
|
|
97
95
|
return result;
|
|
98
96
|
}
|
|
@@ -100,13 +98,13 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
100
98
|
// PDF Upload
|
|
101
99
|
if (!this.hasPDF) {
|
|
102
100
|
this.loadRefs(element, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
fileDrop: 'single',
|
|
102
|
+
fileBrowse: 'single',
|
|
103
|
+
hiddenFileInputElement: 'single',
|
|
104
|
+
uploadError: 'single',
|
|
105
|
+
uploadProgress: 'single',
|
|
106
|
+
uploadProgressWrapper: 'single',
|
|
107
|
+
dragDropText: 'single',
|
|
110
108
|
});
|
|
111
109
|
this.addEventListener(this.refs['pdf-upload-button'], 'click', (event) => {
|
|
112
110
|
event.preventDefault();
|
|
@@ -162,7 +160,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
162
160
|
this.loadRefs(this.element, {
|
|
163
161
|
iframeDropzone: 'single',
|
|
164
162
|
'sidebar-container': 'multiple',
|
|
165
|
-
|
|
163
|
+
sidebar: 'single',
|
|
166
164
|
});
|
|
167
165
|
this.afterAttach();
|
|
168
166
|
return this.element;
|
|
@@ -195,7 +193,8 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
195
193
|
if (this.refs.uploadProgressWrapper) {
|
|
196
194
|
this.refs.uploadProgressWrapper.style.display = 'inherit';
|
|
197
195
|
}
|
|
198
|
-
formio
|
|
196
|
+
formio
|
|
197
|
+
.uploadFile('url', file, file, '', (event) => {
|
|
199
198
|
if (this.refs.uploadProgress) {
|
|
200
199
|
const progress = Math.floor((event.loaded / event.total) * 100);
|
|
201
200
|
this.refs.uploadProgress.style.width = `${progress}%`;
|
|
@@ -228,8 +227,10 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
228
227
|
}
|
|
229
228
|
lodash_1.default.set(this.webform.form, 'settings.pdf', {
|
|
230
229
|
id: result.data.file,
|
|
231
|
-
src: result.data.filesServer
|
|
232
|
-
|
|
230
|
+
src: result.data.filesServer
|
|
231
|
+
? `${result.data.filesServer}${result.data.path}`
|
|
232
|
+
: `${new URL(this.projectUrl).origin}/pdf-proxy${result.data.path}`,
|
|
233
|
+
nonFillableConversionUsed: autoConversionComponentsAssigned && result.data.formfields.nonFillableConversionUsed,
|
|
233
234
|
});
|
|
234
235
|
this.emit('pdfUploaded', result.data);
|
|
235
236
|
this.redraw();
|
|
@@ -250,7 +251,10 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
250
251
|
this.webform = new PDF_1.default(this.element, options);
|
|
251
252
|
this.webform.on('attach', () => {
|
|
252
253
|
// If the dropzone exists but has been removed in a PDF rebuild, reinstate it
|
|
253
|
-
if (this.refs.iframeDropzone &&
|
|
254
|
+
if (this.refs.iframeDropzone &&
|
|
255
|
+
![
|
|
256
|
+
...this.refs.form.children,
|
|
257
|
+
].includes(this.refs.iframeDropzone)) {
|
|
254
258
|
this.prependTo(this.refs.iframeDropzone, this.refs.form);
|
|
255
259
|
}
|
|
256
260
|
});
|
|
@@ -281,14 +285,14 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
281
285
|
return {
|
|
282
286
|
formioComponent: component.parent,
|
|
283
287
|
formioContainer: container,
|
|
284
|
-
originalComponent
|
|
288
|
+
originalComponent,
|
|
285
289
|
};
|
|
286
290
|
}
|
|
287
291
|
initIframeEvents() {
|
|
288
292
|
this.webform.off('iframe-elementUpdate');
|
|
289
293
|
this.webform.off('iframe-componentUpdate');
|
|
290
294
|
this.webform.off('iframe-componentClick');
|
|
291
|
-
this.webform.on('iframe-elementUpdate', schema => {
|
|
295
|
+
this.webform.on('iframe-elementUpdate', (schema) => {
|
|
292
296
|
const component = this.webform.getComponentById(schema.id);
|
|
293
297
|
if (component && component.component) {
|
|
294
298
|
const isNew = true;
|
|
@@ -297,16 +301,18 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
297
301
|
left: schema.left,
|
|
298
302
|
top: schema.top,
|
|
299
303
|
height: schema.height,
|
|
300
|
-
width: schema.width
|
|
304
|
+
width: schema.width,
|
|
301
305
|
};
|
|
302
|
-
if (!this.options.noNewEdit &&
|
|
306
|
+
if (!this.options.noNewEdit &&
|
|
307
|
+
!component.component.noNewEdit &&
|
|
308
|
+
this.hasEditTabs(component.type)) {
|
|
303
309
|
this.editComponent(component.component, this.getParentContainer(component), isNew);
|
|
304
310
|
}
|
|
305
311
|
this.emit('updateComponent', component.component);
|
|
306
312
|
}
|
|
307
313
|
return component;
|
|
308
314
|
});
|
|
309
|
-
this.webform.on('iframe-componentUpdate', schema => {
|
|
315
|
+
this.webform.on('iframe-componentUpdate', (schema) => {
|
|
310
316
|
const component = this.webform.getComponentById(schema.id);
|
|
311
317
|
if (component && component.component) {
|
|
312
318
|
component.component.overlay = {
|
|
@@ -314,14 +320,14 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
314
320
|
left: schema.overlay.left,
|
|
315
321
|
top: schema.overlay.top,
|
|
316
322
|
height: schema.overlay.height,
|
|
317
|
-
width: schema.overlay.width
|
|
323
|
+
width: schema.overlay.width,
|
|
318
324
|
};
|
|
319
325
|
this.emit('updateComponent', component.component);
|
|
320
326
|
this.emit('change', this.form);
|
|
321
327
|
}
|
|
322
328
|
return component;
|
|
323
329
|
});
|
|
324
|
-
this.webform.on('iframe-componentClick', schema => {
|
|
330
|
+
this.webform.on('iframe-componentClick', (schema) => {
|
|
325
331
|
const component = this.webform.getComponentById(schema.id);
|
|
326
332
|
if (component && this.hasEditTabs(component.type)) {
|
|
327
333
|
this.editComponent(component.component, this.getParentContainer(component));
|
|
@@ -363,8 +369,10 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
363
369
|
if (!this.refs['sidebar-container']) {
|
|
364
370
|
return;
|
|
365
371
|
}
|
|
366
|
-
this.refs['sidebar-container'].forEach(container => {
|
|
367
|
-
[
|
|
372
|
+
this.refs['sidebar-container'].forEach((container) => {
|
|
373
|
+
[
|
|
374
|
+
...container.children,
|
|
375
|
+
].forEach((el) => {
|
|
368
376
|
el.draggable = true;
|
|
369
377
|
el.setAttribute('draggable', true);
|
|
370
378
|
this.removeEventListener(el, 'dragstart');
|
|
@@ -382,8 +390,10 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
382
390
|
return;
|
|
383
391
|
}
|
|
384
392
|
const iframeRect = (0, utils_1.getElementRect)(this.webform.refs.iframeContainer);
|
|
385
|
-
this.refs.iframeDropzone.style.height =
|
|
386
|
-
|
|
393
|
+
this.refs.iframeDropzone.style.height =
|
|
394
|
+
iframeRect && iframeRect.height ? `${iframeRect.height}px` : '1000px';
|
|
395
|
+
this.refs.iframeDropzone.style.width =
|
|
396
|
+
iframeRect && iframeRect.width ? `${iframeRect.width}px` : '100%';
|
|
387
397
|
}
|
|
388
398
|
onDragStart(e) {
|
|
389
399
|
// Taking the current offset of a dragged item relative to the cursor
|
|
@@ -415,8 +425,11 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
415
425
|
// If there hasn't been a drop event on the dropzone, we're done
|
|
416
426
|
if (!this.dropEvent) {
|
|
417
427
|
// a 'drop' event may not be emited in the chrome browser when using a Mac, therefore an additional check has been added
|
|
418
|
-
|
|
419
|
-
|
|
428
|
+
if (!this.dropEmitted &&
|
|
429
|
+
((0, utils_1.getBrowserInfo)().chrome || (0, utils_1.getBrowserInfo)().edge) &&
|
|
430
|
+
globalThis.navigator.userAgentData.platform === 'macOS' &&
|
|
431
|
+
iframeRect.left < e.clientX &&
|
|
432
|
+
iframeRect.top < e.clientY) {
|
|
420
433
|
this.dropEvent = e;
|
|
421
434
|
this.dropEvent.dataTransfer.effectAllowed = 'all';
|
|
422
435
|
this.dropEmitted = true;
|
|
@@ -438,10 +451,12 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
438
451
|
builder_1.default.uniquify(((_a = this.webform._form) === null || _a === void 0 ? void 0 : _a.components) || [], schema);
|
|
439
452
|
this.webform._form.components.push(schema);
|
|
440
453
|
schema.overlay = {
|
|
441
|
-
top: layerY
|
|
442
|
-
|
|
454
|
+
top: layerY
|
|
455
|
+
? layerY - this.itemOffsetY + HEIGHT
|
|
456
|
+
: e.clientY - iframeRect.top - (this.itemOffsetY - HEIGHT) * 2,
|
|
457
|
+
left: layerX ? layerX - this.itemOffsetX : e.clientX - iframeRect.left - this.itemOffsetX * 2,
|
|
443
458
|
width: WIDTH,
|
|
444
|
-
height: HEIGHT
|
|
459
|
+
height: HEIGHT,
|
|
445
460
|
};
|
|
446
461
|
this.webform.addComponent(schema, {}, null, true);
|
|
447
462
|
this.webform.postMessage({ name: 'addElement', data: schema });
|
|
@@ -473,7 +488,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
473
488
|
data: {
|
|
474
489
|
compId: comp.component.id,
|
|
475
490
|
errorMessage: `API Key is not unique: ${comp.key}`,
|
|
476
|
-
}
|
|
491
|
+
},
|
|
477
492
|
});
|
|
478
493
|
}
|
|
479
494
|
});
|