@formio/js 5.0.0-rc.18 → 5.0.0-rc.20
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/dist/formio.builder.css +14 -22
- package/dist/formio.builder.min.css +1 -1
- package/dist/formio.embed.css +1 -2
- package/dist/formio.embed.js +2 -2
- package/dist/formio.embed.min.css +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.css +10 -2
- package/dist/formio.form.js +333 -361
- package/dist/formio.form.min.css +1 -1
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -8
- package/dist/formio.full.css +14 -22
- package/dist/formio.full.js +353 -370
- package/dist/formio.full.min.css +1 -1
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -8
- package/dist/formio.js +208 -121
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +2 -7
- package/dist/formio.utils.js +220 -13
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +2 -7
- package/lib/cjs/CDN.js +1 -1
- package/lib/cjs/Element.js +7 -2
- package/lib/cjs/Embed.js +1 -1
- package/lib/cjs/Form.d.ts +8 -5
- package/lib/cjs/Form.js +52 -10
- package/lib/cjs/PDF.d.ts +11 -3
- package/lib/cjs/PDF.js +4 -5
- package/lib/cjs/PDFBuilder.js +2 -3
- package/lib/cjs/Webform.d.ts +4 -7
- package/lib/cjs/Webform.js +40 -119
- package/lib/cjs/WebformBuilder.d.ts +6 -1
- package/lib/cjs/WebformBuilder.js +104 -64
- package/lib/cjs/Wizard.d.ts +8 -5
- package/lib/cjs/Wizard.js +14 -14
- package/lib/cjs/WizardBuilder.d.ts +6 -4
- package/lib/cjs/WizardBuilder.js +20 -3
- package/lib/cjs/addons/FormioAddon.d.ts +1 -1
- package/lib/cjs/addons/FormioAddon.js +1 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +17 -8
- package/lib/cjs/components/_classes/component/Component.js +52 -18
- package/lib/cjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/cjs/components/_classes/input/Input.js +1 -2
- package/lib/cjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/cjs/components/_classes/list/ListComponent.js +43 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.js +11 -12
- package/lib/cjs/components/address/Address.d.ts +8 -0
- package/lib/cjs/components/button/Button.js +2 -3
- package/lib/cjs/components/checkbox/Checkbox.d.ts +13 -0
- package/lib/cjs/components/checkbox/Checkbox.js +17 -5
- package/lib/cjs/components/columns/Columns.d.ts +1 -0
- package/lib/cjs/components/columns/Columns.js +1 -0
- package/lib/cjs/components/container/Container.d.ts +1 -0
- package/lib/cjs/components/container/Container.js +1 -0
- package/lib/cjs/components/content/Content.d.ts +1 -0
- package/lib/cjs/components/content/Content.js +1 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/cjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/cjs/components/datagrid/DataGrid.js +8 -1
- package/lib/cjs/components/datamap/DataMap.js +1 -0
- package/lib/cjs/components/datetime/DateTime.d.ts +4 -0
- package/lib/cjs/components/datetime/DateTime.js +21 -1
- package/lib/cjs/components/day/Day.d.ts +1 -1
- package/lib/cjs/components/day/Day.js +22 -6
- package/lib/cjs/components/day/fixtures/comp3.js +2 -2
- package/lib/cjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/cjs/components/editgrid/EditGrid.js +11 -6
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/cjs/components/editgrid/fixtures/comp-with-custom-default-value.js +227 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/cjs/components/editgrid/fixtures/comp15.js +51 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/cjs/components/editgrid/fixtures/index.js +5 -1
- package/lib/cjs/components/fieldset/Fieldset.d.ts +1 -0
- package/lib/cjs/components/fieldset/Fieldset.js +1 -0
- package/lib/cjs/components/file/File.d.ts +7 -5
- package/lib/cjs/components/file/File.js +26 -9
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/cjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/cjs/components/form/Form.d.ts +3 -0
- package/lib/cjs/components/form/Form.js +9 -10
- package/lib/cjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/cjs/components/hidden/Hidden.js +1 -0
- package/lib/cjs/components/html/HTML.d.ts +1 -0
- package/lib/cjs/components/html/HTML.js +1 -0
- package/lib/cjs/components/number/Number.d.ts +5 -1
- package/lib/cjs/components/number/Number.js +24 -7
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/cjs/components/radio/Radio.d.ts +5 -3
- package/lib/cjs/components/radio/Radio.js +59 -18
- package/lib/cjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/cjs/components/recaptcha/ReCaptcha.js +4 -5
- package/lib/cjs/components/resource/Resource.d.ts +7 -0
- package/lib/cjs/components/resource/Resource.js +0 -1
- package/lib/cjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/cjs/components/select/Select.d.ts +7 -5
- package/lib/cjs/components/select/Select.js +15 -49
- package/lib/cjs/components/selectboxes/SelectBoxes.d.ts +12 -0
- package/lib/cjs/components/selectboxes/SelectBoxes.js +53 -25
- package/lib/cjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/cjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/cjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/cjs/components/selectboxes/fixtures/comp6.js +15 -0
- package/lib/cjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/selectboxes/fixtures/index.js +3 -1
- package/lib/cjs/components/signature/Signature.d.ts +1 -1
- package/lib/cjs/components/signature/Signature.js +8 -3
- package/lib/cjs/components/survey/Survey.js +3 -0
- package/lib/cjs/components/table/Table.d.ts +1 -0
- package/lib/cjs/components/table/Table.js +1 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +1 -0
- package/lib/cjs/components/tabs/Tabs.js +1 -0
- package/lib/cjs/components/tags/Tags.js +3 -0
- package/lib/cjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/cjs/components/textarea/TextArea.js +4 -5
- package/lib/cjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/cjs/components/textarea/fixtures/comp4.js +27 -0
- package/lib/cjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/textarea/fixtures/index.js +3 -1
- package/lib/cjs/components/textfield/TextField.d.ts +1 -0
- package/lib/cjs/components/textfield/TextField.js +5 -3
- package/lib/cjs/components/time/Time.d.ts +4 -0
- package/lib/cjs/components/time/Time.js +6 -1
- package/lib/cjs/components/tree/Tree.d.ts +5 -4
- package/lib/cjs/components/tree/Tree.form.js +5 -0
- package/lib/cjs/components/tree/Tree.js +8 -9
- package/lib/cjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/cjs/components/tree/editForm/Tree.edit.display.js +12 -0
- package/lib/cjs/components/well/Well.d.ts +1 -0
- package/lib/cjs/components/well/Well.js +1 -0
- package/lib/cjs/providers/Providers.d.ts +31 -11
- package/lib/cjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/cjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/cjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/cjs/providers/processor/fileProcessor.js +1 -5
- package/lib/cjs/providers/storage/azure.d.ts +10 -1
- package/lib/cjs/providers/storage/azure.js +7 -2
- package/lib/cjs/providers/storage/base64.d.ts +2 -2
- package/lib/cjs/providers/storage/base64.js +2 -6
- package/lib/cjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/cjs/providers/storage/dropbox.js +2 -6
- package/lib/cjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/cjs/providers/storage/googleDrive.js +6 -6
- package/lib/cjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/cjs/providers/storage/indexeddb.js +9 -13
- package/lib/cjs/providers/storage/s3.d.ts +11 -1
- package/lib/cjs/providers/storage/s3.js +5 -2
- package/lib/cjs/providers/storage/uploadAdapter.js +1 -5
- package/lib/cjs/providers/storage/url.d.ts +2 -2
- package/lib/cjs/providers/storage/url.js +12 -8
- package/lib/cjs/providers/storage/xhr.d.ts +1 -1
- package/lib/cjs/providers/storage/xhr.js +1 -2
- package/lib/cjs/templates/index.d.ts +226 -1
- package/lib/cjs/utils/Evaluator.js +4 -33
- package/lib/cjs/utils/i18n.d.ts +16 -0
- package/lib/cjs/utils/i18n.js +88 -0
- package/lib/cjs/utils/utils.d.ts +1 -1
- package/lib/cjs/utils/utils.js +8 -9
- package/lib/cjs/validator/Validator.d.ts +30 -2
- package/lib/cjs/validator/Validator.js +32 -9
- package/lib/cjs/validator/rules/Select.js +1 -2
- package/lib/cjs/validator/rules/Unique.d.ts +1 -1
- package/lib/cjs/validator/rules/Unique.js +1 -2
- package/lib/cjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/cjs/widgets/InputWidget.d.ts +1 -1
- package/lib/cjs/widgets/InputWidget.js +1 -2
- package/lib/mjs/CDN.js +1 -1
- package/lib/mjs/Element.js +6 -2
- package/lib/mjs/Embed.js +4 -1
- package/lib/mjs/Form.d.ts +8 -5
- package/lib/mjs/Form.js +52 -10
- package/lib/mjs/PDF.d.ts +11 -3
- package/lib/mjs/PDF.js +4 -5
- package/lib/mjs/PDFBuilder.js +2 -3
- package/lib/mjs/Webform.d.ts +4 -7
- package/lib/mjs/Webform.js +40 -122
- package/lib/mjs/WebformBuilder.d.ts +6 -1
- package/lib/mjs/WebformBuilder.js +102 -64
- package/lib/mjs/Wizard.d.ts +8 -5
- package/lib/mjs/Wizard.js +14 -14
- package/lib/mjs/WizardBuilder.d.ts +6 -4
- package/lib/mjs/WizardBuilder.js +20 -3
- package/lib/mjs/addons/FormioAddon.d.ts +1 -1
- package/lib/mjs/addons/FormioAddon.js +1 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +17 -8
- package/lib/mjs/components/_classes/component/Component.js +52 -18
- package/lib/mjs/components/_classes/input/Input.d.ts +1 -1
- package/lib/mjs/components/_classes/input/Input.js +1 -2
- package/lib/mjs/components/_classes/list/ListComponent.d.ts +4 -0
- package/lib/mjs/components/_classes/list/ListComponent.js +43 -5
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +1 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +10 -4
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +5 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.js +11 -12
- package/lib/mjs/components/address/Address.d.ts +8 -0
- package/lib/mjs/components/button/Button.js +2 -3
- package/lib/mjs/components/checkbox/Checkbox.d.ts +13 -0
- package/lib/mjs/components/checkbox/Checkbox.js +21 -5
- package/lib/mjs/components/columns/Columns.d.ts +1 -0
- package/lib/mjs/components/columns/Columns.js +1 -0
- package/lib/mjs/components/container/Container.d.ts +1 -0
- package/lib/mjs/components/container/Container.js +1 -0
- package/lib/mjs/components/content/Content.d.ts +1 -0
- package/lib/mjs/components/content/Content.js +1 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.d.ts +14 -2
- package/lib/mjs/components/currency/editForm/Currency.edit.data.js +4 -0
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +4 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -0
- package/lib/mjs/components/datagrid/DataGrid.js +8 -1
- package/lib/mjs/components/datamap/DataMap.js +1 -0
- package/lib/mjs/components/datetime/DateTime.d.ts +4 -0
- package/lib/mjs/components/datetime/DateTime.js +28 -1
- package/lib/mjs/components/day/Day.d.ts +1 -1
- package/lib/mjs/components/day/Day.js +25 -6
- package/lib/mjs/components/day/fixtures/comp3.js +2 -2
- package/lib/mjs/components/editgrid/EditGrid.d.ts +4 -3
- package/lib/mjs/components/editgrid/EditGrid.js +11 -6
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.d.ts +190 -0
- package/lib/mjs/components/editgrid/fixtures/comp-with-custom-default-value.js +225 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.d.ts +54 -0
- package/lib/mjs/components/editgrid/fixtures/comp15.js +49 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +3 -1
- package/lib/mjs/components/editgrid/fixtures/index.js +3 -1
- package/lib/mjs/components/fieldset/Fieldset.d.ts +1 -0
- package/lib/mjs/components/fieldset/Fieldset.js +1 -0
- package/lib/mjs/components/file/File.d.ts +7 -5
- package/lib/mjs/components/file/File.js +29 -9
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +62 -0
- package/lib/mjs/components/file/editForm/File.edit.file.js +29 -2
- package/lib/mjs/components/form/Form.d.ts +3 -0
- package/lib/mjs/components/form/Form.js +9 -10
- package/lib/mjs/components/hidden/Hidden.d.ts +1 -0
- package/lib/mjs/components/hidden/Hidden.js +1 -0
- package/lib/mjs/components/html/HTML.d.ts +1 -0
- package/lib/mjs/components/html/HTML.js +1 -0
- package/lib/mjs/components/number/Number.d.ts +5 -1
- package/lib/mjs/components/number/Number.js +24 -7
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -0
- package/lib/mjs/components/radio/Radio.d.ts +5 -3
- package/lib/mjs/components/radio/Radio.js +59 -18
- package/lib/mjs/components/recaptcha/ReCaptcha.d.ts +1 -1
- package/lib/mjs/components/recaptcha/ReCaptcha.js +4 -5
- package/lib/mjs/components/resource/Resource.d.ts +7 -0
- package/lib/mjs/components/resource/Resource.js +0 -1
- package/lib/mjs/components/resource/editForm/Resource.edit.display.js +1 -1
- package/lib/mjs/components/select/Select.d.ts +7 -5
- package/lib/mjs/components/select/Select.js +18 -49
- package/lib/mjs/components/selectboxes/SelectBoxes.d.ts +12 -0
- package/lib/mjs/components/selectboxes/SelectBoxes.js +56 -25
- package/lib/mjs/components/selectboxes/fixtures/comp4.d.ts +30 -27
- package/lib/mjs/components/selectboxes/fixtures/comp4.js +47 -32
- package/lib/mjs/components/selectboxes/fixtures/comp6.d.ts +14 -0
- package/lib/mjs/components/selectboxes/fixtures/comp6.js +13 -0
- package/lib/mjs/components/selectboxes/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/selectboxes/fixtures/index.js +2 -1
- package/lib/mjs/components/signature/Signature.d.ts +1 -1
- package/lib/mjs/components/signature/Signature.js +11 -3
- package/lib/mjs/components/survey/Survey.js +6 -0
- package/lib/mjs/components/table/Table.d.ts +1 -0
- package/lib/mjs/components/table/Table.js +1 -0
- package/lib/mjs/components/tabs/Tabs.d.ts +1 -0
- package/lib/mjs/components/tabs/Tabs.js +1 -0
- package/lib/mjs/components/tags/Tags.js +6 -0
- package/lib/mjs/components/textarea/TextArea.d.ts +3 -2
- package/lib/mjs/components/textarea/TextArea.js +4 -5
- package/lib/mjs/components/textarea/fixtures/comp4.d.ts +30 -0
- package/lib/mjs/components/textarea/fixtures/comp4.js +25 -0
- package/lib/mjs/components/textarea/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/textarea/fixtures/index.js +2 -1
- package/lib/mjs/components/textfield/TextField.d.ts +1 -0
- package/lib/mjs/components/textfield/TextField.js +8 -3
- package/lib/mjs/components/time/Time.d.ts +4 -0
- package/lib/mjs/components/time/Time.js +12 -1
- package/lib/mjs/components/tree/Tree.d.ts +5 -4
- package/lib/mjs/components/tree/Tree.form.js +5 -0
- package/lib/mjs/components/tree/Tree.js +8 -9
- package/lib/mjs/components/tree/editForm/Tree.edit.display.d.ts +9 -0
- package/lib/mjs/components/tree/editForm/Tree.edit.display.js +10 -0
- package/lib/mjs/components/well/Well.d.ts +1 -0
- package/lib/mjs/components/well/Well.js +1 -0
- package/lib/mjs/providers/Providers.d.ts +31 -11
- package/lib/mjs/providers/address/GoogleAddressProvider.d.ts +2 -2
- package/lib/mjs/providers/address/GoogleAddressProvider.js +2 -3
- package/lib/mjs/providers/processor/fileProcessor.d.ts +1 -1
- package/lib/mjs/providers/processor/fileProcessor.js +1 -2
- package/lib/mjs/providers/storage/azure.d.ts +10 -1
- package/lib/mjs/providers/storage/azure.js +7 -2
- package/lib/mjs/providers/storage/base64.d.ts +2 -2
- package/lib/mjs/providers/storage/base64.js +2 -3
- package/lib/mjs/providers/storage/dropbox.d.ts +2 -2
- package/lib/mjs/providers/storage/dropbox.js +2 -3
- package/lib/mjs/providers/storage/googleDrive.d.ts +3 -2
- package/lib/mjs/providers/storage/googleDrive.js +6 -3
- package/lib/mjs/providers/storage/indexeddb.d.ts +3 -3
- package/lib/mjs/providers/storage/indexeddb.js +9 -10
- package/lib/mjs/providers/storage/s3.d.ts +11 -1
- package/lib/mjs/providers/storage/s3.js +5 -2
- package/lib/mjs/providers/storage/uploadAdapter.js +1 -2
- package/lib/mjs/providers/storage/url.d.ts +2 -2
- package/lib/mjs/providers/storage/url.js +12 -5
- package/lib/mjs/providers/storage/xhr.d.ts +1 -1
- package/lib/mjs/providers/storage/xhr.js +1 -2
- package/lib/mjs/templates/index.d.ts +226 -1
- package/lib/mjs/utils/Evaluator.js +4 -33
- package/lib/mjs/utils/i18n.d.ts +16 -0
- package/lib/mjs/utils/i18n.js +81 -0
- package/lib/mjs/utils/utils.d.ts +1 -1
- package/lib/mjs/utils/utils.js +8 -9
- package/lib/mjs/validator/Validator.d.ts +30 -2
- package/lib/mjs/validator/Validator.js +31 -9
- package/lib/mjs/validator/rules/Select.js +1 -2
- package/lib/mjs/validator/rules/Unique.d.ts +1 -1
- package/lib/mjs/validator/rules/Unique.js +1 -2
- package/lib/mjs/widgets/CalendarWidget.d.ts +1 -0
- package/lib/mjs/widgets/InputWidget.d.ts +1 -1
- package/lib/mjs/widgets/InputWidget.js +1 -2
- package/package.json +24 -25
@@ -12,6 +12,12 @@ declare class Component extends Element {
|
|
12
12
|
* @param options
|
13
13
|
*/
|
14
14
|
static tableView(value: any, options: any): void;
|
15
|
+
static get serverConditionSettings(): {
|
16
|
+
operators: string[];
|
17
|
+
valueComponent(): {
|
18
|
+
type: string;
|
19
|
+
};
|
20
|
+
};
|
15
21
|
/**
|
16
22
|
* Initialize a new Component.
|
17
23
|
*
|
@@ -151,7 +157,7 @@ declare class Component extends Element {
|
|
151
157
|
set data(arg: any);
|
152
158
|
get data(): any;
|
153
159
|
mergeSchema(component?: {}): any;
|
154
|
-
get ready():
|
160
|
+
get ready(): Promise<Component>;
|
155
161
|
get isPDFReadOnlyMode(): any;
|
156
162
|
get labelInfo(): {
|
157
163
|
hidden: any;
|
@@ -184,6 +190,9 @@ declare class Component extends Element {
|
|
184
190
|
get parentVisible(): any;
|
185
191
|
set parentDisabled(arg: boolean);
|
186
192
|
get parentDisabled(): boolean;
|
193
|
+
shouldForceVisibility(component: any, visibility: any): any;
|
194
|
+
shouldForceHide(component: any): any;
|
195
|
+
shouldForceShow(component: any): any;
|
187
196
|
/**
|
188
197
|
*
|
189
198
|
* @param value {boolean}
|
@@ -290,12 +299,12 @@ declare class Component extends Element {
|
|
290
299
|
loadRefs(element: any, refs: any): void;
|
291
300
|
setOpenModalElement(template: any): void;
|
292
301
|
getModalPreviewTemplate(): any;
|
293
|
-
build(element: any):
|
302
|
+
build(element: any): Promise<void>;
|
294
303
|
get hasModalSaveButton(): boolean;
|
295
304
|
render(children?: string, topLevel?: boolean): any;
|
296
305
|
attachTooltips(toolTipsRefs: any): void;
|
297
306
|
createComponentModal(element: any, modalShouldBeOpened: any, currentValue: any): ComponentModal;
|
298
|
-
attach(element: any):
|
307
|
+
attach(element: any): Promise<void>;
|
299
308
|
componentModal: any;
|
300
309
|
restoreFocus(): void;
|
301
310
|
addShortcut(element: any, shortcut: any): void;
|
@@ -399,8 +408,8 @@ declare class Component extends Element {
|
|
399
408
|
errorMessage(type: any): any;
|
400
409
|
setContent(element: any, content: any, forceSanitize: any, sanitizeOptions: any): boolean;
|
401
410
|
restoreCaretPosition(): void;
|
402
|
-
redraw():
|
403
|
-
rebuild():
|
411
|
+
redraw(): Promise<void>;
|
412
|
+
rebuild(): Promise<void>;
|
404
413
|
hasClass(element: any, className: any): boolean | undefined;
|
405
414
|
addClass(element: any, className: any): Component | undefined;
|
406
415
|
removeClass(element: any, className: any): Component | undefined;
|
@@ -691,7 +700,7 @@ declare class Component extends Element {
|
|
691
700
|
*/
|
692
701
|
checkComponentValidity(data: any, dirty: any, row: any, options?: {}): boolean;
|
693
702
|
checkValidity(data: any, dirty: any, row: any, silentCheck: any): boolean;
|
694
|
-
checkAsyncValidity(data: any, dirty: any, row: any, silentCheck: any):
|
703
|
+
checkAsyncValidity(data: any, dirty: any, row: any, silentCheck: any): Promise<boolean>;
|
695
704
|
/**
|
696
705
|
* Check the conditions, calculations, and validity of a single component and triggers an update if
|
697
706
|
* something changed.
|
@@ -725,8 +734,8 @@ declare class Component extends Element {
|
|
725
734
|
*/
|
726
735
|
isValueHidden(): boolean | any;
|
727
736
|
shouldSkipValidation(data: any, dirty: any, row: any): boolean;
|
728
|
-
whenReady():
|
729
|
-
get dataReady():
|
737
|
+
whenReady(): Promise<void>;
|
738
|
+
get dataReady(): Promise<void>;
|
730
739
|
/**
|
731
740
|
* Prints out the value of this component as a string value.
|
732
741
|
*/
|
@@ -28,7 +28,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29
29
|
/* globals Quill, ClassicEditor, CKEDITOR */
|
30
30
|
const vanilla_text_mask_1 = require("@formio/vanilla-text-mask");
|
31
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
32
31
|
const tippy_js_1 = __importDefault(require("tippy.js"));
|
33
32
|
const lodash_1 = __importDefault(require("lodash"));
|
34
33
|
const ismobilejs_1 = __importDefault(require("ismobilejs"));
|
@@ -437,7 +436,7 @@ class Component extends Element_1.default {
|
|
437
436
|
}
|
438
437
|
// Allow componets to notify when ready.
|
439
438
|
get ready() {
|
440
|
-
return
|
439
|
+
return Promise.resolve(this);
|
441
440
|
}
|
442
441
|
get isPDFReadOnlyMode() {
|
443
442
|
return this.parent &&
|
@@ -552,12 +551,38 @@ class Component extends Element_1.default {
|
|
552
551
|
get parentDisabled() {
|
553
552
|
return this._parentDisabled;
|
554
553
|
}
|
554
|
+
shouldForceVisibility(component, visibility) {
|
555
|
+
if (!this.options[visibility]) {
|
556
|
+
return false;
|
557
|
+
}
|
558
|
+
if (!component) {
|
559
|
+
component = this.component;
|
560
|
+
}
|
561
|
+
if (lodash_1.default.isArray(this.options[visibility])) {
|
562
|
+
return this.options[visibility].includes(component.key);
|
563
|
+
}
|
564
|
+
return this.options[visibility][component.key];
|
565
|
+
}
|
566
|
+
shouldForceHide(component) {
|
567
|
+
return this.shouldForceVisibility(component, 'hide');
|
568
|
+
}
|
569
|
+
shouldForceShow(component) {
|
570
|
+
return this.shouldForceVisibility(component, 'show');
|
571
|
+
}
|
555
572
|
/**
|
556
573
|
*
|
557
574
|
* @param value {boolean}
|
558
575
|
*/
|
559
576
|
set visible(value) {
|
560
577
|
if (this._visible !== value) {
|
578
|
+
// Skip if this component is set to visible and is supposed to be hidden.
|
579
|
+
if (value && this.shouldForceHide()) {
|
580
|
+
return;
|
581
|
+
}
|
582
|
+
// Skip if this component is set to hidden and is supposed to be shown.
|
583
|
+
if (!value && this.shouldForceShow()) {
|
584
|
+
return;
|
585
|
+
}
|
561
586
|
this._visible = value;
|
562
587
|
this.clearOnHide();
|
563
588
|
this.redraw();
|
@@ -572,12 +597,10 @@ class Component extends Element_1.default {
|
|
572
597
|
if (this.builderMode || this.previewMode || this.options.showHiddenFields) {
|
573
598
|
return true;
|
574
599
|
}
|
575
|
-
if (this.
|
576
|
-
this.options.hide[this.component.key]) {
|
600
|
+
if (this.shouldForceHide()) {
|
577
601
|
return false;
|
578
602
|
}
|
579
|
-
if (this.
|
580
|
-
this.options.show[this.component.key]) {
|
603
|
+
if (this.shouldForceShow()) {
|
581
604
|
return true;
|
582
605
|
}
|
583
606
|
return this._visible && this._parentVisible;
|
@@ -902,7 +925,7 @@ class Component extends Element_1.default {
|
|
902
925
|
* @return {*}
|
903
926
|
*/
|
904
927
|
beforePage() {
|
905
|
-
return
|
928
|
+
return Promise.resolve(true);
|
906
929
|
}
|
907
930
|
beforeNext() {
|
908
931
|
return this.beforePage(true);
|
@@ -914,7 +937,7 @@ class Component extends Element_1.default {
|
|
914
937
|
* @return {*}
|
915
938
|
*/
|
916
939
|
beforeSubmit() {
|
917
|
-
return
|
940
|
+
return Promise.resolve(true);
|
918
941
|
}
|
919
942
|
/**
|
920
943
|
* Return the submission timezone.
|
@@ -1065,7 +1088,7 @@ class Component extends Element_1.default {
|
|
1065
1088
|
}
|
1066
1089
|
this.restoreFocus();
|
1067
1090
|
this.addons.forEach((addon) => addon.attach(element));
|
1068
|
-
return
|
1091
|
+
return Promise.resolve();
|
1069
1092
|
}
|
1070
1093
|
restoreFocus() {
|
1071
1094
|
var _a, _b, _c;
|
@@ -1380,6 +1403,14 @@ class Component extends Element_1.default {
|
|
1380
1403
|
});
|
1381
1404
|
return customCSS;
|
1382
1405
|
}
|
1406
|
+
static get serverConditionSettings() {
|
1407
|
+
return {
|
1408
|
+
operators: ['isEqual', 'isNotEqual', 'isEmpty', 'isNotEmpty'],
|
1409
|
+
valueComponent() {
|
1410
|
+
return { type: 'textfield' };
|
1411
|
+
},
|
1412
|
+
};
|
1413
|
+
}
|
1383
1414
|
get isMobile() {
|
1384
1415
|
return (0, ismobilejs_1.default)();
|
1385
1416
|
}
|
@@ -1510,7 +1541,7 @@ class Component extends Element_1.default {
|
|
1510
1541
|
// Don't bother if we have not built yet.
|
1511
1542
|
if (!this.element || !this.element.parentNode || this.optimizeRedraw) {
|
1512
1543
|
// Return a non-resolving promise.
|
1513
|
-
return
|
1544
|
+
return Promise.resolve();
|
1514
1545
|
}
|
1515
1546
|
this.detach();
|
1516
1547
|
this.emit('redraw');
|
@@ -1941,12 +1972,12 @@ class Component extends Element_1.default {
|
|
1941
1972
|
return Formio_1.Formio.requireLibrary('ckeditor', isIEBrowser ? 'CKEDITOR' : 'ClassicEditor', lodash_1.default.get(this.options, 'editors.ckeditor.src', `${Formio_1.Formio.cdn.ckeditor}/ckeditor.js`), true)
|
1942
1973
|
.then(() => {
|
1943
1974
|
if (!element.parentNode) {
|
1944
|
-
return
|
1975
|
+
return Promise.reject();
|
1945
1976
|
}
|
1946
1977
|
if (isIEBrowser) {
|
1947
1978
|
const editor = CKEDITOR.replace(element);
|
1948
1979
|
editor.on('change', () => onChange(editor.getData()));
|
1949
|
-
return
|
1980
|
+
return Promise.resolve(editor);
|
1950
1981
|
}
|
1951
1982
|
else {
|
1952
1983
|
return ClassicEditor.create(element, settings).then(editor => {
|
@@ -1970,7 +2001,7 @@ class Component extends Element_1.default {
|
|
1970
2001
|
return Formio_1.Formio.requireLibrary('quill-table', 'Quill', `${Formio_1.Formio.cdn.baseUrl}/quill/quill-table.js`, true)
|
1971
2002
|
.then(() => {
|
1972
2003
|
if (!element.parentNode) {
|
1973
|
-
return
|
2004
|
+
return Promise.reject();
|
1974
2005
|
}
|
1975
2006
|
this.quill = new Quill(element, isIEBrowser ? Object.assign(Object.assign({}, settings), { modules: {} }) : settings);
|
1976
2007
|
/** This block of code adds the [source] capabilities. See https://codepen.io/anon/pen/ZyEjrQ **/
|
@@ -2421,6 +2452,9 @@ class Component extends Element_1.default {
|
|
2421
2452
|
const dataValue = this.dataValue;
|
2422
2453
|
// Calculate the new value.
|
2423
2454
|
let calculatedValue = this.doValueCalculation(dataValue, data, row, flags);
|
2455
|
+
if (this.options.readOnly && dataValue && !calculatedValue) {
|
2456
|
+
return false;
|
2457
|
+
}
|
2424
2458
|
if (lodash_1.default.isNil(calculatedValue)) {
|
2425
2459
|
calculatedValue = this.emptyValue;
|
2426
2460
|
}
|
@@ -2571,7 +2605,7 @@ class Component extends Element_1.default {
|
|
2571
2605
|
const { async = false, silentCheck = false } = options;
|
2572
2606
|
if (this.shouldSkipValidation(data, dirty, row)) {
|
2573
2607
|
this.setCustomValidity('');
|
2574
|
-
return async ?
|
2608
|
+
return async ? Promise.resolve(true) : true;
|
2575
2609
|
}
|
2576
2610
|
const check = Validator_1.default.checkComponent(this, data, row, true, async);
|
2577
2611
|
let validations = check;
|
@@ -2590,7 +2624,7 @@ class Component extends Element_1.default {
|
|
2590
2624
|
return isValid;
|
2591
2625
|
}
|
2592
2626
|
checkAsyncValidity(data, dirty, row, silentCheck) {
|
2593
|
-
return
|
2627
|
+
return Promise.resolve(this.checkComponentValidity(data, dirty, row, { async: true, silentCheck }));
|
2594
2628
|
}
|
2595
2629
|
/**
|
2596
2630
|
* Check the conditions, calculations, and validity of a single component and triggers an update if
|
@@ -2831,7 +2865,7 @@ class Component extends Element_1.default {
|
|
2831
2865
|
return this.dataReady;
|
2832
2866
|
}
|
2833
2867
|
get dataReady() {
|
2834
|
-
return
|
2868
|
+
return Promise.resolve();
|
2835
2869
|
}
|
2836
2870
|
/**
|
2837
2871
|
* Prints out the value of this component as a string value.
|
@@ -3069,7 +3103,7 @@ Component.externalLibraries = {};
|
|
3069
3103
|
Component.requireLibrary = function (name, property, src, polling) {
|
3070
3104
|
if (!Component.externalLibraries.hasOwnProperty(name)) {
|
3071
3105
|
Component.externalLibraries[name] = {};
|
3072
|
-
Component.externalLibraries[name].ready = new
|
3106
|
+
Component.externalLibraries[name].ready = new Promise((resolve, reject) => {
|
3073
3107
|
Component.externalLibraries[name].resolve = resolve;
|
3074
3108
|
Component.externalLibraries[name].reject = reject;
|
3075
3109
|
});
|
@@ -3142,5 +3176,5 @@ Component.libraryReady = function (name) {
|
|
3142
3176
|
Component.externalLibraries[name].ready) {
|
3143
3177
|
return Component.externalLibraries[name].ready;
|
3144
3178
|
}
|
3145
|
-
return
|
3179
|
+
return Promise.reject(`${name} library was not required.`);
|
3146
3180
|
};
|
@@ -31,7 +31,7 @@ export default class Input extends Multivalue {
|
|
31
31
|
parseValue(value: any): any;
|
32
32
|
formatValue(value: any): any;
|
33
33
|
getWidget(index: any): any;
|
34
|
-
attachElement(element: any, index: any):
|
34
|
+
attachElement(element: any, index: any): Promise<void>;
|
35
35
|
/**
|
36
36
|
* Creates an instance of a widget for this component.
|
37
37
|
*
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Multivalue_1 = __importDefault(require("../multivalue/Multivalue"));
|
7
7
|
const utils_1 = require("../../../utils/utils");
|
8
8
|
const widgets_1 = __importDefault(require("../../../widgets"));
|
9
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
10
9
|
const lodash_1 = __importDefault(require("lodash"));
|
11
10
|
class Input extends Multivalue_1.default {
|
12
11
|
constructor(component, options, data) {
|
@@ -218,7 +217,7 @@ class Input extends Multivalue_1.default {
|
|
218
217
|
element.widget.destroy();
|
219
218
|
}
|
220
219
|
// Attach the widget.
|
221
|
-
let promise =
|
220
|
+
let promise = Promise.resolve();
|
222
221
|
element.widget = this.createWidget(index);
|
223
222
|
if (element.widget) {
|
224
223
|
promise = element.widget.attach(element);
|
@@ -1,5 +1,9 @@
|
|
1
1
|
export default class ListComponent extends Field {
|
2
2
|
get isSelectURL(): boolean;
|
3
|
+
get selectData(): any;
|
4
|
+
get shouldLoad(): any;
|
5
|
+
getTemplateKeys(): void;
|
6
|
+
templateKeys: any[] | undefined;
|
3
7
|
get requestHeaders(): any;
|
4
8
|
setItems(): void;
|
5
9
|
updateCustomItems(): void;
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const Field_1 = __importDefault(require("../field/Field"));
|
7
7
|
const Formio_1 = require("../../../Formio");
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
9
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
10
9
|
class ListComponent extends Field_1.default {
|
11
10
|
static schema(...extend) {
|
12
11
|
return Field_1.default.schema({
|
@@ -22,6 +21,46 @@ class ListComponent extends Field_1.default {
|
|
22
21
|
get isSelectURL() {
|
23
22
|
return this.component.dataSrc === 'url';
|
24
23
|
}
|
24
|
+
get selectData() {
|
25
|
+
const selectData = lodash_1.default.get(this.root, 'submission.metadata.selectData', {});
|
26
|
+
return lodash_1.default.get(selectData, this.path);
|
27
|
+
}
|
28
|
+
get shouldLoad() {
|
29
|
+
if (this.loadingError) {
|
30
|
+
return false;
|
31
|
+
}
|
32
|
+
// Live forms should always load.
|
33
|
+
if (!this.options.readOnly) {
|
34
|
+
return true;
|
35
|
+
}
|
36
|
+
// If there are template keys, then we need to see if we have the data.
|
37
|
+
if (this.templateKeys && this.templateKeys.length) {
|
38
|
+
// See if we already have the data we need.
|
39
|
+
const dataValue = this.dataValue;
|
40
|
+
const selectData = this.selectData;
|
41
|
+
return this.templateKeys.reduce((shouldLoad, key) => {
|
42
|
+
const hasValue = lodash_1.default.has(dataValue, key) ||
|
43
|
+
(lodash_1.default.isArray(selectData) ? selectData.every((data) => lodash_1.default.has(data, key)) : lodash_1.default.has(selectData, key));
|
44
|
+
return shouldLoad || !hasValue;
|
45
|
+
}, false);
|
46
|
+
}
|
47
|
+
// Return that we should load.
|
48
|
+
return true;
|
49
|
+
}
|
50
|
+
getTemplateKeys() {
|
51
|
+
this.templateKeys = [];
|
52
|
+
if (this.options.readOnly && this.component.template) {
|
53
|
+
const keys = this.component.template.match(/({{\s*(.*?)\s*}})/g);
|
54
|
+
if (keys) {
|
55
|
+
keys.forEach((key) => {
|
56
|
+
const propKey = key.match(/{{\s*item\.(.*?)\s*}}/);
|
57
|
+
if (propKey && propKey.length > 1) {
|
58
|
+
this.templateKeys.push(propKey[1]);
|
59
|
+
}
|
60
|
+
});
|
61
|
+
}
|
62
|
+
}
|
63
|
+
}
|
25
64
|
get requestHeaders() {
|
26
65
|
// Create the headers object.
|
27
66
|
const headers = new Formio_1.Formio.Headers();
|
@@ -63,17 +102,15 @@ class ListComponent extends Field_1.default {
|
|
63
102
|
return template;
|
64
103
|
}
|
65
104
|
itemTemplate(data, value) {
|
66
|
-
var _a;
|
67
105
|
if (lodash_1.default.isEmpty(data)) {
|
68
106
|
return '';
|
69
107
|
}
|
70
108
|
const template = this.sanitize(this.getOptionTemplate(data, value), this.shouldSanitizeValue);
|
71
109
|
if (template) {
|
72
110
|
const label = template.replace(/<\/?[^>]+(>|$)/g, '');
|
73
|
-
|
74
|
-
if (!label || (hasTranslator && !this.t(label, { _userInput: true })))
|
111
|
+
if (!label)
|
75
112
|
return;
|
76
|
-
return
|
113
|
+
return template.replace(label, this.t(label, { _userInput: true }));
|
77
114
|
}
|
78
115
|
else {
|
79
116
|
return this.sanitize(JSON.stringify(data), this.shouldSanitizeValue);
|
@@ -192,7 +229,7 @@ class ListComponent extends Field_1.default {
|
|
192
229
|
const db = event.target.result;
|
193
230
|
const transaction = db.transaction(this.component.indexeddb.table, 'readwrite');
|
194
231
|
const objectStore = transaction.objectStore(this.component.indexeddb.table);
|
195
|
-
new
|
232
|
+
new Promise((resolve) => {
|
196
233
|
const responseItems = [];
|
197
234
|
objectStore.getAll().onsuccess = (event) => {
|
198
235
|
event.target.result.forEach((item) => {
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const Field_1 = __importDefault(require("../field/Field"));
|
7
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
8
7
|
const lodash_1 = __importDefault(require("lodash"));
|
9
8
|
class Multivalue extends Field_1.default {
|
10
9
|
get dataValue() {
|
@@ -78,7 +77,7 @@ class Multivalue extends Field_1.default {
|
|
78
77
|
promises.push(this.attachElement.call(this, element, index));
|
79
78
|
});
|
80
79
|
if (!this.component.multiple) {
|
81
|
-
return
|
80
|
+
return Promise.all(promises);
|
82
81
|
}
|
83
82
|
this.refs.removeRow.forEach((removeButton, index) => {
|
84
83
|
this.addEventListener(removeButton, 'click', (event) => {
|
@@ -94,7 +93,7 @@ class Multivalue extends Field_1.default {
|
|
94
93
|
});
|
95
94
|
});
|
96
95
|
return superAttach.then(() => {
|
97
|
-
return
|
96
|
+
return Promise.all(promises);
|
98
97
|
});
|
99
98
|
}
|
100
99
|
detach() {
|
@@ -187,7 +186,14 @@ class Multivalue extends Field_1.default {
|
|
187
186
|
saveCaretPosition(element, index) {
|
188
187
|
var _a, _b;
|
189
188
|
if (((_b = (_a = this.root) === null || _a === void 0 ? void 0 : _a.focusedComponent) === null || _b === void 0 ? void 0 : _b.path) === this.path) {
|
190
|
-
|
189
|
+
try {
|
190
|
+
this.root.currentSelection = { selection: [element.selectionStart, element.selectionEnd], index };
|
191
|
+
}
|
192
|
+
catch (e) {
|
193
|
+
if (!(e instanceof DOMException)) {
|
194
|
+
console.debug(e);
|
195
|
+
}
|
196
|
+
}
|
191
197
|
}
|
192
198
|
}
|
193
199
|
onSelectMaskHandler(event) {
|
@@ -4,7 +4,8 @@ export default class NestedComponent extends Field {
|
|
4
4
|
_collapsed: boolean;
|
5
5
|
set collapsed(arg: boolean);
|
6
6
|
get collapsed(): boolean;
|
7
|
-
collapse(value: any):
|
7
|
+
collapse(value: any): Promise<void>;
|
8
|
+
get ready(): Promise<any[]>;
|
8
9
|
set rowIndex(arg: any);
|
9
10
|
get rowIndex(): any;
|
10
11
|
_rowIndex: any;
|
@@ -78,8 +79,9 @@ export default class NestedComponent extends Field {
|
|
78
79
|
addComponent(component: Object, data: Object, before: HTMLElement, noAdd: any): Component;
|
79
80
|
beforeFocus(): void;
|
80
81
|
renderComponents(components: any): any;
|
82
|
+
attach(element: any): Promise<[void, void]>;
|
81
83
|
attachComponentsLogic(components: any): void;
|
82
|
-
attachComponents(element: any, components: any, container: any): any
|
84
|
+
attachComponents(element: any, components: any, container: any): Promise<any>;
|
83
85
|
/**
|
84
86
|
* Remove a component from the components array.
|
85
87
|
*
|
@@ -123,6 +125,7 @@ export default class NestedComponent extends Field {
|
|
123
125
|
get isPristine(): any;
|
124
126
|
destroyComponents(all?: boolean): void;
|
125
127
|
get errors(): any;
|
128
|
+
get dataReady(): Promise<any[]>;
|
126
129
|
setNestedValue(component: any, value: any, flags?: {}): any;
|
127
130
|
setValue(value: any, flags?: {}): any;
|
128
131
|
get lazyLoad(): any;
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const Field_1 = __importDefault(require("../field/Field"));
|
8
8
|
const Components_1 = __importDefault(require("../../Components"));
|
9
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
10
9
|
const utils_1 = require("../../../utils/utils");
|
11
10
|
class NestedComponent extends Field_1.default {
|
12
11
|
static schema(...extend) {
|
@@ -50,8 +49,8 @@ class NestedComponent extends Field_1.default {
|
|
50
49
|
const visibilityChanged = this._visible !== value;
|
51
50
|
this._visible = value;
|
52
51
|
const isVisible = this.visible;
|
53
|
-
const forceShow = this.
|
54
|
-
const forceHide = this.
|
52
|
+
const forceShow = this.shouldForceShow();
|
53
|
+
const forceHide = this.shouldForceHide();
|
55
54
|
this.components.forEach(component => {
|
56
55
|
// Set the parent visibility first since we may have nested components within nested components
|
57
56
|
// and they need to be able to determine their visibility based on the parent visibility.
|
@@ -100,7 +99,7 @@ class NestedComponent extends Field_1.default {
|
|
100
99
|
return super.parentDisabled;
|
101
100
|
}
|
102
101
|
get ready() {
|
103
|
-
return
|
102
|
+
return Promise.all(this.getComponents().map(component => component.ready));
|
104
103
|
}
|
105
104
|
get currentForm() {
|
106
105
|
return super.currentForm;
|
@@ -405,7 +404,7 @@ class NestedComponent extends Field_1.default {
|
|
405
404
|
collapsed: this.collapsed,
|
406
405
|
[this.nestedKey]: 'single',
|
407
406
|
});
|
408
|
-
let childPromise =
|
407
|
+
let childPromise = Promise.resolve();
|
409
408
|
if (this.refs[this.nestedKey]) {
|
410
409
|
childPromise = this.attachComponents(this.refs[this.nestedKey]);
|
411
410
|
}
|
@@ -423,7 +422,7 @@ class NestedComponent extends Field_1.default {
|
|
423
422
|
}
|
424
423
|
});
|
425
424
|
}
|
426
|
-
return
|
425
|
+
return Promise.all([
|
427
426
|
superPromise,
|
428
427
|
childPromise,
|
429
428
|
]);
|
@@ -443,7 +442,7 @@ class NestedComponent extends Field_1.default {
|
|
443
442
|
element = this.hook('attachComponents', element, components, container, this);
|
444
443
|
if (!element) {
|
445
444
|
// Return a non-resolving promise.
|
446
|
-
return (new
|
445
|
+
return (new Promise(() => { }));
|
447
446
|
}
|
448
447
|
let index = 0;
|
449
448
|
const promises = [];
|
@@ -453,7 +452,7 @@ class NestedComponent extends Field_1.default {
|
|
453
452
|
index++;
|
454
453
|
}
|
455
454
|
});
|
456
|
-
return
|
455
|
+
return Promise.all(promises);
|
457
456
|
}
|
458
457
|
/**
|
459
458
|
* Remove a component from the components array.
|
@@ -564,7 +563,7 @@ class NestedComponent extends Field_1.default {
|
|
564
563
|
* @return {*}
|
565
564
|
*/
|
566
565
|
beforePage(next) {
|
567
|
-
return
|
566
|
+
return Promise.all(this.getComponents().map((comp) => comp.beforePage(next)));
|
568
567
|
}
|
569
568
|
/**
|
570
569
|
* Allow components to hook into the submission to provide their own async data.
|
@@ -572,7 +571,7 @@ class NestedComponent extends Field_1.default {
|
|
572
571
|
* @return {*}
|
573
572
|
*/
|
574
573
|
beforeSubmit() {
|
575
|
-
return
|
574
|
+
return Promise.all(this.getComponents().map((comp) => comp.beforeSubmit()));
|
576
575
|
}
|
577
576
|
calculateValue(data, flags, row) {
|
578
577
|
// Do not iterate into children and calculateValues if this nested component is conditionally hidden.
|
@@ -603,7 +602,7 @@ class NestedComponent extends Field_1.default {
|
|
603
602
|
return this.ready.then(() => {
|
604
603
|
const promises = [super.checkAsyncValidity(data, dirty, row, silentCheck)];
|
605
604
|
this.eachComponent((component) => promises.push(component.checkAsyncValidity(data, dirty, row, silentCheck)));
|
606
|
-
return
|
605
|
+
return Promise.all(promises).then((results) => results.reduce((valid, result) => (valid && result), true));
|
607
606
|
});
|
608
607
|
}
|
609
608
|
setPristine(pristine) {
|
@@ -652,7 +651,7 @@ class NestedComponent extends Field_1.default {
|
|
652
651
|
this.setPristine(true);
|
653
652
|
}
|
654
653
|
get dataReady() {
|
655
|
-
return
|
654
|
+
return Promise.all(this.getComponents().map((component) => component.dataReady));
|
656
655
|
}
|
657
656
|
setNestedValue(component, value, flags = {}) {
|
658
657
|
component._data = this.componentContext(component);
|
@@ -3,6 +3,14 @@ export namespace AddressComponentMode {
|
|
3
3
|
const Manual: string;
|
4
4
|
}
|
5
5
|
export default class AddressComponent extends ContainerComponent {
|
6
|
+
static get builderInfo(): {
|
7
|
+
title: string;
|
8
|
+
group: string;
|
9
|
+
icon: string;
|
10
|
+
documentation: string;
|
11
|
+
weight: number;
|
12
|
+
schema: any;
|
13
|
+
};
|
6
14
|
static get modeSwitcherRef(): string;
|
7
15
|
static get removeValueIconRef(): string;
|
8
16
|
static get searchInputRef(): string;
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
8
7
|
const Field_1 = __importDefault(require("../_classes/field/Field"));
|
9
8
|
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
10
9
|
const utils_1 = require("../../utils/utils");
|
@@ -360,7 +359,7 @@ class ButtonComponent extends Field_1.default {
|
|
360
359
|
let params = {
|
361
360
|
response_type: 'code',
|
362
361
|
client_id: settings.clientId,
|
363
|
-
redirect_uri: settings.redirectURI || window.location.origin || `${window.location.protocol}//${window.location.host}`,
|
362
|
+
redirect_uri: (settings.redirectURI && this.interpolate(settings.redirectURI)) || window.location.origin || `${window.location.protocol}//${window.location.host}`,
|
364
363
|
state: settings.state,
|
365
364
|
scope: settings.scope
|
366
365
|
};
|
@@ -399,7 +398,7 @@ class ButtonComponent extends Field_1.default {
|
|
399
398
|
return;
|
400
399
|
}
|
401
400
|
// Depending on where the settings came from, submit to either the submission endpoint (old) or oauth endpoint (new).
|
402
|
-
let requestPromise =
|
401
|
+
let requestPromise = Promise.resolve();
|
403
402
|
if (lodash_1.default.has(this, 'root.form.config.oauth') && this.root.form.config.oauth[this.component.oauthProvider]) {
|
404
403
|
params.provider = settings.provider;
|
405
404
|
params.redirectURI = originalRedirectUri;
|
@@ -7,6 +7,19 @@ export default class CheckBoxComponent extends Field {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: string[];
|
12
|
+
valueComponent(): {
|
13
|
+
valueType: string;
|
14
|
+
data: {
|
15
|
+
values: {
|
16
|
+
label: string;
|
17
|
+
value: string;
|
18
|
+
}[];
|
19
|
+
};
|
20
|
+
type: string;
|
21
|
+
};
|
22
|
+
};
|
10
23
|
get labelClass(): string;
|
11
24
|
get inputInfo(): {
|
12
25
|
type: string;
|