@itwin/grouping-mapping-widget 0.12.0 → 0.13.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/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.js +50 -66
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.scss +0 -18
- package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
- package/lib/cjs/widget/components/GroupDetails.js +34 -0
- package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
- package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
- package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
- package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
- package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
- package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
- package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
- package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
- package/lib/cjs/widget/components/Grouping.js +1 -2
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMapping.js +1 -1
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
- package/lib/cjs/widget/components/GroupingMappingHeader.js +9 -2
- package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
- package/lib/cjs/widget/components/Mapping.js +2 -3
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.js +1 -1
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
- package/lib/cjs/widget/components/PropertyAction.js +100 -0
- package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
- package/lib/cjs/widget/components/PropertyAction.scss +9 -0
- package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
- package/lib/cjs/widget/components/QueryBuilder.js +4 -4
- package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
- package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
- package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
- package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +11 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js +27 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
- package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
- package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
- package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
- package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
- package/lib/cjs/widget/components/SelectMappings.js +1 -1
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
- package/lib/cjs/widget/components/StatusIcon.js +26 -0
- package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
- package/lib/cjs/widget/components/StatusIcon.scss +26 -0
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
- package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
- package/lib/cjs/widget/components/utils.d.ts +1 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.js +53 -69
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.scss +0 -18
- package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
- package/lib/esm/widget/components/GroupDetails.js +27 -0
- package/lib/esm/widget/components/GroupDetails.js.map +1 -0
- package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
- package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
- package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
- package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
- package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
- package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
- package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
- package/lib/esm/widget/components/Grouping.js +1 -2
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMapping.js +1 -1
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
- package/lib/esm/widget/components/GroupingMappingHeader.js +9 -2
- package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
- package/lib/esm/widget/components/Mapping.js +2 -3
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/MappingAction.js +1 -1
- package/lib/esm/widget/components/MappingAction.js.map +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
- package/lib/esm/widget/components/PropertyAction.js +77 -0
- package/lib/esm/widget/components/PropertyAction.js.map +1 -0
- package/lib/esm/widget/components/PropertyAction.scss +9 -0
- package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
- package/lib/esm/widget/components/QueryBuilder.js +4 -4
- package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
- package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
- package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
- package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +11 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.js +20 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
- package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
- package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
- package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
- package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
- package/lib/esm/widget/components/SelectMappings.js +1 -1
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
- package/lib/esm/widget/components/StatusIcon.js +19 -0
- package/lib/esm/widget/components/StatusIcon.js.map +1 -0
- package/lib/esm/widget/components/StatusIcon.scss +26 -0
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
- package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
- package/lib/esm/widget/components/utils.d.ts +1 -1
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/package.json +1 -1
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
- package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
- package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
- package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
- package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
- package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
- package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
- package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
- package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
- package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
- package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
- package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
- package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
- package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
- package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
- package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
- package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
- package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
- package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
- package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
- package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
- package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
- package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
- package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
- package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyList.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyList.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AA2CpD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,gBAAkC,EAAE,cAA8B;IAC/F,OAAO,gBAAgB,CAAC,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,Y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CAAC,kBAAkB,EAChD,YAAY,EAAE,IAAI,CAAC,aAAa,EAChC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EACrC,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACvD,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACvD,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAC/D,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GACvB,CAAC,CAAC;QACR,CAAC,CAAC,CACE,CACP,CAAC;IACJ,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 */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { PropertyRecord} from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { CommonProps, RatioChangeResult } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type {\n ActionButtonRenderer,\n PropertyCategory,\n PropertyUpdatedArgs,\n PropertyValueRendererManager,\n} from \"@itwin/components-react\";\n\nimport { PropertyRenderer } from \"./PropertyRender\";\nimport type { PropertyGridColumnInfo } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\n\n/** Properties of [[PropertyList]] React component\n * @public\n */\nexport interface PropertyListProps extends CommonProps {\n orientation: Orientation;\n category?: PropertyCategory;\n properties: PropertyRecord[];\n selectedPropertyKey?: string;\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\n columnRatio?: number;\n /** Callback to column ratio changed event */\n onColumnChanged?: (ratio: number) => void | RatioChangeResult;\n propertyValueRendererManager?: PropertyValueRendererManager;\n editingPropertyKey?: string;\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n onEditCancel?: () => void;\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property right click selection */\n isPropertyRightClickSelectionEnabled?: boolean;\n /** Array of action button renderers */\n actionButtonRenderers?: ActionButtonRenderer[];\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n /** Information for styling property grid columns */\n columnInfo?: PropertyGridColumnInfo;\n setWidth?: React.Dispatch<React.SetStateAction<number>>;\n width: number;\n}\n\n/**\n * Get unique key for property record\n * @internal\n */\nexport function getPropertyKey(propertyCategory: PropertyCategory, propertyRecord: PropertyRecord) {\n return propertyCategory.name + propertyRecord.property.name;\n}\n\n/** A React component that renders multiple properties within a category as a list.\n * @public\n */\nexport class PropertyList extends React.Component<PropertyListProps> {\n\n constructor(props: PropertyListProps) {\n super(props);\n }\n\n private _listRef = React.createRef<HTMLDivElement>();\n\n private _onEditCommit = (args: PropertyUpdatedArgs) => {\n // istanbul ignore else\n if (this.props.onEditCommit && this.props.category)\n this.props.onEditCommit(args, this.props.category);\n };\n\n private afterRender() {\n if (\n this.props.orientation !== Orientation.Horizontal ||\n !this._listRef.current\n ) {\n return;\n }\n const width = this._listRef.current.getBoundingClientRect().width;\n if (this.props.setWidth && width !== this.props.width) {\n this.props.setWidth(width);\n }\n }\n\n /** @internal */\n public override componentDidMount() {\n this.afterRender();\n }\n\n /** @internal */\n public override componentDidUpdate() {\n this.afterRender();\n }\n\n /** @internal */\n public override render() {\n const propertyListClassName = classnames(\n (this.props.orientation === Orientation.Horizontal) ? \"gmw-components-property-list--horizontal\" : \"gmw-components-property-list--vertical\",\n this.props.className,\n );\n\n return (\n <div className={propertyListClassName} style={this.props.style} ref={this._listRef}>\n {this.props.properties.map((propertyRecord: PropertyRecord) => {\n const key = this.props.category ? getPropertyKey(this.props.category, propertyRecord) : propertyRecord.property.name;\n return (\n <PropertyRenderer\n key={key}\n uniqueKey={key}\n isHoverable={this.props.isPropertyHoverEnabled}\n isSelectable={this.props.isPropertySelectionEnabled}\n isSelected={key === this.props.selectedPropertyKey}\n propertyRecord={propertyRecord}\n orientation={this.props.orientation}\n onClick={propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyClicked : undefined}\n onRightClick={propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyRightClicked : undefined}\n onContextMenu={this.props.onPropertyContextMenu}\n columnRatio={this.props.columnRatio}\n onColumnRatioChanged={this.props.onColumnChanged}\n propertyValueRendererManager={this.props.propertyValueRendererManager}\n isEditing={key === this.props.editingPropertyKey}\n onEditCommit={this._onEditCommit}\n onEditCancel={this.props.onEditCancel}\n actionButtonRenderers={this.props.actionButtonRenderers}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n columnInfo={this.props.columnInfo}\n width={this.props.width}\n />);\n })}\n </div>\n );\n }\n}\n"]}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { PropertyRecord } from "@itwin/appui-abstract";
|
|
3
|
-
import type { Orientation, RatioChangeResult } from "@itwin/core-react";
|
|
4
|
-
import type { ActionButtonRenderer, PropertyUpdatedArgs, PropertyValueRendererManager } from "@itwin/components-react";
|
|
5
|
-
import type { PropertyGridColumnInfo } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns";
|
|
6
|
-
import type { HighlightingComponentProps } from "@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps";
|
|
7
|
-
/** Properties shared by all renderers and PropertyView
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
10
|
-
export interface SharedRendererProps {
|
|
11
|
-
/** PropertyRecord to render */
|
|
12
|
-
propertyRecord: PropertyRecord;
|
|
13
|
-
/** Unique string, that identifies this property component. Should be used if onClick or onRightClick are provided */
|
|
14
|
-
uniqueKey?: string;
|
|
15
|
-
/** Orientation to use for displaying the property */
|
|
16
|
-
orientation: Orientation;
|
|
17
|
-
/** Controls component selection */
|
|
18
|
-
isSelected?: boolean;
|
|
19
|
-
/** Called when property gets clicked. If undefined, clicking is disabled */
|
|
20
|
-
onClick?: (property: PropertyRecord, key?: string) => void;
|
|
21
|
-
/** Called when property gets right clicked. If undefined, right clicking is not working */
|
|
22
|
-
onRightClick?: (property: PropertyRecord, key?: string) => void;
|
|
23
|
-
/** Called to show a context menu for properties */
|
|
24
|
-
onContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;
|
|
25
|
-
/** Ratio between label and value cells */
|
|
26
|
-
columnRatio?: number;
|
|
27
|
-
/** Callback to column ratio changed event */
|
|
28
|
-
onColumnRatioChanged?: (ratio: number) => void | RatioChangeResult;
|
|
29
|
-
/** Indicates that properties have *hover* effect */
|
|
30
|
-
isHoverable?: boolean;
|
|
31
|
-
/** Indicates that properties can be selected */
|
|
32
|
-
isSelectable?: boolean;
|
|
33
|
-
/** Width of the whole property element */
|
|
34
|
-
width?: number;
|
|
35
|
-
/** Array of action button renderers @beta */
|
|
36
|
-
actionButtonRenderers?: ActionButtonRenderer[];
|
|
37
|
-
/** Is resize handle hovered */
|
|
38
|
-
isResizeHandleHovered?: boolean;
|
|
39
|
-
/** Callback to hover event change */
|
|
40
|
-
onResizeHandleHoverChanged?: (isHovered: boolean) => void;
|
|
41
|
-
/** Is resize handle being dragged */
|
|
42
|
-
isResizeHandleBeingDragged?: boolean;
|
|
43
|
-
/** Callback to drag event change */
|
|
44
|
-
onResizeHandleDragChanged?: (isDragStarted: boolean) => void;
|
|
45
|
-
/** Information for styling property grid columns */
|
|
46
|
-
columnInfo?: PropertyGridColumnInfo;
|
|
47
|
-
}
|
|
48
|
-
/** Properties of [[PropertyRenderer]] React component
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
export interface PropertyRendererProps extends SharedRendererProps {
|
|
52
|
-
/** Custom value renderer */
|
|
53
|
-
propertyValueRendererManager?: PropertyValueRendererManager;
|
|
54
|
-
/** Multiplier of how much the property is indented to the right */
|
|
55
|
-
indentation?: number;
|
|
56
|
-
/** Indicates property is being edited @beta */
|
|
57
|
-
isEditing?: boolean;
|
|
58
|
-
/** Called when property edit is committed. @beta */
|
|
59
|
-
onEditCommit?: (args: PropertyUpdatedArgs) => void;
|
|
60
|
-
/** Called when property edit is cancelled. @beta */
|
|
61
|
-
onEditCancel?: () => void;
|
|
62
|
-
/** Props used for highlighting. @beta */
|
|
63
|
-
highlight?: HighlightingComponentProps;
|
|
64
|
-
}
|
|
65
|
-
/** State of [[PropertyRenderer]] React component
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
interface PropertyRendererState {
|
|
69
|
-
/** Currently loaded property value */
|
|
70
|
-
displayValue?: React.ReactNode;
|
|
71
|
-
}
|
|
72
|
-
/** A React component that renders properties
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
export declare class PropertyRenderer extends React.Component<PropertyRendererProps, PropertyRendererState> {
|
|
76
|
-
/** @internal */
|
|
77
|
-
readonly state: Readonly<PropertyRendererState>;
|
|
78
|
-
static getLabelOffset(indentation?: number, orientation?: Orientation, width?: number, columnRatio?: number, minColumnLabelWidth?: number): number;
|
|
79
|
-
private updateDisplayValue;
|
|
80
|
-
private _onEditCommit;
|
|
81
|
-
private _onEditCancel;
|
|
82
|
-
/** Display property record value in an editor */
|
|
83
|
-
updateDisplayValueAsEditor(props: PropertyRendererProps): void;
|
|
84
|
-
/** @internal */
|
|
85
|
-
componentDidMount(): void;
|
|
86
|
-
/** @internal */
|
|
87
|
-
componentDidUpdate(prevProps: PropertyRendererProps): void;
|
|
88
|
-
/** @internal */
|
|
89
|
-
render(): JSX.Element;
|
|
90
|
-
}
|
|
91
|
-
export {};
|
|
92
|
-
//# sourceMappingURL=PropertyRender.d.ts.map
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
import { PropertyValueFormat } from "@itwin/appui-abstract";
|
|
7
|
-
import { EditorContainer, UiComponents, } from "@itwin/components-react";
|
|
8
|
-
import { NonPrimitivePropertyRenderer } from "./NonPrimitivePropertyRenderer";
|
|
9
|
-
import { PrimitivePropertyRenderer } from "./PrimitivePropertyRenderer";
|
|
10
|
-
import { CommonPropertyRenderer } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer";
|
|
11
|
-
import { createNewDisplayValue } from "./createNewDisplayValue";
|
|
12
|
-
/** A React component that renders properties
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export class PropertyRenderer extends React.Component {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
/** @internal */
|
|
19
|
-
this.state = {
|
|
20
|
-
displayValue: UiComponents.translate("general.loading"),
|
|
21
|
-
};
|
|
22
|
-
this._onEditCommit = (args) => {
|
|
23
|
-
// istanbul ignore else
|
|
24
|
-
if (this.props.onEditCommit) {
|
|
25
|
-
this.props.onEditCommit(args);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
this._onEditCancel = () => {
|
|
29
|
-
// istanbul ignore else
|
|
30
|
-
if (this.props.onEditCancel) {
|
|
31
|
-
this.props.onEditCancel();
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
static getLabelOffset(indentation, orientation, width, columnRatio, minColumnLabelWidth) {
|
|
36
|
-
return CommonPropertyRenderer.getLabelOffset(indentation, orientation, width, columnRatio, minColumnLabelWidth);
|
|
37
|
-
}
|
|
38
|
-
updateDisplayValue(props) {
|
|
39
|
-
if (props.isEditing) {
|
|
40
|
-
this.updateDisplayValueAsEditor(props);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const displayValue = createNewDisplayValue(props.orientation, props.propertyRecord, props.indentation, props.propertyValueRendererManager);
|
|
44
|
-
this.setState({ displayValue });
|
|
45
|
-
}
|
|
46
|
-
/** Display property record value in an editor */
|
|
47
|
-
updateDisplayValueAsEditor(props) {
|
|
48
|
-
this.setState({
|
|
49
|
-
displayValue: (React.createElement(EditorContainer, { propertyRecord: props.propertyRecord, onCommit: this._onEditCommit, onCancel: this._onEditCancel, setFocus: true })),
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/** @internal */
|
|
53
|
-
componentDidMount() {
|
|
54
|
-
this.updateDisplayValue(this.props);
|
|
55
|
-
}
|
|
56
|
-
/** @internal */
|
|
57
|
-
componentDidUpdate(prevProps) {
|
|
58
|
-
if (prevProps.propertyRecord !== this.props.propertyRecord ||
|
|
59
|
-
prevProps.isEditing !== this.props.isEditing ||
|
|
60
|
-
prevProps.orientation !== this.props.orientation) {
|
|
61
|
-
this.updateDisplayValue(this.props);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/** @internal */
|
|
65
|
-
render() {
|
|
66
|
-
const { ...props } = this.props;
|
|
67
|
-
const primitiveRendererProps = {
|
|
68
|
-
...props,
|
|
69
|
-
valueElement: this.state.displayValue,
|
|
70
|
-
indentation: this.props.indentation,
|
|
71
|
-
};
|
|
72
|
-
switch (this.props.propertyRecord.value.valueFormat) {
|
|
73
|
-
case PropertyValueFormat.Primitive:
|
|
74
|
-
return (React.createElement(PrimitivePropertyRenderer, { ...primitiveRendererProps }));
|
|
75
|
-
case PropertyValueFormat.Array:
|
|
76
|
-
// If array is empty, render it as a primitive property
|
|
77
|
-
if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array
|
|
78
|
-
&& this.props.propertyRecord.value.items.length === 0)
|
|
79
|
-
return (React.createElement(PrimitivePropertyRenderer, { ...primitiveRendererProps }));
|
|
80
|
-
// eslint-disable-next-line no-fallthrough
|
|
81
|
-
case PropertyValueFormat.Struct:
|
|
82
|
-
return (React.createElement(NonPrimitivePropertyRenderer, { isCollapsible: true, ...primitiveRendererProps }));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=PropertyRender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyRender.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyRender.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,OAAO,EACL,eAAe,EACf,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AACtI,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAsEhE;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAG3C;IAHD;;QAIE,gBAAgB;QACS,UAAK,GAAoC;YAChE,YAAY,EA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ACL,oBAAC,4BAA4B,IAC3B,aAAa,EAAE,IAAI,KACf,sBAAsB,GAC1B,CACH,CAAC;SACL;IACH,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*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { Orientation, RatioChangeResult } from \"@itwin/core-react\";\nimport type {\n ActionButtonRenderer,\n PrimitiveRendererProps,\n PropertyUpdatedArgs,\n PropertyValueRendererManager,\n} from \"@itwin/components-react\";\nimport {\n EditorContainer,\n UiComponents,\n} from \"@itwin/components-react\";\n\nimport { NonPrimitivePropertyRenderer } from \"./NonPrimitivePropertyRenderer\";\nimport { PrimitivePropertyRenderer } from \"./PrimitivePropertyRenderer\";\nimport type { PropertyGridColumnInfo } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\nimport type { HighlightingComponentProps } from \"@itwin/components-react/lib/cjs/components-react/common/HighlightingComponentProps\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { createNewDisplayValue } from \"./createNewDisplayValue\";\n\n/** Properties shared by all renderers and PropertyView\n * @public\n */\nexport interface SharedRendererProps {\n /** PropertyRecord to render */\n propertyRecord: PropertyRecord;\n /** Unique string, that identifies this property component. Should be used if onClick or onRightClick are provided */\n uniqueKey?: string;\n /** Orientation to use for displaying the property */\n orientation: Orientation;\n /** Controls component selection */\n isSelected?: boolean;\n /** Called when property gets clicked. If undefined, clicking is disabled */\n onClick?: (property: PropertyRecord, key?: string) => void;\n /** Called when property gets right clicked. If undefined, right clicking is not working */\n onRightClick?: (property: PropertyRecord, key?: string) => void;\n /** Called to show a context menu for properties */\n onContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\n /** Ratio between label and value cells */\n columnRatio?: number;\n /** Callback to column ratio changed event */\n onColumnRatioChanged?: (ratio: number) => void | RatioChangeResult;\n /** Indicates that properties have *hover* effect */\n isHoverable?: boolean;\n /** Indicates that properties can be selected */\n isSelectable?: boolean;\n /** Width of the whole property element */\n width?: number;\n /** Array of action button renderers @beta */\n actionButtonRenderers?: ActionButtonRenderer[];\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n /** Information for styling property grid columns */\n columnInfo?: PropertyGridColumnInfo;\n}\n\n/** Properties of [[PropertyRenderer]] React component\n * @public\n */\nexport interface PropertyRendererProps extends SharedRendererProps {\n /** Custom value renderer */\n propertyValueRendererManager?: PropertyValueRendererManager;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n /** Indicates property is being edited @beta */\n isEditing?: boolean;\n /** Called when property edit is committed. @beta */\n onEditCommit?: (args: PropertyUpdatedArgs) => void;\n /** Called when property edit is cancelled. @beta */\n onEditCancel?: () => void;\n /** Props used for highlighting. @beta */\n highlight?: HighlightingComponentProps;\n}\n\n/** State of [[PropertyRenderer]] React component\n * @internal\n */\ninterface PropertyRendererState {\n /** Currently loaded property value */\n displayValue?: React.ReactNode;\n}\n\n/** A React component that renders properties\n * @public\n */\nexport class PropertyRenderer extends React.Component<\nPropertyRendererProps,\nPropertyRendererState\n> {\n /** @internal */\n public override readonly state: Readonly<PropertyRendererState> = {\n displayValue: UiComponents.translate(\"general.loading\"),\n };\n\n public static getLabelOffset(\n indentation?: number,\n orientation?: Orientation,\n width?: number,\n columnRatio?: number,\n minColumnLabelWidth?: number,\n ): number {\n return CommonPropertyRenderer.getLabelOffset(\n indentation,\n orientation,\n width,\n columnRatio,\n minColumnLabelWidth,\n );\n }\n\n private updateDisplayValue(props: PropertyRendererProps) {\n if (props.isEditing) {\n this.updateDisplayValueAsEditor(props);\n return;\n }\n\n const displayValue = createNewDisplayValue(\n props.orientation,\n props.propertyRecord,\n props.indentation,\n props.propertyValueRendererManager,\n );\n this.setState({ displayValue });\n }\n\n private _onEditCommit = (args: PropertyUpdatedArgs) => {\n // istanbul ignore else\n if (this.props.onEditCommit) {\n this.props.onEditCommit(args);\n }\n };\n\n private _onEditCancel = () => {\n // istanbul ignore else\n if (this.props.onEditCancel) {\n this.props.onEditCancel();\n }\n };\n\n /** Display property record value in an editor */\n public updateDisplayValueAsEditor(props: PropertyRendererProps) {\n this.setState({\n displayValue: (\n <EditorContainer\n propertyRecord={props.propertyRecord}\n onCommit={this._onEditCommit}\n onCancel={this._onEditCancel}\n setFocus={true}\n />\n ),\n });\n }\n\n /** @internal */\n public override componentDidMount() {\n this.updateDisplayValue(this.props);\n }\n\n /** @internal */\n public override componentDidUpdate(prevProps: PropertyRendererProps) {\n if (\n prevProps.propertyRecord !== this.props.propertyRecord ||\n prevProps.isEditing !== this.props.isEditing ||\n prevProps.orientation !== this.props.orientation\n ) {\n this.updateDisplayValue(this.props);\n }\n }\n\n /** @internal */\n public override render() {\n const { ...props } = this.props;\n const primitiveRendererProps: PrimitiveRendererProps = {\n ...props,\n valueElement: this.state.displayValue,\n indentation: this.props.indentation,\n };\n\n switch (this.props.propertyRecord.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return (\n <PrimitivePropertyRenderer {...primitiveRendererProps} />\n );\n case PropertyValueFormat.Array:\n // If array is empty, render it as a primitive property\n if (this.props.propertyRecord.value.valueFormat === PropertyValueFormat.Array\n && this.props.propertyRecord.value.items.length === 0)\n return (\n <PrimitivePropertyRenderer {...primitiveRendererProps} />\n );\n // eslint-disable-next-line no-fallthrough\n case PropertyValueFormat.Struct:\n return (\n <NonPrimitivePropertyRenderer\n isCollapsible={true}\n {...primitiveRendererProps}\n />\n );\n }\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./PropertyView.scss";
|
|
3
|
-
import type { SharedRendererProps } from "./PropertyRender";
|
|
4
|
-
/** Properties of [[PropertyView]] React component
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface PropertyViewProps extends SharedRendererProps {
|
|
8
|
-
/** Property label as a React element */
|
|
9
|
-
labelElement: React.ReactNode;
|
|
10
|
-
/** Property value as a React element */
|
|
11
|
-
valueElement?: React.ReactNode;
|
|
12
|
-
/** Render callback for property value. If specified, `valueElement` is ignored. */
|
|
13
|
-
valueElementRenderer?: () => React.ReactNode;
|
|
14
|
-
/** Multiplier of how much the property is indented to the right */
|
|
15
|
-
indentation?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A React component that renders property as label/value pair
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare const PropertyView: (props: PropertyViewProps) => JSX.Element;
|
|
22
|
-
//# sourceMappingURL=PropertyView.d.ts.map
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import React, { useCallback, useEffect, useState } from "react";
|
|
6
|
-
import { PropertyValueFormat } from "@itwin/appui-abstract";
|
|
7
|
-
import { ElementSeparator, Orientation } from "@itwin/core-react";
|
|
8
|
-
import { ActionButtonList } from "@itwin/components-react";
|
|
9
|
-
import "./PropertyView.scss";
|
|
10
|
-
import { PropertyGridColumnStyleProvider } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns";
|
|
11
|
-
import { Checkbox } from "@itwin/itwinui-react";
|
|
12
|
-
import { CommonPropertyRenderer } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer";
|
|
13
|
-
import { usePropertyGridWrapper } from "../context/PropertyGridWrapperContext";
|
|
14
|
-
/**
|
|
15
|
-
* A React component that renders property as label/value pair
|
|
16
|
-
* @public
|
|
17
|
-
*/
|
|
18
|
-
export const PropertyView = (props) => {
|
|
19
|
-
var _a;
|
|
20
|
-
const [isCheckboxLoading, setIsCheckboxLoading] = useState(false);
|
|
21
|
-
const { currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery, isUpdating, } = usePropertyGridWrapper();
|
|
22
|
-
const _validatePropertySelection = () => {
|
|
23
|
-
if (currentPropertyList.includes(props.propertyRecord)) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
// Check if all subproperties are selected
|
|
27
|
-
if (!_validateNestedPropertiesSelection(props.propertyRecord)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
};
|
|
32
|
-
const _validateNestedPropertiesSelection = (prop) => {
|
|
33
|
-
switch (prop.value.valueFormat) {
|
|
34
|
-
case PropertyValueFormat.Primitive:
|
|
35
|
-
if (!currentPropertyList.includes(prop)) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
break;
|
|
39
|
-
case PropertyValueFormat.Array:
|
|
40
|
-
if (prop.value.items.length === 0) {
|
|
41
|
-
if (!currentPropertyList.includes(prop)) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
break;
|
|
46
|
-
case PropertyValueFormat.Struct:
|
|
47
|
-
for (const subPropName in prop.value.members) {
|
|
48
|
-
if (Object.prototype.hasOwnProperty.call(prop.value.members, subPropName)) {
|
|
49
|
-
if (!_validateNestedPropertiesSelection(prop.value.members[subPropName])) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return true;
|
|
56
|
-
};
|
|
57
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
58
|
-
const [isPropertySelected, setIsPropertySelected] = useState(_validatePropertySelection());
|
|
59
|
-
const _addSelectedProperty = useCallback(async (prop) => {
|
|
60
|
-
var _a;
|
|
61
|
-
// TODO: roof selected item/category value is an object but format is primitive(needs further exploration)
|
|
62
|
-
if (!currentPropertyList.includes(prop) &&
|
|
63
|
-
prop.value.valueFormat === PropertyValueFormat.Primitive) {
|
|
64
|
-
if (!(await (queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.addProperty(prop)))) {
|
|
65
|
-
setIsCheckboxLoading(false);
|
|
66
|
-
setIsPropertySelected(false);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
setCurrentPropertyList(currentPropertyList.concat(prop));
|
|
70
|
-
setQuery((_a = queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.buildQueryString()) !== null && _a !== void 0 ? _a : "");
|
|
71
|
-
}
|
|
72
|
-
}, [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]);
|
|
73
|
-
const _addNestedProperties = useCallback((prop) => {
|
|
74
|
-
switch (prop.value.valueFormat) {
|
|
75
|
-
case PropertyValueFormat.Primitive:
|
|
76
|
-
void _addSelectedProperty(prop);
|
|
77
|
-
break;
|
|
78
|
-
case PropertyValueFormat.Array:
|
|
79
|
-
if (prop.value.items.length === 0) {
|
|
80
|
-
void _addSelectedProperty(prop);
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
case PropertyValueFormat.Struct:
|
|
84
|
-
for (const subPropName in prop.value.members) {
|
|
85
|
-
if (Object.prototype.hasOwnProperty.call(prop.value.members, subPropName)) {
|
|
86
|
-
_addNestedProperties(prop.value.members[subPropName]);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}, [_addSelectedProperty]);
|
|
91
|
-
const _removeSelectedProperty = useCallback(async (prop) => {
|
|
92
|
-
var _a;
|
|
93
|
-
if (currentPropertyList.includes(prop)) {
|
|
94
|
-
setCurrentPropertyList(currentPropertyList.filter((x) => x !== prop));
|
|
95
|
-
await (queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.removeProperty(prop));
|
|
96
|
-
setQuery((_a = queryBuilder === null || queryBuilder === void 0 ? void 0 : queryBuilder.buildQueryString()) !== null && _a !== void 0 ? _a : "");
|
|
97
|
-
}
|
|
98
|
-
}, [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]);
|
|
99
|
-
const _removeNestedProperties = useCallback((prop) => {
|
|
100
|
-
switch (prop.value.valueFormat) {
|
|
101
|
-
case PropertyValueFormat.Primitive:
|
|
102
|
-
void _removeSelectedProperty(prop);
|
|
103
|
-
break;
|
|
104
|
-
case PropertyValueFormat.Array:
|
|
105
|
-
if (prop.value.items.length === 0) {
|
|
106
|
-
void _removeSelectedProperty(prop);
|
|
107
|
-
}
|
|
108
|
-
break;
|
|
109
|
-
case PropertyValueFormat.Struct:
|
|
110
|
-
for (const subPropName in prop.value.members) {
|
|
111
|
-
if (Object.prototype.hasOwnProperty.call(prop.value.members, subPropName)) {
|
|
112
|
-
_removeNestedProperties(prop.value.members[subPropName]);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}, [_removeSelectedProperty]);
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
if (!currentPropertyList.includes(props.propertyRecord)) {
|
|
119
|
-
setIsPropertySelected(false);
|
|
120
|
-
}
|
|
121
|
-
}, [currentPropertyList, props.propertyRecord]);
|
|
122
|
-
useEffect(() => {
|
|
123
|
-
if (props === null || props === void 0 ? void 0 : props.propertyRecord) {
|
|
124
|
-
if (isPropertySelected) {
|
|
125
|
-
if (isUpdating) {
|
|
126
|
-
setIsCheckboxLoading(true);
|
|
127
|
-
}
|
|
128
|
-
_addNestedProperties(props.propertyRecord);
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
_removeNestedProperties(props.propertyRecord);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}, [
|
|
135
|
-
_addNestedProperties,
|
|
136
|
-
_removeNestedProperties,
|
|
137
|
-
isPropertySelected,
|
|
138
|
-
props.propertyRecord,
|
|
139
|
-
isUpdating,
|
|
140
|
-
]);
|
|
141
|
-
useEffect(() => {
|
|
142
|
-
if (!isUpdating) {
|
|
143
|
-
setIsCheckboxLoading(false);
|
|
144
|
-
}
|
|
145
|
-
}, [isUpdating]);
|
|
146
|
-
const _onPropertySelectionChanged = () => {
|
|
147
|
-
setIsPropertySelected(!isPropertySelected);
|
|
148
|
-
};
|
|
149
|
-
const _onClick = () => {
|
|
150
|
-
if (props.onClick) {
|
|
151
|
-
props.onClick(props.propertyRecord, props.uniqueKey);
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
const _onMouseEnter = () => {
|
|
155
|
-
if (props.isHoverable) {
|
|
156
|
-
setIsHovered(true);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
const _onMouseLeave = () => {
|
|
160
|
-
if (props.isHoverable) {
|
|
161
|
-
setIsHovered(false);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
const _onContextMenu = (e) => {
|
|
165
|
-
if (props.onContextMenu) {
|
|
166
|
-
props.onContextMenu(props.propertyRecord, e);
|
|
167
|
-
}
|
|
168
|
-
if (props.onRightClick) {
|
|
169
|
-
props.onRightClick(props.propertyRecord, props.uniqueKey);
|
|
170
|
-
}
|
|
171
|
-
e.preventDefault();
|
|
172
|
-
return false;
|
|
173
|
-
};
|
|
174
|
-
const getClassName = (viewProps) => {
|
|
175
|
-
let propertyRecordClassName = viewProps.orientation === Orientation.Horizontal
|
|
176
|
-
? "gmw-components-property-record--horizontal"
|
|
177
|
-
: "gmw-components-property-record--vertical";
|
|
178
|
-
if (viewProps.isSelected) {
|
|
179
|
-
propertyRecordClassName += " components--selected";
|
|
180
|
-
}
|
|
181
|
-
if (viewProps.onClick) {
|
|
182
|
-
propertyRecordClassName += " components--clickable";
|
|
183
|
-
}
|
|
184
|
-
if (viewProps.isHoverable) {
|
|
185
|
-
propertyRecordClassName += " components--hoverable";
|
|
186
|
-
}
|
|
187
|
-
return propertyRecordClassName;
|
|
188
|
-
};
|
|
189
|
-
const ratio = props.columnRatio ? props.columnRatio : 0.25;
|
|
190
|
-
const needElementSeparator = props.orientation === Orientation.Horizontal &&
|
|
191
|
-
!!props.onColumnRatioChanged;
|
|
192
|
-
const needActionButtons = !!props.actionButtonRenderers;
|
|
193
|
-
const columnsStyleProvider = new PropertyGridColumnStyleProvider(props.columnInfo);
|
|
194
|
-
const offset = CommonPropertyRenderer.getLabelOffset(props.indentation, props.orientation, props.width, props.columnRatio, (_a = props.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
|
|
195
|
-
return (React.createElement("div", { style: columnsStyleProvider.getStyle(props.orientation, needActionButtons, ratio, needElementSeparator), className: getClassName(props), onClick: _onClick, onContextMenu: _onContextMenu, onMouseEnter: _onMouseEnter, onMouseLeave: _onMouseLeave, role: "presentation" },
|
|
196
|
-
React.createElement("div", { className: "gmw-components-property-record-label" },
|
|
197
|
-
props.propertyRecord.value.valueFormat ===
|
|
198
|
-
PropertyValueFormat.Primitive && (React.createElement(Checkbox, { style: { marginLeft: offset }, className: "gmw-components-property-selection-checkbox", checked: isPropertySelected, onChange: _onPropertySelectionChanged, disabled: isUpdating ||
|
|
199
|
-
props.propertyRecord.value.value === undefined, isLoading: isCheckboxLoading })),
|
|
200
|
-
props.labelElement),
|
|
201
|
-
needElementSeparator ? (React.createElement(ElementSeparator, { movableArea: props.width, onRatioChanged: props.onColumnRatioChanged, ratio: ratio, orientation: props.orientation, isResizeHandleHovered: props.isResizeHandleHovered, onResizeHandleHoverChanged: props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: props.isResizeHandleBeingDragged, onResizeHandleDragChanged: props.onResizeHandleDragChanged })) : undefined,
|
|
202
|
-
props.propertyRecord.value.valueFormat ===
|
|
203
|
-
PropertyValueFormat.Primitive ? (React.createElement("div", { className: "gmw-components-property-record-value" },
|
|
204
|
-
React.createElement("span", null, props.valueElementRenderer
|
|
205
|
-
? props.valueElementRenderer()
|
|
206
|
-
: props.valueElement))) : undefined,
|
|
207
|
-
props.actionButtonRenderers ? (React.createElement(ActionButtonList, { orientation: props.orientation, property: props.propertyRecord, isPropertyHovered: isHovered, actionButtonRenderers: props.actionButtonRenderers })) : undefined));
|
|
208
|
-
};
|
|
209
|
-
//# sourceMappingURL=PropertyView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyView.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,+BAA+B,EAAE,MAAM,2FAA2F,CAAC;AAC5I,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AACtI,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAgB/E;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;;IACvD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,EACJ,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,QAAQ,EACR,UAAU,GACX,GAAG,sBAAsB,EAAE,CAAC;IAE7B,MAAM,0BAA0B,GAAG,GAAG,EAAE;QACtC,IAAI,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC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oBAAoB,CAAC,CAAC,CAAC,CACtB,oBAAC,gBAAgB,IACf,WAAW,EAAE,KAAK,CAAC,KAAK,EACxB,cAAc,EAAE,KAAK,CAAC,oBAAoB,EAC1C,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,yBAAyB,EAAE,KAAK,CAAC,yBAAyB,GAC1D,CACH,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW;YACrC,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAC9B,6BAAK,SAAS,EAAC,sCAAsC;YACnD,kCACG,KAAK,CAAC,oBAAoB;gBACzB,CAAC,CAAC,KAAK,CAAC,oBAAoB,EAAE;gBAC9B,CAAC,CAAC,KAAK,CAAC,YAAY,CACjB,CACH,CACP,CAAC,CAAC,CAAC,SAAS;QACd,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAC7B,oBAAC,gBAAgB,IACf,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,cAAc,EAC9B,iBAAiB,EAAE,SAAS,EAC5B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,GAClD,CACH,CAAC,CAAC,CAAC,SAAS,CACT,CACP,CAAC;AACJ,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*--------------------------------------------------------------------------------------------*/\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { ElementSeparator, Orientation } from \"@itwin/core-react\";\nimport { ActionButtonList } from \"@itwin/components-react\";\nimport \"./PropertyView.scss\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { PropertyGridColumnStyleProvider } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\nimport { Checkbox } from \"@itwin/itwinui-react\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { usePropertyGridWrapper } from \"../context/PropertyGridWrapperContext\";\n\n/** Properties of [[PropertyView]] React component\n * @public\n */\nexport interface PropertyViewProps extends SharedRendererProps {\n /** Property label as a React element */\n labelElement: React.ReactNode;\n /** Property value as a React element */\n valueElement?: React.ReactNode;\n /** Render callback for property value. If specified, `valueElement` is ignored. */\n valueElementRenderer?: () => React.ReactNode;\n /** Multiplier of how much the property is indented to the right */\n indentation?: number;\n}\n\n/**\n * A React component that renders property as label/value pair\n * @public\n */\nexport const PropertyView = (props: PropertyViewProps) => {\n const [isCheckboxLoading, setIsCheckboxLoading] = useState(false);\n const {\n currentPropertyList,\n queryBuilder,\n setCurrentPropertyList,\n setQuery,\n isUpdating,\n } = usePropertyGridWrapper();\n\n const _validatePropertySelection = () => {\n if (currentPropertyList.includes(props.propertyRecord)) {\n return true;\n }\n // Check if all subproperties are selected\n if (!_validateNestedPropertiesSelection(props.propertyRecord)) {\n return false;\n }\n return true;\n };\n\n const _validateNestedPropertiesSelection = (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n if (!currentPropertyList.includes(prop)) {\n return false;\n }\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n if (!currentPropertyList.includes(prop)) {\n return false;\n }\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n if (\n !_validateNestedPropertiesSelection(\n prop.value.members[subPropName]\n )\n ) {\n return false;\n }\n }\n }\n }\n return true;\n };\n\n const [isHovered, setIsHovered] = useState<boolean>(false);\n const [isPropertySelected, setIsPropertySelected] = useState<boolean>(\n _validatePropertySelection()\n );\n\n const _addSelectedProperty = useCallback(\n async (prop: PropertyRecord) => {\n // TODO: roof selected item/category value is an object but format is primitive(needs further exploration)\n if (\n !currentPropertyList.includes(prop) &&\n prop.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n if (!(await queryBuilder?.addProperty(prop))) {\n setIsCheckboxLoading(false);\n setIsPropertySelected(false);\n return;\n }\n setCurrentPropertyList(\n currentPropertyList.concat(prop)\n );\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n }\n },\n [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]\n );\n\n const _addNestedProperties = useCallback(\n (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n void _addSelectedProperty(prop);\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n void _addSelectedProperty(prop);\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n _addNestedProperties(prop.value.members[subPropName]);\n }\n }\n }\n },\n [_addSelectedProperty]\n );\n\n const _removeSelectedProperty = useCallback(\n async (prop: PropertyRecord): Promise<void> => {\n if (currentPropertyList.includes(prop)) {\n setCurrentPropertyList(\n currentPropertyList.filter((x: PropertyRecord) => x !== prop)\n );\n await queryBuilder?.removeProperty(prop);\n setQuery(queryBuilder?.buildQueryString() ?? \"\");\n }\n },\n [currentPropertyList, queryBuilder, setCurrentPropertyList, setQuery]\n );\n\n const _removeNestedProperties = useCallback(\n (prop: PropertyRecord) => {\n switch (prop.value.valueFormat) {\n case PropertyValueFormat.Primitive:\n void _removeSelectedProperty(prop);\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n void _removeSelectedProperty(prop);\n }\n break;\n case PropertyValueFormat.Struct:\n for (const subPropName in prop.value.members) {\n if (\n Object.prototype.hasOwnProperty.call(\n prop.value.members,\n subPropName\n )\n ) {\n _removeNestedProperties(prop.value.members[subPropName]);\n }\n }\n }\n },\n [_removeSelectedProperty]\n );\n\n useEffect(() => {\n if (!currentPropertyList.includes(props.propertyRecord)) {\n setIsPropertySelected(false);\n }\n }, [currentPropertyList, props.propertyRecord]);\n\n useEffect(() => {\n if (props?.propertyRecord) {\n if (isPropertySelected) {\n if (isUpdating) {\n setIsCheckboxLoading(true);\n }\n _addNestedProperties(props.propertyRecord);\n } else {\n _removeNestedProperties(props.propertyRecord);\n }\n }\n }, [\n _addNestedProperties,\n _removeNestedProperties,\n isPropertySelected,\n props.propertyRecord,\n isUpdating,\n ]);\n\n useEffect(() => {\n if (!isUpdating) {\n setIsCheckboxLoading(false);\n }\n }, [isUpdating]);\n\n const _onPropertySelectionChanged = () => {\n setIsPropertySelected(!isPropertySelected);\n };\n\n const _onClick = () => {\n if (props.onClick) {\n props.onClick(props.propertyRecord, props.uniqueKey);\n }\n };\n\n const _onMouseEnter = () => {\n if (props.isHoverable) {\n setIsHovered(true);\n }\n };\n\n const _onMouseLeave = () => {\n if (props.isHoverable) {\n setIsHovered(false);\n }\n };\n\n const _onContextMenu = (e: React.MouseEvent) => {\n if (props.onContextMenu) {\n props.onContextMenu(props.propertyRecord, e);\n }\n if (props.onRightClick) {\n props.onRightClick(props.propertyRecord, props.uniqueKey);\n }\n e.preventDefault();\n return false;\n };\n\n const getClassName = (viewProps: PropertyViewProps) => {\n let propertyRecordClassName =\n viewProps.orientation === Orientation.Horizontal\n ? \"gmw-components-property-record--horizontal\"\n : \"gmw-components-property-record--vertical\";\n if (viewProps.isSelected) {\n propertyRecordClassName += \" components--selected\";\n }\n if (viewProps.onClick) {\n propertyRecordClassName += \" components--clickable\";\n }\n if (viewProps.isHoverable) {\n propertyRecordClassName += \" components--hoverable\";\n }\n return propertyRecordClassName;\n };\n\n const ratio = props.columnRatio ? props.columnRatio : 0.25;\n const needElementSeparator =\n props.orientation === Orientation.Horizontal &&\n !!props.onColumnRatioChanged;\n const needActionButtons = !!props.actionButtonRenderers;\n const columnsStyleProvider = new PropertyGridColumnStyleProvider(\n props.columnInfo\n );\n\n const offset = CommonPropertyRenderer.getLabelOffset(\n props.indentation,\n props.orientation,\n props.width,\n props.columnRatio,\n props.columnInfo?.minLabelWidth\n );\n\n return (\n <div\n style={columnsStyleProvider.getStyle(\n props.orientation,\n needActionButtons,\n ratio,\n needElementSeparator\n )}\n className={getClassName(props)}\n onClick={_onClick}\n onContextMenu={_onContextMenu}\n onMouseEnter={_onMouseEnter}\n onMouseLeave={_onMouseLeave}\n role=\"presentation\"\n >\n <div className=\"gmw-components-property-record-label\">\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive && (\n <Checkbox\n style={{ marginLeft: offset }}\n className=\"gmw-components-property-selection-checkbox\"\n checked={isPropertySelected}\n onChange={_onPropertySelectionChanged}\n disabled={\n isUpdating ||\n props.propertyRecord.value.value === undefined\n }\n isLoading={isCheckboxLoading}\n />\n )}\n {props.labelElement}\n </div>\n {needElementSeparator ? (\n <ElementSeparator\n movableArea={props.width}\n onRatioChanged={props.onColumnRatioChanged}\n ratio={ratio}\n orientation={props.orientation}\n isResizeHandleHovered={props.isResizeHandleHovered}\n onResizeHandleHoverChanged={props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={props.onResizeHandleDragChanged}\n />\n ) : undefined}\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive ? (\n <div className=\"gmw-components-property-record-value\">\n <span>\n {props.valueElementRenderer\n ? props.valueElementRenderer()\n : props.valueElement}\n </span>\n </div>\n ) : undefined}\n {props.actionButtonRenderers ? (\n <ActionButtonList\n orientation={props.orientation}\n property={props.propertyRecord}\n isPropertyHovered={isHovered}\n actionButtonRenderers={props.actionButtonRenderers}\n />\n ) : undefined}\n </div>\n );\n};\n"]}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
@import '~@itwin/core-react/lib/cjs/core-react/style/themecolors';
|
|
6
|
-
@import '~@itwin/itwinui-css/scss/style/typography';
|
|
7
|
-
@import '~@itwin/itwinui-css/scss/variables';
|
|
8
|
-
|
|
9
|
-
$text-font-size: $iui-font-size;
|
|
10
|
-
$text-font-color: $buic-text-color;
|
|
11
|
-
|
|
12
|
-
.gmw-components-property-record--horizontal {
|
|
13
|
-
height: 100%;
|
|
14
|
-
display: grid;
|
|
15
|
-
padding: 0 8px;
|
|
16
|
-
|
|
17
|
-
.gmw-components-property-record-label {
|
|
18
|
-
font-size: $iui-font-size-small;
|
|
19
|
-
color: $buic-foreground-muted;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.gmw-components-property-record-value {
|
|
23
|
-
min-height: 24px;
|
|
24
|
-
font-size: $text-font-size;
|
|
25
|
-
color: $text-font-color;
|
|
26
|
-
padding: 0px 5px;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.gmw-components-property-record--vertical {
|
|
31
|
-
height: 100%;
|
|
32
|
-
padding: 0 8px;
|
|
33
|
-
display: grid;
|
|
34
|
-
align-content: center;
|
|
35
|
-
|
|
36
|
-
.gmw-components-property-record-label {
|
|
37
|
-
font-size: $iui-font-size-small;
|
|
38
|
-
color: $buic-foreground-muted;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.gmw-components-property-record-value {
|
|
42
|
-
min-height: 22px;
|
|
43
|
-
font-size: $text-font-size;
|
|
44
|
-
color: $text-font-color;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@mixin gmw-record-cell {
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.gmw-components-property-record-label {
|
|
54
|
-
@include gmw-record-cell;
|
|
55
|
-
position: relative;
|
|
56
|
-
.gmw-components-property-selection-checkbox {
|
|
57
|
-
flex-shrink: 0;
|
|
58
|
-
position: absolute;
|
|
59
|
-
z-index: 1;
|
|
60
|
-
}
|
|
61
|
-
// Radial does not respect checkbox positioning, have to force it.
|
|
62
|
-
> .gmw-iui-progress-indicator-radial {
|
|
63
|
-
position: absolute;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.gmw-components-property-record-value {
|
|
68
|
-
@include gmw-record-cell;
|
|
69
|
-
overflow: hidden;
|
|
70
|
-
|
|
71
|
-
span {
|
|
72
|
-
white-space: nowrap;
|
|
73
|
-
overflow: hidden;
|
|
74
|
-
text-overflow: ellipsis;
|
|
75
|
-
width: 100%;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Common
|
|
3
|
-
*/
|
|
4
|
-
/** Counts how many times string 'lookup' is repeated in string 'str'.
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
export declare function countMatchesInString(str: string, lookup: string): number;
|
|
8
|
-
//# sourceMappingURL=countMatchesInString.d.ts.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* @author Vitim.us https://gist.github.com/victornpb/7736865 */
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Common
|
|
8
|
-
*/
|
|
9
|
-
/** Counts how many times string 'lookup' is repeated in string 'str'.
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export function countMatchesInString(str, lookup) {
|
|
13
|
-
if (!str.length || !lookup.length)
|
|
14
|
-
return 0;
|
|
15
|
-
let n = 0, pos = 0;
|
|
16
|
-
const step = lookup.length;
|
|
17
|
-
while (true) {
|
|
18
|
-
pos = str.indexOf(lookup, pos);
|
|
19
|
-
if (pos >= 0) {
|
|
20
|
-
++n;
|
|
21
|
-
pos += step;
|
|
22
|
-
}
|
|
23
|
-
else
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
return n;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=countMatchesInString.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"countMatchesInString.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/countMatchesInString.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,gEAAgE;AAEhE;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW,EAAE,MAAc;IAC9D,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM;QAC/B,OAAO,CAAC,CAAC;IAEX,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;IAE3B,OAAO,IAAI,EAAE;QACX,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,GAAG,IAAI,CAAC,EAAE;YACZ,EAAE,CAAC,CAAC;YACJ,GAAG,IAAI,IAAI,CAAC;SACb;;YACC,MAAM;KACT;IACD,OAAO,CAAC,CAAC;AACX,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/* @author Vitim.us https://gist.github.com/victornpb/7736865 */\n\n/** @packageDocumentation\n * @module Common\n */\n\n/** Counts how many times string 'lookup' is repeated in string 'str'.\n * @internal\n */\nexport function countMatchesInString(str: string, lookup: string) {\n if (!str.length || !lookup.length)\n return 0;\n\n let n = 0, pos = 0;\n const step = lookup.length;\n\n while (true) {\n pos = str.indexOf(lookup, pos);\n if (pos >= 0) {\n ++n;\n pos += step;\n } else\n break;\n }\n return n;\n}\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { PropertyRecord } from "@itwin/appui-abstract";
|
|
2
|
-
import type { HighlightingComponentProps } from "@itwin/components-react";
|
|
3
|
-
import { PropertyValueRendererManager } from "@itwin/components-react";
|
|
4
|
-
import { Orientation } from "@itwin/core-react";
|
|
5
|
-
import * as React from "react";
|
|
6
|
-
export declare function createNewDisplayValue(orientation: Orientation, propertyRecord: PropertyRecord, indentation?: number, propertyValueRendererManager?: PropertyValueRendererManager, isExpanded?: boolean, onExpansionToggled?: () => void, onHeightChanged?: (newHeight: number) => void, highlight?: HighlightingComponentProps & {
|
|
7
|
-
applyOnLabel: boolean;
|
|
8
|
-
applyOnValue: boolean;
|
|
9
|
-
}): React.ReactNode;
|
|
10
|
-
//# sourceMappingURL=createNewDisplayValue.d.ts.map
|