@fluentui/react-tabs 1.0.0-beta.17 → 1.0.0-beta.173
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 +3135 -0
- package/CHANGELOG.md +1338 -1
- package/config/tests.js +0 -4
- package/dist/react-tabs.d.ts +68 -122
- package/etc/react-tabs.api.md +47 -64
- package/lib/{next/Tabs.d.ts → Tabs.d.ts} +0 -0
- package/lib/{next/Tabs.js → Tabs.js} +0 -0
- package/lib/Tabs.js.map +1 -0
- package/lib/common/isConformant.d.ts +4 -2
- package/lib/common/isConformant.js.map +1 -1
- package/{lib-commonjs/next → lib}/components/Tabs/TabItem.d.ts +1 -1
- package/lib/{next/components → components}/Tabs/TabItem.js +0 -0
- package/lib/components/Tabs/TabItem.js.map +1 -0
- package/{lib-commonjs/next → lib}/components/Tabs/TabItem.types.d.ts +3 -6
- package/lib/components/Tabs/TabItem.types.js +2 -0
- package/lib/components/Tabs/TabItem.types.js.map +1 -0
- package/{lib-amd/next → lib}/components/Tabs/Tabs.base.d.ts +1 -1
- package/lib/{next/components → components}/Tabs/Tabs.base.js +5 -5
- package/lib/components/Tabs/Tabs.base.js.map +1 -0
- package/{lib-commonjs/next → lib}/components/Tabs/Tabs.d.ts +1 -1
- package/lib/{next/components → components}/Tabs/Tabs.js +0 -0
- package/lib/components/Tabs/Tabs.js.map +1 -0
- package/lib/{next/components → components}/Tabs/Tabs.styles.d.ts +1 -1
- package/lib/{next/components → components}/Tabs/Tabs.styles.js +3 -8
- package/lib/components/Tabs/Tabs.styles.js.map +1 -0
- package/{lib-amd/next → lib}/components/Tabs/Tabs.types.d.ts +2 -16
- package/lib/components/Tabs/Tabs.types.js +2 -0
- package/lib/components/Tabs/Tabs.types.js.map +1 -0
- package/lib/{next/components → components}/Tabs/index.d.ts +0 -0
- package/lib/components/Tabs/index.js +6 -0
- package/lib/components/Tabs/index.js.map +1 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/utilities/observeResize.d.ts +1 -1
- package/lib/utilities/useOverflow.d.ts +1 -1
- package/lib/utilities/useOverflow.js +1 -0
- package/lib/utilities/useOverflow.js.map +1 -1
- package/lib-amd/{next/Tabs.d.ts → Tabs.d.ts} +0 -0
- package/lib-amd/{next/Tabs.js → Tabs.js} +0 -0
- package/lib-amd/Tabs.js.map +1 -0
- package/lib-amd/common/isConformant.d.ts +4 -2
- package/lib-amd/common/isConformant.js +1 -0
- package/lib-amd/common/isConformant.js.map +1 -1
- package/{lib/next → lib-amd}/components/Tabs/TabItem.d.ts +1 -1
- package/lib-amd/{next/components → components}/Tabs/TabItem.js +1 -0
- package/lib-amd/components/Tabs/TabItem.js.map +1 -0
- package/{lib/next → lib-amd}/components/Tabs/TabItem.types.d.ts +3 -6
- package/lib-amd/{next/components → components}/Tabs/TabItem.types.js +0 -0
- package/lib-amd/components/Tabs/TabItem.types.js.map +1 -0
- package/{lib/next → lib-amd}/components/Tabs/Tabs.base.d.ts +1 -1
- package/lib-amd/{next/components → components}/Tabs/Tabs.base.js +7 -6
- package/lib-amd/components/Tabs/Tabs.base.js.map +1 -0
- package/{lib/next → lib-amd}/components/Tabs/Tabs.d.ts +1 -1
- package/lib-amd/{next/components → components}/Tabs/Tabs.js +1 -0
- package/lib-amd/components/Tabs/Tabs.js.map +1 -0
- package/lib-amd/{next/components → components}/Tabs/Tabs.styles.d.ts +1 -1
- package/lib-amd/{next/components → components}/Tabs/Tabs.styles.js +4 -7
- package/lib-amd/components/Tabs/Tabs.styles.js.map +1 -0
- package/{lib/next → lib-amd}/components/Tabs/Tabs.types.d.ts +2 -16
- package/lib-amd/{next/components → components}/Tabs/Tabs.types.js +0 -0
- package/lib-amd/components/Tabs/Tabs.types.js.map +1 -0
- package/lib-amd/{next/components → components}/Tabs/index.d.ts +0 -0
- package/lib-amd/components/Tabs/index.js +11 -0
- package/lib-amd/components/Tabs/index.js.map +1 -0
- package/lib-amd/index.d.ts +1 -3
- package/lib-amd/index.js +2 -3
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/utilities/observeResize.d.ts +1 -1
- package/lib-amd/utilities/observeResize.js +3 -1
- package/lib-amd/utilities/observeResize.js.map +1 -1
- package/lib-amd/utilities/useOverflow.d.ts +1 -1
- package/lib-amd/utilities/useOverflow.js +4 -1
- package/lib-amd/utilities/useOverflow.js.map +1 -1
- package/lib-commonjs/{next/Tabs.d.ts → Tabs.d.ts} +0 -0
- package/lib-commonjs/{next/Tabs.js → Tabs.js} +0 -0
- package/lib-commonjs/Tabs.js.map +1 -0
- package/lib-commonjs/common/isConformant.d.ts +4 -2
- package/lib-commonjs/common/isConformant.js +1 -0
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/{lib-amd/next → lib-commonjs}/components/Tabs/TabItem.d.ts +1 -1
- package/lib-commonjs/{next/components → components}/Tabs/TabItem.js +1 -0
- package/lib-commonjs/components/Tabs/TabItem.js.map +1 -0
- package/{lib-amd/next → lib-commonjs}/components/Tabs/TabItem.types.d.ts +3 -6
- package/lib-commonjs/{next/components → components}/Tabs/TabItem.types.js +0 -0
- package/lib-commonjs/components/Tabs/TabItem.types.js.map +1 -0
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.base.d.ts +1 -1
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.base.js +9 -8
- package/lib-commonjs/components/Tabs/Tabs.base.js.map +1 -0
- package/{lib-amd/next → lib-commonjs}/components/Tabs/Tabs.d.ts +1 -1
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.js +1 -0
- package/lib-commonjs/components/Tabs/Tabs.js.map +1 -0
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.styles.d.ts +1 -1
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.styles.js +4 -7
- package/lib-commonjs/components/Tabs/Tabs.styles.js.map +1 -0
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.types.d.ts +2 -16
- package/lib-commonjs/{next/components → components}/Tabs/Tabs.types.js +0 -0
- package/lib-commonjs/components/Tabs/Tabs.types.js.map +1 -0
- package/lib-commonjs/{next/components → components}/Tabs/index.d.ts +0 -0
- package/lib-commonjs/components/Tabs/index.js +11 -0
- package/lib-commonjs/components/Tabs/index.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -3
- package/lib-commonjs/index.js +1 -3
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/observeResize.d.ts +1 -1
- package/lib-commonjs/utilities/observeResize.js +3 -1
- package/lib-commonjs/utilities/observeResize.js.map +1 -1
- package/lib-commonjs/utilities/useOverflow.d.ts +1 -1
- package/lib-commonjs/utilities/useOverflow.js +4 -1
- package/lib-commonjs/utilities/useOverflow.js.map +1 -1
- package/package.json +24 -26
- package/src/{next/components → components}/Tabs/TabItem.types.ts +3 -6
- package/src/{next/components → components}/Tabs/Tabs.types.ts +2 -16
- package/lib/Pivot.d.ts +0 -1
- package/lib/Pivot.js +0 -2
- package/lib/Pivot.js.map +0 -1
- package/lib/components/Pivot/Pivot.base.d.ts +0 -3
- package/lib/components/Pivot/Pivot.base.js +0 -183
- package/lib/components/Pivot/Pivot.base.js.map +0 -1
- package/lib/components/Pivot/Pivot.d.ts +0 -8
- package/lib/components/Pivot/Pivot.js +0 -12
- package/lib/components/Pivot/Pivot.js.map +0 -1
- package/lib/components/Pivot/Pivot.styles.d.ts +0 -2
- package/lib/components/Pivot/Pivot.styles.js +0 -269
- package/lib/components/Pivot/Pivot.styles.js.map +0 -1
- package/lib/components/Pivot/Pivot.types.d.ts +0 -141
- package/lib/components/Pivot/Pivot.types.js +0 -31
- package/lib/components/Pivot/Pivot.types.js.map +0 -1
- package/lib/components/Pivot/PivotItem.d.ts +0 -6
- package/lib/components/Pivot/PivotItem.js +0 -21
- package/lib/components/Pivot/PivotItem.js.map +0 -1
- package/lib/components/Pivot/PivotItem.types.d.ts +0 -66
- package/lib/components/Pivot/PivotItem.types.js +0 -1
- package/lib/components/Pivot/PivotItem.types.js.map +0 -1
- package/lib/components/Pivot/index.d.ts +0 -5
- package/lib/components/Pivot/index.js +0 -5
- package/lib/components/Pivot/index.js.map +0 -1
- package/lib/next/Tabs.js.map +0 -1
- package/lib/next/components/Tabs/TabItem.js.map +0 -1
- package/lib/next/components/Tabs/TabItem.types.js +0 -1
- package/lib/next/components/Tabs/TabItem.types.js.map +0 -1
- package/lib/next/components/Tabs/Tabs.base.js.map +0 -1
- package/lib/next/components/Tabs/Tabs.js.map +0 -1
- package/lib/next/components/Tabs/Tabs.styles.js.map +0 -1
- package/lib/next/components/Tabs/Tabs.types.js +0 -1
- package/lib/next/components/Tabs/Tabs.types.js.map +0 -1
- package/lib/next/components/Tabs/index.js +0 -4
- package/lib/next/components/Tabs/index.js.map +0 -1
- package/lib/next/index.d.ts +0 -2
- package/lib/next/index.js +0 -3
- package/lib/next/index.js.map +0 -1
- package/lib/next.d.ts +0 -1
- package/lib/next.js +0 -2
- package/lib/next.js.map +0 -1
- package/lib/version.d.ts +0 -1
- package/lib/version.js +0 -5
- package/lib/version.js.map +0 -1
- package/lib-amd/Pivot.d.ts +0 -1
- package/lib-amd/Pivot.js +0 -6
- package/lib-amd/Pivot.js.map +0 -1
- package/lib-amd/components/Pivot/Pivot.base.d.ts +0 -3
- package/lib-amd/components/Pivot/Pivot.base.js +0 -179
- package/lib-amd/components/Pivot/Pivot.base.js.map +0 -1
- package/lib-amd/components/Pivot/Pivot.d.ts +0 -8
- package/lib-amd/components/Pivot/Pivot.js +0 -13
- package/lib-amd/components/Pivot/Pivot.js.map +0 -1
- package/lib-amd/components/Pivot/Pivot.styles.d.ts +0 -2
- package/lib-amd/components/Pivot/Pivot.styles.js +0 -270
- package/lib-amd/components/Pivot/Pivot.styles.js.map +0 -1
- package/lib-amd/components/Pivot/Pivot.types.d.ts +0 -141
- package/lib-amd/components/Pivot/Pivot.types.js +0 -35
- package/lib-amd/components/Pivot/Pivot.types.js.map +0 -1
- package/lib-amd/components/Pivot/PivotItem.d.ts +0 -6
- package/lib-amd/components/Pivot/PivotItem.js +0 -22
- package/lib-amd/components/Pivot/PivotItem.js.map +0 -1
- package/lib-amd/components/Pivot/PivotItem.types.d.ts +0 -66
- package/lib-amd/components/Pivot/PivotItem.types.js +0 -5
- package/lib-amd/components/Pivot/PivotItem.types.js.map +0 -1
- package/lib-amd/components/Pivot/index.d.ts +0 -5
- package/lib-amd/components/Pivot/index.js +0 -9
- package/lib-amd/components/Pivot/index.js.map +0 -1
- package/lib-amd/next/Tabs.js.map +0 -1
- package/lib-amd/next/components/Tabs/TabItem.js.map +0 -1
- package/lib-amd/next/components/Tabs/TabItem.types.js.map +0 -1
- package/lib-amd/next/components/Tabs/Tabs.base.js.map +0 -1
- package/lib-amd/next/components/Tabs/Tabs.js.map +0 -1
- package/lib-amd/next/components/Tabs/Tabs.styles.js.map +0 -1
- package/lib-amd/next/components/Tabs/Tabs.types.js.map +0 -1
- package/lib-amd/next/components/Tabs/index.js +0 -8
- package/lib-amd/next/components/Tabs/index.js.map +0 -1
- package/lib-amd/next/index.d.ts +0 -2
- package/lib-amd/next/index.js +0 -7
- package/lib-amd/next/index.js.map +0 -1
- package/lib-amd/next.d.ts +0 -1
- package/lib-amd/next.js +0 -6
- package/lib-amd/next.js.map +0 -1
- package/lib-amd/version.d.ts +0 -1
- package/lib-amd/version.js +0 -6
- package/lib-amd/version.js.map +0 -1
- package/lib-commonjs/Pivot.d.ts +0 -1
- package/lib-commonjs/Pivot.js +0 -5
- package/lib-commonjs/Pivot.js.map +0 -1
- package/lib-commonjs/components/Pivot/Pivot.base.d.ts +0 -3
- package/lib-commonjs/components/Pivot/Pivot.base.js +0 -185
- package/lib-commonjs/components/Pivot/Pivot.base.js.map +0 -1
- package/lib-commonjs/components/Pivot/Pivot.d.ts +0 -8
- package/lib-commonjs/components/Pivot/Pivot.js +0 -14
- package/lib-commonjs/components/Pivot/Pivot.js.map +0 -1
- package/lib-commonjs/components/Pivot/Pivot.styles.d.ts +0 -2
- package/lib-commonjs/components/Pivot/Pivot.styles.js +0 -271
- package/lib-commonjs/components/Pivot/Pivot.styles.js.map +0 -1
- package/lib-commonjs/components/Pivot/Pivot.types.d.ts +0 -141
- package/lib-commonjs/components/Pivot/Pivot.types.js +0 -33
- package/lib-commonjs/components/Pivot/Pivot.types.js.map +0 -1
- package/lib-commonjs/components/Pivot/PivotItem.d.ts +0 -6
- package/lib-commonjs/components/Pivot/PivotItem.js +0 -23
- package/lib-commonjs/components/Pivot/PivotItem.js.map +0 -1
- package/lib-commonjs/components/Pivot/PivotItem.types.d.ts +0 -66
- package/lib-commonjs/components/Pivot/PivotItem.types.js +0 -3
- package/lib-commonjs/components/Pivot/PivotItem.types.js.map +0 -1
- package/lib-commonjs/components/Pivot/index.d.ts +0 -5
- package/lib-commonjs/components/Pivot/index.js +0 -9
- package/lib-commonjs/components/Pivot/index.js.map +0 -1
- package/lib-commonjs/next/Tabs.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/TabItem.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/TabItem.types.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/Tabs.base.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/Tabs.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/Tabs.styles.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/Tabs.types.js.map +0 -1
- package/lib-commonjs/next/components/Tabs/index.js +0 -8
- package/lib-commonjs/next/components/Tabs/index.js.map +0 -1
- package/lib-commonjs/next/index.d.ts +0 -2
- package/lib-commonjs/next/index.js +0 -6
- package/lib-commonjs/next/index.js.map +0 -1
- package/lib-commonjs/next.d.ts +0 -1
- package/lib-commonjs/next.js +0 -5
- package/lib-commonjs/next.js.map +0 -1
- package/lib-commonjs/version.d.ts +0 -1
- package/lib-commonjs/version.js +0 -7
- package/lib-commonjs/version.js.map +0 -1
- package/src/components/Pivot/Pivot.types.ts +0 -166
- package/src/components/Pivot/PivotItem.types.ts +0 -76
|
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,GAChE,CACH,CACS;YACX,mBAAmB;gBAClB,aAAa,CAAC,IAAI,CAAC,GAAG,CACpB,UAAA,GAAG;oBACD,OAAA,CAAC,GAAG,CAAC,YAAY,KAAK,IAAI,IAAI,mBAAmB,KAAK,GAAG,CAAC,OAAO,CAAC;wBAClE,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,KAAK,GAAG,CAAC,OAAO,CAAC;gBAD/D,CAC+D,CAClE,CACC,CACP,CAAC;IACJ,CAAC,CACF,CAAC;IACF,gBAAQ,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-internal';\nimport { CommandButton, IButton } from '@fluentui/react-internal/lib/compat/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\"\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 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 doNotLayer: true,\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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"../src/","sources":["next/components/Tabs/Tabs.tsx"],"names":[],"mappings":";;;IAMA;;;;OAIG;IACU,QAAA,IAAI,GAAuC,kBAAM,CAC5D,oBAAQ,EACR,uBAAS,EACT,SAAS,EACT;QACE,KAAK,EAAE,MAAM;KACd,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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.styles.js","sourceRoot":"../src/","sources":["next/components/Tabs/Tabs.styles.ts"],"names":[],"mappings":";;;IAWA,IAAM,gBAAgB,GAAG;QACvB,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,cAAc;QACpB,aAAa,EAAE,aAAa;QAC5B,GAAG,EAAE,aAAa;QAClB,UAAU,EAAE,oBAAo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EAAE,WAAW;qCAC7B;uCACF;6BACF;4BACD,gBAAgB,EAAE;gCAChB,IAAI,EAAE,CAAC;gCACP,KAAK,EAAE,CAAC;6BACT;;wBACD,GAAC,sCAAoB,IAAG;4BACtB,KAAK,EAAE,WAAW;yBACnB;2BACF;iBACF;aACF;YACD,UAAU,EAAE;gBACV,UAAU,CAAC,UAAU;gBACrB;oBACE,IAAI,EAAE,UAAU;oBAChB,SAAS,EAAE;wBACT,QAAQ,EAAE;4BACR,UAAU,EAAE,CAAC;yBACd;wBACD,mBAAmB,EAAE;4BACnB,UAAU,EAAE,CAAC;yBACd;qBACF;iBACF;aACF;YACD,IAAI,EAAE;gBACJ,UAAU,CAAC,IAAI;gBACf;oBACE,OAAO,EAAE,cAAc;oBACvB,aAAa,EAAE,KAAK;iBACrB;aACF;YACD,KAAK,EAAE;gBACL,UAAU,CAAC,KAAK;gBAChB;oBACE,OAAO,EAAE,cAAc;oBACvB,aAAa,EAAE,KAAK;iBACrB;aACF;YACD,IAAI,EAAE,UAAU,CAAC,IAAI;SACtB,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import { TabsStyleProps, TabsStyles } from './Tabs.types';\nimport {\n AnimationVariables,\n getGlobalClassNames,\n HighContrastSelector,\n IStyle,\n normalize,\n FontWeights,\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 MsHighContrastAdjust: 'none',\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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.types.js","sourceRoot":"../src/","sources":["next/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,8 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./Tabs", "./Tabs.base", "./TabItem"], function (require, exports, tslib_1, Tabs_1, Tabs_base_1, TabItem_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(Tabs_1, exports);
|
|
5
|
-
tslib_1.__exportStar(Tabs_base_1, exports);
|
|
6
|
-
exports.TabItem = TabItem_1.TabItem;
|
|
7
|
-
});
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["next/components/Tabs/index.ts"],"names":[],"mappings":";;;IAAA,sCAAuB;IACvB,2CAA4B;IACnB,4BAAA,OAAO,CAAA","sourcesContent":["export * from './Tabs';\nexport * from './Tabs.base';\nexport { TabItem } from './TabItem';\nexport * from './Tabs.types';\nexport * from './TabItem.types';\n"]}
|
package/lib-amd/next/index.d.ts
DELETED
package/lib-amd/next/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "../index", "./Tabs"], function (require, exports, tslib_1, index_1, Tabs_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
|
5
|
-
tslib_1.__exportStar(Tabs_1, exports);
|
|
6
|
-
});
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["next/index.ts"],"names":[],"mappings":";;;IAAA,uCAAyB;IACzB,sCAAuB","sourcesContent":["export * from '../index';\nexport * from './Tabs';\n"]}
|
package/lib-amd/next.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './next/index';
|
package/lib-amd/next.js
DELETED
package/lib-amd/next.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"../src/","sources":["next.ts"],"names":[],"mappings":";;;IAAA,uCAA6B","sourcesContent":["export * from './next/index';\n"]}
|
package/lib-amd/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib-amd/version.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/set-version"], function (require, exports, set_version_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
set_version_1.setVersion('@fluentui/react-tabs', '1.0.0-beta.17');
|
|
5
|
-
});
|
|
6
|
-
//# sourceMappingURL=version.js.map
|
package/lib-amd/version.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"../src/","sources":["version.ts"],"names":[],"mappings":";;;IAGA,wBAAU,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Do not modify this file; it is generated as part of publish.\n// The checked in version is a placeholder only and will not be updated.\nimport { setVersion } from '@fluentui/set-version';\nsetVersion('@fluentui/react-tabs', '1.0.0-beta.17');"]}
|
package/lib-commonjs/Pivot.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Pivot/index';
|
package/lib-commonjs/Pivot.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pivot.js","sourceRoot":"../src/","sources":["Pivot.ts"],"names":[],"mappings":";;;AAAA,mEAAyC","sourcesContent":["export * from './components/Pivot/index';\n"]}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
|
-
var React = require("react");
|
|
5
|
-
var react_hooks_1 = require("@fluentui/react-hooks");
|
|
6
|
-
var utilities_1 = require("@fluentui/utilities");
|
|
7
|
-
var react_internal_1 = require("@fluentui/react-internal");
|
|
8
|
-
var Button_1 = require("@fluentui/react-internal/lib-commonjs/compat/Button");
|
|
9
|
-
var index_1 = require("./index");
|
|
10
|
-
var useOverflow_1 = require("../../utilities/useOverflow");
|
|
11
|
-
var getClassNames = utilities_1.classNamesFunction();
|
|
12
|
-
var COMPONENT_NAME = 'Pivot';
|
|
13
|
-
var getTabId = function (props, pivotId, itemKey, index) {
|
|
14
|
-
if (props.getTabId) {
|
|
15
|
-
return props.getTabId(itemKey, index);
|
|
16
|
-
}
|
|
17
|
-
return pivotId + ("-Tab" + index);
|
|
18
|
-
};
|
|
19
|
-
// Gets the set of PivotLinks as array of IPivotItemProps
|
|
20
|
-
// The set of Links is determined by child components of type PivotItem
|
|
21
|
-
var getLinkItems = function (props, pivotId) {
|
|
22
|
-
var result = {
|
|
23
|
-
links: [],
|
|
24
|
-
keyToIndexMapping: {},
|
|
25
|
-
keyToTabIdMapping: {},
|
|
26
|
-
};
|
|
27
|
-
React.Children.forEach(React.Children.toArray(props.children), function (child, index) {
|
|
28
|
-
if (isPivotItem(child)) {
|
|
29
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
30
|
-
var _a = child.props, linkText = _a.linkText, pivotItemProps = tslib_1.__rest(_a, ["linkText"]);
|
|
31
|
-
var itemKey = child.props.itemKey || index.toString();
|
|
32
|
-
result.links.push(tslib_1.__assign(tslib_1.__assign({ headerText: linkText }, pivotItemProps), { itemKey: itemKey }));
|
|
33
|
-
result.keyToIndexMapping[itemKey] = index;
|
|
34
|
-
result.keyToTabIdMapping[itemKey] = getTabId(props, pivotId, itemKey, index);
|
|
35
|
-
}
|
|
36
|
-
else if (child) {
|
|
37
|
-
utilities_1.warn('The children of a Pivot component must be of type PivotItem to be rendered.');
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return result;
|
|
41
|
-
};
|
|
42
|
-
var isPivotItem = function (item) {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
return ((_b = (_a = item) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.name) === index_1.PivotItem.name;
|
|
45
|
-
};
|
|
46
|
-
exports.PivotBase = React.forwardRef(function (props, ref) {
|
|
47
|
-
var focusZoneRef = React.useRef(null);
|
|
48
|
-
var overflowMenuButtonComponentRef = React.useRef(null);
|
|
49
|
-
var pivotId = react_hooks_1.useId('Pivot');
|
|
50
|
-
var _a = react_hooks_1.useControllableValue(props.selectedKey, props.defaultSelectedKey), selectedKey = _a[0], setSelectedKey = _a[1];
|
|
51
|
-
var componentRef = props.componentRef, theme = props.theme, linkSize = props.linkSize, linkFormat = props.linkFormat, overflowBehavior = props.overflowBehavior;
|
|
52
|
-
var classNames;
|
|
53
|
-
var divProps = utilities_1.getNativeProps(props, utilities_1.divProperties);
|
|
54
|
-
var linkCollection = getLinkItems(props, pivotId);
|
|
55
|
-
React.useImperativeHandle(componentRef, function () { return ({
|
|
56
|
-
focus: function () {
|
|
57
|
-
var _a;
|
|
58
|
-
(_a = focusZoneRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
59
|
-
},
|
|
60
|
-
}); });
|
|
61
|
-
var renderLinkContent = function (link) {
|
|
62
|
-
if (!link) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
var itemCount = link.itemCount, itemIcon = link.itemIcon, headerText = link.headerText;
|
|
66
|
-
return (React.createElement("span", { className: classNames.linkContent },
|
|
67
|
-
itemIcon !== undefined && (React.createElement("span", { className: classNames.icon },
|
|
68
|
-
React.createElement(react_internal_1.Icon, { iconName: itemIcon }))),
|
|
69
|
-
headerText !== undefined && React.createElement("span", { className: classNames.text },
|
|
70
|
-
" ",
|
|
71
|
-
link.headerText),
|
|
72
|
-
itemCount !== undefined && React.createElement("span", { className: classNames.count },
|
|
73
|
-
" (",
|
|
74
|
-
itemCount,
|
|
75
|
-
")")));
|
|
76
|
-
};
|
|
77
|
-
var renderPivotLink = function (renderLinkCollection, link, renderPivotLinkSelectedKey, className) {
|
|
78
|
-
var itemKey = link.itemKey, headerButtonProps = link.headerButtonProps, onRenderItemLink = link.onRenderItemLink;
|
|
79
|
-
var tabId = renderLinkCollection.keyToTabIdMapping[itemKey];
|
|
80
|
-
var linkContent;
|
|
81
|
-
var isSelected = renderPivotLinkSelectedKey === itemKey;
|
|
82
|
-
if (onRenderItemLink) {
|
|
83
|
-
linkContent = onRenderItemLink(link, renderLinkContent);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
linkContent = renderLinkContent(link);
|
|
87
|
-
}
|
|
88
|
-
var contentString = link.headerText || '';
|
|
89
|
-
contentString += link.itemCount ? ' (' + link.itemCount + ')' : '';
|
|
90
|
-
// Adding space supplementary for icon
|
|
91
|
-
contentString += link.itemIcon ? ' xx' : '';
|
|
92
|
-
return (React.createElement(Button_1.CommandButton, tslib_1.__assign({}, headerButtonProps, { id: tabId, key: itemKey, className: utilities_1.css(className, isSelected && classNames.linkIsSelected),
|
|
93
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
94
|
-
onClick: function (ev) { return onLinkClick(itemKey, ev); },
|
|
95
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
96
|
-
onKeyDown: function (ev) { return onKeyDown(itemKey, ev); }, "aria-label": link.ariaLabel, role: "tab", "aria-selected": isSelected, name: link.headerText, keytipProps: link.keytipProps, "data-content": contentString }), linkContent));
|
|
97
|
-
};
|
|
98
|
-
var onLinkClick = function (itemKey, ev) {
|
|
99
|
-
ev.preventDefault();
|
|
100
|
-
updateSelectedItem(itemKey, ev);
|
|
101
|
-
};
|
|
102
|
-
var onKeyDown = function (itemKey, ev) {
|
|
103
|
-
if (ev.which === utilities_1.KeyCodes.enter) {
|
|
104
|
-
ev.preventDefault();
|
|
105
|
-
updateSelectedItem(itemKey);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
var updateSelectedItem = function (itemKey, ev) {
|
|
109
|
-
var _a;
|
|
110
|
-
setSelectedKey(itemKey);
|
|
111
|
-
linkCollection = getLinkItems(props, pivotId);
|
|
112
|
-
if (props.onLinkClick && linkCollection.keyToIndexMapping[itemKey] >= 0) {
|
|
113
|
-
var selectedIndex = linkCollection.keyToIndexMapping[itemKey];
|
|
114
|
-
var item = React.Children.toArray(props.children)[selectedIndex];
|
|
115
|
-
if (isPivotItem(item)) {
|
|
116
|
-
props.onLinkClick(item, ev);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
(_a = overflowMenuButtonComponentRef.current) === null || _a === void 0 ? void 0 : _a.dismissMenu();
|
|
120
|
-
};
|
|
121
|
-
var renderPivotItem = function (itemKey, isActive) {
|
|
122
|
-
if (props.headersOnly || !itemKey) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
var index = linkCollection.keyToIndexMapping[itemKey];
|
|
126
|
-
var selectedTabId = linkCollection.keyToTabIdMapping[itemKey];
|
|
127
|
-
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]));
|
|
128
|
-
};
|
|
129
|
-
var isKeyValid = function (itemKey) {
|
|
130
|
-
return itemKey !== undefined && itemKey !== null && linkCollection.keyToIndexMapping[itemKey] !== undefined;
|
|
131
|
-
};
|
|
132
|
-
var getSelectedKey = function () {
|
|
133
|
-
if (isKeyValid(selectedKey)) {
|
|
134
|
-
return selectedKey;
|
|
135
|
-
}
|
|
136
|
-
if (linkCollection.links.length) {
|
|
137
|
-
return linkCollection.links[0].itemKey;
|
|
138
|
-
}
|
|
139
|
-
return undefined;
|
|
140
|
-
};
|
|
141
|
-
classNames = getClassNames(props.styles, {
|
|
142
|
-
theme: theme,
|
|
143
|
-
linkSize: linkSize,
|
|
144
|
-
linkFormat: linkFormat,
|
|
145
|
-
});
|
|
146
|
-
var renderedSelectedKey = getSelectedKey();
|
|
147
|
-
var renderedSelectedIndex = renderedSelectedKey ? linkCollection.keyToIndexMapping[renderedSelectedKey] : 0;
|
|
148
|
-
var items = linkCollection.links.map(function (l) {
|
|
149
|
-
return renderPivotLink(linkCollection, l, renderedSelectedKey, classNames.link);
|
|
150
|
-
});
|
|
151
|
-
// The overflow menu starts empty and items[] is updated as the overflow items change
|
|
152
|
-
var overflowMenuProps = React.useMemo(function () { return ({
|
|
153
|
-
items: [],
|
|
154
|
-
doNotLayer: true,
|
|
155
|
-
alignTargetEdge: true,
|
|
156
|
-
directionalHint: react_internal_1.DirectionalHint.bottomRightEdge,
|
|
157
|
-
}); }, []);
|
|
158
|
-
var overflowMenuButtonRef = useOverflow_1.useOverflow({
|
|
159
|
-
onOverflowItemsChanged: function (overflowIndex, elements) {
|
|
160
|
-
// Set data-is-overflowing on each item
|
|
161
|
-
elements.forEach(function (_a) {
|
|
162
|
-
var ele = _a.ele, isOverflowing = _a.isOverflowing;
|
|
163
|
-
return (ele.dataset.isOverflowing = "" + isOverflowing);
|
|
164
|
-
});
|
|
165
|
-
// Update the menu items
|
|
166
|
-
overflowMenuProps.items = linkCollection.links.slice(overflowIndex).map(function (link, index) { return ({
|
|
167
|
-
key: link.itemKey || "" + (overflowIndex + index),
|
|
168
|
-
onRender: function () { return renderPivotLink(linkCollection, link, renderedSelectedKey, classNames.linkInMenu); },
|
|
169
|
-
}); });
|
|
170
|
-
},
|
|
171
|
-
rtl: utilities_1.getRTL(theme),
|
|
172
|
-
pinnedIndex: renderedSelectedIndex,
|
|
173
|
-
}).menuButtonRef;
|
|
174
|
-
return (React.createElement("div", tslib_1.__assign({ role: "toolbar" }, divProps, { ref: ref }),
|
|
175
|
-
React.createElement(react_internal_1.FocusZone, { componentRef: focusZoneRef, direction: react_internal_1.FocusZoneDirection.horizontal, className: classNames.root, role: "tablist" },
|
|
176
|
-
items,
|
|
177
|
-
overflowBehavior === 'menu' && (React.createElement(Button_1.CommandButton, { className: utilities_1.css(classNames.link, classNames.overflowMenuButton), elementRef: overflowMenuButtonRef, componentRef: overflowMenuButtonComponentRef, menuProps: overflowMenuProps, menuIconProps: { iconName: 'More', style: { color: 'inherit' } } }))),
|
|
178
|
-
renderedSelectedKey &&
|
|
179
|
-
linkCollection.links.map(function (link) {
|
|
180
|
-
return (link.alwaysRender === true || renderedSelectedKey === link.itemKey) &&
|
|
181
|
-
renderPivotItem(link.itemKey, renderedSelectedKey === link.itemKey);
|
|
182
|
-
})));
|
|
183
|
-
});
|
|
184
|
-
exports.PivotBase.displayName = COMPONENT_NAME;
|
|
185
|
-
//# sourceMappingURL=Pivot.base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pivot.base.js","sourceRoot":"../src/","sources":["components/Pivot/Pivot.base.tsx"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,qDAAoE;AACpE,iDAAqH;AACrH,2DAOkC;AAClC,qEAAoF;AACpF,iCAA0G;AAC1G,2DAA0D;AAE1D,IAAM,aAAa,GAAG,8BAAkB,EAAkC,CAAC;AAE3E,IAAM,cAAc,GAAG,OAAO,CAAC;AAQ/B,IAAM,QAAQ,GAAG,UAAC,KAAkB,EAAE,OAAe,EAAE,OAAe,EAAE,KAAa;IACnF,IAAI,KAAK,CAAC,QAAQ,EAAE;QAClB,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KACvC;IACD,OAAO,OAAO,IAAG,SAAO,KAAO,CAAA,CAAC;AAClC,CAAC,CAAC;AAEF,yDAAyD;AACzD,uEAAuE;AACvE,IAAM,YAAY,GAAG,UAAC,KAAkB,EAAE,OAAe;IACvD,IAAM,MAAM,GAAwB;QAClC,KAAK,EAAE,EAAE;QACT,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,EAAE;KACtB,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,UAAC,KAAsB,EAAE,K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IAEH,OAAO,CACL,8CAAK,IAAI,EAAC,SAAS,IAAK,QAAQ,IAAE,GAAG,EAAE,GAAG;QACxC,oBAAC,0BAAS,IACR,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,mCAAkB,CAAC,UAAU,EACxC,SAAS,EAAE,UAAU,CAAC,IAAI,EAC1B,IAAI,EAAC,SAAS;YAEb,KAAK;YACL,gBAAgB,KAAK,MAAM,IAAI,CAC9B,oBAAC,sBAAa,IACZ,SAAS,EAAE,eAAG,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC,EAC9D,UAAU,EAAE,qBAAqB,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,cAAc,CAAC,KAAK,CAAC,GAAG,CACtB,UAAA,IAAI;gBACF,OAAA,CAAC,IAAI,CAAC,YAAY,KAAK,IAAI,IAAI,mBAAmB,KAAK,IAAI,CAAC,OAAO,CAAC;oBACpE,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC,OAAO,CAAC;YADnE,CACmE,CACtE,CACC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,iBAAS,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-internal';\nimport { CommandButton, IButton } from '@fluentui/react-internal/lib/compat/Button';\nimport { IPivot, IPivotItemProps, IPivotProps, IPivotStyleProps, IPivotStyles, PivotItem } from './index';\nimport { useOverflow } from '../../utilities/useOverflow';\n\nconst getClassNames = classNamesFunction<IPivotStyleProps, IPivotStyles>();\n\nconst COMPONENT_NAME = 'Pivot';\n\ntype PivotLinkCollection = {\n links: IPivotItemProps[];\n keyToIndexMapping: { [key: string]: number };\n keyToTabIdMapping: { [key: string]: string };\n};\n\nconst getTabId = (props: IPivotProps, pivotId: string, itemKey: string, index: number): string => {\n if (props.getTabId) {\n return props.getTabId(itemKey, index);\n }\n return pivotId + `-Tab${index}`;\n};\n\n// Gets the set of PivotLinks as array of IPivotItemProps\n// The set of Links is determined by child components of type PivotItem\nconst getLinkItems = (props: IPivotProps, pivotId: string): PivotLinkCollection => {\n const result: PivotLinkCollection = {\n links: [],\n keyToIndexMapping: {},\n keyToTabIdMapping: {},\n };\n\n React.Children.forEach(React.Children.toArray(props.children), (child: React.ReactNode, index: number) => {\n if (isPivotItem(child)) {\n // eslint-disable-next-line deprecation/deprecation\n const { linkText, ...pivotItemProps } = child.props;\n const itemKey = child.props.itemKey || index.toString();\n result.links.push({\n headerText: linkText,\n ...pivotItemProps,\n itemKey: itemKey,\n });\n result.keyToIndexMapping[itemKey] = index;\n result.keyToTabIdMapping[itemKey] = getTabId(props, pivotId, itemKey, index);\n } else if (child) {\n warn('The children of a Pivot component must be of type PivotItem to be rendered.');\n }\n });\n return result;\n};\n\nconst isPivotItem = (item: React.ReactNode): item is PivotItem => {\n return ((item as React.ReactElement)?.type as React.ComponentType)?.name === PivotItem.name;\n};\n\nexport const PivotBase: React.FunctionComponent<IPivotProps> = React.forwardRef<HTMLDivElement, IPivotProps>(\n (props, ref) => {\n const focusZoneRef = React.useRef<IFocusZone>(null);\n const overflowMenuButtonComponentRef = React.useRef<IButton>(null);\n const pivotId: string = useId('Pivot');\n\n const [selectedKey, setSelectedKey] = useControllableValue(props.selectedKey, props.defaultSelectedKey);\n\n const { componentRef, theme, linkSize, linkFormat, overflowBehavior } = props;\n\n let classNames: { [key in keyof IPivotStyles]: string };\n const divProps = getNativeProps<React.HTMLAttributes<HTMLDivElement>>(props, divProperties);\n\n let linkCollection = getLinkItems(props, pivotId);\n\n React.useImperativeHandle(componentRef as React.RefObject<IPivot>, () => ({\n focus: () => {\n focusZoneRef.current?.focus();\n },\n }));\n\n const renderLinkContent = (link?: IPivotItemProps): JSX.Element | null => {\n if (!link) {\n return null;\n }\n\n const { itemCount, itemIcon, headerText } = link;\n return (\n <span className={classNames.linkContent}>\n {itemIcon !== undefined && (\n <span className={classNames.icon}>\n <Icon iconName={itemIcon} />\n </span>\n )}\n {headerText !== undefined && <span className={classNames.text}> {link.headerText}</span>}\n {itemCount !== undefined && <span className={classNames.count}> ({itemCount})</span>}\n </span>\n );\n };\n\n const renderPivotLink = (\n renderLinkCollection: PivotLinkCollection,\n link: IPivotItemProps,\n renderPivotLinkSelectedKey: string | null | undefined,\n className: string,\n ): JSX.Element => {\n const { itemKey, headerButtonProps, onRenderItemLink } = link;\n const tabId = renderLinkCollection.keyToTabIdMapping[itemKey!];\n let linkContent: JSX.Element | null;\n const isSelected: boolean = renderPivotLinkSelectedKey === itemKey;\n\n if (onRenderItemLink) {\n linkContent = onRenderItemLink(link, renderLinkContent);\n } else {\n linkContent = renderLinkContent(link);\n }\n\n let contentString = link.headerText || '';\n contentString += link.itemCount ? ' (' + link.itemCount + ')' : '';\n // Adding space supplementary for icon\n contentString += link.itemIcon ? ' xx' : '';\n return (\n <CommandButton\n {...headerButtonProps}\n id={tabId}\n key={itemKey}\n className={css(className, isSelected && classNames.linkIsSelected)}\n // eslint-disable-next-line react/jsx-no-bind\n onClick={(ev: React.MouseEvent<HTMLElement>) => onLinkClick(itemKey!, ev)}\n // eslint-disable-next-line react/jsx-no-bind\n onKeyDown={(ev: React.KeyboardEvent<HTMLElement>) => onKeyDown(itemKey!, ev)}\n aria-label={link.ariaLabel}\n role=\"tab\"\n aria-selected={isSelected}\n name={link.headerText}\n keytipProps={link.keytipProps}\n data-content={contentString}\n >\n {linkContent}\n </CommandButton>\n );\n };\n\n const onLinkClick = (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 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 linkCollection = getLinkItems(props, pivotId);\n if (props.onLinkClick && linkCollection.keyToIndexMapping[itemKey] >= 0) {\n const selectedIndex = linkCollection.keyToIndexMapping[itemKey];\n const item = React.Children.toArray(props.children)[selectedIndex];\n if (isPivotItem(item)) {\n props.onLinkClick(item, ev);\n }\n }\n\n overflowMenuButtonComponentRef.current?.dismissMenu();\n };\n\n const renderPivotItem = (itemKey: string | undefined, isActive: boolean): JSX.Element | null => {\n if (props.headersOnly || !itemKey) {\n return null;\n }\n\n const index = linkCollection.keyToIndexMapping[itemKey];\n const selectedTabId = linkCollection.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 && linkCollection.keyToIndexMapping[itemKey] !== undefined;\n };\n\n const getSelectedKey = () => {\n if (isKeyValid(selectedKey)) {\n return selectedKey;\n }\n if (linkCollection.links.length) {\n return linkCollection.links[0].itemKey;\n }\n return undefined;\n };\n\n classNames = getClassNames(props.styles!, {\n theme: theme!,\n linkSize,\n linkFormat,\n });\n\n const renderedSelectedKey = getSelectedKey();\n const renderedSelectedIndex = renderedSelectedKey ? linkCollection.keyToIndexMapping[renderedSelectedKey] : 0;\n\n const items = linkCollection.links.map(l =>\n renderPivotLink(linkCollection, l, renderedSelectedKey, classNames.link),\n );\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 doNotLayer: true,\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 = linkCollection.links.slice(overflowIndex).map((link, index) => ({\n key: link.itemKey || `${overflowIndex + index}`,\n onRender: () => renderPivotLink(linkCollection, link, renderedSelectedKey, classNames.linkInMenu),\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.link, 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 linkCollection.links.map(\n link =>\n (link.alwaysRender === true || renderedSelectedKey === link.itemKey) &&\n renderPivotItem(link.itemKey, renderedSelectedKey === link.itemKey),\n )}\n </div>\n );\n },\n);\nPivotBase.displayName = COMPONENT_NAME;\n"]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { IPivotProps } from './Pivot.types';
|
|
3
|
-
/**
|
|
4
|
-
* The Pivot control and related tabs pattern are used for navigating frequently accessed,
|
|
5
|
-
* distinct content categories. Pivots 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 Pivot: React.FunctionComponent<IPivotProps>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var utilities_1 = require("@fluentui/utilities");
|
|
4
|
-
var Pivot_base_1 = require("./Pivot.base");
|
|
5
|
-
var Pivot_styles_1 = require("./Pivot.styles");
|
|
6
|
-
/**
|
|
7
|
-
* The Pivot control and related tabs pattern are used for navigating frequently accessed,
|
|
8
|
-
* distinct content categories. Pivots allow for navigation between two or more content
|
|
9
|
-
* views and relies on text headers to articulate the different sections of content.
|
|
10
|
-
*/
|
|
11
|
-
exports.Pivot = utilities_1.styled(Pivot_base_1.PivotBase, Pivot_styles_1.getStyles, undefined, {
|
|
12
|
-
scope: 'Pivot',
|
|
13
|
-
});
|
|
14
|
-
//# sourceMappingURL=Pivot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pivot.js","sourceRoot":"../src/","sources":["components/Pivot/Pivot.tsx"],"names":[],"mappings":";;AACA,iDAA6C;AAE7C,2CAAyC;AACzC,+CAA2C;AAE3C;;;;GAIG;AACU,QAAA,KAAK,GAAyC,kBAAM,CAC/D,sBAAS,EACT,wBAAS,EACT,SAAS,EACT;IACE,KAAK,EAAE,OAAO;CACf,CACF,CAAC","sourcesContent":["import * as React from 'react';\nimport { styled } from '@fluentui/utilities';\nimport { IPivotProps, IPivotStyleProps, IPivotStyles } from './Pivot.types';\nimport { PivotBase } from './Pivot.base';\nimport { getStyles } from './Pivot.styles';\n\n/**\n * The Pivot control and related tabs pattern are used for navigating frequently accessed,\n * distinct content categories. Pivots 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 Pivot: React.FunctionComponent<IPivotProps> = styled<IPivotProps, IPivotStyleProps, IPivotStyles>(\n PivotBase,\n getStyles,\n undefined,\n {\n scope: 'Pivot',\n },\n);\n"]}
|