ngwr 9.1.0 → 10.1.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 +23 -8
- package/action-sheet/styles/_index.scss +6 -1
- package/badge/styles/_index.scss +17 -7
- package/badge/styles/_tag.scss +12 -3
- package/border-glow/styles/_index.scss +5 -0
- package/button/styles/_index.scss +48 -1
- package/calendar/styles/_index.scss +9 -1
- package/circular-text/styles/_index.scss +6 -1
- package/density/styles/_index.scss +3 -1
- package/dialog/styles/_index.scss +66 -2
- package/drag-drop/styles/_index.scss +20 -7
- package/drawer/styles/_index.scss +61 -1
- package/event-calendar/styles/_index.scss +284 -0
- package/falling-text/styles/_index.scss +5 -0
- package/fesm2022/ngwr-action-sheet.mjs +1 -1
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +8 -3
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +6 -4
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +12 -9
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +5 -3
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +17 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +35 -7
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +12 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +6 -5
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +7 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +7 -7
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +9 -1
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +37 -15
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +10 -2
- package/fesm2022/ngwr-density.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +5 -4
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +10 -1
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +37 -16
- 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.mjs +723 -0
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -0
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +2 -2
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +258 -42
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +15 -1
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +8 -3
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +89 -5
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +90 -5
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +94 -3
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +79 -35
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +19 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +48 -6
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +8 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +32 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +3 -3
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +2 -2
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +3 -0
- package/fesm2022/ngwr-media.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +166 -10
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +14 -3
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +173 -3
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +2 -2
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +17 -4
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +4 -3
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +10 -3
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +8 -2
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +6 -4
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +19 -12
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +2 -2
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +40 -13
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +4 -6
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +11 -3
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +1 -1
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +10 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +233 -19
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +21 -4
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +20 -4
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +13 -3
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +2 -2
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +2 -2
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +264 -0
- package/fesm2022/ngwr-tour.mjs.map +1 -0
- package/fesm2022/ngwr-transfer.mjs +184 -0
- package/fesm2022/ngwr-transfer.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +27 -9
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +2 -2
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +118 -2
- package/fesm2022/ngwr-validators.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +2 -2
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +25 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/form/styles/_index.scss +8 -4
- package/glitch-text/styles/_index.scss +5 -0
- package/gradient-text/styles/_index.scss +5 -0
- package/i18n/en.json +233 -0
- package/i18n/ru.json +233 -0
- package/icon/styles/_index.scss +15 -1
- package/input/styles/_index.scss +16 -0
- package/input-number/styles/_index.scss +8 -1
- package/keyboard/styles/_index.scss +15 -3
- package/llms-full.txt +124 -63
- package/llms.txt +29 -8
- package/loading-bar/styles/_index.scss +5 -0
- package/marquee/styles/_index.scss +7 -2
- package/mention/styles/_index.scss +23 -0
- package/overlay/styles/_index.scss +5 -0
- package/package.json +15 -1
- package/pagination/styles/_index.scss +12 -0
- package/popover/styles/_index.scss +165 -45
- package/pull-to-refresh/styles/_index.scss +5 -0
- package/result/styles/_index.scss +3 -3
- package/schematics/icon-set/index.js +80 -34
- package/schematics/icon-set/schema.json +8 -3
- package/schematics/ng-add/index.js +23 -6
- package/schematics/package.json +3 -0
- package/schematics/page/templates.js +17 -21
- package/schematics/provider/index.js +31 -13
- package/schematics/provider/schema.json +40 -24
- package/schematics/use/index.js +5 -1
- package/schematics/use/schema.json +8 -3
- package/schematics/use/symbol-map.json +7 -176
- package/segmented/styles/_index.scss +1 -1
- package/select/styles/_index.scss +20 -3
- package/shiny-text/styles/_index.scss +5 -0
- package/speed-dial/styles/_index.scss +12 -1
- package/splitter/styles/_index.scss +7 -1
- package/spotlight-card/styles/_index.scss +5 -0
- package/squircle/styles/_index.scss +5 -0
- package/star-border/styles/_index.scss +5 -0
- package/statistic/styles/_index.scss +2 -2
- package/styles/_animations.scss +6 -0
- package/styles.scss +3 -0
- package/table/styles/_index.scss +128 -12
- package/theme/styles/_box-model.scss +29 -0
- package/theme/styles/_colors.scss +116 -15
- package/theme/styles/_dark.scss +65 -7
- package/theme/styles/_focus.scss +2 -8
- package/theme/styles/_index.scss +1 -0
- package/tilt-card/styles/_index.scss +5 -0
- package/toast/styles/_index.scss +6 -3
- package/tour/styles/_index.scss +63 -0
- package/transfer/styles/_index.scss +105 -0
- package/types/ngwr-alert.d.ts +4 -1
- package/types/ngwr-avatar.d.ts +1 -1
- package/types/ngwr-back-top.d.ts +3 -2
- package/types/ngwr-badge.d.ts +1 -1
- package/types/ngwr-border-glow.d.ts +0 -1
- package/types/ngwr-carousel.d.ts +10 -1
- package/types/ngwr-cascader.d.ts +13 -1
- package/types/ngwr-checkbox.d.ts +9 -1
- package/types/ngwr-color-picker.d.ts +1 -0
- package/types/ngwr-command-palette.d.ts +4 -1
- package/types/ngwr-context-menu.d.ts +1 -0
- package/types/ngwr-date-picker.d.ts +14 -4
- package/types/ngwr-density.d.ts +9 -2
- package/types/ngwr-dialog.d.ts +9 -0
- package/types/ngwr-divider.d.ts +1 -1
- package/types/ngwr-drawer.d.ts +20 -4
- package/types/ngwr-dropdown.d.ts +1 -0
- package/types/ngwr-event-calendar.d.ts +358 -0
- package/types/ngwr-form.d.ts +177 -20
- package/types/ngwr-fuzzy-text.d.ts +8 -0
- package/types/ngwr-gauge.d.ts +4 -1
- package/types/ngwr-i18n.d.ts +80 -2
- package/types/ngwr-icon.d.ts +11 -19
- package/types/ngwr-input-number.d.ts +8 -1
- package/types/ngwr-input.d.ts +50 -20
- package/types/ngwr-knob.d.ts +4 -1
- package/types/ngwr-lightbox.d.ts +7 -1
- package/types/ngwr-line-chart.d.ts +1 -1
- package/types/ngwr-media.d.ts +1 -1
- package/types/ngwr-mention.d.ts +45 -1
- package/types/ngwr-meter-group.d.ts +9 -1
- package/types/ngwr-overlay.d.ts +80 -2
- package/types/ngwr-page-header.d.ts +2 -2
- package/types/ngwr-pagination.d.ts +15 -2
- package/types/ngwr-popconfirm.d.ts +1 -0
- package/types/ngwr-popover.d.ts +1 -0
- package/types/ngwr-progress.d.ts +4 -1
- package/types/ngwr-rating.d.ts +3 -2
- package/types/ngwr-result.d.ts +12 -6
- package/types/ngwr-segmented.d.ts +6 -0
- package/types/ngwr-select.d.ts +19 -7
- package/types/ngwr-shiny-text.d.ts +2 -4
- package/types/ngwr-speed-dial.d.ts +7 -1
- package/types/ngwr-squircle.d.ts +1 -1
- package/types/ngwr-switch.d.ts +7 -1
- package/types/ngwr-table.d.ts +126 -6
- package/types/ngwr-tabs.d.ts +1 -4
- package/types/ngwr-textarea.d.ts +8 -1
- package/types/ngwr-theme.d.ts +8 -1
- package/types/ngwr-toolbar.d.ts +2 -2
- package/types/ngwr-tour.d.ts +132 -0
- package/types/ngwr-transfer.d.ts +118 -0
- package/types/ngwr-tree.d.ts +11 -2
- package/types/ngwr-validators.d.ts +62 -2
- package/types/ngwr-version.d.ts +2 -2
- package/types/ngwr-waves.d.ts +10 -0
- package/typewriter/styles/_index.scss +5 -0
- package/typography/styles/_index.scss +3 -3
- package/virtual-scroll/styles/_index.scss +6 -1
- package/waves/styles/_index.scss +26 -0
package/types/ngwr-toolbar.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ import * as i0 from '@angular/core';
|
|
|
8
8
|
* ```html
|
|
9
9
|
* <wr-toolbar>
|
|
10
10
|
* <div wrToolbarStart>
|
|
11
|
-
* <button
|
|
11
|
+
* <button wr-btn>Back</button>
|
|
12
12
|
* <strong>Items</strong>
|
|
13
13
|
* </div>
|
|
14
14
|
* <div wrToolbarCenter>
|
|
15
15
|
* <wr-segmented [(value)]="view" [options]="['grid', 'list']" />
|
|
16
16
|
* </div>
|
|
17
17
|
* <div wrToolbarEnd>
|
|
18
|
-
* <button
|
|
18
|
+
* <button wr-btn color="primary">New</button>
|
|
19
19
|
* </div>
|
|
20
20
|
* </wr-toolbar>
|
|
21
21
|
* ```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as ngwr_i18n from 'ngwr/i18n';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license
|
|
6
|
+
*
|
|
7
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
8
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
9
|
+
*/
|
|
10
|
+
/** Where the step popup sits relative to its target. */
|
|
11
|
+
type WrTourPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
12
|
+
/** One stop on a tour. */
|
|
13
|
+
interface WrTourStep {
|
|
14
|
+
/**
|
|
15
|
+
* What to spotlight — a CSS selector resolved when the step opens, or the
|
|
16
|
+
* element itself. A step whose selector matches nothing is SKIPPED rather than
|
|
17
|
+
* shown floating: a tour that points at a control the user cannot see is worse
|
|
18
|
+
* than one that is a step shorter.
|
|
19
|
+
*/
|
|
20
|
+
readonly target: string | HTMLElement;
|
|
21
|
+
/** Heading above the copy. */
|
|
22
|
+
readonly title?: string;
|
|
23
|
+
/** The step's body text. */
|
|
24
|
+
readonly content: string;
|
|
25
|
+
/** Preferred side. The overlay falls back to the opposite side near an edge. @default 'bottom' */
|
|
26
|
+
readonly placement?: WrTourPlacement;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Guided product tour: a spotlight over one element at a time plus a popup
|
|
31
|
+
* explaining it.
|
|
32
|
+
*
|
|
33
|
+
* Steps are data, not markup — call `start()` with an array and the service owns
|
|
34
|
+
* the overlay, the cut-out, focus and the keyboard. A step whose target is not
|
|
35
|
+
* on the page is skipped rather than shown floating, so a tour survives a
|
|
36
|
+
* feature being hidden behind a flag or a permission.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* private readonly tour = inject(WrTour);
|
|
41
|
+
*
|
|
42
|
+
* showMeAround(): void {
|
|
43
|
+
* this.tour.start([
|
|
44
|
+
* { target: '[data-tour="search"]', title: 'Search', content: 'Find anything by name.' },
|
|
45
|
+
* { target: '[data-tour="filters"]', content: 'Narrow the list down.', placement: 'right' },
|
|
46
|
+
* ]);
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @see https://ngwr.dev/reference/services/tour
|
|
51
|
+
*/
|
|
52
|
+
declare class WrTour {
|
|
53
|
+
private readonly overlay;
|
|
54
|
+
private readonly scrollStrategies;
|
|
55
|
+
private readonly injector;
|
|
56
|
+
private readonly focusTrapFactory;
|
|
57
|
+
private readonly document;
|
|
58
|
+
private readonly isBrowser;
|
|
59
|
+
private readonly steps;
|
|
60
|
+
private readonly cursor;
|
|
61
|
+
private overlayRef;
|
|
62
|
+
private spotlight;
|
|
63
|
+
private detachKeydown;
|
|
64
|
+
private detachReposition;
|
|
65
|
+
private restoreFocus;
|
|
66
|
+
/** Whether a tour is running. */
|
|
67
|
+
readonly active: _angular_core.Signal<boolean>;
|
|
68
|
+
/** Zero-based index of the current step, `-1` when idle. */
|
|
69
|
+
readonly index: _angular_core.Signal<number>;
|
|
70
|
+
/** How many steps this tour has. */
|
|
71
|
+
readonly total: _angular_core.Signal<number>;
|
|
72
|
+
/** The step being shown, or `null` when idle. */
|
|
73
|
+
readonly step: _angular_core.Signal<WrTourStep | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Begin a tour. Restarts if one is already running. A no-op under SSR — a
|
|
76
|
+
* tour is a client-side affordance and there is nothing to spotlight on the
|
|
77
|
+
* server.
|
|
78
|
+
*/
|
|
79
|
+
start(steps: readonly WrTourStep[]): void;
|
|
80
|
+
/** Advance; finishes the tour past the last step. */
|
|
81
|
+
next(): void;
|
|
82
|
+
/** Go back; stays put on the first step. */
|
|
83
|
+
prev(): void;
|
|
84
|
+
/** End the tour and return focus where it was. */
|
|
85
|
+
stop(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Move to `index`, skipping steps whose target is not in the DOM. `direction`
|
|
88
|
+
* says which way to keep skipping, so a missing step never traps the tour
|
|
89
|
+
* between two dead ends.
|
|
90
|
+
*/
|
|
91
|
+
private goTo;
|
|
92
|
+
private resolve;
|
|
93
|
+
private openStep;
|
|
94
|
+
private placeSpotlight;
|
|
95
|
+
private teardownStep;
|
|
96
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrTour, never>;
|
|
97
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<WrTour>;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** What the popup needs from the running tour, without importing the service (cycle). */
|
|
101
|
+
interface WrTourController {
|
|
102
|
+
readonly index: () => number;
|
|
103
|
+
readonly total: () => number;
|
|
104
|
+
readonly step: () => WrTourStep | null;
|
|
105
|
+
next(): void;
|
|
106
|
+
prev(): void;
|
|
107
|
+
stop(): void;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The card a tour shows next to the spotlit element. Rendered by `WrTour` into
|
|
111
|
+
* a CDK overlay — not something you place yourself.
|
|
112
|
+
*
|
|
113
|
+
* @see https://ngwr.dev/reference/services/tour
|
|
114
|
+
*/
|
|
115
|
+
declare class WrTourPopup {
|
|
116
|
+
protected readonly tour: WrTourController;
|
|
117
|
+
protected readonly nextLabel: string;
|
|
118
|
+
protected readonly backLabel: string;
|
|
119
|
+
protected readonly doneLabel: string;
|
|
120
|
+
protected readonly skipLabel: string;
|
|
121
|
+
/** `Step {{current}} of {{total}}` — also the dialog's accessible name. */
|
|
122
|
+
protected readonly progress: (params?: ngwr_i18n.WrI18nParams) => string;
|
|
123
|
+
protected readonly isLast: _angular_core.Signal<boolean>;
|
|
124
|
+
protected readonly isFirst: _angular_core.Signal<boolean>;
|
|
125
|
+
protected readonly progressText: _angular_core.Signal<string>;
|
|
126
|
+
protected readonly ariaLabel: _angular_core.Signal<string>;
|
|
127
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrTourPopup, never>;
|
|
128
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrTourPopup, "wr-tour-popup", never, {}, {}, never, never, true, never>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { WrTour, WrTourPopup };
|
|
132
|
+
export type { WrTourPlacement, WrTourStep };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as ngwr_i18n from 'ngwr/i18n';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @license
|
|
7
|
+
*
|
|
8
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
9
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
10
|
+
*/
|
|
11
|
+
/** One row in either pane of a `<wr-transfer>`. */
|
|
12
|
+
interface WrTransferItem<TValue = unknown> {
|
|
13
|
+
/** Identity — what `[(value)]` carries, compared with SameValueZero. */
|
|
14
|
+
readonly value: TValue;
|
|
15
|
+
/** Text shown in the pane and matched by the search box. */
|
|
16
|
+
readonly label: string;
|
|
17
|
+
/** Greyed out and never moved by the bulk buttons. */
|
|
18
|
+
readonly disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A pane's rows plus the header state derived from them. */
|
|
22
|
+
interface PaneState {
|
|
23
|
+
readonly rows: readonly WrTransferItem[];
|
|
24
|
+
readonly checkedCount: number;
|
|
25
|
+
readonly allChecked: boolean;
|
|
26
|
+
readonly someChecked: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Dual-listbox picker: two panes and the buttons that move rows between them.
|
|
30
|
+
*
|
|
31
|
+
* The full item set is `[items]` and the RIGHT pane is the value — `[(value)]`
|
|
32
|
+
* holds the chosen `WrTransferItem['value']`s, everything else stays left. The
|
|
33
|
+
* checked state inside each pane is transient staging, deliberately not part of
|
|
34
|
+
* the value: what a form cares about is which rows ended up on the right.
|
|
35
|
+
*
|
|
36
|
+
* A signal-forms native control (`FormValueControl<readonly unknown[]>`), so
|
|
37
|
+
* `[formField]` binds straight to `value`; `[(ngModel)]` and reactive forms keep
|
|
38
|
+
* working through Angular's bridge, and `[(value)]` is the standalone shape.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```html
|
|
42
|
+
* <!-- Standalone -->
|
|
43
|
+
* <wr-transfer [items]="permissions" [(value)]="granted" />
|
|
44
|
+
*
|
|
45
|
+
* <!-- Searchable, with pane titles -->
|
|
46
|
+
* <wr-transfer
|
|
47
|
+
* searchable
|
|
48
|
+
* sourceTitle="Available"
|
|
49
|
+
* targetTitle="Granted"
|
|
50
|
+
* [items]="permissions"
|
|
51
|
+
* [formField]="form.granted"
|
|
52
|
+
* />
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @see https://ngwr.dev/reference/components/transfer
|
|
56
|
+
*/
|
|
57
|
+
declare class WrTransfer implements FormValueControl<readonly unknown[]> {
|
|
58
|
+
/** Every row, in either pane. Membership of the right pane is `value`. */
|
|
59
|
+
readonly items: _angular_core.InputSignal<readonly WrTransferItem<unknown>[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Values currently in the RIGHT pane. Two-way bindable; bound automatically
|
|
62
|
+
* by `[formField]` / `[(ngModel)]`.
|
|
63
|
+
*/
|
|
64
|
+
readonly value: _angular_core.ModelSignal<readonly unknown[]>;
|
|
65
|
+
/** Emitted on blur / commit so a bound field marks itself touched. */
|
|
66
|
+
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
67
|
+
/** Disable the whole control. @default false */
|
|
68
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, any>;
|
|
69
|
+
/** Show a filter box above each pane. @default false */
|
|
70
|
+
readonly searchable: _angular_core.InputSignalWithTransform<boolean, any>;
|
|
71
|
+
/** Heading above the left pane. Falls back to `transfer.source`. */
|
|
72
|
+
readonly sourceTitle: _angular_core.InputSignal<string | null>;
|
|
73
|
+
/** Heading above the right pane. Falls back to `transfer.target`. */
|
|
74
|
+
readonly targetTitle: _angular_core.InputSignal<string | null>;
|
|
75
|
+
/** Placeholder in both filter boxes. Falls back to `transfer.search`. */
|
|
76
|
+
readonly searchPlaceholder: _angular_core.InputSignal<string | null>;
|
|
77
|
+
/** Shown in a pane with no rows. Falls back to `transfer.empty`. */
|
|
78
|
+
readonly emptyText: _angular_core.InputSignal<string | null>;
|
|
79
|
+
/** Accessible name of the move-right button. Falls back to `transfer.toTarget`. */
|
|
80
|
+
readonly toTargetLabel: _angular_core.InputSignal<string | null>;
|
|
81
|
+
/** Accessible name of the move-left button. Falls back to `transfer.toSource`. */
|
|
82
|
+
readonly toSourceLabel: _angular_core.InputSignal<string | null>;
|
|
83
|
+
protected readonly resolvedSourceTitle: _angular_core.Signal<string>;
|
|
84
|
+
protected readonly resolvedTargetTitle: _angular_core.Signal<string>;
|
|
85
|
+
protected readonly resolvedSearch: _angular_core.Signal<string>;
|
|
86
|
+
protected readonly resolvedEmpty: _angular_core.Signal<string>;
|
|
87
|
+
protected readonly resolvedToTarget: _angular_core.Signal<string>;
|
|
88
|
+
protected readonly resolvedToSource: _angular_core.Signal<string>;
|
|
89
|
+
/** `{{checked}} / {{total}}` under each heading. @internal */
|
|
90
|
+
protected readonly countLabel: (params?: ngwr_i18n.WrI18nParams) => string;
|
|
91
|
+
/** Pane order — the template iterates it so both panes share one block. */
|
|
92
|
+
protected readonly panes: readonly ["source", "target"];
|
|
93
|
+
private readonly sourceQuery;
|
|
94
|
+
private readonly targetQuery;
|
|
95
|
+
/** Staged rows, per pane. Cleared as soon as a move commits them. */
|
|
96
|
+
private readonly sourceChecked;
|
|
97
|
+
private readonly targetChecked;
|
|
98
|
+
private readonly valueSet;
|
|
99
|
+
protected readonly source: _angular_core.Signal<PaneState>;
|
|
100
|
+
protected readonly target: _angular_core.Signal<PaneState>;
|
|
101
|
+
protected readonly canMoveRight: _angular_core.Signal<boolean>;
|
|
102
|
+
protected readonly canMoveLeft: _angular_core.Signal<boolean>;
|
|
103
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
104
|
+
protected isChecked(pane: 'source' | 'target', item: WrTransferItem): boolean;
|
|
105
|
+
protected toggle(pane: 'source' | 'target', item: WrTransferItem, checked: boolean): void;
|
|
106
|
+
/** Header checkbox — stages or clears every enabled row the filter shows. */
|
|
107
|
+
protected toggleAll(pane: 'source' | 'target', checked: boolean): void;
|
|
108
|
+
protected onSearch(pane: 'source' | 'target', event: Event): void;
|
|
109
|
+
protected moveRight(): void;
|
|
110
|
+
protected moveLeft(): void;
|
|
111
|
+
/** Filter, then derive the header state from what survived. */
|
|
112
|
+
private pane;
|
|
113
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrTransfer, never>;
|
|
114
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrTransfer, "wr-transfer", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "sourceTitle": { "alias": "sourceTitle"; "required": false; "isSignal": true; }; "targetTitle": { "alias": "targetTitle"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "toTargetLabel": { "alias": "toTargetLabel"; "required": false; "isSignal": true; }; "toSourceLabel": { "alias": "toSourceLabel"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export { WrTransfer };
|
|
118
|
+
export type { WrTransferItem };
|
package/types/ngwr-tree.d.ts
CHANGED
|
@@ -93,6 +93,14 @@ declare class WrTree<TId = string> implements FormValueControl<unknown> {
|
|
|
93
93
|
readonly openOn: _angular_core.InputSignal<"inline" | "overlay">;
|
|
94
94
|
/** Placeholder shown on the trigger when no node is selected. */
|
|
95
95
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
96
|
+
/**
|
|
97
|
+
* Accessible name of the overlay trigger. Falls back to the placeholder, then
|
|
98
|
+
* to `select.label` — a `role="combobox"` with nothing selected and no
|
|
99
|
+
* placeholder otherwise has no name at all.
|
|
100
|
+
*/
|
|
101
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
102
|
+
private readonly labelText;
|
|
103
|
+
protected readonly resolvedAriaLabel: _angular_core.Signal<string>;
|
|
96
104
|
/** Show a clear-all (×) button on the trigger when at least one node is selected. @default true */
|
|
97
105
|
readonly clearable: _angular_core.InputSignalWithTransform<boolean, any>;
|
|
98
106
|
/**
|
|
@@ -138,13 +146,14 @@ declare class WrTree<TId = string> implements FormValueControl<unknown> {
|
|
|
138
146
|
readonly touch: _angular_core.OutputEmitterRef<void>;
|
|
139
147
|
private readonly host;
|
|
140
148
|
private readonly overlay;
|
|
149
|
+
private readonly outsideClick;
|
|
141
150
|
private readonly vcr;
|
|
142
151
|
private readonly scrollStrategies;
|
|
143
152
|
private readonly destroyRef;
|
|
144
153
|
private readonly platformId;
|
|
145
154
|
/** Currently focused row's index in the flattened visible list. */
|
|
146
155
|
protected readonly focusedIndex: _angular_core.WritableSignal<number>;
|
|
147
|
-
/** Resolved ARIA labels —
|
|
156
|
+
/** Resolved ARIA labels — resolved once at construction, so a runtime locale switch needs a re-create. */
|
|
148
157
|
protected readonly clearLabel: string;
|
|
149
158
|
protected readonly expandLabel: string;
|
|
150
159
|
protected readonly collapseLabel: string;
|
|
@@ -224,7 +233,7 @@ declare class WrTree<TId = string> implements FormValueControl<unknown> {
|
|
|
224
233
|
private openOverlay;
|
|
225
234
|
private closeOverlay;
|
|
226
235
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<WrTree<any>, never>;
|
|
227
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrTree<any>, "wr-tree", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "openOn": { "alias": "openOn"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "maxTagCount": { "alias": "maxTagCount"; "required": false; "isSignal": true; }; "defaultExpandAll": { "alias": "defaultExpandAll"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "viewportHeight": { "alias": "viewportHeight"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "expanded": "expandedChange"; "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
|
|
236
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<WrTree<any>, "wr-tree", never, { "nodes": { "alias": "nodes"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "openOn": { "alias": "openOn"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "maxTagCount": { "alias": "maxTagCount"; "required": false; "isSignal": true; }; "defaultExpandAll": { "alias": "defaultExpandAll"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": false; "isSignal": true; }; "viewportHeight": { "alias": "viewportHeight"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "expanded": "expandedChange"; "value": "valueChange"; "touch": "touch"; }, never, never, true, never>;
|
|
228
237
|
}
|
|
229
238
|
|
|
230
239
|
export { WrTree };
|
|
@@ -8,8 +8,11 @@ import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Bundled `ValidatorFn`s — pure functions, no DOM, no DI.
|
|
12
|
-
*
|
|
11
|
+
* Bundled `ValidatorFn`s — pure functions, no DOM, no DI. (`matchFields` keeps
|
|
12
|
+
* one bit of per-instance state, a latch so its dev-mode misconfiguration
|
|
13
|
+
* warning fires once rather than on every validation run; it is never read as
|
|
14
|
+
* part of the result.) Mirrors the API shape of Angular's built-in
|
|
15
|
+
* `Validators` so it composes cleanly:
|
|
13
16
|
*
|
|
14
17
|
* ```ts
|
|
15
18
|
* import { Validators } from '@angular/forms';
|
|
@@ -59,8 +62,65 @@ declare const WrValidators: {
|
|
|
59
62
|
* Value must equal a sibling control's value (e.g. confirm-password).
|
|
60
63
|
* The target lookup uses `control.parent.get(name)`, so it works
|
|
61
64
|
* inside `FormGroup` and nested groups.
|
|
65
|
+
*
|
|
66
|
+
* **It cannot report a mismatch until something revalidates the control.**
|
|
67
|
+
* Angular runs a control's validators inside the control's own constructor,
|
|
68
|
+
* before the control has a parent — so the lookup finds nothing and this
|
|
69
|
+
* returns `null`, and attaching the control to a group does not re-run it.
|
|
70
|
+
*
|
|
71
|
+
* `formControlName` revalidates when it binds, so a group rendered through
|
|
72
|
+
* the reactive-forms directives corrects itself on its first change
|
|
73
|
+
* detection. The window is open for everything that reads validity BEFORE
|
|
74
|
+
* that: a route guard or resolver checking `form.valid`, a form built and
|
|
75
|
+
* submitted from a service, a unit test. Such a group reports itself valid
|
|
76
|
+
* with two values that plainly disagree.
|
|
77
|
+
*
|
|
78
|
+
* Put {@link WrValidators.matchFields} on the group to close it, and keep
|
|
79
|
+
* this one on the child for the per-field message. They do not conflict —
|
|
80
|
+
* different error keys, different hosts.
|
|
81
|
+
*
|
|
82
|
+
* @see WrValidators.matchFields
|
|
62
83
|
*/
|
|
63
84
|
match: (targetName: string) => ValidatorFn;
|
|
85
|
+
/**
|
|
86
|
+
* Every named control must hold the same value — the group-level counterpart
|
|
87
|
+
* to {@link WrValidators.match}. Attach it to the group that OWNS the fields,
|
|
88
|
+
* not to one of its children.
|
|
89
|
+
*
|
|
90
|
+
* Unlike `match` this has no ordering hole: Angular attaches the children and
|
|
91
|
+
* aggregates their values BEFORE it runs the group's own validators, so a
|
|
92
|
+
* group built from a record whose fields already disagree is invalid the
|
|
93
|
+
* moment it exists — no revalidation step, and nothing that depends on the
|
|
94
|
+
* form having been rendered.
|
|
95
|
+
*
|
|
96
|
+
* Names are `AbstractControl.get()` paths, so `'billing.zip'` reaches into a
|
|
97
|
+
* nested group. `null`, `undefined` and `''` all count as the same empty
|
|
98
|
+
* value; everything else is compared with `===`, so two equal `Date`s are NOT
|
|
99
|
+
* equal — compare a derived primitive instead. **Disabled controls are
|
|
100
|
+
* skipped**, which makes the rule compare exactly what `group.value`
|
|
101
|
+
* contains, and the error names only the controls it actually compared.
|
|
102
|
+
*
|
|
103
|
+
* A name that resolves to nothing, or to a group or an array rather than a
|
|
104
|
+
* leaf control, turns the whole check off and warns once per validator
|
|
105
|
+
* instance in dev — never a partial comparison of the names that did
|
|
106
|
+
* resolve, and never an error the user has no way to satisfy.
|
|
107
|
+
*
|
|
108
|
+
* The error lands on the GROUP, and `<wr-form-field>` only reads the one
|
|
109
|
+
* control projected into it — so pair this with `match` for a per-field
|
|
110
|
+
* message, or render it yourself from `form.hasError('matchFields')`.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* new FormGroup(
|
|
115
|
+
* {
|
|
116
|
+
* password: new FormControl(''),
|
|
117
|
+
* confirm: new FormControl('', [WrValidators.match('password')]),
|
|
118
|
+
* },
|
|
119
|
+
* { validators: [WrValidators.matchFields('password', 'confirm')] },
|
|
120
|
+
* );
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
matchFields: (first: string, second: string, ...rest: readonly string[]) => ValidatorFn;
|
|
64
124
|
/** Value must be one of the allowed entries (strict equality). */
|
|
65
125
|
oneOf: <T>(allowed: readonly T[]) => ValidatorFn;
|
|
66
126
|
/** Value (Date | parseable) must be ≥ `min`. */
|
package/types/ngwr-version.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ import { InjectionToken } from '@angular/core';
|
|
|
14
14
|
* import or `require`, neither of which tree-shakes well in Angular builds.
|
|
15
15
|
*
|
|
16
16
|
* Distinct from `Version` exported by `@angular/core`, which reports the
|
|
17
|
-
* loaded Angular runtime version (e.g. `'
|
|
17
|
+
* loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.
|
|
18
18
|
*/
|
|
19
|
-
declare const NGWR_VERSION = "
|
|
19
|
+
declare const NGWR_VERSION = "10.1.0";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
package/types/ngwr-waves.d.ts
CHANGED
|
@@ -53,6 +53,16 @@ declare class WrWaves {
|
|
|
53
53
|
private bounding;
|
|
54
54
|
private readonly mouse;
|
|
55
55
|
private rafId;
|
|
56
|
+
/**
|
|
57
|
+
* Flips once the canvas has drawn, which retires the CSS stand-in grid.
|
|
58
|
+
*
|
|
59
|
+
* A canvas cannot be prerendered, so on an SSR'd or prerendered page this
|
|
60
|
+
* element is simply blank until the bundle has loaded and hydration has run —
|
|
61
|
+
* measured at ~2.8s on ngwr.dev's own home page. The stylesheet paints a static
|
|
62
|
+
* grid of the same colour and pitch in the meantime, straight from the
|
|
63
|
+
* prerendered HTML, and this hands over to the real thing.
|
|
64
|
+
*/
|
|
65
|
+
protected readonly painted: _angular_core.WritableSignal<boolean>;
|
|
56
66
|
constructor();
|
|
57
67
|
private boot;
|
|
58
68
|
private setSize;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
.wr-typewriter {
|
|
2
7
|
--wr-typewriter-cursor-blink: 0.5s;
|
|
3
8
|
|
|
@@ -174,13 +174,13 @@
|
|
|
174
174
|
color: var(--wr-color-primary);
|
|
175
175
|
}
|
|
176
176
|
&--tone-success {
|
|
177
|
-
color: var(--wr-color-success);
|
|
177
|
+
color: var(--wr-color-success-ink);
|
|
178
178
|
}
|
|
179
179
|
&--tone-warning {
|
|
180
|
-
color: var(--wr-color-warning);
|
|
180
|
+
color: var(--wr-color-warning-ink);
|
|
181
181
|
}
|
|
182
182
|
&--tone-danger {
|
|
183
|
-
color: var(--wr-color-danger);
|
|
183
|
+
color: var(--wr-color-danger-ink);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
// Modifiers
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
// Fixed-size virtual scroll wrapper. Most of the layout work is done by
|
|
2
7
|
// CDK's `<cdk-virtual-scroll-viewport>`; this stylesheet just makes the
|
|
3
8
|
// host a block-level container and tames default overflow behaviour.
|
|
@@ -11,7 +16,7 @@
|
|
|
11
16
|
width: 100%;
|
|
12
17
|
height: 100%;
|
|
13
18
|
// CDK already sets `overflow: auto`; just add a discreet scrollbar
|
|
14
|
-
// skin via the platform defaults —
|
|
19
|
+
// skin via the platform defaults — a discreet custom thumb that still matches the
|
|
15
20
|
// host application's chrome.
|
|
16
21
|
scrollbar-width: thin;
|
|
17
22
|
|
package/waves/styles/_index.scss
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
// Wave-field background (reactbits port). The host fills its nearest
|
|
2
7
|
// positioned ancestor; the line colour is theme-aware via
|
|
3
8
|
// `--wr-waves-line-color` unless `[lineColor]` overrides it.
|
|
4
9
|
|
|
5
10
|
.wr-waves {
|
|
6
11
|
--wr-waves-line-color: rgba(var(--wr-color-on-surface-rgb), 0.12);
|
|
12
|
+
// Mirrors the `xGap` input; the component publishes it so the stand-in below
|
|
13
|
+
// lands on the same pitch as the real grid.
|
|
14
|
+
--wr-waves-x-gap: 10px;
|
|
7
15
|
|
|
8
16
|
position: absolute;
|
|
9
17
|
inset: 0;
|
|
@@ -12,6 +20,24 @@
|
|
|
12
20
|
padding: 0;
|
|
13
21
|
overflow: hidden;
|
|
14
22
|
|
|
23
|
+
// Stand-in grid, shown until the canvas has painted.
|
|
24
|
+
//
|
|
25
|
+
// A canvas cannot be prerendered, so on an SSR'd or prerendered page this
|
|
26
|
+
// element is blank until the JS bundle has loaded and hydrated — measured at
|
|
27
|
+
// ~2.8s on ngwr.dev's own home page, where it reads as the background hanging
|
|
28
|
+
// and then popping in. These are straight lines rather than the drifting
|
|
29
|
+
// curves, at the same colour and pitch, so the handover reads as the grid
|
|
30
|
+
// coming alive rather than as content appearing.
|
|
31
|
+
background-image: repeating-linear-gradient(
|
|
32
|
+
to right,
|
|
33
|
+
var(--wr-waves-line-color) 0 1px,
|
|
34
|
+
transparent 1px var(--wr-waves-x-gap)
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
&--painted {
|
|
38
|
+
background-image: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
15
41
|
&__canvas {
|
|
16
42
|
display: block;
|
|
17
43
|
width: 100%;
|