@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
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = [
|
|
4
4
|
{
|
|
5
5
|
key: 'validate.required',
|
|
6
|
-
ignore: true
|
|
6
|
+
ignore: true
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
key: 'validate.unique',
|
|
10
|
-
ignore: true
|
|
10
|
+
ignore: true
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
weight: 0,
|
|
@@ -15,7 +15,7 @@ exports.default = [
|
|
|
15
15
|
label: 'Require Day',
|
|
16
16
|
tooltip: 'A required field must be filled in before the form can be submitted.',
|
|
17
17
|
key: 'fields.day.required',
|
|
18
|
-
input: true
|
|
18
|
+
input: true
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
weight: 10,
|
|
@@ -23,7 +23,7 @@ exports.default = [
|
|
|
23
23
|
label: 'Require Month',
|
|
24
24
|
tooltip: 'A required field must be filled in before the form can be submitted.',
|
|
25
25
|
key: 'fields.month.required',
|
|
26
|
-
input: true
|
|
26
|
+
input: true
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
weight: 20,
|
|
@@ -31,14 +31,14 @@ exports.default = [
|
|
|
31
31
|
label: 'Require Year',
|
|
32
32
|
tooltip: 'A required field must be filled in before the form can be submitted.',
|
|
33
33
|
key: 'fields.year.required',
|
|
34
|
-
input: true
|
|
34
|
+
input: true
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
weight: 40,
|
|
38
38
|
type: 'textfield',
|
|
39
39
|
label: 'Minimum Day',
|
|
40
40
|
placeholder: 'yyyy-MM-dd',
|
|
41
|
-
tooltip:
|
|
41
|
+
tooltip: 'A minimum date that can be set. You can also use Moment.js functions. For example: \n \n moment().subtract(10, \'days\')',
|
|
42
42
|
key: 'minDate',
|
|
43
43
|
input: true,
|
|
44
44
|
},
|
|
@@ -47,7 +47,7 @@ exports.default = [
|
|
|
47
47
|
type: 'textfield',
|
|
48
48
|
label: 'Maximum Day',
|
|
49
49
|
placeholder: 'yyyy-MM-dd',
|
|
50
|
-
tooltip:
|
|
50
|
+
tooltip: 'A maximum day that can be set. You can also use Moment.js functions. For example: \n \n moment().add(10, \'days\')',
|
|
51
51
|
key: 'maxDate',
|
|
52
52
|
input: true,
|
|
53
53
|
},
|
|
@@ -15,14 +15,14 @@ exports.default = [
|
|
|
15
15
|
values: [
|
|
16
16
|
{
|
|
17
17
|
label: 'Number',
|
|
18
|
-
value: 'number'
|
|
18
|
+
value: 'number'
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
label: 'Select',
|
|
22
|
-
value: 'select'
|
|
22
|
+
value: 'select'
|
|
23
23
|
},
|
|
24
|
-
]
|
|
25
|
-
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
weight: 203,
|
|
@@ -31,7 +31,7 @@ exports.default = [
|
|
|
31
31
|
key: 'fields.year.minYear',
|
|
32
32
|
label: 'Minimum Year',
|
|
33
33
|
placeholder: '1900',
|
|
34
|
-
tooltip: 'The minimum year that can be entered.'
|
|
34
|
+
tooltip: 'The minimum year that can be entered.'
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
weight: 204,
|
|
@@ -40,7 +40,7 @@ exports.default = [
|
|
|
40
40
|
key: 'fields.year.maxYear',
|
|
41
41
|
label: 'Maximum Year',
|
|
42
42
|
placeholder: '2030',
|
|
43
|
-
tooltip: 'The maximum year that can be entered.'
|
|
43
|
+
tooltip: 'The maximum year that can be entered.'
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
weight: 210,
|
|
@@ -49,7 +49,7 @@ exports.default = [
|
|
|
49
49
|
key: 'fields.year.placeholder',
|
|
50
50
|
label: 'Placeholder',
|
|
51
51
|
placeholder: 'Year Placeholder',
|
|
52
|
-
tooltip: 'The placeholder text that will appear when Year field is empty.'
|
|
52
|
+
tooltip: 'The placeholder text that will appear when Year field is empty.'
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
weight: 215,
|
|
@@ -66,6 +66,6 @@ exports.default = [
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
input: true
|
|
69
|
+
input: true
|
|
70
70
|
},
|
|
71
71
|
];
|
|
@@ -19,7 +19,7 @@ function default_1(...extend) {
|
|
|
19
19
|
label: 'Templates',
|
|
20
20
|
key: 'templates',
|
|
21
21
|
weight: 5,
|
|
22
|
-
components: EditGrid_edit_templates_1.default
|
|
22
|
+
components: EditGrid_edit_templates_1.default
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
key: 'display',
|
|
@@ -31,7 +31,7 @@ function default_1(...extend) {
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
key: 'validation',
|
|
34
|
-
components: EditGrid_edit_validation_1.default
|
|
34
|
+
components: EditGrid_edit_validation_1.default
|
|
35
35
|
},
|
|
36
36
|
], ...extend);
|
|
37
37
|
}
|
|
@@ -140,11 +140,13 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
140
140
|
get rowTemplate() {
|
|
141
141
|
let rowTemplate;
|
|
142
142
|
if (utils_1.Evaluator.noeval) {
|
|
143
|
-
rowTemplate = this.displayAsTable ?
|
|
143
|
+
rowTemplate = this.displayAsTable ?
|
|
144
|
+
components_1.editgrid.tableRow
|
|
145
|
+
: components_1.editgrid.row;
|
|
144
146
|
}
|
|
145
147
|
else {
|
|
146
|
-
rowTemplate = this.displayAsTable
|
|
147
|
-
|
|
148
|
+
rowTemplate = this.displayAsTable ?
|
|
149
|
+
lodash_1.default.get(this.component, 'templates.tableRow', this.defaultRowTemplate)
|
|
148
150
|
: lodash_1.default.get(this.component, 'templates.row', this.defaultRowTemplate);
|
|
149
151
|
}
|
|
150
152
|
return rowTemplate;
|
|
@@ -152,11 +154,13 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
152
154
|
get headerTemplate() {
|
|
153
155
|
let headerTemplate;
|
|
154
156
|
if (utils_1.Evaluator.noeval) {
|
|
155
|
-
headerTemplate = this.displayAsTable ?
|
|
157
|
+
headerTemplate = this.displayAsTable ?
|
|
158
|
+
components_1.editgrid.tableHeader
|
|
159
|
+
: components_1.editgrid.header;
|
|
156
160
|
}
|
|
157
161
|
else {
|
|
158
|
-
headerTemplate = this.displayAsTable
|
|
159
|
-
|
|
162
|
+
headerTemplate = this.displayAsTable ?
|
|
163
|
+
lodash_1.default.get(this.component, 'templates.tableHeader', this.defaultHeaderTemplate)
|
|
160
164
|
: lodash_1.default.get(this.component, 'templates.header', this.defaultHeaderTemplate);
|
|
161
165
|
}
|
|
162
166
|
return headerTemplate;
|
|
@@ -252,11 +256,11 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
252
256
|
this.type = 'editgrid';
|
|
253
257
|
}
|
|
254
258
|
hasRemoveButtons() {
|
|
255
|
-
return
|
|
259
|
+
return !this.component.disableAddingRemovingRows &&
|
|
256
260
|
!this.options.readOnly &&
|
|
257
261
|
!this.disabled &&
|
|
258
262
|
this.fullMode &&
|
|
259
|
-
this.dataValue.length > lodash_1.default.get(this.component, 'validate.minLength', 0));
|
|
263
|
+
(this.dataValue.length > lodash_1.default.get(this.component, 'validate.minLength', 0));
|
|
260
264
|
}
|
|
261
265
|
init() {
|
|
262
266
|
if (this.builderMode) {
|
|
@@ -307,20 +311,12 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
307
311
|
});
|
|
308
312
|
}
|
|
309
313
|
isOpen(editRow) {
|
|
310
|
-
return [
|
|
311
|
-
EditRowState.New,
|
|
312
|
-
EditRowState.Editing,
|
|
313
|
-
EditRowState.Viewing,
|
|
314
|
-
].includes(editRow.state);
|
|
314
|
+
return [EditRowState.New, EditRowState.Editing, EditRowState.Viewing].includes(editRow.state);
|
|
315
315
|
}
|
|
316
316
|
isComponentVisibleInSomeRow(component) {
|
|
317
317
|
const rows = this.editRows;
|
|
318
|
-
const savedStates = [
|
|
319
|
-
|
|
320
|
-
EditRowState.Editing,
|
|
321
|
-
EditRowState.Draft,
|
|
322
|
-
];
|
|
323
|
-
const savedRows = rows.filter((row) => lodash_1.default.includes(savedStates, row.state));
|
|
318
|
+
const savedStates = [EditRowState.Saved, EditRowState.Editing, EditRowState.Draft];
|
|
319
|
+
const savedRows = rows.filter(row => lodash_1.default.includes(savedStates, row.state));
|
|
324
320
|
this.visibleInHeader = this.visibleInHeader || [];
|
|
325
321
|
const changeVisibleInHeader = (component, isVisible) => {
|
|
326
322
|
if (!isVisible) {
|
|
@@ -340,15 +336,11 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
340
336
|
comp.checkConditions();
|
|
341
337
|
});
|
|
342
338
|
const isVisible = checkComponent ? checkComponent.visible : true;
|
|
343
|
-
[
|
|
344
|
-
...this.components,
|
|
345
|
-
].forEach((comp) => this.removeComponent(comp, this.components));
|
|
339
|
+
[...this.components].forEach((comp) => this.removeComponent(comp, this.components));
|
|
346
340
|
changeVisibleInHeader(component, isVisible);
|
|
347
341
|
return isVisible;
|
|
348
342
|
}
|
|
349
|
-
const isOpenRowWhenEmpty = lodash_1.default.get(this.component, 'openWhenEmpty') &&
|
|
350
|
-
rows.length === 1 &&
|
|
351
|
-
rows[0].state === EditRowState.New;
|
|
343
|
+
const isOpenRowWhenEmpty = lodash_1.default.get(this.component, 'openWhenEmpty') && rows.length === 1 && rows[0].state === EditRowState.New;
|
|
352
344
|
if (!lodash_1.default.isEmpty(rows) && lodash_1.default.isEmpty(savedRows) && !isOpenRowWhenEmpty) {
|
|
353
345
|
return lodash_1.default.includes(this.visibleInHeader, component.key);
|
|
354
346
|
}
|
|
@@ -375,35 +367,34 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
375
367
|
const headerTemplate = this.headerTemplate;
|
|
376
368
|
const t = this.t.bind(this);
|
|
377
369
|
const templateName = this.displayAsTable ? 'editgridTable' : 'editgrid';
|
|
378
|
-
return super.render(children ||
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}));
|
|
370
|
+
return super.render(children || this.renderTemplate(templateName, {
|
|
371
|
+
ref: {
|
|
372
|
+
row: this.rowRef,
|
|
373
|
+
addRow: this.addRowRef,
|
|
374
|
+
saveRow: this.saveRowRef,
|
|
375
|
+
cancelRow: this.cancelRowRef,
|
|
376
|
+
},
|
|
377
|
+
header: this.renderString(headerTemplate, {
|
|
378
|
+
displayValue: (component) => this.displayComponentValue(component, true),
|
|
379
|
+
components: this.component.components,
|
|
380
|
+
value: dataValue,
|
|
381
|
+
t
|
|
382
|
+
}),
|
|
383
|
+
footer: this.renderString(lodash_1.default.get(this.component, 'templates.footer'), {
|
|
384
|
+
components: this.component.components,
|
|
385
|
+
value: dataValue,
|
|
386
|
+
t
|
|
387
|
+
}),
|
|
388
|
+
rows: this.editRows.map(this.renderRow.bind(this)),
|
|
389
|
+
openRows: this.editRows.map((row) => this.isOpen(row)),
|
|
390
|
+
errors: this.editRows.map((row) => row.error),
|
|
391
|
+
hasAddButton: this.hasAddButton(),
|
|
392
|
+
hasRemoveButtons: this.hasRemoveButtons(),
|
|
393
|
+
}));
|
|
403
394
|
}
|
|
404
395
|
renderComponents(components) {
|
|
405
396
|
components = components || this.getComponents();
|
|
406
|
-
const children = components.map(
|
|
397
|
+
const children = components.map(component => component.render());
|
|
407
398
|
const templateName = this.displayAsTable && this.prevHasAddButton ? 'tableComponents' : 'components';
|
|
408
399
|
return this.renderTemplate(templateName, {
|
|
409
400
|
children,
|
|
@@ -475,18 +466,14 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
475
466
|
}
|
|
476
467
|
this.emit(eventName, {
|
|
477
468
|
component: this.component,
|
|
478
|
-
data: this.dataValue[rowIndex]
|
|
469
|
+
data: this.dataValue[rowIndex]
|
|
479
470
|
});
|
|
480
471
|
},
|
|
481
|
-
}
|
|
482
|
-
].forEach(({ className, event, action }) => {
|
|
472
|
+
}
|
|
473
|
+
].forEach(({ className, event, action, }) => {
|
|
483
474
|
const elements = row.getElementsByClassName(className);
|
|
484
475
|
Array.prototype.forEach.call(elements, (element) => {
|
|
485
|
-
if (this.options.pdf &&
|
|
486
|
-
lodash_1.default.intersection(element.classList, [
|
|
487
|
-
'editRow',
|
|
488
|
-
'removeRow',
|
|
489
|
-
]).length) {
|
|
476
|
+
if (this.options.pdf && lodash_1.default.intersection(element.classList, ['editRow', 'removeRow']).length) {
|
|
490
477
|
element.style.display = 'none';
|
|
491
478
|
}
|
|
492
479
|
else {
|
|
@@ -522,9 +509,8 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
522
509
|
return instance ? instance.visible : true;
|
|
523
510
|
}
|
|
524
511
|
displayComponentValue(component, header) {
|
|
525
|
-
return !!((!component.hasOwnProperty('tableView') || component.tableView)
|
|
526
|
-
? this.isComponentVisibleInSomeRow(component)
|
|
527
|
-
: lodash_1.default.includes(this.visibleInHeader, component.key));
|
|
512
|
+
return !!((!component.hasOwnProperty('tableView') || component.tableView)
|
|
513
|
+
&& header ? this.isComponentVisibleInSomeRow(component) : lodash_1.default.includes(this.visibleInHeader, component.key));
|
|
528
514
|
}
|
|
529
515
|
renderRow(row, rowIndex) {
|
|
530
516
|
const dataValue = this.dataValue;
|
|
@@ -548,16 +534,12 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
548
534
|
const view = instance ? instance.getView(data || instance.dataValue) : '';
|
|
549
535
|
// If there is an html tag in view, don't allow it to be injected in template
|
|
550
536
|
const htmlTagRegExp = new RegExp('<(.*?)>');
|
|
551
|
-
return typeof view === 'string' &&
|
|
552
|
-
view.length &&
|
|
553
|
-
!((_a = instance.component) === null || _a === void 0 ? void 0 : _a.template) &&
|
|
554
|
-
htmlTagRegExp.test(view) &&
|
|
555
|
-
((_b = instance.component) === null || _b === void 0 ? void 0 : _b.inputFormat) !== 'html'
|
|
537
|
+
return typeof view === 'string' && view.length && !((_a = instance.component) === null || _a === void 0 ? void 0 : _a.template) && htmlTagRegExp.test(view) && ((_b = instance.component) === null || _b === void 0 ? void 0 : _b.inputFormat) !== 'html'
|
|
556
538
|
? `<input type="text" value="${view.replace(/"/g, '"')}" readonly/>`
|
|
557
539
|
: view;
|
|
558
540
|
},
|
|
559
541
|
state: this.editRows[rowIndex].state,
|
|
560
|
-
t: this.t.bind(this)
|
|
542
|
+
t: this.t.bind(this)
|
|
561
543
|
});
|
|
562
544
|
}
|
|
563
545
|
}
|
|
@@ -582,7 +564,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
582
564
|
return this.builderMode
|
|
583
565
|
? super.getComponents()
|
|
584
566
|
: lodash_1.default.isNumber(rowIndex)
|
|
585
|
-
? ((_a = this.editRows[rowIndex]) === null || _a === void 0 ? void 0 : _a.components) || []
|
|
567
|
+
? (((_a = this.editRows[rowIndex]) === null || _a === void 0 ? void 0 : _a.components) || [])
|
|
586
568
|
: this.editRows.reduce((result, row) => result.concat(row.components || []), []);
|
|
587
569
|
}
|
|
588
570
|
destroy(all = false) {
|
|
@@ -612,6 +594,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
612
594
|
return editRow;
|
|
613
595
|
}
|
|
614
596
|
addRow() {
|
|
597
|
+
var _a;
|
|
615
598
|
if (this.options.readOnly) {
|
|
616
599
|
return;
|
|
617
600
|
}
|
|
@@ -622,7 +605,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
622
605
|
this.emptyRow = (0, utils_1.fastCloneDeep)(editRow.data);
|
|
623
606
|
}
|
|
624
607
|
if (this.inlineEditMode) {
|
|
625
|
-
this.triggerChange();
|
|
608
|
+
(_a = this.triggerChange) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
626
609
|
}
|
|
627
610
|
this.emit('editGridAddRow', {
|
|
628
611
|
component: this.component,
|
|
@@ -643,9 +626,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
643
626
|
editRow.willBeSaved = false;
|
|
644
627
|
const { components } = editRow;
|
|
645
628
|
modalContent.innerHTML = this.renderComponents(components);
|
|
646
|
-
const dialog = this.component.modal
|
|
647
|
-
? this.createModal(modalContent, {}, () => this.showDialog(rowIndex))
|
|
648
|
-
: undefined;
|
|
629
|
+
const dialog = this.component.modal ? this.createModal(modalContent, {}, () => this.showDialog(rowIndex)) : undefined;
|
|
649
630
|
dialog.classList.add(`editgrid-row-modal-${this.id}`);
|
|
650
631
|
editRow.dialog = dialog;
|
|
651
632
|
if (this.alert) {
|
|
@@ -698,9 +679,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
698
679
|
}
|
|
699
680
|
showDialog(rowIndex) {
|
|
700
681
|
const editRow = this.editRows[rowIndex];
|
|
701
|
-
if (editRow.state === EditRowState.New
|
|
702
|
-
? lodash_1.default.isEqual(this.emptyRow, editRow.data)
|
|
703
|
-
: lodash_1.default.isEqual(editRow.backup, editRow.data)) {
|
|
682
|
+
if (editRow.state === EditRowState.New ? lodash_1.default.isEqual(this.emptyRow, editRow.data) : lodash_1.default.isEqual(editRow.backup, editRow.data)) {
|
|
704
683
|
return Promise.resolve();
|
|
705
684
|
}
|
|
706
685
|
const wrapper = this.ce('div', { ref: 'confirmationDialog' });
|
|
@@ -741,7 +720,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
741
720
|
}
|
|
742
721
|
editRow.prevState = editRow.state;
|
|
743
722
|
editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;
|
|
744
|
-
if (this.lazyLoad && editRow.components.length === 0) {
|
|
723
|
+
if (this.lazyLoad && (editRow.components.length === 0)) {
|
|
745
724
|
editRow.components = this.createRowComponents(editRow.data, rowIndex);
|
|
746
725
|
}
|
|
747
726
|
const dataSnapshot = (0, utils_1.fastCloneDeep)(editRow.data);
|
|
@@ -813,7 +792,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
813
792
|
}
|
|
814
793
|
}
|
|
815
794
|
saveRow(rowIndex, modified) {
|
|
816
|
-
var _a, _b;
|
|
795
|
+
var _a, _b, _c;
|
|
817
796
|
const editRow = this.editRows[rowIndex];
|
|
818
797
|
if (this.options.readOnly) {
|
|
819
798
|
return;
|
|
@@ -837,7 +816,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
837
816
|
case EditRowState.New: {
|
|
838
817
|
const newIndex = dataValue.length;
|
|
839
818
|
dataValue.push(editRow.data);
|
|
840
|
-
editRow.components.forEach(
|
|
819
|
+
editRow.components.forEach(component => component.rowIndex = newIndex);
|
|
841
820
|
if (rowIndex !== newIndex) {
|
|
842
821
|
this.editRows.splice(rowIndex, 1);
|
|
843
822
|
this.editRows.splice(newIndex, 0, editRow);
|
|
@@ -850,22 +829,17 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
850
829
|
}
|
|
851
830
|
}
|
|
852
831
|
}
|
|
853
|
-
editRow.state =
|
|
854
|
-
this.component.rowDrafts && errors.length ? EditRowState.Draft : EditRowState.Saved;
|
|
832
|
+
editRow.state = this.component.rowDrafts && errors.length ? EditRowState.Draft : EditRowState.Saved;
|
|
855
833
|
editRow.backup = null;
|
|
856
834
|
this.updateValue();
|
|
857
835
|
this.emit('editGridSaveRow', {
|
|
858
836
|
component: this.component,
|
|
859
837
|
row: editRow.data,
|
|
860
|
-
instance: this
|
|
861
|
-
});
|
|
862
|
-
this.triggerChange({
|
|
863
|
-
modified,
|
|
864
|
-
noPristineChangeOnModified: modified && this.component.rowDrafts,
|
|
865
|
-
isolateRow: true,
|
|
838
|
+
instance: this
|
|
866
839
|
});
|
|
840
|
+
(_c = this.triggerChange) === null || _c === void 0 ? void 0 : _c.call(this, { modified, noPristineChangeOnModified: modified && this.component.rowDrafts, isolateRow: true });
|
|
867
841
|
if (this.component.rowDrafts) {
|
|
868
|
-
editRow.components.forEach(
|
|
842
|
+
editRow.components.forEach(comp => comp.setPristine(this.pristine));
|
|
869
843
|
}
|
|
870
844
|
this.checkValidity(null, true);
|
|
871
845
|
this.redraw();
|
|
@@ -909,6 +883,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
909
883
|
return editRow;
|
|
910
884
|
}
|
|
911
885
|
removeRow(rowIndex, modified) {
|
|
886
|
+
var _a;
|
|
912
887
|
if (this.options.readOnly) {
|
|
913
888
|
return;
|
|
914
889
|
}
|
|
@@ -917,17 +892,13 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
917
892
|
this.removeSubmissionMetadataRow(rowIndex);
|
|
918
893
|
this.splice(rowIndex);
|
|
919
894
|
this.emit('editGridDeleteRow', {
|
|
920
|
-
index: rowIndex
|
|
895
|
+
index: rowIndex
|
|
921
896
|
});
|
|
922
897
|
this.editRows.splice(rowIndex, 1);
|
|
923
898
|
this.openWhenEmpty();
|
|
924
899
|
this.updateRowsComponents(rowIndex);
|
|
925
900
|
this.updateValue();
|
|
926
|
-
this.triggerChange({
|
|
927
|
-
modified,
|
|
928
|
-
noPristineChangeOnModified: modified && this.component.rowDrafts,
|
|
929
|
-
isolateRow: true,
|
|
930
|
-
});
|
|
901
|
+
(_a = this.triggerChange) === null || _a === void 0 ? void 0 : _a.call(this, { modified, noPristineChangeOnModified: modified && this.component.rowDrafts, isolateRow: true });
|
|
931
902
|
this.checkValidity(null, true);
|
|
932
903
|
this.checkData();
|
|
933
904
|
this.redraw();
|
|
@@ -947,8 +918,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
947
918
|
var _a;
|
|
948
919
|
if (recreatePartially && currentRowComponents && this.variableTypeComponentsIndexes.length) {
|
|
949
920
|
const currentComp = currentRowComponents[colIndex];
|
|
950
|
-
const shouldRecreate = lodash_1.default.includes(this.variableTypeComponentsIndexes, colIndex) &&
|
|
951
|
-
(currentComp === null || currentComp === void 0 ? void 0 : currentComp.type) !== ((_a = currentComp === null || currentComp === void 0 ? void 0 : currentComp.component) === null || _a === void 0 ? void 0 : _a.type);
|
|
921
|
+
const shouldRecreate = lodash_1.default.includes(this.variableTypeComponentsIndexes, colIndex) && (currentComp === null || currentComp === void 0 ? void 0 : currentComp.type) !== ((_a = currentComp === null || currentComp === void 0 ? void 0 : currentComp.component) === null || _a === void 0 ? void 0 : _a.type);
|
|
952
922
|
if (!shouldRecreate) {
|
|
953
923
|
return currentComp;
|
|
954
924
|
}
|
|
@@ -960,9 +930,9 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
960
930
|
options.row = `${rowIndex}-${colIndex}`;
|
|
961
931
|
options.rowIndex = rowIndex;
|
|
962
932
|
options.onChange = (flags = {}, changed, modified) => {
|
|
963
|
-
var _a, _b;
|
|
964
|
-
if (((_a = changed.instance.root) === null || _a === void 0 ? void 0 : _a.id) && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.id) !== changed.instance.root.id) {
|
|
965
|
-
changed.instance.root.triggerChange(flags, changed, modified);
|
|
933
|
+
var _a, _b, _c, _d;
|
|
934
|
+
if (((_a = changed.instance.root) === null || _a === void 0 ? void 0 : _a.id) && (((_b = this.root) === null || _b === void 0 ? void 0 : _b.id) !== changed.instance.root.id)) {
|
|
935
|
+
(_d = (_c = changed.instance.root) === null || _c === void 0 ? void 0 : _c.triggerChange) === null || _d === void 0 ? void 0 : _d.call(_c, flags, changed, modified);
|
|
966
936
|
}
|
|
967
937
|
else if (!this.component.modal) {
|
|
968
938
|
this.triggerRootChange(flags, changed, modified);
|
|
@@ -987,7 +957,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
987
957
|
});
|
|
988
958
|
}
|
|
989
959
|
hasOpenRows() {
|
|
990
|
-
return this.editRows.some(
|
|
960
|
+
return this.editRows.some(row => this.isOpen(row));
|
|
991
961
|
}
|
|
992
962
|
getAttachedData(data = null) {
|
|
993
963
|
const ourData = (0, utils_1.fastCloneDeep)(data || this._data || this.rootValue);
|
|
@@ -997,27 +967,25 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
997
967
|
shouldValidateDraft(editRow) {
|
|
998
968
|
var _a, _b;
|
|
999
969
|
// Draft rows should be validated only when there was an attempt to submit a form
|
|
1000
|
-
return (
|
|
970
|
+
return (editRow.state === EditRowState.Draft &&
|
|
1001
971
|
!this.pristine &&
|
|
1002
972
|
!((_a = this.root) === null || _a === void 0 ? void 0 : _a.pristine) &&
|
|
1003
973
|
!this.hasOpenRows()) ||
|
|
1004
|
-
((_b = this.root) === null || _b === void 0 ? void 0 : _b.submitted)
|
|
974
|
+
((_b = this.root) === null || _b === void 0 ? void 0 : _b.submitted);
|
|
1005
975
|
}
|
|
1006
976
|
shouldValidateRow(editRow, dirty, fromSubmission) {
|
|
1007
|
-
return
|
|
977
|
+
return this.shouldValidateDraft(editRow) ||
|
|
1008
978
|
editRow.state === EditRowState.New ||
|
|
1009
979
|
editRow.state === EditRowState.Editing ||
|
|
1010
980
|
editRow.alerts ||
|
|
1011
981
|
fromSubmission ||
|
|
1012
|
-
dirty
|
|
982
|
+
dirty;
|
|
1013
983
|
}
|
|
1014
984
|
validateRow(editRow, dirty, forceSilentCheck, fromSubmission) {
|
|
1015
985
|
var _a;
|
|
1016
986
|
editRow.errors = [];
|
|
1017
987
|
if (this.shouldValidateRow(editRow, dirty, fromSubmission)) {
|
|
1018
|
-
const silentCheck = forceSilentCheck === false
|
|
1019
|
-
? false
|
|
1020
|
-
: (this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck;
|
|
988
|
+
const silentCheck = forceSilentCheck === false ? false : ((this.component.rowDrafts && !this.shouldValidateDraft(editRow)) || forceSilentCheck);
|
|
1021
989
|
const rootValue = (0, utils_1.fastCloneDeep)(this.rootValue);
|
|
1022
990
|
const editGridValue = lodash_1.default.get(rootValue, this.path, []);
|
|
1023
991
|
editGridValue[editRow.rowIndex] = editRow.data;
|
|
@@ -1035,35 +1003,31 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1035
1003
|
processors: [
|
|
1036
1004
|
{
|
|
1037
1005
|
process: validationProcessorProcess,
|
|
1038
|
-
processSync: validationProcessorProcess
|
|
1039
|
-
}
|
|
1040
|
-
]
|
|
1006
|
+
processSync: validationProcessorProcess
|
|
1007
|
+
}
|
|
1008
|
+
]
|
|
1041
1009
|
}).errors;
|
|
1042
|
-
editRow.errors =
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
: errors.filter((err) => lodash_1.default.find(this.visibleErrors, [
|
|
1046
|
-
'component.id',
|
|
1047
|
-
err.component.id,
|
|
1048
|
-
]));
|
|
1010
|
+
editRow.errors = (this.component.modal || this.component.rowDrafts)
|
|
1011
|
+
? errors
|
|
1012
|
+
: errors.filter((err) => lodash_1.default.find(this.visibleErrors, ['component.id', err.component.id]));
|
|
1049
1013
|
}
|
|
1050
1014
|
// TODO: this is essentially running its own custom validation and should be moved into a validation rule
|
|
1051
1015
|
if (this.component.validate && this.component.validate.row) {
|
|
1052
1016
|
const valid = this.evaluate(this.component.validate.row, {
|
|
1053
|
-
valid: editRow.length === 0,
|
|
1054
|
-
row: editRow.data
|
|
1017
|
+
valid: (editRow.length === 0),
|
|
1018
|
+
row: editRow.data
|
|
1055
1019
|
}, 'valid', true);
|
|
1056
1020
|
if (valid.toString() !== 'true') {
|
|
1057
1021
|
editRow.errors.push({
|
|
1058
1022
|
type: 'error',
|
|
1059
1023
|
rowError: true,
|
|
1060
|
-
message: valid.toString()
|
|
1024
|
+
message: valid.toString()
|
|
1061
1025
|
});
|
|
1062
1026
|
}
|
|
1063
1027
|
if (valid === null) {
|
|
1064
1028
|
editRow.errors.push({
|
|
1065
1029
|
type: 'error',
|
|
1066
|
-
message: `Invalid row validation for ${this.key}
|
|
1030
|
+
message: `Invalid row validation for ${this.key}`
|
|
1067
1031
|
});
|
|
1068
1032
|
}
|
|
1069
1033
|
}
|
|
@@ -1093,11 +1057,11 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1093
1057
|
return true;
|
|
1094
1058
|
}
|
|
1095
1059
|
checkComponentValidity(data, dirty, row, options = {}, errors = []) {
|
|
1096
|
-
var _a, _b;
|
|
1060
|
+
var _a, _b, _c;
|
|
1097
1061
|
const { silentCheck, fromSubmission } = options;
|
|
1098
1062
|
const superValid = super.checkComponentValidity(data, dirty, row, options, errors);
|
|
1099
1063
|
// If super tells us that component invalid and there is no need to update alerts, just return false
|
|
1100
|
-
if (!superValid && !this.alert && !this.hasOpenRows()) {
|
|
1064
|
+
if (!superValid && (!this.alert && !this.hasOpenRows())) {
|
|
1101
1065
|
return false;
|
|
1102
1066
|
}
|
|
1103
1067
|
let rowsEditing = false;
|
|
@@ -1111,10 +1075,8 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1111
1075
|
const rowContainer = this.rowRefs[index];
|
|
1112
1076
|
if (rowContainer) {
|
|
1113
1077
|
const errorContainer = rowContainer.querySelector('.editgrid-row-error');
|
|
1114
|
-
if (rowErrors.length &&
|
|
1115
|
-
|
|
1116
|
-
(!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
|
|
1117
|
-
const rowError = rowErrors.find((error) => error.rowError);
|
|
1078
|
+
if (rowErrors.length && errorContainer && (!this.component.rowDrafts || this.shouldValidateDraft(editRow))) {
|
|
1079
|
+
const rowError = rowErrors.find(error => error.rowError);
|
|
1118
1080
|
this.addClass(errorContainer, 'help-block');
|
|
1119
1081
|
errorContainer.textContent = this.t(rowError ? rowError.message : this.errorMessage('invalidRowError'));
|
|
1120
1082
|
}
|
|
@@ -1125,12 +1087,10 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1125
1087
|
}
|
|
1126
1088
|
}
|
|
1127
1089
|
// If this is a dirty check, and any rows are still editing, we need to throw validation error.
|
|
1128
|
-
rowsEditing |= dirty && this.isOpen(editRow);
|
|
1090
|
+
rowsEditing |= (dirty && this.isOpen(editRow));
|
|
1129
1091
|
});
|
|
1130
1092
|
if (allRowErrors.length) {
|
|
1131
|
-
if (!silentCheck &&
|
|
1132
|
-
(dirty || this.dirty) &&
|
|
1133
|
-
(!this.component.rowDrafts || ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submitted))) {
|
|
1093
|
+
if (!silentCheck && (dirty || this.dirty) && (!this.component.rowDrafts || ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submitted))) {
|
|
1134
1094
|
this.setCustomValidity(this.t(this.errorMessage('invalidRowsError')), dirty);
|
|
1135
1095
|
this.removeClass(this.element, 'has-error');
|
|
1136
1096
|
}
|
|
@@ -1147,9 +1107,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1147
1107
|
if (allRowErrors.length && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submitted) && !message) {
|
|
1148
1108
|
this._errors = this.setCustomValidity(message, dirty);
|
|
1149
1109
|
errors.push(...this._errors);
|
|
1150
|
-
this.root.showErrors([
|
|
1151
|
-
message,
|
|
1152
|
-
]);
|
|
1110
|
+
(_c = this.root) === null || _c === void 0 ? void 0 : _c.showErrors([message]);
|
|
1153
1111
|
}
|
|
1154
1112
|
else {
|
|
1155
1113
|
this._errors = this.setCustomValidity(message, dirty);
|
|
@@ -1182,9 +1140,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1182
1140
|
}
|
|
1183
1141
|
if (!Array.isArray(value)) {
|
|
1184
1142
|
if (typeof value === 'object') {
|
|
1185
|
-
value = [
|
|
1186
|
-
value,
|
|
1187
|
-
];
|
|
1143
|
+
value = [value];
|
|
1188
1144
|
}
|
|
1189
1145
|
else {
|
|
1190
1146
|
return false;
|
|
@@ -1214,12 +1170,10 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
|
1214
1170
|
});
|
|
1215
1171
|
let { length: dataLength } = this.dataValue;
|
|
1216
1172
|
// If the last row is a new row, then do not remove it.
|
|
1217
|
-
if (this.editRows[dataLength] && this.editRows[dataLength].state === EditRowState.New) {
|
|
1218
|
-
dataLength = dataLength + 1;
|
|
1173
|
+
if (this.editRows[dataLength] && (this.editRows[dataLength].state === EditRowState.New)) {
|
|
1174
|
+
dataLength = (dataLength + 1);
|
|
1219
1175
|
}
|
|
1220
|
-
this.editRows
|
|
1221
|
-
.slice(dataLength)
|
|
1222
|
-
.forEach((editRow, index) => this.baseRemoveRow(dataLength + index));
|
|
1176
|
+
this.editRows.slice(dataLength).forEach((editRow, index) => this.baseRemoveRow(dataLength + index));
|
|
1223
1177
|
this.editRows = this.editRows.slice(0, dataLength);
|
|
1224
1178
|
this.openWhenEmpty();
|
|
1225
1179
|
this.updateOnChange(flags, changed);
|
|
@@ -7,7 +7,7 @@ exports.default = [
|
|
|
7
7
|
weight: 105,
|
|
8
8
|
key: 'inlineEdit',
|
|
9
9
|
label: 'Inline Editing',
|
|
10
|
-
tooltip:
|
|
10
|
+
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',
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
key: 'defaultValue',
|
|
@@ -15,6 +15,6 @@ exports.default = [
|
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
key: 'multiple',
|
|
18
|
-
ignore: true
|
|
18
|
+
ignore: true
|
|
19
19
|
},
|
|
20
20
|
];
|