@fluentui/react-tree 9.0.0-beta.2 → 9.0.0-beta.21
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 +1073 -1
- package/CHANGELOG.md +295 -2
- package/dist/index.d.ts +153 -91
- package/lib/Tree.js +0 -1
- package/lib/Tree.js.map +1 -1
- package/lib/TreeItem.js +0 -1
- package/lib/TreeItem.js.map +1 -1
- package/lib/TreeItemLayout.js +0 -1
- package/lib/TreeItemLayout.js.map +1 -1
- package/lib/TreeItemPersonaLayout.js +0 -1
- package/lib/TreeItemPersonaLayout.js.map +1 -1
- package/lib/components/Tree/Tree.js +6 -8
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/components/Tree/Tree.types.js +1 -2
- package/lib/components/Tree/Tree.types.js.map +1 -1
- package/lib/components/Tree/index.js +1 -2
- package/lib/components/Tree/index.js.map +1 -1
- package/lib/components/Tree/renderTree.js +7 -13
- package/lib/components/Tree/renderTree.js.map +1 -1
- package/lib/components/Tree/useRootTree.js +145 -0
- package/lib/components/Tree/useRootTree.js.map +1 -0
- package/lib/components/Tree/useSubtree.js +35 -0
- package/lib/components/Tree/useSubtree.js.map +1 -0
- package/lib/components/Tree/useTree.js +9 -103
- package/lib/components/Tree/useTree.js.map +1 -1
- package/lib/components/Tree/useTreeContextValues.js +12 -22
- package/lib/components/Tree/useTreeContextValues.js.map +1 -1
- package/lib/components/Tree/useTreeStyles.styles.js +30 -0
- package/lib/components/Tree/useTreeStyles.styles.js.map +1 -0
- package/lib/components/TreeItem/TreeItem.js +16 -9
- package/lib/components/TreeItem/TreeItem.js.map +1 -1
- package/lib/components/TreeItem/TreeItem.types.js +1 -2
- package/lib/components/TreeItem/TreeItem.types.js.map +1 -1
- package/lib/components/TreeItem/index.js +1 -2
- package/lib/components/TreeItem/index.js.map +1 -1
- package/lib/components/TreeItem/renderTreeItem.js +7 -25
- package/lib/components/TreeItem/renderTreeItem.js.map +1 -1
- package/lib/components/TreeItem/useTreeItem.js +116 -234
- package/lib/components/TreeItem/useTreeItem.js.map +1 -1
- package/lib/components/TreeItem/useTreeItemContextValues.js +18 -16
- package/lib/components/TreeItem/useTreeItemContextValues.js.map +1 -1
- package/lib/components/TreeItem/useTreeItemStyles.styles.js +100 -0
- package/lib/components/TreeItem/useTreeItemStyles.styles.js.map +1 -0
- package/lib/components/TreeItemChevron.js +24 -0
- package/lib/components/TreeItemChevron.js.map +1 -0
- package/lib/components/TreeItemLayout/TreeItemLayout.js +8 -8
- package/lib/components/TreeItemLayout/TreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/TreeItemLayout.types.js +1 -2
- package/lib/components/TreeItemLayout/TreeItemLayout.types.js.map +1 -1
- package/lib/components/TreeItemLayout/index.js +1 -2
- package/lib/components/TreeItemLayout/index.js.map +1 -1
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js +8 -21
- package/lib/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/useTreeItemLayout.js +58 -39
- package/lib/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js +191 -0
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js.map +1 -0
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +9 -9
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js +1 -2
- package/lib/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/index.js +1 -2
- package/lib/components/TreeItemPersonaLayout/index.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +10 -27
- package/lib/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +35 -48
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js +9 -10
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js.map +1 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js +206 -0
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js.map +1 -0
- package/lib/contexts/index.js +0 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/contexts/treeContext.js +9 -14
- package/lib/contexts/treeContext.js.map +1 -1
- package/lib/contexts/treeItemContext.js +13 -10
- package/lib/contexts/treeItemContext.js.map +1 -1
- package/lib/hooks/index.js +0 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useFlatTree.js +81 -35
- package/lib/hooks/useFlatTree.js.map +1 -1
- package/lib/hooks/useFlatTreeNavigation.js +65 -62
- package/lib/hooks/useFlatTreeNavigation.js.map +1 -1
- package/lib/hooks/useHTMLElementWalker.js +78 -76
- package/lib/hooks/useHTMLElementWalker.js.map +1 -1
- package/lib/hooks/useNestedTreeNavigation.js +49 -49
- package/lib/hooks/useNestedTreeNavigation.js.map +1 -1
- package/lib/hooks/useOpenItemsState.js +21 -15
- package/lib/hooks/useOpenItemsState.js.map +1 -1
- package/lib/hooks/useRovingTabIndexes.js +46 -45
- package/lib/hooks/useRovingTabIndexes.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/ImmutableSet.js +27 -30
- package/lib/utils/ImmutableSet.js.map +1 -1
- package/lib/utils/assert.js +5 -5
- package/lib/utils/assert.js.map +1 -1
- package/lib/utils/createFlatTreeItems.js +113 -0
- package/lib/utils/createFlatTreeItems.js.map +1 -0
- package/lib/utils/flattenTree.js +58 -28
- package/lib/utils/flattenTree.js.map +1 -1
- package/lib/utils/getTreeItemValueFromElement.js +4 -0
- package/lib/utils/getTreeItemValueFromElement.js.map +1 -0
- package/lib/utils/nextTypeAheadElement.js +11 -12
- package/lib/utils/nextTypeAheadElement.js.map +1 -1
- package/lib/utils/normalizeOpenItems.js +6 -5
- package/lib/utils/normalizeOpenItems.js.map +1 -1
- package/lib/utils/tokens.js +13 -14
- package/lib/utils/tokens.js.map +1 -1
- package/lib/utils/treeItemFilter.js +2 -3
- package/lib/utils/treeItemFilter.js.map +1 -1
- package/lib-commonjs/Tree.js +3 -5
- package/lib-commonjs/Tree.js.map +1 -1
- package/lib-commonjs/TreeItem.js +3 -5
- package/lib-commonjs/TreeItem.js.map +1 -1
- package/lib-commonjs/TreeItemLayout.js +3 -5
- package/lib-commonjs/TreeItemLayout.js.map +1 -1
- package/lib-commonjs/TreeItemPersonaLayout.js +3 -5
- package/lib-commonjs/TreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/Tree/Tree.js +17 -23
- package/lib-commonjs/components/Tree/Tree.js.map +1 -1
- package/lib-commonjs/components/Tree/Tree.types.js +3 -3
- package/lib-commonjs/components/Tree/Tree.types.js.map +1 -1
- package/lib-commonjs/components/Tree/index.js +8 -10
- package/lib-commonjs/components/Tree/index.js.map +1 -1
- package/lib-commonjs/components/Tree/renderTree.js +14 -19
- package/lib-commonjs/components/Tree/renderTree.js.map +1 -1
- package/lib-commonjs/components/Tree/useRootTree.js +149 -0
- package/lib-commonjs/components/Tree/useRootTree.js.map +1 -0
- package/lib-commonjs/components/Tree/useSubtree.js +39 -0
- package/lib-commonjs/components/Tree/useSubtree.js.map +1 -0
- package/lib-commonjs/components/Tree/useTree.js +16 -116
- package/lib-commonjs/components/Tree/useTree.js.map +1 -1
- package/lib-commonjs/components/Tree/useTreeContextValues.js +17 -26
- package/lib-commonjs/components/Tree/useTreeContextValues.js.map +1 -1
- package/lib-commonjs/components/Tree/useTreeStyles.styles.js +53 -0
- package/lib-commonjs/components/Tree/useTreeStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItem/TreeItem.js +17 -18
- package/lib-commonjs/components/TreeItem/TreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/TreeItem.types.js +3 -4
- package/lib-commonjs/components/TreeItem/TreeItem.types.js.map +1 -1
- package/lib-commonjs/components/TreeItem/index.js +7 -9
- package/lib-commonjs/components/TreeItem/index.js.map +1 -1
- package/lib-commonjs/components/TreeItem/renderTreeItem.js +14 -33
- package/lib-commonjs/components/TreeItem/renderTreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItem.js +126 -251
- package/lib-commonjs/components/TreeItem/useTreeItem.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItemContextValues.js +23 -20
- package/lib-commonjs/components/TreeItem/useTreeItemContextValues.js.map +1 -1
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.styles.js +202 -0
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItemChevron.js +33 -0
- package/lib-commonjs/components/TreeItemChevron.js.map +1 -0
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.js +15 -16
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.types.js +1 -3
- package/lib-commonjs/components/TreeItemLayout/TreeItemLayout.types.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/index.js +7 -9
- package/lib-commonjs/components/TreeItemLayout/index.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js +14 -28
- package/lib-commonjs/components/TreeItemLayout/renderTreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js +64 -52
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js +321 -0
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.styles.js.map +1 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js +17 -18
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js +1 -3
- package/lib-commonjs/components/TreeItemPersonaLayout/TreeItemPersonaLayout.types.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/index.js +7 -9
- package/lib-commonjs/components/TreeItemPersonaLayout/index.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js +17 -35
- package/lib-commonjs/components/TreeItemPersonaLayout/renderTreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js +42 -61
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayout.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js +16 -15
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutContextValues.js.map +1 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js +375 -0
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/index.js +4 -6
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/contexts/treeContext.js +23 -18
- package/lib-commonjs/contexts/treeContext.js.map +1 -1
- package/lib-commonjs/contexts/treeItemContext.js +27 -13
- package/lib-commonjs/contexts/treeItemContext.js.map +1 -1
- package/lib-commonjs/hooks/index.js +5 -7
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useFlatTree.js +88 -52
- package/lib-commonjs/hooks/useFlatTree.js.map +1 -1
- package/lib-commonjs/hooks/useFlatTreeNavigation.js +76 -72
- package/lib-commonjs/hooks/useFlatTreeNavigation.js.map +1 -1
- package/lib-commonjs/hooks/useHTMLElementWalker.js +92 -83
- package/lib-commonjs/hooks/useHTMLElementWalker.js.map +1 -1
- package/lib-commonjs/hooks/useNestedTreeNavigation.js +59 -58
- package/lib-commonjs/hooks/useNestedTreeNavigation.js.map +1 -1
- package/lib-commonjs/hooks/useOpenItemsState.js +30 -22
- package/lib-commonjs/hooks/useOpenItemsState.js.map +1 -1
- package/lib-commonjs/hooks/useRovingTabIndexes.js +54 -53
- package/lib-commonjs/hooks/useRovingTabIndexes.js.map +1 -1
- package/lib-commonjs/index.js +46 -181
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/ImmutableSet.js +37 -38
- package/lib-commonjs/utils/ImmutableSet.js.map +1 -1
- package/lib-commonjs/utils/assert.js +11 -9
- package/lib-commonjs/utils/assert.js.map +1 -1
- package/lib-commonjs/utils/createFlatTreeItems.js +127 -0
- package/lib-commonjs/utils/createFlatTreeItems.js.map +1 -0
- package/lib-commonjs/utils/flattenTree.js +25 -33
- package/lib-commonjs/utils/flattenTree.js.map +1 -1
- package/lib-commonjs/utils/getTreeItemValueFromElement.js +18 -0
- package/lib-commonjs/utils/getTreeItemValueFromElement.js.map +1 -0
- package/lib-commonjs/utils/nextTypeAheadElement.js +16 -16
- package/lib-commonjs/utils/nextTypeAheadElement.js.map +1 -1
- package/lib-commonjs/utils/normalizeOpenItems.js +11 -9
- package/lib-commonjs/utils/normalizeOpenItems.js.map +1 -1
- package/lib-commonjs/utils/tokens.js +28 -20
- package/lib-commonjs/utils/tokens.js.map +1 -1
- package/lib-commonjs/utils/treeItemFilter.js +7 -7
- package/lib-commonjs/utils/treeItemFilter.js.map +1 -1
- package/package.json +23 -17
- package/lib/components/Tree/useTreeStyles.js +0 -20
- package/lib/components/Tree/useTreeStyles.js.map +0 -1
- package/lib/components/TreeItem/useTreeItemStyles.js +0 -203
- package/lib/components/TreeItem/useTreeItemStyles.js.map +0 -1
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.js +0 -98
- package/lib/components/TreeItemLayout/useTreeItemLayoutStyles.js.map +0 -1
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js +0 -115
- package/lib/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +0 -1
- package/lib/utils/createUnfilteredFlatTree.js +0 -77
- package/lib/utils/createUnfilteredFlatTree.js.map +0 -1
- package/lib/utils/createVisibleFlatTree.js +0 -80
- package/lib/utils/createVisibleFlatTree.js.map +0 -1
- package/lib-commonjs/components/Tree/useTreeStyles.js +0 -27
- package/lib-commonjs/components/Tree/useTreeStyles.js.map +0 -1
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.js +0 -210
- package/lib-commonjs/components/TreeItem/useTreeItemStyles.js.map +0 -1
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.js +0 -105
- package/lib-commonjs/components/TreeItemLayout/useTreeItemLayoutStyles.js.map +0 -1
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js +0 -122
- package/lib-commonjs/components/TreeItemPersonaLayout/useTreeItemPersonaLayoutStyles.js.map +0 -1
- package/lib-commonjs/utils/createUnfilteredFlatTree.js +0 -84
- package/lib-commonjs/utils/createUnfilteredFlatTree.js.map +0 -1
- package/lib-commonjs/utils/createVisibleFlatTree.js +0 -87
- package/lib-commonjs/utils/createVisibleFlatTree.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTreeItemLayout_unstable } from './useTreeItemLayout';
|
|
3
3
|
import { renderTreeItemLayout_unstable } from './renderTreeItemLayout';
|
|
4
|
-
import { useTreeItemLayoutStyles_unstable } from './useTreeItemLayoutStyles';
|
|
4
|
+
import { useTreeItemLayoutStyles_unstable } from './useTreeItemLayoutStyles.styles';
|
|
5
5
|
/**
|
|
6
|
-
* TreeItemLayout component
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
* The `TreeItemLayout` component is used as a child of `TreeItem` to define the content and layout of a tree item.
|
|
7
|
+
* It provides a consistent visual structure for tree items in a `Tree` component.
|
|
8
|
+
* This component should only be used as a direct child of `TreeItem`.
|
|
9
|
+
*/ export const TreeItemLayout = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
10
|
+
const state = useTreeItemLayout_unstable(props, ref);
|
|
11
|
+
useTreeItemLayoutStyles_unstable(state);
|
|
12
|
+
return renderTreeItemLayout_unstable(state);
|
|
12
13
|
});
|
|
13
14
|
TreeItemLayout.displayName = 'TreeItemLayout';
|
|
14
|
-
//# sourceMappingURL=TreeItemLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["TreeItemLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTreeItemLayout_unstable } from './useTreeItemLayout';\nimport { renderTreeItemLayout_unstable } from './renderTreeItemLayout';\nimport { useTreeItemLayoutStyles_unstable } from './useTreeItemLayoutStyles.styles';\nimport type { TreeItemLayoutProps } from './TreeItemLayout.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * The `TreeItemLayout` component is used as a child of `TreeItem` to define the content and layout of a tree item.\n * It provides a consistent visual structure for tree items in a `Tree` component.\n * This component should only be used as a direct child of `TreeItem`.\n */\nexport const TreeItemLayout: ForwardRefComponent<TreeItemLayoutProps> = React.forwardRef((props, ref) => {\n const state = useTreeItemLayout_unstable(props, ref);\n\n useTreeItemLayoutStyles_unstable(state);\n return renderTreeItemLayout_unstable(state);\n});\n\nTreeItemLayout.displayName = 'TreeItemLayout';\n"],"names":["React","useTreeItemLayout_unstable","renderTreeItemLayout_unstable","useTreeItemLayoutStyles_unstable","TreeItemLayout","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAIpF;;;;CAIC,GACD,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvG,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=TreeItemLayout.types.js.map
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["TreeItemLayout.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, ExtractSlotProps, Slot } from '@fluentui/react-utilities';\nimport { ButtonContextValue } from '@fluentui/react-button';\n\nexport type TreeItemLayoutSlots = {\n root: Slot<'div'>;\n /**\n * Icon slot that renders right before main content\n */\n iconBefore?: Slot<'div'>;\n /**\n * Icon slot that renders right after main content\n */\n iconAfter?: Slot<'div'>;\n /**\n * Expand icon slot,\n * by default renders a chevron icon to indicate opening and closing\n */\n expandIcon?: Slot<'div'>;\n aside?: Slot<'div'>;\n /**\n * actionable elements are normally buttons, menus, or other focusable elements.\n * Those elements are only visibly available if the given tree item is currently active.\n */\n actions?: Slot<\n ExtractSlotProps<\n Slot<'div'> & {\n /**\n * Forces visibility of the aside/action content\n */\n visible?: boolean;\n }\n >\n >;\n};\n\n/**\n * TreeItemLayout Props\n */\nexport type TreeItemLayoutProps = ComponentProps<Partial<TreeItemLayoutSlots>>;\n\n/**\n * State used in rendering TreeItemLayout\n */\nexport type TreeItemLayoutState = ComponentState<TreeItemLayoutSlots> & {\n buttonContextValue: ButtonContextValue;\n};\n"],"names":[],"mappings":"AAAA,WA6CE"}
|
|
@@ -2,5 +2,4 @@ export * from './TreeItemLayout';
|
|
|
2
2
|
export * from './TreeItemLayout.types';
|
|
3
3
|
export * from './renderTreeItemLayout';
|
|
4
4
|
export * from './useTreeItemLayout';
|
|
5
|
-
export * from './useTreeItemLayoutStyles';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
5
|
+
export * from './useTreeItemLayoutStyles.styles';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './TreeItemLayout';\nexport * from './TreeItemLayout.types';\nexport * from './renderTreeItemLayout';\nexport * from './useTreeItemLayout';\nexport * from './useTreeItemLayoutStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,mCAAmC"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
|
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
|
3
|
+
import { ButtonContextProvider } from '@fluentui/react-button';
|
|
3
4
|
/**
|
|
4
5
|
* Render the final JSX of TreeItemLayout
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const {
|
|
11
|
-
slots,
|
|
12
|
-
slotProps
|
|
13
|
-
} = getSlots(state);
|
|
14
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
|
15
|
-
...slotProps.root
|
|
16
|
-
}, slots.iconBefore && /*#__PURE__*/React.createElement(slots.iconBefore, {
|
|
17
|
-
...slotProps.iconBefore
|
|
18
|
-
}), slotProps.root.children, slots.iconAfter && /*#__PURE__*/React.createElement(slots.iconAfter, {
|
|
19
|
-
...slotProps.iconAfter
|
|
20
|
-
}), !isActionsVisible && slots.aside && /*#__PURE__*/React.createElement(slots.aside, {
|
|
21
|
-
...slotProps.aside
|
|
22
|
-
}));
|
|
6
|
+
*/ export const renderTreeItemLayout_unstable = (state)=>{
|
|
7
|
+
const { slots , slotProps } = getSlotsNext(state);
|
|
8
|
+
return /*#__PURE__*/ createElement(slots.root, slotProps.root, slots.expandIcon && /*#__PURE__*/ createElement(slots.expandIcon, slotProps.expandIcon), slots.iconBefore && /*#__PURE__*/ createElement(slots.iconBefore, slotProps.iconBefore), slotProps.root.children, slots.iconAfter && /*#__PURE__*/ createElement(slots.iconAfter, slotProps.iconAfter), /*#__PURE__*/ createElement(ButtonContextProvider, {
|
|
9
|
+
value: state.buttonContextValue
|
|
10
|
+
}, slots.actions && /*#__PURE__*/ createElement(slots.actions, slotProps.actions), slots.aside && /*#__PURE__*/ createElement(slots.aside, slotProps.aside)));
|
|
23
11
|
};
|
|
24
|
-
//# sourceMappingURL=renderTreeItemLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["renderTreeItemLayout.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { TreeItemLayoutState, TreeItemLayoutSlots } from './TreeItemLayout.types';\nimport { ButtonContextProvider } from '@fluentui/react-button';\n\n/**\n * Render the final JSX of TreeItemLayout\n */\nexport const renderTreeItemLayout_unstable = (state: TreeItemLayoutState) => {\n const { slots, slotProps } = getSlotsNext<TreeItemLayoutSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.expandIcon && <slots.expandIcon {...slotProps.expandIcon} />}\n {slots.iconBefore && <slots.iconBefore {...slotProps.iconBefore} />}\n {slotProps.root.children}\n {slots.iconAfter && <slots.iconAfter {...slotProps.iconAfter} />}\n <ButtonContextProvider value={state.buttonContextValue}>\n {slots.actions && <slots.actions {...slotProps.actions} />}\n {slots.aside && <slots.aside {...slotProps.aside} />}\n </ButtonContextProvider>\n </slots.root>\n );\n};\n"],"names":["createElement","getSlotsNext","ButtonContextProvider","renderTreeItemLayout_unstable","state","slots","slotProps","root","expandIcon","iconBefore","children","iconAfter","value","buttonContextValue","actions","aside"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,YAAY,QAAQ,4BAA4B;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC,QAA+B;IAC3E,MAAM,EAAEC,MAAK,EAAEC,UAAS,EAAE,GAAGL,aAAkCG;IAE/D,qBACE,AAdJ,cAcKC,MAAME,IAAI,EAAKD,UAAUC,IAAI,EAC3BF,MAAMG,UAAU,kBAAI,AAf3B,cAe4BH,MAAMG,UAAU,EAAKF,UAAUE,UAAU,GAC9DH,MAAMI,UAAU,kBAAI,AAhB3B,cAgB4BJ,MAAMI,UAAU,EAAKH,UAAUG,UAAU,GAC9DH,UAAUC,IAAI,CAACG,QAAQ,EACvBL,MAAMM,SAAS,kBAAI,AAlB1B,cAkB2BN,MAAMM,SAAS,EAAKL,UAAUK,SAAS,iBAC5D,AAnBN,cAmBOT;QAAsBU,OAAOR,MAAMS,kBAAkB;OACnDR,MAAMS,OAAO,kBAAI,AApB1B,cAoB2BT,MAAMS,OAAO,EAAKR,UAAUQ,OAAO,GACrDT,MAAMU,KAAK,kBAAI,AArBxB,cAqByBV,MAAMU,KAAK,EAAKT,UAAUS,KAAK;AAIxD,EAAE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getNativeElementProps, isResolvedShorthand, resolveShorthand, useMergedRefs } from '@fluentui/react-utilities';
|
|
2
3
|
import { useTreeItemContext_unstable } from '../../contexts/treeItemContext';
|
|
4
|
+
import { TreeItemChevron } from '../TreeItemChevron';
|
|
3
5
|
/**
|
|
4
6
|
* Create the state required to render TreeItemLayout.
|
|
5
7
|
*
|
|
@@ -8,42 +10,59 @@ import { useTreeItemContext_unstable } from '../../contexts/treeItemContext';
|
|
|
8
10
|
*
|
|
9
11
|
* @param props - props from this instance of TreeItemLayout
|
|
10
12
|
* @param ref - reference to root HTMLElement of TreeItemLayout
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
13
|
+
*/ export const useTreeItemLayout_unstable = (props, ref)=>{
|
|
14
|
+
const { iconAfter , iconBefore , expandIcon , as ='span' , aside , actions } = props;
|
|
15
|
+
const layoutRef = useTreeItemContext_unstable((ctx)=>ctx.layoutRef);
|
|
16
|
+
const expandIconRef = useTreeItemContext_unstable((ctx)=>ctx.expandIconRef);
|
|
17
|
+
const isActionsVisibleContext = useTreeItemContext_unstable((ctx)=>ctx.isActionsVisible);
|
|
18
|
+
const isAsideVisible = useTreeItemContext_unstable((ctx)=>ctx.isAsideVisible);
|
|
19
|
+
var _ref;
|
|
20
|
+
const isActionsVisible = (_ref = isResolvedShorthand(actions) ? actions.visible : undefined) !== null && _ref !== void 0 ? _ref : isActionsVisibleContext;
|
|
21
|
+
const isBranch = useTreeItemContext_unstable((ctx)=>ctx.itemType === 'branch');
|
|
22
|
+
const actionsRef = useMergedRefs(isResolvedShorthand(actions) ? actions.ref : undefined, useTreeItemContext_unstable((ctx)=>ctx.actionsRef));
|
|
23
|
+
return {
|
|
24
|
+
components: {
|
|
25
|
+
root: 'div',
|
|
26
|
+
expandIcon: 'div',
|
|
27
|
+
iconBefore: 'div',
|
|
28
|
+
iconAfter: 'div',
|
|
29
|
+
actions: 'div',
|
|
30
|
+
aside: 'div'
|
|
31
|
+
},
|
|
32
|
+
buttonContextValue: {
|
|
33
|
+
size: 'small'
|
|
34
|
+
},
|
|
35
|
+
root: getNativeElementProps(as, {
|
|
36
|
+
...props,
|
|
37
|
+
ref: useMergedRefs(ref, layoutRef)
|
|
38
|
+
}),
|
|
39
|
+
iconBefore: resolveShorthand(iconBefore, {
|
|
40
|
+
defaultProps: {
|
|
41
|
+
'aria-hidden': true
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
iconAfter: resolveShorthand(iconAfter, {
|
|
45
|
+
defaultProps: {
|
|
46
|
+
'aria-hidden': true
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
aside: isAsideVisible ? resolveShorthand(aside) : undefined,
|
|
50
|
+
actions: isActionsVisible ? resolveShorthand(// visible props should not be propagated to the DOM
|
|
51
|
+
isResolvedShorthand(actions) ? {
|
|
52
|
+
...actions,
|
|
53
|
+
visible: undefined
|
|
54
|
+
} : actions, {
|
|
55
|
+
defaultProps: {
|
|
56
|
+
ref: actionsRef
|
|
57
|
+
}
|
|
58
|
+
}) : undefined,
|
|
59
|
+
expandIcon: resolveShorthand(expandIcon, {
|
|
60
|
+
required: isBranch,
|
|
61
|
+
defaultProps: {
|
|
62
|
+
children: /*#__PURE__*/ React.createElement(TreeItemChevron, null),
|
|
63
|
+
'aria-hidden': true,
|
|
64
|
+
ref: useMergedRefs(isResolvedShorthand(expandIcon) ? expandIcon.ref : undefined, expandIconRef)
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
};
|
|
48
68
|
};
|
|
49
|
-
//# sourceMappingURL=useTreeItemLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["useTreeItemLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ExtractSlotProps,\n getNativeElementProps,\n isResolvedShorthand,\n resolveShorthand,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport type { TreeItemLayoutProps, TreeItemLayoutSlots, TreeItemLayoutState } from './TreeItemLayout.types';\nimport { useTreeItemContext_unstable } from '../../contexts/treeItemContext';\nimport { TreeItemChevron } from '../TreeItemChevron';\n\n/**\n * Create the state required to render TreeItemLayout.\n *\n * The returned state can be modified with hooks such as useTreeItemLayoutStyles_unstable,\n * before being passed to renderTreeItemLayout_unstable.\n *\n * @param props - props from this instance of TreeItemLayout\n * @param ref - reference to root HTMLElement of TreeItemLayout\n */\nexport const useTreeItemLayout_unstable = (\n props: TreeItemLayoutProps,\n ref: React.Ref<HTMLElement>,\n): TreeItemLayoutState => {\n const { iconAfter, iconBefore, expandIcon, as = 'span', aside, actions } = props;\n\n const layoutRef = useTreeItemContext_unstable(ctx => ctx.layoutRef);\n const expandIconRef = useTreeItemContext_unstable(ctx => ctx.expandIconRef);\n const isActionsVisibleContext = useTreeItemContext_unstable(ctx => ctx.isActionsVisible);\n const isAsideVisible = useTreeItemContext_unstable(ctx => ctx.isAsideVisible);\n const isActionsVisible = (isResolvedShorthand(actions) ? actions.visible : undefined) ?? isActionsVisibleContext;\n const isBranch = useTreeItemContext_unstable(ctx => ctx.itemType === 'branch');\n const actionsRef = useMergedRefs(\n isResolvedShorthand(actions) ? actions.ref : undefined,\n useTreeItemContext_unstable(ctx => ctx.actionsRef),\n );\n\n return {\n components: {\n root: 'div',\n expandIcon: 'div',\n iconBefore: 'div',\n iconAfter: 'div',\n actions: 'div',\n aside: 'div',\n },\n buttonContextValue: { size: 'small' },\n root: getNativeElementProps(as, { ...props, ref: useMergedRefs(ref, layoutRef) }),\n iconBefore: resolveShorthand(iconBefore, { defaultProps: { 'aria-hidden': true } }),\n iconAfter: resolveShorthand(iconAfter, { defaultProps: { 'aria-hidden': true } }),\n aside: isAsideVisible ? resolveShorthand(aside) : undefined,\n actions: isActionsVisible\n ? resolveShorthand<ExtractSlotProps<TreeItemLayoutSlots['actions']>>(\n // visible props should not be propagated to the DOM\n isResolvedShorthand(actions) ? { ...actions, visible: undefined } : actions,\n {\n defaultProps: { ref: actionsRef },\n },\n )\n : undefined,\n expandIcon: resolveShorthand(expandIcon, {\n required: isBranch,\n defaultProps: {\n children: <TreeItemChevron />,\n 'aria-hidden': true,\n ref: useMergedRefs(isResolvedShorthand(expandIcon) ? expandIcon.ref : undefined, expandIconRef),\n },\n }),\n };\n};\n"],"names":["React","getNativeElementProps","isResolvedShorthand","resolveShorthand","useMergedRefs","useTreeItemContext_unstable","TreeItemChevron","useTreeItemLayout_unstable","props","ref","iconAfter","iconBefore","expandIcon","as","aside","actions","layoutRef","ctx","expandIconRef","isActionsVisibleContext","isActionsVisible","isAsideVisible","visible","undefined","isBranch","itemType","actionsRef","components","root","buttonContextValue","size","defaultProps","required","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAEEC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,EAChBC,aAAa,QACR,4BAA4B;AAEnC,SAASC,2BAA2B,QAAQ,iCAAiC;AAC7E,SAASC,eAAe,QAAQ,qBAAqB;AAErD;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC,MACwB;IACxB,MAAM,EAAEC,UAAS,EAAEC,WAAU,EAAEC,WAAU,EAAEC,IAAK,OAAM,EAAEC,MAAK,EAAEC,QAAO,EAAE,GAAGP;IAE3E,MAAMQ,YAAYX,4BAA4BY,CAAAA,MAAOA,IAAID,SAAS;IAClE,MAAME,gBAAgBb,4BAA4BY,CAAAA,MAAOA,IAAIC,aAAa;IAC1E,MAAMC,0BAA0Bd,4BAA4BY,CAAAA,MAAOA,IAAIG,gBAAgB;IACvF,MAAMC,iBAAiBhB,4BAA4BY,CAAAA,MAAOA,IAAII,cAAc;QAClDnB;IAA1B,MAAMkB,mBAAmB,CAAClB,OAAAA,oBAAoBa,WAAWA,QAAQO,OAAO,GAAGC,SAAS,cAA1DrB,kBAAAA,OAA+DiB,uBAAuB;IAChH,MAAMK,WAAWnB,4BAA4BY,CAAAA,MAAOA,IAAIQ,QAAQ,KAAK;IACrE,MAAMC,aAAatB,cACjBF,oBAAoBa,WAAWA,QAAQN,GAAG,GAAGc,SAAS,EACtDlB,4BAA4BY,CAAAA,MAAOA,IAAIS,UAAU;IAGnD,OAAO;QACLC,YAAY;YACVC,MAAM;YACNhB,YAAY;YACZD,YAAY;YACZD,WAAW;YACXK,SAAS;YACTD,OAAO;QACT;QACAe,oBAAoB;YAAEC,MAAM;QAAQ;QACpCF,MAAM3B,sBAAsBY,IAAI;YAAE,GAAGL,KAAK;YAAEC,KAAKL,cAAcK,KAAKO;QAAW;QAC/EL,YAAYR,iBAAiBQ,YAAY;YAAEoB,cAAc;gBAAE,eAAe,IAAI;YAAC;QAAE;QACjFrB,WAAWP,iBAAiBO,WAAW;YAAEqB,cAAc;gBAAE,eAAe,IAAI;YAAC;QAAE;QAC/EjB,OAAOO,iBAAiBlB,iBAAiBW,SAASS,SAAS;QAC3DR,SAASK,mBACLjB,iBACE,oDAAoD;QACpDD,oBAAoBa,WAAW;YAAE,GAAGA,OAAO;YAAEO,SAASC;QAAU,IAAIR,OAAO,EAC3E;YACEgB,cAAc;gBAAEtB,KAAKiB;YAAW;QAClC,KAEFH,SAAS;QACbX,YAAYT,iBAAiBS,YAAY;YACvCoB,UAAUR;YACVO,cAAc;gBACZE,wBAAU,oBAAC3B;gBACX,eAAe,IAAI;gBACnBG,KAAKL,cAAcF,oBAAoBU,cAAcA,WAAWH,GAAG,GAAGc,SAAS,EAAEL;YACnF;QACF;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
import { useTreeContext_unstable } from '../../contexts/treeContext';
|
|
4
|
+
import { treeItemLevelToken } from '../../utils/tokens';
|
|
5
|
+
import { useTreeItemContext_unstable } from '../../contexts/treeItemContext';
|
|
6
|
+
export const treeItemLayoutClassNames = {
|
|
7
|
+
root: 'fui-TreeItemLayout',
|
|
8
|
+
iconBefore: 'fui-TreeItemLayout__iconBefore',
|
|
9
|
+
iconAfter: 'fui-TreeItemLayout__iconAfter',
|
|
10
|
+
expandIcon: 'fui-TreeItemLayout__expandIcon',
|
|
11
|
+
aside: 'fui-TreeItemLayout__aside',
|
|
12
|
+
actions: 'fui-TreeItemLayout__actions'
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Styles for the root slot
|
|
16
|
+
*/
|
|
17
|
+
const useRootStyles = /*#__PURE__*/__styles({
|
|
18
|
+
base: {
|
|
19
|
+
mc9l5x: "f22iagw",
|
|
20
|
+
Bt984gj: "f122n59",
|
|
21
|
+
sshi5w: "f1nxs5xn",
|
|
22
|
+
B7ck84d: "f1ewtqcl",
|
|
23
|
+
Ijaq50: "f15ws6j",
|
|
24
|
+
Br312pm: "f135tdbu",
|
|
25
|
+
nk6f5a: "f2e2169",
|
|
26
|
+
Bw0ie65: "f4rqp6x",
|
|
27
|
+
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
|
28
|
+
Beyfa6y: ["f16jpd5f", "f1aa9q02"],
|
|
29
|
+
B7oj6ja: ["f1jar5jt", "fyu767a"],
|
|
30
|
+
Btl43ni: ["fyu767a", "f1jar5jt"],
|
|
31
|
+
lj723h: "flvvhsy",
|
|
32
|
+
ecr2s2: "f1wfn5kd",
|
|
33
|
+
qya0sb: "f1ih54s9",
|
|
34
|
+
Bi91k9c: "fnwyq0v",
|
|
35
|
+
Jwef8y: "f1t94bn6",
|
|
36
|
+
Becwuud: "f1jk1nfw"
|
|
37
|
+
},
|
|
38
|
+
leaf: {
|
|
39
|
+
uwmqm3: ["f1k1erfc", "faevyjx"]
|
|
40
|
+
},
|
|
41
|
+
branch: {
|
|
42
|
+
uwmqm3: ["fo100m9", "f6yw3pu"]
|
|
43
|
+
},
|
|
44
|
+
medium: {
|
|
45
|
+
i8kkvl: "f1rjii52",
|
|
46
|
+
Bahqtrf: "fk6fouc",
|
|
47
|
+
Be2twd7: "fkhj508",
|
|
48
|
+
Bhrd7zp: "figsok6",
|
|
49
|
+
Bg96gwp: "f1i3iumi"
|
|
50
|
+
},
|
|
51
|
+
small: {
|
|
52
|
+
i8kkvl: "f1ufnopg",
|
|
53
|
+
sshi5w: "f1pha7fy",
|
|
54
|
+
Bahqtrf: "fk6fouc",
|
|
55
|
+
Be2twd7: "fy9rknc",
|
|
56
|
+
Bhrd7zp: "figsok6",
|
|
57
|
+
Bg96gwp: "fwrc4pm"
|
|
58
|
+
},
|
|
59
|
+
subtle: {},
|
|
60
|
+
"subtle-alpha": {
|
|
61
|
+
Jwef8y: "f146ro5n",
|
|
62
|
+
ecr2s2: "fkam630"
|
|
63
|
+
},
|
|
64
|
+
transparent: {
|
|
65
|
+
De3pzq: "f1c21dwh",
|
|
66
|
+
Jwef8y: "fjxutwb",
|
|
67
|
+
ecr2s2: "fophhak"
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f1nxs5xn{min-height:32px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f15ws6j{grid-row-start:layout;}", ".f135tdbu{grid-column-start:layout;}", ".f2e2169{grid-row-end:layout;}", ".f4rqp6x{grid-column-end:layout;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1k1erfc{padding-left:calc(var(--fluent-TreeItem--level, 1) * var(--spacingHorizontalXXL));}", ".faevyjx{padding-right:calc(var(--fluent-TreeItem--level, 1) * var(--spacingHorizontalXXL));}", ".fo100m9{padding-left:calc((var(--fluent-TreeItem--level, 1) - 1) * var(--spacingHorizontalXXL));}", ".f6yw3pu{padding-right:calc((var(--fluent-TreeItem--level, 1) - 1) * var(--spacingHorizontalXXL));}", ".f1rjii52{-webkit-column-gap:var(--spacingHorizontalSNudge);column-gap:var(--spacingHorizontalSNudge);}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".f1ufnopg{-webkit-column-gap:var(--spacingHorizontalXS);column-gap:var(--spacingHorizontalXS);}", ".f1pha7fy{min-height:24px;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}"],
|
|
71
|
+
a: [".flvvhsy:active{color:var(--colorNeutralForeground2Pressed);}", ".f1wfn5kd:active{background-color:var(--colorSubtleBackgroundPressed);}", ".f1ih54s9:active .fui-TreeItemLayout__expandIcon{color:var(--colorNeutralForeground3Pressed);}", ".fkam630:active{background-color:var(--colorSubtleBackgroundLightAlphaPressed);}", ".fophhak:active{background-color:var(--colorTransparentBackgroundPressed);}"],
|
|
72
|
+
h: [".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".f1t94bn6:hover{background-color:var(--colorSubtleBackgroundHover);}", ".f1jk1nfw:hover .fui-TreeItemLayout__expandIcon{color:var(--colorNeutralForeground3Hover);}", ".f146ro5n:hover{background-color:var(--colorSubtleBackgroundLightAlphaHover);}", ".fjxutwb:hover{background-color:var(--colorTransparentBackgroundHover);}"]
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Styles for the before/after icon slot
|
|
76
|
+
*/
|
|
77
|
+
const useIconStyles = /*#__PURE__*/__styles({
|
|
78
|
+
base: {
|
|
79
|
+
mc9l5x: "f22iagw",
|
|
80
|
+
Bt984gj: "f122n59",
|
|
81
|
+
sj55zd: "fkfq4zb",
|
|
82
|
+
Bg96gwp: "f106mvju",
|
|
83
|
+
Be2twd7: "f1pp30po"
|
|
84
|
+
},
|
|
85
|
+
iconBefore: {},
|
|
86
|
+
iconAfter: {}
|
|
87
|
+
}, {
|
|
88
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f106mvju{line-height:var(--lineHeightBase500);}", ".f1pp30po{font-size:var(--fontSizeBase500);}"]
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Styles for the action icon slot
|
|
92
|
+
*/
|
|
93
|
+
const useActionsStyles = /*#__PURE__*/__styles({
|
|
94
|
+
base: {
|
|
95
|
+
mc9l5x: "f22iagw",
|
|
96
|
+
Frg6f3: ["fcgxt0o", "f1ujusj6"],
|
|
97
|
+
qhf8xq: "f10pi13n",
|
|
98
|
+
Bj3rh1h: "f19g0ac",
|
|
99
|
+
Ijaq50: "fobksn0",
|
|
100
|
+
Br312pm: "fmy5l6f",
|
|
101
|
+
nk6f5a: "fzqypwc",
|
|
102
|
+
Bw0ie65: "f1tmftl3",
|
|
103
|
+
z8tnut: "f1g0x7ka",
|
|
104
|
+
z189sj: ["f1vdfbxk", "f1f5gg8d"],
|
|
105
|
+
Byoj8tv: "f1qch9an",
|
|
106
|
+
uwmqm3: ["f1f5gg8d", "f1vdfbxk"]
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f10pi13n{position:relative;}", ".f19g0ac{z-index:1;}", ".fobksn0{grid-row-start:aside;}", ".fmy5l6f{grid-column-start:aside;}", ".fzqypwc{grid-row-end:aside;}", ".f1tmftl3{grid-column-end:aside;}", ".f1g0x7ka{padding-top:0;}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f1qch9an{padding-bottom:0;}"]
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Styles for the action icon slot
|
|
113
|
+
*/
|
|
114
|
+
const useAsideStyles = /*#__PURE__*/__styles({
|
|
115
|
+
base: {
|
|
116
|
+
mc9l5x: "f22iagw",
|
|
117
|
+
Frg6f3: ["fcgxt0o", "f1ujusj6"],
|
|
118
|
+
Bt984gj: "f122n59",
|
|
119
|
+
Bj3rh1h: "f11zp4z2",
|
|
120
|
+
Ijaq50: "fobksn0",
|
|
121
|
+
Br312pm: "fmy5l6f",
|
|
122
|
+
nk6f5a: "fzqypwc",
|
|
123
|
+
Bw0ie65: "f1tmftl3",
|
|
124
|
+
z8tnut: "f1g0x7ka",
|
|
125
|
+
z189sj: ["fw5db7e", "f1uw59to"],
|
|
126
|
+
Byoj8tv: "f1qch9an",
|
|
127
|
+
uwmqm3: ["f1uw59to", "fw5db7e"],
|
|
128
|
+
i8kkvl: "f1ufnopg",
|
|
129
|
+
Belr9w4: "f14sijuj"
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fcgxt0o{margin-left:auto;}", ".f1ujusj6{margin-right:auto;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f11zp4z2{z-index:0;}", ".fobksn0{grid-row-start:aside;}", ".fmy5l6f{grid-column-start:aside;}", ".fzqypwc{grid-row-end:aside;}", ".f1tmftl3{grid-column-end:aside;}", ".f1g0x7ka{padding-top:0;}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".f1qch9an{padding-bottom:0;}", ".f1ufnopg{-webkit-column-gap:var(--spacingHorizontalXS);column-gap:var(--spacingHorizontalXS);}", ".f14sijuj{row-gap:var(--spacingHorizontalXS);}"]
|
|
133
|
+
});
|
|
134
|
+
/**
|
|
135
|
+
* Styles for the expand icon slot
|
|
136
|
+
*/
|
|
137
|
+
const useExpandIconStyles = /*#__PURE__*/__styles({
|
|
138
|
+
base: {
|
|
139
|
+
mc9l5x: "f22iagw",
|
|
140
|
+
Bt984gj: "f122n59",
|
|
141
|
+
Brf1p80: "f4d9j23",
|
|
142
|
+
Bf4jedk: "f17fgpbq",
|
|
143
|
+
B7ck84d: "f1ewtqcl",
|
|
144
|
+
sj55zd: "f11d4kpn",
|
|
145
|
+
Bh6795r: "f1jhi6b8",
|
|
146
|
+
Bnnss6s: "fi64zpg",
|
|
147
|
+
xawz: "f1rmlqtg",
|
|
148
|
+
z8tnut: "f1ywm7hm",
|
|
149
|
+
z189sj: ["fhxju0i", "f1cnd47f"],
|
|
150
|
+
Byoj8tv: "f14wxoun",
|
|
151
|
+
uwmqm3: ["f1cnd47f", "fhxju0i"]
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
d: [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f17fgpbq{min-width:24px;}", ".f1ewtqcl{box-sizing:border-box;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f1jhi6b8{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;}", ".fi64zpg{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", ".f1rmlqtg{-webkit-flex-basis:auto;-ms-flex-preferred-size:auto;flex-basis:auto;}", ".f1ywm7hm{padding-top:var(--spacingVerticalXS);}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f14wxoun{padding-bottom:var(--spacingVerticalXS);}"]
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Apply styling to the TreeItemLayout slots based on the state
|
|
158
|
+
*/
|
|
159
|
+
export const useTreeItemLayoutStyles_unstable = state => {
|
|
160
|
+
const {
|
|
161
|
+
iconAfter,
|
|
162
|
+
iconBefore,
|
|
163
|
+
root
|
|
164
|
+
} = state;
|
|
165
|
+
const rootStyles = useRootStyles();
|
|
166
|
+
const iconStyles = useIconStyles();
|
|
167
|
+
const actionsStyles = useActionsStyles();
|
|
168
|
+
const asideStyles = useAsideStyles();
|
|
169
|
+
const expandIconStyles = useExpandIconStyles();
|
|
170
|
+
const size = useTreeContext_unstable(ctx => ctx.size);
|
|
171
|
+
const appearance = useTreeContext_unstable(ctx => ctx.appearance);
|
|
172
|
+
const itemType = useTreeItemContext_unstable(ctx => ctx.itemType);
|
|
173
|
+
root.className = mergeClasses(treeItemLayoutClassNames.root, rootStyles.base, rootStyles[appearance], rootStyles[size], rootStyles[itemType], root.className);
|
|
174
|
+
if (iconBefore) {
|
|
175
|
+
iconBefore.className = mergeClasses(treeItemLayoutClassNames.iconBefore, iconStyles.base, iconStyles.iconBefore, iconBefore.className);
|
|
176
|
+
}
|
|
177
|
+
if (iconAfter) {
|
|
178
|
+
iconAfter.className = mergeClasses(treeItemLayoutClassNames.iconAfter, iconStyles.base, iconStyles.iconAfter, iconAfter.className);
|
|
179
|
+
}
|
|
180
|
+
if (state.actions) {
|
|
181
|
+
state.actions.className = mergeClasses(treeItemLayoutClassNames.actions, actionsStyles.base, state.actions.className);
|
|
182
|
+
}
|
|
183
|
+
if (state.aside) {
|
|
184
|
+
state.aside.className = mergeClasses(treeItemLayoutClassNames.aside, asideStyles.base, state.aside.className);
|
|
185
|
+
}
|
|
186
|
+
if (state.expandIcon) {
|
|
187
|
+
state.expandIcon.className = mergeClasses(treeItemLayoutClassNames.expandIcon, expandIconStyles.base, state.expandIcon.className);
|
|
188
|
+
}
|
|
189
|
+
return state;
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=useTreeItemLayoutStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","useTreeContext_unstable","treeItemLevelToken","useTreeItemContext_unstable","treeItemLayoutClassNames","root","iconBefore","iconAfter","expandIcon","aside","actions","useRootStyles","base","mc9l5x","Bt984gj","sshi5w","B7ck84d","Ijaq50","Br312pm","nk6f5a","Bw0ie65","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","lj723h","ecr2s2","qya0sb","Bi91k9c","Jwef8y","Becwuud","leaf","uwmqm3","branch","medium","i8kkvl","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","small","subtle","transparent","De3pzq","d","a","h","useIconStyles","sj55zd","useActionsStyles","Frg6f3","qhf8xq","Bj3rh1h","z8tnut","z189sj","Byoj8tv","useAsideStyles","Belr9w4","useExpandIconStyles","Brf1p80","Bf4jedk","Bh6795r","Bnnss6s","xawz","useTreeItemLayoutStyles_unstable","state","rootStyles","iconStyles","actionsStyles","asideStyles","expandIconStyles","size","ctx","appearance","itemType","className"],"sources":["useTreeItemLayoutStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { useTreeContext_unstable } from '../../contexts/treeContext';\nimport { treeItemLevelToken } from '../../utils/tokens';\nimport { useTreeItemContext_unstable } from '../../contexts/treeItemContext';\nexport const treeItemLayoutClassNames = {\n root: 'fui-TreeItemLayout',\n iconBefore: 'fui-TreeItemLayout__iconBefore',\n iconAfter: 'fui-TreeItemLayout__iconAfter',\n expandIcon: 'fui-TreeItemLayout__expandIcon',\n aside: 'fui-TreeItemLayout__aside',\n actions: 'fui-TreeItemLayout__actions'\n};\n/**\n * Styles for the root slot\n */ const useRootStyles = makeStyles({\n base: {\n display: 'flex',\n alignItems: 'center',\n minHeight: '32px',\n boxSizing: 'border-box',\n ...shorthands.gridArea('layout'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n ':active': {\n color: tokens.colorNeutralForeground2Pressed,\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n // TODO: stop using treeItemLayoutClassNames.expandIcon for styling\n [`& .${treeItemLayoutClassNames.expandIcon}`]: {\n color: tokens.colorNeutralForeground3Pressed\n }\n },\n ':hover': {\n color: tokens.colorNeutralForeground2Hover,\n backgroundColor: tokens.colorSubtleBackgroundHover,\n // TODO: stop using treeItemLayoutClassNames.expandIcon for styling\n [`& .${treeItemLayoutClassNames.expandIcon}`]: {\n color: tokens.colorNeutralForeground3Hover\n }\n }\n },\n leaf: {\n paddingLeft: `calc(var(${treeItemLevelToken}, 1) * ${tokens.spacingHorizontalXXL})`\n },\n branch: {\n paddingLeft: `calc((var(${treeItemLevelToken}, 1) - 1) * ${tokens.spacingHorizontalXXL})`\n },\n medium: {\n columnGap: tokens.spacingHorizontalSNudge,\n ...typographyStyles.body1\n },\n small: {\n columnGap: tokens.spacingHorizontalXS,\n minHeight: '24px',\n ...typographyStyles.caption1\n },\n // Appearance variations\n subtle: {},\n 'subtle-alpha': {\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundLightAlphaHover\n },\n ':active': {\n backgroundColor: tokens.colorSubtleBackgroundLightAlphaPressed\n }\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover\n },\n ':active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed\n }\n }\n});\n/**\n * Styles for the before/after icon slot\n */ const useIconStyles = makeStyles({\n base: {\n display: 'flex',\n alignItems: 'center',\n color: tokens.colorNeutralForeground2,\n lineHeight: tokens.lineHeightBase500,\n fontSize: tokens.fontSizeBase500\n },\n iconBefore: {},\n iconAfter: {}\n});\n/**\n * Styles for the action icon slot\n */ const useActionsStyles = makeStyles({\n base: {\n display: 'flex',\n marginLeft: 'auto',\n position: 'relative',\n zIndex: 1,\n ...shorthands.gridArea('aside'),\n ...shorthands.padding(0, tokens.spacingHorizontalS)\n }\n});\n/**\n * Styles for the action icon slot\n */ const useAsideStyles = makeStyles({\n base: {\n display: 'flex',\n marginLeft: 'auto',\n alignItems: 'center',\n zIndex: 0,\n ...shorthands.gridArea('aside'),\n ...shorthands.padding(0, tokens.spacingHorizontalM),\n ...shorthands.gap(tokens.spacingHorizontalXS)\n }\n});\n/**\n * Styles for the expand icon slot\n */ const useExpandIconStyles = makeStyles({\n base: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minWidth: '24px',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground3,\n ...shorthands.flex(0, 0, 'auto'),\n ...shorthands.padding(tokens.spacingVerticalXS, 0)\n }\n});\n/**\n * Apply styling to the TreeItemLayout slots based on the state\n */ export const useTreeItemLayoutStyles_unstable = (state)=>{\n const { iconAfter , iconBefore , root } = state;\n const rootStyles = useRootStyles();\n const iconStyles = useIconStyles();\n const actionsStyles = useActionsStyles();\n const asideStyles = useAsideStyles();\n const expandIconStyles = useExpandIconStyles();\n const size = useTreeContext_unstable((ctx)=>ctx.size);\n const appearance = useTreeContext_unstable((ctx)=>ctx.appearance);\n const itemType = useTreeItemContext_unstable((ctx)=>ctx.itemType);\n root.className = mergeClasses(treeItemLayoutClassNames.root, rootStyles.base, rootStyles[appearance], rootStyles[size], rootStyles[itemType], root.className);\n if (iconBefore) {\n iconBefore.className = mergeClasses(treeItemLayoutClassNames.iconBefore, iconStyles.base, iconStyles.iconBefore, iconBefore.className);\n }\n if (iconAfter) {\n iconAfter.className = mergeClasses(treeItemLayoutClassNames.iconAfter, iconStyles.base, iconStyles.iconAfter, iconAfter.className);\n }\n if (state.actions) {\n state.actions.className = mergeClasses(treeItemLayoutClassNames.actions, actionsStyles.base, state.actions.className);\n }\n if (state.aside) {\n state.aside.className = mergeClasses(treeItemLayoutClassNames.aside, asideStyles.base, state.aside.className);\n }\n if (state.expandIcon) {\n state.expandIcon.className = mergeClasses(treeItemLayoutClassNames.expandIcon, expandIconStyles.base, state.expandIcon.className);\n }\n return state;\n};\n"],"mappings":"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"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useTreeItemPersonaLayout_unstable } from './useTreeItemPersonaLayout';
|
|
3
3
|
import { renderTreeItemPersonaLayout_unstable } from './renderTreeItemPersonaLayout';
|
|
4
|
-
import { useTreeItemPersonaLayoutStyles_unstable } from './useTreeItemPersonaLayoutStyles';
|
|
4
|
+
import { useTreeItemPersonaLayoutStyles_unstable } from './useTreeItemPersonaLayoutStyles.styles';
|
|
5
5
|
import { useTreeItemPersonaLayoutContextValues_unstable } from './useTreeItemPersonaLayoutContextValues';
|
|
6
6
|
/**
|
|
7
|
-
* TreeItemPersonaLayout component
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
* The `TreeItemPersonaLayout` component is used as a child of `TreeItem` to display a `TreeItem` with a media (typically an avatar) and a description.
|
|
8
|
+
* It provides a more visually appealing representation of a `TreeItem` and is typically used to display a list of people or topics.
|
|
9
|
+
* This component should only be used as a direct child of `TreeItem`.
|
|
10
|
+
*/ export const TreeItemPersonaLayout = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
11
|
+
const state = useTreeItemPersonaLayout_unstable(props, ref);
|
|
12
|
+
useTreeItemPersonaLayoutStyles_unstable(state);
|
|
13
|
+
const contextValues = useTreeItemPersonaLayoutContextValues_unstable(state);
|
|
14
|
+
return renderTreeItemPersonaLayout_unstable(state, contextValues);
|
|
14
15
|
});
|
|
15
16
|
TreeItemPersonaLayout.displayName = 'TreeItemPersonaLayout';
|
|
16
|
-
//# sourceMappingURL=TreeItemPersonaLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["TreeItemPersonaLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useTreeItemPersonaLayout_unstable } from './useTreeItemPersonaLayout';\nimport { renderTreeItemPersonaLayout_unstable } from './renderTreeItemPersonaLayout';\nimport { useTreeItemPersonaLayoutStyles_unstable } from './useTreeItemPersonaLayoutStyles.styles';\nimport type { TreeItemPersonaLayoutProps } from './TreeItemPersonaLayout.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useTreeItemPersonaLayoutContextValues_unstable } from './useTreeItemPersonaLayoutContextValues';\n\n/**\n * The `TreeItemPersonaLayout` component is used as a child of `TreeItem` to display a `TreeItem` with a media (typically an avatar) and a description.\n * It provides a more visually appealing representation of a `TreeItem` and is typically used to display a list of people or topics.\n * This component should only be used as a direct child of `TreeItem`.\n */\nexport const TreeItemPersonaLayout: ForwardRefComponent<TreeItemPersonaLayoutProps> = React.forwardRef((props, ref) => {\n const state = useTreeItemPersonaLayout_unstable(props, ref);\n\n useTreeItemPersonaLayoutStyles_unstable(state);\n\n const contextValues = useTreeItemPersonaLayoutContextValues_unstable(state);\n\n return renderTreeItemPersonaLayout_unstable(state, contextValues);\n});\n\nTreeItemPersonaLayout.displayName = 'TreeItemPersonaLayout';\n"],"names":["React","useTreeItemPersonaLayout_unstable","renderTreeItemPersonaLayout_unstable","useTreeItemPersonaLayoutStyles_unstable","useTreeItemPersonaLayoutContextValues_unstable","TreeItemPersonaLayout","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iCAAiC,QAAQ,6BAA6B;AAC/E,SAASC,oCAAoC,QAAQ,gCAAgC;AACrF,SAASC,uCAAuC,QAAQ,0CAA0C;AAGlG,SAASC,8CAA8C,QAAQ,0CAA0C;AAEzG;;;;CAIC,GACD,OAAO,MAAMC,sCAAyEL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACrH,MAAMC,QAAQR,kCAAkCM,OAAOC;IAEvDL,wCAAwCM;IAExC,MAAMC,gBAAgBN,+CAA+CK;IAErE,OAAOP,qCAAqCO,OAAOC;AACrD,GAAG;AAEHL,sBAAsBM,WAAW,GAAG"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=TreeItemPersonaLayout.types.js.map
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["TreeItemPersonaLayout.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { AvatarContextValue, AvatarSize } from '@fluentui/react-avatar';\nimport { ButtonContextValue } from '@fluentui/react-button';\nimport { TreeItemLayoutSlots } from '../TreeItemLayout/TreeItemLayout.types';\n\nexport type TreeItemPersonaLayoutContextValues = {\n avatar: AvatarContextValue;\n};\n\nexport type TreeItemPersonaLayoutSlots = Pick<TreeItemLayoutSlots, 'actions' | 'aside' | 'expandIcon'> & {\n root: NonNullable<Slot<'div'>>;\n /**\n * Avatar to display.\n */\n media: NonNullable<Slot<'div'>>;\n /**\n * Main text. Children of the root slot are automatically rendered here\n */\n main: NonNullable<Slot<'div'>>;\n /**\n * Secondary text that describes or complements the main text\n */\n description?: Slot<'div'>;\n};\n\n/**\n * TreeItemPersonaLayout Props\n */\nexport type TreeItemPersonaLayoutProps = ComponentProps<Partial<TreeItemPersonaLayoutSlots>>;\n\n/**\n * State used in rendering TreeItemPersonaLayout\n */\nexport type TreeItemPersonaLayoutState = ComponentState<TreeItemPersonaLayoutSlots> & {\n avatarSize: AvatarSize;\n buttonContextValue: ButtonContextValue;\n};\n"],"names":[],"mappings":"AAAA,WAoCE"}
|
|
@@ -2,5 +2,4 @@ export * from './TreeItemPersonaLayout';
|
|
|
2
2
|
export * from './TreeItemPersonaLayout.types';
|
|
3
3
|
export * from './renderTreeItemPersonaLayout';
|
|
4
4
|
export * from './useTreeItemPersonaLayout';
|
|
5
|
-
export * from './useTreeItemPersonaLayoutStyles';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
5
|
+
export * from './useTreeItemPersonaLayoutStyles.styles';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './TreeItemPersonaLayout';\nexport * from './TreeItemPersonaLayout.types';\nexport * from './renderTreeItemPersonaLayout';\nexport * from './useTreeItemPersonaLayout';\nexport * from './useTreeItemPersonaLayoutStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,0BAA0B;AACxC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC;AAC9C,cAAc,6BAA6B;AAC3C,cAAc,0CAA0C"}
|
|
@@ -1,31 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
|
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
|
3
3
|
import { AvatarContextProvider } from '@fluentui/react-avatar';
|
|
4
|
+
import { ButtonContextProvider } from '@fluentui/react-button';
|
|
4
5
|
/**
|
|
5
6
|
* Render the final JSX of TreeItemPersonaLayout
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
slots,
|
|
13
|
-
slotProps
|
|
14
|
-
} = getSlots(state);
|
|
15
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
|
16
|
-
...slotProps.root
|
|
17
|
-
}, slots.media && /*#__PURE__*/React.createElement(AvatarContextProvider, {
|
|
18
|
-
value: contextValues.avatar
|
|
19
|
-
}, /*#__PURE__*/React.createElement(slots.media, {
|
|
20
|
-
...slotProps.media
|
|
21
|
-
})), slots.content && /*#__PURE__*/React.createElement(slots.content, {
|
|
22
|
-
...slotProps.content
|
|
23
|
-
}, slots.main && /*#__PURE__*/React.createElement(slots.main, {
|
|
24
|
-
...slotProps.main
|
|
25
|
-
}), slots.description && /*#__PURE__*/React.createElement(slots.description, {
|
|
26
|
-
...slotProps.description
|
|
27
|
-
})), !isActionsVisible && slots.aside && /*#__PURE__*/React.createElement(slots.aside, {
|
|
28
|
-
...slotProps.aside
|
|
29
|
-
}));
|
|
7
|
+
*/ export const renderTreeItemPersonaLayout_unstable = (state, contextValues)=>{
|
|
8
|
+
const { slots , slotProps } = getSlotsNext(state);
|
|
9
|
+
return /*#__PURE__*/ createElement(slots.root, slotProps.root, slots.expandIcon && /*#__PURE__*/ createElement(slots.expandIcon, slotProps.expandIcon), /*#__PURE__*/ createElement(AvatarContextProvider, {
|
|
10
|
+
value: contextValues.avatar
|
|
11
|
+
}, /*#__PURE__*/ createElement(slots.media, slotProps.media)), /*#__PURE__*/ createElement(slots.main, slotProps.main), slots.description && /*#__PURE__*/ createElement(slots.description, slotProps.description), /*#__PURE__*/ createElement(ButtonContextProvider, {
|
|
12
|
+
value: state.buttonContextValue
|
|
13
|
+
}, slots.actions && /*#__PURE__*/ createElement(slots.actions, slotProps.actions), slots.aside && /*#__PURE__*/ createElement(slots.aside, slotProps.aside)));
|
|
30
14
|
};
|
|
31
|
-
//# sourceMappingURL=renderTreeItemPersonaLayout.js.map
|