@progress/kendo-react-spreadsheet 14.5.0-develop.8 → 14.5.0-develop.9

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/SheetsBar.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),O=require("@progress/kendo-react-buttons"),C=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-sortable"),N=require("@progress/kendo-svg-icons"),j=require("@progress/kendo-react-intl"),w=require("./messages.js");function M(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const c in o)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(o,c);Object.defineProperty(e,c,i.get?i:{enumerable:!0,get:()=>o[c]})}}return e.default=o,Object.freeze(e)}const t=M(L),U={onSelect:(()=>{}),onDelete:(()=>{}),onEnterEdit:(()=>{}),onCancelEdit:(()=>{}),onExitEdit:(()=>{}),onEdit:(()=>{})},R=t.createContext(U),_=o=>{const e=o.dataItem,{onSelect:c,onDelete:i,onEnterEdit:a,onExitEdit:h,onCancelEdit:u,onEdit:f}=t.useContext(R),p=t.useCallback(n=>{n.target instanceof HTMLElement&&n.target.nodeName==="INPUT"||c.call(void 0,e,n)},[e,c]),v=t.useCallback(n=>{i.call(void 0,e,n)},[e,i]),S=t.useCallback(n=>{n.target instanceof HTMLElement&&n.target.nodeName==="INPUT"||a.call(void 0,e,n)},[e,a]),g=t.useCallback(n=>{h.call(void 0,e,n)},[e,h]),x=t.useCallback(n=>{n.key==="Enter"?h.call(void 0,e,n):n.key==="Escape"&&u.call(void 0,e,n)},[e,h,u]),r=t.useCallback(n=>{f.call(void 0,{...e,text:n.target.value},n)},[e,f]);return t.createElement("li",{style:o.style,...o.attributes,ref:o.forwardRef,role:"tab",className:C.classNames("k-item k-tabstrip-item",{"k-disabled":o.isDisabled,"k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active":e.active,"k-spreadsheet-sheets-bar-inactive":!e.active,"k-first":e.first,"k-last":e.last}),onClick:p,onDoubleClick:S},e.inEdit?t.createElement("input",{type:"text",className:"k-textbox k-spreadsheet-sheets-editor",value:e.text,onChange:r,maxLength:50,autoFocus:!0,onBlur:g,onKeyDown:x}):t.createElement(t.Fragment,null,t.createElement("span",{className:"k-link"},e.text),e.first&&e.last?null:t.createElement("span",{className:"k-link k-spreadsheet-sheets-remove",onClick:v},t.createElement(C.IconWrap,{name:"x",icon:N.xIcon}))))},y=t.forwardRef((o,e)=>{const{children:c,className:i,...a}=o;return t.createElement("ul",{className:C.classNames("k-tabstrip-items k-reset",i),role:"tablist",...a,ref:e},c)});y.displayName="TabsList";const A=o=>{const{sheets:e,setSheets:c,onSheetSelect:i,onSheetDelete:a,onSheetEdit:h,onSheetReorderEnd:u}=o,[f,p]=t.useState(null),v=t.useRef(!1),S=t.useRef(-1),g=t.useCallback(s=>{c(s.map((l,k,d)=>({...l,first:k===0,last:k===d.length-1})))},[]),x=t.useCallback(s=>{g(s.newState)},[g,u]),r=t.useCallback(s=>{u.call(void 0,s)},[u]),n=t.useCallback(s=>{v.current=!0,S.current=s.prevIndex},[]),m=t.useCallback(s=>{setTimeout(()=>{v.current=!1},50),u.call(void 0,{...s,prevIndex:S.current})},[]),E=t.useCallback((s,l)=>{v.current||i.call(void 0,s,l)},[i]),b=t.useCallback((s,l)=>{l.stopPropagation(),a.call(void 0,s)},[e,a]),D=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const k=e.map(d=>({...d,active:d.id===s.id,inEdit:d.id===s.id}));c(k),p({...s})},[e]),P=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const k=e.map(d=>({...d,inEdit:!1,text:d.inEdit&&f?f.text:d.text}));c(k),p(null)},[e,f]),T=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const k=e.map(I=>({...I,inEdit:!1})),d=e.findIndex(I=>I.id===s.id);c(k),p(null),h.call(void 0,s,d)},[e,h]),q=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const k=e.map(d=>({...d,text:s.id===d.id?s.text:d.text}));c(k)},[e]);return t.createElement("div",{className:"k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom"},t.createElement("div",{className:"k-tabstrip-items-wrapper k-hstack"},t.createElement(R.Provider,{value:{onSelect:E,onDelete:b,onEnterEdit:D,onCancelEdit:P,onExitEdit:T,onEdit:q}},t.createElement(B.Sortable,{idField:"id",data:e,itemUI:_,itemsWrapUI:y,onDragOver:x,onNavigate:r,onDragStart:n,onDragEnd:m,navigatable:!0}))))},F=(o,e,c)=>o.map((i,a,h)=>({text:i.name(),id:c+"-sheet-"+a,first:a===0,last:a===h.length-1,active:i.name()===e})),z=o=>{const{spreadsheetRef:e}=o,[c,i]=t.useState([]),a=t.useRef((c.find(r=>r.active)||{}).text),h=C.useId(),u=t.useCallback(()=>{e.current&&(e.current.view.sheetsbar.onSheetSelect(a.current),i(F(e.current.sheets(),a.current,h)))},[]),f=t.useCallback(()=>{if(e.current){const r=e.current.sheets();r.find(n=>n.name()===a.current)||(a.current=r[r.length-1].name()),u()}},[]);t.useEffect(()=>(e.current&&(e.current.sheets().length&&(a.current=e.current.sheets()[0].name(),u()),e.current.view.bind("update",f)),()=>{e.current&&e.current.view.unbind("update",f)}),[e.current]);const p=t.useCallback(r=>{a.current!==r.text&&(a.current=r.text,u())},[]),v=t.useCallback(()=>{if(e.current){e.current.view.sheetsbar.onAddSelect();const r=e.current.sheets();a.current=r[r.length-1].name(),u()}},[]),S=t.useCallback(r=>{if(e.current){if(a.current===r.text){const n=e.current.sheets(),m=n.findIndex(b=>b.name()===r.text),E=n[m+1]||n[m-1];a.current=E?E.name():""}e.current.view.sheetsbar.onSheetRemove(r.text),u()}},[]),g=t.useCallback((r,n)=>{if(e.current){let m=r.text;const E=e.current.sheets(),b=E[n];if(!m){a.current=b.name(),u();return}if(b&&b.name()===m)return;E.find(D=>D.name()===m)&&(m=b.name()),e.current.view.sheetsbar.onSheetRename(m,n),a.current=m,u()}},[]),x=t.useCallback(r=>{if(e.current){const{prevIndex:n,nextIndex:m}=r;a.current=e.current.sheets()[n].name(),e.current.view.sheetsbar.onSheetReorderEnd({oldIndex:n,newIndex:m}),u()}},[]);return t.createElement("div",{className:"k-spreadsheet-sheets-bar k-header"},t.createElement(O.Button,{fillMode:"flat",icon:"plus",className:"k-spreadsheet-sheets-bar-add",title:j.useLocalization().toLanguageString(w.keys.addNewSheet,w.messages[w.keys.addNewSheet]),svgIcon:N.plusIcon,onClick:v}),t.createElement(A,{sheets:c,setSheets:i,onSheetSelect:p,onSheetDelete:S,onSheetEdit:g,onSheetReorderEnd:x}))};exports.SheetsBar=z;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),N=require("@progress/kendo-react-buttons"),w=require("@progress/kendo-react-common"),O=require("@progress/kendo-react-sortable"),R=require("@progress/kendo-svg-icons"),M=require("@progress/kendo-react-intl"),I=require("./messages.js");function j(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const c in o)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(o,c);Object.defineProperty(e,c,i.get?i:{enumerable:!0,get:()=>o[c]})}}return e.default=o,Object.freeze(e)}const t=j(L),U={onSelect:(()=>{}),onDelete:(()=>{}),onEnterEdit:(()=>{}),onCancelEdit:(()=>{}),onExitEdit:(()=>{}),onEdit:(()=>{})},y=t.createContext(U),z=o=>{const e=o.dataItem,{onSelect:c,onDelete:i,onEnterEdit:a,onExitEdit:m,onCancelEdit:u,onEdit:k}=t.useContext(y),p=t.useCallback(n=>{n.target instanceof HTMLElement&&n.target.nodeName==="INPUT"||c.call(void 0,e,n)},[e,c]),v=t.useCallback(n=>{i.call(void 0,e,n)},[e,i]),S=t.useCallback(n=>{n.target instanceof HTMLElement&&n.target.nodeName==="INPUT"||a.call(void 0,e,n)},[e,a]),x=t.useCallback(n=>{m.call(void 0,e,n)},[e,m]),g=t.useCallback(n=>{n.key==="Enter"?m.call(void 0,e,n):n.key==="Escape"&&u.call(void 0,e,n)},[e,m,u]),r=t.useCallback(n=>{k.call(void 0,{...e,text:n.target.value},n)},[e,k]);return t.createElement("li",{style:o.style,...o.attributes,ref:o.forwardRef,role:"tab",className:w.classNames("k-item k-tabstrip-item",{"k-disabled":o.isDisabled,"k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active":e.active,"k-spreadsheet-sheets-bar-inactive":!e.active,"k-first":e.first,"k-last":e.last}),onClick:p,onDoubleClick:S},e.inEdit?t.createElement("input",{type:"text",className:"k-textbox k-spreadsheet-sheets-editor",value:e.text,onChange:r,maxLength:50,autoFocus:!0,onBlur:x,onKeyDown:g}):t.createElement(t.Fragment,null,t.createElement("span",{className:"k-link"},e.text),e.first&&e.last?null:t.createElement(N.Button,{fillMode:"flat",size:"xs",icon:"x",svgIcon:R.xIcon,className:"k-link k-spreadsheet-sheets-remove",onClick:v})))},P=t.forwardRef((o,e)=>{const{children:c,className:i,...a}=o;return t.createElement("ul",{className:w.classNames("k-tabstrip-items k-reset",i),role:"tablist",...a,ref:e},c)});P.displayName="TabsList";const _=o=>{const{sheets:e,setSheets:c,onSheetSelect:i,onSheetDelete:a,onSheetEdit:m,onSheetReorderEnd:u}=o,[k,p]=t.useState(null),v=t.useRef(!1),S=t.useRef(-1),x=t.useCallback(s=>{c(s.map((l,f,d)=>({...l,first:f===0,last:f===d.length-1})))},[]),g=t.useCallback(s=>{x(s.newState)},[x,u]),r=t.useCallback(s=>{u.call(void 0,s)},[u]),n=t.useCallback(s=>{v.current=!0,S.current=s.prevIndex},[]),h=t.useCallback(s=>{setTimeout(()=>{v.current=!1},50),u.call(void 0,{...s,prevIndex:S.current})},[]),E=t.useCallback((s,l)=>{v.current||i.call(void 0,s,l)},[i]),b=t.useCallback((s,l)=>{l.stopPropagation(),a.call(void 0,s)},[e,a]),C=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const f=e.map(d=>({...d,active:d.id===s.id,inEdit:d.id===s.id}));c(f),p({...s})},[e]),T=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const f=e.map(d=>({...d,inEdit:!1,text:d.inEdit&&k?k.text:d.text}));c(f),p(null)},[e,k]),q=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const f=e.map(D=>({...D,inEdit:!1})),d=e.findIndex(D=>D.id===s.id);c(f),p(null),m.call(void 0,s,d)},[e,m]),B=t.useCallback((s,l)=>{l.stopPropagation(),l.preventDefault();const f=e.map(d=>({...d,text:s.id===d.id?s.text:d.text}));c(f)},[e]);return t.createElement("div",{className:"k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom"},t.createElement("div",{className:"k-tabstrip-items-wrapper k-hstack"},t.createElement(y.Provider,{value:{onSelect:E,onDelete:b,onEnterEdit:C,onCancelEdit:T,onExitEdit:q,onEdit:B}},t.createElement(O.Sortable,{idField:"id",data:e,itemUI:z,itemsWrapUI:P,onDragOver:g,onNavigate:r,onDragStart:n,onDragEnd:h,navigatable:!0}))))},A=(o,e,c)=>o.map((i,a,m)=>({text:i.name(),id:c+"-sheet-"+a,first:a===0,last:a===m.length-1,active:i.name()===e})),F=o=>{const{spreadsheetRef:e}=o,[c,i]=t.useState([]),a=t.useRef((c.find(r=>r.active)||{}).text),m=w.useId(),u=t.useCallback(()=>{e.current&&(e.current.view.sheetsbar.onSheetSelect(a.current),i(A(e.current.sheets(),a.current,m)))},[]),k=t.useCallback(()=>{if(e.current){const r=e.current.sheets();r.find(n=>n.name()===a.current)||(a.current=r[r.length-1].name()),u()}},[]);t.useEffect(()=>(e.current&&(e.current.sheets().length&&(a.current=e.current.sheets()[0].name(),u()),e.current.view.bind("update",k)),()=>{e.current&&e.current.view.unbind("update",k)}),[e.current]);const p=t.useCallback(r=>{a.current!==r.text&&(a.current=r.text,u())},[]),v=t.useCallback(()=>{if(e.current){e.current.view.sheetsbar.onAddSelect();const r=e.current.sheets();a.current=r[r.length-1].name(),u()}},[]),S=t.useCallback(r=>{if(e.current){if(a.current===r.text){const n=e.current.sheets(),h=n.findIndex(b=>b.name()===r.text),E=n[h+1]||n[h-1];a.current=E?E.name():""}e.current.view.sheetsbar.onSheetRemove(r.text),u()}},[]),x=t.useCallback((r,n)=>{if(e.current){let h=r.text;const E=e.current.sheets(),b=E[n];if(!h){a.current=b.name(),u();return}if(b&&b.name()===h)return;E.find(C=>C.name()===h)&&(h=b.name()),e.current.view.sheetsbar.onSheetRename(h,n),a.current=h,u()}},[]),g=t.useCallback(r=>{if(e.current){const{prevIndex:n,nextIndex:h}=r;a.current=e.current.sheets()[n].name(),e.current.view.sheetsbar.onSheetReorderEnd({oldIndex:n,newIndex:h}),u()}},[]);return t.createElement("div",{className:"k-spreadsheet-sheets-bar k-header"},t.createElement(N.Button,{fillMode:"flat",size:"xs",icon:"plus",className:"k-spreadsheet-sheets-bar-add",title:M.useLocalization().toLanguageString(I.keys.addNewSheet,I.messages[I.keys.addNewSheet]),svgIcon:R.plusIcon,onClick:v}),t.createElement(_,{sheets:c,setSheets:i,onSheetSelect:p,onSheetDelete:S,onSheetEdit:x,onSheetReorderEnd:g}))};exports.SheetsBar=F;
package/SheetsBar.mjs CHANGED
@@ -6,13 +6,13 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as t from "react";
9
- import { Button as L } from "@progress/kendo-react-buttons";
10
- import { useId as U, classNames as w, IconWrap as B } from "@progress/kendo-react-common";
11
- import { Sortable as A } from "@progress/kendo-react-sortable";
12
- import { plusIcon as F, xIcon as M } from "@progress/kendo-svg-icons";
13
- import { useLocalization as H } from "@progress/kendo-react-intl";
14
- import { keys as I, messages as K } from "./messages.mjs";
15
- const W = {
9
+ import { Button as w } from "@progress/kendo-react-buttons";
10
+ import { useId as U, classNames as N } from "@progress/kendo-react-common";
11
+ import { Sortable as B } from "@progress/kendo-react-sortable";
12
+ import { plusIcon as M, xIcon as z } from "@progress/kendo-svg-icons";
13
+ import { useLocalization as A } from "@progress/kendo-react-intl";
14
+ import { keys as I, messages as F } from "./messages.mjs";
15
+ const H = {
16
16
  onSelect: (() => {
17
17
  }),
18
18
  onDelete: (() => {
@@ -25,8 +25,8 @@ const W = {
25
25
  }),
26
26
  onEdit: (() => {
27
27
  })
28
- }, N = t.createContext(W), z = (u) => {
29
- const e = u.dataItem, { onSelect: l, onDelete: d, onEnterEdit: a, onExitEdit: h, onCancelEdit: o, onEdit: p } = t.useContext(N), b = t.useCallback(
28
+ }, R = t.createContext(H), K = (u) => {
29
+ const e = u.dataItem, { onSelect: l, onDelete: d, onEnterEdit: a, onExitEdit: h, onCancelEdit: o, onEdit: k } = t.useContext(R), b = t.useCallback(
30
30
  (n) => {
31
31
  n.target instanceof HTMLElement && n.target.nodeName === "INPUT" || l.call(void 0, e, n);
32
32
  },
@@ -53,9 +53,9 @@ const W = {
53
53
  [e, h, o]
54
54
  ), r = t.useCallback(
55
55
  (n) => {
56
- p.call(void 0, { ...e, text: n.target.value }, n);
56
+ k.call(void 0, { ...e, text: n.target.value }, n);
57
57
  },
58
- [e, p]
58
+ [e, k]
59
59
  );
60
60
  return /* @__PURE__ */ t.createElement(
61
61
  "li",
@@ -64,7 +64,7 @@ const W = {
64
64
  ...u.attributes,
65
65
  ref: u.forwardRef,
66
66
  role: "tab",
67
- className: w("k-item k-tabstrip-item", {
67
+ className: N("k-item k-tabstrip-item", {
68
68
  "k-disabled": u.isDisabled,
69
69
  "k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active": e.active,
70
70
  "k-spreadsheet-sheets-bar-inactive": !e.active,
@@ -86,15 +86,25 @@ const W = {
86
86
  onBlur: S,
87
87
  onKeyDown: C
88
88
  }
89
- ) : /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-link" }, e.text), e.first && e.last ? null : /* @__PURE__ */ t.createElement("span", { className: "k-link k-spreadsheet-sheets-remove", onClick: v }, /* @__PURE__ */ t.createElement(B, { name: "x", icon: M })))
89
+ ) : /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("span", { className: "k-link" }, e.text), e.first && e.last ? null : /* @__PURE__ */ t.createElement(
90
+ w,
91
+ {
92
+ fillMode: "flat",
93
+ size: "xs",
94
+ icon: "x",
95
+ svgIcon: z,
96
+ className: "k-link k-spreadsheet-sheets-remove",
97
+ onClick: v
98
+ }
99
+ ))
90
100
  );
91
- }, R = t.forwardRef((u, e) => {
101
+ }, y = t.forwardRef((u, e) => {
92
102
  const { children: l, className: d, ...a } = u;
93
- return /* @__PURE__ */ t.createElement("ul", { className: w("k-tabstrip-items k-reset", d), role: "tablist", ...a, ref: e }, l);
103
+ return /* @__PURE__ */ t.createElement("ul", { className: N("k-tabstrip-items k-reset", d), role: "tablist", ...a, ref: e }, l);
94
104
  });
95
- R.displayName = "TabsList";
105
+ y.displayName = "TabsList";
96
106
  const O = (u) => {
97
- const { sheets: e, setSheets: l, onSheetSelect: d, onSheetDelete: a, onSheetEdit: h, onSheetReorderEnd: o } = u, [p, b] = t.useState(null), v = t.useRef(!1), x = t.useRef(-1), S = t.useCallback((s) => {
107
+ const { sheets: e, setSheets: l, onSheetSelect: d, onSheetDelete: a, onSheetEdit: h, onSheetReorderEnd: o } = u, [k, b] = t.useState(null), v = t.useRef(!1), x = t.useRef(-1), S = t.useCallback((s) => {
98
108
  l(
99
109
  s.map((c, f, i) => ({
100
110
  ...c,
@@ -123,7 +133,7 @@ const O = (u) => {
123
133
  v.current || d.call(void 0, s, c);
124
134
  },
125
135
  [d]
126
- ), k = t.useCallback(
136
+ ), p = t.useCallback(
127
137
  (s, c) => {
128
138
  c.stopPropagation(), a.call(void 0, s);
129
139
  },
@@ -139,25 +149,25 @@ const O = (u) => {
139
149
  l(f), b({ ...s });
140
150
  },
141
151
  [e]
142
- ), y = t.useCallback(
152
+ ), P = t.useCallback(
143
153
  (s, c) => {
144
154
  c.stopPropagation(), c.preventDefault();
145
155
  const f = e.map((i) => ({
146
156
  ...i,
147
157
  inEdit: !1,
148
- text: i.inEdit && p ? p.text : i.text
158
+ text: i.inEdit && k ? k.text : i.text
149
159
  }));
150
160
  l(f), b(null);
151
161
  },
152
- [e, p]
153
- ), P = t.useCallback(
162
+ [e, k]
163
+ ), T = t.useCallback(
154
164
  (s, c) => {
155
165
  c.stopPropagation(), c.preventDefault();
156
166
  const f = e.map((D) => ({ ...D, inEdit: !1 })), i = e.findIndex((D) => D.id === s.id);
157
167
  l(f), b(null), h.call(void 0, s, i);
158
168
  },
159
169
  [e, h]
160
- ), T = t.useCallback(
170
+ ), L = t.useCallback(
161
171
  (s, c) => {
162
172
  c.stopPropagation(), c.preventDefault();
163
173
  const f = e.map((i) => ({
@@ -168,13 +178,13 @@ const O = (u) => {
168
178
  },
169
179
  [e]
170
180
  );
171
- return /* @__PURE__ */ t.createElement("div", { className: "k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom" }, /* @__PURE__ */ t.createElement("div", { className: "k-tabstrip-items-wrapper k-hstack" }, /* @__PURE__ */ t.createElement(N.Provider, { value: { onSelect: E, onDelete: k, onEnterEdit: g, onCancelEdit: y, onExitEdit: P, onEdit: T } }, /* @__PURE__ */ t.createElement(
172
- A,
181
+ return /* @__PURE__ */ t.createElement("div", { className: "k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom" }, /* @__PURE__ */ t.createElement("div", { className: "k-tabstrip-items-wrapper k-hstack" }, /* @__PURE__ */ t.createElement(R.Provider, { value: { onSelect: E, onDelete: p, onEnterEdit: g, onCancelEdit: P, onExitEdit: T, onEdit: L } }, /* @__PURE__ */ t.createElement(
182
+ B,
173
183
  {
174
184
  idField: "id",
175
185
  data: e,
176
- itemUI: z,
177
- itemsWrapUI: R,
186
+ itemUI: K,
187
+ itemsWrapUI: y,
178
188
  onDragOver: C,
179
189
  onNavigate: r,
180
190
  onDragStart: n,
@@ -188,17 +198,17 @@ const O = (u) => {
188
198
  first: a === 0,
189
199
  last: a === h.length - 1,
190
200
  active: d.name() === e
191
- })), X = (u) => {
201
+ })), Q = (u) => {
192
202
  const { spreadsheetRef: e } = u, [l, d] = t.useState([]), a = t.useRef((l.find((r) => r.active) || {}).text), h = U(), o = t.useCallback(() => {
193
203
  e.current && (e.current.view.sheetsbar.onSheetSelect(a.current), d(V(e.current.sheets(), a.current, h)));
194
- }, []), p = t.useCallback(() => {
204
+ }, []), k = t.useCallback(() => {
195
205
  if (e.current) {
196
206
  const r = e.current.sheets();
197
207
  r.find((n) => n.name() === a.current) || (a.current = r[r.length - 1].name()), o();
198
208
  }
199
209
  }, []);
200
- t.useEffect(() => (e.current && (e.current.sheets().length && (a.current = e.current.sheets()[0].name(), o()), e.current.view.bind("update", p)), () => {
201
- e.current && e.current.view.unbind("update", p);
210
+ t.useEffect(() => (e.current && (e.current.sheets().length && (a.current = e.current.sheets()[0].name(), o()), e.current.view.bind("update", k)), () => {
211
+ e.current && e.current.view.unbind("update", k);
202
212
  }), [e.current]);
203
213
  const b = t.useCallback((r) => {
204
214
  a.current !== r.text && (a.current = r.text, o());
@@ -211,7 +221,7 @@ const O = (u) => {
211
221
  }, []), x = t.useCallback((r) => {
212
222
  if (e.current) {
213
223
  if (a.current === r.text) {
214
- const n = e.current.sheets(), m = n.findIndex((k) => k.name() === r.text), E = n[m + 1] || n[m - 1];
224
+ const n = e.current.sheets(), m = n.findIndex((p) => p.name() === r.text), E = n[m + 1] || n[m - 1];
215
225
  a.current = E ? E.name() : "";
216
226
  }
217
227
  e.current.view.sheetsbar.onSheetRemove(r.text), o();
@@ -219,14 +229,14 @@ const O = (u) => {
219
229
  }, []), S = t.useCallback((r, n) => {
220
230
  if (e.current) {
221
231
  let m = r.text;
222
- const E = e.current.sheets(), k = E[n];
232
+ const E = e.current.sheets(), p = E[n];
223
233
  if (!m) {
224
- a.current = k.name(), o();
234
+ a.current = p.name(), o();
225
235
  return;
226
236
  }
227
- if (k && k.name() === m)
237
+ if (p && p.name() === m)
228
238
  return;
229
- E.find((g) => g.name() === m) && (m = k.name()), e.current.view.sheetsbar.onSheetRename(m, n), a.current = m, o();
239
+ E.find((g) => g.name() === m) && (m = p.name()), e.current.view.sheetsbar.onSheetRename(m, n), a.current = m, o();
230
240
  }
231
241
  }, []), C = t.useCallback((r) => {
232
242
  if (e.current) {
@@ -235,13 +245,14 @@ const O = (u) => {
235
245
  }
236
246
  }, []);
237
247
  return /* @__PURE__ */ t.createElement("div", { className: "k-spreadsheet-sheets-bar k-header" }, /* @__PURE__ */ t.createElement(
238
- L,
248
+ w,
239
249
  {
240
250
  fillMode: "flat",
251
+ size: "xs",
241
252
  icon: "plus",
242
253
  className: "k-spreadsheet-sheets-bar-add",
243
- title: H().toLanguageString(I.addNewSheet, K[I.addNewSheet]),
244
- svgIcon: F,
254
+ title: A().toLanguageString(I.addNewSheet, F[I.addNewSheet]),
255
+ svgIcon: M,
245
256
  onClick: v
246
257
  }
247
258
  ), /* @__PURE__ */ t.createElement(
@@ -257,5 +268,5 @@ const O = (u) => {
257
268
  ));
258
269
  };
259
270
  export {
260
- X as SheetsBar
271
+ Q as SheetsBar
261
272
  };
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-sortable"),require("@progress/kendo-spreadsheet-common"),require("@progress/kendo-file-saver"),require("@progress/kendo-ooxml"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-inputs")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-dialogs","@progress/kendo-react-popup","@progress/kendo-react-common","@progress/kendo-svg-icons","@progress/kendo-react-dropdowns","@progress/kendo-react-intl","@progress/kendo-react-sortable","@progress/kendo-spreadsheet-common","@progress/kendo-file-saver","@progress/kendo-ooxml","@progress/kendo-react-upload","@progress/kendo-react-inputs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactSpreadsheet={},e.React,e.PropTypes,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactDialogs,e.KendoReactPopup,e.KendoReactCommon,e.KendoSvgIcons,e.KendoReactDropdowns,e.KendoReactIntl,e.KendoReactSortable,e.KendoSpreadsheetCommon,e.KendoFileSaver,e.KendoOoxml,e.KendoReactUpload,e.KendoReactInputs)}(this,function(e,t,n,a,o,r,l,s,c,i,d,u,m,p,g,f,b){"use strict";function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=v(t);const y=h.forwardRef((e,t)=>{const n=h.useRef(null),a=h.useRef(null);return h.useImperativeHandle(n,()=>({element:a.current,props:e})),h.useImperativeHandle(t,()=>n.current),h.createElement("div",{className:"k-list k-list-md"},h.createElement("div",{className:"k-list-content"},h.createElement("ul",{ref:a,className:"k-spreadsheet-formula-list k-list-ul",onMouseDown:e=>e.preventDefault(),style:{maxHeight:280}},e.data.map(t=>h.createElement("li",{key:t.text,className:"k-list-item",onClick:()=>e.onItemClick(t.value)},h.createElement(s.IconWrap,{name:"formula-fx",icon:c.formulaFxIcon}),h.createElement("span",{className:"k-list-item-text"},t.text))))))});y.displayName="List",y.propTypes={};const k=h.forwardRef((e,t)=>{const[n,a]=h.useState(!1),[o,r]=h.useState(0),[c,i]=h.useState([]),d=h.useMemo(()=>({}),[]);d.showPopup=n,d.popupContentKey=o,d.data=c;const u=h.useRef(null),m=h.useRef(null),p=h.useRef(null),g=h.useCallback(()=>{if(p.current&&p.current.element)return p.current.element.querySelector(".k-focus")},[]),f=h.useCallback(()=>{const e=g();e&&e.classList.remove("k-focus")},[]),b=h.useCallback(e=>{const t=Array.from(p.current&&p.current.element.children||[]),n=g();let a;if(n){const o=t.indexOf(n);n.classList.remove("k-focus"),a=t[o+e]?t[o+e]:1===e?t[0]:t[t.length-1]}else a=1===e?t[0]:t[t.length-1];a&&a.classList.add("k-focus")},[]);h.useImperativeHandle(u,()=>({element:m.current,props:e,popup:{open:()=>{a(!0)},close:()=>{a(!1)},position:()=>{r(d.popupContentKey+1)},visible:()=>d.showPopup},list:{get element(){return p.current&&p.current.element},data:e=>{if(!e)return d.data;i(e)},value:()=>({}),focus:()=>Array.from(p.current&&p.current.element&&p.current.element.children||[]).indexOf(g()),focusNext:()=>{b(1)},focusPrev:()=>{b(-1)},focusFirst:()=>{const e=p.current&&p.current.element;e&&e.children.item(0)&&(f(),e.children.item(0).classList.add("k-focus"))},focusLast:()=>{const e=p.current&&p.current.element;e&&e.children.length&&(f(),e.children.item(e.children.length-1).classList.add("k-focus"))},itemClick:e=>{d.itemClick=e}}}),[]),h.useImperativeHandle(t,()=>u.current,[]);const v=h.useCallback(e=>{d.itemClick&&d.itemClick(e)},[]);return h.createElement(h.Fragment,null,h.createElement("div",{className:s.classNames("k-spreadsheet-formula-input",e.className),contentEditable:"true",spellCheck:"false",style:{whiteSpace:"pre"},ref:m,"aria-haspopup":"menu",title:"Formula Input","aria-expanded":n,role:"combobox"}),h.createElement(l.Popup,{show:n,anchor:m.current,animate:{openDuration:100,closeDuration:100},contentKey:o,popupClass:"k-list-container"},h.createElement(y,{data:c,ref:p,onItemClick:v})))});k.displayName="FormulaInput",k.propTypes={};const C="spreadsheet.bold",x="spreadsheet.italic",E="spreadsheet.underline",I="spreadsheet.openFile",S="spreadsheet.textColor",w="spreadsheet.background",N="spreadsheet.addRowAbove",R="spreadsheet.addRowBelow",A="spreadsheet.addColumnLeft",D="spreadsheet.addColumnRight",L="spreadsheet.deleteRow",K="spreadsheet.deleteColumn",F="spreadsheet.undo",T="spreadsheet.redo",z="spreadsheet.fontSize",P="spreadsheet.fontSizeIncrease",B="spreadsheet.fontSizeDecrease",O="spreadsheet.fontName",M="spreadsheet.cleanFormatting",j="spreadsheet.format",H="spreadsheet.alignHorizontally",W="spreadsheet.alignVertically",U="spreadsheet.align",q="spreadsheet.alignLeft",V="spreadsheet.alignRight",J="spreadsheet.alignCenter",_="spreadsheet.center",G="spreadsheet.alignJustify",$="spreadsheet.justify",X="spreadsheet.alignTop",Q="spreadsheet.alignMiddle",Y="spreadsheet.alignBottom",Z="spreadsheet.increaseDecimal",ee="spreadsheet.decreaseDecimal",te="spreadsheet.textWrap",ne="spreadsheet.gridLines",ae="spreadsheet.exportToExcel",oe="spreadsheet.nameBox",re="spreadsheet.defaultSheetName",le="spreadsheet.home",se="spreadsheet.file",ce="spreadsheet.insert",ie="spreadsheet.formatTab",de="spreadsheet.addNewSheet",ue="spreadsheet.error",me="spreadsheet.ok",pe="spreadsheet.modifyMerged",ge="spreadsheet.cannotModifyDisabled",fe="spreadsheet.openUnsupported",be="spreadsheet.duplicateSheetName",ve={[C]:"Bold",[x]:"Italic",[E]:"Underline",[F]:"Undo",[T]:"Redo",[z]:"Font size",[P]:"Increase Font size",[B]:"Decrease Font size",[O]:"Font",[M]:"Clean formatting",[j]:"Custom format...",[H]:"Align horizontally",[W]:"Align vertically",[U]:"Align",[q]:"Align left",[V]:"Align right",[J]:"Align center",[G]:"Align justify",[_]:"Center",[$]:"Justify",[X]:"Align top",[Q]:"Align middle",[Y]:"Align bottom",[Z]:"Increase decimal",[ee]:"Decrease decimal",[S]:"Text Color",[w]:"Background color",[N]:"Add row above",[R]:"Add row below",[A]:"Add column left",[D]:"Add column right",[L]:"Delete row",[K]:"Delete column",[I]:"Open...",[ae]:"Export to Excel",[te]:"Text Wrap",[ne]:"Toggle gridlines",[oe]:"Name Box",[re]:"Sheet",[le]:"Home",[se]:"File",[ce]:"Insert",[de]:"Add new sheet",[ie]:"Format",[pe]:"Cannot change part of a merged cell.",[ge]:"Cannot modify disabled cells.",[fe]:"Unsupported format. Please select an .xlsx file.",[be]:"There is an existing sheet with this name. Please enter another name.",[ue]:"Error",[me]:"OK"},he={bold:C,italic:x,underline:E,undo:F,redo:T,fontSize:z,fontSizeIncrease:P,fontSizeDecrease:B,fontName:O,cleanFormatting:M,format:j,alignHorizontally:H,alignVertically:W,align:U,alignLeft:q,alignRight:V,alignCenter:J,center:_,alignJustify:G,justify:$,alignTop:X,alignMiddle:Q,alignBottom:Y,increaseDecimal:Z,decreaseDecimal:ee,textColor:S,background:w,addRowAbove:N,addRowBelow:R,addColumnLeft:A,addColumnRight:D,deleteRow:L,deleteColumn:K,open:I,exportToExcel:ae,textWrap:te,gridLines:ne,nameBox:oe,defaultSheetName:re,file:se,home:le,insert:ce,addNewSheet:de,error:ue,ok:me,modifyMerged:pe,cannotModifyDisabled:ge,openUnsupported:fe,duplicateSheetName:be,formatTab:ie},ye=h.forwardRef((e,t)=>{const n=h.useRef(null),a=h.useRef(null),[o,r]=h.useState([]),[l,u]=h.useState(!1),[m,p]=h.useState(""),g=h.useMemo(()=>({}),[]);g.data=o,h.useImperativeHandle(n,()=>({value:e=>{if(void 0===e){const e=a.current&&a.current.value;return e&&(e.name||e)}p(e||"")}}),[]),h.useImperativeHandle(t,()=>n.current,[]);const f=h.useCallback(t=>{const n=e.nameEditor();n&&n.trigger("delete",{name:t})},[]),b=h.useCallback((e,t)=>{const n=h.createElement(h.Fragment,null,e.props.children,h.createElement("span",{role:"button",className:"k-button-delete",onClick:()=>f(t.dataItem[t.textField]),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>e.preventDefault(),"data-role":"delete"},h.createElement(s.IconWrap,{name:"x",icon:c.xIcon})));return h.cloneElement(e,e.props,n)},[]),v=h.useCallback(e=>h.cloneElement(e,{...e.props},h.createElement("div",null)),[]),y=h.useCallback(t=>{if(t.syntheticEvent&&"change"===t.syntheticEvent.type)return;const n=e.nameEditor();n&&(r(n.readData()),u(!0))},[]),k=h.useCallback(()=>{u(!1)},[]),C=h.useCallback(t=>{if(t.syntheticEvent.target.closest("[data-role]"))return;const n=e.nameEditor();if(n&&t.value){const e=t.value.name;e!==m&&(n.trigger("select",{name:e}),p(e))}},[m]),x=h.useCallback(t=>{const n=e.nameEditor();if(n)if("Enter"===t.key){const e=t.target.value;n.trigger("enter",{value:e}),p(e)}else"Escape"===t.key&&(n.trigger("cancel"),p(g.prevValue))},[]),E=h.useCallback(e=>{g.prevValue=e.value.name},[]),I=d.useLocalization().toLanguageString(he.nameBox,ve[he.nameBox]);return h.createElement("div",{className:"k-spreadsheet-name-editor",onKeyDown:x},h.createElement(i.ComboBox,{ref:a,title:I,popupSettings:{className:"k-spreadsheet-names-popup"},fillMode:"flat",clearButton:!1,dataItemKey:"name",textField:"name",itemRender:b,data:o,value:m?o.find(e=>e.name===m)||{name:m}:null,onChange:C,opened:l,onOpen:y,onClose:k,onFocus:E,listNoDataRender:v,allowCustom:!0,ariaLabel:I}))});ye.displayName="NameBox",ye.propTypes={};const ke=h.createContext({onSelect:()=>{},onDelete:()=>{},onEnterEdit:()=>{},onCancelEdit:()=>{},onExitEdit:()=>{},onEdit:()=>{}}),Ce=e=>{const t=e.dataItem,{onSelect:n,onDelete:a,onEnterEdit:o,onExitEdit:r,onCancelEdit:l,onEdit:i}=h.useContext(ke),d=h.useCallback(e=>{e.target instanceof HTMLElement&&"INPUT"===e.target.nodeName||n.call(void 0,t,e)},[t,n]),u=h.useCallback(e=>{a.call(void 0,t,e)},[t,a]),m=h.useCallback(e=>{e.target instanceof HTMLElement&&"INPUT"===e.target.nodeName||o.call(void 0,t,e)},[t,o]),p=h.useCallback(e=>{r.call(void 0,t,e)},[t,r]),g=h.useCallback(e=>{"Enter"===e.key?r.call(void 0,t,e):"Escape"===e.key&&l.call(void 0,t,e)},[t,r,l]),f=h.useCallback(e=>{i.call(void 0,{...t,text:e.target.value},e)},[t,i]);return h.createElement("li",{style:e.style,...e.attributes,ref:e.forwardRef,role:"tab",className:s.classNames("k-item k-tabstrip-item",{"k-disabled":e.isDisabled,"k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active":t.active,"k-spreadsheet-sheets-bar-inactive":!t.active,"k-first":t.first,"k-last":t.last}),onClick:d,onDoubleClick:m},t.inEdit?h.createElement("input",{type:"text",className:"k-textbox k-spreadsheet-sheets-editor",value:t.text,onChange:f,maxLength:50,autoFocus:!0,onBlur:p,onKeyDown:g}):h.createElement(h.Fragment,null,h.createElement("span",{className:"k-link"},t.text),t.first&&t.last?null:h.createElement("span",{className:"k-link k-spreadsheet-sheets-remove",onClick:u},h.createElement(s.IconWrap,{name:"x",icon:c.xIcon}))))},xe=h.forwardRef((e,t)=>{const{children:n,className:a,...o}=e;return h.createElement("ul",{className:s.classNames("k-tabstrip-items k-reset",a),role:"tablist",...o,ref:t},n)});xe.displayName="TabsList";const Ee=e=>{const{sheets:t,setSheets:n,onSheetSelect:a,onSheetDelete:o,onSheetEdit:r,onSheetReorderEnd:l}=e,[s,c]=h.useState(null),i=h.useRef(!1),d=h.useRef(-1),m=h.useCallback(e=>{n(e.map((e,t,n)=>({...e,first:0===t,last:t===n.length-1})))},[]),p=h.useCallback(e=>{m(e.newState)},[m,l]),g=h.useCallback(e=>{l.call(void 0,e)},[l]),f=h.useCallback(e=>{i.current=!0,d.current=e.prevIndex},[]),b=h.useCallback(e=>{setTimeout(()=>{i.current=!1},50),l.call(void 0,{...e,prevIndex:d.current})},[]),v=h.useCallback((e,t)=>{i.current||a.call(void 0,e,t)},[a]),y=h.useCallback((e,t)=>{t.stopPropagation(),o.call(void 0,e)},[t,o]),k=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(t=>({...t,active:t.id===e.id,inEdit:t.id===e.id}));n(o),c({...e})},[t]),C=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(e=>({...e,inEdit:!1,text:e.inEdit&&s?s.text:e.text}));n(o),c(null)},[t,s]),x=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(e=>({...e,inEdit:!1})),l=t.findIndex(t=>t.id===e.id);n(o),c(null),r.call(void 0,e,l)},[t,r]),E=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(t=>({...t,text:e.id===t.id?e.text:t.text}));n(o)},[t]);return h.createElement("div",{className:"k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom"},h.createElement("div",{className:"k-tabstrip-items-wrapper k-hstack"},h.createElement(ke.Provider,{value:{onSelect:v,onDelete:y,onEnterEdit:k,onCancelEdit:C,onExitEdit:x,onEdit:E}},h.createElement(u.Sortable,{idField:"id",data:t,itemUI:Ce,itemsWrapUI:xe,onDragOver:p,onNavigate:g,onDragStart:f,onDragEnd:b,navigatable:!0}))))},Ie=e=>{const{spreadsheetRef:t}=e,[n,o]=h.useState([]),r=h.useRef((n.find(e=>e.active)||{}).text),l=s.useId(),i=h.useCallback(()=>{t.current&&(t.current.view.sheetsbar.onSheetSelect(r.current),o(((e,t,n)=>e.map((e,a,o)=>({text:e.name(),id:n+"-sheet-"+a,first:0===a,last:a===o.length-1,active:e.name()===t})))(t.current.sheets(),r.current,l)))},[]),u=h.useCallback(()=>{if(t.current){const e=t.current.sheets();e.find(e=>e.name()===r.current)||(r.current=e[e.length-1].name()),i()}},[]);h.useEffect(()=>(t.current&&(t.current.sheets().length&&(r.current=t.current.sheets()[0].name(),i()),t.current.view.bind("update",u)),()=>{t.current&&t.current.view.unbind("update",u)}),[t.current]);const m=h.useCallback(e=>{r.current!==e.text&&(r.current=e.text,i())},[]),p=h.useCallback(()=>{if(t.current){t.current.view.sheetsbar.onAddSelect();const e=t.current.sheets();r.current=e[e.length-1].name(),i()}},[]),g=h.useCallback(e=>{if(t.current){if(r.current===e.text){const n=t.current.sheets(),a=n.findIndex(t=>t.name()===e.text),o=n[a+1]||n[a-1];r.current=o?o.name():""}t.current.view.sheetsbar.onSheetRemove(e.text),i()}},[]),f=h.useCallback((e,n)=>{if(t.current){let a=e.text;const o=t.current.sheets(),l=o[n];if(!a)return r.current=l.name(),void i();if(l&&l.name()===a)return;o.find(e=>e.name()===a)&&(a=l.name()),t.current.view.sheetsbar.onSheetRename(a,n),r.current=a,i()}},[]),b=h.useCallback(e=>{if(t.current){const{prevIndex:n,nextIndex:a}=e;r.current=t.current.sheets()[n].name(),t.current.view.sheetsbar.onSheetReorderEnd({oldIndex:n,newIndex:a}),i()}},[]);return h.createElement("div",{className:"k-spreadsheet-sheets-bar k-header"},h.createElement(a.Button,{fillMode:"flat",icon:"plus",className:"k-spreadsheet-sheets-bar-add",title:d.useLocalization().toLanguageString(he.addNewSheet,ve[he.addNewSheet]),svgIcon:c.plusIcon,onClick:p}),h.createElement(Ee,{sheets:n,setSheets:o,onSheetSelect:m,onSheetDelete:g,onSheetEdit:f,onSheetReorderEnd:b}))},Se=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(()=>{t.current&&t.current.saveAsExcel({...t.current.options.excel,saveAs:p.saveAs,Workbook:g.Workbook})},[]);return h.createElement(a.Button,{className:"k-toolbar-button",title:"Export...",icon:"download",fillMode:"flat",svgIcon:c.downloadIcon,onClick:n})};Se.displayName="ExcelExport";const we=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(e=>{const t=e.target;if(t instanceof Element&&t.parentNode){const e=t.closest(".k-toolbar"),n=e&&e.querySelector(".k-upload input");n&&n.click()}},[]),o=h.useCallback(e=>{const n=e.newState;if(n[0]&&n[0].getRawFile){const e=n[0].getRawFile();t.current&&t.current.executeCommand({command:"OpenCommand",options:{file:e}})}},[]);return h.createElement(h.Fragment,null,h.createElement(a.Button,{className:"k-toolbar-button",title:d.useLocalization().toLanguageString(he.open,ve[he.open]),icon:"folder-open",svgIcon:c.folderOpenIcon,fillMode:"flat",onClick:n}),h.createElement("div",{style:{display:"none"}},h.createElement(f.Upload,{restrictions:{allowedExtensions:[".xlsx"]},onAdd:o,autoUpload:!1,defaultFiles:[],multiple:!1,accept:".xlsx,.XLSX",withCredentials:!1})))};we.displayName="Open";const Ne=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],Re=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],Ae=[{text:"Automatic",value:null},{text:"Text",value:"@"},{text:"Number",value:"#,0.00"},{text:"Percent",value:"0.00%"},{text:"Financial",value:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)'},{text:"Currency",value:"$#,##0.00;[Red]$#,##0.00"},{text:"Date",value:"m/d/yyyy"},{text:"Time",value:"h:mm:ss AM/PM"},{text:"Date time",value:"m/d/yyyy h:mm"},{text:"Duration",value:"[h]:mm:ss"}],De=e=>t=>{const{property:n,icon:o,svgIcon:r,titleKey:l}=e,{spreadsheetRef:s,value:c}=t,i=h.useCallback(()=>{if(s.current){const e={command:"PropertyChangeCommand",options:{property:n,value:!c}};s.current.executeCommand(e)}},[c]);return h.createElement(a.Button,{type:"button",icon:o,svgIcon:r,fillMode:"flat",togglable:!0,onClick:i,selected:!!c,title:d.useLocalization().toLanguageString(l,ve[l])})},Le=e=>t=>{const{property:n,titleKey:a,...o}=e,{spreadsheetRef:r,value:l}=t,s=h.useCallback(e=>{if(r.current){const t={command:"PropertyChangeCommand",options:{property:n,value:e.value||null}};r.current.executeCommand(t)}},[n]);return h.createElement(b.ColorPicker,{onChange:s,onActiveColorClick:s,fillMode:"flat",...o,title:d.useLocalization().toLanguageString(a,ve[a]),value:l})},Ke=e=>t=>{const{spreadsheetRef:n}=t,o=h.useCallback(()=>{n.current&&n.current.workbook.undoRedoStack[e.action]()},[]);return h.createElement(a.Button,{type:"button",icon:e.icon,svgIcon:e.svgIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(e.titleKey,ve[e.titleKey]),onClick:o,togglable:!0})},Fe=De({property:"bold",icon:"bold",svgIcon:c.boldIcon,titleKey:he.bold});Fe.displayName="Bold";const Te=De({property:"italic",icon:"italic",svgIcon:c.italicIcon,titleKey:he.italic});Te.displayName="Italic";const ze=De({property:"underline",icon:"underline",svgIcon:c.underlineIcon,titleKey:he.underline});ze.displayName="Underline";const Pe=e=>{const{spreadsheetRef:t,value:n}=e,a=h.useCallback(e=>{if(t.current){const n={command:"PropertyChangeCommand",options:{property:"fontFamily",value:e.value||null}};t.current.executeCommand(n)}},[]);return h.createElement(i.DropDownList,{onChange:a,value:n,data:Ne,defaultValue:"Arial",fillMode:"flat",title:d.useLocalization().toLanguageString(he.fontName,ve[he.fontName]),leftRightKeysNavigation:!1})};Pe.displayName="FontFamily";const Be=e=>"string"==typeof e?parseFloat(e):e,Oe=e=>{const{spreadsheetRef:t}=e,n=Be(e.value),a=h.useCallback(e=>{var a;let o=e.value?Be(e.value):n;o=isNaN(o)?n:o,o=Math.min(409,Math.max(1,o));const r={command:"PropertyChangeCommand",options:{property:"fontSize",value:o}};"keydown"===e.nativeEvent.type||"focusout"===e.nativeEvent.type?null==(a=t.current)||a.executeCommand(r):setTimeout(()=>{var e;null==(e=t.current)||e.executeCommand(r)},0)},[n]),o=d.useLocalization().toLanguageString(he.fontSize,ve[he.fontSize]);return h.createElement(i.ComboBox,{onChange:a,value:n,data:Re,defaultValue:12,allowCustom:!0,fillMode:"flat",title:o,tabIndex:-1,clearButton:!1,ariaLabel:o})};Oe.displayName="FontSize";const Me=e=>{const t=t=>{const{property:n,icon:o,svgIcon:r,titleKey:l,step:s}=e,{spreadsheetRef:c}=t,i=Be(t.value),u=h.useCallback(()=>{var e;const t={command:"PropertyChangeCommand",options:{property:n,value:Math.min(409,Math.max(1,i+s))}};null==(e=c.current)||e.executeCommand(t)},[i]);return h.createElement(a.Button,{type:"button",icon:o,svgIcon:r,fillMode:"flat",onClick:u,disabled:i+s<1||i+s>409,title:d.useLocalization().toLanguageString(l,ve[l])})};return t.displayName=e.displayName,t},je=Me({property:"fontSize",icon:"font-grow",svgIcon:c.fontGrowIcon,titleKey:he.fontSizeIncrease,displayName:"IncreaseFontSize",step:1}),He=Me({property:"fontSize",icon:"font-shrink",svgIcon:c.fontShrinkIcon,titleKey:he.fontSizeDecrease,displayName:"DecreaseFontSize",step:-1}),We=Le({icon:"foreground-color",svgIcon:c.foregroundColorIcon,view:"palette",property:"color",titleKey:he.textColor,ariaLabel:"Text Color"});We.displayName="TextColor";const Ue=Le({icon:"droplet",svgIcon:c.dropletIcon,view:"palette",property:"background",titleKey:he.background,ariaLabel:"Background"});Ue.displayName="BackgroundColor";const qe=[{icon:"align-left",svgIcon:c.alignLeftIcon,textKey:he.alignLeft,commandName:"textAlign",value:"left",selected:!1},{icon:"align-center",svgIcon:c.alignCenterIcon,textKey:he.alignCenter,commandName:"textAlign",value:"center",selected:!1},{icon:"align-right",svgIcon:c.alignRightIcon,textKey:he.alignRight,commandName:"textAlign",value:"right",selected:!1},{icon:"align-justify",svgIcon:c.alignJustifyIcon,textKey:he.alignJustify,commandName:"textAlign",value:"justify",selected:!1},{icon:"align-top",svgIcon:c.alignTopIcon,textKey:he.alignTop,commandName:"verticalAlign",value:"top",selected:!1},{icon:"align-middle",svgIcon:c.alignMiddleIcon,textKey:he.alignMiddle,commandName:"verticalAlign",value:"center",selected:!1},{icon:"align-bottom",svgIcon:c.alignBottomIcon,textKey:he.alignBottom,commandName:"verticalAlign",value:"bottom",selected:!1}],Ve=[qe[0],{...qe[1],textKey:he.center},qe[2],{...qe[3],textKey:he.justify}],Je=qe.filter(e=>"verticalAlign"===e.commandName),_e=e=>{const{value:t,spreadsheetRef:n}=e,{textAlign:o,verticalAlign:r}=t||{},l=d.useLocalization(),i=h.useCallback(e=>{if(n.current){const t=e.item,a={command:"PropertyChangeCommand",options:{property:t.commandName,value:t.value||null}};n.current.executeCommand(a)}},[]);let u=qe.slice();return u=u.map(e=>({...e,text:l.toLanguageString(e.textKey,ve[e.textKey])})),o&&(u=u.map(e=>"textAlign"===e.commandName?{...e,selected:e.value===o}:e)),r&&(u=u.map(e=>"verticalAlign"===e.commandName?{...e,selected:e.value===r}:e)),h.createElement(a.DropDownButton,{icon:"align-left",svgIcon:c.alignLeftIcon,items:u,fillMode:"flat",onItemClick:i,title:l.toLanguageString(he.align,ve[he.align]),text:h.createElement(s.IconWrap,{name:"caret-alt-down",icon:c.caretAltDownIcon})})};_e.displayName="Alignment";const Ge={items:Ve,icon:{icon:"align-left",svgIcon:c.alignLeftIcon},displayName:"AlignHorizontally",titleKey:he.alignHorizontally},$e={items:Je,icon:{icon:"align-bottom",svgIcon:c.alignBottomIcon},displayName:"AlignVertically",titleKey:he.alignVertically},Xe=e=>{const t=t=>{const{value:n,spreadsheetRef:o}=t,r=d.useLocalization(),l=h.useCallback(e=>{if(o.current){const t=e.item,n={command:"PropertyChangeCommand",options:{property:t.commandName,value:t.value||null}};o.current.executeCommand(n)}},[]);let i=e.items.slice();i=i.map(e=>({...e,text:r.toLanguageString(e.textKey,ve[e.textKey])})),i=i.map(e=>({...e,selected:e.value===n}));const u={...e.icon},m=i.find(e=>e.selected);return m&&(u.icon=m.icon,u.svgIcon=m.svgIcon),h.createElement(a.DropDownButton,{...u,items:i,fillMode:"flat",onItemClick:l,title:r.toLanguageString(e.titleKey,ve[e.titleKey]),text:h.createElement(s.IconWrap,{name:"caret-alt-down",icon:c.caretAltDownIcon})})};return t.displayName=e.displayName,t},Qe=Xe(Ge),Ye=Xe($e),Ze=e=>{const{value:t,spreadsheetRef:n}=e,o=h.useCallback(()=>{if(n.current){const e=n.current.activeSheet();if(e){const t={command:"TextWrapCommand",options:{property:"wrap",value:!e.range(e.activeCell()).wrap()}};n.current.executeCommand(t)}}},[]);return h.createElement(a.Button,{type:"button",togglable:!0,icon:"text-wrap",svgIcon:c.textWrapIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(he.textWrap,ve[he.textWrap]),onClick:o,selected:t})};Ze.displayName="TextWrap";const et=e=>{const{value:t,spreadsheetRef:n}=e,o=h.useCallback(()=>{if(n.current){const e=n.current.activeSheet();if(e){const t={command:"GridLinesChangeCommand",options:{property:"gridLines",value:!e.showGridLines()}};n.current.executeCommand(t)}}},[]);return h.createElement(a.Button,{type:"button",togglable:!0,icon:"borders-none",svgIcon:c.bordersNoneIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(he.gridLines,ve[he.gridLines]),onClick:o,selected:t})};et.displayName="GridLines";const tt=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(e=>{const n=e.item.value||null;setTimeout(()=>{if(t.current){const e={command:"PropertyChangeCommand",options:{property:"format",value:n}};t.current.executeCommand(e)}},0)},[]);return h.createElement(a.DropDownButton,{icon:"custom-format",svgIcon:c.customFormatIcon,fillMode:"flat",onItemClick:n,items:Ae,title:d.useLocalization().toLanguageString(he.format,ve[he.format]),text:h.createElement(s.IconWrap,{name:"caret-alt-down"})})};tt.displayName="Format";const nt=e=>t=>{const{spreadsheetRef:n,value:o}=t,r=h.useCallback(()=>{if(n.current){const t={command:e.command,options:{value:e.value}};n.current.executeCommand(t)}},[]);return h.createElement(a.Button,{type:"button",icon:e.icon,svgIcon:e.svgIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(e.titleKey,ve[e.titleKey]),onClick:r,disabled:o&&e.disabled(o)})},at={command:"AddColumnCommand",value:"left",icon:"table-column-insert-left",svgIcon:c.tableColumnInsertLeftIcon,titleKey:he.addColumnLeft,disabled:e=>e.allCols,displayName:"AddColumnLeft"},ot={command:"AddColumnCommand",value:"right",icon:"table-column-insert-right",svgIcon:c.tableColumnInsertRightIcon,titleKey:he.addColumnRight,disabled:e=>e.allCols,displayName:"AddColumnRight"},rt={command:"AddRowCommand",value:"below",icon:"table-row-insert-below",svgIcon:c.tableRowInsertBelowIcon,titleKey:he.addRowBelow,disabled:e=>e.allRows,displayName:"AddRowBelow"},lt={command:"AddRowCommand",value:"above",icon:"table-row-insert-above",svgIcon:c.tableRowInsertAboveIcon,titleKey:he.addRowAbove,disabled:e=>e.allRows,displayName:"AddRowAbove"},st={command:"DeleteColumnCommand",icon:"table-column-delete",svgIcon:c.tableColumnDeleteIcon,titleKey:he.deleteColumn,disabled:e=>e.allCols,displayName:"DeleteColumn"},ct={command:"DeleteRowCommand",icon:"table-row-delete",svgIcon:c.tableRowDeleteIcon,titleKey:he.deleteRow,disabled:e=>e.allRows,displayName:"DeleteRow"},it=nt(at),dt=nt(ot),ut=nt(rt),mt=nt(lt),pt=nt(st),gt=nt(ct);it.displayName="AddColumnLeft",dt.displayName="AddColumnRight",ut.displayName="AddRowBelow",mt.displayName="AddRowAbove",pt.displayName="DeleteColumn",gt.displayName="DeleteRow";const ft=Ke({action:"undo",icon:"reset",svgIcon:c.arrowRotateCcwIcon,titleKey:he.undo});ft.displayName="Undo";const bt=Ke({action:"redo",icon:"reload",svgIcon:c.arrowRotateCwIcon,titleKey:he.redo});bt.displayName="Redo";const vt=e=>t=>{const{icon:n,svgIcon:o,titleKey:r,value:l}=e,{spreadsheetRef:s}=t,c=h.useCallback(()=>{if(s.current){const e={command:"AdjustDecimalsCommand",options:{value:l}};s.current.executeCommand(e)}},[]);return h.createElement(a.Button,{type:"button",icon:n,svgIcon:o,fillMode:"flat",onClick:c,title:d.useLocalization().toLanguageString(r,ve[r])})},ht=vt({icon:c.decimalIncreaseIcon.name,svgIcon:c.decimalIncreaseIcon,value:1,titleKey:he.increaseDecimal});ht.displayName="IncreaseDecimal";const yt=vt({icon:c.decimalDecreaseIcon.name,svgIcon:c.decimalDecreaseIcon,value:-1,titleKey:he.decreaseDecimal});yt.displayName="DecreaseDecimal";const kt=[{textKey:he.file,tools:[we,Se]},{textKey:he.home,selected:!0,tools:[[ft,bt],a.ToolbarSeparator,Pe,Oe,je,He,a.ToolbarSeparator,[Fe,Te,ze],We,a.ToolbarSeparator,Ue,a.ToolbarSeparator,Qe,Ye,Ze,a.ToolbarSeparator,et]},{textKey:he.insert,tools:[[it,dt,ut,mt],a.ToolbarSeparator,[pt,gt]]},{textKey:he.formatTab,tools:[tt,[yt,ht]]}],Ct=Object.freeze({name:"@progress/kendo-react-spreadsheet",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1683639393,version:"14.5.0-develop.8",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"}),xt=["bold","italic","underline","fontFamily","fontSize","color","background","textAlign","verticalAlign","wrap","gridLines"],Et={Bold:e=>e.bold,Italic:e=>e.italic,Underline:e=>e.underline,FontFamily:e=>e.fontFamily,FontSize:e=>e.fontSize,IncreaseFontSize:e=>e.fontSize,DecreaseFontSize:e=>e.fontSize,TextColor:e=>e.color,BackgroundColor:e=>e.background,Alignment:e=>({textAlign:e.textAlign,verticalAlign:e.verticalAlign}),AlignHorizontally:e=>e.textAlign,AlignVertically:e=>e.verticalAlign,TextWrap:e=>e.wrap,GridLines:e=>e.gridLines,AddColumnLeft:e=>e.selectedHeaders,AddColumnRight:e=>e.selectedHeaders,AddRowBelow:e=>e.selectedHeaders,AddRowAbove:e=>e.selectedHeaders,DeleteColumn:e=>e.selectedHeaders,DeleteRow:e=>e.selectedHeaders},It=":not(.k-dropdownlist button):not(.k-combobox button):not(.k-upload-button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",St=["button"+It,".k-button-group > button"+It,".k-dropdownlist",".k-combobox",".k-colorpicker"],wt=h.forwardRef((e,t)=>{const n=!s.validatePackage(Ct,{component:"Spreadsheet"}),l=s.getLicenseMessage(Ct),{toolbar:i=kt}=e,u=[];"boolean"==typeof i?u.push(...i?kt:[]):u.push(...i);const[f,b]=h.useState(null),[v,y]=h.useState(u.findIndex(e=>e.selected)||0),[C,x]=h.useState(!1),E=h.useRef(null),I=h.useRef(null),S=h.useRef(null),w=h.useRef(null),N=h.useRef(null),[R,A]=h.useState({}),D=h.useRef({});D.current=R;const L=h.useRef({});L.current=e;const K=d.useLocalization(),F=h.useCallback(e=>{L.current.onSelect&&L.current.onSelect.call(void 0,e)},[]),T=h.useCallback(e=>{L.current.onChange&&L.current.onChange.call(void 0,e)},[]),z=h.useCallback(e=>{L.current.onChangeFormat&&L.current.onChangeFormat.call(void 0,e)},[]),P=h.useCallback(e=>{L.current.onExcelImport&&L.current.onExcelImport.call(void 0,e)},[]),B=h.useCallback(e=>{L.current.onExcelExport&&L.current.onExcelExport.call(void 0,e)},[]),O=h.useRef(null);h.useImperativeHandle(O,()=>({element:E.current,get instance(){return N.current},props:e,get view(){return N.current.view},get workbook(){return N.current.workbook},executeCommand(e){var t;null==(t=N.current)||t.executeCommand(e)},fromJSON(e){var t;return null==(t=N.current)?void 0:t.fromJSON(e)},toJSON:()=>N.current.toJSON(),saveJSON:()=>N.current.saveJSON(),fromFile:e=>N.current.fromFile(e),saveAsExcel(e){var t;null==(t=N.current)||t.saveAsExcel({...N.current.options.excel,saveAs:p.saveAs,Workbook:g.Workbook,...e})},activeSheet(e){var t;return null==(t=N.current)?void 0:t.activeSheet(e)},sheets:()=>N.current.sheets(),refresh(){var e;return null==(e=N.current)?void 0:e.refresh()}}),[e]),h.useImperativeHandle(t,()=>O.current);const M=h.useCallback(()=>N.current&&N.current.view.nameEditor,[]),j=h.useCallback(e=>{const t={};xt.forEach(n=>{"function"==typeof e.range[n]?t[n]=e.range[n]():"gridLines"===n&&(t[n]=e.range.sheet().showGridLines())}),t.selectedHeaders=e.range.sheet().selectedHeaders(),(xt.some(e=>t[e]!==D.current[e])||t.selectedHeaders.allCols!==D.current.selectedHeaders.allCols||t.selectedHeaders.allRows!==D.current.selectedHeaders.allRows)&&A(t)},[]),H=h.useCallback(e=>{const t=e.name,n=he[t];b({title:"Error"===e.title?K.toLanguageString(he.error,ve[he.error]):e.title,message:n?K.toLanguageString(n,ve[n]||e.text):e.text,close:e.close})},[]),W=h.useCallback(()=>{b(null),null==f||f.close()},[f]),U=d.useInternationalization(),q=d.useLocalization();h.useEffect(()=>{var t;const n={...e.defaultProps,sheets:null==window?void 0:window.structuredClone(null==(t=e.defaultProps)?void 0:t.sheets),messages:{workbook:{defaultSheetName:q.toLanguageString(he.defaultSheetName,ve[he.defaultSheetName])}},intl:{localeInfo:()=>U.localeInfo(),localeCurrency:()=>U.localeCurrency(),parseDate:(e,t)=>U.parseDate(e,t),toString:(e,t)=>U.toString(e,t),format:(e,...t)=>U.format(e,...t)},formulaBarInputRef:I,formulaCellInputRef:S,nameBoxRef:w},a=new m.SpreadsheetWidget(E.current,n);N.current=a,a.bind("select",F),a.bind("change",T),a.bind("changeFormat",z),a.bind("excelImport",P),a.bind("excelExport",B),a.view.bind("update",j),a.view.bind("message",H);const o=a.activeSheet();return o&&j({range:o.range(o.activeCell())}),x(!0),()=>{a.destroy()}},[]);const V=h.useCallback((e,t)=>{const n=h.createElement(e,{spreadsheetRef:N,value:Et[e.displayName]?Et[e.displayName](R):void 0,key:t});return n.type===a.ToolbarSeparator?h.createElement(e,{key:t}):n},[R]);let J=null;return u.length&&(J=h.createElement(o.TabStrip,{selected:v,animation:!1,className:"k-floatwrap k-spreadsheet-tabstrip",style:{minHeight:"auto"},onSelect:e=>y(e.selected)},u.map(e=>{const t=e.textKey?q.toLanguageString(e.textKey,ve[e.textKey]):e.text;return h.createElement(o.TabStripTab,{key:e.textKey||e.text,title:t},h.createElement(a.Toolbar,{buttons:St,className:"k-spreadsheet-toolbar"},e.tools.map((e,t)=>Array.isArray(e)?h.createElement(a.ButtonGroup,{key:t},e.map((e,t)=>V(e,t))):V(e,t))))}))),h.createElement("div",{ref:E,style:e.style,className:s.classNames("k-widget k-spreadsheet",e.className),role:"application"},J,h.createElement("div",{className:"k-spreadsheet-action-bar"},h.createElement(ye,{ref:w,nameEditor:M}),h.createElement("div",{className:"k-spreadsheet-formula-bar"},h.createElement(s.IconWrap,{name:"formula-fx",icon:c.formulaFxIcon}),h.createElement(k,{ref:I}))),h.createElement("div",{className:"k-spreadsheet-view"},h.createElement("div",{className:"k-spreadsheet-fixed-container"}),h.createElement("div",{className:"k-spreadsheet-scroller"},h.createElement("div",{className:"k-spreadsheet-view-size"})),h.createElement("div",{tabIndex:0,className:"k-spreadsheet-clipboard",contentEditable:"true"}),h.createElement(k,{ref:S,className:"k-spreadsheet-cell-editor"})),h.createElement(Ie,{spreadsheetRef:N}),f&&h.createElement(r.Dialog,{title:f.title,onClose:W},h.createElement("div",null,f.message),h.createElement(r.DialogActionsBar,{layout:"start"},h.createElement(a.Button,{themeColor:"primary",onClick:W,autoFocus:!0},K.toLanguageString(he.ok,ve[he.ok])))),n&&h.createElement(s.WatermarkOverlay,{message:l}))});wt.displayName="KendoReactSpreadsheet",wt.propTypes={className:n.string,defaultProps:n.any,toolbar:n.oneOfType([n.bool,n.arrayOf(n.any)]),style:n.object,onSelect:n.func,onChange:n.func,onChangeFormat:n.func,onExcelImport:n.func,onExcelExport:n.func};Object.defineProperty(e,"CalcError",{enumerable:!0,get:function(){return m.CalcError}}),Object.defineProperty(e,"CellRef",{enumerable:!0,get:function(){return m.CellRef}}),Object.defineProperty(e,"Context",{enumerable:!0,get:function(){return m.Context}}),Object.defineProperty(e,"Matrix",{enumerable:!0,get:function(){return m.Matrix}}),Object.defineProperty(e,"NULLREF",{enumerable:!0,get:function(){return m.NULLREF}}),Object.defineProperty(e,"NameRef",{enumerable:!0,get:function(){return m.NameRef}}),Object.defineProperty(e,"Range",{enumerable:!0,get:function(){return m.Range}}),Object.defineProperty(e,"RangeRef",{enumerable:!0,get:function(){return m.RangeRef}}),Object.defineProperty(e,"Ref",{enumerable:!0,get:function(){return m.Ref}}),Object.defineProperty(e,"Sheet",{enumerable:!0,get:function(){return m.Sheet}}),Object.defineProperty(e,"SpreadsheetWidget",{enumerable:!0,get:function(){return m.SpreadsheetWidget}}),Object.defineProperty(e,"UnionRef",{enumerable:!0,get:function(){return m.UnionRef}}),Object.defineProperty(e,"View",{enumerable:!0,get:function(){return m.View}}),Object.defineProperty(e,"Workbook",{enumerable:!0,get:function(){return m.Workbook}}),Object.defineProperty(e,"dateToSerial",{enumerable:!0,get:function(){return m.dateToSerial}}),Object.defineProperty(e,"defineAlias",{enumerable:!0,get:function(){return m.defineAlias}}),Object.defineProperty(e,"defineFunction",{enumerable:!0,get:function(){return m.defineFunction}}),Object.defineProperty(e,"packDate",{enumerable:!0,get:function(){return m.packDate}}),Object.defineProperty(e,"packTime",{enumerable:!0,get:function(){return m.packTime}}),Object.defineProperty(e,"serialToDate",{enumerable:!0,get:function(){return m.serialToDate}}),Object.defineProperty(e,"unpackDate",{enumerable:!0,get:function(){return m.unpackDate}}),Object.defineProperty(e,"unpackTime",{enumerable:!0,get:function(){return m.unpackTime}}),e.AddColumnLeft=it,e.AddColumnRight=dt,e.AddRowAbove=mt,e.AddRowBelow=ut,e.AlignHorizontally=Qe,e.AlignVertically=Ye,e.Alignment=_e,e.BackgroundColor=Ue,e.Bold=Fe,e.CleanFormatting=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(()=>{t.current&&t.current.executeCommand({command:"PropertyCleanCommand"})},[]);return h.createElement(a.Button,{type:"button",icon:"clean-css",svgIcon:c.clearCssIcon,fillMode:"flat",onClick:n,title:d.useLocalization().toLanguageString(he.cleanFormatting,ve[he.cleanFormatting])})},e.DecreaseDecimal=yt,e.DecreaseFontSize=He,e.DeleteColumn=pt,e.DeleteRow=gt,e.ExcelExport=Se,e.FontFamily=Pe,e.FontSize=Oe,e.Format=tt,e.GridLines=et,e.IncreaseDecimal=ht,e.IncreaseFontSize=je,e.Italic=Te,e.Open=we,e.Redo=bt,e.Spreadsheet=wt,e.TextColor=We,e.TextWrap=Ze,e.Underline=ze,e.Undo=ft,e.defaultTabs=kt,e.toolsValueMap=Et});
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-popup"),require("@progress/kendo-react-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-dropdowns"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-sortable"),require("@progress/kendo-spreadsheet-common"),require("@progress/kendo-file-saver"),require("@progress/kendo-ooxml"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-inputs")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-dialogs","@progress/kendo-react-popup","@progress/kendo-react-common","@progress/kendo-svg-icons","@progress/kendo-react-dropdowns","@progress/kendo-react-intl","@progress/kendo-react-sortable","@progress/kendo-spreadsheet-common","@progress/kendo-file-saver","@progress/kendo-ooxml","@progress/kendo-react-upload","@progress/kendo-react-inputs"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactSpreadsheet={},e.React,e.PropTypes,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactDialogs,e.KendoReactPopup,e.KendoReactCommon,e.KendoSvgIcons,e.KendoReactDropdowns,e.KendoReactIntl,e.KendoReactSortable,e.KendoSpreadsheetCommon,e.KendoFileSaver,e.KendoOoxml,e.KendoReactUpload,e.KendoReactInputs)}(this,function(e,t,n,a,o,r,l,s,c,i,d,u,m,p,g,f,b){"use strict";function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var h=v(t);const y=h.forwardRef((e,t)=>{const n=h.useRef(null),a=h.useRef(null);return h.useImperativeHandle(n,()=>({element:a.current,props:e})),h.useImperativeHandle(t,()=>n.current),h.createElement("div",{className:"k-list k-list-md"},h.createElement("div",{className:"k-list-content"},h.createElement("ul",{ref:a,className:"k-spreadsheet-formula-list k-list-ul",onMouseDown:e=>e.preventDefault(),style:{maxHeight:280}},e.data.map(t=>h.createElement("li",{key:t.text,className:"k-list-item",onClick:()=>e.onItemClick(t.value)},h.createElement(s.IconWrap,{name:"formula-fx",icon:c.formulaFxIcon}),h.createElement("span",{className:"k-list-item-text"},t.text))))))});y.displayName="List",y.propTypes={};const k=h.forwardRef((e,t)=>{const[n,a]=h.useState(!1),[o,r]=h.useState(0),[c,i]=h.useState([]),d=h.useMemo(()=>({}),[]);d.showPopup=n,d.popupContentKey=o,d.data=c;const u=h.useRef(null),m=h.useRef(null),p=h.useRef(null),g=h.useCallback(()=>{if(p.current&&p.current.element)return p.current.element.querySelector(".k-focus")},[]),f=h.useCallback(()=>{const e=g();e&&e.classList.remove("k-focus")},[]),b=h.useCallback(e=>{const t=Array.from(p.current&&p.current.element.children||[]),n=g();let a;if(n){const o=t.indexOf(n);n.classList.remove("k-focus"),a=t[o+e]?t[o+e]:1===e?t[0]:t[t.length-1]}else a=1===e?t[0]:t[t.length-1];a&&a.classList.add("k-focus")},[]);h.useImperativeHandle(u,()=>({element:m.current,props:e,popup:{open:()=>{a(!0)},close:()=>{a(!1)},position:()=>{r(d.popupContentKey+1)},visible:()=>d.showPopup},list:{get element(){return p.current&&p.current.element},data:e=>{if(!e)return d.data;i(e)},value:()=>({}),focus:()=>Array.from(p.current&&p.current.element&&p.current.element.children||[]).indexOf(g()),focusNext:()=>{b(1)},focusPrev:()=>{b(-1)},focusFirst:()=>{const e=p.current&&p.current.element;e&&e.children.item(0)&&(f(),e.children.item(0).classList.add("k-focus"))},focusLast:()=>{const e=p.current&&p.current.element;e&&e.children.length&&(f(),e.children.item(e.children.length-1).classList.add("k-focus"))},itemClick:e=>{d.itemClick=e}}}),[]),h.useImperativeHandle(t,()=>u.current,[]);const v=h.useCallback(e=>{d.itemClick&&d.itemClick(e)},[]);return h.createElement(h.Fragment,null,h.createElement("div",{className:s.classNames("k-spreadsheet-formula-input",e.className),contentEditable:"true",spellCheck:"false",style:{whiteSpace:"pre"},ref:m,"aria-haspopup":"menu",title:"Formula Input","aria-expanded":n,role:"combobox"}),h.createElement(l.Popup,{show:n,anchor:m.current,animate:{openDuration:100,closeDuration:100},contentKey:o,popupClass:"k-list-container"},h.createElement(y,{data:c,ref:p,onItemClick:v})))});k.displayName="FormulaInput",k.propTypes={};const C="spreadsheet.bold",x="spreadsheet.italic",I="spreadsheet.underline",E="spreadsheet.openFile",w="spreadsheet.textColor",S="spreadsheet.background",N="spreadsheet.addRowAbove",R="spreadsheet.addRowBelow",A="spreadsheet.addColumnLeft",D="spreadsheet.addColumnRight",L="spreadsheet.deleteRow",K="spreadsheet.deleteColumn",F="spreadsheet.undo",T="spreadsheet.redo",z="spreadsheet.fontSize",P="spreadsheet.fontSizeIncrease",B="spreadsheet.fontSizeDecrease",O="spreadsheet.fontName",M="spreadsheet.cleanFormatting",j="spreadsheet.format",H="spreadsheet.alignHorizontally",W="spreadsheet.alignVertically",U="spreadsheet.align",q="spreadsheet.alignLeft",V="spreadsheet.alignRight",J="spreadsheet.alignCenter",_="spreadsheet.center",G="spreadsheet.alignJustify",$="spreadsheet.justify",X="spreadsheet.alignTop",Q="spreadsheet.alignMiddle",Y="spreadsheet.alignBottom",Z="spreadsheet.increaseDecimal",ee="spreadsheet.decreaseDecimal",te="spreadsheet.textWrap",ne="spreadsheet.gridLines",ae="spreadsheet.exportToExcel",oe="spreadsheet.nameBox",re="spreadsheet.defaultSheetName",le="spreadsheet.home",se="spreadsheet.file",ce="spreadsheet.insert",ie="spreadsheet.formatTab",de="spreadsheet.addNewSheet",ue="spreadsheet.error",me="spreadsheet.ok",pe="spreadsheet.modifyMerged",ge="spreadsheet.cannotModifyDisabled",fe="spreadsheet.openUnsupported",be="spreadsheet.duplicateSheetName",ve={[C]:"Bold",[x]:"Italic",[I]:"Underline",[F]:"Undo",[T]:"Redo",[z]:"Font size",[P]:"Increase Font size",[B]:"Decrease Font size",[O]:"Font",[M]:"Clean formatting",[j]:"Custom format...",[H]:"Align horizontally",[W]:"Align vertically",[U]:"Align",[q]:"Align left",[V]:"Align right",[J]:"Align center",[G]:"Align justify",[_]:"Center",[$]:"Justify",[X]:"Align top",[Q]:"Align middle",[Y]:"Align bottom",[Z]:"Increase decimal",[ee]:"Decrease decimal",[w]:"Text Color",[S]:"Background color",[N]:"Add row above",[R]:"Add row below",[A]:"Add column left",[D]:"Add column right",[L]:"Delete row",[K]:"Delete column",[E]:"Open...",[ae]:"Export to Excel",[te]:"Text Wrap",[ne]:"Toggle gridlines",[oe]:"Name Box",[re]:"Sheet",[le]:"Home",[se]:"File",[ce]:"Insert",[de]:"Add new sheet",[ie]:"Format",[pe]:"Cannot change part of a merged cell.",[ge]:"Cannot modify disabled cells.",[fe]:"Unsupported format. Please select an .xlsx file.",[be]:"There is an existing sheet with this name. Please enter another name.",[ue]:"Error",[me]:"OK"},he={bold:C,italic:x,underline:I,undo:F,redo:T,fontSize:z,fontSizeIncrease:P,fontSizeDecrease:B,fontName:O,cleanFormatting:M,format:j,alignHorizontally:H,alignVertically:W,align:U,alignLeft:q,alignRight:V,alignCenter:J,center:_,alignJustify:G,justify:$,alignTop:X,alignMiddle:Q,alignBottom:Y,increaseDecimal:Z,decreaseDecimal:ee,textColor:w,background:S,addRowAbove:N,addRowBelow:R,addColumnLeft:A,addColumnRight:D,deleteRow:L,deleteColumn:K,open:E,exportToExcel:ae,textWrap:te,gridLines:ne,nameBox:oe,defaultSheetName:re,file:se,home:le,insert:ce,addNewSheet:de,error:ue,ok:me,modifyMerged:pe,cannotModifyDisabled:ge,openUnsupported:fe,duplicateSheetName:be,formatTab:ie},ye=h.forwardRef((e,t)=>{const n=h.useRef(null),a=h.useRef(null),[o,r]=h.useState([]),[l,u]=h.useState(!1),[m,p]=h.useState(""),g=h.useMemo(()=>({}),[]);g.data=o,h.useImperativeHandle(n,()=>({value:e=>{if(void 0===e){const e=a.current&&a.current.value;return e&&(e.name||e)}p(e||"")}}),[]),h.useImperativeHandle(t,()=>n.current,[]);const f=h.useCallback(t=>{const n=e.nameEditor();n&&n.trigger("delete",{name:t})},[]),b=h.useCallback((e,t)=>{const n=h.createElement(h.Fragment,null,e.props.children,h.createElement("span",{role:"button",className:"k-button-delete",onClick:()=>f(t.dataItem[t.textField]),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>e.preventDefault(),"data-role":"delete"},h.createElement(s.IconWrap,{name:"x",icon:c.xIcon})));return h.cloneElement(e,e.props,n)},[]),v=h.useCallback(e=>h.cloneElement(e,{...e.props},h.createElement("div",null)),[]),y=h.useCallback(t=>{if(t.syntheticEvent&&"change"===t.syntheticEvent.type)return;const n=e.nameEditor();n&&(r(n.readData()),u(!0))},[]),k=h.useCallback(()=>{u(!1)},[]),C=h.useCallback(t=>{if(t.syntheticEvent.target.closest("[data-role]"))return;const n=e.nameEditor();if(n&&t.value){const e=t.value.name;e!==m&&(n.trigger("select",{name:e}),p(e))}},[m]),x=h.useCallback(t=>{const n=e.nameEditor();if(n)if("Enter"===t.key){const e=t.target.value;n.trigger("enter",{value:e}),p(e)}else"Escape"===t.key&&(n.trigger("cancel"),p(g.prevValue))},[]),I=h.useCallback(e=>{g.prevValue=e.value.name},[]),E=d.useLocalization().toLanguageString(he.nameBox,ve[he.nameBox]);return h.createElement("div",{className:"k-spreadsheet-name-editor",onKeyDown:x},h.createElement(i.ComboBox,{ref:a,title:E,popupSettings:{className:"k-spreadsheet-names-popup"},fillMode:"flat",clearButton:!1,dataItemKey:"name",textField:"name",itemRender:b,data:o,value:m?o.find(e=>e.name===m)||{name:m}:null,onChange:C,opened:l,onOpen:y,onClose:k,onFocus:I,listNoDataRender:v,allowCustom:!0,ariaLabel:E}))});ye.displayName="NameBox",ye.propTypes={};const ke=h.createContext({onSelect:()=>{},onDelete:()=>{},onEnterEdit:()=>{},onCancelEdit:()=>{},onExitEdit:()=>{},onEdit:()=>{}}),Ce=e=>{const t=e.dataItem,{onSelect:n,onDelete:o,onEnterEdit:r,onExitEdit:l,onCancelEdit:i,onEdit:d}=h.useContext(ke),u=h.useCallback(e=>{e.target instanceof HTMLElement&&"INPUT"===e.target.nodeName||n.call(void 0,t,e)},[t,n]),m=h.useCallback(e=>{o.call(void 0,t,e)},[t,o]),p=h.useCallback(e=>{e.target instanceof HTMLElement&&"INPUT"===e.target.nodeName||r.call(void 0,t,e)},[t,r]),g=h.useCallback(e=>{l.call(void 0,t,e)},[t,l]),f=h.useCallback(e=>{"Enter"===e.key?l.call(void 0,t,e):"Escape"===e.key&&i.call(void 0,t,e)},[t,l,i]),b=h.useCallback(e=>{d.call(void 0,{...t,text:e.target.value},e)},[t,d]);return h.createElement("li",{style:e.style,...e.attributes,ref:e.forwardRef,role:"tab",className:s.classNames("k-item k-tabstrip-item",{"k-disabled":e.isDisabled,"k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active":t.active,"k-spreadsheet-sheets-bar-inactive":!t.active,"k-first":t.first,"k-last":t.last}),onClick:u,onDoubleClick:p},t.inEdit?h.createElement("input",{type:"text",className:"k-textbox k-spreadsheet-sheets-editor",value:t.text,onChange:b,maxLength:50,autoFocus:!0,onBlur:g,onKeyDown:f}):h.createElement(h.Fragment,null,h.createElement("span",{className:"k-link"},t.text),t.first&&t.last?null:h.createElement(a.Button,{fillMode:"flat",size:"xs",icon:"x",svgIcon:c.xIcon,className:"k-link k-spreadsheet-sheets-remove",onClick:m})))},xe=h.forwardRef((e,t)=>{const{children:n,className:a,...o}=e;return h.createElement("ul",{className:s.classNames("k-tabstrip-items k-reset",a),role:"tablist",...o,ref:t},n)});xe.displayName="TabsList";const Ie=e=>{const{sheets:t,setSheets:n,onSheetSelect:a,onSheetDelete:o,onSheetEdit:r,onSheetReorderEnd:l}=e,[s,c]=h.useState(null),i=h.useRef(!1),d=h.useRef(-1),m=h.useCallback(e=>{n(e.map((e,t,n)=>({...e,first:0===t,last:t===n.length-1})))},[]),p=h.useCallback(e=>{m(e.newState)},[m,l]),g=h.useCallback(e=>{l.call(void 0,e)},[l]),f=h.useCallback(e=>{i.current=!0,d.current=e.prevIndex},[]),b=h.useCallback(e=>{setTimeout(()=>{i.current=!1},50),l.call(void 0,{...e,prevIndex:d.current})},[]),v=h.useCallback((e,t)=>{i.current||a.call(void 0,e,t)},[a]),y=h.useCallback((e,t)=>{t.stopPropagation(),o.call(void 0,e)},[t,o]),k=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(t=>({...t,active:t.id===e.id,inEdit:t.id===e.id}));n(o),c({...e})},[t]),C=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(e=>({...e,inEdit:!1,text:e.inEdit&&s?s.text:e.text}));n(o),c(null)},[t,s]),x=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(e=>({...e,inEdit:!1})),l=t.findIndex(t=>t.id===e.id);n(o),c(null),r.call(void 0,e,l)},[t,r]),I=h.useCallback((e,a)=>{a.stopPropagation(),a.preventDefault();const o=t.map(t=>({...t,text:e.id===t.id?e.text:t.text}));n(o)},[t]);return h.createElement("div",{className:"k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom"},h.createElement("div",{className:"k-tabstrip-items-wrapper k-hstack"},h.createElement(ke.Provider,{value:{onSelect:v,onDelete:y,onEnterEdit:k,onCancelEdit:C,onExitEdit:x,onEdit:I}},h.createElement(u.Sortable,{idField:"id",data:t,itemUI:Ce,itemsWrapUI:xe,onDragOver:p,onNavigate:g,onDragStart:f,onDragEnd:b,navigatable:!0}))))},Ee=e=>{const{spreadsheetRef:t}=e,[n,o]=h.useState([]),r=h.useRef((n.find(e=>e.active)||{}).text),l=s.useId(),i=h.useCallback(()=>{t.current&&(t.current.view.sheetsbar.onSheetSelect(r.current),o(((e,t,n)=>e.map((e,a,o)=>({text:e.name(),id:n+"-sheet-"+a,first:0===a,last:a===o.length-1,active:e.name()===t})))(t.current.sheets(),r.current,l)))},[]),u=h.useCallback(()=>{if(t.current){const e=t.current.sheets();e.find(e=>e.name()===r.current)||(r.current=e[e.length-1].name()),i()}},[]);h.useEffect(()=>(t.current&&(t.current.sheets().length&&(r.current=t.current.sheets()[0].name(),i()),t.current.view.bind("update",u)),()=>{t.current&&t.current.view.unbind("update",u)}),[t.current]);const m=h.useCallback(e=>{r.current!==e.text&&(r.current=e.text,i())},[]),p=h.useCallback(()=>{if(t.current){t.current.view.sheetsbar.onAddSelect();const e=t.current.sheets();r.current=e[e.length-1].name(),i()}},[]),g=h.useCallback(e=>{if(t.current){if(r.current===e.text){const n=t.current.sheets(),a=n.findIndex(t=>t.name()===e.text),o=n[a+1]||n[a-1];r.current=o?o.name():""}t.current.view.sheetsbar.onSheetRemove(e.text),i()}},[]),f=h.useCallback((e,n)=>{if(t.current){let a=e.text;const o=t.current.sheets(),l=o[n];if(!a)return r.current=l.name(),void i();if(l&&l.name()===a)return;o.find(e=>e.name()===a)&&(a=l.name()),t.current.view.sheetsbar.onSheetRename(a,n),r.current=a,i()}},[]),b=h.useCallback(e=>{if(t.current){const{prevIndex:n,nextIndex:a}=e;r.current=t.current.sheets()[n].name(),t.current.view.sheetsbar.onSheetReorderEnd({oldIndex:n,newIndex:a}),i()}},[]);return h.createElement("div",{className:"k-spreadsheet-sheets-bar k-header"},h.createElement(a.Button,{fillMode:"flat",size:"xs",icon:"plus",className:"k-spreadsheet-sheets-bar-add",title:d.useLocalization().toLanguageString(he.addNewSheet,ve[he.addNewSheet]),svgIcon:c.plusIcon,onClick:p}),h.createElement(Ie,{sheets:n,setSheets:o,onSheetSelect:m,onSheetDelete:g,onSheetEdit:f,onSheetReorderEnd:b}))},we=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(()=>{t.current&&t.current.saveAsExcel({...t.current.options.excel,saveAs:p.saveAs,Workbook:g.Workbook})},[]);return h.createElement(a.Button,{className:"k-toolbar-button",title:"Export...",icon:"download",fillMode:"flat",svgIcon:c.downloadIcon,onClick:n})};we.displayName="ExcelExport";const Se=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(e=>{const t=e.target;if(t instanceof Element&&t.parentNode){const e=t.closest(".k-toolbar"),n=e&&e.querySelector(".k-upload input");n&&n.click()}},[]),o=h.useCallback(e=>{const n=e.newState;if(n[0]&&n[0].getRawFile){const e=n[0].getRawFile();t.current&&t.current.executeCommand({command:"OpenCommand",options:{file:e}})}},[]);return h.createElement(h.Fragment,null,h.createElement(a.Button,{className:"k-toolbar-button",title:d.useLocalization().toLanguageString(he.open,ve[he.open]),icon:"folder-open",svgIcon:c.folderOpenIcon,fillMode:"flat",onClick:n}),h.createElement("div",{style:{display:"none"}},h.createElement(f.Upload,{restrictions:{allowedExtensions:[".xlsx"]},onAdd:o,autoUpload:!1,defaultFiles:[],multiple:!1,accept:".xlsx,.XLSX",withCredentials:!1})))};Se.displayName="Open";const Ne=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],Re=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],Ae=[{text:"Automatic",value:null},{text:"Text",value:"@"},{text:"Number",value:"#,0.00"},{text:"Percent",value:"0.00%"},{text:"Financial",value:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)'},{text:"Currency",value:"$#,##0.00;[Red]$#,##0.00"},{text:"Date",value:"m/d/yyyy"},{text:"Time",value:"h:mm:ss AM/PM"},{text:"Date time",value:"m/d/yyyy h:mm"},{text:"Duration",value:"[h]:mm:ss"}],De=e=>t=>{const{property:n,icon:o,svgIcon:r,titleKey:l}=e,{spreadsheetRef:s,value:c}=t,i=h.useCallback(()=>{if(s.current){const e={command:"PropertyChangeCommand",options:{property:n,value:!c}};s.current.executeCommand(e)}},[c]);return h.createElement(a.Button,{type:"button",icon:o,svgIcon:r,fillMode:"flat",togglable:!0,onClick:i,selected:!!c,title:d.useLocalization().toLanguageString(l,ve[l])})},Le=e=>t=>{const{property:n,titleKey:a,...o}=e,{spreadsheetRef:r,value:l}=t,s=h.useCallback(e=>{if(r.current){const t={command:"PropertyChangeCommand",options:{property:n,value:e.value||null}};r.current.executeCommand(t)}},[n]);return h.createElement(b.ColorPicker,{onChange:s,onActiveColorClick:s,fillMode:"flat",...o,title:d.useLocalization().toLanguageString(a,ve[a]),value:l})},Ke=e=>t=>{const{spreadsheetRef:n}=t,o=h.useCallback(()=>{n.current&&n.current.workbook.undoRedoStack[e.action]()},[]);return h.createElement(a.Button,{type:"button",icon:e.icon,svgIcon:e.svgIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(e.titleKey,ve[e.titleKey]),onClick:o,togglable:!0})},Fe=De({property:"bold",icon:"bold",svgIcon:c.boldIcon,titleKey:he.bold});Fe.displayName="Bold";const Te=De({property:"italic",icon:"italic",svgIcon:c.italicIcon,titleKey:he.italic});Te.displayName="Italic";const ze=De({property:"underline",icon:"underline",svgIcon:c.underlineIcon,titleKey:he.underline});ze.displayName="Underline";const Pe=e=>{const{spreadsheetRef:t,value:n}=e,a=h.useCallback(e=>{if(t.current){const n={command:"PropertyChangeCommand",options:{property:"fontFamily",value:e.value||null}};t.current.executeCommand(n)}},[]);return h.createElement(i.DropDownList,{onChange:a,value:n,data:Ne,defaultValue:"Arial",fillMode:"flat",title:d.useLocalization().toLanguageString(he.fontName,ve[he.fontName]),leftRightKeysNavigation:!1})};Pe.displayName="FontFamily";const Be=e=>"string"==typeof e?parseFloat(e):e,Oe=e=>{const{spreadsheetRef:t}=e,n=Be(e.value),a=h.useCallback(e=>{var a;let o=e.value?Be(e.value):n;o=isNaN(o)?n:o,o=Math.min(409,Math.max(1,o));const r={command:"PropertyChangeCommand",options:{property:"fontSize",value:o}};"keydown"===e.nativeEvent.type||"focusout"===e.nativeEvent.type?null==(a=t.current)||a.executeCommand(r):setTimeout(()=>{var e;null==(e=t.current)||e.executeCommand(r)},0)},[n]),o=d.useLocalization().toLanguageString(he.fontSize,ve[he.fontSize]);return h.createElement(i.ComboBox,{onChange:a,value:n,data:Re,defaultValue:12,allowCustom:!0,fillMode:"flat",title:o,tabIndex:-1,clearButton:!1,ariaLabel:o})};Oe.displayName="FontSize";const Me=e=>{const t=t=>{const{property:n,icon:o,svgIcon:r,titleKey:l,step:s}=e,{spreadsheetRef:c}=t,i=Be(t.value),u=h.useCallback(()=>{var e;const t={command:"PropertyChangeCommand",options:{property:n,value:Math.min(409,Math.max(1,i+s))}};null==(e=c.current)||e.executeCommand(t)},[i]);return h.createElement(a.Button,{type:"button",icon:o,svgIcon:r,fillMode:"flat",onClick:u,disabled:i+s<1||i+s>409,title:d.useLocalization().toLanguageString(l,ve[l])})};return t.displayName=e.displayName,t},je=Me({property:"fontSize",icon:"font-grow",svgIcon:c.fontGrowIcon,titleKey:he.fontSizeIncrease,displayName:"IncreaseFontSize",step:1}),He=Me({property:"fontSize",icon:"font-shrink",svgIcon:c.fontShrinkIcon,titleKey:he.fontSizeDecrease,displayName:"DecreaseFontSize",step:-1}),We=Le({icon:"foreground-color",svgIcon:c.foregroundColorIcon,view:"palette",property:"color",titleKey:he.textColor,ariaLabel:"Text Color"});We.displayName="TextColor";const Ue=Le({icon:"droplet",svgIcon:c.dropletIcon,view:"palette",property:"background",titleKey:he.background,ariaLabel:"Background"});Ue.displayName="BackgroundColor";const qe=[{icon:"align-left",svgIcon:c.alignLeftIcon,textKey:he.alignLeft,commandName:"textAlign",value:"left",selected:!1},{icon:"align-center",svgIcon:c.alignCenterIcon,textKey:he.alignCenter,commandName:"textAlign",value:"center",selected:!1},{icon:"align-right",svgIcon:c.alignRightIcon,textKey:he.alignRight,commandName:"textAlign",value:"right",selected:!1},{icon:"align-justify",svgIcon:c.alignJustifyIcon,textKey:he.alignJustify,commandName:"textAlign",value:"justify",selected:!1},{icon:"align-top",svgIcon:c.alignTopIcon,textKey:he.alignTop,commandName:"verticalAlign",value:"top",selected:!1},{icon:"align-middle",svgIcon:c.alignMiddleIcon,textKey:he.alignMiddle,commandName:"verticalAlign",value:"center",selected:!1},{icon:"align-bottom",svgIcon:c.alignBottomIcon,textKey:he.alignBottom,commandName:"verticalAlign",value:"bottom",selected:!1}],Ve=[qe[0],{...qe[1],textKey:he.center},qe[2],{...qe[3],textKey:he.justify}],Je=qe.filter(e=>"verticalAlign"===e.commandName),_e=e=>{const{value:t,spreadsheetRef:n}=e,{textAlign:o,verticalAlign:r}=t||{},l=d.useLocalization(),i=h.useCallback(e=>{if(n.current){const t=e.item,a={command:"PropertyChangeCommand",options:{property:t.commandName,value:t.value||null}};n.current.executeCommand(a)}},[]);let u=qe.slice();return u=u.map(e=>({...e,text:l.toLanguageString(e.textKey,ve[e.textKey])})),o&&(u=u.map(e=>"textAlign"===e.commandName?{...e,selected:e.value===o}:e)),r&&(u=u.map(e=>"verticalAlign"===e.commandName?{...e,selected:e.value===r}:e)),h.createElement(a.DropDownButton,{icon:"align-left",svgIcon:c.alignLeftIcon,items:u,fillMode:"flat",onItemClick:i,title:l.toLanguageString(he.align,ve[he.align]),text:h.createElement(s.IconWrap,{name:"chevron-down",icon:c.chevronDownIcon})})};_e.displayName="Alignment";const Ge={items:Ve,icon:{icon:"align-left",svgIcon:c.alignLeftIcon},displayName:"AlignHorizontally",titleKey:he.alignHorizontally},$e={items:Je,icon:{icon:"align-bottom",svgIcon:c.alignBottomIcon},displayName:"AlignVertically",titleKey:he.alignVertically},Xe=e=>{const t=t=>{const{value:n,spreadsheetRef:o}=t,r=d.useLocalization(),l=h.useCallback(e=>{if(o.current){const t=e.item,n={command:"PropertyChangeCommand",options:{property:t.commandName,value:t.value||null}};o.current.executeCommand(n)}},[]);let i=e.items.slice();i=i.map(e=>({...e,text:r.toLanguageString(e.textKey,ve[e.textKey])})),i=i.map(e=>({...e,selected:e.value===n}));const u={...e.icon},m=i.find(e=>e.selected);return m&&(u.icon=m.icon,u.svgIcon=m.svgIcon),h.createElement(a.DropDownButton,{...u,items:i,fillMode:"flat",onItemClick:l,title:r.toLanguageString(e.titleKey,ve[e.titleKey]),text:h.createElement(s.IconWrap,{name:"chevron-down",icon:c.chevronDownIcon})})};return t.displayName=e.displayName,t},Qe=Xe(Ge),Ye=Xe($e),Ze=e=>{const{value:t,spreadsheetRef:n}=e,o=h.useCallback(()=>{if(n.current){const e=n.current.activeSheet();if(e){const t={command:"TextWrapCommand",options:{property:"wrap",value:!e.range(e.activeCell()).wrap()}};n.current.executeCommand(t)}}},[]);return h.createElement(a.Button,{type:"button",togglable:!0,icon:"text-wrap-arrow",svgIcon:c.textWrapArrowIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(he.textWrap,ve[he.textWrap]),onClick:o,selected:t})};Ze.displayName="TextWrap";const et=e=>{const{value:t,spreadsheetRef:n}=e,o=h.useCallback(()=>{if(n.current){const e=n.current.activeSheet();if(e){const t={command:"GridLinesChangeCommand",options:{property:"gridLines",value:!e.showGridLines()}};n.current.executeCommand(t)}}},[]);return h.createElement(a.Button,{type:"button",togglable:!0,icon:"borders-none",svgIcon:c.bordersNoneIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(he.gridLines,ve[he.gridLines]),onClick:o,selected:t})};et.displayName="GridLines";const tt=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(e=>{const n=e.item.value||null;setTimeout(()=>{if(t.current){const e={command:"PropertyChangeCommand",options:{property:"format",value:n}};t.current.executeCommand(e)}},0)},[]);return h.createElement(a.DropDownButton,{icon:"custom-format",svgIcon:c.customFormatIcon,fillMode:"flat",onItemClick:n,items:Ae,title:d.useLocalization().toLanguageString(he.format,ve[he.format]),text:h.createElement(s.IconWrap,{name:"chevron-down"})})};tt.displayName="Format";const nt=e=>t=>{const{spreadsheetRef:n,value:o}=t,r=h.useCallback(()=>{if(n.current){const t={command:e.command,options:{value:e.value}};n.current.executeCommand(t)}},[]);return h.createElement(a.Button,{type:"button",icon:e.icon,svgIcon:e.svgIcon,fillMode:"flat",title:d.useLocalization().toLanguageString(e.titleKey,ve[e.titleKey]),onClick:r,disabled:o&&e.disabled(o)})},at={command:"AddColumnCommand",value:"left",icon:"table-column-insert-left",svgIcon:c.tableColumnInsertLeftIcon,titleKey:he.addColumnLeft,disabled:e=>e.allCols,displayName:"AddColumnLeft"},ot={command:"AddColumnCommand",value:"right",icon:"table-column-insert-right",svgIcon:c.tableColumnInsertRightIcon,titleKey:he.addColumnRight,disabled:e=>e.allCols,displayName:"AddColumnRight"},rt={command:"AddRowCommand",value:"below",icon:"table-row-insert-below",svgIcon:c.tableRowInsertBelowIcon,titleKey:he.addRowBelow,disabled:e=>e.allRows,displayName:"AddRowBelow"},lt={command:"AddRowCommand",value:"above",icon:"table-row-insert-above",svgIcon:c.tableRowInsertAboveIcon,titleKey:he.addRowAbove,disabled:e=>e.allRows,displayName:"AddRowAbove"},st={command:"DeleteColumnCommand",icon:"table-column-delete",svgIcon:c.tableColumnDeleteIcon,titleKey:he.deleteColumn,disabled:e=>e.allCols,displayName:"DeleteColumn"},ct={command:"DeleteRowCommand",icon:"table-row-delete",svgIcon:c.tableRowDeleteIcon,titleKey:he.deleteRow,disabled:e=>e.allRows,displayName:"DeleteRow"},it=nt(at),dt=nt(ot),ut=nt(rt),mt=nt(lt),pt=nt(st),gt=nt(ct);it.displayName="AddColumnLeft",dt.displayName="AddColumnRight",ut.displayName="AddRowBelow",mt.displayName="AddRowAbove",pt.displayName="DeleteColumn",gt.displayName="DeleteRow";const ft=Ke({action:"undo",icon:"reset",svgIcon:c.arrowRotateCcwIcon,titleKey:he.undo});ft.displayName="Undo";const bt=Ke({action:"redo",icon:"reload",svgIcon:c.arrowRotateCwIcon,titleKey:he.redo});bt.displayName="Redo";const vt=e=>t=>{const{icon:n,svgIcon:o,titleKey:r,value:l}=e,{spreadsheetRef:s}=t,c=h.useCallback(()=>{if(s.current){const e={command:"AdjustDecimalsCommand",options:{value:l}};s.current.executeCommand(e)}},[]);return h.createElement(a.Button,{type:"button",icon:n,svgIcon:o,fillMode:"flat",onClick:c,title:d.useLocalization().toLanguageString(r,ve[r])})},ht=vt({icon:c.decimalIncreaseIcon.name,svgIcon:c.decimalIncreaseIcon,value:1,titleKey:he.increaseDecimal});ht.displayName="IncreaseDecimal";const yt=vt({icon:c.decimalDecreaseIcon.name,svgIcon:c.decimalDecreaseIcon,value:-1,titleKey:he.decreaseDecimal});yt.displayName="DecreaseDecimal";const kt=[{textKey:he.file,tools:[Se,we]},{textKey:he.home,selected:!0,tools:[[ft,bt],a.ToolbarSeparator,Pe,Oe,je,He,a.ToolbarSeparator,[Fe,Te,ze],We,a.ToolbarSeparator,Ue,a.ToolbarSeparator,Qe,Ye,Ze,a.ToolbarSeparator,et]},{textKey:he.insert,tools:[[it,dt,ut,mt],a.ToolbarSeparator,[pt,gt]]},{textKey:he.formatTab,tools:[tt,[yt,ht]]}],Ct=Object.freeze({name:"@progress/kendo-react-spreadsheet",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:1683639393,version:"14.5.0-develop.9",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"}),xt=["bold","italic","underline","fontFamily","fontSize","color","background","textAlign","verticalAlign","wrap","gridLines"],It={Bold:e=>e.bold,Italic:e=>e.italic,Underline:e=>e.underline,FontFamily:e=>e.fontFamily,FontSize:e=>e.fontSize,IncreaseFontSize:e=>e.fontSize,DecreaseFontSize:e=>e.fontSize,TextColor:e=>e.color,BackgroundColor:e=>e.background,Alignment:e=>({textAlign:e.textAlign,verticalAlign:e.verticalAlign}),AlignHorizontally:e=>e.textAlign,AlignVertically:e=>e.verticalAlign,TextWrap:e=>e.wrap,GridLines:e=>e.gridLines,AddColumnLeft:e=>e.selectedHeaders,AddColumnRight:e=>e.selectedHeaders,AddRowBelow:e=>e.selectedHeaders,AddRowAbove:e=>e.selectedHeaders,DeleteColumn:e=>e.selectedHeaders,DeleteRow:e=>e.selectedHeaders},Et=":not(.k-dropdownlist button):not(.k-combobox button):not(.k-upload-button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",wt=["button"+Et,".k-button-group > button"+Et,".k-dropdownlist",".k-combobox",".k-colorpicker"],St=h.forwardRef((e,t)=>{const n=!s.validatePackage(Ct,{component:"Spreadsheet"}),l=s.getLicenseMessage(Ct),{toolbar:i=kt}=e,u=[];"boolean"==typeof i?u.push(...i?kt:[]):u.push(...i);const[f,b]=h.useState(null),[v,y]=h.useState(u.findIndex(e=>e.selected)||0),[C,x]=h.useState(!1),I=h.useRef(null),E=h.useRef(null),w=h.useRef(null),S=h.useRef(null),N=h.useRef(null),[R,A]=h.useState({}),D=h.useRef({});D.current=R;const L=h.useRef({});L.current=e;const K=d.useLocalization(),F=h.useCallback(e=>{L.current.onSelect&&L.current.onSelect.call(void 0,e)},[]),T=h.useCallback(e=>{L.current.onChange&&L.current.onChange.call(void 0,e)},[]),z=h.useCallback(e=>{L.current.onChangeFormat&&L.current.onChangeFormat.call(void 0,e)},[]),P=h.useCallback(e=>{L.current.onExcelImport&&L.current.onExcelImport.call(void 0,e)},[]),B=h.useCallback(e=>{L.current.onExcelExport&&L.current.onExcelExport.call(void 0,e)},[]),O=h.useRef(null);h.useImperativeHandle(O,()=>({element:I.current,get instance(){return N.current},props:e,get view(){return N.current.view},get workbook(){return N.current.workbook},executeCommand(e){var t;null==(t=N.current)||t.executeCommand(e)},fromJSON(e){var t;return null==(t=N.current)?void 0:t.fromJSON(e)},toJSON:()=>N.current.toJSON(),saveJSON:()=>N.current.saveJSON(),fromFile:e=>N.current.fromFile(e),saveAsExcel(e){var t;null==(t=N.current)||t.saveAsExcel({...N.current.options.excel,saveAs:p.saveAs,Workbook:g.Workbook,...e})},activeSheet(e){var t;return null==(t=N.current)?void 0:t.activeSheet(e)},sheets:()=>N.current.sheets(),refresh(){var e;return null==(e=N.current)?void 0:e.refresh()}}),[e]),h.useImperativeHandle(t,()=>O.current);const M=h.useCallback(()=>N.current&&N.current.view.nameEditor,[]),j=h.useCallback(e=>{const t={};xt.forEach(n=>{"function"==typeof e.range[n]?t[n]=e.range[n]():"gridLines"===n&&(t[n]=e.range.sheet().showGridLines())}),t.selectedHeaders=e.range.sheet().selectedHeaders(),(xt.some(e=>t[e]!==D.current[e])||t.selectedHeaders.allCols!==D.current.selectedHeaders.allCols||t.selectedHeaders.allRows!==D.current.selectedHeaders.allRows)&&A(t)},[]),H=h.useCallback(e=>{const t=e.name,n=he[t];b({title:"Error"===e.title?K.toLanguageString(he.error,ve[he.error]):e.title,message:n?K.toLanguageString(n,ve[n]||e.text):e.text,close:e.close})},[]),W=h.useCallback(()=>{b(null),null==f||f.close()},[f]),U=d.useInternationalization(),q=d.useLocalization();h.useEffect(()=>{var t;const n={...e.defaultProps,sheets:null==window?void 0:window.structuredClone(null==(t=e.defaultProps)?void 0:t.sheets),messages:{workbook:{defaultSheetName:q.toLanguageString(he.defaultSheetName,ve[he.defaultSheetName])}},intl:{localeInfo:()=>U.localeInfo(),localeCurrency:()=>U.localeCurrency(),parseDate:(e,t)=>U.parseDate(e,t),toString:(e,t)=>U.toString(e,t),format:(e,...t)=>U.format(e,...t)},formulaBarInputRef:E,formulaCellInputRef:w,nameBoxRef:S},a=new m.SpreadsheetWidget(I.current,n);N.current=a,a.bind("select",F),a.bind("change",T),a.bind("changeFormat",z),a.bind("excelImport",P),a.bind("excelExport",B),a.view.bind("update",j),a.view.bind("message",H);const o=a.activeSheet();return o&&j({range:o.range(o.activeCell())}),x(!0),()=>{a.destroy()}},[]);const V=h.useCallback((e,t)=>{const n=h.createElement(e,{spreadsheetRef:N,value:It[e.displayName]?It[e.displayName](R):void 0,key:t});return n.type===a.ToolbarSeparator?h.createElement(e,{key:t}):n},[R]);let J=null;return u.length&&(J=h.createElement(o.TabStrip,{selected:v,animation:!1,className:"k-floatwrap k-spreadsheet-tabstrip",style:{minHeight:"auto"},onSelect:e=>y(e.selected)},u.map(e=>{const t=e.textKey?q.toLanguageString(e.textKey,ve[e.textKey]):e.text;return h.createElement(o.TabStripTab,{key:e.textKey||e.text,title:t},h.createElement(a.Toolbar,{buttons:wt,className:"k-spreadsheet-toolbar"},e.tools.map((e,t)=>Array.isArray(e)?h.createElement(a.ButtonGroup,{key:t},e.map((e,t)=>V(e,t))):V(e,t))))}))),h.createElement("div",{ref:I,style:e.style,className:s.classNames("k-widget k-spreadsheet",e.className),role:"application"},J,h.createElement("div",{className:"k-spreadsheet-action-bar"},h.createElement(ye,{ref:S,nameEditor:M}),h.createElement("div",{className:"k-spreadsheet-formula-bar"},h.createElement(s.IconWrap,{name:"formula-fx",icon:c.formulaFxIcon}),h.createElement(k,{ref:E}))),h.createElement("div",{className:"k-spreadsheet-view"},h.createElement("div",{className:"k-spreadsheet-fixed-container"}),h.createElement("div",{className:"k-spreadsheet-scroller"},h.createElement("div",{className:"k-spreadsheet-view-size"})),h.createElement("div",{tabIndex:0,className:"k-spreadsheet-clipboard",contentEditable:"true"}),h.createElement(k,{ref:w,className:"k-spreadsheet-cell-editor"})),h.createElement(Ee,{spreadsheetRef:N}),f&&h.createElement(r.Dialog,{title:f.title,onClose:W},h.createElement("div",null,f.message),h.createElement(r.DialogActionsBar,{layout:"start"},h.createElement(a.Button,{themeColor:"primary",onClick:W,autoFocus:!0},K.toLanguageString(he.ok,ve[he.ok])))),n&&h.createElement(s.WatermarkOverlay,{message:l}))});St.displayName="KendoReactSpreadsheet",St.propTypes={className:n.string,defaultProps:n.any,toolbar:n.oneOfType([n.bool,n.arrayOf(n.any)]),style:n.object,onSelect:n.func,onChange:n.func,onChangeFormat:n.func,onExcelImport:n.func,onExcelExport:n.func};Object.defineProperty(e,"CalcError",{enumerable:!0,get:function(){return m.CalcError}}),Object.defineProperty(e,"CellRef",{enumerable:!0,get:function(){return m.CellRef}}),Object.defineProperty(e,"Context",{enumerable:!0,get:function(){return m.Context}}),Object.defineProperty(e,"Matrix",{enumerable:!0,get:function(){return m.Matrix}}),Object.defineProperty(e,"NULLREF",{enumerable:!0,get:function(){return m.NULLREF}}),Object.defineProperty(e,"NameRef",{enumerable:!0,get:function(){return m.NameRef}}),Object.defineProperty(e,"Range",{enumerable:!0,get:function(){return m.Range}}),Object.defineProperty(e,"RangeRef",{enumerable:!0,get:function(){return m.RangeRef}}),Object.defineProperty(e,"Ref",{enumerable:!0,get:function(){return m.Ref}}),Object.defineProperty(e,"Sheet",{enumerable:!0,get:function(){return m.Sheet}}),Object.defineProperty(e,"SpreadsheetWidget",{enumerable:!0,get:function(){return m.SpreadsheetWidget}}),Object.defineProperty(e,"UnionRef",{enumerable:!0,get:function(){return m.UnionRef}}),Object.defineProperty(e,"View",{enumerable:!0,get:function(){return m.View}}),Object.defineProperty(e,"Workbook",{enumerable:!0,get:function(){return m.Workbook}}),Object.defineProperty(e,"dateToSerial",{enumerable:!0,get:function(){return m.dateToSerial}}),Object.defineProperty(e,"defineAlias",{enumerable:!0,get:function(){return m.defineAlias}}),Object.defineProperty(e,"defineFunction",{enumerable:!0,get:function(){return m.defineFunction}}),Object.defineProperty(e,"packDate",{enumerable:!0,get:function(){return m.packDate}}),Object.defineProperty(e,"packTime",{enumerable:!0,get:function(){return m.packTime}}),Object.defineProperty(e,"serialToDate",{enumerable:!0,get:function(){return m.serialToDate}}),Object.defineProperty(e,"unpackDate",{enumerable:!0,get:function(){return m.unpackDate}}),Object.defineProperty(e,"unpackTime",{enumerable:!0,get:function(){return m.unpackTime}}),e.AddColumnLeft=it,e.AddColumnRight=dt,e.AddRowAbove=mt,e.AddRowBelow=ut,e.AlignHorizontally=Qe,e.AlignVertically=Ye,e.Alignment=_e,e.BackgroundColor=Ue,e.Bold=Fe,e.CleanFormatting=e=>{const{spreadsheetRef:t}=e,n=h.useCallback(()=>{t.current&&t.current.executeCommand({command:"PropertyCleanCommand"})},[]);return h.createElement(a.Button,{type:"button",icon:"clean-css",svgIcon:c.clearCssIcon,fillMode:"flat",onClick:n,title:d.useLocalization().toLanguageString(he.cleanFormatting,ve[he.cleanFormatting])})},e.DecreaseDecimal=yt,e.DecreaseFontSize=He,e.DeleteColumn=pt,e.DeleteRow=gt,e.ExcelExport=we,e.FontFamily=Pe,e.FontSize=Oe,e.Format=tt,e.GridLines=et,e.IncreaseDecimal=ht,e.IncreaseFontSize=je,e.Italic=Te,e.Open=Se,e.Redo=bt,e.Spreadsheet=St,e.TextColor=We,e.TextWrap=Ze,e.Underline=ze,e.Undo=ft,e.defaultTabs=kt,e.toolsValueMap=It});
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-spreadsheet",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1778597149,version:"14.5.0-develop.8",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"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-spreadsheet",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1778599708,version:"14.5.0-develop.9",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"});exports.packageMetadata=e;
@@ -6,8 +6,8 @@ export const packageMetadata = Object.freeze({
6
6
  productName: 'KendoReact',
7
7
  productCode: 'KENDOUIREACT',
8
8
  productCodes: ['KENDOUIREACT'],
9
- publishDate: 1778597149,
10
- version: '14.5.0-develop.8',
9
+ publishDate: 1778599708,
10
+ version: '14.5.0-develop.9',
11
11
  licensingDocsUrl:
12
12
  'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-spreadsheet",
3
- "version": "14.5.0-develop.8",
3
+ "version": "14.5.0-develop.9",
4
4
  "description": "KendoReact Spreadsheet package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -32,18 +32,18 @@
32
32
  "@progress/kendo-file-saver": "^1.1.1",
33
33
  "@progress/kendo-licensing": "^1.7.2",
34
34
  "@progress/kendo-ooxml": "^1.7.0",
35
- "@progress/kendo-react-buttons": "14.5.0-develop.8",
36
- "@progress/kendo-react-common": "14.5.0-develop.8",
37
- "@progress/kendo-react-dialogs": "14.5.0-develop.8",
38
- "@progress/kendo-react-dropdowns": "14.5.0-develop.8",
39
- "@progress/kendo-react-inputs": "14.5.0-develop.8",
40
- "@progress/kendo-react-intl": "14.5.0-develop.8",
41
- "@progress/kendo-react-layout": "14.5.0-develop.8",
42
- "@progress/kendo-react-popup": "14.5.0-develop.8",
43
- "@progress/kendo-react-sortable": "14.5.0-develop.8",
44
- "@progress/kendo-react-upload": "14.5.0-develop.8",
35
+ "@progress/kendo-react-buttons": "14.5.0-develop.9",
36
+ "@progress/kendo-react-common": "14.5.0-develop.9",
37
+ "@progress/kendo-react-dialogs": "14.5.0-develop.9",
38
+ "@progress/kendo-react-dropdowns": "14.5.0-develop.9",
39
+ "@progress/kendo-react-inputs": "14.5.0-develop.9",
40
+ "@progress/kendo-react-intl": "14.5.0-develop.9",
41
+ "@progress/kendo-react-layout": "14.5.0-develop.9",
42
+ "@progress/kendo-react-popup": "14.5.0-develop.9",
43
+ "@progress/kendo-react-sortable": "14.5.0-develop.9",
44
+ "@progress/kendo-react-upload": "14.5.0-develop.9",
45
45
  "@progress/kendo-spreadsheet-common": "^1.2.7",
46
- "@progress/kendo-svg-icons": "^4.0.0",
46
+ "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
47
47
  "react": "^18.0.0 || ^19.0.0",
48
48
  "react-dom": "^18.0.0 || ^19.0.0"
49
49
  },
@@ -68,7 +68,7 @@
68
68
  "package": {
69
69
  "productName": "KendoReact",
70
70
  "productCode": "KENDOUIREACT",
71
- "publishDate": 1778597149,
71
+ "publishDate": 1778599708,
72
72
  "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"
73
73
  }
74
74
  },
@@ -78,5 +78,10 @@
78
78
  },
79
79
  "publishConfig": {
80
80
  "access": "public"
81
+ },
82
+ "peerDependenciesMeta": {
83
+ "@progress/kendo-svg-icons": {
84
+ "optional": true
85
+ }
81
86
  }
82
87
  }
package/tools/align.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),p=require("@progress/kendo-react-buttons"),v=require("@progress/kendo-react-common"),a=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-intl"),t=require("../messages.js");function K(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const s=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(i,c,s.get?s:{enumerable:!0,get:()=>n[c]})}}return i.default=n,Object.freeze(i)}const g=K(N),r=[{icon:"align-left",svgIcon:a.alignLeftIcon,textKey:t.keys.alignLeft,commandName:"textAlign",value:"left",selected:!1},{icon:"align-center",svgIcon:a.alignCenterIcon,textKey:t.keys.alignCenter,commandName:"textAlign",value:"center",selected:!1},{icon:"align-right",svgIcon:a.alignRightIcon,textKey:t.keys.alignRight,commandName:"textAlign",value:"right",selected:!1},{icon:"align-justify",svgIcon:a.alignJustifyIcon,textKey:t.keys.alignJustify,commandName:"textAlign",value:"justify",selected:!1},{icon:"align-top",svgIcon:a.alignTopIcon,textKey:t.keys.alignTop,commandName:"verticalAlign",value:"top",selected:!1},{icon:"align-middle",svgIcon:a.alignMiddleIcon,textKey:t.keys.alignMiddle,commandName:"verticalAlign",value:"center",selected:!1},{icon:"align-bottom",svgIcon:a.alignBottomIcon,textKey:t.keys.alignBottom,commandName:"verticalAlign",value:"bottom",selected:!1}],b=[r[0],{...r[1],textKey:t.keys.center},r[2],{...r[3],textKey:t.keys.justify}],C=r.filter(n=>n.commandName==="verticalAlign"),x=n=>{const{value:i,spreadsheetRef:c}=n,{textAlign:s,verticalAlign:u}=i||{},d=I.useLocalization(),y=g.useCallback(e=>{if(c.current){const m=e.item,o={command:"PropertyChangeCommand",options:{property:m.commandName,value:m.value||null}};c.current.executeCommand(o)}},[]);let l=r.slice();return l=l.map(e=>({...e,text:d.toLanguageString(e.textKey,t.messages[e.textKey])})),s&&(l=l.map(e=>e.commandName==="textAlign"?{...e,selected:e.value===s}:e)),u&&(l=l.map(e=>e.commandName==="verticalAlign"?{...e,selected:e.value===u}:e)),g.createElement(p.DropDownButton,{icon:"align-left",svgIcon:a.alignLeftIcon,items:l,fillMode:"flat",onItemClick:y,title:d.toLanguageString(t.keys.align,t.messages[t.keys.align]),text:g.createElement(v.IconWrap,{name:"caret-alt-down",icon:a.caretAltDownIcon})})};x.displayName="Alignment";const L={items:b,icon:{icon:"align-left",svgIcon:a.alignLeftIcon},displayName:"AlignHorizontally",titleKey:t.keys.alignHorizontally},z={items:C,icon:{icon:"align-bottom",svgIcon:a.alignBottomIcon},displayName:"AlignVertically",titleKey:t.keys.alignVertically},A=n=>{const i=c=>{const{value:s,spreadsheetRef:u}=c,d=I.useLocalization(),y=g.useCallback(o=>{if(u.current){const f=o.item,k={command:"PropertyChangeCommand",options:{property:f.commandName,value:f.value||null}};u.current.executeCommand(k)}},[]);let l=n.items.slice();l=l.map(o=>({...o,text:d.toLanguageString(o.textKey,t.messages[o.textKey])})),l=l.map(o=>({...o,selected:o.value===s}));const e={...n.icon},m=l.find(o=>o.selected);return m&&(e.icon=m.icon,e.svgIcon=m.svgIcon),g.createElement(p.DropDownButton,{...e,items:l,fillMode:"flat",onItemClick:y,title:d.toLanguageString(n.titleKey,t.messages[n.titleKey]),text:g.createElement(v.IconWrap,{name:"caret-alt-down",icon:a.caretAltDownIcon})})};return i.displayName=n.displayName,i},R=A(L),S=A(z);exports.AlignHorizontally=R;exports.AlignVertically=S;exports.Alignment=x;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),v=require("@progress/kendo-react-buttons"),p=require("@progress/kendo-react-common"),a=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-intl"),t=require("../messages.js");function K(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const s=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(i,c,s.get?s:{enumerable:!0,get:()=>n[c]})}}return i.default=n,Object.freeze(i)}const g=K(N),r=[{icon:"align-left",svgIcon:a.alignLeftIcon,textKey:t.keys.alignLeft,commandName:"textAlign",value:"left",selected:!1},{icon:"align-center",svgIcon:a.alignCenterIcon,textKey:t.keys.alignCenter,commandName:"textAlign",value:"center",selected:!1},{icon:"align-right",svgIcon:a.alignRightIcon,textKey:t.keys.alignRight,commandName:"textAlign",value:"right",selected:!1},{icon:"align-justify",svgIcon:a.alignJustifyIcon,textKey:t.keys.alignJustify,commandName:"textAlign",value:"justify",selected:!1},{icon:"align-top",svgIcon:a.alignTopIcon,textKey:t.keys.alignTop,commandName:"verticalAlign",value:"top",selected:!1},{icon:"align-middle",svgIcon:a.alignMiddleIcon,textKey:t.keys.alignMiddle,commandName:"verticalAlign",value:"center",selected:!1},{icon:"align-bottom",svgIcon:a.alignBottomIcon,textKey:t.keys.alignBottom,commandName:"verticalAlign",value:"bottom",selected:!1}],b=[r[0],{...r[1],textKey:t.keys.center},r[2],{...r[3],textKey:t.keys.justify}],C=r.filter(n=>n.commandName==="verticalAlign"),x=n=>{const{value:i,spreadsheetRef:c}=n,{textAlign:s,verticalAlign:u}=i||{},d=I.useLocalization(),y=g.useCallback(e=>{if(c.current){const m=e.item,l={command:"PropertyChangeCommand",options:{property:m.commandName,value:m.value||null}};c.current.executeCommand(l)}},[]);let o=r.slice();return o=o.map(e=>({...e,text:d.toLanguageString(e.textKey,t.messages[e.textKey])})),s&&(o=o.map(e=>e.commandName==="textAlign"?{...e,selected:e.value===s}:e)),u&&(o=o.map(e=>e.commandName==="verticalAlign"?{...e,selected:e.value===u}:e)),g.createElement(v.DropDownButton,{icon:"align-left",svgIcon:a.alignLeftIcon,items:o,fillMode:"flat",onItemClick:y,title:d.toLanguageString(t.keys.align,t.messages[t.keys.align]),text:g.createElement(p.IconWrap,{name:"chevron-down",icon:a.chevronDownIcon})})};x.displayName="Alignment";const h={items:b,icon:{icon:"align-left",svgIcon:a.alignLeftIcon},displayName:"AlignHorizontally",titleKey:t.keys.alignHorizontally},L={items:C,icon:{icon:"align-bottom",svgIcon:a.alignBottomIcon},displayName:"AlignVertically",titleKey:t.keys.alignVertically},k=n=>{const i=c=>{const{value:s,spreadsheetRef:u}=c,d=I.useLocalization(),y=g.useCallback(l=>{if(u.current){const f=l.item,A={command:"PropertyChangeCommand",options:{property:f.commandName,value:f.value||null}};u.current.executeCommand(A)}},[]);let o=n.items.slice();o=o.map(l=>({...l,text:d.toLanguageString(l.textKey,t.messages[l.textKey])})),o=o.map(l=>({...l,selected:l.value===s}));const e={...n.icon},m=o.find(l=>l.selected);return m&&(e.icon=m.icon,e.svgIcon=m.svgIcon),g.createElement(v.DropDownButton,{...e,items:o,fillMode:"flat",onItemClick:y,title:d.toLanguageString(n.titleKey,t.messages[n.titleKey]),text:g.createElement(p.IconWrap,{name:"chevron-down",icon:a.chevronDownIcon})})};return i.displayName=n.displayName,i},z=k(h),R=k(L);exports.AlignHorizontally=z;exports.AlignVertically=R;exports.Alignment=x;
package/tools/align.mjs CHANGED
@@ -6,9 +6,9 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as c from "react";
9
- import { DropDownButton as v } from "@progress/kendo-react-buttons";
9
+ import { DropDownButton as p } from "@progress/kendo-react-buttons";
10
10
  import { IconWrap as x } from "@progress/kendo-react-common";
11
- import { alignLeftIcon as f, caretAltDownIcon as I, alignCenterIcon as h, alignRightIcon as L, alignJustifyIcon as z, alignTopIcon as b, alignMiddleIcon as k, alignBottomIcon as A } from "@progress/kendo-svg-icons";
11
+ import { alignLeftIcon as f, chevronDownIcon as I, alignCenterIcon as h, alignRightIcon as L, alignJustifyIcon as z, alignTopIcon as b, alignMiddleIcon as k, alignBottomIcon as A } from "@progress/kendo-svg-icons";
12
12
  import { useLocalization as K } from "@progress/kendo-react-intl";
13
13
  import { messages as u, keys as n } from "../messages.mjs";
14
14
  const i = [
@@ -73,12 +73,12 @@ const i = [
73
73
  { ...i[1], textKey: n.center },
74
74
  i[2],
75
75
  { ...i[3], textKey: n.justify }
76
- ], R = i.filter((a) => a.commandName === "verticalAlign"), V = (a) => {
77
- const { value: g, spreadsheetRef: r } = a, { textAlign: d, verticalAlign: m } = g || {}, s = K(), y = c.useCallback((e) => {
76
+ ], R = i.filter((o) => o.commandName === "verticalAlign"), V = (o) => {
77
+ const { value: g, spreadsheetRef: r } = o, { textAlign: d, verticalAlign: m } = g || {}, s = K(), y = c.useCallback((e) => {
78
78
  if (r.current) {
79
- const o = e.item, l = {
79
+ const a = e.item, l = {
80
80
  command: "PropertyChangeCommand",
81
- options: { property: o.commandName, value: o.value || null }
81
+ options: { property: a.commandName, value: a.value || null }
82
82
  };
83
83
  r.current.executeCommand(l);
84
84
  }
@@ -87,7 +87,7 @@ const i = [
87
87
  return t = t.map((e) => ({ ...e, text: s.toLanguageString(e.textKey, u[e.textKey]) })), d && (t = t.map((e) => e.commandName === "textAlign" ? { ...e, selected: e.value === d } : e)), m && (t = t.map(
88
88
  (e) => e.commandName === "verticalAlign" ? { ...e, selected: e.value === m } : e
89
89
  )), /* @__PURE__ */ c.createElement(
90
- v,
90
+ p,
91
91
  {
92
92
  icon: "align-left",
93
93
  svgIcon: f,
@@ -95,7 +95,7 @@ const i = [
95
95
  fillMode: "flat",
96
96
  onItemClick: y,
97
97
  title: s.toLanguageString(n.align, u[n.align]),
98
- text: /* @__PURE__ */ c.createElement(x, { name: "caret-alt-down", icon: I })
98
+ text: /* @__PURE__ */ c.createElement(x, { name: "chevron-down", icon: I })
99
99
  }
100
100
  );
101
101
  };
@@ -110,33 +110,33 @@ const w = {
110
110
  icon: { icon: "align-bottom", svgIcon: A },
111
111
  displayName: "AlignVertically",
112
112
  titleKey: n.alignVertically
113
- }, N = (a) => {
113
+ }, N = (o) => {
114
114
  const g = (r) => {
115
115
  const { value: d, spreadsheetRef: m } = r, s = K(), y = c.useCallback((l) => {
116
116
  if (m.current) {
117
- const p = l.item, C = {
117
+ const v = l.item, C = {
118
118
  command: "PropertyChangeCommand",
119
- options: { property: p.commandName, value: p.value || null }
119
+ options: { property: v.commandName, value: v.value || null }
120
120
  };
121
121
  m.current.executeCommand(C);
122
122
  }
123
123
  }, []);
124
- let t = a.items.slice();
124
+ let t = o.items.slice();
125
125
  t = t.map((l) => ({ ...l, text: s.toLanguageString(l.textKey, u[l.textKey]) })), t = t.map((l) => ({ ...l, selected: l.value === d }));
126
- const e = { ...a.icon }, o = t.find((l) => l.selected);
127
- return o && (e.icon = o.icon, e.svgIcon = o.svgIcon), /* @__PURE__ */ c.createElement(
128
- v,
126
+ const e = { ...o.icon }, a = t.find((l) => l.selected);
127
+ return a && (e.icon = a.icon, e.svgIcon = a.svgIcon), /* @__PURE__ */ c.createElement(
128
+ p,
129
129
  {
130
130
  ...e,
131
131
  items: t,
132
132
  fillMode: "flat",
133
133
  onItemClick: y,
134
- title: s.toLanguageString(a.titleKey, u[a.titleKey]),
135
- text: /* @__PURE__ */ c.createElement(x, { name: "caret-alt-down", icon: I })
134
+ title: s.toLanguageString(o.titleKey, u[o.titleKey]),
135
+ text: /* @__PURE__ */ c.createElement(x, { name: "chevron-down", icon: I })
136
136
  }
137
137
  );
138
138
  };
139
- return g.displayName = a.displayName, g;
139
+ return g.displayName = o.displayName, g;
140
140
  }, D = N(w), J = N(E);
141
141
  export {
142
142
  D as AlignHorizontally,
package/tools/format.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),m=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-svg-icons"),d=require("./utils.js"),f=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-intl"),r=require("../messages.js");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const a=p(i),c=e=>{const{spreadsheetRef:t}=e,o=a.useCallback(n=>{const s=n.item.value||null;setTimeout(()=>{if(t.current){const u={command:"PropertyChangeCommand",options:{property:"format",value:s}};t.current.executeCommand(u)}},0)},[]);return a.createElement(m.DropDownButton,{icon:"custom-format",svgIcon:l.customFormatIcon,fillMode:"flat",onItemClick:o,items:d.FORMATS,title:g.useLocalization().toLanguageString(r.keys.format,r.messages[r.keys.format]),text:a.createElement(f.IconWrap,{name:"caret-alt-down"})})};c.displayName="Format";exports.Format=c;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),m=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-svg-icons"),d=require("./utils.js"),f=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-intl"),r=require("../messages.js");function p(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const a=p(i),c=e=>{const{spreadsheetRef:t}=e,o=a.useCallback(n=>{const s=n.item.value||null;setTimeout(()=>{if(t.current){const u={command:"PropertyChangeCommand",options:{property:"format",value:s}};t.current.executeCommand(u)}},0)},[]);return a.createElement(m.DropDownButton,{icon:"custom-format",svgIcon:l.customFormatIcon,fillMode:"flat",onItemClick:o,items:d.FORMATS,title:g.useLocalization().toLanguageString(r.keys.format,r.messages[r.keys.format]),text:a.createElement(f.IconWrap,{name:"chevron-down"})})};c.displayName="Format";exports.Format=c;
package/tools/format.mjs CHANGED
@@ -9,17 +9,17 @@ import * as o from "react";
9
9
  import { DropDownButton as s } from "@progress/kendo-react-buttons";
10
10
  import { customFormatIcon as i } from "@progress/kendo-svg-icons";
11
11
  import { FORMATS as p } from "./utils.mjs";
12
- import { IconWrap as l } from "@progress/kendo-react-common";
13
- import { useLocalization as f } from "@progress/kendo-react-intl";
12
+ import { IconWrap as f } from "@progress/kendo-react-common";
13
+ import { useLocalization as l } from "@progress/kendo-react-intl";
14
14
  import { keys as e, messages as u } from "../messages.mjs";
15
15
  const d = (r) => {
16
- const { spreadsheetRef: t } = r, m = o.useCallback((a) => {
17
- const n = a.item.value || null;
16
+ const { spreadsheetRef: t } = r, m = o.useCallback((n) => {
17
+ const a = n.item.value || null;
18
18
  setTimeout(() => {
19
19
  if (t.current) {
20
20
  const c = {
21
21
  command: "PropertyChangeCommand",
22
- options: { property: "format", value: n }
22
+ options: { property: "format", value: a }
23
23
  };
24
24
  t.current.executeCommand(c);
25
25
  }
@@ -33,8 +33,8 @@ const d = (r) => {
33
33
  fillMode: "flat",
34
34
  onItemClick: m,
35
35
  items: p,
36
- title: f().toLanguageString(e.format, u[e.format]),
37
- text: /* @__PURE__ */ o.createElement(l, { name: "caret-alt-down" })
36
+ title: l().toLanguageString(e.format, u[e.format]),
37
+ text: /* @__PURE__ */ o.createElement(f, { name: "chevron-down" })
38
38
  }
39
39
  );
40
40
  };
package/tools/textWrap.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),i=require("@progress/kendo-react-buttons"),p=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-intl"),a=require("../messages.js");function d(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const c=d(l),s=t=>{const{value:n,spreadsheetRef:e}=t,r=c.useCallback(()=>{if(e.current){const o=e.current.activeSheet();if(o){const u={command:"TextWrapCommand",options:{property:"wrap",value:!o.range(o.activeCell()).wrap()}};e.current.executeCommand(u)}}},[]);return c.createElement(i.Button,{type:"button",togglable:!0,icon:"text-wrap",svgIcon:p.textWrapIcon,fillMode:"flat",title:g.useLocalization().toLanguageString(a.keys.textWrap,a.messages[a.keys.textWrap]),onClick:r,selected:n})};s.displayName="TextWrap";exports.TextWrap=s;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),i=require("@progress/kendo-react-buttons"),p=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-intl"),a=require("../messages.js");function d(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const c=d(l),s=t=>{const{value:r,spreadsheetRef:e}=t,n=c.useCallback(()=>{if(e.current){const o=e.current.activeSheet();if(o){const u={command:"TextWrapCommand",options:{property:"wrap",value:!o.range(o.activeCell()).wrap()}};e.current.executeCommand(u)}}},[]);return c.createElement(i.Button,{type:"button",togglable:!0,icon:"text-wrap-arrow",svgIcon:p.textWrapArrowIcon,fillMode:"flat",title:g.useLocalization().toLanguageString(a.keys.textWrap,a.messages[a.keys.textWrap]),onClick:n,selected:r})};s.displayName="TextWrap";exports.TextWrap=s;
@@ -5,13 +5,13 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as o from "react";
8
+ import * as r from "react";
9
9
  import { Button as s } from "@progress/kendo-react-buttons";
10
- import { textWrapIcon as i } from "@progress/kendo-svg-icons";
10
+ import { textWrapArrowIcon as i } from "@progress/kendo-svg-icons";
11
11
  import { useLocalization as m } from "@progress/kendo-react-intl";
12
- import { keys as r, messages as l } from "../messages.mjs";
12
+ import { keys as o, messages as l } from "../messages.mjs";
13
13
  const u = (a) => {
14
- const { value: n, spreadsheetRef: t } = a, c = o.useCallback(() => {
14
+ const { value: n, spreadsheetRef: t } = a, c = r.useCallback(() => {
15
15
  if (t.current) {
16
16
  const e = t.current.activeSheet();
17
17
  if (e) {
@@ -23,15 +23,15 @@ const u = (a) => {
23
23
  }
24
24
  }
25
25
  }, []);
26
- return /* @__PURE__ */ o.createElement(
26
+ return /* @__PURE__ */ r.createElement(
27
27
  s,
28
28
  {
29
29
  type: "button",
30
30
  togglable: !0,
31
- icon: "text-wrap",
31
+ icon: "text-wrap-arrow",
32
32
  svgIcon: i,
33
33
  fillMode: "flat",
34
- title: m().toLanguageString(r.textWrap, l[r.textWrap]),
34
+ title: m().toLanguageString(o.textWrap, l[o.textWrap]),
35
35
  onClick: c,
36
36
  selected: n
37
37
  }