@proximus/lavender-banner 2.0.0-alpha.168 → 2.0.0-alpha.169
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/Banner.d.ts +16 -16
- package/dist/index.es.js +533 -588
- package/package.json +1 -1
package/dist/Banner.d.ts
CHANGED
|
@@ -18,22 +18,22 @@ export declare class Banner extends VerticallyExtendedElement<HTMLDivElement> {
|
|
|
18
18
|
get $grid(): Grid;
|
|
19
19
|
get $container(): Container;
|
|
20
20
|
get $children(): NodeListOf<Element>;
|
|
21
|
-
get backgroundColor(): string;
|
|
22
|
-
set backgroundColor(value: string);
|
|
23
|
-
get gradient(): string;
|
|
24
|
-
set gradient(value: string);
|
|
25
|
-
get backgroundImage(): string;
|
|
26
|
-
set backgroundImage(value: string);
|
|
27
|
-
get backgroundImageMobile(): string;
|
|
28
|
-
set backgroundImageMobile(value: string);
|
|
29
|
-
get backgroundImageTablet(): string;
|
|
30
|
-
set backgroundImageTablet(value: string);
|
|
31
|
-
get backgroundImageLaptop(): string;
|
|
32
|
-
set backgroundImageLaptop(value: string);
|
|
33
|
-
get backgroundSize(): string;
|
|
34
|
-
set backgroundSize(value: string);
|
|
35
|
-
get backgroundPosition(): string;
|
|
36
|
-
set backgroundPosition(value: string);
|
|
21
|
+
get backgroundColor(): string | null;
|
|
22
|
+
set backgroundColor(value: string | null);
|
|
23
|
+
get gradient(): string | null;
|
|
24
|
+
set gradient(value: string | null);
|
|
25
|
+
get backgroundImage(): string | null;
|
|
26
|
+
set backgroundImage(value: string | null);
|
|
27
|
+
get backgroundImageMobile(): string | null;
|
|
28
|
+
set backgroundImageMobile(value: string | null);
|
|
29
|
+
get backgroundImageTablet(): string | null;
|
|
30
|
+
set backgroundImageTablet(value: string | null);
|
|
31
|
+
get backgroundImageLaptop(): string | null;
|
|
32
|
+
set backgroundImageLaptop(value: string | null);
|
|
33
|
+
get backgroundSize(): string | null;
|
|
34
|
+
set backgroundSize(value: string | null);
|
|
35
|
+
get backgroundPosition(): string | null;
|
|
36
|
+
set backgroundPosition(value: string | null);
|
|
37
37
|
get gradientContrastHelper(): boolean;
|
|
38
38
|
set gradientContrastHelper(value: boolean);
|
|
39
39
|
get overlayContrastHelper(): boolean;
|
package/dist/index.es.js
CHANGED
|
@@ -1,591 +1,536 @@
|
|
|
1
|
-
var b = (a) => {
|
|
2
|
-
throw TypeError(a);
|
|
3
|
-
};
|
|
4
|
-
var k = (a, t, e) => t.has(a) || b("Cannot " + e);
|
|
5
|
-
var m = (a, t, e) => t.has(a) ? b("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(a) : t.set(a, e);
|
|
6
|
-
var l = (a, t, e) => (k(a, t, "access private method"), e);
|
|
7
1
|
import "@proximus/lavender-container";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
get justifyContentDesktop() {
|
|
296
|
-
return this.getAttribute("justify-content--desktop");
|
|
297
|
-
}
|
|
298
|
-
set justifyContentDesktop(t) {
|
|
299
|
-
this.setAttribute("justify-content--desktop", t);
|
|
300
|
-
}
|
|
301
|
-
get justifyItemsDesktop() {
|
|
302
|
-
return this.getAttribute("justify-items--desktop");
|
|
303
|
-
}
|
|
304
|
-
set justifyItemsDesktop(t) {
|
|
305
|
-
this.setAttribute("justify-items--desktop", t);
|
|
306
|
-
}
|
|
307
|
-
get alignContentDesktop() {
|
|
308
|
-
return this.getAttribute("align-content--desktop");
|
|
309
|
-
}
|
|
310
|
-
set alignContentDesktop(t) {
|
|
311
|
-
this.setAttribute("align-content--desktop", t);
|
|
312
|
-
}
|
|
313
|
-
get alignItemsDesktop() {
|
|
314
|
-
return this.getAttribute("align-items--desktop");
|
|
315
|
-
}
|
|
316
|
-
set alignItemsDesktop(t) {
|
|
317
|
-
this.setAttribute("align-items--desktop", t);
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
u.nativeName = "div";
|
|
321
|
-
let c = u;
|
|
322
|
-
customElements.get("px-grid") || customElements.define("px-grid", c);
|
|
323
|
-
const y = new CSSStyleSheet();
|
|
324
|
-
y.replaceSync(T);
|
|
325
|
-
var o, d;
|
|
326
|
-
const p = class p extends x {
|
|
327
|
-
constructor() {
|
|
328
|
-
super(y);
|
|
329
|
-
m(this, o);
|
|
330
|
-
this.template = () => `<div class="banner">
|
|
331
|
-
<div class="contrast-helper"></div>
|
|
332
|
-
<px-container class="banner-container" padding--mobile="m" border-radius="main" >
|
|
333
|
-
<px-vstack>
|
|
334
|
-
<px-grid gap="none">
|
|
335
|
-
<px-container padding="none" background-color="none">
|
|
336
|
-
<div class="banner-content">
|
|
337
|
-
<slot name="tag"></slot>
|
|
338
|
-
<slot name="media"></slot>
|
|
339
|
-
<slot name="title"></slot>
|
|
340
|
-
<slot name="description"></slot>
|
|
341
|
-
<slot name="content"></slot>
|
|
342
|
-
</div>
|
|
343
|
-
</px-container>
|
|
344
|
-
</px-grid>
|
|
345
|
-
<slot name="action"></slot>
|
|
346
|
-
</px-vstack>
|
|
347
|
-
</px-container>
|
|
348
|
-
</div>`, this.shadowRoot.innerHTML = this.template();
|
|
349
|
-
}
|
|
350
|
-
static get observedAttributes() {
|
|
351
|
-
return [
|
|
352
|
-
...super.observedAttributes,
|
|
353
|
-
"background-color",
|
|
354
|
-
"background-gradient",
|
|
355
|
-
"background-image",
|
|
356
|
-
"background-image--mobile",
|
|
357
|
-
"background-image--tablet",
|
|
358
|
-
"background-image--laptop",
|
|
359
|
-
"background-size",
|
|
360
|
-
"background-position",
|
|
361
|
-
"contrast-helper-gradient",
|
|
362
|
-
"contrast-helper-overlay",
|
|
363
|
-
"has-gridding",
|
|
364
|
-
"has-gridding--mobile",
|
|
365
|
-
"has-gridding--tablet",
|
|
366
|
-
"has-gridding--laptop",
|
|
367
|
-
"reduced",
|
|
368
|
-
"inverted"
|
|
369
|
-
];
|
|
370
|
-
}
|
|
371
|
-
connectedCallback() {
|
|
372
|
-
var e;
|
|
373
|
-
(e = super.connectedCallback) == null || e.call(this), l(this, o, d).call(this), this.createGridTemplateAreas(), this.createGridding(), this.observer = new MutationObserver(() => {
|
|
374
|
-
this.createGridTemplateAreas(), this.createGridding();
|
|
375
|
-
}), this.observer.observe(this, {
|
|
376
|
-
childList: !0,
|
|
377
|
-
subtree: !0
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
attributeChangedCallback(e, n, i) {
|
|
381
|
-
if (n !== i)
|
|
382
|
-
switch (e) {
|
|
383
|
-
case "background-color":
|
|
384
|
-
this.$container.backgroundColor = S.indexOf(i) > 0 ? i : "none";
|
|
385
|
-
break;
|
|
386
|
-
case "background-gradient":
|
|
387
|
-
this.$container.gradient = I.indexOf(i) > 0 ? i : "none";
|
|
388
|
-
break;
|
|
389
|
-
case "background-image":
|
|
390
|
-
this.$container.backgroundImage = i;
|
|
391
|
-
break;
|
|
392
|
-
case "background-image--mobile":
|
|
393
|
-
this.$container.backgroundImageMobile = i;
|
|
394
|
-
break;
|
|
395
|
-
case "background-image--tablet":
|
|
396
|
-
this.$container.backgroundImageTablet = i;
|
|
397
|
-
break;
|
|
398
|
-
case "background-image--laptop":
|
|
399
|
-
this.$container.backgroundImageLaptop = i;
|
|
400
|
-
break;
|
|
401
|
-
case "background-size":
|
|
402
|
-
this.$container.backgroundSize = $.indexOf(i) > 0 ? i : "";
|
|
403
|
-
break;
|
|
404
|
-
case "background-position":
|
|
405
|
-
this.$container.backgroundPosition = i;
|
|
406
|
-
break;
|
|
407
|
-
case "reduced":
|
|
408
|
-
this.$el.toggleAttribute("reduced", i !== null), this.isConnected && l(this, o, d).call(this), this.createGridTemplateAreas();
|
|
409
|
-
break;
|
|
410
|
-
case "has-gridding":
|
|
411
|
-
case "has-gridding--mobile":
|
|
412
|
-
case "has-gridding--tablet":
|
|
413
|
-
case "has-gridding--laptop":
|
|
414
|
-
this.createGridding(i);
|
|
415
|
-
break;
|
|
416
|
-
case "inverted":
|
|
417
|
-
for (let s = 0; s < this.$children.length; s++)
|
|
418
|
-
this.$children[s].hasAttribute("inverted") || this.$children[s].toggleAttribute("inverted");
|
|
419
|
-
this.$el.toggleAttribute("inverted", i !== null);
|
|
420
|
-
break;
|
|
421
|
-
default:
|
|
422
|
-
super.attributeChangedCallback(e, n, i);
|
|
423
|
-
break;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
disconnectedCallback() {
|
|
427
|
-
this.observer.disconnect();
|
|
428
|
-
}
|
|
429
|
-
createGridTemplateAreas() {
|
|
430
|
-
const e = this.shadowRoot.querySelector(
|
|
431
|
-
".banner-content"
|
|
432
|
-
), n = ["tag", "media", "title", "description", "content", "action"];
|
|
433
|
-
let i = "";
|
|
434
|
-
this.reduced ? n.forEach((s) => {
|
|
435
|
-
const r = this.shadowRoot.querySelector(
|
|
436
|
-
`slot[name="${s}"]`
|
|
437
|
-
);
|
|
438
|
-
if (r && r.assignedElements().length > 0) {
|
|
439
|
-
if (s === "media") return;
|
|
440
|
-
i += `'media ${s}'
|
|
441
|
-
`;
|
|
442
|
-
}
|
|
443
|
-
}) : n.forEach((s) => {
|
|
444
|
-
const r = this.shadowRoot.querySelector(
|
|
445
|
-
`slot[name="${s}"]`
|
|
446
|
-
);
|
|
447
|
-
r && r.assignedElements().length > 0 && (i += `'${s}'
|
|
448
|
-
`);
|
|
449
|
-
}), i || (i = "'content'"), e.style.gridTemplateAreas = i;
|
|
450
|
-
}
|
|
451
|
-
createGridding(e) {
|
|
452
|
-
const n = [
|
|
453
|
-
{ prop: "hasGridding", gridAttr: "grid-cols", attr: "col-span" },
|
|
454
|
-
{
|
|
455
|
-
prop: "hasGriddingMobile",
|
|
456
|
-
gridAttr: "grid-cols--mobile",
|
|
457
|
-
attr: "col-span--mobile"
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
prop: "hasGriddingTablet",
|
|
461
|
-
gridAttr: "grid-cols--tablet",
|
|
462
|
-
attr: "col-span--tablet"
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
prop: "hasGriddingLaptop",
|
|
466
|
-
gridAttr: "grid-cols--laptop",
|
|
467
|
-
attr: "col-span--laptop"
|
|
468
|
-
}
|
|
469
|
-
], i = this.shadowRoot.querySelector(
|
|
470
|
-
"px-grid > px-container"
|
|
471
|
-
);
|
|
472
|
-
e !== null ? n.forEach(({ prop: s, gridAttr: r, attr: j }) => {
|
|
473
|
-
this[s] && (this.$grid.setAttribute(r, "3"), i == null || i.setAttribute(j, "2"));
|
|
474
|
-
}) : n.forEach(({ gridAttr: s, attr: r }) => {
|
|
475
|
-
this.$grid.setAttribute(s, "1"), i == null || i.setAttribute(r, "1");
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
get $grid() {
|
|
479
|
-
return this.shadowRoot.querySelector("px-grid");
|
|
480
|
-
}
|
|
481
|
-
get $container() {
|
|
482
|
-
return this.shadowRoot.querySelector(".banner-container");
|
|
483
|
-
}
|
|
484
|
-
get $children() {
|
|
485
|
-
return this.querySelectorAll("px-banner > *");
|
|
486
|
-
}
|
|
487
|
-
get backgroundColor() {
|
|
488
|
-
return this.getAttribute("background-color");
|
|
489
|
-
}
|
|
490
|
-
set backgroundColor(e) {
|
|
491
|
-
this.setAttribute("background-color", e);
|
|
492
|
-
}
|
|
493
|
-
get gradient() {
|
|
494
|
-
return this.getAttribute("background-gradient");
|
|
495
|
-
}
|
|
496
|
-
set gradient(e) {
|
|
497
|
-
this.setAttribute("background-gradient", e);
|
|
498
|
-
}
|
|
499
|
-
get backgroundImage() {
|
|
500
|
-
return this.getAttribute("background-image");
|
|
501
|
-
}
|
|
502
|
-
set backgroundImage(e) {
|
|
503
|
-
this.setAttribute("background-image", e);
|
|
504
|
-
}
|
|
505
|
-
get backgroundImageMobile() {
|
|
506
|
-
return this.getAttribute("background-image--mobile");
|
|
507
|
-
}
|
|
508
|
-
set backgroundImageMobile(e) {
|
|
509
|
-
this.setAttribute("background-image--mobile", e);
|
|
510
|
-
}
|
|
511
|
-
get backgroundImageTablet() {
|
|
512
|
-
return this.getAttribute("background-image--tablet");
|
|
513
|
-
}
|
|
514
|
-
set backgroundImageTablet(e) {
|
|
515
|
-
this.setAttribute("background-image--tablet", e);
|
|
516
|
-
}
|
|
517
|
-
get backgroundImageLaptop() {
|
|
518
|
-
return this.getAttribute("background-image--laptop");
|
|
519
|
-
}
|
|
520
|
-
set backgroundImageLaptop(e) {
|
|
521
|
-
this.setAttribute("background-image--laptop", e);
|
|
522
|
-
}
|
|
523
|
-
get backgroundSize() {
|
|
524
|
-
return this.getAttribute("background-size");
|
|
525
|
-
}
|
|
526
|
-
set backgroundSize(e) {
|
|
527
|
-
this.setAttribute("background-size", e);
|
|
528
|
-
}
|
|
529
|
-
get backgroundPosition() {
|
|
530
|
-
return this.getAttribute("background-position");
|
|
531
|
-
}
|
|
532
|
-
set backgroundPosition(e) {
|
|
533
|
-
this.setAttribute("background-position", e);
|
|
534
|
-
}
|
|
535
|
-
get gradientContrastHelper() {
|
|
536
|
-
return this.hasAttribute("contrast-helper-gradient");
|
|
537
|
-
}
|
|
538
|
-
set gradientContrastHelper(e) {
|
|
539
|
-
e ? this.setAttribute("contrast-helper-gradient", "") : this.removeAttribute("contrast-helper-gradient");
|
|
540
|
-
}
|
|
541
|
-
get overlayContrastHelper() {
|
|
542
|
-
return this.hasAttribute("contrast-helper-overlay");
|
|
543
|
-
}
|
|
544
|
-
set overlayContrastHelper(e) {
|
|
545
|
-
e ? this.setAttribute("contrast-helper-overlay", "") : this.removeAttribute("contrast-helper-overlay");
|
|
546
|
-
}
|
|
547
|
-
get inverted() {
|
|
548
|
-
return this.hasAttribute("inverted");
|
|
549
|
-
}
|
|
550
|
-
set inverted(e) {
|
|
551
|
-
e ? this.setAttribute("inverted", "") : this.removeAttribute("inverted");
|
|
552
|
-
}
|
|
553
|
-
get reduced() {
|
|
554
|
-
return this.hasAttribute("reduced");
|
|
555
|
-
}
|
|
556
|
-
set reduced(e) {
|
|
557
|
-
e ? this.setAttribute("reduced", "") : this.removeAttribute("reduced");
|
|
558
|
-
}
|
|
559
|
-
get hasGridding() {
|
|
560
|
-
return this.hasAttribute("has-gridding");
|
|
561
|
-
}
|
|
562
|
-
set hasGridding(e) {
|
|
563
|
-
e ? this.setAttribute("has-gridding", "") : this.removeAttribute("has-gridding");
|
|
564
|
-
}
|
|
565
|
-
get hasGriddingMobile() {
|
|
566
|
-
return this.hasAttribute("has-gridding--mobile");
|
|
567
|
-
}
|
|
568
|
-
set hasGriddingMobile(e) {
|
|
569
|
-
e ? this.setAttribute("has-gridding--mobile", "") : this.removeAttribute("has-gridding--mobile");
|
|
570
|
-
}
|
|
571
|
-
get hasGriddingTablet() {
|
|
572
|
-
return this.hasAttribute("has-gridding--tablet");
|
|
573
|
-
}
|
|
574
|
-
set hasGriddingTablet(e) {
|
|
575
|
-
e ? this.setAttribute("has-gridding--tablet", "") : this.removeAttribute("has-gridding--tablet");
|
|
576
|
-
}
|
|
577
|
-
get hasGriddingLaptop() {
|
|
578
|
-
return this.hasAttribute("has-gridding--laptop");
|
|
579
|
-
}
|
|
580
|
-
set hasGriddingLaptop(e) {
|
|
581
|
-
e ? this.setAttribute("has-gridding--laptop", "") : this.removeAttribute("has-gridding--laptop");
|
|
582
|
-
}
|
|
2
|
+
import { PxElement as e, VerticallyExtendedElement as t, backgroundColorValues as n, backgroundSizeValues as r, cssTokenBreakpoints as i, gapValues as a, gradientValues as o, log as s } from "@proximus/lavender-common";
|
|
3
|
+
//#region src/banner.css?inline
|
|
4
|
+
var c = ":host{position:relative}:host,:host>*{box-sizing:border-box;display:block}.banner{height:100%;min-height:8rem;position:relative}.banner[reduced]{min-height:5rem}px-container{height:100%}.banner-content{row-gap:var(--px-spacing-s-mobile);z-index:2;grid-template-rows:minmax(0,auto);grid-template-columns:1fr;display:grid;position:relative}[reduced] .banner-content{column-gap:var(--px-spacing-default-mobile);grid-template-columns:min-content minmax(0,1fr)}::slotted([slot=tag]){grid-area:tag}::slotted([slot=media]){grid-area:media;align-self:start}::slotted([slot=title]){grid-area:title}::slotted([slot=description]){grid-area:description}::slotted([slot=content]){grid-area:content}::slotted([slot=action]){z-index:2;grid-area:action}:host(:not([reduced])) ::slotted([slot=action]){margin-top:calc(var(--px-spacing-default-mobile) - var(--px-spacing-s-mobile))}.contrast-helper{z-index:1;pointer-events:none;border-radius:var(--px-radius-main);display:none;position:absolute;inset:0}[contrast-helper-gradient] .contrast-helper{background-image:linear-gradient(90deg,#fff 23.43%,#fff0 81.69%);display:block}[inverted] :is([contrast-helper-gradient] .contrast-helper){background-image:linear-gradient(90deg,#000 23.43%,#0000 81.69%)}[contrast-helper-overlay] .contrast-helper{background-color:#ffffffb3;display:block}[inverted] :is([contrast-helper-overlay] .contrast-helper){background-color:#0006}@media screen and (width>=48rem){.banner-content{row-gap:var(--px-spacing-s-desktop)}[reduced] .banner-content{column-gap:var(--px-spacing-default-desktop)}.banner-content :host(:not([reduced])) ::slotted([slot=action]){margin-top:calc(var(--px-spacing-default-desktop) - var(--px-spacing-s-desktop))}}@media screen and (width>=64.0625rem){.banner-content{row-gap:var(--px-spacing-s-desktop)}[reduced] .banner-content{column-gap:var(--px-spacing-default-desktop)}.banner-content :host(:not([reduced])) ::slotted([slot=action]){margin-top:calc(var(--px-spacing-default-desktop) - var(--px-spacing-s-desktop))}}", l = ":host{--grid-cols:initial;--grid-cols--mobile:initial;--grid-cols--tablet:initial;--grid-cols--laptop:initial;--grid-cols--desktop:initial;--justify-content:initial;--justify-items:initial;--align-content:initial;--align-items:initial;display:block}.grid{grid-template-columns:repeat(var(--grid-cols), minmax(0, 1fr));justify-content:var(--justify-content);justify-items:var(--justify-items);align-content:var(--align-content);align-items:var(--align-items);display:grid}.justify-content-normal{justify-content:normal}.justify-content-start{justify-content:start}.justify-content-end{justify-content:end}.justify-content-center{justify-content:center}.justify-content-space-between{justify-content:space-between}.justify-content-space-around{justify-content:space-around}.justify-content-space-evenly{justify-content:space-evenly}.justify-content-stretch{justify-content:stretch}.justify-items-start{justify-items:start}.justify-items-end{justify-items:end}.justify-items-center{justify-items:center}.justify-items-stretch{justify-items:stretch}.align-content-normal{align-content:normal}.align-content-start{align-content:start}.align-content-end{align-content:end}.align-content-center{align-content:center}.align-content-space-between{align-content:space-between}.align-content-space-around{align-content:space-around}.align-content-space-evenly{align-content:space-evenly}.align-content-stretch{align-content:stretch}.align-items-start{align-items:start}.align-items-end{align-items:end}.align-items-center{align-items:center}.align-items-stretch{align-items:stretch}@media screen and (width<=47.938rem){.grid{grid-template-columns:repeat(var(--grid-cols--mobile,var(--grid-cols)), minmax(0, 1fr))}.justify-content-normal-mobile{justify-content:normal}.justify-content-start-mobile{justify-content:start}.justify-content-end-mobile{justify-content:end}.justify-content-center-mobile{justify-content:center}.justify-content-space-between-mobile{justify-content:space-between}.justify-content-space-around-mobile{justify-content:space-around}.justify-content-space-evenly-mobile{justify-content:space-evenly}.justify-content-stretch-mobile{justify-content:stretch}.justify-items-start-mobile{justify-items:start}.justify-items-end-mobile{justify-items:end}.justify-items-center-mobile{justify-items:center}.justify-items-stretch-mobile{justify-items:stretch}.align-content-normal-mobile{align-content:normal}.align-content-start-mobile{align-content:start}.align-content-end-mobile{align-content:end}.align-content-center-mobile{align-content:center}.align-content-space-between-mobile{align-content:space-between}.align-content-space-around-mobile{align-content:space-around}.align-content-space-evenly-mobile{align-content:space-evenly}.align-content-stretch-mobile{align-content:stretch}.align-items-start-mobile{align-items:start}.align-items-end-mobile{align-items:end}.align-items-center-mobile{align-items:center}.align-items-stretch-mobile{align-items:stretch}}@media screen and (width>=48rem) and (width<=64rem){.grid{grid-template-columns:repeat(var(--grid-cols--tablet,var(--grid-cols)), minmax(0, 1fr))}.justify-content-normal-tablet{justify-content:normal}.justify-content-start-tablet{justify-content:start}.justify-content-end-tablet{justify-content:end}.justify-content-center-tablet{justify-content:center}.justify-content-space-between-tablet{justify-content:space-between}.justify-content-space-around-tablet{justify-content:space-around}.justify-content-space-evenly-tablet{justify-content:space-evenly}.justify-content-stretch-tablet{justify-content:stretch}.justify-items-start-tablet{justify-items:start}.justify-items-end-tablet{justify-items:end}.justify-items-center-tablet{justify-items:center}.justify-items-stretch-tablet{justify-items:stretch}.align-content-normal-tablet{align-content:normal}.align-content-start-tablet{align-content:start}.align-content-end-tablet{align-content:end}.align-content-center-tablet{align-content:center}.align-content-space-between-tablet{align-content:space-between}.align-content-space-around-tablet{align-content:space-around}.align-content-space-evenly-tablet{align-content:space-evenly}.align-content-stretch-tablet{align-content:stretch}.align-items-start-tablet{align-items:start}.align-items-end-tablet{align-items:end}.align-items-center-tablet{align-items:center}.align-items-stretch-tablet{align-items:stretch}}@media screen and (width>=64.0625rem){.grid{grid-template-columns:repeat(var(--grid-cols--laptop,var(--grid-cols)), minmax(0, 1fr))}.justify-content-normal-laptop{justify-content:normal}.justify-content-start-laptop{justify-content:start}.justify-content-end-laptop{justify-content:end}.justify-content-center-laptop{justify-content:center}.justify-content-space-between-laptop{justify-content:space-between}.justify-content-space-around-laptop{justify-content:space-around}.justify-content-space-evenly-laptop{justify-content:space-evenly}.justify-content-stretch-laptop{justify-content:stretch}.justify-items-start-laptop{justify-items:start}.justify-items-end-laptop{justify-items:end}.justify-items-center-laptop{justify-items:center}.justify-items-stretch-laptop{justify-items:stretch}.align-content-normal-laptop{align-content:normal}.align-content-start-laptop{align-content:start}.align-content-end-laptop{align-content:end}.align-content-center-laptop{align-content:center}.align-content-space-between-laptop{align-content:space-between}.align-content-space-around-laptop{align-content:space-around}.align-content-space-evenly-laptop{align-content:space-evenly}.align-content-stretch-laptop{align-content:stretch}.align-items-start-laptop{align-items:start}.align-items-end-laptop{align-items:end}.align-items-center-laptop{align-items:center}.align-items-stretch-laptop{align-items:stretch}}", u = new CSSStyleSheet();
|
|
5
|
+
u.replaceSync(l);
|
|
6
|
+
var d = [
|
|
7
|
+
"1",
|
|
8
|
+
"2",
|
|
9
|
+
"3",
|
|
10
|
+
"4",
|
|
11
|
+
"5",
|
|
12
|
+
"6",
|
|
13
|
+
"7",
|
|
14
|
+
"8",
|
|
15
|
+
"9",
|
|
16
|
+
"10",
|
|
17
|
+
"11",
|
|
18
|
+
"12"
|
|
19
|
+
], f = [
|
|
20
|
+
"",
|
|
21
|
+
"start",
|
|
22
|
+
"end",
|
|
23
|
+
"center",
|
|
24
|
+
"space-between",
|
|
25
|
+
"space-around",
|
|
26
|
+
"space-evenly",
|
|
27
|
+
"stretch"
|
|
28
|
+
], p = [
|
|
29
|
+
"",
|
|
30
|
+
"start",
|
|
31
|
+
"end",
|
|
32
|
+
"center",
|
|
33
|
+
"stretch"
|
|
34
|
+
], m = i("gap", (e, t, n) => `:host([${e}${n ? `--${n}` : ""}='${t}']) .grid`, a, "px-spacing", "--grid-gap"), h = class extends e {
|
|
35
|
+
static {
|
|
36
|
+
this.nativeName = "div";
|
|
37
|
+
}
|
|
38
|
+
constructor() {
|
|
39
|
+
super(u, m), this.template = () => "<div class=\"grid\">\n <slot></slot>\n </div>", this.shadowRoot.innerHTML = this.template();
|
|
40
|
+
}
|
|
41
|
+
static get observedAttributes() {
|
|
42
|
+
return [
|
|
43
|
+
...super.observedAttributes,
|
|
44
|
+
"grid-cols",
|
|
45
|
+
"grid-cols--mobile",
|
|
46
|
+
"grid-cols--tablet",
|
|
47
|
+
"grid-cols--laptop",
|
|
48
|
+
"justify-content",
|
|
49
|
+
"justify-items",
|
|
50
|
+
"align-content",
|
|
51
|
+
"align-items",
|
|
52
|
+
"justify-content--mobile",
|
|
53
|
+
"justify-items--mobile",
|
|
54
|
+
"align-content--mobile",
|
|
55
|
+
"align-items--mobile",
|
|
56
|
+
"justify-content--tablet",
|
|
57
|
+
"justify-items--tablet",
|
|
58
|
+
"align-content--tablet",
|
|
59
|
+
"align-items--tablet",
|
|
60
|
+
"justify-content--laptop",
|
|
61
|
+
"justify-items--laptop",
|
|
62
|
+
"align-content--laptop",
|
|
63
|
+
"align-items--laptop",
|
|
64
|
+
"justify-content--desktop",
|
|
65
|
+
"justify-items--desktop",
|
|
66
|
+
"align-content--desktop",
|
|
67
|
+
"align-items--desktop"
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
connectedCallback() {
|
|
71
|
+
this.gap ||= "default", this.alignItems ||= "stretch";
|
|
72
|
+
}
|
|
73
|
+
attributeChangedCallback(e, t, n) {
|
|
74
|
+
if (t !== n) switch (e) {
|
|
75
|
+
case "grid-cols":
|
|
76
|
+
case "grid-cols--mobile":
|
|
77
|
+
case "grid-cols--tablet":
|
|
78
|
+
case "grid-cols--laptop":
|
|
79
|
+
this.updateAttribute(e, t, n, d);
|
|
80
|
+
break;
|
|
81
|
+
case "justify-content":
|
|
82
|
+
case "align-content":
|
|
83
|
+
case "justify-content--mobile":
|
|
84
|
+
case "align-content--mobile":
|
|
85
|
+
case "justify-content--tablet":
|
|
86
|
+
case "align-content--tablet":
|
|
87
|
+
case "justify-content--laptop":
|
|
88
|
+
case "align-content--laptop":
|
|
89
|
+
case "justify-content--desktop":
|
|
90
|
+
case "align-content--desktop":
|
|
91
|
+
this.updateAttribute(e, t, n, f);
|
|
92
|
+
break;
|
|
93
|
+
case "justify-items":
|
|
94
|
+
case "align-items":
|
|
95
|
+
case "justify-items--mobile":
|
|
96
|
+
case "align-items--mobile":
|
|
97
|
+
case "justify-items--tablet":
|
|
98
|
+
case "align-items--tablet":
|
|
99
|
+
case "justify-items--laptop":
|
|
100
|
+
case "align-items--laptop":
|
|
101
|
+
case "justify-items--desktop":
|
|
102
|
+
case "align-items--desktop":
|
|
103
|
+
this.updateAttribute(e, t, n, p);
|
|
104
|
+
break;
|
|
105
|
+
default: super.attributeChangedCallback(e, t, n);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
updateGap(e, t, n) {
|
|
109
|
+
if (!this.checkName(n, t)) {
|
|
110
|
+
s(`"${t}" is not a valid gap value for ${this.tagName.toLowerCase()}. Allowed values are: "${n.join("\", \"")}".`);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
let r = (e) => {
|
|
114
|
+
e !== null && e !== "" && e !== "default" && (this.$el.style.setProperty("--grid-gap--mobile", `var(--px-spacing-${e}-mobile)`), this.$el.style.setProperty("--grid-gap--tablet", `var(--px-spacing-${e}-tablet)`), this.$el.style.setProperty("--grid-gap--laptop", `var(--px-spacing-${e}-laptop)`));
|
|
115
|
+
};
|
|
116
|
+
r(e), r(t);
|
|
117
|
+
}
|
|
118
|
+
updateAttribute(e, t, n, r) {
|
|
119
|
+
this.checkName(r, n) ? e === "grid-cols" || e === "grid-cols--mobile" || e === "grid-cols--tablet" || e === "grid-cols--laptop" || e === "grid-cols--desktop" ? this.$el.style.setProperty(`--${e}`, n) : (t !== null && t !== "" && t !== "default" && this.$el.classList.toggle(`${e}-${t}`), n !== null && n !== "" && n !== "default" && this.$el.classList.toggle(`${e}-${n}`)) : s(`"${n}" is not a valid ${e} value for ${this.tagName.toLowerCase()}. Allowed values are: "${r.join("\", \"")}".`);
|
|
120
|
+
}
|
|
121
|
+
get gap() {
|
|
122
|
+
return this.getAttribute("gap");
|
|
123
|
+
}
|
|
124
|
+
set gap(e) {
|
|
125
|
+
this._updateAttribute("gap", e);
|
|
126
|
+
}
|
|
127
|
+
get gapMobile() {
|
|
128
|
+
return this.getAttribute("gap--mobile");
|
|
129
|
+
}
|
|
130
|
+
set gapMobile(e) {
|
|
131
|
+
this._updateAttribute("gap--mobile", e);
|
|
132
|
+
}
|
|
133
|
+
get gapTablet() {
|
|
134
|
+
return this.getAttribute("gap--tablet");
|
|
135
|
+
}
|
|
136
|
+
set gapTablet(e) {
|
|
137
|
+
this._updateAttribute("gap--tablet", e);
|
|
138
|
+
}
|
|
139
|
+
get gapLaptop() {
|
|
140
|
+
return this.getAttribute("gap--laptop");
|
|
141
|
+
}
|
|
142
|
+
set gapLaptop(e) {
|
|
143
|
+
this._updateAttribute("gap--laptop", e);
|
|
144
|
+
}
|
|
145
|
+
get gridCols() {
|
|
146
|
+
return this.getAttribute("grid-cols");
|
|
147
|
+
}
|
|
148
|
+
set gridCols(e) {
|
|
149
|
+
this._updateAttribute("grid-cols", e);
|
|
150
|
+
}
|
|
151
|
+
get gridColsMobile() {
|
|
152
|
+
return this.getAttribute("grid-cols--mobile");
|
|
153
|
+
}
|
|
154
|
+
set gridColsMobile(e) {
|
|
155
|
+
this._updateAttribute("grid-cols--mobile", e);
|
|
156
|
+
}
|
|
157
|
+
get gridColsTablet() {
|
|
158
|
+
return this.getAttribute("grid-cols--tablet");
|
|
159
|
+
}
|
|
160
|
+
set gridColsTablet(e) {
|
|
161
|
+
this._updateAttribute("grid-cols--tablet", e);
|
|
162
|
+
}
|
|
163
|
+
get gridColsLaptop() {
|
|
164
|
+
return this.getAttribute("grid-cols--laptop");
|
|
165
|
+
}
|
|
166
|
+
set gridColsLaptop(e) {
|
|
167
|
+
this._updateAttribute("grid-cols--laptop", e);
|
|
168
|
+
}
|
|
169
|
+
get justifyContent() {
|
|
170
|
+
return this.getAttribute("justify-content");
|
|
171
|
+
}
|
|
172
|
+
set justifyContent(e) {
|
|
173
|
+
this._updateAttribute("justify-content", e);
|
|
174
|
+
}
|
|
175
|
+
get justifyItems() {
|
|
176
|
+
return this.getAttribute("justify-items");
|
|
177
|
+
}
|
|
178
|
+
set justifyItems(e) {
|
|
179
|
+
this._updateAttribute("justify-items", e);
|
|
180
|
+
}
|
|
181
|
+
get alignContent() {
|
|
182
|
+
return this.getAttribute("align-content");
|
|
183
|
+
}
|
|
184
|
+
set alignContent(e) {
|
|
185
|
+
this._updateAttribute("align-content", e);
|
|
186
|
+
}
|
|
187
|
+
get alignItems() {
|
|
188
|
+
return this.getAttribute("align-items");
|
|
189
|
+
}
|
|
190
|
+
set alignItems(e) {
|
|
191
|
+
this._updateAttribute("align-items", e);
|
|
192
|
+
}
|
|
193
|
+
get justifyContentMobile() {
|
|
194
|
+
return this.getAttribute("justify-content--mobile");
|
|
195
|
+
}
|
|
196
|
+
set justifyContentMobile(e) {
|
|
197
|
+
this._updateAttribute("justify-content--mobile", e);
|
|
198
|
+
}
|
|
199
|
+
get justifyItemsMobile() {
|
|
200
|
+
return this.getAttribute("justify-items--mobile");
|
|
201
|
+
}
|
|
202
|
+
set justifyItemsMobile(e) {
|
|
203
|
+
this._updateAttribute("justify-items--mobile", e);
|
|
204
|
+
}
|
|
205
|
+
get alignContentMobile() {
|
|
206
|
+
return this.getAttribute("align-content--mobile");
|
|
207
|
+
}
|
|
208
|
+
set alignContentMobile(e) {
|
|
209
|
+
this._updateAttribute("align-content--mobile", e);
|
|
210
|
+
}
|
|
211
|
+
get alignItemsMobile() {
|
|
212
|
+
return this.getAttribute("align-items--mobile");
|
|
213
|
+
}
|
|
214
|
+
set alignItemsMobile(e) {
|
|
215
|
+
this._updateAttribute("align-items--mobile", e);
|
|
216
|
+
}
|
|
217
|
+
get justifyContentTablet() {
|
|
218
|
+
return this.getAttribute("justify-content--tablet");
|
|
219
|
+
}
|
|
220
|
+
set justifyContentTablet(e) {
|
|
221
|
+
this._updateAttribute("justify-content--tablet", e);
|
|
222
|
+
}
|
|
223
|
+
get justifyItemsTablet() {
|
|
224
|
+
return this.getAttribute("justify-items--tablet");
|
|
225
|
+
}
|
|
226
|
+
set justifyItemsTablet(e) {
|
|
227
|
+
this._updateAttribute("justify-items--tablet", e);
|
|
228
|
+
}
|
|
229
|
+
get alignContentTablet() {
|
|
230
|
+
return this.getAttribute("align-content--tablet");
|
|
231
|
+
}
|
|
232
|
+
set alignContentTablet(e) {
|
|
233
|
+
this._updateAttribute("align-content--tablet", e);
|
|
234
|
+
}
|
|
235
|
+
get alignItemsTablet() {
|
|
236
|
+
return this.getAttribute("align-items--tablet");
|
|
237
|
+
}
|
|
238
|
+
set alignItemsTablet(e) {
|
|
239
|
+
this._updateAttribute("align-items--tablet", e);
|
|
240
|
+
}
|
|
241
|
+
get justifyContentLaptop() {
|
|
242
|
+
return this.getAttribute("justify-content--laptop");
|
|
243
|
+
}
|
|
244
|
+
set justifyContentLaptop(e) {
|
|
245
|
+
this._updateAttribute("justify-content--laptop", e);
|
|
246
|
+
}
|
|
247
|
+
get justifyItemsLaptop() {
|
|
248
|
+
return this.getAttribute("justify-items--laptop");
|
|
249
|
+
}
|
|
250
|
+
set justifyItemsLaptop(e) {
|
|
251
|
+
this._updateAttribute("justify-items--laptop", e);
|
|
252
|
+
}
|
|
253
|
+
get alignContentLaptop() {
|
|
254
|
+
return this.getAttribute("align-content--laptop");
|
|
255
|
+
}
|
|
256
|
+
set alignContentLaptop(e) {
|
|
257
|
+
this._updateAttribute("align-content--laptop", e);
|
|
258
|
+
}
|
|
259
|
+
get alignItemsLaptop() {
|
|
260
|
+
return this.getAttribute("align-items--laptop");
|
|
261
|
+
}
|
|
262
|
+
set alignItemsLaptop(e) {
|
|
263
|
+
this._updateAttribute("align-items--laptop", e);
|
|
264
|
+
}
|
|
265
|
+
get justifyContentDesktop() {
|
|
266
|
+
return this.getAttribute("justify-content--desktop");
|
|
267
|
+
}
|
|
268
|
+
set justifyContentDesktop(e) {
|
|
269
|
+
this._updateAttribute("justify-content--desktop", e);
|
|
270
|
+
}
|
|
271
|
+
get justifyItemsDesktop() {
|
|
272
|
+
return this.getAttribute("justify-items--desktop");
|
|
273
|
+
}
|
|
274
|
+
set justifyItemsDesktop(e) {
|
|
275
|
+
this._updateAttribute("justify-items--desktop", e);
|
|
276
|
+
}
|
|
277
|
+
get alignContentDesktop() {
|
|
278
|
+
return this.getAttribute("align-content--desktop");
|
|
279
|
+
}
|
|
280
|
+
set alignContentDesktop(e) {
|
|
281
|
+
this._updateAttribute("align-content--desktop", e);
|
|
282
|
+
}
|
|
283
|
+
get alignItemsDesktop() {
|
|
284
|
+
return this.getAttribute("align-items--desktop");
|
|
285
|
+
}
|
|
286
|
+
set alignItemsDesktop(e) {
|
|
287
|
+
this._updateAttribute("align-items--desktop", e);
|
|
288
|
+
}
|
|
583
289
|
};
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
290
|
+
customElements.get("px-grid") || customElements.define("px-grid", h);
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/Banner.ts
|
|
293
|
+
var g = new CSSStyleSheet();
|
|
294
|
+
g.replaceSync(c);
|
|
295
|
+
var _ = class extends t {
|
|
296
|
+
static {
|
|
297
|
+
this.nativeName = "div";
|
|
298
|
+
}
|
|
299
|
+
constructor() {
|
|
300
|
+
super(g), this.observer = new MutationObserver(() => {
|
|
301
|
+
this.createGridTemplateAreas(), this.createGridding();
|
|
302
|
+
}), this.template = () => "<div class=\"banner\">\n <div class=\"contrast-helper\"></div>\n <px-container class=\"banner-container\" padding--mobile=\"m\" border-radius=\"main\" >\n <px-vstack>\n <px-grid gap=\"none\">\n <px-container padding=\"none\" background-color=\"none\">\n <div class=\"banner-content\">\n <slot name=\"tag\"></slot>\n <slot name=\"media\"></slot>\n <slot name=\"title\"></slot>\n <slot name=\"description\"></slot>\n <slot name=\"content\"></slot>\n </div>\n </px-container>\n </px-grid>\n <slot name=\"action\"></slot>\n </px-vstack>\n </px-container>\n </div>", this.shadowRoot.innerHTML = this.template();
|
|
303
|
+
}
|
|
304
|
+
static get observedAttributes() {
|
|
305
|
+
return [
|
|
306
|
+
...super.observedAttributes,
|
|
307
|
+
"background-color",
|
|
308
|
+
"background-gradient",
|
|
309
|
+
"background-image",
|
|
310
|
+
"background-image--mobile",
|
|
311
|
+
"background-image--tablet",
|
|
312
|
+
"background-image--laptop",
|
|
313
|
+
"background-size",
|
|
314
|
+
"background-position",
|
|
315
|
+
"contrast-helper-gradient",
|
|
316
|
+
"contrast-helper-overlay",
|
|
317
|
+
"has-gridding",
|
|
318
|
+
"has-gridding--mobile",
|
|
319
|
+
"has-gridding--tablet",
|
|
320
|
+
"has-gridding--laptop",
|
|
321
|
+
"reduced",
|
|
322
|
+
"inverted"
|
|
323
|
+
];
|
|
324
|
+
}
|
|
325
|
+
connectedCallback() {
|
|
326
|
+
super.connectedCallback?.(), this.#e(), this.createGridTemplateAreas(), this.createGridding(), this.observer.observe(this, {
|
|
327
|
+
childList: !0,
|
|
328
|
+
subtree: !0
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
#e() {
|
|
332
|
+
this.$container.setAttribute("padding", this.reduced ? "m" : "l");
|
|
333
|
+
}
|
|
334
|
+
attributeChangedCallback(e, t, i) {
|
|
335
|
+
if (t !== i) switch (e) {
|
|
336
|
+
case "background-color":
|
|
337
|
+
this.$container.backgroundColor = n.indexOf(i) > 0 ? i : "none";
|
|
338
|
+
break;
|
|
339
|
+
case "background-gradient":
|
|
340
|
+
this.$container.gradient = o.indexOf(i) > 0 ? i : "none";
|
|
341
|
+
break;
|
|
342
|
+
case "background-image":
|
|
343
|
+
this.$container.backgroundImage = i;
|
|
344
|
+
break;
|
|
345
|
+
case "background-image--mobile":
|
|
346
|
+
this.$container.backgroundImageMobile = i;
|
|
347
|
+
break;
|
|
348
|
+
case "background-image--tablet":
|
|
349
|
+
this.$container.backgroundImageTablet = i;
|
|
350
|
+
break;
|
|
351
|
+
case "background-image--laptop":
|
|
352
|
+
this.$container.backgroundImageLaptop = i;
|
|
353
|
+
break;
|
|
354
|
+
case "background-size":
|
|
355
|
+
this.$container.backgroundSize = r.indexOf(i) > 0 ? i : "";
|
|
356
|
+
break;
|
|
357
|
+
case "background-position":
|
|
358
|
+
this.$container.backgroundPosition = i;
|
|
359
|
+
break;
|
|
360
|
+
case "reduced":
|
|
361
|
+
this.$el.toggleAttribute("reduced", i !== null), this.isConnected && this.#e(), this.createGridTemplateAreas();
|
|
362
|
+
break;
|
|
363
|
+
case "has-gridding":
|
|
364
|
+
case "has-gridding--mobile":
|
|
365
|
+
case "has-gridding--tablet":
|
|
366
|
+
case "has-gridding--laptop":
|
|
367
|
+
this.createGridding(i);
|
|
368
|
+
break;
|
|
369
|
+
case "inverted":
|
|
370
|
+
for (let e = 0; e < this.$children.length; e++) this.$children[e].hasAttribute("inverted") || this.$children[e].toggleAttribute("inverted");
|
|
371
|
+
this.$el.toggleAttribute("inverted", i !== null);
|
|
372
|
+
break;
|
|
373
|
+
default: super.attributeChangedCallback(e, t, i);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
disconnectedCallback() {
|
|
377
|
+
this.observer.disconnect();
|
|
378
|
+
}
|
|
379
|
+
createGridTemplateAreas() {
|
|
380
|
+
let e = this.shadowRoot.querySelector(".banner-content"), t = [
|
|
381
|
+
"tag",
|
|
382
|
+
"media",
|
|
383
|
+
"title",
|
|
384
|
+
"description",
|
|
385
|
+
"content",
|
|
386
|
+
"action"
|
|
387
|
+
], n = "";
|
|
388
|
+
this.reduced ? t.forEach((e) => {
|
|
389
|
+
let t = this.shadowRoot.querySelector(`slot[name="${e}"]`);
|
|
390
|
+
if (t && t.assignedElements().length > 0) {
|
|
391
|
+
if (e === "media") return;
|
|
392
|
+
n += `'media ${e}'\n`;
|
|
393
|
+
}
|
|
394
|
+
}) : t.forEach((e) => {
|
|
395
|
+
let t = this.shadowRoot.querySelector(`slot[name="${e}"]`);
|
|
396
|
+
t && t.assignedElements().length > 0 && (n += `'${e}'\n`);
|
|
397
|
+
}), n ||= "'content'", e.style.gridTemplateAreas = n;
|
|
398
|
+
}
|
|
399
|
+
createGridding(e) {
|
|
400
|
+
let t = [
|
|
401
|
+
{
|
|
402
|
+
prop: "hasGridding",
|
|
403
|
+
gridAttr: "grid-cols",
|
|
404
|
+
attr: "col-span"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
prop: "hasGriddingMobile",
|
|
408
|
+
gridAttr: "grid-cols--mobile",
|
|
409
|
+
attr: "col-span--mobile"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
prop: "hasGriddingTablet",
|
|
413
|
+
gridAttr: "grid-cols--tablet",
|
|
414
|
+
attr: "col-span--tablet"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
prop: "hasGriddingLaptop",
|
|
418
|
+
gridAttr: "grid-cols--laptop",
|
|
419
|
+
attr: "col-span--laptop"
|
|
420
|
+
}
|
|
421
|
+
], n = this.shadowRoot.querySelector("px-grid > px-container");
|
|
422
|
+
e === null ? t.forEach(({ gridAttr: e, attr: t }) => {
|
|
423
|
+
this.$grid.setAttribute(e, "1"), n.setAttribute(t, "1");
|
|
424
|
+
}) : t.forEach(({ prop: e, gridAttr: t, attr: r }) => {
|
|
425
|
+
this[e] && (this.$grid.setAttribute(t, "3"), n.setAttribute(r, "2"));
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
get $grid() {
|
|
429
|
+
return this.shadowRoot.querySelector("px-grid");
|
|
430
|
+
}
|
|
431
|
+
get $container() {
|
|
432
|
+
return this.shadowRoot.querySelector(".banner-container");
|
|
433
|
+
}
|
|
434
|
+
get $children() {
|
|
435
|
+
return this.querySelectorAll("px-banner > *");
|
|
436
|
+
}
|
|
437
|
+
get backgroundColor() {
|
|
438
|
+
return this.getAttribute("background-color");
|
|
439
|
+
}
|
|
440
|
+
set backgroundColor(e) {
|
|
441
|
+
this._updateAttribute("background-color", e);
|
|
442
|
+
}
|
|
443
|
+
get gradient() {
|
|
444
|
+
return this.getAttribute("background-gradient");
|
|
445
|
+
}
|
|
446
|
+
set gradient(e) {
|
|
447
|
+
this._updateAttribute("background-gradient", e);
|
|
448
|
+
}
|
|
449
|
+
get backgroundImage() {
|
|
450
|
+
return this.getAttribute("background-image");
|
|
451
|
+
}
|
|
452
|
+
set backgroundImage(e) {
|
|
453
|
+
this._updateAttribute("background-image", e);
|
|
454
|
+
}
|
|
455
|
+
get backgroundImageMobile() {
|
|
456
|
+
return this.getAttribute("background-image--mobile");
|
|
457
|
+
}
|
|
458
|
+
set backgroundImageMobile(e) {
|
|
459
|
+
this._updateAttribute("background-image--mobile", e);
|
|
460
|
+
}
|
|
461
|
+
get backgroundImageTablet() {
|
|
462
|
+
return this.getAttribute("background-image--tablet");
|
|
463
|
+
}
|
|
464
|
+
set backgroundImageTablet(e) {
|
|
465
|
+
this._updateAttribute("background-image--tablet", e);
|
|
466
|
+
}
|
|
467
|
+
get backgroundImageLaptop() {
|
|
468
|
+
return this.getAttribute("background-image--laptop");
|
|
469
|
+
}
|
|
470
|
+
set backgroundImageLaptop(e) {
|
|
471
|
+
this._updateAttribute("background-image--laptop", e);
|
|
472
|
+
}
|
|
473
|
+
get backgroundSize() {
|
|
474
|
+
return this.getAttribute("background-size");
|
|
475
|
+
}
|
|
476
|
+
set backgroundSize(e) {
|
|
477
|
+
this._updateAttribute("background-size", e);
|
|
478
|
+
}
|
|
479
|
+
get backgroundPosition() {
|
|
480
|
+
return this.getAttribute("background-position");
|
|
481
|
+
}
|
|
482
|
+
set backgroundPosition(e) {
|
|
483
|
+
this._updateAttribute("background-position", e);
|
|
484
|
+
}
|
|
485
|
+
get gradientContrastHelper() {
|
|
486
|
+
return this.hasAttribute("contrast-helper-gradient");
|
|
487
|
+
}
|
|
488
|
+
set gradientContrastHelper(e) {
|
|
489
|
+
this._updateBooleanAttribute("contrast-helper-gradient", e);
|
|
490
|
+
}
|
|
491
|
+
get overlayContrastHelper() {
|
|
492
|
+
return this.hasAttribute("contrast-helper-overlay");
|
|
493
|
+
}
|
|
494
|
+
set overlayContrastHelper(e) {
|
|
495
|
+
this._updateBooleanAttribute("contrast-helper-overlay", e);
|
|
496
|
+
}
|
|
497
|
+
get inverted() {
|
|
498
|
+
return this.hasAttribute("inverted");
|
|
499
|
+
}
|
|
500
|
+
set inverted(e) {
|
|
501
|
+
this._updateBooleanAttribute("inverted", e);
|
|
502
|
+
}
|
|
503
|
+
get reduced() {
|
|
504
|
+
return this.hasAttribute("reduced");
|
|
505
|
+
}
|
|
506
|
+
set reduced(e) {
|
|
507
|
+
this._updateBooleanAttribute("reduced", e);
|
|
508
|
+
}
|
|
509
|
+
get hasGridding() {
|
|
510
|
+
return this.hasAttribute("has-gridding");
|
|
511
|
+
}
|
|
512
|
+
set hasGridding(e) {
|
|
513
|
+
this._updateBooleanAttribute("has-gridding", e);
|
|
514
|
+
}
|
|
515
|
+
get hasGriddingMobile() {
|
|
516
|
+
return this.hasAttribute("has-gridding--mobile");
|
|
517
|
+
}
|
|
518
|
+
set hasGriddingMobile(e) {
|
|
519
|
+
this._updateBooleanAttribute("has-gridding--mobile", e);
|
|
520
|
+
}
|
|
521
|
+
get hasGriddingTablet() {
|
|
522
|
+
return this.hasAttribute("has-gridding--tablet");
|
|
523
|
+
}
|
|
524
|
+
set hasGriddingTablet(e) {
|
|
525
|
+
this._updateBooleanAttribute("has-gridding--tablet", e);
|
|
526
|
+
}
|
|
527
|
+
get hasGriddingLaptop() {
|
|
528
|
+
return this.hasAttribute("has-gridding--laptop");
|
|
529
|
+
}
|
|
530
|
+
set hasGriddingLaptop(e) {
|
|
531
|
+
this._updateBooleanAttribute("has-gridding--laptop", e);
|
|
532
|
+
}
|
|
591
533
|
};
|
|
534
|
+
customElements.get("px-banner") || customElements.define("px-banner", _);
|
|
535
|
+
//#endregion
|
|
536
|
+
export { _ as Banner };
|