@itwin/components-react 4.2.1 → 4.3.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +5 -4
  2. package/lib/cjs/components-react/common/UseElementsScrollStorage.d.ts +13 -0
  3. package/lib/cjs/components-react/common/UseElementsScrollStorage.d.ts.map +1 -0
  4. package/lib/cjs/components-react/common/UseElementsScrollStorage.js +49 -0
  5. package/lib/cjs/components-react/common/UseElementsScrollStorage.js.map +1 -0
  6. package/lib/cjs/components-react/datepicker/DatePicker.scss +3 -3
  7. package/lib/cjs/components-react/datepicker/DatePickerPopupButton.scss +3 -3
  8. package/lib/cjs/components-react/datepicker/TimeField.scss +3 -3
  9. package/lib/cjs/components-react/editors/BooleanEditor.scss +3 -3
  10. package/lib/cjs/components-react/editors/EnumButtonGroupEditor.scss +3 -3
  11. package/lib/cjs/components-react/editors/IconEditor.scss +3 -3
  12. package/lib/cjs/components-react/editors/ImageCheckBoxEditor.scss +3 -3
  13. package/lib/cjs/components-react/editors/PopupButton.scss +3 -3
  14. package/lib/cjs/components-react/editors/ToggleEditor.scss +3 -3
  15. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.scss +3 -3
  16. package/lib/cjs/components-react/filter-builder/FilterBuilderRuleGroup.scss +3 -3
  17. package/lib/cjs/components-react/filtering/ResultSelector.scss +3 -3
  18. package/lib/cjs/components-react/iconpicker/IconPickerButton.scss +3 -3
  19. package/lib/cjs/components-react/properties/renderers/ActionButtonList.scss +3 -3
  20. package/lib/cjs/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +3 -3
  21. package/lib/cjs/components-react/properties/renderers/PropertyView.scss +3 -3
  22. package/lib/cjs/components-react/properties/renderers/label/PropertyLabelRenderer.scss +3 -3
  23. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +10 -0
  24. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  25. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +11 -1
  26. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  27. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +3 -3
  28. package/lib/cjs/components-react/selectable-content/SelectableContent.scss +3 -3
  29. package/lib/cjs/components-react/toolbar/ItemWrapper.scss +3 -3
  30. package/lib/cjs/components-react/toolbar/Items.scss +3 -3
  31. package/lib/cjs/components-react/toolbar/Overflow.scss +3 -3
  32. package/lib/cjs/components-react/toolbar/OverflowPanel.scss +3 -3
  33. package/lib/cjs/components-react/toolbar/PopupItem.scss +3 -3
  34. package/lib/cjs/components-react/toolbar/_variables.scss +3 -3
  35. package/lib/cjs/components-react/toolbar/groupPanel/BackArrow.scss +3 -3
  36. package/lib/cjs/components-react/toolbar/groupPanel/Column.scss +3 -3
  37. package/lib/cjs/components-react/toolbar/groupPanel/Columns.scss +3 -3
  38. package/lib/cjs/components-react/toolbar/groupPanel/Panel.scss +3 -3
  39. package/lib/cjs/components-react/toolbar/groupPanel/Title.scss +3 -3
  40. package/lib/cjs/components-react/toolbar/groupPanel/tool/Tool.scss +3 -3
  41. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts +10 -0
  42. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  43. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js +11 -1
  44. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  45. package/lib/cjs/components-react/tree/controlled/component/NodeContent.scss +3 -3
  46. package/lib/esm/components-react/common/UseElementsScrollStorage.d.ts +13 -0
  47. package/lib/esm/components-react/common/UseElementsScrollStorage.d.ts.map +1 -0
  48. package/lib/esm/components-react/common/UseElementsScrollStorage.js +45 -0
  49. package/lib/esm/components-react/common/UseElementsScrollStorage.js.map +1 -0
  50. package/lib/esm/components-react/datepicker/DatePicker.scss +3 -3
  51. package/lib/esm/components-react/datepicker/DatePickerPopupButton.scss +3 -3
  52. package/lib/esm/components-react/datepicker/TimeField.scss +3 -3
  53. package/lib/esm/components-react/editors/BooleanEditor.scss +3 -3
  54. package/lib/esm/components-react/editors/EnumButtonGroupEditor.scss +3 -3
  55. package/lib/esm/components-react/editors/IconEditor.scss +3 -3
  56. package/lib/esm/components-react/editors/ImageCheckBoxEditor.scss +3 -3
  57. package/lib/esm/components-react/editors/PopupButton.scss +3 -3
  58. package/lib/esm/components-react/editors/ToggleEditor.scss +3 -3
  59. package/lib/esm/components-react/filter-builder/FilterBuilderRule.scss +3 -3
  60. package/lib/esm/components-react/filter-builder/FilterBuilderRuleGroup.scss +3 -3
  61. package/lib/esm/components-react/filtering/ResultSelector.scss +3 -3
  62. package/lib/esm/components-react/iconpicker/IconPickerButton.scss +3 -3
  63. package/lib/esm/components-react/properties/renderers/ActionButtonList.scss +3 -3
  64. package/lib/esm/components-react/properties/renderers/NonPrimitivePropertyRenderer.scss +3 -3
  65. package/lib/esm/components-react/properties/renderers/PropertyView.scss +3 -3
  66. package/lib/esm/components-react/properties/renderers/label/PropertyLabelRenderer.scss +3 -3
  67. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +10 -0
  68. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts.map +1 -1
  69. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +9 -0
  70. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  71. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +3 -3
  72. package/lib/esm/components-react/selectable-content/SelectableContent.scss +3 -3
  73. package/lib/esm/components-react/toolbar/ItemWrapper.scss +3 -3
  74. package/lib/esm/components-react/toolbar/Items.scss +3 -3
  75. package/lib/esm/components-react/toolbar/Overflow.scss +3 -3
  76. package/lib/esm/components-react/toolbar/OverflowPanel.scss +3 -3
  77. package/lib/esm/components-react/toolbar/PopupItem.scss +3 -3
  78. package/lib/esm/components-react/toolbar/_variables.scss +3 -3
  79. package/lib/esm/components-react/toolbar/groupPanel/BackArrow.scss +3 -3
  80. package/lib/esm/components-react/toolbar/groupPanel/Column.scss +3 -3
  81. package/lib/esm/components-react/toolbar/groupPanel/Columns.scss +3 -3
  82. package/lib/esm/components-react/toolbar/groupPanel/Panel.scss +3 -3
  83. package/lib/esm/components-react/toolbar/groupPanel/Title.scss +3 -3
  84. package/lib/esm/components-react/toolbar/groupPanel/tool/Tool.scss +3 -3
  85. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts +10 -0
  86. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  87. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js +9 -0
  88. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  89. package/lib/esm/components-react/tree/controlled/component/NodeContent.scss +3 -3
  90. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "variables";
