@proximus/lavender-banner 2.0.0-alpha.6 → 2.0.0-alpha.61
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 +9 -5
- package/dist/index.es.js +376 -48
- package/package.json +2 -2
package/dist/Banner.d.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
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;
|
|
8
|
+
observer: MutationObserver;
|
|
6
9
|
private template;
|
|
7
10
|
constructor();
|
|
8
11
|
static get observedAttributes(): string[];
|
|
9
12
|
connectedCallback(): void;
|
|
10
13
|
attributeChangedCallback(attrName: string, oldValue: string, newValue: string): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
11
15
|
createGridTemplateAreas(): void;
|
|
12
|
-
createGridding(): void;
|
|
16
|
+
createGridding(value?: string): void;
|
|
13
17
|
get $grid(): Grid;
|
|
14
18
|
get $container(): Container;
|
|
15
19
|
get $children(): NodeListOf<Element>;
|
package/dist/index.es.js
CHANGED
|
@@ -1,28 +1,346 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
s.
|
|
4
|
-
|
|
1
|
+
import "@proximus/lavender-container";
|
|
2
|
+
import { cssTokenBreakpoints as b, gapValues as m, PxElement as h, log as c, VerticallyExtendedElement as f, backgroundSizeValues as y, gradientValues as j, backgroundColorValues as k } from "@proximus/lavender-common";
|
|
3
|
+
const A = ':host{position:relative}:host,:host>*{display:block;box-sizing:border-box}.banner{position:relative;min-height:8rem;height:100%}.banner[reduced]{min-height:5rem}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}::slotted([slot="action"]){grid-area:action;z-index:2}:host(:not([reduced])) ::slotted([slot="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))}}', v = ":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}}", g = new CSSStyleSheet();
|
|
4
|
+
g.replaceSync(v);
|
|
5
|
+
const x = [
|
|
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
|
+
], $ = ["", "start", "end", "center", "stretch"], I = (u, t, i) => `:host([${u}${i ? `--${i}` : ""}='${t}']) .grid`, S = "px-spacing", T = b(
|
|
28
|
+
"gap",
|
|
29
|
+
I,
|
|
30
|
+
m,
|
|
31
|
+
S,
|
|
32
|
+
"--grid-gap"
|
|
33
|
+
), o = class o extends h {
|
|
5
34
|
constructor() {
|
|
6
|
-
super(
|
|
35
|
+
super(g, T), 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, x);
|
|
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
|
+
$
|
|
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
|
+
c(
|
|
122
|
+
`${i} is not an allowed gap value for ${this.tagName.toLowerCase()}`
|
|
123
|
+
);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const n = (s) => {
|
|
127
|
+
s !== null && s !== "" && s !== "default" && (this.$el.style.setProperty(
|
|
128
|
+
"--grid-gap--mobile",
|
|
129
|
+
`var(--px-spacing-${s}-mobile)`
|
|
130
|
+
), this.$el.style.setProperty(
|
|
131
|
+
"--grid-gap--tablet",
|
|
132
|
+
`var(--px-spacing-${s}-tablet)`
|
|
133
|
+
), this.$el.style.setProperty(
|
|
134
|
+
"--grid-gap--laptop",
|
|
135
|
+
`var(--px-spacing-${s}-laptop)`
|
|
136
|
+
));
|
|
137
|
+
};
|
|
138
|
+
n(t), n(i);
|
|
139
|
+
}
|
|
140
|
+
updateAttribute(t, i, e, n) {
|
|
141
|
+
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}`)) : c(
|
|
142
|
+
`${e} is not an allowed ${t} value for ${this.tagName.toLowerCase()}`
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
get gap() {
|
|
146
|
+
return this.getAttribute("gap");
|
|
147
|
+
}
|
|
148
|
+
set gap(t) {
|
|
149
|
+
this.setAttribute("gap", t);
|
|
150
|
+
}
|
|
151
|
+
get gapMobile() {
|
|
152
|
+
return this.getAttribute("gap--mobile");
|
|
153
|
+
}
|
|
154
|
+
set gapMobile(t) {
|
|
155
|
+
this.setAttribute("gap--mobile", t);
|
|
156
|
+
}
|
|
157
|
+
get gapTablet() {
|
|
158
|
+
return this.getAttribute("gap--tablet");
|
|
159
|
+
}
|
|
160
|
+
set gapTablet(t) {
|
|
161
|
+
this.setAttribute("gap--tablet", t);
|
|
162
|
+
}
|
|
163
|
+
get gapLaptop() {
|
|
164
|
+
return this.getAttribute("gap--laptop");
|
|
165
|
+
}
|
|
166
|
+
set gapLaptop(t) {
|
|
167
|
+
this.setAttribute("gap--laptop", t);
|
|
168
|
+
}
|
|
169
|
+
get gridCols() {
|
|
170
|
+
return this.getAttribute("grid-cols");
|
|
171
|
+
}
|
|
172
|
+
set gridCols(t) {
|
|
173
|
+
this.setAttribute("grid-cols", t);
|
|
174
|
+
}
|
|
175
|
+
get gridColsMobile() {
|
|
176
|
+
return this.getAttribute("grid-cols--mobile");
|
|
177
|
+
}
|
|
178
|
+
set gridColsMobile(t) {
|
|
179
|
+
this.setAttribute("grid-cols--mobile", t);
|
|
180
|
+
}
|
|
181
|
+
get gridColsTablet() {
|
|
182
|
+
return this.getAttribute("grid-cols--tablet");
|
|
183
|
+
}
|
|
184
|
+
set gridColsTablet(t) {
|
|
185
|
+
this.setAttribute("grid-cols--tablet", t);
|
|
186
|
+
}
|
|
187
|
+
get gridColsLaptop() {
|
|
188
|
+
return this.getAttribute("grid-cols--laptop");
|
|
189
|
+
}
|
|
190
|
+
set gridColsLaptop(t) {
|
|
191
|
+
this.setAttribute("grid-cols--laptop", t);
|
|
192
|
+
}
|
|
193
|
+
get justifyContent() {
|
|
194
|
+
return this.getAttribute("justify-content");
|
|
195
|
+
}
|
|
196
|
+
set justifyContent(t) {
|
|
197
|
+
this.setAttribute("justify-content", t);
|
|
198
|
+
}
|
|
199
|
+
get justifyItems() {
|
|
200
|
+
return this.getAttribute("justify-items");
|
|
201
|
+
}
|
|
202
|
+
set justifyItems(t) {
|
|
203
|
+
this.setAttribute("justify-items", t);
|
|
204
|
+
}
|
|
205
|
+
get alignContent() {
|
|
206
|
+
return this.getAttribute("align-content");
|
|
207
|
+
}
|
|
208
|
+
set alignContent(t) {
|
|
209
|
+
this.setAttribute("align-content", t);
|
|
210
|
+
}
|
|
211
|
+
get alignItems() {
|
|
212
|
+
return this.getAttribute("align-items");
|
|
213
|
+
}
|
|
214
|
+
set alignItems(t) {
|
|
215
|
+
this.setAttribute("align-items", t);
|
|
216
|
+
}
|
|
217
|
+
get justifyContentMobile() {
|
|
218
|
+
return this.getAttribute("justify-content--mobile");
|
|
219
|
+
}
|
|
220
|
+
set justifyContentMobile(t) {
|
|
221
|
+
this.setAttribute("justify-content--mobile", t);
|
|
222
|
+
}
|
|
223
|
+
get justifyItemsMobile() {
|
|
224
|
+
return this.getAttribute("justify-items--mobile");
|
|
225
|
+
}
|
|
226
|
+
set justifyItemsMobile(t) {
|
|
227
|
+
this.setAttribute("justify-items--mobile", t);
|
|
228
|
+
}
|
|
229
|
+
get alignContentMobile() {
|
|
230
|
+
return this.getAttribute("align-content--mobile");
|
|
231
|
+
}
|
|
232
|
+
set alignContentMobile(t) {
|
|
233
|
+
this.setAttribute("align-content--mobile", t);
|
|
234
|
+
}
|
|
235
|
+
get alignItemsMobile() {
|
|
236
|
+
return this.getAttribute("align-items--mobile");
|
|
237
|
+
}
|
|
238
|
+
set alignItemsMobile(t) {
|
|
239
|
+
this.setAttribute("align-items--mobile", t);
|
|
240
|
+
}
|
|
241
|
+
get justifyContentTablet() {
|
|
242
|
+
return this.getAttribute("justify-content--tablet");
|
|
243
|
+
}
|
|
244
|
+
set justifyContentTablet(t) {
|
|
245
|
+
this.setAttribute("justify-content--tablet", t);
|
|
246
|
+
}
|
|
247
|
+
get justifyItemsTablet() {
|
|
248
|
+
return this.getAttribute("justify-items--tablet");
|
|
249
|
+
}
|
|
250
|
+
set justifyItemsTablet(t) {
|
|
251
|
+
this.setAttribute("justify-items--tablet", t);
|
|
252
|
+
}
|
|
253
|
+
get alignContentTablet() {
|
|
254
|
+
return this.getAttribute("align-content--tablet");
|
|
255
|
+
}
|
|
256
|
+
set alignContentTablet(t) {
|
|
257
|
+
this.setAttribute("align-content--tablet", t);
|
|
258
|
+
}
|
|
259
|
+
get alignItemsTablet() {
|
|
260
|
+
return this.getAttribute("align-items--tablet");
|
|
261
|
+
}
|
|
262
|
+
set alignItemsTablet(t) {
|
|
263
|
+
this.setAttribute("align-items--tablet", t);
|
|
264
|
+
}
|
|
265
|
+
get justifyContentLaptop() {
|
|
266
|
+
return this.getAttribute("justify-content--laptop");
|
|
267
|
+
}
|
|
268
|
+
set justifyContentLaptop(t) {
|
|
269
|
+
this.setAttribute("justify-content--laptop", t);
|
|
270
|
+
}
|
|
271
|
+
get justifyItemsLaptop() {
|
|
272
|
+
return this.getAttribute("justify-items--laptop");
|
|
273
|
+
}
|
|
274
|
+
set justifyItemsLaptop(t) {
|
|
275
|
+
this.setAttribute("justify-items--laptop", t);
|
|
276
|
+
}
|
|
277
|
+
get alignContentLaptop() {
|
|
278
|
+
return this.getAttribute("align-content--laptop");
|
|
279
|
+
}
|
|
280
|
+
set alignContentLaptop(t) {
|
|
281
|
+
this.setAttribute("align-content--laptop", t);
|
|
282
|
+
}
|
|
283
|
+
get alignItemsLaptop() {
|
|
284
|
+
return this.getAttribute("align-items--laptop");
|
|
285
|
+
}
|
|
286
|
+
set alignItemsLaptop(t) {
|
|
287
|
+
this.setAttribute("align-items--laptop", t);
|
|
288
|
+
}
|
|
289
|
+
get justifyContentDesktop() {
|
|
290
|
+
return this.getAttribute("justify-content--desktop");
|
|
291
|
+
}
|
|
292
|
+
set justifyContentDesktop(t) {
|
|
293
|
+
this.setAttribute("justify-content--desktop", t);
|
|
294
|
+
}
|
|
295
|
+
get justifyItemsDesktop() {
|
|
296
|
+
return this.getAttribute("justify-items--desktop");
|
|
297
|
+
}
|
|
298
|
+
set justifyItemsDesktop(t) {
|
|
299
|
+
this.setAttribute("justify-items--desktop", t);
|
|
300
|
+
}
|
|
301
|
+
get alignContentDesktop() {
|
|
302
|
+
return this.getAttribute("align-content--desktop");
|
|
303
|
+
}
|
|
304
|
+
set alignContentDesktop(t) {
|
|
305
|
+
this.setAttribute("align-content--desktop", t);
|
|
306
|
+
}
|
|
307
|
+
get alignItemsDesktop() {
|
|
308
|
+
return this.getAttribute("align-items--desktop");
|
|
309
|
+
}
|
|
310
|
+
set alignItemsDesktop(t) {
|
|
311
|
+
this.setAttribute("align-items--desktop", t);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
o.nativeName = "div";
|
|
315
|
+
let a = o;
|
|
316
|
+
customElements.get("px-grid") || customElements.define("px-grid", a);
|
|
317
|
+
const d = new CSSStyleSheet();
|
|
318
|
+
d.replaceSync(A);
|
|
319
|
+
const l = class l extends f {
|
|
320
|
+
constructor() {
|
|
321
|
+
super(d), this.template = () => `<div class="banner">
|
|
7
322
|
<div class="contrast-helper"></div>
|
|
8
|
-
<px-container class="banner-container" padding
|
|
9
|
-
<px-
|
|
10
|
-
<px-
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
323
|
+
<px-container class="banner-container" padding--mobile="m" border-radius="main" >
|
|
324
|
+
<px-vstack>
|
|
325
|
+
<px-grid gap="none">
|
|
326
|
+
<px-container padding="none" background-color="none">
|
|
327
|
+
<div class="banner-content">
|
|
328
|
+
<slot name="tag"></slot>
|
|
329
|
+
<slot name="media"></slot>
|
|
330
|
+
<slot name="title"></slot>
|
|
331
|
+
<slot name="description"></slot>
|
|
332
|
+
<slot name="content"></slot>
|
|
333
|
+
</div>
|
|
334
|
+
</px-container>
|
|
335
|
+
</px-grid>
|
|
336
|
+
<slot name="action"></slot>
|
|
337
|
+
</px-vstack>
|
|
21
338
|
</px-container>
|
|
22
339
|
</div>`, this.shadowRoot.innerHTML = this.template();
|
|
23
340
|
}
|
|
24
341
|
static get observedAttributes() {
|
|
25
342
|
return [
|
|
343
|
+
...super.observedAttributes,
|
|
26
344
|
"background-color",
|
|
27
345
|
"background-gradient",
|
|
28
346
|
"background-image",
|
|
@@ -43,16 +361,21 @@ const o = class o extends d {
|
|
|
43
361
|
}
|
|
44
362
|
connectedCallback() {
|
|
45
363
|
var t;
|
|
46
|
-
(t = super.connectedCallback) == null || t.call(this), this.createGridTemplateAreas(), this.createGridding()
|
|
364
|
+
(t = super.connectedCallback) == null || t.call(this), this.reduced ? this.$container.setAttribute("padding", "m") : this.$container.setAttribute("padding", "l"), this.createGridTemplateAreas(), this.createGridding(), this.observer = new MutationObserver(() => {
|
|
365
|
+
this.createGridTemplateAreas(), this.createGridding();
|
|
366
|
+
}), this.observer.observe(this, {
|
|
367
|
+
childList: !0,
|
|
368
|
+
subtree: !0
|
|
369
|
+
});
|
|
47
370
|
}
|
|
48
371
|
attributeChangedCallback(t, i, e) {
|
|
49
372
|
if (i !== e)
|
|
50
373
|
switch (t) {
|
|
51
374
|
case "background-color":
|
|
52
|
-
this.$container.backgroundColor =
|
|
375
|
+
this.$container.backgroundColor = k.indexOf(e) > 0 ? e : "none";
|
|
53
376
|
break;
|
|
54
377
|
case "background-gradient":
|
|
55
|
-
this.$container.gradient =
|
|
378
|
+
this.$container.gradient = j.indexOf(e) > 0 ? e : "none";
|
|
56
379
|
break;
|
|
57
380
|
case "background-image":
|
|
58
381
|
this.$container.backgroundImage = e;
|
|
@@ -67,7 +390,7 @@ const o = class o extends d {
|
|
|
67
390
|
this.$container.backgroundImageLaptop = e;
|
|
68
391
|
break;
|
|
69
392
|
case "background-size":
|
|
70
|
-
this.$container.backgroundSize =
|
|
393
|
+
this.$container.backgroundSize = y.indexOf(e) > 0 ? e : "";
|
|
71
394
|
break;
|
|
72
395
|
case "background-position":
|
|
73
396
|
this.$container.backgroundPosition = e;
|
|
@@ -79,11 +402,11 @@ const o = class o extends d {
|
|
|
79
402
|
case "has-gridding--mobile":
|
|
80
403
|
case "has-gridding--tablet":
|
|
81
404
|
case "has-gridding--laptop":
|
|
82
|
-
this.createGridding();
|
|
405
|
+
this.createGridding(e);
|
|
83
406
|
break;
|
|
84
407
|
case "inverted":
|
|
85
|
-
for (let
|
|
86
|
-
this.$children[
|
|
408
|
+
for (let n = 0; n < this.$children.length; n++)
|
|
409
|
+
this.$children[n].hasAttribute("inverted") || this.$children[n].toggleAttribute("inverted");
|
|
87
410
|
this.$el.toggleAttribute("inverted", e !== null);
|
|
88
411
|
break;
|
|
89
412
|
default:
|
|
@@ -91,51 +414,56 @@ const o = class o extends d {
|
|
|
91
414
|
break;
|
|
92
415
|
}
|
|
93
416
|
}
|
|
417
|
+
disconnectedCallback() {
|
|
418
|
+
this.observer.disconnect();
|
|
419
|
+
}
|
|
94
420
|
createGridTemplateAreas() {
|
|
95
421
|
const t = this.shadowRoot.querySelector(
|
|
96
422
|
".banner-content"
|
|
97
423
|
), i = ["tag", "media", "title", "description", "content", "action"];
|
|
98
424
|
let e = "";
|
|
99
|
-
this.reduced ? i.forEach((
|
|
100
|
-
const
|
|
101
|
-
`slot[name="${
|
|
425
|
+
this.reduced ? i.forEach((n) => {
|
|
426
|
+
const s = this.shadowRoot.querySelector(
|
|
427
|
+
`slot[name="${n}"]`
|
|
102
428
|
);
|
|
103
|
-
if (
|
|
104
|
-
if (
|
|
105
|
-
e += `'media ${
|
|
429
|
+
if (s && s.assignedElements().length > 0) {
|
|
430
|
+
if (n === "media") return;
|
|
431
|
+
e += `'media ${n}'
|
|
106
432
|
`;
|
|
107
433
|
}
|
|
108
|
-
}) : i.forEach((
|
|
109
|
-
const
|
|
110
|
-
`slot[name="${
|
|
434
|
+
}) : i.forEach((n) => {
|
|
435
|
+
const s = this.shadowRoot.querySelector(
|
|
436
|
+
`slot[name="${n}"]`
|
|
111
437
|
);
|
|
112
|
-
|
|
438
|
+
s && s.assignedElements().length > 0 && (e += `'${n}'
|
|
113
439
|
`);
|
|
114
440
|
}), e || (e = "'content'"), t.style.gridTemplateAreas = e;
|
|
115
441
|
}
|
|
116
|
-
createGridding() {
|
|
117
|
-
const
|
|
118
|
-
{ prop: "hasGridding",
|
|
442
|
+
createGridding(t) {
|
|
443
|
+
const i = [
|
|
444
|
+
{ prop: "hasGridding", gridAttr: "grid-cols", attr: "col-span" },
|
|
119
445
|
{
|
|
120
446
|
prop: "hasGriddingMobile",
|
|
121
|
-
|
|
447
|
+
gridAttr: "grid-cols--mobile",
|
|
122
448
|
attr: "col-span--mobile"
|
|
123
449
|
},
|
|
124
450
|
{
|
|
125
451
|
prop: "hasGriddingTablet",
|
|
126
|
-
|
|
452
|
+
gridAttr: "grid-cols--tablet",
|
|
127
453
|
attr: "col-span--tablet"
|
|
128
454
|
},
|
|
129
455
|
{
|
|
130
456
|
prop: "hasGriddingLaptop",
|
|
131
|
-
|
|
457
|
+
gridAttr: "grid-cols--laptop",
|
|
132
458
|
attr: "col-span--laptop"
|
|
133
459
|
}
|
|
134
|
-
],
|
|
460
|
+
], e = this.shadowRoot.querySelector(
|
|
135
461
|
"px-grid > px-container"
|
|
136
462
|
);
|
|
137
|
-
t.forEach(({ prop:
|
|
138
|
-
this[
|
|
463
|
+
t !== null ? i.forEach(({ prop: n, gridAttr: s, attr: p }) => {
|
|
464
|
+
this[n] && (this.$grid.setAttribute(s, "3"), e == null || e.setAttribute(p, "2"));
|
|
465
|
+
}) : i.forEach(({ gridAttr: n, attr: s }) => {
|
|
466
|
+
this.$grid.setAttribute(n, "1"), e == null || e.setAttribute(s, "1");
|
|
139
467
|
});
|
|
140
468
|
}
|
|
141
469
|
get $grid() {
|
|
@@ -244,9 +572,9 @@ const o = class o extends d {
|
|
|
244
572
|
t ? this.setAttribute("has-gridding--laptop", "") : this.removeAttribute("has-gridding--laptop");
|
|
245
573
|
}
|
|
246
574
|
};
|
|
247
|
-
|
|
248
|
-
let
|
|
249
|
-
customElements.get("px-banner") || customElements.define("px-banner",
|
|
575
|
+
l.nativeName = "div";
|
|
576
|
+
let r = l;
|
|
577
|
+
customElements.get("px-banner") || customElements.define("px-banner", r);
|
|
250
578
|
export {
|
|
251
|
-
|
|
579
|
+
r as Banner
|
|
252
580
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-banner",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.61",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"clean": "rm -rf dist",
|
|
12
12
|
"build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json && npm run wc-manifest",
|
|
13
13
|
"test": "vitest run --coverage",
|
|
14
|
-
"wc-manifest": "cem analyze --globs \"src/*\" --config
|
|
14
|
+
"wc-manifest": "cem analyze --globs \"src/*\" --config ../../custom-elements-manifest.config.js --outdir dist"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|