@ishibashi0112/spreadsheet-grid-core 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/controllers/changeHighlightController.cjs +1 -1
- package/dist/controllers/changeHighlightController.js +54 -49
- package/dist/controllers/clipboardController.cjs +2 -2
- package/dist/controllers/clipboardController.js +71 -76
- package/dist/controllers/columnHeaderDragController.cjs +1 -1
- package/dist/controllers/columnHeaderDragController.js +74 -70
- package/dist/controllers/editController.cjs +1 -1
- package/dist/controllers/editController.js +90 -84
- package/dist/controllers/findController.cjs +1 -1
- package/dist/controllers/findController.js +71 -71
- package/dist/controllers/imeInputController.cjs +1 -1
- package/dist/controllers/imeInputController.js +68 -65
- package/dist/controllers/rowDragController.cjs +1 -1
- package/dist/controllers/rowDragController.d.ts +2 -0
- package/dist/controllers/rowDragController.js +153 -113
- package/dist/controllers/rowEnterController.cjs +1 -1
- package/dist/controllers/rowEnterController.js +49 -47
- package/dist/controllers/saveStatusController.cjs +1 -1
- package/dist/controllers/saveStatusController.js +54 -47
- package/dist/controllers/serverSideRowModel.cjs +1 -1
- package/dist/controllers/serverSideRowModel.js +42 -20
- package/dist/controllers/tooltipController.cjs +1 -1
- package/dist/controllers/tooltipController.js +38 -21
- package/dist/controllers/viewportSyncController.cjs +1 -1
- package/dist/controllers/viewportSyncController.d.ts +2 -1
- package/dist/controllers/viewportSyncController.js +3 -2
- package/dist/engine/columnLayout.cjs +1 -1
- package/dist/engine/columnLayout.d.ts +1 -0
- package/dist/engine/columnLayout.js +12 -11
- package/dist/engine/exportCommands.cjs +1 -1
- package/dist/engine/exportCommands.js +27 -25
- package/dist/engine/filterPopoverCommands.cjs +1 -1
- package/dist/engine/filterPopoverCommands.js +12 -7
- package/dist/engine/gridApi.cjs +1 -1
- package/dist/engine/gridApi.js +2 -2
- package/dist/logic/conditionalFormat.cjs +1 -1
- package/dist/logic/conditionalFormat.js +2 -2
- package/dist/logic/domGuards.cjs +1 -1
- package/dist/logic/domGuards.d.ts +4 -0
- package/dist/logic/domGuards.js +2 -2
- package/dist/logic/editorValues.cjs +1 -1
- package/dist/logic/editorValues.d.ts +2 -0
- package/dist/logic/editorValues.js +11 -2
- package/dist/logic/fillSeries.cjs +1 -1
- package/dist/logic/fillSeries.js +43 -36
- package/dist/logic/find.cjs +1 -1
- package/dist/logic/find.d.ts +1 -0
- package/dist/logic/find.js +6 -6
- package/dist/logic/gridState.cjs +1 -1
- package/dist/logic/gridState.js +72 -55
- package/dist/logic/selectionAggregates.cjs +1 -1
- package/dist/logic/selectionAggregates.js +5 -2
- package/dist/logic/serverSideEdits.cjs +1 -1
- package/dist/logic/serverSideEdits.d.ts +16 -2
- package/dist/logic/serverSideEdits.js +60 -14
- package/dist/model/gridTypes.core.d.ts +8 -5
- package/dist/utils/clipboard.cjs +5 -5
- package/dist/utils/clipboard.d.ts +3 -0
- package/dist/utils/clipboard.js +58 -65
- package/package.json +1 -6
|
@@ -12,14 +12,14 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
12
12
|
let S = null, C = null, w = null, T = {
|
|
13
13
|
x: 0,
|
|
14
14
|
y: 0
|
|
15
|
-
}, E = null, D = !1, O = null, k = null, A = null, j = null, M = null, N =
|
|
15
|
+
}, E = null, D = !1, O = null, k = null, A = null, j = null, M = null, N = null, P = 0, F = () => S?.motion === "live", I = null, L = null, R = null, z = () => [
|
|
16
16
|
S?.leftIndicatorRef.current ?? null,
|
|
17
17
|
S?.centerIndicatorRef.current ?? null,
|
|
18
18
|
S?.rightIndicatorRef.current ?? null
|
|
19
|
-
],
|
|
20
|
-
for (let e of
|
|
21
|
-
},
|
|
22
|
-
if (
|
|
19
|
+
], B = () => {
|
|
20
|
+
for (let e of z()) e && (e.style.display = "none");
|
|
21
|
+
}, V = (e) => {
|
|
22
|
+
if (I) return;
|
|
23
23
|
let t = document.createElement("div");
|
|
24
24
|
t.setAttribute("data-grid-drag-ghost", ""), S?.scrollContainerRef.current?.closest(".ssg-theme-dark") != null && t.classList.add("ssg-theme-dark"), S?.scrollContainerRef.current?.closest(".ssg-motion-off") != null && t.classList.add("ssg-motion-off"), t.style.cssText = [
|
|
25
25
|
"position:fixed",
|
|
@@ -50,24 +50,24 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
50
50
|
let n = document.createElement("span");
|
|
51
51
|
n.style.cssText = "display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex:none";
|
|
52
52
|
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 =
|
|
53
|
+
r.style.cssText = "overflow:hidden;text-overflow:ellipsis", r.textContent = e, t.appendChild(n), t.appendChild(r), document.body.appendChild(t), I = t, L = n, R = null;
|
|
54
|
+
}, H = (e) => {
|
|
55
|
+
let t = I;
|
|
56
56
|
if (!t) return;
|
|
57
57
|
t.style.transform = "translate(" + (T.x + u) + "px," + (T.y + d) + "px)";
|
|
58
58
|
let n = e ? "move" : "out";
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
let r =
|
|
59
|
+
if (R === n) return;
|
|
60
|
+
R = n;
|
|
61
|
+
let r = L;
|
|
62
62
|
n === "out" ? (t.style.opacity = f, r && (r.innerHTML = m)) : (t.style.opacity = "1", r && (r.innerHTML = p));
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
},
|
|
63
|
+
}, U = () => {
|
|
64
|
+
I && I.parentNode && I.parentNode.removeChild(I), I = null, L = null, R = null;
|
|
65
|
+
}, W = (e, t) => {
|
|
66
66
|
let n = S?.scrollContainerRef.current ?? null;
|
|
67
|
-
!n || e === null || n.querySelectorAll(`.ssg-body-row[data-row-index="${e}"]`).forEach((e) => {
|
|
68
|
-
r(n, e) || (t ? e.setAttribute(v,
|
|
67
|
+
!n || t && e === null || n.querySelectorAll(t ? `.ssg-body-row[data-row-index="${e}"]` : `.ssg-body-row[${v}]`).forEach((e) => {
|
|
68
|
+
r(n, e) || (t ? e.setAttribute(v, F() ? "live" : "") : e.removeAttribute(v));
|
|
69
69
|
});
|
|
70
|
-
},
|
|
70
|
+
}, G = () => {
|
|
71
71
|
let e = S?.scrollContainerRef.current ?? null;
|
|
72
72
|
if (!e) return null;
|
|
73
73
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -79,8 +79,8 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
return t;
|
|
82
|
-
},
|
|
83
|
-
let n =
|
|
82
|
+
}, K = (t) => {
|
|
83
|
+
let n = N, r = C;
|
|
84
84
|
if (!n || r === null || S === null) return;
|
|
85
85
|
let i = S.scrollContainerRef.current;
|
|
86
86
|
if (!i) return;
|
|
@@ -92,20 +92,21 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
92
92
|
baseY: parseFloat(t[1])
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
let a = S.rowMetrics.rowsHeight(r, r), o = (i.scrollTop -
|
|
96
|
-
n.forEach((
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
let a = S.rowMetrics.rowsHeight(r, r), o = (i.scrollTop - P) * S.verticalScaleFactor, s = (E ? T.y - E.y : 0) + o, c = t === null ? null : e(r, t);
|
|
96
|
+
n.forEach((e, t) => {
|
|
97
|
+
let { index: i, baseY: o } = e;
|
|
98
|
+
if (!t.isConnected) {
|
|
99
|
+
n.delete(t);
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
102
|
+
if (i === r) {
|
|
103
|
+
t.style.transition = "none", t.style.transform = `translateY(${o + s}px)`, t.style.willChange = "transform", e.applied = t.style.transform;
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
|
-
let
|
|
106
|
-
c !== null && (r <
|
|
106
|
+
let l = 0;
|
|
107
|
+
c !== null && (r < i && i <= c ? l = -a : c <= i && i < r && (l = a)), t.style.transition = _, t.style.transform = `translateY(${o + l}px)`, e.applied = t.style.transform;
|
|
107
108
|
});
|
|
108
|
-
},
|
|
109
|
+
}, q = (e, r) => {
|
|
109
110
|
if (S === null) return null;
|
|
110
111
|
let { scrollContainerRef: a, bodyScrollRef: o, rowMetrics: s, headerHeight: c, verticalScaleFactor: l, windowBaseOffsetPx: u } = S, d = a.current, f = o.current;
|
|
111
112
|
if (!d || !f) return null;
|
|
@@ -116,19 +117,19 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
116
117
|
slot: g,
|
|
117
118
|
top: c + n(g, s) - u
|
|
118
119
|
};
|
|
119
|
-
},
|
|
120
|
-
let t =
|
|
121
|
-
if (
|
|
122
|
-
t && n !== null && (w = e(n, t.slot) === null ? null : t.slot),
|
|
120
|
+
}, J = () => {
|
|
121
|
+
let t = q(T.x, T.y), n = C;
|
|
122
|
+
if (F()) {
|
|
123
|
+
t && n !== null && (w = e(n, t.slot) === null ? null : t.slot), B(), K(w);
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
|
-
if (
|
|
126
|
-
w = null,
|
|
126
|
+
if (H(t), !t || n === null || e(n, t.slot) === null) {
|
|
127
|
+
w = null, B();
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
w = t.slot;
|
|
130
|
-
for (let e of
|
|
131
|
-
},
|
|
131
|
+
for (let e of z()) e && (e.style.top = `${t.top}px`, e.style.display = "block");
|
|
132
|
+
}, Y = () => {
|
|
132
133
|
if (C === null) {
|
|
133
134
|
A = null;
|
|
134
135
|
return;
|
|
@@ -148,101 +149,140 @@ var u = 14, d = 12, f = "0.5", p = "<svg viewBox=\"0 0 24 24\" width=\"14\" heig
|
|
|
148
149
|
behavior: "auto"
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
|
-
|
|
152
|
-
},
|
|
152
|
+
J(), A = requestAnimationFrame(Y);
|
|
153
|
+
}, X = (e, t) => `${e.getAttribute("data-pane") ?? ""}|${t}`, Z = () => {
|
|
153
154
|
let e = S?.scrollContainerRef.current ?? null;
|
|
154
155
|
if (!e) return null;
|
|
155
156
|
let t = /* @__PURE__ */ new Map();
|
|
156
|
-
for (let n of x(e)) t.set(n, n.getBoundingClientRect().top);
|
|
157
|
+
for (let n of x(e)) t.set(X(n, Number(n.getAttribute("data-row-index"))), n.getBoundingClientRect().top);
|
|
157
158
|
return t;
|
|
158
|
-
},
|
|
159
|
-
A !== null && (cancelAnimationFrame(A), A = null), document.body.style.cursor = "",
|
|
160
|
-
let n = C, r = w;
|
|
161
|
-
|
|
162
|
-
let
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
}, Q = (t) => {
|
|
160
|
+
A !== null && (cancelAnimationFrame(A), A = null), document.body.style.cursor = "", B(), U();
|
|
161
|
+
let n = C, r = w, i = M;
|
|
162
|
+
W(n, !1), C = null, M = null, w = null, E = null, k = null;
|
|
163
|
+
let a = n === null || r === null ? null : e(n, r), o = t && n !== null && a !== null && S !== null, s = N;
|
|
164
|
+
N = null;
|
|
165
|
+
let c = s && o && S !== null && !y(S.scrollContainerRef.current) ? Z() : null;
|
|
166
|
+
if (s) if (o) s.forEach(({ baseY: e }, t) => {
|
|
167
|
+
t.style.transition = "", t.style.willChange = "", t.isConnected && (t.style.transform = `translateY(${e}px)`);
|
|
165
168
|
});
|
|
166
169
|
else {
|
|
167
170
|
let e = [];
|
|
168
|
-
|
|
171
|
+
s.forEach(({ baseY: t }, n) => {
|
|
169
172
|
n.isConnected && (n.style.transition = _, n.style.transform = `translateY(${t}px)`, e.push(n));
|
|
170
173
|
}), window.setTimeout(() => {
|
|
171
174
|
for (let t of e) t.style.transition = "", t.style.willChange = "";
|
|
172
175
|
}, 200);
|
|
173
176
|
}
|
|
174
|
-
!
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
let
|
|
177
|
+
if (!o || n === null || a === null || S === null) return;
|
|
178
|
+
let l = c ?? (y(S.scrollContainerRef.current) ? null : Z()), u = l ? {
|
|
179
|
+
tops: l,
|
|
180
|
+
from: n,
|
|
181
|
+
to: a,
|
|
182
|
+
row: i
|
|
183
|
+
} : null;
|
|
184
|
+
j = u, S.commitRowMove(n, a), u && requestAnimationFrame(() => {
|
|
185
|
+
j === u && (j = null);
|
|
186
|
+
});
|
|
187
|
+
}, $ = () => {
|
|
188
|
+
let e = j;
|
|
189
|
+
if (j = null, !e) return;
|
|
190
|
+
let t = S?.scrollContainerRef.current ?? null;
|
|
191
|
+
if (!t) return;
|
|
192
|
+
let { tops: n, from: r, to: i } = e;
|
|
193
|
+
if (S?.locateDragRow && e.row !== null && S.locateDragRow(e.row, i) !== i) return;
|
|
194
|
+
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
|
+
if (x(t).forEach((e) => {
|
|
196
|
+
let t = n.get(X(e, a(Number(e.getAttribute("data-row-index")))));
|
|
197
|
+
if (t === void 0) return;
|
|
198
|
+
let r = t - e.getBoundingClientRect().top;
|
|
199
|
+
if (Math.abs(r) < .5) return;
|
|
200
|
+
let i = b.exec(e.style.transform);
|
|
201
|
+
if (!i) return;
|
|
202
|
+
let c = parseFloat(i[1]);
|
|
203
|
+
s.set(e, c), e.style.transition = "none", e.style.transform = `translateY(${c + r}px)`, e.style.willChange = "transform", o.push(e);
|
|
204
|
+
}), o.length !== 0) {
|
|
205
|
+
t.getBoundingClientRect();
|
|
206
|
+
for (let e of o) e.style.transition = `transform ${h}ms ${g}`, e.style.transform = `translateY(${s.get(e) ?? 0}px)`;
|
|
207
|
+
window.setTimeout(() => {
|
|
208
|
+
for (let e of o) e.style.transition = "", e.style.willChange = "";
|
|
209
|
+
}, 280);
|
|
210
|
+
}
|
|
211
|
+
}, ee = (e, t) => {
|
|
212
|
+
if (S === null || !S.enabled || t.button !== 0) return;
|
|
213
|
+
if (t.stopPropagation(), t.preventDefault(), C !== null) {
|
|
214
|
+
if (t.pointerId !== k) return;
|
|
215
|
+
O?.(), Q(!1);
|
|
216
|
+
}
|
|
217
|
+
C = e, M = S.getDragRow?.(e) ?? null, k = t.pointerId, w = null, T = {
|
|
218
|
+
x: t.clientX,
|
|
219
|
+
y: t.clientY
|
|
220
|
+
}, E = {
|
|
221
|
+
x: t.clientX,
|
|
222
|
+
y: t.clientY
|
|
223
|
+
}, D = !1, document.body.style.cursor = "grabbing", F() ? (N = G(), P = S.scrollContainerRef.current?.scrollTop ?? 0) : V(S.getRowDragLabel(e)), W(e, !0);
|
|
224
|
+
let n = t.currentTarget, r = t.pointerId;
|
|
225
|
+
try {
|
|
226
|
+
n.setPointerCapture(r);
|
|
227
|
+
} catch {}
|
|
228
|
+
let i = (e) => {
|
|
229
|
+
e.pointerId === r && (T = {
|
|
230
|
+
x: e.clientX,
|
|
231
|
+
y: e.clientY
|
|
232
|
+
}, J());
|
|
233
|
+
}, a = () => {
|
|
234
|
+
window.removeEventListener("pointermove", i), window.removeEventListener("pointerup", o), window.removeEventListener("pointercancel", s), window.removeEventListener("keydown", c), window.removeEventListener("blur", l), O = null;
|
|
194
235
|
try {
|
|
195
|
-
n.
|
|
236
|
+
n.releasePointerCapture(r);
|
|
196
237
|
} catch {}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
a(), X(!1);
|
|
238
|
+
};
|
|
239
|
+
function o(e) {
|
|
240
|
+
e.pointerId === r && (a(), Q(!0));
|
|
241
|
+
}
|
|
242
|
+
function s(e) {
|
|
243
|
+
e.pointerId === r && (a(), Q(!1));
|
|
244
|
+
}
|
|
245
|
+
function c(e) {
|
|
246
|
+
e.key === "Escape" && (a(), Q(!1));
|
|
247
|
+
}
|
|
248
|
+
function l() {
|
|
249
|
+
a(), Q(!1);
|
|
250
|
+
}
|
|
251
|
+
window.addEventListener("pointermove", i), window.addEventListener("pointerup", o), window.addEventListener("pointercancel", s), window.addEventListener("keydown", c), window.addEventListener("blur", l), O = a, J(), A = requestAnimationFrame(Y);
|
|
252
|
+
}, te = (e) => {
|
|
253
|
+
if (C === null || M == null || S?.locateDragRow === void 0) return;
|
|
254
|
+
let t = S.locateDragRow(M, C);
|
|
255
|
+
if (N && N.forEach((e, t) => {
|
|
256
|
+
if (!t.isConnected) {
|
|
257
|
+
N?.delete(t);
|
|
258
|
+
return;
|
|
219
259
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
if (!t) return;
|
|
227
|
-
let n = [], r = /* @__PURE__ */ new Map();
|
|
228
|
-
if (e.forEach((e, t) => {
|
|
229
|
-
if (!t.isConnected) return;
|
|
230
|
-
let i = e - t.getBoundingClientRect().top;
|
|
231
|
-
if (Math.abs(i) < .5) return;
|
|
232
|
-
let a = b.exec(t.style.transform);
|
|
233
|
-
if (!a) return;
|
|
234
|
-
let o = parseFloat(a[1]);
|
|
235
|
-
r.set(t, o), t.style.transition = "none", t.style.transform = `translateY(${o + i}px)`, t.style.willChange = "transform", n.push(t);
|
|
236
|
-
}), n.length !== 0) {
|
|
237
|
-
t.getBoundingClientRect();
|
|
238
|
-
for (let e of n) e.style.transition = `transform ${h}ms ${g}`, e.style.transform = `translateY(${r.get(e) ?? 0}px)`;
|
|
239
|
-
window.setTimeout(() => {
|
|
240
|
-
for (let e of n) e.style.transition = "", e.style.willChange = "";
|
|
241
|
-
}, 280);
|
|
260
|
+
let n = Number(t.getAttribute("data-row-index"));
|
|
261
|
+
if (n === e.index && (e.applied === void 0 || t.style.transform === e.applied)) return;
|
|
262
|
+
let r = b.exec(t.style.transform);
|
|
263
|
+
if (!r) {
|
|
264
|
+
N?.delete(t);
|
|
265
|
+
return;
|
|
242
266
|
}
|
|
267
|
+
e.index = n, e.baseY = parseFloat(r[1]), e.applied = void 0;
|
|
268
|
+
}), t === null) {
|
|
269
|
+
O?.(), Q(!1);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
N && t !== C && E !== null && e !== null && (E = {
|
|
273
|
+
x: E.x,
|
|
274
|
+
y: E.y + S.rowMetrics.rowTop(t) - e.rowTop(C)
|
|
275
|
+
}), t !== C && (W(null, !1), C = t, W(t, !0)), J();
|
|
276
|
+
};
|
|
277
|
+
return {
|
|
278
|
+
update: (e) => {
|
|
279
|
+
let t = S;
|
|
280
|
+
S = e, C !== null && t !== null && t.locateDragRow !== e.locateDragRow && te(t.rowMetrics);
|
|
243
281
|
},
|
|
282
|
+
onRowDragHandlePointerDown: ee,
|
|
283
|
+
applyReorderSettle: $,
|
|
244
284
|
dispose: () => {
|
|
245
|
-
O?.(), O = null, A !== null && (cancelAnimationFrame(A), A = null), document.body.style.cursor = "",
|
|
285
|
+
O?.(), O = null, A !== null && (cancelAnimationFrame(A), A = null), document.body.style.cursor = "", U(), W(C, !1), C = null, M = null, w = null, N = null, j = null;
|
|
246
286
|
}
|
|
247
287
|
};
|
|
248
288
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var
|
|
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`)),o=/(?:^|;)\s*transform\s*:\s*([^;]+)/,s=e=>{if(!e)return null;let t=o.exec(e);return t?t[1].trim():null},c=e=>e instanceof HTMLElement&&e.classList.contains(`ssg-body-row`),l=`ssg-scroll-container--scrolling`,u=()=>{let r=null,o=null,u=!1,d={skeletonEnter:!1,mountEnter:!1},f=new Map,p=e=>{e.classList.remove(t),e.style.removeProperty(n);let r=f.get(e);r!==void 0&&(clearTimeout(r),f.delete(e))},m=(e,r)=>{e.style.setProperty(n,String(r)),e.classList.add(t);let a=()=>{e.removeEventListener(`animationend`,a),p(e)};e.addEventListener(`animationend`,a),f.set(e,setTimeout(()=>{e.removeEventListener(`animationend`,a),p(e)},i))},h=(e,t)=>{let n=[];for(let r of e){if(r.style.transition)continue;let e=s(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;o?.getBoundingClientRect();for(let{el:e,to:t}of n)e.style.transform=t}},g=t=>c(t)&&(o===null||!e.isInsideDetailCardOf(o,t)),_=t=>{let n=new Set,r=new Map,i=new Set,s=[];for(let l of t){if(l.type===`attributes`){let e=l.target;g(e)&&!r.has(e)&&r.set(e,l.oldValue);continue}let t=o!==null&&l.target instanceof Element&&e.isInsideDetailCardOf(o,l.target);l.removedNodes.forEach(e=>{t||!c(e)||(e.hasAttribute(`data-skeleton-row`)?n.add(a(e)):i.add(e))}),l.addedNodes.forEach(e=>{g(e)&&!e.hasAttribute(`data-skeleton-row`)&&s.push(e)})}if(s.length===0)return;let u=o?.classList.contains(l)===!0;d.mountEnter&&!u&&h(s.filter(e=>i.has(e)),r);let f=s.filter(e=>d.mountEnter&&!u&&!i.has(e)||d.skeletonEnter&&n.has(a(e)));if(f.length===0)return;let p=Array.from(new Set(f.map(a))).sort((e,t)=>e-t),_=new Map;p.forEach((e,t)=>{_.set(e,Math.min(t,12))});for(let e of f)m(e,_.get(a(e))??0)},v=()=>{r?.disconnect(),r=null,o=null,u=!1;for(let e of Array.from(f.keys()))p(e)};return{update:({scrollContainerRef:e,skeletonEnter:t,mountEnter:n})=>{d={skeletonEnter:t,mountEnter:n};let i=t||n?e.current:null;i===o&&n===u||(v(),!(!i||typeof MutationObserver>`u`)&&(r=new MutationObserver(_),r.observe(i,n?{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`style`],attributeOldValue:!0}:{childList:!0,subtree:!0}),o=i,u=n))},dispose:v}};exports.ROW_ENTER_CLASS_NAME=t,exports.ROW_ENTER_FALLBACK_MS=i,exports.ROW_ENTER_INDEX_VAR=n,exports.ROW_ENTER_STAGGER_CAP=r,exports.createRowEnterController=u,exports.transformOfStyleText=s;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
+
import { isInsideDetailCardOf as e } from "../logic/detailRow.js";
|
|
1
2
|
//#region src/controllers/rowEnterController.ts
|
|
2
|
-
var
|
|
3
|
+
var t = "ssg-body-row--enter", n = "--ssg-row-enter-index", r = 12, i = 1500, a = (e) => Number(e.getAttribute("data-row-index")), o = /(?:^|;)\s*transform\s*:\s*([^;]+)/, s = (e) => {
|
|
3
4
|
if (!e) return null;
|
|
4
|
-
let t =
|
|
5
|
+
let t = o.exec(e);
|
|
5
6
|
return t ? t[1].trim() : null;
|
|
6
|
-
},
|
|
7
|
-
let
|
|
7
|
+
}, c = (e) => e instanceof HTMLElement && e.classList.contains("ssg-body-row"), l = "ssg-scroll-container--scrolling", u = () => {
|
|
8
|
+
let r = null, o = null, u = !1, d = {
|
|
8
9
|
skeletonEnter: !1,
|
|
9
10
|
mountEnter: !1
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
let r =
|
|
13
|
-
r !== void 0 && (clearTimeout(r),
|
|
14
|
-
},
|
|
15
|
-
|
|
11
|
+
}, f = /* @__PURE__ */ new Map(), p = (e) => {
|
|
12
|
+
e.classList.remove(t), e.style.removeProperty(n);
|
|
13
|
+
let r = f.get(e);
|
|
14
|
+
r !== void 0 && (clearTimeout(r), f.delete(e));
|
|
15
|
+
}, m = (e, r) => {
|
|
16
|
+
e.style.setProperty(n, String(r)), e.classList.add(t);
|
|
16
17
|
let a = () => {
|
|
17
|
-
|
|
18
|
+
e.removeEventListener("animationend", a), p(e);
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
},
|
|
20
|
+
e.addEventListener("animationend", a), f.set(e, setTimeout(() => {
|
|
21
|
+
e.removeEventListener("animationend", a), p(e);
|
|
22
|
+
}, i));
|
|
23
|
+
}, h = (e, t) => {
|
|
23
24
|
let n = [];
|
|
24
25
|
for (let r of e) {
|
|
25
26
|
if (r.style.transition) continue;
|
|
26
|
-
let e =
|
|
27
|
+
let e = s(t.get(r) ?? null), i = r.style.transform;
|
|
27
28
|
!e || !i || e === i || n.push({
|
|
28
29
|
el: r,
|
|
29
30
|
from: e,
|
|
@@ -32,45 +33,46 @@ var e = "ssg-body-row--enter", t = "--ssg-row-enter-index", n = 12, r = 1500, i
|
|
|
32
33
|
}
|
|
33
34
|
if (n.length !== 0) {
|
|
34
35
|
for (let { el: e, from: t } of n) e.style.transform = t;
|
|
35
|
-
|
|
36
|
+
o?.getBoundingClientRect();
|
|
36
37
|
for (let { el: e, to: t } of n) e.style.transform = t;
|
|
37
38
|
}
|
|
38
|
-
},
|
|
39
|
-
let
|
|
40
|
-
for (let
|
|
41
|
-
if (
|
|
42
|
-
let e =
|
|
43
|
-
|
|
39
|
+
}, g = (t) => c(t) && (o === null || !e(o, t)), _ = (t) => {
|
|
40
|
+
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [];
|
|
41
|
+
for (let l of t) {
|
|
42
|
+
if (l.type === "attributes") {
|
|
43
|
+
let e = l.target;
|
|
44
|
+
g(e) && !r.has(e) && r.set(e, l.oldValue);
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
let t = o !== null && l.target instanceof Element && e(o, l.target);
|
|
48
|
+
l.removedNodes.forEach((e) => {
|
|
49
|
+
t || !c(e) || (e.hasAttribute("data-skeleton-row") ? n.add(a(e)) : i.add(e));
|
|
50
|
+
}), l.addedNodes.forEach((e) => {
|
|
51
|
+
g(e) && !e.hasAttribute("data-skeleton-row") && s.push(e);
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
|
-
if (
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
if (
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
if (s.length === 0) return;
|
|
55
|
+
let u = o?.classList.contains(l) === !0;
|
|
56
|
+
d.mountEnter && !u && h(s.filter((e) => i.has(e)), r);
|
|
57
|
+
let f = s.filter((e) => d.mountEnter && !u && !i.has(e) || d.skeletonEnter && n.has(a(e)));
|
|
58
|
+
if (f.length === 0) return;
|
|
59
|
+
let p = Array.from(new Set(f.map(a))).sort((e, t) => e - t), _ = /* @__PURE__ */ new Map();
|
|
60
|
+
p.forEach((e, t) => {
|
|
61
|
+
_.set(e, Math.min(t, 12));
|
|
60
62
|
});
|
|
61
|
-
for (let e of
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
for (let e of Array.from(
|
|
63
|
+
for (let e of f) m(e, _.get(a(e)) ?? 0);
|
|
64
|
+
}, v = () => {
|
|
65
|
+
r?.disconnect(), r = null, o = null, u = !1;
|
|
66
|
+
for (let e of Array.from(f.keys())) p(e);
|
|
65
67
|
};
|
|
66
68
|
return {
|
|
67
|
-
update: ({ scrollContainerRef: e, skeletonEnter: t, mountEnter:
|
|
68
|
-
|
|
69
|
+
update: ({ scrollContainerRef: e, skeletonEnter: t, mountEnter: n }) => {
|
|
70
|
+
d = {
|
|
69
71
|
skeletonEnter: t,
|
|
70
|
-
mountEnter:
|
|
72
|
+
mountEnter: n
|
|
71
73
|
};
|
|
72
|
-
let i = t ||
|
|
73
|
-
i ===
|
|
74
|
+
let i = t || n ? e.current : null;
|
|
75
|
+
i === o && n === u || (v(), !(!i || typeof MutationObserver > "u") && (r = new MutationObserver(_), r.observe(i, n ? {
|
|
74
76
|
childList: !0,
|
|
75
77
|
subtree: !0,
|
|
76
78
|
attributes: !0,
|
|
@@ -79,10 +81,10 @@ var e = "ssg-body-row--enter", t = "--ssg-row-enter-index", n = 12, r = 1500, i
|
|
|
79
81
|
} : {
|
|
80
82
|
childList: !0,
|
|
81
83
|
subtree: !0
|
|
82
|
-
}),
|
|
84
|
+
}), o = i, u = n));
|
|
83
85
|
},
|
|
84
|
-
dispose:
|
|
86
|
+
dispose: v
|
|
85
87
|
};
|
|
86
88
|
};
|
|
87
89
|
//#endregion
|
|
88
|
-
export {
|
|
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, u as createRowEnterController, s as transformOfStyleText };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var
|
|
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)},g=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},_=(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`?`✕`:``},v=e=>{e.removeAttribute(t),_(e,null)},y=()=>{f?.remove(),f=null,p!==null&&(clearTimeout(p),u.delete(p),p=null),m&&=(m.removeEventListener(`scroll`,y),null)},b=e=>{y();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`,y,{passive:!0}),p=setTimeout(()=>{p=null,y()},o),u.add(p)},x=e=>{let n=g(e);for(let r of n){if(e.state===`cleared`){v(r);continue}r.setAttribute(t,e.state),_(r,e.state),e.state===`ok`?h(i,()=>{r.getAttribute(`data-ssg-save`)===`ok`&&v(r)}):e.state===`failed`&&h(a,()=>{r.getAttribute(`data-ssg-save`)===`failed`&&v(r)})}e.state===`failed`&&n.length>0&&b(n[0])};return{update:e=>{l=e},handle:e=>{if(!l?.enabled)return;if(typeof requestAnimationFrame!=`function`){x(e);return}let t=requestAnimationFrame(()=>{d.delete(t),x(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(),y();let n=l?.scrollContainerRef.current;n?.querySelectorAll(`[${t}]`).forEach(t=>{e.isInsideDetailCardOf(n,t)||v(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;
|