@itwin/grouping-mapping-widget 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/lib/cjs/widget/components/ConfirmMappingsImport.js +1 -1
  2. package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
  3. package/lib/cjs/widget/components/GroupAction.js +50 -66
  4. package/lib/cjs/widget/components/GroupAction.js.map +1 -1
  5. package/lib/cjs/widget/components/GroupAction.scss +0 -18
  6. package/lib/cjs/widget/components/GroupDetails.d.ts +13 -0
  7. package/lib/cjs/widget/components/GroupDetails.js +34 -0
  8. package/lib/cjs/widget/components/GroupDetails.js.map +1 -0
  9. package/lib/cjs/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  10. package/lib/cjs/widget/components/GroupDetailsActionPanel.js +19 -0
  11. package/lib/cjs/widget/components/GroupDetailsActionPanel.js.map +1 -0
  12. package/lib/cjs/widget/components/GroupDetailsStep.d.ts +13 -0
  13. package/lib/cjs/widget/components/GroupDetailsStep.js +25 -0
  14. package/lib/cjs/widget/components/GroupDetailsStep.js.map +1 -0
  15. package/lib/cjs/widget/components/GroupDetailsStep.scss +11 -0
  16. package/lib/cjs/widget/components/Grouping.js +1 -2
  17. package/lib/cjs/widget/components/Grouping.js.map +1 -1
  18. package/lib/cjs/widget/components/GroupingMapping.js +1 -1
  19. package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
  20. package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +1 -2
  21. package/lib/cjs/widget/components/GroupingMappingHeader.js +9 -2
  22. package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -1
  23. package/lib/cjs/widget/components/Mapping.js +2 -3
  24. package/lib/cjs/widget/components/Mapping.js.map +1 -1
  25. package/lib/cjs/widget/components/MappingAction.js +1 -1
  26. package/lib/cjs/widget/components/MappingAction.js.map +1 -1
  27. package/lib/cjs/widget/components/MappingImportWizardModal.js +1 -1
  28. package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
  29. package/lib/cjs/widget/components/PropertyAction.d.ts +8 -0
  30. package/lib/cjs/widget/components/PropertyAction.js +100 -0
  31. package/lib/cjs/widget/components/PropertyAction.js.map +1 -0
  32. package/lib/cjs/widget/components/PropertyAction.scss +9 -0
  33. package/lib/cjs/widget/components/QueryBuilder.d.ts +1 -1
  34. package/lib/cjs/widget/components/QueryBuilder.js +4 -4
  35. package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
  36. package/lib/cjs/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  37. package/lib/cjs/widget/components/QueryBuilderActionPanel.js +17 -0
  38. package/lib/cjs/widget/components/QueryBuilderActionPanel.js.map +1 -0
  39. package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +11 -0
  40. package/lib/cjs/widget/components/QueryBuilderCustomUI.js +27 -0
  41. package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -0
  42. package/lib/cjs/widget/components/QueryBuilderStep.d.ts +16 -0
  43. package/lib/cjs/widget/components/QueryBuilderStep.js +30 -0
  44. package/lib/cjs/widget/components/QueryBuilderStep.js.map +1 -0
  45. package/lib/cjs/widget/components/QueryBuilderStep.scss +18 -0
  46. package/lib/cjs/widget/components/SelectMappings.js +1 -1
  47. package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
  48. package/lib/cjs/widget/components/StatusIcon.d.ts +15 -0
  49. package/lib/cjs/widget/components/StatusIcon.js +26 -0
  50. package/lib/cjs/widget/components/StatusIcon.js.map +1 -0
  51. package/lib/cjs/widget/components/StatusIcon.scss +26 -0
  52. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  53. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js +0 -2
  54. package/lib/cjs/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  55. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  56. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js +51 -32
  57. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  58. package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  59. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +1 -1
  60. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  61. package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  62. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +1 -1
  63. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  64. package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  65. package/lib/cjs/widget/components/utils.d.ts +1 -1
  66. package/lib/cjs/widget/components/utils.js.map +1 -1
  67. package/lib/esm/widget/components/ConfirmMappingsImport.js +1 -1
  68. package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
  69. package/lib/esm/widget/components/GroupAction.js +53 -69
  70. package/lib/esm/widget/components/GroupAction.js.map +1 -1
  71. package/lib/esm/widget/components/GroupAction.scss +0 -18
  72. package/lib/esm/widget/components/GroupDetails.d.ts +13 -0
  73. package/lib/esm/widget/components/GroupDetails.js +27 -0
  74. package/lib/esm/widget/components/GroupDetails.js.map +1 -0
  75. package/lib/esm/widget/components/GroupDetailsActionPanel.d.ts +8 -0
  76. package/lib/esm/widget/components/GroupDetailsActionPanel.js +12 -0
  77. package/lib/esm/widget/components/GroupDetailsActionPanel.js.map +1 -0
  78. package/lib/esm/widget/components/GroupDetailsStep.d.ts +13 -0
  79. package/lib/esm/widget/components/GroupDetailsStep.js +18 -0
  80. package/lib/esm/widget/components/GroupDetailsStep.js.map +1 -0
  81. package/lib/esm/widget/components/GroupDetailsStep.scss +11 -0
  82. package/lib/esm/widget/components/Grouping.js +1 -2
  83. package/lib/esm/widget/components/Grouping.js.map +1 -1
  84. package/lib/esm/widget/components/GroupingMapping.js +1 -1
  85. package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
  86. package/lib/esm/widget/components/GroupingMappingHeader.d.ts +1 -2
  87. package/lib/esm/widget/components/GroupingMappingHeader.js +9 -2
  88. package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -1
  89. package/lib/esm/widget/components/Mapping.js +2 -3
  90. package/lib/esm/widget/components/Mapping.js.map +1 -1
  91. package/lib/esm/widget/components/MappingAction.js +1 -1
  92. package/lib/esm/widget/components/MappingAction.js.map +1 -1
  93. package/lib/esm/widget/components/MappingImportWizardModal.js +1 -1
  94. package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
  95. package/lib/esm/widget/components/PropertyAction.d.ts +8 -0
  96. package/lib/esm/widget/components/PropertyAction.js +77 -0
  97. package/lib/esm/widget/components/PropertyAction.js.map +1 -0
  98. package/lib/esm/widget/components/PropertyAction.scss +9 -0
  99. package/lib/esm/widget/components/QueryBuilder.d.ts +1 -1
  100. package/lib/esm/widget/components/QueryBuilder.js +4 -4
  101. package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
  102. package/lib/esm/widget/components/QueryBuilderActionPanel.d.ts +6 -0
  103. package/lib/esm/widget/components/QueryBuilderActionPanel.js +10 -0
  104. package/lib/esm/widget/components/QueryBuilderActionPanel.js.map +1 -0
  105. package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +11 -0
  106. package/lib/esm/widget/components/QueryBuilderCustomUI.js +20 -0
  107. package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -0
  108. package/lib/esm/widget/components/QueryBuilderStep.d.ts +16 -0
  109. package/lib/esm/widget/components/QueryBuilderStep.js +23 -0
  110. package/lib/esm/widget/components/QueryBuilderStep.js.map +1 -0
  111. package/lib/esm/widget/components/QueryBuilderStep.scss +18 -0
  112. package/lib/esm/widget/components/SelectMappings.js +1 -1
  113. package/lib/esm/widget/components/SelectMappings.js.map +1 -1
  114. package/lib/esm/widget/components/StatusIcon.d.ts +15 -0
  115. package/lib/esm/widget/components/StatusIcon.js +19 -0
  116. package/lib/esm/widget/components/StatusIcon.js.map +1 -0
  117. package/lib/esm/widget/components/StatusIcon.scss +26 -0
  118. package/lib/esm/widget/components/context/PropertyGridWrapperContext.d.ts +1 -3
  119. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js +0 -2
  120. package/lib/esm/widget/components/context/PropertyGridWrapperContext.js.map +1 -1
  121. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +1 -1
  122. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js +53 -34
  123. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -1
  124. package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.scss +25 -17
  125. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
  126. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
  127. package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.scss +1 -0
  128. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +2 -2
  129. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
  130. package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.scss +1 -0
  131. package/lib/esm/widget/components/utils.d.ts +1 -1
  132. package/lib/esm/widget/components/utils.js.map +1 -1
  133. package/package.json +1 -1
  134. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  135. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -91
  136. package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  137. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  138. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -62
  139. package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  140. package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  141. package/lib/cjs/widget/components/property-grid/PropertyGrid.js +0 -198
  142. package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +0 -1
  143. package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +0 -71
  144. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  145. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +0 -77
  146. package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  147. package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +0 -69
  148. package/lib/cjs/widget/components/property-grid/PropertyList.js +0 -87
  149. package/lib/cjs/widget/components/property-grid/PropertyList.js.map +0 -1
  150. package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +0 -92
  151. package/lib/cjs/widget/components/property-grid/PropertyRender.js +0 -109
  152. package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +0 -1
  153. package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +0 -22
  154. package/lib/cjs/widget/components/property-grid/PropertyView.js +0 -232
  155. package/lib/cjs/widget/components/property-grid/PropertyView.js.map +0 -1
  156. package/lib/cjs/widget/components/property-grid/PropertyView.scss +0 -77
  157. package/lib/cjs/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  158. package/lib/cjs/widget/components/property-grid/countMatchesInString.js +0 -32
  159. package/lib/cjs/widget/components/property-grid/countMatchesInString.js.map +0 -1
  160. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  161. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js +0 -65
  162. package/lib/cjs/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
  163. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +0 -32
  164. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +0 -68
  165. package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +0 -1
  166. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +0 -26
  167. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +0 -39
  168. package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +0 -1
  169. package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +0 -67
  170. package/lib/esm/widget/components/property-grid/PropertyGrid.js +0 -172
  171. package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +0 -1
  172. package/lib/esm/widget/components/property-grid/PropertyGrid.scss +0 -71
  173. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +0 -23
  174. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +0 -54
  175. package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +0 -1
  176. package/lib/esm/widget/components/property-grid/PropertyList.d.ts +0 -69
  177. package/lib/esm/widget/components/property-grid/PropertyList.js +0 -60
  178. package/lib/esm/widget/components/property-grid/PropertyList.js.map +0 -1
  179. package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +0 -92
  180. package/lib/esm/widget/components/property-grid/PropertyRender.js +0 -86
  181. package/lib/esm/widget/components/property-grid/PropertyRender.js.map +0 -1
  182. package/lib/esm/widget/components/property-grid/PropertyView.d.ts +0 -22
  183. package/lib/esm/widget/components/property-grid/PropertyView.js +0 -209
  184. package/lib/esm/widget/components/property-grid/PropertyView.js.map +0 -1
  185. package/lib/esm/widget/components/property-grid/PropertyView.scss +0 -77
  186. package/lib/esm/widget/components/property-grid/countMatchesInString.d.ts +0 -8
  187. package/lib/esm/widget/components/property-grid/countMatchesInString.js +0 -28
  188. package/lib/esm/widget/components/property-grid/countMatchesInString.js.map +0 -1
  189. package/lib/esm/widget/components/property-grid/createNewDisplayValue.d.ts +0 -10
  190. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js +0 -42
  191. package/lib/esm/widget/components/property-grid/createNewDisplayValue.js.map +0 -1
