a zip code crypto-currency system good for red ONLY

tabs.js 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. var __extends = (this && this.__extends) || (function () {
  2. var extendStatics = Object.setPrototypeOf ||
  3. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5. return function (d, b) {
  6. extendStatics(d, b);
  7. function __() { this.constructor = d; }
  8. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  9. };
  10. })();
  11. (function (factory) {
  12. if (typeof module === "object" && typeof module.exports === "object") {
  13. var v = factory(require, exports);
  14. if (v !== undefined) module.exports = v;
  15. }
  16. else if (typeof define === "function" && define.amd) {
  17. define(["require", "exports", "@angular/core", "rxjs/Subject", "rxjs/add/operator/takeUntil", "../app/app", "../../config/config", "../../navigation/deep-linker", "../ion", "../../util/util", "../../platform/keyboard", "../../navigation/nav-controller", "../../navigation/nav-util", "../../navigation/url-serializer", "../split-pane/split-pane", "../../platform/platform", "./tab-highlight", "../../navigation/view-controller"], factory);
  18. }
  19. })(function (require, exports) {
  20. "use strict";
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. var core_1 = require("@angular/core");
  23. var Subject_1 = require("rxjs/Subject");
  24. require("rxjs/add/operator/takeUntil");
  25. var app_1 = require("../app/app");
  26. var config_1 = require("../../config/config");
  27. var deep_linker_1 = require("../../navigation/deep-linker");
  28. var ion_1 = require("../ion");
  29. var util_1 = require("../../util/util");
  30. var keyboard_1 = require("../../platform/keyboard");
  31. var nav_controller_1 = require("../../navigation/nav-controller");
  32. var nav_util_1 = require("../../navigation/nav-util");
  33. var url_serializer_1 = require("../../navigation/url-serializer");
  34. var split_pane_1 = require("../split-pane/split-pane");
  35. var platform_1 = require("../../platform/platform");
  36. var tab_highlight_1 = require("./tab-highlight");
  37. var view_controller_1 = require("../../navigation/view-controller");
  38. /**
  39. * @name Tabs
  40. * @description
  41. * Tabs make it easy to navigate between different pages or functional
  42. * aspects of an app. The Tabs component, written as `<ion-tabs>`, is
  43. * a container of individual [Tab](../Tab/) components. Each individual `ion-tab`
  44. * is a declarative component for a [NavController](../../../navigation/NavController/)
  45. *
  46. * For more information on using nav controllers like Tab or [Nav](../../nav/Nav/),
  47. * take a look at the [NavController API Docs](../../../navigation/NavController/).
  48. *
  49. * ### Placement
  50. *
  51. * The position of the tabs relative to the content varies based on
  52. * the mode. The tabs are placed at the bottom of the screen
  53. * for iOS and Android, and at the top for Windows by default. The position can
  54. * be configured using the `tabsPlacement` attribute on the `<ion-tabs>` component,
  55. * or in an app's [config](../../config/Config/).
  56. * See the [Input Properties](#input-properties) below for the available
  57. * values of `tabsPlacement`.
  58. *
  59. * ### Layout
  60. *
  61. * The layout for all of the tabs can be defined using the `tabsLayout`
  62. * property. If the individual tab has a title and icon, the icons will
  63. * show on top of the title by default. All tabs can be changed by setting
  64. * the value of `tabsLayout` on the `<ion-tabs>` element, or in your
  65. * app's [config](../../config/Config/). For example, this is useful if
  66. * you want to show tabs with a title only on Android, but show icons
  67. * and a title for iOS. See the [Input Properties](#input-properties)
  68. * below for the available values of `tabsLayout`.
  69. *
  70. * ### Selecting a Tab
  71. *
  72. * There are different ways you can select a specific tab from the tabs
  73. * component. You can use the `selectedIndex` property to set the index
  74. * on the `<ion-tabs>` element, or you can call `select()` from the `Tabs`
  75. * instance after creation. See [usage](#usage) below for more information.
  76. *
  77. * @usage
  78. *
  79. * You can add a basic tabs template to a `@Component` using the following
  80. * template:
  81. *
  82. * ```html
  83. * <ion-tabs>
  84. * <ion-tab [root]="tab1Root"></ion-tab>
  85. * <ion-tab [root]="tab2Root"></ion-tab>
  86. * <ion-tab [root]="tab3Root"></ion-tab>
  87. * </ion-tabs>
  88. * ```
  89. *
  90. * Where `tab1Root`, `tab2Root`, and `tab3Root` are each a page:
  91. *
  92. *```ts
  93. * @Component({
  94. * templateUrl: 'build/pages/tabs/tabs.html'
  95. * })
  96. * export class TabsPage {
  97. * // this tells the tabs component which Pages
  98. * // should be each tab's root Page
  99. * tab1Root = Page1;
  100. * tab2Root = Page2;
  101. * tab3Root = Page3;
  102. *
  103. * constructor() {
  104. *
  105. * }
  106. * }
  107. *```
  108. *
  109. * By default, the first tab will be selected upon navigation to the
  110. * Tabs page. We can change the selected tab by using `selectedIndex`
  111. * on the `<ion-tabs>` element:
  112. *
  113. * ```html
  114. * <ion-tabs selectedIndex="2">
  115. * <ion-tab [root]="tab1Root"></ion-tab>
  116. * <ion-tab [root]="tab2Root"></ion-tab>
  117. * <ion-tab [root]="tab3Root"></ion-tab>
  118. * </ion-tabs>
  119. * ```
  120. *
  121. * Since the index starts at `0`, this will select the 3rd tab which has
  122. * root set to `tab3Root`. If you wanted to change it dynamically from
  123. * your class, you could use [property binding](https://angular.io/docs/ts/latest/guide/template-syntax.html#!#property-binding).
  124. *
  125. * Alternatively, you can grab the `Tabs` instance and call the `select()`
  126. * method. This requires the `<ion-tabs>` element to have an `id`. For
  127. * example, set the value of `id` to `myTabs`:
  128. *
  129. * ```html
  130. * <ion-tabs #myTabs>
  131. * <ion-tab [root]="tab1Root"></ion-tab>
  132. * <ion-tab [root]="tab2Root"></ion-tab>
  133. * <ion-tab [root]="tab3Root"></ion-tab>
  134. * </ion-tabs>
  135. * ```
  136. *
  137. * Then in your class you can grab the `Tabs` instance and call `select()`,
  138. * passing the index of the tab as the argument. Here we're grabbing the tabs
  139. * by using ViewChild.
  140. *
  141. *```ts
  142. * export class TabsPage {
  143. *
  144. * @ViewChild('myTabs') tabRef: Tabs;
  145. *
  146. * ionViewDidEnter() {
  147. * this.tabRef.select(2);
  148. * }
  149. *
  150. * }
  151. *```
  152. *
  153. * You can also switch tabs from a child component by calling `select()` on the
  154. * parent view using the `NavController` instance. For example, assuming you have
  155. * a `TabsPage` component, you could call the following from any of the child
  156. * components to switch to `TabsRoot3`:
  157. *
  158. *```ts
  159. * switchTabs() {
  160. * this.navCtrl.parent.select(2);
  161. * }
  162. *```
  163. * @demo /docs/demos/src/tabs/
  164. *
  165. * @see {@link /docs/components#tabs Tabs Component Docs}
  166. * @see {@link ../Tab Tab API Docs}
  167. * @see {@link ../../config/Config Config API Docs}
  168. *
  169. */
  170. var Tabs = (function (_super) {
  171. __extends(Tabs, _super);
  172. function Tabs(parent, viewCtrl, _app, config, elementRef, _plt, renderer, _linker, keyboard) {
  173. var _this = _super.call(this, config, elementRef, renderer, 'tabs') || this;
  174. _this.viewCtrl = viewCtrl;
  175. _this._app = _app;
  176. _this._plt = _plt;
  177. _this._linker = _linker;
  178. /** @internal */
  179. _this._ids = -1;
  180. /** @internal */
  181. _this._tabs = [];
  182. /** @internal */
  183. _this._selectHistory = [];
  184. /** @internal */
  185. _this._onDestroy = new Subject_1.Subject();
  186. /**
  187. * @output {any} Emitted when the tab changes.
  188. */
  189. _this.ionChange = new core_1.EventEmitter();
  190. _this.parent = parent;
  191. _this.id = 't' + (++tabIds);
  192. _this._sbPadding = config.getBoolean('statusbarPadding');
  193. _this.tabsHighlight = config.getBoolean('tabsHighlight');
  194. if (_this.parent) {
  195. // this Tabs has a parent Nav
  196. _this.parent.registerChildNav(_this);
  197. }
  198. else if (viewCtrl && viewCtrl.getNav()) {
  199. // this Nav was opened from a modal
  200. _this.parent = viewCtrl.getNav();
  201. _this.parent.registerChildNav(_this);
  202. }
  203. else if (_this._app) {
  204. // this is the root navcontroller for the entire app
  205. _this._app.registerRootNav(_this);
  206. }
  207. // Tabs may also be an actual ViewController which was navigated to
  208. // if Tabs is static and not navigated to within a NavController
  209. // then skip this and don't treat it as it's own ViewController
  210. if (viewCtrl) {
  211. viewCtrl._setContent(_this);
  212. viewCtrl._setContentRef(elementRef);
  213. }
  214. var keyboardResizes = config.getBoolean('keyboardResizes', false);
  215. if (keyboard && keyboardResizes) {
  216. keyboard.willHide
  217. .takeUntil(_this._onDestroy)
  218. .subscribe(function () {
  219. _this._plt.timeout(function () { return _this.setTabbarHidden(false); }, 50);
  220. });
  221. keyboard.willShow
  222. .takeUntil(_this._onDestroy)
  223. .subscribe(function () { return _this.setTabbarHidden(true); });
  224. }
  225. return _this;
  226. }
  227. /**
  228. * @internal
  229. */
  230. Tabs.prototype.setTabbarHidden = function (tabbarHidden) {
  231. this.setElementClass('tabbar-hidden', tabbarHidden);
  232. this.resize();
  233. };
  234. /**
  235. * @internal
  236. */
  237. Tabs.prototype.ngOnDestroy = function () {
  238. this._onDestroy.next();
  239. if (this.parent) {
  240. this.parent.unregisterChildNav(this);
  241. }
  242. else {
  243. this._app.unregisterRootNav(this);
  244. }
  245. };
  246. /**
  247. * @internal
  248. */
  249. Tabs.prototype.ngAfterViewInit = function () {
  250. var _this = this;
  251. this._setConfig('tabsPlacement', 'bottom');
  252. this._setConfig('tabsLayout', 'icon-top');
  253. this._setConfig('tabsHighlight', this.tabsHighlight);
  254. if (this.tabsHighlight) {
  255. this._plt.resize
  256. .takeUntil(this._onDestroy)
  257. .subscribe(function () { return _this._highlight.select(_this.getSelected()); });
  258. }
  259. this.initTabs();
  260. };
  261. /**
  262. * @internal
  263. */
  264. Tabs.prototype.initTabs = function () {
  265. var _this = this;
  266. // get the selected index from the input
  267. // otherwise default it to use the first index
  268. var selectedIndex = (util_1.isBlank(this.selectedIndex) ? 0 : parseInt(this.selectedIndex, 10));
  269. // now see if the deep linker can find a tab index
  270. var tabsSegment = this._linker.getSegmentByNavIdOrName(this.id, this.name);
  271. if (tabsSegment) {
  272. // we found a segment which probably represents which tab to select
  273. selectedIndex = this._getSelectedTabIndex(tabsSegment.secondaryId, selectedIndex);
  274. }
  275. // get the selectedIndex and ensure it isn't hidden or disabled
  276. var selectedTab = this._tabs.find(function (t, i) { return i === selectedIndex && t.enabled && t.show; });
  277. if (!selectedTab) {
  278. // wasn't able to select the tab they wanted
  279. // try to find the first tab that's available
  280. selectedTab = this._tabs.find(function (t) { return t.enabled && t.show; });
  281. }
  282. var promise = Promise.resolve();
  283. if (selectedTab) {
  284. selectedTab._segment = tabsSegment;
  285. promise = this.select(selectedTab);
  286. }
  287. return promise.then(function () {
  288. // set the initial href attribute values for each tab
  289. _this._tabs.forEach(function (t) {
  290. t.updateHref(t.root, t.rootParams);
  291. });
  292. });
  293. };
  294. /**
  295. * @internal
  296. */
  297. Tabs.prototype._setConfig = function (attrKey, fallback) {
  298. var val = this[attrKey];
  299. if (util_1.isBlank(val)) {
  300. val = this._config.get(attrKey, fallback);
  301. }
  302. this.setElementAttribute(attrKey, val);
  303. };
  304. /**
  305. * @hidden
  306. */
  307. Tabs.prototype.add = function (tab) {
  308. this._tabs.push(tab);
  309. return this.id + '-' + (++this._ids);
  310. };
  311. /**
  312. * @param {number|Tab} tabOrIndex Index, or the Tab instance, of the tab to select.
  313. */
  314. Tabs.prototype.select = function (tabOrIndex, opts, fromUrl) {
  315. var _this = this;
  316. if (opts === void 0) { opts = {}; }
  317. if (fromUrl === void 0) { fromUrl = false; }
  318. var selectedTab = (typeof tabOrIndex === 'number' ? this.getByIndex(tabOrIndex) : tabOrIndex);
  319. if (util_1.isBlank(selectedTab)) {
  320. return Promise.resolve();
  321. }
  322. // If the selected tab is the current selected tab, we do not switch
  323. var currentTab = this.getSelected();
  324. if (selectedTab === currentTab && currentTab.getActive()) {
  325. return this._updateCurrentTab(selectedTab, fromUrl);
  326. }
  327. // If the selected tab does not have a root, we do not switch (#9392)
  328. // it's possible the tab is only for opening modal's or signing out
  329. // and doesn't actually have content. In the case there's no content
  330. // for a tab then do nothing and leave the current view as is
  331. if (selectedTab.root) {
  332. // At this point we are going to perform a page switch
  333. // Let's fire willLeave in the current tab page
  334. var currentPage;
  335. if (currentTab) {
  336. currentPage = currentTab.getActive();
  337. currentPage && currentPage._willLeave(false);
  338. }
  339. // Fire willEnter in the new selected tab
  340. var selectedPage_1 = selectedTab.getActive();
  341. selectedPage_1 && selectedPage_1._willEnter();
  342. // Let's start the transition
  343. opts.animate = false;
  344. return selectedTab.load(opts).then(function () {
  345. _this._tabSwitchEnd(selectedTab, selectedPage_1, currentPage);
  346. if (opts.updateUrl !== false) {
  347. _this._linker.navChange(nav_util_1.DIRECTION_SWITCH);
  348. }
  349. (void 0) /* assert */;
  350. _this._fireChangeEvent(selectedTab);
  351. });
  352. }
  353. else {
  354. this._fireChangeEvent(selectedTab);
  355. return Promise.resolve();
  356. }
  357. };
  358. Tabs.prototype._fireChangeEvent = function (selectedTab) {
  359. selectedTab.ionSelect.emit(selectedTab);
  360. this.ionChange.emit(selectedTab);
  361. };
  362. Tabs.prototype._tabSwitchEnd = function (selectedTab, selectedPage, currentPage) {
  363. (void 0) /* assert */;
  364. (void 0) /* assert */;
  365. // Update tabs selection state
  366. var tabs = this._tabs;
  367. var tab;
  368. for (var i = 0; i < tabs.length; i++) {
  369. tab = tabs[i];
  370. tab.setSelected(tab === selectedTab);
  371. }
  372. if (this.tabsHighlight) {
  373. this._highlight.select(selectedTab);
  374. }
  375. // Fire didEnter/didLeave lifecycle events
  376. if (selectedPage) {
  377. selectedPage._didEnter();
  378. this._app.viewDidEnter.emit(selectedPage);
  379. }
  380. if (currentPage) {
  381. currentPage && currentPage._didLeave();
  382. this._app.viewDidLeave.emit(currentPage);
  383. }
  384. // track the order of which tabs have been selected, by their index
  385. // do not track if the tab index is the same as the previous
  386. if (this._selectHistory[this._selectHistory.length - 1] !== selectedTab.id) {
  387. this._selectHistory.push(selectedTab.id);
  388. }
  389. };
  390. /**
  391. * Get the previously selected Tab which is currently not disabled or hidden.
  392. * @param {boolean} trimHistory If the selection history should be trimmed up to the previous tab selection or not.
  393. * @returns {Tab}
  394. */
  395. Tabs.prototype.previousTab = function (trimHistory) {
  396. var _this = this;
  397. if (trimHistory === void 0) { trimHistory = true; }
  398. // walk backwards through the tab selection history
  399. // and find the first previous tab that is enabled and shown
  400. (void 0) /* console.debug */;
  401. for (var i = this._selectHistory.length - 2; i >= 0; i--) {
  402. var tab = this._tabs.find(function (t) { return t.id === _this._selectHistory[i]; });
  403. if (tab && tab.enabled && tab.show) {
  404. if (trimHistory) {
  405. this._selectHistory.splice(i + 1);
  406. }
  407. return tab;
  408. }
  409. }
  410. return null;
  411. };
  412. /**
  413. * @param {number} index Index of the tab you want to get
  414. * @returns {Tab} Returns the tab who's index matches the one passed
  415. */
  416. Tabs.prototype.getByIndex = function (index) {
  417. return this._tabs[index];
  418. };
  419. /**
  420. * @return {Tab} Returns the currently selected tab
  421. */
  422. Tabs.prototype.getSelected = function () {
  423. var tabs = this._tabs;
  424. for (var i = 0; i < tabs.length; i++) {
  425. if (tabs[i].isSelected) {
  426. return tabs[i];
  427. }
  428. }
  429. return null;
  430. };
  431. /**
  432. * @internal
  433. */
  434. Tabs.prototype.getActiveChildNavs = function () {
  435. var selected = this.getSelected();
  436. return selected ? [selected] : [];
  437. };
  438. /**
  439. * @internal
  440. */
  441. Tabs.prototype.getAllChildNavs = function () {
  442. return this._tabs;
  443. };
  444. /**
  445. * @internal
  446. */
  447. Tabs.prototype.getIndex = function (tab) {
  448. return this._tabs.indexOf(tab);
  449. };
  450. /**
  451. * @internal
  452. */
  453. Tabs.prototype.length = function () {
  454. return this._tabs.length;
  455. };
  456. /**
  457. * "Touch" the active tab, going back to the root view of the tab
  458. * or optionally letting the tab handle the event
  459. */
  460. Tabs.prototype._updateCurrentTab = function (tab, fromUrl) {
  461. var active = tab.getActive();
  462. if (active) {
  463. if (fromUrl && tab._segment) {
  464. // see if the view controller exists
  465. var vc = tab.getViewById(tab._segment.name);
  466. if (vc) {
  467. // the view is already in the stack
  468. return tab.popTo(vc, {
  469. animate: false,
  470. updateUrl: false,
  471. });
  472. }
  473. else if (tab._views.length === 0 && tab._segment.defaultHistory && tab._segment.defaultHistory.length) {
  474. return this._linker.initViews(tab._segment).then(function (views) {
  475. return tab.setPages(views, {
  476. animate: false, updateUrl: false
  477. });
  478. }).then(function () {
  479. tab._segment = null;
  480. });
  481. }
  482. else {
  483. return tab.setRoot(tab._segment.name, tab._segment.data, {
  484. animate: false, updateUrl: false
  485. }).then(function () {
  486. tab._segment = null;
  487. });
  488. }
  489. }
  490. else if (active._cmp && active._cmp.instance.ionSelected) {
  491. // if they have a custom tab selected handler, call it
  492. active._cmp.instance.ionSelected();
  493. return Promise.resolve();
  494. }
  495. else if (tab.length() > 1) {
  496. // if we're a few pages deep, pop to root
  497. return tab.popToRoot();
  498. }
  499. else {
  500. return nav_util_1.getComponent(this._linker, tab.root).then(function (viewController) {
  501. if (viewController.component !== active.component) {
  502. // Otherwise, if the page we're on is not our real root
  503. // reset it to our default root type
  504. return tab.setRoot(tab.root);
  505. }
  506. }).catch(function () {
  507. (void 0) /* console.debug */;
  508. });
  509. }
  510. }
  511. };
  512. /**
  513. * @internal
  514. * DOM WRITE
  515. */
  516. Tabs.prototype.setTabbarPosition = function (top, bottom) {
  517. if (this._top !== top || this._bottom !== bottom) {
  518. var tabbarEle = this._tabbar.nativeElement;
  519. tabbarEle.style.top = (top > -1 ? top + 'px' : '');
  520. tabbarEle.style.bottom = (bottom > -1 ? bottom + 'px' : '');
  521. tabbarEle.classList.add('show-tabbar');
  522. this._top = top;
  523. this._bottom = bottom;
  524. }
  525. };
  526. /**
  527. * @internal
  528. */
  529. Tabs.prototype.resize = function () {
  530. var tab = this.getSelected();
  531. tab && tab.resize();
  532. };
  533. /**
  534. * @internal
  535. */
  536. Tabs.prototype.initPane = function () {
  537. var isMain = this._elementRef.nativeElement.hasAttribute('main');
  538. return isMain;
  539. };
  540. /**
  541. * @internal
  542. */
  543. Tabs.prototype.paneChanged = function (isPane) {
  544. if (isPane) {
  545. this.resize();
  546. }
  547. };
  548. Tabs.prototype.goToRoot = function (opts) {
  549. if (this._tabs.length) {
  550. return this.select(this._tabs[0], opts);
  551. }
  552. };
  553. /*
  554. * @private
  555. */
  556. Tabs.prototype.getType = function () {
  557. return 'tabs';
  558. };
  559. /*
  560. * @private
  561. */
  562. Tabs.prototype.getSecondaryIdentifier = function () {
  563. var tabs = this.getActiveChildNavs();
  564. if (tabs && tabs.length) {
  565. return this._linker._getTabSelector(tabs[0]);
  566. }
  567. return '';
  568. };
  569. /**
  570. * @private
  571. */
  572. Tabs.prototype._getSelectedTabIndex = function (secondaryId, fallbackIndex) {
  573. if (secondaryId === void 0) { secondaryId = ''; }
  574. if (fallbackIndex === void 0) { fallbackIndex = 0; }
  575. // we found a segment which probably represents which tab to select
  576. var indexMatch = secondaryId.match(/tab-(\d+)/);
  577. if (indexMatch) {
  578. // awesome, the segment name was something "tab-0", and
  579. // the numbe represents which tab to select
  580. return parseInt(indexMatch[1], 10);
  581. }
  582. // wasn't in the "tab-0" format so maybe it's using a word
  583. var tab = this._tabs.find(function (t) {
  584. return (util_1.isPresent(t.tabUrlPath) && t.tabUrlPath === secondaryId) ||
  585. (util_1.isPresent(t.tabTitle) && url_serializer_1.formatUrlPart(t.tabTitle) === secondaryId);
  586. });
  587. return util_1.isPresent(tab) ? tab.index : fallbackIndex;
  588. };
  589. Tabs.decorators = [
  590. { type: core_1.Component, args: [{
  591. selector: 'ion-tabs',
  592. template: '<div class="tabbar" role="tablist" #tabbar>' +
  593. '<a *ngFor="let t of _tabs" [tab]="t" class="tab-button" role="tab" href="#" (ionSelect)="select(t)"></a>' +
  594. '<div class="tab-highlight"></div>' +
  595. '</div>' +
  596. '<ng-content></ng-content>' +
  597. '<div #portal tab-portal></div>',
  598. encapsulation: core_1.ViewEncapsulation.None,
  599. providers: [{ provide: split_pane_1.RootNode, useExisting: core_1.forwardRef(function () { return Tabs; }) }]
  600. },] },
  601. ];
  602. /** @nocollapse */
  603. Tabs.ctorParameters = function () { return [
  604. { type: nav_controller_1.NavController, decorators: [{ type: core_1.Optional },] },
  605. { type: view_controller_1.ViewController, decorators: [{ type: core_1.Optional },] },
  606. { type: app_1.App, },
  607. { type: config_1.Config, },
  608. { type: core_1.ElementRef, },
  609. { type: platform_1.Platform, },
  610. { type: core_1.Renderer, },
  611. { type: deep_linker_1.DeepLinker, },
  612. { type: keyboard_1.Keyboard, },
  613. ]; };
  614. Tabs.propDecorators = {
  615. 'name': [{ type: core_1.Input },],
  616. 'selectedIndex': [{ type: core_1.Input },],
  617. 'tabsLayout': [{ type: core_1.Input },],
  618. 'tabsPlacement': [{ type: core_1.Input },],
  619. 'tabsHighlight': [{ type: core_1.Input },],
  620. 'ionChange': [{ type: core_1.Output },],
  621. '_highlight': [{ type: core_1.ViewChild, args: [tab_highlight_1.TabHighlight,] },],
  622. '_tabbar': [{ type: core_1.ViewChild, args: ['tabbar',] },],
  623. 'portal': [{ type: core_1.ViewChild, args: ['portal', { read: core_1.ViewContainerRef },] },],
  624. };
  625. return Tabs;
  626. }(ion_1.Ion));
  627. exports.Tabs = Tabs;
  628. var tabIds = -1;
  629. });
  630. //# sourceMappingURL=tabs.js.map