@molecule/app-day-timeline-angular 0.0.0-stage → 1.1.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 +202 -0
- package/README.md +435 -2
- package/dist/day-timeline.component.d.ts +219 -0
- package/dist/day-timeline.component.d.ts.map +1 -0
- package/dist/day-timeline.component.js +568 -0
- package/dist/day-timeline.component.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +53 -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 +74 -4
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
3
|
+
import type { DayTimelineEvent } from './types.js';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Format a fractional 24h hour as `H AM/PM` (e.g. `9.5` → `9:30 AM`).
|
|
7
|
+
*
|
|
8
|
+
* @param hour - Fractional 24h hour value.
|
|
9
|
+
* @returns A short clock-style label.
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatHour(hour: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* DayTimeline component.
|
|
14
|
+
*
|
|
15
|
+
* Vertical 24h day-of-events timeline. The host IS the root `<div>`
|
|
16
|
+
* (`div[mol-day-timeline]`), matching React's root exactly: `role="list"` +
|
|
17
|
+
* the accessible label on the host, the hour axis, the rail with its
|
|
18
|
+
* gridlines and one absolutely-positioned card per event. Node-valued event
|
|
19
|
+
* fields (`title`, `subtitle`) are `ng-template` references rendered through
|
|
20
|
+
* {@link NgTemplateOutlet}; string / number fields render as text.
|
|
21
|
+
*/
|
|
22
|
+
export declare class DayTimeline {
|
|
23
|
+
/** Events to render on the timeline. */
|
|
24
|
+
events: DayTimelineEvent[];
|
|
25
|
+
/** First hour rendered (inclusive; defaults to `0` at read time). */
|
|
26
|
+
startHour?: number;
|
|
27
|
+
/** Last hour rendered (exclusive; defaults to `24` at read time). */
|
|
28
|
+
endHour?: number;
|
|
29
|
+
/** Pixel height per hour (defaults to `60` at read time). */
|
|
30
|
+
pxPerHour?: number;
|
|
31
|
+
/** Whether to render the axis tick labels (defaults to `true` at read time). */
|
|
32
|
+
showAxisLabels?: boolean;
|
|
33
|
+
/** `data-mol-id` attribute for AI-agent selectors. */
|
|
34
|
+
dataMolId?: string;
|
|
35
|
+
/** Extra classes appended via the ClassMap `cn()` helper. */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** The i18n handle (locale-reactive), read in an injection context. */
|
|
38
|
+
private readonly i18n;
|
|
39
|
+
/**
|
|
40
|
+
* The current class map.
|
|
41
|
+
* @returns The UIClassMap.
|
|
42
|
+
*/
|
|
43
|
+
cm(): UIClassMap;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the axis tick labels render (React's `showAxisLabels = true`).
|
|
46
|
+
* @returns True when the axis column renders.
|
|
47
|
+
*/
|
|
48
|
+
showAxis(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The viewport's clamped first hour (React: `max(0, min(24, startHour))`).
|
|
51
|
+
* @returns The safe start hour.
|
|
52
|
+
*/
|
|
53
|
+
safeStart(): number;
|
|
54
|
+
/**
|
|
55
|
+
* The viewport's clamped last hour (React: at least `startHour + 1`, at most 24).
|
|
56
|
+
* @returns The safe end hour.
|
|
57
|
+
*/
|
|
58
|
+
safeEnd(): number;
|
|
59
|
+
/**
|
|
60
|
+
* The pixel height of one hour (React's `pxPerHour = 60`).
|
|
61
|
+
* @returns The hour height in pixels.
|
|
62
|
+
*/
|
|
63
|
+
hourHeight(): number;
|
|
64
|
+
/**
|
|
65
|
+
* The axis' total height.
|
|
66
|
+
* @returns The height in pixels.
|
|
67
|
+
*/
|
|
68
|
+
totalHeight(): number;
|
|
69
|
+
/**
|
|
70
|
+
* The hour ticks in the visible window (React pre-builds the same list).
|
|
71
|
+
* @returns The tick hours.
|
|
72
|
+
*/
|
|
73
|
+
ticks(): number[];
|
|
74
|
+
/**
|
|
75
|
+
* The wrapper's class list.
|
|
76
|
+
* @returns The class string.
|
|
77
|
+
*/
|
|
78
|
+
classes(): string;
|
|
79
|
+
/**
|
|
80
|
+
* The root's accessible label.
|
|
81
|
+
* @returns The translated group label.
|
|
82
|
+
*/
|
|
83
|
+
groupLabel(): string;
|
|
84
|
+
/**
|
|
85
|
+
* The root's inline style — the axis grid has no ClassMap resolver.
|
|
86
|
+
* @returns The CSS text.
|
|
87
|
+
*/
|
|
88
|
+
wrapperStyle(): string;
|
|
89
|
+
/**
|
|
90
|
+
* The axis column's inline style.
|
|
91
|
+
* @returns The CSS text.
|
|
92
|
+
*/
|
|
93
|
+
axisStyle(): string;
|
|
94
|
+
/**
|
|
95
|
+
* The rail's inline style; its divider from the axis labels is a class.
|
|
96
|
+
* @returns The CSS text.
|
|
97
|
+
*/
|
|
98
|
+
railStyle(): string;
|
|
99
|
+
/**
|
|
100
|
+
* The rail's class list: the theme divider from the axis labels, only while
|
|
101
|
+
* the axis shows.
|
|
102
|
+
* @returns The class string.
|
|
103
|
+
*/
|
|
104
|
+
railClasses(): string;
|
|
105
|
+
/**
|
|
106
|
+
* A tick label's class list (the small text recipe, muted).
|
|
107
|
+
* @returns The class string.
|
|
108
|
+
*/
|
|
109
|
+
tickClasses(): string;
|
|
110
|
+
/**
|
|
111
|
+
* A tick label's inline style.
|
|
112
|
+
* @param hour - The tick's hour.
|
|
113
|
+
* @returns The CSS text.
|
|
114
|
+
*/
|
|
115
|
+
tickStyle(hour: number): string;
|
|
116
|
+
/**
|
|
117
|
+
* The text a tick label shows.
|
|
118
|
+
* @param hour - The tick's hour.
|
|
119
|
+
* @returns The formatted hour.
|
|
120
|
+
*/
|
|
121
|
+
tickLabel(hour: number): string;
|
|
122
|
+
/**
|
|
123
|
+
* One gridline's class list (the theme's border color as a fill).
|
|
124
|
+
* @returns The class string.
|
|
125
|
+
*/
|
|
126
|
+
gridlineClasses(): string;
|
|
127
|
+
/**
|
|
128
|
+
* One gridline's inline style.
|
|
129
|
+
* @param hour - The gridline's hour.
|
|
130
|
+
* @returns The CSS text.
|
|
131
|
+
*/
|
|
132
|
+
gridlineStyle(hour: number): string;
|
|
133
|
+
/**
|
|
134
|
+
* The event card's class list: the accent-card recipe in the event's tone
|
|
135
|
+
* (its own accent color, or the brand primary), over the theme's secondary
|
|
136
|
+
* surface.
|
|
137
|
+
* @param event - The event.
|
|
138
|
+
* @returns The class string.
|
|
139
|
+
*/
|
|
140
|
+
eventCardClasses(event: DayTimelineEvent): string;
|
|
141
|
+
/**
|
|
142
|
+
* The event's accent-card tone: its own `accentColor` when it has one, the
|
|
143
|
+
* brand primary otherwise.
|
|
144
|
+
* @param event - The event.
|
|
145
|
+
* @returns The recipe tone.
|
|
146
|
+
*/
|
|
147
|
+
cardTone(event: DayTimelineEvent): 'custom' | 'primary';
|
|
148
|
+
/**
|
|
149
|
+
* The event title's class list.
|
|
150
|
+
* @returns The class string.
|
|
151
|
+
*/
|
|
152
|
+
titleClasses(): string;
|
|
153
|
+
/**
|
|
154
|
+
* The event subtitle's class list (the accent-card label recipe, in the
|
|
155
|
+
* card's tone).
|
|
156
|
+
* @param event - The event.
|
|
157
|
+
* @returns The class string.
|
|
158
|
+
*/
|
|
159
|
+
subtitleClasses(event: DayTimelineEvent): string;
|
|
160
|
+
/**
|
|
161
|
+
* The event's clamped end hour (a 15-minute floor keeps tiny events
|
|
162
|
+
* clickable).
|
|
163
|
+
* @param event - The event.
|
|
164
|
+
* @returns Its clamped end hour.
|
|
165
|
+
*/
|
|
166
|
+
safeEndOf(event: DayTimelineEvent): number;
|
|
167
|
+
/**
|
|
168
|
+
* The event card's inline style — geometry only; its colors are ClassMap
|
|
169
|
+
* classes.
|
|
170
|
+
* @param event - The event.
|
|
171
|
+
* @returns The CSS text.
|
|
172
|
+
*/
|
|
173
|
+
cardStyle(event: DayTimelineEvent): string;
|
|
174
|
+
/**
|
|
175
|
+
* The content block's inline style: it fills the card so the whole surface
|
|
176
|
+
* is the click target, and its 30px left padding keeps the text clear of
|
|
177
|
+
* the accent bar.
|
|
178
|
+
* @param event - The event the block belongs to.
|
|
179
|
+
* @returns The CSS text.
|
|
180
|
+
*/
|
|
181
|
+
contentStyle(event: DayTimelineEvent): string;
|
|
182
|
+
/**
|
|
183
|
+
* The event's accessible label, built from React's i18n key and default
|
|
184
|
+
* message (only a plain string title is carried into it).
|
|
185
|
+
* @param event - The event.
|
|
186
|
+
* @returns The aria label.
|
|
187
|
+
*/
|
|
188
|
+
eventAria(event: DayTimelineEvent): string;
|
|
189
|
+
/**
|
|
190
|
+
* Calls an event's own click handler with the native event, as React's
|
|
191
|
+
* `onClick={event.onClick}` does.
|
|
192
|
+
* @param event - The event that was clicked.
|
|
193
|
+
* @param native - The click event.
|
|
194
|
+
*/
|
|
195
|
+
handleClick(event: DayTimelineEvent, native: Event): void;
|
|
196
|
+
/**
|
|
197
|
+
* Whether an event field holds a node (an `ng-template` reference) rather
|
|
198
|
+
* than text.
|
|
199
|
+
* @param value - The event field.
|
|
200
|
+
* @returns True when it renders through a template outlet.
|
|
201
|
+
*/
|
|
202
|
+
isTemplate(value: unknown): value is TemplateRef<unknown>;
|
|
203
|
+
/**
|
|
204
|
+
* Narrows a value to an embedded template.
|
|
205
|
+
* @param value - An event field.
|
|
206
|
+
* @returns The template, or null.
|
|
207
|
+
*/
|
|
208
|
+
templateOf(value: unknown): TemplateRef<unknown> | null;
|
|
209
|
+
/**
|
|
210
|
+
* The text an event field renders (React renders strings and numbers as
|
|
211
|
+
* text).
|
|
212
|
+
* @param value - The event field.
|
|
213
|
+
* @returns The text, or `''` for a node value.
|
|
214
|
+
*/
|
|
215
|
+
textOf(value: unknown): string;
|
|
216
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DayTimeline, never>;
|
|
217
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DayTimeline, "div[mol-day-timeline]", never, { "events": { "alias": "events"; "required": false; }; "startHour": { "alias": "startHour"; "required": false; }; "endHour": { "alias": "endHour"; "required": false; }; "pxPerHour": { "alias": "pxPerHour"; "required": false; }; "showAxisLabels": { "alias": "showAxisLabels"; "required": false; }; "dataMolId": { "alias": "dataMolId"; "required": false; }; "className": { "alias": "className"; "required": false; }; }, {}, never, never, true, never>;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=day-timeline.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"day-timeline.component.d.ts","sourceRoot":"","sources":["../src/day-timeline.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAa,WAAW,EAAE,MAAM,eAAe,CAAA;AAGtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;;AAElD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED;;;;;;;;;GASG;AACH,qBAuDa,WAAW;IACtB,wCAAwC;IACxC,MAAM,EAAE,gBAAgB,EAAE,CAAK;IAC/B,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,QAAQ,IAAI,OAAO;IAInB;;;OAGG;IACH,SAAS,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