@ishibashi0112/spreadsheet-grid-core 1.0.1 → 1.1.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.js +4 -2
- package/dist/controllers/clipboardController.cjs +1 -2
- package/dist/controllers/clipboardController.d.ts +3 -0
- package/dist/controllers/clipboardController.js +78 -59
- package/dist/controllers/columnAutosizeRunner.cjs +1 -1
- package/dist/controllers/columnAutosizeRunner.d.ts +3 -1
- package/dist/controllers/columnAutosizeRunner.js +12 -10
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +146 -140
- package/dist/controllers/columnMenuController.cjs +1 -1
- package/dist/controllers/columnMenuController.js +71 -69
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.d.ts +4 -1
- package/dist/controllers/contextMenuController.js +55 -38
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.js +78 -78
- package/dist/controllers/escapeClaimController.cjs +1 -1
- package/dist/controllers/escapeClaimController.d.ts +1 -0
- package/dist/controllers/escapeClaimController.js +11 -5
- package/dist/controllers/fillHandleController.cjs +1 -1
- package/dist/controllers/fillHandleController.d.ts +1 -0
- package/dist/controllers/fillHandleController.js +148 -147
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.js +81 -77
- package/dist/controllers/findController.cjs +1 -1
- package/dist/controllers/findController.d.ts +1 -0
- package/dist/controllers/findController.js +36 -29
- package/dist/controllers/historyController.cjs +1 -1
- package/dist/controllers/historyController.d.ts +6 -0
- package/dist/controllers/historyController.js +79 -37
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +1 -0
- package/dist/controllers/keyboardController.js +116 -116
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +142 -142
- package/dist/controllers/popoverSupport.cjs +1 -1
- package/dist/controllers/popoverSupport.d.ts +1 -0
- package/dist/controllers/popoverSupport.js +17 -7
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +1 -0
- package/dist/controllers/rowDragController.js +151 -149
- package/dist/controllers/rowEnterController.cjs +1 -1
- package/dist/controllers/rowEnterController.d.ts +1 -0
- package/dist/controllers/rowEnterController.js +47 -42
- package/dist/controllers/toolPanelController.cjs +1 -1
- package/dist/controllers/toolPanelController.js +26 -14
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +85 -66
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +4 -1
- package/dist/controllers/viewportSyncController.js +89 -30
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.js +16 -9
- package/dist/engine/filterPopoverCommands.cjs +1 -1
- package/dist/engine/filterPopoverCommands.d.ts +2 -0
- package/dist/engine/filterPopoverCommands.js +15 -15
- package/dist/engine/fullFeatures.cjs +1 -1
- package/dist/engine/fullFeatures.js +17 -17
- package/dist/engine/gridApi.cjs +3 -3
- package/dist/engine/gridApi.d.ts +7 -2
- package/dist/engine/gridApi.js +16 -16
- package/dist/engine/rowSelectionCommands.cjs +1 -1
- package/dist/engine/rowSelectionCommands.d.ts +1 -0
- package/dist/engine/rowSelectionCommands.js +21 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -6
- package/dist/locales/en.cjs +1 -1
- package/dist/locales/en.js +10 -4
- package/dist/logic/autoScrollGeometry.cjs +1 -1
- package/dist/logic/autoScrollGeometry.d.ts +2 -0
- package/dist/logic/autoScrollGeometry.js +3 -3
- package/dist/logic/columnAutosize.cjs +1 -1
- package/dist/logic/columnAutosize.d.ts +8 -2
- package/dist/logic/columnAutosize.js +102 -87
- package/dist/logic/detailRow.cjs +1 -1
- package/dist/logic/detailRow.d.ts +4 -0
- package/dist/logic/detailRow.js +18 -15
- package/dist/logic/editorValues.cjs +1 -1
- package/dist/logic/editorValues.d.ts +1 -0
- package/dist/logic/editorValues.js +37 -34
- package/dist/logic/exportCsv.cjs +3 -3
- package/dist/logic/exportCsv.d.ts +3 -1
- package/dist/logic/exportCsv.js +22 -20
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +3 -1
- package/dist/logic/exportData.js +40 -36
- package/dist/logic/filterSummary.cjs +1 -1
- package/dist/logic/filterSummary.js +9 -2
- package/dist/logic/filtering.cjs +1 -1
- package/dist/logic/filtering.d.ts +2 -1
- package/dist/logic/filtering.js +16 -3
- package/dist/logic/find.cjs +1 -1
- package/dist/logic/find.d.ts +4 -3
- package/dist/logic/find.js +27 -13
- package/dist/logic/gridAsk.cjs +2 -2
- package/dist/logic/gridAsk.d.ts +7 -7
- package/dist/logic/gridAsk.js +140 -122
- package/dist/logic/gridAskLocaleText.cjs +1 -1
- package/dist/logic/gridAskLocaleText.d.ts +2 -0
- package/dist/logic/gridAskLocaleText.js +1 -0
- package/dist/logic/gridState.d.ts +2 -2
- package/dist/logic/groupExport.cjs +1 -1
- package/dist/logic/groupExport.js +28 -27
- package/dist/logic/grouping.cjs +1 -1
- package/dist/logic/grouping.d.ts +1 -0
- package/dist/logic/grouping.js +52 -41
- package/dist/logic/historyRebase.cjs +1 -0
- package/dist/logic/historyRebase.d.ts +5 -0
- package/dist/logic/historyRebase.js +36 -0
- package/dist/logic/localeText.cjs +1 -1
- package/dist/logic/localeText.d.ts +2 -0
- package/dist/logic/localeText.js +1 -0
- package/dist/logic/localeTextFeatures.cjs +1 -1
- package/dist/logic/localeTextFeatures.d.ts +4 -0
- package/dist/logic/localeTextFeatures.js +10 -7
- package/dist/logic/localeTextFilters.cjs +1 -1
- package/dist/logic/localeTextFilters.d.ts +1 -0
- package/dist/logic/localeTextFilters.js +1 -0
- package/dist/logic/localeTextPopups.cjs +1 -1
- package/dist/logic/localeTextPopups.d.ts +1 -0
- package/dist/logic/localeTextPopups.js +3 -2
- package/dist/logic/numberFilterCondition.cjs +1 -1
- package/dist/logic/numberFilterCondition.d.ts +1 -1
- package/dist/logic/numberFilterCondition.js +5 -5
- package/dist/logic/scrollTargets.cjs +1 -1
- package/dist/logic/scrollTargets.js +2 -2
- package/dist/logic/selectEditorState.cjs +1 -1
- package/dist/logic/selectEditorState.d.ts +1 -0
- package/dist/logic/selectEditorState.js +8 -1
- package/dist/logic/selectLabels.cjs +1 -0
- package/dist/logic/selectLabels.d.ts +3 -0
- package/dist/logic/selectLabels.js +41 -0
- package/dist/logic/valueFormatters.d.ts +5 -5
- package/dist/logic/valueParsers.cjs +1 -0
- package/dist/logic/valueParsers.d.ts +14 -0
- package/dist/logic/valueParsers.js +23 -0
- package/dist/logic/verticalGeometry.cjs +1 -1
- package/dist/logic/verticalGeometry.d.ts +1 -0
- package/dist/logic/verticalGeometry.js +12 -8
- package/dist/model/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +2 -1
- package/dist/model/gridActions.js +3 -2
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +145 -62
- package/dist/model/gridTypes.core.d.ts +492 -315
- package/dist/utils/clipboard.cjs +4 -6
- package/dist/utils/clipboard.d.ts +15 -2
- package/dist/utils/clipboard.js +103 -48
- package/dist/utils/popupContainer.cjs +1 -0
- package/dist/utils/popupContainer.d.ts +8 -0
- package/dist/utils/popupContainer.js +60 -0
- package/package.json +1 -1
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { resolveMoveTargetIndex as e, resolveRowDropSlot as t, resolveRowDropSlotTop as n } from "../logic/rowReorder.js";
|
|
2
2
|
import { isInsideDetailCardOf as r } from "../logic/detailRow.js";
|
|
3
|
-
import { clampClientYAboveFooter as i,
|
|
4
|
-
import { resolveElementScale as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { clampClientYAboveFooter as i, clampClientYBelowHeader as a, computeNextScrollPosition as o, hasPointerLeftActivationRadius as s, resolveAutoScrollAxisDirection as c, resolveScrollContentBox as l, resolveTopAutoScrollStart as u } from "../logic/autoScrollGeometry.js";
|
|
4
|
+
import { resolveElementScale as d } from "../logic/elementScale.js";
|
|
5
|
+
import { beginEscapeCancelableDrag as f } from "./escapeClaimController.js";
|
|
6
|
+
import { applySlotToElement as p } from "../logic/slotDom.js";
|
|
7
|
+
import { syncPortalTokens as m } from "../utils/portalTokens.js";
|
|
8
|
+
import { appendToPopupContainer as h, getPopupContainerFor as g } from "../utils/popupContainer.js";
|
|
7
9
|
//#region src/controllers/rowDragController.ts
|
|
8
|
-
var
|
|
10
|
+
var _ = 14, v = 12, y = "0.5", b = "<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>", ee = "<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>", x = 200, S = "cubic-bezier(0.2, 0.7, 0.3, 1)", C = `transform 160ms ${S}`, w = "data-ssg-row-dragging", T = (e) => e?.closest(".ssg-motion-off") != null, E = /translateY\((-?[\d.]+)px\)/, D = (e) => {
|
|
9
11
|
let t = [];
|
|
10
12
|
return e.querySelectorAll(".ssg-body-row[data-row-index]").forEach((n) => {
|
|
11
13
|
r(e, n) || t.push(n);
|
|
12
14
|
}), t;
|
|
13
|
-
},
|
|
15
|
+
}, O = (e) => {
|
|
14
16
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
15
17
|
return e.querySelectorAll(".ssg-detail-band[data-detail-row-index]").forEach((i) => {
|
|
16
18
|
if (r(e, i)) return;
|
|
@@ -21,22 +23,22 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
21
23
|
key: `band|${o}|${a}`
|
|
22
24
|
});
|
|
23
25
|
}), t;
|
|
24
|
-
},
|
|
26
|
+
}, k = (e) => {
|
|
25
27
|
e.style.transition = "", e.style.transform = "", e.style.willChange = "", e.style.zIndex = "";
|
|
26
|
-
},
|
|
27
|
-
let
|
|
28
|
+
}, A = () => {
|
|
29
|
+
let A = null, j = null, M = null, N = {
|
|
28
30
|
x: 0,
|
|
29
31
|
y: 0
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
],
|
|
35
|
-
for (let e of
|
|
36
|
-
},
|
|
37
|
-
if (
|
|
32
|
+
}, P = null, F = !1, I = null, L = null, R = null, z = null, B = null, V = null, H = 0, U = null, W = () => A?.motion === "live", G = null, K = null, q = null, J = () => [
|
|
33
|
+
A?.leftIndicatorRef.current ?? null,
|
|
34
|
+
A?.centerIndicatorRef.current ?? null,
|
|
35
|
+
A?.rightIndicatorRef.current ?? null
|
|
36
|
+
], Y = () => {
|
|
37
|
+
for (let e of J()) e && (e.style.display = "none");
|
|
38
|
+
}, te = (e) => {
|
|
39
|
+
if (G) return;
|
|
38
40
|
let t = document.createElement("div");
|
|
39
|
-
t.setAttribute("data-grid-drag-ghost", ""),
|
|
41
|
+
t.setAttribute("data-grid-drag-ghost", ""), A?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), A?.scrollContainerRef.current?.closest(".ssg-theme-class") != null && t.classList.add("ssg-theme-class"), A?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
|
|
40
42
|
"position:fixed",
|
|
41
43
|
"top:0",
|
|
42
44
|
"left:0",
|
|
@@ -61,53 +63,53 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
61
63
|
"z-index:9999",
|
|
62
64
|
"will-change:transform",
|
|
63
65
|
"transform:translate(-9999px,-9999px)"
|
|
64
|
-
].join(";"),
|
|
66
|
+
].join(";"), p(t, A?.ghostSlot);
|
|
65
67
|
let n = document.createElement("span");
|
|
66
68
|
n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
|
|
67
69
|
let r = document.createElement("span");
|
|
68
|
-
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r),
|
|
69
|
-
},
|
|
70
|
-
let t =
|
|
70
|
+
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), h(t, g(A?.scrollContainerRef.current)), m(A?.scrollContainerRef.current, t), G = t, K = n, q = null;
|
|
71
|
+
}, ne = (e) => {
|
|
72
|
+
let t = G;
|
|
71
73
|
if (!t) return;
|
|
72
|
-
t.style.transform = "translate(" + (
|
|
74
|
+
t.style.transform = "translate(" + (N.x + _) + "px," + (N.y + v) + "px)";
|
|
73
75
|
let n = e ? "move" : "out";
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
let r =
|
|
77
|
-
n === "out" ? (t.style.opacity =
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
let n =
|
|
82
|
-
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${
|
|
83
|
-
r(n, e) || (t ? e.setAttribute(
|
|
76
|
+
if (q === n) return;
|
|
77
|
+
q = n;
|
|
78
|
+
let r = K;
|
|
79
|
+
n === "out" ? (t.style.opacity = y, r && (r.innerHTML = ee)) : (t.style.opacity = "1", r && (r.innerHTML = b));
|
|
80
|
+
}, X = () => {
|
|
81
|
+
G && G.parentNode && G.parentNode.removeChild(G), G = null, K = null, q = null;
|
|
82
|
+
}, Z = (e, t) => {
|
|
83
|
+
let n = A?.scrollContainerRef.current ?? null;
|
|
84
|
+
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${w}]`).forEach((e) => {
|
|
85
|
+
r(n, e) || (t ? e.setAttribute(w, W() ? "live" : "") : e.removeAttribute(w));
|
|
84
86
|
});
|
|
85
|
-
},
|
|
86
|
-
let e =
|
|
87
|
+
}, re = () => {
|
|
88
|
+
let e = A?.scrollContainerRef.current ?? null;
|
|
87
89
|
if (!e) return null;
|
|
88
90
|
let t = /* @__PURE__ */ new Map();
|
|
89
|
-
for (let n of
|
|
90
|
-
let e =
|
|
91
|
+
for (let n of D(e)) {
|
|
92
|
+
let e = E.exec(n.style.transform);
|
|
91
93
|
e && t.set(n, {
|
|
92
94
|
index: Number(n.getAttribute("data-row-index")),
|
|
93
95
|
baseY: parseFloat(e[1])
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
98
|
return t;
|
|
97
|
-
},
|
|
98
|
-
let n =
|
|
99
|
-
if (!n || r === null ||
|
|
100
|
-
let i =
|
|
99
|
+
}, ie = (t) => {
|
|
100
|
+
let n = V, r = j;
|
|
101
|
+
if (!n || r === null || A === null) return;
|
|
102
|
+
let i = A.scrollContainerRef.current;
|
|
101
103
|
if (!i) return;
|
|
102
|
-
for (let e of
|
|
104
|
+
for (let e of D(i)) {
|
|
103
105
|
if (n.has(e)) continue;
|
|
104
|
-
let t =
|
|
106
|
+
let t = E.exec(e.style.transform);
|
|
105
107
|
t && n.set(e, {
|
|
106
108
|
index: Number(e.getAttribute("data-row-index")),
|
|
107
109
|
baseY: parseFloat(t[1])
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
|
-
let a =
|
|
112
|
+
let a = A.rowMetrics.rowsHeight(r, r), o = (i.scrollTop - H) * A.verticalScaleFactor, s = (P ? N.y - P.y : 0) + o, c = t === null ? null : e(r, t);
|
|
111
113
|
n.forEach((e, t) => {
|
|
112
114
|
let { index: i, baseY: o } = e;
|
|
113
115
|
if (!t.isConnected) {
|
|
@@ -119,87 +121,87 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
119
121
|
return;
|
|
120
122
|
}
|
|
121
123
|
let l = 0;
|
|
122
|
-
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition =
|
|
124
|
+
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition = C, t.style.transform = `translateY(${o + l}px)`, e.applied = t.style.transform;
|
|
123
125
|
});
|
|
124
|
-
let l =
|
|
125
|
-
|
|
126
|
-
for (let { el: e, index: t } of
|
|
126
|
+
let l = U ?? /* @__PURE__ */ new Set();
|
|
127
|
+
U = l;
|
|
128
|
+
for (let { el: e, index: t } of O(i)) {
|
|
127
129
|
if (l.add(e), t === r) {
|
|
128
130
|
e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", e.style.zIndex = "10";
|
|
129
131
|
continue;
|
|
130
132
|
}
|
|
131
133
|
let n = 0;
|
|
132
|
-
c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition =
|
|
134
|
+
c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition = C, e.style.transform = `translateY(${n}px)`, e.style.zIndex = "";
|
|
133
135
|
}
|
|
134
|
-
},
|
|
135
|
-
if (
|
|
136
|
-
let { scrollContainerRef:
|
|
137
|
-
if (!
|
|
138
|
-
let
|
|
139
|
-
if (e <
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
142
|
-
let e = t(
|
|
143
|
-
e >
|
|
136
|
+
}, ae = (e, r) => {
|
|
137
|
+
if (A === null) return null;
|
|
138
|
+
let { scrollContainerRef: o, bodyScrollRef: s, rowMetrics: c, headerHeight: l, verticalScaleFactor: u, windowBaseOffsetPx: d } = A, f = o.current, p = s.current;
|
|
139
|
+
if (!f || !p) return null;
|
|
140
|
+
let m = f.getBoundingClientRect();
|
|
141
|
+
if (e < m.left || e > m.right || r < m.top || r > m.bottom) return null;
|
|
142
|
+
let h = a(i(r, m.top + f.clientTop + f.clientHeight, A.footerHeight ?? 0), m.top + f.clientTop, A.stickyTopHeight ?? 0), g = p.getBoundingClientRect(), _ = p.scrollTop + h - g.top - l - f.scrollTop * (1 - u), v = t(_, c), y = j, b = y !== null && W() ? c.detailHeight(y) : 0;
|
|
143
|
+
if (y !== null && b > 0) {
|
|
144
|
+
let e = t(_ + b, c);
|
|
145
|
+
e > y + 1 && (v = e);
|
|
144
146
|
}
|
|
145
|
-
let
|
|
147
|
+
let ee = n(v, c);
|
|
146
148
|
return {
|
|
147
|
-
slot:
|
|
148
|
-
top:
|
|
149
|
+
slot: v,
|
|
150
|
+
top: l + ee - d
|
|
149
151
|
};
|
|
150
|
-
},
|
|
151
|
-
let t =
|
|
152
|
-
if (
|
|
153
|
-
t && n !== null && (
|
|
152
|
+
}, Q = () => {
|
|
153
|
+
let t = ae(N.x, N.y), n = j;
|
|
154
|
+
if (W()) {
|
|
155
|
+
t && n !== null && (M = e(n, t.slot) === null ? null : t.slot), Y(), ie(M);
|
|
154
156
|
return;
|
|
155
157
|
}
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
+
if (ne(t), !t || n === null || e(n, t.slot) === null) {
|
|
159
|
+
M = null, Y();
|
|
158
160
|
return;
|
|
159
161
|
}
|
|
160
|
-
|
|
161
|
-
for (let e of
|
|
162
|
-
},
|
|
163
|
-
if (
|
|
164
|
-
|
|
162
|
+
M = t.slot;
|
|
163
|
+
for (let e of J()) e && (e.style.top = `${t.top}px`, e.style.display = "block");
|
|
164
|
+
}, oe = () => {
|
|
165
|
+
if (j === null) {
|
|
166
|
+
R = null;
|
|
165
167
|
return;
|
|
166
168
|
}
|
|
167
|
-
let e =
|
|
168
|
-
if (e && (
|
|
169
|
-
let t = e.getBoundingClientRect(), n =
|
|
169
|
+
let e = A?.scrollContainerRef.current ?? null;
|
|
170
|
+
if (e && (F || (!P || s(P, N, 6)) && (F = !0), F)) {
|
|
171
|
+
let t = e.getBoundingClientRect(), n = d(e, t), r = l({
|
|
170
172
|
rectLeft: t.left,
|
|
171
173
|
rectTop: t.top,
|
|
172
174
|
clientLeft: e.clientLeft,
|
|
173
175
|
clientTop: e.clientTop,
|
|
174
176
|
clientWidth: e.clientWidth,
|
|
175
177
|
clientHeight: e.clientHeight,
|
|
176
|
-
scale:
|
|
177
|
-
}),
|
|
178
|
-
|
|
179
|
-
top:
|
|
178
|
+
scale: n
|
|
179
|
+
}), i = c(N.y, u(r.top, (A?.stickyTopHeight ?? 0) * n.y, 24), r.bottom - (A?.footerHeight ?? 0), 24), a = o(e.scrollTop, i, 18, e.scrollHeight - e.clientHeight);
|
|
180
|
+
a !== e.scrollTop && e.scrollTo({
|
|
181
|
+
top: a,
|
|
180
182
|
behavior: "auto"
|
|
181
183
|
});
|
|
182
184
|
}
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
let e =
|
|
185
|
+
Q(), R = requestAnimationFrame(oe);
|
|
186
|
+
}, se = (e, t) => `${e.getAttribute("data-pane") ?? ""}|${t}`, ce = () => {
|
|
187
|
+
let e = A?.scrollContainerRef.current ?? null;
|
|
186
188
|
if (!e) return null;
|
|
187
189
|
let t = /* @__PURE__ */ new Map();
|
|
188
|
-
for (let n of
|
|
189
|
-
for (let n of
|
|
190
|
+
for (let n of D(e)) t.set(se(n, Number(n.getAttribute("data-row-index"))), n.getBoundingClientRect().top);
|
|
191
|
+
for (let n of O(e)) t.set(n.key, n.el.getBoundingClientRect().top);
|
|
190
192
|
return t;
|
|
191
193
|
}, $ = (t) => {
|
|
192
|
-
|
|
193
|
-
let n =
|
|
194
|
-
|
|
195
|
-
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null &&
|
|
196
|
-
|
|
197
|
-
let c = s && o &&
|
|
198
|
-
if (
|
|
199
|
-
e.isConnected && (e.style.transition =
|
|
194
|
+
R !== null && (cancelAnimationFrame(R), R = null), document.body.style.cursor = "", Y(), X();
|
|
195
|
+
let n = j, r = M, i = B;
|
|
196
|
+
Z(n, !1), j = null, B = null, M = null, P = null, L = null;
|
|
197
|
+
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null && A !== null, s = V;
|
|
198
|
+
V = null;
|
|
199
|
+
let c = s && o && A !== null && !T(A.scrollContainerRef.current) ? ce() : null, l = U;
|
|
200
|
+
if (U = null, l && (o ? l.forEach(k) : (l.forEach((e) => {
|
|
201
|
+
e.isConnected && (e.style.transition = C, e.style.transform = "translateY(0px)", e.style.zIndex = "");
|
|
200
202
|
}), window.setTimeout(() => {
|
|
201
203
|
l.forEach((e) => {
|
|
202
|
-
|
|
204
|
+
U?.has(e) || k(e);
|
|
203
205
|
});
|
|
204
206
|
}, 200))), s) if (o) s.forEach(({ baseY: e }, t) => {
|
|
205
207
|
t.style.transition = "", t.style.willChange = "", t.isConnected && (t.style.transform = `translateY(${e}px)`);
|
|
@@ -207,131 +209,131 @@ var f = 14, p = 12, m = "0.5", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
207
209
|
else {
|
|
208
210
|
let e = [];
|
|
209
211
|
s.forEach(({ baseY: t }, n) => {
|
|
210
|
-
n.isConnected && (n.style.transition =
|
|
212
|
+
n.isConnected && (n.style.transition = C, n.style.transform = `translateY(${t}px)`, e.push(n));
|
|
211
213
|
}), window.setTimeout(() => {
|
|
212
214
|
for (let t of e) t.style.transition = "", t.style.willChange = "";
|
|
213
215
|
}, 200);
|
|
214
216
|
}
|
|
215
|
-
if (!o || n === null || a === null ||
|
|
216
|
-
let u = c ?? (
|
|
217
|
+
if (!o || n === null || a === null || A === null) return;
|
|
218
|
+
let u = c ?? (T(A.scrollContainerRef.current) ? null : ce()), d = u ? {
|
|
217
219
|
tops: u,
|
|
218
220
|
from: n,
|
|
219
221
|
to: a,
|
|
220
222
|
row: i
|
|
221
223
|
} : null;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
+
z = d, A.commitRowMove(n, a), d && requestAnimationFrame(() => {
|
|
225
|
+
z === d && (z = null);
|
|
224
226
|
});
|
|
225
|
-
},
|
|
226
|
-
let e =
|
|
227
|
-
if (
|
|
228
|
-
let t =
|
|
227
|
+
}, le = () => {
|
|
228
|
+
let e = z;
|
|
229
|
+
if (z = null, !e) return;
|
|
230
|
+
let t = A?.scrollContainerRef.current ?? null;
|
|
229
231
|
if (!t) return;
|
|
230
232
|
let { tops: n, from: r, to: i } = e;
|
|
231
|
-
if (
|
|
233
|
+
if (A?.locateDragRow && e.row !== null && A.locateDragRow(e.row, i) !== i) return;
|
|
232
234
|
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();
|
|
233
|
-
|
|
234
|
-
let t = n.get(
|
|
235
|
+
D(t).forEach((e) => {
|
|
236
|
+
let t = n.get(se(e, a(Number(e.getAttribute("data-row-index")))));
|
|
235
237
|
if (t === void 0) return;
|
|
236
238
|
let r = t - e.getBoundingClientRect().top;
|
|
237
239
|
if (Math.abs(r) < .5) return;
|
|
238
|
-
let i =
|
|
240
|
+
let i = E.exec(e.style.transform);
|
|
239
241
|
if (!i) return;
|
|
240
242
|
let c = parseFloat(i[1]);
|
|
241
243
|
s.set(e, c), e.style.transition = "none", e.style.transform = `translateY(${c + r}px)`, e.style.willChange = "transform", o.push(e);
|
|
242
244
|
});
|
|
243
245
|
let c = [];
|
|
244
|
-
if (
|
|
246
|
+
if (O(t).forEach(({ el: e, index: t, key: r }) => {
|
|
245
247
|
let i = a(t), o = n.get(r.slice(0, r.lastIndexOf("|") + 1) + i);
|
|
246
248
|
if (o === void 0) return;
|
|
247
249
|
let s = o - e.getBoundingClientRect().top;
|
|
248
250
|
Math.abs(s) < .5 || (e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", c.push(e));
|
|
249
251
|
}), !(o.length === 0 && c.length === 0)) {
|
|
250
252
|
t.getBoundingClientRect();
|
|
251
|
-
for (let e of o) e.style.transition = `transform ${
|
|
252
|
-
for (let e of c) e.style.transition = `transform ${
|
|
253
|
+
for (let e of o) e.style.transition = `transform ${x}ms ${S}`, e.style.transform = `translateY(${s.get(e) ?? 0}px)`;
|
|
254
|
+
for (let e of c) e.style.transition = `transform ${x}ms ${S}`, e.style.transform = "translateY(0px)";
|
|
253
255
|
window.setTimeout(() => {
|
|
254
256
|
for (let e of o) e.style.transition = "", e.style.willChange = "";
|
|
255
|
-
for (let e of c)
|
|
257
|
+
for (let e of c) U?.has(e) || k(e);
|
|
256
258
|
}, 280);
|
|
257
259
|
}
|
|
258
|
-
},
|
|
259
|
-
if (
|
|
260
|
-
if (t.stopPropagation(), t.preventDefault(),
|
|
261
|
-
if (t.pointerId !==
|
|
262
|
-
|
|
260
|
+
}, ue = (e, t) => {
|
|
261
|
+
if (A === null || !A.enabled || t.button !== 0) return;
|
|
262
|
+
if (t.stopPropagation(), t.preventDefault(), A.gridRootRef?.current?.focus({ preventScroll: !0 }), j !== null) {
|
|
263
|
+
if (t.pointerId !== L) return;
|
|
264
|
+
I?.(), $(!1);
|
|
263
265
|
}
|
|
264
|
-
|
|
266
|
+
j = e, B = A.getDragRow?.(e) ?? null, L = t.pointerId, M = null, N = {
|
|
265
267
|
x: t.clientX,
|
|
266
268
|
y: t.clientY
|
|
267
|
-
},
|
|
269
|
+
}, P = {
|
|
268
270
|
x: t.clientX,
|
|
269
271
|
y: t.clientY
|
|
270
|
-
},
|
|
272
|
+
}, F = !1, document.body.style.cursor = "grabbing", W() ? (V = re(), H = A.scrollContainerRef.current?.scrollTop ?? 0) : te(A.getRowDragLabel(e)), Z(e, !0);
|
|
271
273
|
let n = t.currentTarget, r = t.pointerId;
|
|
272
274
|
try {
|
|
273
275
|
n.setPointerCapture(r);
|
|
274
276
|
} catch {}
|
|
275
277
|
let i = (e) => {
|
|
276
|
-
e.pointerId === r && (
|
|
278
|
+
e.pointerId === r && (N = {
|
|
277
279
|
x: e.clientX,
|
|
278
280
|
y: e.clientY
|
|
279
|
-
},
|
|
280
|
-
}, a = () => {
|
|
281
|
-
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup",
|
|
281
|
+
}, Q());
|
|
282
|
+
}, a = f(), o = () => {
|
|
283
|
+
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", s), window.removeEventListener("pointercancel", c), window.removeEventListener("keydown", l, !0), window.removeEventListener("blur", u), a(), I = null;
|
|
282
284
|
try {
|
|
283
285
|
n.releasePointerCapture(r);
|
|
284
286
|
} catch {}
|
|
285
287
|
};
|
|
286
|
-
function o(e) {
|
|
287
|
-
e.pointerId === r && (a(), $(!0));
|
|
288
|
-
}
|
|
289
288
|
function s(e) {
|
|
290
|
-
e.pointerId === r && (
|
|
289
|
+
e.pointerId === r && (o(), $(!0));
|
|
291
290
|
}
|
|
292
291
|
function c(e) {
|
|
293
|
-
e.
|
|
292
|
+
e.pointerId === r && (o(), $(!1));
|
|
293
|
+
}
|
|
294
|
+
function l(e) {
|
|
295
|
+
e.key === "Escape" && (o(), $(!1));
|
|
294
296
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
297
|
+
function u() {
|
|
298
|
+
o(), $(!1);
|
|
297
299
|
}
|
|
298
|
-
window.addEventListener("pointermove", i), window.addEventListener("pointerup",
|
|
299
|
-
},
|
|
300
|
-
if (
|
|
301
|
-
let t =
|
|
302
|
-
if (
|
|
300
|
+
window.addEventListener("pointermove", i), window.addEventListener("pointerup", s), window.addEventListener("pointercancel", c), window.addEventListener("keydown", l, !0), window.addEventListener("blur", u), I = o, Q(), R = requestAnimationFrame(oe);
|
|
301
|
+
}, de = (e) => {
|
|
302
|
+
if (j === null || B == null || A?.locateDragRow === void 0) return;
|
|
303
|
+
let t = A.locateDragRow(B, j);
|
|
304
|
+
if (V && V.forEach((e, t) => {
|
|
303
305
|
if (!t.isConnected) {
|
|
304
|
-
|
|
306
|
+
V?.delete(t);
|
|
305
307
|
return;
|
|
306
308
|
}
|
|
307
309
|
let n = Number(t.getAttribute("data-row-index"));
|
|
308
310
|
if (n === e.index && (e.applied === void 0 || t.style.transform === e.applied)) return;
|
|
309
|
-
let r =
|
|
311
|
+
let r = E.exec(t.style.transform);
|
|
310
312
|
if (!r) {
|
|
311
|
-
|
|
313
|
+
V?.delete(t);
|
|
312
314
|
return;
|
|
313
315
|
}
|
|
314
316
|
e.index = n, e.baseY = parseFloat(r[1]), e.applied = void 0;
|
|
315
317
|
}), t === null) {
|
|
316
|
-
|
|
318
|
+
I?.(), $(!1);
|
|
317
319
|
return;
|
|
318
320
|
}
|
|
319
|
-
|
|
320
|
-
x:
|
|
321
|
-
y:
|
|
322
|
-
}), t !==
|
|
321
|
+
V && t !== j && P !== null && e !== null && (P = {
|
|
322
|
+
x: P.x,
|
|
323
|
+
y: P.y + A.rowMetrics.rowTop(t) - e.rowTop(j)
|
|
324
|
+
}), t !== j && (Z(null, !1), j = t, Z(t, !0)), Q();
|
|
323
325
|
};
|
|
324
326
|
return {
|
|
325
327
|
update: (e) => {
|
|
326
|
-
let t =
|
|
327
|
-
|
|
328
|
+
let t = A;
|
|
329
|
+
A = e, j !== null && t !== null && t.locateDragRow !== e.locateDragRow && de(t.rowMetrics);
|
|
328
330
|
},
|
|
329
|
-
onRowDragHandlePointerDown:
|
|
330
|
-
applyReorderSettle:
|
|
331
|
+
onRowDragHandlePointerDown: ue,
|
|
332
|
+
applyReorderSettle: le,
|
|
331
333
|
dispose: () => {
|
|
332
|
-
|
|
334
|
+
I?.(), I = null, R !== null && (cancelAnimationFrame(R), R = null), document.body.style.cursor = "", X(), Z(j, !1), j = null, B = null, M = null, V = null, U?.forEach(k), U = null, z = null;
|
|
333
335
|
}
|
|
334
336
|
};
|
|
335
337
|
};
|
|
336
338
|
//#endregion
|
|
337
|
-
export {
|
|
339
|
+
export { A as createRowDragController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs");var t=`ssg-body-row--enter`,n=`--ssg-row-enter-index`,r=12,i=1500,a=e=>Number(e.getAttribute(`data-row-index`)),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs");var t=`ssg-body-row--enter`,n=`--ssg-row-enter-index`,r=12,i=1500,a=1e3,o=e=>Number(e.getAttribute(`data-row-index`)),s=/(?:^|;)\s*transform\s*:\s*([^;]+)/,c=e=>{if(!e)return null;let t=s.exec(e);return t?t[1].trim():null},l=e=>e instanceof HTMLElement&&e.classList.contains(`ssg-body-row`),u=`ssg-scroll-container--scrolling`,d=()=>{let r=null,s=null,d=!1,f={skeletonEnter:!1,mountEnter:!1},p=new Map,m=-1/0,h=e=>{e.classList.remove(t),e.style.removeProperty(n);let r=p.get(e);r!==void 0&&(clearTimeout(r),p.delete(e))},g=(e,r)=>{e.style.setProperty(n,String(r)),e.classList.add(t);let a=()=>{e.removeEventListener(`animationend`,a),h(e)};e.addEventListener(`animationend`,a),p.set(e,setTimeout(()=>{e.removeEventListener(`animationend`,a),h(e)},i))},_=(e,t)=>{let n=[];for(let r of e){if(r.style.transition)continue;let e=c(t.get(r)??null),i=r.style.transform;!e||!i||e===i||n.push({el:r,from:e,to:i})}if(n.length!==0){for(let{el:e,from:t}of n)e.style.transform=t;s?.getBoundingClientRect();for(let{el:e,to:t}of n)e.style.transform=t}},v=t=>l(t)&&(s===null||!e.isInsideDetailCardOf(s,t)),y=t=>{let n=new Set,r=new Map,i=new Set,c=[];for(let a of t){if(a.type===`attributes`){let e=a.target;v(e)&&!r.has(e)&&r.set(e,a.oldValue);continue}let t=s!==null&&a.target instanceof Element&&e.isInsideDetailCardOf(s,a.target);a.removedNodes.forEach(e=>{t||!l(e)||(e.hasAttribute(`data-skeleton-row`)?n.add(o(e)):i.add(e))}),a.addedNodes.forEach(e=>{v(e)&&!e.hasAttribute(`data-skeleton-row`)&&c.push(e)})}if(c.length===0)return;let d=s?.classList.contains(u)===!0;f.mountEnter&&!d&&_(c.filter(e=>i.has(e)),r);let p=f.mountEnter&&!d;if(p&&c.some(e=>!i.has(e))){let e=Date.now();p=e-m>=a,m=e}let h=c.filter(e=>p&&!i.has(e)||f.skeletonEnter&&n.has(o(e)));if(h.length===0)return;let y=Array.from(new Set(h.map(o))).sort((e,t)=>e-t),b=new Map;y.forEach((e,t)=>{b.set(e,Math.min(t,12))});for(let e of h)g(e,b.get(o(e))??0)},b=()=>{r?.disconnect(),r=null,s=null,d=!1;for(let e of Array.from(p.keys()))h(e)};return{update:({scrollContainerRef:e,skeletonEnter:t,mountEnter:n})=>{f={skeletonEnter:t,mountEnter:n};let i=t||n?e.current:null;i===s&&n===d||(b(),!(!i||typeof MutationObserver>`u`)&&(r=new MutationObserver(y),r.observe(i,n?{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`],attributeOldValue:!0}:{childList:!0,subtree:!0}),s=i,d=n))},dispose:b}};exports.ROW_ENTER_CLASS_NAME=t,exports.ROW_ENTER_FALLBACK_MS=i,exports.ROW_ENTER_INDEX_VAR=n,exports.ROW_ENTER_LIVE_WINDOW_MS=a,exports.ROW_ENTER_STAGGER_CAP=r,exports.createRowEnterController=d,exports.transformOfStyleText=c;
|
|
@@ -14,6 +14,7 @@ export declare const ROW_ENTER_CLASS_NAME = "ssg-body-row--enter";
|
|
|
14
14
|
export declare const ROW_ENTER_INDEX_VAR = "--ssg-row-enter-index";
|
|
15
15
|
export declare const ROW_ENTER_STAGGER_CAP = 12;
|
|
16
16
|
export declare const ROW_ENTER_FALLBACK_MS = 1500;
|
|
17
|
+
export declare const ROW_ENTER_LIVE_WINDOW_MS = 1000;
|
|
17
18
|
export declare const transformOfStyleText: (styleText: string | null) => string | null;
|
|
18
19
|
export declare const createRowEnterController: () => RowEnterController;
|
|
19
20
|
export {};
|