ca-components 1.3.1 → 1.3.2
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.
|
@@ -14277,8 +14277,7 @@ class CaInputDatetimePickerComponent {
|
|
|
14277
14277
|
}, 90);
|
|
14278
14278
|
}
|
|
14279
14279
|
selectLastOneAfterMouseUp() {
|
|
14280
|
-
if (this.inputConfig.name ===
|
|
14281
|
-
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14280
|
+
if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14282
14281
|
this.selectionInput = 1;
|
|
14283
14282
|
this.span2.nativeElement.focus();
|
|
14284
14283
|
this.setSpanSelection(this.span2.nativeElement);
|
|
@@ -14330,8 +14329,7 @@ class CaInputDatetimePickerComponent {
|
|
|
14330
14329
|
isNumber(evt) {
|
|
14331
14330
|
evt = evt ? evt : window.event;
|
|
14332
14331
|
let charCode = evt.which ? evt.which : evt.keyCode;
|
|
14333
|
-
return ((charCode >= 48 && charCode <= 57) ||
|
|
14334
|
-
(charCode >= 96 && charCode <= 105));
|
|
14332
|
+
return ((charCode >= 48 && charCode <= 57) || (charCode >= 96 && charCode <= 105));
|
|
14335
14333
|
}
|
|
14336
14334
|
isNavigationKey(e) {
|
|
14337
14335
|
const navigationKeys = [37, 38, 39, 40, 8, 9, 46]; // Arrow keys, Backspace, Tab, Delete
|
|
@@ -14448,9 +14446,7 @@ class CaInputDatetimePickerComponent {
|
|
|
14448
14446
|
else {
|
|
14449
14447
|
if (this.inputConfig.expiredDateInvalid &&
|
|
14450
14448
|
moment(this.dateTimeInputDate).isBefore(moment())) {
|
|
14451
|
-
this.superControl.control?.setErrors({
|
|
14452
|
-
invalid: true,
|
|
14453
|
-
}); // don't accept expired dates
|
|
14449
|
+
this.superControl.control?.setErrors({ invalid: true }); // don't accept expired dates
|
|
14454
14450
|
}
|
|
14455
14451
|
else {
|
|
14456
14452
|
this.calendarService.dateChanged.next(this.dateTimeInputDate);
|
|
@@ -14514,8 +14510,7 @@ class CaInputDatetimePickerComponent {
|
|
|
14514
14510
|
text = moment(new Date(date)).format('MM/DD/YY');
|
|
14515
14511
|
dateFormat = text.split('/');
|
|
14516
14512
|
}
|
|
14517
|
-
else if (this.inputConfig.name ===
|
|
14518
|
-
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14513
|
+
else if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14519
14514
|
text = moment(new Date(date)).format('MM/DD/YY');
|
|
14520
14515
|
dateFormat = text.split('/');
|
|
14521
14516
|
}
|
|
@@ -14554,11 +14549,9 @@ class CaInputDatetimePickerComponent {
|
|
|
14554
14549
|
? undefined
|
|
14555
14550
|
: parseInt(this.span2.nativeElement.innerHTML);
|
|
14556
14551
|
let span3Value;
|
|
14557
|
-
if (this.inputConfig.name !==
|
|
14558
|
-
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14552
|
+
if (this.inputConfig.name !== InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14559
14553
|
span3Value =
|
|
14560
|
-
isNaN(this.span3.nativeElement.innerHTML) ||
|
|
14561
|
-
this.newInputChanged
|
|
14554
|
+
isNaN(this.span3.nativeElement.innerHTML) || this.newInputChanged
|
|
14562
14555
|
? ''
|
|
14563
14556
|
: parseInt(this.span3.nativeElement.innerHTML);
|
|
14564
14557
|
}
|
|
@@ -14578,13 +14571,12 @@ class CaInputDatetimePickerComponent {
|
|
|
14578
14571
|
this.selectSpanByTabIndex(1, true);
|
|
14579
14572
|
}
|
|
14580
14573
|
else {
|
|
14581
|
-
this.dateTimeInputDate = new Date(this.dateTimeInputDate.setMonth(parseInt(this.span1.nativeElement.innerHTML +
|
|
14582
|
-
|
|
14574
|
+
this.dateTimeInputDate = new Date(this.dateTimeInputDate.setMonth(parseInt(this.span1.nativeElement.innerHTML + parseInt(e.key)) -
|
|
14575
|
+
1));
|
|
14583
14576
|
if (!final_value)
|
|
14584
14577
|
this.span1.nativeElement.innerHTML = 'mm';
|
|
14585
14578
|
else
|
|
14586
|
-
this.span1.nativeElement.innerHTML = (this.span1.nativeElement.innerHTML +
|
|
14587
|
-
parseInt(e.key)).slice(-2);
|
|
14579
|
+
this.span1.nativeElement.innerHTML = (this.span1.nativeElement.innerHTML + parseInt(e.key)).slice(-2);
|
|
14588
14580
|
this.selectionInput = 1;
|
|
14589
14581
|
this.selectSpanByTabIndex(1, true);
|
|
14590
14582
|
}
|
|
@@ -14616,14 +14608,12 @@ class CaInputDatetimePickerComponent {
|
|
|
14616
14608
|
this.selectSpanByTabIndex(2, true);
|
|
14617
14609
|
}
|
|
14618
14610
|
else {
|
|
14619
|
-
this.dateTimeInputDate = new Date(this.dateTimeInputDate.setDate(parseInt(this.span2.nativeElement.innerHTML +
|
|
14620
|
-
parseInt(e.key))));
|
|
14611
|
+
this.dateTimeInputDate = new Date(this.dateTimeInputDate.setDate(parseInt(this.span2.nativeElement.innerHTML + parseInt(e.key))));
|
|
14621
14612
|
if (!final_value) {
|
|
14622
14613
|
this.span2.nativeElement.innerHTML = 'dd';
|
|
14623
14614
|
}
|
|
14624
14615
|
else {
|
|
14625
|
-
this.span2.nativeElement.innerHTML = (this.span2.nativeElement.innerHTML +
|
|
14626
|
-
parseInt(e.key)).slice(-2);
|
|
14616
|
+
this.span2.nativeElement.innerHTML = (this.span2.nativeElement.innerHTML + parseInt(e.key)).slice(-2);
|
|
14627
14617
|
}
|
|
14628
14618
|
this.selectionInput = 2;
|
|
14629
14619
|
this.selectSpanByTabIndex(2, true);
|
|
@@ -14664,8 +14654,7 @@ class CaInputDatetimePickerComponent {
|
|
|
14664
14654
|
}
|
|
14665
14655
|
}
|
|
14666
14656
|
}
|
|
14667
|
-
else if (this.inputConfig.name ===
|
|
14668
|
-
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14657
|
+
else if (this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD) {
|
|
14669
14658
|
if (!this.selectionInput) {
|
|
14670
14659
|
if (isRestart) {
|
|
14671
14660
|
this.span1.nativeElement.innerHTML = 'mm';
|
|
@@ -14680,14 +14669,13 @@ class CaInputDatetimePickerComponent {
|
|
|
14680
14669
|
this.selectSpanByTabIndex(1, true);
|
|
14681
14670
|
}
|
|
14682
14671
|
else {
|
|
14683
|
-
this.dateTimeInputDate = new Date(this.dateTimeInputDate.setMonth(parseInt(this.span1.nativeElement.innerHTML +
|
|
14684
|
-
|
|
14672
|
+
this.dateTimeInputDate = new Date(this.dateTimeInputDate.setMonth(parseInt(this.span1.nativeElement.innerHTML + parseInt(e.key)) -
|
|
14673
|
+
1));
|
|
14685
14674
|
if (!final_value) {
|
|
14686
14675
|
this.span1.nativeElement.innerHTML = 'mm';
|
|
14687
14676
|
}
|
|
14688
14677
|
else {
|
|
14689
|
-
this.span1.nativeElement.innerHTML = (this.span1.nativeElement.innerHTML +
|
|
14690
|
-
parseInt(e.key)).slice(-2);
|
|
14678
|
+
this.span1.nativeElement.innerHTML = (this.span1.nativeElement.innerHTML + parseInt(e.key)).slice(-2);
|
|
14691
14679
|
}
|
|
14692
14680
|
this.selectionInput = 1;
|
|
14693
14681
|
this.selectSpanByTabIndex(1, true);
|
|
@@ -14780,16 +14768,14 @@ class CaInputDatetimePickerComponent {
|
|
|
14780
14768
|
this.selectionInput = 0;
|
|
14781
14769
|
const isUp = direction === 'up';
|
|
14782
14770
|
const isDatePicker = this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER;
|
|
14783
|
-
const isBankCardPicker = this.inputConfig.name ===
|
|
14784
|
-
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
14771
|
+
const isBankCardPicker = this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
14785
14772
|
if (isDatePicker || isBankCardPicker)
|
|
14786
14773
|
this.handleDatePickerInput(isUp, isDatePicker);
|
|
14787
14774
|
else
|
|
14788
14775
|
this.handleTimePickerInput(isUp);
|
|
14789
14776
|
}
|
|
14790
14777
|
moveSelectionRightOrTab(e) {
|
|
14791
|
-
const isDatepickerBankCard = this.inputConfig.name ===
|
|
14792
|
-
InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
14778
|
+
const isDatepickerBankCard = this.inputConfig.name === InputConfigNameStringEnum.DATE_PICKER_BANK_CARD;
|
|
14793
14779
|
const maxIndex = isDatepickerBankCard ? 1 : 2;
|
|
14794
14780
|
if (this.selectionInput < maxIndex && !e.shiftKey) {
|
|
14795
14781
|
this.selectionInput += 1;
|