@itwin/components-react 3.0.0-dev.98 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +136 -5
- package/LICENSE.md +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js +3 -3
- package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js +1 -1
- package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.d.ts +1 -1
- package/lib/cjs/components-react/datepicker/TimeField.js +5 -5
- package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts +2 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/CustomNumberEditor.js +20 -10
- package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/EnumEditor.js +1 -2
- package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/IconEditor.js +1 -0
- package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js +1 -1
- package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
- package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +2 -2
- package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js +3 -2
- package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.js +1 -1
- package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +0 -3
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +0 -3
- package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.js +11 -8
- package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/cjs/components-react/selectable-content/SelectableContent.scss +2 -1
- package/lib/cjs/components-react/table/component/Table.d.ts +3 -3
- package/lib/cjs/components-react/table/component/Table.d.ts.map +1 -1
- package/lib/cjs/components-react/table/component/Table.js +11 -12
- package/lib/cjs/components-react/table/component/Table.js.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts +4 -0
- package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.js +1 -1
- package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +6 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js +9 -4
- package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/components-react.d.ts +0 -8
- package/lib/cjs/components-react.d.ts.map +1 -1
- package/lib/cjs/components-react.js +0 -8
- package/lib/cjs/components-react.js.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js +1 -1
- package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
- package/lib/esm/components-react/datepicker/DateField.js +1 -1
- package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
- package/lib/esm/components-react/datepicker/TimeField.d.ts +1 -1
- package/lib/esm/components-react/datepicker/TimeField.js +5 -5
- package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts +2 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/CustomNumberEditor.js +21 -11
- package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/EnumEditor.js +1 -2
- package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/IconEditor.js +1 -0
- package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
- package/lib/esm/components-react/editors/TextEditor.js +1 -1
- package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js +1 -1
- package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +2 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
- package/lib/esm/components-react/iconpicker/IconPickerButton.js +3 -2
- package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.js +1 -1
- package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +0 -3
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
- package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +0 -3
- package/lib/esm/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.js +11 -8
- package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
- package/lib/esm/components-react/selectable-content/SelectableContent.scss +2 -1
- package/lib/esm/components-react/table/component/Table.d.ts +3 -3
- package/lib/esm/components-react/table/component/Table.d.ts.map +1 -1
- package/lib/esm/components-react/table/component/Table.js +12 -13
- package/lib/esm/components-react/table/component/Table.js.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.d.ts +4 -0
- package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js +1 -1
- package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
- package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +6 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js +9 -4
- package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/components-react.d.ts +0 -8
- package/lib/esm/components-react.d.ts.map +1 -1
- package/lib/esm/components-react.js +0 -8
- package/lib/esm/components-react.js.map +1 -1
- package/package.json +22 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizedPropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,gCAAgC,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAA2B,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAqB,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAKlG,OAAO,EAAE,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAEnF,OAAO,EAAE,mCAAmC,EAAE,MAAM,4DAA4D,CAAC;AACjH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAGxF,OAAO,EAAE,+BAA+B,EAAiC,MAAM,oCAAoC,CAAC;AAEpH,OAAO,EAAE,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAA2B,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAsFlG,MAAM,CACJ,mCAAmC,EACnC,oCA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EAAE;IAC5E,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,KAAK,CAAC,eAAe,CACnB,GAAG,EAAE;QACH,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,EACD,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,CACjD,CAAC;IAEF,OAAO,CACL,6BAAK,GAAG,EAAE,MAAM,IACb,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CACvC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./VirtualizedPropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { areEqual, ListChildComponentProps, VariableSizeList } from \"react-window\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, RatioChangeResult } from \"@itwin/core-react\";\r\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\r\nimport { createContextWithMandatoryProvider } from \"../../common/UseContextWithMandatoryProvider\";\r\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\r\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\r\nimport { PropertyGridColumnInfo } from \"../../properties/renderers/PropertyGridColumns\";\r\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\r\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\r\nimport { FlatGridItem, GridCategoryItem } from \"../internal/flat-items/FlatGridItem\";\r\nimport { MutableCategorizedPrimitiveProperty } from \"../internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nimport { MutableCustomGridCategory } from \"../internal/flat-items/MutableCustomGridCategory\";\r\nimport { FlatGridItemType } from \"../internal/flat-items/MutableFlatGridItem\";\r\nimport { MutableGridCategory } from \"../internal/flat-items/MutableGridCategory\";\r\nimport { FlatPropertyRenderer } from \"../internal/flat-properties/FlatPropertyRenderer\";\r\nimport { IPropertyGridEventHandler } from \"../internal/PropertyGridEventHandler\";\r\nimport { IPropertyGridModel } from \"../internal/PropertyGridModel\";\r\nimport { PropertyCategoryRendererManager, PropertyCategoryRendererProps } from \"../PropertyCategoryRendererManager\";\r\nimport { IPropertyDataProvider, PropertyCategory } from \"../PropertyDataProvider\";\r\nimport { ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { FlatItemNestedBorderWrapper } from \"./FlatItemNestedBorderWrapper\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\n\r\n/** Properties for [[VirtualizedPropertyGrid]] React component\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {\r\n model: IPropertyGridModel;\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n width: number;\r\n height: number;\r\n}\r\n\r\n/** State of [[VirtualizedPropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface VirtualizedPropertyGridState {\r\n /** List of PropertyGrid categories */\r\n gridItems: FlatGridItem[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** Keeps record of dynamic node heights */\r\n dynamicNodeHeights: Map<string, number>;\r\n /** When resetting node height cache, marks the point at which heights have become stale */\r\n resetIndex: number;\r\n}\r\n\r\n/**\r\n * Context of [[VirtualizedPropertyGrid]] component.\r\n * @internal\r\n */\r\nexport interface PropertyGridInternalContext {\r\n gridItems: FlatGridItem[];\r\n gridEventHandler: IPropertyGridEventHandler;\r\n gridModel: IPropertyGridModel;\r\n\r\n style?: React.CSSProperties;\r\n className?: string;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onItemHeightChanged: (index: number, key: string, height: number) => void;\r\n}\r\n\r\n/**\r\n * Context of the surrounding [VirtualizedPropertyGrid]($components-react) component.\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridContext {\r\n orientation: Orientation;\r\n gridWidth: number;\r\n\r\n isPropertyHoverEnabled: boolean;\r\n isPropertySelectionEnabled: boolean;\r\n selectedPropertyKey?: string;\r\n\r\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\r\n\r\n editingPropertyKey?: string;\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n onEditCancel?: () => void;\r\n\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n\r\n actionButtonRenderers?: ActionButtonRenderer[];\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n\r\n columnRatio: number;\r\n columnInfo: PropertyGridColumnInfo;\r\n isResizeHandleBeingDragged: boolean;\r\n isResizeHandleHovered: boolean;\r\n onColumnRatioChanged: (ratio: number) => void | RatioChangeResult;\r\n onResizeHandleDragChanged: (newValue: boolean) => void;\r\n onResizeHandleHoverChanged: (newValue: boolean) => void;\r\n\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n}\r\n\r\nconst [\r\n PropertyGridInternalContextProvider,\r\n _PropertyGridInternalContextConsumer,\r\n usePropertyGridInternalContext,\r\n] = createContextWithMandatoryProvider<PropertyGridInternalContext>(\"PropertyGridInternalContext\");\r\n\r\n/**\r\n * VirtualizedPropertyGrid React component.\r\n * @beta\r\n */\r\nexport class VirtualizedPropertyGrid extends React.Component<VirtualizedPropertyGridProps, VirtualizedPropertyGridState> {\r\n private _listRef = React.createRef<VariableSizeList>();\r\n\r\n /** @internal */\r\n constructor(props: VirtualizedPropertyGridProps) {\r\n super(props);\r\n this.state = {\r\n gridItems: [],\r\n orientation: props.orientation ?? Orientation.Horizontal,\r\n dynamicNodeHeights: new Map(),\r\n resetIndex: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: VirtualizedPropertyGridProps, prevState: VirtualizedPropertyGridState) {\r\n if (this.props.orientation !== prevProps.orientation\r\n || this.props.isOrientationFixed !== prevProps.isOrientationFixed\r\n || this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth\r\n || this.props.width !== prevProps.width)\r\n this.updateOrientation(this.props.width);\r\n\r\n if (this.props.model !== prevProps.model) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n\r\n if (this.props.highlight !== prevProps.highlight && this.props.highlight?.activeHighlight && this.state.gridItems.length !== 0) {\r\n let index = 0;\r\n let foundMatchingItem = false;\r\n for (const item of this.state.gridItems) {\r\n if (item instanceof MutableCategorizedPrimitiveProperty && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.derivedRecord.property.name\r\n || item instanceof MutableGridCategory && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.name) {\r\n foundMatchingItem = true;\r\n break;\r\n }\r\n index++;\r\n }\r\n if (foundMatchingItem) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.scrollToItem(index);\r\n }\r\n }\r\n\r\n if (this.state.dynamicNodeHeights !== prevState.dynamicNodeHeights) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(this.state.resetIndex);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static getDerivedStateFromProps(props: VirtualizedPropertyGridProps, state: VirtualizedPropertyGridState): VirtualizedPropertyGridState | null {\r\n return {\r\n ...state,\r\n gridItems: props.model.getVisibleFlatGrid(),\r\n };\r\n }\r\n\r\n private updateOrientation(width: number) {\r\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };\r\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);\r\n\r\n if (currentOrientation !== this.state.orientation) {\r\n this.setState({ orientation: currentOrientation });\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n }\r\n\r\n /**\r\n * Calculate given node height depending on it's type, position in category, parent category depth and current orientation.\r\n * @param node FlatGridItem node for which to calculate height\r\n * @returns current height of node.\r\n */\r\n private calculateNodeHeight(node: FlatGridItem) {\r\n const categoryHeaderHeight = 34;\r\n const categoryHeaderPadding = 4;\r\n const categoryPropertyHeight = 27;\r\n const bottomBorderPadding = 5;\r\n const verticalPrimitivePropertyHeight = 55;\r\n\r\n return getPropertyHeight(this.state) + node.lastInNumberOfCategories * bottomBorderPadding;\r\n\r\n function getPropertyHeight(state: VirtualizedPropertyGridState) {\r\n const dynamicHeight = state.dynamicNodeHeights.get(node.key);\r\n if (dynamicHeight !== undefined) {\r\n if (node instanceof MutableCustomGridCategory) {\r\n return categoryHeaderHeight + categoryHeaderPadding\r\n + (node.isExpanded ? dynamicHeight + bottomBorderPadding : 0);\r\n }\r\n\r\n return dynamicHeight + (state.orientation === Orientation.Vertical ? 28 : 0);\r\n }\r\n\r\n if (node.type === FlatGridItemType.Category) {\r\n return categoryHeaderHeight + categoryHeaderPadding;\r\n }\r\n\r\n if (state.orientation === Orientation.Vertical && node.type === FlatGridItemType.Primitive) {\r\n return verticalPrimitivePropertyHeight;\r\n }\r\n\r\n return categoryPropertyHeight;\r\n }\r\n }\r\n\r\n private _handleNodeHeightChange = (index: number, key: string, newHeight: number) => {\r\n if (this.state.dynamicNodeHeights.get(key) === newHeight) {\r\n return;\r\n }\r\n\r\n this.setState((state) => {\r\n return {\r\n ...state,\r\n dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(key, newHeight),\r\n resetIndex: index,\r\n };\r\n });\r\n };\r\n\r\n private _calculateNodeHeightByIndex = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return this.calculateNodeHeight(node);\r\n };\r\n\r\n private calculateEstimatedHeight() {\r\n let sum = 0;\r\n for (const node of this.state.gridItems)\r\n sum += this.calculateNodeHeight(node);\r\n\r\n return Math.ceil(sum / this.state.gridItems.length);\r\n }\r\n\r\n private _getNodeKey = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return node.key;\r\n };\r\n\r\n /** @internal */\r\n public override render() {\r\n return <ColumnResizingPropertyListPropsSupplier\r\n orientation={this.state.orientation}\r\n width={this.props.width}\r\n minLabelWidth={this.props.minLabelWidth}\r\n minValueWidth={this.props.minValueWidth}\r\n actionButtonWidth={this.props.actionButtonWidth}\r\n >\r\n {(columnResizeContext) => (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n >\r\n {(selectionContext) => {\r\n const gridContext: VirtualizedPropertyGridContext = {\r\n orientation: columnResizeContext.orientation,\r\n gridWidth: this.props.width,\r\n\r\n isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,\r\n isPropertySelectionEnabled: selectionContext.isPropertySelectionEnabled,\r\n selectedPropertyKey: selectionContext.selectedPropertyKey,\r\n\r\n onPropertyClicked: selectionContext.onPropertyClicked,\r\n onPropertyRightClicked: selectionContext.onPropertyRightClicked,\r\n onPropertyContextMenu: selectionContext.onPropertyContextMenu,\r\n\r\n editingPropertyKey: selectionContext.editingPropertyKey,\r\n onEditCommit: selectionContext.onEditCommit,\r\n onEditCancel: selectionContext.onEditCancel,\r\n\r\n eventHandler: this.props.eventHandler,\r\n dataProvider: this.props.dataProvider,\r\n\r\n actionButtonRenderers: this.props.actionButtonRenderers,\r\n propertyValueRendererManager: this.props.propertyValueRendererManager,\r\n propertyCategoryRendererManager: this.props.propertyCategoryRendererManager,\r\n\r\n columnRatio: columnResizeContext.columnRatio,\r\n columnInfo: columnResizeContext.columnInfo,\r\n isResizeHandleBeingDragged: columnResizeContext.isResizeHandleBeingDragged,\r\n isResizeHandleHovered: columnResizeContext.isResizeHandleHovered,\r\n onColumnRatioChanged: columnResizeContext.onColumnChanged,\r\n onResizeHandleDragChanged: columnResizeContext.onResizeHandleDragChanged,\r\n onResizeHandleHoverChanged: columnResizeContext.onResizeHandleHoverChanged,\r\n\r\n highlight: this.props.highlight,\r\n };\r\n\r\n const renderContext: PropertyGridInternalContext = {\r\n gridItems: this.state.gridItems,\r\n gridEventHandler: this.props.eventHandler,\r\n gridModel: this.props.model,\r\n style: this.props.style,\r\n className: this.props.className,\r\n onItemHeightChanged: this._handleNodeHeightChange,\r\n gridContext,\r\n };\r\n\r\n return (\r\n <PropertyGridInternalContextProvider value={renderContext}>\r\n <div className={classnames(\"components-virtualized-property-grid\", \"components-smallEditor-host\")}>\r\n <VariableSizeList\r\n className={classnames(\"components-property-grid-wrapper\", \"ReactWindow__VariableSizeList\", this.props.className)}\r\n width={this.props.width}\r\n height={this.props.height}\r\n itemCount={this.state.gridItems.length}\r\n itemSize={this._calculateNodeHeightByIndex}\r\n estimatedItemSize={this.calculateEstimatedHeight()}\r\n overscanCount={10}\r\n layout=\"vertical\"\r\n style={this.props.style}\r\n itemKey={this._getNodeKey}\r\n ref={this._listRef}\r\n >\r\n {FlatGridItemNode}\r\n </VariableSizeList>\r\n </div>\r\n </PropertyGridInternalContextProvider>\r\n );\r\n }}\r\n </PropertyGridEventsRelatedPropsSupplier >\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>;\r\n }\r\n}\r\n\r\nconst FlatGridItemNode = React.memo(\r\n ({ index, style: virtualizedListStyle }: ListChildComponentProps) => {\r\n const { gridItems, gridEventHandler, gridModel, gridContext, className, style, onItemHeightChanged } = usePropertyGridInternalContext(FlatGridItemNode);\r\n const node = gridItems[index];\r\n\r\n const onExpansionToggled = React.useCallback(\r\n () => gridEventHandler.onExpansionToggled(node.selectionKey),\r\n [gridEventHandler, node.selectionKey],\r\n );\r\n const onHeightChanged = React.useCallback(\r\n (newHeight: number) => onItemHeightChanged(index, node.key, newHeight),\r\n [onItemHeightChanged, index, node.key],\r\n );\r\n\r\n function getDisplayNode() {\r\n const lastInNumberOfCategories = node.lastInNumberOfCategories;\r\n switch (node.type) {\r\n case FlatGridItemType.Category:\r\n const categoryRendererManager = gridContext.propertyCategoryRendererManager\r\n ?? PropertyCategoryRendererManager.defaultManager;\r\n const customRenderer = categoryRendererManager.getCategoryComponent(node);\r\n const wrapperClassName = classnames(\r\n \"virtualized-grid-node-content\",\r\n customRenderer !== undefined ? \"virtualized-grid-node-custom-category\" : \"virtualized-grid-node-category\",\r\n );\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={node.depth}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className={wrapperClassName}\r\n >\r\n <PropertyCategoryBlock\r\n className={className}\r\n style={style}\r\n category={node.derivedCategory}\r\n onExpansionToggled={onExpansionToggled}\r\n highlight={gridContext.highlight?.filteredTypes?.includes(FilteredType.Category) ?\r\n gridContext.highlight :\r\n undefined\r\n }\r\n >\r\n {customRenderer !== undefined && (\r\n <CustomCategoryContent\r\n renderer={customRenderer}\r\n categoryItem={node}\r\n gridContext={gridContext}\r\n onHeightChanged={onHeightChanged}\r\n />\r\n )}\r\n </PropertyCategoryBlock>\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n case FlatGridItemType.Array:\r\n case FlatGridItemType.Struct:\r\n case FlatGridItemType.Primitive:\r\n const selectionKey = node.selectionKey;\r\n const parentCategoryItem = gridModel.getItem(node.parentCategorySelectionKey) as GridCategoryItem;\r\n\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={parentCategoryItem.depth + 1}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className=\"virtualized-grid-node-content\"\r\n >\r\n <FlatPropertyRenderer\r\n key={node.key}\r\n uniqueKey={selectionKey}\r\n propertyRecord={node.derivedRecord}\r\n orientation={gridContext.orientation}\r\n indentation={node.depth}\r\n width={gridContext.gridWidth}\r\n\r\n isHoverable={gridContext.isPropertyHoverEnabled}\r\n isSelectable={gridContext.isPropertySelectionEnabled}\r\n isSelected={selectionKey === gridContext.selectedPropertyKey}\r\n\r\n onClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyClicked : undefined}\r\n onRightClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyRightClicked : undefined}\r\n onContextMenu={gridContext.onPropertyContextMenu}\r\n\r\n category={parentCategoryItem.derivedCategory}\r\n isEditing={selectionKey === gridContext.editingPropertyKey}\r\n onEditCommit={gridContext.onEditCommit}\r\n onEditCancel={gridContext.onEditCancel}\r\n\r\n isExpanded={node.isExpanded}\r\n onExpansionToggled={onExpansionToggled}\r\n onHeightChanged={onHeightChanged}\r\n\r\n actionButtonRenderers={gridContext.actionButtonRenderers}\r\n propertyValueRendererManager={gridContext.propertyValueRendererManager}\r\n\r\n columnRatio={gridContext.columnRatio}\r\n columnInfo={gridContext.columnInfo}\r\n isResizeHandleBeingDragged={gridContext.isResizeHandleBeingDragged}\r\n isResizeHandleHovered={gridContext.isResizeHandleHovered}\r\n onColumnRatioChanged={gridContext.onColumnRatioChanged}\r\n onResizeHandleDragChanged={gridContext.onResizeHandleDragChanged}\r\n onResizeHandleHoverChanged={gridContext.onResizeHandleHoverChanged}\r\n\r\n highlight={gridContext.highlight ?\r\n { applyOnLabel: (gridContext.highlight.filteredTypes?.includes(FilteredType.Label)) ?? false, applyOnValue: (gridContext.highlight.filteredTypes?.includes(FilteredType.Value)) ?? false, ...gridContext.highlight } :\r\n undefined\r\n }\r\n />\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"virtualized-grid-node\" style={virtualizedListStyle}>\r\n {getDisplayNode()}\r\n </div>\r\n );\r\n },\r\n areEqual,\r\n);\r\n\r\nFlatGridItemNode.displayName = \"FlatGridItemNode\";\r\n\r\ninterface CustomCategoryContentProps {\r\n categoryItem: GridCategoryItem;\r\n renderer: React.ComponentType<PropertyCategoryRendererProps>;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onHeightChanged: (newHeight: number) => void;\r\n}\r\n\r\nconst CustomCategoryContent: React.FC<CustomCategoryContentProps> = (props) => {\r\n const { onHeightChanged } = props;\r\n const divRef = React.useRef<HTMLDivElement>(null);\r\n\r\n React.useLayoutEffect(\r\n () => {\r\n assert(divRef.current !== null);\r\n const contentHeight = divRef.current.getBoundingClientRect().height;\r\n onHeightChanged(contentHeight);\r\n },\r\n [props.gridContext.orientation, onHeightChanged],\r\n );\r\n\r\n return (\r\n <div ref={divRef}>\r\n {React.createElement(props.renderer, props)}\r\n </div>\r\n );\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"VirtualizedPropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;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;QAChC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QACpE,eAAe,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,CACjD,CAAC;IAEF,OAAO,CACL,6BAAK,GAAG,EAAE,MAAM,IACb,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CACvC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./VirtualizedPropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { areEqual, ListChildComponentProps, VariableSizeList } from \"react-window\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, RatioChangeResult } from \"@itwin/core-react\";\r\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\r\nimport { createContextWithMandatoryProvider } from \"../../common/UseContextWithMandatoryProvider\";\r\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\r\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\r\nimport { PropertyGridColumnInfo } from \"../../properties/renderers/PropertyGridColumns\";\r\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\r\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\r\nimport { FlatGridItem, GridCategoryItem } from \"../internal/flat-items/FlatGridItem\";\r\nimport { MutableCategorizedPrimitiveProperty } from \"../internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nimport { MutableCustomGridCategory } from \"../internal/flat-items/MutableCustomGridCategory\";\r\nimport { FlatGridItemType } from \"../internal/flat-items/MutableFlatGridItem\";\r\nimport { MutableGridCategory } from \"../internal/flat-items/MutableGridCategory\";\r\nimport { FlatPropertyRenderer } from \"../internal/flat-properties/FlatPropertyRenderer\";\r\nimport { IPropertyGridEventHandler } from \"../internal/PropertyGridEventHandler\";\r\nimport { IPropertyGridModel } from \"../internal/PropertyGridModel\";\r\nimport { PropertyCategoryRendererManager, PropertyCategoryRendererProps } from \"../PropertyCategoryRendererManager\";\r\nimport { IPropertyDataProvider, PropertyCategory } from \"../PropertyDataProvider\";\r\nimport { ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { FlatItemNestedBorderWrapper } from \"./FlatItemNestedBorderWrapper\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\n\r\n/** Properties for [[VirtualizedPropertyGrid]] React component\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {\r\n model: IPropertyGridModel;\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n width: number;\r\n height: number;\r\n}\r\n\r\n/** State of [[VirtualizedPropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface VirtualizedPropertyGridState {\r\n /** List of PropertyGrid categories */\r\n gridItems: FlatGridItem[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** Keeps record of dynamic node heights */\r\n dynamicNodeHeights: Map<string, number>;\r\n /** When resetting node height cache, marks the point at which heights have become stale */\r\n resetIndex: number;\r\n}\r\n\r\n/**\r\n * Context of [[VirtualizedPropertyGrid]] component.\r\n * @internal\r\n */\r\nexport interface PropertyGridInternalContext {\r\n gridItems: FlatGridItem[];\r\n gridEventHandler: IPropertyGridEventHandler;\r\n gridModel: IPropertyGridModel;\r\n\r\n style?: React.CSSProperties;\r\n className?: string;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onItemHeightChanged: (index: number, key: string, height: number) => void;\r\n}\r\n\r\n/**\r\n * Context of the surrounding [VirtualizedPropertyGrid]($components-react) component.\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridContext {\r\n orientation: Orientation;\r\n gridWidth: number;\r\n\r\n isPropertyHoverEnabled: boolean;\r\n isPropertySelectionEnabled: boolean;\r\n selectedPropertyKey?: string;\r\n\r\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\r\n\r\n editingPropertyKey?: string;\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n onEditCancel?: () => void;\r\n\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n\r\n actionButtonRenderers?: ActionButtonRenderer[];\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n\r\n columnRatio: number;\r\n columnInfo: PropertyGridColumnInfo;\r\n isResizeHandleBeingDragged: boolean;\r\n isResizeHandleHovered: boolean;\r\n onColumnRatioChanged: (ratio: number) => void | RatioChangeResult;\r\n onResizeHandleDragChanged: (newValue: boolean) => void;\r\n onResizeHandleHoverChanged: (newValue: boolean) => void;\r\n\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n}\r\n\r\nconst [\r\n PropertyGridInternalContextProvider,\r\n _PropertyGridInternalContextConsumer,\r\n usePropertyGridInternalContext,\r\n] = createContextWithMandatoryProvider<PropertyGridInternalContext>(\"PropertyGridInternalContext\");\r\n\r\n/**\r\n * VirtualizedPropertyGrid React component.\r\n * @beta\r\n */\r\nexport class VirtualizedPropertyGrid extends React.Component<VirtualizedPropertyGridProps, VirtualizedPropertyGridState> {\r\n private _listRef = React.createRef<VariableSizeList>();\r\n\r\n /** @internal */\r\n constructor(props: VirtualizedPropertyGridProps) {\r\n super(props);\r\n this.state = {\r\n gridItems: [],\r\n orientation: props.orientation ?? Orientation.Horizontal,\r\n dynamicNodeHeights: new Map(),\r\n resetIndex: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: VirtualizedPropertyGridProps, prevState: VirtualizedPropertyGridState) {\r\n if (this.props.orientation !== prevProps.orientation\r\n || this.props.isOrientationFixed !== prevProps.isOrientationFixed\r\n || this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth\r\n || this.props.width !== prevProps.width)\r\n this.updateOrientation(this.props.width);\r\n\r\n if (this.props.model !== prevProps.model) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n\r\n if (this.props.highlight !== prevProps.highlight && this.props.highlight?.activeHighlight && this.state.gridItems.length !== 0) {\r\n let index = 0;\r\n let foundMatchingItem = false;\r\n for (const item of this.state.gridItems) {\r\n if (item instanceof MutableCategorizedPrimitiveProperty && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.derivedRecord.property.name\r\n || item instanceof MutableGridCategory && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.name) {\r\n foundMatchingItem = true;\r\n break;\r\n }\r\n index++;\r\n }\r\n if (foundMatchingItem) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.scrollToItem(index);\r\n }\r\n }\r\n\r\n if (this.state.dynamicNodeHeights !== prevState.dynamicNodeHeights) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(this.state.resetIndex);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static getDerivedStateFromProps(props: VirtualizedPropertyGridProps, state: VirtualizedPropertyGridState): VirtualizedPropertyGridState | null {\r\n return {\r\n ...state,\r\n gridItems: props.model.getVisibleFlatGrid(),\r\n };\r\n }\r\n\r\n private updateOrientation(width: number) {\r\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };\r\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);\r\n\r\n if (currentOrientation !== this.state.orientation) {\r\n this.setState({ orientation: currentOrientation });\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n }\r\n\r\n /**\r\n * Calculate given node height depending on it's type, position in category, parent category depth and current orientation.\r\n * @param node FlatGridItem node for which to calculate height\r\n * @returns current height of node.\r\n */\r\n private calculateNodeHeight(node: FlatGridItem) {\r\n const categoryHeaderHeight = 35;\r\n const categoryHeaderPadding = 4;\r\n const categoryPropertyHeight = 27;\r\n const bottomBorderPadding = 5;\r\n const verticalPrimitivePropertyHeight = 55;\r\n\r\n return getPropertyHeight(this.state) + node.lastInNumberOfCategories * bottomBorderPadding;\r\n\r\n function getPropertyHeight(state: VirtualizedPropertyGridState) {\r\n const dynamicHeight = state.dynamicNodeHeights.get(node.key);\r\n if (dynamicHeight !== undefined) {\r\n if (node instanceof MutableCustomGridCategory) {\r\n return categoryHeaderHeight + categoryHeaderPadding\r\n + (node.isExpanded ? dynamicHeight + bottomBorderPadding : 0);\r\n }\r\n\r\n return dynamicHeight + (state.orientation === Orientation.Vertical ? 28 : 0);\r\n }\r\n\r\n if (node.type === FlatGridItemType.Category) {\r\n return categoryHeaderHeight + categoryHeaderPadding;\r\n }\r\n\r\n if (state.orientation === Orientation.Vertical && node.type === FlatGridItemType.Primitive) {\r\n return verticalPrimitivePropertyHeight;\r\n }\r\n\r\n return categoryPropertyHeight;\r\n }\r\n }\r\n\r\n private _handleNodeHeightChange = (index: number, key: string, newHeight: number) => {\r\n if (this.state.dynamicNodeHeights.get(key) === newHeight) {\r\n return;\r\n }\r\n\r\n this.setState((state) => {\r\n return {\r\n ...state,\r\n dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(key, newHeight),\r\n resetIndex: index,\r\n };\r\n });\r\n };\r\n\r\n private _calculateNodeHeightByIndex = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return this.calculateNodeHeight(node);\r\n };\r\n\r\n private calculateEstimatedHeight() {\r\n let sum = 0;\r\n for (const node of this.state.gridItems)\r\n sum += this.calculateNodeHeight(node);\r\n\r\n return Math.ceil(sum / this.state.gridItems.length);\r\n }\r\n\r\n private _getNodeKey = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return node.key;\r\n };\r\n\r\n /** @internal */\r\n public override render() {\r\n return <ColumnResizingPropertyListPropsSupplier\r\n orientation={this.state.orientation}\r\n width={this.props.width}\r\n minLabelWidth={this.props.minLabelWidth}\r\n minValueWidth={this.props.minValueWidth}\r\n actionButtonWidth={this.props.actionButtonWidth}\r\n >\r\n {(columnResizeContext) => (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n >\r\n {(selectionContext) => {\r\n const gridContext: VirtualizedPropertyGridContext = {\r\n orientation: columnResizeContext.orientation,\r\n gridWidth: this.props.width,\r\n\r\n isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,\r\n isPropertySelectionEnabled: selectionContext.isPropertySelectionEnabled,\r\n selectedPropertyKey: selectionContext.selectedPropertyKey,\r\n\r\n onPropertyClicked: selectionContext.onPropertyClicked,\r\n onPropertyRightClicked: selectionContext.onPropertyRightClicked,\r\n onPropertyContextMenu: selectionContext.onPropertyContextMenu,\r\n\r\n editingPropertyKey: selectionContext.editingPropertyKey,\r\n onEditCommit: selectionContext.onEditCommit,\r\n onEditCancel: selectionContext.onEditCancel,\r\n\r\n eventHandler: this.props.eventHandler,\r\n dataProvider: this.props.dataProvider,\r\n\r\n actionButtonRenderers: this.props.actionButtonRenderers,\r\n propertyValueRendererManager: this.props.propertyValueRendererManager,\r\n propertyCategoryRendererManager: this.props.propertyCategoryRendererManager,\r\n\r\n columnRatio: columnResizeContext.columnRatio,\r\n columnInfo: columnResizeContext.columnInfo,\r\n isResizeHandleBeingDragged: columnResizeContext.isResizeHandleBeingDragged,\r\n isResizeHandleHovered: columnResizeContext.isResizeHandleHovered,\r\n onColumnRatioChanged: columnResizeContext.onColumnChanged,\r\n onResizeHandleDragChanged: columnResizeContext.onResizeHandleDragChanged,\r\n onResizeHandleHoverChanged: columnResizeContext.onResizeHandleHoverChanged,\r\n\r\n highlight: this.props.highlight,\r\n };\r\n\r\n const renderContext: PropertyGridInternalContext = {\r\n gridItems: this.state.gridItems,\r\n gridEventHandler: this.props.eventHandler,\r\n gridModel: this.props.model,\r\n style: this.props.style,\r\n className: this.props.className,\r\n onItemHeightChanged: this._handleNodeHeightChange,\r\n gridContext,\r\n };\r\n\r\n return (\r\n <PropertyGridInternalContextProvider value={renderContext}>\r\n <div className={classnames(\"components-virtualized-property-grid\", \"components-smallEditor-host\")}>\r\n <VariableSizeList\r\n className={classnames(\"components-property-grid-wrapper\", \"ReactWindow__VariableSizeList\", this.props.className)}\r\n width={this.props.width}\r\n height={this.props.height}\r\n itemCount={this.state.gridItems.length}\r\n itemSize={this._calculateNodeHeightByIndex}\r\n estimatedItemSize={this.calculateEstimatedHeight()}\r\n overscanCount={10}\r\n layout=\"vertical\"\r\n style={this.props.style}\r\n itemKey={this._getNodeKey}\r\n ref={this._listRef}\r\n >\r\n {FlatGridItemNode}\r\n </VariableSizeList>\r\n </div>\r\n </PropertyGridInternalContextProvider>\r\n );\r\n }}\r\n </PropertyGridEventsRelatedPropsSupplier >\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>;\r\n }\r\n}\r\n\r\nconst FlatGridItemNode = React.memo(\r\n ({ index, style: virtualizedListStyle }: ListChildComponentProps) => {\r\n const { gridItems, gridEventHandler, gridModel, gridContext, className, style, onItemHeightChanged } = usePropertyGridInternalContext(FlatGridItemNode);\r\n const node = gridItems[index];\r\n\r\n const onExpansionToggled = React.useCallback(\r\n () => gridEventHandler.onExpansionToggled(node.selectionKey),\r\n [gridEventHandler, node.selectionKey],\r\n );\r\n const onHeightChanged = React.useCallback(\r\n (newHeight: number) => onItemHeightChanged(index, node.key, newHeight),\r\n [onItemHeightChanged, index, node.key],\r\n );\r\n\r\n function getDisplayNode() {\r\n const lastInNumberOfCategories = node.lastInNumberOfCategories;\r\n switch (node.type) {\r\n case FlatGridItemType.Category:\r\n const categoryRendererManager = gridContext.propertyCategoryRendererManager\r\n ?? PropertyCategoryRendererManager.defaultManager;\r\n const customRenderer = categoryRendererManager.getCategoryComponent(node);\r\n const wrapperClassName = classnames(\r\n \"virtualized-grid-node-content\",\r\n customRenderer !== undefined ? \"virtualized-grid-node-custom-category\" : \"virtualized-grid-node-category\",\r\n );\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={node.depth}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className={wrapperClassName}\r\n >\r\n <PropertyCategoryBlock\r\n className={className}\r\n style={style}\r\n category={node.derivedCategory}\r\n onExpansionToggled={onExpansionToggled}\r\n highlight={gridContext.highlight?.filteredTypes?.includes(FilteredType.Category) ?\r\n gridContext.highlight :\r\n undefined\r\n }\r\n >\r\n {customRenderer !== undefined && (\r\n <CustomCategoryContent\r\n renderer={customRenderer}\r\n categoryItem={node}\r\n gridContext={gridContext}\r\n onHeightChanged={onHeightChanged}\r\n />\r\n )}\r\n </PropertyCategoryBlock>\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n case FlatGridItemType.Array:\r\n case FlatGridItemType.Struct:\r\n case FlatGridItemType.Primitive:\r\n const selectionKey = node.selectionKey;\r\n const parentCategoryItem = gridModel.getItem(node.parentCategorySelectionKey) as GridCategoryItem;\r\n\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={parentCategoryItem.depth + 1}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className=\"virtualized-grid-node-content\"\r\n >\r\n <FlatPropertyRenderer\r\n key={node.key}\r\n uniqueKey={selectionKey}\r\n propertyRecord={node.derivedRecord}\r\n orientation={gridContext.orientation}\r\n indentation={node.depth}\r\n width={gridContext.gridWidth}\r\n\r\n isHoverable={gridContext.isPropertyHoverEnabled}\r\n isSelectable={gridContext.isPropertySelectionEnabled}\r\n isSelected={selectionKey === gridContext.selectedPropertyKey}\r\n\r\n onClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyClicked : undefined}\r\n onRightClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyRightClicked : undefined}\r\n onContextMenu={gridContext.onPropertyContextMenu}\r\n\r\n category={parentCategoryItem.derivedCategory}\r\n isEditing={selectionKey === gridContext.editingPropertyKey}\r\n onEditCommit={gridContext.onEditCommit}\r\n onEditCancel={gridContext.onEditCancel}\r\n\r\n isExpanded={node.isExpanded}\r\n onExpansionToggled={onExpansionToggled}\r\n onHeightChanged={onHeightChanged}\r\n\r\n actionButtonRenderers={gridContext.actionButtonRenderers}\r\n propertyValueRendererManager={gridContext.propertyValueRendererManager}\r\n\r\n columnRatio={gridContext.columnRatio}\r\n columnInfo={gridContext.columnInfo}\r\n isResizeHandleBeingDragged={gridContext.isResizeHandleBeingDragged}\r\n isResizeHandleHovered={gridContext.isResizeHandleHovered}\r\n onColumnRatioChanged={gridContext.onColumnRatioChanged}\r\n onResizeHandleDragChanged={gridContext.onResizeHandleDragChanged}\r\n onResizeHandleHoverChanged={gridContext.onResizeHandleHoverChanged}\r\n\r\n highlight={gridContext.highlight ?\r\n { applyOnLabel: (gridContext.highlight.filteredTypes?.includes(FilteredType.Label)) ?? false, applyOnValue: (gridContext.highlight.filteredTypes?.includes(FilteredType.Value)) ?? false, ...gridContext.highlight } :\r\n undefined\r\n }\r\n />\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"virtualized-grid-node\" style={virtualizedListStyle}>\r\n {getDisplayNode()}\r\n </div>\r\n );\r\n },\r\n areEqual,\r\n);\r\n\r\nFlatGridItemNode.displayName = \"FlatGridItemNode\";\r\n\r\ninterface CustomCategoryContentProps {\r\n categoryItem: GridCategoryItem;\r\n renderer: React.ComponentType<PropertyCategoryRendererProps>;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onHeightChanged: (newHeight: number) => void;\r\n}\r\n\r\nconst CustomCategoryContent: React.FC<CustomCategoryContentProps> = (props) => {\r\n const { onHeightChanged } = props;\r\n const divRef = React.useRef<HTMLDivElement>(null);\r\n\r\n React.useLayoutEffect(\r\n () => {\r\n assert(divRef.current !== null);\r\n const contentHeight = divRef.current.getBoundingClientRect().height;\r\n onHeightChanged(contentHeight);\r\n },\r\n [props.gridContext.orientation, onHeightChanged],\r\n );\r\n\r\n return (\r\n <div ref={divRef}>\r\n {React.createElement(props.renderer, props)}\r\n </div>\r\n );\r\n};\r\n"]}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@import "~@itwin/core-react/lib/cjs/core-react/expandable/list";
|
|
6
6
|
@import "~@itwin/core-react/lib/cjs/core-react/scrollbar";
|
|
7
|
-
@import "~@itwin/core-react/lib/cjs/core-react/style/itwinui-overrides";
|
|
8
7
|
|
|
9
8
|
.components-virtualized-property-grid-loader {
|
|
10
9
|
height: 100%;
|
|
@@ -15,8 +14,6 @@
|
|
|
15
14
|
|
|
16
15
|
.components-virtualized-property-grid {
|
|
17
16
|
user-select: none;
|
|
18
|
-
|
|
19
|
-
@include small-itwinui-expandable-block;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
.components-property-grid-wrapper {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableContent.d.ts","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectableContent.d.ts","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,eAgClF;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wBAAwB,EAAE,MAAM,CAAC;IACjC,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAU9D"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import "./SelectableContent.scss";
|
|
10
10
|
import * as React from "react";
|
|
11
|
-
import {
|
|
11
|
+
import { Select } from "@itwin/itwinui-react";
|
|
12
12
|
/**
|
|
13
13
|
* A fully-controlled component that accepts a list of child components with ids and labels and
|
|
14
14
|
* renders a select box at the top, allowing to choose which of the provided child components
|
|
@@ -18,16 +18,19 @@ import { ThemedSelect } from "@itwin/core-react";
|
|
|
18
18
|
export function ControlledSelectableContent(props) {
|
|
19
19
|
var _a;
|
|
20
20
|
const { onSelectedContentIdChanged } = props;
|
|
21
|
-
const onContentIdSelected = React.useCallback((
|
|
22
|
-
onSelectedContentIdChanged &&
|
|
21
|
+
const onContentIdSelected = React.useCallback((newValue) => {
|
|
22
|
+
onSelectedContentIdChanged && onSelectedContentIdChanged(newValue);
|
|
23
23
|
}, [onSelectedContentIdChanged]);
|
|
24
24
|
const selectedContent = (_a = props.children.find((contentDef) => contentDef.id === props.selectedContentId)) !== null && _a !== void 0 ? _a : props.children[0];
|
|
25
|
+
const options = React.useMemo(() => {
|
|
26
|
+
return props.children.map((componentDef) => ({
|
|
27
|
+
label: componentDef.label,
|
|
28
|
+
value: componentDef.id,
|
|
29
|
+
}));
|
|
30
|
+
}, [props.children]);
|
|
25
31
|
return (React.createElement("div", { className: "components-selectable-content" },
|
|
26
|
-
React.createElement("div", { className: "components-selectable-content-header" },
|
|
27
|
-
React.createElement(
|
|
28
|
-
label: componentDef.label,
|
|
29
|
-
value: componentDef.id,
|
|
30
|
-
})) })),
|
|
32
|
+
React.createElement("div", { className: "components-selectable-content-header" }, options.length > 0 &&
|
|
33
|
+
React.createElement(Select, { onChange: onContentIdSelected, size: "small", className: "components-selectable-content-selector", "aria-label": props.selectAriaLabel, value: selectedContent.id, options: options })),
|
|
31
34
|
React.createElement("div", { className: "components-selectable-content-wrapper" }, selectedContent === null || selectedContent === void 0 ? void 0 : selectedContent.render())));
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAwB5D;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAuC;;IACjF,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAE7C,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,QAAgB,EAAQ,EAAE;QACvE,0BAA0B,IAAI,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,KAAK,CAAC,iBAAiB,CAAC,mCAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5H,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,YAAY,CAAC,KAAK;YACzB,KAAK,EAAE,YAAY,CAAC,EAAE;SACvB,CAAC,CAA2B,CAAC;IAChC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAErB,OAAO,CACL,6BAAK,SAAS,EAAC,+BAA+B;QAC5C,6BAAK,SAAS,EAAC,sCAAsC,IAClD,OAAO,CAAC,MAAM,GAAG,CAAC;YACjB,oBAAC,MAAM,IAAC,QAAQ,EAAE,mBAAmB,EAAE,IAAI,EAAC,OAAO,EACjD,SAAS,EAAC,wCAAwC,gBACtC,KAAK,CAAC,eAAe,EACjC,KAAK,EAAE,eAAe,CAAC,EAAE,EACzB,OAAO,EAAE,OAAO,GAChB,CAEA;QACN,6BAAK,SAAS,EAAC,uCAAuC,IACnD,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC;AAYD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module SelectableContent\r\n */\r\n\r\nimport \"./SelectableContent.scss\";\r\nimport * as React from \"react\";\r\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\r\n\r\n/**\r\n * A definition for content displayed in [[ControlledSelectableContent]] and\r\n * [[SelectableContent]] components.\r\n * @public\r\n */\r\nexport interface SelectableContentDefinition {\r\n id: string;\r\n label: string;\r\n render: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * [[ControlledSelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface ControlledSelectableContentProps {\r\n selectedContentId: string;\r\n onSelectedContentIdChanged?: (contentId: string) => void;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * A fully-controlled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\r\n const { onSelectedContentIdChanged } = props;\r\n\r\n const onContentIdSelected = React.useCallback((newValue: string): void => {\r\n onSelectedContentIdChanged && onSelectedContentIdChanged(newValue);\r\n }, [onSelectedContentIdChanged]);\r\n\r\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\r\n const options = React.useMemo(() => {\r\n return props.children.map((componentDef) => ({\r\n label: componentDef.label,\r\n value: componentDef.id,\r\n })) as SelectOption<string>[];\r\n }, [props.children]);\r\n\r\n return (\r\n <div className=\"components-selectable-content\">\r\n <div className=\"components-selectable-content-header\">\r\n {options.length > 0 &&\r\n <Select onChange={onContentIdSelected} size=\"small\"\r\n className=\"components-selectable-content-selector\"\r\n aria-label={props.selectAriaLabel}\r\n value={selectedContent.id}\r\n options={options}\r\n />\r\n }\r\n </div>\r\n <div className=\"components-selectable-content-wrapper\">\r\n {selectedContent?.render()}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * [[SelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface SelectableContentProps {\r\n defaultSelectedContentId: string;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * An uncontrolled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function SelectableContent(props: SelectableContentProps) {\r\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\r\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\r\n setSelectedContentId(id);\r\n }, []);\r\n return (\r\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\r\n {props.children}\r\n </ControlledSelectableContent>\r\n );\r\n}\r\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import "./Table.scss";
|
|
5
5
|
import "../columnfiltering/ColumnFiltering.scss";
|
|
6
6
|
import * as React from "react";
|
|
7
|
-
import { CommonProps,
|
|
7
|
+
import { CommonProps, UiStateStorage } from "@itwin/core-react";
|
|
8
8
|
import { SelectionMode } from "../../common/selection/SelectionModes";
|
|
9
9
|
import { PropertyUpdatedArgs } from "../../editors/EditorContainer";
|
|
10
10
|
import { PropertyDialogState, PropertyValueRendererManager } from "../../properties/ValueRendererManager";
|
|
@@ -56,10 +56,10 @@ export interface TableProps extends CommonProps {
|
|
|
56
56
|
/** Indicates whether the Table columns are reorderable */
|
|
57
57
|
reorderableColumns?: boolean;
|
|
58
58
|
/** Optional parameter for persistent UI settings. Used for column reordering and show persistency. */
|
|
59
|
-
settingsStorage?:
|
|
59
|
+
settingsStorage?: UiStateStorage;
|
|
60
60
|
/** Optional parameter for persistent UI settings. Used for column reordering and show persistency.
|
|
61
61
|
* @deprecated use settingsStorage property */
|
|
62
|
-
|
|
62
|
+
uiStateStorage?: UiStateStorage;
|
|
63
63
|
/** Identifying string used for persistent state. */
|
|
64
64
|
settingsIdentifier?: string;
|
|
65
65
|
/** Custom property value renderer manager */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/table/component/Table.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,yCAAyC,CAAC;AAIjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/table/component/Table.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,yCAAyC,CAAC;AAIjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,WAAW,EACX,cAAc,EACf,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAGtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAC1G,OAAO,EAAE,mCAAmC,EAAoC,MAAM,oCAAoC,CAAC;AAO3H,OAAO,EAAE,QAAQ,EAAqC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG/G,OAAO,EAAuB,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjE;;;GAGG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,IAAA;IACH,IAAI,IAAA;CACL;AA6BD;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,kCAAkC;IAClC,YAAY,EAAE,iBAAiB,CAAC;IAChC,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,kCAAkC;IAClC,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAErE,kDAAkD;IAClD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;IAC1C,0CAA0C;IAC1C,cAAc,CAAC,EAAE,CA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aAAa,CAAgF;IAGrG,OAAO,CAAC,cAAc,CAA8C;IAEpE,OAAO,CAAC,gBAAgB;IAIxB,6BAA6B;IAC7B,OAAO,CAAC,eAAe;IAavB;;OAEG;IACH,IAAW,iBAAiB,IAAI,mCAAmC,CAOlE;IAED;;OAEG;IAEI,iCAAiC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMlE,OAAO,CAAC,mBAAmB,CAUzB;IAGF,OAAO,CAAC,qBAAqB,CAI3B;IAEF,OAAO,CAAC,YAAY,CAUlB;IAGF,OAAO,CAAC,qBAAqB,CAM3B;IAQF,OAAO,CAAC,SAAS,CAIf;IAEF,uEAAuE;IACvE,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,gBAAgB,CAyItB;IAEF,OAAO,CAAC,UAAU,CAA8D;IAChF,OAAO,CAAC,QAAQ,CAA+D;IAE/E,gBAAgB;IACA,MAAM;CA6FvB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IAE1D,gBAAgB;IACA,MAAM;CAMvB"}
|
|
@@ -15,7 +15,7 @@ import * as React from "react";
|
|
|
15
15
|
import ReactDataGrid from "react-data-grid";
|
|
16
16
|
import { DisposableList, Guid } from "@itwin/core-bentley";
|
|
17
17
|
import { PropertyValueFormat } from "@itwin/appui-abstract";
|
|
18
|
-
import { Dialog, ElementResizeObserver, isNavigationKey, ItemKeyboardNavigator,
|
|
18
|
+
import { Dialog, ElementResizeObserver, isNavigationKey, ItemKeyboardNavigator, LocalStateStorage, Orientation, SortDirection, Timer, UiStateStorageStatus, } from "@itwin/core-react";
|
|
19
19
|
import { SelectionHandler, } from "../../common/selection/SelectionHandler";
|
|
20
20
|
import { SelectionMode } from "../../common/selection/SelectionModes";
|
|
21
21
|
import { ShowHideMenu } from "../../common/showhide/ShowHideMenu";
|
|
@@ -386,9 +386,9 @@ export class Table extends React.Component {
|
|
|
386
386
|
cols.splice(columnTargetIndex, 0, cols.splice(columnSourceIndex, 1)[0]);
|
|
387
387
|
// istanbul ignore else
|
|
388
388
|
if (this.props.settingsIdentifier) {
|
|
389
|
-
const
|
|
389
|
+
const stateStorage = this.props.settingsStorage || /* istanbul ignore next */ new LocalStateStorage();
|
|
390
390
|
const keys = cols.map((col) => col.key);
|
|
391
|
-
|
|
391
|
+
stateStorage.saveSetting(this.props.settingsIdentifier, "ColumnReorder", keys); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
392
392
|
}
|
|
393
393
|
this.setState({ columns: [] }, () => {
|
|
394
394
|
this.setState({ columns: cols });
|
|
@@ -449,8 +449,8 @@ export class Table extends React.Component {
|
|
|
449
449
|
this._handleShowHideChange = (cols) => {
|
|
450
450
|
this.setState({ hiddenColumns: cols });
|
|
451
451
|
if (this.props.settingsIdentifier) {
|
|
452
|
-
const
|
|
453
|
-
|
|
452
|
+
const stateStorage = this.props.settingsStorage || new LocalStateStorage();
|
|
453
|
+
stateStorage.saveSetting(this.props.settingsIdentifier, "ColumnShowHideHiddenColumns", cols); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
454
454
|
}
|
|
455
455
|
return true;
|
|
456
456
|
};
|
|
@@ -783,22 +783,21 @@ export class Table extends React.Component {
|
|
|
783
783
|
}
|
|
784
784
|
let dataGridColumns = columnDescriptions.map(this._columnDescriptionToReactDataGridColumn);
|
|
785
785
|
if (this.props.settingsIdentifier) {
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
const reorderResult = await settingsStorage.getSetting(this.props.settingsIdentifier, "ColumnReorder");
|
|
786
|
+
const stateStorage = this.props.settingsStorage || /* istanbul ignore next */ this.props.uiStateStorage || /* istanbul ignore next */ new LocalStateStorage();
|
|
787
|
+
const reorderResult = await stateStorage.getSetting(this.props.settingsIdentifier, "ColumnReorder");
|
|
789
788
|
// istanbul ignore next
|
|
790
|
-
if (reorderResult.status ===
|
|
789
|
+
if (reorderResult.status === UiStateStorageStatus.Success) {
|
|
791
790
|
const setting = reorderResult.setting;
|
|
792
791
|
// map columns according to the keys in columns, in the order of the loaded array of keys
|
|
793
792
|
dataGridColumns = setting.map((key) => dataGridColumns.filter((col) => col.key === key)[0]);
|
|
794
793
|
}
|
|
795
|
-
else if (reorderResult.status ===
|
|
794
|
+
else if (reorderResult.status === UiStateStorageStatus.NotFound) {
|
|
796
795
|
const keys = columnDescriptions.map((col) => col.key);
|
|
797
|
-
await
|
|
796
|
+
await stateStorage.saveSetting(this.props.settingsIdentifier, "ColumnReorder", keys);
|
|
798
797
|
}
|
|
799
|
-
const showhideResult = await
|
|
798
|
+
const showhideResult = await stateStorage.getSetting(this.props.settingsIdentifier, "ColumnShowHideHiddenColumns");
|
|
800
799
|
// istanbul ignore next
|
|
801
|
-
if (showhideResult.status ===
|
|
800
|
+
if (showhideResult.status === UiStateStorageStatus.Success) {
|
|
802
801
|
const hiddenColumns = showhideResult.setting;
|
|
803
802
|
this.setState({ hiddenColumns });
|
|
804
803
|
}
|