@flexilla/modal
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -44,3 +44,8 @@ var P = Object.defineProperty; | ||
) : e(); | ||
}, j = (t, e) => { | ||
}, j = () => { | ||
Y({ | ||
newStyles: '[data-fx-modal][data-state="open"] {display: flex;}[data-fx-modal][data-state="close"]{display: none;} [data-fx-modal][data-state="open"] [data-modal-content] { animation-fill-mode: both;animation: var(--un-modal-animation);-webkit-animation: var(--un-modal-animation);} [data-fx-modal] [data-modal-content][data-state="close"]{animation: var(--un-modal-animation);-webkit-animation: var(--un-modal-animation);} [data-modal-overlay]{position: fixed;inset: 0;}', | ||
identifier: "[data-fx-modal]" | ||
}); | ||
}, D = (t, e) => { | ||
e.removeChild(t); | ||
@@ -51,6 +56,6 @@ }, B = (t, e) => { | ||
callback() { | ||
j(t, e); | ||
D(t, e); | ||
} | ||
}); | ||
}, D = ({ modalContent: t, overlayClassName: e }) => { | ||
}, K = ({ modalContent: t, overlayClassName: e }) => { | ||
const n = document.createElement("span"); | ||
@@ -68,3 +73,3 @@ return n.setAttribute("aria-hidden", "true"), n.setAttribute("data-state", "open"), W({ newElement: n, existingElement: t }), n.classList.add(...e), n.setAttribute("data-modal-overlay", "overlay-bg"), n; | ||
A({ selector: "[data-fx-modal][data-state=open]:not([data-allow-body-scroll=true]", parentElement: document.documentElement }).filter((c) => c !== n).length === 0 && !e && (document.body.style.overflowY = "auto"); | ||
}, K = (t, e, n) => { | ||
}, R = (t, e, n) => { | ||
var g; | ||
@@ -96,3 +101,3 @@ if (!(t instanceof HTMLElement)) | ||
O(t); | ||
const s = D({ | ||
const s = K({ | ||
modalContent: a, | ||
@@ -128,7 +133,2 @@ overlayClassName: T | ||
}, showModal: H, hideModal: b, isHidden: () => t.dataset.state === "close" }; | ||
}, R = () => { | ||
Y({ | ||
newStyles: '[data-fx-modal][data-state="open"] {display: flex;}[data-fx-modal][data-state="close"]{display: none;} [data-fx-modal][data-state="open"] [data-modal-content] { animation-fill-mode: both;animation: var(--un-modal-animation);-webkit-animation: var(--un-modal-animation);} [data-fx-modal] [data-modal-content][data-state="close"]{animation: var(--un-modal-animation);-webkit-animation: var(--un-modal-animation);} [data-modal-overlay]{position: fixed;inset: 0;}', | ||
identifier: "[data-fx-modal]" | ||
}); | ||
}; | ||
@@ -148,12 +148,13 @@ class J { | ||
throw new Error("Invalid provided HTMLElement"); | ||
R(), this.modalElement = e, this.options = o, this.modalElement.setAttribute("data-fx-modal", ""); | ||
this.modalElement = e, this.options = o, this.modalElement.setAttribute("data-fx-modal", ""); | ||
const h = e.dataset.modalId, c = n || p({ | ||
selector: `[data-modal-target='${h}']`, | ||
parentElement: document.body | ||
}), { showModal: m, hideModal: u, autoInitModal: f, isHidden: i } = K(e, c, this.options); | ||
}), { showModal: m, hideModal: u, autoInitModal: f, isHidden: i } = R(e, c, this.options); | ||
f(), this.showModal = m, this.hideModal = u, this.isHidden = i; | ||
} | ||
} | ||
j(); | ||
export { | ||
J as Modal | ||
}; |
{ | ||
"name": "@flexilla/modal", | ||
"private": false, | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"type": "module", | ||
@@ -42,3 +42,3 @@ "description": "A customizable modal component for creating interactive pop-up dialogs in web applications.", | ||
"@biomejs/biome": "1.5.1", | ||
"@flexilla/utilities": "^1.0.1", | ||
"@flexilla/utilities": "^1.1.0", | ||
"typescript": "^5.2.2", | ||
@@ -70,3 +70,3 @@ "vite": "^5.0.8", | ||
"author": "johnkat-mj", | ||
"gitHead": "83fd699f629e3c87cedc15857e7335b80b3e5532" | ||
"gitHead": "18549edaac73621574bb4df22436305c201c47c8" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
226
0