@proximus/lavender-timeline 1.4.14-beta.2 → 1.4.15-alpha.2

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.
@@ -6,8 +6,8 @@ export declare class Timeline extends HTMLElement {
6
6
  connectedCallback(): void;
7
7
  attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
8
8
  configureChildren(): void;
9
- get $el(): Element;
9
+ get $el(): Element | null;
10
10
  get $children(): NodeListOf<Element>;
11
- get inverted(): string;
12
- set inverted(value: string);
11
+ get inverted(): boolean;
12
+ set inverted(value: boolean);
13
13
  }
@@ -7,11 +7,11 @@ export declare class TimelineItem extends HTMLElement {
7
7
  attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
8
8
  updateItem(oldValue: string, newValue: string): void;
9
9
  updateIndicator(item: string): void;
10
- get $el(): Element;
11
- get inverted(): string;
12
- set inverted(value: string);
13
- get lastchild(): string;
14
- set lastchild(value: string);
15
- get item(): string;
16
- set item(value: string);
10
+ get $el(): Element | null;
11
+ get inverted(): boolean;
12
+ set inverted(value: boolean);
13
+ get lastchild(): boolean;
14
+ set lastchild(value: boolean);
15
+ get item(): string | null;
16
+ set item(value: string | null);
17
17
  }
