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