@proximus/lavender-layout 1.1.0-alpha.7 → 1.1.0-alpha.8
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/index.js +120 -116
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WithFlexAttributes as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { WithFlexAttributes as l, backgroundColorValues as b } from "@proximus/lavender-common";
|
|
2
|
+
const u = ".flex-container{display:flex;height:100%;width:100%;box-sizing:border-box;flex-direction:var(--flex-direction--mobile-value);gap:var(--flex-gap--mobile-value);flex-wrap:var(--flex-wrap--mobile-value);justify-content:var(--flex-justify-content--mobile-value);align-items:var(--flex-align-items--mobile-value)}@media screen and (min-width: 768px){.flex-container{flex-direction:var(--flex-direction--tablet-value);gap:var(--flex-gap--tablet-value);flex-wrap:var(--flex-wrap--tablet-value);justify-content:var(--flex-justify-content--tablet-value);align-items:var(--flex-align-items--tablet-value)}}@media screen and (min-width: 1025px){.flex-container{flex-direction:var(--flex-direction--laptop-value);gap:var(--flex-gap--laptop-value);flex-wrap:var(--flex-wrap--laptop-value);justify-content:var(--flex-justify-content--laptop-value);align-items:var(--flex-align-items--laptop-value)}}@media screen and (min-width: 1441px){.flex-container{flex-direction:var(--flex-direction--desktop-value);gap:var(--flex-gap--desktop-value);flex-wrap:var(--flex-wrap--desktop-value);justify-content:var(--flex-justify-content--desktop-value);align-items:var(--flex-align-items--desktop-value)}}", d = new CSSStyleSheet();
|
|
3
|
+
d.replaceSync(u);
|
|
4
|
+
const h = [
|
|
5
5
|
"after-element-none",
|
|
6
6
|
"after-element-2xs",
|
|
7
7
|
"after-element-xs",
|
|
@@ -16,15 +16,39 @@ const c = [
|
|
|
16
16
|
"inside-section-default",
|
|
17
17
|
"inside-section-l",
|
|
18
18
|
"between-sections"
|
|
19
|
-
]
|
|
20
|
-
|
|
19
|
+
], x = [
|
|
20
|
+
"",
|
|
21
|
+
"default",
|
|
22
|
+
"row",
|
|
23
|
+
"row-reverse",
|
|
24
|
+
"column",
|
|
25
|
+
"column-reverse"
|
|
26
|
+
], m = [
|
|
27
|
+
"",
|
|
28
|
+
"default",
|
|
29
|
+
"stretch",
|
|
30
|
+
"flex-start",
|
|
31
|
+
"flex-end",
|
|
32
|
+
"center",
|
|
33
|
+
"baseline"
|
|
34
|
+
], f = [
|
|
35
|
+
"",
|
|
36
|
+
"default",
|
|
37
|
+
"flex-start",
|
|
38
|
+
"flex-end",
|
|
39
|
+
"center",
|
|
40
|
+
"space-between",
|
|
41
|
+
"space-around",
|
|
42
|
+
"space-evenly"
|
|
43
|
+
], k = ["", "default", "nowrap", "wrap", "wrap-reverse"];
|
|
44
|
+
class p extends l {
|
|
21
45
|
constructor() {
|
|
22
|
-
super(
|
|
46
|
+
super(d), this.template = `<div class="flex-container">
|
|
23
47
|
<slot></slot>
|
|
24
48
|
</div>`, this.shadowRoot.innerHTML = this.template;
|
|
25
49
|
}
|
|
26
50
|
connectedCallback() {
|
|
27
|
-
this.hasAttribute("direction") || (this.direction = "row");
|
|
51
|
+
this.hasAttribute("direction") || (this.direction = "row"), this.hasAttribute("gap") || (this.gap = "inside-section-none"), this.hasAttribute("align-items") || (this.alignItems = "stretch"), this.hasAttribute("justify-content") || (this.justifyContent = "flex-start"), this.hasAttribute("wrap") || (this.wrap = "nowrap");
|
|
28
52
|
}
|
|
29
53
|
static get observedAttributes() {
|
|
30
54
|
return [
|
|
@@ -35,6 +59,10 @@ class s extends r {
|
|
|
35
59
|
"direction--laptop",
|
|
36
60
|
"direction--desktop",
|
|
37
61
|
"gap",
|
|
62
|
+
"gap--mobile",
|
|
63
|
+
"gap--tablet",
|
|
64
|
+
"gap--laptop",
|
|
65
|
+
"gap--desktop",
|
|
38
66
|
"justify-content",
|
|
39
67
|
"justify-content--mobile",
|
|
40
68
|
"justify-content--tablet",
|
|
@@ -46,10 +74,10 @@ class s extends r {
|
|
|
46
74
|
"align-items--laptop",
|
|
47
75
|
"align-items--desktop",
|
|
48
76
|
"wrap",
|
|
49
|
-
"wrap
|
|
50
|
-
"wrap
|
|
51
|
-
"wrap
|
|
52
|
-
"wrap
|
|
77
|
+
"wrap--mobile",
|
|
78
|
+
"wrap--tablet",
|
|
79
|
+
"wrap--laptop",
|
|
80
|
+
"wrap--desktop"
|
|
53
81
|
];
|
|
54
82
|
}
|
|
55
83
|
attributeChangedCallback(t, i, e) {
|
|
@@ -57,101 +85,73 @@ class s extends r {
|
|
|
57
85
|
throw new Error("Invalid direction");
|
|
58
86
|
switch (t) {
|
|
59
87
|
case "gap":
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.getGapCSSVariable(e, "tablet")
|
|
66
|
-
), this.$el.style.setProperty(
|
|
67
|
-
"--flex-gap-laptop-value",
|
|
68
|
-
this.getGapCSSVariable(e, "desktop")
|
|
69
|
-
), this.$el.style.setProperty(
|
|
70
|
-
"--flex-gap-desktop-value",
|
|
71
|
-
this.getGapCSSVariable(e, "desktop")
|
|
72
|
-
);
|
|
73
|
-
break;
|
|
74
|
-
case "direction":
|
|
75
|
-
this.$el.style.getPropertyValue("--flex-direction--mobile-value") || this.$el.style.setProperty(
|
|
76
|
-
"--flex-direction--mobile-value",
|
|
77
|
-
e
|
|
78
|
-
), this.$el.style.getPropertyValue("--flex-direction--tablet-value") || this.$el.style.setProperty(
|
|
79
|
-
"--flex-direction--tablet-value",
|
|
80
|
-
e
|
|
81
|
-
), this.$el.style.getPropertyValue("--flex-direction--laptop-value") || this.$el.style.setProperty(
|
|
82
|
-
"--flex-direction--laptop-value",
|
|
83
|
-
e
|
|
84
|
-
), this.$el.style.getPropertyValue("--flex-direction--desktop-value") || this.$el.style.setProperty(
|
|
85
|
-
"--flex-direction--desktop-value",
|
|
86
|
-
e
|
|
87
|
-
);
|
|
88
|
+
case "gap--mobile":
|
|
89
|
+
case "gap--tablet":
|
|
90
|
+
case "gap--laptop":
|
|
91
|
+
case "gap--desktop":
|
|
92
|
+
this.updateFlexProperties(t, i, e, h);
|
|
88
93
|
break;
|
|
89
94
|
case "justify-content":
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
e
|
|
100
|
-
), this.$el.style.getPropertyValue(
|
|
101
|
-
"--flex-justify-content--laptop-value"
|
|
102
|
-
) || this.$el.style.setProperty(
|
|
103
|
-
"--flex-justify-content--laptop-value",
|
|
104
|
-
e
|
|
105
|
-
), this.$el.style.getPropertyValue(
|
|
106
|
-
"--flex-justify-content--desktop-value"
|
|
107
|
-
) || this.$el.style.setProperty(
|
|
108
|
-
"--flex-justify-content--desktop-value",
|
|
109
|
-
e
|
|
95
|
+
case "justify-content--mobile":
|
|
96
|
+
case "justify-content--tablet":
|
|
97
|
+
case "justify-content--laptop":
|
|
98
|
+
case "justify-content--desktop":
|
|
99
|
+
this.updateFlexProperties(
|
|
100
|
+
t,
|
|
101
|
+
i,
|
|
102
|
+
e,
|
|
103
|
+
f
|
|
110
104
|
);
|
|
111
105
|
break;
|
|
112
106
|
case "align-items":
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
e
|
|
119
|
-
), this.$el.style.getPropertyValue("--flex-align-items--laptop-value") || this.$el.style.setProperty(
|
|
120
|
-
"--flex-align-items--laptop-value",
|
|
121
|
-
e
|
|
122
|
-
), this.$el.style.getPropertyValue("--flex-align-items--desktop-value") || this.$el.style.setProperty(
|
|
123
|
-
"--flex-align-items--desktop-value",
|
|
124
|
-
e
|
|
125
|
-
);
|
|
107
|
+
case "align-items--mobile":
|
|
108
|
+
case "align-items--tablet":
|
|
109
|
+
case "align-items--laptop":
|
|
110
|
+
case "align-items--desktop":
|
|
111
|
+
this.updateFlexProperties(t, i, e, m);
|
|
126
112
|
break;
|
|
127
113
|
case "wrap":
|
|
128
|
-
|
|
114
|
+
case "wrap--mobile":
|
|
115
|
+
case "wrap--tablet":
|
|
116
|
+
case "wrap--laptop":
|
|
117
|
+
case "wrap--desktop":
|
|
118
|
+
this.updateFlexProperties(t, i, e, k);
|
|
129
119
|
break;
|
|
120
|
+
case "direction":
|
|
130
121
|
case "direction--mobile":
|
|
131
122
|
case "direction--tablet":
|
|
132
123
|
case "direction--laptop":
|
|
133
124
|
case "direction--desktop":
|
|
134
|
-
|
|
135
|
-
case "justify-content--tablet":
|
|
136
|
-
case "justify-content--laptop":
|
|
137
|
-
case "justify-content--desktop":
|
|
138
|
-
case "align-items--mobile":
|
|
139
|
-
case "align-items--tablet":
|
|
140
|
-
case "align-items--laptop":
|
|
141
|
-
case "align-items--desktop":
|
|
142
|
-
case "wrap-mobile":
|
|
143
|
-
case "wrap-tablet":
|
|
144
|
-
case "wrap-laptop":
|
|
145
|
-
case "wrap-desktop":
|
|
146
|
-
this.$el.style.setProperty(`--flex-${t}-value`, e);
|
|
125
|
+
this.updateFlexProperties(t, i, e, x);
|
|
147
126
|
break;
|
|
148
127
|
default:
|
|
149
128
|
super.attributeChangedCallback(t, i, e);
|
|
150
129
|
break;
|
|
151
130
|
}
|
|
152
131
|
}
|
|
153
|
-
|
|
154
|
-
|
|
132
|
+
updateFlexProperties(t, i, e, s) {
|
|
133
|
+
this.checkName(s, e) || console.error(`Bad ${t} value for`, this.$el);
|
|
134
|
+
const c = t.indexOf("--") > -1, a = c ? t.split("--")[0] : t, r = [];
|
|
135
|
+
if (!c)
|
|
136
|
+
this.getAttribute(a + "--mobile") || r.push("mobile"), this.getAttribute(a + "--tablet") || r.push("tablet"), this.getAttribute(a + "--laptop") || r.push("laptop"), this.getAttribute(a + "--desktop") || r.push("desktop"), r.forEach((o) => {
|
|
137
|
+
this.updateStyle(a, o, i, s), this.updateStyle(a, o, e, s);
|
|
138
|
+
});
|
|
139
|
+
else {
|
|
140
|
+
const o = t.split("--")[1];
|
|
141
|
+
this.updateStyle(a, o, i, s), this.updateStyle(a, o, e, s);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
updateStyle(t, i, e, s) {
|
|
145
|
+
e !== null && e !== "" && e !== "default" && (t === "gap" && s.includes(e) ? this.$el.style.setProperty(
|
|
146
|
+
`--flex-${t}--${i}-value`,
|
|
147
|
+
`var(--px-spacing-${e}-${i === "laptop" ? "desktop" : i})`
|
|
148
|
+
) : this.$el.style.setProperty(
|
|
149
|
+
`--flex-${t}--${i}-value`,
|
|
150
|
+
e
|
|
151
|
+
));
|
|
152
|
+
}
|
|
153
|
+
checkName(t, i) {
|
|
154
|
+
return t.includes(i);
|
|
155
155
|
}
|
|
156
156
|
get direction() {
|
|
157
157
|
return this.getAttribute("direction");
|
|
@@ -274,35 +274,35 @@ class s extends r {
|
|
|
274
274
|
this.setAttribute("wrap", t);
|
|
275
275
|
}
|
|
276
276
|
get wrapMobile() {
|
|
277
|
-
return this.getAttribute("wrap
|
|
277
|
+
return this.getAttribute("wrap--mobile");
|
|
278
278
|
}
|
|
279
279
|
set wrapMobile(t) {
|
|
280
|
-
this.setAttribute("wrap
|
|
280
|
+
this.setAttribute("wrap--mobile", t);
|
|
281
281
|
}
|
|
282
282
|
get wrapTablet() {
|
|
283
|
-
return this.getAttribute("wrap
|
|
283
|
+
return this.getAttribute("wrap--tablet");
|
|
284
284
|
}
|
|
285
285
|
set wrapTablet(t) {
|
|
286
|
-
this.setAttribute("wrap
|
|
286
|
+
this.setAttribute("wrap--tablet", t);
|
|
287
287
|
}
|
|
288
288
|
get wrapLaptop() {
|
|
289
|
-
return this.getAttribute("wrap
|
|
289
|
+
return this.getAttribute("wrap--laptop");
|
|
290
290
|
}
|
|
291
291
|
set wrapLaptop(t) {
|
|
292
|
-
this.setAttribute("wrap
|
|
292
|
+
this.setAttribute("wrap--laptop", t);
|
|
293
293
|
}
|
|
294
294
|
get wrapDesktop() {
|
|
295
|
-
return this.getAttribute("wrap
|
|
295
|
+
return this.getAttribute("wrap--desktop");
|
|
296
296
|
}
|
|
297
297
|
set wrapDesktop(t) {
|
|
298
|
-
this.setAttribute("wrap
|
|
298
|
+
this.setAttribute("wrap--desktop", t);
|
|
299
299
|
}
|
|
300
300
|
get $el() {
|
|
301
301
|
return this.shadowRoot.querySelector(".flex-container");
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
customElements.get("px-stack") || customElements.define("px-stack",
|
|
305
|
-
class
|
|
304
|
+
customElements.get("px-stack") || customElements.define("px-stack", p);
|
|
305
|
+
class y extends p {
|
|
306
306
|
constructor() {
|
|
307
307
|
super();
|
|
308
308
|
}
|
|
@@ -310,8 +310,8 @@ class d extends s {
|
|
|
310
310
|
super.connectedCallback(), this.direction = "column", this.directionMobile = "column", this.directionTablet = "column", this.directionLaptop = "column", this.directionDesktop = "column";
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
-
customElements.get("px-vstack") || customElements.define("px-vstack",
|
|
314
|
-
class
|
|
313
|
+
customElements.get("px-vstack") || customElements.define("px-vstack", y);
|
|
314
|
+
class A extends p {
|
|
315
315
|
constructor() {
|
|
316
316
|
super();
|
|
317
317
|
}
|
|
@@ -319,8 +319,8 @@ class g extends s {
|
|
|
319
319
|
super.connectedCallback(), this.direction = "row", this.directionMobile = "row", this.directionTablet = "row", this.directionLaptop = "row", this.directionDesktop = "row";
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
customElements.get("px-hstack") || customElements.define("px-hstack",
|
|
323
|
-
class
|
|
322
|
+
customElements.get("px-hstack") || customElements.define("px-hstack", A);
|
|
323
|
+
class v extends HTMLElement {
|
|
324
324
|
constructor() {
|
|
325
325
|
super();
|
|
326
326
|
}
|
|
@@ -340,12 +340,12 @@ class u extends HTMLElement {
|
|
|
340
340
|
this.setAttribute("grow", t);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
customElements.define("px-spacer",
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
class
|
|
343
|
+
customElements.define("px-spacer", v);
|
|
344
|
+
const w = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5rem}", g = new CSSStyleSheet();
|
|
345
|
+
g.replaceSync(w);
|
|
346
|
+
class C extends l {
|
|
347
347
|
constructor() {
|
|
348
|
-
super(
|
|
348
|
+
super(g), this.template = (t) => `
|
|
349
349
|
<px-container border-radius="none" padding="none">
|
|
350
350
|
<px-vstack>
|
|
351
351
|
<px-container id="header-container" border-radius="none">
|
|
@@ -522,7 +522,7 @@ class h extends r {
|
|
|
522
522
|
case "background-color":
|
|
523
523
|
this.$bodyContainer.setAttribute(
|
|
524
524
|
"background-color",
|
|
525
|
-
|
|
525
|
+
b.indexOf(e) > 0 ? e : "none"
|
|
526
526
|
);
|
|
527
527
|
break;
|
|
528
528
|
case "padding-vertical":
|
|
@@ -542,12 +542,16 @@ class h extends r {
|
|
|
542
542
|
this.$headerContainer.paddingLeft = t, this.$headerContainer.paddingRight = t, this.$bodyContainer.paddingLeft = t, this.$bodyContainer.paddingRight = t, this.$contactContainer.paddingLeft = t, this.$contactContainer.paddingRight = t, this.$footerContainer.paddingLeft = t, this.$footerContainer.paddingRight = t, this.$imageContainer.paddingLeft = t, this.$imageContainer.paddingRight = t;
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
-
customElements.get("px-page") === void 0 && customElements.define("px-page",
|
|
545
|
+
customElements.get("px-page") === void 0 && customElements.define("px-page", C);
|
|
546
546
|
export {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
547
|
+
A as HStack,
|
|
548
|
+
C as Page,
|
|
549
|
+
v as Spacer,
|
|
550
|
+
p as Stack,
|
|
551
|
+
y as VStack,
|
|
552
|
+
m as alignItemsValues,
|
|
553
|
+
x as directionValues,
|
|
554
|
+
h as gapValues,
|
|
555
|
+
f as justifyContentValues,
|
|
556
|
+
k as wrapValues
|
|
553
557
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proximus/lavender-layout",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "74b23a0ad9d5ab4f454d38eaa0c043d2f0c2128e",
|
|
28
28
|
"lerna": {
|
|
29
29
|
"command": {
|
|
30
30
|
"publish": {
|