@cngx/ui 0.0.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +550 -0
- package/action-button/README.md +98 -0
- package/empty-state/README.md +103 -0
- package/feedback/README.md +33 -0
- package/fesm2022/cngx-ui-action-button.mjs +319 -0
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -0
- package/fesm2022/cngx-ui-empty-state.mjs +138 -0
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -0
- package/fesm2022/cngx-ui-feedback.mjs +2962 -0
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -0
- package/fesm2022/cngx-ui-layout.mjs +89 -0
- package/fesm2022/cngx-ui-layout.mjs.map +1 -0
- package/fesm2022/cngx-ui-mat-stepper.mjs +567 -0
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -0
- package/fesm2022/cngx-ui-mat-tabs.mjs +1405 -0
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -0
- package/fesm2022/cngx-ui-material.mjs +79 -0
- package/fesm2022/cngx-ui-material.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +91 -0
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -0
- package/fesm2022/cngx-ui-sidenav.mjs +521 -0
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -0
- package/fesm2022/cngx-ui-skeleton.mjs +158 -0
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -0
- package/fesm2022/cngx-ui-speak.mjs +112 -0
- package/fesm2022/cngx-ui-speak.mjs.map +1 -0
- package/fesm2022/cngx-ui-stepper.mjs +312 -0
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -0
- package/fesm2022/cngx-ui-tabs.mjs +507 -0
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -0
- package/fesm2022/cngx-ui.mjs +45 -0
- package/fesm2022/cngx-ui.mjs.map +1 -0
- package/layout/README.md +133 -0
- package/mat-stepper/README.md +34 -0
- package/mat-tabs/README.md +163 -0
- package/mat-tabs/styles/mat-tabs.css +233 -0
- package/material/README.md +90 -0
- package/overlay/README.md +99 -0
- package/package.json +98 -0
- package/sidenav/README.md +127 -0
- package/skeleton/README.md +98 -0
- package/speak/README.md +93 -0
- package/speak/speak-button-theme.scss +78 -0
- package/stepper/README.md +40 -0
- package/tabs/README.md +28 -0
- package/types/cngx-ui-action-button.d.ts +126 -0
- package/types/cngx-ui-empty-state.d.ts +41 -0
- package/types/cngx-ui-feedback.d.ts +1174 -0
- package/types/cngx-ui-layout.d.ts +56 -0
- package/types/cngx-ui-mat-stepper.d.ts +234 -0
- package/types/cngx-ui-mat-tabs.d.ts +664 -0
- package/types/cngx-ui-material.d.ts +36 -0
- package/types/cngx-ui-overlay.d.ts +57 -0
- package/types/cngx-ui-sidenav.d.ts +209 -0
- package/types/cngx-ui-skeleton.d.ts +97 -0
- package/types/cngx-ui-speak.d.ts +31 -0
- package/types/cngx-ui-stepper.d.ts +129 -0
- package/types/cngx-ui-tabs.d.ts +165 -0
- package/types/cngx-ui.d.ts +18 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { PageEvent } from '@angular/material/paginator';
|
|
3
|
+
import { CngxPaginate } from '@cngx/common/data';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Material paginator wrapper that connects to a {@link CngxPaginate} directive
|
|
7
|
+
* via an explicit `[cngxPaginateRef]` input — no ancestor injection.
|
|
8
|
+
*
|
|
9
|
+
* ```html
|
|
10
|
+
* <div cngxPaginate #pg="cngxPaginate" [total]="items.length">
|
|
11
|
+
* <!-- table / list -->
|
|
12
|
+
* </div>
|
|
13
|
+
* <cngx-mat-paginator [cngxPaginateRef]="pg" />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* For SmartDataSource integration, expose `filteredCount` from the data source
|
|
17
|
+
* and bind it to `[total]` on the element that carries `cngxPaginate`:
|
|
18
|
+
* ```html
|
|
19
|
+
* <div cngxPaginate #pg="cngxPaginate" [total]="ds.filteredCount()">
|
|
20
|
+
* <mat-table [dataSource]="ds" />
|
|
21
|
+
* </div>
|
|
22
|
+
* <cngx-mat-paginator [cngxPaginateRef]="pg" />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare class CngxMatPaginator {
|
|
26
|
+
/** The `CngxPaginate` directive instance to connect to. */
|
|
27
|
+
readonly cngxPaginateRef: _angular_core.InputSignal<CngxPaginate>;
|
|
28
|
+
/** Options for the page-size selector. */
|
|
29
|
+
readonly pageSizeOptions: _angular_core.InputSignal<number[]>;
|
|
30
|
+
protected readonly ref: _angular_core.InputSignal<CngxPaginate>;
|
|
31
|
+
protected handlePage(event: PageEvent): void;
|
|
32
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMatPaginator, never>;
|
|
33
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMatPaginator, "cngx-mat-paginator", never, { "cngxPaginateRef": { "alias": "cngxPaginateRef"; "required": true; "isSignal": true; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { CngxMatPaginator };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Type, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { OverlayRef, OverlayConfig } from '@angular/cdk/overlay';
|
|
4
|
+
import * as rxjs from 'rxjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Typed wrapper around a CDK OverlayRef that exposes a close result stream.
|
|
8
|
+
*/
|
|
9
|
+
declare class CngxOverlayRef<R = unknown> {
|
|
10
|
+
private readonly cdkRef;
|
|
11
|
+
private readonly _afterClosed;
|
|
12
|
+
/** Emits once with the close result when the overlay is dismissed, then completes. */
|
|
13
|
+
readonly afterClosed$: rxjs.Observable<R | undefined>;
|
|
14
|
+
constructor(cdkRef: OverlayRef);
|
|
15
|
+
/** Closes the overlay, emitting `result` on `afterClosed$`, then disposes the CDK ref. */
|
|
16
|
+
close(result?: R): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Config accepted by {@link CngxOverlay.open}. Partial alias of CDK's
|
|
21
|
+
* {@link OverlayConfig} — every field is optional and falls back to
|
|
22
|
+
* the CDK overlay default.
|
|
23
|
+
*/
|
|
24
|
+
type CngxOverlayConfig = Partial<OverlayConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Thin service over CDK Overlay that returns a typed CngxOverlayRef.
|
|
27
|
+
*
|
|
28
|
+
* Must be provided via `provideOverlay()` in application or component providers.
|
|
29
|
+
*
|
|
30
|
+
* // app.config.ts
|
|
31
|
+
* provideOverlay()
|
|
32
|
+
*
|
|
33
|
+
* // usage
|
|
34
|
+
* const ref = overlayService.open(MyComponent, { hasBackdrop: true });
|
|
35
|
+
* ref.afterClosed$.subscribe(result => console.log(result));
|
|
36
|
+
*/
|
|
37
|
+
declare class CngxOverlay {
|
|
38
|
+
private readonly overlay;
|
|
39
|
+
private readonly injector;
|
|
40
|
+
/**
|
|
41
|
+
* Opens `component` in a CDK overlay panel and returns a typed ref.
|
|
42
|
+
*
|
|
43
|
+
* Defaults to a centered, backdropped panel. Merge `config` to override
|
|
44
|
+
* position strategy, scroll strategy, or any other CDK `OverlayConfig` option.
|
|
45
|
+
*
|
|
46
|
+
* @param component Component class to attach as a portal.
|
|
47
|
+
* @param config CDK overlay configuration overrides.
|
|
48
|
+
*/
|
|
49
|
+
open<C, R = unknown>(component: Type<C>, config?: CngxOverlayConfig): CngxOverlayRef<R>;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxOverlay, never>;
|
|
51
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CngxOverlay>;
|
|
52
|
+
}
|
|
53
|
+
/** Provides `CngxOverlay` as an environment-scoped service. */
|
|
54
|
+
declare function provideOverlay(): EnvironmentProviders;
|
|
55
|
+
|
|
56
|
+
export { CngxOverlay, CngxOverlayRef, provideOverlay };
|
|
57
|
+
export type { CngxOverlayConfig };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ElementRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Logical position — flips in RTL. */
|
|
5
|
+
type SidenavPosition = 'start' | 'end';
|
|
6
|
+
/**
|
|
7
|
+
* How the sidenav interacts with the content area.
|
|
8
|
+
*
|
|
9
|
+
* - `'over'` — floats above content (overlay + backdrop)
|
|
10
|
+
* - `'push'` — pushes content aside when open
|
|
11
|
+
* - `'side'` — always visible, content permanently offset
|
|
12
|
+
* - `'mini'` — collapsed icon rail (miniWidth), expands to full width on hover
|
|
13
|
+
*/
|
|
14
|
+
type SidenavMode = 'over' | 'push' | 'side' | 'mini';
|
|
15
|
+
/**
|
|
16
|
+
* Declarative sidebar component that composes drawer, focus trap,
|
|
17
|
+
* scroll lock, swipe dismiss, and media query atoms internally.
|
|
18
|
+
*
|
|
19
|
+
* Supports responsive mode switching, two-way `[(opened)]` binding,
|
|
20
|
+
* and content projection via header/footer slots.
|
|
21
|
+
*
|
|
22
|
+
* Use inside `CngxSidenavLayout` for dual-sidebar support and
|
|
23
|
+
* shared backdrop coordination.
|
|
24
|
+
*
|
|
25
|
+
* ```html
|
|
26
|
+
* <cngx-sidenav-layout>
|
|
27
|
+
* <cngx-sidenav position="start" [(opened)]="navOpen"
|
|
28
|
+
* [responsive]="'(min-width: 1024px)'">
|
|
29
|
+
* <cngx-sidenav-header>Logo</cngx-sidenav-header>
|
|
30
|
+
* <a cngxNavLink [active]="true">Dashboard</a>
|
|
31
|
+
* <cngx-sidenav-footer>v1.0</cngx-sidenav-footer>
|
|
32
|
+
* </cngx-sidenav>
|
|
33
|
+
* <cngx-sidenav-content>
|
|
34
|
+
* <router-outlet />
|
|
35
|
+
* </cngx-sidenav-content>
|
|
36
|
+
* </cngx-sidenav-layout>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
declare class CngxSidenav {
|
|
40
|
+
/** Logical position: `'start'` (default left in LTR) or `'end'` (right in LTR). */
|
|
41
|
+
readonly position: _angular_core.InputSignal<SidenavPosition>;
|
|
42
|
+
/** Accessible label for the complementary landmark. */
|
|
43
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
44
|
+
/** Drawer mode. Overridden by `responsive` when set. */
|
|
45
|
+
readonly mode: _angular_core.InputSignal<SidenavMode>;
|
|
46
|
+
/**
|
|
47
|
+
* CSS media query string for responsive mode switching.
|
|
48
|
+
* When the query matches, mode becomes `'side'` (permanent).
|
|
49
|
+
* When it doesn't match, mode becomes `'over'` (overlay).
|
|
50
|
+
*/
|
|
51
|
+
readonly responsive: _angular_core.InputSignal<string | undefined>;
|
|
52
|
+
/** Width of the sidenav panel. Supports two-way `[(width)]` for resize. */
|
|
53
|
+
readonly width: _angular_core.ModelSignal<string>;
|
|
54
|
+
/** Width of the collapsed rail in `mini` mode. Any CSS value. */
|
|
55
|
+
readonly miniWidth: _angular_core.InputSignal<string>;
|
|
56
|
+
/** Whether hovering the mini rail expands the sidenav to full width. */
|
|
57
|
+
readonly expandOnHover: _angular_core.InputSignal<boolean>;
|
|
58
|
+
/** Whether the sidebar is user-resizable via a drag handle. */
|
|
59
|
+
readonly resizable: _angular_core.InputSignal<boolean>;
|
|
60
|
+
/** Minimum width constraint during resize. */
|
|
61
|
+
readonly minWidth: _angular_core.InputSignal<string>;
|
|
62
|
+
/** Maximum width constraint during resize. */
|
|
63
|
+
readonly maxWidth: _angular_core.InputSignal<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Keyboard shortcut to toggle the sidenav, e.g. `'ctrl+b'` or `'meta+b'`.
|
|
66
|
+
* Uses `ctrl` on Windows/Linux and `meta` (Cmd) on macOS automatically
|
|
67
|
+
* when `'mod+<key>'` syntax is used.
|
|
68
|
+
*/
|
|
69
|
+
readonly shortcut: _angular_core.InputSignal<string | undefined>;
|
|
70
|
+
/** Whether a resize drag is in progress. */
|
|
71
|
+
private readonly resizingState;
|
|
72
|
+
readonly resizing: _angular_core.Signal<boolean>;
|
|
73
|
+
/** Two-way opened state. Supports `[(opened)]="signal"`. */
|
|
74
|
+
readonly opened: _angular_core.ModelSignal<boolean>;
|
|
75
|
+
/** Whether the mini-mode rail is currently expanded (hover or programmatic). */
|
|
76
|
+
private readonly expandedState;
|
|
77
|
+
readonly expanded: _angular_core.Signal<boolean>;
|
|
78
|
+
/** @internal Reference to host element for layout positioning. */
|
|
79
|
+
readonly elementRef: ElementRef<any>;
|
|
80
|
+
private readonly mediaMatches;
|
|
81
|
+
/** Resolved mode — responsive overrides to `'side'` when matching, falls back to `mode()`. */
|
|
82
|
+
readonly effectiveMode: _angular_core.Signal<SidenavMode>;
|
|
83
|
+
/** Whether this sidenav is in overlay mode (over). */
|
|
84
|
+
readonly isOverlay: _angular_core.Signal<boolean>;
|
|
85
|
+
/** Resolved width — mini mode uses miniWidth unless expanded. */
|
|
86
|
+
readonly effectiveWidth: _angular_core.Signal<string>;
|
|
87
|
+
private readonly doc;
|
|
88
|
+
private readonly win;
|
|
89
|
+
/** Tracks the previous effective mode to detect transitions. */
|
|
90
|
+
private readonly prevMode;
|
|
91
|
+
constructor();
|
|
92
|
+
/** Opens the sidenav. */
|
|
93
|
+
open(): void;
|
|
94
|
+
/** Closes the sidenav (only in over/push mode). No-op in side/mini mode. */
|
|
95
|
+
close(): void;
|
|
96
|
+
/** Toggles the sidenav. */
|
|
97
|
+
toggle(): void;
|
|
98
|
+
/** @internal Close only if in overlay mode (for Escape key, click-outside). */
|
|
99
|
+
closeIfOverlay(): void;
|
|
100
|
+
/** Expand the mini rail to full width. */
|
|
101
|
+
expand(): void;
|
|
102
|
+
/** Collapse the expanded mini rail back to miniWidth. */
|
|
103
|
+
collapse(): void;
|
|
104
|
+
/** @internal */
|
|
105
|
+
handleMouseEnter(): void;
|
|
106
|
+
/** @internal */
|
|
107
|
+
handleMouseLeave(): void;
|
|
108
|
+
/** @internal Parse a CSS px value to a number. */
|
|
109
|
+
widthPx: _angular_core.Signal<number>;
|
|
110
|
+
minWidthPx: _angular_core.Signal<number>;
|
|
111
|
+
maxWidthPx: _angular_core.Signal<number>;
|
|
112
|
+
/** @internal */
|
|
113
|
+
handleResizeStart(e: PointerEvent): void;
|
|
114
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenav, never>;
|
|
115
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenav, "cngx-sidenav", ["cngxSidenav"], { "position": { "alias": "position"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "miniWidth": { "alias": "miniWidth"; "required": false; "isSignal": true; }; "expandOnHover": { "alias": "expandOnHover"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "opened": { "alias": "opened"; "required": false; "isSignal": true; }; }, { "width": "widthChange"; "opened": "openedChange"; }, never, ["cngx-sidenav-header, [cngxSidenavHeader]", "*", "cngx-sidenav-footer, [cngxSidenavFooter]"], true, never>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Container for one or two `CngxSidenav` panels and a `CngxSidenavContent`.
|
|
120
|
+
*
|
|
121
|
+
* Manages shared backdrop, scroll lock, and click-outside coordination.
|
|
122
|
+
* Supports up to two sidenavs: one `position="start"` and one `position="end"`.
|
|
123
|
+
*
|
|
124
|
+
* ### Dual sidebar
|
|
125
|
+
* ```html
|
|
126
|
+
* <cngx-sidenav-layout>
|
|
127
|
+
* <cngx-sidenav position="start" [(opened)]="navOpen"
|
|
128
|
+
* [responsive]="'(min-width: 1024px)'">
|
|
129
|
+
* Left nav
|
|
130
|
+
* </cngx-sidenav>
|
|
131
|
+
* <cngx-sidenav-content>
|
|
132
|
+
* Main content
|
|
133
|
+
* </cngx-sidenav-content>
|
|
134
|
+
* <cngx-sidenav position="end" [(opened)]="detailOpen">
|
|
135
|
+
* Right detail panel
|
|
136
|
+
* </cngx-sidenav>
|
|
137
|
+
* </cngx-sidenav-layout>
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
declare class CngxSidenavLayout {
|
|
141
|
+
/** @internal */
|
|
142
|
+
readonly ready: _angular_core.WritableSignal<boolean>;
|
|
143
|
+
private readonly sidenavs;
|
|
144
|
+
/** The start-positioned sidenav, if any. */
|
|
145
|
+
readonly startSidenav: _angular_core.Signal<CngxSidenav | null>;
|
|
146
|
+
/** The end-positioned sidenav, if any. */
|
|
147
|
+
readonly endSidenav: _angular_core.Signal<CngxSidenav | null>;
|
|
148
|
+
/** Whether any sidenav is open in overlay mode. */
|
|
149
|
+
readonly hasOverlay: _angular_core.Signal<boolean>;
|
|
150
|
+
constructor();
|
|
151
|
+
/** Closes all sidenavs that are currently in overlay mode. */
|
|
152
|
+
closeAllOverlays(): void;
|
|
153
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavLayout, never>;
|
|
154
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenavLayout, "cngx-sidenav-layout", ["cngxSidenavLayout"], {}, {}, ["sidenavs"], ["cngx-sidenav[position=start], cngx-sidenav:not([position])", "cngx-sidenav-content", "cngx-sidenav[position=end]"], true, never>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Main content area within a `CngxSidenavLayout`.
|
|
159
|
+
*
|
|
160
|
+
* Auto-adjusts margins when sibling sidenavs are in `push` or `side`
|
|
161
|
+
* mode. Must be a direct child of `CngxSidenavLayout`.
|
|
162
|
+
*
|
|
163
|
+
* ```html
|
|
164
|
+
* <cngx-sidenav-layout>
|
|
165
|
+
* <cngx-sidenav position="start">…</cngx-sidenav>
|
|
166
|
+
* <cngx-sidenav-content>
|
|
167
|
+
* <router-outlet />
|
|
168
|
+
* </cngx-sidenav-content>
|
|
169
|
+
* </cngx-sidenav-layout>
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
declare class CngxSidenavContent {
|
|
173
|
+
private readonly layout;
|
|
174
|
+
constructor();
|
|
175
|
+
/**
|
|
176
|
+
* Margin offset for the start sidenav.
|
|
177
|
+
*
|
|
178
|
+
* Push and side modes use `position: relative` — the sidenav sits in
|
|
179
|
+
* the flex flow and the content shrinks naturally via `flex: 1`.
|
|
180
|
+
* No margin needed. Over mode uses `position: absolute` — no margin needed
|
|
181
|
+
* either since the sidenav floats above content.
|
|
182
|
+
*
|
|
183
|
+
* Kept as a public computed so tests and consumers can still read it.
|
|
184
|
+
*/
|
|
185
|
+
readonly marginStart = "0";
|
|
186
|
+
/** Margin offset for the end sidenav — same rationale as start. */
|
|
187
|
+
readonly marginEnd = "0";
|
|
188
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavContent, never>;
|
|
189
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSidenavContent, "cngx-sidenav-content", ["cngxSidenavContent"], {}, {}, never, ["*"], true, never>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Marks content to be projected into the sidenav's sticky header area.
|
|
194
|
+
*/
|
|
195
|
+
declare class CngxSidenavHeader {
|
|
196
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavHeader, never>;
|
|
197
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavHeader, "cngx-sidenav-header, [cngxSidenavHeader]", never, {}, {}, never, never, true, never>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Marks content to be projected into the sidenav's sticky footer area.
|
|
202
|
+
*/
|
|
203
|
+
declare class CngxSidenavFooter {
|
|
204
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavFooter, never>;
|
|
205
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavFooter, "cngx-sidenav-footer, [cngxSidenavFooter]", never, {}, {}, never, never, true, never>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export { CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout };
|
|
209
|
+
export type { SidenavMode, SidenavPosition };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef, Signal } from '@angular/core';
|
|
3
|
+
import { CngxAsyncState } from '@cngx/core/utils';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Marks a template as the skeleton placeholder inside `cngx-skeleton`.
|
|
7
|
+
*
|
|
8
|
+
* The template is repeated `count` times while loading. Context provides the
|
|
9
|
+
* current index as `$implicit`.
|
|
10
|
+
*
|
|
11
|
+
* ```html
|
|
12
|
+
* <cngx-skeleton [loading]="loading()" [count]="3">
|
|
13
|
+
* <ng-template cngxSkeletonPlaceholder let-i>
|
|
14
|
+
* <div class="skeleton-line" [style.width]="i === 0 ? '60%' : '100%'"></div>
|
|
15
|
+
* </ng-template>
|
|
16
|
+
* <p>Real content</p>
|
|
17
|
+
* </cngx-skeleton>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare class CngxSkeletonPlaceholder {
|
|
21
|
+
/** Reference to the projected template. Used internally by `CngxSkeletonContainer`. */
|
|
22
|
+
readonly templateRef: TemplateRef<CngxSkeletonPlaceholderContext>;
|
|
23
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSkeletonPlaceholder, never>;
|
|
24
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSkeletonPlaceholder, "ng-template[cngxSkeletonPlaceholder]", never, {}, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
26
|
+
/** Template context for `cngxSkeletonPlaceholder`. */
|
|
27
|
+
interface CngxSkeletonPlaceholderContext {
|
|
28
|
+
/** Current index (0-based). */
|
|
29
|
+
$implicit: number;
|
|
30
|
+
/** Current index (named). */
|
|
31
|
+
index: number;
|
|
32
|
+
/** Total count. */
|
|
33
|
+
count: number;
|
|
34
|
+
/** Whether this is the first item. */
|
|
35
|
+
first: boolean;
|
|
36
|
+
/** Whether this is the last item. */
|
|
37
|
+
last: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Skeleton loading container with built-in placeholder repetition.
|
|
42
|
+
*
|
|
43
|
+
* Manages CSS classes, ARIA, and reduced-motion handling internally
|
|
44
|
+
* (same behavior as the `CngxSkeleton` atom directive). Adds template projection
|
|
45
|
+
* so the consumer doesn't need `@if`/`@for` boilerplate.
|
|
46
|
+
*
|
|
47
|
+
* - Project a `<ng-template cngxSkeletonPlaceholder>` for the loading state (repeated `count` times).
|
|
48
|
+
* - Project content directly for the loaded state.
|
|
49
|
+
* - Uses `display: contents` — no extra DOM wrapper.
|
|
50
|
+
*
|
|
51
|
+
* ### Basic usage
|
|
52
|
+
* ```html
|
|
53
|
+
* <cngx-skeleton [loading]="loading()" [count]="3">
|
|
54
|
+
* <ng-template cngxSkeletonPlaceholder>
|
|
55
|
+
* <div class="skeleton-card"></div>
|
|
56
|
+
* </ng-template>
|
|
57
|
+
* <app-real-content />
|
|
58
|
+
* </cngx-skeleton>
|
|
59
|
+
* ```
|
|
60
|
+
*
|
|
61
|
+
* ### With template context (index, first, last)
|
|
62
|
+
* ```html
|
|
63
|
+
* <cngx-skeleton [loading]="loading()" [count]="5">
|
|
64
|
+
* <ng-template cngxSkeletonPlaceholder let-i let-last="last">
|
|
65
|
+
* <div class="skeleton-line" [style.width]="last ? '60%' : '100%'"></div>
|
|
66
|
+
* </ng-template>
|
|
67
|
+
* <p>Loaded content here</p>
|
|
68
|
+
* </cngx-skeleton>
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
declare class CngxSkeletonContainer {
|
|
72
|
+
/** Controls the loading state directly. */
|
|
73
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
74
|
+
/** Bind an async state — shows skeleton during first load. Takes precedence over `loading`. */
|
|
75
|
+
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
76
|
+
/** Enables the `.cngx-skeleton--shimmer` class (respects `prefers-reduced-motion`). */
|
|
77
|
+
readonly shimmer: _angular_core.InputSignal<boolean>;
|
|
78
|
+
/** Repeat count for the placeholder template. */
|
|
79
|
+
readonly count: _angular_core.InputSignal<number>;
|
|
80
|
+
/** Derived loading state: `state.isFirstLoad` takes precedence over `loading` input. */
|
|
81
|
+
protected readonly isLoading: Signal<boolean>;
|
|
82
|
+
/** @internal — projected placeholder template. */
|
|
83
|
+
protected readonly placeholderTpl: Signal<CngxSkeletonPlaceholder | undefined>;
|
|
84
|
+
/** Array of indices for internal `@for` rendering. */
|
|
85
|
+
readonly indices: Signal<number[]>;
|
|
86
|
+
private readonly prefersReducedMotion;
|
|
87
|
+
constructor();
|
|
88
|
+
/** @internal */
|
|
89
|
+
protected readonly showShimmer: Signal<boolean>;
|
|
90
|
+
/** @internal */
|
|
91
|
+
protected getContext(index: number): CngxSkeletonPlaceholderContext;
|
|
92
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSkeletonContainer, never>;
|
|
93
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSkeletonContainer, "cngx-skeleton", ["cngxSkeletonContainer"], { "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "shimmer": { "alias": "shimmer"; "required": false; "isSignal": true; }; "count": { "alias": "count"; "required": false; "isSignal": true; }; }, {}, ["placeholderTpl"], ["*"], true, never>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { CngxSkeletonContainer, CngxSkeletonPlaceholder };
|
|
97
|
+
export type { CngxSkeletonPlaceholderContext };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { CngxSpeak } from '@cngx/common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Ready-made speaker button that connects to a {@link CngxSpeak} directive
|
|
6
|
+
* via an explicit `[speakRef]` input — no ancestor injection.
|
|
7
|
+
*
|
|
8
|
+
* Ships with a speaker/stop SVG icon and CSS custom properties for full
|
|
9
|
+
* theming control. Include `speak-button-theme.scss` for automatic Material
|
|
10
|
+
* theme integration.
|
|
11
|
+
*
|
|
12
|
+
* ### Basic usage
|
|
13
|
+
* ```html
|
|
14
|
+
* <span [cngxSpeak]="text" #tts="cngxSpeak">{{ text }}</span>
|
|
15
|
+
* <cngx-speak-button [speakRef]="tts" />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* ### Material theme integration
|
|
19
|
+
* ```scss
|
|
20
|
+
* @use '@cngx/ui/speak/speak-button-theme' as speak;
|
|
21
|
+
* @include speak.theme($theme);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare class CngxSpeakButton {
|
|
25
|
+
/** The `CngxSpeak` directive instance to connect to. */
|
|
26
|
+
readonly speakRef: i0.InputSignal<CngxSpeak>;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxSpeakButton, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxSpeakButton, "cngx-speak-button", never, { "speakRef": { "alias": "speakRef"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { CngxSpeakButton };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as _cngx_common_stepper from '@cngx/common/stepper';
|
|
2
|
+
import { CngxStepPanelHost, CngxStepNode, CngxStepIndicatorContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepRejectionContext, CngxStepGroupHeaderContext, CngxStepLabelContext, CngxStepContentContext } from '@cngx/common/stepper';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { Signal, TemplateRef } from '@angular/core';
|
|
5
|
+
import * as i2 from '@cngx/common/a11y';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Stepper organism. Composes `CngxStepperPresenter` with
|
|
9
|
+
* `CngxRovingTabindex` and `CngxFocusRestore` via `hostDirectives`;
|
|
10
|
+
* forwards `activeStepIndex`/`linear`/`orientation`/`commitAction`/
|
|
11
|
+
* `commitMode` to the presenter. Material twin lives in
|
|
12
|
+
* `@cngx/ui/mat-stepper`. ARIA attrs are in the `computed()` graph.
|
|
13
|
+
*/
|
|
14
|
+
declare class CngxStepper implements CngxStepPanelHost {
|
|
15
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
16
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
17
|
+
protected readonly presenter: _cngx_common_stepper.CngxStepperHost;
|
|
18
|
+
protected readonly i18n: _cngx_common_stepper.CngxStepperI18n;
|
|
19
|
+
protected readonly config: _cngx_common_stepper.CngxStepperConfig;
|
|
20
|
+
private readonly hostElement;
|
|
21
|
+
private readonly injector;
|
|
22
|
+
private readonly stepDirectives;
|
|
23
|
+
private readonly indicatorSlot;
|
|
24
|
+
private readonly badgeSlot;
|
|
25
|
+
private readonly busySpinnerSlot;
|
|
26
|
+
private readonly rejectionSlot;
|
|
27
|
+
private readonly groupHeaderSlot;
|
|
28
|
+
private readonly emptySlot;
|
|
29
|
+
/** Default-template glyph source — read by `#defaultBadge` / `#defaultRejection` outlets. */
|
|
30
|
+
protected readonly glyphs: {
|
|
31
|
+
readonly errorBadge: "!";
|
|
32
|
+
readonly rejectionIcon: "!";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 6-slot template cascade (indicator/badge/busySpinner/rejection/
|
|
36
|
+
* groupHeader/empty). Resolution: per-instance slot directive →
|
|
37
|
+
* `CNGX_STEPPER_CONFIG.templates.<key>` → `null` (built-in default).
|
|
38
|
+
*/
|
|
39
|
+
protected readonly templates: _cngx_common_stepper.CngxStepperTemplateBindings;
|
|
40
|
+
constructor();
|
|
41
|
+
/** Stepper landmark role-description with config + i18n cascade. */
|
|
42
|
+
protected readonly stepperRoleDescription: Signal<string>;
|
|
43
|
+
/** Group landmark role-description with config + i18n cascade. */
|
|
44
|
+
protected readonly groupRoleDescription: Signal<string>;
|
|
45
|
+
/**
|
|
46
|
+
* `aria-label` cascade: input → `ariaLabels.stepperRegion` → `i18n.stepperLabel`.
|
|
47
|
+
* Pillar 2.
|
|
48
|
+
*/
|
|
49
|
+
protected readonly resolvedAriaLabel: Signal<string | null>;
|
|
50
|
+
private readonly stepDirectiveById;
|
|
51
|
+
readonly flatSteps: Signal<readonly CngxStepNode[]>;
|
|
52
|
+
readonly activeStepIndex: Signal<number>;
|
|
53
|
+
readonly activeStepId: Signal<string | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Step-only flat projection (group nodes filtered out). Structural equal
|
|
56
|
+
* via `flatStepsEqual` — downstream consumers don't re-walk on shape-stable
|
|
57
|
+
* `flatSteps()` re-emits.
|
|
58
|
+
*/
|
|
59
|
+
protected readonly stepsOnly: Signal<CngxStepNode[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Position in the step-only flat projection. Group nodes carry `-1`;
|
|
62
|
+
* callers must guard on `kind === 'step'`.
|
|
63
|
+
*/
|
|
64
|
+
protected stepIndexOf(node: CngxStepNode): number;
|
|
65
|
+
protected isActive(node: CngxStepNode): boolean;
|
|
66
|
+
protected isStepBusy(node: CngxStepNode): boolean;
|
|
67
|
+
/** Commit-in-flight flag — drives the host `aria-busy` binding. Pillar 2. */
|
|
68
|
+
protected readonly isCommitting: Signal<boolean>;
|
|
69
|
+
protected stepHeaderId(node: CngxStepNode): string;
|
|
70
|
+
protected stepPanelId(node: CngxStepNode): string;
|
|
71
|
+
protected stepDescriptorId(node: CngxStepNode): string;
|
|
72
|
+
/**
|
|
73
|
+
* Live-region content. Empty string between transitions keeps the region
|
|
74
|
+
* quiet on no-op CD ticks. Error-arm priority:
|
|
75
|
+
* 1. `commitRolledBackTo(originLabel)` when both `lastFailedIndex` and a
|
|
76
|
+
* resolvable origin label exist.
|
|
77
|
+
* 2. `commitFailedRetry` otherwise.
|
|
78
|
+
*/
|
|
79
|
+
protected readonly liveAnnouncement: Signal<string>;
|
|
80
|
+
/** SR descriptor phrase. Aggregator-announced or "Step N of M: <label>"; appends stepRolledBackSuffix on the rejected row. */
|
|
81
|
+
protected statusPhrase(node: CngxStepNode): string;
|
|
82
|
+
/** Group descriptor — rolls up children's aggregated status. */
|
|
83
|
+
protected groupStatusPhrase(node: CngxStepNode): string;
|
|
84
|
+
/** Whether to render the error badge for a step node. */
|
|
85
|
+
protected showErrorBadge(node: CngxStepNode): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Render the rejection decoration when this step's flat-index matches
|
|
88
|
+
* `presenter.lastFailedIndex()`. Closes stepper-accepted-debt §2.
|
|
89
|
+
*/
|
|
90
|
+
protected showRejection(node: CngxStepNode): boolean;
|
|
91
|
+
/** Build the slot context for `*cngxStepIndicator`. */
|
|
92
|
+
protected indicatorContextFor(node: CngxStepNode): CngxStepIndicatorContext;
|
|
93
|
+
/** Build the slot context for `*cngxStepBadge`. */
|
|
94
|
+
protected badgeContextFor(node: CngxStepNode): CngxStepBadgeContext;
|
|
95
|
+
/** Build the slot context for `*cngxStepBusySpinner`. */
|
|
96
|
+
protected busySpinnerContextFor(node: CngxStepNode): CngxStepBusySpinnerContext;
|
|
97
|
+
/**
|
|
98
|
+
* Build the slot context for `*cngxStepRejection`. Resolves origin label
|
|
99
|
+
* from `presenter.originIndexDuringCommit()` via `stepsOnly()`.
|
|
100
|
+
*/
|
|
101
|
+
protected rejectionContextFor(node: CngxStepNode): CngxStepRejectionContext;
|
|
102
|
+
/** Build the slot context for `*cngxStepGroupHeader`. */
|
|
103
|
+
protected groupHeaderContextFor(node: CngxStepNode): CngxStepGroupHeaderContext;
|
|
104
|
+
protected handleHeaderClick(node: CngxStepNode): void;
|
|
105
|
+
/**
|
|
106
|
+
* Clear the presenter's `lastFailedIndex`. Lets template-ref consumers
|
|
107
|
+
* (`#s="cngxStepper"`) dismiss the rejection decoration without injecting
|
|
108
|
+
* {@link CNGX_STEPPER_HOST}.
|
|
109
|
+
*/
|
|
110
|
+
clearLastFailed(): void;
|
|
111
|
+
labelTemplateFor(id: string): TemplateRef<CngxStepLabelContext> | null;
|
|
112
|
+
contentTemplateFor(id: string): TemplateRef<CngxStepContentContext> | null;
|
|
113
|
+
/**
|
|
114
|
+
* Build the {@link CngxStepLabelContext} for `*cngxStepLabel`.
|
|
115
|
+
* `index` is 1-based (mirrors indicator position); group nodes
|
|
116
|
+
* (`flatIndex === -1`) yield `0` and are never iterated here.
|
|
117
|
+
*/
|
|
118
|
+
protected stepLabelContextFor(node: CngxStepNode): CngxStepLabelContext;
|
|
119
|
+
/**
|
|
120
|
+
* Build the {@link CngxStepContentContext} for `*cngxStepContent`.
|
|
121
|
+
* Same shape as the label context — content templates need the same
|
|
122
|
+
* `disabled`/`busy` derivations.
|
|
123
|
+
*/
|
|
124
|
+
protected stepContentContextFor(node: CngxStepNode): CngxStepContentContext;
|
|
125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStepper, never>;
|
|
126
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStepper, "cngx-stepper", ["cngxStepper"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; }, {}, ["stepDirectives", "indicatorSlot", "badgeSlot", "busySpinnerSlot", "rejectionSlot", "groupHeaderSlot", "emptySlot"], never, true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }, { directive: typeof i2.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }, { directive: typeof i2.CngxFocusRestore; inputs: {}; outputs: {}; }]>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { CngxStepper };
|