@ninebone/util 0.9.188 → 0.9.189

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
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _name, _color, _Trace_instances, isTraceEnabled_fn, _a, _timer, _queue, _delay, _TaskDebouncer_instances, flush_fn, _request, _shift, _dialog, _init, _onMouseDown, _onTouchStart, _NineUxUtil_instances, prepare_fn, _mode, _detectMode, _startDrag, _init2, _prepareLayout, _onCloseCallback, _isInitialized, _NinePopup_instances, renderStructure_fn;
12
+ var _name, _color, _Trace_instances, isTraceEnabled_fn, _a, _timer, _queue, _delay, _TaskDebouncer_instances, flush_fn, _request, _shift, _dialog, _init, _onMouseDown, _onTouchStart, _NineUxUtil_instances, prepare_fn, _mode, _detectMode, _startDrag, _init2, _prepareLayout;
13
13
  import React from "react";
14
14
  import { createRoot } from "react-dom/client";
15
15
  const listeners = /* @__PURE__ */ new Set();
@@ -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.188"}/dist/css/nine-util.css";
1195
+ @import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"0.9.189"}/dist/css/nine-util.css";
1196
1196
  ${customImport}
1197
1197
  </style>
1198
1198
  ${gripTmpl}
@@ -1608,82 +1608,50 @@ class NineUtil {
1608
1608
  }
1609
1609
  }
1610
1610
  Object.assign(nine$1, new NineUtil());
1611
- class NinePopup extends HTMLElement {
1611
+ class NinePopup extends BasePopup {
1612
+ static get tagName() {
1613
+ return "nine-popup";
1614
+ }
1612
1615
  constructor() {
1613
1616
  super();
1614
- __privateAdd(this, _NinePopup_instances);
1615
- __privateAdd(this, _onCloseCallback, null);
1616
- __privateAdd(this, _isInitialized, false);
1617
- }
1618
- get _onCloseCallback() {
1619
- return __privateGet(this, _onCloseCallback);
1620
1617
  }
1621
- set onclose(callbackFunc) {
1622
- if (typeof callbackFunc === "function") __privateSet(this, _onCloseCallback, callbackFunc);
1623
- }
1624
- connectedCallback() {
1625
- if (__privateGet(this, _isInitialized)) return;
1626
- if (!this.shadowRoot) {
1627
- this.attachShadow({ mode: "open" });
1628
- }
1629
- __privateMethod(this, _NinePopup_instances, renderStructure_fn).call(this);
1630
- __privateSet(this, _isInitialized, true);
1631
- }
1632
- open() {
1633
- this.classList.add("open");
1618
+ /**
1619
+ * 뼈대 렌더링 함수 (BasePopup.open의 renderFn으로 바인딩될 녀석)
1620
+ */
1621
+ render(config2) {
1622
+ this.shadowRoot.innerHTML = `
1623
+ <style>
1624
+ :host { display: block; }
1625
+ /* 팝업 창 자체를 감싸는 오버레이 최소한의 방어선 */
1626
+ nine-dialog::part(dialog) {
1627
+ min-width: 500px;
1628
+ max-width: 90%;
1629
+ }
1630
+ </style>
1631
+ <nine-dialog>
1632
+ <div class="popup-body">
1633
+ </div>
1634
+ </nine-dialog>
1635
+ `;
1634
1636
  }
1635
- close(callbackData = null) {
1636
- this.classList.remove("open");
1637
- if (typeof __privateGet(this, _onCloseCallback) === "function") {
1638
- __privateGet(this, _onCloseCallback).call(this, callbackData);
1639
- }
1637
+ /**
1638
+ * 버튼 이벤트 바인딩 배선 (BasePopup.open의 내부 명세)
1639
+ */
1640
+ setupEvents(resolve, dialogComp) {
1641
+ this.popupBody;
1642
+ this.addEventListener("request-close", (e) => {
1643
+ dialogComp.closeWithAnimation(e.detail);
1644
+ });
1640
1645
  }
1641
- // 🔒 만능 동적 팝업 엔진(NineUtil) 전용 입구 개방
1646
+ // 🔒 만능 동적 팝업 엔진이 리액트 19 루트를 꽂을 입구 게터
1642
1647
  get popupBody() {
1643
1648
  var _a2;
1644
- return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector(".popup-body")) || null;
1649
+ return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog .popup-body")) || null;
1645
1650
  }
1646
1651
  }
1647
- _onCloseCallback = new WeakMap();
1648
- _isInitialized = new WeakMap();
1649
- _NinePopup_instances = new WeakSet();
1650
- renderStructure_fn = function() {
1651
- if (this.shadowRoot.querySelector(".popup-dimmed")) return;
1652
- const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-util.css";` : "";
1653
- const $styleTmpl = document.createElement("template");
1654
- $styleTmpl.innerHTML = `
1655
- <style>
1656
- @import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"0.9.188"}/dist/css/nine-util.css";
1657
- ${customImport}
1658
-
1659
- :host { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; }
1660
- :host(.open) { display: block; }
1661
- .popup-dimmed { position: absolute; top:0; left:0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; }
1662
- .popup-content { background: #fff; border-radius: 8px; min-width: 500px; max-width: 90%; box-shadow: 0 4px 15px rgba(0,0,0,0.25); display: flex; flex-direction: column; overflow: hidden; }
1663
- .popup-header { padding: 15px 20px; border-bottom: 1px solid #eee; font-weight: bold; background: #f9f9f9; }
1664
- .popup-body { padding: 20px; min-height: 150px; overflow-y: auto; }
1665
- </style>
1666
- `;
1667
- this.shadowRoot.appendChild($styleTmpl.content.cloneNode(true));
1668
- const $dimmed = document.createElement("div");
1669
- $dimmed.className = "popup-dimmed";
1670
- $dimmed.addEventListener("click", (e) => {
1671
- if (e.target === $dimmed) this.close();
1672
- });
1673
- const $content = document.createElement("div");
1674
- $content.className = "popup-content";
1675
- $content.innerHTML = `
1676
- <div class="popup-header"></div>
1677
- <div class="popup-body"></div>
1678
- `;
1679
- const $bodySpace = $content.querySelector(".popup-body");
1680
- while (this.firstChild) {
1681
- $bodySpace.appendChild(this.firstChild);
1682
- }
1683
- $dimmed.appendChild($content);
1684
- this.shadowRoot.appendChild($dimmed);
1685
- };
1686
- if (!customElements.get("nine-popup")) customElements.define("nine-popup", NinePopup);
1652
+ if (!customElements.get("nine-popup")) {
1653
+ customElements.define("nine-popup", NinePopup);
1654
+ }
1687
1655
  nine$1.safe = safe;
1688
1656
  nine$1.api = api;
1689
1657
  nine$1.trace = trace$2;