ngwr 13.0.1 → 14.0.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/README.md +13 -6
- package/color-picker/styles/_index.scss +43 -5
- package/fesm2022/ngwr-alert.mjs +5 -5
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +11 -1
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-blur-text.mjs +13 -2
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +4 -4
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs +15 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +51 -5
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +20 -1
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs +23 -7
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +89 -10
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +27 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +7 -1
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-date-adapters-fns.mjs +101 -33
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +10 -2
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +103 -13
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +480 -79
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +30 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +2 -1
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +1 -1
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +52 -12
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +63 -1
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +28 -1
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +150 -22
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +21 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +14 -7
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +20 -2
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs +73 -0
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -0
- package/fesm2022/ngwr-loading-bar.mjs +21 -32
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +104 -14
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +11 -10
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +65 -30
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +3 -2
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +2 -1
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +93 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +2 -1
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +35 -4
- package/fesm2022/ngwr-statistic.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +35 -12
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +158 -0
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -0
- package/fesm2022/ngwr-tabs-testing.mjs +13 -11
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +98 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +20 -1
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +1 -1
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +2 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +18 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +37 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window-testing.mjs +10 -2
- package/fesm2022/ngwr-window-testing.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +4 -4
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/i18n/en.json +33 -6
- package/i18n/ru.json +33 -6
- package/llms-full.txt +20 -11
- package/llms.txt +47 -16
- package/mcp/catalog.js +3 -3
- package/mcp/providers.js +11 -0
- package/package.json +9 -1
- package/schematics/migrations/v13/index.js +101 -0
- package/schematics/migrations/v14/index.js +422 -0
- package/schematics/migrations.json +10 -0
- package/schematics/page/templates.js +1 -1
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/SKILL.md +4 -1
- package/skills/ngwr/references/catalog.md +2 -0
- package/skills/ngwr/references/setup.md +4 -0
- package/stepper/styles/_index.scss +19 -1
- package/textarea/styles/_index.scss +14 -6
- package/toast/styles/_index.scss +12 -4
- package/types/ngwr-alert.d.ts +3 -3
- package/types/ngwr-blur-text.d.ts +8 -0
- package/types/ngwr-button.d.ts +2 -2
- package/types/ngwr-calendar-testing.d.ts +21 -4
- package/types/ngwr-calendar.d.ts +37 -0
- package/types/ngwr-circular-text.d.ts +9 -0
- package/types/ngwr-collapse.d.ts +19 -15
- package/types/ngwr-color-picker-testing.d.ts +10 -4
- package/types/ngwr-color-picker.d.ts +70 -2
- package/types/ngwr-command-palette.d.ts +14 -0
- package/types/ngwr-context-menu.d.ts +1 -1
- package/types/ngwr-date-adapters-fns.d.ts +71 -29
- package/types/ngwr-date-picker-testing.d.ts +206 -185
- package/types/ngwr-date-picker.d.ts +7 -0
- package/types/ngwr-date.d.ts +143 -13
- package/types/ngwr-drag-drop.d.ts +19 -0
- package/types/ngwr-dropdown.d.ts +1 -1
- package/types/ngwr-event-calendar-testing.d.ts +12 -9
- package/types/ngwr-file-upload.d.ts +31 -3
- package/types/ngwr-i18n.d.ts +89 -7
- package/types/ngwr-input-number.d.ts +1 -1
- package/types/ngwr-input-otp.d.ts +3 -0
- package/types/ngwr-input.d.ts +11 -4
- package/types/ngwr-knob-testing.d.ts +8 -4
- package/types/ngwr-knob.d.ts +18 -0
- package/types/ngwr-loading-bar-router.d.ts +35 -0
- package/types/ngwr-loading-bar.d.ts +19 -9
- package/types/ngwr-mention.d.ts +13 -0
- package/types/ngwr-pagination-testing.d.ts +11 -10
- package/types/ngwr-pagination.d.ts +39 -10
- package/types/ngwr-popconfirm.d.ts +1 -1
- package/types/ngwr-popover.d.ts +1 -1
- package/types/ngwr-select.d.ts +65 -10
- package/types/ngwr-splitter-testing.d.ts +9 -4
- package/types/ngwr-squircle.d.ts +1 -1
- package/types/ngwr-statistic.d.ts +22 -2
- package/types/ngwr-table.d.ts +24 -5
- package/types/ngwr-tabs-router.d.ts +67 -0
- package/types/ngwr-tabs-testing.d.ts +12 -10
- package/types/ngwr-tabs.d.ts +103 -6
- package/types/ngwr-textarea.d.ts +9 -0
- package/types/ngwr-tree.d.ts +7 -0
- package/types/ngwr-utils.d.ts +33 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window-testing.d.ts +11 -3
- package/types/ngwr-window.d.ts +11 -4
- package/window/styles/_index.scss +1 -1
package/types/ngwr-dropdown.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ declare class WrDropdown {
|
|
|
120
120
|
private focusItemAt;
|
|
121
121
|
private readonly onOverlayMouseLeave;
|
|
122
122
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrDropdown, never>;
|
|
123
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WrDropdown, "[wrDropdown]",
|
|
123
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WrDropdown, "[wrDropdown]", ["wrDropdown"], { "menu": { "alias": "wrDropdown"; "required": true; "isSignal": true; }; "trigger": { "alias": "trigger"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -8,6 +8,13 @@ import { WrCalendarView } from 'ngwr/event-calendar';
|
|
|
8
8
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* An arrow key, by the direction a user would say out loud — the parameter type
|
|
13
|
+
* shared by `WrEventCalendarHarness.pressArrow` and the chip harness's `move`,
|
|
14
|
+
* `resize` and `pressArrow`, exported so a consumer's own test helper can name
|
|
15
|
+
* what it forwards.
|
|
16
|
+
*/
|
|
17
|
+
type WrEventCalendarArrowKey = 'left' | 'right' | 'up' | 'down';
|
|
11
18
|
/** Narrows which `<wr-event-calendar>` a harness query matches. */
|
|
12
19
|
interface WrEventCalendarHarnessFilters extends BaseHarnessFilters {
|
|
13
20
|
/** Match the header title as printed — a string is an exact match, a RegExp is tested. */
|
|
@@ -35,8 +42,6 @@ interface WrEventCalendarChipHarnessFilters extends BaseHarnessFilters {
|
|
|
35
42
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
36
43
|
*/
|
|
37
44
|
|
|
38
|
-
/** The arrow keys, by the direction a user would say out loud. */
|
|
39
|
-
type Arrow$1 = 'left' | 'right' | 'up' | 'down';
|
|
40
45
|
/**
|
|
41
46
|
* Test harness for one event chip inside a {@link WrEventCalendarHarness}.
|
|
42
47
|
*
|
|
@@ -122,16 +127,16 @@ declare class WrEventCalendarChipHarness extends ComponentHarness {
|
|
|
122
127
|
* calendar without `editable` ignores the keys entirely — the same gate the pointer
|
|
123
128
|
* path uses.
|
|
124
129
|
*/
|
|
125
|
-
move(arrow:
|
|
130
|
+
move(arrow: WrEventCalendarArrowKey): Promise<void>;
|
|
126
131
|
/**
|
|
127
132
|
* Resize the event — `Alt` + `Shift` + an arrow, which moves the END alone.
|
|
128
133
|
*
|
|
129
134
|
* A resize that would end at or before the start emits nothing rather than
|
|
130
135
|
* inverting the event, which is the pointer path's rule too.
|
|
131
136
|
*/
|
|
132
|
-
resize(arrow:
|
|
137
|
+
resize(arrow: WrEventCalendarArrowKey): Promise<void>;
|
|
133
138
|
/** Press a bare arrow — which the chip ignores, letting the grid's own navigation run. */
|
|
134
|
-
pressArrow(arrow:
|
|
139
|
+
pressArrow(arrow: WrEventCalendarArrowKey): Promise<void>;
|
|
135
140
|
/** Press Escape — handing focus back to the cell the chip sits in. */
|
|
136
141
|
sendEscape(): Promise<void>;
|
|
137
142
|
}
|
|
@@ -143,8 +148,6 @@ declare class WrEventCalendarChipHarness extends ComponentHarness {
|
|
|
143
148
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
144
149
|
*/
|
|
145
150
|
|
|
146
|
-
/** The arrow keys, by the direction a user would say out loud. */
|
|
147
|
-
type Arrow = 'left' | 'right' | 'up' | 'down';
|
|
148
151
|
/**
|
|
149
152
|
* Test harness for `<wr-event-calendar>` — month, week and day in one component.
|
|
150
153
|
*
|
|
@@ -279,7 +282,7 @@ declare class WrEventCalendarHarness extends ComponentHarness {
|
|
|
279
282
|
* — the element carrying the keyboard should be the one that holds focus — and
|
|
280
283
|
* anything originating inside a chip is deliberately let through untouched.
|
|
281
284
|
*/
|
|
282
|
-
pressArrow(arrow:
|
|
285
|
+
pressArrow(arrow: WrEventCalendarArrowKey): Promise<void>;
|
|
283
286
|
/** Press Home on the cursor cell — the first day of its week. */
|
|
284
287
|
pressHome(): Promise<void>;
|
|
285
288
|
/** Press End on the cursor cell — the last day of its week. */
|
|
@@ -298,4 +301,4 @@ declare class WrEventCalendarHarness extends ComponentHarness {
|
|
|
298
301
|
}
|
|
299
302
|
|
|
300
303
|
export { WrEventCalendarChipHarness, WrEventCalendarHarness };
|
|
301
|
-
export type { WrEventCalendarChipHarnessFilters, WrEventCalendarHarnessFilters };
|
|
304
|
+
export type { WrEventCalendarArrowKey, WrEventCalendarChipHarnessFilters, WrEventCalendarHarnessFilters };
|
|
@@ -17,8 +17,6 @@ interface WrFileUploadRejection {
|
|
|
17
17
|
readonly reason: WrFileUploadRejectionReason;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
/** Human-readable byte size (e.g. `1.2 MB`). */
|
|
21
|
-
declare function formatBytes(bytes: number): string;
|
|
22
20
|
/**
|
|
23
21
|
* Drag-and-drop file upload zone. Click to browse, drag-and-drop to add,
|
|
24
22
|
* with an optional file list + remove buttons.
|
|
@@ -101,7 +99,37 @@ declare class WrFileUpload implements FormValueControl<File | readonly File[] |
|
|
|
101
99
|
protected readonly files: _angular_core.WritableSignal<readonly File[]>;
|
|
102
100
|
protected readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
103
101
|
protected readonly classes: _angular_core.Signal<string>;
|
|
104
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Human-readable file size (e.g. `1.2 MB`).
|
|
104
|
+
*
|
|
105
|
+
* Every piece of this used to be English and unreachable: a module-level unit
|
|
106
|
+
* table with no catalog key, and `toFixed()`, which writes an ASCII decimal
|
|
107
|
+
* point whatever `LOCALE_ID` says. A Russian page showed translated drop-zone
|
|
108
|
+
* copy above `3.4 KB`. The number now goes through `Intl.NumberFormat` and the
|
|
109
|
+
* unit through the catalog, joined by a template the catalog also owns — so a
|
|
110
|
+
* locale controls the separator, the digits and whether a space sits before
|
|
111
|
+
* the unit.
|
|
112
|
+
*
|
|
113
|
+
* Not a `computed`: it is called per file, with the file's size as its
|
|
114
|
+
* argument. It still re-runs on a locale switch, because the formatters it
|
|
115
|
+
* calls are signals read during the same change detection that renders the row.
|
|
116
|
+
*/
|
|
117
|
+
protected formatBytes(bytes: number): string;
|
|
118
|
+
/** `{{value}} {{unit}}` — the join, so a locale owns the space too. */
|
|
119
|
+
private readonly sizeText;
|
|
120
|
+
/**
|
|
121
|
+
* One resolved signal per binary unit, indexed by the power of 1024 the
|
|
122
|
+
* arithmetic lands on.
|
|
123
|
+
*
|
|
124
|
+
* Spelled out rather than built from a key list: `i18n.spec.ts` reads every
|
|
125
|
+
* catalog key the library asks for out of the SOURCE, by matching a quoted
|
|
126
|
+
* dotted string inside the call, so a key built by interpolation is invisible
|
|
127
|
+
* to it. That spec fails rather than passing quietly, but either way the key
|
|
128
|
+
* would stop being checked.
|
|
129
|
+
*/
|
|
130
|
+
private readonly unitTexts;
|
|
131
|
+
private readonly locale;
|
|
132
|
+
private number;
|
|
105
133
|
constructor();
|
|
106
134
|
protected openPicker(): void;
|
|
107
135
|
protected onZoneKey(event: KeyboardEvent): void;
|
package/types/ngwr-i18n.d.ts
CHANGED
|
@@ -19,9 +19,25 @@ type WrI18nParams = Readonly<Record<string, unknown>>;
|
|
|
19
19
|
type WrI18nMissingHandler = (key: string, locale: string) => string;
|
|
20
20
|
/** User-facing config for {@link provideWrI18n}. */
|
|
21
21
|
interface WrI18nConfig {
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* BCP-47 tag used until the user calls `use()`.
|
|
24
|
+
*
|
|
25
|
+
* Omitted, it is Angular's own `LOCALE_ID` — the app already states its
|
|
26
|
+
* locale there, and ngwr having a second, unrelated default is how a fully
|
|
27
|
+
* Russian app came to render an English calendar inside itself. See
|
|
28
|
+
* {@link WrI18n} for the whole precedence.
|
|
29
|
+
*
|
|
30
|
+
* @default LOCALE_ID
|
|
31
|
+
*/
|
|
23
32
|
readonly defaultLocale?: string;
|
|
24
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Whitelisted locales — `use()` ignores anything outside this list. Omitted,
|
|
35
|
+
* it is `[defaultLocale]`: it used to be a hardcoded `['en']`, so
|
|
36
|
+
* `provideWrI18n({ defaultLocale: 'ru' })` produced a service whose own
|
|
37
|
+
* default locale was not switchable back to.
|
|
38
|
+
*
|
|
39
|
+
* @default [defaultLocale]
|
|
40
|
+
*/
|
|
25
41
|
readonly availableLocales?: readonly string[];
|
|
26
42
|
/**
|
|
27
43
|
* Storage key for persisting the active locale (via `WrStorage`).
|
|
@@ -38,7 +54,11 @@ interface WrI18nConfigResolved {
|
|
|
38
54
|
readonly storageKey: string | null;
|
|
39
55
|
readonly missingHandler: WrI18nMissingHandler;
|
|
40
56
|
}
|
|
41
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Everything but the locale, which cannot be a constant: it is resolved from
|
|
59
|
+
* `LOCALE_ID` in an injection context. @internal
|
|
60
|
+
*/
|
|
61
|
+
declare const DEFAULT_WR_I18N_CONFIG: Omit<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'>;
|
|
42
62
|
declare const WR_I18N_CONFIG: InjectionToken<WrI18nConfigResolved>;
|
|
43
63
|
|
|
44
64
|
/**
|
|
@@ -56,9 +76,39 @@ declare const WR_I18N_CONFIG: InjectionToken<WrI18nConfigResolved>;
|
|
|
56
76
|
* - a per-locale signal counter so every `translate()` reading the signal
|
|
57
77
|
* re-evaluates the moment a new catalog finishes loading
|
|
58
78
|
*
|
|
59
|
-
* Translations are looked up scope-first
|
|
60
|
-
*
|
|
61
|
-
* `
|
|
79
|
+
* Translations are looked up scope-first then root, per locale, and the locale
|
|
80
|
+
* itself is tried as the full tag before the bare language underneath it — so
|
|
81
|
+
* an app running `ru-RU` resolves against a catalog registered as `ru`, and a
|
|
82
|
+
* regional catalog is never shadowed by a scope in the base language. For an
|
|
83
|
+
* app that spells its locale one way, which is every app that existed before
|
|
84
|
+
* the chain, the order is exactly what it always was.
|
|
85
|
+
*
|
|
86
|
+
* ## Which locale wins
|
|
87
|
+
*
|
|
88
|
+
* ngwr has three locale inputs and they used to be three unrelated answers — an
|
|
89
|
+
* app that set `LOCALE_ID: 'ru-RU'` correctly still rendered an English
|
|
90
|
+
* calendar, because the date token defaulted to `navigator.language`. The
|
|
91
|
+
* precedence is now stated, highest first:
|
|
92
|
+
*
|
|
93
|
+
* 1. **A subsystem's own explicit option.** `provideWrDateAdapter({ locale })`
|
|
94
|
+
* pins dates; `provideWrI18n({ defaultLocale })` pins the catalog. The most
|
|
95
|
+
* specific statement wins, because it can only have been deliberate.
|
|
96
|
+
* 2. **`WrI18n.locale()` — the runtime value.** The only one of the three that
|
|
97
|
+
* can change without a reload, so it is what a language switcher writes.
|
|
98
|
+
* 3. **`LOCALE_ID`.** Angular's app-wide constant, and the seed for both of the
|
|
99
|
+
* above when neither was given. One statement, one answer.
|
|
100
|
+
* 4. `'en-US'`, which is what `LOCALE_ID` itself falls back to.
|
|
101
|
+
*
|
|
102
|
+
* `navigator.language` is deliberately NOT in that list. It is the browser's
|
|
103
|
+
* preference, not the application's, and reading it made prerendered output and
|
|
104
|
+
* the hydrated page disagree.
|
|
105
|
+
*
|
|
106
|
+
* **What a runtime switch reaches, and what it does not.** `use()` repaints
|
|
107
|
+
* every catalog string. It does not move `LOCALE_ID`, which is a constant, so
|
|
108
|
+
* anything keyed on it — `wrDate` / `wrNumber` / `wrPlural`, `wr-input-number`,
|
|
109
|
+
* `wr-statistic`, `wr-counter` — and anything keyed on `WR_DATE_LOCALE` — the
|
|
110
|
+
* date adapter, and so `wr-calendar` and `wr-date-picker` — stays where it was.
|
|
111
|
+
* `use()` says so once in dev mode rather than leaving it to be discovered.
|
|
62
112
|
*
|
|
63
113
|
* @example
|
|
64
114
|
* ```ts
|
|
@@ -76,6 +126,11 @@ declare class WrI18n {
|
|
|
76
126
|
private readonly config;
|
|
77
127
|
private readonly loader;
|
|
78
128
|
private readonly storage;
|
|
129
|
+
/**
|
|
130
|
+
* Angular's own locale. Read for the dev-mode drift warning only — the
|
|
131
|
+
* resolved default already folded it in through `WR_I18N_CONFIG`. @internal
|
|
132
|
+
*/
|
|
133
|
+
private readonly localeId;
|
|
79
134
|
/**
|
|
80
135
|
* Catalogs registered via `provideWrI18nBaseCatalogs()` — the floor under the
|
|
81
136
|
* loader's own catalogs, so ngwr's built-in strings survive an app that only
|
|
@@ -94,7 +149,14 @@ declare class WrI18n {
|
|
|
94
149
|
private readonly _locale;
|
|
95
150
|
readonly locale: Signal<string>;
|
|
96
151
|
constructor();
|
|
97
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* Switch active locale. Ignored when not whitelisted.
|
|
154
|
+
*
|
|
155
|
+
* Text only — see the class docs for what a runtime switch cannot reach. The
|
|
156
|
+
* dev-mode warning below is the whole reporting of that limit; without it the
|
|
157
|
+
* failure is a screen showing German labels beside `3/15/2026`, with nothing
|
|
158
|
+
* anywhere saying why.
|
|
159
|
+
*/
|
|
98
160
|
use(locale: string): void;
|
|
99
161
|
/** Available locales — pass-through from config. */
|
|
100
162
|
available(): readonly string[];
|
|
@@ -118,6 +180,26 @@ declare class WrI18n {
|
|
|
118
180
|
*/
|
|
119
181
|
private walkBase;
|
|
120
182
|
private initialLocale;
|
|
183
|
+
/**
|
|
184
|
+
* Load a `(locale, scope)` catalog and, when the locale carries a region, the
|
|
185
|
+
* bare-language one under it. Both go in the cache; `t()` reads them in that
|
|
186
|
+
* order.
|
|
187
|
+
*/
|
|
188
|
+
private loadChain;
|
|
189
|
+
/** One warning per service, not one per switch. @internal */
|
|
190
|
+
private warnedLocaleIdDrift;
|
|
191
|
+
/**
|
|
192
|
+
* Say once, in dev, that a runtime switch moved the text and nothing else.
|
|
193
|
+
*
|
|
194
|
+
* The mismatch is otherwise invisible in the way that costs the most time:
|
|
195
|
+
* the catalog strings all change, which reads as "the switch worked", and the
|
|
196
|
+
* dates and numbers beside them are still correct-looking output in the old
|
|
197
|
+
* locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is
|
|
198
|
+
* out of step and a warning that fires when everything agrees is one people
|
|
199
|
+
* learn to ignore. Production builds drop the call entirely via `isDevMode()`
|
|
200
|
+
* tree-shaking.
|
|
201
|
+
*/
|
|
202
|
+
private warnOnLocaleIdDrift;
|
|
121
203
|
private loadCatalog;
|
|
122
204
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrI18n, never>;
|
|
123
205
|
static ɵprov: i0.ɵɵInjectableDeclaration<WrI18n>;
|
|
@@ -53,7 +53,7 @@ declare class WrInputNumber implements FormValueControl<number | null> {
|
|
|
53
53
|
*/
|
|
54
54
|
readonly rounded: _angular_core.InputSignalWithTransform<boolean | null, BooleanInput>;
|
|
55
55
|
/**
|
|
56
|
-
* `size`, then the app config, then `md` — bound to the field's `[
|
|
56
|
+
* `size`, then the app config, then `md` — bound to the field's `[size]`.
|
|
57
57
|
*
|
|
58
58
|
* The chrome this control is built from resolves the same pair for itself, so
|
|
59
59
|
* the config lookup falls through to `input.*` rather than stopping at
|
|
@@ -111,6 +111,9 @@ declare class WrInputOtp implements FormValueControl<string> {
|
|
|
111
111
|
protected readonly cellRefs: _angular_core.Signal<readonly ElementRef<HTMLInputElement>[]>;
|
|
112
112
|
constructor();
|
|
113
113
|
protected onInput(event: Event, index: number): void;
|
|
114
|
+
/** @see onInput — this is where an IME's text finally arrives. */
|
|
115
|
+
protected onCompositionEnd(event: CompositionEvent, index: number): void;
|
|
116
|
+
private commitCell;
|
|
114
117
|
protected onKeyDown(event: KeyboardEvent, index: number): void;
|
|
115
118
|
protected onPaste(event: ClipboardEvent): void;
|
|
116
119
|
protected onBlur(): void;
|
package/types/ngwr-input.d.ts
CHANGED
|
@@ -69,11 +69,18 @@ declare class WrInput {
|
|
|
69
69
|
protected readonly ariaInvalid: _angular_core.Signal<"true" | null>;
|
|
70
70
|
protected readonly describedBy: _angular_core.Signal<string | null>;
|
|
71
71
|
/**
|
|
72
|
-
* Control size.
|
|
73
|
-
* native `<input size>` attribute. Unset, it falls back to
|
|
72
|
+
* Control size. Unset, it falls back to
|
|
74
73
|
* `provideWrConfig({ input: { size } })`. @default 'md'
|
|
74
|
+
*
|
|
75
|
+
* Called `wrSize` until v14, to dodge the native `<input size>` attribute —
|
|
76
|
+
* which measures the field in characters and which `.wr-input`'s `width: 100%`
|
|
77
|
+
* has always overridden, so the clash it guarded against was never observable.
|
|
78
|
+
* It made this the one size input in the catalog spelled differently from the
|
|
79
|
+
* other twenty-three. The cost of the change is that a consumer who wanted the
|
|
80
|
+
* NATIVE `size` on an ngwr input can no longer have it — but `width: 100%`
|
|
81
|
+
* meant they never did.
|
|
75
82
|
*/
|
|
76
|
-
readonly
|
|
83
|
+
readonly size: _angular_core.InputSignal<WrInputSize | null>;
|
|
77
84
|
/**
|
|
78
85
|
* Pill-shaped corners. Unset, it falls back to
|
|
79
86
|
* `provideWrConfig({ input: { rounded } })`; `[rounded]="false"` turns a
|
|
@@ -84,7 +91,7 @@ declare class WrInput {
|
|
|
84
91
|
protected readonly resolvedRounded: _angular_core.Signal<boolean>;
|
|
85
92
|
protected readonly classes: _angular_core.Signal<string>;
|
|
86
93
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrInput, never>;
|
|
87
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WrInput, "input[wrInput], textarea[wrInput]", never, { "
|
|
94
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<WrInput, "input[wrInput], textarea[wrInput]", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
/**
|
|
@@ -7,6 +7,12 @@ import { BaseHarnessFilters, ComponentHarness, HarnessPredicate } from '@angular
|
|
|
7
7
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* An arrow key, by the direction a user would say out loud — the parameter type
|
|
12
|
+
* of `WrKnobHarness.pressArrow`, exported so a consumer's own test helper can name
|
|
13
|
+
* what it forwards.
|
|
14
|
+
*/
|
|
15
|
+
type WrKnobArrowKey = 'left' | 'right' | 'up' | 'down';
|
|
10
16
|
/** Narrows which `<wr-knob>` a harness query matches. */
|
|
11
17
|
interface WrKnobHarnessFilters extends BaseHarnessFilters {
|
|
12
18
|
/** Match the dial's accessible name — a string is an exact match, a RegExp is tested. */
|
|
@@ -26,8 +32,6 @@ interface WrKnobHarnessFilters extends BaseHarnessFilters {
|
|
|
26
32
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
27
33
|
*/
|
|
28
34
|
|
|
29
|
-
/** The two arrow keys that raise the value, and the two that lower it. */
|
|
30
|
-
type Arrow = 'left' | 'right' | 'up' | 'down';
|
|
31
35
|
/**
|
|
32
36
|
* Test harness for `<wr-knob>` — the radial dial.
|
|
33
37
|
*
|
|
@@ -105,7 +109,7 @@ declare class WrKnobHarness extends ComponentHarness {
|
|
|
105
109
|
* component, which has one axis and no mirroring to do. `shift` multiplies the step
|
|
106
110
|
* by ten.
|
|
107
111
|
*/
|
|
108
|
-
pressArrow(arrow:
|
|
112
|
+
pressArrow(arrow: WrKnobArrowKey, options?: {
|
|
109
113
|
shift?: boolean;
|
|
110
114
|
}): Promise<void>;
|
|
111
115
|
/** Press Home — the bottom of the range. */
|
|
@@ -147,4 +151,4 @@ declare class WrKnobHarness extends ComponentHarness {
|
|
|
147
151
|
}
|
|
148
152
|
|
|
149
153
|
export { WrKnobHarness };
|
|
150
|
-
export type { WrKnobHarnessFilters };
|
|
154
|
+
export type { WrKnobArrowKey, WrKnobHarnessFilters };
|
package/types/ngwr-knob.d.ts
CHANGED
|
@@ -95,6 +95,24 @@ declare class WrKnob implements FormValueControl<number> {
|
|
|
95
95
|
* template this one otherwise mirrors, emits on blur for exactly this reason.
|
|
96
96
|
*/
|
|
97
97
|
protected onBlur(): void;
|
|
98
|
+
/**
|
|
99
|
+
* The APG slider keys, and they do NOT mirror under `dir="rtl"` — which is a
|
|
100
|
+
* decision, not an oversight, and the one place it is written down.
|
|
101
|
+
*
|
|
102
|
+
* `wr-slider` swaps ArrowLeft and ArrowRight in RTL because its TRACK mirrors:
|
|
103
|
+
* the thumb is placed with `inset-inline-start`, so the visual maximum moves to
|
|
104
|
+
* the left and a key naming a side has to move with it. This dial does not
|
|
105
|
+
* mirror. It is an SVG gauge drawn in a fixed 100×100 viewBox, and SVG content
|
|
106
|
+
* is not reordered by the reading direction — the arc sweeps clockwise from 7
|
|
107
|
+
* o'clock to 5 o'clock in every locale, the same way a clock face or a car's
|
|
108
|
+
* rev counter does. So ArrowRight still moves the handle toward the visually
|
|
109
|
+
* right-hand side of the arc in RTL, and swapping the keys would be the thing
|
|
110
|
+
* that broke the mapping.
|
|
111
|
+
*
|
|
112
|
+
* That is why nothing here injects `Directionality`, and why the stylesheet
|
|
113
|
+
* carries no `rtl-ok:` marker: there is no physical CSS in the value path at
|
|
114
|
+
* all, only fixed SVG geometry.
|
|
115
|
+
*/
|
|
98
116
|
protected onKeydown(event: KeyboardEvent): void;
|
|
99
117
|
/**
|
|
100
118
|
* Nearest step, measured FROM `min`. A grid anchored at zero offers values the
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EnvironmentProviders } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Drive {@link WrLoadingBar} from router navigations: `NavigationStart` takes a
|
|
12
|
+
* slot, and each of `NavigationEnd` / `NavigationCancel` / `NavigationError`
|
|
13
|
+
* releases one.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { provideWrLoadingBarRouter } from 'ngwr/loading-bar/router';
|
|
18
|
+
*
|
|
19
|
+
* bootstrapApplication(App, {
|
|
20
|
+
* providers: [provideRouter(routes), provideWrLoadingBarRouter()],
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* **Why this is a call and not the default.** `WrLoadingBar` used to inject
|
|
25
|
+
* `Router` itself, so navigations drove the bar with no configuration — and
|
|
26
|
+
* every app that rendered `<wr-loading-bar>` paid 66.3 kB of `@angular/router`
|
|
27
|
+
* for it, two thirds of the entry point's total cost, whether or not it had
|
|
28
|
+
* routes. `{ optional: true }` does not help: an optional inject still names the
|
|
29
|
+
* class as the token, and it measured byte-for-byte identical to a required one.
|
|
30
|
+
* An automatic integration and a router-free bundle cannot both exist in a
|
|
31
|
+
* statically linked app, so the automatic half moved here.
|
|
32
|
+
*/
|
|
33
|
+
declare function provideWrLoadingBarRouter(): EnvironmentProviders;
|
|
34
|
+
|
|
35
|
+
export { provideWrLoadingBarRouter };
|
|
@@ -5,12 +5,19 @@ import { Signal } from '@angular/core';
|
|
|
5
5
|
type WrLoadingState = 'idle' | 'running' | 'completing';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Singleton state machine for a top-of-page progress indicator
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Singleton state machine for a top-of-page progress indicator: a counter of
|
|
9
|
+
* in-flight tasks and a tween between 0 and 1, driven through `start()` /
|
|
10
|
+
* `complete()`.
|
|
11
11
|
*
|
|
12
12
|
* Pair with `<wr-loading-bar>` to render the bar at the top of your shell.
|
|
13
13
|
*
|
|
14
|
+
* It knows nothing about the router on purpose. Naming `Router` here — even
|
|
15
|
+
* `{ optional: true }`, which is byte-for-byte identical to a required inject —
|
|
16
|
+
* put 66.3 kB of `@angular/router` into every app that rendered the bar,
|
|
17
|
+
* two thirds of what `ngwr/loading-bar` cost and 27× the component's own code.
|
|
18
|
+
* Call `provideWrLoadingBarRouter()` from `ngwr/loading-bar/router` to have
|
|
19
|
+
* navigations drive it.
|
|
20
|
+
*
|
|
14
21
|
* @example
|
|
15
22
|
* ```ts
|
|
16
23
|
* // From an HttpInterceptor:
|
|
@@ -22,8 +29,6 @@ type WrLoadingState = 'idle' | 'running' | 'completing';
|
|
|
22
29
|
* @see https://ngwr.dev/reference/services/loading-bar
|
|
23
30
|
*/
|
|
24
31
|
declare class WrLoadingBar {
|
|
25
|
-
private readonly router;
|
|
26
|
-
private readonly destroyRef;
|
|
27
32
|
private readonly isBrowser;
|
|
28
33
|
/** Live count of pending "tasks" (manual + router). */
|
|
29
34
|
private readonly count;
|
|
@@ -33,7 +38,6 @@ declare class WrLoadingBar {
|
|
|
33
38
|
readonly state: Signal<WrLoadingState>;
|
|
34
39
|
private timer;
|
|
35
40
|
private holdTimer;
|
|
36
|
-
constructor();
|
|
37
41
|
/** Reserve a slot. The bar starts trickling as long as `count > 0`. */
|
|
38
42
|
start(): void;
|
|
39
43
|
/** Release a slot. When the last one closes, the bar fast-forwards to 100% then resets. */
|
|
@@ -51,9 +55,15 @@ declare class WrLoadingBar {
|
|
|
51
55
|
/**
|
|
52
56
|
* Thin progress bar fixed to the top of the viewport.
|
|
53
57
|
*
|
|
54
|
-
* Drop one at the root of your shell. Reads the singleton {@link WrLoadingBar}
|
|
55
|
-
*
|
|
56
|
-
*
|
|
58
|
+
* Drop one at the root of your shell. Reads the singleton {@link WrLoadingBar},
|
|
59
|
+
* which is driven manually by `start()` / `complete()` — an HTTP interceptor, a
|
|
60
|
+
* long save, anything with a beginning and an end.
|
|
61
|
+
*
|
|
62
|
+
* Router navigations drive it too, but only once you add
|
|
63
|
+
* `provideWrLoadingBarRouter()` from `ngwr/loading-bar/router`. That is an opt-in
|
|
64
|
+
* because the subscription is what pulls `@angular/router` into the bundle: this
|
|
65
|
+
* component is 2.4 kB of its own code and used to carry 66 kB of router into
|
|
66
|
+
* apps that never routed.
|
|
57
67
|
*
|
|
58
68
|
* @example
|
|
59
69
|
* ```html
|
package/types/ngwr-mention.d.ts
CHANGED
|
@@ -105,6 +105,19 @@ declare class WrMention<T extends WrMentionItem = WrMentionItem> {
|
|
|
105
105
|
private liveRegion;
|
|
106
106
|
constructor();
|
|
107
107
|
private announce;
|
|
108
|
+
/**
|
|
109
|
+
* True between `compositionstart` and `compositionend`.
|
|
110
|
+
*
|
|
111
|
+
* Detection must not run on the half-built text an IME leaves in the field:
|
|
112
|
+
* `@やま` is a reading on its way to `@山田`, and matching the reading opens a
|
|
113
|
+
* panel that then eats the Enter meant to accept the conversion. So the field
|
|
114
|
+
* is read once, on `compositionend`, when the text is real.
|
|
115
|
+
*/
|
|
116
|
+
private composing;
|
|
117
|
+
/** @internal */
|
|
118
|
+
protected onCompositionStart(): void;
|
|
119
|
+
/** @internal */
|
|
120
|
+
protected onCompositionEnd(): void;
|
|
108
121
|
/** @internal */
|
|
109
122
|
protected onInput(): void;
|
|
110
123
|
/** @internal */
|
|
@@ -20,11 +20,11 @@ interface WrPaginationHarnessFilters extends BaseHarnessFilters {
|
|
|
20
20
|
readonly label?: string | RegExp;
|
|
21
21
|
/**
|
|
22
22
|
* Match the page the pager announces as current via `aria-current="page"`. A
|
|
23
|
-
* pager announcing none — `
|
|
23
|
+
* pager announcing none — `page` set below 1 — matches no value here
|
|
24
24
|
* rather than throwing, so one broken pager cannot fail a query for its
|
|
25
25
|
* neighbour.
|
|
26
26
|
*/
|
|
27
|
-
readonly
|
|
27
|
+
readonly page?: number;
|
|
28
28
|
/** Match only enabled (`false`) or only disabled (`true`) pagers. */
|
|
29
29
|
readonly disabled?: boolean;
|
|
30
30
|
}
|
|
@@ -179,7 +179,7 @@ declare class WrPaginationHarness extends ComponentHarness {
|
|
|
179
179
|
* The page the pager announces as current, from `aria-current="page"`.
|
|
180
180
|
*
|
|
181
181
|
* Throws when no cell claims it. The window always keeps the current page on the
|
|
182
|
-
* strip, so getting here means `
|
|
182
|
+
* strip, so getting here means `page` is not one of the pages at all. The
|
|
183
183
|
* component clamps a host write into `1..totalPages`, which leaves one survivor:
|
|
184
184
|
* a fractional page, which is in range and matches no cell — and which leaves
|
|
185
185
|
* every cell looking equally inactive to an assistive tech user.
|
|
@@ -191,7 +191,7 @@ declare class WrPaginationHarness extends ComponentHarness {
|
|
|
191
191
|
* Throws when that page is not on the strip — a seven-slot window over twenty
|
|
192
192
|
* pages simply has no cell for page 15, and a silent no-op there reads as
|
|
193
193
|
* "navigation is broken" three assertions later. Step with {@link next} /
|
|
194
|
-
* {@link previous}, or move the host's own `
|
|
194
|
+
* {@link previous}, or move the host's own `page` model.
|
|
195
195
|
*
|
|
196
196
|
* A disabled pager is still clicked; the component's own guard is what refuses
|
|
197
197
|
* the move, so assert the page rather than assume it. Clicking the CURRENT page
|
|
@@ -233,14 +233,15 @@ declare class WrPaginationHarness extends ComponentHarness {
|
|
|
233
233
|
/** Whether the pager shows its "X–Y of Z" label (the `showTotal` input). */
|
|
234
234
|
hasTotal(): Promise<boolean>;
|
|
235
235
|
/**
|
|
236
|
-
* The total label exactly as rendered, e.g. `1
|
|
236
|
+
* The total label exactly as rendered, e.g. `1–10 of 95`.
|
|
237
237
|
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
238
|
+
* The WHOLE string is one catalog entry (`pagination.range`) and the three
|
|
239
|
+
* numbers in it are formatted per `LOCALE_ID`, so a spec asserting the literal
|
|
240
|
+
* owns both the copy and the locale it asserts under. Note the range separator
|
|
241
|
+
* is an en dash, not the ASCII hyphen this used to print.
|
|
241
242
|
*
|
|
242
243
|
* Throws when the label is not rendered, which is a `showTotal` that was never
|
|
243
|
-
* set rather than a total of zero (a zero total still renders `0
|
|
244
|
+
* set rather than a total of zero (a zero total still renders `0–0 of 0`).
|
|
244
245
|
*/
|
|
245
246
|
getTotalText(): Promise<string>;
|
|
246
247
|
/** Whether the pager renders its page-size changer (the `showSizeChanger` input). */
|
|
@@ -277,7 +278,7 @@ declare class WrPaginationHarness extends ComponentHarness {
|
|
|
277
278
|
* {@link getPageSize} reads them: `20 / page` and `20 / стр.` are the same option.
|
|
278
279
|
* Throws when no option offers that size, naming what is on offer.
|
|
279
280
|
*
|
|
280
|
-
* Changing the size can move the page — the component pulls `
|
|
281
|
+
* Changing the size can move the page — the component pulls `page` back
|
|
281
282
|
* when the new size leaves it past the end — so re-read {@link getCurrentPage}
|
|
282
283
|
* afterwards rather than assuming it held.
|
|
283
284
|
*/
|