@proximus/lavender-list 2.0.0-alpha.14 → 2.0.0-alpha.140
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/dist/List.d.ts +4 -0
- package/dist/ListItem.d.ts +2 -0
- package/dist/index.es.js +235 -171
- package/package.json +2 -2
package/dist/List.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { PxElement } from '@proximus/lavender-common';
|
|
2
|
+
export declare const listVariantValues: string[];
|
|
2
3
|
export declare class List extends PxElement<HTMLDivElement> {
|
|
4
|
+
#private;
|
|
3
5
|
static nativeName: string;
|
|
4
6
|
private template;
|
|
5
7
|
constructor();
|
|
@@ -19,4 +21,6 @@ export declare class List extends PxElement<HTMLDivElement> {
|
|
|
19
21
|
set gapLaptop(value: string);
|
|
20
22
|
get gapDesktop(): string;
|
|
21
23
|
set gapDesktop(value: string);
|
|
24
|
+
get variant(): string;
|
|
25
|
+
set variant(value: string);
|
|
22
26
|
}
|
package/dist/ListItem.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { PxElement } from '@proximus/lavender-common';
|
|
2
|
+
export declare const LIST_ITEM_CONNECTED_EVENT = "px-list-item-connected";
|
|
2
3
|
export declare class ListItem extends PxElement<HTMLDivElement> {
|
|
3
4
|
static nativeName: string;
|
|
4
5
|
private template;
|
|
5
6
|
constructor();
|
|
7
|
+
connectedCallback(): void;
|
|
6
8
|
static get observedAttributes(): string[];
|
|
7
9
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
8
10
|
get $children(): NodeListOf<Element>;
|
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var $ = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
|
+
};
|
|
4
|
+
var O = (r, t, e) => t.has(r) || $("Cannot " + e);
|
|
5
|
+
var S = (r, t, e) => t.has(r) ? $("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
|
6
|
+
var p = (r, t, e) => (O(r, t, "access private method"), e);
|
|
7
|
+
const N = ".list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}", _ = ":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%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host([word-break-all]){word-break:break-all}@media screen and (max-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%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}:host([word-break-all--mobile]){word-break:break-all!important}@media screen and (min-width: 48rem) and (max-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%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}:host([word-break-all--tablet]){word-break:break-all!important}@media screen and (min-width: 64.0625rem){:host([shown--sr--laptop]),::slotted(*[shown--sr--laptop]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}@media screen and (min-width: 64.0625rem){: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 (min-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}}", x = { DEV: !0, VITE_COMPONENT_DEBUG: "true" };
|
|
8
|
+
function B(r) {
|
|
9
|
+
const t = document.createElement(r), e = Object.getPrototypeOf(t);
|
|
10
|
+
return Object.getOwnPropertyNames(e);
|
|
5
11
|
}
|
|
6
|
-
function
|
|
7
|
-
const t = document.createElement(
|
|
8
|
-
return Object.getOwnPropertyNames(
|
|
9
|
-
(
|
|
12
|
+
function G(r) {
|
|
13
|
+
const t = document.createElement(r), e = Object.getPrototypeOf(t);
|
|
14
|
+
return Object.getOwnPropertyNames(e).map(
|
|
15
|
+
(s) => s.toLowerCase()
|
|
10
16
|
);
|
|
11
17
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
const C = new CSSStyleSheet();
|
|
19
|
+
C.replaceSync(_);
|
|
20
|
+
const h = typeof import.meta < "u" && typeof x < "u" ? x : void 0, P = (h == null ? void 0 : h.VITE_COMPONENT_DEBUG) === "true" || (h == null ? void 0 : h.DEV) === !0;
|
|
21
|
+
typeof window < "u" && (window.isComponentDebug = k);
|
|
22
|
+
function k() {
|
|
23
|
+
return P;
|
|
24
|
+
}
|
|
25
|
+
function T(r) {
|
|
26
|
+
k() && console.error(r);
|
|
27
|
+
}
|
|
28
|
+
typeof window < "u" && (window.isComponentDebug = k);
|
|
29
|
+
class v extends HTMLElement {
|
|
15
30
|
static get observedAttributes() {
|
|
16
31
|
return [
|
|
17
32
|
"grow",
|
|
@@ -58,18 +73,25 @@ class b extends HTMLElement {
|
|
|
58
73
|
"order--mobile",
|
|
59
74
|
"order--tablet",
|
|
60
75
|
"order--laptop",
|
|
61
|
-
"order--desktop"
|
|
76
|
+
"order--desktop",
|
|
77
|
+
"sticky-top",
|
|
78
|
+
"sticky-bottom",
|
|
79
|
+
"word-break-all",
|
|
80
|
+
"word-break-all--mobile",
|
|
81
|
+
"word-break-all--tablet",
|
|
82
|
+
"word-break-all--laptop",
|
|
83
|
+
"word-break-all--desktop"
|
|
62
84
|
];
|
|
63
85
|
}
|
|
64
86
|
constructor(...t) {
|
|
65
87
|
super(), this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [
|
|
66
|
-
|
|
88
|
+
C,
|
|
67
89
|
...t
|
|
68
90
|
];
|
|
69
91
|
}
|
|
70
|
-
attributeChangedCallback(t,
|
|
92
|
+
attributeChangedCallback(t, e, s) {
|
|
71
93
|
var i;
|
|
72
|
-
if (
|
|
94
|
+
if (v.observedAttributes.indexOf(t) !== -1)
|
|
73
95
|
switch (t) {
|
|
74
96
|
case "grow":
|
|
75
97
|
case "grow--mobile":
|
|
@@ -86,7 +108,7 @@ class b extends HTMLElement {
|
|
|
86
108
|
case "basis--tablet":
|
|
87
109
|
case "basis--laptop":
|
|
88
110
|
case "basis--desktop":
|
|
89
|
-
this.style.setProperty(`--${t}-value`,
|
|
111
|
+
this.style.setProperty(`--${t}-value`, s);
|
|
90
112
|
break;
|
|
91
113
|
case "align-self":
|
|
92
114
|
case "align-self--mobile":
|
|
@@ -95,9 +117,9 @@ class b extends HTMLElement {
|
|
|
95
117
|
case "align-self--desktop":
|
|
96
118
|
this.updateProperties(
|
|
97
119
|
t,
|
|
98
|
-
s,
|
|
99
120
|
e,
|
|
100
|
-
|
|
121
|
+
s,
|
|
122
|
+
((i = this.parentElement) == null ? void 0 : i.localName) === "px-grid" ? q : R
|
|
101
123
|
);
|
|
102
124
|
break;
|
|
103
125
|
case "justify-self":
|
|
@@ -107,9 +129,9 @@ class b extends HTMLElement {
|
|
|
107
129
|
case "justify-self--desktop":
|
|
108
130
|
this.updateProperties(
|
|
109
131
|
t,
|
|
110
|
-
s,
|
|
111
132
|
e,
|
|
112
|
-
|
|
133
|
+
s,
|
|
134
|
+
H
|
|
113
135
|
);
|
|
114
136
|
break;
|
|
115
137
|
case "col-span":
|
|
@@ -117,50 +139,49 @@ class b extends HTMLElement {
|
|
|
117
139
|
case "col-span--tablet":
|
|
118
140
|
case "col-span--laptop":
|
|
119
141
|
case "col-span--desktop":
|
|
120
|
-
this.updateProperties(t,
|
|
142
|
+
this.updateProperties(t, e, s, U);
|
|
121
143
|
break;
|
|
122
144
|
case "order":
|
|
123
145
|
case "order--mobile":
|
|
124
146
|
case "order--tablet":
|
|
125
147
|
case "order--laptop":
|
|
126
148
|
case "order--desktop":
|
|
127
|
-
this.updateProperties(t,
|
|
149
|
+
this.updateProperties(t, e, s, X);
|
|
128
150
|
break;
|
|
129
151
|
}
|
|
130
152
|
}
|
|
131
|
-
updateProperties(t,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (!a)
|
|
153
|
+
updateProperties(t, e, s, i) {
|
|
154
|
+
i && (this.checkName(i, s) || T(
|
|
155
|
+
`"${s}" is not an allowed ${t} value for ${this.tagName.toLowerCase()}. Allowed values are: "${i.join('", "')}".`
|
|
156
|
+
));
|
|
157
|
+
const l = t.indexOf("--") > -1, n = l ? t.split("--")[0] : t;
|
|
158
|
+
if (!l)
|
|
138
159
|
this.style.setProperty(
|
|
139
|
-
`--${
|
|
140
|
-
s
|
|
141
|
-
), this.style.setProperty(
|
|
142
|
-
`--${l}-value`,
|
|
160
|
+
`--${n}-value`,
|
|
143
161
|
e
|
|
162
|
+
), this.style.setProperty(
|
|
163
|
+
`--${n}-value`,
|
|
164
|
+
s
|
|
144
165
|
);
|
|
145
166
|
else {
|
|
146
|
-
const
|
|
167
|
+
const d = t.split("--")[1];
|
|
147
168
|
this.style.setProperty(
|
|
148
|
-
`--${
|
|
149
|
-
s
|
|
150
|
-
), this.style.setProperty(
|
|
151
|
-
`--${l}--${n}-value`,
|
|
169
|
+
`--${n}--${d}-value`,
|
|
152
170
|
e
|
|
171
|
+
), this.style.setProperty(
|
|
172
|
+
`--${n}--${d}-value`,
|
|
173
|
+
s
|
|
153
174
|
);
|
|
154
175
|
}
|
|
155
176
|
}
|
|
156
|
-
updateStyle(t,
|
|
157
|
-
|
|
158
|
-
`--${t}--${
|
|
159
|
-
|
|
177
|
+
updateStyle(t, e, s) {
|
|
178
|
+
s !== null && s !== "" && s !== "default" && this.style.setProperty(
|
|
179
|
+
`--${t}--${e}-value`,
|
|
180
|
+
s
|
|
160
181
|
);
|
|
161
182
|
}
|
|
162
|
-
checkName(t,
|
|
163
|
-
return t.includes(
|
|
183
|
+
checkName(t, e) {
|
|
184
|
+
return t.includes(e);
|
|
164
185
|
}
|
|
165
186
|
get $el() {
|
|
166
187
|
return this;
|
|
@@ -417,78 +438,80 @@ class b extends HTMLElement {
|
|
|
417
438
|
this.setAttribute("order--desktop", t);
|
|
418
439
|
}
|
|
419
440
|
}
|
|
420
|
-
const
|
|
441
|
+
const A = class A extends v {
|
|
421
442
|
// nativeName: string;
|
|
422
443
|
static get observedAttributes() {
|
|
423
444
|
return [
|
|
424
445
|
...super.observedAttributes,
|
|
425
|
-
...
|
|
446
|
+
...G(this.nativeName)
|
|
426
447
|
];
|
|
427
448
|
}
|
|
428
|
-
attributeChangedCallback(t,
|
|
429
|
-
super.attributeChangedCallback(t,
|
|
449
|
+
attributeChangedCallback(t, e, s) {
|
|
450
|
+
super.attributeChangedCallback(t, e, s), s === null ? this.$el.toggleAttribute(t) : this.$el.setAttribute(t, s);
|
|
430
451
|
}
|
|
431
452
|
get ctor() {
|
|
432
453
|
return Object.getPrototypeOf(this).constructor;
|
|
433
454
|
}
|
|
434
455
|
constructor(...t) {
|
|
435
|
-
super(...t), this.ctor.supportedPropertyNames || (this.ctor.supportedPropertyNames =
|
|
456
|
+
super(...t), this.ctor.supportedPropertyNames || (this.ctor.supportedPropertyNames = B(
|
|
436
457
|
this.ctor.nativeName
|
|
437
458
|
)), this.enhanceWithNativeProperties();
|
|
438
459
|
}
|
|
439
460
|
enhanceWithNativeProperties() {
|
|
440
461
|
var t;
|
|
441
|
-
for (const
|
|
442
|
-
if (!(
|
|
462
|
+
for (const e of this.ctor.supportedPropertyNames)
|
|
463
|
+
if (!(e === "constructor" || (((t = this.ctor) == null ? void 0 : t.accessorExclusions) ?? []).includes(e)))
|
|
443
464
|
try {
|
|
444
|
-
Object.defineProperty(this,
|
|
465
|
+
Object.defineProperty(this, e, {
|
|
445
466
|
get() {
|
|
446
|
-
return this.$el[
|
|
467
|
+
return this.$el[e];
|
|
447
468
|
},
|
|
448
|
-
set(
|
|
449
|
-
this.$el[
|
|
469
|
+
set(s) {
|
|
470
|
+
this.$el[e] !== s && (this.$el[e] = s);
|
|
450
471
|
}
|
|
451
472
|
});
|
|
452
|
-
} catch (
|
|
453
|
-
console.warn(`Could not create property ${
|
|
473
|
+
} catch (s) {
|
|
474
|
+
console.warn(`Could not create property ${e} for`, this.$el, s);
|
|
454
475
|
}
|
|
455
476
|
}
|
|
456
477
|
get $el() {
|
|
457
478
|
return this.shadowRoot.querySelector(this.ctor.nativeName);
|
|
458
479
|
}
|
|
459
|
-
_updateAttribute(t,
|
|
460
|
-
|
|
480
|
+
_updateAttribute(t, e) {
|
|
481
|
+
e ? this.setAttribute(t, e) : this.removeAttribute(t);
|
|
461
482
|
}
|
|
462
|
-
_updateBooleanAttribute(t,
|
|
463
|
-
|
|
483
|
+
_updateBooleanAttribute(t, e) {
|
|
484
|
+
e ? this.setAttribute(t, "") : this.removeAttribute(t);
|
|
464
485
|
}
|
|
465
486
|
};
|
|
466
|
-
|
|
467
|
-
let
|
|
468
|
-
const
|
|
487
|
+
A.accessorExclusions = [];
|
|
488
|
+
let b = A;
|
|
489
|
+
const R = [
|
|
469
490
|
"",
|
|
470
491
|
"default",
|
|
471
492
|
"auto",
|
|
472
493
|
"flex-start",
|
|
494
|
+
"start",
|
|
473
495
|
"flex-end",
|
|
496
|
+
"end",
|
|
474
497
|
"center",
|
|
475
498
|
"baseline",
|
|
476
499
|
"stretch"
|
|
477
|
-
],
|
|
500
|
+
], q = [
|
|
478
501
|
"",
|
|
479
502
|
"default",
|
|
480
503
|
"start",
|
|
481
504
|
"end",
|
|
482
505
|
"center",
|
|
483
506
|
"stretch"
|
|
484
|
-
],
|
|
507
|
+
], H = [
|
|
485
508
|
"",
|
|
486
509
|
"default",
|
|
487
510
|
"start",
|
|
488
511
|
"end",
|
|
489
512
|
"center",
|
|
490
513
|
"stretch"
|
|
491
|
-
],
|
|
514
|
+
], U = [
|
|
492
515
|
"",
|
|
493
516
|
"1",
|
|
494
517
|
"2",
|
|
@@ -502,7 +525,7 @@ const $ = [
|
|
|
502
525
|
"10",
|
|
503
526
|
"11",
|
|
504
527
|
"12"
|
|
505
|
-
],
|
|
528
|
+
], X = [
|
|
506
529
|
"",
|
|
507
530
|
"-1",
|
|
508
531
|
"0",
|
|
@@ -518,11 +541,11 @@ const $ = [
|
|
|
518
541
|
"10",
|
|
519
542
|
"11",
|
|
520
543
|
"12"
|
|
521
|
-
],
|
|
544
|
+
], z = ["Xs", "S", "M", "L", "Xl"];
|
|
522
545
|
[
|
|
523
|
-
...
|
|
546
|
+
...z.map((r) => r.toLowerCase())
|
|
524
547
|
];
|
|
525
|
-
const
|
|
548
|
+
const W = [
|
|
526
549
|
"none",
|
|
527
550
|
"2xs",
|
|
528
551
|
"xs",
|
|
@@ -533,89 +556,90 @@ const L = [
|
|
|
533
556
|
"heading-to-content",
|
|
534
557
|
"page-layout-between-sections"
|
|
535
558
|
];
|
|
536
|
-
function
|
|
537
|
-
const
|
|
538
|
-
(
|
|
539
|
-
${t(
|
|
540
|
-
${
|
|
541
|
-
${`${i}:var(--${
|
|
559
|
+
function I(r, t, e, s = "", i, l = r) {
|
|
560
|
+
const n = new CSSStyleSheet(), d = e.reduce(
|
|
561
|
+
(E, o) => E + `
|
|
562
|
+
${t(l, o)} {
|
|
563
|
+
${r}: var(--${s}-${o}-desktop);
|
|
564
|
+
${`${i}:var(--${s}-${o}-desktop)`}
|
|
542
565
|
}
|
|
543
566
|
/* Mobile only - max 767px */
|
|
544
|
-
@media only screen and (max-width: 47.
|
|
545
|
-
${t(
|
|
546
|
-
${
|
|
547
|
-
${`${i}: var(--${
|
|
567
|
+
@media only screen and (max-width: 47.938rem) {
|
|
568
|
+
${t(l, o)} {
|
|
569
|
+
${r}: var(--${s}-${o}-mobile);
|
|
570
|
+
${`${i}: var(--${s}-${o}-mobile)`}
|
|
548
571
|
}
|
|
549
572
|
}
|
|
550
|
-
${t(
|
|
573
|
+
${t(l, o, "mobile")} {
|
|
551
574
|
/* Mobile only - max 767px */
|
|
552
|
-
@media only screen and (max-width: 47.
|
|
553
|
-
${
|
|
554
|
-
${`${i}: var(--${
|
|
575
|
+
@media only screen and (max-width: 47.938rem) {
|
|
576
|
+
${r}: var(--${s}-${o}-mobile) !important;
|
|
577
|
+
${`${i}: var(--${s}-${o}-mobile)`}
|
|
555
578
|
}
|
|
556
579
|
}
|
|
557
|
-
${t(
|
|
580
|
+
${t(l, o, "tablet")} {
|
|
558
581
|
/* Tablet - min 768px max 1024px */
|
|
559
|
-
@media only screen and (min-width:
|
|
560
|
-
${
|
|
561
|
-
${`${i}: var(--${
|
|
582
|
+
@media only screen and (min-width: 48rem) and (max-width: 64rem) {
|
|
583
|
+
${r}: var(--${s}-${o}-desktop) !important;
|
|
584
|
+
${`${i}: var(--${s}-${o}-desktop)`}
|
|
562
585
|
}
|
|
563
586
|
}
|
|
564
|
-
${t(
|
|
587
|
+
${t(l, o, "laptop")} {
|
|
565
588
|
/* Laptop - 1025px*/
|
|
566
|
-
@media only screen and (min-width: 64.
|
|
567
|
-
${
|
|
568
|
-
${`${i}: var(--${
|
|
589
|
+
@media only screen and (min-width: 64.0625rem) {
|
|
590
|
+
${r}: var(--${s}-${o}-desktop) !important;
|
|
591
|
+
${`${i}: var(--${s}-${o}-desktop)`}
|
|
569
592
|
}
|
|
570
593
|
}
|
|
571
|
-
${t(
|
|
594
|
+
${t(l, o, "desktop")} {
|
|
572
595
|
/* Desktop - 1025px*/
|
|
573
|
-
@media only screen and (min-width: 64.
|
|
574
|
-
${
|
|
575
|
-
${`${i}: var(--${
|
|
596
|
+
@media only screen and (min-width: 64.0625rem) {
|
|
597
|
+
${r}: var(--${s}-${o}-desktop) !important;
|
|
598
|
+
${`${i}: var(--${s}-${o}-desktop)`}
|
|
576
599
|
}
|
|
577
600
|
}`,
|
|
578
601
|
""
|
|
579
602
|
);
|
|
580
|
-
return
|
|
603
|
+
return n.replaceSync(d), n;
|
|
581
604
|
}
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
"gap",
|
|
586
|
-
C,
|
|
587
|
-
L,
|
|
588
|
-
O,
|
|
589
|
-
"--list-gap"
|
|
590
|
-
), g = class g extends p {
|
|
605
|
+
const J = '.list-item{display:flex;gap:var(--px-spacing-xs-mobile);align-items:flex-start;font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l);color:var(--px-color-text-neutral-default)}.list-item[inverted]{color:var(--px-color-text-neutral-inverted)}:host([variant="ul"]) .list-item,:host([variant="ol"]) .list-item{display:list-item;margin-left:var(--px-spacing-default-mobile)}:host([variant="ul"]) .list-item{list-style-type:disc}:host([variant="ol"]) .list-item{counter-set:list-item var(--item-index, 0);list-style-type:decimal}@media screen and (min-width: 48rem){.list-item{gap:var(--px-spacing-xs-tablet)}}@media screen and (min-width: 64.0625rem){.list-item{gap:var(--px-spacing-xs-laptop)}}@media screen and (min-width: 90.0625rem){.list-item{gap:var(--px-spacing-xs-desktop)}}', D = new CSSStyleSheet();
|
|
606
|
+
D.replaceSync(J);
|
|
607
|
+
const M = "px-list-item-connected", w = class w extends b {
|
|
591
608
|
template() {
|
|
592
609
|
return `
|
|
593
|
-
<div class="list" role="
|
|
594
|
-
<slot></slot>
|
|
610
|
+
<div class="list-item" role="listitem">
|
|
611
|
+
<slot name="icon"></slot>
|
|
612
|
+
<slot name="label"></slot>
|
|
595
613
|
</div>
|
|
596
614
|
`;
|
|
597
615
|
}
|
|
598
616
|
constructor() {
|
|
599
|
-
super(
|
|
617
|
+
super(D), this.shadowRoot.innerHTML = this.template();
|
|
618
|
+
}
|
|
619
|
+
connectedCallback() {
|
|
620
|
+
this.dispatchEvent(
|
|
621
|
+
new CustomEvent(M, {
|
|
622
|
+
bubbles: !0,
|
|
623
|
+
composed: !0
|
|
624
|
+
})
|
|
625
|
+
);
|
|
600
626
|
}
|
|
601
627
|
static get observedAttributes() {
|
|
602
628
|
return ["inverted"];
|
|
603
629
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
attributeChangedCallback(t, s, e) {
|
|
608
|
-
if (s !== e)
|
|
630
|
+
// TODO: factorize code
|
|
631
|
+
attributeChangedCallback(t, e, s) {
|
|
632
|
+
if (e !== s)
|
|
609
633
|
switch (t) {
|
|
610
634
|
case "inverted":
|
|
611
635
|
for (let i = 0; i < this.$children.length; i++)
|
|
612
636
|
this.$children[i].hasAttribute("inverted") || this.$children[i].toggleAttribute("inverted");
|
|
613
|
-
this.$el.toggleAttribute("inverted",
|
|
637
|
+
this.$el.toggleAttribute("inverted", s !== null);
|
|
614
638
|
break;
|
|
615
639
|
}
|
|
616
640
|
}
|
|
617
641
|
get $children() {
|
|
618
|
-
return this.querySelectorAll("px-list-item");
|
|
642
|
+
return this.querySelectorAll("px-list-item > *");
|
|
619
643
|
}
|
|
620
644
|
get inverted() {
|
|
621
645
|
return this.hasAttribute("inverted");
|
|
@@ -623,82 +647,122 @@ const C = (o, t, s) => `:host([${o}${s ? `--${s}` : ""}='${t}']) .list`, O = "px
|
|
|
623
647
|
set inverted(t) {
|
|
624
648
|
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
625
649
|
}
|
|
650
|
+
};
|
|
651
|
+
w.nativeName = "div";
|
|
652
|
+
let u = w;
|
|
653
|
+
customElements.get("px-list-item") || customElements.define("px-list-item", u);
|
|
654
|
+
const L = new CSSStyleSheet();
|
|
655
|
+
L.replaceSync(N);
|
|
656
|
+
const j = ["", "ul", "ol"], F = (r, t, e) => `:host([${r}${e ? `--${e}` : ""}='${t}']) .list`, K = "px-spacing", Q = I(
|
|
657
|
+
"gap",
|
|
658
|
+
F,
|
|
659
|
+
W,
|
|
660
|
+
K,
|
|
661
|
+
"--list-gap"
|
|
662
|
+
);
|
|
663
|
+
var a, g, f, m;
|
|
664
|
+
const y = class y extends b {
|
|
665
|
+
constructor() {
|
|
666
|
+
super(L, Q);
|
|
667
|
+
S(this, a);
|
|
668
|
+
this.shadowRoot.innerHTML = this.template();
|
|
669
|
+
}
|
|
670
|
+
template() {
|
|
671
|
+
return `
|
|
672
|
+
<div class="list" role="list">
|
|
673
|
+
<slot></slot>
|
|
674
|
+
</div>
|
|
675
|
+
`;
|
|
676
|
+
}
|
|
677
|
+
static get observedAttributes() {
|
|
678
|
+
return ["inverted", "variant"];
|
|
679
|
+
}
|
|
680
|
+
connectedCallback() {
|
|
681
|
+
this.gap || (this.gap = "xs"), this.addEventListener(M, () => {
|
|
682
|
+
p(this, a, g).call(this);
|
|
683
|
+
}), p(this, a, g).call(this);
|
|
684
|
+
}
|
|
685
|
+
attributeChangedCallback(e, s, i) {
|
|
686
|
+
if (s !== i)
|
|
687
|
+
switch (e) {
|
|
688
|
+
case "inverted":
|
|
689
|
+
this.isConnected && p(this, a, f).call(this);
|
|
690
|
+
break;
|
|
691
|
+
case "variant":
|
|
692
|
+
this.checkName(j, i) || T(
|
|
693
|
+
`"${i}" is not a valid variant value for ${this.tagName.toLowerCase()}. Allowed values are: "${j.join('", "')}".`
|
|
694
|
+
), this.isConnected && p(this, a, m).call(this, i), super.attributeChangedCallback(e, s, i);
|
|
695
|
+
break;
|
|
696
|
+
default:
|
|
697
|
+
super.attributeChangedCallback(e, s, i);
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
get $children() {
|
|
702
|
+
return this.querySelectorAll("px-list-item");
|
|
703
|
+
}
|
|
704
|
+
get inverted() {
|
|
705
|
+
return this.hasAttribute("inverted");
|
|
706
|
+
}
|
|
707
|
+
set inverted(e) {
|
|
708
|
+
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
709
|
+
}
|
|
626
710
|
get gap() {
|
|
627
711
|
return this.getAttribute("gap");
|
|
628
712
|
}
|
|
629
|
-
set gap(
|
|
630
|
-
|
|
713
|
+
set gap(e) {
|
|
714
|
+
e ? this.setAttribute("gap", e) : this.removeAttribute("gap");
|
|
631
715
|
}
|
|
632
716
|
get gapMobile() {
|
|
633
717
|
return this.getAttribute("gap--mobile");
|
|
634
718
|
}
|
|
635
|
-
set gapMobile(
|
|
636
|
-
|
|
719
|
+
set gapMobile(e) {
|
|
720
|
+
e ? this.setAttribute("gap--mobile", e) : this.removeAttribute("gap--mobile");
|
|
637
721
|
}
|
|
638
722
|
get gapTablet() {
|
|
639
723
|
return this.getAttribute("gap--tablet");
|
|
640
724
|
}
|
|
641
|
-
set gapTablet(
|
|
642
|
-
|
|
725
|
+
set gapTablet(e) {
|
|
726
|
+
e ? this.setAttribute("gap--tablet", e) : this.removeAttribute("gap--tablet");
|
|
643
727
|
}
|
|
644
728
|
get gapLaptop() {
|
|
645
729
|
return this.getAttribute("gap--laptop");
|
|
646
730
|
}
|
|
647
|
-
set gapLaptop(
|
|
648
|
-
|
|
731
|
+
set gapLaptop(e) {
|
|
732
|
+
e ? this.setAttribute("gap--laptop", e) : this.removeAttribute("gap--laptop");
|
|
649
733
|
}
|
|
650
734
|
get gapDesktop() {
|
|
651
735
|
return this.getAttribute("gap--desktop");
|
|
652
736
|
}
|
|
653
|
-
set gapDesktop(
|
|
654
|
-
|
|
737
|
+
set gapDesktop(e) {
|
|
738
|
+
e ? this.setAttribute("gap--desktop", e) : this.removeAttribute("gap--desktop");
|
|
655
739
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
let h = g;
|
|
659
|
-
customElements.get("px-list") || customElements.define("px-list", h);
|
|
660
|
-
const N = '.list-item{display:flex;gap:var(--px-spacing-xs-mobile);align-items:flex-start;font-family:var(--px-font-family);line-height:var(--px-line-height-ratio-l)}::slotted([slot="label"][inverted]){color:var(--px-color-text-neutral-inverted)}@media only screen and (min-width: 48em){.list-item{gap:var(--px-spacing-xs-tablet)}}@media only screen and (min-width: 64.0625em){.list-item{gap:var(--px-spacing-xs-laptop)}}@media only screen and (min-width: 90.0625em){.list-item{gap:var(--px-spacing-xs-desktop)}}', k = new CSSStyleSheet();
|
|
661
|
-
k.replaceSync(N);
|
|
662
|
-
const c = class c extends p {
|
|
663
|
-
template() {
|
|
664
|
-
return `
|
|
665
|
-
<div class="list-item" role="listitem">
|
|
666
|
-
<slot name="icon"></slot>
|
|
667
|
-
<slot name="label"></slot>
|
|
668
|
-
</div>
|
|
669
|
-
`;
|
|
670
|
-
}
|
|
671
|
-
constructor() {
|
|
672
|
-
super(k), this.shadowRoot.innerHTML = this.template();
|
|
673
|
-
}
|
|
674
|
-
static get observedAttributes() {
|
|
675
|
-
return ["inverted"];
|
|
676
|
-
}
|
|
677
|
-
// TODO: factorize code
|
|
678
|
-
attributeChangedCallback(t, s, e) {
|
|
679
|
-
if (s !== e)
|
|
680
|
-
switch (t) {
|
|
681
|
-
case "inverted":
|
|
682
|
-
for (let i = 0; i < this.$children.length; i++)
|
|
683
|
-
this.$children[i].hasAttribute("inverted") || this.$children[i].toggleAttribute("inverted");
|
|
684
|
-
this.$el.toggleAttribute("inverted", e !== null);
|
|
685
|
-
break;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
get $children() {
|
|
689
|
-
return this.querySelectorAll("px-list-item > *");
|
|
740
|
+
get variant() {
|
|
741
|
+
return this.getAttribute("variant");
|
|
690
742
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
}
|
|
694
|
-
set inverted(t) {
|
|
695
|
-
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
743
|
+
set variant(e) {
|
|
744
|
+
e ? this.setAttribute("variant", e) : this.removeAttribute("variant");
|
|
696
745
|
}
|
|
697
746
|
};
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
747
|
+
a = new WeakSet(), g = function() {
|
|
748
|
+
p(this, a, f).call(this), p(this, a, m).call(this, this.getAttribute("variant"));
|
|
749
|
+
}, f = function() {
|
|
750
|
+
var s;
|
|
751
|
+
const e = this.hasAttribute("inverted");
|
|
752
|
+
for (let i = 0; i < this.$children.length; i++)
|
|
753
|
+
this.$children[i].toggleAttribute("inverted", e);
|
|
754
|
+
(s = this.$el) == null || s.toggleAttribute("inverted", e);
|
|
755
|
+
}, m = function(e) {
|
|
756
|
+
for (let s = 0; s < this.$children.length; s++) {
|
|
757
|
+
const i = this.$children[s];
|
|
758
|
+
e !== null ? (i.setAttribute("variant", e), e === "ol" ? i.style.setProperty("--item-index", String(s + 1)) : i.style.removeProperty("--item-index")) : (i.removeAttribute("variant"), i.style.removeProperty("--item-index"));
|
|
759
|
+
}
|
|
760
|
+
}, y.nativeName = "div";
|
|
761
|
+
let c = y;
|
|
762
|
+
customElements.get("px-list") || customElements.define("px-list", c);
|
|
701
763
|
export {
|
|
702
|
-
|
|
703
|
-
|
|
764
|
+
M as LIST_ITEM_CONNECTED_EVENT,
|
|
765
|
+
c as List,
|
|
766
|
+
u as ListItem,
|
|
767
|
+
j as listVariantValues
|
|
704
768
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-list",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.140",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.es.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
|
|
15
15
|
"test": "vitest run --coverage",
|
|
16
|
-
"wc-manifest": "cem analyze --globs \"src/*\" --config
|
|
16
|
+
"wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
|
|
17
17
|
},
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|