UNPKG

@ionic/core

Version:
4 lines 5.63 kB
var __awaiter=this&&this.__awaiter||function(t,e,i,n){function o(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,r){function s(t){try{f(n.next(t))}catch(t){r(t)}}function a(t){try{f(n["throw"](t))}catch(t){r(t)}}function f(t){t.done?i(t.value):o(t.value).then(s,a)}f((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return f([t,e])}}function f(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,o&&(r=a[0]&2?o["return"]:a[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;if(o=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;o=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t];o=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}; /*! * (C) Ionic http://ionicframework.com - MIT License */System.register(["./p-f11a9436.system.js","./p-f201b53a.system.js"],(function(t){"use strict";var e,i,n,o,r,s;return{setters:[function(t){e=t.r;i=t.c;n=t.h;o=t.e;r=t.f},function(t){s=t.b}],execute:function(){var a=":host{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){left:0;right:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;overflow:hidden;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:0.55px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));--side-min-width:270px;--side-max-width:28%}";var f=a;var l=":host{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}:host(.split-pane-visible) ::slotted(.split-pane-main){left:0;right:0;top:0;bottom:0;position:relative;-ms-flex:1;flex:1;-webkit-box-shadow:none;box-shadow:none;overflow:hidden;z-index:0}::slotted(.split-pane-side:not(ion-menu)){display:none}:host{--border:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--side-min-width:270px;--side-max-width:28%}";var u=l;var c="split-pane-main";var d="split-pane-side";var h={xs:"(min-width: 0px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",never:""};var p=t("ion_split_pane",function(){function t(t){e(this,t);this.ionSplitPaneVisible=i(this,"ionSplitPaneVisible",7);this.visible=false;this.contentId=undefined;this.disabled=false;this.when=h["lg"]}t.prototype.visibleChanged=function(t){this.ionSplitPaneVisible.emit({visible:t})};t.prototype.isVisible=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,Promise.resolve(this.visible)]}))}))};t.prototype.connectedCallback=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(typeof customElements!=="undefined"&&customElements!=null))return[3,2];return[4,customElements.whenDefined("ion-split-pane")];case 1:t.sent();t.label=2;case 2:this.styleMainElement();this.updateState();return[2]}}))}))};t.prototype.disconnectedCallback=function(){if(this.rmL){this.rmL();this.rmL=undefined}};t.prototype.updateState=function(){var t=this;if(this.rmL){this.rmL();this.rmL=undefined}if(this.disabled){this.visible=false;return}var e=this.when;if(typeof e==="boolean"){this.visible=e;return}var i=h[e]||e;if(i.length===0){this.visible=false;return}var n=function(e){t.visible=e.matches};var o=window.matchMedia(i);o.addListener(n);this.rmL=function(){return o.removeListener(n)};this.visible=o.matches};t.prototype.styleMainElement=function(){var t=this.contentId;var e=this.el.children;var i=this.el.childElementCount;var n=false;for(var o=0;o<i;o++){var r=e[o];var s=t!==undefined&&r.id===t;if(s){if(n){console.warn("split pane cannot have more than one main node");return}else{v(r,s);n=true}}}if(!n){console.warn("split pane does not have a specified main node")}};t.prototype.render=function(){var t;var e=s(this);return n(o,{key:"76be70d7fbebc52646a5851f47accc1006615b85",class:(t={},t[e]=true,t["split-pane-".concat(e)]=true,t["split-pane-visible"]=this.visible,t)},n("slot",{key:"9a859530f4fb18aff43255bc3940feb9aca625d7"}))};Object.defineProperty(t.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{visible:["visibleChanged"],disabled:["updateState"],when:["updateState"]}},enumerable:false,configurable:true});return t}());var v=function(t,e){var i;var n;if(e){i=c;n=d}else{i=d;n=c}var o=t.classList;o.add(i);o.remove(n)};p.style={ios:f,md:u}}}}));