ninegrid2 6.977.0 → 6.979.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.
@@ -121908,7 +121908,7 @@ class NxLayout extends HTMLElement {
121908
121908
  }
121909
121909
 
121910
121910
  static get observedAttributes() {
121911
- return ['columns', 'rows'];
121911
+ return ['columns'];
121912
121912
  }
121913
121913
 
121914
121914
  #render() {
@@ -121923,49 +121923,50 @@ class NxLayout extends HTMLElement {
121923
121923
  const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
121924
121924
  const numRows = columnsLayout.length;
121925
121925
 
121926
- // CSS Grid 템플릿 설정
121927
- let gridRows = '';
121928
- for (let i = 0; i < numRows; i++) {
121929
- gridRows += '1fr ';
121930
- if (i < numRows - 1) {
121931
- gridRows += '8px '; // 세로 스플리터 높이
121932
- }
121933
- }
121934
-
121935
121926
  this.style.display = 'grid';
121936
121927
  this.style.width = '100%';
121937
121928
  this.style.height = '100%';
121938
- this.style.gridTemplateRows = gridRows.trim();
121929
+ this.style.gridTemplateRows = `repeat(${numRows * 2 - 1}, 1fr)`;
121930
+ this.style.gridAutoRows = `8px`;
121931
+ this.style.gridTemplateRows = `repeat(${numRows}, 1fr) `;
121939
121932
 
121940
- // 자식 요소와 스플리터 배치
121941
121933
  let renderedIndex = 0;
121942
121934
 
121943
121935
  for (let row = 0; row < numRows; row++) {
121944
121936
  const numColumns = columnsLayout[row];
121945
- let rowContent = document.createElement('div');
121946
- rowContent.style.display = 'grid';
121947
- rowContent.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
121948
- rowContent.style.gap = '8px';
121937
+ const rowWrapper = document.createElement('div');
121938
+ rowWrapper.style.display = 'grid';
121939
+ rowWrapper.style.gridTemplateColumns = `repeat(${numColumns * 2 - 1}, 1fr)`;
121940
+ rowWrapper.style.gridAutoColumns = `8px`;
121941
+ rowWrapper.style.height = '100%';
121949
121942
 
121950
121943
  for (let col = 0; col < numColumns; col++) {
121951
121944
  if (children[renderedIndex]) {
121952
- rowContent.appendChild(children[renderedIndex]);
121945
+ rowWrapper.appendChild(children[renderedIndex]);
121953
121946
  renderedIndex++;
121954
121947
  }
121948
+
121949
+ if (col < numColumns - 1) {
121950
+ const splitter = document.createElement('nx-splitter');
121951
+ splitter.setAttribute('direction', 'horizontal');
121952
+ splitter.style.gridColumn = `${col * 2 + 2} / span 1`;
121953
+ rowWrapper.appendChild(splitter);
121954
+ }
121955
121955
  }
121956
121956
 
121957
- this.appendChild(rowContent);
121957
+ this.appendChild(rowWrapper);
121958
121958
 
121959
121959
  if (row < numRows - 1) {
121960
121960
  const splitter = document.createElement('nx-splitter');
121961
121961
  splitter.setAttribute('direction', 'vertical');
121962
+ splitter.style.gridRow = `${row * 2 + 2} / span 1`;
121963
+ splitter.style.gridColumn = `1 / -1`;
121962
121964
  this.appendChild(splitter);
121963
121965
  }
121964
121966
  }
121965
121967
  }
121966
121968
  }
121967
121969
 
121968
- // 커스텀 엘리먼트를 등록
121969
121970
  customElements.define('nx-layout', NxLayout);
121970
121971
 
121971
121972
  class aiSettings extends HTMLElement
@@ -121904,7 +121904,7 @@ class NxLayout extends HTMLElement {
121904
121904
  }
121905
121905
 
121906
121906
  static get observedAttributes() {
121907
- return ['columns', 'rows'];
121907
+ return ['columns'];
121908
121908
  }
121909
121909
 
121910
121910
  #render() {
