@proximus/lavender-banner 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Banner.d.ts +7 -5
- package/dist/index.es.js +343 -30
- package/package.json +1 -1
package/dist/Banner.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Container } from '@proximus/lavender-container';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import type { Container } from '@proximus/lavender-container';
|
|
2
|
+
import '@proximus/lavender-container';
|
|
3
|
+
import type { Grid } from '@proximus/lavender-grid';
|
|
4
|
+
import '@proximus/lavender-grid';
|
|
5
|
+
import { VerticallyExtendedElement } from '@proximus/lavender-common';
|
|
6
|
+
export declare class Banner extends VerticallyExtendedElement<HTMLDivElement> {
|
|
5
7
|
static nativeName: string;
|
|
6
8
|
private template;
|
|
7
9
|
constructor();
|
|
@@ -9,7 +11,7 @@ export declare class Banner extends PxElement<HTMLDivElement> {
|
|
|
9
11
|
connectedCallback(): void;
|
|
10
12
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
11
13
|
createGridTemplateAreas(): void;
|
|
12
|
-
createGridding(): void;
|
|
14
|
+
createGridding(value?: string): void;
|
|
13
15
|
get $grid(): Grid;
|
|
14
16
|
get $container(): Container;
|
|
15
17
|
get $children(): NodeListOf<Element>;
|
package/dist/index.es.js
CHANGED
|
@@ -1,9 +1,320 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
s.
|
|
4
|
-
|
|
1
|
+
import "@proximus/lavender-container";
|
|
2
|
+
import { cssTokenBreakpoints as p, gapValues as b, PxElement as m, VerticallyExtendedElement as h, backgroundSizeValues as f, gradientValues as y, backgroundColorValues as j } from "@proximus/lavender-common";
|
|
3
|
+
const k = ':host{position:relative}:host,:host>*{display:block;box-sizing:border-box}.banner{position:relative;min-height:8em}.banner[reduced]{min-height:5em}px-container{height:100%}.banner-content{display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,auto);row-gap:var(--px-spacing-s-mobile);z-index:2;position:relative}[reduced] .banner-content{grid-template-columns:min-content minmax(0,1fr);column-gap:var(--px-spacing-default-mobile)}::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}:host(:not([reduced])) ::slotted([slot="action"]){grid-area:action;margin-top:calc(var(--px-spacing-default-mobile) - var(--px-spacing-s-mobile))}.contrast-helper{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:none;display:none;border-radius:var(--px-radius-main)}[contrast-helper-gradient] .contrast-helper{display:block;background-image:linear-gradient(90deg,#fff 23.43%,#fff0 81.69%)}[inverted] :is([contrast-helper-gradient] .contrast-helper){background-image:linear-gradient(90deg,#000 23.43%,#0000 81.69%)}[contrast-helper-overlay] .contrast-helper{display:block;background-color:#ffffffb3}[inverted] :is([contrast-helper-overlay] .contrast-helper){background-color:#0006}@media only screen and (min-width: 48em){.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 only screen and (min-width: 64.0625em){.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))}}', A = ":host{display:block;--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}.grid{display: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)}.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 only screen and (max-width: 767px){.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 only screen and (min-width: 48em) and (max-width: 64em){.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 only screen and (min-width: 64.0625em){.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}}", c = new CSSStyleSheet();
|
|
4
|
+
c.replaceSync(A);
|
|
5
|
+
const v = [
|
|
6
|
+
"1",
|
|
7
|
+
"2",
|
|
8
|
+
"3",
|
|
9
|
+
"4",
|
|
10
|
+
"5",
|
|
11
|
+
"6",
|
|
12
|
+
"7",
|
|
13
|
+
"8",
|
|
14
|
+
"9",
|
|
15
|
+
"10",
|
|
16
|
+
"11",
|
|
17
|
+
"12"
|
|
18
|
+
], C = [
|
|
19
|
+
"",
|
|
20
|
+
"start",
|
|
21
|
+
"end",
|
|
22
|
+
"center",
|
|
23
|
+
"space-between",
|
|
24
|
+
"space-around",
|
|
25
|
+
"space-evenly",
|
|
26
|
+
"stretch"
|
|
27
|
+
], x = ["", "start", "end", "center", "stretch"], $ = (d, t, i) => `:host([${d}${i ? `--${i}` : ""}='${t}']) .grid`, I = "px-spacing", S = p(
|
|
28
|
+
"gap",
|
|
29
|
+
$,
|
|
30
|
+
b,
|
|
31
|
+
I,
|
|
32
|
+
"--grid-gap"
|
|
33
|
+
), o = class o extends m {
|
|
5
34
|
constructor() {
|
|
6
|
-
super(
|
|
35
|
+
super(c, S), this.template = () => `<div class="grid">
|
|
36
|
+
<slot></slot>
|
|
37
|
+
</div>`, this.shadowRoot.innerHTML = this.template();
|
|
38
|
+
}
|
|
39
|
+
static get observedAttributes() {
|
|
40
|
+
return [
|
|
41
|
+
...super.observedAttributes,
|
|
42
|
+
"grid-cols",
|
|
43
|
+
"grid-cols--mobile",
|
|
44
|
+
"grid-cols--tablet",
|
|
45
|
+
"grid-cols--laptop",
|
|
46
|
+
"justify-content",
|
|
47
|
+
"justify-items",
|
|
48
|
+
"align-content",
|
|
49
|
+
"align-items",
|
|
50
|
+
"justify-content--mobile",
|
|
51
|
+
"justify-items--mobile",
|
|
52
|
+
"align-content--mobile",
|
|
53
|
+
"align-items--mobile",
|
|
54
|
+
"justify-content--tablet",
|
|
55
|
+
"justify-items--tablet",
|
|
56
|
+
"align-content--tablet",
|
|
57
|
+
"align-items--tablet",
|
|
58
|
+
"justify-content--laptop",
|
|
59
|
+
"justify-items--laptop",
|
|
60
|
+
"align-content--laptop",
|
|
61
|
+
"align-items--laptop",
|
|
62
|
+
"justify-content--desktop",
|
|
63
|
+
"justify-items--desktop",
|
|
64
|
+
"align-content--desktop",
|
|
65
|
+
"align-items--desktop"
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
connectedCallback() {
|
|
69
|
+
this.gap || (this.gap = "default"), this.alignItems || (this.alignItems = "stretch");
|
|
70
|
+
}
|
|
71
|
+
attributeChangedCallback(t, i, e) {
|
|
72
|
+
if (i !== e)
|
|
73
|
+
switch (t) {
|
|
74
|
+
case "grid-cols":
|
|
75
|
+
case "grid-cols--mobile":
|
|
76
|
+
case "grid-cols--tablet":
|
|
77
|
+
case "grid-cols--laptop":
|
|
78
|
+
this.updateAttribute(t, i, e, v);
|
|
79
|
+
break;
|
|
80
|
+
case "justify-content":
|
|
81
|
+
case "align-content":
|
|
82
|
+
case "justify-content--mobile":
|
|
83
|
+
case "align-content--mobile":
|
|
84
|
+
case "justify-content--tablet":
|
|
85
|
+
case "align-content--tablet":
|
|
86
|
+
case "justify-content--laptop":
|
|
87
|
+
case "align-content--laptop":
|
|
88
|
+
case "justify-content--desktop":
|
|
89
|
+
case "align-content--desktop":
|
|
90
|
+
this.updateAttribute(
|
|
91
|
+
t,
|
|
92
|
+
i,
|
|
93
|
+
e,
|
|
94
|
+
C
|
|
95
|
+
);
|
|
96
|
+
break;
|
|
97
|
+
case "justify-items":
|
|
98
|
+
case "align-items":
|
|
99
|
+
case "justify-items--mobile":
|
|
100
|
+
case "align-items--mobile":
|
|
101
|
+
case "justify-items--tablet":
|
|
102
|
+
case "align-items--tablet":
|
|
103
|
+
case "justify-items--laptop":
|
|
104
|
+
case "align-items--laptop":
|
|
105
|
+
case "justify-items--desktop":
|
|
106
|
+
case "align-items--desktop":
|
|
107
|
+
this.updateAttribute(
|
|
108
|
+
t,
|
|
109
|
+
i,
|
|
110
|
+
e,
|
|
111
|
+
x
|
|
112
|
+
);
|
|
113
|
+
break;
|
|
114
|
+
default:
|
|
115
|
+
super.attributeChangedCallback(t, i, e);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
updateGap(t, i, e) {
|
|
120
|
+
if (!this.checkName(e, i)) {
|
|
121
|
+
console.error(`${i} is not a valid gap value`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const n = (s) => {
|
|
125
|
+
s !== null && s !== "" && s !== "default" && (this.$el.style.setProperty(
|
|
126
|
+
"--grid-gap--mobile",
|
|
127
|
+
`var(--px-spacing-${s}-mobile)`
|
|
128
|
+
), this.$el.style.setProperty(
|
|
129
|
+
"--grid-gap--tablet",
|
|
130
|
+
`var(--px-spacing-${s}-tablet)`
|
|
131
|
+
), this.$el.style.setProperty(
|
|
132
|
+
"--grid-gap--laptop",
|
|
133
|
+
`var(--px-spacing-${s}-laptop)`
|
|
134
|
+
));
|
|
135
|
+
};
|
|
136
|
+
n(t), n(i);
|
|
137
|
+
}
|
|
138
|
+
updateAttribute(t, i, e, n) {
|
|
139
|
+
this.checkName(n, e) ? t === "grid-cols" || t === "grid-cols--mobile" || t === "grid-cols--tablet" || t === "grid-cols--laptop" || t === "grid-cols--desktop" ? this.$el.style.setProperty(`--${t}`, e) : (i !== null && i !== "" && i !== "default" && this.$el.classList.toggle(`${t}-${i}`), e !== null && e !== "" && e !== "default" && this.$el.classList.toggle(`${t}-${e}`)) : console.error(`${e} is not an allowed ${t} value`);
|
|
140
|
+
}
|
|
141
|
+
get gap() {
|
|
142
|
+
return this.getAttribute("gap");
|
|
143
|
+
}
|
|
144
|
+
set gap(t) {
|
|
145
|
+
this.setAttribute("gap", t);
|
|
146
|
+
}
|
|
147
|
+
get gapMobile() {
|
|
148
|
+
return this.getAttribute("gap--mobile");
|
|
149
|
+
}
|
|
150
|
+
set gapMobile(t) {
|
|
151
|
+
this.setAttribute("gap--mobile", t);
|
|
152
|
+
}
|
|
153
|
+
get gapTablet() {
|
|
154
|
+
return this.getAttribute("gap--tablet");
|
|
155
|
+
}
|
|
156
|
+
set gapTablet(t) {
|
|
157
|
+
this.setAttribute("gap--tablet", t);
|
|
158
|
+
}
|
|
159
|
+
get gapLaptop() {
|
|
160
|
+
return this.getAttribute("gap--laptop");
|
|
161
|
+
}
|
|
162
|
+
set gapLaptop(t) {
|
|
163
|
+
this.setAttribute("gap--laptop", t);
|
|
164
|
+
}
|
|
165
|
+
get gridCols() {
|
|
166
|
+
return this.getAttribute("grid-cols");
|
|
167
|
+
}
|
|
168
|
+
set gridCols(t) {
|
|
169
|
+
this.setAttribute("grid-cols", t);
|
|
170
|
+
}
|
|
171
|
+
get gridColsMobile() {
|
|
172
|
+
return this.getAttribute("grid-cols--mobile");
|
|
173
|
+
}
|
|
174
|
+
set gridColsMobile(t) {
|
|
175
|
+
this.setAttribute("grid-cols--mobile", t);
|
|
176
|
+
}
|
|
177
|
+
get gridColsTablet() {
|
|
178
|
+
return this.getAttribute("grid-cols--tablet");
|
|
179
|
+
}
|
|
180
|
+
set gridColsTablet(t) {
|
|
181
|
+
this.setAttribute("grid-cols--tablet", t);
|
|
182
|
+
}
|
|
183
|
+
get gridColsLaptop() {
|
|
184
|
+
return this.getAttribute("grid-cols--laptop");
|
|
185
|
+
}
|
|
186
|
+
set gridColsLaptop(t) {
|
|
187
|
+
this.setAttribute("grid-cols--laptop", t);
|
|
188
|
+
}
|
|
189
|
+
get justifyContent() {
|
|
190
|
+
return this.getAttribute("justify-content");
|
|
191
|
+
}
|
|
192
|
+
set justifyContent(t) {
|
|
193
|
+
this.setAttribute("justify-content", t);
|
|
194
|
+
}
|
|
195
|
+
get justifyItems() {
|
|
196
|
+
return this.getAttribute("justify-items");
|
|
197
|
+
}
|
|
198
|
+
set justifyItems(t) {
|
|
199
|
+
this.setAttribute("justify-items", t);
|
|
200
|
+
}
|
|
201
|
+
get alignContent() {
|
|
202
|
+
return this.getAttribute("align-content");
|
|
203
|
+
}
|
|
204
|
+
set alignContent(t) {
|
|
205
|
+
this.setAttribute("align-content", t);
|
|
206
|
+
}
|
|
207
|
+
get alignItems() {
|
|
208
|
+
return this.getAttribute("align-items");
|
|
209
|
+
}
|
|
210
|
+
set alignItems(t) {
|
|
211
|
+
this.setAttribute("align-items", t);
|
|
212
|
+
}
|
|
213
|
+
get justifyContentMobile() {
|
|
214
|
+
return this.getAttribute("justify-content--mobile");
|
|
215
|
+
}
|
|
216
|
+
set justifyContentMobile(t) {
|
|
217
|
+
this.setAttribute("justify-content--mobile", t);
|
|
218
|
+
}
|
|
219
|
+
get justifyItemsMobile() {
|
|
220
|
+
return this.getAttribute("justify-items--mobile");
|
|
221
|
+
}
|
|
222
|
+
set justifyItemsMobile(t) {
|
|
223
|
+
this.setAttribute("justify-items--mobile", t);
|
|
224
|
+
}
|
|
225
|
+
get alignContentMobile() {
|
|
226
|
+
return this.getAttribute("align-content--mobile");
|
|
227
|
+
}
|
|
228
|
+
set alignContentMobile(t) {
|
|
229
|
+
this.setAttribute("align-content--mobile", t);
|
|
230
|
+
}
|
|
231
|
+
get alignItemsMobile() {
|
|
232
|
+
return this.getAttribute("align-items--mobile");
|
|
233
|
+
}
|
|
234
|
+
set alignItemsMobile(t) {
|
|
235
|
+
this.setAttribute("align-items--mobile", t);
|
|
236
|
+
}
|
|
237
|
+
get justifyContentTablet() {
|
|
238
|
+
return this.getAttribute("justify-content--tablet");
|
|
239
|
+
}
|
|
240
|
+
set justifyContentTablet(t) {
|
|
241
|
+
this.setAttribute("justify-content--tablet", t);
|
|
242
|
+
}
|
|
243
|
+
get justifyItemsTablet() {
|
|
244
|
+
return this.getAttribute("justify-items--tablet");
|
|
245
|
+
}
|
|
246
|
+
set justifyItemsTablet(t) {
|
|
247
|
+
this.setAttribute("justify-items--tablet", t);
|
|
248
|
+
}
|
|
249
|
+
get alignContentTablet() {
|
|
250
|
+
return this.getAttribute("align-content--tablet");
|
|
251
|
+
}
|
|
252
|
+
set alignContentTablet(t) {
|
|
253
|
+
this.setAttribute("align-content--tablet", t);
|
|
254
|
+
}
|
|
255
|
+
get alignItemsTablet() {
|
|
256
|
+
return this.getAttribute("align-items--tablet");
|
|
257
|
+
}
|
|
258
|
+
set alignItemsTablet(t) {
|
|
259
|
+
this.setAttribute("align-items--tablet", t);
|
|
260
|
+
}
|
|
261
|
+
get justifyContentLaptop() {
|
|
262
|
+
return this.getAttribute("justify-content--laptop");
|
|
263
|
+
}
|
|
264
|
+
set justifyContentLaptop(t) {
|
|
265
|
+
this.setAttribute("justify-content--laptop", t);
|
|
266
|
+
}
|
|
267
|
+
get justifyItemsLaptop() {
|
|
268
|
+
return this.getAttribute("justify-items--laptop");
|
|
269
|
+
}
|
|
270
|
+
set justifyItemsLaptop(t) {
|
|
271
|
+
this.setAttribute("justify-items--laptop", t);
|
|
272
|
+
}
|
|
273
|
+
get alignContentLaptop() {
|
|
274
|
+
return this.getAttribute("align-content--laptop");
|
|
275
|
+
}
|
|
276
|
+
set alignContentLaptop(t) {
|
|
277
|
+
this.setAttribute("align-content--laptop", t);
|
|
278
|
+
}
|
|
279
|
+
get alignItemsLaptop() {
|
|
280
|
+
return this.getAttribute("align-items--laptop");
|
|
281
|
+
}
|
|
282
|
+
set alignItemsLaptop(t) {
|
|
283
|
+
this.setAttribute("align-items--laptop", t);
|
|
284
|
+
}
|
|
285
|
+
get justifyContentDesktop() {
|
|
286
|
+
return this.getAttribute("justify-content--desktop");
|
|
287
|
+
}
|
|
288
|
+
set justifyContentDesktop(t) {
|
|
289
|
+
this.setAttribute("justify-content--desktop", t);
|
|
290
|
+
}
|
|
291
|
+
get justifyItemsDesktop() {
|
|
292
|
+
return this.getAttribute("justify-items--desktop");
|
|
293
|
+
}
|
|
294
|
+
set justifyItemsDesktop(t) {
|
|
295
|
+
this.setAttribute("justify-items--desktop", t);
|
|
296
|
+
}
|
|
297
|
+
get alignContentDesktop() {
|
|
298
|
+
return this.getAttribute("align-content--desktop");
|
|
299
|
+
}
|
|
300
|
+
set alignContentDesktop(t) {
|
|
301
|
+
this.setAttribute("align-content--desktop", t);
|
|
302
|
+
}
|
|
303
|
+
get alignItemsDesktop() {
|
|
304
|
+
return this.getAttribute("align-items--desktop");
|
|
305
|
+
}
|
|
306
|
+
set alignItemsDesktop(t) {
|
|
307
|
+
this.setAttribute("align-items--desktop", t);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
o.nativeName = "div";
|
|
311
|
+
let a = o;
|
|
312
|
+
customElements.get("px-grid") || customElements.define("px-grid", a);
|
|
313
|
+
const g = new CSSStyleSheet();
|
|
314
|
+
g.replaceSync(k);
|
|
315
|
+
const l = class l extends h {
|
|
316
|
+
constructor() {
|
|
317
|
+
super(g), this.template = () => `<div class="banner">
|
|
7
318
|
<div class="contrast-helper"></div>
|
|
8
319
|
<px-container class="banner-container" padding="${this.reduced ? "m" : "l"}" padding--mobile="m" border-radius="main" >
|
|
9
320
|
<px-grid gap="none">
|
|
@@ -49,10 +360,10 @@ const o = class o extends d {
|
|
|
49
360
|
if (i !== e)
|
|
50
361
|
switch (t) {
|
|
51
362
|
case "background-color":
|
|
52
|
-
this.$container.backgroundColor =
|
|
363
|
+
this.$container.backgroundColor = j.indexOf(e) > 0 ? e : "none";
|
|
53
364
|
break;
|
|
54
365
|
case "background-gradient":
|
|
55
|
-
this.$container.gradient =
|
|
366
|
+
this.$container.gradient = y.indexOf(e) > 0 ? e : "none";
|
|
56
367
|
break;
|
|
57
368
|
case "background-image":
|
|
58
369
|
this.$container.backgroundImage = e;
|
|
@@ -67,7 +378,7 @@ const o = class o extends d {
|
|
|
67
378
|
this.$container.backgroundImageLaptop = e;
|
|
68
379
|
break;
|
|
69
380
|
case "background-size":
|
|
70
|
-
this.$container.backgroundSize =
|
|
381
|
+
this.$container.backgroundSize = f.indexOf(e) > 0 ? e : "";
|
|
71
382
|
break;
|
|
72
383
|
case "background-position":
|
|
73
384
|
this.$container.backgroundPosition = e;
|
|
@@ -79,11 +390,11 @@ const o = class o extends d {
|
|
|
79
390
|
case "has-gridding--mobile":
|
|
80
391
|
case "has-gridding--tablet":
|
|
81
392
|
case "has-gridding--laptop":
|
|
82
|
-
this.createGridding();
|
|
393
|
+
this.createGridding(e);
|
|
83
394
|
break;
|
|
84
395
|
case "inverted":
|
|
85
|
-
for (let
|
|
86
|
-
this.$children[
|
|
396
|
+
for (let n = 0; n < this.$children.length; n++)
|
|
397
|
+
this.$children[n].hasAttribute("inverted") || this.$children[n].toggleAttribute("inverted");
|
|
87
398
|
this.$el.toggleAttribute("inverted", e !== null);
|
|
88
399
|
break;
|
|
89
400
|
default:
|
|
@@ -96,25 +407,25 @@ const o = class o extends d {
|
|
|
96
407
|
".banner-content"
|
|
97
408
|
), i = ["tag", "media", "title", "description", "content", "action"];
|
|
98
409
|
let e = "";
|
|
99
|
-
this.reduced ? i.forEach((
|
|
100
|
-
const
|
|
101
|
-
`slot[name="${
|
|
410
|
+
this.reduced ? i.forEach((n) => {
|
|
411
|
+
const s = this.shadowRoot.querySelector(
|
|
412
|
+
`slot[name="${n}"]`
|
|
102
413
|
);
|
|
103
|
-
if (
|
|
104
|
-
if (
|
|
105
|
-
e += `'media ${
|
|
414
|
+
if (s && s.assignedElements().length > 0) {
|
|
415
|
+
if (n === "media") return;
|
|
416
|
+
e += `'media ${n}'
|
|
106
417
|
`;
|
|
107
418
|
}
|
|
108
|
-
}) : i.forEach((
|
|
109
|
-
const
|
|
110
|
-
`slot[name="${
|
|
419
|
+
}) : i.forEach((n) => {
|
|
420
|
+
const s = this.shadowRoot.querySelector(
|
|
421
|
+
`slot[name="${n}"]`
|
|
111
422
|
);
|
|
112
|
-
|
|
423
|
+
s && s.assignedElements().length > 0 && (e += `'${n}'
|
|
113
424
|
`);
|
|
114
425
|
}), e || (e = "'content'"), t.style.gridTemplateAreas = e;
|
|
115
426
|
}
|
|
116
|
-
createGridding() {
|
|
117
|
-
const
|
|
427
|
+
createGridding(t) {
|
|
428
|
+
const i = [
|
|
118
429
|
{ prop: "hasGridding", gridProp: "gridCols", attr: "col-span" },
|
|
119
430
|
{
|
|
120
431
|
prop: "hasGriddingMobile",
|
|
@@ -131,11 +442,13 @@ const o = class o extends d {
|
|
|
131
442
|
gridProp: "gridColsLaptop",
|
|
132
443
|
attr: "col-span--laptop"
|
|
133
444
|
}
|
|
134
|
-
],
|
|
445
|
+
], e = this.shadowRoot.querySelector(
|
|
135
446
|
"px-grid > px-container"
|
|
136
447
|
);
|
|
137
|
-
t.forEach(({ prop:
|
|
138
|
-
this[
|
|
448
|
+
t !== null ? i.forEach(({ prop: n, gridProp: s, attr: u }) => {
|
|
449
|
+
this[n] && (this.$grid[s] = "3", e.setAttribute(u, "2"));
|
|
450
|
+
}) : i.forEach(({ gridProp: n, attr: s }) => {
|
|
451
|
+
this.$grid[n] = "1", e.removeAttribute(s);
|
|
139
452
|
});
|
|
140
453
|
}
|
|
141
454
|
get $grid() {
|
|
@@ -244,9 +557,9 @@ const o = class o extends d {
|
|
|
244
557
|
t ? this.setAttribute("has-gridding--laptop", "") : this.removeAttribute("has-gridding--laptop");
|
|
245
558
|
}
|
|
246
559
|
};
|
|
247
|
-
|
|
248
|
-
let
|
|
249
|
-
customElements.get("px-banner") || customElements.define("px-banner",
|
|
560
|
+
l.nativeName = "div";
|
|
561
|
+
let r = l;
|
|
562
|
+
customElements.get("px-banner") || customElements.define("px-banner", r);
|
|
250
563
|
export {
|
|
251
|
-
|
|
564
|
+
r as Banner
|
|
252
565
|
};
|