@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
|
@@ -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 {
|
|
8
|
+
import { HourFormat, 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 { AttributeConfig, VariantInputs } from '@nanahoshi/mona-ui/internal';
|
|
@@ -20,10 +20,13 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
20
20
|
#private;
|
|
21
21
|
protected readonly activeView: _angular_core.WritableSignal<ActiveView>;
|
|
22
22
|
protected readonly baseClass: _angular_core.Signal<string>;
|
|
23
|
-
protected readonly
|
|
23
|
+
protected readonly dateTabId: string;
|
|
24
24
|
protected readonly decadeCellTemplate: _angular_core.Signal<CalendarDecadeCellTemplateDirective | undefined>;
|
|
25
25
|
protected readonly effectiveFormat: _angular_core.Signal<string>;
|
|
26
|
+
protected readonly effectiveHourFormat: _angular_core.Signal<HourFormat>;
|
|
26
27
|
protected readonly expanded: _angular_core.Signal<boolean>;
|
|
28
|
+
/** Whether the view shown next takes focus: yes after picking a day, no when a tab is chosen. */
|
|
29
|
+
protected readonly focusViewOnMount: _angular_core.WritableSignal<boolean>;
|
|
27
30
|
protected readonly footerClass: _angular_core.Signal<string>;
|
|
28
31
|
protected readonly headerClass: _angular_core.Signal<string>;
|
|
29
32
|
protected readonly inputAttributes: _angular_core.Signal<AttributeConfig>;
|
|
@@ -32,13 +35,33 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
32
35
|
protected readonly messages: _angular_core.Signal<_nanahoshi_mona_ui_i18n.MonaDateTimePickerMessages>;
|
|
33
36
|
protected readonly monthCellTemplate: _angular_core.Signal<CalendarMonthCellTemplateDirective | undefined>;
|
|
34
37
|
protected readonly navigatedDate: _angular_core.WritableSignal<Date>;
|
|
38
|
+
protected readonly panelId: string;
|
|
35
39
|
protected readonly pickerPopupClass: _angular_core.Signal<string>;
|
|
36
40
|
protected readonly popupId: string;
|
|
37
41
|
protected readonly popupTemplate: _angular_core.Signal<TemplateRef<unknown>>;
|
|
38
42
|
protected readonly prefixTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
39
43
|
protected readonly timePickerMax: _angular_core.Signal<Date | null>;
|
|
40
44
|
protected readonly timePickerMin: _angular_core.Signal<Date | null>;
|
|
45
|
+
protected readonly timeTabId: string;
|
|
46
|
+
/** Set in the constructor, which runs after the `value` model it writes to exists. */
|
|
47
|
+
protected readonly typedInput: TypedDateInput;
|
|
41
48
|
protected readonly yearCellTemplate: _angular_core.Signal<CalendarYearCellTemplateDirective | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* @description Id of an element that describes the input, such as a hint or an error message.
|
|
51
|
+
* @default ""
|
|
52
|
+
*/
|
|
53
|
+
readonly ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
54
|
+
/**
|
|
55
|
+
* @description Accessible name of the input. Prefer a visible label, linked through {@link inputId} or
|
|
56
|
+
* {@link ariaLabelledBy}; the placeholder is not a label.
|
|
57
|
+
* @default ""
|
|
58
|
+
*/
|
|
59
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
60
|
+
/**
|
|
61
|
+
* @description Id of the element that labels the input.
|
|
62
|
+
* @default ""
|
|
63
|
+
*/
|
|
64
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string>;
|
|
42
65
|
/**
|
|
43
66
|
* @description Emits when the popup is about to close. This event is preventable.
|
|
44
67
|
*/
|
|
@@ -49,11 +72,13 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
49
72
|
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
50
73
|
/**
|
|
51
74
|
* @description Sets the disabled state of the date time picker.
|
|
75
|
+
* @default false
|
|
52
76
|
*/
|
|
53
|
-
readonly disabled: _angular_core.
|
|
77
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
54
78
|
/**
|
|
55
79
|
* @description Sets the disabled dates of the date time picker.
|
|
56
|
-
* Accepts either an iterable of Date objects or a predicate function.
|
|
80
|
+
* Accepts either an iterable of Date objects or a predicate function. Typing a disabled date is reported as a
|
|
81
|
+
* `disabledDate` error instead of setting the value.
|
|
57
82
|
*/
|
|
58
83
|
readonly disabledDates: _angular_core.InputSignal<DateDisabledType>;
|
|
59
84
|
/**
|
|
@@ -62,32 +87,41 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
62
87
|
*/
|
|
63
88
|
readonly firstDay: _angular_core.InputSignal<FirstDayOfWeek | null>;
|
|
64
89
|
/**
|
|
65
|
-
* @description Sets the date format of the date time picker. If not specified, derives from the active locale,
|
|
90
|
+
* @description Sets the date format of the date time picker. If not specified, derives from the active locale,
|
|
91
|
+
* hourFormat, and showSeconds. Typed text is also accepted with one-digit parts and a two-digit year.
|
|
66
92
|
* @default null
|
|
67
93
|
*/
|
|
68
94
|
readonly format: _angular_core.InputSignal<string | null>;
|
|
69
95
|
/**
|
|
70
|
-
* @description Sets the hour format of the time picker.
|
|
71
|
-
*
|
|
96
|
+
* @description Sets the hour format of the date time picker. When null, the active locale's clock is used: 12-hour
|
|
97
|
+
* for en-US, 24-hour for de-DE.
|
|
98
|
+
* @default null
|
|
72
99
|
*/
|
|
73
|
-
readonly hourFormat: _angular_core.InputSignal<HourFormat>;
|
|
100
|
+
readonly hourFormat: _angular_core.InputSignal<HourFormat | null>;
|
|
74
101
|
/**
|
|
75
102
|
* @description Sets the hour step of the time picker.
|
|
76
103
|
* @default 1
|
|
77
104
|
*/
|
|
78
105
|
readonly hourStep: _angular_core.InputSignal<number>;
|
|
106
|
+
/**
|
|
107
|
+
* @description Id of the inner `<input>` element. Point a `<label for>` or `<mona-label for>` at it to label the
|
|
108
|
+
* date time picker. A unique id is generated when it isn't set.
|
|
109
|
+
* @default generated
|
|
110
|
+
*/
|
|
111
|
+
readonly inputId: _angular_core.InputSignal<string>;
|
|
79
112
|
/**
|
|
80
113
|
* @description Marks the date time picker as invalid. When bound to a signal form field via `[formField]`,
|
|
81
114
|
* this is written by the `FormField` directive.
|
|
82
115
|
* @default false
|
|
83
116
|
*/
|
|
84
|
-
readonly invalid: _angular_core.
|
|
117
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
85
118
|
/**
|
|
86
|
-
* @description Sets the maximum date of the date time picker.
|
|
119
|
+
* @description Sets the maximum date of the date time picker. A later typed date is reported as a `maxDate` error.
|
|
87
120
|
*/
|
|
88
121
|
readonly max: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
|
|
89
122
|
/**
|
|
90
|
-
* @description Sets the minimum date of the date time picker.
|
|
123
|
+
* @description Sets the minimum date of the date time picker. An earlier typed date is reported as a `minDate`
|
|
124
|
+
* error.
|
|
91
125
|
*/
|
|
92
126
|
readonly min: _angular_core.InputSignalWithTransform<Date | undefined, unknown>;
|
|
93
127
|
/**
|
|
@@ -113,30 +147,31 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
113
147
|
*/
|
|
114
148
|
readonly popupClass: _angular_core.InputSignal<string>;
|
|
115
149
|
/**
|
|
116
|
-
* @description Sets the height of the popup element.
|
|
117
|
-
* @default
|
|
150
|
+
* @description Sets the height of the popup element. When not set, the popup fits its content.
|
|
151
|
+
* @default undefined
|
|
118
152
|
*/
|
|
119
153
|
readonly popupHeight: _angular_core.InputSignal<ListSizeInputType>;
|
|
120
154
|
/**
|
|
121
|
-
* @description Sets the width of the popup element.
|
|
122
|
-
* @default
|
|
155
|
+
* @description Sets the width of the popup element. When not set, the popup is at least as wide as the input.
|
|
156
|
+
* @default undefined
|
|
123
157
|
*/
|
|
124
158
|
readonly popupWidth: _angular_core.InputSignal<ListSizeInputType>;
|
|
125
159
|
/**
|
|
126
160
|
* @description Sets the readonly state of the date time picker.
|
|
161
|
+
* @default false
|
|
127
162
|
*/
|
|
128
|
-
readonly readonly: _angular_core.
|
|
163
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
129
164
|
/**
|
|
130
165
|
* @description When true, the input is readonly but the popup button remains enabled.
|
|
131
166
|
* @default false
|
|
132
167
|
*/
|
|
133
|
-
readonly readonlyInput: _angular_core.
|
|
168
|
+
readonly readonlyInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
134
169
|
/**
|
|
135
170
|
* @description Sets the required state of the date time picker.
|
|
136
171
|
* When bound to a signal form field via `[formField]`, this is written by the `FormField` directive.
|
|
137
172
|
* @default false
|
|
138
173
|
*/
|
|
139
|
-
readonly required: _angular_core.
|
|
174
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
140
175
|
/**
|
|
141
176
|
* @description Sets the border radius of the date time picker.
|
|
142
177
|
*/
|
|
@@ -147,19 +182,21 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
147
182
|
*/
|
|
148
183
|
readonly secondStep: _angular_core.InputSignal<number>;
|
|
149
184
|
/**
|
|
150
|
-
* @description Sets the visibility of the clear button.
|
|
185
|
+
* @description Sets the visibility of the clear button. Clearing empties the value at once.
|
|
186
|
+
* @default false
|
|
151
187
|
*/
|
|
152
|
-
readonly showClearButton: _angular_core.
|
|
188
|
+
readonly showClearButton: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
153
189
|
/**
|
|
154
190
|
* @description Sets the visibility of the second selector.
|
|
191
|
+
* @default false
|
|
155
192
|
*/
|
|
156
|
-
readonly showSeconds: _angular_core.
|
|
193
|
+
readonly showSeconds: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
157
194
|
/**
|
|
158
195
|
* @description Sets the size of the date time picker.
|
|
159
196
|
*/
|
|
160
197
|
readonly size: _angular_core.InputSignal<"large" | "medium" | "small" | null | undefined>;
|
|
161
198
|
/**
|
|
162
|
-
* @description Emitted when the date time picker
|
|
199
|
+
* @description Emitted when focus leaves the date time picker and its popup.
|
|
163
200
|
* The `FormField` directive listens to this to mark the field as touched.
|
|
164
201
|
*/
|
|
165
202
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
@@ -168,10 +205,11 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
168
205
|
* this is written by the `FormField` directive.
|
|
169
206
|
* @default false
|
|
170
207
|
*/
|
|
171
|
-
readonly touched: _angular_core.
|
|
208
|
+
readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
172
209
|
readonly userClass: _angular_core.InputSignal<string>;
|
|
173
210
|
/**
|
|
174
|
-
* @description Two-way bindable current date time value.
|
|
211
|
+
* @description Two-way bindable current date time value. Typed text is written on Enter and when the input loses
|
|
212
|
+
* focus; text that isn't a valid date and time keeps the previous value and marks the field invalid.
|
|
175
213
|
* @default null
|
|
176
214
|
*/
|
|
177
215
|
readonly value: _angular_core.ModelSignal<Date | null>;
|
|
@@ -179,30 +217,33 @@ declare class DateTimePickerComponent implements FormValueControl<Date | null>,
|
|
|
179
217
|
* @description Enables the display of week numbers in the calendar.
|
|
180
218
|
* @default false
|
|
181
219
|
*/
|
|
182
|
-
readonly weekNumber: _angular_core.
|
|
220
|
+
readonly weekNumber: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
183
221
|
constructor();
|
|
184
|
-
|
|
222
|
+
/**
|
|
223
|
+
* Focuses the input and places the caret after the text. Read-only pickers take focus too.
|
|
224
|
+
* @param options Options passed to the native `focus()` call, such as `preventScroll`.
|
|
225
|
+
*/
|
|
226
|
+
focus(options?: FocusOptions): void;
|
|
185
227
|
protected onCalendarValueChange(date: Date | Date[] | null): void;
|
|
186
228
|
protected onCancelClick(): void;
|
|
187
|
-
protected onDateInputBlur(): void;
|
|
188
229
|
protected onDateInputButtonClick(): void;
|
|
189
|
-
protected
|
|
230
|
+
protected onFocusIn(event: FocusEvent): void;
|
|
231
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
232
|
+
protected onInputBlur(): void;
|
|
233
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
190
234
|
protected onSetDateClick(): void;
|
|
235
|
+
/** Arrow keys, Home and End move between the Date and Time tabs, as in the APG tabs pattern. */
|
|
236
|
+
protected onTabKeydown(event: KeyboardEvent): void;
|
|
191
237
|
protected onTimeSelectorValueChange(date: Date | null): void;
|
|
238
|
+
/** Shows a view from its tab; focus stays on the tab, as in the APG tabs pattern. */
|
|
239
|
+
protected selectTab(view: ActiveView): void;
|
|
192
240
|
private closePopup;
|
|
193
|
-
private compareDatesEqual;
|
|
194
|
-
private dateStringEquals;
|
|
195
|
-
private handleKeydown;
|
|
196
|
-
private isDateDisabledByInput;
|
|
197
241
|
private openPopup;
|
|
198
|
-
private
|
|
199
|
-
private
|
|
200
|
-
private setPopupCloseSubscriptions;
|
|
201
|
-
private setSubscriptions;
|
|
202
|
-
private updateCurrentDateString;
|
|
242
|
+
private setPopupCloseSubscription;
|
|
243
|
+
private setPopupKeyboardSubscription;
|
|
203
244
|
private updateDateIfNotInRange;
|
|
204
245
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DateTimePickerComponent, never>;
|
|
205
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DateTimePickerComponent, "mona-datetime-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; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "hourStep": { "alias": "hourStep"; "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; }; "minuteStep": { "alias": "minuteStep"; "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; }; "secondStep": { "alias": "secondStep"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "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: {}; }]>;
|
|
246
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DateTimePickerComponent, "mona-datetime-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; }; "hourFormat": { "alias": "hourFormat"; "required": false; "isSignal": true; }; "hourStep": { "alias": "hourStep"; "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; }; "minuteStep": { "alias": "minuteStep"; "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; }; "secondStep": { "alias": "secondStep"; "required": false; "isSignal": true; }; "showClearButton": { "alias": "showClearButton"; "required": false; "isSignal": true; }; "showSeconds": { "alias": "showSeconds"; "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
247
|
}
|
|
207
248
|
|
|
208
249
|
declare const DATETIME_PICKER_DEFAULT_MESSAGES: MonaDateTimePickerMessages;
|
|
@@ -37,6 +37,8 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
37
37
|
protected readonly messages: Signal<_nanahoshi_mona_ui_i18n.MonaNumericTextBoxMessages>;
|
|
38
38
|
protected readonly prefixTemplateList: Signal<readonly TemplateRef<any>[]>;
|
|
39
39
|
protected readonly rawInputValue: _angular_core.WritableSignal<string>;
|
|
40
|
+
/** Spin buttons on a read-only field would look usable but do nothing, so they are hidden there. */
|
|
41
|
+
protected readonly showSpinners: Signal<boolean>;
|
|
40
42
|
protected readonly spin$: Subject<NumericTextBoxStepDirection>;
|
|
41
43
|
protected readonly spinButtonClasses: Signal<string>;
|
|
42
44
|
protected readonly spinButtonIconSize: Signal<20 | 16 | 14>;
|
|
@@ -45,9 +47,21 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
45
47
|
protected readonly valueTextBoxRef: Signal<ElementRef<HTMLInputElement>>;
|
|
46
48
|
protected readonly wheel$: Subject<WheelEvent>;
|
|
47
49
|
/**
|
|
48
|
-
* @description
|
|
50
|
+
* @description ID of an element that provides an extended description for the input, such as a hint or an
|
|
51
|
+
* error message.
|
|
52
|
+
* @default ""
|
|
53
|
+
*/
|
|
54
|
+
readonly ariaDescribedBy: _angular_core.InputSignal<string>;
|
|
55
|
+
/**
|
|
56
|
+
* @description Accessible name for the input. Prefer a visible label, linked through {@link inputId} or
|
|
57
|
+
* {@link ariaLabelledBy}.
|
|
49
58
|
*/
|
|
50
59
|
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
60
|
+
/**
|
|
61
|
+
* @description ID of an external element that provides the accessible name for the input.
|
|
62
|
+
* @default ""
|
|
63
|
+
*/
|
|
64
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string>;
|
|
51
65
|
/**
|
|
52
66
|
* @description Number of fractional decimal places to display and accept. Values are truncated to an integer
|
|
53
67
|
* and clamped to the range 0–20. Non-finite and negative values normalize to 0.
|
|
@@ -57,9 +71,10 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
57
71
|
/**
|
|
58
72
|
* @description Sets whether the input is disabled.
|
|
59
73
|
*/
|
|
60
|
-
readonly disabled: _angular_core.
|
|
74
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
61
75
|
/**
|
|
62
|
-
* @description Emits when the
|
|
76
|
+
* @description Emits when focus leaves the component, after the value has been clamped to the bounds. Moving
|
|
77
|
+
* focus between the input and elements inside the component (such as a prefix template) doesn't count.
|
|
63
78
|
*/
|
|
64
79
|
readonly inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
65
80
|
/**
|
|
@@ -70,24 +85,36 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
70
85
|
* @description Emits when the inner input element loses focus.
|
|
71
86
|
*/
|
|
72
87
|
readonly inputFocusOut: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
88
|
+
/**
|
|
89
|
+
* @description ID of the inner input, so a `<label for>` or `<mona-label for>` can point at it.
|
|
90
|
+
* @default a generated ID
|
|
91
|
+
*/
|
|
92
|
+
readonly inputId: _angular_core.InputSignal<string>;
|
|
73
93
|
/**
|
|
74
94
|
* @description Marks the text box as invalid. When bound to a signal form field via `[formField]`,
|
|
75
95
|
* this is written by the `FormField` directive.
|
|
76
96
|
* @default false
|
|
77
97
|
*/
|
|
78
|
-
readonly invalid: _angular_core.
|
|
98
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
99
|
+
/**
|
|
100
|
+
* @description Sets whether the input can be empty. When `false`, leaving an empty field sets it to the
|
|
101
|
+
* minimum, or to zero when there is no minimum (clamped to the maximum).
|
|
102
|
+
*/
|
|
103
|
+
readonly nullable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
79
104
|
/**
|
|
80
|
-
* @description
|
|
105
|
+
* @description Text shown in the input while it is empty. It isn't a label: it disappears once there is a
|
|
106
|
+
* value.
|
|
107
|
+
* @default ""
|
|
81
108
|
*/
|
|
82
|
-
readonly
|
|
109
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
83
110
|
/**
|
|
84
|
-
* @description Sets whether the input is readonly.
|
|
111
|
+
* @description Sets whether the input is readonly. The spin buttons are hidden while it is.
|
|
85
112
|
*/
|
|
86
|
-
readonly readonly: _angular_core.
|
|
113
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
87
114
|
/**
|
|
88
115
|
* @description Sets whether the input is required.
|
|
89
116
|
*/
|
|
90
|
-
readonly required: _angular_core.
|
|
117
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
91
118
|
/**
|
|
92
119
|
* @description Sets the border radius of the input.
|
|
93
120
|
*/
|
|
@@ -99,14 +126,14 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
99
126
|
/**
|
|
100
127
|
* @description Sets whether the spin buttons are visible.
|
|
101
128
|
*/
|
|
102
|
-
readonly spinners: _angular_core.
|
|
129
|
+
readonly spinners: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
103
130
|
/**
|
|
104
131
|
* @description Tab index of the input.
|
|
105
132
|
*/
|
|
106
133
|
readonly tabindex: _angular_core.InputSignal<number>;
|
|
107
134
|
/**
|
|
108
|
-
* @description Emitted when the
|
|
109
|
-
* The `FormField` directive listens to this to mark the field as touched.
|
|
135
|
+
* @description Emitted when focus leaves the component, as a native input is touched on blur. Typing and
|
|
136
|
+
* spinning don't count. The `FormField` directive listens to this to mark the field as touched.
|
|
110
137
|
*/
|
|
111
138
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
112
139
|
/**
|
|
@@ -114,7 +141,7 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
114
141
|
* this is written by the `FormField` directive.
|
|
115
142
|
* @default false
|
|
116
143
|
*/
|
|
117
|
-
readonly touched: _angular_core.
|
|
144
|
+
readonly touched: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
118
145
|
/**
|
|
119
146
|
* @description Additional CSS classes merged onto the host element via `tailwind-merge`.
|
|
120
147
|
* @default ""
|
|
@@ -129,12 +156,22 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
129
156
|
abstract readonly minValue: Signal<TValue | null>;
|
|
130
157
|
abstract readonly value: ModelSignal<TValue | null>;
|
|
131
158
|
constructor();
|
|
159
|
+
/** Steps the value down by `step` and moves focus to the input. */
|
|
132
160
|
decrease(): void;
|
|
133
|
-
|
|
161
|
+
/**
|
|
162
|
+
* Moves focus to the input, with the caret at the end.
|
|
163
|
+
* @param options passed to the native `focus()` call, for example `{ preventScroll: true }`.
|
|
164
|
+
*/
|
|
165
|
+
focus(options?: FocusOptions): void;
|
|
166
|
+
/** Steps the value up by `step` and moves focus to the input. */
|
|
134
167
|
increase(): void;
|
|
168
|
+
/** Runs when focus leaves an element inside the component: clamps the value and marks the field touched. */
|
|
135
169
|
onBlur(event: FocusEvent): void;
|
|
136
170
|
protected applyRawValue(text: string): void;
|
|
137
171
|
protected onPaste(event: ClipboardEvent): void;
|
|
172
|
+
protected onSpinPointerDown(event: PointerEvent, direction: NumericTextBoxStepDirection): void;
|
|
173
|
+
/** Limits a value to the min and max bounds. */
|
|
174
|
+
private clampValue;
|
|
138
175
|
private commitValue;
|
|
139
176
|
private correctValue;
|
|
140
177
|
private formatEditValue;
|
|
@@ -146,12 +183,13 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
146
183
|
private insertLocaleDecimal;
|
|
147
184
|
private parseValue;
|
|
148
185
|
private setBeforeInputSubscription;
|
|
149
|
-
private setInputFocusSubscription;
|
|
150
186
|
private setKeydownSubscription;
|
|
187
|
+
private setOwnValue;
|
|
151
188
|
private setSpinSubscription;
|
|
152
189
|
private setSubscriptions;
|
|
153
190
|
private setValueChangeSubscription;
|
|
154
191
|
private setWheelSubscription;
|
|
192
|
+
private spinToBound;
|
|
155
193
|
private spinValue;
|
|
156
194
|
/** Negative when `a < b`, zero when equal, positive when `a > b`. */
|
|
157
195
|
protected abstract compareValues(a: TValue, b: TValue): number;
|
|
@@ -162,7 +200,7 @@ declare abstract class NumericTextBoxBaseComponent<TValue extends number | strin
|
|
|
162
200
|
/** The value one step up or down from `value`. */
|
|
163
201
|
protected abstract stepValue(value: TValue, direction: NumericTextBoxStepDirection): TValue;
|
|
164
202
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NumericTextBoxBaseComponent<any>, never>;
|
|
165
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NumericTextBoxBaseComponent<any>, never, never, { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "decimals": { "alias": "decimals"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "nullable": { "alias": "nullable"; "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; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "spinners": { "alias": "spinners"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; "inputFocusOut": "inputFocusOut"; "touch": "touch"; }, ["prefixTemplateList"], never, true, never>;
|
|
203
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NumericTextBoxBaseComponent<any>, never, 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; }; "decimals": { "alias": "decimals"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "nullable": { "alias": "nullable"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "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; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "spinners": { "alias": "spinners"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, { "inputBlur": "inputBlur"; "inputFocus": "inputFocus"; "inputFocusOut": "inputFocusOut"; "touch": "touch"; }, ["prefixTemplateList"], never, true, never>;
|
|
166
204
|
}
|
|
167
205
|
|
|
168
206
|
/**
|
|
@@ -230,7 +268,10 @@ declare class NumericTextBoxComponent extends NumericTextBoxBaseComponent<number
|
|
|
230
268
|
*/
|
|
231
269
|
readonly value: _angular_core.ModelSignal<number | null>;
|
|
232
270
|
private static calculate;
|
|
271
|
+
/** The number of fraction digits, including those of exponent forms such as `1e-7`. */
|
|
233
272
|
private static getPrecision;
|
|
273
|
+
/** -0 reads and shows as "-0"; the field treats it as zero. */
|
|
274
|
+
private static withoutNegativeZero;
|
|
234
275
|
protected compareValues(a: number, b: number): number;
|
|
235
276
|
protected readEditText(text: string, localeId: string, decimals: number): NumericTextBoxTextResult<number>;
|
|
236
277
|
protected readLocaleText(text: string, localeId: string, decimals: number): NumericTextBoxTextResult<number>;
|