@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9
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 +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +227 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +120 -36
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +121 -56
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +204 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +209 -40
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1074 -460
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +553 -198
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +344 -109
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +234 -99
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +88 -25
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +98 -23
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +101 -33
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/README.md +30 -6
- package/mat-tabs/styles/mat-tabs.css +188 -42
- package/overlay/README.md +9 -4
- package/package.json +31 -7
- package/paginator/README.md +8 -4
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +14 -2
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +100 -28
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +167 -60
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +157 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +140 -10
- package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +605 -59
- package/types/cngx-ui-mat-accordion.d.ts +30 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +250 -34
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +425 -136
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +88 -49
- package/types/cngx-ui-tabs.d.ts +6 -4
- package/types/cngx-ui-timeline.d.ts +35 -11
- package/types/cngx-ui-toc.d.ts +93 -16
- package/types/cngx-ui.d.ts +7 -4
package/README.md
CHANGED
|
@@ -635,7 +635,6 @@ Shows banner on `error` transition, auto-dismisses on `success`/`idle`.
|
|
|
635
635
|
| `--cngx-banner-gap` | `12px` | Gap between elements |
|
|
636
636
|
| `--cngx-banner-padding` | `10px 16px` | Banner padding |
|
|
637
637
|
| `--cngx-banner-font-size` | `0.9375rem` | Message font size |
|
|
638
|
-
| `--cngx-banner-action-min-size` | `44px` | Min touch target for action button |
|
|
639
638
|
| `--cngx-banner-pending-opacity` | `0.85` | Opacity during async action |
|
|
640
639
|
| `--cngx-banner-{severity}-bg` | per severity | Background |
|
|
641
640
|
| `--cngx-banner-{severity}-border` | per severity | Border |
|
package/a11y/README.md
CHANGED
|
@@ -43,8 +43,11 @@ default and announces the change through the shared live region.
|
|
|
43
43
|
|
|
44
44
|
## Configuration
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
The rendered axis list comes from `CNGX_A11Y_PANEL_CONFIG`; the text and the
|
|
47
|
+
option labels come from the `a11yPanel` section of the language pack (English
|
|
48
|
+
without one, `CNGX_A11Y_PANEL_LANGUAGE_EN`). An option without a `label` reads
|
|
49
|
+
it from the section by value, so a custom axis list translates with the pack.
|
|
50
|
+
The `with*` features override single keys.
|
|
48
51
|
|
|
49
52
|
```ts
|
|
50
53
|
import {
|
|
@@ -57,8 +60,8 @@ provideA11yPanelConfig(
|
|
|
57
60
|
withA11yPanelLabels({ heading: 'Barrierefreiheit', axes: { motion: 'Bewegung' } }),
|
|
58
61
|
withA11yPanelAxes([
|
|
59
62
|
{ axis: 'textScale', reset: 'md', options: [
|
|
60
|
-
{ value: 'md'
|
|
61
|
-
{ value: 'lg', label: '
|
|
63
|
+
{ value: 'md' },
|
|
64
|
+
{ value: 'lg', label: 'Bigger' },
|
|
62
65
|
] },
|
|
63
66
|
]),
|
|
64
67
|
);
|
|
@@ -78,4 +81,7 @@ Project `[cngxA11yPanelHeader]` to replace the default heading:
|
|
|
78
81
|
|
|
79
82
|
- `CngxA11yPanel` - the placeable card.
|
|
80
83
|
- `CNGX_A11Y_PANEL_CONFIG` / `provideA11yPanelConfig` / `withA11yPanelLabels` /
|
|
81
|
-
`withA11yPanelAxes` / `injectA11yPanelConfig` - the config cascade.
|
|
84
|
+
`withA11yPanelAxes` / `injectA11yPanelConfig` - the config cascade. Both
|
|
85
|
+
features also take a `Signal`, so the panel follows a runtime language switch.
|
|
86
|
+
- `injectA11yPanelLabels` / `injectA11yPanelAxes` - the resolved labels and axis
|
|
87
|
+
list as Signals.
|
package/accordion/README.md
CHANGED
|
@@ -40,8 +40,10 @@ collapsed item un-hides its region so the alert is announced.
|
|
|
40
40
|
`provideAccordionConfig(...)` / `provideAccordionConfigAt(...)` with
|
|
41
41
|
`withAccordionLabels({ disabledReason, errorMessage })`,
|
|
42
42
|
`withDefaultHeadingLevel(n)`, `withAccordionSkin(name)`, and
|
|
43
|
-
`withAccordionTemplates({ icon, busySpinner, error })`.
|
|
44
|
-
English
|
|
43
|
+
`withAccordionTemplates({ icon, busySpinner, error })`. The label defaults
|
|
44
|
+
come from the `accordion` section of the language pack (English without one,
|
|
45
|
+
`CNGX_ACCORDION_LANGUAGE_EN`). Both label keys accept a `Signal<string>`, so
|
|
46
|
+
the accordion follows a runtime language switch.
|
|
45
47
|
|
|
46
48
|
## Skins
|
|
47
49
|
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# CngxBreadcrumbBar
|
|
2
|
+
|
|
3
|
+
Breadcrumb bar organism. `<cngx-breadcrumb [items]="...">` renders a trail
|
|
4
|
+
through the headless `@cngx/common/interactive` trio (`CngxBreadcrumb` /
|
|
5
|
+
`CngxBreadcrumbItem` / `CngxBreadcrumbSeparator`): the bar forwards inputs and
|
|
6
|
+
owns the skin, the trio owns collapse, terminal marking and the landmark a11y.
|
|
7
|
+
Collapsed crumbs surface in a `CngxBreadcrumbOverflow` dropdown; lateral
|
|
8
|
+
navigation per crumb is a `CngxBreadcrumbSiblings` dropdown. Router integration
|
|
9
|
+
is opt-in via two sync directives - the base components never import
|
|
10
|
+
`@angular/router`.
|
|
11
|
+
|
|
12
|
+
## Import
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { CngxBreadcrumbBar, CngxBreadcrumbRouterSync, type CngxBreadcrumbCrumb } from '@cngx/ui/breadcrumb';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { CngxBreadcrumbBar, type CngxBreadcrumbCrumb } from '@cngx/ui/breadcrumb';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-example',
|
|
26
|
+
template: `<cngx-breadcrumb [items]="crumbs" />`,
|
|
27
|
+
imports: [CngxBreadcrumbBar],
|
|
28
|
+
})
|
|
29
|
+
export class ExampleComponent {
|
|
30
|
+
protected readonly crumbs: CngxBreadcrumbCrumb[] = [
|
|
31
|
+
{ label: 'Home', href: '/' },
|
|
32
|
+
{ label: 'Catalog', href: '/catalog' },
|
|
33
|
+
{ label: 'Books' },
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The last crumb is the current page: it renders without `href` and carries
|
|
39
|
+
`aria-current="page"`, derived from position. Keep `href` unique across the
|
|
40
|
+
trail - the bar tracks crumbs by `href ?? label`; a duplicate collides on the
|
|
41
|
+
track key (NG0955).
|
|
42
|
+
|
|
43
|
+
## Collapse and overflow
|
|
44
|
+
|
|
45
|
+
Set `[maxVisible]` and the trail collapses its middle, keeping the first crumb
|
|
46
|
+
and the last `maxVisible - 1`. When anything is collapsed the bar auto-renders
|
|
47
|
+
a `<cngx-breadcrumb-overflow>` after the first crumb: an ellipsis trigger plus
|
|
48
|
+
a `CngxPopoverPanel` hosting a `CngxMenu` of the collapsed crumbs. It reads the
|
|
49
|
+
collapse set through the `CNGX_BREADCRUMB` DI contract and self-hides when
|
|
50
|
+
nothing is collapsed.
|
|
51
|
+
|
|
52
|
+
The default overflow row lists the label and does not navigate. Project
|
|
53
|
+
`*cngxBreadcrumbOverflowItem` on the bar to render a navigable row; the
|
|
54
|
+
`<li cngxMenuItem>` shell stays library-owned:
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<cngx-breadcrumb [items]="crumbs" [maxVisible]="3">
|
|
58
|
+
<ng-template cngxBreadcrumbOverflowItem let-crumb>
|
|
59
|
+
<a [href]="hrefFor(crumb)">{{ crumb.resolvedLabel() }}</a>
|
|
60
|
+
</ng-template>
|
|
61
|
+
</cngx-breadcrumb>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Width-driven collapse
|
|
65
|
+
|
|
66
|
+
On by default, nothing to bind: the bar derives `maxVisible` from **its own
|
|
67
|
+
container width**, not the viewport, so it behaves identically in a drawer on a
|
|
68
|
+
desktop and on a phone.
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<cngx-breadcrumb [items]="crumbs" />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The cap lives in CSS, once. `breadcrumb-bar.component.css` declares the bar as
|
|
75
|
+
the query container `cngx-breadcrumb` and writes
|
|
76
|
+
`--cngx-breadcrumb-max-visible` on `.cngx-breadcrumb::after`: `2` below `30rem`,
|
|
77
|
+
`4` below `48rem`, `6` above. The component reads the resolved value and never
|
|
78
|
+
evaluates a width itself.
|
|
79
|
+
|
|
80
|
+
Re-aim the rungs with your own rule on the same pseudo-element:
|
|
81
|
+
|
|
82
|
+
```css
|
|
83
|
+
.my-nav .cngx-breadcrumb::after {
|
|
84
|
+
--cngx-breadcrumb-max-visible: 8;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Two details decide whether that rule works:
|
|
89
|
+
|
|
90
|
+
- **It has to target `::after`.** The property is registered `inherits: false`,
|
|
91
|
+
so setting it on the bar itself or on an ancestor never reaches the
|
|
92
|
+
pseudo-element the component reads. That is deliberate - the property is a
|
|
93
|
+
channel between the `@container` rule and the component, not a theme token
|
|
94
|
+
the crumbs should inherit.
|
|
95
|
+
- **No `!important` needed.** An unlayered author rule beats the library rule in
|
|
96
|
+
`@layer cngx.components`, whatever the specificity.
|
|
97
|
+
|
|
98
|
+
The property is registered `<integer>`: a non-integer value falls back to the
|
|
99
|
+
registered initial and is never read as a cap.
|
|
100
|
+
|
|
101
|
+
To pin the count instead - the opt-out - bind `[maxVisible]`; an explicit value
|
|
102
|
+
always wins over the derived one:
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<!-- always six crumbs, whatever the width -->
|
|
106
|
+
<cngx-breadcrumb [items]="crumbs" [maxVisible]="6" />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Until the container's first observation the cap stays `undefined`, so the bar
|
|
110
|
+
renders the full trail rather than mis-collapsing on a zero-width first read.
|
|
111
|
+
|
|
112
|
+
## Router-driven trail
|
|
113
|
+
|
|
114
|
+
Add `cngxRouterSync` and the trail derives from the activated route tree -
|
|
115
|
+
every route whose `data['breadcrumb']` is a non-empty string contributes a
|
|
116
|
+
crumb:
|
|
117
|
+
|
|
118
|
+
```html
|
|
119
|
+
<cngx-breadcrumb cngxRouterSync />
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
{ path: 'catalog', data: { breadcrumb: 'Catalog' }, children: [
|
|
124
|
+
{ path: 'books', data: { breadcrumb: 'Books', icon: 'book' } },
|
|
125
|
+
] }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The directive provides `CNGX_BREADCRUMB_ITEMS_SOURCE` (via `useExisting`), and
|
|
129
|
+
the bar's `computed` lets the source win over `[items]` - it never writes the
|
|
130
|
+
bar's input. `[dataKey]` and `[iconKey]` override the route-data keys per
|
|
131
|
+
instance (`data[iconKey]` rides onto `crumb.icon`). A componentless route
|
|
132
|
+
reusing the parent URL collapses into one crumb, deepest label wins. Without
|
|
133
|
+
`@angular/router` the directive dev-warns once and stays an empty source.
|
|
134
|
+
|
|
135
|
+
To translate a crumb, pass a `Signal` of its label from your app's i18n:
|
|
136
|
+
`data: { breadcrumb: computed(() => t('nav.orders')) }`. The trail reads it
|
|
137
|
+
inside its `computed()`, so a language switch relabels the crumb. The sibling
|
|
138
|
+
sync reads route data the same way. Route labels are app copy; the cngx
|
|
139
|
+
language pack only carries the breadcrumb's own accessible names.
|
|
140
|
+
|
|
141
|
+
## Sibling dropdowns
|
|
142
|
+
|
|
143
|
+
`CngxBreadcrumbSiblings` lists the alternatives at one trail level - a chevron
|
|
144
|
+
trigger revealing a `role="list"` of native `<a href>` anchors, self-hiding
|
|
145
|
+
when there are no rows. The active level renders `aria-current="page"` and no
|
|
146
|
+
link. Three ways to feed it:
|
|
147
|
+
|
|
148
|
+
- **Declarative**: a non-empty `crumb.siblings` array makes the bar auto-render
|
|
149
|
+
the dropdown for that crumb. No wiring.
|
|
150
|
+
- **Accessory slot**: project `*cngxBreadcrumbItemAccessory` on the bar; it
|
|
151
|
+
renders after every crumb's link and wins over the declarative auto-render
|
|
152
|
+
for all crumbs.
|
|
153
|
+
- **Router-driven**: `<cngx-breadcrumb-siblings cngxRouterSync [depth]="1" />`
|
|
154
|
+
enumerates the sibling routes at `depth` from the static route config,
|
|
155
|
+
marking the active child `current`. Parameterized siblings (`:id`) emit their
|
|
156
|
+
path pattern verbatim - supply `[siblings]` directly when links need resolved
|
|
157
|
+
params.
|
|
158
|
+
|
|
159
|
+
Project `*cngxBreadcrumbSiblingItem` to replace the default sibling row.
|
|
160
|
+
|
|
161
|
+
## Icons
|
|
162
|
+
|
|
163
|
+
`*cngxBreadcrumbIcon` renders inside every crumb link, before the label. The
|
|
164
|
+
crumb's `icon` is an opaque token - cngx ships no icon set and resolves no
|
|
165
|
+
names; the slot renders it with any icon system:
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<cngx-breadcrumb [items]="crumbs" skin="iconlabel">
|
|
169
|
+
<ng-template cngxBreadcrumbIcon let-crumb>
|
|
170
|
+
<mat-icon aria-hidden="true">{{ crumb.icon }}</mat-icon>
|
|
171
|
+
</ng-template>
|
|
172
|
+
</cngx-breadcrumb>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Skins
|
|
176
|
+
|
|
177
|
+
`skin` reflects onto `[data-skin]`; each look is an independent `@scope` paint
|
|
178
|
+
block over identical DOM, ARIA and collapse behaviour. Pure paint skins:
|
|
179
|
+
`classic` (default), `plain`, `contained`, `pill`, `ribbon`, `editorial`,
|
|
180
|
+
`header`, `metro`, `toolbar`, `chips`. Content skins additionally consume the
|
|
181
|
+
projected icon slot (`iconlabel`, `path`, `icononly`, `shell`) - `record` also
|
|
182
|
+
the accessory slot. Cascade: `[skin]` input, then `config.skin`, then `'classic'`.
|
|
183
|
+
|
|
184
|
+
## Configuration
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
provideBreadcrumbConfig(
|
|
188
|
+
withBreadcrumbAriaLabels({ bar: 'Navigation trail' }),
|
|
189
|
+
withBreadcrumbDataKey('crumb'),
|
|
190
|
+
withBreadcrumbIconKey('glyph'),
|
|
191
|
+
withBreadcrumbSkin('pill'),
|
|
192
|
+
);
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Root, or scoped to a subtree with `provideBreadcrumbConfigAt` in
|
|
196
|
+
`viewProviders`, where features deep-merge onto the parent config. Resolution:
|
|
197
|
+
per-instance input, then the scoped provider, then root, then the library
|
|
198
|
+
defaults; the accessible names come from the `breadcrumb` section of the
|
|
199
|
+
language pack (English without one). Read the resolved
|
|
200
|
+
config with `injectBreadcrumbConfig()` and the resolved labels with
|
|
201
|
+
`injectBreadcrumbAriaLabels()`. `withBreadcrumbAriaLabels` also takes a
|
|
202
|
+
`Signal`, so the labels follow a runtime language switch.
|
|
203
|
+
|
|
204
|
+
## Accessibility
|
|
205
|
+
|
|
206
|
+
- The bar is a `<nav>` landmark; `[label]` names it (default "Breadcrumb").
|
|
207
|
+
- Terminal crumb: `aria-current="page"`, no `href` - derived from position.
|
|
208
|
+
- Separators are `aria-hidden="true"`, so AT reads a clean list of crumbs.
|
|
209
|
+
- Overflow and siblings triggers carry configurable `aria-label`s
|
|
210
|
+
(`[triggerLabel]`, `[menuLabel]`); the siblings trigger reflects open state
|
|
211
|
+
on `aria-expanded`.
|
|
212
|
+
- Sibling rows are native anchors - keyboard activation, screen-reader link
|
|
213
|
+
roles and middle-click work without a command-menu layer.
|
|
214
|
+
- Touch targets floor to `--cngx-target-min` on coarse pointers.
|
|
215
|
+
|
|
216
|
+
## CSS custom properties
|
|
217
|
+
|
|
218
|
+
| Property | Default | Description |
|
|
219
|
+
|-|-|-|
|
|
220
|
+
| `--cngx-breadcrumb-gap` | `var(--cngx-space-sm, 0.5rem)` | Gap between crumbs, density-tracking |
|
|
221
|
+
| `--cngx-breadcrumb-link-color` | `inherit` | Crumb link color |
|
|
222
|
+
| `--cngx-breadcrumb-link-decoration` | `underline` | Crumb link text-decoration |
|
|
223
|
+
| `--cngx-breadcrumb-current-color` | `inherit` | Terminal crumb color |
|
|
224
|
+
| `--cngx-breadcrumb-current-weight` | `600` | Terminal crumb font-weight |
|
|
225
|
+
| `--cngx-breadcrumb-separator` | `'\203A'` (`'\2039'` under RTL) | Separator glyph in skin paint |
|
|
226
|
+
| `--cngx-breadcrumb-separator-color` | `inherit` | Separator color |
|
|
227
|
+
| `--cngx-breadcrumb-overflow-trigger-width` | `32px` | Ellipsis trigger width |
|
|
228
|
+
| `--cngx-breadcrumb-overflow-trigger-height` | `26px` | Ellipsis trigger height |
|
|
229
|
+
| `--cngx-breadcrumb-overflow-menu-min-width` | `11.875rem` | Collapsed-crumb menu min width |
|
|
230
|
+
| `--cngx-breadcrumb-siblings-trigger-size` | `22px` | Chevron trigger box |
|
|
231
|
+
| `--cngx-breadcrumb-siblings-menu-min-width` | `11.25rem` | Sibling list min width |
|
|
232
|
+
| `--cngx-breadcrumb-siblings-item-current-color` | `var(--cngx-color-primary, ...)` | Active sibling row color |
|
|
233
|
+
|
|
234
|
+
Beyond these, `--cngx-breadcrumb-overflow-*` and `--cngx-breadcrumb-siblings-*`
|
|
235
|
+
cover the trigger/row colors, hover/open states, paddings and radii; each skin
|
|
236
|
+
owns a `--cngx-breadcrumb-<skin>-*` family (bg, color, hover, active, radius,
|
|
237
|
+
font-size), registered via `@property` and assigned adaptively from
|
|
238
|
+
`--cngx-color-*` inside its `@scope`. Full list on the compodocx Theming tab.
|
|
239
|
+
|
|
240
|
+
## Material Theme
|
|
241
|
+
|
|
242
|
+
```scss
|
|
243
|
+
@use '@angular/material' as mat;
|
|
244
|
+
@use '@cngx/themes/material/breadcrumb-theme' as breadcrumb;
|
|
245
|
+
|
|
246
|
+
html {
|
|
247
|
+
@include breadcrumb.theme($theme);
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
One include aligns the base bar (link, current, separator, gap) plus the
|
|
252
|
+
overflow and siblings triggers and rows with `--mat-sys-*`. The dropdown
|
|
253
|
+
surfaces are `CngxPopoverPanel` chrome (popover-panel bridge), and the skins
|
|
254
|
+
self-assign from `--cngx-color-*` in their own `@scope` - neither is
|
|
255
|
+
re-declared here.
|
|
256
|
+
|
|
257
|
+
## See Also
|
|
258
|
+
|
|
259
|
+
- [CngxBreadcrumb / CngxBreadcrumbItem / CngxBreadcrumbSeparator](../../common/interactive/) - the headless trio for hand-composed trails
|
|
260
|
+
- [CngxPopoverPanel](../../common/popover/) - the dropdown surface both menus render into
|
|
261
|
+
- [API on compodocx](https://cngxjs.github.io/cngx/)
|
|
262
|
+
- Tests: `projects/ui/breadcrumb/breadcrumb-bar.component.spec.ts`, `breadcrumb-router-sync.directive.spec.ts`
|
package/collection/README.md
CHANGED
|
@@ -125,6 +125,12 @@ focus is never silently dropped.
|
|
|
125
125
|
`isBusy()` signal - never a one-time setting.
|
|
126
126
|
- State changes (empty, end-reached, error) surface through a polite live region
|
|
127
127
|
so assistive technology is told when the collection settles.
|
|
128
|
+
- The labels come from the `collection` section of the language pack
|
|
129
|
+
(`CNGX_COLLECTION_LANGUAGE_EN` in English); `withIncrementalListAriaLabels`
|
|
130
|
+
overrides single keys and also takes a `Signal`. The live region keeps its
|
|
131
|
+
current message on a language switch and speaks the new language with the
|
|
132
|
+
next settle.
|
|
133
|
+
- Without an item slot, a number or `Date` row is formatted for the locale.
|
|
128
134
|
|
|
129
135
|
## Composition
|
|
130
136
|
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# CngxCommandPalette
|
|
2
|
+
|
|
3
|
+
The opinionated Cmd/Ctrl+K palette preset. Renders a search-driven command list
|
|
4
|
+
inside a native modal `<dialog cngxDialog>`, so focus trapping, trigger storage
|
|
5
|
+
at open and focus restore after the close transition come from `CngxDialog` and
|
|
6
|
+
the platform - no hand-rolled focus machinery. The body composes existing
|
|
7
|
+
atoms: `CngxSearch` (debounced term), `CngxListbox` + `CngxOption`
|
|
8
|
+
(active-descendant navigation), `CngxHighlight` (match marking). Commands are
|
|
9
|
+
data from `@cngx/common/command` (`provideCommands`); the palette commits no
|
|
10
|
+
form value - it fires `command.run()`, the locked demarcation from `CngxCombobox`.
|
|
11
|
+
|
|
12
|
+
## Import
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { CngxCommandPalette, CngxCommandPaletteTrigger } from '@cngx/ui/command-palette';
|
|
16
|
+
import { provideCommands } from '@cngx/common/command';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { Component } from '@angular/core';
|
|
23
|
+
import { provideCommands } from '@cngx/common/command';
|
|
24
|
+
import { CngxCommandPalette, CngxCommandPaletteTrigger } from '@cngx/ui/command-palette';
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-example',
|
|
28
|
+
providers: [
|
|
29
|
+
provideCommands([
|
|
30
|
+
{ id: 'new-file', label: 'New file', run: () => void 0 },
|
|
31
|
+
{ id: 'toggle-theme', label: 'Toggle theme', group: 'View', run: () => void 0 },
|
|
32
|
+
]),
|
|
33
|
+
],
|
|
34
|
+
template: `
|
|
35
|
+
<button [cngxCommandPaletteTrigger]="palette">Search <kbd>Cmd K</kbd></button>
|
|
36
|
+
<cngx-command-palette #palette />
|
|
37
|
+
`,
|
|
38
|
+
imports: [CngxCommandPalette, CngxCommandPaletteTrigger],
|
|
39
|
+
})
|
|
40
|
+
export class ExampleComponent {}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Pressing Cmd/Ctrl+K anywhere opens the palette. Type to filter, arrows to
|
|
44
|
+
navigate, Enter runs the highlighted command and dismisses.
|
|
45
|
+
|
|
46
|
+
## Opening
|
|
47
|
+
|
|
48
|
+
The open combo resolves per instance `[openShortcut]` (parsed via
|
|
49
|
+
`parseKeyCombo`, e.g. `'mod+shift+p'`; changing it live re-installs the
|
|
50
|
+
listener), then `withPaletteShortcut(...)` from the config cascade, then the
|
|
51
|
+
`'mod+k'` default.
|
|
52
|
+
|
|
53
|
+
The global keydown listener is installed by a swappable factory,
|
|
54
|
+
`CNGX_PALETTE_KEYBINDING_FACTORY` (default `createPaletteKeybinding`). Override
|
|
55
|
+
the token to replace the whole listener - an enterprise key-capture policy, a
|
|
56
|
+
test double - without touching the palette. To only change the combo, use the
|
|
57
|
+
input or the config feature. On SSR the default factory is an inert no-op.
|
|
58
|
+
|
|
59
|
+
`[cngxCommandPaletteTrigger]` is the optional explicit trigger: opens on click,
|
|
60
|
+
sets `aria-haspopup="dialog"` and derives `aria-expanded` from the palette's
|
|
61
|
+
`isOpen()` signal. The palette is passed by template reference - orthogonal
|
|
62
|
+
composition, no ancestor injection. `open()` and `dismiss()` are public methods
|
|
63
|
+
for programmatic control.
|
|
64
|
+
|
|
65
|
+
## Commands and matching
|
|
66
|
+
|
|
67
|
+
The static registry is `provideCommands(...sources)` - each source an array or
|
|
68
|
+
a `Signal<readonly CngxCommand[]>`, merged reactively. Scoped calls in a lazy
|
|
69
|
+
route or a component add to the root set, so a palette inside a feature lists
|
|
70
|
+
the global commands plus the feature's own; a scoped command that reuses a
|
|
71
|
+
global command's `id` replaces it there. A `CngxCommand` is pure
|
|
72
|
+
data plus `run()`: `id`, `label`, optional `keywords`, `group`, `icon`,
|
|
73
|
+
`disabled` (a `Signal<boolean>`), `disabledReason`, and an `unknown` `data`
|
|
74
|
+
payload the row slot narrows.
|
|
75
|
+
|
|
76
|
+
Ranking runs through the swappable `CNGX_COMMAND_MATCH_FACTORY`
|
|
77
|
+
(`@cngx/common/command`); results group by `command.group`, rank order
|
|
78
|
+
preserved. The two-way `[(scope)]` model feeds the matcher's scope filter and
|
|
79
|
+
renders as a chip in the input row.
|
|
80
|
+
|
|
81
|
+
A disabled command stays in the list and communicates its why: the default row
|
|
82
|
+
wires `aria-describedby` to a visually hidden node carrying `disabledReason`,
|
|
83
|
+
with the reference gated on the disabled state while the node itself stays in
|
|
84
|
+
the DOM.
|
|
85
|
+
|
|
86
|
+
## Async results
|
|
87
|
+
|
|
88
|
+
Bind `[results]` to a `CngxAsyncState<CngxCommandGroup[]>` (from
|
|
89
|
+
`createAsyncState`/`injectAsyncState`) and the palette merges consumer groups
|
|
90
|
+
above the ranked static registry. An internal shell maps the state through
|
|
91
|
+
`resolveAsyncView()`:
|
|
92
|
+
|
|
93
|
+
- first load renders the loading state; a first-load failure the error state
|
|
94
|
+
with a Retry button that emits `(retry)`;
|
|
95
|
+
- a re-query failure keeps stale results visible under an error banner;
|
|
96
|
+
- an empty success keeps the input mounted - the panel renders the empty slot
|
|
97
|
+
off its own result count, so typing to refine the term keeps working.
|
|
98
|
+
|
|
99
|
+
When async groups arrive mid-navigation, the highlight is re-resolved by
|
|
100
|
+
command id, not index - Enter always runs the row the user saw.
|
|
101
|
+
|
|
102
|
+
## Template slots
|
|
103
|
+
|
|
104
|
+
Six structural directives, projected as palette content. Resolution per slot:
|
|
105
|
+
instance directive, then `config.templates`, then the built-in default.
|
|
106
|
+
|
|
107
|
+
| Slot | Context |
|
|
108
|
+
|-|-|
|
|
109
|
+
| `*cngxCommandRow` | `$implicit: CngxRankedCommand`, `term`, `data`, `active` |
|
|
110
|
+
| `*cngxCommandGroupHeader` | `$implicit: CngxCommandGroup` |
|
|
111
|
+
| `*cngxCommandPaletteEmpty` | `term` |
|
|
112
|
+
| `*cngxCommandPaletteLoading` | none |
|
|
113
|
+
| `*cngxCommandPaletteError` | `error`, `retry: () => void` |
|
|
114
|
+
| `*cngxCommandPaletteFooter` | none |
|
|
115
|
+
|
|
116
|
+
The row is one slot on purpose - icon, label and shortcut hint are laid out in
|
|
117
|
+
the consumer's template:
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<cngx-command-palette #palette [results]="results()">
|
|
121
|
+
<ng-template cngxCommandRow let-entry let-active="active">
|
|
122
|
+
<my-icon [name]="entry.command.icon" />
|
|
123
|
+
<span>{{ entry.command.label }}</span>
|
|
124
|
+
</ng-template>
|
|
125
|
+
</cngx-command-palette>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The default footer renders the configured keyboard legend as `<kbd>` rows.
|
|
129
|
+
|
|
130
|
+
## Host contract
|
|
131
|
+
|
|
132
|
+
The palette provides `CNGX_COMMAND_PALETTE_HOST` (`CngxCommandPaletteHost`):
|
|
133
|
+
`isOpen: Signal<boolean>` plus `dismiss()`. The panel uses it to dismiss after
|
|
134
|
+
a command runs and to reset term and highlight when the surface closes - the
|
|
135
|
+
dialog keeps its content mounted, so state must not leak into the next open.
|
|
136
|
+
The trigger binds `aria-expanded` to the same `isOpen()` seam.
|
|
137
|
+
|
|
138
|
+
## Configuration
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
provideCommandPaletteConfig(
|
|
142
|
+
withCommandPaletteLabels({ searchPlaceholder: 'Befehl eingeben...', emptyLabel: 'Keine Treffer.' }),
|
|
143
|
+
withPaletteShortcut('mod+shift+p'),
|
|
144
|
+
withKeyboardLegend([{ keys: 'enter', label: 'Ausfuehren' }]),
|
|
145
|
+
withResultCountFormatter((n) => `${n} Ergebnisse`),
|
|
146
|
+
withCommandPaletteTemplates({ row: myRowTemplate }),
|
|
147
|
+
);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Root, or scoped to a subtree with `provideCommandPaletteConfigAt` in
|
|
151
|
+
`viewProviders`, where features merge onto the enclosing scope. The copy
|
|
152
|
+
defaults are the `commandPalette` section of the language pack (English
|
|
153
|
+
without one), so the language file translates the palette; the features above
|
|
154
|
+
override single keys on top of it. Each footer legend entry is spoken once,
|
|
155
|
+
through the section's `legendEntry` message (`'{keys} {label}'`). The `<kbd>`
|
|
156
|
+
glyphs are hidden from screen readers; an entry's `spokenKeys` (the navigate
|
|
157
|
+
entry's `navigateKeysSpoken`, English `'Up and Down arrows'`) is what they hear.
|
|
158
|
+
|
|
159
|
+
## Accessibility
|
|
160
|
+
|
|
161
|
+
- The surface is a native modal dialog: `showModal()` traps focus, Escape
|
|
162
|
+
closes, focus returns to the trigger after the close transition settles.
|
|
163
|
+
`[ariaLabel]` names the dialog (default `'Command palette'`).
|
|
164
|
+
- The input is `role="combobox"` with `aria-autocomplete="list"`,
|
|
165
|
+
`aria-controls` on the listbox and `aria-activedescendant` tracking the
|
|
166
|
+
highlighted row; focus never leaves the input while navigating.
|
|
167
|
+
- ArrowDown/ArrowUp move the highlight, Home/End jump, Enter activates.
|
|
168
|
+
Modified combos (Ctrl/Meta/Alt) pass through untouched so browser and app
|
|
169
|
+
shortcuts keep working; printable keys fall through to the search term.
|
|
170
|
+
- A polite `aria-live` region announces the result count on every re-rank,
|
|
171
|
+
formatted by `config.resultCount`.
|
|
172
|
+
- Groups render as `role="group"` with `aria-labelledby` pointing at minted,
|
|
173
|
+
panel-unique DOM ids - never raw consumer strings.
|
|
174
|
+
- Forced-colors mode re-signals the active row with the system Highlight pair
|
|
175
|
+
and pins the modal border to `CanvasText`.
|
|
176
|
+
|
|
177
|
+
## CSS custom properties
|
|
178
|
+
|
|
179
|
+
All spacing tokens are set from the global `--cngx-space-*` scale at the hosts,
|
|
180
|
+
so a root `[data-density]` swap re-scales the whole palette.
|
|
181
|
+
|
|
182
|
+
| Property | Default | Purpose |
|
|
183
|
+
|-|-|-|
|
|
184
|
+
| `--cngx-command-width` | `min(40rem, calc(100vw - 2rem))` | Dialog inline size |
|
|
185
|
+
| `--cngx-command-max-h` | `min(32rem, calc(100vh - 6rem))` | Dialog max block size |
|
|
186
|
+
| `--cngx-command-bg` / `--cngx-command-color` | surface / inherit | Dialog surface pair |
|
|
187
|
+
| `--cngx-command-border` / `--cngx-command-border-width` | `--cngx-color-border` / `1px` | Border, input row and footer separators |
|
|
188
|
+
| `--cngx-command-radius` | `--cngx-radius-lg` | Dialog corner radius |
|
|
189
|
+
| `--cngx-command-shadow` | elevation shadow | Dialog elevation |
|
|
190
|
+
| `--cngx-command-backdrop` | `rgb(0 0 0 / 0.4)` | `::backdrop` scrim |
|
|
191
|
+
| `--cngx-command-input-color` / `--cngx-command-placeholder-color` | inherit / muted | Search input text |
|
|
192
|
+
| `--cngx-command-input-gap` / `--cngx-command-input-pad` | `sm` / `md` space | Input row layout |
|
|
193
|
+
| `--cngx-command-chip-bg` / `--cngx-command-chip-color` / `--cngx-command-chip-size` / `--cngx-command-chip-radius` / `--cngx-command-chip-pad` | muted / inherit / `0.8125rem` / `--cngx-radius-sm` / `sm` space | Scope chip |
|
|
194
|
+
| `--cngx-command-listbox-max-h` / `--cngx-command-listbox-pad` | `22rem` / `xs` space | Results scroll area |
|
|
195
|
+
| `--cngx-command-header-color` / `--cngx-command-header-size` / `--cngx-command-header-weight` / `--cngx-command-header-pad-y` / `--cngx-command-header-pad-x` | muted / `0.75rem` / `600` / `xs` / `sm` space | Group headers |
|
|
196
|
+
| `--cngx-command-row-color` / `--cngx-command-row-radius` / `--cngx-command-row-gap` / `--cngx-command-row-pad` | inherit / `--cngx-radius-sm` / `sm` / `sm` space | Command rows |
|
|
197
|
+
| `--cngx-command-row-active-bg` / `--cngx-command-row-active-color` | translucent tint / inherit | Highlighted row |
|
|
198
|
+
| `--cngx-command-mark-bg` | `--cngx-color-highlight` | Match `<mark>` |
|
|
199
|
+
| `--cngx-command-state-pad` / `--cngx-command-state-color` / `--cngx-command-error-color` / `--cngx-command-retry-bg` | `lg` space / muted / danger / transparent | Loading, empty and error chrome |
|
|
200
|
+
| `--cngx-command-footer-gap` / `--cngx-command-footer-pad-y` / `--cngx-command-footer-pad-x` / `--cngx-command-footer-size` / `--cngx-command-footer-color` | `md` / `sm` / `md` space / `0.75rem` / muted | Legend footer |
|
|
201
|
+
| `--cngx-command-kbd-bg` / `--cngx-command-kbd-color` | muted / inherit | `<kbd>` chips |
|
|
202
|
+
| `--cngx-command-focus-outline` / `--cngx-command-focus-offset` | `2px solid` focus color / `2px` | Focus ring |
|
|
203
|
+
|
|
204
|
+
## Material Theme
|
|
205
|
+
|
|
206
|
+
```scss
|
|
207
|
+
@use '@angular/material' as mat;
|
|
208
|
+
@use '@cngx/themes/material/command-palette-theme' as command-palette;
|
|
209
|
+
|
|
210
|
+
html {
|
|
211
|
+
@include command-palette.theme($theme);
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Without the bridge the palette uses the cngx foundation `--cngx-color-*`
|
|
216
|
+
tokens with a native look. The bridge paints an M3 dialog/menu hybrid:
|
|
217
|
+
surface-container-high modal on a scrim backdrop, secondary-container active
|
|
218
|
+
rows, container-tone chip and kbd sub-surfaces, error roles for the failure
|
|
219
|
+
chrome. Spacing stays on `--cngx-space-*` so density tracking keeps working.
|
|
220
|
+
|
|
221
|
+
## See Also
|
|
222
|
+
|
|
223
|
+
- `@cngx/common/command` - the framework-level command registry and matcher
|
|
224
|
+
- [CngxDialog](../../common/dialog/) - the modal surface the palette composes
|
|
225
|
+
- [CngxListbox](../../common/interactive/) - the navigation atom under the rows
|
|
226
|
+
- [API on compodocx](https://cngxjs.github.io/cngx/)
|
|
227
|
+
- Tests: `projects/ui/command-palette/palette/command-palette.component.spec.ts`, `panel/command-panel.component.spec.ts`
|
|
@@ -57,6 +57,16 @@ 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
|
+
The host composes `CngxScrollEdges`, so it carries `data-scroll-inline-start` /
|
|
61
|
+
`data-scroll-inline-end` only while columns are really hidden toward that side, and
|
|
62
|
+
fades that edge with a mask. The fade width is `--cngx-dga-edge-fade-size` (24px) and it
|
|
63
|
+
never drops below `--cngx-dga-edge-fade-min` opacity (0.35), so edge content and overlay
|
|
64
|
+
scrollbars stay visible; the border ring (skin frame, classic scrollbars) is left
|
|
65
|
+
unmasked. The gradient flips under `dir="rtl"`. A focused cell scrolled in sideways
|
|
66
|
+
lands clear of the fade (`scroll-padding-inline` = fade width plus
|
|
67
|
+
`--cngx-dga-focus-clearance`), and while the grid host itself holds keyboard focus the
|
|
68
|
+
mask yields so its focus ring stays visible.
|
|
69
|
+
|
|
60
70
|
## Bounded height
|
|
61
71
|
|
|
62
72
|
Bind `[maxBlockSize]` to cap the grid (a number is `px`, a string is any CSS length):
|
|
@@ -68,6 +78,65 @@ set directly. This is the only way to pin the head - `[cngxStickyHeader]` from
|
|
|
68
78
|
and a content-height grid has nothing to stick to. Leave `[maxBlockSize]` unbound and
|
|
69
79
|
the grid stays content-height and unchanged.
|
|
70
80
|
|
|
81
|
+
In bounded mode the pinned bands communicate hidden rows: the head casts a shadow only
|
|
82
|
+
while `data-scroll-block-start` is set (rows scrolled away above), the footer only while
|
|
83
|
+
`data-scroll-block-end` is set (rows remaining below). Tune them with
|
|
84
|
+
`--cngx-dga-head-shadow` / `--cngx-dga-foot-shadow`. Keyboard focus never lands under a
|
|
85
|
+
band: the host pads its scrollport (`scroll-padding-block`) by the measured head and
|
|
86
|
+
foot size plus `--cngx-dga-focus-clearance` (4px, the widest ring plus its offset);
|
|
87
|
+
`--cngx-dga-head-scroll-pad` / `--cngx-dga-foot-scroll-pad` override the measured
|
|
88
|
+
values.
|
|
89
|
+
|
|
90
|
+
### Scroll-edge visuals are swappable defaults
|
|
91
|
+
|
|
92
|
+
The shadows and the inline fade are only the default look. The host attributes
|
|
93
|
+
`data-scroll-block-start`, `data-scroll-block-end`, `data-scroll-inline-start` and
|
|
94
|
+
`data-scroll-inline-end` are public: each is present (empty value) only while content is
|
|
95
|
+
hidden toward that edge, so you can key any visual on them.
|
|
96
|
+
|
|
97
|
+
Turn the default shadows off:
|
|
98
|
+
|
|
99
|
+
```css
|
|
100
|
+
cngx-data-grid-accordion {
|
|
101
|
+
--cngx-dga-head-shadow: none;
|
|
102
|
+
--cngx-dga-foot-shadow: none;
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
A line that appears under the pinned head instead. Use a background layer on the header
|
|
107
|
+
rather than a pseudo-element: some skins already use the header's pseudo-elements, and
|
|
108
|
+
a background layer stacks on top of the skin's own fill:
|
|
109
|
+
|
|
110
|
+
```css
|
|
111
|
+
cngx-data-grid-accordion {
|
|
112
|
+
--cngx-dga-head-shadow: none;
|
|
113
|
+
}
|
|
114
|
+
cngx-data-grid-accordion[data-scroll-block-start] .cngx-dga-header {
|
|
115
|
+
background-image: linear-gradient(to top, var(--cngx-color-border, #d1d5db) 2px, transparent 0);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
A tonal head instead (the Material 3 top app bar pattern). Set the header's background
|
|
120
|
+
directly: the named skins paint the head fill themselves, so `--cngx-dga-head-bg` only
|
|
121
|
+
reaches the unskinned grid:
|
|
122
|
+
|
|
123
|
+
```css
|
|
124
|
+
cngx-data-grid-accordion {
|
|
125
|
+
--cngx-dga-head-shadow: none;
|
|
126
|
+
}
|
|
127
|
+
cngx-data-grid-accordion[data-scroll-block-start] .cngx-dga-header {
|
|
128
|
+
background-color: color-mix(in oklab, var(--cngx-color-primary, #1d4ed8) 8%, var(--cngx-color-surface, #fff));
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Under forced colors the UA strips shadows, so a line or border is the cue that survives
|
|
133
|
+
there.
|
|
134
|
+
|
|
135
|
+
Motion and forced colors: the shadow and fade ease over `--cngx-dga-edge-duration`
|
|
136
|
+
(default `--cngx-duration-fast`), which the global reduced-motion net collapses to an
|
|
137
|
+
instant change. Under forced colors the UA drops the shadows and the fade is removed;
|
|
138
|
+
the system-coloured scrollbar and the 1px head / foot rules carry the cue.
|
|
139
|
+
|
|
71
140
|
## Skins
|
|
72
141
|
|
|
73
142
|
Six built-in skins select via the `[skin]` input, reflected onto a `[data-skin]` host
|
|
@@ -95,8 +164,13 @@ a per-instance `[skin]` still wins. Columns are per-instance, so there is no
|
|
|
95
164
|
## Config
|
|
96
165
|
|
|
97
166
|
`provideDataGridAccordionConfig(...)` / `provideDataGridAccordionConfigAt(...)` with the
|
|
98
|
-
|
|
99
|
-
`injectDataGridAccordionConfig()`.
|
|
167
|
+
`withDataGridSkin(name)` and `withDataGridAccordionLabels({...})` features; read it back
|
|
168
|
+
with `injectDataGridAccordionConfig()`. `withDataGridAccordionLabels` takes a partial
|
|
169
|
+
bundle (or a `Signal` of one) for the count, sort, filter, row-error and note copy;
|
|
170
|
+
unset keys read the `dataGridAccordion` section of the language pack (English without
|
|
171
|
+
one). `CngxDataGridAccordionConfigFeature` is a union
|
|
172
|
+
since the labels feature landed - see [the migration note](./config-feature-migration.md)
|
|
173
|
+
if you extended or merged the old interface.
|
|
100
174
|
|
|
101
175
|
## Sort and filter
|
|
102
176
|
|