@itwin/grouping-mapping-widget 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/lib/cjs/widget/components/GroupAction.js +1 -1
  2. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  3. package/lib/cjs/widget/components/Grouping.js +4 -6
  4. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  5. package/lib/cjs/widget/components/Grouping.scss +7 -0
  6. package/lib/cjs/widget/components/HorizontalTile.d.ts +13 -0
  7. package/lib/cjs/widget/components/{GroupTile.js → HorizontalTile.js} +6 -6
  8. package/lib/cjs/widget/components/HorizontalTile.js.map +1 -0
  9. package/lib/{esm/widget/components/GroupTile.scss → cjs/widget/components/HorizontalTile.scss} +2 -2
  10. package/lib/cjs/widget/components/Mapping.js +37 -57
  11. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  12. package/lib/cjs/widget/components/Mapping.scss +21 -7
  13. package/lib/cjs/widget/components/SelectProject.js +28 -20
  14. package/lib/cjs/widget/components/SelectProject.js.map +1 -1
  15. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +6 -6
  16. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -1
  17. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +12 -12
  18. package/lib/cjs/widget/components/property-grid/PropertyList.js +1 -1
  19. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +1 -1
  20. package/lib/cjs/widget/components/property-grid/PropertyView.js +5 -5
  21. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -1
  22. package/lib/cjs/widget/components/property-grid/PropertyView.scss +13 -62
  23. package/lib/esm/widget/components/GroupAction.js +1 -1
  24. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  25. package/lib/esm/widget/components/Grouping.js +4 -6
  26. package/lib/esm/widget/components/Grouping.js.map +1 -1
  27. package/lib/esm/widget/components/Grouping.scss +7 -0
  28. package/lib/esm/widget/components/HorizontalTile.d.ts +13 -0
  29. package/lib/esm/widget/components/{GroupTile.js → HorizontalTile.js} +4 -4
  30. package/lib/esm/widget/components/HorizontalTile.js.map +1 -0
  31. package/lib/{cjs/widget/components/GroupTile.scss → esm/widget/components/HorizontalTile.scss} +2 -2
  32. package/lib/esm/widget/components/Mapping.js +40 -60
  33. package/lib/esm/widget/components/Mapping.js.map +1 -1
  34. package/lib/esm/widget/components/Mapping.scss +21 -7
  35. package/lib/esm/widget/components/SelectProject.js +30 -22
  36. package/lib/esm/widget/components/SelectProject.js.map +1 -1
  37. package/lib/esm/widget/components/property-grid/PropertyGrid.js +6 -6
  38. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -1
  39. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +12 -12
  40. package/lib/esm/widget/components/property-grid/PropertyList.js +1 -1
  41. package/lib/esm/widget/components/property-grid/PropertyList.js.map +1 -1
  42. package/lib/esm/widget/components/property-grid/PropertyView.js +5 -5
  43. package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -1
  44. package/lib/esm/widget/components/property-grid/PropertyView.scss +13 -62
  45. package/package.json +1 -1
  46. package/lib/cjs/widget/components/GroupTile.d.ts +0 -13
  47. package/lib/cjs/widget/components/GroupTile.js.map +0 -1
  48. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +0 -16
  49. package/lib/esm/widget/components/GroupTile.d.ts +0 -13
  50. package/lib/esm/widget/components/GroupTile.js.map +0 -1
  51. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +0 -16
@@ -5,14 +5,14 @@
5
5
  @import '~@itwin/core-react/lib/cjs/core-react/expandable/list';
6
6
  @import '~@itwin/core-react/lib/cjs/core-react/scrollbar';
7
7
 
