@proximus/lavender-list 1.0.0-alpha.1
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 +24 -0
- package/dist/ListItem.d.ts +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +786 -0
- package/package.json +24 -0
package/dist/List.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PxElement, AttributeBreakpointHandlerDelegate } from '@proximus/lavender-common';
|
|
2
|
+
export declare const breakpointsValues: string[];
|
|
3
|
+
export declare class List extends PxElement<HTMLDivElement> {
|
|
4
|
+
static nativeName: string;
|
|
5
|
+
private template;
|
|
6
|
+
AttributeDelegate: AttributeBreakpointHandlerDelegate;
|
|
7
|
+
constructor();
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
11
|
+
get $children(): NodeListOf<Element>;
|
|
12
|
+
get inverted(): boolean;
|
|
13
|
+
set inverted(value: boolean);
|
|
14
|
+
get gap(): string;
|
|
15
|
+
set gap(value: string);
|
|
16
|
+
get gapMobile(): string;
|
|
17
|
+
set gapMobile(value: string);
|
|
18
|
+
get gapTablet(): string;
|
|
19
|
+
set gapTablet(value: string);
|
|
20
|
+
get gapLaptop(): string;
|
|
21
|
+
set gapLaptop(value: string);
|
|
22
|
+
get gapDesktop(): string;
|
|
23
|
+
set gapDesktop(value: string);
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PxElement } from '@proximus/lavender-common';
|
|
2
|
+
export declare class ListItem extends PxElement<HTMLDivElement> {
|
|
3
|
+
static nativeName: string;
|
|
4
|
+
private template;
|
|
5
|
+
constructor();
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
8
|
+
get $children(): NodeListOf<Element>;
|
|
9
|
+
get inverted(): boolean;
|
|
10
|
+
set inverted(value: boolean);
|
|
11
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,786 @@
|
|
|
1
|
+
const v = ".list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}", A = ":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-value)}:host([order]),::slotted([order]){order:var(--order-value)}:host([hidden]),::slotted([hidden]){display:none}::slotted(*[shown--sr]){clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media screen and (max-width: 767px){: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}::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}}@media screen and (min-width: 768px) and (max-width: 1024px){: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}::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}}@media screen and (min-width: 1025px){::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: 1025px) and (max-width: 1440px){: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}}@media screen and (min-width: 1441px){: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}}";
|
|
2
|
+
function g(a) {
|
|
3
|
+
const t = document.createElement(a), s = Object.getPrototypeOf(t);
|
|
4
|
+
return Object.getOwnPropertyNames(s);
|
|
5
|
+
}
|
|
6
|
+
const c = new CSSStyleSheet();
|
|
7
|
+
c.replaceSync(A);
|
|
8
|
+
class b extends HTMLElement {
|
|
9
|
+
static get observedAttributes() {
|
|
10
|
+
return [
|
|
11
|
+
"grow",
|
|
12
|
+
"grow--mobile",
|
|
13
|
+
"grow--tablet",
|
|
14
|
+
"grow--laptop",
|
|
15
|
+
"grow--desktop",
|
|
16
|
+
"shrink",
|
|
17
|
+
"shrink--mobile",
|
|
18
|
+
"shrink--tablet",
|
|
19
|
+
"shrink--laptop",
|
|
20
|
+
"shrink--desktop",
|
|
21
|
+
"basis",
|
|
22
|
+
"basis--mobile",
|
|
23
|
+
"basis--tablet",
|
|
24
|
+
"basis--laptop",
|
|
25
|
+
"basis--desktop",
|
|
26
|
+
"align-self",
|
|
27
|
+
"align-self--mobile",
|
|
28
|
+
"align-self--tablet",
|
|
29
|
+
"align-self--laptop",
|
|
30
|
+
"align-self--desktop",
|
|
31
|
+
"justify-self",
|
|
32
|
+
"justify-self--mobile",
|
|
33
|
+
"justify-self--tablet",
|
|
34
|
+
"justify-self--laptop",
|
|
35
|
+
"justify-self--desktop",
|
|
36
|
+
"hidden",
|
|
37
|
+
"hidden--mobile",
|
|
38
|
+
"hidden--tablet",
|
|
39
|
+
"hidden--laptop",
|
|
40
|
+
"hidden--desktop",
|
|
41
|
+
"shown--sr",
|
|
42
|
+
"shown--sr--mobile",
|
|
43
|
+
"shown--sr--tablet",
|
|
44
|
+
"shown--sr--laptop",
|
|
45
|
+
"shown--sr--desktop",
|
|
46
|
+
"col-span",
|
|
47
|
+
"col-span--mobile",
|
|
48
|
+
"col-span--tablet",
|
|
49
|
+
"col-span--laptop",
|
|
50
|
+
"col-span--desktop",
|
|
51
|
+
"order",
|
|
52
|
+
"order--mobile",
|
|
53
|
+
"order--tablet",
|
|
54
|
+
"order--laptop",
|
|
55
|
+
"order--desktop"
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
constructor(...t) {
|
|
59
|
+
super(), this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.adoptedStyleSheets = [
|
|
60
|
+
c,
|
|
61
|
+
...t
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
attributeChangedCallback(t, s, e) {
|
|
65
|
+
if (b.observedAttributes.indexOf(t) !== -1)
|
|
66
|
+
switch (t) {
|
|
67
|
+
case "grow":
|
|
68
|
+
case "grow--mobile":
|
|
69
|
+
case "grow--tablet":
|
|
70
|
+
case "grow--laptop":
|
|
71
|
+
case "grow--desktop":
|
|
72
|
+
case "shrink":
|
|
73
|
+
case "shrink--mobile":
|
|
74
|
+
case "shrink--tablet":
|
|
75
|
+
case "shrink--laptop":
|
|
76
|
+
case "shrink--desktop":
|
|
77
|
+
case "basis":
|
|
78
|
+
case "basis--mobile":
|
|
79
|
+
case "basis--tablet":
|
|
80
|
+
case "basis--laptop":
|
|
81
|
+
case "basis--desktop":
|
|
82
|
+
this.style.setProperty(`--${t}-value`, e);
|
|
83
|
+
break;
|
|
84
|
+
case "align-self":
|
|
85
|
+
case "align-self--mobile":
|
|
86
|
+
case "align-self--tablet":
|
|
87
|
+
case "align-self--laptop":
|
|
88
|
+
case "align-self--desktop":
|
|
89
|
+
this.updateProperties(
|
|
90
|
+
t,
|
|
91
|
+
s,
|
|
92
|
+
e,
|
|
93
|
+
this.isGrid ? S : y
|
|
94
|
+
);
|
|
95
|
+
break;
|
|
96
|
+
case "justify-self":
|
|
97
|
+
case "justify-self--mobile":
|
|
98
|
+
case "justify-self--tablet":
|
|
99
|
+
case "justify-self--laptop":
|
|
100
|
+
case "justify-self--desktop":
|
|
101
|
+
this.updateProperties(
|
|
102
|
+
t,
|
|
103
|
+
s,
|
|
104
|
+
e,
|
|
105
|
+
$
|
|
106
|
+
);
|
|
107
|
+
break;
|
|
108
|
+
case "col-span":
|
|
109
|
+
case "col-span--mobile":
|
|
110
|
+
case "col-span--tablet":
|
|
111
|
+
case "col-span--laptop":
|
|
112
|
+
case "col-span--desktop":
|
|
113
|
+
this.updateProperties(t, s, e, w);
|
|
114
|
+
break;
|
|
115
|
+
case "order":
|
|
116
|
+
case "order--mobile":
|
|
117
|
+
case "order--tablet":
|
|
118
|
+
case "order--laptop":
|
|
119
|
+
case "order--desktop":
|
|
120
|
+
this.updateProperties(t, s, e, x);
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
updateProperties(t, s, e, i) {
|
|
125
|
+
if (i && !this.checkName(i, e)) {
|
|
126
|
+
console.error(`${e} is not a valid value for ${i}`);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const o = t.indexOf("--") > -1, l = o ? t.split("--")[0] : t;
|
|
130
|
+
if (!o)
|
|
131
|
+
this.style.setProperty(
|
|
132
|
+
`--${l}-value`,
|
|
133
|
+
s
|
|
134
|
+
), this.style.setProperty(
|
|
135
|
+
`--${l}-value`,
|
|
136
|
+
e
|
|
137
|
+
);
|
|
138
|
+
else {
|
|
139
|
+
const n = t.split("--")[1];
|
|
140
|
+
this.style.setProperty(
|
|
141
|
+
`--${l}--${n}-value`,
|
|
142
|
+
s
|
|
143
|
+
), this.style.setProperty(
|
|
144
|
+
`--${l}--${n}-value`,
|
|
145
|
+
e
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
updateStyle(t, s, e) {
|
|
150
|
+
e !== null && e !== "" && e !== "default" && this.style.setProperty(
|
|
151
|
+
`--${t}--${s}-value`,
|
|
152
|
+
e
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
checkName(t, s) {
|
|
156
|
+
return t.includes(s);
|
|
157
|
+
}
|
|
158
|
+
get $el() {
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
get $parentElementName() {
|
|
162
|
+
var t;
|
|
163
|
+
return (t = this.parentElement) == null ? void 0 : t.tagName.toLowerCase();
|
|
164
|
+
}
|
|
165
|
+
get isGrid() {
|
|
166
|
+
return this.$parentElementName === "px-grid";
|
|
167
|
+
}
|
|
168
|
+
get isStack() {
|
|
169
|
+
return this.$parentElementName === "px-stack";
|
|
170
|
+
}
|
|
171
|
+
get grow() {
|
|
172
|
+
return this.getAttribute("grow");
|
|
173
|
+
}
|
|
174
|
+
set grow(t) {
|
|
175
|
+
this.setAttribute("grow", t);
|
|
176
|
+
}
|
|
177
|
+
get growMobile() {
|
|
178
|
+
return this.getAttribute("grow--mobile");
|
|
179
|
+
}
|
|
180
|
+
set growMobile(t) {
|
|
181
|
+
this.setAttribute("grow--mobile", t);
|
|
182
|
+
}
|
|
183
|
+
get growTablet() {
|
|
184
|
+
return this.getAttribute("grow--tablet");
|
|
185
|
+
}
|
|
186
|
+
set growTablet(t) {
|
|
187
|
+
this.setAttribute("grow--tablet", t);
|
|
188
|
+
}
|
|
189
|
+
get growLaptop() {
|
|
190
|
+
return this.getAttribute("grow--laptop");
|
|
191
|
+
}
|
|
192
|
+
set growLaptop(t) {
|
|
193
|
+
this.setAttribute("grow--laptop", t);
|
|
194
|
+
}
|
|
195
|
+
get growDesktop() {
|
|
196
|
+
return this.getAttribute("grow--desktop");
|
|
197
|
+
}
|
|
198
|
+
set growDesktop(t) {
|
|
199
|
+
this.setAttribute("grow--desktop", t);
|
|
200
|
+
}
|
|
201
|
+
get shrink() {
|
|
202
|
+
return this.getAttribute("shrink");
|
|
203
|
+
}
|
|
204
|
+
set shrink(t) {
|
|
205
|
+
this.setAttribute("shrink", t);
|
|
206
|
+
}
|
|
207
|
+
get shrinkMobile() {
|
|
208
|
+
return this.getAttribute("shrink--mobile");
|
|
209
|
+
}
|
|
210
|
+
set shrinkMobile(t) {
|
|
211
|
+
this.setAttribute("shrink--mobile", t);
|
|
212
|
+
}
|
|
213
|
+
get shrinkTablet() {
|
|
214
|
+
return this.getAttribute("shrink--tablet");
|
|
215
|
+
}
|
|
216
|
+
set shrinkTablet(t) {
|
|
217
|
+
this.setAttribute("shrink--tablet", t);
|
|
218
|
+
}
|
|
219
|
+
get shrinkLaptop() {
|
|
220
|
+
return this.getAttribute("shrink--laptop");
|
|
221
|
+
}
|
|
222
|
+
set shrinkLaptop(t) {
|
|
223
|
+
this.setAttribute("shrink--laptop", t);
|
|
224
|
+
}
|
|
225
|
+
get shrinkDesktop() {
|
|
226
|
+
return this.getAttribute("shrink--desktop");
|
|
227
|
+
}
|
|
228
|
+
set shrinkDesktop(t) {
|
|
229
|
+
this.setAttribute("shrink--desktop", t);
|
|
230
|
+
}
|
|
231
|
+
get basis() {
|
|
232
|
+
return this.getAttribute("basis");
|
|
233
|
+
}
|
|
234
|
+
set basis(t) {
|
|
235
|
+
this.setAttribute("basis", t);
|
|
236
|
+
}
|
|
237
|
+
get basisMobile() {
|
|
238
|
+
return this.getAttribute("basis--mobile");
|
|
239
|
+
}
|
|
240
|
+
set basisMobile(t) {
|
|
241
|
+
this.setAttribute("basis--mobile", t);
|
|
242
|
+
}
|
|
243
|
+
get basisTablet() {
|
|
244
|
+
return this.getAttribute("basis--tablet");
|
|
245
|
+
}
|
|
246
|
+
set basisTablet(t) {
|
|
247
|
+
this.setAttribute("basis--tablet", t);
|
|
248
|
+
}
|
|
249
|
+
get basisLaptop() {
|
|
250
|
+
return this.getAttribute("basis--laptop");
|
|
251
|
+
}
|
|
252
|
+
set basisLaptop(t) {
|
|
253
|
+
this.setAttribute("basis--laptop", t);
|
|
254
|
+
}
|
|
255
|
+
get basisDesktop() {
|
|
256
|
+
return this.getAttribute("basis--desktop");
|
|
257
|
+
}
|
|
258
|
+
set basisDesktop(t) {
|
|
259
|
+
this.setAttribute("basis--desktop", t);
|
|
260
|
+
}
|
|
261
|
+
get alignSelf() {
|
|
262
|
+
return this.getAttribute("align-self");
|
|
263
|
+
}
|
|
264
|
+
set alignSelf(t) {
|
|
265
|
+
this.setAttribute("align-self", t);
|
|
266
|
+
}
|
|
267
|
+
get alignSelfMobile() {
|
|
268
|
+
return this.getAttribute("align-self--mobile");
|
|
269
|
+
}
|
|
270
|
+
set alignSelfMobile(t) {
|
|
271
|
+
this.setAttribute("align-self--mobile", t);
|
|
272
|
+
}
|
|
273
|
+
get alignSelfTablet() {
|
|
274
|
+
return this.getAttribute("align-self--tablet");
|
|
275
|
+
}
|
|
276
|
+
set alignSelfTablet(t) {
|
|
277
|
+
this.setAttribute("align-self--tablet", t);
|
|
278
|
+
}
|
|
279
|
+
get alignSelfLaptop() {
|
|
280
|
+
return this.getAttribute("align-self--laptop");
|
|
281
|
+
}
|
|
282
|
+
set alignSelfLaptop(t) {
|
|
283
|
+
this.setAttribute("align-self--laptop", t);
|
|
284
|
+
}
|
|
285
|
+
get alignSelfDesktop() {
|
|
286
|
+
return this.getAttribute("align-self--desktop");
|
|
287
|
+
}
|
|
288
|
+
set alignSelfDesktop(t) {
|
|
289
|
+
this.setAttribute("align-self--desktop", t);
|
|
290
|
+
}
|
|
291
|
+
get justifySelf() {
|
|
292
|
+
return this.getAttribute("justify-self");
|
|
293
|
+
}
|
|
294
|
+
set justifySelf(t) {
|
|
295
|
+
this.setAttribute("justify-self", t);
|
|
296
|
+
}
|
|
297
|
+
get justifySelfMobile() {
|
|
298
|
+
return this.getAttribute("justify-self--mobile");
|
|
299
|
+
}
|
|
300
|
+
set justifySelfMobile(t) {
|
|
301
|
+
this.setAttribute("justify-self--mobile", t);
|
|
302
|
+
}
|
|
303
|
+
get justifySelfTablet() {
|
|
304
|
+
return this.getAttribute("justify-self--tablet");
|
|
305
|
+
}
|
|
306
|
+
set justifySelfTablet(t) {
|
|
307
|
+
this.setAttribute("justify-self--tablet", t);
|
|
308
|
+
}
|
|
309
|
+
get justifySelfLaptop() {
|
|
310
|
+
return this.getAttribute("justify-self--laptop");
|
|
311
|
+
}
|
|
312
|
+
set justifySelfLaptop(t) {
|
|
313
|
+
this.setAttribute("justify-self--laptop", t);
|
|
314
|
+
}
|
|
315
|
+
get justifySelfDesktop() {
|
|
316
|
+
return this.getAttribute("justify-self--desktop");
|
|
317
|
+
}
|
|
318
|
+
set justifySelfDesktop(t) {
|
|
319
|
+
this.setAttribute("justify-self--desktop", t);
|
|
320
|
+
}
|
|
321
|
+
get hiddenMobile() {
|
|
322
|
+
return this.getAttribute("hidden--mobile");
|
|
323
|
+
}
|
|
324
|
+
set hiddenMobile(t) {
|
|
325
|
+
this.setAttribute("hidden--mobile", t);
|
|
326
|
+
}
|
|
327
|
+
get hiddenTablet() {
|
|
328
|
+
return this.getAttribute("hidden--tablet");
|
|
329
|
+
}
|
|
330
|
+
set hiddenTablet(t) {
|
|
331
|
+
this.setAttribute("hidden--tablet", t);
|
|
332
|
+
}
|
|
333
|
+
get hiddenLaptop() {
|
|
334
|
+
return this.getAttribute("hidden--laptop");
|
|
335
|
+
}
|
|
336
|
+
set hiddenLaptop(t) {
|
|
337
|
+
this.setAttribute("hidden--laptop", t);
|
|
338
|
+
}
|
|
339
|
+
get hiddenDesktop() {
|
|
340
|
+
return this.getAttribute("hidden--desktop");
|
|
341
|
+
}
|
|
342
|
+
set hiddenDesktop(t) {
|
|
343
|
+
this.setAttribute("hidden--desktop", t);
|
|
344
|
+
}
|
|
345
|
+
get colSpan() {
|
|
346
|
+
return this.getAttribute("col-span");
|
|
347
|
+
}
|
|
348
|
+
set colSpan(t) {
|
|
349
|
+
this.setAttribute("col-span", t);
|
|
350
|
+
}
|
|
351
|
+
get colSpanMobile() {
|
|
352
|
+
return this.getAttribute("col-span--mobile");
|
|
353
|
+
}
|
|
354
|
+
set colSpanMobile(t) {
|
|
355
|
+
this.setAttribute("col-span--mobile", t);
|
|
356
|
+
}
|
|
357
|
+
get colSpanTablet() {
|
|
358
|
+
return this.getAttribute("col-span--tablet");
|
|
359
|
+
}
|
|
360
|
+
set colSpanTablet(t) {
|
|
361
|
+
this.setAttribute("col-span--tablet", t);
|
|
362
|
+
}
|
|
363
|
+
get colSpanLaptop() {
|
|
364
|
+
return this.getAttribute("col-span--laptop");
|
|
365
|
+
}
|
|
366
|
+
set colSpanLaptop(t) {
|
|
367
|
+
this.setAttribute("col-span--laptop", t);
|
|
368
|
+
}
|
|
369
|
+
get colSpanDesktop() {
|
|
370
|
+
return this.getAttribute("col-span--desktop");
|
|
371
|
+
}
|
|
372
|
+
set colSpanDesktop(t) {
|
|
373
|
+
this.setAttribute("col-span--desktop", t);
|
|
374
|
+
}
|
|
375
|
+
get order() {
|
|
376
|
+
return this.getAttribute("order");
|
|
377
|
+
}
|
|
378
|
+
set order(t) {
|
|
379
|
+
this.setAttribute("order", t);
|
|
380
|
+
}
|
|
381
|
+
get orderMobile() {
|
|
382
|
+
return this.getAttribute("order--mobile");
|
|
383
|
+
}
|
|
384
|
+
set orderMobile(t) {
|
|
385
|
+
this.setAttribute("order--mobile", t);
|
|
386
|
+
}
|
|
387
|
+
get orderTablet() {
|
|
388
|
+
return this.getAttribute("order--tablet");
|
|
389
|
+
}
|
|
390
|
+
set orderTablet(t) {
|
|
391
|
+
this.setAttribute("order--tablet", t);
|
|
392
|
+
}
|
|
393
|
+
get orderLaptop() {
|
|
394
|
+
return this.getAttribute("order--laptop");
|
|
395
|
+
}
|
|
396
|
+
set orderLaptop(t) {
|
|
397
|
+
this.setAttribute("order--laptop", t);
|
|
398
|
+
}
|
|
399
|
+
get orderDesktop() {
|
|
400
|
+
return this.getAttribute("order--desktop");
|
|
401
|
+
}
|
|
402
|
+
set orderDesktop(t) {
|
|
403
|
+
this.setAttribute("order--desktop", t);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
class m extends b {
|
|
407
|
+
static get observedAttributes() {
|
|
408
|
+
return [
|
|
409
|
+
...super.observedAttributes,
|
|
410
|
+
...g(this.nativeName)
|
|
411
|
+
];
|
|
412
|
+
}
|
|
413
|
+
attributeChangedCallback(t, s, e) {
|
|
414
|
+
super.attributeChangedCallback(t, s, e), e === null ? this.$el.toggleAttribute(t) : this.$el.setAttribute(t, e);
|
|
415
|
+
}
|
|
416
|
+
constructor(...t) {
|
|
417
|
+
super(...t), this.nativeName = Object.getPrototypeOf(this).constructor.nativeName;
|
|
418
|
+
}
|
|
419
|
+
connectedCallback() {
|
|
420
|
+
var t;
|
|
421
|
+
for (const s of g(this.nativeName))
|
|
422
|
+
if (s !== "constructor")
|
|
423
|
+
try {
|
|
424
|
+
Object.defineProperty(this, s, {
|
|
425
|
+
get() {
|
|
426
|
+
return this.$el[s];
|
|
427
|
+
},
|
|
428
|
+
set(e) {
|
|
429
|
+
this.$el[s] !== e && (this.$el[s] = e);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
} catch (e) {
|
|
433
|
+
console.warn(`Could not create property ${s} for`, this.$el, e);
|
|
434
|
+
}
|
|
435
|
+
if (this.isGrid || this.isStack) {
|
|
436
|
+
const s = (t = this.parentElement) == null ? void 0 : t.getAttribute("direction");
|
|
437
|
+
this.$el.style.display = "block", (this.isGrid || this.isStack && s === "row") && (this.$el.style.height = "100%");
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
get $el() {
|
|
441
|
+
return this.shadowRoot.querySelector(this.nativeName);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
const y = [
|
|
445
|
+
"",
|
|
446
|
+
"default",
|
|
447
|
+
"auto",
|
|
448
|
+
"flex-start",
|
|
449
|
+
"flex-end",
|
|
450
|
+
"center",
|
|
451
|
+
"baseline",
|
|
452
|
+
"stretch"
|
|
453
|
+
], S = [
|
|
454
|
+
"",
|
|
455
|
+
"default",
|
|
456
|
+
"start",
|
|
457
|
+
"end",
|
|
458
|
+
"center",
|
|
459
|
+
"stretch"
|
|
460
|
+
], $ = [
|
|
461
|
+
"",
|
|
462
|
+
"default",
|
|
463
|
+
"start",
|
|
464
|
+
"end",
|
|
465
|
+
"center",
|
|
466
|
+
"stretch"
|
|
467
|
+
], w = [
|
|
468
|
+
"",
|
|
469
|
+
"1",
|
|
470
|
+
"2",
|
|
471
|
+
"3",
|
|
472
|
+
"4",
|
|
473
|
+
"5",
|
|
474
|
+
"6",
|
|
475
|
+
"7",
|
|
476
|
+
"8",
|
|
477
|
+
"9",
|
|
478
|
+
"10",
|
|
479
|
+
"11",
|
|
480
|
+
"12"
|
|
481
|
+
], x = [
|
|
482
|
+
"",
|
|
483
|
+
"-1",
|
|
484
|
+
"0",
|
|
485
|
+
"1",
|
|
486
|
+
"2",
|
|
487
|
+
"3",
|
|
488
|
+
"4",
|
|
489
|
+
"5",
|
|
490
|
+
"6",
|
|
491
|
+
"7",
|
|
492
|
+
"8",
|
|
493
|
+
"9",
|
|
494
|
+
"10",
|
|
495
|
+
"11",
|
|
496
|
+
"12"
|
|
497
|
+
], j = ["Xs", "S", "M", "L", "Xl"];
|
|
498
|
+
[
|
|
499
|
+
...j.map((a) => a.toLowerCase())
|
|
500
|
+
];
|
|
501
|
+
const C = [
|
|
502
|
+
"none",
|
|
503
|
+
"2xs",
|
|
504
|
+
"xs",
|
|
505
|
+
"s",
|
|
506
|
+
"default",
|
|
507
|
+
"l",
|
|
508
|
+
"heading-to-subtitle",
|
|
509
|
+
"heading-to-content",
|
|
510
|
+
"page-layout-between-sections"
|
|
511
|
+
];
|
|
512
|
+
function M(a, t, s, e = "", i) {
|
|
513
|
+
const o = new CSSStyleSheet(), l = s.reduce(
|
|
514
|
+
(n, r) => n + `
|
|
515
|
+
${t(a, r)} {
|
|
516
|
+
${a}: var(--${e}-${r}-desktop);
|
|
517
|
+
${`${i}:var(--${e}-${r}-desktop)`}
|
|
518
|
+
}
|
|
519
|
+
/* Mobile only - max 767px */
|
|
520
|
+
@media only screen and (max-width: 47.938em) {
|
|
521
|
+
${t(a, r)} {
|
|
522
|
+
${a}: var(--${e}-${r}-mobile);
|
|
523
|
+
${`${i}: var(--${e}-${r}-mobile)`}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
${t(a, r, "mobile")} {
|
|
527
|
+
/* Mobile only - max 767px */
|
|
528
|
+
@media only screen and (max-width: 47.938em) {
|
|
529
|
+
${a}: var(--${e}-${r}-mobile) !important;
|
|
530
|
+
${`${i}: var(--${e}-${r}-mobile)`}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
${t(a, r, "tablet")} {
|
|
534
|
+
/* Tablet - min 768px max 1024px */
|
|
535
|
+
@media only screen and (min-width: 48em) and (max-width: 64em) {
|
|
536
|
+
${a}: var(--${e}-${r}-desktop) !important;
|
|
537
|
+
${`${i}: var(--${e}-${r}-desktop)`}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
${t(a, r, "laptop")} {
|
|
541
|
+
/* Laptop - 1025px*/
|
|
542
|
+
@media only screen and (min-width: 64.0625em) {
|
|
543
|
+
${a}: var(--${e}-${r}-desktop) !important;
|
|
544
|
+
${`${i}: var(--${e}-${r}-desktop)`}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
${t(a, r, "desktop")} {
|
|
548
|
+
/* Desktop - 1025px*/
|
|
549
|
+
@media only screen and (min-width: 64.0625em) {
|
|
550
|
+
${a}: var(--${e}-${r}-desktop) !important;
|
|
551
|
+
${`${i}: var(--${e}-${r}-desktop)`}
|
|
552
|
+
}
|
|
553
|
+
}`,
|
|
554
|
+
""
|
|
555
|
+
);
|
|
556
|
+
return o.replaceSync(l), o;
|
|
557
|
+
}
|
|
558
|
+
class D {
|
|
559
|
+
constructor(t, s, e, i) {
|
|
560
|
+
this.component = t, this.attributeName = s, this.cssVariable = i, this.attributeNameMobile = `${this.attributeName}--mobile`, this.attributeNameTablet = `${this.attributeName}--tablet`, this.attributeNameLaptop = `${this.attributeName}--laptop`, this.attributeNameDesktop = `${this.attributeName}--desktop`, this._attributeValue = e, Object.defineProperty(
|
|
561
|
+
this.component,
|
|
562
|
+
this.toCamelCase(this.attributeName),
|
|
563
|
+
{
|
|
564
|
+
get: () => this.component.getAttribute(this.attributeName),
|
|
565
|
+
set: (o) => {
|
|
566
|
+
this.component.setAttribute(this.attributeName, o);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
toCamelCase(t) {
|
|
572
|
+
return t.replace(/[-_]+(.)?/g, (s, e) => e ? e.toUpperCase() : "");
|
|
573
|
+
}
|
|
574
|
+
init(t) {
|
|
575
|
+
this.setCSSProperty(this.attributeName, t), this.setCSSProperties();
|
|
576
|
+
}
|
|
577
|
+
attributeChangedCallback(t, s, e) {
|
|
578
|
+
if (s !== e)
|
|
579
|
+
switch (!0) {
|
|
580
|
+
case t === this.attributeName:
|
|
581
|
+
case t === `${this.attributeName}--mobile`:
|
|
582
|
+
case t === `${this.attributeName}--tablet`:
|
|
583
|
+
case t === `${this.attributeName}--laptop`:
|
|
584
|
+
case t === `${this.attributeName}--desktop`:
|
|
585
|
+
this.setCSSProperty(t, e);
|
|
586
|
+
break;
|
|
587
|
+
default:
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
setCSSProperty(t, s, e = !0) {
|
|
592
|
+
const [, i = ""] = t.split("--");
|
|
593
|
+
this.component.style.setProperty(
|
|
594
|
+
`${this.cssVariable}${e ? "-all" : ""}${i ? `-${i}` : ""}`,
|
|
595
|
+
`${this._attributeValue(s, i)}`
|
|
596
|
+
);
|
|
597
|
+
}
|
|
598
|
+
setCSSProperties() {
|
|
599
|
+
const t = this.component.getAttribute(this.attributeName);
|
|
600
|
+
t && (this.setCSSProperty(this.attributeName, t), this.setCSSProperty(this.attributeNameMobile, t), this.setCSSProperty(this.attributeNameTablet, t), this.setCSSProperty(this.attributeNameLaptop, t), this.setCSSProperty(this.attributeNameDesktop, t));
|
|
601
|
+
const s = this.component.getAttribute(
|
|
602
|
+
this.attributeNameMobile
|
|
603
|
+
);
|
|
604
|
+
s && this.setCSSProperty(
|
|
605
|
+
this.attributeNameMobile,
|
|
606
|
+
s,
|
|
607
|
+
!1
|
|
608
|
+
);
|
|
609
|
+
const e = this.component.getAttribute(
|
|
610
|
+
this.attributeNameTablet
|
|
611
|
+
);
|
|
612
|
+
e && this.setCSSProperty(
|
|
613
|
+
this.attributeNameTablet,
|
|
614
|
+
e,
|
|
615
|
+
!1
|
|
616
|
+
);
|
|
617
|
+
const i = this.component.getAttribute(
|
|
618
|
+
this.attributeNameLaptop
|
|
619
|
+
);
|
|
620
|
+
i && this.setCSSProperty(
|
|
621
|
+
this.attributeNameLaptop,
|
|
622
|
+
i,
|
|
623
|
+
!1
|
|
624
|
+
);
|
|
625
|
+
const o = this.component.getAttribute(
|
|
626
|
+
this.attributeNameDesktop
|
|
627
|
+
);
|
|
628
|
+
o && this.setCSSProperty(
|
|
629
|
+
this.attributeNameDesktop,
|
|
630
|
+
o,
|
|
631
|
+
!1
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
set attributeValue(t) {
|
|
635
|
+
this._attributeValue = t, this.setCSSProperties();
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
const f = new CSSStyleSheet();
|
|
639
|
+
f.replaceSync(v);
|
|
640
|
+
const E = ["", "mobile", "tablet", "laptop"], T = (a, t, s) => `:host([${a}${s ? `--${s}` : ""}='${t}']) .list`, L = "px-spacing", d = class d extends m {
|
|
641
|
+
constructor() {
|
|
642
|
+
super(
|
|
643
|
+
f,
|
|
644
|
+
M(
|
|
645
|
+
"gap",
|
|
646
|
+
T,
|
|
647
|
+
C,
|
|
648
|
+
L,
|
|
649
|
+
"--list-gap"
|
|
650
|
+
)
|
|
651
|
+
), this.AttributeDelegate = new D(
|
|
652
|
+
this,
|
|
653
|
+
"gap",
|
|
654
|
+
(t) => t,
|
|
655
|
+
"--list-gap"
|
|
656
|
+
), this.shadowRoot.innerHTML = this.template();
|
|
657
|
+
}
|
|
658
|
+
template() {
|
|
659
|
+
return `
|
|
660
|
+
<div class="list" role="list">
|
|
661
|
+
<slot></slot>
|
|
662
|
+
</div>
|
|
663
|
+
`;
|
|
664
|
+
}
|
|
665
|
+
static get observedAttributes() {
|
|
666
|
+
return [
|
|
667
|
+
"gap",
|
|
668
|
+
"gap--mobile",
|
|
669
|
+
"gap--tablet",
|
|
670
|
+
"gap--laptop",
|
|
671
|
+
"gap--desktop",
|
|
672
|
+
"inverted"
|
|
673
|
+
];
|
|
674
|
+
}
|
|
675
|
+
connectedCallback() {
|
|
676
|
+
super.connectedCallback(), this.gap || (this.gap = "xs");
|
|
677
|
+
}
|
|
678
|
+
attributeChangedCallback(t, s, e) {
|
|
679
|
+
if (s !== e)
|
|
680
|
+
switch (t) {
|
|
681
|
+
case "gap":
|
|
682
|
+
case "gap--mobile":
|
|
683
|
+
case "gap--tablet":
|
|
684
|
+
case "gap--laptop":
|
|
685
|
+
case "gap--desktop":
|
|
686
|
+
this.AttributeDelegate.attributeChangedCallback(
|
|
687
|
+
t,
|
|
688
|
+
s,
|
|
689
|
+
e
|
|
690
|
+
);
|
|
691
|
+
break;
|
|
692
|
+
case "inverted":
|
|
693
|
+
for (let i = 0; i < this.$children.length; i++)
|
|
694
|
+
this.$children[i].hasAttribute("inverted") || this.$children[i].toggleAttribute("inverted");
|
|
695
|
+
this.$el.toggleAttribute("inverted", e !== null);
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
get $children() {
|
|
700
|
+
return this.querySelectorAll("px-list-item");
|
|
701
|
+
}
|
|
702
|
+
get inverted() {
|
|
703
|
+
return this.hasAttribute("inverted");
|
|
704
|
+
}
|
|
705
|
+
set inverted(t) {
|
|
706
|
+
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
707
|
+
}
|
|
708
|
+
get gap() {
|
|
709
|
+
return this.getAttribute("gap");
|
|
710
|
+
}
|
|
711
|
+
set gap(t) {
|
|
712
|
+
t ? this.setAttribute("gap", t) : this.removeAttribute("gap");
|
|
713
|
+
}
|
|
714
|
+
get gapMobile() {
|
|
715
|
+
return this.getAttribute("gap--mobile");
|
|
716
|
+
}
|
|
717
|
+
set gapMobile(t) {
|
|
718
|
+
t ? this.setAttribute("gap--mobile", t) : this.removeAttribute("gap--mobile");
|
|
719
|
+
}
|
|
720
|
+
get gapTablet() {
|
|
721
|
+
return this.getAttribute("gap--tablet");
|
|
722
|
+
}
|
|
723
|
+
set gapTablet(t) {
|
|
724
|
+
t ? this.setAttribute("gap--tablet", t) : this.removeAttribute("gap--tablet");
|
|
725
|
+
}
|
|
726
|
+
get gapLaptop() {
|
|
727
|
+
return this.getAttribute("gap--laptop");
|
|
728
|
+
}
|
|
729
|
+
set gapLaptop(t) {
|
|
730
|
+
t ? this.setAttribute("gap--laptop", t) : this.removeAttribute("gap--laptop");
|
|
731
|
+
}
|
|
732
|
+
get gapDesktop() {
|
|
733
|
+
return this.getAttribute("gap--desktop");
|
|
734
|
+
}
|
|
735
|
+
set gapDesktop(t) {
|
|
736
|
+
t ? this.setAttribute("gap--desktop", t) : this.removeAttribute("gap--desktop");
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
d.nativeName = "div";
|
|
740
|
+
let p = d;
|
|
741
|
+
customElements.get("px-list") || customElements.define("px-list", p);
|
|
742
|
+
const N = '.list-item{display:flex;gap:var(--px-spacing-xs-mobile);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();
|
|
743
|
+
k.replaceSync(N);
|
|
744
|
+
const u = class u extends m {
|
|
745
|
+
template() {
|
|
746
|
+
return `
|
|
747
|
+
<div class="list-item" role="listitem">
|
|
748
|
+
<slot name="icon"></slot>
|
|
749
|
+
<slot name="label"></slot>
|
|
750
|
+
</div>
|
|
751
|
+
`;
|
|
752
|
+
}
|
|
753
|
+
constructor() {
|
|
754
|
+
super(k), this.shadowRoot.innerHTML = this.template();
|
|
755
|
+
}
|
|
756
|
+
static get observedAttributes() {
|
|
757
|
+
return ["inverted"];
|
|
758
|
+
}
|
|
759
|
+
attributeChangedCallback(t, s, e) {
|
|
760
|
+
if (s !== e)
|
|
761
|
+
switch (t) {
|
|
762
|
+
case "inverted":
|
|
763
|
+
for (let i = 0; i < this.$children.length; i++)
|
|
764
|
+
this.$children[i].hasAttribute("inverted") || this.$children[i].toggleAttribute("inverted");
|
|
765
|
+
this.$el.toggleAttribute("inverted", e !== null);
|
|
766
|
+
break;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
get $children() {
|
|
770
|
+
return this.querySelectorAll("px-list-item > *");
|
|
771
|
+
}
|
|
772
|
+
get inverted() {
|
|
773
|
+
return this.hasAttribute("inverted");
|
|
774
|
+
}
|
|
775
|
+
set inverted(t) {
|
|
776
|
+
t ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
u.nativeName = "div";
|
|
780
|
+
let h = u;
|
|
781
|
+
customElements.get("px-list-item") || customElements.define("px-list-item", h);
|
|
782
|
+
export {
|
|
783
|
+
p as List,
|
|
784
|
+
h as ListItem,
|
|
785
|
+
E as breakpointsValues
|
|
786
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proximus/lavender-list",
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.es.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
|
|
13
|
+
"clean": "rm -rf dist",
|
|
14
|
+
"build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
|
|
15
|
+
"test": "vitest run --coverage",
|
|
16
|
+
"wc-manifest": "cem analyze --globs \"src/*\" --config ../custom-elements-manifest.config.js --outdir dist"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"customElements": "dist/custom-elements.json",
|
|
22
|
+
"web-types": "./dist/web-types.json",
|
|
23
|
+
"gitHead": "460ebd4c7e0171baabc0871a7058f475b5c9adbb"
|
|
24
|
+
}
|