@itwin/components-react 3.6.0-dev.60 → 3.6.0-dev.62

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 (168) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts +4 -1
  3. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
  4. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js +4 -1
  5. package/lib/cjs/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  6. package/lib/cjs/components-react/converters/TypeConverterManager.d.ts.map +1 -1
  7. package/lib/cjs/components-react/converters/TypeConverterManager.js +3 -4
  8. package/lib/cjs/components-react/converters/TypeConverterManager.js.map +1 -1
  9. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  10. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js +6 -2
  11. package/lib/cjs/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  12. package/lib/cjs/components-react/properties/LinkHandler.d.ts +2 -2
  13. package/lib/cjs/components-react/properties/LinkHandler.js +1 -1
  14. package/lib/cjs/components-react/properties/LinkHandler.js.map +1 -1
  15. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +3 -3
  16. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
  17. package/lib/cjs/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  18. package/lib/cjs/components-react/propertygrid/PropertyDataProvider.d.ts +2 -2
  19. package/lib/cjs/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  20. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts +2 -0
  21. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.d.ts.map +1 -1
  22. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js +1 -0
  23. package/lib/cjs/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
  24. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts +5 -10
  25. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
  26. package/lib/cjs/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  27. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +3 -3
  28. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
  29. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  30. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +11 -0
  31. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +2 -2
  32. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
  33. package/lib/cjs/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  34. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.d.ts +2 -2
  35. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js +1 -1
  36. package/lib/cjs/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
  37. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.d.ts +3 -3
  38. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js +3 -3
  39. package/lib/cjs/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  40. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.d.ts +3 -3
  41. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js +1 -1
  42. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  43. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.d.ts +2 -2
  44. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js +1 -1
  45. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
  46. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.d.ts +2 -2
  47. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.d.ts.map +1 -1
  48. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js +1 -1
  49. package/lib/cjs/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  50. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +4 -4
  51. package/lib/cjs/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  52. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
  53. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +1 -1
  54. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  55. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.d.ts +1 -1
  56. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js +1 -1
  57. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
  58. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.d.ts +1 -1
  59. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js +1 -1
  60. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  61. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts +8 -8
  62. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +3 -3
  63. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  64. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts +2 -2
  65. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +1 -1
  66. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  67. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.d.ts +2 -2
  68. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  69. package/lib/cjs/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  70. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +3 -6
  71. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  72. package/lib/cjs/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  73. package/lib/cjs/components-react/toolbar/Toolbar.d.ts +1 -1
  74. package/lib/cjs/components-react/toolbar/Toolbar.d.ts.map +1 -1
  75. package/lib/cjs/components-react/toolbar/Toolbar.js.map +1 -1
  76. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts +1 -1
  77. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  78. package/lib/cjs/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  79. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts +1 -4
  80. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  81. package/lib/cjs/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  82. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts +2 -5
  83. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
  84. package/lib/cjs/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  85. package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts +4 -1
  86. package/lib/esm/components-react/common/UseDebouncedAsyncValue.d.ts.map +1 -1
  87. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js +4 -1
  88. package/lib/esm/components-react/common/UseDebouncedAsyncValue.js.map +1 -1
  89. package/lib/esm/components-react/converters/TypeConverterManager.d.ts.map +1 -1
  90. package/lib/esm/components-react/converters/TypeConverterManager.js +3 -4
  91. package/lib/esm/components-react/converters/TypeConverterManager.js.map +1 -1
  92. package/lib/esm/components-react/filter-builder/FilterBuilderRule.d.ts.map +1 -1
  93. package/lib/esm/components-react/filter-builder/FilterBuilderRule.js +6 -2
  94. package/lib/esm/components-react/filter-builder/FilterBuilderRule.js.map +1 -1
  95. package/lib/esm/components-react/properties/LinkHandler.d.ts +2 -2
  96. package/lib/esm/components-react/properties/LinkHandler.js +1 -1
  97. package/lib/esm/components-react/properties/LinkHandler.js.map +1 -1
  98. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +3 -3
  99. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js +1 -1
  100. package/lib/esm/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  101. package/lib/esm/components-react/propertygrid/PropertyDataProvider.d.ts +2 -2
  102. package/lib/esm/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  103. package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts +2 -0
  104. package/lib/esm/components-react/propertygrid/component/PropertyGrid.d.ts.map +1 -1
  105. package/lib/esm/components-react/propertygrid/component/PropertyGrid.js +1 -0
  106. package/lib/esm/components-react/propertygrid/component/PropertyGrid.js.map +1 -1
  107. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts +5 -10
  108. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
  109. package/lib/esm/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  110. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.d.ts +3 -3
  111. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js +1 -1
  112. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.js.map +1 -1
  113. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGrid.scss +11 -0
  114. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.d.ts +2 -2
  115. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js +1 -1
  116. package/lib/esm/components-react/propertygrid/component/VirtualizedPropertyGridWithDataProvider.js.map +1 -1
  117. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.d.ts +2 -2
  118. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js +1 -1
  119. package/lib/esm/components-react/propertygrid/internal/PropertyGridEventHandler.js.map +1 -1
  120. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.d.ts +3 -3
  121. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js +3 -3
  122. package/lib/esm/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  123. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.d.ts +3 -3
  124. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js +1 -1
  125. package/lib/esm/components-react/propertygrid/internal/PropertyGridModel.js.map +1 -1
  126. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.d.ts +2 -2
  127. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js +1 -1
  128. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelChangeEvent.js.map +1 -1
  129. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.d.ts +2 -2
  130. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.d.ts.map +1 -1
  131. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js +1 -1
  132. package/lib/esm/components-react/propertygrid/internal/PropertyGridModelSource.js.map +1 -1
  133. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.d.ts +4 -4
  134. package/lib/esm/components-react/propertygrid/internal/flat-items/FlatGridItem.js.map +1 -1
  135. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.d.ts +1 -1
  136. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js +1 -1
  137. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedArrayProperty.js.map +1 -1
  138. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.d.ts +1 -1
  139. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js +1 -1
  140. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedPrimitiveProperty.js.map +1 -1
  141. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.d.ts +1 -1
  142. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js +1 -1
  143. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableCategorizedStructProperty.js.map +1 -1
  144. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.d.ts +8 -8
  145. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js +3 -3
  146. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableFlatGridItem.js.map +1 -1
  147. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.d.ts +2 -2
  148. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js +1 -1
  149. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridCategory.js.map +1 -1
  150. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.d.ts +2 -2
  151. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js +1 -1
  152. package/lib/esm/components-react/propertygrid/internal/flat-items/MutableGridItemFactory.js.map +1 -1
  153. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts +3 -6
  154. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.d.ts.map +1 -1
  155. package/lib/esm/components-react/propertygrid/internal/flat-properties/FlatPropertyRenderer.js.map +1 -1
  156. package/lib/esm/components-react/toolbar/Toolbar.d.ts +1 -1
  157. package/lib/esm/components-react/toolbar/Toolbar.d.ts.map +1 -1
  158. package/lib/esm/components-react/toolbar/Toolbar.js.map +1 -1
  159. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts +1 -1
  160. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  161. package/lib/esm/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  162. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts +1 -4
  163. package/lib/esm/components-react/tree/controlled/component/ControlledTree.d.ts.map +1 -1
  164. package/lib/esm/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  165. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts +2 -5
  166. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
  167. package/lib/esm/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  168. package/package.json +21 -11
@@ -1 +1 @@
1
- {"version":3,"file":"FilterBuilderRule.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilderRule.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,0BAA0B,CAAC;AASlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGjE;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD,6DAA6D;IAC7D,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,yBAAyB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,sCAAsC,eAsD9F"}
1
+ {"version":3,"file":"FilterBuilderRule.d.ts","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilderRule.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,0BAA0B,CAAC;AASlC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAGjE;;;GAGG;AACH,MAAM,WAAW,sCAAsC;IACrD,6DAA6D;IAC7D,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,sBAAsB;IACtB,IAAI,EAAE,yBAAyB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,sCAAsC,eA8D9F"}
@@ -53,7 +53,11 @@ export function PropertyFilterBuilderRuleRenderer(props) {
53
53
  React.createElement(SvgDelete, null))),
54
54
  React.createElement("div", { className: "rule-condition" },
55
55
  React.createElement(PropertyFilterBuilderRuleProperty, { properties: properties, selectedProperty: rule.property, onSelectedPropertyChanged: onSelectedPropertyChanged, propertyRenderer: propertyRenderer, isDisabled: isDisabled }),
56
- property && operatorRenderer(property),
57
- property && operator && !isUnaryPropertyFilterOperator(operator) && valueRenderer(property)));
56
+ property !== undefined
57
+ ? operatorRenderer(property)
58
+ : null,
59
+ property !== undefined && operator !== undefined && !isUnaryPropertyFilterOperator(operator)
60
+ ? valueRenderer(property)
61
+ : null));
58
62
  }
