@proximus/lavender-layout 1.3.0-alpha.1 → 1.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Spacer.d.ts +0 -10
- package/dist/index.es.js +18 -39
- package/package.json +1 -1
package/dist/Spacer.d.ts
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
export declare class Spacer extends HTMLElement {
|
|
2
|
-
private resizeObserver?;
|
|
3
|
-
private recheckHandle?;
|
|
4
|
-
private isZeroSized;
|
|
5
|
-
private growValue;
|
|
6
|
-
private isVertical;
|
|
7
2
|
constructor();
|
|
8
3
|
static get observedAttributes(): string[];
|
|
9
4
|
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
10
5
|
connectedCallback(): void;
|
|
11
|
-
disconnectedCallback(): void;
|
|
12
6
|
get grow(): string;
|
|
13
7
|
set grow(value: string);
|
|
14
|
-
private scheduleRecheck;
|
|
15
|
-
private recalculateVisibility;
|
|
16
|
-
private handleSizeChange;
|
|
17
|
-
private updateParticipation;
|
|
18
8
|
}
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithExtraAttributes as
|
|
1
|
+
import { WithExtraAttributes as c, AttributeBreakpointHandlerDelegate as b, gapValues as u, checkName as h, backgroundColorValues as f } from "@proximus/lavender-common";
|
|
2
2
|
const x = ':host{display:block}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-mobile) + var(--px-focus-offset-mobile))}.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);overflow-x:var(--overflow-x-all)}@media only screen and (max-width: 47.9375em){.flex-container{overflow-x:var(--overflow-x-all-mobile, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 48em){.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)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-tablet) + var(--px-focus-offset-tablet))}}@media only screen and (min-width: 48em) and (max-width: 64em){.flex-container{overflow-x:var(--overflow-x-all-tablet, var(--overflow-x-all));scrollbar-width:none}.flex-container::-webkit-scrollbar{display:none}}@media only screen and (min-width: 64.0625em){.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)}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-laptop) + var(--px-focus-offset-laptop))}}@media only screen and (min-width: 64.0625em) and (max-width: 90em){.flex-container{overflow-x:var(--overflow-x-all-laptop, var(--overflow-x-all))}}@media only screen and (min-width: 90.0625em){.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);overflow-x:var(--overflow-x-all-desktop, var(--overflow-x-all))}:host([overflow-x="auto"]){margin:calc(calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop)) * -1)}:host([overflow-x="auto"]) .flex-container{padding:calc(var(--px-focus-outline-desktop) + var(--px-focus-offset-desktop))}}', d = new CSSStyleSheet();
|
|
3
3
|
d.replaceSync(x);
|
|
4
4
|
const m = [
|
|
@@ -26,9 +26,9 @@ const m = [
|
|
|
26
26
|
"space-around",
|
|
27
27
|
"space-evenly"
|
|
28
28
|
], w = ["", "default", "nowrap", "wrap", "wrap-reverse"], y = ["", "visible", "hidden", "scroll", "auto"];
|
|
29
|
-
class l extends
|
|
29
|
+
class l extends c {
|
|
30
30
|
constructor() {
|
|
31
|
-
super(d), this.overflowXAttributeDelegate = new
|
|
31
|
+
super(d), this.overflowXAttributeDelegate = new b(
|
|
32
32
|
this,
|
|
33
33
|
"overflow-x",
|
|
34
34
|
(t) => t,
|
|
@@ -130,7 +130,7 @@ class l extends p {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
updateOverflowX(t, i, e, o) {
|
|
133
|
-
if (!
|
|
133
|
+
if (!h(o, e)) {
|
|
134
134
|
console.error(`${e} is not an allowed ${t} value`);
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
@@ -142,14 +142,14 @@ class l extends p {
|
|
|
142
142
|
}
|
|
143
143
|
updateFlexProperties(t, i, e, o) {
|
|
144
144
|
this.checkName(o, e) || console.error(`${e} is not a valid value for ${o}`);
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
147
|
-
this.getAttribute(a + "--mobile") ||
|
|
148
|
-
this.updateStyle(a,
|
|
145
|
+
const p = t.indexOf("--") > -1, a = p ? t.split("--")[0] : t, r = [];
|
|
146
|
+
if (!p)
|
|
147
|
+
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((s) => {
|
|
148
|
+
this.updateStyle(a, s, i, o), this.updateStyle(a, s, e, o);
|
|
149
149
|
});
|
|
150
150
|
else {
|
|
151
|
-
const
|
|
152
|
-
this.updateStyle(a,
|
|
151
|
+
const s = t.split("--")[1];
|
|
152
|
+
this.updateStyle(a, s, i, o), this.updateStyle(a, s, e, o);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
updateStyle(t, i, e, o) {
|
|
@@ -366,22 +366,16 @@ class C extends l {
|
|
|
366
366
|
customElements.get("px-hstack") || customElements.define("px-hstack", C);
|
|
367
367
|
class $ extends HTMLElement {
|
|
368
368
|
constructor() {
|
|
369
|
-
super()
|
|
369
|
+
super();
|
|
370
370
|
}
|
|
371
371
|
static get observedAttributes() {
|
|
372
372
|
return ["grow"];
|
|
373
373
|
}
|
|
374
374
|
attributeChangedCallback(t, i, e) {
|
|
375
|
-
t === "grow" && (this.
|
|
375
|
+
t === "grow" && (this.style.flexGrow = e);
|
|
376
376
|
}
|
|
377
377
|
connectedCallback() {
|
|
378
|
-
this.
|
|
379
|
-
this.handleSizeChange();
|
|
380
|
-
}), this.isVertical = this.parentElement.localName === "px-vstack" || this.parentElement.style.flexDirection === "column", this.resizeObserver.observe(this), this.scheduleRecheck();
|
|
381
|
-
}
|
|
382
|
-
disconnectedCallback() {
|
|
383
|
-
var t;
|
|
384
|
-
(t = this.resizeObserver) == null || t.disconnect(), this.recheckHandle && (cancelAnimationFrame(this.recheckHandle), this.recheckHandle = void 0);
|
|
378
|
+
this.style.flexGrow = this.getAttribute("grow") || "1";
|
|
385
379
|
}
|
|
386
380
|
get grow() {
|
|
387
381
|
return this.getAttribute("grow");
|
|
@@ -389,26 +383,11 @@ class $ extends HTMLElement {
|
|
|
389
383
|
set grow(t) {
|
|
390
384
|
this.setAttribute("grow", t);
|
|
391
385
|
}
|
|
392
|
-
scheduleRecheck() {
|
|
393
|
-
this.recheckHandle && cancelAnimationFrame(this.recheckHandle), this.recheckHandle = requestAnimationFrame(() => {
|
|
394
|
-
this.recheckHandle = void 0, this.recalculateVisibility();
|
|
395
|
-
});
|
|
396
|
-
}
|
|
397
|
-
recalculateVisibility() {
|
|
398
|
-
this.isConnected && (this.style.display = "", this.style.flexGrow = this.growValue, this.handleSizeChange());
|
|
399
|
-
}
|
|
400
|
-
handleSizeChange() {
|
|
401
|
-
const t = this.getBoundingClientRect(), i = t.width === 0 && !this.isVertical || t.height === 0 && this.isVertical;
|
|
402
|
-
this.isZeroSized !== i && (this.isZeroSized = i, this.updateParticipation());
|
|
403
|
-
}
|
|
404
|
-
updateParticipation() {
|
|
405
|
-
this.isZeroSized ? (this.style.display = "none", this.style.flexGrow = "0") : (this.style.display = "", this.style.flexGrow = this.growValue);
|
|
406
|
-
}
|
|
407
386
|
}
|
|
408
387
|
customElements.get("px-spacer") || customElements.define("px-spacer", $);
|
|
409
|
-
const
|
|
410
|
-
g.replaceSync(
|
|
411
|
-
class
|
|
388
|
+
const j = ":host{display:block;box-sizing:border-box}slot[name=body-container]{min-height:100vh}#image-sticky-box{margin-top:-2.5em}", g = new CSSStyleSheet();
|
|
389
|
+
g.replaceSync(j);
|
|
390
|
+
class S extends c {
|
|
412
391
|
constructor() {
|
|
413
392
|
super(g), this.template = (t) => `
|
|
414
393
|
<px-container border-radius="none" padding="none">
|
|
@@ -607,10 +586,10 @@ class j extends p {
|
|
|
607
586
|
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;
|
|
608
587
|
}
|
|
609
588
|
}
|
|
610
|
-
customElements.get("px-page") === void 0 && customElements.define("px-page",
|
|
589
|
+
customElements.get("px-page") === void 0 && customElements.define("px-page", S);
|
|
611
590
|
export {
|
|
612
591
|
C as HStack,
|
|
613
|
-
|
|
592
|
+
S as Page,
|
|
614
593
|
$ as Spacer,
|
|
615
594
|
l as Stack,
|
|
616
595
|
A as VStack,
|