@ldmjs/ui 1.0.65 → 1.0.66
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/index.js +13 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5267,14 +5267,14 @@ function convert(d) {
|
|
|
5267
5267
|
}
|
|
5268
5268
|
return d;
|
|
5269
5269
|
}
|
|
5270
|
+
/**
|
|
5271
|
+
* Сравнение двух дат
|
|
5272
|
+
* -1 : if a < b
|
|
5273
|
+
* 0 : if a = b
|
|
5274
|
+
* 1 : if a > b
|
|
5275
|
+
* NaN - если a или b не являются объектом даты
|
|
5276
|
+
*/
|
|
5270
5277
|
function compare(a, b) {
|
|
5271
|
-
// Compare two dates (could be of any type supported by the convert
|
|
5272
|
-
// function above) and returns:
|
|
5273
|
-
// -1 : if a < b
|
|
5274
|
-
// 0 : if a = b
|
|
5275
|
-
// 1 : if a > b
|
|
5276
|
-
// NaN : if a or b is an illegal date
|
|
5277
|
-
// NOTE: The code inside isFinite does an assignment (=).
|
|
5278
5278
|
const a1 = a ? convert(a).valueOf() : 0;
|
|
5279
5279
|
const b1 = b ? convert(b).valueOf() : 0;
|
|
5280
5280
|
return isFinite(a1) && isFinite(b1) ? Number(a1 > b1) - Number(a1 < b1) : NaN;
|
|
@@ -14377,20 +14377,17 @@ class TimeComponent extends (0,external_vue_class_component_.mixins)(Validatable
|
|
|
14377
14377
|
}
|
|
14378
14378
|
if (t === 'm') {
|
|
14379
14379
|
this.m = this.testM(this.cut(this.numbers(value)));
|
|
14380
|
-
if (!this.m.length && this.eventKeyCode === 'Backspace') {
|
|
14381
|
-
this.inputH.focus();
|
|
14382
|
-
}
|
|
14383
14380
|
return false;
|
|
14384
14381
|
}
|
|
14385
14382
|
}
|
|
14386
14383
|
onKeydown(e, t) {
|
|
14387
14384
|
this.eventKeyCode = e.code;
|
|
14388
|
-
if (e.code === 'ArrowUp') {
|
|
14385
|
+
if (e.code === 'ArrowUp' || e.code === 'NumpadAdd') {
|
|
14389
14386
|
e.preventDefault();
|
|
14390
14387
|
e.stopPropagation();
|
|
14391
14388
|
this.onClick(t, 'up');
|
|
14392
14389
|
}
|
|
14393
|
-
if (e.code === 'ArrowDown') {
|
|
14390
|
+
if (e.code === 'ArrowDown' || e.code === 'NumpadSubtract') {
|
|
14394
14391
|
e.preventDefault();
|
|
14395
14392
|
e.stopPropagation();
|
|
14396
14393
|
this.onClick(t, 'down');
|
|
@@ -19640,9 +19637,9 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
|
|
|
19640
19637
|
if (!this.date && !this.currentMinDate) {
|
|
19641
19638
|
this.currentMinDate = new Date(newVal);
|
|
19642
19639
|
}
|
|
19643
|
-
if (this.date && datetime.compare(this.date, newVal)
|
|
19640
|
+
if (this.date && datetime.compare(this.date, newVal) > 0) {
|
|
19644
19641
|
const d = new Date(this.date);
|
|
19645
|
-
d.
|
|
19642
|
+
d.setMonth(d.getMonth() - 1);
|
|
19646
19643
|
this.currentMinDate = new Date(d);
|
|
19647
19644
|
}
|
|
19648
19645
|
}
|
|
@@ -19660,9 +19657,9 @@ let DatepickerComponent = class DatepickerComponent extends (0,external_vue_clas
|
|
|
19660
19657
|
if (!this.date && !this.currentMaxDate) {
|
|
19661
19658
|
this.currentMaxDate = new Date(newVal);
|
|
19662
19659
|
}
|
|
19663
|
-
if (this.date && datetime.compare(this.date, newVal)
|
|
19660
|
+
if (this.date && datetime.compare(this.date, newVal) < 0) {
|
|
19664
19661
|
const d = new Date(this.date);
|
|
19665
|
-
d.
|
|
19662
|
+
d.setMonth(d.getMonth() + 1);
|
|
19666
19663
|
this.currentMaxDate = new Date(d);
|
|
19667
19664
|
}
|
|
19668
19665
|
}
|