ninegrid2 6.983.0 → 6.985.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 +31 -30
- package/dist/bundle.esm.js +31 -30
- package/dist/nx/nxLayout.js +32 -31
- package/package.json +1 -1
- package/src/nx/nxLayout.js +32 -31
package/dist/bundle.cjs.js
CHANGED
|
@@ -121896,13 +121896,17 @@ class nxTitle extends HTMLElement {
|
|
|
121896
121896
|
customElements.define("nx-title", nxTitle);
|
|
121897
121897
|
|
|
121898
121898
|
class NxLayout extends HTMLElement {
|
|
121899
|
+
constructor() {
|
|
121900
|
+
super();
|
|
121901
|
+
this.attachShadow({ mode: 'open' });
|
|
121902
|
+
}
|
|
121903
|
+
|
|
121899
121904
|
connectedCallback() {
|
|
121900
121905
|
this.#render();
|
|
121901
121906
|
}
|
|
121902
121907
|
|
|
121903
121908
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
121904
|
-
|
|
121905
|
-
if (oldValue !== newValue) { // 값 변경이 있을 때만 실행하는 것이 효율적
|
|
121909
|
+
if (oldValue !== newValue) {
|
|
121906
121910
|
this.#render();
|
|
121907
121911
|
}
|
|
121908
121912
|
}
|
|
@@ -121912,50 +121916,47 @@ class NxLayout extends HTMLElement {
|
|
|
121912
121916
|
}
|
|
121913
121917
|
|
|
121914
121918
|
#render() {
|
|
121915
|
-
const children = Array.from(this.children);
|
|
121916
|
-
if (children.length === 0) return;
|
|
121917
|
-
|
|
121918
|
-
// 기존 자식 노드를 안전하게 제거
|
|
121919
|
-
while (this.firstChild) {
|
|
121920
|
-
this.removeChild(this.firstChild);
|
|
121921
|
-
}
|
|
121922
|
-
|
|
121923
|
-
console.log("22222");
|
|
121924
|
-
|
|
121925
121919
|
const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
|
|
121926
121920
|
const numRows = columnsLayout.length;
|
|
121927
121921
|
|
|
121928
|
-
|
|
121929
|
-
this.style.width = '100%';
|
|
121930
|
-
this.style.height = '100%';
|
|
121931
|
-
this.style.gridTemplateRows = `repeat(${numRows}, 1fr)`;
|
|
121922
|
+
console.log("111");
|
|
121932
121923
|
|
|
121933
|
-
|
|
121924
|
+
// 템플릿 스트링을 사용하여 섀도우 돔 내부 구조를 동적으로 생성
|
|
121925
|
+
let template = `<style>:host { display: grid; width: 100%; height: 100%; }</style>`;
|
|
121926
|
+
let slotIndex = 0;
|
|
121934
121927
|
|
|
121935
121928
|
for (let row = 0; row < numRows; row++) {
|
|
121936
121929
|
const numColumns = columnsLayout[row];
|
|
121937
|
-
|
|
121938
|
-
rowWrapper.style.display = 'grid';
|
|
121939
|
-
rowWrapper.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
|
|
121940
|
-
rowWrapper.style.gap = `8px`; // 가로 스플리터 간격
|
|
121941
|
-
rowWrapper.style.height = '100%';
|
|
121930
|
+
let rowTemplate = '';
|
|
121942
121931
|
|
|
121943
121932
|
for (let col = 0; col < numColumns; col++) {
|
|
121944
|
-
|
|
121945
|
-
|
|
121946
|
-
|
|
121947
|
-
|
|
121933
|
+
// <slot>에 이름을 부여하여 특정 요소를 투영
|
|
121934
|
+
rowTemplate += `<div><slot name="slot-${slotIndex}"></slot></div>`;
|
|
121935
|
+
slotIndex++;
|
|
121936
|
+
if (col < numColumns - 1) {
|
|
121937
|
+
rowTemplate += `<nx-splitter direction="horizontal"></nx-splitter>`;
|
|
121948
121938
|
}
|
|
121949
121939
|
}
|
|
121950
121940
|
|
|
121951
|
-
|
|
121941
|
+
template += `
|
|
121942
|
+
<div style="display: grid; grid-template-columns: repeat(${numColumns}, 1fr) repeat(${numColumns-1}, 8px); height: 100%;">
|
|
121943
|
+
${rowTemplate}
|
|
121944
|
+
</div>
|
|
121945
|
+
`;
|
|
121952
121946
|
|
|
121953
121947
|
if (row < numRows - 1) {
|
|
121954
|
-
|
|
121955
|
-
splitter.setAttribute('direction', 'vertical');
|
|
121956
|
-
this.appendChild(splitter);
|
|
121948
|
+
template += `<nx-splitter direction="vertical"></nx-splitter>`;
|
|
121957
121949
|
}
|
|
121958
121950
|
}
|
|
121951
|
+
|
|
121952
|
+
// 섀도우 돔에 동적으로 생성된 HTML을 삽입
|
|
121953
|
+
this.shadowRoot.innerHTML = template;
|
|
121954
|
+
|
|
121955
|
+
// 사용자가 제공한 원본 자식 요소를 <slot>에 할당
|
|
121956
|
+
const children = Array.from(this.children);
|
|
121957
|
+
for (let i = 0; i < children.length; i++) {
|
|
121958
|
+
children[i].slot = `slot-${i}`;
|
|
121959
|
+
}
|
|
121959
121960
|
}
|
|
121960
121961
|
}
|
|
121961
121962
|
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121892,13 +121892,17 @@ class nxTitle extends HTMLElement {
|
|
|
121892
121892
|
customElements.define("nx-title", nxTitle);
|
|
121893
121893
|
|
|
121894
121894
|
class NxLayout extends HTMLElement {
|
|
121895
|
+
constructor() {
|
|
121896
|
+
super();
|
|
121897
|
+
this.attachShadow({ mode: 'open' });
|
|
121898
|
+
}
|
|
121899
|
+
|
|
121895
121900
|
connectedCallback() {
|
|
121896
121901
|
this.#render();
|
|
121897
121902
|
}
|
|
121898
121903
|
|
|
121899
121904
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
121900
|
-
|
|
121901
|
-
if (oldValue !== newValue) { // 값 변경이 있을 때만 실행하는 것이 효율적
|
|
121905
|
+
if (oldValue !== newValue) {
|
|
121902
121906
|
this.#render();
|
|
121903
121907
|
}
|
|
121904
121908
|
}
|
|
@@ -121908,50 +121912,47 @@ class NxLayout extends HTMLElement {
|
|
|
121908
121912
|
}
|
|
121909
121913
|
|
|
121910
121914
|
#render() {
|
|
121911
|
-
const children = Array.from(this.children);
|
|
121912
|
-
if (children.length === 0) return;
|
|
121913
|
-
|
|
121914
|
-
// 기존 자식 노드를 안전하게 제거
|
|
121915
|
-
while (this.firstChild) {
|
|
121916
|
-
this.removeChild(this.firstChild);
|
|
121917
|
-
}
|
|
121918
|
-
|
|
121919
|
-
console.log("22222");
|
|
121920
|
-
|
|
121921
121915
|
const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
|
|
121922
121916
|
const numRows = columnsLayout.length;
|
|
121923
121917
|
|
|
121924
|
-
|
|
121925
|
-
this.style.width = '100%';
|
|
121926
|
-
this.style.height = '100%';
|
|
121927
|
-
this.style.gridTemplateRows = `repeat(${numRows}, 1fr)`;
|
|
121918
|
+
console.log("111");
|
|
121928
121919
|
|
|
121929
|
-
|
|
121920
|
+
// 템플릿 스트링을 사용하여 섀도우 돔 내부 구조를 동적으로 생성
|
|
121921
|
+
let template = `<style>:host { display: grid; width: 100%; height: 100%; }</style>`;
|
|
121922
|
+
let slotIndex = 0;
|
|
121930
121923
|
|
|
121931
121924
|
for (let row = 0; row < numRows; row++) {
|
|
121932
121925
|
const numColumns = columnsLayout[row];
|
|
121933
|
-
|
|
121934
|
-
rowWrapper.style.display = 'grid';
|
|
121935
|
-
rowWrapper.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
|
|
121936
|
-
rowWrapper.style.gap = `8px`; // 가로 스플리터 간격
|
|
121937
|
-
rowWrapper.style.height = '100%';
|
|
121926
|
+
let rowTemplate = '';
|
|
121938
121927
|
|
|
121939
121928
|
for (let col = 0; col < numColumns; col++) {
|
|
121940
|
-
|
|
121941
|
-
|
|
121942
|
-
|
|
121943
|
-
|
|
121929
|
+
// <slot>에 이름을 부여하여 특정 요소를 투영
|
|
121930
|
+
rowTemplate += `<div><slot name="slot-${slotIndex}"></slot></div>`;
|
|
121931
|
+
slotIndex++;
|
|
121932
|
+
if (col < numColumns - 1) {
|
|
121933
|
+
rowTemplate += `<nx-splitter direction="horizontal"></nx-splitter>`;
|
|
121944
121934
|
}
|
|
121945
121935
|
}
|
|
121946
121936
|
|
|
121947
|
-
|
|
121937
|
+
template += `
|
|
121938
|
+
<div style="display: grid; grid-template-columns: repeat(${numColumns}, 1fr) repeat(${numColumns-1}, 8px); height: 100%;">
|
|
121939
|
+
${rowTemplate}
|
|
121940
|
+
</div>
|
|
121941
|
+
`;
|
|
121948
121942
|
|
|
121949
121943
|
if (row < numRows - 1) {
|
|
121950
|
-
|
|
121951
|
-
splitter.setAttribute('direction', 'vertical');
|
|
121952
|
-
this.appendChild(splitter);
|
|
121944
|
+
template += `<nx-splitter direction="vertical"></nx-splitter>`;
|
|
121953
121945
|
}
|
|
121954
121946
|
}
|
|
121947
|
+
|
|
121948
|
+
// 섀도우 돔에 동적으로 생성된 HTML을 삽입
|
|
121949
|
+
this.shadowRoot.innerHTML = template;
|
|
121950
|
+
|
|
121951
|
+
// 사용자가 제공한 원본 자식 요소를 <slot>에 할당
|
|
121952
|
+
const children = Array.from(this.children);
|
|
121953
|
+
for (let i = 0; i < children.length; i++) {
|
|
121954
|
+
children[i].slot = `slot-${i}`;
|
|
121955
|
+
}
|
|
121955
121956
|
}
|
|
121956
121957
|
}
|
|
121957
121958
|
|
package/dist/nx/nxLayout.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import ninegrid from "../index.js";
|
|
2
2
|
|
|
3
3
|
class NxLayout extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.attachShadow({ mode: 'open' });
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
connectedCallback() {
|
|
5
10
|
this.#render();
|
|
6
11
|
}
|
|
7
12
|
|
|
8
13
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
9
|
-
|
|
10
|
-
if (oldValue !== newValue) { // 값 변경이 있을 때만 실행하는 것이 효율적
|
|
14
|
+
if (oldValue !== newValue) {
|
|
11
15
|
this.#render();
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -17,51 +21,48 @@ class NxLayout extends HTMLElement {
|
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
#render() {
|
|
20
|
-
const children = Array.from(this.children);
|
|
21
|
-
if (children.length === 0) return;
|
|
22
|
-
|
|
23
|
-
// 기존 자식 노드를 안전하게 제거
|
|
24
|
-
while (this.firstChild) {
|
|
25
|
-
this.removeChild(this.firstChild);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
console.log("22222")
|
|
29
|
-
|
|
30
24
|
const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
|
|
31
25
|
const numRows = columnsLayout.length;
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
this.style.width = '100%';
|
|
35
|
-
this.style.height = '100%';
|
|
36
|
-
this.style.gridTemplateRows = `repeat(${numRows}, 1fr)`;
|
|
27
|
+
console.log("111")
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
// 템플릿 스트링을 사용하여 섀도우 돔 내부 구조를 동적으로 생성
|
|
30
|
+
let template = `<style>:host { display: grid; width: 100%; height: 100%; }</style>`;
|
|
31
|
+
let slotIndex = 0;
|
|
39
32
|
|
|
40
33
|
for (let row = 0; row < numRows; row++) {
|
|
41
34
|
const numColumns = columnsLayout[row];
|
|
42
|
-
|
|
43
|
-
rowWrapper.style.display = 'grid';
|
|
44
|
-
rowWrapper.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
|
|
45
|
-
rowWrapper.style.gap = `8px`; // 가로 스플리터 간격
|
|
46
|
-
rowWrapper.style.height = '100%';
|
|
35
|
+
let rowTemplate = '';
|
|
47
36
|
|
|
48
37
|
for (let col = 0; col < numColumns; col++) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
// <slot>에 이름을 부여하여 특정 요소를 투영
|
|
39
|
+
rowTemplate += `<div><slot name="slot-${slotIndex}"></slot></div>`;
|
|
40
|
+
slotIndex++;
|
|
41
|
+
if (col < numColumns - 1) {
|
|
42
|
+
rowTemplate += `<nx-splitter direction="horizontal"></nx-splitter>`;
|
|
53
43
|
}
|
|
54
44
|
}
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
template += `
|
|
47
|
+
<div style="display: grid; grid-template-columns: repeat(${numColumns}, 1fr) repeat(${numColumns-1}, 8px); height: 100%;">
|
|
48
|
+
${rowTemplate}
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
57
51
|
|
|
58
52
|
if (row < numRows - 1) {
|
|
59
|
-
|
|
60
|
-
splitter.setAttribute('direction', 'vertical');
|
|
61
|
-
this.appendChild(splitter);
|
|
53
|
+
template += `<nx-splitter direction="vertical"></nx-splitter>`;
|
|
62
54
|
}
|
|
63
55
|
}
|
|
56
|
+
|
|
57
|
+
// 섀도우 돔에 동적으로 생성된 HTML을 삽입
|
|
58
|
+
this.shadowRoot.innerHTML = template;
|
|
59
|
+
|
|
60
|
+
// 사용자가 제공한 원본 자식 요소를 <slot>에 할당
|
|
61
|
+
const children = Array.from(this.children);
|
|
62
|
+
for (let i = 0; i < children.length; i++) {
|
|
63
|
+
children[i].slot = `slot-${i}`;
|
|
64
|
+
}
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
customElements.define('nx-layout', NxLayout);
|
|
68
|
+
customElements.define('nx-layout', NxLayout);
|
package/package.json
CHANGED
package/src/nx/nxLayout.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import ninegrid from "../index.js";
|
|
2
2
|
|
|
3
3
|
class NxLayout extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.attachShadow({ mode: 'open' });
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
connectedCallback() {
|
|
5
10
|
this.#render();
|
|
6
11
|
}
|
|
7
12
|
|
|
8
13
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
9
|
-
|
|
10
|
-
if (oldValue !== newValue) { // 값 변경이 있을 때만 실행하는 것이 효율적
|
|
14
|
+
if (oldValue !== newValue) {
|
|
11
15
|
this.#render();
|
|
12
16
|
}
|
|
13
17
|
}
|
|
@@ -17,51 +21,48 @@ class NxLayout extends HTMLElement {
|
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
#render() {
|
|
20
|
-
const children = Array.from(this.children);
|
|
21
|
-
if (children.length === 0) return;
|
|
22
|
-
|
|
23
|
-
// 기존 자식 노드를 안전하게 제거
|
|
24
|
-
while (this.firstChild) {
|
|
25
|
-
this.removeChild(this.firstChild);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
console.log("22222")
|
|
29
|
-
|
|
30
24
|
const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
|
|
31
25
|
const numRows = columnsLayout.length;
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
this.style.width = '100%';
|
|
35
|
-
this.style.height = '100%';
|
|
36
|
-
this.style.gridTemplateRows = `repeat(${numRows}, 1fr)`;
|
|
27
|
+
console.log("111")
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
// 템플릿 스트링을 사용하여 섀도우 돔 내부 구조를 동적으로 생성
|
|
30
|
+
let template = `<style>:host { display: grid; width: 100%; height: 100%; }</style>`;
|
|
31
|
+
let slotIndex = 0;
|
|
39
32
|
|
|
40
33
|
for (let row = 0; row < numRows; row++) {
|
|
41
34
|
const numColumns = columnsLayout[row];
|
|
42
|
-
|
|
43
|
-
rowWrapper.style.display = 'grid';
|
|
44
|
-
rowWrapper.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
|
|
45
|
-
rowWrapper.style.gap = `8px`; // 가로 스플리터 간격
|
|
46
|
-
rowWrapper.style.height = '100%';
|
|
35
|
+
let rowTemplate = '';
|
|
47
36
|
|
|
48
37
|
for (let col = 0; col < numColumns; col++) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
// <slot>에 이름을 부여하여 특정 요소를 투영
|
|
39
|
+
rowTemplate += `<div><slot name="slot-${slotIndex}"></slot></div>`;
|
|
40
|
+
slotIndex++;
|
|
41
|
+
if (col < numColumns - 1) {
|
|
42
|
+
rowTemplate += `<nx-splitter direction="horizontal"></nx-splitter>`;
|
|
53
43
|
}
|
|
54
44
|
}
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
template += `
|
|
47
|
+
<div style="display: grid; grid-template-columns: repeat(${numColumns}, 1fr) repeat(${numColumns-1}, 8px); height: 100%;">
|
|
48
|
+
${rowTemplate}
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
57
51
|
|
|
58
52
|
if (row < numRows - 1) {
|
|
59
|
-
|
|
60
|
-
splitter.setAttribute('direction', 'vertical');
|
|
61
|
-
this.appendChild(splitter);
|
|
53
|
+
template += `<nx-splitter direction="vertical"></nx-splitter>`;
|
|
62
54
|
}
|
|
63
55
|
}
|
|
56
|
+
|
|
57
|
+
// 섀도우 돔에 동적으로 생성된 HTML을 삽입
|
|
58
|
+
this.shadowRoot.innerHTML = template;
|
|
59
|
+
|
|
60
|
+
// 사용자가 제공한 원본 자식 요소를 <slot>에 할당
|
|
61
|
+
const children = Array.from(this.children);
|
|
62
|
+
for (let i = 0; i < children.length; i++) {
|
|
63
|
+
children[i].slot = `slot-${i}`;
|
|
64
|
+
}
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
customElements.define('nx-layout', NxLayout);
|
|
68
|
+
customElements.define('nx-layout', NxLayout);
|