ninegrid2 6.918.0 → 6.921.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.
@@ -11155,6 +11155,29 @@ class ninegrid {
11155
11155
  }, intervalTime);
11156
11156
  });
11157
11157
  };
11158
+
11159
+ static delayQuerySelector = (selector, root = document, maxAttempts = 3, intervalTime = 100) => {
11160
+ return new Promise((resolve, reject) => {
11161
+ let attempts = 0;
11162
+ const interval = setInterval(() => {
11163
+ const el = ninegrid.querySelector(selector, root);
11164
+ console.log(el);
11165
+ if (el) {
11166
+ //console.log("InnerHTML 확인됨, init() 실행 가능!");
11167
+ clearInterval(interval);
11168
+ resolve();
11169
+ } else {
11170
+ attempts++;
11171
+ //console.log(`InnerHTML이 비어 있음, ${attempts}/${maxAttempts}번 재시도`);
11172
+
11173
+ if (attempts >= maxAttempts) {
11174
+ clearInterval(interval);
11175
+ reject("Element를 찾지 못했습니다.");
11176
+ }
11177
+ }
11178
+ }, intervalTime);
11179
+ });
11180
+ };
11158
11181
 
11159
11182
  static copyProperty = (target, source, properties) => {
11160
11183
 
@@ -121655,11 +121678,7 @@ class nxTitle extends HTMLElement {
121655
121678
  }
121656
121679
 
121657
121680
  connectedCallback() {
121658
- if (document.readyState === 'loading') { // DOM이 아직 로딩 중이면
121659
- document.addEventListener('DOMContentLoaded', this.#init);
121660
- } else { // DOM이 이미 로드 완료되었으면 즉시 실행
121661
- this.#init();
121662
- }
121681
+ this.#init();
121663
121682
  }
121664
121683
 
121665
121684
  // 컴포넌트가 DOM에서 제거될 때 이벤트 리스너를 정리
@@ -121669,8 +121688,19 @@ class nxTitle extends HTMLElement {
121669
121688
 
121670
121689
 
121671
121690
  #init = () => {
121691
+ /**
121692
+ console.log("111");
121693
+ const activeMenuItem = ninegrid.delayQuerySelector('nx-side-menu-item.active');
121694
+ console.log(activeMenuItem);
121695
+
121672
121696
  this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
121673
121697
  this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
121698
+ */
121699
+ ninegrid.delayQuerySelector('nx-side-menu-item.active')
121700
+ .then(() => {
121701
+ this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
121702
+ this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
121703
+ });
121674
121704
  };
121675
121705
 
121676
121706
  // Breadcrumb 경로를 구성하는 비공개 메서드
@@ -11151,6 +11151,29 @@ class ninegrid {
11151
11151
  }, intervalTime);
11152
11152
  });
11153
11153
  };
11154
+
11155
+ static delayQuerySelector = (selector, root = document, maxAttempts = 3, intervalTime = 100) => {
11156
+ return new Promise((resolve, reject) => {
11157
+ let attempts = 0;
11158
+ const interval = setInterval(() => {
11159
+ const el = ninegrid.querySelector(selector, root);
11160
+ console.log(el);
11161
+ if (el) {
11162
+ //console.log("InnerHTML 확인됨, init() 실행 가능!");
11163
+ clearInterval(interval);
11164
+ resolve();
11165
+ } else {
11166
+ attempts++;
11167
+ //console.log(`InnerHTML이 비어 있음, ${attempts}/${maxAttempts}번 재시도`);
11168
+
11169
+ if (attempts >= maxAttempts) {
11170
+ clearInterval(interval);
11171
+ reject("Element를 찾지 못했습니다.");
11172
+ }
11173
+ }
11174
+ }, intervalTime);
11175
+ });
11176
+ };
11154
11177
 
