UNPKG

@progress/kendo-ui

Version:

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

1 lines 3.31 kB
module.exports=function(t){function e(n){if(i[n])return i[n].exports;var l=i[n]={exports:{},id:n,loaded:!1};return t[n].call(l.exports,l,l.exports,e),l.loaded=!0,l.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}({0:function(t,e,i){i(1605),t.exports=i(1605)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},20:function(t,e){t.exports=require("../kendo.core")},1605:function(t,e,i){var n,l,r;!function(s,define){l=[i(20)],n=s,r="function"==typeof n?n.apply(e,l):n,!(void 0!==r&&(t.exports=r))}(function(){!function(t){function e(t,e){return t&&(t.top!==e.top||t.left!==e.left)}var i=t.Observable.extend({init:function(e){t.Observable.fn.init.call(this),this.view=e,this.formulaBar=e.formulaBar,this._active=!1,this.barInput=e.formulaBar.formulaInput,this.cellInput=e.formulaInput,this.barInput.syncWith(this.cellInput),this.cellInput.syncWith(this.barInput),this.barInput.bind("keyup",this._triggerUpdate.bind(this)),this.cellInput.bind("keyup",this._triggerUpdate.bind(this)),this.barInput.bind("blur",this._blur.bind(this)),this.cellInput.bind("blur",this._blur.bind(this))},events:["activate","deactivate","change","update"],_blur:function(){this.deactivate()},_triggerUpdate:function(){this.trigger("update",{value:this.value()})},activeEditor:function(){var e=null,i=t._activeElement();return this.barElement()[0]===i?e=this.barInput:this.cellElement()[0]===i&&(e=this.cellInput),e},activate:function(t){var e,i,n,l=this.view.element;return this._active=!0,this._rect=t.rect,this._range=t.range,this.cellInput.position(t.rect),this.cellInput.resize(t.rect),this.cellInput.tooltip(t.tooltip),this.cellInput.activeCell=this.barInput.activeCell=this._range.topLeft(),this.cellInput.activeSheet=this.barInput.activeSheet=this._range._sheet,l&&(e=l.width(),i=l.find(".k-spreadsheet-scroller")[0],n=i.offsetWidth-i.clientWidth,this.cellInput.element.css("max-width",e-n-this.cellInput.element.position().left+"px")),this.trigger("activate"),this},deactivate:function(t){var e=this.cellInput;this._active&&(this._active=!1,t||e.value()==this._value||this.trigger("change",{value:e.value(),range:this._range}),this._rect=null,e.hide(),this.trigger("deactivate"))},enable:function(t){this.barInput.enable(t),this.cellInput.enable(t)},barElement:function(){return this.barInput.element},cellElement:function(){return this.cellInput.element},focus:function(t){t=t||"cell","cell"===t?(this.cellInput.element.focus(),this.cellInput.end()):this.barInput.element.focus()},isActive:function(){return this._active},isFiltered:function(){return this.barInput.popup.visible()||this.cellInput.popup.visible()},canInsertRef:function(t){var e=this.activeEditor();return e&&e.canInsertRef(t)},highlightedRefs:function(){var t=this.activeEditor(),e=[];return t&&(e=t.highlightedRefs()),e},scale:function(){this.cellInput.scale()},toggleTooltip:function(t){this.cellInput.toggleTooltip(e(this._rect,t))},value:function(t,e){return void 0===t?this.barInput.value():(null===t&&(t=""),this._value=t,this.barInput.value(t),this.cellInput.value(t),void this.barInput.element.toggleClass("k-spreadsheet-array-formula",!!e))},insertNewline:function(){this.activeEditor().insertNewline(),this.scale()},select:function(){this.activeEditor().select()}});t.spreadsheet.SheetEditor=i}(kendo)},i(3))}});