react-excel-lite 0.2.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 +147 -26
- 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 +479 -474
- package/dist/react-excel-lite.umd.cjs +2 -2
- package/dist/types.d.ts +5 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/react-excel-lite.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
function
|
|
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
|
+
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
|
|
10
|
-
const [
|
|
11
|
-
return { row:
|
|
9
|
+
function Re(e) {
|
|
10
|
+
const [t, n] = e.split("-").map(Number);
|
|
11
|
+
return { row: t, col: n };
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!e || !
|
|
15
|
-
const
|
|
16
|
-
for (let
|
|
17
|
-
for (let
|
|
18
|
-
u.push({ row:
|
|
13
|
+
function Ie(e, t) {
|
|
14
|
+
if (!e || !t) return e ? [e] : [];
|
|
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
|
+
for (let p = n; p <= c; p++)
|
|
17
|
+
for (let h = a; h <= y; h++)
|
|
18
|
+
u.push({ row: p, col: h });
|
|
19
19
|
return u;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
if (!
|
|
23
|
-
const
|
|
24
|
-
return e.row >=
|
|
21
|
+
function ne(e, t) {
|
|
22
|
+
if (!t.start) return !1;
|
|
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
|
|
27
|
-
return e.split(/\r?\n/).filter((
|
|
26
|
+
function le(e) {
|
|
27
|
+
return e.split(/\r?\n/).filter((t) => t.trim()).map((t) => t.split(" ").map((n) => n.trim()));
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return e.map((
|
|
29
|
+
function re(e) {
|
|
30
|
+
return e.map((t) => t.join(" ")).join(`
|
|
31
31
|
`);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function U(e) {
|
|
34
34
|
return !e.start || !e.end ? e : {
|
|
35
35
|
start: {
|
|
36
36
|
row: Math.min(e.start.row, e.end.row),
|
|
@@ -42,289 +42,289 @@ function B(e) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
if (e.row ===
|
|
45
|
+
function ze(e, t) {
|
|
46
|
+
if (e.row === t.row && e.col === t.col)
|
|
47
47
|
return [];
|
|
48
|
-
const
|
|
49
|
-
for (let
|
|
50
|
-
for (let
|
|
51
|
-
|
|
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
|
+
for (let p = n; p <= c; p++)
|
|
50
|
+
for (let h = a; h <= y; h++)
|
|
51
|
+
p === e.row && h === e.col || u.push({ row: p, col: h });
|
|
52
52
|
return u;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function se({
|
|
55
55
|
containerRef: e
|
|
56
56
|
}) {
|
|
57
|
-
const [
|
|
57
|
+
const [t, n] = G({
|
|
58
58
|
start: null,
|
|
59
59
|
end: null
|
|
60
|
-
}), [
|
|
61
|
-
|
|
62
|
-
}, []), u =
|
|
63
|
-
(
|
|
64
|
-
|
|
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
|
-
[
|
|
67
|
-
),
|
|
66
|
+
[c]
|
|
67
|
+
), p = k(() => {
|
|
68
68
|
a(!1);
|
|
69
|
-
}, []),
|
|
70
|
-
|
|
71
|
-
}, []),
|
|
72
|
-
(
|
|
73
|
-
[
|
|
69
|
+
}, []), h = k(() => {
|
|
70
|
+
n({ start: null, end: null }), a(!1);
|
|
71
|
+
}, []), S = k(
|
|
72
|
+
(d) => ne(d, t),
|
|
73
|
+
[t]
|
|
74
74
|
);
|
|
75
|
-
return
|
|
76
|
-
const
|
|
77
|
-
|
|
75
|
+
return q(() => {
|
|
76
|
+
const d = () => {
|
|
77
|
+
c && a(!1);
|
|
78
78
|
};
|
|
79
|
-
return window.addEventListener("mouseup",
|
|
80
|
-
}, [
|
|
81
|
-
const
|
|
82
|
-
e.current && !e.current.contains(
|
|
79
|
+
return window.addEventListener("mouseup", d), () => window.removeEventListener("mouseup", d);
|
|
80
|
+
}, [c]), q(() => {
|
|
81
|
+
const d = (o) => {
|
|
82
|
+
e.current && !e.current.contains(o.target) && h();
|
|
83
83
|
};
|
|
84
|
-
return document.addEventListener("mousedown",
|
|
85
|
-
}, [e,
|
|
86
|
-
selection:
|
|
87
|
-
isSelecting:
|
|
88
|
-
isCellSelected:
|
|
89
|
-
handleCellMouseDown:
|
|
84
|
+
return document.addEventListener("mousedown", d), () => document.removeEventListener("mousedown", d);
|
|
85
|
+
}, [e, h]), {
|
|
86
|
+
selection: t,
|
|
87
|
+
isSelecting: c,
|
|
88
|
+
isCellSelected: S,
|
|
89
|
+
handleCellMouseDown: y,
|
|
90
90
|
handleCellMouseEnter: u,
|
|
91
|
-
handleMouseUp:
|
|
92
|
-
clearSelection:
|
|
93
|
-
setSelection:
|
|
91
|
+
handleMouseUp: p,
|
|
92
|
+
clearSelection: h,
|
|
93
|
+
setSelection: n
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function ce({
|
|
97
97
|
selection: e,
|
|
98
|
-
getValue:
|
|
99
|
-
setValues:
|
|
100
|
-
setSelection:
|
|
98
|
+
getValue: t,
|
|
99
|
+
setValues: n,
|
|
100
|
+
setSelection: c,
|
|
101
101
|
rowCount: a,
|
|
102
|
-
colCount:
|
|
102
|
+
colCount: y
|
|
103
103
|
}) {
|
|
104
|
-
const u =
|
|
105
|
-
const
|
|
106
|
-
if (!
|
|
107
|
-
const
|
|
108
|
-
for (let
|
|
104
|
+
const u = k(() => {
|
|
105
|
+
const o = U(e);
|
|
106
|
+
if (!o.start || !o.end) return [];
|
|
107
|
+
const x = [];
|
|
108
|
+
for (let f = o.start.row; f <= o.end.row; f++) {
|
|
109
109
|
const C = [];
|
|
110
|
-
for (let
|
|
111
|
-
C.push(
|
|
112
|
-
|
|
110
|
+
for (let s = o.start.col; s <= o.end.col; s++)
|
|
111
|
+
C.push(t({ row: f, col: s }));
|
|
112
|
+
x.push(C);
|
|
113
113
|
}
|
|
114
|
-
return
|
|
115
|
-
}, [e,
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
114
|
+
return x;
|
|
115
|
+
}, [e, t]), p = k(async () => {
|
|
116
|
+
const o = u();
|
|
117
|
+
if (o.length === 0) return;
|
|
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
|
-
}, [u]),
|
|
124
|
+
}, [u]), h = k(async () => {
|
|
125
125
|
if (e.start)
|
|
126
126
|
try {
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
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
|
-
}),
|
|
137
|
-
} catch (
|
|
138
|
-
console.error("Clipboard paste failed:",
|
|
136
|
+
}), s.length > 0 && n(s);
|
|
137
|
+
} catch (o) {
|
|
138
|
+
console.error("Clipboard paste failed:", o);
|
|
139
139
|
}
|
|
140
|
-
}, [e.start,
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
for (let
|
|
145
|
-
for (let C =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, [e,
|
|
149
|
-
(
|
|
150
|
-
if (!(
|
|
151
|
-
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
let C =
|
|
155
|
-
switch (
|
|
140
|
+
}, [e.start, n, a, y]), S = k(() => {
|
|
141
|
+
const o = U(e);
|
|
142
|
+
if (!o.start || !o.end) return;
|
|
143
|
+
const x = [];
|
|
144
|
+
for (let f = o.start.row; f <= o.end.row; f++)
|
|
145
|
+
for (let C = o.start.col; C <= o.end.col; C++)
|
|
146
|
+
x.push({ coord: { row: f, col: C }, value: "" });
|
|
147
|
+
x.length > 0 && n(x);
|
|
148
|
+
}, [e, n]), d = k(
|
|
149
|
+
(o) => {
|
|
150
|
+
if (!(o.target instanceof HTMLInputElement && !o.target.readOnly)) {
|
|
151
|
+
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(o.key)) {
|
|
152
|
+
o.preventDefault();
|
|
153
|
+
const f = U(e).start ?? { row: 0, col: 0 };
|
|
154
|
+
let C = f.row, s = f.col;
|
|
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(a - 1,
|
|
160
|
+
C = Math.min(a - 1, f.row + 1);
|
|
161
161
|
break;
|
|
162
162
|
case "ArrowLeft":
|
|
163
|
-
|
|
163
|
+
s = Math.max(0, f.col - 1);
|
|
164
164
|
break;
|
|
165
165
|
case "ArrowRight":
|
|
166
|
-
|
|
166
|
+
s = Math.min(y - 1, f.col + 1);
|
|
167
167
|
break;
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
start: { row: C, col:
|
|
171
|
-
end: { row: C, col:
|
|
169
|
+
c({
|
|
170
|
+
start: { row: C, col: s },
|
|
171
|
+
end: { row: C, col: s }
|
|
172
172
|
});
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
(
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
p,
|
|
180
|
+
h,
|
|
181
|
+
S,
|
|
182
182
|
e,
|
|
183
|
-
|
|
183
|
+
c,
|
|
184
184
|
a,
|
|
185
|
-
|
|
185
|
+
y
|
|
186
186
|
]
|
|
187
187
|
);
|
|
188
188
|
return {
|
|
189
|
-
handleCopy:
|
|
190
|
-
handlePaste:
|
|
191
|
-
handleKeyDown:
|
|
189
|
+
handleCopy: p,
|
|
190
|
+
handlePaste: h,
|
|
191
|
+
handleKeyDown: d
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function ie(e) {
|
|
195
195
|
if (e.trim() === "") return null;
|
|
196
|
-
const
|
|
197
|
-
return isNaN(
|
|
196
|
+
const t = Number(e);
|
|
197
|
+
return isNaN(t) ? null : t;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Q(e) {
|
|
200
200
|
if (e.length === 0) return null;
|
|
201
|
-
const
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
return { numbers:
|
|
206
|
-
const
|
|
207
|
-
for (let a = 2; a <
|
|
208
|
-
if (
|
|
209
|
-
return { numbers:
|
|
210
|
-
return { numbers:
|
|
201
|
+
const t = e.map(ie);
|
|
202
|
+
if (t.some((a) => a === null)) return null;
|
|
203
|
+
const n = t;
|
|
204
|
+
if (n.length === 1)
|
|
205
|
+
return { numbers: n, diff: 0 };
|
|
206
|
+
const c = n[1] - n[0];
|
|
207
|
+
for (let a = 2; a < n.length; a++)
|
|
208
|
+
if (n[a] - n[a - 1] !== c)
|
|
209
|
+
return { numbers: n, diff: 0 };
|
|
210
|
+
return { numbers: n, diff: c };
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function ae({
|
|
213
213
|
selection: e,
|
|
214
|
-
getValue:
|
|
215
|
-
setValues:
|
|
214
|
+
getValue: t,
|
|
215
|
+
setValues: n
|
|
216
216
|
}) {
|
|
217
|
-
const [
|
|
218
|
-
a(
|
|
219
|
-
}, []),
|
|
220
|
-
(
|
|
221
|
-
if (!
|
|
222
|
-
const
|
|
223
|
-
if (!
|
|
224
|
-
|
|
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
|
+
(s) => {
|
|
221
|
+
if (!p || !e.start) return;
|
|
222
|
+
const m = U(e);
|
|
223
|
+
if (!m.start || !m.end) return;
|
|
224
|
+
d(s);
|
|
225
225
|
const w = {
|
|
226
|
-
row: Math.min(
|
|
227
|
-
col: Math.min(
|
|
228
|
-
},
|
|
229
|
-
row: Math.max(
|
|
230
|
-
col: Math.max(
|
|
226
|
+
row: Math.min(m.start.row, s.row),
|
|
227
|
+
col: Math.min(m.start.col, s.col)
|
|
228
|
+
}, i = {
|
|
229
|
+
row: Math.max(m.end.row, s.row),
|
|
230
|
+
col: Math.max(m.end.col, s.col)
|
|
231
231
|
}, F = [];
|
|
232
|
-
for (let
|
|
233
|
-
for (let
|
|
234
|
-
|
|
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
235
|
u(F);
|
|
236
236
|
},
|
|
237
|
-
[
|
|
238
|
-
),
|
|
239
|
-
if (!e.start ||
|
|
240
|
-
a(null), u([]),
|
|
237
|
+
[p, e]
|
|
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
|
-
const
|
|
244
|
-
if (!
|
|
245
|
-
a(null), u([]),
|
|
243
|
+
const s = U(e);
|
|
244
|
+
if (!s.start || !s.end) {
|
|
245
|
+
a(null), u([]), h(!1), d(null);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
let
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
} else if (
|
|
255
|
-
const
|
|
256
|
-
|
|
248
|
+
const m = [], w = s.start, i = s.end, F = i.row - w.row + 1, N = i.col - w.col + 1;
|
|
249
|
+
y.forEach((r) => {
|
|
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 (
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
} else if (
|
|
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 (
|
|
269
|
-
const
|
|
270
|
-
for (let
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
} else if (
|
|
278
|
-
const
|
|
279
|
-
|
|
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
|
+
if (v && v.diff !== 0) {
|
|
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 (
|
|
284
|
-
const
|
|
285
|
-
for (let
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
} else if (
|
|
293
|
-
const
|
|
294
|
-
|
|
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
|
+
if (v && v.diff !== 0) {
|
|
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
|
-
|
|
299
|
-
}),
|
|
300
|
-
}, [e,
|
|
301
|
-
(
|
|
302
|
-
(
|
|
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
|
+
(s) => y.some(
|
|
302
|
+
(m) => m.row === s.row && m.col === s.col
|
|
303
303
|
),
|
|
304
|
-
[
|
|
304
|
+
[y]
|
|
305
305
|
);
|
|
306
|
-
return
|
|
307
|
-
const
|
|
308
|
-
|
|
306
|
+
return q(() => {
|
|
307
|
+
const s = () => {
|
|
308
|
+
p && f();
|
|
309
309
|
};
|
|
310
|
-
return window.addEventListener("mouseup",
|
|
311
|
-
}, [
|
|
312
|
-
fillSource:
|
|
313
|
-
fillTargets:
|
|
314
|
-
isDraggingFill:
|
|
310
|
+
return window.addEventListener("mouseup", s), () => window.removeEventListener("mouseup", s);
|
|
311
|
+
}, [p, f]), {
|
|
312
|
+
fillSource: c,
|
|
313
|
+
fillTargets: y,
|
|
314
|
+
isDraggingFill: p,
|
|
315
315
|
isFillTarget: C,
|
|
316
|
-
handleFillHandleMouseDown:
|
|
317
|
-
handleCellMouseEnterForFill:
|
|
318
|
-
handleFillMouseUp:
|
|
316
|
+
handleFillHandleMouseDown: o,
|
|
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 se = {
|
|
|
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 se = {
|
|
|
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 se = {
|
|
|
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
|
-
value:
|
|
380
|
-
isSelected:
|
|
381
|
-
isFillTarget:
|
|
379
|
+
value: t,
|
|
380
|
+
isSelected: n,
|
|
381
|
+
isFillTarget: c,
|
|
382
382
|
showFillHandle: a,
|
|
383
|
-
onMouseDown:
|
|
383
|
+
onMouseDown: y,
|
|
384
384
|
onMouseEnter: u,
|
|
385
|
-
onChange:
|
|
386
|
-
onFillHandleMouseDown:
|
|
387
|
-
styles:
|
|
385
|
+
onChange: p,
|
|
386
|
+
onFillHandleMouseDown: h,
|
|
387
|
+
styles: S,
|
|
388
|
+
cellClassName: d
|
|
388
389
|
}) {
|
|
389
|
-
const [
|
|
390
|
-
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
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
|
-
}, [
|
|
398
|
-
!
|
|
399
|
-
}, [
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
|
|
404
|
-
},
|
|
405
|
-
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
...
|
|
414
|
-
...
|
|
415
|
-
...
|
|
416
|
-
},
|
|
417
|
-
...
|
|
418
|
-
...
|
|
419
|
-
},
|
|
420
|
-
...
|
|
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) => {
|
|
402
|
+
p(e, D.target.value);
|
|
403
|
+
}, I = (D) => {
|
|
404
|
+
D.target.classList.contains("fill-handle") || y(e);
|
|
405
|
+
}, z = () => {
|
|
406
|
+
x(!0), C(!0);
|
|
407
|
+
}, L = () => {
|
|
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, $ = {
|
|
414
|
+
...ue,
|
|
415
|
+
...n && !E ? me : {},
|
|
416
|
+
...c && !P ? be : {}
|
|
417
|
+
}, X = {
|
|
418
|
+
...de,
|
|
419
|
+
...V ? { backgroundColor: void 0 } : {}
|
|
420
|
+
}, H = {
|
|
421
|
+
...fe,
|
|
421
422
|
overflow: "hidden",
|
|
422
423
|
textOverflow: "ellipsis"
|
|
423
424
|
};
|
|
424
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ K(
|
|
425
426
|
"td",
|
|
426
427
|
{
|
|
427
|
-
ref:
|
|
428
|
-
className:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
ref: N,
|
|
429
|
+
className: B(
|
|
430
|
+
S?.cell,
|
|
431
|
+
n && S?.selected,
|
|
432
|
+
c && S?.fillTarget,
|
|
433
|
+
d
|
|
432
434
|
),
|
|
433
|
-
style:
|
|
434
|
-
onMouseDown:
|
|
435
|
+
style: $,
|
|
436
|
+
onMouseDown: I,
|
|
435
437
|
onMouseEnter: () => u(e),
|
|
436
|
-
onDoubleClick:
|
|
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
|
-
value:
|
|
445
|
+
value: t,
|
|
444
446
|
readOnly: !0,
|
|
445
|
-
onChange:
|
|
446
|
-
onKeyDown:
|
|
447
|
-
style:
|
|
448
|
-
tabIndex:
|
|
447
|
+
onChange: r,
|
|
448
|
+
onKeyDown: M,
|
|
449
|
+
style: H,
|
|
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
|
-
value:
|
|
457
|
-
onChange:
|
|
458
|
-
onBlur:
|
|
459
|
-
onKeyDown:
|
|
458
|
+
value: t,
|
|
459
|
+
onChange: r,
|
|
460
|
+
onBlur: L,
|
|
461
|
+
onKeyDown: M,
|
|
460
462
|
style: {
|
|
461
|
-
...
|
|
462
|
-
width:
|
|
463
|
+
...he,
|
|
464
|
+
width: s ?? "100%"
|
|
463
465
|
}
|
|
464
466
|
}
|
|
465
467
|
) }),
|
|
466
|
-
|
|
467
|
-
a && /* @__PURE__ */
|
|
468
|
+
o && /* @__PURE__ */ R("span", { ref: F, style: pe, children: t }),
|
|
469
|
+
a && /* @__PURE__ */ R(
|
|
468
470
|
"div",
|
|
469
471
|
{
|
|
470
|
-
className:
|
|
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,255 +493,258 @@ const pe = {
|
|
|
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
|
-
onChange:
|
|
516
|
-
rowHeaders:
|
|
517
|
-
colHeaders:
|
|
517
|
+
onChange: t,
|
|
518
|
+
rowHeaders: n,
|
|
519
|
+
colHeaders: c,
|
|
518
520
|
className: a,
|
|
519
|
-
rowHeaderTitle:
|
|
520
|
-
styles: u
|
|
521
|
+
rowHeaderTitle: y = "",
|
|
522
|
+
styles: u,
|
|
523
|
+
cellStyles: p
|
|
521
524
|
}) {
|
|
522
|
-
const
|
|
523
|
-
(
|
|
525
|
+
const h = O(null), S = e.length, d = j(() => c ? c.reduce(
|
|
526
|
+
(l, b) => l + b.headers.length,
|
|
524
527
|
0
|
|
525
|
-
) : e[0]?.length ?? 0, [
|
|
526
|
-
if (!
|
|
527
|
-
const
|
|
528
|
-
return
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
groupIndex:
|
|
532
|
-
isFirstInGroup:
|
|
533
|
-
groupLabel:
|
|
534
|
-
groupRowCount:
|
|
535
|
-
rowHeader:
|
|
536
|
-
groupClassName:
|
|
537
|
-
groupDescription:
|
|
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(() => {
|
|
529
|
+
if (!n) return null;
|
|
530
|
+
const l = [];
|
|
531
|
+
return n.forEach((b, g) => {
|
|
532
|
+
b.headers.forEach((A, W) => {
|
|
533
|
+
l.push({
|
|
534
|
+
groupIndex: g,
|
|
535
|
+
isFirstInGroup: W === 0,
|
|
536
|
+
groupLabel: b.label,
|
|
537
|
+
groupRowCount: b.headers.length,
|
|
538
|
+
rowHeader: A,
|
|
539
|
+
groupClassName: b.className,
|
|
540
|
+
groupDescription: b.description
|
|
538
541
|
});
|
|
539
542
|
});
|
|
540
|
-
}),
|
|
541
|
-
}, [
|
|
542
|
-
(
|
|
543
|
-
[e,
|
|
544
|
-
),
|
|
545
|
-
(
|
|
546
|
-
const
|
|
547
|
-
(
|
|
548
|
-
(T,
|
|
549
|
-
) :
|
|
543
|
+
}), l;
|
|
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(
|
|
548
|
+
(l, b) => {
|
|
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
|
-
|
|
554
|
+
t(g);
|
|
552
555
|
},
|
|
553
|
-
[e,
|
|
554
|
-
),
|
|
555
|
-
(
|
|
556
|
-
if (
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}),
|
|
556
|
+
[e, t]
|
|
557
|
+
), w = k(
|
|
558
|
+
(l) => {
|
|
559
|
+
if (l.length === 0) return;
|
|
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);
|
|
563
|
+
}), t(b);
|
|
561
564
|
},
|
|
562
|
-
[e,
|
|
565
|
+
[e, t, S, d]
|
|
563
566
|
), {
|
|
564
|
-
selection:
|
|
565
|
-
isSelecting:
|
|
566
|
-
isCellSelected:
|
|
567
|
-
handleCellMouseDown:
|
|
568
|
-
handleCellMouseEnter:
|
|
569
|
-
setSelection:
|
|
570
|
-
} =
|
|
571
|
-
selection:
|
|
572
|
-
getValue:
|
|
573
|
-
setValues:
|
|
574
|
-
setSelection:
|
|
575
|
-
rowCount:
|
|
576
|
-
colCount:
|
|
567
|
+
selection: i,
|
|
568
|
+
isSelecting: F,
|
|
569
|
+
isCellSelected: N,
|
|
570
|
+
handleCellMouseDown: r,
|
|
571
|
+
handleCellMouseEnter: I,
|
|
572
|
+
setSelection: z
|
|
573
|
+
} = se({ containerRef: h }), { handleKeyDown: L } = ce({
|
|
574
|
+
selection: i,
|
|
575
|
+
getValue: s,
|
|
576
|
+
setValues: w,
|
|
577
|
+
setSelection: z,
|
|
578
|
+
rowCount: S,
|
|
579
|
+
colCount: d
|
|
577
580
|
}), {
|
|
578
|
-
isDraggingFill:
|
|
579
|
-
isFillTarget:
|
|
580
|
-
handleFillHandleMouseDown:
|
|
581
|
-
handleCellMouseEnterForFill:
|
|
582
|
-
} =
|
|
583
|
-
selection:
|
|
584
|
-
getValue:
|
|
585
|
-
setValues:
|
|
586
|
-
}),
|
|
587
|
-
(
|
|
588
|
-
|
|
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(
|
|
590
|
+
(l) => {
|
|
591
|
+
M ? P(l) : F && I(l);
|
|
589
592
|
},
|
|
590
593
|
[
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
594
|
+
M,
|
|
595
|
+
F,
|
|
596
|
+
P,
|
|
597
|
+
I
|
|
595
598
|
]
|
|
596
|
-
),
|
|
597
|
-
(
|
|
598
|
-
|
|
599
|
+
), $ = k(
|
|
600
|
+
(l, b) => {
|
|
601
|
+
m(l, b);
|
|
599
602
|
},
|
|
600
|
-
[
|
|
601
|
-
),
|
|
602
|
-
(
|
|
603
|
-
if (!
|
|
604
|
-
const
|
|
605
|
-
return !
|
|
603
|
+
[m]
|
|
604
|
+
), X = k(
|
|
605
|
+
(l) => {
|
|
606
|
+
if (!i.start) return !1;
|
|
607
|
+
const b = U(i);
|
|
608
|
+
return !b.start || !b.end ? !1 : l.row === b.end.row && l.col === b.end.col;
|
|
606
609
|
},
|
|
607
|
-
[
|
|
608
|
-
),
|
|
609
|
-
...
|
|
610
|
-
...!
|
|
611
|
-
}),
|
|
612
|
-
...
|
|
613
|
-
...!
|
|
614
|
-
}),
|
|
615
|
-
...
|
|
616
|
-
...!
|
|
610
|
+
[i]
|
|
611
|
+
), H = (l) => ({
|
|
612
|
+
...Se,
|
|
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:
|
|
624
|
+
ref: h,
|
|
622
625
|
className: a,
|
|
623
|
-
style:
|
|
626
|
+
style: xe,
|
|
624
627
|
tabIndex: 0,
|
|
625
|
-
onKeyDown:
|
|
626
|
-
children: /* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
|
|
629
|
-
|
|
628
|
+
onKeyDown: L,
|
|
629
|
+
children: /* @__PURE__ */ K("table", { style: ge, children: [
|
|
630
|
+
/* @__PURE__ */ K("thead", { children: [
|
|
631
|
+
c && x && /* @__PURE__ */ K("tr", { children: [
|
|
632
|
+
n && /* @__PURE__ */ R(
|
|
630
633
|
"th",
|
|
631
634
|
{
|
|
632
|
-
colSpan: 2,
|
|
635
|
+
colSpan: f ? 2 : 1,
|
|
633
636
|
className: u?.rowHeader,
|
|
634
|
-
style:
|
|
635
|
-
children:
|
|
637
|
+
style: H(),
|
|
638
|
+
children: y
|
|
636
639
|
}
|
|
637
640
|
),
|
|
638
|
-
|
|
641
|
+
c.map((l, b) => /* @__PURE__ */ R(
|
|
639
642
|
"th",
|
|
640
643
|
{
|
|
641
|
-
colSpan:
|
|
642
|
-
className:
|
|
643
|
-
style:
|
|
644
|
-
title:
|
|
645
|
-
children:
|
|
644
|
+
colSpan: l.headers.length,
|
|
645
|
+
className: B(u?.colGroup, l.className),
|
|
646
|
+
style: D(l.className),
|
|
647
|
+
title: l.description,
|
|
648
|
+
children: l.label ?? ""
|
|
646
649
|
},
|
|
647
|
-
|
|
650
|
+
b
|
|
648
651
|
))
|
|
649
652
|
] }),
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
c && /* @__PURE__ */ K("tr", { children: [
|
|
654
|
+
n && /* @__PURE__ */ R(
|
|
652
655
|
"th",
|
|
653
656
|
{
|
|
654
|
-
colSpan: 2,
|
|
657
|
+
colSpan: f ? 2 : 1,
|
|
655
658
|
className: u?.rowHeader,
|
|
656
|
-
style:
|
|
659
|
+
style: H(),
|
|
660
|
+
children: !x && y
|
|
657
661
|
}
|
|
658
662
|
),
|
|
659
|
-
|
|
663
|
+
o.map((l) => /* @__PURE__ */ R(
|
|
660
664
|
"th",
|
|
661
665
|
{
|
|
662
|
-
className:
|
|
663
|
-
style:
|
|
664
|
-
title:
|
|
665
|
-
children:
|
|
666
|
+
className: B(u?.colHeader, l.className),
|
|
667
|
+
style: _(l.className),
|
|
668
|
+
title: l.description,
|
|
669
|
+
children: l.label
|
|
666
670
|
},
|
|
667
|
-
|
|
671
|
+
l.key
|
|
668
672
|
))
|
|
669
673
|
] })
|
|
670
674
|
] }),
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
const
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
|
|
675
|
-
|
|
675
|
+
/* @__PURE__ */ R("tbody", { children: e.map((l, b) => {
|
|
676
|
+
const g = C?.[b];
|
|
677
|
+
return /* @__PURE__ */ K("tr", { children: [
|
|
678
|
+
g && /* @__PURE__ */ K(te, { children: [
|
|
679
|
+
f && g.isFirstInGroup && /* @__PURE__ */ R(
|
|
676
680
|
"td",
|
|
677
681
|
{
|
|
678
|
-
rowSpan:
|
|
679
|
-
className:
|
|
680
|
-
style:
|
|
681
|
-
title:
|
|
682
|
-
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 ?? ""
|
|
683
687
|
}
|
|
684
688
|
),
|
|
685
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ R(
|
|
686
690
|
"td",
|
|
687
691
|
{
|
|
688
|
-
className:
|
|
689
|
-
style:
|
|
690
|
-
title:
|
|
691
|
-
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
|
|
692
696
|
}
|
|
693
697
|
)
|
|
694
698
|
] }),
|
|
695
|
-
|
|
696
|
-
const T = { row:
|
|
697
|
-
return /* @__PURE__ */
|
|
698
|
-
|
|
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,
|
|
699
703
|
{
|
|
700
704
|
coord: T,
|
|
701
|
-
value:
|
|
702
|
-
isSelected:
|
|
703
|
-
isFillTarget:
|
|
704
|
-
showFillHandle:
|
|
705
|
-
onMouseDown:
|
|
706
|
-
onMouseEnter:
|
|
707
|
-
onChange:
|
|
708
|
-
onFillHandleMouseDown:
|
|
709
|
-
styles: u
|
|
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
|
|
710
715
|
},
|
|
711
|
-
|
|
716
|
+
W
|
|
712
717
|
);
|
|
713
718
|
})
|
|
714
|
-
] },
|
|
719
|
+
] }, b);
|
|
715
720
|
}) })
|
|
716
721
|
] })
|
|
717
722
|
}
|
|
718
723
|
);
|
|
719
724
|
}
|
|
720
|
-
function
|
|
721
|
-
const
|
|
722
|
-
return isNaN(
|
|
725
|
+
function Ge(e) {
|
|
726
|
+
const t = typeof e == "string" ? parseFloat(e.replace(/,/g, "")) : e;
|
|
727
|
+
return isNaN(t) ? "0" : new Intl.NumberFormat("ko-KR").format(t);
|
|
723
728
|
}
|
|
724
|
-
function
|
|
725
|
-
const
|
|
726
|
-
return isNaN(
|
|
729
|
+
function Te(e) {
|
|
730
|
+
const t = parseInt(e.replace(/,/g, ""), 10);
|
|
731
|
+
return isNaN(t) ? 0 : t;
|
|
727
732
|
}
|
|
728
733
|
export {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
734
|
+
Le as ExcelGrid,
|
|
735
|
+
ye as GridCell,
|
|
736
|
+
B as cn,
|
|
737
|
+
Fe as coordToKey,
|
|
738
|
+
Ge as formatCurrency,
|
|
739
|
+
Ie as getCellsInRange,
|
|
740
|
+
ze as getFillTargetCells,
|
|
741
|
+
ne as isCellInRange,
|
|
742
|
+
Re as keyToCoord,
|
|
743
|
+
U as normalizeRange,
|
|
744
|
+
Te as parseCurrency,
|
|
745
|
+
le as parseTSV,
|
|
746
|
+
re as toTSV,
|
|
747
|
+
ce as useGridClipboard,
|
|
748
|
+
ae as useGridDragFill,
|
|
749
|
+
se as useGridSelection
|
|
745
750
|
};
|