@fluentui/react-tabs 1.0.0-beta.97 → 9.0.0-beta.10
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 +181 -1762
- package/CHANGELOG.md +54 -718
- package/README.md +0 -17
- package/Spec.md +433 -0
- package/dist/react-tabs.d.ts +173 -127
- 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 +78 -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 +402 -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/tab.constants.d.ts +62 -0
- package/lib/tab.constants.js +68 -0
- package/lib/tab.constants.js.map +1 -0
- 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 +91 -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/lib-commonjs/tab.constants.d.ts +62 -0
- package/lib-commonjs/tab.constants.js +75 -0
- package/lib-commonjs/tab.constants.js.map +1 -0
- package/package.json +25 -21
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -14
- 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 -2
- 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 -2
- 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 -2
- 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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-tabs",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Fluent UI React
|
|
3
|
+
"version": "9.0.0-beta.10",
|
|
4
|
+
"description": "Fluent UI React tabs components",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
@@ -17,29 +17,26 @@
|
|
|
17
17
|
"code-style": "just-scripts code-style",
|
|
18
18
|
"just": "just-scripts",
|
|
19
19
|
"lint": "just-scripts lint",
|
|
20
|
-
"start": "
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
20
|
+
"start": "yarn storybook",
|
|
21
|
+
"test": "jest --passWithNoTests",
|
|
22
|
+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
23
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-tabs/src && yarn docs",
|
|
24
|
+
"storybook": "node ../../scripts/storybook/runner",
|
|
25
|
+
"type-check": "tsc -b tsconfig.json"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|
|
26
|
-
"@fluentui/eslint-plugin": "
|
|
27
|
-
"@fluentui/react-conformance": "
|
|
28
|
-
"@fluentui/
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@types/react": "16.9.42",
|
|
32
|
-
"@types/react-dom": "16.9.10",
|
|
33
|
-
"@types/react-test-renderer": "^16.0.0",
|
|
34
|
-
"enzyme": "~3.10.0",
|
|
35
|
-
"react": "16.8.6",
|
|
36
|
-
"react-dom": "16.8.6"
|
|
28
|
+
"@fluentui/eslint-plugin": "*",
|
|
29
|
+
"@fluentui/react-conformance": "*",
|
|
30
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.4",
|
|
31
|
+
"@fluentui/react-context-selector": "9.0.0-rc.6",
|
|
32
|
+
"@fluentui/scripts": "^1.0.0"
|
|
37
33
|
},
|
|
38
34
|
"dependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@fluentui/react-
|
|
41
|
-
"@fluentui/
|
|
42
|
-
"@fluentui/
|
|
35
|
+
"@griffel/react": "1.0.3",
|
|
36
|
+
"@fluentui/react-context-selector": "9.0.0-rc.6",
|
|
37
|
+
"@fluentui/react-tabster": "9.0.0-rc.7",
|
|
38
|
+
"@fluentui/react-theme": "9.0.0-rc.5",
|
|
39
|
+
"@fluentui/react-utilities": "9.0.0-rc.6",
|
|
43
40
|
"tslib": "^2.1.0"
|
|
44
41
|
},
|
|
45
42
|
"peerDependencies": {
|
|
@@ -55,5 +52,12 @@
|
|
|
55
52
|
"minor",
|
|
56
53
|
"patch"
|
|
57
54
|
]
|
|
55
|
+
},
|
|
56
|
+
"exports": {
|
|
57
|
+
".": {
|
|
58
|
+
"types": "./lib/index.d.ts",
|
|
59
|
+
"import": "./lib/index.js",
|
|
60
|
+
"require": "./lib-commonjs/index.js"
|
|
61
|
+
}
|
|
58
62
|
}
|
|
59
63
|
}
|
package/config/tests.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Jest test setup file. */
|
|
2
|
-
|
|
3
|
-
const { configure } = require('enzyme');
|
|
4
|
-
const { initializeIcons } = require('@fluentui/font-icons-mdl2');
|
|
5
|
-
const Adapter = require('enzyme-adapter-react-16');
|
|
6
|
-
const { resetIds } = require('@fluentui/utilities');
|
|
7
|
-
|
|
8
|
-
// Initialize icons.
|
|
9
|
-
initializeIcons('');
|
|
10
|
-
|
|
11
|
-
// Configure enzyme.
|
|
12
|
-
configure({ adapter: new Adapter() });
|
|
13
|
-
|
|
14
|
-
resetIds();
|
package/etc/react-tabs.api.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
## API Report File for "@fluentui/react-tabs"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { IButtonProps } from '@fluentui/react/lib/Button';
|
|
8
|
-
import { IKeytipProps } from '@fluentui/react';
|
|
9
|
-
import { IRefObject } from '@fluentui/utilities';
|
|
10
|
-
import { IRenderFunction } from '@fluentui/utilities';
|
|
11
|
-
import { IStyle } from '@fluentui/style-utilities';
|
|
12
|
-
import { IStyleFunctionOrObject } from '@fluentui/utilities';
|
|
13
|
-
import { ITheme } from '@fluentui/style-utilities';
|
|
14
|
-
import * as React_2 from 'react';
|
|
15
|
-
|
|
16
|
-
// @public
|
|
17
|
-
export type TabFormatType = 'links' | 'tabs';
|
|
18
|
-
|
|
19
|
-
// @public (undocumented)
|
|
20
|
-
export class TabItem extends React_2.Component<TabItemProps, {}> {
|
|
21
|
-
constructor(props: TabItemProps);
|
|
22
|
-
// (undocumented)
|
|
23
|
-
render(): JSX.Element;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// @public (undocumented)
|
|
27
|
-
export interface TabItemProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
28
|
-
alwaysRender?: boolean;
|
|
29
|
-
ariaLabel?: string;
|
|
30
|
-
componentRef?: IRefObject<{}>;
|
|
31
|
-
headerButtonProps?: IButtonProps | {
|
|
32
|
-
[key: string]: string | number | boolean;
|
|
33
|
-
};
|
|
34
|
-
headerText?: string;
|
|
35
|
-
itemCount?: number | string;
|
|
36
|
-
itemIcon?: string;
|
|
37
|
-
itemKey?: string;
|
|
38
|
-
keytipProps?: IKeytipProps;
|
|
39
|
-
onRenderTab?: IRenderFunction<TabItemProps>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// @public
|
|
43
|
-
export const Tabs: React_2.FunctionComponent<TabsProps>;
|
|
44
|
-
|
|
45
|
-
// @public (undocumented)
|
|
46
|
-
export const TabsBase: React_2.FunctionComponent<TabsProps>;
|
|
47
|
-
|
|
48
|
-
// @public (undocumented)
|
|
49
|
-
export interface TabsImperativeHandle {
|
|
50
|
-
focus(): void;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// @public
|
|
54
|
-
export type TabSizeType = 'normal' | 'large';
|
|
55
|
-
|
|
56
|
-
// @public (undocumented)
|
|
57
|
-
export interface TabsProps extends React_2.HTMLAttributes<HTMLDivElement>, React_2.RefAttributes<HTMLDivElement> {
|
|
58
|
-
className?: string;
|
|
59
|
-
componentRef?: React_2.RefObject<TabsImperativeHandle>;
|
|
60
|
-
defaultSelectedKey?: string;
|
|
61
|
-
getTabId?: (itemKey: string, index: number) => string;
|
|
62
|
-
headersOnly?: boolean;
|
|
63
|
-
onTabClick?: (item?: TabItem, ev?: React_2.MouseEvent<HTMLElement>) => void;
|
|
64
|
-
overflowBehavior?: 'none' | 'menu';
|
|
65
|
-
selectedKey?: string | null;
|
|
66
|
-
styles?: IStyleFunctionOrObject<TabsStyleProps, TabsStyles>;
|
|
67
|
-
tabFormat?: TabFormatType;
|
|
68
|
-
tabSize?: TabSizeType;
|
|
69
|
-
theme?: ITheme;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// @public (undocumented)
|
|
73
|
-
export type TabsStyleProps = Required<Pick<TabsProps, 'theme'>> & Pick<TabsProps, 'className'> & {
|
|
74
|
-
tabSize?: TabSizeType;
|
|
75
|
-
tabFormat?: TabFormatType;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// @public (undocumented)
|
|
79
|
-
export interface TabsStyles {
|
|
80
|
-
// (undocumented)
|
|
81
|
-
count: IStyle;
|
|
82
|
-
// (undocumented)
|
|
83
|
-
icon: IStyle;
|
|
84
|
-
// (undocumented)
|
|
85
|
-
itemContainer?: IStyle;
|
|
86
|
-
// (undocumented)
|
|
87
|
-
overflowMenuButton: IStyle;
|
|
88
|
-
root: IStyle;
|
|
89
|
-
// (undocumented)
|
|
90
|
-
tab: IStyle;
|
|
91
|
-
// (undocumented)
|
|
92
|
-
tabContent: IStyle;
|
|
93
|
-
// (undocumented)
|
|
94
|
-
tabInMenu: IStyle;
|
|
95
|
-
// (undocumented)
|
|
96
|
-
tabIsSelected: IStyle;
|
|
97
|
-
// (undocumented)
|
|
98
|
-
text: IStyle;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// (No @packageDocumentation comment for this package)
|
|
103
|
-
|
|
104
|
-
```
|
package/just.config.ts
DELETED
package/lib/Tabs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Tabs/index';
|
package/lib/Tabs.js
DELETED
package/lib/Tabs.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"../src/","sources":["Tabs.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './components/Tabs/index';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
|
2
|
-
export function isConformant(testInfo) {
|
|
3
|
-
var defaultOptions = {
|
|
4
|
-
disabledTests: ['has-docblock', 'kebab-aria-attributes'],
|
|
5
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
|
6
|
-
};
|
|
7
|
-
baseIsConformant(defaultOptions, testInfo);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=isConformant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAuB,MAAM,6BAA6B,CAAC;AAEpG,MAAM,UAAU,YAAY,CAAC,QAAoD;IAC/E,IAAM,cAAc,GAAG;QACrB,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,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant(testInfo: Omit<IsConformantOptions, 'componentPath'>) {\n const defaultOptions = {\n disabledTests: ['has-docblock', 'kebab-aria-attributes'],\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { __assign, __extends } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { getNativeProps, divProperties, initializeComponentRef } from '@fluentui/utilities';
|
|
4
|
-
// const COMPONENT_NAME = 'TabItem';
|
|
5
|
-
var TabItem = /** @class */ (function (_super) {
|
|
6
|
-
__extends(TabItem, _super);
|
|
7
|
-
function TabItem(props) {
|
|
8
|
-
var _this = _super.call(this, props) || this;
|
|
9
|
-
initializeComponentRef(_this);
|
|
10
|
-
return _this;
|
|
11
|
-
}
|
|
12
|
-
TabItem.prototype.render = function () {
|
|
13
|
-
return React.createElement("div", __assign({}, getNativeProps(this.props, divProperties)), this.props.children);
|
|
14
|
-
};
|
|
15
|
-
return TabItem;
|
|
16
|
-
}(React.Component));
|
|
17
|
-
export { TabItem };
|
|
18
|
-
//# sourceMappingURL=TabItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.js","sourceRoot":"../src/","sources":["components/Tabs/TabItem.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAG5F,oCAAoC;AAEpC;IAA6B,2BAAiC;IAC5D,iBAAY,KAAmB;QAA/B,YACE,kBAAM,KAAK,CAAC,SAGb;QADC,sBAAsB,CAAC,KAAI,CAAC,CAAC;;IAC/B,CAAC;IAEM,wBAAM,GAAb;QACE,OAAO,wCAAS,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAO,CAAC;IACzF,CAAC;IACH,cAAC;AAAD,CAAC,AAVD,CAA6B,KAAK,CAAC,SAAS,GAU3C","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"]}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useControllableValue, useId } from '@fluentui/react-hooks';
|
|
4
|
-
import { classNamesFunction, css, divProperties, getNativeProps, getRTL, KeyCodes, warn } from '@fluentui/utilities';
|
|
5
|
-
import { DirectionalHint, FocusZone, FocusZoneDirection, Icon, } from '@fluentui/react';
|
|
6
|
-
import { CommandButton } from '@fluentui/react/lib/Button';
|
|
7
|
-
import { TabItem } from './index';
|
|
8
|
-
import { useOverflow } from '../../utilities/useOverflow';
|
|
9
|
-
var getClassNames = classNamesFunction();
|
|
10
|
-
var COMPONENT_NAME = 'Tabs';
|
|
11
|
-
var getTabId = function (props, baseId, itemKey, index) {
|
|
12
|
-
if (props.getTabId) {
|
|
13
|
-
return props.getTabId(itemKey, index);
|
|
14
|
-
}
|
|
15
|
-
return baseId + ("-Tab" + index);
|
|
16
|
-
};
|
|
17
|
-
// Gets the set of Tabs as array of TabItemProps
|
|
18
|
-
// The set of Tabs is determined by child components of type TabItem
|
|
19
|
-
var getTabItems = function (props, baseId) {
|
|
20
|
-
var result = {
|
|
21
|
-
tabs: [],
|
|
22
|
-
keyToIndexMapping: {},
|
|
23
|
-
keyToTabIdMapping: {},
|
|
24
|
-
};
|
|
25
|
-
React.Children.forEach(React.Children.toArray(props.children), function (child, index) {
|
|
26
|
-
if (isTabItem(child)) {
|
|
27
|
-
var _a = child.props, _b = _a.itemKey, itemKey = _b === void 0 ? index.toString() : _b, tabItemProps = __rest(_a, ["itemKey"]);
|
|
28
|
-
result.tabs.push(__assign(__assign({}, tabItemProps), { itemKey: itemKey }));
|
|
29
|
-
result.keyToIndexMapping[itemKey] = index;
|
|
30
|
-
result.keyToTabIdMapping[itemKey] = getTabId(props, baseId, itemKey, index);
|
|
31
|
-
}
|
|
32
|
-
else if (child) {
|
|
33
|
-
warn('The children of a Tabs component must be of type TabItem to be rendered.');
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
var isTabItem = function (item) {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
return ((_b = (_a = item) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.name) === TabItem.name;
|
|
41
|
-
};
|
|
42
|
-
export var TabsBase = React.forwardRef(function (props, ref) {
|
|
43
|
-
var focusZoneRef = React.useRef(null);
|
|
44
|
-
var overflowMenuButtonComponentRef = React.useRef(null);
|
|
45
|
-
var baseId = useId('Tabs');
|
|
46
|
-
var _a = useControllableValue(props.selectedKey, props.defaultSelectedKey), selectedKey = _a[0], setSelectedKey = _a[1];
|
|
47
|
-
var componentRef = props.componentRef, theme = props.theme, tabSize = props.tabSize, tabFormat = props.tabFormat, overflowBehavior = props.overflowBehavior;
|
|
48
|
-
var classNames;
|
|
49
|
-
var divProps = getNativeProps(props, divProperties);
|
|
50
|
-
var tabCollection = getTabItems(props, baseId);
|
|
51
|
-
React.useImperativeHandle(componentRef, function () { return ({
|
|
52
|
-
focus: function () {
|
|
53
|
-
var _a;
|
|
54
|
-
(_a = focusZoneRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
55
|
-
},
|
|
56
|
-
}); });
|
|
57
|
-
var renderTabContent = function (tab) {
|
|
58
|
-
if (!tab) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
var itemCount = tab.itemCount, itemIcon = tab.itemIcon, headerText = tab.headerText;
|
|
62
|
-
return (React.createElement("span", { className: classNames.tabContent },
|
|
63
|
-
itemIcon !== undefined && (React.createElement("span", { className: classNames.icon },
|
|
64
|
-
React.createElement(Icon, { iconName: itemIcon }))),
|
|
65
|
-
headerText !== undefined && React.createElement("span", { className: classNames.text },
|
|
66
|
-
" ",
|
|
67
|
-
tab.headerText),
|
|
68
|
-
itemCount !== undefined && React.createElement("span", { className: classNames.count },
|
|
69
|
-
" (",
|
|
70
|
-
itemCount,
|
|
71
|
-
")")));
|
|
72
|
-
};
|
|
73
|
-
var renderTab = function (renderTabCollection, tab, renderTabSelectedKey, className) {
|
|
74
|
-
var itemKey = tab.itemKey, headerButtonProps = tab.headerButtonProps, onRenderTab = tab.onRenderTab;
|
|
75
|
-
var tabId = renderTabCollection.keyToTabIdMapping[itemKey];
|
|
76
|
-
var tabContent;
|
|
77
|
-
var isSelected = renderTabSelectedKey === itemKey;
|
|
78
|
-
if (onRenderTab) {
|
|
79
|
-
tabContent = onRenderTab(tab, renderTabContent);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
tabContent = renderTabContent(tab);
|
|
83
|
-
}
|
|
84
|
-
var contentString = tab.headerText || '';
|
|
85
|
-
contentString += tab.itemCount ? ' (' + tab.itemCount + ')' : '';
|
|
86
|
-
// Adding space supplementary for icon
|
|
87
|
-
contentString += tab.itemIcon ? ' xx' : '';
|
|
88
|
-
return (React.createElement(CommandButton, __assign({}, headerButtonProps, { id: tabId, key: itemKey, className: css(className, isSelected && classNames.tabIsSelected),
|
|
89
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
90
|
-
onClick: function (ev) { return onTabClick(itemKey, ev); },
|
|
91
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
92
|
-
onKeyDown: function (ev) { return onKeyDown(itemKey, ev); }, "aria-label": tab.ariaLabel, role: tab.role || 'tab', "aria-selected": isSelected, name: tab.headerText, keytipProps: tab.keytipProps, "data-content": contentString }), tabContent));
|
|
93
|
-
};
|
|
94
|
-
var onTabClick = function (itemKey, ev) {
|
|
95
|
-
ev.preventDefault();
|
|
96
|
-
updateSelectedItem(itemKey, ev);
|
|
97
|
-
};
|
|
98
|
-
var onKeyDown = function (itemKey, ev) {
|
|
99
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
100
|
-
if (ev.which === KeyCodes.enter) {
|
|
101
|
-
ev.preventDefault();
|
|
102
|
-
updateSelectedItem(itemKey);
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var updateSelectedItem = function (itemKey, ev) {
|
|
106
|
-
var _a;
|
|
107
|
-
setSelectedKey(itemKey);
|
|
108
|
-
tabCollection = getTabItems(props, baseId);
|
|
109
|
-
if (props.onTabClick && tabCollection.keyToIndexMapping[itemKey] >= 0) {
|
|
110
|
-
var selectedIndex = tabCollection.keyToIndexMapping[itemKey];
|
|
111
|
-
var item = React.Children.toArray(props.children)[selectedIndex];
|
|
112
|
-
if (isTabItem(item)) {
|
|
113
|
-
props.onTabClick(item, ev);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
(_a = overflowMenuButtonComponentRef.current) === null || _a === void 0 ? void 0 : _a.dismissMenu();
|
|
117
|
-
};
|
|
118
|
-
var renderTabItem = function (itemKey, isActive) {
|
|
119
|
-
if (props.headersOnly || !itemKey) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
var index = tabCollection.keyToIndexMapping[itemKey];
|
|
123
|
-
var selectedTabId = tabCollection.keyToTabIdMapping[itemKey];
|
|
124
|
-
return (React.createElement("div", { role: "tabpanel", hidden: !isActive, key: itemKey, "aria-hidden": !isActive, "aria-labelledby": selectedTabId, className: classNames.itemContainer }, React.Children.toArray(props.children)[index]));
|
|
125
|
-
};
|
|
126
|
-
var isKeyValid = function (itemKey) {
|
|
127
|
-
return itemKey !== undefined && itemKey !== null && tabCollection.keyToIndexMapping[itemKey] !== undefined;
|
|
128
|
-
};
|
|
129
|
-
var getSelectedKey = function () {
|
|
130
|
-
if (isKeyValid(selectedKey)) {
|
|
131
|
-
return selectedKey;
|
|
132
|
-
}
|
|
133
|
-
if (tabCollection.tabs.length) {
|
|
134
|
-
return tabCollection.tabs[0].itemKey;
|
|
135
|
-
}
|
|
136
|
-
return undefined;
|
|
137
|
-
};
|
|
138
|
-
classNames = getClassNames(props.styles, {
|
|
139
|
-
theme: theme,
|
|
140
|
-
tabSize: tabSize,
|
|
141
|
-
tabFormat: tabFormat,
|
|
142
|
-
});
|
|
143
|
-
var renderedSelectedKey = getSelectedKey();
|
|
144
|
-
var renderedSelectedIndex = renderedSelectedKey ? tabCollection.keyToIndexMapping[renderedSelectedKey] : 0;
|
|
145
|
-
var items = tabCollection.tabs.map(function (l) { return renderTab(tabCollection, l, renderedSelectedKey, classNames.tab); });
|
|
146
|
-
// The overflow menu starts empty and items[] is updated as the overflow items change
|
|
147
|
-
var overflowMenuProps = React.useMemo(function () { return ({
|
|
148
|
-
items: [],
|
|
149
|
-
alignTargetEdge: true,
|
|
150
|
-
directionalHint: DirectionalHint.bottomRightEdge,
|
|
151
|
-
}); }, []);
|
|
152
|
-
var overflowMenuButtonRef = useOverflow({
|
|
153
|
-
onOverflowItemsChanged: function (overflowIndex, elements) {
|
|
154
|
-
// Set data-is-overflowing on each item
|
|
155
|
-
elements.forEach(function (_a) {
|
|
156
|
-
var ele = _a.ele, isOverflowing = _a.isOverflowing;
|
|
157
|
-
return (ele.dataset.isOverflowing = "" + isOverflowing);
|
|
158
|
-
});
|
|
159
|
-
// Update the menu items
|
|
160
|
-
overflowMenuProps.items = tabCollection.tabs.slice(overflowIndex).map(function (tab, index) { return ({
|
|
161
|
-
key: tab.itemKey || "" + (overflowIndex + index),
|
|
162
|
-
onRender: function () { return renderTab(tabCollection, tab, renderedSelectedKey, classNames.tabInMenu); },
|
|
163
|
-
}); });
|
|
164
|
-
},
|
|
165
|
-
rtl: getRTL(theme),
|
|
166
|
-
pinnedIndex: renderedSelectedIndex,
|
|
167
|
-
}).menuButtonRef;
|
|
168
|
-
return (React.createElement("div", __assign({ role: "toolbar" }, divProps, { ref: ref }),
|
|
169
|
-
React.createElement(FocusZone, { componentRef: focusZoneRef, direction: FocusZoneDirection.horizontal, className: classNames.root, role: "tablist" },
|
|
170
|
-
items,
|
|
171
|
-
overflowBehavior === 'menu' && (React.createElement(CommandButton, { className: css(classNames.tab, classNames.overflowMenuButton), elementRef: overflowMenuButtonRef, componentRef: overflowMenuButtonComponentRef, menuProps: overflowMenuProps, menuIconProps: { iconName: 'More', style: { color: 'inherit' } } }))),
|
|
172
|
-
renderedSelectedKey &&
|
|
173
|
-
tabCollection.tabs.map(function (tab) {
|
|
174
|
-
return (tab.alwaysRender === true || renderedSelectedKey === tab.itemKey) &&
|
|
175
|
-
renderTabItem(tab.itemKey, renderedSelectedKey === tab.itemKey);
|
|
176
|
-
})));
|
|
177
|
-
});
|
|
178
|
-
TabsBase.displayName = COMPONENT_NAME;
|
|
179
|
-
//# sourceMappingURL=Tabs.base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.base.js","sourceRoot":"../src/","sources":["components/Tabs/Tabs.base.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,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AqB,EACjC,YAAY,EAAE,8BAA8B,EAC5C,SAAS,EAAE,iBAAiB,EAC5B,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAChE,CACH,CACS;QACX,mBAAmB;YAClB,aAAa,CAAC,IAAI,CAAC,GAAG,CACpB,UAAA,GAAG;gBACD,OAAA,CAAC,GAAG,CAAC,YAAY,KAAK,IAAI,IAAI,mBAAmB,KAAK,GAAG,CAAC,OAAO,CAAC;oBAClE,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,KAAK,GAAG,CAAC,OAAO,CAAC;YAD/D,CAC+D,CAClE,CACC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { useControllableValue, useId } from '@fluentui/react-hooks';\nimport { classNamesFunction, css, divProperties, getNativeProps, getRTL, KeyCodes, warn } from '@fluentui/utilities';\nimport {\n DirectionalHint,\n FocusZone,\n FocusZoneDirection,\n Icon,\n IContextualMenuProps,\n IFocusZone,\n} from '@fluentui/react';\nimport { CommandButton, IButton } from '@fluentui/react/lib/Button';\nimport { TabsImperativeHandle, TabItemProps, TabsProps, TabsStyleProps, TabsStyles, TabItem } from './index';\nimport { useOverflow } from '../../utilities/useOverflow';\n\nconst getClassNames = classNamesFunction<TabsStyleProps, TabsStyles>();\n\nconst COMPONENT_NAME = 'Tabs';\n\ntype TabItemCollection = {\n tabs: TabItemProps[];\n keyToIndexMapping: { [key: string]: number };\n keyToTabIdMapping: { [key: string]: string };\n};\n\nconst getTabId = (props: TabsProps, baseId: string, itemKey: string, index: number): string => {\n if (props.getTabId) {\n return props.getTabId(itemKey, index);\n }\n return baseId + `-Tab${index}`;\n};\n\n// Gets the set of Tabs as array of TabItemProps\n// The set of Tabs is determined by child components of type TabItem\nconst getTabItems = (props: TabsProps, baseId: string): TabItemCollection => {\n const result: TabItemCollection = {\n tabs: [],\n keyToIndexMapping: {},\n keyToTabIdMapping: {},\n };\n\n React.Children.forEach(React.Children.toArray(props.children), (child: React.ReactNode, index: number) => {\n if (isTabItem(child)) {\n const { itemKey = index.toString(), ...tabItemProps } = child.props;\n result.tabs.push({\n ...tabItemProps,\n itemKey: itemKey,\n });\n result.keyToIndexMapping[itemKey] = index;\n result.keyToTabIdMapping[itemKey] = getTabId(props, baseId, itemKey, index);\n } else if (child) {\n warn('The children of a Tabs component must be of type TabItem to be rendered.');\n }\n });\n return result;\n};\n\nconst isTabItem = (item: React.ReactNode): item is TabItem => {\n return ((item as React.ReactElement)?.type as React.ComponentType)?.name === TabItem.name;\n};\n\nexport const TabsBase: React.FunctionComponent<TabsProps> = React.forwardRef<HTMLDivElement, TabsProps>(\n (props, ref) => {\n const focusZoneRef = React.useRef<IFocusZone>(null);\n const overflowMenuButtonComponentRef = React.useRef<IButton>(null);\n const baseId: string = useId('Tabs');\n\n const [selectedKey, setSelectedKey] = useControllableValue(props.selectedKey, props.defaultSelectedKey);\n\n const { componentRef, theme, tabSize, tabFormat, overflowBehavior } = props;\n\n let classNames: { [key in keyof TabsStyles]: string };\n const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(props, divProperties);\n\n let tabCollection = getTabItems(props, baseId);\n\n React.useImperativeHandle(componentRef as React.RefObject<TabsImperativeHandle>, () => ({\n focus: () => {\n focusZoneRef.current?.focus();\n },\n }));\n\n const renderTabContent = (tab?: TabItemProps): JSX.Element | null => {\n if (!tab) {\n return null;\n }\n\n const { itemCount, itemIcon, headerText } = tab;\n return (\n <span className={classNames.tabContent}>\n {itemIcon !== undefined && (\n <span className={classNames.icon}>\n <Icon iconName={itemIcon} />\n </span>\n )}\n {headerText !== undefined && <span className={classNames.text}> {tab.headerText}</span>}\n {itemCount !== undefined && <span className={classNames.count}> ({itemCount})</span>}\n </span>\n );\n };\n\n const renderTab = (\n renderTabCollection: TabItemCollection,\n tab: TabItemProps,\n renderTabSelectedKey: string | null | undefined,\n className: string,\n ): JSX.Element => {\n const { itemKey, headerButtonProps, onRenderTab } = tab;\n const tabId = renderTabCollection.keyToTabIdMapping[itemKey!];\n let tabContent: JSX.Element | null;\n const isSelected: boolean = renderTabSelectedKey === itemKey;\n\n if (onRenderTab) {\n tabContent = onRenderTab(tab, renderTabContent);\n } else {\n tabContent = renderTabContent(tab);\n }\n\n let contentString = tab.headerText || '';\n contentString += tab.itemCount ? ' (' + tab.itemCount + ')' : '';\n // Adding space supplementary for icon\n contentString += tab.itemIcon ? ' xx' : '';\n return (\n <CommandButton\n {...headerButtonProps}\n id={tabId}\n key={itemKey}\n className={css(className, isSelected && classNames.tabIsSelected)}\n // eslint-disable-next-line react/jsx-no-bind\n onClick={(ev: React.MouseEvent<HTMLElement>) => onTabClick(itemKey!, ev)}\n // eslint-disable-next-line react/jsx-no-bind\n onKeyDown={(ev: React.KeyboardEvent<HTMLElement>) => onKeyDown(itemKey!, ev)}\n aria-label={tab.ariaLabel}\n role={tab.role || 'tab'}\n aria-selected={isSelected}\n name={tab.headerText}\n keytipProps={tab.keytipProps}\n data-content={contentString}\n >\n {tabContent}\n </CommandButton>\n );\n };\n\n const onTabClick = (itemKey: string, ev: React.MouseEvent<HTMLElement>): void => {\n ev.preventDefault();\n updateSelectedItem(itemKey, ev);\n };\n\n const onKeyDown = (itemKey: string, ev: React.KeyboardEvent<HTMLElement>): void => {\n // eslint-disable-next-line deprecation/deprecation\n if (ev.which === KeyCodes.enter) {\n ev.preventDefault();\n updateSelectedItem(itemKey);\n }\n };\n\n const updateSelectedItem = (itemKey: string, ev?: React.MouseEvent<HTMLElement>): void => {\n setSelectedKey(itemKey);\n tabCollection = getTabItems(props, baseId);\n if (props.onTabClick && tabCollection.keyToIndexMapping[itemKey] >= 0) {\n const selectedIndex = tabCollection.keyToIndexMapping[itemKey];\n const item = React.Children.toArray(props.children)[selectedIndex];\n if (isTabItem(item)) {\n props.onTabClick(item, ev);\n }\n }\n\n overflowMenuButtonComponentRef.current?.dismissMenu();\n };\n\n const renderTabItem = (itemKey: string | undefined, isActive: boolean): JSX.Element | null => {\n if (props.headersOnly || !itemKey) {\n return null;\n }\n\n const index = tabCollection.keyToIndexMapping[itemKey];\n const selectedTabId = tabCollection.keyToTabIdMapping[itemKey];\n return (\n <div\n role=\"tabpanel\"\n hidden={!isActive}\n key={itemKey}\n aria-hidden={!isActive}\n aria-labelledby={selectedTabId}\n className={classNames.itemContainer}\n >\n {React.Children.toArray(props.children)[index]}\n </div>\n );\n };\n\n const isKeyValid = (itemKey: string | null | undefined): boolean => {\n return itemKey !== undefined && itemKey !== null && tabCollection.keyToIndexMapping[itemKey] !== undefined;\n };\n\n const getSelectedKey = () => {\n if (isKeyValid(selectedKey)) {\n return selectedKey;\n }\n if (tabCollection.tabs.length) {\n return tabCollection.tabs[0].itemKey;\n }\n return undefined;\n };\n\n classNames = getClassNames(props.styles!, {\n theme: theme!,\n tabSize,\n tabFormat,\n });\n\n const renderedSelectedKey = getSelectedKey();\n const renderedSelectedIndex = renderedSelectedKey ? tabCollection.keyToIndexMapping[renderedSelectedKey] : 0;\n\n const items = tabCollection.tabs.map(l => renderTab(tabCollection, l, renderedSelectedKey, classNames.tab));\n\n // The overflow menu starts empty and items[] is updated as the overflow items change\n const overflowMenuProps: IContextualMenuProps = React.useMemo(\n () => ({\n items: [],\n alignTargetEdge: true,\n directionalHint: DirectionalHint.bottomRightEdge,\n }),\n [],\n );\n\n const { menuButtonRef: overflowMenuButtonRef } = useOverflow({\n onOverflowItemsChanged: (overflowIndex, elements) => {\n // Set data-is-overflowing on each item\n elements.forEach(({ ele, isOverflowing }) => (ele.dataset.isOverflowing = `${isOverflowing}`));\n\n // Update the menu items\n overflowMenuProps.items = tabCollection.tabs.slice(overflowIndex).map((tab, index) => ({\n key: tab.itemKey || `${overflowIndex + index}`,\n onRender: () => renderTab(tabCollection, tab, renderedSelectedKey, classNames.tabInMenu),\n }));\n },\n rtl: getRTL(theme),\n pinnedIndex: renderedSelectedIndex,\n });\n\n return (\n <div role=\"toolbar\" {...divProps} ref={ref}>\n <FocusZone\n componentRef={focusZoneRef}\n direction={FocusZoneDirection.horizontal}\n className={classNames.root}\n role=\"tablist\"\n >\n {items}\n {overflowBehavior === 'menu' && (\n <CommandButton\n className={css(classNames.tab, classNames.overflowMenuButton)}\n elementRef={overflowMenuButtonRef}\n componentRef={overflowMenuButtonComponentRef}\n menuProps={overflowMenuProps}\n menuIconProps={{ iconName: 'More', style: { color: 'inherit' } }}\n />\n )}\n </FocusZone>\n {renderedSelectedKey &&\n tabCollection.tabs.map(\n tab =>\n (tab.alwaysRender === true || renderedSelectedKey === tab.itemKey) &&\n renderTabItem(tab.itemKey, renderedSelectedKey === tab.itemKey),\n )}\n </div>\n );\n },\n);\nTabsBase.displayName = COMPONENT_NAME;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { TabsProps } from './Tabs.types';
|
|
3
|
-
/**
|
|
4
|
-
* The Tabs control and related tabs pattern are used for navigating frequently accessed,
|
|
5
|
-
* distinct content categories. Tabs allow for navigation between two or more content
|
|
6
|
-
* views and relies on text headers to articulate the different sections of content.
|
|
7
|
-
*/
|
|
8
|
-
export declare const Tabs: React.FunctionComponent<TabsProps>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { styled } from '@fluentui/utilities';
|
|
2
|
-
import { TabsBase } from './Tabs.base';
|
|
3
|
-
import { getStyles } from './Tabs.styles';
|
|
4
|
-
/**
|
|
5
|
-
* The Tabs control and related tabs pattern are used for navigating frequently accessed,
|
|
6
|
-
* distinct content categories. Tabs allow for navigation between two or more content
|
|
7
|
-
* views and relies on text headers to articulate the different sections of content.
|
|
8
|
-
*/
|
|
9
|
-
export var Tabs = styled(TabsBase, getStyles, undefined, {
|
|
10
|
-
scope: 'Tabs',
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=Tabs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"../src/","sources":["components/Tabs/Tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;GAIG;AACH,MAAM,CAAC,IAAM,IAAI,GAAuC,MAAM,CAC5D,QAAQ,EACR,SAAS,EACT,SAAS,EACT;IACE,KAAK,EAAE,MAAM;CACd,CACF,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '@fluentui/utilities';\nimport { TabsProps, TabsStyleProps, TabsStyles } from './Tabs.types';\nimport { TabsBase } from './Tabs.base';\nimport { getStyles } from './Tabs.styles';\n\n/**\n * The Tabs control and related tabs pattern are used for navigating frequently accessed,\n * distinct content categories. Tabs allow for navigation between two or more content\n * views and relies on text headers to articulate the different sections of content.\n */\nexport const Tabs: React.FunctionComponent<TabsProps> = styled<TabsProps, TabsStyleProps, TabsStyles>(\n TabsBase,\n getStyles,\n undefined,\n {\n scope: 'Tabs',\n },\n);\n"]}
|