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