ninegrid2 6.1025.0 → 6.1027.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 +11 -3
- package/dist/bundle.esm.js +11 -3
- package/dist/nx/nxSplitter.js +10 -2
- package/package.json +1 -1
- package/src/nx/nxSplitter.js +10 -2
package/dist/bundle.cjs.js
CHANGED
|
@@ -121403,9 +121403,13 @@ class nxSplitter extends HTMLElement {
|
|
|
121403
121403
|
e.preventDefault();
|
|
121404
121404
|
e.stopPropagation();
|
|
121405
121405
|
|
|
121406
|
-
this.getBoundingClientRect();
|
|
121406
|
+
const splitterRect = this.getBoundingClientRect();
|
|
121407
121407
|
const isHorizontal = this.#mode === "h";
|
|
121408
121408
|
|
|
121409
|
+
isHorizontal
|
|
121410
|
+
? e.clientX - splitterRect.left
|
|
121411
|
+
: e.clientY - splitterRect.top;
|
|
121412
|
+
|
|
121409
121413
|
const dragBar = document.createElement("div");
|
|
121410
121414
|
dragBar.className = `nx-splitter-drag-bar-${this.#mode}`;
|
|
121411
121415
|
|
|
@@ -121434,15 +121438,19 @@ class nxSplitter extends HTMLElement {
|
|
|
121434
121438
|
const prevRect = prev.getBoundingClientRect();
|
|
121435
121439
|
const nextRect = next.getBoundingClientRect();
|
|
121436
121440
|
|
|
121441
|
+
dragBar.offsetParent.getBoundingClientRect();
|
|
121442
|
+
|
|
121437
121443
|
let dragBarPosInParent;
|
|
121438
121444
|
if (isHorizontal) {
|
|
121439
|
-
dragBarPosInParent = e.clientX - parentRect.left;
|
|
121445
|
+
//dragBarPosInParent = e.clientX - parentRect.left;
|
|
121446
|
+
dragBarPosInParent = e.clientX;// - dragBar.offsetParent.getBoundingClientRect().left;
|
|
121440
121447
|
dragBar.style.top = "0";
|
|
121441
121448
|
dragBar.style.left = `${dragBarPosInParent}px`;
|
|
121442
121449
|
dragBar.style.width = "1px";
|
|
121443
121450
|
dragBar.style.height = "100%";
|
|
121444
121451
|
} else {
|
|
121445
|
-
dragBarPosInParent = e.clientY - parentRect.top;
|
|
121452
|
+
//dragBarPosInParent = e.clientY - parentRect.top;
|
|
121453
|
+
dragBarPosInParent = e.clientY - dragBar.offsetParent.getBoundingClientRect().top;
|
|
121446
121454
|
dragBar.style.left = "0";
|
|
121447
121455
|
dragBar.style.top = `${dragBarPosInParent}px`;
|
|
121448
121456
|
dragBar.style.height = "1px";
|
package/dist/bundle.esm.js
CHANGED
|
@@ -121399,9 +121399,13 @@ class nxSplitter extends HTMLElement {
|
|
|
121399
121399
|
e.preventDefault();
|
|
121400
121400
|
e.stopPropagation();
|
|
121401
121401
|
|
|
121402
|
-
this.getBoundingClientRect();
|
|
121402
|
+
const splitterRect = this.getBoundingClientRect();
|
|
121403
121403
|
const isHorizontal = this.#mode === "h";
|
|
121404
121404
|
|
|
121405
|
+
isHorizontal
|
|
121406
|
+
? e.clientX - splitterRect.left
|
|
121407
|
+
: e.clientY - splitterRect.top;
|
|
121408
|
+
|
|
121405
121409
|
const dragBar = document.createElement("div");
|
|
121406
121410
|
dragBar.className = `nx-splitter-drag-bar-${this.#mode}`;
|
|
121407
121411
|
|
|
@@ -121430,15 +121434,19 @@ class nxSplitter extends HTMLElement {
|
|
|
121430
121434
|
const prevRect = prev.getBoundingClientRect();
|
|
121431
121435
|
const nextRect = next.getBoundingClientRect();
|
|
121432
121436
|
|
|
121437
|
+
dragBar.offsetParent.getBoundingClientRect();
|
|
121438
|
+
|
|
121433
121439
|
let dragBarPosInParent;
|
|
121434
121440
|
if (isHorizontal) {
|
|
121435
|
-
dragBarPosInParent = e.clientX - parentRect.left;
|
|
121441
|
+
//dragBarPosInParent = e.clientX - parentRect.left;
|
|
121442
|
+
dragBarPosInParent = e.clientX;// - dragBar.offsetParent.getBoundingClientRect().left;
|
|
121436
121443
|
dragBar.style.top = "0";
|
|
121437
121444
|
dragBar.style.left = `${dragBarPosInParent}px`;
|
|
121438
121445
|
dragBar.style.width = "1px";
|
|
121439
121446
|
dragBar.style.height = "100%";
|
|
121440
121447
|
} else {
|
|
121441
|
-
dragBarPosInParent = e.clientY - parentRect.top;
|
|
121448
|
+
//dragBarPosInParent = e.clientY - parentRect.top;
|
|
121449
|
+
dragBarPosInParent = e.clientY - dragBar.offsetParent.getBoundingClientRect().top;
|
|
121442
121450
|
dragBar.style.left = "0";
|
|
121443
121451
|
dragBar.style.top = `${dragBarPosInParent}px`;
|
|
121444
121452
|
dragBar.style.height = "1px";
|
package/dist/nx/nxSplitter.js
CHANGED
|
@@ -39,6 +39,10 @@ class nxSplitter extends HTMLElement {
|
|
|
39
39
|
const splitterRect = this.getBoundingClientRect();
|
|
40
40
|
const isHorizontal = this.#mode === "h";
|
|
41
41
|
|
|
42
|
+
const clickOffset = isHorizontal
|
|
43
|
+
? e.clientX - splitterRect.left
|
|
44
|
+
: e.clientY - splitterRect.top;
|
|
45
|
+
|
|
42
46
|
const dragBar = document.createElement("div");
|
|
43
47
|
dragBar.className = `nx-splitter-drag-bar-${this.#mode}`;
|
|
44
48
|
|
|
@@ -67,15 +71,19 @@ class nxSplitter extends HTMLElement {
|
|
|
67
71
|
const prevRect = prev.getBoundingClientRect();
|
|
68
72
|
const nextRect = next.getBoundingClientRect();
|
|
69
73
|
|
|
74
|
+
const dragBarOffsetParentRect = dragBar.offsetParent.getBoundingClientRect();
|
|
75
|
+
|
|
70
76
|
let dragBarPosInParent;
|
|
71
77
|
if (isHorizontal) {
|
|
72
|
-
dragBarPosInParent = e.clientX - parentRect.left;
|
|
78
|
+
//dragBarPosInParent = e.clientX - parentRect.left;
|
|
79
|
+
dragBarPosInParent = e.clientX;// - dragBar.offsetParent.getBoundingClientRect().left;
|
|
73
80
|
dragBar.style.top = "0";
|
|
74
81
|
dragBar.style.left = `${dragBarPosInParent}px`;
|
|
75
82
|
dragBar.style.width = "1px";
|
|
76
83
|
dragBar.style.height = "100%";
|
|
77
84
|
} else {
|
|
78
|
-
dragBarPosInParent = e.clientY - parentRect.top;
|
|
85
|
+
//dragBarPosInParent = e.clientY - parentRect.top;
|
|
86
|
+
dragBarPosInParent = e.clientY - dragBar.offsetParent.getBoundingClientRect().top;
|
|
79
87
|
dragBar.style.left = "0";
|
|
80
88
|
dragBar.style.top = `${dragBarPosInParent}px`;
|
|
81
89
|
dragBar.style.height = "1px";
|
package/package.json
CHANGED
package/src/nx/nxSplitter.js
CHANGED
|
@@ -39,6 +39,10 @@ class nxSplitter extends HTMLElement {
|
|
|
39
39
|
const splitterRect = this.getBoundingClientRect();
|
|
40
40
|
const isHorizontal = this.#mode === "h";
|
|
41
41
|
|
|
42
|
+
const clickOffset = isHorizontal
|
|
43
|
+
? e.clientX - splitterRect.left
|
|
44
|
+
: e.clientY - splitterRect.top;
|
|
45
|
+
|
|
42
46
|
const dragBar = document.createElement("div");
|
|
43
47
|
dragBar.className = `nx-splitter-drag-bar-${this.#mode}`;
|
|
44
48
|
|
|
@@ -67,15 +71,19 @@ class nxSplitter extends HTMLElement {
|
|
|
67
71
|
const prevRect = prev.getBoundingClientRect();
|
|
68
72
|
const nextRect = next.getBoundingClientRect();
|
|
69
73
|
|
|
74
|
+
const dragBarOffsetParentRect = dragBar.offsetParent.getBoundingClientRect();
|
|
75
|
+
|
|
70
76
|
let dragBarPosInParent;
|
|
71
77
|
if (isHorizontal) {
|
|
72
|
-
dragBarPosInParent = e.clientX - parentRect.left;
|
|
78
|
+
//dragBarPosInParent = e.clientX - parentRect.left;
|
|
79
|
+
dragBarPosInParent = e.clientX;// - dragBar.offsetParent.getBoundingClientRect().left;
|
|
73
80
|
dragBar.style.top = "0";
|
|
74
81
|
dragBar.style.left = `${dragBarPosInParent}px`;
|
|
75
82
|
dragBar.style.width = "1px";
|
|
76
83
|
dragBar.style.height = "100%";
|
|
77
84
|
} else {
|
|
78
|
-
dragBarPosInParent = e.clientY - parentRect.top;
|
|
85
|
+
//dragBarPosInParent = e.clientY - parentRect.top;
|
|
86
|
+
dragBarPosInParent = e.clientY - dragBar.offsetParent.getBoundingClientRect().top;
|
|
79
87
|
dragBar.style.left = "0";
|
|
80
88
|
dragBar.style.top = `${dragBarPosInParent}px`;
|
|
81
89
|
dragBar.style.height = "1px";
|