ngwr 16.4.0 → 16.5.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/charts/bar-chart/styles/_index.scss +494 -305
- package/charts/boxplot-chart/styles/_index.scss +114 -48
- package/charts/bullet-chart/styles/_index.scss +113 -42
- package/charts/calendar-heatmap/styles/_index.scss +111 -20
- package/charts/candlestick-chart/styles/_index.scss +61 -26
- package/charts/chart-legend/styles/_index.scss +119 -1
- package/charts/core/styles/_index.scss +201 -5
- package/charts/donut-chart/styles/_index.scss +76 -21
- package/charts/funnel-chart/styles/_index.scss +66 -38
- package/charts/gauge/styles/_index.scss +12 -1
- package/charts/heatmap-chart/styles/_index.scss +90 -53
- package/charts/line-chart/styles/_index.scss +143 -139
- package/charts/meter-group/styles/_index.scss +87 -25
- package/charts/radar-chart/styles/_index.scss +82 -40
- package/charts/scatter-chart/styles/_index.scss +117 -44
- package/charts/sparkline/styles/_index.scss +7 -1
- package/charts/treemap-chart/styles/_index.scss +94 -42
- package/charts/waterfall-chart/styles/_index.scss +150 -87
- package/color-picker/styles/_index.scss +7 -3
- package/copy-value/styles/_index.scss +21 -2
- package/date-stamp/styles/_index.scss +2 -1
- package/dialog/styles/_index.scss +6 -0
- package/drawer/styles/_index.scss +5 -1
- package/fesm2022/ngwr-carousel-testing.mjs +4 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +21 -2
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +48 -4
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +299 -18
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +98 -12
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
- package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +44 -4
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +47 -19
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +38 -2
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +56 -8
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +13 -5
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +19 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +35 -6
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +1 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +81 -13
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +5 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +5 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +5 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +5 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +5 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +5 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +5 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +5 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +5 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +5 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +5 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +5 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +5 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +5 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +5 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +5 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +5 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +5 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +5 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +5 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +20 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +41 -5
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +67 -12
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +2 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +2 -0
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +14 -9
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +49 -16
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +16 -9
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/i18n/ar.json +5 -0
- package/i18n/cs.json +5 -0
- package/i18n/de.json +5 -0
- package/i18n/en.json +5 -0
- package/i18n/es.json +5 -0
- package/i18n/fr.json +5 -0
- package/i18n/he.json +5 -0
- package/i18n/hi.json +5 -0
- package/i18n/id.json +5 -0
- package/i18n/it.json +5 -0
- package/i18n/ja.json +5 -0
- package/i18n/ko.json +5 -0
- package/i18n/nl.json +5 -0
- package/i18n/pl.json +5 -0
- package/i18n/pt.json +5 -0
- package/i18n/ru.json +5 -0
- package/i18n/sv.json +5 -0
- package/i18n/tr.json +5 -0
- package/i18n/uk.json +5 -0
- package/i18n/vi.json +5 -0
- package/i18n/zh-TW.json +5 -0
- package/i18n/zh.json +5 -0
- package/llms-full.txt +8 -8
- package/llms.txt +7 -3
- package/package.json +1 -1
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +24 -13
- package/schematics/use/symbol-map.json +1 -0
- package/skills/ngwr/references/catalog.md +1 -1
- package/tour/styles/_index.scss +6 -0
- package/types/ngwr-carousel-testing.d.ts +6 -4
- package/types/ngwr-carousel.d.ts +14 -3
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +27 -3
- package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
- package/types/ngwr-charts-bar-chart.d.ts +220 -48
- package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
- package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
- package/types/ngwr-charts-bullet-chart.d.ts +72 -12
- package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
- package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
- package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
- package/types/ngwr-charts-chart-legend.d.ts +142 -5
- package/types/ngwr-charts-core.d.ts +259 -21
- package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
- package/types/ngwr-charts-donut-chart.d.ts +124 -16
- package/types/ngwr-charts-funnel-chart.d.ts +62 -6
- package/types/ngwr-charts-gauge-testing.d.ts +5 -1
- package/types/ngwr-charts-gauge.d.ts +72 -10
- package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
- package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
- package/types/ngwr-charts-line-chart.d.ts +215 -86
- package/types/ngwr-charts-meter-group.d.ts +96 -7
- package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
- package/types/ngwr-charts-radar-chart.d.ts +148 -28
- package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
- package/types/ngwr-charts-scatter-chart.d.ts +188 -18
- package/types/ngwr-charts-sparkline.d.ts +26 -4
- package/types/ngwr-charts-treemap-chart.d.ts +121 -23
- package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
- package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
- package/types/ngwr-color-picker.d.ts +27 -0
- package/types/ngwr-context-menu-testing.d.ts +10 -9
- package/types/ngwr-context-menu.d.ts +17 -0
- package/types/ngwr-copy-value.d.ts +8 -0
- package/types/ngwr-date-picker.d.ts +34 -2
- package/types/ngwr-dialog.d.ts +30 -10
- package/types/ngwr-drawer.d.ts +32 -1
- package/types/ngwr-dropdown-testing.d.ts +8 -5
- package/types/ngwr-dropdown.d.ts +29 -6
- package/types/ngwr-graph.d.ts +22 -6
- package/types/ngwr-lightbox.d.ts +15 -0
- package/types/ngwr-overlay.d.ts +16 -1
- package/types/ngwr-popconfirm-testing.d.ts +11 -2
- package/types/ngwr-popconfirm.d.ts +28 -1
- package/types/ngwr-popover.d.ts +59 -9
- package/types/ngwr-table.d.ts +1 -1
- package/types/ngwr-tour.d.ts +21 -2
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +33 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/window/styles/_index.scss +5 -10
|
@@ -58,6 +58,8 @@ interface DrawnStep {
|
|
|
58
58
|
readonly display: string;
|
|
59
59
|
/** Whether that figure goes under the bar — a change down, a total below zero — rather than over it. */
|
|
60
60
|
readonly below: boolean;
|
|
61
|
+
/** The running totals before and after the step, as one attribute: what the harness reads. */
|
|
62
|
+
readonly figures: string;
|
|
61
63
|
/** The change in full with its sign, `''` on a total. */
|
|
62
64
|
readonly changeText: string;
|
|
63
65
|
/** The running total after the step, in full. */
|
|
@@ -96,21 +98,29 @@ interface DrawnStep {
|
|
|
96
98
|
* a finite number counts as zero.
|
|
97
99
|
*
|
|
98
100
|
* **Colour is not the only channel.** An increase is `increaseColor`, a decrease
|
|
99
|
-
* `decreaseColor` and a total `totalColor` — success, danger and
|
|
100
|
-
* otherwise — and each is also told apart without hue: a change
|
|
101
|
-
* thin connector that carries the previous running total to it,
|
|
102
|
-
* on the
|
|
103
|
-
*
|
|
101
|
+
* `decreaseColor` and a total `totalColor` — success, danger and the first colour of the
|
|
102
|
+
* chart palette unless told otherwise — and each is also told apart without hue: a change
|
|
103
|
+
* runs UP or DOWN from the thin connector that carries the previous running total to it,
|
|
104
|
+
* its bar is rounded on the end it runs to, and with `showValues` its figure is printed on
|
|
105
|
+
* that side, with its sign (`+1,800`, `−350`); a total stands on the zero line, its figure
|
|
106
|
+
* has no `+` and its label is set in a heavier weight. A change of zero
|
|
104
107
|
* — or of a value that is not a finite number — is neither: a hairline at the running
|
|
105
108
|
* total in the neutral `--wr-waterfall-chart-flat-color`, printed `0` with no sign, and
|
|
106
109
|
* classed `--flat` rather than as an increase.
|
|
107
110
|
*
|
|
108
|
-
* Those cues are the figures and the connectors
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
111
|
+
* Those cues are the figures and the connectors. The figures are off by default, as on
|
|
112
|
+
* every chart of the family, so the connectors are the cue a chart keeps unconfigured:
|
|
113
|
+
* turning `showConnectors` off with `showValues` off leaves colour, and the 2px of
|
|
114
|
+
* rounding, to tell a change up from a change down on screen - a +100 and a following
|
|
115
|
+
* −100 float over the same span. Each step's name, the tooltip and the data table still
|
|
116
|
+
* carry the change; keep one of the two on wherever the chart has to read without hue. On
|
|
117
|
+
* a narrow chart a figure too wide for its column is left out (see `showValues`), and
|
|
118
|
+
* there the connectors are the cue that stays.
|
|
119
|
+
*
|
|
120
|
+
* **The frame.** Gridlines across the plot (`showGrid`) with a scale beside it
|
|
121
|
+
* (`showAxis`), both on by default, and the zero line either way. With no step the chart
|
|
122
|
+
* keeps that frame and says "No data"; `loading` and `error` put their own message there
|
|
123
|
+
* in place of the bars.
|
|
114
124
|
*
|
|
115
125
|
* Every figure below zero is written with `−` (U+2212 MINUS SIGN) in front of its
|
|
116
126
|
* magnitude — a change, a running total, a total and a tick alike — so a name reads
|
|
@@ -125,9 +135,10 @@ interface DrawnStep {
|
|
|
125
135
|
* The value axis always includes zero, so a total is a bar from the zero line and a
|
|
126
136
|
* running total that goes negative hangs below it. Under RTL the steps run from the
|
|
127
137
|
* right, with the value axis at the inline start, as every part of the layout is logical.
|
|
128
|
-
* The gap between two bars is `--wr-waterfall-chart-gap`,
|
|
129
|
-
*
|
|
130
|
-
* than running out of room.
|
|
138
|
+
* The gap between two bars is `--wr-waterfall-chart-gap`, a share of one step's band
|
|
139
|
+
* (`--wr-chart-gap` by default) and never more than half of it, so a chart of many steps
|
|
140
|
+
* narrows its gaps with its bars rather than running out of room. A bar moves to a new
|
|
141
|
+
* value by a transform, so an update lays nothing out.
|
|
131
142
|
*
|
|
132
143
|
* @see https://ngwr.dev/charts/waterfall-chart
|
|
133
144
|
*/
|
|
@@ -148,12 +159,22 @@ export declare class WrWaterfallChart {
|
|
|
148
159
|
readonly increaseColor: import("@angular/core").InputSignal<string>;
|
|
149
160
|
/** The colour of a change down. Any CSS colour. @default 'var(--wr-color-danger)' */
|
|
150
161
|
readonly decreaseColor: import("@angular/core").InputSignal<string>;
|
|
151
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* The colour of a total. Any CSS colour. The first colour of the chart palette, which is
|
|
164
|
+
* the brand colour until `--wr-chart-1` is set: a total is neither a gain nor a loss, so
|
|
165
|
+
* it takes no status colour. @default 'var(--wr-chart-1)'
|
|
166
|
+
*/
|
|
152
167
|
readonly totalColor: import("@angular/core").InputSignal<string>;
|
|
153
168
|
/** The plot's height in px, at least 80. @default 240 */
|
|
154
169
|
readonly height: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
155
|
-
/**
|
|
170
|
+
/**
|
|
171
|
+
* Draw the gridlines: one across the plot at every tick of the value axis, in
|
|
172
|
+
* `--wr-waterfall-chart-grid-color` (the chart theme's `--wr-chart-grid`). The zero line
|
|
173
|
+
* is drawn either way. @default true
|
|
174
|
+
*/
|
|
156
175
|
readonly showGrid: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
176
|
+
/** Print the value axis' scale beside the plot: a number at every tick. @default true */
|
|
177
|
+
readonly showAxis: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
157
178
|
/**
|
|
158
179
|
* Print each step's figure past the end of its bar: a change with its sign, over the bar
|
|
159
180
|
* when it runs up and under it when it runs down, and a total with no `+`. Compact from
|
|
@@ -167,7 +188,8 @@ export declare class WrWaterfallChart {
|
|
|
167
188
|
*
|
|
168
189
|
* The sign is one of the two cues besides colour that tell a change up from a change
|
|
169
190
|
* down; the connectors are the other. Off together with `showConnectors`, colour is the
|
|
170
|
-
* only one left on screen.
|
|
191
|
+
* only one left on screen. Off by default, as on every chart of the family: the scale,
|
|
192
|
+
* the tooltip and each step's name already carry the figures. @default false
|
|
171
193
|
*/
|
|
172
194
|
readonly showValues: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
173
195
|
/**
|
|
@@ -182,10 +204,30 @@ export declare class WrWaterfallChart {
|
|
|
182
204
|
*/
|
|
183
205
|
readonly showConnectors: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
184
206
|
/**
|
|
185
|
-
* Show a tooltip with the step's change and the running total after it on hover.
|
|
186
|
-
* only — each step's accessible name already carries both.
|
|
207
|
+
* Show a tooltip with the step's change and the running total after it on hover.
|
|
208
|
+
* Pointer only — each step's accessible name already carries both.
|
|
209
|
+
*
|
|
210
|
+
* By default the pointer passes under the chip to the chart, so the next section
|
|
211
|
+
* answers at once and the chip closes off the chart; `'hoverable'` lets the pointer
|
|
212
|
+
* rest on the chip instead, as WCAG 1.4.13 asks of a hint. @default true
|
|
213
|
+
*/
|
|
214
|
+
readonly tooltip: import("@angular/core").InputSignalWithTransform<boolean | "hoverable", unknown>;
|
|
215
|
+
/**
|
|
216
|
+
* A request for the chart's data is in flight: the bars give way to the loading
|
|
217
|
+
* message, over the grid and the scale the chart keeps. @default false
|
|
187
218
|
*/
|
|
188
|
-
readonly
|
|
219
|
+
readonly loading: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
220
|
+
/**
|
|
221
|
+
* The chart's data failed to load: the bars give way to the error message. `loading`
|
|
222
|
+
* wins while both are set. @default false
|
|
223
|
+
*/
|
|
224
|
+
readonly error: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
225
|
+
/** The message shown with no step to draw. Falls back to `chart.empty`, then `'No data'`. */
|
|
226
|
+
readonly emptyLabel: import("@angular/core").InputSignal<string | null>;
|
|
227
|
+
/** The message shown while `loading`. Falls back to `chart.loading`, then `'Loading…'`. */
|
|
228
|
+
readonly loadingLabel: import("@angular/core").InputSignal<string | null>;
|
|
229
|
+
/** The message shown on `error`. Falls back to `chart.error`, then `'Could not load'`. */
|
|
230
|
+
readonly errorLabel: import("@angular/core").InputSignal<string | null>;
|
|
189
231
|
/**
|
|
190
232
|
* Render the chart's figures as a table only assistive technology reaches, beside the
|
|
191
233
|
* drawing: a row per step, headed by its label, with its change (empty on a total) and
|
|
@@ -220,7 +262,7 @@ export declare class WrWaterfallChart {
|
|
|
220
262
|
private readonly runningTotalName;
|
|
221
263
|
private readonly changeStepName;
|
|
222
264
|
private readonly totalStepName;
|
|
223
|
-
private readonly
|
|
265
|
+
private readonly host;
|
|
224
266
|
constructor();
|
|
225
267
|
/**
|
|
226
268
|
* Every step with its arithmetic done. The running total starts at zero, and a total
|
|
@@ -250,6 +292,17 @@ export declare class WrWaterfallChart {
|
|
|
250
292
|
* names, the tooltip and the table cannot disagree.
|
|
251
293
|
*/
|
|
252
294
|
protected readonly drawn: import("@angular/core").Signal<readonly DrawnStep[]>;
|
|
295
|
+
/**
|
|
296
|
+
* Each step's classes, as ONE binding: its kind, `--down` where its bar runs down from
|
|
297
|
+
* where it starts (a change down, a total below zero), which is the end the stylesheet
|
|
298
|
+
* rounds, and `--active` on the step the tooltip is about. Five bindings a step were
|
|
299
|
+
* five comparisons a step on every hover change; this is one string each.
|
|
300
|
+
*/
|
|
301
|
+
protected readonly classes: import("@angular/core").Signal<readonly string[]>;
|
|
302
|
+
/** The part of a step's classes a hover does not change. */
|
|
303
|
+
private readonly kinds;
|
|
304
|
+
/** What the chart shows in place of its bars, or `null` while it draws them. */
|
|
305
|
+
protected readonly state: import("@angular/core").Signal<import("ngwr/charts/core").WrChartStateView | null>;
|
|
253
306
|
/**
|
|
254
307
|
* The figures for `dataTable`: the chart's name as the caption, a row per step headed by
|
|
255
308
|
* its label, and its change and the running total after it as the columns. A total has
|
|
@@ -263,6 +316,10 @@ export declare class WrWaterfallChart {
|
|
|
263
316
|
* height of the plot; a change of zero keeps its hairline to point at, and no swatch,
|
|
264
317
|
* since its neutral paint says nothing. Each figure is isolated (see `isolate`), so a
|
|
265
318
|
* sign stays in front of its digits in an RTL document.
|
|
319
|
+
*
|
|
320
|
+
* The bar's box is worked out from the two ends the chart wrote and the column's own
|
|
321
|
+
* box, not read off the bar: a bar is moved by a transform inside a box that clips it,
|
|
322
|
+
* so its own box is neither where it is drawn nor, mid-transition, where it is going.
|
|
266
323
|
*/
|
|
267
324
|
protected readonly tip: import("ngwr/popover").WrChartTooltip;
|
|
268
325
|
/** Where `value` sits on the axis, as a percentage of the drawing's height from its bottom. */
|
|
@@ -308,6 +365,11 @@ export declare class WrWaterfallChart {
|
|
|
308
365
|
"required": false;
|
|
309
366
|
"isSignal": true;
|
|
310
367
|
};
|
|
368
|
+
"showAxis": {
|
|
369
|
+
"alias": "showAxis";
|
|
370
|
+
"required": false;
|
|
371
|
+
"isSignal": true;
|
|
372
|
+
};
|
|
311
373
|
"showValues": {
|
|
312
374
|
"alias": "showValues";
|
|
313
375
|
"required": false;
|
|
@@ -323,6 +385,31 @@ export declare class WrWaterfallChart {
|
|
|
323
385
|
"required": false;
|
|
324
386
|
"isSignal": true;
|
|
325
387
|
};
|
|
388
|
+
"loading": {
|
|
389
|
+
"alias": "loading";
|
|
390
|
+
"required": false;
|
|
391
|
+
"isSignal": true;
|
|
392
|
+
};
|
|
393
|
+
"error": {
|
|
394
|
+
"alias": "error";
|
|
395
|
+
"required": false;
|
|
396
|
+
"isSignal": true;
|
|
397
|
+
};
|
|
398
|
+
"emptyLabel": {
|
|
399
|
+
"alias": "emptyLabel";
|
|
400
|
+
"required": false;
|
|
401
|
+
"isSignal": true;
|
|
402
|
+
};
|
|
403
|
+
"loadingLabel": {
|
|
404
|
+
"alias": "loadingLabel";
|
|
405
|
+
"required": false;
|
|
406
|
+
"isSignal": true;
|
|
407
|
+
};
|
|
408
|
+
"errorLabel": {
|
|
409
|
+
"alias": "errorLabel";
|
|
410
|
+
"required": false;
|
|
411
|
+
"isSignal": true;
|
|
412
|
+
};
|
|
326
413
|
"dataTable": {
|
|
327
414
|
"alias": "dataTable";
|
|
328
415
|
"required": false;
|
|
@@ -2,6 +2,7 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
import { WrClassInput } from "ngwr/utils";
|
|
3
3
|
import { FormValueControl } from "@angular/forms/signals";
|
|
4
4
|
import { WrSegmentedOption } from "ngwr/segmented";
|
|
5
|
+
import { WrOverlayAutoFocus } from "ngwr/overlay";
|
|
5
6
|
/**
|
|
6
7
|
* @license
|
|
7
8
|
*
|
|
@@ -492,6 +493,17 @@ export declare class WrColorPickerTrigger {
|
|
|
492
493
|
readonly size: import("@angular/core").InputSignal<WrColorPickerSize>;
|
|
493
494
|
/** Disable the trigger entirely. @default false */
|
|
494
495
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
496
|
+
/**
|
|
497
|
+
* Where focus goes when the picker opens. `false` leaves it on the trigger,
|
|
498
|
+
* and Tab from there walks into the panel; `'first-tabbable'` puts it on the
|
|
499
|
+
* saturation surface; `'dialog'` on the panel itself, with no ring. Closing
|
|
500
|
+
* hands focus back to the trigger whenever it was inside.
|
|
501
|
+
*
|
|
502
|
+
* Prefixed because the directive sits on your own element, where an
|
|
503
|
+
* `autoFocus` attribute would also be the native `autofocus`.
|
|
504
|
+
* @default false
|
|
505
|
+
*/
|
|
506
|
+
readonly autoFocus: import("@angular/core").InputSignal<WrOverlayAutoFocus>;
|
|
495
507
|
/**
|
|
496
508
|
* Extra CSS classes for the picker panel's overlay pane.
|
|
497
509
|
*
|
|
@@ -507,6 +519,7 @@ export declare class WrColorPickerTrigger {
|
|
|
507
519
|
readonly closed: import("@angular/core").OutputEmitterRef<void>;
|
|
508
520
|
private readonly host;
|
|
509
521
|
private readonly focusMonitor;
|
|
522
|
+
private readonly focusTraps;
|
|
510
523
|
private readonly overlay;
|
|
511
524
|
private readonly outsideClick;
|
|
512
525
|
private readonly vcr;
|
|
@@ -524,6 +537,7 @@ export declare class WrColorPickerTrigger {
|
|
|
524
537
|
/** Whether the picker panel is open. Read-only: `open()` and `close()` change it. */
|
|
525
538
|
readonly isOpen: import("@angular/core").Signal<boolean>;
|
|
526
539
|
private overlayRef;
|
|
540
|
+
private finder;
|
|
527
541
|
/** @internal Public so the host binding can read it. */
|
|
528
542
|
protected readonly panelId: string;
|
|
529
543
|
constructor();
|
|
@@ -531,6 +545,14 @@ export declare class WrColorPickerTrigger {
|
|
|
531
545
|
toggle(): void;
|
|
532
546
|
/** Open the picker. No-op if already open. */
|
|
533
547
|
open(): void;
|
|
548
|
+
/**
|
|
549
|
+
* Tab on the trigger while the picker is open walks into it, as it would into
|
|
550
|
+
* a panel rendered beside the trigger.
|
|
551
|
+
*
|
|
552
|
+
* @internal
|
|
553
|
+
*/
|
|
554
|
+
protected onTriggerTab(event: Event): void;
|
|
555
|
+
private surface;
|
|
534
556
|
/** Close the picker. No-op if already closed. */
|
|
535
557
|
close(): void;
|
|
536
558
|
private dispose;
|
|
@@ -566,6 +588,11 @@ export declare class WrColorPickerTrigger {
|
|
|
566
588
|
"required": false;
|
|
567
589
|
"isSignal": true;
|
|
568
590
|
};
|
|
591
|
+
"autoFocus": {
|
|
592
|
+
"alias": "wrColorPickerTriggerAutoFocus";
|
|
593
|
+
"required": false;
|
|
594
|
+
"isSignal": true;
|
|
595
|
+
};
|
|
569
596
|
"panelClass": {
|
|
570
597
|
"alias": "panelClass";
|
|
571
598
|
"required": false;
|
|
@@ -87,8 +87,8 @@ export declare class WrContextMenuItemHarness extends ComponentHarness {
|
|
|
87
87
|
/**
|
|
88
88
|
* Whether the item holds the menu's roving focus.
|
|
89
89
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
90
|
+
* ArrowDown moves focus onto the menu's first enabled row and the arrows walk
|
|
91
|
+
* it from there, so this is where the keyboard is. Opening a
|
|
92
92
|
* submenu hands the cursor to the submenu's own first row, which leaves the
|
|
93
93
|
* item that owns it unfocused while its pane is up.
|
|
94
94
|
*/
|
|
@@ -200,10 +200,10 @@ export declare class WrContextMenuItemHarness extends ComponentHarness {
|
|
|
200
200
|
* `clickItem()` leaves it closed.
|
|
201
201
|
* - Submenus are a first-class input here rather than a nested trigger, so they
|
|
202
202
|
* are driven from {@link WrContextMenuItemHarness}.
|
|
203
|
-
* -
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* `getFocusedItemText()` answers
|
|
203
|
+
* - Opening leaves focus where it was unless the trigger sets `wrContextMenuAutoFocus`, as a
|
|
204
|
+
* dropdown's does. ArrowDown anywhere on the page walks in while the menu is
|
|
205
|
+
* open: `(await menu.host()).sendKeys(TestKey.DOWN_ARROW)`, and
|
|
206
|
+
* `getFocusedItemText()` answers from there.
|
|
207
207
|
*
|
|
208
208
|
* **Timing.** The waits are real: a 500ms `setTimeout` for the long-press hold and
|
|
209
209
|
* another 220ms one for the exit animation the pane is held alive through, plus the
|
|
@@ -341,9 +341,10 @@ export declare class WrContextMenuHarness extends ContentContainerComponentHarne
|
|
|
341
341
|
* The label of the item that currently holds focus, or `null` when the
|
|
342
342
|
* keyboard is elsewhere.
|
|
343
343
|
*
|
|
344
|
-
* The menu roves focus rather than drawing a cursor —
|
|
345
|
-
* ENABLED item
|
|
346
|
-
* items only — so this is the only way
|
|
344
|
+
* The menu roves focus rather than drawing a cursor — ArrowDown lands on the
|
|
345
|
+
* first ENABLED item (opening alone moves nothing unless `wrContextMenuAutoFocus` is set),
|
|
346
|
+
* and the arrows walk it over the enabled items only — so this is the only way
|
|
347
|
+
* to ask where the keyboard is. It answers
|
|
347
348
|
* `null` once a submenu has taken the cursor: that pane is a separate overlay,
|
|
348
349
|
* and its own rows are reached through `WrContextMenuItemHarness`.
|
|
349
350
|
*/
|
|
@@ -65,6 +65,18 @@ export declare class WrContextMenuPanel {
|
|
|
65
65
|
export declare class WrContextMenu {
|
|
66
66
|
/** Menu to open. Pass a `<wr-context-menu>` template reference. */
|
|
67
67
|
readonly menu: import("@angular/core").InputSignal<WrContextMenuPanel>;
|
|
68
|
+
/**
|
|
69
|
+
* Focus the first item when the menu opens. Off, focus stays on the element
|
|
70
|
+
* that had it, and while the menu is open ArrowDown / ArrowUp anywhere on the
|
|
71
|
+
* page walk into it at its first / last item; a letter jumps to the item it
|
|
72
|
+
* starts. Closing hands focus back only when it was inside.
|
|
73
|
+
*
|
|
74
|
+
* Prefixed because the directive sits on your own element, where an
|
|
75
|
+
* `autoFocus` attribute would also be the native `autofocus`.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
readonly autoFocus: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
68
80
|
private readonly host;
|
|
69
81
|
private readonly focusMonitor;
|
|
70
82
|
private readonly overlay;
|
|
@@ -222,6 +234,11 @@ export declare class WrContextMenu {
|
|
|
222
234
|
"required": true;
|
|
223
235
|
"isSignal": true;
|
|
224
236
|
};
|
|
237
|
+
"autoFocus": {
|
|
238
|
+
"alias": "wrContextMenuAutoFocus";
|
|
239
|
+
"required": false;
|
|
240
|
+
"isSignal": true;
|
|
241
|
+
};
|
|
225
242
|
}, {}, never, never, true, never>;
|
|
226
243
|
}
|
|
227
244
|
/**
|
|
@@ -47,6 +47,14 @@ export declare class WrCopyValue {
|
|
|
47
47
|
protected readonly resolvedCopiedLabel: import("@angular/core").Signal<string>;
|
|
48
48
|
protected readonly resolvedEmptyLabel: import("@angular/core").Signal<string>;
|
|
49
49
|
protected readonly text: import("@angular/core").Signal<string>;
|
|
50
|
+
/**
|
|
51
|
+
* In `wrap` mode the text up to its last character and that character with any trailing space; else the whole text and nothing.
|
|
52
|
+
* Only one character stays with the button, so a long unbroken value can still break inside the head.
|
|
53
|
+
*/
|
|
54
|
+
protected readonly parts: import("@angular/core").Signal<{
|
|
55
|
+
head: string;
|
|
56
|
+
tail: string;
|
|
57
|
+
}>;
|
|
50
58
|
protected readonly empty: import("@angular/core").Signal<boolean>;
|
|
51
59
|
/** True for a moment after a successful copy. */
|
|
52
60
|
protected readonly justCopied: import("@angular/core").WritableSignal<boolean>;
|
|
@@ -329,6 +329,15 @@ export declare class WrDatePicker implements FormValueControl<Date | null> {
|
|
|
329
329
|
* `datePicker.panel*` string for the current `mode`.
|
|
330
330
|
*/
|
|
331
331
|
readonly panelAriaLabel: import("@angular/core").InputSignal<string | null>;
|
|
332
|
+
/**
|
|
333
|
+
* Move focus into the panel when a pointer press on the calendar button
|
|
334
|
+
* opens it. Off by default: the press leaves focus on the button, and the
|
|
335
|
+
* keyboard is what moves in, by Enter or Space on the button, `Alt+ArrowDown`
|
|
336
|
+
* in the field, or `ArrowDown` once the panel is open. Closing hands focus
|
|
337
|
+
* back to where it came from whenever it was inside.
|
|
338
|
+
* @default false
|
|
339
|
+
*/
|
|
340
|
+
readonly autoFocus: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
332
341
|
/**
|
|
333
342
|
* Extra CSS classes for the calendar panel's overlay pane.
|
|
334
343
|
*
|
|
@@ -515,7 +524,7 @@ export declare class WrDatePicker implements FormValueControl<Date | null> {
|
|
|
515
524
|
focus(options?: FocusOptions): void;
|
|
516
525
|
/** Called by the input's click — opens the overlay if it isn't open already. */
|
|
517
526
|
protected openOnInput(): void;
|
|
518
|
-
protected toggleOverlay(): void;
|
|
527
|
+
protected toggleOverlay(event: MouseEvent): void;
|
|
519
528
|
/**
|
|
520
529
|
* The keyboard route into the panel, per the APG date-picker pattern.
|
|
521
530
|
*
|
|
@@ -526,6 +535,8 @@ export declare class WrDatePicker implements FormValueControl<Date | null> {
|
|
|
526
535
|
* date keeps working exactly as before.
|
|
527
536
|
*/
|
|
528
537
|
protected onFieldKey(event: KeyboardEvent): void;
|
|
538
|
+
/** `ArrowDown` on the calendar button moves into the panel a pointer press opened. */
|
|
539
|
+
protected onTriggerArrow(event: Event): void;
|
|
529
540
|
/**
|
|
530
541
|
* Move focus into an already-mounted panel. A plain query is right HERE and
|
|
531
542
|
* wrong at mount time: the panel has settled, so there is no deferral to get
|
|
@@ -653,6 +664,11 @@ export declare class WrDatePicker implements FormValueControl<Date | null> {
|
|
|
653
664
|
"required": false;
|
|
654
665
|
"isSignal": true;
|
|
655
666
|
};
|
|
667
|
+
"autoFocus": {
|
|
668
|
+
"alias": "autoFocus";
|
|
669
|
+
"required": false;
|
|
670
|
+
"isSignal": true;
|
|
671
|
+
};
|
|
656
672
|
"panelClass": {
|
|
657
673
|
"alias": "panelClass";
|
|
658
674
|
"required": false;
|
|
@@ -870,6 +886,15 @@ export declare class WrDateRangePicker implements FormValueControl<WrDateRange |
|
|
|
870
886
|
* `datePicker.panelRange*` string for the current `mode`.
|
|
871
887
|
*/
|
|
872
888
|
readonly panelAriaLabel: import("@angular/core").InputSignal<string | null>;
|
|
889
|
+
/**
|
|
890
|
+
* Move focus into the panel when a pointer press on the calendar button
|
|
891
|
+
* opens it. Off by default: the press leaves focus on the button, and the
|
|
892
|
+
* keyboard is what moves in, by Enter or Space on the button, `Alt+ArrowDown`
|
|
893
|
+
* in the field, or `ArrowDown` once the panel is open. Closing hands focus
|
|
894
|
+
* back to where it came from whenever it was inside.
|
|
895
|
+
* @default false
|
|
896
|
+
*/
|
|
897
|
+
readonly autoFocus: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
873
898
|
/**
|
|
874
899
|
* Extra CSS classes for the calendar panel's overlay pane.
|
|
875
900
|
*
|
|
@@ -1007,7 +1032,7 @@ export declare class WrDateRangePicker implements FormValueControl<WrDateRange |
|
|
|
1007
1032
|
focus(options?: FocusOptions): void;
|
|
1008
1033
|
/** Called by an input's click — opens the overlay if it isn't open already. */
|
|
1009
1034
|
protected openOnInput(end: RangeEnd): void;
|
|
1010
|
-
protected toggleOverlay(): void;
|
|
1035
|
+
protected toggleOverlay(event: MouseEvent): void;
|
|
1011
1036
|
/**
|
|
1012
1037
|
* The keyboard route into the popup, per the APG date-picker pattern, and the
|
|
1013
1038
|
* only one either field has. `Alt+ArrowDown` opens and takes focus; a bare
|
|
@@ -1018,6 +1043,8 @@ export declare class WrDateRangePicker implements FormValueControl<WrDateRange |
|
|
|
1018
1043
|
protected onFieldKey(event: KeyboardEvent, end: RangeEnd): void;
|
|
1019
1044
|
/** The input element for an end — the two are otherwise addressed by index. */
|
|
1020
1045
|
private fieldEl;
|
|
1046
|
+
/** `ArrowDown` on the calendar button moves into the panel a pointer press opened. */
|
|
1047
|
+
protected onTriggerArrow(event: Event): void;
|
|
1021
1048
|
/**
|
|
1022
1049
|
* Move focus into an already-mounted panel. A plain query is right HERE and
|
|
1023
1050
|
* wrong at mount time: the panel has settled, so there is no deferral to get
|
|
@@ -1204,6 +1231,11 @@ export declare class WrDateRangePicker implements FormValueControl<WrDateRange |
|
|
|
1204
1231
|
"required": false;
|
|
1205
1232
|
"isSignal": true;
|
|
1206
1233
|
};
|
|
1234
|
+
"autoFocus": {
|
|
1235
|
+
"alias": "autoFocus";
|
|
1236
|
+
"required": false;
|
|
1237
|
+
"isSignal": true;
|
|
1238
|
+
};
|
|
1207
1239
|
"panelClass": {
|
|
1208
1240
|
"alias": "panelClass";
|
|
1209
1241
|
"required": false;
|
package/types/ngwr-dialog.d.ts
CHANGED
|
@@ -94,6 +94,13 @@ export declare class WrDialogRef<C, R = unknown> {
|
|
|
94
94
|
}
|
|
95
95
|
/** The ARIA role a dialog panel announces. */
|
|
96
96
|
type WrDialogRole = 'dialog' | 'alertdialog';
|
|
97
|
+
/**
|
|
98
|
+
* What a dialog does with focus when it opens: `'first-tabbable'` focuses the
|
|
99
|
+
* first tabbable element, `'dialog'` focuses the panel itself (no ring, so the
|
|
100
|
+
* first Tab reaches the first control), `false` moves nothing. An element with
|
|
101
|
+
* `cdkFocusInitial` wins in every mode.
|
|
102
|
+
*/
|
|
103
|
+
type WrDialogAutoFocus = 'first-tabbable' | 'dialog' | false;
|
|
97
104
|
/**
|
|
98
105
|
* Options accepted by `WrDialog.open()`.
|
|
99
106
|
*/
|
|
@@ -159,9 +166,20 @@ interface WrDialogOptions<D = unknown> {
|
|
|
159
166
|
* @default 'above'
|
|
160
167
|
*/
|
|
161
168
|
readonly toasts?: 'above' | 'below';
|
|
169
|
+
/**
|
|
170
|
+
* Where focus goes when the dialog opens. `'dialog'` focuses the panel itself,
|
|
171
|
+
* with no ring, so the first Tab goes to the first control. `'first-tabbable'`
|
|
172
|
+
* focuses the first tabbable element, which lights the focus ring on a button
|
|
173
|
+
* when the user pressed nothing. `false` leaves focus where it was. The default is `'dialog'`: a modal that moves no focus strands keyboard
|
|
174
|
+
* users, and `'first-tabbable'` is the explicit opt-in. An
|
|
175
|
+
* element marked `cdkFocusInitial` wins in every mode. The focus trap and the
|
|
176
|
+
* return of focus to the opener on close do not change.
|
|
177
|
+
* @default 'dialog', or what `withDialog()` sets
|
|
178
|
+
*/
|
|
179
|
+
readonly autoFocus?: WrDialogAutoFocus;
|
|
162
180
|
}
|
|
163
181
|
/** The `WrDialogOptions` that `confirm()` and `alert()` pass through to the dialog. */
|
|
164
|
-
type WrDialogMessageOptions = Pick<WrDialogOptions, 'width' | 'maxWidth' | 'panelClass' | 'closeOnBackdropClick' | 'closeOnEscape' | 'closeOnNavigation' | 'tabTitle' | 'toasts'>;
|
|
182
|
+
type WrDialogMessageOptions = Pick<WrDialogOptions, 'width' | 'maxWidth' | 'panelClass' | 'closeOnBackdropClick' | 'closeOnEscape' | 'closeOnNavigation' | 'tabTitle' | 'autoFocus' | 'toasts'>;
|
|
165
183
|
/** The meaning a `confirm()` or an `alert()` dialog shows as an icon before its title. */
|
|
166
184
|
type WrDialogIntent = 'info' | 'success' | 'warning' | 'danger';
|
|
167
185
|
/**
|
|
@@ -217,7 +235,7 @@ interface WrDialogAlertOptions extends WrDialogMessageOptions {
|
|
|
217
235
|
readonly intent?: WrDialogIntent;
|
|
218
236
|
}
|
|
219
237
|
/** App-wide dialog defaults, passed to `provideWr(withDialog(...))`. */
|
|
220
|
-
type WrDialogDefaults = Pick<WrDialogOptions, 'tabTitle'>;
|
|
238
|
+
type WrDialogDefaults = Pick<WrDialogOptions, 'tabTitle' | 'autoFocus'>;
|
|
221
239
|
/**
|
|
222
240
|
* Opens dialog components in an isolated NGWR overlay.
|
|
223
241
|
*
|
|
@@ -262,8 +280,9 @@ export declare class WrDialog {
|
|
|
262
280
|
* The dialog is `role="alertdialog"`, named by `title` and described by
|
|
263
281
|
* `message`, with no corner dismiss: the two buttons are the answers. Labels
|
|
264
282
|
* fall back to the `common.ok` and `common.cancel` catalog keys. With
|
|
265
|
-
* `confirmColor: 'danger'` initial focus is on
|
|
266
|
-
*
|
|
283
|
+
* `autoFocus: 'first-tabbable'` and `confirmColor: 'danger'` initial focus is on
|
|
284
|
+
* the cancel button, and on the confirm button otherwise; by default the panel
|
|
285
|
+
* takes it. Focus returns to the opener on close, as it does
|
|
267
286
|
* for `open()`.
|
|
268
287
|
*
|
|
269
288
|
* `intent` puts an icon before the title, and `danger` or `warning` color the
|
|
@@ -293,7 +312,7 @@ export declare class WrDialog {
|
|
|
293
312
|
*
|
|
294
313
|
* The dialog is `confirm()`'s with one button: `role="alertdialog"` for every
|
|
295
314
|
* intent, named by `title` and described by `message`, with no corner
|
|
296
|
-
* dismiss.
|
|
315
|
+
* dismiss. Under `autoFocus: 'first-tabbable'` the button takes the initial focus; its label falls back to the
|
|
297
316
|
* `common.ok` catalog key. `intent` puts an icon before the title.
|
|
298
317
|
*
|
|
299
318
|
* On the server it resolves at once and opens nothing.
|
|
@@ -309,6 +328,7 @@ export declare class WrDialog {
|
|
|
309
328
|
* ```
|
|
310
329
|
*/
|
|
311
330
|
alert(options: WrDialogAlertOptions): Promise<void>;
|
|
331
|
+
private autoFocusOf;
|
|
312
332
|
private ask;
|
|
313
333
|
/**
|
|
314
334
|
* Tie the dialog's lifetime to the URL it was opened on.
|
|
@@ -397,9 +417,9 @@ export declare const WR_DIALOG_DATA: InjectionToken<unknown>;
|
|
|
397
417
|
*/
|
|
398
418
|
export declare const WR_DIALOG_REF: InjectionToken<WrDialogRef<unknown, unknown>>;
|
|
399
419
|
/**
|
|
400
|
-
* App-wide dialog defaults, as a feature of `provideWr()`:
|
|
401
|
-
*
|
|
402
|
-
* `open()` or `confirm()` still wins.
|
|
420
|
+
* App-wide dialog defaults, as a feature of `provideWr()`: `tabTitle`, so
|
|
421
|
+
* every dialog names the browser tab while it is open, and `autoFocus`, where
|
|
422
|
+
* focus goes on open. The same option on `open()` or `confirm()` still wins.
|
|
403
423
|
*
|
|
404
424
|
* Bootstrap only: `WrDialog` is root-provided and reads it once, from the root
|
|
405
425
|
* injector, so in a route's `providers` it changes nothing.
|
|
@@ -410,7 +430,7 @@ export declare const WR_DIALOG_REF: InjectionToken<WrDialogRef<unknown, unknown>
|
|
|
410
430
|
* import { withDialog } from 'ngwr/dialog';
|
|
411
431
|
*
|
|
412
432
|
* bootstrapApplication(App, {
|
|
413
|
-
* providers: [provideWr(withDialog({ tabTitle: true }))],
|
|
433
|
+
* providers: [provideWr(withDialog({ tabTitle: true, autoFocus: 'first-tabbable' }))],
|
|
414
434
|
* });
|
|
415
435
|
* ```
|
|
416
436
|
*/
|
|
@@ -528,4 +548,4 @@ export declare class WrDialogClose<R = unknown> {
|
|
|
528
548
|
};
|
|
529
549
|
}, {}, never, never, true, never>;
|
|
530
550
|
}
|
|
531
|
-
export type { WrDialogAlertOptions, WrDialogConfirmOptions, WrDialogDefaults, WrDialogIntent, WrDialogMessageOptions, WrDialogOptions, WrDialogRole };
|
|
551
|
+
export type { WrDialogAlertOptions, WrDialogAutoFocus, WrDialogConfirmOptions, WrDialogDefaults, WrDialogIntent, WrDialogMessageOptions, WrDialogOptions, WrDialogRole };
|
package/types/ngwr-drawer.d.ts
CHANGED
|
@@ -13,6 +13,13 @@ import { ReplaySubject } from "rxjs";
|
|
|
13
13
|
*/
|
|
14
14
|
/** Side of the viewport the drawer slides in from. */
|
|
15
15
|
type WrDrawerPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
16
|
+
/**
|
|
17
|
+
* What a drawer does with focus when it opens: `'first-tabbable'` focuses the
|
|
18
|
+
* first tabbable element, `'dialog'` focuses the panel itself (no ring, so the
|
|
19
|
+
* first Tab reaches the first control), `false` moves nothing. An element with
|
|
20
|
+
* `cdkFocusInitial` wins in every mode.
|
|
21
|
+
*/
|
|
22
|
+
type WrDrawerAutoFocus = 'first-tabbable' | 'dialog' | false;
|
|
16
23
|
/**
|
|
17
24
|
* Options accepted by `WrDrawerManager.open()`.
|
|
18
25
|
*
|
|
@@ -83,6 +90,17 @@ interface WrDrawerOptions<D = unknown> {
|
|
|
83
90
|
* @default 'above'
|
|
84
91
|
*/
|
|
85
92
|
readonly toasts?: 'above' | 'below';
|
|
93
|
+
/**
|
|
94
|
+
* Where focus goes when the drawer opens. `'dialog'` focuses the panel itself,
|
|
95
|
+
* with no ring, so the first Tab goes to the first control. `'first-tabbable'`
|
|
96
|
+
* focuses the first tabbable element, which lights the focus ring on a button
|
|
97
|
+
* when the user pressed nothing. `false` leaves focus where it was. The default is `'dialog'`: a modal that moves no focus strands keyboard
|
|
98
|
+
* users, and `'first-tabbable'` is the explicit opt-in. An
|
|
99
|
+
* element marked `cdkFocusInitial` wins in every mode. The trap of a modal
|
|
100
|
+
* drawer and the return of focus on close do not change.
|
|
101
|
+
* @default 'dialog'
|
|
102
|
+
*/
|
|
103
|
+
readonly autoFocus?: WrDrawerAutoFocus;
|
|
86
104
|
}
|
|
87
105
|
/**
|
|
88
106
|
* Side panel that slides in from an edge of the viewport. Two-way binds
|
|
@@ -167,6 +185,14 @@ export declare class WrDrawer {
|
|
|
167
185
|
* @default 'above'
|
|
168
186
|
*/
|
|
169
187
|
readonly toasts: import("@angular/core").InputSignal<"below" | "above">;
|
|
188
|
+
/**
|
|
189
|
+
* Where focus goes when the drawer opens: `'dialog'` focuses the panel itself
|
|
190
|
+
* with no ring so the first Tab reaches the first control, `'first-tabbable'`
|
|
191
|
+
* focuses the first tabbable element, `false` moves nothing. An element
|
|
192
|
+
* marked `cdkFocusInitial` wins in every mode. Read when the drawer opens.
|
|
193
|
+
* @default 'dialog'
|
|
194
|
+
*/
|
|
195
|
+
readonly autoFocus: import("@angular/core").InputSignal<WrDrawerAutoFocus>;
|
|
170
196
|
protected readonly resolvedCloseLabel: import("@angular/core").Signal<string>;
|
|
171
197
|
protected readonly panelTpl: import("@angular/core").Signal<TemplateRef<any>>;
|
|
172
198
|
/**
|
|
@@ -311,6 +337,11 @@ export declare class WrDrawer {
|
|
|
311
337
|
"required": false;
|
|
312
338
|
"isSignal": true;
|
|
313
339
|
};
|
|
340
|
+
"autoFocus": {
|
|
341
|
+
"alias": "autoFocus";
|
|
342
|
+
"required": false;
|
|
343
|
+
"isSignal": true;
|
|
344
|
+
};
|
|
314
345
|
}, {
|
|
315
346
|
"open": "openChange";
|
|
316
347
|
}, ["projectedTitle"], ["*"], true, never>;
|
|
@@ -596,4 +627,4 @@ export declare class WrDrawerClose<R = unknown> {
|
|
|
596
627
|
};
|
|
597
628
|
}, {}, never, never, true, never>;
|
|
598
629
|
}
|
|
599
|
-
export type { WrDrawerOptions, WrDrawerPosition };
|
|
630
|
+
export type { WrDrawerAutoFocus, WrDrawerOptions, WrDrawerPosition };
|
|
@@ -139,7 +139,8 @@ export declare class WrDropdownHarness extends ContentContainerComponentHarness
|
|
|
139
139
|
open(): Promise<void>;
|
|
140
140
|
/**
|
|
141
141
|
* Open the menu from the keyboard — ArrowDown on the trigger, the APG
|
|
142
|
-
* menu-button path (ArrowUp / Enter / Space do the same).
|
|
142
|
+
* menu-button path (ArrowUp / Enter / Space do the same). Focus stays on the
|
|
143
|
+
* trigger unless the dropdown sets `wrDropdownAutoFocus`.
|
|
143
144
|
*
|
|
144
145
|
* Worth its own method rather than an argument to `open()`: it is the only way
|
|
145
146
|
* to get TWO dropdowns open at once, because clicking a second trigger is an
|
|
@@ -183,10 +184,12 @@ export declare class WrDropdownHarness extends ContentContainerComponentHarness
|
|
|
183
184
|
* The label of the item that currently holds focus, or `null` when focus is
|
|
184
185
|
* elsewhere.
|
|
185
186
|
*
|
|
186
|
-
* The menu roves focus rather than moving a visual cursor
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
187
|
+
* The menu roves focus rather than moving a visual cursor, so this is the only
|
|
188
|
+
* way to ask where the keyboard is. Opening leaves focus on the trigger unless
|
|
189
|
+
* the dropdown sets `wrDropdownAutoFocus`: send ArrowDown to the host
|
|
190
|
+
* (`(await dropdown.host()).sendKeys(TestKey.DOWN_ARROW)`) to walk in at the
|
|
191
|
+
* first ENABLED item, and the arrow keys walk from there over the enabled
|
|
192
|
+
* items only (a disabled one is not a stop).
|
|
190
193
|
*/
|
|
191
194
|
getFocusedItemText(): Promise<string | null>;
|
|
192
195
|
/**
|