@formio/js 5.0.0-dev.5760.4aea057 → 5.0.0-dev.5764.34bd69a
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/dist/formio.form.js +2 -2
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.full.js +2 -2
- package/dist/formio.full.min.js +1 -1
- package/lib/cjs/components/day/Day.js +7 -20
- package/lib/cjs/components/time/Time.js +0 -5
- package/lib/mjs/components/day/Day.js +7 -20
- package/lib/mjs/components/time/Time.js +0 -11
- package/package.json +1 -1
|
@@ -30,8 +30,7 @@ class DayComponent extends Field_1.default {
|
|
|
30
30
|
required: false
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
|
-
dayFirst: false
|
|
34
|
-
defaultValue: ''
|
|
33
|
+
dayFirst: false
|
|
35
34
|
}, ...extend);
|
|
36
35
|
}
|
|
37
36
|
static get builderInfo() {
|
|
@@ -344,21 +343,15 @@ class DayComponent extends Field_1.default {
|
|
|
344
343
|
const valueParts = value.split('/');
|
|
345
344
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
346
345
|
const defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';
|
|
347
|
-
const getNextPart = (shouldTake, defaultValue) =>
|
|
348
|
-
// Only push the part if it's not an empty string
|
|
349
|
-
const part = shouldTake ? valueParts.shift() : defaultValue;
|
|
350
|
-
if (part !== '') {
|
|
351
|
-
dateParts.push(part);
|
|
352
|
-
}
|
|
353
|
-
};
|
|
346
|
+
const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);
|
|
354
347
|
if (this.dayFirst) {
|
|
355
|
-
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
|
|
348
|
+
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');
|
|
356
349
|
}
|
|
357
|
-
getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '');
|
|
350
|
+
getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');
|
|
358
351
|
if (!this.dayFirst) {
|
|
359
|
-
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
|
|
352
|
+
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');
|
|
360
353
|
}
|
|
361
|
-
getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '');
|
|
354
|
+
getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');
|
|
362
355
|
return dateParts.join('/');
|
|
363
356
|
}
|
|
364
357
|
/**
|
|
@@ -565,13 +558,7 @@ class DayComponent extends Field_1.default {
|
|
|
565
558
|
}
|
|
566
559
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
567
560
|
const values = value.split('/');
|
|
568
|
-
|
|
569
|
-
return (values[DAY] === '00' ||
|
|
570
|
-
values[MONTH] === '00' ||
|
|
571
|
-
values[YEAR] === '0000' ||
|
|
572
|
-
values[DAY] === '' ||
|
|
573
|
-
values[MONTH] === '' ||
|
|
574
|
-
values[YEAR] === '');
|
|
561
|
+
return (values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000');
|
|
575
562
|
}
|
|
576
563
|
getValidationFormat() {
|
|
577
564
|
return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';
|
|
@@ -18,11 +18,6 @@ class TimeComponent extends TextField_1.default {
|
|
|
18
18
|
dataFormat: defaultDataFormat,
|
|
19
19
|
}, ...extend);
|
|
20
20
|
}
|
|
21
|
-
static get serverConditionSettings() {
|
|
22
|
-
return Object.assign(Object.assign({}, super.serverConditionSettings), { valueComponent(classComp) {
|
|
23
|
-
return Object.assign(Object.assign({}, classComp), { type: 'time' });
|
|
24
|
-
} });
|
|
25
|
-
}
|
|
26
21
|
constructor(component, options, data) {
|
|
27
22
|
super(component, options, data);
|
|
28
23
|
const { edge: isEdgeBrowser, version: edgeVersion } = (0, utils_1.getBrowserInfo)();
|
|
@@ -25,8 +25,7 @@ export default class DayComponent extends Field {
|
|
|
25
25
|
required: false
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
dayFirst: false
|
|
29
|
-
defaultValue: ''
|
|
28
|
+
dayFirst: false
|
|
30
29
|
}, ...extend);
|
|
31
30
|
}
|
|
32
31
|
static get builderInfo() {
|
|
@@ -342,21 +341,15 @@ export default class DayComponent extends Field {
|
|
|
342
341
|
const valueParts = value.split('/');
|
|
343
342
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
344
343
|
const defaultValue = this.component.defaultValue ? this.component.defaultValue.split('/') : '';
|
|
345
|
-
const getNextPart = (shouldTake, defaultValue) =>
|
|
346
|
-
// Only push the part if it's not an empty string
|
|
347
|
-
const part = shouldTake ? valueParts.shift() : defaultValue;
|
|
348
|
-
if (part !== '') {
|
|
349
|
-
dateParts.push(part);
|
|
350
|
-
}
|
|
351
|
-
};
|
|
344
|
+
const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);
|
|
352
345
|
if (this.dayFirst) {
|
|
353
|
-
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
|
|
346
|
+
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');
|
|
354
347
|
}
|
|
355
|
-
getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '');
|
|
348
|
+
getNextPart(this.showMonth, defaultValue ? defaultValue[MONTH] : '00');
|
|
356
349
|
if (!this.dayFirst) {
|
|
357
|
-
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '');
|
|
350
|
+
getNextPart(this.showDay, defaultValue ? defaultValue[DAY] : '00');
|
|
358
351
|
}
|
|
359
|
-
getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '');
|
|
352
|
+
getNextPart(this.showYear, defaultValue ? defaultValue[YEAR] : '0000');
|
|
360
353
|
return dateParts.join('/');
|
|
361
354
|
}
|
|
362
355
|
/**
|
|
@@ -561,13 +554,7 @@ export default class DayComponent extends Field {
|
|
|
561
554
|
}
|
|
562
555
|
const [DAY, MONTH, YEAR] = this.component.dayFirst ? [0, 1, 2] : [1, 0, 2];
|
|
563
556
|
const values = value.split('/');
|
|
564
|
-
|
|
565
|
-
return (values[DAY] === '00' ||
|
|
566
|
-
values[MONTH] === '00' ||
|
|
567
|
-
values[YEAR] === '0000' ||
|
|
568
|
-
values[DAY] === '' ||
|
|
569
|
-
values[MONTH] === '' ||
|
|
570
|
-
values[YEAR] === '');
|
|
557
|
+
return (values[DAY] === '00' || values[MONTH] === '00' || values[YEAR] === '0000');
|
|
571
558
|
}
|
|
572
559
|
getValidationFormat() {
|
|
573
560
|
return this.dayFirst ? 'DD-MM-YYYY' : 'MM-DD-YYYY';
|
|
@@ -13,17 +13,6 @@ export default class TimeComponent extends TextFieldComponent {
|
|
|
13
13
|
dataFormat: defaultDataFormat,
|
|
14
14
|
}, ...extend);
|
|
15
15
|
}
|
|
16
|
-
static get serverConditionSettings() {
|
|
17
|
-
return {
|
|
18
|
-
...super.serverConditionSettings,
|
|
19
|
-
valueComponent(classComp) {
|
|
20
|
-
return {
|
|
21
|
-
...classComp,
|
|
22
|
-
type: 'time',
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
16
|
constructor(component, options, data) {
|
|
28
17
|
super(component, options, data);
|
|
29
18
|
const { edge: isEdgeBrowser, version: edgeVersion } = getBrowserInfo();
|