ninegrid2 6.658.0 → 6.660.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.
@@ -120120,13 +120120,17 @@ class nxSideMenu extends HTMLElement
120120
120120
  .then(() => this.#init())
120121
120121
  .catch(error => console.error(error));
120122
120122
 
120123
- const rawUrl = window.location.href; // 전체 URL
120124
- const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
120125
- const cleanPath = parsedUrl.pathname; // 👉 경로만 추출
120126
- console.log("1.=======================", cleanPath);
120127
-
120128
120123
  setTimeout(() => {
120129
- console.log(ninegrid.querySelectorAll("nx-side-menu-item", this.shadowRoot));
120124
+ if (!ninegrid.querySelector("nx-side-menu-item.active", this.shadowRoot)) {
120125
+ const rawUrl = window.location.href; // 전체 URL
120126
+ const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
120127
+ const href = parsedUrl.pathname; // 👉 경로만 추출
120128
+
120129
+ const el = ninegrid.querySelector(`nx-side-menu-item[href="${href}"]`, this.shadowRoot);
120130
+ if (el) {
120131
+ el.addClass("active");
120132
+ }
120133
+ }
120130
120134
  }, 1000);
120131
120135
 
120132
120136
  };
@@ -120116,13 +120116,17 @@ class nxSideMenu extends HTMLElement
120116
120116
  .then(() => this.#init())
120117
120117
  .catch(error => console.error(error));
120118
120118
 
120119
- const rawUrl = window.location.href; // 전체 URL
120120
- const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
120121
- const cleanPath = parsedUrl.pathname; // 👉 경로만 추출
120122
- console.log("1.=======================", cleanPath);
120123
-
120124
120119
  setTimeout(() => {
120125
- console.log(ninegrid.querySelectorAll("nx-side-menu-item", this.shadowRoot));
120120
+ if (!ninegrid.querySelector("nx-side-menu-item.active", this.shadowRoot)) {
120121
+ const rawUrl = window.location.href; // 전체 URL
120122
+ const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
120123
+ const href = parsedUrl.pathname; // 👉 경로만 추출
120124
+
120125
+ const el = ninegrid.querySelector(`nx-side-menu-item[href="${href}"]`, this.shadowRoot);
120126
+ if (el) {
120127
+ el.addClass("active");
120128
+ }
120129
+ }
120126
120130
  }, 1000);
120127
120131
 
120128
120132
  };
@@ -16,13 +16,17 @@ class nxSideMenu extends HTMLElement
16
16
  .then(() => this.#init())
17
17
  .catch(error => console.error(error));
18
18
 
19
- const rawUrl = window.location.href; // 전체 URL
20
- const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
21
- const cleanPath = parsedUrl.pathname; // 👉 경로만 추출
22
- console.log("1.=======================", cleanPath);
23
-
24
19
  setTimeout(() => {
25
- console.log(ninegrid.querySelectorAll("nx-side-menu-item", this.shadowRoot));
20
+ if (!ninegrid.querySelector("nx-side-menu-item.active", this.shadowRoot)) {
21
+ const rawUrl = window.location.href; // 전체 URL
22
+ const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
23
+ const href = parsedUrl.pathname; // 👉 경로만 추출
24
+
25
+ const el = ninegrid.querySelector(`nx-side-menu-item[href="${href}"]`, this.shadowRoot);
26
+ if (el) {
27
+ el.addClass("active");
28
+ }
29
+ }
26
30
  }, 1000);
27
31
 
28
32
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.658.0",
4
+ "version": "6.660.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -16,13 +16,17 @@ class nxSideMenu extends HTMLElement
16
16
  .then(() => this.#init())
17
17
  .catch(error => console.error(error));
18
18
 
19
- const rawUrl = window.location.href; // 전체 URL
20
- const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
21
- const cleanPath = parsedUrl.pathname; // 👉 경로만 추출
22
- console.log("1.=======================", cleanPath);
23
-
24
19
  setTimeout(() => {
25
- console.log(ninegrid.querySelectorAll("nx-side-menu-item", this.shadowRoot));
20
+ if (!ninegrid.querySelector("nx-side-menu-item.active", this.shadowRoot)) {
21
+ const rawUrl = window.location.href; // 전체 URL
22
+ const parsedUrl = new URL(rawUrl); // URL 객체로 파싱
23
+ const href = parsedUrl.pathname; // 👉 경로만 추출
24
+
25
+ const el = ninegrid.querySelector(`nx-side-menu-item[href="${href}"]`, this.shadowRoot);
26
+ if (el) {
27
+ el.addClass("active");
28
+ }
29
+ }
26
30
  }, 1000);
27
31
 
28
32
  };