@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
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { __assign, __spreadArrays } from "tslib";
|
|
2
|
-
import { AnimationVariables, getGlobalClassNames, HighContrastSelector, normalize, FontWeights, getHighContrastNoAdjustStyle, } from '@fluentui/style-utilities';
|
|
3
|
-
import { IsFocusVisibleClassName } from '@fluentui/utilities';
|
|
4
|
-
var globalClassNames = {
|
|
5
|
-
count: 'ms-Tabs-count',
|
|
6
|
-
icon: 'ms-Tabs-icon',
|
|
7
|
-
tabIsSelected: 'is-selected',
|
|
8
|
-
tab: 'ms-Tabs-tab',
|
|
9
|
-
tabContent: 'ms-Tabs-tabContent',
|
|
10
|
-
root: 'ms-Tabs',
|
|
11
|
-
rootIsLarge: 'ms-Tabs--large',
|
|
12
|
-
rootIsTabs: 'ms-Tabs--tabs',
|
|
13
|
-
text: 'ms-Tabs-text',
|
|
14
|
-
tabInMenu: 'ms-Tabs-tabInMenu',
|
|
15
|
-
overflowMenuButton: 'ms-Tabs-overflowMenuButton',
|
|
16
|
-
};
|
|
17
|
-
var getLinkStyles = function (props, classNames, isLinkInOverflowMenu) {
|
|
18
|
-
var _a, _b, _c;
|
|
19
|
-
if (isLinkInOverflowMenu === void 0) { isLinkInOverflowMenu = false; }
|
|
20
|
-
var tabSize = props.tabSize, tabFormat = props.tabFormat;
|
|
21
|
-
var _d = props.theme, semanticColors = _d.semanticColors, fonts = _d.fonts;
|
|
22
|
-
var rootIsLarge = tabSize === 'large';
|
|
23
|
-
var rootIsTabs = tabFormat === 'tabs';
|
|
24
|
-
return [
|
|
25
|
-
fonts.medium,
|
|
26
|
-
{
|
|
27
|
-
color: semanticColors.actionLink,
|
|
28
|
-
padding: '0 8px',
|
|
29
|
-
position: 'relative',
|
|
30
|
-
backgroundColor: 'transparent',
|
|
31
|
-
border: 0,
|
|
32
|
-
borderRadius: 0,
|
|
33
|
-
selectors: (_a = {
|
|
34
|
-
':hover': {
|
|
35
|
-
backgroundColor: semanticColors.buttonBackgroundHovered,
|
|
36
|
-
color: semanticColors.buttonTextHovered,
|
|
37
|
-
cursor: 'pointer',
|
|
38
|
-
},
|
|
39
|
-
':active': {
|
|
40
|
-
backgroundColor: semanticColors.buttonBackgroundPressed,
|
|
41
|
-
color: semanticColors.buttonTextHovered,
|
|
42
|
-
},
|
|
43
|
-
':focus': {
|
|
44
|
-
outline: 'none',
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
_a["." + IsFocusVisibleClassName + " &:focus"] = {
|
|
48
|
-
outline: "1px solid " + semanticColors.focusBorder,
|
|
49
|
-
},
|
|
50
|
-
_a["." + IsFocusVisibleClassName + " &:focus:after"] = {
|
|
51
|
-
content: 'attr(data-content)',
|
|
52
|
-
position: 'relative',
|
|
53
|
-
border: 0,
|
|
54
|
-
},
|
|
55
|
-
_a),
|
|
56
|
-
},
|
|
57
|
-
!isLinkInOverflowMenu && [
|
|
58
|
-
{
|
|
59
|
-
display: 'inline-block',
|
|
60
|
-
lineHeight: 44,
|
|
61
|
-
height: 44,
|
|
62
|
-
marginRight: 8,
|
|
63
|
-
textAlign: 'center',
|
|
64
|
-
selectors: {
|
|
65
|
-
':before': {
|
|
66
|
-
backgroundColor: 'transparent',
|
|
67
|
-
bottom: 0,
|
|
68
|
-
content: '""',
|
|
69
|
-
height: 2,
|
|
70
|
-
left: 8,
|
|
71
|
-
position: 'absolute',
|
|
72
|
-
right: 8,
|
|
73
|
-
transition: "left " + AnimationVariables.durationValue2 + " " + AnimationVariables.easeFunction2 + ",\n right " + AnimationVariables.durationValue2 + " " + AnimationVariables.easeFunction2,
|
|
74
|
-
},
|
|
75
|
-
':after': {
|
|
76
|
-
color: 'transparent',
|
|
77
|
-
content: 'attr(data-content)',
|
|
78
|
-
display: 'block',
|
|
79
|
-
fontWeight: FontWeights.bold,
|
|
80
|
-
height: 1,
|
|
81
|
-
overflow: 'hidden',
|
|
82
|
-
visibility: 'hidden',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
rootIsLarge && {
|
|
87
|
-
fontSize: fonts.large.fontSize,
|
|
88
|
-
},
|
|
89
|
-
rootIsTabs && [
|
|
90
|
-
{
|
|
91
|
-
marginRight: 0,
|
|
92
|
-
height: 44,
|
|
93
|
-
lineHeight: 44,
|
|
94
|
-
backgroundColor: semanticColors.buttonBackground,
|
|
95
|
-
padding: '0 10px',
|
|
96
|
-
verticalAlign: 'top',
|
|
97
|
-
selectors: (_b = {
|
|
98
|
-
':focus': {
|
|
99
|
-
outlineOffset: '-1px',
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
_b["." + IsFocusVisibleClassName + " &:focus::before"] = {
|
|
103
|
-
height: 'auto',
|
|
104
|
-
background: 'transparent',
|
|
105
|
-
transition: 'none',
|
|
106
|
-
},
|
|
107
|
-
_b['&:hover, &:focus'] = {
|
|
108
|
-
color: semanticColors.buttonTextCheckedHovered,
|
|
109
|
-
},
|
|
110
|
-
_b['&:active, &:hover'] = {
|
|
111
|
-
color: semanticColors.primaryButtonText,
|
|
112
|
-
backgroundColor: semanticColors.primaryButtonBackground,
|
|
113
|
-
},
|
|
114
|
-
_b["&." + classNames.tabIsSelected] = {
|
|
115
|
-
backgroundColor: semanticColors.primaryButtonBackground,
|
|
116
|
-
color: semanticColors.primaryButtonText,
|
|
117
|
-
fontWeight: FontWeights.regular,
|
|
118
|
-
selectors: (_c = {
|
|
119
|
-
':before': {
|
|
120
|
-
backgroundColor: 'transparent',
|
|
121
|
-
transition: 'none',
|
|
122
|
-
position: 'absolute',
|
|
123
|
-
top: 0,
|
|
124
|
-
left: 0,
|
|
125
|
-
right: 0,
|
|
126
|
-
bottom: 0,
|
|
127
|
-
content: '""',
|
|
128
|
-
height: 0,
|
|
129
|
-
},
|
|
130
|
-
':hover': {
|
|
131
|
-
backgroundColor: semanticColors.primaryButtonBackgroundHovered,
|
|
132
|
-
color: semanticColors.primaryButtonText,
|
|
133
|
-
},
|
|
134
|
-
'&:active': {
|
|
135
|
-
backgroundColor: semanticColors.primaryButtonBackgroundPressed,
|
|
136
|
-
color: semanticColors.primaryButtonText,
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
_c[HighContrastSelector] = __assign({ fontWeight: FontWeights.semibold, color: 'HighlightText', background: 'Highlight' }, getHighContrastNoAdjustStyle()),
|
|
140
|
-
_c),
|
|
141
|
-
},
|
|
142
|
-
_b),
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
],
|
|
146
|
-
];
|
|
147
|
-
};
|
|
148
|
-
export var getStyles = function (props) {
|
|
149
|
-
var _a, _b, _c, _d;
|
|
150
|
-
var className = props.className, tabSize = props.tabSize, tabFormat = props.tabFormat, theme = props.theme;
|
|
151
|
-
var semanticColors = theme.semanticColors, fonts = theme.fonts;
|
|
152
|
-
var classNames = getGlobalClassNames(globalClassNames, theme);
|
|
153
|
-
var rootIsLarge = tabSize === 'large';
|
|
154
|
-
var rootIsTabs = tabFormat === 'tabs';
|
|
155
|
-
return {
|
|
156
|
-
root: [
|
|
157
|
-
classNames.root,
|
|
158
|
-
fonts.medium,
|
|
159
|
-
normalize,
|
|
160
|
-
{
|
|
161
|
-
position: 'relative',
|
|
162
|
-
color: semanticColors.link,
|
|
163
|
-
whiteSpace: 'nowrap',
|
|
164
|
-
},
|
|
165
|
-
rootIsLarge && classNames.rootIsLarge,
|
|
166
|
-
rootIsTabs && classNames.rootIsTabs,
|
|
167
|
-
className,
|
|
168
|
-
],
|
|
169
|
-
itemContainer: {
|
|
170
|
-
selectors: {
|
|
171
|
-
'&[hidden]': {
|
|
172
|
-
display: 'none',
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
tab: __spreadArrays([
|
|
177
|
-
classNames.tab
|
|
178
|
-
], getLinkStyles(props, classNames), [
|
|
179
|
-
(_a = {},
|
|
180
|
-
_a["&[data-is-overflowing='true']"] = {
|
|
181
|
-
display: 'none',
|
|
182
|
-
},
|
|
183
|
-
_a),
|
|
184
|
-
]),
|
|
185
|
-
overflowMenuButton: [
|
|
186
|
-
classNames.overflowMenuButton,
|
|
187
|
-
(_b = {
|
|
188
|
-
visibility: 'hidden',
|
|
189
|
-
position: 'absolute',
|
|
190
|
-
right: 0
|
|
191
|
-
},
|
|
192
|
-
_b["." + classNames.tab + "[data-is-overflowing='true'] ~ &"] = {
|
|
193
|
-
visibility: 'visible',
|
|
194
|
-
position: 'relative',
|
|
195
|
-
},
|
|
196
|
-
_b),
|
|
197
|
-
],
|
|
198
|
-
tabInMenu: __spreadArrays([
|
|
199
|
-
classNames.tabInMenu
|
|
200
|
-
], getLinkStyles(props, classNames, true), [
|
|
201
|
-
{
|
|
202
|
-
textAlign: 'left',
|
|
203
|
-
width: '100%',
|
|
204
|
-
height: 36,
|
|
205
|
-
lineHeight: 36,
|
|
206
|
-
},
|
|
207
|
-
]),
|
|
208
|
-
tabIsSelected: [
|
|
209
|
-
classNames.tab,
|
|
210
|
-
classNames.tabIsSelected,
|
|
211
|
-
{
|
|
212
|
-
fontWeight: FontWeights.semibold,
|
|
213
|
-
selectors: (_c = {
|
|
214
|
-
':before': {
|
|
215
|
-
backgroundColor: semanticColors.inputBackgroundChecked,
|
|
216
|
-
selectors: (_d = {},
|
|
217
|
-
_d[HighContrastSelector] = {
|
|
218
|
-
backgroundColor: 'Highlight',
|
|
219
|
-
},
|
|
220
|
-
_d),
|
|
221
|
-
},
|
|
222
|
-
':hover::before': {
|
|
223
|
-
left: 0,
|
|
224
|
-
right: 0,
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
_c[HighContrastSelector] = {
|
|
228
|
-
color: 'Highlight',
|
|
229
|
-
},
|
|
230
|
-
_c),
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
tabContent: [
|
|
234
|
-
classNames.tabContent,
|
|
235
|
-
{
|
|
236
|
-
flex: '0 1 100%',
|
|
237
|
-
selectors: {
|
|
238
|
-
'& > * ': {
|
|
239
|
-
marginLeft: 4,
|
|
240
|
-
},
|
|
241
|
-
'& > *:first-child': {
|
|
242
|
-
marginLeft: 0,
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
],
|
|
247
|
-
text: [
|
|
248
|
-
classNames.text,
|
|
249
|
-
{
|
|
250
|
-
display: 'inline-block',
|
|
251
|
-
verticalAlign: 'top',
|
|
252
|
-
},
|
|
253
|
-
],
|
|
254
|
-
count: [
|
|
255
|
-
classNames.count,
|
|
256
|
-
{
|
|
257
|
-
display: 'inline-block',
|
|
258
|
-
verticalAlign: 'top',
|
|
259
|
-
},
|
|
260
|
-
],
|
|
261
|
-
icon: classNames.icon,
|
|
262
|
-
};
|
|
263
|
-
};
|
|
264
|
-
//# sourceMappingURL=Tabs.styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.styles.js","sourceRoot":"../src/","sources":["components/Tabs/Tabs.styles.ts"],"names":[],"mappings":";AACA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EAEpB,SAAS,EACT,WAAW,EACX,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,IAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;IACpB,aAAa,EAAE,aAAa;IAC5B,GAAG,EAAE,aAAa;IAClB,UAAU,EAAE,oBAAoB;IAChC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,gBAAgB;IAC7B,UAAU,EAAE,eAAe;IAC3B,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,mBAAmB;IAC9B,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7B;mCACF;yBACF;wBACD,gBAAgB,EAAE;4BAChB,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,CAAC;yBACT;;oBACD,GAAC,oBAAoB,IAAG;wBACtB,KAAK,EAAE,WAAW;qBACnB;uBACF;aACF;SACF;QACD,UAAU,EAAE;YACV,UAAU,CAAC,UAAU;YACrB;gBACE,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE;oBACT,QAAQ,EAAE;wBACR,UAAU,EAAE,CAAC;qBACd;oBACD,mBAAmB,EAAE;wBACnB,UAAU,EAAE,CAAC;qBACd;iBACF;aACF;SACF;QACD,IAAI,EAAE;YACJ,UAAU,CAAC,IAAI;YACf;gBACE,OAAO,EAAE,cAAc;gBACvB,aAAa,EAAE,KAAK;aACrB;SACF;QACD,KAAK,EAAE;YACL,UAAU,CAAC,KAAK;YAChB;gBACE,OAAO,EAAE,cAAc;gBACvB,aAAa,EAAE,KAAK;aACrB;SACF;QACD,IAAI,EAAE,UAAU,CAAC,IAAI;KACtB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { TabsStyleProps, TabsStyles } from './Tabs.types';\nimport {\n AnimationVariables,\n getGlobalClassNames,\n HighContrastSelector,\n IStyle,\n normalize,\n FontWeights,\n getHighContrastNoAdjustStyle,\n} from '@fluentui/style-utilities';\nimport { IsFocusVisibleClassName } from '@fluentui/utilities';\n\nconst globalClassNames = {\n count: 'ms-Tabs-count',\n icon: 'ms-Tabs-icon',\n tabIsSelected: 'is-selected',\n tab: 'ms-Tabs-tab',\n tabContent: 'ms-Tabs-tabContent',\n root: 'ms-Tabs',\n rootIsLarge: 'ms-Tabs--large',\n rootIsTabs: 'ms-Tabs--tabs',\n text: 'ms-Tabs-text',\n tabInMenu: 'ms-Tabs-tabInMenu',\n overflowMenuButton: 'ms-Tabs-overflowMenuButton',\n};\n\nconst getLinkStyles = (\n props: TabsStyleProps,\n classNames: { [key: string]: string },\n isLinkInOverflowMenu: boolean = false,\n): IStyle[] => {\n const { tabSize, tabFormat } = props;\n const { semanticColors, fonts } = props.theme;\n const rootIsLarge = tabSize === 'large';\n const rootIsTabs = tabFormat === 'tabs';\n\n return [\n fonts.medium,\n {\n color: semanticColors.actionLink,\n padding: '0 8px',\n position: 'relative',\n backgroundColor: 'transparent',\n border: 0,\n borderRadius: 0,\n selectors: {\n ':hover': {\n backgroundColor: semanticColors.buttonBackgroundHovered,\n color: semanticColors.buttonTextHovered,\n cursor: 'pointer',\n },\n ':active': {\n backgroundColor: semanticColors.buttonBackgroundPressed,\n color: semanticColors.buttonTextHovered,\n },\n ':focus': {\n outline: 'none',\n },\n [`.${IsFocusVisibleClassName} &:focus`]: {\n outline: `1px solid ${semanticColors.focusBorder}`,\n },\n [`.${IsFocusVisibleClassName} &:focus:after`]: {\n content: 'attr(data-content)',\n position: 'relative',\n border: 0,\n },\n },\n },\n !isLinkInOverflowMenu && [\n {\n display: 'inline-block',\n lineHeight: 44,\n height: 44,\n marginRight: 8,\n textAlign: 'center',\n selectors: {\n ':before': {\n backgroundColor: 'transparent',\n bottom: 0,\n content: '\"\"',\n height: 2,\n left: 8,\n position: 'absolute',\n right: 8,\n transition: `left ${AnimationVariables.durationValue2} ${AnimationVariables.easeFunction2},\n right ${AnimationVariables.durationValue2} ${AnimationVariables.easeFunction2}`,\n },\n ':after': {\n color: 'transparent',\n content: 'attr(data-content)',\n display: 'block',\n fontWeight: FontWeights.bold,\n height: 1,\n overflow: 'hidden',\n visibility: 'hidden',\n },\n },\n },\n rootIsLarge && {\n fontSize: fonts.large.fontSize,\n },\n rootIsTabs && [\n {\n marginRight: 0,\n height: 44,\n lineHeight: 44,\n backgroundColor: semanticColors.buttonBackground,\n padding: '0 10px',\n verticalAlign: 'top',\n\n selectors: {\n ':focus': {\n outlineOffset: '-1px',\n },\n [`.${IsFocusVisibleClassName} &:focus::before`]: {\n height: 'auto',\n background: 'transparent',\n transition: 'none',\n },\n '&:hover, &:focus': {\n color: semanticColors.buttonTextCheckedHovered,\n },\n '&:active, &:hover': {\n color: semanticColors.primaryButtonText,\n backgroundColor: semanticColors.primaryButtonBackground,\n },\n [`&.${classNames.tabIsSelected}`]: {\n backgroundColor: semanticColors.primaryButtonBackground,\n color: semanticColors.primaryButtonText,\n fontWeight: FontWeights.regular,\n selectors: {\n ':before': {\n backgroundColor: 'transparent',\n transition: 'none',\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n content: '\"\"',\n height: 0,\n },\n ':hover': {\n backgroundColor: semanticColors.primaryButtonBackgroundHovered,\n color: semanticColors.primaryButtonText,\n },\n '&:active': {\n backgroundColor: semanticColors.primaryButtonBackgroundPressed,\n color: semanticColors.primaryButtonText,\n },\n [HighContrastSelector]: {\n fontWeight: FontWeights.semibold,\n color: 'HighlightText',\n background: 'Highlight',\n ...getHighContrastNoAdjustStyle(),\n },\n },\n },\n },\n },\n ],\n ],\n ];\n};\n\nexport const getStyles = (props: TabsStyleProps): TabsStyles => {\n const { className, tabSize, tabFormat, theme } = props;\n const { semanticColors, fonts } = theme;\n\n const classNames = getGlobalClassNames(globalClassNames, theme);\n\n const rootIsLarge = tabSize === 'large';\n const rootIsTabs = tabFormat === 'tabs';\n\n return {\n root: [\n classNames.root,\n fonts.medium,\n normalize,\n {\n position: 'relative',\n color: semanticColors.link,\n whiteSpace: 'nowrap',\n },\n rootIsLarge && classNames.rootIsLarge,\n rootIsTabs && classNames.rootIsTabs,\n className,\n ],\n itemContainer: {\n selectors: {\n '&[hidden]': {\n display: 'none',\n },\n },\n },\n tab: [\n classNames.tab,\n ...getLinkStyles(props, classNames),\n {\n [`&[data-is-overflowing='true']`]: {\n display: 'none',\n },\n },\n ],\n overflowMenuButton: [\n classNames.overflowMenuButton,\n {\n visibility: 'hidden',\n position: 'absolute',\n right: 0,\n [`.${classNames.tab}[data-is-overflowing='true'] ~ &`]: {\n visibility: 'visible',\n position: 'relative',\n },\n },\n ],\n tabInMenu: [\n classNames.tabInMenu,\n ...getLinkStyles(props, classNames, true),\n {\n textAlign: 'left',\n width: '100%',\n height: 36,\n lineHeight: 36,\n },\n ],\n tabIsSelected: [\n classNames.tab,\n classNames.tabIsSelected,\n {\n fontWeight: FontWeights.semibold,\n selectors: {\n ':before': {\n backgroundColor: semanticColors.inputBackgroundChecked,\n selectors: {\n [HighContrastSelector]: {\n backgroundColor: 'Highlight',\n },\n },\n },\n ':hover::before': {\n left: 0,\n right: 0,\n },\n [HighContrastSelector]: {\n color: 'Highlight',\n },\n },\n },\n ],\n tabContent: [\n classNames.tabContent,\n {\n flex: '0 1 100%',\n selectors: {\n '& > * ': {\n marginLeft: 4,\n },\n '& > *:first-child': {\n marginLeft: 0,\n },\n },\n },\n ],\n text: [\n classNames.text,\n {\n display: 'inline-block',\n verticalAlign: 'top',\n },\n ],\n count: [\n classNames.count,\n {\n display: 'inline-block',\n verticalAlign: 'top',\n },\n ],\n icon: classNames.icon,\n };\n};\n"]}
|
|
@@ -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC","sourcesContent":["export * from './Tabs';\nexport * from './Tabs.base';\nexport { TabItem } from './TabItem';\nexport * from './Tabs.types';\nexport * from './TabItem.types';\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,46 +0,0 @@
|
|
|
1
|
-
import { getWindow } from '@fluentui/utilities';
|
|
2
|
-
/**
|
|
3
|
-
* Wrapper for ResizeObserver, with fallback for browsers that don't support ResizeObserver.
|
|
4
|
-
*
|
|
5
|
-
* Calls the onResize callback once layout is complete, and again whenever any of the target(s) change size.
|
|
6
|
-
* Or if ResizeObserver isn't supported, calls the callback whenever the window changes size.
|
|
7
|
-
*
|
|
8
|
-
* @param target - Either a single element, or array of elements to watch for size changes.
|
|
9
|
-
* @param onResize - Callback to be notified when layout is complete, and when the target(s) change size.
|
|
10
|
-
* If this browser supports ResizeObserver, the callback will be passed the ResizeObserverEntry[] array.
|
|
11
|
-
* Otherwise, the entries array will be undefined, and you'll need to find another way to get the element's size,
|
|
12
|
-
* (e.g. clientWidth/clientHeight or getBoundingClientRect).
|
|
13
|
-
*
|
|
14
|
-
* @returns A function to clean up the observer/listener.
|
|
15
|
-
*/
|
|
16
|
-
export var observeResize = function (target, onResize) {
|
|
17
|
-
if (typeof ResizeObserver !== 'undefined') {
|
|
18
|
-
var observer_1 = new ResizeObserver(onResize);
|
|
19
|
-
if (Array.isArray(target)) {
|
|
20
|
-
target.forEach(function (t) { return observer_1.observe(t); });
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
observer_1.observe(target);
|
|
24
|
-
}
|
|
25
|
-
return function () { return observer_1.disconnect(); };
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
// Fallback for browsers that don't support ResizeObserver
|
|
29
|
-
var onResizeWrapper_1 = function () { return onResize(undefined); };
|
|
30
|
-
var win_1 = getWindow(Array.isArray(target) ? target[0] : target);
|
|
31
|
-
if (!win_1) {
|
|
32
|
-
// Can't listen for resize if we can't get the window object
|
|
33
|
-
return function () {
|
|
34
|
-
// Nothing to clean up
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
// Listen for the first animation frame, which will happen after layout is complete
|
|
38
|
-
var animationFrameId_1 = win_1.requestAnimationFrame(onResizeWrapper_1);
|
|
39
|
-
win_1.addEventListener('resize', onResizeWrapper_1, false);
|
|
40
|
-
return function () {
|
|
41
|
-
win_1.cancelAnimationFrame(animationFrameId_1);
|
|
42
|
-
win_1.removeEventListener('resize', onResizeWrapper_1, false);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=observeResize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observeResize.js","sourceRoot":"../src/","sources":["utilities/observeResize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,IAAM,aAAa,GAAG,UAC3B,MAA2B,EAC3B,QAAuE;IAEvE,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;QACzC,IAAM,UAAQ,GAAG,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE9C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACzB,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,UAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAnB,CAAmB,CAAC,CAAC;SAC1C;aAAM;YACL,UAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SAC1B;QAED,OAAO,cAAM,OAAA,UAAQ,CAAC,UAAU,EAAE,EAArB,CAAqB,CAAC;KACpC;SAAM;QACL,0DAA0D;QAC1D,IAAM,iBAAe,GAAG,cAAM,OAAA,QAAQ,CAAC,SAAS,CAAC,EAAnB,CAAmB,CAAC;QAElD,IAAM,KAAG,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAClE,IAAI,CAAC,KAAG,EAAE;YACR,4DAA4D;YAC5D,OAAO;gBACL,sBAAsB;YACxB,CAAC,CAAC;SACH;QAED,mFAAmF;QACnF,IAAM,kBAAgB,GAAG,KAAG,CAAC,qBAAqB,CAAC,iBAAe,CAAC,CAAC;QACpE,KAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,iBAAe,EAAE,KAAK,CAAC,CAAC;QAEvD,OAAO;YACL,KAAG,CAAC,oBAAoB,CAAC,kBAAgB,CAAC,CAAC;YAC3C,KAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,iBAAe,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC,CAAC;KACH;AACH,CAAC,CAAC","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;
|