@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 10.1 kB
JavaScript
module.exports=function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}({0:function(e,t,i){e.exports=i(1257)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1006:function(e,t){e.exports=require("./kendo.core")},1024:function(e,t){e.exports=require("./kendo.mobile.scroller")},1056:function(e,t){e.exports=require("./kendo.fx")},1058:function(e,t){e.exports=require("./kendo.view")},1257:function(e,t,i){var o,n,r;!function(s,define){n=[i(1006),i(1056),i(1024),i(1058)],o=s,r="function"==typeof o?o.apply(t,n):o,!(void 0!==r&&(e.exports=r))}(function(){return function(e,t){function i(e){var t,i,o=e.find(b("popover")),n=a.roles;for(t=0,i=o.length;t<i;t++)r.initWidget(o[t],{},n)}function o(e){r.triggeredByInput(e)||e.preventDefault()}function n(t){t.each(function(){r.initWidget(e(this),{},a.roles)})}var r=window.kendo,s=r.mobile,a=s.ui,l=r.attr,h=a.Widget,d=r.ViewClone,c="init",u='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',p="beforeShow",f="show",g="afterShow",v="beforeHide",m="transitionEnd",w="transitionStart",y="hide",_="destroy",x=r.attrValue,b=r.roleSelector,S=r.directiveSelector,k=r.compileMobileDirective,V=h.extend({init:function(t,i){h.fn.init.call(this,t,i),this.params={},e.extend(this,i),this.transition=this.transition||this.defaultTransition,this._id(),this.options.$angular?this._overlay():(this._layout(),this._overlay(),this._scroller(),this._model())},events:[c,p,f,g,v,y,_,w,m],options:{name:"View",title:"",layout:null,getLayout:e.noop,reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,modelScope:window,scroller:{},initWidgets:!0},enable:function(e){t===e&&(e=!0),e?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this),this.trigger(_),h.fn.destroy.call(this),this.scroller&&this.scroller.destroy(),this.options.$angular&&this.element.scope().$destroy(),r.destroy(this.element)},purge:function(){this.destroy(),this.element.remove()},triggerBeforeShow:function(){return!this.trigger(p,{view:this})},triggerBeforeHide:function(){return!this.trigger(v,{view:this})},showStart:function(){var e=this.element;e.css("display",""),this.inited?this._invokeNgController():(this.inited=!0,this.trigger(c,{view:this})),this.layout&&this.layout.attach(this),this._padIfNativeScrolling(),this.trigger(f,{view:this}),r.resize(e)},showEnd:function(){this.trigger(g,{view:this}),this._padIfNativeScrolling()},hideEnd:function(){var e=this;e.element.hide(),e.trigger(y,{view:e}),e.layout&&e.layout.trigger(y,{view:e,layout:e.layout})},beforeTransition:function(e){this.trigger(w,{type:e})},afterTransition:function(e){this.trigger(m,{type:e})},_padIfNativeScrolling:function(){if(s.appLevelNativeScrolling()){var e=r.support.mobileOS&&r.support.mobileOS.android,t=s.application.skin()||"",i=s.application.os.android||t.indexOf("android")>-1,o="flat"===t||t.indexOf("material")>-1,n=!e&&!i||o?"header":"footer",a=!e&&!i||o?"footer":"header";this.content.css({paddingTop:this[n].height(),paddingBottom:this[a].height()})}},contentElement:function(){var e=this;return e.options.stretch?e.content:e.scrollerContent},clone:function(){return new d(this)},_scroller:function(){var t=this;s.appLevelNativeScrolling()||(t.options.stretch?t.content.addClass("km-stretched-view"):(t.content.kendoMobileScroller(e.extend(t.options.scroller,{zoom:t.options.zoom,useNative:t.options.useNativeScrolling})),t.scroller=t.content.data("kendoMobileScroller"),t.scrollerContent=t.scroller.scrollElement),r.support.kineticScrollNeeded&&(e(t.element).on("touchmove",".km-header",o),t.options.useNativeScrolling||t.options.stretch||e(t.element).on("touchmove",".km-content",o)))},_model:function(){var e=this,t=e.element,o=e.options.model;"string"==typeof o&&(o=r.getter(o)(e.options.modelScope)),e.model=o,i(t),e.element.css("display",""),e.options.initWidgets&&(o?r.bind(t,o,a,r.ui,r.dataviz.ui):s.init(t.children())),e.element.css("display","none")},_id:function(){var e=this.element,t=e.attr("id")||"";this.id=x(e,"url")||"#"+t,"#"==this.id&&(this.id=r.guid(),e.attr("id",this.id))},_layout:function(){var e=b("content"),t=this.element;t.addClass("km-view"),this.header=t.children(b("header")).addClass("km-header"),this.footer=t.children(b("footer")).addClass("km-footer"),t.children(e)[0]||t.wrapInner("<div "+l("role")+'="content"></div>'),this.content=t.children(b("content")).addClass("km-content"),this.element.prepend(this.header).append(this.footer),this.layout=this.options.getLayout(this.layout),this.layout&&this.layout.setup(this)},_overlay:function(){this.overlay=e(u).appendTo(this.element)},_invokeNgController:function(){var t,i,o;this.options.$angular&&(t=this.element.controller(),i=this.options.$angular[0],t&&(o=e.proxy(this,"_callController",t,i),/^\$(digest|apply)$/.test(i.$$phase)?o():i.$apply(o)))},_callController:function(e,t){this.element.injector().invoke(e.constructor,e,{$scope:t})}}),C=h.extend({init:function(e,t){h.fn.init.call(this,e,t),e=this.element,this.header=e.children(this._locate("header")).addClass("km-header"),this.footer=e.children(this._locate("footer")).addClass("km-footer"),this.elements=this.header.add(this.footer),i(e),this.options.$angular||r.mobile.init(this.element.children()),this.element.detach(),this.trigger(c,{layout:this})},_locate:function(e){return this.options.$angular?S(e):b(e)},options:{name:"Layout",id:null,platform:null},events:[c,f,y],setup:function(e){e.header[0]||(e.header=this.header),e.footer[0]||(e.footer=this.footer)},detach:function(e){var t=this;e.header===t.header&&t.header[0]&&e.element.prepend(t.header.detach()[0].cloneNode(!0)),e.footer===t.footer&&t.footer.length&&e.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(e){var t=this,i=t.currentView;i&&t.detach(i),e.header===t.header&&(t.header.detach(),e.element.children(b("header")).remove(),e.element.prepend(t.header)),e.footer===t.footer&&(t.footer.detach(),e.element.children(b("footer")).remove(),e.element.append(t.footer)),t.trigger(f,{layout:t,view:e}),t.currentView=e}}),$=r.Observable,L=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,N="loadStart",T="loadComplete",E="showStart",I="sameViewRequested",O="viewShow",R="viewTypeDetermined",W="after",z=$.extend({init:function(t){var i,o,s,a,l=this;if($.fn.init.call(l),e.extend(l,t),l.sandbox=e("<div />"),s=l.container,i=l._hideViews(s),l.rootView=i.first(),!l.rootView[0]&&t.rootNeeded)throw o=s[0]==r.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.',Error(o);l.layouts={},l.viewContainer=new r.ViewContainer(l.container),l.viewContainer.bind("accepted",function(e){e.view.params=l.params}),l.viewContainer.bind("complete",function(e){l.trigger(O,{view:e.view})}),l.viewContainer.bind(W,function(){l.trigger(W)}),this.getLayoutProxy=e.proxy(this,"_getLayout"),l._setupLayouts(s),a=s.children(l._locate("modalview drawer")),l.$angular?(l.$angular[0].viewOptions={defaultTransition:l.transition,loader:l.loader,container:l.container,getLayout:l.getLayoutProxy},a.each(function(i,o){k(e(o),t.$angular[0])})):n(a),this.bind(this.events,t)},events:[E,W,O,N,T,I,R],destroy:function(){r.destroy(this.container);for(var e in this.layouts)this.layouts[e].destroy()},view:function(){return this.viewContainer.view},showView:function(e,t,i){if(e=e.replace(RegExp("^"+this.remoteViewURLPrefix),""),""===e&&this.remoteViewURLPrefix&&(e="/"),e.replace(/^#/,"")===this.url)return this.trigger(I),!1;this.trigger(E);var o=this,n=function(i){return o.viewContainer.show(i,t,e)},s=o._findViewElement(e),a=r.widgetInstance(s);return o.url=e.replace(/^#/,""),o.params=i,a&&a.reload&&(a.purge(),s=[]),this.trigger(R,{remote:0===s.length,url:e}),s[0]?(a||(a=o._createView(s)),n(a)):(this.serverNavigation?location.href=e:o._loadView(e,n),!0)},append:function(e,t){var i,o,r,s=this.sandbox,a=(t||"").split("?")[0],h=this.container;return L.test(e)&&(e=RegExp.$1),s[0].innerHTML=e,h.append(s.children("script, style")),i=this._hideViews(s),r=i.first(),r.length||(i=r=s.wrapInner("<div data-role=view />").children()),a&&r.hide().attr(l("url"),a),this._setupLayouts(s),o=s.children(this._locate("modalview drawer")),h.append(s.children(this._locate("layout modalview drawer")).add(i)),n(o),this._createView(r)},_locate:function(e){return this.$angular?S(e):b(e)},_findViewElement:function(e){var t,i=e.split("?")[0];return i?(t=this.container.children("["+l("url")+"='"+i+"']"),t[0]||i.indexOf("/")!==-1||(t=this.container.children("#"===i.charAt(0)?i:"#"+i)),t):this.rootView},_createView:function(e){return this.$angular?k(e,this.$angular[0]):r.initWidget(e,{defaultTransition:this.transition,loader:this.loader,container:this.container,getLayout:this.getLayoutProxy,modelScope:this.modelScope,reload:x(e,"reload")},a.roles)},_getLayout:function(e){return""===e?null:e?this.layouts[e]:this.layouts[this.layout]},_loadView:function(t,i){this._xhr&&this._xhr.abort(),this.trigger(N),this._xhr=e.get(r.absoluteURL(t,this.remoteViewURLPrefix),"html").always(e.proxy(this,"_xhrComplete",i,t))},_xhrComplete:function(e,t,i){var o=!0;if("object"==typeof i&&0===i.status){if(!(i.responseText&&i.responseText.length>0))return;o=!0,i=i.responseText}this.trigger(T),o&&e(this.append(i,t))},_hideViews:function(e){return e.children(this._locate("view splitview")).hide()},_setupLayouts:function(t){var i,o=this;t.children(o._locate("layout")).each(function(){i=o.$angular?k(e(this),o.$angular[0]):r.initWidget(e(this),{},a.roles);var t=i.options.platform;t&&t!==s.application.os.name?i.destroy():o.layouts[i.options.id]=i})}});r.mobile.ViewEngine=z,a.plugin(V),a.plugin(C)}(window.kendo.jQuery),window.kendo},i(3))}});