@itwin/presentation-hierarchies-react 1.9.12 → 1.10.0
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 +48 -12
- package/README.md +15 -9
- package/lib/cjs/presentation-hierarchies-react/LocalizationContext.d.ts.map +1 -0
- package/lib/cjs/presentation-hierarchies-react/LocalizationContext.js.map +1 -0
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeNodeRenderer.css +6 -6
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js +1 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js.map +1 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts +1 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts.map +1 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeRenderer.js +1 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/TreeRenderer.js.map +1 -1
- package/lib/cjs/presentation-hierarchies-react-core.d.ts +9 -0
- package/lib/cjs/presentation-hierarchies-react-core.d.ts.map +1 -0
- package/lib/cjs/presentation-hierarchies-react-core.js +26 -0
- package/lib/cjs/presentation-hierarchies-react-core.js.map +1 -0
- package/lib/cjs/presentation-hierarchies-react-itwinui.d.ts +3 -0
- package/lib/cjs/presentation-hierarchies-react-itwinui.d.ts.map +1 -0
- package/lib/cjs/presentation-hierarchies-react-itwinui.js +13 -0
- package/lib/cjs/presentation-hierarchies-react-itwinui.js.map +1 -0
- package/lib/cjs/presentation-hierarchies-react.d.ts +2 -10
- package/lib/cjs/presentation-hierarchies-react.d.ts.map +1 -1
- package/lib/cjs/presentation-hierarchies-react.js +16 -24
- package/lib/cjs/presentation-hierarchies-react.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/LocalizationContext.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react/LocalizationContext.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.css +6 -6
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js +1 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeNodeRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts +1 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.js +1 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/TreeRenderer.js.map +1 -1
- package/lib/esm/presentation-hierarchies-react-core.d.ts +9 -0
- package/lib/esm/presentation-hierarchies-react-core.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react-core.js +13 -0
- package/lib/esm/presentation-hierarchies-react-core.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react-itwinui.d.ts +3 -0
- package/lib/esm/presentation-hierarchies-react-itwinui.d.ts.map +1 -0
- package/lib/esm/presentation-hierarchies-react-itwinui.js +7 -0
- package/lib/esm/presentation-hierarchies-react-itwinui.js.map +1 -0
- package/lib/esm/presentation-hierarchies-react.d.ts +2 -10
- package/lib/esm/presentation-hierarchies-react.d.ts.map +1 -1
- package/lib/esm/presentation-hierarchies-react.js +2 -10
- package/lib/esm/presentation-hierarchies-react.js.map +1 -1
- package/package.json +16 -8
- package/lib/cjs/presentation-hierarchies-react/itwinui/LocalizationContext.d.ts.map +0 -1
- package/lib/cjs/presentation-hierarchies-react/itwinui/LocalizationContext.js.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies-react/itwinui/LocalizationContext.js.map +0 -1
- /package/lib/cjs/presentation-hierarchies-react/{itwinui/LocalizationContext.d.ts → LocalizationContext.d.ts} +0 -0
- /package/lib/cjs/presentation-hierarchies-react/{itwinui/LocalizationContext.js → LocalizationContext.js} +0 -0
- /package/lib/esm/presentation-hierarchies-react/{itwinui/LocalizationContext.d.ts → LocalizationContext.d.ts} +0 -0
- /package/lib/esm/presentation-hierarchies-react/{itwinui/LocalizationContext.js → LocalizationContext.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @itwin/presentation-hierarchies-react
|
|
2
2
|
|
|
3
|
+
## 1.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1258](https://github.com/iTwin/presentation/pull/1258): Introduced new import paths: `@itwin/presentation-hierarchies-react/core` and `@itwin/presentation-hierarchies-react/itwinui`. They should allow to use this package without `@itwin/itwinui-react` dependency.
|
|
8
|
+
|
|
9
|
+
## 1.9.13
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1242](https://github.com/iTwin/presentation/pull/1242): Bump dependencies.
|
|
14
|
+
- [#1252](https://github.com/iTwin/presentation/pull/1252): Fix tree node outline not appearing on touch devices.
|
|
15
|
+
- Updated dependencies:
|
|
16
|
+
- @itwin/presentation-hierarchies@1.7.11
|
|
17
|
+
- @itwin/presentation-shared@1.2.10
|
|
18
|
+
- @itwin/unified-selection@1.6.8
|
|
19
|
+
|
|
3
20
|
## 1.9.12
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -128,9 +145,17 @@
|
|
|
128
145
|
|
|
129
146
|
const treeState = useUnifiedSelectionTree({
|
|
130
147
|
selectionStorage,
|
|
131
|
-
createSelectableForGenericNode: useCallback<
|
|
132
|
-
|
|
133
|
-
|
|
148
|
+
createSelectableForGenericNode: useCallback<
|
|
149
|
+
NonNullable<
|
|
150
|
+
Props<typeof useUnifiedSelectionTree>["createSelectableForGenericNode"]
|
|
151
|
+
>
|
|
152
|
+
>(
|
|
153
|
+
(node, uniqueId) => ({
|
|
154
|
+
identifier: node.key.id,
|
|
155
|
+
data: node,
|
|
156
|
+
async *loadInstanceKeys() {},
|
|
157
|
+
}),
|
|
158
|
+
[]
|
|
134
159
|
),
|
|
135
160
|
// ...other options
|
|
136
161
|
});
|
|
@@ -237,6 +262,7 @@
|
|
|
237
262
|
### Minor Changes
|
|
238
263
|
|
|
239
264
|
- [#841](https://github.com/iTwin/presentation/pull/841): Changed how tree state hooks access unified selection storage.
|
|
265
|
+
|
|
240
266
|
- The tree state hooks that hook into unified selection system now accept a `selectionStorage` prop. At the moment the prop is optional, but will be made required in the next major release of the package.
|
|
241
267
|
- The `UnifiedSelectionProvider` React context provider is now deprecated. The context is still used by tree state hooks if the selection storage is not provided through prop.
|
|
242
268
|
|
|
@@ -312,7 +338,11 @@
|
|
|
312
338
|
Example usage:
|
|
313
339
|
|
|
314
340
|
```tsx
|
|
315
|
-
function MyTreeComponentInternal({
|
|
341
|
+
function MyTreeComponentInternal({
|
|
342
|
+
imodelAccess,
|
|
343
|
+
}: {
|
|
344
|
+
imodelAccess: IModelAccess;
|
|
345
|
+
}) {
|
|
316
346
|
const {
|
|
317
347
|
rootNodes,
|
|
318
348
|
getNode,
|
|
@@ -327,18 +357,22 @@
|
|
|
327
357
|
async (nodeId: string, isExpanded: boolean) => {
|
|
328
358
|
const node = getNode(nodeId);
|
|
329
359
|
if (node) {
|
|
330
|
-
console.log(
|
|
360
|
+
console.log(
|
|
361
|
+
`${isExpanded ? "Expanding" : "Collapsing"} node: ${node.label}`
|
|
362
|
+
);
|
|
331
363
|
}
|
|
332
364
|
doExpandNode(nodeId, isExpanded);
|
|
333
365
|
},
|
|
334
|
-
[getNode, doExpandNode]
|
|
366
|
+
[getNode, doExpandNode]
|
|
335
367
|
);
|
|
336
368
|
|
|
337
369
|
// render the tree
|
|
338
370
|
if (!rootNodes || !rootNodes.length) {
|
|
339
371
|
return "No data to display";
|
|
340
372
|
}
|
|
341
|
-
return
|
|
373
|
+
return (
|
|
374
|
+
<TreeRenderer {...state} expandNode={expandNode} rootNodes={rootNodes} />
|
|
375
|
+
);
|
|
342
376
|
}
|
|
343
377
|
```
|
|
344
378
|
|
|
@@ -492,6 +526,7 @@
|
|
|
492
526
|
See "Basic example" section in README learning page for the full example.
|
|
493
527
|
|
|
494
528
|
- [#717](https://github.com/iTwin/presentation/pull/717): **BREAKING:** Add support for non-iModel-driven trees.
|
|
529
|
+
|
|
495
530
|
- `useTree` and `useUnifiedSelectionTree` hooks have been changed to support non-iModel-driven trees. The hooks take a `getHierarchyProvider` prop, which returns a `HierarchyProvider`. The provider can return data from any data source.
|
|
496
531
|
- New `useIModelTree` and `useIModelUnifiedSelectionTree` hooks have been added to cover the most common case, where a tree is created from a iModel's data. The API of these hooks is exactly the same as of the old `useTree` and `useUnifiedSelectionTree` hooks.
|
|
497
532
|
|
|
@@ -684,11 +719,12 @@
|
|
|
684
719
|
const hierarchyLevelDetails = getHierarchyLevelDetails(nodeId);
|
|
685
720
|
someFunc(hierarchyLevelDetails);
|
|
686
721
|
}}
|
|
687
|
-
|
|
688
722
|
// After the change
|
|
689
723
|
onNodeClick={(node, isSelected, event) => someFunc(node.id)}
|
|
690
724
|
onNodeKeyDown={(node, isSelected, event) => someFunc(node.id)}
|
|
691
|
-
onFilterClick={(hierarchyLevelDetails) =>
|
|
725
|
+
onFilterClick={(hierarchyLevelDetails) =>
|
|
726
|
+
someFunc(hierarchyLevelDetails)
|
|
727
|
+
}
|
|
692
728
|
/>
|
|
693
729
|
);
|
|
694
730
|
}
|
|
@@ -721,7 +757,7 @@
|
|
|
721
757
|
...props,
|
|
722
758
|
onHierarchyLimitExceeded: ({ nodeId, filter, limit }) => {
|
|
723
759
|
console.log(`Hierarchy limit of ${limit} exceeded for node ${nodeId}.`);
|
|
724
|
-
}
|
|
760
|
+
},
|
|
725
761
|
});
|
|
726
762
|
return <TreeRenderer {...state} />;
|
|
727
763
|
}
|
|
@@ -732,7 +768,7 @@
|
|
|
732
768
|
```ts
|
|
733
769
|
import { registerTxnListeners } from "@itwin/presentation-core-interop";
|
|
734
770
|
|
|
735
|
-
function MyTree({ imodel, ...props}: Props) {
|
|
771
|
+
function MyTree({ imodel, ...props }: Props) {
|
|
736
772
|
const { reloadTree, treeProps } = useTree(props);
|
|
737
773
|
useEffect(() => {
|
|
738
774
|
// listen for changes in iModel and reload tree
|
|
@@ -758,7 +794,7 @@
|
|
|
758
794
|
...props,
|
|
759
795
|
onPerformanceMeasured: (action, duration) => {
|
|
760
796
|
telemetryClient.log(`MyTree [${feature}] took ${duration} ms`);
|
|
761
|
-
}
|
|
797
|
+
},
|
|
762
798
|
});
|
|
763
799
|
return <TreeRenderer {...state} />;
|
|
764
800
|
}
|
package/README.md
CHANGED
|
@@ -4,6 +4,16 @@ Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md
|
|
|
4
4
|
|
|
5
5
|
The `@itwin/presentation-hierarchies-react` package provides APIs for building a headless UI for rendering tree components based on data in an [iTwin.js iModel](https://www.itwinjs.org/learning/imodels/#imodel-overview). In addition, it delivers a set of [iTwinUI](https://itwinui.bentley.com/)-based components for rendering the tree.
|
|
6
6
|
|
|
7
|
+
## Entry points
|
|
8
|
+
|
|
9
|
+
Because `@itwin/itwinui-react` is an optional peer dependency, the package exposes three entry points:
|
|
10
|
+
|
|
11
|
+
| Entry point | Requires `@itwin/itwinui-react` | Description |
|
|
12
|
+
| ----------------------------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| `@itwin/presentation-hierarchies-react` | ✔️ | Full API — all hooks, utilities, and iTwinUI-based components. Kept for backwards compatibility. |
|
|
14
|
+
| `@itwin/presentation-hierarchies-react/core` | ❌ | Hooks and utilities only, safe to use without `@itwin/itwinui-react`. |
|
|
15
|
+
| `@itwin/presentation-hierarchies-react/itwinui` | ✔️ | iTwinUI-based components only (`TreeRenderer`, `TreeNodeRenderer`). |
|
|
16
|
+
|
|
7
17
|
## Headless UI
|
|
8
18
|
|
|
9
19
|
### Tree state hooks
|
|
@@ -130,7 +140,7 @@ Our [tree renderer implementation](#treerenderer) calls this hook and passes the
|
|
|
130
140
|
|
|
131
141
|
## iTwinUI components
|
|
132
142
|
|
|
133
|
-
|
|
143
|
+
The package delivers a set of [iTwinUI](https://itwinui.bentley.com/)-based components for rendering the tree, covering the majority of use cases. These components are available via the `@itwin/presentation-hierarchies-react/itwinui` entry point, or the root entry point. They require `@itwin/itwinui-react` to be installed — see [Entry points](#entry-points).
|
|
134
144
|
|
|
135
145
|
### `TreeRenderer`
|
|
136
146
|
|
|
@@ -162,7 +172,8 @@ import { createLimitingECSqlQueryExecutor, createNodesQueryClauseFactory, Hierar
|
|
|
162
172
|
|
|
163
173
|
import { createBisInstanceLabelSelectClauseFactory, Props } from "@itwin/presentation-shared";
|
|
164
174
|
|
|
165
|
-
import {
|
|
175
|
+
import { useIModelUnifiedSelectionTree } from "@itwin/presentation-hierarchies-react";
|
|
176
|
+
import { TreeRenderer } from "@itwin/presentation-hierarchies-react/itwinui";
|
|
166
177
|
import { createStorage, SelectionStorage } from "@itwin/unified-selection";
|
|
167
178
|
import { useEffect, useState } from "react";
|
|
168
179
|
|
|
@@ -323,13 +334,8 @@ import { Props } from "@itwin/presentation-shared";
|
|
|
323
334
|
|
|
324
335
|
import { ComponentPropsWithoutRef, useCallback } from "react";
|
|
325
336
|
import { Tree } from "@itwin/itwinui-react";
|
|
326
|
-
import {
|
|
327
|
-
|
|
328
|
-
LocalizationContextProvider,
|
|
329
|
-
RenderedTreeNode,
|
|
330
|
-
TreeNodeRenderer,
|
|
331
|
-
TreeRenderer,
|
|
332
|
-
} from "@itwin/presentation-hierarchies-react";
|
|
337
|
+
import { LocalizationContextProvider } from "@itwin/presentation-hierarchies-react";
|
|
338
|
+
import { createRenderedTreeNodeData, RenderedTreeNode, TreeNodeRenderer, TreeRenderer } from "@itwin/presentation-hierarchies-react/itwinui";
|
|
333
339
|
|
|
334
340
|
type TreeProps = ComponentPropsWithoutRef<typeof Tree<RenderedTreeNode>>;
|
|
335
341
|
type TreeRendererProps = Props<typeof TreeRenderer>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalizationContext.d.ts","sourceRoot":"","sources":["../../../src/presentation-hierarchies-react/LocalizationContext.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAiB,iBAAiB,EAAmC,MAAM,OAAO,CAAC;AAE1F;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,yBAAyB,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,gCAAgC,EAAE,MAAM,CAAC;IACzC;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,mCAAmC,EAAE,MAAM,CAAC;IAC5C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAiBD;;;GAGG;AACH,UAAU,gCAAgC;IACxC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAE,EAAE,iBAAiB,CAAC,gCAAgC,CAAC,2CAQ9H;AAED,gBAAgB;AAChB,wBAAgB,sBAAsB,wBAErC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalizationContext.js","sourceRoot":"","sources":["../../../src/presentation-hierarchies-react/LocalizationContext.tsx"],"names":[],"mappings":";;AAiGA,kEAQC;AAGD,wDAEC;;AA9GD;;;gGAGgG;AAEhG,iCAA0F;AAgE1F,MAAM,uBAAuB,GAAqB;IAChD,OAAO,EAAE,YAAY;IACrB,oBAAoB,EAAE,cAAc;IACpC,yBAAyB,EAAE,qBAAqB;IAChD,kBAAkB,EAAE,qCAAqC;IACzD,mBAAmB,EAAE,uDAAuD;IAC5E,gCAAgC,EAAE,0GAA0G;IAC5I,sBAAsB,EAAE,oEAAoE;IAC5F,mCAAmC,EAAE,wEAAwE;IAC7G,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,mBAAmB,GAAG,IAAA,qBAAa,EAAsB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAW9G;;;GAGG;AACH,SAAgB,2BAA2B,CAAC,EAAE,gBAAgB,EAAE,QAAQ,EAAuD;IAC7H,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,gBAAgB,EAAE,EAAE,GAAG,uBAAuB,EAAE,GAAG,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAE9G,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,QAAQ,CAAC,EAAE,gBAAgB,EAAE,EAAE,GAAG,uBAAuB,EAAE,GAAG,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,OAAO,uBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAgC,CAAC;AAC/F,CAAC;AAED,gBAAgB;AAChB,SAAgB,sBAAsB;IACpC,OAAO,IAAA,kBAAU,EAAC,mBAAmB,CAAC,CAAC;AACzC,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 { createContext, PropsWithChildren, useContext, useEffect, useState } from \"react\";\n\n/**\n * Localized strings used in the components.\n * @public\n */\nexport interface LocalizedStrings {\n /**\n * Message displayed when nodes are loading.\n * Default value: `Loading...`.\n */\n loading: string;\n /**\n * Title for apply hierarchy filter button.\n * Default value: `Apply filter`.\n */\n filterHierarchyLevel: string;\n /**\n * Title for clear hierarchy filter button.\n * Default value: `Clear active filter`.\n */\n clearHierarchyLevelFilter: string;\n /**\n * Message displayed when no nodes matching filter are found.\n * Default value: `No child nodes match current filter`.\n */\n noFilteredChildren: string;\n /**\n * Message displayed when result limit exceeds hierarchy size limit.\n * Default value: `There are more items than allowed limit of {{limit}}.`.\n */\n resultLimitExceeded: string;\n /**\n * Message displayed when result limit exceeds hierarchy size limit and hierarchy filtering is enabled.\n * Default value: `Please provide <link>additional filtering</link> - there are more items than allowed limit of {{limit}}.`.\n */\n resultLimitExceededWithFiltering: string;\n /**\n * Message displayed when hierarchy size limit can be overridden.\n * Default value: `<link>Increase the hierarchy level size limit to {{limit}}.</link>`.\n */\n increaseHierarchyLimit: string;\n /**\n * Message displayed when hierarchy size limit can be overridden and hierarchy filtering is enabled.\n * Default value: `Or, <link>increase the hierarchy level size limit to {{limit}}.</link>`.\n */\n increaseHierarchyLimitWithFiltering: string;\n /**\n * Label for retry action.\n * Default value: `Retry`.\n */\n retry: string;\n /**\n * Label for more actions button.\n * Default value: `More`.\n */\n more: string;\n}\n\n/** @internal */\nexport interface LocalizationContext {\n localizedStrings: LocalizedStrings;\n}\n\nconst defaultLocalizedStrings: LocalizedStrings = {\n loading: \"Loading...\",\n filterHierarchyLevel: \"Apply filter\",\n clearHierarchyLevelFilter: \"Clear active filter\",\n noFilteredChildren: \"No child nodes match current filter\",\n resultLimitExceeded: \"There are more items than allowed limit of {{limit}}.\",\n resultLimitExceededWithFiltering: \"Please provide <link>additional filtering</link> - there are more items than allowed limit of {{limit}}.\",\n increaseHierarchyLimit: \"<link>Increase the hierarchy level size limit to {{limit}}.</link>\",\n increaseHierarchyLimitWithFiltering: \"Or, <link>increase the hierarchy level size limit to {{limit}}.</link>\",\n retry: \"Retry\",\n more: \"More\",\n};\n\nconst localizationContext = createContext<LocalizationContext>({ localizedStrings: defaultLocalizedStrings });\n\n/**\n * Properties for `LocalizationContextProvider`.\n * @public\n */\ninterface LocalizationContextProviderProps {\n /** Localized strings used in the components. */\n localizedStrings?: Partial<LocalizedStrings>;\n}\n\n/**\n * Context provider for localized strings used in the components.\n * @public\n */\nexport function LocalizationContextProvider({ localizedStrings, children }: PropsWithChildren<LocalizationContextProviderProps>) {\n const [state, setState] = useState({ localizedStrings: { ...defaultLocalizedStrings, ...localizedStrings } });\n\n useEffect(() => {\n setState({ localizedStrings: { ...defaultLocalizedStrings, ...localizedStrings } });\n }, [localizedStrings]);\n\n return <localizationContext.Provider value={state}>{children}</localizationContext.Provider>;\n}\n\n/** @internal */\nexport function useLocalizationContext() {\n return useContext(localizationContext);\n}\n"]}
|
|
@@ -26,6 +26,12 @@
|
|
|
26
26
|
background-color: var(--iui-color-background-accent-muted);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
&:focus-within {
|
|
30
|
+
outline: 1px solid var(--iui-color-border-accent);
|
|
31
|
+
outline-offset: -1px;
|
|
32
|
+
border-radius: var(--iui-border-radius-1);
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
@media (hover: hover) {
|
|
30
36
|
&:hover .action-buttons {
|
|
31
37
|
visibility: visible;
|
|
@@ -34,12 +40,6 @@
|
|
|
34
40
|
&:hover:not(.selected) .action-buttons {
|
|
35
41
|
background-color: var(--iui-color-background-hover);
|
|
36
42
|
}
|
|
37
|
-
|
|
38
|
-
&:focus-within {
|
|
39
|
-
outline: 1px solid var(--iui-color-border-accent);
|
|
40
|
-
outline-offset: -1px;
|
|
41
|
-
border-radius: var(--iui-border-radius-1);
|
|
42
|
-
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.stateless-tree-node-small-spinner {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EAAE,wBAAwB,EAA2C,YAAY,EAAO,aAAa,EAAkC,MAAM,OAAO,CAAC;AAE5J,OAAO,EAAuF,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeNodeRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EAAE,wBAAwB,EAA2C,YAAY,EAAO,aAAa,EAAkC,MAAM,OAAO,CAAC;AAE5J,OAAO,EAAuF,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIrI,OAAO,EAA+B,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,cAAc;AACd,KAAK,aAAa,GAAG,wBAAwB,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE/D,cAAc;AACd,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,cAAc;AACd,UAAU,wBAAwB;IAChC,6BAA6B;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,yEAAyE;IACzE,aAAa,CAAC,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvE,wCAAwC;IACxC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,yBAAyB,KAAK,YAAY,GAAG,SAAS,CAAC;IACxE,wCAAwC;IACxC,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AAK,CAAC,yBAAyB,CAAC,qBAAqB,GAAG,aAAa,CAAC,cAAc,CAAC,CAmGnH,CAAC"}
|
|
@@ -16,8 +16,8 @@ const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
|
16
16
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
17
17
|
const presentation_hierarchies_1 = require("@itwin/presentation-hierarchies");
|
|
18
18
|
const Utils_js_1 = require("../internal/Utils.js");
|
|
19
|
+
const LocalizationContext_js_1 = require("../LocalizationContext.js");
|
|
19
20
|
const TreeNode_js_1 = require("../TreeNode.js");
|
|
20
|
-
const LocalizationContext_js_1 = require("./LocalizationContext.js");
|
|
21
21
|
/**
|
|
22
22
|
* A component that renders `RenderedTreeNode` using the `TreeNode` component from `@itwin/itwinui-react`.
|
|
23
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeNodeRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;gGAGgG;AAEhG,kCAAgC;AAEhC,4DAA4B;AAC5B,iCAA4J;AAC5J,oEAA4F;AAC5F,wDAAqI;AACrI,8EAAgE;AAChE,mDAA0D;AAC1D,gDAAwF;AAExF,qEAAkE;AAyDlE;;;;;;GAMG;AACU,QAAA,gBAAgB,GAA2F,IAAA,kBAAU,EAChI,CACE,EACE,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACV,GAAG,aAAa,EACjB,EACD,YAAY,EACZ,EAAE;IACF,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,+CAAsB,GAAE,CAAC;IACtD,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,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ACpB,OAAO,EAAE,EAAE,CAAC;oBACd,CAAC,YAEA,SAAS,GACH,EACR,SAAS,CAAC,CAAC,CAAC,CACX,uBAAC,oBAAI,IAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC5C,SAAS,GACL,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,CACP;KACF,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAI,GAAG,IAA6D;IACxF,OAAO,IAAA,mBAAW,EAChB,CAAC,QAAkB,EAAE,EAAE;QACrB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;gBAC9B,GAAG,CAAC,QAAQ,CAAC,CAAC;YAChB,CAAC;iBAAM,IAAI,GAAG,EAAE,CAAC;gBACd,GAAkC,CAAC,OAAO,GAAG,QAAQ,CAAC;YACzD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,uDAAuD;IAC1D,CAAC,GAAG,IAAI,CAAC,CACV,CAAC;AACJ,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 \"./TreeNodeRenderer.css\";\n\nimport cx from \"classnames\";\nimport { ComponentPropsWithoutRef, forwardRef, LegacyRef, MutableRefObject, ReactElement, Ref, RefAttributes, useCallback, useEffect, useRef } from \"react\";\nimport { SvgFilter, SvgFilterHollow, SvgMore, SvgRemove } from \"@itwin/itwinui-icons-react\";\nimport { Anchor, ButtonGroup, DropdownMenu, Flex, IconButton, MenuItem, ProgressRadial, Text, TreeNode } from \"@itwin/itwinui-react\";\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { MAX_LIMIT_OVERRIDE } from \"../internal/Utils.js\";\nimport { isPresentationHierarchyNode, PresentationHierarchyNode } from \"../TreeNode.js\";\nimport { HierarchyLevelDetails, UseTreeResult } from \"../UseTree.js\";\nimport { useLocalizationContext } from \"./LocalizationContext.js\";\nimport { RenderedTreeNode } from \"./TreeRenderer.js\";\n\n/** @public */\ntype TreeNodeProps = ComponentPropsWithoutRef<typeof TreeNode>;\n\n/** @public */\nexport interface TreeNodeActionDefinition {\n label: string;\n icon: ReactElement;\n onClick: () => void;\n}\n\n/** @public */\ninterface TreeNodeRendererOwnProps {\n /** Node that is rendered. */\n node: RenderedTreeNode;\n /** Action to perform when the filter button is clicked for this node. */\n onFilterClick?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n /** Returns an icon for a given node. */\n getIcon?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n /** Returns a label for a given node. */\n getLabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n /** Returns sublabel for a given node. */\n getSublabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n /** Action to perform when the node is clicked. */\n onNodeClick?: (node: PresentationHierarchyNode, isSelected: boolean, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Action to perform when a key is pressed when the node is hovered on. */\n onNodeKeyDown?: (node: PresentationHierarchyNode, isSelected: boolean, event: React.KeyboardEvent<HTMLElement>) => void;\n /** A callback to reload a hierarchy level when an error occurs and `retry` button is clicked. */\n reloadTree?: (options: { parentNodeId: string | undefined; state: \"reset\" }) => void;\n /** CSS class name for the action buttons. */\n actionButtonsClassName?: string;\n /** Tree node size. Should match the size passed to `TreeRenderer` component. */\n size?: \"default\" | \"small\";\n /**\n * Configures filter buttons visibility.\n *\n * Options:\n * - `show-on-hover` - show filter buttons when hovering over node, or the node is in focus.\n * - `hide` - hide filter buttons, but will show them if the filter is applied.\n *\n * Default value: `show-on-hover`\n */\n filterButtonsVisibility?: \"show-on-hover\" | \"hide\";\n /**\n * Additional actions that should be rendered for specific hierarchy node.\n */\n getActions?: (node: PresentationHierarchyNode) => TreeNodeActionDefinition[];\n}\n\n/** @public */\ntype TreeNodeRendererProps = Pick<UseTreeResult, \"expandNode\"> &\n Partial<Pick<UseTreeResult, \"getHierarchyLevelDetails\">> &\n Omit<TreeNodeProps, \"label\" | \"onExpanded\" | \"onSelected\" | \"icon\"> &\n TreeNodeRendererOwnProps;\n\n/**\n * A component that renders `RenderedTreeNode` using the `TreeNode` component from `@itwin/itwinui-react`.\n *\n * @see `TreeRenderer`\n * @see https://itwinui.bentley.com/docs/tree\n * @public\n */\nexport const TreeNodeRenderer: React.ForwardRefExoticComponent<TreeNodeRendererProps & RefAttributes<HTMLDivElement>> = forwardRef(\n (\n {\n node,\n expandNode,\n getIcon,\n getLabel,\n getSublabel,\n onFilterClick,\n onNodeClick,\n onNodeKeyDown,\n isSelected,\n isDisabled,\n actionButtonsClassName,\n getHierarchyLevelDetails,\n reloadTree,\n size,\n filterButtonsVisibility,\n getActions,\n ...treeNodeProps\n },\n forwardedRef,\n ) => {\n const { localizedStrings } = useLocalizationContext();\n if (\"type\" in node && node.type === \"ChildrenPlaceholder\") {\n return <PlaceholderNode {...treeNodeProps} ref={forwardedRef} size={size} />;\n }\n\n if (isPresentationHierarchyNode(node)) {\n return (\n <HierarchyNodeRenderer\n {...treeNodeProps}\n ref={forwardedRef}\n node={node}\n expandNode={expandNode}\n getIcon={getIcon}\n getLabel={getLabel}\n getSublabel={getSublabel}\n onFilterClick={onFilterClick}\n onNodeClick={onNodeClick}\n onNodeKeyDown={onNodeKeyDown}\n isSelected={isSelected}\n isDisabled={isDisabled}\n actionButtonsClassName={actionButtonsClassName}\n getHierarchyLevelDetails={getHierarchyLevelDetails}\n filterButtonsVisibility={filterButtonsVisibility}\n getActions={getActions}\n />\n );\n }\n\n if (node.type === \"ResultSetTooLarge\") {\n const hierarchyLevelDetails = getHierarchyLevelDetails?.(node.parentNodeId);\n const isFilterable =\n hierarchyLevelDetails?.hierarchyNode &&\n !HierarchyNode.isGroupingNode(hierarchyLevelDetails.hierarchyNode) &&\n hierarchyLevelDetails.hierarchyNode.supportsFiltering;\n return (\n <ResultSetTooLargeNode\n {...treeNodeProps}\n ref={forwardedRef}\n limit={node.resultSetSizeLimit}\n onOverrideLimit={hierarchyLevelDetails ? (limit) => hierarchyLevelDetails.setSizeLimit(limit) : undefined}\n onFilterClick={\n onFilterClick && hierarchyLevelDetails && isFilterable\n ? () => {\n onFilterClick(hierarchyLevelDetails);\n }\n : undefined\n }\n />\n );\n }\n\n if (node.type === \"NoFilterMatches\") {\n return (\n <TreeNode\n {...treeNodeProps}\n className=\"stateless-tree-node\"\n ref={forwardedRef}\n label={localizedStrings.noFilteredChildren}\n isDisabled={true}\n onExpanded={/* c8 ignore next */ () => {}}\n />\n );\n }\n\n const onRetry = reloadTree ? () => reloadTree({ parentNodeId: node.parentNodeId, state: \"reset\" }) : undefined;\n return (\n <TreeNode\n {...treeNodeProps}\n className=\"stateless-tree-node\"\n ref={forwardedRef}\n label={<ErrorNodeLabel message={node.message} onRetry={onRetry} />}\n isDisabled={true}\n onExpanded={/* c8 ignore next */ () => {}}\n />\n );\n },\n);\nTreeNodeRenderer.displayName = \"TreeNodeRenderer\";\n\ntype HierarchyNodeRendererProps = Omit<TreeNodeRendererProps, \"node\" | \"reloadTree\" | \"size\"> & {\n node: PresentationHierarchyNode;\n};\n\nconst HierarchyNodeRenderer = forwardRef<HTMLDivElement, HierarchyNodeRendererProps>(\n (\n {\n node,\n expandNode,\n getIcon,\n getLabel,\n getSublabel,\n onFilterClick,\n onNodeClick,\n onNodeKeyDown,\n isSelected,\n isDisabled,\n actionButtonsClassName,\n getHierarchyLevelDetails,\n filterButtonsVisibility,\n getActions,\n ...treeNodeProps\n },\n forwardedRef,\n ) => {\n const nodeRef = useRef<HTMLDivElement>(null);\n const ref = useMergedRefs(forwardedRef, nodeRef);\n\n return (\n <TreeNode\n {...treeNodeProps}\n ref={ref}\n isSelected={isSelected}\n isDisabled={isDisabled}\n className={cx(treeNodeProps.className, \"stateless-tree-node\", { filtered: node.isFiltered, selected: isSelected })}\n onClick={(event) => !isDisabled && onNodeClick?.(node, !isSelected, event)}\n onKeyDown={(event) => {\n // Ignore if it is called on the element inside, e.g. checkbox or expander\n if (!isDisabled && event.target === nodeRef.current) {\n onNodeKeyDown?.(node, !isSelected, event);\n }\n }}\n onExpanded={(_, isExpanded) => {\n expandNode(node.id, isExpanded);\n }}\n icon={getIcon ? getIcon(node) : undefined}\n label={getLabel ? getLabel(node) : node.label}\n sublabel={getSublabel ? getSublabel(node) : undefined}\n // TODO: review if this is needed when horizontal scroll is enabled back after fix for issue: https://github.com/iTwin/iTwinUI/issues/2330\n title={node.label}\n contentProps={{ className: \"stateless-tree-node-content\" }}\n >\n <TreeNodeActions\n node={node}\n getHierarchyLevelDetails={getHierarchyLevelDetails}\n onFilterClick={onFilterClick}\n filterButtonsVisibility={filterButtonsVisibility}\n actionButtonsClassName={actionButtonsClassName}\n getActions={getActions}\n />\n </TreeNode>\n );\n },\n);\nHierarchyNodeRenderer.displayName = \"HierarchyNodeRenderer\";\n\nconst PlaceholderNode = forwardRef<\n HTMLDivElement,\n Omit<TreeNodeProps, \"onExpanded\" | \"label\"> & {\n size?: \"default\" | \"small\";\n }\n>(({ size, ...props }, forwardedRef) => {\n const { localizedStrings } = useLocalizationContext();\n return (\n <TreeNode\n {...props}\n ref={forwardedRef}\n className=\"stateless-tree-node\"\n label={localizedStrings.loading}\n icon={\n <ProgressRadial\n size=\"x-small\"\n indeterminate\n title={localizedStrings.loading}\n className={cx(props.className, { \"stateless-tree-node-small-spinner\": size === \"small\" })}\n />\n }\n onExpanded={/* c8 ignore next */ () => {}}\n />\n );\n});\nPlaceholderNode.displayName = \"PlaceholderNode\";\n\nconst ResultSetTooLargeNode = forwardRef<HTMLDivElement, Omit<TreeNodeProps, \"onExpanded\" | \"label\"> & ResultSetTooLargeNodeLabelProps>(\n ({ onFilterClick, onOverrideLimit, limit, ...props }, forwardedRef) => {\n return (\n <TreeNode\n {...props}\n ref={forwardedRef}\n className=\"stateless-tree-node\"\n label={<ResultSetTooLargeNodeLabel limit={limit} onFilterClick={onFilterClick} onOverrideLimit={onOverrideLimit} />}\n onExpanded={/* c8 ignore next */ () => {}}\n isDisabled={true}\n />\n );\n },\n);\nResultSetTooLargeNode.displayName = \"ResultSetTooLargeNode\";\n\nfunction ErrorNodeLabel({ message, onRetry }: { message: string; onRetry?: () => void }) {\n const { localizedStrings } = useLocalizationContext();\n return (\n <Flex flexDirection=\"row\" gap=\"xs\" title={message} alignItems=\"start\">\n <Text>{message}</Text>\n {onRetry ? <Anchor onClick={onRetry}>{localizedStrings?.retry}</Anchor> : null}\n </Flex>\n );\n}\n\nfunction TreeNodeActions({\n node,\n getHierarchyLevelDetails,\n onFilterClick,\n filterButtonsVisibility,\n actionButtonsClassName,\n getActions,\n}: Pick<\n HierarchyNodeRendererProps,\n \"node\" | \"actionButtonsClassName\" | \"getHierarchyLevelDetails\" | \"filterButtonsVisibility\" | \"getActions\" | \"onFilterClick\"\n>) {\n const { localizedStrings } = useLocalizationContext();\n const applyFilterButtonRef = useRef<HTMLButtonElement>(null);\n const prevIsFiltered = useRef(node.isFiltered);\n useEffect(() => {\n // If the node is filtered, focus the apply filter button\n if (node.isFiltered && !prevIsFiltered.current) {\n applyFilterButtonRef.current?.focus();\n }\n prevIsFiltered.current = node.isFiltered;\n }, [node.isFiltered]);\n\n const additionalButtons = getActions ? getActions(node) : [];\n const isClearFilterVisible = getHierarchyLevelDetails && node.isFiltered;\n const isFilterVisible = onFilterClick && node.isFilterable && (filterButtonsVisibility !== \"hide\" || node.isFiltered);\n\n const renderAdditionalActions = () => {\n if (additionalButtons.length === 1) {\n const button = additionalButtons[0];\n return (\n <IconButton\n styleType=\"borderless\"\n size=\"small\"\n label={button.label}\n onClick={(e) => {\n e.stopPropagation();\n button.onClick();\n }}\n >\n {button.icon}\n </IconButton>\n );\n }\n\n if (additionalButtons.length > 1) {\n return (\n <DropdownMenu\n menuItems={(close) =>\n additionalButtons.map((button, index) => (\n <MenuItem\n key={index}\n startIcon={button.icon}\n onClick={() => {\n button.onClick();\n close();\n }}\n >\n {button.label}\n </MenuItem>\n ))\n }\n >\n <IconButton styleType=\"borderless\" size=\"small\" label={localizedStrings.more} onClick={(e) => e.stopPropagation()}>\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n );\n }\n\n return null;\n };\n\n return (\n <ButtonGroup className={cx(\"action-buttons\", actionButtonsClassName)}>\n {isClearFilterVisible ? (\n <IconButton\n styleType=\"borderless\"\n size=\"small\"\n label={localizedStrings.clearHierarchyLevelFilter}\n onClick={(e) => {\n e.stopPropagation();\n getHierarchyLevelDetails(node.id)?.setInstanceFilter(undefined);\n applyFilterButtonRef.current?.focus();\n }}\n >\n <SvgRemove />\n </IconButton>\n ) : null}\n {isFilterVisible ? (\n <IconButton\n ref={applyFilterButtonRef}\n styleType=\"borderless\"\n size=\"small\"\n label={localizedStrings.filterHierarchyLevel}\n onClick={(e) => {\n e.stopPropagation();\n const hierarchyLevelDetails = getHierarchyLevelDetails?.(node.id);\n hierarchyLevelDetails && onFilterClick(hierarchyLevelDetails);\n }}\n >\n {node.isFiltered ? <SvgFilter /> : <SvgFilterHollow />}\n </IconButton>\n ) : null}\n {renderAdditionalActions()}\n </ButtonGroup>\n );\n}\n\ninterface ResultSetTooLargeNodeLabelProps {\n limit: number;\n onFilterClick?: () => void;\n onOverrideLimit?: (limit: number) => void;\n}\n\nfunction ResultSetTooLargeNodeLabel({ onFilterClick, onOverrideLimit, limit }: ResultSetTooLargeNodeLabelProps) {\n const { localizedStrings } = useLocalizationContext();\n const supportsFiltering = !!onFilterClick;\n const supportsLimitOverride = !!onOverrideLimit && limit < MAX_LIMIT_OVERRIDE;\n\n const limitExceededMessage = createLocalizedMessage(\n supportsFiltering ? localizedStrings.resultLimitExceededWithFiltering : localizedStrings.resultLimitExceeded,\n limit,\n onFilterClick,\n );\n const increaseLimitMessage = supportsLimitOverride\n ? createLocalizedMessage(\n supportsFiltering ? localizedStrings.increaseHierarchyLimitWithFiltering : localizedStrings.increaseHierarchyLimit,\n MAX_LIMIT_OVERRIDE,\n () => onOverrideLimit(MAX_LIMIT_OVERRIDE),\n )\n : { title: \"\", element: null };\n\n const title = `${limitExceededMessage.title} ${increaseLimitMessage.title}`;\n\n return (\n <Flex flexDirection=\"column\" gap=\"3xs\" title={title} alignItems=\"start\">\n {limitExceededMessage.element}\n {increaseLimitMessage.element}\n </Flex>\n );\n}\n\nconst LINK_TAG_REGEX = /<link>(.*?)<\\/link>/;\n\nfunction createLocalizedMessage(message: string, limit: number, onClick?: () => void) {\n const limitStr = limit.toLocaleString(undefined, { useGrouping: true });\n const messageWithLimit = message.replace(\"{{limit}}\", limitStr);\n /* c8 ignore next */\n const match = messageWithLimit.length <= 1000 ? messageWithLimit.match(LINK_TAG_REGEX) : undefined;\n\n if (!match) {\n return {\n title: messageWithLimit,\n element: (\n <Text as=\"span\" style={{ whiteSpace: \"normal\" }}>\n {messageWithLimit}\n </Text>\n ),\n };\n }\n\n const [fullText, innerText] = match;\n const [textBefore, textAfter] = messageWithLimit.split(fullText);\n\n return {\n title: messageWithLimit.replace(fullText, innerText),\n element: (\n <div>\n {textBefore ? (\n <Text as=\"span\" style={{ whiteSpace: \"normal\" }}>\n {textBefore}\n </Text>\n ) : null}\n <Anchor\n style={{ whiteSpace: \"normal\" }}\n underline\n onClick={(e) => {\n e.stopPropagation();\n onClick?.();\n }}\n >\n {innerText}\n </Anchor>\n {textAfter ? (\n <Text as=\"span\" style={{ whiteSpace: \"normal\" }}>\n {textAfter}\n </Text>\n ) : null}\n </div>\n ),\n };\n}\n\nfunction useMergedRefs<T>(...refs: ReadonlyArray<Ref<T> | LegacyRef<T> | undefined | null>) {\n return useCallback(\n (instance: T | null) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(instance);\n } else if (ref) {\n (ref as MutableRefObject<T | null>).current = instance;\n }\n });\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [...refs],\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TreeNodeRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeNodeRenderer.tsx"],"names":[],"mappings":";;;;;;;AAAA;;;gGAGgG;AAEhG,kCAAgC;AAEhC,4DAA4B;AAC5B,iCAA4J;AAC5J,oEAA4F;AAC5F,wDAAqI;AACrI,8EAAgE;AAChE,mDAA0D;AAC1D,sEAAmE;AACnE,gDAAwF;AA0DxF;;;;;;GAMG;AACU,QAAA,gBAAgB,GAA2F,IAAA,kBAAU,EAChI,CACE,EACE,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,aAAa,EACb,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACV,GAAG,aAAa,EACjB,EACD,YAAY,EACZ,EAAE;IACF,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,+CAAsB,GAAE,CAAC;IACtD,IAAI,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;QAC1D,OAAO,uBAAC,eAAe,OAAK,aAAa,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC;IAC/E,CAAC;IAED,IAAI,IAAA,yCAA2B,EAAC,IAAI,CAAC,EAAE,CAAC;QACtC,OAAO,CACL,uBAAC,qBAAqB,OAChB,aAAa,EACjB,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,wBA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C,OAAO,GAAG,QAAQ,CAAC;YACzD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,uDAAuD;IAC1D,CAAC,GAAG,IAAI,CAAC,CACV,CAAC;AACJ,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 \"./TreeNodeRenderer.css\";\n\nimport cx from \"classnames\";\nimport { ComponentPropsWithoutRef, forwardRef, LegacyRef, MutableRefObject, ReactElement, Ref, RefAttributes, useCallback, useEffect, useRef } from \"react\";\nimport { SvgFilter, SvgFilterHollow, SvgMore, SvgRemove } from \"@itwin/itwinui-icons-react\";\nimport { Anchor, ButtonGroup, DropdownMenu, Flex, IconButton, MenuItem, ProgressRadial, Text, TreeNode } from \"@itwin/itwinui-react\";\nimport { HierarchyNode } from \"@itwin/presentation-hierarchies\";\nimport { MAX_LIMIT_OVERRIDE } from \"../internal/Utils.js\";\nimport { useLocalizationContext } from \"../LocalizationContext.js\";\nimport { isPresentationHierarchyNode, PresentationHierarchyNode } from \"../TreeNode.js\";\nimport { HierarchyLevelDetails, UseTreeResult } from \"../UseTree.js\";\nimport { RenderedTreeNode } from \"./TreeRenderer.js\";\n\n/** @public */\ntype TreeNodeProps = ComponentPropsWithoutRef<typeof TreeNode>;\n\n/** @public */\nexport interface TreeNodeActionDefinition {\n label: string;\n icon: ReactElement;\n onClick: () => void;\n}\n\n/** @public */\ninterface TreeNodeRendererOwnProps {\n /** Node that is rendered. */\n node: RenderedTreeNode;\n /** Action to perform when the filter button is clicked for this node. */\n onFilterClick?: (hierarchyLevelDetails: HierarchyLevelDetails) => void;\n /** Returns an icon for a given node. */\n getIcon?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n /** Returns a label for a given node. */\n getLabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n /** Returns sublabel for a given node. */\n getSublabel?: (node: PresentationHierarchyNode) => ReactElement | undefined;\n /** Action to perform when the node is clicked. */\n onNodeClick?: (node: PresentationHierarchyNode, isSelected: boolean, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;\n /** Action to perform when a key is pressed when the node is hovered on. */\n onNodeKeyDown?: (node: PresentationHierarchyNode, isSelected: boolean, event: React.KeyboardEvent<HTMLElement>) => void;\n /** A callback to reload a hierarchy level when an error occurs and `retry` button is clicked. */\n reloadTree?: (options: { parentNodeId: string | undefined; state: \"reset\" }) => void;\n /** CSS class name for the action buttons. */\n actionButtonsClassName?: string;\n /** Tree node size. Should match the size passed to `TreeRenderer` component. */\n size?: \"default\" | \"small\";\n /**\n * Configures filter buttons visibility.\n *\n * Options:\n * - `show-on-hover` - show filter buttons when hovering over node, or the node is in focus.\n * - `hide` - hide filter buttons, but will show them if the filter is applied.\n *\n * Default value: `show-on-hover`\n */\n filterButtonsVisibility?: \"show-on-hover\" | \"hide\";\n /**\n * Additional actions that should be rendered for specific hierarchy node.\n */\n getActions?: (node: PresentationHierarchyNode) => TreeNodeActionDefinition[];\n}\n\n/** @public */\ntype TreeNodeRendererProps = Pick<UseTreeResult, \"expandNode\"> &\n Partial<Pick<UseTreeResult, \"getHierarchyLevelDetails\">> &\n Omit<TreeNodeProps, \"label\" | \"onExpanded\" | \"onSelected\" | \"icon\"> &\n TreeNodeRendererOwnProps;\n\n/**\n * A component that renders `RenderedTreeNode` using the `TreeNode` component from `@itwin/itwinui-react`.\n *\n * @see `TreeRenderer`\n * @see https://itwinui.bentley.com/docs/tree\n * @public\n */\nexport const TreeNodeRenderer: React.ForwardRefExoticComponent<TreeNodeRendererProps & RefAttributes<HTMLDivElement>> = forwardRef(\n (\n {\n node,\n expandNode,\n getIcon,\n getLabel,\n getSublabel,\n onFilterClick,\n onNodeClick,\n onNodeKeyDown,\n isSelected,\n isDisabled,\n actionButtonsClassName,\n getHierarchyLevelDetails,\n reloadTree,\n size,\n filterButtonsVisibility,\n getActions,\n ...treeNodeProps\n },\n forwardedRef,\n ) => {\n const { localizedStrings } = useLocalizationContext();\n if (\"type\" in node && node.type === \"ChildrenPlaceholder\") {\n return <PlaceholderNode {...treeNodeProps} ref={forwardedRef} size={size} />;\n }\n\n if (isPresentationHierarchyNode(node)) {\n return (\n <HierarchyNodeRenderer\n {...treeNodeProps}\n ref={forwardedRef}\n node={node}\n expandNode={expandNode}\n getIcon={getIcon}\n getLabel={getLabel}\n getSublabel={getSublabel}\n onFilterClick={onFilterClick}\n onNodeClick={onNodeClick}\n onNodeKeyDown={onNodeKeyDown}\n isSelected={isSelected}\n isDisabled={isDisabled}\n actionButtonsClassName={actionButtonsClassName}\n getHierarchyLevelDetails={getHierarchyLevelDetails}\n filterButtonsVisibility={filterButtonsVisibility}\n getActions={getActions}\n />\n );\n }\n\n if (node.type === \"ResultSetTooLarge\") {\n const hierarchyLevelDetails = getHierarchyLevelDetails?.(node.parentNodeId);\n const isFilterable =\n hierarchyLevelDetails?.hierarchyNode &&\n !HierarchyNode.isGroupingNode(hierarchyLevelDetails.hierarchyNode) &&\n hierarchyLevelDetails.hierarchyNode.supportsFiltering;\n return (\n <ResultSetTooLargeNode\n {...treeNodeProps}\n ref={forwardedRef}\n limit={node.resultSetSizeLimit}\n onOverrideLimit={hierarchyLevelDetails ? (limit) => hierarchyLevelDetails.setSizeLimit(limit) : undefined}\n onFilterClick={\n onFilterClick && hierarchyLevelDetails && isFilterable\n ? () => {\n onFilterClick(hierarchyLevelDetails);\n }\n : undefined\n }\n />\n );\n }\n\n if (node.type === \"NoFilterMatches\") {\n return (\n <TreeNode\n {...treeNodeProps}\n className=\"stateless-tree-node\"\n ref={forwardedRef}\n label={localizedStrings.noFilteredChildren}\n isDisabled={true}\n onExpanded={/* c8 ignore next */ () => {}}\n />\n );\n }\n\n const onRetry = reloadTree ? () => reloadTree({ parentNodeId: node.parentNodeId, state: \"reset\" }) : undefined;\n return (\n <TreeNode\n {...treeNodeProps}\n className=\"stateless-tree-node\"\n ref={forwardedRef}\n label={<ErrorNodeLabel message={node.message} onRetry={onRetry} />}\n isDisabled={true}\n onExpanded={/* c8 ignore next */ () => {}}\n />\n );\n },\n);\nTreeNodeRenderer.displayName = \"TreeNodeRenderer\";\n\ntype HierarchyNodeRendererProps = Omit<TreeNodeRendererProps, \"node\" | \"reloadTree\" | \"size\"> & {\n node: PresentationHierarchyNode;\n};\n\nconst HierarchyNodeRenderer = forwardRef<HTMLDivElement, HierarchyNodeRendererProps>(\n (\n {\n node,\n expandNode,\n getIcon,\n getLabel,\n getSublabel,\n onFilterClick,\n onNodeClick,\n onNodeKeyDown,\n isSelected,\n isDisabled,\n actionButtonsClassName,\n getHierarchyLevelDetails,\n filterButtonsVisibility,\n getActions,\n ...treeNodeProps\n },\n forwardedRef,\n ) => {\n const nodeRef = useRef<HTMLDivElement>(null);\n const ref = useMergedRefs(forwardedRef, nodeRef);\n\n return (\n <TreeNode\n {...treeNodeProps}\n ref={ref}\n isSelected={isSelected}\n isDisabled={isDisabled}\n className={cx(treeNodeProps.className, \"stateless-tree-node\", { filtered: node.isFiltered, selected: isSelected })}\n onClick={(event) => !isDisabled && onNodeClick?.(node, !isSelected, event)}\n onKeyDown={(event) => {\n // Ignore if it is called on the element inside, e.g. checkbox or expander\n if (!isDisabled && event.target === nodeRef.current) {\n onNodeKeyDown?.(node, !isSelected, event);\n }\n }}\n onExpanded={(_, isExpanded) => {\n expandNode(node.id, isExpanded);\n }}\n icon={getIcon ? getIcon(node) : undefined}\n label={getLabel ? getLabel(node) : node.label}\n sublabel={getSublabel ? getSublabel(node) : undefined}\n // TODO: review if this is needed when horizontal scroll is enabled back after fix for issue: https://github.com/iTwin/iTwinUI/issues/2330\n title={node.label}\n contentProps={{ className: \"stateless-tree-node-content\" }}\n >\n <TreeNodeActions\n node={node}\n getHierarchyLevelDetails={getHierarchyLevelDetails}\n onFilterClick={onFilterClick}\n filterButtonsVisibility={filterButtonsVisibility}\n actionButtonsClassName={actionButtonsClassName}\n getActions={getActions}\n />\n </TreeNode>\n );\n },\n);\nHierarchyNodeRenderer.displayName = \"HierarchyNodeRenderer\";\n\nconst PlaceholderNode = forwardRef<\n HTMLDivElement,\n Omit<TreeNodeProps, \"onExpanded\" | \"label\"> & {\n size?: \"default\" | \"small\";\n }\n>(({ size, ...props }, forwardedRef) => {\n const { localizedStrings } = useLocalizationContext();\n return (\n <TreeNode\n {...props}\n ref={forwardedRef}\n className=\"stateless-tree-node\"\n label={localizedStrings.loading}\n icon={\n <ProgressRadial\n size=\"x-small\"\n indeterminate\n title={localizedStrings.loading}\n className={cx(props.className, { \"stateless-tree-node-small-spinner\": size === \"small\" })}\n />\n }\n onExpanded={/* c8 ignore next */ () => {}}\n />\n );\n});\nPlaceholderNode.displayName = \"PlaceholderNode\";\n\nconst ResultSetTooLargeNode = forwardRef<HTMLDivElement, Omit<TreeNodeProps, \"onExpanded\" | \"label\"> & ResultSetTooLargeNodeLabelProps>(\n ({ onFilterClick, onOverrideLimit, limit, ...props }, forwardedRef) => {\n return (\n <TreeNode\n {...props}\n ref={forwardedRef}\n className=\"stateless-tree-node\"\n label={<ResultSetTooLargeNodeLabel limit={limit} onFilterClick={onFilterClick} onOverrideLimit={onOverrideLimit} />}\n onExpanded={/* c8 ignore next */ () => {}}\n isDisabled={true}\n />\n );\n },\n);\nResultSetTooLargeNode.displayName = \"ResultSetTooLargeNode\";\n\nfunction ErrorNodeLabel({ message, onRetry }: { message: string; onRetry?: () => void }) {\n const { localizedStrings } = useLocalizationContext();\n return (\n <Flex flexDirection=\"row\" gap=\"xs\" title={message} alignItems=\"start\">\n <Text>{message}</Text>\n {onRetry ? <Anchor onClick={onRetry}>{localizedStrings?.retry}</Anchor> : null}\n </Flex>\n );\n}\n\nfunction TreeNodeActions({\n node,\n getHierarchyLevelDetails,\n onFilterClick,\n filterButtonsVisibility,\n actionButtonsClassName,\n getActions,\n}: Pick<\n HierarchyNodeRendererProps,\n \"node\" | \"actionButtonsClassName\" | \"getHierarchyLevelDetails\" | \"filterButtonsVisibility\" | \"getActions\" | \"onFilterClick\"\n>) {\n const { localizedStrings } = useLocalizationContext();\n const applyFilterButtonRef = useRef<HTMLButtonElement>(null);\n const prevIsFiltered = useRef(node.isFiltered);\n useEffect(() => {\n // If the node is filtered, focus the apply filter button\n if (node.isFiltered && !prevIsFiltered.current) {\n applyFilterButtonRef.current?.focus();\n }\n prevIsFiltered.current = node.isFiltered;\n }, [node.isFiltered]);\n\n const additionalButtons = getActions ? getActions(node) : [];\n const isClearFilterVisible = getHierarchyLevelDetails && node.isFiltered;\n const isFilterVisible = onFilterClick && node.isFilterable && (filterButtonsVisibility !== \"hide\" || node.isFiltered);\n\n const renderAdditionalActions = () => {\n if (additionalButtons.length === 1) {\n const button = additionalButtons[0];\n return (\n <IconButton\n styleType=\"borderless\"\n size=\"small\"\n label={button.label}\n onClick={(e) => {\n e.stopPropagation();\n button.onClick();\n }}\n >\n {button.icon}\n </IconButton>\n );\n }\n\n if (additionalButtons.length > 1) {\n return (\n <DropdownMenu\n menuItems={(close) =>\n additionalButtons.map((button, index) => (\n <MenuItem\n key={index}\n startIcon={button.icon}\n onClick={() => {\n button.onClick();\n close();\n }}\n >\n {button.label}\n </MenuItem>\n ))\n }\n >\n <IconButton styleType=\"borderless\" size=\"small\" label={localizedStrings.more} onClick={(e) => e.stopPropagation()}>\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n );\n }\n\n return null;\n };\n\n return (\n <ButtonGroup className={cx(\"action-buttons\", actionButtonsClassName)}>\n {isClearFilterVisible ? (\n <IconButton\n styleType=\"borderless\"\n size=\"small\"\n label={localizedStrings.clearHierarchyLevelFilter}\n onClick={(e) => {\n e.stopPropagation();\n getHierarchyLevelDetails(node.id)?.setInstanceFilter(undefined);\n applyFilterButtonRef.current?.focus();\n }}\n >\n <SvgRemove />\n </IconButton>\n ) : null}\n {isFilterVisible ? (\n <IconButton\n ref={applyFilterButtonRef}\n styleType=\"borderless\"\n size=\"small\"\n label={localizedStrings.filterHierarchyLevel}\n onClick={(e) => {\n e.stopPropagation();\n const hierarchyLevelDetails = getHierarchyLevelDetails?.(node.id);\n hierarchyLevelDetails && onFilterClick(hierarchyLevelDetails);\n }}\n >\n {node.isFiltered ? <SvgFilter /> : <SvgFilterHollow />}\n </IconButton>\n ) : null}\n {renderAdditionalActions()}\n </ButtonGroup>\n );\n}\n\ninterface ResultSetTooLargeNodeLabelProps {\n limit: number;\n onFilterClick?: () => void;\n onOverrideLimit?: (limit: number) => void;\n}\n\nfunction ResultSetTooLargeNodeLabel({ onFilterClick, onOverrideLimit, limit }: ResultSetTooLargeNodeLabelProps) {\n const { localizedStrings } = useLocalizationContext();\n const supportsFiltering = !!onFilterClick;\n const supportsLimitOverride = !!onOverrideLimit && limit < MAX_LIMIT_OVERRIDE;\n\n const limitExceededMessage = createLocalizedMessage(\n supportsFiltering ? localizedStrings.resultLimitExceededWithFiltering : localizedStrings.resultLimitExceeded,\n limit,\n onFilterClick,\n );\n const increaseLimitMessage = supportsLimitOverride\n ? createLocalizedMessage(\n supportsFiltering ? localizedStrings.increaseHierarchyLimitWithFiltering : localizedStrings.increaseHierarchyLimit,\n MAX_LIMIT_OVERRIDE,\n () => onOverrideLimit(MAX_LIMIT_OVERRIDE),\n )\n : { title: \"\", element: null };\n\n const title = `${limitExceededMessage.title} ${increaseLimitMessage.title}`;\n\n return (\n <Flex flexDirection=\"column\" gap=\"3xs\" title={title} alignItems=\"start\">\n {limitExceededMessage.element}\n {increaseLimitMessage.element}\n </Flex>\n );\n}\n\nconst LINK_TAG_REGEX = /<link>(.*?)<\\/link>/;\n\nfunction createLocalizedMessage(message: string, limit: number, onClick?: () => void) {\n const limitStr = limit.toLocaleString(undefined, { useGrouping: true });\n const messageWithLimit = message.replace(\"{{limit}}\", limitStr);\n /* c8 ignore next */\n const match = messageWithLimit.length <= 1000 ? messageWithLimit.match(LINK_TAG_REGEX) : undefined;\n\n if (!match) {\n return {\n title: messageWithLimit,\n element: (\n <Text as=\"span\" style={{ whiteSpace: \"normal\" }}>\n {messageWithLimit}\n </Text>\n ),\n };\n }\n\n const [fullText, innerText] = match;\n const [textBefore, textAfter] = messageWithLimit.split(fullText);\n\n return {\n title: messageWithLimit.replace(fullText, innerText),\n element: (\n <div>\n {textBefore ? (\n <Text as=\"span\" style={{ whiteSpace: \"normal\" }}>\n {textBefore}\n </Text>\n ) : null}\n <Anchor\n style={{ whiteSpace: \"normal\" }}\n underline\n onClick={(e) => {\n e.stopPropagation();\n onClick?.();\n }}\n >\n {innerText}\n </Anchor>\n {textAfter ? (\n <Text as=\"span\" style={{ whiteSpace: \"normal\" }}>\n {textAfter}\n </Text>\n ) : null}\n </div>\n ),\n };\n}\n\nfunction useMergedRefs<T>(...refs: ReadonlyArray<Ref<T> | LegacyRef<T> | undefined | null>) {\n return useCallback(\n (instance: T | null) => {\n refs.forEach((ref) => {\n if (typeof ref === \"function\") {\n ref(instance);\n } else if (ref) {\n (ref as MutableRefObject<T | null>).current = instance;\n }\n });\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [...refs],\n );\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import { NodeData, Tree } from "@itwin/itwinui-react";
|
|
3
|
+
import { LocalizationContextProvider } from "../LocalizationContext.js";
|
|
3
4
|
import { PresentationTreeNode } from "../TreeNode.js";
|
|
4
5
|
import { SelectionMode } from "../UseSelectionHandler.js";
|
|
5
6
|
import { useTree } from "../UseTree.js";
|
|
6
|
-
import { LocalizationContextProvider } from "./LocalizationContext.js";
|
|
7
7
|
import { TreeNodeRenderer } from "./TreeNodeRenderer.js";
|
|
8
8
|
/** @public */
|
|
9
9
|
type TreeProps = ComponentPropsWithoutRef<typeof Tree<RenderedTreeNode>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRenderer.d.ts","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeRenderer.tsx"],"names":[],"mappings":"AAKA,OA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CAAC,OAAO,OAAO,CAAC,EAAE,aAAa,GAAG,gBAAgB,GAAG,0BAA0B,GAAG,YAAY,CAAC,CAAC,GACvH,IAAI,CAAC,qBAAqB,EAAE,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,yBAAyB,GAAG,YAAY,CAAC,GAChI,oBAAoB,GACpB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,sBAAsB,CAAC,GAC7E,wBAAwB,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,OAAO,EACP,QAAQ,EACR,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACV,GAAG,SAAS,EACb,EAAE,iBAAiB,8CAiDnB;AAOD;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GACxB,oBAAoB,GACpB;IACE,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEN;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CA6B1I"}
|
|
@@ -9,8 +9,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
9
|
*--------------------------------------------------------------------------------------------*/
|
|
10
10
|
const react_1 = require("react");
|
|
11
11
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
12
|
+
const LocalizationContext_js_1 = require("../LocalizationContext.js");
|
|
12
13
|
const UseSelectionHandler_js_1 = require("../UseSelectionHandler.js");
|
|
13
|
-
const LocalizationContext_js_1 = require("./LocalizationContext.js");
|
|
14
14
|
const TreeNodeRenderer_js_1 = require("./TreeNodeRenderer.js");
|
|
15
15
|
/**
|
|
16
16
|
* A component that renders a tree using the `Tree` component from `@itwin/itwinui-react`. The tree nodes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeRenderer.tsx"],"names":[],"mappings":";;AA0CA,oCAkEC;AAuCD,gEA6BC;;AAhLD;;;gGAGgG;AAEhG,iCAA8D;AAC9D,wDAAsD;
|
|
1
|
+
{"version":3,"file":"TreeRenderer.js","sourceRoot":"","sources":["../../../../src/presentation-hierarchies-react/itwinui/TreeRenderer.tsx"],"names":[],"mappings":";;AA0CA,oCAkEC;AAuCD,gEA6BC;;AAhLD;;;gGAGgG;AAEhG,iCAA8D;AAC9D,wDAAsD;AACtD,sEAAwE;AAExE,sEAA+E;AAE/E,+DAAyD;AAwBzD;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,OAAO,EACP,QAAQ,EACR,WAAW,EACX,wBAAwB,EACxB,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,uBAAuB,EACvB,UAAU,EACV,GAAG,SAAS,EACM;IAClB,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,IAAA,4CAAmB,EAAC;QACzD,SAAS;QACT,WAAW,EAAE,WAAW,IAAI,eAAe;QAC3C,aAAa,EAAE,aAAa,IAAI,QAAQ;KACzC,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,CAAC,SAAS,EAAE,EAAE;QACZ,OAAO,CACL,uBAAC,sCAAgB,OACX,SAAS,EACb,uBAAuB,EAAE,uBAAuB,EAChD,UAAU,EAAE,UAAU,EACtB,wBAAwB,EAAE,wBAAwB,EAClD,aAAa,E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,CAAC,EAAE;QACf,IAAI;QACJ,WAAW,EAAE,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QAC/D,QAAQ;QACN,uEAAuE;QACvE,IAAI,CAAC,QAAQ,KAAK,IAAI;YACpB,CAAC,CAAC;gBACE;oBACE,EAAE,EAAE,WAAW,IAAI,CAAC,EAAE,EAAE;oBACxB,YAAY,EAAE,IAAI,CAAC,EAAE;oBACrB,IAAI,EAAE,qBAAqB;iBAC5B;aACF;YACH,CAAC,CAAC,IAAI,CAAC,QAAQ;QACnB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;KACpC,CAAC;AACJ,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 { ComponentPropsWithoutRef, useCallback } from \"react\";\nimport { NodeData, Tree } from \"@itwin/itwinui-react\";\nimport { LocalizationContextProvider } from \"../LocalizationContext.js\";\nimport { PresentationTreeNode } from \"../TreeNode.js\";\nimport { SelectionMode, useSelectionHandler } from \"../UseSelectionHandler.js\";\nimport { useTree } from \"../UseTree.js\";\nimport { TreeNodeRenderer } from \"./TreeNodeRenderer.js\";\n\n/** @public */\ntype TreeProps = ComponentPropsWithoutRef<typeof Tree<RenderedTreeNode>>;\n\n/** @public */\ntype TreeNodeRendererProps = ComponentPropsWithoutRef<typeof TreeNodeRenderer>;\n\n/** @public */\ninterface TreeRendererOwnProps {\n /** Root nodes of the tree. */\n rootNodes: PresentationTreeNode[];\n /** Active selection mode used by the tree. Defaults to `\"single\"`. */\n selectionMode?: SelectionMode;\n}\n\n/** @public */\ntype TreeRendererProps = Pick<ReturnType<typeof useTree>, \"rootNodes\" | \"expandNode\"> &\n Partial<Pick<ReturnType<typeof useTree>, \"selectNodes\" | \"isNodeSelected\" | \"getHierarchyLevelDetails\" | \"reloadTree\">> &\n Pick<TreeNodeRendererProps, \"onFilterClick\" | \"getIcon\" | \"getLabel\" | \"getSublabel\" | \"filterButtonsVisibility\" | \"getActions\"> &\n TreeRendererOwnProps &\n Omit<TreeProps, \"data\" | \"nodeRenderer\" | \"getNode\" | \"enableVirtualization\"> &\n ComponentPropsWithoutRef<typeof LocalizationContextProvider>;\n\n/**\n * A component that renders a tree using the `Tree` component from `@itwin/itwinui-react`. The tree nodes\n * are rendered using `TreeNodeRenderer` component from this package.\n *\n * @see https://itwinui.bentley.com/docs/tree\n * @public\n */\nexport function TreeRenderer({\n rootNodes,\n expandNode,\n selectNodes,\n isNodeSelected,\n onFilterClick,\n getIcon,\n getLabel,\n getSublabel,\n getHierarchyLevelDetails,\n reloadTree,\n selectionMode,\n localizedStrings,\n size,\n filterButtonsVisibility,\n getActions,\n ...treeProps\n}: TreeRendererProps) {\n const { onNodeClick, onNodeKeyDown } = useSelectionHandler({\n rootNodes,\n selectNodes: selectNodes ?? noopSelectNodes,\n selectionMode: selectionMode ?? \"single\",\n });\n const nodeRenderer = useCallback<TreeProps[\"nodeRenderer\"]>(\n (nodeProps) => {\n return (\n <TreeNodeRenderer\n {...nodeProps}\n filterButtonsVisibility={filterButtonsVisibility}\n expandNode={expandNode}\n getHierarchyLevelDetails={getHierarchyLevelDetails}\n onFilterClick={onFilterClick}\n onNodeClick={onNodeClick}\n onNodeKeyDown={onNodeKeyDown}\n getIcon={getIcon}\n getLabel={getLabel}\n getSublabel={getSublabel}\n reloadTree={reloadTree}\n size={size}\n getActions={getActions}\n />\n );\n },\n [\n filterButtonsVisibility,\n expandNode,\n getHierarchyLevelDetails,\n onFilterClick,\n onNodeClick,\n onNodeKeyDown,\n getIcon,\n getLabel,\n getSublabel,\n reloadTree,\n size,\n getActions,\n ],\n );\n\n const getNode = useCallback<TreeProps[\"getNode\"]>((node) => createRenderedTreeNodeData(node, isNodeSelected ?? noopIsNodeSelected), [isNodeSelected]);\n\n return (\n <LocalizationContextProvider localizedStrings={localizedStrings}>\n <Tree<RenderedTreeNode> {...treeProps} size={size} data={rootNodes} nodeRenderer={nodeRenderer} getNode={getNode} enableVirtualization={true} />\n </LocalizationContextProvider>\n );\n}\n\nfunction noopSelectNodes() {}\nfunction noopIsNodeSelected() {\n return false;\n}\n\n/**\n * A data structure for a tree node that is rendered using the `TreeRenderer` component.\n *\n * In addition to the `PresentationTreeNode` union, this type may have one additional variation - an informational\n * type of node with `ChildrenPlaceholder` type. This type of node is returned as the single child node of a parent\n * while its children are being loaded. This allows the node renderer to show a placeholder under the parent during\n * the process.\n *\n * @public\n */\nexport type RenderedTreeNode =\n | PresentationTreeNode\n | {\n id: string;\n parentNodeId: string | undefined;\n type: \"ChildrenPlaceholder\";\n };\n\n/**\n * An utility function that creates an `@itwin/itwinui-react` `NodeData` object for the `Tree` component from a\n * `RenderedTreeNode` object.\n *\n * Usage example:\n * ```tsx\n * function MyComponent({ rootNodes, nodeRenderer }: MyComponentProps) {\n * const getNode = useCallback<TreeProps[\"getNode\"]>((node) => createRenderedTreeNodeData(node, () => false), []);\n * return <Tree<RenderedTreeNode> data={rootNodes} getNode={getNode} nodeRenderer={nodeRenderer} />;\n * }\n * ```\n *\n * @public\n */\nexport function createRenderedTreeNodeData(node: RenderedTreeNode, isNodeSelected: (nodeId: string) => boolean): NodeData<RenderedTreeNode> {\n if (\"type\" in node) {\n return {\n nodeId: node.id,\n node,\n hasSubNodes: false,\n isExpanded: false,\n isSelected: false,\n isDisabled: true,\n };\n }\n return {\n nodeId: node.id,\n node,\n hasSubNodes: node.children === true || node.children.length > 0,\n subNodes:\n // returns placeholder node to show as child while children is loading.\n node.children === true\n ? [\n {\n id: `Loading-${node.id}`,\n parentNodeId: node.id,\n type: \"ChildrenPlaceholder\",\n },\n ]\n : node.children,\n isExpanded: node.isExpanded,\n isSelected: isNodeSelected(node.id),\n };\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PresentationGenericInfoNode, PresentationHierarchyNode, PresentationInfoNode, PresentationResultSetTooLargeInfoNode, PresentationTreeNode, isPresentationHierarchyNode, } from "./presentation-hierarchies-react/TreeNode.js";
|
|
2
|
+
export { UnifiedSelectionProvider } from "./presentation-hierarchies-react/UnifiedSelectionContext.js";
|
|
3
|
+
export { useSelectionHandler } from "./presentation-hierarchies-react/UseSelectionHandler.js";
|
|
4
|
+
export { HierarchyLevelDetails, useTree, useUnifiedSelectionTree } from "./presentation-hierarchies-react/UseTree.js";
|
|
5
|
+
export { useIModelTree, useIModelUnifiedSelectionTree } from "./presentation-hierarchies-react/UseIModelTree.js";
|
|
6
|
+
export { LocalizationContextProvider } from "./presentation-hierarchies-react/LocalizationContext.js";
|
|
7
|
+
export { GenericInstanceFilter, HierarchyNode, HierarchyProvider } from "@itwin/presentation-hierarchies";
|
|
8
|
+
export { SelectionStorage } from "@itwin/unified-selection";
|
|
9
|
+
//# sourceMappingURL=presentation-hierarchies-react-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-hierarchies-react-core.d.ts","sourceRoot":"","sources":["../../src/presentation-hierarchies-react-core.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,qCAAqC,EACrC,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAEtG,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.HierarchyNode = exports.GenericInstanceFilter = exports.LocalizationContextProvider = exports.useIModelUnifiedSelectionTree = exports.useIModelTree = exports.useUnifiedSelectionTree = exports.useTree = exports.useSelectionHandler = exports.UnifiedSelectionProvider = exports.isPresentationHierarchyNode = void 0;
|
|
8
|
+
var TreeNode_js_1 = require("./presentation-hierarchies-react/TreeNode.js");
|
|
9
|
+
Object.defineProperty(exports, "isPresentationHierarchyNode", { enumerable: true, get: function () { return TreeNode_js_1.isPresentationHierarchyNode; } });
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
11
|
+
var UnifiedSelectionContext_js_1 = require("./presentation-hierarchies-react/UnifiedSelectionContext.js");
|
|
12
|
+
Object.defineProperty(exports, "UnifiedSelectionProvider", { enumerable: true, get: function () { return UnifiedSelectionContext_js_1.UnifiedSelectionProvider; } });
|
|
13
|
+
var UseSelectionHandler_js_1 = require("./presentation-hierarchies-react/UseSelectionHandler.js");
|
|
14
|
+
Object.defineProperty(exports, "useSelectionHandler", { enumerable: true, get: function () { return UseSelectionHandler_js_1.useSelectionHandler; } });
|
|
15
|
+
var UseTree_js_1 = require("./presentation-hierarchies-react/UseTree.js");
|
|
16
|
+
Object.defineProperty(exports, "useTree", { enumerable: true, get: function () { return UseTree_js_1.useTree; } });
|
|
17
|
+
Object.defineProperty(exports, "useUnifiedSelectionTree", { enumerable: true, get: function () { return UseTree_js_1.useUnifiedSelectionTree; } });
|
|
18
|
+
var UseIModelTree_js_1 = require("./presentation-hierarchies-react/UseIModelTree.js");
|
|
19
|
+
Object.defineProperty(exports, "useIModelTree", { enumerable: true, get: function () { return UseIModelTree_js_1.useIModelTree; } });
|
|
20
|
+
Object.defineProperty(exports, "useIModelUnifiedSelectionTree", { enumerable: true, get: function () { return UseIModelTree_js_1.useIModelUnifiedSelectionTree; } });
|
|
21
|
+
var LocalizationContext_js_1 = require("./presentation-hierarchies-react/LocalizationContext.js");
|
|
22
|
+
Object.defineProperty(exports, "LocalizationContextProvider", { enumerable: true, get: function () { return LocalizationContext_js_1.LocalizationContextProvider; } });
|
|
23
|
+
var presentation_hierarchies_1 = require("@itwin/presentation-hierarchies");
|
|
24
|
+
Object.defineProperty(exports, "GenericInstanceFilter", { enumerable: true, get: function () { return presentation_hierarchies_1.GenericInstanceFilter; } });
|
|
25
|
+
Object.defineProperty(exports, "HierarchyNode", { enumerable: true, get: function () { return presentation_hierarchies_1.HierarchyNode; } });
|
|
26
|
+
//# sourceMappingURL=presentation-hierarchies-react-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-hierarchies-react-core.js","sourceRoot":"","sources":["../../src/presentation-hierarchies-react-core.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,4EAOsD;AADpD,0HAAA,2BAA2B,OAAA;AAE7B,4DAA4D;AAC5D,0GAAuG;AAA9F,sIAAA,wBAAwB,OAAA;AACjC,kGAA8F;AAArF,6HAAA,mBAAmB,OAAA;AAC5B,0EAAsH;AAAtF,qGAAA,OAAO,OAAA;AAAE,qHAAA,uBAAuB,OAAA;AAChE,sFAAiH;AAAxG,iHAAA,aAAa,OAAA;AAAE,iIAAA,6BAA6B,OAAA;AACrD,kGAAsG;AAA7F,qIAAA,2BAA2B,OAAA;AAEpC,4EAA0G;AAAjG,iIAAA,qBAAqB,OAAA;AAAE,yHAAA,aAAa,OAAA","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\nexport {\n PresentationGenericInfoNode,\n PresentationHierarchyNode,\n PresentationInfoNode,\n PresentationResultSetTooLargeInfoNode,\n PresentationTreeNode,\n isPresentationHierarchyNode,\n} from \"./presentation-hierarchies-react/TreeNode.js\";\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport { UnifiedSelectionProvider } from \"./presentation-hierarchies-react/UnifiedSelectionContext.js\";\nexport { useSelectionHandler } from \"./presentation-hierarchies-react/UseSelectionHandler.js\";\nexport { HierarchyLevelDetails, useTree, useUnifiedSelectionTree } from \"./presentation-hierarchies-react/UseTree.js\";\nexport { useIModelTree, useIModelUnifiedSelectionTree } from \"./presentation-hierarchies-react/UseIModelTree.js\";\nexport { LocalizationContextProvider } from \"./presentation-hierarchies-react/LocalizationContext.js\";\n\nexport { GenericInstanceFilter, HierarchyNode, HierarchyProvider } from \"@itwin/presentation-hierarchies\";\nexport { SelectionStorage } from \"@itwin/unified-selection\";\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { TreeNodeRenderer } from "./presentation-hierarchies-react/itwinui/TreeNodeRenderer.js";
|
|
2
|
+
export { RenderedTreeNode, TreeRenderer, createRenderedTreeNodeData } from "./presentation-hierarchies-react/itwinui/TreeRenderer.js";
|
|
3
|
+
//# sourceMappingURL=presentation-hierarchies-react-itwinui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-hierarchies-react-itwinui.d.ts","sourceRoot":"","sources":["../../src/presentation-hierarchies-react-itwinui.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createRenderedTreeNodeData = exports.TreeRenderer = exports.TreeNodeRenderer = void 0;
|
|
8
|
+
var TreeNodeRenderer_js_1 = require("./presentation-hierarchies-react/itwinui/TreeNodeRenderer.js");
|
|
9
|
+
Object.defineProperty(exports, "TreeNodeRenderer", { enumerable: true, get: function () { return TreeNodeRenderer_js_1.TreeNodeRenderer; } });
|
|
10
|
+
var TreeRenderer_js_1 = require("./presentation-hierarchies-react/itwinui/TreeRenderer.js");
|
|
11
|
+
Object.defineProperty(exports, "TreeRenderer", { enumerable: true, get: function () { return TreeRenderer_js_1.TreeRenderer; } });
|
|
12
|
+
Object.defineProperty(exports, "createRenderedTreeNodeData", { enumerable: true, get: function () { return TreeRenderer_js_1.createRenderedTreeNodeData; } });
|
|
13
|
+
//# sourceMappingURL=presentation-hierarchies-react-itwinui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-hierarchies-react-itwinui.js","sourceRoot":"","sources":["../../src/presentation-hierarchies-react-itwinui.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,oGAAgG;AAAvF,uHAAA,gBAAgB,OAAA;AACzB,4FAAsI;AAA3G,+GAAA,YAAY,OAAA;AAAE,6HAAA,0BAA0B,OAAA","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\nexport { TreeNodeRenderer } from \"./presentation-hierarchies-react/itwinui/TreeNodeRenderer.js\";\nexport { RenderedTreeNode, TreeRenderer, createRenderedTreeNodeData } from \"./presentation-hierarchies-react/itwinui/TreeRenderer.js\";\n"]}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export { useSelectionHandler } from "./presentation-hierarchies-react/UseSelectionHandler.js";
|
|
4
|
-
export { HierarchyLevelDetails, useTree, useUnifiedSelectionTree } from "./presentation-hierarchies-react/UseTree.js";
|
|
5
|
-
export { useIModelTree, useIModelUnifiedSelectionTree } from "./presentation-hierarchies-react/UseIModelTree.js";
|
|
6
|
-
export { TreeNodeRenderer } from "./presentation-hierarchies-react/itwinui/TreeNodeRenderer.js";
|
|
7
|
-
export { RenderedTreeNode, TreeRenderer, createRenderedTreeNodeData } from "./presentation-hierarchies-react/itwinui/TreeRenderer.js";
|
|
8
|
-
export { LocalizationContextProvider } from "./presentation-hierarchies-react/itwinui/LocalizationContext.js";
|
|
9
|
-
export { GenericInstanceFilter, HierarchyNode, HierarchyProvider } from "@itwin/presentation-hierarchies";
|
|
10
|
-
export { SelectionStorage } from "@itwin/unified-selection";
|
|
1
|
+
export * from "./presentation-hierarchies-react-core.js";
|
|
2
|
+
export * from "./presentation-hierarchies-react-itwinui.js";
|
|
11
3
|
//# sourceMappingURL=presentation-hierarchies-react.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-hierarchies-react.d.ts","sourceRoot":"","sources":["../../src/presentation-hierarchies-react.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"presentation-hierarchies-react.d.ts","sourceRoot":"","sources":["../../src/presentation-hierarchies-react.ts"],"names":[],"mappings":"AAKA,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC"}
|