@nanahoshi/mona-ui 0.43.1 → 0.45.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/chat/package.json +4 -0
- package/docs/api/chat.json +1 -0
- package/docs/api/chat.md +212 -0
- package/docs/api/i18n.json +1 -1
- package/docs/api/i18n.md +34 -0
- package/docs/api/index.json +1 -1
- package/docs/api/locales.json +1 -1
- package/docs/api/locales.md +14 -14
- package/docs/api/timeline.json +1 -0
- package/docs/api/timeline.md +188 -0
- package/docs/chat.md +480 -0
- package/docs/manifest.json +1 -1
- package/docs/timeline.md +482 -0
- package/fesm2022/nanahoshi-mona-ui-chat.mjs +1230 -0
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +37 -0
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +6 -1
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +29 -0
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +19 -0
- package/fesm2022/nanahoshi-mona-ui-timeline.mjs +1028 -0
- package/i18n/catalogs/en-US.messages.json +19 -0
- package/llms.txt +8 -1
- package/locales/ar-sa/ar-sa.messages.json +19 -0
- package/locales/de-de/de-de.messages.json +19 -0
- package/locales/es-es/es-es.messages.json +19 -0
- package/locales/fr-fr/fr-fr.messages.json +19 -0
- package/locales/id-id/id-id.messages.json +19 -0
- package/locales/it-it/it-it.messages.json +19 -0
- package/locales/ja-jp/ja-jp.messages.json +19 -0
- package/locales/ko-kr/ko-kr.messages.json +19 -0
- package/locales/pl-pl/pl-pl.messages.json +19 -0
- package/locales/pt-br/pt-br.messages.json +19 -0
- package/locales/ru-ru/ru-ru.messages.json +19 -0
- package/locales/tr-tr/tr-tr.messages.json +19 -0
- package/locales/zh-cn/zh-cn.messages.json +19 -0
- package/locales/zh-tw/zh-tw.messages.json +19 -0
- package/package.json +9 -1
- package/timeline/package.json +4 -0
- package/types/nanahoshi-mona-ui-chat.d.ts +424 -0
- package/types/nanahoshi-mona-ui-i18n.d.ts +43 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +4 -0
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +19 -0
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +19 -0
- package/types/nanahoshi-mona-ui-timeline.d.ts +338 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"links":{"TimelineBodyTemplateDirective":"timeline","TimelineComponent":"timeline","TimelineDateTemplateDirective":"timeline","TimelineEventTemplateContext":"timeline","TimelineHeaderTemplateDirective":"timeline","TimelineMarkerTemplateDirective":"timeline","TimelineOrientation":"timeline"},"name":"timeline","pages":[{"path":"timeline","title":"Timeline"}],"symbols":[{"description":"Events in order along a line: each one's date, a marker on the line, and a card with its title, subtitle and\ndescription. It runs down the page, with the cards on one side of the line or on alternating sides, or across it,\nscrolling sideways. It's an ordered list to assistive technology, each event's date read before its card, whose title\nis a heading. On a collapsible timeline, each card's header is a button that opens its details.\n\nThe events are shown in the order of `data`, so sort them the way they should read: oldest first, or newest first.","kind":"component","name":"TimelineComponent","selector":"mona-timeline","typeParameters":["T extends object = Record<string, unknown>"],"inputs":[{"defaultValue":"false","description":"Puts the cards on alternating sides of the line: on a vertical timeline, after it and before it, once\nthe timeline is 32rem wide, with each date on the side across from its card; on a horizontal one, below it and\nabove it.","name":"alternate","type":"boolean"},{"alias":"aria-label","defaultValue":"\"\"","description":"The timeline's name, such as \"Project history\", which assistive technology reads with its list.","name":"ariaLabel","type":"string"},{"alias":"aria-labelledby","defaultValue":"\"\"","description":"The id of an element that names the timeline, such as a heading above it.","name":"ariaLabelledBy","type":"string"},{"alias":"class","defaultValue":"\"\"","description":"Additional CSS classes merged onto the host element via `tailwind-merge`. A horizontal timeline's\nevents are 16rem wide; set `--mona-timeline-event-width` to change it, as in\n`class=\"[--mona-timeline-event-width:20rem]\"`.","name":"userClass","type":"string"},{"defaultValue":"false","description":"Makes each card's header a button that opens and closes its details: its description, or its body\ntemplate. The open events are `expandedKeys`; all are closed by default.","name":"collapsible","type":"boolean"},{"description":"The events, in the order they're shown.","name":"data","required":true,"type":"Iterable<T>"},{"defaultValue":"\"date\"","description":"The field of each event that holds its date: a `Date`, a timestamp in milliseconds, or an ISO 8601\nstring, which is in local time unless it gives an offset. An event without one shows no date.","name":"dateField","type":"string"},{"defaultValue":"{ dateStyle: \"medium\" }","description":"How each event's date is formatted, in the locale, such as `{ year: \"numeric\", month: \"long\" }`.\nThe `<time>` element around it holds the date, and its time too when the format shows one.","name":"dateFormat","type":"Intl.DateTimeFormatOptions"},{"defaultValue":"\"description\"","description":"The field of each event shown as its details, below its title.","name":"descriptionField","type":"string"},{"defaultValue":"[]","description":"The keys of the events whose details are open, on a collapsible timeline: the values of their\n`keyField`, or the events themselves without one. Bind it two-way, `[(expandedKeys)]`, to follow the user's\ntoggles.","name":"expandedKeys","twoWay":true,"type":"readonly unknown[]"},{"defaultValue":"3","description":"The level of each event's heading, its title, from 1 to 6. Set it to fit the page's outline, or to\n`null` for no headings.","name":"headingLevel","type":"number | null"},{"defaultValue":"\"\"","description":"The field of each event that identifies it in `expandedKeys`, so an open event stays open when the\ndata is replaced with copies. Without it, an event is its own key.","name":"keyField","type":"string"},{"defaultValue":"\"vertical\"","description":"Which way the timeline runs: `\"vertical\"`, down the page, or `\"horizontal\"`, across it, scrolling\nsideways when its events don't fit. A horizontal timeline takes focus, so the arrow keys scroll it.","name":"orientation","type":"TimelineOrientation"},{"defaultValue":"\"subtitle\"","description":"The field of each event shown below its title, such as a place or a person.","name":"subtitleField","type":"string"},{"defaultValue":"\"title\"","description":"The field of each event shown as its title, the heading of its card.","name":"titleField","type":"string"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"timeline","title":"Timeline"}},{"description":"Template for each event's details, in place of its description. On a collapsible timeline, it's what opens and closes.\n\nThe event is the template's implicit value (`let-event`), with its date (`let-date=\"date\"`), whether its details are\nopen (`let-expanded=\"expanded\"`) and its index (`let-index=\"index\"`). Bind the timeline's data to\n`monaTimelineBodyTemplateOf` to type the event; without it, the event is `any` in templates.","kind":"directive","name":"TimelineBodyTemplateDirective","selector":"ng-template[monaTimelineBodyTemplate]","templateContext":{"members":[{"description":"The event (`let-event`).","name":"$implicit","type":"T"},{"description":"The event's date, read from its date field, or `null` when it has none (`let-date=\"date\"`).","name":"date","type":"Date | null"},{"description":"Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded=\"expanded\"`).","name":"expanded","type":"boolean"},{"description":"The event's index in the timeline's data (`let-index=\"index\"`).","name":"index","type":"number"}],"type":"TimelineEventTemplateContext<T>"},"typeParameters":["T = any"],"inputs":[{"defaultValue":"null","description":"The timeline's data, used only to type the template's event. Optional.","name":"monaTimelineBodyTemplateOf","type":"Iterable<T> | null | undefined"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"timeline","title":"Timeline"}},{"description":"Template for each event's date label, in place of its date formatted with `dateFormat`, such as a relative date. Write the date in a `<time>` element with a `datetime` attribute.\n\nThe event is the template's implicit value (`let-event`), with its date (`let-date=\"date\"`), whether its details are\nopen (`let-expanded=\"expanded\"`) and its index (`let-index=\"index\"`). Bind the timeline's data to\n`monaTimelineDateTemplateOf` to type the event; without it, the event is `any` in templates.","kind":"directive","name":"TimelineDateTemplateDirective","selector":"ng-template[monaTimelineDateTemplate]","templateContext":{"members":[{"description":"The event (`let-event`).","name":"$implicit","type":"T"},{"description":"The event's date, read from its date field, or `null` when it has none (`let-date=\"date\"`).","name":"date","type":"Date | null"},{"description":"Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded=\"expanded\"`).","name":"expanded","type":"boolean"},{"description":"The event's index in the timeline's data (`let-index=\"index\"`).","name":"index","type":"number"}],"type":"TimelineEventTemplateContext<T>"},"typeParameters":["T = any"],"inputs":[{"defaultValue":"null","description":"The timeline's data, used only to type the template's event. Optional.","name":"monaTimelineDateTemplateOf","type":"Iterable<T> | null | undefined"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"timeline","title":"Timeline"}},{"description":"Template for each event's header, in place of its title and subtitle. It's the event's heading and, on a collapsible timeline, the button that opens its details, so keep it to text and images: no links or controls.\n\nThe event is the template's implicit value (`let-event`), with its date (`let-date=\"date\"`), whether its details are\nopen (`let-expanded=\"expanded\"`) and its index (`let-index=\"index\"`). Bind the timeline's data to\n`monaTimelineHeaderTemplateOf` to type the event; without it, the event is `any` in templates.","kind":"directive","name":"TimelineHeaderTemplateDirective","selector":"ng-template[monaTimelineHeaderTemplate]","templateContext":{"members":[{"description":"The event (`let-event`).","name":"$implicit","type":"T"},{"description":"The event's date, read from its date field, or `null` when it has none (`let-date=\"date\"`).","name":"date","type":"Date | null"},{"description":"Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded=\"expanded\"`).","name":"expanded","type":"boolean"},{"description":"The event's index in the timeline's data (`let-index=\"index\"`).","name":"index","type":"number"}],"type":"TimelineEventTemplateContext<T>"},"typeParameters":["T = any"],"inputs":[{"defaultValue":"null","description":"The timeline's data, used only to type the template's event. Optional.","name":"monaTimelineHeaderTemplateOf","type":"Iterable<T> | null | undefined"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"timeline","title":"Timeline"}},{"description":"Template for each event's marker on the line, in place of its dot, such as an icon for its status. It sits centered on the line. Assistive technology reads what it holds, so give an icon `aria-hidden=\"true\"`, or text that says what it means.\n\nThe event is the template's implicit value (`let-event`), with its date (`let-date=\"date\"`), whether its details are\nopen (`let-expanded=\"expanded\"`) and its index (`let-index=\"index\"`). Bind the timeline's data to\n`monaTimelineMarkerTemplateOf` to type the event; without it, the event is `any` in templates.","kind":"directive","name":"TimelineMarkerTemplateDirective","selector":"ng-template[monaTimelineMarkerTemplate]","templateContext":{"members":[{"description":"The event (`let-event`).","name":"$implicit","type":"T"},{"description":"The event's date, read from its date field, or `null` when it has none (`let-date=\"date\"`).","name":"date","type":"Date | null"},{"description":"Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded=\"expanded\"`).","name":"expanded","type":"boolean"},{"description":"The event's index in the timeline's data (`let-index=\"index\"`).","name":"index","type":"number"}],"type":"TimelineEventTemplateContext<T>"},"typeParameters":["T = any"],"inputs":[{"defaultValue":"null","description":"The timeline's data, used only to type the template's event. Optional.","name":"monaTimelineMarkerTemplateOf","type":"Iterable<T> | null | undefined"}],"methods":[],"outputs":[],"properties":[],"page":{"path":"timeline","title":"Timeline"}},{"description":"The context of a timeline's templates, `monaTimelineHeaderTemplate`, `monaTimelineBodyTemplate`,\n`monaTimelineDateTemplate` and `monaTimelineMarkerTemplate`: the event, as `let-event`.","extends":[],"kind":"interface","methods":[],"name":"TimelineEventTemplateContext","properties":[{"description":"The event (`let-event`).","name":"$implicit","readonly":true,"type":"T"},{"description":"The event's date, read from its date field, or `null` when it has none (`let-date=\"date\"`).","name":"date","readonly":true,"type":"Date | null"},{"description":"Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded=\"expanded\"`).","name":"expanded","readonly":true,"type":"boolean"},{"description":"The event's index in the timeline's data (`let-index=\"index\"`).","name":"index","readonly":true,"type":"number"}],"typeParameters":["T = unknown"],"page":{"path":"timeline","title":"Timeline"}},{"description":"Which way a timeline runs: `\"vertical\"`, down the page, or `\"horizontal\"`, across it in the reading direction, which\nis right to left in a right-to-left layout.","kind":"type","name":"TimelineOrientation","signature":"type TimelineOrientation = \"horizontal\" | \"vertical\";","page":{"path":"timeline","title":"Timeline"},"usedBy":["TimelineComponent"]}]}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# `@nanahoshi/mona-ui/timeline`
|
|
2
|
+
|
|
3
|
+
Everything `@nanahoshi/mona-ui/timeline` exports.
|
|
4
|
+
|
|
5
|
+
**Guides:** [Timeline](../timeline.md)
|
|
6
|
+
|
|
7
|
+
## `TimelineComponent`
|
|
8
|
+
|
|
9
|
+
Component.
|
|
10
|
+
|
|
11
|
+
Events in order along a line: each one's date, a marker on the line, and a card with its title, subtitle and
|
|
12
|
+
description. It runs down the page, with the cards on one side of the line or on alternating sides, or across it,
|
|
13
|
+
scrolling sideways. It's an ordered list to assistive technology, each event's date read before its card, whose title
|
|
14
|
+
is a heading. On a collapsible timeline, each card's header is a button that opens its details.
|
|
15
|
+
|
|
16
|
+
The events are shown in the order of `data`, so sort them the way they should read: oldest first, or newest first.
|
|
17
|
+
|
|
18
|
+
**Selector:** `mona-timeline`
|
|
19
|
+
**Type parameters:** `T extends object = Record<string, unknown>`
|
|
20
|
+
|
|
21
|
+
### Inputs
|
|
22
|
+
|
|
23
|
+
| Name | Type | Default | Description |
|
|
24
|
+
| --- | --- | --- | --- |
|
|
25
|
+
| `alternate` | `boolean` | `false` | Puts the cards on alternating sides of the line: on a vertical timeline, after it and before it, once the timeline is 32rem wide, with each date on the side across from its card; on a horizontal one, below it and above it. |
|
|
26
|
+
| `aria-label` | `string` | `""` | The timeline's name, such as "Project history", which assistive technology reads with its list. |
|
|
27
|
+
| `aria-labelledby` | `string` | `""` | The id of an element that names the timeline, such as a heading above it. |
|
|
28
|
+
| `class` | `string` | `""` | Additional CSS classes merged onto the host element via `tailwind-merge`. A horizontal timeline's events are 16rem wide; set `--mona-timeline-event-width` to change it, as in `class="[--mona-timeline-event-width:20rem]"`. |
|
|
29
|
+
| `collapsible` | `boolean` | `false` | Makes each card's header a button that opens and closes its details: its description, or its body template. The open events are `expandedKeys`; all are closed by default. |
|
|
30
|
+
| `data` (required) | `Iterable<T>` | — | The events, in the order they're shown. |
|
|
31
|
+
| `dateField` | `string` | `"date"` | The field of each event that holds its date: a `Date`, a timestamp in milliseconds, or an ISO 8601 string, which is in local time unless it gives an offset. An event without one shows no date. |
|
|
32
|
+
| `dateFormat` | `Intl.DateTimeFormatOptions` | `{ dateStyle: "medium" }` | How each event's date is formatted, in the locale, such as `{ year: "numeric", month: "long" }`. The `<time>` element around it holds the date, and its time too when the format shows one. |
|
|
33
|
+
| `descriptionField` | `string` | `"description"` | The field of each event shown as its details, below its title. |
|
|
34
|
+
| `expandedKeys` (two-way) | `readonly unknown[]` | `[]` | The keys of the events whose details are open, on a collapsible timeline: the values of their `keyField`, or the events themselves without one. Bind it two-way, `[(expandedKeys)]`, to follow the user's toggles. |
|
|
35
|
+
| `headingLevel` | `number \| null` | `3` | The level of each event's heading, its title, from 1 to 6. Set it to fit the page's outline, or to `null` for no headings. |
|
|
36
|
+
| `keyField` | `string` | `""` | The field of each event that identifies it in `expandedKeys`, so an open event stays open when the data is replaced with copies. Without it, an event is its own key. |
|
|
37
|
+
| `orientation` | `TimelineOrientation` | `"vertical"` | Which way the timeline runs: `"vertical"`, down the page, or `"horizontal"`, across it, scrolling sideways when its events don't fit. A horizontal timeline takes focus, so the arrow keys scroll it. |
|
|
38
|
+
| `subtitleField` | `string` | `"subtitle"` | The field of each event shown below its title, such as a place or a person. |
|
|
39
|
+
| `titleField` | `string` | `"title"` | The field of each event shown as its title, the heading of its card. |
|
|
40
|
+
|
|
41
|
+
### Outputs
|
|
42
|
+
|
|
43
|
+
| Name | Type | Description |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| `expandedKeysChange` | `readonly unknown[]` | Emitted when `expandedKeys` changes. |
|
|
46
|
+
|
|
47
|
+
## `TimelineBodyTemplateDirective`
|
|
48
|
+
|
|
49
|
+
Directive.
|
|
50
|
+
|
|
51
|
+
Template for each event's details, in place of its description. On a collapsible timeline, it's what opens and closes.
|
|
52
|
+
|
|
53
|
+
The event is the template's implicit value (`let-event`), with its date (`let-date="date"`), whether its details are
|
|
54
|
+
open (`let-expanded="expanded"`) and its index (`let-index="index"`). Bind the timeline's data to
|
|
55
|
+
`monaTimelineBodyTemplateOf` to type the event; without it, the event is `any` in templates.
|
|
56
|
+
|
|
57
|
+
**Selector:** `ng-template[monaTimelineBodyTemplate]`
|
|
58
|
+
**Type parameters:** `T = any`
|
|
59
|
+
|
|
60
|
+
### Inputs
|
|
61
|
+
|
|
62
|
+
| Name | Type | Default | Description |
|
|
63
|
+
| --- | --- | --- | --- |
|
|
64
|
+
| `monaTimelineBodyTemplateOf` | `Iterable<T> \| null \| undefined` | `null` | The timeline's data, used only to type the template's event. Optional. |
|
|
65
|
+
|
|
66
|
+
### Template context
|
|
67
|
+
|
|
68
|
+
| Name | Type | Description |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `$implicit` | `T` | The event (`let-event`). |
|
|
71
|
+
| `date` | `Date \| null` | The event's date, read from its date field, or `null` when it has none (`let-date="date"`). |
|
|
72
|
+
| `expanded` | `boolean` | Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded="expanded"`). |
|
|
73
|
+
| `index` | `number` | The event's index in the timeline's data (`let-index="index"`). |
|
|
74
|
+
|
|
75
|
+
## `TimelineDateTemplateDirective`
|
|
76
|
+
|
|
77
|
+
Directive.
|
|
78
|
+
|
|
79
|
+
Template for each event's date label, in place of its date formatted with `dateFormat`, such as a relative date. Write the date in a `<time>` element with a `datetime` attribute.
|
|
80
|
+
|
|
81
|
+
The event is the template's implicit value (`let-event`), with its date (`let-date="date"`), whether its details are
|
|
82
|
+
open (`let-expanded="expanded"`) and its index (`let-index="index"`). Bind the timeline's data to
|
|
83
|
+
`monaTimelineDateTemplateOf` to type the event; without it, the event is `any` in templates.
|
|
84
|
+
|
|
85
|
+
**Selector:** `ng-template[monaTimelineDateTemplate]`
|
|
86
|
+
**Type parameters:** `T = any`
|
|
87
|
+
|
|
88
|
+
### Inputs
|
|
89
|
+
|
|
90
|
+
| Name | Type | Default | Description |
|
|
91
|
+
| --- | --- | --- | --- |
|
|
92
|
+
| `monaTimelineDateTemplateOf` | `Iterable<T> \| null \| undefined` | `null` | The timeline's data, used only to type the template's event. Optional. |
|
|
93
|
+
|
|
94
|
+
### Template context
|
|
95
|
+
|
|
96
|
+
| Name | Type | Description |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `$implicit` | `T` | The event (`let-event`). |
|
|
99
|
+
| `date` | `Date \| null` | The event's date, read from its date field, or `null` when it has none (`let-date="date"`). |
|
|
100
|
+
| `expanded` | `boolean` | Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded="expanded"`). |
|
|
101
|
+
| `index` | `number` | The event's index in the timeline's data (`let-index="index"`). |
|
|
102
|
+
|
|
103
|
+
## `TimelineHeaderTemplateDirective`
|
|
104
|
+
|
|
105
|
+
Directive.
|
|
106
|
+
|
|
107
|
+
Template for each event's header, in place of its title and subtitle. It's the event's heading and, on a collapsible timeline, the button that opens its details, so keep it to text and images: no links or controls.
|
|
108
|
+
|
|
109
|
+
The event is the template's implicit value (`let-event`), with its date (`let-date="date"`), whether its details are
|
|
110
|
+
open (`let-expanded="expanded"`) and its index (`let-index="index"`). Bind the timeline's data to
|
|
111
|
+
`monaTimelineHeaderTemplateOf` to type the event; without it, the event is `any` in templates.
|
|
112
|
+
|
|
113
|
+
**Selector:** `ng-template[monaTimelineHeaderTemplate]`
|
|
114
|
+
**Type parameters:** `T = any`
|
|
115
|
+
|
|
116
|
+
### Inputs
|
|
117
|
+
|
|
118
|
+
| Name | Type | Default | Description |
|
|
119
|
+
| --- | --- | --- | --- |
|
|
120
|
+
| `monaTimelineHeaderTemplateOf` | `Iterable<T> \| null \| undefined` | `null` | The timeline's data, used only to type the template's event. Optional. |
|
|
121
|
+
|
|
122
|
+
### Template context
|
|
123
|
+
|
|
124
|
+
| Name | Type | Description |
|
|
125
|
+
| --- | --- | --- |
|
|
126
|
+
| `$implicit` | `T` | The event (`let-event`). |
|
|
127
|
+
| `date` | `Date \| null` | The event's date, read from its date field, or `null` when it has none (`let-date="date"`). |
|
|
128
|
+
| `expanded` | `boolean` | Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded="expanded"`). |
|
|
129
|
+
| `index` | `number` | The event's index in the timeline's data (`let-index="index"`). |
|
|
130
|
+
|
|
131
|
+
## `TimelineMarkerTemplateDirective`
|
|
132
|
+
|
|
133
|
+
Directive.
|
|
134
|
+
|
|
135
|
+
Template for each event's marker on the line, in place of its dot, such as an icon for its status. It sits centered on the line. Assistive technology reads what it holds, so give an icon `aria-hidden="true"`, or text that says what it means.
|
|
136
|
+
|
|
137
|
+
The event is the template's implicit value (`let-event`), with its date (`let-date="date"`), whether its details are
|
|
138
|
+
open (`let-expanded="expanded"`) and its index (`let-index="index"`). Bind the timeline's data to
|
|
139
|
+
`monaTimelineMarkerTemplateOf` to type the event; without it, the event is `any` in templates.
|
|
140
|
+
|
|
141
|
+
**Selector:** `ng-template[monaTimelineMarkerTemplate]`
|
|
142
|
+
**Type parameters:** `T = any`
|
|
143
|
+
|
|
144
|
+
### Inputs
|
|
145
|
+
|
|
146
|
+
| Name | Type | Default | Description |
|
|
147
|
+
| --- | --- | --- | --- |
|
|
148
|
+
| `monaTimelineMarkerTemplateOf` | `Iterable<T> \| null \| undefined` | `null` | The timeline's data, used only to type the template's event. Optional. |
|
|
149
|
+
|
|
150
|
+
### Template context
|
|
151
|
+
|
|
152
|
+
| Name | Type | Description |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| `$implicit` | `T` | The event (`let-event`). |
|
|
155
|
+
| `date` | `Date \| null` | The event's date, read from its date field, or `null` when it has none (`let-date="date"`). |
|
|
156
|
+
| `expanded` | `boolean` | Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded="expanded"`). |
|
|
157
|
+
| `index` | `number` | The event's index in the timeline's data (`let-index="index"`). |
|
|
158
|
+
|
|
159
|
+
## `TimelineEventTemplateContext`
|
|
160
|
+
|
|
161
|
+
Interface.
|
|
162
|
+
|
|
163
|
+
The context of a timeline's templates, `monaTimelineHeaderTemplate`, `monaTimelineBodyTemplate`,
|
|
164
|
+
`monaTimelineDateTemplate` and `monaTimelineMarkerTemplate`: the event, as `let-event`.
|
|
165
|
+
|
|
166
|
+
**Type parameters:** `T = unknown`
|
|
167
|
+
|
|
168
|
+
### Properties
|
|
169
|
+
|
|
170
|
+
| Name | Type | Description |
|
|
171
|
+
| --- | --- | --- |
|
|
172
|
+
| `$implicit` (read-only) | `T` | The event (`let-event`). |
|
|
173
|
+
| `date` (read-only) | `Date \| null` | The event's date, read from its date field, or `null` when it has none (`let-date="date"`). |
|
|
174
|
+
| `expanded` (read-only) | `boolean` | Whether the event's details are open: always `true` unless the timeline is collapsible (`let-expanded="expanded"`). |
|
|
175
|
+
| `index` (read-only) | `number` | The event's index in the timeline's data (`let-index="index"`). |
|
|
176
|
+
|
|
177
|
+
## `TimelineOrientation`
|
|
178
|
+
|
|
179
|
+
Type alias.
|
|
180
|
+
|
|
181
|
+
Which way a timeline runs: `"vertical"`, down the page, or `"horizontal"`, across it in the reading direction, which
|
|
182
|
+
is right to left in a right-to-left layout.
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
type TimelineOrientation = "horizontal" | "vertical";
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Used by:** [`TimelineComponent`](timeline.md#timelinecomponent)
|