@proximus/lavender-modal 2.0.0-alpha.59 → 2.0.0-alpha.60
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/Modal.d.ts +1 -0
- package/dist/index.es.js +9 -4
- package/package.json +1 -1
package/dist/Modal.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -9,7 +9,7 @@ r.replaceSync(a);
|
|
|
9
9
|
const l = "px.lavender.modal.close", c = ["", "info", "success", "error", "warning"];
|
|
10
10
|
class d extends HTMLElement {
|
|
11
11
|
constructor() {
|
|
12
|
-
super(), this.onOpenClick = () => this.show(), this.onCloseClick = () => this.close(), this.commandButtonCleanups = [], this.openerElement = null, this.closerElement = null, this.template = `<dialog>
|
|
12
|
+
super(), this.onOpenClick = () => this.show(), this.onCloseClick = () => this.close(), this.commandButtonCleanups = [], this.opener = null, this.openerElement = null, this.closerElement = null, this.template = `<dialog>
|
|
13
13
|
<div id="container">
|
|
14
14
|
<div id="content-container">
|
|
15
15
|
<px-vstack gap="default" >
|
|
@@ -135,11 +135,16 @@ class d extends HTMLElement {
|
|
|
135
135
|
}
|
|
136
136
|
addOpenListener() {
|
|
137
137
|
var t;
|
|
138
|
-
this.removeOpenListener(), this.openerElement = this.$opener, (t = this.
|
|
138
|
+
this.removeOpenListener(), this.$opener ? (this.openerElement = this.$opener, this.openerElement.addEventListener("click", this.onOpenClick)) : ((t = this.opener) == null || t.disconnect(), this.opener = new MutationObserver(() => {
|
|
139
|
+
this.$opener && (this.opener.disconnect(), this.opener = null, this.addOpenListener());
|
|
140
|
+
}), this.opener.observe(document.body, {
|
|
141
|
+
childList: !0,
|
|
142
|
+
subtree: !0
|
|
143
|
+
}));
|
|
139
144
|
}
|
|
140
145
|
removeOpenListener() {
|
|
141
|
-
var t;
|
|
142
|
-
(t = this.
|
|
146
|
+
var t, e;
|
|
147
|
+
(t = this.opener) == null || t.disconnect(), this.opener = null, (e = this.openerElement) == null || e.removeEventListener("click", this.onOpenClick), this.openerElement = null;
|
|
143
148
|
}
|
|
144
149
|
addCloseListener(t) {
|
|
145
150
|
var e, o;
|