8
- .gm-components-property-grid-loader {
8
+ .gmw-components-property-grid-loader {
9
9
  display: flex;
10
10
  justify-content: center;
11
11
  align-items: center;
12
12
  }
13
13
 
14
- .components-property-grid {
15
- .property-categories {
14
+ .gmw-components-property-grid {
15
+ .gmw-property-categories {
16
16
  @include uicore-expandable-blocks-list;
17
17
 
18
18
  display: grid;
@@ -27,7 +27,7 @@
27
27
  color: $buic-foreground-body;
28
28
  }
29
29
 
30
- .components-property-grid-wrapper {
30
+ .gmw-components-property-grid-wrapper {
31
31
  width: 100%;
32
32
  height: 100%;
33
33
  overflow-y: auto;
@@ -36,15 +36,15 @@
36
36
  @include uicore-scrollbar();
37
37
  }
38
38
 
39
- @mixin components-property-list {
39
+ @mixin gmw-components-property-list {
40
40
  width: 100%;
41
41
 
42
- .components--selected {
42
+ .gmw-components--selected {
43
43
  background-color: $buic-row-selection;
44
44
  outline: 1px solid $buic-foreground-primary;
45
45
  }
46
46
 
47
- .components--clickable {
47
+ .gmw-components--clickable {
48
48
  cursor: pointer;
49
49
 
50
50
  &:hover {
@@ -52,20 +52,20 @@
52
52
  }
53
53
  }
54
54
 
55
- .components--hoverable:hover {
55
+ .gmw-components--hoverable:hover {
56
56
  background-color: $buic-row-hover;
57
57
  }
58
58
  }
59
59
 
60
- .components-property-list--horizontal {
61
- @include components-property-list;
60
+ .gmw-components-property-list--horizontal {
61
+ @include gmw-components-property-list;
62
62
 
63
63
  display: grid;
64
64
  grid-row-gap: 0px;
65
65
  overflow: hidden;
66
66
  }
67
67
 
68
- .components-property-list--vertical {
69
- @include components-property-list;
68
+ .gmw-components-property-list--vertical {
69
+ @include gmw-components-property-list;
70
70
  // margin-top: -13px;
71
71
  }
@@ -50,7 +50,7 @@ export class PropertyList extends React.Component {
50
50
  }
51
51
  /** @internal */
52
52
  render() {
53
- const propertyListClassName = classnames((this.props.orientation === Orientation.Horizontal) ? "components-property-list--horizontal" : "components-property-list--vertical", this.props.className);
53
+ const propertyListClassName = classnames((this.props.orientation === Orientation.Horizontal) ? "gmw-components-property-list--horizontal" : "gmw-components-property-list--vertical", this.props.className);
54
54
  return (React.createElement("div", { className: propertyListClassName, style: this.props.style, ref: this._listRef }, this.props.properties.map((propertyRecord) => {
55
55
  const key = this.props.category ? getPropertyKey(this.props.category, propertyRecord) : propertyRecord.property.name;
56
56
  return (React.createElement(PropertyRenderer, { key: key, uniqueKey: key, isHoverable: this.props.isPropertyHoverEnabled, isSelectable: this.props.isPropertySelectionEnabled, isSelected: key === this.props.selectedPropertyKey, propertyRecord: propertyRecord, orientation: this.props.orientation, onClick: propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyClicked : undefined, onRightClick: propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyRightClicked : undefined, onContextMenu: this.props.onPropertyContextMenu, columnRatio: this.props.columnRatio, onColumnRatioChanged: this.props.onColumnChanged, propertyValueRendererManager: this.props.propertyValueRendererManager, isEditing: key === this.props.editingPropertyKey, onEditCommit: this._onEditCommit, onEditCancel: this.props.onEditCancel, actionButtonRenderers: this.props.actionButtonRenderers, isResizeHandleHovered: this.props.isResizeHandleHovered, onResizeHandleHoverChanged: this.props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: this.props.isResizeHandleBeingDragged, onResizeHandleDragChanged: this.props.onResizeHandleDragChanged, columnInfo: this.props.columnInfo, width: this.props.width }));
@@ -1 +1 @@
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,CA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rE,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC,KAAK,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) ? \"components-property-list--horizontal\" : \"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
+ {"version":3,"file":"PropertyList.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyList.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,O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CAAC,CAAC,SAAS,EACtH,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,EAChI,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAC/C,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EACnC,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAChD,4BAA4B,EAAE,IAAI,CAAC,KAAK,CAAC,4BAA4B,EACrE,SAAS,EAAE,GAAG,KAAK,IAAI,CAAC,KAAK,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"]}
@@ -172,8 +172,8 @@ export const PropertyView = (props) => {
172
172
  };
173
173
  const getClassName = (viewProps) => {
174
174
  let propertyRecordClassName = viewProps.orientation === Orientation.Horizontal
175
- ? "components-property-record--horizontal"
176
- : "components-property-record--vertical";
175
+ ? "gmw-components-property-record--horizontal"
176
+ : "gmw-components-property-record--vertical";
177
177
  if (viewProps.isSelected) {
178
178
  propertyRecordClassName += " components--selected";
179
179
  }
@@ -192,15 +192,15 @@ export const PropertyView = (props) => {
192
192
  const columnsStyleProvider = new PropertyGridColumnStyleProvider(props.columnInfo);
193
193
  const offset = CommonPropertyRenderer.getLabelOffset(props.indentation, props.orientation, props.width, props.columnRatio, (_a = props.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
194
194
  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" },
195
- React.createElement("div", { className: "components-property-record-label" },
195
+ React.createElement("div", { className: "gmw-components-property-record-label" },
196
196
  props.propertyRecord.value.valueFormat ===
197
- PropertyValueFormat.Primitive && (React.createElement(Checkbox, { style: { marginLeft: offset }, className: "components-property-selection-checkbox", checked: isPropertySelected, onChange: _onPropertySelectionChanged, disabled: context.isLoading ||
197
+ PropertyValueFormat.Primitive && (React.createElement(Checkbox, { style: { marginLeft: offset }, className: "gmw-components-property-selection-checkbox", checked: isPropertySelected, onChange: _onPropertySelectionChanged, disabled: context.isLoading ||
198
198
  context.isRendering ||
199
199
  props.propertyRecord.value.value === undefined, isLoading: isCheckboxLoading })),
200
200
  props.labelElement),
201
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
202
  props.propertyRecord.value.valueFormat ===
203
- PropertyValueFormat.Primitive ? (React.createElement("div", { className: "components-property-record-value" },
203
+ PropertyValueFormat.Primitive ? (React.createElement("div", { className: "gmw-components-property-record-value" },
204
204
  React.createElement("span", null, props.valueElementRenderer
205
205
  ? props.valueElementRenderer()
206
206
  : props.valueElement))) : undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyView.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,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;AAE3D,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2FAA2F,CAAC;AAC5I,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AAgBtI;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;;IACvD,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,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 * as React 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\";\n\nimport \"./PropertyView.scss\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { GroupQueryBuilderContext } from \"../context/GroupQueryBuilderContext\";\nimport { useCallback } from \"react\";\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\";\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 context = React.useContext(GroupQueryBuilderContext);\n const [isCheckboxLoading, setIsCheckboxLoading] = React.useState(false);\n\n const _validatePropertySelection = () => {\n if (context.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 (!context.currentPropertyList.includes(prop)) {\n return false;\n }\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n if (!context.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] = React.useState<boolean>(false);\n const [isPropertySelected, setIsPropertySelected] = React.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 !context.currentPropertyList.includes(prop) &&\n prop.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n if (!(await context.queryBuilder.addProperty(prop))) {\n setIsCheckboxLoading(false);\n setIsPropertySelected(false);\n return;\n }\n context.setCurrentPropertyList(\n context.currentPropertyList.concat(prop)\n );\n context.setQuery(context.queryBuilder.buildQueryString());\n }\n },\n [context]\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 (context.currentPropertyList.includes(prop)) {\n context.setCurrentPropertyList(\n context.currentPropertyList.filter((x: PropertyRecord) => x !== prop)\n );\n await context.queryBuilder.removeProperty(prop);\n context.setQuery(context.queryBuilder.buildQueryString());\n }\n },\n [context]\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 React.useEffect(() => {\n if (!context.currentPropertyList.includes(props.propertyRecord)) {\n setIsPropertySelected(false);\n }\n }, [context.currentPropertyList, props.propertyRecord]);\n\n React.useEffect(() => {\n if (props?.propertyRecord) {\n if (isPropertySelected) {\n if (context.isRendering) {\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 context.isRendering,\n ]);\n\n React.useEffect(() => {\n if (!context.isRendering) {\n setIsCheckboxLoading(false);\n }\n }, [context.isRendering]);\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 ? \"components-property-record--horizontal\"\n : \"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=\"components-property-record-label\">\n {props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive && (\n <Checkbox\n style={{ marginLeft: offset }}\n className=\"components-property-selection-checkbox\"\n checked={isPropertySelected}\n onChange={_onPropertySelectionChanged}\n disabled={\n context.isLoading ||\n context.isRendering ||\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=\"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
+ {"version":3,"file":"PropertyView.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyView.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,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;AAE3D,OAAO,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,2FAA2F,CAAC;AAC5I,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AAgBtI;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;;IACvD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;IAC3D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExE,MAAM,0BAA0B,GAAG,GAAG,EAAE;QACtC,IAAI,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE;Y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ElD,SAAS,EAAE,iBAAiB,GAC5B,CACH;YACA,KAAK,CAAC,YAAY,CACf;QACL,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 * as React 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\";\n\nimport \"./PropertyView.scss\";\nimport type { SharedRendererProps } from \"./PropertyRender\";\nimport { GroupQueryBuilderContext } from \"../context/GroupQueryBuilderContext\";\nimport { useCallback } from \"react\";\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\";\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 context = React.useContext(GroupQueryBuilderContext);\n const [isCheckboxLoading, setIsCheckboxLoading] = React.useState(false);\n\n const _validatePropertySelection = () => {\n if (context.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 (!context.currentPropertyList.includes(prop)) {\n return false;\n }\n break;\n case PropertyValueFormat.Array:\n if (prop.value.items.length === 0) {\n if (!context.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] = React.useState<boolean>(false);\n const [isPropertySelected, setIsPropertySelected] = React.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 !context.currentPropertyList.includes(prop) &&\n prop.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n if (!(await context.queryBuilder.addProperty(prop))) {\n setIsCheckboxLoading(false);\n setIsPropertySelected(false);\n return;\n }\n context.setCurrentPropertyList(\n context.currentPropertyList.concat(prop)\n );\n context.setQuery(context.queryBuilder.buildQueryString());\n }\n },\n [context]\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 (context.currentPropertyList.includes(prop)) {\n context.setCurrentPropertyList(\n context.currentPropertyList.filter((x: PropertyRecord) => x !== prop)\n );\n await context.queryBuilder.removeProperty(prop);\n context.setQuery(context.queryBuilder.buildQueryString());\n }\n },\n [context]\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 React.useEffect(() => {\n if (!context.currentPropertyList.includes(props.propertyRecord)) {\n setIsPropertySelected(false);\n }\n }, [context.currentPropertyList, props.propertyRecord]);\n\n React.useEffect(() => {\n if (props?.propertyRecord) {\n if (isPropertySelected) {\n if (context.isRendering) {\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 context.isRendering,\n ]);\n\n React.useEffect(() => {\n if (!context.isRendering) {\n setIsCheckboxLoading(false);\n }\n }, [context.isRendering]);\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 context.isLoading ||\n context.isRendering ||\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"]}
@@ -9,17 +9,17 @@
9
9
  $text-font-size: $iui-font-size;
10
10
  $text-font-color: $buic-text-color;
11
11
 
12
- .components-property-record--horizontal {
12
+ .gmw-components-property-record--horizontal {
13
13
  height: 100%;
14
14
  display: grid;
15
15
  padding: 0 8px;
16
16
 
17
- .components-property-record-label {
17
+ .gmw-components-property-record-label {
18
18
  font-size: $iui-font-size-small;
19
19
  color: $buic-foreground-muted;
20
20
  }
21
21
 
22
- .components-property-record-value {
22
+ .gmw-components-property-record-value {
23
23
  min-height: 24px;
24
24
  font-size: $text-font-size;
25
25
  color: $text-font-color;
@@ -27,53 +27,45 @@ $text-font-color: $buic-text-color;
27
27
  }
28
28
  }
29
29
 
30
- .components-property-record--vertical {
30
+ .gmw-components-property-record--vertical {
31
31
  height: 100%;
32
32
  padding: 0 8px;
33
33
  display: grid;
34
34
  align-content: center;
35
35
 
36
- .components-property-record-label {
36
+ .gmw-components-property-record-label {
37
37
  font-size: $iui-font-size-small;
38
38
  color: $buic-foreground-muted;
39
39
  }
40
40
 
41
- .components-property-record-value {
41
+ .gmw-components-property-record-value {
42
42
  min-height: 22px;
43
43
  font-size: $text-font-size;
44
44
  color: $text-font-color;
45
45
  }
46
46
  }
47
47
 
48
- @mixin record-cell {
48
+ @mixin gmw-record-cell {
49
49
  display: flex;
50
50
  align-items: center;
51
51
  }
52
52
 
53
- .components-property-record-label {
54
- @include record-cell;
53
+ .gmw-components-property-record-label {
54
+ @include gmw-record-cell;
55
55
  position: relative;
56
- .components-property-selection-checkbox {
56
+ .gmw-components-property-selection-checkbox {
57
57
  flex-shrink: 0;
58
58
  position: absolute;
59
59
  z-index: 1;
60
60
  }
61
61
  // Radial does not respect checkbox positioning, have to force it.
62
- > .iui-progress-indicator-radial {
62
+ > .gmw-iui-progress-indicator-radial {
63
63
  position: absolute;
64
64
  }
65
- .components-property-selection-loading {
66
- display: flex;
67
- width: $iui-m;
68
- height: $iui-m;
69
- align-items: center;
70
- justify-content: center;
71
- flex-shrink: 0;
72
- }
73
65
  }
74
66
 
75
- .components-property-record-value {
76
- @include record-cell;
67
+ .gmw-components-property-record-value {
68
+ @include gmw-record-cell;
77
69
  overflow: hidden;
78
70
 
79
71
  span {
@@ -82,45 +74,4 @@ $text-font-color: $buic-text-color;
82
74
  text-overflow: ellipsis;
83
75
  width: 100%;
84
76
  }
85
-
86
- .core-underlined-button {
87
- // Offset by 2px, because value is centered vertically
88
- // and the button has an underline which offsets it's content,
89
- // which in turn makes it not in line with the rest of text
90
- margin-top: 2px;
91
- }
92
-
93
- .multiline {
94
- display: flex;
95
- align-items: baseline;
96
- }
97
-
98
- .expanded {
99
- white-space: pre-wrap;
100
- margin-top: 4px;
101
- margin-bottom: 4px;
102
-
103
- .expand-toggle {
104
- float: right;
105
- margin-top: 2px;
106
- }
107
- }
108
-
109
- .expand-toggle {
110
- padding: 0;
111
- white-space: nowrap;
112
- border: none;
113
- background: none;
114
- color: var(--buic-foreground-primary);
115
- font-size: 12px;
116
- cursor: pointer;
117
-
118
- &:hover {
119
- text-decoration: underline;
120
- }
121
-
122
- &:active {
123
- outline: none;
124
- }
125
- }
126
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/grouping-mapping-widget",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
5
5
  "keywords": [
6
6
  "Bentley",
@@ -1,13 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import "./GroupTile.scss";
3
- interface GroupTileProps {
4
- title: string;
5
- actionGroup: ReactNode;
6
- subText?: string;
7
- onClickTitle?: () => void;
8
- titleTooltip?: string;
9
- subtextToolTip?: string;
10
- }
11
- export declare const GroupTile: ({ title, subText, onClickTitle, titleTooltip, subtextToolTip, actionGroup }: GroupTileProps) => JSX.Element;
12
- export {};
13
- //# sourceMappingURL=GroupTile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupTile.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupTile.tsx"],"names":[],"mappings":";;;;;;AAKA,kDAA0B;AAC1B,wDAA4C;AAC5C,4BAA0B;AAWnB,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAkB,EAAE,EAAE;IAEvH,OAAO,CACL,uCAAK,SAAS,EAAC,0BAA0B,iBAAa,YAAY;QAChE,uCAAK,SAAS,EAAC,MAAM;YACnB,8BAAC,oBAAI,IAAC,SAAS,EAAE,aAAa,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,YAAY,IAAG,KAAK,CAAQ;YAC1I,OAAO,IAAI,8BAAC,oBAAI,IAAC,SAAS,EAAC,WAAW,EAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAC,OAAO,IAAE,OAAO,CAAQ,CAC1G;QACN,uCAAK,SAAS,EAAC,eAAe,iBAAa,oBAAoB,IAC5D,WAAW,CACR,CACF,CACP,CAAC;AAEJ,CAAC,CAAC;AAdW,QAAA,SAAS,aAcpB","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 type { ReactNode } from \"react\";\nimport React from \"react\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport \"./GroupTile.scss\";\n\ninterface GroupTileProps {\n title: string;\n actionGroup: ReactNode;\n subText?: string;\n onClickTitle?: () => void;\n titleTooltip?: string;\n subtextToolTip?: string;\n}\n\nexport const GroupTile = ({ title, subText, onClickTitle, titleTooltip, subtextToolTip, actionGroup }: GroupTileProps) => {\n\n return (\n <div className=\"gmw-group-tile-container\" data-testid=\"group-tile\">\n <div className=\"body\">\n <Text className={`body-text ${onClickTitle ? \"iui-anchor\" : \"\"}`} onClick={onClickTitle} variant=\"body\" title={titleTooltip}>{title}</Text>\n {subText && <Text className=\"body-text\" isMuted={true} title={subtextToolTip} variant=\"small\">{subText}</Text>}\n </div>\n <div className=\"action-button\" data-testid=\"tile-action-button\">\n {actionGroup}\n </div>\n </div>\n );\n\n};\n"]}
@@ -1,16 +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/colors';
6
-
7
- .components-nonprimitive-property {
8
- padding: 10px;
9
- display: grid;
10
- grid-row-gap: 10px;
11
-
12
- border-radius: 3px;
13
- border: solid 1px $uicore-gray-9;
14
-
15
- background-color: #fff;
16
- }
@@ -1,13 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import "./GroupTile.scss";
3
- interface GroupTileProps {
4
- title: string;
5
- actionGroup: ReactNode;
6
- subText?: string;
7
- onClickTitle?: () => void;
8
- titleTooltip?: string;
9
- subtextToolTip?: string;
10
- }
11
- export declare const GroupTile: ({ title, subText, onClickTitle, titleTooltip, subtextToolTip, actionGroup }: GroupTileProps) => JSX.Element;
12
- export {};
13
- //# sourceMappingURL=GroupTile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupTile.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupTile.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,kBAAkB,CAAC;AAW1B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAkB,EAAE,EAAE;IAEvH,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B,iBAAa,YAAY;QAChE,6BAAK,SAAS,EAAC,MAAM;YACnB,oBAAC,IAAI,IAAC,SAAS,EAAE,aAAa,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,EAAC,KAAK,EAAE,YAAY,IAAG,KAAK,CAAQ;YAC1I,OAAO,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAC,WAAW,EAAC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,OAAO,EAAC,OAAO,IAAE,OAAO,CAAQ,CAC1G;QACN,6BAAK,SAAS,EAAC,eAAe,iBAAa,oBAAoB,IAC5D,WAAW,CACR,CACF,CACP,CAAC;AAEJ,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 type { ReactNode } from \"react\";\nimport React from \"react\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport \"./GroupTile.scss\";\n\ninterface GroupTileProps {\n title: string;\n actionGroup: ReactNode;\n subText?: string;\n onClickTitle?: () => void;\n titleTooltip?: string;\n subtextToolTip?: string;\n}\n\nexport const GroupTile = ({ title, subText, onClickTitle, titleTooltip, subtextToolTip, actionGroup }: GroupTileProps) => {\n\n return (\n <div className=\"gmw-group-tile-container\" data-testid=\"group-tile\">\n <div className=\"body\">\n <Text className={`body-text ${onClickTitle ? \"iui-anchor\" : \"\"}`} onClick={onClickTitle} variant=\"body\" title={titleTooltip}>{title}</Text>\n {subText && <Text className=\"body-text\" isMuted={true} title={subtextToolTip} variant=\"small\">{subText}</Text>}\n </div>\n <div className=\"action-button\" data-testid=\"tile-action-button\">\n {actionGroup}\n </div>\n </div>\n );\n\n};\n"]}
@@ -1,16 +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/colors';
6
-
7
- .components-nonprimitive-property {
8
- padding: 10px;
9
- display: grid;
10
- grid-row-gap: 10px;
11
-
12
- border-radius: 3px;
13
- border: solid 1px $uicore-gray-9;
14
-
15
- background-color: #fff;
16
- }