react-excel-lite 0.1.0 → 0.2.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 +28 -38
- package/dist/components/grid-cell.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react-excel-lite.js +467 -418
- package/dist/react-excel-lite.umd.cjs +2 -2
- package/dist/types.d.ts +7 -27
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/react-excel-lite.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
function
|
|
1
|
+
import { jsxs as A, jsx as N, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useCallback as M, useEffect as j, useRef as U, useLayoutEffect as Y, useMemo as $ } from "react";
|
|
3
|
+
function W(...e) {
|
|
4
4
|
return e.filter(Boolean).join(" ");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function ke(e) {
|
|
7
7
|
return `${e.row}-${e.col}`;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const [o,
|
|
11
|
-
return { row: o, col:
|
|
9
|
+
function Ee(e) {
|
|
10
|
+
const [o, l] = e.split("-").map(Number);
|
|
11
|
+
return { row: o, col: l };
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function ve(e, o) {
|
|
14
14
|
if (!e || !o) return e ? [e] : [];
|
|
15
|
-
const
|
|
16
|
-
for (let
|
|
17
|
-
for (let f = a; f <=
|
|
18
|
-
u.push({ row:
|
|
15
|
+
const l = Math.min(e.row, o.row), i = Math.max(e.row, o.row), a = Math.min(e.col, o.col), x = Math.max(e.col, o.col), u = [];
|
|
16
|
+
for (let m = l; m <= i; m++)
|
|
17
|
+
for (let f = a; f <= x; f++)
|
|
18
|
+
u.push({ row: m, col: f });
|
|
19
19
|
return u;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Z(e, o) {
|
|
22
22
|
if (!o.start) return !1;
|
|
23
|
-
const
|
|
24
|
-
return e.row >= i && e.row <= a && e.col >=
|
|
25
|
-
}
|
|
26
|
-
function Z(e) {
|
|
27
|
-
return e.split(/\r?\n/).filter((o) => o.trim()).map((o) => o.split(" ").map((n) => n.trim()));
|
|
23
|
+
const l = o.end || o.start, i = Math.min(o.start.row, l.row), a = Math.max(o.start.row, l.row), x = Math.min(o.start.col, l.col), u = Math.max(o.start.col, l.col);
|
|
24
|
+
return e.row >= i && e.row <= a && e.col >= x && e.col <= u;
|
|
28
25
|
}
|
|
29
26
|
function ee(e) {
|
|
27
|
+
return e.split(/\r?\n/).filter((o) => o.trim()).map((o) => o.split(" ").map((l) => l.trim()));
|
|
28
|
+
}
|
|
29
|
+
function te(e) {
|
|
30
30
|
return e.map((o) => o.join(" ")).join(`
|
|
31
31
|
`);
|
|
32
32
|
}
|
|
@@ -42,289 +42,289 @@ function B(e) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Fe(e, o) {
|
|
46
46
|
if (e.row === o.row && e.col === o.col)
|
|
47
47
|
return [];
|
|
48
|
-
const
|
|
49
|
-
for (let
|
|
50
|
-
for (let f = a; f <=
|
|
51
|
-
|
|
48
|
+
const l = Math.min(e.row, o.row), i = Math.max(e.row, o.row), a = Math.min(e.col, o.col), x = Math.max(e.col, o.col), u = [];
|
|
49
|
+
for (let m = l; m <= i; m++)
|
|
50
|
+
for (let f = a; f <= x; f++)
|
|
51
|
+
m === e.row && f === e.col || u.push({ row: m, col: f });
|
|
52
52
|
return u;
|
|
53
53
|
}
|
|
54
54
|
function oe({
|
|
55
55
|
containerRef: e
|
|
56
56
|
}) {
|
|
57
|
-
const [o,
|
|
57
|
+
const [o, l] = z({
|
|
58
58
|
start: null,
|
|
59
59
|
end: null
|
|
60
|
-
}), [i, a] =
|
|
61
|
-
|
|
62
|
-
}, []), u =
|
|
63
|
-
(
|
|
64
|
-
i &&
|
|
60
|
+
}), [i, a] = z(!1), x = M((c) => {
|
|
61
|
+
l({ start: c, end: c }), a(!0);
|
|
62
|
+
}, []), u = M(
|
|
63
|
+
(c) => {
|
|
64
|
+
i && l((n) => ({ ...n, end: c }));
|
|
65
65
|
},
|
|
66
66
|
[i]
|
|
67
|
-
),
|
|
67
|
+
), m = M(() => {
|
|
68
68
|
a(!1);
|
|
69
|
-
}, []), f =
|
|
70
|
-
|
|
71
|
-
}, []),
|
|
72
|
-
(
|
|
69
|
+
}, []), f = M(() => {
|
|
70
|
+
l({ start: null, end: null }), a(!1);
|
|
71
|
+
}, []), g = M(
|
|
72
|
+
(c) => Z(c, o),
|
|
73
73
|
[o]
|
|
74
74
|
);
|
|
75
|
-
return
|
|
76
|
-
const
|
|
75
|
+
return j(() => {
|
|
76
|
+
const c = () => {
|
|
77
77
|
i && a(!1);
|
|
78
78
|
};
|
|
79
|
-
return window.addEventListener("mouseup",
|
|
80
|
-
}, [i]),
|
|
81
|
-
const
|
|
82
|
-
e.current && !e.current.contains(
|
|
79
|
+
return window.addEventListener("mouseup", c), () => window.removeEventListener("mouseup", c);
|
|
80
|
+
}, [i]), j(() => {
|
|
81
|
+
const c = (n) => {
|
|
82
|
+
e.current && !e.current.contains(n.target) && f();
|
|
83
83
|
};
|
|
84
|
-
return document.addEventListener("mousedown",
|
|
84
|
+
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
85
85
|
}, [e, f]), {
|
|
86
86
|
selection: o,
|
|
87
87
|
isSelecting: i,
|
|
88
|
-
isCellSelected:
|
|
89
|
-
handleCellMouseDown:
|
|
88
|
+
isCellSelected: g,
|
|
89
|
+
handleCellMouseDown: x,
|
|
90
90
|
handleCellMouseEnter: u,
|
|
91
|
-
handleMouseUp:
|
|
91
|
+
handleMouseUp: m,
|
|
92
92
|
clearSelection: f,
|
|
93
|
-
setSelection:
|
|
93
|
+
setSelection: l
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function ne({
|
|
97
97
|
selection: e,
|
|
98
98
|
getValue: o,
|
|
99
|
-
setValues:
|
|
99
|
+
setValues: l,
|
|
100
100
|
setSelection: i,
|
|
101
101
|
rowCount: a,
|
|
102
|
-
colCount:
|
|
102
|
+
colCount: x
|
|
103
103
|
}) {
|
|
104
|
-
const u =
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
107
|
-
const
|
|
108
|
-
for (let
|
|
109
|
-
const
|
|
110
|
-
for (let
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
const u = M(() => {
|
|
105
|
+
const n = B(e);
|
|
106
|
+
if (!n.start || !n.end) return [];
|
|
107
|
+
const S = [];
|
|
108
|
+
for (let d = n.start.row; d <= n.end.row; d++) {
|
|
109
|
+
const C = [];
|
|
110
|
+
for (let r = n.start.col; r <= n.end.col; r++)
|
|
111
|
+
C.push(o({ row: d, col: r }));
|
|
112
|
+
S.push(C);
|
|
113
113
|
}
|
|
114
|
-
return
|
|
115
|
-
}, [e, o]),
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
114
|
+
return S;
|
|
115
|
+
}, [e, o]), m = M(async () => {
|
|
116
|
+
const n = u();
|
|
117
|
+
if (n.length === 0) return;
|
|
118
|
+
const S = te(n);
|
|
119
119
|
try {
|
|
120
|
-
await navigator.clipboard.writeText(
|
|
121
|
-
} catch (
|
|
122
|
-
console.error("Clipboard copy failed:",
|
|
120
|
+
await navigator.clipboard.writeText(S);
|
|
121
|
+
} catch (d) {
|
|
122
|
+
console.error("Clipboard copy failed:", d);
|
|
123
123
|
}
|
|
124
|
-
}, [u]), f =
|
|
124
|
+
}, [u]), f = M(async () => {
|
|
125
125
|
if (e.start)
|
|
126
126
|
try {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
127
|
+
const n = await navigator.clipboard.readText(), S = ee(n);
|
|
128
|
+
if (S.length === 0) return;
|
|
129
|
+
const d = e.start.row, C = e.start.col, r = [];
|
|
130
|
+
S.forEach((b, w) => {
|
|
131
|
+
const h = d + w;
|
|
132
|
+
h >= a || b.forEach((F, v) => {
|
|
133
|
+
const s = C + v;
|
|
134
|
+
s >= x || r.push({ coord: { row: h, col: s }, value: F });
|
|
135
135
|
});
|
|
136
|
-
}),
|
|
137
|
-
} catch (
|
|
138
|
-
console.error("Clipboard paste failed:",
|
|
136
|
+
}), r.length > 0 && l(r);
|
|
137
|
+
} catch (n) {
|
|
138
|
+
console.error("Clipboard paste failed:", n);
|
|
139
139
|
}
|
|
140
|
-
}, [e.start,
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
for (let
|
|
145
|
-
for (let
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, [e,
|
|
149
|
-
(
|
|
150
|
-
if (!(
|
|
151
|
-
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
let
|
|
155
|
-
switch (
|
|
140
|
+
}, [e.start, l, a, x]), g = M(() => {
|
|
141
|
+
const n = B(e);
|
|
142
|
+
if (!n.start || !n.end) return;
|
|
143
|
+
const S = [];
|
|
144
|
+
for (let d = n.start.row; d <= n.end.row; d++)
|
|
145
|
+
for (let C = n.start.col; C <= n.end.col; C++)
|
|
146
|
+
S.push({ coord: { row: d, col: C }, value: "" });
|
|
147
|
+
S.length > 0 && l(S);
|
|
148
|
+
}, [e, l]), c = M(
|
|
149
|
+
(n) => {
|
|
150
|
+
if (!(n.target instanceof HTMLInputElement && !n.target.readOnly)) {
|
|
151
|
+
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.key)) {
|
|
152
|
+
n.preventDefault();
|
|
153
|
+
const d = B(e).start ?? { row: 0, col: 0 };
|
|
154
|
+
let C = d.row, r = d.col;
|
|
155
|
+
switch (n.key) {
|
|
156
156
|
case "ArrowUp":
|
|
157
|
-
|
|
157
|
+
C = Math.max(0, d.row - 1);
|
|
158
158
|
break;
|
|
159
159
|
case "ArrowDown":
|
|
160
|
-
|
|
160
|
+
C = Math.min(a - 1, d.row + 1);
|
|
161
161
|
break;
|
|
162
162
|
case "ArrowLeft":
|
|
163
|
-
|
|
163
|
+
r = Math.max(0, d.col - 1);
|
|
164
164
|
break;
|
|
165
165
|
case "ArrowRight":
|
|
166
|
-
|
|
166
|
+
r = Math.min(x - 1, d.col + 1);
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
169
169
|
i({
|
|
170
|
-
start: { row:
|
|
171
|
-
end: { row:
|
|
170
|
+
start: { row: C, col: r },
|
|
171
|
+
end: { row: C, col: r }
|
|
172
172
|
});
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
(
|
|
175
|
+
(n.ctrlKey || n.metaKey) && n.key === "c" && (n.preventDefault(), m()), (n.ctrlKey || n.metaKey) && n.key === "v" && (n.preventDefault(), f()), (n.key === "Backspace" || n.key === "Delete") && (n.preventDefault(), g());
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
178
|
[
|
|
179
|
-
|
|
179
|
+
m,
|
|
180
180
|
f,
|
|
181
|
-
|
|
181
|
+
g,
|
|
182
182
|
e,
|
|
183
183
|
i,
|
|
184
184
|
a,
|
|
185
|
-
|
|
185
|
+
x
|
|
186
186
|
]
|
|
187
187
|
);
|
|
188
188
|
return {
|
|
189
|
-
handleCopy:
|
|
189
|
+
handleCopy: m,
|
|
190
190
|
handlePaste: f,
|
|
191
|
-
handleKeyDown:
|
|
191
|
+
handleKeyDown: c
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function le(e) {
|
|
195
195
|
if (e.trim() === "") return null;
|
|
196
196
|
const o = Number(e);
|
|
197
197
|
return isNaN(o) ? null : o;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function X(e) {
|
|
200
200
|
if (e.length === 0) return null;
|
|
201
|
-
const o = e.map(
|
|
201
|
+
const o = e.map(le);
|
|
202
202
|
if (o.some((a) => a === null)) return null;
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
return { numbers:
|
|
206
|
-
const i =
|
|
207
|
-
for (let a = 2; a <
|
|
208
|
-
if (
|
|
209
|
-
return { numbers:
|
|
210
|
-
return { numbers:
|
|
203
|
+
const l = o;
|
|
204
|
+
if (l.length === 1)
|
|
205
|
+
return { numbers: l, diff: 0 };
|
|
206
|
+
const i = l[1] - l[0];
|
|
207
|
+
for (let a = 2; a < l.length; a++)
|
|
208
|
+
if (l[a] - l[a - 1] !== i)
|
|
209
|
+
return { numbers: l, diff: 0 };
|
|
210
|
+
return { numbers: l, diff: i };
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function re({
|
|
213
213
|
selection: e,
|
|
214
214
|
getValue: o,
|
|
215
|
-
setValues:
|
|
215
|
+
setValues: l
|
|
216
216
|
}) {
|
|
217
|
-
const [i, a] =
|
|
218
|
-
a(
|
|
219
|
-
}, []),
|
|
220
|
-
(
|
|
221
|
-
if (!
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
row: Math.min(
|
|
227
|
-
col: Math.min(
|
|
228
|
-
},
|
|
229
|
-
row: Math.max(
|
|
230
|
-
col: Math.max(
|
|
231
|
-
},
|
|
232
|
-
for (let
|
|
233
|
-
for (let
|
|
234
|
-
|
|
235
|
-
u(
|
|
217
|
+
const [i, a] = z(null), [x, u] = z([]), [m, f] = z(!1), [g, c] = z(null), n = M((r) => {
|
|
218
|
+
a(r), f(!0), u([]), c(null);
|
|
219
|
+
}, []), S = M(
|
|
220
|
+
(r) => {
|
|
221
|
+
if (!m || !e.start) return;
|
|
222
|
+
const b = B(e);
|
|
223
|
+
if (!b.start || !b.end) return;
|
|
224
|
+
c(r);
|
|
225
|
+
const w = {
|
|
226
|
+
row: Math.min(b.start.row, r.row),
|
|
227
|
+
col: Math.min(b.start.col, r.col)
|
|
228
|
+
}, h = {
|
|
229
|
+
row: Math.max(b.end.row, r.row),
|
|
230
|
+
col: Math.max(b.end.col, r.col)
|
|
231
|
+
}, F = [];
|
|
232
|
+
for (let v = w.row; v <= h.row; v++)
|
|
233
|
+
for (let s = w.col; s <= h.col; s++)
|
|
234
|
+
v >= b.start.row && v <= b.end.row && s >= b.start.col && s <= b.end.col || F.push({ row: v, col: s });
|
|
235
|
+
u(F);
|
|
236
236
|
},
|
|
237
|
-
[
|
|
238
|
-
),
|
|
239
|
-
if (!e.start ||
|
|
240
|
-
a(null), u([]), f(!1),
|
|
237
|
+
[m, e]
|
|
238
|
+
), d = M(() => {
|
|
239
|
+
if (!e.start || x.length === 0 || !g) {
|
|
240
|
+
a(null), u([]), f(!1), c(null);
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
|
-
const
|
|
244
|
-
if (!
|
|
245
|
-
a(null), u([]), f(!1),
|
|
243
|
+
const r = B(e);
|
|
244
|
+
if (!r.start || !r.end) {
|
|
245
|
+
a(null), u([]), f(!1), c(null);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
let
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
} else if (
|
|
255
|
-
const
|
|
256
|
-
|
|
248
|
+
const b = [], w = r.start, h = r.end, F = h.row - w.row + 1, v = h.col - w.col + 1;
|
|
249
|
+
x.forEach((s) => {
|
|
250
|
+
let R, I;
|
|
251
|
+
if (s.row < w.row) {
|
|
252
|
+
const E = w.row - s.row;
|
|
253
|
+
R = h.row - (E - 1) % F;
|
|
254
|
+
} else if (s.row > h.row) {
|
|
255
|
+
const E = s.row - h.row;
|
|
256
|
+
R = w.row + (E - 1) % F;
|
|
257
257
|
} else
|
|
258
|
-
|
|
259
|
-
if (
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
} else if (
|
|
263
|
-
const
|
|
264
|
-
|
|
258
|
+
R = s.row;
|
|
259
|
+
if (s.col < w.col) {
|
|
260
|
+
const E = w.col - s.col;
|
|
261
|
+
I = h.col - (E - 1) % v;
|
|
262
|
+
} else if (s.col > h.col) {
|
|
263
|
+
const E = s.col - h.col;
|
|
264
|
+
I = w.col + (E - 1) % v;
|
|
265
265
|
} else
|
|
266
|
-
|
|
267
|
-
let
|
|
268
|
-
if (
|
|
269
|
-
const
|
|
270
|
-
for (let
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
} else if (
|
|
278
|
-
const
|
|
279
|
-
|
|
266
|
+
I = s.col;
|
|
267
|
+
let H = o({ row: R, col: I });
|
|
268
|
+
if (s.row !== R && s.col >= w.col && s.col <= h.col) {
|
|
269
|
+
const E = [];
|
|
270
|
+
for (let k = w.row; k <= h.row; k++)
|
|
271
|
+
E.push(o({ row: k, col: s.col }));
|
|
272
|
+
const D = X(E);
|
|
273
|
+
if (D && D.diff !== 0) {
|
|
274
|
+
if (s.row > h.row) {
|
|
275
|
+
const k = s.row - h.row;
|
|
276
|
+
H = String(D.numbers[D.numbers.length - 1] + D.diff * k);
|
|
277
|
+
} else if (s.row < w.row) {
|
|
278
|
+
const k = w.row - s.row;
|
|
279
|
+
H = String(D.numbers[0] - D.diff * k);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
if (
|
|
284
|
-
const
|
|
285
|
-
for (let
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
} else if (
|
|
293
|
-
const
|
|
294
|
-
|
|
283
|
+
if (s.col !== I && s.row >= w.row && s.row <= h.row) {
|
|
284
|
+
const E = [];
|
|
285
|
+
for (let k = w.col; k <= h.col; k++)
|
|
286
|
+
E.push(o({ row: s.row, col: k }));
|
|
287
|
+
const D = X(E);
|
|
288
|
+
if (D && D.diff !== 0) {
|
|
289
|
+
if (s.col > h.col) {
|
|
290
|
+
const k = s.col - h.col;
|
|
291
|
+
H = String(D.numbers[D.numbers.length - 1] + D.diff * k);
|
|
292
|
+
} else if (s.col < w.col) {
|
|
293
|
+
const k = w.col - s.col;
|
|
294
|
+
H = String(D.numbers[0] - D.diff * k);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
|
|
299
|
-
}),
|
|
300
|
-
}, [e,
|
|
301
|
-
(
|
|
302
|
-
(
|
|
298
|
+
b.push({ coord: s, value: H });
|
|
299
|
+
}), b.length > 0 && l(b), a(null), u([]), f(!1), c(null);
|
|
300
|
+
}, [e, x, g, o, l]), C = M(
|
|
301
|
+
(r) => x.some(
|
|
302
|
+
(b) => b.row === r.row && b.col === r.col
|
|
303
303
|
),
|
|
304
|
-
[
|
|
304
|
+
[x]
|
|
305
305
|
);
|
|
306
|
-
return
|
|
307
|
-
const
|
|
308
|
-
|
|
306
|
+
return j(() => {
|
|
307
|
+
const r = () => {
|
|
308
|
+
m && d();
|
|
309
309
|
};
|
|
310
|
-
return window.addEventListener("mouseup",
|
|
311
|
-
}, [
|
|
310
|
+
return window.addEventListener("mouseup", r), () => window.removeEventListener("mouseup", r);
|
|
311
|
+
}, [m, d]), {
|
|
312
312
|
fillSource: i,
|
|
313
|
-
fillTargets:
|
|
314
|
-
isDraggingFill:
|
|
315
|
-
isFillTarget:
|
|
316
|
-
handleFillHandleMouseDown:
|
|
317
|
-
handleCellMouseEnterForFill:
|
|
318
|
-
handleFillMouseUp:
|
|
313
|
+
fillTargets: x,
|
|
314
|
+
isDraggingFill: m,
|
|
315
|
+
isFillTarget: C,
|
|
316
|
+
handleFillHandleMouseDown: n,
|
|
317
|
+
handleCellMouseEnterForFill: S,
|
|
318
|
+
handleFillMouseUp: d
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
const
|
|
321
|
+
const se = {
|
|
322
322
|
position: "relative",
|
|
323
323
|
border: "1px solid #d1d5db",
|
|
324
324
|
padding: 0,
|
|
325
325
|
height: "28px",
|
|
326
326
|
minWidth: "80px"
|
|
327
|
-
},
|
|
327
|
+
}, ce = {
|
|
328
328
|
width: "100%",
|
|
329
329
|
height: "100%",
|
|
330
330
|
padding: "4px",
|
|
@@ -335,7 +335,7 @@ const re = {
|
|
|
335
335
|
backgroundColor: "transparent",
|
|
336
336
|
outline: "none",
|
|
337
337
|
border: "none"
|
|
338
|
-
},
|
|
338
|
+
}, ie = {
|
|
339
339
|
position: "absolute",
|
|
340
340
|
bottom: "-2px",
|
|
341
341
|
right: "-2px",
|
|
@@ -344,97 +344,146 @@ const re = {
|
|
|
344
344
|
cursor: "crosshair",
|
|
345
345
|
zIndex: 20,
|
|
346
346
|
backgroundColor: "#3b82f6"
|
|
347
|
-
},
|
|
347
|
+
}, ae = {
|
|
348
|
+
position: "absolute",
|
|
349
|
+
top: 0,
|
|
350
|
+
left: 0,
|
|
351
|
+
minWidth: "100%",
|
|
352
|
+
height: "100%",
|
|
353
|
+
zIndex: 30
|
|
354
|
+
}, ue = {
|
|
355
|
+
height: "100%",
|
|
356
|
+
padding: "4px",
|
|
357
|
+
textAlign: "right",
|
|
358
|
+
fontSize: "12px",
|
|
359
|
+
boxSizing: "border-box",
|
|
360
|
+
backgroundColor: "#fff",
|
|
361
|
+
border: "2px solid #3b82f6",
|
|
362
|
+
outline: "none",
|
|
363
|
+
minWidth: "100%"
|
|
364
|
+
}, fe = {
|
|
365
|
+
position: "absolute",
|
|
366
|
+
visibility: "hidden",
|
|
367
|
+
whiteSpace: "pre",
|
|
368
|
+
fontSize: "12px",
|
|
369
|
+
padding: "4px"
|
|
370
|
+
}, de = {
|
|
348
371
|
backgroundColor: "#dbeafe",
|
|
349
372
|
outline: "2px solid #3b82f6",
|
|
350
373
|
outlineOffset: "-2px"
|
|
351
|
-
},
|
|
374
|
+
}, we = {
|
|
352
375
|
backgroundColor: "#eff6ff"
|
|
353
376
|
};
|
|
354
|
-
function
|
|
377
|
+
function he({
|
|
355
378
|
coord: e,
|
|
356
379
|
value: o,
|
|
357
|
-
isSelected:
|
|
380
|
+
isSelected: l,
|
|
358
381
|
isFillTarget: i,
|
|
359
382
|
showFillHandle: a,
|
|
360
|
-
onMouseDown:
|
|
383
|
+
onMouseDown: x,
|
|
361
384
|
onMouseEnter: u,
|
|
362
|
-
onChange:
|
|
385
|
+
onChange: m,
|
|
363
386
|
onFillHandleMouseDown: f,
|
|
364
|
-
styles:
|
|
387
|
+
styles: g
|
|
365
388
|
}) {
|
|
366
|
-
const [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
c
|
|
376
|
-
},
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
+
const [c, n] = z(!1), [S, d] = z(!1), [C, r] = z(null), b = U(null), w = U(null), h = U(null), F = U(null);
|
|
390
|
+
Y(() => {
|
|
391
|
+
if (c && h.current && F.current) {
|
|
392
|
+
const t = h.current.offsetWidth, p = F.current.offsetWidth;
|
|
393
|
+
r(Math.max(t + 16, p));
|
|
394
|
+
}
|
|
395
|
+
}, [c, o]), j(() => {
|
|
396
|
+
c && w.current ? (w.current.focus(), S && (w.current.select(), d(!1))) : l && !c && b.current && b.current.focus();
|
|
397
|
+
}, [l, c, S]), j(() => {
|
|
398
|
+
!l && c && (n(!1), r(null));
|
|
399
|
+
}, [l, c]);
|
|
400
|
+
const v = (t) => {
|
|
401
|
+
m(e, t.target.value);
|
|
402
|
+
}, s = (t) => {
|
|
403
|
+
t.target.classList.contains("fill-handle") || x(e);
|
|
404
|
+
}, R = () => {
|
|
405
|
+
n(!0), d(!0);
|
|
406
|
+
}, I = () => {
|
|
407
|
+
n(!1);
|
|
408
|
+
}, H = (t) => {
|
|
409
|
+
c ? (t.key === "Enter" || t.key === "Escape") && n(!1) : t.key === "Enter" ? (t.preventDefault(), n(!0), d(!0)) : t.key.length === 1 && !t.ctrlKey && !t.metaKey && (t.preventDefault(), m(e, t.key), n(!0));
|
|
410
|
+
}, E = (t) => {
|
|
411
|
+
t.stopPropagation(), t.preventDefault(), f(e);
|
|
412
|
+
}, D = !!g?.selected, k = !!g?.fillTarget, O = !!g?.fillHandle, G = {
|
|
413
|
+
...se,
|
|
414
|
+
...l && !D ? de : {},
|
|
415
|
+
...i && !k ? we : {}
|
|
416
|
+
}, q = {
|
|
417
|
+
...ie,
|
|
418
|
+
...O ? { backgroundColor: void 0 } : {}
|
|
419
|
+
}, P = {
|
|
389
420
|
...ce,
|
|
390
|
-
|
|
421
|
+
overflow: "hidden",
|
|
422
|
+
textOverflow: "ellipsis"
|
|
391
423
|
};
|
|
392
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ A(
|
|
393
425
|
"td",
|
|
394
426
|
{
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
427
|
+
ref: F,
|
|
428
|
+
className: W(
|
|
429
|
+
g?.cell,
|
|
430
|
+
l && g?.selected,
|
|
431
|
+
i && g?.fillTarget
|
|
399
432
|
),
|
|
400
|
-
style:
|
|
401
|
-
onMouseDown:
|
|
433
|
+
style: G,
|
|
434
|
+
onMouseDown: s,
|
|
402
435
|
onMouseEnter: () => u(e),
|
|
403
|
-
onDoubleClick:
|
|
436
|
+
onDoubleClick: R,
|
|
404
437
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ N(
|
|
406
439
|
"input",
|
|
407
440
|
{
|
|
408
|
-
ref:
|
|
441
|
+
ref: b,
|
|
409
442
|
type: "text",
|
|
410
443
|
value: o,
|
|
411
|
-
readOnly: !
|
|
412
|
-
onChange:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
444
|
+
readOnly: !0,
|
|
445
|
+
onChange: v,
|
|
446
|
+
onKeyDown: H,
|
|
447
|
+
style: P,
|
|
448
|
+
tabIndex: c ? -1 : 0
|
|
416
449
|
}
|
|
417
450
|
),
|
|
418
|
-
|
|
451
|
+
c && /* @__PURE__ */ N("div", { style: ae, children: /* @__PURE__ */ N(
|
|
452
|
+
"input",
|
|
453
|
+
{
|
|
454
|
+
ref: w,
|
|
455
|
+
type: "text",
|
|
456
|
+
value: o,
|
|
457
|
+
onChange: v,
|
|
458
|
+
onBlur: I,
|
|
459
|
+
onKeyDown: H,
|
|
460
|
+
style: {
|
|
461
|
+
...ue,
|
|
462
|
+
width: C ?? "100%"
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
) }),
|
|
466
|
+
c && /* @__PURE__ */ N("span", { ref: h, style: fe, children: o }),
|
|
467
|
+
a && /* @__PURE__ */ N(
|
|
419
468
|
"div",
|
|
420
469
|
{
|
|
421
|
-
className:
|
|
422
|
-
style:
|
|
423
|
-
onMouseDown:
|
|
470
|
+
className: W("fill-handle", g?.fillHandle),
|
|
471
|
+
style: q,
|
|
472
|
+
onMouseDown: E
|
|
424
473
|
}
|
|
425
474
|
)
|
|
426
475
|
]
|
|
427
476
|
}
|
|
428
477
|
);
|
|
429
478
|
}
|
|
430
|
-
const
|
|
479
|
+
const pe = {
|
|
431
480
|
outline: "none",
|
|
432
481
|
overflowX: "auto"
|
|
433
|
-
},
|
|
482
|
+
}, me = {
|
|
434
483
|
borderCollapse: "collapse",
|
|
435
484
|
fontSize: "12px",
|
|
436
485
|
userSelect: "none"
|
|
437
|
-
},
|
|
486
|
+
}, be = {
|
|
438
487
|
position: "sticky",
|
|
439
488
|
left: 0,
|
|
440
489
|
zIndex: 10,
|
|
@@ -442,255 +491,255 @@ const fe = {
|
|
|
442
491
|
padding: "6px 8px",
|
|
443
492
|
textAlign: "center",
|
|
444
493
|
fontWeight: 500
|
|
445
|
-
},
|
|
494
|
+
}, ye = {
|
|
446
495
|
border: "1px solid #d1d5db",
|
|
447
496
|
padding: "6px 4px",
|
|
448
497
|
textAlign: "center",
|
|
449
498
|
fontWeight: 500
|
|
450
|
-
},
|
|
499
|
+
}, xe = {
|
|
451
500
|
border: "1px solid #d1d5db",
|
|
452
501
|
padding: "4px",
|
|
453
502
|
textAlign: "center",
|
|
454
503
|
fontWeight: 500,
|
|
455
504
|
fontSize: "11px"
|
|
456
|
-
},
|
|
505
|
+
}, ge = {
|
|
457
506
|
backgroundColor: "#f3f4f6"
|
|
458
|
-
},
|
|
507
|
+
}, Se = {
|
|
459
508
|
backgroundColor: "#dbeafe",
|
|
460
509
|
color: "#1d4ed8"
|
|
461
|
-
},
|
|
510
|
+
}, Ce = {
|
|
462
511
|
backgroundColor: "#f9fafb"
|
|
463
512
|
};
|
|
464
|
-
function
|
|
513
|
+
function Ne({
|
|
465
514
|
data: e,
|
|
466
515
|
onChange: o,
|
|
467
|
-
rowHeaders:
|
|
516
|
+
rowHeaders: l,
|
|
468
517
|
colHeaders: i,
|
|
469
518
|
className: a,
|
|
470
|
-
rowHeaderTitle:
|
|
519
|
+
rowHeaderTitle: x = "",
|
|
471
520
|
styles: u
|
|
472
521
|
}) {
|
|
473
|
-
const
|
|
474
|
-
(
|
|
522
|
+
const m = U(null), f = e.length, g = $(() => i ? i.reduce(
|
|
523
|
+
(t, p) => t + p.headers.length,
|
|
475
524
|
0
|
|
476
|
-
) : e[0]?.length ?? 0, [i, e]),
|
|
477
|
-
if (!
|
|
478
|
-
const
|
|
479
|
-
return
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
groupIndex:
|
|
483
|
-
isFirstInGroup:
|
|
484
|
-
groupLabel:
|
|
485
|
-
groupRowCount:
|
|
486
|
-
rowHeader:
|
|
487
|
-
groupClassName:
|
|
488
|
-
groupDescription:
|
|
525
|
+
) : e[0]?.length ?? 0, [i, e]), c = $(() => i ? i.flatMap((t) => t.headers) : [], [i]), n = $(() => {
|
|
526
|
+
if (!l) return null;
|
|
527
|
+
const t = [];
|
|
528
|
+
return l.forEach((p, y) => {
|
|
529
|
+
p.headers.forEach((L, K) => {
|
|
530
|
+
t.push({
|
|
531
|
+
groupIndex: y,
|
|
532
|
+
isFirstInGroup: K === 0,
|
|
533
|
+
groupLabel: p.label,
|
|
534
|
+
groupRowCount: p.headers.length,
|
|
535
|
+
rowHeader: L,
|
|
536
|
+
groupClassName: p.className,
|
|
537
|
+
groupDescription: p.description
|
|
489
538
|
});
|
|
490
539
|
});
|
|
491
|
-
}),
|
|
492
|
-
}, [
|
|
493
|
-
(
|
|
494
|
-
[e, f,
|
|
495
|
-
),
|
|
496
|
-
(
|
|
497
|
-
const
|
|
498
|
-
(
|
|
499
|
-
(
|
|
500
|
-
) :
|
|
540
|
+
}), t;
|
|
541
|
+
}, [l]), S = M(
|
|
542
|
+
(t) => t.row < 0 || t.row >= f || t.col < 0 || t.col >= g ? "" : e[t.row]?.[t.col] ?? "",
|
|
543
|
+
[e, f, g]
|
|
544
|
+
), d = M(
|
|
545
|
+
(t, p) => {
|
|
546
|
+
const y = e.map(
|
|
547
|
+
(L, K) => K === t.row ? L.map(
|
|
548
|
+
(T, V) => V === t.col ? p : T
|
|
549
|
+
) : L
|
|
501
550
|
);
|
|
502
|
-
o(
|
|
551
|
+
o(y);
|
|
503
552
|
},
|
|
504
553
|
[e, o]
|
|
505
|
-
),
|
|
506
|
-
(
|
|
507
|
-
if (
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}), o(
|
|
554
|
+
), C = M(
|
|
555
|
+
(t) => {
|
|
556
|
+
if (t.length === 0) return;
|
|
557
|
+
const p = e.map((y) => [...y]);
|
|
558
|
+
t.forEach(({ coord: y, value: L }) => {
|
|
559
|
+
y.row >= 0 && y.row < f && y.col >= 0 && y.col < g && (p[y.row][y.col] = L);
|
|
560
|
+
}), o(p);
|
|
512
561
|
},
|
|
513
|
-
[e, o, f,
|
|
562
|
+
[e, o, f, g]
|
|
514
563
|
), {
|
|
515
|
-
selection:
|
|
516
|
-
isSelecting:
|
|
517
|
-
isCellSelected:
|
|
518
|
-
handleCellMouseDown:
|
|
519
|
-
handleCellMouseEnter:
|
|
520
|
-
setSelection:
|
|
521
|
-
} = oe({ containerRef:
|
|
522
|
-
selection:
|
|
523
|
-
getValue:
|
|
524
|
-
setValues:
|
|
525
|
-
setSelection:
|
|
564
|
+
selection: r,
|
|
565
|
+
isSelecting: b,
|
|
566
|
+
isCellSelected: w,
|
|
567
|
+
handleCellMouseDown: h,
|
|
568
|
+
handleCellMouseEnter: F,
|
|
569
|
+
setSelection: v
|
|
570
|
+
} = oe({ containerRef: m }), { handleKeyDown: s } = ne({
|
|
571
|
+
selection: r,
|
|
572
|
+
getValue: S,
|
|
573
|
+
setValues: C,
|
|
574
|
+
setSelection: v,
|
|
526
575
|
rowCount: f,
|
|
527
|
-
colCount:
|
|
576
|
+
colCount: g
|
|
528
577
|
}), {
|
|
529
|
-
isDraggingFill:
|
|
530
|
-
isFillTarget:
|
|
531
|
-
handleFillHandleMouseDown:
|
|
532
|
-
handleCellMouseEnterForFill:
|
|
533
|
-
} =
|
|
534
|
-
selection:
|
|
535
|
-
getValue:
|
|
536
|
-
setValues:
|
|
537
|
-
}),
|
|
538
|
-
(
|
|
539
|
-
|
|
578
|
+
isDraggingFill: R,
|
|
579
|
+
isFillTarget: I,
|
|
580
|
+
handleFillHandleMouseDown: H,
|
|
581
|
+
handleCellMouseEnterForFill: E
|
|
582
|
+
} = re({
|
|
583
|
+
selection: r,
|
|
584
|
+
getValue: S,
|
|
585
|
+
setValues: C
|
|
586
|
+
}), D = M(
|
|
587
|
+
(t) => {
|
|
588
|
+
R ? E(t) : b && F(t);
|
|
540
589
|
},
|
|
541
590
|
[
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
591
|
+
R,
|
|
592
|
+
b,
|
|
593
|
+
E,
|
|
594
|
+
F
|
|
546
595
|
]
|
|
547
|
-
),
|
|
548
|
-
(
|
|
549
|
-
|
|
596
|
+
), k = M(
|
|
597
|
+
(t, p) => {
|
|
598
|
+
d(t, p);
|
|
550
599
|
},
|
|
551
|
-
[
|
|
552
|
-
),
|
|
553
|
-
(
|
|
554
|
-
if (!
|
|
555
|
-
const
|
|
556
|
-
return !
|
|
600
|
+
[d]
|
|
601
|
+
), O = M(
|
|
602
|
+
(t) => {
|
|
603
|
+
if (!r.start) return !1;
|
|
604
|
+
const p = B(r);
|
|
605
|
+
return !p.start || !p.end ? !1 : t.row === p.end.row && t.col === p.end.col;
|
|
557
606
|
},
|
|
558
|
-
[
|
|
559
|
-
),
|
|
560
|
-
...
|
|
561
|
-
...!
|
|
562
|
-
}),
|
|
563
|
-
...
|
|
564
|
-
...!
|
|
565
|
-
}),
|
|
566
|
-
...
|
|
567
|
-
...!
|
|
607
|
+
[r]
|
|
608
|
+
), G = (t) => ({
|
|
609
|
+
...be,
|
|
610
|
+
...!t && !u?.rowHeader ? ge : {}
|
|
611
|
+
}), q = (t) => ({
|
|
612
|
+
...ye,
|
|
613
|
+
...!t && !u?.colGroup ? Se : {}
|
|
614
|
+
}), P = (t) => ({
|
|
615
|
+
...xe,
|
|
616
|
+
...!t && !u?.colHeader ? Ce : {}
|
|
568
617
|
});
|
|
569
|
-
return /* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ N(
|
|
570
619
|
"div",
|
|
571
620
|
{
|
|
572
|
-
ref:
|
|
621
|
+
ref: m,
|
|
573
622
|
className: a,
|
|
574
|
-
style:
|
|
623
|
+
style: pe,
|
|
575
624
|
tabIndex: 0,
|
|
576
|
-
onKeyDown:
|
|
577
|
-
children: /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
i && /* @__PURE__ */
|
|
580
|
-
|
|
625
|
+
onKeyDown: s,
|
|
626
|
+
children: /* @__PURE__ */ A("table", { style: me, children: [
|
|
627
|
+
/* @__PURE__ */ A("thead", { children: [
|
|
628
|
+
i && /* @__PURE__ */ A("tr", { children: [
|
|
629
|
+
l && /* @__PURE__ */ N(
|
|
581
630
|
"th",
|
|
582
631
|
{
|
|
583
632
|
colSpan: 2,
|
|
584
633
|
className: u?.rowHeader,
|
|
585
|
-
style:
|
|
586
|
-
children:
|
|
634
|
+
style: G(),
|
|
635
|
+
children: x
|
|
587
636
|
}
|
|
588
637
|
),
|
|
589
|
-
i.map((
|
|
638
|
+
i.map((t, p) => /* @__PURE__ */ N(
|
|
590
639
|
"th",
|
|
591
640
|
{
|
|
592
|
-
colSpan:
|
|
593
|
-
className:
|
|
594
|
-
style:
|
|
595
|
-
title:
|
|
596
|
-
children:
|
|
641
|
+
colSpan: t.headers.length,
|
|
642
|
+
className: W(u?.colGroup, t.className),
|
|
643
|
+
style: q(t.className),
|
|
644
|
+
title: t.description,
|
|
645
|
+
children: t.label
|
|
597
646
|
},
|
|
598
|
-
|
|
647
|
+
p
|
|
599
648
|
))
|
|
600
649
|
] }),
|
|
601
|
-
i && /* @__PURE__ */
|
|
602
|
-
|
|
650
|
+
i && /* @__PURE__ */ A("tr", { children: [
|
|
651
|
+
l && /* @__PURE__ */ N(
|
|
603
652
|
"th",
|
|
604
653
|
{
|
|
605
654
|
colSpan: 2,
|
|
606
655
|
className: u?.rowHeader,
|
|
607
|
-
style:
|
|
656
|
+
style: G()
|
|
608
657
|
}
|
|
609
658
|
),
|
|
610
|
-
|
|
659
|
+
c.map((t) => /* @__PURE__ */ N(
|
|
611
660
|
"th",
|
|
612
661
|
{
|
|
613
|
-
className:
|
|
614
|
-
style:
|
|
615
|
-
title:
|
|
616
|
-
children:
|
|
662
|
+
className: W(u?.colHeader, t.className),
|
|
663
|
+
style: P(t.className),
|
|
664
|
+
title: t.description,
|
|
665
|
+
children: t.label
|
|
617
666
|
},
|
|
618
|
-
|
|
667
|
+
t.key
|
|
619
668
|
))
|
|
620
669
|
] })
|
|
621
670
|
] }),
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
const
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
-
|
|
626
|
-
|
|
671
|
+
/* @__PURE__ */ N("tbody", { children: e.map((t, p) => {
|
|
672
|
+
const y = n?.[p];
|
|
673
|
+
return /* @__PURE__ */ A("tr", { children: [
|
|
674
|
+
y && /* @__PURE__ */ A(Q, { children: [
|
|
675
|
+
y.isFirstInGroup && /* @__PURE__ */ N(
|
|
627
676
|
"td",
|
|
628
677
|
{
|
|
629
|
-
rowSpan:
|
|
630
|
-
className:
|
|
631
|
-
style:
|
|
632
|
-
title:
|
|
633
|
-
children:
|
|
678
|
+
rowSpan: y.groupRowCount,
|
|
679
|
+
className: W(u?.rowHeader, y.groupClassName),
|
|
680
|
+
style: G(y.groupClassName),
|
|
681
|
+
title: y.groupDescription,
|
|
682
|
+
children: y.groupLabel
|
|
634
683
|
}
|
|
635
684
|
),
|
|
636
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ N(
|
|
637
686
|
"td",
|
|
638
687
|
{
|
|
639
|
-
className:
|
|
640
|
-
style:
|
|
641
|
-
title:
|
|
642
|
-
children:
|
|
688
|
+
className: W(u?.rowHeader, y.rowHeader.className),
|
|
689
|
+
style: G(y.rowHeader.className),
|
|
690
|
+
title: y.rowHeader.description,
|
|
691
|
+
children: y.rowHeader.label
|
|
643
692
|
}
|
|
644
693
|
)
|
|
645
694
|
] }),
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
return /* @__PURE__ */
|
|
649
|
-
|
|
695
|
+
t.map((L, K) => {
|
|
696
|
+
const T = { row: p, col: K }, V = w(T), _ = I(T), J = O(T);
|
|
697
|
+
return /* @__PURE__ */ N(
|
|
698
|
+
he,
|
|
650
699
|
{
|
|
651
|
-
coord:
|
|
652
|
-
value:
|
|
653
|
-
isSelected:
|
|
700
|
+
coord: T,
|
|
701
|
+
value: S(T),
|
|
702
|
+
isSelected: V,
|
|
654
703
|
isFillTarget: _,
|
|
655
|
-
showFillHandle: J && !
|
|
656
|
-
onMouseDown:
|
|
657
|
-
onMouseEnter:
|
|
658
|
-
onChange:
|
|
659
|
-
onFillHandleMouseDown:
|
|
704
|
+
showFillHandle: J && !R,
|
|
705
|
+
onMouseDown: h,
|
|
706
|
+
onMouseEnter: D,
|
|
707
|
+
onChange: k,
|
|
708
|
+
onFillHandleMouseDown: H,
|
|
660
709
|
styles: u
|
|
661
710
|
},
|
|
662
|
-
|
|
711
|
+
K
|
|
663
712
|
);
|
|
664
713
|
})
|
|
665
|
-
] },
|
|
714
|
+
] }, p);
|
|
666
715
|
}) })
|
|
667
716
|
] })
|
|
668
717
|
}
|
|
669
718
|
);
|
|
670
719
|
}
|
|
671
|
-
function
|
|
720
|
+
function Re(e) {
|
|
672
721
|
const o = typeof e == "string" ? parseFloat(e.replace(/,/g, "")) : e;
|
|
673
722
|
return isNaN(o) ? "0" : new Intl.NumberFormat("ko-KR").format(o);
|
|
674
723
|
}
|
|
675
|
-
function
|
|
724
|
+
function He(e) {
|
|
676
725
|
const o = parseInt(e.replace(/,/g, ""), 10);
|
|
677
726
|
return isNaN(o) ? 0 : o;
|
|
678
727
|
}
|
|
679
728
|
export {
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
729
|
+
Ne as ExcelGrid,
|
|
730
|
+
he as GridCell,
|
|
731
|
+
W as cn,
|
|
732
|
+
ke as coordToKey,
|
|
733
|
+
Re as formatCurrency,
|
|
734
|
+
ve as getCellsInRange,
|
|
735
|
+
Fe as getFillTargetCells,
|
|
736
|
+
Z as isCellInRange,
|
|
737
|
+
Ee as keyToCoord,
|
|
689
738
|
B as normalizeRange,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
739
|
+
He as parseCurrency,
|
|
740
|
+
ee as parseTSV,
|
|
741
|
+
te as toTSV,
|
|
742
|
+
ne as useGridClipboard,
|
|
743
|
+
re as useGridDragFill,
|
|
695
744
|
oe as useGridSelection
|
|
696
745
|
};
|