UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

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