ngwr 16.0.0 → 16.2.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/badge/styles/_tag.scss +8 -4
- package/button/styles/_index.scss +13 -7
- package/cascader/styles/_rules.scss +4 -2
- package/checkbox/styles/_index.scss +4 -2
- package/date-picker/styles/_index.scss +95 -3
- package/date-stamp/styles/_index.scss +38 -0
- package/dialog/styles/_index.scss +38 -0
- package/dropdown/styles/_index.scss +37 -1
- package/fesm2022/internal-CVLvP9b_.mjs +33 -0
- package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +11 -7
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +11 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +10 -6
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +18 -6
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -6
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +8 -4
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +19 -8
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -5
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +11 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +10 -6
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +2 -1
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +9 -5
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +4 -2
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-comment.mjs +13 -7
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +9 -3
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +4 -2
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +11 -6
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +238 -38
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-stamp.mjs +213 -0
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
- package/fesm2022/ngwr-date.mjs +364 -54
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +9 -5
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +23 -2
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +45 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +102 -11
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +4 -2
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +29 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +362 -26
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +5 -2
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +4 -2
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +9 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -6
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +9 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +9 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +9 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +9 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +9 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +9 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +9 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +9 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +9 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +9 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +9 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +9 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +9 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +9 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +9 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +9 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +9 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +9 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +9 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +9 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +9 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +34 -8
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +9 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +4 -2
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +20 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +9 -3
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +9 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +13 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +255 -15
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +13 -5
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +9 -5
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +84 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +3 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +47 -9
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +93 -4
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +4 -2
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +9 -5
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +9 -3
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-resizable.mjs +503 -0
- package/fesm2022/ngwr-resizable.mjs.map +1 -0
- package/fesm2022/ngwr-result.mjs +9 -5
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +3 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +4 -2
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +13 -5
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +4 -2
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider-testing.mjs +17 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +91 -13
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
- package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sortable-list.mjs +257 -53
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +4 -2
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +4 -2
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +17 -21
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +9 -3
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +9 -5
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +5 -1
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +167 -10
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +9 -3
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +18 -8
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +6 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +529 -104
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +4 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +9 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs +18 -2
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +9 -2
- 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.mjs +7 -4
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/fesm2022/ngwr.mjs.map +1 -1
- package/i18n/ar.json +13 -2
- package/i18n/cs.json +13 -2
- package/i18n/de.json +13 -2
- package/i18n/en.json +13 -2
- package/i18n/es.json +13 -2
- package/i18n/fr.json +13 -2
- package/i18n/he.json +13 -2
- package/i18n/hi.json +13 -2
- package/i18n/id.json +13 -2
- package/i18n/it.json +13 -2
- package/i18n/ja.json +13 -2
- package/i18n/ko.json +13 -2
- package/i18n/nl.json +13 -2
- package/i18n/pl.json +13 -2
- package/i18n/pt.json +13 -2
- package/i18n/ru.json +13 -2
- package/i18n/sv.json +13 -2
- package/i18n/tr.json +13 -2
- package/i18n/uk.json +13 -2
- package/i18n/vi.json +13 -2
- package/i18n/zh-TW.json +13 -2
- package/i18n/zh.json +13 -2
- package/input/styles/_index.scss +10 -5
- package/input-number/styles/_index.scss +6 -3
- package/input-otp/styles/_index.scss +4 -2
- package/lightbox/styles/_rules.scss +96 -0
- package/llms-full.txt +40 -17
- package/llms.txt +20 -4
- package/package.json +19 -1
- package/radio/styles/_index.scss +4 -2
- package/resizable/styles/_index.scss +154 -0
- package/schematics/use/rule.js +1 -0
- package/schematics/use/symbol-map.json +5 -0
- package/select/styles/_index.scss +6 -3
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +6 -2
- package/skills/ngwr/references/setup.md +3 -0
- package/slider/styles/_index.scss +106 -0
- package/sortable-list/styles/_rules.scss +23 -1
- package/switch/styles/_index.scss +4 -2
- package/table/styles/_index.scss +53 -0
- package/textarea/styles/_index.scss +4 -2
- package/theme/styles/_motion.scss +6 -0
- package/toast/styles/_index.scss +19 -0
- package/types/ngwr-burger.d.ts +0 -1
- package/types/ngwr-calendar.d.ts +7 -0
- package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
- package/types/ngwr-clipboard.d.ts +7 -0
- package/types/ngwr-date-picker-testing.d.ts +17 -0
- package/types/ngwr-date-picker.d.ts +88 -4
- package/types/ngwr-date-stamp-testing.d.ts +47 -0
- package/types/ngwr-date-stamp.d.ts +127 -0
- package/types/ngwr-date.d.ts +251 -37
- package/types/ngwr-dialog-testing.d.ts +10 -0
- package/types/ngwr-dialog.d.ts +72 -4
- package/types/ngwr-directives.d.ts +36 -1
- package/types/ngwr-drawer.d.ts +21 -0
- package/types/ngwr-dropdown-testing.d.ts +53 -5
- package/types/ngwr-dropdown.d.ts +100 -0
- package/types/ngwr-i18n.d.ts +44 -14
- package/types/ngwr-lightbox-testing.d.ts +27 -0
- package/types/ngwr-lightbox.d.ts +71 -6
- package/types/ngwr-overlay.d.ts +36 -0
- package/types/ngwr-pipes.d.ts +48 -13
- package/types/ngwr-popover.d.ts +39 -1
- package/types/ngwr-resizable.d.ts +228 -0
- package/types/ngwr-slider-testing.d.ts +8 -1
- package/types/ngwr-slider.d.ts +89 -3
- package/types/ngwr-sortable-list-testing.d.ts +79 -0
- package/types/ngwr-sortable-list.d.ts +113 -10
- package/types/ngwr-table-testing.d.ts +3 -1
- package/types/ngwr-table.d.ts +120 -4
- package/types/ngwr-toast-testing.d.ts +12 -1
- package/types/ngwr-toast.d.ts +215 -18
- package/types/ngwr-utils-router.d.ts +22 -0
- package/types/ngwr-utils.d.ts +8 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr.d.ts +1 -0
package/types/ngwr-drawer.d.ts
CHANGED
|
@@ -75,6 +75,14 @@ interface WrDrawerOptions<D = unknown> {
|
|
|
75
75
|
* splitting happens here.
|
|
76
76
|
*/
|
|
77
77
|
readonly panelClass?: WrClassInput;
|
|
78
|
+
/**
|
|
79
|
+
* Where the global toast stack paints while this drawer is open. `'below'`
|
|
80
|
+
* keeps it under the drawer and its backdrop. Toasts in a
|
|
81
|
+
* `<wr-toast-outlet>` are page content and are under every drawer anyway.
|
|
82
|
+
* With overlays stacked, the top one decides.
|
|
83
|
+
* @default 'above'
|
|
84
|
+
*/
|
|
85
|
+
readonly toasts?: 'above' | 'below';
|
|
78
86
|
}
|
|
79
87
|
/**
|
|
80
88
|
* Side panel that slides in from an edge of the viewport. Two-way binds
|
|
@@ -153,6 +161,12 @@ export declare class WrDrawer {
|
|
|
153
161
|
* pane, so one name has to mean the same surface on both paths.
|
|
154
162
|
*/
|
|
155
163
|
readonly panelClass: import("@angular/core").InputSignal<WrClassInput>;
|
|
164
|
+
/**
|
|
165
|
+
* Where the global toast stack paints while the drawer is open. `'below'`
|
|
166
|
+
* keeps it under the drawer and its backdrop. Read when the drawer opens.
|
|
167
|
+
* @default 'above'
|
|
168
|
+
*/
|
|
169
|
+
readonly toasts: import("@angular/core").InputSignal<"below" | "above">;
|
|
156
170
|
protected readonly resolvedCloseLabel: import("@angular/core").Signal<string>;
|
|
157
171
|
protected readonly panelTpl: import("@angular/core").Signal<TemplateRef<any>>;
|
|
158
172
|
/**
|
|
@@ -170,6 +184,7 @@ export declare class WrDrawer {
|
|
|
170
184
|
protected panelClasses(): string;
|
|
171
185
|
private readonly focusMonitor;
|
|
172
186
|
private readonly overlay;
|
|
187
|
+
private readonly order;
|
|
173
188
|
private readonly vcr;
|
|
174
189
|
private readonly destroyRef;
|
|
175
190
|
private readonly injector;
|
|
@@ -282,6 +297,11 @@ export declare class WrDrawer {
|
|
|
282
297
|
"required": false;
|
|
283
298
|
"isSignal": true;
|
|
284
299
|
};
|
|
300
|
+
"toasts": {
|
|
301
|
+
"alias": "toasts";
|
|
302
|
+
"required": false;
|
|
303
|
+
"isSignal": true;
|
|
304
|
+
};
|
|
285
305
|
}, {
|
|
286
306
|
"open": "openChange";
|
|
287
307
|
}, ["projectedTitle"], ["*"], true, never>;
|
|
@@ -388,6 +408,7 @@ export declare class WrDrawerManager {
|
|
|
388
408
|
private readonly isBrowser;
|
|
389
409
|
private readonly i18n;
|
|
390
410
|
private readonly location;
|
|
411
|
+
private readonly order;
|
|
391
412
|
/**
|
|
392
413
|
* The application's reading direction — the instance the CDK itself read when
|
|
393
414
|
* it stamped the overlay. A root service has no node injector above it, so a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseHarnessFilters, ComponentHarness, ContentContainerComponentHarness, HarnessLoader, HarnessPredicate } from "@angular/cdk/testing";
|
|
1
|
+
import { BaseHarnessFilters, ComponentHarness, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessLoader, HarnessPredicate, TestElement } from "@angular/cdk/testing";
|
|
2
2
|
/** Narrows which `[wrDropdown]` trigger a harness query matches. */
|
|
3
3
|
interface WrDropdownHarnessFilters extends BaseHarnessFilters {
|
|
4
4
|
/**
|
|
@@ -40,6 +40,8 @@ export declare class WrDropdownItemHarness extends ComponentHarness {
|
|
|
40
40
|
getRole(): Promise<string | null>;
|
|
41
41
|
/** Whether the item refuses activation. */
|
|
42
42
|
isDisabled(): Promise<boolean>;
|
|
43
|
+
/** Whether the item opens a submenu. `WrDropdownHarness.openSubmenu()` opens it. */
|
|
44
|
+
hasSubmenu(): Promise<boolean>;
|
|
43
45
|
/** Whether the item shows a leading icon. */
|
|
44
46
|
hasIcon(): Promise<boolean>;
|
|
45
47
|
/** The leading icon's registered name, or `null` when the item has no icon. */
|
|
@@ -71,8 +73,8 @@ export declare class WrDropdownItemHarness extends ComponentHarness {
|
|
|
71
73
|
* That scoped loader is also this harness's CONTENT loader, so
|
|
72
74
|
* `dropdown.getHarness(…)` resolves inside THIS dropdown's menu: the consumer's
|
|
73
75
|
* own components in the menu are reachable without the spec ever touching the
|
|
74
|
-
* overlay, and so is a nested `[wrDropdown]
|
|
75
|
-
*
|
|
76
|
+
* overlay, and so is a nested `[wrDropdown]`. A submenu is reached with
|
|
77
|
+
* `openSubmenu()`, which answers with a harness scoped to that submenu.
|
|
76
78
|
*
|
|
77
79
|
* @example
|
|
78
80
|
* ```ts
|
|
@@ -90,7 +92,7 @@ export declare class WrDropdownHarness extends ContentContainerComponentHarness
|
|
|
90
92
|
/** The directive's host — whatever element the consumer put `[wrDropdown]` on. */
|
|
91
93
|
static hostSelector: string;
|
|
92
94
|
/** Build a predicate that narrows the query. */
|
|
93
|
-
static with(options?: WrDropdownHarnessFilters): HarnessPredicate<
|
|
95
|
+
static with<T extends WrDropdownHarness>(this: ComponentHarnessConstructor<T>, options?: WrDropdownHarnessFilters): HarnessPredicate<T>;
|
|
94
96
|
/** The trigger's visible text. */
|
|
95
97
|
getTriggerText(): Promise<string>;
|
|
96
98
|
/** Whether the menu is showing. */
|
|
@@ -149,6 +151,14 @@ export declare class WrDropdownHarness extends ContentContainerComponentHarness
|
|
|
149
151
|
* the menu, so a consumer who wants one calls `close()` themselves.
|
|
150
152
|
*/
|
|
151
153
|
clickItem(filters: WrDropdownItemHarnessFilters): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Open the menu if it is closed, then open the submenu of the item with this
|
|
156
|
+
* label and answer with its harness: `getItems()`, `clickItem()` and a further
|
|
157
|
+
* `openSubmenu()` all read that submenu and nothing else.
|
|
158
|
+
*
|
|
159
|
+
* A click opens it, since hovering waits out the item's `showDelay`.
|
|
160
|
+
*/
|
|
161
|
+
openSubmenu(text: string | RegExp): Promise<WrDropdownSubmenuHarness>;
|
|
152
162
|
/**
|
|
153
163
|
* The label of the item that currently holds focus, or `null` when focus is
|
|
154
164
|
* elsewhere.
|
|
@@ -169,8 +179,46 @@ export declare class WrDropdownHarness extends ContentContainerComponentHarness
|
|
|
169
179
|
*/
|
|
170
180
|
protected getRootHarnessLoader(): Promise<HarnessLoader>;
|
|
171
181
|
/** This dropdown's menu element in the overlay. */
|
|
172
|
-
|
|
182
|
+
protected menu(): Promise<TestElement>;
|
|
173
183
|
/** The id the trigger publishes as `aria-controls`, which its menu carries. */
|
|
174
184
|
private menuId;
|
|
175
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Test harness for an item carrying `[wrDropdownSubmenu]`, and the submenu it
|
|
188
|
+
* opens. Usually reached through `openSubmenu()` on the level above.
|
|
189
|
+
*
|
|
190
|
+
* It is a `WrDropdownHarness` whose trigger is the item, so everything that
|
|
191
|
+
* reads a menu reads the submenu, scoped the same way, by the id the item
|
|
192
|
+
* publishes. Two things differ. `hoverTrigger()` opens nothing by itself: the
|
|
193
|
+
* item waits out its `showDelay`, which is the spec's own fake timer to
|
|
194
|
+
* advance. And clicking a leaf item closes every submenu, so `clickItem()`
|
|
195
|
+
* leaves this one closed, while the root menu stays open as it always has.
|
|
196
|
+
*
|
|
197
|
+
* Which side the submenu opened on is not readable: jsdom has no layout.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```ts
|
|
201
|
+
* const file = await loader.getHarness(WrDropdownHarness.with({ text: 'File' }));
|
|
202
|
+
* const exportAs = await file.openSubmenu('Export');
|
|
203
|
+
*
|
|
204
|
+
* expect(await exportAs.getItemTexts()).toEqual(['CSV', 'PDF', 'Excel']);
|
|
205
|
+
* await exportAs.clickItem({ text: 'CSV' });
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* @see https://ngwr.dev/guides/testing
|
|
209
|
+
*/
|
|
210
|
+
export declare class WrDropdownSubmenuHarness extends WrDropdownHarness {
|
|
211
|
+
/** The class the directive puts on its item. */
|
|
212
|
+
static hostSelector: string;
|
|
213
|
+
/** Open the submenu with a click on its item. */
|
|
214
|
+
open(): Promise<void>;
|
|
215
|
+
/**
|
|
216
|
+
* Open the submenu from the keyboard, with Enter on its item. Enter rather
|
|
217
|
+
* than the arrow because the arrow that opens a submenu depends on the
|
|
218
|
+
* reading direction, and Enter does not.
|
|
219
|
+
*/
|
|
220
|
+
openByKeyboard(): Promise<void>;
|
|
221
|
+
/** Close the submenu with Escape typed inside it, which closes this level only. */
|
|
222
|
+
close(): Promise<void>;
|
|
223
|
+
}
|
|
176
224
|
export type { WrDropdownHarnessFilters, WrDropdownItemHarnessFilters };
|
package/types/ngwr-dropdown.d.ts
CHANGED
|
@@ -138,6 +138,8 @@ export declare class WrDropdown {
|
|
|
138
138
|
*/
|
|
139
139
|
protected get triggerId(): string;
|
|
140
140
|
private overlayRef;
|
|
141
|
+
/** The root menu's link to the submenus open below it. */
|
|
142
|
+
private level;
|
|
141
143
|
constructor();
|
|
142
144
|
/** Open the menu. */
|
|
143
145
|
open(): void;
|
|
@@ -181,7 +183,12 @@ export declare class WrDropdown {
|
|
|
181
183
|
/** @internal Trigger keydown — ArrowDown/Up/Enter/Space open the menu. */
|
|
182
184
|
protected onKeydown(event: KeyboardEvent): void;
|
|
183
185
|
private handleMenuKeydown;
|
|
186
|
+
/** The focus stops of `pane`, the root menu's own by default. */
|
|
184
187
|
private getItems;
|
|
188
|
+
/** Whether `node` is in the root menu or in a submenu open below it. */
|
|
189
|
+
private inMenus;
|
|
190
|
+
/** A `trigger="hover"` menu closes once the pointer is off the trigger and every pane. */
|
|
191
|
+
private onMenusLeave;
|
|
185
192
|
private focusItemAt;
|
|
186
193
|
private readonly onOverlayMouseLeave;
|
|
187
194
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrDropdown, never>;
|
|
@@ -249,4 +256,97 @@ export declare class WrDropdownItem {
|
|
|
249
256
|
};
|
|
250
257
|
}, {}, never, ["*"], true, never>;
|
|
251
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Put on a `<wr-dropdown-item>` to open another `<wr-dropdown-menu>` beside it.
|
|
261
|
+
* The submenu's own items can carry it too, to any depth.
|
|
262
|
+
*
|
|
263
|
+
* @example
|
|
264
|
+
* ```html
|
|
265
|
+
* <button [wrDropdown]="file">File</button>
|
|
266
|
+
*
|
|
267
|
+
* <wr-dropdown-menu #file>
|
|
268
|
+
* <wr-dropdown-item>New</wr-dropdown-item>
|
|
269
|
+
* <wr-dropdown-item [wrDropdownSubmenu]="exportAs">Export</wr-dropdown-item>
|
|
270
|
+
* </wr-dropdown-menu>
|
|
271
|
+
*
|
|
272
|
+
* <wr-dropdown-menu #exportAs>
|
|
273
|
+
* <wr-dropdown-item (click)="export('csv')">CSV</wr-dropdown-item>
|
|
274
|
+
* <wr-dropdown-item (click)="export('pdf')">PDF</wr-dropdown-item>
|
|
275
|
+
* </wr-dropdown-menu>
|
|
276
|
+
* ```
|
|
277
|
+
*
|
|
278
|
+
* @see https://ngwr.dev/reference/components/dropdown
|
|
279
|
+
*/
|
|
280
|
+
export declare class WrDropdownSubmenu {
|
|
281
|
+
/** Menu to open beside the item. Pass a `<wr-dropdown-menu>` template reference. */
|
|
282
|
+
readonly menu: import("@angular/core").InputSignal<WrDropdownMenu>;
|
|
283
|
+
/** How long the pointer rests on the item before the submenu opens, in ms. @default 150 */
|
|
284
|
+
readonly showDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
285
|
+
/**
|
|
286
|
+
* How long the submenu stays once the pointer has left both the item and the
|
|
287
|
+
* submenu, in ms. Long enough to cross a neighbouring item on the way in.
|
|
288
|
+
* @default 150
|
|
289
|
+
*/
|
|
290
|
+
readonly hideDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
291
|
+
private readonly host;
|
|
292
|
+
private readonly focusMonitor;
|
|
293
|
+
private readonly overlay;
|
|
294
|
+
private readonly dir;
|
|
295
|
+
private readonly outsideClick;
|
|
296
|
+
private readonly vcr;
|
|
297
|
+
private readonly scrollStrategies;
|
|
298
|
+
private readonly injector;
|
|
299
|
+
private readonly openState;
|
|
300
|
+
/** Whether the submenu is open. Read-only: `open()` and `close()` change it. */
|
|
301
|
+
readonly isOpen: import("@angular/core").Signal<boolean>;
|
|
302
|
+
private readonly fallbackId;
|
|
303
|
+
/** The consumer's own `id` wins, read fresh for the reason `WrDropdown` gives. */
|
|
304
|
+
protected get itemId(): string;
|
|
305
|
+
private overlayRef;
|
|
306
|
+
private level;
|
|
307
|
+
private outside;
|
|
308
|
+
private showTimer;
|
|
309
|
+
private hideTimer;
|
|
310
|
+
constructor();
|
|
311
|
+
/** Open the submenu and move focus to its first item. The item has to be in an open menu. */
|
|
312
|
+
open(): void;
|
|
313
|
+
/** Close the submenu and every submenu below it. */
|
|
314
|
+
close(): void;
|
|
315
|
+
/** @internal A real click opens; Enter and Space arrive as a click with no pointer behind it. */
|
|
316
|
+
protected onClick(event: MouseEvent): void;
|
|
317
|
+
/** @internal The arrow pointing the way the menus cascade walks into the submenu. */
|
|
318
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
319
|
+
/** @internal */
|
|
320
|
+
protected onMouseEnter(): void;
|
|
321
|
+
/** @internal */
|
|
322
|
+
protected onMouseLeave(event: MouseEvent): void;
|
|
323
|
+
private get disabled();
|
|
324
|
+
/** A pointer shows the submenu and leaves the caret alone; the keyboard walks in. */
|
|
325
|
+
private show;
|
|
326
|
+
private attach;
|
|
327
|
+
private dispose;
|
|
328
|
+
private hideLater;
|
|
329
|
+
private readonly clearTimers;
|
|
330
|
+
private readonly onPaneLeave;
|
|
331
|
+
/** Choosing a leaf closes every submenu, up to the root menu's own item. */
|
|
332
|
+
private readonly onPaneClick;
|
|
333
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WrDropdownSubmenu, never>;
|
|
334
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<WrDropdownSubmenu, "[wrDropdownSubmenu]", ["wrDropdownSubmenu"], {
|
|
335
|
+
"menu": {
|
|
336
|
+
"alias": "wrDropdownSubmenu";
|
|
337
|
+
"required": true;
|
|
338
|
+
"isSignal": true;
|
|
339
|
+
};
|
|
340
|
+
"showDelay": {
|
|
341
|
+
"alias": "showDelay";
|
|
342
|
+
"required": false;
|
|
343
|
+
"isSignal": true;
|
|
344
|
+
};
|
|
345
|
+
"hideDelay": {
|
|
346
|
+
"alias": "hideDelay";
|
|
347
|
+
"required": false;
|
|
348
|
+
"isSignal": true;
|
|
349
|
+
};
|
|
350
|
+
}, {}, never, never, true, never>;
|
|
351
|
+
}
|
|
252
352
|
export type { WrDropdownPosition, WrDropdownTrigger };
|
package/types/ngwr-i18n.d.ts
CHANGED
|
@@ -7,6 +7,19 @@ interface WrI18nCatalog {
|
|
|
7
7
|
}
|
|
8
8
|
/** Parameters passed to interpolation — coerced to strings via `String(v)`. */
|
|
9
9
|
type WrI18nParams = Readonly<Record<string, unknown>>;
|
|
10
|
+
/**
|
|
11
|
+
* The third argument of `WrI18n.t()`, `WrI18n.translate()` and the `wrT` pipe,
|
|
12
|
+
* where a bare string is the scope.
|
|
13
|
+
*/
|
|
14
|
+
interface WrI18nTranslateOptions {
|
|
15
|
+
/** Scoped lookup first, then the root catalog. */
|
|
16
|
+
readonly scope?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Returned as is when the key is missing: no interpolation, no
|
|
19
|
+
* `missingHandler` call. `null` and `undefined` mean no fallback.
|
|
20
|
+
*/
|
|
21
|
+
readonly fallback?: string | null;
|
|
22
|
+
}
|
|
10
23
|
/** Hook called once on every key that resolves to nothing. */
|
|
11
24
|
type WrI18nMissingHandler = (key: string, locale: string) => string;
|
|
12
25
|
/** User-facing config for {@link provideWrI18n}. */
|
|
@@ -79,6 +92,7 @@ export declare const WR_I18N_CONFIG: InjectionToken<WrI18nConfigResolved>;
|
|
|
79
92
|
* specific statement wins, because it can only have been deliberate.
|
|
80
93
|
* 2. **`WrI18n.locale()` — the runtime value.** The only one of the three that
|
|
81
94
|
* can change without a reload, so it is what a language switcher writes.
|
|
95
|
+
* With `provideWrI18n()` in the app, dates are written in it.
|
|
82
96
|
* 3. **`LOCALE_ID`.** Angular's app-wide constant, and the seed for both of the
|
|
83
97
|
* above when neither was given. One statement, one answer.
|
|
84
98
|
* 4. `'en-US'`, which is what `LOCALE_ID` itself falls back to.
|
|
@@ -88,11 +102,12 @@ export declare const WR_I18N_CONFIG: InjectionToken<WrI18nConfigResolved>;
|
|
|
88
102
|
* the hydrated page disagree.
|
|
89
103
|
*
|
|
90
104
|
* **What a runtime switch reaches, and what it does not.** `use()` repaints
|
|
91
|
-
* every catalog string
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
105
|
+
* every catalog string, and every date: the date adapter, and so
|
|
106
|
+
* `wr-calendar`, `wr-date-picker`, `wrDate` and `wr-date-stamp`, formats in
|
|
107
|
+
* this locale unless `withDates({ locale })` pinned another. It does not move
|
|
108
|
+
* `LOCALE_ID`, which is a constant, so anything keyed on it — `wrNumber` /
|
|
109
|
+
* `wrPlural`, `wr-input-number`, `wr-statistic`, `wr-counter` — stays where it
|
|
110
|
+
* was. `use()` says so once in dev mode rather than leaving it to be
|
|
96
111
|
* discovered.
|
|
97
112
|
*
|
|
98
113
|
* @example
|
|
@@ -101,6 +116,7 @@ export declare const WR_I18N_CONFIG: InjectionToken<WrI18nConfigResolved>;
|
|
|
101
116
|
* i18n.use('ru'); // switch locale
|
|
102
117
|
* i18n.t('cart.checkout'); // → 'Оформить заказ'
|
|
103
118
|
* i18n.t('greeting', { name: 'Ada' }); // → 'Hello, Ada!'
|
|
119
|
+
* i18n.t(`types.${type}`, undefined, { fallback: type }); // → type, when no key
|
|
104
120
|
*
|
|
105
121
|
* effect(() => console.log(i18n.translate('hi')())); // re-runs on locale change
|
|
106
122
|
* ```
|
|
@@ -137,9 +153,9 @@ export declare class WrI18n {
|
|
|
137
153
|
/**
|
|
138
154
|
* Switch active locale. Ignored when not whitelisted.
|
|
139
155
|
*
|
|
140
|
-
* Text
|
|
156
|
+
* Text and dates — see the class docs for what a runtime switch cannot reach. The
|
|
141
157
|
* dev-mode warning below is the whole reporting of that limit; without it the
|
|
142
|
-
* failure is a screen showing German labels beside `
|
|
158
|
+
* failure is a screen showing German labels beside `1,234.5`, with nothing
|
|
143
159
|
* anywhere saying why.
|
|
144
160
|
*/
|
|
145
161
|
use(locale: string): void;
|
|
@@ -155,10 +171,15 @@ export declare class WrI18n {
|
|
|
155
171
|
* Eager translate — returns the current value or the missing-handler
|
|
156
172
|
* fallback. Does NOT auto-load missing catalogs; combine with the
|
|
157
173
|
* reactive `translate(...)` if you want load-on-demand.
|
|
174
|
+
*
|
|
175
|
+
* The third argument is a scope, or `{ scope, fallback }`. With a `fallback`
|
|
176
|
+
* a missing key returns it as is, not interpolated, and `missingHandler` is
|
|
177
|
+
* not called: for a key built from a server value that may have no
|
|
178
|
+
* translation.
|
|
158
179
|
*/
|
|
159
|
-
t(key: string, params?: WrI18nParams,
|
|
180
|
+
t(key: string, params?: WrI18nParams, scopeOrOptions?: string | WrI18nTranslateOptions): string;
|
|
160
181
|
/** Reactive translate — re-evaluates on locale or catalog updates. */
|
|
161
|
-
translate(key: string, params?: WrI18nParams,
|
|
182
|
+
translate(key: string, params?: WrI18nParams, scopeOrOptions?: string | WrI18nTranslateOptions): Signal<string>;
|
|
162
183
|
/**
|
|
163
184
|
* Look a key up in the registered base catalogs, later contributions first so
|
|
164
185
|
* a feature can shadow an earlier one.
|
|
@@ -177,9 +198,9 @@ export declare class WrI18n {
|
|
|
177
198
|
* Say once, in dev, that a runtime switch moved the text and nothing else.
|
|
178
199
|
*
|
|
179
200
|
* The mismatch is otherwise invisible in the way that costs the most time:
|
|
180
|
-
* the catalog strings all change, which reads as "the switch
|
|
181
|
-
*
|
|
182
|
-
* locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is
|
|
201
|
+
* the catalog strings and the dates all change, which reads as "the switch
|
|
202
|
+
* worked", and the numbers beside them are still correct-looking output in
|
|
203
|
+
* the old locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is
|
|
183
204
|
* out of step and a warning that fires when everything agrees is one people
|
|
184
205
|
* learn to ignore. Production builds drop the call entirely via `isDevMode()`
|
|
185
206
|
* tree-shaking.
|
|
@@ -198,11 +219,12 @@ export declare class WrI18n {
|
|
|
198
219
|
* <h1>{{ 'home.title' | wrT }}</h1>
|
|
199
220
|
* <p>{{ 'greeting' | wrT: { name: user().name } }}</p>
|
|
200
221
|
* <button>{{ 'forms.save' | wrT: null : 'checkout' }}</button>
|
|
222
|
+
* <span>{{ 'types.' + type | wrT: null : { fallback: type } }}</span>
|
|
201
223
|
* ```
|
|
202
224
|
*/
|
|
203
225
|
export declare class WrTPipe implements PipeTransform {
|
|
204
226
|
private readonly i18n;
|
|
205
|
-
transform(key: string, params?: WrI18nParams | null,
|
|
227
|
+
transform(key: string, params?: WrI18nParams | null, scopeOrOptions?: string | WrI18nTranslateOptions): string;
|
|
206
228
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrTPipe, never>;
|
|
207
229
|
static ɵpipe: i0.ɵɵPipeDeclaration<WrTPipe, "wrT", true>;
|
|
208
230
|
}
|
|
@@ -215,6 +237,7 @@ export declare class WrTPipe implements PipeTransform {
|
|
|
215
237
|
* <span [wrT]="'home.title'"></span>
|
|
216
238
|
* <span [wrT]="'greeting'" [wrTParams]="{ name: user().name }"></span>
|
|
217
239
|
* <span [wrT]="'forms.save'" wrTScope="checkout"></span>
|
|
240
|
+
* <span [wrT]="'types.' + type" [wrTFallback]="type"></span>
|
|
218
241
|
* ```
|
|
219
242
|
*/
|
|
220
243
|
export declare class WrTDirective {
|
|
@@ -224,6 +247,8 @@ export declare class WrTDirective {
|
|
|
224
247
|
readonly wrTParams: import("@angular/core").InputSignal<Readonly<Record<string, unknown>> | null>;
|
|
225
248
|
/** Optional scope — scoped lookup first, then root fallback. */
|
|
226
249
|
readonly wrTScope: import("@angular/core").InputSignal<string | null>;
|
|
250
|
+
/** Text shown as is when the key is missing; `missingHandler` is not called. */
|
|
251
|
+
readonly wrTFallback: import("@angular/core").InputSignal<string | null>;
|
|
227
252
|
private readonly host;
|
|
228
253
|
private readonly i18n;
|
|
229
254
|
private readonly text;
|
|
@@ -245,6 +270,11 @@ export declare class WrTDirective {
|
|
|
245
270
|
"required": false;
|
|
246
271
|
"isSignal": true;
|
|
247
272
|
};
|
|
273
|
+
"wrTFallback": {
|
|
274
|
+
"alias": "wrTFallback";
|
|
275
|
+
"required": false;
|
|
276
|
+
"isSignal": true;
|
|
277
|
+
};
|
|
248
278
|
}, {}, never, never, true, never>;
|
|
249
279
|
}
|
|
250
280
|
/**
|
|
@@ -469,4 +499,4 @@ export declare function wrReadI18nText(key: string, fallback: string): Signal<st
|
|
|
469
499
|
* ```
|
|
470
500
|
*/
|
|
471
501
|
export declare function useI18nFormatter(key: string, fallback: string): (params?: WrI18nParams) => string;
|
|
472
|
-
export type { ProvideWrI18nOptions, WrI18nBaseCatalogs, WrI18nCatalog, WrI18nConfig, WrI18nConfigResolved, WrI18nHttpLoaderConfig, WrI18nLoader, WrI18nMissingHandler, WrI18nParams, WrI18nStaticCatalogs, WrI18nStaticScopedCatalogs };
|
|
502
|
+
export type { ProvideWrI18nOptions, WrI18nBaseCatalogs, WrI18nCatalog, WrI18nConfig, WrI18nConfigResolved, WrI18nHttpLoaderConfig, WrI18nLoader, WrI18nMissingHandler, WrI18nParams, WrI18nStaticCatalogs, WrI18nStaticScopedCatalogs, WrI18nTranslateOptions };
|
|
@@ -99,6 +99,32 @@ export declare class WrLightboxHarness extends ComponentHarness {
|
|
|
99
99
|
sendEscape(): Promise<void>;
|
|
100
100
|
/** The full-size image's `src`. Throws while the viewer is closed. */
|
|
101
101
|
getFullSrc(): Promise<string>;
|
|
102
|
+
/**
|
|
103
|
+
* The image the viewer is showing right now.
|
|
104
|
+
*
|
|
105
|
+
* {@link getFullSrc} under the name a gallery spec reads better with: after
|
|
106
|
+
* {@link next} it is another member's `src`, not this lightbox's own.
|
|
107
|
+
*/
|
|
108
|
+
getCurrentSrc(): Promise<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Go to the next image of the group through the viewer's button.
|
|
111
|
+
*
|
|
112
|
+
* At the last image without `loop` the button is `aria-disabled` and the click
|
|
113
|
+
* lands on nothing — read {@link isNextDisabled} to tell the two apart. Throws on
|
|
114
|
+
* a lightbox that is closed, or that has no gallery to move through.
|
|
115
|
+
*/
|
|
116
|
+
next(): Promise<void>;
|
|
117
|
+
/** Go to the previous image of the group. The mirror of {@link next}. */
|
|
118
|
+
previous(): Promise<void>;
|
|
119
|
+
/** Whether the next button reports the end of the group (`aria-disabled`). */
|
|
120
|
+
isNextDisabled(): Promise<boolean>;
|
|
121
|
+
/** Whether the previous button reports the start of the group (`aria-disabled`). */
|
|
122
|
+
isPreviousDisabled(): Promise<boolean>;
|
|
123
|
+
/**
|
|
124
|
+
* The counter as drawn, e.g. `2 / 3`, or `null` for a lightbox outside a gallery.
|
|
125
|
+
* Throws while the viewer is closed.
|
|
126
|
+
*/
|
|
127
|
+
getCounter(): Promise<string | null>;
|
|
102
128
|
/** The caption under the full image, or `null` when there is none. Throws while closed. */
|
|
103
129
|
getCaption(): Promise<string | null>;
|
|
104
130
|
/** The name the viewer dialog announces — its alt text, or the catalog's fallback. */
|
|
@@ -131,6 +157,7 @@ export declare class WrLightboxHarness extends ComponentHarness {
|
|
|
131
157
|
/** The id the trigger currently points at, or `null` while the viewer is closed. */
|
|
132
158
|
private viewerId;
|
|
133
159
|
private requireViewer;
|
|
160
|
+
private navButton;
|
|
134
161
|
private viewerPart;
|
|
135
162
|
}
|
|
136
163
|
export type { WrLightboxHarnessFilters };
|
package/types/ngwr-lightbox.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import { Signal, TemplateRef } from "@angular/core";
|
|
3
3
|
import { WrClassInput } from "ngwr/utils";
|
|
4
4
|
/**
|
|
5
5
|
* Image with click-to-zoom lightbox. The thumbnail is a plain `<img>`
|
|
@@ -7,6 +7,9 @@ import { WrClassInput } from "ngwr/utils";
|
|
|
7
7
|
* overlay showing the full image, with Escape + close button + backdrop
|
|
8
8
|
* to dismiss.
|
|
9
9
|
*
|
|
10
|
+
* Lightboxes that share a `group` form a gallery in document order: the viewer
|
|
11
|
+
* gains previous and next buttons, a counter and the arrow keys.
|
|
12
|
+
*
|
|
10
13
|
* @example
|
|
11
14
|
* ```html
|
|
12
15
|
* <wr-lightbox
|
|
@@ -23,7 +26,7 @@ export declare class WrLightbox {
|
|
|
23
26
|
readonly openLabel: import("@angular/core").InputSignal<string | null>;
|
|
24
27
|
/** Accessible name of the viewer's close button. Falls back to `image.close`, then `'Close preview'`. */
|
|
25
28
|
readonly closeLabel: import("@angular/core").InputSignal<string | null>;
|
|
26
|
-
protected readonly resolvedCloseLabel:
|
|
29
|
+
protected readonly resolvedCloseLabel: Signal<string>;
|
|
27
30
|
/** Image source. */
|
|
28
31
|
readonly src: import("@angular/core").InputSignal<string>;
|
|
29
32
|
/** Alt text. Required for a11y; falls back to an empty string. @default '' */
|
|
@@ -34,8 +37,8 @@ export declare class WrLightbox {
|
|
|
34
37
|
* to it later.
|
|
35
38
|
*/
|
|
36
39
|
readonly preview: import("@angular/core").InputSignal<string | null>;
|
|
37
|
-
protected readonly resolvedOpenLabel:
|
|
38
|
-
protected readonly resolvedViewerLabel:
|
|
40
|
+
protected readonly resolvedOpenLabel: Signal<string>;
|
|
41
|
+
protected readonly resolvedViewerLabel: Signal<string>;
|
|
39
42
|
/** Disable the click-to-zoom lightbox. @default false */
|
|
40
43
|
readonly disablePreview: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
41
44
|
/** Caption shown under the full image in the lightbox. */
|
|
@@ -57,6 +60,22 @@ export declare class WrLightbox {
|
|
|
57
60
|
* handle on it. A space-separated string works as well as an array.
|
|
58
61
|
*/
|
|
59
62
|
readonly panelClass: import("@angular/core").InputSignal<WrClassInput>;
|
|
63
|
+
/**
|
|
64
|
+
* Gallery name. Every `wr-lightbox` with the same group, in document order,
|
|
65
|
+
* can be paged through from whichever one was opened. A lightbox with
|
|
66
|
+
* `disablePreview` stays out of it. @default null
|
|
67
|
+
*/
|
|
68
|
+
readonly group: import("@angular/core").InputSignal<string | null>;
|
|
69
|
+
/** Wrap from the last image of the group to the first, and back. @default false */
|
|
70
|
+
readonly loop: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
71
|
+
/** Accessible name of the viewer's previous button. Falls back to `common.previous`. */
|
|
72
|
+
readonly previousLabel: import("@angular/core").InputSignal<string | null>;
|
|
73
|
+
/** Accessible name of the viewer's next button. Falls back to `common.next`. */
|
|
74
|
+
readonly nextLabel: import("@angular/core").InputSignal<string | null>;
|
|
75
|
+
protected readonly resolvedPreviousLabel: Signal<string>;
|
|
76
|
+
protected readonly resolvedNextLabel: Signal<string>;
|
|
77
|
+
private readonly counterText;
|
|
78
|
+
private readonly positionText;
|
|
60
79
|
protected readonly open: import("@angular/core").WritableSignal<boolean>;
|
|
61
80
|
protected readonly loaded: import("@angular/core").WritableSignal<boolean>;
|
|
62
81
|
/**
|
|
@@ -65,8 +84,11 @@ export declare class WrLightbox {
|
|
|
65
84
|
* @internal Public so the host bindings can read it.
|
|
66
85
|
*/
|
|
67
86
|
protected readonly viewerId: string;
|
|
68
|
-
protected readonly classes:
|
|
69
|
-
protected readonly panelTpl:
|
|
87
|
+
protected readonly classes: Signal<string>;
|
|
88
|
+
protected readonly panelTpl: Signal<TemplateRef<unknown>>;
|
|
89
|
+
private readonly groups;
|
|
90
|
+
private readonly host;
|
|
91
|
+
private readonly isBrowser;
|
|
70
92
|
private readonly focusMonitor;
|
|
71
93
|
private readonly overlay;
|
|
72
94
|
private readonly vcr;
|
|
@@ -90,14 +112,36 @@ export declare class WrLightbox {
|
|
|
90
112
|
private focusTrap;
|
|
91
113
|
private previouslyFocused;
|
|
92
114
|
private overlayRef;
|
|
115
|
+
/** The gallery this lightbox pages through; empty when it stands alone. */
|
|
116
|
+
protected readonly gallery: Signal<readonly WrLightbox[]>;
|
|
117
|
+
private readonly target;
|
|
118
|
+
private lastIndex;
|
|
119
|
+
/** The lightbox whose image the viewer is showing. */
|
|
120
|
+
protected readonly shown: Signal<WrLightbox>;
|
|
121
|
+
protected readonly index: Signal<number>;
|
|
122
|
+
protected readonly canPrevious: Signal<boolean>;
|
|
123
|
+
protected readonly canNext: Signal<boolean>;
|
|
124
|
+
protected readonly counter: Signal<string>;
|
|
125
|
+
protected readonly announcement: Signal<string>;
|
|
126
|
+
private readonly preloaded;
|
|
93
127
|
constructor();
|
|
94
128
|
protected onClick(): void;
|
|
129
|
+
/** Move through the gallery by one image; a no-op at an end unless `loop` is set. */
|
|
130
|
+
protected step(delta: -1 | 1): void;
|
|
131
|
+
private show;
|
|
132
|
+
private wrap;
|
|
133
|
+
private place;
|
|
134
|
+
private preload;
|
|
95
135
|
protected onClose(): void;
|
|
136
|
+
private viewerStartX;
|
|
96
137
|
private viewerStartY;
|
|
97
138
|
private viewerSwiping;
|
|
98
139
|
protected onViewerSwipeStart(event: TouchEvent): void;
|
|
99
140
|
protected onViewerSwipeMove(event: TouchEvent, viewer: HTMLElement): void;
|
|
100
141
|
protected onViewerSwipeEnd(event: TouchEvent, viewer: HTMLElement): void;
|
|
142
|
+
/** A drag that belongs to the gallery rather than to swipe-down-to-dismiss. */
|
|
143
|
+
private isSideways;
|
|
144
|
+
private isRtl;
|
|
101
145
|
/**
|
|
102
146
|
* The thumbnail has settled, one way or the other. A failure counts: `--loading`
|
|
103
147
|
* animates a shimmer AND sets `opacity: 0` on the image, so a broken `src` with no
|
|
@@ -106,6 +150,7 @@ export declare class WrLightbox {
|
|
|
106
150
|
*/
|
|
107
151
|
protected onSettled(): void;
|
|
108
152
|
private openOverlay;
|
|
153
|
+
private onGalleryKey;
|
|
109
154
|
private closeOverlay;
|
|
110
155
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrLightbox, never>;
|
|
111
156
|
static ɵcmp: i0.ɵɵComponentDeclaration<WrLightbox, "wr-lightbox", never, {
|
|
@@ -154,5 +199,25 @@ export declare class WrLightbox {
|
|
|
154
199
|
"required": false;
|
|
155
200
|
"isSignal": true;
|
|
156
201
|
};
|
|
202
|
+
"group": {
|
|
203
|
+
"alias": "group";
|
|
204
|
+
"required": false;
|
|
205
|
+
"isSignal": true;
|
|
206
|
+
};
|
|
207
|
+
"loop": {
|
|
208
|
+
"alias": "loop";
|
|
209
|
+
"required": false;
|
|
210
|
+
"isSignal": true;
|
|
211
|
+
};
|
|
212
|
+
"previousLabel": {
|
|
213
|
+
"alias": "previousLabel";
|
|
214
|
+
"required": false;
|
|
215
|
+
"isSignal": true;
|
|
216
|
+
};
|
|
217
|
+
"nextLabel": {
|
|
218
|
+
"alias": "nextLabel";
|
|
219
|
+
"required": false;
|
|
220
|
+
"isSignal": true;
|
|
221
|
+
};
|
|
157
222
|
}, {}, never, never, true, never>;
|
|
158
223
|
}
|
package/types/ngwr-overlay.d.ts
CHANGED
|
@@ -203,6 +203,42 @@ export declare class WrOverlayContainer extends OverlayContainer {
|
|
|
203
203
|
static ɵfac: i0.ɵɵFactoryDeclaration<WrOverlayContainer, never>;
|
|
204
204
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
205
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Keeps the global toast host under the overlays opened with
|
|
208
|
+
* `toasts: 'below'`, and above every other one.
|
|
209
|
+
*
|
|
210
|
+
* The top layer is ordered by the moment of promotion and by nothing else, so
|
|
211
|
+
* the only way to put the toast host under an overlay is to promote that
|
|
212
|
+
* overlay again after it. The toast host therefore belongs right under the
|
|
213
|
+
* trailing run of covering overlays: the ones opened after the last overlay
|
|
214
|
+
* that wants toasts above it. A covering overlay under such an overlay cannot
|
|
215
|
+
* be moved over the toasts without also moving over the modal above it, so the
|
|
216
|
+
* newer overlay's rule wins until it closes.
|
|
217
|
+
*
|
|
218
|
+
* @internal
|
|
219
|
+
*/
|
|
220
|
+
export declare class WrOverlayOrder {
|
|
221
|
+
/** Open overlays in the order they were promoted. */
|
|
222
|
+
private readonly layers;
|
|
223
|
+
private toasts;
|
|
224
|
+
/** How many of `layers` sit under the toast host. */
|
|
225
|
+
private under;
|
|
226
|
+
/**
|
|
227
|
+
* Register an overlay right after it is attached, which is when the CDK
|
|
228
|
+
* promotes it. Returns the function that takes it off the list.
|
|
229
|
+
*/
|
|
230
|
+
add(host: HTMLElement, toasts?: 'above' | 'below'): () => void;
|
|
231
|
+
/** Put the toast host on top, then every overlay that covers toasts over it. */
|
|
232
|
+
raiseToasts(host: HTMLElement): void;
|
|
233
|
+
dropToasts(): void;
|
|
234
|
+
/**
|
|
235
|
+
* @param raise with no covering overlay open, raise the host even where the
|
|
236
|
+
* list says it is on top: a popover this list does not know may have joined.
|
|
237
|
+
*/
|
|
238
|
+
private place;
|
|
239
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WrOverlayOrder, never>;
|
|
240
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
241
|
+
}
|
|
206
242
|
/**
|
|
207
243
|
* Injection token for the CDK `Overlay` service NGWR components should
|
|
208
244
|
* use to open panels.
|