@ninebone/util 0.9.187 โ†’ 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, _root, _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.187"}/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,76 +1608,50 @@ class NineUtil {
1608
1608
  }
1609
1609
  }
1610
1610
  Object.assign(nine$1, new NineUtil());
1611
- class NinePopup extends HTMLElement {
1612
- // ๐Ÿ”’ Shadow DOM ๋ฃจํŠธ๋ฅผ ๋‹ด์„ ์ฃผ๋จธ๋‹ˆ
1611
+ class NinePopup extends BasePopup {
1612
+ static get tagName() {
1613
+ return "nine-popup";
1614
+ }
1613
1615
  constructor() {
1614
1616
  super();
1615
- __privateAdd(this, _NinePopup_instances);
1616
- __privateAdd(this, _onCloseCallback, null);
1617
- __privateAdd(this, _isInitialized, false);
1618
- __privateAdd(this, _root);
1619
- }
1620
- get _onCloseCallback() {
1621
- return __privateGet(this, _onCloseCallback);
1622
1617
  }
1623
- set onclose(callbackFunc) {
1624
- if (typeof callbackFunc === "function") __privateSet(this, _onCloseCallback, callbackFunc);
1625
- }
1626
- connectedCallback() {
1627
- if (__privateGet(this, _isInitialized)) return;
1628
- if (!this.shadowRoot) {
1629
- this.attachShadow({ mode: "open" });
1630
- }
1631
- __privateSet(this, _root, this.shadowRoot);
1632
- __privateMethod(this, _NinePopup_instances, renderStructure_fn).call(this);
1633
- __privateSet(this, _isInitialized, true);
1634
- }
1635
- open() {
1636
- 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
+ `;
1637
1636
  }
1638
- close(callbackData = null) {
1639
- this.classList.remove("open");
1640
- if (typeof __privateGet(this, _onCloseCallback) === "function") {
1641
- __privateGet(this, _onCloseCallback).call(this, callbackData);
1642
- }
1637
+ /**
1638
+ * ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ๋ฐ”์ธ๋”ฉ ๋ฐฐ์„  (BasePopup.open์˜ ๋‚ด๋ถ€ ๋ช…์„ธ)
1639
+ */
1640
+ setupEvents(resolve, dialogComp) {
1641
+ this.popupBody;
1642
+ this.addEventListener("request-close", (e) => {
1643
+ dialogComp.closeWithAnimation(e.detail);
1644
+ });
1643
1645
  }
1644
- // ๐Ÿ”’ [ํผ๋ธ”๋ฆญ ๊ฒŒํ„ฐ] ๋™์  ๋ Œ๋”๋ง ์—”์ง„(NineUtil)์ด Shadow DOM ๋‚ด๋ถ€์˜ ๋ฐ”๋”” ๊ณต๊ฐ„์„ ์ฐพ์„ ์ˆ˜ ์žˆ๋„๋ก ํ†ต๋กœ ๊ฐœ๋ฐฉ
1646
+ // ๐Ÿ”’ ๋งŒ๋Šฅ ๋™์  ํŒ์—… ์—”์ง„์ด ๋ฆฌ์•กํŠธ 19 ๋ฃจํŠธ๋ฅผ ๊ฝ‚์„ ์ž…๊ตฌ ๊ฒŒํ„ฐ
1645
1647
  get popupBody() {
1646
1648
  var _a2;
1647
- return ((_a2 = __privateGet(this, _root)) == null ? void 0 : _a2.querySelector(".popup-body")) || null;
1649
+ return ((_a2 = this.shadowRoot) == null ? void 0 : _a2.querySelector("nine-dialog .popup-body")) || null;
1648
1650
  }
1649
1651
  }
1650
- _onCloseCallback = new WeakMap();
1651
- _isInitialized = new WeakMap();
1652
- _root = new WeakMap();
1653
- _NinePopup_instances = new WeakSet();
1654
- renderStructure_fn = function() {
1655
- if (__privateGet(this, _root).querySelector(".popup-dimmed")) return;
1656
- const $dimmed = document.createElement("div");
1657
- $dimmed.className = "popup-dimmed";
1658
- $dimmed.addEventListener("click", (e) => {
1659
- if (e.target === $dimmed) this.close();
1660
- });
1661
- const $content = document.createElement("div");
1662
- $content.className = "popup-content";
1663
- const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-util.css";` : "";
1664
- $content.innerHTML = `
1665
- <style>
1666
- @import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"0.9.187"}/dist/css/nine-util.css";
1667
- ${customImport}
1668
- </style>
1669
-
1670
- <div class="popup-header"></div>
1671
- <div class="popup-body"></div>
1672
- `;
1673
- const $bodySpace = $content.querySelector(".popup-body");
1674
- while (this.firstChild) {
1675
- $bodySpace.appendChild(this.firstChild);
1676
- }
1677
- $dimmed.appendChild($content);
1678
- __privateGet(this, _root).appendChild($dimmed);
1679
- };
1680
- if (!customElements.get("nine-popup")) customElements.define("nine-popup", NinePopup);
1652
+ if (!customElements.get("nine-popup")) {
1653
+ customElements.define("nine-popup", NinePopup);
1654
+ }
1681
1655
  nine$1.safe = safe;
1682
1656
  nine$1.api = api;
1683
1657
  nine$1.trace = trace$2;