@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.
@@ -500,17 +500,17 @@ class McCalendar {
500
500
  }
501
501
  /**
502
502
  * The current active date. This determines which time period is shown and which date is
503
- * highlighted when using keyboard navigation.
503
+ * highlighted and used as the anchor on when using keyboard navigation.
504
504
  */
505
505
  get activeDate() {
506
506
  return this._activeDate;
507
507
  }
508
508
  set activeDate(value) {
509
- this._activeDate = this.adapter.clampDate(value, this.minDate, this.maxDate);
509
+ this._activeDate = this.adapter.clampDate(value || this.getActiveDateDefault(), this.minDate, this.maxDate);
510
510
  this.stateChanges.next();
511
511
  }
512
512
  ngAfterContentInit() {
513
- this.activeDate = this.startAt || this.adapter.today();
513
+ this.activeDate = this.getActiveDateDefault();
514
514
  }
515
515
  ngOnDestroy() {
516
516
  this.intlChanges.unsubscribe();
@@ -549,6 +549,9 @@ class McCalendar {
549
549
  getValidDateOrNull(obj) {
550
550
  return (this.adapter.isDateInstance(obj) && this.adapter.isValid(obj)) ? obj : null;
551
551
  }
552
+ getActiveDateDefault() {
553
+ return this.startAt || this.adapter.today();
554
+ }
552
555
  }
553
556
  /** @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 });
554
557
  /** @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 });
@@ -739,8 +742,8 @@ class McDatepickerInput {
739
742
  this.lastValueValid = !!newTimeObj;
740
743
  if (!newTimeObj) {
741
744
  if (!this.viewValue) {
742
- this._value = null;
743
- this.cvaOnChange(null);
745
+ this.lastValueValid = false;
746
+ this.updateValue(newTimeObj);
744
747
  }
745
748
  else {
746
749
  this.control.updateValueAndValidity();
@@ -1065,7 +1068,9 @@ class McDatepickerInput {
1065
1068
  }
1066
1069
  }
1067
1070
  onChange() {
1068
- this.dateChange.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
1071
+ setTimeout(() => {
1072
+ this.dateChange.emit(new McDatepickerInputEvent(this, this.elementRef.nativeElement));
1073
+ });
1069
1074
  }
1070
1075
  /** Handles blur events on the input. */
1071
1076
  onBlur() {