@ishibashi0112/spreadsheet-grid-core 0.60.0 → 0.62.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/README.md +2 -2
- package/dist/controllers/changeHighlightController.cjs +1 -1
- package/dist/controllers/changeHighlightController.js +54 -49
- package/dist/controllers/clipboardController.cjs +2 -2
- package/dist/controllers/clipboardController.js +71 -76
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +74 -70
- package/dist/controllers/columnMenuController.cjs +1 -1
- package/dist/controllers/columnMenuController.d.ts +2 -0
- package/dist/controllers/columnMenuController.js +72 -60
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.js +40 -32
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.js +90 -84
- package/dist/controllers/findController.cjs +1 -1
- package/dist/controllers/findController.js +71 -71
- package/dist/controllers/imeInputController.cjs +1 -1
- package/dist/controllers/imeInputController.js +68 -65
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +3 -0
- package/dist/controllers/keyboardController.js +184 -91
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.js +11 -2
- package/dist/controllers/popoverSupport.cjs +1 -1
- package/dist/controllers/popoverSupport.d.ts +1 -0
- package/dist/controllers/popoverSupport.js +14 -2
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +2 -0
- package/dist/controllers/rowDragController.js +222 -138
- package/dist/controllers/rowEnterController.cjs +1 -1
- package/dist/controllers/rowEnterController.js +49 -47
- package/dist/controllers/saveStatusController.cjs +1 -1
- package/dist/controllers/saveStatusController.js +101 -48
- package/dist/controllers/serverSideRowModel.cjs +1 -1
- package/dist/controllers/serverSideRowModel.d.ts +1 -0
- package/dist/controllers/serverSideRowModel.js +199 -130
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +38 -21
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +2 -1
- package/dist/controllers/viewportSyncController.js +3 -2
- package/dist/engine/columnLayout.cjs +1 -1
- package/dist/engine/columnLayout.d.ts +1 -0
- package/dist/engine/columnLayout.js +12 -11
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.js +27 -25
- package/dist/engine/filterPopoverCommands.cjs +1 -1
- package/dist/engine/filterPopoverCommands.js +12 -7
- package/dist/engine/gridApi.cjs +1 -1
- package/dist/engine/gridApi.d.ts +4 -1
- package/dist/engine/gridApi.js +175 -129
- package/dist/engine/notifiers.cjs +1 -1
- package/dist/engine/notifiers.d.ts +1 -0
- package/dist/engine/notifiers.js +10 -5
- package/dist/logic/conditionalFormat.cjs +1 -1
- package/dist/logic/conditionalFormat.js +2 -2
- package/dist/logic/detailRow.cjs +1 -1
- package/dist/logic/detailRow.d.ts +1 -0
- package/dist/logic/detailRow.js +9 -4
- package/dist/logic/domGuards.cjs +1 -1
- package/dist/logic/domGuards.d.ts +4 -0
- package/dist/logic/domGuards.js +2 -2
- package/dist/logic/editorValues.cjs +1 -1
- package/dist/logic/editorValues.d.ts +2 -0
- package/dist/logic/editorValues.js +19 -9
- package/dist/logic/fillSeries.cjs +1 -1
- package/dist/logic/fillSeries.js +43 -36
- package/dist/logic/filterSummary.cjs +1 -1
- package/dist/logic/filterSummary.d.ts +9 -3
- package/dist/logic/filterSummary.js +39 -13
- package/dist/logic/find.cjs +1 -1
- package/dist/logic/find.d.ts +1 -0
- package/dist/logic/find.js +6 -6
- package/dist/logic/gridAsk.cjs +1 -1
- package/dist/logic/gridAsk.js +106 -106
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.d.ts +14 -0
- package/dist/logic/gridState.js +114 -62
- package/dist/logic/numberFilterCondition.cjs +1 -1
- package/dist/logic/numberFilterCondition.d.ts +1 -1
- package/dist/logic/numberFilterCondition.js +12 -9
- package/dist/logic/selectionAggregates.cjs +1 -1
- package/dist/logic/selectionAggregates.js +5 -2
- package/dist/logic/serverSideEdits.cjs +1 -1
- package/dist/logic/serverSideEdits.d.ts +16 -2
- package/dist/logic/serverSideEdits.js +60 -14
- package/dist/logic/urgentFilters.cjs +1 -0
- package/dist/logic/urgentFilters.d.ts +3 -0
- package/dist/logic/urgentFilters.js +6 -0
- package/dist/logic/validation.cjs +1 -1
- package/dist/logic/validation.d.ts +1 -1
- package/dist/logic/validation.js +10 -10
- package/dist/logic/valueFormatters.d.ts +2 -1
- package/dist/model/gridStore.cjs +1 -1
- package/dist/model/gridStore.d.ts +1 -0
- package/dist/model/gridStore.js +2 -1
- package/dist/model/gridTypes.core.d.ts +92 -16
- package/dist/utils/clipboard.cjs +5 -5
- package/dist/utils/clipboard.d.ts +3 -0
- package/dist/utils/clipboard.js +58 -65
- package/dist/utils/permissions.cjs +1 -1
- package/dist/utils/permissions.js +5 -3
- package/package.json +1 -6
|
@@ -40,18 +40,18 @@ var f = (e) => {
|
|
|
40
40
|
let n = 0;
|
|
41
41
|
for (; n < e.entries.length && t(e.entries[n].column.key);) n += 1;
|
|
42
42
|
return n;
|
|
43
|
-
}, p = 32, m = 2, h = 14, g = 12, _ = 14, v = (e) => "<svg viewBox=\"0 0 24 24\" width=\"" + e + "\" height=\"" + e + "\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"5 9 2 12 5 15\"/><polyline points=\"9 5 12 2 15 5\"/><polyline points=\"15 19 12 22 9 19\"/><polyline points=\"19 9 22 12 19 15\"/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", y = (e) => "<svg viewBox=\"0 0 24 24\" width=\"" + e + "\" height=\"" + e + "\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"22\"/><path d=\"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z\"/></svg>", ee = v(_), te = y(_), ne = "<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>", re = "0.5", ie = 200, b = "cubic-bezier(0.2, 0.7, 0.3, 1)", ae = (e) => e?.closest(".ssg-motion-off") != null, oe = 160,
|
|
43
|
+
}, p = 32, m = 2, h = 14, g = 12, _ = 14, v = (e) => "<svg viewBox=\"0 0 24 24\" width=\"" + e + "\" height=\"" + e + "\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"5 9 2 12 5 15\"/><polyline points=\"9 5 12 2 15 5\"/><polyline points=\"15 19 12 22 9 19\"/><polyline points=\"19 9 22 12 19 15\"/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", y = (e) => "<svg viewBox=\"0 0 24 24\" width=\"" + e + "\" height=\"" + e + "\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"22\"/><path d=\"M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z\"/></svg>", ee = v(_), te = y(_), ne = "<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>", re = "0.5", ie = 200, b = "cubic-bezier(0.2, 0.7, 0.3, 1)", ae = (e) => e?.closest(".ssg-motion-off") != null, oe = 160, se = `transform ${oe}ms ${b}`, x = "data-ssg-col-dragging", ce = "4", le = "9", ue = "ssg-col-drag-float", de = "ssg-col-drag-pin", S = 12, fe = "ssg-col-drop-indicator", pe = "ssg-header-cell", me = [
|
|
44
44
|
"data-ssg-col-key",
|
|
45
45
|
"data-ssg-tooltip",
|
|
46
46
|
"data-autoheight-cell",
|
|
47
47
|
"id",
|
|
48
48
|
"tabindex"
|
|
49
|
-
],
|
|
49
|
+
], he = 180, ge = 400, C = (t) => {
|
|
50
50
|
let n = [];
|
|
51
51
|
return t.querySelectorAll("[data-ssg-col-key]").forEach((r) => {
|
|
52
52
|
e(t, r) || n.push(r);
|
|
53
53
|
}), n;
|
|
54
|
-
},
|
|
54
|
+
}, _e = (t) => {
|
|
55
55
|
if (!t) return null;
|
|
56
56
|
let n = /* @__PURE__ */ new Map();
|
|
57
57
|
return t.querySelectorAll("[data-ssg-col-key]").forEach((r) => {
|
|
@@ -59,23 +59,23 @@ var f = (e) => {
|
|
|
59
59
|
let i = r.dataset.ssgColKey;
|
|
60
60
|
i && !n.has(i) && n.set(i, r.getBoundingClientRect().left);
|
|
61
61
|
}), n;
|
|
62
|
-
},
|
|
62
|
+
}, ve = (e) => {
|
|
63
63
|
let t = getComputedStyle(e).transform, n = /^matrix(3d)?\(([^)]*)\)$/.exec(t);
|
|
64
64
|
if (n === null) return 0;
|
|
65
65
|
let r = Number(n[2].split(",")[n[1] === "3d" ? 12 : 4]);
|
|
66
66
|
return Number.isFinite(r) ? r : 0;
|
|
67
|
-
},
|
|
68
|
-
let t = null, _ = null,
|
|
67
|
+
}, w = () => {
|
|
68
|
+
let t = null, _ = null, w = null, T = null, E = {
|
|
69
69
|
x: 0,
|
|
70
70
|
y: 0
|
|
71
|
-
},
|
|
71
|
+
}, D = null, O = !1, k = null, A = null, j = null, M = null, N = null, P = null, F = null, I = null, L = 0, R = null, z = null, B = "", V = null, ye = 0, H = null, U = null, be = () => t?.motion === "live", W = () => ({
|
|
72
72
|
left: t?.leftIndicatorRef.current ?? null,
|
|
73
73
|
center: t?.centerIndicatorRef.current ?? null,
|
|
74
74
|
right: t?.rightIndicatorRef.current ?? null
|
|
75
75
|
}), G = () => {
|
|
76
76
|
for (let e of Object.values(W())) e && (e.style.display = "none");
|
|
77
77
|
}, xe = (e) => {
|
|
78
|
-
if (
|
|
78
|
+
if (N) return;
|
|
79
79
|
let n = document.createElement("div");
|
|
80
80
|
n.setAttribute("data-grid-drag-ghost", ""), t?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && n.classList.add("ssg-theme-dark"), t?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && n.classList.add("ssg-motion-off"), n.style.cssText = [
|
|
81
81
|
"position:fixed",
|
|
@@ -103,18 +103,18 @@ var f = (e) => {
|
|
|
103
103
|
let r = document.createElement("span");
|
|
104
104
|
r.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
|
|
105
105
|
let i = document.createElement("span");
|
|
106
|
-
i.textContent = e, n.appendChild(r), n.appendChild(i), document.body.appendChild(n),
|
|
106
|
+
i.textContent = e, n.appendChild(r), n.appendChild(i), document.body.appendChild(n), N = n, P = r, F = null;
|
|
107
107
|
}, Se = (e) => {
|
|
108
|
-
let t =
|
|
108
|
+
let t = N;
|
|
109
109
|
if (!t) return;
|
|
110
|
-
t.style.transform = "translate(" + (
|
|
110
|
+
t.style.transform = "translate(" + (E.x + h) + "px," + (E.y + g) + "px)";
|
|
111
111
|
let n = e ?? "out";
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
let r =
|
|
112
|
+
if (F === n) return;
|
|
113
|
+
F = n;
|
|
114
|
+
let r = P;
|
|
115
115
|
n === "out" ? (t.style.opacity = re, r && (r.innerHTML = ne)) : (t.style.opacity = "1", r && (r.innerHTML = n === "center" ? ee : te));
|
|
116
116
|
}, K = () => {
|
|
117
|
-
|
|
117
|
+
N && N.parentNode && N.parentNode.removeChild(N), N = null, P = null, F = null;
|
|
118
118
|
}, Ce = (e, r) => {
|
|
119
119
|
if (t === null) return null;
|
|
120
120
|
let { paneLayout: a, leftPaneScrollRef: o, rightPaneScrollRef: s, bodyScrollRef: c, scrollContainerRef: l, leftLeadingWidth: u, centerLeadingWidth: d, rightLeadingWidth: h } = t, g = l.current;
|
|
@@ -182,7 +182,7 @@ var f = (e) => {
|
|
|
182
182
|
visibility: t.style.visibility
|
|
183
183
|
});
|
|
184
184
|
}, q = (e, n) => {
|
|
185
|
-
let r = [], i = R, a = _, o =
|
|
185
|
+
let r = [], i = R, a = _, o = I;
|
|
186
186
|
if (!i || a === null || o === null || t === null) return r;
|
|
187
187
|
let s = t.scrollContainerRef.current;
|
|
188
188
|
if (!s) return r;
|
|
@@ -190,17 +190,17 @@ var f = (e) => {
|
|
|
190
190
|
if (l < 0) return r;
|
|
191
191
|
let u = c[l].paneLocalSize, d = n === "lift-out" ? c.length - 1 : n === "rest" || e === null ? l : e > l ? e - 1 : e, f = /* @__PURE__ */ new Map();
|
|
192
192
|
for (let e = Math.min(l, d); e <= Math.max(l, d); e += 1) e !== l && f.set(c[e].column.key, e > l ? -u : u);
|
|
193
|
-
let p = o === "center" ? s.scrollLeft -
|
|
193
|
+
let p = o === "center" ? s.scrollLeft - L : 0, m = (D ? E.x - D.x : 0) + p, h = U, g = /* @__PURE__ */ new WeakSet();
|
|
194
194
|
U = g;
|
|
195
|
-
for (let e of
|
|
195
|
+
for (let e of C(s)) {
|
|
196
196
|
let t = e.dataset.ssgColKey;
|
|
197
197
|
if (t === void 0) continue;
|
|
198
198
|
g.add(e);
|
|
199
|
-
let o = h !== null && !h.has(e) ? "none" :
|
|
199
|
+
let o = h !== null && !h.has(e) ? "none" : se;
|
|
200
200
|
if (t === a) {
|
|
201
|
-
r.push(e), i.has(e) || (Te(i, e), e.style.zIndex =
|
|
201
|
+
r.push(e), i.has(e) || (Te(i, e), e.style.zIndex = ce, e.style.willChange = "transform");
|
|
202
202
|
let t = i.get(e);
|
|
203
|
-
n === "follow" ? (e.style.visibility = t?.visibility ?? "", e.setAttribute(
|
|
203
|
+
n === "follow" ? (e.style.visibility = t?.visibility ?? "", e.setAttribute(x, "live"), e.style.transition = "none", e.style.transform = `translateX(${m}px)`) : n === "lift-out" ? (e.style.visibility = "hidden", e.removeAttribute(x), e.style.transition = "none", e.style.transform = "translateX(0px)") : (e.style.visibility = t?.visibility ?? "", e.removeAttribute(x), e.style.transition = o, e.style.transform = "translateX(0px)");
|
|
204
204
|
continue;
|
|
205
205
|
}
|
|
206
206
|
let s = f.get(t) ?? 0;
|
|
@@ -212,22 +212,22 @@ var f = (e) => {
|
|
|
212
212
|
return r;
|
|
213
213
|
}, J = (e) => {
|
|
214
214
|
e.forEach((e, t) => {
|
|
215
|
-
t.style.transition = "", t.style.transform = "", t.style.willChange = "", t.style.zIndex = e.zIndex, t.style.visibility = e.visibility, t.removeAttribute(
|
|
215
|
+
t.style.transition = "", t.style.transform = "", t.style.willChange = "", t.style.zIndex = e.zIndex, t.style.visibility = e.visibility, t.removeAttribute(x);
|
|
216
216
|
});
|
|
217
217
|
}, Ee = (e) => {
|
|
218
218
|
let t = (e) => {
|
|
219
|
-
for (let t of
|
|
219
|
+
for (let t of me) e.removeAttribute(t);
|
|
220
220
|
};
|
|
221
221
|
t(e), e.querySelectorAll("*").forEach(t), e.querySelectorAll(".ssg-header-actions").forEach((e) => e.remove());
|
|
222
222
|
}, De = (e, t, n) => {
|
|
223
223
|
let r = V;
|
|
224
224
|
if (r === null) {
|
|
225
225
|
let e = document.createElement("div");
|
|
226
|
-
e.className =
|
|
226
|
+
e.className = ue, e.setAttribute("aria-hidden", "true"), e.setAttribute("inert", "");
|
|
227
227
|
let n = document.createElement("div");
|
|
228
228
|
n.style.cssText = "position:absolute;top:0;left:0;height:100%;will-change:transform";
|
|
229
229
|
let i = document.createElement("div");
|
|
230
|
-
i.className =
|
|
230
|
+
i.className = fe, i.style.cssText = "position:absolute;display:none", e.append(n, i), t.appendChild(e), r = {
|
|
231
231
|
layer: e,
|
|
232
232
|
column: n,
|
|
233
233
|
guide: i,
|
|
@@ -248,17 +248,17 @@ var f = (e) => {
|
|
|
248
248
|
`height:${e.clientHeight}px`,
|
|
249
249
|
"overflow:hidden",
|
|
250
250
|
"pointer-events:none",
|
|
251
|
-
`z-index:${
|
|
251
|
+
`z-index:${le}`
|
|
252
252
|
].join(";");
|
|
253
253
|
let c = [], l = [], u = 0;
|
|
254
254
|
for (let e of n) {
|
|
255
255
|
let t = e.getBoundingClientRect(), n = e.cloneNode(!0);
|
|
256
|
-
Ee(n), n.setAttribute(
|
|
256
|
+
Ee(n), n.setAttribute(x, "live");
|
|
257
257
|
let r = n.style;
|
|
258
|
-
r.position = "absolute", r.left = "0px", r.top = `${t.top - s}px`, r.width = `${t.width}px`, r.minWidth = `${t.width}px`, r.height = `${t.height}px`, r.transform = "", r.transition = "", r.visibility = "", r.willChange = "", r.zIndex = "", u = Math.max(u, t.width), (n.classList.contains(
|
|
258
|
+
r.position = "absolute", r.left = "0px", r.top = `${t.top - s}px`, r.width = `${t.width}px`, r.minWidth = `${t.width}px`, r.height = `${t.height}px`, r.transform = "", r.transition = "", r.visibility = "", r.willChange = "", r.zIndex = "", u = Math.max(u, t.width), (n.classList.contains(pe) ? l : c).push(n);
|
|
259
259
|
}
|
|
260
260
|
let d = null;
|
|
261
|
-
for (let e of l) e.style.zIndex = "1", d === null && (d = document.createElement("span"), d.className =
|
|
261
|
+
for (let e of l) e.style.zIndex = "1", d === null && (d = document.createElement("span"), d.className = de, e.insertBefore(d, e.firstChild));
|
|
262
262
|
return r.column.replaceChildren(...c, ...l), r.column.style.width = `${u}px`, r.badge = d, r.badgeKind = null, r.layerWidth = e.clientWidth, r.columnWidth = u, r.scrollTop = e.scrollTop, r.cellCount = n.length, r;
|
|
263
263
|
}, Oe = (e) => {
|
|
264
264
|
let n = t?.scrollContainerRef.current ?? null, r = n?.parentElement ?? null;
|
|
@@ -282,10 +282,10 @@ var f = (e) => {
|
|
|
282
282
|
}
|
|
283
283
|
r.style.left = `${a.left - n.left}px`, r.style.top = `${a.top - n.top}px`, r.style.height = `${a.height}px`, r.style.display = "block";
|
|
284
284
|
}, je = (e, t) => {
|
|
285
|
-
let n = e.layer.getBoundingClientRect(), r = Math.max(e.layerWidth - e.columnWidth, 0), i = Math.min(Math.max(
|
|
285
|
+
let n = e.layer.getBoundingClientRect(), r = Math.max(e.layerWidth - e.columnWidth, 0), i = Math.min(Math.max(E.x - ye - n.left, 0), r);
|
|
286
286
|
e.column.style.transition = "none", e.column.style.transform = `translateX(${i}px)`;
|
|
287
287
|
let a = t === null ? "none" : t === "center" ? "move" : "pin";
|
|
288
|
-
e.badge !== null && e.badgeKind !== a && (e.badgeKind = a, e.badge.innerHTML = a === "none" ? "" : a === "move" ? v(
|
|
288
|
+
e.badge !== null && e.badgeKind !== a && (e.badgeKind = a, e.badge.innerHTML = a === "none" ? "" : a === "move" ? v(S) : y(S), e.badge.style.display = a === "none" ? "none" : ""), Ae(e, t, n);
|
|
289
289
|
}, Y = () => {
|
|
290
290
|
V?.layer.remove(), V = null;
|
|
291
291
|
}, Me = (e, t, n) => {
|
|
@@ -304,23 +304,23 @@ var f = (e) => {
|
|
|
304
304
|
let n = e.key;
|
|
305
305
|
if (e.pane !== null && !t?.paneLayout[e.pane].entries.some((e) => e.column.key === n)) return;
|
|
306
306
|
e.key = null;
|
|
307
|
-
let r = t?.scrollContainerRef.current ?? null, i = r ?
|
|
307
|
+
let r = t?.scrollContainerRef.current ?? null, i = r ? C(r).filter((e) => e.dataset.ssgColKey === n) : [];
|
|
308
308
|
if (i.length === 0) {
|
|
309
309
|
X();
|
|
310
310
|
return;
|
|
311
311
|
}
|
|
312
312
|
let a = i[0].getBoundingClientRect().left;
|
|
313
313
|
for (let t of i) e.hiddenCells.push([t, t.style.visibility]), t.style.visibility = "hidden";
|
|
314
|
-
Me(e.float, a,
|
|
314
|
+
Me(e.float, a, he), e.timer !== null && window.clearTimeout(e.timer), e.timer = window.setTimeout(X, 220);
|
|
315
315
|
}, Z = () => {
|
|
316
|
-
let e = Ce(
|
|
316
|
+
let e = Ce(E.x, E.y);
|
|
317
317
|
if (be()) {
|
|
318
|
-
e && (
|
|
318
|
+
e && (w = {
|
|
319
319
|
pane: e.pane,
|
|
320
320
|
slot: e.slot
|
|
321
321
|
});
|
|
322
|
-
let n =
|
|
323
|
-
if (n !== null && n.pane !==
|
|
322
|
+
let n = w;
|
|
323
|
+
if (n !== null && n.pane !== I) {
|
|
324
324
|
if (e && we(e), (t?.scrollContainerRef.current ?? null)?.parentElement != null) {
|
|
325
325
|
let e = Oe(q(null, "lift-out"));
|
|
326
326
|
if (e !== null) {
|
|
@@ -339,20 +339,20 @@ var f = (e) => {
|
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
341
|
if (Se(e ? e.pane : null), !e) {
|
|
342
|
-
|
|
342
|
+
w = null, G();
|
|
343
343
|
return;
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
w = {
|
|
346
346
|
pane: e.pane,
|
|
347
347
|
slot: e.slot
|
|
348
348
|
}, we(e);
|
|
349
349
|
}, Pe = () => {
|
|
350
350
|
if (_ === null) {
|
|
351
|
-
|
|
351
|
+
j = null;
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
354
|
let e = t?.scrollContainerRef.current ?? null;
|
|
355
|
-
if (e && (
|
|
355
|
+
if (e && (O || (!D || o(D, E, 6)) && (O = !0), O)) {
|
|
356
356
|
let t = e.getBoundingClientRect(), n = c({
|
|
357
357
|
rectLeft: t.left,
|
|
358
358
|
rectTop: t.top,
|
|
@@ -360,23 +360,23 @@ var f = (e) => {
|
|
|
360
360
|
clientTop: e.clientTop,
|
|
361
361
|
clientWidth: e.clientWidth,
|
|
362
362
|
clientHeight: e.clientHeight
|
|
363
|
-
}), r = s(
|
|
363
|
+
}), r = s(E.x, n.left, n.right, 24), i = a(e.scrollLeft, r, 18, e.scrollWidth - e.clientWidth);
|
|
364
364
|
i !== e.scrollLeft && e.scrollTo({
|
|
365
365
|
left: i,
|
|
366
366
|
behavior: "auto"
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
Z(),
|
|
369
|
+
Z(), j = requestAnimationFrame(Pe);
|
|
370
370
|
}, Q = (e) => {
|
|
371
|
-
|
|
372
|
-
let n = _, i =
|
|
373
|
-
_ = null,
|
|
371
|
+
j !== null && (cancelAnimationFrame(j), j = null), document.body.style.cursor = "", G(), K();
|
|
372
|
+
let n = _, i = w;
|
|
373
|
+
_ = null, A = null, U = null, w = null, D = null;
|
|
374
374
|
let a = R;
|
|
375
|
-
R = null,
|
|
375
|
+
R = null, I = null;
|
|
376
376
|
let o = n !== null && i !== null && t !== null ? t.paneLayout[i.pane].entries.findIndex((e) => e.column.key === n) : -1, s = i !== null && o >= 0 && (i.slot === o || i.slot === o + 1), c = e && n && i && t !== null && !s ? u(t.columns, n, i.pane, d(t.columns, t.paneLayout[i.pane], i.pane, i.slot)) : null, l = V;
|
|
377
377
|
if (V = null, a && !c) {
|
|
378
378
|
a.forEach((e, t) => {
|
|
379
|
-
t.isConnected && (t.style.transition =
|
|
379
|
+
t.isConnected && (t.style.transition = se, t.style.transform = "translateX(0px)");
|
|
380
380
|
});
|
|
381
381
|
let e = null;
|
|
382
382
|
if (l !== null) {
|
|
@@ -399,17 +399,21 @@ var f = (e) => {
|
|
|
399
399
|
} else l !== null && !c && l.layer.remove();
|
|
400
400
|
if (!c || !n || !i || t === null) return;
|
|
401
401
|
let { columns: f, applyColumnOrderAndPin: p, scrollContainerRef: m } = t, h = f.find((e) => e.key === n), g = h ? r(h) : null;
|
|
402
|
-
|
|
402
|
+
T = g !== null && g === i.pane && !ae(m.current) ? _e(m.current) : null, a && J(a), l !== null && (l.badge?.remove(), l.guide.style.display = "none", H = {
|
|
403
403
|
float: l,
|
|
404
404
|
key: n,
|
|
405
405
|
pane: i.pane,
|
|
406
|
-
timer: window.setTimeout(X,
|
|
406
|
+
timer: window.setTimeout(X, ge),
|
|
407
407
|
hiddenCells: []
|
|
408
|
-
})
|
|
408
|
+
});
|
|
409
|
+
let v = /* @__PURE__ */ new Map([[n, i.pane === "center" ? void 0 : i.pane]]), y = T;
|
|
410
|
+
p(c, v), y !== null && requestAnimationFrame(() => {
|
|
411
|
+
T === y && (T = null);
|
|
412
|
+
});
|
|
409
413
|
}, Fe = () => {
|
|
410
414
|
Ne();
|
|
411
|
-
let n =
|
|
412
|
-
if (
|
|
415
|
+
let n = T;
|
|
416
|
+
if (T = null, !n) return;
|
|
413
417
|
let r = t?.scrollContainerRef.current ?? null;
|
|
414
418
|
if (!r) return;
|
|
415
419
|
let i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
@@ -435,13 +439,13 @@ var f = (e) => {
|
|
|
435
439
|
}, c = {
|
|
436
440
|
run: s,
|
|
437
441
|
timer: window.setTimeout(() => {
|
|
438
|
-
|
|
442
|
+
M === c && (M = null), s();
|
|
439
443
|
}, 280)
|
|
440
444
|
};
|
|
441
|
-
|
|
445
|
+
M = c;
|
|
442
446
|
}, $ = () => {
|
|
443
|
-
let e =
|
|
444
|
-
|
|
447
|
+
let e = M;
|
|
448
|
+
M = null, e !== null && (window.clearTimeout(e.timer), e.run());
|
|
445
449
|
};
|
|
446
450
|
return {
|
|
447
451
|
update: (e) => {
|
|
@@ -450,34 +454,34 @@ var f = (e) => {
|
|
|
450
454
|
onColumnDragHandlePointerDown: (e, n) => {
|
|
451
455
|
if (t === null || !t.enabled || n.button !== 0) return;
|
|
452
456
|
if (n.stopPropagation(), n.preventDefault(), _ !== null) {
|
|
453
|
-
if (n.pointerId !==
|
|
454
|
-
|
|
457
|
+
if (n.pointerId !== A) return;
|
|
458
|
+
k?.(), Q(!1);
|
|
455
459
|
}
|
|
456
460
|
if ($(), X(), Y(), z?.forEach((e, t) => {
|
|
457
461
|
t.style.visibility = e.visibility;
|
|
458
|
-
}), _ = e.key,
|
|
462
|
+
}), _ = e.key, A = n.pointerId, w = null, U = null, E = {
|
|
459
463
|
x: n.clientX,
|
|
460
464
|
y: n.clientY
|
|
461
|
-
},
|
|
465
|
+
}, D = {
|
|
462
466
|
x: n.clientX,
|
|
463
467
|
y: n.clientY
|
|
464
|
-
},
|
|
468
|
+
}, O = !1, document.body.style.cursor = "grabbing", B = e.title || e.key, be()) {
|
|
465
469
|
let i = t.scrollContainerRef.current;
|
|
466
|
-
|
|
467
|
-
let a = i ?
|
|
468
|
-
ye = a ? n.clientX - (a.getBoundingClientRect().left -
|
|
470
|
+
I = r(e), L = i?.scrollLeft ?? 0, R = /* @__PURE__ */ new Map();
|
|
471
|
+
let a = i ? C(i).find((t) => t.dataset.ssgColKey === e.key) : void 0;
|
|
472
|
+
ye = a ? n.clientX - (a.getBoundingClientRect().left - ve(a)) : (t.paneLayout[I].entries.find((t) => t.column.key === e.key)?.paneLocalSize ?? 0) / 2;
|
|
469
473
|
} else xe(B);
|
|
470
474
|
let i = n.currentTarget, a = n.pointerId;
|
|
471
475
|
try {
|
|
472
476
|
i.setPointerCapture(a);
|
|
473
477
|
} catch {}
|
|
474
478
|
let o = (e) => {
|
|
475
|
-
e.pointerId === a && (
|
|
479
|
+
e.pointerId === a && (E = {
|
|
476
480
|
x: e.clientX,
|
|
477
481
|
y: e.clientY
|
|
478
482
|
}, Z());
|
|
479
483
|
}, s = () => {
|
|
480
|
-
window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", l), window.removeEventListener("keydown", u), window.removeEventListener("blur", d),
|
|
484
|
+
window.removeEventListener("pointermove", o), window.removeEventListener("pointerup", c), window.removeEventListener("pointercancel", l), window.removeEventListener("keydown", u), window.removeEventListener("blur", d), k = null;
|
|
481
485
|
try {
|
|
482
486
|
i.releasePointerCapture(a);
|
|
483
487
|
} catch {}
|
|
@@ -494,13 +498,13 @@ var f = (e) => {
|
|
|
494
498
|
function d() {
|
|
495
499
|
s(), Q(!1);
|
|
496
500
|
}
|
|
497
|
-
window.addEventListener("pointermove", o), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", l), window.addEventListener("keydown", u), window.addEventListener("blur", d),
|
|
501
|
+
window.addEventListener("pointermove", o), window.addEventListener("pointerup", c), window.addEventListener("pointercancel", l), window.addEventListener("keydown", u), window.addEventListener("blur", d), k = s, Z(), j = requestAnimationFrame(Pe);
|
|
498
502
|
},
|
|
499
503
|
applyReorderSettle: Fe,
|
|
500
504
|
dispose: () => {
|
|
501
|
-
|
|
505
|
+
k?.(), k = null, j !== null && (cancelAnimationFrame(j), j = null), _ = null, A = null, w = null, document.body.style.cursor = "", K(), R && J(R), R = null, I = null, Y(), X();
|
|
502
506
|
}
|
|
503
507
|
};
|
|
504
508
|
};
|
|
505
509
|
//#endregion
|
|
506
|
-
export { u as computeHeaderReorderedKeys,
|
|
510
|
+
export { u as computeHeaderReorderedKeys, w as createColumnHeaderDragController, d as resolveConsumerDropSlot };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/valueStore.cjs"),t=require("./popoverSupport.cjs");var n=200,r=8,
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/valueStore.cjs"),t=require("./popoverSupport.cjs");var n=200,r=`.ssg-menu-item`,i=8,a=6,o=289,s=()=>{let s=null,c=e.createValueStore({columnKey:null,layout:null}),l={current:null},u=null,d=!1,f=null,p=null,m=null,h=e=>{let t=c.getSnapshot(),n=t.layout;n===e||n!==null&&e!==null&&n.top===e.top&&n.left===e.left&&n.width===e.width&&n.maxHeight===e.maxHeight||c.setSnapshot({...t,layout:e})},g=()=>{m!==null&&(cancelAnimationFrame(m),m=null),b.detach(),c.setSnapshot({columnKey:null,layout:null})},_=()=>{if(c.getSnapshot().columnKey===null){h(null);return}let e,t,r,s=l.current,d=s?s.scrollHeight+(s.offsetHeight-s.clientHeight):o;if(u){if(!u.isConnected){u=null,g();return}let i=u.getBoundingClientRect();t=i.right-n,e=i.bottom+a,r=i.top-d-a}else if(f)t=f.x,e=f.y,r=f.y-d;else{h(null);return}t=Math.max(i,t),t=Math.min(t,window.innerWidth-n-i);let p=window.innerHeight-i;e+d>p&&r>=i&&(e=r),e=Math.max(i,e);let m=p-e;h({top:e,left:t,width:n,maxHeight:d>m?Math.max(m,0):void 0})},v=e=>{g(),u=null,f=null,s!==null&&e&&t.restoreGridFocus(s.gridRootRef)},y=()=>v(!0),b=t.createPopoverWindowBindings({onResize:_,onScroll:()=>{if(f){y();return}_()},isInside:e=>l.current?.contains(e)===!0||u?.contains(e)===!0,onOutsidePointerDown:e=>v(s!==null&&t.isInsideGridRoot(s.gridRootRef,e)),onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),y();return}let n=l.current;if(!n||t.handleMenuKeyNavigation(n,e,r))return;let i=document.activeElement;e.key===`Tab`&&i instanceof HTMLElement&&i.matches(r)&&n.contains(i)&&(e.preventDefault(),y())}}),x=e=>{c.setSnapshot({...c.getSnapshot(),columnKey:e}),_(),m!==null&&cancelAnimationFrame(m),m=requestAnimationFrame(()=>{m=null,_(),d&&(d=!1,l.current?.querySelector(r)?.focus())}),b.attach()},S=(e,n,r=!1)=>{t.blurForPopover(s?.gridRootRef.current??null),u=n,f=null,d=r,x(e.key)};return{update:e=>{s=e},subscribe:c.subscribe,getSnapshot:c.getSnapshot,panelRef:l,openFromButton:(e,t)=>{if(t.preventDefault(),t.stopPropagation(),!s?.enableColumnMenu||t.button!==0)return;let n=t.currentTarget;if(c.getSnapshot().columnKey===e.key&&u===n){y();return}if(t.pointerType===`touch`){p=n;return}S(e,n)},openFromButtonClick:(e,t)=>{let n=p;p=null;let r=n===null&&t.detail===0;!s?.enableColumnMenu||n!==t.currentTarget&&!r||(t.preventDefault(),t.stopPropagation(),S(e,t.currentTarget,r))},openFromContextMenu:(e,n)=>{s?.enableColumnMenu&&(n.preventDefault(),n.stopPropagation(),t.blurForPopover(s.gridRootRef.current),u=null,f={x:n.clientX,y:n.clientY},d=!1,x(e.key))},openFromKeyboard:(e,t)=>{s?.enableColumnMenu&&S(e,t,!0)},close:y,dispose:()=>{m!==null&&(cancelAnimationFrame(m),m=null),b.detach()}}};exports.createColumnMenuController=s;
|
|
@@ -24,6 +24,7 @@ export type MenuButtonPointerEvent = {
|
|
|
24
24
|
};
|
|
25
25
|
export type MenuButtonClickEvent = {
|
|
26
26
|
currentTarget: HTMLButtonElement;
|
|
27
|
+
detail: number;
|
|
27
28
|
preventDefault: () => void;
|
|
28
29
|
stopPropagation: () => void;
|
|
29
30
|
};
|
|
@@ -43,6 +44,7 @@ export type ColumnMenuController<T> = {
|
|
|
43
44
|
openFromButton: (column: GridColumn<T>, event: MenuButtonPointerEvent) => void;
|
|
44
45
|
openFromButtonClick: (column: GridColumn<T>, event: MenuButtonClickEvent) => void;
|
|
45
46
|
openFromContextMenu: (column: GridColumn<T>, event: MenuContextEvent) => void;
|
|
47
|
+
openFromKeyboard: (column: GridColumn<T>, anchor: HTMLElement) => void;
|
|
46
48
|
close: () => void;
|
|
47
49
|
dispose: () => void;
|
|
48
50
|
};
|
|
@@ -1,110 +1,122 @@
|
|
|
1
1
|
import { createValueStore as e } from "../logic/valueStore.js";
|
|
2
|
-
import { blurForPopover as t, createPopoverWindowBindings as n,
|
|
2
|
+
import { blurForPopover as t, createPopoverWindowBindings as n, handleMenuKeyNavigation as r, isInsideGridRoot as i, restoreGridFocus as a } from "./popoverSupport.js";
|
|
3
3
|
//#region src/controllers/columnMenuController.ts
|
|
4
|
-
var
|
|
5
|
-
let
|
|
4
|
+
var o = 200, s = ".ssg-menu-item", c = 8, l = 6, u = 289, d = () => {
|
|
5
|
+
let d = null, f = e({
|
|
6
6
|
columnKey: null,
|
|
7
7
|
layout: null
|
|
8
|
-
}),
|
|
9
|
-
let t =
|
|
10
|
-
n === e || n !== null && e !== null && n.top === e.top && n.left === e.left && n.width === e.width && n.maxHeight === e.maxHeight ||
|
|
8
|
+
}), p = { current: null }, m = null, h = !1, g = null, _ = null, v = null, y = (e) => {
|
|
9
|
+
let t = f.getSnapshot(), n = t.layout;
|
|
10
|
+
n === e || n !== null && e !== null && n.top === e.top && n.left === e.left && n.width === e.width && n.maxHeight === e.maxHeight || f.setSnapshot({
|
|
11
11
|
...t,
|
|
12
12
|
layout: e
|
|
13
13
|
});
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, b = () => {
|
|
15
|
+
v !== null && (cancelAnimationFrame(v), v = null), w.detach(), f.setSnapshot({
|
|
16
16
|
columnKey: null,
|
|
17
17
|
layout: null
|
|
18
18
|
});
|
|
19
|
-
},
|
|
20
|
-
if (
|
|
21
|
-
|
|
19
|
+
}, x = () => {
|
|
20
|
+
if (f.getSnapshot().columnKey === null) {
|
|
21
|
+
y(null);
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
let e, t, n, r =
|
|
25
|
-
if (
|
|
26
|
-
if (!
|
|
27
|
-
|
|
24
|
+
let e, t, n, r = p.current, i = r ? r.scrollHeight + (r.offsetHeight - r.clientHeight) : u;
|
|
25
|
+
if (m) {
|
|
26
|
+
if (!m.isConnected) {
|
|
27
|
+
m = null, b();
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
let r =
|
|
31
|
-
t = r.right -
|
|
32
|
-
} else if (
|
|
30
|
+
let r = m.getBoundingClientRect();
|
|
31
|
+
t = r.right - o, e = r.bottom + l, n = r.top - i - l;
|
|
32
|
+
} else if (g) t = g.x, e = g.y, n = g.y - i;
|
|
33
33
|
else {
|
|
34
|
-
|
|
34
|
+
y(null);
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
t = Math.max(
|
|
38
|
-
let
|
|
39
|
-
e + i >
|
|
40
|
-
let
|
|
41
|
-
|
|
37
|
+
t = Math.max(c, t), t = Math.min(t, window.innerWidth - o - c);
|
|
38
|
+
let a = window.innerHeight - c;
|
|
39
|
+
e + i > a && n >= c && (e = n), e = Math.max(c, e);
|
|
40
|
+
let s = a - e;
|
|
41
|
+
y({
|
|
42
42
|
top: e,
|
|
43
43
|
left: t,
|
|
44
|
-
width:
|
|
45
|
-
maxHeight: i >
|
|
44
|
+
width: o,
|
|
45
|
+
maxHeight: i > s ? Math.max(s, 0) : void 0
|
|
46
46
|
});
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
onResize:
|
|
47
|
+
}, S = (e) => {
|
|
48
|
+
b(), m = null, g = null, d !== null && e && a(d.gridRootRef);
|
|
49
|
+
}, C = () => S(!0), w = n({
|
|
50
|
+
onResize: x,
|
|
51
51
|
onScroll: () => {
|
|
52
|
-
if (
|
|
53
|
-
|
|
52
|
+
if (g) {
|
|
53
|
+
C();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
x();
|
|
57
57
|
},
|
|
58
|
-
isInside: (e) =>
|
|
59
|
-
onOutsidePointerDown: (e) =>
|
|
58
|
+
isInside: (e) => p.current?.contains(e) === !0 || m?.contains(e) === !0,
|
|
59
|
+
onOutsidePointerDown: (e) => S(d !== null && i(d.gridRootRef, e)),
|
|
60
60
|
onKeyDown: (e) => {
|
|
61
|
-
e.key === "Escape"
|
|
61
|
+
if (e.key === "Escape") {
|
|
62
|
+
e.preventDefault(), C();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
let t = p.current;
|
|
66
|
+
if (!t || r(t, e, s)) return;
|
|
67
|
+
let n = document.activeElement;
|
|
68
|
+
e.key === "Tab" && n instanceof HTMLElement && n.matches(s) && t.contains(n) && (e.preventDefault(), C());
|
|
62
69
|
}
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
...
|
|
70
|
+
}), T = (e) => {
|
|
71
|
+
f.setSnapshot({
|
|
72
|
+
...f.getSnapshot(),
|
|
66
73
|
columnKey: e
|
|
67
|
-
}),
|
|
68
|
-
|
|
69
|
-
}),
|
|
70
|
-
},
|
|
71
|
-
t(
|
|
74
|
+
}), x(), v !== null && cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
75
|
+
v = null, x(), h && (h = !1, p.current?.querySelector(s)?.focus());
|
|
76
|
+
}), w.attach();
|
|
77
|
+
}, E = (e, n, r = !1) => {
|
|
78
|
+
t(d?.gridRootRef.current ?? null), m = n, g = null, h = r, T(e.key);
|
|
72
79
|
};
|
|
73
80
|
return {
|
|
74
81
|
update: (e) => {
|
|
75
|
-
|
|
82
|
+
d = e;
|
|
76
83
|
},
|
|
77
|
-
subscribe:
|
|
78
|
-
getSnapshot:
|
|
79
|
-
panelRef:
|
|
84
|
+
subscribe: f.subscribe,
|
|
85
|
+
getSnapshot: f.getSnapshot,
|
|
86
|
+
panelRef: p,
|
|
80
87
|
openFromButton: (e, t) => {
|
|
81
|
-
if (t.preventDefault(), t.stopPropagation(), !
|
|
88
|
+
if (t.preventDefault(), t.stopPropagation(), !d?.enableColumnMenu || t.button !== 0) return;
|
|
82
89
|
let n = t.currentTarget;
|
|
83
|
-
if (
|
|
84
|
-
|
|
90
|
+
if (f.getSnapshot().columnKey === e.key && m === n) {
|
|
91
|
+
C();
|
|
85
92
|
return;
|
|
86
93
|
}
|
|
87
94
|
if (t.pointerType === "touch") {
|
|
88
|
-
|
|
95
|
+
_ = n;
|
|
89
96
|
return;
|
|
90
97
|
}
|
|
91
|
-
|
|
98
|
+
E(e, n);
|
|
92
99
|
},
|
|
93
100
|
openFromButtonClick: (e, t) => {
|
|
94
|
-
let n =
|
|
95
|
-
|
|
101
|
+
let n = _;
|
|
102
|
+
_ = null;
|
|
103
|
+
let r = n === null && t.detail === 0;
|
|
104
|
+
!d?.enableColumnMenu || n !== t.currentTarget && !r || (t.preventDefault(), t.stopPropagation(), E(e, t.currentTarget, r));
|
|
96
105
|
},
|
|
97
106
|
openFromContextMenu: (e, n) => {
|
|
98
|
-
|
|
107
|
+
d?.enableColumnMenu && (n.preventDefault(), n.stopPropagation(), t(d.gridRootRef.current), m = null, g = {
|
|
99
108
|
x: n.clientX,
|
|
100
109
|
y: n.clientY
|
|
101
|
-
},
|
|
110
|
+
}, h = !1, T(e.key));
|
|
111
|
+
},
|
|
112
|
+
openFromKeyboard: (e, t) => {
|
|
113
|
+
d?.enableColumnMenu && E(e, t, !0);
|
|
102
114
|
},
|
|
103
|
-
close:
|
|
115
|
+
close: C,
|
|
104
116
|
dispose: () => {
|
|
105
|
-
|
|
117
|
+
v !== null && (cancelAnimationFrame(v), v = null), w.detach();
|
|
106
118
|
}
|
|
107
119
|
};
|
|
108
120
|
};
|
|
109
121
|
//#endregion
|
|
110
|
-
export {
|
|
122
|
+
export { d as createColumnMenuController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/valueStore.cjs"),t=require("./popoverSupport.cjs");var n=220,r=8,i=34,a=16,o=()=>{let o=null,s=e.createValueStore({state:null,layout:null}),c={current:null},l=null,u=0,d=e=>{let t=s.getSnapshot();t.layout===e||t.layout!==null&&e!==null&&t.layout.top===e.top&&t.layout.left===e.left&&t.layout.width===e.width||s.setSnapshot({...t,layout:e})},f=()=>{if(!l){d(null);return}let e=u*i+a,t=l.x,o=l.y,s=l.y-e;t=Math.max(r,t),t=Math.min(t,window.innerWidth-n-r),o+e>window.innerHeight-r&&(o=s),o=Math.max(r,o),d({top:o,left:t,width:n})},p=e=>{s.setSnapshot({state:null,layout:null}),l=null,u=0,h.detach(),o!==null&&e&&t.restoreGridFocus(o.gridRootRef)},m=()=>p(!0),h=t.createPopoverWindowBindings({onResize:f,onScroll:m,isInside:e=>c.current?.contains(e)===!0,onOutsidePointerDown:e=>p(o!==null&&t.isInsideGridRoot(o.gridRootRef,e)),onKeyDown:e=>{e.key===`Escape
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/valueStore.cjs"),t=require("./popoverSupport.cjs");var n=220,r=8,i=34,a=16,o=()=>{let o=null,s=e.createValueStore({state:null,layout:null}),c={current:null},l=null,u=0,d=e=>{let t=s.getSnapshot();t.layout===e||t.layout!==null&&e!==null&&t.layout.top===e.top&&t.layout.left===e.left&&t.layout.width===e.width||s.setSnapshot({...t,layout:e})},f=()=>{if(!l){d(null);return}let e=u*i+a,t=l.x,o=l.y,s=l.y-e;t=Math.max(r,t),t=Math.min(t,window.innerWidth-n-r),o+e>window.innerHeight-r&&(o=s),o=Math.max(r,o),d({top:o,left:t,width:n})},p=e=>{s.setSnapshot({state:null,layout:null}),l=null,u=0,h.detach(),o!==null&&e&&t.restoreGridFocus(o.gridRootRef)},m=()=>p(!0),h=t.createPopoverWindowBindings({onResize:f,onScroll:m,isInside:e=>c.current?.contains(e)===!0,onOutsidePointerDown:e=>p(o!==null&&t.isInsideGridRoot(o.gridRootRef,e)),onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),m();return}let n=c.current;if(!(!n||t.handleMenuKeyNavigation(n,e))&&e.key===`Tab`){let t=document.activeElement;(!(t instanceof HTMLElement&&n.contains(t))||t.getAttribute(`role`)===`menuitem`)&&(e.preventDefault(),m())}}});return{update:e=>{o=e},subscribe:s.subscribe,getSnapshot:s.getSnapshot,panelRef:c,open:(e,n)=>{t.blurForPopover(o?.gridRootRef.current??null),l={x:e.clientX,y:e.clientY},u=n.length,s.setSnapshot({...s.getSnapshot(),state:{params:e,items:n}}),f(),h.attach()},close:m,dispose:()=>{h.detach()}}};exports.createContextMenuController=o;
|