@elliemae/ds-tabs 2.0.0-alpha.1 → 2.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSTabs.js +29 -107
- package/cjs/DSTabsCTX.js +30 -0
- package/cjs/DSTabsDatatestid.js +18 -0
- package/cjs/DSTabsTypes.js +2 -0
- package/cjs/config/useCrossRef.js +17 -0
- package/cjs/config/useTabs.js +51 -0
- package/cjs/defaultProps.js +27 -0
- package/cjs/{PanelContainer.js → exportsRelated/DSTab.js} +19 -28
- package/cjs/index.js +5 -5
- package/cjs/parts/carousel/Carousel.js +71 -0
- package/cjs/parts/carousel/styles.js +60 -0
- package/cjs/parts/carousel/useCarousel.js +78 -0
- package/cjs/parts/carousel/useCarouselCallbacks.js +72 -0
- package/cjs/parts/tabBar/TabBar.js +160 -0
- package/cjs/parts/tabBar/styles.js +199 -0
- package/cjs/parts/tabBar/useTabBar.js +98 -0
- package/cjs/parts/tabsContent/TabsContent.js +49 -0
- package/cjs/parts/tabsContent/styles.js +15 -0
- package/cjs/parts/tabsPanel/TabsPanels.js +77 -0
- package/cjs/parts/tabsPanel/styles.js +25 -0
- package/cjs/propTypes.js +33 -0
- package/cjs/utils/constants.js +29 -0
- package/cjs/utils/helpers.js +47 -0
- package/cjs/utils/hooks/useKeyboardNavigation.js +61 -0
- package/cjs/utils/hooks/useTabsCallbacks.js +59 -0
- package/esm/DSTabs.js +30 -108
- package/esm/DSTabsCTX.js +25 -0
- package/esm/DSTabsDatatestid.js +14 -0
- package/esm/DSTabsTypes.js +1 -0
- package/esm/config/useCrossRef.js +13 -0
- package/esm/config/useTabs.js +47 -0
- package/esm/defaultProps.js +23 -0
- package/esm/{PanelContainer.js → exportsRelated/DSTab.js} +11 -23
- package/esm/index.js +4 -3
- package/esm/parts/carousel/Carousel.js +63 -0
- package/esm/parts/carousel/styles.js +49 -0
- package/esm/parts/carousel/useCarousel.js +70 -0
- package/esm/parts/carousel/useCarouselCallbacks.js +68 -0
- package/esm/parts/tabBar/TabBar.js +151 -0
- package/esm/parts/tabBar/styles.js +185 -0
- package/esm/parts/tabBar/useTabBar.js +90 -0
- package/esm/parts/tabsContent/TabsContent.js +40 -0
- package/esm/parts/tabsContent/styles.js +7 -0
- package/esm/parts/tabsPanel/TabsPanels.js +67 -0
- package/esm/parts/tabsPanel/styles.js +17 -0
- package/esm/propTypes.js +28 -0
- package/esm/utils/constants.js +21 -0
- package/esm/utils/helpers.js +37 -0
- package/esm/utils/hooks/useKeyboardNavigation.js +57 -0
- package/esm/utils/hooks/useTabsCallbacks.js +55 -0
- package/package.json +100 -37
- package/types/DSTabs.d.ts +10 -60
- package/types/DSTabsCTX.d.ts +4 -0
- package/types/DSTabsDatatestid.d.ts +12 -0
- package/types/DSTabsTypes.d.ts +202 -0
- package/types/config/useCrossRef.d.ts +2 -0
- package/types/config/useTabs.d.ts +2 -0
- package/types/defaultProps.d.ts +2 -0
- package/types/exportsRelated/DSTab.d.ts +14 -0
- package/types/index.d.ts +4 -3
- package/types/parts/carousel/Carousel.d.ts +3 -0
- package/types/parts/carousel/styles.d.ts +9 -0
- package/types/parts/carousel/useCarousel.d.ts +2 -0
- package/types/parts/carousel/useCarouselCallbacks.d.ts +2 -0
- package/types/parts/tabBar/TabBar.d.ts +2 -0
- package/types/parts/tabBar/styles.d.ts +7 -0
- package/types/parts/tabBar/useTabBar.d.ts +2 -0
- package/types/parts/tabsContent/TabsContent.d.ts +2 -0
- package/types/parts/tabsContent/styles.d.ts +1 -0
- package/types/parts/tabsPanel/TabsPanels.d.ts +2 -0
- package/types/parts/tabsPanel/styles.d.ts +2 -0
- package/types/propTypes.d.ts +54 -0
- package/types/tests/{DSTabs.events.test.d.ts → DSTabs.callbacks.test.d.ts} +0 -0
- package/types/tests/DSTabs.func.test.d.ts +1 -0
- package/types/tests/DSTabs.keyboard.test.d.ts +1 -0
- package/types/utils/constants.d.ts +19 -0
- package/types/utils/helpers.d.ts +8 -0
- package/types/utils/hooks/useKeyboardNavigation.d.ts +2 -0
- package/types/utils/hooks/useTabsCallbacks.d.ts +2 -0
- package/cjs/Carousel.js +0 -197
- package/cjs/DSTab.js +0 -43
- package/cjs/SubTabBar.js +0 -45
- package/cjs/TabBar.js +0 -410
- package/cjs/TabTypes.js +0 -12
- package/cjs/TabsImpl.js +0 -114
- package/cjs/TabsPanels.js +0 -82
- package/cjs/package.json +0 -7
- package/cjs/useResize.js +0 -24
- package/esm/Carousel.js +0 -186
- package/esm/DSTab.js +0 -33
- package/esm/SubTabBar.js +0 -39
- package/esm/TabBar.js +0 -399
- package/esm/TabTypes.js +0 -7
- package/esm/TabsImpl.js +0 -107
- package/esm/TabsPanels.js +0 -72
- package/esm/package.json +0 -7
- package/esm/useResize.js +0 -20
- package/types/Carousel.d.ts +0 -16
- package/types/DSTab.d.ts +0 -22
- package/types/PanelContainer.d.ts +0 -20
- package/types/SubTabBar.d.ts +0 -23
- package/types/TabBar.d.ts +0 -30
- package/types/TabTypes.d.ts +0 -5
- package/types/TabsImpl.d.ts +0 -37
- package/types/TabsPanels.d.ts +0 -5
- package/types/useResize.d.ts +0 -1
package/esm/TabsImpl.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
4
|
-
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
5
|
-
import TabsPanels from './TabsPanels.js';
|
|
6
|
-
import TabBar from './TabBar.js';
|
|
7
|
-
import SubTabBar from './SubTabBar.js';
|
|
8
|
-
import { TabTypes } from './TabTypes.js';
|
|
9
|
-
import { jsxs } from 'react/jsx-runtime';
|
|
10
|
-
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
|
-
const blockName = 'tabs';
|
|
15
|
-
const StyledTabsContainer = aggregatedClasses('div')(blockName);
|
|
16
|
-
const StyledTabBarContainer = aggregatedClasses('div')(blockName, 'tab-bar-container');
|
|
17
|
-
const TabBarComponentsByType = {
|
|
18
|
-
[TabTypes.NORMAL]: TabBar,
|
|
19
|
-
[TabTypes.SUBTABS]: SubTabBar
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const TabsImpl = props => {
|
|
23
|
-
var _tabs$, _tabs$$props, _TabsPanels, _StyledTabBarContaine;
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
animated,
|
|
27
|
-
children: tabs,
|
|
28
|
-
type,
|
|
29
|
-
tabBarExtraContent,
|
|
30
|
-
onTabChange,
|
|
31
|
-
enableMouseEvents,
|
|
32
|
-
innerRef,
|
|
33
|
-
onlyRenderActiveTab,
|
|
34
|
-
containerProps,
|
|
35
|
-
allowTextSelection,
|
|
36
|
-
tabsListAriaLabel,
|
|
37
|
-
activeTab,
|
|
38
|
-
firstSubtabRef,
|
|
39
|
-
lastTabRef,
|
|
40
|
-
withCarousel,
|
|
41
|
-
flexibleTabsHeaders,
|
|
42
|
-
fixedTabsHeaders,
|
|
43
|
-
isDSMobile
|
|
44
|
-
} = props;
|
|
45
|
-
const [actualActiveTab, setActualActiveTab] = useState(activeTab || (tabs === null || tabs === void 0 ? void 0 : (_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : (_tabs$$props = _tabs$.props) === null || _tabs$$props === void 0 ? void 0 : _tabs$$props.tabId));
|
|
46
|
-
const firstTabRefByParent = useRef(null);
|
|
47
|
-
const lastTabRefByParent = useRef(null);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (activeTab) {
|
|
50
|
-
setActualActiveTab(activeTab);
|
|
51
|
-
}
|
|
52
|
-
}, [activeTab]);
|
|
53
|
-
const handleTabClick = useCallback(tab => {
|
|
54
|
-
setActualActiveTab(tab);
|
|
55
|
-
onTabChange(tab);
|
|
56
|
-
}, [onTabChange]);
|
|
57
|
-
const handleDownArrow = useCallback(e => {
|
|
58
|
-
var _firstTabRefByParent$;
|
|
59
|
-
|
|
60
|
-
e.preventDefault();
|
|
61
|
-
e.stopPropagation();
|
|
62
|
-
if (firstTabRefByParent !== null && firstTabRefByParent !== void 0 && firstTabRefByParent.current) (_firstTabRefByParent$ = firstTabRefByParent.current) === null || _firstTabRefByParent$ === void 0 ? void 0 : _firstTabRefByParent$.focus();
|
|
63
|
-
}, [firstTabRefByParent]);
|
|
64
|
-
const handleUpArrow = useCallback(e => {
|
|
65
|
-
var _lastTabRef$current;
|
|
66
|
-
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
e.stopPropagation();
|
|
69
|
-
if (lastTabRef !== null && lastTabRef !== void 0 && lastTabRef.current) (_lastTabRef$current = lastTabRef.current) === null || _lastTabRef$current === void 0 ? void 0 : _lastTabRef$current.focus();
|
|
70
|
-
}, [lastTabRef]);
|
|
71
|
-
const PureTabBarComponent = useMemo(() => {
|
|
72
|
-
const TabBarComponent = TabBarComponentsByType[type] || TabBar;
|
|
73
|
-
return /*#__PURE__*/_jsx(TabBarComponent, {
|
|
74
|
-
withCarousel: withCarousel,
|
|
75
|
-
activeTab: actualActiveTab,
|
|
76
|
-
onTabClick: handleTabClick,
|
|
77
|
-
tabs: tabs,
|
|
78
|
-
firstSubtabRef: firstSubtabRef,
|
|
79
|
-
lastTabRef: lastTabRefByParent,
|
|
80
|
-
handleDownArrow: handleDownArrow,
|
|
81
|
-
handleUpArrow: handleUpArrow,
|
|
82
|
-
isDSMobile: isDSMobile,
|
|
83
|
-
flexibleTabsHeaders: flexibleTabsHeaders,
|
|
84
|
-
fixedTabsHeaders: fixedTabsHeaders
|
|
85
|
-
});
|
|
86
|
-
}, [type, withCarousel, actualActiveTab, handleTabClick, tabs, firstSubtabRef, lastTabRefByParent, handleDownArrow, handleUpArrow, isDSMobile]);
|
|
87
|
-
const PureTabsPanels = useMemo(() => _TabsPanels || (_TabsPanels = /*#__PURE__*/_jsx(TabsPanels, {
|
|
88
|
-
activeTab: actualActiveTab,
|
|
89
|
-
allowTextSelection: allowTextSelection,
|
|
90
|
-
animated: animated,
|
|
91
|
-
enableMouseEvents: enableMouseEvents,
|
|
92
|
-
onlyRenderActiveTab: onlyRenderActiveTab,
|
|
93
|
-
onTabChange: handleTabClick,
|
|
94
|
-
tabsComponents: tabs,
|
|
95
|
-
lastTabRef: lastTabRefByParent,
|
|
96
|
-
firstTabRefByParent: firstTabRefByParent
|
|
97
|
-
})), [actualActiveTab, allowTextSelection, animated, enableMouseEvents, onlyRenderActiveTab, handleTabClick, tabs, lastTabRefByParent, firstTabRefByParent]);
|
|
98
|
-
const PureTabsImpl = useMemo(() => /*#__PURE__*/jsxs(StyledTabsContainer, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
99
|
-
"aria-label": tabsListAriaLabel,
|
|
100
|
-
innerRef: innerRef,
|
|
101
|
-
role: "tablist",
|
|
102
|
-
children: [_StyledTabBarContaine || (_StyledTabBarContaine = /*#__PURE__*/_jsx(StyledTabBarContainer, {}, void 0, PureTabBarComponent, tabBarExtraContent)), PureTabsPanels]
|
|
103
|
-
})), [containerProps, tabsListAriaLabel, innerRef, PureTabBarComponent, tabBarExtraContent, PureTabsPanels]);
|
|
104
|
-
return PureTabsImpl;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export { TabsImpl as default };
|
package/esm/TabsPanels.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import memoizeOne from 'memoize-one';
|
|
5
|
-
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
6
|
-
import SwipeableViews from 'react-swipeable-views';
|
|
7
|
-
import PanelContainer from './PanelContainer.js';
|
|
8
|
-
|
|
9
|
-
const blockName = 'tabs-panels';
|
|
10
|
-
const Panels = aggregatedClasses('div')(blockName);
|
|
11
|
-
|
|
12
|
-
const getIndexById = (children, activeId) => children && children.findIndex(item => item.props.tabId === activeId);
|
|
13
|
-
|
|
14
|
-
const getIdByIndex = (children, index) => children && children[index].props.tabId;
|
|
15
|
-
|
|
16
|
-
class TabsPanels extends Component {
|
|
17
|
-
constructor(...args) {
|
|
18
|
-
super(...args);
|
|
19
|
-
|
|
20
|
-
_defineProperty(this, "renderPanels", memoizeOne((activeTab, tabsComponents) => {
|
|
21
|
-
const {
|
|
22
|
-
animated,
|
|
23
|
-
onlyRenderActiveTab,
|
|
24
|
-
allowTextSelection
|
|
25
|
-
} = this.props;
|
|
26
|
-
return React.Children.map(tabsComponents, tab => {
|
|
27
|
-
const {
|
|
28
|
-
tabId: panelId,
|
|
29
|
-
style,
|
|
30
|
-
children: content
|
|
31
|
-
} = tab.props;
|
|
32
|
-
const isActive = activeTab === panelId;
|
|
33
|
-
const shouldRender = !onlyRenderActiveTab || isActive;
|
|
34
|
-
return /*#__PURE__*/_jsx(PanelContainer, {
|
|
35
|
-
"aria-labelledby": `${panelId}-label`,
|
|
36
|
-
lastTabRef: this.props.lastTabRef,
|
|
37
|
-
firstSubtabRef: this.props.firstTabRefByParent,
|
|
38
|
-
classProps: {
|
|
39
|
-
isActive
|
|
40
|
-
},
|
|
41
|
-
"data-panel-id": panelId,
|
|
42
|
-
hidden: !animated && !isActive,
|
|
43
|
-
onMouseDown: e => {
|
|
44
|
-
const role = e.target.getAttribute('role');
|
|
45
|
-
if (role !== 'tabpanel' && allowTextSelection) e.stopPropagation();
|
|
46
|
-
},
|
|
47
|
-
role: "tabpanel",
|
|
48
|
-
style: style
|
|
49
|
-
}, panelId, shouldRender && content);
|
|
50
|
-
}, null);
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
render() {
|
|
55
|
-
const {
|
|
56
|
-
activeTab,
|
|
57
|
-
tabsComponents,
|
|
58
|
-
animated,
|
|
59
|
-
onTabChange,
|
|
60
|
-
enableMouseEvents
|
|
61
|
-
} = this.props;
|
|
62
|
-
const panels = animated ? /*#__PURE__*/_jsx(SwipeableViews, {
|
|
63
|
-
enableMouseEvents: enableMouseEvents,
|
|
64
|
-
index: getIndexById(tabsComponents, activeTab),
|
|
65
|
-
onChangeIndex: index => onTabChange(getIdByIndex(tabsComponents, index))
|
|
66
|
-
}, void 0, this.renderPanels(activeTab, tabsComponents)) : this.renderPanels(activeTab, tabsComponents);
|
|
67
|
-
return /*#__PURE__*/_jsx(Panels, {}, void 0, panels);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { TabsPanels as default };
|
package/esm/package.json
DELETED
package/esm/useResize.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react';
|
|
2
|
-
import { debounce } from 'lodash';
|
|
3
|
-
|
|
4
|
-
function useResize(ref, callback) {
|
|
5
|
-
var _ref$current;
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
right,
|
|
9
|
-
left
|
|
10
|
-
} = (ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.getBoundingClientRect()) || {
|
|
11
|
-
right: null,
|
|
12
|
-
left: null
|
|
13
|
-
};
|
|
14
|
-
const handleResize = debounce(callback, 300);
|
|
15
|
-
useLayoutEffect(() => {
|
|
16
|
-
handleResize();
|
|
17
|
-
}, [right, left]);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { useResize };
|
package/types/Carousel.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const Carousel: {
|
|
4
|
-
({ children, onScroll }: {
|
|
5
|
-
children: any;
|
|
6
|
-
onScroll: any;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
defaultProps: {
|
|
9
|
-
onScroll: () => null;
|
|
10
|
-
};
|
|
11
|
-
propTypes: {
|
|
12
|
-
children: PropTypes.Validator<(PropTypes.ReactElementLike | null | undefined)[]>;
|
|
13
|
-
onScroll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export default Carousel;
|
package/types/DSTab.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const DSTab: {
|
|
3
|
-
({ tabId, title, required }: {
|
|
4
|
-
tabId?: string | undefined;
|
|
5
|
-
title?: string | undefined;
|
|
6
|
-
required?: boolean | undefined;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
propTypes: {
|
|
10
|
-
/** unique id for tab */
|
|
11
|
-
tabId: any;
|
|
12
|
-
/** tab title */
|
|
13
|
-
title: any;
|
|
14
|
-
/** Show a required mark next to the title */
|
|
15
|
-
required: any;
|
|
16
|
-
/** Whether or not it's a ds-tab from DSMobile tabs */
|
|
17
|
-
isDSMobile: any;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
declare const DSTabWithSchema: any;
|
|
21
|
-
export { DSTab, DSTabWithSchema };
|
|
22
|
-
export default DSTab;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const PanelContainer: {
|
|
4
|
-
({ children, lastTabRef, firstSubtabRef, ...rest }: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
children: any;
|
|
7
|
-
lastTabRef: any;
|
|
8
|
-
firstSubtabRef: any;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
propTypes: {
|
|
11
|
-
children: PropTypes.Requireable<any>;
|
|
12
|
-
firstSubtabRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
13
|
-
current: PropTypes.Requireable<any>;
|
|
14
|
-
}>>;
|
|
15
|
-
lastTabRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
16
|
-
current: PropTypes.Requireable<any>;
|
|
17
|
-
}>>;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export default PanelContainer;
|
package/types/SubTabBar.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const SubTabBar: {
|
|
4
|
-
({ withCarousel, tabs, activeTab, onTabClick, firstSubtabRef, handleUpArrow, }: {
|
|
5
|
-
withCarousel: any;
|
|
6
|
-
tabs?: never[] | undefined;
|
|
7
|
-
activeTab?: string | undefined;
|
|
8
|
-
onTabClick?: (() => null) | undefined;
|
|
9
|
-
firstSubtabRef: any;
|
|
10
|
-
handleUpArrow: any;
|
|
11
|
-
}): JSX.Element;
|
|
12
|
-
propTypes: {
|
|
13
|
-
tabs: PropTypes.Validator<(PropTypes.ReactElementLike | null | undefined)[]>;
|
|
14
|
-
activeTab: PropTypes.Requireable<string>;
|
|
15
|
-
onTabClick: PropTypes.Validator<(...args: any[]) => any>;
|
|
16
|
-
withCarousel: PropTypes.Requireable<boolean>;
|
|
17
|
-
handleUpArrow: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
-
firstSubtabRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
19
|
-
current: PropTypes.Requireable<any>;
|
|
20
|
-
}>>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default SubTabBar;
|
package/types/TabBar.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
|
-
import { Component } from 'react';
|
|
3
|
-
declare class TabBar extends Component {
|
|
4
|
-
constructor(props: any);
|
|
5
|
-
componentDidMount(): void;
|
|
6
|
-
componentDidUpdate(prevProps: any): void;
|
|
7
|
-
componentWillUnmount(): void;
|
|
8
|
-
handleGradients(): void;
|
|
9
|
-
shouldHaveLeftGradient(scrollLeft: any, gWidth: any): boolean;
|
|
10
|
-
shouldHaveRightGradient(scrollLeft: any, gWidth: any, clientWidth: any, scrollWidth: any): boolean;
|
|
11
|
-
setIndicatorStyle(): void;
|
|
12
|
-
getActiveTabElement(activeTab: any): any;
|
|
13
|
-
isElementVisible(el: any, holder: any): boolean;
|
|
14
|
-
getVisibleDimensions(node: any, referenceNode: any): {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
getIndicatorStyles(activeTab: any): {
|
|
19
|
-
height: any;
|
|
20
|
-
left: string;
|
|
21
|
-
top: string;
|
|
22
|
-
width: any;
|
|
23
|
-
} | null;
|
|
24
|
-
handleTabClick: (tabId: any, e: any) => void;
|
|
25
|
-
handleKeyPress: (tabId: any, e: any, index: any) => void;
|
|
26
|
-
handleTabsHeadersHorizontalScroll: import("lodash").DebouncedFunc<() => void>;
|
|
27
|
-
renderTabs: (this: any, activeTab: any, tabs: any) => any;
|
|
28
|
-
render(): any;
|
|
29
|
-
}
|
|
30
|
-
export default TabBar;
|
package/types/TabTypes.d.ts
DELETED
package/types/TabsImpl.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
declare const TabsImpl: {
|
|
4
|
-
(props: any): JSX.Element;
|
|
5
|
-
propTypes: {
|
|
6
|
-
animated: PropTypes.Requireable<boolean>;
|
|
7
|
-
enableMouseEvents: PropTypes.Requireable<boolean>;
|
|
8
|
-
allowTextSelection: PropTypes.Requireable<boolean>;
|
|
9
|
-
onTabChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
-
type: PropTypes.Requireable<string>;
|
|
11
|
-
tabBarExtraContent: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
12
|
-
onlyRenderActiveTab: PropTypes.Requireable<boolean>;
|
|
13
|
-
withCarousel: PropTypes.Requireable<boolean>;
|
|
14
|
-
activeTab: PropTypes.Requireable<string>;
|
|
15
|
-
children: PropTypes.Validator<(PropTypes.InferProps<{
|
|
16
|
-
type: PropTypes.Requireable<any>;
|
|
17
|
-
}> | null | undefined)[]>;
|
|
18
|
-
tabsListAriaLabel: PropTypes.Requireable<string>;
|
|
19
|
-
containerProps: PropTypes.Requireable<object>;
|
|
20
|
-
innerRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
21
|
-
current: PropTypes.Requireable<any>;
|
|
22
|
-
}>>;
|
|
23
|
-
firstSubtabRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
24
|
-
current: PropTypes.Requireable<any>;
|
|
25
|
-
}>>;
|
|
26
|
-
lastTabRef: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.InferProps<{
|
|
27
|
-
current: PropTypes.Requireable<any>;
|
|
28
|
-
}>>;
|
|
29
|
-
/** Whether or not it's a ds-tab from DSMobile tabs */
|
|
30
|
-
isDSMobile: PropTypes.Requireable<boolean>;
|
|
31
|
-
/** DSMobile only flexible tabs mode */
|
|
32
|
-
flexibleTabsHeaders: PropTypes.Requireable<boolean>;
|
|
33
|
-
/** DSMobile only fixed tabs mode */
|
|
34
|
-
fixedTabsHeaders: PropTypes.Requireable<boolean>;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export default TabsImpl;
|
package/types/TabsPanels.d.ts
DELETED
package/types/useResize.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useResize(ref: any, callback: any): void;
|