@cngx/ui 0.1.0-rc.5 → 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 +19 -8
- 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 +90 -20
- 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 +38 -19
- 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 +18 -4
- 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
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef, Signal } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@cngx/common/interactive';
|
|
4
|
+
import { CngxContextMenuTriggerPopoverRef, CngxMenuHost, CngxMenu, CngxMenuSubmenuWiring, CngxMenuItemIcon, CngxMenuSubmenuPopoverRef } from '@cngx/common/interactive';
|
|
5
|
+
import * as i1 from '@cngx/common/popover';
|
|
6
|
+
import { CngxPopover } from '@cngx/common/popover';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Context handed to a `*cngxContextMenuContent` template. `$implicit` is the
|
|
10
|
+
* per-open datum the trigger resolved for the target the menu opened over
|
|
11
|
+
* (`null` while the menu is closed). Read it with `let-row`.
|
|
12
|
+
*
|
|
13
|
+
* @category ui/context-menu
|
|
14
|
+
*/
|
|
15
|
+
interface CngxContextMenuContentContext<T = unknown> {
|
|
16
|
+
/** The per-open datum, or `null` while the menu is closed. Usable as `let-row`. */
|
|
17
|
+
readonly $implicit: T | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Lazy content slot for {@link CngxContextMenu}. The template renders only
|
|
21
|
+
* while the menu is open and receives the trigger's per-open datum as
|
|
22
|
+
* `$implicit`, so one panel declaration serves every target of a delegated
|
|
23
|
+
* trigger with row-correct content.
|
|
24
|
+
*
|
|
25
|
+
* ```html
|
|
26
|
+
* <cngx-context-menu #menu ariaLabel="Row actions">
|
|
27
|
+
* <ng-template cngxContextMenuContent let-row>
|
|
28
|
+
* <cngx-context-menu-item (select)="edit(row)">Edit {{ row.name }}</cngx-context-menu-item>
|
|
29
|
+
* </ng-template>
|
|
30
|
+
* </cngx-context-menu>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/grid/delegated-resolver</example-url>
|
|
34
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/table/row-context-data</example-url>
|
|
35
|
+
* @category ui/context-menu
|
|
36
|
+
* @wcag AA
|
|
37
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-content.directive.ts
|
|
38
|
+
* @since 0.1.0
|
|
39
|
+
* @relatedTo CngxContextMenu, CngxContextMenuFor
|
|
40
|
+
*/
|
|
41
|
+
declare class CngxContextMenuContent<T = unknown> {
|
|
42
|
+
/** The projected `<ng-template>`, rendered by the panel while open. */
|
|
43
|
+
readonly templateRef: TemplateRef<CngxContextMenuContentContext<T>>;
|
|
44
|
+
/** Narrows `let-` bindings to {@link CngxContextMenuContentContext} under strict templates. */
|
|
45
|
+
static ngTemplateContextGuard<T>(_dir: CngxContextMenuContent<T>, _ctx: unknown): _ctx is CngxContextMenuContentContext<T>;
|
|
46
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuContent<any>, never>;
|
|
47
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxContextMenuContent<any>, "ng-template[cngxContextMenuContent]", ["cngxContextMenuContent"], {}, {}, never, never, true, never>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Structural contract a context-menu panel exposes to `CngxContextMenuFor`.
|
|
52
|
+
* The trigger depends on this interface rather than the concrete
|
|
53
|
+
* `CngxContextMenu` class so an ejected panel skin (decompose) or a future
|
|
54
|
+
* second panel can satisfy the same seam - the `CngxMenuHost` precedent
|
|
55
|
+
* (`CNGX_MENU_HOST`) applied to the panel surface.
|
|
56
|
+
*
|
|
57
|
+
* @category ui/context-menu
|
|
58
|
+
*/
|
|
59
|
+
interface CngxContextMenuPanel<T = unknown> {
|
|
60
|
+
/** Popover surface the trigger drives at pointer coordinates. */
|
|
61
|
+
readonly popover: CngxContextMenuTriggerPopoverRef;
|
|
62
|
+
/** Menu brain the popover wraps (`role="menu"`, active-descendant registry). */
|
|
63
|
+
readonly menuHost: CngxMenuHost;
|
|
64
|
+
/** The per-open datum while visible, `null` once closed. */
|
|
65
|
+
readonly context: Signal<T | null>;
|
|
66
|
+
/** Store the per-open datum. Called by the trigger before the popover opens. */
|
|
67
|
+
setContext(value: T | null): void;
|
|
68
|
+
/**
|
|
69
|
+
* @internal Open this panel as a nested submenu of a parent item: flank the
|
|
70
|
+
* inline-end (`right-start` + the submenu flip chain), open non-exclusively so
|
|
71
|
+
* the parent panel survives, and mirror the parent's per-open datum. Owns the
|
|
72
|
+
* submenu placement policy so a projected item drives one seam instead of
|
|
73
|
+
* reaching into the popover's override signals. Optional: an ejected panel
|
|
74
|
+
* skin may omit it and drive its own popover directly.
|
|
75
|
+
*/
|
|
76
|
+
openAsSubmenu?(context: T | null): void;
|
|
77
|
+
/**
|
|
78
|
+
* @internal Register the trigger core's keydown handler so the panel can
|
|
79
|
+
* forward ArrowRight/ArrowLeft/Escape submenu routing to it. The core owns
|
|
80
|
+
* that routing, but open moves focus into the panel (a sibling of the
|
|
81
|
+
* trigger), so the panel - not the trigger host - is where those keys land.
|
|
82
|
+
* `null` deregisters. Optional: an ejected panel skin may omit it, in which
|
|
83
|
+
* case keyboard submenu routing is simply not wired.
|
|
84
|
+
*/
|
|
85
|
+
setKeydownHandler?(handler: ((event: KeyboardEvent) => void) | null): void;
|
|
86
|
+
/**
|
|
87
|
+
* @internal Register the trigger core's activation handler. The panel
|
|
88
|
+
* subscribes to its menu brain's `CngxActiveDescendant.activated` output and
|
|
89
|
+
* invokes this on every activation, so pointer click and Enter/Space open a
|
|
90
|
+
* submenu-parent deterministically off the `activated` event rather than a
|
|
91
|
+
* forwarded keydown that races the AD's own listener. `null` deregisters.
|
|
92
|
+
* Optional: an ejected panel skin may omit it.
|
|
93
|
+
*/
|
|
94
|
+
setActivationHandler?(handler: (() => void) | null): void;
|
|
95
|
+
/**
|
|
96
|
+
* @internal Register the trigger core's push-only "submenu opened" handler.
|
|
97
|
+
* A projected item calls {@link noteActiveSubmenuOpened} after its
|
|
98
|
+
* `openAsSubmenu` terminal ran; the panel forwards to this handler so the
|
|
99
|
+
* trigger's focus stack records an externally opened submenu (hover and
|
|
100
|
+
* click already route through the stack and no-op here). `null`
|
|
101
|
+
* deregisters. Optional: an ejected panel skin may omit it.
|
|
102
|
+
*/
|
|
103
|
+
setSubmenuNoteHandler?(handler: (() => void) | null): void;
|
|
104
|
+
/**
|
|
105
|
+
* @internal Called by a projected item after its `openAsSubmenu` terminal
|
|
106
|
+
* showed the submenu, so the trigger's focus stack records it when the open
|
|
107
|
+
* did not come from the stack itself (programmatic opens; idempotent no-op
|
|
108
|
+
* for hover/click). Routes to the handler registered via
|
|
109
|
+
* {@link setSubmenuNoteHandler}; a no-op when none is wired.
|
|
110
|
+
*/
|
|
111
|
+
noteActiveSubmenuOpened?(): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Declarative context-menu panel. Stacks `CngxPopover` (the top-layer popup
|
|
116
|
+
* surface) and `CngxMenu` (the `role="menu"` keyboard + ARIA brain) as host
|
|
117
|
+
* directives on its own element, so projected items and the lazy content
|
|
118
|
+
* template resolve `CngxActiveDescendant` / `CNGX_MENU_HOST` against the panel
|
|
119
|
+
* host's injector chain. Pair it with `[cngxContextMenuFor]` on a target.
|
|
120
|
+
*
|
|
121
|
+
* The brains live on the host - not inside an inner `[cngxMenu]` element -
|
|
122
|
+
* because Angular resolves DI for projected and template content at the
|
|
123
|
+
* declaration site, not the projection site; an inner menu directive would
|
|
124
|
+
* be invisible to items rendered through `<ng-content>` or the content slot.
|
|
125
|
+
* Construction mirrors `CngxPopoverPanel`.
|
|
126
|
+
*
|
|
127
|
+
* `context()` is derived, never synced: it reads the trigger's per-open datum
|
|
128
|
+
* while the popover is visible and `null` once it closes - no manual reset on
|
|
129
|
+
* dismiss (Pillar 1).
|
|
130
|
+
*
|
|
131
|
+
* ### Static menu
|
|
132
|
+
* ```html
|
|
133
|
+
* <div [cngxContextMenuFor]="menu">Right-click me</div>
|
|
134
|
+
* <cngx-context-menu #menu ariaLabel="Actions">
|
|
135
|
+
* <cngx-context-menu-item (select)="copy()">Copy</cngx-context-menu-item>
|
|
136
|
+
* <cngx-context-menu-item (select)="paste()">Paste</cngx-context-menu-item>
|
|
137
|
+
* </cngx-context-menu>
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* ### Per-row content
|
|
141
|
+
* ```html
|
|
142
|
+
* <cngx-context-menu #menu ariaLabel="Row actions">
|
|
143
|
+
* <ng-template cngxContextMenuContent let-row>
|
|
144
|
+
* <cngx-context-menu-item (select)="edit(row)">Edit {{ row.name }}</cngx-context-menu-item>
|
|
145
|
+
* </ng-template>
|
|
146
|
+
* </cngx-context-menu>
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/basic/static-items</example-url>
|
|
150
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/grid/delegated-resolver</example-url>
|
|
151
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/submenu/nested-export-menu</example-url>
|
|
152
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/selection/checkbox-radio-items</example-url>
|
|
153
|
+
* @category ui/context-menu
|
|
154
|
+
* @docsKind primary
|
|
155
|
+
* @wcag AA
|
|
156
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu.component.ts
|
|
157
|
+
* @since 0.1.0
|
|
158
|
+
* @relatedTo CngxContextMenuFor, CngxContextMenuItem, CngxContextMenuContent, CngxMenu, CngxPopover
|
|
159
|
+
*/
|
|
160
|
+
declare class CngxContextMenu<T = unknown> implements CngxContextMenuPanel<T> {
|
|
161
|
+
/** The popover surface this panel drives. Consumed by the trigger core. */
|
|
162
|
+
readonly popover: CngxPopover;
|
|
163
|
+
/** The menu brain (`role="menu"`, active-descendant registry). */
|
|
164
|
+
readonly menuHost: CngxMenu;
|
|
165
|
+
/** Per-open datum set by the trigger before `show()`. */
|
|
166
|
+
private readonly datum;
|
|
167
|
+
/**
|
|
168
|
+
* The datum the menu opened over while visible, `null` once closed. Gated on
|
|
169
|
+
* `popover.isVisible()` so the reset on dismiss is derived, not synced.
|
|
170
|
+
*/
|
|
171
|
+
readonly context: _angular_core.Signal<T | null>;
|
|
172
|
+
protected readonly contentTemplate: _angular_core.Signal<CngxContextMenuContent<any> | undefined>;
|
|
173
|
+
/**
|
|
174
|
+
* @internal Store the per-open datum. Called by `CngxContextMenuFor` in the
|
|
175
|
+
* `contextmenu` event path, before the popover opens.
|
|
176
|
+
*/
|
|
177
|
+
setContext(value: T | null): void;
|
|
178
|
+
/**
|
|
179
|
+
* @internal Open this panel as a nested submenu of a parent item. Installs the
|
|
180
|
+
* inline-end placement + flip chain, opens non-exclusively (the parent panel
|
|
181
|
+
* survives), mirrors the parent's per-open datum, then shows. Owns the submenu
|
|
182
|
+
* placement policy so `CngxContextMenuItem` drives one seam rather than
|
|
183
|
+
* reaching into the popover's `@internal` override signals - the ejected item
|
|
184
|
+
* skin stays off `CngxPopover` internals (decompose).
|
|
185
|
+
*/
|
|
186
|
+
openAsSubmenu(context: T | null): void;
|
|
187
|
+
/** Keydown forwarder registered by the trigger; `null` while none is bound. */
|
|
188
|
+
private keydownHandler;
|
|
189
|
+
/** Activation forwarder registered by the trigger; `null` while none bound. */
|
|
190
|
+
private activationHandler;
|
|
191
|
+
/** Push-only submenu-note forwarder registered by the trigger; `null` while none bound. */
|
|
192
|
+
private submenuNoteHandler;
|
|
193
|
+
constructor();
|
|
194
|
+
/**
|
|
195
|
+
* @internal Register the trigger core's keydown handler. The core owns
|
|
196
|
+
* submenu ArrowRight/ArrowLeft/Escape routing, but open moves focus into
|
|
197
|
+
* this panel, so keydown lands here rather than on the trigger host.
|
|
198
|
+
*/
|
|
199
|
+
setKeydownHandler(handler: ((event: KeyboardEvent) => void) | null): void;
|
|
200
|
+
/**
|
|
201
|
+
* @internal Register the trigger core's activation handler, invoked on every
|
|
202
|
+
* `CngxActiveDescendant.activated` (keyboard activation + pointer click) so a
|
|
203
|
+
* submenu parent opens deterministically off the event rather than a racing
|
|
204
|
+
* keydown.
|
|
205
|
+
*/
|
|
206
|
+
setActivationHandler(handler: (() => void) | null): void;
|
|
207
|
+
/** @internal Register the trigger core's push-only submenu-note handler. */
|
|
208
|
+
setSubmenuNoteHandler(handler: (() => void) | null): void;
|
|
209
|
+
/** @internal A projected item calls this after its openAsSubmenu terminal
|
|
210
|
+
* ran, so the trigger's focus stack records an externally opened submenu
|
|
211
|
+
* (idempotent no-op for stack-driven hover/click opens). */
|
|
212
|
+
noteActiveSubmenuOpened(): void;
|
|
213
|
+
protected handleKeydown(event: KeyboardEvent): void;
|
|
214
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenu<any>, never>;
|
|
215
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxContextMenu<any>, "cngx-context-menu", ["cngxContextMenu"], {}, {}, ["contentTemplate"], ["*"], true, [{ directive: typeof i1.CngxPopover; inputs: { "offset": "offset"; "closeOnEscape": "closeOnEscape"; }; outputs: {}; }, { directive: typeof i1$1.CngxMenu; inputs: { "label": "ariaLabel"; }; outputs: {}; }]>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Docks a {@link CngxContextMenu} onto a target element. Opens the panel at
|
|
220
|
+
* pointer coordinates on `contextmenu` (right-click) or `Shift+F10`, feeding
|
|
221
|
+
* the panel a per-open datum so one declaration serves many targets.
|
|
222
|
+
*
|
|
223
|
+
* Two ways to obtain the datum `T`:
|
|
224
|
+
* - `[cngxContextMenuData]` - a fixed datum for this single target.
|
|
225
|
+
* - `[cngxContextMenuResolve]` - a resolver run against the `contextmenu`
|
|
226
|
+
* event, so a container (table, grid, treetable, virtualized list) keeps a
|
|
227
|
+
* single trigger instance and derives the row from `event.target`. The
|
|
228
|
+
* resolver wins when both are bound. A `null` resolver result leaves the
|
|
229
|
+
* native context menu untouched (no `preventDefault`, no open).
|
|
230
|
+
*
|
|
231
|
+
* A thin shell over `createContextMenuTriggerCore` (shared with
|
|
232
|
+
* `CngxContextMenuTrigger`): the core owns the preventDefault decision through
|
|
233
|
+
* its `resolveOpen` seam, so the veto lives in one place and this directive
|
|
234
|
+
* only feeds the resolver.
|
|
235
|
+
*
|
|
236
|
+
* ```html
|
|
237
|
+
* <tr [cngxContextMenuFor]="menu" [cngxContextMenuData]="row" tabindex="0"></tr>
|
|
238
|
+
* <cngx-context-menu #menu ariaLabel="Row actions">…</cngx-context-menu>
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
241
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/grid/delegated-resolver</example-url>
|
|
242
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/basic/static-items</example-url>
|
|
243
|
+
* @category ui/context-menu
|
|
244
|
+
* @wcag AA
|
|
245
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-for.directive.ts
|
|
246
|
+
* @since 0.1.0
|
|
247
|
+
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxContextMenuTrigger
|
|
248
|
+
*/
|
|
249
|
+
declare class CngxContextMenuFor<T = unknown> {
|
|
250
|
+
/** Panel this trigger opens. Typed to the {@link CngxContextMenuPanel} seam. */
|
|
251
|
+
readonly panel: _angular_core.InputSignal<CngxContextMenuPanel<T>>;
|
|
252
|
+
/** Fixed datum handed to the panel for this single target. */
|
|
253
|
+
readonly data: _angular_core.InputSignal<T | undefined>;
|
|
254
|
+
/**
|
|
255
|
+
* Resolver run against the `contextmenu` event. Return the datum to open
|
|
256
|
+
* with, or `null` to let the native menu show. Wins over `[cngxContextMenuData]`.
|
|
257
|
+
*/
|
|
258
|
+
readonly resolve: _angular_core.InputSignal<((event: MouseEvent) => T | null) | undefined>;
|
|
259
|
+
/** Mirrors the panel popover's visibility. */
|
|
260
|
+
readonly isOpen: _angular_core.Signal<boolean>;
|
|
261
|
+
private readonly core;
|
|
262
|
+
constructor();
|
|
263
|
+
protected handleContextMenu(event: MouseEvent): void;
|
|
264
|
+
protected handleKeydown(event: KeyboardEvent): void;
|
|
265
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuFor<any>, never>;
|
|
266
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxContextMenuFor<any>, "[cngxContextMenuFor]", ["cngxContextMenuFor"], { "panel": { "alias": "cngxContextMenuFor"; "required": true; "isSignal": true; }; "data": { "alias": "cngxContextMenuData"; "required": false; "isSignal": true; }; "resolve": { "alias": "cngxContextMenuResolve"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* A single actionable context-menu item. Thin shell over `CngxMenuItem`: the
|
|
271
|
+
* brain owns `role="menuitem"`, the active-descendant registration, the
|
|
272
|
+
* keyboard/pointer activation and the disabled semantics. Dual selector, so it
|
|
273
|
+
* works both as an element and as an attribute on a native `<button>` (the
|
|
274
|
+
* `button[mat-menu-item]` precedent).
|
|
275
|
+
*
|
|
276
|
+
* Emits `select` when this item is activated by click or Enter/Space. Give
|
|
277
|
+
* each item a distinct `[value]` (forwarded to the brain) so pointer
|
|
278
|
+
* activation targets the right row - matching the base `CngxMenuItem`
|
|
279
|
+
* convention; a value-less item still works when it is the only item.
|
|
280
|
+
*
|
|
281
|
+
* ### Submenu
|
|
282
|
+
* Bind `[submenu]` to a sibling `<cngx-context-menu>` to open a nested menu.
|
|
283
|
+
* The `CngxMenuItemSubmenu` brain (a host directive here) is wired internally
|
|
284
|
+
* through `CNGX_MENU_SUBMENU_WIRING`, so the consumer needs no `[exclusive]`
|
|
285
|
+
* handgrip and no popover plumbing - just the sibling reference. The nested
|
|
286
|
+
* panel opens non-exclusively (the parent stays open) and inherits the parent
|
|
287
|
+
* panel's row context.
|
|
288
|
+
*
|
|
289
|
+
* ```html
|
|
290
|
+
* <cngx-context-menu-item value="copy" kbd="⌘C" (select)="copy()">Copy</cngx-context-menu-item>
|
|
291
|
+
* <button cngxContextMenuItem value="delete" [disabled]="locked()" (select)="remove()">Delete</button>
|
|
292
|
+
*
|
|
293
|
+
* <cngx-context-menu-item [submenu]="exportMenu">Export</cngx-context-menu-item>
|
|
294
|
+
* <cngx-context-menu #exportMenu ariaLabel="Export as">
|
|
295
|
+
* <cngx-context-menu-item (select)="export('pdf')">PDF</cngx-context-menu-item>
|
|
296
|
+
* </cngx-context-menu>
|
|
297
|
+
* ```
|
|
298
|
+
*
|
|
299
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/basic/static-items</example-url>
|
|
300
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/submenu/nested-export-menu</example-url>
|
|
301
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/attribute-form/native-buttons</example-url>
|
|
302
|
+
* @category ui/context-menu
|
|
303
|
+
* @wcag AA
|
|
304
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item.component.ts
|
|
305
|
+
* @since 0.1.0
|
|
306
|
+
* @relatedTo CngxContextMenu, CngxContextMenuDivider, CngxMenuItem, CngxMenuItemSubmenu
|
|
307
|
+
*/
|
|
308
|
+
declare class CngxContextMenuItem implements CngxMenuSubmenuWiring {
|
|
309
|
+
/**
|
|
310
|
+
* Leading glyph shorthand rendered in the icon slot (decorative,
|
|
311
|
+
* `aria-hidden`). A convenience for single-character icons; suppressed when
|
|
312
|
+
* the consumer projects a richer `[cngxMenuItemIcon]` marker (SVG / icon
|
|
313
|
+
* component), which wins.
|
|
314
|
+
*/
|
|
315
|
+
readonly icon: _angular_core.InputSignal<string | undefined>;
|
|
316
|
+
/**
|
|
317
|
+
* A consumer-projected `[cngxMenuItemIcon]` marker, when present. Gates the
|
|
318
|
+
* string `[icon]` shorthand off so the projected icon is the only one drawn.
|
|
319
|
+
*/
|
|
320
|
+
protected readonly projectedIcon: _angular_core.Signal<CngxMenuItemIcon | undefined>;
|
|
321
|
+
/** Keyboard-shortcut hint rendered in the kbd slot (decorative). */
|
|
322
|
+
readonly kbd: _angular_core.InputSignal<string | undefined>;
|
|
323
|
+
/**
|
|
324
|
+
* Sibling `<cngx-context-menu>` opened as a nested submenu. When set, the
|
|
325
|
+
* item renders a caret, gains `aria-haspopup="menu"` (from the submenu
|
|
326
|
+
* brain) and routes ArrowRight/ArrowLeft into the nested panel.
|
|
327
|
+
*/
|
|
328
|
+
readonly submenu: _angular_core.InputSignal<CngxContextMenu<unknown> | undefined>;
|
|
329
|
+
/** Fires when this item is activated by click or Enter/Space. */
|
|
330
|
+
readonly select: _angular_core.OutputEmitterRef<void>;
|
|
331
|
+
/** @internal Decorative caret rendered while `submenu` is set. RTL flip is
|
|
332
|
+
* a CSS concern (`.cngx-menu-item__suffix` under `[dir='rtl']`), not a
|
|
333
|
+
* swapped glyph. */
|
|
334
|
+
protected readonly caret: "▸";
|
|
335
|
+
private readonly parentPanel;
|
|
336
|
+
/**
|
|
337
|
+
* Facade the submenu brain drives instead of a `[cngxMenuItemSubmenu]`
|
|
338
|
+
* input. `show()` opens the target panel non-exclusively and mirrors the
|
|
339
|
+
* parent panel's row context in first; every other member delegates to the
|
|
340
|
+
* target's `CngxPopover`. Built once, reads `submenu()` lazily so it stays
|
|
341
|
+
* valid across target changes. The adapter itself lives in
|
|
342
|
+
* `createContextMenuItemSubmenuFacade` so this class stays a thin shell.
|
|
343
|
+
*/
|
|
344
|
+
private readonly submenuPopoverFacade;
|
|
345
|
+
constructor();
|
|
346
|
+
/** @internal `CngxMenuSubmenuWiring` - the nested panel's menu brain, or
|
|
347
|
+
* `undefined` while no `[submenu]` is bound so the brain stays inert. */
|
|
348
|
+
menu(): CngxMenuHost | undefined;
|
|
349
|
+
/** @internal `CngxMenuSubmenuWiring` - the popover facade the brain drives,
|
|
350
|
+
* or `undefined` while no `[submenu]` is bound so the brain stays inert. */
|
|
351
|
+
popover(): CngxMenuSubmenuPopoverRef | undefined;
|
|
352
|
+
private openSubmenu;
|
|
353
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuItem, never>;
|
|
354
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxContextMenuItem, "cngx-context-menu-item, button[cngxContextMenuItem]", ["cngxContextMenuItem"], { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "kbd": { "alias": "kbd"; "required": false; "isSignal": true; }; "submenu": { "alias": "submenu"; "required": false; "isSignal": true; }; }, { "select": "select"; }, ["projectedIcon"], ["[cngxMenuItemIcon]", "*"], true, [{ directive: typeof i1$1.CngxMenuItem; inputs: { "disabled": "disabled"; "value": "value"; }; outputs: {}; }, { directive: typeof i1$1.CngxMenuItemSubmenu; inputs: {}; outputs: {}; }]>;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Non-interactive separator between context-menu item groups. Thin shell over
|
|
359
|
+
* `CngxMenuSeparator` (`role="separator"`, `aria-orientation="horizontal"`),
|
|
360
|
+
* skipped by active-descendant navigation and typeahead. Dual selector: use as
|
|
361
|
+
* an element or as an attribute on a native `<hr>`.
|
|
362
|
+
*
|
|
363
|
+
* ```html
|
|
364
|
+
* <cngx-context-menu-divider />
|
|
365
|
+
* <hr cngxContextMenuDivider />
|
|
366
|
+
* ```
|
|
367
|
+
*
|
|
368
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/basic/static-items</example-url>
|
|
369
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/attribute-form/native-buttons</example-url>
|
|
370
|
+
* @category ui/context-menu
|
|
371
|
+
* @wcag AA
|
|
372
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-divider.component.ts
|
|
373
|
+
* @since 0.1.0
|
|
374
|
+
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxMenuSeparator
|
|
375
|
+
*/
|
|
376
|
+
declare class CngxContextMenuDivider {
|
|
377
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuDivider, never>;
|
|
378
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxContextMenuDivider, "cngx-context-menu-divider, hr[cngxContextMenuDivider]", ["cngxContextMenuDivider"], {}, {}, never, never, true, [{ directive: typeof i1$1.CngxMenuSeparator; inputs: {}; outputs: {}; }]>;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* A checkable context-menu item (`role="menuitemcheckbox"`). Thin shell over
|
|
383
|
+
* `CngxMenuItemCheckbox`: the brain owns the role, the active-descendant
|
|
384
|
+
* registration, the toggle-on-activation semantics and the reactive
|
|
385
|
+
* `aria-checked`. `checked` is a two-way model forwarded through the host
|
|
386
|
+
* directive, so `[(checked)]` binds straight to consumer state.
|
|
387
|
+
*
|
|
388
|
+
* ```html
|
|
389
|
+
* <cngx-context-menu-item-checkbox [(checked)]="wrap">Word wrap</cngx-context-menu-item-checkbox>
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
392
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/selection/checkbox-radio-items</example-url>
|
|
393
|
+
* @category ui/context-menu
|
|
394
|
+
* @wcag AA
|
|
395
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item-checkbox.component.ts
|
|
396
|
+
* @since 0.1.0
|
|
397
|
+
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxContextMenuItemRadio, CngxMenuItemCheckbox
|
|
398
|
+
*/
|
|
399
|
+
declare class CngxContextMenuItemCheckbox {
|
|
400
|
+
/**
|
|
401
|
+
* Leading glyph shorthand rendered in the icon slot (decorative,
|
|
402
|
+
* `aria-hidden`). Suppressed when the consumer projects a richer
|
|
403
|
+
* `[cngxMenuItemIcon]` marker. The checked-indicator gutter renders
|
|
404
|
+
* independently of the icon, so a checked item stays visibly checked beside
|
|
405
|
+
* a custom icon.
|
|
406
|
+
*/
|
|
407
|
+
readonly icon: _angular_core.InputSignal<string | undefined>;
|
|
408
|
+
/** Keyboard-shortcut hint rendered in the kbd slot (decorative). */
|
|
409
|
+
readonly kbd: _angular_core.InputSignal<string | undefined>;
|
|
410
|
+
/**
|
|
411
|
+
* A consumer-projected `[cngxMenuItemIcon]` marker, when present. Gates the
|
|
412
|
+
* string `[icon]` shorthand off so the projected icon is the only one drawn.
|
|
413
|
+
*/
|
|
414
|
+
protected readonly projectedIcon: _angular_core.Signal<CngxMenuItemIcon | undefined>;
|
|
415
|
+
/** @internal Seeds the CSS `content` of the default checked indicator from
|
|
416
|
+
* the shared glyph const (CSS-string quoted for `content:`). */
|
|
417
|
+
protected readonly checkGlyph: string;
|
|
418
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuItemCheckbox, never>;
|
|
419
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxContextMenuItemCheckbox, "cngx-context-menu-item-checkbox, button[cngxContextMenuItemCheckbox]", ["cngxContextMenuItemCheckbox"], { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "kbd": { "alias": "kbd"; "required": false; "isSignal": true; }; }, {}, ["projectedIcon"], ["[cngxMenuItemIcon]", "*"], true, [{ directive: typeof i1$1.CngxMenuItemCheckbox; inputs: { "disabled": "disabled"; "value": "value"; "checked": "checked"; "label": "label"; }; outputs: { "checkedChange": "checkedChange"; }; }]>;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* A radio-style context-menu item (`role="menuitemradio"`). Thin shell over
|
|
424
|
+
* `CngxMenuItemRadio`: the brain owns the role, the active-descendant
|
|
425
|
+
* registration and the reactive `aria-checked`. Mutual exclusion is scoped to
|
|
426
|
+
* the enclosing `[cngxMenuGroup]` - the group owns the selected value, the
|
|
427
|
+
* item forwards its `value`.
|
|
428
|
+
*
|
|
429
|
+
* ```html
|
|
430
|
+
* <div cngxMenuGroup label="Density" [(selectedValue)]="density">
|
|
431
|
+
* <cngx-context-menu-item-radio value="cozy">Cozy</cngx-context-menu-item-radio>
|
|
432
|
+
* <cngx-context-menu-item-radio value="compact">Compact</cngx-context-menu-item-radio>
|
|
433
|
+
* </div>
|
|
434
|
+
* ```
|
|
435
|
+
*
|
|
436
|
+
* <example-url>http://localhost:4200/#/ui/context-menu/selection/checkbox-radio-items</example-url>
|
|
437
|
+
* @category ui/context-menu
|
|
438
|
+
* @wcag AA
|
|
439
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item-radio.component.ts
|
|
440
|
+
* @since 0.1.0
|
|
441
|
+
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxContextMenuItemCheckbox, CngxMenuItemRadio, CngxMenuGroup
|
|
442
|
+
*/
|
|
443
|
+
declare class CngxContextMenuItemRadio {
|
|
444
|
+
/**
|
|
445
|
+
* Leading glyph shorthand rendered in the icon slot (decorative,
|
|
446
|
+
* `aria-hidden`). Suppressed when the consumer projects a richer
|
|
447
|
+
* `[cngxMenuItemIcon]` marker. The checked-indicator gutter renders
|
|
448
|
+
* independently of the icon, so a checked item stays visibly checked beside
|
|
449
|
+
* a custom icon.
|
|
450
|
+
*/
|
|
451
|
+
readonly icon: _angular_core.InputSignal<string | undefined>;
|
|
452
|
+
/** Keyboard-shortcut hint rendered in the kbd slot (decorative). */
|
|
453
|
+
readonly kbd: _angular_core.InputSignal<string | undefined>;
|
|
454
|
+
/**
|
|
455
|
+
* A consumer-projected `[cngxMenuItemIcon]` marker, when present. Gates the
|
|
456
|
+
* string `[icon]` shorthand off so the projected icon is the only one drawn.
|
|
457
|
+
*/
|
|
458
|
+
protected readonly projectedIcon: _angular_core.Signal<CngxMenuItemIcon | undefined>;
|
|
459
|
+
/** @internal Seeds the CSS `content` of the default checked indicator from
|
|
460
|
+
* the shared glyph const (CSS-string quoted for `content:`). */
|
|
461
|
+
protected readonly checkGlyph: string;
|
|
462
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuItemRadio, never>;
|
|
463
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxContextMenuItemRadio, "cngx-context-menu-item-radio, button[cngxContextMenuItemRadio]", ["cngxContextMenuItemRadio"], { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "kbd": { "alias": "kbd"; "required": false; "isSignal": true; }; }, {}, ["projectedIcon"], ["[cngxMenuItemIcon]", "*"], true, [{ directive: typeof i1$1.CngxMenuItemRadio; inputs: { "disabled": "disabled"; "value": "value"; "label": "label"; }; outputs: {}; }]>;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export { CngxContextMenu, CngxContextMenuContent, CngxContextMenuDivider, CngxContextMenuFor, CngxContextMenuItem, CngxContextMenuItemCheckbox, CngxContextMenuItemRadio };
|
|
467
|
+
export type { CngxContextMenuContentContext, CngxContextMenuPanel };
|
|
@@ -146,10 +146,27 @@ interface CngxDataGridAccordionConfig {
|
|
|
146
146
|
* visible + ordered rows via a `computed()` and owns the `@for`; the open set is keyed
|
|
147
147
|
* by row value so a sorted or filtered row stays open while it moves.
|
|
148
148
|
*
|
|
149
|
+
* `injectSmartDataSource` cannot inject the group's hosted atoms: injection
|
|
150
|
+
* resolves upward, and `sort` / `filter` live on this element below the
|
|
151
|
+
* consumer's injector. Two routes reach them: derive the rows yourself from a
|
|
152
|
+
* `viewChild` + `computed()` (the group's prescribed shape), or hand the atoms
|
|
153
|
+
* to the source through its options thunks -
|
|
154
|
+
* `injectSmartDataSource(rows, { sort: () => grid()?.sort, filter: () => grid()?.filter })`.
|
|
155
|
+
*
|
|
149
156
|
* The column widths are declared on the header cells via `col`
|
|
150
157
|
* (`grow` / `fit` / `sm` / `md` / `lg`); the group derives the shared template from
|
|
151
158
|
* them, so no `grid-template-columns` string is needed for the common case.
|
|
152
159
|
*
|
|
160
|
+
* For a **bounded-height** grid, bind `[maxBlockSize]` (a number is `px`, a string is
|
|
161
|
+
* any CSS length): the grid becomes its own vertical scrollport, the column head pins
|
|
162
|
+
* to the top and the footer to the bottom, and only the rows scroll between them - the
|
|
163
|
+
* sum footer stays visible, not just the head. The input reflects onto
|
|
164
|
+
* `--cngx-dga-max-block-size`, the same token a skin may set directly. This is the only
|
|
165
|
+
* way to pin the head - `[cngxStickyHeader]` from `@cngx/common/layout` is the wrong
|
|
166
|
+
* tool here: the group is its own scrollport, so a header would resolve its sticky
|
|
167
|
+
* against that scrollport, and an unbounded (content-height) grid has nothing to stick
|
|
168
|
+
* to. Leave `[maxBlockSize]` unbound and the grid stays content-height, byte-identical.
|
|
169
|
+
*
|
|
153
170
|
* ```html
|
|
154
171
|
* <cngx-data-grid-accordion [multi]="true">
|
|
155
172
|
* <cngx-dga-header>
|
|
@@ -177,6 +194,7 @@ interface CngxDataGridAccordionConfig {
|
|
|
177
194
|
* @relatedTo CngxDataGridRow, CngxDgCell, CngxDataGridHeader, CngxDataGridFooter, CngxAccordion, CngxSort, CngxFilter, CngxDgaSortHeader, CngxDgaFilter, CngxDgaCount
|
|
178
195
|
*
|
|
179
196
|
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/sortable-ledger</example-url>
|
|
197
|
+
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/sticky-head</example-url>
|
|
180
198
|
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/bound-sort-filter</example-url>
|
|
181
199
|
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/master-detail</example-url>
|
|
182
200
|
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/spreadsheet</example-url>
|
|
@@ -218,6 +236,22 @@ declare class CngxDataGridAccordion implements CngxDataGridAccordionContext {
|
|
|
218
236
|
* (unlike `[skin]`).
|
|
219
237
|
*/
|
|
220
238
|
readonly columns: _angular_core.InputSignal<string | undefined>;
|
|
239
|
+
/**
|
|
240
|
+
* Opt-in maximum block size that turns the grid into a bounded vertical scrollport:
|
|
241
|
+
* the column head pins to the top and the footer to the bottom while the rows scroll
|
|
242
|
+
* between them. A number is taken as `px`; a string is any CSS length (`'40rem'`).
|
|
243
|
+
* Unset leaves the grid content-height - no scrollport, no pinning - byte-identical
|
|
244
|
+
* to before. Reflects onto `--cngx-dga-max-block-size`, the same token a skin may set
|
|
245
|
+
* directly: the input is the ergonomic front door, the token the escape hatch.
|
|
246
|
+
*/
|
|
247
|
+
readonly maxBlockSize: _angular_core.InputSignal<string | number | undefined>;
|
|
248
|
+
/**
|
|
249
|
+
* `[maxBlockSize]` resolved to a CSS length for the host binding. A bare number (or
|
|
250
|
+
* a unit-less numeric string via attribute binding) becomes `px`; any other string
|
|
251
|
+
* passes through untouched. `null` removes the inline property so the registered
|
|
252
|
+
* `none` initial wins and the grid stays unbounded. Primitive, so `Object.is` dedupes.
|
|
253
|
+
*/
|
|
254
|
+
protected readonly maxBlockSizeVar: _angular_core.Signal<string | null>;
|
|
221
255
|
/**
|
|
222
256
|
* Heading level (2-6) every row's `role="heading"` wrapper reflects via
|
|
223
257
|
* `aria-level`. Clamped into the valid ARIA range so a stray `0`/`9` can never
|
|
@@ -257,7 +291,7 @@ declare class CngxDataGridAccordion implements CngxDataGridAccordionContext {
|
|
|
257
291
|
*/
|
|
258
292
|
protected readonly resolvedColumns: _angular_core.Signal<string>;
|
|
259
293
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDataGridAccordion, never>;
|
|
260
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxDataGridAccordion, "cngx-data-grid-accordion", ["cngxDataGridAccordion"], { "filterTerm": { "alias": "filterTerm"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "headingLevel": { "alias": "headingLevel"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; }, { "filterTerm": "filterTermChange"; }, ["header", "firstRow"], ["*"], true, [{ directive: typeof i1.CngxAccordion; inputs: { "multi": "multi"; "openIds": "openIds"; }; outputs: { "openIdsChange": "openIdsChange"; }; }, { directive: typeof i2.CngxSort; inputs: { "cngxSortActive": "sortActive"; "cngxSortDirection": "sortDirection"; "cngxSortInitial": "initialSort"; "multiSort": "multiSort"; }; outputs: { "sortChange": "sortChange"; }; }, { directive: typeof i2.CngxFilter; inputs: { "cngxFilter": "filterPredicate"; }; outputs: { "filterChange": "filterChange"; }; }]>;
|
|
294
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxDataGridAccordion, "cngx-data-grid-accordion", ["cngxDataGridAccordion"], { "filterTerm": { "alias": "filterTerm"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": false; "isSignal": true; }; "maxBlockSize": { "alias": "maxBlockSize"; "required": false; "isSignal": true; }; "headingLevel": { "alias": "headingLevel"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; }, { "filterTerm": "filterTermChange"; }, ["header", "firstRow"], ["*"], true, [{ directive: typeof i1.CngxAccordion; inputs: { "multi": "multi"; "openIds": "openIds"; }; outputs: { "openIdsChange": "openIdsChange"; }; }, { directive: typeof i2.CngxSort; inputs: { "cngxSortActive": "sortActive"; "cngxSortDirection": "sortDirection"; "cngxSortInitial": "initialSort"; "multiSort": "multiSort"; }; outputs: { "sortChange": "sortChange"; }; }, { directive: typeof i2.CngxFilter; inputs: { "cngxFilter": "filterPredicate"; }; outputs: { "filterChange": "filterChange"; }; }]>;
|
|
261
295
|
}
|
|
262
296
|
|
|
263
297
|
/** Inline alignment of a data-grid cell within its column track. */
|
|
@@ -415,16 +449,22 @@ declare class CngxDgaRowError {
|
|
|
415
449
|
/**
|
|
416
450
|
* A disclosure row in a {@link CngxDataGridAccordion}. Renders the APG-correct
|
|
417
451
|
* trio: a `role="heading"` wrapper carrying the group's `aria-level`, a
|
|
418
|
-
* `cngxAccordionPanel` summary `<button>`
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
452
|
+
* `cngxAccordionPanel` summary `<button>` that is the full-row disclosure
|
|
453
|
+
* trigger, and a `role="region"` detail zone named back at the primary cell via
|
|
454
|
+
* `aria-labelledby`. Expansion is derived from the coordinator (Pillar 1); the
|
|
455
|
+
* button self-wires keyboard nav through the registration brain, so arrow keys
|
|
456
|
+
* rove across rows even though each summary lives in its own component view.
|
|
457
|
+
*
|
|
458
|
+
* The projected `cngxDgaCell`s are laid OVER the trigger, not inside it: a
|
|
459
|
+
* `<button>` accepts phrasing content only, so a cell holding flow content (a
|
|
460
|
+
* chart, a table, a nested list) could never live in the button. The cells share
|
|
461
|
+
* the button's grid row, painted above it, and are `pointer-events: none`, so a
|
|
462
|
+
* click on a passive cell falls through to the trigger and toggles the row, while
|
|
463
|
+
* interactive cell content (a link, a control) re-enables its own clicks. The
|
|
464
|
+
* cell marked `primary` supplies the row's accessible name through the button's
|
|
465
|
+
* `aria-labelledby` (falling back to the whole cells row when none is marked), so
|
|
466
|
+
* a screen reader hears a list of expandable sections rather than a wall of cell
|
|
467
|
+
* text.
|
|
428
468
|
*
|
|
429
469
|
* @category ui/data-grid-accordion
|
|
430
470
|
* @docsKind primary
|
|
@@ -432,6 +472,8 @@ declare class CngxDgaRowError {
|
|
|
432
472
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/data-grid-accordion/data-grid-row.component.ts
|
|
433
473
|
* @since 0.1.0
|
|
434
474
|
* @relatedTo CngxDataGridAccordion, CngxDgCell, CngxAccordionPanel
|
|
475
|
+
* @slot cngxDgaRowBusy Rendered over the row while its detail loads.
|
|
476
|
+
* @slot cngxDgaRowError Rendered when the row's detail failed to load.
|
|
435
477
|
*
|
|
436
478
|
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/master-detail</example-url>
|
|
437
479
|
* <example-url>http://localhost:4200/#/ui/data-grid-accordion/report</example-url>
|
|
@@ -468,6 +510,7 @@ declare class CngxDataGridRow {
|
|
|
468
510
|
protected readonly grid: _cngx_ui_data_grid_accordion.CngxDataGridAccordionContext;
|
|
469
511
|
protected readonly regionId: string;
|
|
470
512
|
protected readonly headerId: string;
|
|
513
|
+
protected readonly cellsId: string;
|
|
471
514
|
/**
|
|
472
515
|
* Projected cells; the `primary` one supplies the row's accessible name. Public
|
|
473
516
|
* so {@link CngxDataGridAccordion} can read the primary-column index (for the
|
|
@@ -475,11 +518,21 @@ declare class CngxDataGridRow {
|
|
|
475
518
|
*/
|
|
476
519
|
readonly cells: _angular_core.Signal<readonly CngxDgCell[]>;
|
|
477
520
|
/**
|
|
478
|
-
* IDREF of the
|
|
479
|
-
*
|
|
480
|
-
*
|
|
521
|
+
* IDREF of the cell marked `primary`, or `null` when none is. Feeds
|
|
522
|
+
* {@link summaryLabelledBy}, the single name source both the summary button and the
|
|
523
|
+
* detail region reference. A primitive, so `Object.is` dedupes.
|
|
481
524
|
*/
|
|
482
525
|
protected readonly primaryId: _angular_core.Signal<string | null>;
|
|
526
|
+
/**
|
|
527
|
+
* Accessible name source for the summary button AND the detail region. The cells are
|
|
528
|
+
* laid over the button rather than inside it, so the button has no intrinsic text to
|
|
529
|
+
* name itself from - this points at the `primary` cell when one exists, else at the
|
|
530
|
+
* whole cells row (`cellsId`), reproducing the old name-from-projected-content
|
|
531
|
+
* fallback. Both surfaces read it so they stay symmetric: a no-primary row names both
|
|
532
|
+
* by the cells row rather than naming the button and leaving the region blank. A
|
|
533
|
+
* primitive, so `Object.is` dedupes.
|
|
534
|
+
*/
|
|
535
|
+
protected readonly summaryLabelledBy: _angular_core.Signal<string>;
|
|
483
536
|
/** Whether this row's region is open, derived from the coordinator's open-set. */
|
|
484
537
|
protected readonly expanded: _angular_core.Signal<boolean>;
|
|
485
538
|
/** Per-instance busy slot; absent means the CSS skeleton default renders. */
|
|
@@ -744,10 +797,14 @@ declare class CngxDgaFilterField {
|
|
|
744
797
|
*
|
|
745
798
|
* ```html
|
|
746
799
|
* <cngx-dga-footer>
|
|
747
|
-
* <span [cngxDgaCount]="visibleRows().length"></span>
|
|
800
|
+
* <span cngxDgaCell [cngxDgaCount]="visibleRows().length"></span>
|
|
748
801
|
* </cngx-dga-footer>
|
|
749
802
|
* ```
|
|
750
803
|
*
|
|
804
|
+
* `cngxDgaCell` puts the count in the first content column alongside every other
|
|
805
|
+
* grid cell. It is not required - the footer already places a bare first child in
|
|
806
|
+
* that column - but it is the consistent form the rest of the grid's cells use.
|
|
807
|
+
*
|
|
751
808
|
* The noun is English by default (`result` / `results`); a consumer localises via
|
|
752
809
|
* `cngxDgaCountSingular` / `cngxDgaCountPlural`.
|
|
753
810
|
*
|