@gridsheet/react-core 3.0.6 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CellStateOverlay.d.ts.map +1 -1
- package/dist/components/GridSheet.d.ts.map +1 -1
- package/dist/components/StoreObserver.d.ts +3 -1
- package/dist/components/StoreObserver.d.ts.map +1 -1
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/{hooks-CcD8I6FA.mjs → hooks-CvkA2lFB.mjs} +403 -364
- package/dist/hooks-CvkA2lFB.mjs.map +1 -0
- package/dist/index.js +841 -821
- package/dist/index.js.map +1 -1
- package/dist/spellbook.js +1 -1
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/types.d.ts +9 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/hooks-CcD8I6FA.mjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { x2c as ne, y2r as se, a2p as $, Autofill as ie, areaToZone as L, zoneToArea as z, areaDiff as G, restrictZone as U, matrixShape as oe, superposeArea as re, p2a as ce, operations as K, DEFAULT_HEIGHT as F, DEFAULT_WIDTH as k, smartScroll as J, createBook as
|
|
3
|
-
const
|
|
1
|
+
import { useRef as V, useEffect as O, useState as N } from "react";
|
|
2
|
+
import { x2c as ne, y2r as se, a2p as $, Autofill as ie, areaToZone as L, zoneToArea as z, areaDiff as G, restrictZone as U, matrixShape as oe, superposeArea as re, p2a as ce, operations as K, DEFAULT_HEIGHT as F, DEFAULT_WIDTH as k, smartScroll as J, createBook as ae } from "@gridsheet/core";
|
|
3
|
+
const p = (o) => {
|
|
4
4
|
const e = { ...o };
|
|
5
5
|
return e.selectingZone != null && e.selectingZone.endY === -1 && e.selectingZone.endX === -1 && delete e.selectingZone, e;
|
|
6
6
|
}, W = (o, e) => {
|
|
7
7
|
const { choosing: s, selectingZone: t } = o;
|
|
8
|
-
let { y: n, x: i } = s, { startY: r, startX:
|
|
9
|
-
const [
|
|
10
|
-
return n >
|
|
8
|
+
let { y: n, x: i } = s, { startY: r, startX: a, endY: c, endX: d } = t;
|
|
9
|
+
const [l, u] = [e.numRows, e.numCols];
|
|
10
|
+
return n > l && (n = l), i > u && (i = u), r > l && (r = l), c > l && (c = l), a > u && (a = u), d > u && (d = u), {
|
|
11
11
|
choosing: { y: n, x: i },
|
|
12
|
-
selectingZone: { startY: r, startX:
|
|
12
|
+
selectingZone: { startY: r, startX: a, endY: c, endX: d }
|
|
13
13
|
};
|
|
14
|
-
}, _ = "gs-flash-overlay--active",
|
|
15
|
-
o && (o.classList.remove(_), o.offsetWidth, o.classList.add(_), setTimeout(() => o.classList.remove(_),
|
|
14
|
+
}, _ = "gs-flash-overlay--active", le = 600, D = (o) => {
|
|
15
|
+
o && (o.classList.remove(_), o.offsetWidth, o.classList.add(_), setTimeout(() => o.classList.remove(_), le));
|
|
16
16
|
}, ee = (o, e, s) => ({
|
|
17
17
|
...o,
|
|
18
18
|
sheetReactive: { current: e },
|
|
@@ -24,52 +24,52 @@ const y = (o) => {
|
|
|
24
24
|
let { choosing: r } = e;
|
|
25
25
|
if (!s)
|
|
26
26
|
return { matchingCells: [] };
|
|
27
|
-
const
|
|
27
|
+
const a = [];
|
|
28
28
|
let c;
|
|
29
29
|
if (n)
|
|
30
30
|
try {
|
|
31
|
-
const
|
|
32
|
-
c = (
|
|
31
|
+
const R = t ? "" : "i", h = new RegExp(s, R);
|
|
32
|
+
c = (w) => h.test(w);
|
|
33
33
|
} catch {
|
|
34
|
-
const
|
|
35
|
-
c = (
|
|
34
|
+
const h = t ? s : s.toLowerCase();
|
|
35
|
+
c = (w) => (t ? w : w.toLowerCase()).indexOf(h) !== -1;
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
const
|
|
39
|
-
c = (
|
|
40
|
-
}
|
|
41
|
-
let
|
|
42
|
-
i && (
|
|
43
|
-
for (let
|
|
44
|
-
for (let
|
|
45
|
-
const
|
|
46
|
-
c(
|
|
38
|
+
const R = t ? s : s.toLowerCase();
|
|
39
|
+
c = (h) => (t ? h : h.toLowerCase()).indexOf(R) !== -1;
|
|
40
|
+
}
|
|
41
|
+
let d = 1, l = o.bottom, u = 1, g = o.right;
|
|
42
|
+
i && (d = i.startY, l = i.endY, u = i.startX, g = i.endX);
|
|
43
|
+
for (let R = d; R <= l; R++)
|
|
44
|
+
for (let h = u; h <= g; h++) {
|
|
45
|
+
const w = o.getSerializedValue({ point: { y: R, x: h } });
|
|
46
|
+
c(w) && a.push(`${ne(h)}${se(R)}`);
|
|
47
47
|
}
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
r = $(
|
|
48
|
+
const S = a.length === e.matchingCells.length ? e.matchingCellIndex : 0;
|
|
49
|
+
if (a.length > 0) {
|
|
50
|
+
const R = a[S];
|
|
51
|
+
r = $(R);
|
|
52
52
|
}
|
|
53
|
-
return { matchingCells:
|
|
53
|
+
return { matchingCells: a, searchQuery: s, matchingCellIndex: S, choosing: r };
|
|
54
54
|
}, Zt = (o) => {
|
|
55
55
|
const { sheetId: e, sheetReactive: s } = o, t = s.current;
|
|
56
56
|
return !t || e === t.registry.editingSheetId ? !1 : !!t.registry.editingAddress;
|
|
57
|
-
}, E = { startY: -1, startX: -1, endY: -1, endX: -1 },
|
|
58
|
-
var
|
|
59
|
-
const s =
|
|
57
|
+
}, E = { startY: -1, startX: -1, endY: -1, endX: -1 }, j = {}, Xt = (o, e) => {
|
|
58
|
+
var a, c;
|
|
59
|
+
const s = j[e.type];
|
|
60
60
|
if (s == null)
|
|
61
61
|
return o;
|
|
62
|
-
const t = (
|
|
62
|
+
const t = (a = o.sheetReactive.current) == null ? void 0 : a.registry;
|
|
63
63
|
if ((c = t == null ? void 0 : t._strictModeCache) != null && c.has(e)) {
|
|
64
|
-
const
|
|
65
|
-
return t._strictModeCache.delete(e),
|
|
64
|
+
const d = t._strictModeCache.get(e);
|
|
65
|
+
return t._strictModeCache.delete(e), d;
|
|
66
66
|
}
|
|
67
67
|
const { callback: n, ...i } = s.reduce(o, e.value);
|
|
68
68
|
n == null || n(i);
|
|
69
69
|
const r = { ...o, ...i };
|
|
70
70
|
return t && (t._strictModeCache || (t._strictModeCache = /* @__PURE__ */ new Map()), t._strictModeCache.set(e, r), queueMicrotask(() => {
|
|
71
|
-
var
|
|
72
|
-
(
|
|
71
|
+
var d;
|
|
72
|
+
(d = t._strictModeCache) == null || d.delete(e);
|
|
73
73
|
})), r;
|
|
74
74
|
}, B = class B {
|
|
75
75
|
constructor() {
|
|
@@ -85,16 +85,16 @@ const y = (o) => {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
bind() {
|
|
88
|
-
return this.actionId = B.head++,
|
|
88
|
+
return this.actionId = B.head++, j[this.actionId] = this, this.call.bind(this);
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
B.head = 1;
|
|
92
|
-
let
|
|
92
|
+
let f = B;
|
|
93
93
|
const Mt = (o) => {
|
|
94
94
|
var e;
|
|
95
|
-
return ((e =
|
|
95
|
+
return ((e = j[o]) == null ? void 0 : e.mutation) === !0;
|
|
96
96
|
};
|
|
97
|
-
class
|
|
97
|
+
class ue extends f {
|
|
98
98
|
reduce(e, s) {
|
|
99
99
|
const t = s, { sheetReactive: n } = e;
|
|
100
100
|
return n.current == null ? e : {
|
|
@@ -104,8 +104,8 @@ class ae extends h {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
const Et = new
|
|
108
|
-
class
|
|
107
|
+
const Et = new ue().bind();
|
|
108
|
+
class de extends f {
|
|
109
109
|
reduce(e, s) {
|
|
110
110
|
const t = s, { sheetReactive: n } = e;
|
|
111
111
|
return n.current == null ? e : {
|
|
@@ -115,8 +115,8 @@ class le extends h {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
class he extends
|
|
118
|
+
const Ht = new de().bind();
|
|
119
|
+
class he extends f {
|
|
120
120
|
reduce(e, s) {
|
|
121
121
|
const t = s, { sheetReactive: n } = e;
|
|
122
122
|
return n.current == null ? e : {
|
|
@@ -126,8 +126,8 @@ class he extends h {
|
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
const
|
|
130
|
-
class
|
|
129
|
+
const Tt = new he().bind();
|
|
130
|
+
class fe extends f {
|
|
131
131
|
reduce(e, s) {
|
|
132
132
|
const t = s, { sheetReactive: n } = e;
|
|
133
133
|
return n.current == null ? e : {
|
|
@@ -137,8 +137,8 @@ class ge extends h {
|
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
const Ft = new
|
|
141
|
-
class
|
|
140
|
+
const Ft = new fe().bind();
|
|
141
|
+
class ge extends f {
|
|
142
142
|
reduce(e, s) {
|
|
143
143
|
return {
|
|
144
144
|
...e,
|
|
@@ -146,8 +146,8 @@ class fe extends h {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
const kt = new
|
|
150
|
-
class Re extends
|
|
149
|
+
const kt = new ge().bind();
|
|
150
|
+
class Re extends f {
|
|
151
151
|
reduce(e, s) {
|
|
152
152
|
return {
|
|
153
153
|
...e,
|
|
@@ -156,7 +156,7 @@ class Re extends h {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
const Lt = new Re().bind();
|
|
159
|
-
class we extends
|
|
159
|
+
class we extends f {
|
|
160
160
|
reduce(e, s) {
|
|
161
161
|
const t = new ie(e, s), n = t.applied, i = L(t.wholeArea);
|
|
162
162
|
return {
|
|
@@ -172,7 +172,7 @@ class we extends h {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
const Dt = new we().bind();
|
|
175
|
-
class Se extends
|
|
175
|
+
class Se extends f {
|
|
176
176
|
reduce(e, s) {
|
|
177
177
|
return {
|
|
178
178
|
...e,
|
|
@@ -181,7 +181,7 @@ class Se extends h {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
const Pt = new Se().bind();
|
|
184
|
-
class xe extends
|
|
184
|
+
class xe extends f {
|
|
185
185
|
reduce(e, s) {
|
|
186
186
|
return {
|
|
187
187
|
...e,
|
|
@@ -190,7 +190,7 @@ class xe extends h {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
const zt = new xe().bind();
|
|
193
|
-
class me extends
|
|
193
|
+
class me extends f {
|
|
194
194
|
reduce(e, s) {
|
|
195
195
|
return {
|
|
196
196
|
...e,
|
|
@@ -199,7 +199,7 @@ class me extends h {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
const Bt = new me().bind();
|
|
202
|
-
class ye extends
|
|
202
|
+
class ye extends f {
|
|
203
203
|
reduce(e, s) {
|
|
204
204
|
return {
|
|
205
205
|
...e,
|
|
@@ -208,7 +208,7 @@ class ye extends h {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
const Wt = new ye().bind();
|
|
211
|
-
class pe extends
|
|
211
|
+
class pe extends f {
|
|
212
212
|
reduce(e, s) {
|
|
213
213
|
return {
|
|
214
214
|
...e,
|
|
@@ -219,7 +219,7 @@ class pe extends h {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
const ve = new pe().bind();
|
|
222
|
-
class be extends
|
|
222
|
+
class be extends f {
|
|
223
223
|
reduce(e, s) {
|
|
224
224
|
return {
|
|
225
225
|
...e,
|
|
@@ -228,7 +228,7 @@ class be extends h {
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
const Ut = new be().bind();
|
|
231
|
-
class Ae extends
|
|
231
|
+
class Ae extends f {
|
|
232
232
|
reduce(e, s) {
|
|
233
233
|
return {
|
|
234
234
|
...e,
|
|
@@ -237,7 +237,7 @@ class Ae extends h {
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
const _t = new Ae().bind();
|
|
240
|
-
class Ce extends
|
|
240
|
+
class Ce extends f {
|
|
241
241
|
reduce(e, s) {
|
|
242
242
|
return {
|
|
243
243
|
...e,
|
|
@@ -245,8 +245,8 @@ class Ce extends h {
|
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
class
|
|
248
|
+
const Ye = new Ce().bind();
|
|
249
|
+
class Ie extends f {
|
|
250
250
|
reduce(e, s) {
|
|
251
251
|
const { sheetReactive: t } = e, n = t.current;
|
|
252
252
|
return n ? {
|
|
@@ -261,8 +261,8 @@ class Ye extends h {
|
|
|
261
261
|
} : e;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
const Ze = new
|
|
265
|
-
class Xe extends
|
|
264
|
+
const Ze = new Ie().bind();
|
|
265
|
+
class Xe extends f {
|
|
266
266
|
constructor() {
|
|
267
267
|
super(...arguments), this.mutation = !0;
|
|
268
268
|
}
|
|
@@ -281,7 +281,7 @@ class Xe extends h {
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
const Me = new Xe().bind();
|
|
284
|
-
class Ee extends
|
|
284
|
+
class Ee extends f {
|
|
285
285
|
constructor() {
|
|
286
286
|
super(...arguments), this.mutation = !0;
|
|
287
287
|
}
|
|
@@ -289,13 +289,13 @@ class Ee extends h {
|
|
|
289
289
|
const { choosing: t, selectingZone: n, sheetReactive: i } = e, r = i.current;
|
|
290
290
|
if (!r)
|
|
291
291
|
return e;
|
|
292
|
-
const { registry:
|
|
292
|
+
const { registry: a } = r, { copyingSheetId: c, copyingZone: d, cutting: l } = a, u = r.getSheetBySheetId(c);
|
|
293
293
|
let g = z(n);
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
if (!
|
|
294
|
+
const S = z(d), { matrix: R, onlyValue: h } = s;
|
|
295
|
+
if (l) {
|
|
296
|
+
if (!u)
|
|
297
297
|
return e;
|
|
298
|
-
const
|
|
298
|
+
const I = S, { rows: C, cols: v } = G(S), x = g.top !== -1 ? {
|
|
299
299
|
top: g.top,
|
|
300
300
|
left: g.left,
|
|
301
301
|
bottom: g.top + C,
|
|
@@ -305,108 +305,108 @@ class Ee extends h {
|
|
|
305
305
|
left: t.x,
|
|
306
306
|
bottom: t.y + C,
|
|
307
307
|
right: t.x + v
|
|
308
|
-
},
|
|
309
|
-
srcSheet:
|
|
310
|
-
src:
|
|
311
|
-
dst:
|
|
308
|
+
}, y = U(L(x)), X = r.move({
|
|
309
|
+
srcSheet: u,
|
|
310
|
+
src: I,
|
|
311
|
+
dst: x,
|
|
312
312
|
operator: "USER",
|
|
313
|
-
undoReflection:
|
|
314
|
-
sheetId:
|
|
315
|
-
selectingZone:
|
|
313
|
+
undoReflection: p({
|
|
314
|
+
sheetId: u.id,
|
|
315
|
+
selectingZone: y,
|
|
316
316
|
choosing: t,
|
|
317
|
-
transmit: { copyingSheetId:
|
|
317
|
+
transmit: { copyingSheetId: u.id, copyingZone: d, cutting: !0 }
|
|
318
318
|
}),
|
|
319
|
-
redoReflection:
|
|
320
|
-
sheetId:
|
|
319
|
+
redoReflection: p({
|
|
320
|
+
sheetId: u.id,
|
|
321
321
|
choosing: t,
|
|
322
|
-
transmit: { copyingSheetId:
|
|
322
|
+
transmit: { copyingSheetId: u.id, copyingZone: E }
|
|
323
323
|
})
|
|
324
324
|
});
|
|
325
325
|
return {
|
|
326
326
|
...e,
|
|
327
327
|
...M(X, e),
|
|
328
328
|
sheetReactive: { current: X },
|
|
329
|
-
selectingZone:
|
|
329
|
+
selectingZone: y,
|
|
330
330
|
inputting: X.getSerializedValue({ point: t, resolution: "RAW" }),
|
|
331
|
-
callback: ({ sheetReactive:
|
|
332
|
-
|
|
331
|
+
callback: ({ sheetReactive: T }) => {
|
|
332
|
+
a.transmit({
|
|
333
333
|
cutting: !1,
|
|
334
334
|
copyingZone: E
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
let
|
|
340
|
-
if (
|
|
341
|
-
const { rows:
|
|
339
|
+
let w, { y: m, x: Z } = t;
|
|
340
|
+
if (S.top === -1) {
|
|
341
|
+
const { rows: I, cols: C } = oe({ matrix: R, base: -1 });
|
|
342
342
|
g = {
|
|
343
|
-
top:
|
|
343
|
+
top: m,
|
|
344
344
|
left: Z,
|
|
345
|
-
bottom:
|
|
345
|
+
bottom: m + I,
|
|
346
346
|
right: Z + C
|
|
347
347
|
};
|
|
348
348
|
const v = U(L(g));
|
|
349
|
-
|
|
350
|
-
point: { y:
|
|
351
|
-
matrix:
|
|
352
|
-
onlyValue:
|
|
353
|
-
undoReflection:
|
|
349
|
+
w = r.writeRawCellMatrix({
|
|
350
|
+
point: { y: m, x: Z },
|
|
351
|
+
matrix: R,
|
|
352
|
+
onlyValue: h,
|
|
353
|
+
undoReflection: p({
|
|
354
354
|
sheetId: r.id,
|
|
355
355
|
selectingZone: v,
|
|
356
356
|
choosing: t
|
|
357
357
|
}),
|
|
358
|
-
redoReflection:
|
|
358
|
+
redoReflection: p({
|
|
359
359
|
sheetId: r.id,
|
|
360
360
|
selectingZone: v,
|
|
361
361
|
choosing: t
|
|
362
362
|
})
|
|
363
363
|
});
|
|
364
364
|
} else {
|
|
365
|
-
if (
|
|
365
|
+
if (u == null)
|
|
366
366
|
return e;
|
|
367
|
-
let { rows:
|
|
367
|
+
let { rows: I, cols: C } = G(S);
|
|
368
368
|
if (g.top !== -1) {
|
|
369
|
-
|
|
370
|
-
const v = re(g,
|
|
371
|
-
|
|
369
|
+
m = g.top, Z = g.left;
|
|
370
|
+
const v = re(g, S);
|
|
371
|
+
I = v.rows, C = v.cols;
|
|
372
372
|
}
|
|
373
|
-
g = { top:
|
|
374
|
-
srcSheet:
|
|
375
|
-
src:
|
|
373
|
+
g = { top: m, left: Z, bottom: m + I, right: Z + C }, w = r.copy({
|
|
374
|
+
srcSheet: u,
|
|
375
|
+
src: S,
|
|
376
376
|
dst: g,
|
|
377
|
-
onlyValue:
|
|
377
|
+
onlyValue: h,
|
|
378
378
|
operator: "USER",
|
|
379
|
-
undoReflection:
|
|
380
|
-
sheetId:
|
|
381
|
-
transmit: { copyingZone:
|
|
379
|
+
undoReflection: p({
|
|
380
|
+
sheetId: u.id,
|
|
381
|
+
transmit: { copyingZone: d },
|
|
382
382
|
choosing: t,
|
|
383
383
|
selectingZone: n
|
|
384
384
|
}),
|
|
385
|
-
redoReflection:
|
|
386
|
-
sheetId:
|
|
387
|
-
transmit: { copyingSheetId:
|
|
385
|
+
redoReflection: p({
|
|
386
|
+
sheetId: u.id,
|
|
387
|
+
transmit: { copyingSheetId: u.id, copyingZone: E },
|
|
388
388
|
choosing: t,
|
|
389
389
|
selectingZone: L(g)
|
|
390
390
|
})
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
const
|
|
394
|
-
return
|
|
393
|
+
const Y = U(L(g));
|
|
394
|
+
return Y.endX = Math.min(Y.endX, w.numCols), Y.endY = Math.min(Y.endY, w.numRows), {
|
|
395
395
|
...e,
|
|
396
|
-
sheetReactive: { current:
|
|
397
|
-
selectingZone:
|
|
398
|
-
inputting:
|
|
399
|
-
...M(
|
|
400
|
-
callback: ({ sheetReactive:
|
|
401
|
-
|
|
396
|
+
sheetReactive: { current: w },
|
|
397
|
+
selectingZone: Y,
|
|
398
|
+
inputting: w.getSerializedValue({ point: t, resolution: "RAW" }),
|
|
399
|
+
...M(w, e),
|
|
400
|
+
callback: ({ sheetReactive: I }) => {
|
|
401
|
+
a.transmit({
|
|
402
402
|
copyingZone: E
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
405
|
};
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
class
|
|
408
|
+
const He = new Ee().bind();
|
|
409
|
+
class Te extends f {
|
|
410
410
|
reduce(e, s) {
|
|
411
411
|
const { sheetReactive: t } = e;
|
|
412
412
|
return {
|
|
@@ -423,8 +423,8 @@ class He extends h {
|
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
const Fe = new
|
|
427
|
-
class ke extends
|
|
426
|
+
const Fe = new Te().bind();
|
|
427
|
+
class ke extends f {
|
|
428
428
|
reduce(e, s) {
|
|
429
429
|
return {
|
|
430
430
|
...e,
|
|
@@ -434,7 +434,7 @@ class ke extends h {
|
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
const Le = new ke().bind();
|
|
437
|
-
class De extends
|
|
437
|
+
class De extends f {
|
|
438
438
|
reduce(e, s) {
|
|
439
439
|
return {
|
|
440
440
|
...e,
|
|
@@ -445,59 +445,59 @@ class De extends h {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
const Pe = new De().bind();
|
|
448
|
-
class ze extends
|
|
448
|
+
class ze extends f {
|
|
449
449
|
reduce(e, s) {
|
|
450
|
-
const { range: t, numCols: n } = s, { start: i, end: r } = t,
|
|
450
|
+
const { range: t, numCols: n } = s, { start: i, end: r } = t, a = e.sheetReactive.current, c = {
|
|
451
451
|
startY: i,
|
|
452
452
|
startX: 1,
|
|
453
453
|
endY: r,
|
|
454
454
|
endX: n
|
|
455
455
|
};
|
|
456
|
-
let
|
|
457
|
-
if (
|
|
458
|
-
for (let
|
|
459
|
-
if (!
|
|
460
|
-
|
|
456
|
+
let d = i;
|
|
457
|
+
if (a) {
|
|
458
|
+
for (let l = i; l <= r; l++)
|
|
459
|
+
if (!a.isRowFiltered(l)) {
|
|
460
|
+
d = l;
|
|
461
461
|
break;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
return {
|
|
465
465
|
...e,
|
|
466
466
|
selectingZone: c,
|
|
467
|
-
choosing: { y:
|
|
467
|
+
choosing: { y: d, x: 1 },
|
|
468
468
|
leftHeaderSelecting: !0,
|
|
469
469
|
topHeaderSelecting: !1
|
|
470
470
|
};
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
const Be = new ze().bind();
|
|
474
|
-
class We extends
|
|
474
|
+
class We extends f {
|
|
475
475
|
reduce(e, s) {
|
|
476
|
-
const { range: t, numRows: n } = s, { start: i, end: r } = t,
|
|
476
|
+
const { range: t, numRows: n } = s, { start: i, end: r } = t, a = e.sheetReactive.current, c = {
|
|
477
477
|
startY: 1,
|
|
478
478
|
startX: i,
|
|
479
479
|
endY: n,
|
|
480
480
|
endX: r
|
|
481
481
|
};
|
|
482
|
-
let
|
|
483
|
-
if (
|
|
484
|
-
for (let
|
|
485
|
-
if (!
|
|
486
|
-
|
|
482
|
+
let d = 1;
|
|
483
|
+
if (a) {
|
|
484
|
+
for (let l = 1; l <= n; l++)
|
|
485
|
+
if (!a.isRowFiltered(l)) {
|
|
486
|
+
d = l;
|
|
487
487
|
break;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
return {
|
|
491
491
|
...e,
|
|
492
492
|
selectingZone: c,
|
|
493
|
-
choosing: { y:
|
|
493
|
+
choosing: { y: d, x: i },
|
|
494
494
|
leftHeaderSelecting: !1,
|
|
495
495
|
topHeaderSelecting: !0
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
const Ue = new We().bind();
|
|
500
|
-
class _e extends
|
|
500
|
+
class _e extends f {
|
|
501
501
|
reduce(e, s) {
|
|
502
502
|
const { startY: t, startX: n } = e.selectingZone, i = {
|
|
503
503
|
startY: t,
|
|
@@ -509,7 +509,7 @@ class _e extends h {
|
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
const Oe = new _e().bind();
|
|
512
|
-
class
|
|
512
|
+
class je extends f {
|
|
513
513
|
reduce(e, s) {
|
|
514
514
|
const { matchingCells: t } = e;
|
|
515
515
|
let { matchingCellIndex: n, choosing: i } = e;
|
|
@@ -520,25 +520,25 @@ class qe extends h {
|
|
|
520
520
|
return { ...e, matchingCells: t, matchingCellIndex: n, choosing: i };
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
const
|
|
524
|
-
class
|
|
523
|
+
const qe = new je().bind();
|
|
524
|
+
class Qe extends f {
|
|
525
525
|
reduce(e, s) {
|
|
526
526
|
let { value: t, point: n } = s;
|
|
527
|
-
const { choosing: i, selectingZone: r, sheetReactive:
|
|
527
|
+
const { choosing: i, selectingZone: r, sheetReactive: a } = e;
|
|
528
528
|
n == null && (n = i);
|
|
529
|
-
const c =
|
|
529
|
+
const c = a.current;
|
|
530
530
|
if (!c)
|
|
531
531
|
return e;
|
|
532
|
-
const
|
|
532
|
+
const d = c.write({
|
|
533
533
|
point: n,
|
|
534
534
|
value: t,
|
|
535
535
|
operator: "USER",
|
|
536
|
-
undoReflection:
|
|
536
|
+
undoReflection: p({
|
|
537
537
|
sheetId: c.id,
|
|
538
538
|
selectingZone: r,
|
|
539
539
|
choosing: n
|
|
540
540
|
}),
|
|
541
|
-
redoReflection:
|
|
541
|
+
redoReflection: p({
|
|
542
542
|
sheetId: c.id,
|
|
543
543
|
selectingZone: r,
|
|
544
544
|
choosing: n
|
|
@@ -546,9 +546,9 @@ class Ve extends h {
|
|
|
546
546
|
});
|
|
547
547
|
return {
|
|
548
548
|
...e,
|
|
549
|
-
...M(
|
|
550
|
-
sheetReactive: { current:
|
|
551
|
-
callback: ({ sheetReactive:
|
|
549
|
+
...M(d, e),
|
|
550
|
+
sheetReactive: { current: d },
|
|
551
|
+
callback: ({ sheetReactive: l }) => {
|
|
552
552
|
c.registry.transmit({
|
|
553
553
|
copyingZone: E
|
|
554
554
|
});
|
|
@@ -556,39 +556,39 @@ class Ve extends h {
|
|
|
556
556
|
};
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
class Ge extends
|
|
559
|
+
const Ve = new Qe().bind();
|
|
560
|
+
class Ge extends f {
|
|
561
561
|
constructor() {
|
|
562
562
|
super(...arguments), this.mutation = !0;
|
|
563
563
|
}
|
|
564
564
|
reduce(e, s) {
|
|
565
|
-
var
|
|
565
|
+
var R;
|
|
566
566
|
const { choosing: t, selectingZone: n, sheetReactive: i } = e, r = i.current;
|
|
567
567
|
if (!r)
|
|
568
568
|
return e;
|
|
569
|
-
let
|
|
570
|
-
if (
|
|
571
|
-
const { y:
|
|
572
|
-
|
|
569
|
+
let a = z(n);
|
|
570
|
+
if (a.top === -1) {
|
|
571
|
+
const { y: h, x: w } = t;
|
|
572
|
+
a = { top: h, left: w, bottom: h, right: w };
|
|
573
573
|
}
|
|
574
|
-
const { top: c, left:
|
|
575
|
-
let
|
|
576
|
-
for (let
|
|
577
|
-
if (!r.isRowFiltered(
|
|
578
|
-
for (let
|
|
579
|
-
const
|
|
580
|
-
K.hasOperation(
|
|
574
|
+
const { top: c, left: d, bottom: l, right: u } = a, g = {};
|
|
575
|
+
let S = 0;
|
|
576
|
+
for (let h = c; h <= l; h++)
|
|
577
|
+
if (!r.isRowFiltered(h))
|
|
578
|
+
for (let w = d; w <= u; w++) {
|
|
579
|
+
const m = r.getCell({ y: h, x: w }, { resolution: "SYSTEM" }), Z = ce({ y: h, x: w });
|
|
580
|
+
K.hasOperation(m == null ? void 0 : m.prevention, K.Write) || ((R = r.getSystem({ y: h, x: w })) == null ? void 0 : R.spilledFrom) == null && (m == null ? void 0 : m.value) != null && (g[Z] = { value: void 0 }, S++);
|
|
581
581
|
}
|
|
582
|
-
return
|
|
582
|
+
return S === 0 ? e : (r.update({
|
|
583
583
|
diff: g,
|
|
584
584
|
partial: !0,
|
|
585
585
|
operator: "USER",
|
|
586
|
-
undoReflection:
|
|
586
|
+
undoReflection: p({
|
|
587
587
|
sheetId: r.id,
|
|
588
588
|
selectingZone: n,
|
|
589
589
|
choosing: t
|
|
590
590
|
}),
|
|
591
|
-
redoReflection:
|
|
591
|
+
redoReflection: p({
|
|
592
592
|
sheetId: r.id,
|
|
593
593
|
selectingZone: n,
|
|
594
594
|
choosing: t
|
|
@@ -601,7 +601,7 @@ class Ge extends h {
|
|
|
601
601
|
}
|
|
602
602
|
}
|
|
603
603
|
const Ke = new Ge().bind();
|
|
604
|
-
class Ne extends
|
|
604
|
+
class Ne extends f {
|
|
605
605
|
constructor() {
|
|
606
606
|
super(...arguments), this.mutation = !0;
|
|
607
607
|
}
|
|
@@ -613,8 +613,8 @@ class Ne extends h {
|
|
|
613
613
|
if (i == null)
|
|
614
614
|
return e;
|
|
615
615
|
if (i.dstSheetId !== n.id) {
|
|
616
|
-
const { dispatch:
|
|
617
|
-
return
|
|
616
|
+
const { dispatch: a, store: c } = n.registry.contextsBySheetId[i.dstSheetId];
|
|
617
|
+
return a(
|
|
618
618
|
te({
|
|
619
619
|
...c,
|
|
620
620
|
...i.undoReflection,
|
|
@@ -628,14 +628,14 @@ class Ne extends h {
|
|
|
628
628
|
...i.undoReflection,
|
|
629
629
|
...M(n, e),
|
|
630
630
|
sheetReactive: { current: n },
|
|
631
|
-
callback: (
|
|
632
|
-
r == null || r(
|
|
631
|
+
callback: (a) => {
|
|
632
|
+
r == null || r(a), D(e.flashRef.current);
|
|
633
633
|
}
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
637
|
const $e = new Ne().bind();
|
|
638
|
-
class Je extends
|
|
638
|
+
class Je extends f {
|
|
639
639
|
constructor() {
|
|
640
640
|
super(...arguments), this.mutation = !0;
|
|
641
641
|
}
|
|
@@ -643,18 +643,18 @@ class Je extends h {
|
|
|
643
643
|
const { sheetReactive: t } = e, n = t.current;
|
|
644
644
|
if (n == null)
|
|
645
645
|
return e;
|
|
646
|
-
const { history: i, newSheet: r, callback:
|
|
646
|
+
const { history: i, newSheet: r, callback: a } = n.redo();
|
|
647
647
|
if (i == null)
|
|
648
648
|
return e;
|
|
649
649
|
if (i.dstSheetId !== n.id) {
|
|
650
|
-
const { dispatch: c, store:
|
|
650
|
+
const { dispatch: c, store: d } = n.registry.contextsBySheetId[i.dstSheetId];
|
|
651
651
|
return c(
|
|
652
652
|
te({
|
|
653
|
-
...
|
|
653
|
+
...d,
|
|
654
654
|
...i.redoReflection,
|
|
655
|
-
sheetReactive: { current:
|
|
655
|
+
sheetReactive: { current: d.sheetReactive.current }
|
|
656
656
|
})
|
|
657
|
-
), D(
|
|
657
|
+
), D(d.flashRef.current), i.srcSheetId === n.id ? ee(e, n, a) : e;
|
|
658
658
|
}
|
|
659
659
|
return {
|
|
660
660
|
...e,
|
|
@@ -663,106 +663,106 @@ class Je extends h {
|
|
|
663
663
|
...M(n, e),
|
|
664
664
|
sheetReactive: { current: n },
|
|
665
665
|
callback: (c) => {
|
|
666
|
-
|
|
666
|
+
a == null || a(c), D(e.flashRef.current);
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
const et = new Je().bind();
|
|
672
|
-
class tt extends
|
|
672
|
+
class tt extends f {
|
|
673
673
|
reduce(e, s) {
|
|
674
|
-
var
|
|
675
|
-
const { shiftKey: t, deltaY: n, deltaX: i, numRows: r, numCols:
|
|
676
|
-
if (
|
|
674
|
+
var x, y, X, T;
|
|
675
|
+
const { shiftKey: t, deltaY: n, deltaX: i, numRows: r, numCols: a } = s, { choosing: c, sheetReactive: d, tabularRef: l } = e, u = d.current;
|
|
676
|
+
if (u == null)
|
|
677
677
|
return e;
|
|
678
678
|
let { selectingZone: g } = e;
|
|
679
|
-
const { y:
|
|
679
|
+
const { y: S, x: R } = c;
|
|
680
680
|
if (t) {
|
|
681
681
|
const [b, P] = [
|
|
682
|
-
g.endY === -1 ?
|
|
683
|
-
g.endX === -1 ?
|
|
684
|
-
], [
|
|
685
|
-
return
|
|
682
|
+
g.endY === -1 ? S : g.endY,
|
|
683
|
+
g.endX === -1 ? R : g.endX
|
|
684
|
+
], [H, A] = [b + n, P + i];
|
|
685
|
+
return H < 1 || r < H || A < 1 || a < A ? e : (g = S === H && R === A ? { startY: -1, startX: -1, endY: -1, endX: -1 } : { startY: S, startX: R, endY: H, endX: A }, {
|
|
686
686
|
...e,
|
|
687
687
|
selectingZone: g
|
|
688
688
|
});
|
|
689
689
|
}
|
|
690
|
-
const [
|
|
691
|
-
if (
|
|
690
|
+
const [h, w] = [S + n, R + i];
|
|
691
|
+
if (h < 1 || r < h || w < 1 || a < w)
|
|
692
692
|
return e;
|
|
693
|
-
let
|
|
694
|
-
if (
|
|
693
|
+
let m = h;
|
|
694
|
+
if (u.isRowFiltered(m)) {
|
|
695
695
|
const b = n >= 0 ? 1 : -1;
|
|
696
|
-
for (;
|
|
697
|
-
|
|
698
|
-
if (
|
|
696
|
+
for (; m >= 1 && m <= r && u.isRowFiltered(m); )
|
|
697
|
+
m += b;
|
|
698
|
+
if (m < 1 || m > r)
|
|
699
699
|
return e;
|
|
700
700
|
}
|
|
701
|
-
let { y: Z, x:
|
|
701
|
+
let { y: Z, x: Y, height: I, width: C } = e.editorRect;
|
|
702
702
|
if (n > 0)
|
|
703
|
-
for (let b =
|
|
704
|
-
Z += ((
|
|
703
|
+
for (let b = S; b < m; b++)
|
|
704
|
+
Z += ((x = u.getCell({ y: b, x: 0 }, { resolution: "SYSTEM" })) == null ? void 0 : x.height) || F;
|
|
705
705
|
else if (n < 0)
|
|
706
|
-
for (let b =
|
|
707
|
-
Z -= ((
|
|
706
|
+
for (let b = S - 1; b >= m; b--)
|
|
707
|
+
Z -= ((y = u.getCell({ y: b, x: 0 }, { resolution: "SYSTEM" })) == null ? void 0 : y.height) || F;
|
|
708
708
|
if (i > 0)
|
|
709
|
-
for (let b =
|
|
710
|
-
|
|
709
|
+
for (let b = R; b < w; b++)
|
|
710
|
+
Y += ((X = u.getCell({ y: 0, x: b }, { resolution: "SYSTEM" })) == null ? void 0 : X.width) || k;
|
|
711
711
|
else if (i < 0)
|
|
712
|
-
for (let b =
|
|
713
|
-
|
|
714
|
-
const v =
|
|
715
|
-
return
|
|
712
|
+
for (let b = R - 1; b >= w; b--)
|
|
713
|
+
Y -= ((T = u.getCell({ y: 0, x: b }, { resolution: "SYSTEM" })) == null ? void 0 : T.width) || k;
|
|
714
|
+
const v = u.getCell({ y: m, x: w }, { resolution: "SYSTEM" });
|
|
715
|
+
return I = (v == null ? void 0 : v.height) || F, C = (v == null ? void 0 : v.width) || k, J(u, l.current, { y: m, x: w }), {
|
|
716
716
|
...e,
|
|
717
717
|
selectingZone: { startY: -1, startX: -1, endY: -1, endX: -1 },
|
|
718
|
-
choosing: { y:
|
|
719
|
-
editorRect: { y: Z, x:
|
|
718
|
+
choosing: { y: m, x: w },
|
|
719
|
+
editorRect: { y: Z, x: Y, height: I, width: C }
|
|
720
720
|
};
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
723
|
const nt = new tt().bind();
|
|
724
|
-
class st extends
|
|
724
|
+
class st extends f {
|
|
725
725
|
reduce(e, s) {
|
|
726
|
-
var
|
|
726
|
+
var T, b, P, H;
|
|
727
727
|
const { numRows: t, numCols: n } = s;
|
|
728
728
|
let { deltaY: i, deltaX: r } = s;
|
|
729
|
-
const { choosing:
|
|
730
|
-
if (
|
|
729
|
+
const { choosing: a, selectingZone: c, sheetReactive: d, tabularRef: l } = e, u = d.current;
|
|
730
|
+
if (u == null)
|
|
731
731
|
return e;
|
|
732
|
-
let { y: g, x:
|
|
733
|
-
const { y:
|
|
734
|
-
let [
|
|
735
|
-
if (
|
|
732
|
+
let { y: g, x: S, height: R, width: h } = e.editorRect;
|
|
733
|
+
const { y: w, x: m } = a, Z = z(c), { top: Y, left: I, bottom: C, right: v } = Z;
|
|
734
|
+
let [x, y] = [w + i, m + r];
|
|
735
|
+
if (x < Y && Y !== -1 && (i = C - x, x = C, y > I ? (y--, r--) : (r = v - y, y = v)), x > C && C !== -1 && (i = Y - x, x = Y, y < v ? (y++, r++) : (r = I - y, y = I)), y < I && I !== -1 && (r = v - y, y = v, x > Y ? (x--, i--) : (i = C - x, x = C)), y > v && v !== -1 && (r = I - y, y = I, x < C ? (x++, i++) : (i = Y - x, x = Y)), x < 1 || t < x || y < 1 || n < y)
|
|
736
736
|
return e;
|
|
737
|
-
if (
|
|
738
|
-
const A = i >= 0 ? 1 : -1,
|
|
739
|
-
for (;
|
|
740
|
-
|
|
741
|
-
if (
|
|
737
|
+
if (u.isRowFiltered(x)) {
|
|
738
|
+
const A = i >= 0 ? 1 : -1, q = Y !== -1 ? Y : 1, Q = C !== -1 ? C : t;
|
|
739
|
+
for (; x >= q && x <= Q && u.isRowFiltered(x); )
|
|
740
|
+
x += A;
|
|
741
|
+
if (x < q || x > Q || u.isRowFiltered(x))
|
|
742
742
|
return e;
|
|
743
743
|
}
|
|
744
744
|
if (i > 0)
|
|
745
|
-
for (let A =
|
|
746
|
-
g += ((
|
|
745
|
+
for (let A = w; A < x; A++)
|
|
746
|
+
g += ((T = u.getCell({ y: A, x: 0 }, { resolution: "SYSTEM" })) == null ? void 0 : T.height) || F;
|
|
747
747
|
else if (i < 0)
|
|
748
|
-
for (let A =
|
|
749
|
-
g -= ((b =
|
|
748
|
+
for (let A = w - 1; A >= x; A--)
|
|
749
|
+
g -= ((b = u.getCell({ y: A, x: 0 }, { resolution: "SYSTEM" })) == null ? void 0 : b.height) || F;
|
|
750
750
|
if (r > 0)
|
|
751
|
-
for (let A =
|
|
752
|
-
|
|
751
|
+
for (let A = m; A < y; A++)
|
|
752
|
+
S += ((P = u.getCell({ y: 0, x: A }, { resolution: "SYSTEM" })) == null ? void 0 : P.width) || k;
|
|
753
753
|
else if (r < 0)
|
|
754
|
-
for (let A =
|
|
755
|
-
|
|
756
|
-
const X =
|
|
757
|
-
return
|
|
754
|
+
for (let A = m - 1; A >= y; A--)
|
|
755
|
+
S -= ((H = u.getCell({ y: 0, x: A }, { resolution: "SYSTEM" })) == null ? void 0 : H.width) || k;
|
|
756
|
+
const X = u.getCell({ y: x, x: y }, { resolution: "SYSTEM" });
|
|
757
|
+
return R = (X == null ? void 0 : X.height) || F, h = (X == null ? void 0 : X.width) || k, J(u, l.current, { y: x, x: y }), {
|
|
758
758
|
...e,
|
|
759
|
-
choosing: { y:
|
|
760
|
-
editorRect: { y: g, x:
|
|
759
|
+
choosing: { y: x, x: y },
|
|
760
|
+
editorRect: { y: g, x: S, height: R, width: h }
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
764
|
const it = new st().bind();
|
|
765
|
-
class ot extends
|
|
765
|
+
class ot extends f {
|
|
766
766
|
reduce(e, s) {
|
|
767
767
|
return {
|
|
768
768
|
...e,
|
|
@@ -771,235 +771,274 @@ class ot extends h {
|
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
const Ot = new ot().bind();
|
|
774
|
-
class rt extends
|
|
774
|
+
class rt extends f {
|
|
775
775
|
constructor() {
|
|
776
776
|
super(...arguments), this.mutation = !0;
|
|
777
777
|
}
|
|
778
778
|
reduce(e, s) {
|
|
779
|
-
const { numRows: t, y: n, operator: i } = s, { sheetReactive: r, selectingZone:
|
|
780
|
-
return
|
|
779
|
+
const { numRows: t, y: n, operator: i } = s, { sheetReactive: r, selectingZone: a, choosing: c } = e, d = r.current;
|
|
780
|
+
return d == null ? e : (d.insertRows({
|
|
781
781
|
y: n,
|
|
782
782
|
numRows: t,
|
|
783
783
|
baseY: n,
|
|
784
784
|
operator: i,
|
|
785
|
-
undoReflection:
|
|
786
|
-
sheetId:
|
|
787
|
-
selectingZone:
|
|
785
|
+
undoReflection: p({
|
|
786
|
+
sheetId: d.id,
|
|
787
|
+
selectingZone: a,
|
|
788
788
|
choosing: c
|
|
789
789
|
}),
|
|
790
|
-
redoReflection:
|
|
791
|
-
sheetId:
|
|
792
|
-
selectingZone:
|
|
790
|
+
redoReflection: p({
|
|
791
|
+
sheetId: d.id,
|
|
792
|
+
selectingZone: a,
|
|
793
793
|
choosing: c
|
|
794
794
|
})
|
|
795
795
|
}), {
|
|
796
796
|
...e,
|
|
797
|
-
sheetReactive: { current:
|
|
797
|
+
sheetReactive: { current: d }
|
|
798
798
|
});
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
801
|
const ct = new rt().bind();
|
|
802
|
-
class
|
|
802
|
+
class at extends f {
|
|
803
803
|
constructor() {
|
|
804
804
|
super(...arguments), this.mutation = !0;
|
|
805
805
|
}
|
|
806
806
|
reduce(e, s) {
|
|
807
|
-
const { numRows: t, y: n, operator: i } = s, { sheetReactive: r, selectingZone:
|
|
808
|
-
if (
|
|
807
|
+
const { numRows: t, y: n, operator: i } = s, { sheetReactive: r, selectingZone: a, choosing: c, editorRef: d } = e, l = r.current;
|
|
808
|
+
if (l == null)
|
|
809
809
|
return e;
|
|
810
|
-
const
|
|
811
|
-
...
|
|
812
|
-
startY:
|
|
813
|
-
endY:
|
|
810
|
+
const u = {
|
|
811
|
+
...a,
|
|
812
|
+
startY: a.startY + t,
|
|
813
|
+
endY: a.endY + t
|
|
814
814
|
}, g = { ...c, y: c.y + t };
|
|
815
|
-
return
|
|
815
|
+
return l.insertRows({
|
|
816
816
|
y: n + 1,
|
|
817
817
|
numRows: t,
|
|
818
818
|
baseY: n,
|
|
819
819
|
operator: i,
|
|
820
|
-
undoReflection:
|
|
821
|
-
sheetId:
|
|
822
|
-
selectingZone:
|
|
820
|
+
undoReflection: p({
|
|
821
|
+
sheetId: l.id,
|
|
822
|
+
selectingZone: a,
|
|
823
823
|
choosing: c
|
|
824
824
|
}),
|
|
825
|
-
redoReflection:
|
|
826
|
-
sheetId:
|
|
827
|
-
selectingZone:
|
|
825
|
+
redoReflection: p({
|
|
826
|
+
sheetId: l.id,
|
|
827
|
+
selectingZone: u,
|
|
828
828
|
choosing: g
|
|
829
829
|
})
|
|
830
830
|
}), {
|
|
831
831
|
...e,
|
|
832
|
-
selectingZone:
|
|
832
|
+
selectingZone: u,
|
|
833
833
|
choosing: g,
|
|
834
|
-
sheetReactive: { current:
|
|
834
|
+
sheetReactive: { current: l }
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
|
-
const
|
|
839
|
-
class
|
|
838
|
+
const lt = new at().bind();
|
|
839
|
+
class ut extends f {
|
|
840
840
|
constructor() {
|
|
841
841
|
super(...arguments), this.mutation = !0;
|
|
842
842
|
}
|
|
843
843
|
reduce(e, s) {
|
|
844
|
-
const { numCols: t, x: n, operator: i } = s, { sheetReactive: r, selectingZone:
|
|
845
|
-
return
|
|
844
|
+
const { numCols: t, x: n, operator: i } = s, { sheetReactive: r, selectingZone: a, choosing: c, editorRef: d } = e, l = r.current;
|
|
845
|
+
return l == null ? e : (l.insertCols({
|
|
846
846
|
x: n,
|
|
847
847
|
numCols: t,
|
|
848
848
|
baseX: n,
|
|
849
849
|
operator: i,
|
|
850
|
-
undoReflection:
|
|
851
|
-
sheetId:
|
|
852
|
-
selectingZone:
|
|
850
|
+
undoReflection: p({
|
|
851
|
+
sheetId: l.id,
|
|
852
|
+
selectingZone: a,
|
|
853
853
|
choosing: c
|
|
854
854
|
}),
|
|
855
|
-
redoReflection:
|
|
856
|
-
sheetId:
|
|
857
|
-
selectingZone:
|
|
855
|
+
redoReflection: p({
|
|
856
|
+
sheetId: l.id,
|
|
857
|
+
selectingZone: a,
|
|
858
858
|
choosing: c
|
|
859
859
|
})
|
|
860
860
|
}), {
|
|
861
861
|
...e,
|
|
862
|
-
sheetReactive: { current:
|
|
862
|
+
sheetReactive: { current: l }
|
|
863
863
|
});
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
|
-
const
|
|
867
|
-
class ht extends
|
|
866
|
+
const dt = new ut().bind();
|
|
867
|
+
class ht extends f {
|
|
868
868
|
constructor() {
|
|
869
869
|
super(...arguments), this.mutation = !0;
|
|
870
870
|
}
|
|
871
871
|
reduce(e, s) {
|
|
872
|
-
const { numCols: t, x: n, operator: i } = s, { sheetReactive: r, selectingZone:
|
|
873
|
-
if (
|
|
872
|
+
const { numCols: t, x: n, operator: i } = s, { sheetReactive: r, selectingZone: a, choosing: c } = e, d = r.current;
|
|
873
|
+
if (d == null)
|
|
874
874
|
return e;
|
|
875
|
-
const
|
|
876
|
-
...
|
|
877
|
-
startX:
|
|
878
|
-
endX:
|
|
879
|
-
},
|
|
880
|
-
return
|
|
875
|
+
const l = {
|
|
876
|
+
...a,
|
|
877
|
+
startX: a.startX + t,
|
|
878
|
+
endX: a.endX + t
|
|
879
|
+
}, u = { ...c, x: c.x + t };
|
|
880
|
+
return a.startX += t, a.endX += t, d.insertCols({
|
|
881
881
|
x: n + 1,
|
|
882
882
|
numCols: t,
|
|
883
883
|
baseX: n,
|
|
884
884
|
operator: i,
|
|
885
|
-
undoReflection:
|
|
886
|
-
sheetId:
|
|
887
|
-
selectingZone:
|
|
885
|
+
undoReflection: p({
|
|
886
|
+
sheetId: d.id,
|
|
887
|
+
selectingZone: a,
|
|
888
888
|
choosing: c
|
|
889
889
|
}),
|
|
890
|
-
redoReflection:
|
|
891
|
-
sheetId:
|
|
892
|
-
selectingZone:
|
|
893
|
-
choosing:
|
|
890
|
+
redoReflection: p({
|
|
891
|
+
sheetId: d.id,
|
|
892
|
+
selectingZone: l,
|
|
893
|
+
choosing: u
|
|
894
894
|
})
|
|
895
895
|
}), {
|
|
896
896
|
...e,
|
|
897
|
-
selectingZone:
|
|
898
|
-
choosing:
|
|
899
|
-
sheetReactive: { current:
|
|
897
|
+
selectingZone: l,
|
|
898
|
+
choosing: u,
|
|
899
|
+
sheetReactive: { current: d }
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
902
|
}
|
|
903
|
-
const
|
|
904
|
-
class
|
|
903
|
+
const ft = new ht().bind();
|
|
904
|
+
class gt extends f {
|
|
905
905
|
constructor() {
|
|
906
906
|
super(...arguments), this.mutation = !0;
|
|
907
907
|
}
|
|
908
908
|
reduce(e, s) {
|
|
909
|
-
const { numRows: t, y: n, operator: i } = s, { sheetReactive: r, selectingZone:
|
|
910
|
-
|
|
909
|
+
const { numRows: t, y: n, operator: i } = s, { sheetReactive: r, selectingZone: a, choosing: c, editorRef: d } = e, l = r.current;
|
|
910
|
+
if (l == null)
|
|
911
|
+
return e;
|
|
912
|
+
l.removeRows({
|
|
911
913
|
y: n,
|
|
912
914
|
numRows: t,
|
|
913
915
|
operator: i,
|
|
914
|
-
undoReflection:
|
|
915
|
-
sheetId:
|
|
916
|
-
selectingZone:
|
|
916
|
+
undoReflection: p({
|
|
917
|
+
sheetId: l.id,
|
|
918
|
+
selectingZone: a,
|
|
917
919
|
choosing: c,
|
|
918
920
|
sheetHeight: e.sheetHeight
|
|
919
921
|
}),
|
|
920
|
-
redoReflection:
|
|
921
|
-
sheetId:
|
|
922
|
-
selectingZone:
|
|
922
|
+
redoReflection: p({
|
|
923
|
+
sheetId: l.id,
|
|
924
|
+
selectingZone: a,
|
|
923
925
|
choosing: c
|
|
924
926
|
})
|
|
925
|
-
}), {
|
|
926
|
-
...e,
|
|
927
|
-
sheetReactive: { current: d }
|
|
928
927
|
});
|
|
928
|
+
const u = l.numRows, g = l.numCols;
|
|
929
|
+
let S = Math.max(1, Math.min(n, u));
|
|
930
|
+
if (l.isRowFiltered(S)) {
|
|
931
|
+
let R = -1;
|
|
932
|
+
for (let h = S; h <= u; h++)
|
|
933
|
+
if (!l.isRowFiltered(h)) {
|
|
934
|
+
R = h;
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
937
|
+
if (R === -1) {
|
|
938
|
+
for (let h = S; h >= 1; h--)
|
|
939
|
+
if (!l.isRowFiltered(h)) {
|
|
940
|
+
R = h;
|
|
941
|
+
break;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
R !== -1 && (S = R);
|
|
945
|
+
}
|
|
946
|
+
return {
|
|
947
|
+
...e,
|
|
948
|
+
sheetReactive: { current: l },
|
|
949
|
+
selectingZone: { startY: S, startX: 1, endY: S, endX: g },
|
|
950
|
+
choosing: { y: S, x: 1 },
|
|
951
|
+
leftHeaderSelecting: !0,
|
|
952
|
+
topHeaderSelecting: !1
|
|
953
|
+
};
|
|
929
954
|
}
|
|
930
955
|
}
|
|
931
|
-
const Rt = new
|
|
932
|
-
class wt extends
|
|
956
|
+
const Rt = new gt().bind();
|
|
957
|
+
class wt extends f {
|
|
933
958
|
constructor() {
|
|
934
959
|
super(...arguments), this.mutation = !0;
|
|
935
960
|
}
|
|
936
961
|
reduce(e, s) {
|
|
937
|
-
const { numCols: t, x: n, operator: i } = s, { sheetReactive: r, selectingZone:
|
|
938
|
-
|
|
962
|
+
const { numCols: t, x: n, operator: i } = s, { sheetReactive: r, selectingZone: a, choosing: c, editorRef: d } = e, l = r.current;
|
|
963
|
+
if (l == null)
|
|
964
|
+
return e;
|
|
965
|
+
l.removeCols({
|
|
939
966
|
x: n,
|
|
940
967
|
numCols: t,
|
|
941
968
|
operator: i,
|
|
942
|
-
undoReflection:
|
|
943
|
-
sheetId:
|
|
944
|
-
selectingZone:
|
|
969
|
+
undoReflection: p({
|
|
970
|
+
sheetId: l.id,
|
|
971
|
+
selectingZone: a,
|
|
945
972
|
choosing: c,
|
|
946
973
|
sheetWidth: e.sheetWidth
|
|
947
974
|
}),
|
|
948
|
-
redoReflection:
|
|
949
|
-
sheetId:
|
|
950
|
-
selectingZone:
|
|
975
|
+
redoReflection: p({
|
|
976
|
+
sheetId: l.id,
|
|
977
|
+
selectingZone: a,
|
|
951
978
|
choosing: c
|
|
952
979
|
})
|
|
953
|
-
}), {
|
|
954
|
-
...e,
|
|
955
|
-
sheetReactive: { current: d }
|
|
956
980
|
});
|
|
981
|
+
const u = l.numCols, g = l.numRows, S = Math.max(1, Math.min(n, u));
|
|
982
|
+
let R = 1;
|
|
983
|
+
for (let h = 1; h <= g; h++)
|
|
984
|
+
if (!l.isRowFiltered(h)) {
|
|
985
|
+
R = h;
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
return {
|
|
989
|
+
...e,
|
|
990
|
+
sheetReactive: { current: l },
|
|
991
|
+
selectingZone: { startY: 1, startX: S, endY: g, endX: S },
|
|
992
|
+
choosing: { y: R, x: S },
|
|
993
|
+
leftHeaderSelecting: !1,
|
|
994
|
+
topHeaderSelecting: !0
|
|
995
|
+
};
|
|
957
996
|
}
|
|
958
997
|
}
|
|
959
998
|
const St = new wt().bind();
|
|
960
|
-
class xt extends
|
|
999
|
+
class xt extends f {
|
|
961
1000
|
constructor() {
|
|
962
1001
|
super(...arguments), this.mutation = !0;
|
|
963
1002
|
}
|
|
964
1003
|
reduce(e, s) {
|
|
965
|
-
const { x: t, direction: n } = s, { sheetReactive: i, selectingZone: r, choosing:
|
|
1004
|
+
const { x: t, direction: n } = s, { sheetReactive: i, selectingZone: r, choosing: a } = e, c = i.current;
|
|
966
1005
|
if (c == null)
|
|
967
1006
|
return e;
|
|
968
1007
|
c.sortRows({ x: t, direction: n });
|
|
969
|
-
const
|
|
970
|
-
return c.registry.lastHistory && (c.registry.lastHistory.undoReflection =
|
|
1008
|
+
const d = p({ sheetId: c.id, selectingZone: r, choosing: a });
|
|
1009
|
+
return c.registry.lastHistory && (c.registry.lastHistory.undoReflection = d, c.registry.lastHistory.redoReflection = d), {
|
|
971
1010
|
...e,
|
|
972
1011
|
sheetReactive: { current: c }
|
|
973
1012
|
};
|
|
974
1013
|
}
|
|
975
1014
|
}
|
|
976
1015
|
const mt = new xt().bind();
|
|
977
|
-
class yt extends
|
|
1016
|
+
class yt extends f {
|
|
978
1017
|
constructor() {
|
|
979
1018
|
super(...arguments), this.mutation = !0;
|
|
980
1019
|
}
|
|
981
1020
|
reduce(e, s) {
|
|
982
|
-
const { x: t, filter: n } = s, { sheetReactive: i, selectingZone: r, choosing:
|
|
1021
|
+
const { x: t, filter: n } = s, { sheetReactive: i, selectingZone: r, choosing: a } = e, c = i.current;
|
|
983
1022
|
if (c == null)
|
|
984
1023
|
return e;
|
|
985
1024
|
c.filterRows({ x: t, filter: n });
|
|
986
|
-
const
|
|
987
|
-
c.registry.lastHistory && (c.registry.lastHistory.undoReflection =
|
|
988
|
-
let
|
|
989
|
-
if (c.isRowFiltered(
|
|
990
|
-
for (let
|
|
991
|
-
if (!c.isRowFiltered(
|
|
992
|
-
|
|
1025
|
+
const d = p({ sheetId: c.id, selectingZone: r, choosing: a });
|
|
1026
|
+
c.registry.lastHistory && (c.registry.lastHistory.undoReflection = d, c.registry.lastHistory.redoReflection = d);
|
|
1027
|
+
let l = a;
|
|
1028
|
+
if (c.isRowFiltered(a.y)) {
|
|
1029
|
+
for (let u = 1; u <= c.numRows; u++)
|
|
1030
|
+
if (!c.isRowFiltered(u)) {
|
|
1031
|
+
l = { y: u, x: a.x };
|
|
993
1032
|
break;
|
|
994
1033
|
}
|
|
995
1034
|
}
|
|
996
1035
|
return {
|
|
997
1036
|
...e,
|
|
998
|
-
choosing:
|
|
999
|
-
selectingZone:
|
|
1037
|
+
choosing: l,
|
|
1038
|
+
selectingZone: l !== a ? E : r,
|
|
1000
1039
|
sheetReactive: { current: c },
|
|
1001
|
-
callback: ({ sheetReactive:
|
|
1002
|
-
const g =
|
|
1040
|
+
callback: ({ sheetReactive: u }) => {
|
|
1041
|
+
const g = u.current;
|
|
1003
1042
|
g && g.registry.transmit({
|
|
1004
1043
|
cutting: !1,
|
|
1005
1044
|
copyingZone: E
|
|
@@ -1009,7 +1048,7 @@ class yt extends h {
|
|
|
1009
1048
|
}
|
|
1010
1049
|
}
|
|
1011
1050
|
const pt = new yt().bind();
|
|
1012
|
-
class vt extends
|
|
1051
|
+
class vt extends f {
|
|
1013
1052
|
reduce(e, s) {
|
|
1014
1053
|
return {
|
|
1015
1054
|
...e,
|
|
@@ -1017,8 +1056,8 @@ class vt extends h {
|
|
|
1017
1056
|
};
|
|
1018
1057
|
}
|
|
1019
1058
|
}
|
|
1020
|
-
const
|
|
1021
|
-
class bt extends
|
|
1059
|
+
const jt = new vt().bind();
|
|
1060
|
+
class bt extends f {
|
|
1022
1061
|
reduce(e, s) {
|
|
1023
1062
|
return {
|
|
1024
1063
|
...e,
|
|
@@ -1026,8 +1065,8 @@ class bt extends h {
|
|
|
1026
1065
|
};
|
|
1027
1066
|
}
|
|
1028
1067
|
}
|
|
1029
|
-
const
|
|
1030
|
-
class At extends
|
|
1068
|
+
const qt = new bt().bind();
|
|
1069
|
+
class At extends f {
|
|
1031
1070
|
reduce(e, s) {
|
|
1032
1071
|
return {
|
|
1033
1072
|
...e,
|
|
@@ -1035,8 +1074,8 @@ class At extends h {
|
|
|
1035
1074
|
};
|
|
1036
1075
|
}
|
|
1037
1076
|
}
|
|
1038
|
-
const
|
|
1039
|
-
class Ct extends
|
|
1077
|
+
const Qt = new At().bind();
|
|
1078
|
+
class Ct extends f {
|
|
1040
1079
|
reduce(e, s) {
|
|
1041
1080
|
return {
|
|
1042
1081
|
...e,
|
|
@@ -1044,28 +1083,28 @@ class Ct extends h {
|
|
|
1044
1083
|
};
|
|
1045
1084
|
}
|
|
1046
1085
|
}
|
|
1047
|
-
const te = new Ct().bind(),
|
|
1048
|
-
blur:
|
|
1086
|
+
const te = new Ct().bind(), Vt = {
|
|
1087
|
+
blur: Ye,
|
|
1049
1088
|
copy: Ze,
|
|
1050
1089
|
cut: Me,
|
|
1051
|
-
paste:
|
|
1090
|
+
paste: He,
|
|
1052
1091
|
escape: Fe,
|
|
1053
1092
|
choose: Le,
|
|
1054
1093
|
select: Pe,
|
|
1055
1094
|
selectRows: Be,
|
|
1056
1095
|
selectCols: Ue,
|
|
1057
1096
|
drag: Oe,
|
|
1058
|
-
search:
|
|
1059
|
-
write:
|
|
1097
|
+
search: qe,
|
|
1098
|
+
write: Ve,
|
|
1060
1099
|
clear: Ke,
|
|
1061
1100
|
undo: $e,
|
|
1062
1101
|
redo: et,
|
|
1063
1102
|
arrow: nt,
|
|
1064
1103
|
walk: it,
|
|
1065
1104
|
insertRowsAbove: ct,
|
|
1066
|
-
insertRowsBelow:
|
|
1067
|
-
insertColsLeft:
|
|
1068
|
-
insertColsRight:
|
|
1105
|
+
insertRowsBelow: lt,
|
|
1106
|
+
insertColsLeft: dt,
|
|
1107
|
+
insertColsRight: ft,
|
|
1069
1108
|
removeRows: Rt,
|
|
1070
1109
|
removeCols: St,
|
|
1071
1110
|
sortRows: mt,
|
|
@@ -1076,7 +1115,7 @@ const te = new Ct().bind(), jt = {
|
|
|
1076
1115
|
e(!0);
|
|
1077
1116
|
}, []), o && typeof window < "u" ? { window, document } : { window: null, document: null };
|
|
1078
1117
|
}, Kt = (o, e = 100) => {
|
|
1079
|
-
const s =
|
|
1118
|
+
const s = V(o), t = V();
|
|
1080
1119
|
return O(() => {
|
|
1081
1120
|
s.current = o;
|
|
1082
1121
|
}, [o]), (...n) => {
|
|
@@ -1085,7 +1124,7 @@ const te = new Ct().bind(), jt = {
|
|
|
1085
1124
|
}, e);
|
|
1086
1125
|
};
|
|
1087
1126
|
}, Nt = (o = {}) => {
|
|
1088
|
-
const [e, s] = N(() =>
|
|
1127
|
+
const [e, s] = N(() => ae(o)), { registry: t } = e;
|
|
1089
1128
|
return t.updateSheet = ve, t.transmit = (n) => {
|
|
1090
1129
|
Object.assign(t, n), t.ready && requestAnimationFrame(() => s({ registry: t }));
|
|
1091
1130
|
}, O(() => {
|
|
@@ -1093,12 +1132,12 @@ const te = new Ct().bind(), jt = {
|
|
|
1093
1132
|
}, [o]), e;
|
|
1094
1133
|
};
|
|
1095
1134
|
export {
|
|
1096
|
-
|
|
1097
|
-
|
|
1135
|
+
dt as A,
|
|
1136
|
+
lt as B,
|
|
1098
1137
|
ct as C,
|
|
1099
1138
|
Pt as D,
|
|
1100
|
-
|
|
1101
|
-
|
|
1139
|
+
jt as E,
|
|
1140
|
+
qt as F,
|
|
1102
1141
|
Zt as G,
|
|
1103
1142
|
Ut as H,
|
|
1104
1143
|
Le as I,
|
|
@@ -1109,14 +1148,14 @@ export {
|
|
|
1109
1148
|
Ue as N,
|
|
1110
1149
|
Kt as O,
|
|
1111
1150
|
Be as P,
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1151
|
+
qe as Q,
|
|
1152
|
+
Ht as R,
|
|
1153
|
+
Tt as S,
|
|
1115
1154
|
Ft as T,
|
|
1116
1155
|
Nt as U,
|
|
1117
1156
|
Xt as V,
|
|
1118
1157
|
Mt as W,
|
|
1119
|
-
|
|
1158
|
+
Vt as X,
|
|
1120
1159
|
Ot as a,
|
|
1121
1160
|
ve as b,
|
|
1122
1161
|
$e as c,
|
|
@@ -1129,19 +1168,19 @@ export {
|
|
|
1129
1168
|
Fe as j,
|
|
1130
1169
|
Ke as k,
|
|
1131
1170
|
it as l,
|
|
1132
|
-
|
|
1171
|
+
Qt as m,
|
|
1133
1172
|
te as n,
|
|
1134
1173
|
zt as o,
|
|
1135
|
-
|
|
1174
|
+
He as p,
|
|
1136
1175
|
Bt as q,
|
|
1137
1176
|
et as r,
|
|
1138
1177
|
kt as s,
|
|
1139
1178
|
pt as t,
|
|
1140
1179
|
Gt as u,
|
|
1141
1180
|
mt as v,
|
|
1142
|
-
|
|
1181
|
+
Ve as w,
|
|
1143
1182
|
St as x,
|
|
1144
1183
|
Rt as y,
|
|
1145
|
-
|
|
1184
|
+
ft as z
|
|
1146
1185
|
};
|
|
1147
|
-
//# sourceMappingURL=hooks-
|
|
1186
|
+
//# sourceMappingURL=hooks-CvkA2lFB.mjs.map
|