@progress/kendo-react-spreadsheet 7.0.3-develop.9 → 7.1.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-spreadsheet.js +1 -1
- package/index.mjs +1 -1
- package/package.json +11 -11
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
(function(l,V){typeof exports=="object"&&typeof module<"u"?V(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")):typeof define=="function"&&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"],V):(l=typeof globalThis<"u"?globalThis:l||self,V(l.KendoReactSpreadsheet={},l.React,l.PropTypes,l.KendoReactButtons,l.KendoReactLayout,l.KendoReactDialogs,l.KendoReactPopup,l.KendoReactCommon,l.KendoSvgIcons,l.KendoReactDropdowns,l.KendoReactIntl,l.KendoReactSortable,l.KendoSpreadsheetCommon,l.KendoFileSaver,l.KendoOoxml,l.KendoReactUpload,l.KendoReactInputs))})(this,function(l,V,O,N,we,ke,Vt,K,f,$,L,_t,S,Ne,Ie,qt,Jt){"use strict";"use client";function $t(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const e=$t(V),G=e.forwardRef((t,n)=>{const o=e.useRef(null),r=e.useRef(null);return e.useImperativeHandle(o,()=>({element:r.current,props:t})),e.useImperativeHandle(n,()=>o.current),e.createElement("div",{className:"k-list k-list-md"},e.createElement("div",{className:"k-list-content"},e.createElement("ul",{ref:r,className:"k-spreadsheet-formula-list k-list-ul",onMouseDown:a=>a.preventDefault(),style:{maxHeight:280}},t.data.map(a=>e.createElement("li",{key:a.text,className:"k-list-item",onClick:()=>t.onItemClick(a.value)},e.createElement(K.IconWrap,{name:"formula-fx",icon:f.formulaFxIcon}),e.createElement("span",{className:"k-list-item-text"},a.text))))))});G.displayName="List",G.propTypes={};const J=e.forwardRef((t,n)=>{const[o,r]=e.useState(!1),[a,s]=e.useState(0),[d,m]=e.useState([]),i=e.useMemo(()=>({}),[]);i.showPopup=o,i.popupContentKey=a,i.data=d;const v=e.useRef(null),E=e.useRef(null),C=e.useRef(null),R=e.useCallback(()=>{if(C.current&&C.current.element)return C.current.element.querySelector(".k-focus")},[]),x=e.useCallback(()=>{const b=R();b&&b.classList.remove("k-focus")},[]),g=e.useCallback(b=>{const D=Array.from(C.current&&C.current.element.children||[]),z=R();let p;if(z){const k=D.indexOf(z);z.classList.remove("k-focus"),p=D[k+b]?D[k+b]:b===1?D[0]:D[D.length-1]}else p=b===1?D[0]:D[D.length-1];p&&p.classList.add("k-focus")},[]);e.useImperativeHandle(v,()=>({element:E.current,props:t,popup:{open:()=>{r(!0)},close:()=>{r(!1)},position:()=>{s(i.popupContentKey+1)},visible:()=>i.showPopup},list:{get element(){return C.current&&C.current.element},data:b=>{if(b)m(b);else return i.data},value:()=>({}),focus:()=>Array.from(C.current&&C.current.element&&C.current.element.children||[]).indexOf(R()),focusNext:()=>{g(1)},focusPrev:()=>{g(-1)},focusFirst:()=>{const b=C.current&&C.current.element;b&&b.children.item(0)&&(x(),b.children.item(0).classList.add("k-focus"))},focusLast:()=>{const b=C.current&&C.current.element;b&&b.children.length&&(x(),b.children.item(b.children.length-1).classList.add("k-focus"))},itemClick:b=>{i.itemClick=b}}}),[]),e.useImperativeHandle(n,()=>v.current,[]);const y=e.useCallback(b=>{i.itemClick&&i.itemClick(b)},[]);return e.createElement(e.Fragment,null,e.createElement("div",{className:K.classNames("k-spreadsheet-formula-input",t.className),contentEditable:"true",spellCheck:"false",style:{whiteSpace:"pre"},ref:E}),e.createElement(Vt.Popup,{show:o,anchor:E.current,animate:{openDuration:100,closeDuration:100},contentKey:a,popupClass:"k-list-container"},e.createElement(G,{data:d,ref:C,onItemClick:y})))});J.displayName="FormulaInput",J.propTypes={};const Se="spreadsheet.bold",Ae="spreadsheet.italic",De="spreadsheet.underline",Le="spreadsheet.openFile",Re="spreadsheet.textColor",Te="spreadsheet.background",Fe="spreadsheet.addRowAbove",Ke="spreadsheet.addRowBelow",ze="spreadsheet.addColumnLeft",Oe="spreadsheet.addColumnRight",Pe="spreadsheet.deleteRow",Me="spreadsheet.deleteColumn",Be="spreadsheet.undo",je="spreadsheet.redo",He="spreadsheet.fontSize",Ue="spreadsheet.fontSizeIncrease",We="spreadsheet.fontSizeDecrease",Ve="spreadsheet.fontName",_e="spreadsheet.cleanFormatting",qe="spreadsheet.format",Je="spreadsheet.alignHorizontally",$e="spreadsheet.alignVertically",Ge="spreadsheet.align",Xe="spreadsheet.alignLeft",Ze="spreadsheet.alignRight",Ye="spreadsheet.alignCenter",Qe="spreadsheet.center",et="spreadsheet.alignJustify",tt="spreadsheet.justify",nt="spreadsheet.alignTop",at="spreadsheet.alignMiddle",ot="spreadsheet.alignBottom",lt="spreadsheet.increaseDecimal",rt="spreadsheet.decreaseDecimal",st="spreadsheet.textWrap",ct="spreadsheet.gridLines",it="spreadsheet.exportToExcel",ut="spreadsheet.nameBox",dt="spreadsheet.defaultSheetName",mt="spreadsheet.home",pt="spreadsheet.file",ft="spreadsheet.insert",gt="spreadsheet.formatTab",bt="spreadsheet.addNewSheet",ht="spreadsheet.error",yt="spreadsheet.ok",Ct="spreadsheet.modifyMerged",vt="spreadsheet.cannotModifyDisabled",Et="spreadsheet.openUnsupported",xt="spreadsheet.duplicateSheetName",I={[Se]:"Bold",[Ae]:"Italic",[De]:"Underline",[Be]:"Undo",[je]:"Redo",[He]:"Font size",[Ue]:"Increase Font size",[We]:"Decrease Font size",[Ve]:"Font",[_e]:"Clean formatting",[qe]:"Custom format...",[Je]:"Align horizontally",[$e]:"Align vertically",[Ge]:"Align",[Xe]:"Align left",[Ze]:"Align right",[Ye]:"Align center",[et]:"Align justify",[Qe]:"Center",[tt]:"Justify",[nt]:"Align top",[at]:"Align middle",[ot]:"Align bottom",[lt]:"Increase decimal",[rt]:"Decrease decimal",[Re]:"Text Color",[Te]:"Background color",[Fe]:"Add row above",[Ke]:"Add row below",[ze]:"Add column left",[Oe]:"Add column right",[Pe]:"Delete row",[Me]:"Delete column",[Le]:"Open...",[it]:"Export to Excel",[st]:"Text Wrap",[ct]:"Toggle gridlines",[ut]:"Name Box",[dt]:"Sheet",[mt]:"Home",[pt]:"File",[ft]:"Insert",[bt]:"Add new sheet",[gt]:"Format",[Ct]:"Cannot change part of a merged cell.",[vt]:"Cannot modify disabled cells.",[Et]:"Unsupported format. Please select an .xlsx file.",[xt]:"There is an existing sheet with this name. Please enter another name.",[ht]:"Error",[yt]:"OK"},c={bold:Se,italic:Ae,underline:De,undo:Be,redo:je,fontSize:He,fontSizeIncrease:Ue,fontSizeDecrease:We,fontName:Ve,cleanFormatting:_e,format:qe,alignHorizontally:Je,alignVertically:$e,align:Ge,alignLeft:Xe,alignRight:Ze,alignCenter:Ye,center:Qe,alignJustify:et,justify:tt,alignTop:nt,alignMiddle:at,alignBottom:ot,increaseDecimal:lt,decreaseDecimal:rt,textColor:Re,background:Te,addRowAbove:Fe,addRowBelow:Ke,addColumnLeft:ze,addColumnRight:Oe,deleteRow:Pe,deleteColumn:Me,open:Le,exportToExcel:it,textWrap:st,gridLines:ct,nameBox:ut,defaultSheetName:dt,file:pt,home:mt,insert:ft,addNewSheet:bt,error:ht,ok:yt,modifyMerged:Ct,cannotModifyDisabled:vt,openUnsupported:Et,duplicateSheetName:xt,formatTab:gt},X=e.forwardRef((t,n)=>{const o=e.useRef(null),r=e.useRef(null),[a,s]=e.useState([]),[d,m]=e.useState(!1),[i,v]=e.useState(""),E=e.useMemo(()=>({}),[]);E.data=a,e.useImperativeHandle(o,()=>({value:p=>{if(p===void 0){const k=r.current&&r.current.value;return k&&(k.name||k)}else v(p||"")}}),[]),e.useImperativeHandle(n,()=>o.current,[]);const C=e.useCallback(p=>{const k=t.nameEditor();k&&k.trigger("delete",{name:p})},[]),R=e.useCallback((p,k)=>{const P=e.createElement(e.Fragment,null,p.props.children,e.createElement("span",{role:"button",className:"k-button-delete",onClick:()=>C(k.dataItem[k.textField]),onMouseDown:w=>w.preventDefault(),onPointerDown:w=>w.preventDefault(),"data-role":"delete"},e.createElement(K.IconWrap,{name:"x",icon:f.xIcon})));return e.cloneElement(p,p.props,P)},[]),x=e.useCallback(p=>e.cloneElement(p,{...p.props},e.createElement("div",null)),[]),g=e.useCallback(p=>{if(p.syntheticEvent&&p.syntheticEvent.type==="change")return;const k=t.nameEditor();k&&(s(k.readData()),m(!0))},[]),y=e.useCallback(()=>{m(!1)},[]),b=e.useCallback(p=>{if(p.syntheticEvent.target.closest("[data-role]"))return;const k=t.nameEditor();if(k&&p.value){const P=p.value.name;P!==i&&(k.trigger("select",{name:P}),v(P))}},[i]),D=e.useCallback(p=>{const k=t.nameEditor();if(k)if(p.key==="Enter"){const P=p.target.value;k.trigger("enter",{value:P}),v(P)}else p.key==="Escape"&&(k.trigger("cancel"),v(E.prevValue))},[]),z=e.useCallback(p=>{E.prevValue=p.value.name},[]);return e.createElement("div",{className:"k-spreadsheet-name-editor",onKeyDown:D},e.createElement($.ComboBox,{ref:r,title:L.useLocalization().toLanguageString(c.nameBox,I[c.nameBox]),popupSettings:{className:"k-spreadsheet-names-popup"},fillMode:"flat",clearButton:!1,dataItemKey:"name",textField:"name",itemRender:R,data:a,value:i?a.find(p=>p.name===i)||{name:i}:null,onChange:b,opened:d,onOpen:g,onClose:y,onFocus:z,listNoDataRender:x,allowCustom:!0}))});X.displayName="NameBox",X.propTypes={};const Gt={onSelect:()=>{},onDelete:()=>{},onEnterEdit:()=>{},onCancelEdit:()=>{},onExitEdit:()=>{},onEdit:()=>{}},wt=e.createContext(Gt),Xt=t=>{const n=t.dataItem,{onSelect:o,onDelete:r,onEnterEdit:a,onExitEdit:s,onCancelEdit:d,onEdit:m}=e.useContext(wt),i=e.useCallback(g=>{g.target instanceof HTMLElement&&g.target.nodeName==="INPUT"||o.call(void 0,n,g)},[n,o]),v=e.useCallback(g=>{r.call(void 0,n,g)},[n,r]),E=e.useCallback(g=>{g.target instanceof HTMLElement&&g.target.nodeName==="INPUT"||a.call(void 0,n,g)},[n,a]),C=e.useCallback(g=>{s.call(void 0,n,g)},[n,s]),R=e.useCallback(g=>{g.key==="Enter"?s.call(void 0,n,g):g.key==="Escape"&&d.call(void 0,n,g)},[n,s,d]),x=e.useCallback(g=>{m.call(void 0,{...n,text:g.target.value},g)},[n,m]);return e.createElement("li",{style:t.style,...t.attributes,ref:t.forwardRef,role:"tab",className:K.classNames("k-item k-tabstrip-item",{"k-disabled":t.isDisabled,"k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active":n.active,"k-spreadsheet-sheets-bar-inactive":!n.active,"k-first":n.first,"k-last":n.last}),onClick:i,onDoubleClick:E},n.inEdit?e.createElement("input",{type:"text",className:"k-textbox k-spreadsheet-sheets-editor",value:n.text,onChange:x,maxLength:50,autoFocus:!0,onBlur:C,onKeyDown:R}):e.createElement(e.Fragment,null,e.createElement("span",{className:"k-link"},n.text),n.first&&n.last?null:e.createElement("span",{className:"k-link k-spreadsheet-sheets-remove",onClick:v},e.createElement(K.IconWrap,{name:"x",icon:f.xIcon}))))},kt=e.forwardRef((t,n)=>{const{children:o,className:r,...a}=t;return e.createElement("ul",{className:K.classNames("k-tabstrip-items k-reset",r),role:"tablist",...a,ref:n},o)});kt.displayName="TabsList";const Zt=t=>{const{sheets:n,setSheets:o,onSheetSelect:r,onSheetDelete:a,onSheetEdit:s,onSheetReorderEnd:d}=t,[m,i]=e.useState(null),v=e.useRef(!1),E=e.useRef(-1),C=e.useCallback(w=>{o(w.map((T,M,F)=>({...T,first:M===0,last:M===F.length-1})))},[]),R=e.useCallback(w=>{C(w.newState)},[C,d]),x=e.useCallback(w=>{d.call(void 0,w)},[d]),g=e.useCallback(w=>{v.current=!0,E.current=w.prevIndex},[]),y=e.useCallback(w=>{setTimeout(()=>{v.current=!1},50),d.call(void 0,{...w,prevIndex:E.current})},[]),b=e.useCallback((w,T)=>{v.current||r.call(void 0,w,T)},[r]),D=e.useCallback((w,T)=>{T.stopPropagation(),a.call(void 0,w)},[n,a]),z=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(F=>({...F,active:F.id===w.id,inEdit:F.id===w.id}));o(M),i({...w})},[n]),p=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(F=>({...F,inEdit:!1,text:F.inEdit&&m?m.text:F.text}));o(M),i(null)},[n,m]),k=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(W=>({...W,inEdit:!1})),F=n.findIndex(W=>W.id===w.id);o(M),i(null),s.call(void 0,w,F)},[n,s]),P=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(F=>({...F,text:w.id===F.id?w.text:F.text}));o(M)},[n]);return e.createElement("div",{className:"k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom"},e.createElement("div",{className:"k-tabstrip-items-wrapper k-hstack"},e.createElement(wt.Provider,{value:{onSelect:b,onDelete:D,onEnterEdit:z,onCancelEdit:p,onExitEdit:k,onEdit:P}},e.createElement(_t.Sortable,{idField:"id",data:n,itemUI:Xt,itemsWrapUI:kt,onDragOver:R,onNavigate:x,onDragStart:g,onDragEnd:y}))))},Yt=(t,n,o)=>t.map((r,a,s)=>({text:r.name(),id:o+"-sheet-"+a,first:a===0,last:a===s.length-1,active:r.name()===n})),Qt=t=>{const{spreadsheetRef:n}=t,[o,r]=e.useState([]),a=e.useRef((o.find(x=>x.active)||{}).text),s=K.useId(),d=e.useCallback(()=>{n.current&&(n.current.view.sheetsbar.onSheetSelect(a.current),r(Yt(n.current.sheets(),a.current,s)))},[]),m=e.useCallback(()=>{if(n.current){const x=n.current.sheets();x.find(g=>g.name()===a.current)||(a.current=x[x.length-1].name()),d()}},[]);e.useEffect(()=>(n.current&&(n.current.sheets().length&&(a.current=n.current.sheets()[0].name(),d()),n.current.view.bind("update",m)),()=>{n.current&&n.current.view.unbind("update",m)}),[n.current]);const i=e.useCallback(x=>{a.current!==x.text&&(a.current=x.text,d())},[]),v=e.useCallback(()=>{if(n.current){n.current.view.sheetsbar.onAddSelect();const x=n.current.sheets();a.current=x[x.length-1].name(),d()}},[]),E=e.useCallback(x=>{if(n.current){if(a.current===x.text){const g=n.current.sheets(),y=g.findIndex(D=>D.name()===x.text),b=g[y+1]||g[y-1];a.current=b?b.name():""}n.current.view.sheetsbar.onSheetRemove(x.text),d()}},[]),C=e.useCallback((x,g)=>{if(n.current){let y=x.text;const b=n.current.sheets(),D=b[g];if(!y){a.current=D.name(),d();return}if(D&&D.name()===y)return;b.find(z=>z.name()===y)&&(y=D.name()),n.current.view.sheetsbar.onSheetRename(y,g),a.current=y,d()}},[]),R=e.useCallback(x=>{if(n.current){const{prevIndex:g,nextIndex:y}=x;a.current=n.current.sheets()[g].name(),n.current.view.sheetsbar.onSheetReorderEnd({oldIndex:g,newIndex:y}),d()}},[]);return e.createElement("div",{className:"k-spreadsheet-sheets-bar k-header"},e.createElement(N.Button,{fillMode:"flat",icon:"plus",className:"k-spreadsheet-sheets-bar-add",title:L.useLocalization().toLanguageString(c.addNewSheet,I[c.addNewSheet]),svgIcon:f.plusIcon,onClick:v}),e.createElement(Zt,{sheets:o,setSheets:r,onSheetSelect:i,onSheetDelete:E,onSheetEdit:C,onSheetReorderEnd:R}))},Z=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(()=>{n.current&&n.current.saveAsExcel({...n.current.options.excel,saveAs:Ne.saveAs,Workbook:Ie.Workbook})},[]);return e.createElement(N.Button,{className:"k-toolbar-button",title:"Export...",icon:"download",fillMode:"flat",svgIcon:f.downloadIcon,onClick:o})};Z.displayName="ExcelExport";const Y=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(a=>{const s=a.target;if(s instanceof Element&&s.parentNode){const d=s.closest(".k-toolbar"),m=d&&d.querySelector(".k-upload input");m&&m.click()}},[]),r=e.useCallback(a=>{const s=a.newState;if(s[0]&&s[0].getRawFile){const d=s[0].getRawFile();n.current&&n.current.executeCommand({command:"OpenCommand",options:{file:d}})}},[]);return e.createElement(e.Fragment,null,e.createElement(N.Button,{className:"k-toolbar-button",title:L.useLocalization().toLanguageString(c.open,I[c.open]),icon:"folder-open",svgIcon:f.folderOpenIcon,fillMode:"flat",onClick:o}),e.createElement("div",{style:{display:"none"}},e.createElement(qt.Upload,{restrictions:{allowedExtensions:[".xlsx"]},onAdd:r,autoUpload:!1,defaultFiles:[],multiple:!1,accept:".xlsx,.XLSX",withCredentials:!1})))};Y.displayName="Open";const en=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],tn="Arial",nn=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],an=12,on=[{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"}],Q=t=>o=>{const{property:r,icon:a,svgIcon:s,titleKey:d}=t,{spreadsheetRef:m,value:i}=o,v=e.useCallback(()=>{if(m.current){const C={command:"PropertyChangeCommand",options:{property:r,value:!i}};m.current.executeCommand(C)}},[i]);return e.createElement(N.Button,{type:"button",icon:a,svgIcon:s,fillMode:"flat",togglable:!0,onClick:v,selected:i,title:L.useLocalization().toLanguageString(d,I[d])})},Nt=t=>o=>{const{property:r,titleKey:a,...s}=t,{spreadsheetRef:d,value:m}=o,i=e.useCallback(v=>{if(d.current){const E={command:"PropertyChangeCommand",options:{property:r,value:v.value||null}};d.current.executeCommand(E)}},[r]);return e.createElement(Jt.ColorPicker,{onChange:i,onActiveColorClick:i,fillMode:"flat",...s,title:L.useLocalization().toLanguageString(a,I[a]),value:m})},It=t=>o=>{const{spreadsheetRef:r}=o,a=e.useCallback(()=>{r.current&&r.current.workbook.undoRedoStack[t.action]()},[]);return e.createElement(N.Button,{type:"button",icon:t.icon,svgIcon:t.svgIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(t.titleKey,I[t.titleKey]),onClick:a})},ln={property:"bold",icon:"bold",svgIcon:f.boldIcon,titleKey:c.bold},ee=Q(ln);ee.displayName="Bold";const rn={property:"italic",icon:"italic",svgIcon:f.italicIcon,titleKey:c.italic},te=Q(rn);te.displayName="Italic";const sn={property:"underline",icon:"underline",svgIcon:f.underlineIcon,titleKey:c.underline},ne=Q(sn);ne.displayName="Underline";const ae=t=>{const{spreadsheetRef:n,value:o}=t,r=e.useCallback(a=>{if(n.current){const s={command:"PropertyChangeCommand",options:{property:"fontFamily",value:a.value||null}};n.current.executeCommand(s)}},[]);return e.createElement($.DropDownList,{onChange:r,value:o,data:en,defaultValue:tn,fillMode:"flat",title:L.useLocalization().toLanguageString(c.fontName,I[c.fontName]),leftRightKeysNavigation:!1})};ae.displayName="FontFamily";const oe=1,le=409,re=t=>typeof t=="string"?parseFloat(t):t,se=t=>{const{spreadsheetRef:n}=t,o=re(t.value),r=e.useCallback(a=>{var m;let s=a.value?re(a.value):o;s=isNaN(s)?o:s,s=Math.min(le,Math.max(oe,s));const d={command:"PropertyChangeCommand",options:{property:"fontSize",value:s}};a.nativeEvent.type==="keydown"||a.nativeEvent.type==="focusout"?(m=n.current)==null||m.executeCommand(d):setTimeout(()=>{var i;(i=n.current)==null||i.executeCommand(d)},0)},[o]);return e.createElement($.ComboBox,{onChange:r,value:o,data:nn,defaultValue:an,allowCustom:!0,fillMode:"flat",title:L.useLocalization().toLanguageString(c.fontSize,I[c.fontSize]),tabIndex:-1,clearButton:!1})};se.displayName="FontSize";const St=t=>{const n=o=>{const{property:r,icon:a,svgIcon:s,titleKey:d,step:m}=t,{spreadsheetRef:i}=o,v=re(o.value),E=e.useCallback(()=>{var R;const C={command:"PropertyChangeCommand",options:{property:r,value:Math.min(le,Math.max(oe,v+m))}};(R=i.current)==null||R.executeCommand(C)},[v]);return e.createElement(N.Button,{type:"button",icon:a,svgIcon:s,fillMode:"flat",onClick:E,disabled:v+m<oe||v+m>le,title:L.useLocalization().toLanguageString(d,I[d])})};return n.displayName=t.displayName,n},At=St({property:"fontSize",icon:"font-grow",svgIcon:f.fontGrowIcon,titleKey:c.fontSizeIncrease,displayName:"IncreaseFontSize",step:1}),Dt=St({property:"fontSize",icon:"font-shrink",svgIcon:f.fontShrinkIcon,titleKey:c.fontSizeDecrease,displayName:"DecreaseFontSize",step:-1}),ce=Nt({icon:"foreground-color",svgIcon:f.foregroundColorIcon,view:"palette",property:"color",titleKey:c.textColor,ariaLabel:"Text Color"});ce.displayName="TextColor";const ie=Nt({icon:"droplet",svgIcon:f.dropletIcon,view:"palette",property:"background",titleKey:c.background,ariaLabel:"Background"});ie.displayName="BackgroundColor";const H=[{icon:"align-left",svgIcon:f.alignLeftIcon,textKey:c.alignLeft,commandName:"textAlign",value:"left",selected:!1},{icon:"align-center",svgIcon:f.alignCenterIcon,textKey:c.alignCenter,commandName:"textAlign",value:"center",selected:!1},{icon:"align-right",svgIcon:f.alignRightIcon,textKey:c.alignRight,commandName:"textAlign",value:"right",selected:!1},{icon:"align-justify",svgIcon:f.alignJustifyIcon,textKey:c.alignJustify,commandName:"textAlign",value:"justify",selected:!1},{icon:"align-top",svgIcon:f.alignTopIcon,textKey:c.alignTop,commandName:"verticalAlign",value:"top",selected:!1},{icon:"align-middle",svgIcon:f.alignMiddleIcon,textKey:c.alignMiddle,commandName:"verticalAlign",value:"center",selected:!1},{icon:"align-bottom",svgIcon:f.alignBottomIcon,textKey:c.alignBottom,commandName:"verticalAlign",value:"bottom",selected:!1}],cn=[H[0],{...H[1],textKey:c.center},H[2],{...H[3],textKey:c.justify}],un=H.filter(t=>t.commandName==="verticalAlign"),Lt=t=>{const{value:n,spreadsheetRef:o}=t,{textAlign:r,verticalAlign:a}=n||{},s=L.useLocalization(),d=e.useCallback(i=>{if(o.current){const v=i.item,E={command:"PropertyChangeCommand",options:{property:v.commandName,value:v.value||null}};o.current.executeCommand(E)}},[]);let m=H.slice();return m=m.map(i=>({...i,text:s.toLanguageString(i.textKey,I[i.textKey])})),r&&(m=m.map(i=>i.commandName==="textAlign"?{...i,selected:i.value===r}:i)),a&&(m=m.map(i=>i.commandName==="verticalAlign"?{...i,selected:i.value===a}:i)),e.createElement(N.DropDownButton,{icon:"align-left",svgIcon:f.alignLeftIcon,items:m,fillMode:"flat",onItemClick:d,title:s.toLanguageString(c.align,I[c.align]),text:e.createElement(K.IconWrap,{name:"caret-alt-down",icon:f.caretAltDownIcon})})};Lt.displayName="Alignment";const dn={items:cn,icon:{icon:"align-left",svgIcon:f.alignLeftIcon},displayName:"AlignHorizontally",titleKey:c.alignHorizontally},mn={items:un,icon:{icon:"align-bottom",svgIcon:f.alignBottomIcon},displayName:"AlignVertically",titleKey:c.alignVertically},Rt=t=>{const n=o=>{const{value:r,spreadsheetRef:a}=o,s=L.useLocalization(),d=e.useCallback(E=>{if(a.current){const C=E.item,R={command:"PropertyChangeCommand",options:{property:C.commandName,value:C.value||null}};a.current.executeCommand(R)}},[]);let m=t.items.slice();m=m.map(E=>({...E,text:s.toLanguageString(E.textKey,I[E.textKey])})),m=m.map(E=>({...E,selected:E.value===r}));const i={...t.icon},v=m.find(E=>E.selected);return v&&(i.icon=v.icon,i.svgIcon=v.svgIcon),e.createElement(N.DropDownButton,{...i,items:m,fillMode:"flat",onItemClick:d,title:s.toLanguageString(t.titleKey,I[t.titleKey]),text:e.createElement(K.IconWrap,{name:"caret-alt-down",icon:f.caretAltDownIcon})})};return n.displayName=t.displayName,n},Tt=Rt(dn),Ft=Rt(mn),ue=t=>{const{value:n,spreadsheetRef:o}=t,r=e.useCallback(()=>{if(o.current){const a=o.current.activeSheet();if(a){const m={command:"TextWrapCommand",options:{property:"wrap",value:!a.range(a.activeCell()).wrap()}};o.current.executeCommand(m)}}},[]);return e.createElement(N.Button,{type:"button",togglable:!0,icon:"text-wrap",svgIcon:f.textWrapIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(c.textWrap,I[c.textWrap]),onClick:r,selected:n})};ue.displayName="TextWrap";const de=t=>{const{value:n,spreadsheetRef:o}=t,r=e.useCallback(()=>{if(o.current){const a=o.current.activeSheet();if(a){const d={command:"GridLinesChangeCommand",options:{property:"gridLines",value:!a.showGridLines()}};o.current.executeCommand(d)}}},[]);return e.createElement(N.Button,{type:"button",togglable:!0,icon:"borders-none",svgIcon:f.bordersNoneIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(c.gridLines,I[c.gridLines]),onClick:r,selected:n})};de.displayName="GridLines";const me=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(r=>{const a=r.item.value||null;setTimeout(()=>{if(n.current){const s={command:"PropertyChangeCommand",options:{property:"format",value:a}};n.current.executeCommand(s)}},0)},[]);return e.createElement(N.DropDownButton,{icon:"custom-format",svgIcon:f.customFormatIcon,fillMode:"flat",onItemClick:o,items:on,title:L.useLocalization().toLanguageString(c.format,I[c.format]),text:e.createElement(K.IconWrap,{name:"caret-alt-down"})})};me.displayName="Format";const U=t=>o=>{const{spreadsheetRef:r,value:a}=o,s=e.useCallback(()=>{if(r.current){const d={command:t.command,options:{value:t.value}};r.current.executeCommand(d)}},[]);return e.createElement(N.Button,{type:"button",icon:t.icon,svgIcon:t.svgIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(t.titleKey,I[t.titleKey]),onClick:s,disabled:a&&t.disabled(a)})},pn={command:"AddColumnCommand",value:"left",icon:"table-column-insert-left",svgIcon:f.tableColumnInsertLeftIcon,titleKey:c.addColumnLeft,disabled:t=>t.allCols,displayName:"AddColumnLeft"},fn={command:"AddColumnCommand",value:"right",icon:"table-column-insert-right",svgIcon:f.tableColumnInsertRightIcon,titleKey:c.addColumnRight,disabled:t=>t.allCols,displayName:"AddColumnRight"},gn={command:"AddRowCommand",value:"below",icon:"table-row-insert-below",svgIcon:f.tableRowInsertBelowIcon,titleKey:c.addRowBelow,disabled:t=>t.allRows,displayName:"AddRowBelow"},bn={command:"AddRowCommand",value:"above",icon:"table-row-insert-above",svgIcon:f.tableRowInsertAboveIcon,titleKey:c.addRowAbove,disabled:t=>t.allRows,displayName:"AddRowAbove"},hn={command:"DeleteColumnCommand",icon:"table-column-delete",svgIcon:f.tableColumnDeleteIcon,titleKey:c.deleteColumn,disabled:t=>t.allCols,displayName:"DeleteColumn"},yn={command:"DeleteRowCommand",icon:"table-row-delete",svgIcon:f.tableRowDeleteIcon,titleKey:c.deleteRow,disabled:t=>t.allRows,displayName:"DeleteRow"},pe=U(pn),fe=U(fn),ge=U(gn),be=U(bn),he=U(hn),ye=U(yn);pe.displayName="AddColumnLeft",fe.displayName="AddColumnRight",ge.displayName="AddRowBelow",be.displayName="AddRowAbove",he.displayName="DeleteColumn",ye.displayName="DeleteRow";const Cn={action:"undo",icon:"reset",svgIcon:f.arrowRotateCcwIcon,titleKey:c.undo},Ce=It(Cn);Ce.displayName="Undo";const vn={action:"redo",icon:"reload",svgIcon:f.arrowRotateCwIcon,titleKey:c.redo},ve=It(vn);ve.displayName="Redo";const Kt=t=>o=>{const{icon:r,svgIcon:a,titleKey:s,value:d}=t,{spreadsheetRef:m}=o,i=e.useCallback(()=>{if(m.current){const v={command:"AdjustDecimalsCommand",options:{value:d}};m.current.executeCommand(v)}},[]);return e.createElement(N.Button,{type:"button",icon:r,svgIcon:a,fillMode:"flat",onClick:i,title:L.useLocalization().toLanguageString(s,I[s])})},En=Kt({icon:f.decimalIncreaseIcon.name,svgIcon:f.decimalIncreaseIcon,value:1,titleKey:c.increaseDecimal}),xn=Kt({icon:f.decimalDecreaseIcon.name,svgIcon:f.decimalDecreaseIcon,value:-1,titleKey:c.decreaseDecimal}),Ee=[{textKey:c.file,tools:[Y,Z]},{textKey:c.home,selected:!0,tools:[[Ce,ve],N.ToolbarSeparator,ae,se,At,Dt,N.ToolbarSeparator,[ee,te,ne],ce,N.ToolbarSeparator,ie,N.ToolbarSeparator,Tt,Ft,ue,N.ToolbarSeparator,de]},{textKey:c.insert,tools:[[pe,fe,ge,be],N.ToolbarSeparator,[he,ye]]},{textKey:c.formatTab,tools:[me,[xn,En]]}],zt={name:"@progress/kendo-react-spreadsheet",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1683639393,version:"",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"},Ot=["bold","italic","underline","fontFamily","fontSize","color","background","textAlign","verticalAlign","wrap","gridLines"],Pt={Bold:t=>t.bold,Italic:t=>t.italic,Underline:t=>t.underline,FontFamily:t=>t.fontFamily,FontSize:t=>t.fontSize,IncreaseFontSize:t=>t.fontSize,DecreaseFontSize:t=>t.fontSize,TextColor:t=>t.color,BackgroundColor:t=>t.background,Alignment:t=>({textAlign:t.textAlign,verticalAlign:t.verticalAlign}),AlignHorizontally:t=>t.textAlign,AlignVertically:t=>t.verticalAlign,TextWrap:t=>t.wrap,GridLines:t=>t.gridLines,AddColumnLeft:t=>t.selectedHeaders,AddColumnRight:t=>t.selectedHeaders,AddRowBelow:t=>t.selectedHeaders,AddRowAbove:t=>t.selectedHeaders,DeleteColumn:t=>t.selectedHeaders,DeleteRow:t=>t.selectedHeaders},Mt=":not(.k-dropdownlist button):not(.k-combobox button):not(.k-upload-button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",wn=["button"+Mt,".k-button-group > button"+Mt,".k-dropdownlist",".k-combobox",".k-colorpicker"],xe=e.forwardRef((t,n)=>{K.validatePackage(zt);const o=K.shouldShowValidationUI(zt),{toolbar:r=Ee}=t,a=[];typeof r=="boolean"?a.push(...r?Ee:[]):a.push(...r);const[s,d]=e.useState(null),[m,i]=e.useState(a.findIndex(u=>u.selected)||0),[v,E]=e.useState(!1),C=e.useRef(null),R=e.useRef(null),x=e.useRef(null),g=e.useRef(null),y=e.useRef(null),[b,D]=e.useState({}),z=e.useRef({});z.current=b;const p=e.useRef({});p.current=t;const k=L.useLocalization(),P=e.useCallback(u=>{p.current.onSelect&&p.current.onSelect.call(void 0,u)},[]),w=e.useCallback(u=>{p.current.onChange&&p.current.onChange.call(void 0,u)},[]),T=e.useCallback(u=>{p.current.onChangeFormat&&p.current.onChangeFormat.call(void 0,u)},[]),M=e.useCallback(u=>{p.current.onExcelImport&&p.current.onExcelImport.call(void 0,u)},[]),F=e.useCallback(u=>{p.current.onExcelExport&&p.current.onExcelExport.call(void 0,u)},[]),W=e.useRef(null);e.useImperativeHandle(W,()=>({element:C.current,get instance(){return y.current},props:t,get view(){return y.current.view},get workbook(){return y.current.workbook},executeCommand(u){var h;(h=y.current)==null||h.executeCommand(u)},fromJSON(u){var h;return(h=y.current)==null?void 0:h.fromJSON(u)},toJSON(){return y.current.toJSON()},saveJSON(){return y.current.saveJSON()},fromFile(u){return y.current.fromFile(u)},saveAsExcel(u){var h;(h=y.current)==null||h.saveAsExcel({...y.current.options.excel,saveAs:Ne.saveAs,Workbook:Ie.Workbook,...u})},activeSheet(u){var h;return(h=y.current)==null?void 0:h.activeSheet(u)},sheets(){return y.current.sheets()},refresh(){var u;return(u=y.current)==null?void 0:u.refresh()}}),[t]),e.useImperativeHandle(n,()=>W.current);const Nn=e.useCallback(()=>y.current&&y.current.view.nameEditor,[]),Bt=e.useCallback(u=>{const h={};Ot.forEach(A=>{typeof u.range[A]=="function"?h[A]=u.range[A]():A==="gridLines"&&(h[A]=u.range.sheet().showGridLines())}),h.selectedHeaders=u.range.sheet().selectedHeaders(),(Ot.some(A=>h[A]!==z.current[A])||h.selectedHeaders.allCols!==z.current.selectedHeaders.allCols||h.selectedHeaders.allRows!==z.current.selectedHeaders.allRows)&&D(h)},[]),In=e.useCallback(u=>{const h=u.name,A=c[h];d({title:u.title==="Error"?k.toLanguageString(c.error,I[c.error]||u.title):u.title,message:A?k.toLanguageString(A,I[A]||u.text):u.text,close:u.close})},[]),jt=e.useCallback(()=>{d(null),s==null||s.close()},[s]),_=L.useInternationalization(),Ht=L.useLocalization();e.useEffect(()=>{var q;const u={...t.defaultProps,sheets:structuredClone((q=t.defaultProps)==null?void 0:q.sheets),messages:{workbook:{defaultSheetName:Ht.toLanguageString(c.defaultSheetName,I[c.defaultSheetName])}},intl:{localeInfo:()=>_.localeInfo(),localeCurrency:()=>_.localeCurrency(),parseDate:(B,j)=>_.parseDate(B,j),toString:(B,j)=>_.toString(B,j),format:(B,...j)=>_.format(B,...j)},formulaBarInputRef:R,formulaCellInputRef:x,nameBoxRef:g},h=new S.SpreadsheetWidget(C.current,u);y.current=h,h.bind("select",P),h.bind("change",w),h.bind("changeFormat",T),h.bind("excelImport",M),h.bind("excelExport",F),h.view.bind("update",Bt),h.view.bind("message",In);const A=h.activeSheet();return A&&Bt({range:A.range(A.activeCell())}),E(!0),()=>{h.destroy()}},[]);const Ut=e.useCallback((u,h)=>{const A=e.createElement(u,{spreadsheetRef:y,value:Pt[u.displayName]?Pt[u.displayName](b):void 0,key:h});return A.type===N.ToolbarSeparator?e.createElement(u,{key:h}):A},[b]);let Wt=null;return a.length&&(Wt=e.createElement(we.TabStrip,{selected:m,animation:!1,className:"k-floatwrap k-spreadsheet-tabstrip",style:{minHeight:"auto"},onSelect:u=>i(u.selected)},a.map(u=>{const h=u.textKey?Ht.toLanguageString(u.textKey,I[u.textKey]):u.text;return e.createElement(we.TabStripTab,{key:u.textKey||u.text,title:h},e.createElement(N.Toolbar,{buttons:wn,className:"k-spreadsheet-toolbar"},u.tools.map((A,q)=>Array.isArray(A)?e.createElement(N.ButtonGroup,{key:q},A.map((B,j)=>Ut(B,j))):Ut(A,q))))}))),e.createElement("div",{ref:C,style:t.style,className:K.classNames("k-widget k-spreadsheet",t.className),role:"application"},Wt,e.createElement("div",{className:"k-spreadsheet-action-bar"},e.createElement(X,{ref:g,nameEditor:Nn}),e.createElement("div",{className:"k-spreadsheet-formula-bar"},e.createElement(K.IconWrap,{name:"formula-fx",icon:f.formulaFxIcon}),e.createElement(J,{ref:R}))),e.createElement("div",{className:"k-spreadsheet-view"},e.createElement("div",{className:"k-spreadsheet-fixed-container"}),e.createElement("div",{className:"k-spreadsheet-scroller"},e.createElement("div",{className:"k-spreadsheet-view-size"})),e.createElement("div",{tabIndex:0,className:"k-spreadsheet-clipboard",contentEditable:"true"}),e.createElement(J,{ref:x,className:"k-spreadsheet-cell-editor"})),e.createElement(Qt,{spreadsheetRef:y}),s&&e.createElement(ke.Dialog,{title:s.title,onClose:jt},e.createElement("div",null,s.message),e.createElement(ke.DialogActionsBar,{layout:"start"},e.createElement(N.Button,{themeColor:"primary",onClick:jt,autoFocus:!0},k.toLanguageString(c.ok,I[c.ok])))),o&&e.createElement(K.WatermarkOverlay,null))});xe.displayName="KendoReactSpreadsheet",xe.propTypes={className:O.string,defaultProps:O.any,toolbar:O.oneOfType([O.bool,O.arrayOf(O.any)]),style:O.object,onSelect:O.func,onChange:O.func,onChangeFormat:O.func,onExcelImport:O.func,onExcelExport:O.func};const kn=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(()=>{n.current&&n.current.executeCommand({command:"PropertyCleanCommand"})},[]);return e.createElement(N.Button,{type:"button",icon:"clean-css",svgIcon:f.clearCssIcon,fillMode:"flat",onClick:o,title:L.useLocalization().toLanguageString(c.cleanFormatting,I[c.cleanFormatting])})};Object.defineProperty(l,"CalcError",{enumerable:!0,get:()=>S.CalcError}),Object.defineProperty(l,"CellRef",{enumerable:!0,get:()=>S.CellRef}),Object.defineProperty(l,"Context",{enumerable:!0,get:()=>S.Context}),Object.defineProperty(l,"Matrix",{enumerable:!0,get:()=>S.Matrix}),Object.defineProperty(l,"NULLREF",{enumerable:!0,get:()=>S.NULLREF}),Object.defineProperty(l,"NameRef",{enumerable:!0,get:()=>S.NameRef}),Object.defineProperty(l,"Range",{enumerable:!0,get:()=>S.Range}),Object.defineProperty(l,"RangeRef",{enumerable:!0,get:()=>S.RangeRef}),Object.defineProperty(l,"Ref",{enumerable:!0,get:()=>S.Ref}),Object.defineProperty(l,"Sheet",{enumerable:!0,get:()=>S.Sheet}),Object.defineProperty(l,"SpreadsheetWidget",{enumerable:!0,get:()=>S.SpreadsheetWidget}),Object.defineProperty(l,"UnionRef",{enumerable:!0,get:()=>S.UnionRef}),Object.defineProperty(l,"View",{enumerable:!0,get:()=>S.View}),Object.defineProperty(l,"Workbook",{enumerable:!0,get:()=>S.Workbook}),Object.defineProperty(l,"dateToSerial",{enumerable:!0,get:()=>S.dateToSerial}),Object.defineProperty(l,"defineAlias",{enumerable:!0,get:()=>S.defineAlias}),Object.defineProperty(l,"defineFunction",{enumerable:!0,get:()=>S.defineFunction}),Object.defineProperty(l,"packDate",{enumerable:!0,get:()=>S.packDate}),Object.defineProperty(l,"packTime",{enumerable:!0,get:()=>S.packTime}),Object.defineProperty(l,"serialToDate",{enumerable:!0,get:()=>S.serialToDate}),Object.defineProperty(l,"unpackDate",{enumerable:!0,get:()=>S.unpackDate}),Object.defineProperty(l,"unpackTime",{enumerable:!0,get:()=>S.unpackTime}),l.AddColumnLeft=pe,l.AddColumnRight=fe,l.AddRowAbove=be,l.AddRowBelow=ge,l.AlignHorizontally=Tt,l.AlignVertically=Ft,l.Alignment=Lt,l.BackgroundColor=ie,l.Bold=ee,l.CleanFormatting=kn,l.DecreaseFontSize=Dt,l.DeleteColumn=he,l.DeleteRow=ye,l.ExcelExport=Z,l.FontFamily=ae,l.FontSize=se,l.Format=me,l.GridLines=de,l.IncreaseFontSize=At,l.Italic=te,l.Open=Y,l.Redo=ve,l.Spreadsheet=xe,l.TextColor=ce,l.TextWrap=ue,l.Underline=ne,l.Undo=Ce,l.defaultTabs=Ee,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
(function(l,V){typeof exports=="object"&&typeof module!="undefined"?V(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")):typeof define=="function"&&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"],V):(l=typeof globalThis!="undefined"?globalThis:l||self,V(l.KendoReactSpreadsheet={},l.React,l.PropTypes,l.KendoReactButtons,l.KendoReactLayout,l.KendoReactDialogs,l.KendoReactPopup,l.KendoReactCommon,l.KendoSvgIcons,l.KendoReactDropdowns,l.KendoReactIntl,l.KendoReactSortable,l.KendoSpreadsheetCommon,l.KendoFileSaver,l.KendoOoxml,l.KendoReactUpload,l.KendoReactInputs))})(this,function(l,V,O,N,we,ke,Vt,K,f,$,L,_t,S,Ne,Ie,qt,Jt){"use strict";"use client";function $t(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const e=$t(V),G=e.forwardRef((t,n)=>{const o=e.useRef(null),r=e.useRef(null);return e.useImperativeHandle(o,()=>({element:r.current,props:t})),e.useImperativeHandle(n,()=>o.current),e.createElement("div",{className:"k-list k-list-md"},e.createElement("div",{className:"k-list-content"},e.createElement("ul",{ref:r,className:"k-spreadsheet-formula-list k-list-ul",onMouseDown:a=>a.preventDefault(),style:{maxHeight:280}},t.data.map(a=>e.createElement("li",{key:a.text,className:"k-list-item",onClick:()=>t.onItemClick(a.value)},e.createElement(K.IconWrap,{name:"formula-fx",icon:f.formulaFxIcon}),e.createElement("span",{className:"k-list-item-text"},a.text))))))});G.displayName="List",G.propTypes={};const J=e.forwardRef((t,n)=>{const[o,r]=e.useState(!1),[a,s]=e.useState(0),[d,m]=e.useState([]),i=e.useMemo(()=>({}),[]);i.showPopup=o,i.popupContentKey=a,i.data=d;const v=e.useRef(null),E=e.useRef(null),C=e.useRef(null),R=e.useCallback(()=>{if(C.current&&C.current.element)return C.current.element.querySelector(".k-focus")},[]),x=e.useCallback(()=>{const b=R();b&&b.classList.remove("k-focus")},[]),g=e.useCallback(b=>{const D=Array.from(C.current&&C.current.element.children||[]),z=R();let p;if(z){const k=D.indexOf(z);z.classList.remove("k-focus"),p=D[k+b]?D[k+b]:b===1?D[0]:D[D.length-1]}else p=b===1?D[0]:D[D.length-1];p&&p.classList.add("k-focus")},[]);e.useImperativeHandle(v,()=>({element:E.current,props:t,popup:{open:()=>{r(!0)},close:()=>{r(!1)},position:()=>{s(i.popupContentKey+1)},visible:()=>i.showPopup},list:{get element(){return C.current&&C.current.element},data:b=>{if(b)m(b);else return i.data},value:()=>({}),focus:()=>Array.from(C.current&&C.current.element&&C.current.element.children||[]).indexOf(R()),focusNext:()=>{g(1)},focusPrev:()=>{g(-1)},focusFirst:()=>{const b=C.current&&C.current.element;b&&b.children.item(0)&&(x(),b.children.item(0).classList.add("k-focus"))},focusLast:()=>{const b=C.current&&C.current.element;b&&b.children.length&&(x(),b.children.item(b.children.length-1).classList.add("k-focus"))},itemClick:b=>{i.itemClick=b}}}),[]),e.useImperativeHandle(n,()=>v.current,[]);const y=e.useCallback(b=>{i.itemClick&&i.itemClick(b)},[]);return e.createElement(e.Fragment,null,e.createElement("div",{className:K.classNames("k-spreadsheet-formula-input",t.className),contentEditable:"true",spellCheck:"false",style:{whiteSpace:"pre"},ref:E}),e.createElement(Vt.Popup,{show:o,anchor:E.current,animate:{openDuration:100,closeDuration:100},contentKey:a,popupClass:"k-list-container"},e.createElement(G,{data:d,ref:C,onItemClick:y})))});J.displayName="FormulaInput",J.propTypes={};const Se="spreadsheet.bold",Ae="spreadsheet.italic",De="spreadsheet.underline",Le="spreadsheet.openFile",Re="spreadsheet.textColor",Te="spreadsheet.background",Fe="spreadsheet.addRowAbove",Ke="spreadsheet.addRowBelow",ze="spreadsheet.addColumnLeft",Oe="spreadsheet.addColumnRight",Pe="spreadsheet.deleteRow",Me="spreadsheet.deleteColumn",Be="spreadsheet.undo",je="spreadsheet.redo",He="spreadsheet.fontSize",Ue="spreadsheet.fontSizeIncrease",We="spreadsheet.fontSizeDecrease",Ve="spreadsheet.fontName",_e="spreadsheet.cleanFormatting",qe="spreadsheet.format",Je="spreadsheet.alignHorizontally",$e="spreadsheet.alignVertically",Ge="spreadsheet.align",Xe="spreadsheet.alignLeft",Ze="spreadsheet.alignRight",Ye="spreadsheet.alignCenter",Qe="spreadsheet.center",et="spreadsheet.alignJustify",tt="spreadsheet.justify",nt="spreadsheet.alignTop",at="spreadsheet.alignMiddle",ot="spreadsheet.alignBottom",lt="spreadsheet.increaseDecimal",rt="spreadsheet.decreaseDecimal",st="spreadsheet.textWrap",ct="spreadsheet.gridLines",it="spreadsheet.exportToExcel",ut="spreadsheet.nameBox",dt="spreadsheet.defaultSheetName",mt="spreadsheet.home",pt="spreadsheet.file",ft="spreadsheet.insert",gt="spreadsheet.formatTab",bt="spreadsheet.addNewSheet",ht="spreadsheet.error",yt="spreadsheet.ok",Ct="spreadsheet.modifyMerged",vt="spreadsheet.cannotModifyDisabled",Et="spreadsheet.openUnsupported",xt="spreadsheet.duplicateSheetName",I={[Se]:"Bold",[Ae]:"Italic",[De]:"Underline",[Be]:"Undo",[je]:"Redo",[He]:"Font size",[Ue]:"Increase Font size",[We]:"Decrease Font size",[Ve]:"Font",[_e]:"Clean formatting",[qe]:"Custom format...",[Je]:"Align horizontally",[$e]:"Align vertically",[Ge]:"Align",[Xe]:"Align left",[Ze]:"Align right",[Ye]:"Align center",[et]:"Align justify",[Qe]:"Center",[tt]:"Justify",[nt]:"Align top",[at]:"Align middle",[ot]:"Align bottom",[lt]:"Increase decimal",[rt]:"Decrease decimal",[Re]:"Text Color",[Te]:"Background color",[Fe]:"Add row above",[Ke]:"Add row below",[ze]:"Add column left",[Oe]:"Add column right",[Pe]:"Delete row",[Me]:"Delete column",[Le]:"Open...",[it]:"Export to Excel",[st]:"Text Wrap",[ct]:"Toggle gridlines",[ut]:"Name Box",[dt]:"Sheet",[mt]:"Home",[pt]:"File",[ft]:"Insert",[bt]:"Add new sheet",[gt]:"Format",[Ct]:"Cannot change part of a merged cell.",[vt]:"Cannot modify disabled cells.",[Et]:"Unsupported format. Please select an .xlsx file.",[xt]:"There is an existing sheet with this name. Please enter another name.",[ht]:"Error",[yt]:"OK"},c={bold:Se,italic:Ae,underline:De,undo:Be,redo:je,fontSize:He,fontSizeIncrease:Ue,fontSizeDecrease:We,fontName:Ve,cleanFormatting:_e,format:qe,alignHorizontally:Je,alignVertically:$e,align:Ge,alignLeft:Xe,alignRight:Ze,alignCenter:Ye,center:Qe,alignJustify:et,justify:tt,alignTop:nt,alignMiddle:at,alignBottom:ot,increaseDecimal:lt,decreaseDecimal:rt,textColor:Re,background:Te,addRowAbove:Fe,addRowBelow:Ke,addColumnLeft:ze,addColumnRight:Oe,deleteRow:Pe,deleteColumn:Me,open:Le,exportToExcel:it,textWrap:st,gridLines:ct,nameBox:ut,defaultSheetName:dt,file:pt,home:mt,insert:ft,addNewSheet:bt,error:ht,ok:yt,modifyMerged:Ct,cannotModifyDisabled:vt,openUnsupported:Et,duplicateSheetName:xt,formatTab:gt},X=e.forwardRef((t,n)=>{const o=e.useRef(null),r=e.useRef(null),[a,s]=e.useState([]),[d,m]=e.useState(!1),[i,v]=e.useState(""),E=e.useMemo(()=>({}),[]);E.data=a,e.useImperativeHandle(o,()=>({value:p=>{if(p===void 0){const k=r.current&&r.current.value;return k&&(k.name||k)}else v(p||"")}}),[]),e.useImperativeHandle(n,()=>o.current,[]);const C=e.useCallback(p=>{const k=t.nameEditor();k&&k.trigger("delete",{name:p})},[]),R=e.useCallback((p,k)=>{const P=e.createElement(e.Fragment,null,p.props.children,e.createElement("span",{role:"button",className:"k-button-delete",onClick:()=>C(k.dataItem[k.textField]),onMouseDown:w=>w.preventDefault(),onPointerDown:w=>w.preventDefault(),"data-role":"delete"},e.createElement(K.IconWrap,{name:"x",icon:f.xIcon})));return e.cloneElement(p,p.props,P)},[]),x=e.useCallback(p=>e.cloneElement(p,{...p.props},e.createElement("div",null)),[]),g=e.useCallback(p=>{if(p.syntheticEvent&&p.syntheticEvent.type==="change")return;const k=t.nameEditor();k&&(s(k.readData()),m(!0))},[]),y=e.useCallback(()=>{m(!1)},[]),b=e.useCallback(p=>{if(p.syntheticEvent.target.closest("[data-role]"))return;const k=t.nameEditor();if(k&&p.value){const P=p.value.name;P!==i&&(k.trigger("select",{name:P}),v(P))}},[i]),D=e.useCallback(p=>{const k=t.nameEditor();if(k)if(p.key==="Enter"){const P=p.target.value;k.trigger("enter",{value:P}),v(P)}else p.key==="Escape"&&(k.trigger("cancel"),v(E.prevValue))},[]),z=e.useCallback(p=>{E.prevValue=p.value.name},[]);return e.createElement("div",{className:"k-spreadsheet-name-editor",onKeyDown:D},e.createElement($.ComboBox,{ref:r,title:L.useLocalization().toLanguageString(c.nameBox,I[c.nameBox]),popupSettings:{className:"k-spreadsheet-names-popup"},fillMode:"flat",clearButton:!1,dataItemKey:"name",textField:"name",itemRender:R,data:a,value:i?a.find(p=>p.name===i)||{name:i}:null,onChange:b,opened:d,onOpen:g,onClose:y,onFocus:z,listNoDataRender:x,allowCustom:!0}))});X.displayName="NameBox",X.propTypes={};const Gt={onSelect:()=>{},onDelete:()=>{},onEnterEdit:()=>{},onCancelEdit:()=>{},onExitEdit:()=>{},onEdit:()=>{}},wt=e.createContext(Gt),Xt=t=>{const n=t.dataItem,{onSelect:o,onDelete:r,onEnterEdit:a,onExitEdit:s,onCancelEdit:d,onEdit:m}=e.useContext(wt),i=e.useCallback(g=>{g.target instanceof HTMLElement&&g.target.nodeName==="INPUT"||o.call(void 0,n,g)},[n,o]),v=e.useCallback(g=>{r.call(void 0,n,g)},[n,r]),E=e.useCallback(g=>{g.target instanceof HTMLElement&&g.target.nodeName==="INPUT"||a.call(void 0,n,g)},[n,a]),C=e.useCallback(g=>{s.call(void 0,n,g)},[n,s]),R=e.useCallback(g=>{g.key==="Enter"?s.call(void 0,n,g):g.key==="Escape"&&d.call(void 0,n,g)},[n,s,d]),x=e.useCallback(g=>{m.call(void 0,{...n,text:g.target.value},g)},[n,m]);return e.createElement("li",{style:t.style,...t.attributes,ref:t.forwardRef,role:"tab",className:K.classNames("k-item k-tabstrip-item",{"k-disabled":t.isDisabled,"k-active k-state-tab-on-top k-spreadsheet-sheets-bar-active":n.active,"k-spreadsheet-sheets-bar-inactive":!n.active,"k-first":n.first,"k-last":n.last}),onClick:i,onDoubleClick:E},n.inEdit?e.createElement("input",{type:"text",className:"k-textbox k-spreadsheet-sheets-editor",value:n.text,onChange:x,maxLength:50,autoFocus:!0,onBlur:C,onKeyDown:R}):e.createElement(e.Fragment,null,e.createElement("span",{className:"k-link"},n.text),n.first&&n.last?null:e.createElement("span",{className:"k-link k-spreadsheet-sheets-remove",onClick:v},e.createElement(K.IconWrap,{name:"x",icon:f.xIcon}))))},kt=e.forwardRef((t,n)=>{const{children:o,className:r,...a}=t;return e.createElement("ul",{className:K.classNames("k-tabstrip-items k-reset",r),role:"tablist",...a,ref:n},o)});kt.displayName="TabsList";const Zt=t=>{const{sheets:n,setSheets:o,onSheetSelect:r,onSheetDelete:a,onSheetEdit:s,onSheetReorderEnd:d}=t,[m,i]=e.useState(null),v=e.useRef(!1),E=e.useRef(-1),C=e.useCallback(w=>{o(w.map((T,M,F)=>({...T,first:M===0,last:M===F.length-1})))},[]),R=e.useCallback(w=>{C(w.newState)},[C,d]),x=e.useCallback(w=>{d.call(void 0,w)},[d]),g=e.useCallback(w=>{v.current=!0,E.current=w.prevIndex},[]),y=e.useCallback(w=>{setTimeout(()=>{v.current=!1},50),d.call(void 0,{...w,prevIndex:E.current})},[]),b=e.useCallback((w,T)=>{v.current||r.call(void 0,w,T)},[r]),D=e.useCallback((w,T)=>{T.stopPropagation(),a.call(void 0,w)},[n,a]),z=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(F=>({...F,active:F.id===w.id,inEdit:F.id===w.id}));o(M),i({...w})},[n]),p=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(F=>({...F,inEdit:!1,text:F.inEdit&&m?m.text:F.text}));o(M),i(null)},[n,m]),k=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(W=>({...W,inEdit:!1})),F=n.findIndex(W=>W.id===w.id);o(M),i(null),s.call(void 0,w,F)},[n,s]),P=e.useCallback((w,T)=>{T.stopPropagation(),T.preventDefault();const M=n.map(F=>({...F,text:w.id===F.id?w.text:F.text}));o(M)},[n]);return e.createElement("div",{className:"k-spreadsheet-sheets-items k-tabstrip k-floatwrap k-tabstrip-bottom"},e.createElement("div",{className:"k-tabstrip-items-wrapper k-hstack"},e.createElement(wt.Provider,{value:{onSelect:b,onDelete:D,onEnterEdit:z,onCancelEdit:p,onExitEdit:k,onEdit:P}},e.createElement(_t.Sortable,{idField:"id",data:n,itemUI:Xt,itemsWrapUI:kt,onDragOver:R,onNavigate:x,onDragStart:g,onDragEnd:y}))))},Yt=(t,n,o)=>t.map((r,a,s)=>({text:r.name(),id:o+"-sheet-"+a,first:a===0,last:a===s.length-1,active:r.name()===n})),Qt=t=>{const{spreadsheetRef:n}=t,[o,r]=e.useState([]),a=e.useRef((o.find(x=>x.active)||{}).text),s=K.useId(),d=e.useCallback(()=>{n.current&&(n.current.view.sheetsbar.onSheetSelect(a.current),r(Yt(n.current.sheets(),a.current,s)))},[]),m=e.useCallback(()=>{if(n.current){const x=n.current.sheets();x.find(g=>g.name()===a.current)||(a.current=x[x.length-1].name()),d()}},[]);e.useEffect(()=>(n.current&&(n.current.sheets().length&&(a.current=n.current.sheets()[0].name(),d()),n.current.view.bind("update",m)),()=>{n.current&&n.current.view.unbind("update",m)}),[n.current]);const i=e.useCallback(x=>{a.current!==x.text&&(a.current=x.text,d())},[]),v=e.useCallback(()=>{if(n.current){n.current.view.sheetsbar.onAddSelect();const x=n.current.sheets();a.current=x[x.length-1].name(),d()}},[]),E=e.useCallback(x=>{if(n.current){if(a.current===x.text){const g=n.current.sheets(),y=g.findIndex(D=>D.name()===x.text),b=g[y+1]||g[y-1];a.current=b?b.name():""}n.current.view.sheetsbar.onSheetRemove(x.text),d()}},[]),C=e.useCallback((x,g)=>{if(n.current){let y=x.text;const b=n.current.sheets(),D=b[g];if(!y){a.current=D.name(),d();return}if(D&&D.name()===y)return;b.find(z=>z.name()===y)&&(y=D.name()),n.current.view.sheetsbar.onSheetRename(y,g),a.current=y,d()}},[]),R=e.useCallback(x=>{if(n.current){const{prevIndex:g,nextIndex:y}=x;a.current=n.current.sheets()[g].name(),n.current.view.sheetsbar.onSheetReorderEnd({oldIndex:g,newIndex:y}),d()}},[]);return e.createElement("div",{className:"k-spreadsheet-sheets-bar k-header"},e.createElement(N.Button,{fillMode:"flat",icon:"plus",className:"k-spreadsheet-sheets-bar-add",title:L.useLocalization().toLanguageString(c.addNewSheet,I[c.addNewSheet]),svgIcon:f.plusIcon,onClick:v}),e.createElement(Zt,{sheets:o,setSheets:r,onSheetSelect:i,onSheetDelete:E,onSheetEdit:C,onSheetReorderEnd:R}))},Z=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(()=>{n.current&&n.current.saveAsExcel({...n.current.options.excel,saveAs:Ne.saveAs,Workbook:Ie.Workbook})},[]);return e.createElement(N.Button,{className:"k-toolbar-button",title:"Export...",icon:"download",fillMode:"flat",svgIcon:f.downloadIcon,onClick:o})};Z.displayName="ExcelExport";const Y=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(a=>{const s=a.target;if(s instanceof Element&&s.parentNode){const d=s.closest(".k-toolbar"),m=d&&d.querySelector(".k-upload input");m&&m.click()}},[]),r=e.useCallback(a=>{const s=a.newState;if(s[0]&&s[0].getRawFile){const d=s[0].getRawFile();n.current&&n.current.executeCommand({command:"OpenCommand",options:{file:d}})}},[]);return e.createElement(e.Fragment,null,e.createElement(N.Button,{className:"k-toolbar-button",title:L.useLocalization().toLanguageString(c.open,I[c.open]),icon:"folder-open",svgIcon:f.folderOpenIcon,fillMode:"flat",onClick:o}),e.createElement("div",{style:{display:"none"}},e.createElement(qt.Upload,{restrictions:{allowedExtensions:[".xlsx"]},onAdd:r,autoUpload:!1,defaultFiles:[],multiple:!1,accept:".xlsx,.XLSX",withCredentials:!1})))};Y.displayName="Open";const en=["Arial","Courier New","Georgia","Times New Roman","Trebuchet MS","Verdana"],tn="Arial",nn=[8,9,10,11,12,13,14,16,18,20,22,24,26,28,36,48,72],an=12,on=[{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"}],Q=t=>o=>{const{property:r,icon:a,svgIcon:s,titleKey:d}=t,{spreadsheetRef:m,value:i}=o,v=e.useCallback(()=>{if(m.current){const C={command:"PropertyChangeCommand",options:{property:r,value:!i}};m.current.executeCommand(C)}},[i]);return e.createElement(N.Button,{type:"button",icon:a,svgIcon:s,fillMode:"flat",togglable:!0,onClick:v,selected:i,title:L.useLocalization().toLanguageString(d,I[d])})},Nt=t=>o=>{const{property:r,titleKey:a,...s}=t,{spreadsheetRef:d,value:m}=o,i=e.useCallback(v=>{if(d.current){const E={command:"PropertyChangeCommand",options:{property:r,value:v.value||null}};d.current.executeCommand(E)}},[r]);return e.createElement(Jt.ColorPicker,{onChange:i,onActiveColorClick:i,fillMode:"flat",...s,title:L.useLocalization().toLanguageString(a,I[a]),value:m})},It=t=>o=>{const{spreadsheetRef:r}=o,a=e.useCallback(()=>{r.current&&r.current.workbook.undoRedoStack[t.action]()},[]);return e.createElement(N.Button,{type:"button",icon:t.icon,svgIcon:t.svgIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(t.titleKey,I[t.titleKey]),onClick:a})},ln={property:"bold",icon:"bold",svgIcon:f.boldIcon,titleKey:c.bold},ee=Q(ln);ee.displayName="Bold";const rn={property:"italic",icon:"italic",svgIcon:f.italicIcon,titleKey:c.italic},te=Q(rn);te.displayName="Italic";const sn={property:"underline",icon:"underline",svgIcon:f.underlineIcon,titleKey:c.underline},ne=Q(sn);ne.displayName="Underline";const ae=t=>{const{spreadsheetRef:n,value:o}=t,r=e.useCallback(a=>{if(n.current){const s={command:"PropertyChangeCommand",options:{property:"fontFamily",value:a.value||null}};n.current.executeCommand(s)}},[]);return e.createElement($.DropDownList,{onChange:r,value:o,data:en,defaultValue:tn,fillMode:"flat",title:L.useLocalization().toLanguageString(c.fontName,I[c.fontName]),leftRightKeysNavigation:!1})};ae.displayName="FontFamily";const oe=1,le=409,re=t=>typeof t=="string"?parseFloat(t):t,se=t=>{const{spreadsheetRef:n}=t,o=re(t.value),r=e.useCallback(a=>{var m;let s=a.value?re(a.value):o;s=isNaN(s)?o:s,s=Math.min(le,Math.max(oe,s));const d={command:"PropertyChangeCommand",options:{property:"fontSize",value:s}};a.nativeEvent.type==="keydown"||a.nativeEvent.type==="focusout"?(m=n.current)==null||m.executeCommand(d):setTimeout(()=>{var i;(i=n.current)==null||i.executeCommand(d)},0)},[o]);return e.createElement($.ComboBox,{onChange:r,value:o,data:nn,defaultValue:an,allowCustom:!0,fillMode:"flat",title:L.useLocalization().toLanguageString(c.fontSize,I[c.fontSize]),tabIndex:-1,clearButton:!1})};se.displayName="FontSize";const St=t=>{const n=o=>{const{property:r,icon:a,svgIcon:s,titleKey:d,step:m}=t,{spreadsheetRef:i}=o,v=re(o.value),E=e.useCallback(()=>{var R;const C={command:"PropertyChangeCommand",options:{property:r,value:Math.min(le,Math.max(oe,v+m))}};(R=i.current)==null||R.executeCommand(C)},[v]);return e.createElement(N.Button,{type:"button",icon:a,svgIcon:s,fillMode:"flat",onClick:E,disabled:v+m<oe||v+m>le,title:L.useLocalization().toLanguageString(d,I[d])})};return n.displayName=t.displayName,n},At=St({property:"fontSize",icon:"font-grow",svgIcon:f.fontGrowIcon,titleKey:c.fontSizeIncrease,displayName:"IncreaseFontSize",step:1}),Dt=St({property:"fontSize",icon:"font-shrink",svgIcon:f.fontShrinkIcon,titleKey:c.fontSizeDecrease,displayName:"DecreaseFontSize",step:-1}),ce=Nt({icon:"foreground-color",svgIcon:f.foregroundColorIcon,view:"palette",property:"color",titleKey:c.textColor,ariaLabel:"Text Color"});ce.displayName="TextColor";const ie=Nt({icon:"droplet",svgIcon:f.dropletIcon,view:"palette",property:"background",titleKey:c.background,ariaLabel:"Background"});ie.displayName="BackgroundColor";const H=[{icon:"align-left",svgIcon:f.alignLeftIcon,textKey:c.alignLeft,commandName:"textAlign",value:"left",selected:!1},{icon:"align-center",svgIcon:f.alignCenterIcon,textKey:c.alignCenter,commandName:"textAlign",value:"center",selected:!1},{icon:"align-right",svgIcon:f.alignRightIcon,textKey:c.alignRight,commandName:"textAlign",value:"right",selected:!1},{icon:"align-justify",svgIcon:f.alignJustifyIcon,textKey:c.alignJustify,commandName:"textAlign",value:"justify",selected:!1},{icon:"align-top",svgIcon:f.alignTopIcon,textKey:c.alignTop,commandName:"verticalAlign",value:"top",selected:!1},{icon:"align-middle",svgIcon:f.alignMiddleIcon,textKey:c.alignMiddle,commandName:"verticalAlign",value:"center",selected:!1},{icon:"align-bottom",svgIcon:f.alignBottomIcon,textKey:c.alignBottom,commandName:"verticalAlign",value:"bottom",selected:!1}],cn=[H[0],{...H[1],textKey:c.center},H[2],{...H[3],textKey:c.justify}],un=H.filter(t=>t.commandName==="verticalAlign"),Lt=t=>{const{value:n,spreadsheetRef:o}=t,{textAlign:r,verticalAlign:a}=n||{},s=L.useLocalization(),d=e.useCallback(i=>{if(o.current){const v=i.item,E={command:"PropertyChangeCommand",options:{property:v.commandName,value:v.value||null}};o.current.executeCommand(E)}},[]);let m=H.slice();return m=m.map(i=>({...i,text:s.toLanguageString(i.textKey,I[i.textKey])})),r&&(m=m.map(i=>i.commandName==="textAlign"?{...i,selected:i.value===r}:i)),a&&(m=m.map(i=>i.commandName==="verticalAlign"?{...i,selected:i.value===a}:i)),e.createElement(N.DropDownButton,{icon:"align-left",svgIcon:f.alignLeftIcon,items:m,fillMode:"flat",onItemClick:d,title:s.toLanguageString(c.align,I[c.align]),text:e.createElement(K.IconWrap,{name:"caret-alt-down",icon:f.caretAltDownIcon})})};Lt.displayName="Alignment";const dn={items:cn,icon:{icon:"align-left",svgIcon:f.alignLeftIcon},displayName:"AlignHorizontally",titleKey:c.alignHorizontally},mn={items:un,icon:{icon:"align-bottom",svgIcon:f.alignBottomIcon},displayName:"AlignVertically",titleKey:c.alignVertically},Rt=t=>{const n=o=>{const{value:r,spreadsheetRef:a}=o,s=L.useLocalization(),d=e.useCallback(E=>{if(a.current){const C=E.item,R={command:"PropertyChangeCommand",options:{property:C.commandName,value:C.value||null}};a.current.executeCommand(R)}},[]);let m=t.items.slice();m=m.map(E=>({...E,text:s.toLanguageString(E.textKey,I[E.textKey])})),m=m.map(E=>({...E,selected:E.value===r}));const i={...t.icon},v=m.find(E=>E.selected);return v&&(i.icon=v.icon,i.svgIcon=v.svgIcon),e.createElement(N.DropDownButton,{...i,items:m,fillMode:"flat",onItemClick:d,title:s.toLanguageString(t.titleKey,I[t.titleKey]),text:e.createElement(K.IconWrap,{name:"caret-alt-down",icon:f.caretAltDownIcon})})};return n.displayName=t.displayName,n},Tt=Rt(dn),Ft=Rt(mn),ue=t=>{const{value:n,spreadsheetRef:o}=t,r=e.useCallback(()=>{if(o.current){const a=o.current.activeSheet();if(a){const m={command:"TextWrapCommand",options:{property:"wrap",value:!a.range(a.activeCell()).wrap()}};o.current.executeCommand(m)}}},[]);return e.createElement(N.Button,{type:"button",togglable:!0,icon:"text-wrap",svgIcon:f.textWrapIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(c.textWrap,I[c.textWrap]),onClick:r,selected:n})};ue.displayName="TextWrap";const de=t=>{const{value:n,spreadsheetRef:o}=t,r=e.useCallback(()=>{if(o.current){const a=o.current.activeSheet();if(a){const d={command:"GridLinesChangeCommand",options:{property:"gridLines",value:!a.showGridLines()}};o.current.executeCommand(d)}}},[]);return e.createElement(N.Button,{type:"button",togglable:!0,icon:"borders-none",svgIcon:f.bordersNoneIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(c.gridLines,I[c.gridLines]),onClick:r,selected:n})};de.displayName="GridLines";const me=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(r=>{const a=r.item.value||null;setTimeout(()=>{if(n.current){const s={command:"PropertyChangeCommand",options:{property:"format",value:a}};n.current.executeCommand(s)}},0)},[]);return e.createElement(N.DropDownButton,{icon:"custom-format",svgIcon:f.customFormatIcon,fillMode:"flat",onItemClick:o,items:on,title:L.useLocalization().toLanguageString(c.format,I[c.format]),text:e.createElement(K.IconWrap,{name:"caret-alt-down"})})};me.displayName="Format";const U=t=>o=>{const{spreadsheetRef:r,value:a}=o,s=e.useCallback(()=>{if(r.current){const d={command:t.command,options:{value:t.value}};r.current.executeCommand(d)}},[]);return e.createElement(N.Button,{type:"button",icon:t.icon,svgIcon:t.svgIcon,fillMode:"flat",title:L.useLocalization().toLanguageString(t.titleKey,I[t.titleKey]),onClick:s,disabled:a&&t.disabled(a)})},pn={command:"AddColumnCommand",value:"left",icon:"table-column-insert-left",svgIcon:f.tableColumnInsertLeftIcon,titleKey:c.addColumnLeft,disabled:t=>t.allCols,displayName:"AddColumnLeft"},fn={command:"AddColumnCommand",value:"right",icon:"table-column-insert-right",svgIcon:f.tableColumnInsertRightIcon,titleKey:c.addColumnRight,disabled:t=>t.allCols,displayName:"AddColumnRight"},gn={command:"AddRowCommand",value:"below",icon:"table-row-insert-below",svgIcon:f.tableRowInsertBelowIcon,titleKey:c.addRowBelow,disabled:t=>t.allRows,displayName:"AddRowBelow"},bn={command:"AddRowCommand",value:"above",icon:"table-row-insert-above",svgIcon:f.tableRowInsertAboveIcon,titleKey:c.addRowAbove,disabled:t=>t.allRows,displayName:"AddRowAbove"},hn={command:"DeleteColumnCommand",icon:"table-column-delete",svgIcon:f.tableColumnDeleteIcon,titleKey:c.deleteColumn,disabled:t=>t.allCols,displayName:"DeleteColumn"},yn={command:"DeleteRowCommand",icon:"table-row-delete",svgIcon:f.tableRowDeleteIcon,titleKey:c.deleteRow,disabled:t=>t.allRows,displayName:"DeleteRow"},pe=U(pn),fe=U(fn),ge=U(gn),be=U(bn),he=U(hn),ye=U(yn);pe.displayName="AddColumnLeft",fe.displayName="AddColumnRight",ge.displayName="AddRowBelow",be.displayName="AddRowAbove",he.displayName="DeleteColumn",ye.displayName="DeleteRow";const Cn={action:"undo",icon:"reset",svgIcon:f.arrowRotateCcwIcon,titleKey:c.undo},Ce=It(Cn);Ce.displayName="Undo";const vn={action:"redo",icon:"reload",svgIcon:f.arrowRotateCwIcon,titleKey:c.redo},ve=It(vn);ve.displayName="Redo";const Kt=t=>o=>{const{icon:r,svgIcon:a,titleKey:s,value:d}=t,{spreadsheetRef:m}=o,i=e.useCallback(()=>{if(m.current){const v={command:"AdjustDecimalsCommand",options:{value:d}};m.current.executeCommand(v)}},[]);return e.createElement(N.Button,{type:"button",icon:r,svgIcon:a,fillMode:"flat",onClick:i,title:L.useLocalization().toLanguageString(s,I[s])})},En=Kt({icon:f.decimalIncreaseIcon.name,svgIcon:f.decimalIncreaseIcon,value:1,titleKey:c.increaseDecimal}),xn=Kt({icon:f.decimalDecreaseIcon.name,svgIcon:f.decimalDecreaseIcon,value:-1,titleKey:c.decreaseDecimal}),Ee=[{textKey:c.file,tools:[Y,Z]},{textKey:c.home,selected:!0,tools:[[Ce,ve],N.ToolbarSeparator,ae,se,At,Dt,N.ToolbarSeparator,[ee,te,ne],ce,N.ToolbarSeparator,ie,N.ToolbarSeparator,Tt,Ft,ue,N.ToolbarSeparator,de]},{textKey:c.insert,tools:[[pe,fe,ge,be],N.ToolbarSeparator,[he,ye]]},{textKey:c.formatTab,tools:[me,[xn,En]]}],zt={name:"@progress/kendo-react-spreadsheet",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:1683639393,version:"",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"},Ot=["bold","italic","underline","fontFamily","fontSize","color","background","textAlign","verticalAlign","wrap","gridLines"],Pt={Bold:t=>t.bold,Italic:t=>t.italic,Underline:t=>t.underline,FontFamily:t=>t.fontFamily,FontSize:t=>t.fontSize,IncreaseFontSize:t=>t.fontSize,DecreaseFontSize:t=>t.fontSize,TextColor:t=>t.color,BackgroundColor:t=>t.background,Alignment:t=>({textAlign:t.textAlign,verticalAlign:t.verticalAlign}),AlignHorizontally:t=>t.textAlign,AlignVertically:t=>t.verticalAlign,TextWrap:t=>t.wrap,GridLines:t=>t.gridLines,AddColumnLeft:t=>t.selectedHeaders,AddColumnRight:t=>t.selectedHeaders,AddRowBelow:t=>t.selectedHeaders,AddRowAbove:t=>t.selectedHeaders,DeleteColumn:t=>t.selectedHeaders,DeleteRow:t=>t.selectedHeaders},Mt=":not(.k-dropdownlist button):not(.k-combobox button):not(.k-upload-button):not(.k-colorpicker button):not(.k-split-button .k-split-button-arrow)",wn=["button"+Mt,".k-button-group > button"+Mt,".k-dropdownlist",".k-combobox",".k-colorpicker"],xe=e.forwardRef((t,n)=>{K.validatePackage(zt);const o=K.shouldShowValidationUI(zt),{toolbar:r=Ee}=t,a=[];typeof r=="boolean"?a.push(...r?Ee:[]):a.push(...r);const[s,d]=e.useState(null),[m,i]=e.useState(a.findIndex(u=>u.selected)||0),[v,E]=e.useState(!1),C=e.useRef(null),R=e.useRef(null),x=e.useRef(null),g=e.useRef(null),y=e.useRef(null),[b,D]=e.useState({}),z=e.useRef({});z.current=b;const p=e.useRef({});p.current=t;const k=L.useLocalization(),P=e.useCallback(u=>{p.current.onSelect&&p.current.onSelect.call(void 0,u)},[]),w=e.useCallback(u=>{p.current.onChange&&p.current.onChange.call(void 0,u)},[]),T=e.useCallback(u=>{p.current.onChangeFormat&&p.current.onChangeFormat.call(void 0,u)},[]),M=e.useCallback(u=>{p.current.onExcelImport&&p.current.onExcelImport.call(void 0,u)},[]),F=e.useCallback(u=>{p.current.onExcelExport&&p.current.onExcelExport.call(void 0,u)},[]),W=e.useRef(null);e.useImperativeHandle(W,()=>({element:C.current,get instance(){return y.current},props:t,get view(){return y.current.view},get workbook(){return y.current.workbook},executeCommand(u){var h;(h=y.current)==null||h.executeCommand(u)},fromJSON(u){var h;return(h=y.current)==null?void 0:h.fromJSON(u)},toJSON(){return y.current.toJSON()},saveJSON(){return y.current.saveJSON()},fromFile(u){return y.current.fromFile(u)},saveAsExcel(u){var h;(h=y.current)==null||h.saveAsExcel({...y.current.options.excel,saveAs:Ne.saveAs,Workbook:Ie.Workbook,...u})},activeSheet(u){var h;return(h=y.current)==null?void 0:h.activeSheet(u)},sheets(){return y.current.sheets()},refresh(){var u;return(u=y.current)==null?void 0:u.refresh()}}),[t]),e.useImperativeHandle(n,()=>W.current);const Nn=e.useCallback(()=>y.current&&y.current.view.nameEditor,[]),Bt=e.useCallback(u=>{const h={};Ot.forEach(A=>{typeof u.range[A]=="function"?h[A]=u.range[A]():A==="gridLines"&&(h[A]=u.range.sheet().showGridLines())}),h.selectedHeaders=u.range.sheet().selectedHeaders(),(Ot.some(A=>h[A]!==z.current[A])||h.selectedHeaders.allCols!==z.current.selectedHeaders.allCols||h.selectedHeaders.allRows!==z.current.selectedHeaders.allRows)&&D(h)},[]),In=e.useCallback(u=>{const h=u.name,A=c[h];d({title:u.title==="Error"?k.toLanguageString(c.error,I[c.error]||u.title):u.title,message:A?k.toLanguageString(A,I[A]||u.text):u.text,close:u.close})},[]),jt=e.useCallback(()=>{d(null),s==null||s.close()},[s]),_=L.useInternationalization(),Ht=L.useLocalization();e.useEffect(()=>{var q;const u={...t.defaultProps,sheets:structuredClone((q=t.defaultProps)==null?void 0:q.sheets),messages:{workbook:{defaultSheetName:Ht.toLanguageString(c.defaultSheetName,I[c.defaultSheetName])}},intl:{localeInfo:()=>_.localeInfo(),localeCurrency:()=>_.localeCurrency(),parseDate:(B,j)=>_.parseDate(B,j),toString:(B,j)=>_.toString(B,j),format:(B,...j)=>_.format(B,...j)},formulaBarInputRef:R,formulaCellInputRef:x,nameBoxRef:g},h=new S.SpreadsheetWidget(C.current,u);y.current=h,h.bind("select",P),h.bind("change",w),h.bind("changeFormat",T),h.bind("excelImport",M),h.bind("excelExport",F),h.view.bind("update",Bt),h.view.bind("message",In);const A=h.activeSheet();return A&&Bt({range:A.range(A.activeCell())}),E(!0),()=>{h.destroy()}},[]);const Ut=e.useCallback((u,h)=>{const A=e.createElement(u,{spreadsheetRef:y,value:Pt[u.displayName]?Pt[u.displayName](b):void 0,key:h});return A.type===N.ToolbarSeparator?e.createElement(u,{key:h}):A},[b]);let Wt=null;return a.length&&(Wt=e.createElement(we.TabStrip,{selected:m,animation:!1,className:"k-floatwrap k-spreadsheet-tabstrip",style:{minHeight:"auto"},onSelect:u=>i(u.selected)},a.map(u=>{const h=u.textKey?Ht.toLanguageString(u.textKey,I[u.textKey]):u.text;return e.createElement(we.TabStripTab,{key:u.textKey||u.text,title:h},e.createElement(N.Toolbar,{buttons:wn,className:"k-spreadsheet-toolbar"},u.tools.map((A,q)=>Array.isArray(A)?e.createElement(N.ButtonGroup,{key:q},A.map((B,j)=>Ut(B,j))):Ut(A,q))))}))),e.createElement("div",{ref:C,style:t.style,className:K.classNames("k-widget k-spreadsheet",t.className),role:"application"},Wt,e.createElement("div",{className:"k-spreadsheet-action-bar"},e.createElement(X,{ref:g,nameEditor:Nn}),e.createElement("div",{className:"k-spreadsheet-formula-bar"},e.createElement(K.IconWrap,{name:"formula-fx",icon:f.formulaFxIcon}),e.createElement(J,{ref:R}))),e.createElement("div",{className:"k-spreadsheet-view"},e.createElement("div",{className:"k-spreadsheet-fixed-container"}),e.createElement("div",{className:"k-spreadsheet-scroller"},e.createElement("div",{className:"k-spreadsheet-view-size"})),e.createElement("div",{tabIndex:0,className:"k-spreadsheet-clipboard",contentEditable:"true"}),e.createElement(J,{ref:x,className:"k-spreadsheet-cell-editor"})),e.createElement(Qt,{spreadsheetRef:y}),s&&e.createElement(ke.Dialog,{title:s.title,onClose:jt},e.createElement("div",null,s.message),e.createElement(ke.DialogActionsBar,{layout:"start"},e.createElement(N.Button,{themeColor:"primary",onClick:jt,autoFocus:!0},k.toLanguageString(c.ok,I[c.ok])))),o&&e.createElement(K.WatermarkOverlay,null))});xe.displayName="KendoReactSpreadsheet",xe.propTypes={className:O.string,defaultProps:O.any,toolbar:O.oneOfType([O.bool,O.arrayOf(O.any)]),style:O.object,onSelect:O.func,onChange:O.func,onChangeFormat:O.func,onExcelImport:O.func,onExcelExport:O.func};const kn=t=>{const{spreadsheetRef:n}=t,o=e.useCallback(()=>{n.current&&n.current.executeCommand({command:"PropertyCleanCommand"})},[]);return e.createElement(N.Button,{type:"button",icon:"clean-css",svgIcon:f.clearCssIcon,fillMode:"flat",onClick:o,title:L.useLocalization().toLanguageString(c.cleanFormatting,I[c.cleanFormatting])})};Object.defineProperty(l,"CalcError",{enumerable:!0,get:()=>S.CalcError}),Object.defineProperty(l,"CellRef",{enumerable:!0,get:()=>S.CellRef}),Object.defineProperty(l,"Context",{enumerable:!0,get:()=>S.Context}),Object.defineProperty(l,"Matrix",{enumerable:!0,get:()=>S.Matrix}),Object.defineProperty(l,"NULLREF",{enumerable:!0,get:()=>S.NULLREF}),Object.defineProperty(l,"NameRef",{enumerable:!0,get:()=>S.NameRef}),Object.defineProperty(l,"Range",{enumerable:!0,get:()=>S.Range}),Object.defineProperty(l,"RangeRef",{enumerable:!0,get:()=>S.RangeRef}),Object.defineProperty(l,"Ref",{enumerable:!0,get:()=>S.Ref}),Object.defineProperty(l,"Sheet",{enumerable:!0,get:()=>S.Sheet}),Object.defineProperty(l,"SpreadsheetWidget",{enumerable:!0,get:()=>S.SpreadsheetWidget}),Object.defineProperty(l,"UnionRef",{enumerable:!0,get:()=>S.UnionRef}),Object.defineProperty(l,"View",{enumerable:!0,get:()=>S.View}),Object.defineProperty(l,"Workbook",{enumerable:!0,get:()=>S.Workbook}),Object.defineProperty(l,"dateToSerial",{enumerable:!0,get:()=>S.dateToSerial}),Object.defineProperty(l,"defineAlias",{enumerable:!0,get:()=>S.defineAlias}),Object.defineProperty(l,"defineFunction",{enumerable:!0,get:()=>S.defineFunction}),Object.defineProperty(l,"packDate",{enumerable:!0,get:()=>S.packDate}),Object.defineProperty(l,"packTime",{enumerable:!0,get:()=>S.packTime}),Object.defineProperty(l,"serialToDate",{enumerable:!0,get:()=>S.serialToDate}),Object.defineProperty(l,"unpackDate",{enumerable:!0,get:()=>S.unpackDate}),Object.defineProperty(l,"unpackTime",{enumerable:!0,get:()=>S.unpackTime}),l.AddColumnLeft=pe,l.AddColumnRight=fe,l.AddRowAbove=be,l.AddRowBelow=ge,l.AlignHorizontally=Tt,l.AlignVertically=Ft,l.Alignment=Lt,l.BackgroundColor=ie,l.Bold=ee,l.CleanFormatting=kn,l.DecreaseFontSize=Dt,l.DeleteColumn=he,l.DeleteRow=ye,l.ExcelExport=Z,l.FontFamily=ae,l.FontSize=se,l.Format=me,l.GridLines=de,l.IncreaseFontSize=At,l.Italic=te,l.Open=Y,l.Redo=ve,l.Spreadsheet=xe,l.TextColor=ce,l.TextWrap=ue,l.Underline=ne,l.Undo=Ce,l.defaultTabs=Ee,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/index.mjs
CHANGED
|
@@ -1086,7 +1086,7 @@ const Ut = (t) => (a) => {
|
|
|
1086
1086
|
name: "@progress/kendo-react-spreadsheet",
|
|
1087
1087
|
productName: "KendoReact",
|
|
1088
1088
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
1089
|
-
publishDate:
|
|
1089
|
+
publishDate: 1706107108,
|
|
1090
1090
|
version: "",
|
|
1091
1091
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
1092
1092
|
}, ie = ["bold", "italic", "underline", "fontFamily", "fontSize", "color", "background", "textAlign", "verticalAlign", "wrap", "gridLines"], de = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-spreadsheet",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0-develop.10",
|
|
4
4
|
"description": "KendoReact Spreadsheet package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@progress/kendo-file-saver": "^1.1.1",
|
|
30
30
|
"@progress/kendo-licensing": "^1.3.4",
|
|
31
31
|
"@progress/kendo-ooxml": "^1.7.0",
|
|
32
|
-
"@progress/kendo-react-buttons": "7.0
|
|
33
|
-
"@progress/kendo-react-common": "7.0
|
|
34
|
-
"@progress/kendo-react-dialogs": "7.0
|
|
35
|
-
"@progress/kendo-react-dropdowns": "7.0
|
|
36
|
-
"@progress/kendo-react-inputs": "7.0
|
|
37
|
-
"@progress/kendo-react-intl": "7.0
|
|
38
|
-
"@progress/kendo-react-layout": "7.0
|
|
39
|
-
"@progress/kendo-react-popup": "7.0
|
|
40
|
-
"@progress/kendo-react-sortable": "7.0
|
|
41
|
-
"@progress/kendo-react-upload": "7.0
|
|
32
|
+
"@progress/kendo-react-buttons": "7.1.0-develop.10",
|
|
33
|
+
"@progress/kendo-react-common": "7.1.0-develop.10",
|
|
34
|
+
"@progress/kendo-react-dialogs": "7.1.0-develop.10",
|
|
35
|
+
"@progress/kendo-react-dropdowns": "7.1.0-develop.10",
|
|
36
|
+
"@progress/kendo-react-inputs": "7.1.0-develop.10",
|
|
37
|
+
"@progress/kendo-react-intl": "7.1.0-develop.10",
|
|
38
|
+
"@progress/kendo-react-layout": "7.1.0-develop.10",
|
|
39
|
+
"@progress/kendo-react-popup": "7.1.0-develop.10",
|
|
40
|
+
"@progress/kendo-react-sortable": "7.1.0-develop.10",
|
|
41
|
+
"@progress/kendo-react-upload": "7.1.0-develop.10",
|
|
42
42
|
"@progress/kendo-spreadsheet-common": "v1.1.1",
|
|
43
43
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
44
44
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|