@ishibashi0112/spreadsheet-grid-core 0.61.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/controllers/autoHeightMeasurer.cjs +1 -1
- package/dist/controllers/autoHeightMeasurer.d.ts +1 -0
- package/dist/controllers/autoHeightMeasurer.js +59 -48
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +119 -115
- package/dist/controllers/columnMenuController.cjs +1 -1
- package/dist/controllers/columnMenuController.d.ts +2 -0
- package/dist/controllers/columnMenuController.js +74 -60
- package/dist/controllers/contextMenuController.cjs +1 -1
- package/dist/controllers/contextMenuController.js +42 -32
- package/dist/controllers/detailTabOrder.cjs +1 -0
- package/dist/controllers/detailTabOrder.d.ts +4 -0
- package/dist/controllers/detailTabOrder.js +33 -0
- package/dist/controllers/fillHandleController.cjs +1 -1
- package/dist/controllers/fillHandleController.js +119 -117
- package/dist/controllers/filterPopoverController.cjs +1 -1
- package/dist/controllers/filterPopoverController.d.ts +1 -0
- package/dist/controllers/filterPopoverController.js +4 -2
- package/dist/controllers/imeInputController.cjs +1 -1
- package/dist/controllers/imeInputController.js +1 -1
- package/dist/controllers/keyboardController.cjs +1 -1
- package/dist/controllers/keyboardController.d.ts +5 -0
- package/dist/controllers/keyboardController.js +182 -86
- package/dist/controllers/pointerInteractionsController.cjs +1 -1
- package/dist/controllers/pointerInteractionsController.d.ts +1 -0
- package/dist/controllers/pointerInteractionsController.js +33 -17
- package/dist/controllers/popoverSupport.cjs +1 -1
- package/dist/controllers/popoverSupport.d.ts +3 -0
- package/dist/controllers/popoverSupport.js +25 -5
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.js +166 -121
- package/dist/controllers/saveStatusController.cjs +1 -1
- package/dist/controllers/saveStatusController.js +71 -25
- package/dist/controllers/serverSideRowModel.cjs +1 -1
- package/dist/controllers/serverSideRowModel.d.ts +1 -0
- package/dist/controllers/serverSideRowModel.js +180 -133
- package/dist/controllers/toolPanelController.cjs +1 -1
- package/dist/controllers/toolPanelController.js +2 -0
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +54 -53
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +3 -1
- package/dist/controllers/viewportSyncController.js +4 -4
- package/dist/engine/columnCommands.cjs +1 -1
- package/dist/engine/columnCommands.d.ts +2 -0
- package/dist/engine/columnCommands.js +71 -31
- package/dist/engine/columnLayout.cjs +1 -1
- package/dist/engine/columnLayout.js +15 -14
- package/dist/engine/createGridEngine.cjs +1 -1
- package/dist/engine/createGridEngine.d.ts +3 -1
- package/dist/engine/createGridEngine.js +71 -49
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.d.ts +2 -1
- package/dist/engine/exportCommands.js +117 -92
- package/dist/engine/features.d.ts +3 -1
- package/dist/engine/fullFeatures.cjs +1 -1
- package/dist/engine/fullFeatures.js +23 -21
- package/dist/engine/gridApi.cjs +1 -1
- package/dist/engine/gridApi.d.ts +10 -2
- package/dist/engine/gridApi.js +389 -297
- package/dist/engine/notifiers.cjs +1 -1
- package/dist/engine/notifiers.d.ts +1 -0
- package/dist/engine/notifiers.js +10 -5
- package/dist/engine/rowPipeline.cjs +1 -1
- package/dist/engine/rowPipeline.d.ts +2 -0
- package/dist/engine/rowPipeline.js +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -6
- package/dist/logic/columnAutosize.cjs +1 -1
- package/dist/logic/columnAutosize.js +84 -84
- package/dist/logic/columnWidthState.cjs +1 -1
- package/dist/logic/columnWidthState.js +25 -20
- package/dist/logic/detailRow.cjs +1 -1
- package/dist/logic/detailRow.d.ts +12 -0
- package/dist/logic/detailRow.js +42 -4
- package/dist/logic/editorValues.cjs +1 -1
- package/dist/logic/editorValues.js +14 -13
- package/dist/logic/exportCsv.cjs +2 -2
- package/dist/logic/exportCsv.d.ts +3 -1
- package/dist/logic/exportCsv.js +15 -10
- package/dist/logic/exportData.cjs +1 -1
- package/dist/logic/exportData.d.ts +3 -1
- package/dist/logic/exportData.js +23 -15
- package/dist/logic/filterSummary.cjs +1 -1
- package/dist/logic/filterSummary.d.ts +9 -3
- package/dist/logic/filterSummary.js +39 -13
- 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 +19 -0
- package/dist/logic/gridState.js +93 -53
- package/dist/logic/groupExport.cjs +1 -0
- package/dist/logic/groupExport.d.ts +15 -0
- package/dist/logic/groupExport.js +40 -0
- package/dist/logic/grouping.cjs +1 -1
- package/dist/logic/grouping.d.ts +2 -2
- package/dist/logic/grouping.js +58 -40
- package/dist/logic/localeText.cjs +1 -0
- package/dist/logic/localeText.d.ts +4 -0
- package/dist/logic/localeText.js +45 -0
- package/dist/logic/numberFilterCondition.cjs +1 -1
- package/dist/logic/numberFilterCondition.d.ts +1 -1
- package/dist/logic/numberFilterCondition.js +12 -9
- package/dist/logic/scrollTargets.cjs +1 -1
- package/dist/logic/scrollTargets.d.ts +6 -1
- package/dist/logic/scrollTargets.js +8 -8
- package/dist/logic/theme.cjs +1 -1
- package/dist/logic/theme.d.ts +2 -0
- package/dist/logic/theme.js +2 -2
- package/dist/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/gridActions.cjs +1 -1
- package/dist/model/gridActions.d.ts +4 -2
- package/dist/model/gridActions.js +12 -4
- package/dist/model/gridReducer.cjs +1 -1
- package/dist/model/gridReducer.js +2 -2
- package/dist/model/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 +244 -40
- package/dist/utils/permissions.cjs +1 -1
- package/dist/utils/permissions.js +5 -3
- package/dist/utils/portalTokens.cjs +1 -0
- package/dist/utils/portalTokens.d.ts +3 -0
- package/dist/utils/portalTokens.js +65 -0
- package/package.json +1 -1
|
@@ -2,26 +2,40 @@ import { resolveMoveTargetIndex as e, resolveRowDropSlot as t, resolveRowDropSlo
|
|
|
2
2
|
import { isInsideDetailCardOf as r } from "../logic/detailRow.js";
|
|
3
3
|
import { clampClientYAboveFooter as i, computeNextScrollPosition as a, hasPointerLeftActivationRadius as o, resolveAutoScrollAxisDirection as s, resolveScrollContentBox as c } from "../logic/autoScrollGeometry.js";
|
|
4
4
|
import { applySlotToElement as l } from "../logic/slotDom.js";
|
|
5
|
+
import { syncPortalTokens as u } from "../utils/portalTokens.js";
|
|
5
6
|
//#region src/controllers/rowDragController.ts
|
|
6
|
-
var
|
|
7
|
+
var d = 14, f = 12, p = "0.5", m = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"8 6 12 2 16 6\"/><polyline points=\"16 18 12 22 8 18\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"22\"/></svg>", h = "<svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"4.9\" y1=\"4.9\" x2=\"19.1\" y2=\"19.1\"/></svg>", g = 200, _ = "cubic-bezier(0.2, 0.7, 0.3, 1)", v = `transform 160ms ${_}`, y = "data-ssg-row-dragging", b = (e) => e?.closest(".ssg-motion-off") != null, x = /translateY\((-?[\d.]+)px\)/, S = (e) => {
|
|
7
8
|
let t = [];
|
|
8
9
|
return e.querySelectorAll(".ssg-body-row[data-row-index]").forEach((n) => {
|
|
9
10
|
r(e, n) || t.push(n);
|
|
10
11
|
}), t;
|
|
11
|
-
},
|
|
12
|
-
let
|
|
12
|
+
}, C = (e) => {
|
|
13
|
+
let t = [], n = /* @__PURE__ */ new Map();
|
|
14
|
+
return e.querySelectorAll(".ssg-detail-band[data-detail-row-index]").forEach((i) => {
|
|
15
|
+
if (r(e, i)) return;
|
|
16
|
+
let a = Number(i.getAttribute("data-detail-row-index")), o = n.get(a) ?? 0;
|
|
17
|
+
n.set(a, o + 1), t.push({
|
|
18
|
+
el: i,
|
|
19
|
+
index: a,
|
|
20
|
+
key: `band|${o}|${a}`
|
|
21
|
+
});
|
|
22
|
+
}), t;
|
|
23
|
+
}, w = (e) => {
|
|
24
|
+
e.style.transition = "", e.style.transform = "", e.style.willChange = "", e.style.zIndex = "";
|
|
25
|
+
}, T = () => {
|
|
26
|
+
let T = null, E = null, D = null, O = {
|
|
13
27
|
x: 0,
|
|
14
28
|
y: 0
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
],
|
|
20
|
-
for (let e of
|
|
21
|
-
},
|
|
22
|
-
if (
|
|
29
|
+
}, k = null, A = !1, j = null, M = null, N = null, P = null, F = null, I = null, L = 0, R = null, z = () => T?.motion === "live", B = null, V = null, H = null, U = () => [
|
|
30
|
+
T?.leftIndicatorRef.current ?? null,
|
|
31
|
+
T?.centerIndicatorRef.current ?? null,
|
|
32
|
+
T?.rightIndicatorRef.current ?? null
|
|
33
|
+
], W = () => {
|
|
34
|
+
for (let e of U()) e && (e.style.display = "none");
|
|
35
|
+
}, G = (e) => {
|
|
36
|
+
if (B) return;
|
|
23
37
|
let t = document.createElement("div");
|
|
24
|
-
t.setAttribute("data-grid-drag-ghost", ""),
|
|
38
|
+
t.setAttribute("data-grid-drag-ghost", ""), T?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), T?.scrollContainerRef.current?.closest(".ssg-theme-class") != null && t.classList.add("ssg-theme-class"), T?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
|
|
25
39
|
"position:fixed",
|
|
26
40
|
"top:0",
|
|
27
41
|
"left:0",
|
|
@@ -46,53 +60,53 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
46
60
|
"z-index:9999",
|
|
47
61
|
"will-change:transform",
|
|
48
62
|
"transform:translate(-9999px,-9999px)"
|
|
49
|
-
].join(";"), l(t,
|
|
63
|
+
].join(";"), l(t, T?.ghostSlot);
|
|
50
64
|
let n = document.createElement("span");
|
|
51
65
|
n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
|
|
52
66
|
let r = document.createElement("span");
|
|
53
|
-
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t),
|
|
54
|
-
},
|
|
55
|
-
let t =
|
|
67
|
+
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), u(T?.scrollContainerRef.current, t), B = t, V = n, H = null;
|
|
68
|
+
}, K = (e) => {
|
|
69
|
+
let t = B;
|
|
56
70
|
if (!t) return;
|
|
57
|
-
t.style.transform = "translate(" + (
|
|
71
|
+
t.style.transform = "translate(" + (O.x + d) + "px," + (O.y + f) + "px)";
|
|
58
72
|
let n = e ? "move" : "out";
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
let r =
|
|
62
|
-
n === "out" ? (t.style.opacity =
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
let n =
|
|
67
|
-
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${
|
|
68
|
-
r(n, e) || (t ? e.setAttribute(
|
|
73
|
+
if (H === n) return;
|
|
74
|
+
H = n;
|
|
75
|
+
let r = V;
|
|
76
|
+
n === "out" ? (t.style.opacity = p, r && (r.innerHTML = h)) : (t.style.opacity = "1", r && (r.innerHTML = m));
|
|
77
|
+
}, q = () => {
|
|
78
|
+
B && B.parentNode && B.parentNode.removeChild(B), B = null, V = null, H = null;
|
|
79
|
+
}, J = (e, t) => {
|
|
80
|
+
let n = T?.scrollContainerRef.current ?? null;
|
|
81
|
+
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${y}]`).forEach((e) => {
|
|
82
|
+
r(n, e) || (t ? e.setAttribute(y, z() ? "live" : "") : e.removeAttribute(y));
|
|
69
83
|
});
|
|
70
|
-
},
|
|
71
|
-
let e =
|
|
84
|
+
}, ee = () => {
|
|
85
|
+
let e = T?.scrollContainerRef.current ?? null;
|
|
72
86
|
if (!e) return null;
|
|
73
87
|
let t = /* @__PURE__ */ new Map();
|
|
74
|
-
for (let n of
|
|
75
|
-
let e =
|
|
88
|
+
for (let n of S(e)) {
|
|
89
|
+
let e = x.exec(n.style.transform);
|
|
76
90
|
e && t.set(n, {
|
|
77
91
|
index: Number(n.getAttribute("data-row-index")),
|
|
78
92
|
baseY: parseFloat(e[1])
|
|
79
93
|
});
|
|
80
94
|
}
|
|
81
95
|
return t;
|
|
82
|
-
},
|
|
83
|
-
let n =
|
|
84
|
-
if (!n || r === null ||
|
|
85
|
-
let i =
|
|
96
|
+
}, te = (t) => {
|
|
97
|
+
let n = I, r = E;
|
|
98
|
+
if (!n || r === null || T === null) return;
|
|
99
|
+
let i = T.scrollContainerRef.current;
|
|
86
100
|
if (!i) return;
|
|
87
|
-
for (let e of
|
|
101
|
+
for (let e of S(i)) {
|
|
88
102
|
if (n.has(e)) continue;
|
|
89
|
-
let t =
|
|
103
|
+
let t = x.exec(e.style.transform);
|
|
90
104
|
t && n.set(e, {
|
|
91
105
|
index: Number(e.getAttribute("data-row-index")),
|
|
92
106
|
baseY: parseFloat(t[1])
|
|
93
107
|
});
|
|
94
108
|
}
|
|
95
|
-
let a =
|
|
109
|
+
let a = T.rowMetrics.rowsHeight(r, r), o = (i.scrollTop - L) * T.verticalScaleFactor, s = (k ? O.y - k.y : 0) + o, c = t === null ? null : e(r, t);
|
|
96
110
|
n.forEach((e, t) => {
|
|
97
111
|
let { index: i, baseY: o } = e;
|
|
98
112
|
if (!t.isConnected) {
|
|
@@ -104,38 +118,53 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
104
118
|
return;
|
|
105
119
|
}
|
|
106
120
|
let l = 0;
|
|
107
|
-
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition =
|
|
121
|
+
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition = v, t.style.transform = `translateY(${o + l}px)`, e.applied = t.style.transform;
|
|
108
122
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
let {
|
|
123
|
+
let l = R ?? /* @__PURE__ */ new Set();
|
|
124
|
+
R = l;
|
|
125
|
+
for (let { el: e, index: t } of C(i)) {
|
|
126
|
+
if (l.add(e), t === r) {
|
|
127
|
+
e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", e.style.zIndex = "10";
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
let n = 0;
|
|
131
|
+
c !== null && (r < t && t <= c ? n = -a : c <= t && t < r && (n = a)), e.style.transition = v, e.style.transform = `translateY(${n}px)`, e.style.zIndex = "";
|
|
132
|
+
}
|
|
133
|
+
}, ne = (e, r) => {
|
|
134
|
+
if (T === null) return null;
|
|
135
|
+
let { scrollContainerRef: a, bodyScrollRef: o, rowMetrics: s, headerHeight: c, verticalScaleFactor: l, windowBaseOffsetPx: u } = T, d = a.current, f = o.current;
|
|
112
136
|
if (!d || !f) return null;
|
|
113
137
|
let p = d.getBoundingClientRect();
|
|
114
138
|
if (e < p.left || e > p.right || r < p.top || r > p.bottom) return null;
|
|
115
|
-
let m = i(r, p.top + d.clientTop + d.clientHeight,
|
|
139
|
+
let m = i(r, p.top + d.clientTop + d.clientHeight, T.footerHeight ?? 0), h = f.getBoundingClientRect(), g = f.scrollTop + m - h.top - c - d.scrollTop * (1 - l), _ = t(g, s), v = E, y = v !== null && z() ? s.detailHeight(v) : 0;
|
|
140
|
+
if (v !== null && y > 0) {
|
|
141
|
+
let e = t(g + y, s);
|
|
142
|
+
e > v + 1 && (_ = e);
|
|
143
|
+
}
|
|
144
|
+
let b = n(_, s);
|
|
116
145
|
return {
|
|
117
|
-
slot:
|
|
118
|
-
top: c +
|
|
146
|
+
slot: _,
|
|
147
|
+
top: c + b - u
|
|
119
148
|
};
|
|
120
|
-
},
|
|
121
|
-
let t =
|
|
122
|
-
if (
|
|
123
|
-
t && n !== null && (
|
|
149
|
+
}, Y = () => {
|
|
150
|
+
let t = ne(O.x, O.y), n = E;
|
|
151
|
+
if (z()) {
|
|
152
|
+
t && n !== null && (D = e(n, t.slot) === null ? null : t.slot), W(), te(D);
|
|
124
153
|
return;
|
|
125
154
|
}
|
|
126
|
-
if (
|
|
127
|
-
|
|
155
|
+
if (K(t), !t || n === null || e(n, t.slot) === null) {
|
|
156
|
+
D = null, W();
|
|
128
157
|
return;
|
|
129
158
|
}
|
|
130
|
-
|
|
131
|
-
for (let e of
|
|
132
|
-
},
|
|
133
|
-
if (
|
|
134
|
-
|
|
159
|
+
D = t.slot;
|
|
160
|
+
for (let e of U()) e && (e.style.top = `${t.top}px`, e.style.display = "block");
|
|
161
|
+
}, X = () => {
|
|
162
|
+
if (E === null) {
|
|
163
|
+
N = null;
|
|
135
164
|
return;
|
|
136
165
|
}
|
|
137
|
-
let e =
|
|
138
|
-
if (e && (
|
|
166
|
+
let e = T?.scrollContainerRef.current ?? null;
|
|
167
|
+
if (e && (A || (!k || o(k, O, 6)) && (A = !0), A)) {
|
|
139
168
|
let t = e.getBoundingClientRect(), n = c({
|
|
140
169
|
rectLeft: t.left,
|
|
141
170
|
rectTop: t.top,
|
|
@@ -143,148 +172,164 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
143
172
|
clientTop: e.clientTop,
|
|
144
173
|
clientWidth: e.clientWidth,
|
|
145
174
|
clientHeight: e.clientHeight
|
|
146
|
-
}), r = s(
|
|
175
|
+
}), r = s(O.y, n.top, n.bottom - (T?.footerHeight ?? 0), 24), i = a(e.scrollTop, r, 18, e.scrollHeight - e.clientHeight);
|
|
147
176
|
i !== e.scrollTop && e.scrollTo({
|
|
148
177
|
top: i,
|
|
149
178
|
behavior: "auto"
|
|
150
179
|
});
|
|
151
180
|
}
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
let e =
|
|
181
|
+
Y(), N = requestAnimationFrame(X);
|
|
182
|
+
}, Z = (e, t) => `${e.getAttribute("data-pane") ?? ""}|${t}`, Q = () => {
|
|
183
|
+
let e = T?.scrollContainerRef.current ?? null;
|
|
155
184
|
if (!e) return null;
|
|
156
185
|
let t = /* @__PURE__ */ new Map();
|
|
157
|
-
for (let n of
|
|
186
|
+
for (let n of S(e)) t.set(Z(n, Number(n.getAttribute("data-row-index"))), n.getBoundingClientRect().top);
|
|
187
|
+
for (let n of C(e)) t.set(n.key, n.el.getBoundingClientRect().top);
|
|
158
188
|
return t;
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
let n =
|
|
162
|
-
|
|
163
|
-
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null &&
|
|
164
|
-
|
|
165
|
-
let c = s && o &&
|
|
166
|
-
if (
|
|
189
|
+
}, $ = (t) => {
|
|
190
|
+
N !== null && (cancelAnimationFrame(N), N = null), document.body.style.cursor = "", W(), q();
|
|
191
|
+
let n = E, r = D, i = F;
|
|
192
|
+
J(n, !1), E = null, F = null, D = null, k = null, M = null;
|
|
193
|
+
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null && T !== null, s = I;
|
|
194
|
+
I = null;
|
|
195
|
+
let c = s && o && T !== null && !b(T.scrollContainerRef.current) ? Q() : null, l = R;
|
|
196
|
+
if (R = null, l && (o ? l.forEach(w) : (l.forEach((e) => {
|
|
197
|
+
e.isConnected && (e.style.transition = v, e.style.transform = "translateY(0px)", e.style.zIndex = "");
|
|
198
|
+
}), window.setTimeout(() => {
|
|
199
|
+
l.forEach((e) => {
|
|
200
|
+
R?.has(e) || w(e);
|
|
201
|
+
});
|
|
202
|
+
}, 200))), s) if (o) s.forEach(({ baseY: e }, t) => {
|
|
167
203
|
t.style.transition = "", t.style.willChange = "", t.isConnected && (t.style.transform = `translateY(${e}px)`);
|
|
168
204
|
});
|
|
169
205
|
else {
|
|
170
206
|
let e = [];
|
|
171
207
|
s.forEach(({ baseY: t }, n) => {
|
|
172
|
-
n.isConnected && (n.style.transition =
|
|
208
|
+
n.isConnected && (n.style.transition = v, n.style.transform = `translateY(${t}px)`, e.push(n));
|
|
173
209
|
}), window.setTimeout(() => {
|
|
174
210
|
for (let t of e) t.style.transition = "", t.style.willChange = "";
|
|
175
211
|
}, 200);
|
|
176
212
|
}
|
|
177
|
-
if (!o || n === null || a === null ||
|
|
178
|
-
let
|
|
179
|
-
tops:
|
|
213
|
+
if (!o || n === null || a === null || T === null) return;
|
|
214
|
+
let u = c ?? (b(T.scrollContainerRef.current) ? null : Q()), d = u ? {
|
|
215
|
+
tops: u,
|
|
180
216
|
from: n,
|
|
181
217
|
to: a,
|
|
182
218
|
row: i
|
|
183
219
|
} : null;
|
|
184
|
-
|
|
185
|
-
|
|
220
|
+
P = d, T.commitRowMove(n, a), d && requestAnimationFrame(() => {
|
|
221
|
+
P === d && (P = null);
|
|
186
222
|
});
|
|
187
|
-
},
|
|
188
|
-
let e =
|
|
189
|
-
if (
|
|
190
|
-
let t =
|
|
223
|
+
}, re = () => {
|
|
224
|
+
let e = P;
|
|
225
|
+
if (P = null, !e) return;
|
|
226
|
+
let t = T?.scrollContainerRef.current ?? null;
|
|
191
227
|
if (!t) return;
|
|
192
228
|
let { tops: n, from: r, to: i } = e;
|
|
193
|
-
if (
|
|
229
|
+
if (T?.locateDragRow && e.row !== null && T.locateDragRow(e.row, i) !== i) return;
|
|
194
230
|
let a = (e) => e === i ? r : r < i && e >= r && e < i ? e + 1 : i < r && e > i && e <= r ? e - 1 : e, o = [], s = /* @__PURE__ */ new Map();
|
|
195
|
-
|
|
196
|
-
let t = n.get(
|
|
231
|
+
S(t).forEach((e) => {
|
|
232
|
+
let t = n.get(Z(e, a(Number(e.getAttribute("data-row-index")))));
|
|
197
233
|
if (t === void 0) return;
|
|
198
234
|
let r = t - e.getBoundingClientRect().top;
|
|
199
235
|
if (Math.abs(r) < .5) return;
|
|
200
|
-
let i =
|
|
236
|
+
let i = x.exec(e.style.transform);
|
|
201
237
|
if (!i) return;
|
|
202
238
|
let c = parseFloat(i[1]);
|
|
203
239
|
s.set(e, c), e.style.transition = "none", e.style.transform = `translateY(${c + r}px)`, e.style.willChange = "transform", o.push(e);
|
|
204
|
-
})
|
|
240
|
+
});
|
|
241
|
+
let c = [];
|
|
242
|
+
if (C(t).forEach(({ el: e, index: t, key: r }) => {
|
|
243
|
+
let i = a(t), o = n.get(r.slice(0, r.lastIndexOf("|") + 1) + i);
|
|
244
|
+
if (o === void 0) return;
|
|
245
|
+
let s = o - e.getBoundingClientRect().top;
|
|
246
|
+
Math.abs(s) < .5 || (e.style.transition = "none", e.style.transform = `translateY(${s}px)`, e.style.willChange = "transform", c.push(e));
|
|
247
|
+
}), !(o.length === 0 && c.length === 0)) {
|
|
205
248
|
t.getBoundingClientRect();
|
|
206
|
-
for (let e of o) e.style.transition = `transform ${
|
|
249
|
+
for (let e of o) e.style.transition = `transform ${g}ms ${_}`, e.style.transform = `translateY(${s.get(e) ?? 0}px)`;
|
|
250
|
+
for (let e of c) e.style.transition = `transform ${g}ms ${_}`, e.style.transform = "translateY(0px)";
|
|
207
251
|
window.setTimeout(() => {
|
|
208
252
|
for (let e of o) e.style.transition = "", e.style.willChange = "";
|
|
253
|
+
for (let e of c) R?.has(e) || w(e);
|
|
209
254
|
}, 280);
|
|
210
255
|
}
|
|
211
|
-
},
|
|
212
|
-
if (
|
|
213
|
-
if (t.stopPropagation(), t.preventDefault(),
|
|
214
|
-
if (t.pointerId !==
|
|
215
|
-
|
|
256
|
+
}, ie = (e, t) => {
|
|
257
|
+
if (T === null || !T.enabled || t.button !== 0) return;
|
|
258
|
+
if (t.stopPropagation(), t.preventDefault(), E !== null) {
|
|
259
|
+
if (t.pointerId !== M) return;
|
|
260
|
+
j?.(), $(!1);
|
|
216
261
|
}
|
|
217
|
-
|
|
262
|
+
E = e, F = T.getDragRow?.(e) ?? null, M = t.pointerId, D = null, O = {
|
|
218
263
|
x: t.clientX,
|
|
219
264
|
y: t.clientY
|
|
220
|
-
},
|
|
265
|
+
}, k = {
|
|
221
266
|
x: t.clientX,
|
|
222
267
|
y: t.clientY
|
|
223
|
-
},
|
|
268
|
+
}, A = !1, document.body.style.cursor = "grabbing", z() ? (I = ee(), L = T.scrollContainerRef.current?.scrollTop ?? 0) : G(T.getRowDragLabel(e)), J(e, !0);
|
|
224
269
|
let n = t.currentTarget, r = t.pointerId;
|
|
225
270
|
try {
|
|
226
271
|
n.setPointerCapture(r);
|
|
227
272
|
} catch {}
|
|
228
273
|
let i = (e) => {
|
|
229
|
-
e.pointerId === r && (
|
|
274
|
+
e.pointerId === r && (O = {
|
|
230
275
|
x: e.clientX,
|
|
231
276
|
y: e.clientY
|
|
232
|
-
},
|
|
277
|
+
}, Y());
|
|
233
278
|
}, a = () => {
|
|
234
|
-
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l),
|
|
279
|
+
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l), j = null;
|
|
235
280
|
try {
|
|
236
281
|
n.releasePointerCapture(r);
|
|
237
282
|
} catch {}
|
|
238
283
|
};
|
|
239
284
|
function o(e) {
|
|
240
|
-
e.pointerId === r && (a(),
|
|
285
|
+
e.pointerId === r && (a(), $(!0));
|
|
241
286
|
}
|
|
242
287
|
function s(e) {
|
|
243
|
-
e.pointerId === r && (a(),
|
|
288
|
+
e.pointerId === r && (a(), $(!1));
|
|
244
289
|
}
|
|
245
290
|
function c(e) {
|
|
246
|
-
e.key === "Escape" && (a(),
|
|
291
|
+
e.key === "Escape" && (a(), $(!1));
|
|
247
292
|
}
|
|
248
293
|
function l() {
|
|
249
|
-
a(),
|
|
294
|
+
a(), $(!1);
|
|
250
295
|
}
|
|
251
|
-
window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l),
|
|
252
|
-
},
|
|
253
|
-
if (
|
|
254
|
-
let t =
|
|
255
|
-
if (
|
|
296
|
+
window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l), j = a, Y(), N = requestAnimationFrame(X);
|
|
297
|
+
}, ae = (e) => {
|
|
298
|
+
if (E === null || F == null || T?.locateDragRow === void 0) return;
|
|
299
|
+
let t = T.locateDragRow(F, E);
|
|
300
|
+
if (I && I.forEach((e, t) => {
|
|
256
301
|
if (!t.isConnected) {
|
|
257
|
-
|
|
302
|
+
I?.delete(t);
|
|
258
303
|
return;
|
|
259
304
|
}
|
|
260
305
|
let n = Number(t.getAttribute("data-row-index"));
|
|
261
306
|
if (n === e.index && (e.applied === void 0 || t.style.transform === e.applied)) return;
|
|
262
|
-
let r =
|
|
307
|
+
let r = x.exec(t.style.transform);
|
|
263
308
|
if (!r) {
|
|
264
|
-
|
|
309
|
+
I?.delete(t);
|
|
265
310
|
return;
|
|
266
311
|
}
|
|
267
312
|
e.index = n, e.baseY = parseFloat(r[1]), e.applied = void 0;
|
|
268
313
|
}), t === null) {
|
|
269
|
-
|
|
314
|
+
j?.(), $(!1);
|
|
270
315
|
return;
|
|
271
316
|
}
|
|
272
|
-
|
|
273
|
-
x:
|
|
274
|
-
y:
|
|
275
|
-
}), t !==
|
|
317
|
+
I && t !== E && k !== null && e !== null && (k = {
|
|
318
|
+
x: k.x,
|
|
319
|
+
y: k.y + T.rowMetrics.rowTop(t) - e.rowTop(E)
|
|
320
|
+
}), t !== E && (J(null, !1), E = t, J(t, !0)), Y();
|
|
276
321
|
};
|
|
277
322
|
return {
|
|
278
323
|
update: (e) => {
|
|
279
|
-
let t =
|
|
280
|
-
|
|
324
|
+
let t = T;
|
|
325
|
+
T = e, E !== null && t !== null && t.locateDragRow !== e.locateDragRow && ae(t.rowMetrics);
|
|
281
326
|
},
|
|
282
|
-
onRowDragHandlePointerDown:
|
|
283
|
-
applyReorderSettle:
|
|
327
|
+
onRowDragHandlePointerDown: ie,
|
|
328
|
+
applyReorderSettle: re,
|
|
284
329
|
dispose: () => {
|
|
285
|
-
|
|
330
|
+
j?.(), j = null, N !== null && (cancelAnimationFrame(N), N = null), document.body.style.cursor = "", q(), J(E, !1), E = null, F = null, D = null, I = null, R?.forEach(w), R = null, P = null;
|
|
286
331
|
}
|
|
287
332
|
};
|
|
288
333
|
};
|
|
289
334
|
//#endregion
|
|
290
|
-
export {
|
|
335
|
+
export { T as createRowDragController };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs");var t=`data-ssg-save`,n=`ssg-save-indicator`,r=`ssg-save-failed-chip`,i=1300,a=1300,o=4e3,s=`保存に失敗しました。値を戻しました`,c=e=>typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`),l=()=>{let l=null,u=new Set,d=new Set,f=null,p=null,m=null,h=(e,t)=>{let n=setTimeout(()=>{u.delete(n),t()},e);u.add(n)},
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../logic/detailRow.cjs");var t=`data-ssg-save`,n=`ssg-save-indicator`,r=`ssg-save-failed-chip`,i=1300,a=1300,o=4e3,s=`保存に失敗しました。値を戻しました`,c=e=>typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(e):e.replace(/["\\]/g,`\\$&`),l=()=>{let l=null,u=new Set,d=new Set,f=null,p=null,m=null,h=new Map,g=null,_=null,v=null,y=(e,t)=>{let n=setTimeout(()=>{u.delete(n),t()},e);u.add(n)},b=t=>{let n=l?.scrollContainerRef.current;if(!n)return[];let r=[];for(let i of t.cells){let t=`.ssg-body-row[data-row-key="${c(String(i.rowKey))}"]`;for(let a of i.columnKeys)n.querySelectorAll(`${t} .ssg-body-cell[data-ssg-col-key="${c(a)}"]`).forEach(t=>{e.isInsideDetailCardOf(n,t)||r.push(t)})}return r},x=(e,t)=>{let r=e.querySelector(`:scope > .${n}`);if(t===null){r?.remove();return}r||(r=document.createElement(`span`),r.className=n,r.setAttribute(`aria-hidden`,`true`),e.appendChild(r)),r.setAttribute(`data-kind`,t),r.textContent=t===`ok`?`✓`:t===`failed`?`✕`:``},S=e=>{e.removeAttribute(t),x(e,null)},C=()=>{f?.remove(),f=null,p!==null&&(clearTimeout(p),u.delete(p),p=null),m&&=(m.removeEventListener(`scroll`,C),null)},w=e=>{C();let t=l?.scrollContainerRef.current,n=l?.shellRef?.current??t;if(!t||!n)return;let i=e.getBoundingClientRect(),a=n.getBoundingClientRect();f=document.createElement(`div`),f.className=r,f.setAttribute(`role`,`status`),f.textContent=s,f.style.left=`${Math.max(0,i.left-a.left)}px`,f.style.top=`${i.bottom-a.top+4}px`,n.appendChild(f),m=t,t.addEventListener(`scroll`,C,{passive:!0}),p=setTimeout(()=>{p=null,C()},o),u.add(p)},T=()=>{g?.disconnect(),g=null,_=null,v!==null&&(typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(v),d.delete(v),v=null)},E=()=>{let n=l?.scrollContainerRef.current;!n||h.size===0||n.querySelectorAll(`.ssg-body-row[data-row-key]`).forEach(r=>{let i=h.get(r.getAttribute(`data-row-key`)??``);i&&r.querySelectorAll(`.ssg-body-cell[data-ssg-col-key]`).forEach(r=>{i.has(r.getAttribute(`data-ssg-col-key`)??``)&&r.getAttribute(`data-ssg-save`)!==`pending`&&!e.isInsideDetailCardOf(n,r)&&(r.setAttribute(t,`pending`),x(r,`pending`))})})},D=()=>{if(v!==null)return;if(typeof requestAnimationFrame!=`function`){E();return}let e=requestAnimationFrame(()=>{d.delete(e),v===e&&(v=null),E()});v=e,d.add(e)},O=()=>{let e=l?.scrollContainerRef.current??null;if(h.size===0||!e||typeof MutationObserver!=`function`){T();return}g&&_===e||(T(),g=new MutationObserver(D),g.observe(e,{childList:!0,subtree:!0}),_=e)},k=e=>{for(let t of e.cells){let n=String(t.rowKey);if(e.state===`pending`){let e=h.get(n)??new Set;for(let n of t.columnKeys)e.add(n);h.set(n,e);continue}let r=h.get(n);if(r){for(let e of t.columnKeys)r.delete(e);r.size===0&&h.delete(n)}}O()},A=e=>{let n=b(e);for(let r of n){if(e.state===`cleared`){S(r);continue}r.setAttribute(t,e.state),x(r,e.state),e.state===`ok`?y(i,()=>{r.getAttribute(`data-ssg-save`)===`ok`&&S(r)}):e.state===`failed`&&y(a,()=>{r.getAttribute(`data-ssg-save`)===`failed`&&S(r)})}e.state===`failed`&&n.length>0&&w(n[0])};return{update:e=>{l=e,e.enabled||h.clear(),O()},handle:e=>{if(!l?.enabled)return;if(k(e),typeof requestAnimationFrame!=`function`){A(e);return}let t=requestAnimationFrame(()=>{d.delete(t),A(e)});d.add(t)},dispose:()=>{for(let e of u)clearTimeout(e);if(u.clear(),typeof cancelAnimationFrame==`function`)for(let e of d)cancelAnimationFrame(e);d.clear(),v=null,h.clear(),T(),C();let n=l?.scrollContainerRef.current;n?.querySelectorAll(`[${t}]`).forEach(t=>{e.isInsideDetailCardOf(n,t)||S(t)}),l=null}}};exports.FAILED_BADGE_MS=a,exports.FAILED_CHIP_MS=o,exports.FAILED_CHIP_TEXT=s,exports.OK_BADGE_MS=i,exports.SAVE_FAILED_CHIP_CLASS_NAME=r,exports.SAVE_INDICATOR_CLASS_NAME=n,exports.SAVE_STATE_ATTRIBUTE=t,exports.createSaveStatusController=l;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isInsideDetailCardOf as e } from "../logic/detailRow.js";
|
|
2
2
|
//#region src/controllers/saveStatusController.ts
|
|
3
3
|
var t = "data-ssg-save", n = "ssg-save-indicator", r = "ssg-save-failed-chip", i = 1300, a = 1300, o = 4e3, s = "保存に失敗しました。値を戻しました", c = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&"), l = () => {
|
|
4
|
-
let l = null, u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), f = null, p = null, m = null, h = (e, t) => {
|
|
4
|
+
let l = null, u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), f = null, p = null, m = null, h = /* @__PURE__ */ new Map(), g = null, _ = null, v = null, y = (e, t) => {
|
|
5
5
|
let n = setTimeout(() => {
|
|
6
6
|
u.delete(n), t();
|
|
7
7
|
}, e);
|
|
8
8
|
u.add(n);
|
|
9
|
-
},
|
|
9
|
+
}, b = (t) => {
|
|
10
10
|
let n = l?.scrollContainerRef.current;
|
|
11
11
|
if (!n) return [];
|
|
12
12
|
let r = [];
|
|
@@ -17,62 +17,108 @@ var t = "data-ssg-save", n = "ssg-save-indicator", r = "ssg-save-failed-chip", i
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
return r;
|
|
20
|
-
},
|
|
20
|
+
}, x = (e, t) => {
|
|
21
21
|
let r = e.querySelector(`:scope > .${n}`);
|
|
22
22
|
if (t === null) {
|
|
23
23
|
r?.remove();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
r || (r = document.createElement("span"), r.className = n, r.setAttribute("aria-hidden", "true"), e.appendChild(r)), r.setAttribute("data-kind", t), r.textContent = t === "ok" ? "✓" : t === "failed" ? "✕" : "";
|
|
27
|
-
},
|
|
28
|
-
e.removeAttribute(t),
|
|
29
|
-
},
|
|
30
|
-
f?.remove(), f = null, p !== null && (clearTimeout(p), u.delete(p), p = null), m &&= (m.removeEventListener("scroll",
|
|
31
|
-
},
|
|
32
|
-
|
|
27
|
+
}, S = (e) => {
|
|
28
|
+
e.removeAttribute(t), x(e, null);
|
|
29
|
+
}, C = () => {
|
|
30
|
+
f?.remove(), f = null, p !== null && (clearTimeout(p), u.delete(p), p = null), m &&= (m.removeEventListener("scroll", C), null);
|
|
31
|
+
}, w = (e) => {
|
|
32
|
+
C();
|
|
33
33
|
let t = l?.scrollContainerRef.current, n = l?.shellRef?.current ?? t;
|
|
34
34
|
if (!t || !n) return;
|
|
35
35
|
let i = e.getBoundingClientRect(), a = n.getBoundingClientRect();
|
|
36
|
-
f = document.createElement("div"), f.className = r, f.setAttribute("role", "status"), f.textContent = s, f.style.left = `${Math.max(0, i.left - a.left)}px`, f.style.top = `${i.bottom - a.top + 4}px`, n.appendChild(f), m = t, t.addEventListener("scroll",
|
|
37
|
-
p = null,
|
|
36
|
+
f = document.createElement("div"), f.className = r, f.setAttribute("role", "status"), f.textContent = s, f.style.left = `${Math.max(0, i.left - a.left)}px`, f.style.top = `${i.bottom - a.top + 4}px`, n.appendChild(f), m = t, t.addEventListener("scroll", C, { passive: !0 }), p = setTimeout(() => {
|
|
37
|
+
p = null, C();
|
|
38
38
|
}, o), u.add(p);
|
|
39
|
-
},
|
|
40
|
-
|
|
39
|
+
}, T = () => {
|
|
40
|
+
g?.disconnect(), g = null, _ = null, v !== null && (typeof cancelAnimationFrame == "function" && cancelAnimationFrame(v), d.delete(v), v = null);
|
|
41
|
+
}, E = () => {
|
|
42
|
+
let n = l?.scrollContainerRef.current;
|
|
43
|
+
!n || h.size === 0 || n.querySelectorAll(".ssg-body-row[data-row-key]").forEach((r) => {
|
|
44
|
+
let i = h.get(r.getAttribute("data-row-key") ?? "");
|
|
45
|
+
i && r.querySelectorAll(".ssg-body-cell[data-ssg-col-key]").forEach((r) => {
|
|
46
|
+
i.has(r.getAttribute("data-ssg-col-key") ?? "") && r.getAttribute("data-ssg-save") !== "pending" && !e(n, r) && (r.setAttribute(t, "pending"), x(r, "pending"));
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}, D = () => {
|
|
50
|
+
if (v !== null) return;
|
|
51
|
+
if (typeof requestAnimationFrame != "function") {
|
|
52
|
+
E();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let e = requestAnimationFrame(() => {
|
|
56
|
+
d.delete(e), v === e && (v = null), E();
|
|
57
|
+
});
|
|
58
|
+
v = e, d.add(e);
|
|
59
|
+
}, O = () => {
|
|
60
|
+
let e = l?.scrollContainerRef.current ?? null;
|
|
61
|
+
if (h.size === 0 || !e || typeof MutationObserver != "function") {
|
|
62
|
+
T();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
g && _ === e || (T(), g = new MutationObserver(D), g.observe(e, {
|
|
66
|
+
childList: !0,
|
|
67
|
+
subtree: !0
|
|
68
|
+
}), _ = e);
|
|
69
|
+
}, k = (e) => {
|
|
70
|
+
for (let t of e.cells) {
|
|
71
|
+
let n = String(t.rowKey);
|
|
72
|
+
if (e.state === "pending") {
|
|
73
|
+
let e = h.get(n) ?? /* @__PURE__ */ new Set();
|
|
74
|
+
for (let n of t.columnKeys) e.add(n);
|
|
75
|
+
h.set(n, e);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
let r = h.get(n);
|
|
79
|
+
if (r) {
|
|
80
|
+
for (let e of t.columnKeys) r.delete(e);
|
|
81
|
+
r.size === 0 && h.delete(n);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
O();
|
|
85
|
+
}, A = (e) => {
|
|
86
|
+
let n = b(e);
|
|
41
87
|
for (let r of n) {
|
|
42
88
|
if (e.state === "cleared") {
|
|
43
|
-
|
|
89
|
+
S(r);
|
|
44
90
|
continue;
|
|
45
91
|
}
|
|
46
|
-
r.setAttribute(t, e.state),
|
|
47
|
-
r.getAttribute("data-ssg-save") === "ok" &&
|
|
48
|
-
}) : e.state === "failed" &&
|
|
49
|
-
r.getAttribute("data-ssg-save") === "failed" &&
|
|
92
|
+
r.setAttribute(t, e.state), x(r, e.state), e.state === "ok" ? y(i, () => {
|
|
93
|
+
r.getAttribute("data-ssg-save") === "ok" && S(r);
|
|
94
|
+
}) : e.state === "failed" && y(a, () => {
|
|
95
|
+
r.getAttribute("data-ssg-save") === "failed" && S(r);
|
|
50
96
|
});
|
|
51
97
|
}
|
|
52
|
-
e.state === "failed" && n.length > 0 &&
|
|
98
|
+
e.state === "failed" && n.length > 0 && w(n[0]);
|
|
53
99
|
};
|
|
54
100
|
return {
|
|
55
101
|
update: (e) => {
|
|
56
|
-
l = e;
|
|
102
|
+
l = e, e.enabled || h.clear(), O();
|
|
57
103
|
},
|
|
58
104
|
handle: (e) => {
|
|
59
105
|
if (!l?.enabled) return;
|
|
60
|
-
if (typeof requestAnimationFrame != "function") {
|
|
61
|
-
|
|
106
|
+
if (k(e), typeof requestAnimationFrame != "function") {
|
|
107
|
+
A(e);
|
|
62
108
|
return;
|
|
63
109
|
}
|
|
64
110
|
let t = requestAnimationFrame(() => {
|
|
65
|
-
d.delete(t),
|
|
111
|
+
d.delete(t), A(e);
|
|
66
112
|
});
|
|
67
113
|
d.add(t);
|
|
68
114
|
},
|
|
69
115
|
dispose: () => {
|
|
70
116
|
for (let e of u) clearTimeout(e);
|
|
71
117
|
if (u.clear(), typeof cancelAnimationFrame == "function") for (let e of d) cancelAnimationFrame(e);
|
|
72
|
-
d.clear(),
|
|
118
|
+
d.clear(), v = null, h.clear(), T(), C();
|
|
73
119
|
let n = l?.scrollContainerRef.current;
|
|
74
120
|
n?.querySelectorAll(`[${t}]`).forEach((t) => {
|
|
75
|
-
e(n, t) ||
|
|
121
|
+
e(n, t) || S(t);
|
|
76
122
|
}), l = null;
|
|
77
123
|
}
|
|
78
124
|
};
|