@fluentui/react-tabs 1.0.0-beta.99 → 9.0.0-beta.12
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/CHANGELOG.json +259 -1810
- package/CHANGELOG.md +74 -733
- package/README.md +0 -17
- package/Spec.md +433 -0
- package/dist/index.d.ts +243 -0
- package/lib/Tab.d.ts +1 -0
- package/lib/Tab.js +2 -0
- package/lib/Tab.js.map +1 -0
- package/lib/TabList.d.ts +1 -0
- package/lib/TabList.js +2 -0
- package/lib/TabList.js.map +1 -0
- package/lib/components/Tab/Tab.d.ts +6 -0
- package/lib/components/Tab/Tab.js +15 -0
- package/lib/components/Tab/Tab.js.map +1 -0
- package/lib/components/Tab/Tab.types.d.ts +61 -0
- package/lib/components/Tab/Tab.types.js +2 -0
- package/lib/components/Tab/Tab.types.js.map +1 -0
- package/lib/components/Tab/index.d.ts +6 -0
- package/lib/components/Tab/index.js +7 -0
- package/lib/components/Tab/index.js.map +1 -0
- package/lib/components/Tab/renderTab.d.ts +5 -0
- package/lib/components/Tab/renderTab.js +17 -0
- package/lib/components/Tab/renderTab.js.map +1 -0
- package/lib/components/Tab/useTab.d.ts +12 -0
- package/lib/components/Tab/useTab.js +81 -0
- package/lib/components/Tab/useTab.js.map +1 -0
- package/lib/components/Tab/useTabAnimatedIndicator.d.ts +5 -0
- package/lib/components/Tab/useTabAnimatedIndicator.js +134 -0
- package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -0
- package/lib/components/Tab/useTabStyles.d.ts +8 -0
- package/lib/components/Tab/useTabStyles.js +403 -0
- package/lib/components/Tab/useTabStyles.js.map +1 -0
- package/lib/components/TabList/TabList.d.ts +6 -0
- package/lib/components/TabList/TabList.js +17 -0
- package/lib/components/TabList/TabList.js.map +1 -0
- package/lib/components/TabList/TabList.types.d.ts +104 -0
- package/lib/components/TabList/TabList.types.js +2 -0
- package/lib/components/TabList/TabList.types.js.map +1 -0
- package/lib/components/TabList/TabListContext.d.ts +3 -0
- package/lib/components/TabList/TabListContext.js +23 -0
- package/lib/components/TabList/TabListContext.js.map +1 -0
- package/lib/components/TabList/index.d.ts +5 -0
- package/lib/components/TabList/index.js +6 -0
- package/lib/components/TabList/index.js.map +1 -0
- package/lib/components/TabList/renderTabList.d.ts +5 -0
- package/lib/components/TabList/renderTabList.js +18 -0
- package/lib/components/TabList/renderTabList.js.map +1 -0
- package/lib/components/TabList/useTabList.d.ts +12 -0
- package/lib/components/TabList/useTabList.js +81 -0
- package/lib/components/TabList/useTabList.js.map +1 -0
- package/lib/components/TabList/useTabListContextValues.d.ts +2 -0
- package/lib/components/TabList/useTabListContextValues.js +28 -0
- package/lib/components/TabList/useTabListContextValues.js.map +1 -0
- package/lib/components/TabList/useTabListStyles.d.ts +8 -0
- package/lib/components/TabList/useTabListStyles.js +45 -0
- package/lib/components/TabList/useTabListStyles.js.map +1 -0
- package/lib/index.d.ts +4 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Tab.d.ts +1 -0
- package/lib-commonjs/Tab.js +10 -0
- package/lib-commonjs/Tab.js.map +1 -0
- package/lib-commonjs/TabList.d.ts +1 -0
- package/lib-commonjs/TabList.js +10 -0
- package/lib-commonjs/TabList.js.map +1 -0
- package/lib-commonjs/components/Tab/Tab.d.ts +6 -0
- package/lib-commonjs/components/Tab/Tab.js +26 -0
- package/lib-commonjs/components/Tab/Tab.js.map +1 -0
- package/lib-commonjs/components/Tab/Tab.types.d.ts +61 -0
- package/lib-commonjs/components/Tab/Tab.types.js +6 -0
- package/lib-commonjs/components/Tab/Tab.types.js.map +1 -0
- package/lib-commonjs/components/Tab/index.d.ts +6 -0
- package/lib-commonjs/components/Tab/index.js +20 -0
- package/lib-commonjs/components/Tab/index.js.map +1 -0
- package/lib-commonjs/components/Tab/renderTab.d.ts +5 -0
- package/lib-commonjs/components/Tab/renderTab.js +28 -0
- package/lib-commonjs/components/Tab/renderTab.js.map +1 -0
- package/lib-commonjs/components/Tab/useTab.d.ts +12 -0
- package/lib-commonjs/components/Tab/useTab.js +94 -0
- package/lib-commonjs/components/Tab/useTab.js.map +1 -0
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.d.ts +5 -0
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +148 -0
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -0
- package/lib-commonjs/components/Tab/useTabStyles.d.ts +8 -0
- package/lib-commonjs/components/Tab/useTabStyles.js +416 -0
- package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -0
- package/lib-commonjs/components/TabList/TabList.d.ts +6 -0
- package/lib-commonjs/components/TabList/TabList.js +29 -0
- package/lib-commonjs/components/TabList/TabList.js.map +1 -0
- package/lib-commonjs/components/TabList/TabList.types.d.ts +104 -0
- package/lib-commonjs/components/TabList/TabList.types.js +6 -0
- package/lib-commonjs/components/TabList/TabList.types.js.map +1 -0
- package/lib-commonjs/components/TabList/TabListContext.d.ts +3 -0
- package/lib-commonjs/components/TabList/TabListContext.js +31 -0
- package/lib-commonjs/components/TabList/TabListContext.js.map +1 -0
- package/lib-commonjs/components/TabList/index.d.ts +5 -0
- package/lib-commonjs/components/TabList/index.js +18 -0
- package/lib-commonjs/components/TabList/index.js.map +1 -0
- package/lib-commonjs/components/TabList/renderTabList.d.ts +5 -0
- package/lib-commonjs/components/TabList/renderTabList.js +30 -0
- package/lib-commonjs/components/TabList/renderTabList.js.map +1 -0
- package/lib-commonjs/components/TabList/useTabList.d.ts +12 -0
- package/lib-commonjs/components/TabList/useTabList.js +93 -0
- package/lib-commonjs/components/TabList/useTabList.js.map +1 -0
- package/lib-commonjs/components/TabList/useTabListContextValues.d.ts +2 -0
- package/lib-commonjs/components/TabList/useTabListContextValues.js +37 -0
- package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -0
- package/lib-commonjs/components/TabList/useTabListStyles.d.ts +8 -0
- package/lib-commonjs/components/TabList/useTabListStyles.js +55 -0
- package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -0
- package/lib-commonjs/index.d.ts +4 -1
- package/lib-commonjs/index.js +83 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +25 -21
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -14
- package/dist/react-tabs.d.ts +0 -197
- package/etc/react-tabs.api.md +0 -104
- package/just.config.ts +0 -3
- package/lib/Tabs.d.ts +0 -1
- package/lib/Tabs.js +0 -2
- package/lib/Tabs.js.map +0 -1
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -9
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/Tabs/TabItem.d.ts +0 -6
- package/lib/components/Tabs/TabItem.js +0 -18
- package/lib/components/Tabs/TabItem.js.map +0 -1
- package/lib/components/Tabs/TabItem.types.d.ts +0 -61
- package/lib/components/Tabs/TabItem.types.js +0 -2
- package/lib/components/Tabs/TabItem.types.js.map +0 -1
- package/lib/components/Tabs/Tabs.base.d.ts +0 -3
- package/lib/components/Tabs/Tabs.base.js +0 -179
- package/lib/components/Tabs/Tabs.base.js.map +0 -1
- package/lib/components/Tabs/Tabs.d.ts +0 -8
- package/lib/components/Tabs/Tabs.js +0 -12
- package/lib/components/Tabs/Tabs.js.map +0 -1
- package/lib/components/Tabs/Tabs.styles.d.ts +0 -2
- package/lib/components/Tabs/Tabs.styles.js +0 -264
- package/lib/components/Tabs/Tabs.styles.js.map +0 -1
- package/lib/components/Tabs/Tabs.types.d.ts +0 -113
- package/lib/components/Tabs/Tabs.types.js +0 -2
- package/lib/components/Tabs/Tabs.types.js.map +0 -1
- package/lib/components/Tabs/index.d.ts +0 -5
- package/lib/components/Tabs/index.js +0 -6
- package/lib/components/Tabs/index.js.map +0 -1
- package/lib/utilities/observeResize.d.ts +0 -21
- package/lib/utilities/observeResize.js +0 -46
- package/lib/utilities/observeResize.js.map +0 -1
- package/lib/utilities/useOverflow.d.ts +0 -45
- package/lib/utilities/useOverflow.js +0 -126
- package/lib/utilities/useOverflow.js.map +0 -1
- package/lib-amd/Tabs.d.ts +0 -1
- package/lib-amd/Tabs.js +0 -6
- package/lib-amd/Tabs.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -4
- package/lib-amd/common/isConformant.js +0 -14
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Tabs/TabItem.d.ts +0 -6
- package/lib-amd/components/Tabs/TabItem.js +0 -20
- package/lib-amd/components/Tabs/TabItem.js.map +0 -1
- package/lib-amd/components/Tabs/TabItem.types.d.ts +0 -61
- package/lib-amd/components/Tabs/TabItem.types.js +0 -5
- package/lib-amd/components/Tabs/TabItem.types.js.map +0 -1
- package/lib-amd/components/Tabs/Tabs.base.d.ts +0 -3
- package/lib-amd/components/Tabs/Tabs.base.js +0 -176
- package/lib-amd/components/Tabs/Tabs.base.js.map +0 -1
- package/lib-amd/components/Tabs/Tabs.d.ts +0 -8
- package/lib-amd/components/Tabs/Tabs.js +0 -14
- package/lib-amd/components/Tabs/Tabs.js.map +0 -1
- package/lib-amd/components/Tabs/Tabs.styles.d.ts +0 -2
- package/lib-amd/components/Tabs/Tabs.styles.js +0 -267
- package/lib-amd/components/Tabs/Tabs.styles.js.map +0 -1
- package/lib-amd/components/Tabs/Tabs.types.d.ts +0 -113
- package/lib-amd/components/Tabs/Tabs.types.js +0 -5
- package/lib-amd/components/Tabs/Tabs.types.js.map +0 -1
- package/lib-amd/components/Tabs/index.d.ts +0 -5
- package/lib-amd/components/Tabs/index.js +0 -11
- package/lib-amd/components/Tabs/index.js.map +0 -1
- package/lib-amd/index.d.ts +0 -1
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/utilities/observeResize.d.ts +0 -21
- package/lib-amd/utilities/observeResize.js +0 -51
- package/lib-amd/utilities/observeResize.js.map +0 -1
- package/lib-amd/utilities/useOverflow.d.ts +0 -45
- package/lib-amd/utilities/useOverflow.js +0 -128
- package/lib-amd/utilities/useOverflow.js.map +0 -1
- package/lib-commonjs/Tabs.d.ts +0 -1
- package/lib-commonjs/Tabs.js +0 -5
- package/lib-commonjs/Tabs.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -13
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/Tabs/TabItem.d.ts +0 -6
- package/lib-commonjs/components/Tabs/TabItem.js +0 -21
- package/lib-commonjs/components/Tabs/TabItem.js.map +0 -1
- package/lib-commonjs/components/Tabs/TabItem.types.d.ts +0 -61
- package/lib-commonjs/components/Tabs/TabItem.types.js +0 -3
- package/lib-commonjs/components/Tabs/TabItem.types.js.map +0 -1
- package/lib-commonjs/components/Tabs/Tabs.base.d.ts +0 -3
- package/lib-commonjs/components/Tabs/Tabs.base.js +0 -182
- package/lib-commonjs/components/Tabs/Tabs.base.js.map +0 -1
- package/lib-commonjs/components/Tabs/Tabs.d.ts +0 -8
- package/lib-commonjs/components/Tabs/Tabs.js +0 -15
- package/lib-commonjs/components/Tabs/Tabs.js.map +0 -1
- package/lib-commonjs/components/Tabs/Tabs.styles.d.ts +0 -2
- package/lib-commonjs/components/Tabs/Tabs.styles.js +0 -268
- package/lib-commonjs/components/Tabs/Tabs.styles.js.map +0 -1
- package/lib-commonjs/components/Tabs/Tabs.types.d.ts +0 -113
- package/lib-commonjs/components/Tabs/Tabs.types.js +0 -3
- package/lib-commonjs/components/Tabs/Tabs.types.js.map +0 -1
- package/lib-commonjs/components/Tabs/index.d.ts +0 -5
- package/lib-commonjs/components/Tabs/index.js +0 -11
- package/lib-commonjs/components/Tabs/index.js.map +0 -1
- package/lib-commonjs/utilities/observeResize.d.ts +0 -21
- package/lib-commonjs/utilities/observeResize.js +0 -50
- package/lib-commonjs/utilities/observeResize.js.map +0 -1
- package/lib-commonjs/utilities/useOverflow.d.ts +0 -45
- package/lib-commonjs/utilities/useOverflow.js +0 -130
- package/lib-commonjs/utilities/useOverflow.js.map +0 -1
- package/src/components/Tabs/TabItem.types.ts +0 -69
- package/src/components/Tabs/Tabs.types.ts +0 -131
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IStyle, ITheme } from '@fluentui/style-utilities';
|
|
3
|
-
import { IStyleFunctionOrObject } from '@fluentui/utilities';
|
|
4
|
-
import { TabItem } from './TabItem';
|
|
5
|
-
/**
|
|
6
|
-
* {@docCategory Tabs}
|
|
7
|
-
*/
|
|
8
|
-
export interface TabsImperativeHandle {
|
|
9
|
-
/**
|
|
10
|
-
* Sets focus to the first tab.
|
|
11
|
-
*/
|
|
12
|
-
focus(): void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* {@docCategory Tabs}
|
|
16
|
-
*/
|
|
17
|
-
export interface TabsProps extends React.HTMLAttributes<HTMLDivElement>, React.RefAttributes<HTMLDivElement> {
|
|
18
|
-
/**
|
|
19
|
-
* Optional callback to access the TabsImperativeHandle interface. Use this instead of ref for accessing
|
|
20
|
-
* the public methods and properties of the component.
|
|
21
|
-
*/
|
|
22
|
-
componentRef?: React.RefObject<TabsImperativeHandle>;
|
|
23
|
-
/**
|
|
24
|
-
* Call to provide customized styling that will layer on top of the variant rules.
|
|
25
|
-
*/
|
|
26
|
-
styles?: IStyleFunctionOrObject<TabsStyleProps, TabsStyles>;
|
|
27
|
-
/**
|
|
28
|
-
* Theme provided by High-Order Component.
|
|
29
|
-
*/
|
|
30
|
-
theme?: ITheme;
|
|
31
|
-
/**
|
|
32
|
-
* Additional css class to apply to the Tabs
|
|
33
|
-
* @defaultvalue undefined
|
|
34
|
-
*/
|
|
35
|
-
className?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Default selected TabItem key. Only provide this if the Tabs is an uncontrolled component;
|
|
38
|
-
* otherwise, use the `selectedKey` property.
|
|
39
|
-
*/
|
|
40
|
-
defaultSelectedKey?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Key of the selected tab item. Updating this will override the selected tab state.
|
|
43
|
-
* Only provide this if the Tabs is a controlled component where you are maintaining the
|
|
44
|
-
* current state; otherwise, use `defaultSelectedKey`.
|
|
45
|
-
*/
|
|
46
|
-
selectedKey?: string | null;
|
|
47
|
-
/**
|
|
48
|
-
* Callback for when the selected tab item is changed.
|
|
49
|
-
*/
|
|
50
|
-
onTabClick?: (item?: TabItem, ev?: React.MouseEvent<HTMLElement>) => void;
|
|
51
|
-
/**
|
|
52
|
-
* Tab size (normal, large)
|
|
53
|
-
*/
|
|
54
|
-
tabSize?: TabSizeType;
|
|
55
|
-
/**
|
|
56
|
-
* Tab format (links, tabs)
|
|
57
|
-
*/
|
|
58
|
-
tabFormat?: TabFormatType;
|
|
59
|
-
/**
|
|
60
|
-
* Overflow behavior when there is not enough room to display all of the tabs
|
|
61
|
-
* * none: Tabs will overflow the container and may not be visible
|
|
62
|
-
* * menu: Display an overflow menu that contains the tabs that don't fit
|
|
63
|
-
*
|
|
64
|
-
* @default none
|
|
65
|
-
*/
|
|
66
|
-
overflowBehavior?: 'none' | 'menu';
|
|
67
|
-
/**
|
|
68
|
-
* Whether to skip rendering the tabpanel with the content of the selected tab.
|
|
69
|
-
* Use this prop if you plan to separately render the tab content
|
|
70
|
-
* and don't want to leave an empty tabpanel in the page that may confuse Screen Readers.
|
|
71
|
-
*/
|
|
72
|
-
headersOnly?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Callback to customize how IDs are generated for each tab header.
|
|
75
|
-
* Useful if you're rendering content outside and need to connect aria-labelledby.
|
|
76
|
-
*/
|
|
77
|
-
getTabId?: (itemKey: string, index: number) => string;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* {@docCategory Tabs}
|
|
81
|
-
*/
|
|
82
|
-
export declare type TabsStyleProps = Required<Pick<TabsProps, 'theme'>> & Pick<TabsProps, 'className'> & {
|
|
83
|
-
tabSize?: TabSizeType;
|
|
84
|
-
tabFormat?: TabFormatType;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* {@docCategory Tabs}
|
|
88
|
-
*/
|
|
89
|
-
export interface TabsStyles {
|
|
90
|
-
/**
|
|
91
|
-
* Style for the root element.
|
|
92
|
-
*/
|
|
93
|
-
root: IStyle;
|
|
94
|
-
tab: IStyle;
|
|
95
|
-
tabIsSelected: IStyle;
|
|
96
|
-
tabContent: IStyle;
|
|
97
|
-
text: IStyle;
|
|
98
|
-
count: IStyle;
|
|
99
|
-
icon: IStyle;
|
|
100
|
-
tabInMenu: IStyle;
|
|
101
|
-
overflowMenuButton: IStyle;
|
|
102
|
-
itemContainer?: IStyle;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* {@docCategory Tabs}
|
|
106
|
-
* Display mode for the tabs
|
|
107
|
-
*/
|
|
108
|
-
export declare type TabFormatType = 'links' | 'tabs';
|
|
109
|
-
/**
|
|
110
|
-
* {@docCategory Tabs}
|
|
111
|
-
* Size of the tabs
|
|
112
|
-
*/
|
|
113
|
-
export declare type TabSizeType = 'normal' | 'large';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.types.js","sourceRoot":"../src/","sources":["components/Tabs/Tabs.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IStyle, ITheme } from '@fluentui/style-utilities';\nimport { IStyleFunctionOrObject } from '@fluentui/utilities';\nimport { TabItem } from './TabItem';\n\n/**\n * {@docCategory Tabs}\n */\nexport interface TabsImperativeHandle {\n /**\n * Sets focus to the first tab.\n */\n focus(): void;\n}\n\n/**\n * {@docCategory Tabs}\n */\nexport interface TabsProps extends React.HTMLAttributes<HTMLDivElement>, React.RefAttributes<HTMLDivElement> {\n /**\n * Optional callback to access the TabsImperativeHandle interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: React.RefObject<TabsImperativeHandle>;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<TabsStyleProps, TabsStyles>;\n\n /**\n * Theme provided by High-Order Component.\n */\n theme?: ITheme;\n\n /**\n * Additional css class to apply to the Tabs\n * @defaultvalue undefined\n */\n className?: string;\n\n /**\n * Default selected TabItem key. Only provide this if the Tabs is an uncontrolled component;\n * otherwise, use the `selectedKey` property.\n */\n defaultSelectedKey?: string;\n\n /**\n * Key of the selected tab item. Updating this will override the selected tab state.\n * Only provide this if the Tabs is a controlled component where you are maintaining the\n * current state; otherwise, use `defaultSelectedKey`.\n */\n selectedKey?: string | null;\n\n /**\n * Callback for when the selected tab item is changed.\n */\n onTabClick?: (item?: TabItem, ev?: React.MouseEvent<HTMLElement>) => void;\n\n /**\n * Tab size (normal, large)\n */\n tabSize?: TabSizeType;\n\n /**\n * Tab format (links, tabs)\n */\n tabFormat?: TabFormatType;\n\n /**\n * Overflow behavior when there is not enough room to display all of the tabs\n * * none: Tabs will overflow the container and may not be visible\n * * menu: Display an overflow menu that contains the tabs that don't fit\n *\n * @default none\n */\n overflowBehavior?: 'none' | 'menu';\n\n /**\n * Whether to skip rendering the tabpanel with the content of the selected tab.\n * Use this prop if you plan to separately render the tab content\n * and don't want to leave an empty tabpanel in the page that may confuse Screen Readers.\n */\n headersOnly?: boolean;\n\n /**\n * Callback to customize how IDs are generated for each tab header.\n * Useful if you're rendering content outside and need to connect aria-labelledby.\n */\n getTabId?: (itemKey: string, index: number) => string;\n}\n\n/**\n * {@docCategory Tabs}\n */\nexport type TabsStyleProps = Required<Pick<TabsProps, 'theme'>> &\n Pick<TabsProps, 'className'> & {\n tabSize?: TabSizeType;\n tabFormat?: TabFormatType;\n };\n\n/**\n * {@docCategory Tabs}\n */\nexport interface TabsStyles {\n /**\n * Style for the root element.\n */\n root: IStyle;\n tab: IStyle;\n tabIsSelected: IStyle;\n tabContent: IStyle;\n text: IStyle;\n count: IStyle;\n icon: IStyle;\n tabInMenu: IStyle;\n overflowMenuButton: IStyle;\n itemContainer?: IStyle;\n}\n\n/**\n * {@docCategory Tabs}\n * Display mode for the tabs\n */\nexport type TabFormatType = 'links' | 'tabs';\n\n/**\n * {@docCategory Tabs}\n * Size of the tabs\n */\nexport type TabSizeType = 'normal' | 'large';\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./Tabs", "./Tabs.base", "./TabItem", "./Tabs.types", "./TabItem.types"], function (require, exports, tslib_1, Tabs_1, Tabs_base_1, TabItem_1, Tabs_types_1, TabItem_types_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.TabItem = void 0;
|
|
5
|
-
tslib_1.__exportStar(Tabs_1, exports);
|
|
6
|
-
tslib_1.__exportStar(Tabs_base_1, exports);
|
|
7
|
-
Object.defineProperty(exports, "TabItem", { enumerable: true, get: function () { return TabItem_1.TabItem; } });
|
|
8
|
-
tslib_1.__exportStar(Tabs_types_1, exports);
|
|
9
|
-
tslib_1.__exportStar(TabItem_types_1, exports);
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Tabs/index.ts"],"names":[],"mappings":";;;;IAAA,sCAAuB;IACvB,2CAA4B;IACnB,kGAAA,OAAO,OAAA;IAChB,4CAA6B;IAC7B,+CAAgC","sourcesContent":["export * from './Tabs';\nexport * from './Tabs.base';\nexport { TabItem } from './TabItem';\nexport * from './Tabs.types';\nexport * from './TabItem.types';\n"]}
|
package/lib-amd/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Tabs';
|
package/lib-amd/index.js
DELETED
package/lib-amd/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;IAAA,sCAAuB","sourcesContent":["export * from './Tabs';\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wrapper for ResizeObserver, with fallback for browsers that don't support ResizeObserver.
|
|
3
|
-
*
|
|
4
|
-
* Calls the onResize callback once layout is complete, and again whenever any of the target(s) change size.
|
|
5
|
-
* Or if ResizeObserver isn't supported, calls the callback whenever the window changes size.
|
|
6
|
-
*
|
|
7
|
-
* @param target - Either a single element, or array of elements to watch for size changes.
|
|
8
|
-
* @param onResize - Callback to be notified when layout is complete, and when the target(s) change size.
|
|
9
|
-
* If this browser supports ResizeObserver, the callback will be passed the ResizeObserverEntry[] array.
|
|
10
|
-
* Otherwise, the entries array will be undefined, and you'll need to find another way to get the element's size,
|
|
11
|
-
* (e.g. clientWidth/clientHeight or getBoundingClientRect).
|
|
12
|
-
*
|
|
13
|
-
* @returns A function to clean up the observer/listener.
|
|
14
|
-
*/
|
|
15
|
-
export declare const observeResize: (target: Element | Element[], onResize: (entries: readonly ResizeObserverEntry[] | undefined) => void) => (() => void);
|
|
16
|
-
/** Temporary type definition for ResizeObserverEntry. Can be removed when official types are available. */
|
|
17
|
-
declare type ResizeObserverEntry = {
|
|
18
|
-
readonly contentRect: DOMRectReadOnly;
|
|
19
|
-
readonly target: Element;
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/utilities"], function (require, exports, utilities_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.observeResize = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Wrapper for ResizeObserver, with fallback for browsers that don't support ResizeObserver.
|
|
7
|
-
*
|
|
8
|
-
* Calls the onResize callback once layout is complete, and again whenever any of the target(s) change size.
|
|
9
|
-
* Or if ResizeObserver isn't supported, calls the callback whenever the window changes size.
|
|
10
|
-
*
|
|
11
|
-
* @param target - Either a single element, or array of elements to watch for size changes.
|
|
12
|
-
* @param onResize - Callback to be notified when layout is complete, and when the target(s) change size.
|
|
13
|
-
* If this browser supports ResizeObserver, the callback will be passed the ResizeObserverEntry[] array.
|
|
14
|
-
* Otherwise, the entries array will be undefined, and you'll need to find another way to get the element's size,
|
|
15
|
-
* (e.g. clientWidth/clientHeight or getBoundingClientRect).
|
|
16
|
-
*
|
|
17
|
-
* @returns A function to clean up the observer/listener.
|
|
18
|
-
*/
|
|
19
|
-
var observeResize = function (target, onResize) {
|
|
20
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
21
|
-
var observer_1 = new ResizeObserver(onResize);
|
|
22
|
-
if (Array.isArray(target)) {
|
|
23
|
-
target.forEach(function (t) { return observer_1.observe(t); });
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
observer_1.observe(target);
|
|
27
|
-
}
|
|
28
|
-
return function () { return observer_1.disconnect(); };
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
// Fallback for browsers that don't support ResizeObserver
|
|
32
|
-
var onResizeWrapper_1 = function () { return onResize(undefined); };
|
|
33
|
-
var win_1 = utilities_1.getWindow(Array.isArray(target) ? target[0] : target);
|
|
34
|
-
if (!win_1) {
|
|
35
|
-
// Can't listen for resize if we can't get the window object
|
|
36
|
-
return function () {
|
|
37
|
-
// Nothing to clean up
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
// Listen for the first animation frame, which will happen after layout is complete
|
|
41
|
-
var animationFrameId_1 = win_1.requestAnimationFrame(onResizeWrapper_1);
|
|
42
|
-
win_1.addEventListener('resize', onResizeWrapper_1, false);
|
|
43
|
-
return function () {
|
|
44
|
-
win_1.cancelAnimationFrame(animationFrameId_1);
|
|
45
|
-
win_1.removeEventListener('resize', onResizeWrapper_1, false);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.observeResize = observeResize;
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=observeResize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observeResize.js","sourceRoot":"../src/","sources":["utilities/observeResize.ts"],"names":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AAa,iBAmCxB","sourcesContent":["import { getWindow } from '@fluentui/utilities';\n\n/**\n * Wrapper for ResizeObserver, with fallback for browsers that don't support ResizeObserver.\n *\n * Calls the onResize callback once layout is complete, and again whenever any of the target(s) change size.\n * Or if ResizeObserver isn't supported, calls the callback whenever the window changes size.\n *\n * @param target - Either a single element, or array of elements to watch for size changes.\n * @param onResize - Callback to be notified when layout is complete, and when the target(s) change size.\n * If this browser supports ResizeObserver, the callback will be passed the ResizeObserverEntry[] array.\n * Otherwise, the entries array will be undefined, and you'll need to find another way to get the element's size,\n * (e.g. clientWidth/clientHeight or getBoundingClientRect).\n *\n * @returns A function to clean up the observer/listener.\n */\nexport const observeResize = (\n target: Element | Element[],\n onResize: (entries: readonly ResizeObserverEntry[] | undefined) => void,\n): (() => void) => {\n if (typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(onResize);\n\n if (Array.isArray(target)) {\n target.forEach(t => observer.observe(t));\n } else {\n observer.observe(target);\n }\n\n return () => observer.disconnect();\n } else {\n // Fallback for browsers that don't support ResizeObserver\n const onResizeWrapper = () => onResize(undefined);\n\n const win = getWindow(Array.isArray(target) ? target[0] : target);\n if (!win) {\n // Can't listen for resize if we can't get the window object\n return () => {\n // Nothing to clean up\n };\n }\n\n // Listen for the first animation frame, which will happen after layout is complete\n const animationFrameId = win.requestAnimationFrame(onResizeWrapper);\n win.addEventListener('resize', onResizeWrapper, false);\n\n return () => {\n win.cancelAnimationFrame(animationFrameId);\n win.removeEventListener('resize', onResizeWrapper, false);\n };\n }\n};\n\n/** Temporary type definition for ResizeObserver. Can be removed when official types are available. */\ntype ResizeObserver = {\n new (callback: (entries: readonly ResizeObserverEntry[], observer: ResizeObserver) => void): ResizeObserver;\n observe(target: Element, options?: { box: 'content-box' | 'border-box' }): void;\n unobserve(target: Element): void;\n disconnect(): void;\n};\n\n/** Temporary type definition for ResizeObserverEntry. Can be removed when official types are available. */\ntype ResizeObserverEntry = {\n readonly contentRect: DOMRectReadOnly;\n readonly target: Element;\n};\n\n/** Temporary definition for ResizeObserver. Can be removed when official types are available. */\ndeclare const ResizeObserver: ResizeObserver | undefined;\n"]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { RefCallback } from '@fluentui/react-hooks';
|
|
2
|
-
/**
|
|
3
|
-
* Callback to notify the user that the items in the overflow have changed. This should ensure that the overflow menu
|
|
4
|
-
* is visible, and contains all of the overflowing items.
|
|
5
|
-
*
|
|
6
|
-
* @param overflowIndex - The index of the first item in the overflow, or items.length if nothing is overflowing.
|
|
7
|
-
* @param items - The list of all items in the container, and whether that particular item is in the overflow
|
|
8
|
-
*/
|
|
9
|
-
export declare type OverflowItemsChangedCallback = (overflowIndex: number, items: {
|
|
10
|
-
ele: HTMLElement;
|
|
11
|
-
isOverflowing: boolean;
|
|
12
|
-
}[]) => void;
|
|
13
|
-
/** Parameters for {@see useOverflow} */
|
|
14
|
-
export declare type OverflowParams = {
|
|
15
|
-
/** Callback to notify the user that the items in the overflow have changed. */
|
|
16
|
-
onOverflowItemsChanged: OverflowItemsChangedCallback;
|
|
17
|
-
/** True if the element containing overflowMenuButtonRef is in right-to-left order */
|
|
18
|
-
rtl: boolean;
|
|
19
|
-
/** Optional: Index of item that should never go into the overflow menu. */
|
|
20
|
-
pinnedIndex?: number;
|
|
21
|
-
};
|
|
22
|
-
/** Return value for {@see useOverflow} */
|
|
23
|
-
export declare type OverflowRefs = {
|
|
24
|
-
/** Set the overflow menu button's ref to this ref callback */
|
|
25
|
-
menuButtonRef: RefCallback<HTMLElement>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Track whether any items don't fit within their container, and move them to the overflow menu.
|
|
29
|
-
* Items are moved into the overflow menu from back to front, excluding pinned items.
|
|
30
|
-
*
|
|
31
|
-
* The overflow menu button must be the last sibling of all of the items that can be put into the overflow, and it
|
|
32
|
-
* must be hooked up to the `setMenuButtonRef` setter function that's returned by `useOverflow`:
|
|
33
|
-
* ```ts
|
|
34
|
-
* const overflow = useOverflow(...);
|
|
35
|
-
* ```
|
|
36
|
-
* ```jsx
|
|
37
|
-
* <Container>
|
|
38
|
-
* <Item /> // Index 0
|
|
39
|
-
* <Item /> // Index 1
|
|
40
|
-
* ...
|
|
41
|
-
* <Button ref={overflow.setMenuButtonRef} /> // Can be any React.Component or HTMLElement
|
|
42
|
-
* </Container>
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare const useOverflow: ({ onOverflowItemsChanged, rtl, pinnedIndex }: OverflowParams) => OverflowRefs;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "@fluentui/react-hooks", "@fluentui/utilities", "./observeResize"], function (require, exports, React, react_hooks_1, utilities_1, observeResize_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useOverflow = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Track whether any items don't fit within their container, and move them to the overflow menu.
|
|
7
|
-
* Items are moved into the overflow menu from back to front, excluding pinned items.
|
|
8
|
-
*
|
|
9
|
-
* The overflow menu button must be the last sibling of all of the items that can be put into the overflow, and it
|
|
10
|
-
* must be hooked up to the `setMenuButtonRef` setter function that's returned by `useOverflow`:
|
|
11
|
-
* ```ts
|
|
12
|
-
* const overflow = useOverflow(...);
|
|
13
|
-
* ```
|
|
14
|
-
* ```jsx
|
|
15
|
-
* <Container>
|
|
16
|
-
* <Item /> // Index 0
|
|
17
|
-
* <Item /> // Index 1
|
|
18
|
-
* ...
|
|
19
|
-
* <Button ref={overflow.setMenuButtonRef} /> // Can be any React.Component or HTMLElement
|
|
20
|
-
* </Container>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
var useOverflow = function (_a) {
|
|
24
|
-
var onOverflowItemsChanged = _a.onOverflowItemsChanged, rtl = _a.rtl, pinnedIndex = _a.pinnedIndex;
|
|
25
|
-
var updateOverflowRef = React.useRef();
|
|
26
|
-
var containerWidthRef = React.useRef();
|
|
27
|
-
// Attach a resize observer to the container
|
|
28
|
-
var containerRef = react_hooks_1.useRefEffect(function (container) {
|
|
29
|
-
var cleanupObserver = observeResize_1.observeResize(container, function (entries) {
|
|
30
|
-
containerWidthRef.current = entries ? entries[0].contentRect.width : container.clientWidth;
|
|
31
|
-
if (updateOverflowRef.current) {
|
|
32
|
-
updateOverflowRef.current();
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return function () {
|
|
36
|
-
cleanupObserver();
|
|
37
|
-
containerWidthRef.current = undefined;
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
var menuButtonRef = react_hooks_1.useRefEffect(function (menuButton) {
|
|
41
|
-
containerRef(menuButton.parentElement);
|
|
42
|
-
return function () { return containerRef(null); };
|
|
43
|
-
});
|
|
44
|
-
// eslint-disable-next-line no-restricted-properties
|
|
45
|
-
React.useLayoutEffect(function () {
|
|
46
|
-
var container = containerRef.current;
|
|
47
|
-
var menuButton = menuButtonRef.current;
|
|
48
|
-
if (!container || !menuButton) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
// items contains the container's children, excluding the overflow menu button itself
|
|
52
|
-
var items = [];
|
|
53
|
-
for (var i = 0; i < container.children.length; i++) {
|
|
54
|
-
var item = container.children[i];
|
|
55
|
-
if (item instanceof HTMLElement && item !== menuButton) {
|
|
56
|
-
items.push(item);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
// Keep track of the minimum width of the container to fit each child index.
|
|
60
|
-
// This cache is an integral part of the algorithm and not just a performance optimization: it allows us to
|
|
61
|
-
// recalculate the overflowIndex on subsequent resizes even if some items are already inside the overflow.
|
|
62
|
-
var minContainerWidth = [];
|
|
63
|
-
var extraWidth = 0; // The accumulated width of items that don't move into the overflow
|
|
64
|
-
updateOverflowRef.current = function () {
|
|
65
|
-
var containerWidth = containerWidthRef.current;
|
|
66
|
-
if (containerWidth === undefined) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
// Iterate the items in reverse order until we find one that fits within the bounds of the container
|
|
70
|
-
for (var i = items.length - 1; i >= 0; i--) {
|
|
71
|
-
// Calculate the min container width for this item if we haven't done so yet
|
|
72
|
-
if (minContainerWidth[i] === undefined) {
|
|
73
|
-
var itemOffsetEnd = rtl ? containerWidth - items[i].offsetLeft : items[i].offsetLeft + items[i].offsetWidth;
|
|
74
|
-
// If the item after this one is pinned, reserve space for it
|
|
75
|
-
if (i + 1 < items.length && i + 1 === pinnedIndex) {
|
|
76
|
-
// Use distance between the end of the previous item and this one (rather than the
|
|
77
|
-
// pinned item's offsetWidth), to account for any margin between the items.
|
|
78
|
-
extraWidth = minContainerWidth[i + 1] - itemOffsetEnd;
|
|
79
|
-
}
|
|
80
|
-
// Reserve space for the menu button after the first item was added to the overflow
|
|
81
|
-
if (i === items.length - 2) {
|
|
82
|
-
extraWidth += menuButton.offsetWidth;
|
|
83
|
-
}
|
|
84
|
-
minContainerWidth[i] = itemOffsetEnd + extraWidth;
|
|
85
|
-
}
|
|
86
|
-
if (containerWidth > minContainerWidth[i]) {
|
|
87
|
-
setOverflowIndex(i + 1);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
// If we got here, nothing fits outside the overflow
|
|
92
|
-
setOverflowIndex(0);
|
|
93
|
-
};
|
|
94
|
-
var prevOverflowIndex = items.length;
|
|
95
|
-
var setOverflowIndex = function (overflowIndex) {
|
|
96
|
-
if (prevOverflowIndex !== overflowIndex) {
|
|
97
|
-
prevOverflowIndex = overflowIndex;
|
|
98
|
-
onOverflowItemsChanged(overflowIndex, items.map(function (ele, index) { return ({
|
|
99
|
-
ele: ele,
|
|
100
|
-
isOverflowing: index >= overflowIndex && index !== pinnedIndex,
|
|
101
|
-
}); }));
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
var cancelAnimationFrame = undefined;
|
|
105
|
-
// If the container width is already known from a previous render, update the overflow with its width.
|
|
106
|
-
// Do this in an animation frame to avoid forcing layout to happen early.
|
|
107
|
-
if (containerWidthRef.current !== undefined) {
|
|
108
|
-
var win_1 = utilities_1.getWindow(container);
|
|
109
|
-
if (win_1) {
|
|
110
|
-
var animationFrameId_1 = win_1.requestAnimationFrame(updateOverflowRef.current);
|
|
111
|
-
cancelAnimationFrame = function () { return win_1.cancelAnimationFrame(animationFrameId_1); };
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return function () {
|
|
115
|
-
if (cancelAnimationFrame) {
|
|
116
|
-
cancelAnimationFrame();
|
|
117
|
-
}
|
|
118
|
-
// On cleanup, need to remove all items from the overflow
|
|
119
|
-
// so they don't have stale properties on the next render
|
|
120
|
-
setOverflowIndex(items.length);
|
|
121
|
-
updateOverflowRef.current = undefined;
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
return { menuButtonRef: menuButtonRef };
|
|
125
|
-
};
|
|
126
|
-
exports.useOverflow = useOverflow;
|
|
127
|
-
});
|
|
128
|
-
//# sourceMappingURL=useOverflow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useOverflow.js","sourceRoot":"../src/","sources":["utilities/useOverflow.ts"],"names":[],"mappings":";;;;IAmCA;;;;;;;;;;;;;;;;;OAiBG;IACI,IAAM,WAAW,GAAG,UAAC,EAA4D;YAA1D,sBAAsB,4BAAA,EAAE,GAAG,SAAA,EAAE,WAAW,iBAAA;QACpE,IAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,EAAc,CAAC;QACrD,IAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,EAAU,CAAC;QAEjD,4CAA4C;QAC5C,IAAM,YAAY,GAAG,0BAAY,CAAc,UAAA,SAAS;YACtD,IAAM,eAAe,GAAG,6BAAa,CAAC,SAAS,EAAE,UAAA,OAAO;gBACtD,iBAAiB,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS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GAAG,aAAa,CAAC;oBAClC,sBAAsB,CACpB,aAAa,EACb,KAAK,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,KAAK,IAAK,OAAA,CAAC;wBACzB,GAAG,KAAA;wBACH,aAAa,EAAE,KAAK,IAAI,aAAa,IAAI,KAAK,KAAK,WAAW;qBAC/D,CAAC,EAHwB,CAGxB,CAAC,CACJ,CAAC;iBACH;YACH,CAAC,CAAC;YAEF,IAAI,oBAAoB,GAA6B,SAAS,CAAC;YAE/D,sGAAsG;YACtG,yEAAyE;YACzE,IAAI,iBAAiB,CAAC,OAAO,KAAK,SAAS,EAAE;gBAC3C,IAAM,KAAG,GAAG,qBAAS,CAAC,SAAS,CAAC,CAAC;gBACjC,IAAI,KAAG,EAAE;oBACP,IAAM,kBAAgB,GAAG,KAAG,CAAC,qBAAqB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;oBAC9E,oBAAoB,GAAG,cAAM,OAAA,KAAG,CAAC,oBAAoB,CAAC,kBAAgB,CAAC,EAA1C,CAA0C,CAAC;iBACzE;aACF;YAED,OAAO;gBACL,IAAI,oBAAoB,EAAE;oBACxB,oBAAoB,EAAE,CAAC;iBACxB;gBAED,yDAAyD;gBACzD,yDAAyD;gBACzD,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC/B,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;YACxC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,aAAa,eAAA,EAAE,CAAC;IAC3B,CAAC,CAAC;IA3HW,QAAA,WAAW,eA2HtB","sourcesContent":["import * as React from 'react';\nimport { useRefEffect, RefCallback } from '@fluentui/react-hooks';\nimport { getWindow } from '@fluentui/utilities';\nimport { observeResize } from './observeResize';\n\n/**\n * Callback to notify the user that the items in the overflow have changed. This should ensure that the overflow menu\n * is visible, and contains all of the overflowing items.\n *\n * @param overflowIndex - The index of the first item in the overflow, or items.length if nothing is overflowing.\n * @param items - The list of all items in the container, and whether that particular item is in the overflow\n */\nexport type OverflowItemsChangedCallback = (\n overflowIndex: number,\n items: { ele: HTMLElement; isOverflowing: boolean }[],\n) => void;\n\n/** Parameters for {@see useOverflow} */\nexport type OverflowParams = {\n /** Callback to notify the user that the items in the overflow have changed. */\n onOverflowItemsChanged: OverflowItemsChangedCallback;\n\n /** True if the element containing overflowMenuButtonRef is in right-to-left order */\n rtl: boolean;\n\n /** Optional: Index of item that should never go into the overflow menu. */\n pinnedIndex?: number;\n};\n\n/** Return value for {@see useOverflow} */\nexport type OverflowRefs = {\n /** Set the overflow menu button's ref to this ref callback */\n menuButtonRef: RefCallback<HTMLElement>;\n};\n\n/**\n * Track whether any items don't fit within their container, and move them to the overflow menu.\n * Items are moved into the overflow menu from back to front, excluding pinned items.\n *\n * The overflow menu button must be the last sibling of all of the items that can be put into the overflow, and it\n * must be hooked up to the `setMenuButtonRef` setter function that's returned by `useOverflow`:\n * ```ts\n * const overflow = useOverflow(...);\n * ```\n * ```jsx\n * <Container>\n * <Item /> // Index 0\n * <Item /> // Index 1\n * ...\n * <Button ref={overflow.setMenuButtonRef} /> // Can be any React.Component or HTMLElement\n * </Container>\n * ```\n */\nexport const useOverflow = ({ onOverflowItemsChanged, rtl, pinnedIndex }: OverflowParams): OverflowRefs => {\n const updateOverflowRef = React.useRef<() => void>();\n const containerWidthRef = React.useRef<number>();\n\n // Attach a resize observer to the container\n const containerRef = useRefEffect<HTMLElement>(container => {\n const cleanupObserver = observeResize(container, entries => {\n containerWidthRef.current = entries ? entries[0].contentRect.width : container.clientWidth;\n if (updateOverflowRef.current) {\n updateOverflowRef.current();\n }\n });\n\n return () => {\n cleanupObserver();\n containerWidthRef.current = undefined;\n };\n });\n\n const menuButtonRef = useRefEffect<HTMLElement>(menuButton => {\n containerRef(menuButton.parentElement);\n return () => containerRef(null);\n });\n\n // eslint-disable-next-line no-restricted-properties\n React.useLayoutEffect(() => {\n const container = containerRef.current;\n const menuButton = menuButtonRef.current;\n if (!container || !menuButton) {\n return;\n }\n\n // items contains the container's children, excluding the overflow menu button itself\n const items: HTMLElement[] = [];\n for (let i = 0; i < container.children.length; i++) {\n const item = container.children[i];\n if (item instanceof HTMLElement && item !== menuButton) {\n items.push(item);\n }\n }\n\n // Keep track of the minimum width of the container to fit each child index.\n // This cache is an integral part of the algorithm and not just a performance optimization: it allows us to\n // recalculate the overflowIndex on subsequent resizes even if some items are already inside the overflow.\n const minContainerWidth: number[] = [];\n let extraWidth = 0; // The accumulated width of items that don't move into the overflow\n\n updateOverflowRef.current = () => {\n const containerWidth = containerWidthRef.current;\n if (containerWidth === undefined) {\n return;\n }\n\n // Iterate the items in reverse order until we find one that fits within the bounds of the container\n for (let i = items.length - 1; i >= 0; i--) {\n // Calculate the min container width for this item if we haven't done so yet\n if (minContainerWidth[i] === undefined) {\n const itemOffsetEnd = rtl ? containerWidth - items[i].offsetLeft : items[i].offsetLeft + items[i].offsetWidth;\n\n // If the item after this one is pinned, reserve space for it\n if (i + 1 < items.length && i + 1 === pinnedIndex) {\n // Use distance between the end of the previous item and this one (rather than the\n // pinned item's offsetWidth), to account for any margin between the items.\n extraWidth = minContainerWidth[i + 1] - itemOffsetEnd;\n }\n\n // Reserve space for the menu button after the first item was added to the overflow\n if (i === items.length - 2) {\n extraWidth += menuButton.offsetWidth;\n }\n\n minContainerWidth[i] = itemOffsetEnd + extraWidth;\n }\n\n if (containerWidth > minContainerWidth[i]) {\n setOverflowIndex(i + 1);\n return;\n }\n }\n\n // If we got here, nothing fits outside the overflow\n setOverflowIndex(0);\n };\n\n let prevOverflowIndex = items.length;\n const setOverflowIndex = (overflowIndex: number) => {\n if (prevOverflowIndex !== overflowIndex) {\n prevOverflowIndex = overflowIndex;\n onOverflowItemsChanged(\n overflowIndex,\n items.map((ele, index) => ({\n ele,\n isOverflowing: index >= overflowIndex && index !== pinnedIndex,\n })),\n );\n }\n };\n\n let cancelAnimationFrame: (() => void) | undefined = undefined;\n\n // If the container width is already known from a previous render, update the overflow with its width.\n // Do this in an animation frame to avoid forcing layout to happen early.\n if (containerWidthRef.current !== undefined) {\n const win = getWindow(container);\n if (win) {\n const animationFrameId = win.requestAnimationFrame(updateOverflowRef.current);\n cancelAnimationFrame = () => win.cancelAnimationFrame(animationFrameId);\n }\n }\n\n return () => {\n if (cancelAnimationFrame) {\n cancelAnimationFrame();\n }\n\n // On cleanup, need to remove all items from the overflow\n // so they don't have stale properties on the next render\n setOverflowIndex(items.length);\n updateOverflowRef.current = undefined;\n };\n });\n\n return { menuButtonRef };\n};\n"]}
|
package/lib-commonjs/Tabs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Tabs/index';
|
package/lib-commonjs/Tabs.js
DELETED
package/lib-commonjs/Tabs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"../src/","sources":["Tabs.ts"],"names":[],"mappings":";;;AAAA,kEAAwC","sourcesContent":["export * from './components/Tabs/index';\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isConformant = void 0;
|
|
4
|
-
var react_conformance_1 = require("@fluentui/react-conformance");
|
|
5
|
-
function isConformant(testInfo) {
|
|
6
|
-
var defaultOptions = {
|
|
7
|
-
disabledTests: ['has-docblock', 'kebab-aria-attributes'],
|
|
8
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
9
|
-
};
|
|
10
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
|
11
|
-
}
|
|
12
|
-
exports.isConformant = isConformant;
|
|
13
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;AAAA,iEAAoG;AAEpG,SAAgB,YAAY,CAC1B,QAAyF;IAEzF,IAAM,cAAc,GAAyC;QAC3D,aAAa,EAAE,CAAC,cAAc,EAAE,uBAAuB,CAAC;QACxD,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;KAC7D,CAAC;IAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AATD,oCASC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n disabledTests: ['has-docblock', 'kebab-aria-attributes'],\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TabItem = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var React = require("react");
|
|
6
|
-
var utilities_1 = require("@fluentui/utilities");
|
|
7
|
-
// const COMPONENT_NAME = 'TabItem';
|
|
8
|
-
var TabItem = /** @class */ (function (_super) {
|
|
9
|
-
tslib_1.__extends(TabItem, _super);
|
|
10
|
-
function TabItem(props) {
|
|
11
|
-
var _this = _super.call(this, props) || this;
|
|
12
|
-
utilities_1.initializeComponentRef(_this);
|
|
13
|
-
return _this;
|
|
14
|
-
}
|
|
15
|
-
TabItem.prototype.render = function () {
|
|
16
|
-
return React.createElement("div", tslib_1.__assign({}, utilities_1.getNativeProps(this.props, utilities_1.divProperties)), this.props.children);
|
|
17
|
-
};
|
|
18
|
-
return TabItem;
|
|
19
|
-
}(React.Component));
|
|
20
|
-
exports.TabItem = TabItem;
|
|
21
|
-
//# sourceMappingURL=TabItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.js","sourceRoot":"../src/","sources":["components/Tabs/TabItem.tsx"],"names":[],"mappings":";;;;AAAA,6BAA+B;AAC/B,iDAA4F;AAG5F,oCAAoC;AAEpC;IAA6B,mCAAiC;IAC5D,iBAAY,KAAmB;QAA/B,YACE,kBAAM,KAAK,CAAC,SAGb;QADC,kCAAsB,CAAC,KAAI,CAAC,CAAC;;IAC/B,CAAC;IAEM,wBAAM,GAAb;QACE,OAAO,gDAAS,0BAAc,CAAC,IAAI,CAAC,KAAK,EAAE,yBAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAO,CAAC;IACzF,CAAC;IACH,cAAC;AAAD,CAAC,AAVD,CAA6B,KAAK,CAAC,SAAS,GAU3C;AAVY,0BAAO","sourcesContent":["import * as React from 'react';\nimport { getNativeProps, divProperties, initializeComponentRef } from '@fluentui/utilities';\nimport { TabItemProps } from './TabItem.types';\n\n// const COMPONENT_NAME = 'TabItem';\n\nexport class TabItem extends React.Component<TabItemProps, {}> {\n constructor(props: TabItemProps) {\n super(props);\n\n initializeComponentRef(this);\n }\n\n public render(): JSX.Element {\n return <div {...getNativeProps(this.props, divProperties)}>{this.props.children}</div>;\n }\n}\n"]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IKeytipProps } from '@fluentui/react';
|
|
3
|
-
import { IButtonProps } from '@fluentui/react/lib/Button';
|
|
4
|
-
import { IRefObject, IRenderFunction } from '@fluentui/utilities';
|
|
5
|
-
/**
|
|
6
|
-
* {@docCategory Tabs}
|
|
7
|
-
*/
|
|
8
|
-
export interface TabItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
/**
|
|
10
|
-
* Gets the component ref.
|
|
11
|
-
*/
|
|
12
|
-
componentRef?: IRefObject<{}>;
|
|
13
|
-
/**
|
|
14
|
-
* The text displayed of each tab.
|
|
15
|
-
*/
|
|
16
|
-
headerText?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Props for the header command button. This provides a way to pass in native props, such as data-* and aria-*,
|
|
19
|
-
* for each tab element.
|
|
20
|
-
*/
|
|
21
|
-
headerButtonProps?: IButtonProps | {
|
|
22
|
-
[key: string]: string | number | boolean;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* An required key to uniquely identify a tab item.
|
|
26
|
-
*
|
|
27
|
-
* Note: The 'key' from react props cannot be used inside component.
|
|
28
|
-
*/
|
|
29
|
-
itemKey?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The aria label of each tab which will read by screen reader instead of headerText.
|
|
32
|
-
*
|
|
33
|
-
* Note that unless you have compelling requirements you should not override aria-label.
|
|
34
|
-
*/
|
|
35
|
-
ariaLabel?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Defines an optional item count displayed in parentheses just after the `headerText`.
|
|
38
|
-
*
|
|
39
|
-
* Examples: completed (4), Unread (99+)
|
|
40
|
-
*/
|
|
41
|
-
itemCount?: number | string;
|
|
42
|
-
/**
|
|
43
|
-
* An optional icon to show next to the tab.
|
|
44
|
-
*/
|
|
45
|
-
itemIcon?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Optional custom renderer for the tab
|
|
48
|
-
*/
|
|
49
|
-
onRenderTab?: IRenderFunction<TabItemProps>;
|
|
50
|
-
/**
|
|
51
|
-
* Optional keytip for this TabItem
|
|
52
|
-
*/
|
|
53
|
-
keytipProps?: IKeytipProps;
|
|
54
|
-
/**
|
|
55
|
-
* Defines whether to always render the tab item (regardless of whether it is selected or not).
|
|
56
|
-
* Useful if you're rendering content that is expensive to mount.
|
|
57
|
-
*
|
|
58
|
-
* @defaultvalue false
|
|
59
|
-
*/
|
|
60
|
-
alwaysRender?: boolean;
|
|
61
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.types.js","sourceRoot":"../src/","sources":["components/Tabs/TabItem.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { IKeytipProps } from '@fluentui/react';\nimport { IButtonProps } from '@fluentui/react/lib/Button';\nimport { IRefObject, IRenderFunction } from '@fluentui/utilities';\n\n/**\n * {@docCategory Tabs}\n */\nexport interface TabItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Gets the component ref.\n */\n componentRef?: IRefObject<{}>;\n\n /**\n * The text displayed of each tab.\n */\n headerText?: string;\n\n /**\n * Props for the header command button. This provides a way to pass in native props, such as data-* and aria-*,\n * for each tab element.\n */\n headerButtonProps?: IButtonProps | { [key: string]: string | number | boolean };\n\n /**\n * An required key to uniquely identify a tab item.\n *\n * Note: The 'key' from react props cannot be used inside component.\n */\n itemKey?: string;\n\n /**\n * The aria label of each tab which will read by screen reader instead of headerText.\n *\n * Note that unless you have compelling requirements you should not override aria-label.\n */\n ariaLabel?: string;\n\n /**\n * Defines an optional item count displayed in parentheses just after the `headerText`.\n *\n * Examples: completed (4), Unread (99+)\n */\n itemCount?: number | string;\n\n /**\n * An optional icon to show next to the tab.\n */\n itemIcon?: string;\n\n /**\n * Optional custom renderer for the tab\n */\n onRenderTab?: IRenderFunction<TabItemProps>;\n\n /**\n * Optional keytip for this TabItem\n */\n keytipProps?: IKeytipProps;\n\n /**\n * Defines whether to always render the tab item (regardless of whether it is selected or not).\n * Useful if you're rendering content that is expensive to mount.\n *\n * @defaultvalue false\n */\n alwaysRender?: boolean;\n}\n"]}
|