@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
|
@@ -14,7 +14,7 @@ export default function (...extend) {
|
|
|
14
14
|
label: 'Templates',
|
|
15
15
|
key: 'templates',
|
|
16
16
|
weight: 5,
|
|
17
|
-
components: EditGridEditTemplates
|
|
17
|
+
components: EditGridEditTemplates,
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
key: 'display',
|
|
@@ -26,7 +26,7 @@ export default function (...extend) {
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
key: 'validation',
|
|
29
|
-
components: EditGridEditValidation
|
|
29
|
+
components: EditGridEditValidation,
|
|
30
30
|
},
|
|
31
31
|
], ...extend);
|
|
32
32
|
}
|
|
@@ -135,13 +135,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
135
135
|
get rowTemplate() {
|
|
136
136
|
let rowTemplate;
|
|
137
137
|
if (Evaluator.noeval) {
|
|
138
|
-
rowTemplate = this.displayAsTable ?
|
|
139
|
-
templates.tableRow
|
|
140
|
-
: templates.row;
|
|
138
|
+
rowTemplate = this.displayAsTable ? templates.tableRow : templates.row;
|
|
141
139
|
}
|
|
142
140
|
else {
|
|
143
|
-
rowTemplate = this.displayAsTable
|
|
144
|
-
_.get(this.component, 'templates.tableRow', this.defaultRowTemplate)
|
|
141
|
+
rowTemplate = this.displayAsTable
|
|
142
|
+
? _.get(this.component, 'templates.tableRow', this.defaultRowTemplate)
|
|
145
143
|
: _.get(this.component, 'templates.row', this.defaultRowTemplate);
|
|
146
144
|
}
|
|
147
145
|
return rowTemplate;
|
|
@@ -149,13 +147,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
149
147
|
get headerTemplate() {
|
|
150
148
|
let headerTemplate;
|
|
151
149
|
if (Evaluator.noeval) {
|
|
152
|
-
headerTemplate = this.displayAsTable ?
|
|
153
|
-
templates.tableHeader
|
|
154
|
-
: templates.header;
|
|
150
|
+
headerTemplate = this.displayAsTable ? templates.tableHeader : templates.header;
|
|
155
151
|
}
|
|
156
152
|
else {
|
|
157
|
-
headerTemplate = this.displayAsTable
|
|
158
|
-
_.get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate)
|
|
153
|
+
headerTemplate = this.displayAsTable
|
|
154
|
+
? _.get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate)
|
|
159
155
|
: _.get(this.component, 'templates.header', this.defaultHeaderTemplate);
|
|
160
156
|
}
|
|
161
157
|
return headerTemplate;
|
|
@@ -251,11 +247,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
251
247
|
this.type = 'editgrid';
|
|
252
248
|
}
|
|
253
249
|
hasRemoveButtons() {
|
|
254
|
-
return !this.component.disableAddingRemovingRows &&
|
|
250
|
+
return (!this.component.disableAddingRemovingRows &&
|
|
255
251
|
!this.options.readOnly &&
|
|
256
252
|
!this.disabled &&
|
|
257
253
|
this.fullMode &&
|
|
258
|
-
|
|
254
|
+
this.dataValue.length > _.get(this.component, 'validate.minLength', 0));
|
|
259
255
|
}
|
|
260
256
|
init() {
|
|
261
257
|
if (this.builderMode) {
|
|
@@ -306,12 +302,20 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
306
302
|
});
|
|
307
303
|
}
|
|
308
304
|
isOpen(editRow) {
|
|
309
|
-
return [
|
|
305
|
+
return [
|
|
306
|
+
EditRowState.New,
|
|
307
|
+
EditRowState.Editing,
|
|
308
|
+
EditRowState.Viewing,
|
|
309
|
+
].includes(editRow.state);
|
|
310
310
|
}
|
|
311
311
|
isComponentVisibleInSomeRow(component) {
|
|
312
312
|
const rows = this.editRows;
|
|
313
|
-
const savedStates = [
|
|
314
|
-
|
|
313
|
+
const savedStates = [
|
|
314
|
+
EditRowState.Saved,
|
|
315
|
+
EditRowState.Editing,
|
|
316
|
+
EditRowState.Draft,
|
|
317
|
+
];
|
|
318
|
+
const savedRows = rows.filter((row) => _.includes(savedStates, row.state));
|
|
315
319
|
this.visibleInHeader = this.visibleInHeader || [];
|
|
316
320
|
const changeVisibleInHeader = (component, isVisible) => {
|
|
317
321
|
if (!isVisible) {
|
|
@@ -331,11 +335,15 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
331
335
|
comp.checkConditions();
|
|
332
336
|
});
|
|
333
337
|
const isVisible = checkComponent ? checkComponent.visible : true;
|
|
334
|
-
[
|
|
338
|
+
[
|
|
339
|
+
...this.components,
|
|
340
|
+
].forEach((comp) => this.removeComponent(comp, this.components));
|
|
335
341
|
changeVisibleInHeader(component, isVisible);
|
|
336
342
|
return isVisible;
|
|
337
343
|
}
|
|
338
|
-
const isOpenRowWhenEmpty = _.get(this.component, 'openWhenEmpty') &&
|
|
344
|
+
const isOpenRowWhenEmpty = _.get(this.component, 'openWhenEmpty') &&
|
|
345
|
+
rows.length === 1 &&
|
|
346
|
+
rows[0].state === EditRowState.New;
|
|
339
347
|
if (!_.isEmpty(rows) && _.isEmpty(savedRows) && !isOpenRowWhenEmpty) {
|
|
340
348
|
return _.includes(this.visibleInHeader, component.key);
|
|
341
349
|
}
|
|
@@ -362,34 +370,35 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
362
370
|
const headerTemplate = this.headerTemplate;
|
|
363
371
|
const t = this.t.bind(this);
|
|
364
372
|
const templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';
|
|
365
|
-
return super.render(children ||
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
373
|
+
return super.render(children ||
|
|
374
|
+
this.renderTemplate(templateName, {
|
|
375
|
+
ref: {
|
|
376
|
+
row: this.rowRef,
|
|
377
|
+
addRow: this.addRowRef,
|
|
378
|
+
saveRow: this.saveRowRef,
|
|
379
|
+
cancelRow: this.cancelRowRef,
|
|
380
|
+
},
|
|
381
|
+
header: this.renderString(headerTemplate, {
|
|
382
|
+
displayValue: (component) => this.displayComponentValue(component, true),
|
|
383
|
+
components: this.component.components,
|
|
384
|
+
value: dataValue,
|
|
385
|
+
t,
|
|
386
|
+
}),
|
|
387
|
+
footer: this.renderString(_.get(this.component, 'templates.footer'), {
|
|
388
|
+
components: this.component.components,
|
|
389
|
+
value: dataValue,
|
|
390
|
+
t,
|
|
391
|
+
}),
|
|
392
|
+
rows: this.editRows.map(this.renderRow.bind(this)),
|
|
393
|
+
openRows: this.editRows.map((row) => this.isOpen(row)),
|
|
394
|
+
errors: this.editRows.map((row) => row.error),
|
|
395
|
+
hasAddButton: this.hasAddButton(),
|
|
396
|
+
hasRemoveButtons: this.hasRemoveButtons(),
|
|
397
|
+
}));
|
|
389
398
|
}
|
|
390
399
|
renderComponents(components) {
|
|
391
400
|
components = components || this.getComponents();
|
|
392
|
-
const children = components.map(component => component.render());
|
|
401
|
+
const children = components.map((component) => component.render());
|
|
393
402
|
const templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';
|
|
394
403
|
return this.renderTemplate(templateName, {
|
|
395
404
|
children,
|
|
@@ -460,14 +469,18 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
460
469
|
}
|
|
461
470
|
this.emit(eventName, {
|
|
462
471
|
component: this.component,
|
|
463
|
-
data: this.dataValue[rowIndex]
|
|
472
|
+
data: this.dataValue[rowIndex],
|
|
464
473
|
});
|
|
465
474
|
},
|
|
466
|
-
}
|
|
467
|
-
].forEach(({ className, event, action
|
|
475
|
+
},
|
|
476
|
+
].forEach(({ className, event, action }) => {
|
|
468
477
|
const elements = row.getElementsByClassName(className);
|
|
469
478
|
Array.prototype.forEach.call(elements, (element) => {
|
|
470
|
-
if (this.options.pdf &&
|
|
479
|
+
if (this.options.pdf &&
|
|
480
|
+
_.intersection(element.classList, [
|
|
481
|
+
'editRow',
|
|
482
|
+
'removeRow',
|
|
483
|
+
]).length) {
|
|
471
484
|
element.style.display = 'none';
|
|
472
485
|
}
|
|
473
486
|
else {
|
|
@@ -503,8 +516,9 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
503
516
|
return instance ? instance.visible : true;
|
|
504
517
|
}
|
|
505
518
|
displayComponentValue(component, header) {
|
|
506
|
-
return !!((!component.hasOwnProperty('tableView') || component.tableView)
|
|
507
|
-
|
|
519
|
+
return !!((!component.hasOwnProperty('tableView') || component.tableView) && header
|
|
520
|
+
? this.isComponentVisibleInSomeRow(component)
|
|
521
|
+
: _.includes(this.visibleInHeader, component.key));
|
|
508
522
|
}
|
|
509
523
|
renderRow(row, rowIndex) {
|
|
510
524
|
const dataValue = this.dataValue;
|
|
@@ -527,12 +541,16 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
527
541
|
const view = instance ? instance.getView(data || instance.dataValue) : '';
|
|
528
542
|
// If there is an html tag in view, don't allow it to be injected in template
|
|
529
543
|
const htmlTagRegExp = new RegExp('<(.*?)>');
|
|
530
|
-
return typeof view === 'string' &&
|
|
544
|
+
return typeof view === 'string' &&
|
|
545
|
+
view.length &&
|
|
546
|
+
!instance.component?.template &&
|
|
547
|
+
htmlTagRegExp.test(view) &&
|
|
548
|
+
instance.component?.inputFormat !== 'html'
|
|
531
549
|
? `<input type="text" value="${view.replace(/"/g, '"')}" readonly/>`
|
|
532
550
|
: view;
|
|
533
551
|
},
|
|
534
552
|
state: this.editRows[rowIndex].state,
|
|
535
|
-
t: this.t.bind(this)
|
|
553
|
+
t: this.t.bind(this),
|
|
536
554
|
});
|
|
537
555
|
}
|
|
538
556
|
}
|
|
@@ -556,7 +574,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
556
574
|
return this.builderMode
|
|
557
575
|
? super.getComponents()
|
|
558
576
|
: _.isNumber(rowIndex)
|
|
559
|
-
?
|
|
577
|
+
? this.editRows[rowIndex]?.components || []
|
|
560
578
|
: this.editRows.reduce((result, row) => result.concat(row.components || []), []);
|
|
561
579
|
}
|
|
562
580
|
destroy(all = false) {
|
|
@@ -617,7 +635,9 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
617
635
|
editRow.willBeSaved = false;
|
|
618
636
|
const { components } = editRow;
|
|
619
637
|
modalContent.innerHTML = this.renderComponents(components);
|
|
620
|
-
const dialog = this.component.modal
|
|
638
|
+
const dialog = this.component.modal
|
|
639
|
+
? this.createModal(modalContent, {}, () => this.showDialog(rowIndex))
|
|
640
|
+
: undefined;
|
|
621
641
|
dialog.classList.add(`editgrid-row-modal-${this.id}`);
|
|
622
642
|
editRow.dialog = dialog;
|
|
623
643
|
if (this.alert) {
|
|
@@ -670,7 +690,9 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
670
690
|
}
|
|
671
691
|
showDialog(rowIndex) {
|
|
672
692
|
const editRow = this.editRows[rowIndex];
|
|
673
|
-
if (editRow.state === EditRowState.New
|
|
693
|
+
if (editRow.state === EditRowState.New
|
|
694
|
+
? _.isEqual(this.emptyRow, editRow.data)
|
|
695
|
+
: _.isEqual(editRow.backup, editRow.data)) {
|
|
674
696
|
return Promise.resolve();
|
|
675
697
|
}
|
|
676
698
|
const wrapper = this.ce('div', { ref: 'confirmationDialog' });
|
|
@@ -711,7 +733,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
711
733
|
}
|
|
712
734
|
editRow.prevState = editRow.state;
|
|
713
735
|
editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;
|
|
714
|
-
if (this.lazyLoad &&
|
|
736
|
+
if (this.lazyLoad && editRow.components.length === 0) {
|
|
715
737
|
editRow.components = this.createRowComponents(editRow.data, rowIndex);
|
|
716
738
|
}
|
|
717
739
|
const dataSnapshot = fastCloneDeep(editRow.data);
|
|
@@ -806,7 +828,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
806
828
|
case EditRowState.New: {
|
|
807
829
|
const newIndex = dataValue.length;
|
|
808
830
|
dataValue.push(editRow.data);
|
|
809
|
-
editRow.components.forEach(component => component.rowIndex = newIndex);
|
|
831
|
+
editRow.components.forEach((component) => (component.rowIndex = newIndex));
|
|
810
832
|
if (rowIndex !== newIndex) {
|
|
811
833
|
this.editRows.splice(rowIndex, 1);
|
|
812
834
|
this.editRows.splice(newIndex, 0, editRow);
|
|
@@ -819,17 +841,22 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
819
841
|
}
|
|
820
842
|
}
|
|
821
843
|
}
|
|
822
|
-
editRow.state =
|
|
844
|
+
editRow.state =
|
|
845
|
+
this.component.rowDrafts && errors.length ? EditRowState.Draft : EditRowState.Saved;
|
|
823
846
|
editRow.backup = null;
|
|
824
847
|
this.updateValue();
|
|
825
848
|
this.emit('editGridSaveRow', {
|
|
826
849
|
component: this.component,
|
|
827
850
|
row: editRow.data,
|
|
828
|
-
instance: this
|
|
851
|
+
instance: this,
|
|
852
|
+
});
|
|
853
|
+
this.triggerChange({
|
|
854
|
+
modified,
|
|
855
|
+
noPristineChangeOnModified: modified && this.component.rowDrafts,
|
|
856
|
+
isolateRow: true,
|
|
829
857
|
});
|
|
830
|
-
this.triggerChange({ modified, noPristineChangeOnModified: modified && this.component.rowDrafts, isolateRow: true });
|
|
831
858
|
if (this.component.rowDrafts) {
|
|
832
|
-
editRow.components.forEach(comp => comp.setPristine(this.pristine));
|
|
859
|
+
editRow.components.forEach((comp) => comp.setPristine(this.pristine));
|
|
833
860
|
}
|
|
834
861
|
this.checkValidity(null, true);
|
|
835
862
|
this.redraw();
|
|
@@ -881,13 +908,17 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
881
908
|
this.removeSubmissionMetadataRow(rowIndex);
|
|
882
909
|
this.splice(rowIndex);
|
|
883
910
|
this.emit('editGridDeleteRow', {
|
|
884
|
-
index: rowIndex
|
|
911
|
+
index: rowIndex,
|
|
885
912
|
});
|
|
886
913
|
this.editRows.splice(rowIndex, 1);
|
|
887
914
|
this.openWhenEmpty();
|
|
888
915
|
this.updateRowsComponents(rowIndex);
|
|
889
916
|
this.updateValue();
|
|
890
|
-
this.triggerChange({
|
|
917
|
+
this.triggerChange({
|
|
918
|
+
modified,
|
|
919
|
+
noPristineChangeOnModified: modified && this.component.rowDrafts,
|
|
920
|
+
isolateRow: true,
|
|
921
|
+
});
|
|
891
922
|
this.checkValidity(null, true);
|
|
892
923
|
this.checkData();
|
|
893
924
|
this.redraw();
|
|
@@ -906,7 +937,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
906
937
|
return this.component.components.map((col, colIndex) => {
|
|
907
938
|
if (recreatePartially && currentRowComponents && this.variableTypeComponentsIndexes.length) {
|
|
908
939
|
const currentComp = currentRowComponents[colIndex];
|
|
909
|
-
const shouldRecreate = _.includes(this.variableTypeComponentsIndexes, colIndex) &&
|
|
940
|
+
const shouldRecreate = _.includes(this.variableTypeComponentsIndexes, colIndex) &&
|
|
941
|
+
currentComp?.type !== currentComp?.component?.type;
|
|
910
942
|
if (!shouldRecreate) {
|
|
911
943
|
return currentComp;
|
|
912
944
|
}
|
|
@@ -918,7 +950,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
918
950
|
options.row = `${rowIndex}-${colIndex}`;
|
|
919
951
|
options.rowIndex = rowIndex;
|
|
920
952
|
options.onChange = (flags = {}, changed, modified) => {
|
|
921
|
-
if (changed.instance.root?.id &&
|
|
953
|
+
if (changed.instance.root?.id && this.root?.id !== changed.instance.root.id) {
|
|
922
954
|
changed.instance.root.triggerChange(flags, changed, modified);
|
|
923
955
|
}
|
|
924
956
|
else if (!this.component.modal) {
|
|
@@ -947,7 +979,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
947
979
|
});
|
|
948
980
|
}
|
|
949
981
|
hasOpenRows() {
|
|
950
|
-
return this.editRows.some(row => this.isOpen(row));
|
|
982
|
+
return this.editRows.some((row) => this.isOpen(row));
|
|
951
983
|
}
|
|
952
984
|
getAttachedData(data = null) {
|
|
953
985
|
const ourData = fastCloneDeep(data || this._data || this.rootValue);
|
|
@@ -956,24 +988,26 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
956
988
|
}
|
|
957
989
|
shouldValidateDraft(editRow) {
|
|
958
990
|
// Draft rows should be validated only when there was an attempt to submit a form
|
|
959
|
-
return (editRow.state === EditRowState.Draft &&
|
|
991
|
+
return ((editRow.state === EditRowState.Draft &&
|
|
960
992
|
!this.pristine &&
|
|
961
993
|
!this.root?.pristine &&
|
|
962
994
|
!this.hasOpenRows()) ||
|
|
963
|
-
this.root?.submitted;
|
|
995
|
+
this.root?.submitted);
|
|
964
996
|
}
|
|
965
997
|
shouldValidateRow(editRow, dirty, fromSubmission) {
|
|
966
|
-
return this.shouldValidateDraft(editRow) ||
|
|
998
|
+
return (this.shouldValidateDraft(editRow) ||
|
|
967
999
|
editRow.state === EditRowState.New ||
|
|
968
1000
|
editRow.state === EditRowState.Editing ||
|
|
969
1001
|
editRow.alerts ||
|
|
970
1002
|
fromSubmission ||
|
|
971
|
-
dirty;
|
|
1003
|
+
dirty);
|
|
972
1004
|
}
|
|
973
1005
|
validateRow(editRow, dirty, forceSilentCheck, fromSubmission) {
|
|
974
1006
|
editRow.errors = [];
|
|
975
1007
|
if (this.shouldValidateRow(editRow, dirty, fromSubmission)) {
|
|
976
|
-
const silentCheck = forceSilentCheck === false
|
|
1008
|
+
const silentCheck = forceSilentCheck === false
|
|
1009
|
+
? false
|
|
1010
|
+
: (this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck;
|
|
977
1011
|
const rootValue = fastCloneDeep(this.rootValue);
|
|
978
1012
|
const editGridValue = _.get(rootValue, this.path, []);
|
|
979
1013
|
editGridValue[editRow.rowIndex] = editRow.data;
|
|
@@ -989,36 +1023,40 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
989
1023
|
parent: this.component,
|
|
990
1024
|
parentPaths: {
|
|
991
1025
|
...this.paths,
|
|
992
|
-
dataIndex: editRow.rowIndex
|
|
1026
|
+
dataIndex: editRow.rowIndex,
|
|
993
1027
|
},
|
|
994
1028
|
processors: [
|
|
995
1029
|
{
|
|
996
1030
|
process: validationProcessorProcess,
|
|
997
|
-
processSync: validationProcessorProcess
|
|
998
|
-
}
|
|
999
|
-
]
|
|
1031
|
+
processSync: validationProcessorProcess,
|
|
1032
|
+
},
|
|
1033
|
+
],
|
|
1000
1034
|
}).errors;
|
|
1001
|
-
editRow.errors =
|
|
1002
|
-
|
|
1003
|
-
|
|
1035
|
+
editRow.errors =
|
|
1036
|
+
this.component.modal || this.component.rowDrafts
|
|
1037
|
+
? errors
|
|
1038
|
+
: errors.filter((err) => _.find(this.visibleErrors, [
|
|
1039
|
+
'component.id',
|
|
1040
|
+
err.component.id,
|
|
1041
|
+
]));
|
|
1004
1042
|
}
|
|
1005
1043
|
// TODO: this is essentially running its own custom validation and should be moved into a validation rule
|
|
1006
1044
|
if (this.component.validate && this.component.validate.row) {
|
|
1007
1045
|
const valid = this.evaluate(this.component.validate.row, {
|
|
1008
|
-
valid:
|
|
1009
|
-
row: editRow.data
|
|
1046
|
+
valid: editRow.length === 0,
|
|
1047
|
+
row: editRow.data,
|
|
1010
1048
|
}, 'valid', true);
|
|
1011
1049
|
if (valid.toString() !== 'true') {
|
|
1012
1050
|
editRow.errors.push({
|
|
1013
1051
|
type: 'error',
|
|
1014
1052
|
rowError: true,
|
|
1015
|
-
message: valid.toString()
|
|
1053
|
+
message: valid.toString(),
|
|
1016
1054
|
});
|
|
1017
1055
|
}
|
|
1018
1056
|
if (valid === null) {
|
|
1019
1057
|
editRow.errors.push({
|
|
1020
1058
|
type: 'error',
|
|
1021
|
-
message: `Invalid row validation for ${this.key}
|
|
1059
|
+
message: `Invalid row validation for ${this.key}`,
|
|
1022
1060
|
});
|
|
1023
1061
|
}
|
|
1024
1062
|
}
|
|
@@ -1051,7 +1089,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1051
1089
|
const { silentCheck, fromSubmission } = options;
|
|
1052
1090
|
const superValid = super.checkComponentValidity(data, dirty, row, options, errors);
|
|
1053
1091
|
// If super tells us that component invalid and there is no need to update alerts, just return false
|
|
1054
|
-
if (!superValid &&
|
|
1092
|
+
if (!superValid && !this.alert && !this.hasOpenRows()) {
|
|
1055
1093
|
return false;
|
|
1056
1094
|
}
|
|
1057
1095
|
let rowsEditing = false;
|
|
@@ -1065,8 +1103,10 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1065
1103
|
const rowContainer = this.rowRefs[index];
|
|
1066
1104
|
if (rowContainer) {
|
|
1067
1105
|
const errorContainer = rowContainer.querySelector('.editgrid-row-error');
|
|
1068
|
-
if (rowErrors.length &&
|
|
1069
|
-
|
|
1106
|
+
if (rowErrors.length &&
|
|
1107
|
+
errorContainer &&
|
|
1108
|
+
(!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
|
|
1109
|
+
const rowError = rowErrors.find((error) => error.rowError);
|
|
1070
1110
|
this.addClass(errorContainer, 'help-block');
|
|
1071
1111
|
errorContainer.textContent = this.t(rowError ? rowError.message : this.errorMessage('invalidRowError'));
|
|
1072
1112
|
}
|
|
@@ -1077,10 +1117,12 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1077
1117
|
}
|
|
1078
1118
|
}
|
|
1079
1119
|
// If this is a dirty check, and any rows are still editing, we need to throw validation error.
|
|
1080
|
-
rowsEditing |=
|
|
1120
|
+
rowsEditing |= dirty && this.isOpen(editRow);
|
|
1081
1121
|
});
|
|
1082
1122
|
if (allRowErrors.length) {
|
|
1083
|
-
if (!silentCheck &&
|
|
1123
|
+
if (!silentCheck &&
|
|
1124
|
+
(dirty || this.dirty) &&
|
|
1125
|
+
(!this.component.rowDrafts || this.root?.submitted)) {
|
|
1084
1126
|
this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);
|
|
1085
1127
|
this.removeClass(this.element, 'has-error');
|
|
1086
1128
|
}
|
|
@@ -1097,7 +1139,9 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1097
1139
|
if (allRowErrors.length && this.root?.submitted && !message) {
|
|
1098
1140
|
this._errors = this.setCustomValidity(message, dirty);
|
|
1099
1141
|
errors.push(...this._errors);
|
|
1100
|
-
this.root.showErrors([
|
|
1142
|
+
this.root.showErrors([
|
|
1143
|
+
message,
|
|
1144
|
+
]);
|
|
1101
1145
|
}
|
|
1102
1146
|
else {
|
|
1103
1147
|
this._errors = this.setCustomValidity(message, dirty);
|
|
@@ -1130,7 +1174,9 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1130
1174
|
}
|
|
1131
1175
|
if (!Array.isArray(value)) {
|
|
1132
1176
|
if (typeof value === 'object') {
|
|
1133
|
-
value = [
|
|
1177
|
+
value = [
|
|
1178
|
+
value,
|
|
1179
|
+
];
|
|
1134
1180
|
}
|
|
1135
1181
|
else {
|
|
1136
1182
|
return false;
|
|
@@ -1160,10 +1206,12 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1160
1206
|
});
|
|
1161
1207
|
let { length: dataLength } = this.dataValue;
|
|
1162
1208
|
// If the last row is a new row, then do not remove it.
|
|
1163
|
-
if (this.editRows[dataLength] &&
|
|
1164
|
-
dataLength =
|
|
1209
|
+
if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {
|
|
1210
|
+
dataLength = dataLength + 1;
|
|
1165
1211
|
}
|
|
1166
|
-
this.editRows
|
|
1212
|
+
this.editRows
|
|
1213
|
+
.slice(dataLength)
|
|
1214
|
+
.forEach((editRow, index) => this.baseRemoveRow(dataLength + index));
|
|
1167
1215
|
this.editRows = this.editRows.slice(0, dataLength);
|
|
1168
1216
|
this.openWhenEmpty();
|
|
1169
1217
|
this.updateOnChange(flags, changed);
|
|
@@ -5,7 +5,7 @@ export default [
|
|
|
5
5
|
weight: 105,
|
|
6
6
|
key: 'inlineEdit',
|
|
7
7
|
label: 'Inline Editing',
|
|
8
|
-
tooltip:
|
|
8
|
+
tooltip: "Check this if you would like your changes within 'edit' mode to be committed directly to the submission object as that row is being changed",
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
key: 'defaultValue',
|
|
@@ -13,6 +13,6 @@ export default [
|
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
key: 'multiple',
|
|
16
|
-
ignore: true
|
|
16
|
+
ignore: true,
|
|
17
17
|
},
|
|
18
18
|
];
|
|
@@ -11,10 +11,10 @@ export default [
|
|
|
11
11
|
input: true,
|
|
12
12
|
placeholder: '/*** Lodash Template Code ***/',
|
|
13
13
|
description: 'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',
|
|
14
|
-
tooltip:
|
|
14
|
+
tooltip: "This is the <a href='https://lodash.com/docs/4.17.5#template'>Lodash Template</a> used to render the header of the Edit grid.",
|
|
15
15
|
customConditional({ data }) {
|
|
16
16
|
return (!Evaluator.noeval || Evaluator.protectedEval) && !data.displayAsTable;
|
|
17
|
-
}
|
|
17
|
+
},
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
type: 'textarea',
|
|
@@ -27,10 +27,10 @@ export default [
|
|
|
27
27
|
input: true,
|
|
28
28
|
placeholder: '/*** Lodash Template Code ***/',
|
|
29
29
|
description: 'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',
|
|
30
|
-
tooltip:
|
|
30
|
+
tooltip: "This is the <a href='https://lodash.com/docs/4.17.5#template'>Lodash Template</a> used to render the header of the Edit grid.",
|
|
31
31
|
customConditional({ data }) {
|
|
32
32
|
return (!Evaluator.noeval || Evaluator.protectedEval) && data.displayAsTable;
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
type: 'textarea',
|
|
@@ -45,10 +45,10 @@ export default [
|
|
|
45
45
|
description: 'Three available variables. "row" is an object of one row\'s data, "components"' +
|
|
46
46
|
' is the array of components in the grid and "state" is current row\'s state (can be "draft" or "saved").' +
|
|
47
47
|
' To add click events, add the classes "editRow" and "removeRow" to elements.',
|
|
48
|
-
tooltip:
|
|
48
|
+
tooltip: "This is the <a href='https://lodash.com/docs/4.17.5#template'>Lodash Template</a> used to render each row of the Edit grid.",
|
|
49
49
|
customConditional({ data }) {
|
|
50
50
|
return (!Evaluator.noeval || Evaluator.protectedEval) && !data.displayAsTable;
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
type: 'textarea',
|
|
@@ -63,10 +63,10 @@ export default [
|
|
|
63
63
|
description: 'Three available variables. "row" is an object of one row\'s data, "components"' +
|
|
64
64
|
' is the array of components in the grid and "state" is current row\'s state (can be "draft" or "saved").' +
|
|
65
65
|
' To add click events, add the classes "editRow" and "removeRow" to elements.',
|
|
66
|
-
tooltip:
|
|
66
|
+
tooltip: "This is the <a href='https://lodash.com/docs/4.17.5#template'>Lodash Template</a> used to render each row of the Edit grid.",
|
|
67
67
|
customConditional({ data }) {
|
|
68
68
|
return (!Evaluator.noeval || Evaluator.protectedEval) && data.displayAsTable;
|
|
69
|
-
}
|
|
69
|
+
},
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
type: 'textarea',
|
|
@@ -78,10 +78,10 @@ export default [
|
|
|
78
78
|
input: true,
|
|
79
79
|
placeholder: '/*** Lodash Template Code ***/',
|
|
80
80
|
description: 'Two available variables. "value" is the array of row data and "components" is the array of components in the grid.',
|
|
81
|
-
tooltip:
|
|
81
|
+
tooltip: "This is the <a href='https://lodash.com/docs/4.17.5#template'>Lodash Template</a> used to render the footer of the Edit grid.",
|
|
82
82
|
customConditional() {
|
|
83
83
|
return !Evaluator.noeval || Evaluator.protectedEval;
|
|
84
|
-
}
|
|
84
|
+
},
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
type: 'textfield',
|
|
@@ -89,7 +89,7 @@ export default [
|
|
|
89
89
|
key: 'rowClass',
|
|
90
90
|
label: 'Row CSS Class',
|
|
91
91
|
placeholder: 'Row CSS Class',
|
|
92
|
-
tooltip: 'CSS class to add to the edit row wrapper.'
|
|
92
|
+
tooltip: 'CSS class to add to the edit row wrapper.',
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
type: 'textfield',
|
|
@@ -97,7 +97,7 @@ export default [
|
|
|
97
97
|
key: 'addAnother',
|
|
98
98
|
label: 'Add Another Text',
|
|
99
99
|
placeholder: 'Add Another',
|
|
100
|
-
tooltip: 'Set the text of the Add Another button.'
|
|
100
|
+
tooltip: 'Set the text of the Add Another button.',
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
weight: 70,
|
|
@@ -105,7 +105,7 @@ export default [
|
|
|
105
105
|
label: 'Display as Modal',
|
|
106
106
|
tooltip: 'Display a modal to add or edit entries in the table',
|
|
107
107
|
key: 'modal',
|
|
108
|
-
input: true
|
|
108
|
+
input: true,
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
type: 'textfield',
|
|
@@ -113,7 +113,7 @@ export default [
|
|
|
113
113
|
key: 'saveRow',
|
|
114
114
|
label: 'Save Row Text',
|
|
115
115
|
placeholder: 'Save',
|
|
116
|
-
tooltip: 'Set the text of the Save Row button.'
|
|
116
|
+
tooltip: 'Set the text of the Save Row button.',
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
type: 'textfield',
|
|
@@ -121,6 +121,6 @@ export default [
|
|
|
121
121
|
key: 'removeRow',
|
|
122
122
|
label: 'Remove Row Text',
|
|
123
123
|
placeholder: 'Remove',
|
|
124
|
-
tooltip: 'Set the text of the remove Row button.'
|
|
125
|
-
}
|
|
124
|
+
tooltip: 'Set the text of the remove Row button.',
|
|
125
|
+
},
|
|
126
126
|
];
|