59
63
  //# sourceMappingURL=FilterBuilderRule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilterBuilderRule.js","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilderRule.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,yCAAyC,EAAE,MAAM,wBAAwB,CAAC;AACjH,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,6BAA6B,EAA8B,MAAM,aAAa,CAAC;AAaxF;;;GAGG;AACH,MAAM,UAAU,iCAAi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IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,CACxF,CACF,CAAC;AACT,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 PropertyFilterBuilder\r\n */\r\n\r\nimport \"./FilterBuilderRule.scss\";\r\nimport * as React from \"react\";\r\nimport { PropertyDescription, PropertyValue } from \"@itwin/appui-abstract\";\r\nimport { SvgDelete } from \"@itwin/itwinui-icons-react\";\r\nimport { IconButton } from \"@itwin/itwinui-react\";\r\nimport { PropertyFilterBuilderContext, PropertyFilterBuilderRuleRenderingContext } from \"./FilterBuilderContext\";\r\nimport { PropertyFilterBuilderRuleOperator } from \"./FilterBuilderRuleOperator\";\r\nimport { PropertyFilterBuilderRuleProperty } from \"./FilterBuilderRuleProperty\";\r\nimport { PropertyFilterBuilderRuleValue } from \"./FilterBuilderRuleValue\";\r\nimport { PropertyFilterBuilderRule } from \"./FilterBuilderState\";\r\nimport { isUnaryPropertyFilterOperator, PropertyFilterRuleOperator } from \"./Operators\";\r\n\r\n/**\r\n * Props for [[PropertyFilterBuilderRuleRenderer]] component.\r\n * @internal\r\n */\r\nexport interface PropertyFilterBuilderRuleRendererProps {\r\n /** Path from [[PropertyFilterBuilder]] root to this rule. */\r\n path: string[];\r\n /** Rule to render. */\r\n rule: PropertyFilterBuilderRule;\r\n}\r\n\r\n/**\r\n * Component that renders single rule in [[PropertyFilterBuilder]] component.\r\n * @internal\r\n */\r\nexport function PropertyFilterBuilderRuleRenderer(props: PropertyFilterBuilderRuleRendererProps) {\r\n const { path, rule } = props;\r\n const { properties, actions, onRulePropertySelected } = React.useContext(PropertyFilterBuilderContext);\r\n const { ruleOperatorRenderer, ruleValueRenderer, propertyRenderer, isDisabled } = React.useContext(PropertyFilterBuilderRuleRenderingContext);\r\n const { property, operator, value } = rule;\r\n\r\n const onSelectedPropertyChanged = React.useCallback((newProperty?: PropertyDescription) => {\r\n actions.setRuleProperty(path, newProperty);\r\n // invoke 'onRulePropertySelected' when new property is selected. There is no way to deselect property\r\n // so 'newProperty' will be 'undefined' only if selected property is no longer in 'properties' list.\r\n if (onRulePropertySelected && newProperty)\r\n onRulePropertySelected(newProperty);\r\n }, [path, onRulePropertySelected, actions]);\r\n\r\n const onRuleOperatorChange = React.useCallback((newOperator: PropertyFilterRuleOperator) => {\r\n actions.setRuleOperator(path, newOperator);\r\n }, [path, actions]);\r\n\r\n const onRuleValueChange = React.useCallback((newValue: PropertyValue) => {\r\n actions.setRuleValue(path, newValue);\r\n }, [path, actions]);\r\n\r\n const removeRule = () => actions.removeItem(path);\r\n\r\n const operatorRenderer = React.useCallback((prop: PropertyDescription) => {\r\n if (ruleOperatorRenderer)\r\n return ruleOperatorRenderer({ property: prop, operator, onChange: onRuleOperatorChange });\r\n return <PropertyFilterBuilderRuleOperator property={prop} onChange={onRuleOperatorChange} operator={operator} />;\r\n }, [operator, ruleOperatorRenderer, onRuleOperatorChange]);\r\n\r\n const valueRenderer = React.useCallback((prop: PropertyDescription) => {\r\n if (ruleValueRenderer)\r\n return ruleValueRenderer({ property: prop, value, onChange: onRuleValueChange });\r\n return <PropertyFilterBuilderRuleValue property={prop} onChange={onRuleValueChange} value={value} />;\r\n }, [value, ruleValueRenderer, onRuleValueChange]);\r\n\r\n return <div className=\"rule\">\r\n <div className=\"rule-remove-action\">\r\n <IconButton onClick={removeRule} styleType=\"borderless\" size=\"small\">\r\n <SvgDelete />\r\n </IconButton>\r\n </div>\r\n <div className=\"rule-condition\">\r\n <PropertyFilterBuilderRuleProperty\r\n properties={properties}\r\n selectedProperty={rule.property}\r\n onSelectedPropertyChanged={onSelectedPropertyChanged}\r\n propertyRenderer={propertyRenderer}\r\n isDisabled={isDisabled}\r\n />\r\n {property && operatorRenderer(property)}\r\n {property && operator && !isUnaryPropertyFilterOperator(operator) && valueRenderer(property)}\r\n </div>\r\n </div>;\r\n}\r\n"]}
