ngwr 16.3.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/carousel/styles/_index.scss +53 -1
- 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-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +27 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +86 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +56 -25
- 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 +60 -17
- 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 +49 -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-file-upload.mjs +7 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +27 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +643 -14
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +13 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +13 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +13 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +13 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +13 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +13 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +13 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +13 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +13 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +13 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +13 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +13 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +13 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +13 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +13 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +13 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +13 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +13 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +13 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +13 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +13 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +22 -5
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +1 -0
- package/fesm2022/ngwr-pagination.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 +3 -0
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +100 -3
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +2 -2
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +71 -3
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +173 -11
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tour-testing.mjs +13 -1
- package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +25 -16
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +52 -8
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +64 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +16 -9
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/graph/styles/_index.scss +87 -0
- package/i18n/ar.json +13 -4
- package/i18n/cs.json +13 -4
- package/i18n/de.json +13 -4
- package/i18n/en.json +13 -4
- package/i18n/es.json +13 -4
- package/i18n/fr.json +13 -4
- package/i18n/he.json +13 -4
- package/i18n/hi.json +13 -4
- package/i18n/id.json +13 -4
- package/i18n/it.json +13 -4
- package/i18n/ja.json +13 -4
- package/i18n/ko.json +13 -4
- package/i18n/nl.json +13 -4
- package/i18n/pl.json +13 -4
- package/i18n/pt.json +13 -4
- package/i18n/ru.json +13 -4
- package/i18n/sv.json +13 -4
- package/i18n/tr.json +13 -4
- package/i18n/uk.json +13 -4
- package/i18n/vi.json +13 -4
- package/i18n/zh-TW.json +13 -4
- package/i18n/zh.json +13 -4
- package/llms-full.txt +12 -12
- package/llms.txt +64 -27
- package/package.json +1 -1
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +24 -13
- package/schematics/collection.json +5 -0
- package/schematics/eject/index.js +158 -0
- package/schematics/eject/schema.js +8 -0
- package/schematics/eject/schema.json +24 -0
- package/schematics/eject/source.js +295 -0
- package/schematics/use/symbol-map.json +2 -0
- package/select/styles/_index.scss +13 -0
- package/skills/ngwr/SKILL.md +30 -3
- package/skills/ngwr/references/catalog.md +2 -2
- package/table/styles/_index.scss +24 -0
- package/theme/styles/_focus.scss +11 -1
- package/tour/styles/_index.scss +6 -0
- package/types/ngwr-carousel-testing.d.ts +29 -6
- package/types/ngwr-carousel.d.ts +52 -5
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +29 -7
- 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 +19 -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 +31 -6
- package/types/ngwr-file-upload.d.ts +8 -2
- package/types/ngwr-graph-testing.d.ts +28 -0
- package/types/ngwr-graph.d.ts +263 -91
- 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-select.d.ts +37 -0
- package/types/ngwr-table-testing.d.ts +52 -1
- package/types/ngwr-table.d.ts +102 -10
- package/types/ngwr-tour-testing.d.ts +10 -0
- package/types/ngwr-tour.d.ts +32 -4
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +35 -2
- package/types/ngwr-utils.d.ts +79 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/window/styles/_index.scss +5 -10
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.EJECT_SHARED_DIR = void 0;
|
|
10
|
+
exports.collectEjected = collectEjected;
|
|
11
|
+
exports.ejectHeader = ejectHeader;
|
|
12
|
+
exports.ejectRawUrl = ejectRawUrl;
|
|
13
|
+
exports.ejectRefusal = ejectRefusal;
|
|
14
|
+
exports.ejectTarget = ejectTarget;
|
|
15
|
+
exports.ejectableEntryPoints = ejectableEntryPoints;
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const DEFAULT_REPOSITORY = 'thekhegay/ngwr';
|
|
18
|
+
const DEFAULT_DIRECTORY = 'projects/lib';
|
|
19
|
+
/**
|
|
20
|
+
* The raw-file URL of one source file at the tag of a release.
|
|
21
|
+
*
|
|
22
|
+
* `file` is a path under the library folder: `button/button.ts`.
|
|
23
|
+
*/
|
|
24
|
+
function ejectRawUrl(version, file, repository = {}) {
|
|
25
|
+
const slug = /github\.com[/:]([^/]+\/[^/]+?)(?:\.git)?$/.exec(repository.url ?? '')?.[1] ?? DEFAULT_REPOSITORY;
|
|
26
|
+
const directory = (repository.directory ?? DEFAULT_DIRECTORY).replace(/^\/+|\/+$/g, '');
|
|
27
|
+
return `https://raw.githubusercontent.com/${slug}/v${version}/${directory}/${file}`;
|
|
28
|
+
}
|
|
29
|
+
const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
30
|
+
/** Every entry point with code behind it: no root, no wildcard, no stylesheet-only path. */
|
|
31
|
+
function codeEntryPoints(exports) {
|
|
32
|
+
return Object.keys(exports)
|
|
33
|
+
.filter(key => key.startsWith('./') &&
|
|
34
|
+
!key.includes('*') &&
|
|
35
|
+
!key.endsWith('.json') &&
|
|
36
|
+
isRecord(exports[key]) &&
|
|
37
|
+
'default' in exports[key])
|
|
38
|
+
.map(key => key.slice(2));
|
|
39
|
+
}
|
|
40
|
+
/** Why an entry point is never ejected, read off its path alone. */
|
|
41
|
+
function structuralRefusal(entry) {
|
|
42
|
+
if (/(^|\/)testing$/.test(entry))
|
|
43
|
+
return 'a test harness';
|
|
44
|
+
if (/(^|\/)router$/.test(entry))
|
|
45
|
+
return 'a router adapter';
|
|
46
|
+
if (/^i18n(\/|$)/.test(entry))
|
|
47
|
+
return 'a translation catalogue';
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
/** The entry points `ng g ngwr:eject` accepts by name, from the `exports` map. */
|
|
51
|
+
function ejectableEntryPoints(exports) {
|
|
52
|
+
return codeEntryPoints(exports).filter(entry => structuralRefusal(entry) === null);
|
|
53
|
+
}
|
|
54
|
+
/** Why `entry` cannot be ejected, or `null` when its name is acceptable. */
|
|
55
|
+
function ejectRefusal(entry, exports) {
|
|
56
|
+
const reason = structuralRefusal(entry);
|
|
57
|
+
if (reason)
|
|
58
|
+
return `ngwr/${entry} is ${reason}, not a component. Eject the component it belongs to.`;
|
|
59
|
+
if (ejectableEntryPoints(exports).includes(entry))
|
|
60
|
+
return null;
|
|
61
|
+
return `ngwr/${entry} is not an entry point. Give a component's path under ngwr/: ${ejectableEntryPoints(exports).join(', ')}.`;
|
|
62
|
+
}
|
|
63
|
+
/** The entry point a path under the library folder belongs to: the longest one that contains it. */
|
|
64
|
+
function ownerOf(path, entryPoints) {
|
|
65
|
+
let owner = null;
|
|
66
|
+
for (const entry of entryPoints) {
|
|
67
|
+
if ((path === entry || path.startsWith(`${entry}/`)) && (owner === null || entry.length > owner.length)) {
|
|
68
|
+
owner = entry;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return owner;
|
|
72
|
+
}
|
|
73
|
+
const NOT_FOUND = 'reaches a file that could not be read from the source, so nothing was copied for it';
|
|
74
|
+
/** The folder private files are copied to, beside the ejected one and shared by its neighbours. */
|
|
75
|
+
const EJECT_SHARED_DIR = '_ngwr-internal';
|
|
76
|
+
exports.EJECT_SHARED_DIR = EJECT_SHARED_DIR;
|
|
77
|
+
/** The header each copied file opens with. `entry` is `null` for a private file in the shared folder. */
|
|
78
|
+
function ejectHeader(file, entry, version) {
|
|
79
|
+
const lines = [
|
|
80
|
+
entry === null
|
|
81
|
+
? `Copied from ngwr@${version} by \`ng g ngwr:eject\`: a private file that ejected components share.`
|
|
82
|
+
: `Copied from ngwr@${version}, entry point ngwr/${entry}, by \`ng g ngwr:eject\`.`,
|
|
83
|
+
'`ng update` no longer updates this copy.',
|
|
84
|
+
];
|
|
85
|
+
return file.endsWith('.html')
|
|
86
|
+
? `<!--\n ${lines.join('\n ')}\n-->\n`
|
|
87
|
+
: `${lines.map(line => `// ${line}`).join('\n')}\n\n`;
|
|
88
|
+
}
|
|
89
|
+
/** Whether a line is commentary, where an `import … from` is prose or a usage example. */
|
|
90
|
+
const isCommentLine = (line) => /^\s*(\*|\/\*|\/\/)/.test(line);
|
|
91
|
+
const TS_SPECIFIER = /(\bfrom\s+|\bimport\s*\(\s*|^\s*import\s+)(['"])([^'"]+)\2/g;
|
|
92
|
+
const TS_RESOURCE = /\b(?:templateUrl|styleUrl)\s*:\s*(['"])([^'"]+)\1/g;
|
|
93
|
+
const TS_STYLE_URLS = /\bstyleUrls\s*:\s*\[([^\]]*)\]/g;
|
|
94
|
+
const SASS_LOAD = /^(\s*@(use|forward|import)\s+)(['"])([^'"]+)\3(.*)$/;
|
|
95
|
+
/**
|
|
96
|
+
* The files of one entry point, rewritten to live outside the library.
|
|
97
|
+
*
|
|
98
|
+
* Starts at `public-api.ts`, the barrel and the stylesheet the `exports` map
|
|
99
|
+
* names, and follows every relative import, `templateUrl`, `styleUrl` and Sass
|
|
100
|
+
* load. Where one lands decides what happens to it:
|
|
101
|
+
*
|
|
102
|
+
* - inside the entry point: the file is copied, at the same place in the folder;
|
|
103
|
+
* - on another entry point: the import becomes that entry point's package path
|
|
104
|
+
* (`../utils` reads `ngwr/utils`, `../../button/styles` reads `ngwr/button`),
|
|
105
|
+
* so the copy keeps using the installed package for everything but itself;
|
|
106
|
+
* - on a file no package path exposes (`animations/internal`, a theme partial):
|
|
107
|
+
* the file is copied too, under `../_ngwr-internal/<its path in the library>`,
|
|
108
|
+
* its own imports are followed the same way, and the import is rewritten to
|
|
109
|
+
* reach it there. Later ejects beside this one share that folder.
|
|
110
|
+
*
|
|
111
|
+
* A file path in the result is relative to the ejected folder, so a shared one
|
|
112
|
+
* starts with `../_ngwr-internal/`. Only an import whose file cannot be read is
|
|
113
|
+
* left as written and reported.
|
|
114
|
+
*
|
|
115
|
+
* `folder` is the name of the folder the copy is written to, which a private
|
|
116
|
+
* file reaching back into the component has to spell.
|
|
117
|
+
*
|
|
118
|
+
* Resolves to `null` when the entry point has no `public-api.ts` to start from.
|
|
119
|
+
*/
|
|
120
|
+
async function collectEjected(entry, exports, version, read, folder = node_path_1.posix.basename(entry)) {
|
|
121
|
+
const entryPoints = codeEntryPoints(exports);
|
|
122
|
+
const loaded = new Map();
|
|
123
|
+
const files = new Map();
|
|
124
|
+
const warnings = [];
|
|
125
|
+
const queue = [];
|
|
126
|
+
const queued = new Set();
|
|
127
|
+
const load = async (path) => {
|
|
128
|
+
if (!loaded.has(path))
|
|
129
|
+
loaded.set(path, await read(path));
|
|
130
|
+
return loaded.get(path) ?? null;
|
|
131
|
+
};
|
|
132
|
+
/** Queues the first candidate that exists; `false` when none does. */
|
|
133
|
+
const follow = async (candidates) => {
|
|
134
|
+
for (const candidate of candidates) {
|
|
135
|
+
if ((await load(candidate)) !== null) {
|
|
136
|
+
if (!queued.has(candidate)) {
|
|
137
|
+
queued.add(candidate);
|
|
138
|
+
queue.push(candidate);
|
|
139
|
+
}
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
144
|
+
};
|
|
145
|
+
const own = (path) => ownerOf(path, entryPoints) === entry;
|
|
146
|
+
/** Where a library path lands, relative to the ejected folder. */
|
|
147
|
+
const placed = (path) => (own(path) ? node_path_1.posix.relative(entry, path) : `../${EJECT_SHARED_DIR}/${path}`);
|
|
148
|
+
const header = (file) => ejectHeader(file, own(file) ? entry : null, version);
|
|
149
|
+
/** `line` is 1-based in the source; the warning names the line in the copy, below its header. */
|
|
150
|
+
const warn = (file, line, specifier) => {
|
|
151
|
+
warnings.push({
|
|
152
|
+
file: placed(file),
|
|
153
|
+
line: line + header(file).split('\n').length - 1,
|
|
154
|
+
specifier,
|
|
155
|
+
reason: NOT_FOUND,
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
/** The package path a load that leaves the entry point should read, or `null` when it has none. */
|
|
159
|
+
const publicPath = (target, sass) => {
|
|
160
|
+
const owner = ownerOf(target, entryPoints);
|
|
161
|
+
if (owner === null || owner === entry)
|
|
162
|
+
return null;
|
|
163
|
+
const rest = target.slice(owner.length + 1);
|
|
164
|
+
if (!sass)
|
|
165
|
+
return rest === '' || rest === 'index' || rest === 'public-api' ? `ngwr/${owner}` : null;
|
|
166
|
+
// `<entry>/styles` is what the `sass` condition resolves to. The theme's is
|
|
167
|
+
// `theme/_index.scss`, which forwards `theme/styles` whole.
|
|
168
|
+
const entryExports = exports[`./${owner}`];
|
|
169
|
+
const shipsStyles = isRecord(entryExports) && 'sass' in entryExports;
|
|
170
|
+
return shipsStyles && /^styles(\/_?index(\.scss)?)?$/.test(rest) ? `ngwr/${owner}` : null;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* What a relative specifier reads once both ends are placed, or `null` to
|
|
174
|
+
* leave it as written: two files on the same side keep their distance.
|
|
175
|
+
*/
|
|
176
|
+
const relocated = (file, target) => {
|
|
177
|
+
if (own(file) === own(target))
|
|
178
|
+
return null;
|
|
179
|
+
// From the parent both folders sit in, where the ejected one has a name:
|
|
180
|
+
// a private file reaching back into the component has to spell it.
|
|
181
|
+
const fromParent = (path) => node_path_1.posix.join(folder, placed(path));
|
|
182
|
+
const relative = node_path_1.posix.relative(node_path_1.posix.dirname(fromParent(file)), fromParent(target));
|
|
183
|
+
return relative.startsWith('.') ? relative : `./${relative}`;
|
|
184
|
+
};
|
|
185
|
+
const sassCandidates = (target) => {
|
|
186
|
+
const base = node_path_1.posix.basename(target).replace(/\.scss$/, '');
|
|
187
|
+
const parent = node_path_1.posix.dirname(target);
|
|
188
|
+
return [
|
|
189
|
+
`${parent}/_${base}.scss`,
|
|
190
|
+
`${parent}/${base}.scss`,
|
|
191
|
+
`${parent}/${base}/_index.scss`,
|
|
192
|
+
`${parent}/${base}/index.scss`,
|
|
193
|
+
];
|
|
194
|
+
};
|
|
195
|
+
const rewriteTs = async (file, source) => {
|
|
196
|
+
const dir = node_path_1.posix.dirname(file);
|
|
197
|
+
const lines = source.split('\n');
|
|
198
|
+
for (let index = 0; index < lines.length; index++) {
|
|
199
|
+
const line = lines[index];
|
|
200
|
+
if (isCommentLine(line))
|
|
201
|
+
continue;
|
|
202
|
+
for (const match of [...line.matchAll(TS_SPECIFIER)]) {
|
|
203
|
+
const specifier = match[3];
|
|
204
|
+
if (!specifier.startsWith('.'))
|
|
205
|
+
continue;
|
|
206
|
+
const target = node_path_1.posix.normalize(node_path_1.posix.join(dir, specifier));
|
|
207
|
+
let replacement = publicPath(target, false);
|
|
208
|
+
if (replacement === null) {
|
|
209
|
+
if (!(await follow(target === entry ? [`${entry}/index.ts`] : [`${target}.ts`, `${target}/index.ts`]))) {
|
|
210
|
+
warn(file, index + 1, specifier);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
replacement = relocated(file, target);
|
|
214
|
+
}
|
|
215
|
+
if (replacement !== null) {
|
|
216
|
+
lines[index] = lines[index].replace(`${match[2]}${specifier}${match[2]}`, `'${replacement}'`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const resources = [...source.matchAll(TS_RESOURCE)].map(match => match[2]);
|
|
221
|
+
for (const list of source.matchAll(TS_STYLE_URLS)) {
|
|
222
|
+
resources.push(...[...list[1].matchAll(/(['"])([^'"]+)\1/g)].map(match => match[2]));
|
|
223
|
+
}
|
|
224
|
+
for (const resource of resources)
|
|
225
|
+
await follow([node_path_1.posix.normalize(node_path_1.posix.join(dir, resource))]);
|
|
226
|
+
return lines.join('\n');
|
|
227
|
+
};
|
|
228
|
+
const rewriteSass = async (file, source) => {
|
|
229
|
+
const dir = node_path_1.posix.dirname(file);
|
|
230
|
+
const lines = source.split('\n');
|
|
231
|
+
for (let index = 0; index < lines.length; index++) {
|
|
232
|
+
const match = SASS_LOAD.exec(lines[index]);
|
|
233
|
+
if (!match)
|
|
234
|
+
continue;
|
|
235
|
+
const [, head, rule, quote, specifier, tail] = match;
|
|
236
|
+
if (/^(sass:|ngwr(\/|$)|https?:)/.test(specifier) || specifier.endsWith('.css'))
|
|
237
|
+
continue;
|
|
238
|
+
const target = node_path_1.posix.normalize(node_path_1.posix.join(dir, specifier));
|
|
239
|
+
const packagePath = publicPath(target, true);
|
|
240
|
+
if (packagePath !== null) {
|
|
241
|
+
// A `@use` with no `as` is named after its last segment, which the package path changes.
|
|
242
|
+
const namespace = rule === 'use' && !/^\s+as\s/.test(tail) ? ` as ${node_path_1.posix.basename(specifier)}` : '';
|
|
243
|
+
lines[index] = `${head}${quote}${packagePath}${quote}${namespace}${tail}`;
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (!(await follow(sassCandidates(target)))) {
|
|
247
|
+
warn(file, index + 1, specifier);
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const replacement = relocated(file, target);
|
|
251
|
+
if (replacement !== null)
|
|
252
|
+
lines[index] = `${head}${quote}${replacement}${quote}${tail}`;
|
|
253
|
+
}
|
|
254
|
+
return lines.join('\n');
|
|
255
|
+
};
|
|
256
|
+
if (!(await follow([`${entry}/public-api.ts`])))
|
|
257
|
+
return null;
|
|
258
|
+
await follow([`${entry}/index.ts`]);
|
|
259
|
+
const entryExports = exports[`./${entry}`];
|
|
260
|
+
const sassEntry = isRecord(entryExports) ? entryExports.sass : null;
|
|
261
|
+
const stylesFile = typeof sassEntry === 'string' ? node_path_1.posix.normalize(sassEntry) : null;
|
|
262
|
+
const styles = stylesFile !== null && (await follow([stylesFile])) ? stylesFile : null;
|
|
263
|
+
let declarable = false;
|
|
264
|
+
for (let file = queue.shift(); file !== undefined; file = queue.shift()) {
|
|
265
|
+
const source = (await load(file)) ?? '';
|
|
266
|
+
let content = source;
|
|
267
|
+
if (file.endsWith('.ts')) {
|
|
268
|
+
declarable ||= own(file) && /^\s*@(Component|Directive)\s*\(/m.test(source);
|
|
269
|
+
content = await rewriteTs(file, source);
|
|
270
|
+
}
|
|
271
|
+
else if (file.endsWith('.scss')) {
|
|
272
|
+
content = await rewriteSass(file, source);
|
|
273
|
+
}
|
|
274
|
+
files.set(file, header(file) + content);
|
|
275
|
+
}
|
|
276
|
+
return {
|
|
277
|
+
files: [...files]
|
|
278
|
+
.map(([path, content]) => ({ path: placed(path), content }))
|
|
279
|
+
.sort((a, b) => (a.path < b.path ? -1 : 1)),
|
|
280
|
+
warnings,
|
|
281
|
+
declarable,
|
|
282
|
+
styles: styles === null ? null : placed(styles),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* The entry point a name refers to: itself, or the one nested entry point a
|
|
287
|
+
* bare name ends, the way `component-style` reads `bar-chart`.
|
|
288
|
+
*/
|
|
289
|
+
function ejectTarget(name, exports) {
|
|
290
|
+
const candidates = ejectableEntryPoints(exports);
|
|
291
|
+
if (candidates.includes(name) || name.includes('/'))
|
|
292
|
+
return name;
|
|
293
|
+
const nested = candidates.filter(candidate => candidate.endsWith(`/${name}`));
|
|
294
|
+
return nested.length === 1 ? nested[0] : name;
|
|
295
|
+
}
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"WrCalendarHeatmap": "ngwr/charts/calendar-heatmap",
|
|
48
48
|
"WrCandlestickChart": "ngwr/charts/candlestick-chart",
|
|
49
49
|
"WrChartLegend": "ngwr/charts/chart-legend",
|
|
50
|
+
"WrChartScale": "ngwr/charts/chart-legend",
|
|
50
51
|
"WrDonutChart": "ngwr/charts/donut-chart",
|
|
51
52
|
"WrFunnelChart": "ngwr/charts/funnel-chart",
|
|
52
53
|
"WrGauge": "ngwr/charts/gauge",
|
|
@@ -215,6 +216,7 @@
|
|
|
215
216
|
"WrSwitch": "ngwr/switch",
|
|
216
217
|
"WrTable": "ngwr/table",
|
|
217
218
|
"WrTableCell": "ngwr/table",
|
|
219
|
+
"WrTableColumnChooser": "ngwr/table",
|
|
218
220
|
"WrTableEditCell": "ngwr/table",
|
|
219
221
|
"WrTableExpand": "ngwr/table",
|
|
220
222
|
"WrTableGroupHeader": "ngwr/table",
|
|
@@ -119,6 +119,19 @@
|
|
|
119
119
|
cursor: default;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
// The search status, inside the trigger: read out, never drawn.
|
|
123
|
+
&__status {
|
|
124
|
+
position: absolute;
|
|
125
|
+
width: 1px;
|
|
126
|
+
height: 1px;
|
|
127
|
+
padding: 0;
|
|
128
|
+
margin: -1px;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
clip: rect(0, 0, 0, 0);
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
border: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
122
135
|
&__trigger {
|
|
123
136
|
display: inline-flex;
|
|
124
137
|
align-items: center;
|
package/skills/ngwr/SKILL.md
CHANGED
|
@@ -54,10 +54,16 @@ guess gets backwards.
|
|
|
54
54
|
`wr-btn`, not `wr-button`. Check `references/catalog.md` before writing a tag.
|
|
55
55
|
- **Check for a MODE before reaching for another component.** The catalog is
|
|
56
56
|
deliberately consolidated: `wr-select` covers single / multi / search / tag,
|
|
57
|
-
`wr-date-picker` covers date / time / datetime,
|
|
57
|
+
`wr-date-picker` covers date / time / datetime and, through the same
|
|
58
|
+
`mode`, a week, month, quarter or year held as its first day,
|
|
59
|
+
`wr-popover` has a tooltip
|
|
58
60
|
mode, `wr-drawer` doubles as a bottom sheet (and, with `hasBackdrop` off,
|
|
59
61
|
a non-modal side panel), `wr-table` owns pinning,
|
|
60
|
-
resizing, grouping, tree rows, CSV export
|
|
62
|
+
resizing, grouping, tree rows, CSV export, virtual scroll, hidden columns,
|
|
63
|
+
a bulk-action bar and inline cell editing, `wr-tree` owns lazy children
|
|
64
|
+
(`loadChildren`), a `filter`, cascading checks (`cascade`) and drag and
|
|
65
|
+
drop (`draggable`), `wr-select` in multi mode has `selectAll`, and
|
|
66
|
+
`wr-graph` zooms and pans with `zoomable`. The charts too:
|
|
61
67
|
a pie is `wr-donut-chart` with `pie`, an area chart `wr-line-chart` with
|
|
62
68
|
`showArea` (and `stacked` for a stacked area), a polar area chart
|
|
63
69
|
`wr-radar-chart` with `variant="polar-area"`, a stacked, horizontal or
|
|
@@ -78,6 +84,24 @@ guess gets backwards.
|
|
|
78
84
|
claims, `<wr-form-field>` shows the validator's own message
|
|
79
85
|
(`required(path.email, { message: '…' })`), else `validation.<key>` from the
|
|
80
86
|
APP's i18n catalog. With neither, nothing renders and only dev mode warns.
|
|
87
|
+
- **A data view reports a change and never writes your data.** `(cellEdit)`
|
|
88
|
+
on `wr-table`, `(nodeMove)` on `wr-tree` (apply it with
|
|
89
|
+
`wrMoveTreeNode` from `ngwr/tree`), `(eventChange)` on
|
|
90
|
+
`wr-event-calendar`: update `items`, `nodes` or `events` in the
|
|
91
|
+
handler, or the screen keeps the old value. `wr-file-upload` does not
|
|
92
|
+
upload either: the app does, and reports each file through `[status]`.
|
|
93
|
+
- **Table extras are templates and one state object.** A cell editor is
|
|
94
|
+
`<ng-template wrTableEditCell="price" let-value let-set="set">` inside the
|
|
95
|
+
table, and it is what makes the column editable. Bulk actions go in
|
|
96
|
+
`<ng-template wrTableSelectionBar let-rows let-clear="clear">`. Columns hide
|
|
97
|
+
through `[(hiddenColumns)]`, with `columnChooser` for the built-in button
|
|
98
|
+
or `<wr-table-column-chooser [table]="table" />` in a menu of your own. A
|
|
99
|
+
saved view is the `WrTableState` that `(stateChange)` emits, restored
|
|
100
|
+
through `[state]` with a new object each time.
|
|
101
|
+
- **A click on a `wr-tree` branch row opens it** (`expandOnClick`, on by
|
|
102
|
+
default since 16.3). `[expandOnClick]="false"` leaves that to the arrow.
|
|
103
|
+
- **There is no input mask.** Put `ngx-mask` on the same `<input wrInput>`;
|
|
104
|
+
do not look for a `wrMask`.
|
|
81
105
|
- **`<wr-checkbox>` group identity is `checkboxValue`, not `value`.**
|
|
82
106
|
`value` is reserved for the form value, so a leftover `value="x"` lands on the
|
|
83
107
|
host as a plain DOM attribute, every box in the group keeps the default
|
|
@@ -124,12 +148,15 @@ guess gets backwards.
|
|
|
124
148
|
ng add ngwr # prompts, installs peers, prints bootstrap
|
|
125
149
|
ng g ngwr:use WrSelect --path src/app/some.ts # adds the import AND the @Component entry
|
|
126
150
|
ng g ngwr:provider icons # splices a provider into bootstrap
|
|
151
|
+
ng g ngwr:eject select # copies the component's source into src/app/ngwr/select
|
|
127
152
|
```
|
|
128
153
|
|
|
129
154
|
`--path` is a NAMED option on `ngwr:use`; only the symbol is positional, and
|
|
130
155
|
passing the path bare fails with `Unknown argument`. It takes declarables only:
|
|
131
156
|
a service such as `WrDialog` is refused, since the import line would compile and
|
|
132
|
-
the `imports` entry would not — `inject()` it instead.
|
|
157
|
+
the `imports` entry would not — `inject()` it instead. `ngwr:eject` is for
|
|
158
|
+
a component you need to change beyond its inputs and `--wr-*` hooks: the copy
|
|
159
|
+
is yours, and `ng update` no longer reaches it.
|
|
133
160
|
|
|
134
161
|
### Providers a component cannot work without
|
|
135
162
|
|
|
@@ -59,7 +59,7 @@ root barrel for components: the root `ngwr` exports only `provideWr()`.
|
|
|
59
59
|
| `ngwr/charts/calendar-heatmap/testing` | `import { WrCalendarHeatmapHarness } from 'ngwr/charts/calendar-heatmap/testing'` | — |
|
|
60
60
|
| `ngwr/charts/candlestick-chart` | `import { WrCandlestickChart } from 'ngwr/charts/candlestick-chart'` | `wr-candlestick-chart` |
|
|
61
61
|
| `ngwr/charts/candlestick-chart/testing` | `import { WrCandlestickChartHarness } from 'ngwr/charts/candlestick-chart/testing'` | — |
|
|
62
|
-
| `ngwr/charts/chart-legend` | `import { WrChartLegend } from 'ngwr/charts/chart-legend'` | `ul[wr-chart-legend]` |
|
|
62
|
+
| `ngwr/charts/chart-legend` | `import { WrChartLegend } from 'ngwr/charts/chart-legend'` | `ul[wr-chart-legend]` `wr-chart-scale` |
|
|
63
63
|
| `ngwr/charts/chart-legend/testing` | `import { WrChartLegendHarness } from 'ngwr/charts/chart-legend/testing'` | — |
|
|
64
64
|
| `ngwr/charts/donut-chart` | `import { WrDonutChart } from 'ngwr/charts/donut-chart'` | `wr-donut-chart` |
|
|
65
65
|
| `ngwr/charts/donut-chart/testing` | `import { WrDonutChartHarness } from 'ngwr/charts/donut-chart/testing'` | — |
|
|
@@ -221,7 +221,7 @@ root barrel for components: the root `ngwr` exports only `provideWr()`.
|
|
|
221
221
|
| `ngwr/storage` | `import { WrStorage } from 'ngwr/storage'` | — |
|
|
222
222
|
| `ngwr/switch` | `import { WrSwitch } from 'ngwr/switch'` | `wr-switch` |
|
|
223
223
|
| `ngwr/switch/testing` | `import { WrSwitchHarness } from 'ngwr/switch/testing'` | — |
|
|
224
|
-
| `ngwr/table` | `import { WrTable } from 'ngwr/table'` | `[wrTableCell]` `[wrTableEditCell]` `ng-template[wrTableExpand]` `wr-table-filter` `ng-template[wrTableGroupHeader]` `ng-template[wrTableSelectionBar]` `wr-table-sort` `wr-table` |
|
|
224
|
+
| `ngwr/table` | `import { WrTable } from 'ngwr/table'` | `[wrTableCell]` `wr-table-column-chooser` `[wrTableEditCell]` `ng-template[wrTableExpand]` `wr-table-filter` `ng-template[wrTableGroupHeader]` `ng-template[wrTableSelectionBar]` `wr-table-sort` `wr-table` |
|
|
225
225
|
| `ngwr/table/testing` | `import { WrTableCellHarness } from 'ngwr/table/testing'` | — |
|
|
226
226
|
| `ngwr/tabs` | `import { WrTabs } from 'ngwr/tabs'` | `wr-tab` `wr-tabs` |
|
|
227
227
|
| `ngwr/tabs/router` | `import { WrTabsRouting } from 'ngwr/tabs/router'` | `[wrTabsRouting]` |
|
package/table/styles/_index.scss
CHANGED
|
@@ -1460,3 +1460,27 @@ html.wr-table-dragging--blocked * {
|
|
|
1460
1460
|
transform: translateX(250%);
|
|
1461
1461
|
}
|
|
1462
1462
|
}
|
|
1463
|
+
|
|
1464
|
+
// --- Column chooser ---------------------------------------------------------
|
|
1465
|
+
// The column list, in the built-in panel or in a menu of the consumer's own.
|
|
1466
|
+
// Its hooks are declared on itself: wherever it is placed, it inherits nothing
|
|
1467
|
+
// from the table.
|
|
1468
|
+
.wr-table-column-chooser {
|
|
1469
|
+
--wr-table-column-chooser-gap: var(--wr-space-sm);
|
|
1470
|
+
--wr-table-column-chooser-divider: var(--wr-border-base);
|
|
1471
|
+
|
|
1472
|
+
display: flex;
|
|
1473
|
+
flex-direction: column;
|
|
1474
|
+
gap: var(--wr-table-column-chooser-gap);
|
|
1475
|
+
|
|
1476
|
+
// "Show all" stands apart from the columns it acts on.
|
|
1477
|
+
&__all {
|
|
1478
|
+
padding-block-end: var(--wr-table-column-chooser-gap);
|
|
1479
|
+
border-block-end: 1px solid var(--wr-table-column-chooser-divider);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
// The built-in panel keeps the gap it had before the list was a component.
|
|
1484
|
+
.wr-table__columns > .wr-table-column-chooser {
|
|
1485
|
+
--wr-table-column-chooser-gap: var(--wr-table-columns-gap);
|
|
1486
|
+
}
|
package/theme/styles/_focus.scss
CHANGED
|
@@ -156,8 +156,9 @@
|
|
|
156
156
|
@include focus-ring;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
// Carousel nav + dots
|
|
159
|
+
// Carousel nav, pause button + dots
|
|
160
160
|
.wr-carousel__nav:focus-visible,
|
|
161
|
+
.wr-carousel__toggle:focus-visible,
|
|
161
162
|
.wr-carousel__dot:focus-visible {
|
|
162
163
|
@include focus-ring;
|
|
163
164
|
}
|
|
@@ -275,3 +276,12 @@
|
|
|
275
276
|
position: relative;
|
|
276
277
|
z-index: 1;
|
|
277
278
|
}
|
|
279
|
+
|
|
280
|
+
// Graph — the viewport is the graph's one tab stop, the element a keyboard
|
|
281
|
+
// scrolls, or zooms and pans when the graph is `zoomable`. Its own `overflow`
|
|
282
|
+
// does not clip its outline, so the ring stays outset. The zoom buttons beside
|
|
283
|
+
// it are bare `<button>`s.
|
|
284
|
+
.wr-graph__viewport:focus-visible,
|
|
285
|
+
.wr-graph__control:focus-visible {
|
|
286
|
+
@include focus-ring;
|
|
287
|
+
}
|
package/tour/styles/_index.scss
CHANGED
|
@@ -40,6 +40,12 @@
|
|
|
40
40
|
height var(--wr-transition-base);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
// The card takes focus when a step opens, as `tabindex="-1"`: the keyboard is in
|
|
44
|
+
// the tour and no button is lit. A container is not a control to ring.
|
|
45
|
+
.wr-tour-popup:focus {
|
|
46
|
+
outline: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
.wr-tour-popup {
|
|
44
50
|
--wr-tour-popup-padding: var(--wr-space-lg);
|
|
45
51
|
--wr-tour-popup-border: var(--wr-border-base);
|
|
@@ -29,9 +29,9 @@ interface WrCarouselHarnessFilters extends BaseHarnessFilters {
|
|
|
29
29
|
* `role="group"` and `aria-roledescription="slide"` and nothing else — no
|
|
30
30
|
* `aria-current`, no `aria-hidden` on the ones off-screen. The current slide is
|
|
31
31
|
* published in exactly two places, the dot carrying `aria-current="true"` and the
|
|
32
|
-
* track's own offset, and {@link getActiveIndex} reads them in that order.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* track's own offset, and {@link getActiveIndex} reads them in that order. A
|
|
33
|
+
* move the reader made is also said by the one live region, which
|
|
34
|
+
* {@link getAnnouncement} reads; an autoplay tick is not.
|
|
35
35
|
* - **It never drags.** The swipe the component supports is a touch gesture
|
|
36
36
|
* measured against the viewport's own width, and jsdom has no layout — that width
|
|
37
37
|
* is 0, so the "20% of the viewport" threshold is 0 too and EVERY drag clears it,
|
|
@@ -182,6 +182,27 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
182
182
|
* carousel where it was.
|
|
183
183
|
*/
|
|
184
184
|
goTo(index: number): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* The text of the live region: `Slide 2 of 3` after an arrow, a dot or a swipe
|
|
187
|
+
* moved the carousel, and empty before any move and after an autoplay tick.
|
|
188
|
+
*/
|
|
189
|
+
getAnnouncement(): Promise<string>;
|
|
190
|
+
/**
|
|
191
|
+
* Whether the live region speaks: `polite`, or `off` while the slides advance on
|
|
192
|
+
* their own, when a tick must not be read out.
|
|
193
|
+
*/
|
|
194
|
+
getLivePoliteness(): Promise<string | null>;
|
|
195
|
+
/** Whether the pause button is on the page: `autoplay` and `pauseButton` on, two slides or more. */
|
|
196
|
+
hasPauseButton(): Promise<boolean>;
|
|
197
|
+
/**
|
|
198
|
+
* The name of the pause button, which says what a press does next: the pause
|
|
199
|
+
* label while autoplay is on, the play label while it is off, held or not.
|
|
200
|
+
* Throws when the button is not drawn, which is every carousel without
|
|
201
|
+
* `autoplay` and `pauseButton`.
|
|
202
|
+
*/
|
|
203
|
+
getAutoplayLabel(): Promise<string | null>;
|
|
204
|
+
/** Press the pause button. Throws when the button is not drawn. */
|
|
205
|
+
toggleAutoplay(): Promise<void>;
|
|
185
206
|
/**
|
|
186
207
|
* Move the pointer onto the carousel, which is what HOLDS autoplay.
|
|
187
208
|
*
|
|
@@ -193,8 +214,9 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
193
214
|
/** Move the pointer away again, releasing the hold. */
|
|
194
215
|
mouseAway(): Promise<void>;
|
|
195
216
|
/**
|
|
196
|
-
* Put keyboard focus on the first control the carousel renders — the
|
|
197
|
-
* arrow, or the first dot when the
|
|
217
|
+
* Put keyboard focus on the first control the carousel renders — the pause
|
|
218
|
+
* button under `autoplay` with `pauseButton`, else the previous arrow, or the first dot when the
|
|
219
|
+
* arrows are hidden.
|
|
198
220
|
*
|
|
199
221
|
* This is the keyboard half of the autoplay hold: WCAG 2.2.2 wants a way to stop
|
|
200
222
|
* moving content, and hovering is not one for someone who never touches a mouse,
|
|
@@ -205,7 +227,7 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
205
227
|
*
|
|
206
228
|
* Note what this is NOT: the dot of the slide showing. The dots are ordinary
|
|
207
229
|
* buttons with no roving `tabindex`, so each of them is a tab stop of its own and
|
|
208
|
-
* the first one a Tab press meets is the
|
|
230
|
+
* the first one a Tab press meets is the same whatever slide is current —
|
|
209
231
|
* two different questions, answered here and by {@link getActiveIndex}.
|
|
210
232
|
*
|
|
211
233
|
* Throws when the carousel renders no controls at all, because then there is
|
|
@@ -235,6 +257,7 @@ export declare class WrCarouselHarness extends ComponentHarness {
|
|
|
235
257
|
*/
|
|
236
258
|
private controls;
|
|
237
259
|
/** One arrow, or a failure naming both reasons it might not be there. */
|
|
260
|
+
private autoplayButton;
|
|
238
261
|
private nav;
|
|
239
262
|
}
|
|
240
263
|
export type { WrCarouselHarnessFilters };
|
package/types/ngwr-carousel.d.ts
CHANGED
|
@@ -98,6 +98,13 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
98
98
|
readonly roledescription: import("@angular/core").InputSignal<string | null>;
|
|
99
99
|
protected readonly resolvedRoledescription: import("@angular/core").Signal<string>;
|
|
100
100
|
protected readonly slideLabel: (params?: import("ngwr/i18n").WrI18nParams) => string;
|
|
101
|
+
/** Name of the autoplay button while the slides advance. Falls back to `marquee.pause`, "Pause" in English. */
|
|
102
|
+
readonly pauseLabel: import("@angular/core").InputSignal<string | null>;
|
|
103
|
+
/** Name of the autoplay button while the slides stand. Falls back to `marquee.play`, "Play" in English. */
|
|
104
|
+
readonly playLabel: import("@angular/core").InputSignal<string | null>;
|
|
105
|
+
protected readonly resolvedPauseLabel: import("@angular/core").Signal<string>;
|
|
106
|
+
protected readonly resolvedPlayLabel: import("@angular/core").Signal<string>;
|
|
107
|
+
private readonly positionText;
|
|
101
108
|
/** Active slide index. Two-way bindable. @default 0 */
|
|
102
109
|
readonly active: import("@angular/core").ModelSignal<number>;
|
|
103
110
|
/** Show prev / next arrow buttons. @default true */
|
|
@@ -106,11 +113,16 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
106
113
|
readonly showDots: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
107
114
|
/**
|
|
108
115
|
* Auto-advance slides. Held while the pointer or keyboard focus is inside the
|
|
109
|
-
* carousel and during a swipe
|
|
110
|
-
*
|
|
111
|
-
*
|
|
116
|
+
* carousel and during a swipe. While the reader prefers reduced motion it does
|
|
117
|
+
* not start until they press play. Turn on `pauseButton` to let readers stop
|
|
118
|
+
* it. @default false
|
|
112
119
|
*/
|
|
113
120
|
readonly autoplay: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
121
|
+
/**
|
|
122
|
+
* Draw a pause / play button while `autoplay` is on. WCAG 2.2.2 asks for a way
|
|
123
|
+
* to pause moving content, so turn it on with autoplay. @default false
|
|
124
|
+
*/
|
|
125
|
+
readonly pauseButton: import("@angular/core").InputSignalWithTransform<boolean, any>;
|
|
114
126
|
/** Autoplay interval (ms). @default 4000 */
|
|
115
127
|
readonly intervalMs: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
116
128
|
/** Wrap around at the ends. @default true */
|
|
@@ -157,10 +169,21 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
157
169
|
* `prefers-reduced-motion` asks a page to drop: the stylesheet already switches
|
|
158
170
|
* slides in place under it, and a panel that still changed every four seconds
|
|
159
171
|
* was the half that stylesheet cannot reach. A signal, so the preference is
|
|
160
|
-
* followed while the page is open
|
|
161
|
-
*
|
|
172
|
+
* followed while the page is open, until the reader presses the button: a
|
|
173
|
+
* press is an explicit answer and outranks the preference.
|
|
162
174
|
*/
|
|
163
175
|
private readonly reducedMotion;
|
|
176
|
+
/** What the reader last asked of the pause button, `null` until it is pressed. */
|
|
177
|
+
private readonly asked;
|
|
178
|
+
/** Whether autoplay is switched on, holds aside: what the button's name and glyph follow. */
|
|
179
|
+
protected readonly playing: import("@angular/core").Signal<boolean>;
|
|
180
|
+
/** The slides are advancing on their own right now. */
|
|
181
|
+
protected readonly rotating: import("@angular/core").Signal<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* Text of the live region: the position after a move the reader made. Empty
|
|
184
|
+
* after an autoplay tick, so the same position can be said again later.
|
|
185
|
+
*/
|
|
186
|
+
protected readonly announcement: import("@angular/core").WritableSignal<string>;
|
|
164
187
|
private readonly destroyRef;
|
|
165
188
|
private readonly isBrowser;
|
|
166
189
|
constructor();
|
|
@@ -168,7 +191,16 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
168
191
|
protected onHoverOut(): void;
|
|
169
192
|
protected onFocusIn(): void;
|
|
170
193
|
protected onFocusOut(): void;
|
|
194
|
+
/**
|
|
195
|
+
* The pause button. Play also lets go of the hover and focus holds in force:
|
|
196
|
+
* the press came from inside the carousel, so they would keep the slides still
|
|
197
|
+
* after the reader asked for them to move. Each hold comes back with the next
|
|
198
|
+
* `focusin` or `mouseenter`.
|
|
199
|
+
*/
|
|
200
|
+
protected toggleAutoplay(): void;
|
|
201
|
+
/** Show a slide, and announce its position: an autoplay tick is the only silent move. */
|
|
171
202
|
goTo(index: number): void;
|
|
203
|
+
private move;
|
|
172
204
|
next(): void;
|
|
173
205
|
prev(): void;
|
|
174
206
|
private swipeStartX;
|
|
@@ -210,6 +242,16 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
210
242
|
"required": false;
|
|
211
243
|
"isSignal": true;
|
|
212
244
|
};
|
|
245
|
+
"pauseLabel": {
|
|
246
|
+
"alias": "pauseLabel";
|
|
247
|
+
"required": false;
|
|
248
|
+
"isSignal": true;
|
|
249
|
+
};
|
|
250
|
+
"playLabel": {
|
|
251
|
+
"alias": "playLabel";
|
|
252
|
+
"required": false;
|
|
253
|
+
"isSignal": true;
|
|
254
|
+
};
|
|
213
255
|
"active": {
|
|
214
256
|
"alias": "active";
|
|
215
257
|
"required": false;
|
|
@@ -230,6 +272,11 @@ export declare class WrCarousel implements WrCarouselContext {
|
|
|
230
272
|
"required": false;
|
|
231
273
|
"isSignal": true;
|
|
232
274
|
};
|
|
275
|
+
"pauseButton": {
|
|
276
|
+
"alias": "pauseButton";
|
|
277
|
+
"required": false;
|
|
278
|
+
"isSignal": true;
|
|
279
|
+
};
|
|
233
280
|
"intervalMs": {
|
|
234
281
|
"alias": "intervalMs";
|
|
235
282
|
"required": false;
|