@itwin/components-react 5.4.0 → 5.6.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 (46) hide show
  1. package/CHANGELOG.md +355 -13
  2. package/lib/components-react/UiComponents.js +1 -1
  3. package/lib/components-react/UiComponents.js.map +1 -1
  4. package/lib/components-react/common/DisposePolyfill.d.ts +5 -0
  5. package/lib/components-react/common/DisposePolyfill.d.ts.map +1 -0
  6. package/lib/components-react/common/DisposePolyfill.js +14 -0
  7. package/lib/components-react/common/DisposePolyfill.js.map +1 -0
  8. package/lib/components-react/common/ImageRenderer.js +1 -1
  9. package/lib/components-react/common/ImageRenderer.js.map +1 -1
  10. package/lib/components-react/converters/PointTypeConverter.d.ts.map +1 -1
  11. package/lib/components-react/converters/PointTypeConverter.js +1 -0
  12. package/lib/components-react/converters/PointTypeConverter.js.map +1 -1
  13. package/lib/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  14. package/lib/components-react/filter-builder/FilterBuilderRule.js +2 -5
  15. package/lib/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  16. package/lib/components-react/filter-builder/FilterBuilderRuleValue.d.ts +6 -0
  17. package/lib/components-react/filter-builder/FilterBuilderRuleValue.d.ts.map +1 -1
  18. package/lib/components-react/filter-builder/FilterBuilderRuleValue.js +3 -2
  19. package/lib/components-react/filter-builder/FilterBuilderRuleValue.js.map +1 -1
  20. package/lib/components-react/new-editors/EditorRenderer.d.ts +9 -1
  21. package/lib/components-react/new-editors/EditorRenderer.d.ts.map +1 -1
  22. package/lib/components-react/new-editors/EditorRenderer.js +6 -3
  23. package/lib/components-react/new-editors/EditorRenderer.js.map +1 -1
  24. package/lib/components-react/new-editors/editors/NumericEditor.d.ts.map +1 -1
  25. package/lib/components-react/new-editors/editors/NumericEditor.js +9 -4
  26. package/lib/components-react/new-editors/editors/NumericEditor.js.map +1 -1
  27. package/lib/components-react/properties/renderers/PropertyGridColumns.d.ts.map +1 -1
  28. package/lib/components-react/properties/renderers/PropertyGridColumns.js +1 -1
  29. package/lib/components-react/properties/renderers/PropertyGridColumns.js.map +1 -1
  30. package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +1 -1
  31. package/lib/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  32. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts +6 -2
  33. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts.map +1 -1
  34. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js +16 -1
  35. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  36. package/lib/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts.map +1 -1
  37. package/lib/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +1 -1
  38. package/lib/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  39. package/lib/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.d.ts.map +1 -1
  40. package/lib/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  41. package/lib/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  42. package/lib/components-react/tree/controlled/TreeEventHandler.d.ts +8 -3
  43. package/lib/components-react/tree/controlled/TreeEventHandler.d.ts.map +1 -1
  44. package/lib/components-react/tree/controlled/TreeEventHandler.js +18 -2
  45. package/lib/components-react/tree/controlled/TreeEventHandler.js.map +1 -1
  46. package/package.json +16 -15
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedPropertyGrid.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACH,OAAO,gCAAgC,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,QAAQ,EAAE,gBA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S,EAAE,GAAG,SAAS,IAAI;gBAC3B,OAAO,EAAE,MAAM;aAChB;YAED,6BACE,GAAG,EAAE,MAAM,EACX,SAAS,EAAC,4CAA4C,IAErD,cAAc,EAAE,CACb,CACF,CACF,CACP,CAAC;AACJ,CAAC,EACD,QAAQ,CACT,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AASlD,MAAM,qBAAqB,GAAyC,CAAC,KAAK,EAAE,EAAE;IAC5E,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,MAAM,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAChC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QACpE,eAAe,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;IAErD,OAAO,6BAAK,GAAG,EAAE,MAAM,IAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAO,CAAC;AAC9E,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport \"./VirtualizedPropertyGrid.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n ListChildComponentProps,\n VariableSizeListProps,\n} from \"react-window\";\nimport { areEqual, VariableSizeList } from \"react-window\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { createContextWithMandatoryProvider } from \"../../common/UseContextWithMandatoryProvider.js\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer.js\";\nimport type { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer.js\";\nimport type { PropertyGridColumnInfo } from \"../../properties/renderers/PropertyGridColumns.js\";\nimport type { PropertyValueRendererManager } from \"../../properties/ValueRendererManager.js\";\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase.js\";\nimport type {\n FlatGridItem,\n GridCategoryItem,\n} from \"../internal/flat-items/FlatGridItem.js\";\nimport { MutableCategorizedPrimitiveProperty } from \"../internal/flat-items/MutableCategorizedPrimitiveProperty.js\";\nimport { MutableCustomGridCategory } from \"../internal/flat-items/MutableCustomGridCategory.js\";\nimport { FlatGridItemType } from \"../internal/flat-items/MutableFlatGridItem.js\";\nimport { MutableGridCategory } from \"../internal/flat-items/MutableGridCategory.js\";\nimport { FlatPropertyRenderer } from \"../internal/flat-properties/FlatPropertyRenderer.js\";\nimport type { IPropertyGridEventHandler } from \"../internal/PropertyGridEventHandler.js\";\nimport type { IPropertyGridModel } from \"../internal/PropertyGridModel.js\";\nimport type { PropertyCategoryRendererProps } from \"../PropertyCategoryRendererManager.js\";\nimport { PropertyCategoryRendererManager } from \"../PropertyCategoryRendererManager.js\";\nimport type {\n IPropertyDataProvider,\n PropertyCategory,\n} from \"../PropertyDataProvider.js\";\nimport { ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier.js\";\nimport { FlatItemNestedBorderWrapper } from \"./FlatItemNestedBorderWrapper.js\";\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock.js\";\nimport type {\n CommonPropertyGridProps,\n PropertyGridContentHighlightProps,\n} from \"./PropertyGridCommons.js\";\nimport { PropertyGridCommons } from \"./PropertyGridCommons.js\";\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier.js\";\nimport { useElementsScrollStorage } from \"../../common/UseElementsScrollStorage.js\";\nimport { Orientation } from \"../../common/Orientation.js\";\n\n/** Properties for [[VirtualizedPropertyGrid]] React component\n * @public\n */\nexport interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {\n /** Property grid view model that defines what needs to be rendered */\n model: IPropertyGridModel;\n /** Handler of the events raised from the property grid */\n eventHandler: IPropertyGridEventHandler;\n /** Property data provider used by the property grid */\n dataProvider: IPropertyDataProvider;\n /** Properties for highlighting property data in the grid. */\n highlight?: PropertyGridContentHighlightProps;\n /** Custom property category renderer manager. Defaults to [[PropertyCategoryRendererManager.defaultManager]]. */\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\n /** Width of the property grid component. */\n width: number;\n /** Height of the property grid component. */\n height: number;\n /**\n * Specifies which editors system should be used: legacy or the new one.\n * @default \"legacy\"\n * @beta\n */\n editorSystem?: \"legacy\" | \"new\";\n}\n\n/** State of [[VirtualizedPropertyGrid]] React component\n * @internal\n */\ninterface VirtualizedPropertyGridState {\n /** List of PropertyGrid categories */\n gridItems: FlatGridItem[];\n /** Actual orientation used by the property grid */\n orientation: Orientation;\n /** Keeps record of dynamic node heights */\n dynamicNodeHeights: Map<string, number>;\n}\n\n/**\n * Context of [[VirtualizedPropertyGrid]] component.\n * @internal\n */\nexport interface PropertyGridInternalContext {\n gridItems: FlatGridItem[];\n gridEventHandler: IPropertyGridEventHandler;\n gridModel: IPropertyGridModel;\n\n style?: React.CSSProperties;\n className?: string;\n gridContext: VirtualizedPropertyGridContext;\n onItemHeightChanged: (index: number, key: string, height: number) => void;\n}\n\n/**\n * Context of the surrounding [VirtualizedPropertyGrid]($components-react) component.\n * @public\n */\nexport interface VirtualizedPropertyGridContext {\n orientation: Orientation;\n gridWidth: number;\n\n isPropertyHoverEnabled: boolean;\n isPropertySelectionEnabled: boolean;\n selectedPropertyKey?: string;\n isPropertyEditingEnabled?: boolean;\n\n alwaysShowEditor?: (property: PropertyRecord) => boolean;\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyContextMenu?: (\n property: PropertyRecord,\n e: React.MouseEvent\n ) => void;\n\n editingPropertyKey?: string;\n onEditCommit?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => void;\n onEditCancel?: () => void;\n editorSystem: \"legacy\" | \"new\";\n\n eventHandler: IPropertyGridEventHandler;\n dataProvider: IPropertyDataProvider;\n\n actionButtonRenderers?: ActionButtonRenderer[];\n propertyValueRendererManager?: PropertyValueRendererManager;\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\n\n columnRatio: number;\n columnInfo: PropertyGridColumnInfo;\n isResizeHandleBeingDragged: boolean;\n isResizeHandleHovered: boolean;\n onColumnRatioChanged: (ratio: number) => void | {\n ratio: number;\n };\n onResizeHandleDragChanged: (newValue: boolean) => void;\n onResizeHandleHoverChanged: (newValue: boolean) => void;\n\n highlight?: PropertyGridContentHighlightProps;\n}\n\nconst [\n PropertyGridInternalContextProvider,\n _PropertyGridInternalContextConsumer,\n usePropertyGridInternalContext,\n] = createContextWithMandatoryProvider<PropertyGridInternalContext>(\n \"PropertyGridInternalContext\"\n);\n\nconst ACTION_BUTTON_DEFAULT_WIDTH = 90;\nconst CATEGORY_HEADER_HEIGHT = 42;\nconst CATEGORY_PROPERTY_HEIGHT = 28;\nconst VERTICAL_CATEGORY_PROPERTY_HEIGHT = 48;\n\n/**\n * VirtualizedPropertyGrid React component.\n * @public\n */\nexport class VirtualizedPropertyGrid extends React.Component<\n VirtualizedPropertyGridProps,\n VirtualizedPropertyGridState\n> {\n private _listRef = React.createRef<VariableSizeList>();\n\n constructor(props: VirtualizedPropertyGridProps) {\n super(props);\n this.state = {\n gridItems: [],\n orientation:\n props.orientation ??\n PropertyGridCommons.getCurrentOrientation(\n props.width,\n undefined,\n props.isOrientationFixed,\n props.horizontalOrientationMinWidth\n ),\n dynamicNodeHeights: new Map(),\n };\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: VirtualizedPropertyGridProps) {\n if (\n this.props.orientation !== prevProps.orientation ||\n this.props.isOrientationFixed !== prevProps.isOrientationFixed ||\n this.props.horizontalOrientationMinWidth !==\n prevProps.horizontalOrientationMinWidth ||\n this.props.width !== prevProps.width\n )\n this.updateOrientation(this.props.width);\n\n if (this.props.model !== prevProps.model) {\n if (this._listRef.current) this._listRef.current.resetAfterIndex(0);\n }\n\n if (\n this.props.highlight !== prevProps.highlight &&\n this.props.highlight?.activeHighlight &&\n this.state.gridItems.length !== 0\n ) {\n let index = 0;\n let foundMatchingItem = false;\n for (const item of this.state.gridItems) {\n if (\n (item instanceof MutableCategorizedPrimitiveProperty &&\n this.props.highlight.activeHighlight.highlightedItemIdentifier ===\n item.derivedRecord.property.name) ||\n (item instanceof MutableGridCategory &&\n this.props.highlight.activeHighlight.highlightedItemIdentifier ===\n item.name)\n ) {\n foundMatchingItem = true;\n break;\n }\n index++;\n }\n if (foundMatchingItem) {\n if (this._listRef.current) this._listRef.current.scrollToItem(index);\n }\n }\n }\n\n /** @internal */\n public static getDerivedStateFromProps(\n props: VirtualizedPropertyGridProps,\n state: VirtualizedPropertyGridState\n ): VirtualizedPropertyGridState | null {\n return {\n ...state,\n gridItems: props.model.getVisibleFlatGrid(),\n };\n }\n\n private updateOrientation(width: number) {\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {\n ...this.props,\n };\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(\n width,\n orientation,\n isOrientationFixed,\n horizontalOrientationMinWidth\n );\n\n if (currentOrientation !== this.state.orientation) {\n this.setState({ orientation: currentOrientation });\n }\n }\n\n /**\n * Calculate given node height depending on it's type, position in category, parent category depth and current orientation.\n * @param node FlatGridItem node for which to calculate height\n * @returns current height of node.\n */\n private calculateNodeHeight(node: FlatGridItem) {\n return getPropertyHeight(this.state);\n\n function getPropertyHeight(state: VirtualizedPropertyGridState) {\n const dynamicHeight = state.dynamicNodeHeights.get(node.key);\n if (dynamicHeight !== undefined) {\n if (node instanceof MutableCustomGridCategory) {\n return CATEGORY_HEADER_HEIGHT + (node.isExpanded ? dynamicHeight : 0);\n }\n\n return dynamicHeight;\n }\n\n if (node.type === FlatGridItemType.Category) {\n return CATEGORY_HEADER_HEIGHT;\n }\n\n return state.orientation === Orientation.Vertical\n ? VERTICAL_CATEGORY_PROPERTY_HEIGHT\n : CATEGORY_PROPERTY_HEIGHT;\n }\n }\n\n private _handleNodeHeightChange = (\n index: number,\n key: string,\n newHeight: number\n ) => {\n if (this.state.dynamicNodeHeights.get(key) === newHeight) {\n return;\n }\n\n this.setState(\n (state) => {\n return {\n ...state,\n dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(\n key,\n newHeight\n ),\n };\n },\n () => this._listRef.current!.resetAfterIndex(index)\n );\n };\n\n private _calculateNodeHeightByIndex = (index: number) => {\n const node = this.state.gridItems[index];\n return this.calculateNodeHeight(node);\n };\n\n private calculateEstimatedHeight() {\n let sum = 0;\n for (const node of this.state.gridItems)\n sum += this.calculateNodeHeight(node);\n\n return Math.ceil(sum / this.state.gridItems.length);\n }\n\n private _getNodeKey = (index: number) => {\n const node = this.state.gridItems[index];\n return node.key;\n };\n\n private _getMaxItemDepth = () => {\n let depth = 0;\n for (const item of this.state.gridItems) {\n if (depth < item.depth) {\n depth = item.depth;\n }\n }\n return depth + 1;\n };\n\n public override render() {\n const defaultActionButtonWidth =\n (this.props.actionButtonRenderers?.length ?? 0) > 0\n ? ACTION_BUTTON_DEFAULT_WIDTH\n : undefined;\n\n return (\n <ColumnResizingPropertyListPropsSupplier\n orientation={this.state.orientation}\n width={this.props.width}\n minLabelWidth={this.props.minLabelWidth}\n minValueWidth={this.props.minValueWidth}\n actionButtonWidth={\n this.props.actionButtonWidth !== undefined\n ? this.props.actionButtonWidth\n : defaultActionButtonWidth\n }\n maxPropertyDepth={this._getMaxItemDepth()}\n >\n {(columnResizeContext) => (\n <PropertyGridEventsRelatedPropsSupplier\n isPropertySelectionEnabled={\n this.props.isPropertySelectionEnabled ?? false\n }\n isPropertySelectionOnRightClickEnabled={\n this.props.isPropertySelectionOnRightClickEnabled\n }\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\n onPropertyContextMenu={this.props.onPropertyContextMenu}\n onPropertyUpdated={this.props.onPropertyUpdated}\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\n >\n {(selectionContext) => {\n const gridContext: VirtualizedPropertyGridContext = {\n orientation: columnResizeContext.orientation,\n gridWidth: this.props.width,\n\n isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,\n isPropertySelectionEnabled:\n selectionContext.isPropertySelectionEnabled,\n selectedPropertyKey: selectionContext.selectedPropertyKey,\n isPropertyEditingEnabled: this.props.isPropertyEditingEnabled,\n\n alwaysShowEditor: this.props.alwaysShowEditor,\n onPropertyClicked: selectionContext.onPropertyClicked,\n onPropertyRightClicked: selectionContext.onPropertyRightClicked,\n onPropertyContextMenu: selectionContext.onPropertyContextMenu,\n\n editingPropertyKey: selectionContext.editingPropertyKey,\n onEditCommit: selectionContext.onEditCommit,\n onEditCancel: selectionContext.onEditCancel,\n editorSystem: this.props.editorSystem ?? \"legacy\",\n\n eventHandler: this.props.eventHandler,\n dataProvider: this.props.dataProvider,\n\n actionButtonRenderers: this.props.actionButtonRenderers,\n propertyValueRendererManager:\n this.props.propertyValueRendererManager,\n propertyCategoryRendererManager:\n this.props.propertyCategoryRendererManager,\n\n columnRatio: columnResizeContext.columnRatio,\n columnInfo: columnResizeContext.columnInfo,\n isResizeHandleBeingDragged:\n columnResizeContext.isResizeHandleBeingDragged,\n isResizeHandleHovered:\n columnResizeContext.isResizeHandleHovered,\n onColumnRatioChanged: columnResizeContext.onColumnChanged,\n onResizeHandleDragChanged:\n columnResizeContext.onResizeHandleDragChanged,\n onResizeHandleHoverChanged:\n columnResizeContext.onResizeHandleHoverChanged,\n\n highlight: this.props.highlight,\n };\n\n const renderContext: PropertyGridInternalContext = {\n gridItems: this.state.gridItems,\n gridEventHandler: this.props.eventHandler,\n gridModel: this.props.model,\n style: this.props.style,\n className: this.props.className,\n onItemHeightChanged: this._handleNodeHeightChange,\n gridContext,\n };\n\n return (\n <PropertyGridInternalContextProvider value={renderContext}>\n <VirtualizedPropertyGridInternal\n width={this.props.width}\n height={this.props.height}\n itemCount={this.state.gridItems.length}\n itemSize={this._calculateNodeHeightByIndex}\n estimatedItemSize={this.calculateEstimatedHeight()}\n overscanCount={10}\n layout=\"vertical\"\n style={this.props.style}\n itemKey={this._getNodeKey}\n ref={this._listRef}\n />\n </PropertyGridInternalContextProvider>\n );\n }}\n </PropertyGridEventsRelatedPropsSupplier>\n )}\n </ColumnResizingPropertyListPropsSupplier>\n );\n }\n}\n\nconst VirtualizedPropertyGridInternal = React.forwardRef<\n VariableSizeList,\n Omit<VariableSizeListProps, \"children\">\n>(function VirtualizedPropertyGridInternal(props, ref) {\n const { gridContext } = usePropertyGridInternalContext(FlatGridItemNode);\n\n React.useEffect(() => {\n return gridContext.dataProvider.onDataChanged.addListener(() => {\n gridContext.onEditCancel?.();\n });\n }, [gridContext]);\n\n return (\n <div\n className={classnames(\n \"components-virtualized-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <VariableSizeList\n {...props}\n className={classnames(\n \"components-property-grid-wrapper\",\n \"ReactWindow__VariableSizeList\",\n props.className\n )}\n ref={ref}\n >\n {FlatGridItemNode}\n </VariableSizeList>\n </div>\n );\n});\n\n/**\n * Returns callbacks for persisting and restoring [[VirtualizedPropertyGrid]] layout state.\n * Returned `ref` should be set on container containing [[VirtualizedPropertyGrid]].\n * @public\n */\nexport function useVirtualizedPropertyGridLayoutStorage<T extends Element>() {\n return useElementsScrollStorage<T>(\"ReactWindow__VariableSizeList\");\n}\n\nconst FlatGridItemNode = React.memo(\n ({ index, style: virtualizedListStyle }: ListChildComponentProps) => {\n const {\n gridItems,\n gridEventHandler,\n gridModel,\n gridContext,\n className,\n style,\n onItemHeightChanged,\n } = usePropertyGridInternalContext(FlatGridItemNode);\n const node = gridItems[index];\n const divRef = React.useRef<HTMLDivElement>(null);\n const previousHeightRef = React.useRef(0);\n\n const onExpansionToggled = React.useCallback(\n () => gridEventHandler.onExpansionToggled(node.selectionKey),\n [gridEventHandler, node.selectionKey]\n );\n const onHeightChanged = React.useCallback(\n (newHeight: number) => onItemHeightChanged(index, node.key, newHeight),\n [onItemHeightChanged, index, node.key]\n );\n\n const minHeight = React.useMemo(() => {\n if (node.type === FlatGridItemType.Category)\n return CATEGORY_HEADER_HEIGHT;\n\n return gridContext.orientation === Orientation.Vertical\n ? VERTICAL_CATEGORY_PROPERTY_HEIGHT\n : CATEGORY_PROPERTY_HEIGHT;\n }, [gridContext.orientation, node.type]);\n\n React.useLayoutEffect(() => {\n assert(divRef.current !== null);\n const refHeight = divRef.current.getBoundingClientRect().height;\n const currentHeight = Math.max(refHeight, minHeight);\n\n if (currentHeight !== previousHeightRef.current) {\n onHeightChanged(currentHeight);\n previousHeightRef.current = currentHeight;\n }\n });\n\n function getDisplayNode() {\n const lastInNumberOfCategories = node.lastInNumberOfCategories;\n switch (node.type) {\n case FlatGridItemType.Category:\n const categoryRendererManager =\n gridContext.propertyCategoryRendererManager ??\n PropertyCategoryRendererManager.defaultManager;\n const customRenderer =\n categoryRendererManager.getCategoryComponent(node);\n const wrapperClassName = classnames(\n \"virtualized-grid-node-content\",\n customRenderer !== undefined\n ? \"virtualized-grid-node-custom-category\"\n : \"virtualized-grid-node-category\"\n );\n return (\n <FlatItemNestedBorderWrapper\n borderCount={node.depth}\n bottomBorderCount={lastInNumberOfCategories}\n className={wrapperClassName}\n >\n <PropertyCategoryBlock\n className={className}\n style={style}\n category={node.derivedCategory}\n onExpansionToggled={onExpansionToggled}\n highlight={\n gridContext.highlight?.filteredTypes?.includes(\n FilteredType.Category\n )\n ? gridContext.highlight\n : undefined\n }\n >\n {customRenderer !== undefined && (\n <CustomCategoryContent\n renderer={customRenderer}\n categoryItem={node}\n gridContext={gridContext}\n onHeightChanged={onHeightChanged}\n />\n )}\n </PropertyCategoryBlock>\n </FlatItemNestedBorderWrapper>\n );\n case FlatGridItemType.Array:\n case FlatGridItemType.Struct:\n case FlatGridItemType.Primitive:\n const selectionKey = node.selectionKey;\n const parentCategoryItem = gridModel.getItem(\n node.parentCategorySelectionKey\n ) as GridCategoryItem;\n\n return (\n <FlatItemNestedBorderWrapper\n borderCount={parentCategoryItem.depth + 1}\n bottomBorderCount={lastInNumberOfCategories}\n className=\"virtualized-grid-node-content\"\n >\n <FlatPropertyRenderer\n key={node.key}\n uniqueKey={selectionKey}\n propertyRecord={node.derivedRecord}\n orientation={gridContext.orientation}\n indentation={node.depth}\n width={gridContext.gridWidth}\n isHoverable={gridContext.isPropertyHoverEnabled}\n isSelectable={gridContext.isPropertySelectionEnabled}\n isSelected={selectionKey === gridContext.selectedPropertyKey}\n onClick={gridContext.onPropertyClicked}\n onRightClick={gridContext.onPropertyRightClicked}\n onContextMenu={gridContext.onPropertyContextMenu}\n category={parentCategoryItem.derivedCategory}\n isEditing={selectionKey === gridContext.editingPropertyKey}\n isPropertyEditingEnabled={gridContext.isPropertyEditingEnabled}\n alwaysShowEditor={gridContext.alwaysShowEditor}\n onEditCommit={gridContext.onEditCommit}\n onEditCancel={gridContext.onEditCancel}\n editorSystem={gridContext.editorSystem}\n isExpanded={node.isExpanded}\n onExpansionToggled={onExpansionToggled}\n onHeightChanged={onHeightChanged}\n actionButtonRenderers={gridContext.actionButtonRenderers}\n propertyValueRendererManager={\n gridContext.propertyValueRendererManager\n }\n columnRatio={gridContext.columnRatio}\n columnInfo={gridContext.columnInfo}\n isResizeHandleBeingDragged={\n gridContext.isResizeHandleBeingDragged\n }\n isResizeHandleHovered={gridContext.isResizeHandleHovered}\n onColumnRatioChanged={gridContext.onColumnRatioChanged}\n onResizeHandleDragChanged={\n gridContext.onResizeHandleDragChanged\n }\n onResizeHandleHoverChanged={\n gridContext.onResizeHandleHoverChanged\n }\n highlight={\n gridContext.highlight\n ? {\n applyOnLabel:\n gridContext.highlight.filteredTypes?.includes(\n FilteredType.Label\n ) ?? false,\n applyOnValue:\n gridContext.highlight.filteredTypes?.includes(\n FilteredType.Value\n ) ?? false,\n ...gridContext.highlight,\n }\n : undefined\n }\n />\n </FlatItemNestedBorderWrapper>\n );\n }\n }\n\n return (\n <div className=\"virtualized-grid-node\" style={virtualizedListStyle}>\n <div\n className=\"virtualized-grid-node-content-wrapper\"\n style={{\n minHeight: `${minHeight}px`,\n display: \"grid\",\n }}\n >\n <div\n ref={divRef}\n className=\"virtualized-grid-node-content-wrapper-item\"\n >\n {getDisplayNode()}\n </div>\n </div>\n </div>\n );\n },\n areEqual\n);\n\nFlatGridItemNode.displayName = \"FlatGridItemNode\";\n\ninterface CustomCategoryContentProps {\n categoryItem: GridCategoryItem;\n renderer: React.ComponentType<PropertyCategoryRendererProps>;\n gridContext: VirtualizedPropertyGridContext;\n onHeightChanged: (newHeight: number) => void;\n}\n\nconst CustomCategoryContent: React.FC<CustomCategoryContentProps> = (props) => {\n const { onHeightChanged } = props;\n const divRef = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n assert(divRef.current !== null);\n const contentHeight = divRef.current.getBoundingClientRect().height;\n onHeightChanged(contentHeight);\n }, [props.gridContext.orientation, onHeightChanged]);\n\n return <div ref={divRef}>{React.createElement(props.renderer, props)}</div>;\n};\n"]}
1
+ {"version":3,"file":"VirtualizedPropertyGrid.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACH,OAAO,gCAAgC,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kCAAkC,E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4C,IAErD,cAAc,EAAE,CACb,CACF,CACF,CACP,CAAC;AACJ,CAAC,EACD,QAAQ,CACT,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AASlD,MAAM,qBAAqB,GAAyC,CAAC,KAAK,EAAE,EAAE;IAC5E,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,MAAM,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAChC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QACpE,eAAe,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;IAErD,OAAO,6BAAK,GAAG,EAAE,MAAM,IAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAO,CAAC;AAC9E,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport \"./VirtualizedPropertyGrid.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n ListChildComponentProps,\n VariableSizeListProps,\n} from \"react-window\";\nimport { areEqual, VariableSizeList } from \"react-window\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { createContextWithMandatoryProvider } from \"../../common/UseContextWithMandatoryProvider.js\";\nimport type { PropertyUpdatedArgs } from \"../../editors/EditorContainer.js\";\nimport type { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer.js\";\nimport type { PropertyGridColumnInfo } from \"../../properties/renderers/PropertyGridColumns.js\";\nimport type { PropertyValueRendererManager } from \"../../properties/ValueRendererManager.js\";\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase.js\";\nimport type {\n FlatGridItem,\n GridCategoryItem,\n} from \"../internal/flat-items/FlatGridItem.js\";\nimport { MutableCategorizedPrimitiveProperty } from \"../internal/flat-items/MutableCategorizedPrimitiveProperty.js\";\nimport { MutableCustomGridCategory } from \"../internal/flat-items/MutableCustomGridCategory.js\";\nimport { FlatGridItemType } from \"../internal/flat-items/MutableFlatGridItem.js\";\nimport { MutableGridCategory } from \"../internal/flat-items/MutableGridCategory.js\";\nimport { FlatPropertyRenderer } from \"../internal/flat-properties/FlatPropertyRenderer.js\";\nimport type { IPropertyGridEventHandler } from \"../internal/PropertyGridEventHandler.js\";\nimport type { IPropertyGridModel } from \"../internal/PropertyGridModel.js\";\nimport type { PropertyCategoryRendererProps } from \"../PropertyCategoryRendererManager.js\";\nimport { PropertyCategoryRendererManager } from \"../PropertyCategoryRendererManager.js\";\nimport type {\n IPropertyDataProvider,\n PropertyCategory,\n} from \"../PropertyDataProvider.js\";\nimport { ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier.js\";\nimport { FlatItemNestedBorderWrapper } from \"./FlatItemNestedBorderWrapper.js\";\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock.js\";\nimport type {\n CommonPropertyGridProps,\n PropertyGridContentHighlightProps,\n} from \"./PropertyGridCommons.js\";\nimport { PropertyGridCommons } from \"./PropertyGridCommons.js\";\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier.js\";\nimport { useElementsScrollStorage } from \"../../common/UseElementsScrollStorage.js\";\nimport { Orientation } from \"../../common/Orientation.js\";\n\n/** Properties for [[VirtualizedPropertyGrid]] React component\n * @public\n */\nexport interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {\n /** Property grid view model that defines what needs to be rendered */\n model: IPropertyGridModel;\n /** Handler of the events raised from the property grid */\n eventHandler: IPropertyGridEventHandler;\n /** Property data provider used by the property grid */\n dataProvider: IPropertyDataProvider;\n /** Properties for highlighting property data in the grid. */\n highlight?: PropertyGridContentHighlightProps;\n /** Custom property category renderer manager. Defaults to [[PropertyCategoryRendererManager.defaultManager]]. */\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\n /** Width of the property grid component. */\n width: number;\n /** Height of the property grid component. */\n height: number;\n /**\n * Specifies which editors system should be used: legacy or the new one.\n * @default \"legacy\"\n * @beta\n */\n editorSystem?: \"legacy\" | \"new\";\n}\n\n/** State of [[VirtualizedPropertyGrid]] React component\n * @internal\n */\ninterface VirtualizedPropertyGridState {\n /** List of PropertyGrid categories */\n gridItems: FlatGridItem[];\n /** Actual orientation used by the property grid */\n orientation: Orientation;\n /** Keeps record of dynamic node heights */\n dynamicNodeHeights: Map<string, number>;\n}\n\n/**\n * Context of [[VirtualizedPropertyGrid]] component.\n * @internal\n */\nexport interface PropertyGridInternalContext {\n gridItems: FlatGridItem[];\n gridEventHandler: IPropertyGridEventHandler;\n gridModel: IPropertyGridModel;\n\n style?: React.CSSProperties;\n className?: string;\n gridContext: VirtualizedPropertyGridContext;\n onItemHeightChanged: (index: number, key: string, height: number) => void;\n}\n\n/**\n * Context of the surrounding [[VirtualizedPropertyGrid]] component.\n * @public\n */\nexport interface VirtualizedPropertyGridContext {\n orientation: Orientation;\n gridWidth: number;\n\n isPropertyHoverEnabled: boolean;\n isPropertySelectionEnabled: boolean;\n selectedPropertyKey?: string;\n isPropertyEditingEnabled?: boolean;\n\n alwaysShowEditor?: (property: PropertyRecord) => boolean;\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyContextMenu?: (\n property: PropertyRecord,\n e: React.MouseEvent\n ) => void;\n\n editingPropertyKey?: string;\n onEditCommit?: (\n args: PropertyUpdatedArgs,\n category: PropertyCategory\n ) => void;\n onEditCancel?: () => void;\n editorSystem: \"legacy\" | \"new\";\n\n eventHandler: IPropertyGridEventHandler;\n dataProvider: IPropertyDataProvider;\n\n actionButtonRenderers?: ActionButtonRenderer[];\n propertyValueRendererManager?: PropertyValueRendererManager;\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\n\n columnRatio: number;\n columnInfo: PropertyGridColumnInfo;\n isResizeHandleBeingDragged: boolean;\n isResizeHandleHovered: boolean;\n onColumnRatioChanged: (ratio: number) => void | {\n ratio: number;\n };\n onResizeHandleDragChanged: (newValue: boolean) => void;\n onResizeHandleHoverChanged: (newValue: boolean) => void;\n\n highlight?: PropertyGridContentHighlightProps;\n}\n\nconst [\n PropertyGridInternalContextProvider,\n _PropertyGridInternalContextConsumer,\n usePropertyGridInternalContext,\n] = createContextWithMandatoryProvider<PropertyGridInternalContext>(\n \"PropertyGridInternalContext\"\n);\n\nconst ACTION_BUTTON_DEFAULT_WIDTH = 90;\nconst CATEGORY_HEADER_HEIGHT = 42;\nconst CATEGORY_PROPERTY_HEIGHT = 28;\nconst VERTICAL_CATEGORY_PROPERTY_HEIGHT = 48;\n\n/**\n * VirtualizedPropertyGrid React component.\n * @public\n */\nexport class VirtualizedPropertyGrid extends React.Component<\n VirtualizedPropertyGridProps,\n VirtualizedPropertyGridState\n> {\n private _listRef = React.createRef<VariableSizeList>();\n\n constructor(props: VirtualizedPropertyGridProps) {\n super(props);\n this.state = {\n gridItems: [],\n orientation:\n props.orientation ??\n PropertyGridCommons.getCurrentOrientation(\n props.width,\n undefined,\n props.isOrientationFixed,\n props.horizontalOrientationMinWidth\n ),\n dynamicNodeHeights: new Map(),\n };\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: VirtualizedPropertyGridProps) {\n if (\n this.props.orientation !== prevProps.orientation ||\n this.props.isOrientationFixed !== prevProps.isOrientationFixed ||\n this.props.horizontalOrientationMinWidth !==\n prevProps.horizontalOrientationMinWidth ||\n this.props.width !== prevProps.width\n )\n this.updateOrientation(this.props.width);\n\n if (this.props.model !== prevProps.model) {\n if (this._listRef.current) this._listRef.current.resetAfterIndex(0);\n }\n\n if (\n this.props.highlight !== prevProps.highlight &&\n this.props.highlight?.activeHighlight &&\n this.state.gridItems.length !== 0\n ) {\n let index = 0;\n let foundMatchingItem = false;\n for (const item of this.state.gridItems) {\n if (\n (item instanceof MutableCategorizedPrimitiveProperty &&\n this.props.highlight.activeHighlight.highlightedItemIdentifier ===\n item.derivedRecord.property.name) ||\n (item instanceof MutableGridCategory &&\n this.props.highlight.activeHighlight.highlightedItemIdentifier ===\n item.name)\n ) {\n foundMatchingItem = true;\n break;\n }\n index++;\n }\n if (foundMatchingItem) {\n if (this._listRef.current) this._listRef.current.scrollToItem(index);\n }\n }\n }\n\n /** @internal */\n public static getDerivedStateFromProps(\n props: VirtualizedPropertyGridProps,\n state: VirtualizedPropertyGridState\n ): VirtualizedPropertyGridState | null {\n return {\n ...state,\n gridItems: props.model.getVisibleFlatGrid(),\n };\n }\n\n private updateOrientation(width: number) {\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {\n ...this.props,\n };\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(\n width,\n orientation,\n isOrientationFixed,\n horizontalOrientationMinWidth\n );\n\n if (currentOrientation !== this.state.orientation) {\n this.setState({ orientation: currentOrientation });\n }\n }\n\n /**\n * Calculate given node height depending on it's type, position in category, parent category depth and current orientation.\n * @param node FlatGridItem node for which to calculate height\n * @returns current height of node.\n */\n private calculateNodeHeight(node: FlatGridItem) {\n return getPropertyHeight(this.state);\n\n function getPropertyHeight(state: VirtualizedPropertyGridState) {\n const dynamicHeight = state.dynamicNodeHeights.get(node.key);\n if (dynamicHeight !== undefined) {\n if (node instanceof MutableCustomGridCategory) {\n return CATEGORY_HEADER_HEIGHT + (node.isExpanded ? dynamicHeight : 0);\n }\n\n return dynamicHeight;\n }\n\n if (node.type === FlatGridItemType.Category) {\n return CATEGORY_HEADER_HEIGHT;\n }\n\n return state.orientation === Orientation.Vertical\n ? VERTICAL_CATEGORY_PROPERTY_HEIGHT\n : CATEGORY_PROPERTY_HEIGHT;\n }\n }\n\n private _handleNodeHeightChange = (\n index: number,\n key: string,\n newHeight: number\n ) => {\n if (this.state.dynamicNodeHeights.get(key) === newHeight) {\n return;\n }\n\n this.setState(\n (state) => {\n return {\n ...state,\n dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(\n key,\n newHeight\n ),\n };\n },\n () => this._listRef.current!.resetAfterIndex(index)\n );\n };\n\n private _calculateNodeHeightByIndex = (index: number) => {\n const node = this.state.gridItems[index];\n return this.calculateNodeHeight(node);\n };\n\n private calculateEstimatedHeight() {\n let sum = 0;\n for (const node of this.state.gridItems)\n sum += this.calculateNodeHeight(node);\n\n return Math.ceil(sum / this.state.gridItems.length);\n }\n\n private _getNodeKey = (index: number) => {\n const node = this.state.gridItems[index];\n return node.key;\n };\n\n private _getMaxItemDepth = () => {\n let depth = 0;\n for (const item of this.state.gridItems) {\n if (depth < item.depth) {\n depth = item.depth;\n }\n }\n return depth + 1;\n };\n\n public override render() {\n const defaultActionButtonWidth =\n (this.props.actionButtonRenderers?.length ?? 0) > 0\n ? ACTION_BUTTON_DEFAULT_WIDTH\n : undefined;\n\n return (\n <ColumnResizingPropertyListPropsSupplier\n orientation={this.state.orientation}\n width={this.props.width}\n minLabelWidth={this.props.minLabelWidth}\n minValueWidth={this.props.minValueWidth}\n actionButtonWidth={\n this.props.actionButtonWidth !== undefined\n ? this.props.actionButtonWidth\n : defaultActionButtonWidth\n }\n maxPropertyDepth={this._getMaxItemDepth()}\n >\n {(columnResizeContext) => (\n <PropertyGridEventsRelatedPropsSupplier\n isPropertySelectionEnabled={\n this.props.isPropertySelectionEnabled ?? false\n }\n isPropertySelectionOnRightClickEnabled={\n this.props.isPropertySelectionOnRightClickEnabled\n }\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\n onPropertyContextMenu={this.props.onPropertyContextMenu}\n onPropertyUpdated={this.props.onPropertyUpdated}\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\n >\n {(selectionContext) => {\n const gridContext: VirtualizedPropertyGridContext = {\n orientation: columnResizeContext.orientation,\n gridWidth: this.props.width,\n\n isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,\n isPropertySelectionEnabled:\n selectionContext.isPropertySelectionEnabled,\n selectedPropertyKey: selectionContext.selectedPropertyKey,\n isPropertyEditingEnabled: this.props.isPropertyEditingEnabled,\n\n alwaysShowEditor: this.props.alwaysShowEditor,\n onPropertyClicked: selectionContext.onPropertyClicked,\n onPropertyRightClicked: selectionContext.onPropertyRightClicked,\n onPropertyContextMenu: selectionContext.onPropertyContextMenu,\n\n editingPropertyKey: selectionContext.editingPropertyKey,\n onEditCommit: selectionContext.onEditCommit,\n onEditCancel: selectionContext.onEditCancel,\n editorSystem: this.props.editorSystem ?? \"legacy\",\n\n eventHandler: this.props.eventHandler,\n dataProvider: this.props.dataProvider,\n\n actionButtonRenderers: this.props.actionButtonRenderers,\n propertyValueRendererManager:\n this.props.propertyValueRendererManager,\n propertyCategoryRendererManager:\n this.props.propertyCategoryRendererManager,\n\n columnRatio: columnResizeContext.columnRatio,\n columnInfo: columnResizeContext.columnInfo,\n isResizeHandleBeingDragged:\n columnResizeContext.isResizeHandleBeingDragged,\n isResizeHandleHovered:\n columnResizeContext.isResizeHandleHovered,\n onColumnRatioChanged: columnResizeContext.onColumnChanged,\n onResizeHandleDragChanged:\n columnResizeContext.onResizeHandleDragChanged,\n onResizeHandleHoverChanged:\n columnResizeContext.onResizeHandleHoverChanged,\n\n highlight: this.props.highlight,\n };\n\n const renderContext: PropertyGridInternalContext = {\n gridItems: this.state.gridItems,\n gridEventHandler: this.props.eventHandler,\n gridModel: this.props.model,\n style: this.props.style,\n className: this.props.className,\n onItemHeightChanged: this._handleNodeHeightChange,\n gridContext,\n };\n\n return (\n <PropertyGridInternalContextProvider value={renderContext}>\n <VirtualizedPropertyGridInternal\n width={this.props.width}\n height={this.props.height}\n itemCount={this.state.gridItems.length}\n itemSize={this._calculateNodeHeightByIndex}\n estimatedItemSize={this.calculateEstimatedHeight()}\n overscanCount={10}\n layout=\"vertical\"\n style={this.props.style}\n itemKey={this._getNodeKey}\n ref={this._listRef}\n />\n </PropertyGridInternalContextProvider>\n );\n }}\n </PropertyGridEventsRelatedPropsSupplier>\n )}\n </ColumnResizingPropertyListPropsSupplier>\n );\n }\n}\n\nconst VirtualizedPropertyGridInternal = React.forwardRef<\n VariableSizeList,\n Omit<VariableSizeListProps, \"children\">\n>(function VirtualizedPropertyGridInternal(props, ref) {\n const { gridContext } = usePropertyGridInternalContext(FlatGridItemNode);\n\n React.useEffect(() => {\n return gridContext.dataProvider.onDataChanged.addListener(() => {\n gridContext.onEditCancel?.();\n });\n }, [gridContext]);\n\n return (\n <div\n className={classnames(\n \"components-virtualized-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <VariableSizeList\n {...props}\n className={classnames(\n \"components-property-grid-wrapper\",\n \"ReactWindow__VariableSizeList\",\n props.className\n )}\n ref={ref}\n >\n {FlatGridItemNode}\n </VariableSizeList>\n </div>\n );\n});\n\n/**\n * Returns callbacks for persisting and restoring [[VirtualizedPropertyGrid]] layout state.\n * Returned `ref` should be set on container containing [[VirtualizedPropertyGrid]].\n * @public\n */\nexport function useVirtualizedPropertyGridLayoutStorage<T extends Element>() {\n return useElementsScrollStorage<T>(\"ReactWindow__VariableSizeList\");\n}\n\nconst FlatGridItemNode = React.memo(\n ({ index, style: virtualizedListStyle }: ListChildComponentProps) => {\n const {\n gridItems,\n gridEventHandler,\n gridModel,\n gridContext,\n className,\n style,\n onItemHeightChanged,\n } = usePropertyGridInternalContext(FlatGridItemNode);\n const node = gridItems[index];\n const divRef = React.useRef<HTMLDivElement>(null);\n const previousHeightRef = React.useRef(0);\n\n const onExpansionToggled = React.useCallback(\n () => gridEventHandler.onExpansionToggled(node.selectionKey),\n [gridEventHandler, node.selectionKey]\n );\n const onHeightChanged = React.useCallback(\n (newHeight: number) => onItemHeightChanged(index, node.key, newHeight),\n [onItemHeightChanged, index, node.key]\n );\n\n const minHeight = React.useMemo(() => {\n if (node.type === FlatGridItemType.Category)\n return CATEGORY_HEADER_HEIGHT;\n\n return gridContext.orientation === Orientation.Vertical\n ? VERTICAL_CATEGORY_PROPERTY_HEIGHT\n : CATEGORY_PROPERTY_HEIGHT;\n }, [gridContext.orientation, node.type]);\n\n React.useLayoutEffect(() => {\n assert(divRef.current !== null);\n const refHeight = divRef.current.getBoundingClientRect().height;\n const currentHeight = Math.max(refHeight, minHeight);\n\n if (currentHeight !== previousHeightRef.current) {\n onHeightChanged(currentHeight);\n previousHeightRef.current = currentHeight;\n }\n });\n\n function getDisplayNode() {\n const lastInNumberOfCategories = node.lastInNumberOfCategories;\n switch (node.type) {\n case FlatGridItemType.Category:\n const categoryRendererManager =\n gridContext.propertyCategoryRendererManager ??\n PropertyCategoryRendererManager.defaultManager;\n const customRenderer =\n categoryRendererManager.getCategoryComponent(node);\n const wrapperClassName = classnames(\n \"virtualized-grid-node-content\",\n customRenderer !== undefined\n ? \"virtualized-grid-node-custom-category\"\n : \"virtualized-grid-node-category\"\n );\n return (\n <FlatItemNestedBorderWrapper\n borderCount={node.depth}\n bottomBorderCount={lastInNumberOfCategories}\n className={wrapperClassName}\n >\n <PropertyCategoryBlock\n className={className}\n style={style}\n category={node.derivedCategory}\n onExpansionToggled={onExpansionToggled}\n highlight={\n gridContext.highlight?.filteredTypes?.includes(\n FilteredType.Category\n )\n ? gridContext.highlight\n : undefined\n }\n >\n {customRenderer !== undefined && (\n <CustomCategoryContent\n renderer={customRenderer}\n categoryItem={node}\n gridContext={gridContext}\n onHeightChanged={onHeightChanged}\n />\n )}\n </PropertyCategoryBlock>\n </FlatItemNestedBorderWrapper>\n );\n case FlatGridItemType.Array:\n case FlatGridItemType.Struct:\n case FlatGridItemType.Primitive:\n const selectionKey = node.selectionKey;\n const parentCategoryItem = gridModel.getItem(\n node.parentCategorySelectionKey\n ) as GridCategoryItem;\n\n return (\n <FlatItemNestedBorderWrapper\n borderCount={parentCategoryItem.depth + 1}\n bottomBorderCount={lastInNumberOfCategories}\n className=\"virtualized-grid-node-content\"\n >\n <FlatPropertyRenderer\n key={node.key}\n uniqueKey={selectionKey}\n propertyRecord={node.derivedRecord}\n orientation={gridContext.orientation}\n indentation={node.depth}\n width={gridContext.gridWidth}\n isHoverable={gridContext.isPropertyHoverEnabled}\n isSelectable={gridContext.isPropertySelectionEnabled}\n isSelected={selectionKey === gridContext.selectedPropertyKey}\n onClick={gridContext.onPropertyClicked}\n onRightClick={gridContext.onPropertyRightClicked}\n onContextMenu={gridContext.onPropertyContextMenu}\n category={parentCategoryItem.derivedCategory}\n isEditing={selectionKey === gridContext.editingPropertyKey}\n isPropertyEditingEnabled={gridContext.isPropertyEditingEnabled}\n alwaysShowEditor={gridContext.alwaysShowEditor}\n onEditCommit={gridContext.onEditCommit}\n onEditCancel={gridContext.onEditCancel}\n editorSystem={gridContext.editorSystem}\n isExpanded={node.isExpanded}\n onExpansionToggled={onExpansionToggled}\n onHeightChanged={onHeightChanged}\n actionButtonRenderers={gridContext.actionButtonRenderers}\n propertyValueRendererManager={\n gridContext.propertyValueRendererManager\n }\n columnRatio={gridContext.columnRatio}\n columnInfo={gridContext.columnInfo}\n isResizeHandleBeingDragged={\n gridContext.isResizeHandleBeingDragged\n }\n isResizeHandleHovered={gridContext.isResizeHandleHovered}\n onColumnRatioChanged={gridContext.onColumnRatioChanged}\n onResizeHandleDragChanged={\n gridContext.onResizeHandleDragChanged\n }\n onResizeHandleHoverChanged={\n gridContext.onResizeHandleHoverChanged\n }\n highlight={\n gridContext.highlight\n ? {\n applyOnLabel:\n gridContext.highlight.filteredTypes?.includes(\n FilteredType.Label\n ) ?? false,\n applyOnValue:\n gridContext.highlight.filteredTypes?.includes(\n FilteredType.Value\n ) ?? false,\n ...gridContext.highlight,\n }\n : undefined\n }\n />\n </FlatItemNestedBorderWrapper>\n );\n }\n }\n\n return (\n <div className=\"virtualized-grid-node\" style={virtualizedListStyle}>\n <div\n className=\"virtualized-grid-node-content-wrapper\"\n style={{\n minHeight: `${minHeight}px`,\n display: \"grid\",\n }}\n >\n <div\n ref={divRef}\n className=\"virtualized-grid-node-content-wrapper-item\"\n >\n {getDisplayNode()}\n </div>\n </div>\n </div>\n );\n },\n areEqual\n);\n\nFlatGridItemNode.displayName = \"FlatGridItemNode\";\n\ninterface CustomCategoryContentProps {\n categoryItem: GridCategoryItem;\n renderer: React.ComponentType<PropertyCategoryRendererProps>;\n gridContext: VirtualizedPropertyGridContext;\n onHeightChanged: (newHeight: number) => void;\n}\n\nconst CustomCategoryContent: React.FC<CustomCategoryContentProps> = (props) => {\n const { onHeightChanged } = props;\n const divRef = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n assert(divRef.current !== null);\n const contentHeight = divRef.current.getBoundingClientRect().height;\n onHeightChanged(contentHeight);\n }, [props.gridContext.orientation, onHeightChanged]);\n\n return <div ref={divRef}>{React.createElement(props.renderer, props)}</div>;\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module PropertyGrid
3
3
  */
4
- import type { IDisposable } from "@itwin/core-bentley";
4
+ import "../../common/DisposePolyfill.js";
5
5
  import type { HighlightInfo } from "../../common/HighlightingComponentProps.js";
6
6
  import type { IPropertyDataProvider, PropertyData } from "../PropertyDataProvider.js";
7
7
  import { PropertyDataChangeEvent } from "../PropertyDataProvider.js";
@@ -28,7 +28,8 @@ export interface FilteredPropertyData extends PropertyData {
28
28
  * [[IPropertyDataProvider]] implementation which filters wrapped provider [[PropertyData]] using passed [[IPropertyDataFilterer]].
29
29
  * @public
30
30
  */
31
- export declare class FilteringPropertyDataProvider implements IPropertyDataProvider, IDisposable {
31
+ export declare class FilteringPropertyDataProvider implements IPropertyDataProvider, Disposable {
32
+ #private;
32
33
  private _dataProvider;
33
34
  private _filterer;
34
35
  onDataChanged: PropertyDataChangeEvent;
@@ -36,6 +37,9 @@ export declare class FilteringPropertyDataProvider implements IPropertyDataProvi
36
37
  private _disposeFilterChangedListener;
37
38
  private _disposeDataChangedListener;
38
39
  constructor(_dataProvider: IPropertyDataProvider, _filterer: IPropertyDataFilterer);
40
+ /** Destructor. Must be called to clean up. */
41
+ [Symbol.dispose](): void;
42
+ /** @deprecated in 5.5.0. Use `[Symbol.dispose]` instead. */
39
43
  dispose(): void;
40
44
  getData(): Promise<FilteredPropertyData>;
41
45
  private filterPropertyData;
@@ -1 +1 @@
1
- {"version":3,"file":"FilteringDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,KAAK,EACV,qBAAqB,EAErB,YAAY,EACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EAEtB,MAAM,yCAAyC,CAAC;AAWjD;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAE/D,qDAAqD;IACrD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,6BACX,YAAW,qBAAqB,EAAE,WAAW;IAS3C,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IARZ,aAAa,0BAAiC;IACrD,OAAO,CAAC,qBAAqB,CACjB;IACZ,OAAO,CAAC,6BAA6B,CAA0B;IAC/D,OAAO,CAAC,2BAA2B,CAA0B;gBAGnD,aAAa,EAAE,qBAAqB,EACpC,SAAS,EAAE,qBAAqB;IAcnC,OAAO,IAAI,IAAI;IAKT,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;YAgBvC,kBAAkB;CA0CjC"}
1
+ {"version":3,"file":"FilteringDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,iCAAiC,CAAC;AAIzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAEhF,OAAO,KAAK,EACV,qBAAqB,EAErB,YAAY,EACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EAEtB,MAAM,yCAAyC,CAAC;AAWjD;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAE/D,qDAAqD;IACrD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,6BACX,YAAW,qBAAqB,EAAE,UAAU;;IAS1C,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IARZ,aAAa,0BAAiC;IACrD,OAAO,CAAC,qBAAqB,CACjB;IACZ,OAAO,CAAC,6BAA6B,CAA0B;IAC/D,OAAO,CAAC,2BAA2B,CAA0B;gBAGnD,aAAa,EAAE,qBAAqB,EACpC,SAAS,EAAE,qBAAqB;IAmB1C,+CAA+C;IACxC,CAAC,MAAM,CAAC,OAAO,CAAC;IAIvB,4DAA4D;IACrD,OAAO,IAAI,IAAI;IAIT,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;YAgBvC,kBAAkB;CA0CjC"}
@@ -5,6 +5,13 @@
5
5
  /** @packageDocumentation
6
6
  * @module PropertyGrid
7
7
  */
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _FilteringPropertyDataProvider_instances, _FilteringPropertyDataProvider_dispose;
14
+ import "../../common/DisposePolyfill.js";
8
15
  import { PropertyValueFormat } from "@itwin/appui-abstract";
9
16
  import { PropertyDataChangeEvent } from "../PropertyDataProvider.js";
10
17
  /**
@@ -13,6 +20,7 @@ import { PropertyDataChangeEvent } from "../PropertyDataProvider.js";
13
20
  */
14
21
  export class FilteringPropertyDataProvider {
15
22
  constructor(_dataProvider, _filterer) {
23
+ _FilteringPropertyDataProvider_instances.add(this);
16
24
  this._dataProvider = _dataProvider;
17
25
  this._filterer = _filterer;
18
26
  this.onDataChanged = new PropertyDataChangeEvent();
@@ -28,9 +36,16 @@ export class FilteringPropertyDataProvider {
28
36
  this.onDataChanged.raiseEvent();
29
37
  });
30
38
  }
31
- dispose() {
39
+ /** Destructor. Must be called to clean up. */
40
+ [(_FilteringPropertyDataProvider_instances = new WeakSet(), _FilteringPropertyDataProvider_dispose = function _FilteringPropertyDataProvider_dispose() {
32
41
  this._disposeDataChangedListener();
33
42
  this._disposeFilterChangedListener();
43
+ }, Symbol.dispose)]() {
44
+ __classPrivateFieldGet(this, _FilteringPropertyDataProvider_instances, "m", _FilteringPropertyDataProvider_dispose).call(this);
45
+ }
46
+ /** @deprecated in 5.5.0. Use `[Symbol.dispose]` instead. */
47
+ dispose() {
48
+ __classPrivateFieldGet(this, _FilteringPropertyDataProvider_instances, "m", _FilteringPropertyDataProvider_dispose).call(this);
34
49
  }
35
50
  async getData() {
36
51
  if (this._filteredPropertyData) {
@@ -1 +1 @@
1
- {"version":3,"file":"FilteringDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAS5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAqCrE;;;GAGG;AACH,MAAM,OAAO,6BAA6B;IASxC,YACU,aAAoC,EACpC,SAAgC;QADhC,kBAAa,GAAb,aAAa,CAAuB;QACpC,cAAS,GAAT,SAAS,CAAuB;QARnC,kBAAa,GAAG,IAAI,uBAAuB,EAAE,CAAC;QAC7C,0BAAqB,GAC3B,SAAS,CAAC;QAQV,IAAI,CAAC,6BAA6B;YAChC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,GAAG,EAAE;gBAC9C,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;gBACvC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,2BAA2B;YAC9B,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,EAAE;gBAChD,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC;gBACvC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACnC,IAAI,CAAC,6BAA6B,EAAE,CAAC;IACvC,CAAC;IAEM,KAAK,CAAC,OAAO;QAClB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC/B,OAAO,IAAI,CAAC,qBAA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,EAAE,YAAY;QACrC,YAAY;QACZ,qBAAqB;QACrB,aAAa;KACd,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAC3B,gBAAkC,EAClC,WAA+B,EAC/B,MAAe;IAEf,OAAO;QACL,GAAG,gBAAgB;QACnB,eAAe,EAAE,WAAW;QAC5B,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAsB,EACtB,WAA6B,EAC7B,UAAmB;IAEnB,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAC/B,sBAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,CAClD,CAAC;IACF,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC;IAC1B,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,sBAAsB,CAC7B,KAAoB,EACpB,WAA6B;IAE7B,QAAQ,KAAK,CAAC,WAAW,EAAE,CAAC;QAC1B,KAAK,mBAAmB,CAAC,SAAS;YAChC,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;QACtB,KAAK,mBAAmB,CAAC,KAAK;YAC5B,OAAO;gBACL,WAAW,EAAE,mBAAmB,CAAC,KAAK;gBACtC,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,KAAK,EAAE,WAAW;aACnB,CAAC;QACJ,KAAK,mBAAmB,CAAC,MAAM;YAC7B,MAAM,OAAO,GAAuC,EAAE,CAAC;YACvD,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YACvE,OAAO;gBACL,WAAW,EAAE,mBAAmB,CAAC,MAAM;gBACvC,OAAO;aACR,CAAC;IACN,CAAC;AACH,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 PropertyGrid\n */\n\nimport type { PropertyRecord, PropertyValue } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { IDisposable } from \"@itwin/core-bentley\";\nimport type { HighlightInfo } from \"../../common/HighlightingComponentProps.js\";\nimport type { CategoryRecordsDict } from \"../internal/flat-items/MutableGridCategory.js\";\nimport type {\n IPropertyDataProvider,\n PropertyCategory,\n PropertyData,\n} from \"../PropertyDataProvider.js\";\nimport { PropertyDataChangeEvent } from \"../PropertyDataProvider.js\";\nimport type {\n FilteredType,\n IPropertyDataFilterer,\n PropertyDataFilterResult,\n} from \"./filterers/PropertyDataFiltererBase.js\";\n\ninterface FilteredRecords {\n filteredRecords: PropertyRecord[];\n shouldExpandNodeParents: boolean;\n matchesCount: number;\n activeMatch?: HighlightInfo;\n filteredResultMatches: { id: string; matchesCount: number }[];\n filteredTypes: FilteredType[];\n}\n\n/**\n * Data returned by [[FilteringPropertyDataProvider]]\n * @public\n */\nexport interface FilteredPropertyData extends PropertyData {\n /**\n * Shows how many matches were found when filtering data.\n * `undefined` when filterer is not active\n */\n matchesCount?: number;\n\n /**\n * Function used for getting [[HighlightInfo]] by index from all the filtered matches.\n * `undefined` when filterer is not active\n */\n getMatchByIndex?: (index: number) => HighlightInfo | undefined;\n\n /** Types of objects that were used for filtering. */\n filteredTypes?: FilteredType[];\n}\n\n/**\n * [[IPropertyDataProvider]] implementation which filters wrapped provider [[PropertyData]] using passed [[IPropertyDataFilterer]].\n * @public\n */\nexport class FilteringPropertyDataProvider\n implements IPropertyDataProvider, IDisposable\n{\n public onDataChanged = new PropertyDataChangeEvent();\n private _filteredPropertyData: Promise<FilteredPropertyData> | undefined =\n undefined;\n private _disposeFilterChangedListener: (...args: any[]) => any;\n private _disposeDataChangedListener: (...args: any[]) => any;\n\n public constructor(\n private _dataProvider: IPropertyDataProvider,\n private _filterer: IPropertyDataFilterer\n ) {\n this._disposeFilterChangedListener =\n this._filterer.onFilterChanged.addListener(() => {\n this._filteredPropertyData = undefined;\n this.onDataChanged.raiseEvent();\n });\n this._disposeDataChangedListener =\n this._dataProvider.onDataChanged.addListener(() => {\n this._filteredPropertyData = undefined;\n this.onDataChanged.raiseEvent();\n });\n }\n\n public dispose(): void {\n this._disposeDataChangedListener();\n this._disposeFilterChangedListener();\n }\n\n public async getData(): Promise<FilteredPropertyData> {\n if (this._filteredPropertyData) {\n return this._filteredPropertyData;\n }\n\n this._filteredPropertyData = this._dataProvider\n .getData()\n .then(async (propertyData) => {\n return this._filterer.isActive\n ? this.filterPropertyData(propertyData)\n : propertyData;\n });\n\n return this._filteredPropertyData;\n }\n\n private async filterPropertyData(propertyData: PropertyData) {\n const { categories, records, label, description } = { ...propertyData };\n const {\n filteredCategories,\n filteredRecords,\n matchesCount,\n filteredResultMatches,\n filteredTypes,\n } = await matchHierarchy(this._filterer, categories, records, undefined);\n\n const uniqueTypes = [...new Set(filteredTypes)];\n const getMatchByIndex = (index: number) => {\n let activeMatch: HighlightInfo | undefined;\n if (index <= 0) return undefined;\n\n let i = 1;\n for (const record of filteredResultMatches) {\n const fullMatchesCount = record.matchesCount;\n if (index < i + fullMatchesCount) {\n activeMatch = {\n highlightedItemIdentifier: record.id,\n highlightIndex: index - i,\n };\n break;\n }\n\n i += fullMatchesCount;\n }\n return activeMatch;\n };\n\n return {\n label,\n description,\n categories: filteredCategories,\n records: filteredRecords,\n reusePropertyDataState: false,\n matchesCount,\n getMatchByIndex,\n filteredTypes: uniqueTypes,\n };\n }\n}\n\nasync function matchHierarchy(\n filterer: IPropertyDataFilterer,\n categories: PropertyCategory[],\n records: CategoryRecordsDict,\n newRecords?: CategoryRecordsDict,\n parentMatchInfo?: PropertyDataFilterResult\n) {\n const newCategories: PropertyCategory[] = [];\n newRecords = newRecords ?? {};\n let matchesCount = 0;\n let allFilteredResultMatches: { id: string; matchesCount: number }[] = [];\n let allFilteredTypes: FilteredType[] = [];\n\n for (const category of categories) {\n const matchInfo = await filterer.categoryMatchesFilter(category, []);\n\n if (matchInfo.matchesFilter) {\n allFilteredResultMatches.push({\n id: category.name,\n matchesCount: matchInfo.matchesCount ?? 0,\n });\n allFilteredTypes = allFilteredTypes.concat(matchInfo.filteredTypes ?? []);\n matchesCount += matchInfo.matchesCount ?? 0;\n }\n\n const childRecords = records[category.name] ?? [];\n const {\n filteredRecords,\n matchesCount: count,\n filteredResultMatches,\n filteredTypes,\n } = await matchRecordHierarchy(filterer, childRecords, []);\n allFilteredResultMatches = allFilteredResultMatches.concat(\n filteredResultMatches\n );\n allFilteredTypes = allFilteredTypes.concat(filteredTypes);\n matchesCount += count;\n\n const parentInfo = parentMatchInfo?.matchesFilter\n ? parentMatchInfo\n : matchInfo;\n\n const childCategories = category.childCategories ?? [];\n const {\n filteredCategories,\n matchesCount: childCount,\n filteredResultMatches: childFilteredResultMatches,\n filteredTypes: childFilteredTypes,\n } = await matchHierarchy(\n filterer,\n childCategories,\n records,\n newRecords,\n parentInfo\n );\n allFilteredResultMatches = allFilteredResultMatches.concat(\n childFilteredResultMatches\n );\n allFilteredTypes = allFilteredTypes.concat(childFilteredTypes);\n matchesCount += childCount;\n\n let expand = !(count === 0 && childCount === 0);\n if (\n matchInfo.matchesFilter ||\n (parentMatchInfo?.matchesFilter &&\n parentMatchInfo.shouldForceIncludeDescendants)\n ) {\n newRecords[category.name] = records[category.name];\n if (matchInfo.matchesFilter) {\n expand = true;\n }\n const newCategory = copyPropertyCategory(\n category,\n filteredCategories,\n expand\n );\n newCategories.push(newCategory);\n }\n\n if (\n (filteredRecords.length !== 0 || filteredCategories.length !== 0) &&\n !matchInfo.matchesFilter &&\n !(\n parentMatchInfo?.shouldExpandNodeParents &&\n parentMatchInfo.matchesFilter\n )\n ) {\n const newCategory = copyPropertyCategory(\n category,\n filteredCategories,\n expand\n );\n newRecords[newCategory.name] = filteredRecords;\n newCategories.push(newCategory);\n }\n }\n\n return {\n filteredCategories: newCategories,\n filteredRecords: newRecords,\n matchesCount,\n filteredResultMatches: allFilteredResultMatches,\n filteredTypes: allFilteredTypes,\n };\n}\n\nasync function matchRecordHierarchy(\n filterer: IPropertyDataFilterer,\n records: PropertyRecord[],\n parents: PropertyRecord[],\n forceIncludeItem: boolean = false\n): Promise<FilteredRecords> {\n const newMatchedRecords: PropertyRecord[] = [];\n let expandParent = false; // property passed back to parent to indicate whether it should be expanded\n let matchesCount = 0;\n let filteredResultMatches: { id: string; matchesCount: number }[] = [];\n let filteredTypes: FilteredType[] = [];\n\n for (const record of records) {\n const matchInfo = await filterer.recordMatchesFilter(record, parents);\n const shouldForceIncludeDescendants =\n forceIncludeItem || matchInfo.shouldForceIncludeDescendants;\n const {\n filteredRecords: filteredChildren,\n shouldExpandNodeParents,\n matchesCount: childrenMatchesCount,\n filteredResultMatches: childrenResultMatches,\n filteredTypes: childrenFilteredTypes,\n } = await matchRecordHierarchy(\n filterer,\n record.getChildrenRecords(),\n [...parents, record],\n shouldForceIncludeDescendants\n );\n filteredResultMatches = filteredResultMatches.concat(childrenResultMatches);\n filteredTypes = [...filteredTypes, ...childrenFilteredTypes];\n matchesCount += childrenMatchesCount;\n // if child hierarchy indicates parents should be expanded, then it should be passed back up to the top parent\n expandParent = expandParent || shouldExpandNodeParents;\n\n let newRecord: PropertyRecord | undefined;\n if (matchInfo.matchesFilter) {\n filteredTypes = [...filteredTypes, ...(matchInfo.filteredTypes ?? [])];\n const recordMatchesCount = matchInfo.matchesCount ?? 0;\n matchesCount += recordMatchesCount;\n // Item is included if it matches filter\n // If at least one matched record from records list needs its parent expanded,\n // then `expandParent` should be set to true\n expandParent = expandParent || !!matchInfo.shouldExpandNodeParents;\n newRecord = copyPropertyRecord(\n record,\n filteredChildren,\n shouldExpandNodeParents\n );\n filteredResultMatches.push({\n id: newRecord.property.name,\n matchesCount: recordMatchesCount,\n });\n } else if (filteredChildren.length !== 0 || forceIncludeItem) {\n // Item is also included if it has at least one matched child or is forcefully included by its parent\n newRecord = copyPropertyRecord(\n record,\n filteredChildren,\n shouldExpandNodeParents\n );\n }\n\n if (newRecord) newMatchedRecords.push(newRecord);\n }\n\n return {\n filteredRecords: newMatchedRecords,\n shouldExpandNodeParents: expandParent,\n matchesCount,\n filteredResultMatches,\n filteredTypes,\n };\n}\n\nfunction copyPropertyCategory(\n propertyCategory: PropertyCategory,\n newChildren: PropertyCategory[],\n expand: boolean\n): PropertyCategory {\n return {\n ...propertyCategory,\n childCategories: newChildren,\n expand,\n };\n}\n\nfunction copyPropertyRecord(\n record: PropertyRecord,\n newChildren: PropertyRecord[],\n autoExpand: boolean\n) {\n const r = record.copyWithNewValue(\n createNewPropertyValue(record.value, newChildren)\n );\n r.autoExpand = autoExpand;\n return r;\n}\n\nfunction createNewPropertyValue(\n value: PropertyValue,\n newChildren: PropertyRecord[]\n): PropertyValue {\n switch (value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return { ...value };\n case PropertyValueFormat.Array:\n return {\n valueFormat: PropertyValueFormat.Array,\n itemsTypeName: value.itemsTypeName,\n items: newChildren,\n };\n case PropertyValueFormat.Struct:\n const members: { [name: string]: PropertyRecord } = {};\n newChildren.forEach((child) => (members[child.property.name] = child));\n return {\n valueFormat: PropertyValueFormat.Struct,\n members,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"FilteringDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;;;;;;;AAEH,OAAO,iCAAiC,CAAC;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAqCrE;;;GAGG;AACH,MAAM,OAAO,6BAA6B;IASxC,YACU,aAAoC,EACpC,SAAgC;;QADhC,kBAAa,GAAb,aAAa,CAAuB;QACpC,cAAS,GAAT,SAAS,CAAuB;QARnC,kBAAa,GAAG,IAAI,uBAAuB,EAAE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KAAK,EAAE,WAAW,CAAC,CAClD,CAAC;IACF,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC;IAC1B,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,sBAAsB,CAC7B,KAAoB,EACpB,WAA6B;IAE7B,QAAQ,KAAK,CAAC,WAAW,EAAE,CAAC;QAC1B,KAAK,mBAAmB,CAAC,SAAS;YAChC,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;QACtB,KAAK,mBAAmB,CAAC,KAAK;YAC5B,OAAO;gBACL,WAAW,EAAE,mBAAmB,CAAC,KAAK;gBACtC,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,KAAK,EAAE,WAAW;aACnB,CAAC;QACJ,KAAK,mBAAmB,CAAC,MAAM;YAC7B,MAAM,OAAO,GAAuC,EAAE,CAAC;YACvD,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;YACvE,OAAO;gBACL,WAAW,EAAE,mBAAmB,CAAC,MAAM;gBACvC,OAAO;aACR,CAAC;IACN,CAAC;AACH,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 PropertyGrid\n */\n\nimport \"../../common/DisposePolyfill.js\";\n\nimport type { PropertyRecord, PropertyValue } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { HighlightInfo } from \"../../common/HighlightingComponentProps.js\";\nimport type { CategoryRecordsDict } from \"../internal/flat-items/MutableGridCategory.js\";\nimport type {\n IPropertyDataProvider,\n PropertyCategory,\n PropertyData,\n} from \"../PropertyDataProvider.js\";\nimport { PropertyDataChangeEvent } from \"../PropertyDataProvider.js\";\nimport type {\n FilteredType,\n IPropertyDataFilterer,\n PropertyDataFilterResult,\n} from \"./filterers/PropertyDataFiltererBase.js\";\n\ninterface FilteredRecords {\n filteredRecords: PropertyRecord[];\n shouldExpandNodeParents: boolean;\n matchesCount: number;\n activeMatch?: HighlightInfo;\n filteredResultMatches: { id: string; matchesCount: number }[];\n filteredTypes: FilteredType[];\n}\n\n/**\n * Data returned by [[FilteringPropertyDataProvider]]\n * @public\n */\nexport interface FilteredPropertyData extends PropertyData {\n /**\n * Shows how many matches were found when filtering data.\n * `undefined` when filterer is not active\n */\n matchesCount?: number;\n\n /**\n * Function used for getting [[HighlightInfo]] by index from all the filtered matches.\n * `undefined` when filterer is not active\n */\n getMatchByIndex?: (index: number) => HighlightInfo | undefined;\n\n /** Types of objects that were used for filtering. */\n filteredTypes?: FilteredType[];\n}\n\n/**\n * [[IPropertyDataProvider]] implementation which filters wrapped provider [[PropertyData]] using passed [[IPropertyDataFilterer]].\n * @public\n */\nexport class FilteringPropertyDataProvider\n implements IPropertyDataProvider, Disposable\n{\n public onDataChanged = new PropertyDataChangeEvent();\n private _filteredPropertyData: Promise<FilteredPropertyData> | undefined =\n undefined;\n private _disposeFilterChangedListener: (...args: any[]) => any;\n private _disposeDataChangedListener: (...args: any[]) => any;\n\n public constructor(\n private _dataProvider: IPropertyDataProvider,\n private _filterer: IPropertyDataFilterer\n ) {\n this._disposeFilterChangedListener =\n this._filterer.onFilterChanged.addListener(() => {\n this._filteredPropertyData = undefined;\n this.onDataChanged.raiseEvent();\n });\n this._disposeDataChangedListener =\n this._dataProvider.onDataChanged.addListener(() => {\n this._filteredPropertyData = undefined;\n this.onDataChanged.raiseEvent();\n });\n }\n\n #dispose() {\n this._disposeDataChangedListener();\n this._disposeFilterChangedListener();\n }\n\n /** Destructor. Must be called to clean up. */\n public [Symbol.dispose]() {\n this.#dispose();\n }\n\n /** @deprecated in 5.5.0. Use `[Symbol.dispose]` instead. */\n public dispose(): void {\n this.#dispose();\n }\n\n public async getData(): Promise<FilteredPropertyData> {\n if (this._filteredPropertyData) {\n return this._filteredPropertyData;\n }\n\n this._filteredPropertyData = this._dataProvider\n .getData()\n .then(async (propertyData) => {\n return this._filterer.isActive\n ? this.filterPropertyData(propertyData)\n : propertyData;\n });\n\n return this._filteredPropertyData;\n }\n\n private async filterPropertyData(propertyData: PropertyData) {\n const { categories, records, label, description } = { ...propertyData };\n const {\n filteredCategories,\n filteredRecords,\n matchesCount,\n filteredResultMatches,\n filteredTypes,\n } = await matchHierarchy(this._filterer, categories, records, undefined);\n\n const uniqueTypes = [...new Set(filteredTypes)];\n const getMatchByIndex = (index: number) => {\n let activeMatch: HighlightInfo | undefined;\n if (index <= 0) return undefined;\n\n let i = 1;\n for (const record of filteredResultMatches) {\n const fullMatchesCount = record.matchesCount;\n if (index < i + fullMatchesCount) {\n activeMatch = {\n highlightedItemIdentifier: record.id,\n highlightIndex: index - i,\n };\n break;\n }\n\n i += fullMatchesCount;\n }\n return activeMatch;\n };\n\n return {\n label,\n description,\n categories: filteredCategories,\n records: filteredRecords,\n reusePropertyDataState: false,\n matchesCount,\n getMatchByIndex,\n filteredTypes: uniqueTypes,\n };\n }\n}\n\nasync function matchHierarchy(\n filterer: IPropertyDataFilterer,\n categories: PropertyCategory[],\n records: CategoryRecordsDict,\n newRecords?: CategoryRecordsDict,\n parentMatchInfo?: PropertyDataFilterResult\n) {\n const newCategories: PropertyCategory[] = [];\n newRecords = newRecords ?? {};\n let matchesCount = 0;\n let allFilteredResultMatches: { id: string; matchesCount: number }[] = [];\n let allFilteredTypes: FilteredType[] = [];\n\n for (const category of categories) {\n const matchInfo = await filterer.categoryMatchesFilter(category, []);\n\n if (matchInfo.matchesFilter) {\n allFilteredResultMatches.push({\n id: category.name,\n matchesCount: matchInfo.matchesCount ?? 0,\n });\n allFilteredTypes = allFilteredTypes.concat(matchInfo.filteredTypes ?? []);\n matchesCount += matchInfo.matchesCount ?? 0;\n }\n\n const childRecords = records[category.name] ?? [];\n const {\n filteredRecords,\n matchesCount: count,\n filteredResultMatches,\n filteredTypes,\n } = await matchRecordHierarchy(filterer, childRecords, []);\n allFilteredResultMatches = allFilteredResultMatches.concat(\n filteredResultMatches\n );\n allFilteredTypes = allFilteredTypes.concat(filteredTypes);\n matchesCount += count;\n\n const parentInfo = parentMatchInfo?.matchesFilter\n ? parentMatchInfo\n : matchInfo;\n\n const childCategories = category.childCategories ?? [];\n const {\n filteredCategories,\n matchesCount: childCount,\n filteredResultMatches: childFilteredResultMatches,\n filteredTypes: childFilteredTypes,\n } = await matchHierarchy(\n filterer,\n childCategories,\n records,\n newRecords,\n parentInfo\n );\n allFilteredResultMatches = allFilteredResultMatches.concat(\n childFilteredResultMatches\n );\n allFilteredTypes = allFilteredTypes.concat(childFilteredTypes);\n matchesCount += childCount;\n\n let expand = !(count === 0 && childCount === 0);\n if (\n matchInfo.matchesFilter ||\n (parentMatchInfo?.matchesFilter &&\n parentMatchInfo.shouldForceIncludeDescendants)\n ) {\n newRecords[category.name] = records[category.name];\n if (matchInfo.matchesFilter) {\n expand = true;\n }\n const newCategory = copyPropertyCategory(\n category,\n filteredCategories,\n expand\n );\n newCategories.push(newCategory);\n }\n\n if (\n (filteredRecords.length !== 0 || filteredCategories.length !== 0) &&\n !matchInfo.matchesFilter &&\n !(\n parentMatchInfo?.shouldExpandNodeParents &&\n parentMatchInfo.matchesFilter\n )\n ) {\n const newCategory = copyPropertyCategory(\n category,\n filteredCategories,\n expand\n );\n newRecords[newCategory.name] = filteredRecords;\n newCategories.push(newCategory);\n }\n }\n\n return {\n filteredCategories: newCategories,\n filteredRecords: newRecords,\n matchesCount,\n filteredResultMatches: allFilteredResultMatches,\n filteredTypes: allFilteredTypes,\n };\n}\n\nasync function matchRecordHierarchy(\n filterer: IPropertyDataFilterer,\n records: PropertyRecord[],\n parents: PropertyRecord[],\n forceIncludeItem: boolean = false\n): Promise<FilteredRecords> {\n const newMatchedRecords: PropertyRecord[] = [];\n let expandParent = false; // property passed back to parent to indicate whether it should be expanded\n let matchesCount = 0;\n let filteredResultMatches: { id: string; matchesCount: number }[] = [];\n let filteredTypes: FilteredType[] = [];\n\n for (const record of records) {\n const matchInfo = await filterer.recordMatchesFilter(record, parents);\n const shouldForceIncludeDescendants =\n forceIncludeItem || matchInfo.shouldForceIncludeDescendants;\n const {\n filteredRecords: filteredChildren,\n shouldExpandNodeParents,\n matchesCount: childrenMatchesCount,\n filteredResultMatches: childrenResultMatches,\n filteredTypes: childrenFilteredTypes,\n } = await matchRecordHierarchy(\n filterer,\n record.getChildrenRecords(),\n [...parents, record],\n shouldForceIncludeDescendants\n );\n filteredResultMatches = filteredResultMatches.concat(childrenResultMatches);\n filteredTypes = [...filteredTypes, ...childrenFilteredTypes];\n matchesCount += childrenMatchesCount;\n // if child hierarchy indicates parents should be expanded, then it should be passed back up to the top parent\n expandParent = expandParent || shouldExpandNodeParents;\n\n let newRecord: PropertyRecord | undefined;\n if (matchInfo.matchesFilter) {\n filteredTypes = [...filteredTypes, ...(matchInfo.filteredTypes ?? [])];\n const recordMatchesCount = matchInfo.matchesCount ?? 0;\n matchesCount += recordMatchesCount;\n // Item is included if it matches filter\n // If at least one matched record from records list needs its parent expanded,\n // then `expandParent` should be set to true\n expandParent = expandParent || !!matchInfo.shouldExpandNodeParents;\n newRecord = copyPropertyRecord(\n record,\n filteredChildren,\n shouldExpandNodeParents\n );\n filteredResultMatches.push({\n id: newRecord.property.name,\n matchesCount: recordMatchesCount,\n });\n } else if (filteredChildren.length !== 0 || forceIncludeItem) {\n // Item is also included if it has at least one matched child or is forcefully included by its parent\n newRecord = copyPropertyRecord(\n record,\n filteredChildren,\n shouldExpandNodeParents\n );\n }\n\n if (newRecord) newMatchedRecords.push(newRecord);\n }\n\n return {\n filteredRecords: newMatchedRecords,\n shouldExpandNodeParents: expandParent,\n matchesCount,\n filteredResultMatches,\n filteredTypes,\n };\n}\n\nfunction copyPropertyCategory(\n propertyCategory: PropertyCategory,\n newChildren: PropertyCategory[],\n expand: boolean\n): PropertyCategory {\n return {\n ...propertyCategory,\n childCategories: newChildren,\n expand,\n };\n}\n\nfunction copyPropertyRecord(\n record: PropertyRecord,\n newChildren: PropertyRecord[],\n autoExpand: boolean\n) {\n const r = record.copyWithNewValue(\n createNewPropertyValue(record.value, newChildren)\n );\n r.autoExpand = autoExpand;\n return r;\n}\n\nfunction createNewPropertyValue(\n value: PropertyValue,\n newChildren: PropertyRecord[]\n): PropertyValue {\n switch (value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return { ...value };\n case PropertyValueFormat.Array:\n return {\n valueFormat: PropertyValueFormat.Array,\n itemsTypeName: value.itemsTypeName,\n items: newChildren,\n };\n case PropertyValueFormat.Struct:\n const members: { [name: string]: PropertyRecord } = {};\n newChildren.forEach((child) => (members[child.property.name] = child));\n return {\n valueFormat: PropertyValueFormat.Struct,\n members,\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFlatGridItem.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;;GAKG;AACH,oBAAY,gBAAgB;IAC1B,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,KAAK,IAAA;IACL,MAAM,IAAA;CACP;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,gBAAgB,CAAC,KAAK,GACtB,gBAAgB,CAAC,SAAS,GAC1B,gBAAgB,CAAC,MAAM,CAAC;AAE5B;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,EAAE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E,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM;IAwB/B,SAAyB,IAAI,EAAE,wBAAwB,CAAC;aAC/B,WAAW,IAAI,+BAA+B,EAAE;IAEzE;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUlB,OAAO,IAAI,+BAA+B;IAIjD,IAAoB,0BAA0B,WAE7C;IAED,IAAoB,kBAAkB,WAErC;IAED;;OAEG;IACH,IAAW,YAAY,WAEtB;IAED,IAAW,KAAK,WAEf;IAED;;OAEG;IACH,IAAW,aAAa,mBAEvB;CACF"}
1
+ {"version":3,"file":"MutableFlatGridItem.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAE5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;;GAKG;AACH,oBAAY,gBAAgB;IAC1B,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,KAAK,IAAA;IACL,MAAM,IAAA;CACP;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,gBAAgB,CAAC,KAAK,GACtB,gBAAgB,CAAC,SAAS,GAC1B,gBAAgB,CAAC,MAAM,CAAC;AAE5B;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAA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rB,oBAAoB,CAAC,EAAE,MAAM;IAwB/B,SAAyB,IAAI,EAAE,wBAAwB,CAAC;aAC/B,WAAW,IAAI,+BAA+B,EAAE;IAEzE;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAiB/B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAUlB,OAAO,IAAI,+BAA+B;IAIjD,IAAoB,0BAA0B,WAE7C;IAED,IAAoB,kBAAkB,WAErC;IAED;;OAEG;IACH,IAAW,YAAY,WAEtB;IAED,IAAW,KAAK,WAEf;IAED;;OAEG;IACH,IAAW,aAAa,mBAEvB;CACF"}
@@ -158,7 +158,7 @@ export class MutableCategorizedProperty extends MutableFlatPropertyGridItem {
158
158
  return FlatGridItemType.Struct;
159
159
  default:
160
160
  const unhandledType = valueType;
161
- throw Error(`Property Value Format not handled: ${unhandledType}`);
161
+ throw Error(`Property Value Format not handled: ${String(unhandledType)}`);
162
162
  }
163
163
  }
164
164
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAgCD;;;GAGG;AACH,MAAM,OAAgB,2BAA2B;IAU/C,YACU,MAAc,EACd,mBAAuC,EACvC,2BAA+C;QAF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,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF","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 PropertyGrid\n */\nimport { immerable } from \"immer\";\nimport type { PropertyDescription } from \"@itwin/appui-abstract\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Guid } from \"@itwin/core-bentley\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider.js\";\n\n/**\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\n * Category for PropertyCategory\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\n * @public\n */\nexport enum FlatGridItemType {\n Category,\n Primitive,\n Array,\n Struct,\n}\n\n/**\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\n * @public\n */\nexport type CategorizedPropertyTypes =\n | FlatGridItemType.Array\n | FlatGridItemType.Primitive\n | FlatGridItemType.Struct;\n\n/**\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\n * @public\n */\nexport interface IMutableFlatPropertyGridItem {\n readonly type: FlatGridItemType;\n readonly key: string;\n readonly selectionKey: string;\n readonly parentSelectionKey: string | undefined;\n readonly parentCategorySelectionKey: string | undefined;\n readonly depth: number;\n readonly label: string;\n lastInNumberOfCategories: number;\n isLastInRootCategory: boolean;\n isExpanded: boolean;\n getDescendantsAndSelf(): IMutableFlatGridItem[];\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\n getChildren(): IMutableFlatGridItem[];\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\n}\n\n/**\n * Base class for all FlatPropertyGrid items\n * @public\n */\nexport abstract class MutableFlatPropertyGridItem\n implements IMutableFlatPropertyGridItem\n{\n public [immerable] = true;\n\n public readonly key: string = Guid.createValue();\n protected _isExpanded: boolean = false;\n protected _lastInNumberOfCategories: number = 0;\n protected _isLastInRootCategory: boolean = false;\n\n public constructor(\n private _depth: number,\n private _parentSelectionKey: string | undefined,\n private _parentCategorySelectionKey: string | undefined\n ) {\n if (this._depth < 0) throw new Error(\"Depth cannot be negative\");\n }\n\n public abstract type: FlatGridItemType;\n public abstract label: string;\n public abstract selectionKey: string;\n\n public get depth() {\n return this._depth;\n }\n\n public get parentSelectionKey() {\n return this._parentSelectionKey;\n }\n\n public get parentCategorySelectionKey() {\n return this._parentCategorySelectionKey;\n }\n\n public get isExpanded() {\n return this._isExpanded;\n }\n\n public set isExpanded(value: boolean) {\n this._isExpanded = value;\n }\n\n public abstract getChildren(): IMutableFlatGridItem[];\n public abstract getSelf(): IMutableFlatGridItem;\n\n protected getDescendants() {\n const descendants: IMutableFlatGridItem[] = [];\n this.getChildren().forEach((child) =>\n descendants.push(...child.getDescendantsAndSelf())\n );\n\n return descendants;\n }\n\n /**\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\n */\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getDescendants()];\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\n */\n public getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded)\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n return descendants;\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\n */\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getVisibleDescendants()];\n }\n\n /**\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\n */\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\n if (!this.isExpanded) return this.getSelf();\n\n const children = this.getChildren();\n if (children.length < 1) return this.getSelf();\n\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\n }\n\n /**\n * Sets lastInNumberOfCategories value and sends it down to this items last child\n * @internal\n */\n public get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0) return 0;\n\n return this._lastInNumberOfCategories;\n }\n\n public set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].lastInNumberOfCategories = value;\n }\n\n /**\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\n * @internal\n */\n public get isLastInRootCategory(): boolean {\n if (this.isExpanded && this.getChildren().length > 0) return false;\n\n return this._isLastInRootCategory;\n }\n\n public set isLastInRootCategory(value: boolean) {\n this._isLastInRootCategory = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].isLastInRootCategory = value;\n }\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\n * @public\n */\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\n type: FlatGridItemType.Category;\n name: string;\n derivedCategory: PropertyCategory;\n isRootCategory: boolean;\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\n * @public\n */\nexport interface IMutableCategorizedPropertyItem\n extends IMutableFlatPropertyGridItem {\n readonly type: CategorizedPropertyTypes;\n readonly derivedRecord: PropertyRecord;\n readonly parentCategorySelectionKey: string;\n readonly parentSelectionKey: string;\n\n getChildren(): IMutableCategorizedPropertyItem[];\n}\n\n/**\n * Type which describes mutable GridCategoryItem or CategorizedProperty\n * @public\n */\nexport type IMutableFlatGridItem =\n | IMutableCategorizedPropertyItem\n | IMutableGridCategoryItem;\n\n/**\n * Base class for all Mutable CategorizedProperties\n * @public\n */\nexport abstract class MutableCategorizedProperty\n extends MutableFlatPropertyGridItem\n implements Partial<IMutableCategorizedPropertyItem>\n{\n private _derivedRecord: PropertyRecord;\n private _selectionKey: string;\n\n public constructor(\n type: CategorizedPropertyTypes,\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(depth, parentSelectionKey, parentCategorySelectionKey);\n\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\n if (recordType !== type) {\n const expectedTypeStr = FlatGridItemType[type];\n const actualTypeStr = FlatGridItemType[recordType];\n throw Error(\n `Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`\n );\n }\n\n const overriddenProperty = this.makeOverriddenProperty(\n record.property,\n overrideName,\n overrideDisplayLabel\n );\n this._derivedRecord = this.makeDerivedRecord(record, overriddenProperty);\n\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\n this._isExpanded = !!record.autoExpand;\n }\n\n public abstract override type: CategorizedPropertyTypes;\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\n\n /**\n * Maps PropertyRecord valueFormat to FlatGridItemType\n * @param valueType valueFormat to map\n * @returns mapped FlatGridItemType\n */\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\n switch (valueType) {\n case PropertyValueFormat.Primitive:\n return FlatGridItemType.Primitive;\n case PropertyValueFormat.Array:\n return FlatGridItemType.Array;\n case PropertyValueFormat.Struct:\n return FlatGridItemType.Struct;\n\n default:\n const unhandledType: never = valueType;\n throw Error(`Property Value Format not handled: ${unhandledType}`);\n }\n }\n\n /**\n * Make new property description with overridden fields.\n * @param propertyDescription property description to override.\n * @param overrideName property description name to override.\n * @param overrideDisplay property description display name to override.\n */\n private makeOverriddenProperty(\n propertyDescription: PropertyDescription,\n overrideName?: string,\n overrideDisplay?: string\n ): PropertyDescription {\n const { name, displayLabel, ...property } = { ...propertyDescription };\n const newName = overrideName ?? name;\n const newDisplayLabel = overrideDisplay ?? displayLabel;\n\n return { ...property, name: newName, displayLabel: newDisplayLabel };\n }\n\n /**\n * Gets derived property record that has it's property description field overridden\n */\n private makeDerivedRecord(\n record: PropertyRecord,\n overriddenPropertyDescription: PropertyDescription\n ) {\n const { value, property, ...others } = record;\n const newRecord = new PropertyRecord(value, overriddenPropertyDescription);\n\n return Object.assign(newRecord, others);\n }\n\n public getSelf(): IMutableCategorizedPropertyItem {\n return this;\n }\n\n public override get parentCategorySelectionKey() {\n return super.parentCategorySelectionKey!;\n }\n\n public override get parentSelectionKey() {\n return super.parentSelectionKey!;\n }\n\n /**\n * Unique selection key made of parent selectionKey and this property name.\n */\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get label() {\n return this._derivedRecord.property.displayLabel;\n }\n\n /**\n * Record with overridden property description.\n */\n public get derivedRecord() {\n return this._derivedRecord;\n }\n}\n"]}
1
+ {"version":3,"file":"MutableFlatGridItem.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+DAAQ,CAAA;IACR,iEAAS,CAAA;IACT,yDAAK,CAAA;IACL,2DAAM,CAAA;AACR,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAgCD;;;GAG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MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAoB,0BAA0B;QAC5C,OAAO,KAAK,CAAC,0BAA2B,CAAC;IAC3C,CAAC;IAED,IAAoB,kBAAkB;QACpC,OAAO,KAAK,CAAC,kBAAmB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF","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 PropertyGrid\n */\nimport { immerable } from \"immer\";\nimport type { PropertyDescription } from \"@itwin/appui-abstract\";\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { Guid } from \"@itwin/core-bentley\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider.js\";\n\n/**\n * Types of FlatGridItems for differentiating what property FlatGridItem is wrapping.\n * Category for PropertyCategory\n * (Primitive, Array, Struct) for PropertyRecord with valueFormats: (Primitive, Array, Struct)\n * @public\n */\nexport enum FlatGridItemType {\n Category,\n Primitive,\n Array,\n Struct,\n}\n\n/**\n * Type which extracts FlatGridItemTypes relevant for working with CategorizedProperties\n * @public\n */\nexport type CategorizedPropertyTypes =\n | FlatGridItemType.Array\n | FlatGridItemType.Primitive\n | FlatGridItemType.Struct;\n\n/**\n * Base mutable data structure defining common methods and properties for both CategorizedProperties and GridCategoryItems\n * @public\n */\nexport interface IMutableFlatPropertyGridItem {\n readonly type: FlatGridItemType;\n readonly key: string;\n readonly selectionKey: string;\n readonly parentSelectionKey: string | undefined;\n readonly parentCategorySelectionKey: string | undefined;\n readonly depth: number;\n readonly label: string;\n lastInNumberOfCategories: number;\n isLastInRootCategory: boolean;\n isExpanded: boolean;\n getDescendantsAndSelf(): IMutableFlatGridItem[];\n getVisibleDescendantsAndSelf(): IMutableFlatGridItem[];\n getChildren(): IMutableFlatGridItem[];\n getLastVisibleDescendantOrSelf(): IMutableFlatGridItem;\n}\n\n/**\n * Base class for all FlatPropertyGrid items\n * @public\n */\nexport abstract class MutableFlatPropertyGridItem\n implements IMutableFlatPropertyGridItem\n{\n public [immerable] = true;\n\n public readonly key: string = Guid.createValue();\n protected _isExpanded: boolean = false;\n protected _lastInNumberOfCategories: number = 0;\n protected _isLastInRootCategory: boolean = false;\n\n public constructor(\n private _depth: number,\n private _parentSelectionKey: string | undefined,\n private _parentCategorySelectionKey: string | undefined\n ) {\n if (this._depth < 0) throw new Error(\"Depth cannot be negative\");\n }\n\n public abstract type: FlatGridItemType;\n public abstract label: string;\n public abstract selectionKey: string;\n\n public get depth() {\n return this._depth;\n }\n\n public get parentSelectionKey() {\n return this._parentSelectionKey;\n }\n\n public get parentCategorySelectionKey() {\n return this._parentCategorySelectionKey;\n }\n\n public get isExpanded() {\n return this._isExpanded;\n }\n\n public set isExpanded(value: boolean) {\n this._isExpanded = value;\n }\n\n public abstract getChildren(): IMutableFlatGridItem[];\n public abstract getSelf(): IMutableFlatGridItem;\n\n protected getDescendants() {\n const descendants: IMutableFlatGridItem[] = [];\n this.getChildren().forEach((child) =>\n descendants.push(...child.getDescendantsAndSelf())\n );\n\n return descendants;\n }\n\n /**\n * Gets a flat list of all FlatGridItems beneath this flat grid item including itself in depth first visiting order.\n */\n public getDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getDescendants()];\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item.\n */\n public getVisibleDescendants(): IMutableFlatGridItem[] {\n const descendants: IMutableFlatGridItem[] = [];\n if (this.isExpanded)\n this.getChildren().forEach((child) =>\n descendants.push(...child.getVisibleDescendantsAndSelf())\n );\n return descendants;\n }\n\n /**\n * Gets a flat list of visible FlatGridItems beneath this flat grid item and itself in depth first visiting order.\n */\n public getVisibleDescendantsAndSelf(): IMutableFlatGridItem[] {\n return [this.getSelf(), ...this.getVisibleDescendants()];\n }\n\n /**\n * @returns self if item is not expanded, last visible descendant of this item otherwise.\n */\n public getLastVisibleDescendantOrSelf(): IMutableFlatGridItem {\n if (!this.isExpanded) return this.getSelf();\n\n const children = this.getChildren();\n if (children.length < 1) return this.getSelf();\n\n return children[children.length - 1].getLastVisibleDescendantOrSelf();\n }\n\n /**\n * Sets lastInNumberOfCategories value and sends it down to this items last child\n * @internal\n */\n public get lastInNumberOfCategories(): number {\n if (this.isExpanded && this.getChildren().length > 0) return 0;\n\n return this._lastInNumberOfCategories;\n }\n\n public set lastInNumberOfCategories(value: number) {\n this._lastInNumberOfCategories = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].lastInNumberOfCategories = value;\n }\n\n /**\n * Gets and sets isLastInRootCategory value and sends it down to this items last child\n * @internal\n */\n public get isLastInRootCategory(): boolean {\n if (this.isExpanded && this.getChildren().length > 0) return false;\n\n return this._isLastInRootCategory;\n }\n\n public set isLastInRootCategory(value: boolean) {\n this._isLastInRootCategory = value;\n const children = this.getChildren();\n if (children.length < 1) return;\n\n children[children.length - 1].isLastInRootCategory = value;\n }\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable GridCategoryItems\n * @public\n */\nexport interface IMutableGridCategoryItem extends IMutableFlatPropertyGridItem {\n type: FlatGridItemType.Category;\n name: string;\n derivedCategory: PropertyCategory;\n isRootCategory: boolean;\n}\n\n/**\n * Data structure which describes methods and properties to be held by Mutable CategorizedPropertyItems\n * @public\n */\nexport interface IMutableCategorizedPropertyItem\n extends IMutableFlatPropertyGridItem {\n readonly type: CategorizedPropertyTypes;\n readonly derivedRecord: PropertyRecord;\n readonly parentCategorySelectionKey: string;\n readonly parentSelectionKey: string;\n\n getChildren(): IMutableCategorizedPropertyItem[];\n}\n\n/**\n * Type which describes mutable GridCategoryItem or CategorizedProperty\n * @public\n */\nexport type IMutableFlatGridItem =\n | IMutableCategorizedPropertyItem\n | IMutableGridCategoryItem;\n\n/**\n * Base class for all Mutable CategorizedProperties\n * @public\n */\nexport abstract class MutableCategorizedProperty\n extends MutableFlatPropertyGridItem\n implements Partial<IMutableCategorizedPropertyItem>\n{\n private _derivedRecord: PropertyRecord;\n private _selectionKey: string;\n\n public constructor(\n type: CategorizedPropertyTypes,\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n super(depth, parentSelectionKey, parentCategorySelectionKey);\n\n const recordType = this.valueTypeToFlatGridType(record.value.valueFormat);\n if (recordType !== type) {\n const expectedTypeStr = FlatGridItemType[type];\n const actualTypeStr = FlatGridItemType[recordType];\n throw Error(\n `Record with incorrect value format passed to property: expected ${expectedTypeStr}, got ${actualTypeStr}`\n );\n }\n\n const overriddenProperty = this.makeOverriddenProperty(\n record.property,\n overrideName,\n overrideDisplayLabel\n );\n this._derivedRecord = this.makeDerivedRecord(record, overriddenProperty);\n\n this._selectionKey = `${this.parentSelectionKey}_${this.derivedRecord.property.name}`;\n this._isExpanded = !!record.autoExpand;\n }\n\n public abstract override type: CategorizedPropertyTypes;\n public abstract override getChildren(): IMutableCategorizedPropertyItem[];\n\n /**\n * Maps PropertyRecord valueFormat to FlatGridItemType\n * @param valueType valueFormat to map\n * @returns mapped FlatGridItemType\n */\n private valueTypeToFlatGridType(valueType: PropertyValueFormat) {\n switch (valueType) {\n case PropertyValueFormat.Primitive:\n return FlatGridItemType.Primitive;\n case PropertyValueFormat.Array:\n return FlatGridItemType.Array;\n case PropertyValueFormat.Struct:\n return FlatGridItemType.Struct;\n\n default:\n const unhandledType: never = valueType;\n throw Error(\n `Property Value Format not handled: ${String(unhandledType)}`\n );\n }\n }\n\n /**\n * Make new property description with overridden fields.\n * @param propertyDescription property description to override.\n * @param overrideName property description name to override.\n * @param overrideDisplay property description display name to override.\n */\n private makeOverriddenProperty(\n propertyDescription: PropertyDescription,\n overrideName?: string,\n overrideDisplay?: string\n ): PropertyDescription {\n const { name, displayLabel, ...property } = { ...propertyDescription };\n const newName = overrideName ?? name;\n const newDisplayLabel = overrideDisplay ?? displayLabel;\n\n return { ...property, name: newName, displayLabel: newDisplayLabel };\n }\n\n /**\n * Gets derived property record that has it's property description field overridden\n */\n private makeDerivedRecord(\n record: PropertyRecord,\n overriddenPropertyDescription: PropertyDescription\n ) {\n const { value, property, ...others } = record;\n const newRecord = new PropertyRecord(value, overriddenPropertyDescription);\n\n return Object.assign(newRecord, others);\n }\n\n public getSelf(): IMutableCategorizedPropertyItem {\n return this;\n }\n\n public override get parentCategorySelectionKey() {\n return super.parentCategorySelectionKey!;\n }\n\n public override get parentSelectionKey() {\n return super.parentSelectionKey!;\n }\n\n /**\n * Unique selection key made of parent selectionKey and this property name.\n */\n public get selectionKey() {\n return this._selectionKey;\n }\n\n public get label() {\n return this._derivedRecord.property.displayLabel;\n }\n\n /**\n * Record with overridden property description.\n */\n public get derivedRecord() {\n return this._derivedRecord;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridItemFactory.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uC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AAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM,GAC5B,+BAA+B;IAuClC;;;;;;;OAOG;IACI,kBAAkB,CACvB,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,mBAAmB,EAChC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,wBAAwB;CAqB5B"}
1
+ {"version":3,"file":"MutableGridItemFactory.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,OAAO,KAAK,EACV,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGpE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,yBAAyB,EAAE,CACzB,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM,KAC1B,+BAA+B,CAAC;IAErC,kBAAkB,EAAE,CAClB,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,mBAAmB,EAChC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,KAAK,CAAC,EAAE,MAAM,KACX,wBAAwB,CAAC;CAC/B;AAED;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,uBAAuB;IACpE,SAAS,CAAC,uBAAuB,CAC/B,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM;IAY/B,SAAS,CAAC,mBAAmB,CAC3B,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM;IAa/B,SAAS,CAAC,oBAAoB,CAC5B,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM;IAa/B;;;;;;;;;OASG;IACI,yBAAyB,CAC9B,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,MAAM,EAC1B,0BAA0B,EAAE,MAAM,EAClC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,MAAM,EACrB,oBAAoB,CAAC,EAAE,MAAM,GAC5B,+BAA+B;IAyClC;;;;;;;OAOG;IACI,kBAAkB,CACvB,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,mBAAmB,EAChC,kBAAkB,CAAC,EAAE,MAAM,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,wBAAwB;CAqB5B"}
@@ -39,7 +39,7 @@ export class MutableGridItemFactory {
39
39
  return this.createStructProperty(record, parentSelectionKey, parentCategorySelectionKey, depth, overrideName, overrideDisplayLabel);
40
40
  default:
41
41
  const unhandledRecordType = valueFormat;
42
- throw new Error(`Unhandled property record type. Was a new type added? ${unhandledRecordType}`);
42
+ throw new Error(`Unhandled property record type. Was a new type added? ${String(unhandledRecordType)}`);
43
43
  }
44
44
  }
45
45
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAM3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAwB/D;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACvB,uBAAuB,CAC/B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,mCAAmC,CAC5C,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,oBAAoB,CACrB,CAAC;IACJ,CAAC;IAES,mBAAmB,CAC3B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,+BAA+B,CACxC,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,oBAAoB,CACrB,CAAC;IACJ,CAAC;IAES,oBAAoB,CAC5B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,gCAAgC,CACzC,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EA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ACR,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,KAAK,CACN,CAAC;QAEJ,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF","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 PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider.js\";\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty.js\";\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty.js\";\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty.js\";\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory.js\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableGridCategoryItem,\n} from \"./MutableFlatGridItem.js\";\nimport type { CategoryRecordsDict } from \"./MutableGridCategory.js\";\nimport { MutableGridCategory } from \"./MutableGridCategory.js\";\n\n/**\n * IMutableGridItemFactory interface for creating MutableGridItem objects\n * @public\n */\nexport interface IMutableGridItemFactory {\n createCategorizedProperty: (\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) => IMutableCategorizedPropertyItem;\n\n createGridCategory: (\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ) => IMutableGridCategoryItem;\n}\n\n/**\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\n * @public\n */\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\n protected createPrimitiveProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createArrayProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createStructProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n /**\n * Converts record into FlatGridItem.\n * @param record record to convert to a FlatGridItem.\n * @param parentSelectionKey parent selection key of provided `record`.\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\n * @param depth current depth counting from parent category.\n * @param overrideName property name that overrides original record property name.\n * @param overrideDisplayLabel property display label that overrides original record property display label.\n * @returns converted CategorizedProperty.\n */\n public createCategorizedProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ): IMutableCategorizedPropertyItem {\n const valueFormat = record.value.valueFormat;\n switch (valueFormat) {\n case PropertyValueFormat.Primitive:\n return this.createPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Array:\n return this.createArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Struct:\n return this.createStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n\n default:\n const unhandledRecordType: never = valueFormat;\n throw new Error(\n `Unhandled property record type. Was a new type added? ${unhandledRecordType}`\n );\n }\n }\n\n /**\n * Converts category into GridCategoryItem.\n * @param category PropertyCategory to convert.\n * @param recordsDict dictionary of category records.\n * @param parentSelectionKey parent selection key of this category.\n * @param depth current depth counting from root category.\n * @returns converted GridCategory.\n */\n public createGridCategory(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ): IMutableGridCategoryItem {\n if (category.renderer !== undefined)\n return new MutableCustomGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth ?? 0\n );\n\n if (parentSelectionKey !== undefined && depth !== undefined)\n return new MutableGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth\n );\n\n return new MutableGridCategory(category, recordsDict, this);\n }\n}\n"]}
1
+ {"version":3,"file":"MutableGridItemFactory.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAM3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAwB/D;;;GAGG;AACH,MAAM,OAAO,sBAAsB;IACvB,uBAAuB,CAC/B,MAAsB,EACtB,kBAA0B,EAC1B,0BAAkC,EAClC,KAAa,EACb,YAAqB,EACrB,oBAA6B;QAE7B,OAAO,IAAI,mCAAmC,CAC5C,MAAM,EACN,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,oB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AC;gBAC/C,MAAM,IAAI,KAAK,CACb,yDAAyD,MAAM,CAC7D,mBAAmB,CACpB,EAAE,CACJ,CAAC;QACN,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACI,kBAAkB,CACvB,QAA0B,EAC1B,WAAgC,EAChC,kBAA2B,EAC3B,KAAc;QAEd,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;YACjC,OAAO,IAAI,yBAAyB,CAClC,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,KAAK,IAAI,CAAC,CACX,CAAC;QAEJ,IAAI,kBAAkB,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS;YACzD,OAAO,IAAI,mBAAmB,CAC5B,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,kBAAkB,EAClB,KAAK,CACN,CAAC;QAEJ,OAAO,IAAI,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF","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 PropertyGrid\n */\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { PropertyCategory } from \"../../PropertyDataProvider.js\";\nimport { MutableCategorizedArrayProperty } from \"./MutableCategorizedArrayProperty.js\";\nimport { MutableCategorizedPrimitiveProperty } from \"./MutableCategorizedPrimitiveProperty.js\";\nimport { MutableCategorizedStructProperty } from \"./MutableCategorizedStructProperty.js\";\nimport { MutableCustomGridCategory } from \"./MutableCustomGridCategory.js\";\nimport type {\n IMutableCategorizedPropertyItem,\n IMutableGridCategoryItem,\n} from \"./MutableFlatGridItem.js\";\nimport type { CategoryRecordsDict } from \"./MutableGridCategory.js\";\nimport { MutableGridCategory } from \"./MutableGridCategory.js\";\n\n/**\n * IMutableGridItemFactory interface for creating MutableGridItem objects\n * @public\n */\nexport interface IMutableGridItemFactory {\n createCategorizedProperty: (\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) => IMutableCategorizedPropertyItem;\n\n createGridCategory: (\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ) => IMutableGridCategoryItem;\n}\n\n/**\n * Implementation of IMutableGridItemFactory for creating MutableGridItem objects.\n * @public\n */\nexport class MutableGridItemFactory implements IMutableGridItemFactory {\n protected createPrimitiveProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createArrayProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n protected createStructProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ) {\n return new MutableCategorizedStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n this,\n overrideName,\n overrideDisplayLabel\n );\n }\n\n /**\n * Converts record into FlatGridItem.\n * @param record record to convert to a FlatGridItem.\n * @param parentSelectionKey parent selection key of provided `record`.\n * @param parentCategorySelectionKey parent category selection key of provided `record`.\n * @param depth current depth counting from parent category.\n * @param overrideName property name that overrides original record property name.\n * @param overrideDisplayLabel property display label that overrides original record property display label.\n * @returns converted CategorizedProperty.\n */\n public createCategorizedProperty(\n record: PropertyRecord,\n parentSelectionKey: string,\n parentCategorySelectionKey: string,\n depth: number,\n overrideName?: string,\n overrideDisplayLabel?: string\n ): IMutableCategorizedPropertyItem {\n const valueFormat = record.value.valueFormat;\n switch (valueFormat) {\n case PropertyValueFormat.Primitive:\n return this.createPrimitiveProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Array:\n return this.createArrayProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n case PropertyValueFormat.Struct:\n return this.createStructProperty(\n record,\n parentSelectionKey,\n parentCategorySelectionKey,\n depth,\n overrideName,\n overrideDisplayLabel\n );\n\n default:\n const unhandledRecordType: never = valueFormat;\n throw new Error(\n `Unhandled property record type. Was a new type added? ${String(\n unhandledRecordType\n )}`\n );\n }\n }\n\n /**\n * Converts category into GridCategoryItem.\n * @param category PropertyCategory to convert.\n * @param recordsDict dictionary of category records.\n * @param parentSelectionKey parent selection key of this category.\n * @param depth current depth counting from root category.\n * @returns converted GridCategory.\n */\n public createGridCategory(\n category: PropertyCategory,\n recordsDict: CategoryRecordsDict,\n parentSelectionKey?: string,\n depth?: number\n ): IMutableGridCategoryItem {\n if (category.renderer !== undefined)\n return new MutableCustomGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth ?? 0\n );\n\n if (parentSelectionKey !== undefined && depth !== undefined)\n return new MutableGridCategory(\n category,\n recordsDict,\n this,\n parentSelectionKey,\n depth\n );\n\n return new MutableGridCategory(category, recordsDict, this);\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Tree
3
3
  */
4
- import type { IDisposable } from "@itwin/core-bentley";
4
+ import "../../common/DisposePolyfill.js";
5
5
  import type { Subscription } from "./Observable.js";
6
6
  import type { TreeCheckboxStateChangeEventArgs, TreeEvents, TreeNodeEventArgs, TreeSelectionModificationEventArgs, TreeSelectionReplacementEventArgs } from "./TreeEvents.js";
7
7
  import type { TreeModelNode } from "./TreeModel.js";
@@ -33,13 +33,18 @@ export interface TreeEventHandlerParams {
33
33
  * Default tree event handler.
34
34
  * @public
35
35
  */
36
- export declare class TreeEventHandler implements TreeEvents, IDisposable {
36
+ export declare class TreeEventHandler implements TreeEvents, Disposable {
37
+ #private;
37
38
  private _modelMutator;
38
39
  private _editingParams?;
39
40
  private _disposed;
40
41
  private _selectionReplaced;
41
42
  constructor(params: TreeEventHandlerParams);
42
- /** Disposes tree event handler. */
43
+ /** Destructor. Must be called to clean up. */
44
+ [Symbol.dispose](): void;
45
+ /** Disposes tree event handler.
46
+ * @deprecated in 5.5.0. Use `[Symbol.dispose]` instead.
47
+ */
43
48
  dispose(): void;
44
49
  get modelSource(): TreeModelSource;
45
50
  /** Expands node and starts loading children. */
@@ -1 +1 @@
1
- {"version":3,"file":"TreeEventHandler.d.ts","sourceRoot":"","sources":["../../../../src/components-react/tree/controlled/TreeEventHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EACV,gCAAgC,EAChC,UAAU,EACV,iBAAiB,EACjB,kCAAkC,EAClC,iCAAiC,EAClC,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,aAAa,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAChE;AAED;;;GAGG;AACH,MA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