@@ -1,42 +0,0 @@
1
- import { HighlightedText, PropertyContainerType, PropertyValueRendererManager } from "@itwin/components-react";
2
- import { CommonPropertyRenderer } from "@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer";
3
- import { Orientation } from "@itwin/core-react";
4
- import * as React from "react";
5
- import { countMatchesInString } from "./countMatchesInString";
6
- function createHighlightCallback(highlight, propertyRecord) {
7
- var _a;
8
- const activeMatch = highlight.activeHighlight;
9
- const propertyName = activeMatch === null || activeMatch === void 0 ? void 0 : activeMatch.highlightedItemIdentifier;
10
- const matchIndex = (_a = activeMatch === null || activeMatch === void 0 ? void 0 : activeMatch.highlightIndex) !== null && _a !== void 0 ? _a : 0;
11
- let labelMatches;
12
- if (highlight.applyOnLabel) {
13
- labelMatches = countMatchesInString(propertyRecord.property.displayLabel.toLowerCase(), highlight.highlightedText);
14
- }
15
- else {
16
- labelMatches = 0;
17
- }
18
- const activeMatchIndex = (propertyRecord.property.name === propertyName) && ((matchIndex - labelMatches) >= 0) ? (matchIndex - labelMatches) : undefined;
19
- const highlightCallback = (text) => (React.createElement(HighlightedText, { text: text, activeMatchIndex: activeMatchIndex, searchText: highlight.highlightedText }));
20
- return highlightCallback;
21
- }
22
- export function createNewDisplayValue(orientation, propertyRecord, indentation, propertyValueRendererManager, isExpanded, onExpansionToggled, onHeightChanged, highlight) {
23
- const highlightCallback = (highlight === null || highlight === void 0 ? void 0 : highlight.applyOnValue) ? (createHighlightCallback(highlight, propertyRecord)) : undefined;
24
- const rendererContext = {
25
- orientation,
26
- containerType: PropertyContainerType.PropertyPane,
27
- isExpanded,
28
- onExpansionToggled,
29
- onHeightChanged,
30
- textHighlighter: highlightCallback,
31
- };
32
- let displayValue;
33
- if (propertyValueRendererManager)
34
- displayValue = propertyValueRendererManager.render(propertyRecord, rendererContext);
35
- else
36
- displayValue = PropertyValueRendererManager.defaultManager.render(propertyRecord, rendererContext);
37
- // Align value with label if orientation is vertical
38
- if (orientation === Orientation.Vertical)
39
- displayValue = React.createElement("span", { style: { paddingLeft: CommonPropertyRenderer.getLabelOffset(indentation, orientation) } }, displayValue);
40
- return displayValue;
41
- }
42
- //# sourceMappingURL=createNewDisplayValue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createNewDisplayValue.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/createNewDisplayValue.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,MAAM,8FAA8F,CAAC;AACtI,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,SAAS,uBAAuB,CAAC,SAAiE,EAAE,cAA8B;;IAChI,MAAM,WAAW,GAAG,SAAS,CAAC,eAAe,CAAC;IAC9C,MAAM,YAAY,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yBAAyB,CAAC;IAC5D,MAAM,UAAU,GAAG,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAAI,CAAC,CAAC;IACpD,IAAI,YAAoB,CAAC;IAEzB,IAAI,SAAS,CAAC,YAAY,EAAE;QAC1B,YAAY,GAAG,oBAAoB,CAAC,cAAc,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;KACpH;SAAM;QACL,YAAY,GAAG,CAAC,CAAC;KAClB;IAED,MAAM,gBAAgB,GAAG,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACzJ,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,oBAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,CAAC,eAAe,GAAI,CAAC,CAAC;IAEzJ,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,WAAwB,EACxB,cAA8B,EAC9B,WAAoB,EACpB,4BAA2D,EAC3D,UAAoB,EACpB,kBAA+B,EAC/B,eAA6C,EAC7C,SAAyF;IAEzF,MAAM,iBAAiB,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,YAAY,EAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrH,MAAM,eAAe,GAAiC;QACpD,WAAW;QACX,aAAa,EAAE,qBAAqB,CAAC,YAAY;QACjD,UAAU;QACV,kBAAkB;QAClB,eAAe;QACf,eAAe,EAAE,iBAAiB;KACnC,CAAC;IAEF,IAAI,YAAyC,CAAC;IAC9C,IAAI,4BAA4B;QAC9B,YAAY,GAAG,4BAA4B,CAAC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;;QAEpF,YAAY,GAAG,4BAA4B,CAAC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;IAErG,oDAAoD;IACpD,IAAI,WAAW,KAAK,WAAW,CAAC,QAAQ;QACtC,YAAY,GAAG,8BAAM,KAAK,EAAE,EAAE,WAAW,EAAE,sBAAsB,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,IAAG,YAAY,CAAQ,CAAC;IAEtI,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type { HighlightingComponentProps, PropertyValueRendererContext } from \"@itwin/components-react\";\nimport { HighlightedText, PropertyContainerType, PropertyValueRendererManager } from \"@itwin/components-react\";\nimport { CommonPropertyRenderer } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/CommonPropertyRenderer\";\nimport { Orientation } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport { countMatchesInString } from \"./countMatchesInString\";\n\nfunction createHighlightCallback(highlight: HighlightingComponentProps & { applyOnLabel: boolean }, propertyRecord: PropertyRecord) {\n const activeMatch = highlight.activeHighlight;\n const propertyName = activeMatch?.highlightedItemIdentifier;\n const matchIndex = activeMatch?.highlightIndex ?? 0;\n let labelMatches: number;\n\n if (highlight.applyOnLabel) {\n labelMatches = countMatchesInString(propertyRecord.property.displayLabel.toLowerCase(), highlight.highlightedText);\n } else {\n labelMatches = 0;\n }\n\n const activeMatchIndex = (propertyRecord.property.name === propertyName) && ((matchIndex - labelMatches) >= 0) ? (matchIndex - labelMatches) : undefined;\n const highlightCallback = (text: string) => (<HighlightedText text={text} activeMatchIndex={activeMatchIndex} searchText={highlight.highlightedText} />);\n\n return highlightCallback;\n}\n\nexport function createNewDisplayValue(\n orientation: Orientation,\n propertyRecord: PropertyRecord,\n indentation?: number,\n propertyValueRendererManager?: PropertyValueRendererManager,\n isExpanded?: boolean,\n onExpansionToggled?: () => void,\n onHeightChanged?: (newHeight: number) => void,\n highlight?: HighlightingComponentProps & { applyOnLabel: boolean, applyOnValue: boolean }\n) {\n const highlightCallback = highlight?.applyOnValue ? (createHighlightCallback(highlight, propertyRecord)) : undefined;\n const rendererContext: PropertyValueRendererContext = {\n orientation,\n containerType: PropertyContainerType.PropertyPane,\n isExpanded,\n onExpansionToggled,\n onHeightChanged,\n textHighlighter: highlightCallback,\n };\n\n let displayValue: React.ReactNode | undefined;\n if (propertyValueRendererManager)\n displayValue = propertyValueRendererManager.render(propertyRecord, rendererContext);\n else\n displayValue = PropertyValueRendererManager.defaultManager.render(propertyRecord, rendererContext);\n\n // Align value with label if orientation is vertical\n if (orientation === Orientation.Vertical)\n displayValue = <span style={{ paddingLeft: CommonPropertyRenderer.getLabelOffset(indentation, orientation) }}>{displayValue}</span>;\n\n return displayValue;\n}\n"]}