ninegrid2 6.662.0 → 6.664.0

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.
@@ -120131,7 +120131,7 @@ class nxSideMenu extends HTMLElement
120131
120131
  el.classList.add("active");
120132
120132
  }
120133
120133
  }
120134
- }, 1000);
120134
+ }, 300);
120135
120135
 
120136
120136
  };
120137
120137
 
@@ -121045,6 +121045,52 @@ Array.prototype.nineBinarySearch = function(target)
121045
121045
  return -1;
121046
121046
  };
121047
121047
 
121048
+ class nxSplitter extends HTMLElement {
121049
+ #mode;
121050
+
121051
+ constructor() {
121052
+ super();
121053
+ this.attachShadow({ mode: "open" });
121054
+ }
121055
+
121056
+ connectedCallback() {
121057
+ this.#init();
121058
+ }
121059
+
121060
+ #detectMode(el) {
121061
+ const prev = el.previousElementSibling;
121062
+ const next = el.nextElementSibling;
121063
+
121064
+ const prevRect = prev?.getBoundingClientRect();
121065
+ const nextRect = next?.getBoundingClientRect();
121066
+
121067
+ this.#mode = (!prevRect || !nextRect) || (Math.abs(prevRect.top - nextRect.top) < 5) ? "h" : "v";
121068
+ }
121069
+
121070
+ #init = () => {
121071
+ this.#detectMode(this);
121072
+
121073
+ const contents = this.innerHTML.trim();
121074
+ const gripClass = `grip-${this.#mode}`;
121075
+ const gripTmpl = (contents === "") ? `<div class="${gripClass}"></div>`: `<div class="${gripClass}"></div>${contents}<div class="${gripClass}"></div>`;
121076
+
121077
+ this.innerHTML = ""; // 기존 내부 HTML 제거
121078
+ const htmlTmpl = document.createElement("template");
121079
+ htmlTmpl.innerHTML = `
121080
+ <style>
121081
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxSplitter.css";
121082
+ ${ninegrid.getCustomPath(this,"nxSplitter.css")}
121083
+ </style>
121084
+
121085
+ ${gripTmpl}
121086
+ `;
121087
+
121088
+ this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
121089
+ }
121090
+ }
121091
+
121092
+ customElements.define("nx-splitter", nxSplitter);
121093
+
121048
121094
  class aiSettings extends HTMLElement
121049
121095
  {
121050
121096
  constructor() {
@@ -120127,7 +120127,7 @@ class nxSideMenu extends HTMLElement
120127
120127
  el.classList.add("active");
120128
120128
  }
120129
120129
  }
120130
- }, 1000);
120130
+ }, 300);
120131
120131
 
120132
120132
  };
120133
120133
 
@@ -121041,6 +121041,52 @@ Array.prototype.nineBinarySearch = function(target)
121041
121041
  return -1;
121042
121042
  };
121043
121043
 
121044
+ class nxSplitter extends HTMLElement {
121045
+ #mode;
121046
+
121047
+ constructor() {
121048
+ super();
121049
+ this.attachShadow({ mode: "open" });
121050
+ }
121051
+
121052
+ connectedCallback() {
121053
+ this.#init();
121054
+ }
121055
+
121056
+ #detectMode(el) {
121057
+ const prev = el.previousElementSibling;
121058
+ const next = el.nextElementSibling;
121059
+
121060
+ const prevRect = prev?.getBoundingClientRect();
121061
+ const nextRect = next?.getBoundingClientRect();
121062
+
121063
+ this.#mode = (!prevRect || !nextRect) || (Math.abs(prevRect.top - nextRect.top) < 5) ? "h" : "v";
121064
+ }
121065
+
121066
+ #init = () => {
121067
+ this.#detectMode(this);
121068
+
121069
+ const contents = this.innerHTML.trim();
121070
+ const gripClass = `grip-${this.#mode}`;
121071
+ const gripTmpl = (contents === "") ? `<div class="${gripClass}"></div>`: `<div class="${gripClass}"></div>${contents}<div class="${gripClass}"></div>`;
121072
+
121073
+ this.innerHTML = ""; // 기존 내부 HTML 제거
121074
+ const htmlTmpl = document.createElement("template");
121075
+ htmlTmpl.innerHTML = `
121076
+ <style>
121077
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxSplitter.css";
121078
+ ${ninegrid.getCustomPath(this,"nxSplitter.css")}
121079
+ </style>
121080
+
121081
+ ${gripTmpl}
121082
+ `;
121083
+
121084
+ this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
121085
+ }
121086
+ }
121087
+
121088
+ customElements.define("nx-splitter", nxSplitter);
121089
+
121044
121090
  class aiSettings extends HTMLElement
121045
121091
  {
121046
121092
  constructor() {
@@ -27,7 +27,7 @@ class nxSideMenu extends HTMLElement
27
27
  el.classList.add("active");
28
28
  }
29
29
  }
