@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
@@ -28,14 +28,23 @@ class CheckBoxComponent extends Field_1.default {
|
|
28
28
|
schema: CheckBoxComponent.schema()
|
29
29
|
};
|
30
30
|
}
|
31
|
+
static get serverConditionSettings() {
|
32
|
+
return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: ['isEqual'], valueComponent() {
|
33
|
+
return {
|
34
|
+
valueType: 'boolean',
|
35
|
+
data: {
|
36
|
+
values: [
|
37
|
+
{ label: 'Checked', value: 'true' },
|
38
|
+
{ label: 'Not Checked', value: 'false' },
|
39
|
+
]
|
40
|
+
},
|
41
|
+
type: 'select',
|
42
|
+
};
|
43
|
+
} });
|
44
|
+
}
|
31
45
|
get defaultSchema() {
|
32
46
|
return CheckBoxComponent.schema();
|
33
47
|
}
|
34
|
-
get defaultValue() {
|
35
|
-
const { name } = this.component;
|
36
|
-
const defaultValue = super.defaultValue;
|
37
|
-
return name ? (this.component[name] || this.emptyValue) : (defaultValue || this.component.defaultValue || false).toString() === 'true';
|
38
|
-
}
|
39
48
|
get labelClass() {
|
40
49
|
let className = '';
|
41
50
|
if (this.isInputComponent
|
@@ -168,6 +177,9 @@ class CheckBoxComponent extends Field_1.default {
|
|
168
177
|
getValueAsString(value) {
|
169
178
|
const { name: componentName, value: componentValue } = this.component;
|
170
179
|
const hasValue = componentName ? lodash_1.default.isEqual(value, componentValue) : value;
|
180
|
+
if (lodash_1.default.isUndefined(value) && this.inDataTable) {
|
181
|
+
return '';
|
182
|
+
}
|
171
183
|
return this.t(hasValue ? 'Yes' : 'No');
|
172
184
|
}
|
173
185
|
updateValue(value, flags) {
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const Component_1 = __importDefault(require("../_classes/component/Component"));
|
7
7
|
const lodash_1 = __importDefault(require("lodash"));
|
8
|
-
const native_promise_only_1 = __importDefault(require("native-promise-only"));
|
9
8
|
class ContentComponent extends Component_1.default {
|
10
9
|
static schema(...extend) {
|
11
10
|
return Component_1.default.schema({
|
@@ -51,7 +50,7 @@ class ContentComponent extends Component_1.default {
|
|
51
50
|
}
|
52
51
|
get dataReady() {
|
53
52
|
var _a;
|
54
|
-
return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submissionReady) ||
|
53
|
+
return ((_a = this.root) === null || _a === void 0 ? void 0 : _a.submissionReady) || Promise.resolve();
|
55
54
|
}
|
56
55
|
attach(element) {
|
57
56
|
this.loadRefs(element, { html: 'single' });
|
@@ -1,4 +1,15 @@
|
|
1
|
-
declare const _default: {
|
1
|
+
declare const _default: ({
|
2
|
+
key: string;
|
3
|
+
ignore: boolean;
|
4
|
+
type?: undefined;
|
5
|
+
input?: undefined;
|
6
|
+
weight?: undefined;
|
7
|
+
label?: undefined;
|
8
|
+
tooltip?: undefined;
|
9
|
+
defaultValue?: undefined;
|
10
|
+
dataSrc?: undefined;
|
11
|
+
data?: undefined;
|
12
|
+
} | {
|
2
13
|
type: string;
|
3
14
|
input: boolean;
|
4
15
|
weight: number;
|
@@ -13,5 +24,6 @@ declare const _default: {
|
|
13
24
|
value: string;
|
14
25
|
}[];
|
15
26
|
};
|
16
|
-
|
27
|
+
ignore?: undefined;
|
28
|
+
})[];
|
17
29
|
export default _default;
|
@@ -24,6 +24,7 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
24
24
|
icon: 'th',
|
25
25
|
group: 'data',
|
26
26
|
documentation: '/userguide/form-building/data-components#data-grid',
|
27
|
+
showPreview: false,
|
27
28
|
weight: 30,
|
28
29
|
schema: DataGridComponent.schema()
|
29
30
|
};
|
@@ -513,7 +514,13 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
513
514
|
(col.checkConditions(data, flags, dataValue[rowIndex]) && col.type !== 'hidden');
|
514
515
|
if (col.component.logic && firstRowCheck) {
|
515
516
|
const compIndex = lodash_1.default.findIndex(this.columns, ['key', key]);
|
516
|
-
|
517
|
+
const equalColumns = lodash_1.default.isEqualWith(this.columns[compIndex], col.component, (col1, col2, key) => {
|
518
|
+
// Don't compare columns by their auto-generated ids.
|
519
|
+
if (key === 'id') {
|
520
|
+
return true;
|
521
|
+
}
|
522
|
+
});
|
523
|
+
if (!equalColumns) {
|
517
524
|
logicRebuild = true;
|
518
525
|
this.columns[compIndex] = col.component;
|
519
526
|
}
|
@@ -7,6 +7,10 @@ export default class DateTimeComponent extends Input {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
static get serverConditionSettings(): {
|
11
|
+
operators: string[];
|
12
|
+
valueComponent(classComp: any): any;
|
13
|
+
};
|
10
14
|
get emptyValue(): string;
|
11
15
|
get momentFormat(): string;
|
12
16
|
createWrapper(): boolean;
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
6
|
const lodash_1 = __importDefault(require("lodash"));
|
7
7
|
const moment_1 = __importDefault(require("moment"));
|
8
|
-
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
9
8
|
const utils_1 = __importDefault(require("../../utils"));
|
9
|
+
const Input_1 = __importDefault(require("../_classes/input/Input"));
|
10
10
|
class DateTimeComponent extends Input_1.default {
|
11
11
|
static schema(...extend) {
|
12
12
|
return Input_1.default.schema({
|
@@ -55,6 +55,20 @@ class DateTimeComponent extends Input_1.default {
|
|
55
55
|
schema: DateTimeComponent.schema()
|
56
56
|
};
|
57
57
|
}
|
58
|
+
static get serverConditionSettings() {
|
59
|
+
return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: [
|
60
|
+
'isDateEqual',
|
61
|
+
'isNotDateEqual',
|
62
|
+
'isEmpty',
|
63
|
+
'isNotEmpty',
|
64
|
+
'dateLessThan',
|
65
|
+
'dateGreaterThan',
|
66
|
+
'dateLessThanOrEqual',
|
67
|
+
'dateGreaterThanOrEqual',
|
68
|
+
], valueComponent(classComp) {
|
69
|
+
return Object.assign(Object.assign({}, classComp), { type: 'datetime' });
|
70
|
+
} });
|
71
|
+
}
|
58
72
|
constructor(component, options, data) {
|
59
73
|
super(component, options, data);
|
60
74
|
const timezone = (this.component.timezone || this.options.timezone);
|
@@ -63,9 +77,15 @@ class DateTimeComponent extends Input_1.default {
|
|
63
77
|
if (!this.component.enableDate) {
|
64
78
|
this.component.format = this.component.format.replace(/yyyy-MM-dd /g, '');
|
65
79
|
}
|
80
|
+
else if (this.component.enableDate && !/[yMd]/.test(this.component.format) && this.builderMode) {
|
81
|
+
this.component.format = `yyyy-MM-dd ${this.component.format}`;
|
82
|
+
}
|
66
83
|
if (!this.component.enableTime) {
|
67
84
|
this.component.format = this.component.format.replace(/ hh:mm a$/g, '');
|
68
85
|
}
|
86
|
+
else if (this.component.enableTime && !/[mhH]/.test(this.component.format) && this.builderMode) {
|
87
|
+
this.component.format = `${this.component.format} hh:mm a`;
|
88
|
+
}
|
69
89
|
else if (time24hr) {
|
70
90
|
this.component.format = this.component.format.replace(/hh:mm a$/g, 'HH:mm');
|
71
91
|
}
|
@@ -7,6 +7,7 @@ export default class DayComponent extends Field {
|
|
7
7
|
weight: number;
|
8
8
|
schema: any;
|
9
9
|
};
|
10
|
+
constructor(component: any, options: any, data: any);
|
10
11
|
/**
|
11
12
|
* The empty value for day component.
|
12
13
|
*
|
@@ -122,7 +123,6 @@ export default class DayComponent extends Field {
|
|
122
123
|
* @returns {Date}
|
123
124
|
*/
|
124
125
|
get date(): Date;
|
125
|
-
normalizeMinMaxDates(): any[];
|
126
126
|
/**
|
127
127
|
* Return the raw value.
|
128
128
|
*
|
@@ -4,6 +4,7 @@ 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 moment_1 = __importDefault(require("moment"));
|
7
8
|
const Field_1 = __importDefault(require("../_classes/field/Field"));
|
8
9
|
const utils_1 = require("../../utils/utils");
|
9
10
|
class DayComponent extends Field_1.default {
|
@@ -42,6 +43,27 @@ class DayComponent extends Field_1.default {
|
|
42
43
|
schema: DayComponent.schema()
|
43
44
|
};
|
44
45
|
}
|
46
|
+
constructor(component, options, data) {
|
47
|
+
if (component.maxDate) {
|
48
|
+
component.maxDate = (0, moment_1.default)(component.maxDate, 'YYYY-MM-DD').toISOString();
|
49
|
+
}
|
50
|
+
if (component.minDate) {
|
51
|
+
component.minDate = (0, moment_1.default)(component.minDate, 'YYYY-MM-DD').toISOString();
|
52
|
+
}
|
53
|
+
super(component, options, data);
|
54
|
+
}
|
55
|
+
static get serverConditionSettings() {
|
56
|
+
return Object.assign(Object.assign({}, super.serverConditionSettings), { operators: [
|
57
|
+
'isDateEqual',
|
58
|
+
'isNotDateEqual',
|
59
|
+
'isEmpty',
|
60
|
+
'isNotEmpty',
|
61
|
+
'dateLessThan',
|
62
|
+
'dateGreaterThan',
|
63
|
+
'dateLessThanOrEqual',
|
64
|
+
'dateGreaterThanOrEqual',
|
65
|
+
] });
|
66
|
+
}
|
45
67
|
/**
|
46
68
|
* The empty value for day component.
|
47
69
|
*
|
@@ -464,18 +486,12 @@ class DayComponent extends Field_1.default {
|
|
464
486
|
get date() {
|
465
487
|
return this.getDate();
|
466
488
|
}
|
467
|
-
normalizeMinMaxDates() {
|
468
|
-
return [this.component.minDate, this.component.maxDate]
|
469
|
-
.map(date => date ? date.split('-').reverse().join('/') : date);
|
470
|
-
}
|
471
489
|
/**
|
472
490
|
* Return the raw value.
|
473
491
|
*
|
474
492
|
* @returns {Date}
|
475
493
|
*/
|
476
494
|
get validationValue() {
|
477
|
-
[this.component.minDate, this.component.maxDate] = this.dayFirst ? this.normalizeMinMaxDates()
|
478
|
-
: [this.component.minDate, this.component.maxDate];
|
479
495
|
return this.dataValue;
|
480
496
|
}
|
481
497
|
getValue() {
|
@@ -4,6 +4,7 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
4
4
|
icon: string;
|
5
5
|
group: string;
|
6
6
|
documentation: string;
|
7
|
+
showPreview: boolean;
|
7
8
|
weight: number;
|
8
9
|
schema: any;
|
9
10
|
};
|
@@ -68,10 +69,10 @@ export default class EditGridComponent extends NestedArrayComponent {
|
|
68
69
|
error: null;
|
69
70
|
rowIndex: any;
|
70
71
|
} | undefined;
|
71
|
-
addRowModal(rowIndex: any): any
|
72
|
+
addRowModal(rowIndex: any): Promise<any>;
|
72
73
|
alert: Alert | null | undefined;
|
73
|
-
showDialog(rowIndex: any): any
|
74
|
-
editRow(rowIndex: any): any
|
74
|
+
showDialog(rowIndex: any): Promise<any>;
|
75
|
+
editRow(rowIndex: any): Promise<any>;
|
75
76
|
clearErrors(rowIndex: any): void;
|
76
77
|
cancelRow(rowIndex: any): void;
|
77
78
|
saveRow(rowIndex: any, modified: any): boolean | undefined;
|
@@ -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 NestedArrayComponent_1 = __importDefault(require("../_classes/nestedarray/NestedArrayComponent"));
|
9
8
|
const Component_1 = __importDefault(require("../_classes/component/Component"));
|
10
9
|
const Alert_1 = __importDefault(require("../alert/Alert"));
|
@@ -48,6 +47,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
48
47
|
icon: 'tasks',
|
49
48
|
group: 'data',
|
50
49
|
documentation: '/userguide/form-building/data-components#edit-grid',
|
50
|
+
showPreview: false,
|
51
51
|
weight: 30,
|
52
52
|
schema: EditGridComponent.schema(),
|
53
53
|
};
|
@@ -213,7 +213,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
213
213
|
return !this.inlineEditMode;
|
214
214
|
}
|
215
215
|
get minLength() {
|
216
|
-
return lodash_1.default.get(this.component, 'validate.minLength', 0);
|
216
|
+
return this.builderMode ? 0 : lodash_1.default.get(this.component, 'validate.minLength', 0);
|
217
217
|
}
|
218
218
|
get data() {
|
219
219
|
return this._data;
|
@@ -473,7 +473,12 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
473
473
|
].forEach(({ className, event, action, }) => {
|
474
474
|
const elements = row.getElementsByClassName(className);
|
475
475
|
Array.prototype.forEach.call(elements, (element) => {
|
476
|
-
this.
|
476
|
+
if (this.options.readOnly && lodash_1.default.intersection(element.classList, ['editRow', 'removeRow']).length) {
|
477
|
+
element.style.display = 'none';
|
478
|
+
}
|
479
|
+
else {
|
480
|
+
this.addEventListener(element, event, action);
|
481
|
+
}
|
477
482
|
});
|
478
483
|
});
|
479
484
|
}
|
@@ -673,7 +678,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
673
678
|
showDialog(rowIndex) {
|
674
679
|
const editRow = this.editRows[rowIndex];
|
675
680
|
if (lodash_1.default.isEqual(editRow.backup, editRow.data)) {
|
676
|
-
return
|
681
|
+
return Promise.resolve();
|
677
682
|
}
|
678
683
|
const wrapper = this.ce('div', { ref: 'confirmationDialog' });
|
679
684
|
const dialogContent = this.component.dialogTemplate || this.defaultDialogTemplate;
|
@@ -691,7 +696,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
691
696
|
dialog.close();
|
692
697
|
};
|
693
698
|
let dialogResult;
|
694
|
-
const promise = new
|
699
|
+
const promise = new Promise((resolve, reject) => {
|
695
700
|
dialogResult = { resolve, reject };
|
696
701
|
});
|
697
702
|
this.addEventListener(wrapper.refs.dialogYesButton, 'click', (event) => {
|
@@ -709,7 +714,7 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
709
714
|
const editRow = this.editRows[rowIndex];
|
710
715
|
const isAlreadyEditing = editRow.state === EditRowState.Editing || editRow.state === EditRowState.New;
|
711
716
|
if (!editRow || isAlreadyEditing) {
|
712
|
-
return
|
717
|
+
return Promise.resolve();
|
713
718
|
}
|
714
719
|
editRow.prevState = editRow.state;
|
715
720
|
editRow.state = this.options.readOnly ? EditRowState.Viewing : EditRowState.Editing;
|
@@ -0,0 +1,190 @@
|
|
1
|
+
declare namespace _default {
|
2
|
+
const type: string;
|
3
|
+
const components: ({
|
4
|
+
label: string;
|
5
|
+
conditionalAddButton: string;
|
6
|
+
tableView: boolean;
|
7
|
+
templates: {
|
8
|
+
header: string;
|
9
|
+
row: string;
|
10
|
+
};
|
11
|
+
addAnother: string;
|
12
|
+
saveRow: string;
|
13
|
+
inlineEdit: boolean;
|
14
|
+
customDefaultValue: string;
|
15
|
+
validate: {
|
16
|
+
minLength: number;
|
17
|
+
};
|
18
|
+
rowDrafts: boolean;
|
19
|
+
key: string;
|
20
|
+
type: string;
|
21
|
+
input: boolean;
|
22
|
+
components: ({
|
23
|
+
label: string;
|
24
|
+
columns: ({
|
25
|
+
components: {
|
26
|
+
label: string;
|
27
|
+
widget: string;
|
28
|
+
tableView: boolean;
|
29
|
+
dataSrc: string;
|
30
|
+
data: {
|
31
|
+
custom: string;
|
32
|
+
};
|
33
|
+
template: string;
|
34
|
+
validate: {
|
35
|
+
required: boolean;
|
36
|
+
};
|
37
|
+
key: string;
|
38
|
+
type: string;
|
39
|
+
input: boolean;
|
40
|
+
hideOnChildrenHidden: boolean;
|
41
|
+
}[];
|
42
|
+
width: number;
|
43
|
+
offset: number;
|
44
|
+
push: number;
|
45
|
+
pull: number;
|
46
|
+
size: string;
|
47
|
+
currentWidth: number;
|
48
|
+
} | {
|
49
|
+
components: {
|
50
|
+
label: string;
|
51
|
+
widget: string;
|
52
|
+
tableView: boolean;
|
53
|
+
dataSrc: string;
|
54
|
+
data: {
|
55
|
+
custom: string;
|
56
|
+
};
|
57
|
+
template: string;
|
58
|
+
validate: {
|
59
|
+
required: boolean;
|
60
|
+
};
|
61
|
+
key: string;
|
62
|
+
logic: {
|
63
|
+
name: string;
|
64
|
+
trigger: {
|
65
|
+
type: string;
|
66
|
+
javascript: string;
|
67
|
+
};
|
68
|
+
actions: {
|
69
|
+
name: string;
|
70
|
+
type: string;
|
71
|
+
property: {
|
72
|
+
label: string;
|
73
|
+
value: string;
|
74
|
+
type: string;
|
75
|
+
};
|
76
|
+
state: boolean;
|
77
|
+
}[];
|
78
|
+
}[];
|
79
|
+
type: string;
|
80
|
+
input: boolean;
|
81
|
+
hideOnChildrenHidden: boolean;
|
82
|
+
}[];
|
83
|
+
width: number;
|
84
|
+
offset: number;
|
85
|
+
push: number;
|
86
|
+
pull: number;
|
87
|
+
size: string;
|
88
|
+
currentWidth: number;
|
89
|
+
})[];
|
90
|
+
key: string;
|
91
|
+
type: string;
|
92
|
+
tableView: boolean;
|
93
|
+
input: boolean;
|
94
|
+
hideOnChildrenHidden: boolean;
|
95
|
+
} | {
|
96
|
+
label: string;
|
97
|
+
columns: ({
|
98
|
+
components: {
|
99
|
+
label: string;
|
100
|
+
widget: string;
|
101
|
+
tableView: boolean;
|
102
|
+
data: {
|
103
|
+
values: {
|
104
|
+
label: string;
|
105
|
+
value: string;
|
106
|
+
}[];
|
107
|
+
};
|
108
|
+
refreshOn: string;
|
109
|
+
validate: {
|
110
|
+
required: boolean;
|
111
|
+
};
|
112
|
+
key: string;
|
113
|
+
logic: {
|
114
|
+
name: string;
|
115
|
+
trigger: {
|
116
|
+
type: string;
|
117
|
+
javascript: string;
|
118
|
+
};
|
119
|
+
actions: {
|
120
|
+
name: string;
|
121
|
+
type: string;
|
122
|
+
property: {
|
123
|
+
label: string;
|
124
|
+
value: string;
|
125
|
+
type: string;
|
126
|
+
};
|
127
|
+
state: boolean;
|
128
|
+
}[];
|
129
|
+
}[];
|
130
|
+
type: string;
|
131
|
+
input: boolean;
|
132
|
+
hideOnChildrenHidden: boolean;
|
133
|
+
}[];
|
134
|
+
width: number;
|
135
|
+
offset: number;
|
136
|
+
push: number;
|
137
|
+
pull: number;
|
138
|
+
size: string;
|
139
|
+
currentWidth: number;
|
140
|
+
} | {
|
141
|
+
components: {
|
142
|
+
label: string;
|
143
|
+
mask: boolean;
|
144
|
+
spellcheck: boolean;
|
145
|
+
tableView: boolean;
|
146
|
+
currency: string;
|
147
|
+
inputFormat: string;
|
148
|
+
validate: {
|
149
|
+
required: boolean;
|
150
|
+
};
|
151
|
+
key: string;
|
152
|
+
type: string;
|
153
|
+
input: boolean;
|
154
|
+
delimiter: boolean;
|
155
|
+
hideOnChildrenHidden: boolean;
|
156
|
+
}[];
|
157
|
+
width: number;
|
158
|
+
offset: number;
|
159
|
+
push: number;
|
160
|
+
pull: number;
|
161
|
+
size: string;
|
162
|
+
currentWidth: number;
|
163
|
+
})[];
|
164
|
+
key: string;
|
165
|
+
type: string;
|
166
|
+
input: boolean;
|
167
|
+
tableView: boolean;
|
168
|
+
hideOnChildrenHidden: boolean;
|
169
|
+
})[];
|
170
|
+
disableOnInvalid?: undefined;
|
171
|
+
} | {
|
172
|
+
type: string;
|
173
|
+
label: string;
|
174
|
+
key: string;
|
175
|
+
disableOnInvalid: boolean;
|
176
|
+
input: boolean;
|
177
|
+
tableView: boolean;
|
178
|
+
conditionalAddButton?: undefined;
|
179
|
+
templates?: undefined;
|
180
|
+
addAnother?: undefined;
|
181
|
+
saveRow?: undefined;
|
182
|
+
inlineEdit?: undefined;
|
183
|
+
customDefaultValue?: undefined;
|
184
|
+
validate?: undefined;
|
185
|
+
rowDrafts?: undefined;
|
186
|
+
components?: undefined;
|
187
|
+
})[];
|
188
|
+
const display: string;
|
189
|
+
}
|
190
|
+
export default _default;
|