@material/tabs
Version:
The Material Components for the web tabs component
656 lines (637 loc) • 32.8 kB
TypeScript
// Generated by dts-bundle v0.7.3
// Dependencies for this module:
// ../../../@material/base/types
// ../../../@material/base/component
// ../../../@material/base/foundation
declare module '@material/tabs' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export * from '@material/tabs/tab/index';
export * from '@material/tabs/tab-bar/index';
export * from '@material/tabs/tab-bar-scroller/index';
}
declare module '@material/tabs/tab/index' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export * from '@material/tabs/tab/adapter';
export * from '@material/tabs/tab/component';
export * from '@material/tabs/tab/foundation';
export { cssClasses as tabCssClasses, strings as tabStrings } from '@material/tabs/tab/constants';
}
declare module '@material/tabs/tab-bar/index' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export * from '@material/tabs/tab-bar/adapter';
export * from '@material/tabs/tab-bar/component';
export * from '@material/tabs/tab-bar/foundation';
export * from '@material/tabs/tab-bar/types';
export { cssClasses as tabBarCssClasses, strings as tabBarStrings } from '@material/tabs/tab-bar/constants';
}
declare module '@material/tabs/tab-bar-scroller/index' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export * from '@material/tabs/tab-bar-scroller/adapter';
export * from '@material/tabs/tab-bar-scroller/component';
export * from '@material/tabs/tab-bar-scroller/foundation';
export { cssClasses as tabBarScrollerCssClasses, strings as tabBarScrollerStrings } from '@material/tabs/tab-bar-scroller/constants';
}
declare module '@material/tabs/tab/adapter' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { EventType, SpecificEventListener } from '@material/base/types';
export interface MDCTabAdapter {
addClass: (className: string) => void;
removeClass: (className: string) => void;
registerInteractionHandler: <K extends EventType>(type: K, handler: SpecificEventListener<K>) => void;
deregisterInteractionHandler: <K extends EventType>(type: K, handler: SpecificEventListener<K>) => void;
getOffsetWidth: () => number;
getOffsetLeft: () => number;
notifySelected: () => void;
}
}
declare module '@material/tabs/tab/component' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { MDCComponent } from '@material/base/component';
import { MDCTabFoundation } from '@material/tabs/tab/foundation';
export type MDCTabFactory = (el: Element, foundation?: MDCTabFoundation) => MDCTab;
export interface MDCTabSelectedEventDetail {
tab: MDCTab;
}
export interface MDCTabSelectedEvent extends Event {
readonly detail: MDCTabSelectedEventDetail;
}
export class MDCTab extends MDCComponent<MDCTabFoundation> {
static attachTo(root: Element): MDCTab;
readonly computedWidth: number;
readonly computedLeft: number;
isActive: boolean;
preventDefaultOnClick: boolean;
protected root_: HTMLElement;
destroy(): void;
getDefaultFoundation(): MDCTabFoundation;
initialSyncWithDOM(): void;
measureSelf(): void;
}
}
declare module '@material/tabs/tab/foundation' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { MDCFoundation } from '@material/base/foundation';
import { MDCTabAdapter } from '@material/tabs/tab/adapter';
export class MDCTabFoundation extends MDCFoundation<MDCTabAdapter> {
static readonly cssClasses: {
ACTIVE: string;
};
static readonly strings: {
SELECTED_EVENT: string;
};
static readonly defaultAdapter: MDCTabAdapter;
constructor(adapter?: Partial<MDCTabAdapter>);
init(): void;
destroy(): void;
getComputedWidth(): number;
getComputedLeft(): number;
isActive(): boolean;
setActive(isActive: boolean): void;
preventsDefaultOnClick(): boolean;
setPreventDefaultOnClick(preventDefaultOnClick: boolean): void;
measureSelf(): void;
}
export default MDCTabFoundation;
}
declare module '@material/tabs/tab/constants' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export const cssClasses: {
ACTIVE: string;
};
export const strings: {
SELECTED_EVENT: string;
};
}
declare module '@material/tabs/tab-bar/adapter' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { SpecificEventListener } from '@material/base/types';
import { MDCTabBarChangeEventDetail } from '@material/tabs/tab-bar/types';
export interface MDCTabBarAdapter {
addClass: (className: string) => void;
removeClass: (className: string) => void;
bindOnMDCTabSelectedEvent: () => void;
unbindOnMDCTabSelectedEvent: () => void;
registerResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
deregisterResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
getOffsetWidth: () => number;
setStyleForIndicator: (propertyName: string, value: string) => void;
getOffsetWidthForIndicator: () => number;
notifyChange: (evtData: MDCTabBarChangeEventDetail) => void;
getNumberOfTabs: () => number;
isTabActiveAtIndex: (index: number) => boolean;
setTabActiveAtIndex: (index: number, isActive: boolean) => void;
isDefaultPreventedOnClickForTabAtIndex: (index: number) => boolean;
setPreventDefaultOnClickForTabAtIndex: (index: number, preventDefaultOnClick: boolean) => void;
measureTabAtIndex: (index: number) => void;
getComputedWidthForTabAtIndex: (index: number) => number;
getComputedLeftForTabAtIndex: (index: number) => number;
}
}
declare module '@material/tabs/tab-bar/component' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { MDCComponent } from '@material/base/component';
import { MDCTab, MDCTabFactory } from '@material/tabs/tab/component';
import { MDCTabBarFoundation } from '@material/tabs/tab-bar/foundation';
export type MDCTabBarFactory = (el: Element, foundation?: MDCTabBarFoundation) => MDCTabBar;
export class MDCTabBar extends MDCComponent<MDCTabBarFoundation> {
static attachTo(root: Element): MDCTabBar;
readonly tabs: MDCTab[];
activeTab: MDCTab;
activeTabIndex: number;
protected root_: HTMLElement;
initialize(tabFactory?: MDCTabFactory): void;
getDefaultFoundation(): MDCTabBarFoundation;
layout(): void;
}
}
declare module '@material/tabs/tab-bar/foundation' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { MDCFoundation } from '@material/base/foundation';
import { MDCTabBarAdapter } from '@material/tabs/tab-bar/adapter';
export class MDCTabBarFoundation extends MDCFoundation<MDCTabBarAdapter> {
static readonly cssClasses: {
UPGRADED: string;
};
static readonly strings: {
CHANGE_EVENT: string;
INDICATOR_SELECTOR: string;
TAB_SELECTOR: string;
};
static readonly defaultAdapter: MDCTabBarAdapter;
constructor(adapter?: Partial<MDCTabBarAdapter>);
init(): void;
destroy(): void;
layout(): void;
switchToTabAtIndex(index: number, shouldNotify: boolean): void;
getActiveTabIndex(): number;
}
export default MDCTabBarFoundation;
}
declare module '@material/tabs/tab-bar/types' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export interface MDCTabBarChangeEventDetail {
activeTabIndex: number;
}
export interface MDCTabBarChangeEvent extends Event {
readonly detail: MDCTabBarChangeEventDetail;
}
}
declare module '@material/tabs/tab-bar/constants' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export const cssClasses: {
UPGRADED: string;
};
export const strings: {
CHANGE_EVENT: string;
INDICATOR_SELECTOR: string;
TAB_SELECTOR: string;
};
}
declare module '@material/tabs/tab-bar-scroller/adapter' {
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { EventType, SpecificEventListener } from '@material/base/types';
export interface MDCTabBarScrollerAdapter {
addClass: (className: string) => void;
removeClass: (className: string) => void;
eventTargetHasClass: (target: Element, className: string) => boolean;
addClassToForwardIndicator: (className: string) => void;
removeClassFromForwardIndicator: (className: string) => void;
addClassToBackIndicator: (className: string) => void;
removeClassFromBackIndicator: (className: string) => void;
isRTL: () => boolean;
registerBackIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
deregisterBackIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
registerForwardIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
deregisterForwardIndicatorClickHandler: (handler: SpecificEventListener<'click'>) => void;
registerCapturedInteractionHandler: <K extends EventType>(evt: K, handler: SpecificEventListener<K>) => void;
deregisterCapturedInteractionHandler: <K extends EventType>(evt: K, handler: SpecificEventListener<K>) => void;
registerWindowResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
deregisterWindowResizeHandler: (handler: SpecificEventListener<'resize'>) => void;
getNumberOfTabs: () => number;
getComputedWidthForTabAtIndex: (index: number) => number;
getComputedLeftForTabAtIndex: (index: number) => number;
getOffsetWidthForScrollFrame: () => number;
getScrollLeftForScrollFrame: () => number;
setScrollLeftForScrollFrame: (scrollLeftAmount: number) => void;
getOffsetWidthForTabBar: () => number;
setTransformStyleForTabBar: (value: string) => void;
getOffsetLeftForEventTarget: (target: HTMLElement) => number;
getOffsetWidthForEventTarget: (target: HTMLElement) => number;
}
}
declare module '@material/tabs/tab-bar-scroller/component' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { MDCComponent } from '@material/base/component';
import { MDCTabBar, MDCTabBarFactory } from '@material/tabs/tab-bar/component';
import { MDCTabBarScrollerFoundation } from '@material/tabs/tab-bar-scroller/foundation';
export class MDCTabBarScroller extends MDCComponent<MDCTabBarScrollerFoundation> {
static attachTo(root: Element): MDCTabBarScroller;
readonly tabBar: MDCTabBar;
protected root_: HTMLElement;
initialize(tabBarFactory?: MDCTabBarFactory): void;
getDefaultFoundation(): MDCTabBarScrollerFoundation;
layout(): void;
}
}
declare module '@material/tabs/tab-bar-scroller/foundation' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import { MDCFoundation } from '@material/base/foundation';
import { MDCTabBarScrollerAdapter } from '@material/tabs/tab-bar-scroller/adapter';
export class MDCTabBarScrollerFoundation extends MDCFoundation<MDCTabBarScrollerAdapter> {
static readonly cssClasses: {
INDICATOR_BACK: string;
INDICATOR_ENABLED: string;
INDICATOR_FORWARD: string;
TAB: string;
};
static readonly strings: {
FRAME_SELECTOR: string;
INDICATOR_BACK_SELECTOR: string;
INDICATOR_FORWARD_SELECTOR: string;
TABS_SELECTOR: string;
TAB_SELECTOR: string;
};
static readonly defaultAdapter: MDCTabBarScrollerAdapter;
constructor(adapter?: Partial<MDCTabBarScrollerAdapter>);
init(): void;
destroy(): void;
scrollBack(evt?: MouseEvent): void;
scrollForward(evt?: MouseEvent): void;
layout(): void;
scrollToTabAtIndex(index: number): void;
}
export default MDCTabBarScrollerFoundation;
}
declare module '@material/tabs/tab-bar-scroller/constants' {
/**
* @license
* Copyright 2017 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
export const cssClasses: {
INDICATOR_BACK: string;
INDICATOR_ENABLED: string;
INDICATOR_FORWARD: string;
TAB: string;
};
export const strings: {
FRAME_SELECTOR: string;
INDICATOR_BACK_SELECTOR: string;
INDICATOR_FORWARD_SELECTOR: string;
TABS_SELECTOR: string;
TAB_SELECTOR: string;
};
}