11155
11178
  static copyProperty = (target, source, properties) => {
11156
11179
 
@@ -121651,11 +121674,7 @@ class nxTitle extends HTMLElement {
121651
121674
  }
121652
121675
 
121653
121676
  connectedCallback() {
121654
- if (document.readyState === 'loading') { // DOM이 아직 로딩 중이면
121655
- document.addEventListener('DOMContentLoaded', this.#init);
121656
- } else { // DOM이 이미 로드 완료되었으면 즉시 실행
121657
- this.#init();
121658
- }
121677
+ this.#init();
121659
121678
  }
121660
121679
 
121661
121680
  // 컴포넌트가 DOM에서 제거될 때 이벤트 리스너를 정리
@@ -121665,8 +121684,19 @@ class nxTitle extends HTMLElement {
121665
121684
 
121666
121685
 
121667
121686
  #init = () => {
121687
+ /**
121688
+ console.log("111");
121689
+ const activeMenuItem = ninegrid.delayQuerySelector('nx-side-menu-item.active');
121690
+ console.log(activeMenuItem);
121691
+
121668
121692
  this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
121669
121693
  this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
121694
+ */
121695
+ ninegrid.delayQuerySelector('nx-side-menu-item.active')
121696
+ .then(() => {
121697
+ this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
121698
+ this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
121699
+ });
121670
121700
  };
121671
121701
 
121672
121702
  // Breadcrumb 경로를 구성하는 비공개 메서드
@@ -10,11 +10,7 @@ class nxTitle extends HTMLElement {
10
10
  }
11
11
 
12
12
  connectedCallback() {
13
- if (document.readyState === 'loading') { // DOM이 아직 로딩 중이면
14
- document.addEventListener('DOMContentLoaded', this.#init);
15
- } else { // DOM이 이미 로드 완료되었으면 즉시 실행
16
- this.#init();
17
- }
13
+ this.#init();
18
14
  }
19
15
 
20
16
  // 컴포넌트가 DOM에서 제거될 때 이벤트 리스너를 정리
@@ -24,8 +20,19 @@ class nxTitle extends HTMLElement {
24
20
 
25
21
 
26
22
  #init = () => {
23
+ /**
24
+ console.log("111");
25
+ const activeMenuItem = ninegrid.delayQuerySelector('nx-side-menu-item.active');
26
+ console.log(activeMenuItem);
27
+
27
28
  this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
28
29
  this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
30
+ */
31
+ ninegrid.delayQuerySelector('nx-side-menu-item.active')
32
+ .then(() => {
33
+ this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
34
+ this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
35
+ });
29
36
  };
30
37
 
31
38
  // Breadcrumb 경로를 구성하는 비공개 메서드
@@ -288,6 +288,29 @@ export class ninegrid {
288
288
  }, intervalTime);
289
289
  });
290
290
  };
291
+
292
+ static delayQuerySelector = (selector, root = document, maxAttempts = 3, intervalTime = 100) => {
293
+ return new Promise((resolve, reject) => {
294
+ let attempts = 0;
295
+ const interval = setInterval(() => {
296
+ const el = ninegrid.querySelector(selector, root);
297
+ console.log(el);
298
+ if (el) {
299
+ //console.log("InnerHTML 확인됨, init() 실행 가능!");
300
+ clearInterval(interval);
301
+ resolve();
302
+ } else {
303
+ attempts++;
304
+ //console.log(`InnerHTML이 비어 있음, ${attempts}/${maxAttempts}번 재시도`);
305
+
306
+ if (attempts >= maxAttempts) {
307
+ clearInterval(interval);
308
+ reject("Element를 찾지 못했습니다.");
309
+ }
310
+ }
311
+ }, intervalTime);
312
+ });
313
+ };
291
314
 
292
315
  static copyProperty = (target, source, properties) => {
293
316
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.918.0",
4
+ "version": "6.921.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
package/src/nx/nxTitle.js CHANGED
@@ -10,11 +10,7 @@ class nxTitle extends HTMLElement {
10
10
  }
11
11
 
12
12
  connectedCallback() {
13
- if (document.readyState === 'loading') { // DOM이 아직 로딩 중이면
14
- document.addEventListener('DOMContentLoaded', this.#init);
15
- } else { // DOM이 이미 로드 완료되었으면 즉시 실행
16
- this.#init();
17
- }
13
+ this.#init();
18
14
  }
19
15
 
20
16
  // 컴포넌트가 DOM에서 제거될 때 이벤트 리스너를 정리
@@ -24,8 +20,19 @@ class nxTitle extends HTMLElement {
24
20
 
25
21
 
26
22
  #init = () => {
23
+ /**
24
+ console.log("111");
25
+ const activeMenuItem = ninegrid.delayQuerySelector('nx-side-menu-item.active');
26
+ console.log(activeMenuItem);
27
+
27
28
  this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
28
29
  this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
30
+ */
31
+ ninegrid.delayQuerySelector('nx-side-menu-item.active')
32
+ .then(() => {
33
+ this.#generateBreadcrumb(); // 빵 부스러기 데이터 생성 및 최종 렌더링 트리거
34
+ this.#renderer(); // 초기 렌더링 (빵 부스러기 데이터는 아직 없음)
35
+ });
29
36
  };
30
37
 
31
38
  // Breadcrumb 경로를 구성하는 비공개 메서드
@@ -288,6 +288,29 @@ export class ninegrid {
288
288
  }, intervalTime);
289
289
  });
290
290
  };
291
+
292
+ static delayQuerySelector = (selector, root = document, maxAttempts = 3, intervalTime = 100) => {
293
+ return new Promise((resolve, reject) => {
294
+ let attempts = 0;
295
+ const interval = setInterval(() => {
296
+ const el = ninegrid.querySelector(selector, root);
297
+ console.log(el);
298
+ if (el) {
299
+ //console.log("InnerHTML 확인됨, init() 실행 가능!");
300
+ clearInterval(interval);
301
+ resolve();
302
+ } else {
303
+ attempts++;
304
+ //console.log(`InnerHTML이 비어 있음, ${attempts}/${maxAttempts}번 재시도`);
305
+
306
+ if (attempts >= maxAttempts) {
307
+ clearInterval(interval);
308
+ reject("Element를 찾지 못했습니다.");
309
+ }
310
+ }
311
+ }, intervalTime);
312
+ });
313
+ };
291
314
 
292
315
  static copyProperty = (target, source, properties) => {
293
316