@forgeroute/ui 0.4.49 → 0.4.50

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.
@@ -39802,6 +39802,24 @@ var CalendarComponent = class CalendarComponent {
39802
39802
  if (f && cells.some((c) => c.dateStr === f)) return f;
39803
39803
  return (cells.find((c) => c.isToday) ?? cells.find((c) => c.isCurrentMonth) ?? cells[0]).dateStr;
39804
39804
  }, ...ngDevMode ? [{ debugName: "focusDate" }] : /* istanbul ignore next */ []);
39805
+ this.pendingFocus = null;
39806
+ this.pendingSawLoading = false;
39807
+ this.host.nativeElement.addEventListener("pointerdown", () => {
39808
+ this.pendingFocus = null;
39809
+ });
39810
+ effect(() => {
39811
+ const loading = this.loading();
39812
+ if (!this.pendingFocus) return;
39813
+ if (loading) {
39814
+ this.pendingSawLoading = true;
39815
+ return;
39816
+ }
39817
+ if (!this.pendingSawLoading) return;
39818
+ const target = this.pendingFocus;
39819
+ this.pendingFocus = null;
39820
+ this.pendingSawLoading = false;
39821
+ afterNextRender(() => this.host.nativeElement.querySelector(`.month-cell[data-date="${target}"]`)?.focus(), { injector: this.injector });
39822
+ });
39805
39823
  effect(() => {
39806
39824
  const view = this.view();
39807
39825
  const views = this.views();
@@ -39902,6 +39920,7 @@ var CalendarComponent = class CalendarComponent {
39902
39920
  if (this.clickable(dateStr)) this.dateClick.emit(dateStr);
39903
39921
  }
39904
39922
  onCellKey(event, dateStr) {
39923
+ if (event.key !== "PageUp" && event.key !== "PageDown") this.pendingFocus = null;
39905
39924
  if (event.target !== event.currentTarget || event.altKey || event.ctrlKey || event.metaKey) return;
39906
39925
  if (event.key === "Enter" || event.key === " ") {
39907
39926
  event.preventDefault();
@@ -39935,8 +39954,13 @@ var CalendarComponent = class CalendarComponent {
39935
39954
  const target = new Date(y, m, Math.min(from.getDate(), new Date(y, m + 1, 0).getDate()));
39936
39955
  const targetStr = toDateStr(target);
39937
39956
  this.focusedDate.set(targetStr);
39957
+ this.pendingFocus = targetStr;
39958
+ this.pendingSawLoading = this.loading();
39938
39959
  this.anchorDate.set(target);
39939
- afterNextRender(() => this.host.nativeElement.querySelector(`.month-cell[data-date="${targetStr}"]`)?.focus(), { injector: this.injector });
39960
+ afterNextRender(() => {
39961
+ this.host.nativeElement.querySelector(`.month-cell[data-date="${targetStr}"]`)?.focus();
39962
+ if (!this.loading() && this.pendingFocus === targetStr) this.pendingFocus = null;
39963
+ }, { injector: this.injector });
39940
39964
  }
39941
39965
  onAddAllDay(dateStr, event) {
39942
39966
  event.stopPropagation();