@proximus/lavender-drawer 1.4.9-alpha.16 → 1.4.9-alpha.17
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 +26 -24
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -41,10 +41,12 @@ class h extends HTMLElement {
|
|
|
41
41
|
</dialog>`, this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = this.template, this.shadowRoot.adoptedStyleSheets = [n];
|
|
42
42
|
}
|
|
43
43
|
connectedCallback() {
|
|
44
|
-
var
|
|
44
|
+
var e;
|
|
45
45
|
this.toggleFooterVisibility = this.toggleFooterVisibility.bind(this), this.$opener && this.addOpenListener(), this.$closer && this.addCloseListener(), this.hasAttribute("showfrom") || this.setAttribute("showfrom", "bottom"), this.$closeButton.addEventListener("click", () => {
|
|
46
46
|
this.hide();
|
|
47
|
-
}), this.
|
|
47
|
+
}), this.$dialog.addEventListener("toggle", (t) => {
|
|
48
|
+
t.newState === "closed" && this.hide();
|
|
49
|
+
}), this.toggleFooterVisibility(), (e = this.$slotFooter) == null || e.addEventListener(
|
|
48
50
|
"slotchange",
|
|
49
51
|
this.toggleFooterVisibility
|
|
50
52
|
);
|
|
@@ -52,9 +54,9 @@ class h extends HTMLElement {
|
|
|
52
54
|
static get observedAttributes() {
|
|
53
55
|
return ["open", "aria-label-close-button", "openedby", "closedby"];
|
|
54
56
|
}
|
|
55
|
-
attributeChangedCallback(
|
|
57
|
+
attributeChangedCallback(e, t, o) {
|
|
56
58
|
var a, i, s;
|
|
57
|
-
switch (
|
|
59
|
+
switch (e) {
|
|
58
60
|
case "open":
|
|
59
61
|
o !== null ? this.show() : this.hide();
|
|
60
62
|
break;
|
|
@@ -66,9 +68,9 @@ class h extends HTMLElement {
|
|
|
66
68
|
) : (a = this.$closeButton) == null || a.removeAttribute("aria-label");
|
|
67
69
|
break;
|
|
68
70
|
case "openedby":
|
|
69
|
-
if (o !==
|
|
70
|
-
if (
|
|
71
|
-
const r = document.querySelector(`#${
|
|
71
|
+
if (o !== t) {
|
|
72
|
+
if (t) {
|
|
73
|
+
const r = document.querySelector(`#${t}`);
|
|
72
74
|
r == null || r.removeEventListener("click", () => this.show());
|
|
73
75
|
}
|
|
74
76
|
this.addOpenListener();
|
|
@@ -80,19 +82,19 @@ class h extends HTMLElement {
|
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
disconnectedCallback() {
|
|
83
|
-
var
|
|
84
|
-
(
|
|
85
|
+
var e, t;
|
|
86
|
+
(e = this.$slotFooter) == null || e.removeEventListener(
|
|
85
87
|
"slotchange",
|
|
86
88
|
this.toggleFooterVisibility
|
|
87
|
-
), (
|
|
89
|
+
), (t = this.observer) == null || t.disconnect(), this.$opener && this.$opener.removeEventListener("click", () => this.show()), this.$closer && this.$closer.removeEventListener("click", () => this.hide());
|
|
88
90
|
}
|
|
89
91
|
show() {
|
|
90
|
-
var
|
|
91
|
-
(
|
|
92
|
+
var e, t;
|
|
93
|
+
(t = (e = this.$dialog).showPopover) == null || t.call(e), document.body.style.overflow = "hidden";
|
|
92
94
|
}
|
|
93
95
|
hide() {
|
|
94
|
-
var
|
|
95
|
-
(
|
|
96
|
+
var e, t;
|
|
97
|
+
(t = (e = this.$dialog).hidePopover) == null || t.call(e), document.body.style.overflow = "", this.dispatchEvent(
|
|
96
98
|
new Event(d, {
|
|
97
99
|
bubbles: !0,
|
|
98
100
|
composed: !0
|
|
@@ -111,8 +113,8 @@ class h extends HTMLElement {
|
|
|
111
113
|
}));
|
|
112
114
|
}
|
|
113
115
|
addCloseListener() {
|
|
114
|
-
var
|
|
115
|
-
this.$closer && ((
|
|
116
|
+
var e;
|
|
117
|
+
this.$closer && ((e = this.$closer) == null || e.addEventListener("click", () => {
|
|
116
118
|
this.hide();
|
|
117
119
|
}));
|
|
118
120
|
}
|
|
@@ -146,26 +148,26 @@ class h extends HTMLElement {
|
|
|
146
148
|
get $footer() {
|
|
147
149
|
return this.shadowRoot.querySelector("#footer");
|
|
148
150
|
}
|
|
149
|
-
set open(
|
|
150
|
-
|
|
151
|
+
set open(e) {
|
|
152
|
+
e ? this.setAttribute("open", "") : this.removeAttribute("open");
|
|
151
153
|
}
|
|
152
154
|
get AriaLabelCloseButton() {
|
|
153
155
|
return this.getAttribute("aria-label-close-button");
|
|
154
156
|
}
|
|
155
|
-
set AriaLabelCloseButton(
|
|
156
|
-
this.setAttribute("aria-label-close-button",
|
|
157
|
+
set AriaLabelCloseButton(e) {
|
|
158
|
+
this.setAttribute("aria-label-close-button", e);
|
|
157
159
|
}
|
|
158
160
|
get openedby() {
|
|
159
161
|
return this.getAttribute("openedby");
|
|
160
162
|
}
|
|
161
|
-
set openedby(
|
|
162
|
-
this.setAttribute("openedby",
|
|
163
|
+
set openedby(e) {
|
|
164
|
+
this.setAttribute("openedby", e);
|
|
163
165
|
}
|
|
164
166
|
get closedby() {
|
|
165
167
|
return this.getAttribute("closedby");
|
|
166
168
|
}
|
|
167
|
-
set closedby(
|
|
168
|
-
this.setAttribute("closedby",
|
|
169
|
+
set closedby(e) {
|
|
170
|
+
this.setAttribute("closedby", e);
|
|
169
171
|
}
|
|
170
172
|
}
|
|
171
173
|
customElements.get("px-drawer") || customElements.define("px-drawer", h);
|