@cngx/common 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 +18 -0
- package/a11y/README.md +77 -0
- package/card/README.md +79 -0
- package/chart/README.md +31 -0
- package/data/README.md +883 -0
- package/dialog/README.md +84 -0
- package/display/README.md +30 -0
- package/fesm2022/cngx-common-a11y.mjs +1260 -0
- package/fesm2022/cngx-common-a11y.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +765 -0
- package/fesm2022/cngx-common-card.mjs.map +1 -0
- package/fesm2022/cngx-common-chart.mjs +2943 -0
- package/fesm2022/cngx-common-chart.mjs.map +1 -0
- package/fesm2022/cngx-common-data.mjs +2886 -0
- package/fesm2022/cngx-common-data.mjs.map +1 -0
- package/fesm2022/cngx-common-dialog.mjs +1366 -0
- package/fesm2022/cngx-common-dialog.mjs.map +1 -0
- package/fesm2022/cngx-common-display.mjs +1603 -0
- package/fesm2022/cngx-common-display.mjs.map +1 -0
- package/fesm2022/cngx-common-interactive.mjs +8185 -0
- package/fesm2022/cngx-common-interactive.mjs.map +1 -0
- package/fesm2022/cngx-common-layout.mjs +1335 -0
- package/fesm2022/cngx-common-layout.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +1200 -0
- package/fesm2022/cngx-common-popover.mjs.map +1 -0
- package/fesm2022/cngx-common-stepper.mjs +1350 -0
- package/fesm2022/cngx-common-stepper.mjs.map +1 -0
- package/fesm2022/cngx-common-tabs.mjs +1551 -0
- package/fesm2022/cngx-common-tabs.mjs.map +1 -0
- package/fesm2022/cngx-common.mjs +34 -0
- package/fesm2022/cngx-common.mjs.map +1 -0
- package/interactive/README.md +211 -0
- package/layout/README.md +117 -0
- package/package.json +100 -0
- package/popover/README.md +218 -0
- package/stepper/README.md +102 -0
- package/tabs/README.md +32 -0
- package/types/cngx-common-a11y.d.ts +616 -0
- package/types/cngx-common-card.d.ts +413 -0
- package/types/cngx-common-chart.d.ts +1081 -0
- package/types/cngx-common-data.d.ts +1460 -0
- package/types/cngx-common-dialog.d.ts +772 -0
- package/types/cngx-common-display.d.ts +1136 -0
- package/types/cngx-common-interactive.d.ts +5013 -0
- package/types/cngx-common-layout.d.ts +737 -0
- package/types/cngx-common-popover.d.ts +520 -0
- package/types/cngx-common-stepper.d.ts +982 -0
- package/types/cngx-common-tabs.d.ts +1237 -0
- package/types/cngx-common.d.ts +13 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import * as i1 from '@cngx/common/a11y';
|
|
4
|
+
import { CngxAsyncState } from '@cngx/core/utils';
|
|
5
|
+
|
|
6
|
+
/** Reason why a card grid is empty — drives empty-state template selection. */
|
|
7
|
+
type EmptyReason = 'first-use' | 'no-results' | 'cleared';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Semantic card component that adapts its host element role based on the `as` input.
|
|
11
|
+
*
|
|
12
|
+
* Three archetypes:
|
|
13
|
+
* - `'article'` (default) — display card, no primary action
|
|
14
|
+
* - `'button'` — the entire card is a clickable button
|
|
15
|
+
* - `'link'` — the entire card is a navigation link
|
|
16
|
+
*
|
|
17
|
+
* The host element **is** the semantic element — no inner wrapper.
|
|
18
|
+
* This eliminates double focus rings and wrapper problems for screen readers.
|
|
19
|
+
*
|
|
20
|
+
* ### Action card with selection
|
|
21
|
+
* ```html
|
|
22
|
+
* <cngx-card as="button" [selectable]="true" [(selected)]="isSelected">
|
|
23
|
+
* <header cngxCardHeader><h3>Patient</h3></header>
|
|
24
|
+
* <div cngxCardBody>Details here</div>
|
|
25
|
+
* </cngx-card>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* ### Link card
|
|
29
|
+
* ```html
|
|
30
|
+
* <cngx-card as="link" href="/patients/42" ariaLabel="View patient">
|
|
31
|
+
* <img cngxCardMedia alt="Photo" />
|
|
32
|
+
* </cngx-card>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare class CngxCard {
|
|
36
|
+
private readonly uid;
|
|
37
|
+
private readonly rovingParent;
|
|
38
|
+
/** Semantic archetype: `'article'` (display), `'button'` (action), or `'link'` (navigation). */
|
|
39
|
+
readonly cardType: _angular_core.InputSignal<"article" | "link" | "button">;
|
|
40
|
+
/** Navigation URL when `as="link"`. Applied as `href` on the host. */
|
|
41
|
+
readonly href: _angular_core.InputSignal<string | undefined>;
|
|
42
|
+
/** Accessible label for the card. Overrides the default screen reader announcement. */
|
|
43
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
44
|
+
/** Two-way selection state. Only relevant when `selectable` is `true`. */
|
|
45
|
+
readonly selected: _angular_core.ModelSignal<boolean>;
|
|
46
|
+
/** Whether the card supports selection toggling. */
|
|
47
|
+
readonly selectable: _angular_core.InputSignal<boolean>;
|
|
48
|
+
/** Whether the card is in a loading state. Sets `aria-busy` and shows SR announcement. */
|
|
49
|
+
readonly loading: _angular_core.InputSignal<boolean>;
|
|
50
|
+
/** Whether the card is disabled. Prevents interaction and sets `aria-disabled`. */
|
|
51
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
52
|
+
/** Explanation for why the card is disabled. Communicated to SR via `aria-describedby`. */
|
|
53
|
+
readonly disabledReason: _angular_core.InputSignal<string | undefined>;
|
|
54
|
+
/** Whether this card is interactive (button or link). */
|
|
55
|
+
readonly interactive: _angular_core.Signal<boolean>;
|
|
56
|
+
/** @internal Host href for link cards. */
|
|
57
|
+
protected readonly hostHref: _angular_core.Signal<string | null>;
|
|
58
|
+
/** @internal Host element ARIA role. */
|
|
59
|
+
protected readonly hostRole: _angular_core.Signal<"article" | "link" | "button">;
|
|
60
|
+
/**
|
|
61
|
+
* @internal Tabindex management.
|
|
62
|
+
* When inside a CngxRovingTabindex parent (e.g. CngxCardGrid), the roving
|
|
63
|
+
* controller manages tabindex via CngxRovingItem — card does not set its own.
|
|
64
|
+
* When standalone, interactive cards get tabindex="0".
|
|
65
|
+
*/
|
|
66
|
+
protected readonly hostTabindex: _angular_core.Signal<0 | null>;
|
|
67
|
+
/** @internal */
|
|
68
|
+
protected readonly disabledReasonId: string;
|
|
69
|
+
/** @internal */
|
|
70
|
+
protected readonly liveRegionId: string;
|
|
71
|
+
/** @internal IDs for `aria-describedby` — always present, aria-hidden controls what SR reads. */
|
|
72
|
+
protected readonly describedByIds: _angular_core.Signal<string>;
|
|
73
|
+
/** @internal SR live announcement for state changes. */
|
|
74
|
+
protected readonly liveAnnouncement: _angular_core.Signal<"Loading" | "Selected" | "Deselected" | "">;
|
|
75
|
+
/** Emits when an interactive card is clicked or activated via keyboard. */
|
|
76
|
+
readonly clicked: _angular_core.OutputEmitterRef<void>;
|
|
77
|
+
/** @internal */
|
|
78
|
+
protected handleHostClick(e: MouseEvent): void;
|
|
79
|
+
/** @internal */
|
|
80
|
+
protected handleHostKeydown(e: Event): void;
|
|
81
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCard, never>;
|
|
82
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCard, "cngx-card", never, { "cardType": { "alias": "as"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "clicked": "clicked"; }, never, ["[cngxCardMedia]", "header[cngxCardHeader]", "[cngxCardBody]", "footer[cngxCardFooter]", "[cngxCardActions]", "*"], true, [{ directive: typeof i1.CngxRovingItem; inputs: {}; outputs: {}; }]>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Structural slot directive for the card header region.
|
|
87
|
+
*
|
|
88
|
+
* Must be placed on a native `<header>` element — the selector enforces
|
|
89
|
+
* semantic correctness at compile time.
|
|
90
|
+
*
|
|
91
|
+
* ```html
|
|
92
|
+
* <cngx-card>
|
|
93
|
+
* <header cngxCardHeader>
|
|
94
|
+
* <h3 cngxCardTitle>Title</h3>
|
|
95
|
+
* </header>
|
|
96
|
+
* </cngx-card>
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
declare class CngxCardHeader {
|
|
100
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardHeader, never>;
|
|
101
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardHeader, "header[cngxCardHeader]", never, {}, {}, never, never, true, never>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Marks an element as the card's primary title.
|
|
106
|
+
*
|
|
107
|
+
* Provides consistent font sizing and weight. Typically placed on
|
|
108
|
+
* a heading element inside `[cngxCardHeader]`.
|
|
109
|
+
*
|
|
110
|
+
* ```html
|
|
111
|
+
* <cngx-card>
|
|
112
|
+
* <header cngxCardHeader>
|
|
113
|
+
* <h3 cngxCardTitle>Patient Overview</h3>
|
|
114
|
+
* <span cngxCardSubtitle>Room 12</span>
|
|
115
|
+
* </header>
|
|
116
|
+
* </cngx-card>
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare class CngxCardTitle {
|
|
120
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardTitle, never>;
|
|
121
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardTitle, "[cngxCardTitle]", never, {}, {}, never, never, true, never>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Marks an element as the card's subtitle — secondary text below the title.
|
|
126
|
+
*
|
|
127
|
+
* ```html
|
|
128
|
+
* <cngx-card>
|
|
129
|
+
* <header cngxCardHeader>
|
|
130
|
+
* <h3 cngxCardTitle>Maria Muster</h3>
|
|
131
|
+
* <span cngxCardSubtitle>Zimmer 12, Station 3A</span>
|
|
132
|
+
* </header>
|
|
133
|
+
* </cngx-card>
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
declare class CngxCardSubtitle {
|
|
137
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardSubtitle, never>;
|
|
138
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardSubtitle, "[cngxCardSubtitle]", never, {}, {}, never, never, true, never>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Structural slot directive for the card body region.
|
|
143
|
+
*
|
|
144
|
+
* ```html
|
|
145
|
+
* <cngx-card>
|
|
146
|
+
* <div cngxCardBody>Main content here</div>
|
|
147
|
+
* </cngx-card>
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
declare class CngxCardBody {
|
|
151
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardBody, never>;
|
|
152
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardBody, "[cngxCardBody]", never, {}, {}, never, never, true, never>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Structural slot directive for the card media region (images, videos, icons).
|
|
157
|
+
*
|
|
158
|
+
* When `decorative` is `true` (default), the media is hidden from screen readers
|
|
159
|
+
* via `aria-hidden`. Set to `false` when the image carries meaningful information.
|
|
160
|
+
*
|
|
161
|
+
* ```html
|
|
162
|
+
* <cngx-card>
|
|
163
|
+
* <img cngxCardMedia [decorative]="false" alt="Photo of patient" />
|
|
164
|
+
* </cngx-card>
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
declare class CngxCardMedia {
|
|
168
|
+
/** Whether this media is purely decorative (hidden from SR). */
|
|
169
|
+
readonly decorative: _angular_core.InputSignal<boolean>;
|
|
170
|
+
/** Aspect ratio applied via CSS `aspect-ratio` property. */
|
|
171
|
+
readonly aspectRatio: _angular_core.InputSignal<"16/9" | "4/3" | "1/1" | "auto">;
|
|
172
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardMedia, never>;
|
|
173
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardMedia, "[cngxCardMedia]", never, { "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Structural slot directive for the card footer region.
|
|
178
|
+
*
|
|
179
|
+
* Must be placed on a native `<footer>` element — the selector enforces
|
|
180
|
+
* semantic correctness at compile time.
|
|
181
|
+
*
|
|
182
|
+
* ```html
|
|
183
|
+
* <cngx-card>
|
|
184
|
+
* <footer cngxCardFooter>Footer content</footer>
|
|
185
|
+
* </cngx-card>
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
declare class CngxCardFooter {
|
|
189
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardFooter, never>;
|
|
190
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardFooter, "footer[cngxCardFooter]", never, {}, {}, never, never, true, never>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Structural slot directive for the card actions region.
|
|
195
|
+
*
|
|
196
|
+
* Contains independent action buttons within an interactive card.
|
|
197
|
+
* Actions are separated from the card body by a divider.
|
|
198
|
+
*
|
|
199
|
+
* ```html
|
|
200
|
+
* <cngx-card>
|
|
201
|
+
* <div cngxCardActions align="end">
|
|
202
|
+
* <button>Edit</button>
|
|
203
|
+
* <button>Delete</button>
|
|
204
|
+
* </div>
|
|
205
|
+
* </cngx-card>
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
declare class CngxCardActions {
|
|
209
|
+
/** Horizontal alignment of actions. */
|
|
210
|
+
readonly align: _angular_core.InputSignal<"start" | "end">;
|
|
211
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardActions, never>;
|
|
212
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardActions, "[cngxCardActions]", never, { "align": { "alias": "align"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Positions a badge element at a corner of its parent card.
|
|
217
|
+
*
|
|
218
|
+
* Typically used for status indicators (P-badges, notification dots)
|
|
219
|
+
* that float in the card's top-right corner.
|
|
220
|
+
*
|
|
221
|
+
* ```html
|
|
222
|
+
* <cngx-card>
|
|
223
|
+
* <cngx-status-badge cngxCardBadge status="pending" variant="dot" />
|
|
224
|
+
* <header cngxCardHeader>Pflegeplan</header>
|
|
225
|
+
* </cngx-card>
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
declare class CngxCardBadge {
|
|
229
|
+
/** Corner position using logical properties. */
|
|
230
|
+
readonly position: _angular_core.InputSignal<"top-start" | "top-end" | "bottom-start" | "bottom-end">;
|
|
231
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardBadge, never>;
|
|
232
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardBadge, "[cngxCardBadge]", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Adds a color-coded severity accent to a card.
|
|
237
|
+
*
|
|
238
|
+
* Renders as a colored top border + tinted background to communicate
|
|
239
|
+
* status visually. Differentiates by both color and border width
|
|
240
|
+
* (not just color — WCAG 1.4.1).
|
|
241
|
+
*
|
|
242
|
+
* ```html
|
|
243
|
+
* <cngx-card cngxCardAccent="warning">
|
|
244
|
+
* <header cngxCardHeader>
|
|
245
|
+
* <h3 cngxCardTitle>Blutzucker</h3>
|
|
246
|
+
* </header>
|
|
247
|
+
* </cngx-card>
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
declare class CngxCardAccent {
|
|
251
|
+
/** Severity level controlling the accent color. */
|
|
252
|
+
readonly severity: _angular_core.InputSignal<"info" | "success" | "warning" | "danger" | "neutral">;
|
|
253
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardAccent, never>;
|
|
254
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardAccent, "[cngxCardAccent]", never, { "severity": { "alias": "cngxCardAccent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Skeleton placeholder for card content during loading.
|
|
259
|
+
*
|
|
260
|
+
* Renders shimmer rectangles that match typical card layout patterns.
|
|
261
|
+
* Use alongside `@if (loading())` to swap real content with the skeleton.
|
|
262
|
+
*
|
|
263
|
+
* ```html
|
|
264
|
+
* <cngx-card [loading]="loading()">
|
|
265
|
+
* @if (loading()) {
|
|
266
|
+
* <cngx-card-skeleton [lines]="3" [showMedia]="true" />
|
|
267
|
+
* } @else {
|
|
268
|
+
* <header cngxCardHeader>...</header>
|
|
269
|
+
* <div cngxCardBody>...</div>
|
|
270
|
+
* }
|
|
271
|
+
* </cngx-card>
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
declare class CngxCardSkeleton {
|
|
275
|
+
/** Number of body text lines to show. */
|
|
276
|
+
readonly lines: _angular_core.InputSignal<number>;
|
|
277
|
+
/** Whether to show a media placeholder block. */
|
|
278
|
+
readonly showMedia: _angular_core.InputSignal<boolean>;
|
|
279
|
+
/** @internal */
|
|
280
|
+
protected readonly lineArray: _angular_core.Signal<unknown[]>;
|
|
281
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardSkeleton, never>;
|
|
282
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCardSkeleton, "cngx-card-skeleton", never, { "lines": { "alias": "lines"; "required": false; "isSignal": true; }; "showMedia": { "alias": "showMedia"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Marker directive placed on `<ng-template>` inside a `<cngx-card-grid>`.
|
|
287
|
+
*
|
|
288
|
+
* The grid selects the template whose `reason` matches the grid's `emptyReason` input.
|
|
289
|
+
* A template without a reason acts as the default fallback.
|
|
290
|
+
*
|
|
291
|
+
* ```html
|
|
292
|
+
* <cngx-card-grid [items]="items()" [emptyReason]="emptyReason()">
|
|
293
|
+
* <ng-template cngxCardGridEmpty="no-results">
|
|
294
|
+
* No results found.
|
|
295
|
+
* </ng-template>
|
|
296
|
+
* <ng-template cngxCardGridEmpty>
|
|
297
|
+
* Nothing here yet.
|
|
298
|
+
* </ng-template>
|
|
299
|
+
* </cngx-card-grid>
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
declare class CngxCardGridEmpty {
|
|
303
|
+
/** Empty-state reason this template handles. Omit for a default fallback. */
|
|
304
|
+
readonly reason: _angular_core.InputSignal<"" | EmptyReason | undefined>;
|
|
305
|
+
/** @internal Template reference used by `CngxCardGrid` to render the empty state. */
|
|
306
|
+
readonly templateRef: TemplateRef<any>;
|
|
307
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardGridEmpty, never>;
|
|
308
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxCardGridEmpty, "[cngxCardGridEmpty]", never, { "reason": { "alias": "cngxCardGridEmpty"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Responsive card grid layout with intrinsic sizing, keyboard navigation,
|
|
313
|
+
* and reason-based empty-state template selection.
|
|
314
|
+
*
|
|
315
|
+
* Uses CSS Grid with `auto-fill` + `minmax` for intrinsic responsiveness —
|
|
316
|
+
* no breakpoint management required.
|
|
317
|
+
*
|
|
318
|
+
* Keyboard navigation is provided by `CngxRovingTabindex` as a host directive.
|
|
319
|
+
* Arrow keys navigate between cards; Enter/Space activates.
|
|
320
|
+
*
|
|
321
|
+
* ### Basic grid
|
|
322
|
+
* ```html
|
|
323
|
+
* <cngx-card-grid minWidth="280px">
|
|
324
|
+
* <cngx-card>...</cngx-card>
|
|
325
|
+
* <cngx-card>...</cngx-card>
|
|
326
|
+
* </cngx-card-grid>
|
|
327
|
+
* ```
|
|
328
|
+
*
|
|
329
|
+
* ### With empty state
|
|
330
|
+
* ```html
|
|
331
|
+
* <cngx-card-grid [items]="items()" [emptyReason]="emptyReason()">
|
|
332
|
+
* @for (item of items(); track item.id) {
|
|
333
|
+
* <cngx-card>...</cngx-card>
|
|
334
|
+
* }
|
|
335
|
+
* <ng-template cngxCardGridEmpty="no-results">
|
|
336
|
+
* <cngx-empty-state title="No results" />
|
|
337
|
+
* </ng-template>
|
|
338
|
+
* <ng-template cngxCardGridEmpty>
|
|
339
|
+
* <cngx-empty-state title="Nothing here yet" />
|
|
340
|
+
* </ng-template>
|
|
341
|
+
* </cngx-card-grid>
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
declare class CngxCardGrid {
|
|
345
|
+
/** Minimum card width for the CSS Grid `minmax()` function. */
|
|
346
|
+
readonly minWidth: _angular_core.InputSignal<string>;
|
|
347
|
+
/** Gap between grid items. */
|
|
348
|
+
readonly gap: _angular_core.InputSignal<string>;
|
|
349
|
+
/** Grid density level — controls gap and card padding via CSS custom properties. */
|
|
350
|
+
readonly density: _angular_core.InputSignal<"compact" | "default" | "comfortable">;
|
|
351
|
+
/** Whether the grid should have `role="list"`. Requires `role="listitem"` on each card. */
|
|
352
|
+
readonly semanticList: _angular_core.InputSignal<boolean>;
|
|
353
|
+
/**
|
|
354
|
+
* Optional data source. When provided and empty, the grid shows the matching
|
|
355
|
+
* empty-state template. When omitted, the grid is a pure layout tool.
|
|
356
|
+
*/
|
|
357
|
+
readonly items: _angular_core.InputSignal<readonly unknown[] | undefined>;
|
|
358
|
+
/** Reason why items are empty — selects the matching `cngxCardGridEmpty` template. */
|
|
359
|
+
readonly emptyReason: _angular_core.InputSignal<EmptyReason | undefined>;
|
|
360
|
+
/**
|
|
361
|
+
* Bind an async state — drives loading and empty from a single source.
|
|
362
|
+
* When set, `isLoading` derives from `state.isFirstLoad()` and
|
|
363
|
+
* `empty` derives from `state.isEmpty()` (overrides `[items]`).
|
|
364
|
+
*/
|
|
365
|
+
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
366
|
+
/** `true` during initial data load (skeleton phase). */
|
|
367
|
+
readonly isLoading: _angular_core.Signal<boolean>;
|
|
368
|
+
/** Whether the grid should show an empty state. */
|
|
369
|
+
readonly empty: _angular_core.Signal<boolean>;
|
|
370
|
+
/** @internal All `ng-template[cngxCardGridEmpty]` instances projected by the consumer. */
|
|
371
|
+
private readonly emptyTemplates;
|
|
372
|
+
/**
|
|
373
|
+
* @internal Selects the template matching `emptyReason`.
|
|
374
|
+
* Falls back to a template without a reason as default.
|
|
375
|
+
*/
|
|
376
|
+
readonly activeEmptyTemplate: _angular_core.Signal<CngxCardGridEmpty | undefined>;
|
|
377
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardGrid, never>;
|
|
378
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCardGrid, "cngx-card-grid", never, { "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "gap": { "alias": "gap"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "semanticList": { "alias": "semanticList"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "emptyReason": { "alias": "emptyReason"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; }, {}, ["emptyTemplates"], ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; "loop": "loop"; "activeIndex": "activeIndex"; "virtualCount": "virtualCount"; }; outputs: {}; }]>;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Displays a formatted date/timestamp, typically in a card footer.
|
|
383
|
+
*
|
|
384
|
+
* Uses `Intl.DateTimeFormat` with the injected `LOCALE_ID`.
|
|
385
|
+
*
|
|
386
|
+
* ```html
|
|
387
|
+
* <cngx-card>
|
|
388
|
+
* <footer cngxCardFooter>
|
|
389
|
+
* <cngx-card-timestamp [date]="evaluationDate()" prefix="Evaluierung am:" />
|
|
390
|
+
* </footer>
|
|
391
|
+
* </cngx-card>
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
declare class CngxCardTimestamp {
|
|
395
|
+
private readonly locale;
|
|
396
|
+
/** Date to display. Accepts Date objects or ISO strings. */
|
|
397
|
+
readonly date: _angular_core.InputSignal<string | Date>;
|
|
398
|
+
/** Optional prefix text before the date (e.g. "Evaluierung am:"). */
|
|
399
|
+
readonly prefix: _angular_core.InputSignal<string | undefined>;
|
|
400
|
+
/** `Intl.DateTimeFormatOptions` for the date. */
|
|
401
|
+
readonly format: _angular_core.InputSignal<Intl.DateTimeFormatOptions | undefined>;
|
|
402
|
+
/** @internal */
|
|
403
|
+
protected readonly dateObj: _angular_core.Signal<Date>;
|
|
404
|
+
/** @internal */
|
|
405
|
+
protected readonly isoDate: _angular_core.Signal<string>;
|
|
406
|
+
/** @internal */
|
|
407
|
+
protected readonly formattedDate: _angular_core.Signal<string>;
|
|
408
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCardTimestamp, never>;
|
|
409
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCardTimestamp, "cngx-card-timestamp", never, { "date": { "alias": "date"; "required": true; "isSignal": true; }; "prefix": { "alias": "prefix"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export { CngxCard, CngxCardAccent, CngxCardActions, CngxCardBadge, CngxCardBody, CngxCardFooter, CngxCardGrid, CngxCardGridEmpty, CngxCardHeader, CngxCardMedia, CngxCardSkeleton, CngxCardSubtitle, CngxCardTimestamp, CngxCardTitle };
|
|
413
|
+
export type { EmptyReason };
|