@ishibashi0112/spreadsheet-grid-core 0.62.0 → 0.63.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/controllers/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.d.ts +1 -0
- package/dist/controllers/autoHeightMeasurer.js +59 -48
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +119 -115
- package/dist/controllers/columnMenuController.cjs +1 -1
- package/dist/controllers/columnMenuController.js +2 -0
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.js +2 -0
- package/dist/controllers/detailTabOrder.cjs +1 -0
- package/dist/controllers/detailTabOrder.d.ts +4 -0
- package/dist/controllers/detailTabOrder.js +33 -0
- package/dist/controllers/fillHandleController.cjs +1 -1
- package/dist/controllers/fillHandleController.js +119 -117
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.d.ts +1 -0
- package/dist/controllers/filterPopoverController.js +4 -2
- package/dist/controllers/imeInputController.cjs +1 -1
- package/dist/controllers/imeInputController.js +1 -1
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +2 -0
- package/dist/controllers/keyboardController.js +71 -68
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +22 -15
- package/dist/controllers/popoverSupport.cjs +1 -1
- package/dist/controllers/popoverSupport.d.ts +2 -0
- package/dist/controllers/popoverSupport.js +11 -3
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.js +120 -119
- package/dist/controllers/toolPanelController.cjs +1 -1
- package/dist/controllers/toolPanelController.js +2 -0
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +54 -53
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +3 -1
- package/dist/controllers/viewportSyncController.js +4 -4
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.d.ts +2 -0
- package/dist/engine/columnCommands.js +71 -31
- package/dist/engine/columnLayout.cjs +1 -1
- package/dist/engine/columnLayout.js +15 -14
- package/dist/engine/createGridEngine.cjs +1 -1
- package/dist/engine/createGridEngine.d.ts +3 -1
- package/dist/engine/createGridEngine.js +71 -49
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.d.ts +2 -1
- package/dist/engine/exportCommands.js +117 -92
- package/dist/engine/features.d.ts +3 -1
- package/dist/engine/fullFeatures.cjs +1 -1
- package/dist/engine/fullFeatures.js +23 -21
- package/dist/engine/gridApi.cjs +1 -1
- package/dist/engine/gridApi.d.ts +6 -1
- package/dist/engine/gridApi.js +378 -332
- package/dist/engine/rowPipeline.cjs +1 -1
- package/dist/engine/rowPipeline.d.ts +2 -0
- package/dist/engine/rowPipeline.js +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -6
- package/dist/logic/columnAutosize.cjs +1 -1
- package/dist/logic/columnAutosize.js +84 -84
- package/dist/logic/columnWidthState.cjs +1 -1
- package/dist/logic/columnWidthState.js +25 -20
- package/dist/logic/detailRow.cjs +1 -1
- package/dist/logic/detailRow.d.ts +11 -0
- package/dist/logic/detailRow.js +34 -1
- package/dist/logic/exportCsv.cjs +2 -2
- package/dist/logic/exportCsv.d.ts +3 -1
- package/dist/logic/exportCsv.js +15 -10
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +3 -1
- package/dist/logic/exportData.js +23 -15
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.d.ts +5 -0
- package/dist/logic/gridState.js +27 -22
- package/dist/logic/groupExport.cjs +1 -0
- package/dist/logic/groupExport.d.ts +15 -0
- package/dist/logic/groupExport.js +40 -0
- package/dist/logic/grouping.cjs +1 -1
- package/dist/logic/grouping.d.ts +2 -2
- package/dist/logic/grouping.js +58 -40
- package/dist/logic/localeText.cjs +1 -0
- package/dist/logic/localeText.d.ts +4 -0
- package/dist/logic/localeText.js +45 -0
- package/dist/logic/scrollTargets.cjs +1 -1
- package/dist/logic/scrollTargets.d.ts +6 -1
- package/dist/logic/scrollTargets.js +8 -8
- package/dist/logic/theme.cjs +1 -1
- package/dist/logic/theme.d.ts +2 -0
- package/dist/logic/theme.js +2 -2
- package/dist/model/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +4 -2
- package/dist/model/gridActions.js +12 -4
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +2 -2
- package/dist/model/gridTypes.core.d.ts +158 -27
- package/dist/utils/portalTokens.cjs +1 -0
- package/dist/utils/portalTokens.d.ts +3 -0
- package/dist/utils/portalTokens.js +65 -0
- package/package.json +1 -1
|
@@ -2,13 +2,14 @@ import { resolveMoveTargetIndex as e, resolveRowDropSlot as t, resolveRowDropSlo
|
|
|
2
2
|
import { isInsideDetailCardOf as r } from "../logic/detailRow.js";
|
|
3
3
|
import { clampClientYAboveFooter as i, computeNextScrollPosition as a, hasPointerLeftActivationRadius as o, resolveAutoScrollAxisDirection as s, resolveScrollContentBox as c } from "../logic/autoScrollGeometry.js";
|
|
4
4
|
import { applySlotToElement as l } from "../logic/slotDom.js";
|
|
5
|
+
import { syncPortalTokens as u } from "../utils/portalTokens.js";
|
|
5
6
|
//#region src/controllers/rowDragController.ts
|
|
6
|
-
var
|
|
7
|
+
var d = 14, f = 12, p = "0.5", m = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"8 6 12 2 16 6\"/><polyline points=\"16 18 12 22 8 18\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"4.9\" y1=\"4.9\" x2=\"19.1\" y2=\"19.1\"/></svg>", g = 200, _ = "cubic-bezier(0.2, 0.7, 0.3, 1)", v = `transform 160ms ${_}`, y = "data-ssg-row-dragging", b = (e) => e?.closest(".ssg-motion-off") != null, x = /translateY\((-?[\d.]+)px\)/, S = (e) => {
|
|
7
8
|
let t = [];
|
|
8
9
|
return e.querySelectorAll(".ssg-body-row[data-row-index]").forEach((n) => {
|
|
9
10
|
r(e, n) || t.push(n);
|
|
10
11
|
}), t;
|
|
11
|
-
},
|
|
12
|
+
}, C = (e) => {
|
|
12
13
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
13
14
|
return e.querySelectorAll(".ssg-detail-band[data-detail-row-index]").forEach((i) => {
|
|
14
15
|
if (r(e, i)) return;
|
|
@@ -19,22 +20,22 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
19
20
|
key: `band|${o}|${a}`
|
|
20
21
|
});
|
|
21
22
|
}), t;
|
|
22
|
-
},
|
|
23
|
+
}, w = (e) => {
|
|
23
24
|
e.style.transition = "", e.style.transform = "", e.style.willChange = "", e.style.zIndex = "";
|
|
24
|
-
},
|
|
25
|
-
let
|
|
25
|
+
}, T = () => {
|
|
26
|
+
let T = null, E = null, D = null, O = {
|
|
26
27
|
x: 0,
|
|
27
28
|
y: 0
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
for (let e of
|
|
34
|
-
},
|
|
35
|
-
if (
|
|
29
|
+
}, k = null, A = !1, j = null, M = null, N = null, P = null, F = null, I = null, L = 0, R = null, z = () => T?.motion === "live", B = null, V = null, H = null, U = () => [
|
|
30
|
+
T?.leftIndicatorRef.current ?? null,
|
|
31
|
+
T?.centerIndicatorRef.current ?? null,
|
|
32
|
+
T?.rightIndicatorRef.current ?? null
|
|
33
|
+
], W = () => {
|
|
34
|
+
for (let e of U()) e && (e.style.display = "none");
|
|
35
|
+
}, G = (e) => {
|
|
36
|
+
if (B) return;
|
|
36
37
|
let t = document.createElement("div");
|
|
37
|
-
t.setAttribute("data-grid-drag-ghost", ""),
|
|
38
|
+
t.setAttribute("data-grid-drag-ghost", ""), T?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), T?.scrollContainerRef.current?.closest(".ssg-theme-class") != null && t.classList.add("ssg-theme-class"), T?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
|
|
38
39
|
"position:fixed",
|
|
39
40
|
"top:0",
|
|
40
41
|
"left:0",
|
|
@@ -59,53 +60,53 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
59
60
|
"z-index:9999",
|
|
60
61
|
"will-change:transform",
|
|
61
62
|
"transform:translate(-9999px,-9999px)"
|
|
62
|
-
].join(";"), l(t,
|
|
63
|
+
].join(";"), l(t, T?.ghostSlot);
|
|
63
64
|
let n = document.createElement("span");
|
|
64
65
|
n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
|
|
65
66
|
let r = document.createElement("span");
|
|
66
|
-
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t),
|
|
67
|
-
},
|
|
68
|
-
let t =
|
|
67
|
+
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), u(T?.scrollContainerRef.current, t), B = t, V = n, H = null;
|
|
68
|
+
}, K = (e) => {
|
|
69
|
+
let t = B;
|
|
69
70
|
if (!t) return;
|
|
70
|
-
t.style.transform = "translate(" + (
|
|
71
|
+
t.style.transform = "translate(" + (O.x + d) + "px," + (O.y + f) + "px)";
|
|
71
72
|
let n = e ? "move" : "out";
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
let r =
|
|
75
|
-
n === "out" ? (t.style.opacity =
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
let n =
|
|
80
|
-
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${
|
|
81
|
-
r(n, e) || (t ? e.setAttribute(
|
|
73
|
+
if (H === n) return;
|
|
74
|
+
H = n;
|
|
75
|
+
let r = V;
|
|
76
|
+
n === "out" ? (t.style.opacity = p, r && (r.innerHTML = h)) : (t.style.opacity = "1", r && (r.innerHTML = m));
|
|
77
|
+
}, q = () => {
|
|
78
|
+
B && B.parentNode && B.parentNode.removeChild(B), B = null, V = null, H = null;
|
|
79
|
+
}, J = (e, t) => {
|
|
80
|
+
let n = T?.scrollContainerRef.current ?? null;
|
|
81
|
+
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${y}]`).forEach((e) => {
|
|
82
|
+
r(n, e) || (t ? e.setAttribute(y, z() ? "live" : "") : e.removeAttribute(y));
|
|
82
83
|
});
|
|
83
|
-
},
|
|
84
|
-
let e =
|
|
84
|
+
}, ee = () => {
|
|
85
|
+
let e = T?.scrollContainerRef.current ?? null;
|
|
85
86
|
if (!e) return null;
|
|
86
87
|
let t = /* @__PURE__ */ new Map();
|
|
87
|
-
for (let n of
|
|
88
|
-
let e =
|
|
88
|
+
for (let n of S(e)) {
|
|
89
|
+
let e = x.exec(n.style.transform);
|
|
89
90
|
e && t.set(n, {
|
|
90
91
|
index: Number(n.getAttribute("data-row-index")),
|
|
91
92
|
baseY: parseFloat(e[1])
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
return t;
|
|
95
|
-
},
|
|
96
|
-
let n =
|
|
97
|
-
if (!n || r === null ||
|
|
98
|
-
let i =
|
|
96
|
+
}, te = (t) => {
|
|
97
|
+
let n = I, r = E;
|
|
98
|
+
if (!n || r === null || T === null) return;
|
|
99
|
+
let i = T.scrollContainerRef.current;
|
|
99
100
|
if (!i) return;
|
|
100
|
-
for (let e of
|
|
101
|
+
for (let e of S(i)) {
|
|
101
102
|
if (n.has(e)) continue;
|
|
102
|
-
let t =
|
|
103
|
+
let t = x.exec(e.style.transform);
|
|
103
104
|
t && n.set(e, {
|
|
104
105
|
index: Number(e.getAttribute("data-row-index")),
|
|
105
106
|
baseY: parseFloat(t[1])
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
let a =
|
|
109
|
+
let a = T.rowMetrics.rowsHeight(r, r), o = (i.scrollTop - L) * T.verticalScaleFactor, s = (k ? O.y - k.y : 0) + o, c = t === null ? null : e(r, t);
|
|
109
110
|
n.forEach((e, t) => {
|
|
110
111
|
let { index: i, baseY: o } = e;
|
|
111
112
|
if (!t.isConnected) {
|
|
@@ -117,25 +118,25 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
117
118
|
return;
|
|
118
119
|
}
|
|
119
120
|
let l = 0;
|
|
120
|
-
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition =
|
|
121
|
+
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition = v, t.style.transform = `translateY(${o + l}px)`, e.applied = t.style.transform;
|
|
121
122
|
});
|
|
122
|
-
let l =
|
|
123
|
-
|
|
124
|
-
for (let { el: e, index: t } of
|
|
123
|
+
let l = R ?? /* @__PURE__ */ new Set();
|
|
124
|
+
R = l;
|
|
125
|
+
for (let { el: e, index: t } of C(i)) {
|
|
125
126
|
if (l.add(e), t === r) {
|
|
126
127
|
e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", e.style.zIndex = "10";
|
|
127
128
|
continue;
|
|
128
129
|
}
|
|
129
130
|
let n = 0;
|
|
130
|
-
c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition =
|
|
131
|
+
c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition = v, e.style.transform = `translateY(${n}px)`, e.style.zIndex = "";
|
|
131
132
|
}
|
|
132
|
-
},
|
|
133
|
-
if (
|
|
134
|
-
let { scrollContainerRef: a, bodyScrollRef: o, rowMetrics: s, headerHeight: c, verticalScaleFactor: l, windowBaseOffsetPx: u } =
|
|
133
|
+
}, ne = (e, r) => {
|
|
134
|
+
if (T === null) return null;
|
|
135
|
+
let { scrollContainerRef: a, bodyScrollRef: o, rowMetrics: s, headerHeight: c, verticalScaleFactor: l, windowBaseOffsetPx: u } = T, d = a.current, f = o.current;
|
|
135
136
|
if (!d || !f) return null;
|
|
136
137
|
let p = d.getBoundingClientRect();
|
|
137
138
|
if (e < p.left || e > p.right || r < p.top || r > p.bottom) return null;
|
|
138
|
-
let m = i(r, p.top + d.clientTop + d.clientHeight,
|
|
139
|
+
let m = i(r, p.top + d.clientTop + d.clientHeight, T.footerHeight ?? 0), h = f.getBoundingClientRect(), g = f.scrollTop + m - h.top - c - d.scrollTop * (1 - l), _ = t(g, s), v = E, y = v !== null && z() ? s.detailHeight(v) : 0;
|
|
139
140
|
if (v !== null && y > 0) {
|
|
140
141
|
let e = t(g + y, s);
|
|
141
142
|
e > v + 1 && (_ = e);
|
|
@@ -146,24 +147,24 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
146
147
|
top: c + b - u
|
|
147
148
|
};
|
|
148
149
|
}, Y = () => {
|
|
149
|
-
let t =
|
|
150
|
-
if (
|
|
151
|
-
t && n !== null && (
|
|
150
|
+
let t = ne(O.x, O.y), n = E;
|
|
151
|
+
if (z()) {
|
|
152
|
+
t && n !== null && (D = e(n, t.slot) === null ? null : t.slot), W(), te(D);
|
|
152
153
|
return;
|
|
153
154
|
}
|
|
154
|
-
if (
|
|
155
|
-
|
|
155
|
+
if (K(t), !t || n === null || e(n, t.slot) === null) {
|
|
156
|
+
D = null, W();
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
|
-
|
|
159
|
-
for (let e of
|
|
159
|
+
D = t.slot;
|
|
160
|
+
for (let e of U()) e && (e.style.top = `${t.top}px`, e.style.display = "block");
|
|
160
161
|
}, X = () => {
|
|
161
|
-
if (
|
|
162
|
-
|
|
162
|
+
if (E === null) {
|
|
163
|
+
N = null;
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
|
-
let e =
|
|
166
|
-
if (e && (
|
|
166
|
+
let e = T?.scrollContainerRef.current ?? null;
|
|
167
|
+
if (e && (A || (!k || o(k, O, 6)) && (A = !0), A)) {
|
|
167
168
|
let t = e.getBoundingClientRect(), n = c({
|
|
168
169
|
rectLeft: t.left,
|
|
169
170
|
rectTop: t.top,
|
|
@@ -171,32 +172,32 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
171
172
|
clientTop: e.clientTop,
|
|
172
173
|
clientWidth: e.clientWidth,
|
|
173
174
|
clientHeight: e.clientHeight
|
|
174
|
-
}), r = s(
|
|
175
|
+
}), r = s(O.y, n.top, n.bottom - (T?.footerHeight ?? 0), 24), i = a(e.scrollTop, r, 18, e.scrollHeight - e.clientHeight);
|
|
175
176
|
i !== e.scrollTop && e.scrollTo({
|
|
176
177
|
top: i,
|
|
177
178
|
behavior: "auto"
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
|
-
Y(),
|
|
181
|
+
Y(), N = requestAnimationFrame(X);
|
|
181
182
|
}, Z = (e, t) => `${e.getAttribute("data-pane") ?? ""}|${t}`, Q = () => {
|
|
182
|
-
let e =
|
|
183
|
+
let e = T?.scrollContainerRef.current ?? null;
|
|
183
184
|
if (!e) return null;
|
|
184
185
|
let t = /* @__PURE__ */ new Map();
|
|
185
|
-
for (let n of
|
|
186
|
-
for (let n of
|
|
186
|
+
for (let n of S(e)) t.set(Z(n, Number(n.getAttribute("data-row-index"))), n.getBoundingClientRect().top);
|
|
187
|
+
for (let n of C(e)) t.set(n.key, n.el.getBoundingClientRect().top);
|
|
187
188
|
return t;
|
|
188
189
|
}, $ = (t) => {
|
|
189
|
-
|
|
190
|
-
let n =
|
|
191
|
-
|
|
192
|
-
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null &&
|
|
193
|
-
|
|
194
|
-
let c = s && o &&
|
|
195
|
-
if (
|
|
196
|
-
e.isConnected && (e.style.transition =
|
|
190
|
+
N !== null && (cancelAnimationFrame(N), N = null), document.body.style.cursor = "", W(), q();
|
|
191
|
+
let n = E, r = D, i = F;
|
|
192
|
+
J(n, !1), E = null, F = null, D = null, k = null, M = null;
|
|
193
|
+
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null && T !== null, s = I;
|
|
194
|
+
I = null;
|
|
195
|
+
let c = s && o && T !== null && !b(T.scrollContainerRef.current) ? Q() : null, l = R;
|
|
196
|
+
if (R = null, l && (o ? l.forEach(w) : (l.forEach((e) => {
|
|
197
|
+
e.isConnected && (e.style.transition = v, e.style.transform = "translateY(0px)", e.style.zIndex = "");
|
|
197
198
|
}), window.setTimeout(() => {
|
|
198
199
|
l.forEach((e) => {
|
|
199
|
-
|
|
200
|
+
R?.has(e) || w(e);
|
|
200
201
|
});
|
|
201
202
|
}, 200))), s) if (o) s.forEach(({ baseY: e }, t) => {
|
|
202
203
|
t.style.transition = "", t.style.willChange = "", t.isConnected && (t.style.transform = `translateY(${e}px)`);
|
|
@@ -204,78 +205,78 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
204
205
|
else {
|
|
205
206
|
let e = [];
|
|
206
207
|
s.forEach(({ baseY: t }, n) => {
|
|
207
|
-
n.isConnected && (n.style.transition =
|
|
208
|
+
n.isConnected && (n.style.transition = v, n.style.transform = `translateY(${t}px)`, e.push(n));
|
|
208
209
|
}), window.setTimeout(() => {
|
|
209
210
|
for (let t of e) t.style.transition = "", t.style.willChange = "";
|
|
210
211
|
}, 200);
|
|
211
212
|
}
|
|
212
|
-
if (!o || n === null || a === null ||
|
|
213
|
-
let u = c ?? (
|
|
213
|
+
if (!o || n === null || a === null || T === null) return;
|
|
214
|
+
let u = c ?? (b(T.scrollContainerRef.current) ? null : Q()), d = u ? {
|
|
214
215
|
tops: u,
|
|
215
216
|
from: n,
|
|
216
217
|
to: a,
|
|
217
218
|
row: i
|
|
218
219
|
} : null;
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
P = d, T.commitRowMove(n, a), d && requestAnimationFrame(() => {
|
|
221
|
+
P === d && (P = null);
|
|
221
222
|
});
|
|
222
|
-
},
|
|
223
|
-
let e =
|
|
224
|
-
if (
|
|
225
|
-
let t =
|
|
223
|
+
}, re = () => {
|
|
224
|
+
let e = P;
|
|
225
|
+
if (P = null, !e) return;
|
|
226
|
+
let t = T?.scrollContainerRef.current ?? null;
|
|
226
227
|
if (!t) return;
|
|
227
228
|
let { tops: n, from: r, to: i } = e;
|
|
228
|
-
if (
|
|
229
|
+
if (T?.locateDragRow && e.row !== null && T.locateDragRow(e.row, i) !== i) return;
|
|
229
230
|
let a = (e) => e === i ? r : r < i && e >= r && e < i ? e + 1 : i < r && e > i && e <= r ? e - 1 : e, o = [], s = /* @__PURE__ */ new Map();
|
|
230
|
-
|
|
231
|
+
S(t).forEach((e) => {
|
|
231
232
|
let t = n.get(Z(e, a(Number(e.getAttribute("data-row-index")))));
|
|
232
233
|
if (t === void 0) return;
|
|
233
234
|
let r = t - e.getBoundingClientRect().top;
|
|
234
235
|
if (Math.abs(r) < .5) return;
|
|
235
|
-
let i =
|
|
236
|
+
let i = x.exec(e.style.transform);
|
|
236
237
|
if (!i) return;
|
|
237
238
|
let c = parseFloat(i[1]);
|
|
238
239
|
s.set(e, c), e.style.transition = "none", e.style.transform = `translateY(${c + r}px)`, e.style.willChange = "transform", o.push(e);
|
|
239
240
|
});
|
|
240
241
|
let c = [];
|
|
241
|
-
if (
|
|
242
|
+
if (C(t).forEach(({ el: e, index: t, key: r }) => {
|
|
242
243
|
let i = a(t), o = n.get(r.slice(0, r.lastIndexOf("|") + 1) + i);
|
|
243
244
|
if (o === void 0) return;
|
|
244
245
|
let s = o - e.getBoundingClientRect().top;
|
|
245
246
|
Math.abs(s) < .5 || (e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", c.push(e));
|
|
246
247
|
}), !(o.length === 0 && c.length === 0)) {
|
|
247
248
|
t.getBoundingClientRect();
|
|
248
|
-
for (let e of o) e.style.transition = `transform ${
|
|
249
|
-
for (let e of c) e.style.transition = `transform ${
|
|
249
|
+
for (let e of o) e.style.transition = `transform ${g}ms ${_}`, e.style.transform = `translateY(${s.get(e) ?? 0}px)`;
|
|
250
|
+
for (let e of c) e.style.transition = `transform ${g}ms ${_}`, e.style.transform = "translateY(0px)";
|
|
250
251
|
window.setTimeout(() => {
|
|
251
252
|
for (let e of o) e.style.transition = "", e.style.willChange = "";
|
|
252
|
-
for (let e of c)
|
|
253
|
+
for (let e of c) R?.has(e) || w(e);
|
|
253
254
|
}, 280);
|
|
254
255
|
}
|
|
255
|
-
},
|
|
256
|
-
if (
|
|
257
|
-
if (t.stopPropagation(), t.preventDefault(),
|
|
258
|
-
if (t.pointerId !==
|
|
259
|
-
|
|
256
|
+
}, ie = (e, t) => {
|
|
257
|
+
if (T === null || !T.enabled || t.button !== 0) return;
|
|
258
|
+
if (t.stopPropagation(), t.preventDefault(), E !== null) {
|
|
259
|
+
if (t.pointerId !== M) return;
|
|
260
|
+
j?.(), $(!1);
|
|
260
261
|
}
|
|
261
|
-
|
|
262
|
+
E = e, F = T.getDragRow?.(e) ?? null, M = t.pointerId, D = null, O = {
|
|
262
263
|
x: t.clientX,
|
|
263
264
|
y: t.clientY
|
|
264
|
-
},
|
|
265
|
+
}, k = {
|
|
265
266
|
x: t.clientX,
|
|
266
267
|
y: t.clientY
|
|
267
|
-
},
|
|
268
|
+
}, A = !1, document.body.style.cursor = "grabbing", z() ? (I = ee(), L = T.scrollContainerRef.current?.scrollTop ?? 0) : G(T.getRowDragLabel(e)), J(e, !0);
|
|
268
269
|
let n = t.currentTarget, r = t.pointerId;
|
|
269
270
|
try {
|
|
270
271
|
n.setPointerCapture(r);
|
|
271
272
|
} catch {}
|
|
272
273
|
let i = (e) => {
|
|
273
|
-
e.pointerId === r && (
|
|
274
|
+
e.pointerId === r && (O = {
|
|
274
275
|
x: e.clientX,
|
|
275
276
|
y: e.clientY
|
|
276
277
|
}, Y());
|
|
277
278
|
}, a = () => {
|
|
278
|
-
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l),
|
|
279
|
+
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l), j = null;
|
|
279
280
|
try {
|
|
280
281
|
n.releasePointerCapture(r);
|
|
281
282
|
} catch {}
|
|
@@ -292,43 +293,43 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
292
293
|
function l() {
|
|
293
294
|
a(), $(!1);
|
|
294
295
|
}
|
|
295
|
-
window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l),
|
|
296
|
-
},
|
|
297
|
-
if (
|
|
298
|
-
let t =
|
|
299
|
-
if (
|
|
296
|
+
window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l), j = a, Y(), N = requestAnimationFrame(X);
|
|
297
|
+
}, ae = (e) => {
|
|
298
|
+
if (E === null || F == null || T?.locateDragRow === void 0) return;
|
|
299
|
+
let t = T.locateDragRow(F, E);
|
|
300
|
+
if (I && I.forEach((e, t) => {
|
|
300
301
|
if (!t.isConnected) {
|
|
301
|
-
|
|
302
|
+
I?.delete(t);
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
304
305
|
let n = Number(t.getAttribute("data-row-index"));
|
|
305
306
|
if (n === e.index && (e.applied === void 0 || t.style.transform === e.applied)) return;
|
|
306
|
-
let r =
|
|
307
|
+
let r = x.exec(t.style.transform);
|
|
307
308
|
if (!r) {
|
|
308
|
-
|
|
309
|
+
I?.delete(t);
|
|
309
310
|
return;
|
|
310
311
|
}
|
|
311
312
|
e.index = n, e.baseY = parseFloat(r[1]), e.applied = void 0;
|
|
312
313
|
}), t === null) {
|
|
313
|
-
|
|
314
|
+
j?.(), $(!1);
|
|
314
315
|
return;
|
|
315
316
|
}
|
|
316
|
-
|
|
317
|
-
x:
|
|
318
|
-
y:
|
|
319
|
-
}), t !==
|
|
317
|
+
I && t !== E && k !== null && e !== null && (k = {
|
|
318
|
+
x: k.x,
|
|
319
|
+
y: k.y + T.rowMetrics.rowTop(t) - e.rowTop(E)
|
|
320
|
+
}), t !== E && (J(null, !1), E = t, J(t, !0)), Y();
|
|
320
321
|
};
|
|
321
322
|
return {
|
|
322
323
|
update: (e) => {
|
|
323
|
-
let t =
|
|
324
|
-
|
|
324
|
+
let t = T;
|
|
325
|
+
T = e, E !== null && t !== null && t.locateDragRow !== e.locateDragRow && ae(t.rowMetrics);
|
|
325
326
|
},
|
|
326
|
-
onRowDragHandlePointerDown:
|
|
327
|
-
applyReorderSettle:
|
|
327
|
+
onRowDragHandlePointerDown: ie,
|
|
328
|
+
applyReorderSettle: re,
|
|
328
329
|
dispose: () => {
|
|
329
|
-
|
|
330
|
+
j?.(), j = null, N !== null && (cancelAnimationFrame(N), N = null), document.body.style.cursor = "", q(), J(E, !1), E = null, F = null, D = null, I = null, R?.forEach(w), R = null, P = null;
|
|
330
331
|
}
|
|
331
332
|
};
|
|
332
333
|
};
|
|
333
334
|
//#endregion
|
|
334
|
-
export {
|
|
335
|
+
export { T as createRowDragController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/valueStore.cjs"),t=require("./popoverSupport.cjs"),n=require("../logic/panelDragGeometry.cjs");var r=360,i=8,a=12,o=[`filter`,`columns`,`sort`],s=e=>{let t={filter:e.canUseFilterTab,columns:e.canUseColumnsTab,sort:e.canUseSortTab};return o.filter(e=>t[e])},c=(e,t)=>e===null?null:t.includes(e)?e:t[0]??null,l=()=>{let o=null,l=e.createValueStore({requestedTab:null,layout:null,flashTick:0}),u={current:null},d=null,f=e=>{l.setSnapshot({...l.getSnapshot(),...e})},p=e=>{let t=l.getSnapshot().layout;t===e||t!==null&&e!==null&&t.top===e.top&&t.left===e.left&&t.width===e.width||f({layout:e})},m=e=>n.clampPanelDragPosition({top:e.top,left:e.left,panelWidth:r,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),h=()=>{if(d){let e=m(d);p({top:e.top,left:e.left,width:r});return}let e=o?.gridRootRef.current??null;if(!e){p(null);return}let t=e.getBoundingClientRect(),n=t.right-r-a,s=t.top+a;n=Math.max(i,n),n=Math.min(n,window.innerWidth-r-i),s=Math.max(i,s),p({top:s,left:n,width:r})},g=()=>o!==null&&c(l.getSnapshot().requestedTab,s(o))!==null,_=e=>{f({requestedTab:null,layout:null}),b(),o!==null&&e&&t.restoreGridFocus(o.gridRootRef)},v=()=>_(!0),y=t.createPopoverWindowBindings({onResize:h,onScroll:h,isInside:e=>u.current?.contains(e)===!0||o?.alliedRef?.current?.contains(e)===!0,onOutsidePointerDown:e=>_(o!==null&&t.isInsideGridRoot(o.gridRootRef,e)),onKeyDown:e=>{if(e.key===`Escape`){if(o?.suppressEscape){o.onSuppressedEscape?.();return}e.preventDefault(),v()}}}),b=()=>{let e=g();e&&!y.isAttached()?(h(),y.attach()):!e&&y.isAttached()&&y.detach()};return{update:e=>{o=e,b()},subscribe:l.subscribe,getSnapshot:l.getSnapshot,panelRef:u,open:e=>{if(o===null||!s(o).includes(e))return;let n=l.getSnapshot();t.blurForPopover(o.gridRootRef.current),f({requestedTab:e,flashTick:n.requestedTab===null?n.flashTick:n.flashTick+1}),b()},close:v,move:(e,t)=>{let n=m({top:e,left:t});d=n,f({layout:{top:n.top,left:n.left,width:r}})},dispose:()=>{y.detach()}}};exports.createToolPanelController=l,exports.resolveActiveToolPanelTab=c,exports.resolveAvailableToolPanelTabs=s;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/valueStore.cjs"),t=require("./popoverSupport.cjs"),n=require("../logic/panelDragGeometry.cjs");var r=360,i=8,a=12,o=[`filter`,`columns`,`sort`],s=e=>{let t={filter:e.canUseFilterTab,columns:e.canUseColumnsTab,sort:e.canUseSortTab};return o.filter(e=>t[e])},c=(e,t)=>e===null?null:t.includes(e)?e:t[0]??null,l=()=>{let o=null,l=e.createValueStore({requestedTab:null,layout:null,flashTick:0}),u={current:null},d=null,f=e=>{l.setSnapshot({...l.getSnapshot(),...e})},p=e=>{let t=l.getSnapshot().layout;t===e||t!==null&&e!==null&&t.top===e.top&&t.left===e.left&&t.width===e.width||f({layout:e})},m=e=>n.clampPanelDragPosition({top:e.top,left:e.left,panelWidth:r,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),h=()=>{if(d){let e=m(d);p({top:e.top,left:e.left,width:r});return}let e=o?.gridRootRef.current??null;if(!e){p(null);return}let t=e.getBoundingClientRect(),n=t.right-r-a,s=t.top+a;n=Math.max(i,n),n=Math.min(n,window.innerWidth-r-i),s=Math.max(i,s),p({top:s,left:n,width:r})},g=()=>o!==null&&c(l.getSnapshot().requestedTab,s(o))!==null,_=e=>{f({requestedTab:null,layout:null}),b(),o!==null&&e&&t.restoreGridFocus(o.gridRootRef)},v=()=>_(!0),y=t.createPopoverWindowBindings({onResize:h,onScroll:h,isInside:e=>u.current?.contains(e)===!0||o?.alliedRef?.current?.contains(e)===!0,onOutsidePointerDown:e=>_(o!==null&&t.isInsideGridRoot(o.gridRootRef,e)),getGridRoot:()=>o?.gridRootRef.current??null,onGridHidden:()=>_(!1),onKeyDown:e=>{if(e.key===`Escape`){if(o?.suppressEscape){o.onSuppressedEscape?.();return}e.preventDefault(),v()}}}),b=()=>{let e=g();e&&!y.isAttached()?(h(),y.attach()):!e&&y.isAttached()&&y.detach()};return{update:e=>{o=e,b()},subscribe:l.subscribe,getSnapshot:l.getSnapshot,panelRef:u,open:e=>{if(o===null||!s(o).includes(e))return;let n=l.getSnapshot();t.blurForPopover(o.gridRootRef.current),f({requestedTab:e,flashTick:n.requestedTab===null?n.flashTick:n.flashTick+1}),b()},close:v,move:(e,t)=>{let n=m({top:e,left:t});d=n,f({layout:{top:n.top,left:n.left,width:r}})},dispose:()=>{y.detach()}}};exports.createToolPanelController=l,exports.resolveActiveToolPanelTab=c,exports.resolveAvailableToolPanelTabs=s;
|
|
@@ -63,6 +63,8 @@ var o = 360, s = 8, c = 12, l = [
|
|
|
63
63
|
onScroll: v,
|
|
64
64
|
isInside: (e) => p.current?.contains(e) === !0 || l?.alliedRef?.current?.contains(e) === !0,
|
|
65
65
|
onOutsidePointerDown: (e) => b(l !== null && r(l.gridRootRef, e)),
|
|
66
|
+
getGridRoot: () => l?.gridRootRef.current ?? null,
|
|
67
|
+
onGridHidden: () => b(!1),
|
|
66
68
|
onKeyDown: (e) => {
|
|
67
69
|
if (e.key === "Escape") {
|
|
68
70
|
if (l?.suppressEscape) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/slotDom.cjs"),t=require("../logic/tooltipGeometry.cjs");var
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/slotDom.cjs"),t=require("../utils/portalTokens.cjs"),n=require("../logic/tooltipGeometry.cjs");var r=`data-ssg-tooltip`,i=`data-ssg-tooltip-overflow`,a=`[${r}], [${i}]`,o=350,s=800,c=0,l=null,u=null,d=0,f=null,p,m;function h(t){m=e.applySlotToElement(t,p,m)}function g(){if(l!==null)return l;let e=document.createElement(`div`);return e.className=`ssg-tooltip`,e.setAttribute(`aria-hidden`,`true`),m=void 0,h(e),document.body.appendChild(e),l=e,e}function _(){u!==null&&(window.clearTimeout(u),u=null)}var v=null;function y(){v!==null&&(cancelAnimationFrame(v),v=null)}function b(){if(y(),typeof requestAnimationFrame!=`function`)return;let e=()=>{if(v=null,f!==null){if(!f.isConnected){x();return}v=requestAnimationFrame(e)}};v=requestAnimationFrame(e)}function x(){_(),y(),f!==null&&(d=Date.now()+s),f=null,l!==null&&l.classList.remove(`ssg-tooltip--visible`)}function S(e){if(!e.isConnected)return;let a=e.getAttribute(r),o=e.getAttribute(i),s=a!==null&&a!==``?a:o!==null&&o!==``?o:(e.textContent??``).trim();if(s===``)return;let c=g();c.classList.toggle(`ssg-theme-dark`,e.closest(`.ssg-theme-dark`)!==null),c.classList.toggle(`ssg-theme-class`,e.closest(`.ssg-theme-class`)!==null),c.classList.toggle(`ssg-motion-off`,e.closest(`.ssg-motion-off`)!==null),t.syncPortalTokens(e,c),c.textContent=s,c.style.left=`0px`,c.style.top=`0px`;let l=n.computeTooltipPlacement({targetRect:e.getBoundingClientRect(),tipWidth:c.offsetWidth,tipHeight:c.offsetHeight,viewportWidth:window.innerWidth});c.style.left=`${l.left}px`,c.style.top=`${l.top}px`,c.classList.add(`ssg-tooltip--visible`),f=e,b()}function C(e){let t=e.target;if(!(t instanceof Element)||typeof PointerEvent<`u`&&e instanceof PointerEvent&&e.buttons!==0)return;let n=t.closest(a);if(n===null||n===f||!n.hasAttribute(r)&&n.scrollWidth<=n.clientWidth+1)return;let i=f!==null;x(),i||Date.now()<d?S(n):u=window.setTimeout(()=>{u=null,S(n)},o)}function w(e){let t=e.target;if(!(t instanceof Element))return;let n=t.closest(a);if(n===null)return;let r=e.relatedTarget;r instanceof Node&&n.contains(r)||x()}function T(){x()}function E(e){e.key===`Escape`&&x()}function D(){window.addEventListener(`pointerover`,C,!0),window.addEventListener(`pointerout`,w,!0),window.addEventListener(`focusin`,C,!0),window.addEventListener(`focusout`,w,!0),window.addEventListener(`pointerdown`,T,!0),window.addEventListener(`scroll`,T,!0),window.addEventListener(`keydown`,E,!0)}function O(){window.removeEventListener(`pointerover`,C,!0),window.removeEventListener(`pointerout`,w,!0),window.removeEventListener(`focusin`,C,!0),window.removeEventListener(`focusout`,w,!0),window.removeEventListener(`pointerdown`,T,!0),window.removeEventListener(`scroll`,T,!0),window.removeEventListener(`keydown`,E,!0)}function k(e){c+=1,c===1&&D();let t=!1,n=e=>{p=e,l!==null&&h(l)};return n(e),{setSlot:n,dispose:()=>{t||(t=!0,--c,c===0&&(O(),_(),y(),f=null,l!==null&&(l.remove(),l=null)))}}}exports.acquireTooltipController=k;
|
|
@@ -1,93 +1,94 @@
|
|
|
1
1
|
import { applySlotToElement as e } from "../logic/slotDom.js";
|
|
2
|
-
import {
|
|
2
|
+
import { syncPortalTokens as t } from "../utils/portalTokens.js";
|
|
3
|
+
import { computeTooltipPlacement as n } from "../logic/tooltipGeometry.js";
|
|
3
4
|
//#region src/controllers/tooltipController.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
function h() {
|
|
9
|
-
if (c !== null) return c;
|
|
10
|
-
let e = document.createElement("div");
|
|
11
|
-
return e.className = "ssg-tooltip", e.setAttribute("aria-hidden", "true"), p = void 0, m(e), document.body.appendChild(e), c = e, e;
|
|
5
|
+
var r = "data-ssg-tooltip", i = "data-ssg-tooltip-overflow", a = `[${r}], [${i}]`, o = 350, s = 800, c = 0, l = null, u = null, d = 0, f = null, p, m;
|
|
6
|
+
function h(t) {
|
|
7
|
+
m = e(t, p, m);
|
|
12
8
|
}
|
|
13
9
|
function g() {
|
|
14
|
-
l !== null
|
|
10
|
+
if (l !== null) return l;
|
|
11
|
+
let e = document.createElement("div");
|
|
12
|
+
return e.className = "ssg-tooltip", e.setAttribute("aria-hidden", "true"), m = void 0, h(e), document.body.appendChild(e), l = e, e;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
_ !== null && (cancelAnimationFrame(_), _ = null);
|
|
14
|
+
function _() {
|
|
15
|
+
u !== null && (window.clearTimeout(u), u = null);
|
|
19
16
|
}
|
|
17
|
+
var v = null;
|
|
20
18
|
function y() {
|
|
21
|
-
|
|
19
|
+
v !== null && (cancelAnimationFrame(v), v = null);
|
|
20
|
+
}
|
|
21
|
+
function b() {
|
|
22
|
+
if (y(), typeof requestAnimationFrame != "function") return;
|
|
22
23
|
let e = () => {
|
|
23
|
-
if (
|
|
24
|
-
if (!
|
|
25
|
-
|
|
24
|
+
if (v = null, f !== null) {
|
|
25
|
+
if (!f.isConnected) {
|
|
26
|
+
x();
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
v = requestAnimationFrame(e);
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
+
v = requestAnimationFrame(e);
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
34
|
+
function x() {
|
|
35
|
+
_(), y(), f !== null && (d = Date.now() + s), f = null, l !== null && l.classList.remove("ssg-tooltip--visible");
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function S(e) {
|
|
37
38
|
if (!e.isConnected) return;
|
|
38
|
-
let
|
|
39
|
-
if (
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
let
|
|
39
|
+
let a = e.getAttribute(r), o = e.getAttribute(i), s = a !== null && a !== "" ? a : o !== null && o !== "" ? o : (e.textContent ?? "").trim();
|
|
40
|
+
if (s === "") return;
|
|
41
|
+
let c = g();
|
|
42
|
+
c.classList.toggle("ssg-theme-dark", e.closest(".ssg-theme-dark") !== null), c.classList.toggle("ssg-theme-class", e.closest(".ssg-theme-class") !== null), c.classList.toggle("ssg-motion-off", e.closest(".ssg-motion-off") !== null), t(e, c), c.textContent = s, c.style.left = "0px", c.style.top = "0px";
|
|
43
|
+
let l = n({
|
|
43
44
|
targetRect: e.getBoundingClientRect(),
|
|
44
|
-
tipWidth:
|
|
45
|
-
tipHeight:
|
|
45
|
+
tipWidth: c.offsetWidth,
|
|
46
|
+
tipHeight: c.offsetHeight,
|
|
46
47
|
viewportWidth: window.innerWidth
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
+
c.style.left = `${l.left}px`, c.style.top = `${l.top}px`, c.classList.add("ssg-tooltip--visible"), f = e, b();
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function C(e) {
|
|
51
52
|
let t = e.target;
|
|
52
53
|
if (!(t instanceof Element) || typeof PointerEvent < "u" && e instanceof PointerEvent && e.buttons !== 0) return;
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
},
|
|
54
|
+
let n = t.closest(a);
|
|
55
|
+
if (n === null || n === f || !n.hasAttribute(r) && n.scrollWidth <= n.clientWidth + 1) return;
|
|
56
|
+
let i = f !== null;
|
|
57
|
+
x(), i || Date.now() < d ? S(n) : u = window.setTimeout(() => {
|
|
58
|
+
u = null, S(n);
|
|
59
|
+
}, o);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function w(e) {
|
|
61
62
|
let t = e.target;
|
|
62
63
|
if (!(t instanceof Element)) return;
|
|
63
|
-
let n = t.closest(
|
|
64
|
+
let n = t.closest(a);
|
|
64
65
|
if (n === null) return;
|
|
65
66
|
let r = e.relatedTarget;
|
|
66
|
-
r instanceof Node && n.contains(r) ||
|
|
67
|
-
}
|
|
68
|
-
function w() {
|
|
69
|
-
b();
|
|
67
|
+
r instanceof Node && n.contains(r) || x();
|
|
70
68
|
}
|
|
71
|
-
function T(
|
|
72
|
-
|
|
69
|
+
function T() {
|
|
70
|
+
x();
|
|
73
71
|
}
|
|
74
|
-
function E() {
|
|
75
|
-
|
|
72
|
+
function E(e) {
|
|
73
|
+
e.key === "Escape" && x();
|
|
76
74
|
}
|
|
77
75
|
function D() {
|
|
78
|
-
window.
|
|
76
|
+
window.addEventListener("pointerover", C, !0), window.addEventListener("pointerout", w, !0), window.addEventListener("focusin", C, !0), window.addEventListener("focusout", w, !0), window.addEventListener("pointerdown", T, !0), window.addEventListener("scroll", T, !0), window.addEventListener("keydown", E, !0);
|
|
77
|
+
}
|
|
78
|
+
function O() {
|
|
79
|
+
window.removeEventListener("pointerover", C, !0), window.removeEventListener("pointerout", w, !0), window.removeEventListener("focusin", C, !0), window.removeEventListener("focusout", w, !0), window.removeEventListener("pointerdown", T, !0), window.removeEventListener("scroll", T, !0), window.removeEventListener("keydown", E, !0);
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
81
|
+
function k(e) {
|
|
82
|
+
c += 1, c === 1 && D();
|
|
82
83
|
let t = !1, n = (e) => {
|
|
83
|
-
|
|
84
|
+
p = e, l !== null && h(l);
|
|
84
85
|
};
|
|
85
86
|
return n(e), {
|
|
86
87
|
setSlot: n,
|
|
87
88
|
dispose: () => {
|
|
88
|
-
t || (t = !0, --
|
|
89
|
+
t || (t = !0, --c, c === 0 && (O(), _(), y(), f = null, l !== null && (l.remove(), l = null)));
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
92
|
}
|
|
92
93
|
//#endregion
|
|
93
|
-
export {
|
|
94
|
+
export { k as acquireTooltipController };
|