@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
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @molecule/app-timeline-angular
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular chronological timeline with event rails and date markers
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install @molecule/app-timeline-angular
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Part of the [Molecule](https://www.molecule.dev) package fleet. This page carries the manifest summary; the full generated documentation ships with the package's first committed version.
|
|
10
|
+
|
|
11
|
+
License: Apache-2.0
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular chronological timeline primitives.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<mol-timeline>` / `Timeline` — vertical list of events with optional date separators.
|
|
6
|
+
* - `<div mol-timeline-event>` / `TimelineEvent` — one event row with rail (marker + connector) + content.
|
|
7
|
+
* - `<div mol-timeline-rail>` / `TimelineRail` — standalone rail (marker + connector) for custom rows.
|
|
8
|
+
* - `<div mol-timeline-date>` / `TimelineDate` — date separator rendered between groups.
|
|
9
|
+
* - `TimelineEventData` type for event records.
|
|
10
|
+
*
|
|
11
|
+
* Use for activity chronologies, deal timelines, order tracking, audit logs.
|
|
12
|
+
* It is the Angular counterpart of `@molecule/app-timeline-react`: the same
|
|
13
|
+
* props (React names) and the same DOM for the same input, so switching
|
|
14
|
+
* framework is changing the package name in the imports.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { Component } from '@angular/core'
|
|
19
|
+
* import { Timeline, TimelineDate } from '@molecule/app-timeline-angular'
|
|
20
|
+
*
|
|
21
|
+
* @Component({
|
|
22
|
+
* selector: 'app-activity',
|
|
23
|
+
* standalone: true,
|
|
24
|
+
* imports: [Timeline, TimelineDate],
|
|
25
|
+
* template: `
|
|
26
|
+
* <mol-timeline [events]="events">
|
|
27
|
+
* <p slot="emptyState">No activity yet.</p>
|
|
28
|
+
* </mol-timeline>
|
|
29
|
+
* `,
|
|
30
|
+
* })
|
|
31
|
+
* export class Activity {
|
|
32
|
+
* events = [
|
|
33
|
+
* { id: '1', timestamp: '2 hours ago', title: 'Order placed' },
|
|
34
|
+
* { id: '2', timestamp: 'Yesterday', title: 'Payment confirmed', body: 'Visa ending 4242' },
|
|
35
|
+
* { id: '3', timestamp: 'Mar 12', title: 'Item shipped' },
|
|
36
|
+
* ]
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* This is NOT the Angular binding for `@molecule/app-timeline` (the headless
|
|
42
|
+
* provider core wired via `setProvider`) — it is standalone presentational
|
|
43
|
+
* markup with no provider. For domain-specific rows see the sibling
|
|
44
|
+
* `@molecule/app-{activity,order,status,stage,day}-timeline-angular` packages.
|
|
45
|
+
*
|
|
46
|
+
* `TimelineEventData.accent` is currently INERT — no component reads it, so
|
|
47
|
+
* setting it changes nothing; color a row by passing a custom `marker` node
|
|
48
|
+
* instead. `timestamp` is a display node — format/translate it before
|
|
49
|
+
* passing. Node-valued props are `ng-template` references; `Timeline`'s root is
|
|
50
|
+
* a fragment in its empty branch, so its host is `display: contents`, and rows
|
|
51
|
+
* are tracked by the event's `id`, like React's keys. The prop surface
|
|
52
|
+
* (documented on the exported `TimelineProps`, `TimelineEventProps`,
|
|
53
|
+
* `TimelineRailProps` and `TimelineDateProps` interfaces):
|
|
54
|
+
* Timeline(events, renderDateSeparator, emptyState, className),
|
|
55
|
+
* TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
|
|
56
|
+
* className), TimelineDate(children, className).
|
|
57
|
+
*
|
|
58
|
+
* @module
|
|
59
|
+
*/
|
|
60
|
+
export * from './timeline.component.js';
|
|
61
|
+
export * from './timeline-date.component.js';
|
|
62
|
+
export * from './timeline-event.component.js';
|
|
63
|
+
export * from './timeline-rail.component.js';
|
|
64
|
+
export * from './types.js';
|
|
65
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,YAAY,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular chronological timeline primitives.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `<mol-timeline>` / `Timeline` — vertical list of events with optional date separators.
|
|
6
|
+
* - `<div mol-timeline-event>` / `TimelineEvent` — one event row with rail (marker + connector) + content.
|
|
7
|
+
* - `<div mol-timeline-rail>` / `TimelineRail` — standalone rail (marker + connector) for custom rows.
|
|
8
|
+
* - `<div mol-timeline-date>` / `TimelineDate` — date separator rendered between groups.
|
|
9
|
+
* - `TimelineEventData` type for event records.
|
|
10
|
+
*
|
|
11
|
+
* Use for activity chronologies, deal timelines, order tracking, audit logs.
|
|
12
|
+
* It is the Angular counterpart of `@molecule/app-timeline-react`: the same
|
|
13
|
+
* props (React names) and the same DOM for the same input, so switching
|
|
14
|
+
* framework is changing the package name in the imports.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { Component } from '@angular/core'
|
|
19
|
+
* import { Timeline, TimelineDate } from '@molecule/app-timeline-angular'
|
|
20
|
+
*
|
|
21
|
+
* @Component({
|
|
22
|
+
* selector: 'app-activity',
|
|
23
|
+
* standalone: true,
|
|
24
|
+
* imports: [Timeline, TimelineDate],
|
|
25
|
+
* template: `
|
|
26
|
+
* <mol-timeline [events]="events">
|
|
27
|
+
* <p slot="emptyState">No activity yet.</p>
|
|
28
|
+
* </mol-timeline>
|
|
29
|
+
* `,
|
|
30
|
+
* })
|
|
31
|
+
* export class Activity {
|
|
32
|
+
* events = [
|
|
33
|
+
* { id: '1', timestamp: '2 hours ago', title: 'Order placed' },
|
|
34
|
+
* { id: '2', timestamp: 'Yesterday', title: 'Payment confirmed', body: 'Visa ending 4242' },
|
|
35
|
+
* { id: '3', timestamp: 'Mar 12', title: 'Item shipped' },
|
|
36
|
+
* ]
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* This is NOT the Angular binding for `@molecule/app-timeline` (the headless
|
|
42
|
+
* provider core wired via `setProvider`) — it is standalone presentational
|
|
43
|
+
* markup with no provider. For domain-specific rows see the sibling
|
|
44
|
+
* `@molecule/app-{activity,order,status,stage,day}-timeline-angular` packages.
|
|
45
|
+
*
|
|
46
|
+
* `TimelineEventData.accent` is currently INERT — no component reads it, so
|
|
47
|
+
* setting it changes nothing; color a row by passing a custom `marker` node
|
|
48
|
+
* instead. `timestamp` is a display node — format/translate it before
|
|
49
|
+
* passing. Node-valued props are `ng-template` references; `Timeline`'s root is
|
|
50
|
+
* a fragment in its empty branch, so its host is `display: contents`, and rows
|
|
51
|
+
* are tracked by the event's `id`, like React's keys. The prop surface
|
|
52
|
+
* (documented on the exported `TimelineProps`, `TimelineEventProps`,
|
|
53
|
+
* `TimelineRailProps` and `TimelineDateProps` interfaces):
|
|
54
|
+
* Timeline(events, renderDateSeparator, emptyState, className),
|
|
55
|
+
* TimelineEvent(event, isLast, className), TimelineRail(marker, connector,
|
|
56
|
+
* className), TimelineDate(children, className).
|
|
57
|
+
*
|
|
58
|
+
* @module
|
|
59
|
+
*/
|
|
60
|
+
export * from './timeline.component.js';
|
|
61
|
+
export * from './timeline-date.component.js';
|
|
62
|
+
export * from './timeline-event.component.js';
|
|
63
|
+
export * from './timeline-rail.component.js';
|
|
64
|
+
export * from './types.js';
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM helpers for the projected capture points of {@link Timeline}.
|
|
3
|
+
*
|
|
4
|
+
* React renders the empty state bare and drops the wrapper, or renders the
|
|
5
|
+
* wrapper and drops the empty state. Angular projection needs an
|
|
6
|
+
* always-mounted `<ng-content>` capture point, so the wrapper lives in the
|
|
7
|
+
* template unconditionally and these helpers reconcile it against React's DOM:
|
|
8
|
+
* the capture point is marked `data-parity-unwrap` (the snapshot expands it, so
|
|
9
|
+
* it looks like React's bare slot) and is detached together with its contents
|
|
10
|
+
* when React would not render it.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import type { ElementRef, Renderer2 } from '@angular/core';
|
|
15
|
+
/**
|
|
16
|
+
* Whether an ng-content wrapper captured any element or text node.
|
|
17
|
+
*
|
|
18
|
+
* @param el - The wrapper element.
|
|
19
|
+
* @returns True when at least one projected node exists.
|
|
20
|
+
*/
|
|
21
|
+
export declare const hasNodes: (el: Element | undefined | null) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Reconciles one always-mounted wrapper against what React renders.
|
|
24
|
+
*
|
|
25
|
+
* Both operations are idempotent and anchored in the wrapper's current parent
|
|
26
|
+
* (default: the component host), so a wrapper whose contents move with it can
|
|
27
|
+
* be detached and re-attached across prop changes.
|
|
28
|
+
*/
|
|
29
|
+
export declare class SlotGuard {
|
|
30
|
+
private readonly host;
|
|
31
|
+
private readonly renderer;
|
|
32
|
+
private readonly anchors;
|
|
33
|
+
/**
|
|
34
|
+
* Creates the guard.
|
|
35
|
+
*
|
|
36
|
+
* @param host - The component host element (default anchor parent).
|
|
37
|
+
* @param renderer - The DOM renderer.
|
|
38
|
+
*/
|
|
39
|
+
constructor(host: ElementRef<HTMLElement>, renderer: Renderer2);
|
|
40
|
+
/**
|
|
41
|
+
* Attaches or detaches the element (contents move with it).
|
|
42
|
+
*
|
|
43
|
+
* @param el - The wrapper element.
|
|
44
|
+
* @param shouldAttach - Whether it should be in the DOM.
|
|
45
|
+
*/
|
|
46
|
+
toggle(el: Element | undefined | null, shouldAttach: boolean): void;
|
|
47
|
+
/**
|
|
48
|
+
* Returns the wrapper's anchor comment in `parent`, creating (or replacing a
|
|
49
|
+
* stale one) where the wrapper sits.
|
|
50
|
+
*
|
|
51
|
+
* @param parent - The anchor's parent.
|
|
52
|
+
* @param el - The wrapper the anchor stands for.
|
|
53
|
+
* @returns The connected anchor comment.
|
|
54
|
+
*/
|
|
55
|
+
private anchorIn;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=slot-dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-dom.d.ts","sourceRoot":"","sources":["../src/slot-dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,IAAI,OAAO,GAAG,SAAS,GAAG,IAAI,KAAG,OAOzD,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,SAAS;IAUlB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAV3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IAEtD;;;;;OAKG;gBAEgB,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,EAC7B,QAAQ,EAAE,SAAS;IAGtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI;IAoBnE;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ;CASjB"}
|
package/dist/slot-dom.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM helpers for the projected capture points of {@link Timeline}.
|
|
3
|
+
*
|
|
4
|
+
* React renders the empty state bare and drops the wrapper, or renders the
|
|
5
|
+
* wrapper and drops the empty state. Angular projection needs an
|
|
6
|
+
* always-mounted `<ng-content>` capture point, so the wrapper lives in the
|
|
7
|
+
* template unconditionally and these helpers reconcile it against React's DOM:
|
|
8
|
+
* the capture point is marked `data-parity-unwrap` (the snapshot expands it, so
|
|
9
|
+
* it looks like React's bare slot) and is detached together with its contents
|
|
10
|
+
* when React would not render it.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Whether an ng-content wrapper captured any element or text node.
|
|
16
|
+
*
|
|
17
|
+
* @param el - The wrapper element.
|
|
18
|
+
* @returns True when at least one projected node exists.
|
|
19
|
+
*/
|
|
20
|
+
export const hasNodes = (el) => {
|
|
21
|
+
if (!el)
|
|
22
|
+
return false;
|
|
23
|
+
for (const node of Array.from(el.childNodes)) {
|
|
24
|
+
if (node.nodeType === 1)
|
|
25
|
+
return true;
|
|
26
|
+
if (node.nodeType === 3 && (node.textContent ?? '').trim())
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Reconciles one always-mounted wrapper against what React renders.
|
|
33
|
+
*
|
|
34
|
+
* Both operations are idempotent and anchored in the wrapper's current parent
|
|
35
|
+
* (default: the component host), so a wrapper whose contents move with it can
|
|
36
|
+
* be detached and re-attached across prop changes.
|
|
37
|
+
*/
|
|
38
|
+
export class SlotGuard {
|
|
39
|
+
host;
|
|
40
|
+
renderer;
|
|
41
|
+
anchors = new Map();
|
|
42
|
+
/**
|
|
43
|
+
* Creates the guard.
|
|
44
|
+
*
|
|
45
|
+
* @param host - The component host element (default anchor parent).
|
|
46
|
+
* @param renderer - The DOM renderer.
|
|
47
|
+
*/
|
|
48
|
+
constructor(host, renderer) {
|
|
49
|
+
this.host = host;
|
|
50
|
+
this.renderer = renderer;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Attaches or detaches the element (contents move with it).
|
|
54
|
+
*
|
|
55
|
+
* @param el - The wrapper element.
|
|
56
|
+
* @param shouldAttach - Whether it should be in the DOM.
|
|
57
|
+
*/
|
|
58
|
+
toggle(el, shouldAttach) {
|
|
59
|
+
if (!el)
|
|
60
|
+
return;
|
|
61
|
+
const parent = el.parentElement ?? this.host.nativeElement;
|
|
62
|
+
if (shouldAttach && !el.isConnected) {
|
|
63
|
+
const anchor = this.anchors.get(el);
|
|
64
|
+
if (anchor?.isConnected) {
|
|
65
|
+
parent.insertBefore(el, anchor);
|
|
66
|
+
this.renderer.removeChild(parent, anchor);
|
|
67
|
+
this.anchors.delete(el);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
parent.appendChild(el);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (!shouldAttach && el.isConnected) {
|
|
74
|
+
// A placeholder comment keeps the re-insertion position stable; the
|
|
75
|
+
// conformance normalizer strips comment nodes, so it never shows.
|
|
76
|
+
this.anchorIn(parent, el);
|
|
77
|
+
this.renderer.removeChild(parent, el);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns the wrapper's anchor comment in `parent`, creating (or replacing a
|
|
82
|
+
* stale one) where the wrapper sits.
|
|
83
|
+
*
|
|
84
|
+
* @param parent - The anchor's parent.
|
|
85
|
+
* @param el - The wrapper the anchor stands for.
|
|
86
|
+
* @returns The connected anchor comment.
|
|
87
|
+
*/
|
|
88
|
+
anchorIn(parent, el) {
|
|
89
|
+
const existing = this.anchors.get(el);
|
|
90
|
+
if (existing?.isConnected && existing.parentNode === parent)
|
|
91
|
+
return existing;
|
|
92
|
+
if (existing)
|
|
93
|
+
this.anchors.delete(el);
|
|
94
|
+
const created = this.renderer.createComment('slot');
|
|
95
|
+
parent.insertBefore(created, el.isConnected ? el : null);
|
|
96
|
+
this.anchors.set(el, created);
|
|
97
|
+
return created;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=slot-dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-dom.js","sourceRoot":"","sources":["../src/slot-dom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAA8B,EAAW,EAAE;IAClE,IAAI,CAAC,EAAE;QAAE,OAAO,KAAK,CAAA;IACrB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC;YAAE,OAAO,IAAI,CAAA;QACpC,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;YAAE,OAAO,IAAI,CAAA;IACzE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,OAAO,SAAS;IAUD;IACA;IAVF,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAA;IAEtD;;;;;OAKG;IACH,YACmB,IAA6B,EAC7B,QAAmB;QADnB,SAAI,GAAJ,IAAI,CAAyB;QAC7B,aAAQ,GAAR,QAAQ,CAAW;IACnC,CAAC;IAEJ;;;;;OAKG;IACH,MAAM,CAAC,EAA8B,EAAE,YAAqB;QAC1D,IAAI,CAAC,EAAE;YAAE,OAAM;QACf,MAAM,MAAM,GAAS,EAAE,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAA;QAChE,IAAI,YAAY,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC;YACpC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACnC,IAAI,MAAM,EAAE,WAAW,EAAE,CAAC;gBACxB,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;gBAC/B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;gBACzC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YACzB,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;YACxB,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC3C,oEAAoE;YACpE,kEAAkE;YAClE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;YACzB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACK,QAAQ,CAAC,MAAY,EAAE,EAAW;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACrC,IAAI,QAAQ,EAAE,WAAW,IAAI,QAAQ,CAAC,UAAU,KAAK,MAAM;YAAE,OAAO,QAAQ,CAAA;QAC5E,IAAI,QAAQ;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QACnD,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACxD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;QAC7B,OAAO,OAAO,CAAA;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { UIClassMap } from '@molecule/app-ui';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* TimelineDate component.
|
|
5
|
+
*
|
|
6
|
+
* Date separator rendered between timeline groups. The host IS the
|
|
7
|
+
* separator's outer `<div>` (`div[mol-timeline-date]`), matching React's root
|
|
8
|
+
* exactly, and the label is projected content (the default `<ng-content>`).
|
|
9
|
+
*
|
|
10
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
11
|
+
* `TimelineDate`: the same props (React names), the same ClassMap tokens, and
|
|
12
|
+
* the same DOM for the same input.
|
|
13
|
+
*/
|
|
14
|
+
export declare class TimelineDate {
|
|
15
|
+
/** Extra classes. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The current class map.
|
|
19
|
+
* @returns The UIClassMap.
|
|
20
|
+
*/
|
|
21
|
+
cm(): UIClassMap;
|
|
22
|
+
/**
|
|
23
|
+
* Computes the separator's class list.
|
|
24
|
+
* @returns The class string.
|
|
25
|
+
*/
|
|
26
|
+
classes(): string;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimelineDate, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TimelineDate, "div[mol-timeline-date]", never, { "className": { "alias": "className"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=timeline-date.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-date.component.d.ts","sourceRoot":"","sources":["../src/timeline-date.component.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;;AAGlD;;;;;;;;;;GAUG;AACH,qBASa,YAAY;IACvB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;OAGG;IACH,OAAO,IAAI,MAAM;yCAhBN,YAAY;2CAAZ,YAAY;CAyBxB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TimelineDate component (React parity).
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Component } from '@angular/core';
|
|
7
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
const _c0 = ["*"];
|
|
10
|
+
/**
|
|
11
|
+
* TimelineDate component.
|
|
12
|
+
*
|
|
13
|
+
* Date separator rendered between timeline groups. The host IS the
|
|
14
|
+
* separator's outer `<div>` (`div[mol-timeline-date]`), matching React's root
|
|
15
|
+
* exactly, and the label is projected content (the default `<ng-content>`).
|
|
16
|
+
*
|
|
17
|
+
* This is the Angular counterpart of `@molecule/app-timeline-react`'s
|
|
18
|
+
* `TimelineDate`: the same props (React names), the same ClassMap tokens, and
|
|
19
|
+
* the same DOM for the same input.
|
|
20
|
+
*/
|
|
21
|
+
export class TimelineDate {
|
|
22
|
+
/** Extra classes. */
|
|
23
|
+
className;
|
|
24
|
+
/**
|
|
25
|
+
* The current class map.
|
|
26
|
+
* @returns The UIClassMap.
|
|
27
|
+
*/
|
|
28
|
+
cm() {
|
|
29
|
+
return getClassMap();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Computes the separator's class list.
|
|
33
|
+
* @returns The class string.
|
|
34
|
+
*/
|
|
35
|
+
classes() {
|
|
36
|
+
return this.cm().cn(this.cm().flex({ align: 'center', gap: 'sm' }), this.cm().sp('py', 2), this.cm().textSize('xs'), this.cm().fontWeight('semibold'), this.className);
|
|
37
|
+
}
|
|
38
|
+
static ɵfac = function TimelineDate_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimelineDate)(); };
|
|
39
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TimelineDate, selectors: [["div", "mol-timeline-date", ""]], hostVars: 2, hostBindings: function TimelineDate_HostBindings(rf, ctx) { if (rf & 2) {
|
|
40
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
41
|
+
} }, inputs: { className: "className" }, ngContentSelectors: _c0, decls: 2, vars: 2, template: function TimelineDate_Template(rf, ctx) { if (rf & 1) {
|
|
42
|
+
i0.ɵɵprojectionDef();
|
|
43
|
+
i0.ɵɵdomElementStart(0, "span");
|
|
44
|
+
i0.ɵɵprojection(1);
|
|
45
|
+
i0.ɵɵdomElementEnd();
|
|
46
|
+
} if (rf & 2) {
|
|
47
|
+
i0.ɵɵclassMap(ctx.cm().cn(ctx.cm().flex1));
|
|
48
|
+
} }, encapsulation: 2 });
|
|
49
|
+
}
|
|
50
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimelineDate, [{
|
|
51
|
+
type: Component,
|
|
52
|
+
args: [{
|
|
53
|
+
selector: 'div[mol-timeline-date]',
|
|
54
|
+
standalone: true,
|
|
55
|
+
inputs: ['className'],
|
|
56
|
+
host: {
|
|
57
|
+
'[class]': 'classes()',
|
|
58
|
+
},
|
|
59
|
+
template: `<span [class]="cm().cn(cm().flex1)"><ng-content></ng-content></span>`,
|
|
60
|
+
}]
|
|
61
|
+
}], null, null); })();
|
|
62
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TimelineDate, { className: "TimelineDate", filePath: "timeline-date.component.ts", lineNumber: 32 }); })();
|
|
63
|
+
//# sourceMappingURL=timeline-date.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-date.component.js","sourceRoot":"","sources":["../src/timeline-date.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;;;AAE9C;;;;;;;;;;GAUG;AAUH,MAAM,OAAO,YAAY;IACvB,qBAAqB;IACrB,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,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,EAC9C,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EACrB,IAAI,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EACxB,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAChC,IAAI,CAAC,SAAS,CACf,CAAA;IACH,CAAC;sGAxBU,YAAY;6DAAZ,YAAY;YAAZ,cAAA,aAAS,CAAG;;;YAFZ,+BAAoC;YAAA,kBAAyB;YAAA,oBAAO;;YAA9D,0CAA6B;;;iFAEnC,YAAY;cATxB,SAAS;eAAC;gBACT,QAAQ,EAAE,wBAAwB;gBAClC,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC,WAAW,CAAC;gBACrB,IAAI,EAAE;oBACJ,SAAS,EAAE,WAAW;iBACvB;gBACD,QAAQ,EAAE,sEAAsE;aACjF;;kFACY,YAAY"}
|