@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 3.65 kB
JavaScript
module.exports=function(e){function n(a){if(t[a])return t[a].exports;var o=t[a]={exports:{},id:a,loaded:!1};return e[a].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}({0:function(e,n,t){t(1601),e.exports=t(1601)},3:function(e,n){e.exports=function(){throw Error("define cannot be used indirect")}},20:function(e,n){e.exports=require("../kendo.core")},953:function(e,n){e.exports=require("../kendo.popup")},1033:function(e,n){e.exports=require("../kendo.listview")},1601:function(e,n,t){var a,o,r;!function(i,define){o=[t(20),t(953),t(1602),t(1033),t(1603)],a=i,r="function"==typeof a?a.apply(n,o):a,!(void 0!==r&&(e.exports=r))}(function(){!function(e){"use strict";var n=e.jQuery,t={},a=e.spreadsheet.registerEditor=function(e,n){t[e]=n};e.spreadsheet.Sheet.prototype.activeCellCustomEditor=function(){var e,n,a,o=this.activeCell().first();if(this.range(o).enable())return e=this.validation(o),n=this._properties.get("editor",this._grid.cellRefIndex(o)),null!=n?a=t[n]:e&&e.showButton&&(n="_validation_"+e.dataType,a=t[n]),"function"==typeof a&&(a=t[n]=a()),a},a("_validation_date",function(){function t(){i||(i=n("<div>").kendoCalendar(),u=n("<div>").kendoPopup(),i.appendTo(u),i=i.getKendoCalendar(),u=u.getKendoPopup(),i.bind("change",function(){u.close();var n=i.value();r.range.format()||r.range.format("yyyy-mm-dd"),r.callback(e.spreadsheet.dateToNumber(n))})),u.setOptions({anchor:r.view.element.find(".k-spreadsheet-editor-button")})}function a(){var n,a,l,s,c,d,p,v;t(),n=r.range.value(),a=r.range.sheet(),i.value(null!=n?e.spreadsheet.numberToDate(n):null),l=r.validation,l?(s=e.ui.Calendar.fn.options.min,c=e.ui.Calendar.fn.options.max,d=l.from,p=l.to,v=e.spreadsheet.calc.runtime.Formula,/^(?:greaterThan|between)/.test(l.comparerType)&&(s=e.spreadsheet.numberToDate(d instanceof v&&o(d.value)?a.range(d.value.row,d.value.col).value():d.value)),"between"==l.comparerType&&(c=e.spreadsheet.numberToDate(p instanceof v&&o(p.value)?a.range(p.value.row,p.value.col).value():l.to.value)),"lessThan"!=l.comparerType&&"lessThanOrEqualTo"!=l.comparerType||(c=e.spreadsheet.numberToDate(d instanceof v&&o(d.value)?a.range(d.value.row,d.value.col).value():l.from.value)),i.setOptions({disableDates:function(n){var t,r;return t=d&&d instanceof v&&o(d.value)?a.range(d.value.row,d.value.col).value():d?0|d.value:0,r=p&&p instanceof v&&o(p.value)?a.range(p.value.row,p.value.col).value():p?0|p.value:0,n=0|e.spreadsheet.dateToNumber(n),!e.spreadsheet.validation.validationComparers[l.comparerType](n,t,r)},min:s,max:c})):i.setOptions({disableDates:null,min:null,max:null}),u.open()}function o(e){return e&&null!==e.row&&null!==e.col&&e.row>-1&&e.col>-1}var r,i,u;return{edit:function(e){r=e,a()},icon:"k-i-calendar"}}),a("_validation_list",function(){function t(){r||(r=n("<ul class='k-list k-reset'/>").kendoStaticList({template:"#:value#",selectable:!0,autoBind:!1}),i=n("<div class='k-spreadsheet-list-popup'>").kendoPopup(),r.appendTo(i),i=i.getKendoPopup(),r=r.getKendoStaticList(),r.bind("change",function(){i.close();var e=r.value()[0];e&&o.callback(e.value)})),i.setOptions({anchor:o.view.element.find(".k-spreadsheet-editor-button")})}function a(){var n,a,u,l;t(),n=o.validation.from.value,a=[],u=function(e){a.push({value:e})},n instanceof e.spreadsheet.calc.runtime.Matrix?n.each(u):(n+"").split(/\s*,\s*/).forEach(u),l=new e.data.DataSource({data:a}),r.setDataSource(l),l.read(),i.open()}var o,r,i;return{edit:function(e){o=e,a()},icon:"k-i-arrow-60-down"}})}(window.kendo)},t(3))},1602:function(e,n){e.exports=require("../kendo.calendar")},1603:function(e,n){e.exports=require("./sheet")}});