Skip to content

Commit

Permalink
Itiwnui-react upgrade (#794)
Browse files Browse the repository at this point in the history
* Bump itwinui-react

* Pass missing to `TreeNode`

* Do not clear unique value filter on value selected

* Use small tree in test-app

* Change
  • Loading branch information
saskliutas authored Nov 27, 2024
1 parent 65d15e8 commit 1b69393
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-carpets-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@itwin/presentation-hierarchies-react": patch
---

Add missing `ref` to the placeholder and error nodes to have correct styling in virtualized small tree.
5 changes: 5 additions & 0 deletions .changeset/thick-books-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@itwin/presentation-components": patch
---

Do not clear filter in `UniqueValuesSelector` when value is selected.
20 changes: 10 additions & 10 deletions apps/test-app/frontend/src/components/tree-widget/StatelessTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ function Tree({ imodel, imodelAccess, height, width }: { imodel: IModelConnectio
}

return (
<Flex.Item alignSelf="flex-start" style={{ width: "100%", overflow: "auto" }}>
<TreeRenderer
rootNodes={rootNodes ?? []}
{...treeProps}
reloadTree={reloadTree}
onFilterClick={setFilteringOptions}
getIcon={getIcon}
selectionMode={"extended"}
/>
</Flex.Item>
<TreeRenderer
{...treeProps}
rootNodes={rootNodes ?? []}
reloadTree={reloadTree}
onFilterClick={setFilteringOptions}
getIcon={getIcon}
selectionMode={"extended"}
size="small"
style={{ height: "100%", width: "100%" }}
/>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ export function UniquePropertyValuesSelector(props: UniquePropertyValuesSelector
}}
emptyStateMessage={emptyContent}
value={selectedValues}
clearFilterOnOptionToggle={false}
inputProps={{
placeholder: translate("unique-values-property-editor.select-values"),
size: "small",
value: searchInput,
onChange: (e) => setSearchInput(e.target.value),
}}
onHide={() => setSearchInput("")}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const TreeNodeRenderer: React.ForwardRefExoticComponent<TreeNodeRendererP
const nodeRef = useRef<HTMLDivElement>(null);
const ref = useMergedRefs(forwardedRef, nodeRef);
if ("type" in node && node.type === "ChildrenPlaceholder") {
return <PlaceholderNode {...treeNodeProps} />;
return <PlaceholderNode {...treeNodeProps} ref={ref} />;
}

if (isPresentationHierarchyNode(node)) {
Expand Down Expand Up @@ -143,6 +143,7 @@ export const TreeNodeRenderer: React.ForwardRefExoticComponent<TreeNodeRendererP
return (
<ResultSetTooLargeNode
{...treeNodeProps}
ref={ref}
limit={node.resultSetSizeLimit}
onOverrideLimit={getHierarchyLevelDetails ? (limit) => getHierarchyLevelDetails(node.parentNodeId)?.setSizeLimit(limit) : undefined}
onFilterClick={
Expand Down
26 changes: 13 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ catalogs:
itwinui:
"@itwin/itwinui-icons-react": "^2.9.0"
"@itwin/itwinui-illustrations-react": "^2.1.0"
"@itwin/itwinui-react": "^3.15.5"
"@itwin/itwinui-react": "^3.16.0"

react:
"classnames": "^2.5.1"
Expand Down

0 comments on commit 1b69393

Please sign in to comment.