@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 22.8 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(1600),e.exports=i(1600)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},20:function(e,t){e.exports=require("../kendo.core")},1600:function(e,t,i){var o,n,r;!function(s,define){n=[i(20)],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=e.jQuery,r=/:alphanum$/,s={up:"up",down:"down",left:"left",right:"right",home:"first-col",end:"last-col","ctrl+left":"word-left","ctrl+right":"word-right","ctrl+up":"word-up","ctrl+down":"word-down","ctrl+home":"first","ctrl+end":"last",pageup:"prev-page",pagedown:"next-page"},a={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"},c={wheel:"onWheel","*+mousedown":"onMouseDown",contextmenu:"onContextMenu","*+mousedrag":"onMouseDrag","*+mouseup":"onMouseUp","*+dblclick":"onDblClick",mousemove:"onMouseMove"},h={pageup:"onPageUp",pagedown:"onPageDown",mouseup:"onMouseUp","*+cut":"onCut","*+paste":"onPaste","*+copy":"onCopy"},l={esc:"onEditorEsc",enter:"onEditorBlur","alt+enter":"insertNewline","shift+enter":"onEditorBlur",tab:"onEditorBlur","shift+tab":"onEditorBlur","shift+ctrl+enter":"onEditorArrayFormula"},d=n.extend({focus:"onEditorBarFocus"},l),u=n.extend({focus:"onEditorCellFocus"},l),p={cell:"range",rowheader:"row",columnheader:"column",topcorner:"sheet",autofill:"autofill"},m=t(["cut","copy","paste","insert-left","insert-right","insert-above","insert-below"]),f=t(["unhide-row","unhide-column"]),v=[],g=[],w=[];for(i in s)v.push(i),g.push("shift+"+i);for(i in a)w.push(i);h[v]="onAction",h[g]="onShiftAction",h[w]="onEntryAction",u[v]="onEditorAction",u[g]="onEditorShiftAction",o=e.Class.extend({init:function(t,i){this.view=t,this.workbook(i),this.container=n(t.container),this.clipboardElement=n(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)),n(t.scroller).on("scroll",this.onScroll.bind(this)),this.listener=new e.spreadsheet.EventListener(this.container,this,c),n(t.scroller).on("mousedown",this.onMouseDown.bind(this)),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,h),this.barKeyListener=new e.spreadsheet.EventListener(this.editor.barElement(),this,d),this.inputKeyListener=new e.spreadsheet.EventListener(this.editor.cellElement(),this,u)):(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,i=n(e.item).data("action");switch(i){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()},onAction:function(e,t){var i=this._workbook.activeSheet();i._activeDrawing=null,this.navigator.moveActiveCell(s[t]),e.preventDefault()},onPageUp:function(){this.scrollDown(-this._viewPortHeight)},onPageDown:function(){this.scrollDown(this._viewPortHeight)},onEntryAction:function(e,t){var i,o,n,s,c=this._workbook.activeSheet();if(e.mod){switch(i=String.fromCharCode(e.keyCode),o=!0,i){case"A":c._activeDrawing=null,this.navigator.selectAll();break;case"Y":this._workbook.undoRedoStack.redo();break;case"Z":this._workbook.undoRedoStack.undo();break;default:o=!1}o&&e.preventDefault()}else if(n=c.selection().enable()===!1,s=":edit"!==t,"delete"==t||"backspace"==t)c._activeDrawing?this._execute({command:"DeleteDrawingCommand",options:{drawing:c._activeDrawing}}):n||this._execute({command:"ClearContentCommand"}),e.preventDefault();else if(r.test(t)||!s){if(c._activeDrawing=null,n)return void e.preventDefault();s&&this.editor.value(""),this.activateEditor(s)}else this.navigator.navigateInSelection(a[t]),e.preventDefault()},onShiftAction:function(e,t){this.navigator.modifySelection(s[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,this.view),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=p[n.type],this.appendSelection=t.mod,this.navigator.startSelection(n.ref,this._selectionMode,this.appendSelection,t.shiftKey,this.view)}},_startResizingDrawing:function(e){var t,i,o,r,s=n(e.target).closest(".k-spreadsheet-drawing-handle");if(s.length)return t=this.translateCoords(e),i=s.data("direction"),o=this._workbook.activeSheet(),r=o._activeDrawing,o.startDragging({pane:this.originFrame,drawing:r,copy:r.clone(),startBox:o.drawingBoundingBox(r),resize:i,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,p[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(m).toggle(!n),i.element.find(f).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(t){var i,o,n,r;if("sheet"!==this._selectionMode&&(i={clientX:t.clientX,clientY:t.clientY},o=this._workbook.activeSheet(),!this._dragDrawing(t))){if(n=this.objectAt(i),o.resizingInProgress())return void(this.constrainResize(n.type,n.ref)||o.resizeHintPosition({x:n.x,y:n.y}));if("outside"===n.type)return void this.startAutoScroll(n);this.originFrame===n.pane?this.selectToLocation(i):(r=this.originFrame._grid,n.x>r.right&&e.scrollLeft(this),n.y>r.bottom&&this.scrollTop(),n.y<r.top||n.x<r.left?this.startAutoScroll(n,i):this.selectToLocation(i)),t.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){var t=this;setTimeout(function(){t.clipboard.menuInvoked=void 0===e,t._execute({command:"CutCommand",options:{workbook:t.view._workbook,event:e.originalEvent||e}})})},clipBoardValue:function(){return this.clipboardElement.html()},_pasteImage:function(e){var t=this,i=new window.Image;i.src=window.URL.createObjectURL(e),i.onload=function(){t._execute({command:"InsertImageCommand",options:{blob:e,width:i.width,height:i.height}})},setTimeout(function(){window.URL.revokeObjectURL(i.src)},10)},onPaste:function(t){var i,o,n,r,s,a,c,h=this,l="",d="";if(h.clipboard.menuInvoked=void 0===t,t){if(i=t.originalEvent.clipboardData,!i||!i.getData){if(a=h.clipboardElement.find("table.kendo-clipboard-"+h.clipboard._uid).detach(),h.clipboardElement.empty(),window.clipboardData.files&&window.clipboardData.files.length&&(c=window.clipboardData.files[0],/^image\/(?:png|jpe?g|gif)$/i.test(c.type)))return h._pasteImage(c);if(l=h.clipboardElement.html(),d=window.clipboardData.getData("Text"),d&&(d=d.trim()),!l&&!d)return;return h.clipboard.external({html:l,plain:d}),h.clipboardElement.empty().append(a),h._execute({command:"PasteCommand",options:{workbook:h.view._workbook,event:t.originalEvent||t}}),void(h.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")):Array.isArray(i.types)?(o=i.types.indexOf("text/html")>=0,n=i.types.indexOf("text/plain")>=0):(o=/text\/html/.test(i.types),n=/text\/plain/.test(i.types)),o&&(l=i.getData("text/html").trim()),n&&(d=i.getData("text/plain").trim()),!l&&!d&&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 h._pasteImage(s.getAsFile())}else{if(e.support.browser.msie)return h.clipboardElement.focus().select(),void document.execCommand("paste");h.clipboard.menuInvoked=!0}(l||d)&&(h.clipboard.external({html:l,plain:d}),h._execute({command:"PasteCommand",options:{workbook:h.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)},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(a[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(s[t]),e.preventDefault()):i.canInsertRef(!0)&&(this.navigator.moveActiveCell(s[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(s[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?n.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=o}(window.kendo)},i(3))}});