@molecule/app-timeline-angular 0.0.0-stage → 0.0.1-stage
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 +202 -0
- package/README.md +10 -2
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/slot-dom.d.ts +57 -0
- package/dist/slot-dom.d.ts.map +1 -0
- package/dist/slot-dom.js +100 -0
- package/dist/slot-dom.js.map +1 -0
- package/dist/timeline-date.component.d.ts +30 -0
- package/dist/timeline-date.component.d.ts.map +1 -0
- package/dist/timeline-date.component.js +63 -0
- package/dist/timeline-date.component.js.map +1 -0
- package/dist/timeline-event.component.d.ts +71 -0
- package/dist/timeline-event.component.d.ts.map +1 -0
- package/dist/timeline-event.component.js +180 -0
- package/dist/timeline-event.component.js.map +1 -0
- package/dist/timeline-rail.component.d.ts +63 -0
- package/dist/timeline-rail.component.d.ts.map +1 -0
- package/dist/timeline-rail.component.js +148 -0
- package/dist/timeline-rail.component.js.map +1 -0
- package/dist/timeline.component.d.ts +101 -0
- package/dist/timeline.component.d.ts.map +1 -0
- package/dist/timeline.component.js +227 -0
- package/dist/timeline.component.js.map +1 -0
- package/dist/types.d.ts +82 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
3
|
+
import type { TimelineEventData } from './types.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* TimelineEvent component.
|
|
7
|
+
*
|
|
8
|
+
* One row of a `<Timeline>`: [rail (marker + connector)] [timestamp / title /
|
|
9
|
+
* body]. The host IS the row's outer `<div>` (`div[mol-timeline-event]`),
|
|
10
|
+
* matching React's root exactly. The event's node-valued fields are
|
|
11
|
+
* `ng-template` references rendered through `NgTemplateOutlet`; string / number
|
|
12
|
+
* fields render as text.
|
|
13
|
+
*
|
|
14
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
15
|
+
* `TimelineEvent`: the same props (React names), the same ClassMap tokens, and
|
|
16
|
+
* the same DOM for the same input.
|
|
17
|
+
*/
|
|
18
|
+
export declare class TimelineEvent {
|
|
19
|
+
/** The event to render. */
|
|
20
|
+
event: TimelineEventData;
|
|
21
|
+
/** Whether this is the last event in the list (suppresses the connector). */
|
|
22
|
+
isLast?: boolean;
|
|
23
|
+
/** Extra classes. */
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The current class map.
|
|
27
|
+
* @returns The UIClassMap.
|
|
28
|
+
*/
|
|
29
|
+
cm(): UIClassMap;
|
|
30
|
+
/**
|
|
31
|
+
* Computes the row's class list.
|
|
32
|
+
* @returns The class string.
|
|
33
|
+
*/
|
|
34
|
+
classes(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Computes the content column's class list.
|
|
37
|
+
* @returns The class string.
|
|
38
|
+
*/
|
|
39
|
+
contentClasses(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Computes the timestamp line's class list.
|
|
42
|
+
* @returns The class string.
|
|
43
|
+
*/
|
|
44
|
+
timestampClasses(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Computes the title line's class list.
|
|
47
|
+
* @returns The class string.
|
|
48
|
+
*/
|
|
49
|
+
titleClasses(): string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a field holds a node (an `ng-template` reference) rather than text.
|
|
52
|
+
* @param value - The event field.
|
|
53
|
+
* @returns True when it renders through a template outlet.
|
|
54
|
+
*/
|
|
55
|
+
isNode(value: unknown): value is TemplateRef<unknown>;
|
|
56
|
+
/**
|
|
57
|
+
* Narrows a value to an embedded template.
|
|
58
|
+
* @param value - The event field.
|
|
59
|
+
* @returns The template, or null.
|
|
60
|
+
*/
|
|
61
|
+
templateOf(value: unknown): TemplateRef<unknown> | null;
|
|
62
|
+
/**
|
|
63
|
+
* The text a field renders (React renders strings and numbers as text).
|
|
64
|
+
* @param value - The event field.
|
|
65
|
+
* @returns The text, or `''` for a node field.
|
|
66
|
+
*/
|
|
67
|
+
textOf(value: unknown): string;
|
|
68
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimelineEvent, never>;
|
|
69
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimelineEvent, "div[mol-timeline-event]", never, { "event": { "alias": "event"; "required": false; }; "isLast": { "alias": "isLast"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=timeline-event.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-event.component.d.ts","sourceRoot":"","sources":["../src/timeline-event.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;;AAEnD;;;;;;;;;;;;GAYG;AACH,qBAWa,aAAa;IACxB,2BAA2B;IAC3B,KAAK,EAAG,iBAAiB,CAAA;IACzB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,cAAc,IAAI,MAAM;IAIxB;;;OAGG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;OAGG;IACH,YAAY,IAAI,MAAM;IAItB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;IAIrD;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI;IAIvD;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;yCAvEnB,aAAa;2CAAb,aAAa;CA0EzB"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TimelineEvent component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
+
import { Component, TemplateRef } from '@angular/core';
|
|
8
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
+
import { TimelineRail } from './timeline-rail.component.js';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
function TimelineEvent_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
12
|
+
i0.ɵɵelementContainer(0, 1);
|
|
13
|
+
} if (rf & 2) {
|
|
14
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
15
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.templateOf(ctx_r0.event.timestamp));
|
|
16
|
+
} }
|
|
17
|
+
function TimelineEvent_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
i0.ɵɵtext(0);
|
|
19
|
+
} if (rf & 2) {
|
|
20
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
21
|
+
i0.ɵɵtextInterpolate(ctx_r0.textOf(ctx_r0.event.timestamp));
|
|
22
|
+
} }
|
|
23
|
+
function TimelineEvent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelementContainer(0, 1);
|
|
25
|
+
} if (rf & 2) {
|
|
26
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
27
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.templateOf(ctx_r0.event.title));
|
|
28
|
+
} }
|
|
29
|
+
function TimelineEvent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
30
|
+
i0.ɵɵtext(0);
|
|
31
|
+
} if (rf & 2) {
|
|
32
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
33
|
+
i0.ɵɵtextInterpolate(ctx_r0.textOf(ctx_r0.event.title));
|
|
34
|
+
} }
|
|
35
|
+
function TimelineEvent_Conditional_8_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
36
|
+
i0.ɵɵelementContainer(0, 1);
|
|
37
|
+
} if (rf & 2) {
|
|
38
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
39
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r0.templateOf(ctx_r0.event.body));
|
|
40
|
+
} }
|
|
41
|
+
function TimelineEvent_Conditional_8_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
42
|
+
i0.ɵɵtext(0);
|
|
43
|
+
} if (rf & 2) {
|
|
44
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
45
|
+
i0.ɵɵtextInterpolate(ctx_r0.textOf(ctx_r0.event.body));
|
|
46
|
+
} }
|
|
47
|
+
function TimelineEvent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
48
|
+
i0.ɵɵelementStart(0, "div");
|
|
49
|
+
i0.ɵɵconditionalCreate(1, TimelineEvent_Conditional_8_Conditional_1_Template, 1, 1, "ng-container", 1)(2, TimelineEvent_Conditional_8_Conditional_2_Template, 1, 1);
|
|
50
|
+
i0.ɵɵelementEnd();
|
|
51
|
+
} if (rf & 2) {
|
|
52
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
53
|
+
i0.ɵɵclassMap(ctx_r0.cm().textSize("sm"));
|
|
54
|
+
i0.ɵɵadvance();
|
|
55
|
+
i0.ɵɵconditional(ctx_r0.isNode(ctx_r0.event.body) ? 1 : 2);
|
|
56
|
+
} }
|
|
57
|
+
/**
|
|
58
|
+
* TimelineEvent component.
|
|
59
|
+
*
|
|
60
|
+
* One row of a `<Timeline>`: [rail (marker + connector)] [timestamp / title /
|
|
61
|
+
* body]. The host IS the row's outer `<div>` (`div[mol-timeline-event]`),
|
|
62
|
+
* matching React's root exactly. The event's node-valued fields are
|
|
63
|
+
* `ng-template` references rendered through `NgTemplateOutlet`; string / number
|
|
64
|
+
* fields render as text.
|
|
65
|
+
*
|
|
66
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
67
|
+
* `TimelineEvent`: the same props (React names), the same ClassMap tokens, and
|
|
68
|
+
* the same DOM for the same input.
|
|
69
|
+
*/
|
|
70
|
+
export class TimelineEvent {
|
|
71
|
+
/** The event to render. */
|
|
72
|
+
event;
|
|
73
|
+
/** Whether this is the last event in the list (suppresses the connector). */
|
|
74
|
+
isLast;
|
|
75
|
+
/** Extra classes. */
|
|
76
|
+
className;
|
|
77
|
+
/**
|
|
78
|
+
* The current class map.
|
|
79
|
+
* @returns The UIClassMap.
|
|
80
|
+
*/
|
|
81
|
+
cm() {
|
|
82
|
+
return getClassMap();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Computes the row's class list.
|
|
86
|
+
* @returns The class string.
|
|
87
|
+
*/
|
|
88
|
+
classes() {
|
|
89
|
+
return this.cm().cn(this.cm().flex({ align: 'stretch', gap: 'sm' }), this.className);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Computes the content column's class list.
|
|
93
|
+
* @returns The class string.
|
|
94
|
+
*/
|
|
95
|
+
contentClasses() {
|
|
96
|
+
return this.cm().cn(this.cm().flex1, this.cm().stack(1), this.cm().sp('pb', 4));
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Computes the timestamp line's class list.
|
|
100
|
+
* @returns The class string.
|
|
101
|
+
*/
|
|
102
|
+
timestampClasses() {
|
|
103
|
+
return this.cm().cn(this.cm().textSize('xs'), this.cm().fontWeight('medium'));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Computes the title line's class list.
|
|
107
|
+
* @returns The class string.
|
|
108
|
+
*/
|
|
109
|
+
titleClasses() {
|
|
110
|
+
return this.cm().cn(this.cm().textSize('sm'), this.cm().fontWeight('semibold'));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Whether a field holds a node (an `ng-template` reference) rather than text.
|
|
114
|
+
* @param value - The event field.
|
|
115
|
+
* @returns True when it renders through a template outlet.
|
|
116
|
+
*/
|
|
117
|
+
isNode(value) {
|
|
118
|
+
return value instanceof TemplateRef;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Narrows a value to an embedded template.
|
|
122
|
+
* @param value - The event field.
|
|
123
|
+
* @returns The template, or null.
|
|
124
|
+
*/
|
|
125
|
+
templateOf(value) {
|
|
126
|
+
return value instanceof TemplateRef ? value : null;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The text a field renders (React renders strings and numbers as text).
|
|
130
|
+
* @param value - The event field.
|
|
131
|
+
* @returns The text, or `''` for a node field.
|
|
132
|
+
*/
|
|
133
|
+
textOf(value) {
|
|
134
|
+
return typeof value === 'string' || typeof value === 'number' ? String(value) : '';
|
|
135
|
+
}
|
|
136
|
+
static ɵfac = function TimelineEvent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimelineEvent)(); };
|
|
137
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TimelineEvent, selectors: [["div", "mol-timeline-event", ""]], hostVars: 2, hostBindings: function TimelineEvent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
138
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
139
|
+
} }, inputs: { event: "event", isLast: "isLast", className: "className" }, decls: 9, vars: 11, consts: [["mol-timeline-rail", "", 3, "marker", "connector"], [3, "ngTemplateOutlet"], [3, "class"]], template: function TimelineEvent_Template(rf, ctx) { if (rf & 1) {
|
|
140
|
+
i0.ɵɵelement(0, "div", 0);
|
|
141
|
+
i0.ɵɵelementStart(1, "div")(2, "div");
|
|
142
|
+
i0.ɵɵconditionalCreate(3, TimelineEvent_Conditional_3_Template, 1, 1, "ng-container", 1)(4, TimelineEvent_Conditional_4_Template, 1, 1);
|
|
143
|
+
i0.ɵɵelementEnd();
|
|
144
|
+
i0.ɵɵelementStart(5, "div");
|
|
145
|
+
i0.ɵɵconditionalCreate(6, TimelineEvent_Conditional_6_Template, 1, 1, "ng-container", 1)(7, TimelineEvent_Conditional_7_Template, 1, 1);
|
|
146
|
+
i0.ɵɵelementEnd();
|
|
147
|
+
i0.ɵɵconditionalCreate(8, TimelineEvent_Conditional_8_Template, 3, 3, "div", 2);
|
|
148
|
+
i0.ɵɵelementEnd();
|
|
149
|
+
} if (rf & 2) {
|
|
150
|
+
i0.ɵɵproperty("marker", ctx.event.marker)("connector", !ctx.isLast);
|
|
151
|
+
i0.ɵɵadvance();
|
|
152
|
+
i0.ɵɵclassMap(ctx.contentClasses());
|
|
153
|
+
i0.ɵɵadvance();
|
|
154
|
+
i0.ɵɵclassMap(ctx.timestampClasses());
|
|
155
|
+
i0.ɵɵadvance();
|
|
156
|
+
i0.ɵɵconditional(ctx.isNode(ctx.event.timestamp) ? 3 : 4);
|
|
157
|
+
i0.ɵɵadvance(2);
|
|
158
|
+
i0.ɵɵclassMap(ctx.titleClasses());
|
|
159
|
+
i0.ɵɵadvance();
|
|
160
|
+
i0.ɵɵconditional(ctx.isNode(ctx.event.title) ? 6 : 7);
|
|
161
|
+
i0.ɵɵadvance(2);
|
|
162
|
+
i0.ɵɵconditional(ctx.event.body ? 8 : -1);
|
|
163
|
+
} }, dependencies: [NgTemplateOutlet, TimelineRail], encapsulation: 2 });
|
|
164
|
+
}
|
|
165
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimelineEvent, [{
|
|
166
|
+
type: Component,
|
|
167
|
+
args: [{
|
|
168
|
+
selector: 'div[mol-timeline-event]',
|
|
169
|
+
standalone: true,
|
|
170
|
+
imports: [NgTemplateOutlet, TimelineRail],
|
|
171
|
+
inputs: ['event', 'isLast', 'className'],
|
|
172
|
+
host: {
|
|
173
|
+
'[class]': 'classes()',
|
|
174
|
+
},
|
|
175
|
+
// prettier-ignore
|
|
176
|
+
template: `<div mol-timeline-rail [marker]="event.marker" [connector]="!isLast"></div><div [class]="contentClasses()"><div [class]="timestampClasses()">@if (isNode(event.timestamp)) {<ng-container [ngTemplateOutlet]="templateOf(event.timestamp)" />}@else {{{ textOf(event.timestamp) }}}</div><div [class]="titleClasses()">@if (isNode(event.title)) {<ng-container [ngTemplateOutlet]="templateOf(event.title)" />}@else {{{ textOf(event.title) }}}</div>@if (event.body) {<div [class]="cm().textSize('sm')">@if (isNode(event.body)) {<ng-container [ngTemplateOutlet]="templateOf(event.body)" />}@else {{{ textOf(event.body) }}}</div>}</div>`,
|
|
177
|
+
}]
|
|
178
|
+
}], null, null); })();
|
|
179
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TimelineEvent, { className: "TimelineEvent", filePath: "timeline-event.component.ts", lineNumber: 40 }); })();
|
|
180
|
+
//# sourceMappingURL=timeline-event.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-event.component.js","sourceRoot":"","sources":["../src/timeline-event.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;;;IAyB8H,2BAAiE;;;IAAnD,4EAAgD;;;IAAW,YAA6B;;;IAA7B,2DAA6B;;;IAAgE,2BAA6D;;;IAA/C,wEAA4C;;;IAAW,YAAyB;;;IAAzB,uDAAyB;;;IAAsF,2BAA4D;;;IAA9C,uEAA2C;;;IAAW,YAAwB;;;IAA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B;;kFACY,aAAa"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* TimelineRail component.
|
|
6
|
+
*
|
|
7
|
+
* Left-hand rail of a timeline row — renders the marker (a default dot when
|
|
8
|
+
* none is given) and an optional vertical connector extending downward. The
|
|
9
|
+
* host IS the rail's outer `<div>` (`div[mol-timeline-rail]`), matching React's
|
|
10
|
+
* root exactly. A node-valued marker is an `ng-template` reference rendered
|
|
11
|
+
* through `NgTemplateOutlet`; the connector's inline style is applied the way
|
|
12
|
+
* React applies it (through the CSSOM), so the serialized attribute matches.
|
|
13
|
+
*
|
|
14
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
15
|
+
* `TimelineRail`: the same props (React names), the same ClassMap tokens, and
|
|
16
|
+
* the same DOM for the same input.
|
|
17
|
+
*/
|
|
18
|
+
export declare class TimelineRail {
|
|
19
|
+
/** Marker for this row, as a template reference or plain text. */
|
|
20
|
+
marker?: string | number | TemplateRef<unknown>;
|
|
21
|
+
/** Whether to render the vertical connector below the marker (defaults to `true`). */
|
|
22
|
+
connector?: boolean;
|
|
23
|
+
/** Extra classes on the outer wrapper. */
|
|
24
|
+
className?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The current class map.
|
|
27
|
+
* @returns The UIClassMap.
|
|
28
|
+
*/
|
|
29
|
+
cm(): UIClassMap;
|
|
30
|
+
/**
|
|
31
|
+
* Computes the outer rail class list.
|
|
32
|
+
* @returns The class string.
|
|
33
|
+
*/
|
|
34
|
+
classes(): string;
|
|
35
|
+
/**
|
|
36
|
+
* React's `connector = true` default: an absent input keeps the connector.
|
|
37
|
+
* @returns Whether the connector renders.
|
|
38
|
+
*/
|
|
39
|
+
hasConnector(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the marker holds a node (an `ng-template` reference) rather than text.
|
|
42
|
+
* @returns True when it renders through a template outlet.
|
|
43
|
+
*/
|
|
44
|
+
markerTemplate(): TemplateRef<unknown> | null;
|
|
45
|
+
/**
|
|
46
|
+
* The text a marker renders (React renders strings and numbers as text).
|
|
47
|
+
* @returns The text, or null when the marker is a node or absent.
|
|
48
|
+
*/
|
|
49
|
+
markerText(): string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Computes the connector's class list (`cm.w(0)` + `cm.h('full')`).
|
|
52
|
+
* @returns The class string.
|
|
53
|
+
*/
|
|
54
|
+
connectorClasses(): string;
|
|
55
|
+
/**
|
|
56
|
+
* The connector's inline style, exactly React's object.
|
|
57
|
+
* @returns The style declarations.
|
|
58
|
+
*/
|
|
59
|
+
connectorStyle(): Record<string, string>;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimelineRail, never>;
|
|
61
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimelineRail, "div[mol-timeline-rail]", never, { "marker": { "alias": "marker"; "required": false; }; "connector": { "alias": "connector"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=timeline-rail.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-rail.component.d.ts","sourceRoot":"","sources":["../src/timeline-rail.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAGlD;;;;;;;;;;;;;GAaG;AACH,qBAqBa,YAAY;IACvB,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAC/C,sFAAsF;IACtF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAQjB;;;OAGG;IACH,YAAY,IAAI,OAAO;IAIvB;;;OAGG;IACH,cAAc,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI;IAI7C;;;OAGG;IACH,UAAU,IAAI,MAAM,GAAG,IAAI;IAM3B;;;OAGG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;OAGG;IACH,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;yCAlE7B,YAAY;2CAAZ,YAAY;CAqExB"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TimelineRail component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
+
import { Component, TemplateRef } from '@angular/core';
|
|
8
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
function TimelineRail_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
11
|
+
i0.ɵɵelementContainer(0, 0);
|
|
12
|
+
} if (rf & 2) {
|
|
13
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx);
|
|
14
|
+
} }
|
|
15
|
+
function TimelineRail_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
16
|
+
i0.ɵɵtext(0);
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
19
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.markerText(), " ");
|
|
20
|
+
} }
|
|
21
|
+
function TimelineRail_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
+
i0.ɵɵelementStart(0, "span", 1);
|
|
23
|
+
i0.ɵɵtext(1, "\u2022");
|
|
24
|
+
i0.ɵɵelementEnd();
|
|
25
|
+
} }
|
|
26
|
+
function TimelineRail_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
+
i0.ɵɵelement(0, "div");
|
|
28
|
+
} if (rf & 2) {
|
|
29
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
30
|
+
i0.ɵɵstyleMap(ctx_r0.connectorStyle());
|
|
31
|
+
i0.ɵɵclassMap(ctx_r0.connectorClasses());
|
|
32
|
+
} }
|
|
33
|
+
/**
|
|
34
|
+
* TimelineRail component.
|
|
35
|
+
*
|
|
36
|
+
* Left-hand rail of a timeline row — renders the marker (a default dot when
|
|
37
|
+
* none is given) and an optional vertical connector extending downward. The
|
|
38
|
+
* host IS the rail's outer `<div>` (`div[mol-timeline-rail]`), matching React's
|
|
39
|
+
* root exactly. A node-valued marker is an `ng-template` reference rendered
|
|
40
|
+
* through `NgTemplateOutlet`; the connector's inline style is applied the way
|
|
41
|
+
* React applies it (through the CSSOM), so the serialized attribute matches.
|
|
42
|
+
*
|
|
43
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
44
|
+
* `TimelineRail`: the same props (React names), the same ClassMap tokens, and
|
|
45
|
+
* the same DOM for the same input.
|
|
46
|
+
*/
|
|
47
|
+
export class TimelineRail {
|
|
48
|
+
/** Marker for this row, as a template reference or plain text. */
|
|
49
|
+
marker;
|
|
50
|
+
/** Whether to render the vertical connector below the marker (defaults to `true`). */
|
|
51
|
+
connector;
|
|
52
|
+
/** Extra classes on the outer wrapper. */
|
|
53
|
+
className;
|
|
54
|
+
/**
|
|
55
|
+
* The current class map.
|
|
56
|
+
* @returns The UIClassMap.
|
|
57
|
+
*/
|
|
58
|
+
cm() {
|
|
59
|
+
return getClassMap();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Computes the outer rail class list.
|
|
63
|
+
* @returns The class string.
|
|
64
|
+
*/
|
|
65
|
+
classes() {
|
|
66
|
+
return this.cm().cn(this.cm().flex({ direction: 'col', align: 'center' }), this.cm().shrink0, this.className);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* React's `connector = true` default: an absent input keeps the connector.
|
|
70
|
+
* @returns Whether the connector renders.
|
|
71
|
+
*/
|
|
72
|
+
hasConnector() {
|
|
73
|
+
return this.connector ?? true;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Whether the marker holds a node (an `ng-template` reference) rather than text.
|
|
77
|
+
* @returns True when it renders through a template outlet.
|
|
78
|
+
*/
|
|
79
|
+
markerTemplate() {
|
|
80
|
+
return this.marker instanceof TemplateRef ? this.marker : null;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The text a marker renders (React renders strings and numbers as text).
|
|
84
|
+
* @returns The text, or null when the marker is a node or absent.
|
|
85
|
+
*/
|
|
86
|
+
markerText() {
|
|
87
|
+
if (typeof this.marker === 'string')
|
|
88
|
+
return this.marker;
|
|
89
|
+
if (typeof this.marker === 'number')
|
|
90
|
+
return String(this.marker);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Computes the connector's class list (`cm.w(0)` + `cm.h('full')`).
|
|
95
|
+
* @returns The class string.
|
|
96
|
+
*/
|
|
97
|
+
connectorClasses() {
|
|
98
|
+
return this.cm().cn(this.cm().w(0), this.cm().h('full'));
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The connector's inline style, exactly React's object.
|
|
102
|
+
* @returns The style declarations.
|
|
103
|
+
*/
|
|
104
|
+
connectorStyle() {
|
|
105
|
+
return { 'border-left': '1px solid currentColor', opacity: '0.2', 'min-height': '24px' };
|
|
106
|
+
}
|
|
107
|
+
static ɵfac = function TimelineRail_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimelineRail)(); };
|
|
108
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TimelineRail, selectors: [["div", "mol-timeline-rail", ""]], hostVars: 2, hostBindings: function TimelineRail_HostBindings(rf, ctx) { if (rf & 2) {
|
|
109
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
110
|
+
} }, inputs: { marker: "marker", connector: "connector", className: "className" }, decls: 5, vars: 2, consts: [[3, "ngTemplateOutlet"], ["aria-hidden", "true"], [3, "class", "style"]], template: function TimelineRail_Template(rf, ctx) { if (rf & 1) {
|
|
111
|
+
i0.ɵɵelementStart(0, "div");
|
|
112
|
+
i0.ɵɵconditionalCreate(1, TimelineRail_Conditional_1_Template, 1, 1, "ng-container", 0)(2, TimelineRail_Conditional_2_Template, 1, 1)(3, TimelineRail_Conditional_3_Template, 2, 0, "span", 1);
|
|
113
|
+
i0.ɵɵelementEnd();
|
|
114
|
+
i0.ɵɵconditionalCreate(4, TimelineRail_Conditional_4_Template, 1, 4, "div", 2);
|
|
115
|
+
} if (rf & 2) {
|
|
116
|
+
let tmp_0_0;
|
|
117
|
+
i0.ɵɵadvance();
|
|
118
|
+
i0.ɵɵconditional((tmp_0_0 = ctx.markerTemplate()) ? 1 : ctx.markerText() !== null ? 2 : 3, tmp_0_0);
|
|
119
|
+
i0.ɵɵadvance(3);
|
|
120
|
+
i0.ɵɵconditional(ctx.hasConnector() ? 4 : -1);
|
|
121
|
+
} }, dependencies: [NgTemplateOutlet], encapsulation: 2 });
|
|
122
|
+
}
|
|
123
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimelineRail, [{
|
|
124
|
+
type: Component,
|
|
125
|
+
args: [{
|
|
126
|
+
selector: 'div[mol-timeline-rail]',
|
|
127
|
+
standalone: true,
|
|
128
|
+
imports: [NgTemplateOutlet],
|
|
129
|
+
inputs: ['marker', 'connector', 'className'],
|
|
130
|
+
host: {
|
|
131
|
+
'[class]': 'classes()',
|
|
132
|
+
},
|
|
133
|
+
template: `<div>
|
|
134
|
+
@if (markerTemplate(); as marker) {
|
|
135
|
+
<ng-container [ngTemplateOutlet]="marker" />
|
|
136
|
+
} @else if (markerText() !== null) {
|
|
137
|
+
{{ markerText() }}
|
|
138
|
+
} @else {
|
|
139
|
+
<span aria-hidden="true">•</span>
|
|
140
|
+
}
|
|
141
|
+
</div>
|
|
142
|
+
@if (hasConnector()) {
|
|
143
|
+
<div [class]="connectorClasses()" [style]="connectorStyle()"></div>
|
|
144
|
+
}`,
|
|
145
|
+
}]
|
|
146
|
+
}], null, null); })();
|
|
147
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TimelineRail, { className: "TimelineRail", filePath: "timeline-rail.component.ts", lineNumber: 48 }); })();
|
|
148
|
+
//# sourceMappingURL=timeline-rail.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-rail.component.js","sourceRoot":"","sources":["../src/timeline-rail.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;;;IA0BtC,2BAA4C;;IAA9B,sCAA2B;;;IAEzC,YACF;;;IADE,oDACF;;;IACE,+BAAyB;IAAA,sBAAC;IAAA,iBAAO;;;IAInC,sBAAmE;;;IAAjC,sCAA0B;IAAvD,wCAA4B;;AAhCvC;;;;;;;;;;;;;GAaG;AAsBH,MAAM,OAAO,YAAY;IACvB,kEAAkE;IAClE,MAAM,CAAyC;IAC/C,sFAAsF;IACtF,SAAS,CAAU;IACnB,0CAA0C;IAC1C,SAAS,CAAS;IAElB;;;OAGG;IACH,EAAE;QACA,OAAO,WAAW,EAAE,CAAA;IACtB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CACjB,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACrD,IAAI,CAAC,EAAE,EAAE,CAAC,OAAO,EACj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,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC;gBAC5C,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;iBACvB;gBACD,QAAQ,EAAE;;;;;;;;;;;MAWN;aACL;;kFACY,YAAY"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type AfterViewChecked, type AfterViewInit, type DoCheck, TemplateRef } from '@angular/core';
|
|
2
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
3
|
+
import type { TimelineEventData } from './types.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Timeline component.
|
|
7
|
+
*
|
|
8
|
+
* Vertical chronological list of events, each rendered with a marker +
|
|
9
|
+
* connector on the left (`<div mol-timeline-event>`). Optional date separators
|
|
10
|
+
* come from `renderDateSeparator`, a template reference whose context carries
|
|
11
|
+
* the event as `$implicit` / `a0` and its predecessor as `a1`.
|
|
12
|
+
*
|
|
13
|
+
* React's root is the wrapper `<div>` — or, with no events and an empty state,
|
|
14
|
+
* that empty state alone (a fragment). A host element always exists in Angular,
|
|
15
|
+
* so this component's host is transparent (`mol-timeline`, `display: contents`,
|
|
16
|
+
* unwrapped by the conformance normalizer) and the template renders whichever
|
|
17
|
+
* root React would. The empty state is projected content
|
|
18
|
+
* (`[slot=emptyState]`) or a template reference passed as an input, reconciled
|
|
19
|
+
* against React's branch by {@link Timeline.ngAfterViewInit} /
|
|
20
|
+
* {@link Timeline.ngAfterViewChecked} / {@link Timeline.ngDoCheck}. Rows are
|
|
21
|
+
* tracked by the event's `id` value (`@for (…; track event.id)`), like React's
|
|
22
|
+
* per-item keys.
|
|
23
|
+
*
|
|
24
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
25
|
+
* `Timeline`: the same props (React names), the same ClassMap tokens, and the
|
|
26
|
+
* same DOM for the same input.
|
|
27
|
+
*/
|
|
28
|
+
export declare class Timeline implements AfterViewInit, AfterViewChecked, DoCheck {
|
|
29
|
+
/** Events in display order. */
|
|
30
|
+
events: TimelineEventData[];
|
|
31
|
+
/** Optional renderer for date separators: a template reference with the event in its context. */
|
|
32
|
+
renderDateSeparator?: TemplateRef<unknown>;
|
|
33
|
+
/** Rendered when there are no events: a template reference, plain text, or `[slot=emptyState]`. */
|
|
34
|
+
emptyState?: unknown;
|
|
35
|
+
/** Extra classes on the outer wrapper. */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** The projected empty-state capture point (unwrapped, so React's bare slot). */
|
|
38
|
+
private empty?;
|
|
39
|
+
/** The wrapper `<div>` (detached when the empty state renders instead). */
|
|
40
|
+
private list?;
|
|
41
|
+
private readonly guard;
|
|
42
|
+
/**
|
|
43
|
+
* The current class map.
|
|
44
|
+
* @returns The UIClassMap.
|
|
45
|
+
*/
|
|
46
|
+
cm(): UIClassMap;
|
|
47
|
+
/**
|
|
48
|
+
* Computes the outer wrapper's class list (`cm.stack(0)` + `className`).
|
|
49
|
+
* @returns The class string.
|
|
50
|
+
*/
|
|
51
|
+
classes(): string;
|
|
52
|
+
/**
|
|
53
|
+
* React's branch: with no events, the empty state renders bare (its
|
|
54
|
+
* template when it is a node).
|
|
55
|
+
* @returns The empty-state template, or null.
|
|
56
|
+
*/
|
|
57
|
+
emptyTemplate(): TemplateRef<unknown> | null;
|
|
58
|
+
/**
|
|
59
|
+
* React's branch: with no events, a text empty state renders bare.
|
|
60
|
+
* @returns The empty-state text, or null when the wrapper renders instead.
|
|
61
|
+
*/
|
|
62
|
+
emptyText(): string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The date-separator template, when the caller supplied one.
|
|
65
|
+
* @returns The template, or null.
|
|
66
|
+
*/
|
|
67
|
+
separatorTemplate(): TemplateRef<unknown> | null;
|
|
68
|
+
/**
|
|
69
|
+
* The separator template's context: React's `renderDateSeparator(event, prev)`
|
|
70
|
+
* arguments as `$implicit` / `a0` (the event) and `a1` (its predecessor).
|
|
71
|
+
* @param event - The event the separator precedes.
|
|
72
|
+
* @param index - The event's index in the list.
|
|
73
|
+
* @returns The template context.
|
|
74
|
+
*/
|
|
75
|
+
separatorContext(event: TimelineEventData, index: number): Record<string, unknown>;
|
|
76
|
+
/**
|
|
77
|
+
* Reconciles the projected empty state and the wrapper against React's
|
|
78
|
+
* branch once the view queries resolve.
|
|
79
|
+
*/
|
|
80
|
+
ngAfterViewInit(): void;
|
|
81
|
+
/**
|
|
82
|
+
* Re-reconciles on later passes, so a props step that empties or refills the
|
|
83
|
+
* list swaps the branch the way React does.
|
|
84
|
+
*/
|
|
85
|
+
ngDoCheck(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Re-reconciles after each view update: a node-valued empty state that arrives
|
|
88
|
+
* through an input renders into its outlet only during the update, so the
|
|
89
|
+
* branch decision must be read afterwards.
|
|
90
|
+
*/
|
|
91
|
+
ngAfterViewChecked(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Applies React's condition: with no events and an empty state, the empty
|
|
94
|
+
* state renders bare and the wrapper disappears; otherwise the wrapper
|
|
95
|
+
* renders and the empty state is dropped.
|
|
96
|
+
*/
|
|
97
|
+
private reconcile;
|
|
98
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Timeline, never>;
|
|
99
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Timeline, "mol-timeline", never, { "events": { "alias": "events"; "required": false; }; "renderDateSeparator": { "alias": "renderDateSeparator"; "required": false; }; "emptyState": { "alias": "emptyState"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, ["[slot=emptyState]"], true, never>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=timeline.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.component.d.ts","sourceRoot":"","sources":["../src/timeline.component.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,KAAK,OAAO,EAIZ,WAAW,EAEZ,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,UAAU,E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