ngwr 13.0.0 → 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-border-glow.mjs +12 -3
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +14 -3
- package/fesm2022/ngwr-breadcrumbs.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 +13 -3
- 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-dialog.mjs +22 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +5 -2
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +30 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +24 -18
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +8 -3
- 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-fuzzy-text.mjs +21 -4
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +9 -2
- package/fesm2022/ngwr-gradient-text.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-icon-adapters-feather.mjs +11 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +22 -2
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +474 -37
- package/fesm2022/ngwr-icon.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-markdown.mjs +63 -11
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +104 -14
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +36 -7
- package/fesm2022/ngwr-overlay.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-qr.mjs +38 -1
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +93 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +10 -3
- package/fesm2022/ngwr-shiny-text.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 +104 -12
- 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 +143 -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 +11 -3
- 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-breadcrumbs.d.ts +1 -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-fuzzy-text.d.ts +5 -0
- package/types/ngwr-i18n.d.ts +89 -7
- package/types/ngwr-icon-adapters-feather.d.ts +11 -0
- package/types/ngwr-icon.d.ts +42 -1
- 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-shiny-text.d.ts +1 -0
- 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 +79 -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;
|
|
@@ -23,6 +23,11 @@ type WrFuzzyTextDirection = 'horizontal' | 'vertical' | 'both';
|
|
|
23
23
|
* @see https://www.reactbits.dev/text-animations/fuzzy-text
|
|
24
24
|
*/
|
|
25
25
|
declare class WrFuzzyText {
|
|
26
|
+
/**
|
|
27
|
+
* Visual-hiding declarations for the screen-reader copy of the text. A stable
|
|
28
|
+
* object literal, so the binding is written once rather than on every pass.
|
|
29
|
+
*/
|
|
30
|
+
protected readonly srOnly: Readonly<Record<string, string>>;
|
|
26
31
|
/** Text to render. */
|
|
27
32
|
readonly text: _angular_core.InputSignal<string>;
|
|
28
33
|
/** Font size as CSS length (`'4rem'`, `'72px'`, …) or px number. @default 'clamp(2rem, 10vw, 10rem)' */
|
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>;
|
|
@@ -20,6 +20,17 @@ import { WrIconDef } from 'ngwr/icon';
|
|
|
20
20
|
*
|
|
21
21
|
* provideWrIcons([feather('plus', featherIcons.plus)]);
|
|
22
22
|
* ```
|
|
23
|
+
*
|
|
24
|
+
* `innerSvg` is **markup**, not text — that is the shape upstream ships and the
|
|
25
|
+
* reason this adapter exists — so it is interpolated into the envelope
|
|
26
|
+
* verbatim. There is no escaping to add here: escaped markup is not markup.
|
|
27
|
+
* A `</svg>` in that input therefore closes the envelope early, and everything
|
|
28
|
+
* after it is a sibling of the icon rather than a child. Nothing executes
|
|
29
|
+
* regardless, because `<wr-icon>` never assigns the result to `innerHTML` — it
|
|
30
|
+
* rebuilds the first `<svg>` root from an allowlist and drops the rest. Feed
|
|
31
|
+
* this a map fetched at runtime and the sanitizer is what stands between it and
|
|
32
|
+
* the app's origin; feed it the `icons.json` from your own node_modules and
|
|
33
|
+
* neither matters.
|
|
23
34
|
*/
|
|
24
35
|
declare function feather(name: string, innerSvg: string): WrIconDef;
|
|
25
36
|
/**
|
package/types/ngwr-icon.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { Provider } from '@angular/core';
|
|
|
17
17
|
declare class WrIcon {
|
|
18
18
|
readonly name: i0.InputSignal<string>;
|
|
19
19
|
private readonly host;
|
|
20
|
+
private readonly doc;
|
|
20
21
|
/**
|
|
21
22
|
* Every icon visible from this position, walked up the whole chain of
|
|
22
23
|
* registering injector levels.
|
|
@@ -35,6 +36,22 @@ declare class WrIcon {
|
|
|
35
36
|
private readonly registry;
|
|
36
37
|
private readonly icon;
|
|
37
38
|
constructor();
|
|
39
|
+
/**
|
|
40
|
+
* `replaceChildren()` would say this in one call, but domino — the DOM
|
|
41
|
+
* `@angular/platform-server` renders into — does not implement it, and
|
|
42
|
+
* `innerHTML = ''` is the write Trusted Types refuses.
|
|
43
|
+
*/
|
|
44
|
+
private clear;
|
|
45
|
+
/**
|
|
46
|
+
* Say what the allowlist removed, once per registered icon.
|
|
47
|
+
*
|
|
48
|
+
* A silently stripped icon is the failure mode this rebuild could introduce:
|
|
49
|
+
* a consumer's own glyph renders blank or wrong and nothing anywhere says
|
|
50
|
+
* why. Keyed on the definition object, so a page with fifty instances of the
|
|
51
|
+
* same icon warns once and an icon nobody renders never warns at all.
|
|
52
|
+
*/
|
|
53
|
+
private reportStripped;
|
|
54
|
+
private static readonly reported;
|
|
38
55
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrIcon, never>;
|
|
39
56
|
static ɵcmp: i0.ɵɵComponentDeclaration<WrIcon, "wr-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
40
57
|
}
|
|
@@ -79,6 +96,15 @@ type WrIconName = string;
|
|
|
79
96
|
*/
|
|
80
97
|
interface WrIconDef {
|
|
81
98
|
name: WrIconName;
|
|
99
|
+
/**
|
|
100
|
+
* The icon's SVG markup, treated as **untrusted**: `<wr-icon>` rebuilds the
|
|
101
|
+
* first `<svg>` root from an allowlist of shape, paint and text elements
|
|
102
|
+
* rather than assigning the string to `innerHTML`, so event handlers,
|
|
103
|
+
* `<script>`, `<style>`, `<image>`, `<foreignObject>`, `<a>`, SMIL animation
|
|
104
|
+
* and non-fragment `href`s never reach the DOM. Registering a runtime-fetched
|
|
105
|
+
* or tenant-supplied icon set is therefore safe; dev mode warns whenever
|
|
106
|
+
* anything is dropped.
|
|
107
|
+
*/
|
|
82
108
|
data: string;
|
|
83
109
|
}
|
|
84
110
|
|
|
@@ -99,7 +125,13 @@ interface WrIconDef {
|
|
|
99
125
|
*
|
|
100
126
|
* In dev mode, each icon is validated for common issues (missing
|
|
101
127
|
* `viewBox`, malformed root). Validation is dropped from production
|
|
102
|
-
* builds via `isDevMode()` tree-shaking
|
|
128
|
+
* builds via `isDevMode()` tree-shaking, and it is a rendering check rather
|
|
129
|
+
* than a security one — see {@link validateIcon}.
|
|
130
|
+
*
|
|
131
|
+
* Icon `data` is treated as **untrusted** at render: `<wr-icon>` rebuilds the
|
|
132
|
+
* glyph from an allowlist instead of writing the string to `innerHTML`, so a
|
|
133
|
+
* set fetched at runtime or supplied by a tenant cannot execute in the app's
|
|
134
|
+
* origin. Dev mode names anything the allowlist removed.
|
|
103
135
|
*
|
|
104
136
|
* @example
|
|
105
137
|
* ```ts
|
|
@@ -165,6 +197,15 @@ declare function provideWrIcons(icons: WrIconDef[]): Provider[];
|
|
|
165
197
|
* ],
|
|
166
198
|
* });
|
|
167
199
|
* ```
|
|
200
|
+
*
|
|
201
|
+
* **`svg` is treated as untrusted.** It is a string, so it is a natural place
|
|
202
|
+
* for a tenant's uploaded logo or an icon pack fetched from an API to end up,
|
|
203
|
+
* and `<wr-icon>` used to write it to `innerHTML`. It no longer does: the glyph
|
|
204
|
+
* is rebuilt from an allowlist of SVG shape, paint and text elements, so
|
|
205
|
+
* `<script>`, `<style>`, `<image>`, `<foreignObject>`, `<a>`, SMIL animation,
|
|
206
|
+
* every `on*` handler, `style` attributes and non-fragment `href`s are dropped
|
|
207
|
+
* before anything reaches the DOM. In dev mode the component names what it
|
|
208
|
+
* removed, so a legitimate icon that loses something says so out loud.
|
|
168
209
|
*/
|
|
169
210
|
declare function svgIcon(name: string, svg: string): WrIconDef;
|
|
170
211
|
|
|
@@ -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 */
|