@ninebone/util 0.9.190 โ 0.9.192
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/nine-util.js +49 -66
- package/dist/nine-util.js.map +1 -1
- package/dist/nine-util.umd.js +1 -1
- package/dist/nine-util.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-util.js
CHANGED
|
@@ -1192,7 +1192,7 @@ class UxSplitter extends HTMLElement {
|
|
|
1192
1192
|
const htmlTmpl = document.createElement("template");
|
|
1193
1193
|
htmlTmpl.innerHTML = `
|
|
1194
1194
|
<style>
|
|
1195
|
-
@import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"0.9.
|
|
1195
|
+
@import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"0.9.192"}/dist/css/nine-util.css";
|
|
1196
1196
|
${customImport}
|
|
1197
1197
|
</style>
|
|
1198
1198
|
${gripTmpl}
|
|
@@ -1527,6 +1527,33 @@ function requireDayjs_min() {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
var dayjs_minExports = requireDayjs_min();
|
|
1529
1529
|
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
1530
|
+
class NinePopup extends HTMLElement {
|
|
1531
|
+
static get tagName() {
|
|
1532
|
+
return "nine-popup";
|
|
1533
|
+
}
|
|
1534
|
+
constructor() {
|
|
1535
|
+
super();
|
|
1536
|
+
this.attachShadow({ mode: "open" });
|
|
1537
|
+
}
|
|
1538
|
+
connectedCallback() {
|
|
1539
|
+
this.shadowRoot.innerHTML = `
|
|
1540
|
+
<nine-dialog>
|
|
1541
|
+
<div class="popup-body"></div>
|
|
1542
|
+
</nine-dialog>
|
|
1543
|
+
`;
|
|
1544
|
+
}
|
|
1545
|
+
// ๐ ๋ฆฌ์กํธ ์์ง์ด ๊ฝ์ ๋ฃ์ ์
๊ตฌ ํฌ์ธํฐ ๊ฐ๋ฐฉ
|
|
1546
|
+
get popupBody() {
|
|
1547
|
+
var _a2;
|
|
1548
|
+
return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog .popup-body")) || null;
|
|
1549
|
+
}
|
|
1550
|
+
// ๐ ๋ฆฌ์กํธ๋ ์ธ๋ถ ์ ํธ์์ ์ง์ ์ ์ดํ ์ ์๋ ์ ์ด ํต๋ก
|
|
1551
|
+
get dialog() {
|
|
1552
|
+
var _a2;
|
|
1553
|
+
return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog")) || null;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
if (!customElements.get("nine-popup")) customElements.define("nine-popup", NinePopup);
|
|
1530
1557
|
class NineUtil {
|
|
1531
1558
|
constructor() {
|
|
1532
1559
|
// ๐
1. ๋ ์ง ํฌ๋งท ํฌํผ (์ธ์คํด์ค ๋ฉ์๋)
|
|
@@ -1542,31 +1569,31 @@ class NineUtil {
|
|
|
1542
1569
|
__publicField(this, "popup", (ContentComponent, options = {}, onCloseCallback = null) => {
|
|
1543
1570
|
const title = options.title || "Details";
|
|
1544
1571
|
const componentProps = options.props || {};
|
|
1545
|
-
NinePopup.
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
title,
|
|
1550
|
-
// ์ญ์ ๋๋๊ทธ ๋ฐ ํค๋์ ๊ฝํ ํ์ดํ๋ช
|
|
1551
|
-
options,
|
|
1552
|
-
// ์ถ๊ฐ ์ ๋๋ฉ์ด์
๋ฐ ํด๋์ค ์ต์
|
|
1553
|
-
(el, msg, cfg) => el.render(cfg)
|
|
1554
|
-
// ๋ ๋๋ง ํ๊ฒ ๋ฐฐ์
|
|
1555
|
-
).then((resultData) => {
|
|
1556
|
-
if (typeof onCloseCallback === "function") {
|
|
1557
|
-
onCloseCallback(resultData);
|
|
1558
|
-
}
|
|
1559
|
-
});
|
|
1560
|
-
const $popupWrapper = document.querySelector(NinePopup.tagName);
|
|
1561
|
-
if ($popupWrapper) {
|
|
1572
|
+
document.querySelectorAll(NinePopup.tagName).forEach((el) => el.remove());
|
|
1573
|
+
const $popupWrapper = document.createElement(NinePopup.tagName);
|
|
1574
|
+
document.body.appendChild($popupWrapper);
|
|
1575
|
+
return new Promise((resolve) => {
|
|
1562
1576
|
const $bodySpace = $popupWrapper.popupBody;
|
|
1577
|
+
const $dialogComp = $popupWrapper.dialog;
|
|
1578
|
+
if ($dialogComp) $dialogComp.setAttribute("subject", title);
|
|
1563
1579
|
const root = createRoot($bodySpace);
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1580
|
+
$dialogComp == null ? void 0 : $dialogComp.addEventListener("closed", (e) => {
|
|
1581
|
+
const resultData = e.detail;
|
|
1582
|
+
if (typeof onCloseCallback === "function") onCloseCallback(resultData);
|
|
1583
|
+
resolve(resultData);
|
|
1584
|
+
setTimeout(() => {
|
|
1585
|
+
root.unmount();
|
|
1586
|
+
$popupWrapper.remove();
|
|
1587
|
+
}, 0);
|
|
1588
|
+
});
|
|
1589
|
+
$popupWrapper.addEventListener("request-close", (e) => {
|
|
1590
|
+
$dialogComp == null ? void 0 : $dialogComp.closeWithAnimation(e.detail);
|
|
1567
1591
|
});
|
|
1568
1592
|
root.render(React.createElement(ContentComponent, componentProps));
|
|
1569
|
-
|
|
1593
|
+
setTimeout(() => {
|
|
1594
|
+
$dialogComp == null ? void 0 : $dialogComp.showModal();
|
|
1595
|
+
}, 0);
|
|
1596
|
+
});
|
|
1570
1597
|
});
|
|
1571
1598
|
/**
|
|
1572
1599
|
* ๐ฏ 2. Shadow DOM ๊ฒฝ๊ณ๋ฅผ ๋ฌด๋ ฅํํ๊ณ ๊น์ด ์๊ด์์ด ๋ชจ๋ ์์๋ฅผ ์์งํ๋ ๋ง๋ฅ ์ฟผ๋ฆฌ
|
|
@@ -1620,50 +1647,6 @@ class NineUtil {
|
|
|
1620
1647
|
}
|
|
1621
1648
|
}
|
|
1622
1649
|
Object.assign(nine$1, new NineUtil());
|
|
1623
|
-
let NinePopup$1 = class NinePopup2 extends BasePopup {
|
|
1624
|
-
static get tagName() {
|
|
1625
|
-
return "nine-popup";
|
|
1626
|
-
}
|
|
1627
|
-
constructor() {
|
|
1628
|
-
super();
|
|
1629
|
-
}
|
|
1630
|
-
/**
|
|
1631
|
-
* ๋ผ๋ ๋ ๋๋ง ํจ์ (BasePopup.open์ renderFn์ผ๋ก ๋ฐ์ธ๋ฉ๋ ๋
์)
|
|
1632
|
-
*/
|
|
1633
|
-
render(config2) {
|
|
1634
|
-
this.shadowRoot.innerHTML = `
|
|
1635
|
-
<style>
|
|
1636
|
-
:host { display: block; }
|
|
1637
|
-
/* ํ์
์ฐฝ ์์ฒด๋ฅผ ๊ฐ์ธ๋ ์ค๋ฒ๋ ์ด ์ต์ํ์ ๋ฐฉ์ด์ */
|
|
1638
|
-
nine-dialog::part(dialog) {
|
|
1639
|
-
min-width: 500px;
|
|
1640
|
-
max-width: 90%;
|
|
1641
|
-
}
|
|
1642
|
-
</style>
|
|
1643
|
-
<nine-dialog>
|
|
1644
|
-
<div class="popup-body">
|
|
1645
|
-
</div>
|
|
1646
|
-
</nine-dialog>
|
|
1647
|
-
`;
|
|
1648
|
-
}
|
|
1649
|
-
/**
|
|
1650
|
-
* ๋ฒํผ ์ด๋ฒคํธ ๋ฐ์ธ๋ฉ ๋ฐฐ์ (BasePopup.open์ ๋ด๋ถ ๋ช
์ธ)
|
|
1651
|
-
*/
|
|
1652
|
-
setupEvents(resolve, dialogComp) {
|
|
1653
|
-
this.popupBody;
|
|
1654
|
-
this.addEventListener("request-close", (e) => {
|
|
1655
|
-
dialogComp.closeWithAnimation(e.detail);
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1658
|
-
// ๐ ๋ง๋ฅ ๋์ ํ์
์์ง์ด ๋ฆฌ์กํธ 19 ๋ฃจํธ๋ฅผ ๊ฝ์ ์
๊ตฌ ๊ฒํฐ
|
|
1659
|
-
get popupBody() {
|
|
1660
|
-
var _a2;
|
|
1661
|
-
return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog .popup-body")) || null;
|
|
1662
|
-
}
|
|
1663
|
-
};
|
|
1664
|
-
if (!customElements.get("nine-popup")) {
|
|
1665
|
-
customElements.define("nine-popup", NinePopup$1);
|
|
1666
|
-
}
|
|
1667
1650
|
nine$1.safe = safe;
|
|
1668
1651
|
nine$1.api = api;
|
|
1669
1652
|
nine$1.trace = trace$2;
|