@ptsecurity/mosaic 15.2.0 → 15.2.1
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/_theming.scss +6 -3
- package/checkbox/_checkbox-theme.scss +4 -2
- package/datepicker/calendar.component.d.ts +3 -2
- package/esm2020/core/version.mjs +2 -2
- package/esm2020/datepicker/calendar.component.mjs +7 -4
- package/esm2020/datepicker/datepicker-input.directive.mjs +6 -4
- package/fesm2015/ptsecurity-mosaic-core.mjs +1 -1
- package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-datepicker.mjs +11 -6
- package/fesm2015/ptsecurity-mosaic-datepicker.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-core.mjs +1 -1
- package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-datepicker.mjs +11 -6
- package/fesm2020/ptsecurity-mosaic-datepicker.mjs.map +1 -1
- package/input/_input-theme.scss +2 -1
- package/package.json +2 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
@@ -499,17 +499,17 @@ class McCalendar {
|
|
499
499
|
}
|
500
500
|
/**
|
501
501
|
* The current active date. This determines which time period is shown and which date is
|
502
|
-
* highlighted when using keyboard navigation.
|
502
|
+
* highlighted and used as the anchor on when using keyboard navigation.
|
503
503
|
*/
|
504
504
|
get activeDate() {
|
505
505
|
return this._activeDate;
|
506
506
|
}
|
507
507
|
set activeDate(value) {
|
508
|
-
this._activeDate = this.adapter.clampDate(value, this.minDate, this.maxDate);
|
508
|
+
this._activeDate = this.adapter.clampDate(value || this.getActiveDateDefault(), this.minDate, this.maxDate);
|
509
509
|
this.stateChanges.next();
|
510
510
|
}
|
511
511
|
ngAfterContentInit() {
|
512
|
-
this.activeDate = this.
|
512
|
+
this.activeDate = this.getActiveDateDefault();
|
513
513
|
}
|
514
514
|
ngOnDestroy() {
|
515
515
|
this.intlChanges.unsubscribe();
|
@@ -548,6 +548,9 @@ class McCalendar {
|
|
548
548
|
getValidDateOrNull(obj) {
|
549
549
|
return (this.adapter.isDateInstance(obj) && this.adapter.isValid(obj)) ? obj : null;
|
550
550
|
}
|
551
|
+
getActiveDateDefault() {
|
552
|
+
return this.startAt || this.adapter.today();
|
553
|
+
}
|
551
554
|
}
|
552
555
|
/** @nocollapse */ McCalendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McCalendar, deps: [{ token: McDatepickerIntl }, { token: i1$1.DateAdapter, optional: true }, { token: MC_DATE_FORMATS, optional: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
553
556
|
/** @nocollapse */ McCalendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: McCalendar, selector: "mc-calendar", inputs: { startAt: "startAt", selected: "selected", minDate: "minDate", maxDate: "maxDate", dateFilter: "dateFilter", dateClass: "dateClass" }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", monthSelected: "monthSelected", userSelection: "userSelection" }, host: { classAttribute: "mc-calendar" }, viewQueries: [{ propertyName: "monthView", first: true, predicate: McMonthView, descendants: true }], exportAs: ["mcCalendar"], usesOnChanges: true, ngImport: i0, template: "<mc-calendar-header\n [(activeDate)]=\"activeDate\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n (monthSelected)=\"monthSelected.emit(activeDate)\"\n (yearSelected)=\"yearSelected.emit(activeDate)\">\n</mc-calendar-header>\n\n<div class=\"mc-calendar__content\">\n <mc-month-view\n [(activeDate)]=\"activeDate\"\n [selected]=\"selected\"\n [dateFilter]=\"dateFilter\"\n [maxDate]=\"maxDate\"\n [minDate]=\"minDate\"\n [dateClass]=\"dateClass\"\n (selectedChange)=\"dateSelected($event!)\"\n (userSelection)=\"userSelected()\">\n </mc-month-view>\n</div>\n", styles: [".mc-calendar{display:block}.mc-calendar__content{padding:0 var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px) var(--mc-datepicker-calendar-size-padding-horizontal, 8px);outline:none}.mc-calendar__table{border-spacing:0;border-collapse:collapse;width:100%}.mc-calendar__table-header th{text-align:center;height:30px}.mc-calendar__table-header th.mc-calendar__table-header-divider{position:relative;height:calc(var(--mc-datepicker-calendar-size-padding-blocks, 12px) - 2px)}.mc-calendar__table-header th.mc-calendar__table-header-divider:after{content:\"\";position:absolute;top:0;left:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));right:calc(-1 * var(--mc-datepicker-calendar-size-padding-horizontal, 8px));height:var(--mc-datepicker-calendar-size-divider-width, 1px)}\n"], dependencies: [{ kind: "component", type: McMonthView, selector: "mc-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate", "dateFilter", "dateClass"], outputs: ["selectedChange", "userSelection", "activeDateChange"], exportAs: ["mcMonthView"] }, { kind: "component", type: McCalendarHeader, selector: "mc-calendar-header", inputs: ["activeDate", "maxDate", "minDate"], outputs: ["activeDateChange", "monthSelected", "yearSelected"], exportAs: ["mcCalendarHeader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
@@ -1140,8 +1143,8 @@ class McDatepickerInput {
|
|
1140
1143
|
this.lastValueValid = !!newTimeObj;
|
1141
1144
|
if (!newTimeObj) {
|
1142
1145
|
if (!this.viewValue) {
|
1143
|
-
this.
|
1144
|
-
this.
|
1146
|
+
this.lastValueValid = false;
|
1147
|
+
this.updateValue(newTimeObj);
|
1145
1148
|
}
|
1146
1149
|
else {
|
1147
1150
|
this.control.updateValueAndValidity();
|
@@ -1465,7 +1468,9 @@ class McDatepickerInput {
|
|
1465
1468
|
}
|
1466
1469
|
}
|
1467
1470
|
onChange() {
|
1468
|
-
|
1471
|
+
setTimeout(() => {
|
1472
|
+
this.dateChange.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
|
1473
|
+
});
|
1469
1474
|
}
|
1470
1475
|
/** Handles blur events on the input. */
|
1471
1476
|
onBlur() {
|