@proximus/lavender-sticky-container 2.0.0-alpha.17 → 2.0.0-alpha.170
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.es.js +39 -79
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,80 +1,40 @@
|
|
|
1
|
-
import { AttributeBreakpointHandlerDelegate as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
}, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [s];
|
|
41
|
-
}
|
|
42
|
-
connectedCallback() {
|
|
43
|
-
this.adjustContentHeight(), window.addEventListener("resize", this.adjustContentHeight);
|
|
44
|
-
}
|
|
45
|
-
disconnectedCallback() {
|
|
46
|
-
window.removeEventListener("resize", this.adjustContentHeight);
|
|
47
|
-
}
|
|
48
|
-
static get observedAttributes() {
|
|
49
|
-
return ["offset-left", "offset-right"];
|
|
50
|
-
}
|
|
51
|
-
attributeChangedCallback(t, e, i) {
|
|
52
|
-
if (e !== i)
|
|
53
|
-
switch (t) {
|
|
54
|
-
case "offset-left":
|
|
55
|
-
this.prefixMarginTopBreakpointHandlerDelegate.attributeChangedCallback(
|
|
56
|
-
t,
|
|
57
|
-
e,
|
|
58
|
-
i
|
|
59
|
-
);
|
|
60
|
-
break;
|
|
61
|
-
case "offset-right":
|
|
62
|
-
this.suffixMarginTopBreakpointHandlerDelegate.attributeChangedCallback(
|
|
63
|
-
t,
|
|
64
|
-
e,
|
|
65
|
-
i
|
|
66
|
-
);
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
get $header() {
|
|
71
|
-
return this.shadowRoot.querySelector("#header");
|
|
72
|
-
}
|
|
73
|
-
get $footer() {
|
|
74
|
-
return this.shadowRoot.querySelector(".sticky-footer");
|
|
75
|
-
}
|
|
76
|
-
get $middle() {
|
|
77
|
-
return this.shadowRoot.querySelector("#middle");
|
|
78
|
-
}
|
|
79
|
-
}
|
|
1
|
+
import { AttributeBreakpointHandlerDelegate as e } from "@proximus/lavender-common";
|
|
2
|
+
//#region src/sticky-container.css?inline
|
|
3
|
+
var t = "#content{overflow:auto}#sticky-left{float:left;margin-top:var(--px-sticky-container-offset-left-desktop,var(--px-sticky-container-offset-left-all));position:sticky;top:0}@media screen and (width<=47.938rem){#sticky-left{margin-top:var(--px-sticky-container-offset-left-mobile,var(--px-sticky-container-offset-left-all))}}@media screen and (width>=48rem){#sticky-left{margin-top:var(--px-sticky-container-offset-left-tablet,var(--px-sticky-container-offset-left-all))}}@media screen and (width>=64.0625rem){#sticky-left{margin-top:var(--px-sticky-container-offset-left-laptop,var(--px-sticky-container-offset-left-all))}}#sticky-right{float:right;margin-top:var(--px-sticky-container-offset-right-desktop,var(--px-sticky-container-offset-right-all));position:sticky;top:0}@media screen and (width<=47.938rem){#sticky-right{margin-top:var(--px-sticky-container-offset-right-mobile,var(--px-sticky-container-offset-right-all))}}@media screen and (width>=48rem){#sticky-right{margin-top:var(--px-sticky-container-offset-right-tablet,var(--px-sticky-container-offset-right-all))}}@media screen and (width>=64.0625rem){#sticky-right{margin-top:var(--px-sticky-container-offset-right-laptop,var(--px-sticky-container-offset-right-all))}}#middle{height:var(--px-sticky-container-middle-height,100vh);width:100%;position:relative;overflow:auto}.sticky-footer{z-index:999;width:100%;position:sticky;bottom:0}", n = new CSSStyleSheet();
|
|
4
|
+
n.replaceSync(t);
|
|
5
|
+
var r = class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(), this.prefixMarginTopBreakpointHandlerDelegate = new e(this, "offset-left", (e) => e, "--px-sticky-container-offset-left"), this.suffixMarginTopBreakpointHandlerDelegate = new e(this, "offset-right", (e) => e, "--px-sticky-container-offset-right"), this.template = "\n <div id=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <div id=\"middle\">\n <div id=\"sticky-left\">\n <slot name=\"left\"></slot>\n </div>\n <div id=\"sticky-right\">\n <slot name=\"right\"></slot>\n </div>\n <div id=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"sticky-footer\">\n <slot name=\"footer\"></slot>\n </div>\n ", this.adjustContentHeight = () => {
|
|
8
|
+
let e = this.$header.offsetHeight, t = this.$footer.offsetHeight;
|
|
9
|
+
this.$middle.style.setProperty("--px-sticky-container-middle-height", `calc(100vh - ${e + t}px)`);
|
|
10
|
+
}, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [n];
|
|
11
|
+
}
|
|
12
|
+
connectedCallback() {
|
|
13
|
+
this.adjustContentHeight(), window.addEventListener("resize", this.adjustContentHeight);
|
|
14
|
+
}
|
|
15
|
+
disconnectedCallback() {
|
|
16
|
+
window.removeEventListener("resize", this.adjustContentHeight);
|
|
17
|
+
}
|
|
18
|
+
static get observedAttributes() {
|
|
19
|
+
return ["offset-left", "offset-right"];
|
|
20
|
+
}
|
|
21
|
+
attributeChangedCallback(e, t, n) {
|
|
22
|
+
if (t !== n) switch (e) {
|
|
23
|
+
case "offset-left":
|
|
24
|
+
this.prefixMarginTopBreakpointHandlerDelegate.attributeChangedCallback(e, t, n);
|
|
25
|
+
break;
|
|
26
|
+
case "offset-right": this.suffixMarginTopBreakpointHandlerDelegate.attributeChangedCallback(e, t, n);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
get $header() {
|
|
30
|
+
return this.shadowRoot.querySelector("#header");
|
|
31
|
+
}
|
|
32
|
+
get $footer() {
|
|
33
|
+
return this.shadowRoot.querySelector(".sticky-footer");
|
|
34
|
+
}
|
|
35
|
+
get $middle() {
|
|
36
|
+
return this.shadowRoot.querySelector("#middle");
|
|
37
|
+
}
|
|
38
|
+
};
|
|
80
39
|
customElements.get("px-sticky-container") || customElements.define("px-sticky-container", r);
|
|
40
|
+
//#endregion
|