@cngx/ui 0.1.0-rc.6 → 0.1.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/a11y/README.md +81 -0
- package/context-menu/README.md +98 -0
- package/data-grid-accordion/README.md +27 -0
- package/feedback/README.md +2 -0
- package/fesm2022/cngx-ui-a11y.mjs +320 -0
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
- package/fesm2022/cngx-ui-accordion.mjs +17 -6
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +5 -2
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +11 -6
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +429 -0
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
- package/fesm2022/cngx-ui-collection.mjs +15 -6
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +1005 -0
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
- package/fesm2022/cngx-ui-context-menu.mjs +742 -0
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +88 -18
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +97 -106
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +18 -9
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +9 -9
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +64 -70
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +18 -8
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +2 -2
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +20 -7
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +2 -2
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +618 -0
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
- package/fesm2022/cngx-ui-stepper.mjs +30 -12
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +36 -19
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +495 -0
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
- package/fesm2022/cngx-ui-toc.mjs +704 -0
- package/fesm2022/cngx-ui-toc.mjs.map +1 -0
- package/fesm2022/cngx-ui.mjs +2 -2
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-accordion/README.md +1 -1
- package/mat-tabs/styles/mat-tabs.css +20 -17
- package/package.json +32 -1
- package/skeleton/README.md +2 -0
- package/stepper/README.md +2 -2
- package/timeline/README.md +350 -0
- package/toc/README.md +183 -0
- package/types/cngx-ui-a11y.d.ts +303 -0
- package/types/cngx-ui-accordion.d.ts +9 -4
- package/types/cngx-ui-action-button.d.ts +3 -0
- package/types/cngx-ui-breadcrumb.d.ts +5 -0
- package/types/cngx-ui-chart-panel.d.ts +278 -0
- package/types/cngx-ui-collection.d.ts +12 -3
- package/types/cngx-ui-command-palette.d.ts +451 -0
- package/types/cngx-ui-context-menu.d.ts +467 -0
- package/types/cngx-ui-data-grid-accordion.d.ts +72 -15
- package/types/cngx-ui-feedback.d.ts +71 -18
- package/types/cngx-ui-layout.d.ts +8 -3
- package/types/cngx-ui-mat-accordion.d.ts +3 -3
- package/types/cngx-ui-mat-tabs.d.ts +11 -9
- package/types/cngx-ui-paginator.d.ts +13 -3
- package/types/cngx-ui-skeleton.d.ts +13 -1
- package/types/cngx-ui-stat-card.d.ts +327 -0
- package/types/cngx-ui-stepper.d.ts +15 -2
- package/types/cngx-ui-tabs.d.ts +20 -4
- package/types/cngx-ui-timeline.d.ts +479 -0
- package/types/cngx-ui-toc.d.ts +514 -0
- package/types/cngx-ui.d.ts +1 -1
package/README.md
CHANGED
|
@@ -78,6 +78,87 @@ need `@if`/`@for` boilerplate.
|
|
|
78
78
|
|
|
79
79
|
**Selector:** `cngx-skeleton` -- exportAs `"cngxSkeletonContainer"`
|
|
80
80
|
|
|
81
|
+
### CngxStatCard
|
|
82
|
+
|
|
83
|
+
Card-framed KPI tile. One `<cngx-stat-card [state]="s">` renders the whole
|
|
84
|
+
dashboard metric: card surface, the four coordinated stat slots, an inline
|
|
85
|
+
visualisation and a footer, with the async view switch derived from `[state]`.
|
|
86
|
+
|
|
87
|
+
The stat slots are the existing `cngxStat*` atoms from `@cngx/common/data`, not
|
|
88
|
+
copies. They resolve `CNGX_STAT` at their declaration site, so the card hosts
|
|
89
|
+
the shared `CngxStatCoordinator` brain and re-points the token at it - the same
|
|
90
|
+
shape `CngxIncrementalList` uses for `CNGX_PAGINATOR_HOST`. The tile therefore
|
|
91
|
+
carries one accessible name in reading order instead of four fragments.
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<cngx-stat-card [state]="revenue" live="polite">
|
|
95
|
+
<span cngxStatLabel>Revenue</span>
|
|
96
|
+
<cngx-metric cngxStatValue [value]="1.2" unit="M EUR" />
|
|
97
|
+
<cngx-delta cngxStatDelta [value]="5.3" />
|
|
98
|
+
<span cngxStatCaption>vs. last quarter</span>
|
|
99
|
+
<cngx-sparkline cngxStatCardViz [data]="trend()" />
|
|
100
|
+
</cngx-stat-card>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Inputs:** `state` (`CngxAsyncState<unknown>`), `loadingTreatment`
|
|
104
|
+
(`'auto' | 'spinner' | 'skeleton'`), `live` (`'off' | 'polite' | 'assertive'`),
|
|
105
|
+
`busyLabel`, `errorText`, `staleText`
|
|
106
|
+
|
|
107
|
+
**Slots:** `cngxStatLabel` / `cngxStatValue` / `cngxStatDelta` /
|
|
108
|
+
`cngxStatCaption` (re-exported), plus `cngxStatCardViz` and `cngxStatCardFooter`
|
|
109
|
+
|
|
110
|
+
With `loadingTreatment="auto"` the tile picks spinner vs skeleton from the
|
|
111
|
+
latency it observed. The threshold is never hardcoded - it comes from
|
|
112
|
+
`CNGX_LOADING_CONFIG`, so one `provideLoadingConfig(...)` retunes every tile.
|
|
113
|
+
|
|
114
|
+
**Config:** `provideStatCardConfig` / `provideStatCardConfigAt` /
|
|
115
|
+
`injectStatCardConfig`, features `withStatCardAriaLabels` and
|
|
116
|
+
`withStatCardLoadingTreatment`
|
|
117
|
+
|
|
118
|
+
**Selector:** `cngx-stat-card` -- entry `@cngx/ui/stat-card`
|
|
119
|
+
|
|
120
|
+
### CngxChartPanel
|
|
121
|
+
|
|
122
|
+
Dashboard housing for a chart: title, subtitle, header actions, legend
|
|
123
|
+
placement and footer. `role="group"` plus an `aria-labelledby` pointing at the
|
|
124
|
+
projected title makes the region announce as one named unit rather than
|
|
125
|
+
dropping the user into an unlabelled SVG.
|
|
126
|
+
|
|
127
|
+
The panel frames a projected `cngx-chart` and never duplicates its machine. The
|
|
128
|
+
chart keeps owning its data async envelope, its view switch and its SR data
|
|
129
|
+
table; panel-level `[state]` drives header chrome only. `aria-busy` sits on the
|
|
130
|
+
header, not on the group - on the region it would hold back the chart's own live
|
|
131
|
+
announcements and claim a stable chart is updating.
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<cngx-chart-panel [state]="rangeSwitch" legendPosition="bottom">
|
|
135
|
+
<h3 cngxChartPanelTitle>Revenue by quarter</h3>
|
|
136
|
+
<span cngxChartPanelSubtitle>EUR, net</span>
|
|
137
|
+
<button cngxChartPanelActions type="button">Change range</button>
|
|
138
|
+
|
|
139
|
+
<cngx-chart [data]="series" [state]="chartState">
|
|
140
|
+
<svg:g cngxLine [data]="series"></svg:g>
|
|
141
|
+
</cngx-chart>
|
|
142
|
+
|
|
143
|
+
<cngx-chart-legend [items]="legend" />
|
|
144
|
+
</cngx-chart-panel>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Inputs:** `state` (`CngxAsyncState<unknown>`), `legendPosition`
|
|
148
|
+
(`'top' | 'bottom' | 'none'`)
|
|
149
|
+
|
|
150
|
+
**Slots:** `cngxChartPanelTitle`, `cngxChartPanelSubtitle`,
|
|
151
|
+
`cngxChartPanelActions`, `cngxChartPanelFooter`
|
|
152
|
+
|
|
153
|
+
The legend slot matches the bare `cngx-chart-legend` tag; a legend wrapped in an
|
|
154
|
+
element of your own lands in the body instead.
|
|
155
|
+
|
|
156
|
+
**Config:** `provideChartPanelConfig` / `provideChartPanelConfigAt` /
|
|
157
|
+
`injectChartPanelConfig`, features `withChartPanelAriaLabels` and
|
|
158
|
+
`withChartPanelLegendPosition`
|
|
159
|
+
|
|
160
|
+
**Selector:** `cngx-chart-panel` -- entry `@cngx/ui/chart-panel`
|
|
161
|
+
|
|
81
162
|
### CngxActionButton
|
|
82
163
|
|
|
83
164
|
Action button molecule with built-in async status communication. Composes
|
|
@@ -235,6 +316,37 @@ via the CSS `grid-template-rows: 0fr/1fr` trick (no `@angular/animations` needed
|
|
|
235
316
|
|
|
236
317
|
**Material theme:** `@use '@cngx/themes/material/sidenav-theme'` - includes nav-link theme automatically
|
|
237
318
|
|
|
319
|
+
### CngxToc (`@cngx/ui/toc`)
|
|
320
|
+
|
|
321
|
+
"On this page" navigation rail. Renders a `<nav>` of anchor links from a
|
|
322
|
+
`CngxTocItem[]` outline, tracks the most-visible section through an internal
|
|
323
|
+
`CngxScrollSpy`, and reflects it on `aria-current` inside the `computed()`
|
|
324
|
+
graph. Activating a link scrolls the section into view (honouring
|
|
325
|
+
`prefers-reduced-motion`) and moves focus to it.
|
|
326
|
+
|
|
327
|
+
```html
|
|
328
|
+
<cngx-toc [items]="toc" contentRoot="#article"></cngx-toc>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
**Inputs:** `items` (required, `CngxTocItem[]`), `contentRoot` (scroll-container
|
|
332
|
+
selector, default viewport), `rootMargin`, `threshold` (forwarded to the spy).
|
|
333
|
+
**Output:** `activated` (the item whose link was clicked).
|
|
334
|
+
**Slot:** `*cngxTocItem` (context `$implicit` / `active` / `depth`).
|
|
335
|
+
**Router sync:** add `[cngxTocRouterSync]` on the same host to deep-link the
|
|
336
|
+
active section into the URL fragment (opt-in, `CNGX_TOC` contract token).
|
|
337
|
+
|
|
338
|
+
A toc is a **navigation landmark of links, not a tree**. Nesting is communicated
|
|
339
|
+
structurally (nested `<ul>`, indentation) so native tab order and link semantics
|
|
340
|
+
stay intact - the APG treeview pattern is deliberately not applied. Reach for
|
|
341
|
+
`CngxSidenav` instead when you need a collapsible primary-navigation rail with a
|
|
342
|
+
selection model; `CngxToc` is a passive reflection of scroll position.
|
|
343
|
+
|
|
344
|
+
**Focus contract:** to move focus to a scrolled-to section, `CngxToc` sets
|
|
345
|
+
`tabindex="-1"` on the target element only when it is not focusable by default
|
|
346
|
+
and carries no author-set `tabindex`; an author value is never overwritten.
|
|
347
|
+
|
|
348
|
+
**Material theme:** `@use '@cngx/themes/material/toc-theme'`
|
|
349
|
+
|
|
238
350
|
### CngxToaster - Toast API (`@cngx/ui/feedback`)
|
|
239
351
|
|
|
240
352
|
Programmatic toast service. Not `providedIn: 'root'` - provide via
|
package/a11y/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @cngx/ui/a11y
|
|
2
|
+
|
|
3
|
+
Batteries-included accessibility preferences UI. Ships `CngxA11yPanel`: a plain
|
|
4
|
+
in-flow card that renders one labelled control group per accessibility axis
|
|
5
|
+
(spacing/density, text size, motion, contrast) bound to the app-wide preference
|
|
6
|
+
signals, plus a Reset.
|
|
7
|
+
|
|
8
|
+
The panel ships no trigger, no overlay, and no placement of its own. Drop
|
|
9
|
+
`<cngx-a11y-panel>` wherever it belongs - inline on a settings page, inside a
|
|
10
|
+
`CngxDrawer`, inside a `CngxDialog`, or behind your own popover trigger. It is
|
|
11
|
+
the same split as `CngxListbox` under `CngxSelect`: the panel owns the axis
|
|
12
|
+
controls, the consumer owns where it appears.
|
|
13
|
+
|
|
14
|
+
## Prerequisite
|
|
15
|
+
|
|
16
|
+
Install the axis reflectors + preference signals at app root via the
|
|
17
|
+
`@cngx/core` aggregator. The panel reads and writes those signals; it installs
|
|
18
|
+
nothing itself.
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { provideA11yPreferences, withPersistence } from '@cngx/core';
|
|
22
|
+
|
|
23
|
+
bootstrapApplication(AppComponent, {
|
|
24
|
+
providers: [provideA11yPreferences(withPersistence())],
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { CngxA11yPanel } from '@cngx/ui/a11y';
|
|
32
|
+
|
|
33
|
+
@Component({
|
|
34
|
+
imports: [CngxA11yPanel],
|
|
35
|
+
template: `<cngx-a11y-panel />`,
|
|
36
|
+
})
|
|
37
|
+
export class SettingsPage {}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Toggling a group writes the matching axis signal, which reflects onto the root
|
|
41
|
+
`<html data-*>` attribute live. Reset restores every axis to its library
|
|
42
|
+
default and announces the change through the shared live region.
|
|
43
|
+
|
|
44
|
+
## Configuration
|
|
45
|
+
|
|
46
|
+
Labels and the rendered axis list come from `CNGX_A11Y_PANEL_CONFIG`. Defaults
|
|
47
|
+
are English; override via the cascade.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import {
|
|
51
|
+
provideA11yPanelConfig,
|
|
52
|
+
withA11yPanelLabels,
|
|
53
|
+
withA11yPanelAxes,
|
|
54
|
+
} from '@cngx/ui/a11y';
|
|
55
|
+
|
|
56
|
+
provideA11yPanelConfig(
|
|
57
|
+
withA11yPanelLabels({ heading: 'Barrierefreiheit', axes: { motion: 'Bewegung' } }),
|
|
58
|
+
withA11yPanelAxes([
|
|
59
|
+
{ axis: 'textScale', reset: 'md', options: [
|
|
60
|
+
{ value: 'md', label: 'Default' },
|
|
61
|
+
{ value: 'lg', label: 'Large' },
|
|
62
|
+
] },
|
|
63
|
+
]),
|
|
64
|
+
);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Header slot
|
|
68
|
+
|
|
69
|
+
Project `[cngxA11yPanelHeader]` to replace the default heading:
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<cngx-a11y-panel>
|
|
73
|
+
<h2 cngxA11yPanelHeader>Display & motion</h2>
|
|
74
|
+
</cngx-a11y-panel>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Public API
|
|
78
|
+
|
|
79
|
+
- `CngxA11yPanel` - the placeable card.
|
|
80
|
+
- `CNGX_A11Y_PANEL_CONFIG` / `provideA11yPanelConfig` / `withA11yPanelLabels` /
|
|
81
|
+
`withA11yPanelAxes` / `injectA11yPanelConfig` - the config cascade.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @cngx/ui/context-menu
|
|
2
|
+
|
|
3
|
+
Declarative context-menu organism over the headless menu brains
|
|
4
|
+
(`@cngx/common/interactive`). One `<cngx-context-menu>` docks onto many targets
|
|
5
|
+
via `[cngxContextMenuFor]`, opens at pointer coordinates on right-click or
|
|
6
|
+
`Shift+F10`, and hands each open a per-row datum. The panel stacks `CngxPopover`
|
|
7
|
+
and `CngxMenu` as host directives, so `role="menu"`, active-descendant
|
|
8
|
+
navigation, and the four dismiss sources come from the composition, not the
|
|
9
|
+
shell.
|
|
10
|
+
|
|
11
|
+
Placement follows the tabs precedent: components that host a popover surface
|
|
12
|
+
live in `@cngx/ui`, above the popover-free `common/interactive` layer.
|
|
13
|
+
|
|
14
|
+
## Anatomy
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<div [cngxContextMenuFor]="menu" [cngxContextMenuData]="row" tabindex="0">…</div>
|
|
18
|
+
|
|
19
|
+
<cngx-context-menu #menu="cngxContextMenu" ariaLabel="Row actions">
|
|
20
|
+
<cngx-context-menu-item value="open" kbd="⌘O" (select)="open()">Open</cngx-context-menu-item>
|
|
21
|
+
<cngx-context-menu-item value="rename" (select)="rename()">Rename</cngx-context-menu-item>
|
|
22
|
+
<cngx-context-menu-divider />
|
|
23
|
+
<cngx-context-menu-item value="delete" [disabled]="locked()" (select)="remove()">Delete</cngx-context-menu-item>
|
|
24
|
+
</cngx-context-menu>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Minimal case: two template elements, one binding. `ariaLabel` forwards to the
|
|
28
|
+
menu's required label, so the accessible name stays mandatory.
|
|
29
|
+
|
|
30
|
+
## Data channel
|
|
31
|
+
|
|
32
|
+
Two ways to obtain the datum `T`:
|
|
33
|
+
|
|
34
|
+
- `[cngxContextMenuData]` - a fixed datum for a single target.
|
|
35
|
+
- `[cngxContextMenuResolve]` - a resolver run against the `contextmenu` event,
|
|
36
|
+
so a table, grid, treetable, or virtualized list keeps one trigger instance
|
|
37
|
+
and derives the row from `event.target`. The resolver wins when both are
|
|
38
|
+
bound; a `null` result leaves the native menu untouched (no `preventDefault`,
|
|
39
|
+
no open).
|
|
40
|
+
|
|
41
|
+
The panel's `context()` is derived from popover visibility, never synced: the
|
|
42
|
+
lazy `*cngxContextMenuContent` template rebuilds with the right row on each open
|
|
43
|
+
and nulls out on close.
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<table [cngxContextMenuFor]="menu" [cngxContextMenuResolve]="resolveRow">…</table>
|
|
47
|
+
|
|
48
|
+
<cngx-context-menu #menu="cngxContextMenu" ariaLabel="Row actions">
|
|
49
|
+
<ng-template cngxContextMenuContent let-row>
|
|
50
|
+
<cngx-context-menu-item (select)="edit(row)">Edit {{ row.name }}</cngx-context-menu-item>
|
|
51
|
+
</ng-template>
|
|
52
|
+
</cngx-context-menu>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Items
|
|
56
|
+
|
|
57
|
+
`CngxContextMenuItem` (dual selector: `cngx-context-menu-item` or
|
|
58
|
+
`button[cngxContextMenuItem]`) is a thin shell over `CngxMenuItem` - the brain
|
|
59
|
+
owns `role="menuitem"`, activation, and disabled semantics. `icon` and `kbd`
|
|
60
|
+
render through the menu-item slots; `select` fires on click or Enter/Space.
|
|
61
|
+
|
|
62
|
+
Checkable rows: `cngx-context-menu-item-checkbox` two-way binds `[(checked)]`;
|
|
63
|
+
`cngx-context-menu-item-radio` scopes mutual exclusion to an enclosing
|
|
64
|
+
`[cngxMenuGroup]`. `role="menuitemcheckbox"` / `menuitemradio` and the reactive
|
|
65
|
+
`aria-checked` come from the brains.
|
|
66
|
+
|
|
67
|
+
## Submenu
|
|
68
|
+
|
|
69
|
+
Bind `[submenu]` on an item to a sibling `<cngx-context-menu>` - sibling
|
|
70
|
+
declaration, not inline nesting (inline-projected items would register with the
|
|
71
|
+
parent's active-descendant). The `CngxMenuItemSubmenu` brain is wired internally
|
|
72
|
+
through `CNGX_MENU_SUBMENU_WIRING`, so there is no `[exclusive]` handgrip and no
|
|
73
|
+
popover plumbing. The nested panel opens non-exclusively (the parent survives),
|
|
74
|
+
inherits the parent's row context, and shares the ArrowRight / ArrowLeft /
|
|
75
|
+
Escape keyboard contract with `CngxMenuTrigger`.
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<cngx-context-menu-item [submenu]="exportMenu">Export as</cngx-context-menu-item>
|
|
79
|
+
<cngx-context-menu #exportMenu="cngxContextMenu" ariaLabel="Export format">
|
|
80
|
+
<cngx-context-menu-item (select)="export('pdf')">PDF</cngx-context-menu-item>
|
|
81
|
+
</cngx-context-menu>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Config
|
|
85
|
+
|
|
86
|
+
No new config surface. All labels flow through `provideCngxMenu(...)` /
|
|
87
|
+
`injectMenuConfig()` from `@cngx/common/interactive`. Library defaults are
|
|
88
|
+
English.
|
|
89
|
+
|
|
90
|
+
## Theming
|
|
91
|
+
|
|
92
|
+
Default visuals ship with the components (Track A) - no theme import needed. The
|
|
93
|
+
popup surface, item geometry, divider, and checked glyph paint from the
|
|
94
|
+
`--cngx-context-menu-*` token family; spacing derives from `--cngx-space-*`, so a
|
|
95
|
+
root `[data-density]` compacts the menu and colours track the foundation across
|
|
96
|
+
light and dark. The item slot and highlight painting is adopted from the base
|
|
97
|
+
menu skin. Opt into Material with
|
|
98
|
+
`@use '@cngx/themes/material/context-menu-theme'`.
|
|
@@ -57,6 +57,17 @@ Above `--cngx-dga-min-width` the grid fills 100%; below it the host scrolls side
|
|
|
57
57
|
(`overflow-x: auto`) with every column intact. No column is ever dropped - horizontal
|
|
58
58
|
scroll over silent information loss.
|
|
59
59
|
|
|
60
|
+
## Bounded height
|
|
61
|
+
|
|
62
|
+
Bind `[maxBlockSize]` to cap the grid (a number is `px`, a string is any CSS length):
|
|
63
|
+
it becomes its own vertical scrollport, the column head pins to the top and the footer
|
|
64
|
+
to the bottom, and only the rows scroll between them - the totals in the footer stay
|
|
65
|
+
visible. The input reflects onto `--cngx-dga-max-block-size`, the same token a skin may
|
|
66
|
+
set directly. This is the only way to pin the head - `[cngxStickyHeader]` from
|
|
67
|
+
`@cngx/common/layout` is the wrong tool here, because the group is its own scrollport
|
|
68
|
+
and a content-height grid has nothing to stick to. Leave `[maxBlockSize]` unbound and
|
|
69
|
+
the grid stays content-height and unchanged.
|
|
70
|
+
|
|
60
71
|
## Skins
|
|
61
72
|
|
|
62
73
|
Six built-in skins select via the `[skin]` input, reflected onto a `[data-skin]` host
|
|
@@ -135,3 +146,19 @@ Sort and filter are per-instance, so there is no `withDataGridSort` / `withDataG
|
|
|
135
146
|
config feature - each grid sorts and filters its own data. No in-component sort/filter
|
|
136
147
|
engine: the `@cngx/common/data` atoms own comparison and predicate matching; the group only
|
|
137
148
|
coordinates and publishes state.
|
|
149
|
+
|
|
150
|
+
### Pairing with `injectSmartDataSource`
|
|
151
|
+
|
|
152
|
+
`injectSmartDataSource` resolves its atoms by injection, and injection walks up the tree -
|
|
153
|
+
the group's `sort` / `filter` live on the grid element below the consumer's injector, so
|
|
154
|
+
the source never sees them and silently skips those steps. Either derive the rows yourself
|
|
155
|
+
from the context (the prescribed shape above), or hand the hosted atoms over through the
|
|
156
|
+
source's options thunks:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
readonly grid = viewChild(CngxDataGridAccordion);
|
|
160
|
+
readonly source = injectSmartDataSource(this.rows, {
|
|
161
|
+
sort: () => this.grid()?.sort,
|
|
162
|
+
filter: () => this.grid()?.filter,
|
|
163
|
+
});
|
|
164
|
+
```
|
package/feedback/README.md
CHANGED
|
@@ -27,6 +27,8 @@ Two patterns make the whole feedback layer feel cohesive:
|
|
|
27
27
|
|
|
28
28
|
Toast, banner, and alerter services are **not** `providedIn: 'root'`. Provide them via `provideFeedback(...)` in your application bootstrap, and render the outlets once at the application root. This is intentional - feedback presentation is application-level, not library-level, and forcing the consumer to opt in keeps a tree-shake-friendly footprint when only a subset of surfaces is in use.
|
|
29
29
|
|
|
30
|
+
Loading timing (the flash-suppression `showDelay` / `minDwell` shared by every loading surface) lives in the `CNGX_LOADING_CONFIG` cascade in `@cngx/core/utils`. `provideFeedback(withLoadingDefaults({ delay, minDuration }))` still writes that token as a back-compat wrapper (`delay` maps to `showDelay`, `minDuration` to `minDwell`), but it replaces the whole config and resets `spinnerVsSkeletonCutoff`. For new apps prefer `provideLoadingConfig(withShowDelay(...), withMinDwell(...), withSpinnerVsSkeletonCutoff(...))` from `@cngx/core/utils` as the canonical loading-timing knob.
|
|
31
|
+
|
|
30
32
|
## See also
|
|
31
33
|
|
|
32
34
|
- Outlet components, services, bridge directives, slot directives, and `with*` config features in the **API** tab.
|