component.d.ts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * @license
  3. * Copyright 2018 Google Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. * THE SOFTWARE.
  22. */
  23. import { MDCComponent } from '@material/base/component';
  24. import { MDCTabScrollerFactory } from '@material/tab-scroller/component';
  25. import { MDCTabFactory } from '@material/tab/component';
  26. import { MDCTabBarFoundation } from './foundation';
  27. /** MDC Tab Bar */
  28. export declare class MDCTabBar extends MDCComponent<MDCTabBarFoundation> {
  29. static attachTo(root: HTMLElement): MDCTabBar;
  30. private tabList;
  31. private tabScroller;
  32. private handleTabInteraction;
  33. private handleKeyDown;
  34. set focusOnActivate(focusOnActivate: boolean);
  35. set useAutomaticActivation(useAutomaticActivation: boolean);
  36. initialize(tabFactory?: MDCTabFactory, tabScrollerFactory?: MDCTabScrollerFactory): void;
  37. initialSyncWithDOM(): void;
  38. destroy(): void;
  39. getDefaultFoundation(): MDCTabBarFoundation;
  40. /**
  41. * Activates the tab at the given index
  42. * @param index The index of the tab
  43. */
  44. activateTab(index: number): void;
  45. /**
  46. * Scrolls the tab at the given index into view
  47. * @param index THe index of the tab
  48. */
  49. scrollIntoView(index: number): void;
  50. /**
  51. * Returns all the tab elements in a nice clean array
  52. */
  53. private getTabElements;
  54. /**
  55. * Instantiates tab components on all child tab elements
  56. */
  57. private instantiateTabs;
  58. /**
  59. * Instantiates tab scroller component on the child tab scroller element
  60. */
  61. private instantiatetabScroller;
  62. }