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