ninegrid2 6.700.0 → 6.702.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 +17 -16
- package/dist/bundle.esm.js +17 -16
- package/dist/nx/nxSplitter.js +15 -44
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +15 -44
package/dist/bundle.cjs.js
CHANGED
|
@@ -121126,43 +121126,44 @@ class nxSplitter extends HTMLElement {
|
|
|
121126
121126
|
}
|
|
121127
121127
|
};
|
|
121128
121128
|
|
|
121129
|
+
|
|
121130
|
+
|
|
121129
121131
|
const onUp = (e) => {
|
|
121130
121132
|
window.removeEventListener("mousemove", onMove);
|
|
121131
|
-
window.removeEventListener("mouseup",
|
|
121133
|
+
window.removeEventListener("mouseup", onDrop);
|
|
121132
121134
|
dragBar.remove();
|
|
121133
121135
|
|
|
121134
|
-
const parentRect = parent.getBoundingClientRect();
|
|
121135
|
-
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121136
|
-
|
|
121137
121136
|
const prev = this.previousElementSibling;
|
|
121138
121137
|
const next = this.nextElementSibling;
|
|
121139
121138
|
if (!prev || !next) return;
|
|
121140
121139
|
|
|
121141
|
-
|
|
121140
|
+
this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121142
121141
|
|
|
121143
|
-
//
|
|
121144
|
-
const
|
|
121145
|
-
?
|
|
121146
|
-
:
|
|
121142
|
+
// 기준: prev + next 너비 합계
|
|
121143
|
+
const totalSize = this.#mode === "h"
|
|
121144
|
+
? prev.offsetWidth + next.offsetWidth
|
|
121145
|
+
: prev.offsetHeight + next.offsetHeight;
|
|
121147
121146
|
|
|
121148
|
-
|
|
121147
|
+
// prev 기준 상대 거리 (드래그 거리)
|
|
121148
|
+
const delta = this.#mode === "h"
|
|
121149
|
+
? e.clientX - prev.getBoundingClientRect().left
|
|
121150
|
+
: e.clientY - prev.getBoundingClientRect().top;
|
|
121149
121151
|
|
|
121152
|
+
// 📌 사이즈 적용
|
|
121150
121153
|
if (this.#mode === "h") {
|
|
121151
121154
|
prev.style.width = `${delta}px`;
|
|
121152
|
-
|
|
121153
|
-
// next 너비는 전체 - prev의 offset - delta - splitter
|
|
121154
|
-
next.style.width = `${parentRect.width - prevRect.left - delta - splitterSize}px`;
|
|
121155
|
+
next.style.width = `${totalSize - delta}px`;
|
|
121155
121156
|
} else {
|
|
121156
121157
|
prev.style.height = `${delta}px`;
|
|
121157
|
-
next.style.height = `${
|
|
121158
|
+
next.style.height = `${totalSize - delta}px`;
|
|
121158
121159
|
}
|
|
121159
|
-
|
|
121160
|
-
console.log(prev.style.width, next.style.width);
|
|
121161
121160
|
};
|
|
121162
121161
|
|
|
121163
121162
|
|
|
121164
121163
|
|
|
121165
121164
|
|
|
121165
|
+
|
|
121166
|
+
|
|
121166
121167
|
window.addEventListener("mousemove", onMove);
|
|
121167
121168
|
window.addEventListener("mouseup", onUp);
|
|
121168
121169
|
};
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121122,43 +121122,44 @@ class nxSplitter extends HTMLElement {
|
|
|
121122
121122
|
}
|
|
121123
121123
|
};
|
|
121124
121124
|
|
|
121125
|
+
|
|
121126
|
+
|
|
121125
121127
|
const onUp = (e) => {
|
|
121126
121128
|
window.removeEventListener("mousemove", onMove);
|
|
121127
|
-
window.removeEventListener("mouseup",
|
|
121129
|
+
window.removeEventListener("mouseup", onDrop);
|
|
121128
121130
|
dragBar.remove();
|
|
121129
121131
|
|
|
121130
|
-
const parentRect = parent.getBoundingClientRect();
|
|
121131
|
-
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121132
|
-
|
|
121133
121132
|
const prev = this.previousElementSibling;
|
|
121134
121133
|
const next = this.nextElementSibling;
|
|
121135
121134
|
if (!prev || !next) return;
|
|
121136
121135
|
|
|
121137
|
-
|
|
121136
|
+
this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121138
121137
|
|
|
121139
|
-
//
|
|
121140
|
-
const
|
|
121141
|
-
?
|
|
121142
|
-
:
|
|
121138
|
+
// 기준: prev + next 너비 합계
|
|
121139
|
+
const totalSize = this.#mode === "h"
|
|
121140
|
+
? prev.offsetWidth + next.offsetWidth
|
|
121141
|
+
: prev.offsetHeight + next.offsetHeight;
|
|
121143
121142
|
|
|
121144
|
-
|
|
121143
|
+
// prev 기준 상대 거리 (드래그 거리)
|
|
121144
|
+
const delta = this.#mode === "h"
|
|
121145
|
+
? e.clientX - prev.getBoundingClientRect().left
|
|
121146
|
+
: e.clientY - prev.getBoundingClientRect().top;
|
|
121145
121147
|
|
|
121148
|
+
// 📌 사이즈 적용
|
|
121146
121149
|
if (this.#mode === "h") {
|
|
121147
121150
|
prev.style.width = `${delta}px`;
|
|
121148
|
-
|
|
121149
|
-
// next 너비는 전체 - prev의 offset - delta - splitter
|
|
121150
|
-
next.style.width = `${parentRect.width - prevRect.left - delta - splitterSize}px`;
|
|
121151
|
+
next.style.width = `${totalSize - delta}px`;
|
|
121151
121152
|
} else {
|
|
121152
121153
|
prev.style.height = `${delta}px`;
|
|
121153
|
-
next.style.height = `${
|
|
121154
|
+
next.style.height = `${totalSize - delta}px`;
|
|
121154
121155
|
}
|
|
121155
|
-
|
|
121156
|
-
console.log(prev.style.width, next.style.width);
|
|
121157
121156
|
};
|
|
121158
121157
|
|
|
121159
121158
|
|
|
121160
121159
|
|
|
121161
121160
|
|
|
121161
|
+
|
|
121162
|
+
|
|
121162
121163
|
window.addEventListener("mousemove", onMove);
|
|
121163
121164
|
window.addEventListener("mouseup", onUp);
|
|
121164
121165
|
};
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -82,72 +82,43 @@ class nxSplitter extends HTMLElement {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
const onUp1 = (e) => {
|
|
86
|
-
window.removeEventListener("mousemove", onMove);
|
|
87
|
-
window.removeEventListener("mouseup", onUp);
|
|
88
|
-
dragBar.remove();
|
|
89
|
-
|
|
90
|
-
const parentRect = parent.getBoundingClientRect();
|
|
91
|
-
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
92
|
-
|
|
93
|
-
const prev = this.previousElementSibling;
|
|
94
|
-
const next = this.nextElementSibling;
|
|
95
|
-
if (!prev || !next) return;
|
|
96
|
-
|
|
97
|
-
const prevRect = prev.getBoundingClientRect();
|
|
98
|
-
|
|
99
|
-
// 📌 드래그 위치에서 prev 시작 위치를 뺀 상대 위치 (prev 기준)
|
|
100
|
-
const position = this.#mode === "h"
|
|
101
|
-
? e.clientX - prevRect.left
|
|
102
|
-
: e.clientY - prevRect.top;
|
|
103
|
-
|
|
104
|
-
// prev 시작 위치 기준으로 상대 크기 설정
|
|
105
|
-
if (this.#mode === "h") {
|
|
106
|
-
prev.style.width = `${position}px`;
|
|
107
|
-
next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
|
|
108
|
-
} else {
|
|
109
|
-
prev.style.height = `${position}px`;
|
|
110
|
-
next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
85
|
|
|
114
86
|
const onUp = (e) => {
|
|
115
87
|
window.removeEventListener("mousemove", onMove);
|
|
116
|
-
window.removeEventListener("mouseup",
|
|
88
|
+
window.removeEventListener("mouseup", onDrop);
|
|
117
89
|
dragBar.remove();
|
|
118
90
|
|
|
119
|
-
const parentRect = parent.getBoundingClientRect();
|
|
120
|
-
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121
|
-
|
|
122
91
|
const prev = this.previousElementSibling;
|
|
123
92
|
const next = this.nextElementSibling;
|
|
124
93
|
if (!prev || !next) return;
|
|
125
94
|
|
|
126
|
-
const
|
|
95
|
+
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
96
|
+
|
|
97
|
+
// 기준: prev + next 너비 합계
|
|
98
|
+
const totalSize = this.#mode === "h"
|
|
99
|
+
? prev.offsetWidth + next.offsetWidth
|
|
100
|
+
: prev.offsetHeight + next.offsetHeight;
|
|
127
101
|
|
|
128
|
-
//
|
|
102
|
+
// prev 기준 상대 거리 (드래그 거리)
|
|
129
103
|
const delta = this.#mode === "h"
|
|
130
|
-
? e.clientX -
|
|
131
|
-
: e.clientY -
|
|
132
|
-
|
|
133
|
-
console.log(e.clientX, prevRect.left, delta, splitterSize);
|
|
104
|
+
? e.clientX - prev.getBoundingClientRect().left
|
|
105
|
+
: e.clientY - prev.getBoundingClientRect().top;
|
|
134
106
|
|
|
107
|
+
// 📌 사이즈 적용
|
|
135
108
|
if (this.#mode === "h") {
|
|
136
109
|
prev.style.width = `${delta}px`;
|
|
137
|
-
|
|
138
|
-
// next 너비는 전체 - prev의 offset - delta - splitter
|
|
139
|
-
next.style.width = `${parentRect.width - prevRect.left - delta - splitterSize}px`;
|
|
110
|
+
next.style.width = `${totalSize - delta}px`;
|
|
140
111
|
} else {
|
|
141
112
|
prev.style.height = `${delta}px`;
|
|
142
|
-
next.style.height = `${
|
|
113
|
+
next.style.height = `${totalSize - delta}px`;
|
|
143
114
|
}
|
|
144
|
-
|
|
145
|
-
console.log(prev.style.width, next.style.width);
|
|
146
115
|
};
|
|
147
116
|
|
|
148
117
|
|
|
149
118
|
|
|
150
119
|
|
|
120
|
+
|
|
121
|
+
|
|
151
122
|
window.addEventListener("mousemove", onMove);
|
|
152
123
|
window.addEventListener("mouseup", onUp);
|
|
153
124
|
};
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -82,72 +82,43 @@ class nxSplitter extends HTMLElement {
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
const onUp1 = (e) => {
|
|
86
|
-
window.removeEventListener("mousemove", onMove);
|
|
87
|
-
window.removeEventListener("mouseup", onUp);
|
|
88
|
-
dragBar.remove();
|
|
89
|
-
|
|
90
|
-
const parentRect = parent.getBoundingClientRect();
|
|
91
|
-
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
92
|
-
|
|
93
|
-
const prev = this.previousElementSibling;
|
|
94
|
-
const next = this.nextElementSibling;
|
|
95
|
-
if (!prev || !next) return;
|
|
96
|
-
|
|
97
|
-
const prevRect = prev.getBoundingClientRect();
|
|
98
|
-
|
|
99
|
-
// 📌 드래그 위치에서 prev 시작 위치를 뺀 상대 위치 (prev 기준)
|
|
100
|
-
const position = this.#mode === "h"
|
|
101
|
-
? e.clientX - prevRect.left
|
|
102
|
-
: e.clientY - prevRect.top;
|
|
103
|
-
|
|
104
|
-
// prev 시작 위치 기준으로 상대 크기 설정
|
|
105
|
-
if (this.#mode === "h") {
|
|
106
|
-
prev.style.width = `${position}px`;
|
|
107
|
-
next.style.width = `${parentRect.width - (prevRect.left - parentRect.left) - position - splitterSize}px`;
|
|
108
|
-
} else {
|
|
109
|
-
prev.style.height = `${position}px`;
|
|
110
|
-
next.style.height = `${parentRect.height - (prevRect.top - parentRect.top) - position - splitterSize}px`;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
85
|
|
|
114
86
|
const onUp = (e) => {
|
|
115
87
|
window.removeEventListener("mousemove", onMove);
|
|
116
|
-
window.removeEventListener("mouseup",
|
|
88
|
+
window.removeEventListener("mouseup", onDrop);
|
|
117
89
|
dragBar.remove();
|
|
118
90
|
|
|
119
|
-
const parentRect = parent.getBoundingClientRect();
|
|
120
|
-
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
121
|
-
|
|
122
91
|
const prev = this.previousElementSibling;
|
|
123
92
|
const next = this.nextElementSibling;
|
|
124
93
|
if (!prev || !next) return;
|
|
125
94
|
|
|
126
|
-
const
|
|
95
|
+
const splitterSize = this.#mode === "h" ? this.offsetWidth : this.offsetHeight;
|
|
96
|
+
|
|
97
|
+
// 기준: prev + next 너비 합계
|
|
98
|
+
const totalSize = this.#mode === "h"
|
|
99
|
+
? prev.offsetWidth + next.offsetWidth
|
|
100
|
+
: prev.offsetHeight + next.offsetHeight;
|
|
127
101
|
|
|
128
|
-
//
|
|
102
|
+
// prev 기준 상대 거리 (드래그 거리)
|
|
129
103
|
const delta = this.#mode === "h"
|
|
130
|
-
? e.clientX -
|
|
131
|
-
: e.clientY -
|
|
132
|
-
|
|
133
|
-
console.log(e.clientX, prevRect.left, delta, splitterSize);
|
|
104
|
+
? e.clientX - prev.getBoundingClientRect().left
|
|
105
|
+
: e.clientY - prev.getBoundingClientRect().top;
|
|
134
106
|
|
|
107
|
+
// 📌 사이즈 적용
|
|
135
108
|
if (this.#mode === "h") {
|
|
136
109
|
prev.style.width = `${delta}px`;
|
|
137
|
-
|
|
138
|
-
// next 너비는 전체 - prev의 offset - delta - splitter
|
|
139
|
-
next.style.width = `${parentRect.width - prevRect.left - delta - splitterSize}px`;
|
|
110
|
+
next.style.width = `${totalSize - delta}px`;
|
|
140
111
|
} else {
|
|
141
112
|
prev.style.height = `${delta}px`;
|
|
142
|
-
next.style.height = `${
|
|
113
|
+
next.style.height = `${totalSize - delta}px`;
|
|
143
114
|
}
|
|
144
|
-
|
|
145
|
-
console.log(prev.style.width, next.style.width);
|
|
146
115
|
};
|
|
147
116
|
|
|
148
117
|
|
|
149
118
|
|
|
150
119
|
|
|
120
|
+
|
|
121
|
+
|
|
151
122
|
window.addEventListener("mousemove", onMove);
|
|
152
123
|
window.addEventListener("mouseup", onUp);
|
|
153
124
|
};
|