@formio/js 5.0.0-dev.5673.3d062b9 → 5.0.0-dev.5673.ae99c16
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/Changelog.md +63 -1
- package/dist/formio.builder.css +0 -1
- 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.form.css +0 -1
- package/dist/formio.form.js +646 -594
- 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 -9
- package/dist/formio.full.css +0 -1
- package/dist/formio.full.js +633 -601
- 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 -9
- package/dist/formio.js +4 -4
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +100 -38
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +5 -3
- package/lib/cjs/CDN.d.ts +1 -0
- package/lib/cjs/CDN.js +2 -2
- package/lib/cjs/Form.d.ts +2 -2
- package/lib/cjs/Form.js +11 -5
- package/lib/cjs/Formio.js +1 -0
- package/lib/cjs/PDF.js +1 -1
- package/lib/cjs/PDFBuilder.js +2 -1
- package/lib/cjs/Webform.d.ts +1 -1
- package/lib/cjs/Webform.js +11 -6
- package/lib/cjs/WebformBuilder.js +13 -3
- package/lib/cjs/Wizard.js +1 -1
- package/lib/cjs/components/_classes/component/Component.d.ts +4 -3
- package/lib/cjs/components/_classes/component/Component.js +31 -8
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/cjs/components/_classes/component/fixtures/comp7.js +86 -0
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/_classes/input/Input.js +23 -1
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +53 -26
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.js +56 -29
- package/lib/cjs/components/address/Address.d.ts +6 -0
- package/lib/cjs/components/address/Address.js +11 -1
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.js +1 -1
- package/lib/cjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/cjs/components/checkbox/fixtures/comp6.js +30 -0
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/checkbox/fixtures/index.js +3 -1
- package/lib/cjs/components/currency/Currency.d.ts +2 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +11 -1
- package/lib/cjs/components/datagrid/DataGrid.js +59 -36
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/cjs/components/datagrid/fixtures/comp-with-reorder.js +139 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/cjs/components/datagrid/fixtures/comp10.js +87 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/cjs/components/datagrid/fixtures/comp11.js +55 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/cjs/components/datagrid/fixtures/comp9.js +44 -0
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/cjs/components/datagrid/fixtures/index.js +9 -1
- package/lib/cjs/components/datamap/DataMap.js +2 -2
- package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
- package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/cjs/components/datetime/fixtures/index.js +3 -1
- package/lib/cjs/components/day/Day.d.ts +3 -4
- package/lib/cjs/components/day/Day.js +31 -10
- package/lib/cjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/cjs/components/day/fixtures/comp8.js +40 -0
- package/lib/cjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/day/fixtures/index.js +3 -1
- package/lib/cjs/components/editgrid/EditGrid.js +16 -8
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp-test-events.js +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/cjs/components/editgrid/fixtures/comp16.js +71 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.d.ts +80 -0
- package/lib/cjs/components/editgrid/fixtures/comp17.js +99 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +7 -1
- package/lib/cjs/components/file/File.d.ts +2 -2
- package/lib/cjs/components/file/File.js +13 -2
- package/lib/cjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/cjs/components/form/Form.d.ts +1 -1
- package/lib/cjs/components/form/Form.js +1 -1
- package/lib/cjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/cjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/form/fixtures/index.js +3 -1
- package/lib/cjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/cjs/components/form/fixtures/nestedWizardForm.js +765 -0
- package/lib/cjs/components/html/HTML.js +1 -1
- package/lib/cjs/components/number/Number.d.ts +17 -2
- package/lib/cjs/components/number/Number.js +27 -7
- package/lib/cjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp10.js +21 -0
- package/lib/cjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/cjs/components/number/fixtures/comp8.js +28 -0
- package/lib/cjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/cjs/components/number/fixtures/comp9.js +21 -0
- package/lib/cjs/components/number/fixtures/index.d.ts +4 -1
- package/lib/cjs/components/number/fixtures/index.js +7 -1
- package/lib/cjs/components/panel/Panel.d.ts +1 -0
- package/lib/cjs/components/panel/Panel.js +1 -0
- package/lib/cjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/cjs/components/phonenumber/fixtures/comp2.js +25 -0
- package/lib/cjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/phonenumber/fixtures/index.js +3 -1
- package/lib/cjs/components/radio/Radio.d.ts +2 -18
- package/lib/cjs/components/radio/Radio.js +29 -27
- package/lib/cjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/cjs/components/radio/fixtures/comp12.js +36 -0
- package/lib/cjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/radio/fixtures/index.js +3 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/cjs/components/recaptcha/ReCaptcha.js +6 -0
- package/lib/cjs/components/select/Select.d.ts +38 -0
- package/lib/cjs/components/select/Select.js +14 -5
- package/lib/cjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/cjs/components/select/fixtures/comp25.js +66 -0
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/select/fixtures/index.js +5 -1
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/cjs/components/selectboxes/SelectBoxes.js +12 -9
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/cjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/cjs/components/tags/Tags.js +3 -3
- package/lib/cjs/components/time/Time.d.ts +2 -2
- package/lib/cjs/components/time/Time.form.js +2 -2
- package/lib/cjs/components/time/Time.js +3 -7
- package/lib/cjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/cjs/components/time/fixtures/comp4.js +171 -0
- package/lib/cjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/time/fixtures/index.js +3 -1
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/cjs/providers/address/GoogleAddressProvider.js +23 -1
- package/lib/cjs/templates/Templates.js +1 -1
- package/lib/cjs/translations/en.d.ts +4 -0
- package/lib/cjs/translations/en.js +5 -1
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/cjs/utils/utils.d.ts +2 -11
- package/lib/cjs/utils/utils.js +60 -24
- package/lib/cjs/widgets/CalendarWidget.js +24 -10
- package/lib/mjs/CDN.d.ts +1 -0
- package/lib/mjs/CDN.js +2 -2
- package/lib/mjs/Form.d.ts +2 -2
- package/lib/mjs/Form.js +11 -5
- package/lib/mjs/Formio.js +1 -0
- package/lib/mjs/PDF.js +1 -1
- package/lib/mjs/PDFBuilder.js +1 -1
- package/lib/mjs/Webform.d.ts +1 -1
- package/lib/mjs/Webform.js +15 -6
- package/lib/mjs/WebformBuilder.js +12 -3
- package/lib/mjs/Wizard.js +1 -1
- package/lib/mjs/components/_classes/component/Component.d.ts +4 -3
- package/lib/mjs/components/_classes/component/Component.js +17 -5
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.js +8 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.d.ts +84 -0
- package/lib/mjs/components/_classes/component/fixtures/comp7.js +84 -0
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/_classes/input/Input.js +22 -1
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +9 -2
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +53 -26
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +2 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.js +5 -1
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +3 -0
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.js +57 -29
- package/lib/mjs/components/address/Address.d.ts +6 -0
- package/lib/mjs/components/address/Address.js +14 -1
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +1 -1
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.js +1 -1
- package/lib/mjs/components/checkbox/fixtures/comp6.d.ts +32 -0
- package/lib/mjs/components/checkbox/fixtures/comp6.js +28 -0
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/checkbox/fixtures/index.js +2 -1
- package/lib/mjs/components/currency/Currency.d.ts +2 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +11 -1
- package/lib/mjs/components/datagrid/DataGrid.js +58 -35
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.d.ts +100 -0
- package/lib/mjs/components/datagrid/fixtures/comp-with-reorder.js +137 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.d.ts +81 -0
- package/lib/mjs/components/datagrid/fixtures/comp10.js +85 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.d.ts +50 -0
- package/lib/mjs/components/datagrid/fixtures/comp11.js +53 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.d.ts +41 -0
- package/lib/mjs/components/datagrid/fixtures/comp9.js +42 -0
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +5 -1
- package/lib/mjs/components/datagrid/fixtures/index.js +5 -1
- package/lib/mjs/components/datamap/DataMap.js +2 -2
- package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
- package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/mjs/components/datetime/fixtures/index.js +2 -1
- package/lib/mjs/components/day/Day.d.ts +3 -4
- package/lib/mjs/components/day/Day.js +30 -10
- package/lib/mjs/components/day/fixtures/comp8.d.ts +41 -0
- package/lib/mjs/components/day/fixtures/comp8.js +38 -0
- package/lib/mjs/components/day/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/day/fixtures/index.js +2 -1
- package/lib/mjs/components/editgrid/EditGrid.js +16 -8
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp-test-events.js +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.d.ts +52 -0
- package/lib/mjs/components/editgrid/fixtures/comp16.js +69 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.d.ts +80 -0
- package/lib/mjs/components/editgrid/fixtures/comp17.js +97 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +10 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +4 -1
- package/lib/mjs/components/file/File.d.ts +2 -2
- package/lib/mjs/components/file/File.js +13 -2
- package/lib/mjs/components/file/editForm/File.edit.display.js +1 -1
- package/lib/mjs/components/form/Form.d.ts +1 -1
- package/lib/mjs/components/form/Form.js +1 -1
- package/lib/mjs/components/form/editForm/Form.edit.form.js +1 -1
- package/lib/mjs/components/form/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/form/fixtures/index.js +2 -1
- package/lib/mjs/components/form/fixtures/nestedWizardForm.d.ts +771 -0
- package/lib/mjs/components/form/fixtures/nestedWizardForm.js +763 -0
- package/lib/mjs/components/html/HTML.js +1 -1
- package/lib/mjs/components/number/Number.d.ts +17 -2
- package/lib/mjs/components/number/Number.js +26 -6
- package/lib/mjs/components/number/fixtures/comp10.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp10.js +19 -0
- package/lib/mjs/components/number/fixtures/comp8.d.ts +32 -0
- package/lib/mjs/components/number/fixtures/comp8.js +26 -0
- package/lib/mjs/components/number/fixtures/comp9.d.ts +18 -0
- package/lib/mjs/components/number/fixtures/comp9.js +19 -0
- package/lib/mjs/components/number/fixtures/index.d.ts +4 -1
- package/lib/mjs/components/number/fixtures/index.js +4 -1
- package/lib/mjs/components/panel/Panel.d.ts +1 -0
- package/lib/mjs/components/panel/Panel.js +1 -0
- package/lib/mjs/components/phonenumber/fixtures/comp2.d.ts +16 -0
- package/lib/mjs/components/phonenumber/fixtures/comp2.js +23 -0
- package/lib/mjs/components/phonenumber/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/phonenumber/fixtures/index.js +2 -1
- package/lib/mjs/components/radio/Radio.d.ts +2 -18
- package/lib/mjs/components/radio/Radio.js +32 -30
- package/lib/mjs/components/radio/fixtures/comp12.d.ts +29 -0
- package/lib/mjs/components/radio/fixtures/comp12.js +34 -0
- package/lib/mjs/components/radio/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/radio/fixtures/index.js +2 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +6 -0
- package/lib/mjs/components/recaptcha/ReCaptcha.js +9 -0
- package/lib/mjs/components/select/Select.d.ts +38 -0
- package/lib/mjs/components/select/Select.js +17 -6
- package/lib/mjs/components/select/fixtures/comp25.d.ts +59 -0
- package/lib/mjs/components/select/fixtures/comp25.js +64 -0
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/select/fixtures/index.js +3 -1
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -22
- package/lib/mjs/components/selectboxes/SelectBoxes.js +16 -9
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -6
- package/lib/mjs/components/signature/editForm/Signature.edit.display.js +0 -1
- package/lib/mjs/components/tags/Tags.js +3 -3
- package/lib/mjs/components/time/Time.d.ts +2 -2
- package/lib/mjs/components/time/Time.form.js +2 -2
- package/lib/mjs/components/time/Time.js +3 -13
- package/lib/mjs/components/time/fixtures/comp4.d.ts +166 -0
- package/lib/mjs/components/time/fixtures/comp4.js +169 -0
- package/lib/mjs/components/time/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/time/fixtures/index.js +2 -1
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +5 -0
- package/lib/mjs/providers/address/GoogleAddressProvider.js +22 -1
- package/lib/mjs/templates/Templates.js +1 -1
- package/lib/mjs/translations/en.d.ts +4 -0
- package/lib/mjs/translations/en.js +5 -1
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.js +2 -2
- package/lib/mjs/utils/utils.d.ts +2 -11
- package/lib/mjs/utils/utils.js +59 -13
- package/lib/mjs/widgets/CalendarWidget.js +24 -10
- package/package.json +5 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* dist/inputmask
|
|
3
3
|
* https://github.com/RobinHerbots/Inputmask
|
|
4
|
-
* Copyright (c) 2010 -
|
|
4
|
+
* Copyright (c) 2010 - 2024 Robin Herbots
|
|
5
5
|
* Licensed under the MIT license
|
|
6
|
-
* Version: 5.0.
|
|
6
|
+
* Version: 5.0.9
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/*!
|
|
@@ -18,10 +18,12 @@
|
|
|
18
18
|
* MIT licensed
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
/*! @license DOMPurify 3.1.
|
|
21
|
+
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
|
|
22
22
|
|
|
23
23
|
/*! formiojs v5.0.0-rc.59 | https://unpkg.com/formiojs@5.0.0-rc.59/LICENSE.txt */
|
|
24
24
|
|
|
25
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
26
|
+
|
|
25
27
|
/**
|
|
26
28
|
* @license
|
|
27
29
|
* Lodash <https://lodash.com/>
|
package/lib/cjs/CDN.d.ts
CHANGED
package/lib/cjs/CDN.js
CHANGED
|
@@ -17,6 +17,7 @@ class CDN {
|
|
|
17
17
|
'bootswatch': '5.3.3',
|
|
18
18
|
'bootstrap-icons': '1.11.1',
|
|
19
19
|
'ckeditor': '19.0.0',
|
|
20
|
+
'dragula': '3.7.3',
|
|
20
21
|
'flatpickr': '4.6.8',
|
|
21
22
|
'flatpickr-formio': '4.6.13-formio.3',
|
|
22
23
|
'font-awesome': '4.7.0',
|
|
@@ -63,8 +64,7 @@ class CDN {
|
|
|
63
64
|
url += `/${lib}`;
|
|
64
65
|
}
|
|
65
66
|
// Only attach the version if this is the hosted cdn.
|
|
66
|
-
if (cdnUrl.
|
|
67
|
-
version && version !== 'latest') {
|
|
67
|
+
if (cdnUrl.match(/cdn\.(test-)?form.io/) && version && version !== 'latest') {
|
|
68
68
|
url += `/${version}`;
|
|
69
69
|
}
|
|
70
70
|
return url;
|
package/lib/cjs/Form.d.ts
CHANGED
|
@@ -398,10 +398,10 @@ export default class Form extends Element {
|
|
|
398
398
|
getFormInitOptions(url: string, form: import('@formio/core').Form): object;
|
|
399
399
|
/**
|
|
400
400
|
* Sets the form to the JSON schema of a form.
|
|
401
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
401
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
402
402
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
403
403
|
*/
|
|
404
|
-
setForm(formParam: import('@formio/core').Form): Promise<Webform | Wizard | PDF>;
|
|
404
|
+
setForm(formParam: import('@formio/core').Form | string): Promise<Webform | Wizard | PDF>;
|
|
405
405
|
_form: any;
|
|
406
406
|
getSubmission(formio: any, opts: any): any;
|
|
407
407
|
/**
|
package/lib/cjs/Form.js
CHANGED
|
@@ -65,13 +65,13 @@ class Form extends Element_1.default {
|
|
|
65
65
|
else {
|
|
66
66
|
this.element = null;
|
|
67
67
|
}
|
|
68
|
+
this.options = formOptions;
|
|
69
|
+
this.options.events = this.events;
|
|
68
70
|
if (form) {
|
|
69
71
|
this.setForm(form)
|
|
70
72
|
.then(() => this.readyResolve(this.instance))
|
|
71
73
|
.catch(this.readyReject);
|
|
72
74
|
}
|
|
73
|
-
this.options = formOptions;
|
|
74
|
-
this.options.events = this.events;
|
|
75
75
|
this.display = '';
|
|
76
76
|
}
|
|
77
77
|
createElement(tag, attrs, children) {
|
|
@@ -195,7 +195,7 @@ class Form extends Element_1.default {
|
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
197
|
* Sets the form to the JSON schema of a form.
|
|
198
|
-
* @param {import('@formio/core').Form} formParam - The form JSON to set this form to.
|
|
198
|
+
* @param {import('@formio/core').Form | string} formParam - The form JSON to set this form to.
|
|
199
199
|
* @returns {Promise<Webform|Wizard|PDF>} - The webform instance that was created.
|
|
200
200
|
*/
|
|
201
201
|
setForm(formParam) {
|
|
@@ -222,8 +222,14 @@ class Form extends Element_1.default {
|
|
|
222
222
|
}
|
|
223
223
|
this.loading = false;
|
|
224
224
|
this.instance = this.instance || this.create(form.display);
|
|
225
|
-
|
|
226
|
-
this.instance.setUrl
|
|
225
|
+
// If we're in builder mode, instance.setUrl is not a function, so just manually set the URL.
|
|
226
|
+
if (this.instance.setUrl) {
|
|
227
|
+
const options = this.getFormInitOptions(formParam, form);
|
|
228
|
+
this.instance.setUrl(formParam, options);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
this.instance.url = formParam;
|
|
232
|
+
}
|
|
227
233
|
this.instance.nosubmit = false;
|
|
228
234
|
this._form = this.instance.form = form;
|
|
229
235
|
if (submission) {
|
package/lib/cjs/Formio.js
CHANGED
package/lib/cjs/PDF.js
CHANGED
|
@@ -70,7 +70,7 @@ class PDF extends Webform_1.default {
|
|
|
70
70
|
super.destroy(all);
|
|
71
71
|
}
|
|
72
72
|
rebuild() {
|
|
73
|
-
if (this.
|
|
73
|
+
if (this.builderMode && this.component.components) {
|
|
74
74
|
this.destroyComponents();
|
|
75
75
|
this.addComponents();
|
|
76
76
|
return Promise.resolve();
|
package/lib/cjs/PDFBuilder.js
CHANGED
|
@@ -403,6 +403,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
403
403
|
return false;
|
|
404
404
|
}
|
|
405
405
|
onDragEnd(e) {
|
|
406
|
+
var _a;
|
|
406
407
|
// IMPORTANT - must retrieve offsets BEFORE disabling the dropzone - offsets will
|
|
407
408
|
// reflect absolute positioning if accessed after the target element is hidden
|
|
408
409
|
const iframeRect = this.webform.refs.iframeContainer.getBoundingClientRect();
|
|
@@ -435,7 +436,7 @@ class PDFBuilder extends WebformBuilder_1.default {
|
|
|
435
436
|
lodash_1.default.merge(schema, info);
|
|
436
437
|
}
|
|
437
438
|
// Set a unique key for this component.
|
|
438
|
-
builder_1.default.uniquify(
|
|
439
|
+
builder_1.default.uniquify(((_a = this.webform._form) === null || _a === void 0 ? void 0 : _a.components) || [], schema);
|
|
439
440
|
this.webform._form.components.push(schema);
|
|
440
441
|
schema.overlay = {
|
|
441
442
|
top: layerY ? (layerY - this.itemOffsetY + HEIGHT) : (e.clientY - iframeRect.top - (this.itemOffsetY - HEIGHT) * 2),
|
package/lib/cjs/Webform.d.ts
CHANGED
|
@@ -334,7 +334,7 @@ declare class Webform extends NestedDataComponent {
|
|
|
334
334
|
* Sets the submission value
|
|
335
335
|
* @param {object|null|undefined} submission - The submission to set.
|
|
336
336
|
* @param {object|null|undefined} flags - Any flags to apply when setting the submission.
|
|
337
|
-
* @
|
|
337
|
+
* @returns {void}
|
|
338
338
|
*/
|
|
339
339
|
onSetSubmission(submission: object | null | undefined, flags?: object | null | undefined): void;
|
|
340
340
|
/**
|
package/lib/cjs/Webform.js
CHANGED
|
@@ -13,6 +13,10 @@ const Components_1 = __importDefault(require("./components/Components"));
|
|
|
13
13
|
const NestedDataComponent_1 = __importDefault(require("./components/_classes/nesteddata/NestedDataComponent"));
|
|
14
14
|
const utils_1 = require("./utils/utils");
|
|
15
15
|
const formUtils_1 = require("./utils/formUtils");
|
|
16
|
+
// We need this here because dragula pulls in CustomEvent class that requires global to exist.
|
|
17
|
+
if (typeof window !== 'undefined' && typeof window.global === 'undefined') {
|
|
18
|
+
window.global = window;
|
|
19
|
+
}
|
|
16
20
|
// Initialize the available forms.
|
|
17
21
|
Formio_1.Formio.forms = {};
|
|
18
22
|
// Allow people to register components.
|
|
@@ -702,7 +706,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
702
706
|
* Sets the submission value
|
|
703
707
|
* @param {object|null|undefined} submission - The submission to set.
|
|
704
708
|
* @param {object|null|undefined} flags - Any flags to apply when setting the submission.
|
|
705
|
-
* @
|
|
709
|
+
* @returns {void}
|
|
706
710
|
*/
|
|
707
711
|
onSetSubmission(submission, flags = {}) {
|
|
708
712
|
this.submissionSet = true;
|
|
@@ -822,7 +826,6 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
822
826
|
if (!submission || !submission.data) {
|
|
823
827
|
submission = {
|
|
824
828
|
data: {},
|
|
825
|
-
metadata: submission.metadata,
|
|
826
829
|
};
|
|
827
830
|
}
|
|
828
831
|
// Metadata needs to be available before setValue
|
|
@@ -882,7 +885,9 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
882
885
|
this.addComponents();
|
|
883
886
|
this.on("submitButton", (options) => {
|
|
884
887
|
this.submit(false, options).catch((e) => {
|
|
885
|
-
options.instance
|
|
888
|
+
if (options === null || options === void 0 ? void 0 : options.instance) {
|
|
889
|
+
options.instance.loading = false;
|
|
890
|
+
}
|
|
886
891
|
return e !== false && e !== undefined && console.log(e);
|
|
887
892
|
});
|
|
888
893
|
}, true);
|
|
@@ -1124,7 +1129,7 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
1124
1129
|
});
|
|
1125
1130
|
const displayedErrors = [];
|
|
1126
1131
|
if (errors.length) {
|
|
1127
|
-
errors = lodash_1.default.uniqBy(errors, (error) => error.message);
|
|
1132
|
+
errors = lodash_1.default.uniqBy(errors, (error) => { var _a, _b; return [error.message, (_a = error.component) === null || _a === void 0 ? void 0 : _a.id, (_b = error.context) === null || _b === void 0 ? void 0 : _b.path].join(); });
|
|
1128
1133
|
const createListItem = (message, index) => {
|
|
1129
1134
|
var _a, _b, _c;
|
|
1130
1135
|
const err = errors[index];
|
|
@@ -1240,10 +1245,10 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
1240
1245
|
}
|
|
1241
1246
|
this.checkData(value.data, flags);
|
|
1242
1247
|
const shouldValidate = !flags.noValidate ||
|
|
1243
|
-
flags.
|
|
1248
|
+
flags.fromIframe ||
|
|
1244
1249
|
(flags.fromSubmission && this.rootPristine && this.pristine && flags.changed);
|
|
1245
1250
|
const errors = shouldValidate
|
|
1246
|
-
? this.validate(value.data, Object.assign(Object.assign({}, flags), { process:
|
|
1251
|
+
? this.validate(value.data, Object.assign(Object.assign({}, flags), { noValidate: false, process: 'change' }))
|
|
1247
1252
|
: [];
|
|
1248
1253
|
value.isValid = errors.length === 0;
|
|
1249
1254
|
this.loading = false;
|
|
@@ -208,7 +208,8 @@ class WebformBuilder extends Component_1.default {
|
|
|
208
208
|
params: {
|
|
209
209
|
type: 'resource',
|
|
210
210
|
limit: 1000000,
|
|
211
|
-
select: '_id,title,name,components'
|
|
211
|
+
select: '_id,title,name,components',
|
|
212
|
+
'tags__ne': 'noBuilderResource'
|
|
212
213
|
}
|
|
213
214
|
};
|
|
214
215
|
if (this.options && this.options.resourceTag) {
|
|
@@ -908,7 +909,11 @@ class WebformBuilder extends Component_1.default {
|
|
|
908
909
|
if (form && form.properties) {
|
|
909
910
|
this.options.properties = form.properties;
|
|
910
911
|
}
|
|
911
|
-
|
|
912
|
+
let keyboardActionsEnabled = lodash_1.default.get(this.options, 'keyboardBuilder', false) || ((_a = this.options.properties) === null || _a === void 0 ? void 0 : _a.keyboardBuilder);
|
|
913
|
+
if (typeof keyboardActionsEnabled === 'string') {
|
|
914
|
+
keyboardActionsEnabled = keyboardActionsEnabled === 'true';
|
|
915
|
+
}
|
|
916
|
+
this.keyboardActionsEnabled = keyboardActionsEnabled;
|
|
912
917
|
const isShowSubmitButton = !this.options.noDefaultSubmitButton
|
|
913
918
|
&& (!form.components.length || !form.components.find(comp => comp.key === 'submit'));
|
|
914
919
|
// Ensure there is at least a submit button.
|
|
@@ -1060,7 +1065,10 @@ class WebformBuilder extends Component_1.default {
|
|
|
1060
1065
|
'calculateValue',
|
|
1061
1066
|
'conditional',
|
|
1062
1067
|
'customConditional',
|
|
1063
|
-
'id'
|
|
1068
|
+
'id',
|
|
1069
|
+
'fields.day.required',
|
|
1070
|
+
'fields.month.required',
|
|
1071
|
+
'fields.year.required',
|
|
1064
1072
|
]));
|
|
1065
1073
|
const parentComponent = defaultValueComponent.parent;
|
|
1066
1074
|
let tabIndex = -1;
|
|
@@ -1236,6 +1244,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1236
1244
|
const previewButtons = this.componentEdit.querySelectorAll(`[${this._referenceAttributeName}="previewButton"]`);
|
|
1237
1245
|
previewButtons.forEach((previewButton) => {
|
|
1238
1246
|
this.editForm.addEventListener(previewButton, 'click', (event) => {
|
|
1247
|
+
var _a;
|
|
1239
1248
|
event.preventDefault();
|
|
1240
1249
|
this.showPreview = !this.showPreview;
|
|
1241
1250
|
this.editForm.detach();
|
|
@@ -1247,6 +1256,7 @@ class WebformBuilder extends Component_1.default {
|
|
|
1247
1256
|
helplinks: this.helplinks,
|
|
1248
1257
|
}));
|
|
1249
1258
|
this.editForm.attach(this.componentEdit.querySelector(`[${this._referenceAttributeName}="editForm"]`));
|
|
1259
|
+
this.updateComponent((_a = this.editForm.submission.data) !== null && _a !== void 0 ? _a : component);
|
|
1250
1260
|
this.attachEditComponentControls(component, parent, isNew, original, ComponentClass);
|
|
1251
1261
|
});
|
|
1252
1262
|
});
|
package/lib/cjs/Wizard.js
CHANGED
|
@@ -18,7 +18,7 @@ class Wizard extends Webform_1.default {
|
|
|
18
18
|
*/
|
|
19
19
|
constructor(elementOrOptions = undefined, _options = undefined) {
|
|
20
20
|
let element, options;
|
|
21
|
-
if (elementOrOptions instanceof HTMLElement ||
|
|
21
|
+
if (elementOrOptions instanceof HTMLElement || _options) {
|
|
22
22
|
element = elementOrOptions;
|
|
23
23
|
options = _options || {};
|
|
24
24
|
}
|
|
@@ -346,7 +346,7 @@ declare class Component extends Element {
|
|
|
346
346
|
/**
|
|
347
347
|
* Renders a modal preview template and returns the markup as a string
|
|
348
348
|
* @param {object|null|undefined} ctx - The rendering context
|
|
349
|
-
* @
|
|
349
|
+
* @returns {string} - The modal preview markup
|
|
350
350
|
*/
|
|
351
351
|
renderModalPreview(ctx: object | null | undefined): string;
|
|
352
352
|
/**
|
|
@@ -372,7 +372,7 @@ declare class Component extends Element {
|
|
|
372
372
|
* Creates the tooltip instance using tippy.js and returns it
|
|
373
373
|
* @param {HTMLElement} tooltipEl - HTML element to attach the tooltip
|
|
374
374
|
* @param {object|null|undefined} settings - tippy.js options
|
|
375
|
-
* @
|
|
375
|
+
* @returns {import('tippy.js').Tippy} - tippy.js instance
|
|
376
376
|
*/
|
|
377
377
|
createTooltip(tooltipEl: HTMLElement, settings?: object | null | undefined): import('tippy.js').Tippy;
|
|
378
378
|
/**
|
|
@@ -830,6 +830,7 @@ declare class Component extends Element {
|
|
|
830
830
|
quill: any;
|
|
831
831
|
get shouldSanitizeValue(): boolean;
|
|
832
832
|
addAce(element: any, settings: any, onChange: any): any;
|
|
833
|
+
getDragula(): Promise<any>;
|
|
833
834
|
get tree(): any;
|
|
834
835
|
/**
|
|
835
836
|
* The empty value for this component.
|
|
@@ -1075,7 +1076,7 @@ declare class Component extends Element {
|
|
|
1075
1076
|
elementInfo(): any;
|
|
1076
1077
|
autofocus(): void;
|
|
1077
1078
|
scrollIntoView(element?: any): void;
|
|
1078
|
-
focus(index
|
|
1079
|
+
focus(index: any): void;
|
|
1079
1080
|
/**
|
|
1080
1081
|
* Get `Formio` instance for working with files
|
|
1081
1082
|
* @returns {import('@formio/core').Formio} - The Formio instance file service.
|
|
@@ -22,6 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
25
34
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
36
|
};
|
|
@@ -1049,7 +1058,7 @@ class Component extends Element_1.default {
|
|
|
1049
1058
|
/**
|
|
1050
1059
|
* Renders a modal preview template and returns the markup as a string
|
|
1051
1060
|
* @param {object|null|undefined} ctx - The rendering context
|
|
1052
|
-
* @
|
|
1061
|
+
* @returns {string} - The modal preview markup
|
|
1053
1062
|
*/
|
|
1054
1063
|
renderModalPreview(ctx) {
|
|
1055
1064
|
return this.renderTemplate('modalPreview', ctx || {});
|
|
@@ -1118,7 +1127,7 @@ class Component extends Element_1.default {
|
|
|
1118
1127
|
* Creates the tooltip instance using tippy.js and returns it
|
|
1119
1128
|
* @param {HTMLElement} tooltipEl - HTML element to attach the tooltip
|
|
1120
1129
|
* @param {object|null|undefined} settings - tippy.js options
|
|
1121
|
-
* @
|
|
1130
|
+
* @returns {import('tippy.js').Tippy} - tippy.js instance
|
|
1122
1131
|
*/
|
|
1123
1132
|
createTooltip(tooltipEl, settings = {}) {
|
|
1124
1133
|
const tooltipAttribute = tooltipEl.getAttribute('data-tooltip');
|
|
@@ -2374,6 +2383,15 @@ class Component extends Element_1.default {
|
|
|
2374
2383
|
return editor;
|
|
2375
2384
|
});
|
|
2376
2385
|
}
|
|
2386
|
+
getDragula() {
|
|
2387
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2388
|
+
return new Promise((resolve) => {
|
|
2389
|
+
return Formio_1.Formio.requireLibrary('dragula', 'dragula', `${Formio_1.Formio.cdn.dragula}/dragula.js`, true, (ready) => {
|
|
2390
|
+
return ready.then(resolve);
|
|
2391
|
+
});
|
|
2392
|
+
});
|
|
2393
|
+
});
|
|
2394
|
+
}
|
|
2377
2395
|
get tree() {
|
|
2378
2396
|
return this.component.tree || false;
|
|
2379
2397
|
}
|
|
@@ -3006,7 +3024,7 @@ class Component extends Element_1.default {
|
|
|
3006
3024
|
this.parent.childErrors.push(...errors);
|
|
3007
3025
|
}
|
|
3008
3026
|
else {
|
|
3009
|
-
lodash_1.default.remove(this.parent.childErrors, (err) => err.component.key === this.component.key);
|
|
3027
|
+
lodash_1.default.remove(this.parent.childErrors, (err) => { var _a, _b; return (((_a = err === null || err === void 0 ? void 0 : err.component) === null || _a === void 0 ? void 0 : _a.key) || ((_b = err === null || err === void 0 ? void 0 : err.context) === null || _b === void 0 ? void 0 : _b.key)) === this.component.key; });
|
|
3010
3028
|
}
|
|
3011
3029
|
}
|
|
3012
3030
|
this.showValidationErrors(errors, data, row, flags);
|
|
@@ -3022,7 +3040,7 @@ class Component extends Element_1.default {
|
|
|
3022
3040
|
this.parent.childErrors.push(...errors);
|
|
3023
3041
|
}
|
|
3024
3042
|
else {
|
|
3025
|
-
lodash_1.default.remove(this.parent.childErrors, (err) => err.component.key === this.component.key);
|
|
3043
|
+
lodash_1.default.remove(this.parent.childErrors, (err) => { var _a, _b; return (((_a = err === null || err === void 0 ? void 0 : err.component) === null || _a === void 0 ? void 0 : _a.key) || ((_b = err === null || err === void 0 ? void 0 : err.context) === null || _b === void 0 ? void 0 : _b.key)) === this.component.key; });
|
|
3026
3044
|
}
|
|
3027
3045
|
}
|
|
3028
3046
|
return errors.length === 0;
|
|
@@ -3388,6 +3406,10 @@ class Component extends Element_1.default {
|
|
|
3388
3406
|
const disabled = this.shouldDisabled;
|
|
3389
3407
|
// Change states which won't be recalculated during redrawing
|
|
3390
3408
|
if (this.visible !== visible) {
|
|
3409
|
+
// If the logic is triggered by an event and the action sets the hidden state then the original
|
|
3410
|
+
// component definition must be changed so that the components hidden state does not get flipped back by
|
|
3411
|
+
// the fieldLogic function
|
|
3412
|
+
this.originalComponent.hidden = !visible;
|
|
3391
3413
|
this.visible = visible;
|
|
3392
3414
|
}
|
|
3393
3415
|
if (this.disabled !== disabled) {
|
|
@@ -3441,14 +3463,15 @@ class Component extends Element_1.default {
|
|
|
3441
3463
|
const { left, top } = element.getBoundingClientRect();
|
|
3442
3464
|
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
|
3443
3465
|
}
|
|
3444
|
-
focus(index
|
|
3445
|
-
var _a, _b;
|
|
3466
|
+
focus(index) {
|
|
3467
|
+
var _a, _b, _c;
|
|
3446
3468
|
if ('beforeFocus' in this.parent) {
|
|
3447
3469
|
this.parent.beforeFocus(this);
|
|
3448
3470
|
}
|
|
3449
|
-
|
|
3471
|
+
index = index || ((_a = this.refs.input) === null || _a === void 0 ? void 0 : _a.length) - 1;
|
|
3472
|
+
if ((_b = this.refs.input) === null || _b === void 0 ? void 0 : _b.length) {
|
|
3450
3473
|
const focusingInput = this.refs.input[index];
|
|
3451
|
-
if (((
|
|
3474
|
+
if (((_c = this.component.widget) === null || _c === void 0 ? void 0 : _c.type) === 'calendar') {
|
|
3452
3475
|
const sibling = focusingInput.nextSibling;
|
|
3453
3476
|
if (sibling) {
|
|
3454
3477
|
sibling.focus();
|
|
@@ -190,5 +190,13 @@ exports.default = [
|
|
|
190
190
|
key: 'tableView',
|
|
191
191
|
input: true
|
|
192
192
|
},
|
|
193
|
+
{
|
|
194
|
+
weight: 1600,
|
|
195
|
+
type: 'checkbox',
|
|
196
|
+
label: 'Modal Edit',
|
|
197
|
+
tooltip: 'Opens up a modal to edit the value of this component.',
|
|
198
|
+
key: 'modalEdit',
|
|
199
|
+
input: true
|
|
200
|
+
}
|
|
193
201
|
];
|
|
194
202
|
/* eslint-enable max-len */
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: ({
|
|
3
|
+
label: string;
|
|
4
|
+
action: string;
|
|
5
|
+
showValidations: boolean;
|
|
6
|
+
tableView: boolean;
|
|
7
|
+
key: string;
|
|
8
|
+
type: string;
|
|
9
|
+
event: string;
|
|
10
|
+
input: boolean;
|
|
11
|
+
theme?: undefined;
|
|
12
|
+
collapsible?: undefined;
|
|
13
|
+
hidden?: undefined;
|
|
14
|
+
logic?: undefined;
|
|
15
|
+
collapsed?: undefined;
|
|
16
|
+
components?: undefined;
|
|
17
|
+
applyMaskOn?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
label: string;
|
|
20
|
+
action: string;
|
|
21
|
+
showValidations: boolean;
|
|
22
|
+
theme: string;
|
|
23
|
+
tableView: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
event: string;
|
|
27
|
+
input: boolean;
|
|
28
|
+
collapsible?: undefined;
|
|
29
|
+
hidden?: undefined;
|
|
30
|
+
logic?: undefined;
|
|
31
|
+
collapsed?: undefined;
|
|
32
|
+
components?: undefined;
|
|
33
|
+
applyMaskOn?: undefined;
|
|
34
|
+
} | {
|
|
35
|
+
collapsible: boolean;
|
|
36
|
+
hidden: boolean;
|
|
37
|
+
key: string;
|
|
38
|
+
logic: {
|
|
39
|
+
name: string;
|
|
40
|
+
trigger: {
|
|
41
|
+
type: string;
|
|
42
|
+
event: string;
|
|
43
|
+
};
|
|
44
|
+
actions: {
|
|
45
|
+
name: string;
|
|
46
|
+
type: string;
|
|
47
|
+
property: {
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
state: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
}[];
|
|
55
|
+
type: string;
|
|
56
|
+
label: string;
|
|
57
|
+
collapsed: boolean;
|
|
58
|
+
input: boolean;
|
|
59
|
+
tableView: boolean;
|
|
60
|
+
components: never[];
|
|
61
|
+
action?: undefined;
|
|
62
|
+
showValidations?: undefined;
|
|
63
|
+
event?: undefined;
|
|
64
|
+
theme?: undefined;
|
|
65
|
+
applyMaskOn?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
label: string;
|
|
68
|
+
applyMaskOn: string;
|
|
69
|
+
tableView: boolean;
|
|
70
|
+
key: string;
|
|
71
|
+
type: string;
|
|
72
|
+
input: boolean;
|
|
73
|
+
action?: undefined;
|
|
74
|
+
showValidations?: undefined;
|
|
75
|
+
event?: undefined;
|
|
76
|
+
theme?: undefined;
|
|
77
|
+
collapsible?: undefined;
|
|
78
|
+
hidden?: undefined;
|
|
79
|
+
logic?: undefined;
|
|
80
|
+
collapsed?: undefined;
|
|
81
|
+
components?: undefined;
|
|
82
|
+
})[];
|
|
83
|
+
}
|
|
84
|
+
export default _default;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Show",
|
|
7
|
+
"action": "event",
|
|
8
|
+
"showValidations": false,
|
|
9
|
+
"tableView": false,
|
|
10
|
+
"key": "show",
|
|
11
|
+
"type": "button",
|
|
12
|
+
"event": "show",
|
|
13
|
+
"input": true
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"label": "Hide",
|
|
17
|
+
"action": "event",
|
|
18
|
+
"showValidations": false,
|
|
19
|
+
"theme": "danger",
|
|
20
|
+
"tableView": false,
|
|
21
|
+
"key": "hide",
|
|
22
|
+
"type": "button",
|
|
23
|
+
"event": "hide",
|
|
24
|
+
"input": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"collapsible": true,
|
|
28
|
+
"hidden": true,
|
|
29
|
+
"key": "panel",
|
|
30
|
+
"logic": [
|
|
31
|
+
{
|
|
32
|
+
"name": "ShowPanel",
|
|
33
|
+
"trigger": {
|
|
34
|
+
"type": "event",
|
|
35
|
+
"event": "show"
|
|
36
|
+
},
|
|
37
|
+
"actions": [
|
|
38
|
+
{
|
|
39
|
+
"name": "Show",
|
|
40
|
+
"type": "property",
|
|
41
|
+
"property": {
|
|
42
|
+
"label": "Hidden",
|
|
43
|
+
"value": "hidden",
|
|
44
|
+
"type": "boolean"
|
|
45
|
+
},
|
|
46
|
+
"state": false
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "HidePanel",
|
|
52
|
+
"trigger": {
|
|
53
|
+
"type": "event",
|
|
54
|
+
"event": "hide"
|
|
55
|
+
},
|
|
56
|
+
"actions": [
|
|
57
|
+
{
|
|
58
|
+
"name": "Hide",
|
|
59
|
+
"type": "property",
|
|
60
|
+
"property": {
|
|
61
|
+
"label": "Hidden",
|
|
62
|
+
"value": "hidden",
|
|
63
|
+
"type": "boolean"
|
|
64
|
+
},
|
|
65
|
+
"state": true
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"type": "panel",
|
|
71
|
+
"label": "Panel",
|
|
72
|
+
"collapsed": false,
|
|
73
|
+
"input": false,
|
|
74
|
+
"tableView": false,
|
|
75
|
+
"components": []
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"label": "Text Field",
|
|
79
|
+
"applyMaskOn": "change",
|
|
80
|
+
"tableView": true,
|
|
81
|
+
"key": "textField1",
|
|
82
|
+
"type": "textfield",
|
|
83
|
+
"input": true
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
};
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
6
|
+
exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp3 = exports.comp2 = exports.comp1 = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
@@ -16,3 +16,5 @@ const comp5_1 = __importDefault(require("./comp5"));
|
|
|
16
16
|
exports.comp5 = comp5_1.default;
|
|
17
17
|
const comp6_1 = __importDefault(require("./comp6"));
|
|
18
18
|
exports.comp6 = comp6_1.default;
|
|
19
|
+
const comp7_1 = __importDefault(require("./comp7"));
|
|
20
|
+
exports.comp7 = comp7_1.default;
|
|
@@ -234,11 +234,33 @@ class Input extends Multivalue_1.default {
|
|
|
234
234
|
this.addFocusBlurEvents(element);
|
|
235
235
|
if (this.options.submitOnEnter) {
|
|
236
236
|
this.addEventListener(element, 'keypress', (event) => {
|
|
237
|
+
var _a;
|
|
237
238
|
const key = event.keyCode || event.which;
|
|
238
239
|
if (key === 13) {
|
|
239
240
|
event.preventDefault();
|
|
240
241
|
event.stopPropagation();
|
|
241
|
-
|
|
242
|
+
let submitButton = null;
|
|
243
|
+
if ((_a = this.root) === null || _a === void 0 ? void 0 : _a.everyComponent) {
|
|
244
|
+
this.root.everyComponent((component) => {
|
|
245
|
+
if ((component === null || component === void 0 ? void 0 : component.component.type) === 'button' &&
|
|
246
|
+
(component === null || component === void 0 ? void 0 : component.component.action) === 'submit') {
|
|
247
|
+
submitButton = component;
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
const options = {};
|
|
253
|
+
if (submitButton) {
|
|
254
|
+
options.instance = submitButton;
|
|
255
|
+
options.component = submitButton.component;
|
|
256
|
+
options.noValidate = this.component.state === 'draft';
|
|
257
|
+
options.state = this.component.state || 'submitted';
|
|
258
|
+
submitButton.loading = true;
|
|
259
|
+
this.emit('submitButton', options);
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
this.emit('submitButton', options);
|
|
263
|
+
}
|
|
242
264
|
}
|
|
243
265
|
});
|
|
244
266
|
}
|