@nanahoshi/mona-ui 0.24.5 → 0.24.6
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/README.md +2 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +196 -137
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +164 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +124 -140
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +205 -202
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1 -1
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-row.component-BMCM0W8s.mjs → nanahoshi-mona-ui-grid-grid-footer-row.component-CD_ODHpU.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-list.component-BSlV8Sua.mjs → nanahoshi-mona-ui-grid-grid-list.component-0jN7I1jo.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-row.component-CTOdnH29.mjs → nanahoshi-mona-ui-grid-grid-row.component-BI_iE7pl.mjs} +3 -3
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-C2kf5MwO.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-Sa1aAtJ-.mjs} +4 -4
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Dh42tUui.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-BvUM9nPt.mjs} +8 -8
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +195 -122
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +149 -167
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +182 -137
- package/package.json +2 -2
- package/types/nanahoshi-mona-ui-calendar.d.ts +30 -11
- package/types/nanahoshi-mona-ui-date-input.d.ts +74 -3
- package/types/nanahoshi-mona-ui-date-picker.d.ts +61 -33
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +79 -38
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +57 -16
- package/types/nanahoshi-mona-ui-time-picker.d.ts +72 -42
- package/types/nanahoshi-mona-ui-time-selector.d.ts +78 -46
|
@@ -122,6 +122,11 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
122
122
|
protected readonly headerMonthYear: _angular_core.Signal<string>;
|
|
123
123
|
protected readonly headerYear: _angular_core.Signal<string>;
|
|
124
124
|
protected readonly invalidState: _angular_core.Signal<boolean>;
|
|
125
|
+
/**
|
|
126
|
+
* Whether a day can't be picked: outside `minDate`/`maxDate` or in `disabledDates`. An iterable of disabled
|
|
127
|
+
* dates is turned into a set of day keys once, so each of the 42 cells answers in constant time.
|
|
128
|
+
*/
|
|
129
|
+
protected readonly isDayUnavailable: _angular_core.Signal<(date: Date) => boolean>;
|
|
125
130
|
protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaCalendarMessages>;
|
|
126
131
|
protected readonly monthBounds: _angular_core.Signal<{
|
|
127
132
|
start: Date;
|
|
@@ -138,9 +143,13 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
138
143
|
protected readonly prevButtonLabel: _angular_core.Signal<string>;
|
|
139
144
|
protected readonly rangePreviewDate: _angular_core.WritableSignal<Date | null>;
|
|
140
145
|
protected readonly rangePreviewDates: _angular_core.Signal<Date[]>;
|
|
146
|
+
protected readonly rangePreviewKeys: _angular_core.Signal<ReadonlySet<string>>;
|
|
141
147
|
protected readonly selectedDates: _angular_core.WritableSignal<Date[]>;
|
|
142
|
-
protected readonly
|
|
148
|
+
protected readonly selectedKeys: _angular_core.Signal<ReadonlySet<string>>;
|
|
149
|
+
/** Today at midnight. Refreshed when focus enters the calendar, so a page left open overnight moves on. */
|
|
150
|
+
protected readonly today: _angular_core.WritableSignal<Date>;
|
|
143
151
|
protected readonly todayButtonLabel: _angular_core.Signal<string>;
|
|
152
|
+
protected readonly todayUnavailable: _angular_core.Signal<boolean>;
|
|
144
153
|
protected readonly viewSwitchButtonLabel: _angular_core.Signal<string>;
|
|
145
154
|
protected readonly weekdays: _angular_core.Signal<{
|
|
146
155
|
display: string;
|
|
@@ -153,7 +162,7 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
153
162
|
/**
|
|
154
163
|
* @description Sets the disabled state of the calendar.
|
|
155
164
|
*/
|
|
156
|
-
readonly disabled: _angular_core.
|
|
165
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
157
166
|
/**
|
|
158
167
|
* @description Sets the disabled dates of the calendar.
|
|
159
168
|
* Accepts either an iterable of Date objects or a predicate function.
|
|
@@ -164,12 +173,18 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
164
173
|
* @default null
|
|
165
174
|
*/
|
|
166
175
|
readonly firstDay: _angular_core.InputSignal<FirstDayOfWeek | null>;
|
|
176
|
+
/**
|
|
177
|
+
* @description Moves focus to the active day when the calendar first renders. An inline calendar on a page
|
|
178
|
+
* should leave focus where it is; a calendar that opens in a popup sets this so focus moves into it.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
readonly focusOnMount: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
167
182
|
/**
|
|
168
183
|
* @description Marks the calendar as invalid. When bound to a signal form field via `[formField]`,
|
|
169
184
|
* this is written by the `FormField` directive.
|
|
170
185
|
* @default false
|
|
171
186
|
*/
|
|
172
|
-
readonly invalid: _angular_core.
|
|
187
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
173
188
|
/**
|
|
174
189
|
* @description Sets the maximum date that can be selected.
|
|
175
190
|
*/
|
|
@@ -182,13 +197,13 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
182
197
|
* @description Sets the readonly state of the calendar.
|
|
183
198
|
* @default false
|
|
184
199
|
*/
|
|
185
|
-
readonly readonly: _angular_core.
|
|
200
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
186
201
|
/**
|
|
187
202
|
* @description Sets whether the calendar is required. When bound to a signal form field via `[formField]`,
|
|
188
203
|
* this is written by the `FormField` directive.
|
|
189
204
|
* @default false
|
|
190
205
|
*/
|
|
191
|
-
readonly required: _angular_core.
|
|
206
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
192
207
|
/**
|
|
193
208
|
* @description Sets the border radius of the calendar.
|
|
194
209
|
* @default "medium"
|
|
@@ -200,8 +215,8 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
200
215
|
*/
|
|
201
216
|
readonly selection: _angular_core.InputSignal<CalendarSelection>;
|
|
202
217
|
/**
|
|
203
|
-
* @description Emitted when the calendar
|
|
204
|
-
* The `FormField` directive listens to this to mark the field as touched.
|
|
218
|
+
* @description Emitted when focus leaves the calendar, as a native input is touched on blur. Moving between
|
|
219
|
+
* its buttons and days doesn't count. The `FormField` directive listens to this to mark the field as touched.
|
|
205
220
|
*/
|
|
206
221
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
207
222
|
/**
|
|
@@ -209,13 +224,14 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
209
224
|
* this is written by the `FormField` directive.
|
|
210
225
|
* @default false
|
|
211
226
|
*/
|
|
212
|
-
readonly touched: _angular_core.
|
|
227
|
+
readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
213
228
|
/**
|
|
214
229
|
* @description Adds custom CSS classes to the calendar host element.
|
|
215
230
|
*/
|
|
216
231
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
217
232
|
/**
|
|
218
|
-
* @description The current value of the calendar
|
|
233
|
+
* @description The current value of the calendar: a `Date` in single selection, the selected dates in multiple
|
|
234
|
+
* selection, and `[start, end]` in range selection. A range is written once both ends are picked.
|
|
219
235
|
* @default null
|
|
220
236
|
*/
|
|
221
237
|
readonly value: _angular_core.ModelSignal<Date | Date[] | null>;
|
|
@@ -223,18 +239,20 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
223
239
|
* @description Enables the display of week numbers in the calendar.
|
|
224
240
|
* @default false
|
|
225
241
|
*/
|
|
226
|
-
readonly weekNumber: _angular_core.
|
|
242
|
+
readonly weekNumber: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
227
243
|
constructor();
|
|
228
244
|
protected formatInteger(value: number): string;
|
|
229
245
|
protected getWeekNumber(date: Date): number;
|
|
230
246
|
protected onDayClick(date: Date, event: MouseEvent): void;
|
|
231
247
|
protected onDayPointerEnter(date: Date): void;
|
|
248
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
232
249
|
protected onMonthClick(month: number): void;
|
|
233
250
|
protected onMonthGridPointerLeave(): void;
|
|
234
251
|
protected onNavigationClick(direction: "prev" | "next"): void;
|
|
235
252
|
protected onTodayButtonClick(): void;
|
|
236
253
|
protected onViewChangeClick(view: CalendarView): void;
|
|
237
254
|
protected onYearClick(year: number): void;
|
|
255
|
+
protected refreshToday(): void;
|
|
238
256
|
private clearPendingRange;
|
|
239
257
|
private commitUserSelection;
|
|
240
258
|
private extendSelection;
|
|
@@ -251,6 +269,7 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
251
269
|
private horizontalPeriodDirection;
|
|
252
270
|
private isDateDisabled;
|
|
253
271
|
private isEmptyValue;
|
|
272
|
+
private isOutOfRange;
|
|
254
273
|
private navigateByDaysOrCells;
|
|
255
274
|
private navigateByPeriod;
|
|
256
275
|
private navigateByWeeksOrRows;
|
|
@@ -266,7 +285,7 @@ declare class CalendarComponent implements CalendarVariantInput, FormValueContro
|
|
|
266
285
|
private switchToUpperView;
|
|
267
286
|
private toggleFocusedDateInSelection;
|
|
268
287
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CalendarComponent, never>;
|
|
269
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CalendarComponent, "mona-calendar", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledDates": { "alias": "disabledDates"; "required": false; "isSignal": true; }; "firstDay": { "alias": "firstDay"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "weekNumber": { "alias": "weekNumber"; "required": false; "isSignal": true; }; }, { "
|
|
288
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CalendarComponent, "mona-calendar", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledDates": { "alias": "disabledDates"; "required": false; "isSignal": true; }; "firstDay": { "alias": "firstDay"; "required": false; "isSignal": true; }; "focusOnMount": { "alias": "focusOnMount"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "selection": { "alias": "selection"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "weekNumber": { "alias": "weekNumber"; "required": false; "isSignal": true; }; }, { "touch": "touch"; "value": "valueChange"; }, ["decadeCellTemplate", "monthCellTemplate", "yearCellTemplate"], never, true, never>;
|
|
270
289
|
}
|
|
271
290
|
|
|
272
291
|
declare const CALENDAR_DEFAULT_MESSAGES: MonaCalendarMessages;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import { PipeTransform, Signal, WritableSignal, ModelSignal } from '@angular/core';
|
|
3
3
|
import { Predicate, ImmutableSet } from '@mirei/ts-collections';
|
|
4
4
|
import { DateTime } from 'luxon';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -7,6 +7,7 @@ import { VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
|
7
7
|
import { VariantProps } from 'class-variance-authority';
|
|
8
8
|
import { Subject } from 'rxjs';
|
|
9
9
|
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
10
|
+
import { ValidationError } from '@angular/forms/signals';
|
|
10
11
|
|
|
11
12
|
declare class DateInputPrefixTemplateDirective {
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateInputPrefixTemplateDirective, never>;
|
|
@@ -55,5 +56,75 @@ declare const generateHourSet: (hourFormat: HourFormat, meridiem: Meridiem, step
|
|
|
55
56
|
declare const generateMinuteSet: (step?: number) => ImmutableSet<TimeUnit>;
|
|
56
57
|
declare const generateSecondSet: (step?: number) => ImmutableSet<TimeUnit>;
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* The clock a locale uses by default: "12" for en-US, ja-JP and ko-KR, "24" for de-DE, fr-FR and tr-TR. Locales that
|
|
61
|
+
* mark the hour cycle explicitly (`en-US-u-hc-h23`) are honoured.
|
|
62
|
+
*/
|
|
63
|
+
declare function getLocaleHourFormat(localeId: string): HourFormat;
|
|
64
|
+
|
|
65
|
+
/** Which part of the typed value min, max and `disabledDates` apply to. */
|
|
66
|
+
type TypedDateUnit = "date" | "datetime" | "time";
|
|
67
|
+
interface TypedDateConstraints {
|
|
68
|
+
readonly disabledDates?: DateDisabledType;
|
|
69
|
+
readonly max?: Date | null;
|
|
70
|
+
readonly min?: Date | null;
|
|
71
|
+
readonly unit: TypedDateUnit;
|
|
72
|
+
}
|
|
73
|
+
/** The error a picker reports when the typed text isn't a date in the input format. */
|
|
74
|
+
interface TypedDateParseError extends ValidationError.WithoutFieldTree {
|
|
75
|
+
readonly kind: "parse";
|
|
76
|
+
}
|
|
77
|
+
/** The error a picker reports when the typed date is one of its `disabledDates`. */
|
|
78
|
+
interface DisabledDateError extends ValidationError.WithoutFieldTree {
|
|
79
|
+
readonly date: Date;
|
|
80
|
+
readonly kind: "disabledDate";
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Parses text typed into a picker. The input format is tried first, then the same format with one-digit months, days,
|
|
84
|
+
* hours, minutes and seconds ("1/5/2025", "9:05"), then with a two-digit year ("1/5/25"). Two-digit years up to 60
|
|
85
|
+
* read as 20xx, later ones as 19xx.
|
|
86
|
+
* @returns The parsed date, or null when the text isn't a date in any of these forms.
|
|
87
|
+
*/
|
|
88
|
+
declare function parseTypedDate(text: string, format: string, localeId: string): DateTime | null;
|
|
89
|
+
/** Whether a date is one of `disabledDates`, compared by day. */
|
|
90
|
+
declare function isDateDisabled(date: Date, disabledDates: DateDisabledType): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Checks a typed date against a picker's min, max and `disabledDates`, the same limits its popup applies.
|
|
93
|
+
* @returns The error to report, or null when the date is allowed. Range errors are Angular's `minDate` and `maxDate`
|
|
94
|
+
* errors, so they read like the signal-forms validators.
|
|
95
|
+
*/
|
|
96
|
+
declare function checkTypedDate(date: Date, constraints: TypedDateConstraints): ValidationError.WithoutFieldTree | null;
|
|
97
|
+
/** The error reported for text that doesn't parse. */
|
|
98
|
+
declare function typedDateParseError(): TypedDateParseError;
|
|
99
|
+
interface TypedDateInputOptions {
|
|
100
|
+
/** The limits the typed date is checked against. */
|
|
101
|
+
readonly constraints: () => TypedDateConstraints;
|
|
102
|
+
/** The format the value is shown in and typed text is parsed with. */
|
|
103
|
+
readonly format: () => string;
|
|
104
|
+
readonly localeId: () => string;
|
|
105
|
+
/** Turns the parsed text into the value, such as putting a typed time on the current value's day. */
|
|
106
|
+
readonly resolve?: (parsed: DateTime, current: Date | null) => Date;
|
|
107
|
+
readonly value: ModelSignal<Date | null>;
|
|
108
|
+
}
|
|
109
|
+
interface TypedDateInput {
|
|
110
|
+
/**
|
|
111
|
+
* Writes the typed text to the value. Text that doesn't parse, or a date outside the limits, leaves the value as
|
|
112
|
+
* it was and is reported through {@link errors}, and to the form field the picker is bound to. Empty text clears
|
|
113
|
+
* the value.
|
|
114
|
+
*/
|
|
115
|
+
commit(): void;
|
|
116
|
+
/** Takes text typed into the input. Clearing the input commits at once, so the clear button empties the value. */
|
|
117
|
+
edit(text: string): void;
|
|
118
|
+
/** Parse and limit errors of the last commit. They clear when the value changes. */
|
|
119
|
+
readonly errors: Signal<readonly ValidationError.WithoutFieldTree[]>;
|
|
120
|
+
/** The text in the input: the formatted value, or what the user is typing. */
|
|
121
|
+
readonly text: WritableSignal<string>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The typed-input pipeline of the date, time and date-time pickers. Call it in an injection context: the errors are
|
|
125
|
+
* reported to the form field (signal forms, `ngModel` or a reactive form control) bound to the picker.
|
|
126
|
+
*/
|
|
127
|
+
declare function createTypedDateInput(options: TypedDateInputOptions): TypedDateInput;
|
|
128
|
+
|
|
129
|
+
export { CalendarService, DateInputPrefixTemplateDirective, TimeLimiterPipe, TimeSelectorService, checkTypedDate, createTypedDateInput, datePopupThemeVariants, generateHourSet, generateMinuteSet, generateSecondSet, getLocaleHourFormat, isDateDisabled, parseTypedDate, typedDateParseError };
|
|
130
|
+
export type { CalendarView, DateDisabledType, DatePopupVariantInput, DatePopupVariantProps, DisabledDateError, HourFormat, Meridiem, TimeUnit, TypedDateConstraints, TypedDateInput, TypedDateInputOptions, TypedDateParseError, TypedDateUnit };
|
|
@@ -5,7 +5,7 @@ import { TemplateRef } from '@angular/core';
|
|
|
5
5
|
import { FormValueControl } from '@angular/forms/signals';
|
|
6
6
|
import { CalendarDecadeCellTemplateDirective, CalendarMonthCellTemplateDirective, CalendarYearCellTemplateDirective, FirstDayOfWeek } from '@nanahoshi/mona-ui/calendar';
|
|
7
7
|
import { PreventableEvent } from '@nanahoshi/mona-ui/common';
|
|
8
|
-
import { DatePopupVariantInput, DateDisabledType } from '@nanahoshi/mona-ui/date-input';
|
|
8
|
+
import { DatePopupVariantInput, TypedDateInput, DateDisabledType } from '@nanahoshi/mona-ui/date-input';
|
|
9
9
|
import * as i1 from '@nanahoshi/mona-ui/dropdowns';
|
|
10
10
|
import { DropdownPopupInput } from '@nanahoshi/mona-ui/dropdowns';
|
|
11
11
|
import { VariantInputs, AttributeConfig } from '@nanahoshi/mona-ui/internal';
|
|
@@ -27,7 +27,6 @@ type DatePickerVariantInput = Omit<DatePickerBaseVariantInput, "focused">;
|
|
|
27
27
|
declare class DatePickerComponent implements FormValueControl<Date | null>, DropdownPopupInput, DatePickerVariantInput, DatePopupVariantInput {
|
|
28
28
|
#private;
|
|
29
29
|
protected readonly baseClass: _angular_core.Signal<string>;
|
|
30
|
-
protected readonly currentDateString: _angular_core.WritableSignal<string>;
|
|
31
30
|
protected readonly decadeCellTemplate: _angular_core.Signal<CalendarDecadeCellTemplateDirective | undefined>;
|
|
32
31
|
protected readonly effectiveFormat: _angular_core.Signal<string>;
|
|
33
32
|
protected readonly expanded: _angular_core.Signal<boolean>;
|
|
@@ -35,12 +34,29 @@ declare class DatePickerComponent implements FormValueControl<Date | null>, Drop
|
|
|
35
34
|
protected readonly invalidState: _angular_core.Signal<boolean>;
|
|
36
35
|
protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaDatePickerMessages>;
|
|
37
36
|
protected readonly monthCellTemplate: _angular_core.Signal<CalendarMonthCellTemplateDirective | undefined>;
|
|
38
|
-
protected readonly navigatedDate: _angular_core.WritableSignal<Date>;
|
|
39
37
|
protected readonly pickerPopupClass: _angular_core.Signal<string>;
|
|
40
38
|
protected readonly popupId: string;
|
|
41
39
|
protected readonly popupTemplate: _angular_core.Signal<TemplateRef<unknown>>;
|
|
42
40
|
protected readonly prefixTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
41
|
+
/** Set in the constructor, which runs after the `value` model it writes to exists. */
|
|
42
|
+
protected readonly typedInput: TypedDateInput;
|
|
43
43
|
protected readonly yearCellTemplate: _angular_core.Signal<CalendarYearCellTemplateDirective | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* @description Id of an element that describes the input, such as a hint or an error message.
|
|
46
|
+
* @default ""
|
|
47
|
+
*/
|
|
48
|
+
readonly ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
49
|
+
/**
|
|
50
|
+
* @description Accessible name of the input. Prefer a visible label, linked through {@link inputId} or
|
|
51
|
+
* {@link ariaLabelledBy}; the placeholder is not a label.
|
|
52
|
+
* @default ""
|
|
53
|
+
*/
|
|
54
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
55
|
+
/**
|
|
56
|
+
* @description Id of the element that labels the input.
|
|
57
|
+
* @default ""
|
|
58
|
+
*/
|
|
59
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string>;
|
|
44
60
|
/**
|
|
45
61
|
* @description Emits when the popup is about to close. This event is preventable.
|
|
46
62
|
*/
|
|
@@ -51,11 +67,13 @@ declare class DatePickerComponent implements FormValueControl<Date | null>, Drop
|
|
|
51
67
|
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
52
68
|
/**
|
|
53
69
|
* @description Sets the disabled state of the date picker.
|
|
70
|
+
* @default false
|
|
54
71
|
*/
|
|
55
|
-
readonly disabled: _angular_core.
|
|
72
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
56
73
|
/**
|
|
57
74
|
* @description Sets the disabled dates of the date picker.
|
|
58
|
-
* Accepts either an iterable of Date objects or a predicate function.
|
|
75
|
+
* Accepts either an iterable of Date objects or a predicate function. Typing a disabled date is reported as a
|
|
76
|
+
* `disabledDate` error instead of setting the value.
|
|
59
77
|
*/
|
|
60
78
|
readonly disabledDates: _angular_core.InputSignal<DateDisabledType>;
|
|
61
79
|
/**
|
|
@@ -65,21 +83,28 @@ declare class DatePickerComponent implements FormValueControl<Date | null>, Drop
|
|
|
65
83
|
readonly firstDay: _angular_core.InputSignal<FirstDayOfWeek | null>;
|
|
66
84
|
/**
|
|
67
85
|
* @description Sets the date format of the date picker. If not specified, derives from the active locale.
|
|
86
|
+
* Typed text is also accepted with one-digit days and months and a two-digit year.
|
|
68
87
|
* @default null
|
|
69
88
|
*/
|
|
70
89
|
readonly format: _angular_core.InputSignal<string | null>;
|
|
90
|
+
/**
|
|
91
|
+
* @description Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the
|
|
92
|
+
* date picker. A unique id is generated when it isn't set.
|
|
93
|
+
* @default generated
|
|
94
|
+
*/
|
|
95
|
+
readonly inputId: _angular_core.InputSignal<string>;
|
|
71
96
|
/**
|
|
72
97
|
* @description Marks the date picker as invalid. When bound to a signal form field via `[formField]`,
|
|
73
98
|
* this is written by the `FormField` directive.
|
|
74
99
|
* @default false
|
|
75
100
|
*/
|
|
76
|
-
readonly invalid: _angular_core.
|
|
101
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
77
102
|
/**
|
|
78
|
-
* @description Sets the maximum date of the date picker.
|
|
103
|
+
* @description Sets the maximum date of the date picker. A later typed date is reported as a `maxDate` error.
|
|
79
104
|
*/
|
|
80
105
|
readonly max: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
|
|
81
106
|
/**
|
|
82
|
-
* @description Sets the minimum date of the date picker.
|
|
107
|
+
* @description Sets the minimum date of the date picker. An earlier typed date is reported as a `minDate` error.
|
|
83
108
|
*/
|
|
84
109
|
readonly min: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
|
|
85
110
|
/**
|
|
@@ -100,44 +125,46 @@ declare class DatePickerComponent implements FormValueControl<Date | null>, Drop
|
|
|
100
125
|
*/
|
|
101
126
|
readonly popupClass: _angular_core.InputSignal<string>;
|
|
102
127
|
/**
|
|
103
|
-
* @description Sets the height of the popup element.
|
|
104
|
-
* @default
|
|
128
|
+
* @description Sets the height of the popup element. When empty, the popup fits the calendar.
|
|
129
|
+
* @default ""
|
|
105
130
|
*/
|
|
106
131
|
readonly popupHeight: _angular_core.InputSignal<ListSizeInputType>;
|
|
107
132
|
/**
|
|
108
|
-
* @description Sets the width of the popup element.
|
|
109
|
-
* @default
|
|
133
|
+
* @description Sets the width of the popup element. When empty, the popup fits the calendar.
|
|
134
|
+
* @default ""
|
|
110
135
|
*/
|
|
111
136
|
readonly popupWidth: _angular_core.InputSignal<ListSizeInputType>;
|
|
112
137
|
/**
|
|
113
138
|
* @description Sets the readonly state of the date picker.
|
|
139
|
+
* @default false
|
|
114
140
|
*/
|
|
115
|
-
readonly readonly: _angular_core.
|
|
141
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
116
142
|
/**
|
|
117
143
|
* @description When true, the input is readonly but the calendar button remains enabled.
|
|
118
144
|
* @default false
|
|
119
145
|
*/
|
|
120
|
-
readonly readonlyInput: _angular_core.
|
|
146
|
+
readonly readonlyInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
121
147
|
/**
|
|
122
148
|
* @description Sets the required state of the date picker.
|
|
123
149
|
* When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
|
|
124
150
|
* @default false
|
|
125
151
|
*/
|
|
126
|
-
readonly required: _angular_core.
|
|
152
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
127
153
|
/**
|
|
128
154
|
* @description Sets the border radius of the date picker.
|
|
129
155
|
*/
|
|
130
156
|
readonly rounded: _angular_core.InputSignal<"full" | "large" | "medium" | "none" | "small" | null | undefined>;
|
|
131
157
|
/**
|
|
132
|
-
* @description Sets the visibility of the clear button.
|
|
158
|
+
* @description Sets the visibility of the clear button. Clearing empties the value at once.
|
|
159
|
+
* @default false
|
|
133
160
|
*/
|
|
134
|
-
readonly showClearButton: _angular_core.
|
|
161
|
+
readonly showClearButton: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
135
162
|
/**
|
|
136
163
|
* @description Sets the size of the date picker.
|
|
137
164
|
*/
|
|
138
165
|
readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
|
|
139
166
|
/**
|
|
140
|
-
* @description Emitted when the date picker
|
|
167
|
+
* @description Emitted when focus leaves the date picker and its popup.
|
|
141
168
|
* The `FormField` directive listens to this to mark the field as touched.
|
|
142
169
|
*/
|
|
143
170
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
@@ -146,10 +173,11 @@ declare class DatePickerComponent implements FormValueControl<Date | null>, Drop
|
|
|
146
173
|
* this is written by the `FormField` directive.
|
|
147
174
|
* @default false
|
|
148
175
|
*/
|
|
149
|
-
readonly touched: _angular_core.
|
|
176
|
+
readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
150
177
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
151
178
|
/**
|
|
152
|
-
* @description Two-way bindable current date value.
|
|
179
|
+
* @description Two-way bindable current date value. Typed text is written on Enter and when the input loses
|
|
180
|
+
* focus; text that isn't a valid date keeps the previous value and marks the field invalid.
|
|
153
181
|
* @default null
|
|
154
182
|
*/
|
|
155
183
|
readonly value: _angular_core.ModelSignal<Date | null>;
|
|
@@ -157,25 +185,25 @@ declare class DatePickerComponent implements FormValueControl<Date | null>, Drop
|
|
|
157
185
|
* @description Enables the display of week numbers in the calendar.
|
|
158
186
|
* @default false
|
|
159
187
|
*/
|
|
160
|
-
readonly weekNumber: _angular_core.
|
|
188
|
+
readonly weekNumber: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
161
189
|
constructor();
|
|
162
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Focuses the input and places the caret after the text. Read-only pickers take focus too.
|
|
192
|
+
* @param options Options passed to the native `focus()` call, such as `preventScroll`.
|
|
193
|
+
*/
|
|
194
|
+
focus(options?: FocusOptions): void;
|
|
163
195
|
protected onCalendarValueChange(date: Date | Date[] | null): void;
|
|
164
|
-
protected onDateInputBlur(): void;
|
|
165
196
|
protected onDateInputButtonClick(): void;
|
|
166
|
-
protected
|
|
197
|
+
protected onFocusIn(event: FocusEvent): void;
|
|
198
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
199
|
+
protected onInputBlur(): void;
|
|
200
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
167
201
|
private closePopup;
|
|
168
|
-
private compareDatesEqual;
|
|
169
|
-
private dateStringEquals;
|
|
170
|
-
private handleKeydown;
|
|
171
|
-
private isDateDisabledByInput;
|
|
172
202
|
private openPopup;
|
|
173
|
-
private
|
|
174
|
-
private
|
|
175
|
-
private setPopupCloseSubscriptions;
|
|
176
|
-
private setSubscriptions;
|
|
203
|
+
private setCalendarKeyboardSubscription;
|
|
204
|
+
private setPopupCloseSubscription;
|
|
177
205
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DatePickerComponent, never>;
|
|
178
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "mona-date-picker", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledDates": { "alias": "disabledDates"; "required": false; "isSignal": true; }; "firstDay": { "alias": "firstDay"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "popupClass": { "alias": "popupClass"; "required": false; "isSignal": true; }; "popupHeight": { "alias": "popupHeight"; "required": false; "isSignal": true; }; "popupWidth": { "alias": "popupWidth"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "readonlyInput": { "alias": "readonlyInput"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "weekNumber": { "alias": "weekNumber"; "required": false; "isSignal": true; }; }, { "close": "close"; "closed": "closed"; "open": "open"; "opened": "opened"; "touch": "touch"; "value": "valueChange"; }, ["decadeCellTemplate", "monthCellTemplate", "prefixTemplate", "yearCellTemplate"], never, true, [{ directive: typeof i1.DropdownPopupHandlerDirective; inputs: {}; outputs: {}; }]>;
|
|
206
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DatePickerComponent, "mona-date-picker", never, { "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledDates": { "alias": "disabledDates"; "required": false; "isSignal": true; }; "firstDay": { "alias": "firstDay"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "popupClass": { "alias": "popupClass"; "required": false; "isSignal": true; }; "popupHeight": { "alias": "popupHeight"; "required": false; "isSignal": true; }; "popupWidth": { "alias": "popupWidth"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "readonlyInput": { "alias": "readonlyInput"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "weekNumber": { "alias": "weekNumber"; "required": false; "isSignal": true; }; }, { "close": "close"; "closed": "closed"; "open": "open"; "opened": "opened"; "touch": "touch"; "value": "valueChange"; }, ["decadeCellTemplate", "monthCellTemplate", "prefixTemplate", "yearCellTemplate"], never, true, [{ directive: typeof i1.DropdownPopupHandlerDirective; inputs: {}; outputs: {}; }]>;
|
|
179
207
|
}
|
|
180
208
|
|
|
181
209
|
declare const DATE_PICKER_DEFAULT_MESSAGES: MonaDatePickerMessages;
|