devextreme-react
Version:
DevExtreme React UI and Visualization Components
109 lines (107 loc) • 5.48 kB
TypeScript
/*!
* devextreme-react
* Version: 24.2.6
* Build date: Mon Mar 17 2025
*
* Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file in the root of the project for details.
*
* https://github.com/DevExpress/devextreme-react
*/
export { ExplicitTypes } from "devextreme/ui/tab_panel";
import * as React from "react";
import { Ref, ReactElement } from "react";
import dxTabPanel, { Properties } from "devextreme/ui/tab_panel";
import { IHtmlOptions, NestedComponentMeta } from "./core/component";
import type { dxTabPanelItem, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel";
import type { template } from "devextreme/common";
import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base";
type ReplaceFieldTypes<TSource, TReplacement> = {
[P in keyof TSource]: P extends keyof TReplacement ? TReplacement[P] : TSource[P];
};
type ITabPanelOptionsNarrowedEvents<TItem = any, TKey = any> = {
onContentReady?: ((e: ContentReadyEvent<TItem, TKey>) => void);
onDisposing?: ((e: DisposingEvent<TItem, TKey>) => void);
onInitialized?: ((e: InitializedEvent<TItem, TKey>) => void);
onItemClick?: ((e: ItemClickEvent<TItem, TKey>) => void);
onItemContextMenu?: ((e: ItemContextMenuEvent<TItem, TKey>) => void);
onItemHold?: ((e: ItemHoldEvent<TItem, TKey>) => void);
onItemRendered?: ((e: ItemRenderedEvent<TItem, TKey>) => void);
onSelectionChanging?: ((e: SelectionChangingEvent<TItem, TKey>) => void);
onTitleClick?: ((e: TitleClickEvent<TItem, TKey>) => void);
onTitleHold?: ((e: TitleHoldEvent<TItem, TKey>) => void);
onTitleRendered?: ((e: TitleRenderedEvent<TItem, TKey>) => void);
};
type ITabPanelOptions<TItem = any, TKey = any> = React.PropsWithChildren<ReplaceFieldTypes<Properties<TItem, TKey>, ITabPanelOptionsNarrowedEvents<TItem, TKey>> & IHtmlOptions & {
dataSource?: Properties<TItem, TKey>["dataSource"];
itemRender?: (...params: any) => React.ReactNode;
itemComponent?: React.ComponentType<any>;
itemTitleRender?: (...params: any) => React.ReactNode;
itemTitleComponent?: React.ComponentType<any>;
defaultItems?: Array<any | dxTabPanelItem | string>;
defaultSelectedIndex?: number;
defaultSelectedItem?: any;
onItemsChange?: (value: Array<any | dxTabPanelItem | string>) => void;
onSelectedIndexChange?: (value: number) => void;
onSelectedItemChange?: (value: any) => void;
}>;
interface TabPanelRef<TItem = any, TKey = any> {
instance: () => dxTabPanel<TItem, TKey>;
}
declare const TabPanel: <TItem = any, TKey = any>(props: ReplaceFieldTypes<Properties<TItem, TKey>, ITabPanelOptionsNarrowedEvents<TItem, TKey>> & IHtmlOptions & {
dataSource?: import("devextreme/data/data_source").DataSourceLike<TItem, TKey> | null | undefined;
itemRender?: ((...params: any) => React.ReactNode) | undefined;
itemComponent?: React.ComponentType<any> | undefined;
itemTitleRender?: ((...params: any) => React.ReactNode) | undefined;
itemTitleComponent?: React.ComponentType<any> | undefined;
defaultItems?: any[] | undefined;
defaultSelectedIndex?: number | undefined;
defaultSelectedItem?: any;
onItemsChange?: ((value: Array<any | dxTabPanelItem | string>) => void) | undefined;
onSelectedIndexChange?: ((value: number) => void) | undefined;
onSelectedItemChange?: ((value: any) => void) | undefined;
} & {
children?: React.ReactNode;
} & {
ref?: React.Ref<TabPanelRef<TItem, TKey>> | undefined;
}) => ReactElement | null;
type IItemProps = React.PropsWithChildren<{
badge?: string;
disabled?: boolean;
html?: string;
icon?: string;
tabTemplate?: (() => string | any) | template;
template?: ((itemData: CollectionWidgetItem, itemIndex: number, itemElement: any) => string | any) | template;
text?: string;
title?: string;
visible?: boolean;
tabRender?: (...params: any) => React.ReactNode;
tabComponent?: React.ComponentType<any>;
render?: (...params: any) => React.ReactNode;
component?: React.ComponentType<any>;
}>;
declare const Item: ((props: IItemProps) => React.FunctionComponentElement<React.PropsWithChildren<{
badge?: string | undefined;
disabled?: boolean | undefined;
html?: string | undefined;
icon?: string | undefined;
tabTemplate?: template | (() => string | any) | undefined;
template?: template | ((itemData: CollectionWidgetItem, itemIndex: number, itemElement: any) => string | any) | undefined;
text?: string | undefined;
title?: string | undefined;
visible?: boolean | undefined;
tabRender?: ((...params: any) => React.ReactNode) | undefined;
tabComponent?: React.ComponentType<any> | undefined;
render?: ((...params: any) => React.ReactNode) | undefined;
component?: React.ComponentType<any> | undefined;
} & {
children?: React.ReactNode;
} & {
elementDescriptor: import("./core/configuration/react/element").IElementDescriptor;
}>>) & NestedComponentMeta;
export default TabPanel;
export { TabPanel, ITabPanelOptions, TabPanelRef, Item, IItemProps };
import type * as TabPanelTypes from 'devextreme/ui/tab_panel_types';
export { TabPanelTypes };