@itwin/components-react 3.0.0-extension.1 → 3.0.2

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 (129) hide show
  1. package/CHANGELOG.md +148 -5
  2. package/LICENSE.md +1 -1
  3. package/lib/cjs/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
  4. package/lib/cjs/components-react/converters/DateTimeTypeConverter.js +3 -3
  5. package/lib/cjs/components-react/converters/DateTimeTypeConverter.js.map +1 -1
  6. package/lib/cjs/components-react/datepicker/DateField.js +1 -1
  7. package/lib/cjs/components-react/datepicker/DateField.js.map +1 -1
  8. package/lib/cjs/components-react/datepicker/TimeField.d.ts +1 -1
  9. package/lib/cjs/components-react/datepicker/TimeField.js +5 -5
  10. package/lib/cjs/components-react/datepicker/TimeField.js.map +1 -1
  11. package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts +2 -1
  12. package/lib/cjs/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
  13. package/lib/cjs/components-react/editors/CustomNumberEditor.js +20 -10
  14. package/lib/cjs/components-react/editors/CustomNumberEditor.js.map +1 -1
  15. package/lib/cjs/components-react/editors/EnumEditor.d.ts.map +1 -1
  16. package/lib/cjs/components-react/editors/EnumEditor.js +1 -2
  17. package/lib/cjs/components-react/editors/EnumEditor.js.map +1 -1
  18. package/lib/cjs/components-react/editors/IconEditor.d.ts.map +1 -1
  19. package/lib/cjs/components-react/editors/IconEditor.js +1 -0
  20. package/lib/cjs/components-react/editors/IconEditor.js.map +1 -1
  21. package/lib/cjs/components-react/editors/TextEditor.d.ts.map +1 -1
  22. package/lib/cjs/components-react/editors/TextEditor.js +1 -1
  23. package/lib/cjs/components-react/editors/TextEditor.js.map +1 -1
  24. package/lib/cjs/components-react/filtering/FilteringInput.d.ts.map +1 -1
  25. package/lib/cjs/components-react/filtering/FilteringInput.js +1 -1
  26. package/lib/cjs/components-react/filtering/FilteringInput.js.map +1 -1
  27. package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts +2 -2
  28. package/lib/cjs/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
  29. package/lib/cjs/components-react/iconpicker/IconPickerButton.js +3 -2
  30. package/lib/cjs/components-react/iconpicker/IconPickerButton.js.map +1 -1
  31. package/lib/cjs/components-react/inputs/ParsedInput.js +1 -1
  32. package/lib/cjs/components-react/inputs/ParsedInput.js.map +1 -1
  33. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
  34. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -1
  35. package/lib/cjs/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  36. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.scss +0 -3
  37. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
  38. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  39. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +0 -3
  40. package/lib/cjs/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
  41. package/lib/cjs/components-react/selectable-content/SelectableContent.js +11 -8
  42. package/lib/cjs/components-react/selectable-content/SelectableContent.js.map +1 -1
  43. package/lib/cjs/components-react/selectable-content/SelectableContent.scss +2 -1
  44. package/lib/cjs/components-react/table/component/Table.d.ts +3 -3
  45. package/lib/cjs/components-react/table/component/Table.d.ts.map +1 -1
  46. package/lib/cjs/components-react/table/component/Table.js +11 -12
  47. package/lib/cjs/components-react/table/component/Table.js.map +1 -1
  48. package/lib/cjs/components-react/toolbar/Overflow.d.ts.map +1 -1
  49. package/lib/cjs/components-react/toolbar/Overflow.js +3 -1
  50. package/lib/cjs/components-react/toolbar/Overflow.js.map +1 -1
  51. package/lib/cjs/components-react/toolbar/Overflow.scss +7 -0
  52. package/lib/cjs/components-react/toolbar/PopupItem.d.ts +4 -0
  53. package/lib/cjs/components-react/toolbar/PopupItem.d.ts.map +1 -1
  54. package/lib/cjs/components-react/toolbar/PopupItem.js +4 -2
  55. package/lib/cjs/components-react/toolbar/PopupItem.js.map +1 -1
  56. package/lib/cjs/components-react/toolbar/PopupItem.scss +13 -2
  57. package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
  58. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +16 -1
  59. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  60. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js +24 -5
  61. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  62. package/lib/cjs/components-react.d.ts +0 -8
  63. package/lib/cjs/components-react.d.ts.map +1 -1
  64. package/lib/cjs/components-react.js +0 -8
  65. package/lib/cjs/components-react.js.map +1 -1
  66. package/lib/esm/components-react/converters/DateTimeTypeConverter.d.ts.map +1 -1
  67. package/lib/esm/components-react/converters/DateTimeTypeConverter.js +1 -1
  68. package/lib/esm/components-react/converters/DateTimeTypeConverter.js.map +1 -1
  69. package/lib/esm/components-react/datepicker/DateField.js +1 -1
  70. package/lib/esm/components-react/datepicker/DateField.js.map +1 -1
  71. package/lib/esm/components-react/datepicker/TimeField.d.ts +1 -1
  72. package/lib/esm/components-react/datepicker/TimeField.js +5 -5
  73. package/lib/esm/components-react/datepicker/TimeField.js.map +1 -1
  74. package/lib/esm/components-react/editors/CustomNumberEditor.d.ts +2 -1
  75. package/lib/esm/components-react/editors/CustomNumberEditor.d.ts.map +1 -1
  76. package/lib/esm/components-react/editors/CustomNumberEditor.js +21 -11
  77. package/lib/esm/components-react/editors/CustomNumberEditor.js.map +1 -1
  78. package/lib/esm/components-react/editors/EnumEditor.d.ts.map +1 -1
  79. package/lib/esm/components-react/editors/EnumEditor.js +1 -2
  80. package/lib/esm/components-react/editors/EnumEditor.js.map +1 -1
  81. package/lib/esm/components-react/editors/IconEditor.d.ts.map +1 -1
  82. package/lib/esm/components-react/editors/IconEditor.js +1 -0
  83. package/lib/esm/components-react/editors/IconEditor.js.map +1 -1
  84. package/lib/esm/components-react/editors/TextEditor.d.ts.map +1 -1
  85. package/lib/esm/components-react/editors/TextEditor.js +1 -1
  86. package/lib/esm/components-react/editors/TextEditor.js.map +1 -1
  87. package/lib/esm/components-react/filtering/FilteringInput.d.ts.map +1 -1
  88. package/lib/esm/components-react/filtering/FilteringInput.js +1 -1
  89. package/lib/esm/components-react/filtering/FilteringInput.js.map +1 -1
  90. package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts +2 -2
  91. package/lib/esm/components-react/iconpicker/IconPickerButton.d.ts.map +1 -1
  92. package/lib/esm/components-react/iconpicker/IconPickerButton.js +3 -2
  93. package/lib/esm/components-react/iconpicker/IconPickerButton.js.map +1 -1
  94. package/lib/esm/components-react/inputs/ParsedInput.js +1 -1
  95. package/lib/esm/components-react/inputs/ParsedInput.js.map +1 -1
  96. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
  97. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js +1 -1
  98. package/lib/esm/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  99. package/lib/esm/components-react/propertygrid/component/PropertyGrid.scss +0 -3
  100. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
  101. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  102. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +0 -3
  103. package/lib/esm/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
  104. package/lib/esm/components-react/selectable-content/SelectableContent.js +11 -8
  105. package/lib/esm/components-react/selectable-content/SelectableContent.js.map +1 -1
  106. package/lib/esm/components-react/selectable-content/SelectableContent.scss +2 -1
  107. package/lib/esm/components-react/table/component/Table.d.ts +3 -3
  108. package/lib/esm/components-react/table/component/Table.d.ts.map +1 -1
  109. package/lib/esm/components-react/table/component/Table.js +12 -13
  110. package/lib/esm/components-react/table/component/Table.js.map +1 -1
  111. package/lib/esm/components-react/toolbar/Overflow.d.ts.map +1 -1
  112. package/lib/esm/components-react/toolbar/Overflow.js +4 -2
  113. package/lib/esm/components-react/toolbar/Overflow.js.map +1 -1
  114. package/lib/esm/components-react/toolbar/Overflow.scss +7 -0
  115. package/lib/esm/components-react/toolbar/PopupItem.d.ts +4 -0
  116. package/lib/esm/components-react/toolbar/PopupItem.d.ts.map +1 -1
  117. package/lib/esm/components-react/toolbar/PopupItem.js +5 -3
  118. package/lib/esm/components-react/toolbar/PopupItem.js.map +1 -1
  119. package/lib/esm/components-react/toolbar/PopupItem.scss +13 -2
  120. package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
  121. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +16 -1
  122. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  123. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js +22 -4
  124. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  125. package/lib/esm/components-react.d.ts +0 -8
  126. package/lib/esm/components-react.d.ts.map +1 -1
  127. package/lib/esm/components-react.js +0 -8
  128. package/lib/esm/components-react.js.map +1 -1
  129. package/package.json +20 -24
