@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8
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 +224 -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 +102 -35
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +112 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
- 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 +194 -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 +149 -34
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
- 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 +1022 -439
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +75 -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 +314 -141
- 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 +487 -178
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- 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 +191 -68
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +10 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +74 -21
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +70 -26
- 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/styles/mat-tabs.css +9 -10
- package/overlay/README.md +9 -4
- package/package.json +4 -4
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +13 -1
- 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 +91 -26
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +154 -58
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +147 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +98 -6
- package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +594 -56
- package/types/cngx-ui-mat-accordion.d.ts +29 -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 +207 -14
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +403 -129
- 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 +66 -27
- package/types/cngx-ui-tabs.d.ts +2 -2
- package/types/cngx-ui-timeline.d.ts +23 -7
- package/types/cngx-ui-toc.d.ts +80 -13
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, Signal } from '@angular/core';
|
|
2
|
+
import { TemplateRef, InjectionToken, Signal } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@cngx/common/interactive';
|
|
4
4
|
import { CngxContextMenuTriggerPopoverRef, CngxMenuHost, CngxMenu, CngxMenuSubmenuWiring, CngxMenuItemIcon, CngxMenuSubmenuPopoverRef } from '@cngx/common/interactive';
|
|
5
5
|
import * as i1 from '@cngx/common/popover';
|
|
@@ -65,6 +65,32 @@ interface CngxContextMenuPanel<T = unknown> {
|
|
|
65
65
|
readonly context: Signal<T | null>;
|
|
66
66
|
/** Store the per-open datum. Called by the trigger before the popover opens. */
|
|
67
67
|
setContext(value: T | null): void;
|
|
68
|
+
/**
|
|
69
|
+
* @internal The trigger that owns the current open, `null` while unowned.
|
|
70
|
+
* N triggers can dock one panel; only the opener may report
|
|
71
|
+
* `aria-expanded="true"`, forward keydown, and run its dismiss binding.
|
|
72
|
+
* A direct open (`openAsSubmenu`, programmatic `popover.show()`) claims no
|
|
73
|
+
* owner, so every docked trigger stays collapsed. Optional: an ejected
|
|
74
|
+
* panel skin may omit it, in which case a docked trigger falls back to
|
|
75
|
+
* mirroring plain popover visibility.
|
|
76
|
+
*/
|
|
77
|
+
readonly openOwner?: Signal<unknown>;
|
|
78
|
+
/**
|
|
79
|
+
* @internal Claim the current open for `owner`. Called by the opening
|
|
80
|
+
* trigger synchronously in its open gesture, before the popover shows, so
|
|
81
|
+
* the handler registration that follows belongs to the opener even when
|
|
82
|
+
* other triggers dock the same panel. A claim always marks a ROOT open -
|
|
83
|
+
* the panel resets any sticky submenu policy a previous `openAsSubmenu`
|
|
84
|
+
* installed. Optional alongside {@link openOwner}.
|
|
85
|
+
*/
|
|
86
|
+
claimOpen?(owner: unknown): void;
|
|
87
|
+
/**
|
|
88
|
+
* @internal Release the open claim if `owner` still holds it. A trigger
|
|
89
|
+
* calls this when the popover closes, when its panel binding swaps, and on
|
|
90
|
+
* destroy; the owner guard keeps a stale release from clobbering a newer
|
|
91
|
+
* claim. Optional alongside {@link openOwner}.
|
|
92
|
+
*/
|
|
93
|
+
releaseOpen?(owner: unknown): void;
|
|
68
94
|
/**
|
|
69
95
|
* @internal Open this panel as a nested submenu of a parent item: flank the
|
|
70
96
|
* inline-end (`right-start` + the submenu flip chain), open non-exclusively so
|
|
@@ -110,6 +136,14 @@ interface CngxContextMenuPanel<T = unknown> {
|
|
|
110
136
|
*/
|
|
111
137
|
noteActiveSubmenuOpened?(): void;
|
|
112
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* @internal DI token the panel provides via `useExisting` so a projected
|
|
141
|
+
* `CngxContextMenuItem` can read its enclosing panel's `context()` and mirror
|
|
142
|
+
* it into a sibling-declared submenu. Not part of the public API - the child
|
|
143
|
+
* talks to the panel through this structural seam rather than injecting the
|
|
144
|
+
* concrete `CngxContextMenu` class (`CNGX_MENU_HOST` precedent).
|
|
145
|
+
*/
|
|
146
|
+
declare const CNGX_CONTEXT_MENU_PANEL: InjectionToken<CngxContextMenuPanel<unknown>>;
|
|
113
147
|
|
|
114
148
|
/**
|
|
115
149
|
* Declarative context-menu panel. Stacks `CngxPopover` (the top-layer popup
|
|
@@ -156,6 +190,7 @@ interface CngxContextMenuPanel<T = unknown> {
|
|
|
156
190
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu.component.ts
|
|
157
191
|
* @since 0.1.0
|
|
158
192
|
* @relatedTo CngxContextMenuFor, CngxContextMenuItem, CngxContextMenuContent, CngxMenu, CngxPopover
|
|
193
|
+
* @slot cngxContextMenuContent Replaces the projected items with lazy content rendered only while the menu is open; gets the trigger's per-open datum as $implicit (let-row).
|
|
159
194
|
*/
|
|
160
195
|
declare class CngxContextMenu<T = unknown> implements CngxContextMenuPanel<T> {
|
|
161
196
|
/** The popover surface this panel drives. Consumed by the trigger core. */
|
|
@@ -164,6 +199,16 @@ declare class CngxContextMenu<T = unknown> implements CngxContextMenuPanel<T> {
|
|
|
164
199
|
readonly menuHost: CngxMenu;
|
|
165
200
|
/** Per-open datum set by the trigger before `show()`. */
|
|
166
201
|
private readonly datum;
|
|
202
|
+
/** Backing state for {@link openOwner}. */
|
|
203
|
+
private readonly openOwnerState;
|
|
204
|
+
/**
|
|
205
|
+
* @internal The trigger that owns the current open, `null` while unowned.
|
|
206
|
+
* Claimed by the opening `CngxContextMenuFor` before the popover shows;
|
|
207
|
+
* direct opens (`openAsSubmenu`, programmatic `popover.show()`) leave it
|
|
208
|
+
* `null`, so docked triggers keep `aria-expanded="false"` for opens they
|
|
209
|
+
* did not perform.
|
|
210
|
+
*/
|
|
211
|
+
readonly openOwner: _angular_core.Signal<unknown>;
|
|
167
212
|
/**
|
|
168
213
|
* The datum the menu opened over while visible, `null` once closed. Gated on
|
|
169
214
|
* `popover.isVisible()` so the reset on dismiss is derived, not synced.
|
|
@@ -175,12 +220,16 @@ declare class CngxContextMenu<T = unknown> implements CngxContextMenuPanel<T> {
|
|
|
175
220
|
* `contextmenu` event path, before the popover opens.
|
|
176
221
|
*/
|
|
177
222
|
setContext(value: T | null): void;
|
|
223
|
+
/** @internal Claim the current open for `owner`. See {@link CngxContextMenuPanel.claimOpen}. */
|
|
224
|
+
claimOpen(owner: unknown): void;
|
|
225
|
+
/** @internal Release the open claim if `owner` still holds it. */
|
|
226
|
+
releaseOpen(owner: unknown): void;
|
|
178
227
|
/**
|
|
179
228
|
* @internal Open this panel as a nested submenu of a parent item. Installs the
|
|
180
229
|
* inline-end placement + flip chain, opens non-exclusively (the parent panel
|
|
181
230
|
* survives), mirrors the parent's per-open datum, then shows. Owns the submenu
|
|
182
231
|
* placement policy so `CngxContextMenuItem` drives one seam rather than
|
|
183
|
-
* reaching into the popover's `@internal` override
|
|
232
|
+
* reaching into the popover's `@internal` override setters - the ejected item
|
|
184
233
|
* skin stays off `CngxPopover` internals (decompose).
|
|
185
234
|
*/
|
|
186
235
|
openAsSubmenu(context: T | null): void;
|
|
@@ -220,19 +269,28 @@ declare class CngxContextMenu<T = unknown> implements CngxContextMenuPanel<T> {
|
|
|
220
269
|
* pointer coordinates on `contextmenu` (right-click) or `Shift+F10`, feeding
|
|
221
270
|
* the panel a per-open datum so one declaration serves many targets.
|
|
222
271
|
*
|
|
223
|
-
*
|
|
272
|
+
* Three ways to obtain the datum `T`:
|
|
224
273
|
* - `[cngxContextMenuData]` - a fixed datum for this single target.
|
|
225
274
|
* - `[cngxContextMenuResolve]` - a resolver run against the `contextmenu`
|
|
226
275
|
* event, so a container (table, grid, treetable, virtualized list) keeps a
|
|
227
276
|
* single trigger instance and derives the row from `event.target`. The
|
|
228
277
|
* resolver wins when both are bound. A `null` resolver result leaves the
|
|
229
278
|
* native context menu untouched (no `preventDefault`, no open).
|
|
279
|
+
* - `[cngxContextMenuKeyboardResolve]` - the keyboard counterpart, run
|
|
280
|
+
* against the `Shift+F10` keydown so a delegated container derives the
|
|
281
|
+
* row from the focused element (`event.target`). Without it a keyboard
|
|
282
|
+
* open commits `[cngxContextMenuData]` (or `null` in resolver-only mode).
|
|
230
283
|
*
|
|
231
284
|
* A thin shell over `createContextMenuTriggerCore` (shared with
|
|
232
285
|
* `CngxContextMenuTrigger`): the core owns the preventDefault decision through
|
|
233
286
|
* its `resolveOpen` seam, so the veto lives in one place and this directive
|
|
234
287
|
* only feeds the resolver.
|
|
235
288
|
*
|
|
289
|
+
* Many triggers may dock the same panel. Each open claims ownership on the
|
|
290
|
+
* panel, so only the opening trigger reports `aria-expanded="true"`, forwards
|
|
291
|
+
* the panel's keydown into its core, and runs its dismiss binding - sibling
|
|
292
|
+
* triggers stay collapsed and inert for opens they did not perform.
|
|
293
|
+
*
|
|
236
294
|
* ```html
|
|
237
295
|
* <tr [cngxContextMenuFor]="menu" [cngxContextMenuData]="row" tabindex="0"></tr>
|
|
238
296
|
* <cngx-context-menu #menu ariaLabel="Row actions">…</cngx-context-menu>
|
|
@@ -254,16 +312,50 @@ declare class CngxContextMenuFor<T = unknown> {
|
|
|
254
312
|
/**
|
|
255
313
|
* Resolver run against the `contextmenu` event. Return the datum to open
|
|
256
314
|
* with, or `null` to let the native menu show. Wins over `[cngxContextMenuData]`.
|
|
315
|
+
* Keyboard opens (`Shift+F10`) carry no pointer event - they resolve via
|
|
316
|
+
* `[cngxContextMenuKeyboardResolve]`, or fall back to the fixed datum.
|
|
257
317
|
*/
|
|
258
318
|
readonly resolve: _angular_core.InputSignal<((event: MouseEvent) => T | null) | undefined>;
|
|
259
|
-
/**
|
|
319
|
+
/**
|
|
320
|
+
* Resolver run against the `Shift+F10` keydown. `event.target` is the
|
|
321
|
+
* focused element inside this trigger's host, so a delegated container
|
|
322
|
+
* (focusable rows, roving grid cells) derives the row for keyboard users
|
|
323
|
+
* exactly like `[cngxContextMenuResolve]` does for pointer users. Return
|
|
324
|
+
* `null` to skip the open (the browser's own Shift+F10 behaviour stays
|
|
325
|
+
* untouched). Wins over `[cngxContextMenuData]` for keyboard opens.
|
|
326
|
+
*/
|
|
327
|
+
readonly keyboardResolve: _angular_core.InputSignal<((event: KeyboardEvent) => T | null) | undefined>;
|
|
328
|
+
/**
|
|
329
|
+
* `true` while the panel is visible AND this trigger performed the open.
|
|
330
|
+
* N triggers can dock one panel; each reports `aria-expanded` only for its
|
|
331
|
+
* own opens (a shared panel opened by a sibling trigger, `openAsSubmenu`,
|
|
332
|
+
* or a programmatic `popover.show()` leaves this trigger collapsed).
|
|
333
|
+
* Panels without the ownership seam fall back to plain visibility.
|
|
334
|
+
*/
|
|
260
335
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
261
336
|
private readonly core;
|
|
337
|
+
/** Panel-forwarded seams, stable identities so registration is idempotent. */
|
|
338
|
+
private readonly forwardKeydown;
|
|
339
|
+
private readonly forwardActivation;
|
|
340
|
+
private readonly forwardSubmenuNote;
|
|
341
|
+
/**
|
|
342
|
+
* Claim the shared panel for this trigger's open: record ownership, then
|
|
343
|
+
* register the keydown/activation/submenu-note forwarders. Registration
|
|
344
|
+
* happens on open (not on construction), so the OPENING trigger owns the
|
|
345
|
+
* handlers instead of whichever sibling was constructed last.
|
|
346
|
+
*/
|
|
347
|
+
private claimPanel;
|
|
348
|
+
/**
|
|
349
|
+
* Clear the panel's forwarders and release the claim - but only while this
|
|
350
|
+
* trigger still owns the open (or the panel has no ownership seam). A stale
|
|
351
|
+
* release must never clobber a sibling's newer claim.
|
|
352
|
+
*/
|
|
353
|
+
private releasePanel;
|
|
262
354
|
constructor();
|
|
263
355
|
protected handleContextMenu(event: MouseEvent): void;
|
|
264
356
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
265
357
|
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>;
|
|
358
|
+
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; }; "keyboardResolve": { "alias": "cngxContextMenuKeyboardResolve"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
267
359
|
}
|
|
268
360
|
|
|
269
361
|
/**
|
|
@@ -463,5 +555,5 @@ declare class CngxContextMenuItemRadio {
|
|
|
463
555
|
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
556
|
}
|
|
465
557
|
|
|
466
|
-
export { CngxContextMenu, CngxContextMenuContent, CngxContextMenuDivider, CngxContextMenuFor, CngxContextMenuItem, CngxContextMenuItemCheckbox, CngxContextMenuItemRadio };
|
|
558
|
+
export { CNGX_CONTEXT_MENU_PANEL, CngxContextMenu, CngxContextMenuContent, CngxContextMenuDivider, CngxContextMenuFor, CngxContextMenuItem, CngxContextMenuItemCheckbox, CngxContextMenuItemRadio };
|
|
467
559
|
export type { CngxContextMenuContentContext, CngxContextMenuPanel };
|