@formio/js 5.1.0-dev.6040.debc859 → 5.1.0-dev.6042.6e62a7a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +140 -6
- package/dist/formio.form.js +591 -580
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +613 -602
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.js +47 -14
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +48 -15
- package/dist/formio.utils.min.js +1 -1
- package/lib/cjs/Element.d.ts +2 -1
- package/lib/cjs/Element.js +6 -4
- package/lib/cjs/Webform.d.ts +2 -2
- package/lib/cjs/Webform.js +9 -9
- package/lib/cjs/WebformBuilder.js +5 -1
- package/lib/cjs/Wizard.d.ts +1 -0
- package/lib/cjs/Wizard.js +23 -3
- package/lib/cjs/components/_classes/component/Component.d.ts +50 -15
- package/lib/cjs/components/_classes/component/Component.js +153 -69
- package/lib/cjs/components/_classes/component/editForm/Component.edit.data.js +19 -0
- package/lib/cjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/cjs/components/_classes/list/ListComponent.js +2 -2
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +0 -1
- package/lib/cjs/components/_classes/nested/NestedComponent.form.js +13 -0
- package/lib/cjs/components/_classes/nested/NestedComponent.js +10 -18
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -2
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.js +0 -11
- package/lib/cjs/components/address/Address.d.ts +9 -0
- package/lib/cjs/components/address/Address.js +31 -8
- package/lib/cjs/components/address/editForm/Address.edit.display.d.ts +4 -0
- package/lib/cjs/components/address/editForm/Address.edit.display.js +1 -0
- package/lib/cjs/components/address/editForm/Address.edit.provider.js +8 -8
- package/lib/cjs/components/content/editForm/Content.edit.display.js +8 -0
- package/lib/cjs/components/currency/editForm/Currency.edit.display.js +12 -0
- package/lib/cjs/components/datagrid/DataGrid.js +0 -3
- package/lib/cjs/components/datamap/DataMap.js +2 -6
- package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.d.ts +66 -15
- package/lib/cjs/components/datetime/editForm/DateTime.edit.validation.js +68 -47
- package/lib/cjs/components/day/editForm/Day.edit.display.js +8 -0
- package/lib/cjs/components/editgrid/EditGrid.js +3 -13
- package/lib/cjs/components/email/editForm/Email.edit.display.js +12 -0
- package/lib/cjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
- package/lib/cjs/components/file/File.js +7 -2
- package/lib/cjs/components/file/editForm/File.edit.file.d.ts +13 -0
- package/lib/cjs/components/file/editForm/File.edit.file.js +1 -0
- package/lib/cjs/components/form/Form.d.ts +0 -1
- package/lib/cjs/components/form/Form.js +18 -22
- package/lib/cjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
- package/lib/cjs/components/html/HTML.js +1 -2
- package/lib/cjs/components/html/editForm/HTML.edit.display.js +8 -0
- package/lib/cjs/components/number/editForm/Number.edit.display.js +12 -0
- package/lib/cjs/components/password/editForm/Password.edit.display.js +13 -1
- package/lib/cjs/components/phonenumber/PhoneNumber.form.js +9 -1
- package/lib/cjs/components/radio/Radio.js +1 -1
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/components/select/editForm/Select.edit.data.d.ts +68 -110
- package/lib/cjs/components/select/editForm/Select.edit.data.js +2 -37
- package/lib/cjs/components/selectboxes/SelectBoxes.js +3 -0
- package/lib/cjs/components/survey/Survey.js +1 -1
- package/lib/cjs/components/tabs/Tabs.js +1 -0
- package/lib/cjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
- package/lib/cjs/components/textarea/TextArea.js +9 -1
- package/lib/cjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
- package/lib/cjs/components/textfield/TextField.js +2 -2
- package/lib/cjs/components/unknown/Unknown.form.d.ts +2 -1
- package/lib/cjs/components/unknown/Unknown.form.js +13 -9
- package/lib/cjs/components/url/editForm/Url.edit.display.js +12 -0
- package/lib/cjs/components/well/editForm/Well.edit.display.js +8 -0
- package/lib/cjs/formio.form.js +2 -2
- package/lib/cjs/providers/storage/uploadAdapter.js +5 -3
- package/lib/cjs/translations/en.d.ts +1 -234
- package/lib/cjs/translations/en.js +4 -2
- package/lib/cjs/utils/formUtils.d.ts +2 -2
- package/lib/cjs/utils/utils.d.ts +9 -8
- package/lib/cjs/utils/utils.js +18 -23
- package/lib/cjs/widgets/CalendarWidget.js +6 -1
- package/lib/mjs/Element.d.ts +2 -1
- package/lib/mjs/Element.js +6 -4
- package/lib/mjs/Webform.d.ts +2 -2
- package/lib/mjs/Webform.js +9 -9
- package/lib/mjs/WebformBuilder.js +5 -1
- package/lib/mjs/Wizard.d.ts +1 -0
- package/lib/mjs/Wizard.js +22 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +50 -15
- package/lib/mjs/components/_classes/component/Component.js +154 -70
- package/lib/mjs/components/_classes/component/editForm/Component.edit.data.js +19 -0
- package/lib/mjs/components/_classes/component/editForm/utils.js +1 -1
- package/lib/mjs/components/_classes/list/ListComponent.js +2 -2
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +0 -1
- package/lib/mjs/components/_classes/nested/NestedComponent.form.js +13 -0
- package/lib/mjs/components/_classes/nested/NestedComponent.js +10 -18
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +0 -2
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.js +0 -11
- package/lib/mjs/components/address/Address.d.ts +9 -0
- package/lib/mjs/components/address/Address.js +31 -8
- package/lib/mjs/components/address/editForm/Address.edit.display.d.ts +4 -0
- package/lib/mjs/components/address/editForm/Address.edit.display.js +1 -0
- package/lib/mjs/components/address/editForm/Address.edit.provider.js +8 -8
- package/lib/mjs/components/content/editForm/Content.edit.display.js +8 -0
- package/lib/mjs/components/currency/editForm/Currency.edit.display.js +12 -0
- package/lib/mjs/components/datagrid/DataGrid.js +0 -3
- package/lib/mjs/components/datamap/DataMap.js +2 -6
- package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.d.ts +66 -15
- package/lib/mjs/components/datetime/editForm/DateTime.edit.validation.js +68 -47
- package/lib/mjs/components/day/editForm/Day.edit.display.js +8 -0
- package/lib/mjs/components/editgrid/EditGrid.js +3 -12
- package/lib/mjs/components/email/editForm/Email.edit.display.js +12 -0
- package/lib/mjs/components/fieldset/editForm/Fieldset.edit.display.js +8 -0
- package/lib/mjs/components/file/File.js +7 -2
- package/lib/mjs/components/file/editForm/File.edit.file.d.ts +13 -0
- package/lib/mjs/components/file/editForm/File.edit.file.js +1 -0
- package/lib/mjs/components/form/Form.d.ts +0 -1
- package/lib/mjs/components/form/Form.js +18 -22
- package/lib/mjs/components/hidden/editForm/Hidden.edit.display.js +8 -0
- package/lib/mjs/components/html/HTML.js +1 -2
- package/lib/mjs/components/html/editForm/HTML.edit.display.js +8 -0
- package/lib/mjs/components/number/editForm/Number.edit.display.js +12 -0
- package/lib/mjs/components/password/editForm/Password.edit.display.js +13 -1
- package/lib/mjs/components/phonenumber/PhoneNumber.form.js +9 -1
- package/lib/mjs/components/radio/Radio.js +1 -1
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/components/select/editForm/Select.edit.data.d.ts +68 -110
- package/lib/mjs/components/select/editForm/Select.edit.data.js +2 -37
- package/lib/mjs/components/selectboxes/SelectBoxes.js +3 -0
- package/lib/mjs/components/survey/Survey.js +1 -1
- package/lib/mjs/components/tabs/Tabs.js +1 -0
- package/lib/mjs/components/tabs/editForm/Tabs.edit.display.js +8 -0
- package/lib/mjs/components/textarea/TextArea.js +9 -1
- package/lib/mjs/components/textarea/editForm/TextArea.edit.display.js +12 -0
- package/lib/mjs/components/textfield/TextField.js +2 -2
- package/lib/mjs/components/unknown/Unknown.form.d.ts +2 -1
- package/lib/mjs/components/unknown/Unknown.form.js +13 -9
- package/lib/mjs/components/url/editForm/Url.edit.display.js +12 -0
- package/lib/mjs/components/well/editForm/Well.edit.display.js +8 -0
- package/lib/mjs/formio.form.js +1 -1
- package/lib/mjs/providers/storage/uploadAdapter.js +5 -3
- package/lib/mjs/translations/en.d.ts +1 -234
- package/lib/mjs/translations/en.js +5 -47
- package/lib/mjs/utils/formUtils.d.ts +2 -2
- package/lib/mjs/utils/utils.d.ts +9 -8
- package/lib/mjs/utils/utils.js +16 -21
- package/lib/mjs/widgets/CalendarWidget.js +7 -2
- package/package.json +2 -2
- package/lib/cjs/i18n.d.ts +0 -13
- package/lib/cjs/i18n.js +0 -19
- package/lib/cjs/utils/i18n.d.ts +0 -19
- package/lib/cjs/utils/i18n.js +0 -120
- package/lib/mjs/i18n.d.ts +0 -13
- package/lib/mjs/i18n.js +0 -14
- package/lib/mjs/utils/i18n.d.ts +0 -19
- package/lib/mjs/utils/i18n.js +0 -112
@@ -26,7 +26,6 @@ class AddressComponent extends Container_1.default {
|
|
26
26
|
key: 'address',
|
27
27
|
switchToManualModeLabel: 'Can\'t find address? Switch to manual mode.',
|
28
28
|
provider: '',
|
29
|
-
providerOptions: {},
|
30
29
|
manualModeViewString: '',
|
31
30
|
hideLabel: false,
|
32
31
|
disableClearIcon: false,
|
@@ -116,20 +115,33 @@ class AddressComponent extends Container_1.default {
|
|
116
115
|
NestedComponent_1.default.prototype.addComponents.call(this, this.manualMode ? this.address : {});
|
117
116
|
}
|
118
117
|
Field_1.default.prototype.init.call(this);
|
118
|
+
// Added for backwards compatibility
|
119
|
+
if (this.component.providerOptions) {
|
120
|
+
const { params, url, queryProperty, responseProperty, displayValueProperty } = this.component.providerOptions;
|
121
|
+
const key = params === null || params === void 0 ? void 0 : params.key;
|
122
|
+
const autocompleteOptions = params === null || params === void 0 ? void 0 : params.autocompleteOptions;
|
123
|
+
delete this.component.providerOptions;
|
124
|
+
this.component.url = url;
|
125
|
+
this.component.queryProperty = queryProperty;
|
126
|
+
this.component.responseProperty = responseProperty;
|
127
|
+
this.component.displayValueProperty = displayValueProperty;
|
128
|
+
this.component.apiKey = key;
|
129
|
+
this.component.autocompleteOptions = autocompleteOptions;
|
130
|
+
}
|
131
|
+
let provider = this.component.provider;
|
132
|
+
const providerOptions = this.providerOptions;
|
133
|
+
const map = this.component.map;
|
119
134
|
if (!this.builderMode) {
|
120
|
-
if (
|
121
|
-
const { provider, providerOptions, } = this.component;
|
135
|
+
if (provider) {
|
122
136
|
if (lodash_1.default.get(providerOptions, 'params.subscriptionKey')) {
|
123
137
|
lodash_1.default.set(providerOptions, "params['subscription-key']", lodash_1.default.get(providerOptions, 'params.subscriptionKey'));
|
124
138
|
lodash_1.default.unset(providerOptions, 'params.subscriptionKey');
|
125
139
|
}
|
126
140
|
this.provider = this.initializeProvider(provider, providerOptions);
|
127
141
|
}
|
128
|
-
else if (
|
142
|
+
else if (map) {
|
129
143
|
// Fallback to legacy version where Google Maps was the only provider.
|
130
|
-
this.component.provider = GoogleAddressProvider_1.GoogleAddressProvider.name;
|
131
|
-
this.component.providerOptions = this.component.providerOptions || {};
|
132
|
-
const { map, provider, providerOptions, } = this.component;
|
144
|
+
provider = this.component.provider = GoogleAddressProvider_1.GoogleAddressProvider.name;
|
133
145
|
const { key, region, } = map;
|
134
146
|
if (key) {
|
135
147
|
lodash_1.default.set(providerOptions, 'params.key', key);
|
@@ -262,6 +274,16 @@ class AddressComponent extends Container_1.default {
|
|
262
274
|
? (this.refs[AddressComponent.modeSwitcherRef] || null)
|
263
275
|
: null;
|
264
276
|
}
|
277
|
+
get providerOptions() {
|
278
|
+
return {
|
279
|
+
params: Object.assign({ subscriptionKey: this.component.subscriptionKey, key: this.component.apiKey }, this.component.params),
|
280
|
+
url: this.component.url,
|
281
|
+
queryProperty: this.component.queryProperty,
|
282
|
+
responseProperty: this.component.responseProperty,
|
283
|
+
displayValueProperty: this.component.displayValueProperty,
|
284
|
+
autocompleteOptions: this.component.autocompleteOptions
|
285
|
+
};
|
286
|
+
}
|
265
287
|
get removeValueIcon() {
|
266
288
|
return this.refs
|
267
289
|
? (this.refs[AddressComponent.removeValueIconRef] || null)
|
@@ -375,7 +397,8 @@ class AddressComponent extends Container_1.default {
|
|
375
397
|
const result = ((this.builderMode || this.manualMode) ? super.attach : Field_1.default.prototype.attach).call(this, element);
|
376
398
|
if (!this.builderMode) {
|
377
399
|
if (!this.provider && this.component.provider) {
|
378
|
-
const
|
400
|
+
const provider = this.component.provider;
|
401
|
+
const providerOptions = this.providerOptions;
|
379
402
|
this.provider = this.initializeProvider(provider, providerOptions);
|
380
403
|
}
|
381
404
|
}
|
@@ -8,6 +8,7 @@ declare const _default: ({
|
|
8
8
|
customConditional: ({ data }: {
|
9
9
|
data: any;
|
10
10
|
}) => boolean;
|
11
|
+
defaultValue?: undefined;
|
11
12
|
placeholder?: undefined;
|
12
13
|
validate?: undefined;
|
13
14
|
} | {
|
@@ -15,6 +16,7 @@ declare const _default: ({
|
|
15
16
|
type: string;
|
16
17
|
input: boolean;
|
17
18
|
key: string;
|
19
|
+
defaultValue: string;
|
18
20
|
label: string;
|
19
21
|
placeholder: string;
|
20
22
|
tooltip: string;
|
@@ -32,6 +34,7 @@ declare const _default: ({
|
|
32
34
|
label: string;
|
33
35
|
tooltip: string;
|
34
36
|
customConditional?: undefined;
|
37
|
+
defaultValue?: undefined;
|
35
38
|
placeholder?: undefined;
|
36
39
|
validate?: undefined;
|
37
40
|
} | {
|
@@ -45,6 +48,7 @@ declare const _default: ({
|
|
45
48
|
customConditional: ({ data }: {
|
46
49
|
data: any;
|
47
50
|
}) => any;
|
51
|
+
defaultValue?: undefined;
|
48
52
|
validate?: undefined;
|
49
53
|
})[];
|
50
54
|
export default _default;
|
@@ -15,6 +15,7 @@ exports.default = [
|
|
15
15
|
type: 'textfield',
|
16
16
|
input: true,
|
17
17
|
key: 'switchToManualModeLabel',
|
18
|
+
defaultValue: 'Can\'t find address? Switch to manual mode.',
|
18
19
|
label: 'Switch To Manual Mode Label',
|
19
20
|
placeholder: 'Switch To Manual Mode Label',
|
20
21
|
tooltip: 'The label for the checkbox used to switch to manual mode.',
|
@@ -31,7 +31,7 @@ exports.default = [
|
|
31
31
|
{
|
32
32
|
type: 'textfield',
|
33
33
|
input: true,
|
34
|
-
key: "
|
34
|
+
key: "subscriptionKey",
|
35
35
|
label: 'Subscription Key',
|
36
36
|
placeholder: 'Enter Subscription Key',
|
37
37
|
weight: 10,
|
@@ -46,7 +46,7 @@ exports.default = [
|
|
46
46
|
{
|
47
47
|
type: 'textfield',
|
48
48
|
input: true,
|
49
|
-
key: '
|
49
|
+
key: 'url',
|
50
50
|
label: 'Url',
|
51
51
|
placeholder: 'Enter Url',
|
52
52
|
weight: 10,
|
@@ -61,7 +61,7 @@ exports.default = [
|
|
61
61
|
{
|
62
62
|
type: 'textfield',
|
63
63
|
input: true,
|
64
|
-
key: '
|
64
|
+
key: 'queryProperty',
|
65
65
|
label: 'Query Property',
|
66
66
|
defaultValue: 'query',
|
67
67
|
placeholder: 'Enter Query Property',
|
@@ -74,7 +74,7 @@ exports.default = [
|
|
74
74
|
{
|
75
75
|
type: 'textfield',
|
76
76
|
input: true,
|
77
|
-
key: '
|
77
|
+
key: 'responseProperty',
|
78
78
|
label: 'Response Property',
|
79
79
|
placeholder: 'Enter Response Property',
|
80
80
|
weight: 30,
|
@@ -86,7 +86,7 @@ exports.default = [
|
|
86
86
|
{
|
87
87
|
type: 'textfield',
|
88
88
|
input: true,
|
89
|
-
key: '
|
89
|
+
key: 'displayValueProperty',
|
90
90
|
label: 'Display Value Property',
|
91
91
|
placeholder: 'Display Value Property',
|
92
92
|
weight: 40,
|
@@ -98,7 +98,7 @@ exports.default = [
|
|
98
98
|
{
|
99
99
|
type: 'textarea',
|
100
100
|
input: true,
|
101
|
-
key: '
|
101
|
+
key: 'params',
|
102
102
|
label: 'Params',
|
103
103
|
placeholder: '{ ... }',
|
104
104
|
weight: 50,
|
@@ -113,7 +113,7 @@ exports.default = [
|
|
113
113
|
{
|
114
114
|
type: 'textfield',
|
115
115
|
input: true,
|
116
|
-
key: '
|
116
|
+
key: 'apiKey',
|
117
117
|
label: 'API Key',
|
118
118
|
placeholder: 'Enter API Key',
|
119
119
|
weight: 10,
|
@@ -128,7 +128,7 @@ exports.default = [
|
|
128
128
|
{
|
129
129
|
type: 'textarea',
|
130
130
|
input: true,
|
131
|
-
key: '
|
131
|
+
key: 'autocompleteOptions',
|
132
132
|
label: 'Provider options',
|
133
133
|
placeholder: 'Enter provider options as JSON object',
|
134
134
|
defaultValue: {},
|
@@ -9,6 +9,18 @@ exports.default = [
|
|
9
9
|
key: 'allowMultipleMasks',
|
10
10
|
ignore: true
|
11
11
|
},
|
12
|
+
{
|
13
|
+
key: 'inputMasks',
|
14
|
+
ignore: true
|
15
|
+
},
|
16
|
+
{
|
17
|
+
key: 'widget.type',
|
18
|
+
ignore: true
|
19
|
+
},
|
20
|
+
{
|
21
|
+
key: 'widget',
|
22
|
+
ignore: true
|
23
|
+
},
|
12
24
|
{
|
13
25
|
key: 'showWordCount',
|
14
26
|
ignore: true
|
@@ -613,9 +613,6 @@ class DataGridComponent extends NestedArrayComponent_1.default {
|
|
613
613
|
this.updateOnChange(flags, changed);
|
614
614
|
return changed;
|
615
615
|
}
|
616
|
-
restoreComponentsContext() {
|
617
|
-
this.rows.forEach((row, index) => lodash_1.default.forIn(row, (component) => component.data = this.dataValue[index]));
|
618
|
-
}
|
619
616
|
toggleGroup(element, index) {
|
620
617
|
element.classList.toggle('collapsed');
|
621
618
|
lodash_1.default.each(this.refs.chunks[index], row => {
|
@@ -73,14 +73,10 @@ class DataMapComponent extends DataGrid_1.default {
|
|
73
73
|
return {};
|
74
74
|
}
|
75
75
|
get dataValue() {
|
76
|
-
if (!this.key
|
77
|
-
(this.conditionallyHidden && this.component.clearOnHide)) {
|
76
|
+
if (!this.key) {
|
78
77
|
return this.emptyValue;
|
79
78
|
}
|
80
|
-
|
81
|
-
this.dataValue = this.emptyValue;
|
82
|
-
}
|
83
|
-
return lodash_1.default.get(this.data, this.key);
|
79
|
+
return lodash_1.default.get(this.data, this.key, this.emptyValue);
|
84
80
|
}
|
85
81
|
set dataValue(value) {
|
86
82
|
super.dataValue = value;
|
@@ -6,36 +6,87 @@ declare const _default: ({
|
|
6
6
|
persistent: boolean;
|
7
7
|
weight: number;
|
8
8
|
tooltip: string;
|
9
|
+
applyMaskOn?: undefined;
|
10
|
+
logic?: undefined;
|
9
11
|
skipMerge?: undefined;
|
10
|
-
|
12
|
+
tableView?: undefined;
|
13
|
+
validateWhenHidden?: undefined;
|
11
14
|
enableTime?: undefined;
|
12
15
|
} | {
|
16
|
+
label: string;
|
17
|
+
tooltip: string;
|
18
|
+
applyMaskOn: string;
|
19
|
+
key: string;
|
20
|
+
logic: ({
|
21
|
+
name: string;
|
22
|
+
trigger: {
|
23
|
+
type: string;
|
24
|
+
javascript: string;
|
25
|
+
event?: undefined;
|
26
|
+
};
|
27
|
+
actions: {
|
28
|
+
name: string;
|
29
|
+
type: string;
|
30
|
+
schemaDefinition: string;
|
31
|
+
}[];
|
32
|
+
} | {
|
33
|
+
name: string;
|
34
|
+
trigger: {
|
35
|
+
type: string;
|
36
|
+
event: string;
|
37
|
+
javascript?: undefined;
|
38
|
+
};
|
39
|
+
actions: {
|
40
|
+
name: string;
|
41
|
+
type: string;
|
42
|
+
customAction: string;
|
43
|
+
}[];
|
44
|
+
})[];
|
13
45
|
type: string;
|
14
46
|
input: boolean;
|
15
|
-
key: string;
|
16
|
-
label: string;
|
17
47
|
skipMerge: boolean;
|
18
48
|
weight: number;
|
19
|
-
tooltip: string;
|
20
|
-
customConditional({ data, component }: {
|
21
|
-
data: any;
|
22
|
-
component: any;
|
23
|
-
}): boolean;
|
24
49
|
persistent?: undefined;
|
50
|
+
tableView?: undefined;
|
51
|
+
validateWhenHidden?: undefined;
|
25
52
|
enableTime?: undefined;
|
26
53
|
} | {
|
54
|
+
label: string;
|
55
|
+
tooltip: string;
|
56
|
+
applyMaskOn: string;
|
57
|
+
tableView: boolean;
|
58
|
+
validateWhenHidden: boolean;
|
59
|
+
key: string;
|
60
|
+
logic: ({
|
61
|
+
name: string;
|
62
|
+
trigger: {
|
63
|
+
type: string;
|
64
|
+
javascript: string;
|
65
|
+
event?: undefined;
|
66
|
+
};
|
67
|
+
actions: {
|
68
|
+
name: string;
|
69
|
+
type: string;
|
70
|
+
schemaDefinition: string;
|
71
|
+
}[];
|
72
|
+
} | {
|
73
|
+
name: string;
|
74
|
+
trigger: {
|
75
|
+
type: string;
|
76
|
+
event: string;
|
77
|
+
javascript?: undefined;
|
78
|
+
};
|
79
|
+
actions: {
|
80
|
+
name: string;
|
81
|
+
type: string;
|
82
|
+
customAction: string;
|
83
|
+
}[];
|
84
|
+
})[];
|
27
85
|
type: string;
|
28
86
|
input: boolean;
|
29
87
|
enableTime: boolean;
|
30
|
-
key: string;
|
31
88
|
skipMerge: boolean;
|
32
|
-
label: string;
|
33
89
|
weight: number;
|
34
|
-
tooltip: string;
|
35
|
-
customConditional({ data, component }: {
|
36
|
-
data: any;
|
37
|
-
component: any;
|
38
|
-
}): any;
|
39
90
|
persistent?: undefined;
|
40
91
|
})[];
|
41
92
|
export default _default;
|
@@ -11,35 +11,44 @@ exports.default = [
|
|
11
11
|
tooltip: 'Enables to use input for moment functions instead of calendar.'
|
12
12
|
},
|
13
13
|
{
|
14
|
-
|
15
|
-
|
14
|
+
label: 'Minimum Date',
|
15
|
+
tooltip: "The minimum date that can be picked. You can also use Moment.js functions. For example: moment().subtract(10, 'days')",
|
16
|
+
applyMaskOn: 'change',
|
16
17
|
key: 'datePicker.minDate',
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
18
|
+
logic: [
|
19
|
+
{
|
20
|
+
name: 'check input mode',
|
21
|
+
trigger: {
|
22
|
+
type: 'javascript',
|
23
|
+
javascript: "if (component.datePicker && component.datePicker.minDate && component.datePicker.minDate.indexOf('moment') !== -1) {\r\n result = false;\r\n}\r\nelse {\r\n result = !data.enableMinDateInput;\r\n}",
|
24
|
+
},
|
25
|
+
actions: [
|
26
|
+
{
|
27
|
+
name: 'change component',
|
28
|
+
type: 'mergeComponentSchema',
|
29
|
+
schemaDefinition: "schema = {\n type: 'datetime',\n label: 'Use calendar to set minDate',\n enableDate: true,\n enableTime: true,\n tooltip: 'Enables to use calendar to set date.',\n widget: {\n type: 'calendar',\n displayInTimezone: 'viewer',\n locale: 'en',\n useLocaleSettings: false,\n allowInput: true,\n mode: 'single',\n enableTime: true,\n noCalendar: false,\n format: 'yyyy-MM-dd hh:mm a',\n hourIncrement: 1,\n minuteIncrement: 1,\n time_24hr: false,\n disableWeekends: false,\n disableWeekdays: false,\n maxDate: null,\n },\n};",
|
30
|
+
},
|
31
|
+
],
|
32
|
+
},
|
33
|
+
{
|
34
|
+
name: 'clear value',
|
35
|
+
trigger: {
|
36
|
+
type: 'event',
|
37
|
+
event: 'componentChange',
|
38
|
+
},
|
39
|
+
actions: [
|
40
|
+
{
|
41
|
+
name: 'reset value',
|
42
|
+
type: 'customAction',
|
43
|
+
customAction: "var isDateInput = instance.component?.type === 'datetime';\nvar enableInput = data.enableMinDateInput;\nvar allowReset = result[0].component && result[0].component.key === 'enableMinDateInput' && !result[0].flags?.fromSubmission;\nif(((enableInput && isDateInput) || (!enableInput && !isDateInput)) && allowReset) {\n instance.resetValue()\n}\n",
|
44
|
+
},
|
45
|
+
],
|
46
|
+
},
|
47
|
+
],
|
29
48
|
type: 'textfield',
|
30
49
|
input: true,
|
31
|
-
enableTime: false,
|
32
|
-
key: 'datePicker.minDate',
|
33
50
|
skipMerge: true,
|
34
|
-
label: 'Minimum Date',
|
35
51
|
weight: 10,
|
36
|
-
tooltip: 'The minimum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().subtract(10, \'days\')',
|
37
|
-
customConditional({ data, component }) {
|
38
|
-
if (component.datePicker && component.datePicker.minDate && component.datePicker.minDate.indexOf('moment') !== -1) {
|
39
|
-
return true;
|
40
|
-
}
|
41
|
-
return data.enableMinDateInput;
|
42
|
-
},
|
43
52
|
},
|
44
53
|
{
|
45
54
|
type: 'checkbox',
|
@@ -51,34 +60,46 @@ exports.default = [
|
|
51
60
|
tooltip: 'Enables to use input for moment functions instead of calendar.'
|
52
61
|
},
|
53
62
|
{
|
54
|
-
|
55
|
-
|
63
|
+
label: 'Maximum Date',
|
64
|
+
tooltip: "The maximum date that can be picked. You can also use Moment.js functions. For example: moment().add(10, 'days')",
|
65
|
+
applyMaskOn: 'change',
|
66
|
+
tableView: true,
|
67
|
+
validateWhenHidden: false,
|
56
68
|
key: 'datePicker.maxDate',
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
+
logic: [
|
70
|
+
{
|
71
|
+
name: 'check input mode',
|
72
|
+
trigger: {
|
73
|
+
type: 'javascript',
|
74
|
+
javascript: "if (component.datePicker && component.datePicker.maxDate && component.datePicker.maxDate.indexOf('moment') !== -1) {\r\n result = false;\r\n}\r\nelse {\r\n result = !data.enableMaxDateInput;\r\n}",
|
75
|
+
},
|
76
|
+
actions: [
|
77
|
+
{
|
78
|
+
name: 'change component',
|
79
|
+
type: 'mergeComponentSchema',
|
80
|
+
schemaDefinition: "schema = {\n type: 'datetime',\n label: 'Use calendar to set maxDate',\n enableDate: true,\n enableTime: true,\n tooltip: 'Enables to use calendar to set date.',\n widget: {\n type: 'calendar',\n displayInTimezone: 'viewer',\n locale: 'en',\n useLocaleSettings: false,\n allowInput: true,\n mode: 'single',\n enableTime: true,\n noCalendar: false,\n format: 'yyyy-MM-dd hh:mm a',\n hourIncrement: 1,\n minuteIncrement: 1,\n time_24hr: false,\n disableWeekends: false,\n disableWeekdays: false,\n maxDate: null,\n },\n};",
|
81
|
+
},
|
82
|
+
],
|
83
|
+
},
|
84
|
+
{
|
85
|
+
name: 'clear value',
|
86
|
+
trigger: {
|
87
|
+
type: 'event',
|
88
|
+
event: 'componentChange',
|
89
|
+
},
|
90
|
+
actions: [
|
91
|
+
{
|
92
|
+
name: 'reset value',
|
93
|
+
type: 'customAction',
|
94
|
+
customAction: "var isDateInput = instance.component?.type === 'datetime';\nvar enableInput = data.enableMaxDateInput;\nvar allowReset = result[0].component && result[0].component.key === 'enableMaxDateInput' && !result[0].flags?.fromSubmission;\nif(((enableInput && isDateInput) || (!enableInput && !isDateInput)) && allowReset) {\n instance.resetValue()\n}\n",
|
95
|
+
},
|
96
|
+
],
|
97
|
+
},
|
98
|
+
],
|
69
99
|
type: 'textfield',
|
70
100
|
input: true,
|
71
101
|
enableTime: false,
|
72
|
-
key: 'datePicker.maxDate',
|
73
102
|
skipMerge: true,
|
74
|
-
label: 'Maximum Date',
|
75
|
-
tooltip: 'The maximum date that can be picked. You can also use Moment.js functions. For example: \n \n moment().add(10, \'days\')',
|
76
103
|
weight: 20,
|
77
|
-
customConditional({ data, component }) {
|
78
|
-
if (component.datePicker && component.datePicker.maxDate && component.datePicker.maxDate.indexOf('moment') !== -1) {
|
79
|
-
return true;
|
80
|
-
}
|
81
|
-
return data.enableMaxDateInput;
|
82
|
-
},
|
83
104
|
}
|
84
105
|
];
|
@@ -553,14 +553,6 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
553
553
|
}
|
554
554
|
});
|
555
555
|
}
|
556
|
-
restoreComponentsContext() {
|
557
|
-
this.getComponents().forEach((component) => {
|
558
|
-
var _a;
|
559
|
-
const rowData = this.dataValue[component.rowIndex];
|
560
|
-
const editRowData = (_a = this.editRows[component.rowIndex]) === null || _a === void 0 ? void 0 : _a.data;
|
561
|
-
component.data = rowData || editRowData;
|
562
|
-
});
|
563
|
-
}
|
564
556
|
flattenComponents(rowIndex) {
|
565
557
|
const result = {};
|
566
558
|
this.everyComponent((component) => {
|
@@ -1115,7 +1107,9 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
1115
1107
|
errors.push(...this._errors);
|
1116
1108
|
return false;
|
1117
1109
|
}
|
1118
|
-
|
1110
|
+
// TODO: this is the only place invalidMessage gets called, and it's not clear why it's needed - we already validate the editGrid
|
1111
|
+
// component above with super.checkComponentValidity
|
1112
|
+
const message = this.invalid || this.invalidMessage(data, dirty, false, row, options);
|
1119
1113
|
if (allRowErrors.length && ((_b = this.root) === null || _b === void 0 ? void 0 : _b.submitted) && !message) {
|
1120
1114
|
this._errors = this.setCustomValidity(message, dirty);
|
1121
1115
|
errors.push(...this._errors);
|
@@ -1159,9 +1153,6 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
1159
1153
|
}
|
1160
1154
|
}
|
1161
1155
|
const changed = this.hasChanged(value, this.dataValue);
|
1162
|
-
if (this.parent) {
|
1163
|
-
this.parent.checkComponentConditions();
|
1164
|
-
}
|
1165
1156
|
this.dataValue = value;
|
1166
1157
|
// Refresh editRow data when data changes.
|
1167
1158
|
this.dataValue.forEach((row, rowIndex) => {
|
@@ -1192,7 +1183,6 @@ class EditGridComponent extends NestedArrayComponent_1.default {
|
|
1192
1183
|
this.editRows = this.editRows.slice(0, dataLength);
|
1193
1184
|
this.openWhenEmpty();
|
1194
1185
|
this.updateOnChange(flags, changed);
|
1195
|
-
this.checkData();
|
1196
1186
|
this.changeState(changed, flags);
|
1197
1187
|
return changed;
|
1198
1188
|
}
|
@@ -9,6 +9,18 @@ exports.default = [
|
|
9
9
|
key: 'allowMultipleMasks',
|
10
10
|
ignore: true,
|
11
11
|
},
|
12
|
+
{
|
13
|
+
key: 'inputMasks',
|
14
|
+
ignore: true
|
15
|
+
},
|
16
|
+
{
|
17
|
+
key: 'widget.type',
|
18
|
+
ignore: true
|
19
|
+
},
|
20
|
+
{
|
21
|
+
key: 'widget',
|
22
|
+
ignore: true
|
23
|
+
},
|
12
24
|
{
|
13
25
|
key: 'showWordCount',
|
14
26
|
ignore: true
|
@@ -905,14 +905,17 @@ class FileComponent extends Field_1.default {
|
|
905
905
|
}
|
906
906
|
uploadFile(fileToSync) {
|
907
907
|
return __awaiter(this, void 0, void 0, function* () {
|
908
|
-
|
908
|
+
const filePromise = this.fileService.uploadFile(fileToSync.storage, fileToSync.file, fileToSync.name, fileToSync.dir,
|
909
909
|
// Progress callback
|
910
|
-
this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => {
|
910
|
+
this.updateProgress.bind(this, fileToSync), fileToSync.url, fileToSync.options, fileToSync.fileKey, fileToSync.groupPermissions, fileToSync.groupResourceId, () => {
|
911
|
+
this.emit('fileUploadingStart', filePromise);
|
912
|
+
},
|
911
913
|
// Abort upload callback
|
912
914
|
(abort) => this.abortUploads.push({
|
913
915
|
id: fileToSync.id,
|
914
916
|
abort,
|
915
917
|
}), this.getMultipartOptions(fileToSync));
|
918
|
+
return yield filePromise;
|
916
919
|
});
|
917
920
|
}
|
918
921
|
upload() {
|
@@ -934,6 +937,7 @@ class FileComponent extends Field_1.default {
|
|
934
937
|
fileToSync.message = this.t('succefullyUploaded');
|
935
938
|
fileInfo.originalName = fileToSync.originalName;
|
936
939
|
fileInfo.hash = fileToSync.hash;
|
940
|
+
this.emit('fileUploadingEnd', Promise.resolve(fileInfo));
|
937
941
|
}
|
938
942
|
catch (response) {
|
939
943
|
fileToSync.status = 'error';
|
@@ -943,6 +947,7 @@ class FileComponent extends Field_1.default {
|
|
943
947
|
: response.type === 'abort'
|
944
948
|
? this.t('Request was aborted')
|
945
949
|
: response.toString();
|
950
|
+
this.emit('fileUploadingEnd', Promise.reject(response));
|
946
951
|
this.emit('fileUploadError', {
|
947
952
|
fileToSync,
|
948
953
|
response,
|