ninegrid2 6.682.0 β 6.684.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 +19 -15
- package/dist/bundle.esm.js +19 -15
- package/dist/nx/nxSplitter.js +19 -15
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +19 -15
package/dist/bundle.cjs.js
CHANGED
|
@@ -121082,7 +121082,15 @@ class nxSplitter extends HTMLElement {
|
|
|
121082
121082
|
});
|
|
121083
121083
|
|
|
121084
121084
|
const parent = this.getRootNode().host || this.parentElement;
|
|
121085
|
+
const prev = this.previousElementSibling;
|
|
121086
|
+
const next = this.nextElementSibling;
|
|
121087
|
+
|
|
121088
|
+
if (!parent || !prev || !next) return;
|
|
121089
|
+
|
|
121085
121090
|
const parentRect = parent.getBoundingClientRect();
|
|
121091
|
+
const prevRect = prev.getBoundingClientRect();
|
|
121092
|
+
const nextRect = next.getBoundingClientRect();
|
|
121093
|
+
|
|
121086
121094
|
const left = e.clientX - parentRect.left;
|
|
121087
121095
|
const top = e.clientY - parentRect.top;
|
|
121088
121096
|
|
|
@@ -121102,17 +121110,19 @@ class nxSplitter extends HTMLElement {
|
|
|
121102
121110
|
// π λΆλͺ¨ λ
Έλ κΈ°μ€μΌλ‘ μ½μ
|
|
121103
121111
|
parent.appendChild(dragBar);
|
|
121104
121112
|
|
|
121113
|
+
const min = this.#mode === "h" ? prevRect.left : prevRect.top;
|
|
121114
|
+
const max = this.#mode === "h" ? nextRect.right : nextRect.bottom;
|
|
121115
|
+
|
|
121105
121116
|
const onMove = e => {
|
|
121106
|
-
const
|
|
121117
|
+
const clientPos = this.#mode === "h" ? e.clientX : e.clientY;
|
|
121118
|
+
const position = Math.max(min, Math.min(clientPos, max));
|
|
121119
|
+
|
|
121120
|
+
const relative = position - parent.getBoundingClientRect()[this.#mode === "h" ? "left" : "top"];
|
|
121107
121121
|
|
|
121108
121122
|
if (this.#mode === "h") {
|
|
121109
|
-
|
|
121110
|
-
left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width λ²μ μ ν
|
|
121111
|
-
dragBar.style.left = `${left}px`;
|
|
121123
|
+
dragBar.style.left = `${relative}px`;
|
|
121112
121124
|
} else {
|
|
121113
|
-
|
|
121114
|
-
top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height λ²μ μ ν
|
|
121115
|
-
dragBar.style.top = `${top}px`;
|
|
121125
|
+
dragBar.style.top = `${relative}px`;
|
|
121116
121126
|
}
|
|
121117
121127
|
};
|
|
121118
121128
|
|
|
@@ -121129,16 +121139,10 @@ class nxSplitter extends HTMLElement {
|
|
|
121129
121139
|
? e.clientX - parentRect.left
|
|
121130
121140
|
: e.clientY - parentRect.top;
|
|
121131
121141
|
|
|
121132
|
-
// νμ μμλ€
|
|
121133
|
-
const prev = this.previousElementSibling;
|
|
121134
|
-
const next = this.nextElementSibling;
|
|
121135
|
-
|
|
121136
|
-
if (!prev || !next) return;
|
|
121137
|
-
|
|
121138
121142
|
if (this.#mode === "h") {
|
|
121139
121143
|
prev.style.width = `${position}px`;
|
|
121140
|
-
|
|
121141
|
-
next.style.width = `100%`;
|
|
121144
|
+
next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
|
|
121145
|
+
//next.style.width = `100%`;
|
|
121142
121146
|
} else {
|
|
121143
121147
|
prev.style.height = `${position}px`;
|
|
121144
121148
|
next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121078,7 +121078,15 @@ class nxSplitter extends HTMLElement {
|
|
|
121078
121078
|
});
|
|
121079
121079
|
|
|
121080
121080
|
const parent = this.getRootNode().host || this.parentElement;
|
|
121081
|
+
const prev = this.previousElementSibling;
|
|
121082
|
+
const next = this.nextElementSibling;
|
|
121083
|
+
|
|
121084
|
+
if (!parent || !prev || !next) return;
|
|
121085
|
+
|
|
121081
121086
|
const parentRect = parent.getBoundingClientRect();
|
|
121087
|
+
const prevRect = prev.getBoundingClientRect();
|
|
121088
|
+
const nextRect = next.getBoundingClientRect();
|
|
121089
|
+
|
|
121082
121090
|
const left = e.clientX - parentRect.left;
|
|
121083
121091
|
const top = e.clientY - parentRect.top;
|
|
121084
121092
|
|
|
@@ -121098,17 +121106,19 @@ class nxSplitter extends HTMLElement {
|
|
|
121098
121106
|
// π λΆλͺ¨ λ
Έλ κΈ°μ€μΌλ‘ μ½μ
|
|
121099
121107
|
parent.appendChild(dragBar);
|
|
121100
121108
|
|
|
121109
|
+
const min = this.#mode === "h" ? prevRect.left : prevRect.top;
|
|
121110
|
+
const max = this.#mode === "h" ? nextRect.right : nextRect.bottom;
|
|
121111
|
+
|
|
121101
121112
|
const onMove = e => {
|
|
121102
|
-
const
|
|
121113
|
+
const clientPos = this.#mode === "h" ? e.clientX : e.clientY;
|
|
121114
|
+
const position = Math.max(min, Math.min(clientPos, max));
|
|
121115
|
+
|
|
121116
|
+
const relative = position - parent.getBoundingClientRect()[this.#mode === "h" ? "left" : "top"];
|
|
121103
121117
|
|
|
121104
121118
|
if (this.#mode === "h") {
|
|
121105
|
-
|
|
121106
|
-
left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width λ²μ μ ν
|
|
121107
|
-
dragBar.style.left = `${left}px`;
|
|
121119
|
+
dragBar.style.left = `${relative}px`;
|
|
121108
121120
|
} else {
|
|
121109
|
-
|
|
121110
|
-
top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height λ²μ μ ν
|
|
121111
|
-
dragBar.style.top = `${top}px`;
|
|
121121
|
+
dragBar.style.top = `${relative}px`;
|
|
121112
121122
|
}
|
|
121113
121123
|
};
|
|
121114
121124
|
|
|
@@ -121125,16 +121135,10 @@ class nxSplitter extends HTMLElement {
|
|
|
121125
121135
|
? e.clientX - parentRect.left
|
|
121126
121136
|
: e.clientY - parentRect.top;
|
|
121127
121137
|
|
|
121128
|
-
// νμ μμλ€
|
|
121129
|
-
const prev = this.previousElementSibling;
|
|
121130
|
-
const next = this.nextElementSibling;
|
|
121131
|
-
|
|
121132
|
-
if (!prev || !next) return;
|
|
121133
|
-
|
|
121134
121138
|
if (this.#mode === "h") {
|
|
121135
121139
|
prev.style.width = `${position}px`;
|
|
121136
|
-
|
|
121137
|
-
next.style.width = `100%`;
|
|
121140
|
+
next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
|
|
121141
|
+
//next.style.width = `100%`;
|
|
121138
121142
|
} else {
|
|
121139
121143
|
prev.style.height = `${position}px`;
|
|
121140
121144
|
next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -37,7 +37,15 @@ class nxSplitter extends HTMLElement {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const parent = this.getRootNode().host || this.parentElement;
|
|
40
|
+
const prev = this.previousElementSibling;
|
|
41
|
+
const next = this.nextElementSibling;
|
|
42
|
+
|
|
43
|
+
if (!parent || !prev || !next) return;
|
|
44
|
+
|
|
40
45
|
const parentRect = parent.getBoundingClientRect();
|
|
46
|
+
const prevRect = prev.getBoundingClientRect();
|
|
47
|
+
const nextRect = next.getBoundingClientRect();
|
|
48
|
+
|
|
41
49
|
const left = e.clientX - parentRect.left;
|
|
42
50
|
const top = e.clientY - parentRect.top;
|
|
43
51
|
|
|
@@ -57,17 +65,19 @@ class nxSplitter extends HTMLElement {
|
|
|
57
65
|
// π λΆλͺ¨ λ
Έλ κΈ°μ€μΌλ‘ μ½μ
|
|
58
66
|
parent.appendChild(dragBar);
|
|
59
67
|
|
|
68
|
+
const min = this.#mode === "h" ? prevRect.left : prevRect.top;
|
|
69
|
+
const max = this.#mode === "h" ? nextRect.right : nextRect.bottom;
|
|
70
|
+
|
|
60
71
|
const onMove = e => {
|
|
61
|
-
const
|
|
72
|
+
const clientPos = this.#mode === "h" ? e.clientX : e.clientY;
|
|
73
|
+
const position = Math.max(min, Math.min(clientPos, max));
|
|
74
|
+
|
|
75
|
+
const relative = position - parent.getBoundingClientRect()[this.#mode === "h" ? "left" : "top"];
|
|
62
76
|
|
|
63
77
|
if (this.#mode === "h") {
|
|
64
|
-
|
|
65
|
-
left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width λ²μ μ ν
|
|
66
|
-
dragBar.style.left = `${left}px`;
|
|
78
|
+
dragBar.style.left = `${relative}px`;
|
|
67
79
|
} else {
|
|
68
|
-
|
|
69
|
-
top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height λ²μ μ ν
|
|
70
|
-
dragBar.style.top = `${top}px`;
|
|
80
|
+
dragBar.style.top = `${relative}px`;
|
|
71
81
|
}
|
|
72
82
|
};
|
|
73
83
|
|
|
@@ -84,16 +94,10 @@ class nxSplitter extends HTMLElement {
|
|
|
84
94
|
? e.clientX - parentRect.left
|
|
85
95
|
: e.clientY - parentRect.top;
|
|
86
96
|
|
|
87
|
-
// νμ μμλ€
|
|
88
|
-
const prev = this.previousElementSibling;
|
|
89
|
-
const next = this.nextElementSibling;
|
|
90
|
-
|
|
91
|
-
if (!prev || !next) return;
|
|
92
|
-
|
|
93
97
|
if (this.#mode === "h") {
|
|
94
98
|
prev.style.width = `${position}px`;
|
|
95
|
-
|
|
96
|
-
next.style.width = `100%`;
|
|
99
|
+
next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
|
|
100
|
+
//next.style.width = `100%`;
|
|
97
101
|
} else {
|
|
98
102
|
prev.style.height = `${position}px`;
|
|
99
103
|
next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -37,7 +37,15 @@ class nxSplitter extends HTMLElement {
|
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const parent = this.getRootNode().host || this.parentElement;
|
|
40
|
+
const prev = this.previousElementSibling;
|
|
41
|
+
const next = this.nextElementSibling;
|
|
42
|
+
|
|
43
|
+
if (!parent || !prev || !next) return;
|
|
44
|
+
|
|
40
45
|
const parentRect = parent.getBoundingClientRect();
|
|
46
|
+
const prevRect = prev.getBoundingClientRect();
|
|
47
|
+
const nextRect = next.getBoundingClientRect();
|
|
48
|
+
|
|
41
49
|
const left = e.clientX - parentRect.left;
|
|
42
50
|
const top = e.clientY - parentRect.top;
|
|
43
51
|
|
|
@@ -57,17 +65,19 @@ class nxSplitter extends HTMLElement {
|
|
|
57
65
|
// π λΆλͺ¨ λ
Έλ κΈ°μ€μΌλ‘ μ½μ
|
|
58
66
|
parent.appendChild(dragBar);
|
|
59
67
|
|
|
68
|
+
const min = this.#mode === "h" ? prevRect.left : prevRect.top;
|
|
69
|
+
const max = this.#mode === "h" ? nextRect.right : nextRect.bottom;
|
|
70
|
+
|
|
60
71
|
const onMove = e => {
|
|
61
|
-
const
|
|
72
|
+
const clientPos = this.#mode === "h" ? e.clientX : e.clientY;
|
|
73
|
+
const position = Math.max(min, Math.min(clientPos, max));
|
|
74
|
+
|
|
75
|
+
const relative = position - parent.getBoundingClientRect()[this.#mode === "h" ? "left" : "top"];
|
|
62
76
|
|
|
63
77
|
if (this.#mode === "h") {
|
|
64
|
-
|
|
65
|
-
left = Math.max(0, Math.min(left, rect.width)); // 0 ~ width λ²μ μ ν
|
|
66
|
-
dragBar.style.left = `${left}px`;
|
|
78
|
+
dragBar.style.left = `${relative}px`;
|
|
67
79
|
} else {
|
|
68
|
-
|
|
69
|
-
top = Math.max(0, Math.min(top, rect.height)); // 0 ~ height λ²μ μ ν
|
|
70
|
-
dragBar.style.top = `${top}px`;
|
|
80
|
+
dragBar.style.top = `${relative}px`;
|
|
71
81
|
}
|
|
72
82
|
};
|
|
73
83
|
|
|
@@ -84,16 +94,10 @@ class nxSplitter extends HTMLElement {
|
|
|
84
94
|
? e.clientX - parentRect.left
|
|
85
95
|
: e.clientY - parentRect.top;
|
|
86
96
|
|
|
87
|
-
// νμ μμλ€
|
|
88
|
-
const prev = this.previousElementSibling;
|
|
89
|
-
const next = this.nextElementSibling;
|
|
90
|
-
|
|
91
|
-
if (!prev || !next) return;
|
|
92
|
-
|
|
93
97
|
if (this.#mode === "h") {
|
|
94
98
|
prev.style.width = `${position}px`;
|
|
95
|
-
|
|
96
|
-
next.style.width = `100%`;
|
|
99
|
+
next.style.width = `${parentRect.width - position - this.offsetWidth}px`;
|
|
100
|
+
//next.style.width = `100%`;
|
|
97
101
|
} else {
|
|
98
102
|
prev.style.height = `${position}px`;
|
|
99
103
|
next.style.height = `${parentRect.height - position - this.offsetHeight}px`;
|