@@ -13,11 +13,11 @@ import {
13
13
} from '@builder.io/qwik' ;
14
14
import { KeyCode } from '../../utils/key-code.type' ;
15
15
import { Behavior } from './behavior.type' ;
16
- import { Tab , TabProps } from './tab' ;
17
- import { TabPanel , TabPanelProps } from './tab-panel' ;
16
+ import { Tab as InternalTab , TabProps } from './tab' ;
17
+ import { TabPanel as InternalTabPanel , TabPanelProps } from './tab-panel' ;
18
18
import { tabsContextId } from './tabs-context-id' ;
19
19
import { TabsContext } from './tabs-context.type' ;
20
- import { TabList } from './tabs-list' ;
20
+ import { TabList as InternalTabList } from './tabs-list' ;
21
21
22
22
/**
23
23
* TABS TODOs
@@ -56,6 +56,9 @@ export type TabsProps = {
56
56
'bind:selectedTabId' ?: Signal < string | undefined > ;
57
57
tabClass ?: QwikIntrinsicElements [ 'div' ] [ 'class' ] ;
58
58
panelClass ?: QwikIntrinsicElements [ 'div' ] [ 'class' ] ;
59
+ TabList ?: typeof InternalTabList ;
60
+ Tab ?: typeof InternalTab ;
61
+ TabPanel ?: typeof InternalTabPanel ;
59
62
} & QwikIntrinsicElements [ 'div' ] ;
60
63
61
64
export type TabInfo = {
@@ -69,8 +72,21 @@ export type TabInfo = {
69
72
// standard structure. It must take care to retain the props objects
70
73
// unchanged so signals keep working
71
74
export const Tabs : FunctionComponent < TabsProps > = ( props ) => {
72
- const { children : myChildren , tabClass, panelClass, ...rest } = props ;
73
- const childrenToProcess = Array . isArray ( myChildren ) ? [ ...myChildren ] : [ myChildren ] ;
75
+ const {
76
+ children,
77
+ tabClass,
78
+ panelClass,
79
+ TabList : UserTabList ,
80
+ Tab : UserTab ,
81
+ TabPanel : UserTabPanel ,
82
+ ...rest
83
+ } = props ;
84
+
85
+ const TabList = UserTabList ? UserTabList : InternalTabList ;
86
+ const Tab = UserTab ? UserTab : InternalTab ;
87
+ const TabPanel = UserTabPanel ? UserTabPanel : InternalTabPanel ;
88
+
89
+ const childrenToProcess = Array . isArray ( children ) ? [ ...children ] : [ children ] ;
74
90
let tabListComponent : JSXNode | undefined ;
75
91
const tabComponents : JSXNode [ ] = [ ] ;
76
92
const panelComponents : JSXNode [ ] = [ ] ;
0 commit comments