diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a92f142f8..b6c565885c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Adding 'expand', 'collapse', 'companion', 'share-to' and 'settings-audio' icons @TanelVari ([#2343](https://github.com/microsoft/fluent-ui-react/pull/2343)) - Add support for Children API in `List` component @layershifter ([#2207](https://github.com/microsoft/fluent-ui-react/pull/2207)) - Added virtualized table prototype using `react-virtualized` and `Table` components @pompomon ([#2339](https://github.com/microsoft/fluent-ui-react/pull/2339)) +- Adding prototype for popover in `Table` header @pompomon ([#2379](https://github.com/microsoft/fluent-ui-react/pull/2379)) ### Performance - Add styles caching when there aren't inline overrides defined @mnajdova ([#2309](https://github.com/microsoft/fluent-ui-react/pull/2309)) diff --git a/docs/src/prototypes/table/InteractiveTable.tsx b/docs/src/prototypes/table/InteractiveTable.tsx new file mode 100644 index 0000000000..9d772cb8c9 --- /dev/null +++ b/docs/src/prototypes/table/InteractiveTable.tsx @@ -0,0 +1,78 @@ +import { + Icon, + Popup, + Table, + gridNestedBehavior, + gridHeaderCellBehavior, + gridRowBehavior, + gridCellBehavior, +} from '@fluentui/react' +import * as React from 'react' + +const columnDescription = 'ID uniquely identifies a uniquely indetifiable item' + +const InteractiveTable = () => { + const [popupOpen, setPopupOpen] = React.useState(false) + const handleFocus = () => setPopupOpen(true) + const handleBlur = () => { + setPopupOpen(false) + } + + return ( + <> + + + + + Id + } + content={columnDescription} + onOpenChange={(e, { open }) => setPopupOpen(open)} + on="hover" + open={popupOpen} + /> + + } + key="id" + accessibility={gridHeaderCellBehavior} + aria-describedby="columnDescription" + onFocus={handleFocus} + onBlur={handleBlur} + /> + + + + + + + + + + + + + + + + + + + + + + +
+ + ) +} + +export default InteractiveTable diff --git a/docs/src/prototypes/table/index.tsx b/docs/src/prototypes/table/index.tsx index ce824b9be9..0f1c0f289b 100644 --- a/docs/src/prototypes/table/index.tsx +++ b/docs/src/prototypes/table/index.tsx @@ -1,22 +1,23 @@ -import * as React from 'react' import { - Button, - Menu, - Flex, + gridCellMultipleFocusableBehavior, + gridCellWithFocusableElementBehavior, +} from '@fluentui/accessibility' +import { Avatar, - Text, - Dropdown, + Button, Checkbox, + Dropdown, + Flex, Icon, + Menu, MenuButton, + Text, } from '@fluentui/react' -import { - gridCellWithFocusableElementBehavior, - gridCellMultipleFocusableBehavior, -} from '@fluentui/accessibility' - -import AdvancedTable, { stringCellComparator } from './AdvancedTable' +import * as React from 'react' import chatProtoStyle from '.././chatPane/chatProtoStyle' +import { ComponentPrototype, PrototypeSection } from '../Prototypes' +import AdvancedTable, { stringCellComparator } from './AdvancedTable' +import InteractiveTable from './InteractiveTable' function handleRowClick(index) { alert(`OnClick on the row ${index} executed.`) @@ -175,18 +176,28 @@ const rowsChannels = [ }, ] -const StaticTable = () => ( - <> - -
- -
- +export default () => ( + + + + + + +
+ + + + + ) - -export default StaticTable