@datarailsshared/datarailsshared 1.6.265 → 1.6.267

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.
@@ -1,17 +1,18 @@
1
- import { OnDestroy, ChangeDetectorRef, OnInit } from '@angular/core';
2
- import { Subject } from 'rxjs';
1
+ import { ChangeDetectorRef, OnInit, ComponentRef, ApplicationRef, DestroyRef, OnDestroy } from '@angular/core';
3
2
  import { MatCalendar } from '@angular/material/datepicker';
4
3
  import { DateAdapter } from '@angular/material/core';
5
4
  import { CalendarView, CustomDateFormat, ITimeframeOption, TCalendarView } from '../../../models/datePicker';
6
5
  import { DrDatePickerService } from '../services/dr-date-picker.service';
6
+ import { WeekSelectorComponent } from '../week-selector/week-selector.component';
7
7
  import * as i0 from "@angular/core";
8
- export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnDestroy, OnInit {
8
+ export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnInit, OnDestroy {
9
9
  protected _calendar: MatCalendar<any>;
10
10
  protected _dateAdapter: DateAdapter<Moment>;
11
11
  protected _dateFormats: CustomDateFormat;
12
12
  protected cdr: ChangeDetectorRef;
13
+ private appRef;
13
14
  datePickerService: DrDatePickerService;
14
- protected _destroyed: Subject<void>;
15
+ protected readonly destroyRef: DestroyRef;
15
16
  quarters: number[];
16
17
  selectedQuarter: number;
17
18
  timeframeOptions: ITimeframeOption[];
@@ -25,11 +26,12 @@ export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnDest
25
26
  timeframeSelection: boolean;
26
27
  periodMonthLabel: string;
27
28
  periodYearLabel: string;
29
+ weekSelectorComponentRef: ComponentRef<WeekSelectorComponent> | null;
28
30
  get selectedPresetTag(): import("../../../models/datePicker").DateTags;
29
31
  readonly calendarView: typeof CalendarView;
30
32
  private readonly cfr;
31
33
  private readonly injector;
32
- constructor(_calendar: MatCalendar<any>, _dateAdapter: DateAdapter<Moment>, _dateFormats: CustomDateFormat, cdr: ChangeDetectorRef, datePickerService: DrDatePickerService);
34
+ constructor(_calendar: MatCalendar<any>, _dateAdapter: DateAdapter<Moment>, _dateFormats: CustomDateFormat, cdr: ChangeDetectorRef, appRef: ApplicationRef, datePickerService: DrDatePickerService);
33
35
  ngOnInit(): void;
34
36
  ngOnDestroy(): void;
35
37
  setPeriodLabels(): void;
@@ -1,3 +1,4 @@
1
+ import { AfterViewInit } from '@angular/core';
1
2
  import { DrDatePickerService } from '../services/dr-date-picker.service';
2
3
  import { Moment } from 'moment';
3
4
  import * as i0 from "@angular/core";
@@ -10,14 +11,37 @@ export interface WeekInfo {
10
11
  isPartial: boolean;
11
12
  selected: boolean;
12
13
  }
13
- export declare class WeekSelectorComponent {
14
+ /**
15
+ * Provides week-based interaction for Angular Material `MatCalendar`.
16
+ * The component renders a list of weeks for the currently active month
17
+ * and keeps it synchronized with the calendar hover (preview) and selection state.
18
+ *
19
+ * Key responsibilities:
20
+ * - Derive logical weeks from the calendar's active month.
21
+ * - Detect which calendar week is currently previewed/selected and reflect it in the UI.
22
+ *
23
+ * ⚠ Stability note:
24
+ * - `_matCalendarBody` and `previewChange` are **private Angular Material APIs**.
25
+ * - This component may require adjustments after Angular Material upgrades.
26
+ * - Related upgrade considerations are documented in `UPGRADE_CHECKLIST.md`.
27
+ *
28
+ * If private API is going to change, and we don't have access to with properties,
29
+ * check the following commit with class and mutation observable implementation:
30
+ * https://github.com/Datarails/datarailsshared/pull/126/commits/590152cff0448c5f48bff32f9cb165bbf464112b
31
+ */
32
+ export declare class WeekSelectorComponent implements AfterViewInit {
14
33
  readonly service: DrDatePickerService;
15
34
  private readonly calendar;
16
- private readonly cdr;
17
- private readonly destroy$;
18
- currentMonthWeeks: WeekInfo[];
35
+ private readonly destroyRef;
36
+ private calendarBody;
37
+ readonly previewedWeek: import("@angular/core").WritableSignal<number>;
38
+ readonly currentMonthWeeks: import("@angular/core").WritableSignal<WeekInfo[]>;
19
39
  constructor();
40
+ ngAfterViewInit(): void;
41
+ toggleWeekPreview(event: Event, weekIndex: number, value: boolean): void;
20
42
  private getWeeksInMonth;
43
+ private isInRange;
44
+ private getWeekDays;
21
45
  static ɵfac: i0.ɵɵFactoryDeclaration<WeekSelectorComponent, never>;
22
46
  static ɵcmp: i0.ɵɵComponentDeclaration<WeekSelectorComponent, "dr-week-selector", never, {}, {}, never, never, true, never>;
23
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/datarailsshared",
3
- "version": "1.6.265",
3
+ "version": "1.6.267",
4
4
  "description": "DataRails shared components",
5
5
  "keywords": [
6
6
  "angular",