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(i){var n={};function l(t){if(n[t])return n[t].exports;var e=n[t]={exports:{},id:t,loaded:!1};return i[t].call(e.exports,e,e.exports,l),e.loaded=!0,e.exports}return l.m=i,l.c=n,l.p="",l(0)}({0:function(t,e,i){t.exports=i(1699)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},20:function(t,e){t.exports=require("../kendo.core")},1699:function(t,e,i){var n;i(3),i=[i(20)],void 0===(e="function"==typeof(n=function(){var i=kendo,t=i.Observable.extend({init:function(t){i.Observable.fn.init.call(this);this.view=t;this.formulaBar=t.formulaBar;this._active=false;this.barInput=t.formulaBar.formulaInput;this.cellInput=t.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 t=null;var e=i._activeElement();if(this.barElement()[0]===e)t=this.barInput;else if(this.cellElement()[0]===e)t=this.cellInput;return t},activate:function(t){var e=this.view.element,i,n,l;this._active=true;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;if(e){i=e.width();n=e.find(".k-spreadsheet-scroller")[0];l=n.offsetWidth-n.clientWidth;this.cellInput.element.css("max-width",i-l-this.cellInput.element.position().left+"px")}this.trigger("activate");return this},deactivate:function(t){var e=this.cellInput;if(!this._active)return;this._active=false;if(!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";if(t==="cell"){this.cellInput.element.trigger("focus");this.cellInput.end()}else this.barInput.element.trigger("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();var e=[];if(t)e=t.highlightedRefs();return e},scale:function(){this.cellInput.scale()},toggleTooltip:function(t){this.cellInput.toggleTooltip(e(this._rect,t))},value:function(t,e){if(t===undefined)return this.barInput.value();if(t===null)t="";this._value=t;this.barInput.value(t);this.cellInput.value(t);this.barInput.element.toggleClass("k-spreadsheet-array-formula",!!e)},insertNewline:function(){this.activeEditor().insertNewline();this.scale()},select:function(){this.activeEditor().select()}});function e(t,e){return t&&(t.top!==e.top||t.left!==e.left)}i.spreadsheet.SheetEditor=t})?n.apply(e,i):n)||(t.exports=e)}});