@ionic/core
Version:
Base components for Ionic
4 lines • 3.94 kB
JavaScript
var __awaiter=this&&this.__awaiter||function(r,n,t,e){function i(r){return r instanceof t?r:new t((function(n){n(r)}))}return new(t||(t=Promise))((function(t,o){function u(r){try{c(e.next(r))}catch(r){o(r)}}function a(r){try{c(e["throw"](r))}catch(r){o(r)}}function c(r){r.done?t(r.value):i(r.value).then(u,a)}c((e=e.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,i,o,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(r){return function(n){return c([r,n])}}function c(a){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(t=0)),t)try{if(e=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;i=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){t.label=a[1];break}if(a[0]===6&&t.label<o[1]){t.label=o[1];o=a;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(a);break}if(o[2])t.ops.pop();t.trys.pop();continue}a=n.call(r,t)}catch(r){a=[6,r];i=0}finally{e=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(r,n,t){if(t||arguments.length===2)for(var e=0,i=n.length,o;e<i;e++){if(o||!(e in n)){if(!o)o=Array.prototype.slice.call(n,0,e);o[e]=n[e]}}return r.concat(o||Array.prototype.slice.call(n))};
/*!
* (C) Ionic http://ionicframework.com - MIT License
*/System.register(["./p-455cd7cc.system.js"],(function(r){"use strict";var n;return{setters:[function(r){n=r.c}],execute:function(){var t=this;var e=r("a",(function(r,e,i,o,u,a){return __awaiter(t,void 0,void 0,(function(){var t,c;return __generator(this,(function(f){switch(f.label){case 0:if(r){return[2,r.attachViewToDom(e,i,u,o)]}if(!a&&typeof i!=="string"&&!(i instanceof HTMLElement)){throw new Error("framework delegate is missing")}c=typeof i==="string"?(t=e.ownerDocument)===null||t===void 0?void 0:t.createElement(i):i;if(o){o.forEach((function(r){return c.classList.add(r)}))}if(u){Object.assign(c,u)}e.appendChild(c);return[4,new Promise((function(r){return n(c,r)}))];case 1:f.sent();return[2,c]}}))}))}));var i=r("d",(function(r,n){if(n){if(r){var t=n.parentElement;return r.removeViewFromDom(t,n)}n.remove()}return Promise.resolve()}));var o=r("C",(function(){var r;var e;var i=function(i,o){var u=[];for(var a=2;a<arguments.length;a++){u[a-2]=arguments[a]}return __awaiter(t,__spreadArray([i,o],u,true),void 0,(function(t,i,o,u){var a,c,f,s,v,d,h;if(o===void 0){o={}}if(u===void 0){u=[]}return __generator(this,(function(l){switch(l.label){case 0:r=t;if(!i)return[3,2];s=typeof i==="string"?(a=r.ownerDocument)===null||a===void 0?void 0:a.createElement(i):i;u.forEach((function(r){return s.classList.add(r)}));Object.assign(s,o);r.appendChild(s);f=s;return[4,new Promise((function(r){return n(s,r)}))];case 1:l.sent();return[3,3];case 2:if(r.children.length>0&&(r.tagName==="ION-MODAL"||r.tagName==="ION-POPOVER")){v=f=r.children[0];if(!v.classList.contains("ion-delegate-host")){d=(c=r.ownerDocument)===null||c===void 0?void 0:c.createElement("div");d.classList.add("ion-delegate-host");u.forEach((function(r){return d.classList.add(r)}));d.append.apply(d,r.children);r.appendChild(d);f=d}}l.label=3;case 3:h=document.querySelector("ion-app")||document.body;e=document.createComment("ionic teleport");r.parentNode.insertBefore(e,r);h.appendChild(r);return[2,f!==null&&f!==void 0?f:r]}}))}))};var o=function(){if(r&&e){e.parentNode.insertBefore(r,e);e.remove()}return Promise.resolve()};return{attachViewToDom:i,removeViewFromDom:o}}))}}}));