@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(i){if(r[i])return r[i].exports;var o=r[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}({0:function(e,t,r){r(1628),e.exports=r(1628)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},20:function(e,t){e.exports=require("../kendo.core")},1628:function(e,t,r){var i,o,a;!function(s,define){o=[r(20)],i=s,a="function"==typeof i?i.apply(t,o):i,!(void 0!==a&&(e.exports=a))}(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 i(){var e=this.map(r);return e.clone=i,e}var o=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)}}),a=o.extend({set:function(e,t,r){this.list.value(e,t,JSON.stringify(r))},parse:function(e){return JSON.parse(e)}}),s=o.extend({init:function(e,t){o.prototype.init.call(this,e),this.formats=t},set:function(r,i,o){o instanceof Date?(o=e.spreadsheet.dateToNumber(o),this.formats.value(r,i)||this.formats.value(r,i,t(e.culture().calendar.patterns.d))):"number"==typeof o&&(o=e.spreadsheet.calc.runtime.limitPrecision(o)),this.list.value(r,i,o)}});e.spreadsheet.PropertyBag=e.Class.extend({specs:[{property:o,name:"format",value:null,sortable:!0,serializable:!0},{property:s,name:"value",value:null,sortable:!0,serializable:!0,depends:"format"},{property:o,name:"formula",value:null,sortable:!0,serializable:!0},{property:o,name:"background",value:null,sortable:!0,serializable:!0},{property:a,name:"vBorders",value:null,sortable:!1,serializable:!1},{property:a,name:"hBorders",value:null,sortable:!1,serializable:!1},{property:o,name:"color",value:null,sortable:!0,serializable:!0},{property:o,name:"fontFamily",value:null,sortable:!0,serializable:!0},{property:o,name:"underline",value:null,sortable:!0,serializable:!0},{property:o,name:"fontSize",value:null,sortable:!0,serializable:!0},{property:o,name:"italic",value:null,sortable:!0,serializable:!0},{property:o,name:"bold",value:null,sortable:!0,serializable:!0},{property:o,name:"textAlign",value:null,sortable:!0,serializable:!0},{property:o,name:"indent",value:null,sortable:!0,serializable:!0},{property:o,name:"verticalAlign",value:null,sortable:!0,serializable:!0},{property:o,name:"wrap",value:null,sortable:!0,serializable:!0},{property:o,name:"validation",value:null,sortable:!1,serializable:!0},{property:o,name:"enable",value:null,sortable:!1,serializable:!0},{property:o,name:"link",value:null,sortable:!0,serializable:!0},{property:o,name:"editor",value:null,sortable:!0,serializable:!0},{property:o,name:"comment",value:null,sortable:!0,serializable:!0},{property:o,name:"html",value:null,sortable:!0,serializable:!0}],init:function(t,r,o){o=o||{};var a=t*r-1;this.rowCount=t,this.columnCount=r,this.cellCount=a,this.properties={},this.lists={},this.specs.forEach(function(t){var r,i=t.name,s=o[i];void 0===s&&(s=t.value),this.lists[i]=new e.spreadsheet.SparseRangeList(0,a,s),r=this.properties[i]=new t.property(this.lists[i],this.lists[t.depends]),r.spec=t},this),this.lists.formula.tree.clone=i,this.lists.validation.tree.clone=i},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,i){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,i)},fromJSON:function(e,t){var r,i;for(r=0;r<this.specs.length;r++)i=this.specs[r],i.serializable&&void 0!==t[i.name]&&this.set(i.name,e,e,t[i.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(i){this.properties[i.name].copy(e,t,r)},this)},iterator:function(e,t,r){var i=this.properties[e],o=i.iterator(t,r),a=o.at,s=this.cellCount;return o.at=function(e){return e>s?null:i.parse(a.call(o,e))},o.name=e,o.value=i.spec.value,o},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,i){return i.serializable&&r.push(this.iterator(i.name,e,t)),r}.bind(this),[])},forEach:function(e,t,r){function i(e,t,r){var i=t.at(r);i!==t.value&&(o[e]=i)}var o,a,s,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(a=e;a<=t;a++){for(o={},s=0;s<u.length;s++)n=u[s],l=n.at(a),l!==n.value&&(o[n.name]=l);i("borderLeft",c,a),i("borderRight",h,a+this.rowCount),i("borderTop",p,a),(a+1)%this.rowCount&&i("borderBottom",p,a+1),r(o)}},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))}});