tabset.d.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import { AfterContentChecked, EventEmitter, QueryList, TemplateRef } from '@angular/core';
  2. import { NgbTabsetConfig } from './tabset-config';
  3. /**
  4. * A directive to wrap tab titles that need to contain HTML markup or other directives.
  5. *
  6. * Alternatively you could use the `NgbTab.title` input for string titles.
  7. */
  8. export declare class NgbTabTitle {
  9. templateRef: TemplateRef<any>;
  10. constructor(templateRef: TemplateRef<any>);
  11. }
  12. /**
  13. * A directive to wrap content to be displayed in a tab.
  14. */
  15. export declare class NgbTabContent {
  16. templateRef: TemplateRef<any>;
  17. constructor(templateRef: TemplateRef<any>);
  18. }
  19. /**
  20. * A directive representing an individual tab.
  21. */
  22. export declare class NgbTab implements AfterContentChecked {
  23. /**
  24. * The tab identifier.
  25. *
  26. * Must be unique for the entire document for proper accessibility support.
  27. */
  28. id: string;
  29. /**
  30. * The tab title.
  31. *
  32. * Use the [`NgbTabTitle`](#/components/tabset/api#NgbTabTitle) directive for non-string titles.
  33. */
  34. title: string;
  35. /**
  36. * If `true`, the current tab is disabled and can't be toggled.
  37. */
  38. disabled: boolean;
  39. titleTpl: NgbTabTitle | null;
  40. contentTpl: NgbTabContent | null;
  41. titleTpls: QueryList<NgbTabTitle>;
  42. contentTpls: QueryList<NgbTabContent>;
  43. ngAfterContentChecked(): void;
  44. }
  45. /**
  46. * The payload of the change event fired right before the tab change.
  47. */
  48. export interface NgbTabChangeEvent {
  49. /**
  50. * The id of the currently active tab.
  51. */
  52. activeId: string;
  53. /**
  54. * The id of the newly selected tab.
  55. */
  56. nextId: string;
  57. /**
  58. * Calling this function will prevent tab switching.
  59. */
  60. preventDefault: () => void;
  61. }
  62. /**
  63. * A component that makes it easy to create tabbed interface.
  64. */
  65. export declare class NgbTabset implements AfterContentChecked {
  66. justifyClass: string;
  67. tabs: QueryList<NgbTab>;
  68. /**
  69. * The identifier of the tab that should be opened **initially**.
  70. *
  71. * For subsequent tab switches use the `.select()` method and the `(tabChange)` event.
  72. */
  73. activeId: string;
  74. /**
  75. * If `true`, non-visible tabs content will be removed from DOM. Otherwise it will just be hidden.
  76. */
  77. destroyOnHide: boolean;
  78. /**
  79. * The horizontal alignment of the tabs with flexbox utilities.
  80. */
  81. justify: 'start' | 'center' | 'end' | 'fill' | 'justified';
  82. /**
  83. * The orientation of the tabset.
  84. */
  85. orientation: 'horizontal' | 'vertical';
  86. /**
  87. * Type of navigation to be used for tabs.
  88. *
  89. * Currently Bootstrap supports only `"tabs"` and `"pills"`.
  90. *
  91. * Since `3.0.0` can also be an arbitrary string (ex. for custom themes).
  92. */
  93. type: 'tabs' | 'pills' | string;
  94. /**
  95. * A tab change event emitted right before the tab change happens.
  96. *
  97. * See [`NgbTabChangeEvent`](#/components/tabset/api#NgbTabChangeEvent) for payload details.
  98. */
  99. tabChange: EventEmitter<NgbTabChangeEvent>;
  100. constructor(config: NgbTabsetConfig);
  101. /**
  102. * Selects the tab with the given id and shows its associated content panel.
  103. *
  104. * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
  105. * hidden depending on the `destroyOnHide` value.
  106. */
  107. select(tabId: string): void;
  108. ngAfterContentChecked(): void;
  109. private _getTabById;
  110. }