1
+ {"version":3,"file":"FilterBuilderRule.js","sourceRoot":"","sources":["../../../../src/components-react/filter-builder/FilterBuilderRule.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,yCAAyC,EAAE,MAAM,wBAAwB,CAAC;AACjH,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,6BAA6B,EAA8B,MAAM,aAAa,CAAC;AAaxF;;;GAGG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAA6C;IAC7F,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;IACvG,MAAM,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,yCAAyC,CAAC,CAAC;IAC9I,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAE3C,MAAM,yBAAyB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,WAAiC,EAAE,EAAE;QACxF,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC3C,sGAAsG;QACtG,oGAAo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C,CAAC;QACnF,OAAO,oBAAC,8BAA8B,IAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;IACvG,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAElD,OAAO,6BAAK,SAAS,EAAC,MAAM;QAC1B,6BAAK,SAAS,EAAC,oBAAoB;YACjC,oBAAC,UAAU,IAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,OAAO;gBAClE,oBAAC,SAAS,OAAG,CACF,CACT;QACN,6BAAK,SAAS,EAAC,gBAAgB;YAC7B,oBAAC,iCAAiC,IAChC,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,IAAI,CAAC,QAAQ,EAC/B,yBAAyB,EAAE,yBAAyB,EACpD,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,GACtB;YAEA,QAAQ,KAAK,SAAS;gBACpB,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC;gBAC5B,CAAC,CAAC,IAAI;YAGR,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC;gBAC1F,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC;gBACzB,CAAC,CAAC,IAAI,CAEN,CACF,CAAC;AACT,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 PropertyFilterBuilder\r\n */\r\n\r\nimport \"./FilterBuilderRule.scss\";\r\nimport * as React from \"react\";\r\nimport { PropertyDescription, PropertyValue } from \"@itwin/appui-abstract\";\r\nimport { SvgDelete } from \"@itwin/itwinui-icons-react\";\r\nimport { IconButton } from \"@itwin/itwinui-react\";\r\nimport { PropertyFilterBuilderContext, PropertyFilterBuilderRuleRenderingContext } from \"./FilterBuilderContext\";\r\nimport { PropertyFilterBuilderRuleOperator } from \"./FilterBuilderRuleOperator\";\r\nimport { PropertyFilterBuilderRuleProperty } from \"./FilterBuilderRuleProperty\";\r\nimport { PropertyFilterBuilderRuleValue } from \"./FilterBuilderRuleValue\";\r\nimport { PropertyFilterBuilderRule } from \"./FilterBuilderState\";\r\nimport { isUnaryPropertyFilterOperator, PropertyFilterRuleOperator } from \"./Operators\";\r\n\r\n/**\r\n * Props for [[PropertyFilterBuilderRuleRenderer]] component.\r\n * @internal\r\n */\r\nexport interface PropertyFilterBuilderRuleRendererProps {\r\n /** Path from [[PropertyFilterBuilder]] root to this rule. */\r\n path: string[];\r\n /** Rule to render. */\r\n rule: PropertyFilterBuilderRule;\r\n}\r\n\r\n/**\r\n * Component that renders single rule in [[PropertyFilterBuilder]] component.\r\n * @internal\r\n */\r\nexport function PropertyFilterBuilderRuleRenderer(props: PropertyFilterBuilderRuleRendererProps) {\r\n const { path, rule } = props;\r\n const { properties, actions, onRulePropertySelected } = React.useContext(PropertyFilterBuilderContext);\r\n const { ruleOperatorRenderer, ruleValueRenderer, propertyRenderer, isDisabled } = React.useContext(PropertyFilterBuilderRuleRenderingContext);\r\n const { property, operator, value } = rule;\r\n\r\n const onSelectedPropertyChanged = React.useCallback((newProperty?: PropertyDescription) => {\r\n actions.setRuleProperty(path, newProperty);\r\n // invoke 'onRulePropertySelected' when new property is selected. There is no way to deselect property\r\n // so 'newProperty' will be 'undefined' only if selected property is no longer in 'properties' list.\r\n if (onRulePropertySelected && newProperty)\r\n onRulePropertySelected(newProperty);\r\n }, [path, onRulePropertySelected, actions]);\r\n\r\n const onRuleOperatorChange = React.useCallback((newOperator: PropertyFilterRuleOperator) => {\r\n actions.setRuleOperator(path, newOperator);\r\n }, [path, actions]);\r\n\r\n const onRuleValueChange = React.useCallback((newValue: PropertyValue) => {\r\n actions.setRuleValue(path, newValue);\r\n }, [path, actions]);\r\n\r\n const removeRule = () => actions.removeItem(path);\r\n\r\n const operatorRenderer = React.useCallback((prop: PropertyDescription) => {\r\n if (ruleOperatorRenderer)\r\n return ruleOperatorRenderer({ property: prop, operator, onChange: onRuleOperatorChange });\r\n return <PropertyFilterBuilderRuleOperator property={prop} onChange={onRuleOperatorChange} operator={operator} />;\r\n }, [operator, ruleOperatorRenderer, onRuleOperatorChange]);\r\n\r\n const valueRenderer = React.useCallback((prop: PropertyDescription) => {\r\n if (ruleValueRenderer)\r\n return ruleValueRenderer({ property: prop, value, onChange: onRuleValueChange });\r\n return <PropertyFilterBuilderRuleValue property={prop} onChange={onRuleValueChange} value={value} />;\r\n }, [value, ruleValueRenderer, onRuleValueChange]);\r\n\r\n return <div className=\"rule\">\r\n <div className=\"rule-remove-action\">\r\n <IconButton onClick={removeRule} styleType=\"borderless\" size=\"small\">\r\n <SvgDelete />\r\n </IconButton>\r\n </div>\r\n <div className=\"rule-condition\">\r\n <PropertyFilterBuilderRuleProperty\r\n properties={properties}\r\n selectedProperty={rule.property}\r\n onSelectedPropertyChanged={onSelectedPropertyChanged}\r\n propertyRenderer={propertyRenderer}\r\n isDisabled={isDisabled}\r\n />\r\n {\r\n property !== undefined\r\n ? operatorRenderer(property)\r\n : null\r\n }\r\n {\r\n property !== undefined && operator !== undefined && !isUnaryPropertyFilterOperator(operator)\r\n ? valueRenderer(property)\r\n : null\r\n }\r\n </div>\r\n </div>;\r\n}\r\n"]}
@@ -14,7 +14,7 @@ export declare const renderLinks: (text: string, links: LinkElementsInfo, highli
14
14
  export declare const withLinks: (stringValue: string, links?: LinkElementsInfo | undefined, highlight?: ((text: string) => React.ReactNode) | undefined) => React.ReactNode;
15
15
  /**
16
16
  * Properties for [[LinksRenderer]] component.
17
- * @alpha
17
+ * @public
18
18
  */
19
19
  export interface LinksRendererProps {
20
20
  value: string;
@@ -23,7 +23,7 @@ export interface LinksRendererProps {
23
23
  }
24
24
  /**
25
25
  * React component for rendering string with links.
26
- * @alpha
26
+ * @public
27
27
  */
28
28
  export declare function LinksRenderer(props: LinksRendererProps): JSX.Element;
29
29
  //# sourceMappingURL=LinkHandler.d.ts.map
@@ -72,7 +72,7 @@ export const withLinks = (stringValue, links, highlight) => {
72
72
  };
73
73
  /**
74
74
  * React component for rendering string with links.
75
- * @alpha
75
+ * @public
76
76
  */
77
77
  export function LinksRenderer(props) {
78
78
  return React.createElement(React.Fragment, null, withLinks(props.value, props.links, props.highlighter));
@@ -1 +1 @@
1
- {"version":3,"file":"LinkHandler.js","sourceRoot":"","sources":["../../../../src/components-react/properties/LinkHandler.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,iCAAiC;AACjC,SAAS,SAAS,CAAC,IAAY,EAAE,KAAuB,EAAE,SAA6C;IACrG,OAAO,CACL,oBAAC,gBAAgB,IACf,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,IAEA,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAClB,CACpB,CAAC;AACJ,CAAC;AAID,SAAS,eAAe,CAAC,MAAa,EAAE,MAAa;IACnD,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK;QAC7B,OAAO,CAAC,CAAC;IACX,IAAI,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK;QAC7B,OAAO,CAAC,CAAC,CAAC;IACZ,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS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AC,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnE,8DAA8D;IAC9D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,KAAK,IAAG,IAAI,CAAkB,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,SAA4C;IACnF,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAE,KAAuB,EAAE,SAA6C,EAAmB,EAAE;IACnI,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,WAAmB,EAAE,KAAwB,EAAE,SAA6C,EAAmB,EAAE;IACzI,IAAI,KAAK;QACP,OAAO,WAAW,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,SAAS;QACX,OAAO,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACnD,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAYF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,OAAO,0CAAG,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAI,CAAC;AACvE,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 Properties\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { BentleyError, BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { LinkElementsInfo } from \"@itwin/appui-abstract\";\r\nimport { UnderlinedButton } from \"@itwin/core-react\";\r\n\r\n/** Render a single anchor tag */\r\nfunction renderTag(text: string, links: LinkElementsInfo, highlight?: (text: string) => React.ReactNode) {\r\n return (\r\n <UnderlinedButton\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n links.onClick(text);\r\n }}\r\n >\r\n {highlight ? highlight(text) : text}\r\n </UnderlinedButton>\r\n );\r\n}\r\n\r\ninterface Match { start: number, end: number }\r\n\r\nfunction matchComparison(matchA: Match, matchB: Match) {\r\n if (matchA.start > matchB.start)\r\n return 1;\r\n if (matchB.start > matchA.start)\r\n return -1;\r\n return 0;\r\n}\r\n\r\nfunction renderTextPart(text: string, highlight?: (text: string) => React.ReactNode): React.ReactNode {\r\n return highlight ? highlight(text) : text;\r\n}\r\n\r\nfunction renderText(text: string, links: LinkElementsInfo, highlight?: (text: string) => React.ReactNode): React.ReactNode {\r\n const { matcher } = links;\r\n\r\n if (!matcher)\r\n return renderTag(text, links, highlight);\r\n\r\n const matches = matcher(text);\r\n\r\n // Sort just to be sure\r\n matches.sort(matchComparison);\r\n\r\n const parts: React.ReactNode[] = [];\r\n let lastIndex = 0;\r\n for (const match of matches) {\r\n // If matches overlap there must be something wrong with the matcher\r\n if (lastIndex > match.start)\r\n throw new BentleyError(BentleyStatus.ERROR, \"renderText: matcher returned overlapping matches\");\r\n\r\n if (lastIndex < match.start)\r\n parts.push(renderTextPart(text.substring(lastIndex, match.start), highlight));\r\n\r\n const anchorText = text.substring(match.start, match.end);\r\n parts.push(renderTag(anchorText, links, highlight));\r\n\r\n lastIndex = match.end;\r\n }\r\n if (text.length > lastIndex)\r\n parts.push(renderTextPart(text.substring(lastIndex), highlight));\r\n\r\n // Need to map, because React complains about the lack of keys\r\n return parts.map((part, index) => <React.Fragment key={index}>{part}</React.Fragment>);\r\n}\r\n\r\nfunction renderHighlighted(text: string, highlight: (text: string) => React.ReactNode) {\r\n return highlight(text);\r\n}\r\n\r\n/** Renders anchor tag by wrapping or splitting provided text\r\n * @public\r\n */\r\nexport const renderLinks = (text: string, links: LinkElementsInfo, highlight?: (text: string) => React.ReactNode): React.ReactNode => {\r\n return renderText(text, links, highlight);\r\n};\r\n\r\n/** If record has links, wraps stringValue in them, otherwise returns unchanged stringValue\r\n * Optionally it can highlight text\r\n * @public\r\n */\r\nexport const withLinks = (stringValue: string, links?: LinkElementsInfo, highlight?: (text: string) => React.ReactNode): React.ReactNode => {\r\n if (links)\r\n return renderLinks(stringValue, links, highlight);\r\n if (highlight)\r\n return renderHighlighted(stringValue, highlight);\r\n return stringValue;\r\n};\r\n\r\n/**\r\n * Properties for [[LinksRenderer]] component.\r\n * @alpha\r\n */\r\nexport interface LinksRendererProps {\r\n value: string;\r\n links?: LinkElementsInfo;\r\n highlighter?: (text: string) => React.ReactNode;\r\n}\r\n\r\n/**\r\n * React component for rendering string with links.\r\n * @alpha\r\n */\r\nexport function LinksRenderer(props: LinksRendererProps) {\r\n return <>{withLinks(props.value, props.links, props.highlighter)}</>;\r\n}\r\n"]}
1
+ {"version":3,"file":"LinkHandler.js","sourceRoot":"","sources":["../../../../src/components-react/properties/LinkHandler.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,iCAAiC;AACjC,SAAS,SAAS,CAAC,IAAY,EAAE,KAAuB,EAAE,SAA6C;IACrG,OAAO,CACL,oBAAC,gBAAgB,IACf,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;YACb,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,IAEA,SA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AAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAI,CAAC;AACvE,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 Properties\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { BentleyError, BentleyStatus } from \"@itwin/core-bentley\";\r\nimport { LinkElementsInfo } from \"@itwin/appui-abstract\";\r\nimport { UnderlinedButton } from \"@itwin/core-react\";\r\n\r\n/** Render a single anchor tag */\r\nfunction renderTag(text: string, links: LinkElementsInfo, highlight?: (text: string) => React.ReactNode) {\r\n return (\r\n <UnderlinedButton\r\n onClick={(e) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n links.onClick(text);\r\n }}\r\n >\r\n {highlight ? highlight(text) : text}\r\n </UnderlinedButton>\r\n );\r\n}\r\n\r\ninterface Match { start: number, end: number }\r\n\r\nfunction matchComparison(matchA: Match, matchB: Match) {\r\n if (matchA.start > matchB.start)\r\n return 1;\r\n if (matchB.start > matchA.start)\r\n return -1;\r\n return 0;\r\n}\r\n\r\nfunction renderTextPart(text: string, highlight?: (text: string) => React.ReactNode): React.ReactNode {\r\n return highlight ? highlight(text) : text;\r\n}\r\n\r\nfunction renderText(text: string, links: LinkElementsInfo, highlight?: (text: string) => React.ReactNode): React.ReactNode {\r\n const { matcher } = links;\r\n\r\n if (!matcher)\r\n return renderTag(text, links, highlight);\r\n\r\n const matches = matcher(text);\r\n\r\n // Sort just to be sure\r\n matches.sort(matchComparison);\r\n\r\n const parts: React.ReactNode[] = [];\r\n let lastIndex = 0;\r\n for (const match of matches) {\r\n // If matches overlap there must be something wrong with the matcher\r\n if (lastIndex > match.start)\r\n throw new BentleyError(BentleyStatus.ERROR, \"renderText: matcher returned overlapping matches\");\r\n\r\n if (lastIndex < match.start)\r\n parts.push(renderTextPart(text.substring(lastIndex, match.start), highlight));\r\n\r\n const anchorText = text.substring(match.start, match.end);\r\n parts.push(renderTag(anchorText, links, highlight));\r\n\r\n lastIndex = match.end;\r\n }\r\n if (text.length > lastIndex)\r\n parts.push(renderTextPart(text.substring(lastIndex), highlight));\r\n\r\n // Need to map, because React complains about the lack of keys\r\n return parts.map((part, index) => <React.Fragment key={index}>{part}</React.Fragment>);\r\n}\r\n\r\nfunction renderHighlighted(text: string, highlight: (text: string) => React.ReactNode) {\r\n return highlight(text);\r\n}\r\n\r\n/** Renders anchor tag by wrapping or splitting provided text\r\n * @public\r\n */\r\nexport const renderLinks = (text: string, links: LinkElementsInfo, highlight?: (text: string) => React.ReactNode): React.ReactNode => {\r\n return renderText(text, links, highlight);\r\n};\r\n\r\n/** If record has links, wraps stringValue in them, otherwise returns unchanged stringValue\r\n * Optionally it can highlight text\r\n * @public\r\n */\r\nexport const withLinks = (stringValue: string, links?: LinkElementsInfo, highlight?: (text: string) => React.ReactNode): React.ReactNode => {\r\n if (links)\r\n return renderLinks(stringValue, links, highlight);\r\n if (highlight)\r\n return renderHighlighted(stringValue, highlight);\r\n return stringValue;\r\n};\r\n\r\n/**\r\n * Properties for [[LinksRenderer]] component.\r\n * @public\r\n */\r\nexport interface LinksRendererProps {\r\n value: string;\r\n links?: LinkElementsInfo;\r\n highlighter?: (text: string) => React.ReactNode;\r\n}\r\n\r\n/**\r\n * React component for rendering string with links.\r\n * @public\r\n */\r\nexport function LinksRenderer(props: LinksRendererProps) {\r\n return <>{withLinks(props.value, props.links, props.highlighter)}</>;\r\n}\r\n"]}
@@ -6,7 +6,7 @@ import { VirtualizedPropertyGridContext } from "./component/VirtualizedPropertyG
6
6
  import { GridCategoryItem } from "./internal/flat-items/FlatGridItem";
7
7
  /**
8
8
  * Props that property category renderer receives.
9
- * @beta
9
+ * @public
10
10
  */
11
11
  export interface PropertyCategoryRendererProps {
12
12
  /** The category being rendered. */
@@ -18,13 +18,13 @@ export interface PropertyCategoryRendererProps {
18
18
  }
19
19
  /**
20
20
  * Factory function that produces custom property category components.
21
- * @beta
21
+ * @public
22
22
  */
23
23
  export declare type PropertyCategoryRenderer = (categoryItem: GridCategoryItem) => React.ComponentType<PropertyCategoryRendererProps> | undefined;
24
24
  /**
25
25
  * Keeps a record of currently registered property category renderers and determines which renderers get invoked for
26
26
  * each category.
27
- * @beta
27
+ * @public
28
28
  */
29
29
  export declare class PropertyCategoryRendererManager {
30
30
  private _categoryRenderers;
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * Keeps a record of currently registered property category renderers and determines which renderers get invoked for
10
10
  * each category.
11
- * @beta
11
+ * @public
12
12
  */
13
13
  export class PropertyCategoryRendererManager {
14
14
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAyBH;;;;GAIG;AACH,MAAM,OAAO,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IA4B3E,CAAC;IAxBC,mFAAmF;IAC5E,oBAAoB,CAAC,YAA8B;;QACxD,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvD,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAA,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAG,YAAY,CAAC,CAAC;IACjG,CAAC;IAED,qGAAqG;IAC9F,WAAW,CAAC,YAAoB,EAAE,gBAA0C,EAAE,QAAQ,GAAG,KAAK;QACnG,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1D,MAAM,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;YACvD,MAAM,UAAU,GAAG,+BAA+B,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC9E,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,IAAI,UAAU,qBAAqB,YAAY,wDAAwD,CAAC,CAAC;SACtI;QAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,sDAAsD;IAC/C,cAAc,CAAC,YAAoB;QACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;;AAzBa,8CAAc,GAAG,IAAI,+BAA+B,EAAE,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 PropertyGrid\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { VirtualizedPropertyGridContext } from \"./component/VirtualizedPropertyGrid\";\r\nimport { GridCategoryItem } from \"./internal/flat-items/FlatGridItem\";\r\n\r\n/**\r\n * Props that property category renderer receives.\r\n * @beta\r\n */\r\nexport interface PropertyCategoryRendererProps {\r\n /** The category being rendered. */\r\n categoryItem: GridCategoryItem;\r\n /** Context of the surrounding property grid. */\r\n gridContext: VirtualizedPropertyGridContext;\r\n /** Sets the allocated height for category contents. */\r\n onHeightChanged: (newHeight: number) => void;\r\n}\r\n\r\n/**\r\n * Factory function that produces custom property category components.\r\n * @beta\r\n */\r\nexport type PropertyCategoryRenderer = (categoryItem: GridCategoryItem) => React.ComponentType<PropertyCategoryRendererProps> | undefined;\r\n\r\n/**\r\n * Keeps a record of currently registered property category renderers and determines which renderers get invoked for\r\n * each category.\r\n * @beta\r\n */\r\nexport class PropertyCategoryRendererManager {\r\n private _categoryRenderers = new Map<string, PropertyCategoryRenderer>();\r\n\r\n public static defaultManager = new PropertyCategoryRendererManager();\r\n\r\n /** Retrieves a category rendering component based for the passed category item. */\r\n public getCategoryComponent(categoryItem: GridCategoryItem): React.ComponentType<PropertyCategoryRendererProps> | undefined {\r\n if (categoryItem.derivedCategory.renderer === undefined) {\r\n return undefined;\r\n }\r\n\r\n return this._categoryRenderers.get(categoryItem.derivedCategory.renderer.name)?.(categoryItem);\r\n }\r\n\r\n /** Registers a renderer factory function to be invoked on categories with specific renderer name. */\r\n public addRenderer(rendererName: string, categoryRenderer: PropertyCategoryRenderer, override = false): void {\r\n if (this._categoryRenderers.has(rendererName) && !override) {\r\n const className = PropertyCategoryRendererManager.name;\r\n const methodName = PropertyCategoryRendererManager.prototype.addRenderer.name;\r\n throw new Error(`${className}.${methodName} error: renderer '${rendererName}' has already been added. Did you mean to override it?`);\r\n }\r\n\r\n this._categoryRenderers.set(rendererName, categoryRenderer);\r\n }\r\n\r\n /** Removes previous renderer factory registration. */\r\n public removeRenderer(rendererName: string): void {\r\n this._categoryRenderers.delete(rendererName);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PropertyCategoryRendererManager.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyCategoryRendererManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAyBH;;;;GAIG;AACH,MAAM,OAAO,+BAA+B;IAA5C;QACU,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAC;IA4B3E,CAAC;IAxBC,mFAAmF;IAC5E,oBAAoB,CAAC,YAA8B;;QACxD,IAAI,YAAY,CAAC,eAAe,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvD,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAA,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,0CAAG,YAAY,CAAC,CAAC;IACjG,CAAC;IAED,qGAAqG;IAC9F,WAAW,CAAC,YAAoB,EAAE,gBAA0C,EAAE,QAAQ,GAAG,KAAK;QACnG,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC1D,MAAM,SAAS,GAAG,+BAA+B,CAAC,IAAI,CAAC;YACvD,MAAM,UAAU,GAAG,+BAA+B,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;YAC9E,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,IAAI,UAAU,qBAAqB,YAAY,wDAAwD,CAAC,CAAC;SACtI;QAED,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;IAC9D,CAAC;IAED,sDAAsD;IAC/C,cAAc,CAAC,YAAoB;QACxC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC;;AAzBa,8CAAc,GAAG,IAAI,+BAA+B,EAAE,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 PropertyGrid\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { VirtualizedPropertyGridContext } from \"./component/VirtualizedPropertyGrid\";\r\nimport { GridCategoryItem } from \"./internal/flat-items/FlatGridItem\";\r\n\r\n/**\r\n * Props that property category renderer receives.\r\n * @public\r\n */\r\nexport interface PropertyCategoryRendererProps {\r\n /** The category being rendered. */\r\n categoryItem: GridCategoryItem;\r\n /** Context of the surrounding property grid. */\r\n gridContext: VirtualizedPropertyGridContext;\r\n /** Sets the allocated height for category contents. */\r\n onHeightChanged: (newHeight: number) => void;\r\n}\r\n\r\n/**\r\n * Factory function that produces custom property category components.\r\n * @public\r\n */\r\nexport type PropertyCategoryRenderer = (categoryItem: GridCategoryItem) => React.ComponentType<PropertyCategoryRendererProps> | undefined;\r\n\r\n/**\r\n * Keeps a record of currently registered property category renderers and determines which renderers get invoked for\r\n * each category.\r\n * @public\r\n */\r\nexport class PropertyCategoryRendererManager {\r\n private _categoryRenderers = new Map<string, PropertyCategoryRenderer>();\r\n\r\n public static defaultManager = new PropertyCategoryRendererManager();\r\n\r\n /** Retrieves a category rendering component based for the passed category item. */\r\n public getCategoryComponent(categoryItem: GridCategoryItem): React.ComponentType<PropertyCategoryRendererProps> | undefined {\r\n if (categoryItem.derivedCategory.renderer === undefined) {\r\n return undefined;\r\n }\r\n\r\n return this._categoryRenderers.get(categoryItem.derivedCategory.renderer.name)?.(categoryItem);\r\n }\r\n\r\n /** Registers a renderer factory function to be invoked on categories with specific renderer name. */\r\n public addRenderer(rendererName: string, categoryRenderer: PropertyCategoryRenderer, override = false): void {\r\n if (this._categoryRenderers.has(rendererName) && !override) {\r\n const className = PropertyCategoryRendererManager.name;\r\n const methodName = PropertyCategoryRendererManager.prototype.addRenderer.name;\r\n throw new Error(`${className}.${methodName} error: renderer '${rendererName}' has already been added. Did you mean to override it?`);\r\n }\r\n\r\n this._categoryRenderers.set(rendererName, categoryRenderer);\r\n }\r\n\r\n /** Removes previous renderer factory registration. */\r\n public removeRenderer(rendererName: string): void {\r\n this._categoryRenderers.delete(rendererName);\r\n }\r\n}\r\n"]}
@@ -28,8 +28,8 @@ export interface PropertyData {
28
28
  [categoryName: string]: PropertyRecord[];
29
29
  };
30
30
  /**
31
- * Should state of existing property data in the component be re-used for this property data
32
- * @alpha
31
+ * Should state of existing property data in the component be re-used for this property data
32
+ * @beta
33
33
  */
34
34
  reusePropertyDataState?: boolean;
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAsC9C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,OAAoC;CAAI","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 { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\n\r\n/**\r\n * Contains metadata about a group of Properties.\r\n * @public\r\n */\r\nexport interface PropertyCategory {\r\n name: string;\r\n label: string;\r\n expand: boolean;\r\n childCategories?: PropertyCategory[];\r\n renderer?: {\r\n name: string;\r\n };\r\n}\r\n\r\n/**\r\n * Interface for property data provided to the PropertyGrid React component.\r\n * @public\r\n */\r\nexport interface PropertyData {\r\n label: PropertyRecord;\r\n description?: string;\r\n categories: PropertyCategory[];\r\n records: { [categoryName: string]: PropertyRecord[] };\r\n\r\n /**\r\n * Should state of existing property data in the component be re-used for this property data\r\n * @alpha\r\n */\r\n reusePropertyDataState?: boolean;\r\n}\r\n\r\n/** A signature for property data change listeners\r\n * @public\r\n */\r\nexport declare type PropertyDataChangesListener = () => void;\r\n\r\n/** An event broadcasted on property data changes\r\n * @public\r\n */\r\nexport class PropertyDataChangeEvent extends BeEvent<PropertyDataChangesListener> { }\r\n\r\n/**\r\n * An interface for property data provider which returns\r\n * property data and broadcasts an event when the data changes\r\n * @public\r\n */\r\nexport interface IPropertyDataProvider {\r\n /** Returns property data. */\r\n getData: (() => Promise<PropertyData>);\r\n /** Property data change event. */\r\n onDataChanged: PropertyDataChangeEvent;\r\n}\r\n"]}
1
+ {"version":3,"file":"PropertyDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/PropertyDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAsC9C;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,OAAoC;CAAI","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 { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\n\r\n/**\r\n * Contains metadata about a group of Properties.\r\n * @public\r\n */\r\nexport interface PropertyCategory {\r\n name: string;\r\n label: string;\r\n expand: boolean;\r\n childCategories?: PropertyCategory[];\r\n renderer?: {\r\n name: string;\r\n };\r\n}\r\n\r\n/**\r\n * Interface for property data provided to the PropertyGrid React component.\r\n * @public\r\n */\r\nexport interface PropertyData {\r\n label: PropertyRecord;\r\n description?: string;\r\n categories: PropertyCategory[];\r\n records: { [categoryName: string]: PropertyRecord[] };\r\n\r\n /**\r\n * Should state of existing property data in the component be re-used for this property data\r\n * @beta\r\n */\r\n reusePropertyDataState?: boolean;\r\n}\r\n\r\n/** A signature for property data change listeners\r\n * @public\r\n */\r\nexport declare type PropertyDataChangesListener = () => void;\r\n\r\n/** An event broadcasted on property data changes\r\n * @public\r\n */\r\nexport class PropertyDataChangeEvent extends BeEvent<PropertyDataChangesListener> { }\r\n\r\n/**\r\n * An interface for property data provider which returns\r\n * property data and broadcasts an event when the data changes\r\n * @public\r\n */\r\nexport interface IPropertyDataProvider {\r\n /** Returns property data. */\r\n getData: (() => Promise<PropertyData>);\r\n /** Property data change event. */\r\n onDataChanged: PropertyDataChangeEvent;\r\n}\r\n"]}
@@ -9,6 +9,7 @@ import { IPropertyDataProvider, PropertyCategory } from "../PropertyDataProvider
9
9
  import { CommonPropertyGridProps } from "./PropertyGridCommons";
10
10
  /** Properties for [[PropertyGrid]] React component
11
11
  * @public
12
+ * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
12
13
  */
13
14
  export interface PropertyGridProps extends CommonPropertyGridProps {
14
15
  /** Property data provider */
@@ -43,6 +44,7 @@ interface PropertyGridState {
43
44
  }
44
45
  /** PropertyGrid React component.
45
46
  * @public
47
+ * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
46
48
  */
47
49
  export declare class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> {
48
50
  private _dataChangesListenerDisposeFunc?;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAG7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAgB,MAAM,yBAAyB,CAAC;AAGhG,OAAO,EAAE,uBAAuB,EAAuB,MAAM,uBAAuB,CAAC;AAIrF;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAChE,6BAA6B;IAC7B,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,UAAU,8BAA8B;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAED;;GAEG;AACH,UAAU,iBAAiB;IACzB,sCAAsC;IACtC,UAAU,EAAE,8BAA8B,EAAE,CAAC;IAC7C,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,uEAAuE;IACvE,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACrF,OAAO,CAAC,+BAA+B,CAAC,CAAc;IACtD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,sBAAsB,CAAS;IAEvC,gBAAgB;gBACJ,KAAK,EAAE,iBAAiB;IASpC,gBAAgB;IACA,iBAAiB;IAQjC,gBAAgB;IACA,oBAAoB;IASpB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAiB/D,OAAO,CAAC,sBAAsB,CAG5B;YAEY,UAAU;IAyCxB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,2BAA2B,CAWjC;IAEF,OAAO,CAAC,iBAAiB;IAQzB,gBAAgB;IACA,MAAM;CA4CvB"}
1
+ {"version":3,"file":"PropertyGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAG7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAA8B,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAgB,MAAM,yBAAyB,CAAC;AAGhG,OAAO,EAAE,uBAAuB,EAAuB,MAAM,uBAAuB,CAAC;AAIrF;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,uBAAuB;IAChE,6BAA6B;IAC7B,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,UAAU,8BAA8B;IACtC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,QAAQ,EAAE,8BAA8B,EAAE,CAAC;CAC5C;AAED;;GAEG;AACH,UAAU,iBAAiB;IACzB,sCAAsC;IACtC,UAAU,EAAE,8BAA8B,EAAE,CAAC;IAC7C,mDAAmD;IACnD,WAAW,EAAE,WAAW,CAAC;IACzB,uEAAuE;IACvE,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IACrF,OAAO,CAAC,+BAA+B,CAAC,CAAc;IACtD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,sBAAsB,CAAS;IAEvC,gBAAgB;gBACJ,KAAK,EAAE,iBAAiB;IASpC,gBAAgB;IACA,iBAAiB;IAQjC,gBAAgB;IACA,oBAAoB;IASpB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAiB/D,OAAO,CAAC,sBAAsB,CAG5B;YAEY,UAAU;IAyCxB,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,SAAS,CAEf;IAEF,OAAO,CAAC,2BAA2B,CAWjC;IAEF,OAAO,CAAC,iBAAiB;IAQzB,gBAAgB;IACA,MAAM;CA4CvB"}
@@ -18,6 +18,7 @@ import { PropertyGridEventsRelatedPropsSupplier } from "./PropertyGridEventsRela
18
18
  import { PropertyList } from "./PropertyList";
19
19
  /** PropertyGrid React component.
20
20
  * @public
21
+ * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.
21
22
  */
22
23
  export class PropertyGrid extends React.Component {
23
24
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAwC,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AAC1I,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAA2B,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAwCjE;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAA+C;IAMrF,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,eAAU,GAAG,KAAK,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;QACzB,2BAAsB,GAAG,KAAK,CAAC;QAgD/B,2BAAsB,GAAG,GAAG,EAAE;YACpC,mEAAmE;YACnE,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC;QA+CM,cAAS,GAAG,CAAC,KAAa,EAAE,EAAE;YACpC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEM,gCAA2B,GAAG,CAAC,YAAoB,EAAE,EAAE;YAC7D,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAA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AC,YAAY,OACP,gBAAgB,EACpB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,QAAQ,EAC3C,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAC5C,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,4BAA4B,EAAE,KAAK,CAAC,4BAA4B,EAChE,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,oCAAoC,EAAE,KAAK,CAAC,oCAAoC,EAChF,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,GAClD,CACH,CACuC,CAC3C,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1C,6BAAK,SAAS,EAAC,qBAAqB,IAEhC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,EAAE,CAAC,CACjE,oBAAC,mBAAmB,OAAK,KAAK,EAAE,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,uBAAuB,GAAI,CAC5H,CAAC,CAEA,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./PropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport { produce } from \"immer\";\r\nimport * as React from \"react\";\r\nimport { DisposeFunc } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\r\nimport { DelayedSpinner } from \"../../common/DelayedSpinner\";\r\nimport { IPropertyDataProvider, PropertyCategory, PropertyData } from \"../PropertyDataProvider\";\r\nimport { ColumnResizeRelatedPropertyListProps, ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\nimport { PropertyList, PropertyListProps } from \"./PropertyList\";\r\n\r\n/** Properties for [[PropertyGrid]] React component\r\n * @public\r\n */\r\nexport interface PropertyGridProps extends CommonPropertyGridProps {\r\n /** Property data provider */\r\n dataProvider: IPropertyDataProvider;\r\n}\r\n\r\n/** Property Category in the [[PropertyGrid]] state\r\n * @public\r\n * @deprecated in 2.x. This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.\r\n */\r\nexport interface PropertyGridCategory {\r\n propertyCategory: PropertyCategory;\r\n propertyCount: number;\r\n properties: PropertyRecord[];\r\n}\r\n\r\ninterface CategorizedPropertyGridRecords {\r\n category: PropertyCategory;\r\n records: PropertyRecord[];\r\n children: CategorizedPropertyGridRecords[];\r\n}\r\n\r\n/** State of [[PropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface PropertyGridState {\r\n /** List of PropertyGrid categories */\r\n categories: CategorizedPropertyGridRecords[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** If property grid currently loading data, the loading start time */\r\n loadStart?: Date;\r\n /** Width of PropertyGrid */\r\n width: number;\r\n}\r\n\r\n/** PropertyGrid React component.\r\n * @public\r\n */\r\nexport class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> {\r\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\r\n private _isMounted = false;\r\n private _isInDataRequest = false;\r\n private _hasPendingDataRequest = false;\r\n\r\n /** @internal */\r\n constructor(props: PropertyGridProps) {\r\n super(props);\r\n this.state = {\r\n categories: [],\r\n orientation: this.getPreferredOrientation(),\r\n width: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc) {\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = undefined;\r\n }\r\n this._isMounted = false;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: PropertyGridProps) {\r\n if (this.props.dataProvider !== prevProps.dataProvider) {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc)\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\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.updateOrientation(this.state.width);\r\n }\r\n\r\n private _onPropertyDataChanged = () => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n };\r\n\r\n private async gatherData(): Promise<void> {\r\n if (this._isInDataRequest) {\r\n this._hasPendingDataRequest = true;\r\n return;\r\n }\r\n\r\n this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });\r\n\r\n this._isInDataRequest = true;\r\n let propertyData: PropertyData;\r\n try {\r\n propertyData = await this.props.dataProvider.getData();\r\n } finally {\r\n this._isInDataRequest = false;\r\n }\r\n\r\n if (!this._isMounted)\r\n return;\r\n\r\n if (this._hasPendingDataRequest) {\r\n this._hasPendingDataRequest = false;\r\n return this.gatherData();\r\n }\r\n\r\n this.setState((prevState) => {\r\n const buildCategoriesHierarchy = (newCategories: PropertyCategory[], stateCategories: CategorizedPropertyGridRecords[] | undefined) =>\r\n newCategories.map((category): CategorizedPropertyGridRecords => {\r\n const matchingStateCategory = findCategory(stateCategories ?? [], category.name, false);\r\n return {\r\n category: { ...category, expand: matchingStateCategory?.category?.expand ?? category.expand },\r\n records: propertyData.records[category.name] ?? [],\r\n children: buildCategoriesHierarchy(category.childCategories ?? [], matchingStateCategory?.children),\r\n };\r\n });\r\n return {\r\n categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),\r\n loadStart: undefined,\r\n };\r\n });\r\n }\r\n\r\n private getPreferredOrientation(): Orientation {\r\n return (this.props.orientation !== undefined) ? this.props.orientation : Orientation.Horizontal;\r\n }\r\n\r\n private _onResize = (width: number) => {\r\n this.updateOrientation(width);\r\n };\r\n\r\n private _onCategoryExpansionToggled = (categoryName: string) => {\r\n this.setState((state) => {\r\n return produce(state, (draft) => {\r\n const records = findCategory(draft.categories, categoryName, true);\r\n // istanbul ignore else\r\n if (records) {\r\n const category = records.category;\r\n category.expand = !category.expand;\r\n }\r\n });\r\n });\r\n };\r\n\r\n private updateOrientation(width: number): void {\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 || width !== this.state.width)\r\n this.setState({ orientation: currentOrientation, width });\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n if (this.state.loadStart) {\r\n return (\r\n <div className=\"components-property-grid-loader\">\r\n <DelayedSpinner loadStart={this.state.loadStart} size=\"large\" />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n >\r\n {(selectionContext) => (\r\n <div className={classnames(\"components-property-grid-wrapper\", this.props.className)} style={this.props.style}>\r\n <div className={classnames(\"components-property-grid\", \"components-smallEditor-host\")}>\r\n <div className=\"property-categories\">\r\n {\r\n this.state.categories.map((categorizedRecords: CategorizedPropertyGridRecords) => (\r\n <NestedCategoryBlock\r\n {...selectionContext}\r\n key={categorizedRecords.category.name}\r\n categorizedRecords={categorizedRecords}\r\n onCategoryExpansionToggled={this._onCategoryExpansionToggled}\r\n orientation={this.state.orientation}\r\n propertyValueRendererManager={this.props.propertyValueRendererManager}\r\n actionButtonRenderers={this.props.actionButtonRenderers}\r\n />\r\n ))\r\n }\r\n </div>\r\n </div>\r\n <ResizableContainerObserver onResize={this._onResize} />\r\n </div>\r\n )}\r\n </PropertyGridEventsRelatedPropsSupplier>\r\n );\r\n }\r\n}\r\n\r\nfunction findCategory(categories: CategorizedPropertyGridRecords[], lookupName: string, recurseIntoChildren: boolean): CategorizedPropertyGridRecords | undefined {\r\n for (const category of categories) {\r\n if (category.category.name === lookupName)\r\n return category;\r\n if (recurseIntoChildren) {\r\n const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);\r\n if (matchingChild)\r\n return matchingChild;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\ninterface NestedCategoryBlockProps extends Omit<PropertyListProps, (keyof ColumnResizeRelatedPropertyListProps) | \"properties\"> {\r\n categorizedRecords: CategorizedPropertyGridRecords;\r\n onCategoryExpansionToggled: (categoryName: string) => void;\r\n orientation: Orientation;\r\n}\r\nfunction NestedCategoryBlock(props: NestedCategoryBlockProps) {\r\n return (\r\n <PropertyCategoryBlock\r\n category={props.categorizedRecords.category}\r\n onExpansionToggled={props.onCategoryExpansionToggled}\r\n >\r\n {props.categorizedRecords.records.length ? (\r\n <ColumnResizingPropertyListPropsSupplier orientation={props.orientation}>\r\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\r\n <PropertyList\r\n {...partialListProps}\r\n orientation={props.orientation}\r\n category={props.categorizedRecords.category}\r\n properties={props.categorizedRecords.records}\r\n selectedPropertyKey={props.selectedPropertyKey}\r\n onPropertyClicked={props.onPropertyClicked}\r\n onPropertyRightClicked={props.onPropertyRightClicked}\r\n onPropertyContextMenu={props.onPropertyContextMenu}\r\n propertyValueRendererManager={props.propertyValueRendererManager}\r\n editingPropertyKey={props.editingPropertyKey}\r\n onEditCommit={props.onEditCommit}\r\n onEditCancel={props.onEditCancel}\r\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\r\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\r\n isPropertyRightClickSelectionEnabled={props.isPropertyRightClickSelectionEnabled}\r\n actionButtonRenderers={props.actionButtonRenderers}\r\n />\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>\r\n ) : undefined}\r\n {props.categorizedRecords.children.length ? (\r\n <div className=\"property-categories\">\r\n {\r\n props.categorizedRecords.children.map((categorizedChildRecords) => (\r\n <NestedCategoryBlock {...props} key={categorizedChildRecords.category.name} categorizedRecords={categorizedChildRecords} />\r\n ))\r\n }\r\n </div>\r\n ) : undefined}\r\n </PropertyCategoryBlock>\r\n );\r\n}\r\n"]}
1
+ {"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAwC,uCAAuC,EAAE,MAAM,2CAA2C,CAAC;AAC1I,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAA2B,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,YAAY,EAAqB,MAAM,gBAAgB,CAAC;AAyCjE;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAA+C;IAMrF,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QANP,eAAU,GAAG,KAAK,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;QACzB,2BAAsB,GAAG,KAAK,CAAC;QAgD/B,2BAAsB,GAAG,GAAG,EAAE;YACpC,mEAAmE;YACnE,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC;QA+CM,cAAS,GAAG,CAAC,KAAa,EAAE,EAAE;YACpC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEM,gCAA2B,GAAG,CAAC,YAAoB,EAAE,EAAE;YAC7D,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtB,OAAO,OAAO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B,EACpB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,QAAQ,EAC3C,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAC5C,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,4BAA4B,EAAE,KAAK,CAAC,4BAA4B,EAChE,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,oCAAoC,EAAE,KAAK,CAAC,oCAAoC,EAChF,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,GAClD,CACH,CACuC,CAC3C,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1C,6BAAK,SAAS,EAAC,qBAAqB,IAEhC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,EAAE,CAAC,CACjE,oBAAC,mBAAmB,OAAK,KAAK,EAAE,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,uBAAuB,GAAI,CAC5H,CAAC,CAEA,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\nimport \"./PropertyGrid.scss\";\r\nimport classnames from \"classnames\";\r\nimport { produce } from \"immer\";\r\nimport * as React from \"react\";\r\nimport { DisposeFunc } from \"@itwin/core-bentley\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\r\nimport { DelayedSpinner } from \"../../common/DelayedSpinner\";\r\nimport { IPropertyDataProvider, PropertyCategory, PropertyData } from \"../PropertyDataProvider\";\r\nimport { ColumnResizeRelatedPropertyListProps, ColumnResizingPropertyListPropsSupplier } from \"./ColumnResizingPropertyListPropsSupplier\";\r\nimport { PropertyCategoryBlock } from \"./PropertyCategoryBlock\";\r\nimport { CommonPropertyGridProps, PropertyGridCommons } from \"./PropertyGridCommons\";\r\nimport { PropertyGridEventsRelatedPropsSupplier } from \"./PropertyGridEventsRelatedPropsSupplier\";\r\nimport { PropertyList, PropertyListProps } from \"./PropertyList\";\r\n\r\n/** Properties for [[PropertyGrid]] React component\r\n * @public\r\n * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.\r\n */\r\nexport interface PropertyGridProps extends CommonPropertyGridProps {\r\n /** Property data provider */\r\n dataProvider: IPropertyDataProvider;\r\n}\r\n\r\n/** Property Category in the [[PropertyGrid]] state\r\n * @public\r\n * @deprecated in 2.x. This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.\r\n */\r\nexport interface PropertyGridCategory {\r\n propertyCategory: PropertyCategory;\r\n propertyCount: number;\r\n properties: PropertyRecord[];\r\n}\r\n\r\ninterface CategorizedPropertyGridRecords {\r\n category: PropertyCategory;\r\n records: PropertyRecord[];\r\n children: CategorizedPropertyGridRecords[];\r\n}\r\n\r\n/** State of [[PropertyGrid]] React component\r\n * @internal\r\n */\r\ninterface PropertyGridState {\r\n /** List of PropertyGrid categories */\r\n categories: CategorizedPropertyGridRecords[];\r\n /** Actual orientation used by the property grid */\r\n orientation: Orientation;\r\n /** If property grid currently loading data, the loading start time */\r\n loadStart?: Date;\r\n /** Width of PropertyGrid */\r\n width: number;\r\n}\r\n\r\n/** PropertyGrid React component.\r\n * @public\r\n * @deprecated in 3.x. Use [[VirtualizedPropertyGrid]] instead.\r\n */\r\nexport class PropertyGrid extends React.Component<PropertyGridProps, PropertyGridState> { // eslint-disable-line deprecation/deprecation\r\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\r\n private _isMounted = false;\r\n private _isInDataRequest = false;\r\n private _hasPendingDataRequest = false;\r\n\r\n /** @internal */\r\n constructor(props: PropertyGridProps) { // eslint-disable-line deprecation/deprecation\r\n super(props);\r\n this.state = {\r\n categories: [],\r\n orientation: this.getPreferredOrientation(),\r\n width: 0,\r\n };\r\n }\r\n\r\n /** @internal */\r\n public override componentDidMount() {\r\n this._isMounted = true;\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\r\n /** @internal */\r\n public override componentWillUnmount() {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc) {\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = undefined;\r\n }\r\n this._isMounted = false;\r\n }\r\n\r\n public override componentDidUpdate(prevProps: PropertyGridProps) { // eslint-disable-line deprecation/deprecation\r\n if (this.props.dataProvider !== prevProps.dataProvider) {\r\n // istanbul ignore else\r\n if (this._dataChangesListenerDisposeFunc)\r\n this._dataChangesListenerDisposeFunc();\r\n this._dataChangesListenerDisposeFunc = this.props.dataProvider.onDataChanged.addListener(this._onPropertyDataChanged);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n }\r\n\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.updateOrientation(this.state.width);\r\n }\r\n\r\n private _onPropertyDataChanged = () => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.gatherData();\r\n };\r\n\r\n private async gatherData(): Promise<void> {\r\n if (this._isInDataRequest) {\r\n this._hasPendingDataRequest = true;\r\n return;\r\n }\r\n\r\n this.setState((prev) => prev.loadStart ? null : { loadStart: new Date() });\r\n\r\n this._isInDataRequest = true;\r\n let propertyData: PropertyData;\r\n try {\r\n propertyData = await this.props.dataProvider.getData();\r\n } finally {\r\n this._isInDataRequest = false;\r\n }\r\n\r\n if (!this._isMounted)\r\n return;\r\n\r\n if (this._hasPendingDataRequest) {\r\n this._hasPendingDataRequest = false;\r\n return this.gatherData();\r\n }\r\n\r\n this.setState((prevState) => {\r\n const buildCategoriesHierarchy = (newCategories: PropertyCategory[], stateCategories: CategorizedPropertyGridRecords[] | undefined) =>\r\n newCategories.map((category): CategorizedPropertyGridRecords => {\r\n const matchingStateCategory = findCategory(stateCategories ?? [], category.name, false);\r\n return {\r\n category: { ...category, expand: matchingStateCategory?.category?.expand ?? category.expand },\r\n records: propertyData.records[category.name] ?? [],\r\n children: buildCategoriesHierarchy(category.childCategories ?? [], matchingStateCategory?.children),\r\n };\r\n });\r\n return {\r\n categories: buildCategoriesHierarchy(propertyData.categories, prevState.categories),\r\n loadStart: undefined,\r\n };\r\n });\r\n }\r\n\r\n private getPreferredOrientation(): Orientation {\r\n return (this.props.orientation !== undefined) ? this.props.orientation : Orientation.Horizontal;\r\n }\r\n\r\n private _onResize = (width: number) => {\r\n this.updateOrientation(width);\r\n };\r\n\r\n private _onCategoryExpansionToggled = (categoryName: string) => {\r\n this.setState((state) => {\r\n return produce(state, (draft) => {\r\n const records = findCategory(draft.categories, categoryName, true);\r\n // istanbul ignore else\r\n if (records) {\r\n const category = records.category;\r\n category.expand = !category.expand;\r\n }\r\n });\r\n });\r\n };\r\n\r\n private updateOrientation(width: number): void {\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 || width !== this.state.width)\r\n this.setState({ orientation: currentOrientation, width });\r\n }\r\n\r\n /** @internal */\r\n public override render() {\r\n if (this.state.loadStart) {\r\n return (\r\n <div className=\"components-property-grid-loader\">\r\n <DelayedSpinner loadStart={this.state.loadStart} size=\"large\" />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <PropertyGridEventsRelatedPropsSupplier\r\n isPropertySelectionEnabled={this.props.isPropertySelectionEnabled ?? false}\r\n isPropertySelectionOnRightClickEnabled={this.props.isPropertySelectionOnRightClickEnabled}\r\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\r\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\r\n onPropertyContextMenu={this.props.onPropertyContextMenu}\r\n onPropertyUpdated={this.props.onPropertyUpdated}\r\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\r\n >\r\n {(selectionContext) => (\r\n <div className={classnames(\"components-property-grid-wrapper\", this.props.className)} style={this.props.style}>\r\n <div className={classnames(\"components-property-grid\", \"components-smallEditor-host\")}>\r\n <div className=\"property-categories\">\r\n {\r\n this.state.categories.map((categorizedRecords: CategorizedPropertyGridRecords) => (\r\n <NestedCategoryBlock\r\n {...selectionContext}\r\n key={categorizedRecords.category.name}\r\n categorizedRecords={categorizedRecords}\r\n onCategoryExpansionToggled={this._onCategoryExpansionToggled}\r\n orientation={this.state.orientation}\r\n propertyValueRendererManager={this.props.propertyValueRendererManager}\r\n actionButtonRenderers={this.props.actionButtonRenderers}\r\n />\r\n ))\r\n }\r\n </div>\r\n </div>\r\n <ResizableContainerObserver onResize={this._onResize} />\r\n </div>\r\n )}\r\n </PropertyGridEventsRelatedPropsSupplier>\r\n );\r\n }\r\n}\r\n\r\nfunction findCategory(categories: CategorizedPropertyGridRecords[], lookupName: string, recurseIntoChildren: boolean): CategorizedPropertyGridRecords | undefined {\r\n for (const category of categories) {\r\n if (category.category.name === lookupName)\r\n return category;\r\n if (recurseIntoChildren) {\r\n const matchingChild = findCategory(category.children, lookupName, recurseIntoChildren);\r\n if (matchingChild)\r\n return matchingChild;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\ninterface NestedCategoryBlockProps extends Omit<PropertyListProps, (keyof ColumnResizeRelatedPropertyListProps) | \"properties\"> {\r\n categorizedRecords: CategorizedPropertyGridRecords;\r\n onCategoryExpansionToggled: (categoryName: string) => void;\r\n orientation: Orientation;\r\n}\r\nfunction NestedCategoryBlock(props: NestedCategoryBlockProps) {\r\n return (\r\n <PropertyCategoryBlock\r\n category={props.categorizedRecords.category}\r\n onExpansionToggled={props.onCategoryExpansionToggled}\r\n >\r\n {props.categorizedRecords.records.length ? (\r\n <ColumnResizingPropertyListPropsSupplier orientation={props.orientation}>\r\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\r\n <PropertyList\r\n {...partialListProps}\r\n orientation={props.orientation}\r\n category={props.categorizedRecords.category}\r\n properties={props.categorizedRecords.records}\r\n selectedPropertyKey={props.selectedPropertyKey}\r\n onPropertyClicked={props.onPropertyClicked}\r\n onPropertyRightClicked={props.onPropertyRightClicked}\r\n onPropertyContextMenu={props.onPropertyContextMenu}\r\n propertyValueRendererManager={props.propertyValueRendererManager}\r\n editingPropertyKey={props.editingPropertyKey}\r\n onEditCommit={props.onEditCommit}\r\n onEditCancel={props.onEditCancel}\r\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\r\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\r\n isPropertyRightClickSelectionEnabled={props.isPropertyRightClickSelectionEnabled}\r\n actionButtonRenderers={props.actionButtonRenderers}\r\n />\r\n )}\r\n </ColumnResizingPropertyListPropsSupplier>\r\n ) : undefined}\r\n {props.categorizedRecords.children.length ? (\r\n <div className=\"property-categories\">\r\n {\r\n props.categorizedRecords.children.map((categorizedChildRecords) => (\r\n <NestedCategoryBlock {...props} key={categorizedChildRecords.category.name} categorizedRecords={categorizedChildRecords} />\r\n ))\r\n }\r\n </div>\r\n ) : undefined}\r\n </PropertyCategoryBlock>\r\n );\r\n}\r\n"]}
@@ -43,22 +43,17 @@ export interface CommonPropertyGridProps extends CommonProps {
43
43
  isPropertySelectionOnRightClickEnabled?: boolean;
44
44
  /** Callback to property selection */
45
45
  onPropertySelectionChanged?: (property: PropertyRecord) => void;
46
- /** Enables/disables property editing
47
- * @beta */
46
+ /** Enables/disables property editing */
48
47
  isPropertyEditingEnabled?: boolean;
49
- /** Callback for when properties are being edited
50
- * @beta */
48
+ /** Callback for when properties are being edited */
51
49
  onPropertyEditing?: (args: PropertyEditingArgs, category: PropertyCategory) => void;
52
- /** Callback for when properties are updated
53
- * @beta */
50
+ /** Callback for when properties are updated */
54
51
  onPropertyUpdated?: (args: PropertyUpdatedArgs, category: PropertyCategory) => Promise<boolean>;
55
52
  /** Custom property value renderer manager */
56
53
  propertyValueRendererManager?: PropertyValueRendererManager;
57
- /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false.
58
- * @beta */
54
+ /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false. */
59
55
  isOrientationFixed?: boolean;
60
- /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300.
61
- * @beta */
56
+ /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300. */
62
57
  horizontalOrientationMinWidth?: number;
63
58
  /** Minimum allowed label column width, after which resizing stops */
64
59
  minLabelWidth?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridCommons.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,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;IAC7C,4BAA4B,CAAC,EAAE,4BAA4B,CAAC;IAE5D;eACW;IACX,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;eACW;IACX,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAEvC,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,EAAE,CAAC;CAChD;AAED,gBAAgB;AAChB,qBAAa,mBAAmB;WAChB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,WAAW,EAAE,kBAAkB,CAAC,EAAE,OAAO,EAAE,6BAA6B,CAAC,EAAE,MAAM,GAAG,WAAW;IAazK;;;OAGG;WACW,eAAe,CAAC,IAAI,EAAE,MAAM;IAiB1C;;;OAGG;IACH,OAAc,QAAQ,UAAW,MAAM,KAAG,MAAM;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAI7E;CACH"}
1
+ {"version":3,"file":"PropertyGridCommons.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,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,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,EAAE,CAAC;CAChD;AAED,gBAAgB;AAChB,qBAAa,mBAAmB;WAChB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,WAAW,EAAE,kBAAkB,CAAC,EAAE,OAAO,EAAE,6BAA6B,CAAC,EAAE,MAAM,GAAG,WAAW;IAazK;;;OAGG;WACW,eAAe,CAAC,IAAI,EAAE,MAAM;IAiB1C;;;OAGG;IACH,OAAc,QAAQ,UAAW,MAAM,KAAG,MAAM;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAI7E;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/component/PropertyGridCommons.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAiFhD,gBAAgB;AAChB,MAAM,OAAO,mBAAmB;IACvB,MAAM,CAAC,qBAAqB,CAAC,KAAa,EAAE,oBAAkC,EAAE,kBAA4B,EAAE,6BAAsC;QACzJ,MAAM,WAAW,GAAG,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,WAAW,CAAC,UAAU,CAAC;QACnE,IAAI,kBAAkB;YACpB,OAAO,WAAW,CAAC;QAErB,6BAA6B,GAAG,6BAA6B,aAA7B,6BAA6B,cAA7B,6BAA6B,GAAI,GAAG,CAAC;QACrE,wCAAwC;QACxC,IAAI,KAAK,GAAG,6BAA6B;YACvC,OAAO,WAAW,CAAC,QAAQ,CAAC;QAE9B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC;YACxB,OAAO;QACT,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,uBAAuB;QACvB,IAAI,SAAS,IAAI,SAAS,CAAC,GAAG,EAAE;YAC9B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK;gBAC9D,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC;iBAC3B;gBACH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;gBACxD,IAAI,UAAU;oBACZ,UAAU,CAAC,KAAK,EAAE,CAAC;aACtB;SACF;IACH,CAAC;;AAED;;;GAGG;AACW,4BAAQ,GAAG,CAAC,KAAa,EAAyC,EAAE;IAChF,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAA8C,EAAE,EAAE;QAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,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/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\n\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Orientation } from \"@itwin/core-react\";\r\nimport { matchLinks } from \"../../common/Links\";\r\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\r\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\r\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\r\nimport { PropertyCategory } from \"../PropertyDataProvider\";\r\n\r\n/** Arguments for the Property Editing event callback\r\n * @public\r\n */\r\nexport interface PropertyEditingArgs {\r\n /** PropertyRecord being edited */\r\n propertyRecord: PropertyRecord;\r\n /** Unique key of currently edited property */\r\n propertyKey?: string;\r\n}\r\n\r\n/** Arguments for `PropertyGridProps.onPropertyContextMenu` callback\r\n * @public\r\n */\r\nexport interface PropertyGridContextMenuArgs {\r\n /** PropertyRecord being edited */\r\n propertyRecord: PropertyRecord;\r\n /** An event which caused the context menu callback */\r\n event: React.MouseEvent;\r\n}\r\n\r\n/**\r\n * Common Property Grid Props to be used by Property Grid Variants\r\n * @public\r\n */\r\nexport interface CommonPropertyGridProps extends CommonProps {\r\n /** Grid orientation. When not defined, it is chosen automatically based on width of the grid. */\r\n orientation?: Orientation;\r\n\r\n /** Enables/disables property hovering effect */\r\n isPropertyHoverEnabled?: boolean;\r\n\r\n /** Called to show a context menu when properties are right-clicked */\r\n onPropertyContextMenu?: (args: PropertyGridContextMenuArgs) => void;\r\n\r\n /** Enables/disables property selection */\r\n isPropertySelectionEnabled?: boolean;\r\n /** Enables/disables property selection with right click */\r\n isPropertySelectionOnRightClickEnabled?: boolean;\r\n /** Callback to property selection */\r\n onPropertySelectionChanged?: (property: PropertyRecord) => void;\r\n\r\n /** Enables/disables property editing\r\n * @beta */\r\n isPropertyEditingEnabled?: boolean;\r\n /** Callback for when properties are being edited\r\n * @beta */\r\n onPropertyEditing?: (args: PropertyEditingArgs, category: PropertyCategory) => void;\r\n /** Callback for when properties are updated\r\n * @beta */\r\n onPropertyUpdated?: (args: PropertyUpdatedArgs, category: PropertyCategory) => Promise<boolean>;\r\n\r\n /** Custom property value renderer manager */\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n\r\n /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false.\r\n * @beta */\r\n isOrientationFixed?: boolean;\r\n /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300.\r\n * @beta */\r\n horizontalOrientationMinWidth?: number;\r\n\r\n /** Minimum allowed label column width, after which resizing stops */\r\n minLabelWidth?: number;\r\n /** Minimum allowed value column width, after which resizing stops */\r\n minValueWidth?: number;\r\n /** Fixed action button column width */\r\n actionButtonWidth?: number;\r\n\r\n /**\r\n * Array of action button renderers. Each renderer is called for each property and can decide\r\n * to render an action button for the property or not.\r\n */\r\n actionButtonRenderers?: ActionButtonRenderer[];\r\n}\r\n\r\n/** @internal */\r\nexport class PropertyGridCommons {\r\n public static getCurrentOrientation(width: number, preferredOrientation?: Orientation, isOrientationFixed?: boolean, horizontalOrientationMinWidth?: number): Orientation {\r\n const orientation = preferredOrientation ?? Orientation.Horizontal;\r\n if (isOrientationFixed)\r\n return orientation;\r\n\r\n horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;\r\n // Switch to Vertical if width too small\r\n if (width < horizontalOrientationMinWidth)\r\n return Orientation.Vertical;\r\n\r\n return orientation;\r\n }\r\n\r\n /**\r\n * Helper method to handle link clicks\r\n * @internal\r\n */\r\n public static handleLinkClick(text: string) {\r\n const linksArray = matchLinks(text);\r\n if (linksArray.length <= 0)\r\n return;\r\n const foundLink = linksArray[0];\r\n // istanbul ignore else\r\n if (foundLink && foundLink.url) {\r\n if (foundLink.schema === \"mailto:\" || foundLink.schema === \"pw:\")\r\n location.href = foundLink.url;\r\n else {\r\n const windowOpen = window.open(foundLink.url, \"_blank\");\r\n if (windowOpen)\r\n windowOpen.focus();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * A helper method to get links from string.\r\n * @internal\r\n */\r\n public static getLinks = (value: string): Array<{ start: number, end: number }> => {\r\n return matchLinks(value).map((linkInfo: { index: number, lastIndex: number }) => {\r\n return { start: linkInfo.index, end: linkInfo.lastIndex };\r\n });\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"PropertyGridCommons.js","sourceRoot":"","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H,CAAC;;AAED;;;GAGG;AACW,4BAAQ,GAAG,CAAC,KAAa,EAAyC,EAAE;IAChF,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,QAA8C,EAAE,EAAE;QAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,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/** @packageDocumentation\r\n * @module PropertyGrid\r\n */\r\n\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, Orientation } from \"@itwin/core-react\";\r\nimport { matchLinks } from \"../../common/Links\";\r\nimport { PropertyUpdatedArgs } from \"../../editors/EditorContainer\";\r\nimport { ActionButtonRenderer } from \"../../properties/renderers/ActionButtonRenderer\";\r\nimport { PropertyValueRendererManager } from \"../../properties/ValueRendererManager\";\r\nimport { PropertyCategory } from \"../PropertyDataProvider\";\r\n\r\n/** Arguments for the Property Editing event callback\r\n * @public\r\n */\r\nexport interface PropertyEditingArgs {\r\n /** PropertyRecord being edited */\r\n propertyRecord: PropertyRecord;\r\n /** Unique key of currently edited property */\r\n propertyKey?: string;\r\n}\r\n\r\n/** Arguments for `PropertyGridProps.onPropertyContextMenu` callback\r\n * @public\r\n */\r\nexport interface PropertyGridContextMenuArgs {\r\n /** PropertyRecord being edited */\r\n propertyRecord: PropertyRecord;\r\n /** An event which caused the context menu callback */\r\n event: React.MouseEvent;\r\n}\r\n\r\n/**\r\n * Common Property Grid Props to be used by Property Grid Variants\r\n * @public\r\n */\r\nexport interface CommonPropertyGridProps extends CommonProps {\r\n /** Grid orientation. When not defined, it is chosen automatically based on width of the grid. */\r\n orientation?: Orientation;\r\n\r\n /** Enables/disables property hovering effect */\r\n isPropertyHoverEnabled?: boolean;\r\n\r\n /** Called to show a context menu when properties are right-clicked */\r\n onPropertyContextMenu?: (args: PropertyGridContextMenuArgs) => void;\r\n\r\n /** Enables/disables property selection */\r\n isPropertySelectionEnabled?: boolean;\r\n /** Enables/disables property selection with right click */\r\n isPropertySelectionOnRightClickEnabled?: boolean;\r\n /** Callback to property selection */\r\n onPropertySelectionChanged?: (property: PropertyRecord) => void;\r\n\r\n /** Enables/disables property editing */\r\n isPropertyEditingEnabled?: boolean;\r\n /** Callback for when properties are being edited */\r\n onPropertyEditing?: (args: PropertyEditingArgs, category: PropertyCategory) => void;\r\n /** Callback for when properties are updated */\r\n onPropertyUpdated?: (args: PropertyUpdatedArgs, category: PropertyCategory) => Promise<boolean>;\r\n\r\n /** Custom property value renderer manager */\r\n propertyValueRendererManager?: PropertyValueRendererManager;\r\n\r\n /** Indicates whether the orientation is fixed and does not auto-switch to Vertical when the width is too narrow. Defaults to false. */\r\n isOrientationFixed?: boolean;\r\n /** The minimum width before the auto-switch to Vertical when the width is too narrow. Defaults to 300. */\r\n horizontalOrientationMinWidth?: number;\r\n\r\n /** Minimum allowed label column width, after which resizing stops */\r\n minLabelWidth?: number;\r\n /** Minimum allowed value column width, after which resizing stops */\r\n minValueWidth?: number;\r\n /** Fixed action button column width */\r\n actionButtonWidth?: number;\r\n\r\n /**\r\n * Array of action button renderers. Each renderer is called for each property and can decide\r\n * to render an action button for the property or not.\r\n */\r\n actionButtonRenderers?: ActionButtonRenderer[];\r\n}\r\n\r\n/** @internal */\r\nexport class PropertyGridCommons {\r\n public static getCurrentOrientation(width: number, preferredOrientation?: Orientation, isOrientationFixed?: boolean, horizontalOrientationMinWidth?: number): Orientation {\r\n const orientation = preferredOrientation ?? Orientation.Horizontal;\r\n if (isOrientationFixed)\r\n return orientation;\r\n\r\n horizontalOrientationMinWidth = horizontalOrientationMinWidth ?? 300;\r\n // Switch to Vertical if width too small\r\n if (width < horizontalOrientationMinWidth)\r\n return Orientation.Vertical;\r\n\r\n return orientation;\r\n }\r\n\r\n /**\r\n * Helper method to handle link clicks\r\n * @internal\r\n */\r\n public static handleLinkClick(text: string) {\r\n const linksArray = matchLinks(text);\r\n if (linksArray.length <= 0)\r\n return;\r\n const foundLink = linksArray[0];\r\n // istanbul ignore else\r\n if (foundLink && foundLink.url) {\r\n if (foundLink.schema === \"mailto:\" || foundLink.schema === \"pw:\")\r\n location.href = foundLink.url;\r\n else {\r\n const windowOpen = window.open(foundLink.url, \"_blank\");\r\n if (windowOpen)\r\n windowOpen.focus();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * A helper method to get links from string.\r\n * @internal\r\n */\r\n public static getLinks = (value: string): Array<{ start: number, end: number }> => {\r\n return matchLinks(value).map((linkInfo: { index: number, lastIndex: number }) => {\r\n return { start: linkInfo.index, end: linkInfo.lastIndex };\r\n });\r\n };\r\n}\r\n"]}
@@ -18,7 +18,7 @@ import { PropertyCategoryRendererManager } from "../PropertyCategoryRendererMana
18
18
  import { IPropertyDataProvider, PropertyCategory } from "../PropertyDataProvider";
19
19
  import { CommonPropertyGridProps } from "./PropertyGridCommons";
20
20
  /** Properties for [[VirtualizedPropertyGrid]] React component
21
- * @beta
21
+ * @public
22
22
  */
23
23
  export interface VirtualizedPropertyGridProps extends CommonPropertyGridProps {
24
24
  model: IPropertyGridModel;
@@ -59,7 +59,7 @@ export interface PropertyGridInternalContext {
59
59
  }
60
60
  /**
61
61
  * Context of the surrounding [VirtualizedPropertyGrid]($components-react) component.
62
- * @beta
62
+ * @public
63
63
  */
64
64
  export interface VirtualizedPropertyGridContext {
65
65
  orientation: Orientation;
@@ -91,7 +91,7 @@ export interface VirtualizedPropertyGridContext {
91
91
  }
92
92
  /**
93
93
  * VirtualizedPropertyGrid React component.
94
- * @beta
94
+ * @public
95
95
  */
96
96
  export declare class VirtualizedPropertyGrid extends React.Component<VirtualizedPropertyGridProps, VirtualizedPropertyGridState> {
97
97
  private _listRef;
@@ -27,7 +27,7 @@ import { PropertyGridEventsRelatedPropsSupplier } from "./PropertyGridEventsRela
27
27
  const [PropertyGridInternalContextProvider, _PropertyGridInternalContextConsumer, usePropertyGridInternalContext,] = createContextWithMandatoryProvider("PropertyGridInternalContext");
28
28
  /**
29
29
  * VirtualizedPropertyGrid React component.
30
- * @beta
30
+ * @public
31
31
  */
32
32
  export class VirtualizedPropertyGrid extends React.Component {
33
33
  /** @internal */