@progress/kendo-react-spreadsheet 7.0.0-develop.11 → 7.0.0-develop.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-spreadsheet.js +1 -1
- package/index.js +1 -1
- package/index.mjs +206 -205
- package/package.json +11 -11
package/index.mjs
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
"use client";
|
|
5
6
|
import * as e from "react";
|
|
6
7
|
import * as F from "prop-types";
|
|
7
8
|
import { Button as K, DropDownButton as q, ToolbarSeparator as B, Toolbar as Jt, ButtonGroup as $t } from "@progress/kendo-react-buttons";
|
|
8
9
|
import { TabStrip as jt, TabStripTab as Gt } from "@progress/kendo-react-layout";
|
|
9
10
|
import { Dialog as qt, DialogActionsBar as Xt } from "@progress/kendo-react-dialogs";
|
|
10
11
|
import { Popup as Zt } from "@progress/kendo-react-popup";
|
|
11
|
-
import { IconWrap as P, classNames as J,
|
|
12
|
+
import { IconWrap as P, classNames as J, useId as Yt, validatePackage as Qt, shouldShowValidationUI as en, WatermarkOverlay as tn } from "@progress/kendo-react-common";
|
|
12
13
|
import { formulaFxIcon as me, xIcon as pe, plusIcon as nn, downloadIcon as on, folderOpenIcon as an, boldIcon as ln, italicIcon as sn, underlineIcon as rn, fontGrowIcon as cn, fontShrinkIcon as dn, foregroundColorIcon as un, dropletIcon as mn, alignLeftIcon as X, caretAltDownIcon as fe, alignCenterIcon as pn, alignRightIcon as fn, alignJustifyIcon as gn, alignTopIcon as hn, alignMiddleIcon as Cn, alignBottomIcon as ge, textWrapIcon as vn, bordersNoneIcon as yn, customFormatIcon as bn, tableColumnInsertLeftIcon as kn, tableColumnInsertRightIcon as xn, tableRowInsertBelowIcon as En, tableRowInsertAboveIcon as Sn, tableColumnDeleteIcon as In, tableRowDeleteIcon as wn, arrowRotateCcwIcon as Nn, arrowRotateCwIcon as Rn, decimalIncreaseIcon as le, decimalDecreaseIcon as se, clearCssIcon as An } from "@progress/kendo-svg-icons";
|
|
13
14
|
import { ComboBox as he, DropDownList as Dn } from "@progress/kendo-react-dropdowns";
|
|
14
|
-
import { useLocalization as
|
|
15
|
+
import { useLocalization as R, useInternationalization as Tn } from "@progress/kendo-react-intl";
|
|
15
16
|
import { Sortable as Ln } from "@progress/kendo-react-sortable";
|
|
16
17
|
import { SpreadsheetWidget as Fn } from "@progress/kendo-spreadsheet-common";
|
|
17
18
|
import { CalcError as Fo, CellRef as Ko, Context as Mo, Matrix as zo, NULLREF as Bo, NameRef as Po, Range as Ho, RangeRef as Oo, Ref as Uo, Sheet as Vo, SpreadsheetWidget as Wo, UnionRef as _o, View as Jo, Workbook as $o, dateToSerial as jo, defineAlias as Go, defineFunction as qo, packDate as Xo, packTime as Zo, serialToDate as Yo, unpackDate as Qo, unpackTime as ea } from "@progress/kendo-spreadsheet-common";
|
|
@@ -40,22 +41,22 @@ const Z = e.forwardRef((t, n) => {
|
|
|
40
41
|
Z.displayName = "List";
|
|
41
42
|
Z.propTypes = {};
|
|
42
43
|
const _ = e.forwardRef((t, n) => {
|
|
43
|
-
const [a, s] = e.useState(!1), [o, l] = e.useState(0), [
|
|
44
|
-
r.showPopup = a, r.popupContentKey = o, r.data =
|
|
45
|
-
const v = e.useRef(null), y = e.useRef(null), C = e.useRef(null),
|
|
44
|
+
const [a, s] = e.useState(!1), [o, l] = e.useState(0), [d, u] = e.useState([]), r = e.useMemo(() => ({}), []);
|
|
45
|
+
r.showPopup = a, r.popupContentKey = o, r.data = d;
|
|
46
|
+
const v = e.useRef(null), y = e.useRef(null), C = e.useRef(null), w = e.useCallback(() => {
|
|
46
47
|
if (C.current && C.current.element)
|
|
47
48
|
return C.current.element.querySelector(".k-focus");
|
|
48
|
-
}, []),
|
|
49
|
-
const f =
|
|
49
|
+
}, []), b = e.useCallback(() => {
|
|
50
|
+
const f = w();
|
|
50
51
|
f && f.classList.remove("k-focus");
|
|
51
52
|
}, []), p = e.useCallback((f) => {
|
|
52
|
-
const
|
|
53
|
+
const I = Array.from(C.current && C.current.element.children || []), D = w();
|
|
53
54
|
let m;
|
|
54
55
|
if (D) {
|
|
55
|
-
const x =
|
|
56
|
-
D.classList.remove("k-focus"), m =
|
|
56
|
+
const x = I.indexOf(D);
|
|
57
|
+
D.classList.remove("k-focus"), m = I[x + f] ? I[x + f] : f === 1 ? I[0] : I[I.length - 1];
|
|
57
58
|
} else
|
|
58
|
-
m = f === 1 ?
|
|
59
|
+
m = f === 1 ? I[0] : I[I.length - 1];
|
|
59
60
|
m && m.classList.add("k-focus");
|
|
60
61
|
}, []);
|
|
61
62
|
e.useImperativeHandle(v, () => ({
|
|
@@ -79,12 +80,12 @@ const _ = e.forwardRef((t, n) => {
|
|
|
79
80
|
},
|
|
80
81
|
data: (f) => {
|
|
81
82
|
if (f)
|
|
82
|
-
|
|
83
|
+
u(f);
|
|
83
84
|
else
|
|
84
85
|
return r.data;
|
|
85
86
|
},
|
|
86
87
|
value: () => ({}),
|
|
87
|
-
focus: () => Array.from(C.current && C.current.element && C.current.element.children || []).indexOf(
|
|
88
|
+
focus: () => Array.from(C.current && C.current.element && C.current.element.children || []).indexOf(w()),
|
|
88
89
|
// select: (x) => {
|
|
89
90
|
// console.log('select', x);
|
|
90
91
|
// },
|
|
@@ -96,18 +97,18 @@ const _ = e.forwardRef((t, n) => {
|
|
|
96
97
|
},
|
|
97
98
|
focusFirst: () => {
|
|
98
99
|
const f = C.current && C.current.element;
|
|
99
|
-
f && f.children.item(0) && (
|
|
100
|
+
f && f.children.item(0) && (b(), f.children.item(0).classList.add("k-focus"));
|
|
100
101
|
},
|
|
101
102
|
focusLast: () => {
|
|
102
103
|
const f = C.current && C.current.element;
|
|
103
|
-
f && f.children.length && (
|
|
104
|
+
f && f.children.length && (b(), f.children.item(f.children.length - 1).classList.add("k-focus"));
|
|
104
105
|
},
|
|
105
106
|
itemClick: (f) => {
|
|
106
107
|
r.itemClick = f;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
}), []), e.useImperativeHandle(n, () => v.current, []);
|
|
110
|
-
const
|
|
111
|
+
const h = e.useCallback((f) => {
|
|
111
112
|
r.itemClick && r.itemClick(f);
|
|
112
113
|
}, []);
|
|
113
114
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
@@ -128,7 +129,7 @@ const _ = e.forwardRef((t, n) => {
|
|
|
128
129
|
contentKey: o,
|
|
129
130
|
popupClass: "k-list-container"
|
|
130
131
|
},
|
|
131
|
-
/* @__PURE__ */ e.createElement(Z, { data:
|
|
132
|
+
/* @__PURE__ */ e.createElement(Z, { data: d, ref: C, onItemClick: h })
|
|
132
133
|
));
|
|
133
134
|
});
|
|
134
135
|
_.displayName = "FormulaInput";
|
|
@@ -236,7 +237,7 @@ const ye = "spreadsheet.bold", be = "spreadsheet.italic", ke = "spreadsheet.unde
|
|
|
236
237
|
duplicateSheetName: ft,
|
|
237
238
|
formatTab: rt
|
|
238
239
|
}, Y = e.forwardRef((t, n) => {
|
|
239
|
-
const a = e.useRef(null), s = e.useRef(null), [o, l] = e.useState([]), [
|
|
240
|
+
const a = e.useRef(null), s = e.useRef(null), [o, l] = e.useState([]), [d, u] = e.useState(!1), [r, v] = e.useState(""), y = e.useMemo(() => ({}), []);
|
|
240
241
|
y.data = o, e.useImperativeHandle(a, () => ({
|
|
241
242
|
value: (m) => {
|
|
242
243
|
if (m === void 0) {
|
|
@@ -249,7 +250,7 @@ const ye = "spreadsheet.bold", be = "spreadsheet.italic", ke = "spreadsheet.unde
|
|
|
249
250
|
const C = e.useCallback((m) => {
|
|
250
251
|
const x = t.nameEditor();
|
|
251
252
|
x && x.trigger("delete", { name: m });
|
|
252
|
-
}, []),
|
|
253
|
+
}, []), w = e.useCallback((m, x) => {
|
|
253
254
|
const T = /* @__PURE__ */ e.createElement(e.Fragment, null, m.props.children, /* @__PURE__ */ e.createElement(
|
|
254
255
|
"span",
|
|
255
256
|
{
|
|
@@ -269,13 +270,13 @@ const ye = "spreadsheet.bold", be = "spreadsheet.italic", ke = "spreadsheet.unde
|
|
|
269
270
|
)
|
|
270
271
|
));
|
|
271
272
|
return e.cloneElement(m, m.props, T);
|
|
272
|
-
}, []),
|
|
273
|
+
}, []), b = e.useCallback((m) => e.cloneElement(m, { ...m.props }, /* @__PURE__ */ e.createElement("div", null)), []), p = e.useCallback((m) => {
|
|
273
274
|
if (m.syntheticEvent && m.syntheticEvent.type === "change")
|
|
274
275
|
return;
|
|
275
276
|
const x = t.nameEditor();
|
|
276
|
-
x && (l(x.readData()),
|
|
277
|
-
}, []),
|
|
278
|
-
|
|
277
|
+
x && (l(x.readData()), u(!0));
|
|
278
|
+
}, []), h = e.useCallback(() => {
|
|
279
|
+
u(!1);
|
|
279
280
|
}, []), f = e.useCallback((m) => {
|
|
280
281
|
if (m.syntheticEvent.target.closest("[data-role]"))
|
|
281
282
|
return;
|
|
@@ -284,7 +285,7 @@ const ye = "spreadsheet.bold", be = "spreadsheet.italic", ke = "spreadsheet.unde
|
|
|
284
285
|
const T = m.value.name;
|
|
285
286
|
T !== r && (x.trigger("select", { name: T }), v(T));
|
|
286
287
|
}
|
|
287
|
-
}, [r]),
|
|
288
|
+
}, [r]), I = e.useCallback((m) => {
|
|
288
289
|
const x = t.nameEditor();
|
|
289
290
|
if (x)
|
|
290
291
|
if (m.key === "Enter") {
|
|
@@ -299,27 +300,27 @@ const ye = "spreadsheet.bold", be = "spreadsheet.italic", ke = "spreadsheet.unde
|
|
|
299
300
|
"div",
|
|
300
301
|
{
|
|
301
302
|
className: "k-spreadsheet-name-editor",
|
|
302
|
-
onKeyDown:
|
|
303
|
+
onKeyDown: I
|
|
303
304
|
},
|
|
304
305
|
/* @__PURE__ */ e.createElement(
|
|
305
306
|
he,
|
|
306
307
|
{
|
|
307
308
|
ref: s,
|
|
308
|
-
title:
|
|
309
|
+
title: R().toLanguageString(c.nameBox, E[c.nameBox]),
|
|
309
310
|
popupSettings: { className: "k-spreadsheet-names-popup" },
|
|
310
311
|
fillMode: "flat",
|
|
311
312
|
clearButton: !1,
|
|
312
313
|
dataItemKey: "name",
|
|
313
314
|
textField: "name",
|
|
314
|
-
itemRender:
|
|
315
|
+
itemRender: w,
|
|
315
316
|
data: o,
|
|
316
317
|
value: r ? o.find((m) => m.name === r) || { name: r } : null,
|
|
317
318
|
onChange: f,
|
|
318
|
-
opened:
|
|
319
|
+
opened: d,
|
|
319
320
|
onOpen: p,
|
|
320
|
-
onClose:
|
|
321
|
+
onClose: h,
|
|
321
322
|
onFocus: D,
|
|
322
|
-
listNoDataRender:
|
|
323
|
+
listNoDataRender: b,
|
|
323
324
|
allowCustom: !0
|
|
324
325
|
}
|
|
325
326
|
)
|
|
@@ -341,7 +342,7 @@ const zn = {
|
|
|
341
342
|
onEdit: () => {
|
|
342
343
|
}
|
|
343
344
|
}, gt = e.createContext(zn), Bn = (t) => {
|
|
344
|
-
const n = t.dataItem, { onSelect: a, onDelete: s, onEnterEdit: o, onExitEdit: l, onCancelEdit:
|
|
345
|
+
const n = t.dataItem, { onSelect: a, onDelete: s, onEnterEdit: o, onExitEdit: l, onCancelEdit: d, onEdit: u } = e.useContext(gt), r = e.useCallback((p) => {
|
|
345
346
|
p.target instanceof HTMLElement && p.target.nodeName === "INPUT" || a.call(void 0, n, p);
|
|
346
347
|
}, [n, a]), v = e.useCallback((p) => {
|
|
347
348
|
s.call(void 0, n, p);
|
|
@@ -349,11 +350,11 @@ const zn = {
|
|
|
349
350
|
p.target instanceof HTMLElement && p.target.nodeName === "INPUT" || o.call(void 0, n, p);
|
|
350
351
|
}, [n, o]), C = e.useCallback((p) => {
|
|
351
352
|
l.call(void 0, n, p);
|
|
352
|
-
}, [n, l]),
|
|
353
|
-
p.key === "Enter" ? l.call(void 0, n, p) : p.key === "Escape" &&
|
|
354
|
-
}, [n, l,
|
|
355
|
-
|
|
356
|
-
}, [n,
|
|
353
|
+
}, [n, l]), w = e.useCallback((p) => {
|
|
354
|
+
p.key === "Enter" ? l.call(void 0, n, p) : p.key === "Escape" && d.call(void 0, n, p);
|
|
355
|
+
}, [n, l, d]), b = e.useCallback((p) => {
|
|
356
|
+
u.call(void 0, { ...n, text: p.target.value }, p);
|
|
357
|
+
}, [n, u]);
|
|
357
358
|
return /* @__PURE__ */ e.createElement(
|
|
358
359
|
"li",
|
|
359
360
|
{
|
|
@@ -377,11 +378,11 @@ const zn = {
|
|
|
377
378
|
type: "text",
|
|
378
379
|
className: "k-textbox k-spreadsheet-sheets-editor",
|
|
379
380
|
value: n.text,
|
|
380
|
-
onChange:
|
|
381
|
+
onChange: b,
|
|
381
382
|
maxLength: 50,
|
|
382
383
|
autoFocus: !0,
|
|
383
384
|
onBlur: C,
|
|
384
|
-
onKeyDown:
|
|
385
|
+
onKeyDown: w
|
|
385
386
|
}
|
|
386
387
|
) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { className: "k-link" }, n.text), n.first && n.last ? null : /* @__PURE__ */ e.createElement("span", { className: "k-link k-spreadsheet-sheets-remove", onClick: v }, /* @__PURE__ */ e.createElement(P, { name: "x", icon: pe })))
|
|
387
388
|
);
|
|
@@ -400,102 +401,102 @@ const zn = {
|
|
|
400
401
|
});
|
|
401
402
|
ht.displayName = "TabsList";
|
|
402
403
|
const Pn = (t) => {
|
|
403
|
-
const { sheets: n, setSheets: a, onSheetSelect: s, onSheetDelete: o, onSheetEdit: l, onSheetReorderEnd:
|
|
404
|
-
a(k.map((
|
|
405
|
-
}, []),
|
|
404
|
+
const { sheets: n, setSheets: a, onSheetSelect: s, onSheetDelete: o, onSheetEdit: l, onSheetReorderEnd: d } = t, [u, r] = e.useState(null), v = e.useRef(!1), y = e.useRef(-1), C = e.useCallback((k) => {
|
|
405
|
+
a(k.map((N, L, A) => ({ ...N, first: L === 0, last: L === A.length - 1 })));
|
|
406
|
+
}, []), w = e.useCallback((k) => {
|
|
406
407
|
C(k.newState);
|
|
407
|
-
}, [C,
|
|
408
|
-
|
|
409
|
-
}, [
|
|
408
|
+
}, [C, d]), b = e.useCallback((k) => {
|
|
409
|
+
d.call(void 0, k);
|
|
410
|
+
}, [d]), p = e.useCallback((k) => {
|
|
410
411
|
v.current = !0, y.current = k.prevIndex;
|
|
411
|
-
}, []),
|
|
412
|
+
}, []), h = e.useCallback((k) => {
|
|
412
413
|
setTimeout(() => {
|
|
413
414
|
v.current = !1;
|
|
414
|
-
}, 50),
|
|
415
|
-
}, []), f = e.useCallback((k,
|
|
416
|
-
v.current || s.call(void 0, k,
|
|
417
|
-
}, [s]),
|
|
418
|
-
|
|
419
|
-
}, [n, o]), D = e.useCallback((k,
|
|
420
|
-
|
|
415
|
+
}, 50), d.call(void 0, { ...k, prevIndex: y.current });
|
|
416
|
+
}, []), f = e.useCallback((k, N) => {
|
|
417
|
+
v.current || s.call(void 0, k, N);
|
|
418
|
+
}, [s]), I = e.useCallback((k, N) => {
|
|
419
|
+
N.stopPropagation(), o.call(void 0, k);
|
|
420
|
+
}, [n, o]), D = e.useCallback((k, N) => {
|
|
421
|
+
N.stopPropagation(), N.preventDefault();
|
|
421
422
|
const L = n.map((A) => ({ ...A, active: A.id === k.id, inEdit: A.id === k.id }));
|
|
422
423
|
a(L), r({ ...k });
|
|
423
|
-
}, [n]), m = e.useCallback((k,
|
|
424
|
-
|
|
425
|
-
const L = n.map((A) => ({ ...A, inEdit: !1, text: A.inEdit &&
|
|
424
|
+
}, [n]), m = e.useCallback((k, N) => {
|
|
425
|
+
N.stopPropagation(), N.preventDefault();
|
|
426
|
+
const L = n.map((A) => ({ ...A, inEdit: !1, text: A.inEdit && u ? u.text : A.text }));
|
|
426
427
|
a(L), r(null);
|
|
427
|
-
}, [n,
|
|
428
|
-
|
|
428
|
+
}, [n, u]), x = e.useCallback((k, N) => {
|
|
429
|
+
N.stopPropagation(), N.preventDefault();
|
|
429
430
|
const L = n.map((H) => ({ ...H, inEdit: !1 })), A = n.findIndex((H) => H.id === k.id);
|
|
430
431
|
a(L), r(null), l.call(void 0, k, A);
|
|
431
|
-
}, [n, l]), T = e.useCallback((k,
|
|
432
|
-
|
|
432
|
+
}, [n, l]), T = e.useCallback((k, N) => {
|
|
433
|
+
N.stopPropagation(), N.preventDefault();
|
|
433
434
|
const L = n.map((A) => ({ ...A, text: k.id === A.id ? k.text : A.text }));
|
|
434
435
|
a(L);
|
|
435
436
|
}, [n]);
|
|
436
|
-
return /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom" }, /* @__PURE__ */ e.createElement("div", { className: "k-tabstrip-items-wrapper k-hstack" }, /* @__PURE__ */ e.createElement(gt.Provider, { value: { onSelect: f, onDelete:
|
|
437
|
+
return /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom" }, /* @__PURE__ */ e.createElement("div", { className: "k-tabstrip-items-wrapper k-hstack" }, /* @__PURE__ */ e.createElement(gt.Provider, { value: { onSelect: f, onDelete: I, onEnterEdit: D, onCancelEdit: m, onExitEdit: x, onEdit: T } }, /* @__PURE__ */ e.createElement(
|
|
437
438
|
Ln,
|
|
438
439
|
{
|
|
439
440
|
idField: "id",
|
|
440
441
|
data: n,
|
|
441
442
|
itemUI: Bn,
|
|
442
443
|
itemsWrapUI: ht,
|
|
443
|
-
onDragOver:
|
|
444
|
-
onNavigate:
|
|
444
|
+
onDragOver: w,
|
|
445
|
+
onNavigate: b,
|
|
445
446
|
onDragStart: p,
|
|
446
|
-
onDragEnd:
|
|
447
|
+
onDragEnd: h
|
|
447
448
|
}
|
|
448
449
|
))));
|
|
449
|
-
}, Hn = (t, n) => t.map((
|
|
450
|
-
text:
|
|
451
|
-
id:
|
|
452
|
-
first:
|
|
453
|
-
last:
|
|
454
|
-
active:
|
|
450
|
+
}, Hn = (t, n, a) => t.map((s, o, l) => ({
|
|
451
|
+
text: s.name(),
|
|
452
|
+
id: a + "-sheet-" + o,
|
|
453
|
+
first: o === 0,
|
|
454
|
+
last: o === l.length - 1,
|
|
455
|
+
active: s.name() === n
|
|
455
456
|
})), On = (t) => {
|
|
456
|
-
const { spreadsheetRef: n } = t, [a, s] = e.useState([]), o = e.useRef((a.find((
|
|
457
|
-
n.current && (n.current.view.sheetsbar.onSheetSelect(o.current), s(Hn(n.current.sheets(), o.current)));
|
|
457
|
+
const { spreadsheetRef: n } = t, [a, s] = e.useState([]), o = e.useRef((a.find((b) => b.active) || {}).text), l = Yt(), d = e.useCallback(() => {
|
|
458
|
+
n.current && (n.current.view.sheetsbar.onSheetSelect(o.current), s(Hn(n.current.sheets(), o.current, l)));
|
|
458
459
|
}, []), u = e.useCallback(() => {
|
|
459
460
|
if (n.current) {
|
|
460
|
-
const
|
|
461
|
-
|
|
461
|
+
const b = n.current.sheets();
|
|
462
|
+
b.find((p) => p.name() === o.current) || (o.current = b[b.length - 1].name()), d();
|
|
462
463
|
}
|
|
463
464
|
}, []);
|
|
464
|
-
e.useEffect(() => (n.current && (n.current.sheets().length && (o.current = n.current.sheets()[0].name(),
|
|
465
|
+
e.useEffect(() => (n.current && (n.current.sheets().length && (o.current = n.current.sheets()[0].name(), d()), n.current.view.bind("update", u)), () => {
|
|
465
466
|
n.current && n.current.view.unbind("update", u);
|
|
466
467
|
}), [n.current]);
|
|
467
|
-
const
|
|
468
|
-
o.current !==
|
|
469
|
-
}, []),
|
|
468
|
+
const r = e.useCallback((b) => {
|
|
469
|
+
o.current !== b.text && (o.current = b.text, d());
|
|
470
|
+
}, []), v = e.useCallback(() => {
|
|
470
471
|
if (n.current) {
|
|
471
472
|
n.current.view.sheetsbar.onAddSelect();
|
|
472
|
-
const
|
|
473
|
-
o.current =
|
|
473
|
+
const b = n.current.sheets();
|
|
474
|
+
o.current = b[b.length - 1].name(), d();
|
|
474
475
|
}
|
|
475
|
-
}, []),
|
|
476
|
+
}, []), y = e.useCallback((b) => {
|
|
476
477
|
if (n.current) {
|
|
477
|
-
if (o.current ===
|
|
478
|
-
const
|
|
479
|
-
o.current =
|
|
478
|
+
if (o.current === b.text) {
|
|
479
|
+
const p = n.current.sheets(), h = p.findIndex((I) => I.name() === b.text), f = p[h + 1] || p[h - 1];
|
|
480
|
+
o.current = f ? f.name() : "";
|
|
480
481
|
}
|
|
481
|
-
n.current.view.sheetsbar.onSheetRemove(
|
|
482
|
+
n.current.view.sheetsbar.onSheetRemove(b.text), d();
|
|
482
483
|
}
|
|
483
|
-
}, []),
|
|
484
|
+
}, []), C = e.useCallback((b, p) => {
|
|
484
485
|
if (n.current) {
|
|
485
|
-
let
|
|
486
|
-
const
|
|
487
|
-
if (!
|
|
488
|
-
o.current =
|
|
486
|
+
let h = b.text;
|
|
487
|
+
const f = n.current.sheets(), I = f[p];
|
|
488
|
+
if (!h) {
|
|
489
|
+
o.current = I.name(), d();
|
|
489
490
|
return;
|
|
490
491
|
}
|
|
491
|
-
if (
|
|
492
|
+
if (I && I.name() === h)
|
|
492
493
|
return;
|
|
493
|
-
|
|
494
|
+
f.find((D) => D.name() === h) && (h = I.name()), n.current.view.sheetsbar.onSheetRename(h, p), o.current = h, d();
|
|
494
495
|
}
|
|
495
|
-
}, []),
|
|
496
|
+
}, []), w = e.useCallback((b) => {
|
|
496
497
|
if (n.current) {
|
|
497
|
-
const { prevIndex:
|
|
498
|
-
o.current = n.current.sheets()[
|
|
498
|
+
const { prevIndex: p, nextIndex: h } = b;
|
|
499
|
+
o.current = n.current.sheets()[p].name(), n.current.view.sheetsbar.onSheetReorderEnd({ oldIndex: p, newIndex: h }), d();
|
|
499
500
|
}
|
|
500
501
|
}, []);
|
|
501
502
|
return /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-sheets-bar k-header" }, /* @__PURE__ */ e.createElement(
|
|
@@ -504,19 +505,19 @@ const Pn = (t) => {
|
|
|
504
505
|
fillMode: "flat",
|
|
505
506
|
icon: "plus",
|
|
506
507
|
className: "k-spreadsheet-sheets-bar-add",
|
|
507
|
-
title:
|
|
508
|
+
title: R().toLanguageString(c.addNewSheet, E[c.addNewSheet]),
|
|
508
509
|
svgIcon: nn,
|
|
509
|
-
onClick:
|
|
510
|
+
onClick: v
|
|
510
511
|
}
|
|
511
512
|
), /* @__PURE__ */ e.createElement(
|
|
512
513
|
Pn,
|
|
513
514
|
{
|
|
514
515
|
sheets: a,
|
|
515
516
|
setSheets: s,
|
|
516
|
-
onSheetSelect:
|
|
517
|
-
onSheetDelete:
|
|
518
|
-
onSheetEdit:
|
|
519
|
-
onSheetReorderEnd:
|
|
517
|
+
onSheetSelect: r,
|
|
518
|
+
onSheetDelete: y,
|
|
519
|
+
onSheetEdit: C,
|
|
520
|
+
onSheetReorderEnd: w
|
|
520
521
|
}
|
|
521
522
|
));
|
|
522
523
|
}, Ct = (t) => {
|
|
@@ -544,21 +545,21 @@ const vt = (t) => {
|
|
|
544
545
|
const { spreadsheetRef: n } = t, a = e.useCallback((o) => {
|
|
545
546
|
const l = o.target;
|
|
546
547
|
if (l instanceof Element && l.parentNode) {
|
|
547
|
-
const
|
|
548
|
-
|
|
548
|
+
const d = l.closest(".k-toolbar"), u = d && d.querySelector(".k-upload input");
|
|
549
|
+
u && u.click();
|
|
549
550
|
}
|
|
550
551
|
}, []), s = e.useCallback((o) => {
|
|
551
552
|
const l = o.newState;
|
|
552
553
|
if (l[0] && l[0].getRawFile) {
|
|
553
|
-
const
|
|
554
|
-
n.current && n.current.executeCommand({ command: "OpenCommand", options: { file:
|
|
554
|
+
const d = l[0].getRawFile();
|
|
555
|
+
n.current && n.current.executeCommand({ command: "OpenCommand", options: { file: d } });
|
|
555
556
|
}
|
|
556
557
|
}, []);
|
|
557
558
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
558
559
|
K,
|
|
559
560
|
{
|
|
560
561
|
className: "k-toolbar-button",
|
|
561
|
-
title:
|
|
562
|
+
title: R().toLanguageString(c.open, E[c.open]),
|
|
562
563
|
icon: "folder-open",
|
|
563
564
|
svgIcon: an,
|
|
564
565
|
fillMode: "flat",
|
|
@@ -590,13 +591,13 @@ const Un = ["Arial", "Courier New", "Georgia", "Times New Roman", "Trebuchet MS"
|
|
|
590
591
|
{ text: "Date time", value: "m/d/yyyy h:mm" },
|
|
591
592
|
{ text: "Duration", value: "[h]:mm:ss" }
|
|
592
593
|
], Q = (t) => (a) => {
|
|
593
|
-
const { property: s, icon: o, svgIcon: l, titleKey:
|
|
594
|
-
if (
|
|
594
|
+
const { property: s, icon: o, svgIcon: l, titleKey: d } = t, { spreadsheetRef: u, value: r } = a, v = e.useCallback(() => {
|
|
595
|
+
if (u.current) {
|
|
595
596
|
const C = {
|
|
596
597
|
command: "PropertyChangeCommand",
|
|
597
598
|
options: { property: s, value: !r }
|
|
598
599
|
};
|
|
599
|
-
|
|
600
|
+
u.current.executeCommand(C);
|
|
600
601
|
}
|
|
601
602
|
}, [r]);
|
|
602
603
|
return /* @__PURE__ */ e.createElement(
|
|
@@ -609,18 +610,18 @@ const Un = ["Arial", "Courier New", "Georgia", "Times New Roman", "Trebuchet MS"
|
|
|
609
610
|
togglable: !0,
|
|
610
611
|
onClick: v,
|
|
611
612
|
selected: r,
|
|
612
|
-
title:
|
|
613
|
+
title: R().toLanguageString(d, E[d])
|
|
613
614
|
}
|
|
614
615
|
);
|
|
615
616
|
}, yt = (t) => (a) => {
|
|
616
|
-
const { property: s, titleKey: o, ...l } = t, { spreadsheetRef:
|
|
617
|
+
const { property: s, titleKey: o, ...l } = t, { spreadsheetRef: d, value: u } = a, r = e.useCallback(
|
|
617
618
|
(v) => {
|
|
618
|
-
if (
|
|
619
|
+
if (d.current) {
|
|
619
620
|
const y = {
|
|
620
621
|
command: "PropertyChangeCommand",
|
|
621
622
|
options: { property: s, value: v.value || null }
|
|
622
623
|
};
|
|
623
|
-
|
|
624
|
+
d.current.executeCommand(y);
|
|
624
625
|
}
|
|
625
626
|
},
|
|
626
627
|
[s]
|
|
@@ -632,8 +633,8 @@ const Un = ["Arial", "Courier New", "Georgia", "Times New Roman", "Trebuchet MS"
|
|
|
632
633
|
onActiveColorClick: r,
|
|
633
634
|
fillMode: "flat",
|
|
634
635
|
...l,
|
|
635
|
-
title:
|
|
636
|
-
value:
|
|
636
|
+
title: R().toLanguageString(o, E[o]),
|
|
637
|
+
value: u
|
|
637
638
|
}
|
|
638
639
|
);
|
|
639
640
|
}, bt = (t) => (a) => {
|
|
@@ -647,7 +648,7 @@ const Un = ["Arial", "Courier New", "Georgia", "Times New Roman", "Trebuchet MS"
|
|
|
647
648
|
icon: t.icon,
|
|
648
649
|
svgIcon: t.svgIcon,
|
|
649
650
|
fillMode: "flat",
|
|
650
|
-
title:
|
|
651
|
+
title: R().toLanguageString(t.titleKey, E[t.titleKey]),
|
|
651
652
|
onClick: o
|
|
652
653
|
}
|
|
653
654
|
);
|
|
@@ -675,7 +676,7 @@ const St = (t) => {
|
|
|
675
676
|
data: Un,
|
|
676
677
|
defaultValue: Vn,
|
|
677
678
|
fillMode: "flat",
|
|
678
|
-
title:
|
|
679
|
+
title: R().toLanguageString(c.fontName, E[c.fontName]),
|
|
679
680
|
leftRightKeysNavigation: !1
|
|
680
681
|
}
|
|
681
682
|
);
|
|
@@ -683,16 +684,16 @@ const St = (t) => {
|
|
|
683
684
|
St.displayName = "FontFamily";
|
|
684
685
|
const $ = 1, j = 409, G = (t) => typeof t == "string" ? parseFloat(t) : t, It = (t) => {
|
|
685
686
|
const { spreadsheetRef: n } = t, a = G(t.value), s = e.useCallback((o) => {
|
|
686
|
-
var
|
|
687
|
+
var u;
|
|
687
688
|
let l = o.value ? G(o.value) : a;
|
|
688
689
|
l = isNaN(l) ? a : l, l = Math.min(j, Math.max($, l));
|
|
689
|
-
const
|
|
690
|
+
const d = {
|
|
690
691
|
command: "PropertyChangeCommand",
|
|
691
692
|
options: { property: "fontSize", value: l }
|
|
692
693
|
};
|
|
693
|
-
o.nativeEvent.type === "keydown" || o.nativeEvent.type === "focusout" ? (
|
|
694
|
+
o.nativeEvent.type === "keydown" || o.nativeEvent.type === "focusout" ? (u = n.current) == null || u.executeCommand(d) : setTimeout(() => {
|
|
694
695
|
var r;
|
|
695
|
-
(r = n.current) == null || r.executeCommand(
|
|
696
|
+
(r = n.current) == null || r.executeCommand(d);
|
|
696
697
|
}, 0);
|
|
697
698
|
}, [a]);
|
|
698
699
|
return /* @__PURE__ */ e.createElement(
|
|
@@ -704,7 +705,7 @@ const $ = 1, j = 409, G = (t) => typeof t == "string" ? parseFloat(t) : t, It =
|
|
|
704
705
|
defaultValue: _n,
|
|
705
706
|
allowCustom: !0,
|
|
706
707
|
fillMode: "flat",
|
|
707
|
-
title:
|
|
708
|
+
title: R().toLanguageString(c.fontSize, E[c.fontSize]),
|
|
708
709
|
tabIndex: -1,
|
|
709
710
|
clearButton: !1
|
|
710
711
|
}
|
|
@@ -713,13 +714,13 @@ const $ = 1, j = 409, G = (t) => typeof t == "string" ? parseFloat(t) : t, It =
|
|
|
713
714
|
It.displayName = "FontSize";
|
|
714
715
|
const wt = (t) => {
|
|
715
716
|
const n = (a) => {
|
|
716
|
-
const { property: s, icon: o, svgIcon: l, titleKey:
|
|
717
|
-
var
|
|
717
|
+
const { property: s, icon: o, svgIcon: l, titleKey: d, step: u } = t, { spreadsheetRef: r } = a, v = G(a.value), y = e.useCallback(() => {
|
|
718
|
+
var w;
|
|
718
719
|
const C = {
|
|
719
720
|
command: "PropertyChangeCommand",
|
|
720
|
-
options: { property: s, value: Math.min(j, Math.max($, v +
|
|
721
|
+
options: { property: s, value: Math.min(j, Math.max($, v + u)) }
|
|
721
722
|
};
|
|
722
|
-
(
|
|
723
|
+
(w = r.current) == null || w.executeCommand(C);
|
|
723
724
|
}, [v]);
|
|
724
725
|
return /* @__PURE__ */ e.createElement(
|
|
725
726
|
K,
|
|
@@ -729,8 +730,8 @@ const wt = (t) => {
|
|
|
729
730
|
svgIcon: l,
|
|
730
731
|
fillMode: "flat",
|
|
731
732
|
onClick: y,
|
|
732
|
-
disabled: v +
|
|
733
|
-
title:
|
|
733
|
+
disabled: v + u < $ || v + u > j,
|
|
734
|
+
title: R().toLanguageString(d, E[d])
|
|
734
735
|
}
|
|
735
736
|
);
|
|
736
737
|
};
|
|
@@ -781,7 +782,7 @@ const O = [
|
|
|
781
782
|
O[2],
|
|
782
783
|
{ ...O[3], textKey: c.justify }
|
|
783
784
|
], Yn = O.filter((t) => t.commandName === "verticalAlign"), Qn = (t) => {
|
|
784
|
-
const { value: n, spreadsheetRef: a } = t, { textAlign: s, verticalAlign: o } = n || {}, l =
|
|
785
|
+
const { value: n, spreadsheetRef: a } = t, { textAlign: s, verticalAlign: o } = n || {}, l = R(), d = e.useCallback((r) => {
|
|
785
786
|
if (a.current) {
|
|
786
787
|
const v = r.item, y = {
|
|
787
788
|
command: "PropertyChangeCommand",
|
|
@@ -790,15 +791,15 @@ const O = [
|
|
|
790
791
|
a.current.executeCommand(y);
|
|
791
792
|
}
|
|
792
793
|
}, []);
|
|
793
|
-
let
|
|
794
|
-
return
|
|
794
|
+
let u = O.slice();
|
|
795
|
+
return u = u.map((r) => ({ ...r, text: l.toLanguageString(r.textKey, E[r.textKey]) })), s && (u = u.map((r) => r.commandName === "textAlign" ? { ...r, selected: r.value === s } : r)), o && (u = u.map((r) => r.commandName === "verticalAlign" ? { ...r, selected: r.value === o } : r)), /* @__PURE__ */ e.createElement(
|
|
795
796
|
q,
|
|
796
797
|
{
|
|
797
798
|
icon: "align-left",
|
|
798
799
|
svgIcon: X,
|
|
799
|
-
items:
|
|
800
|
+
items: u,
|
|
800
801
|
fillMode: "flat",
|
|
801
|
-
onItemClick:
|
|
802
|
+
onItemClick: d,
|
|
802
803
|
title: l.toLanguageString(c.align, E[c.align]),
|
|
803
804
|
text: /* @__PURE__ */ e.createElement(P, { name: "caret-alt-down", icon: fe })
|
|
804
805
|
}
|
|
@@ -817,25 +818,25 @@ const eo = {
|
|
|
817
818
|
titleKey: c.alignVertically
|
|
818
819
|
}, At = (t) => {
|
|
819
820
|
const n = (a) => {
|
|
820
|
-
const { value: s, spreadsheetRef: o } = a, l =
|
|
821
|
+
const { value: s, spreadsheetRef: o } = a, l = R(), d = e.useCallback((y) => {
|
|
821
822
|
if (o.current) {
|
|
822
|
-
const C = y.item,
|
|
823
|
+
const C = y.item, w = {
|
|
823
824
|
command: "PropertyChangeCommand",
|
|
824
825
|
options: { property: C.commandName, value: C.value || null }
|
|
825
826
|
};
|
|
826
|
-
o.current.executeCommand(
|
|
827
|
+
o.current.executeCommand(w);
|
|
827
828
|
}
|
|
828
829
|
}, []);
|
|
829
|
-
let
|
|
830
|
-
|
|
831
|
-
const r = { ...t.icon }, v =
|
|
830
|
+
let u = t.items.slice();
|
|
831
|
+
u = u.map((y) => ({ ...y, text: l.toLanguageString(y.textKey, E[y.textKey]) })), u = u.map((y) => ({ ...y, selected: y.value === s }));
|
|
832
|
+
const r = { ...t.icon }, v = u.find((y) => y.selected);
|
|
832
833
|
return v && (r.icon = v.icon, r.svgIcon = v.svgIcon), /* @__PURE__ */ e.createElement(
|
|
833
834
|
q,
|
|
834
835
|
{
|
|
835
836
|
...r,
|
|
836
|
-
items:
|
|
837
|
+
items: u,
|
|
837
838
|
fillMode: "flat",
|
|
838
|
-
onItemClick:
|
|
839
|
+
onItemClick: d,
|
|
839
840
|
title: l.toLanguageString(t.titleKey, E[t.titleKey]),
|
|
840
841
|
text: /* @__PURE__ */ e.createElement(P, { name: "caret-alt-down", icon: fe })
|
|
841
842
|
}
|
|
@@ -847,11 +848,11 @@ const eo = {
|
|
|
847
848
|
if (a.current) {
|
|
848
849
|
const o = a.current.activeSheet();
|
|
849
850
|
if (o) {
|
|
850
|
-
const
|
|
851
|
+
const u = {
|
|
851
852
|
command: "TextWrapCommand",
|
|
852
853
|
options: { property: "wrap", value: !o.range(o.activeCell()).wrap() }
|
|
853
854
|
};
|
|
854
|
-
a.current.executeCommand(
|
|
855
|
+
a.current.executeCommand(u);
|
|
855
856
|
}
|
|
856
857
|
}
|
|
857
858
|
}, []);
|
|
@@ -863,7 +864,7 @@ const eo = {
|
|
|
863
864
|
icon: "text-wrap",
|
|
864
865
|
svgIcon: vn,
|
|
865
866
|
fillMode: "flat",
|
|
866
|
-
title:
|
|
867
|
+
title: R().toLanguageString(c.textWrap, E[c.textWrap]),
|
|
867
868
|
onClick: s,
|
|
868
869
|
selected: n
|
|
869
870
|
}
|
|
@@ -875,11 +876,11 @@ const Tt = (t) => {
|
|
|
875
876
|
if (a.current) {
|
|
876
877
|
const o = a.current.activeSheet();
|
|
877
878
|
if (o) {
|
|
878
|
-
const
|
|
879
|
+
const d = {
|
|
879
880
|
command: "GridLinesChangeCommand",
|
|
880
881
|
options: { property: "gridLines", value: !o.showGridLines() }
|
|
881
882
|
};
|
|
882
|
-
a.current.executeCommand(
|
|
883
|
+
a.current.executeCommand(d);
|
|
883
884
|
}
|
|
884
885
|
}
|
|
885
886
|
}, []);
|
|
@@ -891,7 +892,7 @@ const Tt = (t) => {
|
|
|
891
892
|
icon: "borders-none",
|
|
892
893
|
svgIcon: yn,
|
|
893
894
|
fillMode: "flat",
|
|
894
|
-
title:
|
|
895
|
+
title: R().toLanguageString(c.gridLines, E[c.gridLines]),
|
|
895
896
|
onClick: s,
|
|
896
897
|
selected: n
|
|
897
898
|
}
|
|
@@ -919,7 +920,7 @@ const Lt = (t) => {
|
|
|
919
920
|
fillMode: "flat",
|
|
920
921
|
onItemClick: a,
|
|
921
922
|
items: Jn,
|
|
922
|
-
title:
|
|
923
|
+
title: R().toLanguageString(c.format, E[c.format]),
|
|
923
924
|
text: /* @__PURE__ */ e.createElement(P, { name: "caret-alt-down" })
|
|
924
925
|
}
|
|
925
926
|
);
|
|
@@ -928,11 +929,11 @@ Lt.displayName = "Format";
|
|
|
928
929
|
const U = (t) => (a) => {
|
|
929
930
|
const { spreadsheetRef: s, value: o } = a, l = e.useCallback(() => {
|
|
930
931
|
if (s.current) {
|
|
931
|
-
const
|
|
932
|
+
const d = {
|
|
932
933
|
command: t.command,
|
|
933
934
|
options: { value: t.value }
|
|
934
935
|
};
|
|
935
|
-
s.current.executeCommand(
|
|
936
|
+
s.current.executeCommand(d);
|
|
936
937
|
}
|
|
937
938
|
}, []);
|
|
938
939
|
return /* @__PURE__ */ e.createElement(
|
|
@@ -942,7 +943,7 @@ const U = (t) => (a) => {
|
|
|
942
943
|
icon: t.icon,
|
|
943
944
|
svgIcon: t.svgIcon,
|
|
944
945
|
fillMode: "flat",
|
|
945
|
-
title:
|
|
946
|
+
title: R().toLanguageString(t.titleKey, E[t.titleKey]),
|
|
946
947
|
onClick: l,
|
|
947
948
|
disabled: o && t.disabled(o)
|
|
948
949
|
}
|
|
@@ -1005,13 +1006,13 @@ Ht.displayName = "Undo";
|
|
|
1005
1006
|
const mo = { action: "redo", icon: "reload", svgIcon: Rn, titleKey: c.redo }, Ot = bt(mo);
|
|
1006
1007
|
Ot.displayName = "Redo";
|
|
1007
1008
|
const Ut = (t) => (a) => {
|
|
1008
|
-
const { icon: s, svgIcon: o, titleKey: l, value:
|
|
1009
|
-
if (
|
|
1009
|
+
const { icon: s, svgIcon: o, titleKey: l, value: d } = t, { spreadsheetRef: u } = a, r = e.useCallback(() => {
|
|
1010
|
+
if (u.current) {
|
|
1010
1011
|
const v = {
|
|
1011
1012
|
command: "AdjustDecimalsCommand",
|
|
1012
|
-
options: { value:
|
|
1013
|
+
options: { value: d }
|
|
1013
1014
|
};
|
|
1014
|
-
|
|
1015
|
+
u.current.executeCommand(v);
|
|
1015
1016
|
}
|
|
1016
1017
|
}, []);
|
|
1017
1018
|
return /* @__PURE__ */ e.createElement(
|
|
@@ -1022,7 +1023,7 @@ const Ut = (t) => (a) => {
|
|
|
1022
1023
|
svgIcon: o,
|
|
1023
1024
|
fillMode: "flat",
|
|
1024
1025
|
onClick: r,
|
|
1025
|
-
title:
|
|
1026
|
+
title: R().toLanguageString(l, E[l])
|
|
1026
1027
|
}
|
|
1027
1028
|
);
|
|
1028
1029
|
}, po = Ut({
|
|
@@ -1085,7 +1086,7 @@ const Ut = (t) => (a) => {
|
|
|
1085
1086
|
name: "@progress/kendo-react-spreadsheet",
|
|
1086
1087
|
productName: "KendoReact",
|
|
1087
1088
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
1088
|
-
publishDate:
|
|
1089
|
+
publishDate: 1702025010,
|
|
1089
1090
|
version: "",
|
|
1090
1091
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
1091
1092
|
}, ie = ["bold", "italic", "underline", "fontFamily", "fontSize", "color", "background", "textAlign", "verticalAlign", "wrap", "gridLines"], de = {
|
|
@@ -1119,15 +1120,15 @@ const Ut = (t) => (a) => {
|
|
|
1119
1120
|
Qt(ce);
|
|
1120
1121
|
const a = en(ce), { toolbar: s = re } = t, o = [];
|
|
1121
1122
|
typeof s == "boolean" ? o.push(...s ? re : []) : o.push(...s);
|
|
1122
|
-
const [l,
|
|
1123
|
+
const [l, d] = e.useState(null), [u, r] = e.useState(o.findIndex((i) => i.selected) || 0), [v, y] = e.useState(!1), C = e.useRef(null), w = e.useRef(null), b = e.useRef(null), p = e.useRef(null), h = e.useRef(null), [f, I] = e.useState({}), D = e.useRef({});
|
|
1123
1124
|
D.current = f;
|
|
1124
1125
|
const m = e.useRef({});
|
|
1125
1126
|
m.current = t;
|
|
1126
|
-
const x =
|
|
1127
|
+
const x = R(), T = e.useCallback((i) => {
|
|
1127
1128
|
m.current.onSelect && m.current.onSelect.call(void 0, i);
|
|
1128
1129
|
}, []), k = e.useCallback((i) => {
|
|
1129
1130
|
m.current.onChange && m.current.onChange.call(void 0, i);
|
|
1130
|
-
}, []),
|
|
1131
|
+
}, []), N = e.useCallback((i) => {
|
|
1131
1132
|
m.current.onChangeFormat && m.current.onChangeFormat.call(void 0, i);
|
|
1132
1133
|
}, []), L = e.useCallback((i) => {
|
|
1133
1134
|
m.current.onExcelImport && m.current.onExcelImport.call(void 0, i);
|
|
@@ -1137,68 +1138,68 @@ const Ut = (t) => (a) => {
|
|
|
1137
1138
|
e.useImperativeHandle(H, () => ({
|
|
1138
1139
|
element: C.current,
|
|
1139
1140
|
get instance() {
|
|
1140
|
-
return
|
|
1141
|
+
return h.current;
|
|
1141
1142
|
},
|
|
1142
1143
|
props: t,
|
|
1143
1144
|
get view() {
|
|
1144
|
-
return
|
|
1145
|
+
return h.current.view;
|
|
1145
1146
|
},
|
|
1146
1147
|
get workbook() {
|
|
1147
|
-
return
|
|
1148
|
+
return h.current.workbook;
|
|
1148
1149
|
},
|
|
1149
1150
|
executeCommand(i) {
|
|
1150
|
-
var
|
|
1151
|
-
(
|
|
1151
|
+
var g;
|
|
1152
|
+
(g = h.current) == null || g.executeCommand(i);
|
|
1152
1153
|
},
|
|
1153
1154
|
fromJSON(i) {
|
|
1154
|
-
var
|
|
1155
|
-
return (
|
|
1155
|
+
var g;
|
|
1156
|
+
return (g = h.current) == null ? void 0 : g.fromJSON(i);
|
|
1156
1157
|
},
|
|
1157
1158
|
toJSON() {
|
|
1158
|
-
return
|
|
1159
|
+
return h.current.toJSON();
|
|
1159
1160
|
},
|
|
1160
1161
|
saveJSON() {
|
|
1161
|
-
return
|
|
1162
|
+
return h.current.saveJSON();
|
|
1162
1163
|
},
|
|
1163
1164
|
fromFile(i) {
|
|
1164
|
-
return
|
|
1165
|
+
return h.current.fromFile(i);
|
|
1165
1166
|
},
|
|
1166
1167
|
saveAsExcel(i) {
|
|
1167
|
-
var
|
|
1168
|
-
(
|
|
1169
|
-
...
|
|
1168
|
+
var g;
|
|
1169
|
+
(g = h.current) == null || g.saveAsExcel({
|
|
1170
|
+
...h.current.options.excel,
|
|
1170
1171
|
saveAs: Ce,
|
|
1171
1172
|
Workbook: ve,
|
|
1172
1173
|
...i
|
|
1173
1174
|
});
|
|
1174
1175
|
},
|
|
1175
1176
|
activeSheet(i) {
|
|
1176
|
-
var
|
|
1177
|
-
return (
|
|
1177
|
+
var g;
|
|
1178
|
+
return (g = h.current) == null ? void 0 : g.activeSheet(i);
|
|
1178
1179
|
},
|
|
1179
1180
|
sheets() {
|
|
1180
|
-
return
|
|
1181
|
+
return h.current.sheets();
|
|
1181
1182
|
},
|
|
1182
1183
|
refresh() {
|
|
1183
1184
|
var i;
|
|
1184
|
-
return (i =
|
|
1185
|
+
return (i = h.current) == null ? void 0 : i.refresh();
|
|
1185
1186
|
}
|
|
1186
1187
|
}), [t]), e.useImperativeHandle(n, () => H.current);
|
|
1187
|
-
const Wt = e.useCallback(() =>
|
|
1188
|
-
const
|
|
1189
|
-
ie.forEach((
|
|
1190
|
-
typeof i.range[
|
|
1191
|
-
}),
|
|
1188
|
+
const Wt = e.useCallback(() => h.current && h.current.view.nameEditor, []), ee = e.useCallback((i) => {
|
|
1189
|
+
const g = {};
|
|
1190
|
+
ie.forEach((S) => {
|
|
1191
|
+
typeof i.range[S] == "function" ? g[S] = i.range[S]() : S === "gridLines" && (g[S] = i.range.sheet().showGridLines());
|
|
1192
|
+
}), g.selectedHeaders = i.range.sheet().selectedHeaders(), (ie.some((S) => g[S] !== D.current[S]) || g.selectedHeaders.allCols !== D.current.selectedHeaders.allCols || g.selectedHeaders.allRows !== D.current.selectedHeaders.allRows) && I(g);
|
|
1192
1193
|
}, []), _t = e.useCallback((i) => {
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1194
|
+
const g = i.name, S = c[g];
|
|
1195
|
+
d({
|
|
1195
1196
|
title: i.title === "Error" ? x.toLanguageString(c.error, E[c.error] || i.title) : i.title,
|
|
1196
|
-
message:
|
|
1197
|
+
message: S ? x.toLanguageString(S, E[S] || i.text) : i.text,
|
|
1197
1198
|
close: i.close
|
|
1198
1199
|
});
|
|
1199
1200
|
}, []), te = e.useCallback(() => {
|
|
1200
|
-
|
|
1201
|
-
}, [l]), V = Tn(), ne =
|
|
1201
|
+
d(null), l == null || l.close();
|
|
1202
|
+
}, [l]), V = Tn(), ne = R();
|
|
1202
1203
|
e.useEffect(() => {
|
|
1203
1204
|
var W;
|
|
1204
1205
|
const i = {
|
|
@@ -1216,40 +1217,40 @@ const Ut = (t) => (a) => {
|
|
|
1216
1217
|
toString: (M, z) => V.toString(M, z),
|
|
1217
1218
|
format: (M, ...z) => V.format(M, ...z)
|
|
1218
1219
|
},
|
|
1219
|
-
formulaBarInputRef:
|
|
1220
|
-
formulaCellInputRef:
|
|
1220
|
+
formulaBarInputRef: w,
|
|
1221
|
+
formulaCellInputRef: b,
|
|
1221
1222
|
nameBoxRef: p
|
|
1222
|
-
},
|
|
1223
|
-
|
|
1224
|
-
const
|
|
1225
|
-
return
|
|
1226
|
-
|
|
1223
|
+
}, g = new Fn(C.current, i);
|
|
1224
|
+
h.current = g, g.bind("select", T), g.bind("change", k), g.bind("changeFormat", N), g.bind("excelImport", L), g.bind("excelExport", A), g.view.bind("update", ee), g.view.bind("message", _t);
|
|
1225
|
+
const S = g.activeSheet();
|
|
1226
|
+
return S && ee({ range: S.range(S.activeCell()) }), y(!0), () => {
|
|
1227
|
+
g.destroy();
|
|
1227
1228
|
};
|
|
1228
1229
|
}, []);
|
|
1229
|
-
const oe = e.useCallback((i,
|
|
1230
|
-
const
|
|
1230
|
+
const oe = e.useCallback((i, g) => {
|
|
1231
|
+
const S = /* @__PURE__ */ e.createElement(
|
|
1231
1232
|
i,
|
|
1232
1233
|
{
|
|
1233
|
-
spreadsheetRef:
|
|
1234
|
+
spreadsheetRef: h,
|
|
1234
1235
|
value: de[i.displayName] ? de[i.displayName](f) : void 0,
|
|
1235
|
-
key:
|
|
1236
|
+
key: g
|
|
1236
1237
|
}
|
|
1237
1238
|
);
|
|
1238
|
-
return
|
|
1239
|
+
return S.type === B ? /* @__PURE__ */ e.createElement(i, { key: g }) : S;
|
|
1239
1240
|
}, [f]);
|
|
1240
1241
|
let ae = null;
|
|
1241
1242
|
return o.length && (ae = /* @__PURE__ */ e.createElement(
|
|
1242
1243
|
jt,
|
|
1243
1244
|
{
|
|
1244
|
-
selected:
|
|
1245
|
+
selected: u,
|
|
1245
1246
|
animation: !1,
|
|
1246
1247
|
className: "k-floatwrap k-spreadsheet-tabstrip",
|
|
1247
1248
|
style: { minHeight: "auto" },
|
|
1248
1249
|
onSelect: (i) => r(i.selected)
|
|
1249
1250
|
},
|
|
1250
1251
|
o.map((i) => {
|
|
1251
|
-
const
|
|
1252
|
-
return /* @__PURE__ */ e.createElement(Gt, { key: i.textKey || i.text, title:
|
|
1252
|
+
const g = i.textKey ? ne.toLanguageString(i.textKey, E[i.textKey]) : i.text;
|
|
1253
|
+
return /* @__PURE__ */ e.createElement(Gt, { key: i.textKey || i.text, title: g }, /* @__PURE__ */ e.createElement(Jt, { buttons: go, className: "k-spreadsheet-toolbar" }, i.tools.map((S, W) => Array.isArray(S) ? /* @__PURE__ */ e.createElement($t, { key: W }, S.map((M, z) => oe(M, z))) : oe(S, W))));
|
|
1253
1254
|
})
|
|
1254
1255
|
)), /* @__PURE__ */ e.createElement(
|
|
1255
1256
|
"div",
|
|
@@ -1260,9 +1261,9 @@ const Ut = (t) => (a) => {
|
|
|
1260
1261
|
role: "application"
|
|
1261
1262
|
},
|
|
1262
1263
|
ae,
|
|
1263
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-action-bar" }, /* @__PURE__ */ e.createElement(Y, { ref: p, nameEditor: Wt }), /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-formula-bar" }, /* @__PURE__ */ e.createElement(P, { name: "formula-fx", icon: me }), /* @__PURE__ */ e.createElement(_, { ref:
|
|
1264
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-view" }, /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-fixed-container" }), /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-scroller" }, /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-view-size" })), /* @__PURE__ */ e.createElement("div", { tabIndex: 0, className: "k-spreadsheet-clipboard", contentEditable: "true" }), /* @__PURE__ */ e.createElement(_, { ref:
|
|
1265
|
-
/* @__PURE__ */ e.createElement(On, { spreadsheetRef:
|
|
1264
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-action-bar" }, /* @__PURE__ */ e.createElement(Y, { ref: p, nameEditor: Wt }), /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-formula-bar" }, /* @__PURE__ */ e.createElement(P, { name: "formula-fx", icon: me }), /* @__PURE__ */ e.createElement(_, { ref: w }))),
|
|
1265
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-view" }, /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-fixed-container" }), /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-scroller" }, /* @__PURE__ */ e.createElement("div", { className: "k-spreadsheet-view-size" })), /* @__PURE__ */ e.createElement("div", { tabIndex: 0, className: "k-spreadsheet-clipboard", contentEditable: "true" }), /* @__PURE__ */ e.createElement(_, { ref: b, className: "k-spreadsheet-cell-editor" })),
|
|
1266
|
+
/* @__PURE__ */ e.createElement(On, { spreadsheetRef: h }),
|
|
1266
1267
|
l && /* @__PURE__ */ e.createElement(qt, { title: l.title, onClose: te }, /* @__PURE__ */ e.createElement("div", null, l.message), /* @__PURE__ */ e.createElement(Xt, { layout: "start" }, /* @__PURE__ */ e.createElement(
|
|
1267
1268
|
K,
|
|
1268
1269
|
{
|
|
@@ -1299,7 +1300,7 @@ const Do = (t) => {
|
|
|
1299
1300
|
svgIcon: An,
|
|
1300
1301
|
fillMode: "flat",
|
|
1301
1302
|
onClick: a,
|
|
1302
|
-
title:
|
|
1303
|
+
title: R().toLanguageString(c.cleanFormatting, E[c.cleanFormatting])
|
|
1303
1304
|
}
|
|
1304
1305
|
);
|
|
1305
1306
|
};
|