@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 5.71 kB
JavaScript
module.exports=function(e){function t(o){if(r[o])return r[o].exports;var i=r[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}({0:function(e,t,r){r(1526),e.exports=r(1526)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},19:function(e,t){e.exports=require("../kendo.core")},1526:function(e,t,r){var o,i,s;!function(a,define){i=[r(19)],o=a,s="function"==typeof o?o.apply(t,i):o,!(void 0!==s&&(e.exports=s))}(function(){!function(e){function t(e){return e.replace(/M/g,"m").replace(/'/g,'"').replace(/tt/,"am/pm")}function r(e){return e=e.clone(),e.value=e.value.deepClone(),e}function o(){var e=this.map(r);return e.clone=o,e}var i,s,a;e.support.browser.msie&&e.support.browser.version<9||(i=e.Class.extend({init:function(e){this.list=e},get:function(e){return this.parse(this.list.value(e,e))},set:function(e,t,r){void 0===r&&(r=t,t=e),this.list.value(e,t,r)},parse:function(e){return e},copy:function(e,t,r){this.list.copy(e,t,r)},iterator:function(e,t){return this.list.iterator(e,t)}}),s=i.extend({set:function(e,t,r){this.list.value(e,t,JSON.stringify(r))},parse:function(e){return JSON.parse(e)}}),a=i.extend({init:function(e,t){i.prototype.init.call(this,e),this.formats=t},set:function(r,o,i){i instanceof Date?(i=e.spreadsheet.dateToNumber(i),this.formats.value(r,o)||this.formats.value(r,o,t(e.culture().calendar.patterns.d))):"number"==typeof i&&(i=e.spreadsheet.calc.runtime.limitPrecision(i)),this.list.value(r,o,i)}}),e.spreadsheet.PropertyBag=e.Class.extend({specs:[{property:i,name:"format",value:null,sortable:!0,serializable:!0},{property:a,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:i,name:"formula",value:null,sortable:!0,serializable:!0},{property:i,name:"background",value:null,sortable:!0,serializable:!0},{property:s,name:"vBorders",value:null,sortable:!1,serializable:!1},{property:s,name:"hBorders",value:null,sortable:!1,serializable:!1},{property:i,name:"color",value:null,sortable:!0,serializable:!0},{property:i,name:"fontFamily",value:null,sortable:!0,serializable:!0},{property:i,name:"underline",value:null,sortable:!0,serializable:!0},{property:i,name:"fontSize",value:null,sortable:!0,serializable:!0},{property:i,name:"italic",value:null,sortable:!0,serializable:!0},{property:i,name:"bold",value:null,sortable:!0,serializable:!0},{property:i,name:"textAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"indent",value:null,sortable:!0,serializable:!0},{property:i,name:"verticalAlign",value:null,sortable:!0,serializable:!0},{property:i,name:"wrap",value:null,sortable:!0,serializable:!0},{property:i,name:"validation",value:null,sortable:!1,serializable:!0},{property:i,name:"enable",value:null,sortable:!1,serializable:!0},{property:i,name:"link",value:null,sortable:!0,serializable:!0},{property:i,name:"editor",value:null,sortable:!0,serializable:!0},{property:i,name:"comment",value:null,sortable:!0,serializable:!0}],init:function(t,r,i){i=i||{};var s=t*r-1;this.rowCount=t,this.columnCount=r,this.cellCount=s,this.properties={},this.lists={},this.specs.forEach(function(t){var r,o=t.name,a=i[o];void 0===a&&(a=t.value),this.lists[o]=new e.spreadsheet.SparseRangeList(0,s,a),r=this.properties[o]=new t.property(this.lists[o],this.lists[t.depends]),r.spec=t},this),this.lists.formula.tree.clone=o,this.lists.validation.tree.clone=o},getState:function(){var e={};return this.specs.forEach(function(t){e[t.name]=this.lists[t.name].getState()},this),e},setState:function(e){this.specs.forEach(function(t){this.lists[t.name].setState(e[t.name])},this)},get:function(e,t){if(void 0===t)return this.lists[e];switch(e){case"borderRight":t+=this.rowCount;case"borderLeft":e="vBorders";break;case"borderBottom":t++;case"borderTop":e="hBorders"}return t>this.cellCount?null:this.properties[e].get(t)},set:function(e,t,r,o){switch(e){case"borderRight":t+=this.rowCount,r+=this.rowCount;case"borderLeft":e="vBorders";break;case"borderBottom":t++,r++;case"borderTop":e="hBorders"}t<=r&&r<=this.cellCount&&this.properties[e].set(t,r,o)},fromJSON:function(e,t){var r,o;for(r=0;r<this.specs.length;r++)o=this.specs[r],o.serializable&&void 0!==t[o.name]&&this.set(o.name,e,e,t[o.name],!1);["borderLeft","borderRight","borderTop","borderBottom"].forEach(function(r){void 0!==t[r]&&this.set(r,e,e,t[r])},this)},copy:function(e,t,r){this.specs.forEach(function(o){this.properties[o.name].copy(e,t,r)},this)},iterator:function(e,t,r){var o=this.properties[e],i=o.iterator(t,r),s=i.at,a=this.cellCount;return i.at=function(e){return e>a?null:o.parse(s.call(i,e))},i.name=e,i.value=o.spec.value,i},sortable:function(){return this.specs.filter(function(e){return e.sortable}).map(function(e){return this.lists[e.name]},this)},iterators:function(e,t){return this.specs.reduce(function(r,o){return o.serializable&&r.push(this.iterator(o.name,e,t)),r}.bind(this),[])},forEach:function(e,t,r){function o(e,t,r){var o=t.at(r);o!==t.value&&(i[e]=o)}var i,s,a,n,l,u=this.iterators(e,t),p=this.iterator("hBorders",e,t+1),c=this.iterator("vBorders",e,t),h=this.iterator("vBorders",e+this.rowCount,t+this.rowCount);for(s=e;s<=t;s++){for(i={},a=0;a<u.length;a++)n=u[a],l=n.at(s),l!==n.value&&(i[n.name]=l);o("borderLeft",c,s),o("borderRight",h,s+this.rowCount),o("borderTop",p,s),(s+1)%this.rowCount&&o("borderBottom",p,s+1),r(i)}},forEachProperty:function(e){for(var t in this.properties)e(this.properties[t])}}),e.spreadsheet.ALL_PROPERTIES=e.spreadsheet.PropertyBag.prototype.specs.reduce(function(e,t){return t.serializable&&e.push(t.name),e},["borderTop","borderRight","borderBottom","borderLeft"]))}(window.kendo)},r(3))}});