@eagami/ui 5.96.0 → 5.97.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "5.96.0",
3
+ "version": "5.97.0",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -155,6 +155,12 @@ export interface EagamiMessages {
155
155
  nextMonth: string;
156
156
  nextYear: string;
157
157
  today: string;
158
+ rangePlaceholder: string;
159
+ rangeDialogLabel: string;
160
+ clearRange: string;
161
+ rangeStartDay: (day: number) => string;
162
+ rangeEndDay: (day: number) => string;
163
+ chooseEndDate: string;
158
164
  /** Abbreviated weekday names, Sunday first (index 0), for the calendar
159
165
  * header. Bundled so the calendar localizes even when the runtime's
160
166
  * `Intl` lacks this locale's date data. */
@@ -3754,12 +3760,20 @@ export interface DatePickerDateRange {
3754
3760
  start: Date;
3755
3761
  end: Date;
3756
3762
  }
3763
+ /** Whether a pick selects one date or a start and end date. */
3764
+ export type DatePickerMode = 'single' | 'range';
3765
+ /** Value reported to Angular forms: a `Date` in `single` mode, a `DatePickerDateRange` in `range` mode. */
3766
+ export type DatePickerControlValue = Date | DatePickerDateRange | null;
3757
3767
  interface CalendarDay {
3758
3768
  date: Date;
3759
3769
  day: number;
3760
3770
  isCurrentMonth: boolean;
3761
3771
  isToday: boolean;
3762
3772
  isSelected: boolean;
3773
+ isRangeStart: boolean;
3774
+ isRangeEnd: boolean;
3775
+ /** Strictly between the ends of the highlighted range. */
3776
+ isInRange: boolean;
3763
3777
  isDisabled: boolean;
3764
3778
  isFocused: boolean;
3765
3779
  }
@@ -3769,8 +3783,9 @@ interface CalendarDay {
3769
3783
  * or with a month name) and is rewritten in the configured `format` on commit.
3770
3784
  * Supports `min`/`max` bounds, disabled weekdays and dates, configurable week
3771
3785
  * start, locale-aware formatting via `Intl.DateTimeFormat`, and full keyboard
3772
- * navigation (arrows, PageUp/PageDown, Home/End, Enter, Escape). Integrates
3773
- * with Angular forms via `ControlValueAccessor`.
3786
+ * navigation (arrows, PageUp/PageDown, Home/End, Enter, Escape). In `range`
3787
+ * mode two picks set a start and end date, and the range is typed as two dates
3788
+ * joined by an en dash. Integrates with Angular forms via `ControlValueAccessor`.
3774
3789
  */
3775
3790
  export declare class DatePickerComponent extends LabelledFieldControlBase implements ControlValueAccessor {
3776
3791
  protected readonly fieldEl: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
@@ -3798,9 +3813,15 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3798
3813
  readonly weekStartsOn: import("@angular/core").InputSignal<DatePickerWeekStart>;
3799
3814
  readonly locale: import("@angular/core").InputSignal<string | undefined>;
3800
3815
  readonly id: import("@angular/core").InputSignal<string>;
3816
+ /** Picks one date, or a start and end date in `range` mode, where only the two ends need to be available days. */
3817
+ readonly mode: import("@angular/core").InputSignal<DatePickerMode>;
3801
3818
  readonly value: import("@angular/core").ModelSignal<Date | null>;
3819
+ /** Selected start and end dates in `range` mode, two-way bindable via `[(range)]`. */
3820
+ readonly range: import("@angular/core").ModelSignal<DatePickerDateRange | null>;
3802
3821
  /** Fires when the selected date changes, including when cleared. */
3803
3822
  readonly changed: import("@angular/core").OutputEmitterRef<Date | null>;
3823
+ /** Fires in `range` mode when the selected range changes, including when cleared. */
3824
+ readonly rangeChanged: import("@angular/core").OutputEmitterRef<DatePickerDateRange | null>;
3804
3825
  readonly isOpen: import("@angular/core").WritableSignal<boolean>;
3805
3826
  readonly viewYear: import("@angular/core").WritableSignal<number>;
3806
3827
  readonly viewMonth: import("@angular/core").WritableSignal<number>;
@@ -3809,6 +3830,8 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3809
3830
  private readonly isFocused;
3810
3831
  /** Entry in progress, held verbatim until it is committed or abandoned. */
3811
3832
  private readonly draft;
3833
+ protected readonly rangeAnchor: import("@angular/core").WritableSignal<Date | null>;
3834
+ private readonly hoveredDate;
3812
3835
  private onChange;
3813
3836
  private onTouched;
3814
3837
  readonly isDisabled: import("@angular/core").Signal<boolean>;
@@ -3830,8 +3853,12 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3830
3853
  private readonly intlLocalizesEffectiveLocale;
3831
3854
  /** Placeholder text, empty unless a `placeholder` is given. */
3832
3855
  readonly resolvedPlaceholder: import("@angular/core").Signal<string>;
3856
+ protected readonly isRange: import("@angular/core").Signal<boolean>;
3857
+ protected readonly hasValue: import("@angular/core").Signal<boolean>;
3833
3858
  /** Accessible name when neither `label` nor `aria-labelledby` is given. */
3834
3859
  protected readonly fallbackLabel: import("@angular/core").Signal<string>;
3860
+ protected readonly dialogLabel: import("@angular/core").Signal<string>;
3861
+ protected readonly clearLabel: import("@angular/core").Signal<string>;
3835
3862
  readonly dialogId: import("@angular/core").Signal<string>;
3836
3863
  readonly fieldClasses: import("@angular/core").Signal<{
3837
3864
  'ea-date-picker__field--focused': boolean;
@@ -3847,9 +3874,11 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3847
3874
  readonly inputText: import("@angular/core").Signal<string>;
3848
3875
  readonly monthYearLabel: import("@angular/core").Signal<string>;
3849
3876
  readonly weekdayLabels: import("@angular/core").Signal<string[]>;
3877
+ /** Committed range, or the one being picked: from the anchor to the hovered or focused day. */
3878
+ private readonly highlightedRange;
3850
3879
  readonly weeks: import("@angular/core").Signal<CalendarDay[][]>;
3851
- writeValue(val: DatePickerValue): void;
3852
- registerOnChange(fn: (value: Date | null) => void): void;
3880
+ writeValue(val: DatePickerValue | DatePickerDateRange): void;
3881
+ registerOnChange(fn: (value: DatePickerControlValue) => void): void;
3853
3882
  registerOnTouched(fn: () => void): void;
3854
3883
  setDisabledState(isDisabled: boolean): void;
3855
3884
  /** Toggles the calendar popover between open and closed. */
@@ -3862,8 +3891,12 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3862
3891
  /** Moves keyboard focus to the date field. */
3863
3892
  focus(): void;
3864
3893
  selectDay(day: CalendarDay): void;
3865
- /** Clears the selected date and emits `changed` with `null`. */
3894
+ protected onDayHover(day: CalendarDay): void;
3895
+ protected rangeDayLabel(day: CalendarDay): string | null;
3896
+ protected onGridLeave(): void;
3897
+ /** Clears the selected date, or range in `range` mode, and emits `changed` or `rangeChanged` with `null`. */
3866
3898
  clear(event: Event): void;
3899
+ private pick;
3867
3900
  goToPrevMonth(): void;
3868
3901
  goToNextMonth(): void;
3869
3902
  goToPrevYear(): void;
@@ -3881,14 +3914,21 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3881
3914
  protected onInputBlur(): void;
3882
3915
  protected handleInputKeydown(event: KeyboardEvent): void;
3883
3916
  private commitDraft;
3917
+ private commitRangeEntry;
3918
+ private parseEntry;
3919
+ private applyRange;
3884
3920
  private applyValue;
3885
3921
  private isUnavailable;
3886
3922
  private covers;
3887
3923
  handleGridKeydown(event: KeyboardEvent): void;
3888
3924
  /** Called by `<ea-popover>` when the user clicks outside the picker. */
3889
3925
  onPopoverCloseRequested(): void;
3926
+ private formatDate;
3890
3927
  private formatOptions;
3891
3928
  private toDate;
3929
+ private isDateRange;
3930
+ private toRange;
3931
+ private orderRange;
3892
3932
  private startOfDay;
3893
3933
  private isSameDay;
3894
3934
  private addDays;
@@ -3965,14 +4005,26 @@ export declare class DatePickerComponent extends LabelledFieldControlBase implem
3965
4005
  "required": false;
3966
4006
  "isSignal": true;
3967
4007
  };
4008
+ "mode": {
4009
+ "alias": "mode";
4010
+ "required": false;
4011
+ "isSignal": true;
4012
+ };
3968
4013
  "value": {
3969
4014
  "alias": "value";
3970
4015
  "required": false;
3971
4016
  "isSignal": true;
3972
4017
  };
4018
+ "range": {
4019
+ "alias": "range";
4020
+ "required": false;
4021
+ "isSignal": true;
4022
+ };
3973
4023
  }, {
3974
4024
  "value": "valueChange";
4025
+ "range": "rangeChange";
3975
4026
  "changed": "changed";
4027
+ "rangeChanged": "rangeChanged";
3976
4028
  }, never, never, true, never>;
3977
4029
  }
3978
4030
  /** Width preset of the dialog panel. */