@cngx/common 0.1.0-rc.8 → 0.3.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/a11y/README.md +15 -2
- package/button/README.md +258 -0
- package/command/README.md +42 -2
- package/data/README.md +15 -12
- package/fesm2022/cngx-common-a11y.mjs +1076 -319
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +99 -77
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-button.mjs +1084 -0
- package/fesm2022/cngx-common-button.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +138 -78
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +799 -327
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +101 -25
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +861 -423
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +198 -160
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +693 -329
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7303 -2774
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2174 -442
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-menu-button.mjs +557 -0
- package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +2109 -557
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +548 -419
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +442 -331
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +44 -71
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +10 -10
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +30 -19
- package/layout/README.md +17 -1
- package/menu-button/README.md +234 -0
- package/package.json +31 -8
- package/popover/README.md +81 -4
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +96 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +5 -5
- package/theming/components/cngx-accordion.css +36 -7
- package/theming/components/cngx-async.css +185 -37
- package/theming/components/cngx-backdrop.css +3 -1
- package/theming/components/cngx-badge.css +20 -5
- package/theming/components/cngx-bottom-sheet.css +2 -0
- package/theming/components/cngx-breadcrumb.css +3 -1
- package/theming/components/cngx-button-group.css +325 -0
- package/theming/components/cngx-button-toggle.css +55 -23
- package/theming/components/cngx-button.css +975 -0
- package/theming/components/cngx-data-grid.css +2 -0
- package/theming/components/cngx-dialog.css +3 -1
- package/theming/components/cngx-divider.css +24 -9
- package/theming/components/cngx-drawer.css +153 -0
- package/theming/components/cngx-icon-glyph.css +76 -0
- package/theming/components/cngx-listbox.css +79 -25
- package/theming/components/cngx-menu.css +112 -52
- package/theming/components/cngx-nav.css +1220 -0
- package/theming/components/cngx-popover-sheet.css +434 -0
- package/theming/components/cngx-popover.css +37 -9
- package/theming/components/cngx-recycler-placeholder.css +2 -0
- package/theming/components/cngx-ripple.css +74 -16
- package/theming/components/cngx-sidebar.css +71 -0
- package/theming/components/cngx-slider.css +3 -1
- package/theming/components/cngx-tooltip.css +2 -0
- package/timeline/README.md +2 -2
- package/types/cngx-common-a11y.d.ts +488 -112
- package/types/cngx-common-audio.d.ts +60 -88
- package/types/cngx-common-button.d.ts +698 -0
- package/types/cngx-common-card.d.ts +104 -78
- package/types/cngx-common-chart.d.ts +677 -389
- package/types/cngx-common-command.d.ts +55 -41
- package/types/cngx-common-data.d.ts +506 -360
- package/types/cngx-common-dialog.d.ts +94 -127
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4383 -1721
- package/types/cngx-common-layout.d.ts +1399 -288
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +990 -268
- package/types/cngx-common-stepper.d.ts +374 -465
- package/types/cngx-common-tabs.d.ts +309 -403
- package/types/cngx-common-timeline.d.ts +50 -109
|
@@ -14,8 +14,6 @@ import { CngxMessage } from '@cngx/core/i18n';
|
|
|
14
14
|
* `groupLabel` fallback), not to the presenter. `key` is stable and
|
|
15
15
|
* collision-free across the built-in groupers, so it doubles as the
|
|
16
16
|
* `@for` track expression and as the `aria-labelledby` id seed.
|
|
17
|
-
*
|
|
18
|
-
* @category common/timeline
|
|
19
17
|
*/
|
|
20
18
|
interface TimelineGroup<T> {
|
|
21
19
|
/** Stable bucket identity, e.g. `2026-07-27` for `day`. */
|
|
@@ -32,8 +30,6 @@ interface TimelineGroup<T> {
|
|
|
32
30
|
/**
|
|
33
31
|
* What a {@link TimelineGroupingFn} returns for a single item: the bucket
|
|
34
32
|
* it belongs to, and the instant that bucket starts at.
|
|
35
|
-
*
|
|
36
|
-
* @category common/timeline
|
|
37
33
|
*/
|
|
38
34
|
interface TimelineGroupKey {
|
|
39
35
|
readonly key: string;
|
|
@@ -46,8 +42,6 @@ interface TimelineGroupKey {
|
|
|
46
42
|
* (tenant, channel) as well as time.
|
|
47
43
|
*
|
|
48
44
|
* Called once per item per recomputation; keep it pure and cheap.
|
|
49
|
-
*
|
|
50
|
-
* @category common/timeline
|
|
51
45
|
*/
|
|
52
46
|
type TimelineGroupingFn<T> = (date: Date, item: T) => TimelineGroupKey;
|
|
53
47
|
/**
|
|
@@ -58,32 +52,24 @@ type TimelineGroupingFn<T> = (date: Date, item: T) => TimelineGroupKey;
|
|
|
58
52
|
*
|
|
59
53
|
* `'none'` collapses everything into one synthetic group, which is how the
|
|
60
54
|
* organism renders an ungrouped `role="list"` without a second code path.
|
|
61
|
-
*
|
|
62
|
-
* @category common/timeline
|
|
63
55
|
*/
|
|
64
56
|
type TimelineGroupBy<T> = 'day' | 'week' | 'month' | 'none' | TimelineGroupingFn<T>;
|
|
65
57
|
/**
|
|
66
58
|
* Sort direction for the whole timeline. `'desc'` (default) is
|
|
67
59
|
* newest-first, the activity-feed convention; `'asc'` is oldest-first,
|
|
68
60
|
* which reads better for narrative histories.
|
|
69
|
-
*
|
|
70
|
-
* @category common/timeline
|
|
71
61
|
*/
|
|
72
62
|
type TimelineDirection = 'asc' | 'desc';
|
|
73
63
|
/**
|
|
74
64
|
* Pulls the timestamp out of a consumer item. Anything the `Date`
|
|
75
65
|
* constructor accepts works, so ISO strings straight off an API response
|
|
76
66
|
* need no pre-mapping.
|
|
77
|
-
*
|
|
78
|
-
* @category common/timeline
|
|
79
67
|
*/
|
|
80
68
|
type TimelineDateAccessor<T> = (item: T) => Date | string | number;
|
|
81
69
|
/**
|
|
82
70
|
* Inputs to {@link createTimelineGrouping}. Every reactive knob is a
|
|
83
71
|
* zero-arg accessor, so a `Signal` (or an `input()`) can be passed
|
|
84
72
|
* directly and a constant is just `() => 'day'`.
|
|
85
|
-
*
|
|
86
|
-
* @category common/timeline
|
|
87
73
|
*/
|
|
88
74
|
interface TimelineGroupingOptions<T> {
|
|
89
75
|
/** Source list. Read inside the `groups` computation, so it is tracked. */
|
|
@@ -110,8 +96,6 @@ interface TimelineGroupingOptions<T> {
|
|
|
110
96
|
* What {@link createTimelineGrouping} hands back. An object rather than a
|
|
111
97
|
* bare `Signal` because the v2 live cursor extends this surface - callers
|
|
112
98
|
* written against v1 keep compiling.
|
|
113
|
-
*
|
|
114
|
-
* @category common/timeline
|
|
115
99
|
*/
|
|
116
100
|
interface TimelineGrouping<T> {
|
|
117
101
|
readonly groups: Signal<readonly TimelineGroup<T>[]>;
|
|
@@ -155,16 +139,13 @@ interface TimelineGrouping<T> {
|
|
|
155
139
|
* });
|
|
156
140
|
* ```
|
|
157
141
|
*
|
|
158
|
-
* @category common/timeline
|
|
159
142
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/grouping.ts
|
|
160
|
-
* @since 0.
|
|
143
|
+
* @since 0.3.0
|
|
161
144
|
*/
|
|
162
145
|
declare function createTimelineGrouping<T>(options: TimelineGroupingOptions<T>): TimelineGrouping<T>;
|
|
163
146
|
/**
|
|
164
147
|
* Signature of {@link createTimelineGrouping}, carried as a named type so
|
|
165
148
|
* a DI override matches it exactly.
|
|
166
|
-
*
|
|
167
|
-
* @category common/timeline
|
|
168
149
|
*/
|
|
169
150
|
type CngxTimelineGroupingFactory = <T>(options: TimelineGroupingOptions<T>) => TimelineGrouping<T>;
|
|
170
151
|
/**
|
|
@@ -182,10 +163,9 @@ type CngxTimelineGroupingFactory = <T>(options: TimelineGroupingOptions<T>) => T
|
|
|
182
163
|
* Same shape as `CNGX_SELECTION_CONTROLLER_FACTORY`: the internals of a
|
|
183
164
|
* component are swappable without forking the component.
|
|
184
165
|
*
|
|
185
|
-
* @category common/timeline
|
|
186
166
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/grouping.ts
|
|
187
167
|
* @relatedTo createTimelineGrouping
|
|
188
|
-
* @since 0.
|
|
168
|
+
* @since 0.3.0
|
|
189
169
|
*/
|
|
190
170
|
declare const CNGX_TIMELINE_GROUPING_FACTORY: InjectionToken<CngxTimelineGroupingFactory>;
|
|
191
171
|
|
|
@@ -197,8 +177,6 @@ declare const CNGX_TIMELINE_GROUPING_FACTORY: InjectionToken<CngxTimelineGroupin
|
|
|
197
177
|
* what the user may do about it. A timeline that needed `disabled`,
|
|
198
178
|
* `editable` or `current` would be a stepper, and steppers live in
|
|
199
179
|
* `@cngx/common/stepper` with their own flow logic.
|
|
200
|
-
*
|
|
201
|
-
* @category common/timeline
|
|
202
180
|
*/
|
|
203
181
|
type TimelineStatus = 'done' | 'active' | 'upcoming' | 'rejected';
|
|
204
182
|
/**
|
|
@@ -229,11 +207,10 @@ type TimelineStatus = 'done' | 'active' | 'upcoming' | 'rejected';
|
|
|
229
207
|
* <cngx-timeline-marker status="active" busy />
|
|
230
208
|
* ```
|
|
231
209
|
*
|
|
232
|
-
* @category common/timeline
|
|
233
210
|
* @wcag AA
|
|
234
211
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/marker.component.ts
|
|
235
212
|
* @relatedTo CngxTimelineConnector
|
|
236
|
-
* @since 0.
|
|
213
|
+
* @since 0.3.0
|
|
237
214
|
*/
|
|
238
215
|
declare class CngxTimelineMarker {
|
|
239
216
|
/**
|
|
@@ -262,8 +239,6 @@ declare class CngxTimelineMarker {
|
|
|
262
239
|
*
|
|
263
240
|
* `'only'` renders nothing at all - a single-item timeline has no rail to
|
|
264
241
|
* draw.
|
|
265
|
-
*
|
|
266
|
-
* @category common/timeline
|
|
267
242
|
*/
|
|
268
243
|
type TimelineConnectorPosition = 'middle' | 'first' | 'last' | 'only';
|
|
269
244
|
/**
|
|
@@ -290,11 +265,10 @@ type TimelineConnectorPosition = 'middle' | 'first' | 'last' | 'only';
|
|
|
290
265
|
* <cngx-timeline-connector position="last" />
|
|
291
266
|
* ```
|
|
292
267
|
*
|
|
293
|
-
* @category common/timeline
|
|
294
268
|
* @wcag AA
|
|
295
269
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/connector.component.ts
|
|
296
270
|
* @relatedTo CngxTimelineMarker
|
|
297
|
-
* @since 0.
|
|
271
|
+
* @since 0.3.0
|
|
298
272
|
*/
|
|
299
273
|
declare class CngxTimelineConnector {
|
|
300
274
|
/**
|
|
@@ -320,8 +294,6 @@ declare class CngxTimelineConnector {
|
|
|
320
294
|
*
|
|
321
295
|
* Pair it with `<cngx-time>` from `@cngx/common/display` for relative
|
|
322
296
|
* formatting; the timeline neither formats nor ticks.
|
|
323
|
-
*
|
|
324
|
-
* @category common/timeline
|
|
325
297
|
*/
|
|
326
298
|
declare class CngxTimelineTime {
|
|
327
299
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineTime, never>;
|
|
@@ -356,10 +328,9 @@ declare class CngxTimelineTime {
|
|
|
356
328
|
* grid can fix that, because the paint follows `[data-row-side]` while the
|
|
357
329
|
* DOM order does not.
|
|
358
330
|
*
|
|
359
|
-
* @category common/timeline
|
|
360
331
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-item.component.ts
|
|
361
332
|
* @relatedTo CngxTimelineItem, CngxTimelineTime
|
|
362
|
-
* @since 0.
|
|
333
|
+
* @since 0.3.0
|
|
363
334
|
*/
|
|
364
335
|
declare class CngxTimelineOpposite {
|
|
365
336
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineOpposite, never>;
|
|
@@ -376,8 +347,6 @@ declare class CngxTimelineOpposite {
|
|
|
376
347
|
* without the timeline's default being torn out for the rest.
|
|
377
348
|
*
|
|
378
349
|
* Whatever renders here is inside an `aria-hidden` element - decoration only.
|
|
379
|
-
*
|
|
380
|
-
* @category common/timeline
|
|
381
350
|
*/
|
|
382
351
|
declare class CngxTimelineMarkerContent {
|
|
383
352
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineMarkerContent, never>;
|
|
@@ -388,8 +357,6 @@ declare class CngxTimelineMarkerContent {
|
|
|
388
357
|
* projected without a slot directive lands in the body too. Reach for it
|
|
389
358
|
* when the item also projects a timestamp and the source order would
|
|
390
359
|
* otherwise be ambiguous.
|
|
391
|
-
*
|
|
392
|
-
* @category common/timeline
|
|
393
360
|
*/
|
|
394
361
|
declare class CngxTimelineContent {
|
|
395
362
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineContent, never>;
|
|
@@ -436,17 +403,16 @@ declare class CngxTimelineContent {
|
|
|
436
403
|
* </cngx-timeline-item>
|
|
437
404
|
* ```
|
|
438
405
|
*
|
|
439
|
-
* @category common/timeline
|
|
440
|
-
* @docsKind primary
|
|
441
406
|
* @wcag AA
|
|
442
407
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-item.component.ts
|
|
443
408
|
* @relatedTo CngxTimelineMarker, CngxTimelineConnector, CNGX_TIMELINE_CONFIG
|
|
444
|
-
* <example-url
|
|
445
|
-
* <example-url
|
|
446
|
-
* <example-url
|
|
447
|
-
* <example-url
|
|
448
|
-
* <example-url
|
|
449
|
-
* @since 0.
|
|
409
|
+
* <example-url>/#/ui/timeline/basics/standalone-atoms</example-url>
|
|
410
|
+
* <example-url>/#/ui/timeline/basics/custom-date-header-and-marker</example-url>
|
|
411
|
+
* <example-url>/#/ui/timeline/basics/marker-precedence</example-url>
|
|
412
|
+
* <example-url>/#/ui/timeline/layout/media-markers</example-url>
|
|
413
|
+
* <example-url>/#/ui/timeline/layout/placement-end</example-url>
|
|
414
|
+
* @since 0.3.0
|
|
415
|
+
* @axis level atom
|
|
450
416
|
*/
|
|
451
417
|
declare class CngxTimelineItem {
|
|
452
418
|
private readonly labels;
|
|
@@ -527,8 +493,6 @@ declare class CngxTimelineItem {
|
|
|
527
493
|
* `first` and `last` are positions **within the group**, not within the
|
|
528
494
|
* whole timeline, because that is what a consumer needs to decide whether
|
|
529
495
|
* to draw a trailing rail.
|
|
530
|
-
*
|
|
531
|
-
* @category common/timeline
|
|
532
496
|
*/
|
|
533
497
|
interface CngxTimelineItemContext<T> {
|
|
534
498
|
readonly $implicit: T;
|
|
@@ -563,10 +527,9 @@ interface CngxTimelineItemContext<T> {
|
|
|
563
527
|
* `CngxTimelineItem` component; the selector stays `cngxTimelineItem`,
|
|
564
528
|
* which is what consumers write.
|
|
565
529
|
*
|
|
566
|
-
* @category common/timeline
|
|
567
530
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
568
531
|
* @relatedTo CngxTimelineItem, CngxTimelineDateHeader
|
|
569
|
-
* @since 0.
|
|
532
|
+
* @since 0.3.0
|
|
570
533
|
*/
|
|
571
534
|
declare class CngxTimelineItemTpl<T = unknown> {
|
|
572
535
|
/**
|
|
@@ -597,8 +560,6 @@ declare class CngxTimelineItemTpl<T = unknown> {
|
|
|
597
560
|
/**
|
|
598
561
|
* Context for `*cngxTimelineDateHeader` - the whole group, so a header can
|
|
599
562
|
* show its item count alongside the date.
|
|
600
|
-
*
|
|
601
|
-
* @category common/timeline
|
|
602
563
|
*/
|
|
603
564
|
interface CngxTimelineDateHeaderContext<T> {
|
|
604
565
|
readonly $implicit: TimelineGroup<T>;
|
|
@@ -617,11 +578,10 @@ interface CngxTimelineDateHeaderContext<T> {
|
|
|
617
578
|
* </ng-template>
|
|
618
579
|
* ```
|
|
619
580
|
*
|
|
620
|
-
* @category common/timeline
|
|
621
581
|
* @wcag AA
|
|
622
582
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
623
583
|
* @relatedTo CngxTimelineItemTpl
|
|
624
|
-
* @since 0.
|
|
584
|
+
* @since 0.3.0
|
|
625
585
|
*/
|
|
626
586
|
declare class CngxTimelineDateHeader<T = unknown> {
|
|
627
587
|
/**
|
|
@@ -638,8 +598,6 @@ declare class CngxTimelineDateHeader<T = unknown> {
|
|
|
638
598
|
/**
|
|
639
599
|
* Context for `*cngxTimelineMarkerTpl` - the item and the status the
|
|
640
600
|
* organism resolved for it.
|
|
641
|
-
*
|
|
642
|
-
* @category common/timeline
|
|
643
601
|
*/
|
|
644
602
|
interface CngxTimelineMarkerContext<T> {
|
|
645
603
|
readonly $implicit: T;
|
|
@@ -659,11 +617,10 @@ interface CngxTimelineMarkerContext<T> {
|
|
|
659
617
|
* Keeps `Tpl` in class *and* selector to stay clear of
|
|
660
618
|
* `CngxTimelineMarker`, the component it renders into.
|
|
661
619
|
*
|
|
662
|
-
* @category common/timeline
|
|
663
620
|
* @wcag AA
|
|
664
621
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
665
622
|
* @relatedTo CngxTimelineMarker
|
|
666
|
-
* @since 0.
|
|
623
|
+
* @since 0.3.0
|
|
667
624
|
*/
|
|
668
625
|
declare class CngxTimelineMarkerTpl<T = unknown> {
|
|
669
626
|
/**
|
|
@@ -684,8 +641,6 @@ declare class CngxTimelineMarkerTpl<T = unknown> {
|
|
|
684
641
|
* filter matched nothing" call for different copy and different actions.
|
|
685
642
|
* Vocabulary shared with `CngxCardGrid` so an app writes one empty-state
|
|
686
643
|
* component and reuses it.
|
|
687
|
-
*
|
|
688
|
-
* @category common/timeline
|
|
689
644
|
*/
|
|
690
645
|
interface CngxTimelineEmptyContext {
|
|
691
646
|
readonly $implicit: EmptyReason;
|
|
@@ -701,10 +656,9 @@ interface CngxTimelineEmptyContext {
|
|
|
701
656
|
* </ng-template>
|
|
702
657
|
* ```
|
|
703
658
|
*
|
|
704
|
-
* @category common/timeline
|
|
705
659
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
706
660
|
* @relatedTo CngxTimelineError
|
|
707
|
-
* @since 0.
|
|
661
|
+
* @since 0.3.0
|
|
708
662
|
*/
|
|
709
663
|
declare class CngxTimelineEmpty {
|
|
710
664
|
readonly templateRef: TemplateRef<CngxTimelineEmptyContext>;
|
|
@@ -715,8 +669,6 @@ declare class CngxTimelineEmpty {
|
|
|
715
669
|
/**
|
|
716
670
|
* Context for `*cngxTimelineError` - the raw error plus the retry the
|
|
717
671
|
* organism owns.
|
|
718
|
-
*
|
|
719
|
-
* @category common/timeline
|
|
720
672
|
*/
|
|
721
673
|
interface CngxTimelineErrorContext {
|
|
722
674
|
readonly $implicit: unknown;
|
|
@@ -729,10 +681,9 @@ interface CngxTimelineErrorContext {
|
|
|
729
681
|
* restyling. Falls back to
|
|
730
682
|
* `CNGX_TIMELINE_CONFIG.labels.errorFallback` plus a plain retry button.
|
|
731
683
|
*
|
|
732
|
-
* @category common/timeline
|
|
733
684
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
734
685
|
* @relatedTo CngxTimelineRetryButton, CngxTimelineEmpty
|
|
735
|
-
* @since 0.
|
|
686
|
+
* @since 0.3.0
|
|
736
687
|
*/
|
|
737
688
|
declare class CngxTimelineError {
|
|
738
689
|
readonly templateRef: TemplateRef<CngxTimelineErrorContext>;
|
|
@@ -742,8 +693,6 @@ declare class CngxTimelineError {
|
|
|
742
693
|
}
|
|
743
694
|
/**
|
|
744
695
|
* Context for `*cngxTimelineRetryButton` - the retry callback.
|
|
745
|
-
*
|
|
746
|
-
* @category common/timeline
|
|
747
696
|
*/
|
|
748
697
|
interface CngxTimelineRetryButtonContext {
|
|
749
698
|
readonly $implicit: () => void;
|
|
@@ -762,11 +711,10 @@ interface CngxTimelineRetryButtonContext {
|
|
|
762
711
|
* </ng-template>
|
|
763
712
|
* ```
|
|
764
713
|
*
|
|
765
|
-
* @category common/timeline
|
|
766
714
|
* @wcag AA
|
|
767
715
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
768
716
|
* @relatedTo CngxTimelineError
|
|
769
|
-
* @since 0.
|
|
717
|
+
* @since 0.3.0
|
|
770
718
|
*/
|
|
771
719
|
declare class CngxTimelineRetryButton {
|
|
772
720
|
readonly templateRef: TemplateRef<CngxTimelineRetryButtonContext>;
|
|
@@ -782,35 +730,52 @@ declare class CngxTimelineRetryButton {
|
|
|
782
730
|
* Contextless on purpose - a refresh has nothing to say beyond the fact
|
|
783
731
|
* that it is happening.
|
|
784
732
|
*
|
|
785
|
-
* @category common/timeline
|
|
786
733
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
787
734
|
* @relatedTo CngxTimelineError
|
|
788
|
-
* @since 0.
|
|
735
|
+
* @since 0.3.0
|
|
789
736
|
*/
|
|
790
737
|
declare class CngxTimelineLoadingTail {
|
|
791
738
|
readonly templateRef: TemplateRef<void>;
|
|
792
739
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineLoadingTail, never>;
|
|
793
740
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineLoadingTail, "ng-template[cngxTimelineLoadingTail]", ["cngxTimelineLoadingTail"], {}, {}, never, never, true, never>;
|
|
794
741
|
}
|
|
742
|
+
/**
|
|
743
|
+
* Context of one `*cngxTimelineSkeleton` placeholder row. A placeholder has
|
|
744
|
+
* no data, only a position: the same index, row count and side the built-in
|
|
745
|
+
* placeholder uses, so a custom shape lands where the content row will.
|
|
746
|
+
*
|
|
747
|
+
* @since 0.3.0
|
|
748
|
+
*/
|
|
749
|
+
interface CngxTimelineSkeletonContext {
|
|
750
|
+
/** Same as `index`, for `let-index` shorthand. */
|
|
751
|
+
readonly $implicit: number;
|
|
752
|
+
/** 0-based position of the placeholder row. */
|
|
753
|
+
readonly index: number;
|
|
754
|
+
/** Number of placeholder rows (`[skeletonRowCount]`). */
|
|
755
|
+
readonly count: number;
|
|
756
|
+
/** Side the content row at this index will sit on, from `placement` and `mode`. */
|
|
757
|
+
readonly side: 'start' | 'end';
|
|
758
|
+
}
|
|
795
759
|
/**
|
|
796
760
|
* One placeholder row in the first-load body, replacing the built-in
|
|
797
761
|
* marker-rail-and-two-bars shape. Rendered `[skeletonRowCount]` times.
|
|
798
762
|
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
763
|
+
* The context carries the row's position only ({@link CngxTimelineSkeletonContext}):
|
|
764
|
+
* `index`, `count` and the `side` the content row will sit on, so a custom
|
|
765
|
+
* shape follows `placement="end"` / `"alternate"` and the swap to content
|
|
766
|
+
* does not reflow. Bind this when the real rows are taller or busier than
|
|
767
|
+
* the default shape.
|
|
803
768
|
*
|
|
804
769
|
* Whatever renders here sits inside an `aria-hidden` wrapper - the load is
|
|
805
770
|
* announced through the timeline's live region, not through the placeholder.
|
|
806
771
|
*
|
|
807
|
-
* @category common/timeline
|
|
808
772
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/template-slots.ts
|
|
809
773
|
* @relatedTo CngxTimelineLoadingTail
|
|
810
|
-
* @since 0.
|
|
774
|
+
* @since 0.3.0
|
|
811
775
|
*/
|
|
812
776
|
declare class CngxTimelineSkeleton {
|
|
813
|
-
readonly templateRef: TemplateRef<
|
|
777
|
+
readonly templateRef: TemplateRef<CngxTimelineSkeletonContext>;
|
|
778
|
+
static ngTemplateContextGuard(_dir: CngxTimelineSkeleton, ctx: unknown): ctx is CngxTimelineSkeletonContext;
|
|
814
779
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineSkeleton, never>;
|
|
815
780
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineSkeleton, "ng-template[cngxTimelineSkeleton]", ["cngxTimelineSkeleton"], {}, {}, never, never, true, never>;
|
|
816
781
|
}
|
|
@@ -824,8 +789,6 @@ declare class CngxTimelineSkeleton {
|
|
|
824
789
|
* organism has no handle on the marker inside it. Passing the resolved
|
|
825
790
|
* template through DI is what closes that gap without the row having to
|
|
826
791
|
* thread it down by hand.
|
|
827
|
-
*
|
|
828
|
-
* @category common/timeline
|
|
829
792
|
*/
|
|
830
793
|
interface CngxTimelineMarkerHost {
|
|
831
794
|
/** Resolved `*cngxTimelineMarkerTpl`, already through the config cascade. */
|
|
@@ -840,10 +803,9 @@ interface CngxTimelineMarkerHost {
|
|
|
840
803
|
* standalone, and a concrete parent type would make the two mutually
|
|
841
804
|
* dependent and block the decompose schematic.
|
|
842
805
|
*
|
|
843
|
-
* @category common/timeline
|
|
844
806
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/marker-host.token.ts
|
|
845
807
|
* @relatedTo CngxTimelineMarkerTpl, CngxTimelineItem
|
|
846
|
-
* @since 0.
|
|
808
|
+
* @since 0.3.0
|
|
847
809
|
*/
|
|
848
810
|
declare const CNGX_TIMELINE_MARKER_HOST: InjectionToken<CngxTimelineMarkerHost>;
|
|
849
811
|
|
|
@@ -859,8 +821,6 @@ declare const CNGX_TIMELINE_MARKER_HOST: InjectionToken<CngxTimelineMarkerHost>;
|
|
|
859
821
|
* Each of these is a *fallback*: the matching template slot
|
|
860
822
|
* (`*cngxTimelineError`, `*cngxTimelineEmpty`, ...) wins whenever it is
|
|
861
823
|
* present.
|
|
862
|
-
*
|
|
863
|
-
* @category common/timeline
|
|
864
824
|
*/
|
|
865
825
|
interface CngxTimelineLabels {
|
|
866
826
|
/**
|
|
@@ -936,8 +896,6 @@ interface CngxTimelineLabels {
|
|
|
936
896
|
* Set them with {@link withTimelineTemplates}. Keys are typed against
|
|
937
897
|
* `unknown` items because the config is app-wide while the slots are
|
|
938
898
|
* generic; a `TemplateRef` for a concrete item type assigns in fine.
|
|
939
|
-
*
|
|
940
|
-
* @category common/timeline
|
|
941
899
|
*/
|
|
942
900
|
interface CngxTimelineTemplates {
|
|
943
901
|
/** Default row template (`*cngxTimelineItem`). */
|
|
@@ -955,7 +913,7 @@ interface CngxTimelineTemplates {
|
|
|
955
913
|
/** Default refreshing tail (`*cngxTimelineLoadingTail`). */
|
|
956
914
|
readonly loadingTail?: TemplateRef<void>;
|
|
957
915
|
/** Default placeholder row for the first-load body (`*cngxTimelineSkeleton`). */
|
|
958
|
-
readonly skeleton?: TemplateRef<
|
|
916
|
+
readonly skeleton?: TemplateRef<CngxTimelineSkeletonContext>;
|
|
959
917
|
}
|
|
960
918
|
/**
|
|
961
919
|
* Timeline config surface. Resolution priority: \
|
|
@@ -966,8 +924,6 @@ interface CngxTimelineTemplates {
|
|
|
966
924
|
* configure, so this carries text and templates only. Bucketing is
|
|
967
925
|
* swapped through {@link CNGX_TIMELINE_GROUPING_FACTORY} instead, and
|
|
968
926
|
* everything visual through the slot directives.
|
|
969
|
-
*
|
|
970
|
-
* @category common/timeline
|
|
971
927
|
*/
|
|
972
928
|
interface CngxTimelineConfig {
|
|
973
929
|
/**
|
|
@@ -985,19 +941,16 @@ interface CngxTimelineConfig {
|
|
|
985
941
|
* {@link provideTimelineConfig} (root) or {@link provideTimelineConfigAt}
|
|
986
942
|
* (component scope).
|
|
987
943
|
*
|
|
988
|
-
* @category common/timeline
|
|
989
944
|
* @wcag AA
|
|
990
945
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/timeline/timeline-config.ts
|
|
991
946
|
* @relatedTo provideTimelineConfig
|
|
992
947
|
* @relatedTo withTimelineLabels
|
|
993
|
-
* @since 0.
|
|
948
|
+
* @since 0.3.0
|
|
994
949
|
*/
|
|
995
950
|
declare const CNGX_TIMELINE_CONFIG: InjectionToken<CngxTimelineConfig>;
|
|
996
951
|
/**
|
|
997
952
|
* Signature of every `with*` timeline config builder - a pure
|
|
998
953
|
* config-to-config mutator, folded left over the library defaults.
|
|
999
|
-
*
|
|
1000
|
-
* @category common/timeline
|
|
1001
954
|
*/
|
|
1002
955
|
type CngxTimelineConfigFeature = (config: CngxTimelineConfig) => CngxTimelineConfig;
|
|
1003
956
|
/**
|
|
@@ -1014,8 +967,6 @@ type CngxTimelineConfigFeature = (config: CngxTimelineConfig) => CngxTimelineCon
|
|
|
1014
967
|
* }),
|
|
1015
968
|
* )
|
|
1016
969
|
* ```
|
|
1017
|
-
*
|
|
1018
|
-
* @category common/timeline
|
|
1019
970
|
*/
|
|
1020
971
|
declare function withTimelineLabels(labels: CngxTimelineLabels | Signal<CngxTimelineLabels>): CngxTimelineConfigFeature;
|
|
1021
972
|
/**
|
|
@@ -1034,15 +985,11 @@ declare function withTimelineLabels(labels: CngxTimelineLabels | Signal<CngxTime
|
|
|
1034
985
|
*
|
|
1035
986
|
* providers: [provideTimelineConfig(withTimelineTemplates({ empty: this.emptyTpl() }))]
|
|
1036
987
|
* ```
|
|
1037
|
-
*
|
|
1038
|
-
* @category common/timeline
|
|
1039
988
|
*/
|
|
1040
989
|
declare function withTimelineTemplates(templates: CngxTimelineTemplates): CngxTimelineConfigFeature;
|
|
1041
990
|
/**
|
|
1042
991
|
* Root-level provider. Apply once in `bootstrapApplication` /
|
|
1043
992
|
* `appConfig.providers`.
|
|
1044
|
-
*
|
|
1045
|
-
* @category common/timeline
|
|
1046
993
|
*/
|
|
1047
994
|
declare function provideTimelineConfig(...features: readonly CngxTimelineConfigFeature[]): EnvironmentProviders;
|
|
1048
995
|
/**
|
|
@@ -1059,14 +1006,10 @@ declare function provideTimelineConfig(...features: readonly CngxTimelineConfigF
|
|
|
1059
1006
|
* viewProviders: [...provideTimelineConfigAt(withTimelineLabels({ retry: 'Again' }))],
|
|
1060
1007
|
* })
|
|
1061
1008
|
* ```
|
|
1062
|
-
*
|
|
1063
|
-
* @category common/timeline
|
|
1064
1009
|
*/
|
|
1065
1010
|
declare function provideTimelineConfigAt(...features: readonly CngxTimelineConfigFeature[]): Provider[];
|
|
1066
1011
|
/**
|
|
1067
1012
|
* Read the resolved timeline config. Runs in an injection context.
|
|
1068
|
-
*
|
|
1069
|
-
* @category common/timeline
|
|
1070
1013
|
*/
|
|
1071
1014
|
declare function injectTimelineConfig(): CngxTimelineConfig;
|
|
1072
1015
|
|
|
@@ -1075,8 +1018,7 @@ declare function injectTimelineConfig(): CngxTimelineConfig;
|
|
|
1075
1018
|
* timeline renders without a consumer slot. It feeds the `labels` of
|
|
1076
1019
|
* `CNGX_TIMELINE_CONFIG`.
|
|
1077
1020
|
*
|
|
1078
|
-
* @
|
|
1079
|
-
* @since 0.1.0
|
|
1021
|
+
* @since 0.3.0
|
|
1080
1022
|
* @relatedTo CNGX_TIMELINE_CONFIG, withTimelineLabels
|
|
1081
1023
|
*/
|
|
1082
1024
|
interface CngxTimelineLanguageSection {
|
|
@@ -1110,8 +1052,7 @@ interface CngxTimelineLanguageSection {
|
|
|
1110
1052
|
* The English timeline section: the single source of the timeline's English
|
|
1111
1053
|
* copy. `CNGX_TIMELINE_CONFIG` defaults its `labels` to it.
|
|
1112
1054
|
*
|
|
1113
|
-
* @
|
|
1114
|
-
* @since 0.1.0
|
|
1055
|
+
* @since 0.3.0
|
|
1115
1056
|
* @relatedTo CNGX_TIMELINE_CONFIG
|
|
1116
1057
|
*/
|
|
1117
1058
|
declare const CNGX_TIMELINE_LANGUAGE_EN: CngxTimelineLanguageSection;
|
|
@@ -1122,4 +1063,4 @@ declare module '@cngx/core/i18n' {
|
|
|
1122
1063
|
}
|
|
1123
1064
|
|
|
1124
1065
|
export { CNGX_TIMELINE_CONFIG, CNGX_TIMELINE_GROUPING_FACTORY, CNGX_TIMELINE_LANGUAGE_EN, CNGX_TIMELINE_MARKER_HOST, CngxTimelineConnector, CngxTimelineContent, CngxTimelineDateHeader, CngxTimelineEmpty, CngxTimelineError, CngxTimelineItem, CngxTimelineItemTpl, CngxTimelineLoadingTail, CngxTimelineMarker, CngxTimelineMarkerContent, CngxTimelineMarkerTpl, CngxTimelineOpposite, CngxTimelineRetryButton, CngxTimelineSkeleton, CngxTimelineTime, createTimelineGrouping, injectTimelineConfig, provideTimelineConfig, provideTimelineConfigAt, withTimelineLabels, withTimelineTemplates };
|
|
1125
|
-
export type { CngxTimelineConfig, CngxTimelineConfigFeature, CngxTimelineDateHeaderContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineGroupingFactory, CngxTimelineItemContext, CngxTimelineLabels, CngxTimelineLanguageSection, CngxTimelineMarkerContext, CngxTimelineMarkerHost, CngxTimelineRetryButtonContext, CngxTimelineTemplates, TimelineConnectorPosition, TimelineDateAccessor, TimelineDirection, TimelineGroup, TimelineGroupBy, TimelineGroupKey, TimelineGrouping, TimelineGroupingFn, TimelineGroupingOptions, TimelineStatus };
|
|
1066
|
+
export type { CngxTimelineConfig, CngxTimelineConfigFeature, CngxTimelineDateHeaderContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineGroupingFactory, CngxTimelineItemContext, CngxTimelineLabels, CngxTimelineLanguageSection, CngxTimelineMarkerContext, CngxTimelineMarkerHost, CngxTimelineRetryButtonContext, CngxTimelineSkeletonContext, CngxTimelineTemplates, TimelineConnectorPosition, TimelineDateAccessor, TimelineDirection, TimelineGroup, TimelineGroupBy, TimelineGroupKey, TimelineGrouping, TimelineGroupingFn, TimelineGroupingOptions, TimelineStatus };
|