@formio/js 5.0.0-dev.5794.12ca15f → 5.0.0-dev.5797.3f96a70
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 +3 -0
- package/dist/formio.form.js +565 -573
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +0 -10
- package/dist/formio.full.js +571 -579
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +0 -10
- package/dist/formio.js +1 -1
- package/dist/formio.min.js +1 -1
- package/dist/formio.utils.js +50 -48
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +4 -4
- package/lib/cjs/Webform.js +2 -2
- package/lib/cjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/cjs/components/_classes/component/Component.js +7 -6
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +12 -10
- package/lib/cjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/cjs/components/datetime/fixtures/comp14.js +38 -0
- package/lib/cjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/cjs/components/datetime/fixtures/index.js +3 -1
- package/lib/cjs/components/day/Day.d.ts +5 -1
- package/lib/cjs/components/day/Day.js +51 -11
- package/lib/cjs/components/day/editForm/Day.edit.day.d.ts +17 -0
- package/lib/cjs/components/day/editForm/Day.edit.day.js +19 -0
- package/lib/cjs/components/day/editForm/Day.edit.month.d.ts +5 -0
- package/lib/cjs/components/day/editForm/Day.edit.month.js +19 -0
- package/lib/cjs/components/day/editForm/Day.edit.year.d.ts +5 -0
- package/lib/cjs/components/day/editForm/Day.edit.year.js +13 -0
- package/lib/cjs/components/editgrid/fixtures/index.d.ts +7 -7
- package/lib/cjs/components/editgrid/fixtures/index.js +1 -1
- package/lib/cjs/components/html/HTML.js +1 -1
- package/lib/cjs/components/select/Select.js +1 -1
- package/lib/cjs/components/select/fixtures/comp25.d.ts +43 -28
- package/lib/cjs/components/select/fixtures/comp25.js +56 -49
- package/lib/cjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/cjs/components/select/fixtures/comp26.js +59 -0
- package/lib/cjs/components/select/fixtures/index.d.ts +2 -1
- package/lib/cjs/components/select/fixtures/index.js +3 -1
- package/lib/cjs/widgets/CalendarWidget.js +24 -10
- package/lib/mjs/Webform.js +6 -2
- package/lib/mjs/components/_classes/component/Component.d.ts +1 -1
- package/lib/mjs/components/_classes/component/Component.js +4 -3
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +8 -0
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +12 -10
- package/lib/mjs/components/datetime/fixtures/comp14.d.ts +35 -0
- package/lib/mjs/components/datetime/fixtures/comp14.js +36 -0
- package/lib/mjs/components/datetime/fixtures/index.d.ts +6 -5
- package/lib/mjs/components/datetime/fixtures/index.js +2 -1
- package/lib/mjs/components/day/Day.d.ts +5 -1
- package/lib/mjs/components/day/Day.js +51 -11
- package/lib/mjs/components/day/editForm/Day.edit.day.d.ts +17 -0
- package/lib/mjs/components/day/editForm/Day.edit.day.js +16 -0
- package/lib/mjs/components/day/editForm/Day.edit.month.d.ts +5 -0
- package/lib/mjs/components/day/editForm/Day.edit.month.js +16 -0
- package/lib/mjs/components/day/editForm/Day.edit.year.d.ts +5 -0
- package/lib/mjs/components/day/editForm/Day.edit.year.js +10 -0
- package/lib/mjs/components/editgrid/fixtures/index.d.ts +7 -7
- package/lib/mjs/components/editgrid/fixtures/index.js +1 -1
- package/lib/mjs/components/html/HTML.js +1 -1
- package/lib/mjs/components/select/Select.js +1 -1
- package/lib/mjs/components/select/fixtures/comp25.d.ts +43 -28
- package/lib/mjs/components/select/fixtures/comp25.js +56 -49
- package/lib/mjs/components/select/fixtures/comp26.d.ts +44 -0
- package/lib/mjs/components/select/fixtures/comp26.js +57 -0
- package/lib/mjs/components/select/fixtures/index.d.ts +2 -1
- package/lib/mjs/components/select/fixtures/index.js +2 -1
- package/lib/mjs/widgets/CalendarWidget.js +24 -10
- package/package.json +2 -2
|
@@ -1,44 +1,59 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
|
-
let title: string;
|
|
3
|
-
let name: string;
|
|
4
|
-
let path: string;
|
|
5
|
-
let type: string;
|
|
6
|
-
let display: string;
|
|
7
2
|
let components: ({
|
|
8
3
|
label: string;
|
|
9
|
-
widget: string;
|
|
10
4
|
tableView: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
label: string;
|
|
14
|
-
value: string;
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
17
|
-
dataType: string;
|
|
5
|
+
modal: boolean;
|
|
6
|
+
rowDrafts: boolean;
|
|
18
7
|
key: string;
|
|
19
8
|
type: string;
|
|
9
|
+
displayAsTable: boolean;
|
|
20
10
|
input: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
components: ({
|
|
12
|
+
label: string;
|
|
13
|
+
widget: string;
|
|
14
|
+
tableView: boolean;
|
|
15
|
+
data: {
|
|
16
|
+
values: {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
validate: {
|
|
22
|
+
required: boolean;
|
|
23
|
+
};
|
|
24
|
+
key: string;
|
|
25
|
+
type: string;
|
|
26
|
+
input: boolean;
|
|
27
|
+
applyMaskOn?: undefined;
|
|
28
|
+
validateWhenHidden?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
label: string;
|
|
31
|
+
applyMaskOn: string;
|
|
32
|
+
tableView: boolean;
|
|
33
|
+
validate: {
|
|
34
|
+
required: boolean;
|
|
35
|
+
};
|
|
36
|
+
validateWhenHidden: boolean;
|
|
37
|
+
key: string;
|
|
38
|
+
type: string;
|
|
39
|
+
input: boolean;
|
|
40
|
+
widget?: undefined;
|
|
41
|
+
data?: undefined;
|
|
42
|
+
})[];
|
|
43
|
+
showValidations?: undefined;
|
|
44
|
+
saveOnEnter?: undefined;
|
|
23
45
|
} | {
|
|
24
46
|
label: string;
|
|
25
|
-
|
|
47
|
+
showValidations: boolean;
|
|
26
48
|
tableView: boolean;
|
|
27
49
|
key: string;
|
|
28
50
|
type: string;
|
|
29
51
|
input: boolean;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
operator: string;
|
|
36
|
-
value: number;
|
|
37
|
-
}[];
|
|
38
|
-
};
|
|
39
|
-
widget?: undefined;
|
|
40
|
-
data?: undefined;
|
|
41
|
-
dataType?: undefined;
|
|
52
|
+
saveOnEnter: boolean;
|
|
53
|
+
modal?: undefined;
|
|
54
|
+
rowDrafts?: undefined;
|
|
55
|
+
displayAsTable?: undefined;
|
|
56
|
+
components?: undefined;
|
|
42
57
|
})[];
|
|
43
58
|
}
|
|
44
59
|
export default _default;
|
|
@@ -1,59 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
|
-
|
|
5
|
-
name: 'fio8072',
|
|
6
|
-
path: 'fio8072',
|
|
7
|
-
type: 'form',
|
|
8
|
-
display: 'form',
|
|
9
|
-
components: [
|
|
4
|
+
"components": [
|
|
10
5
|
{
|
|
11
|
-
label:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
"label": "Edit Grid",
|
|
7
|
+
"tableView": false,
|
|
8
|
+
"modal": true,
|
|
9
|
+
"rowDrafts": true,
|
|
10
|
+
"key": "editGrid",
|
|
11
|
+
"type": "editgrid",
|
|
12
|
+
"displayAsTable": false,
|
|
13
|
+
"input": true,
|
|
14
|
+
"components": [
|
|
15
|
+
{
|
|
16
|
+
"label": "Select",
|
|
17
|
+
"widget": "choicesjs",
|
|
18
|
+
"tableView": true,
|
|
19
|
+
"data": {
|
|
20
|
+
"values": [
|
|
21
|
+
{
|
|
22
|
+
"label": "a",
|
|
23
|
+
"value": "a"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"label": "b",
|
|
27
|
+
"value": "b"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"label": "c",
|
|
31
|
+
"value": "c"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
19
34
|
},
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
value: '2',
|
|
35
|
+
"validate": {
|
|
36
|
+
"required": true
|
|
23
37
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
"key": "select",
|
|
39
|
+
"type": "select",
|
|
40
|
+
"input": true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"label": "Text Field",
|
|
44
|
+
"applyMaskOn": "change",
|
|
45
|
+
"tableView": true,
|
|
46
|
+
"validate": {
|
|
47
|
+
"required": true
|
|
27
48
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
dataType: 'number',
|
|
35
|
-
key: 'select',
|
|
36
|
-
type: 'select',
|
|
37
|
-
input: true,
|
|
49
|
+
"validateWhenHidden": false,
|
|
50
|
+
"key": "textField",
|
|
51
|
+
"type": "textfield",
|
|
52
|
+
"input": true
|
|
53
|
+
}
|
|
54
|
+
]
|
|
38
55
|
},
|
|
39
56
|
{
|
|
40
|
-
label:
|
|
41
|
-
|
|
42
|
-
tableView:
|
|
43
|
-
key:
|
|
44
|
-
type:
|
|
45
|
-
input: true,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
conditions: [
|
|
50
|
-
{
|
|
51
|
-
component: 'select',
|
|
52
|
-
operator: 'lessThan',
|
|
53
|
-
value: 5,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
],
|
|
57
|
+
"label": "Submit",
|
|
58
|
+
"showValidations": false,
|
|
59
|
+
"tableView": false,
|
|
60
|
+
"key": "submit",
|
|
61
|
+
"type": "button",
|
|
62
|
+
"input": true,
|
|
63
|
+
"saveOnEnter": false
|
|
64
|
+
}
|
|
65
|
+
]
|
|
59
66
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let title: string;
|
|
3
|
+
let name: string;
|
|
4
|
+
let path: string;
|
|
5
|
+
let type: string;
|
|
6
|
+
let display: string;
|
|
7
|
+
let components: ({
|
|
8
|
+
label: string;
|
|
9
|
+
widget: string;
|
|
10
|
+
tableView: boolean;
|
|
11
|
+
data: {
|
|
12
|
+
values: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
dataType: string;
|
|
18
|
+
key: string;
|
|
19
|
+
type: string;
|
|
20
|
+
input: boolean;
|
|
21
|
+
applyMaskOn?: undefined;
|
|
22
|
+
conditional?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
label: string;
|
|
25
|
+
applyMaskOn: string;
|
|
26
|
+
tableView: boolean;
|
|
27
|
+
key: string;
|
|
28
|
+
type: string;
|
|
29
|
+
input: boolean;
|
|
30
|
+
conditional: {
|
|
31
|
+
show: boolean;
|
|
32
|
+
conjunction: string;
|
|
33
|
+
conditions: {
|
|
34
|
+
component: string;
|
|
35
|
+
operator: string;
|
|
36
|
+
value: number;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
widget?: undefined;
|
|
40
|
+
data?: undefined;
|
|
41
|
+
dataType?: undefined;
|
|
42
|
+
})[];
|
|
43
|
+
}
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
title: 'FIO-8072',
|
|
5
|
+
name: 'fio8072',
|
|
6
|
+
path: 'fio8072',
|
|
7
|
+
type: 'form',
|
|
8
|
+
display: 'form',
|
|
9
|
+
components: [
|
|
10
|
+
{
|
|
11
|
+
label: 'Select',
|
|
12
|
+
widget: 'choicesjs',
|
|
13
|
+
tableView: true,
|
|
14
|
+
data: {
|
|
15
|
+
values: [
|
|
16
|
+
{
|
|
17
|
+
label: 'A',
|
|
18
|
+
value: '1',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: 'B',
|
|
22
|
+
value: '2',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: 'C',
|
|
26
|
+
value: '10',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'D',
|
|
30
|
+
value: '1d',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
dataType: 'number',
|
|
35
|
+
key: 'select',
|
|
36
|
+
type: 'select',
|
|
37
|
+
input: true,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Text Field',
|
|
41
|
+
applyMaskOn: 'change',
|
|
42
|
+
tableView: true,
|
|
43
|
+
key: 'textField',
|
|
44
|
+
type: 'textfield',
|
|
45
|
+
input: true,
|
|
46
|
+
conditional: {
|
|
47
|
+
show: true,
|
|
48
|
+
conjunction: 'all',
|
|
49
|
+
conditions: [
|
|
50
|
+
{
|
|
51
|
+
component: 'select',
|
|
52
|
+
operator: 'lessThan',
|
|
53
|
+
value: 5,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
};
|
|
@@ -22,5 +22,6 @@ import comp22 from './comp22';
|
|
|
22
22
|
import comp23 from './comp23';
|
|
23
23
|
import comp24 from './comp24';
|
|
24
24
|
import comp25 from './comp25';
|
|
25
|
-
|
|
25
|
+
import comp26 from './comp26';
|
|
26
|
+
export { comp1, comp2, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, comp18, comp19, comp20, comp21, comp22, comp23, comp24, comp25, comp26 };
|
|
26
27
|
export { multiSelect, multiSelectOptions } from "./comp3";
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.comp25 = exports.comp24 = exports.comp23 = exports.comp22 = exports.comp21 = exports.comp20 = exports.comp19 = exports.comp18 = exports.comp17 = exports.comp16 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp2 = exports.comp1 = exports.multiSelectOptions = exports.multiSelect = void 0;
|
|
6
|
+
exports.comp26 = exports.comp25 = exports.comp24 = exports.comp23 = exports.comp22 = exports.comp21 = exports.comp20 = exports.comp19 = exports.comp18 = exports.comp17 = exports.comp16 = exports.comp15 = exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp4 = exports.comp2 = exports.comp1 = exports.multiSelectOptions = exports.multiSelect = void 0;
|
|
7
7
|
const comp1_1 = __importDefault(require("./comp1"));
|
|
8
8
|
exports.comp1 = comp1_1.default;
|
|
9
9
|
const comp2_1 = __importDefault(require("./comp2"));
|
|
@@ -55,3 +55,5 @@ const comp24_1 = __importDefault(require("./comp24"));
|
|
|
55
55
|
exports.comp24 = comp24_1.default;
|
|
56
56
|
const comp25_1 = __importDefault(require("./comp25"));
|
|
57
57
|
exports.comp25 = comp25_1.default;
|
|
58
|
+
const comp26_1 = __importDefault(require("./comp26"));
|
|
59
|
+
exports.comp26 = comp26_1.default;
|
|
@@ -102,14 +102,8 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
102
102
|
this.settings.dateFormat = (0, utils_1.convertFormatToFlatpickr)(this.settings.dateFormat);
|
|
103
103
|
this.settings.position = 'auto center';
|
|
104
104
|
this.settings.onChange = () => {
|
|
105
|
-
if (this.settings.allowInput) {
|
|
106
|
-
|
|
107
|
-
this.calendar._input.value = this.settings.manualInputValue;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
this.settings.manualInputValue = '';
|
|
111
|
-
}
|
|
112
|
-
this.settings.isManuallyOverriddenValue = false;
|
|
105
|
+
if (this.settings.allowInput && this.settings.enableTime) {
|
|
106
|
+
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
|
113
107
|
}
|
|
114
108
|
this.emit('update');
|
|
115
109
|
};
|
|
@@ -118,8 +112,7 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
118
112
|
this.hook('onCalendarClose');
|
|
119
113
|
this.closedOn = Date.now();
|
|
120
114
|
if (this.settings.allowInput && this.settings.enableTime) {
|
|
121
|
-
this.calendar._input.value = this.settings.manualInputValue
|
|
122
|
-
this.settings.isManuallyOverriddenValue = false;
|
|
115
|
+
this.calendar._input.value = this.settings.isManuallyOverriddenValue ? this.settings.manualInputValue : this.calendar.altInput.value;
|
|
123
116
|
this.emit('update');
|
|
124
117
|
}
|
|
125
118
|
if (this.settings.wasDefaultValueChanged) {
|
|
@@ -358,9 +351,14 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
358
351
|
this.calendar = new Flatpickr(this._input, Object.assign(Object.assign({}, this.settings), { disableMobile: true }));
|
|
359
352
|
this.addEventListener(this.calendar.altInput, 'input', (event) => {
|
|
360
353
|
if (this.settings.allowInput && this.settings.currentValue !== event.target.value) {
|
|
354
|
+
if (event.target.mask) {
|
|
355
|
+
event.target.mask.textMaskInputElement.update();
|
|
356
|
+
}
|
|
361
357
|
this.settings.manualInputValue = event.target.value;
|
|
358
|
+
this._input.value = this.settings.manualInputValue;
|
|
362
359
|
this.settings.isManuallyOverriddenValue = true;
|
|
363
360
|
this.settings.currentValue = event.target.value;
|
|
361
|
+
this.emit('update');
|
|
364
362
|
}
|
|
365
363
|
if (event.target.value === '' && this.calendar.selectedDates.length > 0) {
|
|
366
364
|
this.settings.wasDefaultValueChanged = true;
|
|
@@ -371,6 +369,18 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
371
369
|
this.settings.wasDefaultValueChanged = false;
|
|
372
370
|
}
|
|
373
371
|
});
|
|
372
|
+
if (this.calendar.daysContainer) {
|
|
373
|
+
this.calendar.daysContainer.addEventListener('click', () => {
|
|
374
|
+
this.settings.isManuallyOverriddenValue = false;
|
|
375
|
+
this.calendar.updateValue(false);
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
if (this.calendar.timeContainer) {
|
|
379
|
+
this.calendar.timeContainer.addEventListener('click', () => {
|
|
380
|
+
this.settings.isManuallyOverriddenValue = false;
|
|
381
|
+
this.calendar.updateValue(false);
|
|
382
|
+
});
|
|
383
|
+
}
|
|
374
384
|
const excludedFromMaskFormats = ['MMMM'];
|
|
375
385
|
if (!this.settings.readOnly && !lodash_1.default.some(excludedFromMaskFormats, format => lodash_1.default.includes(this.settings.format, format))) {
|
|
376
386
|
// Enforce the input mask of the format.
|
|
@@ -397,6 +407,10 @@ class CalendarWidget extends InputWidget_1.default {
|
|
|
397
407
|
// Make sure we commit the value after a blur event occurs.
|
|
398
408
|
this.addEventListener(this.calendar._input, 'blur', (event) => {
|
|
399
409
|
var _a, _b, _c, _d;
|
|
410
|
+
// If we have manually overridden the value then we shouldn't call setDate because this will fill the input mask
|
|
411
|
+
if (this.settings.isManuallyOverriddenValue) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
400
414
|
const activeElement = this.settings.shadowRoot ? this.settings.shadowRoot.activeElement : document.activeElement;
|
|
401
415
|
const relatedTarget = event.relatedTarget ? event.relatedTarget : activeElement;
|
|
402
416
|
if (!(isIEBrowser && !relatedTarget) && !this.isCalendarElement(relatedTarget)) {
|
package/lib/mjs/Webform.js
CHANGED
|
@@ -1247,10 +1247,14 @@ export default class Webform extends NestedDataComponent {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
this.checkData(value.data, flags);
|
|
1249
1249
|
const shouldValidate = !flags.noValidate ||
|
|
1250
|
-
flags.
|
|
1250
|
+
flags.fromIframe ||
|
|
1251
1251
|
(flags.fromSubmission && this.rootPristine && this.pristine && flags.changed);
|
|
1252
1252
|
const errors = shouldValidate
|
|
1253
|
-
? this.validate(value.data, {
|
|
1253
|
+
? this.validate(value.data, {
|
|
1254
|
+
...flags,
|
|
1255
|
+
noValidate: false,
|
|
1256
|
+
process: 'change'
|
|
1257
|
+
})
|
|
1254
1258
|
: [];
|
|
1255
1259
|
value.isValid = errors.length === 0;
|
|
1256
1260
|
this.loading = false;
|
|
@@ -1076,7 +1076,7 @@ declare class Component extends Element {
|
|
|
1076
1076
|
elementInfo(): any;
|
|
1077
1077
|
autofocus(): void;
|
|
1078
1078
|
scrollIntoView(element?: any): void;
|
|
1079
|
-
focus(index
|
|
1079
|
+
focus(index: any): void;
|
|
1080
1080
|
/**
|
|
1081
1081
|
* Get `Formio` instance for working with files
|
|
1082
1082
|
* @returns {import('@formio/core').Formio} - The Formio instance file service.
|
|
@@ -2988,7 +2988,7 @@ export default class Component extends Element {
|
|
|
2988
2988
|
this.parent.childErrors.push(...errors);
|
|
2989
2989
|
}
|
|
2990
2990
|
else {
|
|
2991
|
-
_.remove(this.parent.childErrors, (err) => err
|
|
2991
|
+
_.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
|
|
2992
2992
|
}
|
|
2993
2993
|
}
|
|
2994
2994
|
this.showValidationErrors(errors, data, row, flags);
|
|
@@ -3004,7 +3004,7 @@ export default class Component extends Element {
|
|
|
3004
3004
|
this.parent.childErrors.push(...errors);
|
|
3005
3005
|
}
|
|
3006
3006
|
else {
|
|
3007
|
-
_.remove(this.parent.childErrors, (err) => err
|
|
3007
|
+
_.remove(this.parent.childErrors, (err) => (err?.component?.key || err?.context?.key) === this.component.key);
|
|
3008
3008
|
}
|
|
3009
3009
|
}
|
|
3010
3010
|
return errors.length === 0;
|
|
@@ -3425,10 +3425,11 @@ export default class Component extends Element {
|
|
|
3425
3425
|
const { left, top } = element.getBoundingClientRect();
|
|
3426
3426
|
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
|
3427
3427
|
}
|
|
3428
|
-
focus(index
|
|
3428
|
+
focus(index) {
|
|
3429
3429
|
if ('beforeFocus' in this.parent) {
|
|
3430
3430
|
this.parent.beforeFocus(this);
|
|
3431
3431
|
}
|
|
3432
|
+
index = index || this.refs.input?.length - 1;
|
|
3432
3433
|
if (this.refs.input?.length) {
|
|
3433
3434
|
const focusingInput = this.refs.input[index];
|
|
3434
3435
|
if (this.component.widget?.type === 'calendar') {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export default class Multivalue extends Field {
|
|
2
|
+
/**
|
|
3
|
+
* Normalize values coming into updateValue.
|
|
4
|
+
* @param {*} value - The value to normalize before setting.
|
|
5
|
+
* @param {Object} flags - Flags to use when normalizing the value.
|
|
6
|
+
* @param {*} emptyValue - The empty value for the field.
|
|
7
|
+
* @returns {*} - The normalized value.
|
|
8
|
+
*/
|
|
9
|
+
normalizeValue(value: any, flags?: Object, emptyValue?: any): any;
|
|
2
10
|
get addAnother(): string;
|
|
3
11
|
/**
|
|
4
12
|
* @returns {Field} - The created field.
|
|
@@ -4,37 +4,39 @@ export default class Multivalue extends Field {
|
|
|
4
4
|
/**
|
|
5
5
|
* Normalize values coming into updateValue.
|
|
6
6
|
* @param {*} value - The value to normalize before setting.
|
|
7
|
+
* @param {Object} flags - Flags to use when normalizing the value.
|
|
8
|
+
* @param {*} emptyValue - The empty value for the field.
|
|
7
9
|
* @returns {*} - The normalized value.
|
|
8
10
|
*/
|
|
9
|
-
normalizeValue(value) {
|
|
11
|
+
normalizeValue(value, flags = {}, emptyValue = this.emptyValue) {
|
|
10
12
|
if (this.component.multiple) {
|
|
11
13
|
if (Array.isArray(value)) {
|
|
12
14
|
if (value.length === 0) {
|
|
13
|
-
return [
|
|
15
|
+
return [emptyValue];
|
|
14
16
|
}
|
|
15
17
|
if (this.component.storeas === 'array') {
|
|
16
|
-
return super.normalizeValue([value]);
|
|
18
|
+
return super.normalizeValue([value], flags);
|
|
17
19
|
}
|
|
18
|
-
return super.normalizeValue(value);
|
|
20
|
+
return super.normalizeValue(value, flags);
|
|
19
21
|
}
|
|
20
22
|
else {
|
|
21
|
-
return super.normalizeValue(value == null ? [
|
|
23
|
+
return super.normalizeValue(value == null ? [emptyValue] : [value], flags);
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
26
|
else {
|
|
25
|
-
if (Array.isArray(value) &&
|
|
27
|
+
if (Array.isArray(value) && !Array.isArray(emptyValue)) {
|
|
26
28
|
if (this.component.storeas === 'string') {
|
|
27
|
-
return super.normalizeValue(value.join(this.delimiter || ''));
|
|
29
|
+
return super.normalizeValue(value.join(this.delimiter || ''), flags);
|
|
28
30
|
}
|
|
29
|
-
return super.normalizeValue(value[0] ||
|
|
31
|
+
return super.normalizeValue(value[0] || emptyValue, flags);
|
|
30
32
|
}
|
|
31
33
|
else {
|
|
32
|
-
return super.normalizeValue(value);
|
|
34
|
+
return super.normalizeValue(value, flags);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
get dataValue() {
|
|
37
|
-
return super.dataValue;
|
|
39
|
+
return this.normalizeValue(super.dataValue);
|
|
38
40
|
}
|
|
39
41
|
set dataValue(value) {
|
|
40
42
|
super.dataValue = value;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let components: {
|
|
3
|
+
label: string;
|
|
4
|
+
tableView: boolean;
|
|
5
|
+
datePicker: {
|
|
6
|
+
disableWeekends: boolean;
|
|
7
|
+
disableWeekdays: boolean;
|
|
8
|
+
};
|
|
9
|
+
enableMinDateInput: boolean;
|
|
10
|
+
enableMaxDateInput: boolean;
|
|
11
|
+
validateWhenHidden: boolean;
|
|
12
|
+
key: string;
|
|
13
|
+
type: string;
|
|
14
|
+
input: boolean;
|
|
15
|
+
widget: {
|
|
16
|
+
type: string;
|
|
17
|
+
displayInTimezone: string;
|
|
18
|
+
locale: string;
|
|
19
|
+
useLocaleSettings: boolean;
|
|
20
|
+
allowInput: boolean;
|
|
21
|
+
mode: string;
|
|
22
|
+
enableTime: boolean;
|
|
23
|
+
noCalendar: boolean;
|
|
24
|
+
format: string;
|
|
25
|
+
hourIncrement: number;
|
|
26
|
+
minuteIncrement: number;
|
|
27
|
+
time_24hr: boolean;
|
|
28
|
+
minDate: null;
|
|
29
|
+
disableWeekends: boolean;
|
|
30
|
+
disableWeekdays: boolean;
|
|
31
|
+
maxDate: null;
|
|
32
|
+
};
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
components: [
|
|
3
|
+
{
|
|
4
|
+
"label": "Date / Time",
|
|
5
|
+
"tableView": false,
|
|
6
|
+
"datePicker": {
|
|
7
|
+
"disableWeekends": false,
|
|
8
|
+
"disableWeekdays": false
|
|
9
|
+
},
|
|
10
|
+
"enableMinDateInput": false,
|
|
11
|
+
"enableMaxDateInput": false,
|
|
12
|
+
"validateWhenHidden": false,
|
|
13
|
+
"key": "dateTime",
|
|
14
|
+
"type": "datetime",
|
|
15
|
+
"input": true,
|
|
16
|
+
"widget": {
|
|
17
|
+
"type": "calendar",
|
|
18
|
+
"displayInTimezone": "viewer",
|
|
19
|
+
"locale": "en",
|
|
20
|
+
"useLocaleSettings": false,
|
|
21
|
+
"allowInput": true,
|
|
22
|
+
"mode": "single",
|
|
23
|
+
"enableTime": true,
|
|
24
|
+
"noCalendar": false,
|
|
25
|
+
"format": "yyyy-MM-dd hh:mm a",
|
|
26
|
+
"hourIncrement": 1,
|
|
27
|
+
"minuteIncrement": 1,
|
|
28
|
+
"time_24hr": false,
|
|
29
|
+
"minDate": null,
|
|
30
|
+
"disableWeekends": false,
|
|
31
|
+
"disableWeekdays": false,
|
|
32
|
+
"maxDate": null
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
|
-
import comp10 from './comp10';
|
|
3
|
-
import comp11 from './comp11';
|
|
4
|
-
import comp12 from './comp12';
|
|
5
|
-
import comp13 from './comp13';
|
|
6
2
|
import comp2 from './comp2';
|
|
7
3
|
import comp3 from './comp3';
|
|
8
4
|
import comp5 from './comp5';
|
|
@@ -10,4 +6,9 @@ import comp6 from './comp6';
|
|
|
10
6
|
import comp7 from './comp7';
|
|
11
7
|
import comp8 from './comp8';
|
|
12
8
|
import comp9 from './comp9';
|
|
13
|
-
|
|
9
|
+
import comp10 from './comp10';
|
|
10
|
+
import comp11 from './comp11';
|
|
11
|
+
import comp12 from './comp12';
|
|
12
|
+
import comp13 from './comp13';
|
|
13
|
+
import comp14 from './comp14';
|
|
14
|
+
export { comp1, comp2, comp3, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14 };
|
|
@@ -10,4 +10,5 @@ import comp10 from './comp10';
|
|
|
10
10
|
import comp11 from './comp11';
|
|
11
11
|
import comp12 from './comp12';
|
|
12
12
|
import comp13 from './comp13';
|
|
13
|
-
|
|
13
|
+
import comp14 from './comp14';
|
|
14
|
+
export { comp1, comp2, comp3, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14 };
|
|
@@ -97,6 +97,11 @@ export default class DayComponent extends Field {
|
|
|
97
97
|
* @returns {null|void} - Returns null if the value is invalid, otherwise void.
|
|
98
98
|
*/
|
|
99
99
|
setValueAt(index: number, value: any): null | void;
|
|
100
|
+
getDayWithHiddenFields(parts: any): {
|
|
101
|
+
month: any;
|
|
102
|
+
day: any;
|
|
103
|
+
year: any;
|
|
104
|
+
};
|
|
100
105
|
getFieldValue(name: any): number;
|
|
101
106
|
get parts(): {
|
|
102
107
|
day: number;
|
|
@@ -130,7 +135,6 @@ export default class DayComponent extends Field {
|
|
|
130
135
|
* @returns {string|null} - The string value of the date.
|
|
131
136
|
*/
|
|
132
137
|
getValueAsString(value: any): string | null;
|
|
133
|
-
focus(field: any): void;
|
|
134
138
|
isPartialDay(value: any): boolean;
|
|
135
139
|
getValidationFormat(): string;
|
|
136
140
|
}
|