@itwin/presentation-hierarchies-react 2.0.0-alpha.41 → 2.0.0-alpha.42
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.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @itwin/presentation-hierarchies-react
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.42
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1118](https://github.com/iTwin/presentation/pull/1118): Fixed first hidden inline action causing second action to be focused when navigating using keyboard.
|
|
8
|
+
|
|
3
9
|
## 2.0.0-alpha.41
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
|
@@ -26,11 +26,11 @@ import { DropdownMenu, Tree } from "@stratakit/structures";
|
|
|
26
26
|
*/
|
|
27
27
|
export const TreeActionBase = memo(function TreeActionBase({ hide, variant = "default", dot, visible, ...actionProps }) {
|
|
28
28
|
if (hide) {
|
|
29
|
-
return variant === "inline" ? _jsx(Tree.ItemAction, { ...actionProps, visible: false
|
|
29
|
+
return variant === "inline" ? _jsx(Tree.ItemAction, { ...actionProps, visible: false }) : undefined;
|
|
30
30
|
}
|
|
31
31
|
if (variant === "context-menu") {
|
|
32
32
|
return _jsx(DropdownMenu.Item, { ...actionProps });
|
|
33
33
|
}
|
|
34
|
-
return _jsx(Tree.ItemAction, { ...actionProps, dot: dot, visible: visible });
|
|
34
|
+
return _jsx(Tree.ItemAction, { ...actionProps, dot: dot, visible: variant === "inline" ? visible : undefined });
|
|
35
35
|
});
|
|
36
36
|
//# sourceMappingURL=TreeAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeAction.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/stratakit/TreeAction.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAEhG,OAAO,EAAkB,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA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,CAAC,CAAC,SAAS,GAAI,CAAC;AAC7G,CAAC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ComponentProps, memo } from \"react\";\nimport { DropdownMenu, Tree } from \"@stratakit/structures\";\n\n/**\n * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context\n * where that action is used.\n * @alpha\n */\nexport interface TreeActionBaseAttributes {\n /**\n * Specifies action variant supported by tree nodes:\n *\n * - \"default\" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node.\n * - \"inline\" - actions displayed directly on the tree node.\n * - \"context-menu\" - actions displayed in the context menu opened by right-clicking the tree node.\n */\n variant?: \"default\" | \"inline\" | \"context-menu\";\n /**\n * Indicates that the actions is not applicable for current tree node and should be hidden.\n * When set to true, the action will not be rendered at all.\n */\n hide?: boolean;\n}\n\n/** @alpha */\nexport type TreeActionBaseProps = ComponentProps<typeof Tree.ItemAction> & TreeActionBaseAttributes;\n\n/**\n * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu.\n * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks.\n *\n * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example:\n *\n * ```tsx\n * interface MyCustomTreeActionProps extends TreeActionBaseAttributes {\n * myProp: string\n * }\n *\n * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) {\n * // custom button logic goes here\n * return <TreeActionBase {...attributes} icon={...} onClick={...} />\n * }\n * ```\n *\n * @alpha\n */\nexport const TreeActionBase = memo(function TreeActionBase({ hide, variant = \"default\", dot, visible, ...actionProps }: TreeActionBaseProps) {\n if (hide) {\n return variant === \"inline\" ? <Tree.ItemAction {...actionProps} visible={false} /> : undefined;\n }\n\n if (variant === \"context-menu\") {\n return <DropdownMenu.Item {...actionProps} />;\n }\n\n return <Tree.ItemAction {...actionProps} dot={dot} visible={variant === \"inline\" ? visible : undefined} />;\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/presentation-hierarchies-react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.42",
|
|
4
4
|
"description": "React components based on `@itwin/presentation-hierarchies`",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"immer": "^10.2.0",
|
|
44
44
|
"react-error-boundary": "^4.1.2",
|
|
45
45
|
"rxjs": "^7.8.2",
|
|
46
|
+
"@itwin/presentation-hierarchies": "^2.0.0-alpha.5",
|
|
46
47
|
"@itwin/presentation-shared": "^2.0.0-alpha.3",
|
|
47
|
-
"@itwin/unified-selection": "^1.6.2-alpha.0"
|
|
48
|
-
"@itwin/presentation-hierarchies": "^2.0.0-alpha.5"
|
|
48
|
+
"@itwin/unified-selection": "^1.6.2-alpha.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@stratakit/bricks": "^0.5",
|