ngwr 16.3.0 → 16.4.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/carousel/styles/_index.scss +53 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +24 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +67 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +10 -23
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +16 -1
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +18 -4
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +7 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +27 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +568 -7
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +8 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +8 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +8 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +8 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +8 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +8 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +8 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +8 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +8 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +8 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +8 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +8 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +8 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +8 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +8 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +8 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +8 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +8 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +8 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +8 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +8 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +8 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +2 -2
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +1 -0
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +1 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +100 -3
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +2 -2
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +71 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +171 -11
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +13 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +12 -1
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +64 -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/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +8 -4
- package/i18n/cs.json +8 -4
- package/i18n/de.json +8 -4
- package/i18n/en.json +8 -4
- package/i18n/es.json +8 -4
- package/i18n/fr.json +8 -4
- package/i18n/he.json +8 -4
- package/i18n/hi.json +8 -4
- package/i18n/id.json +8 -4
- package/i18n/it.json +8 -4
- package/i18n/ja.json +8 -4
- package/i18n/ko.json +8 -4
- package/i18n/nl.json +8 -4
- package/i18n/pl.json +8 -4
- package/i18n/pt.json +8 -4
- package/i18n/ru.json +8 -4
- package/i18n/sv.json +8 -4
- package/i18n/tr.json +8 -4
- package/i18n/uk.json +8 -4
- package/i18n/vi.json +8 -4
- package/i18n/zh-TW.json +8 -4
- package/i18n/zh.json +8 -4
- package/llms-full.txt +4 -4
- package/llms.txt +57 -24
- package/package.json +1 -1
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/symbol-map.json +1 -0
- package/select/styles/_index.scss +13 -0
- package/skills/ngwr/SKILL.md +30 -3
- package/skills/ngwr/references/catalog.md +1 -1
- package/table/styles/_index.scss +24 -0
- package/theme/styles/_focus.scss +11 -1
- package/types/ngwr-carousel-testing.d.ts +27 -6
- package/types/ngwr-carousel.d.ts +42 -6
- package/types/ngwr-cascader.d.ts +3 -5
- package/types/ngwr-context-menu.d.ts +2 -0
- package/types/ngwr-dropdown.d.ts +2 -0
- package/types/ngwr-file-upload.d.ts +8 -2
- package/types/ngwr-graph-testing.d.ts +28 -0
- package/types/ngwr-graph.d.ts +247 -91
- package/types/ngwr-select.d.ts +37 -0
- package/types/ngwr-table-testing.d.ts +52 -1
- package/types/ngwr-table.d.ts +101 -9
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +11 -2
- package/types/ngwr-tree.d.ts +2 -0
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
|
@@ -29,9 +29,9 @@ interface WrCarouselHarnessFilters extends BaseHarnessFilters {
|
|
|
29
29
|
* `role="group"` and `aria-roledescription="slide"` and nothing else — no
|
|
30
30
|
* `aria-current`, no `aria-hidden` on the ones off-screen. The current slide is
|
|
31
31
|
* published in exactly two places, the dot carrying `aria-current="true"` and the
|
|
32
|
-
* track's own offset, and {@link getActiveIndex} reads them in that order.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* track's own offset, and {@link getActiveIndex} reads them in that order. A
|
|
33
|
+
* move the reader made is also said by the one live region, which
|
|
34
|
+
* {@link getAnnouncement} reads; an autoplay tick is not.
|
|
35
35
|
* - **It never drags.** The swipe the component supports is a touch gesture
|
|
36
36
|
* measured against the viewport's own width, and jsdom has no layout — that width
|
|
37
37
|
* is 0, so the "20% of the viewport" threshold is 0 too and EVERY drag clears it,
|
|
@@ -182,6 +182,25 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
182
182
|
* carousel where it was.
|
|
183
183
|
*/
|
|
184
184
|
goTo(index: number): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* The text of the live region: `Slide 2 of 3` after an arrow, a dot or a swipe
|
|
187
|
+
* moved the carousel, and empty before any move and after an autoplay tick.
|
|
188
|
+
*/
|
|
189
|
+
getAnnouncement(): Promise<string>;
|
|
190
|
+
/**
|
|
191
|
+
* Whether the live region speaks: `polite`, or `off` while the slides advance on
|
|
192
|
+
* their own, when a tick must not be read out.
|
|
193
|
+
*/
|
|
194
|
+
getLivePoliteness(): Promise<string | null>;
|
|
195
|
+
/**
|
|
196
|
+
* The name of the pause button, which says what a press does next: the pause
|
|
197
|
+
* label while autoplay is on, the play label while it is off, held or not.
|
|
198
|
+
* Throws when the carousel has no such button, which is every carousel
|
|
199
|
+
* without `autoplay`.
|
|
200
|
+
*/
|
|
201
|
+
getAutoplayLabel(): Promise<string | null>;
|
|
202
|
+
/** Press the pause button. Throws without `autoplay`. */
|
|
203
|
+
toggleAutoplay(): Promise<void>;
|
|
185
204
|
/**
|
|
186
205
|
* Move the pointer onto the carousel, which is what HOLDS autoplay.
|
|
187
206
|
*
|
|
@@ -193,8 +212,9 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
193
212
|
/** Move the pointer away again, releasing the hold. */
|
|
194
213
|
mouseAway(): Promise<void>;
|
|
195
214
|
/**
|
|
196
|
-
* Put keyboard focus on the first control the carousel renders — the
|
|
197
|
-
* arrow, or the first dot when the
|
|
215
|
+
* Put keyboard focus on the first control the carousel renders — the pause
|
|
216
|
+
* button under `autoplay`, else the previous arrow, or the first dot when the
|
|
217
|
+
* arrows are hidden.
|
|
198
218
|
*
|
|
199
219
|
* This is the keyboard half of the autoplay hold: WCAG 2.2.2 wants a way to stop
|
|
200
220
|
* moving content, and hovering is not one for someone who never touches a mouse,
|
|
@@ -205,7 +225,7 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
205
225
|
*
|
|
206
226
|
* Note what this is NOT: the dot of the slide showing. The dots are ordinary
|
|
207
227
|
* buttons with no roving `tabindex`, so each of them is a tab stop of its own and
|
|
208
|
-
* the first one a Tab press meets is the
|
|
228
|
+
* the first one a Tab press meets is the same whatever slide is current —
|
|
209
229
|
* two different questions, answered here and by {@link getActiveIndex}.
|
|
210
230
|
*
|
|
211
231
|
* Throws when the carousel renders no controls at all, because then there is
|
|
@@ -235,6 +255,7 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
235
255
|
*/
|
|
236
256
|
private controls;
|
|
237
257
|
/** One arrow, or a failure naming both reasons it might not be there. */
|
|
258
|
+
private autoplayButton;
|
|
238
259
|
private nav;
|
|
239
260
|
}
|
|
240
261
|
export type { WrCarouselHarnessFilters };
|
package/types/ngwr-carousel.d.ts
CHANGED
|
@@ -98,6 +98,13 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
98
98
|
readonly roledescription: import("@angular/core").InputSignal<string | null>;
|
|
99
99
|
protected readonly resolvedRoledescription: import("@angular/core").Signal<string>;
|
|
100
100
|
protected readonly slideLabel: (params?: import("ngwr/i18n").WrI18nParams) => string;
|
|
101
|
+
/** Name of the autoplay button while the slides advance. Falls back to `marquee.pause`, "Pause" in English. */
|
|
102
|
+
readonly pauseLabel: import("@angular/core").InputSignal<string | null>;
|
|
103
|
+
/** Name of the autoplay button while the slides stand. Falls back to `marquee.play`, "Play" in English. */
|
|
104
|
+
readonly playLabel: import("@angular/core").InputSignal<string | null>;
|
|
105
|
+
protected readonly resolvedPauseLabel: import("@angular/core").Signal<string>;
|
|
106
|
+
protected readonly resolvedPlayLabel: import("@angular/core").Signal<string>;
|
|
107
|
+
private readonly positionText;
|
|
101
108
|
/** Active slide index. Two-way bindable. @default 0 */
|
|
102
109
|
readonly active: import("@angular/core").ModelSignal<number>;
|
|
103
110
|
/** Show prev / next arrow buttons. @default true */
|
|
@@ -105,10 +112,9 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
105
112
|
/** Show dot indicators below the slides. @default true */
|
|
106
113
|
readonly showDots: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
107
114
|
/**
|
|
108
|
-
* Auto-advance slides. Held while the pointer or
|
|
109
|
-
* carousel and during a swipe
|
|
110
|
-
* reduced motion
|
|
111
|
-
* the slides and turning it off starts them. @default false
|
|
115
|
+
* Auto-advance slides, with a pause / play button. Held while the pointer or
|
|
116
|
+
* keyboard focus is inside the carousel and during a swipe. While the reader
|
|
117
|
+
* prefers reduced motion it does not start until they press play. @default false
|
|
112
118
|
*/
|
|
113
119
|
readonly autoplay: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
114
120
|
/** Autoplay interval (ms). @default 4000 */
|
|
@@ -157,10 +163,21 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
157
163
|
* `prefers-reduced-motion` asks a page to drop: the stylesheet already switches
|
|
158
164
|
* slides in place under it, and a panel that still changed every four seconds
|
|
159
165
|
* was the half that stylesheet cannot reach. A signal, so the preference is
|
|
160
|
-
* followed while the page is open
|
|
161
|
-
*
|
|
166
|
+
* followed while the page is open, until the reader presses the button: a
|
|
167
|
+
* press is an explicit answer and outranks the preference.
|
|
162
168
|
*/
|
|
163
169
|
private readonly reducedMotion;
|
|
170
|
+
/** What the reader last asked of the pause button, `null` until it is pressed. */
|
|
171
|
+
private readonly asked;
|
|
172
|
+
/** Whether autoplay is switched on, holds aside: what the button's name and glyph follow. */
|
|
173
|
+
protected readonly playing: import("@angular/core").Signal<boolean>;
|
|
174
|
+
/** The slides are advancing on their own right now. */
|
|
175
|
+
protected readonly rotating: import("@angular/core").Signal<boolean>;
|
|
176
|
+
/**
|
|
177
|
+
* Text of the live region: the position after a move the reader made. Empty
|
|
178
|
+
* after an autoplay tick, so the same position can be said again later.
|
|
179
|
+
*/
|
|
180
|
+
protected readonly announcement: import("@angular/core").WritableSignal<string>;
|
|
164
181
|
private readonly destroyRef;
|
|
165
182
|
private readonly isBrowser;
|
|
166
183
|
constructor();
|
|
@@ -168,7 +185,16 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
168
185
|
protected onHoverOut(): void;
|
|
169
186
|
protected onFocusIn(): void;
|
|
170
187
|
protected onFocusOut(): void;
|
|
188
|
+
/**
|
|
189
|
+
* The pause button. Play also lets go of the hover and focus holds in force:
|
|
190
|
+
* the press came from inside the carousel, so they would keep the slides still
|
|
191
|
+
* after the reader asked for them to move. Each hold comes back with the next
|
|
192
|
+
* `focusin` or `mouseenter`.
|
|
193
|
+
*/
|
|
194
|
+
protected toggleAutoplay(): void;
|
|
195
|
+
/** Show a slide, and announce its position: an autoplay tick is the only silent move. */
|
|
171
196
|
goTo(index: number): void;
|
|
197
|
+
private move;
|
|
172
198
|
next(): void;
|
|
173
199
|
prev(): void;
|
|
174
200
|
private swipeStartX;
|
|
@@ -210,6 +236,16 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
210
236
|
"required": false;
|
|
211
237
|
"isSignal": true;
|
|
212
238
|
};
|
|
239
|
+
"pauseLabel": {
|
|
240
|
+
"alias": "pauseLabel";
|
|
241
|
+
"required": false;
|
|
242
|
+
"isSignal": true;
|
|
243
|
+
};
|
|
244
|
+
"playLabel": {
|
|
245
|
+
"alias": "playLabel";
|
|
246
|
+
"required": false;
|
|
247
|
+
"isSignal": true;
|
|
248
|
+
};
|
|
213
249
|
"active": {
|
|
214
250
|
"alias": "active";
|
|
215
251
|
"required": false;
|
package/types/ngwr-cascader.d.ts
CHANGED
|
@@ -166,9 +166,9 @@ export declare class WrCascader<T = string> implements FormValueControl<unknown>
|
|
|
166
166
|
readonly col: number;
|
|
167
167
|
readonly value: T;
|
|
168
168
|
} | null>;
|
|
169
|
+
private readonly liveLocale;
|
|
169
170
|
/** Letters typed in quick succession, for type-ahead. */
|
|
170
|
-
private typeahead;
|
|
171
|
-
private typeaheadAt;
|
|
171
|
+
private readonly typeahead;
|
|
172
172
|
/** Panel id used by the trigger's `aria-controls`. */
|
|
173
173
|
protected readonly panelId: string;
|
|
174
174
|
/**
|
|
@@ -237,9 +237,7 @@ export declare class WrCascader<T = string> implements FormValueControl<unknown>
|
|
|
237
237
|
protected isTabStop(colIndex: number, opt: WrCascaderOption<T>): boolean;
|
|
238
238
|
/**
|
|
239
239
|
* Move to the next enabled option in `column` whose label starts with the letters
|
|
240
|
-
* typed so far
|
|
241
|
-
* pressed again cycles through the options that start with it; a longer run keeps
|
|
242
|
-
* the option it already matches, so `g` then `e` stays on "Germany".
|
|
240
|
+
* typed so far: {@link wrTypeahead} over the column's labels.
|
|
243
241
|
*/
|
|
244
242
|
private typeAhead;
|
|
245
243
|
protected clearSelection(event: Event): void;
|
|
@@ -81,6 +81,7 @@ export declare class WrContextMenu {
|
|
|
81
81
|
private readonly scrollStrategies;
|
|
82
82
|
private readonly injector;
|
|
83
83
|
private readonly destroyRef;
|
|
84
|
+
private readonly liveLocale;
|
|
84
85
|
/**
|
|
85
86
|
* Id of the menu element while this trigger's menu is open, published on the
|
|
86
87
|
* host as `aria-controls`. The pane is portalled into the overlay container, a
|
|
@@ -259,6 +260,7 @@ export declare class WrContextMenuItem {
|
|
|
259
260
|
private readonly scrollStrategies;
|
|
260
261
|
private readonly injector;
|
|
261
262
|
private readonly destroyRef;
|
|
263
|
+
private readonly liveLocale;
|
|
262
264
|
private submenuRef;
|
|
263
265
|
private submenuKeys;
|
|
264
266
|
private openTimer;
|
package/types/ngwr-dropdown.d.ts
CHANGED
|
@@ -123,6 +123,7 @@ export declare class WrDropdown {
|
|
|
123
123
|
private readonly scrollStrategies;
|
|
124
124
|
private readonly injector;
|
|
125
125
|
private readonly destroyRef;
|
|
126
|
+
private readonly liveLocale;
|
|
126
127
|
private readonly openState;
|
|
127
128
|
/** Whether the menu is open. Read-only: `open()` and `close()` change it. */
|
|
128
129
|
readonly isOpen: import("@angular/core").Signal<boolean>;
|
|
@@ -314,6 +315,7 @@ export declare class WrDropdownSubmenu {
|
|
|
314
315
|
private readonly vcr;
|
|
315
316
|
private readonly scrollStrategies;
|
|
316
317
|
private readonly injector;
|
|
318
|
+
private readonly liveLocale;
|
|
317
319
|
private readonly openState;
|
|
318
320
|
/** Whether the submenu is open. Read-only: `open()` and `close()` change it. */
|
|
319
321
|
readonly isOpen: import("@angular/core").Signal<boolean>;
|
|
@@ -162,7 +162,11 @@ export declare class WrFileUpload implements FormValueControl<File | readonly Fi
|
|
|
162
162
|
* (WCAG 2.5.3).
|
|
163
163
|
*/
|
|
164
164
|
readonly dropZoneLabel: import("@angular/core").InputSignal<string | null>;
|
|
165
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Name of each row's remove button. `{{name}}` is the row's file name, so the
|
|
167
|
+
* buttons of a list are told apart. Falls back to `fileUpload.removeFile`,
|
|
168
|
+
* "Remove {{name}}" in English.
|
|
169
|
+
*/
|
|
166
170
|
readonly removeFileLabel: import("@angular/core").InputSignal<string | null>;
|
|
167
171
|
/** Retry button text on a failed row. Falls back to `fileUpload.retry`. */
|
|
168
172
|
readonly retryLabel: import("@angular/core").InputSignal<string | null>;
|
|
@@ -174,7 +178,9 @@ export declare class WrFileUpload implements FormValueControl<File | readonly Fi
|
|
|
174
178
|
readonly failedLabel: import("@angular/core").InputSignal<string | null>;
|
|
175
179
|
protected readonly resolvedPick: import("@angular/core").Signal<string>;
|
|
176
180
|
protected readonly resolvedDrop: import("@angular/core").Signal<string>;
|
|
177
|
-
|
|
181
|
+
private readonly removeText;
|
|
182
|
+
/** The remove button of one row, named after its file. */
|
|
183
|
+
protected removeName(name: string): string;
|
|
178
184
|
protected readonly resolvedRetry: import("@angular/core").Signal<string>;
|
|
179
185
|
protected readonly resolvedUploading: import("@angular/core").Signal<string>;
|
|
180
186
|
protected readonly resolvedUploaded: import("@angular/core").Signal<string>;
|
|
@@ -109,6 +109,12 @@ export declare class WrGraphNodeHarness extends ComponentHarness {
|
|
|
109
109
|
* `tabindex` is no proxy either — it is always `0`, precisely so the tab stop never
|
|
110
110
|
* depends on a measurement.
|
|
111
111
|
*
|
|
112
|
+
* A `zoomable` graph is driven through its own three buttons, and its zoom is read off
|
|
113
|
+
* the `scale()` the component wrote on the stage. The pan is not readable here for the
|
|
114
|
+
* reason node positions are not: its pixels depend on a viewport box jsdom does not
|
|
115
|
+
* have. Gestures have no method either, since the wheel, a drag and a pinch all read
|
|
116
|
+
* that box.
|
|
117
|
+
*
|
|
112
118
|
* An empty graph and a graph whose layout drew nothing render the same DOM, so the
|
|
113
119
|
* harness cannot tell them apart. {@link getNodes} answers `[]` for both, which is the
|
|
114
120
|
* honest way to assert emptiness; {@link getEdges} refuses instead, because "no edges"
|
|
@@ -165,5 +171,27 @@ export declare class WrGraphHarness extends ComponentHarness {
|
|
|
165
171
|
from: string;
|
|
166
172
|
to: string;
|
|
167
173
|
}[]>;
|
|
174
|
+
/** Whether the graph zooms and pans, from the host's `wr-graph--zoomable`. */
|
|
175
|
+
isZoomable(): Promise<boolean>;
|
|
176
|
+
/** Clicks the zoom-in button: one step, around the middle of the viewport. Throws unless `zoomable`. */
|
|
177
|
+
zoomIn(): Promise<void>;
|
|
178
|
+
/** Clicks the zoom-out button: one step, around the middle of the viewport. Throws unless `zoomable`. */
|
|
179
|
+
zoomOut(): Promise<void>;
|
|
180
|
+
/**
|
|
181
|
+
* Clicks the fit button. Throws unless `zoomable`.
|
|
182
|
+
*
|
|
183
|
+
* A fit needs the viewport's box, and jsdom gives every element a 0×0 one, so there
|
|
184
|
+
* the click changes nothing. A spec that asserts the fitted zoom has to stub
|
|
185
|
+
* `getBoundingClientRect` on the `.wr-graph__viewport` element first.
|
|
186
|
+
*/
|
|
187
|
+
fit(): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* The zoom the component drew, where `1` is 100%: the `scale()` in the stage's inline
|
|
190
|
+
* `transform`, or `1` when it wrote none. Throws unless `zoomable`, where no zoom is
|
|
191
|
+
* ever drawn and `1` would be vacuously true.
|
|
192
|
+
*/
|
|
193
|
+
getZoom(): Promise<number>;
|
|
194
|
+
private control;
|
|
195
|
+
private notZoomable;
|
|
168
196
|
}
|
|
169
197
|
export type { WrGraphHarnessFilters, WrGraphNodeHarnessFilters };
|