1 line
14 KiB
Plaintext
1 line
14 KiB
Plaintext
{"version":3,"sources":["webpack:///node_modules/@ionic/core/dist/esm/ion-tab_2.entry.js"],"names":["tabCss","Tab","hostRef","loaded","active","setActive","prepareLazyLoaded","isActive","component","delegate","el","e","console","error","Promise","resolve","undefined","tab","role","style","tabsCss","Tabs","ionNavWillLoad","ionTabsWillChange","ionTabsDidChange","transitioning","useRouter","onTabClicked","ev","detail","href","router","document","querySelector","push","select","closest","tabs","length","emit","tabBar","selectedTab","getTab","shouldSwitch","notifyRouter","tabSwitch","id","changed","element","markVisible","tabId","reject","leavingTab","navChanged","onIonTabButtonClick","name","Array","from","querySelectorAll","tabEl","find","t"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;;AAGA,UAAMA,MAAM,GAAG,6CAAf;;AAEA,UAAMC,GAAG;AACP,qBAAYC,OAAZ,EAAqB;AAAA;;AACnB,uEAAiB,IAAjB,EAAuBA,OAAvB;AACA,eAAKC,MAAL,GAAc,KAAd;AACA;;AACA,eAAKC,MAAL,GAAc,KAAd;AACD;;AANM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAQD,KAAKA,MARJ;AAAA;AAAA;AAAA;;AAAA;AAAA,6BASG,KAAKC,SAAL,EATH;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAYP;;AAZO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAcC,KAAKC,iBAAL,EAdD;;AAAA;AAeL,2BAAKF,MAAL,GAAc,IAAd;;AAfK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,uCAiBMG,QAjBN,EAiBgB;AACrB,g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F,EAAU;AAAE4B,kBAAI,EAAE;AAAR,aAAV,CAApD,EAAgF,6DAAE,KAAF,EAAS;AAAE,uBAAO;AAAT,aAAT,EAAkC,6DAAE,MAAF,EAAU,IAAV,CAAlC,CAAhF,EAAoI,6DAAE,MAAF,EAAU;AAAEA,kBAAI,EAAE;AAAR,aAAV,CAApI,CAAR;AACD;AApIO;AAAA;AAAA,8BA+HG;AACT,mBAAOC,KAAK,CAACC,IAAN,CAAW,KAAK/C,EAAL,CAAQgD,gBAAR,CAAyB,SAAzB,CAAX,CAAP;AACD;AAjIO;AAAA;AAAA,8BAqIC;AAAE,mBAAO,6DAAW,IAAX,CAAP;AAA0B;AArI7B;;AAAA;AAAA,SAAV;;AAuIA,UAAMhB,OAAM,GAAG,SAATA,OAAS,CAACL,IAAD,EAAOpB,GAAP,EAAe;AAC5B,YAAM0C,KAAK,GAAI,OAAO1C,GAAP,KAAe,QAAhB,GACVoB,IAAI,CAACuB,IAAL,CAAU,UAAAC,CAAC;AAAA,iBAAIA,CAAC,CAAC5C,GAAF,KAAUA,GAAd;AAAA,SAAX,CADU,GAEVA,GAFJ;;AAGA,YAAI,CAAC0C,KAAL,EAAY;AACV/C,iBAAO,CAACC,KAAR,0BAA+B8C,KAA/B;AACD;;AACD,eAAOA,KAAP;AACD,OARD;;AASAtC,UAAI,CAACF,KAAL,GAAaC,OAAb","file":"37-es5.js","sourcesContent":["import { r as registerInstance, h, H as Host, i as getElement, e as createEvent } from './index-e806d1f6.js';\nimport { a as attachComponent } from './framework-delegate-4584ab5a.js';\n\nconst tabCss = \":host(.tab-hidden){display:none !important}\";\n\nconst Tab = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.loaded = false;\n /** @internal */\n this.active = false;\n }\n async componentWillLoad() {\n if (this.active) {\n await this.setActive();\n }\n }\n /** Set the active component for the tab */\n async setActive() {\n await this.prepareLazyLoaded();\n this.active = true;\n }\n changeActive(isActive) {\n if (isActive) {\n this.prepareLazyLoaded();\n }\n }\n prepareLazyLoaded() {\n if (!this.loaded && this.component != null) {\n this.loaded = true;\n try {\n return attachComponent(this.delegate, this.el, this.component, ['ion-page']);\n }\n catch (e) {\n console.error(e);\n }\n }\n return Promise.resolve(undefined);\n }\n render() {\n const { tab, active, component } = this;\n return (h(Host, { role: \"tabpanel\", \"aria-hidden\": !active ? 'true' : null, \"aria-labelledby\": `tab-button-${tab}`, class: {\n 'ion-page': component === undefined,\n 'tab-hidden': !active\n } }, h(\"slot\", null)));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"active\": [\"changeActive\"]\n }; }\n};\nTab.style = tabCss;\n\nconst tabsCss = \":host{left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%;contain:layout size style;z-index:0}.tabs-inner{position:relative;-ms-flex:1;flex:1;contain:layout size style}\";\n\nconst Tabs = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionNavWillLoad = createEvent(this, \"ionNavWillLoad\", 7);\n this.ionTabsWillChange = createEvent(this, \"ionTabsWillChange\", 3);\n this.ionTabsDidChange = createEvent(this, \"ionTabsDidChange\", 3);\n this.transitioning = false;\n /** @internal */\n this.useRouter = false;\n this.onTabClicked = (ev) => {\n const { href, tab } = ev.detail;\n if (this.useRouter && href !== undefined) {\n const router = document.querySelector('ion-router');\n if (router) {\n router.push(href);\n }\n }\n else {\n this.select(tab);\n }\n };\n }\n async componentWillLoad() {\n if (!this.useRouter) {\n this.useRouter = !!document.querySelector('ion-router') && !this.el.closest('[no-router]');\n }\n if (!this.useRouter) {\n const tabs = this.tabs;\n if (tabs.length > 0) {\n await this.select(tabs[0]);\n }\n }\n this.ionNavWillLoad.emit();\n }\n componentWillRender() {\n const tabBar = this.el.querySelector('ion-tab-bar');\n if (tabBar) {\n const tab = this.selectedTab ? this.selectedTab.tab : undefined;\n tabBar.selectedTab = tab;\n }\n }\n /**\n * Select a tab by the value of its `tab` property or an element reference.\n *\n * @param tab The tab instance to select. If passed a string, it should be the value of the tab's `tab` property.\n */\n async select(tab) {\n const selectedTab = getTab(this.tabs, tab);\n if (!this.shouldSwitch(selectedTab)) {\n return false;\n }\n await this.setActive(selectedTab);\n await this.notifyRouter();\n this.tabSwitch();\n return true;\n }\n /**\n * Get a specific tab by the value of its `tab` property or an element reference.\n *\n * @param tab The tab instance to select. If passed a string, it should be the value of the tab's `tab` property.\n */\n async getTab(tab) {\n return getTab(this.tabs, tab);\n }\n /**\n * Get the currently selected tab.\n */\n getSelected() {\n return Promise.resolve(this.selectedTab ? this.selectedTab.tab : undefined);\n }\n /** @internal */\n async setRouteId(id) {\n const selectedTab = getTab(this.tabs, id);\n if (!this.shouldSwitch(selectedTab)) {\n return { changed: false, element: this.selectedTab };\n }\n await this.setActive(selectedTab);\n return {\n changed: true,\n element: this.selectedTab,\n markVisible: () => this.tabSwitch(),\n };\n }\n /** @internal */\n async getRouteId() {\n const tabId = this.selectedTab && this.selectedTab.tab;\n return tabId !== undefined ? { id: tabId, element: this.selectedTab } : undefined;\n }\n setActive(selectedTab) {\n if (this.transitioning) {\n return Promise.reject('transitioning already happening');\n }\n this.transitioning = true;\n this.leavingTab = this.selectedTab;\n this.selectedTab = selectedTab;\n this.ionTabsWillChange.emit({ tab: selectedTab.tab });\n selectedTab.active = true;\n return Promise.resolve();\n }\n tabSwitch() {\n const selectedTab = this.selectedTab;\n const leavingTab = this.leavingTab;\n this.leavingTab = undefined;\n this.transitioning = false;\n if (!selectedTab) {\n return;\n }\n if (leavingTab !== selectedTab) {\n if (leavingTab) {\n leavingTab.active = false;\n }\n this.ionTabsDidChange.emit({ tab: selectedTab.tab });\n }\n }\n notifyRouter() {\n if (this.useRouter) {\n const router = document.querySelector('ion-router');\n if (router) {\n return router.navChanged('forward');\n }\n }\n return Promise.resolve(false);\n }\n shouldSwitch(selectedTab) {\n const leavingTab = this.selectedTab;\n return selectedTab !== undefined && selectedTab !== leavingTab && !this.transitioning;\n }\n get tabs() {\n return Array.from(this.el.querySelectorAll('ion-tab'));\n }\n render() {\n return (h(Host, { onIonTabButtonClick: this.onTabClicked }, h(\"slot\", { name: \"top\" }), h(\"div\", { class: \"tabs-inner\" }, h(\"slot\", null)), h(\"slot\", { name: \"bottom\" })));\n }\n get el() { return getElement(this); }\n};\nconst getTab = (tabs, tab) => {\n const tabEl = (typeof tab === 'string')\n ? tabs.find(t => t.tab === tab)\n : tab;\n if (!tabEl) {\n console.error(`tab with id: \"${tabEl}\" does not exist`);\n }\n return tabEl;\n};\nTabs.style = tabsCss;\n\nexport { Tab as ion_tab, Tabs as ion_tabs };\n"]} |