@formio/js 5.2.4-rc.0 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/formio.builder.css +50 -161
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +49 -158
- package/dist/formio.form.js +108 -152
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.css +50 -161
- package/dist/formio.full.js +227 -401
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +18 -51
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +14 -47
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/CDN.js +12 -12
- package/lib/cjs/Element.d.ts +2 -3
- package/lib/cjs/Element.js +26 -29
- package/lib/cjs/Embed.js +42 -75
- package/lib/cjs/EventEmitter.js +1 -1
- package/lib/cjs/Form.d.ts +341 -371
- package/lib/cjs/Form.js +39 -153
- package/lib/cjs/FormBuilder.d.ts +3 -3
- package/lib/cjs/FormBuilder.js +3 -2
- package/lib/cjs/Formio.js +23 -26
- package/lib/cjs/InlineEmbed.js +17 -23
- package/lib/cjs/PDF.d.ts +0 -1
- package/lib/cjs/PDF.js +15 -18
- package/lib/cjs/PDFBuilder.js +36 -51
- package/lib/cjs/Webform.d.ts +366 -8
- package/lib/cjs/Webform.js +238 -177
- package/lib/cjs/WebformBuilder.js +152 -221
- package/lib/cjs/Wizard.js +65 -95
- package/lib/cjs/WizardBuilder.js +19 -27
- package/lib/cjs/addons/FormioAddon.js +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +57 -59
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +16 -24
- package/lib/cjs/addons/index.js +3 -3
- package/lib/cjs/components/Components.js +4 -0
- package/lib/cjs/components/_classes/component/Component.form.js +11 -11
- package/lib/cjs/components/_classes/component/Component.js +198 -309
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.js +4 -2
- package/lib/cjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.js +11 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +0 -37
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +25 -39
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +29 -47
- package/lib/cjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.js +7 -5
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.js +34 -37
- package/lib/cjs/components/_classes/component/editForm/utils.js +16 -12
- package/lib/cjs/components/_classes/componentModal/ComponentModal.js +6 -6
- package/lib/cjs/components/_classes/field/Field.js +1 -7
- package/lib/cjs/components/_classes/input/Input.js +26 -30
- package/lib/cjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +18 -27
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.js +9 -36
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +13 -32
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +1 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.js +75 -67
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +14 -19
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +17 -19
- package/lib/cjs/components/address/Address.d.ts +0 -1
- package/lib/cjs/components/address/Address.js +52 -57
- package/lib/cjs/components/address/editForm/Address.edit.data.js +2 -2
- package/lib/cjs/components/address/editForm/Address.edit.display.js +2 -2
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +11 -53
- package/lib/cjs/components/alert/Alert.js +15 -21
- package/lib/cjs/components/button/Button.form.js +1 -1
- package/lib/cjs/components/button/Button.js +47 -64
- package/lib/cjs/components/button/editForm/Button.edit.display.js +9 -49
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.form.js +3 -3
- package/lib/cjs/components/checkbox/Checkbox.js +20 -28
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.js +3 -13
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
- package/lib/cjs/components/columns/Columns.form.js +1 -1
- package/lib/cjs/components/columns/Columns.js +12 -24
- package/lib/cjs/components/columns/editForm/Columns.edit.display.js +17 -17
- package/lib/cjs/components/container/Container.form.js +2 -2
- package/lib/cjs/components/container/Container.js +4 -6
- package/lib/cjs/components/container/editForm/Container.edit.data.js +3 -3
- package/lib/cjs/components/container/editForm/Container.edit.display.js +4 -4
- package/lib/cjs/components/content/Content.form.js +2 -4
- package/lib/cjs/components/content/Content.js +8 -10
- package/lib/cjs/components/content/editForm/Content.edit.display.js +10 -10
- package/lib/cjs/components/currency/Currency.form.js +3 -3
- package/lib/cjs/components/currency/Currency.js +10 -19
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +5 -5
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +8 -8
- package/lib/cjs/components/datagrid/DataGrid.form.js +3 -3
- package/lib/cjs/components/datagrid/DataGrid.js +42 -92
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
- package/lib/cjs/components/datamap/DataMap.form.js +2 -2
- package/lib/cjs/components/datamap/DataMap.js +35 -46
- package/lib/cjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
- package/lib/cjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
- package/lib/cjs/components/datetime/DateTime.form.js +5 -5
- package/lib/cjs/components/datetime/DateTime.js +15 -30
- package/lib/cjs/components/datetime/editForm/DateTime.edit.data.js +3 -4
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.js +17 -22
- package/lib/cjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
- package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
- package/lib/cjs/components/day/Day.form.js +5 -5
- package/lib/cjs/components/day/Day.js +58 -147
- package/lib/cjs/components/day/editForm/Day.edit.day.js +9 -13
- package/lib/cjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.month.js +8 -12
- package/lib/cjs/components/day/editForm/Day.edit.validation.js +7 -7
- package/lib/cjs/components/day/editForm/Day.edit.year.js +8 -8
- package/lib/cjs/components/editgrid/EditGrid.form.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.js +96 -142
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -7
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
- package/lib/cjs/components/email/Email.js +4 -4
- package/lib/cjs/components/email/editForm/Email.edit.display.js +3 -3
- package/lib/cjs/components/email/editForm/Email.edit.validation.js +6 -6
- package/lib/cjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/cjs/components/fieldset/Fieldset.js +2 -2
- package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
- package/lib/cjs/components/file/File.form.js +4 -4
- package/lib/cjs/components/file/File.js +90 -131
- package/lib/cjs/components/file/editForm/File.edit.display.js +5 -9
- package/lib/cjs/components/file/editForm/File.edit.file.js +53 -97
- package/lib/cjs/components/file/editForm/File.edit.validation.js +2 -2
- package/lib/cjs/components/form/Form.form.js +3 -3
- package/lib/cjs/components/form/Form.js +58 -68
- package/lib/cjs/components/form/editForm/Form.edit.data.js +3 -1
- package/lib/cjs/components/form/editForm/Form.edit.display.js +7 -6
- package/lib/cjs/components/form/editForm/Form.edit.form.js +9 -11
- package/lib/cjs/components/hidden/Hidden.form.js +4 -4
- package/lib/cjs/components/hidden/Hidden.js +2 -2
- package/lib/cjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
- package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
- package/lib/cjs/components/html/HTML.js +17 -23
- package/lib/cjs/components/html/editForm/HTML.edit.display.js +17 -17
- package/lib/cjs/components/html/editForm/HTML.edit.logic.js +2 -2
- package/lib/cjs/components/number/Number.form.js +3 -3
- package/lib/cjs/components/number/Number.js +11 -27
- package/lib/cjs/components/number/editForm/Number.edit.data.js +3 -3
- package/lib/cjs/components/number/editForm/Number.edit.display.js +4 -4
- package/lib/cjs/components/number/editForm/Number.edit.validation.js +9 -9
- package/lib/cjs/components/panel/Panel.form.js +1 -1
- package/lib/cjs/components/panel/Panel.js +2 -2
- package/lib/cjs/components/panel/editForm/Panel.edit.conditional.js +7 -5
- package/lib/cjs/components/panel/editForm/Panel.edit.display.js +29 -55
- package/lib/cjs/components/password/Password.form.js +3 -3
- package/lib/cjs/components/password/Password.js +2 -5
- package/lib/cjs/components/password/editForm/Password.edit.data.js +11 -11
- package/lib/cjs/components/password/editForm/Password.edit.display.js +3 -3
- package/lib/cjs/components/password/editForm/Password.edit.validation.js +3 -3
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +8 -8
- package/lib/cjs/components/phonenumber/PhoneNumber.js +3 -3
- package/lib/cjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
- package/lib/cjs/components/radio/Radio.form.js +3 -3
- package/lib/cjs/components/radio/Radio.js +32 -58
- package/lib/cjs/components/radio/editForm/Radio.edit.data.js +9 -23
- package/lib/cjs/components/radio/editForm/Radio.edit.display.js +6 -6
- package/lib/cjs/components/radio/editForm/Radio.edit.validation.js +2 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.form.js +5 -5
- package/lib/cjs/components/recaptcha/ReCaptcha.js +10 -10
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
- package/lib/cjs/components/select/Select.form.js +3 -3
- package/lib/cjs/components/select/Select.js +140 -235
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.js +57 -191
- package/lib/cjs/components/select/editForm/Select.edit.display.js +2 -2
- package/lib/cjs/components/select/editForm/Select.edit.validation.js +4 -4
- package/lib/cjs/components/selectboxes/SelectBoxes.form.js +3 -3
- package/lib/cjs/components/selectboxes/SelectBoxes.js +16 -29
- package/lib/cjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
- package/lib/cjs/components/signature/Signature.form.js +3 -3
- package/lib/cjs/components/signature/Signature.js +17 -26
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +10 -19
- package/lib/cjs/components/survey/Survey.form.js +3 -3
- package/lib/cjs/components/survey/Survey.js +17 -30
- package/lib/cjs/components/survey/editForm/Survey.edit.data.js +11 -23
- package/lib/cjs/components/survey/editForm/Survey.edit.display.js +1 -1
- package/lib/cjs/components/survey/editForm/Survey.edit.validation.js +1 -1
- package/lib/cjs/components/table/Table.form.js +1 -1
- package/lib/cjs/components/table/Table.js +7 -8
- package/lib/cjs/components/table/editForm/Table.edit.display.js +22 -22
- package/lib/cjs/components/tabs/Tabs.form.js +1 -1
- package/lib/cjs/components/tabs/Tabs.js +10 -27
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +17 -21
- package/lib/cjs/components/tags/Tags.form.js +1 -1
- package/lib/cjs/components/tags/Tags.js +12 -28
- package/lib/cjs/components/tags/editForm/Tags.edit.data.js +7 -7
- package/lib/cjs/components/textarea/TextArea.form.js +2 -2
- package/lib/cjs/components/textarea/TextArea.js +45 -63
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +72 -96
- package/lib/cjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
- package/lib/cjs/components/textfield/TextField.form.js +3 -3
- package/lib/cjs/components/textfield/TextField.js +21 -32
- package/lib/cjs/components/textfield/editForm/TextField.edit.data.js +13 -15
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.js +21 -31
- package/lib/cjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/cjs/components/time/Time.js +10 -17
- package/lib/cjs/components/time/editForm/Time.edit.display.js +2 -2
- package/lib/cjs/components/unknown/Unknown.form.js +5 -5
- package/lib/cjs/components/unknown/Unknown.js +2 -2
- package/lib/cjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
- package/lib/cjs/components/url/Url.form.js +3 -3
- package/lib/cjs/components/url/Url.js +2 -2
- package/lib/cjs/components/url/editForm/Url.edit.display.js +3 -3
- package/lib/cjs/components/url/editForm/Url.edit.validation.js +1 -1
- package/lib/cjs/components/well/Well.form.js +1 -1
- package/lib/cjs/components/well/Well.js +2 -2
- package/lib/cjs/components/well/editForm/Well.edit.display.js +10 -10
- package/lib/cjs/formio.form.d.ts +1 -2
- package/lib/cjs/formio.form.js +12 -38
- package/lib/cjs/i18n.d.ts +0 -4
- package/lib/cjs/i18n.js +3 -7
- package/lib/cjs/package.json +1 -1
- package/lib/cjs/pdf.image.d.ts +2 -0
- package/lib/cjs/pdf.image.js +94 -0
- package/lib/cjs/providers/address/AddressProvider.js +5 -8
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/cjs/providers/address/GoogleAddressProvider.js +13 -24
- package/lib/cjs/providers/processor/fileProcessor.js +1 -3
- package/lib/cjs/providers/storage/azure.js +2 -5
- package/lib/cjs/providers/storage/dropbox.js +5 -4
- package/lib/cjs/providers/storage/googleDrive.js +4 -3
- package/lib/cjs/providers/storage/index.js +1 -1
- package/lib/cjs/providers/storage/indexeddb.js +6 -16
- package/lib/cjs/providers/storage/s3.js +6 -17
- package/lib/cjs/providers/storage/uploadAdapter.js +11 -17
- package/lib/cjs/providers/storage/url.js +11 -13
- package/lib/cjs/providers/storage/xhr.js +9 -17
- package/lib/cjs/templates/index.js +1 -1
- package/lib/cjs/translations/en.d.ts +2 -0
- package/lib/cjs/translations/en.js +9 -7
- package/lib/cjs/utils/ChoicesWrapper.js +2 -2
- package/lib/cjs/utils/builder.js +7 -31
- package/lib/cjs/utils/calendarUtils.js +5 -7
- package/lib/cjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.js +4 -12
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +1 -3
- package/lib/cjs/utils/conditionOperators/IsEqualTo.js +6 -10
- package/lib/cjs/utils/conditionOperators/index.js +1 -1
- package/lib/cjs/utils/formUtils.js +1 -1
- package/lib/cjs/utils/i18n.js +1 -7
- package/lib/cjs/utils/index.d.ts +1 -2
- package/lib/cjs/utils/index.js +2 -2
- package/lib/cjs/utils/jsonlogic/operators.d.ts +1 -0
- package/lib/cjs/utils/jsonlogic/operators.js +265 -0
- package/lib/cjs/utils/utils.d.ts +1 -10
- package/lib/cjs/utils/utils.js +92 -175
- package/lib/cjs/widgets/CalendarWidget.js +49 -66
- package/lib/cjs/widgets/InputWidget.js +4 -6
- package/lib/cjs/widgets/index.js +1 -1
- package/lib/mjs/CDN.js +12 -12
- package/lib/mjs/Element.d.ts +2 -3
- package/lib/mjs/Element.js +23 -29
- package/lib/mjs/Embed.js +43 -77
- package/lib/mjs/EventEmitter.js +1 -1
- package/lib/mjs/Form.d.ts +341 -371
- package/lib/mjs/Form.js +126 -142
- package/lib/mjs/FormBuilder.d.ts +3 -3
- package/lib/mjs/FormBuilder.js +3 -2
- package/lib/mjs/Formio.js +23 -26
- package/lib/mjs/InlineEmbed.js +17 -23
- package/lib/mjs/PDF.d.ts +0 -1
- package/lib/mjs/PDF.js +15 -18
- package/lib/mjs/PDFBuilder.js +36 -51
- package/lib/mjs/Webform.d.ts +366 -8
- package/lib/mjs/Webform.js +251 -184
- package/lib/mjs/WebformBuilder.js +151 -224
- package/lib/mjs/Wizard.js +64 -94
- package/lib/mjs/WizardBuilder.js +19 -27
- package/lib/mjs/addons/FormioAddon.js +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.js +57 -59
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +16 -24
- package/lib/mjs/addons/index.js +3 -3
- package/lib/mjs/components/Components.js +4 -0
- package/lib/mjs/components/_classes/component/Component.form.js +11 -11
- package/lib/mjs/components/_classes/component/Component.js +194 -313
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.js +4 -2
- package/lib/mjs/components/_classes/component/editForm/Component.edit.api.js +5 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.js +11 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +0 -37
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +25 -39
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +29 -47
- package/lib/mjs/components/_classes/component/editForm/Component.edit.layout.js +9 -9
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.js +7 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.js +34 -37
- package/lib/mjs/components/_classes/component/editForm/utils.js +16 -12
- package/lib/mjs/components/_classes/componentModal/ComponentModal.js +2 -2
- package/lib/mjs/components/_classes/field/Field.js +2 -8
- package/lib/mjs/components/_classes/input/Input.js +23 -27
- package/lib/mjs/components/_classes/list/ListComponent.form.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +18 -27
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.js +9 -36
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +13 -32
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +1 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +3 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.js +33 -41
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +15 -20
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +17 -19
- package/lib/mjs/components/address/Address.d.ts +0 -1
- package/lib/mjs/components/address/Address.js +49 -60
- package/lib/mjs/components/address/editForm/Address.edit.data.js +2 -2
- package/lib/mjs/components/address/editForm/Address.edit.display.js +2 -2
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +11 -53
- package/lib/mjs/components/alert/Alert.js +16 -22
- package/lib/mjs/components/button/Button.form.js +1 -1
- package/lib/mjs/components/button/Button.js +42 -65
- package/lib/mjs/components/button/editForm/Button.edit.display.js +9 -49
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.form.js +3 -3
- package/lib/mjs/components/checkbox/Checkbox.js +21 -29
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.data.js +1 -1
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.js +3 -13
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.validation.js +2 -2
- package/lib/mjs/components/columns/Columns.form.js +1 -1
- package/lib/mjs/components/columns/Columns.js +12 -24
- package/lib/mjs/components/columns/editForm/Columns.edit.display.js +17 -17
- package/lib/mjs/components/container/Container.form.js +2 -2
- package/lib/mjs/components/container/Container.js +4 -6
- package/lib/mjs/components/container/editForm/Container.edit.data.js +3 -3
- package/lib/mjs/components/container/editForm/Container.edit.display.js +4 -4
- package/lib/mjs/components/content/Content.form.js +2 -4
- package/lib/mjs/components/content/Content.js +8 -10
- package/lib/mjs/components/content/editForm/Content.edit.display.js +10 -10
- package/lib/mjs/components/currency/Currency.form.js +3 -3
- package/lib/mjs/components/currency/Currency.js +10 -19
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +5 -5
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +8 -8
- package/lib/mjs/components/datagrid/DataGrid.form.js +3 -3
- package/lib/mjs/components/datagrid/DataGrid.js +41 -92
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.data.js +1 -1
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.display.js +14 -14
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.validation.js +3 -3
- package/lib/mjs/components/datamap/DataMap.form.js +2 -2
- package/lib/mjs/components/datamap/DataMap.js +33 -46
- package/lib/mjs/components/datamap/editForm/DataMap.edit.data.js +1 -1
- package/lib/mjs/components/datamap/editForm/DataMap.edit.display.js +8 -8
- package/lib/mjs/components/datetime/DateTime.form.js +5 -5
- package/lib/mjs/components/datetime/DateTime.js +16 -31
- package/lib/mjs/components/datetime/editForm/DateTime.edit.data.js +3 -4
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.js +10 -10
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.js +17 -22
- package/lib/mjs/components/datetime/editForm/DateTime.edit.time.js +5 -5
- package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +3 -3
- package/lib/mjs/components/day/Day.form.js +5 -5
- package/lib/mjs/components/day/Day.js +58 -148
- package/lib/mjs/components/day/editForm/Day.edit.day.js +9 -13
- package/lib/mjs/components/day/editForm/Day.edit.display.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.month.js +8 -12
- package/lib/mjs/components/day/editForm/Day.edit.validation.js +7 -7
- package/lib/mjs/components/day/editForm/Day.edit.year.js +8 -8
- package/lib/mjs/components/editgrid/EditGrid.form.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.js +92 -140
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.data.js +2 -2
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.js +2 -7
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.js +16 -16
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.validation.js +3 -3
- package/lib/mjs/components/email/Email.js +4 -4
- package/lib/mjs/components/email/editForm/Email.edit.display.js +3 -3
- package/lib/mjs/components/email/editForm/Email.edit.validation.js +6 -6
- package/lib/mjs/components/fieldset/Fieldset.form.js +1 -1
- package/lib/mjs/components/fieldset/Fieldset.js +2 -2
- package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -8
- package/lib/mjs/components/file/File.form.js +4 -4
- package/lib/mjs/components/file/File.js +89 -136
- package/lib/mjs/components/file/editForm/File.edit.display.js +5 -9
- package/lib/mjs/components/file/editForm/File.edit.file.js +53 -97
- package/lib/mjs/components/file/editForm/File.edit.validation.js +2 -2
- package/lib/mjs/components/form/Form.form.js +3 -3
- package/lib/mjs/components/form/Form.js +55 -68
- package/lib/mjs/components/form/editForm/Form.edit.data.js +3 -1
- package/lib/mjs/components/form/editForm/Form.edit.display.js +7 -6
- package/lib/mjs/components/form/editForm/Form.edit.form.js +8 -10
- package/lib/mjs/components/hidden/Hidden.form.js +4 -4
- package/lib/mjs/components/hidden/Hidden.js +2 -2
- package/lib/mjs/components/hidden/editForm/Hidden.edit.data.js +3 -3
- package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +10 -10
- package/lib/mjs/components/html/HTML.js +17 -23
- package/lib/mjs/components/html/editForm/HTML.edit.display.js +17 -17
- package/lib/mjs/components/html/editForm/HTML.edit.logic.js +2 -2
- package/lib/mjs/components/number/Number.form.js +3 -3
- package/lib/mjs/components/number/Number.js +12 -28
- package/lib/mjs/components/number/editForm/Number.edit.data.js +3 -3
- package/lib/mjs/components/number/editForm/Number.edit.display.js +4 -4
- package/lib/mjs/components/number/editForm/Number.edit.validation.js +9 -9
- package/lib/mjs/components/panel/Panel.form.js +1 -1
- package/lib/mjs/components/panel/Panel.js +2 -2
- package/lib/mjs/components/panel/editForm/Panel.edit.conditional.js +8 -6
- package/lib/mjs/components/panel/editForm/Panel.edit.display.js +29 -55
- package/lib/mjs/components/password/Password.form.js +3 -3
- package/lib/mjs/components/password/Password.js +2 -5
- package/lib/mjs/components/password/editForm/Password.edit.data.js +11 -11
- package/lib/mjs/components/password/editForm/Password.edit.display.js +3 -3
- package/lib/mjs/components/password/editForm/Password.edit.validation.js +3 -3
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +8 -8
- package/lib/mjs/components/phonenumber/PhoneNumber.js +3 -3
- package/lib/mjs/components/phonenumber/editForm/PhoneNumber.edit.validation.js +6 -6
- package/lib/mjs/components/radio/Radio.form.js +3 -3
- package/lib/mjs/components/radio/Radio.js +30 -59
- package/lib/mjs/components/radio/editForm/Radio.edit.data.js +9 -23
- package/lib/mjs/components/radio/editForm/Radio.edit.display.js +6 -6
- package/lib/mjs/components/radio/editForm/Radio.edit.validation.js +2 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.form.js +5 -5
- package/lib/mjs/components/recaptcha/ReCaptcha.js +8 -10
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.js +24 -24
- package/lib/mjs/components/select/Select.form.js +3 -3
- package/lib/mjs/components/select/Select.js +145 -240
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.js +57 -191
- package/lib/mjs/components/select/editForm/Select.edit.display.js +2 -2
- package/lib/mjs/components/select/editForm/Select.edit.validation.js +4 -4
- package/lib/mjs/components/selectboxes/SelectBoxes.form.js +3 -3
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -30
- package/lib/mjs/components/selectboxes/editForm/SelectBoxes.edit.validation.js +5 -5
- package/lib/mjs/components/signature/Signature.form.js +3 -3
- package/lib/mjs/components/signature/Signature.js +16 -26
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +10 -19
- package/lib/mjs/components/survey/Survey.form.js +3 -3
- package/lib/mjs/components/survey/Survey.js +17 -30
- package/lib/mjs/components/survey/editForm/Survey.edit.data.js +11 -23
- package/lib/mjs/components/survey/editForm/Survey.edit.display.js +1 -1
- package/lib/mjs/components/survey/editForm/Survey.edit.validation.js +1 -1
- package/lib/mjs/components/table/Table.form.js +1 -1
- package/lib/mjs/components/table/Table.js +6 -8
- package/lib/mjs/components/table/editForm/Table.edit.display.js +22 -22
- package/lib/mjs/components/tabs/Tabs.form.js +1 -1
- package/lib/mjs/components/tabs/Tabs.js +9 -27
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +17 -21
- package/lib/mjs/components/tags/Tags.form.js +1 -1
- package/lib/mjs/components/tags/Tags.js +12 -28
- package/lib/mjs/components/tags/editForm/Tags.edit.data.js +7 -7
- package/lib/mjs/components/textarea/TextArea.form.js +2 -2
- package/lib/mjs/components/textarea/TextArea.js +51 -75
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +72 -96
- package/lib/mjs/components/textarea/editForm/TextArea.edit.validation.js +3 -3
- package/lib/mjs/components/textfield/TextField.form.js +3 -3
- package/lib/mjs/components/textfield/TextField.js +23 -34
- package/lib/mjs/components/textfield/editForm/TextField.edit.data.js +13 -15
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.js +21 -31
- package/lib/mjs/components/textfield/editForm/TextField.edit.validation.js +6 -6
- package/lib/mjs/components/time/Time.js +10 -17
- package/lib/mjs/components/time/editForm/Time.edit.display.js +2 -2
- package/lib/mjs/components/unknown/Unknown.form.js +5 -5
- package/lib/mjs/components/unknown/Unknown.js +2 -2
- package/lib/mjs/components/unknown/editForm/Unknown.edit.display.js +3 -3
- package/lib/mjs/components/url/Url.form.js +3 -3
- package/lib/mjs/components/url/Url.js +2 -2
- package/lib/mjs/components/url/editForm/Url.edit.display.js +3 -3
- package/lib/mjs/components/url/editForm/Url.edit.validation.js +1 -1
- package/lib/mjs/components/well/Well.form.js +1 -1
- package/lib/mjs/components/well/Well.js +2 -2
- package/lib/mjs/components/well/editForm/Well.edit.display.js +10 -10
- package/lib/mjs/formio.form.d.ts +1 -2
- package/lib/mjs/formio.form.js +8 -10
- package/lib/mjs/i18n.d.ts +0 -4
- package/lib/mjs/i18n.js +3 -7
- package/lib/mjs/package.json +1 -1
- package/lib/mjs/pdf.image.d.ts +2 -0
- package/lib/mjs/pdf.image.js +94 -0
- package/lib/mjs/providers/address/AddressProvider.js +5 -8
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +3 -3
- package/lib/mjs/providers/address/GoogleAddressProvider.js +13 -24
- package/lib/mjs/providers/processor/fileProcessor.js +1 -3
- package/lib/mjs/providers/storage/azure.js +2 -5
- package/lib/mjs/providers/storage/dropbox.js +5 -4
- package/lib/mjs/providers/storage/googleDrive.js +4 -3
- package/lib/mjs/providers/storage/index.js +1 -1
- package/lib/mjs/providers/storage/indexeddb.js +6 -16
- package/lib/mjs/providers/storage/s3.js +8 -19
- package/lib/mjs/providers/storage/uploadAdapter.js +11 -17
- package/lib/mjs/providers/storage/url.js +11 -13
- package/lib/mjs/providers/storage/xhr.js +9 -17
- package/lib/mjs/templates/index.js +1 -1
- package/lib/mjs/translations/en.d.ts +2 -0
- package/lib/mjs/translations/en.js +9 -7
- package/lib/mjs/utils/ChoicesWrapper.js +2 -2
- package/lib/mjs/utils/builder.js +7 -31
- package/lib/mjs/utils/calendarUtils.js +5 -7
- package/lib/mjs/utils/conditionOperators/ConditionOperator.js +1 -1
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.js +5 -16
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +1 -3
- package/lib/mjs/utils/conditionOperators/IsEqualTo.js +6 -10
- package/lib/mjs/utils/conditionOperators/index.js +1 -1
- package/lib/mjs/utils/formUtils.js +2 -2
- package/lib/mjs/utils/i18n.js +1 -7
- package/lib/mjs/utils/index.d.ts +1 -2
- package/lib/mjs/utils/index.js +3 -3
- package/lib/mjs/utils/jsonlogic/operators.d.ts +1 -0
- package/lib/mjs/utils/jsonlogic/operators.js +262 -0
- package/lib/mjs/utils/utils.d.ts +1 -10
- package/lib/mjs/utils/utils.js +91 -178
- package/lib/mjs/widgets/CalendarWidget.js +50 -67
- package/lib/mjs/widgets/InputWidget.js +4 -6
- package/lib/mjs/widgets/index.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/translations/de.d.ts +0 -80
- package/lib/cjs/translations/de.js +0 -81
- package/lib/mjs/translations/de.d.ts +0 -80
- package/lib/mjs/translations/de.js +0 -79
|
@@ -10,14 +10,14 @@ export default [
|
|
|
10
10
|
values: [
|
|
11
11
|
{
|
|
12
12
|
label: 'Number',
|
|
13
|
-
value: 'number'
|
|
13
|
+
value: 'number'
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
label: 'Select',
|
|
17
|
-
value: 'select'
|
|
17
|
+
value: 'select'
|
|
18
18
|
},
|
|
19
|
-
]
|
|
20
|
-
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
weight: 203,
|
|
@@ -26,7 +26,7 @@ export default [
|
|
|
26
26
|
key: 'fields.year.minYear',
|
|
27
27
|
label: 'Minimum Year',
|
|
28
28
|
placeholder: '1900',
|
|
29
|
-
tooltip: 'The minimum year that can be entered.'
|
|
29
|
+
tooltip: 'The minimum year that can be entered.'
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
weight: 204,
|
|
@@ -35,7 +35,7 @@ export default [
|
|
|
35
35
|
key: 'fields.year.maxYear',
|
|
36
36
|
label: 'Maximum Year',
|
|
37
37
|
placeholder: '2030',
|
|
38
|
-
tooltip: 'The maximum year that can be entered.'
|
|
38
|
+
tooltip: 'The maximum year that can be entered.'
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
weight: 210,
|
|
@@ -44,7 +44,7 @@ export default [
|
|
|
44
44
|
key: 'fields.year.placeholder',
|
|
45
45
|
label: 'Placeholder',
|
|
46
46
|
placeholder: 'Year Placeholder',
|
|
47
|
-
tooltip: 'The placeholder text that will appear when Year field is empty.'
|
|
47
|
+
tooltip: 'The placeholder text that will appear when Year field is empty.'
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
weight: 215,
|
|
@@ -61,6 +61,6 @@ export default [
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
input: true
|
|
64
|
+
input: true
|
|
65
65
|
},
|
|
66
66
|
];
|
|
@@ -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,11 +135,13 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
135
135
|
get rowTemplate() {
|
|
136
136
|
let rowTemplate;
|
|
137
137
|
if (Evaluator.noeval) {
|
|
138
|
-
rowTemplate = this.displayAsTable ?
|
|
138
|
+
rowTemplate = this.displayAsTable ?
|
|
139
|
+
templates.tableRow
|
|
140
|
+
: templates.row;
|
|
139
141
|
}
|
|
140
142
|
else {
|
|
141
|
-
rowTemplate = this.displayAsTable
|
|
142
|
-
|
|
143
|
+
rowTemplate = this.displayAsTable ?
|
|
144
|
+
_.get(this.component, 'templates.tableRow', this.defaultRowTemplate)
|
|
143
145
|
: _.get(this.component, 'templates.row', this.defaultRowTemplate);
|
|
144
146
|
}
|
|
145
147
|
return rowTemplate;
|
|
@@ -147,11 +149,13 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
147
149
|
get headerTemplate() {
|
|
148
150
|
let headerTemplate;
|
|
149
151
|
if (Evaluator.noeval) {
|
|
150
|
-
headerTemplate = this.displayAsTable ?
|
|
152
|
+
headerTemplate = this.displayAsTable ?
|
|
153
|
+
templates.tableHeader
|
|
154
|
+
: templates.header;
|
|
151
155
|
}
|
|
152
156
|
else {
|
|
153
|
-
headerTemplate = this.displayAsTable
|
|
154
|
-
|
|
157
|
+
headerTemplate = this.displayAsTable ?
|
|
158
|
+
_.get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate)
|
|
155
159
|
: _.get(this.component, 'templates.header', this.defaultHeaderTemplate);
|
|
156
160
|
}
|
|
157
161
|
return headerTemplate;
|
|
@@ -247,11 +251,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
247
251
|
this.type = 'editgrid';
|
|
248
252
|
}
|
|
249
253
|
hasRemoveButtons() {
|
|
250
|
-
return
|
|
254
|
+
return !this.component.disableAddingRemovingRows &&
|
|
251
255
|
!this.options.readOnly &&
|
|
252
256
|
!this.disabled &&
|
|
253
257
|
this.fullMode &&
|
|
254
|
-
this.dataValue.length > _.get(this.component, 'validate.minLength', 0));
|
|
258
|
+
(this.dataValue.length > _.get(this.component, 'validate.minLength', 0));
|
|
255
259
|
}
|
|
256
260
|
init() {
|
|
257
261
|
if (this.builderMode) {
|
|
@@ -302,20 +306,12 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
302
306
|
});
|
|
303
307
|
}
|
|
304
308
|
isOpen(editRow) {
|
|
305
|
-
return [
|
|
306
|
-
EditRowState.New,
|
|
307
|
-
EditRowState.Editing,
|
|
308
|
-
EditRowState.Viewing,
|
|
309
|
-
].includes(editRow.state);
|
|
309
|
+
return [EditRowState.New, EditRowState.Editing, EditRowState.Viewing].includes(editRow.state);
|
|
310
310
|
}
|
|
311
311
|
isComponentVisibleInSomeRow(component) {
|
|
312
312
|
const rows = this.editRows;
|
|
313
|
-
const savedStates = [
|
|
314
|
-
|
|
315
|
-
EditRowState.Editing,
|
|
316
|
-
EditRowState.Draft,
|
|
317
|
-
];
|
|
318
|
-
const savedRows = rows.filter((row) => _.includes(savedStates, row.state));
|
|
313
|
+
const savedStates = [EditRowState.Saved, EditRowState.Editing, EditRowState.Draft];
|
|
314
|
+
const savedRows = rows.filter(row => _.includes(savedStates, row.state));
|
|
319
315
|
this.visibleInHeader = this.visibleInHeader || [];
|
|
320
316
|
const changeVisibleInHeader = (component, isVisible) => {
|
|
321
317
|
if (!isVisible) {
|
|
@@ -335,15 +331,11 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
335
331
|
comp.checkConditions();
|
|
336
332
|
});
|
|
337
333
|
const isVisible = checkComponent ? checkComponent.visible : true;
|
|
338
|
-
[
|
|
339
|
-
...this.components,
|
|
340
|
-
].forEach((comp) => this.removeComponent(comp, this.components));
|
|
334
|
+
[...this.components].forEach((comp) => this.removeComponent(comp, this.components));
|
|
341
335
|
changeVisibleInHeader(component, isVisible);
|
|
342
336
|
return isVisible;
|
|
343
337
|
}
|
|
344
|
-
const isOpenRowWhenEmpty = _.get(this.component, 'openWhenEmpty') &&
|
|
345
|
-
rows.length === 1 &&
|
|
346
|
-
rows[0].state === EditRowState.New;
|
|
338
|
+
const isOpenRowWhenEmpty = _.get(this.component, 'openWhenEmpty') && rows.length === 1 && rows[0].state === EditRowState.New;
|
|
347
339
|
if (!_.isEmpty(rows) && _.isEmpty(savedRows) && !isOpenRowWhenEmpty) {
|
|
348
340
|
return _.includes(this.visibleInHeader, component.key);
|
|
349
341
|
}
|
|
@@ -370,35 +362,34 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
370
362
|
const headerTemplate = this.headerTemplate;
|
|
371
363
|
const t = this.t.bind(this);
|
|
372
364
|
const templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';
|
|
373
|
-
return super.render(children ||
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}));
|
|
365
|
+
return super.render(children || this.renderTemplate(templateName, {
|
|
366
|
+
ref: {
|
|
367
|
+
row: this.rowRef,
|
|
368
|
+
addRow: this.addRowRef,
|
|
369
|
+
saveRow: this.saveRowRef,
|
|
370
|
+
cancelRow: this.cancelRowRef,
|
|
371
|
+
},
|
|
372
|
+
header: this.renderString(headerTemplate, {
|
|
373
|
+
displayValue: (component) => this.displayComponentValue(component, true),
|
|
374
|
+
components: this.component.components,
|
|
375
|
+
value: dataValue,
|
|
376
|
+
t
|
|
377
|
+
}),
|
|
378
|
+
footer: this.renderString(_.get(this.component, 'templates.footer'), {
|
|
379
|
+
components: this.component.components,
|
|
380
|
+
value: dataValue,
|
|
381
|
+
t
|
|
382
|
+
}),
|
|
383
|
+
rows: this.editRows.map(this.renderRow.bind(this)),
|
|
384
|
+
openRows: this.editRows.map((row) => this.isOpen(row)),
|
|
385
|
+
errors: this.editRows.map((row) => row.error),
|
|
386
|
+
hasAddButton: this.hasAddButton(),
|
|
387
|
+
hasRemoveButtons: this.hasRemoveButtons(),
|
|
388
|
+
}));
|
|
398
389
|
}
|
|
399
390
|
renderComponents(components) {
|
|
400
391
|
components = components || this.getComponents();
|
|
401
|
-
const children = components.map(
|
|
392
|
+
const children = components.map(component => component.render());
|
|
402
393
|
const templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';
|
|
403
394
|
return this.renderTemplate(templateName, {
|
|
404
395
|
children,
|
|
@@ -469,18 +460,14 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
469
460
|
}
|
|
470
461
|
this.emit(eventName, {
|
|
471
462
|
component: this.component,
|
|
472
|
-
data: this.dataValue[rowIndex]
|
|
463
|
+
data: this.dataValue[rowIndex]
|
|
473
464
|
});
|
|
474
465
|
},
|
|
475
|
-
}
|
|
476
|
-
].forEach(({ className, event, action }) => {
|
|
466
|
+
}
|
|
467
|
+
].forEach(({ className, event, action, }) => {
|
|
477
468
|
const elements = row.getElementsByClassName(className);
|
|
478
469
|
Array.prototype.forEach.call(elements, (element) => {
|
|
479
|
-
if (this.options.pdf &&
|
|
480
|
-
_.intersection(element.classList, [
|
|
481
|
-
'editRow',
|
|
482
|
-
'removeRow',
|
|
483
|
-
]).length) {
|
|
470
|
+
if (this.options.pdf && _.intersection(element.classList, ['editRow', 'removeRow']).length) {
|
|
484
471
|
element.style.display = 'none';
|
|
485
472
|
}
|
|
486
473
|
else {
|
|
@@ -516,9 +503,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
516
503
|
return instance ? instance.visible : true;
|
|
517
504
|
}
|
|
518
505
|
displayComponentValue(component, header) {
|
|
519
|
-
return !!((!component.hasOwnProperty('tableView') || component.tableView)
|
|
520
|
-
? this.isComponentVisibleInSomeRow(component)
|
|
521
|
-
: _.includes(this.visibleInHeader, component.key));
|
|
506
|
+
return !!((!component.hasOwnProperty('tableView') || component.tableView)
|
|
507
|
+
&& header ? this.isComponentVisibleInSomeRow(component) : _.includes(this.visibleInHeader, component.key));
|
|
522
508
|
}
|
|
523
509
|
renderRow(row, rowIndex) {
|
|
524
510
|
const dataValue = this.dataValue;
|
|
@@ -541,16 +527,12 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
541
527
|
const view = instance ? instance.getView(data || instance.dataValue) : '';
|
|
542
528
|
// If there is an html tag in view, don't allow it to be injected in template
|
|
543
529
|
const htmlTagRegExp = new RegExp('<(.*?)>');
|
|
544
|
-
return typeof view === 'string' &&
|
|
545
|
-
view.length &&
|
|
546
|
-
!instance.component?.template &&
|
|
547
|
-
htmlTagRegExp.test(view) &&
|
|
548
|
-
instance.component?.inputFormat !== 'html'
|
|
530
|
+
return typeof view === 'string' && view.length && !instance.component?.template && htmlTagRegExp.test(view) && instance.component?.inputFormat !== 'html'
|
|
549
531
|
? `<input type="text" value="${view.replace(/"/g, '"')}" readonly/>`
|
|
550
532
|
: view;
|
|
551
533
|
},
|
|
552
534
|
state: this.editRows[rowIndex].state,
|
|
553
|
-
t: this.t.bind(this)
|
|
535
|
+
t: this.t.bind(this)
|
|
554
536
|
});
|
|
555
537
|
}
|
|
556
538
|
}
|
|
@@ -574,7 +556,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
574
556
|
return this.builderMode
|
|
575
557
|
? super.getComponents()
|
|
576
558
|
: _.isNumber(rowIndex)
|
|
577
|
-
? this.editRows[rowIndex]?.components || []
|
|
559
|
+
? (this.editRows[rowIndex]?.components || [])
|
|
578
560
|
: this.editRows.reduce((result, row) => result.concat(row.components || []), []);
|
|
579
561
|
}
|
|
580
562
|
destroy(all = false) {
|
|
@@ -614,7 +596,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
614
596
|
this.emptyRow = fastCloneDeep(editRow.data);
|
|
615
597
|
}
|
|
616
598
|
if (this.inlineEditMode) {
|
|
617
|
-
this.triggerChange();
|
|
599
|
+
this.triggerChange?.();
|
|
618
600
|
}
|
|
619
601
|
this.emit('editGridAddRow', {
|
|
620
602
|
component: this.component,
|
|
@@ -635,9 +617,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
635
617
|
editRow.willBeSaved = false;
|
|
636
618
|
const { components } = editRow;
|
|
637
619
|
modalContent.innerHTML = this.renderComponents(components);
|
|
638
|
-
const dialog = this.component.modal
|
|
639
|
-
? this.createModal(modalContent, {}, () => this.showDialog(rowIndex))
|
|
640
|
-
: undefined;
|
|
620
|
+
const dialog = this.component.modal ? this.createModal(modalContent, {}, () => this.showDialog(rowIndex)) : undefined;
|
|
641
621
|
dialog.classList.add(`editgrid-row-modal-${this.id}`);
|
|
642
622
|
editRow.dialog = dialog;
|
|
643
623
|
if (this.alert) {
|
|
@@ -690,9 +670,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
690
670
|
}
|
|
691
671
|
showDialog(rowIndex) {
|
|
692
672
|
const editRow = this.editRows[rowIndex];
|
|
693
|
-
if (editRow.state === EditRowState.New
|
|
694
|
-
? _.isEqual(this.emptyRow, editRow.data)
|
|
695
|
-
: _.isEqual(editRow.backup, editRow.data)) {
|
|
673
|
+
if (editRow.state === EditRowState.New ? _.isEqual(this.emptyRow, editRow.data) : _.isEqual(editRow.backup, editRow.data)) {
|
|
696
674
|
return Promise.resolve();
|
|
697
675
|
}
|
|
698
676
|
const wrapper = this.ce('div', { ref: 'confirmationDialog' });
|
|
@@ -733,7 +711,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
733
711
|
}
|
|
734
712
|
editRow.prevState = editRow.state;
|
|
735
713
|
editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;
|
|
736
|
-
if (this.lazyLoad && editRow.components.length === 0) {
|
|
714
|
+
if (this.lazyLoad && (editRow.components.length === 0)) {
|
|
737
715
|
editRow.components = this.createRowComponents(editRow.data, rowIndex);
|
|
738
716
|
}
|
|
739
717
|
const dataSnapshot = fastCloneDeep(editRow.data);
|
|
@@ -828,7 +806,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
828
806
|
case EditRowState.New: {
|
|
829
807
|
const newIndex = dataValue.length;
|
|
830
808
|
dataValue.push(editRow.data);
|
|
831
|
-
editRow.components.forEach(
|
|
809
|
+
editRow.components.forEach(component => component.rowIndex = newIndex);
|
|
832
810
|
if (rowIndex !== newIndex) {
|
|
833
811
|
this.editRows.splice(rowIndex, 1);
|
|
834
812
|
this.editRows.splice(newIndex, 0, editRow);
|
|
@@ -841,22 +819,17 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
841
819
|
}
|
|
842
820
|
}
|
|
843
821
|
}
|
|
844
|
-
editRow.state =
|
|
845
|
-
this.component.rowDrafts && errors.length ? EditRowState.Draft : EditRowState.Saved;
|
|
822
|
+
editRow.state = this.component.rowDrafts && errors.length ? EditRowState.Draft : EditRowState.Saved;
|
|
846
823
|
editRow.backup = null;
|
|
847
824
|
this.updateValue();
|
|
848
825
|
this.emit('editGridSaveRow', {
|
|
849
826
|
component: this.component,
|
|
850
827
|
row: editRow.data,
|
|
851
|
-
instance: this
|
|
852
|
-
});
|
|
853
|
-
this.triggerChange({
|
|
854
|
-
modified,
|
|
855
|
-
noPristineChangeOnModified: modified && this.component.rowDrafts,
|
|
856
|
-
isolateRow: true,
|
|
828
|
+
instance: this
|
|
857
829
|
});
|
|
830
|
+
this.triggerChange?.({ modified, noPristineChangeOnModified: modified && this.component.rowDrafts, isolateRow: true });
|
|
858
831
|
if (this.component.rowDrafts) {
|
|
859
|
-
editRow.components.forEach(
|
|
832
|
+
editRow.components.forEach(comp => comp.setPristine(this.pristine));
|
|
860
833
|
}
|
|
861
834
|
this.checkValidity(null, true);
|
|
862
835
|
this.redraw();
|
|
@@ -908,17 +881,13 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
908
881
|
this.removeSubmissionMetadataRow(rowIndex);
|
|
909
882
|
this.splice(rowIndex);
|
|
910
883
|
this.emit('editGridDeleteRow', {
|
|
911
|
-
index: rowIndex
|
|
884
|
+
index: rowIndex
|
|
912
885
|
});
|
|
913
886
|
this.editRows.splice(rowIndex, 1);
|
|
914
887
|
this.openWhenEmpty();
|
|
915
888
|
this.updateRowsComponents(rowIndex);
|
|
916
889
|
this.updateValue();
|
|
917
|
-
this.triggerChange({
|
|
918
|
-
modified,
|
|
919
|
-
noPristineChangeOnModified: modified && this.component.rowDrafts,
|
|
920
|
-
isolateRow: true,
|
|
921
|
-
});
|
|
890
|
+
this.triggerChange?.({ modified, noPristineChangeOnModified: modified && this.component.rowDrafts, isolateRow: true });
|
|
922
891
|
this.checkValidity(null, true);
|
|
923
892
|
this.checkData();
|
|
924
893
|
this.redraw();
|
|
@@ -937,8 +906,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
937
906
|
return this.component.components.map((col, colIndex) => {
|
|
938
907
|
if (recreatePartially && currentRowComponents && this.variableTypeComponentsIndexes.length) {
|
|
939
908
|
const currentComp = currentRowComponents[colIndex];
|
|
940
|
-
const shouldRecreate = _.includes(this.variableTypeComponentsIndexes, colIndex) &&
|
|
941
|
-
currentComp?.type !== currentComp?.component?.type;
|
|
909
|
+
const shouldRecreate = _.includes(this.variableTypeComponentsIndexes, colIndex) && currentComp?.type !== currentComp?.component?.type;
|
|
942
910
|
if (!shouldRecreate) {
|
|
943
911
|
return currentComp;
|
|
944
912
|
}
|
|
@@ -950,8 +918,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
950
918
|
options.row = `${rowIndex}-${colIndex}`;
|
|
951
919
|
options.rowIndex = rowIndex;
|
|
952
920
|
options.onChange = (flags = {}, changed, modified) => {
|
|
953
|
-
if (changed.instance.root?.id && this.root?.id !== changed.instance.root.id) {
|
|
954
|
-
changed.instance.root
|
|
921
|
+
if (changed.instance.root?.id && (this.root?.id !== changed.instance.root.id)) {
|
|
922
|
+
changed.instance.root?.triggerChange?.(flags, changed, modified);
|
|
955
923
|
}
|
|
956
924
|
else if (!this.component.modal) {
|
|
957
925
|
this.triggerRootChange(flags, changed, modified);
|
|
@@ -979,7 +947,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
979
947
|
});
|
|
980
948
|
}
|
|
981
949
|
hasOpenRows() {
|
|
982
|
-
return this.editRows.some(
|
|
950
|
+
return this.editRows.some(row => this.isOpen(row));
|
|
983
951
|
}
|
|
984
952
|
getAttachedData(data = null) {
|
|
985
953
|
const ourData = fastCloneDeep(data || this._data || this.rootValue);
|
|
@@ -988,26 +956,24 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
988
956
|
}
|
|
989
957
|
shouldValidateDraft(editRow) {
|
|
990
958
|
// Draft rows should be validated only when there was an attempt to submit a form
|
|
991
|
-
return (
|
|
959
|
+
return (editRow.state === EditRowState.Draft &&
|
|
992
960
|
!this.pristine &&
|
|
993
961
|
!this.root?.pristine &&
|
|
994
962
|
!this.hasOpenRows()) ||
|
|
995
|
-
this.root?.submitted
|
|
963
|
+
this.root?.submitted;
|
|
996
964
|
}
|
|
997
965
|
shouldValidateRow(editRow, dirty, fromSubmission) {
|
|
998
|
-
return
|
|
966
|
+
return this.shouldValidateDraft(editRow) ||
|
|
999
967
|
editRow.state === EditRowState.New ||
|
|
1000
968
|
editRow.state === EditRowState.Editing ||
|
|
1001
969
|
editRow.alerts ||
|
|
1002
970
|
fromSubmission ||
|
|
1003
|
-
dirty
|
|
971
|
+
dirty;
|
|
1004
972
|
}
|
|
1005
973
|
validateRow(editRow, dirty, forceSilentCheck, fromSubmission) {
|
|
1006
974
|
editRow.errors = [];
|
|
1007
975
|
if (this.shouldValidateRow(editRow, dirty, fromSubmission)) {
|
|
1008
|
-
const silentCheck = forceSilentCheck === false
|
|
1009
|
-
? false
|
|
1010
|
-
: (this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck;
|
|
976
|
+
const silentCheck = forceSilentCheck === false ? false : ((this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck);
|
|
1011
977
|
const rootValue = fastCloneDeep(this.rootValue);
|
|
1012
978
|
const editGridValue = _.get(rootValue, this.path, []);
|
|
1013
979
|
editGridValue[editRow.rowIndex] = editRow.data;
|
|
@@ -1023,40 +989,36 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1023
989
|
parent: this.component,
|
|
1024
990
|
parentPaths: {
|
|
1025
991
|
...this.paths,
|
|
1026
|
-
dataIndex: editRow.rowIndex
|
|
992
|
+
dataIndex: editRow.rowIndex
|
|
1027
993
|
},
|
|
1028
994
|
processors: [
|
|
1029
995
|
{
|
|
1030
996
|
process: validationProcessorProcess,
|
|
1031
|
-
processSync: validationProcessorProcess
|
|
1032
|
-
}
|
|
1033
|
-
]
|
|
997
|
+
processSync: validationProcessorProcess
|
|
998
|
+
}
|
|
999
|
+
]
|
|
1034
1000
|
}).errors;
|
|
1035
|
-
editRow.errors =
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
: errors.filter((err) => _.find(this.visibleErrors, [
|
|
1039
|
-
'component.id',
|
|
1040
|
-
err.component.id,
|
|
1041
|
-
]));
|
|
1001
|
+
editRow.errors = (this.component.modal || this.component.rowDrafts)
|
|
1002
|
+
? errors
|
|
1003
|
+
: errors.filter((err) => _.find(this.visibleErrors, ['component.id', err.component.id]));
|
|
1042
1004
|
}
|
|
1043
1005
|
// TODO: this is essentially running its own custom validation and should be moved into a validation rule
|
|
1044
1006
|
if (this.component.validate && this.component.validate.row) {
|
|
1045
1007
|
const valid = this.evaluate(this.component.validate.row, {
|
|
1046
|
-
valid: editRow.length === 0,
|
|
1047
|
-
row: editRow.data
|
|
1008
|
+
valid: (editRow.length === 0),
|
|
1009
|
+
row: editRow.data
|
|
1048
1010
|
}, 'valid', true);
|
|
1049
1011
|
if (valid.toString() !== 'true') {
|
|
1050
1012
|
editRow.errors.push({
|
|
1051
1013
|
type: 'error',
|
|
1052
1014
|
rowError: true,
|
|
1053
|
-
message: valid.toString()
|
|
1015
|
+
message: valid.toString()
|
|
1054
1016
|
});
|
|
1055
1017
|
}
|
|
1056
1018
|
if (valid === null) {
|
|
1057
1019
|
editRow.errors.push({
|
|
1058
1020
|
type: 'error',
|
|
1059
|
-
message: `Invalid row validation for ${this.key}
|
|
1021
|
+
message: `Invalid row validation for ${this.key}`
|
|
1060
1022
|
});
|
|
1061
1023
|
}
|
|
1062
1024
|
}
|
|
@@ -1089,7 +1051,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1089
1051
|
const { silentCheck, fromSubmission } = options;
|
|
1090
1052
|
const superValid = super.checkComponentValidity(data, dirty, row, options, errors);
|
|
1091
1053
|
// If super tells us that component invalid and there is no need to update alerts, just return false
|
|
1092
|
-
if (!superValid && !this.alert && !this.hasOpenRows()) {
|
|
1054
|
+
if (!superValid && (!this.alert && !this.hasOpenRows())) {
|
|
1093
1055
|
return false;
|
|
1094
1056
|
}
|
|
1095
1057
|
let rowsEditing = false;
|
|
@@ -1103,10 +1065,8 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1103
1065
|
const rowContainer = this.rowRefs[index];
|
|
1104
1066
|
if (rowContainer) {
|
|
1105
1067
|
const errorContainer = rowContainer.querySelector('.editgrid-row-error');
|
|
1106
|
-
if (rowErrors.length &&
|
|
1107
|
-
|
|
1108
|
-
(!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
|
|
1109
|
-
const rowError = rowErrors.find((error) => error.rowError);
|
|
1068
|
+
if (rowErrors.length && errorContainer && (!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
|
|
1069
|
+
const rowError = rowErrors.find(error => error.rowError);
|
|
1110
1070
|
this.addClass(errorContainer, 'help-block');
|
|
1111
1071
|
errorContainer.textContent = this.t(rowError ? rowError.message : this.errorMessage('invalidRowError'));
|
|
1112
1072
|
}
|
|
@@ -1117,12 +1077,10 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1117
1077
|
}
|
|
1118
1078
|
}
|
|
1119
1079
|
// If this is a dirty check, and any rows are still editing, we need to throw validation error.
|
|
1120
|
-
rowsEditing |= dirty && this.isOpen(editRow);
|
|
1080
|
+
rowsEditing |= (dirty && this.isOpen(editRow));
|
|
1121
1081
|
});
|
|
1122
1082
|
if (allRowErrors.length) {
|
|
1123
|
-
if (!silentCheck &&
|
|
1124
|
-
(dirty || this.dirty) &&
|
|
1125
|
-
(!this.component.rowDrafts || this.root?.submitted)) {
|
|
1083
|
+
if (!silentCheck && (dirty || this.dirty) && (!this.component.rowDrafts || this.root?.submitted)) {
|
|
1126
1084
|
this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);
|
|
1127
1085
|
this.removeClass(this.element, 'has-error');
|
|
1128
1086
|
}
|
|
@@ -1139,9 +1097,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1139
1097
|
if (allRowErrors.length && this.root?.submitted && !message) {
|
|
1140
1098
|
this._errors = this.setCustomValidity(message, dirty);
|
|
1141
1099
|
errors.push(...this._errors);
|
|
1142
|
-
this.root
|
|
1143
|
-
message,
|
|
1144
|
-
]);
|
|
1100
|
+
this.root?.showErrors([message]);
|
|
1145
1101
|
}
|
|
1146
1102
|
else {
|
|
1147
1103
|
this._errors = this.setCustomValidity(message, dirty);
|
|
@@ -1174,9 +1130,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1174
1130
|
}
|
|
1175
1131
|
if (!Array.isArray(value)) {
|
|
1176
1132
|
if (typeof value === 'object') {
|
|
1177
|
-
value = [
|
|
1178
|
-
value,
|
|
1179
|
-
];
|
|
1133
|
+
value = [value];
|
|
1180
1134
|
}
|
|
1181
1135
|
else {
|
|
1182
1136
|
return false;
|
|
@@ -1206,12 +1160,10 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
|
1206
1160
|
});
|
|
1207
1161
|
let { length: dataLength } = this.dataValue;
|
|
1208
1162
|
// If the last row is a new row, then do not remove it.
|
|
1209
|
-
if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {
|
|
1210
|
-
dataLength = dataLength + 1;
|
|
1163
|
+
if (this.editRows[dataLength] && (this.editRows[dataLength].state === EditRowState.New)) {
|
|
1164
|
+
dataLength = (dataLength + 1);
|
|
1211
1165
|
}
|
|
1212
|
-
this.editRows
|
|
1213
|
-
.slice(dataLength)
|
|
1214
|
-
.forEach((editRow, index) => this.baseRemoveRow(dataLength + index));
|
|
1166
|
+
this.editRows.slice(dataLength).forEach((editRow, index) => this.baseRemoveRow(dataLength + index));
|
|
1215
1167
|
this.editRows = this.editRows.slice(0, dataLength);
|
|
1216
1168
|
this.openWhenEmpty();
|
|
1217
1169
|
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
|
];
|