ninegrid2 6.946.0 → 6.948.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.
- package/dist/bundle.cjs.js +16 -12
- package/dist/bundle.esm.js +16 -12
- package/dist/nx/nxTitle.js +16 -12
- package/package.json +1 -1
- package/src/nx/nxTitle.js +16 -12
package/dist/bundle.cjs.js
CHANGED
|
@@ -121683,6 +121683,8 @@ customElements.define("nx-form", nxForm);
|
|
|
121683
121683
|
|
|
121684
121684
|
class nxTitle extends HTMLElement {
|
|
121685
121685
|
|
|
121686
|
+
|
|
121687
|
+
|
|
121686
121688
|
#breadcrumbPath = []; // Breadcrumb 경로를 저장할 내부 상태 초기화
|
|
121687
121689
|
|
|
121688
121690
|
constructor() {
|
|
@@ -121823,8 +121825,9 @@ class nxTitle extends HTMLElement {
|
|
|
121823
121825
|
const isCurrent = index === this.#breadcrumbPath.length - 1;
|
|
121824
121826
|
// static 메서드를 직접 호출하도록 수정
|
|
121825
121827
|
const linkTag = item.path && !isCurrent
|
|
121826
|
-
? `<a href="javascript:
|
|
121827
|
-
class="breadcrumb-item breadcrumb-link"
|
|
121828
|
+
? `<a href="javascript:void(0);">
|
|
121829
|
+
class="breadcrumb-item breadcrumb-link"
|
|
121830
|
+
data-path="${item.path}"
|
|
121828
121831
|
>${item.caption}</a>`
|
|
121829
121832
|
: `<span class="breadcrumb-item ${isCurrent ? 'breadcrumb-current' : ''}">${item.caption}</span>`;
|
|
121830
121833
|
|
|
@@ -121839,19 +121842,20 @@ class nxTitle extends HTMLElement {
|
|
|
121839
121842
|
`;
|
|
121840
121843
|
|
|
121841
121844
|
this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
|
|
121842
|
-
}
|
|
121843
121845
|
|
|
121844
|
-
|
|
121845
|
-
|
|
121846
|
-
|
|
121846
|
+
this.shadowRoot.querySelectorAll('.breadcrumb-link').forEach(link => {
|
|
121847
|
+
link.addEventListener('click', this.#menuClickHandler);
|
|
121848
|
+
});
|
|
121849
|
+
}
|
|
121847
121850
|
|
|
121848
|
-
|
|
121849
|
-
|
|
121850
|
-
|
|
121851
|
-
|
|
121851
|
+
#menuClickHandler = (e) => {
|
|
121852
|
+
console.log(e);
|
|
121853
|
+
const path = e.target.dataset.path;
|
|
121854
|
+
if (path && window.location.pathname === path) {
|
|
121855
|
+
// path가 현재 URL과 같으면 private 메서드 #aaa() 호출
|
|
121856
|
+
console.log('1111');
|
|
121852
121857
|
} else {
|
|
121853
|
-
console.log(
|
|
121854
|
-
window.location.href = path;
|
|
121858
|
+
console.log("222");
|
|
121855
121859
|
}
|
|
121856
121860
|
}
|
|
121857
121861
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121679,6 +121679,8 @@ customElements.define("nx-form", nxForm);
|
|
|
121679
121679
|
|
|
121680
121680
|
class nxTitle extends HTMLElement {
|
|
121681
121681
|
|
|
121682
|
+
|
|
121683
|
+
|
|
121682
121684
|
#breadcrumbPath = []; // Breadcrumb 경로를 저장할 내부 상태 초기화
|
|
121683
121685
|
|
|
121684
121686
|
constructor() {
|
|
@@ -121819,8 +121821,9 @@ class nxTitle extends HTMLElement {
|
|
|
121819
121821
|
const isCurrent = index === this.#breadcrumbPath.length - 1;
|
|
121820
121822
|
// static 메서드를 직접 호출하도록 수정
|
|
121821
121823
|
const linkTag = item.path && !isCurrent
|
|
121822
|
-
? `<a href="javascript:
|
|
121823
|
-
class="breadcrumb-item breadcrumb-link"
|
|
121824
|
+
? `<a href="javascript:void(0);">
|
|
121825
|
+
class="breadcrumb-item breadcrumb-link"
|
|
121826
|
+
data-path="${item.path}"
|
|
121824
121827
|
>${item.caption}</a>`
|
|
121825
121828
|
: `<span class="breadcrumb-item ${isCurrent ? 'breadcrumb-current' : ''}">${item.caption}</span>`;
|
|
121826
121829
|
|
|
@@ -121835,19 +121838,20 @@ class nxTitle extends HTMLElement {
|
|
|
121835
121838
|
`;
|
|
121836
121839
|
|
|
121837
121840
|
this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
|
|
121838
|
-
}
|
|
121839
121841
|
|
|
121840
|
-
|
|
121841
|
-
|
|
121842
|
-
|
|
121842
|
+
this.shadowRoot.querySelectorAll('.breadcrumb-link').forEach(link => {
|
|
121843
|
+
link.addEventListener('click', this.#menuClickHandler);
|
|
121844
|
+
});
|
|
121845
|
+
}
|
|
121843
121846
|
|
|
121844
|
-
|
|
121845
|
-
|
|
121846
|
-
|
|
121847
|
-
|
|
121847
|
+
#menuClickHandler = (e) => {
|
|
121848
|
+
console.log(e);
|
|
121849
|
+
const path = e.target.dataset.path;
|
|
121850
|
+
if (path && window.location.pathname === path) {
|
|
121851
|
+
// path가 현재 URL과 같으면 private 메서드 #aaa() 호출
|
|
121852
|
+
console.log('1111');
|
|
121848
121853
|
} else {
|
|
121849
|
-
console.log(
|
|
121850
|
-
window.location.href = path;
|
|
121854
|
+
console.log("222");
|
|
121851
121855
|
}
|
|
121852
121856
|
}
|
|
121853
121857
|
}
|
package/dist/nx/nxTitle.js
CHANGED
|
@@ -2,6 +2,8 @@ import ninegrid from "../index.js";
|
|
|
2
2
|
|
|
3
3
|
export class nxTitle extends HTMLElement {
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
#breadcrumbPath = []; // Breadcrumb 경로를 저장할 내부 상태 초기화
|
|
6
8
|
|
|
7
9
|
constructor() {
|
|
@@ -158,8 +160,9 @@ export class nxTitle extends HTMLElement {
|
|
|
158
160
|
const isCurrent = index === this.#breadcrumbPath.length - 1;
|
|
159
161
|
// static 메서드를 직접 호출하도록 수정
|
|
160
162
|
const linkTag = item.path && !isCurrent
|
|
161
|
-
? `<a href="javascript:
|
|
162
|
-
class="breadcrumb-item breadcrumb-link"
|
|
163
|
+
? `<a href="javascript:void(0);">
|
|
164
|
+
class="breadcrumb-item breadcrumb-link"
|
|
165
|
+
data-path="${item.path}"
|
|
163
166
|
>${item.caption}</a>`
|
|
164
167
|
: `<span class="breadcrumb-item ${isCurrent ? 'breadcrumb-current' : ''}">${item.caption}</span>`;
|
|
165
168
|
|
|
@@ -174,19 +177,20 @@ export class nxTitle extends HTMLElement {
|
|
|
174
177
|
`;
|
|
175
178
|
|
|
176
179
|
this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
|
|
177
|
-
}
|
|
178
180
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
this.shadowRoot.querySelectorAll('.breadcrumb-link').forEach(link => {
|
|
182
|
+
link.addEventListener('click', this.#menuClickHandler);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
182
185
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
#menuClickHandler = (e) => {
|
|
187
|
+
console.log(e);
|
|
188
|
+
const path = e.target.dataset.path;
|
|
189
|
+
if (path && window.location.pathname === path) {
|
|
190
|
+
// path가 현재 URL과 같으면 private 메서드 #aaa() 호출
|
|
191
|
+
console.log('1111');
|
|
187
192
|
} else {
|
|
188
|
-
console.log(
|
|
189
|
-
window.location.href = path;
|
|
193
|
+
console.log("222");
|
|
190
194
|
}
|
|
191
195
|
}
|
|
192
196
|
}
|
package/package.json
CHANGED
package/src/nx/nxTitle.js
CHANGED
|
@@ -2,6 +2,8 @@ import ninegrid from "../index.js";
|
|
|
2
2
|
|
|
3
3
|
export class nxTitle extends HTMLElement {
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
5
7
|
#breadcrumbPath = []; // Breadcrumb 경로를 저장할 내부 상태 초기화
|
|
6
8
|
|
|
7
9
|
constructor() {
|
|
@@ -158,8 +160,9 @@ export class nxTitle extends HTMLElement {
|
|
|
158
160
|
const isCurrent = index === this.#breadcrumbPath.length - 1;
|
|
159
161
|
// static 메서드를 직접 호출하도록 수정
|
|
160
162
|
const linkTag = item.path && !isCurrent
|
|
161
|
-
? `<a href="javascript:
|
|
162
|
-
class="breadcrumb-item breadcrumb-link"
|
|
163
|
+
? `<a href="javascript:void(0);">
|
|
164
|
+
class="breadcrumb-item breadcrumb-link"
|
|
165
|
+
data-path="${item.path}"
|
|
163
166
|
>${item.caption}</a>`
|
|
164
167
|
: `<span class="breadcrumb-item ${isCurrent ? 'breadcrumb-current' : ''}">${item.caption}</span>`;
|
|
165
168
|
|
|
@@ -174,19 +177,20 @@ export class nxTitle extends HTMLElement {
|
|
|
174
177
|
`;
|
|
175
178
|
|
|
176
179
|
this.shadowRoot.appendChild(htmlTmpl.content.cloneNode(true));
|
|
177
|
-
}
|
|
178
180
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
this.shadowRoot.querySelectorAll('.breadcrumb-link').forEach(link => {
|
|
182
|
+
link.addEventListener('click', this.#menuClickHandler);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
182
185
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
#menuClickHandler = (e) => {
|
|
187
|
+
console.log(e);
|
|
188
|
+
const path = e.target.dataset.path;
|
|
189
|
+
if (path && window.location.pathname === path) {
|
|
190
|
+
// path가 현재 URL과 같으면 private 메서드 #aaa() 호출
|
|
191
|
+
console.log('1111');
|
|
187
192
|
} else {
|
|
188
|
-
console.log(
|
|
189
|
-
window.location.href = path;
|
|
193
|
+
console.log("222");
|
|
190
194
|
}
|
|
191
195
|
}
|
|
192
196
|
}
|