@@ -121919,49 +121919,50 @@ class NxLayout extends HTMLElement {
121919
121919
  const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
121920
121920
  const numRows = columnsLayout.length;
121921
121921
 
121922
- // CSS Grid 템플릿 설정
121923
- let gridRows = '';
121924
- for (let i = 0; i < numRows; i++) {
121925
- gridRows += '1fr ';
121926
- if (i < numRows - 1) {
121927
- gridRows += '8px '; // 세로 스플리터 높이
121928
- }
121929
- }
121930
-
121931
121922
  this.style.display = 'grid';
121932
121923
  this.style.width = '100%';
121933
121924
  this.style.height = '100%';
121934
- this.style.gridTemplateRows = gridRows.trim();
121925
+ this.style.gridTemplateRows = `repeat(${numRows * 2 - 1}, 1fr)`;
121926
+ this.style.gridAutoRows = `8px`;
121927
+ this.style.gridTemplateRows = `repeat(${numRows}, 1fr) `;
121935
121928
 
121936
- // 자식 요소와 스플리터 배치
121937
121929
  let renderedIndex = 0;
121938
121930
 
121939
121931
  for (let row = 0; row < numRows; row++) {
121940
121932
  const numColumns = columnsLayout[row];
121941
- let rowContent = document.createElement('div');
121942
- rowContent.style.display = 'grid';
121943
- rowContent.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
121944
- rowContent.style.gap = '8px';
121933
+ const rowWrapper = document.createElement('div');
121934
+ rowWrapper.style.display = 'grid';
121935
+ rowWrapper.style.gridTemplateColumns = `repeat(${numColumns * 2 - 1}, 1fr)`;
121936
+ rowWrapper.style.gridAutoColumns = `8px`;
121937
+ rowWrapper.style.height = '100%';
121945
121938
 
121946
121939
  for (let col = 0; col < numColumns; col++) {
121947
121940
  if (children[renderedIndex]) {
121948
- rowContent.appendChild(children[renderedIndex]);
121941
+ rowWrapper.appendChild(children[renderedIndex]);
121949
121942
  renderedIndex++;
121950
121943
  }
121944
+
121945
+ if (col < numColumns - 1) {
121946
+ const splitter = document.createElement('nx-splitter');
121947
+ splitter.setAttribute('direction', 'horizontal');
121948
+ splitter.style.gridColumn = `${col * 2 + 2} / span 1`;
121949
+ rowWrapper.appendChild(splitter);
121950
+ }
121951
121951
  }
121952
121952
 
121953
- this.appendChild(rowContent);
121953
+ this.appendChild(rowWrapper);
121954
121954
 
121955
121955
  if (row < numRows - 1) {
121956
121956
  const splitter = document.createElement('nx-splitter');
121957
121957
  splitter.setAttribute('direction', 'vertical');
121958
+ splitter.style.gridRow = `${row * 2 + 2} / span 1`;
121959
+ splitter.style.gridColumn = `1 / -1`;
121958
121960
  this.appendChild(splitter);
121959
121961
  }
121960
121962
  }
121961
121963
  }
121962
121964
  }
121963
121965
 
121964
- // 커스텀 엘리먼트를 등록
121965
121966
  customElements.define('nx-layout', NxLayout);
121966
121967
 
121967
121968
  class aiSettings extends HTMLElement
@@ -13,7 +13,7 @@ class NxLayout extends HTMLElement {
13
13
  }
14
14
 
15
15
  static get observedAttributes() {
16
- return ['columns', 'rows'];
16
+ return ['columns'];
17
17
  }
18
18
 
19
19
  #render() {
@@ -28,47 +28,48 @@ class NxLayout extends HTMLElement {
28
28
  const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
29
29
  const numRows = columnsLayout.length;
30
30
 
31
- // CSS Grid 템플릿 설정
32
- let gridRows = '';
33
- for (let i = 0; i < numRows; i++) {
34
- gridRows += '1fr ';
35
- if (i < numRows - 1) {
36
- gridRows += '8px '; // 세로 스플리터 높이
37
- }
38
- }
39
-
40
31
  this.style.display = 'grid';
41
32
  this.style.width = '100%';
42
33
  this.style.height = '100%';
43
- this.style.gridTemplateRows = gridRows.trim();
34
+ this.style.gridTemplateRows = `repeat(${numRows * 2 - 1}, 1fr)`;
35
+ this.style.gridAutoRows = `8px`;
36
+ this.style.gridTemplateRows = `repeat(${numRows}, 1fr) `;
44
37
 
45
- // 자식 요소와 스플리터 배치
46
38
  let renderedIndex = 0;
47
39
 
48
40
  for (let row = 0; row < numRows; row++) {
49
41
  const numColumns = columnsLayout[row];
50
- let rowContent = document.createElement('div');
51
- rowContent.style.display = 'grid';
52
- rowContent.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
53
- rowContent.style.gap = '8px';
42
+ const rowWrapper = document.createElement('div');
43
+ rowWrapper.style.display = 'grid';
44
+ rowWrapper.style.gridTemplateColumns = `repeat(${numColumns * 2 - 1}, 1fr)`;
45
+ rowWrapper.style.gridAutoColumns = `8px`;
46
+ rowWrapper.style.height = '100%';
54
47
 
55
48
  for (let col = 0; col < numColumns; col++) {
56
49
  if (children[renderedIndex]) {
57
- rowContent.appendChild(children[renderedIndex]);
50
+ rowWrapper.appendChild(children[renderedIndex]);
58
51
  renderedIndex++;
59
52
  }
53
+
54
+ if (col < numColumns - 1) {
55
+ const splitter = document.createElement('nx-splitter');
56
+ splitter.setAttribute('direction', 'horizontal');
57
+ splitter.style.gridColumn = `${col * 2 + 2} / span 1`;
58
+ rowWrapper.appendChild(splitter);
59
+ }
60
60
  }
61
61
 
62
- this.appendChild(rowContent);
62
+ this.appendChild(rowWrapper);
63
63
 
64
64
  if (row < numRows - 1) {
65
65
  const splitter = document.createElement('nx-splitter');
66
66
  splitter.setAttribute('direction', 'vertical');
67
+ splitter.style.gridRow = `${row * 2 + 2} / span 1`;
68
+ splitter.style.gridColumn = `1 / -1`;
67
69
  this.appendChild(splitter);
68
70
  }
69
71
  }
70
72
  }
