@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
package/dist/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular vertical 24h day-of-events timeline — itinerary planner, daily
|
|
3
|
+
* agenda, schedule view. Events are absolutely positioned by start/end hour
|
|
4
|
+
* and scaled by `pxPerHour` (total height = (endHour - startHour) * pxPerHour).
|
|
5
|
+
*
|
|
6
|
+
* Exports `<div mol-day-timeline>` and `formatHour` — the Angular counterpart
|
|
7
|
+
* of `@molecule/app-day-timeline-react`, with the same props (React names) and
|
|
8
|
+
* the same DOM for the same input.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { Component } from '@angular/core'
|
|
13
|
+
* import { DayTimeline } from '@molecule/app-day-timeline-angular'
|
|
14
|
+
*
|
|
15
|
+
* @Component({
|
|
16
|
+
* selector: 'app-trip-day',
|
|
17
|
+
* standalone: true,
|
|
18
|
+
* imports: [DayTimeline],
|
|
19
|
+
* template: `<div mol-day-timeline [startHour]="7" [endHour]="22" [events]="events"></div>`,
|
|
20
|
+
* })
|
|
21
|
+
* export class TripDay {
|
|
22
|
+
* events = [
|
|
23
|
+
* { id: 'flight', title: 'Flight to LAX', startHour: 13, endHour: 16 },
|
|
24
|
+
* { id: 'dinner', title: 'Dinner', startHour: 19, endHour: 20.5 },
|
|
25
|
+
* ]
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* - **No overlap/lane layout.** Events are absolutely positioned across the
|
|
31
|
+
* full rail width, so events with overlapping time ranges render stacked
|
|
32
|
+
* on top of each other. If your data can contain concurrent events,
|
|
33
|
+
* partition them into separate `<DayTimeline>` columns (one per lane or
|
|
34
|
+
* resource) before rendering — the component does not de-conflict.
|
|
35
|
+
* - Bounds are clamped: `startHour` to [0, 24], `endHour` to at least
|
|
36
|
+
* `startHour + 1`; an event shorter than 15 minutes still renders at a
|
|
37
|
+
* 20px minimum height so it stays clickable.
|
|
38
|
+
* - Axis tick labels are formatted by the exported `formatHour()`, which
|
|
39
|
+
* uses English 12-hour "AM/PM" notation. There is currently no prop to
|
|
40
|
+
* localize tick formatting — hide them with `[showAxisLabels]="false"` and
|
|
41
|
+
* render your own axis if you need 24h or localized labels.
|
|
42
|
+
* - Aria labels resolve through `t()` with English fallbacks; the companion
|
|
43
|
+
* locale bond is `@molecule/app-locales-day-timeline`. Requires the app's
|
|
44
|
+
* i18n provider (`useTranslation()` throws without one) and a wired
|
|
45
|
+
* ClassMap bond (standard molecule app setup).
|
|
46
|
+
* - Events with an `onClick` render their content inside a native `<button>`
|
|
47
|
+
* (Enter and Space activate it); events without one are not focusable.
|
|
48
|
+
* - Node-valued event fields (`title`, `subtitle`) are `ng-template`
|
|
49
|
+
* references or plain text, as React's `ReactNode` fields are.
|
|
50
|
+
* - Events are tracked by `id` (`@for (… ; track event.id)`), so a re-passed
|
|
51
|
+
* or re-ordered list keeps each card's DOM the way React's `key` does.
|
|
52
|
+
*
|
|
53
|
+
* @module
|
|
54
|
+
*/
|
|
55
|
+
export * from './day-timeline.component.js';
|
|
56
|
+
export * from './types.js';
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,cAAc,6BAA6B,CAAA;AAC3C,cAAc,YAAY,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types of `@molecule/app-day-timeline-angular` — the Angular counterpart of
|
|
3
|
+
* `@molecule/app-day-timeline-react`, same props and DOM.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import type { TemplateRef } from '@angular/core';
|
|
8
|
+
/** A single event positioned on the day axis. */
|
|
9
|
+
export interface DayTimelineEvent {
|
|
10
|
+
/** Stable id (used as the render key + `data-event-id`). */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Event title: a template reference (a node), or text. */
|
|
13
|
+
title: string | number | TemplateRef<unknown>;
|
|
14
|
+
/** Optional secondary line (location, type, etc.): a template reference, or text. */
|
|
15
|
+
subtitle?: string | number | TemplateRef<unknown>;
|
|
16
|
+
/** Start hour in fractional 24h (e.g. `9.5` = 9:30 AM). */
|
|
17
|
+
startHour: number;
|
|
18
|
+
/** End hour in fractional 24h. Must be > `startHour`. */
|
|
19
|
+
endHour: number;
|
|
20
|
+
/** Optional accent color (CSS color value). */
|
|
21
|
+
accentColor?: string;
|
|
22
|
+
/** Optional click handler. */
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Props accepted by {@link DayTimeline} — the same props
|
|
27
|
+
* `@molecule/app-day-timeline-react` accepts. Node-valued event fields
|
|
28
|
+
* (`title`, `subtitle`) are template references in Angular (an input cannot
|
|
29
|
+
* carry a node), or plain text.
|
|
30
|
+
*/
|
|
31
|
+
export interface DayTimelineProps {
|
|
32
|
+
/** Events to render on the timeline. */
|
|
33
|
+
events: DayTimelineEvent[];
|
|
34
|
+
/** First hour rendered (inclusive). Defaults to `0`. */
|
|
35
|
+
startHour?: number;
|
|
36
|
+
/** Last hour rendered (exclusive). Defaults to `24`. */
|
|
37
|
+
endHour?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Pixel height per hour. Drives the overall axis size: total height =
|
|
40
|
+
* `(endHour - startHour) * pxPerHour`. Defaults to `60`.
|
|
41
|
+
*/
|
|
42
|
+
pxPerHour?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to render the axis tick labels (e.g. "9 AM"). Defaults to
|
|
45
|
+
* `true`.
|
|
46
|
+
*/
|
|
47
|
+
showAxisLabels?: boolean;
|
|
48
|
+
/** `data-mol-id` attribute for AI-agent selectors. */
|
|
49
|
+
dataMolId?: string;
|
|
50
|
+
/** Extra classes appended via the ClassMap `cn()` helper. */
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,iDAAiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAA;IACV,2DAA2D;IAC3D,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAC7C,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IACjD,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAA;IACjB,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAA;IACf,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-day-timeline-angular",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Vertical 24h day-of-events timeline — itinerary planner, daily agenda, schedule view",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-day-timeline-angular",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "ngc",
|
|
21
|
+
"dev": "ngc --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"molecule",
|
|
27
|
+
"day-timeline",
|
|
28
|
+
"itinerary",
|
|
29
|
+
"schedule",
|
|
30
|
+
"angular"
|
|
31
|
+
],
|
|
32
|
+
"author": "Molecule Dev, Inc. (https://molecule.dev)",
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
37
|
+
"directory": "packages/app/features/day-timeline-angular"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20"
|
|
41
|
+
},
|
|
42
|
+
"bugs": "https://github.com/molecule-dev/molecule/issues",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@angular/common": "^22.0.0",
|
|
48
|
+
"@angular/core": "^22.0.0",
|
|
49
|
+
"@angular/platform-browser": "^22.0.0",
|
|
50
|
+
"@molecule/app-angular": "^3.5.0",
|
|
51
|
+
"@molecule/app-i18n": "^1.0.1",
|
|
52
|
+
"@molecule/app-ui": "^1.3.11",
|
|
53
|
+
"@molecule/app-ui-angular": "^1.1.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@angular/common": "22.2.3",
|
|
57
|
+
"@angular/compiler": "22.2.3",
|
|
58
|
+
"@angular/compiler-cli": "22.2.3",
|
|
59
|
+
"@angular/core": "22.2.3",
|
|
60
|
+
"@angular/platform-browser": "22.2.3",
|
|
61
|
+
"@molecule/app-angular": "3.7.2",
|
|
62
|
+
"@molecule/app-framework-conformance": "0.0.0",
|
|
63
|
+
"@molecule/app-i18n": "1.2.2",
|
|
64
|
+
"@molecule/app-icons": "1.0.4",
|
|
65
|
+
"@molecule/app-ui": "1.4.0",
|
|
66
|
+
"@molecule/app-ui-angular": "1.2.1",
|
|
67
|
+
"@molecule/app-ui-tailwind": "1.3.0",
|
|
68
|
+
"@testing-library/dom": "10.4.2",
|
|
69
|
+
"@types/node": "26.6.5",
|
|
70
|
+
"jsdom": "30.1.3",
|
|
71
|
+
"rxjs": "7.8.2",
|
|
72
|
+
"typescript": "6.0.3",
|
|
73
|
+
"vitest": "4.1.12",
|
|
74
|
+
"zone.js": "0.16.3"
|
|
75
|
+
}
|
|
76
|
+
}
|