@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 22.9 kB
JavaScript
module.exports=function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}({0:function(e,t,i){i(1496),e.exports=i(1496)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},19:function(e,t){e.exports=require("../kendo.core")},1496:function(e,t,i){var o,n,r;!function(s,define){n=[i(19)],o=s,r="function"==typeof o?o.apply(t,n):o,!(void 0!==r&&(e.exports=r))}(function(){!function(e){"use strict";function t(e){return e.map(function(e){return'[data-action="'+e+'"]'}).join(",")}var i,o,n,r,s,a,c,h,l,d,u,p,m,f,v,g,w;if(!(e.support.browser.msie&&e.support.browser.version<9)){i=e.jQuery,o=/:alphanum$/,n={up:"up",down:"down",left:"left",right:"right",home:"first-col","ctrl+left":"first-col",end:"last-col","ctrl+right":"last-col","ctrl+up":"first-row","ctrl+down":"last-row","ctrl+home":"first","ctrl+end":"last",pageup:"prev-page",pagedown:"next-page"},r={tab:"next","shift+tab":"previous",enter:"lower","shift+enter":"upper","delete":"clearContents",backspace:"clearContents","shift+:alphanum":"edit","alt+:alphanum":"edit",":alphanum":"edit","ctrl+:alphanum":"ctrl","alt+ctrl+:alphanum":"edit",":edit":"edit"},s={wheel:"onWheel","*+mousedown":"onMouseDown",contextmenu:"onContextMenu","*+mousedrag":"onMouseDrag","*+mouseup":"onMouseUp","*+dblclick":"onDblClick",mousemove:"onMouseMove",touchmove:"onTouchMove",touchend:"onTouchEnd"},a={pageup:"onPageUp",pagedown:"onPageDown",mouseup:"onMouseUp","*+cut":"onCut","*+paste":"onPaste","*+copy":"onCopy"},c={esc:"onEditorEsc",enter:"onEditorBlur","alt+enter":"insertNewline","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"onEditorBlur","shift+ctrl+enter":"onEditorArrayFormula"},h=i.extend({focus:"onEditorBarFocus"},c),l=i.extend({focus:"onEditorCellFocus"},c),d={cell:"range",rowheader:"row",columnheader:"column",topcorner:"sheet",autofill:"autofill"},u=t(["cut","copy","paste","insert-left","insert-right","insert-above","insert-below"]),p=t(["unhide-row","unhide-column"]),m=[],f=[],v=[];for(g in n)m.push(g),f.push("shift+"+g);for(g in r)v.push(g);a[m]="onAction",a[f]="onShiftAction",a[v]="onEntryAction",l[m]="onEditorAction",l[f]="onEditorShiftAction",w=e.Class.extend({init:function(t,o){this.view=t,this.workbook(o),this.container=i(t.container),this.clipboardElement=i(t.clipboard),this.cellContextMenu=t.cellContextMenu,this.rowHeaderContextMenu=t.rowHeaderContextMenu,this.colHeaderContextMenu=t.colHeaderContextMenu,this.drawingContextMenu=t.drawingContextMenu,this.scroller=t.scroller,this.tabstrip=t.tabstrip,this.sheetsbar=t.sheetsbar,t.nameEditor.bind("enter",this.onNameEditorEnter.bind(this)),t.nameEditor.bind("cancel",this.onNameEditorCancel.bind(this)),t.nameEditor.bind("select",this.onNameEditorSelect.bind(this)),t.nameEditor.bind("delete",this.onNameEditorDelete.bind(this)),this.editor=t.editor,this.editor.bind("change",this.onEditorChange.bind(this)),this.editor.bind("activate",this.onEditorActivate.bind(this)),this.editor.bind("deactivate",this.onEditorDeactivate.bind(this)),this.editor.bind("update",this.onEditorUpdate.bind(this)),i(t.scroller).on("scroll",this.onScroll.bind(this)),this.listener=new e.spreadsheet.EventListener(this.container,this,s),this._enableEditorEvents(),this.sheetsbar&&(this.sheetsbar.bind("select",this.onSheetBarSelect.bind(this)),this.sheetsbar.bind("reorder",this.onSheetBarReorder.bind(this)),this.sheetsbar.bind("rename",this.onSheetBarRename.bind(this)),this.sheetsbar.bind("remove",this.onSheetBarRemove.bind(this))),this.cellContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.rowHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.colHeaderContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.drawingContextMenu.bind("select",this.onContextMenuSelect.bind(this)),this.cellContextMenu.element.add(this.rowHeaderContextMenu.element).add(this.colHeaderContextMenu.element).add(this.drawingContextMenu.element).on("contextmenu",!1),this.tabstrip&&(this.tabstrip.bind("action",this.onCommandRequest.bind(this)),this.tabstrip.bind("dialog",this.onDialogRequest.bind(this)))},_enableEditorEvents:function(t){void 0===t||t?(this.keyListener=new e.spreadsheet.EventListener(this.clipboardElement,this,a),this.barKeyListener=new e.spreadsheet.EventListener(this.editor.barElement(),this,h),this.inputKeyListener=new e.spreadsheet.EventListener(this.editor.cellElement(),this,l)):(this.keyListener.destroy(),this.barKeyListener.destroy(),this.inputKeyListener.destroy())},_execute:function(e){var t=this._workbook.execute(e);return"EditCommand"!==e.command||t||this._workbook.trigger("change",{editorClose:!0}),t&&(this._preventNavigation=!0,"error"===t.reason?(this.editor.deactivate(!0),this.view.showError(t,function(){this.activateEditor(!1),this.editor.value(this._lastEditorValue),this.editor._value=this._workbook._inputForRef(this._workbook.activeSheet()._viewActiveCell()),this.editor.select()}.bind(this))):this.view.openDialog(t.reason)),t},_activeTooltip:function(){return""+this._workbook.activeSheet().activeCell().simplify()},onContextMenuSelect:function(e){var t,o=i(e.item).data("action");switch(o){case"cut":t={command:"ToolbarCutCommand",options:{workbook:this._workbook}};break;case"copy":t={command:"ToolbarCopyCommand",options:{workbook:this._workbook}};break;case"paste":t={command:"ToolbarPasteCommand",options:{workbook:this._workbook}};break;case"delete-drawing":t={command:"DeleteDrawingCommand",options:{drawing:this.navigator._sheet._activeDrawing}};break;case"bring-to-front":t={command:"BringToFrontCommand",options:{drawing:this.navigator._sheet._activeDrawing}};break;case"send-to-back":t={command:"SendToBackCommand",options:{drawing:this.navigator._sheet._activeDrawing}};break;case"unmerge":t={command:"MergeCellCommand",options:{value:"unmerge"}};break;case"merge":this.view.openDialog("merge");break;case"hide-row":t={command:"HideLineCommand",options:{axis:"row"}};break;case"hide-column":t={command:"HideLineCommand",options:{axis:"column"}};break;case"unhide-row":t={command:"UnHideLineCommand",options:{axis:"row"}};break;case"unhide-column":t={command:"UnHideLineCommand",options:{axis:"column"}};break;case"delete-row":t={command:"DeleteRowCommand"};break;case"delete-column":t={command:"DeleteColumnCommand"}}t&&this._execute(t)},onSheetBarRemove:function(e){var t=this._workbook.sheetByName(e.name);t&&this._workbook.removeSheet(t)},destroy:function(){this.listener.destroy(),this._enableEditorEvents(!1),this.keyListener.destroy(),this.inputKeyListener.destroy()},onSheetBarSelect:function(e){var t,i=this._workbook;if(e.isAddButton){if(this._workbook.trigger("insertSheet"))return;t=i.insertSheet()}else t=i.sheetByName(e.name);if(i.activeSheet().name()!==t.name()){if(this._workbook.trigger("selectSheet",{sheet:t}))return;this.editor.canInsertRef(!1)||this.editor.deactivate(),i.activeSheet(t)}},onSheetBarReorder:function(e){var t=this._workbook.sheetByIndex(e.oldIndex);this._workbook.moveSheetToIndex(t,e.newIndex),this._workbook.activeSheet(t)},onSheetBarRename:function(e){var t=this._workbook.sheetByIndex(e.sheetIndex);return this._workbook.sheetByName(e.name)?void this.view.showError({reason:"error",type:"duplicateSheetName"}):(this._workbook.renameSheet(t,e.name),void this.clipboardElement.focus())},sheet:function(e){this.navigator=e.navigator(),this.axisManager=e.axisManager()},workbook:function(e){this._workbook=e,this.clipboard=e.clipboard(),e.bind("commandRequest",this.onCommandRequest.bind(this))},refresh:function(){var e,t,i=this.editor,o=this._workbook,n=o.activeSheet();this._viewPortHeight=this.view.scroller.clientHeight,this.navigator.height(this._viewPortHeight),i.isActive()||this.isEditorDisabled||(i.enable(n.selection().enable()!==!1),this.resetEditorValue()),e=n.selection()._ref.simplify(),t=this._workbook.nameForRef(e,n.name()),this.view.nameEditor.value(t.name)},onScroll:function(){this.view.render({scroll:!0})},onWheel:function(e){var t=e.originalEvent.deltaX,i=e.originalEvent.deltaY;1===e.originalEvent.deltaMode&&(t*=10,i*=10),this.scrollWith(t,i),e.preventDefault()},onTouchMove:function(){this.view.forceScrollerStackingOrder(2)},onTouchEnd:function(){this.view.forceScrollerStackingOrder(1)},onAction:function(e,t){var i=this._workbook.activeSheet();i._activeDrawing=null,this.navigator.moveActiveCell(n[t]),e.preventDefault()},onPageUp:function(){this.scrollDown(-this._viewPortHeight)},onPageDown:function(){this.scrollDown(this._viewPortHeight)},onEntryAction:function(e,t){var i,n,s,a,c=this._workbook.activeSheet();if(e.mod){switch(i=!0,n=String.fromCharCode(e.keyCode)){case"A":c._activeDrawing=null,this.navigator.selectAll();break;case"Y":this._workbook.undoRedoStack.redo();break;case"Z":this._workbook.undoRedoStack.undo();break;default:i=!1}i&&e.preventDefault()}else if(s=c.selection().enable()===!1,a=":edit"!==t,"delete"==t||"backspace"==t)c._activeDrawing?this._execute({command:"DeleteDrawingCommand",options:{drawing:c._activeDrawing}}):s||this._execute({command:"ClearContentCommand"}),e.preventDefault();else if(o.test(t)||!a){if(c._activeDrawing=null,s)return void e.preventDefault();a&&this.editor.value(""),this.activateEditor(a)}else this.navigator.navigateInSelection(r[t]),e.preventDefault()},onShiftAction:function(e,t){this.navigator.modifySelection(n[t.replace("shift+","")],this.appendSelection),e.preventDefault()},onMouseMove:function(e){var t,i=this._workbook.activeSheet();i.resizingInProgress()||i.selectionInProgress()||(t=this.objectAt(e),"columnresizehandle"===t.type||"rowresizehandle"===t.type?i.positionResizeHandle(t.ref):i.removeResizeHandle(),i._renderComment("cell"==t.type?t.ref:null))},onMouseDown:function(t){var i,o,n=this.objectAt(t);if(n.pane&&(this.originFrame=n.pane),this._startResizingDrawing(t,n))return void t.stopPropagation();if(i=this._workbook.activeSheet(),o=this.container.closest('[data-role="window"]'),o.length&&(o=e.widgetInstance(o),o&&o.options.modal&&t.stopPropagation()),i._activeDrawing=null,"drawing"===n.type)return i._activeDrawing=n.drawing,n.copy=n.drawing.clone(),n.startBox=i.drawingBoundingBox(n.copy),i.startDragging(n),i.triggerChange({dragging:!0}),void t.preventDefault();if("editor"===n.type)return this.onEditorEsc(),this.openCustomEditor(),void t.preventDefault();if(this.editor.canInsertRef(!1)&&n.ref)return this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs()),this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,t.shiftKey),void t.preventDefault();if(this._preventNavigation=!1,this.editor.deactivate(),!this._preventNavigation){if("columnresizehandle"===n.type||"rowresizehandle"===n.type)return i.startResizing({x:n.x,y:n.y}),void t.preventDefault();if("filtericon"===n.type)return this.openFilterMenu(t),void t.preventDefault();this._selectionMode=d[n.type],this.appendSelection=t.mod,this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,t.shiftKey)}},_startResizingDrawing:function(e){var t,o,n,r,s=i(e.target).closest(".k-spreadsheet-drawing-handle");if(s.length)return t=this.translateCoords(e),o=s.data("direction"),n=this._workbook.activeSheet(),r=n._activeDrawing,n.startDragging({pane:this.originFrame,drawing:r,copy:r.clone(),startBox:n.drawingBoundingBox(r),resize:o,startX:t.x,startY:t.y}),!0},onContextMenu:function(t){var i,o,n,r,s,a=this._workbook.activeSheet();t.preventDefault(),a.resizingInProgress()||a.draggingInProgress()||(this.cellContextMenu.close(),this.colHeaderContextMenu.close(),this.rowHeaderContextMenu.close(),this.drawingContextMenu.close(),o=this.objectAt(t),"columnresizehandle"!==o.type&&"rowresizehandle"!==o.type&&(o.ref?this.navigator.selectForContextMenu(o.ref,d[o.type]):"drawing"==o.type&&this.navigator.selectDrawingForContextMenu(o.drawing),n=this.navigator._sheet.select()instanceof e.spreadsheet.UnionRef,r=!1,s=!1,"columnheader"==o.type?(i=this.colHeaderContextMenu,r=!n&&this.axisManager.selectionIncludesHiddenColumns()):"rowheader"==o.type?(i=this.rowHeaderContextMenu,r=!n&&this.axisManager.selectionIncludesHiddenRows()):"drawing"==o.type?i=this.drawingContextMenu:(i=this.cellContextMenu,s=this.navigator.selectionIncludesMergedCells()),i.element.find(u).toggle(!n),i.element.find(p).toggle(r),i.element.find("[data-action=unmerge]").toggle(s),setTimeout(function(){i.open(t.pageX,t.pageY)})))},prevent:function(e){e.preventDefault()},constrainResize:function(e,t){var i=this._workbook.activeSheet(),o=i.resizeHandlePosition();return!o||"outside"===e||"topcorner"===e||t.col<o.col||t.row<o.row},_dragDrawing:function(e){var t,i,o,n,r=this._workbook.activeSheet(),s=r.draggingInProgress();return!!s&&(t=this.translateCoords(e),i=s.drawing,o=t.x-s.startX,n=t.y-s.startY,"SE"==s.resize?s.aspect?Math.abs(o)>Math.abs(n)?(i.width=Math.max(s.copy.width+o,20),i.height=i.width/s.aspect):(i.height=Math.max(s.copy.height+n,20),i.width=i.height*s.aspect):(i.width=Math.max(s.copy.width+o,20),i.height=Math.max(s.copy.height+n,20)):"E"==s.resize?i.width=Math.max(s.copy.width+o,20):"S"==s.resize?i.height=Math.max(s.copy.height+n,20):"N"==s.resize?s.copy.height-n>20&&(i.height=s.copy.height-n,i.offsetY=s.copy.offsetY+n):"W"==s.resize?s.copy.width-o>20&&(i.width=s.copy.width-o,i.offsetX=s.copy.offsetX+o):"NE"==s.resize?(i.width=Math.max(s.copy.width+o,20),s.copy.height-n>20&&(i.height=s.copy.height-n,i.offsetY=s.copy.offsetY+n)):"SW"==s.resize?(i.height=Math.max(s.copy.height+n,20),s.copy.width-o>20&&(i.width=s.copy.width-o,i.offsetX=s.copy.offsetX+o)):"NW"==s.resize?(s.copy.height-n>20&&(i.height=s.copy.height-n,i.offsetY=s.copy.offsetY+n),s.copy.width-o>20&&(i.width=s.copy.width-o,i.offsetX=s.copy.offsetX+o)):(i.offsetX=s.copy.offsetX+o,i.offsetY=s.copy.offsetY+n),r.triggerChange({dragging:!0}),!0)},onMouseDrag:function(e){var t,i,o,n;if("sheet"!==this._selectionMode&&(t={clientX:e.clientX,clientY:e.clientY},i=this._workbook.activeSheet(),!this._dragDrawing(e))){if(o=this.objectAt(t),i.resizingInProgress())return void(this.constrainResize(o.type,o.ref)||i.resizeHintPosition({x:o.x,y:o.y}));if("outside"===o.type)return void this.startAutoScroll(o);this.originFrame===o.pane?this.selectToLocation(t):(n=this.originFrame._grid,o.x>n.right&&this.scrollLeft(),o.y>n.bottom&&this.scrollTop(),o.y<n.top||o.x<n.left?this.startAutoScroll(o,t):this.selectToLocation(t)),e.preventDefault()}},onMouseUp:function(e){var t,i,o,n=this._workbook.activeSheet();if(n.completeResizing(),n.completeDragging(),this.navigator.completeSelection(),this.stopAutoScroll(),t=this.editor.activeEditor()){for(i=e.target;i;){if(i===t.element[0])return;i=i.parentNode}o=this.objectAt(e),o&&o.ref&&t.canInsertRef(!1)&&(t.refAtPoint(n),n._setFormulaSelections(t.highlightedRefs()))}},onDblClick:function(e){var t,i=this.objectAt(e),o=this._workbook.activeSheet().selection().enable()===!1;"cell"!==i.type||o||(t=this._workbook.activeSheet().selection(),this.activateEditor(!t.value()&&!t.formula()),this.onEditorUpdate())},onCut:function(e){if(e){var t=this.clipboardElement.find("table.kendo-clipboard-"+this.clipboard._uid).detach();this.clipboardElement.append(t.clone(!1)),setTimeout(function(){this.clipboardElement.empty().append(t)}.bind(this))}this._execute({command:"CutCommand",options:{workbook:this.view._workbook,event:e.originalEvent||e}})},clipBoardValue:function(){return this.clipboardElement.html()},_pasteImage:function(e){var t=this,i=e.getAsFile(),o=new window.Image;o.src=window.URL.createObjectURL(i),o.onload=function(){t._execute({command:"InsertImageCommand",options:{blob:i,width:o.width,height:o.height}})},setTimeout(function(){window.URL.revokeObjectURL(o.src)},10)},onPaste:function(t){var i,o,n,r,s,a,c=this,h="",l="";if(c.clipboard.menuInvoked=void 0===t,t){if(i=t.originalEvent.clipboardData,!i||!i.getData)return a=c.clipboardElement.find("table.kendo-clipboard-"+c.clipboard._uid).detach(),c.clipboardElement.empty(),void setTimeout(function(){var e=c.clipboardElement.html(),i=window.clipboardData.getData("Text").trim();(e||i)&&(c.clipboard.external({html:e,plain:i}),c.clipboardElement.empty().append(a),c._execute({command:"PasteCommand",options:{workbook:c.view._workbook,event:t.originalEvent||t}}),c.clipboard.menuInvoked=!0)});if(t.preventDefault(),o=!1,n=!1,window.DOMStringList&&i.types instanceof window.DOMStringList?(o=i.types.contains("text/html"),n=i.types.contains("text/plain")):(o=/text\/html/.test(i.types),n=/text\/plain/.test(i.types)),o&&(h=i.getData("text/html")),n&&(l=i.getData("text/plain").trim()),!o&&!n&&i.items&&i.items.length)for(r=0;r<i.items.length;++r)if(s=i.items[r],"file"==s.kind&&/^image\/(?:png|jpe?g|gif)$/i.test(s.type))return c._pasteImage(s)}else{if(e.support.browser.msie)return c.clipboardElement.focus().select(),void document.execCommand("paste");c.clipboard.menuInvoked=!0}(h||l)&&(c.clipboard.external({html:h,plain:l}),c._execute({command:"PasteCommand",options:{workbook:c.view._workbook,event:t.originalEvent||t}}))},onCopy:function(e){this.clipboard.menuInvoked=void 0===e,this._execute({command:"CopyCommand",options:{workbook:this.view._workbook,event:e.originalEvent||e}})},scrollTop:function(){this.scroller.scrollTop=0},scrollLeft:function(){this.scroller.scrollLeft=0},scrollDown:function(e){this.scroller.scrollTop+=e},scrollRight:function(e){this.scroller.scrollLeft+=e},scrollWith:function(e,t){this.scroller.scrollTop+=t,this.scroller.scrollLeft+=e},translateCoords:function(e){var t=this.container[0].getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},objectAt:function(e,t){if(e)return e=this.translateCoords(e),this.view.objectAt(e.x,e.y,t)},selectToLocation:function(e){var t=this.objectAt(e,!0);t.pane&&t.ref&&(this.extendSelection(t),this.lastKnownCellLocation=e,this.originFrame=t.pane),this.stopAutoScroll()},extendSelection:function(e){this.navigator.extendSelection(e.ref,this._selectionMode,this.appendSelection)},autoScroll:function(){var e=this._autoScrollTarget.x,t=this._autoScrollTarget.y,i=this.originFrame._grid,o=this.view.scroller,n=8,r=o.scrollLeft,s=o.scrollTop;e<i.left&&this.scrollRight(-n),e>i.right&&this.scrollRight(n),t<i.top&&this.scrollDown(-n),t>i.bottom&&this.scrollDown(n),s===o.scrollTop&&r===o.scrollLeft?this.selectToLocation(this.finalLocation):this.extendSelection(this.objectAt(this.lastKnownCellLocation))},startAutoScroll:function(e,t){this._scrollInterval||(this._scrollInterval=setInterval(this.autoScroll.bind(this),50)),this.finalLocation=t||this.lastKnownCellLocation,this._autoScrollTarget=e},stopAutoScroll:function(){clearInterval(this._scrollInterval),this._scrollInterval=null},openCustomEditor:function(){this.view.openCustomEditor()},openFilterMenu:function(e){var t=this.objectAt(e),i=this._workbook.activeSheet(),o=i.filterColumn(t.ref),n=this.view.createFilterMenu(o);n.bind("action",this.onCommandRequest.bind(this)),n.bind("action",n.close.bind(n)),n.openFor(e.target)},_saveEditorValue:function(e){var t=this.editor._range.sheet(),i=this.editor.value();this._workbook.activeSheet()!==t&&(this._workbook.activeSheet()._setFormulaSelections(),this._workbook.activeSheet(t)),t.isInEditMode(!1),this._lastEditorValue=i,this._execute({command:"EditCommand",options:{value:i,arrayFormula:e}})},onEditorChange:function(){this._saveEditorValue(!1)},onEditorArrayFormula:function(){this._saveEditorValue(!0),this.editor.deactivate(!0)},onEditorActivate:function(){var e=this._workbook,t=e.activeSheet();t._setFormulaSelections(this.editor.highlightedRefs()),t.isInEditMode(!0)},onEditorDeactivate:function(){var e=this._workbook.activeSheet();e.isInEditMode(!1),e._setFormulaSelections([])},onEditorUpdate:function(){this._workbook.activeSheet()._setFormulaSelections(this.editor.highlightedRefs())},onEditorBarFocus:function(){var e=this._workbook.activeSheet().selection().enable()===!1;e||this.editor.activate({range:this._workbook.activeSheet().selection(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()})},onEditorCellFocus:function(){this.editor.scale()},onEditorEsc:function(){this.resetEditorValue(),this.editor.deactivate(),this.clipboardElement.focus()},insertNewline:function(e){e.preventDefault(),this.editor.insertNewline()},onEditorBlur:function(e,t){this.editor.isFiltered()||(this._preventNavigation=!1,this.editor.deactivate(),this._preventNavigation||(this.clipboardElement.focus(),this.navigator.navigateInSelection(r[t])))},onEditorAction:function(e,t){var i=this.editor,o=this._workbook.activeSheet();this._casualEditing&&/^(?:up|right|down|left)$/.test(t)?(this.deactivateEditor(),this.navigator.moveActiveCell(n[t]),e.preventDefault()):i.canInsertRef(!0)&&(this.navigator.moveActiveCell(n[t]),i.activeEditor().refAtPoint(o),o._setFormulaSelections(i.highlightedRefs()),e.preventDefault())},onEditorShiftAction:function(e,t){var i=this.editor,o=this._workbook.activeSheet();i.canInsertRef(!0)&&(this.navigator.modifySelection(n[t.replace("shift+","")],this.appendSelection),i.activeEditor().refAtPoint(o),o._setFormulaSelections(i.highlightedRefs()),e.preventDefault())},resetEditorValue:function(){var e=this._workbook.activeSheet(),t=e.activeCell(),i=this._workbook._inputForRef(t),o=e.range(t).intersectingArrayFormula();o&&(i="="+o.formula),this.editor.value(i,!!o)},activateEditor:function(e){this._casualEditing=e,this.editor.activate({range:this._workbook.activeSheet().selection(),rect:this.view.activeCellRectangle(),tooltip:this._activeTooltip()}).focus()},deactivateEditor:function(){this.view.editor.deactivate()},onCommandRequest:function(e){e.command?this._execute(e):this._workbook.undoRedoStack[e.action]()},onDialogRequest:function(e){var t={pdfExport:this._workbook.options.pdf,excelExport:this._workbook.options.excel};e.options?i.extend(!0,e.options,t):e.options=t,this.view.openDialog(e.name,e.options)},onNameEditorEnter:function(){var t,i=this._workbook,o=i.activeSheet(),n=this.view.nameEditor.value(),r=e.spreadsheet.calc.parseReference(n,!0)||i.nameValue(n);return r instanceof e.spreadsheet.Ref?(r.sheet&&r.sheet.toLowerCase()!=o.name().toLowerCase()&&(t=i.sheetByName(r.sheet),t&&(i.activeSheet(t),o=t)),void o.range(r).select()):(r=o.selection()._ref.clone().simplify().setSheet(o.name(),!0),this._execute({command:"DefineNameCommand",options:{name:n,value:r}}),void this.clipboardElement.focus())},onNameEditorCancel:function(){this.clipboardElement.focus()},onNameEditorSelect:function(t){var i,o=t.name,n=this._workbook,r=n.activeSheet(),s=n.nameValue(o);return s instanceof e.spreadsheet.Ref?(s.sheet&&s.sheet.toLowerCase()!=r.name().toLowerCase()&&(i=n.sheetByName(s.sheet),i&&(n.activeSheet(i),r=i)),void r.range(s).select()):void this.clipboardElement.focus()},onNameEditorDelete:function(e){this._execute({command:"DeleteNameCommand",options:{name:e.name}}),this.clipboardElement.focus()}}),e.spreadsheet.Controller=w}}(window.kendo)},i(3))}});