6
6
 
7
7
  $separator-color: var(--iui-color-border-subtle);
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/z-index";
6
6
  @import "variables";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "variables";
6
6
 
7
7
  .components-toolbar-overflow-panel {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/z-index";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/geometry";
7
7
  @import "variables";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/index";
6
6
 
7
7
  $components-desktop-item-width: 40px;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @use "sass:math";
6
6
  @import "../../target";
7
7
  @import "variables";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  .components-toolbar-item-expandable-group-column {
6
6
  > *:not(:last-child) {
7
7
  margin-bottom: 9px;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  .components-toolbar-item-expandable-group-columns {
6
6
  display: grid;
7
7
  grid-auto-columns: 1fr;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "variables";
6
6
 
7
7
  .components-toolbar-item-expandable-group-panel {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "variables";
6
6
 
7
7
  .components-toolbar-item-expandable-group-title {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "../../../target";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/typography";
7
7
  @import "variables";
@@ -55,4 +55,14 @@ export interface ControlledTreeProps extends CommonProps {
55
55
  * @public
56
56
  */
57
57
  export declare function ControlledTree(props: ControlledTreeProps): JSX.Element;
58
+ /**
59
+ * Returns callbacks for persisting and restoring [[ControlledTree]] layout state.
60
+ * Returned `ref` should be set on container containing ControlledTree.
61
+ * @public
62
+ */
63
+ export declare function useControlledTreeLayoutStorage<T extends Element>(): {
64
+ ref: React.Ref<T>;
65
+ persist: () => void;
66
+ restore: () => void;
67
+ };
58
68
  //# sourceMappingURL=ControlledTree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ControlledTree.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/component/ControlledTree.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAE9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EACV,SAAS,EAIV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAG5E;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,oCAAoC;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB,iEAAiE;IACjE,UAAU,EAAE,eAAe,CAAC;IAC5B,2BAA2B;IAC3B,aAAa,EAAE,UAAU,CAAC;IAC1B,wCAAwC;IACxC,aAAa,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,sBAAsB,CAAC;IAC/C,mDAAmD;IACnD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC;IAChE,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC;IAC3C,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC;IAC1C,kEAAkE;IAClE,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACtD,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eAqDxD"}
1
+ {"version":3,"file":"ControlledTree.d.ts","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/component/ControlledTree.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC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AAO;;;;EAE/D"}
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
30
30
  return result;
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.ControlledTree = void 0;
33
+ exports.useControlledTreeLayoutStorage = exports.ControlledTree = void 0;
34
34
  const React = __importStar(require("react"));
35
35
  const core_react_1 = require("@itwin/core-react");
36
36
  const DelayedSpinner_1 = require("../../../common/DelayedSpinner");
@@ -40,6 +40,7 @@ const TreeEventDispatcher_1 = require("../TreeEventDispatcher");
40
40
  const TreeModel_1 = require("../TreeModel");
41
41
  const TreeNodeRenderer_1 = require("./TreeNodeRenderer");
42
42
  const TreeRenderer_1 = require("./TreeRenderer");
43
+ const UseElementsScrollStorage_1 = require("../../../common/UseElementsScrollStorage");
43
44
  /**
44
45
  * React tree component which rendering is fully controlled from outside.
45
46
  * @public
@@ -66,6 +67,15 @@ function ControlledTree(props) {
66
67
  return (React.createElement(Loader, { loading: loading, noData: noData, spinnerRenderer: props.spinnerRenderer, noDataRenderer: props.noDataRenderer }, props.treeRenderer ? (props.treeRenderer(treeProps)) : (React.createElement(TreeRenderer_1.TreeRenderer, { ...treeProps }))));
67
68
  }
68
69
  exports.ControlledTree = ControlledTree;
70
+ /**
71
+ * Returns callbacks for persisting and restoring [[ControlledTree]] layout state.
72
+ * Returned `ref` should be set on container containing ControlledTree.
73
+ * @public
74
+ */
75
+ function useControlledTreeLayoutStorage() {
76
+ return (0, UseElementsScrollStorage_1.useElementsScrollStorage)("ReactWindow__VariableSizeList");
77
+ }
78
+ exports.useControlledTreeLayoutStorage = useControlledTreeLayoutStorage;
69
79
  function useRootNodeLoader(visibleNodes, nodeLoader) {
70
80
  React.useEffect(() => {
71
81
  if (visibleNodes.getNumRootNodes() === undefined) {
@@ -1 +1 @@
1
- {"version":3,"file":"ControlledTree.js","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/component/ControlledTree.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;A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AAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,UAAU,GAAG,CAAC,CAAC;QACrB,uFAAuF;QACvF,OAAO,aAAa,GAAG,UAAU,CAAC;IACpC,CAAC,EACD,CAAC,mBAAmB,CAAC,CACtB,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/** @packageDocumentation\n * @module Tree\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { FillCentered } from \"@itwin/core-react\";\nimport { DelayedSpinner } from \"../../../common/DelayedSpinner\";\nimport type { SelectionMode } from \"../../../common/selection/SelectionModes\";\nimport { UiComponents } from \"../../../UiComponents\";\nimport type { HighlightableTreeProps } from \"../../HighlightingEngine\";\nimport { TreeImageLoader } from \"../../ImageLoader\";\nimport { TreeEventDispatcher } from \"../TreeEventDispatcher\";\nimport type { TreeEvents } from \"../TreeEvents\";\nimport type {\n TreeModel,\n TreeModelNode,\n TreeModelNodePlaceholder,\n VisibleTreeNodes,\n} from \"../TreeModel\";\nimport { computeVisibleNodes, isTreeModelNode } from \"../TreeModel\";\nimport type { ITreeNodeLoader } from \"../TreeNodeLoader\";\nimport type { TreeNodeRendererProps } from \"./TreeNodeRenderer\";\nimport { TreeNodeRenderer } from \"./TreeNodeRenderer\";\nimport type { RenderedItemsRange, TreeRendererProps } from \"./TreeRenderer\";\nimport { TreeRenderer } from \"./TreeRenderer\";\n\n/**\n * Properties for [[ControlledTree]]\n * @public\n */\nexport interface ControlledTreeProps extends CommonProps {\n /** Model of the tree to display. */\n model: TreeModel;\n /** Node loader used to load root nodes and placeholder nodes. */\n nodeLoader: ITreeNodeLoader;\n /** Tree events handler. */\n eventsHandler: TreeEvents;\n /** Mode of nodes' selection in tree. */\n selectionMode: SelectionMode;\n /**\n * Specifies whether to show node description or not. It is used in default node renderer and to determine node height.\n * If custom node renderer and node height callbacks are used it does nothing.\n */\n descriptionsEnabled?: boolean;\n /**\n * Specifies whether to show node icon or not. It is used in default node renderer.\n * If custom node renderer is used it does nothing.\n */\n iconsEnabled?: boolean;\n /**\n * Used to highlight matches when filtering tree.\n * It is passed to treeRenderer.\n */\n nodeHighlightingProps?: HighlightableTreeProps;\n /** Custom renderer to be used to render a tree. */\n treeRenderer?: (props: TreeRendererProps) => React.ReactElement;\n /** Custom renderer to be used while root nodes is loading. */\n spinnerRenderer?: () => React.ReactElement;\n /** Custom renderer to be used when there is no data to show in tree. */\n noDataRenderer?: () => React.ReactElement;\n /** Callback that is invoked when rendered items range changes. */\n onItemsRendered?: (items: RenderedItemsRange) => void;\n /** Width of the tree renderer. */\n width: number;\n /** Height of the tree renderer. */\n height: number;\n}\n\n/**\n * React tree component which rendering is fully controlled from outside.\n * @public\n */\nexport function ControlledTree(props: ControlledTreeProps) {\n const nodeHeight = useNodeHeight(!!props.descriptionsEnabled);\n const imageLoader = React.useMemo(() => new TreeImageLoader(), []);\n const nodeRenderer = React.useCallback(\n (nodeProps: TreeNodeRendererProps) => (\n <TreeNodeRenderer\n {...nodeProps}\n descriptionEnabled={props.descriptionsEnabled}\n imageLoader={props.iconsEnabled ? imageLoader : undefined}\n />\n ),\n [props.descriptionsEnabled, props.iconsEnabled, imageLoader]\n );\n\n const visibleNodes = React.useMemo(\n () => computeVisibleNodes(props.model),\n [props.model]\n );\n const eventDispatcher = useEventDispatcher(\n props.nodeLoader,\n props.eventsHandler,\n props.selectionMode,\n visibleNodes\n );\n\n const treeProps: TreeRendererProps = {\n nodeRenderer,\n nodeHeight,\n visibleNodes,\n treeActions: eventDispatcher,\n nodeLoader: props.nodeLoader,\n nodeHighlightingProps: props.nodeHighlightingProps,\n onItemsRendered: props.onItemsRendered,\n width: props.width,\n height: props.height,\n };\n\n const loading = useRootNodeLoader(visibleNodes, props.nodeLoader);\n const noData = visibleNodes.getNumRootNodes() === 0;\n return (\n <Loader\n loading={loading}\n noData={noData}\n spinnerRenderer={props.spinnerRenderer}\n noDataRenderer={props.noDataRenderer}\n >\n {props.treeRenderer ? (\n props.treeRenderer(treeProps)\n ) : (\n <TreeRenderer {...treeProps} />\n )}\n </Loader>\n );\n}\n\nfunction useRootNodeLoader(\n visibleNodes: VisibleTreeNodes,\n nodeLoader: ITreeNodeLoader\n): boolean {\n React.useEffect(() => {\n if (visibleNodes.getNumRootNodes() === undefined) {\n const subscription = nodeLoader\n .loadNode(visibleNodes.getModel().getRootNode(), 0)\n .subscribe();\n return () => subscription.unsubscribe();\n }\n\n return () => {};\n }, [visibleNodes, nodeLoader]);\n\n return visibleNodes.getNumRootNodes() === undefined;\n}\n\nfunction useEventDispatcher(\n nodeLoader: ITreeNodeLoader,\n treeEvents: TreeEvents,\n selectionMode: SelectionMode,\n visibleNodes: VisibleTreeNodes\n) {\n /* istanbul ignore next */\n const getVisibleNodes = React.useCallback(() => visibleNodes, [visibleNodes]);\n const eventDispatcher = React.useMemo(\n () => new TreeEventDispatcher(treeEvents, nodeLoader, selectionMode),\n [treeEvents, nodeLoader, selectionMode]\n );\n\n React.useEffect(() => {\n eventDispatcher.setVisibleNodes(getVisibleNodes);\n }, [eventDispatcher, getVisibleNodes]);\n\n return eventDispatcher;\n}\n\ninterface LoaderProps {\n loading: boolean;\n noData: boolean;\n spinnerRenderer?: () => React.ReactElement;\n noDataRenderer?: () => React.ReactElement;\n children: React.ReactElement;\n}\n\nfunction Loader(props: LoaderProps) {\n if (props.loading) {\n return props.spinnerRenderer ? (\n props.spinnerRenderer()\n ) : (\n <div className=\"components-controlledTree-loader\">\n <DelayedSpinner size=\"large\" />\n </div>\n );\n }\n if (props.noData) {\n return props.noDataRenderer ? (\n props.noDataRenderer()\n ) : (\n <FillCentered>\n <p className=\"components-controlledTree-errorMessage\">\n {UiComponents.translate(\"general.noData\")}\n </p>\n </FillCentered>\n );\n }\n\n return props.children;\n}\n\nfunction useNodeHeight(\n descriptionsEnabled: boolean\n): (node: TreeModelNode | TreeModelNodePlaceholder) => number {\n return React.useCallback(\n (node: TreeModelNode | TreeModelNodePlaceholder): number => {\n const contentHeight =\n isTreeModelNode(node) && descriptionsEnabled && node && node.description\n ? 43\n : 24;\n const borderSize = 1;\n // Not counting node's border size twice because we want neighboring borders to overlap\n return contentHeight + borderSize;\n },\n [descriptionsEnabled]\n );\n}\n"]}
1
+ {"version":3,"file":"ControlledTree.js","sourceRoot":"","sources":["../../../../../../src/components-react/tree/controlled/component/ControlledTree.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,kDAAiD;AACjD,mEAAgE;AAEhE,wDAAqD;AAErD,mDAAoD;AACpD,gEAA6D;AAQ7D,4CAAoE;AAGpE,yDAAsD;AAEtD,iDAA8C;AAC9C,uFAAoF;AA4CpF;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,UAAU,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,6BAAe,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CACpC,CAAC,SAAgC,EAAE,EAAE,CAAC,CACpC,oBAAC,mCAAgB,OACX,SAAS,EACb,kBAAkB,EAAE,KAAK,CAAC,mBAAmB,EAC7C,WAAW,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,GACzD,CACH,EACD,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,CAAC,YAAY,EAAE,WAAW,CAAC,CAC7D,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAChC,GAAG,EAAE,CAAC,IAAA,+BAAmB,EAAC,KAAK,CA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C,MAAM,EAAE;QAChB,OAAO,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAC5B,KAAK,CAAC,cAAc,EAAE,CACvB,CAAC,CAAC,CAAC,CACF,oBAAC,yBAAY;YACX,2BAAG,SAAS,EAAC,wCAAwC,IAClD,2BAAY,CAAC,SAAS,CAAC,gBAAgB,CAAC,CACvC,CACS,CAChB,CAAC;KACH;IAED,OAAO,KAAK,CAAC,QAAQ,CAAC;AACxB,CAAC;AAED,SAAS,aAAa,CACpB,mBAA4B;IAE5B,OAAO,KAAK,CAAC,WAAW,CACtB,CAAC,IAA8C,EAAU,EAAE;QACzD,MAAM,aAAa,GACjB,IAAA,2BAAe,EAAC,IAAI,CAAC,IAAI,mBAAmB,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW;YACtE,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,UAAU,GAAG,CAAC,CAAC;QACrB,uFAAuF;QACvF,OAAO,aAAa,GAAG,UAAU,CAAC;IACpC,CAAC,EACD,CAAC,mBAAmB,CAAC,CACtB,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/** @packageDocumentation\n * @module Tree\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { FillCentered } from \"@itwin/core-react\";\nimport { DelayedSpinner } from \"../../../common/DelayedSpinner\";\nimport type { SelectionMode } from \"../../../common/selection/SelectionModes\";\nimport { UiComponents } from \"../../../UiComponents\";\nimport type { HighlightableTreeProps } from \"../../HighlightingEngine\";\nimport { TreeImageLoader } from \"../../ImageLoader\";\nimport { TreeEventDispatcher } from \"../TreeEventDispatcher\";\nimport type { TreeEvents } from \"../TreeEvents\";\nimport type {\n TreeModel,\n TreeModelNode,\n TreeModelNodePlaceholder,\n VisibleTreeNodes,\n} from \"../TreeModel\";\nimport { computeVisibleNodes, isTreeModelNode } from \"../TreeModel\";\nimport type { ITreeNodeLoader } from \"../TreeNodeLoader\";\nimport type { TreeNodeRendererProps } from \"./TreeNodeRenderer\";\nimport { TreeNodeRenderer } from \"./TreeNodeRenderer\";\nimport type { RenderedItemsRange, TreeRendererProps } from \"./TreeRenderer\";\nimport { TreeRenderer } from \"./TreeRenderer\";\nimport { useElementsScrollStorage } from \"../../../common/UseElementsScrollStorage\";\n\n/**\n * Properties for [[ControlledTree]]\n * @public\n */\nexport interface ControlledTreeProps extends CommonProps {\n /** Model of the tree to display. */\n model: TreeModel;\n /** Node loader used to load root nodes and placeholder nodes. */\n nodeLoader: ITreeNodeLoader;\n /** Tree events handler. */\n eventsHandler: TreeEvents;\n /** Mode of nodes' selection in tree. */\n selectionMode: SelectionMode;\n /**\n * Specifies whether to show node description or not. It is used in default node renderer and to determine node height.\n * If custom node renderer and node height callbacks are used it does nothing.\n */\n descriptionsEnabled?: boolean;\n /**\n * Specifies whether to show node icon or not. It is used in default node renderer.\n * If custom node renderer is used it does nothing.\n */\n iconsEnabled?: boolean;\n /**\n * Used to highlight matches when filtering tree.\n * It is passed to treeRenderer.\n */\n nodeHighlightingProps?: HighlightableTreeProps;\n /** Custom renderer to be used to render a tree. */\n treeRenderer?: (props: TreeRendererProps) => React.ReactElement;\n /** Custom renderer to be used while root nodes is loading. */\n spinnerRenderer?: () => React.ReactElement;\n /** Custom renderer to be used when there is no data to show in tree. */\n noDataRenderer?: () => React.ReactElement;\n /** Callback that is invoked when rendered items range changes. */\n onItemsRendered?: (items: RenderedItemsRange) => void;\n /** Width of the tree renderer. */\n width: number;\n /** Height of the tree renderer. */\n height: number;\n}\n\n/**\n * React tree component which rendering is fully controlled from outside.\n * @public\n */\nexport function ControlledTree(props: ControlledTreeProps) {\n const nodeHeight = useNodeHeight(!!props.descriptionsEnabled);\n const imageLoader = React.useMemo(() => new TreeImageLoader(), []);\n const nodeRenderer = React.useCallback(\n (nodeProps: TreeNodeRendererProps) => (\n <TreeNodeRenderer\n {...nodeProps}\n descriptionEnabled={props.descriptionsEnabled}\n imageLoader={props.iconsEnabled ? imageLoader : undefined}\n />\n ),\n [props.descriptionsEnabled, props.iconsEnabled, imageLoader]\n );\n\n const visibleNodes = React.useMemo(\n () => computeVisibleNodes(props.model),\n [props.model]\n );\n const eventDispatcher = useEventDispatcher(\n props.nodeLoader,\n props.eventsHandler,\n props.selectionMode,\n visibleNodes\n );\n\n const treeProps: TreeRendererProps = {\n nodeRenderer,\n nodeHeight,\n visibleNodes,\n treeActions: eventDispatcher,\n nodeLoader: props.nodeLoader,\n nodeHighlightingProps: props.nodeHighlightingProps,\n onItemsRendered: props.onItemsRendered,\n width: props.width,\n height: props.height,\n };\n\n const loading = useRootNodeLoader(visibleNodes, props.nodeLoader);\n const noData = visibleNodes.getNumRootNodes() === 0;\n return (\n <Loader\n loading={loading}\n noData={noData}\n spinnerRenderer={props.spinnerRenderer}\n noDataRenderer={props.noDataRenderer}\n >\n {props.treeRenderer ? (\n props.treeRenderer(treeProps)\n ) : (\n <TreeRenderer {...treeProps} />\n )}\n </Loader>\n );\n}\n\n/**\n * Returns callbacks for persisting and restoring [[ControlledTree]] layout state.\n * Returned `ref` should be set on container containing ControlledTree.\n * @public\n */\nexport function useControlledTreeLayoutStorage<T extends Element>() {\n return useElementsScrollStorage<T>(\"ReactWindow__VariableSizeList\");\n}\n\nfunction useRootNodeLoader(\n visibleNodes: VisibleTreeNodes,\n nodeLoader: ITreeNodeLoader\n): boolean {\n React.useEffect(() => {\n if (visibleNodes.getNumRootNodes() === undefined) {\n const subscription = nodeLoader\n .loadNode(visibleNodes.getModel().getRootNode(), 0)\n .subscribe();\n return () => subscription.unsubscribe();\n }\n\n return () => {};\n }, [visibleNodes, nodeLoader]);\n\n return visibleNodes.getNumRootNodes() === undefined;\n}\n\nfunction useEventDispatcher(\n nodeLoader: ITreeNodeLoader,\n treeEvents: TreeEvents,\n selectionMode: SelectionMode,\n visibleNodes: VisibleTreeNodes\n) {\n /* istanbul ignore next */\n const getVisibleNodes = React.useCallback(() => visibleNodes, [visibleNodes]);\n const eventDispatcher = React.useMemo(\n () => new TreeEventDispatcher(treeEvents, nodeLoader, selectionMode),\n [treeEvents, nodeLoader, selectionMode]\n );\n\n React.useEffect(() => {\n eventDispatcher.setVisibleNodes(getVisibleNodes);\n }, [eventDispatcher, getVisibleNodes]);\n\n return eventDispatcher;\n}\n\ninterface LoaderProps {\n loading: boolean;\n noData: boolean;\n spinnerRenderer?: () => React.ReactElement;\n noDataRenderer?: () => React.ReactElement;\n children: React.ReactElement;\n}\n\nfunction Loader(props: LoaderProps) {\n if (props.loading) {\n return props.spinnerRenderer ? (\n props.spinnerRenderer()\n ) : (\n <div className=\"components-controlledTree-loader\">\n <DelayedSpinner size=\"large\" />\n </div>\n );\n }\n if (props.noData) {\n return props.noDataRenderer ? (\n props.noDataRenderer()\n ) : (\n <FillCentered>\n <p className=\"components-controlledTree-errorMessage\">\n {UiComponents.translate(\"general.noData\")}\n </p>\n </FillCentered>\n );\n }\n\n return props.children;\n}\n\nfunction useNodeHeight(\n descriptionsEnabled: boolean\n): (node: TreeModelNode | TreeModelNodePlaceholder) => number {\n return React.useCallback(\n (node: TreeModelNode | TreeModelNodePlaceholder): number => {\n const contentHeight =\n isTreeModelNode(node) && descriptionsEnabled && node && node.description\n ? 43\n : 24;\n const borderSize = 1;\n // Not counting node's border size twice because we want neighboring borders to overlap\n return contentHeight + borderSize;\n },\n [descriptionsEnabled]\n );\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  .components-controlledTree-node-description {
7
7
  color: var(--iui-color-text-muted);
@@ -0,0 +1,13 @@
1
+ import type { Ref } from "react";
2
+ /**
3
+ * Returns callbacks for persisting and restoring elements `scrollTop` property value.
4
+ * This can be used to restore elements scroll position if it needs to be hidden and
5
+ * later shown again without unmounting React component.
6
+ * @internal
7
+ */
8
+ export declare function useElementsScrollStorage<T extends Element>(elementsClassName: string): {
9
+ ref: Ref<T>;
10
+ persist: () => void;
11
+ restore: () => void;
12
+ };
13
+ //# sourceMappingURL=UseElementsScrollStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseElementsScrollStorage.d.ts","sourceRoot":"","sources":["../../../../src/components-react/common/UseElementsScrollStorage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,OAAO,EACxD,iBAAiB,EAAE,MAAM,GACxB;IACD,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAqCA"}
@@ -0,0 +1,45 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { useRef } from "react";
6
+ /**
7
+ * Returns callbacks for persisting and restoring elements `scrollTop` property value.
8
+ * This can be used to restore elements scroll position if it needs to be hidden and
9
+ * later shown again without unmounting React component.
10
+ * @internal
11
+ */
12
+ export function useElementsScrollStorage(elementsClassName) {
13
+ const ref = useRef(null);
14
+ const scrollTop = useRef([]);
15
+ const getElements = () => {
16
+ // istanbul ignore if
17
+ if (!ref.current) {
18
+ return [];
19
+ }
20
+ return ref.current.getElementsByClassName(elementsClassName);
21
+ };
22
+ /** Persists current `scrollTop` property value of elements. */
23
+ const persist = () => {
24
+ const elements = getElements();
25
+ const offsets = [];
26
+ for (const element of elements) {
27
+ offsets.push(element.scrollTop);
28
+ }
29
+ scrollTop.current = offsets;
30
+ };
31
+ /** Restores `scrollTop` property values back. If `persist` was not called does nothing. */
32
+ const restore = () => {
33
+ const elements = getElements();
34
+ if (elements.length !== scrollTop.current.length) {
35
+ scrollTop.current = [];
36
+ return;
37
+ }
38
+ for (let i = 0; i < scrollTop.current.length; i++) {
39
+ elements[i].scrollTop = scrollTop.current[i];
40
+ }
41
+ scrollTop.current = [];
42
+ };
43
+ return { ref, persist, restore };
44
+ }
45
+ //# sourceMappingURL=UseElementsScrollStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseElementsScrollStorage.js","sourceRoot":"","sources":["../../../../src/components-react/common/UseElementsScrollStorage.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACtC,iBAAyB;IAMzB,MAAM,GAAG,GAAG,MAAM,CAAI,IAAI,CAAC,CAAC;IAC5B,MAAM,SAAS,GAAG,MAAM,CAAW,EAAE,CAAC,CAAC;IAEvC,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,qBAAqB;QACrB,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YAChB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAC/D,CAAC,CAAC;IAEF,+DAA+D;IAC/D,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SACjC;QACD,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC9B,CAAC,CAAC;IAEF,2FAA2F;IAC3F,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;QAC/B,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE;YAChD,SAAS,CAAC,OAAO,GAAG,EAAE,CAAC;YACvB,OAAO;SACR;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACjD,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SAC9C;QACD,SAAS,CAAC,OAAO,GAAG,EAAE,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACnC,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 type { Ref } from \"react\";\nimport { useRef } from \"react\";\n\n/**\n * Returns callbacks for persisting and restoring elements `scrollTop` property value.\n * This can be used to restore elements scroll position if it needs to be hidden and\n * later shown again without unmounting React component.\n * @internal\n */\nexport function useElementsScrollStorage<T extends Element>(\n elementsClassName: string\n): {\n ref: Ref<T>;\n persist: () => void;\n restore: () => void;\n} {\n const ref = useRef<T>(null);\n const scrollTop = useRef<number[]>([]);\n\n const getElements = () => {\n // istanbul ignore if\n if (!ref.current) {\n return [];\n }\n return ref.current.getElementsByClassName(elementsClassName);\n };\n\n /** Persists current `scrollTop` property value of elements. */\n const persist = () => {\n const elements = getElements();\n const offsets: number[] = [];\n for (const element of elements) {\n offsets.push(element.scrollTop);\n }\n scrollTop.current = offsets;\n };\n\n /** Restores `scrollTop` property values back. If `persist` was not called does nothing. */\n const restore = () => {\n const elements = getElements();\n if (elements.length !== scrollTop.current.length) {\n scrollTop.current = [];\n return;\n }\n\n for (let i = 0; i < scrollTop.current.length; i++) {\n elements[i].scrollTop = scrollTop.current[i];\n }\n scrollTop.current = [];\n };\n\n return { ref, persist, restore };\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/style/opacity";
7
7
  @import "~@itwin/core-react/lib/cjs/core-react/icons/variables";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/index";
6
6
 
7
7
  .components-date-picker-calendar-popup-button {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/inputs/variables";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  $checkbox-size: calc(var(--iui-font-size-1) * 1.2);
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  $desktop-tool-stripe-width: 2px;
7
7
  $desktop-tool-stripe-height: 22px;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
6
 
7
7
  $components-color-editor-item-height: 100%;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  $image-checkbox-size: 32px;
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/icons/variables";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/inputs/variables";
7
7
  @import "~@itwin/core-react/lib/cjs/core-react/style/baseline";
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  .components-property-list--horizontal {
6
6
  .components-toggle-editor {
7
7
  margin-left: var(--iui-size-2xs); // Clear the resizer in the PropertyGrid
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  .rule {
7
7
  display: grid;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  .filter-builder > .rule-group {
7
7
  & > .rule-group-content {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
6
 
7
7
  .components-result-selector {
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/z-index";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @mixin property-action-button-list {
6
6
  display: flex;
7
7
  justify-content: flex-end;
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
 
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/style/colors";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
6
 
7
7
  $text-font-size: var(--iui-font-size-1);
@@ -1,7 +1,7 @@
1
1
  /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/style/themecolors";
6
6
 
7
7
  @mixin rotate($amount) {
@@ -118,5 +118,15 @@ export declare class VirtualizedPropertyGrid extends React.Component<Virtualized
118
118
  /** @internal */
119
119
  render(): JSX.Element;
120
120
  }
121
+ /**
122
+ * Returns callbacks for persisting and restoring [[VirtualizedPropertyGrid]] layout state.
123
+ * Returned `ref` should be set on container containing [[VirtualizedPropertyGrid]].
124
+ * @public
125
+ */
126
+ export declare function useVirtualizedPropertyGridLayoutStorage<T extends Element>(): {
127
+ ref: React.Ref<T>;
128
+ persist: () => void;
129
+ restore: () => void;
130
+ };
121
131
  export {};
122
132
  //# sourceMappingURL=VirtualizedPropertyGrid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedPropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV,uBAAuB,EACvB,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAI/B;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,sEAAsE;IACtE,KAAK,EAAE,kBAAkB,CAAC;IAC1B,0DAA0D;IAC1D,YAAY,EAAE,yBAAyB,CAAC;IACxC,uDAAuD;IACvD,YAAY,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BAA4B,GAClC,4BAA4B,GAAG,IAAI;IAOtC,OAAO,CAAC,iBAAiB;IAkBzB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA2C3B,OAAO,CAAC,uBAAuB,CAmB7B;IAEF,OAAO,CAAC,2BAA2B,CAGjC;IAEF,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,gBAAgB,CAQtB;IAEF,gBAAgB;IACA,MAAM;CAyHvB"}
1
+ {"version":3,"file":"VirtualizedPropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,gCAAgC,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAE1F,OAAO,KAAK,EACV,YAAY,EAEb,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC;AACrF,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EACV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