@cngx/ui 0.1.0-rc.2 → 0.1.0-rc.4
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 +15 -7
- package/accordion/README.md +86 -0
- package/collection/README.md +167 -0
- package/data-grid-accordion/README.md +137 -0
- package/fesm2022/cngx-ui-accordion.mjs +853 -0
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -0
- package/fesm2022/cngx-ui-action-button.mjs +2 -2
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +1044 -0
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/cngx-ui-collection.mjs +645 -0
- package/fesm2022/cngx-ui-collection.mjs.map +1 -0
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +1135 -0
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -0
- package/fesm2022/cngx-ui-empty-state.mjs +2 -2
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +10 -10
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +229 -0
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -0
- package/fesm2022/cngx-ui-mat-paginator.mjs +215 -0
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -0
- package/fesm2022/cngx-ui-paginator.mjs +1937 -0
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -0
- package/fesm2022/cngx-ui-sidenav.mjs +547 -65
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +8 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +2 -2
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-accordion/README.md +48 -0
- package/mat-paginator/README.md +135 -0
- package/package.json +29 -5
- package/paginator/README.md +134 -0
- package/sidenav/README.md +89 -3
- package/types/cngx-ui-accordion.d.ts +801 -0
- package/types/cngx-ui-breadcrumb.d.ts +890 -0
- package/types/cngx-ui-collection.d.ts +396 -0
- package/types/cngx-ui-data-grid-accordion.d.ts +912 -0
- package/types/cngx-ui-mat-accordion.d.ts +63 -0
- package/types/cngx-ui-mat-paginator.d.ts +108 -0
- package/types/cngx-ui-paginator.d.ts +1147 -0
- package/types/cngx-ui-sidenav.d.ts +429 -21
- package/types/cngx-ui-tabs.d.ts +2 -0
- package/fesm2022/cngx-ui-material.mjs +0 -90
- package/fesm2022/cngx-ui-material.mjs.map +0 -1
- package/material/README.md +0 -90
- package/types/cngx-ui-material.d.ts +0 -47
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { ElementRef, InjectionToken, ModelSignal, EnvironmentProviders, Provider } from '@angular/core';
|
|
3
|
+
import * as i1 from '@cngx/common/interactive';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Logical position - flips in RTL.
|
|
@@ -19,11 +20,18 @@ type SidenavPosition = 'start' | 'end';
|
|
|
19
20
|
*/
|
|
20
21
|
type SidenavMode = 'over' | 'push' | 'side' | 'mini';
|
|
21
22
|
/**
|
|
22
|
-
* Declarative sidebar component
|
|
23
|
-
*
|
|
23
|
+
* Declarative sidebar component for the four drawer modes (`over`,
|
|
24
|
+
* `push`, `side`, `mini`), with responsive mode switching, two-way
|
|
25
|
+
* `[(opened)]` binding, and content projection via header/footer
|
|
26
|
+
* slots.
|
|
24
27
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
28
|
+
* In overlay (`over`) mode it drives a CDK focus trap directly via
|
|
29
|
+
* `FocusTrapFactory` (the same primitive `CngxFocusTrap` wraps): focus
|
|
30
|
+
* moves into the rail on open and is restored to the opener on close.
|
|
31
|
+
* Responsive switching runs off an inline `matchMedia` listener; the
|
|
32
|
+
* shared backdrop and document scroll lock are coordinated by
|
|
33
|
+
* `CngxSidenavLayout`. It does not compose `CngxDrawer` and has no
|
|
34
|
+
* swipe-to-dismiss.
|
|
27
35
|
*
|
|
28
36
|
* Use inside `CngxSidenavLayout` for dual-sidebar support and
|
|
29
37
|
* shared backdrop coordination.
|
|
@@ -53,6 +61,14 @@ type SidenavMode = 'over' | 'push' | 'side' | 'mini';
|
|
|
53
61
|
* <example-url>http://localhost:4200/#/ui/sidenav/material-theming-light-vs-dark</example-url>
|
|
54
62
|
*/
|
|
55
63
|
declare class CngxSidenav {
|
|
64
|
+
/**
|
|
65
|
+
* Resolved sidenav configuration cascade. Seeds the dimension, `responsive`,
|
|
66
|
+
* and `shortcut` input defaults below so a per-instance binding still wins
|
|
67
|
+
* (Controlled+Uncontrolled), an app-wide `provideSidenavConfig(...)` moves the
|
|
68
|
+
* default, and an un-configured consumer keeps the byte-identical literals.
|
|
69
|
+
* Declared first so the input field initialisers can read it.
|
|
70
|
+
*/
|
|
71
|
+
private readonly cfg;
|
|
56
72
|
/** Logical position: `'start'` (default left in LTR) or `'end'` (right in LTR). */
|
|
57
73
|
readonly position: _angular_core.InputSignal<SidenavPosition>;
|
|
58
74
|
/** Accessible label for the complementary landmark. */
|
|
@@ -88,7 +104,29 @@ declare class CngxSidenav {
|
|
|
88
104
|
readonly resizing: _angular_core.Signal<boolean>;
|
|
89
105
|
/** Two-way opened state. Supports `[(opened)]="signal"`. */
|
|
90
106
|
readonly opened: _angular_core.ModelSignal<boolean>;
|
|
91
|
-
/**
|
|
107
|
+
/** Debounced mini expand-on-hover, composed as a hostDirective (its own pointer listeners drive it). */
|
|
108
|
+
private readonly hoverIntent;
|
|
109
|
+
/**
|
|
110
|
+
* Composed source for `expandedState`: the effective mode, the debounced
|
|
111
|
+
* hover-intent signal, and the on/off switch. Carries an explicit `equal` so
|
|
112
|
+
* the object literal never churns identity and re-runs the computation when
|
|
113
|
+
* none of the three fields actually changed.
|
|
114
|
+
*/
|
|
115
|
+
private readonly hoverSource;
|
|
116
|
+
/**
|
|
117
|
+
* Whether the mini-mode rail is currently expanded. A pure derivation of
|
|
118
|
+
* `(effectiveMode, hoverIntent.active, expandOnHover)`, not two imperative
|
|
119
|
+
* event-handler writes:
|
|
120
|
+
*
|
|
121
|
+
* - outside `mini` it is always `false`;
|
|
122
|
+
* - with `expandOnHover=true` the debounced hover is the source of truth, so a
|
|
123
|
+
* pointer edge overrides a prior `expand()`/`collapse()` (see `expand()`);
|
|
124
|
+
* - with `expandOnHover=false` hover is ignored and the prior value is kept, so
|
|
125
|
+
* `expand()`/`collapse()` retain full programmatic authority.
|
|
126
|
+
*
|
|
127
|
+
* It stays a writable `linkedSignal` so `expand()`/`collapse()` can `set()` it;
|
|
128
|
+
* the next source change re-derives from the debounced hover.
|
|
129
|
+
*/
|
|
92
130
|
private readonly expandedState;
|
|
93
131
|
readonly expanded: _angular_core.Signal<boolean>;
|
|
94
132
|
/** @internal Reference to host element for layout positioning. */
|
|
@@ -98,12 +136,32 @@ declare class CngxSidenav {
|
|
|
98
136
|
readonly effectiveMode: _angular_core.Signal<SidenavMode>;
|
|
99
137
|
/** Whether this sidenav is in overlay mode (over). */
|
|
100
138
|
readonly isOverlay: _angular_core.Signal<boolean>;
|
|
139
|
+
/** Whether the sidenav is currently a modal overlay: overlay mode and open. */
|
|
140
|
+
readonly overlayActive: _angular_core.Signal<boolean>;
|
|
101
141
|
/** Resolved width - mini mode uses miniWidth unless expanded. */
|
|
102
142
|
readonly effectiveWidth: _angular_core.Signal<string>;
|
|
103
143
|
private readonly doc;
|
|
104
144
|
private readonly win;
|
|
105
|
-
/**
|
|
106
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Current/previous effective-mode pair for transition detection. Mirrors the
|
|
147
|
+
* `createTransitionTracker` shape from `@cngx/core/utils`, inlined because that
|
|
148
|
+
* helper is typed to `AsyncStatus`; `SidenavMode` needs the same `linkedSignal`
|
|
149
|
+
* pattern. Replaces the hand-rolled `prevMode` signal that was `.set()` inside
|
|
150
|
+
* the mode effect.
|
|
151
|
+
*/
|
|
152
|
+
private readonly modeTransition;
|
|
153
|
+
/** CDK focus trap over the host; enabled only while a modal overlay is open. */
|
|
154
|
+
private readonly focusTrap;
|
|
155
|
+
/** Element that held focus when the overlay opened, restored to it on close. */
|
|
156
|
+
private restoreTarget;
|
|
157
|
+
/**
|
|
158
|
+
* Set when the mode-transition effect auto-opens an overlay (a viewport-driven
|
|
159
|
+
* `side`/`mini` -> `over` switch). The focus effect reads it to enable the trap
|
|
160
|
+
* without pulling focus into the rail, since that open was not user-initiated.
|
|
161
|
+
*/
|
|
162
|
+
private autoOpenInFlight;
|
|
163
|
+
/** Aborts the in-flight resize drag's document listeners (pointerup or teardown). */
|
|
164
|
+
private resizeAbort;
|
|
107
165
|
constructor();
|
|
108
166
|
/** Opens the sidenav. */
|
|
109
167
|
open(): void;
|
|
@@ -112,23 +170,31 @@ declare class CngxSidenav {
|
|
|
112
170
|
/** Toggles the sidenav. */
|
|
113
171
|
toggle(): void;
|
|
114
172
|
/** @internal Close only if in overlay mode (for Escape key, click-outside). */
|
|
115
|
-
closeIfOverlay(): void;
|
|
116
|
-
/**
|
|
173
|
+
protected closeIfOverlay(): void;
|
|
174
|
+
/**
|
|
175
|
+
* Expand the mini rail to full width.
|
|
176
|
+
*
|
|
177
|
+
* When `expandOnHover=true` (the default) the debounced hover is the source of
|
|
178
|
+
* truth for `expanded`, so a programmatic `expand()` is transient: the next
|
|
179
|
+
* pointer edge overrides it. For authoritative programmatic control set
|
|
180
|
+
* `expandOnHover=false`, which hands `expand()`/`collapse()` full authority.
|
|
181
|
+
*/
|
|
117
182
|
expand(): void;
|
|
118
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Collapse the expanded mini rail back to miniWidth.
|
|
185
|
+
*
|
|
186
|
+
* Same reconciliation as `expand()`: transient while `expandOnHover=true`,
|
|
187
|
+
* authoritative while `expandOnHover=false`.
|
|
188
|
+
*/
|
|
119
189
|
collapse(): void;
|
|
120
|
-
/** @internal */
|
|
121
|
-
handleMouseEnter(): void;
|
|
122
|
-
/** @internal */
|
|
123
|
-
handleMouseLeave(): void;
|
|
124
190
|
/** @internal Parse a CSS px value to a number. */
|
|
125
|
-
widthPx: _angular_core.Signal<number>;
|
|
126
|
-
minWidthPx: _angular_core.Signal<number>;
|
|
127
|
-
maxWidthPx: _angular_core.Signal<number>;
|
|
191
|
+
protected readonly widthPx: _angular_core.Signal<number>;
|
|
192
|
+
protected readonly minWidthPx: _angular_core.Signal<number>;
|
|
193
|
+
protected readonly maxWidthPx: _angular_core.Signal<number>;
|
|
128
194
|
/** @internal */
|
|
129
195
|
handleResizeStart(e: PointerEvent): void;
|
|
130
196
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenav, never>;
|
|
131
|
-
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,
|
|
197
|
+
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, [{ directive: typeof i1.CngxHoverIntent; inputs: { "enterDelay": "expandDelay"; "leaveDelay": "collapseDelay"; }; outputs: {}; }]>;
|
|
132
198
|
}
|
|
133
199
|
|
|
134
200
|
/**
|
|
@@ -177,6 +243,69 @@ declare class CngxSidenavLayout {
|
|
|
177
243
|
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>;
|
|
178
244
|
}
|
|
179
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Minimal contract a sidenav rail exposes to the router-sync directive: the
|
|
248
|
+
* two-way `opened` signal it reads and writes. Injected via {@link CNGX_SIDENAV}
|
|
249
|
+
* + `useExisting`, never by injecting the concrete `CngxSidenav` class - that
|
|
250
|
+
* would create a cyclic type dependency and block the decompose brain/skin
|
|
251
|
+
* split. The deferred layout-coordination consumer will broaden this contract
|
|
252
|
+
* (with `close()` / `elementRef`) in the branch that migrates
|
|
253
|
+
* `CngxSidenavLayout` onto the token.
|
|
254
|
+
*
|
|
255
|
+
* @category ui/sidenav
|
|
256
|
+
* @since 0.1.0
|
|
257
|
+
*/
|
|
258
|
+
interface CngxSidenavContract {
|
|
259
|
+
/** Two-way open state; the directive both reads and writes it. */
|
|
260
|
+
readonly opened: ModelSignal<boolean>;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Contract token for a sidenav rail. `CngxSidenav` provides it via
|
|
264
|
+
* `{ provide: CNGX_SIDENAV, useExisting: CngxSidenav }`, so a collaborator
|
|
265
|
+
* injects the narrow {@link CngxSidenavContract} instead of the concrete class.
|
|
266
|
+
*
|
|
267
|
+
* @category ui/sidenav
|
|
268
|
+
* @since 0.1.0
|
|
269
|
+
* @relatedTo CngxSidenav, CngxSidenavRouterSync
|
|
270
|
+
*/
|
|
271
|
+
declare const CNGX_SIDENAV: InjectionToken<CngxSidenavContract>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Deep-links a sidenav's open state into a query param. Opt-in via
|
|
275
|
+
* `[cngxSidenavRouterSync]` on a `<cngx-sidenav>`: opening writes `?nav=open`,
|
|
276
|
+
* an initial `?nav=open` hydrates it open, closing removes the param, and
|
|
277
|
+
* browser back/forward re-hydrates it. A thin caller over
|
|
278
|
+
* `injectQueryParamSync` - it reaches the rail through the {@link CNGX_SIDENAV}
|
|
279
|
+
* contract token, never the concrete class.
|
|
280
|
+
*
|
|
281
|
+
* The `param` default cascades: per-instance `[param]` wins, then
|
|
282
|
+
* `withSidenavRouterSync({ param })` on `CNGX_SIDENAV_CONFIG`, then the `'nav'`
|
|
283
|
+
* literal. Without `@angular/router` the kernel dev-warns once and no-ops.
|
|
284
|
+
*
|
|
285
|
+
* @category ui/sidenav
|
|
286
|
+
* @docsKind primary
|
|
287
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/sidenav-router-sync.directive.ts
|
|
288
|
+
* @since 0.1.0
|
|
289
|
+
* @relatedTo CngxSidenav, CNGX_SIDENAV, injectQueryParamSync
|
|
290
|
+
* <example-url>http://localhost:4200/#/ui/sidenav/router-sync/deep-linkable-overlay</example-url>
|
|
291
|
+
*/
|
|
292
|
+
declare class CngxSidenavRouterSync {
|
|
293
|
+
private readonly sidenav;
|
|
294
|
+
private readonly cfg;
|
|
295
|
+
/**
|
|
296
|
+
* Raw `[param]` input. Read the resolved {@link param} computed instead.
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
|
+
readonly paramInput: _angular_core.InputSignal<string | undefined>;
|
|
300
|
+
/** Resolved query-param key: `[param]` -> config `routerSync.param` -> `'nav'`. */
|
|
301
|
+
readonly param: _angular_core.Signal<string>;
|
|
302
|
+
/** Emits when a `router.navigate` rejection is observed. Parity with the stepper sibling. */
|
|
303
|
+
readonly syncError: _angular_core.OutputEmitterRef<unknown>;
|
|
304
|
+
constructor();
|
|
305
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSidenavRouterSync, never>;
|
|
306
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavRouterSync, "[cngxSidenavRouterSync]", ["cngxSidenavRouterSync"], { "paramInput": { "alias": "param"; "required": false; "isSignal": true; }; }, { "syncError": "syncError"; }, never, never, true, never>;
|
|
307
|
+
}
|
|
308
|
+
|
|
180
309
|
/**
|
|
181
310
|
* Main content area within a `CngxSidenavLayout`.
|
|
182
311
|
*
|
|
@@ -299,5 +428,284 @@ declare class CngxSidenavFooter {
|
|
|
299
428
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSidenavFooter, "cngx-sidenav-footer, [cngxSidenavFooter]", never, {}, {}, never, never, true, never>;
|
|
300
429
|
}
|
|
301
430
|
|
|
302
|
-
|
|
303
|
-
|
|
431
|
+
/**
|
|
432
|
+
* App-wide cascade for the sidenav family's dimension defaults, the mini
|
|
433
|
+
* expand-on-hover dwell, and the `responsive` / `shortcut` behaviour knobs.
|
|
434
|
+
*
|
|
435
|
+
* Resolution priority (high -> low):
|
|
436
|
+
* 1. Per-instance Input binding (e.g. `[width]="'320px'"`, `[shortcut]="'mod+b'"`).
|
|
437
|
+
* 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`
|
|
438
|
+
* (component-scoped override).
|
|
439
|
+
* 3. `provideSidenavConfig(...)` at the application root.
|
|
440
|
+
* 4. Library defaults (merged in via `CNGX_SIDENAV_DEFAULTS`).
|
|
441
|
+
*
|
|
442
|
+
* Every key is optional - partial overrides deep-merge with the library
|
|
443
|
+
* defaults, so consumers declare only the keys they want to override. The
|
|
444
|
+
* `dimensions`, `hover`, and `routerSync` sub-trees are one level deep
|
|
445
|
+
* (spread-merged per key); `responsive` and `shortcut` are flat top-level
|
|
446
|
+
* scalars.
|
|
447
|
+
*
|
|
448
|
+
* The cascaded keys are the dimension inputs, the mini hover dwell, the
|
|
449
|
+
* `responsive` and `shortcut` defaults, and the router-sync `param`.
|
|
450
|
+
* `ariaLabel`, `position`, and `mode` stay per-instance only, since they
|
|
451
|
+
* describe an individual rail rather than an app-wide default.
|
|
452
|
+
*
|
|
453
|
+
* @category ui/sidenav
|
|
454
|
+
* @since 0.1.0
|
|
455
|
+
*/
|
|
456
|
+
interface CngxSidenavConfig {
|
|
457
|
+
/**
|
|
458
|
+
* Panel dimensions. Per-instance `[width]` / `[miniWidth]` / `[minWidth]` /
|
|
459
|
+
* `[maxWidth]` bindings still win; this only moves the cascade defaults. A
|
|
460
|
+
* one-level nested sub-tree (spread-merged per key in the config reducer).
|
|
461
|
+
*/
|
|
462
|
+
readonly dimensions?: {
|
|
463
|
+
/** Width of the expanded panel. Seeds the two-way `[(width)]` model. */
|
|
464
|
+
readonly width?: string;
|
|
465
|
+
/** Width of the collapsed rail in `mini` mode. */
|
|
466
|
+
readonly miniWidth?: string;
|
|
467
|
+
/** Minimum width constraint during resize. */
|
|
468
|
+
readonly minWidth?: string;
|
|
469
|
+
/** Maximum width constraint during resize. */
|
|
470
|
+
readonly maxWidth?: string;
|
|
471
|
+
};
|
|
472
|
+
/**
|
|
473
|
+
* Mini expand-on-hover dwell, forwarded to the composed `CngxHoverIntent`
|
|
474
|
+
* hostDirective. A one-level nested sub-tree. Wired via
|
|
475
|
+
* `withSidenavHoverDwell(...)`.
|
|
476
|
+
*/
|
|
477
|
+
readonly hover?: {
|
|
478
|
+
/** Delay in ms before the mini rail expands on pointer enter. */
|
|
479
|
+
readonly enterDelay?: number;
|
|
480
|
+
/** Delay in ms before the mini rail collapses on pointer leave. */
|
|
481
|
+
readonly leaveDelay?: number;
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* URL query-param sync defaults for `[cngxSidenavRouterSync]`. A one-level
|
|
485
|
+
* nested sub-tree (spread-merged per key in the config reducer). Wired via
|
|
486
|
+
* `withSidenavRouterSync(...)`; the directive resolves `param` as
|
|
487
|
+
* `[param] ?? routerSync.param ?? 'nav'`, so an un-configured consumer keeps
|
|
488
|
+
* the `'nav'` literal.
|
|
489
|
+
*/
|
|
490
|
+
readonly routerSync?: {
|
|
491
|
+
/** Query-param key the sidenav's `opened` state syncs to. Defaults to `'nav'`. */
|
|
492
|
+
readonly param?: string;
|
|
493
|
+
};
|
|
494
|
+
/**
|
|
495
|
+
* Default CSS media-query string for responsive mode switching. Per-instance
|
|
496
|
+
* `[responsive]` still wins. A flat top-level scalar, not a nested sub-tree.
|
|
497
|
+
*/
|
|
498
|
+
readonly responsive?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Default keyboard shortcut to toggle the sidenav (e.g. `'mod+b'`).
|
|
501
|
+
* Per-instance `[shortcut]` still wins. A flat top-level scalar.
|
|
502
|
+
*/
|
|
503
|
+
readonly shortcut?: string;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* App-wide configuration cascade for the sidenav family. Resolves in priority
|
|
508
|
+
* order:
|
|
509
|
+
*
|
|
510
|
+
* 1. Per-instance Input binding.
|
|
511
|
+
* 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`.
|
|
512
|
+
* 3. `provideSidenavConfig(...)` at the application root.
|
|
513
|
+
* 4. Library defaults (this token's `factory`).
|
|
514
|
+
*
|
|
515
|
+
* `providedIn: 'root'` with a default factory means consumers never need to
|
|
516
|
+
* provide the token explicitly - `inject(CNGX_SIDENAV_CONFIG)` always resolves.
|
|
517
|
+
* Consumers who want overrides call `provideSidenavConfig(...)` in
|
|
518
|
+
* `bootstrapApplication` providers (root cascade) or `provideSidenavConfigAt(...)`
|
|
519
|
+
* in a component's `viewProviders` (sub-tree cascade).
|
|
520
|
+
*
|
|
521
|
+
* @category ui/sidenav
|
|
522
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/sidenav/config/sidenav.config.defaults.ts
|
|
523
|
+
* @since 0.1.0
|
|
524
|
+
*/
|
|
525
|
+
declare const CNGX_SIDENAV_CONFIG: InjectionToken<CngxSidenavConfig>;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Discriminated-union shape returned by the sidenav config features -
|
|
529
|
+
* `withSidenavDimensions`, `withSidenavResponsive`, `withSidenavShortcut`,
|
|
530
|
+
* `withSidenavHoverDwell`, and `withSidenavRouterSync`. The reducer in
|
|
531
|
+
* `provideSidenavConfig` / `provideSidenavConfigAt` matches on `kind` and merges
|
|
532
|
+
* `payload` into the corresponding config sub-tree: `dimensions`, `hover`, and
|
|
533
|
+
* `routerSync` are one-level nested sub-trees, `responsive` and `shortcut` are
|
|
534
|
+
* flat top-level scalars. Mirrors `CngxBreadcrumbConfigFeature` from
|
|
535
|
+
* `@cngx/ui/breadcrumb` (nested-sub-tree style; the stepper family uses flat
|
|
536
|
+
* scalar keys instead).
|
|
537
|
+
*
|
|
538
|
+
* @category ui/sidenav
|
|
539
|
+
* @since 0.1.0
|
|
540
|
+
*/
|
|
541
|
+
type CngxSidenavConfigFeature = {
|
|
542
|
+
readonly kind: 'dimensions';
|
|
543
|
+
readonly payload: NonNullable<CngxSidenavConfig['dimensions']>;
|
|
544
|
+
} | {
|
|
545
|
+
readonly kind: 'hover';
|
|
546
|
+
readonly payload: NonNullable<CngxSidenavConfig['hover']>;
|
|
547
|
+
} | {
|
|
548
|
+
readonly kind: 'routerSync';
|
|
549
|
+
readonly payload: NonNullable<CngxSidenavConfig['routerSync']>;
|
|
550
|
+
} | {
|
|
551
|
+
readonly kind: 'responsive';
|
|
552
|
+
readonly payload: {
|
|
553
|
+
readonly responsive: string;
|
|
554
|
+
};
|
|
555
|
+
} | {
|
|
556
|
+
readonly kind: 'shortcut';
|
|
557
|
+
readonly payload: {
|
|
558
|
+
readonly shortcut: string;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* Application-root configuration cascade for the sidenav family. Pass any
|
|
563
|
+
* combination of `withSidenavDimensions`, `withSidenavResponsive`,
|
|
564
|
+
* `withSidenavShortcut`, `withSidenavHoverDwell`, and `withSidenavRouterSync`
|
|
565
|
+
* features in `bootstrapApplication`'s providers array.
|
|
566
|
+
*
|
|
567
|
+
* Resolution priority (high -> low):
|
|
568
|
+
* 1. Per-instance Input binding.
|
|
569
|
+
* 2. `provideSidenavConfigAt(...)` in a parent component's `viewProviders`.
|
|
570
|
+
* 3. `provideSidenavConfig(...)` at the application root.
|
|
571
|
+
* 4. Library defaults (`CNGX_SIDENAV_DEFAULTS`).
|
|
572
|
+
*
|
|
573
|
+
* The provider deep-merges supplied features with the library defaults so
|
|
574
|
+
* consumers only declare keys they want to override.
|
|
575
|
+
*
|
|
576
|
+
* ```ts
|
|
577
|
+
* bootstrapApplication(AppComponent, {
|
|
578
|
+
* providers: [
|
|
579
|
+
* provideSidenavConfig(
|
|
580
|
+
* withSidenavDimensions({ width: '320px' }),
|
|
581
|
+
* withSidenavShortcut('mod+b'),
|
|
582
|
+
* ),
|
|
583
|
+
* ],
|
|
584
|
+
* });
|
|
585
|
+
* ```
|
|
586
|
+
*
|
|
587
|
+
* @category ui/sidenav
|
|
588
|
+
* @since 0.1.0
|
|
589
|
+
*/
|
|
590
|
+
declare function provideSidenavConfig(...features: CngxSidenavConfigFeature[]): EnvironmentProviders;
|
|
591
|
+
/**
|
|
592
|
+
* Component-scoped configuration cascade for the sidenav family. Pass any
|
|
593
|
+
* combination of feature factories in a parent component's `viewProviders`
|
|
594
|
+
* array.
|
|
595
|
+
*
|
|
596
|
+
* Unlike `provideSidenavConfig` (root-only), `provideSidenavConfigAt` injects
|
|
597
|
+
* the parent injector's `CNGX_SIDENAV_CONFIG` value (resolves through the
|
|
598
|
+
* priority chain - root provider, library defaults, or another
|
|
599
|
+
* `provideSidenavConfigAt` further up) and deep-merges the supplied features on
|
|
600
|
+
* top. Descendant sidenav instances see the merged config; sibling sub-trees
|
|
601
|
+
* keep the inherited value untouched.
|
|
602
|
+
*
|
|
603
|
+
* ```ts
|
|
604
|
+
* @Component({
|
|
605
|
+
* viewProviders: [
|
|
606
|
+
* provideSidenavConfigAt(withSidenavDimensions({ width: '320px' })),
|
|
607
|
+
* ],
|
|
608
|
+
* template: '<cngx-sidenav>...</cngx-sidenav>',
|
|
609
|
+
* })
|
|
610
|
+
* class Section {}
|
|
611
|
+
* ```
|
|
612
|
+
*
|
|
613
|
+
* @category ui/sidenav
|
|
614
|
+
* @since 0.1.0
|
|
615
|
+
*/
|
|
616
|
+
declare function provideSidenavConfigAt(...features: CngxSidenavConfigFeature[]): Provider[];
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Override the sidenav family's panel dimensions - `width`, `miniWidth`,
|
|
620
|
+
* `minWidth`, and `maxWidth`. Per-instance `[width]` / `[miniWidth]` /
|
|
621
|
+
* `[minWidth]` / `[maxWidth]` bindings still win over the cascade; this only
|
|
622
|
+
* moves the defaults. Partial payloads deep-merge, so pass only the keys you
|
|
623
|
+
* want to change.
|
|
624
|
+
*
|
|
625
|
+
* ```ts
|
|
626
|
+
* provideSidenavConfig(withSidenavDimensions({ width: '320px', miniWidth: '64px' }));
|
|
627
|
+
* ```
|
|
628
|
+
*
|
|
629
|
+
* @category ui/sidenav
|
|
630
|
+
* @since 0.1.0
|
|
631
|
+
*/
|
|
632
|
+
declare function withSidenavDimensions(payload: NonNullable<CngxSidenavConfig['dimensions']>): CngxSidenavConfigFeature;
|
|
633
|
+
/**
|
|
634
|
+
* Set the app-wide default CSS media-query string for responsive mode
|
|
635
|
+
* switching. When the query matches, the sidenav resolves to `'side'`;
|
|
636
|
+
* otherwise it falls back to its `mode`. Per-instance `[responsive]` still
|
|
637
|
+
* wins.
|
|
638
|
+
*
|
|
639
|
+
* ```ts
|
|
640
|
+
* provideSidenavConfig(withSidenavResponsive('(min-width: 1024px)'));
|
|
641
|
+
* ```
|
|
642
|
+
*
|
|
643
|
+
* @category ui/sidenav
|
|
644
|
+
* @since 0.1.0
|
|
645
|
+
*/
|
|
646
|
+
declare function withSidenavResponsive(query: string): CngxSidenavConfigFeature;
|
|
647
|
+
/**
|
|
648
|
+
* Set the app-wide default keyboard shortcut to toggle the sidenav (e.g.
|
|
649
|
+
* `'mod+b'`, which resolves to `ctrl` on Windows/Linux and `meta` on macOS).
|
|
650
|
+
* Per-instance `[shortcut]` still wins.
|
|
651
|
+
*
|
|
652
|
+
* ```ts
|
|
653
|
+
* provideSidenavConfig(withSidenavShortcut('mod+b'));
|
|
654
|
+
* ```
|
|
655
|
+
*
|
|
656
|
+
* @category ui/sidenav
|
|
657
|
+
* @since 0.1.0
|
|
658
|
+
*/
|
|
659
|
+
declare function withSidenavShortcut(combo: string): CngxSidenavConfigFeature;
|
|
660
|
+
/**
|
|
661
|
+
* Set the app-wide default mini expand-on-hover dwell - `enterDelay` (ms before
|
|
662
|
+
* the rail expands) and `leaveDelay` (ms before it collapses). Flows into the
|
|
663
|
+
* composed `CngxHoverIntent` via `CNGX_HOVER_INTENT_DEFAULTS`. Per-instance
|
|
664
|
+
* `[enterDelay]` / `[leaveDelay]` still win; the shipped literals (120 / 0)
|
|
665
|
+
* apply when neither is set. Partial payloads deep-merge, so pass only the key
|
|
666
|
+
* you want to change.
|
|
667
|
+
*
|
|
668
|
+
* ```ts
|
|
669
|
+
* provideSidenavConfig(withSidenavHoverDwell({ enterDelay: 200, leaveDelay: 150 }));
|
|
670
|
+
* ```
|
|
671
|
+
*
|
|
672
|
+
* @category ui/sidenav
|
|
673
|
+
* @since 0.1.0
|
|
674
|
+
*/
|
|
675
|
+
declare function withSidenavHoverDwell(payload: NonNullable<CngxSidenavConfig['hover']>): CngxSidenavConfigFeature;
|
|
676
|
+
/**
|
|
677
|
+
* Set the app-wide default query-param key for `[cngxSidenavRouterSync]` - the
|
|
678
|
+
* param the sidenav's `opened` state deep-links to. Per-instance `[param]`
|
|
679
|
+
* still wins; the `'nav'` literal applies when neither is set.
|
|
680
|
+
*
|
|
681
|
+
* ```ts
|
|
682
|
+
* provideSidenavConfig(withSidenavRouterSync({ param: 'menu' }));
|
|
683
|
+
* ```
|
|
684
|
+
*
|
|
685
|
+
* @category ui/sidenav
|
|
686
|
+
* @since 0.1.0
|
|
687
|
+
*/
|
|
688
|
+
declare function withSidenavRouterSync(payload: NonNullable<CngxSidenavConfig['routerSync']>): CngxSidenavConfigFeature;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Convenience accessor for the sidenav configuration cascade. Runs in injection
|
|
692
|
+
* context; resolves through the priority chain (per-instance Input ->
|
|
693
|
+
* `provideSidenavConfigAt` -> `provideSidenavConfig` -> library defaults).
|
|
694
|
+
* Equivalent to `inject(CNGX_SIDENAV_CONFIG)` - the helper exists so consumers
|
|
695
|
+
* don't import the token directly. Mirrors `injectBreadcrumbConfig` in
|
|
696
|
+
* `@cngx/ui/breadcrumb`.
|
|
697
|
+
*
|
|
698
|
+
* ```ts
|
|
699
|
+
* export class CngxSidenav {
|
|
700
|
+
* private readonly cfg = injectSidenavConfig();
|
|
701
|
+
* readonly width = model<string>(this.cfg.dimensions?.width ?? '280px');
|
|
702
|
+
* }
|
|
703
|
+
* ```
|
|
704
|
+
*
|
|
705
|
+
* @category ui/sidenav
|
|
706
|
+
* @since 0.1.0
|
|
707
|
+
*/
|
|
708
|
+
declare function injectSidenavConfig(): CngxSidenavConfig;
|
|
709
|
+
|
|
710
|
+
export { CNGX_SIDENAV, CNGX_SIDENAV_CONFIG, CngxSidenav, CngxSidenavContent, CngxSidenavFooter, CngxSidenavHeader, CngxSidenavLayout, CngxSidenavRouterSync, injectSidenavConfig, provideSidenavConfig, provideSidenavConfigAt, withSidenavDimensions, withSidenavHoverDwell, withSidenavResponsive, withSidenavRouterSync, withSidenavShortcut };
|
|
711
|
+
export type { CngxSidenavConfig, CngxSidenavConfigFeature, CngxSidenavContract, SidenavMode, SidenavPosition };
|
package/types/cngx-ui-tabs.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
24
24
|
* @playground Overflow "More" menu under resize ./examples/overflow-resize/overflow-resize.component.ts
|
|
25
25
|
* @playground Async commit-action (optimistic / pessimistic) ./examples/async-commit/async-commit.component.ts
|
|
26
26
|
* @playground Dismissable + addable tabs ./examples/dynamic-tabs/dynamic-tabs.component.ts
|
|
27
|
+
* @playground Data-driven tabs via HTTP (Material) ./examples/http-commit/http-commit-material.component.ts
|
|
28
|
+
* @playground Data-driven tabs via HTTP (default theme) ./examples/http-commit/http-commit-plain.component.ts
|
|
27
29
|
* @playground Form error aggregation ./examples/form-errors/form-errors.component.ts
|
|
28
30
|
* @playground Routed tabs with a CanDeactivate guard ./examples/routed-outlet/routed-outlet.component.ts
|
|
29
31
|
* @see {@link CngxMatTabs} for the Material `<mat-tab-group>` variant with `[cngxMatTabError]`.
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/material/paginator';
|
|
4
|
-
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Material paginator wrapper that connects to a {@link CngxPaginate} directive
|
|
8
|
-
* via an explicit `[cngxPaginateRef]` input - no ancestor injection.
|
|
9
|
-
*
|
|
10
|
-
* ```html
|
|
11
|
-
* <div cngxPaginate #pg="cngxPaginate" [total]="items.length">
|
|
12
|
-
* <!-- table / list -->
|
|
13
|
-
* </div>
|
|
14
|
-
* <cngx-mat-paginator [cngxPaginateRef]="pg" />
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* For SmartDataSource integration, expose `filteredCount` from the data source
|
|
18
|
-
* and bind it to `[total]` on the element that carries `cngxPaginate`:
|
|
19
|
-
* ```html
|
|
20
|
-
* <div cngxPaginate #pg="cngxPaginate" [total]="ds.filteredCount()">
|
|
21
|
-
* <mat-table [dataSource]="ds" />
|
|
22
|
-
* </div>
|
|
23
|
-
* <cngx-mat-paginator [cngxPaginateRef]="pg" />
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @category ui/material
|
|
27
|
-
* @docsKind primary
|
|
28
|
-
* @wcag AA
|
|
29
|
-
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/material/mat-paginator.ts
|
|
30
|
-
* @since 0.1.0
|
|
31
|
-
* @relatedTo CngxPaginate, CngxDataSource
|
|
32
|
-
* <example-url>http://localhost:4200/#/common/data/data-source/datasource-cngxpaginate-manual-pipeline</example-url>
|
|
33
|
-
* <example-url>http://localhost:4200/#/common/data/data-source/signal-observable-bridge</example-url>
|
|
34
|
-
* <example-url>http://localhost:4200/#/common/data/paginate-list/paginated-list-cngxpaginate-cngxmatpaginator</example-url>
|
|
35
|
-
* <example-url>http://localhost:4200/#/common/data/paginate-list/uncontrolled-mode-zero-class-boilerplate</example-url>
|
|
36
|
-
*/
|
|
37
|
-
class CngxMatPaginator {
|
|
38
|
-
/** The `CngxPaginate` directive instance to connect to. */
|
|
39
|
-
cngxPaginateRef = input.required({ ...(ngDevMode ? { debugName: "cngxPaginateRef" } : /* istanbul ignore next */ {}), alias: 'cngxPaginateRef' });
|
|
40
|
-
/** Options for the page-size selector. */
|
|
41
|
-
pageSizeOptions = input([5, 10, 25], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : /* istanbul ignore next */ []));
|
|
42
|
-
ref = this.cngxPaginateRef;
|
|
43
|
-
handlePage(event) {
|
|
44
|
-
// setPageSize(..., false) suppresses the implicit page reset so the
|
|
45
|
-
// explicit setPage below lands the index mat-paginator already computed.
|
|
46
|
-
this.ref().setPageSize(event.pageSize, false);
|
|
47
|
-
this.ref().setPage(event.pageIndex);
|
|
48
|
-
}
|
|
49
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMatPaginator, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.4", type: CngxMatPaginator, isStandalone: true, selector: "cngx-mat-paginator", inputs: { cngxPaginateRef: { classPropertyName: "cngxPaginateRef", publicName: "cngxPaginateRef", isSignal: true, isRequired: true, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
51
|
-
<mat-paginator
|
|
52
|
-
[length]="ref().total()"
|
|
53
|
-
[pageIndex]="ref().pageIndex()"
|
|
54
|
-
[pageSize]="ref().pageSize()"
|
|
55
|
-
[pageSizeOptions]="pageSizeOptions()"
|
|
56
|
-
[disabled]="ref().isBusy()"
|
|
57
|
-
(page)="handlePage($event)"
|
|
58
|
-
/>
|
|
59
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: MatPaginatorModule }, { kind: "component", type: i1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
60
|
-
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMatPaginator, decorators: [{
|
|
62
|
-
type: Component,
|
|
63
|
-
args: [{
|
|
64
|
-
selector: 'cngx-mat-paginator',
|
|
65
|
-
standalone: true,
|
|
66
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
67
|
-
imports: [MatPaginatorModule],
|
|
68
|
-
template: `
|
|
69
|
-
<mat-paginator
|
|
70
|
-
[length]="ref().total()"
|
|
71
|
-
[pageIndex]="ref().pageIndex()"
|
|
72
|
-
[pageSize]="ref().pageSize()"
|
|
73
|
-
[pageSizeOptions]="pageSizeOptions()"
|
|
74
|
-
[disabled]="ref().isBusy()"
|
|
75
|
-
(page)="handlePage($event)"
|
|
76
|
-
/>
|
|
77
|
-
`,
|
|
78
|
-
}]
|
|
79
|
-
}], propDecorators: { cngxPaginateRef: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxPaginateRef", required: true }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }] } });
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @module @cngx/ui/material
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Generated bundle index. Do not edit.
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
export { CngxMatPaginator };
|
|
90
|
-
//# sourceMappingURL=cngx-ui-material.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-ui-material.mjs","sources":["../../../projects/ui/material/mat-paginator.ts","../../../projects/ui/material/public-api.ts","../../../projects/ui/material/cngx-ui-material.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { MatPaginatorModule, type PageEvent } from '@angular/material/paginator';\nimport { type CngxPaginate } from '@cngx/common/data';\n\n/**\n * Material paginator wrapper that connects to a {@link CngxPaginate} directive\n * via an explicit `[cngxPaginateRef]` input - no ancestor injection.\n *\n * ```html\n * <div cngxPaginate #pg=\"cngxPaginate\" [total]=\"items.length\">\n * <!-- table / list -->\n * </div>\n * <cngx-mat-paginator [cngxPaginateRef]=\"pg\" />\n * ```\n *\n * For SmartDataSource integration, expose `filteredCount` from the data source\n * and bind it to `[total]` on the element that carries `cngxPaginate`:\n * ```html\n * <div cngxPaginate #pg=\"cngxPaginate\" [total]=\"ds.filteredCount()\">\n * <mat-table [dataSource]=\"ds\" />\n * </div>\n * <cngx-mat-paginator [cngxPaginateRef]=\"pg\" />\n * ```\n *\n * @category ui/material\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/material/mat-paginator.ts\n * @since 0.1.0\n * @relatedTo CngxPaginate, CngxDataSource\n * <example-url>http://localhost:4200/#/common/data/data-source/datasource-cngxpaginate-manual-pipeline</example-url>\n * <example-url>http://localhost:4200/#/common/data/data-source/signal-observable-bridge</example-url>\n * <example-url>http://localhost:4200/#/common/data/paginate-list/paginated-list-cngxpaginate-cngxmatpaginator</example-url>\n * <example-url>http://localhost:4200/#/common/data/paginate-list/uncontrolled-mode-zero-class-boilerplate</example-url>\n */\n@Component({\n selector: 'cngx-mat-paginator',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatPaginatorModule],\n template: `\n <mat-paginator\n [length]=\"ref().total()\"\n [pageIndex]=\"ref().pageIndex()\"\n [pageSize]=\"ref().pageSize()\"\n [pageSizeOptions]=\"pageSizeOptions()\"\n [disabled]=\"ref().isBusy()\"\n (page)=\"handlePage($event)\"\n />\n `,\n})\nexport class CngxMatPaginator {\n /** The `CngxPaginate` directive instance to connect to. */\n readonly cngxPaginateRef = input.required<CngxPaginate>({ alias: 'cngxPaginateRef' });\n /** Options for the page-size selector. */\n readonly pageSizeOptions = input<number[]>([5, 10, 25]);\n\n protected readonly ref = this.cngxPaginateRef;\n\n protected handlePage(event: PageEvent): void {\n // setPageSize(..., false) suppresses the implicit page reset so the\n // explicit setPage below lands the index mat-paginator already computed.\n this.ref().setPageSize(event.pageSize, false);\n this.ref().setPage(event.pageIndex);\n }\n}\n","/**\n * @module @cngx/ui/material\n */\nexport { CngxMatPaginator } from './mat-paginator';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;MAiBU,gBAAgB,CAAA;;IAElB,eAAe,GAAG,KAAK,CAAC,QAAQ,sFAAiB,KAAK,EAAE,iBAAiB,EAAA,CAAG;;IAE5E,eAAe,GAAG,KAAK,CAAW,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,iBAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAC;AAEpC,IAAA,GAAG,GAAG,IAAI,CAAC,eAAe;AAEnC,IAAA,UAAU,CAAC,KAAgB,EAAA;;;AAGnC,QAAA,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC7C,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC;IACrC;uGAbW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,eAAA,EAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAXjB;;;;;;;;;AAST,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAVS,kBAAkB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,WAAA,EAAA,QAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,cAAA,EAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,MAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAYjB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAhB5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;oBAChB,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAC7B,oBAAA,QAAQ,EAAE;;;;;;;;;AAST,EAAA,CAAA;AACF,iBAAA;;;AClDD;;AAEG;;ACFH;;AAEG;;;;"}
|