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