@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 2.86 kB
JavaScript
module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){e.exports=n(1053)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1006:function(e,t){e.exports=require("./kendo.core")},1053:function(e,t,n){var r,o,i;!function(a,define){o=[n(1006)],r=a,i="function"==typeof r?r.apply(t,o):r,!(void 0!==i&&(e.exports=i))}(function(){return function(e,t){var n=window.kendo,r=e.isArray,o=e.isPlainObject,i=e.map,a=e.each,f=e.extend,u=n.getter,l=n.Class,d=l.extend({init:function(t){var u,l,d,s,p=this,c=t.total,x=t.model,m=t.parse,h=t.errors,g=t.serialize,v=t.data;x&&(o(x)&&(u=t.modelBase||n.data.Model,x.fields&&a(x.fields,function(t,n){o(n)&&n.field?e.isFunction(n.field)||(n=f(n,{field:p.getter(n.field)})):n={field:p.getter(n)},x.fields[t]=n}),l=x.id,l&&(d={},d[p.xpathToMember(l,!0)]={field:p.getter(l)},x.fields=f(d,x.fields),x.id=p.xpathToMember(l)),x=u.define(x)),p.model=x),c&&("string"==typeof c?(c=p.getter(c),p.total=function(e){return parseInt(c(e),10)}):"function"==typeof c&&(p.total=c)),h&&("string"==typeof h?(h=p.getter(h),p.errors=function(e){return h(e)||null}):"function"==typeof h&&(p.errors=h)),v&&("string"==typeof v?(v=p.xpathToMember(v),p.data=function(e){var t,n=p.evaluate(e,v);return n=r(n)?n:[n],p.model&&x.fields?(t=new p.model,i(n,function(e){if(e){var n,r={};for(n in x.fields)r[n]=t._parse(n,x.fields[n].field(e));return r}})):n}):"function"==typeof v&&(p.data=v)),"function"==typeof m&&(s=p.parse,p.parse=function(e){var t=m.call(p,e);return s.call(p,t)}),"function"==typeof g&&(p.serialize=g)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,o,i,a,f,u,l,d={},s=e.attributes,p=s.length;for(l=0;l<p;l++)u=s[l],d["@"+u.nodeName]=u.nodeValue;for(o=e.firstChild;o;o=o.nextSibling)i=o.nodeType,3===i||4===i?d["#text"]=o.nodeValue:1===i&&(n=this.parseDOM(o),a=o.nodeName,f=d[a],r(f)?f.push(n):f=f!==t?[f,n]:n,d[a]=f);return d},evaluate:function(e,t){for(var n,o,i,a,f,u=t.split(".");n=u.shift();)if(e=e[n],r(e)){for(o=[],t=u.join("."),f=0,i=e.length;f<i;f++)a=this.evaluate(e[f],t),a=r(a)?a:[a],o.push.apply(o,a);return o}return e},parse:function(t){var n,r,o={};return n=t.documentElement||e.parseXML(t).documentElement,r=this.parseDOM(n),o[n.nodeName]=r,o},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return u(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:d,readers:{xml:d}})}(window.kendo.jQuery),window.kendo},n(3))}});