UNPKG

smart-webcomponents-angular

Version:

[![Price](https://img.shields.io/badge/price-COMMERCIAL-0098f7.svg)](https://jqwidgets.com/license/)

208 lines (207 loc) 12.2 kB
import { Tabs } from './../index'; import { Animation, TabsCloseButtonMode, Overflow, LayoutPosition, TabsScrollMode, TabSelectionMode, TabsTabLayout, TabPosition, Orientation } from './../index'; import { AfterViewInit, ElementRef, OnInit, OnChanges, OnDestroy, SimpleChanges, EventEmitter } from '@angular/core'; import { BaseElement } from './smart.element'; import * as i0 from "@angular/core"; export { Animation, TabsCloseButtonMode, Overflow, LayoutPosition, TabsScrollMode, TabSelectionMode, TabsTabLayout, TabPosition, Orientation, ElementRenderMode } from './../index'; export { Smart } from './smart.element'; export { Tabs } from './../index'; export declare class TabsComponent extends BaseElement implements OnInit, AfterViewInit, OnDestroy, OnChanges { constructor(ref: ElementRef<Tabs>); private eventHandlers; nativeElement: Tabs; /** @description Creates the component on demand. * @param properties An optional object of properties, which will be added to the template binded ones. */ createComponent(properties?: {}): any; /** @description Sets or gets whether the "Add new tab" button (+) is displayed. */ get addNewTab(): boolean; set addNewTab(value: boolean); /** @description Allows toggle. If set to true, **selectedIndex** can be set to null (no selected tab). */ get allowToggle(): boolean; set allowToggle(value: boolean); /** @description Sets or gets the animation mode. Animation is disabled when the property is set to 'none' */ get animation(): Animation | string; set animation(value: Animation | string); /** @description Sets or gets the close button mode. */ get closeButtonMode(): TabsCloseButtonMode | string; set closeButtonMode(value: TabsCloseButtonMode | string); /** @description Sets or gets whether close buttons are displayed. */ get closeButtons(): boolean; set closeButtons(value: boolean); /** @description Sets or gets whether the Tabs content section is collapsed. */ get collapsed(): boolean; set collapsed(value: boolean); /** @description Enables or disables the collapsible feature. */ get collapsible(): boolean; set collapsible(value: boolean); /** @description Determines the data source that will be loaded to the Tabs. */ get dataSource(): any; set dataSource(value: any); /** @description Enables or disables the element. */ get disabled(): boolean; set disabled(value: boolean); /** @description Enables or disables scrolling using the mouse wheel through overflowing tab labels in the tab strip. */ get enableMouseWheelAction(): boolean; set enableMouseWheelAction(value: boolean); /** @description Sets or gets the license which unlocks the product. */ get license(): string; set license(value: string); /** @description Sets or gets the locale. Used in conjunction with the property messages. */ get locale(): string; set locale(value: string); /** @description Callback, related to localization module. */ get localizeFormatFunction(): any; set localizeFormatFunction(value: any); /** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */ get messages(): any; set messages(value: any); /** @description Sets or gets the widget's name. */ get name(): string; set name(value: string); /** @description Sets or gets the Tabs scroll buttons behavior. Applicable only when tabLayout is 'scroll'. */ get overflow(): Overflow | string; set overflow(value: Overflow | string); /** @description Disables user interaction with the element. */ get readonly(): boolean; set readonly(value: boolean); /** @description Enables or disables the reorder feature. When this feature is enabled, the end-user can drag a tab and drop it over another tab. As a result the tabs will be reordered. */ get reorder(): boolean; set reorder(value: boolean); /** @description Sets or gets whether tab labels can be resized by dragging with the mouse. */ get resize(): boolean; set resize(value: boolean); /** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */ get rightToLeft(): boolean; set rightToLeft(value: boolean); /** @description Sets or gets the position of the scroll buttons. */ get scrollButtonsPosition(): LayoutPosition | string; set scrollButtonsPosition(value: LayoutPosition | string); /** @description Sets or gets the behavior when scrolling the tab strip via the scroll buttons. */ get scrollMode(): TabsScrollMode | string; set scrollMode(value: TabsScrollMode | string); /** @description Sets or gets which tab is selected. */ get selectedIndex(): number | null; set selectedIndex(value: number | null); /** @description Determines the way the user can switch between tabs. */ get selectionMode(): TabSelectionMode | string; set selectionMode(value: TabSelectionMode | string); /** @description Applies one of four behaviors when the element is not wide enough to display all tab labels. */ get tabLayout(): TabsTabLayout | string; set tabLayout(value: TabsTabLayout | string); /** @description Sets or gets where the tab strip is positioned. */ get tabPosition(): TabPosition | string; set tabPosition(value: TabPosition | string); /** @description Sets or gets the orientation of the text in the tabs. */ get tabTextOrientation(): Orientation | string; set tabTextOrientation(value: Orientation | string); /** @description Determines the theme. Theme defines the look of the element */ get theme(): string; set theme(value: string); /** @description If is set to true, the element cannot be focused. */ get unfocusable(): boolean; set unfocusable(value: boolean); /** @description This event is triggered when the addNewTab is enabled and is clicked. * @param event. The custom event. */ onAddNewTabClick: EventEmitter<CustomEvent>; /** @description This event is triggered when the tab selection is changed. * @param event. The custom event. Custom event was created with: event.detail( index, oldIndex) * index - The tab's index. * oldIndex - The tab's old index. */ onChange: EventEmitter<CustomEvent>; /** @description This event is triggered when a tab is closed. * @param event. The custom event. Custom event was created with: event.detail( index) * index - The tab's index. */ onClose: EventEmitter<CustomEvent>; /** @description This event is triggered when a tab is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function. * @param event. The custom event. Custom event was created with: event.detail( index) * index - The tab's index. */ onClosing: EventEmitter<CustomEvent>; /** @description This event is triggered when a drag operation has ended. * @param event. The custom event. Custom event was created with: event.detail( left, top, index, label) * left - The tab's left position. * top - The tab's top position. * index - The tab's index. * label - The tab's label. */ onDragEnd: EventEmitter<CustomEvent>; /** @description This event is triggered when a drag operation has started. * @param event. The custom event. Custom event was created with: event.detail( left, top, index, label) * left - The tab's left position. * top - The tab's top position. * index - The tab's index. * label - The tab's label. */ onDragStart: EventEmitter<CustomEvent>; /** @description This event is triggered when tabs have been reordered. * @param event. The custom event. Custom event was created with: event.detail( index, oldIndex) * index - The tab's index. * oldIndex - The tab's old index. */ onReorder: EventEmitter<CustomEvent>; /** @description Collapses the content section. */ collapse(): void; /** @description Returns the label of a Tab at given index. * @param {number} index. The index of the tab. * @returns {string} */ getTabLabel(index: any): Promise<any>; /** @description Returns the content of a Tab at given index. * @param {number} index. The index of the tab. * @returns {HTMLElement} */ getTabContent(index: any): Promise<any>; /** @description Makes sure a tab is visible by scrolling to it. * @param {number} index. The index of the tab to scroll to. */ ensureVisible(index: number): void; /** @description Expands the content section. */ expand(): void; /** @description Returns an array of the TabItems inside the element. * @returns {TabItem[]} */ getTabs(): Promise<any>; /** @description Returns the offset of the tab item container (smart-tab-item element) from the edge of the Tabs (smart-tabs element) where the tab strip is positioned. * @param {number} index. The index of the tab item. * @returns {number} */ getOffsetFromEdgeOfElement(index: any): Promise<any>; /** @description Inserts a new tab and an associated content section. * @param {number} index. The index to insert a new tab at. * @param {any} details. An Object with the fields "label", "labelSize", "content" and "group". */ insert(index: number, details: any): void; /** @description Refreshes the Tabs header section. Useful when the header contains elements (such as images) loaded slower than the Tabs itself. */ refreshTabHeader(): void; /** @description Removes a tab and its associated content section. * @param {number} index. The index of the tab to remove. */ removeAt(index: number): void; /** @description Selects a tab. * @param {number} index. The index of the tab to select. */ select(index: number): void; /** @description Updates a tab and its associated content section. * @param {number} index. The index of the tab to update. * @param {string} label. The new label of the tab. The value can be the id of an HTMLTemplateElement * @param {string | HTMLElement} content. The new content of the tab. */ update(index: number, label: string, content: string | HTMLElement): void; get isRendered(): boolean; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; /** @description Add event listeners. */ private listen; /** @description Remove event listeners. */ private unlisten; static ɵfac: i0.ɵɵFactoryDeclaration<TabsComponent, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<TabsComponent, "smart-tabs, [smart-tabs]", ["smart-tabs"], { "addNewTab": "addNewTab"; "allowToggle": "allowToggle"; "animation": "animation"; "closeButtonMode": "closeButtonMode"; "closeButtons": "closeButtons"; "collapsed": "collapsed"; "collapsible": "collapsible"; "dataSource": "dataSource"; "disabled": "disabled"; "enableMouseWheelAction": "enableMouseWheelAction"; "license": "license"; "locale": "locale"; "localizeFormatFunction": "localizeFormatFunction"; "messages": "messages"; "name": "name"; "overflow": "overflow"; "readonly": "readonly"; "reorder": "reorder"; "resize": "resize"; "rightToLeft": "rightToLeft"; "scrollButtonsPosition": "scrollButtonsPosition"; "scrollMode": "scrollMode"; "selectedIndex": "selectedIndex"; "selectionMode": "selectionMode"; "tabLayout": "tabLayout"; "tabPosition": "tabPosition"; "tabTextOrientation": "tabTextOrientation"; "theme": "theme"; "unfocusable": "unfocusable"; }, { "onAddNewTabClick": "onAddNewTabClick"; "onChange": "onChange"; "onClose": "onClose"; "onClosing": "onClosing"; "onDragEnd": "onDragEnd"; "onDragStart": "onDragStart"; "onReorder": "onReorder"; }, never>; }