@@ -1 +1 @@
1
- {"version":3,"file":"IconPickerButton.js","sourceRoot":"","sources":["../../../../src/components-react/iconpicker/IconPickerButton.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mCAAiC;AACjC,4DAAoC;AACpC,6CAA+B;AAC/B,0DAAyD;AACzD,kDAAkE;AAYlE;;GAEG;AACH,uBAAuB;AACvB,MAAM,QAAS,SAAQ,KAAK,CAAC,aAA4B;IACvD,gBAAgB;IAChB,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,MAAM;QACJ,6DAA6D;QAC7D,OAAO,EAAE,IAAI,EAAE,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AAI,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO;gBAC9K,oBAAC,sBAAS,IAAC,SAAS,EAAC,0BAA0B,EAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAI;gBACxE,8BAAM,SAAS,EAAC,wBAAwB,GAAG,CACpC;YACT,oBAAC,kBAAK,IACJ,SAAS,EAAC,6BAA6B,EACvC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC5B,QAAQ,EAAE,iCAAgB,CAAC,UAAU,EACrC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,IAC3B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CACrC,CACP,CACJ,CAAC;IACJ,CAAC;;AAxEH,4CA0EC;AAvEC,gBAAgB;AACF,6BAAY,GAA6B;IACrD,UAAU,EAAE,CAAC;CACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module IconPicker\r\n */\r\n\r\nimport \"./IconPickerButton.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Popup, SvgSprite } from \"@itwin/core-react\";\r\n\r\n/** Properties for the [[IconItem]] React component\r\n * @alpha\r\n */\r\ninterface IconItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** icon specification */\r\n icon: string;\r\n /** function to run when user selects icon */\r\n onClick?: () => void;\r\n}\r\n\r\n/** IconItem Functional component\r\n * @alpha\r\n */\r\n// istanbul ignore next\r\nclass IconItem extends React.PureComponent<IconItemProps> {\r\n /** @internal */\r\n constructor(props: IconItemProps) {\r\n super(props);\r\n }\r\n\r\n public override render() {\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n onClick, icon, // do not pass on item specific props\r\n ...otherProps\r\n } = this.props;\r\n\r\n const handleClick = (_e: React.MouseEvent) => {\r\n if (onClick)\r\n onClick();\r\n };\r\n\r\n const classes = classnames(\"components-icon-swatch\", this.props.className);\r\n\r\n return (\r\n <button {...otherProps} className={classes} style={this.props.style} onClick={handleClick}>\r\n <SvgSprite src={this.props.icon} />\r\n </button>\r\n );\r\n }\r\n}\r\n\r\n/** Properties for the [[IconPicker]] React component\r\n * @alpha\r\n */\r\n// istanbul ignore next\r\nexport interface IconPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** active string */\r\n icon: string;\r\n /** available icons */\r\n icons: string[];\r\n /** function to run when user selects icon */\r\n onIconChange?: ((icon: string) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not */\r\n readonly?: boolean;\r\n /** Title to show at top of DropDown */\r\n dropDownTitle?: string;\r\n /** Number of columns */\r\n numColumns: number;\r\n}\r\n\r\n/** @internal */\r\ninterface IconPickerState {\r\n showPopup: boolean;\r\n icon: string;\r\n}\r\n\r\n/** IconPickerButton component\r\n * @alpha\r\n */\r\n// istanbul ignore next\r\nexport class IconPickerButton extends React.PureComponent<IconPickerProps, IconPickerState> {\r\n private _target = React.createRef<HTMLButtonElement>();\r\n\r\n /** @internal */\r\n public static defaultProps: Partial<IconPickerProps> = {\r\n numColumns: 4,\r\n };\r\n\r\n /** @internal */\r\n constructor(props: IconPickerProps) {\r\n super(props);\r\n\r\n this.state = { showPopup: false, icon: this.props.icon };\r\n }\r\n\r\n private _togglePopup = () => {\r\n if (this.props.readonly)\r\n return;\r\n\r\n this.setState((prevState) => ({ showPopup: !prevState.showPopup }));\r\n };\r\n\r\n private _closePopup = () => {\r\n this.setState({ showPopup: false });\r\n };\r\n\r\n private _handleIconPicked = (icon: string) => {\r\n this.setState(\r\n { showPopup: false, icon },\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onIconChange)\r\n this.props.onIconChange(icon);\r\n });\r\n };\r\n\r\n private renderPopup(title: string | undefined) {\r\n const containerStyle: React.CSSProperties = { gridTemplateColumns: `repeat(${this.props.numColumns}, 1fr)` };\r\n return (\r\n <div className=\"components-iconpicker-popup-container\">\r\n {title && <h4>{title}</h4>}\r\n <div data-testid=\"components-iconpicker-popup-icons\" className=\"components-iconpicker-popup-icons\" style={containerStyle}>\r\n {this.props.icons.map((icon: string, index: number) => <IconItem key={index} icon={icon} onClick={this._handleIconPicked.bind(this, icon)} />)}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n const buttonStyle = { ...this.props.style } as React.CSSProperties;\r\n const buttonClassNames = classnames(\"components-iconpicker-button\",\r\n this.props.readonly && \"readonly\",\r\n this.props.className,\r\n );\r\n\r\n return (\r\n <>\r\n <button data-testid=\"components-iconpicker-button\" onClick={this._togglePopup} className={buttonClassNames} style={buttonStyle} disabled={this.props.disabled} ref={this._target}>\r\n <SvgSprite className=\"iconpicker-button-sprite\" src={this.state.icon} />\r\n <span className=\"icon icon-chevron-down\" />\r\n </button>\r\n <Popup\r\n className=\"components-iconpicker-popup\"\r\n isOpen={this.state.showPopup}\r\n position={RelativePosition.BottomLeft}\r\n onClose={this._closePopup}\r\n target={this._target.current}>\r\n {this.renderPopup(this.props.dropDownTitle)}\r\n </Popup>\r\n </>\r\n );\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"IconPickerButton.js","sourceRoot":"","sources":["../../../../src/components-react/iconpicker/IconPickerButton.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,mCAAiC;AACjC,4DAAoC;AACpC,6CAA+B;AAC/B,0DAAyD;AACzD,kDAAkE;AAYlE;;GAEG;AACH,uBAAuB;AACvB,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C,IAAI,CAAC,KAAK,CAAC,SAAS,CACrB,CAAC;QAEF,OAAO,CACL;YACE,+CAAoB,8BAA8B,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,OAAO;gBAC9K,oBAAC,sBAAS,IAAC,SAAS,EAAC,0BAA0B,EAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAI;gBACxE,8BAAM,SAAS,EAAC,wBAAwB,GAAG,CACpC;YACT,oBAAC,kBAAK,IACJ,SAAS,EAAC,6BAA6B,EACvC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAC5B,QAAQ,EAAE,iCAAgB,CAAC,UAAU,EACrC,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,IAC3B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CACrC,CACP,CACJ,CAAC;IACJ,CAAC;;AAxEH,4CA0EC;AAvEC,gBAAgB;AACF,6BAAY,GAA6B;IACrD,UAAU,EAAE,CAAC;CACd,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module IconPicker\r\n */\r\n\r\nimport \"./IconPickerButton.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { RelativePosition } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Popup, SvgSprite } from \"@itwin/core-react\";\r\n\r\n/** Properties for the [[IconItem]] React component\r\n * @alpha @deprecated\r\n */\r\ninterface IconItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** icon specification */\r\n icon: string;\r\n /** function to run when user selects icon */\r\n onClick?: () => void;\r\n}\r\n\r\n/** IconItem Functional component\r\n * @alpha @deprecated\r\n */\r\n// istanbul ignore next\r\nclass IconItem extends React.PureComponent<IconItemProps> {\r\n /** @internal */\r\n constructor(props: IconItemProps) {\r\n super(props);\r\n }\r\n\r\n public override render() {\r\n const {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n onClick, icon, // do not pass on item specific props\r\n ...otherProps\r\n } = this.props;\r\n\r\n const handleClick = (_e: React.MouseEvent) => {\r\n if (onClick)\r\n onClick();\r\n };\r\n\r\n const classes = classnames(\"components-icon-swatch\", this.props.className);\r\n\r\n return (\r\n <button {...otherProps} className={classes} style={this.props.style} onClick={handleClick}>\r\n <SvgSprite src={this.props.icon} />\r\n </button>\r\n );\r\n }\r\n}\r\n\r\n/** Properties for the [[IconPicker]] React component\r\n * @alpha @deprecated\r\n */\r\n// istanbul ignore next\r\nexport interface IconPickerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, CommonProps {\r\n /** active string */\r\n icon: string;\r\n /** available icons */\r\n icons: string[];\r\n /** function to run when user selects icon */\r\n onIconChange?: ((icon: string) => void) | undefined;\r\n /** Disabled or not */\r\n disabled?: boolean;\r\n /** Readonly or not */\r\n readonly?: boolean;\r\n /** Title to show at top of DropDown */\r\n dropDownTitle?: string;\r\n /** Number of columns */\r\n numColumns: number;\r\n}\r\n\r\n/** @internal */\r\ninterface IconPickerState {\r\n showPopup: boolean;\r\n icon: string;\r\n}\r\n\r\n/** IconPickerButton component\r\n * @alpha @deprecated\r\n */\r\n// istanbul ignore next\r\nexport class IconPickerButton extends React.PureComponent<IconPickerProps, IconPickerState> {\r\n private _target = React.createRef<HTMLButtonElement>();\r\n\r\n /** @internal */\r\n public static defaultProps: Partial<IconPickerProps> = {\r\n numColumns: 4,\r\n };\r\n\r\n /** @internal */\r\n constructor(props: IconPickerProps) {\r\n super(props);\r\n\r\n this.state = { showPopup: false, icon: this.props.icon };\r\n }\r\n\r\n private _togglePopup = () => {\r\n if (this.props.readonly)\r\n return;\r\n\r\n this.setState((prevState) => ({ showPopup: !prevState.showPopup }));\r\n };\r\n\r\n private _closePopup = () => {\r\n this.setState({ showPopup: false });\r\n };\r\n\r\n private _handleIconPicked = (icon: string) => {\r\n this.setState(\r\n { showPopup: false, icon },\r\n () => {\r\n // istanbul ignore else\r\n if (this.props.onIconChange)\r\n this.props.onIconChange(icon);\r\n });\r\n };\r\n\r\n private renderPopup(title: string | undefined) {\r\n const containerStyle: React.CSSProperties = { gridTemplateColumns: `repeat(${this.props.numColumns}, 1fr)` };\r\n return (\r\n <div className=\"components-iconpicker-popup-container\">\r\n {title && <h4>{title}</h4>}\r\n <div data-testid=\"components-iconpicker-popup-icons\" className=\"components-iconpicker-popup-icons\" style={containerStyle}>\r\n {this.props.icons.map((icon: string, index: number) => <IconItem key={index} icon={icon} onClick={this._handleIconPicked.bind(this, icon)} />)}\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n const buttonStyle = { ...this.props.style } as React.CSSProperties;\r\n const buttonClassNames = classnames(\"components-iconpicker-button\",\r\n this.props.readonly && \"readonly\",\r\n this.props.className,\r\n );\r\n\r\n return (\r\n <>\r\n <button data-testid=\"components-iconpicker-button\" onClick={this._togglePopup} className={buttonClassNames} style={buttonStyle} disabled={this.props.disabled} ref={this._target}>\r\n <SvgSprite className=\"iconpicker-button-sprite\" src={this.state.icon} />\r\n <span className=\"icon icon-chevron-down\" />\r\n </button>\r\n <Popup\r\n className=\"components-iconpicker-popup\"\r\n isOpen={this.state.showPopup}\r\n position={RelativePosition.BottomLeft}\r\n onClose={this._closePopup}\r\n target={this._target.current}>\r\n {this.renderPopup(this.props.dropDownTitle)}\r\n </Popup>\r\n </>\r\n );\r\n }\r\n\r\n}\r\n"]}
@@ -102,7 +102,7 @@ const ForwardRefParsedInput = React.forwardRef(function ForwardRefParsedInput({
102
102
  }
103
103
  }, [formatValue, updateValueFromString]);
104
104
  const classNames = (0, classnames_1.default)(className, "components-parsed-input", hasBadInput && "components-parsed-input-has-error");
105
- return React.createElement(itwinui_react_1.Input, { "data-testid": "components-parsed-input", ref: ref, style: style, className: classNames, onKeyDown: handleKeyDown, onBlur: handleBlur, onChange: handleChange, value: formattedValue, disabled: readonly });
105
+ return React.createElement(itwinui_react_1.Input, { "data-testid": "components-parsed-input", ref: ref, style: style, className: classNames, onKeyDown: handleKeyDown, onBlur: handleBlur, onChange: handleChange, value: formattedValue, disabled: readonly, size: "small" });
106
106
  });
