ms-design-system 0.0.39 → 0.0.40
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.
|
@@ -3609,24 +3609,657 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
3609
3609
|
class MsDesignSystemModule {
|
|
3610
3610
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MsDesignSystemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3611
3611
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.3", ngImport: i0, type: MsDesignSystemModule, imports: [i1$2.InlineSVGModule, MsButton, MsDropdown, MsCheckbox, MsBadge, MsToggle, MsRadioButton, MsInputField, MsTextArea, MsAvatar, MsSidebar, MsTooltip, MsPagination, MsSpinner, MsFileUploader, MsTooltipDirective, MsIcon, MsTopbar, MsTabs, MsBreadcrumb, MsFlagIcon,
|
|
3612
|
-
MsCommentBox, MsToaster], exports: [InlineSVGModule$1, MsButton, MsDropdown, MsCheckbox, MsBadge, MsToggle, MsRadioButton, MsInputField, MsTextArea, MsAvatar, MsSidebar, MsTooltip, MsPagination, MsSpinner, MsFileUploader, MsIcon, MsTopbar, MsTabs, MsBreadcrumb, MsFlagIcon,
|
|
3613
|
-
MsCommentBox, MsToaster] });
|
|
3612
|
+
MsCommentBox, MsToaster, MsDatePicker], exports: [InlineSVGModule$1, MsButton, MsDropdown, MsCheckbox, MsBadge, MsToggle, MsRadioButton, MsInputField, MsTextArea, MsAvatar, MsSidebar, MsTooltip, MsPagination, MsSpinner, MsFileUploader, MsIcon, MsTopbar, MsTabs, MsBreadcrumb, MsFlagIcon,
|
|
3613
|
+
MsCommentBox, MsToaster, MsDatePicker] });
|
|
3614
3614
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MsDesignSystemModule, providers: [TopbarService], imports: [InlineSVGModule$1.forRoot(), MsButton, MsDropdown, MsInputField, MsTextArea, MsAvatar, MsSidebar, MsTooltip, MsPagination, MsSpinner, MsFileUploader, MsIcon, MsTopbar, MsTabs, MsBreadcrumb, MsFlagIcon,
|
|
3615
|
-
MsToaster, InlineSVGModule$1] });
|
|
3615
|
+
MsToaster, MsDatePicker, InlineSVGModule$1] });
|
|
3616
3616
|
}
|
|
3617
3617
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MsDesignSystemModule, decorators: [{
|
|
3618
3618
|
type: NgModule,
|
|
3619
3619
|
args: [{
|
|
3620
3620
|
imports: [InlineSVGModule$1.forRoot(), MsButton, MsDropdown, MsCheckbox, MsBadge, MsToggle, MsRadioButton, MsInputField, MsTextArea, MsAvatar, MsSidebar, MsTooltip, MsPagination, MsSpinner, MsFileUploader, MsTooltipDirective, MsIcon, MsTopbar, MsTabs, MsBreadcrumb, MsFlagIcon,
|
|
3621
|
-
MsCommentBox, MsToaster
|
|
3621
|
+
MsCommentBox, MsToaster, MsDatePicker
|
|
3622
3622
|
], // standalone components can be imported
|
|
3623
3623
|
exports: [InlineSVGModule$1, MsButton, MsDropdown, MsCheckbox, MsBadge, MsToggle, MsRadioButton, MsInputField, MsTextArea, MsAvatar, MsSidebar, MsTooltip, MsPagination, MsSpinner, MsFileUploader, MsIcon, MsTopbar, MsTabs, MsBreadcrumb, MsFlagIcon,
|
|
3624
|
-
MsCommentBox, MsToaster
|
|
3624
|
+
MsCommentBox, MsToaster, MsDatePicker
|
|
3625
3625
|
],
|
|
3626
3626
|
providers: [TopbarService],
|
|
3627
3627
|
}]
|
|
3628
3628
|
}] });
|
|
3629
3629
|
|
|
3630
|
+
class Calendar {
|
|
3631
|
+
mode = 'single';
|
|
3632
|
+
dateChange = new EventEmitter();
|
|
3633
|
+
selectedDate = null;
|
|
3634
|
+
fromDate = null;
|
|
3635
|
+
toDate = null;
|
|
3636
|
+
leftMonth = new Date().getMonth();
|
|
3637
|
+
leftYear = new Date().getFullYear();
|
|
3638
|
+
rightMonth = new Date().getMonth();
|
|
3639
|
+
rightYear = new Date().getFullYear();
|
|
3640
|
+
monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
3641
|
+
today = new Date();
|
|
3642
|
+
ngOnInit() { }
|
|
3643
|
+
prevMonth(side) {
|
|
3644
|
+
if (this.mode === 'single') {
|
|
3645
|
+
if (this.leftMonth === 0) {
|
|
3646
|
+
this.leftMonth = 11;
|
|
3647
|
+
this.leftYear--;
|
|
3648
|
+
}
|
|
3649
|
+
else
|
|
3650
|
+
this.leftMonth--;
|
|
3651
|
+
}
|
|
3652
|
+
else {
|
|
3653
|
+
if (side === 'left') {
|
|
3654
|
+
if (this.leftMonth === 0) {
|
|
3655
|
+
this.leftMonth = 11;
|
|
3656
|
+
this.leftYear--;
|
|
3657
|
+
}
|
|
3658
|
+
else
|
|
3659
|
+
this.leftMonth--;
|
|
3660
|
+
}
|
|
3661
|
+
else {
|
|
3662
|
+
if (this.rightMonth === 0) {
|
|
3663
|
+
this.rightMonth = 11;
|
|
3664
|
+
this.rightYear--;
|
|
3665
|
+
}
|
|
3666
|
+
else
|
|
3667
|
+
this.rightMonth--;
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
}
|
|
3671
|
+
nextMonth(side) {
|
|
3672
|
+
if (this.mode === 'single') {
|
|
3673
|
+
if (this.leftMonth === 11) {
|
|
3674
|
+
this.leftMonth = 0;
|
|
3675
|
+
this.leftYear++;
|
|
3676
|
+
}
|
|
3677
|
+
else
|
|
3678
|
+
this.leftMonth++;
|
|
3679
|
+
}
|
|
3680
|
+
else {
|
|
3681
|
+
if (side === 'left') {
|
|
3682
|
+
if (this.leftMonth === 11) {
|
|
3683
|
+
this.leftMonth = 0;
|
|
3684
|
+
this.leftYear++;
|
|
3685
|
+
}
|
|
3686
|
+
else
|
|
3687
|
+
this.leftMonth++;
|
|
3688
|
+
}
|
|
3689
|
+
else {
|
|
3690
|
+
if (this.rightMonth === 11) {
|
|
3691
|
+
this.rightMonth = 0;
|
|
3692
|
+
this.rightYear++;
|
|
3693
|
+
}
|
|
3694
|
+
else
|
|
3695
|
+
this.rightMonth++;
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
}
|
|
3699
|
+
// Select date
|
|
3700
|
+
select(date) {
|
|
3701
|
+
if (this.mode === 'single') {
|
|
3702
|
+
this.selectedDate = date;
|
|
3703
|
+
this.dateChange.emit(date);
|
|
3704
|
+
}
|
|
3705
|
+
else {
|
|
3706
|
+
if (!this.fromDate || this.toDate) {
|
|
3707
|
+
this.fromDate = date;
|
|
3708
|
+
this.toDate = null;
|
|
3709
|
+
}
|
|
3710
|
+
else {
|
|
3711
|
+
this.toDate = date;
|
|
3712
|
+
if (this.fromDate.getTime() > this.toDate.getTime()) {
|
|
3713
|
+
// [this.fromDate, this.toDate] = [this.toDate, this.fromDate];
|
|
3714
|
+
this.fromDate = date;
|
|
3715
|
+
this.toDate = null;
|
|
3716
|
+
}
|
|
3717
|
+
// this.dateChange.emit({ from: this.fromDate, to: this.toDate });
|
|
3718
|
+
// if (this.fromDate && this.toDate) this.dateChange.emit({ from: this.fromDate, to: this.toDate });
|
|
3719
|
+
// else if (this.fromDate) this.dateChange.emit({ from: this.fromDate, to: this.fromDate });
|
|
3720
|
+
}
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
getDayClasses(day, index, allDays) {
|
|
3724
|
+
let classes = '';
|
|
3725
|
+
if (this.isInRange(day.date))
|
|
3726
|
+
classes += ' range';
|
|
3727
|
+
if (this.isToday(day.date))
|
|
3728
|
+
classes += ' today';
|
|
3729
|
+
if (day.type !== 'current')
|
|
3730
|
+
classes += ' disabled';
|
|
3731
|
+
const rowStartIndex = Math.floor(index / 7) * 7;
|
|
3732
|
+
const rowEndIndex = rowStartIndex + 6;
|
|
3733
|
+
const rowDays = allDays.slice(rowStartIndex, rowEndIndex + 1);
|
|
3734
|
+
const firstInRange = rowDays.find(d => this.isInRange(d.date));
|
|
3735
|
+
const lastInRange = [...rowDays].reverse().find(d => this.isInRange(d.date));
|
|
3736
|
+
if (firstInRange && day.date.getTime() === firstInRange.date.getTime()) {
|
|
3737
|
+
classes += ' range-start';
|
|
3738
|
+
}
|
|
3739
|
+
if (lastInRange && day.date.getTime() === lastInRange.date.getTime()) {
|
|
3740
|
+
classes += ' range-end';
|
|
3741
|
+
}
|
|
3742
|
+
if (this.fromDate && day.date.getTime() === this.fromDate.getTime()) {
|
|
3743
|
+
classes += ' range-first';
|
|
3744
|
+
}
|
|
3745
|
+
if (this.toDate && day.date.getTime() === this.toDate.getTime()) {
|
|
3746
|
+
classes += ' range-last';
|
|
3747
|
+
}
|
|
3748
|
+
return classes;
|
|
3749
|
+
}
|
|
3750
|
+
onCancel() {
|
|
3751
|
+
this.fromDate = null;
|
|
3752
|
+
this.toDate = null;
|
|
3753
|
+
this.dateChange.emit({ from: null, to: null });
|
|
3754
|
+
}
|
|
3755
|
+
onApply() {
|
|
3756
|
+
if (this.fromDate && this.toDate) {
|
|
3757
|
+
this.dateChange.emit({ from: this.fromDate, to: this.toDate });
|
|
3758
|
+
}
|
|
3759
|
+
else if (this.fromDate) {
|
|
3760
|
+
this.dateChange.emit({ from: this.fromDate, to: this.fromDate });
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
isSameDate(d1, d2) {
|
|
3764
|
+
if (!d1 || !d2)
|
|
3765
|
+
return false;
|
|
3766
|
+
return d1.getFullYear() === d2.getFullYear() &&
|
|
3767
|
+
d1.getMonth() === d2.getMonth() &&
|
|
3768
|
+
d1.getDate() === d2.getDate();
|
|
3769
|
+
}
|
|
3770
|
+
isToday(date) {
|
|
3771
|
+
return this.isSameDate(date, this.today);
|
|
3772
|
+
}
|
|
3773
|
+
isInRange(date) {
|
|
3774
|
+
if (!this.fromDate || !this.toDate)
|
|
3775
|
+
return false;
|
|
3776
|
+
return date >= this.fromDate && date <= this.toDate;
|
|
3777
|
+
}
|
|
3778
|
+
isRowRangeStart(index, allDays) {
|
|
3779
|
+
const rowStartIndex = Math.floor(index / 7) * 7;
|
|
3780
|
+
const rowEndIndex = rowStartIndex + 6;
|
|
3781
|
+
const rowDays = allDays.slice(rowStartIndex, rowEndIndex + 1);
|
|
3782
|
+
const firstInRange = rowDays.find(d => this.isInRange(d.date));
|
|
3783
|
+
return firstInRange ? firstInRange.date.getTime() === allDays[index].date.getTime() : false;
|
|
3784
|
+
}
|
|
3785
|
+
// Get last in-range day of the row
|
|
3786
|
+
isRowRangeEnd(index, allDays) {
|
|
3787
|
+
const rowStartIndex = Math.floor(index / 7) * 7;
|
|
3788
|
+
const rowEndIndex = rowStartIndex + 6;
|
|
3789
|
+
const rowDays = allDays.slice(rowStartIndex, rowEndIndex + 1);
|
|
3790
|
+
const lastInRange = [...rowDays].reverse().find(d => this.isInRange(d.date));
|
|
3791
|
+
return lastInRange ? lastInRange.date.getTime() === allDays[index].date.getTime() : false;
|
|
3792
|
+
}
|
|
3793
|
+
getDays(month, year) {
|
|
3794
|
+
const days = [];
|
|
3795
|
+
const firstDay = new Date(year, month, 1).getDay();
|
|
3796
|
+
const lastDate = new Date(year, month + 1, 0).getDate();
|
|
3797
|
+
const prevMonth = month === 0 ? 11 : month - 1;
|
|
3798
|
+
const prevYear = month === 0 ? year - 1 : year;
|
|
3799
|
+
const prevLastDate = new Date(year, month, 0).getDate();
|
|
3800
|
+
// Previous month padding
|
|
3801
|
+
for (let i = firstDay - 1; i >= 0; i--) {
|
|
3802
|
+
days.push({ date: new Date(prevYear, prevMonth, prevLastDate - i), type: 'prev' });
|
|
3803
|
+
}
|
|
3804
|
+
// Current month
|
|
3805
|
+
for (let d = 1; d <= lastDate; d++) {
|
|
3806
|
+
days.push({ date: new Date(year, month, d), type: 'current' });
|
|
3807
|
+
}
|
|
3808
|
+
// const totalCellsNeeded = 5 * 7; // 5 rows × 7 columns = 35 cells
|
|
3809
|
+
const totalCellsNeeded = 6 * 7; // 6 rows × 7 columns = 42 cells
|
|
3810
|
+
const nextMonth = month === 11 ? 0 : month + 1;
|
|
3811
|
+
const nextYear = month === 11 ? year + 1 : year;
|
|
3812
|
+
const nextDaysCount = totalCellsNeeded - days.length;
|
|
3813
|
+
for (let i = 1; i <= nextDaysCount; i++) {
|
|
3814
|
+
days.push({ date: new Date(nextYear, nextMonth, i), type: 'next' });
|
|
3815
|
+
}
|
|
3816
|
+
return days;
|
|
3817
|
+
}
|
|
3818
|
+
get leftDays() { return this.getDays(this.leftMonth, this.leftYear); }
|
|
3819
|
+
get rightDays() { return this.getDays(this.rightMonth, this.rightYear); }
|
|
3820
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Calendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3821
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: Calendar, isStandalone: true, selector: "app-calendar", inputs: { mode: "mode", selectedDate: "selectedDate", fromDate: "fromDate", toDate: "toDate", leftMonth: "leftMonth", leftYear: "leftYear", rightMonth: "rightMonth", rightYear: "rightYear" }, outputs: { dateChange: "dateChange" }, ngImport: i0, template: "<div class=\"calendar-wrapper\">\n\n <!-- SINGLE MODE -->\n <ng-container *ngIf=\"mode==='single'\">\n <div class=\"calendar single-calendar\">\n <div class=\"header\">\n <strong>{{ monthNames[leftMonth] }} {{ leftYear }}</strong>\n <div class=\"icons\">\n <!-- <span class=\"icon\" (click)=\"prevMonth()\"><</span> -->\n <!-- <span class=\"icon\" (click)=\"nextMonth()\">></span> -->\n <ms-icon class=\"icon rotate-180\" (click)=\"prevMonth()\" [name]=\"'chevron-right'\"></ms-icon>\n <ms-icon class=\"icon\" (click)=\"nextMonth()\" [name]=\"'chevron-right'\"></ms-icon>\n </div>\n </div>\n <div class=\"grid\">\n <div class=\"day-name\" *ngFor=\"let d of ['Su','Mo','Tu','We','Th','Fr','Sa']\"><strong>{{ d }}</strong>\n </div>\n <div class=\"day\" *ngFor=\"let d of getDays(leftMonth, leftYear)\"\n [class.selected]=\"isSameDate(d.date, selectedDate)\" [class.today]=\"isToday(d.date)\"\n [class.disabled]=\"d.type!=='current'\" (mousedown)=\"d.type==='current' && select(d.date)\">\n {{ d.date.getDate() }}\n <span *ngIf=\"isToday(d.date)\" class=\"dot\"\n [style.background-color]=\"isSameDate(d.date, selectedDate) ? '#fff' : '#0084FF'\"></span>\n </div>\n </div>\n </div>\n </ng-container>\n\n\n <ng-container *ngIf=\"mode === 'range'\">\n <div class=\"range-calendar\">\n\n <div class=\"calendars\">\n\n <!-- LEFT CALENDAR -->\n <div class=\"calendar\">\n <div class=\"header\">\n <strong>{{ monthNames[leftMonth] }} {{ leftYear }}</strong>\n <div class=\"icons\">\n <!-- <span class=\"icon\" (click)=\"prevMonth('left')\"><</span>\n <span class=\"icon\" (click)=\"nextMonth('left')\">></span> -->\n <ms-icon class=\"icon rotate-180\" (click)=\"prevMonth('left')\" [name]=\"'chevron-right'\"></ms-icon>\n <ms-icon class=\"icon\" (click)=\"nextMonth('left')\" [name]=\"'chevron-right'\"></ms-icon>\n </div>\n </div>\n\n <div class=\"grid\">\n <!-- Day names -->\n <div class=\"day-name\" *ngFor=\"let d of ['Su','Mo','Tu','We','Th','Fr','Sa']\">\n <strong>{{ d }}</strong>\n </div>\n\n <!-- Days -->\n <div *ngFor=\"let d of leftDays; let i = index\" [ngClass]=\"{\n 'is-in-range': isInRange(d.date),\n 'range-start': isRowRangeStart(i, leftDays),\n 'range-end': isRowRangeEnd(i, leftDays)\n }\" (click)=\"d.type === 'current' && select(d.date)\" class=\"day-outer\">\n\n <div class=\"day\" [ngClass]=\"getDayClasses(d, i, leftDays)\">\n <span>{{ d.date.getDate() }}</span>\n <span *ngIf=\"isToday(d.date)\" class=\"dot\"\n [style.background-color]=\"(isInRange(d.date) && (isSameDate(d.date, fromDate) || isSameDate(d.date, toDate))) ? '#fff' : '#0084FF'\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n <!-- RIGHT CALENDAR -->\n <div class=\"calendar\">\n <div class=\"header\">\n <strong>{{ monthNames[rightMonth] }} {{ rightYear }}</strong>\n <div class=\"icons\">\n <!-- <span class=\"icon\" (click)=\"prevMonth('right')\"><</span>\n <span class=\"icon\" (click)=\"nextMonth('right')\">></span> -->\n <ms-icon class=\"icon rotate-180\" (click)=\"prevMonth('right')\" [name]=\"'chevron-right'\"></ms-icon>\n <ms-icon class=\"icon\" (click)=\"nextMonth('right')\" [name]=\"'chevron-right'\"></ms-icon>\n </div>\n </div>\n\n <div class=\"grid\">\n <!-- Day names -->\n <div class=\"day-name\" *ngFor=\"let d of ['Su','Mo','Tu','We','Th','Fr','Sa']\">\n <strong>{{ d }}</strong>\n </div>\n\n <!-- Days -->\n <div *ngFor=\"let d of rightDays; let i = index\" [ngClass]=\"{\n 'is-in-range': isInRange(d.date),\n 'range-start': isRowRangeStart(i, rightDays),\n 'range-end': isRowRangeEnd(i, rightDays)\n }\" (click)=\"d.type === 'current' && select(d.date)\" class=\"day-outer\">\n\n <div class=\"day\" [ngClass]=\"getDayClasses(d, i, rightDays)\">\n <span>{{ d.date.getDate() }}</span>\n <span *ngIf=\"isToday(d.date)\" class=\"dot\"\n [style.background-color]=\"(isInRange(d.date) && (isSameDate(d.date, fromDate) || isSameDate(d.date, toDate))) ? '#fff' : '#0084FF'\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n </div>\n\n <!-- RANGE ACTIONS -->\n <div class=\"range-actions\">\n <button class=\"btn cancel\" (click)=\"onCancel()\">Cancel</button>\n <button class=\"btn apply\" (click)=\"onApply()\">Apply</button>\n </div>\n\n </div>\n </ng-container>\n\n\n</div>", styles: [".calendar-wrapper{display:flex;flex-direction:column;margin-top:4px}.calendars{display:flex;width:616px}.calendar{width:312px;min-height:320px;background:#fff;border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:16px;box-sizing:border-box}.single-calendar{border:1px solid #E0E0E0;box-shadow:0 2px 12px #00000014;border-radius:12px;z-index:9999}.range-calendar{width:616px;height:440px;border:1px solid #E0E0E0;background:#fff;box-shadow:0 2px 12px #00000014;border-radius:12px;z-index:9999}.calendars .calendar{width:100%;background:#fff;border-radius:12px;display:flex;flex-direction:column;box-sizing:border-box}.header{width:100%;height:40px;display:flex;justify-content:space-between;align-items:center}.header strong{font-size:14px;font-weight:600}.icons{display:flex;gap:8px}.icon{width:40px;height:40px;display:flex;justify-content:center;align-items:center;font-size:20px;border-radius:8px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .2s}.icon:hover{background:#e0f0ff}.grid{display:grid;grid-template-columns:repeat(7,1fr);grid-column-gap:0;grid-row-gap:4px}.day-name{height:40px;display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:500;color:#1b1f22}.day{position:relative;width:100%;height:40px;display:flex;justify-content:center;align-items:center;font-size:14px;font-weight:500;line-height:18px;color:#1b1f22;cursor:pointer;box-sizing:border-box;transition:background .15s,border .15s}.day:hover{background:#e0f0ff;border:1px solid #0084FF;border-radius:8px;flex-direction:column;color:#0084ff}.day.today{color:#0084ff}.dot{position:absolute;bottom:4px;width:3px;height:3px;border-radius:1px;background-color:#0084ff}.day.selected{background:#007bff;color:#fff;border-radius:8px}.day.selected.today{color:#fff}.day.selected.today .dot{background-color:#fff}.is-in-range{background:#0084ff1a}.is-in-range.range-start{border-top-left-radius:8px;border-bottom-left-radius:8px}.is-in-range.range-end{border-top-right-radius:8px;border-bottom-right-radius:8px}.day.range-first{background:#0084ff;color:#fff;border:4px solid #0084FF;border-radius:8px!important;box-sizing:border-box}.day.range-last{background:#0084ff;color:#fff;border:4px solid #0084FF;border-radius:8px;box-sizing:border-box}.day.disabled{color:#aaa;cursor:default;background:none}.range-actions{width:595px;height:32px;display:flex;justify-content:flex-end;gap:8px}.range-actions .btn{height:32px;padding:0 12px;border-radius:8px;border:1px solid #E0E0E0;background:#fff;cursor:pointer;font-size:13px}.range-actions .btn.apply{background-color:#007bff;color:#fff;border:none}.rotate-180{transform:rotate(180deg)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MsDesignSystemModule }, { kind: "component", type: MsIcon, selector: "ms-icon", inputs: ["name", "color", "size"] }] });
|
|
3822
|
+
}
|
|
3823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Calendar, decorators: [{
|
|
3824
|
+
type: Component,
|
|
3825
|
+
args: [{ selector: 'app-calendar', imports: [CommonModule, MsDesignSystemModule], template: "<div class=\"calendar-wrapper\">\n\n <!-- SINGLE MODE -->\n <ng-container *ngIf=\"mode==='single'\">\n <div class=\"calendar single-calendar\">\n <div class=\"header\">\n <strong>{{ monthNames[leftMonth] }} {{ leftYear }}</strong>\n <div class=\"icons\">\n <!-- <span class=\"icon\" (click)=\"prevMonth()\"><</span> -->\n <!-- <span class=\"icon\" (click)=\"nextMonth()\">></span> -->\n <ms-icon class=\"icon rotate-180\" (click)=\"prevMonth()\" [name]=\"'chevron-right'\"></ms-icon>\n <ms-icon class=\"icon\" (click)=\"nextMonth()\" [name]=\"'chevron-right'\"></ms-icon>\n </div>\n </div>\n <div class=\"grid\">\n <div class=\"day-name\" *ngFor=\"let d of ['Su','Mo','Tu','We','Th','Fr','Sa']\"><strong>{{ d }}</strong>\n </div>\n <div class=\"day\" *ngFor=\"let d of getDays(leftMonth, leftYear)\"\n [class.selected]=\"isSameDate(d.date, selectedDate)\" [class.today]=\"isToday(d.date)\"\n [class.disabled]=\"d.type!=='current'\" (mousedown)=\"d.type==='current' && select(d.date)\">\n {{ d.date.getDate() }}\n <span *ngIf=\"isToday(d.date)\" class=\"dot\"\n [style.background-color]=\"isSameDate(d.date, selectedDate) ? '#fff' : '#0084FF'\"></span>\n </div>\n </div>\n </div>\n </ng-container>\n\n\n <ng-container *ngIf=\"mode === 'range'\">\n <div class=\"range-calendar\">\n\n <div class=\"calendars\">\n\n <!-- LEFT CALENDAR -->\n <div class=\"calendar\">\n <div class=\"header\">\n <strong>{{ monthNames[leftMonth] }} {{ leftYear }}</strong>\n <div class=\"icons\">\n <!-- <span class=\"icon\" (click)=\"prevMonth('left')\"><</span>\n <span class=\"icon\" (click)=\"nextMonth('left')\">></span> -->\n <ms-icon class=\"icon rotate-180\" (click)=\"prevMonth('left')\" [name]=\"'chevron-right'\"></ms-icon>\n <ms-icon class=\"icon\" (click)=\"nextMonth('left')\" [name]=\"'chevron-right'\"></ms-icon>\n </div>\n </div>\n\n <div class=\"grid\">\n <!-- Day names -->\n <div class=\"day-name\" *ngFor=\"let d of ['Su','Mo','Tu','We','Th','Fr','Sa']\">\n <strong>{{ d }}</strong>\n </div>\n\n <!-- Days -->\n <div *ngFor=\"let d of leftDays; let i = index\" [ngClass]=\"{\n 'is-in-range': isInRange(d.date),\n 'range-start': isRowRangeStart(i, leftDays),\n 'range-end': isRowRangeEnd(i, leftDays)\n }\" (click)=\"d.type === 'current' && select(d.date)\" class=\"day-outer\">\n\n <div class=\"day\" [ngClass]=\"getDayClasses(d, i, leftDays)\">\n <span>{{ d.date.getDate() }}</span>\n <span *ngIf=\"isToday(d.date)\" class=\"dot\"\n [style.background-color]=\"(isInRange(d.date) && (isSameDate(d.date, fromDate) || isSameDate(d.date, toDate))) ? '#fff' : '#0084FF'\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n <!-- RIGHT CALENDAR -->\n <div class=\"calendar\">\n <div class=\"header\">\n <strong>{{ monthNames[rightMonth] }} {{ rightYear }}</strong>\n <div class=\"icons\">\n <!-- <span class=\"icon\" (click)=\"prevMonth('right')\"><</span>\n <span class=\"icon\" (click)=\"nextMonth('right')\">></span> -->\n <ms-icon class=\"icon rotate-180\" (click)=\"prevMonth('right')\" [name]=\"'chevron-right'\"></ms-icon>\n <ms-icon class=\"icon\" (click)=\"nextMonth('right')\" [name]=\"'chevron-right'\"></ms-icon>\n </div>\n </div>\n\n <div class=\"grid\">\n <!-- Day names -->\n <div class=\"day-name\" *ngFor=\"let d of ['Su','Mo','Tu','We','Th','Fr','Sa']\">\n <strong>{{ d }}</strong>\n </div>\n\n <!-- Days -->\n <div *ngFor=\"let d of rightDays; let i = index\" [ngClass]=\"{\n 'is-in-range': isInRange(d.date),\n 'range-start': isRowRangeStart(i, rightDays),\n 'range-end': isRowRangeEnd(i, rightDays)\n }\" (click)=\"d.type === 'current' && select(d.date)\" class=\"day-outer\">\n\n <div class=\"day\" [ngClass]=\"getDayClasses(d, i, rightDays)\">\n <span>{{ d.date.getDate() }}</span>\n <span *ngIf=\"isToday(d.date)\" class=\"dot\"\n [style.background-color]=\"(isInRange(d.date) && (isSameDate(d.date, fromDate) || isSameDate(d.date, toDate))) ? '#fff' : '#0084FF'\"></span>\n </div>\n\n </div>\n </div>\n </div>\n\n </div>\n\n <!-- RANGE ACTIONS -->\n <div class=\"range-actions\">\n <button class=\"btn cancel\" (click)=\"onCancel()\">Cancel</button>\n <button class=\"btn apply\" (click)=\"onApply()\">Apply</button>\n </div>\n\n </div>\n </ng-container>\n\n\n</div>", styles: [".calendar-wrapper{display:flex;flex-direction:column;margin-top:4px}.calendars{display:flex;width:616px}.calendar{width:312px;min-height:320px;background:#fff;border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:16px;box-sizing:border-box}.single-calendar{border:1px solid #E0E0E0;box-shadow:0 2px 12px #00000014;border-radius:12px;z-index:9999}.range-calendar{width:616px;height:440px;border:1px solid #E0E0E0;background:#fff;box-shadow:0 2px 12px #00000014;border-radius:12px;z-index:9999}.calendars .calendar{width:100%;background:#fff;border-radius:12px;display:flex;flex-direction:column;box-sizing:border-box}.header{width:100%;height:40px;display:flex;justify-content:space-between;align-items:center}.header strong{font-size:14px;font-weight:600}.icons{display:flex;gap:8px}.icon{width:40px;height:40px;display:flex;justify-content:center;align-items:center;font-size:20px;border-radius:8px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .2s}.icon:hover{background:#e0f0ff}.grid{display:grid;grid-template-columns:repeat(7,1fr);grid-column-gap:0;grid-row-gap:4px}.day-name{height:40px;display:flex;justify-content:center;align-items:center;font-size:12px;font-weight:500;color:#1b1f22}.day{position:relative;width:100%;height:40px;display:flex;justify-content:center;align-items:center;font-size:14px;font-weight:500;line-height:18px;color:#1b1f22;cursor:pointer;box-sizing:border-box;transition:background .15s,border .15s}.day:hover{background:#e0f0ff;border:1px solid #0084FF;border-radius:8px;flex-direction:column;color:#0084ff}.day.today{color:#0084ff}.dot{position:absolute;bottom:4px;width:3px;height:3px;border-radius:1px;background-color:#0084ff}.day.selected{background:#007bff;color:#fff;border-radius:8px}.day.selected.today{color:#fff}.day.selected.today .dot{background-color:#fff}.is-in-range{background:#0084ff1a}.is-in-range.range-start{border-top-left-radius:8px;border-bottom-left-radius:8px}.is-in-range.range-end{border-top-right-radius:8px;border-bottom-right-radius:8px}.day.range-first{background:#0084ff;color:#fff;border:4px solid #0084FF;border-radius:8px!important;box-sizing:border-box}.day.range-last{background:#0084ff;color:#fff;border:4px solid #0084FF;border-radius:8px;box-sizing:border-box}.day.disabled{color:#aaa;cursor:default;background:none}.range-actions{width:595px;height:32px;display:flex;justify-content:flex-end;gap:8px}.range-actions .btn{height:32px;padding:0 12px;border-radius:8px;border:1px solid #E0E0E0;background:#fff;cursor:pointer;font-size:13px}.range-actions .btn.apply{background-color:#007bff;color:#fff;border:none}.rotate-180{transform:rotate(180deg)}\n"] }]
|
|
3826
|
+
}], propDecorators: { mode: [{
|
|
3827
|
+
type: Input
|
|
3828
|
+
}], dateChange: [{
|
|
3829
|
+
type: Output
|
|
3830
|
+
}], selectedDate: [{
|
|
3831
|
+
type: Input
|
|
3832
|
+
}], fromDate: [{
|
|
3833
|
+
type: Input
|
|
3834
|
+
}], toDate: [{
|
|
3835
|
+
type: Input
|
|
3836
|
+
}], leftMonth: [{
|
|
3837
|
+
type: Input
|
|
3838
|
+
}], leftYear: [{
|
|
3839
|
+
type: Input
|
|
3840
|
+
}], rightMonth: [{
|
|
3841
|
+
type: Input
|
|
3842
|
+
}], rightYear: [{
|
|
3843
|
+
type: Input
|
|
3844
|
+
}] } });
|
|
3845
|
+
|
|
3846
|
+
class MsDatePicker {
|
|
3847
|
+
_value = ['', ''];
|
|
3848
|
+
container;
|
|
3849
|
+
required = false;
|
|
3850
|
+
readonly = false;
|
|
3851
|
+
pattern = '';
|
|
3852
|
+
skeleton = false;
|
|
3853
|
+
prefix = '';
|
|
3854
|
+
dateType = 'datepicker';
|
|
3855
|
+
disabled = false;
|
|
3856
|
+
invalid = false;
|
|
3857
|
+
selectedSate = '';
|
|
3858
|
+
minDate = '';
|
|
3859
|
+
maxDate = '';
|
|
3860
|
+
mode = 'single';
|
|
3861
|
+
dateChange = new EventEmitter();
|
|
3862
|
+
isCalendarOpen = false;
|
|
3863
|
+
hoveredDate = null;
|
|
3864
|
+
showCalendar = false;
|
|
3865
|
+
leftMonth = new Date().getMonth();
|
|
3866
|
+
leftYear = new Date().getFullYear();
|
|
3867
|
+
rightMonth = new Date().getMonth();
|
|
3868
|
+
rightYear = new Date().getFullYear();
|
|
3869
|
+
onInputClick(event) {
|
|
3870
|
+
event.stopPropagation();
|
|
3871
|
+
this.open('single');
|
|
3872
|
+
}
|
|
3873
|
+
open(mode, field) {
|
|
3874
|
+
if (this.mode !== mode) {
|
|
3875
|
+
this.mode = mode;
|
|
3876
|
+
this.showCalendar = true;
|
|
3877
|
+
return;
|
|
3878
|
+
}
|
|
3879
|
+
this.showCalendar = !this.showCalendar;
|
|
3880
|
+
}
|
|
3881
|
+
field = 'from';
|
|
3882
|
+
singleDateValue = '';
|
|
3883
|
+
// singleDate: string = '';
|
|
3884
|
+
rangeDate = '';
|
|
3885
|
+
fromDateInput = '';
|
|
3886
|
+
toDateInput = '';
|
|
3887
|
+
onDateChange(value) {
|
|
3888
|
+
if (this.mode === 'single' && value instanceof Date) {
|
|
3889
|
+
this.singleDateValue = this.formatDate(value);
|
|
3890
|
+
this.dateChange.emit(this.singleDateValue);
|
|
3891
|
+
}
|
|
3892
|
+
if (this.mode === 'range') {
|
|
3893
|
+
if (this.dateType === 'daterange') {
|
|
3894
|
+
// single input range
|
|
3895
|
+
if (value?.from && value?.to) {
|
|
3896
|
+
this.rangeDate = `${this.formatDate(value.from)} - ${this.formatDate(value.to)}`;
|
|
3897
|
+
this.dateChange.emit(this.rangeDate);
|
|
3898
|
+
}
|
|
3899
|
+
else {
|
|
3900
|
+
this.rangeDate = '';
|
|
3901
|
+
}
|
|
3902
|
+
}
|
|
3903
|
+
else if (this.dateType === 'daterange-dual') {
|
|
3904
|
+
// dual input range
|
|
3905
|
+
if (this.field === 'from' && value instanceof Date)
|
|
3906
|
+
this.fromDateInput = this.formatDate(value);
|
|
3907
|
+
if (this.field === 'to' && value instanceof Date)
|
|
3908
|
+
this.toDateInput = this.formatDate(value);
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
get singleDate() {
|
|
3913
|
+
return this.singleDateValue;
|
|
3914
|
+
}
|
|
3915
|
+
set singleDate(value) {
|
|
3916
|
+
const regex = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/;
|
|
3917
|
+
this.singleDateValue = regex.test(value) ? value : '';
|
|
3918
|
+
}
|
|
3919
|
+
formatDate(date) {
|
|
3920
|
+
const mm = String(date.getMonth() + 1).padStart(2, '0');
|
|
3921
|
+
const dd = String(date.getDate()).padStart(2, '0');
|
|
3922
|
+
const yyyy = date.getFullYear();
|
|
3923
|
+
return `${mm}/${dd}/${yyyy}`;
|
|
3924
|
+
}
|
|
3925
|
+
onDocumentClick(event) {
|
|
3926
|
+
if (!this.container.nativeElement.contains(event.target)) {
|
|
3927
|
+
this.showCalendar = false;
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
selectedDate = null;
|
|
3931
|
+
fromDate = null;
|
|
3932
|
+
toDate = null;
|
|
3933
|
+
onSingleDateInput(event) {
|
|
3934
|
+
const input = event.target;
|
|
3935
|
+
const rawValue = input.value;
|
|
3936
|
+
// Format the typed value leniently
|
|
3937
|
+
input.value = this.formatTypingDate(rawValue);
|
|
3938
|
+
this.singleDate = input.value;
|
|
3939
|
+
// Only update calendar if input has at least month and day
|
|
3940
|
+
if (this.singleDate.length >= 5) { // MM/DD at least
|
|
3941
|
+
const date = this.parseDateString(this.singleDate);
|
|
3942
|
+
if (date) {
|
|
3943
|
+
this.selectedDate = date;
|
|
3944
|
+
this.leftMonth = date.getMonth();
|
|
3945
|
+
this.leftYear = date.getFullYear();
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
onRangeDateInput(event) {
|
|
3950
|
+
const input = event.target;
|
|
3951
|
+
input.value = this.formatTypingRangeDate(input.value);
|
|
3952
|
+
this.rangeDate = input.value;
|
|
3953
|
+
const parts = input.value.split('-');
|
|
3954
|
+
if (parts[0]) {
|
|
3955
|
+
const from = this.parseDateString(parts[0].trim());
|
|
3956
|
+
if (from) {
|
|
3957
|
+
this.fromDate = from;
|
|
3958
|
+
this.leftMonth = from.getMonth();
|
|
3959
|
+
this.leftYear = from.getFullYear();
|
|
3960
|
+
}
|
|
3961
|
+
}
|
|
3962
|
+
if (parts[1]) {
|
|
3963
|
+
const to = this.parseDateString(parts[1].trim());
|
|
3964
|
+
if (to) {
|
|
3965
|
+
this.toDate = to;
|
|
3966
|
+
this.rightMonth = to.getMonth();
|
|
3967
|
+
this.rightYear = to.getFullYear();
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
}
|
|
3971
|
+
onDualDateInput(event, field) {
|
|
3972
|
+
const formatted = this.formatTypingDate(event.target.value);
|
|
3973
|
+
if (field === 'from')
|
|
3974
|
+
this.fromDateInput = formatted;
|
|
3975
|
+
else
|
|
3976
|
+
this.toDateInput = formatted;
|
|
3977
|
+
}
|
|
3978
|
+
// onSingleDateBlur() {
|
|
3979
|
+
// if (!this.isValidDate(this.singleDate)) {
|
|
3980
|
+
// this.singleDate = '';
|
|
3981
|
+
// this.selectedDate = null;
|
|
3982
|
+
// }
|
|
3983
|
+
// if (this.singleDate && !this.isValidDate(this.singleDate)) {
|
|
3984
|
+
// this.selectedDate = null;
|
|
3985
|
+
// }
|
|
3986
|
+
// }
|
|
3987
|
+
// onRangeDateBlur() {
|
|
3988
|
+
// if (!this.isValidDate(this.rangeDate)) this.rangeDate = '';
|
|
3989
|
+
// }
|
|
3990
|
+
onDualDateBlur(field) {
|
|
3991
|
+
if (field === 'from' && !this.isValidDate(this.fromDateInput))
|
|
3992
|
+
this.fromDateInput = '';
|
|
3993
|
+
if (field === 'to' && !this.isValidDate(this.toDateInput))
|
|
3994
|
+
this.toDateInput = '';
|
|
3995
|
+
}
|
|
3996
|
+
formatTypingRangeDate(value) {
|
|
3997
|
+
let cleanValue = value.replace(/[^0-9-]/g, '');
|
|
3998
|
+
// Ensure only one dash exists (prevent multiple)
|
|
3999
|
+
const dashIndex = cleanValue.indexOf('-');
|
|
4000
|
+
let firstPart = '';
|
|
4001
|
+
let secondPart = '';
|
|
4002
|
+
if (dashIndex >= 0) {
|
|
4003
|
+
firstPart = cleanValue.substring(0, dashIndex).trim();
|
|
4004
|
+
secondPart = cleanValue.substring(dashIndex + 1).trim();
|
|
4005
|
+
}
|
|
4006
|
+
else {
|
|
4007
|
+
firstPart = cleanValue;
|
|
4008
|
+
}
|
|
4009
|
+
const first = this.formatTypingDateForRange(firstPart);
|
|
4010
|
+
const second = secondPart ? this.formatTypingDateForRange(secondPart) : '';
|
|
4011
|
+
return second ? `${first} - ${second}` : first;
|
|
4012
|
+
}
|
|
4013
|
+
formatTypingDateForRange(value) {
|
|
4014
|
+
// Keep only digits and dash
|
|
4015
|
+
let clean = value.replace(/[^0-9-]/g, '');
|
|
4016
|
+
// Split by the first dash
|
|
4017
|
+
const dashIndex = clean.indexOf('-');
|
|
4018
|
+
let firstPart = '';
|
|
4019
|
+
let secondPart = '';
|
|
4020
|
+
if (dashIndex >= 0) {
|
|
4021
|
+
firstPart = clean.substring(0, dashIndex).trim();
|
|
4022
|
+
secondPart = clean.substring(dashIndex + 1).trim();
|
|
4023
|
+
}
|
|
4024
|
+
else {
|
|
4025
|
+
firstPart = clean;
|
|
4026
|
+
}
|
|
4027
|
+
// Format each part independently
|
|
4028
|
+
const first = this.formatTypingDatePart(firstPart);
|
|
4029
|
+
const second = secondPart ? this.formatTypingDatePart(secondPart) : '';
|
|
4030
|
+
// Join with dash if second exists
|
|
4031
|
+
return second ? `${first} - ${second}` : first;
|
|
4032
|
+
}
|
|
4033
|
+
// private formatTypingDatePart(value: string): string {
|
|
4034
|
+
// let digits = value.replace(/\D/g, '').substring(0, 8); // MMDDYYYY max
|
|
4035
|
+
// let mm = '';
|
|
4036
|
+
// let dd = '';
|
|
4037
|
+
// let yyyy = '';
|
|
4038
|
+
// // Month
|
|
4039
|
+
// if (digits.length >= 1) {
|
|
4040
|
+
// mm = digits.substring(0, 2);
|
|
4041
|
+
// if (parseInt(mm) > 12) mm = '12';
|
|
4042
|
+
// }
|
|
4043
|
+
// // Day
|
|
4044
|
+
// if (digits.length >= 3) {
|
|
4045
|
+
// dd = digits.substring(2, 4);
|
|
4046
|
+
// if (parseInt(dd) > 31) dd = '31';
|
|
4047
|
+
// } else if (digits.length > 2) {
|
|
4048
|
+
// dd = digits.substring(2);
|
|
4049
|
+
// }
|
|
4050
|
+
// // Year
|
|
4051
|
+
// if (digits.length > 4) {
|
|
4052
|
+
// yyyy = digits.substring(4, 8);
|
|
4053
|
+
// if (yyyy.length === 4) {
|
|
4054
|
+
// let yearNum = parseInt(yyyy);
|
|
4055
|
+
// if (yearNum < 1900) yearNum = 1900;
|
|
4056
|
+
// if (yearNum > 2099) yearNum = 2099;
|
|
4057
|
+
// yyyy = yearNum.toString();
|
|
4058
|
+
// }
|
|
4059
|
+
// }
|
|
4060
|
+
// let formatted = mm;
|
|
4061
|
+
// if (dd) formatted += '/' + dd;
|
|
4062
|
+
// if (yyyy) formatted += '/' + yyyy;
|
|
4063
|
+
// // Limit to 10 characters
|
|
4064
|
+
// return formatted.substring(0, 10);
|
|
4065
|
+
// }
|
|
4066
|
+
formatTypingDatePart(value) {
|
|
4067
|
+
let digits = value.replace(/\D/g, '').substring(0, 8); // MMDDYYYY
|
|
4068
|
+
let mm = '';
|
|
4069
|
+
let dd = '';
|
|
4070
|
+
let yyyy = '';
|
|
4071
|
+
// Helpers
|
|
4072
|
+
const isLeapYear = (year) => (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
4073
|
+
const getMaxDays = (month, year) => {
|
|
4074
|
+
if (month === 2)
|
|
4075
|
+
return isLeapYear(year) ? 29 : 28;
|
|
4076
|
+
if ([4, 6, 9, 11].includes(month))
|
|
4077
|
+
return 30;
|
|
4078
|
+
return 31;
|
|
4079
|
+
};
|
|
4080
|
+
// Month
|
|
4081
|
+
if (digits.length >= 1) {
|
|
4082
|
+
mm = digits.substring(0, 2);
|
|
4083
|
+
if (parseInt(mm) > 12)
|
|
4084
|
+
mm = '12';
|
|
4085
|
+
}
|
|
4086
|
+
// Year (needed for Feb validation)
|
|
4087
|
+
if (digits.length > 4) {
|
|
4088
|
+
yyyy = digits.substring(4, 8);
|
|
4089
|
+
if (yyyy.length === 4) {
|
|
4090
|
+
let yearNum = parseInt(yyyy);
|
|
4091
|
+
if (yearNum < 1900)
|
|
4092
|
+
yearNum = 1900;
|
|
4093
|
+
if (yearNum > 2099)
|
|
4094
|
+
yearNum = 2099;
|
|
4095
|
+
yyyy = yearNum.toString();
|
|
4096
|
+
}
|
|
4097
|
+
}
|
|
4098
|
+
const monthNum = parseInt(mm);
|
|
4099
|
+
const yearNum = yyyy.length === 4 ? parseInt(yyyy) : new Date().getFullYear();
|
|
4100
|
+
// Day (month-wise validation)
|
|
4101
|
+
if (digits.length >= 3) {
|
|
4102
|
+
dd = digits.substring(2, 4);
|
|
4103
|
+
if (!isNaN(monthNum)) {
|
|
4104
|
+
const maxDays = getMaxDays(monthNum, yearNum);
|
|
4105
|
+
if (parseInt(dd) > maxDays) {
|
|
4106
|
+
dd = maxDays.toString().padStart(2, '0');
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
4110
|
+
else if (digits.length > 2) {
|
|
4111
|
+
dd = digits.substring(2);
|
|
4112
|
+
}
|
|
4113
|
+
// Format output
|
|
4114
|
+
let formatted = mm;
|
|
4115
|
+
if (dd)
|
|
4116
|
+
formatted += '/' + dd;
|
|
4117
|
+
if (yyyy)
|
|
4118
|
+
formatted += '/' + yyyy;
|
|
4119
|
+
return formatted.substring(0, 10); // MM/DD/YYYY
|
|
4120
|
+
}
|
|
4121
|
+
formatTypingDate(value) {
|
|
4122
|
+
let digits = value.replace(/\D/g, '').substring(0, 8); // MMDDYYYY
|
|
4123
|
+
let mm = '';
|
|
4124
|
+
let dd = '';
|
|
4125
|
+
let yyyy = '';
|
|
4126
|
+
// Helpers
|
|
4127
|
+
const isLeapYear = (year) => (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
|
|
4128
|
+
const getMaxDays = (month, year) => {
|
|
4129
|
+
if (month === 2)
|
|
4130
|
+
return isLeapYear(year) ? 29 : 28;
|
|
4131
|
+
if ([4, 6, 9, 11].includes(month))
|
|
4132
|
+
return 30;
|
|
4133
|
+
return 31;
|
|
4134
|
+
};
|
|
4135
|
+
// Month
|
|
4136
|
+
if (digits.length >= 1) {
|
|
4137
|
+
mm = digits.substring(0, 2);
|
|
4138
|
+
if (parseInt(mm) > 12)
|
|
4139
|
+
mm = '12';
|
|
4140
|
+
}
|
|
4141
|
+
// Year (needed for Feb validation)
|
|
4142
|
+
if (digits.length > 4) {
|
|
4143
|
+
yyyy = digits.substring(4, 8);
|
|
4144
|
+
if (yyyy.length === 4) {
|
|
4145
|
+
let yearNum = parseInt(yyyy);
|
|
4146
|
+
if (yearNum < 1900)
|
|
4147
|
+
yearNum = 1900;
|
|
4148
|
+
if (yearNum > 2099)
|
|
4149
|
+
yearNum = 2099;
|
|
4150
|
+
yyyy = yearNum.toString();
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
const monthNum = parseInt(mm);
|
|
4154
|
+
const yearNum = yyyy.length === 4 ? parseInt(yyyy) : new Date().getFullYear();
|
|
4155
|
+
// Day (month-wise validation)
|
|
4156
|
+
if (digits.length >= 3) {
|
|
4157
|
+
dd = digits.substring(2, 4);
|
|
4158
|
+
if (!isNaN(monthNum)) {
|
|
4159
|
+
const maxDays = getMaxDays(monthNum, yearNum);
|
|
4160
|
+
if (parseInt(dd) > maxDays) {
|
|
4161
|
+
dd = maxDays.toString().padStart(2, '0');
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
}
|
|
4165
|
+
else if (digits.length > 2) {
|
|
4166
|
+
dd = digits.substring(2);
|
|
4167
|
+
}
|
|
4168
|
+
// Format output
|
|
4169
|
+
let formatted = mm;
|
|
4170
|
+
if (dd)
|
|
4171
|
+
formatted += '/' + dd;
|
|
4172
|
+
if (yyyy)
|
|
4173
|
+
formatted += '/' + yyyy;
|
|
4174
|
+
return formatted.substring(0, 10); // MM/DD/YYYY
|
|
4175
|
+
}
|
|
4176
|
+
// private formatTypingDate(value: string): string {
|
|
4177
|
+
// let digits = value.replace(/\D/g, '').substring(0, 8);
|
|
4178
|
+
// let mm = '';
|
|
4179
|
+
// let dd = '';
|
|
4180
|
+
// let yyyy = '';
|
|
4181
|
+
// if (digits.length >= 1) {
|
|
4182
|
+
// mm = digits.substring(0, 2);
|
|
4183
|
+
// if (parseInt(mm) > 12) mm = '12';
|
|
4184
|
+
// }
|
|
4185
|
+
// if (digits.length >= 3) {
|
|
4186
|
+
// dd = digits.substring(2, 4);
|
|
4187
|
+
// if (parseInt(dd) > 31) dd = '31';
|
|
4188
|
+
// } else if (digits.length > 2) {
|
|
4189
|
+
// dd = digits.substring(2);
|
|
4190
|
+
// }
|
|
4191
|
+
// // Year
|
|
4192
|
+
// if (digits.length > 4) {
|
|
4193
|
+
// yyyy = digits.substring(4, 8);
|
|
4194
|
+
// if (yyyy.length === 4) {
|
|
4195
|
+
// let yearNum = parseInt(yyyy);
|
|
4196
|
+
// if (yearNum < 1900) yearNum = 1900;
|
|
4197
|
+
// if (yearNum > 2099) yearNum = 2099;
|
|
4198
|
+
// yyyy = yearNum.toString();
|
|
4199
|
+
// }
|
|
4200
|
+
// }
|
|
4201
|
+
// let formatted = mm;
|
|
4202
|
+
// if (dd) formatted += '/' + dd;
|
|
4203
|
+
// if (yyyy) formatted += '/' + yyyy;
|
|
4204
|
+
// // Limit to 10 chars
|
|
4205
|
+
// return formatted.substring(0, 10);
|
|
4206
|
+
// }
|
|
4207
|
+
parseDateString(value) {
|
|
4208
|
+
const parts = value.split('/');
|
|
4209
|
+
if (parts.length === 3) {
|
|
4210
|
+
const mm = parseInt(parts[0], 10) - 1;
|
|
4211
|
+
const dd = parseInt(parts[1], 10);
|
|
4212
|
+
const yyyy = parseInt(parts[2], 10);
|
|
4213
|
+
if (!isNaN(mm) && !isNaN(dd) && !isNaN(yyyy))
|
|
4214
|
+
return new Date(yyyy, mm, dd);
|
|
4215
|
+
}
|
|
4216
|
+
return null;
|
|
4217
|
+
}
|
|
4218
|
+
/** Validate final date */
|
|
4219
|
+
isValidDate(value) {
|
|
4220
|
+
const regex = /^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/\d{4}$/;
|
|
4221
|
+
return regex.test(value);
|
|
4222
|
+
}
|
|
4223
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MsDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4224
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.3", type: MsDatePicker, isStandalone: true, selector: "ms-date-picker", inputs: { required: "required", readonly: "readonly", pattern: "pattern", skeleton: "skeleton", prefix: "prefix", dateType: "dateType", disabled: "disabled", invalid: "invalid", selectedSate: "selectedSate", minDate: "minDate", maxDate: "maxDate", mode: "mode" }, outputs: { dateChange: "dateChange" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: "<div #container class=\"ms-d-flex ms-flex-column ms-input-field-container\">\n\n <div *ngIf=\"dateType == 'datepicker'\" class=\"ms-date-field\" [class.ms-has-error]=\"invalid\" [class]=\"selectedSate\"\n [class.ms-has-focus]=\"selectedSate === 'ms-focus'\" [class.ms-has-prefix-container]=\"prefix\">\n <input type=\"text\" class=\"ms-form-control\" [class.ms-has-prefix]=\"prefix\" placeholder=\"mm/dd/yyyy\"\n [required]=\"required\" [readonly]=\"readonly\" [pattern]=\"pattern\" [class.disabled]=\"disabled\" [disabled]=\"disabled\"\n (click)=\"onInputClick($event)\" [attr.aria-invalid]=\"invalid\" [class]=\"selectedSate\" [(ngModel)]=\"singleDate\"\n [class.ms-file-uploader-skeleton]=\"skeleton\" (input)=\"onSingleDateInput($event)\">\n </div>\n <div *ngIf=\"dateType == 'datepicker-icon'\" class=\"ms-date-range-dual-wrapper\" [class.ms-has-suffix]=\"true\">\n\n <input type=\"text\" class=\"ms-form-control\" [class.ms-has-prefix]=\"prefix\" placeholder=\"mm/dd/yyyy\"\n [required]=\"required\" [readonly]=\"readonly\" [pattern]=\"pattern\" [disabled]=\"disabled\" [(ngModel)]=\"singleDate\"\n [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\" [class.ms-file-uploader-skeleton]=\"skeleton\"\n (input)=\"onSingleDateInput($event)\">\n <span class=\"ms-date-suffix\" (click)=\"open('single')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n <div *ngIf=\"dateType == 'daterange'\" class=\"ms-date-range-dual-wrapper\">\n <input type=\"text\" class=\"ms-form-control\" [class.ms-has-prefix]=\"prefix\" placeholder=\"Select a range\"\n [required]=\"required\" [readonly]=\"readonly\" [pattern]=\"pattern\" [disabled]=\"disabled\" [(ngModel)]=\"rangeDate\"\n [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\" [class.ms-file-uploader-skeleton]=\"skeleton\"\n (input)=\"onRangeDateInput($event)\" maxlength=\"23\">\n <span class=\"ms-date-suffix\" (click)=\"open('range')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n <div *ngIf=\"dateType === 'daterange-dual'\" class=\"ms-date-range-from-to-wrapper\">\n <div>\n <label>From</label>\n <div class=\"ms-date-wrapper ms-me-3 ms-mt-2\">\n <input type=\"text\" class=\"ms-form-control\" placeholder=\"mm/dd/yyyy\" [required]=\"required\" [readonly]=\"readonly\"\n [pattern]=\"pattern\" [disabled]=\"disabled\" [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\"\n [(ngModel)]=\"fromDateInput\" [class.ms-file-uploader-skeleton]=\"skeleton\" />\n <span class=\"ms-date-suffix\" (click)=\"open('single', 'from')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n </div>\n\n <div>\n <label>To</label>\n <!-- TO DATE -->\n <div class=\"ms-date-wrapper ms-mt-2\">\n\n <input type=\"text\" class=\"ms-form-control\" placeholder=\"mm/dd/yyyy\" [required]=\"required\" [readonly]=\"readonly\"\n [pattern]=\"pattern\" [disabled]=\"disabled\" [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\"\n [(ngModel)]=\"toDateInput\" [class.ms-file-uploader-skeleton]=\"skeleton\" />\n <span class=\"ms-date-suffix\" (click)=\"open('single', 'to')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n </div>\n\n\n </div>\n\n\n <app-calendar *ngIf=\"showCalendar\" [mode]=\"mode\" [selectedDate]=\"selectedDate\" (dateChange)=\"onDateChange($event)\"\n [fromDate]=\"fromDate\" [toDate]=\"toDate\" [leftMonth]=\"leftMonth\" [leftYear]=\"leftYear\" [rightMonth]=\"rightMonth\"\n [rightYear]=\"rightYear\">\n </app-calendar>\n</div>", styles: [".ms-date-field,.ms-date-range-dual-wrapper,.ms-date-wrapper{display:flex;align-items:center;position:relative;width:240px;height:36px;border-radius:8px;background-color:#fff;border:1px solid #E0E0E0;padding:0;overflow:hidden;box-sizing:border-box;transition:border-color .2s,box-shadow .2s,background-color .2s;z-index:0}.ms-date-range-from-to-wrapper{display:flex;align-items:center;position:relative;background-color:#fff;padding:0;overflow:hidden;box-sizing:border-box;z-index:0}.ms-form-control{flex:1;border:none;outline:none;height:100%;font-size:14px;font-weight:500;color:#374151;background-color:transparent;padding:0 12px;box-sizing:border-box;z-index:2}.ms-form-control.ms-has-prefix{padding-left:40px}.ms-form-control.ms-has-suffix{padding-right:40px}.ms-form-control:disabled{color:#9ca3af;cursor:not-allowed;background-color:transparent}.ms-date-prefix,.ms-date-suffix{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;z-index:3}.ms-date-prefix img,.ms-date-suffix img{width:16px;height:16px}.ms-date-prefix{left:12px}.ms-date-suffix{right:12px}.ms-date-field,.ms-date-wrapper{display:flex;align-items:center;border:1px solid #d1d5db;overflow:visible;background-color:#fff;height:36px;transition:border-color .2s,box-shadow .2s;padding:0;border:1px solid var(--semantics-border-subtle-secondary, #E0E0E0);border-radius:8px}.ms-date-field.ms-has-focus,.ms-date-wrapper.ms-has-focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.ms-date-field.ms-has-error,.ms-date-wrapper.ms-has-error{border-color:#ef4444;box-shadow:0 0 0 3px #ef44441a}.ms-date-field:hover:not(:disabled),.ms-date-wrapper:hover:not(:disabled){border-color:#3b82f6}.ms-date-field.ms-disabled,.ms-date-wrapper.ms-disabled{border:1px solid #d1d5db!important}.ms-date-field.ms-error,.ms-date-wrapper.ms-error{border:1px solid #ef4444!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: Calendar, selector: "app-calendar", inputs: ["mode", "selectedDate", "fromDate", "toDate", "leftMonth", "leftYear", "rightMonth", "rightYear"], outputs: ["dateChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MsDesignSystemModule }, { kind: "component", type: MsIcon, selector: "ms-icon", inputs: ["name", "color", "size"] }] });
|
|
4225
|
+
}
|
|
4226
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: MsDatePicker, decorators: [{
|
|
4227
|
+
type: Component,
|
|
4228
|
+
args: [{ selector: 'ms-date-picker', imports: [CommonModule, Calendar, FormsModule, MsDesignSystemModule], template: "<div #container class=\"ms-d-flex ms-flex-column ms-input-field-container\">\n\n <div *ngIf=\"dateType == 'datepicker'\" class=\"ms-date-field\" [class.ms-has-error]=\"invalid\" [class]=\"selectedSate\"\n [class.ms-has-focus]=\"selectedSate === 'ms-focus'\" [class.ms-has-prefix-container]=\"prefix\">\n <input type=\"text\" class=\"ms-form-control\" [class.ms-has-prefix]=\"prefix\" placeholder=\"mm/dd/yyyy\"\n [required]=\"required\" [readonly]=\"readonly\" [pattern]=\"pattern\" [class.disabled]=\"disabled\" [disabled]=\"disabled\"\n (click)=\"onInputClick($event)\" [attr.aria-invalid]=\"invalid\" [class]=\"selectedSate\" [(ngModel)]=\"singleDate\"\n [class.ms-file-uploader-skeleton]=\"skeleton\" (input)=\"onSingleDateInput($event)\">\n </div>\n <div *ngIf=\"dateType == 'datepicker-icon'\" class=\"ms-date-range-dual-wrapper\" [class.ms-has-suffix]=\"true\">\n\n <input type=\"text\" class=\"ms-form-control\" [class.ms-has-prefix]=\"prefix\" placeholder=\"mm/dd/yyyy\"\n [required]=\"required\" [readonly]=\"readonly\" [pattern]=\"pattern\" [disabled]=\"disabled\" [(ngModel)]=\"singleDate\"\n [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\" [class.ms-file-uploader-skeleton]=\"skeleton\"\n (input)=\"onSingleDateInput($event)\">\n <span class=\"ms-date-suffix\" (click)=\"open('single')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n <div *ngIf=\"dateType == 'daterange'\" class=\"ms-date-range-dual-wrapper\">\n <input type=\"text\" class=\"ms-form-control\" [class.ms-has-prefix]=\"prefix\" placeholder=\"Select a range\"\n [required]=\"required\" [readonly]=\"readonly\" [pattern]=\"pattern\" [disabled]=\"disabled\" [(ngModel)]=\"rangeDate\"\n [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\" [class.ms-file-uploader-skeleton]=\"skeleton\"\n (input)=\"onRangeDateInput($event)\" maxlength=\"23\">\n <span class=\"ms-date-suffix\" (click)=\"open('range')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n <div *ngIf=\"dateType === 'daterange-dual'\" class=\"ms-date-range-from-to-wrapper\">\n <div>\n <label>From</label>\n <div class=\"ms-date-wrapper ms-me-3 ms-mt-2\">\n <input type=\"text\" class=\"ms-form-control\" placeholder=\"mm/dd/yyyy\" [required]=\"required\" [readonly]=\"readonly\"\n [pattern]=\"pattern\" [disabled]=\"disabled\" [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\"\n [(ngModel)]=\"fromDateInput\" [class.ms-file-uploader-skeleton]=\"skeleton\" />\n <span class=\"ms-date-suffix\" (click)=\"open('single', 'from')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n </div>\n\n <div>\n <label>To</label>\n <!-- TO DATE -->\n <div class=\"ms-date-wrapper ms-mt-2\">\n\n <input type=\"text\" class=\"ms-form-control\" placeholder=\"mm/dd/yyyy\" [required]=\"required\" [readonly]=\"readonly\"\n [pattern]=\"pattern\" [disabled]=\"disabled\" [attr.aria-invalid]=\"invalid\" [attr.data-state]=\"selectedSate\"\n [(ngModel)]=\"toDateInput\" [class.ms-file-uploader-skeleton]=\"skeleton\" />\n <span class=\"ms-date-suffix\" (click)=\"open('single', 'to')\">\n <ms-icon [name]=\"'calender'\"></ms-icon>\n </span>\n </div>\n </div>\n\n\n </div>\n\n\n <app-calendar *ngIf=\"showCalendar\" [mode]=\"mode\" [selectedDate]=\"selectedDate\" (dateChange)=\"onDateChange($event)\"\n [fromDate]=\"fromDate\" [toDate]=\"toDate\" [leftMonth]=\"leftMonth\" [leftYear]=\"leftYear\" [rightMonth]=\"rightMonth\"\n [rightYear]=\"rightYear\">\n </app-calendar>\n</div>", styles: [".ms-date-field,.ms-date-range-dual-wrapper,.ms-date-wrapper{display:flex;align-items:center;position:relative;width:240px;height:36px;border-radius:8px;background-color:#fff;border:1px solid #E0E0E0;padding:0;overflow:hidden;box-sizing:border-box;transition:border-color .2s,box-shadow .2s,background-color .2s;z-index:0}.ms-date-range-from-to-wrapper{display:flex;align-items:center;position:relative;background-color:#fff;padding:0;overflow:hidden;box-sizing:border-box;z-index:0}.ms-form-control{flex:1;border:none;outline:none;height:100%;font-size:14px;font-weight:500;color:#374151;background-color:transparent;padding:0 12px;box-sizing:border-box;z-index:2}.ms-form-control.ms-has-prefix{padding-left:40px}.ms-form-control.ms-has-suffix{padding-right:40px}.ms-form-control:disabled{color:#9ca3af;cursor:not-allowed;background-color:transparent}.ms-date-prefix,.ms-date-suffix{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;z-index:3}.ms-date-prefix img,.ms-date-suffix img{width:16px;height:16px}.ms-date-prefix{left:12px}.ms-date-suffix{right:12px}.ms-date-field,.ms-date-wrapper{display:flex;align-items:center;border:1px solid #d1d5db;overflow:visible;background-color:#fff;height:36px;transition:border-color .2s,box-shadow .2s;padding:0;border:1px solid var(--semantics-border-subtle-secondary, #E0E0E0);border-radius:8px}.ms-date-field.ms-has-focus,.ms-date-wrapper.ms-has-focus{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61a}.ms-date-field.ms-has-error,.ms-date-wrapper.ms-has-error{border-color:#ef4444;box-shadow:0 0 0 3px #ef44441a}.ms-date-field:hover:not(:disabled),.ms-date-wrapper:hover:not(:disabled){border-color:#3b82f6}.ms-date-field.ms-disabled,.ms-date-wrapper.ms-disabled{border:1px solid #d1d5db!important}.ms-date-field.ms-error,.ms-date-wrapper.ms-error{border:1px solid #ef4444!important}\n"] }]
|
|
4229
|
+
}], propDecorators: { container: [{
|
|
4230
|
+
type: ViewChild,
|
|
4231
|
+
args: ['container']
|
|
4232
|
+
}], required: [{
|
|
4233
|
+
type: Input
|
|
4234
|
+
}], readonly: [{
|
|
4235
|
+
type: Input
|
|
4236
|
+
}], pattern: [{
|
|
4237
|
+
type: Input
|
|
4238
|
+
}], skeleton: [{
|
|
4239
|
+
type: Input
|
|
4240
|
+
}], prefix: [{
|
|
4241
|
+
type: Input
|
|
4242
|
+
}], dateType: [{
|
|
4243
|
+
type: Input
|
|
4244
|
+
}], disabled: [{
|
|
4245
|
+
type: Input
|
|
4246
|
+
}], invalid: [{
|
|
4247
|
+
type: Input
|
|
4248
|
+
}], selectedSate: [{
|
|
4249
|
+
type: Input
|
|
4250
|
+
}], minDate: [{
|
|
4251
|
+
type: Input
|
|
4252
|
+
}], maxDate: [{
|
|
4253
|
+
type: Input
|
|
4254
|
+
}], mode: [{
|
|
4255
|
+
type: Input
|
|
4256
|
+
}], dateChange: [{
|
|
4257
|
+
type: Output
|
|
4258
|
+
}], onDocumentClick: [{
|
|
4259
|
+
type: HostListener,
|
|
4260
|
+
args: ['document:click', ['$event']]
|
|
4261
|
+
}] } });
|
|
4262
|
+
|
|
3630
4263
|
function provideMsDesignSystem() {
|
|
3631
4264
|
return makeEnvironmentProviders([]);
|
|
3632
4265
|
}
|
|
@@ -3700,5 +4333,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.3", ngImpor
|
|
|
3700
4333
|
* Generated bundle index. Do not edit.
|
|
3701
4334
|
*/
|
|
3702
4335
|
|
|
3703
|
-
export { FLAGICONS, ICONS, MS_SVG_PATH, MsAvatar, MsBadge, MsBreadcrumb, MsButton, MsCheckbox, MsCommentBox, MsDesignSystemModule, MsDropdown, MsFileUploader, MsFlagIcon, MsIcon, MsInputField, MsPagination, MsRadioButton, MsSidebar, MsSpinner, MsTabs, MsTextArea, MsToaster, MsToasterService, MsToggle, MsTooltip, MsTooltipDirective, MsTopbar, TopbarService, provideMsDesignSystem };
|
|
4336
|
+
export { FLAGICONS, ICONS, MS_SVG_PATH, MsAvatar, MsBadge, MsBreadcrumb, MsButton, MsCheckbox, MsCommentBox, MsDatePicker, MsDesignSystemModule, MsDropdown, MsFileUploader, MsFlagIcon, MsIcon, MsInputField, MsPagination, MsRadioButton, MsSidebar, MsSpinner, MsTabs, MsTextArea, MsToaster, MsToasterService, MsToggle, MsTooltip, MsTooltipDirective, MsTopbar, TopbarService, provideMsDesignSystem };
|
|
3704
4337
|
//# sourceMappingURL=ms-design-system.mjs.map
|