@formio/js 5.0.0-rc.30 → 5.0.0-rc.32
Sign up to get free protection for your applications and to get access to all the features.
- 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.js +64 -108
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +1 -1
- package/dist/formio.full.js +66 -110
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +1 -1
- package/dist/formio.js +40 -84
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +18 -84
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +1 -1
- package/lib/cjs/CDN.js +6 -2
- package/lib/cjs/Embed.js +98 -61
- package/lib/cjs/Formio.js +10 -0
- package/lib/cjs/Wizard.js +9 -10
- package/lib/cjs/components/_classes/component/Component.js +1 -3
- package/lib/cjs/components/_classes/component/fixtures/comp5.js +26 -0
- package/lib/cjs/components/_classes/component/fixtures/index.js +3 -1
- package/lib/cjs/components/columns/editForm/Columns.edit.display.js +0 -18
- package/lib/cjs/components/file/File.js +13 -1
- package/lib/cjs/components/file/editForm/File.edit.file.js +40 -0
- package/lib/cjs/components/select/Select.js +7 -3
- package/lib/cjs/formio.form.js +3 -1
- package/lib/cjs/providers/storage/azure.js +24 -22
- package/lib/cjs/providers/storage/base64.js +29 -27
- package/lib/cjs/providers/storage/dropbox.js +51 -49
- package/lib/cjs/providers/storage/googleDrive.js +50 -48
- package/lib/cjs/providers/storage/indexeddb.js +106 -104
- package/lib/cjs/providers/storage/s3.js +137 -37
- package/lib/cjs/providers/storage/url.js +2 -2
- package/lib/cjs/providers/storage/util.js +21 -0
- package/lib/cjs/providers/storage/xhr.js +81 -64
- package/lib/cjs/utils/formUtils.js +1 -1
- package/lib/cjs/utils/utils.js +6 -0
- package/lib/mjs/CDN.js +6 -2
- package/lib/mjs/Embed.js +94 -62
- package/lib/mjs/Formio.js +35 -25
- package/lib/mjs/Wizard.js +9 -10
- package/lib/mjs/components/_classes/component/Component.js +1 -3
- package/lib/mjs/components/_classes/component/fixtures/comp5.js +24 -0
- package/lib/mjs/components/_classes/component/fixtures/index.js +2 -1
- package/lib/mjs/components/columns/editForm/Columns.edit.display.js +0 -18
- package/lib/mjs/components/file/File.js +17 -1
- package/lib/mjs/components/file/editForm/File.edit.file.js +40 -0
- package/lib/mjs/components/select/Select.js +7 -3
- package/lib/mjs/formio.form.js +3 -1
- package/lib/mjs/providers/storage/azure.js +24 -22
- package/lib/mjs/providers/storage/base64.js +29 -27
- package/lib/mjs/providers/storage/dropbox.js +51 -49
- package/lib/mjs/providers/storage/googleDrive.js +50 -48
- package/lib/mjs/providers/storage/indexeddb.js +106 -104
- package/lib/mjs/providers/storage/s3.js +122 -29
- package/lib/mjs/providers/storage/url.js +2 -2
- package/lib/mjs/providers/storage/util.js +6 -0
- package/lib/mjs/providers/storage/xhr.js +75 -65
- package/lib/mjs/utils/formUtils.js +1 -1
- package/lib/mjs/utils/utils.js +6 -0
- package/package.json +7 -4
- package/types/Embed.d.ts +13 -0
- package/types/Plugins.d.ts +95 -0
- package/types/components/_classes/component/component.d.ts +2 -1
- package/types/components/schema.d.ts +2 -68
- package/types/formio.d.ts +1230 -118
- package/types/index.d.ts +1 -1
- package/types/utils.d.ts +1 -1
- package/lib/cjs/CDN.d.ts +0 -29
- package/lib/cjs/Element.d.ts +0 -255
- package/lib/cjs/Embed.d.ts +0 -52
- package/lib/cjs/EventEmitter.d.ts +0 -7
- package/lib/cjs/Form.d.ts +0 -93
- package/lib/cjs/FormBuilder.d.ts +0 -6
- package/lib/cjs/Formio.d.ts +0 -1
- package/lib/cjs/PDF.d.ts +0 -40
- package/lib/cjs/PDFBuilder.d.ts +0 -55
- package/lib/cjs/Webform.d.ts +0 -402
- package/lib/cjs/WebformBuilder.d.ts +0 -126
- package/lib/cjs/Wizard.d.ts +0 -97
- package/lib/cjs/WizardBuilder.d.ts +0 -49
- package/lib/cjs/addons/FormioAddon.d.ts +0 -19
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +0 -716
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.form.d.ts +0 -590
- package/lib/cjs/addons/index.d.ts +0 -626
- package/lib/cjs/builders/Builders.d.ts +0 -18
- package/lib/cjs/builders/index.d.ts +0 -2
- package/lib/cjs/components/Components.d.ts +0 -265
- package/lib/cjs/components/_classes/component/Component.d.ts +0 -828
- package/lib/cjs/components/_classes/component/Component.form.d.ts +0 -3
- package/lib/cjs/components/_classes/component/editForm/Component.edit.addons.d.ts +0 -653
- package/lib/cjs/components/_classes/component/editForm/Component.edit.api.d.ts +0 -42
- package/lib/cjs/components/_classes/component/editForm/Component.edit.conditional.d.ts +0 -113
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.d.ts +0 -219
- package/lib/cjs/components/_classes/component/editForm/Component.edit.display.d.ts +0 -160
- package/lib/cjs/components/_classes/component/editForm/Component.edit.layout.d.ts +0 -44
- package/lib/cjs/components/_classes/component/editForm/Component.edit.logic.d.ts +0 -368
- package/lib/cjs/components/_classes/component/editForm/Component.edit.validation.d.ts +0 -140
- package/lib/cjs/components/_classes/component/editForm/utils.d.ts +0 -83
- package/lib/cjs/components/_classes/component/fixtures/comp1.d.ts +0 -33
- package/lib/cjs/components/_classes/component/fixtures/comp2.d.ts +0 -33
- package/lib/cjs/components/_classes/component/fixtures/comp3.d.ts +0 -14
- package/lib/cjs/components/_classes/component/fixtures/comp4.d.ts +0 -17
- package/lib/cjs/components/_classes/component/fixtures/index.d.ts +0 -5
- package/lib/cjs/components/_classes/componentModal/ComponentModal.d.ts +0 -46
- package/lib/cjs/components/_classes/field/Field.d.ts +0 -5
- package/lib/cjs/components/_classes/input/Input.d.ts +0 -42
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +0 -18
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +0 -3
- package/lib/cjs/components/_classes/list/editForm/ListComponent.edit.data.d.ts +0 -183
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +0 -29
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +0 -150
- package/lib/cjs/components/_classes/nested/NestedComponent.form.d.ts +0 -3
- package/lib/cjs/components/_classes/nested/fixtures/comp1.d.ts +0 -8
- package/lib/cjs/components/_classes/nested/fixtures/comp2.d.ts +0 -236
- package/lib/cjs/components/_classes/nested/fixtures/comp3.d.ts +0 -26
- package/lib/cjs/components/_classes/nested/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +0 -16
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -12
- package/lib/cjs/components/address/Address.d.ts +0 -66
- package/lib/cjs/components/address/Address.form.d.ts +0 -3
- package/lib/cjs/components/address/editForm/Address.edit.data.d.ts +0 -31
- package/lib/cjs/components/address/editForm/Address.edit.display.d.ts +0 -49
- package/lib/cjs/components/address/editForm/Address.edit.provider.d.ts +0 -164
- package/lib/cjs/components/address/fixtures/comp1.d.ts +0 -34
- package/lib/cjs/components/address/fixtures/comp2.d.ts +0 -62
- package/lib/cjs/components/address/fixtures/comp3.d.ts +0 -44
- package/lib/cjs/components/address/fixtures/comp4.d.ts +0 -56
- package/lib/cjs/components/address/fixtures/index.d.ts +0 -5
- package/lib/cjs/components/address/fixtures/values.d.ts +0 -22
- package/lib/cjs/components/alert/Alert.d.ts +0 -30
- package/lib/cjs/components/builder.d.ts +0 -2
- package/lib/cjs/components/button/Button.d.ts +0 -45
- package/lib/cjs/components/button/Button.form.d.ts +0 -3
- package/lib/cjs/components/button/editForm/Button.edit.display.d.ts +0 -360
- package/lib/cjs/components/button/fixtures/comp1.d.ts +0 -15
- package/lib/cjs/components/button/fixtures/comp2.d.ts +0 -25
- package/lib/cjs/components/button/fixtures/comp3.d.ts +0 -113
- package/lib/cjs/components/button/fixtures/index.d.ts +0 -4
- package/lib/cjs/components/button/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/checkbox/Checkbox.d.ts +0 -77
- package/lib/cjs/components/checkbox/Checkbox.form.d.ts +0 -3
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.data.d.ts +0 -5
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.display.d.ts +0 -75
- package/lib/cjs/components/checkbox/editForm/Checkbox.edit.validation.d.ts +0 -5
- package/lib/cjs/components/checkbox/fixtures/comp1.d.ts +0 -24
- package/lib/cjs/components/checkbox/fixtures/comp2.d.ts +0 -12
- package/lib/cjs/components/checkbox/fixtures/comp3.d.ts +0 -15
- package/lib/cjs/components/checkbox/fixtures/comp4.d.ts +0 -46
- package/lib/cjs/components/checkbox/fixtures/customDefaultComponent.d.ts +0 -25
- package/lib/cjs/components/checkbox/fixtures/index.d.ts +0 -6
- package/lib/cjs/components/checkbox/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/columns/Columns.d.ts +0 -28
- package/lib/cjs/components/columns/Columns.form.d.ts +0 -3
- package/lib/cjs/components/columns/editForm/Columns.edit.display.d.ts +0 -87
- package/lib/cjs/components/columns/fixtures/comp1.d.ts +0 -45
- package/lib/cjs/components/columns/fixtures/comp2.d.ts +0 -24
- package/lib/cjs/components/columns/fixtures/comp3.d.ts +0 -45
- package/lib/cjs/components/columns/fixtures/index.d.ts +0 -4
- package/lib/cjs/components/container/Container.d.ts +0 -16
- package/lib/cjs/components/container/Container.form.d.ts +0 -3
- package/lib/cjs/components/container/editForm/Container.edit.data.d.ts +0 -5
- package/lib/cjs/components/container/editForm/Container.edit.display.d.ts +0 -5
- package/lib/cjs/components/container/fixtures/comp1.d.ts +0 -49
- package/lib/cjs/components/container/fixtures/comp2.d.ts +0 -30
- package/lib/cjs/components/container/fixtures/comp3.d.ts +0 -77
- package/lib/cjs/components/container/fixtures/index.d.ts +0 -4
- package/lib/cjs/components/content/Content.d.ts +0 -18
- package/lib/cjs/components/content/Content.form.d.ts +0 -3
- package/lib/cjs/components/content/editForm/Content.edit.display.d.ts +0 -18
- package/lib/cjs/components/content/editForm/Content.edit.logic.d.ts +0 -48
- package/lib/cjs/components/content/fixtures/comp1.d.ts +0 -13
- package/lib/cjs/components/content/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/currency/Currency.d.ts +0 -8
- package/lib/cjs/components/currency/Currency.form.d.ts +0 -3
- package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +0 -29
- package/lib/cjs/components/currency/editForm/Currency.edit.display.d.ts +0 -18
- package/lib/cjs/components/currency/fixtures/comp1.d.ts +0 -31
- package/lib/cjs/components/currency/fixtures/comp2.d.ts +0 -20
- package/lib/cjs/components/currency/fixtures/comp3.d.ts +0 -13
- package/lib/cjs/components/currency/fixtures/comp4.d.ts +0 -17
- package/lib/cjs/components/currency/fixtures/index.d.ts +0 -5
- package/lib/cjs/components/currency/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/datagrid/DataGrid.d.ts +0 -80
- package/lib/cjs/components/datagrid/DataGrid.form.d.ts +0 -3
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.data.d.ts +0 -5
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.display.d.ts +0 -283
- package/lib/cjs/components/datagrid/editForm/DataGrid.edit.validation.d.ts +0 -20
- package/lib/cjs/components/datagrid/fixtures/comp-modal-with-required-fields.d.ts +0 -37
- package/lib/cjs/components/datagrid/fixtures/comp-on-blur-validation.d.ts +0 -0
- package/lib/cjs/components/datagrid/fixtures/comp-row-groups-with-def-value.d.ts +0 -63
- package/lib/cjs/components/datagrid/fixtures/comp-with-collapsible-groups.d.ts +0 -76
- package/lib/cjs/components/datagrid/fixtures/comp-with-conditional-components-and-validations.d.ts +0 -197
- package/lib/cjs/components/datagrid/fixtures/comp-with-def-value.d.ts +0 -61
- package/lib/cjs/components/datagrid/fixtures/comp-with-logic.d.ts +0 -165
- package/lib/cjs/components/datagrid/fixtures/comp1.d.ts +0 -93
- package/lib/cjs/components/datagrid/fixtures/comp2.d.ts +0 -18
- package/lib/cjs/components/datagrid/fixtures/comp3.d.ts +0 -14
- package/lib/cjs/components/datagrid/fixtures/comp4.d.ts +0 -27
- package/lib/cjs/components/datagrid/fixtures/comp5.d.ts +0 -67
- package/lib/cjs/components/datagrid/fixtures/comp6.d.ts +0 -567
- package/lib/cjs/components/datagrid/fixtures/comp7.d.ts +0 -28
- package/lib/cjs/components/datagrid/fixtures/comp8.d.ts +0 -35
- package/lib/cjs/components/datagrid/fixtures/index.d.ts +0 -15
- package/lib/cjs/components/datamap/DataMap.d.ts +0 -36
- package/lib/cjs/components/datamap/DataMap.form.d.ts +0 -3
- package/lib/cjs/components/datamap/editForm/DataMap.edit.data.d.ts +0 -5
- package/lib/cjs/components/datamap/editForm/DataMap.edit.display.d.ts +0 -30
- package/lib/cjs/components/datamap/fixtures/comp1.d.ts +0 -18
- package/lib/cjs/components/datamap/fixtures/formWithConditionalPanel.d.ts +0 -87
- package/lib/cjs/components/datamap/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/datetime/DateTime.d.ts +0 -39
- package/lib/cjs/components/datetime/DateTime.form.d.ts +0 -3
- package/lib/cjs/components/datetime/editForm/DateTime.edit.data.d.ts +0 -24
- package/lib/cjs/components/datetime/editForm/DateTime.edit.date.d.ts +0 -61
- package/lib/cjs/components/datetime/editForm/DateTime.edit.display.d.ts +0 -128
- package/lib/cjs/components/datetime/editForm/DateTime.edit.time.d.ts +0 -9
- package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.d.ts +0 -40
- package/lib/cjs/components/datetime/fixtures/comp1.d.ts +0 -45
- package/lib/cjs/components/datetime/fixtures/comp10.d.ts +0 -102
- package/lib/cjs/components/datetime/fixtures/comp11.d.ts +0 -58
- package/lib/cjs/components/datetime/fixtures/comp12.d.ts +0 -57
- package/lib/cjs/components/datetime/fixtures/comp2.d.ts +0 -42
- package/lib/cjs/components/datetime/fixtures/comp3.d.ts +0 -51
- package/lib/cjs/components/datetime/fixtures/comp5.d.ts +0 -57
- package/lib/cjs/components/datetime/fixtures/comp6.d.ts +0 -55
- package/lib/cjs/components/datetime/fixtures/comp7.d.ts +0 -59
- package/lib/cjs/components/datetime/fixtures/comp8.d.ts +0 -59
- package/lib/cjs/components/datetime/fixtures/comp9.d.ts +0 -64
- package/lib/cjs/components/datetime/fixtures/index.d.ts +0 -12
- package/lib/cjs/components/datetime/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/day/Day.d.ts +0 -163
- package/lib/cjs/components/day/Day.form.d.ts +0 -3
- package/lib/cjs/components/day/editForm/Day.edit.data.d.ts +0 -5
- package/lib/cjs/components/day/editForm/Day.edit.day.d.ts +0 -40
- package/lib/cjs/components/day/editForm/Day.edit.display.d.ts +0 -40
- package/lib/cjs/components/day/editForm/Day.edit.month.d.ts +0 -40
- package/lib/cjs/components/day/editForm/Day.edit.validation.d.ts +0 -29
- package/lib/cjs/components/day/editForm/Day.edit.year.d.ts +0 -40
- package/lib/cjs/components/day/fixtures/comp1.d.ts +0 -46
- package/lib/cjs/components/day/fixtures/comp2.d.ts +0 -46
- package/lib/cjs/components/day/fixtures/comp3.d.ts +0 -48
- package/lib/cjs/components/day/fixtures/comp4.d.ts +0 -53
- package/lib/cjs/components/day/fixtures/comp5.d.ts +0 -29
- package/lib/cjs/components/day/fixtures/comp6.d.ts +0 -81
- package/lib/cjs/components/day/fixtures/index.d.ts +0 -7
- package/lib/cjs/components/day/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/editgrid/EditGrid.d.ts +0 -103
- package/lib/cjs/components/editgrid/EditGrid.form.d.ts +0 -3
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.data.d.ts +0 -18
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.display.d.ts +0 -82
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.templates.d.ts +0 -58
- package/lib/cjs/components/editgrid/editForm/EditGrid.edit.validation.d.ts +0 -29
- package/lib/cjs/components/editgrid/fixtures/comp-openWhenEmpty.d.ts +0 -34
- package/lib/cjs/components/editgrid/fixtures/comp-with-basic-components.d.ts +0 -327
- package/lib/cjs/components/editgrid/fixtures/comp-with-conditions-and-openWhenEmpty.d.ts +0 -77
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +0 -190
- package/lib/cjs/components/editgrid/fixtures/comp1.d.ts +0 -89
- package/lib/cjs/components/editgrid/fixtures/comp10.d.ts +0 -49
- package/lib/cjs/components/editgrid/fixtures/comp11.d.ts +0 -53
- package/lib/cjs/components/editgrid/fixtures/comp12.d.ts +0 -57
- package/lib/cjs/components/editgrid/fixtures/comp13.d.ts +0 -64
- package/lib/cjs/components/editgrid/fixtures/comp14.d.ts +0 -88
- package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +0 -54
- package/lib/cjs/components/editgrid/fixtures/comp2.d.ts +0 -112
- package/lib/cjs/components/editgrid/fixtures/comp3.d.ts +0 -27
- package/lib/cjs/components/editgrid/fixtures/comp4.d.ts +0 -23
- package/lib/cjs/components/editgrid/fixtures/comp5.d.ts +0 -19
- package/lib/cjs/components/editgrid/fixtures/comp6.d.ts +0 -50
- package/lib/cjs/components/editgrid/fixtures/comp7.d.ts +0 -129
- package/lib/cjs/components/editgrid/fixtures/comp8.d.ts +0 -148
- package/lib/cjs/components/editgrid/fixtures/comp9.d.ts +0 -86
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +0 -19
- package/lib/cjs/components/email/Email.d.ts +0 -4
- package/lib/cjs/components/email/Email.form.d.ts +0 -3
- package/lib/cjs/components/email/editForm/Email.edit.display.d.ts +0 -5
- package/lib/cjs/components/email/editForm/Email.edit.validation.d.ts +0 -24
- package/lib/cjs/components/email/fixtures/comp1.d.ts +0 -26
- package/lib/cjs/components/email/fixtures/comp2.d.ts +0 -23
- package/lib/cjs/components/email/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/email/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/fieldset/Fieldset.d.ts +0 -15
- package/lib/cjs/components/fieldset/Fieldset.form.d.ts +0 -3
- package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.d.ts +0 -33
- package/lib/cjs/components/fieldset/fixtures/comp1.d.ts +0 -46
- package/lib/cjs/components/fieldset/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/file/File.d.ts +0 -81
- package/lib/cjs/components/file/File.form.d.ts +0 -3
- package/lib/cjs/components/file/editForm/File.edit.data.d.ts +0 -5
- package/lib/cjs/components/file/editForm/File.edit.display.d.ts +0 -5
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +0 -275
- package/lib/cjs/components/file/editForm/File.edit.validation.d.ts +0 -5
- package/lib/cjs/components/file/fixtures/comp1.d.ts +0 -15
- package/lib/cjs/components/file/fixtures/comp2.d.ts +0 -35
- package/lib/cjs/components/file/fixtures/comp3.d.ts +0 -29
- package/lib/cjs/components/file/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/file/fixtures/values.d.ts +0 -10
- package/lib/cjs/components/form/Form.d.ts +0 -94
- package/lib/cjs/components/form/Form.form.d.ts +0 -3
- package/lib/cjs/components/form/editForm/Form.edit.data.d.ts +0 -82
- package/lib/cjs/components/form/editForm/Form.edit.display.d.ts +0 -5
- package/lib/cjs/components/form/editForm/Form.edit.form.d.ts +0 -89
- package/lib/cjs/components/form/fixtures/comp1.d.ts +0 -45
- package/lib/cjs/components/form/fixtures/comp2.d.ts +0 -14
- package/lib/cjs/components/form/fixtures/comp3.d.ts +0 -187
- package/lib/cjs/components/form/fixtures/comp4.d.ts +0 -107
- package/lib/cjs/components/form/fixtures/comp5.d.ts +0 -42
- package/lib/cjs/components/form/fixtures/comp6.d.ts +0 -74
- package/lib/cjs/components/form/fixtures/formModalEdit.d.ts +0 -42
- package/lib/cjs/components/form/fixtures/index.d.ts +0 -8
- package/lib/cjs/components/form/fixtures/values.d.ts +0 -6
- package/lib/cjs/components/hidden/Hidden.d.ts +0 -26
- package/lib/cjs/components/hidden/Hidden.form.d.ts +0 -3
- package/lib/cjs/components/hidden/editForm/Hidden.edit.data.d.ts +0 -5
- package/lib/cjs/components/hidden/editForm/Hidden.edit.display.d.ts +0 -5
- package/lib/cjs/components/hidden/fixtures/comp1.d.ts +0 -18
- package/lib/cjs/components/hidden/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/hidden/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/html/HTML.d.ts +0 -18
- package/lib/cjs/components/html/HTML.form.d.ts +0 -3
- package/lib/cjs/components/html/editForm/HTML.edit.display.d.ts +0 -77
- package/lib/cjs/components/html/editForm/HTML.edit.logic.d.ts +0 -48
- package/lib/cjs/components/html/fixtures/comp1.d.ts +0 -19
- package/lib/cjs/components/html/fixtures/comp2.d.ts +0 -21
- package/lib/cjs/components/html/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/index.d.ts +0 -98
- package/lib/cjs/components/number/Number.d.ts +0 -53
- package/lib/cjs/components/number/Number.form.d.ts +0 -3
- package/lib/cjs/components/number/editForm/Number.edit.data.d.ts +0 -18
- package/lib/cjs/components/number/editForm/Number.edit.display.d.ts +0 -5
- package/lib/cjs/components/number/editForm/Number.edit.validation.d.ts +0 -20
- package/lib/cjs/components/number/fixtures/comp1.d.ts +0 -33
- package/lib/cjs/components/number/fixtures/comp2.d.ts +0 -32
- package/lib/cjs/components/number/fixtures/comp3.d.ts +0 -14
- package/lib/cjs/components/number/fixtures/comp4.d.ts +0 -14
- package/lib/cjs/components/number/fixtures/comp5.d.ts +0 -20
- package/lib/cjs/components/number/fixtures/comp6.d.ts +0 -40
- package/lib/cjs/components/number/fixtures/comp7.d.ts +0 -15
- package/lib/cjs/components/number/fixtures/index.d.ts +0 -8
- package/lib/cjs/components/number/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/panel/Panel.d.ts +0 -14
- package/lib/cjs/components/panel/Panel.form.d.ts +0 -3
- package/lib/cjs/components/panel/editForm/Panel.edit.conditional.d.ts +0 -75
- package/lib/cjs/components/panel/editForm/Panel.edit.display.d.ts +0 -196
- package/lib/cjs/components/panel/fixtures/comp1.d.ts +0 -46
- package/lib/cjs/components/panel/fixtures/comp2.d.ts +0 -80
- package/lib/cjs/components/panel/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/password/Password.d.ts +0 -3
- package/lib/cjs/components/password/Password.form.d.ts +0 -3
- package/lib/cjs/components/password/editForm/Password.edit.data.d.ts +0 -18
- package/lib/cjs/components/password/editForm/Password.edit.display.d.ts +0 -5
- package/lib/cjs/components/password/editForm/Password.edit.validation.d.ts +0 -5
- package/lib/cjs/components/password/fixtures/comp1.d.ts +0 -22
- package/lib/cjs/components/password/fixtures/comp2.d.ts +0 -27
- package/lib/cjs/components/password/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/password/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/phonenumber/PhoneNumber.d.ts +0 -3
- package/lib/cjs/components/phonenumber/PhoneNumber.form.d.ts +0 -3
- package/lib/cjs/components/phonenumber/editForm/PhoneNumber.edit.validation.d.ts +0 -5
- package/lib/cjs/components/phonenumber/fixtures/comp1.d.ts +0 -27
- package/lib/cjs/components/phonenumber/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/phonenumber/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/radio/Radio.d.ts +0 -65
- package/lib/cjs/components/radio/Radio.form.d.ts +0 -3
- package/lib/cjs/components/radio/editForm/Radio.edit.data.d.ts +0 -134
- package/lib/cjs/components/radio/editForm/Radio.edit.display.d.ts +0 -40
- package/lib/cjs/components/radio/editForm/Radio.edit.validation.d.ts +0 -18
- package/lib/cjs/components/radio/fixtures/comp1.d.ts +0 -28
- package/lib/cjs/components/radio/fixtures/comp2.d.ts +0 -85
- package/lib/cjs/components/radio/fixtures/comp3.d.ts +0 -85
- package/lib/cjs/components/radio/fixtures/comp4.d.ts +0 -19
- package/lib/cjs/components/radio/fixtures/comp5.d.ts +0 -39
- package/lib/cjs/components/radio/fixtures/comp6.d.ts +0 -38
- package/lib/cjs/components/radio/fixtures/comp7.d.ts +0 -23
- package/lib/cjs/components/radio/fixtures/comp8.d.ts +0 -118
- package/lib/cjs/components/radio/fixtures/comp9.d.ts +0 -35
- package/lib/cjs/components/radio/fixtures/index.d.ts +0 -10
- package/lib/cjs/components/radio/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +0 -23
- package/lib/cjs/components/recaptcha/ReCaptcha.form.d.ts +0 -3
- package/lib/cjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +0 -44
- package/lib/cjs/components/recaptcha/fixtures/comp1.d.ts +0 -8
- package/lib/cjs/components/recaptcha/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/resource/Resource.d.ts +0 -10
- package/lib/cjs/components/resource/Resource.form.d.ts +0 -3
- package/lib/cjs/components/resource/editForm/Resource.edit.display.d.ts +0 -173
- package/lib/cjs/components/resource/fixtures/comp1.d.ts +0 -30
- package/lib/cjs/components/resource/fixtures/comp2.d.ts +0 -35
- package/lib/cjs/components/resource/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/select/Select.d.ts +0 -145
- package/lib/cjs/components/select/Select.form.d.ts +0 -3
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +0 -1039
- package/lib/cjs/components/select/editForm/Select.edit.display.d.ts +0 -27
- package/lib/cjs/components/select/editForm/Select.edit.validation.d.ts +0 -30
- package/lib/cjs/components/select/fixtures/comp1.d.ts +0 -40
- package/lib/cjs/components/select/fixtures/comp10.d.ts +0 -41
- package/lib/cjs/components/select/fixtures/comp11.d.ts +0 -28
- package/lib/cjs/components/select/fixtures/comp12.d.ts +0 -53
- package/lib/cjs/components/select/fixtures/comp13.d.ts +0 -28
- package/lib/cjs/components/select/fixtures/comp14.d.ts +0 -40
- package/lib/cjs/components/select/fixtures/comp15.d.ts +0 -50
- package/lib/cjs/components/select/fixtures/comp16.d.ts +0 -34
- package/lib/cjs/components/select/fixtures/comp17.d.ts +0 -51
- package/lib/cjs/components/select/fixtures/comp18.d.ts +0 -49
- package/lib/cjs/components/select/fixtures/comp19.d.ts +0 -23
- package/lib/cjs/components/select/fixtures/comp2.d.ts +0 -41
- package/lib/cjs/components/select/fixtures/comp3.d.ts +0 -35
- package/lib/cjs/components/select/fixtures/comp4.d.ts +0 -103
- package/lib/cjs/components/select/fixtures/comp5.d.ts +0 -21
- package/lib/cjs/components/select/fixtures/comp6.d.ts +0 -20
- package/lib/cjs/components/select/fixtures/comp7.d.ts +0 -63
- package/lib/cjs/components/select/fixtures/comp8.d.ts +0 -72
- package/lib/cjs/components/select/fixtures/comp9.d.ts +0 -88
- package/lib/cjs/components/select/fixtures/index.d.ts +0 -20
- package/lib/cjs/components/select/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +0 -51
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +0 -3
- package/lib/cjs/components/selectboxes/editForm/SelectBoxes.edit.validation.d.ts +0 -9
- package/lib/cjs/components/selectboxes/fixtures/comp1.d.ts +0 -24
- package/lib/cjs/components/selectboxes/fixtures/comp2.d.ts +0 -24
- package/lib/cjs/components/selectboxes/fixtures/comp3.d.ts +0 -23
- package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +0 -66
- package/lib/cjs/components/selectboxes/fixtures/comp5.d.ts +0 -37
- package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +0 -14
- package/lib/cjs/components/selectboxes/fixtures/comp7.d.ts +0 -18
- package/lib/cjs/components/selectboxes/fixtures/index.d.ts +0 -8
- package/lib/cjs/components/selectboxes/fixtures/values.d.ts +0 -6
- package/lib/cjs/components/signature/Signature.d.ts +0 -46
- package/lib/cjs/components/signature/Signature.form.d.ts +0 -3
- package/lib/cjs/components/signature/editForm/Signature.edit.data.d.ts +0 -5
- package/lib/cjs/components/signature/editForm/Signature.edit.display.d.ts +0 -51
- package/lib/cjs/components/signature/editForm/Signature.edit.validation.d.ts +0 -5
- package/lib/cjs/components/signature/fixtures/comp1.d.ts +0 -30
- package/lib/cjs/components/signature/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/signature/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/survey/Survey.d.ts +0 -37
- package/lib/cjs/components/survey/Survey.form.d.ts +0 -3
- package/lib/cjs/components/survey/editForm/Survey.edit.data.d.ts +0 -44
- package/lib/cjs/components/survey/editForm/Survey.edit.display.d.ts +0 -5
- package/lib/cjs/components/survey/editForm/Survey.edit.validation.d.ts +0 -5
- package/lib/cjs/components/survey/fixtures/comp1.d.ts +0 -31
- package/lib/cjs/components/survey/fixtures/comp2.d.ts +0 -31
- package/lib/cjs/components/survey/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/survey/fixtures/values.d.ts +0 -5
- package/lib/cjs/components/table/Table.d.ts +0 -23
- package/lib/cjs/components/table/Table.form.d.ts +0 -3
- package/lib/cjs/components/table/editForm/Table.edit.display.d.ts +0 -84
- package/lib/cjs/components/table/fixtures/comp1.d.ts +0 -53
- package/lib/cjs/components/table/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/tabs/Tabs.d.ts +0 -30
- package/lib/cjs/components/tabs/Tabs.form.d.ts +0 -3
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.d.ts +0 -77
- package/lib/cjs/components/tabs/fixtures/comp1.d.ts +0 -23
- package/lib/cjs/components/tabs/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/tags/Tags.d.ts +0 -41
- package/lib/cjs/components/tags/Tags.form.d.ts +0 -3
- package/lib/cjs/components/tags/editForm/Tags.edit.data.d.ts +0 -51
- package/lib/cjs/components/tags/fixtures/comp1.d.ts +0 -20
- package/lib/cjs/components/tags/fixtures/comp2.d.ts +0 -10
- package/lib/cjs/components/tags/fixtures/comp3.d.ts +0 -23
- package/lib/cjs/components/tags/fixtures/comp4.d.ts +0 -9
- package/lib/cjs/components/tags/fixtures/comp5.d.ts +0 -24
- package/lib/cjs/components/tags/fixtures/comp6.d.ts +0 -17
- package/lib/cjs/components/tags/fixtures/index.d.ts +0 -7
- package/lib/cjs/components/tags/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/textarea/TextArea.d.ts +0 -37
- package/lib/cjs/components/textarea/TextArea.form.d.ts +0 -3
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.d.ts +0 -355
- package/lib/cjs/components/textarea/editForm/TextArea.edit.validation.d.ts +0 -10
- package/lib/cjs/components/textarea/fixtures/comp1.d.ts +0 -31
- package/lib/cjs/components/textarea/fixtures/comp2.d.ts +0 -29
- package/lib/cjs/components/textarea/fixtures/comp3.d.ts +0 -27
- package/lib/cjs/components/textarea/fixtures/comp4.d.ts +0 -30
- package/lib/cjs/components/textarea/fixtures/index.d.ts +0 -5
- package/lib/cjs/components/textarea/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/textfield/TextField.d.ts +0 -60
- package/lib/cjs/components/textfield/TextField.form.d.ts +0 -3
- package/lib/cjs/components/textfield/editForm/TextField.edit.data.d.ts +0 -46
- package/lib/cjs/components/textfield/editForm/TextField.edit.display.d.ts +0 -248
- package/lib/cjs/components/textfield/editForm/TextField.edit.validation.d.ts +0 -10
- package/lib/cjs/components/textfield/fixtures/comp-with-display-and-value-masks.d.ts +0 -47
- package/lib/cjs/components/textfield/fixtures/comp1.d.ts +0 -33
- package/lib/cjs/components/textfield/fixtures/comp2.d.ts +0 -33
- package/lib/cjs/components/textfield/fixtures/comp3.d.ts +0 -33
- package/lib/cjs/components/textfield/fixtures/comp4.d.ts +0 -23
- package/lib/cjs/components/textfield/fixtures/comp5.d.ts +0 -12
- package/lib/cjs/components/textfield/fixtures/comp6.d.ts +0 -25
- package/lib/cjs/components/textfield/fixtures/comp7.d.ts +0 -37
- package/lib/cjs/components/textfield/fixtures/index.d.ts +0 -9
- package/lib/cjs/components/textfield/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/time/Time.d.ts +0 -27
- package/lib/cjs/components/time/Time.form.d.ts +0 -3
- package/lib/cjs/components/time/editForm/Time.edit.data.d.ts +0 -10
- package/lib/cjs/components/time/editForm/Time.edit.display.d.ts +0 -52
- package/lib/cjs/components/time/fixtures/comp1.d.ts +0 -24
- package/lib/cjs/components/time/fixtures/comp2.d.ts +0 -10
- package/lib/cjs/components/time/fixtures/comp3.d.ts +0 -15
- package/lib/cjs/components/time/fixtures/index.d.ts +0 -6
- package/lib/cjs/components/time/fixtures/timeForm.d.ts +0 -47
- package/lib/cjs/components/time/fixtures/timeForm2.d.ts +0 -38
- package/lib/cjs/components/time/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/unknown/Unknown.d.ts +0 -28
- package/lib/cjs/components/unknown/Unknown.form.d.ts +0 -34
- package/lib/cjs/components/unknown/editForm/Unknown.edit.display.d.ts +0 -24
- package/lib/cjs/components/unknown/fixtures/comp1.d.ts +0 -7
- package/lib/cjs/components/unknown/fixtures/index.d.ts +0 -2
- package/lib/cjs/components/url/Url.d.ts +0 -3
- package/lib/cjs/components/url/Url.form.d.ts +0 -3
- package/lib/cjs/components/url/editForm/Url.edit.data.d.ts +0 -5
- package/lib/cjs/components/url/editForm/Url.edit.display.d.ts +0 -5
- package/lib/cjs/components/url/editForm/Url.edit.validation.d.ts +0 -5
- package/lib/cjs/components/url/fixtures/comp1.d.ts +0 -26
- package/lib/cjs/components/url/fixtures/comp2.d.ts +0 -26
- package/lib/cjs/components/url/fixtures/index.d.ts +0 -3
- package/lib/cjs/components/url/fixtures/values.d.ts +0 -2
- package/lib/cjs/components/well/Well.d.ts +0 -15
- package/lib/cjs/components/well/Well.form.d.ts +0 -3
- package/lib/cjs/components/well/editForm/Well.edit.display.d.ts +0 -28
- package/lib/cjs/components/well/fixtures/comp1.d.ts +0 -43
- package/lib/cjs/components/well/fixtures/index.d.ts +0 -2
- package/lib/cjs/displays/Displays.d.ts +0 -18
- package/lib/cjs/displays/index.d.ts +0 -2
- package/lib/cjs/formio.embed.d.ts +0 -2
- package/lib/cjs/formio.form.d.ts +0 -17
- package/lib/cjs/i18n.d.ts +0 -13
- package/lib/cjs/index.d.ts +0 -5
- package/lib/cjs/licenses/Licenses.d.ts +0 -7
- package/lib/cjs/licenses/index.d.ts +0 -2
- package/lib/cjs/pdf.image.d.ts +0 -2
- package/lib/cjs/providers/Providers.d.ts +0 -80
- package/lib/cjs/providers/address/AddressProvider.d.ts +0 -17
- package/lib/cjs/providers/address/AzureAddressProvider.d.ts +0 -12
- package/lib/cjs/providers/address/CustomAddressProvider.d.ts +0 -7
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +0 -18
- package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +0 -11
- package/lib/cjs/providers/address/index.d.ts +0 -6
- package/lib/cjs/providers/auth/index.d.ts +0 -2
- package/lib/cjs/providers/index.d.ts +0 -2
- package/lib/cjs/providers/processor/fileProcessor.d.ts +0 -2
- package/lib/cjs/providers/storage/azure.d.ts +0 -15
- package/lib/cjs/providers/storage/base64.d.ts +0 -10
- package/lib/cjs/providers/storage/dropbox.d.ts +0 -8
- package/lib/cjs/providers/storage/googleDrive.d.ts +0 -8
- package/lib/cjs/providers/storage/index.d.ts +0 -15
- package/lib/cjs/providers/storage/indexeddb.d.ts +0 -11
- package/lib/cjs/providers/storage/s3.d.ts +0 -17
- package/lib/cjs/providers/storage/uploadAdapter.d.ts +0 -1
- package/lib/cjs/providers/storage/url.d.ts +0 -11
- package/lib/cjs/providers/storage/xhr.d.ts +0 -7
- package/lib/cjs/templates/Templates.d.ts +0 -1
- package/lib/cjs/templates/index.d.ts +0 -229
- package/lib/cjs/translations/en.d.ts +0 -71
- package/lib/cjs/utils/ChoicesWrapper.d.ts +0 -38
- package/lib/cjs/utils/Evaluator.d.ts +0 -4
- package/lib/cjs/utils/builder.d.ts +0 -22
- package/lib/cjs/utils/calendarUtils.d.ts +0 -41
- package/lib/cjs/utils/conditionOperators/ConditionOperator.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/DateGreaterThan.d.ts +0 -13
- package/lib/cjs/utils/conditionOperators/DateGreaterThanOrEqual.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/DateLessThan.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/DateLessThanOrEqual.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/EndsWith.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/GreaterThan.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/GreaterThanOrEqual.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/Includes.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/IsDateEqual.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/IsEmptyValue.d.ts +0 -9
- package/lib/cjs/utils/conditionOperators/IsEqualTo.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/IsNotDateEqual.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/IsNotEmptyValue.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/IsNotEqualTo.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/LessThan.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/LessThanOrEqual.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/NotIncludes.d.ts +0 -4
- package/lib/cjs/utils/conditionOperators/StartsWith.d.ts +0 -7
- package/lib/cjs/utils/conditionOperators/index.d.ts +0 -7
- package/lib/cjs/utils/formUtils.d.ts +0 -173
- package/lib/cjs/utils/i18n.d.ts +0 -16
- package/lib/cjs/utils/index.d.ts +0 -3
- package/lib/cjs/utils/jsonlogic/operators.d.ts +0 -1
- package/lib/cjs/utils/utils.d.ts +0 -375
- package/lib/cjs/widgets/CalendarWidget.d.ts +0 -97
- package/lib/cjs/widgets/InputWidget.d.ts +0 -24
- package/lib/cjs/widgets/index.d.ts +0 -7
- package/lib/mjs/CDN.d.ts +0 -29
- package/lib/mjs/Element.d.ts +0 -255
- package/lib/mjs/Embed.d.ts +0 -52
- package/lib/mjs/EventEmitter.d.ts +0 -7
- package/lib/mjs/Form.d.ts +0 -93
- package/lib/mjs/FormBuilder.d.ts +0 -6
- package/lib/mjs/Formio.d.ts +0 -1
- package/lib/mjs/PDF.d.ts +0 -40
- package/lib/mjs/PDFBuilder.d.ts +0 -55
- package/lib/mjs/Webform.d.ts +0 -402
- package/lib/mjs/WebformBuilder.d.ts +0 -126
- package/lib/mjs/Wizard.d.ts +0 -97
- package/lib/mjs/WizardBuilder.d.ts +0 -49
- package/lib/mjs/addons/FormioAddon.d.ts +0 -19
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +0 -716
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.form.d.ts +0 -590
- package/lib/mjs/addons/index.d.ts +0 -626
- package/lib/mjs/builders/Builders.d.ts +0 -18
- package/lib/mjs/builders/index.d.ts +0 -2
- package/lib/mjs/components/Components.d.ts +0 -265
- package/lib/mjs/components/_classes/component/Component.d.ts +0 -828
- package/lib/mjs/components/_classes/component/Component.form.d.ts +0 -3
- package/lib/mjs/components/_classes/component/editForm/Component.edit.addons.d.ts +0 -653
- package/lib/mjs/components/_classes/component/editForm/Component.edit.api.d.ts +0 -42
- package/lib/mjs/components/_classes/component/editForm/Component.edit.conditional.d.ts +0 -113
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.d.ts +0 -219
- package/lib/mjs/components/_classes/component/editForm/Component.edit.display.d.ts +0 -160
- package/lib/mjs/components/_classes/component/editForm/Component.edit.layout.d.ts +0 -44
- package/lib/mjs/components/_classes/component/editForm/Component.edit.logic.d.ts +0 -368
- package/lib/mjs/components/_classes/component/editForm/Component.edit.validation.d.ts +0 -140
- package/lib/mjs/components/_classes/component/editForm/utils.d.ts +0 -83
- package/lib/mjs/components/_classes/component/fixtures/comp1.d.ts +0 -33
- package/lib/mjs/components/_classes/component/fixtures/comp2.d.ts +0 -33
- package/lib/mjs/components/_classes/component/fixtures/comp3.d.ts +0 -14
- package/lib/mjs/components/_classes/component/fixtures/comp4.d.ts +0 -17
- package/lib/mjs/components/_classes/component/fixtures/index.d.ts +0 -5
- package/lib/mjs/components/_classes/componentModal/ComponentModal.d.ts +0 -46
- package/lib/mjs/components/_classes/field/Field.d.ts +0 -5
- package/lib/mjs/components/_classes/input/Input.d.ts +0 -42
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +0 -18
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +0 -3
- package/lib/mjs/components/_classes/list/editForm/ListComponent.edit.data.d.ts +0 -183
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +0 -29
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +0 -150
- package/lib/mjs/components/_classes/nested/NestedComponent.form.d.ts +0 -3
- package/lib/mjs/components/_classes/nested/fixtures/comp1.d.ts +0 -8
- package/lib/mjs/components/_classes/nested/fixtures/comp2.d.ts +0 -236
- package/lib/mjs/components/_classes/nested/fixtures/comp3.d.ts +0 -26
- package/lib/mjs/components/_classes/nested/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/_classes/nestedarray/NestedArrayComponent.d.ts +0 -16
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -12
- package/lib/mjs/components/address/Address.d.ts +0 -66
- package/lib/mjs/components/address/Address.form.d.ts +0 -3
- package/lib/mjs/components/address/editForm/Address.edit.data.d.ts +0 -31
- package/lib/mjs/components/address/editForm/Address.edit.display.d.ts +0 -49
- package/lib/mjs/components/address/editForm/Address.edit.provider.d.ts +0 -164
- package/lib/mjs/components/address/fixtures/comp1.d.ts +0 -34
- package/lib/mjs/components/address/fixtures/comp2.d.ts +0 -62
- package/lib/mjs/components/address/fixtures/comp3.d.ts +0 -44
- package/lib/mjs/components/address/fixtures/comp4.d.ts +0 -56
- package/lib/mjs/components/address/fixtures/index.d.ts +0 -5
- package/lib/mjs/components/address/fixtures/values.d.ts +0 -22
- package/lib/mjs/components/alert/Alert.d.ts +0 -30
- package/lib/mjs/components/builder.d.ts +0 -2
- package/lib/mjs/components/button/Button.d.ts +0 -45
- package/lib/mjs/components/button/Button.form.d.ts +0 -3
- package/lib/mjs/components/button/editForm/Button.edit.display.d.ts +0 -360
- package/lib/mjs/components/button/fixtures/comp1.d.ts +0 -15
- package/lib/mjs/components/button/fixtures/comp2.d.ts +0 -25
- package/lib/mjs/components/button/fixtures/comp3.d.ts +0 -113
- package/lib/mjs/components/button/fixtures/index.d.ts +0 -4
- package/lib/mjs/components/button/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/checkbox/Checkbox.d.ts +0 -77
- package/lib/mjs/components/checkbox/Checkbox.form.d.ts +0 -3
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.data.d.ts +0 -5
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.display.d.ts +0 -75
- package/lib/mjs/components/checkbox/editForm/Checkbox.edit.validation.d.ts +0 -5
- package/lib/mjs/components/checkbox/fixtures/comp1.d.ts +0 -24
- package/lib/mjs/components/checkbox/fixtures/comp2.d.ts +0 -12
- package/lib/mjs/components/checkbox/fixtures/comp3.d.ts +0 -15
- package/lib/mjs/components/checkbox/fixtures/comp4.d.ts +0 -46
- package/lib/mjs/components/checkbox/fixtures/customDefaultComponent.d.ts +0 -25
- package/lib/mjs/components/checkbox/fixtures/index.d.ts +0 -6
- package/lib/mjs/components/checkbox/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/columns/Columns.d.ts +0 -28
- package/lib/mjs/components/columns/Columns.form.d.ts +0 -3
- package/lib/mjs/components/columns/editForm/Columns.edit.display.d.ts +0 -87
- package/lib/mjs/components/columns/fixtures/comp1.d.ts +0 -45
- package/lib/mjs/components/columns/fixtures/comp2.d.ts +0 -24
- package/lib/mjs/components/columns/fixtures/comp3.d.ts +0 -45
- package/lib/mjs/components/columns/fixtures/index.d.ts +0 -4
- package/lib/mjs/components/container/Container.d.ts +0 -16
- package/lib/mjs/components/container/Container.form.d.ts +0 -3
- package/lib/mjs/components/container/editForm/Container.edit.data.d.ts +0 -5
- package/lib/mjs/components/container/editForm/Container.edit.display.d.ts +0 -5
- package/lib/mjs/components/container/fixtures/comp1.d.ts +0 -49
- package/lib/mjs/components/container/fixtures/comp2.d.ts +0 -30
- package/lib/mjs/components/container/fixtures/comp3.d.ts +0 -77
- package/lib/mjs/components/container/fixtures/index.d.ts +0 -4
- package/lib/mjs/components/content/Content.d.ts +0 -18
- package/lib/mjs/components/content/Content.form.d.ts +0 -3
- package/lib/mjs/components/content/editForm/Content.edit.display.d.ts +0 -18
- package/lib/mjs/components/content/editForm/Content.edit.logic.d.ts +0 -48
- package/lib/mjs/components/content/fixtures/comp1.d.ts +0 -13
- package/lib/mjs/components/content/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/currency/Currency.d.ts +0 -8
- package/lib/mjs/components/currency/Currency.form.d.ts +0 -3
- package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +0 -29
- package/lib/mjs/components/currency/editForm/Currency.edit.display.d.ts +0 -18
- package/lib/mjs/components/currency/fixtures/comp1.d.ts +0 -31
- package/lib/mjs/components/currency/fixtures/comp2.d.ts +0 -20
- package/lib/mjs/components/currency/fixtures/comp3.d.ts +0 -13
- package/lib/mjs/components/currency/fixtures/comp4.d.ts +0 -17
- package/lib/mjs/components/currency/fixtures/index.d.ts +0 -5
- package/lib/mjs/components/currency/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/datagrid/DataGrid.d.ts +0 -80
- package/lib/mjs/components/datagrid/DataGrid.form.d.ts +0 -3
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.data.d.ts +0 -5
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.display.d.ts +0 -283
- package/lib/mjs/components/datagrid/editForm/DataGrid.edit.validation.d.ts +0 -20
- package/lib/mjs/components/datagrid/fixtures/comp-modal-with-required-fields.d.ts +0 -37
- package/lib/mjs/components/datagrid/fixtures/comp-on-blur-validation.d.ts +0 -0
- package/lib/mjs/components/datagrid/fixtures/comp-row-groups-with-def-value.d.ts +0 -63
- package/lib/mjs/components/datagrid/fixtures/comp-with-collapsible-groups.d.ts +0 -76
- package/lib/mjs/components/datagrid/fixtures/comp-with-conditional-components-and-validations.d.ts +0 -197
- package/lib/mjs/components/datagrid/fixtures/comp-with-def-value.d.ts +0 -61
- package/lib/mjs/components/datagrid/fixtures/comp-with-logic.d.ts +0 -165
- package/lib/mjs/components/datagrid/fixtures/comp1.d.ts +0 -93
- package/lib/mjs/components/datagrid/fixtures/comp2.d.ts +0 -18
- package/lib/mjs/components/datagrid/fixtures/comp3.d.ts +0 -14
- package/lib/mjs/components/datagrid/fixtures/comp4.d.ts +0 -27
- package/lib/mjs/components/datagrid/fixtures/comp5.d.ts +0 -67
- package/lib/mjs/components/datagrid/fixtures/comp6.d.ts +0 -567
- package/lib/mjs/components/datagrid/fixtures/comp7.d.ts +0 -28
- package/lib/mjs/components/datagrid/fixtures/comp8.d.ts +0 -35
- package/lib/mjs/components/datagrid/fixtures/index.d.ts +0 -15
- package/lib/mjs/components/datamap/DataMap.d.ts +0 -36
- package/lib/mjs/components/datamap/DataMap.form.d.ts +0 -3
- package/lib/mjs/components/datamap/editForm/DataMap.edit.data.d.ts +0 -5
- package/lib/mjs/components/datamap/editForm/DataMap.edit.display.d.ts +0 -30
- package/lib/mjs/components/datamap/fixtures/comp1.d.ts +0 -18
- package/lib/mjs/components/datamap/fixtures/formWithConditionalPanel.d.ts +0 -87
- package/lib/mjs/components/datamap/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/datetime/DateTime.d.ts +0 -39
- package/lib/mjs/components/datetime/DateTime.form.d.ts +0 -3
- package/lib/mjs/components/datetime/editForm/DateTime.edit.data.d.ts +0 -24
- package/lib/mjs/components/datetime/editForm/DateTime.edit.date.d.ts +0 -61
- package/lib/mjs/components/datetime/editForm/DateTime.edit.display.d.ts +0 -128
- package/lib/mjs/components/datetime/editForm/DateTime.edit.time.d.ts +0 -9
- package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.d.ts +0 -40
- package/lib/mjs/components/datetime/fixtures/comp1.d.ts +0 -45
- package/lib/mjs/components/datetime/fixtures/comp10.d.ts +0 -102
- package/lib/mjs/components/datetime/fixtures/comp11.d.ts +0 -58
- package/lib/mjs/components/datetime/fixtures/comp12.d.ts +0 -57
- package/lib/mjs/components/datetime/fixtures/comp2.d.ts +0 -42
- package/lib/mjs/components/datetime/fixtures/comp3.d.ts +0 -51
- package/lib/mjs/components/datetime/fixtures/comp5.d.ts +0 -57
- package/lib/mjs/components/datetime/fixtures/comp6.d.ts +0 -55
- package/lib/mjs/components/datetime/fixtures/comp7.d.ts +0 -59
- package/lib/mjs/components/datetime/fixtures/comp8.d.ts +0 -59
- package/lib/mjs/components/datetime/fixtures/comp9.d.ts +0 -64
- package/lib/mjs/components/datetime/fixtures/index.d.ts +0 -12
- package/lib/mjs/components/datetime/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/day/Day.d.ts +0 -163
- package/lib/mjs/components/day/Day.form.d.ts +0 -3
- package/lib/mjs/components/day/editForm/Day.edit.data.d.ts +0 -5
- package/lib/mjs/components/day/editForm/Day.edit.day.d.ts +0 -40
- package/lib/mjs/components/day/editForm/Day.edit.display.d.ts +0 -40
- package/lib/mjs/components/day/editForm/Day.edit.month.d.ts +0 -40
- package/lib/mjs/components/day/editForm/Day.edit.validation.d.ts +0 -29
- package/lib/mjs/components/day/editForm/Day.edit.year.d.ts +0 -40
- package/lib/mjs/components/day/fixtures/comp1.d.ts +0 -46
- package/lib/mjs/components/day/fixtures/comp2.d.ts +0 -46
- package/lib/mjs/components/day/fixtures/comp3.d.ts +0 -48
- package/lib/mjs/components/day/fixtures/comp4.d.ts +0 -53
- package/lib/mjs/components/day/fixtures/comp5.d.ts +0 -29
- package/lib/mjs/components/day/fixtures/comp6.d.ts +0 -81
- package/lib/mjs/components/day/fixtures/index.d.ts +0 -7
- package/lib/mjs/components/day/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/editgrid/EditGrid.d.ts +0 -103
- package/lib/mjs/components/editgrid/EditGrid.form.d.ts +0 -3
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.data.d.ts +0 -18
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.display.d.ts +0 -82
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.templates.d.ts +0 -58
- package/lib/mjs/components/editgrid/editForm/EditGrid.edit.validation.d.ts +0 -29
- package/lib/mjs/components/editgrid/fixtures/comp-openWhenEmpty.d.ts +0 -34
- package/lib/mjs/components/editgrid/fixtures/comp-with-basic-components.d.ts +0 -327
- package/lib/mjs/components/editgrid/fixtures/comp-with-conditions-and-openWhenEmpty.d.ts +0 -77
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +0 -190
- package/lib/mjs/components/editgrid/fixtures/comp1.d.ts +0 -89
- package/lib/mjs/components/editgrid/fixtures/comp10.d.ts +0 -49
- package/lib/mjs/components/editgrid/fixtures/comp11.d.ts +0 -53
- package/lib/mjs/components/editgrid/fixtures/comp12.d.ts +0 -57
- package/lib/mjs/components/editgrid/fixtures/comp13.d.ts +0 -64
- package/lib/mjs/components/editgrid/fixtures/comp14.d.ts +0 -88
- package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +0 -54
- package/lib/mjs/components/editgrid/fixtures/comp2.d.ts +0 -112
- package/lib/mjs/components/editgrid/fixtures/comp3.d.ts +0 -27
- package/lib/mjs/components/editgrid/fixtures/comp4.d.ts +0 -23
- package/lib/mjs/components/editgrid/fixtures/comp5.d.ts +0 -19
- package/lib/mjs/components/editgrid/fixtures/comp6.d.ts +0 -50
- package/lib/mjs/components/editgrid/fixtures/comp7.d.ts +0 -129
- package/lib/mjs/components/editgrid/fixtures/comp8.d.ts +0 -148
- package/lib/mjs/components/editgrid/fixtures/comp9.d.ts +0 -86
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +0 -19
- package/lib/mjs/components/email/Email.d.ts +0 -4
- package/lib/mjs/components/email/Email.form.d.ts +0 -3
- package/lib/mjs/components/email/editForm/Email.edit.display.d.ts +0 -5
- package/lib/mjs/components/email/editForm/Email.edit.validation.d.ts +0 -24
- package/lib/mjs/components/email/fixtures/comp1.d.ts +0 -26
- package/lib/mjs/components/email/fixtures/comp2.d.ts +0 -23
- package/lib/mjs/components/email/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/email/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/fieldset/Fieldset.d.ts +0 -15
- package/lib/mjs/components/fieldset/Fieldset.form.d.ts +0 -3
- package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.d.ts +0 -33
- package/lib/mjs/components/fieldset/fixtures/comp1.d.ts +0 -46
- package/lib/mjs/components/fieldset/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/file/File.d.ts +0 -81
- package/lib/mjs/components/file/File.form.d.ts +0 -3
- package/lib/mjs/components/file/editForm/File.edit.data.d.ts +0 -5
- package/lib/mjs/components/file/editForm/File.edit.display.d.ts +0 -5
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +0 -275
- package/lib/mjs/components/file/editForm/File.edit.validation.d.ts +0 -5
- package/lib/mjs/components/file/fixtures/comp1.d.ts +0 -15
- package/lib/mjs/components/file/fixtures/comp2.d.ts +0 -35
- package/lib/mjs/components/file/fixtures/comp3.d.ts +0 -29
- package/lib/mjs/components/file/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/file/fixtures/values.d.ts +0 -10
- package/lib/mjs/components/form/Form.d.ts +0 -94
- package/lib/mjs/components/form/Form.form.d.ts +0 -3
- package/lib/mjs/components/form/editForm/Form.edit.data.d.ts +0 -82
- package/lib/mjs/components/form/editForm/Form.edit.display.d.ts +0 -5
- package/lib/mjs/components/form/editForm/Form.edit.form.d.ts +0 -89
- package/lib/mjs/components/form/fixtures/comp1.d.ts +0 -45
- package/lib/mjs/components/form/fixtures/comp2.d.ts +0 -14
- package/lib/mjs/components/form/fixtures/comp3.d.ts +0 -187
- package/lib/mjs/components/form/fixtures/comp4.d.ts +0 -107
- package/lib/mjs/components/form/fixtures/comp5.d.ts +0 -42
- package/lib/mjs/components/form/fixtures/comp6.d.ts +0 -74
- package/lib/mjs/components/form/fixtures/formModalEdit.d.ts +0 -42
- package/lib/mjs/components/form/fixtures/index.d.ts +0 -8
- package/lib/mjs/components/form/fixtures/values.d.ts +0 -6
- package/lib/mjs/components/hidden/Hidden.d.ts +0 -26
- package/lib/mjs/components/hidden/Hidden.form.d.ts +0 -3
- package/lib/mjs/components/hidden/editForm/Hidden.edit.data.d.ts +0 -5
- package/lib/mjs/components/hidden/editForm/Hidden.edit.display.d.ts +0 -5
- package/lib/mjs/components/hidden/fixtures/comp1.d.ts +0 -18
- package/lib/mjs/components/hidden/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/hidden/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/html/HTML.d.ts +0 -18
- package/lib/mjs/components/html/HTML.form.d.ts +0 -3
- package/lib/mjs/components/html/editForm/HTML.edit.display.d.ts +0 -77
- package/lib/mjs/components/html/editForm/HTML.edit.logic.d.ts +0 -48
- package/lib/mjs/components/html/fixtures/comp1.d.ts +0 -19
- package/lib/mjs/components/html/fixtures/comp2.d.ts +0 -21
- package/lib/mjs/components/html/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/index.d.ts +0 -98
- package/lib/mjs/components/number/Number.d.ts +0 -53
- package/lib/mjs/components/number/Number.form.d.ts +0 -3
- package/lib/mjs/components/number/editForm/Number.edit.data.d.ts +0 -18
- package/lib/mjs/components/number/editForm/Number.edit.display.d.ts +0 -5
- package/lib/mjs/components/number/editForm/Number.edit.validation.d.ts +0 -20
- package/lib/mjs/components/number/fixtures/comp1.d.ts +0 -33
- package/lib/mjs/components/number/fixtures/comp2.d.ts +0 -32
- package/lib/mjs/components/number/fixtures/comp3.d.ts +0 -14
- package/lib/mjs/components/number/fixtures/comp4.d.ts +0 -14
- package/lib/mjs/components/number/fixtures/comp5.d.ts +0 -20
- package/lib/mjs/components/number/fixtures/comp6.d.ts +0 -40
- package/lib/mjs/components/number/fixtures/comp7.d.ts +0 -15
- package/lib/mjs/components/number/fixtures/index.d.ts +0 -8
- package/lib/mjs/components/number/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/panel/Panel.d.ts +0 -14
- package/lib/mjs/components/panel/Panel.form.d.ts +0 -3
- package/lib/mjs/components/panel/editForm/Panel.edit.conditional.d.ts +0 -75
- package/lib/mjs/components/panel/editForm/Panel.edit.display.d.ts +0 -196
- package/lib/mjs/components/panel/fixtures/comp1.d.ts +0 -46
- package/lib/mjs/components/panel/fixtures/comp2.d.ts +0 -80
- package/lib/mjs/components/panel/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/password/Password.d.ts +0 -3
- package/lib/mjs/components/password/Password.form.d.ts +0 -3
- package/lib/mjs/components/password/editForm/Password.edit.data.d.ts +0 -18
- package/lib/mjs/components/password/editForm/Password.edit.display.d.ts +0 -5
- package/lib/mjs/components/password/editForm/Password.edit.validation.d.ts +0 -5
- package/lib/mjs/components/password/fixtures/comp1.d.ts +0 -22
- package/lib/mjs/components/password/fixtures/comp2.d.ts +0 -27
- package/lib/mjs/components/password/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/password/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/phonenumber/PhoneNumber.d.ts +0 -3
- package/lib/mjs/components/phonenumber/PhoneNumber.form.d.ts +0 -3
- package/lib/mjs/components/phonenumber/editForm/PhoneNumber.edit.validation.d.ts +0 -5
- package/lib/mjs/components/phonenumber/fixtures/comp1.d.ts +0 -27
- package/lib/mjs/components/phonenumber/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/phonenumber/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/radio/Radio.d.ts +0 -65
- package/lib/mjs/components/radio/Radio.form.d.ts +0 -3
- package/lib/mjs/components/radio/editForm/Radio.edit.data.d.ts +0 -134
- package/lib/mjs/components/radio/editForm/Radio.edit.display.d.ts +0 -40
- package/lib/mjs/components/radio/editForm/Radio.edit.validation.d.ts +0 -18
- package/lib/mjs/components/radio/fixtures/comp1.d.ts +0 -28
- package/lib/mjs/components/radio/fixtures/comp2.d.ts +0 -85
- package/lib/mjs/components/radio/fixtures/comp3.d.ts +0 -85
- package/lib/mjs/components/radio/fixtures/comp4.d.ts +0 -19
- package/lib/mjs/components/radio/fixtures/comp5.d.ts +0 -39
- package/lib/mjs/components/radio/fixtures/comp6.d.ts +0 -38
- package/lib/mjs/components/radio/fixtures/comp7.d.ts +0 -23
- package/lib/mjs/components/radio/fixtures/comp8.d.ts +0 -118
- package/lib/mjs/components/radio/fixtures/comp9.d.ts +0 -35
- package/lib/mjs/components/radio/fixtures/index.d.ts +0 -10
- package/lib/mjs/components/radio/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +0 -23
- package/lib/mjs/components/recaptcha/ReCaptcha.form.d.ts +0 -3
- package/lib/mjs/components/recaptcha/editForm/ReCaptcha.edit.display.d.ts +0 -44
- package/lib/mjs/components/recaptcha/fixtures/comp1.d.ts +0 -8
- package/lib/mjs/components/recaptcha/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/resource/Resource.d.ts +0 -10
- package/lib/mjs/components/resource/Resource.form.d.ts +0 -3
- package/lib/mjs/components/resource/editForm/Resource.edit.display.d.ts +0 -173
- package/lib/mjs/components/resource/fixtures/comp1.d.ts +0 -30
- package/lib/mjs/components/resource/fixtures/comp2.d.ts +0 -35
- package/lib/mjs/components/resource/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/select/Select.d.ts +0 -145
- package/lib/mjs/components/select/Select.form.d.ts +0 -3
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +0 -1039
- package/lib/mjs/components/select/editForm/Select.edit.display.d.ts +0 -27
- package/lib/mjs/components/select/editForm/Select.edit.validation.d.ts +0 -30
- package/lib/mjs/components/select/fixtures/comp1.d.ts +0 -40
- package/lib/mjs/components/select/fixtures/comp10.d.ts +0 -41
- package/lib/mjs/components/select/fixtures/comp11.d.ts +0 -28
- package/lib/mjs/components/select/fixtures/comp12.d.ts +0 -53
- package/lib/mjs/components/select/fixtures/comp13.d.ts +0 -28
- package/lib/mjs/components/select/fixtures/comp14.d.ts +0 -40
- package/lib/mjs/components/select/fixtures/comp15.d.ts +0 -50
- package/lib/mjs/components/select/fixtures/comp16.d.ts +0 -34
- package/lib/mjs/components/select/fixtures/comp17.d.ts +0 -51
- package/lib/mjs/components/select/fixtures/comp18.d.ts +0 -49
- package/lib/mjs/components/select/fixtures/comp19.d.ts +0 -23
- package/lib/mjs/components/select/fixtures/comp2.d.ts +0 -41
- package/lib/mjs/components/select/fixtures/comp3.d.ts +0 -35
- package/lib/mjs/components/select/fixtures/comp4.d.ts +0 -103
- package/lib/mjs/components/select/fixtures/comp5.d.ts +0 -21
- package/lib/mjs/components/select/fixtures/comp6.d.ts +0 -20
- package/lib/mjs/components/select/fixtures/comp7.d.ts +0 -63
- package/lib/mjs/components/select/fixtures/comp8.d.ts +0 -72
- package/lib/mjs/components/select/fixtures/comp9.d.ts +0 -88
- package/lib/mjs/components/select/fixtures/index.d.ts +0 -20
- package/lib/mjs/components/select/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +0 -51
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +0 -3
- package/lib/mjs/components/selectboxes/editForm/SelectBoxes.edit.validation.d.ts +0 -9
- package/lib/mjs/components/selectboxes/fixtures/comp1.d.ts +0 -24
- package/lib/mjs/components/selectboxes/fixtures/comp2.d.ts +0 -24
- package/lib/mjs/components/selectboxes/fixtures/comp3.d.ts +0 -23
- package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +0 -66
- package/lib/mjs/components/selectboxes/fixtures/comp5.d.ts +0 -37
- package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +0 -14
- package/lib/mjs/components/selectboxes/fixtures/comp7.d.ts +0 -18
- package/lib/mjs/components/selectboxes/fixtures/index.d.ts +0 -8
- package/lib/mjs/components/selectboxes/fixtures/values.d.ts +0 -6
- package/lib/mjs/components/signature/Signature.d.ts +0 -46
- package/lib/mjs/components/signature/Signature.form.d.ts +0 -3
- package/lib/mjs/components/signature/editForm/Signature.edit.data.d.ts +0 -5
- package/lib/mjs/components/signature/editForm/Signature.edit.display.d.ts +0 -51
- package/lib/mjs/components/signature/editForm/Signature.edit.validation.d.ts +0 -5
- package/lib/mjs/components/signature/fixtures/comp1.d.ts +0 -30
- package/lib/mjs/components/signature/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/signature/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/survey/Survey.d.ts +0 -37
- package/lib/mjs/components/survey/Survey.form.d.ts +0 -3
- package/lib/mjs/components/survey/editForm/Survey.edit.data.d.ts +0 -44
- package/lib/mjs/components/survey/editForm/Survey.edit.display.d.ts +0 -5
- package/lib/mjs/components/survey/editForm/Survey.edit.validation.d.ts +0 -5
- package/lib/mjs/components/survey/fixtures/comp1.d.ts +0 -31
- package/lib/mjs/components/survey/fixtures/comp2.d.ts +0 -31
- package/lib/mjs/components/survey/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/survey/fixtures/values.d.ts +0 -5
- package/lib/mjs/components/table/Table.d.ts +0 -23
- package/lib/mjs/components/table/Table.form.d.ts +0 -3
- package/lib/mjs/components/table/editForm/Table.edit.display.d.ts +0 -84
- package/lib/mjs/components/table/fixtures/comp1.d.ts +0 -53
- package/lib/mjs/components/table/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/tabs/Tabs.d.ts +0 -30
- package/lib/mjs/components/tabs/Tabs.form.d.ts +0 -3
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.d.ts +0 -77
- package/lib/mjs/components/tabs/fixtures/comp1.d.ts +0 -23
- package/lib/mjs/components/tabs/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/tags/Tags.d.ts +0 -41
- package/lib/mjs/components/tags/Tags.form.d.ts +0 -3
- package/lib/mjs/components/tags/editForm/Tags.edit.data.d.ts +0 -51
- package/lib/mjs/components/tags/fixtures/comp1.d.ts +0 -20
- package/lib/mjs/components/tags/fixtures/comp2.d.ts +0 -10
- package/lib/mjs/components/tags/fixtures/comp3.d.ts +0 -23
- package/lib/mjs/components/tags/fixtures/comp4.d.ts +0 -9
- package/lib/mjs/components/tags/fixtures/comp5.d.ts +0 -24
- package/lib/mjs/components/tags/fixtures/comp6.d.ts +0 -17
- package/lib/mjs/components/tags/fixtures/index.d.ts +0 -7
- package/lib/mjs/components/tags/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/textarea/TextArea.d.ts +0 -37
- package/lib/mjs/components/textarea/TextArea.form.d.ts +0 -3
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.d.ts +0 -355
- package/lib/mjs/components/textarea/editForm/TextArea.edit.validation.d.ts +0 -10
- package/lib/mjs/components/textarea/fixtures/comp1.d.ts +0 -31
- package/lib/mjs/components/textarea/fixtures/comp2.d.ts +0 -29
- package/lib/mjs/components/textarea/fixtures/comp3.d.ts +0 -27
- package/lib/mjs/components/textarea/fixtures/comp4.d.ts +0 -30
- package/lib/mjs/components/textarea/fixtures/index.d.ts +0 -5
- package/lib/mjs/components/textarea/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/textfield/TextField.d.ts +0 -60
- package/lib/mjs/components/textfield/TextField.form.d.ts +0 -3
- package/lib/mjs/components/textfield/editForm/TextField.edit.data.d.ts +0 -46
- package/lib/mjs/components/textfield/editForm/TextField.edit.display.d.ts +0 -248
- package/lib/mjs/components/textfield/editForm/TextField.edit.validation.d.ts +0 -10
- package/lib/mjs/components/textfield/fixtures/comp-with-display-and-value-masks.d.ts +0 -47
- package/lib/mjs/components/textfield/fixtures/comp1.d.ts +0 -33
- package/lib/mjs/components/textfield/fixtures/comp2.d.ts +0 -33
- package/lib/mjs/components/textfield/fixtures/comp3.d.ts +0 -33
- package/lib/mjs/components/textfield/fixtures/comp4.d.ts +0 -23
- package/lib/mjs/components/textfield/fixtures/comp5.d.ts +0 -12
- package/lib/mjs/components/textfield/fixtures/comp6.d.ts +0 -25
- package/lib/mjs/components/textfield/fixtures/comp7.d.ts +0 -37
- package/lib/mjs/components/textfield/fixtures/index.d.ts +0 -9
- package/lib/mjs/components/textfield/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/time/Time.d.ts +0 -27
- package/lib/mjs/components/time/Time.form.d.ts +0 -3
- package/lib/mjs/components/time/editForm/Time.edit.data.d.ts +0 -10
- package/lib/mjs/components/time/editForm/Time.edit.display.d.ts +0 -52
- package/lib/mjs/components/time/fixtures/comp1.d.ts +0 -24
- package/lib/mjs/components/time/fixtures/comp2.d.ts +0 -10
- package/lib/mjs/components/time/fixtures/comp3.d.ts +0 -15
- package/lib/mjs/components/time/fixtures/index.d.ts +0 -6
- package/lib/mjs/components/time/fixtures/timeForm.d.ts +0 -47
- package/lib/mjs/components/time/fixtures/timeForm2.d.ts +0 -38
- package/lib/mjs/components/time/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/unknown/Unknown.d.ts +0 -28
- package/lib/mjs/components/unknown/Unknown.form.d.ts +0 -34
- package/lib/mjs/components/unknown/editForm/Unknown.edit.display.d.ts +0 -24
- package/lib/mjs/components/unknown/fixtures/comp1.d.ts +0 -7
- package/lib/mjs/components/unknown/fixtures/index.d.ts +0 -2
- package/lib/mjs/components/url/Url.d.ts +0 -3
- package/lib/mjs/components/url/Url.form.d.ts +0 -3
- package/lib/mjs/components/url/editForm/Url.edit.data.d.ts +0 -5
- package/lib/mjs/components/url/editForm/Url.edit.display.d.ts +0 -5
- package/lib/mjs/components/url/editForm/Url.edit.validation.d.ts +0 -5
- package/lib/mjs/components/url/fixtures/comp1.d.ts +0 -26
- package/lib/mjs/components/url/fixtures/comp2.d.ts +0 -26
- package/lib/mjs/components/url/fixtures/index.d.ts +0 -3
- package/lib/mjs/components/url/fixtures/values.d.ts +0 -2
- package/lib/mjs/components/well/Well.d.ts +0 -15
- package/lib/mjs/components/well/Well.form.d.ts +0 -3
- package/lib/mjs/components/well/editForm/Well.edit.display.d.ts +0 -28
- package/lib/mjs/components/well/fixtures/comp1.d.ts +0 -43
- package/lib/mjs/components/well/fixtures/index.d.ts +0 -2
- package/lib/mjs/displays/Displays.d.ts +0 -18
- package/lib/mjs/displays/index.d.ts +0 -2
- package/lib/mjs/formio.embed.d.ts +0 -2
- package/lib/mjs/formio.form.d.ts +0 -17
- package/lib/mjs/i18n.d.ts +0 -13
- package/lib/mjs/index.d.ts +0 -5
- package/lib/mjs/licenses/Licenses.d.ts +0 -7
- package/lib/mjs/licenses/index.d.ts +0 -2
- package/lib/mjs/pdf.image.d.ts +0 -2
- package/lib/mjs/providers/Providers.d.ts +0 -80
- package/lib/mjs/providers/address/AddressProvider.d.ts +0 -17
- package/lib/mjs/providers/address/AzureAddressProvider.d.ts +0 -12
- package/lib/mjs/providers/address/CustomAddressProvider.d.ts +0 -7
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +0 -18
- package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +0 -11
- package/lib/mjs/providers/address/index.d.ts +0 -6
- package/lib/mjs/providers/auth/index.d.ts +0 -2
- package/lib/mjs/providers/index.d.ts +0 -2
- package/lib/mjs/providers/processor/fileProcessor.d.ts +0 -2
- package/lib/mjs/providers/storage/azure.d.ts +0 -15
- package/lib/mjs/providers/storage/base64.d.ts +0 -10
- package/lib/mjs/providers/storage/dropbox.d.ts +0 -8
- package/lib/mjs/providers/storage/googleDrive.d.ts +0 -8
- package/lib/mjs/providers/storage/index.d.ts +0 -15
- package/lib/mjs/providers/storage/indexeddb.d.ts +0 -11
- package/lib/mjs/providers/storage/s3.d.ts +0 -17
- package/lib/mjs/providers/storage/uploadAdapter.d.ts +0 -1
- package/lib/mjs/providers/storage/url.d.ts +0 -11
- package/lib/mjs/providers/storage/xhr.d.ts +0 -7
- package/lib/mjs/templates/Templates.d.ts +0 -1
- package/lib/mjs/templates/index.d.ts +0 -229
- package/lib/mjs/translations/en.d.ts +0 -71
- package/lib/mjs/utils/ChoicesWrapper.d.ts +0 -38
- package/lib/mjs/utils/Evaluator.d.ts +0 -4
- package/lib/mjs/utils/builder.d.ts +0 -22
- package/lib/mjs/utils/calendarUtils.d.ts +0 -41
- package/lib/mjs/utils/conditionOperators/ConditionOperator.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/DateGreaterThan.d.ts +0 -13
- package/lib/mjs/utils/conditionOperators/DateGreaterThanOrEqual.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/DateLessThan.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/DateLessThanOrEqual.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/EndsWith.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/GreaterThan.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/GreaterThanOrEqual.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/Includes.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/IsDateEqual.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/IsEmptyValue.d.ts +0 -9
- package/lib/mjs/utils/conditionOperators/IsEqualTo.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/IsNotDateEqual.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/IsNotEmptyValue.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/IsNotEqualTo.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/LessThan.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/LessThanOrEqual.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/NotIncludes.d.ts +0 -4
- package/lib/mjs/utils/conditionOperators/StartsWith.d.ts +0 -7
- package/lib/mjs/utils/conditionOperators/index.d.ts +0 -7
- package/lib/mjs/utils/formUtils.d.ts +0 -173
- package/lib/mjs/utils/i18n.d.ts +0 -16
- package/lib/mjs/utils/index.d.ts +0 -3
- package/lib/mjs/utils/jsonlogic/operators.d.ts +0 -1
- package/lib/mjs/utils/utils.d.ts +0 -375
- package/lib/mjs/widgets/CalendarWidget.d.ts +0 -97
- package/lib/mjs/widgets/InputWidget.d.ts +0 -24
- package/lib/mjs/widgets/index.d.ts +0 -7
package/dist/formio.js
CHANGED
@@ -26,7 +26,7 @@ return /******/ (function() { // webpackBootstrap
|
|
26
26
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
27
27
|
|
28
28
|
"use strict";
|
29
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst lodash_1 = __webpack_require__(/*!
|
29
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/**\n * The Form.io Plugins allow external systems to \"hook\" into the default behaviors of the JavaScript SDK.\n */\nclass Plugins {\n /**\n * Returns the plugin identity.\n *\n * @param value\n */\n static identity(value) {\n return value;\n }\n /**\n * De-registers a plugin.\n * @param plugin The plugin you wish to deregister.\n */\n static deregisterPlugin(plugin) {\n const beforeLength = Plugins.plugins.length;\n Plugins.plugins = Plugins.plugins.filter((p) => {\n if (p !== plugin && p.__name !== plugin) {\n return true;\n }\n (p.deregister || lodash_1.noop).call(plugin, Plugins.Formio);\n return false;\n });\n return beforeLength !== Plugins.plugins.length;\n }\n /**\n * Registers a new plugin.\n *\n * @param plugin The Plugin object.\n * @param name The name of the plugin you wish to register.\n */\n static registerPlugin(plugin, name) {\n Plugins.plugins.push(plugin);\n Plugins.plugins.sort((a, b) => (b.priority || 0) - (a.priority || 0));\n plugin.__name = name;\n (plugin.init || lodash_1.noop).call(plugin, Plugins.Formio);\n }\n /**\n * Returns a plugin provided the name of the plugin.\n * @param name The name of the plugin you would like to get.\n */\n static getPlugin(name) {\n for (const plugin of Plugins.plugins) {\n if (plugin.__name === name) {\n return plugin;\n }\n }\n return null;\n }\n /**\n * Wait for a plugin function to complete.\n * @param pluginFn - A function within the plugin.\n * @param args\n */\n static pluginWait(pluginFn, ...args) {\n return Promise.all(Plugins.plugins.map((plugin) => (plugin[pluginFn] || lodash_1.noop).call(plugin, ...args)));\n }\n /**\n * Gets a value from a Plugin\n * @param pluginFn\n * @param args\n */\n static pluginGet(pluginFn, ...args) {\n const callPlugin = (index) => {\n const plugin = Plugins.plugins[index];\n if (!plugin) {\n return Promise.resolve(null);\n }\n return Promise.resolve((plugin[pluginFn] || lodash_1.noop).call(plugin, ...args))\n .then((result) => {\n if (!(0, lodash_1.isNil)(result)) {\n return result;\n }\n return callPlugin(index + 1);\n });\n };\n return callPlugin(0);\n }\n /**\n * Allows a Plugin to alter the behavior of the JavaScript library.\n *\n * @param pluginFn\n * @param value\n * @param args\n */\n static pluginAlter(pluginFn, value, ...args) {\n return Plugins.plugins.reduce((value, plugin) => (plugin[pluginFn] || Plugins.identity)(value, ...args), value);\n }\n}\n/**\n * An array of Form.io Plugins.\n */\nPlugins.plugins = [];\nexports[\"default\"] = Plugins;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/sdk/Plugins.js?");
|
30
30
|
|
31
31
|
/***/ }),
|
32
32
|
|
@@ -48,7 +48,18 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
48
48
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
49
49
|
|
50
50
|
"use strict";
|
51
|
-
eval("\
|
51
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Evaluator = exports.BaseEvaluator = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n// BaseEvaluator is for extending.\nclass BaseEvaluator {\n static evaluator(func, ...params) {\n if (Evaluator.noeval) {\n console.warn('No evaluations allowed for this renderer.');\n return lodash_1.noop;\n }\n if (typeof func === 'function') {\n return func;\n }\n if (typeof params[0] === 'object') {\n params = (0, lodash_1.keys)(params[0]);\n }\n return new Function(...params, func);\n }\n ;\n static interpolateString(rawTemplate, data, options = {}) {\n return rawTemplate.replace(/({{\\s*(.*?)\\s*}})/g, (match, $1, $2) => {\n // If this is a function call and we allow evals.\n if ($2.indexOf('(') !== -1) {\n return $2.replace(/([^\\(]+)\\(([^\\)]+)\\s*\\);?/, (evalMatch, funcName, args) => {\n funcName = (0, lodash_1.trim)(funcName);\n const func = (0, lodash_1.get)(data, funcName);\n if (func) {\n if (args) {\n args = args.split(',').map((arg) => {\n arg = (0, lodash_1.trim)(arg);\n if ((arg.indexOf('\"') === 0) || (arg.indexOf(\"'\") === 0)) {\n return arg.substring(1, arg.length - 1);\n }\n return (0, lodash_1.get)(data, arg);\n });\n }\n return Evaluator.evaluate(func, args, '', false, data, options);\n }\n return '';\n });\n }\n else {\n let dataPath = $2;\n if ($2.indexOf('?') !== -1) {\n dataPath = $2.replace(/\\?\\./g, '.');\n }\n // Allow for conditional values.\n const parts = dataPath.split('||').map((item) => item.trim());\n let value = '';\n let path = '';\n for (let i = 0; i < parts.length; i++) {\n path = parts[i];\n value = (0, lodash_1.get)(data, path);\n if (value) {\n break;\n }\n }\n if (options.data) {\n (0, lodash_1.set)(options.data, path, value);\n }\n return value;\n }\n });\n }\n static interpolate(rawTemplate, data, options = {}) {\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n return Evaluator.interpolateString(String(rawTemplate), data, options);\n }\n ;\n /**\n * Evaluate a method.\n *\n * @param func\n * @param args\n * @return {*}\n */\n static evaluate(func, args = {}, ret = '', interpolate = false, context = {}, options = {}) {\n let returnVal = null;\n options = (0, lodash_1.isObject)(options) ? options : { noeval: options };\n const component = args.component ? args.component : { key: 'unknown' };\n if (!args.form && args.instance) {\n args.form = (0, lodash_1.get)(args.instance, 'root._form', {});\n }\n const componentKey = component.key;\n if (typeof func === 'string') {\n if (ret) {\n func += `;return ${ret}`;\n }\n if (interpolate) {\n func = BaseEvaluator.interpolate(func, args, options);\n }\n try {\n if (Evaluator.noeval || options.noeval) {\n func = lodash_1.noop;\n }\n else {\n func = Evaluator.evaluator(func, args, context);\n }\n args = (0, lodash_1.values)(args);\n }\n catch (err) {\n console.warn(`An error occured within the custom function for ${componentKey}`, err);\n returnVal = null;\n func = false;\n }\n }\n if (typeof func === 'function') {\n try {\n returnVal = Evaluator.execute(func, args, context, options);\n }\n catch (err) {\n returnVal = null;\n console.warn(`An error occured within custom function for ${componentKey}`, err);\n }\n }\n else if (func) {\n console.warn(`Unknown function type for ${componentKey}`);\n }\n return returnVal;\n }\n /**\n * Execute a function.\n *\n * @param func\n * @param args\n * @returns\n */\n static execute(func, args, context = {}, options = {}) {\n options = (0, lodash_1.isObject)(options) ? options : { noeval: options };\n if (Evaluator.noeval || options.noeval) {\n console.warn('No evaluations allowed for this renderer.');\n return;\n }\n return Array.isArray(args) ? func.apply(context, args) : func.call(context, args);\n }\n ;\n}\nexports.BaseEvaluator = BaseEvaluator;\nBaseEvaluator.templateSettings = {\n interpolate: /{{([\\s\\S]+?)}}/g,\n evaluate: /\\{%([\\s\\S]+?)%\\}/g,\n escape: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g\n};\nBaseEvaluator.noeval = false;\n// The extendable evaluator\nclass Evaluator extends BaseEvaluator {\n /**\n * Allow external modules the ability to extend the Evaluator.\n * @param evaluator\n */\n static registerEvaluator(evaluator) {\n Object.keys(evaluator).forEach((key) => {\n Evaluator[key] = evaluator[key];\n });\n }\n}\nexports.Evaluator = Evaluator;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/Evaluator.js?");
|
52
|
+
|
53
|
+
/***/ }),
|
54
|
+
|
55
|
+
/***/ "./node_modules/@formio/core/lib/utils/fastCloneDeep.js":
|
56
|
+
/*!**************************************************************!*\
|
57
|
+
!*** ./node_modules/@formio/core/lib/utils/fastCloneDeep.js ***!
|
58
|
+
\**************************************************************/
|
59
|
+
/***/ (function(__unused_webpack_module, exports) {
|
60
|
+
|
61
|
+
"use strict";
|
62
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.fastCloneDeep = void 0;\n/**\n * Performs a fast clone deep operation.\n *\n * @param obj\n */\nfunction fastCloneDeep(obj) {\n try {\n return JSON.parse(JSON.stringify(obj));\n }\n catch (err) {\n console.log(`Clone Failed: ${err.message}`);\n return null;\n }\n}\nexports.fastCloneDeep = fastCloneDeep;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/fastCloneDeep.js?");
|
52
63
|
|
53
64
|
/***/ }),
|
54
65
|
|
@@ -74,80 +85,14 @@ eval("\n// copied from https://github.com/auth0/jwt-decode\nObject.definePropert
|
|
74
85
|
|
75
86
|
/***/ }),
|
76
87
|
|
77
|
-
/***/ "./node_modules
|
78
|
-
|
79
|
-
!*** ./node_modules
|
80
|
-
|
81
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
82
|
-
|
83
|
-
"use strict";
|
84
|
-
eval("\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.intersection = exports.map = exports.head = exports.last = exports.filter = exports.findEach = exports.matches = exports.findIndex = exports.find = exports.each = exports.dropRight = exports.drop = exports.difference = exports.concat = exports.compact = exports.chunk = void 0;\nvar lang_1 = __webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\");\nvar object_1 = __webpack_require__(/*! ./object */ \"./node_modules/@formio/lodash/lib/object.js\");\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_chunk\nfunction chunk(input, size) {\n return input.reduce(function (arr, item, idx) {\n return idx % size === 0\n ? __spreadArray(__spreadArray([], arr, true), [[item]], false) : __spreadArray(__spreadArray([], arr.slice(0, -1), true), [__spreadArray(__spreadArray([], arr.slice(-1)[0], true), [item], false)], false);\n }, []);\n}\nexports.chunk = chunk;\n;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_compact\nfunction compact(input) {\n return input.filter(Boolean);\n}\nexports.compact = compact;\n/**\n * @link https://lodash.com/docs/4.17.15#concat\n * @param input\n * @param args\n * @returns\n */\nfunction concat(input) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return input.concat.apply(input, args);\n}\nexports.concat = concat;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_difference\nfunction difference() {\n var arrays = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n arrays[_i] = arguments[_i];\n }\n return arrays.reduce(function (a, b) {\n return a.filter(function (value) {\n return !b.includes(value);\n });\n });\n}\nexports.difference = difference;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_drop\nfunction drop(arr, index) {\n if (index === void 0) { index = 1; }\n return (index > 0) ? arr.slice(index) : arr;\n}\nexports.drop = drop;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_dropright\nfunction dropRight(arr, index) {\n if (index === void 0) { index = 1; }\n return (index > 0) ? arr.slice(0, -index) : arr;\n}\nexports.dropRight = dropRight;\n/**\n * Iterate through a collection or array.\n * @param collection\n * @param _each\n */\nfunction each(collection, _each) {\n var isArray = Array.isArray(collection);\n for (var i in collection) {\n if (collection.hasOwnProperty(i)) {\n if (_each(collection[i], isArray ? Number(i) : i) === true) {\n break;\n }\n ;\n }\n }\n}\nexports.each = each;\n/**\n * Perform a find operation.\n * @param arr\n * @param query\n */\nfunction find(arr, query, findIndex) {\n if (findIndex === void 0) { findIndex = false; }\n if (!arr) {\n return undefined;\n }\n if (Array.isArray(arr) && typeof query === 'function') {\n return findIndex ? arr.findIndex(query) : arr.find(query);\n }\n var found = undefined;\n var foundIndex = 0;\n findEach(arr, query, function (item, index) {\n found = item;\n foundIndex = index;\n return true;\n });\n return findIndex ? foundIndex : found;\n}\nexports.find = find;\n/**\n * Find an index.\n *\n * @param arr\n * @param query\n * @returns\n */\nfunction findIndex(arr, query) {\n return find(arr, query, true);\n}\nexports.findIndex = findIndex;\n/**\n * Returns a function to perform matches.\n * @param query\n * @returns\n */\nfunction matches(query) {\n var keys = [];\n var compare = {};\n if (typeof query === 'string') {\n keys = [query];\n compare[query] = true;\n }\n else {\n keys = Object.keys(query);\n compare = query;\n }\n return function (comp) {\n return (0, lang_1.isEqual)((0, object_1.pick)(comp, keys), compare);\n };\n}\nexports.matches = matches;\n/**\n * Perform a find operation on each item in an array.\n * @param arr\n * @param query\n * @param fn\n */\nfunction findEach(arr, query, fn) {\n each(arr, function (item, index) {\n if (matches(query)(item)) {\n if (fn(item, index) === true) {\n return true;\n }\n }\n });\n}\nexports.findEach = findEach;\n/**\n * Perform a filter operation.\n * @param arr\n * @param fn\n */\nfunction filter(arr, fn) {\n if (!arr) {\n return [];\n }\n if (!fn) {\n fn = function (val) { return !!val; };\n }\n if (Array.isArray(arr) && typeof fn === 'function') {\n return arr.filter(fn);\n }\n var found = [];\n findEach(arr, fn, function (item, index) {\n found.push(item);\n if (Array.isArray(item)) {\n arr.splice(index, 1);\n }\n else {\n delete arr[index];\n }\n });\n return found;\n}\nexports.filter = filter;\n/**\n * Get the last item in an array.\n * @param arr\n */\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexports.last = last;\n/**\n * https://lodash.com/docs/4.17.15#head\n * @param arr\n * @returns\n */\nfunction head(arr) {\n return arr[0];\n}\nexports.head = head;\n/**\n * https://lodash.com/docs/4.17.15#map\n * @param arr\n * @param fn\n * @returns\n */\nfunction map(arr, fn) {\n return arr.map(fn);\n}\nexports.map = map;\n/**\n * Get the intersection of two objects.\n * @param a\n * @param b\n */\nfunction intersection(a, b) {\n return a.filter(function (value) { return b.includes(value); });\n}\nexports.intersection = intersection;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/array.js?");
|
85
|
-
|
86
|
-
/***/ }),
|
87
|
-
|
88
|
-
/***/ "./node_modules/@formio/lodash/lib/function.js":
|
89
|
-
/*!*****************************************************!*\
|
90
|
-
!*** ./node_modules/@formio/lodash/lib/function.js ***!
|
91
|
-
\*****************************************************/
|
92
|
-
/***/ (function(__unused_webpack_module, exports) {
|
93
|
-
|
94
|
-
"use strict";
|
95
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.debounce = void 0;\n/**\n * Debounc the call of a function for a given amount of time.\n *\n * @param func\n * @param wait\n * @returns\n */\nfunction debounce(func, wait) {\n if (wait === void 0) { wait = 100; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(function () {\n timeout = null;\n func.apply(void 0, args);\n }, wait);\n };\n}\nexports.debounce = debounce;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/function.js?");
|
96
|
-
|
97
|
-
/***/ }),
|
98
|
-
|
99
|
-
/***/ "./node_modules/@formio/lodash/lib/index.js":
|
100
|
-
/*!**************************************************!*\
|
101
|
-
!*** ./node_modules/@formio/lodash/lib/index.js ***!
|
102
|
-
\**************************************************/
|
103
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
104
|
-
|
105
|
-
"use strict";
|
106
|
-
eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.chain = void 0;\nvar ArrayFunctions = __importStar(__webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\"));\nvar Chainable = /** @class */ (function () {\n function Chainable(val) {\n this.chain = [];\n this.currentValue = [];\n this.currentValue = val;\n }\n Chainable.prototype.value = function () {\n return this.chain.reduce(function (current, func) {\n var _a;\n return (_a = ArrayFunctions)[func.method].apply(_a, __spreadArray([current], func.args, false));\n }, this.currentValue);\n };\n return Chainable;\n}());\nvar _loop_1 = function (method) {\n if (ArrayFunctions.hasOwnProperty(method)) {\n Chainable.prototype[method] = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n this.chain.push({ method: method, args: args });\n return this;\n };\n }\n};\nfor (var method in ArrayFunctions) {\n _loop_1(method);\n}\n/**\n * Create a chainable array of methods.\n * @param val\n * @returns\n */\nfunction chain(val) {\n return new Chainable(val);\n}\nexports.chain = chain;\nexports[\"default\"] = chain;\n__exportStar(__webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\"), exports);\n__exportStar(__webpack_require__(/*! ./function */ \"./node_modules/@formio/lodash/lib/function.js\"), exports);\n__exportStar(__webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\"), exports);\n__exportStar(__webpack_require__(/*! ./math */ \"./node_modules/@formio/lodash/lib/math.js\"), exports);\n__exportStar(__webpack_require__(/*! ./object */ \"./node_modules/@formio/lodash/lib/object.js\"), exports);\n__exportStar(__webpack_require__(/*! ./string */ \"./node_modules/@formio/lodash/lib/string.js\"), exports);\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/index.js?");
|
107
|
-
|
108
|
-
/***/ }),
|
109
|
-
|
110
|
-
/***/ "./node_modules/@formio/lodash/lib/lang.js":
|
111
|
-
/*!*************************************************!*\
|
112
|
-
!*** ./node_modules/@formio/lodash/lib/lang.js ***!
|
113
|
-
\*************************************************/
|
114
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
115
|
-
|
116
|
-
"use strict";
|
117
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isRegExp = exports.isBoolean = exports.isNumber = exports.isPlainObject = exports.isObject = exports.isObjectLike = exports.isArray = exports.isNull = exports.isNil = exports.isNaN = exports.isInteger = exports.isEmpty = exports.isString = exports.isEqual = exports.noop = void 0;\nvar array_1 = __webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\");\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction getTag(value) {\n if (value == null) {\n return value === undefined ? '[object Undefined]' : '[object Null]';\n }\n return Object.prototype.toString.call(value);\n}\n/**\n * A no-operation function.\n */\nfunction noop() {\n return;\n}\nexports.noop = noop;\n;\n/**\n * Determines equality of a value or complex object.\n * @param a\n * @param b\n */\nfunction isEqual(a, b) {\n var equal = false;\n if (a === b) {\n return true;\n }\n if (a && b && (Array.isArray(a) || isObject(a)) && Object.keys(a).length === Object.keys(b).length) {\n equal = true;\n (0, array_1.each)(a, function (val, key) {\n if ((Array.isArray(val) || isObject(val)) && !isEqual(b[key], val)) {\n equal = false;\n return true;\n }\n if (b[key] !== val) {\n equal = false;\n return true;\n }\n });\n }\n return equal;\n}\nexports.isEqual = isEqual;\nfunction isString(val) {\n return typeof val === 'string';\n}\nexports.isString = isString;\n// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isempty\nfunction isEmpty(val) {\n return [Object, Array].includes((val || {}).constructor) && !Object.entries((val || {})).length;\n}\nexports.isEmpty = isEmpty;\nfunction isInteger(val) {\n return Number.isInteger(val);\n}\nexports.isInteger = isInteger;\nfunction isNaN(val) {\n return Number.isNaN(val);\n}\nexports.isNaN = isNaN;\nfunction isNil(val) {\n return val == null;\n}\nexports.isNil = isNil;\nfunction isNull(val) {\n return val === null;\n}\nexports.isNull = isNull;\nfunction isArray(val) {\n return Array.isArray(val);\n}\nexports.isArray = isArray;\nfunction isObjectLike(val) {\n return typeof val === 'object' && (val !== null);\n}\nexports.isObjectLike = isObjectLike;\nfunction isObject(val) {\n var type = typeof val;\n return val != null && (type === 'object' || type === 'function');\n}\nexports.isObject = isObject;\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || getTag(value) != '[object Object]') {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n}\nexports.isPlainObject = isPlainObject;\nfunction isNumber(val) {\n return typeof val === 'number' || (isObjectLike(val) && getTag(val) == '[object Number]');\n}\nexports.isNumber = isNumber;\nfunction isBoolean(val) {\n return val === true || val === false || (isObjectLike(val) && getTag(val) == '[object Boolean]');\n}\nexports.isBoolean = isBoolean;\nfunction isRegExp(val) {\n return isObjectLike(val) && getTag(val) == '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/lang.js?");
|
118
|
-
|
119
|
-
/***/ }),
|
120
|
-
|
121
|
-
/***/ "./node_modules/@formio/lodash/lib/math.js":
|
122
|
-
/*!*************************************************!*\
|
123
|
-
!*** ./node_modules/@formio/lodash/lib/math.js ***!
|
124
|
-
\*************************************************/
|
125
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
126
|
-
|
127
|
-
"use strict";
|
128
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.sumBy = exports.sum = exports.mod = exports.subtract = exports.round = exports.multiply = exports.minBy = exports.min = exports.meanBy = exports.mean = exports.maxBy = exports.max = exports.floor = exports.divide = exports.ceil = exports.add = void 0;\nvar lang_1 = __webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\");\nvar object_1 = __webpack_require__(/*! ./object */ \"./node_modules/@formio/lodash/lib/object.js\");\nfunction mathOp(a, op, precision) {\n if (precision === void 0) { precision = 0; }\n if (!precision) {\n return op(a);\n }\n precision = Math.pow(10, precision);\n return op(a * precision) / precision;\n}\nfunction compareBy(arr, fn, op) {\n var first = arr[0];\n if (arr.length <= 1) {\n return first;\n }\n var fnString = (0, lang_1.isString)(fn);\n return arr.slice(1).reduce(function (current, next) {\n var currentValue = fnString ? (0, object_1.get)(current, fn) : fn(current);\n var nextValue = fnString ? (0, object_1.get)(next, fn) : fn(next);\n var result = op(currentValue, nextValue);\n return (result === nextValue) ? next : current;\n }, first);\n}\nfunction valueBy(arr, fn, op) {\n var first = arr[0];\n if (arr.length <= 1) {\n return first;\n }\n var fnString = (0, lang_1.isString)(fn);\n return arr.slice(1).reduce(function (current, next) { return op(current, fnString ? (0, object_1.get)(next, fn) : fn(next)); }, fnString ? (0, object_1.get)(first, fn) : fn(first));\n}\n/**\n * @link https://lodash.com/docs/4.17.15#add\n * @param augend\n * @param addend\n * @returns\n */\nfunction add(augend, addend) {\n return augend + addend;\n}\nexports.add = add;\n/**\n * @link https://lodash.com/docs/4.17.15#ceil\n * @param num\n * @param precision\n * @returns\n */\nfunction ceil(num, precision) {\n if (precision === void 0) { precision = 0; }\n return mathOp(num, Math.ceil, precision);\n}\nexports.ceil = ceil;\n/**\n * https://lodash.com/docs/4.17.15#divide\n * @param dividend\n * @param divisor\n * @returns\n */\nfunction divide(dividend, divisor) {\n return dividend / divisor;\n}\nexports.divide = divide;\n/**\n * @link https://lodash.com/docs/4.17.15#floor\n * @param num\n * @param precision\n * @returns\n */\nfunction floor(num, precision) {\n if (precision === void 0) { precision = 0; }\n return mathOp(num, Math.floor, precision);\n}\nexports.floor = floor;\n/**\n * @link https://lodash.com/docs/4.17.15#max\n * @param arr\n * @returns\n */\nfunction max(arr) {\n return Math.max.apply(Math, arr);\n}\nexports.max = max;\n/**\n * @link https://lodash.com/docs/4.17.15#maxBy\n */\nfunction maxBy(arr, fn) {\n return compareBy(arr, fn, Math.max);\n}\nexports.maxBy = maxBy;\n/**\n * @link https://lodash.com/docs/4.17.15#mean\n * @param arr\n * @returns\n */\nfunction mean(arr) {\n return sum(arr) / arr.length;\n}\nexports.mean = mean;\n/**\n * @link https://lodash.com/docs/4.17.15#meanBy\n * @param arr\n * @param fn\n * @returns\n */\nfunction meanBy(arr, fn) {\n return sumBy(arr, fn) / arr.length;\n}\nexports.meanBy = meanBy;\n/**\n * @link https://lodash.com/docs/4.17.15#min\n * @param arr\n * @returns\n */\nfunction min(arr) {\n return Math.min.apply(Math, arr);\n}\nexports.min = min;\n/**\n * @link https://lodash.com/docs/4.17.15#minBy\n * @param arr\n * @param fn\n * @returns\n */\nfunction minBy(arr, fn) {\n return compareBy(arr, fn, Math.min);\n}\nexports.minBy = minBy;\n/**\n * @link https://lodash.com/docs/4.17.15#multiply\n * @param multiplier\n * @param multiplicand\n * @returns\n */\nfunction multiply(multiplier, multiplicand) {\n return multiplier * multiplicand;\n}\nexports.multiply = multiply;\n/**\n * @link https://lodash.com/docs/4.17.15#round\n * @param num\n * @param precision\n * @returns\n */\nfunction round(num, precision) {\n if (precision === void 0) { precision = 0; }\n return mathOp(num, Math.round, precision);\n}\nexports.round = round;\n/**\n * @link https://lodash.com/docs/4.17.15#subtract\n * @param a\n * @param b\n * @returns\n */\nfunction subtract(minuend, subtrahend) {\n return minuend - subtrahend;\n}\nexports.subtract = subtract;\n/**\n * Perform a modulus operation between two numbers.\n * @param a\n * @param b\n * @returns\n */\nfunction mod(a, b) {\n return a % b;\n}\nexports.mod = mod;\n/**\n * @link https://lodash.com/docs/4.17.15#sum\n * @param arr\n * @returns\n */\nfunction sum(arr) {\n return arr.reduce(add, 0);\n}\nexports.sum = sum;\n/**\n * @link https://lodash.com/docs/4.17.15#sumBy\n * @param arr\n * @param fn\n * @returns\n */\nfunction sumBy(arr, fn) {\n return valueBy(arr, fn, function (a, b) { return (a + b); });\n}\nexports.sumBy = sumBy;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/math.js?");
|
129
|
-
|
130
|
-
/***/ }),
|
131
|
-
|
132
|
-
/***/ "./node_modules/@formio/lodash/lib/object.js":
|
133
|
-
/*!***************************************************!*\
|
134
|
-
!*** ./node_modules/@formio/lodash/lib/object.js ***!
|
135
|
-
\***************************************************/
|
136
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
137
|
-
|
138
|
-
"use strict";
|
139
|
-
eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.pick = exports.defaults = exports.cloneDeep = exports.clone = exports.fastCloneDeep = exports.merge = exports.set = exports.has = exports.propertyOf = exports.property = exports.get = exports.pathParts = exports.values = exports.keys = void 0;\nvar lang_1 = __webpack_require__(/*! ./lang */ \"./node_modules/@formio/lodash/lib/lang.js\");\nvar array_1 = __webpack_require__(/*! ./array */ \"./node_modules/@formio/lodash/lib/array.js\");\n/**\n * Get the keys of an Object.\n * @param obj\n */\nfunction keys(obj) {\n return Object.keys(obj);\n}\nexports.keys = keys;\n;\n/**\n * Return the values of an object or an array.\n * @param obj\n * @returns\n */\nfunction values(obj) {\n return (0, lang_1.isArray)(obj) ? obj : Object.values(obj);\n}\nexports.values = values;\n/**\n * Retrieve the path parts provided a path string.\n * @param path\n */\nfunction pathParts(path) {\n if (!path) {\n return [];\n }\n if (path[0] === '[') {\n path = path.replace(/^\\[([^\\]]+)\\]/, '$1');\n }\n return path.\n replace(/\\[/g, '.').\n replace(/\\]/g, '').\n split('.');\n}\nexports.pathParts = pathParts;\n/**\n * Get the value from an object or an array provided a path.\n *\n * @param obj\n * @param path\n * @param def\n */\nfunction get(obj, path, def) {\n var val = pathParts(path).reduce(function (o, k) { return (o || {})[k]; }, obj);\n return (typeof def !== 'undefined' &&\n typeof val === 'undefined') ? def : val;\n}\nexports.get = get;\nfunction property(path) {\n return function (obj) { return get(obj, path); };\n}\nexports.property = property;\nfunction propertyOf(obj) {\n return function (path) { return get(obj, path); };\n}\nexports.propertyOf = propertyOf;\n/**\n * Determine if a value is set.\n *\n * @param obj\n * @param path\n */\nfunction has(obj, path) {\n return get(obj, path, undefined) !== undefined;\n}\nexports.has = has;\n/**\n * Sets the value of an item within an array or object.\n * @param obj\n * @param path\n * @param value\n */\nfunction set(obj, path, value) {\n var parts = pathParts(path);\n parts.reduce(function (o, k, i) {\n if (!isNaN(Number(k))) {\n k = Number(k);\n }\n if ((Array.isArray(o) ? (k >= o.length) : !o.hasOwnProperty(k)) ||\n ((i < (parts.length - 1)) && !Array.isArray(o[k]) && !(0, lang_1.isObject)(o[k]))) {\n o[k] = !isNaN(Number(parts[i + 1])) ? [] : {};\n }\n if (i === (parts.length - 1)) {\n o[k] = value;\n }\n return o[k];\n }, obj);\n return obj;\n}\nexports.set = set;\n;\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n }\n catch (_) {\n return false;\n }\n}\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.\n}\n/**\n * Merge a single object.\n *\n * @param target\n * @param source\n * @returns\n */\nfunction mergeObject(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n if (propertyIsUnsafe(target, key)) {\n return;\n }\n if (propertyIsOnObject(target, key)) {\n target[key] = merge(target[key], source[key]);\n }\n else {\n target[key] = cloneDeep(source[key]);\n }\n }\n }\n return target;\n}\n/**\n * Merge two arrays.\n * @param target\n * @param source\n */\nfunction mergeArray(target, source) {\n source.forEach(function (subSource, index) {\n target[index] = merge(target[index], subSource);\n });\n return target;\n}\n/**\n * Merges a complex data object.\n *\n * @param a\n * @param b\n * @param options\n */\nfunction merge() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var first = args.shift();\n return args.reduce(function (target, source, index) {\n if (!target || (target === source)) {\n return cloneDeep(source);\n }\n else if ((0, lang_1.isArray)(source)) {\n // If there is no target array, then make it one.\n if (!(0, lang_1.isArray)(target)) {\n args[index] = target = [];\n }\n return mergeArray(target, source);\n }\n else if ((0, lang_1.isPlainObject)(source)) {\n return mergeObject(target, source);\n }\n else {\n return cloneDeep(source);\n }\n }, first);\n}\nexports.merge = merge;\n/**\n * Performs a fast clone deep operation.\n *\n * @param obj\n */\nfunction fastCloneDeep(obj) {\n try {\n return JSON.parse(JSON.stringify(obj));\n }\n catch (err) {\n console.log(\"Clone Failed: \".concat(err.message));\n return null;\n }\n}\nexports.fastCloneDeep = fastCloneDeep;\n/**\n * Performs a shallow clone of an object.\n * @param src\n */\nfunction clone(src) {\n if (Array.isArray(src)) { // for arrays\n return __spreadArray([], src, true);\n }\n else {\n return __assign({}, src);\n }\n}\nexports.clone = clone;\n/**\n * Performs a recursive cloneDeep operation.\n * @param src\n * @returns\n */\nfunction cloneDeep(src) {\n if (Array.isArray(src)) { // for arrays\n return src.map(cloneDeep);\n }\n if (src === null || typeof src !== 'object') { // for primitives / functions / non-references/pointers\n return src;\n }\n return Object.fromEntries(Object.entries(src).map(function (_a) {\n var key = _a[0], val = _a[1];\n return ([key, cloneDeep(val)]);\n }));\n}\nexports.cloneDeep = cloneDeep;\n/**\n * Sets the defaults of an object.\n *\n * @param obj\n * @param defs\n */\nfunction defaults(obj, defs) {\n (0, array_1.each)(defs, function (value, key) {\n if (!obj.hasOwnProperty(key)) {\n obj[key] = value;\n }\n });\n return obj;\n}\nexports.defaults = defaults;\n/**\n * Pick an item in an object.\n * @param object\n * @param keys\n */\nfunction pick(object, keys) {\n return keys.reduce(function (obj, key) {\n if (object && object.hasOwnProperty(key)) {\n obj[key] = object[key];\n }\n return obj;\n }, {});\n}\nexports.pick = pick;\n;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/object.js?");
|
140
|
-
|
141
|
-
/***/ }),
|
142
|
-
|
143
|
-
/***/ "./node_modules/@formio/lodash/lib/string.js":
|
144
|
-
/*!***************************************************!*\
|
145
|
-
!*** ./node_modules/@formio/lodash/lib/string.js ***!
|
146
|
-
\***************************************************/
|
88
|
+
/***/ "./node_modules/abortcontroller-polyfill/dist/cjs-ponyfill.js":
|
89
|
+
/*!********************************************************************!*\
|
90
|
+
!*** ./node_modules/abortcontroller-polyfill/dist/cjs-ponyfill.js ***!
|
91
|
+
\********************************************************************/
|
147
92
|
/***/ (function(__unused_webpack_module, exports) {
|
148
93
|
|
149
94
|
"use strict";
|
150
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.endsWith = exports.trim = void 0;\n// From https://youmightnotneed.com/lodash/#trim\nfunction trim(str, c) {\n if (c === void 0) { c = '\\\\s'; }\n return str.replace(new RegExp(\"^([\".concat(c, \"]*)(.*?)([\").concat(c, \"]*)$\")), '$2');\n}\nexports.trim = trim;\n// Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function (search, this_len) {\n if (this_len === undefined || this_len > this.length) {\n this_len = this.length;\n }\n // @ts-ignore: Object is possibly 'undefined'\n return this.substring(this_len - search.length, this_len) === search;\n };\n}\n// From https://youmightnotneed.com/lodash/#endsWith\nfunction endsWith(str, c) {\n return str.endsWith(c);\n}\nexports.endsWith = endsWith;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/lodash/lib/string.js?");
|
95
|
+
eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get.bind();\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get.apply(this, arguments);\n}\n\nvar Emitter = /*#__PURE__*/function () {\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n Object.defineProperty(this, 'listeners', {\n value: {},\n writable: true,\n configurable: true\n });\n }\n\n _createClass(Emitter, [{\n key: \"addEventListener\",\n value: function addEventListener(type, callback, options) {\n if (!(type in this.listeners)) {\n this.listeners[type] = [];\n }\n\n this.listeners[type].push({\n callback: callback,\n options: options\n });\n }\n }, {\n key: \"removeEventListener\",\n value: function removeEventListener(type, callback) {\n if (!(type in this.listeners)) {\n return;\n }\n\n var stack = this.listeners[type];\n\n for (var i = 0, l = stack.length; i < l; i++) {\n if (stack[i].callback === callback) {\n stack.splice(i, 1);\n return;\n }\n }\n }\n }, {\n key: \"dispatchEvent\",\n value: function dispatchEvent(event) {\n if (!(event.type in this.listeners)) {\n return;\n }\n\n var stack = this.listeners[event.type];\n var stackToCall = stack.slice();\n\n for (var i = 0, l = stackToCall.length; i < l; i++) {\n var listener = stackToCall[i];\n\n try {\n listener.callback.call(this, event);\n } catch (e) {\n Promise.resolve().then(function () {\n throw e;\n });\n }\n\n if (listener.options && listener.options.once) {\n this.removeEventListener(event.type, listener.callback);\n }\n }\n\n return !event.defaultPrevented;\n }\n }]);\n\n return Emitter;\n}();\n\nvar AbortSignal = /*#__PURE__*/function (_Emitter) {\n _inherits(AbortSignal, _Emitter);\n\n var _super = _createSuper(AbortSignal);\n\n function AbortSignal() {\n var _this;\n\n _classCallCheck(this, AbortSignal);\n\n _this = _super.call(this); // Some versions of babel does not transpile super() correctly for IE <= 10, if the parent\n // constructor has failed to run, then \"this.listeners\" will still be undefined and then we call\n // the parent constructor directly instead as a workaround. For general details, see babel bug:\n // https://github.com/babel/babel/issues/3041\n // This hack was added as a fix for the issue described here:\n // https://github.com/Financial-Times/polyfill-library/pull/59#issuecomment-477558042\n\n if (!_this.listeners) {\n Emitter.call(_assertThisInitialized(_this));\n } // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and\n // we want Object.keys(new AbortController().signal) to be [] for compat with the native impl\n\n\n Object.defineProperty(_assertThisInitialized(_this), 'aborted', {\n value: false,\n writable: true,\n configurable: true\n });\n Object.defineProperty(_assertThisInitialized(_this), 'onabort', {\n value: null,\n writable: true,\n configurable: true\n });\n Object.defineProperty(_assertThisInitialized(_this), 'reason', {\n value: undefined,\n writable: true,\n configurable: true\n });\n return _this;\n }\n\n _createClass(AbortSignal, [{\n key: \"toString\",\n value: function toString() {\n return '[object AbortSignal]';\n }\n }, {\n key: \"dispatchEvent\",\n value: function dispatchEvent(event) {\n if (event.type === 'abort') {\n this.aborted = true;\n\n if (typeof this.onabort === 'function') {\n this.onabort.call(this, event);\n }\n }\n\n _get(_getPrototypeOf(AbortSignal.prototype), \"dispatchEvent\", this).call(this, event);\n }\n }]);\n\n return AbortSignal;\n}(Emitter);\nvar AbortController = /*#__PURE__*/function () {\n function AbortController() {\n _classCallCheck(this, AbortController);\n\n // Compared to assignment, Object.defineProperty makes properties non-enumerable by default and\n // we want Object.keys(new AbortController()) to be [] for compat with the native impl\n Object.defineProperty(this, 'signal', {\n value: new AbortSignal(),\n writable: true,\n configurable: true\n });\n }\n\n _createClass(AbortController, [{\n key: \"abort\",\n value: function abort(reason) {\n var event;\n\n try {\n event = new Event('abort');\n } catch (e) {\n if (typeof document !== 'undefined') {\n if (!document.createEvent) {\n // For Internet Explorer 8:\n event = document.createEventObject();\n event.type = 'abort';\n } else {\n // For Internet Explorer 11:\n event = document.createEvent('Event');\n event.initEvent('abort', false, false);\n }\n } else {\n // Fallback where document isn't available:\n event = {\n type: 'abort',\n bubbles: false,\n cancelable: false\n };\n }\n }\n\n var signalReason = reason;\n\n if (signalReason === undefined) {\n if (typeof document === 'undefined') {\n signalReason = new Error('This operation was aborted');\n signalReason.name = 'AbortError';\n } else {\n try {\n signalReason = new DOMException('signal is aborted without reason');\n } catch (err) {\n // IE 11 does not support calling the DOMException constructor, use a\n // regular error object on it instead.\n signalReason = new Error('This operation was aborted');\n signalReason.name = 'AbortError';\n }\n }\n }\n\n this.signal.reason = signalReason;\n this.signal.dispatchEvent(event);\n }\n }, {\n key: \"toString\",\n value: function toString() {\n return '[object AbortController]';\n }\n }]);\n\n return AbortController;\n}();\n\nif (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n // These are necessary to make sure that we get correct output for:\n // Object.prototype.toString.call(new AbortController())\n AbortController.prototype[Symbol.toStringTag] = 'AbortController';\n AbortSignal.prototype[Symbol.toStringTag] = 'AbortSignal';\n}\n\nfunction polyfillNeeded(self) {\n if (self.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {\n console.log('__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill');\n return true;\n } // Note that the \"unfetch\" minimal fetch polyfill defines fetch() without\n // defining window.Request, and this polyfill need to work on top of unfetch\n // so the below feature detection needs the !self.AbortController part.\n // The Request.prototype check is also needed because Safari versions 11.1.2\n // up to and including 12.1.x has a window.AbortController present but still\n // does NOT correctly implement abortable fetch:\n // https://bugs.webkit.org/show_bug.cgi?id=174980#c2\n\n\n return typeof self.Request === 'function' && !self.Request.prototype.hasOwnProperty('signal') || !self.AbortController;\n}\n\n/**\n * Note: the \"fetch.Request\" default value is available for fetch imported from\n * the \"node-fetch\" package and not in browsers. This is OK since browsers\n * will be importing umd-polyfill.js from that path \"self\" is passed the\n * decorator so the default value will not be used (because browsers that define\n * fetch also has Request). One quirky setup where self.fetch exists but\n * self.Request does not is when the \"unfetch\" minimal fetch polyfill is used\n * on top of IE11; for this case the browser will try to use the fetch.Request\n * default value which in turn will be undefined but then then \"if (Request)\"\n * will ensure that you get a patched fetch but still no Request (as expected).\n * @param {fetch, Request = fetch.Request}\n * @returns {fetch: abortableFetch, Request: AbortableRequest}\n */\n\nfunction abortableFetchDecorator(patchTargets) {\n if ('function' === typeof patchTargets) {\n patchTargets = {\n fetch: patchTargets\n };\n }\n\n var _patchTargets = patchTargets,\n fetch = _patchTargets.fetch,\n _patchTargets$Request = _patchTargets.Request,\n NativeRequest = _patchTargets$Request === void 0 ? fetch.Request : _patchTargets$Request,\n NativeAbortController = _patchTargets.AbortController,\n _patchTargets$__FORCE = _patchTargets.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,\n __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL = _patchTargets$__FORCE === void 0 ? false : _patchTargets$__FORCE;\n\n if (!polyfillNeeded({\n fetch: fetch,\n Request: NativeRequest,\n AbortController: NativeAbortController,\n __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL: __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL\n })) {\n return {\n fetch: fetch,\n Request: Request\n };\n }\n\n var Request = NativeRequest; // Note that the \"unfetch\" minimal fetch polyfill defines fetch() without\n // defining window.Request, and this polyfill need to work on top of unfetch\n // hence we only patch it if it's available. Also we don't patch it if signal\n // is already available on the Request prototype because in this case support\n // is present and the patching below can cause a crash since it assigns to\n // request.signal which is technically a read-only property. This latter error\n // happens when you run the main5.js node-fetch example in the repo\n // \"abortcontroller-polyfill-examples\". The exact error is:\n // request.signal = init.signal;\n // ^\n // TypeError: Cannot set property signal of #<Request> which has only a getter\n\n if (Request && !Request.prototype.hasOwnProperty('signal') || __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {\n Request = function Request(input, init) {\n var signal;\n\n if (init && init.signal) {\n signal = init.signal; // Never pass init.signal to the native Request implementation when the polyfill has\n // been installed because if we're running on top of a browser with a\n // working native AbortController (i.e. the polyfill was installed due to\n // __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL being set), then passing our\n // fake AbortSignal to the native fetch will trigger:\n // TypeError: Failed to construct 'Request': member signal is not of type AbortSignal.\n\n delete init.signal;\n }\n\n var request = new NativeRequest(input, init);\n\n if (signal) {\n Object.defineProperty(request, 'signal', {\n writable: false,\n enumerable: false,\n configurable: true,\n value: signal\n });\n }\n\n return request;\n };\n\n Request.prototype = NativeRequest.prototype;\n }\n\n var realFetch = fetch;\n\n var abortableFetch = function abortableFetch(input, init) {\n var signal = Request && Request.prototype.isPrototypeOf(input) ? input.signal : init ? init.signal : undefined;\n\n if (signal) {\n var abortError;\n\n try {\n abortError = new DOMException('Aborted', 'AbortError');\n } catch (err) {\n // IE 11 does not support calling the DOMException constructor, use a\n // regular error object on it instead.\n abortError = new Error('Aborted');\n abortError.name = 'AbortError';\n } // Return early if already aborted, thus avoiding making an HTTP request\n\n\n if (signal.aborted) {\n return Promise.reject(abortError);\n } // Turn an event into a promise, reject it once `abort` is dispatched\n\n\n var cancellation = new Promise(function (_, reject) {\n signal.addEventListener('abort', function () {\n return reject(abortError);\n }, {\n once: true\n });\n });\n\n if (init && init.signal) {\n // Never pass .signal to the native implementation when the polyfill has\n // been installed because if we're running on top of a browser with a\n // working native AbortController (i.e. the polyfill was installed due to\n // __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL being set), then passing our\n // fake AbortSignal to the native fetch will trigger:\n // TypeError: Failed to execute 'fetch' on 'Window': member signal is not of type AbortSignal.\n delete init.signal;\n } // Return the fastest promise (don't need to wait for request to finish)\n\n\n return Promise.race([cancellation, realFetch(input, init)]);\n }\n\n return realFetch(input, init);\n };\n\n return {\n fetch: abortableFetch,\n Request: Request\n };\n}\n\nexports.AbortController = AbortController;\nexports.AbortSignal = AbortSignal;\nexports.abortableFetch = abortableFetchDecorator;\n\n\n//# sourceURL=webpack://Formio/./node_modules/abortcontroller-polyfill/dist/cjs-ponyfill.js?");
|
151
96
|
|
152
97
|
/***/ }),
|
153
98
|
|
@@ -469,7 +414,7 @@ eval("var baseToString = __webpack_require__(/*! ./_baseToString */ \"./node_mod
|
|
469
414
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
470
415
|
|
471
416
|
"use strict";
|
472
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = exports.FormioPathType = void 0;\nconst fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nconst lodash_1 = __webpack_require__(/*! @formio/lodash */ \"./node_modules/@formio/lodash/lib/index.js\");\nconst formUtil_1 = __webpack_require__(/*! ../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst jwtDecode_1 = __webpack_require__(/*! ../utils/jwtDecode */ \"./node_modules/@formio/core/lib/utils/jwtDecode.js\");\nconst eventemitter3_1 = __importDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\"));\nconst browser_cookies_1 = __importDefault(__webpack_require__(/*! browser-cookies */ \"./node_modules/browser-cookies/src/browser-cookies.js\"));\nconst { fetch, Headers } = (0, fetch_ponyfill_1.default)();\nconst Plugins_1 = __importDefault(__webpack_require__(/*! ./Plugins */ \"./node_modules/@formio/core/lib/sdk/Plugins.js\"));\n/**\n * The different path types for a project.\n */\nvar FormioPathType;\n(function (FormioPathType) {\n FormioPathType[\"Subdirectories\"] = \"Subdirectories\";\n FormioPathType[\"Subdomains\"] = \"Subdomains\";\n})(FormioPathType || (exports.FormioPathType = FormioPathType = {}));\n/**\n * The Formio interface class. This is a minimalistic API library that allows you to work with the Form.io API's within JavaScript.\n *\n * ## Usage\n * Creating an instance of Formio is simple, and takes only a path (URL String). The path can be different, depending on the desired output.\n * The Formio instance can also access higher level operations, depending on how granular of a path you start with.\n *\n * ```ts\n * var formio = new Formio(<endpoint>, [options]);\n * ```\n *\n * Where **endpoint** is any valid API endpoint within Form.io. These URL's can provide a number of different methods depending on the granularity of the endpoint. This allows you to use the same interface but have access to different methods depending on how granular the endpoint url is.\n * **options** is defined within the {link Formio.constructor} documentation.\n *\n * Here is an example of how this library can be used to load a form JSON from the Form.io API's\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n */\nclass Formio {\n /* eslint-disable max-statements */\n /**\n * @constructor\n * @param {string} path - A project, form, and submission API Url.\n * @param {FormioOptions} options - Available options to configure the Javascript API.\n */\n constructor(path, options = {}) {\n this.path = path;\n this.options = options;\n /**\n * The base API url of the Form.io Platform. Example: https://api.form.io\n */\n this.base = '';\n /**\n * The Projects Endpoint derived from the provided source.\n *\n * @example https://api.form.io/project\n */\n this.projectsUrl = '';\n /**\n * A specific project endpoint derived from the provided source.\n *\n * @example https://examples.form.io\n */\n this.projectUrl = '';\n /**\n * The Project ID found within the provided source.\n */\n this.projectId = '';\n /**\n * A specific Role URL provided the source.\n *\n * @example https://examples.form.io/role/2342343234234234\n */\n this.roleUrl = '';\n /**\n * The roles endpoint derived from the provided source.\n *\n * @example https://examples.form.io/role\n */\n this.rolesUrl = '';\n /**\n * The roleID derieved from the provided source.\n */\n this.roleId = '';\n /**\n * A specific form url derived from the provided source.\n *\n * @example https://examples.form.io/example\n */\n this.formUrl = '';\n /**\n * The forms url derived from the provided source.\n *\n * @example https://example.form.io/form\n */\n this.formsUrl = '';\n /**\n * The Form ID derived from the provided source.\n */\n this.formId = '';\n /**\n * The submissions URL derived from the provided source.\n *\n * @example https://examples.form.io/example/submission\n */\n this.submissionsUrl = '';\n /**\n * A specific submissions URL derived from a provided source.\n *\n * @example https://examples.form.io/example/submission/223423423423\n */\n this.submissionUrl = '';\n /**\n * The submission ID provided a submission url.\n */\n this.submissionId = '';\n /**\n * The actions url provided a form url as the source.\n *\n * @example https://examples.form.io/example/action\n */\n this.actionsUrl = '';\n /**\n * The Action ID derived from a provided Action url.\n */\n this.actionId = '';\n /**\n * A specific action api endoint.\n */\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n /**\n * The query string derived from the provided src url.\n */\n this.query = '';\n /**\n * If this is a non-project url, such is the case for Open Source API.\n */\n this.noProject = false;\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n if (options.useSessionToken) {\n Formio.useSessionToken(options);\n }\n if (options.hasOwnProperty('base') && options.base) {\n this.base = options.base;\n }\n else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n }\n else if (window && window.location) {\n const match = window.location.href.match(/http[s]?:\\/\\/api./);\n this.base = match ? match[0] : window.location.origin;\n }\n if (!path) {\n // Allow user to create new projects if this was instantiated without\n // a url\n this.projectUrl = Formio.projectUrl || `${this.base}/project`;\n this.projectsUrl = `${this.base}/project`;\n this.projectId = '';\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('project') && options.project) {\n this.projectUrl = options.project;\n }\n const project = this.projectUrl || Formio.projectUrl;\n const projectRegEx = /(^|\\/)(project)($|\\/[^/]+)/;\n const isProjectUrl = (path.search(projectRegEx) !== -1);\n // The baseURL is the same as the projectUrl, and does not contain \"/project/MONGO_ID\" in\n // its domain. This is almost certainly against the Open Source server.\n if (project && this.base === project && !isProjectUrl) {\n this.noProject = true;\n this.projectUrl = this.base;\n }\n // Normalize to an absolute path.\n if ((path.indexOf('http') !== 0) && (path.indexOf('//') !== 0)) {\n path = this.base + path;\n }\n const hostparts = this.getUrlParts(path);\n let hostName = '';\n let parts = [];\n if (hostparts) {\n hostName = hostparts[1] + hostparts[2];\n path = hostparts.length > 3 ? hostparts[3] : '';\n const queryparts = path.split('?');\n if (queryparts.length > 1) {\n path = queryparts[0];\n this.query = `?${queryparts[1]}`;\n }\n }\n // Register a specific path.\n const registerPath = (name, base) => {\n this[`${name}sUrl`] = `${base}/${name}`;\n const regex = new RegExp(`/${name}/([^/]+)`);\n if (path && path.search(regex) !== -1) {\n parts = path.match(regex);\n this[`${name}Url`] = parts ? (base + parts[0]) : '';\n this[`${name}Id`] = (parts.length > 1) ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n // Register an array of items.\n const registerItems = (items, base, staticBase) => {\n for (const i in items) {\n if (items.hasOwnProperty(i)) {\n const item = items[i];\n if (Array.isArray(item)) {\n registerItems(item, base, true);\n }\n else {\n const newBase = registerPath(item, base);\n base = staticBase ? base : newBase;\n }\n }\n }\n };\n if (!this.projectUrl || (this.projectUrl === this.base)) {\n // If a project uses Subdirectories path type, we need to specify a projectUrl\n if (!this.projectUrl && !isProjectUrl && Formio.pathType === 'Subdirectories') {\n const regex = `^${hostName.replace(/\\//g, '\\\\/')}.[^/]+`;\n const match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\n }\n else {\n this.projectUrl = hostName;\n }\n }\n // Check if we have a specified path type.\n let isNotSubdomainType = false;\n if (Formio.pathType) {\n isNotSubdomainType = Formio.pathType !== 'Subdomains';\n }\n if (!this.noProject) {\n // Determine the projectUrl and projectId\n if (isProjectUrl) {\n // Get project id as project/:projectId.\n registerItems(['project'], hostName);\n path = path.replace(projectRegEx, '');\n }\n else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts && hostparts.length > 3 && path.split('/').length > 1) {\n const isFile = path.match(/.json/);\n const pathParts = path.split('/');\n if (isFile) {\n this.projectUrl = hostName;\n }\n else {\n pathParts.shift(); // Throw away the first /.\n const projectId = pathParts.shift();\n if (projectId) {\n this.projectId = projectId;\n path = `/${pathParts.join('/')}`;\n this.projectUrl = `${hostName}/${this.projectId}`;\n }\n }\n }\n }\n else {\n // Get project id from subdomain.\n if (hostparts && hostparts.length > 2 && (hostparts[2].split('.').length > 2 || hostName.includes('localhost')) && !isNotSubdomainType) {\n this.projectUrl = hostName;\n this.projectId = hostparts[2].split('.')[0];\n }\n }\n this.projectsUrl = this.projectsUrl || `${this.base}/project`;\n }\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n }\n else {\n const subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n const subs = path.match(subRegEx);\n if ((subs && (subs.length > 1))) {\n this.pathType = subs[1];\n }\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = `${this.projectUrl}/form`;\n this.formUrl = path ? this.projectUrl + path : '';\n this.formId = path.replace(/^\\/+|\\/+$/g, '');\n const items = ['submission', 'action', 'v'];\n for (const i in items) {\n if (items.hasOwnProperty(i)) {\n const item = items[i];\n this[`${item}sUrl`] = `${this.projectUrl + path}/${item}`;\n if ((this.pathType === item) && subs && (subs.length > 2) && subs[2]) {\n this[`${item}Id`] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[`${item}Url`] = this.projectUrl + path + subs[0];\n }\n }\n }\n }\n // Set the app url if it is not set.\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = this.projectUrl;\n }\n }\n /* eslint-enable max-statements */\n /**\n * Deletes a remote resource of any provided type.\n *\n * @param {string} type - The type of resource to delete. \"submission\", \"form\", etc.\n * @param {object} options - The options passed to {@link Formio.request}\n * @return {Promise<Response>}\n */\n delete(type, opts) {\n const _id = `${type}Id`;\n const _url = `${type}Url`;\n if (!this[_id]) {\n return Promise.reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n }\n /**\n * Returns the index (array of records) for any provided type.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} query - A query object to pass to the request.\n * @param {object} query.params - A map (key-value pairs) of URL query parameters to add to the url.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n index(type, query, opts) {\n const _url = `${type}Url`;\n query = query || '';\n if (query && (0, lodash_1.isObject)(query)) {\n query = `?${Formio.serialize(query.params)}`;\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n }\n /**\n * Save a document record using \"upsert\". If the document does not exist, it will be created, if the _id is provided,\n * it will be updated.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} data - The resource data object.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n save(type, data, opts) {\n const _id = `${type}Id`;\n const _url = `${type}Url`;\n const method = (this[_id] || data._id) ? 'put' : 'post';\n let reqUrl = this[_id] ? this[_url] : this[`${type}sUrl`];\n if (!this[_id] && data._id && (method === 'put') && !reqUrl.includes(data._id)) {\n reqUrl += `/${data._id}`;\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n }\n /**\n * @summary Load (GET) a document record.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} query - A query object to pass to the request.\n * @param {object} query.params - A map (key-value pairs) of URL query parameters to add to the url.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n load(type, query, opts) {\n const _id = `${type}Id`;\n const _url = `${type}Url`;\n if (query && (0, lodash_1.isObject)(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? (`${this.query}&${query}`) : (`?${query}`);\n }\n else {\n query = this.query;\n }\n if (!this[_id]) {\n return Promise.reject(`Missing ${_id}`);\n }\n let url = this[_url] + query;\n if (type === 'form' && !isNaN(parseInt(this.vId))) {\n url += url.indexOf('?') === -1 ? '?' : '&';\n url += `formRevision=${this.vId}`;\n }\n return this.makeRequest(type, url, 'get', null, opts);\n }\n /**\n * @summary Call {@link Formio.makeRequest} for this Formio instance.\n *\n * @param {string} type - The request resource type. \"submission\", \"form\", etc.\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise<Response>}\n */\n makeRequest(type, url, method, data, opts) {\n return Formio.makeRequest(this, type, url, method, data, opts);\n }\n /**\n * @summary Loads a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadProject().then((project) => {\n * console.log(project);\n * });\n * ```\n *\n * @param {object} query - Query parameters to pass to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n loadProject(query, opts) {\n return this.load('project', query, opts);\n }\n /**\n * Saves or Updates a project.\n *\n * ### Create a new project\n * ```ts\n * const formio = new Formio();\n * formio.saveProject({\n * title: 'My Project',\n * path: 'myproject',\n * name: 'myproject'\n * });\n * ```\n *\n * ### Update an existing project\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadProject().then((project) => {\n * project.title = 'Title changed';\n * formio.saveProject(project).then(() => {\n * console.log('Done saving project!');\n * });\n * });\n * ```\n *\n * @param {object} data - The project JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveProject(data, opts) {\n return this.save('project', data, opts);\n }\n /**\n * Deletes a project\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.deleteProject();\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n deleteProject(opts) {\n return this.delete('project', opts);\n }\n /**\n * Loads a list of all projects.\n *\n * ```ts\n * Formio.loadProjects().then((projects) => {\n * console.log(projects);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {*}\n */\n static loadProjects(query, opts) {\n query = query || '';\n if ((0, lodash_1.isObject)(query)) {\n query = `?${Formio.serialize(query.params)}`;\n }\n return Formio.makeStaticRequest(`${Formio.baseUrl}/project${query}`, 'GET', null, opts);\n }\n /**\n * Loads a role within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/role/234234234234');\n * formio.loadRole().then((role) => {\n * console.log(role);\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n loadRole(opts) {\n return this.load('role', null, opts);\n }\n /**\n * Create a new or Update an existing role within a project.\n *\n * ### Create new Role example\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.saveRole({\n * title: 'Employee',\n * description: 'A person who belongs to a company.'\n * }).then((role) => {\n * console.log(role);\n * });\n * ```\n *\n * ### Update existing role example\n * ```ts\n * const formio = new Formio('https://examples.form.io/role/234234234234234');\n * formio.loadRole().then((role) => {\n * role.title = 'Manager';\n * formio.saveRole(role).then(() => {\n * console.log('DONE');\n * });\n * });\n * ```\n *\n * @param {object} role - The Role JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveRole(data, opts) {\n return this.save('role', data, opts);\n }\n /**\n * Deletes a role within a project.\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteRole(opts) {\n return this.delete('role', opts);\n }\n /**\n * Load all roles within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadRoles().then((roles) => {\n * console.log(roles);\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadRoles(opts) {\n return this.index('roles', null, opts);\n }\n /**\n * Loads a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n loadForm(query, opts) {\n return this.load('form', query, opts)\n .then((currentForm) => {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(this.vId))) {\n return currentForm;\n }\n // If a submission already exists but form is marked to load current version of form.\n if (currentForm.revisions === 'current' && this.submissionId) {\n return currentForm;\n }\n // eslint-disable-next-line eqeqeq\n if (currentForm._vid == this.vId || currentForm.revisionId === this.vId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && (0, lodash_1.isObject)(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? (`${this.query}&${query}`) : (`?${query}`);\n }\n else {\n query = this.query;\n }\n return this.makeRequest('form', this.vUrl + query, 'get', null, opts)\n .then((revisionForm) => {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n currentForm.revisionId = revisionForm.revisionId;\n // Using object.assign so we don't cross polinate multiple form loads.\n return Object.assign({}, currentForm);\n })\n // If we couldn't load the revision, just return the original form.\n .catch(() => Object.assign({}, currentForm));\n });\n }\n /**\n * Create or Update a specific form.\n *\n * ### Create form example\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.saveForm({\n * title: 'Employee',\n * type: 'resource',\n * path: 'employee',\n * name: 'employee',\n * components: [\n * {\n * type: 'textfield',\n * key: 'firstName',\n * label: 'First Name'\n * },\n * {\n * type: 'textfield',\n * key: 'lastName',\n * label: 'Last Name'\n * }\n * ]\n * });\n * ```\n *\n * ### Update a form example\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * form.title = 'Changed Title';\n * formio.saveForm(form).then(() => {\n * console.log('DONE!!!');\n * });\n * });\n * ```\n *\n * @param {object} data - The Form JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveForm(data, opts) {\n return this.save('form', data, opts);\n }\n /**\n * Deletes a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.deleteForm().then(() => {\n * console.log('Deleted!');\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteForm(opts) {\n return this.delete('form', opts);\n }\n /**\n * Loads all forms within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadForms().then((forms) => {\n * console.log(forms);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadForms(query, opts) {\n return this.index('forms', query, opts);\n }\n /**\n * Loads a specific submissionn.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/23423423423423423');\n * formio.loadSubmission().then((submission) => {\n * console.log(submission);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n loadSubmission(query, opts) {\n return this.load('submission', query, opts)\n .then((submission) => {\n this.vId = submission._frid || submission._fvid;\n this.vUrl = `${this.formUrl}/v/${this.vId}`;\n return submission;\n });\n }\n /**\n * Creates a new or Updates an existing submission.\n *\n * ### Create a new submission\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.saveSubmission({\n * data: {\n * firstName: 'Joe',\n * lastName: 'Smith'\n * }\n * }).then((submission) => {\n * // This will now be the complete submission object saved on the server.\n * console.log(submission);\n * });\n * ```\n *\n * ### Update an existing submission\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/23423423423423423');\n * formio.loadSubmission().then((submission) => {\n * submission.data.lastName = 'Thompson';\n * formio.saveSubmission(submission).then(() => {\n * console.log('DONE');\n * });\n * });\n * ```\n *\n * @param {object} data - The submission JSON object.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveSubmission(data, opts) {\n if (!isNaN(parseInt(this.vId)) && !data._fvid) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n }\n /**\n * Deletes a submission.\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteSubmission(opts) {\n return this.delete('submission', opts);\n }\n /**\n * Loads all submissions within a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadSubmissions({\n * params: {\n * limit: 25,\n * 'data.lastName__regex': 'smith'\n * }\n * }).then((submissions) => {\n * // Should print out 25 submissions where the last name contains \"smith\".\n * console.log(submissions);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadSubmissions(query, opts) {\n return this.index('submissions', query, opts);\n }\n /**\n * Loads a form action.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.loadAction().then((action) => {\n * console.log(action);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n loadAction(query, opts) {\n return this.load('action', query, opts);\n }\n /**\n * Create a new or update an existing action.\n *\n * ### Create a new action for a form.\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.saveAction({\n * data: {\n * name: 'webhook',\n * title: 'Webhook Action',\n * method: ['create', 'update', 'delete'],\n * handler: ['after'],\n * condition: {},\n * settings: {\n * url: 'https://example.com',\n * headers: [{}],\n * block: false,\n * forwardHeaders: false\n * }\n * }\n * }).then((action) => {\n * console.log(action);\n * });\n * ```\n *\n * ### Update an action\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.loadAction().then((action) => {\n * action.title = 'Updated title';\n * formio.saveAction(action).then(() => {\n * console.log('Done!');\n * });\n * });\n * ```\n *\n * @param {object} data - The action JSON\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveAction(data, opts) {\n return this.save('action', data, opts);\n }\n /**\n * Delete an action\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.deleteAction().then(() => {\n * console.log('Action was deleted.');\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteAction(opts) {\n return this.delete('action', opts);\n }\n /**\n * Loads all actions within a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadActions().then((actions) => {\n * console.log(actions);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadActions(query, opts) {\n return this.index('actions', query, opts);\n }\n /**\n * Returns a list of available actions\n *\n * @return {Promise<Response>}\n */\n availableActions() {\n return this.makeRequest('availableActions', `${this.formUrl}/actions`);\n }\n /**\n * Returns the action information for a specific action, such as \"save\".\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/actions/save');\n * formio.actionInfo().then((info) => {\n * console.log(info);\n * });\n * ```\n *\n * @param {string} name - The name of the action you would like to get information for. i.e. \"save\", \"webhook\", etc.\n * @return {Promise<Response>}\n */\n actionInfo(name) {\n return this.makeRequest('actionInfo', `${this.formUrl}/actions/${name}`);\n }\n /**\n * Determine if a string ID is a valid MongoID.\n *\n * @param {string} id - The id that should be tested if it is avalid id.\n * @return {boolean} - true if it is a valid MongoId, false otherwise.\n */\n isObjectId(id) {\n const checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n }\n /**\n * Get the project ID of project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.getProjectId().then((projectId) => {\n * console.log(projectId);\n * };\n * ```\n *\n * @return {Promise<string>}\n */\n getProjectId() {\n if (!this.projectId) {\n return Promise.resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return Promise.resolve(this.projectId);\n }\n else {\n return this.loadProject().then((project) => {\n return project._id;\n });\n }\n }\n /**\n * Get the ID of a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.getFormId().then((formId) => {\n * console.log(formId);\n * });\n * ```\n *\n * @return {Promise<string>}\n */\n getFormId() {\n if (!this.formId) {\n return Promise.resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return Promise.resolve(this.formId);\n }\n else {\n return this.loadForm().then((form) => {\n return form._id;\n });\n }\n }\n /**\n * Instance method for {@link Formio.currentUser}\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n currentUser(options) {\n return Formio.currentUser(this, options);\n }\n /**\n * Instance method for {@link Formio.accessInfo}\n *\n * @return {Promise<Response>}\n */\n accessInfo() {\n return Formio.accessInfo(this);\n }\n /**\n * Sets OAuth Logout URL.\n *\n * @param {string} uri - Logout URL.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string}\n */\n oauthLogoutURI(uri, options) {\n return Formio.oauthLogoutURI(uri, Object.assign({ formio: this }, this.options, options));\n }\n /**\n * Returns the JWT token for this instance.\n *\n * @param {object} options - The following options are provided.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string} - The JWT token for this user.\n */\n getToken(options) {\n return Formio.getToken(Object.assign({ formio: this }, this.options, options));\n }\n /**\n * Sets the JWT token for this instance.\n *\n * @param {string} token - The JWT token to set.\n * @param {object} options - The following options are provided.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string} - The JWT token that was set.\n */\n setToken(token, options) {\n return Formio.setToken(token, Object.assign({ formio: this }, this.options, options));\n }\n /**\n * Returns a temporary authentication token for single purpose token generation.\n *\n * @param {number|string} expire - The amount of seconds to wait before this temp token expires.\n * @param {string} allowed - The allowed path string inn the format GET:/path\n * @param {object} options - The options passed to {@link Formio#getToken}\n */\n getTempToken(expire, allowed, options) {\n const token = Formio.getToken(options);\n if (!token) {\n return Promise.reject('You must be authenticated to generate a temporary auth token.');\n }\n const authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', `${authUrl}/token`, 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n }\n /**\n * Get a PDF download url for a submission, which will generate a new PDF of the submission. This method will first\n * fetch a temporary download token, and then append this to the download url for this form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/324234234234234');\n * formio.getDownloadUrl().then((url) => {\n * console.log(url);\n * });\n * ```\n *\n * @param {object} [form] - The form JSON to fetch a download url for.\n * @return {Promise<string>} - The download url.\n */\n getDownloadUrl(form) {\n if (!this.submissionId) {\n return Promise.resolve('');\n }\n if (!form) {\n // Make sure to load the form first.\n return this.loadForm().then((_form) => {\n if (!_form) {\n return '';\n }\n return this.getDownloadUrl(_form);\n });\n }\n let apiUrl = `/project/${form.project}`;\n apiUrl += `/form/${form._id}`;\n apiUrl += `/submission/${this.submissionId}`;\n const postfix = form.submissionRevisions && form.settings.changeLog ? '/download/changelog' : '/download';\n apiUrl += postfix;\n let download = this.base + apiUrl;\n return new Promise((resolve, reject) => {\n this.getTempToken(3600, `GET:${apiUrl}`).then((tempToken) => {\n download += `?token=${tempToken.key}`;\n resolve(download);\n }, () => {\n resolve(download);\n }).catch(reject);\n });\n }\n /**\n * Returns the user permissions to a form and submission.\n *\n * @param user - The user or current user if undefined. For anonymous, use \"null\"\n * @param form - The form or current form if undefined. For no form check, use \"null\"\n * @param submission - The submisison or \"index\" if undefined.\n *\n * @return {{create: boolean, read: boolean, edit: boolean, delete: boolean}}\n */\n userPermissions(user, form, submission) {\n return Promise.all([\n (form !== undefined) ? Promise.resolve(form) : this.loadForm(),\n (user !== undefined) ? Promise.resolve(user) : this.currentUser(),\n (submission !== undefined || !this.submissionId) ? Promise.resolve(submission) : this.loadSubmission(),\n this.accessInfo()\n ]).then((results) => {\n const form = results.shift();\n const user = results.shift() || { _id: false, roles: [] };\n const submission = results.shift();\n const access = results.shift();\n const permMap = {\n create: 'create',\n read: 'read',\n update: 'edit',\n delete: 'delete'\n };\n const perms = {\n user: user,\n form: form,\n access: access,\n create: false,\n read: false,\n edit: false,\n delete: false\n };\n for (const roleName in access.roles) {\n if (access.roles.hasOwnProperty(roleName)) {\n const role = access.roles[roleName];\n if (role.default && (user._id === false)) {\n // User is anonymous. Add the anonymous role.\n user.roles.push(role._id);\n }\n else if (role.admin && user.roles.indexOf(role._id) !== -1) {\n perms.create = true;\n perms.read = true;\n perms.delete = true;\n perms.edit = true;\n return perms;\n }\n }\n }\n if (form && form.submissionAccess) {\n for (let i = 0; i < form.submissionAccess.length; i++) {\n const permission = form.submissionAccess[i];\n const [perm, scope] = permission.type.split('_');\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if ((0, lodash_1.intersection)(permission.roles, user.roles).length) {\n perms[permMap[perm]] = (scope === 'all') || (!submission || (user._id === submission.owner));\n }\n }\n }\n }\n // check for Group Permissions\n if (submission) {\n // we would anyway need to loop through components for create permission, so we'll do that for all of them\n (0, formUtil_1.eachComponent)(form.components, (component, path) => {\n if (component && component.defaultPermission) {\n const value = (0, lodash_1.get)(submission.data, path);\n // make it work for single-select Group and multi-select Group\n const groups = Array.isArray(value) ? value : [value];\n groups.forEach(group => {\n if (group && group._id && // group id is present\n user.roles.indexOf(group._id) > -1 // user has group id in his roles\n ) {\n if (component.defaultPermission === 'read') {\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'create') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'write') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n }\n if (component.defaultPermission === 'admin') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n perms[permMap.delete] = true;\n }\n }\n });\n }\n });\n }\n return perms;\n });\n }\n /**\n * `Determine if the current user can submit a form.\n * @return {*}\n */\n canSubmit() {\n return this.userPermissions().then((perms) => {\n // If there is user and they cannot create, then check anonymous user permissions.\n if (!perms.create && Formio.getUser()) {\n return this.userPermissions(null).then((anonPerms) => {\n if (anonPerms.create) {\n Formio.setUser(null);\n return true;\n }\n return false;\n });\n }\n return perms.create;\n });\n }\n getUrlParts(url) {\n return Formio.getUrlParts(url, this);\n }\n static getUrlParts(url, formio) {\n const base = (formio && formio.base) ? formio.base : Formio.baseUrl;\n let regex = '^(http[s]?:\\\\/\\\\/)';\n if (base && url.indexOf(base) === 0) {\n regex += `(${base.replace(/^http[s]?:\\/\\//, '')})`;\n }\n else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n }\n static serialize(obj, _interpolate) {\n const str = [];\n const interpolate = (item) => {\n return _interpolate ? _interpolate(item) : item;\n };\n for (const p in obj) {\n if (obj.hasOwnProperty(p)) {\n str.push(`${encodeURIComponent(p)}=${encodeURIComponent(interpolate(obj[p]))}`);\n }\n }\n return str.join('&');\n }\n static getRequestArgs(formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !(0, lodash_1.isObject)(opts)) {\n opts = {};\n }\n const requestArgs = {\n url,\n method,\n data: data || null,\n opts\n };\n if (type) {\n requestArgs.type = type;\n }\n if (formio) {\n requestArgs.formio = formio;\n }\n return requestArgs;\n }\n static makeStaticRequest(url, method, data, opts) {\n const requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n const request = Plugins_1.default.pluginWait('preRequest', requestArgs)\n .then(() => Plugins_1.default.pluginGet('staticRequest', requestArgs)\n .then((result) => {\n if ((0, lodash_1.isNil)(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n }));\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n }\n /**\n * Make an API request and wrap that request with the Form.io Request plugin system. This is very similar to the\n * {Formio.request} method with a difference being that it will pass the request through the Form.io request plugin.\n *\n * @param {Formio} formio - An instance of the Formio class.\n * @param {string} type - The request resource type. \"submission\", \"form\", etc.\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise<Response>}\n */\n static makeRequest(formio, type, url, method, data, opts) {\n if (!formio) {\n return Formio.makeStaticRequest(url, method, data, opts);\n }\n const requestArgs = Formio.getRequestArgs(formio, type, url, method, data, opts);\n requestArgs.opts = requestArgs.opts || {};\n requestArgs.opts.formio = formio;\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = (0, lodash_1.defaults)(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n const request = Plugins_1.default.pluginWait('preRequest', requestArgs)\n .then(() => Plugins_1.default.pluginGet('request', requestArgs)\n .then((result) => {\n if ((0, lodash_1.isNil)(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n }));\n return Plugins_1.default.pluginAlter('wrapRequestPromise', request, requestArgs);\n }\n /**\n * Execute an API request to any external system. This is a wrapper around the Web fetch method.\n *\n * ```ts\n * Formio.request('https://examples.form.io').then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {Headers} header - An object of headers to pass to the request.\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise<Response>|*}\n */\n static request(url, method, data, header, opts) {\n if (!url) {\n return Promise.reject('No url provided');\n }\n method = (method || 'GET').toUpperCase();\n // For reverse compatibility, if they provided the ignoreCache parameter,\n // then change it back to the options format where that is a parameter.\n if ((0, lodash_1.isBoolean)(opts)) {\n opts = { ignoreCache: opts };\n }\n if (!opts || !(0, lodash_1.isObject)(opts)) {\n opts = {};\n }\n // Generate a cachekey.\n const cacheKey = btoa(encodeURI(url));\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && Formio.cache.hasOwnProperty(cacheKey)) {\n return Promise.resolve(Formio.cloneResponse(Formio.cache[cacheKey]));\n }\n if (url[0] === '/') {\n url = Formio.baseUrl + url;\n }\n // Set up and fetch request\n const headers = header || new Headers(opts.headers || {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n const token = Formio.getToken(opts);\n if (token && !opts.noToken) {\n headers.append('x-jwt-token', token);\n }\n // The fetch-ponyfill can't handle a proper Headers class anymore. Change it back to an object.\n const headerObj = {};\n headers.forEach(function (value, name) {\n headerObj[name] = value;\n });\n let options = {\n method: method,\n headers: headerObj,\n mode: 'cors'\n };\n if (data) {\n options.body = JSON.stringify(data);\n }\n // Allow plugins to alter the options.\n options = Plugins_1.default.pluginAlter('requestOptions', options, url);\n if (options.namespace || Formio.namespace) {\n opts.namespace = options.namespace || Formio.namespace;\n }\n const requestToken = options.headers['x-jwt-token'];\n const result = Plugins_1.default.pluginAlter('wrapFetchRequestPromise', Formio.fetch(url, options), { url, method, data, opts }).then((response) => {\n // Allow plugins to respond.\n response = Plugins_1.default.pluginAlter('requestResponse', response, Formio, data);\n if (!response.ok) {\n if (response.status === 440) {\n Formio.setToken(null, opts);\n Formio.events.emit('formio.sessionExpired', response.body);\n }\n else if (response.status === 401) {\n Formio.events.emit('formio.unauthorized', response.body);\n }\n else if (response.status === 416) {\n Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n }\n else if (response.status === 504) {\n return Promise.reject(new Error('Network request failed'));\n }\n // Parse and return the error as a rejected promise to reject this promise\n return (response.headers.get('content-type').includes('application/json')\n ? response.json()\n : response.text())\n .then((error) => {\n return Promise.reject(error);\n });\n }\n // Handle fetch results\n const token = response.headers.get('x-jwt-token');\n // In some strange cases, the fetch library will return an x-jwt-token without sending\n // one to the server. This has even been debugged on the server to verify that no token\n // was introduced with the request, but the response contains a token. This is an Invalid\n // case where we do not send an x-jwt-token and get one in return for any GET request.\n let tokenIntroduced = false;\n if ((method === 'GET') &&\n !requestToken &&\n token &&\n !opts.external &&\n !url.includes('token=') &&\n !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 &&\n response.status < 300 &&\n token &&\n token !== '' &&\n !tokenIntroduced) {\n Formio.setToken(token, opts);\n }\n // 204 is no content. Don't try to .json() it.\n if (response.status === 204) {\n return {};\n }\n const getResult = response.headers.get('content-type').includes('application/json')\n ? response.json()\n : response.text();\n return getResult.then((result) => {\n // Add some content-range metadata to the result here\n let range = response.headers.get('content-range');\n if (range && (0, lodash_1.isObject)(result)) {\n range = range.split('/');\n if (range[0] !== '*') {\n const skipLimit = range[0].split('-');\n result.skip = Number(skipLimit[0]);\n result.limit = skipLimit[1] - skipLimit[0] + 1;\n }\n result.serverCount = range[1] === '*' ? range[1] : Number(range[1]);\n }\n if (!opts.getHeaders) {\n return result;\n }\n const headers = {};\n response.headers.forEach((item, key) => {\n headers[key] = item;\n });\n // Return the result with the headers.\n return {\n result,\n headers,\n };\n });\n })\n .then((result) => {\n if (opts.getHeaders) {\n return result;\n }\n // Cache the response.\n if (method === 'GET') {\n Formio.cache[cacheKey] = result;\n }\n return Formio.cloneResponse(result);\n })\n .catch((err) => {\n if (err === 'Bad Token' && opts.noToken !== false) {\n Formio.setToken(null, opts);\n Formio.events.emit('formio.badToken', err);\n }\n if (err.message) {\n err = new Error(`Could not connect to API server (${err.message}): ${url}`);\n err.networkError = true;\n }\n if (method === 'GET') {\n delete Formio.cache[cacheKey];\n }\n return Promise.reject(err);\n });\n return result;\n }\n // Needed to maintain reverse compatability...\n static get token() {\n return Formio.tokens.formioToken || '';\n }\n // Needed to maintain reverse compatability...\n static set token(token) {\n Formio.tokens.formioToken = token || '';\n }\n static useSessionToken(options) {\n if (typeof localStorage === 'undefined') {\n return;\n }\n let namespace = options;\n if (typeof options === 'object') {\n options = options.namespace;\n }\n const tokenName = `${namespace || Formio.namespace || 'formio'}Token`;\n const token = localStorage.getItem(tokenName);\n if (token) {\n localStorage.removeItem(tokenName);\n sessionStorage.setItem(tokenName, token);\n }\n const userName = `${namespace || Formio.namespace || 'formio'}User`;\n const user = localStorage.getItem(userName);\n if (user) {\n localStorage.removeItem(userName);\n sessionStorage.setItem(userName, user);\n }\n localStorage.setItem('useSessionToken', 'true');\n }\n /**\n * Sets the JWT in storage to be used within an application.\n *\n * @param {string} token - The JWT token to set.\n * @param {object} options - Options as follows\n * @param {string} options.namespace - The namespace to save the token within. i.e. \"formio\"\n * @param {Formio} options.formio - The Formio instance.\n * @return {Promise<object>|void}\n */\n static setToken(token = '', opts = {}) {\n token = token || '';\n opts = (typeof opts === 'string') ? { namespace: opts } : opts || {};\n const tokenName = `${opts.namespace || Formio.namespace || 'formio'}Token`;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n const storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!token) {\n if (!opts.fromUser) {\n opts.fromToken = true;\n Formio.setUser(null, opts);\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.removeItem(tokenName);\n }\n catch (err) {\n browser_cookies_1.default.erase(tokenName, { path: '/' });\n }\n Formio.tokens[tokenName] = token;\n return Promise.resolve(null);\n }\n if (Formio.tokens[tokenName] !== token) {\n Formio.tokens[tokenName] = token;\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(tokenName, token);\n }\n catch (err) {\n browser_cookies_1.default.set(tokenName, token, { path: '/' });\n }\n }\n // Return or updates the current user\n return Formio.currentUser(opts.formio, opts);\n }\n /**\n * Returns the token set within the application for the user.\n *\n * @param {object} options - The options as follows.\n * @param {string} options.namespace - The namespace of the token you wish to fetch.\n * @param {boolean} options.decode - If you would like the token returned as decoded JSON.\n * @return {*}\n */\n static getToken(options) {\n options = (typeof options === 'string') ? { namespace: options } : options || {};\n const tokenName = `${options.namespace || Formio.namespace || 'formio'}Token`;\n const decodedTokenName = options.decode ? `${tokenName}Decoded` : tokenName;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n if (Formio.tokens[decodedTokenName]) {\n return Formio.tokens[decodedTokenName];\n }\n try {\n const token = localStorage.getItem('useSessionToken')\n ? sessionStorage.getItem(tokenName)\n : localStorage.getItem(tokenName);\n Formio.tokens[tokenName] = token || '';\n if (options.decode) {\n Formio.tokens[decodedTokenName] = Formio.tokens[tokenName] ? (0, jwtDecode_1.jwtDecode)(Formio.tokens[tokenName]) : {};\n return Formio.tokens[decodedTokenName];\n }\n return Formio.tokens[tokenName];\n }\n catch (e) {\n Formio.tokens[tokenName] = browser_cookies_1.default.get(tokenName);\n return '';\n }\n }\n /**\n * Sets the current user within the application cache.\n *\n * @param {object} user - JSON object of the user you wish to set.\n * @param {object} options - Options as follows\n * @param {string} options.namespace - The namespace of the tokens\n */\n static setUser(user, opts = {}) {\n const userName = `${opts.namespace || Formio.namespace || 'formio'}User`;\n const storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n return storage.removeItem(userName);\n }\n catch (err) {\n return browser_cookies_1.default.erase(userName, { path: '/' });\n }\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(userName, JSON.stringify(user));\n }\n catch (err) {\n browser_cookies_1.default.set(userName, JSON.stringify(user), { path: '/' });\n }\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n }\n /**\n * Returns the user JSON.\n *\n * @param {object} options - Options as follows\n * @param {string} namespace - The namespace of the tokens stored within this application.\n * @return {object} - The user object.\n */\n static getUser(options) {\n options = options || {};\n const userName = `${options.namespace || Formio.namespace || 'formio'}User`;\n try {\n return JSON.parse((localStorage.getItem('useSessionToken')\n ? sessionStorage\n : localStorage).getItem(userName) || '');\n }\n catch (e) {\n return JSON.parse(browser_cookies_1.default.get(userName));\n }\n }\n /**\n * Sets the BaseURL for the application.\n *\n * @description Every application developed using the JavaScript SDK must set both the {@link Formio.setBaseUrl} and\n * {@link Formio.setProjectUrl} methods. These two functions ensure that every URL passed into the constructor of this\n * class can determine the \"project\" context for which the application is running.\n *\n * Any Open Source server applications will set both the {@link Formio.setBaseUrl} and {@link Formio.setProjectUrl}\n * values will be the same value.\n *\n * ```ts\n * Formio.setBaseUrl('https://yourwebsite.com/forms');\n * Formio.setProjectUrl('https://yourwebsite.com/forms/project');\n *\n * // Now the Formio constructor will know what is the \"project\" and what is the form alias name. Without setBaseUrl\n * // and setProjectUrl, this would throw an error.\n *\n * const formio = new Formio('https://yourwebsite.com/forms/project/user');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {string} url - The URL of the Base API url.\n */\n static setBaseUrl(url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n }\n /**\n * Returns the current base url described at {@link Formio.setBaseUrl}\n *\n * @return {string} - The base url of the application.\n */\n static getBaseUrl() {\n return Formio.baseUrl;\n }\n static setApiUrl(url) {\n return Formio.setBaseUrl(url);\n }\n static getApiUrl() {\n return Formio.getBaseUrl();\n }\n static setAppUrl(url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n /**\n * Sets the Project Url for the application. This is an important method that needs to be set for all applications. It\n * is documented @ {@link Formio.setBaseUrl}.\n *\n * @param {string} url - The project api url.\n */\n static setProjectUrl(url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n /**\n * The Auth URL can be set to customize the authentication requests made from an application. By default, this is\n * just the same value as {@link Formio.projectUrl}\n *\n * @param {string} url - The authentication url\n */\n static setAuthUrl(url) {\n Formio.authUrl = url;\n }\n static getAppUrl() {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n }\n /**\n * Returns the Project url described at {@link Formio.setProjectUrl}\n *\n * @return {string|string} - The Project Url.\n */\n static getProjectUrl() {\n return Formio.projectUrl;\n }\n /**\n * Clears the runtime internal API cache.\n *\n * @description By default, the Formio class will cache all API requests in memory so that any subsequent requests\n * using GET method will return the cached results as long as the API URl is the same as what was cached previously.\n * This cache can be cleared using this method as follows.\n *\n * ```ts\n * Formio.clearCache();\n * ```\n *\n * Or, if you just wish to clear a single request, then the {@link Formio.request#options.ignoreCache} option can be\n * provided when making an API request as follows.\n *\n * ```ts\n * Formio.loadForm({}, {\n * ignoreCache: true\n * }).then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * Both of the following will ensure that a new request is made to the API server and that the results will not be\n * from the cached result.\n */\n static clearCache() {\n Formio.cache = {};\n }\n /**\n * Return the access information about a Project, such as the Role ID's for that project, and if the server is\n * configured to do so, the Form and Resource access configurations that the authenticated user has access to.\n *\n * @description This is useful for an application to determine the UI for a specific user to identify which forms they have\n * access to submit or read.\n *\n * @param {Formio} formio - The Formio instance.\n * @return {Promise<Response>}\n */\n static accessInfo(formio) {\n const projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', `${projectUrl}/access`);\n }\n /**\n * Returns an array of roles for the project, which includes the ID's and names of those roles.\n *\n * @param {Formio} formio - The Formio instance.\n * @return {Promise<Response>}\n */\n static projectRoles(formio) {\n const projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', `${projectUrl}/role`);\n }\n /**\n * Return the currentUser object. This will fetch the user from the server and respond with the Submission JSON\n * of that user object.\n *\n * @param {Formio} formio - The Formio instance\n * @param {object} options - The options passed to {@link Formio.getUser}\n * @return {Promise<R>|*}\n */\n static currentUser(formio, options = {}) {\n let authUrl = Formio.authUrl;\n if (!authUrl) {\n authUrl = formio ? formio.projectUrl : (Formio.projectUrl || Formio.baseUrl);\n }\n authUrl += '/current';\n if (!options.ignoreCache || options.fromCurrent) {\n const user = Formio.getUser(options);\n if (user) {\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', Promise.resolve(user), {\n url: authUrl,\n method: 'GET',\n options\n });\n }\n }\n const token = Formio.getToken(options);\n if ((!options || !options.external) && !token) {\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', Promise.resolve(null), {\n url: authUrl,\n method: 'GET',\n options\n });\n }\n options.fromCurrent = true;\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options)\n .then((response) => {\n Formio.setUser(response, options);\n return response;\n });\n }\n /**\n * Performs a logout of the Form.io application. This will reset all cache, as well as make a request to the logout\n * endpoint of the Form.io api platform.\n *\n * @param {Formio} formio - A Formio instance.\n * @param {object} options - Options passed to both {@link Formio.setToken} as well as {@link Formio.setUser}\n * @return {Promise<Response>}\n */\n static logout(formio, options = {}) {\n options.formio = formio;\n const projectUrl = Formio.authUrl ? Formio.authUrl : (formio ? formio.projectUrl : Formio.baseUrl);\n const logout = () => {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n localStorage.removeItem('useSessionToken');\n };\n return Formio.makeRequest(formio, 'logout', `${projectUrl}/logout`)\n .then(function (result) {\n logout();\n if (result.shouldRedirect && result.url) {\n window.location.href = result.url;\n }\n return result;\n })\n .catch(function (err) {\n logout();\n throw err;\n });\n }\n /**\n * Returns the query passed to a page in JSON object format.\n *\n * @description For example, lets say you visit your application using\n * the url as follows.\n *\n * ```\n * https://yourapplication.com/?token=23423423423&username=Joe\n * ```\n *\n * The following code will provide your application with the following.\n *\n * ```ts\n * const query Formio.pageQuery();\n * console.log(query.token); // Will print 23423423423\n * console.log(query.username); // Will print Joe\n * ```\n *\n * @return {{}} - A JSON object representation of the query that was passed to the URL of an application.\n */\n static pageQuery() {\n const pageQuery = {};\n pageQuery.paths = [];\n const hashes = location.hash.substr(1).replace(/\\?/g, '&').split('&');\n let parts = [];\n location.search.substr(1).split('&').forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n });\n hashes.forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n }\n /**\n * Much like {@link Formio.currentUser}, but instead automatically injects the Bearer tokens into the headers to\n * perform a Token swap of the OAuth token which will then return the JWT token for that user.\n *\n * @param {Formio} formio - The Formio instance\n * @param {string} token - An OAuth Bearer token to use for a token swap between the OAuth provider and Form.io\n * @return {Promise<R>|*}\n */\n static oAuthCurrentUser(formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: `Bearer ${token}`\n }\n });\n }\n static oauthLogoutURI(uri, options) {\n options = (typeof options === 'string') ? { namespace: options } : options || {};\n const logoutURIName = `${options.namespace || Formio.namespace || 'formio'}LogoutAuthUrl`;\n Formio.tokens[logoutURIName];\n localStorage.setItem(logoutURIName, uri);\n return Formio.tokens[logoutURIName];\n }\n /**\n * Perform a SAML initialization.\n *\n * @description Typically, you would use the {@link Formio.ssoInit} method to perform this function\n * since this method is an alias for the following.\n *\n * ```ts\n * Formio.samlInit();\n * Formio.ssoInit('saml'); // This is the exact same thing as calling Formio.samlInit\n * ```\n *\n * This method will return false if the process is just starting. The code below is a typical block of code that is\n * used to automatically trigger the SAML authentication process within your application using a Button component.\n *\n * ```ts\n * if (Formio.pageQuery().saml) {\n * const sso = Formio.samlInit();\n * if (sso) {\n * sso.then((user) => {\n * // The SSO user is now loaded!\n * console.log(user);\n * });\n * }\n * }\n * ```\n *\n * You can then place the following code withiin the \"Custom\" action of a Button component on your form.\n *\n * ```ts\n * Formio.samlInit();\n * ```\n *\n * Now when you click on this button, it will start the handshake process with SAML, and once it returns, will pass\n * a \"saml\" query parameter back to your application which will execute the code to load the current user from SAML.\n *\n * @param {object} options - Options to pass to the SAML initialization process.\n * @param {string} options.relay - The URL that will be used as the authentication \"relay\" that occurs during a SAML handshake process.\n * @return {boolean|Promise<Object>|void}\n */\n static samlInit(options = {}) {\n const query = Formio.pageQuery();\n if (query.saml) {\n Formio.setUser(null);\n const retVal = Formio.setToken(query.saml);\n let uri = window.location.toString();\n uri = uri.substring(0, uri.indexOf('?'));\n if (window.location.hash) {\n uri += window.location.hash;\n }\n window.history.replaceState({}, document.title, uri);\n return retVal;\n }\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n // go to the saml sso endpoint for this project.\n const authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = `${authUrl}/saml/sso?relay=${encodeURI(options.relay)}`;\n return false;\n }\n /**\n * Perform an Okta Authentication process using the {@link https://developer.okta.com/code/javascript/okta_auth_sdk|Okta SDK}.\n *\n * @description This method does require that you first include the Okta JavaScript SDK within your application as follows.\n *\n * First you need to include the Okta Authentication script.\n *\n * ```html\n * <script src=\"https://ok1static.oktacdn.com/assets/js/sdk/okta-auth-js/2.0.1/okta-auth-js.min.js\" type=\"text/javascript\"></script>\n * ```\n *\n * Then you can call this method as follows.\n *\n * ```ts\n * Formio.oktaInit();\n * ```\n *\n * @param {object} options - Options that are passed directly to the {@link https://github.com/okta/okta-auth-js#configuration-reference|Okta SDK constructor}\n * @param {constructor} options.OktaAuth - If the OktaAuth constructor is not provided global to the application, it can be provided to this method using this property.\n * @param {Formio} options.formio - The Formio instance.\n * @param {Array<string>} options.scopes - Scopes that are passed to the {@link https://github.com/okta/okta-auth-js#tokengetwithredirectoptions|getWithRedirect} method from the Okta SDK.\n * @return {Promise<Object>}\n */\n static oktaInit(options = {}) {\n if (typeof OktaAuth !== undefined) {\n options.OktaAuth = OktaAuth;\n }\n if (typeof options.OktaAuth === undefined) {\n const errorMessage = 'Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.';\n console.warn(errorMessage);\n return Promise.reject(errorMessage);\n }\n return new Promise((resolve, reject) => {\n const Okta = options.OktaAuth;\n delete options.OktaAuth;\n const authClient = new Okta(options);\n authClient.tokenManager.get('accessToken')\n .then((accessToken) => {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n }\n else if (location.hash) {\n authClient.token.parseFromUrl()\n .then((token) => {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })\n .catch((err) => {\n console.warn(err);\n reject(err);\n });\n }\n else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })\n .catch((error) => {\n reject(error);\n });\n });\n }\n /**\n * A common static method to trigger any SSO processes. This method is really just an alias for other static methods.\n *\n * @param {('saml'|'okta')} type - The type of SSO to trigger. 'saml' is an alias for {@link Formio.samlInit}, and 'okta' is an alias for {@link Formio.oktaInit}.\n * @param {object} options - Options to pass to the specific sso methods\n * @return {*|Promise<Object>|boolean|void}\n */\n static ssoInit(type, options = {}) {\n switch (type) {\n case 'saml':\n return Formio.samlInit(options);\n case 'okta':\n return Formio.oktaInit(options);\n default:\n console.warn('Unknown SSO type');\n return Promise.reject('Unknown SSO type');\n }\n }\n /**\n * Lazy load a remote library dependency.\n *\n * @description This is useful for components that wish to lazy load a required library\n * by adding that library to the <scripts> section of the HTML webpage, and then provide a promise that will resolve\n * when the library becomes available for use.\n *\n * @example Load Google Maps API.\n * ```ts\n * Formio.requireLibrary('googleMaps', 'google.maps.Map', 'https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap', true).then(() => {\n * // Once the promise resolves, the following can now be used within your application.\n * const map = new google.maps.Map(document.getElementById(\"map\"), {...});\n * });\n * ```\n *\n * @param {string} name - The internal name to give to the library you are loading. This is useful for caching the library for later use.\n * @param {string} property - The name of the global property that will be added to the global namespace once the library has been loaded. This is used to check to see if the property exists before resolving the promise that the library is ready for use.\n * @param {string} src - The URL of the library to lazy load.\n * @param {boolean} polling - Determines if polling should be used to determine if they library is ready to use. If set to false, then it will rely on a global callback called ${name}Callback where \"name\" is the first property passed to this method. When this is called, that will indicate when the library is ready. In most cases, you will want to pass true to this parameter to initiate a polling method to check for the library availability in the global context.\n * @return {Promise<object>} - A promise that will resolve when the plugin is ready to be used.\n */\n static requireLibrary(name, property, src, polling = false, onload) {\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new Promise((resolve, reject) => {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n const callbackName = `${name}Callback`;\n if (!polling && !window[callbackName]) {\n window[callbackName] = () => Formio.libraries[name].resolve();\n }\n // See if the plugin already exists.\n const plugin = (0, lodash_1.get)(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\n }\n else {\n src = Array.isArray(src) ? src : [src];\n src.forEach((lib) => {\n let attrs = {};\n let elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib,\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true,\n referrerpolicy: 'origin',\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet',\n };\n break;\n }\n // Add the script to the top of the page.\n const element = document.createElement(elementType);\n if (element.setAttribute) {\n for (const attr in attrs) {\n element.setAttribute(attr, attrs[attr]);\n }\n }\n if (onload) {\n element.addEventListener('load', () => {\n Formio.libraries[name].loaded = true;\n onload(Formio.libraries[name].ready);\n });\n }\n const { head } = document;\n if (head) {\n head.appendChild(element);\n }\n });\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n const interval = setInterval(() => {\n const plugin = (0, lodash_1.get)(window, property);\n if (plugin) {\n clearInterval(interval);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n const lib = Formio.libraries[name];\n return onload && lib.loaded ? onload(lib.ready) : lib.ready;\n }\n /**\n * Determines if a lazy loaded library is ready to be used.\n *\n * @description Example: Let's assume that the example provided at {@link Formio.requireLibrary} was used elsewhere in your application.\n * You could now use the following within a separate place that will also resolve once the library is ready to be used.\n *\n * ```js\n * Formio.libraryReady('googleMaps').then(() => {\n * // Once the promise resolves, the following can now be used within your application.\n * const map = new google.maps.Map(document.getElementById(\"map\"), {...});\n * });\n * ```\n *\n * @param {string} name - The name of the library to check.\n * @return {Promise<object>} - A promise that will resolve when the library is ready to be used.\n */\n static libraryReady(name) {\n if (Formio.libraries.hasOwnProperty(name) &&\n Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return Promise.reject(`${name} library was not required.`);\n }\n /**\n * Clones the response from the API so that it cannot be mutated.\n *\n * @param response\n */\n static cloneResponse(response) {\n const copy = (0, lodash_1.fastCloneDeep)(response);\n if (Array.isArray(response)) {\n copy.skip = response.skip;\n copy.limit = response.limit;\n copy.serverCount = response.serverCount;\n }\n return copy;\n }\n /**\n * Sets the project path type.\n *\n * @param type\n */\n static setPathType(type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n }\n /**\n * Gets the project path type.\n */\n static getPathType() {\n return Formio.pathType;\n }\n}\nexports.Formio = Formio;\n/**\n * The base API url of the Form.io Platform. Example: https://api.form.io\n */\nFormio.baseUrl = 'https://api.form.io';\n/**\n * The project API url of the Form.io Project. Example: https://examples.form.io\n */\nFormio.projectUrl = '';\n/**\n * The project url to use for Authentication.\n */\nFormio.authUrl = '';\n/**\n * Set to true if the project url has been established with ```Formio.setProjectUrl()```\n */\nFormio.projectUrlSet = false;\n/**\n * The Form.io API Cache. This ensures that requests to the same API endpoint are cached.\n */\nFormio.cache = {};\n/**\n * The namespace used to save the Form.io Token's and variables within an application.\n */\nFormio.namespace = '';\n/**\n * Handles events fired within this SDK library.\n */\nFormio.events = new eventemitter3_1.default();\n/**\n * Stores all of the libraries lazy loaded with ```Formio.requireLibrary``` method.\n */\nFormio.libraries = {};\n/**\n * A direct interface to the Form.io fetch polyfill.\n */\nFormio.fetch = fetch;\n/**\n * A direct interface to the Form.io fetch Headers polyfill.\n */\nFormio.Headers = Headers;\n/**\n * All of the auth tokens for this session.\n */\nFormio.tokens = {};\n/**\n * The version of this library.\n */\nFormio.version = '---VERSION---';\n// Add Plugin methods.\nFormio.plugins = Plugins_1.default.plugins;\nFormio.deregisterPlugin = Plugins_1.default.deregisterPlugin;\nFormio.registerPlugin = Plugins_1.default.registerPlugin;\nFormio.getPlugin = Plugins_1.default.getPlugin;\nFormio.pluginWait = Plugins_1.default.pluginWait;\nFormio.pluginGet = Plugins_1.default.pluginGet;\nFormio.pluginAlter = Plugins_1.default.pluginAlter;\n// Adds Formio to the Plugins Interface.\nPlugins_1.default.Formio = Formio;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/sdk/Formio.js?");
|
417
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = exports.FormioPathType = void 0;\nconst fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nconst fastCloneDeep_1 = __webpack_require__(/*! ../utils/fastCloneDeep */ \"./node_modules/@formio/core/lib/utils/fastCloneDeep.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst jwtDecode_1 = __webpack_require__(/*! ../utils/jwtDecode */ \"./node_modules/@formio/core/lib/utils/jwtDecode.js\");\nconst eventemitter3_1 = __importDefault(__webpack_require__(/*! eventemitter3 */ \"./node_modules/eventemitter3/index.js\"));\nconst browser_cookies_1 = __importDefault(__webpack_require__(/*! browser-cookies */ \"./node_modules/browser-cookies/src/browser-cookies.js\"));\nconst { fetch, Headers } = (0, fetch_ponyfill_1.default)();\nconst Plugins_1 = __importDefault(__webpack_require__(/*! ./Plugins */ \"./node_modules/@formio/core/lib/sdk/Plugins.js\"));\n/**\n * The different path types for a project.\n */\nvar FormioPathType;\n(function (FormioPathType) {\n FormioPathType[\"Subdirectories\"] = \"Subdirectories\";\n FormioPathType[\"Subdomains\"] = \"Subdomains\";\n})(FormioPathType || (exports.FormioPathType = FormioPathType = {}));\n/**\n * The Formio interface class. This is a minimalistic API library that allows you to work with the Form.io API's within JavaScript.\n *\n * ## Usage\n * Creating an instance of Formio is simple, and takes only a path (URL String). The path can be different, depending on the desired output.\n * The Formio instance can also access higher level operations, depending on how granular of a path you start with.\n *\n * ```ts\n * var formio = new Formio(<endpoint>, [options]);\n * ```\n *\n * Where **endpoint** is any valid API endpoint within Form.io. These URL's can provide a number of different methods depending on the granularity of the endpoint. This allows you to use the same interface but have access to different methods depending on how granular the endpoint url is.\n * **options** is defined within the {link Formio.constructor} documentation.\n *\n * Here is an example of how this library can be used to load a form JSON from the Form.io API's\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n */\nclass Formio {\n /* eslint-disable max-statements */\n /**\n * @constructor\n * @param {string} path - A project, form, and submission API Url.\n * @param {FormioOptions} options - Available options to configure the Javascript API.\n */\n constructor(path, options = {}) {\n this.path = path;\n this.options = options;\n /**\n * The base API url of the Form.io Platform. Example: https://api.form.io\n */\n this.base = '';\n /**\n * The Projects Endpoint derived from the provided source.\n *\n * @example https://api.form.io/project\n */\n this.projectsUrl = '';\n /**\n * A specific project endpoint derived from the provided source.\n *\n * @example https://examples.form.io\n */\n this.projectUrl = '';\n /**\n * The Project ID found within the provided source.\n */\n this.projectId = '';\n /**\n * A specific Role URL provided the source.\n *\n * @example https://examples.form.io/role/2342343234234234\n */\n this.roleUrl = '';\n /**\n * The roles endpoint derived from the provided source.\n *\n * @example https://examples.form.io/role\n */\n this.rolesUrl = '';\n /**\n * The roleID derieved from the provided source.\n */\n this.roleId = '';\n /**\n * A specific form url derived from the provided source.\n *\n * @example https://examples.form.io/example\n */\n this.formUrl = '';\n /**\n * The forms url derived from the provided source.\n *\n * @example https://example.form.io/form\n */\n this.formsUrl = '';\n /**\n * The Form ID derived from the provided source.\n */\n this.formId = '';\n /**\n * The submissions URL derived from the provided source.\n *\n * @example https://examples.form.io/example/submission\n */\n this.submissionsUrl = '';\n /**\n * A specific submissions URL derived from a provided source.\n *\n * @example https://examples.form.io/example/submission/223423423423\n */\n this.submissionUrl = '';\n /**\n * The submission ID provided a submission url.\n */\n this.submissionId = '';\n /**\n * The actions url provided a form url as the source.\n *\n * @example https://examples.form.io/example/action\n */\n this.actionsUrl = '';\n /**\n * The Action ID derived from a provided Action url.\n */\n this.actionId = '';\n /**\n * A specific action api endoint.\n */\n this.actionUrl = '';\n this.vsUrl = '';\n this.vId = '';\n this.vUrl = '';\n /**\n * The query string derived from the provided src url.\n */\n this.query = '';\n /**\n * If this is a non-project url, such is the case for Open Source API.\n */\n this.noProject = false;\n // Ensure we have an instance of Formio.\n if (!(this instanceof Formio)) {\n return new Formio(path);\n }\n if (options.useSessionToken) {\n Formio.useSessionToken(options);\n }\n if (options.hasOwnProperty('base') && options.base) {\n this.base = options.base;\n }\n else if (Formio.baseUrl) {\n this.base = Formio.baseUrl;\n }\n else if (window && window.location) {\n const match = window.location.href.match(/http[s]?:\\/\\/api./);\n this.base = match ? match[0] : window.location.origin;\n }\n if (!path) {\n // Allow user to create new projects if this was instantiated without\n // a url\n this.projectUrl = Formio.projectUrl || `${this.base}/project`;\n this.projectsUrl = `${this.base}/project`;\n this.projectId = '';\n this.query = '';\n return;\n }\n if (options.hasOwnProperty('project') && options.project) {\n this.projectUrl = options.project;\n }\n const project = this.projectUrl || Formio.projectUrl;\n const projectRegEx = /(^|\\/)(project)($|\\/[^/]+)/;\n const isProjectUrl = (path.search(projectRegEx) !== -1);\n // The baseURL is the same as the projectUrl, and does not contain \"/project/MONGO_ID\" in\n // its domain. This is almost certainly against the Open Source server.\n if (project && this.base === project && !isProjectUrl) {\n this.noProject = true;\n this.projectUrl = this.base;\n }\n // Normalize to an absolute path.\n if ((path.indexOf('http') !== 0) && (path.indexOf('//') !== 0)) {\n path = this.base + path;\n }\n const hostparts = this.getUrlParts(path);\n let hostName = '';\n let parts = [];\n if (hostparts) {\n hostName = hostparts[1] + hostparts[2];\n path = hostparts.length > 3 ? hostparts[3] : '';\n const queryparts = path.split('?');\n if (queryparts.length > 1) {\n path = queryparts[0];\n this.query = `?${queryparts[1]}`;\n }\n }\n // Register a specific path.\n const registerPath = (name, base) => {\n this[`${name}sUrl`] = `${base}/${name}`;\n const regex = new RegExp(`/${name}/([^/]+)`);\n if (path && path.search(regex) !== -1) {\n parts = path.match(regex);\n this[`${name}Url`] = parts ? (base + parts[0]) : '';\n this[`${name}Id`] = (parts.length > 1) ? parts[1] : '';\n base += parts[0];\n }\n return base;\n };\n // Register an array of items.\n const registerItems = (items, base, staticBase) => {\n for (const i in items) {\n if (items.hasOwnProperty(i)) {\n const item = items[i];\n if (Array.isArray(item)) {\n registerItems(item, base, true);\n }\n else {\n const newBase = registerPath(item, base);\n base = staticBase ? base : newBase;\n }\n }\n }\n };\n if (!this.projectUrl || (this.projectUrl === this.base)) {\n // If a project uses Subdirectories path type, we need to specify a projectUrl\n if (!this.projectUrl && !isProjectUrl && Formio.pathType === 'Subdirectories') {\n const regex = `^${hostName.replace(/\\//g, '\\\\/')}.[^/]+`;\n const match = project.match(new RegExp(regex));\n this.projectUrl = match ? match[0] : hostName;\n }\n else {\n this.projectUrl = hostName;\n }\n }\n // Check if we have a specified path type.\n let isNotSubdomainType = false;\n if (Formio.pathType) {\n isNotSubdomainType = Formio.pathType !== 'Subdomains';\n }\n if (!this.noProject) {\n // Determine the projectUrl and projectId\n if (isProjectUrl) {\n // Get project id as project/:projectId.\n registerItems(['project'], hostName);\n path = path.replace(projectRegEx, '');\n }\n else if (hostName === this.base) {\n // Get project id as first part of path (subdirectory).\n if (hostparts && hostparts.length > 3 && path.split('/').length > 1) {\n const isFile = path.match(/.json/);\n const pathParts = path.split('/');\n if (isFile) {\n this.projectUrl = hostName;\n }\n else {\n pathParts.shift(); // Throw away the first /.\n const projectId = pathParts.shift();\n if (projectId) {\n this.projectId = projectId;\n path = `/${pathParts.join('/')}`;\n this.projectUrl = `${hostName}/${this.projectId}`;\n }\n }\n }\n }\n else {\n // Get project id from subdomain.\n if (hostparts && hostparts.length > 2 && (hostparts[2].split('.').length > 2 || hostName.includes('localhost')) && !isNotSubdomainType) {\n this.projectUrl = hostName;\n this.projectId = hostparts[2].split('.')[0];\n }\n }\n this.projectsUrl = this.projectsUrl || `${this.base}/project`;\n }\n // Configure Role urls and role ids.\n registerItems(['role'], this.projectUrl);\n // Configure Form urls and form ids.\n if (/(^|\\/)(form)($|\\/)/.test(path)) {\n registerItems(['form', ['submission', 'action', 'v']], this.projectUrl);\n }\n else {\n const subRegEx = new RegExp('/(submission|action|v)($|/.*)');\n const subs = path.match(subRegEx);\n if ((subs && (subs.length > 1))) {\n this.pathType = subs[1];\n }\n path = path.replace(subRegEx, '');\n path = path.replace(/\\/$/, '');\n this.formsUrl = `${this.projectUrl}/form`;\n this.formUrl = path ? this.projectUrl + path : '';\n this.formId = path.replace(/^\\/+|\\/+$/g, '');\n const items = ['submission', 'action', 'v'];\n for (const i in items) {\n if (items.hasOwnProperty(i)) {\n const item = items[i];\n this[`${item}sUrl`] = `${this.projectUrl + path}/${item}`;\n if ((this.pathType === item) && subs && (subs.length > 2) && subs[2]) {\n this[`${item}Id`] = subs[2].replace(/^\\/+|\\/+$/g, '');\n this[`${item}Url`] = this.projectUrl + path + subs[0];\n }\n }\n }\n }\n // Set the app url if it is not set.\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = this.projectUrl;\n }\n }\n /* eslint-enable max-statements */\n /**\n * Deletes a remote resource of any provided type.\n *\n * @param {string} type - The type of resource to delete. \"submission\", \"form\", etc.\n * @param {object} options - The options passed to {@link Formio.request}\n * @return {Promise<Response>}\n */\n delete(type, opts) {\n const _id = `${type}Id`;\n const _url = `${type}Url`;\n if (!this[_id]) {\n return Promise.reject('Nothing to delete');\n }\n Formio.cache = {};\n return this.makeRequest(type, this[_url], 'delete', null, opts);\n }\n /**\n * Returns the index (array of records) for any provided type.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} query - A query object to pass to the request.\n * @param {object} query.params - A map (key-value pairs) of URL query parameters to add to the url.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n index(type, query, opts) {\n const _url = `${type}Url`;\n query = query || '';\n if (query && (0, lodash_1.isObject)(query)) {\n query = `?${Formio.serialize(query.params)}`;\n }\n return this.makeRequest(type, this[_url] + query, 'get', null, opts);\n }\n /**\n * Save a document record using \"upsert\". If the document does not exist, it will be created, if the _id is provided,\n * it will be updated.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} data - The resource data object.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n save(type, data, opts) {\n const _id = `${type}Id`;\n const _url = `${type}Url`;\n const method = (this[_id] || data._id) ? 'put' : 'post';\n let reqUrl = this[_id] ? this[_url] : this[`${type}sUrl`];\n if (!this[_id] && data._id && (method === 'put') && !reqUrl.includes(data._id)) {\n reqUrl += `/${data._id}`;\n }\n Formio.cache = {};\n return this.makeRequest(type, reqUrl + this.query, method, data, opts);\n }\n /**\n * @summary Load (GET) a document record.\n *\n * @param {string} type - The type of resource to fetch the index of. \"submission\", \"form\", etc.\n * @param {object} query - A query object to pass to the request.\n * @param {object} query.params - A map (key-value pairs) of URL query parameters to add to the url.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n load(type, query, opts) {\n const _id = `${type}Id`;\n const _url = `${type}Url`;\n if (query && (0, lodash_1.isObject)(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? (`${this.query}&${query}`) : (`?${query}`);\n }\n else {\n query = this.query;\n }\n if (!this[_id]) {\n return Promise.reject(`Missing ${_id}`);\n }\n let url = this[_url] + query;\n if (type === 'form' && !isNaN(parseInt(this.vId))) {\n url += url.indexOf('?') === -1 ? '?' : '&';\n url += `formRevision=${this.vId}`;\n }\n return this.makeRequest(type, url, 'get', null, opts);\n }\n /**\n * @summary Call {@link Formio.makeRequest} for this Formio instance.\n *\n * @param {string} type - The request resource type. \"submission\", \"form\", etc.\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise<Response>}\n */\n makeRequest(type, url, method, data, opts) {\n return Formio.makeRequest(this, type, url, method, data, opts);\n }\n /**\n * @summary Loads a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadProject().then((project) => {\n * console.log(project);\n * });\n * ```\n *\n * @param {object} query - Query parameters to pass to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n loadProject(query, opts) {\n return this.load('project', query, opts);\n }\n /**\n * Saves or Updates a project.\n *\n * ### Create a new project\n * ```ts\n * const formio = new Formio();\n * formio.saveProject({\n * title: 'My Project',\n * path: 'myproject',\n * name: 'myproject'\n * });\n * ```\n *\n * ### Update an existing project\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadProject().then((project) => {\n * project.title = 'Title changed';\n * formio.saveProject(project).then(() => {\n * console.log('Done saving project!');\n * });\n * });\n * ```\n *\n * @param {object} data - The project JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveProject(data, opts) {\n return this.save('project', data, opts);\n }\n /**\n * Deletes a project\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.deleteProject();\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n deleteProject(opts) {\n return this.delete('project', opts);\n }\n /**\n * Loads a list of all projects.\n *\n * ```ts\n * Formio.loadProjects().then((projects) => {\n * console.log(projects);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {*}\n */\n static loadProjects(query, opts) {\n query = query || '';\n if ((0, lodash_1.isObject)(query)) {\n query = `?${Formio.serialize(query.params)}`;\n }\n return Formio.makeStaticRequest(`${Formio.baseUrl}/project${query}`, 'GET', null, opts);\n }\n /**\n * Loads a role within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/role/234234234234');\n * formio.loadRole().then((role) => {\n * console.log(role);\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n loadRole(opts) {\n return this.load('role', null, opts);\n }\n /**\n * Create a new or Update an existing role within a project.\n *\n * ### Create new Role example\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.saveRole({\n * title: 'Employee',\n * description: 'A person who belongs to a company.'\n * }).then((role) => {\n * console.log(role);\n * });\n * ```\n *\n * ### Update existing role example\n * ```ts\n * const formio = new Formio('https://examples.form.io/role/234234234234234');\n * formio.loadRole().then((role) => {\n * role.title = 'Manager';\n * formio.saveRole(role).then(() => {\n * console.log('DONE');\n * });\n * });\n * ```\n *\n * @param {object} role - The Role JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveRole(data, opts) {\n return this.save('role', data, opts);\n }\n /**\n * Deletes a role within a project.\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteRole(opts) {\n return this.delete('role', opts);\n }\n /**\n * Load all roles within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadRoles().then((roles) => {\n * console.log(roles);\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadRoles(opts) {\n return this.index('roles', null, opts);\n }\n /**\n * Loads a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n loadForm(query, opts) {\n return this.load('form', query, opts)\n .then((currentForm) => {\n // Check to see if there isn't a number in vId.\n if (!currentForm.revisions || isNaN(parseInt(this.vId))) {\n return currentForm;\n }\n // If a submission already exists but form is marked to load current version of form.\n if (currentForm.revisions === 'current' && this.submissionId) {\n return currentForm;\n }\n // eslint-disable-next-line eqeqeq\n if (currentForm._vid == this.vId || currentForm.revisionId === this.vId) {\n return currentForm;\n }\n // If they specified a revision form, load the revised form components.\n if (query && (0, lodash_1.isObject)(query)) {\n query = Formio.serialize(query.params);\n }\n if (query) {\n query = this.query ? (`${this.query}&${query}`) : (`?${query}`);\n }\n else {\n query = this.query;\n }\n return this.makeRequest('form', this.vUrl + query, 'get', null, opts)\n .then((revisionForm) => {\n currentForm._vid = revisionForm._vid;\n currentForm.components = revisionForm.components;\n currentForm.settings = revisionForm.settings;\n currentForm.revisionId = revisionForm.revisionId;\n // Using object.assign so we don't cross polinate multiple form loads.\n return Object.assign({}, currentForm);\n })\n // If we couldn't load the revision, just return the original form.\n .catch(() => Object.assign({}, currentForm));\n });\n }\n /**\n * Create or Update a specific form.\n *\n * ### Create form example\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.saveForm({\n * title: 'Employee',\n * type: 'resource',\n * path: 'employee',\n * name: 'employee',\n * components: [\n * {\n * type: 'textfield',\n * key: 'firstName',\n * label: 'First Name'\n * },\n * {\n * type: 'textfield',\n * key: 'lastName',\n * label: 'Last Name'\n * }\n * ]\n * });\n * ```\n *\n * ### Update a form example\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadForm().then((form) => {\n * form.title = 'Changed Title';\n * formio.saveForm(form).then(() => {\n * console.log('DONE!!!');\n * });\n * });\n * ```\n *\n * @param {object} data - The Form JSON to create or update.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveForm(data, opts) {\n return this.save('form', data, opts);\n }\n /**\n * Deletes a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.deleteForm().then(() => {\n * console.log('Deleted!');\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteForm(opts) {\n return this.delete('form', opts);\n }\n /**\n * Loads all forms within a project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.loadForms().then((forms) => {\n * console.log(forms);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadForms(query, opts) {\n return this.index('forms', query, opts);\n }\n /**\n * Loads a specific submissionn.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/23423423423423423');\n * formio.loadSubmission().then((submission) => {\n * console.log(submission);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n loadSubmission(query, opts) {\n return this.load('submission', query, opts)\n .then((submission) => {\n this.vId = submission._frid || submission._fvid;\n this.vUrl = `${this.formUrl}/v/${this.vId}`;\n return submission;\n });\n }\n /**\n * Creates a new or Updates an existing submission.\n *\n * ### Create a new submission\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.saveSubmission({\n * data: {\n * firstName: 'Joe',\n * lastName: 'Smith'\n * }\n * }).then((submission) => {\n * // This will now be the complete submission object saved on the server.\n * console.log(submission);\n * });\n * ```\n *\n * ### Update an existing submission\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/23423423423423423');\n * formio.loadSubmission().then((submission) => {\n * submission.data.lastName = 'Thompson';\n * formio.saveSubmission(submission).then(() => {\n * console.log('DONE');\n * });\n * });\n * ```\n *\n * @param {object} data - The submission JSON object.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveSubmission(data, opts) {\n if (!isNaN(parseInt(this.vId)) && !data._fvid) {\n data._fvid = this.vId;\n }\n return this.save('submission', data, opts);\n }\n /**\n * Deletes a submission.\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteSubmission(opts) {\n return this.delete('submission', opts);\n }\n /**\n * Loads all submissions within a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadSubmissions({\n * params: {\n * limit: 25,\n * 'data.lastName__regex': 'smith'\n * }\n * }).then((submissions) => {\n * // Should print out 25 submissions where the last name contains \"smith\".\n * console.log(submissions);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadSubmissions(query, opts) {\n return this.index('submissions', query, opts);\n }\n /**\n * Loads a form action.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.loadAction().then((action) => {\n * console.log(action);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n loadAction(query, opts) {\n return this.load('action', query, opts);\n }\n /**\n * Create a new or update an existing action.\n *\n * ### Create a new action for a form.\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.saveAction({\n * data: {\n * name: 'webhook',\n * title: 'Webhook Action',\n * method: ['create', 'update', 'delete'],\n * handler: ['after'],\n * condition: {},\n * settings: {\n * url: 'https://example.com',\n * headers: [{}],\n * block: false,\n * forwardHeaders: false\n * }\n * }\n * }).then((action) => {\n * console.log(action);\n * });\n * ```\n *\n * ### Update an action\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.loadAction().then((action) => {\n * action.title = 'Updated title';\n * formio.saveAction(action).then(() => {\n * console.log('Done!');\n * });\n * });\n * ```\n *\n * @param {object} data - The action JSON\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Object>}\n */\n saveAction(data, opts) {\n return this.save('action', data, opts);\n }\n /**\n * Delete an action\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/action/234234234234');\n * formio.deleteAction().then(() => {\n * console.log('Action was deleted.');\n * });\n * ```\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n deleteAction(opts) {\n return this.delete('action', opts);\n }\n /**\n * Loads all actions within a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.loadActions().then((actions) => {\n * console.log(actions);\n * });\n * ```\n *\n * @param {object} query - Query parameters similar to {@link Formio#load}.\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<Response>}\n */\n loadActions(query, opts) {\n return this.index('actions', query, opts);\n }\n /**\n * Returns a list of available actions\n *\n * @return {Promise<Response>}\n */\n availableActions() {\n return this.makeRequest('availableActions', `${this.formUrl}/actions`);\n }\n /**\n * Returns the action information for a specific action, such as \"save\".\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/actions/save');\n * formio.actionInfo().then((info) => {\n * console.log(info);\n * });\n * ```\n *\n * @param {string} name - The name of the action you would like to get information for. i.e. \"save\", \"webhook\", etc.\n * @return {Promise<Response>}\n */\n actionInfo(name) {\n return this.makeRequest('actionInfo', `${this.formUrl}/actions/${name}`);\n }\n /**\n * Determine if a string ID is a valid MongoID.\n *\n * @param {string} id - The id that should be tested if it is avalid id.\n * @return {boolean} - true if it is a valid MongoId, false otherwise.\n */\n isObjectId(id) {\n const checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');\n return checkForHexRegExp.test(id);\n }\n /**\n * Get the project ID of project.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io');\n * formio.getProjectId().then((projectId) => {\n * console.log(projectId);\n * };\n * ```\n *\n * @return {Promise<string>}\n */\n getProjectId() {\n if (!this.projectId) {\n return Promise.resolve('');\n }\n if (this.isObjectId(this.projectId)) {\n return Promise.resolve(this.projectId);\n }\n else {\n return this.loadProject().then((project) => {\n return project._id;\n });\n }\n }\n /**\n * Get the ID of a form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example');\n * formio.getFormId().then((formId) => {\n * console.log(formId);\n * });\n * ```\n *\n * @return {Promise<string>}\n */\n getFormId() {\n if (!this.formId) {\n return Promise.resolve('');\n }\n if (this.isObjectId(this.formId)) {\n return Promise.resolve(this.formId);\n }\n else {\n return this.loadForm().then((form) => {\n return form._id;\n });\n }\n }\n /**\n * Instance method for {@link Formio.currentUser}\n *\n * @param {object} options - Options to pass to {@link Formio.request}\n * @return {Promise<object>}\n */\n currentUser(options) {\n return Formio.currentUser(this, options);\n }\n /**\n * Instance method for {@link Formio.accessInfo}\n *\n * @return {Promise<Response>}\n */\n accessInfo() {\n return Formio.accessInfo(this);\n }\n /**\n * Sets OAuth Logout URL.\n *\n * @param {string} uri - Logout URL.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string}\n */\n oauthLogoutURI(uri, options) {\n return Formio.oauthLogoutURI(uri, Object.assign({ formio: this }, this.options, options));\n }\n /**\n * Returns the JWT token for this instance.\n *\n * @param {object} options - The following options are provided.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string} - The JWT token for this user.\n */\n getToken(options) {\n return Formio.getToken(Object.assign({ formio: this }, this.options, options));\n }\n /**\n * Sets the JWT token for this instance.\n *\n * @param {string} token - The JWT token to set.\n * @param {object} options - The following options are provided.\n * @param {string} options.namespace - The localStorage namespace to use when retrieving tokens from storage.\n * @return {string} - The JWT token that was set.\n */\n setToken(token, options) {\n return Formio.setToken(token, Object.assign({ formio: this }, this.options, options));\n }\n /**\n * Returns a temporary authentication token for single purpose token generation.\n *\n * @param {number|string} expire - The amount of seconds to wait before this temp token expires.\n * @param {string} allowed - The allowed path string inn the format GET:/path\n * @param {object} options - The options passed to {@link Formio#getToken}\n */\n getTempToken(expire, allowed, options) {\n const token = Formio.getToken(options);\n if (!token) {\n return Promise.reject('You must be authenticated to generate a temporary auth token.');\n }\n const authUrl = Formio.authUrl || this.projectUrl;\n return this.makeRequest('tempToken', `${authUrl}/token`, 'GET', null, {\n ignoreCache: true,\n header: new Headers({\n 'x-expire': expire,\n 'x-allow': allowed\n })\n });\n }\n /**\n * Get a PDF download url for a submission, which will generate a new PDF of the submission. This method will first\n * fetch a temporary download token, and then append this to the download url for this form.\n *\n * ```ts\n * const formio = new Formio('https://examples.form.io/example/submission/324234234234234');\n * formio.getDownloadUrl().then((url) => {\n * console.log(url);\n * });\n * ```\n *\n * @param {object} [form] - The form JSON to fetch a download url for.\n * @return {Promise<string>} - The download url.\n */\n getDownloadUrl(form) {\n if (!this.submissionId) {\n return Promise.resolve('');\n }\n if (!form) {\n // Make sure to load the form first.\n return this.loadForm().then((_form) => {\n if (!_form) {\n return '';\n }\n return this.getDownloadUrl(_form);\n });\n }\n let apiUrl = `/project/${form.project}`;\n apiUrl += `/form/${form._id}`;\n apiUrl += `/submission/${this.submissionId}`;\n const postfix = form.submissionRevisions && form.settings.changeLog ? '/download/changelog' : '/download';\n apiUrl += postfix;\n let download = this.base + apiUrl;\n return new Promise((resolve, reject) => {\n this.getTempToken(3600, `GET:${apiUrl}`).then((tempToken) => {\n download += `?token=${tempToken.key}`;\n resolve(download);\n }, () => {\n resolve(download);\n }).catch(reject);\n });\n }\n /**\n * Returns the user permissions to a form and submission.\n *\n * @param user - The user or current user if undefined. For anonymous, use \"null\"\n * @param form - The form or current form if undefined. For no form check, use \"null\"\n * @param submission - The submisison or \"index\" if undefined.\n *\n * @return {{create: boolean, read: boolean, edit: boolean, delete: boolean}}\n */\n userPermissions(user, form, submission) {\n return Promise.all([\n (form !== undefined) ? Promise.resolve(form) : this.loadForm(),\n (user !== undefined) ? Promise.resolve(user) : this.currentUser(),\n (submission !== undefined || !this.submissionId) ? Promise.resolve(submission) : this.loadSubmission(),\n this.accessInfo()\n ]).then((results) => {\n const form = results.shift();\n const user = results.shift() || { _id: false, roles: [] };\n const submission = results.shift();\n const access = results.shift();\n const permMap = {\n create: 'create',\n read: 'read',\n update: 'edit',\n delete: 'delete'\n };\n const perms = {\n user: user,\n form: form,\n access: access,\n create: false,\n read: false,\n edit: false,\n delete: false\n };\n for (const roleName in access.roles) {\n if (access.roles.hasOwnProperty(roleName)) {\n const role = access.roles[roleName];\n if (role.default && (user._id === false)) {\n // User is anonymous. Add the anonymous role.\n user.roles.push(role._id);\n }\n else if (role.admin && user.roles.indexOf(role._id) !== -1) {\n perms.create = true;\n perms.read = true;\n perms.delete = true;\n perms.edit = true;\n return perms;\n }\n }\n }\n if (form && form.submissionAccess) {\n for (let i = 0; i < form.submissionAccess.length; i++) {\n const permission = form.submissionAccess[i];\n const [perm, scope] = permission.type.split('_');\n if (['create', 'read', 'update', 'delete'].includes(perm)) {\n if ((0, lodash_1.intersection)(permission.roles, user.roles).length) {\n perms[permMap[perm]] = (scope === 'all') || (!submission || (user._id === submission.owner));\n }\n }\n }\n }\n // check for Group Permissions\n if (submission) {\n // we would anyway need to loop through components for create permission, so we'll do that for all of them\n (0, formUtil_1.eachComponent)(form.components, (component, path) => {\n if (component && component.defaultPermission) {\n const value = (0, lodash_1.get)(submission.data, path);\n // make it work for single-select Group and multi-select Group\n const groups = Array.isArray(value) ? value : [value];\n groups.forEach(group => {\n if (group && group._id && // group id is present\n user.roles.indexOf(group._id) > -1 // user has group id in his roles\n ) {\n if (component.defaultPermission === 'read') {\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'create') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n }\n if (component.defaultPermission === 'write') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n }\n if (component.defaultPermission === 'admin') {\n perms[permMap.create] = true;\n perms[permMap.read] = true;\n perms[permMap.update] = true;\n perms[permMap.delete] = true;\n }\n }\n });\n }\n });\n }\n return perms;\n });\n }\n /**\n * `Determine if the current user can submit a form.\n * @return {*}\n */\n canSubmit() {\n return this.userPermissions().then((perms) => {\n // If there is user and they cannot create, then check anonymous user permissions.\n if (!perms.create && Formio.getUser()) {\n return this.userPermissions(null).then((anonPerms) => {\n if (anonPerms.create) {\n Formio.setUser(null);\n return true;\n }\n return false;\n });\n }\n return perms.create;\n });\n }\n getUrlParts(url) {\n return Formio.getUrlParts(url, this);\n }\n static getUrlParts(url, formio) {\n const base = (formio && formio.base) ? formio.base : Formio.baseUrl;\n let regex = '^(http[s]?:\\\\/\\\\/)';\n if (base && url.indexOf(base) === 0) {\n regex += `(${base.replace(/^http[s]?:\\/\\//, '')})`;\n }\n else {\n regex += '([^/]+)';\n }\n regex += '($|\\\\/.*)';\n return url.match(new RegExp(regex));\n }\n static serialize(obj, _interpolate) {\n const str = [];\n const interpolate = (item) => {\n return _interpolate ? _interpolate(item) : item;\n };\n for (const p in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, p)) {\n str.push(`${encodeURIComponent(p)}=${encodeURIComponent(interpolate(obj[p]))}`);\n }\n }\n return str.join('&');\n }\n static getRequestArgs(formio, type, url, method, data, opts) {\n method = (method || 'GET').toUpperCase();\n if (!opts || !(0, lodash_1.isObject)(opts)) {\n opts = {};\n }\n const requestArgs = {\n url,\n method,\n data: data || null,\n opts\n };\n if (type) {\n requestArgs.type = type;\n }\n if (formio) {\n requestArgs.formio = formio;\n }\n return requestArgs;\n }\n static makeStaticRequest(url, method, data, opts) {\n const requestArgs = Formio.getRequestArgs(null, '', url, method, data, opts);\n const request = Plugins_1.default.pluginWait('preRequest', requestArgs)\n .then(() => Plugins_1.default.pluginGet('staticRequest', requestArgs)\n .then((result) => {\n if ((0, lodash_1.isNil)(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n }));\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', request, requestArgs);\n }\n /**\n * Make an API request and wrap that request with the Form.io Request plugin system. This is very similar to the\n * {Formio.request} method with a difference being that it will pass the request through the Form.io request plugin.\n *\n * @param {Formio} formio - An instance of the Formio class.\n * @param {string} type - The request resource type. \"submission\", \"form\", etc.\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise<Response>}\n */\n static makeRequest(formio, type, url, method, data, opts) {\n if (!formio) {\n return Formio.makeStaticRequest(url, method, data, opts);\n }\n const requestArgs = Formio.getRequestArgs(formio, type, url, method, data, opts);\n requestArgs.opts = requestArgs.opts || {};\n requestArgs.opts.formio = formio;\n //for Formio requests default Accept and Content-type headers\n if (!requestArgs.opts.headers) {\n requestArgs.opts.headers = {};\n }\n requestArgs.opts.headers = (0, lodash_1.defaults)(requestArgs.opts.headers, {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n const request = Plugins_1.default.pluginWait('preRequest', requestArgs)\n .then(() => Plugins_1.default.pluginGet('request', requestArgs)\n .then((result) => {\n if ((0, lodash_1.isNil)(result)) {\n return Formio.request(requestArgs.url, requestArgs.method, requestArgs.data, requestArgs.opts.header, requestArgs.opts);\n }\n return result;\n }));\n return Plugins_1.default.pluginAlter('wrapRequestPromise', request, requestArgs);\n }\n /**\n * Execute an API request to any external system. This is a wrapper around the Web fetch method.\n *\n * ```ts\n * Formio.request('https://examples.form.io').then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {string} url - The URL to request.\n * @param {string} method - The request method. GET, PUT, POST, DELETE, or PATCH\n * @param {object} data - The data to pass to the request (for PUT, POST, and PATCH methods)\n * @param {Headers} header - An object of headers to pass to the request.\n * @param {object} options - An object of options to pass to the request method.\n * @param {boolean} options.ignoreCache - To ignore internal caching of the request.\n * @param {object} options.headers - An object of headers to pass along to the request.\n * @param {boolean} options.noToken - If set to true, this will not include the Form.io x-jwt-token along with the request.\n * @param {string} options.namespace - The Form.io namespace to prepend to all LocalStorage variables such as formioToken.\n * @param {boolean} options.getHeaders - Set this if you wish to include the response headers with the return of this method.\n * @return {Promise<Response>|*}\n */\n static request(url, method, data, header, opts) {\n if (!url) {\n return Promise.reject('No url provided');\n }\n method = (method || 'GET').toUpperCase();\n // For reverse compatibility, if they provided the ignoreCache parameter,\n // then change it back to the options format where that is a parameter.\n if ((0, lodash_1.isBoolean)(opts)) {\n opts = { ignoreCache: opts };\n }\n if (!opts || !(0, lodash_1.isObject)(opts)) {\n opts = {};\n }\n // Generate a cachekey.\n const cacheKey = btoa(encodeURI(url));\n // Get the cached promise to save multiple loads.\n if (!opts.ignoreCache && method === 'GET' && Formio.cache.hasOwnProperty(cacheKey)) {\n return Promise.resolve(Formio.cloneResponse(Formio.cache[cacheKey]));\n }\n if (url[0] === '/') {\n url = Formio.baseUrl + url;\n }\n // Set up and fetch request\n const headers = header || new Headers(opts.headers || {\n 'Accept': 'application/json',\n 'Content-type': 'application/json'\n });\n const token = Formio.getToken(opts);\n if (token && !opts.noToken) {\n headers.set('x-jwt-token', token);\n }\n // The fetch-ponyfill can't handle a proper Headers class anymore. Change it back to an object.\n const headerObj = {};\n headers.forEach(function (value, name) {\n headerObj[name] = value;\n });\n let options = {\n method: method,\n headers: headerObj,\n mode: 'cors'\n };\n if (data) {\n options.body = JSON.stringify(data);\n }\n // Allow plugins to alter the options.\n options = Plugins_1.default.pluginAlter('requestOptions', options, url);\n if (options.namespace || Formio.namespace) {\n opts.namespace = options.namespace || Formio.namespace;\n }\n const requestToken = options.headers['x-jwt-token'];\n const result = Plugins_1.default.pluginAlter('wrapFetchRequestPromise', Formio.fetch(url, options), { url, method, data, opts }).then((response) => {\n // Allow plugins to respond.\n response = Plugins_1.default.pluginAlter('requestResponse', response, Formio, data);\n if (!response.ok) {\n if (response.status === 440) {\n Formio.setToken(null, opts);\n Formio.events.emit('formio.sessionExpired', response.body);\n }\n else if (response.status === 401) {\n Formio.events.emit('formio.unauthorized', response.body);\n }\n else if (response.status === 416) {\n Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);\n }\n else if (response.status === 504) {\n return Promise.reject(new Error('Network request failed'));\n }\n // Parse and return the error as a rejected promise to reject this promise\n return (response.headers.get('content-type').includes('application/json')\n ? response.json()\n : response.text())\n .then((error) => {\n return Promise.reject(error);\n });\n }\n // Handle fetch results\n const respToken = response.headers.get('x-jwt-token');\n // In some strange cases, the fetch library will return an x-jwt-token without sending\n // one to the server. This has even been debugged on the server to verify that no token\n // was introduced with the request, but the response contains a token. This is an Invalid\n // case where we do not send an x-jwt-token and get one in return for any GET request.\n let tokenIntroduced = false;\n if ((method === 'GET') &&\n !requestToken &&\n respToken &&\n !opts.external &&\n !url.includes('token=') &&\n !url.includes('x-jwt-token=')) {\n console.warn('Token was introduced in request.');\n tokenIntroduced = true;\n }\n if (response.status >= 200 &&\n response.status < 300 &&\n respToken &&\n respToken !== '' &&\n !tokenIntroduced) {\n Formio.setToken(respToken, Object.assign(Object.assign({}, opts), { fromCurrent: (opts.fromCurrent || !!requestToken) }));\n }\n // 204 is no content. Don't try to .json() it.\n if (response.status === 204) {\n return {};\n }\n const getResult = response.headers.get('content-type').includes('application/json')\n ? response.json()\n : response.text();\n return getResult.then((result) => {\n // Add some content-range metadata to the result here\n let range = response.headers.get('content-range');\n if (range && (0, lodash_1.isObject)(result)) {\n range = range.split('/');\n if (range[0] !== '*') {\n const skipLimit = range[0].split('-');\n result.skip = Number(skipLimit[0]);\n result.limit = skipLimit[1] - skipLimit[0] + 1;\n }\n result.serverCount = range[1] === '*' ? range[1] : Number(range[1]);\n }\n if (!opts.getHeaders) {\n return result;\n }\n const headers = {};\n response.headers.forEach((item, key) => {\n headers[key] = item;\n });\n // Return the result with the headers.\n return {\n result,\n headers,\n };\n });\n })\n .then((result) => {\n if (opts.getHeaders) {\n return result;\n }\n // Cache the response.\n if (method === 'GET') {\n Formio.cache[cacheKey] = result;\n }\n return Formio.cloneResponse(result);\n })\n .catch((err) => {\n if (err === 'Bad Token' && opts.noToken !== false) {\n Formio.setToken(null, opts);\n Formio.events.emit('formio.badToken', err);\n }\n if (err.message) {\n err = new Error(`Could not connect to API server (${err.message}): ${url}`);\n err.networkError = true;\n }\n if (method === 'GET') {\n delete Formio.cache[cacheKey];\n }\n return Promise.reject(err);\n });\n return result;\n }\n // Needed to maintain reverse compatability...\n static get token() {\n return Formio.tokens.formioToken || '';\n }\n // Needed to maintain reverse compatability...\n static set token(token) {\n Formio.tokens.formioToken = token || '';\n }\n static useSessionToken(options) {\n if (typeof localStorage === 'undefined') {\n return;\n }\n let namespace = options;\n if (typeof options === 'object') {\n options = options.namespace;\n }\n const tokenName = `${namespace || Formio.namespace || 'formio'}Token`;\n const token = localStorage.getItem(tokenName);\n if (token) {\n localStorage.removeItem(tokenName);\n sessionStorage.setItem(tokenName, token);\n }\n const userName = `${namespace || Formio.namespace || 'formio'}User`;\n const user = localStorage.getItem(userName);\n if (user) {\n localStorage.removeItem(userName);\n sessionStorage.setItem(userName, user);\n }\n localStorage.setItem('useSessionToken', 'true');\n }\n /**\n * Sets the JWT in storage to be used within an application.\n *\n * @param {string} token - The JWT token to set.\n * @param {object} options - Options as follows\n * @param {string} options.namespace - The namespace to save the token within. i.e. \"formio\"\n * @param {Formio} options.formio - The Formio instance.\n * @return {Promise<object>|void}\n */\n static setToken(token = '', opts = {}) {\n token = token || '';\n opts = (typeof opts === 'string') ? { namespace: opts } : opts || {};\n const tokenName = `${opts.namespace || Formio.namespace || 'formio'}Token`;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n const storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!token) {\n if (!opts.fromUser) {\n opts.fromToken = true;\n Formio.setUser(null, opts);\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.removeItem(tokenName);\n }\n catch (err) {\n browser_cookies_1.default.erase(tokenName, { path: '/' });\n }\n Formio.tokens[tokenName] = token;\n return Promise.resolve(null);\n }\n if (Formio.tokens[tokenName] !== token) {\n Formio.tokens[tokenName] = token;\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(tokenName, token);\n }\n catch (err) {\n browser_cookies_1.default.set(tokenName, token, { path: '/' });\n }\n }\n // Return or updates the current user\n return Formio.currentUser(opts.formio, opts);\n }\n /**\n * Returns the token set within the application for the user.\n *\n * @param {object} options - The options as follows.\n * @param {string} options.namespace - The namespace of the token you wish to fetch.\n * @param {boolean} options.decode - If you would like the token returned as decoded JSON.\n * @return {*}\n */\n static getToken(options) {\n options = (typeof options === 'string') ? { namespace: options } : options || {};\n const tokenName = `${options.namespace || Formio.namespace || 'formio'}Token`;\n const decodedTokenName = options.decode ? `${tokenName}Decoded` : tokenName;\n if (!Formio.tokens) {\n Formio.tokens = {};\n }\n if (Formio.tokens[decodedTokenName]) {\n return Formio.tokens[decodedTokenName];\n }\n try {\n const token = localStorage.getItem('useSessionToken')\n ? sessionStorage.getItem(tokenName)\n : localStorage.getItem(tokenName);\n Formio.tokens[tokenName] = token || '';\n if (options.decode) {\n Formio.tokens[decodedTokenName] = Formio.tokens[tokenName] ? (0, jwtDecode_1.jwtDecode)(Formio.tokens[tokenName]) : {};\n return Formio.tokens[decodedTokenName];\n }\n return Formio.tokens[tokenName];\n }\n catch (e) {\n Formio.tokens[tokenName] = browser_cookies_1.default.get(tokenName);\n return '';\n }\n }\n /**\n * Sets the current user within the application cache.\n *\n * @param {object} user - JSON object of the user you wish to set.\n * @param {object} options - Options as follows\n * @param {string} options.namespace - The namespace of the tokens\n */\n static setUser(user, opts = {}) {\n const userName = `${opts.namespace || Formio.namespace || 'formio'}User`;\n const storage = localStorage.getItem('useSessionToken') ? sessionStorage : localStorage;\n if (!user) {\n if (!opts.fromToken) {\n opts.fromUser = true;\n Formio.setToken(null, opts);\n }\n // Emit an event on the cleared user.\n Formio.events.emit('formio.user', null);\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n return storage.removeItem(userName);\n }\n catch (err) {\n return browser_cookies_1.default.erase(userName, { path: '/' });\n }\n }\n // iOS in private browse mode will throw an error but we can't detect ahead of time that we are in private mode.\n try {\n storage.setItem(userName, JSON.stringify(user));\n }\n catch (err) {\n browser_cookies_1.default.set(userName, JSON.stringify(user), { path: '/' });\n }\n // Emit an event on the authenticated user.\n Formio.events.emit('formio.user', user);\n }\n /**\n * Returns the user JSON.\n *\n * @param {object} options - Options as follows\n * @param {string} namespace - The namespace of the tokens stored within this application.\n * @return {object} - The user object.\n */\n static getUser(options) {\n options = options || {};\n const userName = `${options.namespace || Formio.namespace || 'formio'}User`;\n try {\n return JSON.parse((localStorage.getItem('useSessionToken')\n ? sessionStorage\n : localStorage).getItem(userName) || '');\n }\n catch (e) {\n return JSON.parse(browser_cookies_1.default.get(userName));\n }\n }\n /**\n * Sets the BaseURL for the application.\n *\n * @description Every application developed using the JavaScript SDK must set both the {@link Formio.setBaseUrl} and\n * {@link Formio.setProjectUrl} methods. These two functions ensure that every URL passed into the constructor of this\n * class can determine the \"project\" context for which the application is running.\n *\n * Any Open Source server applications will set both the {@link Formio.setBaseUrl} and {@link Formio.setProjectUrl}\n * values will be the same value.\n *\n * ```ts\n * Formio.setBaseUrl('https://yourwebsite.com/forms');\n * Formio.setProjectUrl('https://yourwebsite.com/forms/project');\n *\n * // Now the Formio constructor will know what is the \"project\" and what is the form alias name. Without setBaseUrl\n * // and setProjectUrl, this would throw an error.\n *\n * const formio = new Formio('https://yourwebsite.com/forms/project/user');\n * formio.loadForm().then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * @param {string} url - The URL of the Base API url.\n */\n static setBaseUrl(url) {\n Formio.baseUrl = url;\n if (!Formio.projectUrlSet) {\n Formio.projectUrl = url;\n }\n }\n /**\n * Returns the current base url described at {@link Formio.setBaseUrl}\n *\n * @return {string} - The base url of the application.\n */\n static getBaseUrl() {\n return Formio.baseUrl;\n }\n static setApiUrl(url) {\n return Formio.setBaseUrl(url);\n }\n static getApiUrl() {\n return Formio.getBaseUrl();\n }\n static setAppUrl(url) {\n console.warn('Formio.setAppUrl() is deprecated. Use Formio.setProjectUrl instead.');\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n /**\n * Sets the Project Url for the application. This is an important method that needs to be set for all applications. It\n * is documented @ {@link Formio.setBaseUrl}.\n *\n * @param {string} url - The project api url.\n */\n static setProjectUrl(url) {\n Formio.projectUrl = url;\n Formio.projectUrlSet = true;\n }\n /**\n * The Auth URL can be set to customize the authentication requests made from an application. By default, this is\n * just the same value as {@link Formio.projectUrl}\n *\n * @param {string} url - The authentication url\n */\n static setAuthUrl(url) {\n Formio.authUrl = url;\n }\n static getAppUrl() {\n console.warn('Formio.getAppUrl() is deprecated. Use Formio.getProjectUrl instead.');\n return Formio.projectUrl;\n }\n /**\n * Returns the Project url described at {@link Formio.setProjectUrl}\n *\n * @return {string|string} - The Project Url.\n */\n static getProjectUrl() {\n return Formio.projectUrl;\n }\n /**\n * Clears the runtime internal API cache.\n *\n * @description By default, the Formio class will cache all API requests in memory so that any subsequent requests\n * using GET method will return the cached results as long as the API URl is the same as what was cached previously.\n * This cache can be cleared using this method as follows.\n *\n * ```ts\n * Formio.clearCache();\n * ```\n *\n * Or, if you just wish to clear a single request, then the {@link Formio.request#options.ignoreCache} option can be\n * provided when making an API request as follows.\n *\n * ```ts\n * Formio.loadForm({}, {\n * ignoreCache: true\n * }).then((form) => {\n * console.log(form);\n * });\n * ```\n *\n * Both of the following will ensure that a new request is made to the API server and that the results will not be\n * from the cached result.\n */\n static clearCache() {\n Formio.cache = {};\n }\n /**\n * Return the access information about a Project, such as the Role ID's for that project, and if the server is\n * configured to do so, the Form and Resource access configurations that the authenticated user has access to.\n *\n * @description This is useful for an application to determine the UI for a specific user to identify which forms they have\n * access to submit or read.\n *\n * @param {Formio} formio - The Formio instance.\n * @return {Promise<Response>}\n */\n static accessInfo(formio) {\n const projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'accessInfo', `${projectUrl}/access`);\n }\n /**\n * Returns an array of roles for the project, which includes the ID's and names of those roles.\n *\n * @param {Formio} formio - The Formio instance.\n * @return {Promise<Response>}\n */\n static projectRoles(formio) {\n const projectUrl = formio ? formio.projectUrl : Formio.projectUrl;\n return Formio.makeRequest(formio, 'projectRoles', `${projectUrl}/role`);\n }\n /**\n * Return the currentUser object. This will fetch the user from the server and respond with the Submission JSON\n * of that user object.\n *\n * @param {Formio} formio - The Formio instance\n * @param {object} options - The options passed to {@link Formio.getUser}\n * @return {Promise<R>|*}\n */\n static currentUser(formio, options = {}) {\n let authUrl = Formio.authUrl;\n if (!authUrl) {\n authUrl = formio ? formio.projectUrl : (Formio.projectUrl || Formio.baseUrl);\n }\n authUrl += '/current';\n if (!options.ignoreCache || options.fromCurrent) {\n const user = Formio.getUser(options);\n if (user) {\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', Promise.resolve(user), {\n url: authUrl,\n method: 'GET',\n options\n });\n }\n }\n const token = Formio.getToken(options);\n if ((!options || !options.external) && !token) {\n return Plugins_1.default.pluginAlter('wrapStaticRequestPromise', Promise.resolve(null), {\n url: authUrl,\n method: 'GET',\n options\n });\n }\n options.fromCurrent = true;\n return Formio.makeRequest(formio, 'currentUser', authUrl, 'GET', null, options)\n .then((response) => {\n Formio.setUser(response, options);\n return response;\n });\n }\n /**\n * Performs a logout of the Form.io application. This will reset all cache, as well as make a request to the logout\n * endpoint of the Form.io api platform.\n *\n * @param {Formio} formio - A Formio instance.\n * @param {object} options - Options passed to both {@link Formio.setToken} as well as {@link Formio.setUser}\n * @return {Promise<Response>}\n */\n static logout(formio, options = {}) {\n options.formio = formio;\n const projectUrl = Formio.authUrl ? Formio.authUrl : (formio ? formio.projectUrl : Formio.baseUrl);\n const logout = () => {\n Formio.setToken(null, options);\n Formio.setUser(null, options);\n Formio.clearCache();\n localStorage.removeItem('useSessionToken');\n };\n return Formio.makeRequest(formio, 'logout', `${projectUrl}/logout`)\n .then(function (result) {\n logout();\n if (result.shouldRedirect && result.url) {\n window.location.href = result.url;\n }\n return result;\n })\n .catch(function (err) {\n logout();\n throw err;\n });\n }\n /**\n * Returns the query passed to a page in JSON object format.\n *\n * @description For example, lets say you visit your application using\n * the url as follows.\n *\n * ```\n * https://yourapplication.com/?token=23423423423&username=Joe\n * ```\n *\n * The following code will provide your application with the following.\n *\n * ```ts\n * const query Formio.pageQuery();\n * console.log(query.token); // Will print 23423423423\n * console.log(query.username); // Will print Joe\n * ```\n *\n * @return {{}} - A JSON object representation of the query that was passed to the URL of an application.\n */\n static pageQuery() {\n const pageQuery = {};\n pageQuery.paths = [];\n const hashes = location.hash.substr(1).replace(/\\?/g, '&').split('&');\n let parts = [];\n location.search.substr(1).split('&').forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n });\n hashes.forEach(function (item) {\n parts = item.split('=');\n if (parts.length > 1) {\n pageQuery[parts[0]] = parts[1] && decodeURIComponent(parts[1]);\n }\n else if (item.indexOf('/') === 0) {\n pageQuery.paths = item.substr(1).split('/');\n }\n });\n return pageQuery;\n }\n /**\n * Much like {@link Formio.currentUser}, but instead automatically injects the Bearer tokens into the headers to\n * perform a Token swap of the OAuth token which will then return the JWT token for that user.\n *\n * @param {Formio} formio - The Formio instance\n * @param {string} token - An OAuth Bearer token to use for a token swap between the OAuth provider and Form.io\n * @return {Promise<R>|*}\n */\n static oAuthCurrentUser(formio, token) {\n return Formio.currentUser(formio, {\n external: true,\n headers: {\n Authorization: `Bearer ${token}`\n }\n });\n }\n static oauthLogoutURI(uri, options) {\n options = (typeof options === 'string') ? { namespace: options } : options || {};\n const logoutURIName = `${options.namespace || Formio.namespace || 'formio'}LogoutAuthUrl`;\n Formio.tokens[logoutURIName];\n localStorage.setItem(logoutURIName, uri);\n return Formio.tokens[logoutURIName];\n }\n /**\n * Perform a SAML initialization.\n *\n * @description Typically, you would use the {@link Formio.ssoInit} method to perform this function\n * since this method is an alias for the following.\n *\n * ```ts\n * Formio.samlInit();\n * Formio.ssoInit('saml'); // This is the exact same thing as calling Formio.samlInit\n * ```\n *\n * This method will return false if the process is just starting. The code below is a typical block of code that is\n * used to automatically trigger the SAML authentication process within your application using a Button component.\n *\n * ```ts\n * if (Formio.pageQuery().saml) {\n * const sso = Formio.samlInit();\n * if (sso) {\n * sso.then((user) => {\n * // The SSO user is now loaded!\n * console.log(user);\n * });\n * }\n * }\n * ```\n *\n * You can then place the following code withiin the \"Custom\" action of a Button component on your form.\n *\n * ```ts\n * Formio.samlInit();\n * ```\n *\n * Now when you click on this button, it will start the handshake process with SAML, and once it returns, will pass\n * a \"saml\" query parameter back to your application which will execute the code to load the current user from SAML.\n *\n * @param {object} options - Options to pass to the SAML initialization process.\n * @param {string} options.relay - The URL that will be used as the authentication \"relay\" that occurs during a SAML handshake process.\n * @return {boolean|Promise<Object>|void}\n */\n static samlInit(options = {}) {\n const query = Formio.pageQuery();\n if (query.saml) {\n Formio.setUser(null);\n const retVal = Formio.setToken(query.saml);\n let uri = window.location.toString();\n uri = uri.substring(0, uri.indexOf('?'));\n if (window.location.hash) {\n uri += window.location.hash;\n }\n window.history.replaceState({}, document.title, uri);\n return retVal;\n }\n // Set the relay if not provided.\n if (!options.relay) {\n options.relay = window.location.href;\n }\n // go to the saml sso endpoint for this project.\n const authUrl = Formio.authUrl || Formio.projectUrl;\n window.location.href = `${authUrl}/saml/sso?relay=${encodeURI(options.relay)}`;\n return false;\n }\n /**\n * Perform an Okta Authentication process using the {@link https://developer.okta.com/code/javascript/okta_auth_sdk|Okta SDK}.\n *\n * @description This method does require that you first include the Okta JavaScript SDK within your application as follows.\n *\n * First you need to include the Okta Authentication script.\n *\n * ```html\n * <script src=\"https://ok1static.oktacdn.com/assets/js/sdk/okta-auth-js/2.0.1/okta-auth-js.min.js\" type=\"text/javascript\"></script>\n * ```\n *\n * Then you can call this method as follows.\n *\n * ```ts\n * Formio.oktaInit();\n * ```\n *\n * @param {object} options - Options that are passed directly to the {@link https://github.com/okta/okta-auth-js#configuration-reference|Okta SDK constructor}\n * @param {constructor} options.OktaAuth - If the OktaAuth constructor is not provided global to the application, it can be provided to this method using this property.\n * @param {Formio} options.formio - The Formio instance.\n * @param {Array<string>} options.scopes - Scopes that are passed to the {@link https://github.com/okta/okta-auth-js#tokengetwithredirectoptions|getWithRedirect} method from the Okta SDK.\n * @return {Promise<Object>}\n */\n static oktaInit(options = {}) {\n if (typeof OktaAuth !== undefined) {\n options.OktaAuth = OktaAuth;\n }\n if (typeof options.OktaAuth === undefined) {\n const errorMessage = 'Cannot find OktaAuth. Please include the Okta JavaScript SDK within your application. See https://developer.okta.com/code/javascript/okta_auth_sdk for an example.';\n console.warn(errorMessage);\n return Promise.reject(errorMessage);\n }\n return new Promise((resolve, reject) => {\n const Okta = options.OktaAuth;\n delete options.OktaAuth;\n const authClient = new Okta(options);\n authClient.tokenManager.get('accessToken')\n .then((accessToken) => {\n if (accessToken) {\n resolve(Formio.oAuthCurrentUser(options.formio, accessToken.accessToken));\n }\n else if (location.hash) {\n authClient.token.parseFromUrl()\n .then((token) => {\n authClient.tokenManager.add('accessToken', token);\n resolve(Formio.oAuthCurrentUser(options.formio, token.accessToken));\n })\n .catch((err) => {\n console.warn(err);\n reject(err);\n });\n }\n else {\n authClient.token.getWithRedirect({\n responseType: 'token',\n scopes: options.scopes\n });\n resolve(false);\n }\n })\n .catch((error) => {\n reject(error);\n });\n });\n }\n /**\n * A common static method to trigger any SSO processes. This method is really just an alias for other static methods.\n *\n * @param {('saml'|'okta')} type - The type of SSO to trigger. 'saml' is an alias for {@link Formio.samlInit}, and 'okta' is an alias for {@link Formio.oktaInit}.\n * @param {object} options - Options to pass to the specific sso methods\n * @return {*|Promise<Object>|boolean|void}\n */\n static ssoInit(type, options = {}) {\n switch (type) {\n case 'saml':\n return Formio.samlInit(options);\n case 'okta':\n return Formio.oktaInit(options);\n default:\n console.warn('Unknown SSO type');\n return Promise.reject('Unknown SSO type');\n }\n }\n /**\n * Lazy load a remote library dependency.\n *\n * @description This is useful for components that wish to lazy load a required library\n * by adding that library to the <scripts> section of the HTML webpage, and then provide a promise that will resolve\n * when the library becomes available for use.\n *\n * @example Load Google Maps API.\n * ```ts\n * Formio.requireLibrary('googleMaps', 'google.maps.Map', 'https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap', true).then(() => {\n * // Once the promise resolves, the following can now be used within your application.\n * const map = new google.maps.Map(document.getElementById(\"map\"), {...});\n * });\n * ```\n *\n * @param {string} name - The internal name to give to the library you are loading. This is useful for caching the library for later use.\n * @param {string} property - The name of the global property that will be added to the global namespace once the library has been loaded. This is used to check to see if the property exists before resolving the promise that the library is ready for use.\n * @param {string} src - The URL of the library to lazy load.\n * @param {boolean} polling - Determines if polling should be used to determine if they library is ready to use. If set to false, then it will rely on a global callback called ${name}Callback where \"name\" is the first property passed to this method. When this is called, that will indicate when the library is ready. In most cases, you will want to pass true to this parameter to initiate a polling method to check for the library availability in the global context.\n * @return {Promise<object>} - A promise that will resolve when the plugin is ready to be used.\n */\n static requireLibrary(name, property, src, polling = false, onload) {\n if (!Formio.libraries.hasOwnProperty(name)) {\n Formio.libraries[name] = {};\n Formio.libraries[name].ready = new Promise((resolve, reject) => {\n Formio.libraries[name].resolve = resolve;\n Formio.libraries[name].reject = reject;\n });\n const callbackName = `${name}Callback`;\n if (!polling && !window[callbackName]) {\n window[callbackName] = () => Formio.libraries[name].resolve();\n }\n // See if the plugin already exists.\n const plugin = (0, lodash_1.get)(window, property);\n if (plugin) {\n Formio.libraries[name].resolve(plugin);\n }\n else {\n src = Array.isArray(src) ? src : [src];\n src.forEach((lib) => {\n let attrs = {};\n let elementType = '';\n if (typeof lib === 'string') {\n lib = {\n type: 'script',\n src: lib,\n };\n }\n switch (lib.type) {\n case 'script':\n elementType = 'script';\n attrs = {\n src: lib.src,\n type: 'text/javascript',\n defer: true,\n async: true,\n referrerpolicy: 'origin',\n };\n break;\n case 'styles':\n elementType = 'link';\n attrs = {\n href: lib.src,\n rel: 'stylesheet',\n };\n break;\n }\n // Add the script to the top of the page.\n const element = document.createElement(elementType);\n if (element.setAttribute) {\n for (const attr in attrs) {\n element.setAttribute(attr, attrs[attr]);\n }\n }\n if (onload) {\n element.addEventListener('load', () => {\n Formio.libraries[name].loaded = true;\n onload(Formio.libraries[name].ready);\n });\n }\n const { head } = document;\n if (head) {\n head.appendChild(element);\n }\n });\n // if no callback is provided, then check periodically for the script.\n if (polling) {\n const interval = setInterval(() => {\n const plugin = (0, lodash_1.get)(window, property);\n if (plugin) {\n clearInterval(interval);\n Formio.libraries[name].resolve(plugin);\n }\n }, 200);\n }\n }\n }\n const lib = Formio.libraries[name];\n return onload && lib.loaded ? onload(lib.ready) : lib.ready;\n }\n /**\n * Determines if a lazy loaded library is ready to be used.\n *\n * @description Example: Let's assume that the example provided at {@link Formio.requireLibrary} was used elsewhere in your application.\n * You could now use the following within a separate place that will also resolve once the library is ready to be used.\n *\n * ```js\n * Formio.libraryReady('googleMaps').then(() => {\n * // Once the promise resolves, the following can now be used within your application.\n * const map = new google.maps.Map(document.getElementById(\"map\"), {...});\n * });\n * ```\n *\n * @param {string} name - The name of the library to check.\n * @return {Promise<object>} - A promise that will resolve when the library is ready to be used.\n */\n static libraryReady(name) {\n if (Formio.libraries.hasOwnProperty(name) &&\n Formio.libraries[name].ready) {\n return Formio.libraries[name].ready;\n }\n return Promise.reject(`${name} library was not required.`);\n }\n /**\n * Clones the response from the API so that it cannot be mutated.\n *\n * @param response\n */\n static cloneResponse(response) {\n const copy = (0, fastCloneDeep_1.fastCloneDeep)(response);\n if (Array.isArray(response)) {\n copy.skip = response.skip;\n copy.limit = response.limit;\n copy.serverCount = response.serverCount;\n }\n return copy;\n }\n /**\n * Sets the project path type.\n *\n * @param type\n */\n static setPathType(type) {\n if (typeof type === 'string') {\n Formio.pathType = type;\n }\n }\n /**\n * Gets the project path type.\n */\n static getPathType() {\n return Formio.pathType;\n }\n}\nexports.Formio = Formio;\n/**\n * The base API url of the Form.io Platform. Example: https://api.form.io\n */\nFormio.baseUrl = 'https://api.form.io';\n/**\n * The project API url of the Form.io Project. Example: https://examples.form.io\n */\nFormio.projectUrl = '';\n/**\n * The project url to use for Authentication.\n */\nFormio.authUrl = '';\n/**\n * Set to true if the project url has been established with ```Formio.setProjectUrl()```\n */\nFormio.projectUrlSet = false;\n/**\n * The Form.io API Cache. This ensures that requests to the same API endpoint are cached.\n */\nFormio.cache = {};\n/**\n * The namespace used to save the Form.io Token's and variables within an application.\n */\nFormio.namespace = '';\n/**\n * Handles events fired within this SDK library.\n */\nFormio.events = new eventemitter3_1.default();\n/**\n * Stores all of the libraries lazy loaded with ```Formio.requireLibrary``` method.\n */\nFormio.libraries = {};\n/**\n * A direct interface to the Form.io fetch polyfill.\n */\nFormio.fetch = fetch;\n/**\n * A direct interface to the Form.io fetch Headers polyfill.\n */\nFormio.Headers = Headers;\n/**\n * All of the auth tokens for this session.\n */\nFormio.tokens = {};\n/**\n * The version of this library.\n */\nFormio.version = '---VERSION---';\n// Add Plugin methods.\nFormio.plugins = Plugins_1.default.plugins;\nFormio.deregisterPlugin = Plugins_1.default.deregisterPlugin;\nFormio.registerPlugin = Plugins_1.default.registerPlugin;\nFormio.getPlugin = Plugins_1.default.getPlugin;\nFormio.pluginWait = Plugins_1.default.pluginWait;\nFormio.pluginGet = Plugins_1.default.pluginGet;\nFormio.pluginAlter = Plugins_1.default.pluginAlter;\n// Adds Formio to the Plugins Interface.\nPlugins_1.default.Formio = Formio;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/sdk/Formio.js?");
|
473
418
|
|
474
419
|
/***/ }),
|
475
420
|
|
@@ -656,7 +601,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));
|
|
656
601
|
/***/ (function(__unused_webpack_module, exports) {
|
657
602
|
|
658
603
|
"use strict";
|
659
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n// All external libs URLs should be injected through this class.\n// CDN libs URLs are accessible throuh CDN object properties\n// like Formio.cdn.ace === 'http://cdn.form.io/ace/1.4.12'.\n// For latest version use empty string\nclass CDN {\n constructor(baseUrl, overrides = {}) {\n this.baseUrl = baseUrl ||
|
604
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n// All external libs URLs should be injected through this class.\n// CDN libs URLs are accessible throuh CDN object properties\n// like Formio.cdn.ace === 'http://cdn.form.io/ace/1.4.12'.\n// For latest version use empty string\nclass CDN {\n constructor(baseUrl, overrides = {}) {\n this.baseUrl = baseUrl || CDN.defaultCDN;\n this.overrides = overrides;\n this.libs = {\n 'js': '',\n 'ace': '1.4.12',\n 'bootstrap': '5.3.2',\n 'bootstrap4': '4.6.2',\n 'bootstrap5': '5.3.2',\n 'bootstrap-icons': '1.11.1',\n 'ckeditor': '19.0.0',\n 'flatpickr': '4.6.8',\n 'flatpickr-formio': '4.6.13-formio.3',\n 'font-awesome': '4.7.0',\n 'grid': 'latest',\n 'moment-timezone': 'latest',\n 'quill': '2.0.0-dev.3',\n 'shortcut-buttons-flatpickr': '0.4.0',\n 'uswds': '2.4.8',\n 'core': ''\n };\n this.updateUrls();\n }\n getVersion(lib) {\n return this.libs[lib];\n }\n // Sets a specific library version\n setVersion(lib, version) {\n this.libs[lib] = version;\n this.updateUrls();\n }\n // Sets base CDN url for all libraries\n setBaseUrl(url) {\n this.baseUrl = url;\n this.updateUrls();\n }\n // Allows to override CDN url for a specific library\n setOverrideUrl(lib, url) {\n this.overrides[lib] = url;\n this.updateUrls();\n }\n // Removes override for a specific library\n removeOverride(lib) {\n delete this.overrides[lib];\n this.updateUrls();\n }\n // Removes all overrides\n removeOverrides() {\n this.overrides = {};\n this.updateUrls();\n }\n buildUrl(cdnUrl, lib, version) {\n let url;\n if (version === 'latest' || version === '') {\n url = `${cdnUrl}/${lib}`;\n }\n else {\n url = `${cdnUrl}/${lib}/${version}`;\n }\n return url;\n }\n updateUrls() {\n for (const lib in this.libs) {\n if (lib in this.overrides) {\n this[lib] = this.buildUrl(this.overrides[lib], lib, this.libs[lib]);\n }\n else {\n this[lib] = this.buildUrl(this.baseUrl, lib, this.libs[lib]);\n }\n }\n }\n}\nCDN.defaultCDN = 'https://cdn.form.io';\nexports[\"default\"] = CDN;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/CDN.js?");
|
660
605
|
|
661
606
|
/***/ }),
|
662
607
|
|
@@ -766,7 +711,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
766
711
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
767
712
|
|
768
713
|
"use strict";
|
769
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst xhr_1 = __importDefault(__webpack_require__(/*! ./xhr */ \"./lib/cjs/providers/storage/xhr.js\"));\
|
714
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst xhr_1 = __importDefault(__webpack_require__(/*! ./xhr */ \"./lib/cjs/providers/storage/xhr.js\"));\nfunction azure(formio) {\n return {\n uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) {\n return xhr_1.default.upload(formio, 'azure', (xhr, response) => {\n xhr.openAndSetHeaders('PUT', response.url);\n xhr.setRequestHeader('Content-Type', file.type);\n xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob');\n return file;\n }, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then(() => {\n return {\n storage: 'azure',\n name: xhr_1.default.path([dir, fileName]),\n size: file.size,\n type: file.type,\n groupPermissions,\n groupId,\n };\n });\n },\n downloadFile(file) {\n return formio.makeRequest('file', `${formio.formUrl}/storage/azure?name=${xhr_1.default.trim(file.name)}`, 'GET');\n }\n };\n}\nazure.title = 'Azure File Services';\nexports[\"default\"] = azure;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/azure.js?");
|
770
715
|
|
771
716
|
/***/ }),
|
772
717
|
|
@@ -777,7 +722,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
777
722
|
/***/ (function(__unused_webpack_module, exports) {
|
778
723
|
|
779
724
|
"use strict";
|
780
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\
|
725
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction base64() {\n return {\n title: 'Base64',\n name: 'base64',\n uploadFile(file, fileName) {\n const reader = new FileReader();\n return new Promise((resolve, reject) => {\n reader.onload = (event) => {\n const url = event.target.result;\n resolve({\n storage: 'base64',\n name: fileName,\n url: url,\n size: file.size,\n type: file.type,\n });\n };\n reader.onerror = () => {\n return reject(this);\n };\n reader.readAsDataURL(file);\n });\n },\n downloadFile(file) {\n // Return the original as there is nothing to do.\n return Promise.resolve(file);\n }\n };\n}\nbase64.title = 'Base64';\nexports[\"default\"] = base64;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/base64.js?");
|
781
726
|
|
782
727
|
/***/ }),
|
783
728
|
|
@@ -788,7 +733,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\ncons
|
|
788
733
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
789
734
|
|
790
735
|
"use strict";
|
791
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst xhr_1 = __webpack_require__(/*! ./xhr */ \"./lib/cjs/providers/storage/xhr.js\");\
|
736
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst xhr_1 = __webpack_require__(/*! ./xhr */ \"./lib/cjs/providers/storage/xhr.js\");\nfunction googledrive(formio) {\n return {\n uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) {\n return new Promise(((resolve, reject) => {\n // Send the file with data.\n const xhr = new XMLHttpRequest();\n if (typeof progressCallback === 'function') {\n xhr.upload.onprogress = progressCallback;\n }\n if (typeof abortCallback === 'function') {\n abortCallback(() => xhr.abort());\n }\n const fd = new FormData();\n fd.append('name', fileName);\n fd.append('dir', dir);\n fd.append('file', file);\n // Fire on network error.\n xhr.onerror = (err) => {\n err.networkError = true;\n reject(err);\n };\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n const response = JSON.parse(xhr.response);\n response.storage = 'googledrive';\n response.size = file.size;\n response.type = file.type;\n response.groupId = groupId;\n response.groupPermissions = groupPermissions;\n resolve(response);\n }\n else {\n reject(xhr.response || 'Unable to upload file');\n }\n };\n xhr.onabort = reject;\n xhr.open('POST', `${formio.formUrl}/storage/gdrive`);\n (0, xhr_1.setXhrHeaders)(formio, xhr);\n const token = formio.getToken();\n if (token) {\n xhr.setRequestHeader('x-jwt-token', token);\n }\n xhr.send(fd);\n }));\n },\n downloadFile(file) {\n const token = formio.getToken();\n file.url =\n `${formio.formUrl}/storage/gdrive?fileId=${file.id}&fileName=${file.originalName}${token ? `&x-jwt-token=${token}` : ''}`;\n return Promise.resolve(file);\n }\n };\n}\ngoogledrive.title = 'Google Drive';\nexports[\"default\"] = googledrive;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/googleDrive.js?");
|
792
737
|
|
793
738
|
/***/ }),
|
794
739
|
|
@@ -810,7 +755,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
810
755
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
811
756
|
|
812
757
|
"use strict";
|
813
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst uuid_1 = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/commonjs-browser/index.js\");\
|
758
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst uuid_1 = __webpack_require__(/*! uuid */ \"./node_modules/uuid/dist/commonjs-browser/index.js\");\nfunction indexeddb() {\n return {\n title: 'indexedDB',\n name: 'indexeddb',\n uploadFile(file, fileName, dir, progressCallback, url, options) {\n if (!('indexedDB' in window)) {\n console.log('This browser doesn\\'t support IndexedDB');\n return;\n }\n return new Promise((resolve) => {\n const request = indexedDB.open(options.indexeddb);\n request.onsuccess = function (event) {\n const db = event.target.result;\n resolve(db);\n };\n request.onupgradeneeded = function (e) {\n const db = e.target.result;\n db.createObjectStore(options.indexeddbTable);\n };\n }).then((db) => {\n const reader = new FileReader();\n return new Promise((resolve, reject) => {\n reader.onload = () => {\n const blobObject = new Blob([file], { type: file.type });\n const id = (0, uuid_1.v4)(blobObject);\n const data = {\n id,\n data: blobObject,\n name: file.name,\n size: file.size,\n type: file.type,\n url,\n };\n const trans = db.transaction([options.indexeddbTable], 'readwrite');\n const addReq = trans.objectStore(options.indexeddbTable).put(data, id);\n addReq.onerror = function (e) {\n console.log('error storing data');\n console.error(e);\n };\n trans.oncomplete = function () {\n resolve({\n storage: 'indexeddb',\n name: file.name,\n size: file.size,\n type: file.type,\n url: url,\n id,\n });\n };\n };\n reader.onerror = () => {\n return reject(this);\n };\n reader.readAsDataURL(file);\n });\n });\n },\n downloadFile(file, options) {\n return new Promise((resolve) => {\n const request = indexedDB.open(options.indexeddb);\n request.onsuccess = function (event) {\n const db = event.target.result;\n resolve(db);\n };\n }).then((db) => {\n return new Promise((resolve, reject) => {\n const trans = db.transaction([options.indexeddbTable], 'readonly');\n const store = trans.objectStore(options.indexeddbTable).get(file.id);\n store.onsuccess = () => {\n trans.oncomplete = () => {\n const result = store.result;\n const dbFile = new File([store.result.data], file.name, {\n type: store.result.type,\n });\n const reader = new FileReader();\n reader.onload = (event) => {\n result.url = event.target.result;\n result.storage = file.storage;\n resolve(result);\n };\n reader.onerror = () => {\n return reject(this);\n };\n reader.readAsDataURL(dbFile);\n };\n };\n store.onerror = () => {\n return reject(this);\n };\n });\n });\n },\n deleteFile(file, options) {\n return new Promise((resolve) => {\n const request = indexedDB.open(options.indexeddb);\n request.onsuccess = function (event) {\n const db = event.target.result;\n resolve(db);\n };\n }).then((db) => {\n return new Promise((resolve, reject) => {\n const trans = db.transaction([options.indexeddbTable], 'readwrite');\n const store = trans.objectStore(options.indexeddbTable).delete(file.id);\n store.onsuccess = () => {\n trans.oncomplete = () => {\n const result = store.result;\n resolve(result);\n };\n };\n store.onerror = () => {\n return reject(this);\n };\n });\n });\n }\n };\n}\nindexeddb.title = 'IndexedDB';\nexports[\"default\"] = indexeddb;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/indexeddb.js?");
|
814
759
|
|
815
760
|
/***/ }),
|
816
761
|
|
@@ -821,7 +766,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\ncons
|
|
821
766
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
822
767
|
|
823
768
|
"use strict";
|
824
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst xhr_1 = __importDefault(__webpack_require__(/*! ./xhr */ \"./lib/cjs/providers/storage/xhr.js\"));\nconst
|
769
|
+
eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst xhr_1 = __importDefault(__webpack_require__(/*! ./xhr */ \"./lib/cjs/providers/storage/xhr.js\"));\nconst util_1 = __webpack_require__(/*! ./util */ \"./lib/cjs/providers/storage/util.js\");\nconst AbortController = window.AbortController || __webpack_require__(/*! abortcontroller-polyfill/dist/cjs-ponyfill */ \"./node_modules/abortcontroller-polyfill/dist/cjs-ponyfill.js\");\nfunction s3(formio) {\n return {\n uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n const xhrCallback = (xhr, response, abortCallback) => __awaiter(this, void 0, void 0, function* () {\n response.data.fileName = fileName;\n response.data.key = xhr_1.default.path([response.data.key, dir, fileName]);\n if (response.signed) {\n if (multipartOptions && Array.isArray(response.signed)) {\n // patch abort callback\n const abortController = new AbortController();\n const abortSignal = abortController.signal;\n if (typeof abortCallback === 'function') {\n abortCallback(() => abortController.abort());\n }\n try {\n const parts = yield this.uploadParts(file, response.signed, response.data.headers, response.partSizeActual, multipartOptions, abortSignal);\n yield (0, util_1.withRetries)(this.completeMultipartUpload, [response, parts, multipartOptions], 3);\n return;\n }\n catch (err) {\n // abort in-progress fetch requests\n abortController.abort();\n // attempt to cancel the multipart upload\n this.abortMultipartUpload(response);\n throw err;\n }\n }\n else {\n xhr.openAndSetHeaders('PUT', response.signed);\n xhr.setRequestHeader('Content-Type', file.type);\n Object.keys(response.data.headers).forEach((key) => {\n xhr.setRequestHeader(key, response.data.headers[key]);\n });\n return file;\n }\n }\n else {\n const fd = new FormData();\n for (const key in response.data) {\n fd.append(key, response.data[key]);\n }\n fd.append('file', file);\n xhr.openAndSetHeaders('POST', response.url);\n return fd;\n }\n });\n const response = yield xhr_1.default.upload(formio, 's3', xhrCallback, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback, multipartOptions);\n return {\n storage: 's3',\n name: fileName,\n bucket: response.bucket,\n key: response.data.key,\n url: xhr_1.default.path([response.url, response.data.key]),\n acl: response.data.acl,\n size: file.size,\n type: file.type\n };\n });\n },\n completeMultipartUpload(serverResponse, parts, multipart) {\n return __awaiter(this, void 0, void 0, function* () {\n const { changeMessage } = multipart;\n changeMessage('Completing AWS S3 multipart upload...');\n const token = formio.getToken();\n const response = yield fetch(`${formio.formUrl}/storage/s3/multipart/complete`, {\n method: 'POST',\n headers: Object.assign({ 'Content-Type': 'application/json' }, (token ? { 'x-jwt-token': token } : {})),\n body: JSON.stringify({ parts, uploadId: serverResponse.uploadId, key: serverResponse.key })\n });\n const message = yield response.text();\n if (!response.ok) {\n throw new Error(message);\n }\n // the AWS S3 SDK CompleteMultipartUpload command can return a HTTP 200 status header but still error;\n // we need to parse, and according to AWS, to retry\n if (message.match(/Error/)) {\n throw new Error(message);\n }\n });\n },\n abortMultipartUpload(serverResponse) {\n const { uploadId, key } = serverResponse;\n const token = formio.getToken();\n fetch(`${formio.formUrl}/storage/s3/multipart/abort`, {\n method: 'POST',\n headers: Object.assign({ 'Content-Type': 'application/json' }, (token ? { 'x-jwt-token': token } : {})),\n body: JSON.stringify({ uploadId, key })\n }).catch((err) => console.error('Error while aborting multipart upload:', err));\n },\n uploadParts(file, urls, headers, partSize, multipart, abortSignal) {\n const { changeMessage, progressCallback } = multipart;\n changeMessage('Chunking and uploading parts to AWS S3...');\n const promises = [];\n for (let i = 0; i < urls.length; i++) {\n const start = i * partSize;\n const end = (i + 1) * partSize;\n const blob = i < urls.length ? file.slice(start, end) : file.slice(start);\n const promise = fetch(urls[i], {\n method: 'PUT',\n headers,\n body: blob,\n signal: abortSignal,\n }).then((res) => {\n if (res.ok) {\n progressCallback(urls.length);\n const eTag = res.headers.get('etag');\n if (!eTag) {\n throw new Error('ETag header not found; it must be exposed in S3 bucket CORS settings');\n }\n return { ETag: eTag, PartNumber: i + 1 };\n }\n else {\n throw new Error(`Part no ${i} failed with status ${res.status}`);\n }\n });\n promises.push(promise);\n }\n return Promise.all(promises);\n },\n downloadFile(file) {\n if (file.acl !== 'public-read') {\n return formio.makeRequest('file', `${formio.formUrl}/storage/s3?bucket=${xhr_1.default.trim(file.bucket)}&key=${xhr_1.default.trim(file.key)}`, 'GET');\n }\n else {\n return Promise.resolve(file);\n }\n }\n };\n}\ns3.title = 'S3';\nexports[\"default\"] = s3;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/s3.js?");
|
825
770
|
|
826
771
|
/***/ }),
|
827
772
|
|
@@ -832,7 +777,18 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
832
777
|
/***/ (function(__unused_webpack_module, exports) {
|
833
778
|
|
834
779
|
"use strict";
|
835
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\
|
780
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction url(formio) {\n const xhrRequest = (url, name, query, data, options, progressCallback, abortCallback) => {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n const json = (typeof data === 'string');\n const fd = new FormData();\n if (typeof progressCallback === 'function') {\n xhr.upload.onprogress = progressCallback;\n }\n if (typeof abortCallback === 'function') {\n abortCallback(() => xhr.abort());\n }\n if (!json) {\n for (const key in data) {\n fd.append(key, data[key]);\n }\n }\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n // Need to test if xhr.response is decoded or not.\n let respData = {};\n try {\n respData = (typeof xhr.response === 'string') ? JSON.parse(xhr.response) : {};\n respData = (respData && respData.data) ? respData.data : respData;\n }\n catch (err) {\n respData = {};\n }\n // Get the url of the file.\n let respUrl = respData.hasOwnProperty('url') ? respData.url : `${xhr.responseURL}/${name}`;\n // If they provide relative url, then prepend the url.\n if (respUrl && respUrl[0] === '/') {\n respUrl = `${url}${respUrl}`;\n }\n resolve({ url: respUrl, data: respData });\n }\n else {\n reject(xhr.response || 'Unable to upload file');\n }\n };\n xhr.onerror = () => reject(xhr);\n xhr.onabort = () => reject(xhr);\n let requestUrl = url + (url.indexOf('?') > -1 ? '&' : '?');\n for (const key in query) {\n requestUrl += `${key}=${query[key]}&`;\n }\n if (requestUrl[requestUrl.length - 1] === '&') {\n requestUrl = requestUrl.substr(0, requestUrl.length - 1);\n }\n xhr.open('POST', requestUrl);\n if (json) {\n xhr.setRequestHeader('Content-Type', 'application/json');\n }\n const token = formio.getToken();\n if (token) {\n xhr.setRequestHeader('x-jwt-token', token);\n }\n //Overrides previous request props\n if (options) {\n const parsedOptions = typeof options === 'string' ? JSON.parse(options) : options;\n for (const prop in parsedOptions) {\n if (prop === 'headers') {\n const headers = parsedOptions['headers'];\n for (const header in headers) {\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n else {\n xhr[prop] = parsedOptions[prop];\n }\n }\n }\n xhr.send(json ? data : fd);\n });\n };\n return {\n title: 'Url',\n name: 'url',\n uploadFile(file, name, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback) {\n const uploadRequest = function (form) {\n return xhrRequest(url, name, {\n baseUrl: encodeURIComponent(formio.projectUrl),\n project: form ? form.project : '',\n form: form ? form._id : ''\n }, {\n [fileKey]: file,\n name,\n dir\n }, options, progressCallback, abortCallback).then(response => {\n // Store the project and form url along with the metadata.\n response.data = response.data || {};\n response.data.baseUrl = formio.projectUrl;\n response.data.project = form ? form.project : '';\n response.data.form = form ? form._id : '';\n return {\n storage: 'url',\n name,\n url: response.url,\n size: file.size,\n type: file.type,\n data: response.data\n };\n });\n };\n if (file.private && formio.formId) {\n return formio.loadForm().then((form) => uploadRequest(form));\n }\n else {\n return uploadRequest();\n }\n },\n deleteFile(fileInfo) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open('DELETE', fileInfo.url, true);\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve('File deleted');\n }\n else {\n reject(xhr.response || 'Unable to delete file');\n }\n };\n xhr.send(null);\n });\n },\n downloadFile(file) {\n if (file.private) {\n if (formio.submissionId && file.data) {\n file.data.submission = formio.submissionId;\n }\n return xhrRequest(file.url, file.name, {}, JSON.stringify(file)).then(response => response.data);\n }\n // Return the original as there is nothing to do.\n return Promise.resolve(file);\n }\n };\n}\nurl.title = 'Url';\nexports[\"default\"] = url;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/url.js?");
|
781
|
+
|
782
|
+
/***/ }),
|
783
|
+
|
784
|
+
/***/ "./lib/cjs/providers/storage/util.js":
|
785
|
+
/*!*******************************************!*\
|
786
|
+
!*** ./lib/cjs/providers/storage/util.js ***!
|
787
|
+
\*******************************************/
|
788
|
+
/***/ (function(__unused_webpack_module, exports) {
|
789
|
+
|
790
|
+
"use strict";
|
791
|
+
eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.withRetries = void 0;\nfunction withRetries(fn, args, retries = 3, err = null) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!retries) {\n throw new Error(err);\n }\n return fn(...args).catch(() => withRetries(fn, args, retries - 1, err));\n });\n}\nexports.withRetries = withRetries;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/util.js?");
|
836
792
|
|
837
793
|
/***/ }),
|
838
794
|
|
@@ -843,7 +799,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\ncons
|
|
843
799
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
844
800
|
|
845
801
|
"use strict";
|
846
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.setXhrHeaders = void 0;\nconst trim_1 = __importDefault(__webpack_require__(/*! lodash/trim */ \"./node_modules/lodash/trim.js\"));\nconst setXhrHeaders = (formio, xhr) => {\n const { headers } = formio.options;\n if (headers) {\n const ValidHeaders = {\n 'Content-Disposition': true,\n 'Authorization': true,\n };\n for (const header in headers) {\n if (ValidHeaders[header]) {\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n }\n};\nexports.setXhrHeaders = setXhrHeaders;\nconst XHR = {\n trim(text) {\n return (0, trim_1.default)(text, '/');\n },\n path(items) {\n return items.filter(item => !!item).map(XHR.trim).join('/');\n },\n upload(formio, type,
|
802
|
+
eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.setXhrHeaders = void 0;\nconst trim_1 = __importDefault(__webpack_require__(/*! lodash/trim */ \"./node_modules/lodash/trim.js\"));\nconst setXhrHeaders = (formio, xhr) => {\n const { headers } = formio.options;\n if (headers) {\n const ValidHeaders = {\n 'Content-Disposition': true,\n 'Authorization': true,\n };\n for (const header in headers) {\n if (ValidHeaders[header]) {\n xhr.setRequestHeader(header, headers[header]);\n }\n }\n }\n};\nexports.setXhrHeaders = setXhrHeaders;\nconst XHR = {\n trim(text) {\n return (0, trim_1.default)(text, '/');\n },\n path(items) {\n return items.filter(item => !!item).map(XHR.trim).join('/');\n },\n upload(formio, type, xhrCallback, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback, multipartOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n // make request to Form.io server\n const token = formio.getToken();\n let response;\n try {\n response = yield fetch(`${formio.formUrl}/storage/${type}`, {\n method: 'POST',\n headers: Object.assign({ 'Accept': 'application/json', 'Content-Type': 'application/json; charset=UTF-8' }, (token ? { 'x-jwt-token': token } : {})),\n body: JSON.stringify({\n name: XHR.path([dir, fileName]),\n size: file.size,\n type: file.type,\n groupPermissions,\n groupId,\n multipart: multipartOptions\n })\n });\n }\n catch (err) {\n // only throws on network errors\n err.networkError = true;\n throw err;\n }\n if (!response.ok) {\n const message = yield response.text();\n throw new Error(message || 'Unable to sign file.');\n }\n const serverResponse = yield response.json();\n return yield XHR.makeXhrRequest(formio, xhrCallback, serverResponse, progressCallback, abortCallback);\n });\n },\n makeXhrRequest(formio, xhrCallback, serverResponse, progressCallback, abortCallback) {\n return new Promise((resolve, reject) => {\n // Send the file with data.\n const xhr = new XMLHttpRequest();\n xhr.openAndSetHeaders = (...params) => {\n xhr.open(...params);\n (0, exports.setXhrHeaders)(formio, xhr);\n };\n Promise.resolve(xhrCallback(xhr, serverResponse, abortCallback)).then((payload) => {\n // if payload is nullish we can assume the provider took care of the entire upload process\n if (!payload) {\n return resolve(serverResponse);\n }\n // Fire on network error.\n xhr.onerror = (err) => {\n err.networkError = true;\n reject(err);\n };\n // Fire on network abort.\n xhr.onabort = (err) => {\n err.networkError = true;\n reject(err);\n };\n // Set the onabort error callback.\n xhr.onabort = reject;\n if (typeof progressCallback === 'function') {\n xhr.upload.onprogress = progressCallback;\n }\n if (typeof abortCallback === 'function') {\n abortCallback(() => xhr.abort());\n }\n // Fired when the response has made it back from the server.\n xhr.onload = () => {\n if (xhr.status >= 200 && xhr.status < 300) {\n resolve(serverResponse);\n }\n else {\n reject(xhr.response || 'Unable to upload file');\n }\n };\n // Get the request and send it to the server.\n xhr.send(payload);\n }).catch(reject);\n });\n }\n};\nexports[\"default\"] = XHR;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/xhr.js?");
|
847
803
|
|
848
804
|
/***/ }),
|
849
805
|
|
@@ -854,7 +810,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
854
810
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
855
811
|
|
856
812
|
"use strict";
|
857
|
-
eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setBaseUrl(url, norecurse = false) {\n Formio.baseUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n Formio.baseUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n Formio.projectUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n Formio.projectUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n Formio.pathType = type;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (Formio.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (Formio.FormioClass) {\n Formio.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n Formio.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (Formio.FormioClass && Formio.FormioClass.isRenderer) {\n Formio.FormioClass.use(module);\n }\n else {\n Formio.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(Formio.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => Formio.addScript(wrapper, ref)));\n }\n if (name && Formio.global(name, flag)) {\n Formio.debug(`${name} already loaded.`);\n return Promise.resolve(Formio.global(name));\n }\n Formio.debug('Adding Script', src);\n wrapper.appendChild(Formio.createElement('script', {\n src\n }));\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n Formio.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (Formio.global(name, flag)) {\n clearInterval(wait);\n Formio.debug(`${name} loaded.`);\n resolve(Formio.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => Formio.addStyles(wrapper, ref));\n return;\n }\n Formio.debug('Adding Styles', href);\n wrapper.appendChild(Formio.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n Formio.debug('Submision Complete', submission);\n const successMessage = (Formio.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = Formio.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n Formio.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n Formio.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n if (Formio.fullAdded || builder) {\n Formio.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n Formio.cdn = new CDN_js_1.default(Formio.config.cdn, Formio.config.cdnUrls || {});\n Formio.config.libs = Formio.config.libs || {\n uswds: {\n fa: true,\n js: `${Formio.cdn.uswds}/uswds.min.js`,\n css: `${Formio.cdn.uswds}/uswds.min.css`,\n },\n fontawesome: {\n css: `${Formio.cdn['font-awesome']}/css/font-awesome.min.css`\n },\n bootstrap: {\n css: `${Formio.cdn.bootstrap}/css/bootstrap.min.css`\n }\n };\n const id = Formio.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = Formio.createElement('div', {\n 'id': `\"${id}-wrapper\"`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n if (Formio.config.includeLibs && (typeof wrapper.attachShadow === 'function') && !Formio.config.premium) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // Load the renderer styles.\n yield Formio.addStyles(wrapper, Formio.config.embedCSS || `${Formio.cdn.js}/formio.embed.css`);\n // Add a loader.\n wrapper.appendChild(Formio.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n const renderer = Formio.config.debug ? 'formio.form' : 'formio.form.min';\n Formio.FormioClass = yield Formio.addScript(wrapper, Formio.formioScript(Formio.config.script || `${Formio.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n Formio.FormioClass.setBaseUrl(options.baseUrl || Formio.baseUrl || Formio.config.base);\n Formio.FormioClass.setProjectUrl(options.projectUrl || Formio.projectUrl || Formio.config.project);\n Formio.FormioClass.language = Formio.language;\n Formio.modules.forEach((module) => {\n Formio.FormioClass.use(module);\n });\n if (Formio.icons) {\n Formio.FormioClass.icons = Formio.icons;\n }\n if (Formio.pathType) {\n Formio.FormioClass.setPathType(Formio.pathType);\n }\n // Add premium modules\n if (Formio.global('premium')) {\n Formio.debug('Using premium module.');\n Formio.FormioClass.use(Formio.global('premium'));\n }\n if (Formio.global('vpat')) {\n Formio.debug('Using vpat module.');\n Formio.FormioClass.use(Formio.global('vpat'));\n }\n if (Formio.config.template) {\n if (Formio.config.includeLibs) {\n yield Formio.addStyles(wrapper, Formio.config.libs[Formio.config.template].css);\n yield Formio.addScript(wrapper, Formio.config.libs[Formio.config.template].js);\n if (Formio.config.libs[Formio.config.template].fa) {\n yield Formio.addStyles(wrapper, Formio.config.libs.fontawesome.css);\n }\n }\n if (Formio.cdn[Formio.config.template]) {\n const templateSrc = `${Formio.cdn[Formio.config.template]}/${Formio.config.template}.min`;\n yield Formio.addStyles(wrapper, `${templateSrc}.css`);\n Formio.debug(`Using ${Formio.config.template}`);\n Formio.FormioClass.use(yield Formio.addScript(wrapper, `${templateSrc}.js`, Formio.config.template));\n }\n }\n else if (Formio.global('uswds')) {\n Formio.debug('Using uswds module.');\n Formio.FormioClass.use(Formio.global('uswds'));\n }\n // Default bootstrap + fontawesome.\n else if (Formio.config.includeLibs) {\n yield Formio.addStyles(wrapper, Formio.config.libs.fontawesome.css);\n yield Formio.addStyles(wrapper, Formio.config.libs.bootstrap.css);\n }\n if (Formio.config.premium) {\n yield Formio.addStyles(wrapper, Formio.config.premium.css);\n Formio.debug('Using premium');\n Formio.FormioClass.use(yield Formio.addScript(wrapper, Formio.config.premium.js, 'premium'));\n }\n yield Formio.addStyles(wrapper, Formio.formioScript(Formio.config.style || `${Formio.cdn.js}/${renderer}.css`, builder));\n if (Formio.config.before) {\n yield Formio.config.before(Formio.FormioClass, element, Formio.config);\n }\n Formio.FormioClass.license = true;\n Formio._formioReady(Formio.FormioClass);\n return wrapper;\n });\n }\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = yield Formio.init(element, options);\n return Formio.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n Formio.debug('Form created', instance);\n // Remove the loader.\n Formio.debug('Removing loader');\n wrapper.removeChild(wrapper.querySelector('.formio-loader'));\n // Set the default submission data.\n if (Formio.config.submission) {\n Formio.debug('Setting submission', Formio.config.submission);\n instance.submission = Formio.config.submission;\n }\n // Allow them to provide additional configs.\n Formio.debug('Triggering embed event');\n Formio.FormioClass.events.emit('formEmbedded', instance);\n // Trigger the after handler.\n if (Formio.config.after) {\n Formio.debug('Calling ready callback');\n Formio.config.after(instance, Formio.config);\n }\n return instance;\n });\n });\n }\n static builder(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = yield Formio.init(element, options, true);\n return Formio.FormioClass.builder(element, form, options).then((instance) => {\n Formio.debug('Builder created', instance);\n Formio.debug('Removing loader');\n wrapper.removeChild(wrapper.querySelector('.formio-loader'));\n Formio.debug('Triggering embed event');\n Formio.FormioClass.events.emit('builderEmbedded', instance);\n if (Formio.config.after) {\n Formio.debug('Calling ready callback');\n Formio.config.after(instance, Formio.config);\n }\n return instance;\n });\n });\n }\n}\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.cdn = new CDN_js_1.default();\nFormio.modules = [];\nFormio.icons = '';\nFormio.formioReady = new Promise((ready, reject) => {\n Formio._formioReady = ready;\n Formio._formioReadyReject = reject;\n});\nFormio.version = '5.0.0-rc.30';\nexports.Formio = Formio;\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.init();\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
|
813
|
+
eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n Formio.license = license;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n Formio.baseUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n Formio.baseUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n Formio.projectUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n Formio.projectUrl = url;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n Formio.pathType = type;\n if (!norecurse && Formio.FormioClass) {\n Formio.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (Formio.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (Formio.FormioClass) {\n Formio.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n Formio.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (Formio.FormioClass && Formio.FormioClass.isRenderer) {\n Formio.FormioClass.use(module);\n }\n else {\n Formio.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(Formio.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => Formio.addScript(wrapper, ref)));\n }\n if (name && Formio.global(name, flag)) {\n Formio.debug(`${name} already loaded.`);\n return Promise.resolve(Formio.global(name));\n }\n Formio.debug('Adding Script', src);\n try {\n wrapper.appendChild(Formio.createElement('script', {\n src\n }));\n }\n catch (err) {\n Formio.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n Formio.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (Formio.global(name, flag)) {\n clearInterval(wait);\n Formio.debug(`${name} loaded.`);\n resolve(Formio.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => Formio.addStyles(wrapper, ref));\n return;\n }\n Formio.debug('Adding Styles', href);\n wrapper.appendChild(Formio.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n Formio.debug('Submision Complete', submission);\n const successMessage = (Formio.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = Formio.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n Formio.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n Formio.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || Formio.config.includeBuilder;\n if (Formio.fullAdded || builder) {\n Formio.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(wrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n yield Formio.addLibrary(wrapper, Formio.cdn.libs[lib.dependencies[i]]);\n }\n }\n if (lib.css) {\n yield Formio.addStyles(wrapper, lib.css);\n }\n if (lib.js) {\n const module = yield Formio.addScript(wrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n Formio.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && Formio.license) {\n options.license = Formio.license;\n }\n Formio.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n });\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n Formio.cdn = new CDN_js_1.default(Formio.config.cdn, Formio.config.cdnUrls || {});\n Formio.config.libs = Formio.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${Formio.cdn.uswds}/uswds.min.js`,\n css: `${Formio.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n css: `${Formio.cdn['font-awesome']}/css/font-awesome.min.css`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${Formio.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${Formio.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n css: `${Formio.cdn['bootstrap-icons']}/css/bootstrap-icons.css`\n }\n };\n const id = Formio.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = Formio.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n if (Formio.config.includeLibs && (typeof wrapper.attachShadow === 'function') && !Formio.config.premium) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // Load the renderer styles.\n yield Formio.addStyles(wrapper, Formio.config.embedCSS || `${Formio.cdn.js}/formio.embed.css`);\n // Add a loader.\n wrapper.appendChild(Formio.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n const renderer = Formio.config.debug ? 'formio.form' : 'formio.form.min';\n Formio.FormioClass = yield Formio.addScript(wrapper, Formio.formioScript(Formio.config.script || `${Formio.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n Formio.FormioClass.cdn = Formio.cdn;\n Formio.FormioClass.setBaseUrl(options.baseUrl || Formio.baseUrl || Formio.config.base);\n Formio.FormioClass.setProjectUrl(options.projectUrl || Formio.projectUrl || Formio.config.project);\n Formio.FormioClass.language = Formio.language;\n Formio.setLicense(Formio.license || Formio.config.license || false);\n Formio.modules.forEach((module) => {\n Formio.FormioClass.use(module);\n });\n if (Formio.icons) {\n Formio.FormioClass.icons = Formio.icons;\n }\n if (Formio.pathType) {\n Formio.FormioClass.setPathType(Formio.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (Formio.config.template && Formio.config.includeLibs) {\n yield Formio.addLibrary(wrapper, Formio.config.libs[Formio.config.template], Formio.config.template);\n }\n // Add the premium modules.\n if (Formio.config.premium) {\n Formio.config.modules.premium = Formio.config.premium;\n }\n // Allow adding dynamic modules.\n if (Formio.config.modules) {\n for (const name in Formio.config.modules) {\n const lib = Formio.config.modules[name];\n lib.use = lib.use || true;\n yield Formio.addLibrary(wrapper, lib, name);\n }\n }\n yield Formio.addStyles(wrapper, Formio.formioScript(Formio.config.style || `${Formio.cdn.js}/${renderer}.css`, builder));\n if (Formio.config.before) {\n yield Formio.config.before(Formio.FormioClass, element, Formio.config);\n }\n Formio.FormioClass.license = true;\n Formio._formioReady(Formio.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.removeChild(wrapper.querySelector('.formio-loader'));\n Formio.FormioClass.events.emit(readyEvent, instance);\n if (Formio.config.after) {\n Formio.debug('Calling ready callback');\n Formio.config.after(instance, Formio.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = yield Formio.init(element, options);\n return Formio.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (Formio.config.submission) {\n Formio.debug('Setting submission', Formio.config.submission);\n instance.submission = Formio.config.submission;\n }\n // Call the after create method.\n Formio.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const wrapper = yield Formio.init(element, options, true);\n return Formio.FormioClass.builder(element, form, options).then((instance) => {\n Formio.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n Formio._formioReady = ready;\n Formio._formioReadyReject = reject;\n});\nFormio.version = '5.0.0-rc.32';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n const wrapper = yield Formio.init(element, options, true);\n return Formio.FormioClass.Report.create(element, submission, options).then((instance) => {\n Formio.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nexports.Formio = Formio;\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.init();\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
|
858
814
|
|
859
815
|
/***/ }),
|
860
816
|
|
@@ -865,7 +821,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
865
821
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
866
822
|
|
867
823
|
"use strict";
|
868
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"./node_modules/@formio/core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.0.0-rc.
|
824
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"./node_modules/@formio/core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.0.0-rc.32';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n['setBaseUrl', 'setApiUrl', 'setAppUrl', 'setProjectUrl', 'setPathType', 'setLicense'].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?");
|
869
825
|
|
870
826
|
/***/ })
|
871
827
|
|