107
107
  /** Generic Input component that requires formatting and parsing functions to be passed in as props.
108
108
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"ParsedInput.js","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,4DAAoC;AACpC,wDAA6C;AAE7C,0DAAiE;AACjE,8BAA4B;AAoB5B,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,SAAS,qBAAqB,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG;IAClH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,qBAAqB,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC;IACtE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAChG,MAAM,CAAC,WA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IACH,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEzC,MAAM,UAAU,GAAG,IAAA,oBAAU,EAAC,SAAS,EAAE,yBAAyB,EAAE,WAAW,IAAI,mCAAmC,CAAC,CAAC;IAExH,OAAO,oBAAC,qBAAK,mBAAa,yBAAyB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAC7I,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AAC1E,CAAC,CACF,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAAoD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Inputs\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { ParseResults, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport \"./ParsedInput.scss\";\r\n\r\n/** Props for [[ParsedInput]] control\r\n * @public\r\n */\r\nexport interface ParsedInputProps extends CommonProps {\r\n /** InitialValue which is used to restore input field if ESC is pressed */\r\n initialValue: number;\r\n /** Function used to format the value */\r\n formatValue: (value: number) => string;\r\n /** Function used to parse user input into a value */\r\n parseString: (stringValue: string) => ParseResults;\r\n /** Function to call when value is changed */\r\n onChange?: (newValue: number) => void;\r\n /** if readonly then only the formatValue function is used. */\r\n readonly?: boolean;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\nconst ForwardRefParsedInput = React.forwardRef<HTMLInputElement, ParsedInputProps>(\r\n function ForwardRefParsedInput({ initialValue, formatValue, parseString, readonly, className, style, onChange }, ref) {\r\n const currentValueRef = React.useRef(initialValue);\r\n const isMountedRef = React.useRef(false);\r\n const lastFormattedValueRef = React.useRef(formatValue(initialValue));\r\n const [formattedValue, setFormattedValue] = React.useState(() => lastFormattedValueRef.current);\r\n const [hasBadInput, setHasBadInput] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n return () => {\r\n isMountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n // See if new initialValue props have changed since component mounted\r\n React.useEffect(() => {\r\n currentValueRef.current = initialValue;\r\n const currentFormattedValue = formatValue(currentValueRef.current);\r\n if (currentFormattedValue !== lastFormattedValueRef.current) {\r\n lastFormattedValueRef.current = currentFormattedValue;\r\n setFormattedValue(lastFormattedValueRef.current);\r\n setHasBadInput(false);\r\n }\r\n }, [formatValue, initialValue]);\r\n\r\n const handleChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setFormattedValue(event.currentTarget.value);\r\n }, []);\r\n\r\n const updateValueFromString = React.useCallback((strVal: string) => {\r\n if (lastFormattedValueRef.current === strVal)\r\n return;\r\n\r\n const parseResults = (parseString(strVal));\r\n // istanbul ignore else\r\n if (!parseResults.parseError) {\r\n // istanbul ignore else\r\n if (undefined !== parseResults.value && typeof parseResults.value === \"number\") {\r\n const currentValue = parseResults.value;\r\n // istanbul ignore else\r\n if (currentValue !== currentValueRef.current) {\r\n currentValueRef.current = currentValue;\r\n onChange && onChange(currentValueRef.current);\r\n }\r\n // istanbul ignore else\r\n if (isMountedRef.current) {\r\n lastFormattedValueRef.current = formatValue(currentValue);\r\n setFormattedValue(lastFormattedValueRef.current);\r\n setHasBadInput(false);\r\n }\r\n }\r\n } else {\r\n setHasBadInput(true);\r\n }\r\n }, [formatValue, onChange, parseString]);\r\n\r\n const handleBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n updateValueFromString(event.target.value);\r\n }, [updateValueFromString]);\r\n\r\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.Enter) {\r\n updateValueFromString(event.currentTarget.value);\r\n event.preventDefault();\r\n }\r\n if (event.key === SpecialKey.Escape) {\r\n setFormattedValue(formatValue(currentValueRef.current));\r\n setHasBadInput(false);\r\n event.preventDefault();\r\n }\r\n }, [formatValue, updateValueFromString]);\r\n\r\n const classNames = classnames(className, \"components-parsed-input\", hasBadInput && \"components-parsed-input-has-error\");\r\n\r\n return <Input data-testid=\"components-parsed-input\" ref={ref} style={style} className={classNames} onKeyDown={handleKeyDown} onBlur={handleBlur}\r\n onChange={handleChange} value={formattedValue} disabled={readonly} />;\r\n }\r\n);\r\n\r\n/** Generic Input component that requires formatting and parsing functions to be passed in as props.\r\n * @public\r\n */\r\nexport const ParsedInput: (props: ParsedInputProps) => JSX.Element | null = ForwardRefParsedInput;\r\n\r\n"]}
1
+ {"version":3,"file":"ParsedInput.js","sourceRoot":"","sources":["../../../../src/components-react/inputs/ParsedInput.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,4DAAoC;AACpC,wDAA6C;AAE7C,0DAAiE;AACjE,8BAA4B;AAoB5B,MAAM,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAC5C,SAAS,qBAAqB,CAAC,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG;IAClH,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,qBAAqB,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,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EAAE;YACnC,iBAAiB,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;YACxD,cAAc,CAAC,KAAK,CAAC,CAAC;YACtB,KAAK,CAAC,cAAc,EAAE,CAAC;SACxB;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEzC,MAAM,UAAU,GAAG,IAAA,oBAAU,EAAC,SAAS,EAAE,yBAAyB,EAAE,WAAW,IAAI,mCAAmC,CAAC,CAAC;IAExH,OAAO,oBAAC,qBAAK,mBAAa,yBAAyB,EAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAC7I,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,GAAG,CAAC;AACvF,CAAC,CACF,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAAoD,qBAAqB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Inputs\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { Input } from \"@itwin/itwinui-react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { ParseResults, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport \"./ParsedInput.scss\";\r\n\r\n/** Props for [[ParsedInput]] control\r\n * @public\r\n */\r\nexport interface ParsedInputProps extends CommonProps {\r\n /** InitialValue which is used to restore input field if ESC is pressed */\r\n initialValue: number;\r\n /** Function used to format the value */\r\n formatValue: (value: number) => string;\r\n /** Function used to parse user input into a value */\r\n parseString: (stringValue: string) => ParseResults;\r\n /** Function to call when value is changed */\r\n onChange?: (newValue: number) => void;\r\n /** if readonly then only the formatValue function is used. */\r\n readonly?: boolean;\r\n /** Provides ability to return reference to HTMLInputElement */\r\n ref?: React.Ref<HTMLInputElement>;\r\n}\r\n\r\nconst ForwardRefParsedInput = React.forwardRef<HTMLInputElement, ParsedInputProps>(\r\n function ForwardRefParsedInput({ initialValue, formatValue, parseString, readonly, className, style, onChange }, ref) {\r\n const currentValueRef = React.useRef(initialValue);\r\n const isMountedRef = React.useRef(false);\r\n const lastFormattedValueRef = React.useRef(formatValue(initialValue));\r\n const [formattedValue, setFormattedValue] = React.useState(() => lastFormattedValueRef.current);\r\n const [hasBadInput, setHasBadInput] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n isMountedRef.current = true;\r\n return () => {\r\n isMountedRef.current = false;\r\n };\r\n }, []);\r\n\r\n // See if new initialValue props have changed since component mounted\r\n React.useEffect(() => {\r\n currentValueRef.current = initialValue;\r\n const currentFormattedValue = formatValue(currentValueRef.current);\r\n if (currentFormattedValue !== lastFormattedValueRef.current) {\r\n lastFormattedValueRef.current = currentFormattedValue;\r\n setFormattedValue(lastFormattedValueRef.current);\r\n setHasBadInput(false);\r\n }\r\n }, [formatValue, initialValue]);\r\n\r\n const handleChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setFormattedValue(event.currentTarget.value);\r\n }, []);\r\n\r\n const updateValueFromString = React.useCallback((strVal: string) => {\r\n if (lastFormattedValueRef.current === strVal)\r\n return;\r\n\r\n const parseResults = (parseString(strVal));\r\n // istanbul ignore else\r\n if (!parseResults.parseError) {\r\n // istanbul ignore else\r\n if (undefined !== parseResults.value && typeof parseResults.value === \"number\") {\r\n const currentValue = parseResults.value;\r\n // istanbul ignore else\r\n if (currentValue !== currentValueRef.current) {\r\n currentValueRef.current = currentValue;\r\n onChange && onChange(currentValueRef.current);\r\n }\r\n // istanbul ignore else\r\n if (isMountedRef.current) {\r\n lastFormattedValueRef.current = formatValue(currentValue);\r\n setFormattedValue(lastFormattedValueRef.current);\r\n setHasBadInput(false);\r\n }\r\n }\r\n } else {\r\n setHasBadInput(true);\r\n }\r\n }, [formatValue, onChange, parseString]);\r\n\r\n const handleBlur = React.useCallback((event: React.FocusEvent<HTMLInputElement>) => {\r\n updateValueFromString(event.target.value);\r\n }, [updateValueFromString]);\r\n\r\n const handleKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n // istanbul ignore else\r\n if (event.key === SpecialKey.Enter) {\r\n updateValueFromString(event.currentTarget.value);\r\n event.preventDefault();\r\n }\r\n if (event.key === SpecialKey.Escape) {\r\n setFormattedValue(formatValue(currentValueRef.current));\r\n setHasBadInput(false);\r\n event.preventDefault();\r\n }\r\n }, [formatValue, updateValueFromString]);\r\n\r\n const classNames = classnames(className, \"components-parsed-input\", hasBadInput && \"components-parsed-input-has-error\");\r\n\r\n return <Input data-testid=\"components-parsed-input\" ref={ref} style={style} className={classNames} onKeyDown={handleKeyDown} onBlur={handleBlur}\r\n onChange={handleChange} value={formattedValue} disabled={readonly} size=\"small\" />;\r\n }\r\n);\r\n\r\n/** Generic Input component that requires formatting and parsing functions to be passed in as props.\r\n * @public\r\n */\r\nexport const ParsedInput: (props: ParsedInputProps) => JSX.Element | null = ForwardRefParsedInput;\r\n\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryBlock.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,iCAAiC;IACjC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,uCAAuC;IACvC,SAAS,CAAC,EAAE,0BAA0B,CAAC;CACxC;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAS,CAAC,0BAA0B,CAAC;gBACxE,KAAK,EAAE,0BAA0B;IAI7C,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,aAAa,CAEnB;IAEF,gBAAgB;IACA,MAAM;CAkBvB"}
1
+ {"version":3,"file":"PropertyCategoryBlock.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,iCAAiC;IACjC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,uCAAuC;IACvC,SAAS,CAAC,EAAE,0BAA0B,CAAC;CACxC;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAS,CAAC,0BAA0B,CAAC;gBACxE,KAAK,EAAE,0BAA0B;IAI7C,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,aAAa,CAEnB;IAEF,gBAAgB;IACA,MAAM;CAmBvB"}
@@ -54,7 +54,7 @@ class PropertyCategoryBlock extends React.Component {
54
54
  const label = highlight ?
55
55
  (React.createElement(HighlightedText_1.HighlightedText, { text: category.label, activeMatchIndex: activeMatchIndex, searchText: highlight.highlightedText })) :
56
56
  category.label;
57
- return (React.createElement(itwinui_react_1.ExpandableBlock, { isExpanded: category.expand, onToggle: this._handleToggle, title: label, ...props }, category.expand && children));
57
+ return (React.createElement(itwinui_react_1.ExpandableBlock, { isExpanded: category.expand, onToggle: this._handleToggle, title: label, size: "small", ...props }, category.expand && children));
58
58
  }
59
59
  }
60
60
  exports.PropertyCategoryBlock = PropertyCategoryBlock;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryBlock.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAuD;AACvD,kEAA+D;AAiB/D;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IACpF,YAAY,KAAiC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QAQP,kBAAa,GAAG,CAAC,YAAqB,EAAQ,EAAE;YACtD,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;IATF,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC/B,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAMD,gBAAgB;IACA,MAAM;;QACpB,6DAA6D;QAC7D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACnF,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,MAAK,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,0CAAE,yBAAyB,CAAA,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;QACnK,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC;YACvB,CAAC,oBAAC,iCAAe,IAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC,eAAe,GAAI,CAAC,CAAC,CAAC;YACxH,QAAQ,CAAC,KAAK,CAAC;QACjB,OAAO,CACL,oBAAC,+BAAe,IACd,UAAU,EAAE,QAAQ,CAAC,MAAM,EAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,KAAK,EAAE,KAAK,KACR,KAAK,IAER,QAAQ,CAAC,MAAM,IAAI,QAAQ,CACZ,CACnB,CAAC;IACJ,CAAC;CACF;AAjCD,sDAiCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { ExpandableBlock } from \"@itwin/itwinui-react\";\r\nimport { HighlightedText } from \"../../common/HighlightedText\";\r\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\r\nimport { PropertyCategory } from \"../PropertyDataProvider\";\r\n\r\n/**\r\n * Properties for the [[PropertyCategoryBlock]] React component\r\n * @public\r\n */\r\nexport interface PropertyCategoryBlockProps extends CommonProps {\r\n /** Category of the properties */\r\n category: PropertyCategory;\r\n /** Callback to when PropertyCategoryBlock gets expended or collapsed */\r\n onExpansionToggled?: (categoryName: string) => void;\r\n /** Properties used for highlighting */\r\n highlight?: HighlightingComponentProps;\r\n}\r\n\r\n/**\r\n * PropertyCategoryBlock React component\r\n * @public\r\n */\r\nexport class PropertyCategoryBlock extends React.Component<PropertyCategoryBlockProps> {\r\n constructor(props: PropertyCategoryBlockProps) {\r\n super(props);\r\n }\r\n\r\n private toggleExpansion() {\r\n if (this.props.onExpansionToggled)\r\n this.props.onExpansionToggled(this.props.category.name);\r\n }\r\n\r\n private _handleToggle = (_isExpanding: boolean): void => {\r\n this.toggleExpansion();\r\n };\r\n\r\n /** @internal */\r\n public override render() {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { highlight, category, children, onExpansionToggled, ...props } = this.props;\r\n const activeMatchIndex = this.props.category.name === highlight?.activeHighlight?.highlightedItemIdentifier ? highlight.activeHighlight.highlightIndex : undefined;\r\n const label = highlight ?\r\n (<HighlightedText text={category.label} activeMatchIndex={activeMatchIndex} searchText={highlight.highlightedText} />) :\r\n category.label;\r\n return (\r\n <ExpandableBlock\r\n isExpanded={category.expand}\r\n onToggle={this._handleToggle}\r\n title={label}\r\n {...props}\r\n >\r\n {category.expand && children}\r\n </ExpandableBlock>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PropertyCategoryBlock.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyCategoryBlock.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAE/B,wDAAuD;AACvD,kEAA+D;AAiB/D;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,KAAK,CAAC,SAAqC;IACpF,YAAY,KAAiC;QAC3C,KAAK,CAAC,KAAK,CAAC,CAAC;QAQP,kBAAa,GAAG,CAAC,YAAqB,EAAQ,EAAE;YACtD,IAAI,CAAC,eAAe,EAAE,CAAC;QACzB,CAAC,CAAC;IATF,CAAC;IAEO,eAAe;QACrB,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB;YAC/B,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAMD,gBAAgB;IACA,MAAM;;QACpB,6DAA6D;QAC7D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACnF,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,MAAK,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,eAAe,0CAAE,yBAAyB,CAAA,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC;QACnK,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC;YACvB,CAAC,oBAAC,iCAAe,IAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC,eAAe,GAAI,CAAC,CAAC,CAAC;YACxH,QAAQ,CAAC,KAAK,CAAC;QACjB,OAAO,CACL,oBAAC,+BAAe,IACd,UAAU,EAAE,QAAQ,CAAC,MAAM,EAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAC,OAAO,KACR,KAAK,IAER,QAAQ,CAAC,MAAM,IAAI,QAAQ,CACZ,CACnB,CAAC;IACJ,CAAC;CACF;AAlCD,sDAkCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { ExpandableBlock } from \"@itwin/itwinui-react\";\r\nimport { HighlightedText } from \"../../common/HighlightedText\";\r\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\r\nimport { PropertyCategory } from \"../PropertyDataProvider\";\r\n\r\n/**\r\n * Properties for the [[PropertyCategoryBlock]] React component\r\n * @public\r\n */\r\nexport interface PropertyCategoryBlockProps extends CommonProps {\r\n /** Category of the properties */\r\n category: PropertyCategory;\r\n /** Callback to when PropertyCategoryBlock gets expended or collapsed */\r\n onExpansionToggled?: (categoryName: string) => void;\r\n /** Properties used for highlighting */\r\n highlight?: HighlightingComponentProps;\r\n}\r\n\r\n/**\r\n * PropertyCategoryBlock React component\r\n * @public\r\n */\r\nexport class PropertyCategoryBlock extends React.Component<PropertyCategoryBlockProps> {\r\n constructor(props: PropertyCategoryBlockProps) {\r\n super(props);\r\n }\r\n\r\n private toggleExpansion() {\r\n if (this.props.onExpansionToggled)\r\n this.props.onExpansionToggled(this.props.category.name);\r\n }\r\n\r\n private _handleToggle = (_isExpanding: boolean): void => {\r\n this.toggleExpansion();\r\n };\r\n\r\n /** @internal */\r\n public override render() {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { highlight, category, children, onExpansionToggled, ...props } = this.props;\r\n const activeMatchIndex = this.props.category.name === highlight?.activeHighlight?.highlightedItemIdentifier ? highlight.activeHighlight.highlightIndex : undefined;\r\n const label = highlight ?\r\n (<HighlightedText text={category.label} activeMatchIndex={activeMatchIndex} searchText={highlight.highlightedText} />) :\r\n category.label;\r\n return (\r\n <ExpandableBlock\r\n isExpanded={category.expand}\r\n onToggle={this._handleToggle}\r\n title={label}\r\n size=\"small\"\r\n {...props}\r\n >\r\n {category.expand && children}\r\n </ExpandableBlock>\r\n );\r\n }\r\n}\r\n"]}
@@ -4,7 +4,6 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/expandable/list";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/scrollbar";
7
- @import "~@itwin/core-react/lib/cjs/core-react/style/itwinui-overrides";
8
7
 
9
8
  .components-property-grid-loader {
10
9
  position: relative;
@@ -28,8 +27,6 @@
28
27
 
29
28
  user-select: none;
30
29
  color: $buic-foreground-body;
31
-
32
- @include small-itwinui-expandable-block;
33
30
  }
34
31
 
35
32
  .components-property-grid-wrapper {
@@ -146,7 +146,7 @@ class VirtualizedPropertyGrid extends React.Component {
146
146
  * @returns current height of node.
147
147
  */
148
148
  calculateNodeHeight(node) {
149
- const categoryHeaderHeight = 34;
149
+ const categoryHeaderHeight = 35;
150
150
  const categoryHeaderPadding = 4;
151
151
  const categoryPropertyHeight = 27;
152
152
  const bottomBorderPadding = 5;
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedPropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AACH,0CAAwC;AACxC,4DAAoC;AACpC,6CAA+B;AAC/B,+CAAmF;AACnF,sDAA6C;AAE7C,kDAAmE;AAEnE,kGAAkG;AAKlG,kGAAmF;AAEnF,oHAAiH;AACjH,gGAA6F;AAC7F,oFAA8E;AAC9E,oFAAiF;AACjF,2FAAwF;AAGxF,wFAAoH;AAEpH,uGAAoG;AACpG,+EAA4E;AAC5E,mEAAgE;AAChE,+DAAqF;AACrF,qGAAkG;AAsFlG,MAAM,CACJ,mCAAmC,EACnC,oCAAoC,EACpC,8BAA8B,EAC/B,GAAG,IAAA,oEAAkC,EAA8B,6BAA6B,CAAC,CAAC;AAEnG;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,KAAK,CAAC,SAAqE;IAGtH,gBAAgB;IAChB,YAAY,KAAmC;;QAC7C,KAAK,CAAC,KAAK,CAAC,CAAC;QAJP,aAAQ,GAAG,KAAK,CAAC,SAAS,EAAoB,CAAC;QA6G/C,4BAAuB,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,SAAiB,EAAE,EAAE;YAClF,IAAI,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,SAAS,EAA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CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,CACjD,CAAC;IAEF,OAAO,CACL,6BAAK,GAAG,EAAE,MAAM,IACb,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CACvC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./VirtualizedPropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { areEqual, ListChildComponentProps, VariableSizeList } from \"react-window\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, RatioChangeResult } from \"@itwin/core-react\";\r\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\r\nimport { createContextWithMandatoryProvider } from \"../../common/UseContextWithMandatoryProvider\";\r\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\r\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\r\nimport { PropertyGridColumnInfo } from \"../../properties/renderers/PropertyGridColumns\";\r\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\r\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\r\nimport { FlatGridItem, GridCategoryItem } from \"../internal/flat-items/FlatGridItem\";\r\nimport { MutableCategorizedPrimitiveProperty } from \"../internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nimport { MutableCustomGridCategory } from \"../internal/flat-items/MutableCustomGridCategory\";\r\nimport { FlatGridItemType } from \"../internal/flat-items/MutableFlatGridItem\";\r\nimport { MutableGridCategory } from \"../internal/flat-items/MutableGridCategory\";\r\nimport { FlatPropertyRenderer } from \"../internal/flat-properties/FlatPropertyRenderer\";\r\nimport { IPropertyGridEventHandler } from \"../internal/PropertyGridEventHandler\";\r\nimport { IPropertyGridModel } from \"../internal/PropertyGridModel\";\r\nimport { PropertyCategoryRendererManager, PropertyCategoryRendererProps } from \"../PropertyCategoryRendererManager\";\r\nimport { IPropertyDataProvider, PropertyCategory } from \"../PropertyDataProvider\";\r\nimport { ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { FlatItemNestedBorderWrapper } from \"./FlatItemNestedBorderWrapper\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\n\r\n/** Properties for [[VirtualizedPropertyGrid]] React component\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {\r\n model: IPropertyGridModel;\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n width: number;\r\n height: number;\r\n}\r\n\r\n/** State of [[VirtualizedPropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface VirtualizedPropertyGridState {\r\n /** List of PropertyGrid categories */\r\n gridItems: FlatGridItem[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** Keeps record of dynamic node heights */\r\n dynamicNodeHeights: Map<string, number>;\r\n /** When resetting node height cache, marks the point at which heights have become stale */\r\n resetIndex: number;\r\n}\r\n\r\n/**\r\n * Context of [[VirtualizedPropertyGrid]] component.\r\n * @internal\r\n */\r\nexport interface PropertyGridInternalContext {\r\n gridItems: FlatGridItem[];\r\n gridEventHandler: IPropertyGridEventHandler;\r\n gridModel: IPropertyGridModel;\r\n\r\n style?: React.CSSProperties;\r\n className?: string;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onItemHeightChanged: (index: number, key: string, height: number) => void;\r\n}\r\n\r\n/**\r\n * Context of the surrounding [VirtualizedPropertyGrid]($components-react) component.\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridContext {\r\n orientation: Orientation;\r\n gridWidth: number;\r\n\r\n isPropertyHoverEnabled: boolean;\r\n isPropertySelectionEnabled: boolean;\r\n selectedPropertyKey?: string;\r\n\r\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\r\n\r\n editingPropertyKey?: string;\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n onEditCancel?: () => void;\r\n\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n\r\n actionButtonRenderers?: ActionButtonRenderer[];\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n\r\n columnRatio: number;\r\n columnInfo: PropertyGridColumnInfo;\r\n isResizeHandleBeingDragged: boolean;\r\n isResizeHandleHovered: boolean;\r\n onColumnRatioChanged: (ratio: number) => void | RatioChangeResult;\r\n onResizeHandleDragChanged: (newValue: boolean) => void;\r\n onResizeHandleHoverChanged: (newValue: boolean) => void;\r\n\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n}\r\n\r\nconst [\r\n PropertyGridInternalContextProvider,\r\n _PropertyGridInternalContextConsumer,\r\n usePropertyGridInternalContext,\r\n] = createContextWithMandatoryProvider<PropertyGridInternalContext>(\"PropertyGridInternalContext\");\r\n\r\n/**\r\n * VirtualizedPropertyGrid React component.\r\n * @beta\r\n */\r\nexport class VirtualizedPropertyGrid extends React.Component<VirtualizedPropertyGridProps, VirtualizedPropertyGridState> {\r\n private _listRef = React.createRef<VariableSizeList>();\r\n\r\n /** @internal */\r\n constructor(props: VirtualizedPropertyGridProps) {\r\n super(props);\r\n this.state = {\r\n gridItems: [],\r\n orientation: props.orientation ?? Orientation.Horizontal,\r\n dynamicNodeHeights: new Map(),\r\n resetIndex: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: VirtualizedPropertyGridProps, prevState: VirtualizedPropertyGridState) {\r\n if (this.props.orientation !== prevProps.orientation\r\n || this.props.isOrientationFixed !== prevProps.isOrientationFixed\r\n || this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth\r\n || this.props.width !== prevProps.width)\r\n this.updateOrientation(this.props.width);\r\n\r\n if (this.props.model !== prevProps.model) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n\r\n if (this.props.highlight !== prevProps.highlight && this.props.highlight?.activeHighlight && this.state.gridItems.length !== 0) {\r\n let index = 0;\r\n let foundMatchingItem = false;\r\n for (const item of this.state.gridItems) {\r\n if (item instanceof MutableCategorizedPrimitiveProperty && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.derivedRecord.property.name\r\n || item instanceof MutableGridCategory && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.name) {\r\n foundMatchingItem = true;\r\n break;\r\n }\r\n index++;\r\n }\r\n if (foundMatchingItem) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.scrollToItem(index);\r\n }\r\n }\r\n\r\n if (this.state.dynamicNodeHeights !== prevState.dynamicNodeHeights) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(this.state.resetIndex);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static getDerivedStateFromProps(props: VirtualizedPropertyGridProps, state: VirtualizedPropertyGridState): VirtualizedPropertyGridState | null {\r\n return {\r\n ...state,\r\n gridItems: props.model.getVisibleFlatGrid(),\r\n };\r\n }\r\n\r\n private updateOrientation(width: number) {\r\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };\r\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);\r\n\r\n if (currentOrientation !== this.state.orientation) {\r\n this.setState({ orientation: currentOrientation });\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n }\r\n\r\n /**\r\n * Calculate given node height depending on it's type, position in category, parent category depth and current orientation.\r\n * @param node FlatGridItem node for which to calculate height\r\n * @returns current height of node.\r\n */\r\n private calculateNodeHeight(node: FlatGridItem) {\r\n const categoryHeaderHeight = 34;\r\n const categoryHeaderPadding = 4;\r\n const categoryPropertyHeight = 27;\r\n const bottomBorderPadding = 5;\r\n const verticalPrimitivePropertyHeight = 55;\r\n\r\n return getPropertyHeight(this.state) + node.lastInNumberOfCategories * bottomBorderPadding;\r\n\r\n function getPropertyHeight(state: VirtualizedPropertyGridState) {\r\n const dynamicHeight = state.dynamicNodeHeights.get(node.key);\r\n if (dynamicHeight !== undefined) {\r\n if (node instanceof MutableCustomGridCategory) {\r\n return categoryHeaderHeight + categoryHeaderPadding\r\n + (node.isExpanded ? dynamicHeight + bottomBorderPadding : 0);\r\n }\r\n\r\n return dynamicHeight + (state.orientation === Orientation.Vertical ? 28 : 0);\r\n }\r\n\r\n if (node.type === FlatGridItemType.Category) {\r\n return categoryHeaderHeight + categoryHeaderPadding;\r\n }\r\n\r\n if (state.orientation === Orientation.Vertical && node.type === FlatGridItemType.Primitive) {\r\n return verticalPrimitivePropertyHeight;\r\n }\r\n\r\n return categoryPropertyHeight;\r\n }\r\n }\r\n\r\n private _handleNodeHeightChange = (index: number, key: string, newHeight: number) => {\r\n if (this.state.dynamicNodeHeights.get(key) === newHeight) {\r\n return;\r\n }\r\n\r\n this.setState((state) => {\r\n return {\r\n ...state,\r\n dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(key, newHeight),\r\n resetIndex: index,\r\n };\r\n });\r\n };\r\n\r\n private _calculateNodeHeightByIndex = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return this.calculateNodeHeight(node);\r\n };\r\n\r\n private calculateEstimatedHeight() {\r\n let sum = 0;\r\n for (const node of this.state.gridItems)\r\n sum += this.calculateNodeHeight(node);\r\n\r\n return Math.ceil(sum / this.state.gridItems.length);\r\n }\r\n\r\n private _getNodeKey = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return node.key;\r\n };\r\n\r\n /** @internal */\r\n public override render() {\r\n return <ColumnResizingPropertyListPropsSupplier\r\n orientation={this.state.orientation}\r\n width={this.props.width}\r\n minLabelWidth={this.props.minLabelWidth}\r\n minValueWidth={this.props.minValueWidth}\r\n actionButtonWidth={this.props.actionButtonWidth}\r\n >\r\n {(columnResizeContext) => (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n >\r\n {(selectionContext) => {\r\n const gridContext: VirtualizedPropertyGridContext = {\r\n orientation: columnResizeContext.orientation,\r\n gridWidth: this.props.width,\r\n\r\n isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,\r\n isPropertySelectionEnabled: selectionContext.isPropertySelectionEnabled,\r\n selectedPropertyKey: selectionContext.selectedPropertyKey,\r\n\r\n onPropertyClicked: selectionContext.onPropertyClicked,\r\n onPropertyRightClicked: selectionContext.onPropertyRightClicked,\r\n onPropertyContextMenu: selectionContext.onPropertyContextMenu,\r\n\r\n editingPropertyKey: selectionContext.editingPropertyKey,\r\n onEditCommit: selectionContext.onEditCommit,\r\n onEditCancel: selectionContext.onEditCancel,\r\n\r\n eventHandler: this.props.eventHandler,\r\n dataProvider: this.props.dataProvider,\r\n\r\n actionButtonRenderers: this.props.actionButtonRenderers,\r\n propertyValueRendererManager: this.props.propertyValueRendererManager,\r\n propertyCategoryRendererManager: this.props.propertyCategoryRendererManager,\r\n\r\n columnRatio: columnResizeContext.columnRatio,\r\n columnInfo: columnResizeContext.columnInfo,\r\n isResizeHandleBeingDragged: columnResizeContext.isResizeHandleBeingDragged,\r\n isResizeHandleHovered: columnResizeContext.isResizeHandleHovered,\r\n onColumnRatioChanged: columnResizeContext.onColumnChanged,\r\n onResizeHandleDragChanged: columnResizeContext.onResizeHandleDragChanged,\r\n onResizeHandleHoverChanged: columnResizeContext.onResizeHandleHoverChanged,\r\n\r\n highlight: this.props.highlight,\r\n };\r\n\r\n const renderContext: PropertyGridInternalContext = {\r\n gridItems: this.state.gridItems,\r\n gridEventHandler: this.props.eventHandler,\r\n gridModel: this.props.model,\r\n style: this.props.style,\r\n className: this.props.className,\r\n onItemHeightChanged: this._handleNodeHeightChange,\r\n gridContext,\r\n };\r\n\r\n return (\r\n <PropertyGridInternalContextProvider value={renderContext}>\r\n <div className={classnames(\"components-virtualized-property-grid\", \"components-smallEditor-host\")}>\r\n <VariableSizeList\r\n className={classnames(\"components-property-grid-wrapper\", \"ReactWindow__VariableSizeList\", this.props.className)}\r\n width={this.props.width}\r\n height={this.props.height}\r\n itemCount={this.state.gridItems.length}\r\n itemSize={this._calculateNodeHeightByIndex}\r\n estimatedItemSize={this.calculateEstimatedHeight()}\r\n overscanCount={10}\r\n layout=\"vertical\"\r\n style={this.props.style}\r\n itemKey={this._getNodeKey}\r\n ref={this._listRef}\r\n >\r\n {FlatGridItemNode}\r\n </VariableSizeList>\r\n </div>\r\n </PropertyGridInternalContextProvider>\r\n );\r\n }}\r\n </PropertyGridEventsRelatedPropsSupplier >\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>;\r\n }\r\n}\r\n\r\nconst FlatGridItemNode = React.memo(\r\n ({ index, style: virtualizedListStyle }: ListChildComponentProps) => {\r\n const { gridItems, gridEventHandler, gridModel, gridContext, className, style, onItemHeightChanged } = usePropertyGridInternalContext(FlatGridItemNode);\r\n const node = gridItems[index];\r\n\r\n const onExpansionToggled = React.useCallback(\r\n () => gridEventHandler.onExpansionToggled(node.selectionKey),\r\n [gridEventHandler, node.selectionKey],\r\n );\r\n const onHeightChanged = React.useCallback(\r\n (newHeight: number) => onItemHeightChanged(index, node.key, newHeight),\r\n [onItemHeightChanged, index, node.key],\r\n );\r\n\r\n function getDisplayNode() {\r\n const lastInNumberOfCategories = node.lastInNumberOfCategories;\r\n switch (node.type) {\r\n case FlatGridItemType.Category:\r\n const categoryRendererManager = gridContext.propertyCategoryRendererManager\r\n ?? PropertyCategoryRendererManager.defaultManager;\r\n const customRenderer = categoryRendererManager.getCategoryComponent(node);\r\n const wrapperClassName = classnames(\r\n \"virtualized-grid-node-content\",\r\n customRenderer !== undefined ? \"virtualized-grid-node-custom-category\" : \"virtualized-grid-node-category\",\r\n );\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={node.depth}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className={wrapperClassName}\r\n >\r\n <PropertyCategoryBlock\r\n className={className}\r\n style={style}\r\n category={node.derivedCategory}\r\n onExpansionToggled={onExpansionToggled}\r\n highlight={gridContext.highlight?.filteredTypes?.includes(FilteredType.Category) ?\r\n gridContext.highlight :\r\n undefined\r\n }\r\n >\r\n {customRenderer !== undefined && (\r\n <CustomCategoryContent\r\n renderer={customRenderer}\r\n categoryItem={node}\r\n gridContext={gridContext}\r\n onHeightChanged={onHeightChanged}\r\n />\r\n )}\r\n </PropertyCategoryBlock>\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n case FlatGridItemType.Array:\r\n case FlatGridItemType.Struct:\r\n case FlatGridItemType.Primitive:\r\n const selectionKey = node.selectionKey;\r\n const parentCategoryItem = gridModel.getItem(node.parentCategorySelectionKey) as GridCategoryItem;\r\n\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={parentCategoryItem.depth + 1}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className=\"virtualized-grid-node-content\"\r\n >\r\n <FlatPropertyRenderer\r\n key={node.key}\r\n uniqueKey={selectionKey}\r\n propertyRecord={node.derivedRecord}\r\n orientation={gridContext.orientation}\r\n indentation={node.depth}\r\n width={gridContext.gridWidth}\r\n\r\n isHoverable={gridContext.isPropertyHoverEnabled}\r\n isSelectable={gridContext.isPropertySelectionEnabled}\r\n isSelected={selectionKey === gridContext.selectedPropertyKey}\r\n\r\n onClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyClicked : undefined}\r\n onRightClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyRightClicked : undefined}\r\n onContextMenu={gridContext.onPropertyContextMenu}\r\n\r\n category={parentCategoryItem.derivedCategory}\r\n isEditing={selectionKey === gridContext.editingPropertyKey}\r\n onEditCommit={gridContext.onEditCommit}\r\n onEditCancel={gridContext.onEditCancel}\r\n\r\n isExpanded={node.isExpanded}\r\n onExpansionToggled={onExpansionToggled}\r\n onHeightChanged={onHeightChanged}\r\n\r\n actionButtonRenderers={gridContext.actionButtonRenderers}\r\n propertyValueRendererManager={gridContext.propertyValueRendererManager}\r\n\r\n columnRatio={gridContext.columnRatio}\r\n columnInfo={gridContext.columnInfo}\r\n isResizeHandleBeingDragged={gridContext.isResizeHandleBeingDragged}\r\n isResizeHandleHovered={gridContext.isResizeHandleHovered}\r\n onColumnRatioChanged={gridContext.onColumnRatioChanged}\r\n onResizeHandleDragChanged={gridContext.onResizeHandleDragChanged}\r\n onResizeHandleHoverChanged={gridContext.onResizeHandleHoverChanged}\r\n\r\n highlight={gridContext.highlight ?\r\n { applyOnLabel: (gridContext.highlight.filteredTypes?.includes(FilteredType.Label)) ?? false, applyOnValue: (gridContext.highlight.filteredTypes?.includes(FilteredType.Value)) ?? false, ...gridContext.highlight } :\r\n undefined\r\n }\r\n />\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"virtualized-grid-node\" style={virtualizedListStyle}>\r\n {getDisplayNode()}\r\n </div>\r\n );\r\n },\r\n areEqual,\r\n);\r\n\r\nFlatGridItemNode.displayName = \"FlatGridItemNode\";\r\n\r\ninterface CustomCategoryContentProps {\r\n categoryItem: GridCategoryItem;\r\n renderer: React.ComponentType<PropertyCategoryRendererProps>;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onHeightChanged: (newHeight: number) => void;\r\n}\r\n\r\nconst CustomCategoryContent: React.FC<CustomCategoryContentProps> = (props) => {\r\n const { onHeightChanged } = props;\r\n const divRef = React.useRef<HTMLDivElement>(null);\r\n\r\n React.useLayoutEffect(\r\n () => {\r\n assert(divRef.current !== null);\r\n const contentHeight = divRef.current.getBoundingClientRect().height;\r\n onHeightChanged(contentHeight);\r\n },\r\n [props.gridContext.orientation, onHeightChanged],\r\n );\r\n\r\n return (\r\n <div ref={divRef}>\r\n {React.createElement(props.renderer, props)}\r\n </div>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"VirtualizedPropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/VirtualizedPropertyGrid.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;;;;;;;;;AAE/F;;GAEG;AACH,0CAAwC;AACxC,4DAAoC;AACpC,6CAA+B;AAC/B,+CAAmF;AACnF,sDAA6C;AAE7C,kDAAmE;AAEnE,kGAAkG;AAKlG,kGAAmF;AAEnF,oHAAiH;AACjH,gGAA6F;AAC7F,oFAA8E;AAC9E,oFAAiF;AACjF,2FAAwF;AAGxF,wFAAoH;AAEpH,uGAAoG;AACpG,+EAA4E;AAC5E,mEAAgE;AAChE,+DAAqF;AACrF,qGAAkG;AAsFlG,MAAM,CACJ,mCAAmC,EACnC,oCAAoC,EACpC,8BAA8B,EAC/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yC,CAAC,KAAK,EAAE,EAAE;IAC5E,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,KAAK,CAAC,eAAe,CACnB,GAAG,EAAE;QACH,IAAA,qBAAM,EAAC,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;QAChC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QACpE,eAAe,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC,EACD,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,eAAe,CAAC,CACjD,CAAC;IAEF,OAAO,CACL,6BAAK,GAAG,EAAE,MAAM,IACb,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CACvC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./VirtualizedPropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { areEqual, ListChildComponentProps, VariableSizeList } from \"react-window\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, RatioChangeResult } from \"@itwin/core-react\";\r\nimport { HighlightingComponentProps } from \"../../common/HighlightingComponentProps\";\r\nimport { createContextWithMandatoryProvider } from \"../../common/UseContextWithMandatoryProvider\";\r\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\r\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\r\nimport { PropertyGridColumnInfo } from \"../../properties/renderers/PropertyGridColumns\";\r\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\r\nimport { FilteredType } from \"../dataproviders/filterers/PropertyDataFiltererBase\";\r\nimport { FlatGridItem, GridCategoryItem } from \"../internal/flat-items/FlatGridItem\";\r\nimport { MutableCategorizedPrimitiveProperty } from \"../internal/flat-items/MutableCategorizedPrimitiveProperty\";\r\nimport { MutableCustomGridCategory } from \"../internal/flat-items/MutableCustomGridCategory\";\r\nimport { FlatGridItemType } from \"../internal/flat-items/MutableFlatGridItem\";\r\nimport { MutableGridCategory } from \"../internal/flat-items/MutableGridCategory\";\r\nimport { FlatPropertyRenderer } from \"../internal/flat-properties/FlatPropertyRenderer\";\r\nimport { IPropertyGridEventHandler } from \"../internal/PropertyGridEventHandler\";\r\nimport { IPropertyGridModel } from \"../internal/PropertyGridModel\";\r\nimport { PropertyCategoryRendererManager, PropertyCategoryRendererProps } from \"../PropertyCategoryRendererManager\";\r\nimport { IPropertyDataProvider, PropertyCategory } from \"../PropertyDataProvider\";\r\nimport { ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { FlatItemNestedBorderWrapper } from \"./FlatItemNestedBorderWrapper\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\n\r\n/** Properties for [[VirtualizedPropertyGrid]] React component\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {\r\n model: IPropertyGridModel;\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n width: number;\r\n height: number;\r\n}\r\n\r\n/** State of [[VirtualizedPropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface VirtualizedPropertyGridState {\r\n /** List of PropertyGrid categories */\r\n gridItems: FlatGridItem[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** Keeps record of dynamic node heights */\r\n dynamicNodeHeights: Map<string, number>;\r\n /** When resetting node height cache, marks the point at which heights have become stale */\r\n resetIndex: number;\r\n}\r\n\r\n/**\r\n * Context of [[VirtualizedPropertyGrid]] component.\r\n * @internal\r\n */\r\nexport interface PropertyGridInternalContext {\r\n gridItems: FlatGridItem[];\r\n gridEventHandler: IPropertyGridEventHandler;\r\n gridModel: IPropertyGridModel;\r\n\r\n style?: React.CSSProperties;\r\n className?: string;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onItemHeightChanged: (index: number, key: string, height: number) => void;\r\n}\r\n\r\n/**\r\n * Context of the surrounding [VirtualizedPropertyGrid]($components-react) component.\r\n * @beta\r\n */\r\nexport interface VirtualizedPropertyGridContext {\r\n orientation: Orientation;\r\n gridWidth: number;\r\n\r\n isPropertyHoverEnabled: boolean;\r\n isPropertySelectionEnabled: boolean;\r\n selectedPropertyKey?: string;\r\n\r\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\r\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\r\n\r\n editingPropertyKey?: string;\r\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\r\n onEditCancel?: () => void;\r\n\r\n eventHandler: IPropertyGridEventHandler;\r\n dataProvider: IPropertyDataProvider;\r\n\r\n actionButtonRenderers?: ActionButtonRenderer[];\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n propertyCategoryRendererManager?: PropertyCategoryRendererManager;\r\n\r\n columnRatio: number;\r\n columnInfo: PropertyGridColumnInfo;\r\n isResizeHandleBeingDragged: boolean;\r\n isResizeHandleHovered: boolean;\r\n onColumnRatioChanged: (ratio: number) => void | RatioChangeResult;\r\n onResizeHandleDragChanged: (newValue: boolean) => void;\r\n onResizeHandleHoverChanged: (newValue: boolean) => void;\r\n\r\n highlight?: HighlightingComponentProps & {\r\n filteredTypes?: FilteredType[];\r\n };\r\n}\r\n\r\nconst [\r\n PropertyGridInternalContextProvider,\r\n _PropertyGridInternalContextConsumer,\r\n usePropertyGridInternalContext,\r\n] = createContextWithMandatoryProvider<PropertyGridInternalContext>(\"PropertyGridInternalContext\");\r\n\r\n/**\r\n * VirtualizedPropertyGrid React component.\r\n * @beta\r\n */\r\nexport class VirtualizedPropertyGrid extends React.Component<VirtualizedPropertyGridProps, VirtualizedPropertyGridState> {\r\n private _listRef = React.createRef<VariableSizeList>();\r\n\r\n /** @internal */\r\n constructor(props: VirtualizedPropertyGridProps) {\r\n super(props);\r\n this.state = {\r\n gridItems: [],\r\n orientation: props.orientation ?? Orientation.Horizontal,\r\n dynamicNodeHeights: new Map(),\r\n resetIndex: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidUpdate(prevProps: VirtualizedPropertyGridProps, prevState: VirtualizedPropertyGridState) {\r\n if (this.props.orientation !== prevProps.orientation\r\n || this.props.isOrientationFixed !== prevProps.isOrientationFixed\r\n || this.props.horizontalOrientationMinWidth !== prevProps.horizontalOrientationMinWidth\r\n || this.props.width !== prevProps.width)\r\n this.updateOrientation(this.props.width);\r\n\r\n if (this.props.model !== prevProps.model) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n\r\n if (this.props.highlight !== prevProps.highlight && this.props.highlight?.activeHighlight && this.state.gridItems.length !== 0) {\r\n let index = 0;\r\n let foundMatchingItem = false;\r\n for (const item of this.state.gridItems) {\r\n if (item instanceof MutableCategorizedPrimitiveProperty && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.derivedRecord.property.name\r\n || item instanceof MutableGridCategory && this.props.highlight.activeHighlight.highlightedItemIdentifier === item.name) {\r\n foundMatchingItem = true;\r\n break;\r\n }\r\n index++;\r\n }\r\n if (foundMatchingItem) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.scrollToItem(index);\r\n }\r\n }\r\n\r\n if (this.state.dynamicNodeHeights !== prevState.dynamicNodeHeights) {\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(this.state.resetIndex);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static getDerivedStateFromProps(props: VirtualizedPropertyGridProps, state: VirtualizedPropertyGridState): VirtualizedPropertyGridState | null {\r\n return {\r\n ...state,\r\n gridItems: props.model.getVisibleFlatGrid(),\r\n };\r\n }\r\n\r\n private updateOrientation(width: number) {\r\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = { ...this.props };\r\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(width, orientation, isOrientationFixed, horizontalOrientationMinWidth);\r\n\r\n if (currentOrientation !== this.state.orientation) {\r\n this.setState({ orientation: currentOrientation });\r\n // istanbul ignore else\r\n if (this._listRef.current)\r\n this._listRef.current.resetAfterIndex(0);\r\n }\r\n }\r\n\r\n /**\r\n * Calculate given node height depending on it's type, position in category, parent category depth and current orientation.\r\n * @param node FlatGridItem node for which to calculate height\r\n * @returns current height of node.\r\n */\r\n private calculateNodeHeight(node: FlatGridItem) {\r\n const categoryHeaderHeight = 35;\r\n const categoryHeaderPadding = 4;\r\n const categoryPropertyHeight = 27;\r\n const bottomBorderPadding = 5;\r\n const verticalPrimitivePropertyHeight = 55;\r\n\r\n return getPropertyHeight(this.state) + node.lastInNumberOfCategories * bottomBorderPadding;\r\n\r\n function getPropertyHeight(state: VirtualizedPropertyGridState) {\r\n const dynamicHeight = state.dynamicNodeHeights.get(node.key);\r\n if (dynamicHeight !== undefined) {\r\n if (node instanceof MutableCustomGridCategory) {\r\n return categoryHeaderHeight + categoryHeaderPadding\r\n + (node.isExpanded ? dynamicHeight + bottomBorderPadding : 0);\r\n }\r\n\r\n return dynamicHeight + (state.orientation === Orientation.Vertical ? 28 : 0);\r\n }\r\n\r\n if (node.type === FlatGridItemType.Category) {\r\n return categoryHeaderHeight + categoryHeaderPadding;\r\n }\r\n\r\n if (state.orientation === Orientation.Vertical && node.type === FlatGridItemType.Primitive) {\r\n return verticalPrimitivePropertyHeight;\r\n }\r\n\r\n return categoryPropertyHeight;\r\n }\r\n }\r\n\r\n private _handleNodeHeightChange = (index: number, key: string, newHeight: number) => {\r\n if (this.state.dynamicNodeHeights.get(key) === newHeight) {\r\n return;\r\n }\r\n\r\n this.setState((state) => {\r\n return {\r\n ...state,\r\n dynamicNodeHeights: new Map(state.dynamicNodeHeights).set(key, newHeight),\r\n resetIndex: index,\r\n };\r\n });\r\n };\r\n\r\n private _calculateNodeHeightByIndex = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return this.calculateNodeHeight(node);\r\n };\r\n\r\n private calculateEstimatedHeight() {\r\n let sum = 0;\r\n for (const node of this.state.gridItems)\r\n sum += this.calculateNodeHeight(node);\r\n\r\n return Math.ceil(sum / this.state.gridItems.length);\r\n }\r\n\r\n private _getNodeKey = (index: number) => {\r\n const node = this.state.gridItems[index];\r\n return node.key;\r\n };\r\n\r\n /** @internal */\r\n public override render() {\r\n return <ColumnResizingPropertyListPropsSupplier\r\n orientation={this.state.orientation}\r\n width={this.props.width}\r\n minLabelWidth={this.props.minLabelWidth}\r\n minValueWidth={this.props.minValueWidth}\r\n actionButtonWidth={this.props.actionButtonWidth}\r\n >\r\n {(columnResizeContext) => (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n >\r\n {(selectionContext) => {\r\n const gridContext: VirtualizedPropertyGridContext = {\r\n orientation: columnResizeContext.orientation,\r\n gridWidth: this.props.width,\r\n\r\n isPropertyHoverEnabled: selectionContext.isPropertyHoverEnabled,\r\n isPropertySelectionEnabled: selectionContext.isPropertySelectionEnabled,\r\n selectedPropertyKey: selectionContext.selectedPropertyKey,\r\n\r\n onPropertyClicked: selectionContext.onPropertyClicked,\r\n onPropertyRightClicked: selectionContext.onPropertyRightClicked,\r\n onPropertyContextMenu: selectionContext.onPropertyContextMenu,\r\n\r\n editingPropertyKey: selectionContext.editingPropertyKey,\r\n onEditCommit: selectionContext.onEditCommit,\r\n onEditCancel: selectionContext.onEditCancel,\r\n\r\n eventHandler: this.props.eventHandler,\r\n dataProvider: this.props.dataProvider,\r\n\r\n actionButtonRenderers: this.props.actionButtonRenderers,\r\n propertyValueRendererManager: this.props.propertyValueRendererManager,\r\n propertyCategoryRendererManager: this.props.propertyCategoryRendererManager,\r\n\r\n columnRatio: columnResizeContext.columnRatio,\r\n columnInfo: columnResizeContext.columnInfo,\r\n isResizeHandleBeingDragged: columnResizeContext.isResizeHandleBeingDragged,\r\n isResizeHandleHovered: columnResizeContext.isResizeHandleHovered,\r\n onColumnRatioChanged: columnResizeContext.onColumnChanged,\r\n onResizeHandleDragChanged: columnResizeContext.onResizeHandleDragChanged,\r\n onResizeHandleHoverChanged: columnResizeContext.onResizeHandleHoverChanged,\r\n\r\n highlight: this.props.highlight,\r\n };\r\n\r\n const renderContext: PropertyGridInternalContext = {\r\n gridItems: this.state.gridItems,\r\n gridEventHandler: this.props.eventHandler,\r\n gridModel: this.props.model,\r\n style: this.props.style,\r\n className: this.props.className,\r\n onItemHeightChanged: this._handleNodeHeightChange,\r\n gridContext,\r\n };\r\n\r\n return (\r\n <PropertyGridInternalContextProvider value={renderContext}>\r\n <div className={classnames(\"components-virtualized-property-grid\", \"components-smallEditor-host\")}>\r\n <VariableSizeList\r\n className={classnames(\"components-property-grid-wrapper\", \"ReactWindow__VariableSizeList\", this.props.className)}\r\n width={this.props.width}\r\n height={this.props.height}\r\n itemCount={this.state.gridItems.length}\r\n itemSize={this._calculateNodeHeightByIndex}\r\n estimatedItemSize={this.calculateEstimatedHeight()}\r\n overscanCount={10}\r\n layout=\"vertical\"\r\n style={this.props.style}\r\n itemKey={this._getNodeKey}\r\n ref={this._listRef}\r\n >\r\n {FlatGridItemNode}\r\n </VariableSizeList>\r\n </div>\r\n </PropertyGridInternalContextProvider>\r\n );\r\n }}\r\n </PropertyGridEventsRelatedPropsSupplier >\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>;\r\n }\r\n}\r\n\r\nconst FlatGridItemNode = React.memo(\r\n ({ index, style: virtualizedListStyle }: ListChildComponentProps) => {\r\n const { gridItems, gridEventHandler, gridModel, gridContext, className, style, onItemHeightChanged } = usePropertyGridInternalContext(FlatGridItemNode);\r\n const node = gridItems[index];\r\n\r\n const onExpansionToggled = React.useCallback(\r\n () => gridEventHandler.onExpansionToggled(node.selectionKey),\r\n [gridEventHandler, node.selectionKey],\r\n );\r\n const onHeightChanged = React.useCallback(\r\n (newHeight: number) => onItemHeightChanged(index, node.key, newHeight),\r\n [onItemHeightChanged, index, node.key],\r\n );\r\n\r\n function getDisplayNode() {\r\n const lastInNumberOfCategories = node.lastInNumberOfCategories;\r\n switch (node.type) {\r\n case FlatGridItemType.Category:\r\n const categoryRendererManager = gridContext.propertyCategoryRendererManager\r\n ?? PropertyCategoryRendererManager.defaultManager;\r\n const customRenderer = categoryRendererManager.getCategoryComponent(node);\r\n const wrapperClassName = classnames(\r\n \"virtualized-grid-node-content\",\r\n customRenderer !== undefined ? \"virtualized-grid-node-custom-category\" : \"virtualized-grid-node-category\",\r\n );\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={node.depth}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className={wrapperClassName}\r\n >\r\n <PropertyCategoryBlock\r\n className={className}\r\n style={style}\r\n category={node.derivedCategory}\r\n onExpansionToggled={onExpansionToggled}\r\n highlight={gridContext.highlight?.filteredTypes?.includes(FilteredType.Category) ?\r\n gridContext.highlight :\r\n undefined\r\n }\r\n >\r\n {customRenderer !== undefined && (\r\n <CustomCategoryContent\r\n renderer={customRenderer}\r\n categoryItem={node}\r\n gridContext={gridContext}\r\n onHeightChanged={onHeightChanged}\r\n />\r\n )}\r\n </PropertyCategoryBlock>\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n case FlatGridItemType.Array:\r\n case FlatGridItemType.Struct:\r\n case FlatGridItemType.Primitive:\r\n const selectionKey = node.selectionKey;\r\n const parentCategoryItem = gridModel.getItem(node.parentCategorySelectionKey) as GridCategoryItem;\r\n\r\n return (\r\n <FlatItemNestedBorderWrapper\r\n borderCount={parentCategoryItem.depth + 1}\r\n bottomBorderCount={lastInNumberOfCategories}\r\n className=\"virtualized-grid-node-content\"\r\n >\r\n <FlatPropertyRenderer\r\n key={node.key}\r\n uniqueKey={selectionKey}\r\n propertyRecord={node.derivedRecord}\r\n orientation={gridContext.orientation}\r\n indentation={node.depth}\r\n width={gridContext.gridWidth}\r\n\r\n isHoverable={gridContext.isPropertyHoverEnabled}\r\n isSelectable={gridContext.isPropertySelectionEnabled}\r\n isSelected={selectionKey === gridContext.selectedPropertyKey}\r\n\r\n onClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyClicked : undefined}\r\n onRightClick={node.type === FlatGridItemType.Primitive ? gridContext.onPropertyRightClicked : undefined}\r\n onContextMenu={gridContext.onPropertyContextMenu}\r\n\r\n category={parentCategoryItem.derivedCategory}\r\n isEditing={selectionKey === gridContext.editingPropertyKey}\r\n onEditCommit={gridContext.onEditCommit}\r\n onEditCancel={gridContext.onEditCancel}\r\n\r\n isExpanded={node.isExpanded}\r\n onExpansionToggled={onExpansionToggled}\r\n onHeightChanged={onHeightChanged}\r\n\r\n actionButtonRenderers={gridContext.actionButtonRenderers}\r\n propertyValueRendererManager={gridContext.propertyValueRendererManager}\r\n\r\n columnRatio={gridContext.columnRatio}\r\n columnInfo={gridContext.columnInfo}\r\n isResizeHandleBeingDragged={gridContext.isResizeHandleBeingDragged}\r\n isResizeHandleHovered={gridContext.isResizeHandleHovered}\r\n onColumnRatioChanged={gridContext.onColumnRatioChanged}\r\n onResizeHandleDragChanged={gridContext.onResizeHandleDragChanged}\r\n onResizeHandleHoverChanged={gridContext.onResizeHandleHoverChanged}\r\n\r\n highlight={gridContext.highlight ?\r\n { applyOnLabel: (gridContext.highlight.filteredTypes?.includes(FilteredType.Label)) ?? false, applyOnValue: (gridContext.highlight.filteredTypes?.includes(FilteredType.Value)) ?? false, ...gridContext.highlight } :\r\n undefined\r\n }\r\n />\r\n </FlatItemNestedBorderWrapper>\r\n );\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"virtualized-grid-node\" style={virtualizedListStyle}>\r\n {getDisplayNode()}\r\n </div>\r\n );\r\n },\r\n areEqual,\r\n);\r\n\r\nFlatGridItemNode.displayName = \"FlatGridItemNode\";\r\n\r\ninterface CustomCategoryContentProps {\r\n categoryItem: GridCategoryItem;\r\n renderer: React.ComponentType<PropertyCategoryRendererProps>;\r\n gridContext: VirtualizedPropertyGridContext;\r\n onHeightChanged: (newHeight: number) => void;\r\n}\r\n\r\nconst CustomCategoryContent: React.FC<CustomCategoryContentProps> = (props) => {\r\n const { onHeightChanged } = props;\r\n const divRef = React.useRef<HTMLDivElement>(null);\r\n\r\n React.useLayoutEffect(\r\n () => {\r\n assert(divRef.current !== null);\r\n const contentHeight = divRef.current.getBoundingClientRect().height;\r\n onHeightChanged(contentHeight);\r\n },\r\n [props.gridContext.orientation, onHeightChanged],\r\n );\r\n\r\n return (\r\n <div ref={divRef}>\r\n {React.createElement(props.renderer, props)}\r\n </div>\r\n );\r\n};\r\n"]}
@@ -4,7 +4,6 @@
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  @import "~@itwin/core-react/lib/cjs/core-react/expandable/list";
6
6
  @import "~@itwin/core-react/lib/cjs/core-react/scrollbar";
7
- @import "~@itwin/core-react/lib/cjs/core-react/style/itwinui-overrides";
8
7
 
9
8
  .components-virtualized-property-grid-loader {
10
9
  height: 100%;
@@ -15,8 +14,6 @@
15
14
 
16
15
  .components-virtualized-property-grid {
17
16
  user-select: none;
18
-
19
- @include small-itwinui-expandable-block;
20
17
  }
21
18
 
22
19
  .components-property-grid-wrapper {
@@ -1 +1 @@
1
- {"version":3,"file":"SelectableContent.d.ts","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,eAwBlF;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wBAAwB,EAAE,MAAM,CAAC;IACjC,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAU9D"}
1
+ {"version":3,"file":"SelectableContent.d.ts","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,gCAAgC,eAgClF;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wBAAwB,EAAE,MAAM,CAAC;IACjC,QAAQ,EAAE,2BAA2B,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAU9D"}
@@ -30,7 +30,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.SelectableContent = exports.ControlledSelectableContent = void 0;
31
31
  require("./SelectableContent.scss");
32
32
  const React = __importStar(require("react"));
33
- const core_react_1 = require("@itwin/core-react");
33
+ const itwinui_react_1 = require("@itwin/itwinui-react");
34
34
  /**
35
35
  * A fully-controlled component that accepts a list of child components with ids and labels and
36
36
  * renders a select box at the top, allowing to choose which of the provided child components
@@ -40,16 +40,19 @@ const core_react_1 = require("@itwin/core-react");
40
40
  function ControlledSelectableContent(props) {
41
41
  var _a;
42
42
  const { onSelectedContentIdChanged } = props;
43
- const onContentIdSelected = React.useCallback((value, action) => {
44
- onSelectedContentIdChanged && action.action === "select-option" && value && onSelectedContentIdChanged(value.value);
43
+ const onContentIdSelected = React.useCallback((newValue) => {
44
+ onSelectedContentIdChanged && onSelectedContentIdChanged(newValue);
45
45
  }, [onSelectedContentIdChanged]);
46
46
  const selectedContent = (_a = props.children.find((contentDef) => contentDef.id === props.selectedContentId)) !== null && _a !== void 0 ? _a : props.children[0];
47
+ const options = React.useMemo(() => {
48
+ return props.children.map((componentDef) => ({
49
+ label: componentDef.label,
50
+ value: componentDef.id,
51
+ }));
52
+ }, [props.children]);
47
53
  return (React.createElement("div", { className: "components-selectable-content" },
48
- React.createElement("div", { className: "components-selectable-content-header" },
49
- React.createElement(core_react_1.ThemedSelect, { openMenuOnClick: true, openMenuOnFocus: true, isSearchable: false, onChange: onContentIdSelected, className: "components-selectable-content-selector", "aria-label": props.selectAriaLabel, value: { label: selectedContent === null || selectedContent === void 0 ? void 0 : selectedContent.label, value: selectedContent === null || selectedContent === void 0 ? void 0 : selectedContent.id }, options: props.children.map((componentDef) => ({
50
- label: componentDef.label,
51
- value: componentDef.id,
52
- })) })),
54
+ React.createElement("div", { className: "components-selectable-content-header" }, options.length > 0 &&
55
+ React.createElement(itwinui_react_1.Select, { onChange: onContentIdSelected, size: "small", className: "components-selectable-content-selector", "aria-label": props.selectAriaLabel, value: selectedContent.id, options: options })),
53
56
  React.createElement("div", { className: "components-selectable-content-wrapper" }, selectedContent === null || selectedContent === void 0 ? void 0 : selectedContent.render())));
54
57
  }
55
58
  exports.ControlledSelectableContent = ControlledSelectableContent;
@@ -1 +1 @@
1
- {"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;;;;;;;;;;;;;;;;;;;;;;AAEH,oCAAkC;AAClC,6CAA+B;AAE/B,kDAA6D;AAwB7D;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,KAAuC;;IACjF,MAAM,EAAE,0BAA0B,EAAE,GAAG,KAAK,CAAC;IAC7C,MAAM,mBAAmB,G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AC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC;AAVD,8CAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module SelectableContent\r\n */\r\n\r\nimport \"./SelectableContent.scss\";\r\nimport * as React from \"react\";\r\nimport { ActionMeta, ValueType } from \"react-select/src/types\";\r\nimport { OptionType, ThemedSelect } from \"@itwin/core-react\";\r\n\r\n/**\r\n * A definition for content displayed in [[ControlledSelectableContent]] and\r\n * [[SelectableContent]] components.\r\n * @public\r\n */\r\nexport interface SelectableContentDefinition {\r\n id: string;\r\n label: string;\r\n render: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * [[ControlledSelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface ControlledSelectableContentProps {\r\n selectedContentId: string;\r\n onSelectedContentIdChanged?: (contentId: string) => void;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * A fully-controlled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\r\n const { onSelectedContentIdChanged } = props;\r\n const onContentIdSelected = React.useCallback((value: ValueType<OptionType>, action: ActionMeta<OptionType>) => {\r\n onSelectedContentIdChanged && action.action === \"select-option\" && value && onSelectedContentIdChanged((value as OptionType).value);\r\n }, [onSelectedContentIdChanged]);\r\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\r\n return (\r\n <div className=\"components-selectable-content\">\r\n <div className=\"components-selectable-content-header\">\r\n <ThemedSelect openMenuOnClick={true} openMenuOnFocus={true} isSearchable={false} onChange={onContentIdSelected}\r\n className=\"components-selectable-content-selector\"\r\n aria-label={props.selectAriaLabel}\r\n value={{ label: selectedContent?.label, value: selectedContent?.id }}\r\n options={props.children.map((componentDef) => ({\r\n label: componentDef.label,\r\n value: componentDef.id,\r\n }))}\r\n />\r\n </div>\r\n <div className=\"components-selectable-content-wrapper\">\r\n {selectedContent?.render()}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * [[SelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface SelectableContentProps {\r\n defaultSelectedContentId: string;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * An uncontrolled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function SelectableContent(props: SelectableContentProps) {\r\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\r\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\r\n setSelectedContentId(id);\r\n }, []);\r\n return (\r\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\r\n {props.children}\r\n </ControlledSelectableContent>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"SelectableContent.js","sourceRoot":"","sources":["../../../../src/components-react/selectable-content/SelectableContent.tsx"],"names":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QACN,6BAAK,SAAS,EAAC,uCAAuC,IACnD,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EAAE,CACtB,CACF,CACP,CAAC;AACJ,CAAC;AAhCD,kEAgCC;AAYD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjG,MAAM,0BAA0B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,EAAU,EAAE,EAAE;QAClE,oBAAoB,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACL,oBAAC,2BAA2B,IAAC,iBAAiB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,IAC9J,KAAK,CAAC,QAAQ,CACa,CAC/B,CAAC;AACJ,CAAC;AAVD,8CAUC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module SelectableContent\r\n */\r\n\r\nimport \"./SelectableContent.scss\";\r\nimport * as React from \"react\";\r\nimport { Select, SelectOption } from \"@itwin/itwinui-react\";\r\n\r\n/**\r\n * A definition for content displayed in [[ControlledSelectableContent]] and\r\n * [[SelectableContent]] components.\r\n * @public\r\n */\r\nexport interface SelectableContentDefinition {\r\n id: string;\r\n label: string;\r\n render: () => React.ReactNode;\r\n}\r\n\r\n/**\r\n * [[ControlledSelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface ControlledSelectableContentProps {\r\n selectedContentId: string;\r\n onSelectedContentIdChanged?: (contentId: string) => void;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * A fully-controlled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function ControlledSelectableContent(props: ControlledSelectableContentProps) {\r\n const { onSelectedContentIdChanged } = props;\r\n\r\n const onContentIdSelected = React.useCallback((newValue: string): void => {\r\n onSelectedContentIdChanged && onSelectedContentIdChanged(newValue);\r\n }, [onSelectedContentIdChanged]);\r\n\r\n const selectedContent = props.children.find((contentDef) => contentDef.id === props.selectedContentId) ?? props.children[0];\r\n const options = React.useMemo(() => {\r\n return props.children.map((componentDef) => ({\r\n label: componentDef.label,\r\n value: componentDef.id,\r\n })) as SelectOption<string>[];\r\n }, [props.children]);\r\n\r\n return (\r\n <div className=\"components-selectable-content\">\r\n <div className=\"components-selectable-content-header\">\r\n {options.length > 0 &&\r\n <Select onChange={onContentIdSelected} size=\"small\"\r\n className=\"components-selectable-content-selector\"\r\n aria-label={props.selectAriaLabel}\r\n value={selectedContent.id}\r\n options={options}\r\n />\r\n }\r\n </div>\r\n <div className=\"components-selectable-content-wrapper\">\r\n {selectedContent?.render()}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\n/**\r\n * [[SelectableContent]] component properties\r\n * @public\r\n */\r\nexport interface SelectableContentProps {\r\n defaultSelectedContentId: string;\r\n children: SelectableContentDefinition[];\r\n selectAriaLabel?: string;\r\n}\r\n\r\n/**\r\n * An uncontrolled component that accepts a list of child components with ids and labels and\r\n * renders a select box at the top, allowing to choose which of the provided child components\r\n * should be rendered at the bottom.\r\n * @public\r\n */\r\nexport function SelectableContent(props: SelectableContentProps) {\r\n const [selectedContentId, setSelectedContentId] = React.useState(props.defaultSelectedContentId);\r\n const onSelectedContentIdChanged = React.useCallback((id: string) => {\r\n setSelectedContentId(id);\r\n }, []);\r\n return (\r\n <ControlledSelectableContent selectedContentId={selectedContentId} onSelectedContentIdChanged={onSelectedContentIdChanged} selectAriaLabel={props.selectAriaLabel}>\r\n {props.children}\r\n </ControlledSelectableContent>\r\n );\r\n}\r\n"]}
@@ -16,5 +16,6 @@
16
16
 
17
17
  .components-selectable-content-wrapper {
18
18
  flex-grow: 1;
19
+ overflow: hidden;
19
20
  }
20
- }
21
+ }
@@ -4,7 +4,7 @@
4
4
  import "./Table.scss";
5
5
  import "../columnfiltering/ColumnFiltering.scss";
6
6
  import * as React from "react";
7
- import { CommonProps, UiSettings, UiSettingsStorage } from "@itwin/core-react";
7
+ import { CommonProps, UiStateStorage } from "@itwin/core-react";
8
8
  import { SelectionMode } from "../../common/selection/SelectionModes";
9
9
  import { PropertyUpdatedArgs } from "../../editors/EditorContainer";
10
10
  import { PropertyDialogState, PropertyValueRendererManager } from "../../properties/ValueRendererManager";
@@ -56,10 +56,10 @@ export interface TableProps extends CommonProps {
56
56
  /** Indicates whether the Table columns are reorderable */
57
57
  reorderableColumns?: boolean;
58
58
  /** Optional parameter for persistent UI settings. Used for column reordering and show persistency. */
59
- settingsStorage?: UiSettingsStorage;
59
+ settingsStorage?: UiStateStorage;
60
60
  /** Optional parameter for persistent UI settings. Used for column reordering and show persistency.
61
61
  * @deprecated use settingsStorage property */
62
- uiSettings?: UiSettings;
62
+ uiStateStorage?: UiStateStorage;
63
63
  /** Identifying string used for persistent state. */
64
64
  settingsIdentifier?: string;
65
65
  /** Custom property value renderer manager */
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/table/component/Table.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,cAAc,CAAC;AACtB,OAAO,yCAAyC,CAAC;AAIjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EACL,WAAW,EACX,UAAU,EAAoB,iBAAiB,EAChD,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAGtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+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G,OAAO;IAIlE,OAAO,CAAC,aAAa,CAiBnB;IAEF,OAAO,CAAC,kBAAkB,CAIxB;IAEF,OAAO,CAAC,0BAA0B,CAiBhC;IAEF,OAAO,CAAC,gBAAgB,CAItB;IAGF,OAAO,CAAC,qBAAqB,CAO3B;IAGF,OAAO,CAAC,aAAa,CAAgF;IAGrG,OAAO,CAAC,cAAc,CAA8C;IAEpE,OAAO,CAAC,gBAAgB;IAIxB,6BAA6B;IAC7B,OAAO,CAAC,eAAe;IAavB;;OAEG;IACH,IAAW,iBAAiB,IAAI,mCAAmC,CAOlE;IAED;;OAEG;IAEI,iCAAiC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMlE,OAAO,CAAC,mBAAmB,CAUzB;IAGF,OAAO,CAAC,qBAAqB,CAI3B;IAEF,OAAO,CAAC,YAAY,CAUlB;IAGF,OAAO,CAAC,qBAAqB,CAM3B;IAQF,OAAO,CAAC,SAAS,CAIf;IAEF,uEAAuE;IACvE,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,gBAAgB,CAyItB;IAEF,OAAO,CAAC,UAAU,CAA8D;IAChF,OAAO,CAAC,QAAQ,CAA+D;IAE/E,gBAAgB;IACA,MAAM;CA6FvB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;KAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IAE1D,gBAAgB;IACA,MAAM;CAMvB"}
@@ -411,9 +411,9 @@ class Table extends React.Component {
411
411
  cols.splice(columnTargetIndex, 0, cols.splice(columnSourceIndex, 1)[0]);
412
412
  // istanbul ignore else
413
413
  if (this.props.settingsIdentifier) {
414
- const settingsStorage = this.props.settingsStorage || /* istanbul ignore next */ new core_react_1.LocalSettingsStorage();
414
+ const stateStorage = this.props.settingsStorage || /* istanbul ignore next */ new core_react_1.LocalStateStorage();
415
415
  const keys = cols.map((col) => col.key);
416
- settingsStorage.saveSetting(this.props.settingsIdentifier, "ColumnReorder", keys); // eslint-disable-line @typescript-eslint/no-floating-promises
416
+ stateStorage.saveSetting(this.props.settingsIdentifier, "ColumnReorder", keys); // eslint-disable-line @typescript-eslint/no-floating-promises
417
417
  }
418
418
  this.setState({ columns: [] }, () => {
419
419
  this.setState({ columns: cols });
@@ -474,8 +474,8 @@ class Table extends React.Component {
474
474
  this._handleShowHideChange = (cols) => {
475
475
  this.setState({ hiddenColumns: cols });
476
476
  if (this.props.settingsIdentifier) {
477
- const settingsStorage = this.props.settingsStorage || new core_react_1.LocalSettingsStorage();
478
- settingsStorage.saveSetting(this.props.settingsIdentifier, "ColumnShowHideHiddenColumns", cols); // eslint-disable-line @typescript-eslint/no-floating-promises
477
+ const stateStorage = this.props.settingsStorage || new core_react_1.LocalStateStorage();
478
+ stateStorage.saveSetting(this.props.settingsIdentifier, "ColumnShowHideHiddenColumns", cols); // eslint-disable-line @typescript-eslint/no-floating-promises
479
479
  }
480
480
  return true;
481
481
  };
@@ -808,22 +808,21 @@ class Table extends React.Component {
808
808
  }
809
809
  let dataGridColumns = columnDescriptions.map(this._columnDescriptionToReactDataGridColumn);
810
810
  if (this.props.settingsIdentifier) {
811
- // eslint-disable-next-line deprecation/deprecation
812
- const settingsStorage = this.props.settingsStorage || /* istanbul ignore next */ this.props.uiSettings || /* istanbul ignore next */ new core_react_1.LocalSettingsStorage();
813
- const reorderResult = await settingsStorage.getSetting(this.props.settingsIdentifier, "ColumnReorder");
811
+ const stateStorage = this.props.settingsStorage || /* istanbul ignore next */ this.props.uiStateStorage || /* istanbul ignore next */ new core_react_1.LocalStateStorage();
812
+ const reorderResult = await stateStorage.getSetting(this.props.settingsIdentifier, "ColumnReorder");
814
813
  // istanbul ignore next
815
- if (reorderResult.status === core_react_1.UiSettingsStatus.Success) {
814
+ if (reorderResult.status === core_react_1.UiStateStorageStatus.Success) {
816
815
  const setting = reorderResult.setting;
817
816
  // map columns according to the keys in columns, in the order of the loaded array of keys
818
817
  dataGridColumns = setting.map((key) => dataGridColumns.filter((col) => col.key === key)[0]);
819
818
  }
820
- else if (reorderResult.status === core_react_1.UiSettingsStatus.NotFound) {
819
+ else if (reorderResult.status === core_react_1.UiStateStorageStatus.NotFound) {
821
820
  const keys = columnDescriptions.map((col) => col.key);
822
- await settingsStorage.saveSetting(this.props.settingsIdentifier, "ColumnReorder", keys);
821
+ await stateStorage.saveSetting(this.props.settingsIdentifier, "ColumnReorder", keys);
823
822
  }
824
- const showhideResult = await settingsStorage.getSetting(this.props.settingsIdentifier, "ColumnShowHideHiddenColumns");
823
+ const showhideResult = await stateStorage.getSetting(this.props.settingsIdentifier, "ColumnShowHideHiddenColumns");
825
824
  // istanbul ignore next
826
- if (showhideResult.status === core_react_1.UiSettingsStatus.Success) {
825
+ if (showhideResult.status === core_react_1.UiStateStorageStatus.Success) {
827
826
  const hiddenColumns = showhideResult.setting;
828
827
  this.setState({ hiddenColumns });
829
828
  }