71
73
  }
72
74
 
73
- // 커스텀 엘리먼트를 등록
74
75
  customElements.define('nx-layout', NxLayout);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.977.0",
4
+ "version": "6.979.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -13,7 +13,7 @@ class NxLayout extends HTMLElement {
13
13
  }
14
14
 
15
15
  static get observedAttributes() {
16
- return ['columns', 'rows'];
16
+ return ['columns'];
17
17
  }
18
18
 
19
19
  #render() {
@@ -28,47 +28,48 @@ class NxLayout extends HTMLElement {
28
28
  const columnsLayout = (this.getAttribute('columns') || '1').split(',').map(Number);
29
29
  const numRows = columnsLayout.length;
30
30
 
31
- // CSS Grid 템플릿 설정
32
- let gridRows = '';
33
- for (let i = 0; i < numRows; i++) {
34
- gridRows += '1fr ';
35
- if (i < numRows - 1) {
36
- gridRows += '8px '; // 세로 스플리터 높이
37
- }
38
- }
39
-
40
31
  this.style.display = 'grid';
41
32
  this.style.width = '100%';
42
33
  this.style.height = '100%';
43
- this.style.gridTemplateRows = gridRows.trim();
34
+ this.style.gridTemplateRows = `repeat(${numRows * 2 - 1}, 1fr)`;
35
+ this.style.gridAutoRows = `8px`;
36
+ this.style.gridTemplateRows = `repeat(${numRows}, 1fr) `;
44
37
 
45
- // 자식 요소와 스플리터 배치
46
38
  let renderedIndex = 0;
47
39
 
48
40
  for (let row = 0; row < numRows; row++) {
49
41
  const numColumns = columnsLayout[row];
50
- let rowContent = document.createElement('div');
51
- rowContent.style.display = 'grid';
52
- rowContent.style.gridTemplateColumns = `repeat(${numColumns}, 1fr)`;
53
- rowContent.style.gap = '8px';
42
+ const rowWrapper = document.createElement('div');
43
+ rowWrapper.style.display = 'grid';
44
+ rowWrapper.style.gridTemplateColumns = `repeat(${numColumns * 2 - 1}, 1fr)`;
45
+ rowWrapper.style.gridAutoColumns = `8px`;
46
+ rowWrapper.style.height = '100%';
54
47
 
55
48
  for (let col = 0; col < numColumns; col++) {
56
49
  if (children[renderedIndex]) {
57
- rowContent.appendChild(children[renderedIndex]);
50
+ rowWrapper.appendChild(children[renderedIndex]);
58
51
  renderedIndex++;
59
52
  }
53
+
54
+ if (col < numColumns - 1) {
55
+ const splitter = document.createElement('nx-splitter');
56
+ splitter.setAttribute('direction', 'horizontal');
57
+ splitter.style.gridColumn = `${col * 2 + 2} / span 1`;
58
+ rowWrapper.appendChild(splitter);
59
+ }
60
60
  }
61
61
 
62
- this.appendChild(rowContent);
62
+ this.appendChild(rowWrapper);
63
63
 
64
64
  if (row < numRows - 1) {
65
65
  const splitter = document.createElement('nx-splitter');
66
66
  splitter.setAttribute('direction', 'vertical');
67
+ splitter.style.gridRow = `${row * 2 + 2} / span 1`;
68
+ splitter.style.gridColumn = `1 / -1`;
67
69
  this.appendChild(splitter);
68
70
  }
69
71
  }
70
72
  }
71
73
  }
72
74
 
73
- // 커스텀 엘리먼트를 등록
74
75
  customElements.define('nx-layout', NxLayout);