package/dist/index.es.js CHANGED
@@ -1,138 +1,577 @@
1
- var s = (n) => {
2
- throw TypeError(n);
1
+ //#region src/timeline.css?inline
2
+ var e = ".timeline{margin:0;padding:0;list-style:none}", t = ":host([grow]){flex-grow:var(--grow-value)}:host([shrink]){flex-shrink:var(--shrink-value)}:host([basis]){flex-basis:var(--basis-value)}:host([align-self]){align-self:var(--align-self-value)}:host([col-span]){grid-column:span var(--col-span-value) / span var(--col-span-value)}:host([justify-self]){justify-self:var(--justify-self-value)}:host([order]),::slotted([order]){order:var(--order-value)}:host([sticky-top]),:host([sticky-bottom]){z-index:5}:host([sticky-top]){position:sticky;top:0}:host([sticky-bottom]){position:sticky;bottom:0}:host([hidden]),::slotted([hidden]){display:none}:host([shown--sr]),::slotted([shown--sr]){clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}:host([word-break-all]){word-break:break-all}@media screen and (width<=47.938rem){:host([hidden--mobile]),::slotted([hidden--mobile]){display:none}:host([grow--mobile]){flex-grow:var(--grow--mobile-value)!important}:host([shrink--mobile]){flex-shrink:var(--shrink--mobile-value)!important}:host([basis--mobile]){flex-basis:var(--basis--mobile-value)!important}:host([align-self--mobile]){align-self:var(--align-self--mobile-value)!important}:host([col-span--mobile]){grid-column:span var(--col-span--mobile-value) / span var(--col-span--mobile-value)!important}:host([justify-self--mobile]){justify-self:var(--justify-self--mobile-value)!important}:host([order--mobile]),::slotted([order--mobile]){order:var(--order--mobile-value)!important}:host([shown--sr--mobile]),::slotted([shown--sr--mobile]){clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}}:host([word-break-all--mobile]){word-break:break-all!important}@media screen and (width>=48rem) and (width<=64rem){:host([hidden--tablet]),::slotted([hidden--tablet]){display:none}:host([grow--tablet]){flex-grow:var(--grow--tablet-value)!important}:host([shrink--tablet]){flex-shrink:var(--shrink--tablet-value)!important}:host([basis--tablet]){flex-basis:var(--basis--tablet-value)!important}:host([align-self--tablet]){align-self:var(--align-self--tablet-value)!important}:host([col-span--tablet]){grid-column:span var(--col-span--tablet-value) / span var(--col-span--tablet-value)!important}:host([justify-self--tablet]){justify-self:var(--justify-self--tablet-value)!important}:host([order--tablet]),::slotted([order--tablet]){order:var(--order--tablet-value)!important}:host([shown--sr--tablet]),::slotted([shown--sr--tablet]){clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}}:host([word-break-all--tablet]){word-break:break-all!important}@media screen and (width>=64.0625rem){:host([shown--sr--laptop]),::slotted([shown--sr--laptop]){clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}:host([hidden--laptop]),::slotted([hidden--laptop]){display:none!important}:host([grow--laptop]){flex-grow:var(--grow--laptop-value)!important}:host([shrink--laptop]){flex-shrink:var(--shrink--laptop-value)!important}:host([basis--laptop]){flex-basis:var(--basis--laptop-value)!important}:host([align-self--laptop]){align-self:var(--align-self--laptop-value)!important}:host([col-span--laptop]){grid-column:span var(--col-span--laptop-value) / span var(--col-span--laptop-value)!important}:host([justify-self--laptop]){justify-self:var(--justify-self--laptop-value)!important}:host([order--laptop]),::slotted([order--laptop]){order:var(--order--laptop-value)!important}}:host([word-break-all--laptop]){word-break:break-all!important}@media screen and (width>=90.0625rem){:host([col-span--desktop]){grid-column:span var(--col-span--desktop-value) / span var(--col-span--desktop-value)!important}:host([justify-self--desktop]){justify-self:var(--justify-self--desktop-value)!important}:host([order--desktop]),::slotted([order--desktop]){order:var(--order--desktop-value)!important}:host([hidden--desktop]),::slotted([hidden--desktop]){display:none!important}:host([grow--desktop]){flex-grow:var(--grow--desktop-value)!important}:host([shrink--desktop]){flex-shrink:var(--shrink--desktop-value)!important}:host([basis--desktop]){flex-basis:var(--basis--desktop-value)!important}:host([align-self--desktop]){align-self:var(--align-self--desktop-value)!important}:host([word-break-all--desktop]){word-break:break-all!important}}";
3
+ //#endregion
4
+ //#region ../common/src/common.ts
5
+ function n(e) {
6
+ let t = document.createElement(e), n = Object.getPrototypeOf(t);
7
+ return Object.getOwnPropertyNames(n);
8
+ }
9
+ function r(e) {
10
+ let t = document.createElement(e), n = Object.getPrototypeOf(t);
11
+ return Object.getOwnPropertyNames(n).map((e) => e.toLowerCase());
12
+ }
13
+ var i = new CSSStyleSheet();
14
+ i.replaceSync(t);
15
+ var a = {
16
+ BASE_URL: "/",
17
+ DEV: !0,
18
+ MODE: "production",
19
+ PROD: !1,
20
+ SSR: !1,
21
+ VITE_COMPONENT_DEBUG: "true"
22
+ }, o = a?.VITE_COMPONENT_DEBUG === "true" || a?.DEV === !0;
23
+ typeof window < "u" && (window.isComponentDebug = s);
24
+ function s() {
25
+ return o;
26
+ }
27
+ function c(e) {
28
+ s() && console.error(e);
29
+ }
30
+ typeof window < "u" && (window.isComponentDebug = s);
31
+ var l = class e extends HTMLElement {
32
+ static get observedAttributes() {
33
+ return /* @__PURE__ */ "grow.grow--mobile.grow--tablet.grow--laptop.grow--desktop.shrink.shrink--mobile.shrink--tablet.shrink--laptop.shrink--desktop.basis.basis--mobile.basis--tablet.basis--laptop.basis--desktop.align-self.align-self--mobile.align-self--tablet.align-self--laptop.align-self--desktop.justify-self.justify-self--mobile.justify-self--tablet.justify-self--laptop.justify-self--desktop.hidden.hidden--mobile.hidden--tablet.hidden--laptop.hidden--desktop.shown--sr.shown--sr--mobile.shown--sr--tablet.shown--sr--laptop.shown--sr--desktop.col-span.col-span--mobile.col-span--tablet.col-span--laptop.col-span--desktop.order.order--mobile.order--tablet.order--laptop.order--desktop.sticky-top.sticky-bottom.word-break-all.word-break-all--mobile.word-break-all--tablet.word-break-all--laptop.word-break-all--desktop".split(".");
34
+ }
35
+ constructor(...e) {
36
+ super(), this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [i, ...e];
37
+ }
38
+ attributeChangedCallback(t, n, r) {
39
+ if (e.observedAttributes.indexOf(t) !== -1) switch (t) {
40
+ case "grow":
41
+ case "grow--mobile":
42
+ case "grow--tablet":
43
+ case "grow--laptop":
44
+ case "grow--desktop":
45
+ case "shrink":
46
+ case "shrink--mobile":
47
+ case "shrink--tablet":
48
+ case "shrink--laptop":
49
+ case "shrink--desktop":
50
+ case "basis":
51
+ case "basis--mobile":
52
+ case "basis--tablet":
53
+ case "basis--laptop":
54
+ case "basis--desktop":
55
+ this.style.setProperty(`--${t}-value`, r);
56
+ break;
57
+ case "align-self":
58
+ case "align-self--mobile":
59
+ case "align-self--tablet":
60
+ case "align-self--laptop":
61
+ case "align-self--desktop":
62
+ this.updateProperties(t, n, r, this.parentElement?.localName === "px-grid" ? d : u);
63
+ break;
64
+ case "justify-self":
65
+ case "justify-self--mobile":
66
+ case "justify-self--tablet":
67
+ case "justify-self--laptop":
68
+ case "justify-self--desktop":
69
+ this.updateProperties(t, n, r, f);
70
+ break;
71
+ case "col-span":
72
+ case "col-span--mobile":
73
+ case "col-span--tablet":
74
+ case "col-span--laptop":
75
+ case "col-span--desktop":
76
+ this.updateProperties(t, n, r, p);
77
+ break;
78
+ case "order":
79
+ case "order--mobile":
80
+ case "order--tablet":
81
+ case "order--laptop":
82
+ case "order--desktop": this.updateProperties(t, n, r, m);
83
+ }
84
+ }
85
+ updateProperties(e, t, n, r) {
86
+ r && (this.checkName(r, n) || c(`"${n}" is not an allowed ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${r.join("\", \"")}".`));
87
+ let i = e.indexOf("--") > -1, a = i ? e.split("--")[0] : e;
88
+ if (!i) this.style.setProperty(`--${a}-value`, t), this.style.setProperty(`--${a}-value`, n);
89
+ else {
90
+ let r = e.split("--")[1];
91
+ this.style.setProperty(`--${a}--${r}-value`, t), this.style.setProperty(`--${a}--${r}-value`, n);
92
+ }
93
+ }
94
+ updateStyle(e, t, n) {
95
+ n !== null && n !== "" && n !== "default" && this.style.setProperty(`--${e}--${t}-value`, n);
96
+ }
97
+ checkName(e, t) {
98
+ return e.includes(t);
99
+ }
100
+ get $el() {
101
+ return this;
102
+ }
103
+ get $parentElementName() {
104
+ return this.parentElement?.tagName.toLowerCase();
105
+ }
106
+ get isInsideGridOrStack() {
107
+ let e = this.parentElement;
108
+ for (; e;) {
109
+ if (e.localName === "px-grid" || e.localName === "px-stack" && e?.getAttribute("direction") === "row") return !0;
110
+ if (window.getComputedStyle(e).display === "contents") {
111
+ e = e.parentElement;
112
+ continue;
113
+ }
114
+ break;
115
+ }
116
+ return !1;
117
+ }
118
+ get grow() {
119
+ return this.getAttribute("grow");
120
+ }
121
+ set grow(e) {
122
+ h(this, "grow", e);
123
+ }
124
+ get growMobile() {
125
+ return this.getAttribute("grow--mobile");
126
+ }
127
+ set growMobile(e) {
128
+ h(this, "grow--mobile", e);
129
+ }
130
+ get growTablet() {
131
+ return this.getAttribute("grow--tablet");
132
+ }
133
+ set growTablet(e) {
134
+ h(this, "grow--tablet", e);
135
+ }
136
+ get growLaptop() {
137
+ return this.getAttribute("grow--laptop");
138
+ }
139
+ set growLaptop(e) {
140
+ h(this, "grow--laptop", e);
141
+ }
142
+ get growDesktop() {
143
+ return this.getAttribute("grow--desktop");
144
+ }
145
+ set growDesktop(e) {
146
+ h(this, "grow--desktop", e);
147
+ }
148
+ get shrink() {
149
+ return this.getAttribute("shrink");
150
+ }
151
+ set shrink(e) {
152
+ h(this, "shrink", e);
153
+ }
154
+ get shrinkMobile() {
155
+ return this.getAttribute("shrink--mobile");
156
+ }
157
+ set shrinkMobile(e) {
158
+ h(this, "shrink--mobile", e);
159
+ }
160
+ get shrinkTablet() {
161
+ return this.getAttribute("shrink--tablet");
162
+ }
163
+ set shrinkTablet(e) {
164
+ h(this, "shrink--tablet", e);
165
+ }
166
+ get shrinkLaptop() {
167
+ return this.getAttribute("shrink--laptop");
168
+ }
169
+ set shrinkLaptop(e) {
170
+ h(this, "shrink--laptop", e);
171
+ }
172
+ get shrinkDesktop() {
173
+ return this.getAttribute("shrink--desktop");
174
+ }
175
+ set shrinkDesktop(e) {
176
+ h(this, "shrink--desktop", e);
177
+ }
178
+ get basis() {
179
+ return this.getAttribute("basis");
180
+ }
181
+ set basis(e) {
182
+ h(this, "basis", e);
183
+ }
184
+ get basisMobile() {
185
+ return this.getAttribute("basis--mobile");
186
+ }
187
+ set basisMobile(e) {
188
+ h(this, "basis--mobile", e);
189
+ }
190
+ get basisTablet() {
191
+ return this.getAttribute("basis--tablet");
192
+ }
193
+ set basisTablet(e) {
194
+ h(this, "basis--tablet", e);
195
+ }
196
+ get basisLaptop() {
197
+ return this.getAttribute("basis--laptop");
198
+ }
199
+ set basisLaptop(e) {
200
+ h(this, "basis--laptop", e);
201
+ }
202
+ get basisDesktop() {
203
+ return this.getAttribute("basis--desktop");
204
+ }
205
+ set basisDesktop(e) {
206
+ h(this, "basis--desktop", e);
207
+ }
208
+ get alignSelf() {
209
+ return this.getAttribute("align-self");
210
+ }
211
+ set alignSelf(e) {
212
+ h(this, "align-self", e);
213
+ }
214
+ get alignSelfMobile() {
215
+ return this.getAttribute("align-self--mobile");
216
+ }
217
+ set alignSelfMobile(e) {
218
+ h(this, "align-self--mobile", e);
219
+ }
220
+ get alignSelfTablet() {
221
+ return this.getAttribute("align-self--tablet");
222
+ }
223
+ set alignSelfTablet(e) {
224
+ h(this, "align-self--tablet", e);
225
+ }
226
+ get alignSelfLaptop() {
227
+ return this.getAttribute("align-self--laptop");
228
+ }
229
+ set alignSelfLaptop(e) {
230
+ h(this, "align-self--laptop", e);
231
+ }
232
+ get alignSelfDesktop() {
233
+ return this.getAttribute("align-self--desktop");
234
+ }
235
+ set alignSelfDesktop(e) {
236
+ h(this, "align-self--desktop", e);
237
+ }
238
+ get justifySelf() {
239
+ return this.getAttribute("justify-self");
240
+ }
241
+ set justifySelf(e) {
242
+ h(this, "justify-self", e);
243
+ }
244
+ get justifySelfMobile() {
245
+ return this.getAttribute("justify-self--mobile");
246
+ }
247
+ set justifySelfMobile(e) {
248
+ h(this, "justify-self--mobile", e);
249
+ }
250
+ get justifySelfTablet() {
251
+ return this.getAttribute("justify-self--tablet");
252
+ }
253
+ set justifySelfTablet(e) {
254
+ h(this, "justify-self--tablet", e);
255
+ }
256
+ get justifySelfLaptop() {
257
+ return this.getAttribute("justify-self--laptop");
258
+ }
259
+ set justifySelfLaptop(e) {
260
+ h(this, "justify-self--laptop", e);
261
+ }
262
+ get justifySelfDesktop() {
263
+ return this.getAttribute("justify-self--desktop");
264
+ }
265
+ set justifySelfDesktop(e) {
266
+ h(this, "justify-self--desktop", e);
267
+ }
268
+ get hiddenMobile() {
269
+ return this.hasAttribute("hidden--mobile");
270
+ }
271
+ set hiddenMobile(e) {
272
+ g(this, "hidden--mobile", e);
273
+ }
274
+ get hiddenTablet() {
275
+ return this.hasAttribute("hidden--tablet");
276
+ }
277
+ set hiddenTablet(e) {
278
+ g(this, "hidden--tablet", e);
279
+ }
280
+ get hiddenLaptop() {
281
+ return this.hasAttribute("hidden--laptop");
282
+ }
283
+ set hiddenLaptop(e) {
284
+ g(this, "hidden--laptop", e);
285
+ }
286
+ get hiddenDesktop() {
287
+ return this.hasAttribute("hidden--desktop");
288
+ }
289
+ set hiddenDesktop(e) {
290
+ g(this, "hidden--desktop", e);
291
+ }
292
+ get colSpan() {
293
+ return this.getAttribute("col-span");
294
+ }
295
+ set colSpan(e) {
296
+ h(this, "col-span", e);
297
+ }
298
+ get colSpanMobile() {
299
+ return this.getAttribute("col-span--mobile");
300
+ }
301
+ set colSpanMobile(e) {
302
+ h(this, "col-span--mobile", e);
303
+ }
304
+ get colSpanTablet() {
305
+ return this.getAttribute("col-span--tablet");
306
+ }
307
+ set colSpanTablet(e) {
308
+ h(this, "col-span--tablet", e);
309
+ }
310
+ get colSpanLaptop() {
311
+ return this.getAttribute("col-span--laptop");
312
+ }
313
+ set colSpanLaptop(e) {
314
+ h(this, "col-span--laptop", e);
315
+ }
316
+ get colSpanDesktop() {
317
+ return this.getAttribute("col-span--desktop");
318
+ }
319
+ set colSpanDesktop(e) {
320
+ h(this, "col-span--desktop", e);
321
+ }
322
+ get order() {
323
+ return this.getAttribute("order");
324
+ }
325
+ set order(e) {
326
+ h(this, "order", e);
327
+ }
328
+ get orderMobile() {
329
+ return this.getAttribute("order--mobile");
330
+ }
331
+ set orderMobile(e) {
332
+ h(this, "order--mobile", e);
333
+ }
334
+ get orderTablet() {
335
+ return this.getAttribute("order--tablet");
336
+ }
337
+ set orderTablet(e) {
338
+ h(this, "order--tablet", e);
339
+ }
340
+ get orderLaptop() {
341
+ return this.getAttribute("order--laptop");
342
+ }
343
+ set orderLaptop(e) {
344
+ h(this, "order--laptop", e);
345
+ }
346
+ get orderDesktop() {
347
+ return this.getAttribute("order--desktop");
348
+ }
349
+ set orderDesktop(e) {
350
+ h(this, "order--desktop", e);
351
+ }
3
352
  };
4
- var x = (n, e, t) => e.has(n) || s("Cannot " + t);
5
- var d = (n, e, t) => e.has(n) ? s("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t);
6
- var o = (n, e, t) => (x(n, e, "access private method"), t);
7
- const v = ".timeline{list-style:none;margin:0;padding:0}", b = '.timeline-item{display:flex;gap:var(--px-spacing-default-mobile);font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l)}.indicator-area{position:relative}.indicator-area:before{display:block;content:"";position:absolute;top:26px;left:12px;width:var(--px-size-border-m);height:calc(100% - 26px);background:var(--px-color-border-main-default)}.indicator-area .indicator{display:flex;align-items:center;justify-content:center;text-align:center;width:26px;height:26px;font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-m-mobile);color:var(--px-color-text-neutral-default);border-radius:var(--px-radius-pill);background:var(--px-color-background-container-default-default)}.content-area{display:flex;flex-direction:column;margin-bottom:var(--px-padding-m-mobile);gap:var(--px-spacing-xs-mobile)}.content-area ::slotted([slot="title"]){font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-l-mobile);color:var(--px-color-text-neutral-default)}.content-area ::slotted([slot="content"]){font-weight:var(--px-font-weight-body);font-size:var(--px-text-size-body-m-mobile);color:var(--px-color-text-dimmed-default)}:host([lastchild]) .indicator-area:before{display:none}:host([lastchild]) .content-area{margin-bottom:0}:host([inverted]) .indicator-area:before{background:var(--px-color-border-main-inverted)}:host([inverted]) .indicator{color:var(--px-color-text-neutral-inverted);background:var(--px-color-background-container-default-inverted)}:host([inverted]) .content-area ::slotted([slot="title"]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .content-area ::slotted([slot="content"]){color:var(--px-color-text-dimmed-inverted)}@media screen and (min-width: 48rem){.timeline-item{gap:var(--px-spacing-default-tablet)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-tablet)}.content-area{margin-bottom:var(--px-padding-m-tablet);gap:var(--px-spacing-xs-tablet)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-tablet)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-tablet)}}@media screen and (min-width: 64.0625rem){.timeline-item{gap:var(--px-spacing-default-laptop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-laptop)}.content-area{margin-bottom:var(--px-padding-m-laptop)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-laptop)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-laptop)}}@media screen and (min-width: 90.0625rem){.timeline-item{gap:var(--px-spacing-default-desktop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-desktop)}.content-area{margin-bottom:var(--px-padding-m-desktop)}.content-area ::slotted([slot="title"]){font-size:var(--px-text-size-label-l-desktop)}.content-area ::slotted([slot="content"]){font-size:var(--px-text-size-body-m-desktop)}}', c = new CSSStyleSheet();
8
- c.replaceSync(b);
9
- const p = "px-timeline-item-connected";
10
- let l = "1";
11
- class u extends HTMLElement {
12
- template() {
13
- return `
14
- <li class="timeline-item" role="listitem">
15
- <div class="indicator-area">
16
- <div class="indicator"></div>
17
- </div>
18
- <div class="content-area">
19
- <slot name="title"></slot>
20
- <slot name="content"></slot>
21
- </div>
22
- </li>
23
- `;
24
- }
25
- constructor() {
26
- super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [c];
27
- }
28
- connectedCallback() {
29
- this.dispatchEvent(
30
- new CustomEvent(p, {
31
- bubbles: !0,
32
- composed: !0
33
- })
34
- );
35
- }
36
- static get observedAttributes() {
37
- return ["inverted", "lastchild", "item"];
38
- }
39
- attributeChangedCallback(e, t, i) {
40
- if (t !== i)
41
- switch (e) {
42
- case "item":
43
- this.updateItem(t, i), this.updateIndicator(l);
44
- break;
45
- }
46
- }
47
- updateItem(e, t) {
48
- e !== null && e !== "" && (l = e), t !== null && t !== "" && (l = t);
49
- }
50
- updateIndicator(e) {
51
- const t = this.$el.querySelector(".indicator");
52
- t.innerHTML = e;
53
- }
54
- get $el() {
55
- return this.shadowRoot.querySelector(".timeline-item");
56
- }
57
- get inverted() {
58
- return this.getAttribute("inverted");
59
- }
60
- set inverted(e) {
61
- this.setAttribute("inverted", e);
62
- }
63
- get lastchild() {
64
- return this.getAttribute("lastchild");
65
- }
66
- set lastchild(e) {
67
- this.setAttribute("lastchild", e);
68
- }
69
- get item() {
70
- return this.getAttribute("item");
71
- }
72
- set item(e) {
73
- this.setAttribute("item", e);
74
- }
353
+ (class extends l {
354
+ static {
355
+ this.accessorExclusions = [];
356
+ }
357
+ static get observedAttributes() {
358
+ return [...super.observedAttributes, ...r(this.nativeName)];
359
+ }
360
+ attributeChangedCallback(e, t, n) {
361
+ super.attributeChangedCallback(e, t, n), n === null ? this.$el.toggleAttribute(e) : this.$el.setAttribute(e, n);
362
+ }
363
+ get ctor() {
364
+ return Object.getPrototypeOf(this).constructor;
365
+ }
366
+ constructor(...e) {
367
+ super(...e), this.ctor.supportedPropertyNames || (this.ctor.supportedPropertyNames = n(this.ctor.nativeName)), this.enhanceWithNativeProperties();
368
+ }
369
+ enhanceWithNativeProperties() {
370
+ for (let e of this.ctor.supportedPropertyNames) if (!(e === "constructor" || (this.ctor?.accessorExclusions ?? []).includes(e))) try {
371
+ Object.defineProperty(this, e, {
372
+ get() {
373
+ return this.$el[e];
374
+ },
375
+ set(t) {
376
+ this.$el[e] !== t && (this.$el[e] = t);
377
+ }
378
+ });
379
+ } catch (t) {
380
+ console.warn(`Could not create property ${e} for`, this.$el, t);
381
+ }
382
+ }
383
+ get $el() {
384
+ return this.shadowRoot.querySelector(this.ctor.nativeName);
385
+ }
386
+ _updateAttribute(e, t) {
387
+ h(this, e, t);
388
+ }
389
+ _updateBooleanAttribute(e, t) {
390
+ g(this, e, t);
391
+ }
392
+ });
393
+ var u = [
394
+ "",
395
+ "default",
396
+ "auto",
397
+ "flex-start",
398
+ "start",
399
+ "flex-end",
400
+ "end",
401
+ "center",
402
+ "baseline",
403
+ "stretch"
404
+ ], d = [
405
+ "",
406
+ "default",
407
+ "start",
408
+ "end",
409
+ "center",
410
+ "stretch"
411
+ ], f = [
412
+ "",
413
+ "default",
414
+ "start",
415
+ "end",
416
+ "center",
417
+ "stretch"
418
+ ], p = [
419
+ "",
420
+ "1",
421
+ "2",
422
+ "3",
423
+ "4",
424
+ "5",
425
+ "6",
426
+ "7",
427
+ "8",
428
+ "9",
429
+ "10",
430
+ "11",
431
+ "12"
432
+ ], m = [
433
+ "",
434
+ "-1",
435
+ "0",
436
+ "1",
437
+ "2",
438
+ "3",
439
+ "4",
440
+ "5",
441
+ "6",
442
+ "7",
443
+ "8",
444
+ "9",
445
+ "10",
446
+ "11",
447
+ "12"
448
+ ];
449
+ [...[
450
+ "Xs",
451
+ "S",
452
+ "M",
453
+ "L",
454
+ "Xl"
455
+ ].map((e) => e.toLowerCase())];
456
+ function h(e, t, n) {
457
+ if (n == null || n === "") {
458
+ e.removeAttribute(t);
459
+ return;
460
+ }
461
+ e.setAttribute(t, n.toString());
75
462
  }
76
- customElements.get("px-timeline-item") || customElements.define("px-timeline-item", u);
77
- const h = new CSSStyleSheet();
78
- h.replaceSync(v);
79
- var a, r;
80
- class g extends HTMLElement {
81
- constructor() {
82
- super();
83
- d(this, a);
84
- this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [h];
85
- }
86
- template() {
87
- return `
88
- <ol class="timeline" role="list">
89
- <slot></slot>
90
- </ol>
91
- `;
92
- }
93
- static get observedAttributes() {
94
- return ["inverted"];
95
- }
96
- connectedCallback() {
97
- this.addEventListener(p, () => {
98
- this.configureChildren(), o(this, a, r).call(this);
99
- }), this.configureChildren(), o(this, a, r).call(this);
100
- }
101
- attributeChangedCallback(t, i, m) {
102
- if (i !== m)
103
- switch (t) {
104
- case "inverted":
105
- this.isConnected && o(this, a, r).call(this);
106
- break;
107
- }
108
- }
109
- configureChildren() {
110
- const t = this.$children[this.$children.length - 1];
111
- t && !t.hasAttribute("lastchild") && t.setAttribute("lastchild", "");
112
- for (let i = 0; i < this.$children.length; i++)
113
- this.$children[i].setAttribute("item", `${i + 1}`);
114
- }
115
- get $el() {
116
- return this.shadowRoot.querySelector(".timeline");
117
- }
118
- get $children() {
119
- return this.querySelectorAll("px-timeline-item");
120
- }
121
- get inverted() {
122
- return this.getAttribute("inverted");
123
- }
124
- set inverted(t) {
125
- this.setAttribute("inverted", t);
126
- }
463
+ function g(e, t, n) {
464
+ if (!n) {
465
+ e.removeAttribute(t);
466
+ return;
467
+ }
468
+ e.setAttribute(t, "");
127
469
  }
128
- a = new WeakSet(), r = function() {
129
- const t = this.hasAttribute("inverted");
130
- for (let i = 0; i < this.$children.length; i++)
131
- this.$children[i].toggleAttribute("inverted", t);
470
+ //#endregion
471
+ //#region src/timelineitem.css?inline
472
+ var _ = ".timeline-item{gap:var(--px-spacing-default-mobile);font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l);display:flex}.indicator-area{position:relative}.indicator-area:before{content:\"\";width:var(--px-size-border-m);background:var(--px-color-border-main-default);height:calc(100% - 26px);display:block;position:absolute;top:26px;left:12px}.indicator-area .indicator{text-align:center;width:26px;height:26px;font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-m-mobile);color:var(--px-color-text-neutral-default);border-radius:var(--px-radius-pill);background:var(--px-color-background-container-default-default);justify-content:center;align-items:center;display:flex}.content-area{margin-bottom:var(--px-padding-m-mobile);gap:var(--px-spacing-xs-mobile);flex-direction:column;display:flex}.content-area ::slotted([slot=title]){font-weight:var(--px-font-weight-title);font-size:var(--px-text-size-label-l-mobile);color:var(--px-color-text-neutral-default)}.content-area ::slotted([slot=content]){font-weight:var(--px-font-weight-body);font-size:var(--px-text-size-body-m-mobile);color:var(--px-color-text-dimmed-default)}:host([lastchild]) .indicator-area:before{display:none}:host([lastchild]) .content-area{margin-bottom:0}:host([inverted]) .indicator-area:before{background:var(--px-color-border-main-inverted)}:host([inverted]) .indicator{color:var(--px-color-text-neutral-inverted);background:var(--px-color-background-container-default-inverted)}:host([inverted]) .content-area ::slotted([slot=title]){color:var(--px-color-text-neutral-inverted)}:host([inverted]) .content-area ::slotted([slot=content]){color:var(--px-color-text-dimmed-inverted)}@media screen and (width>=48rem){.timeline-item{gap:var(--px-spacing-default-tablet)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-tablet)}.content-area{margin-bottom:var(--px-padding-m-tablet);gap:var(--px-spacing-xs-tablet)}.content-area ::slotted([slot=title]){font-size:var(--px-text-size-label-l-tablet)}.content-area ::slotted([slot=content]){font-size:var(--px-text-size-body-m-tablet)}}@media screen and (width>=64.0625rem){.timeline-item{gap:var(--px-spacing-default-laptop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-laptop)}.content-area{margin-bottom:var(--px-padding-m-laptop)}.content-area ::slotted([slot=title]){font-size:var(--px-text-size-label-l-laptop)}.content-area ::slotted([slot=content]){font-size:var(--px-text-size-body-m-laptop)}}@media screen and (width>=90.0625rem){.timeline-item{gap:var(--px-spacing-default-desktop)}.indicator-area .indicator{font-size:var(--px-text-size-label-m-desktop)}.content-area{margin-bottom:var(--px-padding-m-desktop)}.content-area ::slotted([slot=title]){font-size:var(--px-text-size-label-l-desktop)}.content-area ::slotted([slot=content]){font-size:var(--px-text-size-body-m-desktop)}}", v = new CSSStyleSheet();
473
+ v.replaceSync(_);
474
+ var y = "px-timeline-item-connected", b = "1", x = class extends HTMLElement {
475
+ template() {
476
+ return "\n <li class=\"timeline-item\" role=\"listitem\">\n <div class=\"indicator-area\">\n <div class=\"indicator\"></div>\n </div>\n <div class=\"content-area\">\n <slot name=\"title\"></slot>\n <slot name=\"content\"></slot>\n </div>\n </li>\n ";
477
+ }
478
+ constructor() {
479
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [v];
480
+ }
481
+ connectedCallback() {
482
+ this.dispatchEvent(new CustomEvent(y, {
483
+ bubbles: !0,
484
+ composed: !0
485
+ }));
486
+ }
487
+ static get observedAttributes() {
488
+ return [
489
+ "inverted",
490
+ "lastchild",
491
+ "item"
492
+ ];
493
+ }
494
+ attributeChangedCallback(e, t, n) {
495
+ if (t !== n) switch (e) {
496
+ case "item": this.updateItem(t, n), this.updateIndicator(b);
497
+ }
498
+ }
499
+ updateItem(e, t) {
500
+ e !== null && e !== "" && (b = e), t !== null && t !== "" && (b = t);
501
+ }
502
+ updateIndicator(e) {
503
+ let t = this.$el?.querySelector(".indicator");
504
+ t && (t.innerHTML = e);
505
+ }
506
+ get $el() {
507
+ return this.shadowRoot.querySelector(".timeline-item");
508
+ }
509
+ get inverted() {
510
+ return this.hasAttribute("inverted");
511
+ }
512
+ set inverted(e) {
513
+ g(this, "inverted", e);
514
+ }
515
+ get lastchild() {
516
+ return this.hasAttribute("lastchild");
517
+ }
518
+ set lastchild(e) {
519
+ g(this, "lastchild", e);
520
+ }
521
+ get item() {
522
+ return this.getAttribute("item");
523
+ }
524
+ set item(e) {
525
+ h(this, "item", e);
526
+ }
132
527
  };
133
- customElements.get("px-timeline") || customElements.define("px-timeline", g);
134
- export {
135
- p as TIMELINE_ITEM_CONNECTED_EVENT,
136
- g as Timeline,
137
- u as TimelineItem
528
+ customElements.get("px-timeline-item") || customElements.define("px-timeline-item", x);
529
+ //#endregion
530
+ //#region src/Timeline.ts
531
+ var S = new CSSStyleSheet();
532
+ S.replaceSync(e);
533
+ var C = class extends HTMLElement {
534
+ template() {
535
+ return "\n <ol class=\"timeline\" role=\"list\">\n <slot></slot>\n </ol>\n ";
536
+ }
537
+ constructor() {
538
+ super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template(), this.shadowRoot.adoptedStyleSheets = [S];
539
+ }
540
+ static get observedAttributes() {
541
+ return ["inverted"];
542
+ }
543
+ connectedCallback() {
544
+ this.addEventListener(y, () => {
545
+ this.configureChildren(), this.#e();
546
+ }), this.configureChildren(), this.#e();
547
+ }
548
+ attributeChangedCallback(e, t, n) {
549
+ if (t !== n) switch (e) {
550
+ case "inverted": this.isConnected && this.#e();
551
+ }
552
+ }
553
+ #e() {
554
+ let e = this.hasAttribute("inverted");
555
+ for (let t = 0; t < this.$children.length; t++) this.$children[t].toggleAttribute("inverted", e);
556
+ }
557
+ configureChildren() {
558
+ let e = this.$children[this.$children.length - 1];
559
+ e && !e.hasAttribute("lastchild") && e.setAttribute("lastchild", "");
560
+ for (let e = 0; e < this.$children.length; e++) this.$children[e].setAttribute("item", `${e + 1}`);
561
+ }
562
+ get $el() {
563
+ return this.shadowRoot.querySelector(".timeline");
564
+ }
565
+ get $children() {
566
+ return this.querySelectorAll("px-timeline-item");
567
+ }
568
+ get inverted() {
569
+ return this.hasAttribute("inverted");
570
+ }
571
+ set inverted(e) {
572
+ g(this, "inverted", e);
573
+ }
138
574
  };
575
+ customElements.get("px-timeline") || customElements.define("px-timeline", C);
576
+ //#endregion
577
+ export { y as TIMELINE_ITEM_CONNECTED_EVENT, C as Timeline, x as TimelineItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-timeline",
3
- "version": "1.4.14-beta.2",
3
+ "version": "1.4.15-alpha.2",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",