30
- }, 1000);
30
+ }, 300);
31
31
 
32
32
  };
33
33
 
package/dist/index.js CHANGED
@@ -101,6 +101,8 @@ import "./etc/nxTopMenu.js";
101
101
  import "./utils/ngFiltering.js";
102
102
  import "./utils/ngPrototype.js";
103
103
 
104
+ import "./nx/nxSplitter.js";
105
+
104
106
 
105
107
  import "./ai/aiSettings.js";
106
108
  import "./ai/aiMessage.js";
@@ -0,0 +1,47 @@
1
+ import ninegrid from "../index.js";
2
+
3
+ class nxSplitter extends HTMLElement {
4
+ #mode;
5
+
6
+ constructor() {
7
+ super();
8
+ this.attachShadow({ mode: "open" });
9
+ }
10
+
11
+ connectedCallback() {
12
+ this.#init();
13
+ }
14
+
15
+ #detectMode(el) {
16
+ const prev = el.previousElementSibling;
17
+ const next = el.nextElementSibling;
18
+
19
+ const prevRect = prev?.getBoundingClientRect();
20
+ const nextRect = next?.getBoundingClientRect();
21
+
22
+ this.#mode = (!prevRect || !nextRect) || (Math.abs(prevRect.top - nextRect.top) < 5) ? "h" : "v";
23
+ }
24
+
25
+ #init = () => {
26
+ this.#detectMode(this);
27
+
28
+ const contents = this.innerHTML.trim();
29
+ const gripClass = `grip-${this.#mode}`;
30
+ const gripTmpl = (contents === "") ? `<div class="${gripClass}"></div>`: `<div class="${gripClass}"></div>${contents}<div class="${gripClass}"></div>`;
31
+
32
+ this.innerHTML = ""; // 기존 내부 HTML 제거
33
+ const htmlTmpl = document.createElement("template");
34
+ htmlTmpl.innerHTML = `
35
+ <style>
36
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxSplitter.css";
37
+ ${ninegrid.getCustomPath(this,"nxSplitter.css")}
38
+ </style>
39
+
40
+ ${gripTmpl}
41
+ `;
42
+
43
+ this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
44
+ }
45
+ }
46
+
47
+ customElements.define("nx-splitter", nxSplitter);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.662.0",
4
+ "version": "6.664.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -27,7 +27,7 @@ class nxSideMenu extends HTMLElement
27
27
  el.classList.add("active");
28
28
  }
29
29
  }
30
- }, 1000);
30
+ }, 300);
31
31
 
32
32
  };
33
33
 
package/src/index.js CHANGED
@@ -101,6 +101,8 @@ import "./etc/nxTopMenu.js";
101
101
  import "./utils/ngFiltering.js";
102
102
  import "./utils/ngPrototype.js";
103
103
 
104
+ import "./nx/nxSplitter.js";
105
+
104
106
 
105
107
  import "./ai/aiSettings.js";
106
108
  import "./ai/aiMessage.js";
@@ -0,0 +1,47 @@
1
+ import ninegrid from "../index.js";
2
+
3
+ class nxSplitter extends HTMLElement {
4
+ #mode;
5
+
6
+ constructor() {
7
+ super();
8
+ this.attachShadow({ mode: "open" });
9
+ }
10
+
11
+ connectedCallback() {
12
+ this.#init();
13
+ }
14
+
15
+ #detectMode(el) {
16
+ const prev = el.previousElementSibling;
17
+ const next = el.nextElementSibling;
18
+
19
+ const prevRect = prev?.getBoundingClientRect();
20
+ const nextRect = next?.getBoundingClientRect();
21
+
22
+ this.#mode = (!prevRect || !nextRect) || (Math.abs(prevRect.top - nextRect.top) < 5) ? "h" : "v";
23
+ }
24
+
25
+ #init = () => {
26
+ this.#detectMode(this);
27
+
28
+ const contents = this.innerHTML.trim();
29
+ const gripClass = `grip-${this.#mode}`;
30
+ const gripTmpl = (contents === "") ? `<div class="${gripClass}"></div>`: `<div class="${gripClass}"></div>${contents}<div class="${gripClass}"></div>`;
31
+
32
+ this.innerHTML = ""; // 기존 내부 HTML 제거
33
+ const htmlTmpl = document.createElement("template");
34
+ htmlTmpl.innerHTML = `
35
+ <style>
36
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/nxSplitter.css";
37
+ ${ninegrid.getCustomPath(this,"nxSplitter.css")}
38
+ </style>
39
+
40
+ ${gripTmpl}
41
+ `;
42
+
43
+ this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
44
+ }
45
+ }
46
+
47
+ customElements.define("nx-splitter", nxSplitter);