@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
@@ -21,6 +21,12 @@ export default class SurveyComponent extends Field {
|
|
21
21
|
schema: SurveyComponent.schema()
|
22
22
|
};
|
23
23
|
}
|
24
|
+
static get serverConditionSettings() {
|
25
|
+
return {
|
26
|
+
...super.serverConditionSettings,
|
27
|
+
operators: ['isEmpty', 'isNotEmpty'],
|
28
|
+
};
|
29
|
+
}
|
24
30
|
get defaultSchema() {
|
25
31
|
return SurveyComponent.schema();
|
26
32
|
}
|
@@ -21,6 +21,12 @@ export default class TagsComponent extends Input {
|
|
21
21
|
schema: TagsComponent.schema()
|
22
22
|
};
|
23
23
|
}
|
24
|
+
static get serverConditionSettings() {
|
25
|
+
return {
|
26
|
+
...super.serverConditionSettings,
|
27
|
+
operators: [...super.serverConditionSettings.operators, 'includes', 'notIncludes'],
|
28
|
+
};
|
29
|
+
}
|
24
30
|
init() {
|
25
31
|
super.init();
|
26
32
|
}
|
@@ -10,6 +10,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
10
10
|
*/
|
11
11
|
updateEditorValue(index: any, newValue: any): void;
|
12
12
|
autoModified: boolean | undefined;
|
13
|
+
attachElement(element: any, index: any): any;
|
13
14
|
imageHandler(moduleInstance: any, range: any, files: any): void;
|
14
15
|
get isPlain(): boolean;
|
15
16
|
get htmlView(): any;
|
@@ -19,8 +20,8 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
19
20
|
setReadOnlyValue(value: any, index: any): void;
|
20
21
|
get isJsonValue(): any;
|
21
22
|
setConvertedValue(value: any, index: any): any;
|
22
|
-
setAsyncConvertedValue(value: any): any
|
23
|
-
setImagesUrl(images: any): any
|
23
|
+
setAsyncConvertedValue(value: any): Promise<any>;
|
24
|
+
setImagesUrl(images: any): Promise<any>;
|
24
25
|
addAutoExpanding(textarea: any, index: any): void;
|
25
26
|
trimBlanks(value: any): any;
|
26
27
|
onChange(flags: any, fromRoot: any): {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/* global Quill */
|
2
2
|
import TextFieldComponent from '../textfield/TextField';
|
3
3
|
import _ from 'lodash';
|
4
|
-
import NativePromise from 'native-promise-only';
|
5
4
|
import { uniqueName, getBrowserInfo } from '../../utils/utils';
|
6
5
|
export default class TextAreaComponent extends TextFieldComponent {
|
7
6
|
static schema(...extend) {
|
@@ -112,7 +111,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
112
111
|
this.wysiwygDefault[this.component.editor] || this.wysiwygDefault.default
|
113
112
|
: this.component.wysiwyg;
|
114
113
|
// Keep track of when this editor is ready.
|
115
|
-
this.editorsReady[index] = new
|
114
|
+
this.editorsReady[index] = new Promise((editorReady) => {
|
116
115
|
// Attempt to add a wysiwyg editor. In order to add one, it must be included on the global scope.
|
117
116
|
switch (this.component.editor) {
|
118
117
|
case 'ace':
|
@@ -280,7 +279,7 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
280
279
|
this.setConvertedValue(value);
|
281
280
|
return super.setValue(value, flags);
|
282
281
|
}
|
283
|
-
flags.skipWysiwyg = _.isEqual(value, this.getValue());
|
282
|
+
flags.skipWysiwyg = value === '' && flags.resetValue ? false : _.isEqual(value, this.getValue());
|
284
283
|
return super.setValue(value, flags);
|
285
284
|
}
|
286
285
|
setContent(element, content, forceSanitize) {
|
@@ -342,11 +341,11 @@ export default class TextAreaComponent extends TextFieldComponent {
|
|
342
341
|
});
|
343
342
|
}
|
344
343
|
else {
|
345
|
-
return
|
344
|
+
return Promise.resolve(value);
|
346
345
|
}
|
347
346
|
}
|
348
347
|
setImagesUrl(images) {
|
349
|
-
return
|
348
|
+
return Promise.all(_.map(images, image => {
|
350
349
|
let requestData;
|
351
350
|
try {
|
352
351
|
requestData = JSON.parse(image.getAttribute('alt'));
|
@@ -0,0 +1,30 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
const type: string;
|
3
|
+
const components: ({
|
4
|
+
type: string;
|
5
|
+
key: string;
|
6
|
+
rows: number;
|
7
|
+
editor: string;
|
8
|
+
hideLabel: boolean;
|
9
|
+
as: string;
|
10
|
+
input: boolean;
|
11
|
+
label?: undefined;
|
12
|
+
showValidations?: undefined;
|
13
|
+
tableView?: undefined;
|
14
|
+
} | {
|
15
|
+
label: string;
|
16
|
+
showValidations: boolean;
|
17
|
+
tableView: boolean;
|
18
|
+
key: string;
|
19
|
+
type: string;
|
20
|
+
input: boolean;
|
21
|
+
rows?: undefined;
|
22
|
+
editor?: undefined;
|
23
|
+
hideLabel?: undefined;
|
24
|
+
as?: undefined;
|
25
|
+
})[];
|
26
|
+
const title: string;
|
27
|
+
const display: string;
|
28
|
+
const name: string;
|
29
|
+
}
|
30
|
+
export default _default;
|
@@ -0,0 +1,25 @@
|
|
1
|
+
export default {
|
2
|
+
type: 'form',
|
3
|
+
components: [
|
4
|
+
{
|
5
|
+
type: 'textarea',
|
6
|
+
key: 'jsonTextarea',
|
7
|
+
rows: 5,
|
8
|
+
editor: 'ace',
|
9
|
+
hideLabel: true,
|
10
|
+
as: 'json',
|
11
|
+
input: true
|
12
|
+
},
|
13
|
+
{
|
14
|
+
label: 'Submit',
|
15
|
+
showValidations: false,
|
16
|
+
tableView: false,
|
17
|
+
key: 'submit',
|
18
|
+
type: 'button',
|
19
|
+
input: true
|
20
|
+
}
|
21
|
+
],
|
22
|
+
title: 'text area tests',
|
23
|
+
display: 'form',
|
24
|
+
name: 'textAriaTests',
|
25
|
+
};
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import Input from '../_classes/input/Input';
|
2
2
|
import { conformToMask } from '@formio/vanilla-text-mask';
|
3
3
|
import * as FormioUtils from '../../utils/utils';
|
4
|
-
import NativePromise from 'native-promise-only';
|
5
4
|
export default class TextFieldComponent extends Input {
|
6
5
|
static schema(...extend) {
|
7
6
|
return Input.schema({
|
@@ -33,6 +32,12 @@ export default class TextFieldComponent extends Input {
|
|
33
32
|
schema: TextFieldComponent.schema()
|
34
33
|
};
|
35
34
|
}
|
35
|
+
static get serverConditionSettings() {
|
36
|
+
return {
|
37
|
+
...super.serverConditionSettings,
|
38
|
+
operators: [...super.serverConditionSettings.operators, 'includes', 'notIncludes', 'endsWith', 'startsWith'],
|
39
|
+
};
|
40
|
+
}
|
36
41
|
get defaultSchema() {
|
37
42
|
return TextFieldComponent.schema();
|
38
43
|
}
|
@@ -209,10 +214,10 @@ export default class TextFieldComponent extends Input {
|
|
209
214
|
beforeSubmit() {
|
210
215
|
let value = this.dataValue;
|
211
216
|
if (!this.component.truncateMultipleSpaces || !value) {
|
212
|
-
return
|
217
|
+
return Promise.resolve(value);
|
213
218
|
}
|
214
219
|
value = this.truncateMultipleSpaces(value);
|
215
220
|
this.dataValue = value;
|
216
|
-
return
|
221
|
+
return Promise.resolve(value).then(() => super.beforeSubmit());
|
217
222
|
}
|
218
223
|
}
|
@@ -13,6 +13,17 @@ export default class TimeComponent extends TextFieldComponent {
|
|
13
13
|
dataFormat: defaultDataFormat,
|
14
14
|
}, ...extend);
|
15
15
|
}
|
16
|
+
static get serverConditionSettings() {
|
17
|
+
return {
|
18
|
+
...super.serverConditionSettings,
|
19
|
+
valueComponent(classComp) {
|
20
|
+
return {
|
21
|
+
...classComp,
|
22
|
+
type: 'time',
|
23
|
+
};
|
24
|
+
},
|
25
|
+
};
|
26
|
+
}
|
16
27
|
constructor(component, options, data) {
|
17
28
|
super(component, options, data);
|
18
29
|
const { edge: isEdgeBrowser, version: edgeVersion } = getBrowserInfo();
|
@@ -33,7 +44,7 @@ export default class TimeComponent extends TextFieldComponent {
|
|
33
44
|
title: 'Time',
|
34
45
|
icon: 'clock-o',
|
35
46
|
group: 'advanced',
|
36
|
-
documentation: '/userguide/form-building/advanced-components#time',
|
47
|
+
documentation: '/userguide/form-building/advanced-components#time-1',
|
37
48
|
weight: 55,
|
38
49
|
schema: TimeComponent.schema(),
|
39
50
|
};
|
@@ -2,9 +2,9 @@ export default class TreeComponent extends NestedDataComponent {
|
|
2
2
|
static get builderInfo(): {
|
3
3
|
title: string;
|
4
4
|
icon: string;
|
5
|
-
group: string;
|
6
5
|
weight: number;
|
7
6
|
documentation: string;
|
7
|
+
showPreview: boolean;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
10
|
constructor(...args: any[]);
|
@@ -23,10 +23,11 @@ export default class TreeComponent extends NestedDataComponent {
|
|
23
23
|
renderChildNodes(nodes: any[] | undefined, odd: any): any;
|
24
24
|
renderEdit(node?: {}): any;
|
25
25
|
renderView(node?: {}): any;
|
26
|
-
|
26
|
+
attach(element: any): Promise<[void, void]> | Promise<[[void, void], void | [void, void]]>;
|
27
|
+
attachNode(element: any, node: any): Promise<void> | Promise<[void, void]>;
|
27
28
|
attachActions(node: any): void;
|
28
|
-
attachComponents(node: any, ...args: any[]): any
|
29
|
-
attachChildren(node: any): any
|
29
|
+
attachComponents(node: any, ...args: any[]): Promise<any>;
|
30
|
+
attachChildren(node: any): Promise<any>;
|
30
31
|
addChild(parent: any): void;
|
31
32
|
cancelNode(node: any): void;
|
32
33
|
editNode(node: any): void;
|
@@ -1,7 +1,12 @@
|
|
1
1
|
import componentEditForm from '../_classes/component/Component.form';
|
2
2
|
import TreeEditData from './editForm/Tree.edit.data';
|
3
|
+
import TreeDisplayData from './editForm/Tree.edit.display';
|
3
4
|
export default function (...extend) {
|
4
5
|
return componentEditForm([
|
6
|
+
{
|
7
|
+
key: 'display',
|
8
|
+
components: TreeDisplayData,
|
9
|
+
},
|
5
10
|
{
|
6
11
|
key: 'data',
|
7
12
|
components: TreeEditData,
|
@@ -3,7 +3,6 @@ import Component from '../_classes/component/Component';
|
|
3
3
|
import Components from '../Components';
|
4
4
|
import NestedDataComponent from '../_classes/nesteddata/NestedDataComponent';
|
5
5
|
import Node from './Node';
|
6
|
-
import NativePromise from 'native-promise-only';
|
7
6
|
export default class TreeComponent extends NestedDataComponent {
|
8
7
|
static schema(...extend) {
|
9
8
|
return NestedDataComponent.schema({
|
@@ -21,9 +20,9 @@ export default class TreeComponent extends NestedDataComponent {
|
|
21
20
|
return {
|
22
21
|
title: 'Tree',
|
23
22
|
icon: 'indent',
|
24
|
-
group: 'data',
|
25
23
|
weight: 40,
|
26
24
|
documentation: '/userguide/form-building/data-components#tree',
|
25
|
+
showPreview: false,
|
27
26
|
schema: TreeComponent.schema(),
|
28
27
|
};
|
29
28
|
}
|
@@ -134,17 +133,17 @@ export default class TreeComponent extends NestedDataComponent {
|
|
134
133
|
this.loadRefs(element, {
|
135
134
|
root: 'single',
|
136
135
|
});
|
137
|
-
return
|
136
|
+
return Promise.all([
|
138
137
|
super.attach(element),
|
139
138
|
this.attachNode(this.refs.root, this.treeRoot),
|
140
139
|
]);
|
141
140
|
}
|
142
141
|
attachNode(element, node) {
|
143
142
|
if (!element) {
|
144
|
-
return
|
143
|
+
return Promise.resolve();
|
145
144
|
}
|
146
|
-
let componentsPromise =
|
147
|
-
let childrenPromise =
|
145
|
+
let componentsPromise = Promise.resolve();
|
146
|
+
let childrenPromise = Promise.resolve();
|
148
147
|
node.refs = _.reduce(element.children, (refs, child) => (child.hasAttribute('ref')
|
149
148
|
? {
|
150
149
|
...refs,
|
@@ -158,7 +157,7 @@ export default class TreeComponent extends NestedDataComponent {
|
|
158
157
|
if (node.refs.childNodes) {
|
159
158
|
childrenPromise = this.attachChildren(node);
|
160
159
|
}
|
161
|
-
return
|
160
|
+
return Promise.all([
|
162
161
|
componentsPromise,
|
163
162
|
childrenPromise,
|
164
163
|
]);
|
@@ -223,11 +222,11 @@ export default class TreeComponent extends NestedDataComponent {
|
|
223
222
|
});
|
224
223
|
return node.refs.nodeEdit
|
225
224
|
? super.attachComponents(node.refs.nodeEdit, node.components)
|
226
|
-
:
|
225
|
+
: Promise.resolve();
|
227
226
|
}
|
228
227
|
attachChildren(node) {
|
229
228
|
const childElements = node.refs.childNodes.children;
|
230
|
-
return
|
229
|
+
return Promise.all(_.map(childElements, (childElement, index) => this.attachNode(childElement, node.children[index])));
|
231
230
|
}
|
232
231
|
setValue(value, flags = {}) {
|
233
232
|
const changed = this.updateValue(value, flags);
|
@@ -9,15 +9,25 @@ export default class Providers {
|
|
9
9
|
(): {
|
10
10
|
title: string;
|
11
11
|
name: string;
|
12
|
-
uploadFile(file: any, fileName: any): any
|
13
|
-
downloadFile(file: any): any
|
12
|
+
uploadFile(file: any, fileName: any): Promise<any>;
|
13
|
+
downloadFile(file: any): Promise<any>;
|
14
14
|
};
|
15
15
|
title: string;
|
16
16
|
};
|
17
17
|
s3: {
|
18
18
|
(formio: any): {
|
19
|
-
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any):
|
19
|
+
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<{
|
20
|
+
storage: string;
|
21
|
+
name: any;
|
22
|
+
bucket: any;
|
23
|
+
key: any;
|
24
|
+
url: any;
|
25
|
+
acl: any;
|
26
|
+
size: any;
|
27
|
+
type: any;
|
28
|
+
}>;
|
20
29
|
downloadFile(file: any): any;
|
30
|
+
deleteFile(fileInfo: any): any;
|
21
31
|
};
|
22
32
|
title: string;
|
23
33
|
};
|
@@ -26,15 +36,24 @@ export default class Providers {
|
|
26
36
|
title: string;
|
27
37
|
name: string;
|
28
38
|
uploadFile(file: any, name: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any;
|
29
|
-
deleteFile(fileInfo: any): any
|
30
|
-
downloadFile(file: any): any
|
39
|
+
deleteFile(fileInfo: any): Promise<any>;
|
40
|
+
downloadFile(file: any): Promise<any>;
|
31
41
|
};
|
32
42
|
title: string;
|
33
43
|
};
|
34
44
|
azure: {
|
35
45
|
(formio: any): {
|
36
|
-
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any):
|
46
|
+
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<{
|
47
|
+
storage: string;
|
48
|
+
name: any;
|
49
|
+
size: any;
|
50
|
+
type: any;
|
51
|
+
groupPermissions: any;
|
52
|
+
groupId: any;
|
53
|
+
key: any;
|
54
|
+
}>;
|
37
55
|
downloadFile(file: any): any;
|
56
|
+
deleteFile: (fileInfo: any) => any;
|
38
57
|
};
|
39
58
|
title: string;
|
40
59
|
};
|
@@ -42,16 +61,17 @@ export default class Providers {
|
|
42
61
|
(): {
|
43
62
|
title: string;
|
44
63
|
name: string;
|
45
|
-
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any): any;
|
46
|
-
downloadFile(file: any, options: any): any
|
47
|
-
deleteFile(file: any, options: any): any
|
64
|
+
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any): Promise<any> | undefined;
|
65
|
+
downloadFile(file: any, options: any): Promise<any>;
|
66
|
+
deleteFile(file: any, options: any): Promise<any>;
|
48
67
|
};
|
49
68
|
title: string;
|
50
69
|
};
|
51
70
|
googledrive: {
|
52
71
|
(formio: any): {
|
53
|
-
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any
|
54
|
-
downloadFile(file: any): any
|
72
|
+
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<any>;
|
73
|
+
downloadFile(file: any): Promise<any>;
|
74
|
+
deleteFile: (fileInfo: any) => any;
|
55
75
|
};
|
56
76
|
title: string;
|
57
77
|
};
|
@@ -12,7 +12,7 @@ export class GoogleAddressProvider extends AddressProvider {
|
|
12
12
|
addRequiredProviderOptions(options: any): void;
|
13
13
|
filterPlace(place: any): {};
|
14
14
|
attachAutocomplete(elem: any, index: any, onSelectAddress: any): void;
|
15
|
-
search():
|
16
|
-
makeRequest():
|
15
|
+
search(): Promise<void>;
|
16
|
+
makeRequest(): Promise<void>;
|
17
17
|
}
|
18
18
|
import { AddressProvider } from './AddressProvider';
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import { Formio } from '../../Formio';
|
3
3
|
import _ from 'lodash';
|
4
4
|
import { AddressProvider } from './AddressProvider';
|
5
|
-
import NativePromise from 'native-promise-only';
|
6
5
|
export class GoogleAddressProvider extends AddressProvider {
|
7
6
|
static get name() {
|
8
7
|
return 'google';
|
@@ -96,10 +95,10 @@ export class GoogleAddressProvider extends AddressProvider {
|
|
96
95
|
});
|
97
96
|
}
|
98
97
|
search() {
|
99
|
-
return
|
98
|
+
return Promise.resolve();
|
100
99
|
}
|
101
100
|
makeRequest() {
|
102
|
-
return
|
101
|
+
return Promise.resolve();
|
103
102
|
}
|
104
103
|
getDisplayValue(address) {
|
105
104
|
const displayedProperty = _.has(address, this.displayValueProperty)
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export default fileProcessor;
|
2
|
-
declare function fileProcessor(formio: any, config: any): (file: any, options: any) => any
|
2
|
+
declare function fileProcessor(formio: any, config: any): (file: any, options: any) => Promise<any>;
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
const fileProcessor = (formio, config) => (file, options) => new NativePromise((resolve, reject) => {
|
1
|
+
const fileProcessor = (formio, config) => (file, options) => new Promise((resolve, reject) => {
|
3
2
|
const xhr = new XMLHttpRequest();
|
4
3
|
// Fire on network error.
|
5
4
|
xhr.onerror = (err) => {
|
@@ -1,7 +1,16 @@
|
|
1
1
|
export default azure;
|
2
2
|
declare function azure(formio: any): {
|
3
|
-
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any):
|
3
|
+
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<{
|
4
|
+
storage: string;
|
5
|
+
name: any;
|
6
|
+
size: any;
|
7
|
+
type: any;
|
8
|
+
groupPermissions: any;
|
9
|
+
groupId: any;
|
10
|
+
key: any;
|
11
|
+
}>;
|
4
12
|
downloadFile(file: any): any;
|
13
|
+
deleteFile: (fileInfo: any) => any;
|
5
14
|
};
|
6
15
|
declare namespace azure {
|
7
16
|
const title: string;
|
@@ -6,19 +6,24 @@ const azure = (formio) => ({
|
|
6
6
|
xhr.setRequestHeader('Content-Type', file.type);
|
7
7
|
xhr.setRequestHeader('x-ms-blob-type', 'BlockBlob');
|
8
8
|
return file;
|
9
|
-
}, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then(() => {
|
9
|
+
}, file, fileName, dir, progressCallback, groupPermissions, groupId, abortCallback).then((response) => {
|
10
10
|
return {
|
11
11
|
storage: 'azure',
|
12
12
|
name: XHR.path([dir, fileName]),
|
13
13
|
size: file.size,
|
14
14
|
type: file.type,
|
15
15
|
groupPermissions,
|
16
|
-
groupId
|
16
|
+
groupId,
|
17
|
+
key: response.pathFile
|
17
18
|
};
|
18
19
|
});
|
19
20
|
},
|
20
21
|
downloadFile(file) {
|
21
22
|
return formio.makeRequest('file', `${formio.formUrl}/storage/azure?name=${XHR.trim(file.name)}`, 'GET');
|
23
|
+
},
|
24
|
+
deleteFile: function deleteFile(fileInfo) {
|
25
|
+
var url = `${formio.formUrl}/storage/azure?name=${XHR.trim(fileInfo.name)}&key=${XHR.trim(fileInfo.key)}`;
|
26
|
+
return formio.makeRequest('', url, 'delete');
|
22
27
|
}
|
23
28
|
});
|
24
29
|
azure.title = 'Azure File Services';
|
@@ -2,8 +2,8 @@ export default base64;
|
|
2
2
|
declare function base64(): {
|
3
3
|
title: string;
|
4
4
|
name: string;
|
5
|
-
uploadFile(file: any, fileName: any): any
|
6
|
-
downloadFile(file: any): any
|
5
|
+
uploadFile(file: any, fileName: any): Promise<any>;
|
6
|
+
downloadFile(file: any): Promise<any>;
|
7
7
|
};
|
8
8
|
declare namespace base64 {
|
9
9
|
const title: string;
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import NativePromise from 'native-promise-only';
|
2
1
|
const base64 = () => ({
|
3
2
|
title: 'Base64',
|
4
3
|
name: 'base64',
|
5
4
|
uploadFile(file, fileName) {
|
6
5
|
const reader = new FileReader();
|
7
|
-
return new
|
6
|
+
return new Promise((resolve, reject) => {
|
8
7
|
reader.onload = (event) => {
|
9
8
|
const url = event.target.result;
|
10
9
|
resolve({
|
@@ -23,7 +22,7 @@ const base64 = () => ({
|
|
23
22
|
},
|
24
23
|
downloadFile(file) {
|
25
24
|
// Return the original as there is nothing to do.
|
26
|
-
return
|
25
|
+
return Promise.resolve(file);
|
27
26
|
}
|
28
27
|
});
|
29
28
|
base64.title = 'Base64';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export default dropbox;
|
2
2
|
declare function dropbox(formio: any): {
|
3
|
-
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): any
|
4
|
-
downloadFile(file: any): any
|
3
|
+
uploadFile(file: any, fileName: any, dir: any, progressCallback: any, url: any, options: any, fileKey: any, groupPermissions: any, groupId: any, abortCallback: any): Promise<any>;
|
4
|
+
downloadFile(file: any): Promise<any>;
|
5
5
|
};
|
6
6
|
declare namespace dropbox {
|
7
7
|
const title: string;
|