@ninebone/util 0.9.190 → 0.9.191

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 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.190"}/dist/css/nine-util.css";
1195
+ @import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"0.9.191"}/dist/css/nine-util.css";
1196
1196
  ${customImport}
1197
1197
  </style>
1198
1198
  ${gripTmpl}
@@ -1542,31 +1542,31 @@ class NineUtil {
1542
1542
  __publicField(this, "popup", (ContentComponent, options = {}, onCloseCallback = null) => {
1543
1543
  const title = options.title || "Details";
1544
1544
  const componentProps = options.props || {};
1545
- NinePopup.open(
1546
- NinePopup,
1547
- null,
1548
- // message (일반 얼럿이 아니므로 패스)
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) {
1545
+ document.querySelectorAll(NinePopup.tagName).forEach((el) => el.remove());
1546
+ const $popupWrapper = document.createElement(NinePopup.tagName);
1547
+ document.body.appendChild($popupWrapper);
1548
+ return new Promise((resolve) => {
1562
1549
  const $bodySpace = $popupWrapper.popupBody;
1550
+ const $dialogComp = $popupWrapper.dialog;
1551
+ if ($dialogComp) $dialogComp.setAttribute("subject", title);
1563
1552
  const root = createRoot($bodySpace);
1564
- const dialogComp = $popupWrapper.shadowRoot.querySelector("nine-dialog");
1565
- dialogComp == null ? void 0 : dialogComp.addEventListener("closed", () => {
1566
- setTimeout(() => root.unmount(), 0);
1553
+ $dialogComp == null ? void 0 : $dialogComp.addEventListener("closed", (e) => {
1554
+ const resultData = e.detail;
1555
+ if (typeof onCloseCallback === "function") onCloseCallback(resultData);
1556
+ resolve(resultData);
1557
+ setTimeout(() => {
1558
+ root.unmount();
1559
+ $popupWrapper.remove();
1560
+ }, 0);
1561
+ });
1562
+ $popupWrapper.addEventListener("request-close", (e) => {
1563
+ $dialogComp == null ? void 0 : $dialogComp.closeWithAnimation(e.detail);
1567
1564
  });
1568
1565
  root.render(React.createElement(ContentComponent, componentProps));
1569
- }
1566
+ setTimeout(() => {
1567
+ $dialogComp == null ? void 0 : $dialogComp.showModal();
1568
+ }, 0);
1569
+ });
1570
1570
  });
1571
1571
  /**
1572
1572
  * 🎯 2. Shadow DOM 경계를 무력화하고 깊이 상관없이 모든 요소를 수집하는 만능 쿼리
@@ -1620,50 +1620,33 @@ class NineUtil {
1620
1620
  }
1621
1621
  }
1622
1622
  Object.assign(nine$1, new NineUtil());
1623
- let NinePopup$1 = class NinePopup2 extends BasePopup {
1623
+ let NinePopup$1 = class NinePopup2 extends HTMLElement {
1624
1624
  static get tagName() {
1625
1625
  return "nine-popup";
1626
1626
  }
1627
1627
  constructor() {
1628
1628
  super();
1629
+ this.attachShadow({ mode: "open" });
1629
1630
  }
1630
- /**
1631
- * 뼈대 렌더링 함수 (BasePopup.open의 renderFn으로 바인딩될 녀석)
1632
- */
1633
- render(config2) {
1631
+ connectedCallback() {
1634
1632
  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
1633
  <nine-dialog>
1644
- <div class="popup-body">
1645
- </div>
1634
+ <div class="popup-body"></div>
1646
1635
  </nine-dialog>
1647
1636
  `;
1648
1637
  }
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 루트를 꽂을 입구 게터
1638
+ // 🔓 리액트 엔진이 꽂아 넣을 입구 포인터 개방
1659
1639
  get popupBody() {
1660
1640
  var _a2;
1661
1641
  return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog .popup-body")) || null;
1662
1642
  }
1643
+ // 🔓 리액트나 외부 유틸에서 직접 제어할 수 있는 제어 통로
1644
+ get dialog() {
1645
+ var _a2;
1646
+ return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog")) || null;
1647
+ }
1663
1648
  };
1664
- if (!customElements.get("nine-popup")) {
1665
- customElements.define("nine-popup", NinePopup$1);
1666
- }
1649
+ if (!customElements.get("nine-popup")) customElements.define("nine-popup", NinePopup$1);
1667
1650
  nine$1.safe = safe;
1668
1651
  nine$1.api = api;
1669
1652
  nine$1.trace = trace$2;