@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,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* dist/inputmask
|
|
3
3
|
* https://github.com/RobinHerbots/Inputmask
|
|
4
|
-
* Copyright (c) 2010 -
|
|
4
|
+
* Copyright (c) 2010 - 2024 Robin Herbots
|
|
5
5
|
* Licensed under the MIT license
|
|
6
|
-
* Version: 5.0.
|
|
6
|
+
* Version: 5.0.9
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/*!
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
* MIT licensed
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
/*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
|
|
22
|
-
|
|
23
21
|
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */
|
|
24
22
|
|
|
25
23
|
/*! formiojs v5.0.0-rc.59 | https://unpkg.com/formiojs@5.0.0-rc.59/LICENSE.txt */
|
|
26
24
|
|
|
25
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
26
|
+
|
|
27
27
|
/**
|
|
28
28
|
* @license
|
|
29
29
|
* Lodash <https://lodash.com/>
|
package/lib/cjs/Webform.js
CHANGED
|
@@ -1245,10 +1245,10 @@ class Webform extends NestedDataComponent_1.default {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
this.checkData(value.data, flags);
|
|
1247
1247
|
const shouldValidate = !flags.noValidate ||
|
|
1248
|
-
flags.
|
|
1248
|
+
flags.fromIframe ||
|
|
1249
1249
|
(flags.fromSubmission && this.rootPristine && this.pristine && flags.changed);
|
|
1250
1250
|
const errors = shouldValidate
|
|
1251
|
-
? this.validate(value.data, Object.assign(Object.assign({}, flags), { process:
|
|
1251
|
+
? this.validate(value.data, Object.assign(Object.assign({}, flags), { noValidate: false, process: 'change' }))
|
|
1252
1252
|
: [];
|
|
1253
1253
|
value.isValid = errors.length === 0;
|
|
1254
1254
|
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.
|
|
@@ -3024,7 +3024,7 @@ class Component extends Element_1.default {
|
|
|
3024
3024
|
this.parent.childErrors.push(...errors);
|
|
3025
3025
|
}
|
|
3026
3026
|
else {
|
|
3027
|
-
lodash_1.default.remove(this.parent.childErrors, (err) => err.component.key === this.component.key);
|
|
3027
|
+
lodash_1.default.remove(this.parent.childErrors, (err) => { var _a, _b; return (((_a = err === null || err === void 0 ? void 0 : err.component) === null || _a === void 0 ? void 0 : _a.key) || ((_b = err === null || err === void 0 ? void 0 : err.context) === null || _b === void 0 ? void 0 : _b.key)) === this.component.key; });
|
|
3028
3028
|
}
|
|
3029
3029
|
}
|
|
3030
3030
|
this.showValidationErrors(errors, data, row, flags);
|
|
@@ -3040,7 +3040,7 @@ class Component extends Element_1.default {
|
|
|
3040
3040
|
this.parent.childErrors.push(...errors);
|
|
3041
3041
|
}
|
|
3042
3042
|
else {
|
|
3043
|
-
lodash_1.default.remove(this.parent.childErrors, (err) => err.component.key === this.component.key);
|
|
3043
|
+
lodash_1.default.remove(this.parent.childErrors, (err) => { var _a, _b; return (((_a = err === null || err === void 0 ? void 0 : err.component) === null || _a === void 0 ? void 0 : _a.key) || ((_b = err === null || err === void 0 ? void 0 : err.context) === null || _b === void 0 ? void 0 : _b.key)) === this.component.key; });
|
|
3044
3044
|
}
|
|
3045
3045
|
}
|
|
3046
3046
|
return errors.length === 0;
|
|
@@ -3463,14 +3463,15 @@ class Component extends Element_1.default {
|
|
|
3463
3463
|
const { left, top } = element.getBoundingClientRect();
|
|
3464
3464
|
window.scrollTo(left + window.scrollX, top + window.scrollY);
|
|
3465
3465
|
}
|
|
3466
|
-
focus(index
|
|
3467
|
-
var _a, _b;
|
|
3466
|
+
focus(index) {
|
|
3467
|
+
var _a, _b, _c;
|
|
3468
3468
|
if ('beforeFocus' in this.parent) {
|
|
3469
3469
|
this.parent.beforeFocus(this);
|
|
3470
3470
|
}
|
|
3471
|
-
|
|
3471
|
+
index = index || ((_a = this.refs.input) === null || _a === void 0 ? void 0 : _a.length) - 1;
|
|
3472
|
+
if ((_b = this.refs.input) === null || _b === void 0 ? void 0 : _b.length) {
|
|
3472
3473
|
const focusingInput = this.refs.input[index];
|
|
3473
|
-
if (((
|
|
3474
|
+
if (((_c = this.component.widget) === null || _c === void 0 ? void 0 : _c.type) === 'calendar') {
|
|
3474
3475
|
const sibling = focusingInput.nextSibling;
|
|
3475
3476
|
if (sibling) {
|
|
3476
3477
|
sibling.focus();
|
|
@@ -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.
|
|
@@ -9,37 +9,39 @@ class Multivalue extends Field_1.default {
|
|
|
9
9
|
/**
|
|
10
10
|
* Normalize values coming into updateValue.
|
|
11
11
|
* @param {*} value - The value to normalize before setting.
|
|
12
|
+
* @param {Object} flags - Flags to use when normalizing the value.
|
|
13
|
+
* @param {*} emptyValue - The empty value for the field.
|
|
12
14
|
* @returns {*} - The normalized value.
|
|
13
15
|
*/
|
|
14
|
-
normalizeValue(value) {
|
|
16
|
+
normalizeValue(value, flags = {}, emptyValue = this.emptyValue) {
|
|
15
17
|
if (this.component.multiple) {
|
|
16
18
|
if (Array.isArray(value)) {
|
|
17
19
|
if (value.length === 0) {
|
|
18
|
-
return [
|
|
20
|
+
return [emptyValue];
|
|
19
21
|
}
|
|
20
22
|
if (this.component.storeas === 'array') {
|
|
21
|
-
return super.normalizeValue([value]);
|
|
23
|
+
return super.normalizeValue([value], flags);
|
|
22
24
|
}
|
|
23
|
-
return super.normalizeValue(value);
|
|
25
|
+
return super.normalizeValue(value, flags);
|
|
24
26
|
}
|
|
25
27
|
else {
|
|
26
|
-
return super.normalizeValue(value == null ? [
|
|
28
|
+
return super.normalizeValue(value == null ? [emptyValue] : [value], flags);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
else {
|
|
30
|
-
if (Array.isArray(value) &&
|
|
32
|
+
if (Array.isArray(value) && !Array.isArray(emptyValue)) {
|
|
31
33
|
if (this.component.storeas === 'string') {
|
|
32
|
-
return super.normalizeValue(value.join(this.delimiter || ''));
|
|
34
|
+
return super.normalizeValue(value.join(this.delimiter || ''), flags);
|
|
33
35
|
}
|
|
34
|
-
return super.normalizeValue(value[0] ||
|
|
36
|
+
return super.normalizeValue(value[0] || emptyValue, flags);
|
|
35
37
|
}
|
|
36
38
|
else {
|
|
37
|
-
return super.normalizeValue(value);
|
|
39
|
+
return super.normalizeValue(value, flags);
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
get dataValue() {
|
|
42
|
-
return super.dataValue;
|
|
44
|
+
return this.normalizeValue(super.dataValue);
|
|
43
45
|
}
|
|
44
46
|
set dataValue(value) {
|
|
45
47
|
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,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
components: [
|
|
5
|
+
{
|
|
6
|
+
"label": "Date / Time",
|
|
7
|
+
"tableView": false,
|
|
8
|
+
"datePicker": {
|
|
9
|
+
"disableWeekends": false,
|
|
10
|
+
"disableWeekdays": false
|
|
11
|
+
},
|
|
12
|
+
"enableMinDateInput": false,
|
|
13
|
+
"enableMaxDateInput": false,
|
|
14
|
+
"validateWhenHidden": false,
|
|
15
|
+
"key": "dateTime",
|
|
16
|
+
"type": "datetime",
|
|
17
|
+
"input": true,
|
|
18
|
+
"widget": {
|
|
19
|
+
"type": "calendar",
|
|
20
|
+
"displayInTimezone": "viewer",
|
|
21
|
+
"locale": "en",
|
|
22
|
+
"useLocaleSettings": false,
|
|
23
|
+
"allowInput": true,
|
|
24
|
+
"mode": "single",
|
|
25
|
+
"enableTime": true,
|
|
26
|
+
"noCalendar": false,
|
|
27
|
+
"format": "yyyy-MM-dd hh:mm a",
|
|
28
|
+
"hourIncrement": 1,
|
|
29
|
+
"minuteIncrement": 1,
|
|
30
|
+
"time_24hr": false,
|
|
31
|
+
"minDate": null,
|
|
32
|
+
"disableWeekends": false,
|
|
33
|
+
"disableWeekdays": false,
|
|
34
|
+
"maxDate": null
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
@@ -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 };
|
|
@@ -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.
|
|
6
|
+
exports.comp14 = exports.comp13 = exports.comp12 = exports.comp11 = exports.comp10 = exports.comp9 = exports.comp8 = exports.comp7 = exports.comp6 = exports.comp5 = exports.comp3 = exports.comp2 = exports.comp1 = 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"));
|
|
@@ -28,3 +28,5 @@ const comp12_1 = __importDefault(require("./comp12"));
|
|
|
28
28
|
exports.comp12 = comp12_1.default;
|
|
29
29
|
const comp13_1 = __importDefault(require("./comp13"));
|
|
30
30
|
exports.comp13 = comp13_1.default;
|
|
31
|
+
const comp14_1 = __importDefault(require("./comp14"));
|
|
32
|
+
exports.comp14 = comp14_1.default;
|
|
@@ -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
|
}
|
|
@@ -344,6 +344,18 @@ class DayComponent extends Field_1.default {
|
|
|
344
344
|
const valueParts = value.split('/');
|
|
345
345
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
346
346
|
const defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';
|
|
347
|
+
let defaultDay = '';
|
|
348
|
+
let defaultMonth = '';
|
|
349
|
+
let defaultYear = '';
|
|
350
|
+
if (defaultValue) {
|
|
351
|
+
const hasHiddenFields = defaultValue.length !== 3;
|
|
352
|
+
defaultDay = hasHiddenFields ? this.getDayWithHiddenFields(defaultValue).day : defaultValue[DAY];
|
|
353
|
+
defaultMonth = hasHiddenFields ? this.getDayWithHiddenFields(defaultValue).month : defaultValue[MONTH];
|
|
354
|
+
defaultYear = hasHiddenFields ? this.getDayWithHiddenFields(defaultValue).year : defaultValue[YEAR];
|
|
355
|
+
}
|
|
356
|
+
if (this.options.building && defaultValue.length === 3) {
|
|
357
|
+
return this.component.defaultValue;
|
|
358
|
+
}
|
|
347
359
|
const getNextPart = (shouldTake, defaultValue) => {
|
|
348
360
|
// Only push the part if it's not an empty string
|
|
349
361
|
const part = shouldTake ? valueParts.shift() : defaultValue;
|
|
@@ -352,13 +364,13 @@ class DayComponent extends Field_1.default {
|
|
|
352
364
|
}
|
|
353
365
|
};
|
|
354
366
|
if (this.dayFirst) {
|
|
355
|
-
getNextPart(this.showDay,
|
|
367
|
+
getNextPart(this.showDay, defaultDay);
|
|
356
368
|
}
|
|
357
|
-
getNextPart(this.showMonth,
|
|
369
|
+
getNextPart(this.showMonth, defaultMonth);
|
|
358
370
|
if (!this.dayFirst) {
|
|
359
|
-
getNextPart(this.showDay,
|
|
371
|
+
getNextPart(this.showDay, defaultDay);
|
|
360
372
|
}
|
|
361
|
-
getNextPart(this.showYear,
|
|
373
|
+
getNextPart(this.showYear, defaultYear);
|
|
362
374
|
return dateParts.join('/');
|
|
363
375
|
}
|
|
364
376
|
/**
|
|
@@ -373,16 +385,23 @@ class DayComponent extends Field_1.default {
|
|
|
373
385
|
if (value === 'Invalid date') {
|
|
374
386
|
return null;
|
|
375
387
|
}
|
|
388
|
+
let day, month, year;
|
|
376
389
|
const parts = value.split('/');
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
390
|
+
if (parts.length !== 3) {
|
|
391
|
+
day = this.getDayWithHiddenFields(parts).day;
|
|
392
|
+
month = this.getDayWithHiddenFields(parts).month;
|
|
393
|
+
year = this.getDayWithHiddenFields(parts).year;
|
|
380
394
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
395
|
+
else {
|
|
396
|
+
if (this.component.dayFirst) {
|
|
397
|
+
day = parts.shift();
|
|
398
|
+
}
|
|
399
|
+
month = parts.shift();
|
|
400
|
+
if (!this.component.dayFirst) {
|
|
401
|
+
day = parts.shift();
|
|
402
|
+
}
|
|
403
|
+
year = parts.shift();
|
|
384
404
|
}
|
|
385
|
-
const year = parts.shift();
|
|
386
405
|
if (this.refs.day && this.showDay) {
|
|
387
406
|
this.refs.day.value = day === '00' ? '' : parseInt(day, 10);
|
|
388
407
|
}
|
|
@@ -393,6 +412,27 @@ class DayComponent extends Field_1.default {
|
|
|
393
412
|
this.refs.year.value = year === '0000' ? '' : parseInt(year, 10);
|
|
394
413
|
}
|
|
395
414
|
}
|
|
415
|
+
getDayWithHiddenFields(parts) {
|
|
416
|
+
let [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
417
|
+
if (!this.showDay) {
|
|
418
|
+
MONTH = MONTH === 0 ? 0 : MONTH - 1;
|
|
419
|
+
YEAR = YEAR - 1;
|
|
420
|
+
DAY = null;
|
|
421
|
+
}
|
|
422
|
+
if (!this.showMonth) {
|
|
423
|
+
DAY = DAY === 0 ? 0 : DAY - 1;
|
|
424
|
+
YEAR = YEAR - 1;
|
|
425
|
+
MONTH = null;
|
|
426
|
+
}
|
|
427
|
+
if (!this.showYear) {
|
|
428
|
+
YEAR = null;
|
|
429
|
+
}
|
|
430
|
+
return {
|
|
431
|
+
month: lodash_1.default.isNull(MONTH) ? '' : parts[MONTH],
|
|
432
|
+
day: lodash_1.default.isNull(DAY) ? '' : parts[DAY],
|
|
433
|
+
year: lodash_1.default.isNull(YEAR) ? '' : parts[YEAR],
|
|
434
|
+
};
|
|
435
|
+
}
|
|
396
436
|
getFieldValue(name) {
|
|
397
437
|
const parts = this.dataValue ? this.dataValue.split('/') : [];
|
|
398
438
|
let val = 0;
|
|
@@ -14,6 +14,7 @@ declare const _default: ({
|
|
|
14
14
|
input?: undefined;
|
|
15
15
|
placeholder?: undefined;
|
|
16
16
|
tooltip?: undefined;
|
|
17
|
+
onChange?: undefined;
|
|
17
18
|
} | {
|
|
18
19
|
weight: number;
|
|
19
20
|
type: string;
|
|
@@ -25,16 +26,32 @@ declare const _default: ({
|
|
|
25
26
|
wieght?: undefined;
|
|
26
27
|
datasrc?: undefined;
|
|
27
28
|
data?: undefined;
|
|
29
|
+
onChange?: undefined;
|
|
28
30
|
} | {
|
|
29
31
|
weight: number;
|
|
30
32
|
type: string;
|
|
31
33
|
label: string;
|
|
32
34
|
tooltip: string;
|
|
33
35
|
key: string;
|
|
36
|
+
onChange: ({ data }: {
|
|
37
|
+
data: any;
|
|
38
|
+
}) => void;
|
|
34
39
|
input: boolean;
|
|
35
40
|
wieght?: undefined;
|
|
36
41
|
datasrc?: undefined;
|
|
37
42
|
data?: undefined;
|
|
38
43
|
placeholder?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
weight: number;
|
|
46
|
+
type: string;
|
|
47
|
+
label: string;
|
|
48
|
+
tooltip: string;
|
|
49
|
+
key: string;
|
|
50
|
+
input: boolean;
|
|
51
|
+
wieght?: undefined;
|
|
52
|
+
datasrc?: undefined;
|
|
53
|
+
data?: undefined;
|
|
54
|
+
placeholder?: undefined;
|
|
55
|
+
onChange?: undefined;
|
|
39
56
|
})[];
|
|
40
57
|
export default _default;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
3
7
|
exports.default = [
|
|
4
8
|
{
|
|
5
9
|
wieght: 200,
|
|
@@ -35,6 +39,21 @@ exports.default = [
|
|
|
35
39
|
label: 'Hidden',
|
|
36
40
|
tooltip: 'Hide the Day part of the component.',
|
|
37
41
|
key: 'fields.day.hide',
|
|
42
|
+
onChange: ({ data }) => {
|
|
43
|
+
if (data.defaultValue) {
|
|
44
|
+
const defaultValueParts = data.defaultValue.split('/');
|
|
45
|
+
if (!data.fields.day.hide && defaultValueParts.length !== 3) {
|
|
46
|
+
const newDefaultValue = ['00'];
|
|
47
|
+
if (!data.fields.month.hide) {
|
|
48
|
+
data.dayFirst ? newDefaultValue.push(defaultValueParts[0]) : newDefaultValue.unshift(defaultValueParts[0]);
|
|
49
|
+
}
|
|
50
|
+
if (!data.fields.year.hide) {
|
|
51
|
+
newDefaultValue.push(defaultValueParts[1]);
|
|
52
|
+
}
|
|
53
|
+
lodash_1.default.set(data, 'defaultValue', newDefaultValue.join('/'));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
38
57
|
input: true
|
|
39
58
|
},
|
|
40
59
|
{
|
|
@@ -14,6 +14,7 @@ declare const _default: ({
|
|
|
14
14
|
input?: undefined;
|
|
15
15
|
placeholder?: undefined;
|
|
16
16
|
tooltip?: undefined;
|
|
17
|
+
onChange?: undefined;
|
|
17
18
|
} | {
|
|
18
19
|
weight: number;
|
|
19
20
|
type: string;
|
|
@@ -25,12 +26,16 @@ declare const _default: ({
|
|
|
25
26
|
wieght?: undefined;
|
|
26
27
|
datasrc?: undefined;
|
|
27
28
|
data?: undefined;
|
|
29
|
+
onChange?: undefined;
|
|
28
30
|
} | {
|
|
29
31
|
weight: number;
|
|
30
32
|
type: string;
|
|
31
33
|
label: string;
|
|
32
34
|
tooltip: string;
|
|
33
35
|
key: string;
|
|
36
|
+
onChange: ({ data }: {
|
|
37
|
+
data: any;
|
|
38
|
+
}) => void;
|
|
34
39
|
input: boolean;
|
|
35
40
|
wieght?: undefined;
|
|
36
41
|
datasrc?: undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
3
7
|
exports.default = [
|
|
4
8
|
{
|
|
5
9
|
wieght: 200,
|
|
@@ -35,6 +39,21 @@ exports.default = [
|
|
|
35
39
|
label: 'Hidden',
|
|
36
40
|
tooltip: 'Hide the Month part of the component.',
|
|
37
41
|
key: 'fields.month.hide',
|
|
42
|
+
onChange: ({ data }) => {
|
|
43
|
+
if (data.defaultValue) {
|
|
44
|
+
const defaultValueParts = data.defaultValue.split('/');
|
|
45
|
+
if (!data.fields.month.hide && defaultValueParts.length !== 3) {
|
|
46
|
+
const newDefaultValue = ['00'];
|
|
47
|
+
if (!data.fields.day.hide) {
|
|
48
|
+
data.dayFirst ? newDefaultValue.unshift(defaultValueParts[0]) : newDefaultValue.push(defaultValueParts[0]);
|
|
49
|
+
}
|
|
50
|
+
if (!data.fields.year.hide) {
|
|
51
|
+
newDefaultValue.push(defaultValueParts[1]);
|
|
52
|
+
}
|
|
53
|
+
lodash_1.default.set(data, 'defaultValue', newDefaultValue.join('/'));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
38
57
|
input: true
|
|
39
58
|
},
|
|
40
59
|
];
|
|
@@ -14,6 +14,7 @@ declare const _default: ({
|
|
|
14
14
|
input?: undefined;
|
|
15
15
|
placeholder?: undefined;
|
|
16
16
|
tooltip?: undefined;
|
|
17
|
+
onChange?: undefined;
|
|
17
18
|
} | {
|
|
18
19
|
weight: number;
|
|
19
20
|
type: string;
|
|
@@ -25,12 +26,16 @@ declare const _default: ({
|
|
|
25
26
|
wieght?: undefined;
|
|
26
27
|
datasrc?: undefined;
|
|
27
28
|
data?: undefined;
|
|
29
|
+
onChange?: undefined;
|
|
28
30
|
} | {
|
|
29
31
|
weight: number;
|
|
30
32
|
type: string;
|
|
31
33
|
label: string;
|
|
32
34
|
tooltip: string;
|
|
33
35
|
key: string;
|
|
36
|
+
onChange: ({ data }: {
|
|
37
|
+
data: any;
|
|
38
|
+
}) => void;
|
|
34
39
|
input: boolean;
|
|
35
40
|
wieght?: undefined;
|
|
36
41
|
datasrc?: undefined;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
3
7
|
exports.default = [
|
|
4
8
|
{
|
|
5
9
|
wieght: 200,
|
|
@@ -53,6 +57,15 @@ exports.default = [
|
|
|
53
57
|
label: 'Hidden',
|
|
54
58
|
tooltip: 'Hide the Year part of the component.',
|
|
55
59
|
key: 'fields.year.hide',
|
|
60
|
+
onChange: ({ data }) => {
|
|
61
|
+
if (data.defaultValue) {
|
|
62
|
+
const defaultValueParts = data.defaultValue.split('/');
|
|
63
|
+
if (!data.fields.month.hide && defaultValueParts.length !== 3) {
|
|
64
|
+
defaultValueParts.push('0000');
|
|
65
|
+
lodash_1.default.set(data, 'defaultValue', defaultValueParts.join('/'));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
56
69
|
input: true
|
|
57
70
|
},
|
|
58
71
|
];
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import comp1 from './comp1';
|
|
2
2
|
import comp2 from './comp2';
|
|
3
3
|
import comp3 from './comp3';
|
|
4
|
-
import comp10 from './comp10';
|
|
5
|
-
import comp11 from './comp11';
|
|
6
|
-
import comp12 from './comp12';
|
|
7
|
-
import comp13 from './comp13';
|
|
8
|
-
import comp14 from './comp14';
|
|
9
|
-
import comp15 from './comp15';
|
|
10
4
|
import comp4 from './comp4';
|
|
11
5
|
import comp5 from './comp5';
|
|
12
6
|
import comp6 from './comp6';
|
|
13
7
|
import comp7 from './comp7';
|
|
14
8
|
import comp8 from './comp8';
|
|
15
9
|
import comp9 from './comp9';
|
|
10
|
+
import comp10 from './comp10';
|
|
11
|
+
import comp11 from './comp11';
|
|
12
|
+
import comp12 from './comp12';
|
|
13
|
+
import comp13 from './comp13';
|
|
14
|
+
import comp14 from './comp14';
|
|
15
|
+
import comp15 from './comp15';
|
|
16
16
|
import comp16 from './comp16';
|
|
17
17
|
import comp17 from './comp17';
|
|
18
18
|
import compOpenWhenEmpty from './comp-openWhenEmpty';
|
|
19
19
|
import withOpenWhenEmptyAndConditions from './comp-with-conditions-and-openWhenEmpty';
|
|
20
20
|
import compWithCustomDefaultValue from './comp-with-custom-default-value';
|
|
21
21
|
import compTestEvents from './comp-test-events';
|
|
22
|
-
export { comp1, comp2, comp3,
|
|
22
|
+
export { comp1, comp2, comp3, comp4, comp5, comp6, comp7, comp8, comp9, comp10, comp11, comp12, comp13, comp14, comp15, comp16, comp17, compOpenWhenEmpty, withOpenWhenEmptyAndConditions, compWithCustomDefaultValue, compTestEvents };
|
|
@@ -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.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = exports.comp17 = exports.comp16 = exports.
|
|
6
|
+
exports.compTestEvents = exports.compWithCustomDefaultValue = exports.withOpenWhenEmptyAndConditions = exports.compOpenWhenEmpty = 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.comp3 = exports.comp2 = exports.comp1 = 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"));
|
|
@@ -1567,8 +1567,8 @@ class SelectComponent extends ListComponent_1.default {
|
|
|
1567
1567
|
super.detach();
|
|
1568
1568
|
}
|
|
1569
1569
|
focus() {
|
|
1570
|
+
super.focus.call(this);
|
|
1570
1571
|
if (this.focusableElement) {
|
|
1571
|
-
super.focus.call(this);
|
|
1572
1572
|
this.focusableElement.focus();
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|