@itwin/components-react 3.0.0-dev.72 → 3.0.0-dev.78

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 (163) hide show
  1. package/lib/components-react/UiComponents.d.ts +10 -10
  2. package/lib/components-react/UiComponents.d.ts.map +1 -1
  3. package/lib/components-react/UiComponents.js +18 -18
  4. package/lib/components-react/UiComponents.js.map +1 -1
  5. package/lib/components-react/common/HighlightedText.d.ts +2 -2
  6. package/lib/components-react/common/HighlightedText.js +1 -1
  7. package/lib/components-react/common/HighlightedText.js.map +1 -1
  8. package/lib/components-react/common/HighlightingComponentProps.d.ts +2 -2
  9. package/lib/components-react/common/HighlightingComponentProps.js.map +1 -1
  10. package/lib/components-react/common/UseAsyncValue.d.ts +1 -1
  11. package/lib/components-react/common/UseAsyncValue.js +1 -1
  12. package/lib/components-react/common/UseAsyncValue.js.map +1 -1
  13. package/lib/components-react/datepicker/DatePicker.js +28 -28
  14. package/lib/components-react/datepicker/DatePicker.js.map +1 -1
  15. package/lib/components-react/editors/BooleanEditor.d.ts +2 -2
  16. package/lib/components-react/editors/BooleanEditor.js +2 -2
  17. package/lib/components-react/editors/BooleanEditor.js.map +1 -1
  18. package/lib/components-react/editors/EnumButtonGroupEditor.d.ts +2 -2
  19. package/lib/components-react/editors/EnumButtonGroupEditor.js +2 -2
  20. package/lib/components-react/editors/EnumButtonGroupEditor.js.map +1 -1
  21. package/lib/components-react/editors/EnumEditor.d.ts +2 -2
  22. package/lib/components-react/editors/EnumEditor.js +2 -2
  23. package/lib/components-react/editors/EnumEditor.js.map +1 -1
  24. package/lib/components-react/editors/ImageCheckBoxEditor.d.ts +2 -2
  25. package/lib/components-react/editors/ImageCheckBoxEditor.js +2 -2
  26. package/lib/components-react/editors/ImageCheckBoxEditor.js.map +1 -1
  27. package/lib/components-react/editors/NumericInputEditor.d.ts +2 -2
  28. package/lib/components-react/editors/NumericInputEditor.js +2 -2
  29. package/lib/components-react/editors/NumericInputEditor.js.map +1 -1
  30. package/lib/components-react/editors/PropertyEditorManager.d.ts +7 -7
  31. package/lib/components-react/editors/PropertyEditorManager.js +4 -4
  32. package/lib/components-react/editors/PropertyEditorManager.js.map +1 -1
  33. package/lib/components-react/editors/SliderEditor.d.ts +2 -2
  34. package/lib/components-react/editors/SliderEditor.js +2 -2
  35. package/lib/components-react/editors/SliderEditor.js.map +1 -1
  36. package/lib/components-react/editors/TextEditor.d.ts +1 -1
  37. package/lib/components-react/editors/TextEditor.js +1 -1
  38. package/lib/components-react/editors/TextEditor.js.map +1 -1
  39. package/lib/components-react/editors/TextareaEditor.d.ts +2 -2
  40. package/lib/components-react/editors/TextareaEditor.js +2 -2
  41. package/lib/components-react/editors/TextareaEditor.js.map +1 -1
  42. package/lib/components-react/editors/ThemedEnumEditor.d.ts +3 -3
  43. package/lib/components-react/editors/ThemedEnumEditor.d.ts.map +1 -1
  44. package/lib/components-react/editors/ThemedEnumEditor.js +3 -2
  45. package/lib/components-react/editors/ThemedEnumEditor.js.map +1 -1
  46. package/lib/components-react/editors/ToggleEditor.d.ts +2 -2
  47. package/lib/components-react/editors/ToggleEditor.js +2 -2
  48. package/lib/components-react/editors/ToggleEditor.js.map +1 -1
  49. package/lib/components-react/favorite/FavoritePropertiesRenderer.d.ts +1 -1
  50. package/lib/components-react/favorite/FavoritePropertiesRenderer.js +1 -1
  51. package/lib/components-react/favorite/FavoritePropertiesRenderer.js.map +1 -1
  52. package/lib/components-react/filtering/FilteringInput.d.ts +1 -2
  53. package/lib/components-react/filtering/FilteringInput.d.ts.map +1 -1
  54. package/lib/components-react/filtering/FilteringInput.js +1 -1
  55. package/lib/components-react/filtering/FilteringInput.js.map +1 -1
  56. package/lib/components-react/inputs/ParsedInput.d.ts +2 -2
  57. package/lib/components-react/inputs/ParsedInput.js +1 -1
  58. package/lib/components-react/inputs/ParsedInput.js.map +1 -1
  59. package/lib/components-react/properties/renderers/ActionButtonList.d.ts +2 -2
  60. package/lib/components-react/properties/renderers/ActionButtonList.js +1 -1
  61. package/lib/components-react/properties/renderers/ActionButtonList.js.map +1 -1
  62. package/lib/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts +0 -1
  63. package/lib/components-react/properties/renderers/PrimitivePropertyRenderer.d.ts.map +1 -1
  64. package/lib/components-react/properties/renderers/PrimitivePropertyRenderer.js.map +1 -1
  65. package/lib/components-react/properties/renderers/PropertyRenderer.d.ts +5 -10
  66. package/lib/components-react/properties/renderers/PropertyRenderer.d.ts.map +1 -1
  67. package/lib/components-react/properties/renderers/PropertyRenderer.js.map +1 -1
  68. package/lib/components-react/properties/renderers/label/PropertyLabelRenderer.d.ts +1 -3
  69. package/lib/components-react/properties/renderers/label/PropertyLabelRenderer.d.ts.map +1 -1
  70. package/lib/components-react/properties/renderers/label/PropertyLabelRenderer.js.map +1 -1
  71. package/lib/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.d.ts +1 -1
  72. package/lib/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js +1 -1
  73. package/lib/components-react/properties/renderers/value/PrimitivePropertyValueRenderer.js.map +1 -1
  74. package/lib/components-react/propertygrid/PropertyCategoryRendererManager.d.ts +1 -1
  75. package/lib/components-react/propertygrid/PropertyCategoryRendererManager.js.map +1 -1
  76. package/lib/components-react/propertygrid/PropertyDataProvider.d.ts +1 -3
  77. package/lib/components-react/propertygrid/PropertyDataProvider.d.ts.map +1 -1
  78. package/lib/components-react/propertygrid/PropertyDataProvider.js.map +1 -1
  79. package/lib/components-react/propertygrid/component/PropertyCategoryBlock.d.ts +1 -3
  80. package/lib/components-react/propertygrid/component/PropertyCategoryBlock.d.ts.map +1 -1
  81. package/lib/components-react/propertygrid/component/PropertyCategoryBlock.js.map +1 -1
  82. package/lib/components-react/propertygrid/component/PropertyGridCommons.d.ts +0 -2
  83. package/lib/components-react/propertygrid/component/PropertyGridCommons.d.ts.map +1 -1
  84. package/lib/components-react/propertygrid/component/PropertyGridCommons.js.map +1 -1
  85. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts +13 -4
  86. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.d.ts.map +1 -1
  87. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js +9 -2
  88. package/lib/components-react/propertygrid/dataproviders/FilteringDataProvider.js.map +1 -1
  89. package/lib/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.d.ts +2 -2
  90. package/lib/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js +2 -2
  91. package/lib/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.js.map +1 -1
  92. package/lib/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.d.ts +1 -1
  93. package/lib/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js +1 -1
  94. package/lib/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.js.map +1 -1
  95. package/lib/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.d.ts +1 -1
  96. package/lib/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js +1 -1
  97. package/lib/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.js.map +1 -1
  98. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.d.ts +1 -1
  99. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js +1 -1
  100. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.js.map +1 -1
  101. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.d.ts +17 -14
  102. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.d.ts.map +1 -1
  103. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js +10 -8
  104. package/lib/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.js.map +1 -1
  105. package/lib/components-react/propertygrid/internal/PropertyGridHooks.d.ts +4 -4
  106. package/lib/components-react/propertygrid/internal/PropertyGridHooks.js +5 -5
  107. package/lib/components-react/propertygrid/internal/PropertyGridHooks.js.map +1 -1
  108. package/lib/components-react/selectable-content/SelectableContent.d.ts +5 -5
  109. package/lib/components-react/selectable-content/SelectableContent.d.ts.map +1 -1
  110. package/lib/components-react/selectable-content/SelectableContent.js +3 -2
  111. package/lib/components-react/selectable-content/SelectableContent.js.map +1 -1
  112. package/lib/components-react/table/SimpleTableDataProvider.d.ts +2 -2
  113. package/lib/components-react/table/SimpleTableDataProvider.js +2 -2
  114. package/lib/components-react/table/SimpleTableDataProvider.js.map +1 -1
  115. package/lib/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.d.ts.map +1 -1
  116. package/lib/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.js +1 -0
  117. package/lib/components-react/table/columnfiltering/data-grid-addons/AutoCompleteFilter.js.map +1 -1
  118. package/lib/components-react/table/component/Table.d.ts +4 -7
  119. package/lib/components-react/table/component/Table.d.ts.map +1 -1
  120. package/lib/components-react/table/component/Table.js.map +1 -1
  121. package/lib/components-react/toolbar/Item.d.ts +2 -2
  122. package/lib/components-react/toolbar/Item.js +1 -1
  123. package/lib/components-react/toolbar/Item.js.map +1 -1
  124. package/lib/components-react/toolbar/PopupItem.d.ts +2 -2
  125. package/lib/components-react/toolbar/PopupItem.js +1 -1
  126. package/lib/components-react/toolbar/PopupItem.js.map +1 -1
  127. package/lib/components-react/toolbar/PopupItemWithDrag.d.ts +2 -2
  128. package/lib/components-react/toolbar/PopupItemWithDrag.js +1 -1
  129. package/lib/components-react/toolbar/PopupItemWithDrag.js.map +1 -1
  130. package/lib/components-react/toolbar/Toolbar.d.ts +2 -2
  131. package/lib/components-react/toolbar/Toolbar.js +1 -1
  132. package/lib/components-react/toolbar/Toolbar.js.map +1 -1
  133. package/lib/components-react/toolbar/ToolbarWithOverflow.d.ts +6 -6
  134. package/lib/components-react/toolbar/ToolbarWithOverflow.js +3 -3
  135. package/lib/components-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  136. package/lib/components-react/toolbar/utilities/Direction.d.ts +1 -1
  137. package/lib/components-react/toolbar/utilities/Direction.js +1 -1
  138. package/lib/components-react/toolbar/utilities/Direction.js.map +1 -1
  139. package/lib/components-react/tree/HighlightingEngine.d.ts +1 -1
  140. package/lib/components-react/tree/HighlightingEngine.js +1 -1
  141. package/lib/components-react/tree/HighlightingEngine.js.map +1 -1
  142. package/lib/components-react/tree/TreeDataProvider.d.ts +1 -1
  143. package/lib/components-react/tree/TreeDataProvider.js.map +1 -1
  144. package/lib/components-react/tree/controlled/TreeHooks.d.ts +3 -4
  145. package/lib/components-react/tree/controlled/TreeHooks.d.ts.map +1 -1
  146. package/lib/components-react/tree/controlled/TreeHooks.js +3 -4
  147. package/lib/components-react/tree/controlled/TreeHooks.js.map +1 -1
  148. package/lib/components-react/tree/controlled/component/ControlledTree.d.ts +1 -1
  149. package/lib/components-react/tree/controlled/component/ControlledTree.js.map +1 -1
  150. package/lib/components-react/tree/controlled/component/TreeNodeEditor.d.ts +9 -6
  151. package/lib/components-react/tree/controlled/component/TreeNodeEditor.d.ts.map +1 -1
  152. package/lib/components-react/tree/controlled/component/TreeNodeEditor.js +3 -2
  153. package/lib/components-react/tree/controlled/component/TreeNodeEditor.js.map +1 -1
  154. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.d.ts +12 -16
  155. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.d.ts.map +1 -1
  156. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.js +1 -1
  157. package/lib/components-react/tree/controlled/component/TreeNodeRenderer.js.map +1 -1
  158. package/lib/components-react/tree/controlled/component/TreeRenderer.d.ts +5 -54
  159. package/lib/components-react/tree/controlled/component/TreeRenderer.d.ts.map +1 -1
  160. package/lib/components-react/tree/controlled/component/TreeRenderer.js +13 -28
  161. package/lib/components-react/tree/controlled/component/TreeRenderer.js.map +1 -1
  162. package/lib/public/locales/en/UiComponents.json +1 -8
  163. package/package.json +16 -15
@@ -6,17 +6,26 @@ import { HighlightInfo } from "../../common/HighlightingComponentProps";
6
6
  import { IPropertyDataProvider, PropertyData, PropertyDataChangeEvent } from "../PropertyDataProvider";
7
7
  import { FilteredType, IPropertyDataFilterer } from "./filterers/PropertyDataFiltererBase";
8
8
  /**
9
- * Data returned by [[FilteringPropertyDataProvider]]
10
- * @beta
9
+ * Data returned by [[FilteringPropertyDataProvider]]
10
+ * @public
11
11
  */
12
12
  export interface FilteredPropertyData extends PropertyData {
13
+ /**
14
+ * Shows how many matches were found when filtering data.
15
+ * `undefined` when filterer is not active
16
+ */
13
17
  matchesCount?: number;
18
+ /**
19
+ * Function used for getting [[HighlightInfo]] by index from all the filtered matches.
20
+ * `undefined` when filterer is not active
21
+ */
14
22
  getMatchByIndex?: (index: number) => HighlightInfo | undefined;
23
+ /** Types of objects that were used for filtering. */
15
24
  filteredTypes?: FilteredType[];
16
25
  }
17
26
  /**
18
- * IPropertyDataProvider implementation which will filter wrapped provider PropertyData using passed IPropertyDataFilterer.
19
- * @beta
27
+ * [[IPropertyDataProvider]] implementation which filters wrapped provider [[PropertyData]] using passed [[IPropertyDataFilterer]].
28
+ * @public
20
29
  */
21
30
  export declare class FilteringPropertyDataProvider implements IPropertyDataProvider, IDisposable {
22
31
  private _dataProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"FilteringDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAoB,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAA4B,MAAM,sCAAsC,CAAC;AAWrH;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IAKxD,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAE/D,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,6BAA8B,YAAW,qBAAqB,EAAE,WAAW;IAMnE,OAAO,CAAC,aAAa;IAAyB,OAAO,CAAC,SAAS;IAL3E,aAAa,0BAAiC;IACrD,OAAO,CAAC,qBAAqB,CAAwD;IACrF,OAAO,CAAC,6BAA6B,CAAW;IAChD,OAAO,CAAC,2BAA2B,CAAW;gBAEnB,aAAa,EAAE,qBAAqB,EAAU,SAAS,EAAE,qBAAqB;IAKlG,OAAO,IAAI,IAAI;IAKT,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;YAavC,kBAAkB;CAqCjC"}
1
+ {"version":3,"file":"FilteringDataProvider.d.ts","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAoB,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAA4B,MAAM,sCAAsC,CAAC;AAWrH;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD;;;MAGE;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;MAGE;IACF,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAE/D,qDAAqD;IACrD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,6BAA8B,YAAW,qBAAqB,EAAE,WAAW;IAMnE,OAAO,CAAC,aAAa;IAAyB,OAAO,CAAC,SAAS;IAL3E,aAAa,0BAAiC;IACrD,OAAO,CAAC,qBAAqB,CAAwD;IACrF,OAAO,CAAC,6BAA6B,CAAW;IAChD,OAAO,CAAC,2BAA2B,CAAW;gBAEnB,aAAa,EAAE,qBAAqB,EAAU,SAAS,EAAE,qBAAqB;IAKlG,OAAO,IAAI,IAAI;IAKT,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;YAavC,kBAAkB;CAqCjC"}
@@ -1,11 +1,18 @@
1
1
  "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module PropertyGrid
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.FilteringPropertyDataProvider = void 0;
4
11
  const appui_abstract_1 = require("@itwin/appui-abstract");
5
12
  const PropertyDataProvider_1 = require("../PropertyDataProvider");
6
13
  /**
7
- * IPropertyDataProvider implementation which will filter wrapped provider PropertyData using passed IPropertyDataFilterer.
8
- * @beta
14
+ * [[IPropertyDataProvider]] implementation which filters wrapped provider [[PropertyData]] using passed [[IPropertyDataFilterer]].
15
+ * @public
9
16
  */
10
17
  class FilteringPropertyDataProvider {
11
18
  constructor(_dataProvider, _filterer) {
@@ -1 +1 @@
1
- {"version":3,"file":"FilteringDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":";;;AAQA,0DAA2F;AAG3F,kEAAyH;AA+BzH;;;GAGG;AACH,MAAa,6BAA6B;IAMxC,YAA2B,aAAoC,EAAU,SAAgC;QAA9E,kBAAa,GAAb,aAAa,CAAuB;QAAU,cAAS,GAAT,SAAS,CAAuB;QALlG,kBAAa,GAAG,IAAI,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AS,sBAAsB,CAAC,KAAoB,EAAE,WAA6B;IACjF,QAAQ,KAAK,CAAC,WAAW,EAAE;QACzB,KAAK,oCAAmB,CAAC,SAAS;YAChC,yBAAY,KAAK,EAAG;QACtB,KAAK,oCAAmB,CAAC,KAAK;YAC5B,OAAO;gBACL,WAAW,EAAE,oCAAmB,CAAC,KAAK;gBACtC,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,KAAK,EAAE,WAAW;aACnB,CAAC;QACJ,KAAK,oCAAmB,CAAC,MAAM;YAC7B,MAAM,OAAO,GAAuC,EAAE,CAAC;YACvD,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;YACrE,OAAO;gBACL,WAAW,EAAE,oCAAmB,CAAC,MAAM;gBACvC,OAAO;aACR,CAAC;KACL;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\nimport { IDisposable } from \"@itwin/core-bentley\";\nimport { PropertyRecord, PropertyValue, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { HighlightInfo } from \"../../common/HighlightingComponentProps\";\nimport { CategoryRecordsDict } from \"../internal/flat-items/MutableGridCategory\";\nimport { IPropertyDataProvider, PropertyCategory, PropertyData, PropertyDataChangeEvent } from \"../PropertyDataProvider\";\nimport { FilteredType, IPropertyDataFilterer, PropertyDataFilterResult } from \"./filterers/PropertyDataFiltererBase\";\n\ninterface FilteredRecords {\n filteredRecords: PropertyRecord[];\n shouldExpandNodeParents: boolean;\n matchesCount: number;\n activeMatch?: HighlightInfo;\n filteredResultMatches: { id: string, matchesCount: number }[];\n filteredTypes: FilteredType[];\n}\n\n/**\n * Data returned by [[FilteringPropertyDataProvider]]\n * @beta\n */\nexport interface FilteredPropertyData extends PropertyData {\n /*\n * Shows how many matches were found when filtering data.\n * Undefined when filterer is not active\n */\n matchesCount?: number;\n /*\n * Function used for getting PropertyRecordMatchInfo by index from all the filtered matches.\n * Undefined when filterer is not active\n */\n getMatchByIndex?: (index: number) => HighlightInfo | undefined;\n\n filteredTypes?: FilteredType[];\n}\n\n/**\n * IPropertyDataProvider implementation which will filter wrapped provider PropertyData using passed IPropertyDataFilterer.\n * @beta\n */\nexport class FilteringPropertyDataProvider implements IPropertyDataProvider, IDisposable {\n public onDataChanged = new PropertyDataChangeEvent();\n private _filteredPropertyData: Promise<FilteredPropertyData> | undefined = undefined;\n private _disposeFilterChangedListener: Function;\n private _disposeDataChangedListener: Function;\n\n public constructor(private _dataProvider: IPropertyDataProvider, private _filterer: IPropertyDataFilterer) {\n this._disposeFilterChangedListener = this._filterer.onFilterChanged.addListener(() => { this._filteredPropertyData = undefined; this.onDataChanged.raiseEvent(); });\n this._disposeDataChangedListener = this._dataProvider.onDataChanged.addListener(() => { this._filteredPropertyData = undefined; this.onDataChanged.raiseEvent(); });\n }\n\n public dispose(): void {\n this._disposeDataChangedListener();\n this._disposeFilterChangedListener();\n }\n\n public async getData(): Promise<FilteredPropertyData> {\n if (this._filteredPropertyData) {\n return this._filteredPropertyData;\n }\n\n this._filteredPropertyData = this._dataProvider.getData().then(async (propertyData) => {\n return ((this._filterer.isActive) ?\n this.filterPropertyData(propertyData) : propertyData);\n });\n\n return this._filteredPropertyData;\n }\n\n private async filterPropertyData(propertyData: PropertyData) {\n const { categories, records, label, description } = { ...propertyData };\n const { filteredCategories, filteredRecords, matchesCount, filteredResultMatches, filteredTypes } = await matchHierarchy(this._filterer, categories, records, undefined);\n\n const uniqueTypes = [...new Set(filteredTypes)];\n const getMatchByIndex = (index: number) => {\n let activeMatch: HighlightInfo | undefined;\n if (index <= 0)\n return undefined;\n\n let i = 1;\n for (const record of filteredResultMatches) {\n const fullMatchesCount = record.matchesCount;\n if (index < i + fullMatchesCount) {\n activeMatch = {\n highlightedItemIdentifier: record.id,\n highlightIndex: index - i,\n };\n break;\n }\n\n i += fullMatchesCount;\n }\n return activeMatch;\n };\n\n return {\n label,\n description,\n categories: filteredCategories,\n records: filteredRecords,\n reusePropertyDataState: false,\n matchesCount,\n getMatchByIndex,\n filteredTypes: uniqueTypes,\n };\n }\n}\n\nasync function matchHierarchy(filterer: IPropertyDataFilterer, categories: PropertyCategory[], records: CategoryRecordsDict, newRecords?: CategoryRecordsDict, parentMatchInfo?: PropertyDataFilterResult) {\n const newCategories: PropertyCategory[] = [];\n newRecords = newRecords ?? {};\n let matchesCount = 0;\n let allFilteredResultMatches: { id: string, matchesCount: number }[] = [];\n let allFilteredTypes: FilteredType[] = [];\n\n for (const category of categories) {\n const matchInfo = await filterer.categoryMatchesFilter(category, []);\n\n if (matchInfo.matchesFilter) {\n allFilteredResultMatches.push({ id: category.name, matchesCount: matchInfo.matchesCount ?? 0 });\n allFilteredTypes = allFilteredTypes.concat(matchInfo.filteredTypes ?? []);\n matchesCount += matchInfo.matchesCount ?? 0;\n }\n\n const childRecords = records[category.name] ?? [];\n const { filteredRecords, matchesCount: count, filteredResultMatches, filteredTypes } = await matchRecordHierarchy(filterer, childRecords, []);\n allFilteredResultMatches = allFilteredResultMatches.concat(filteredResultMatches);\n allFilteredTypes = allFilteredTypes.concat(filteredTypes);\n matchesCount += count;\n\n const parentInfo = parentMatchInfo?.matchesFilter ? parentMatchInfo : matchInfo;\n\n const childCategories = category.childCategories ?? [];\n const { filteredCategories, matchesCount: childCount, filteredResultMatches: childFilteredResultMatches, filteredTypes: childFilteredTypes } = await matchHierarchy(filterer, childCategories, records, newRecords, parentInfo);\n allFilteredResultMatches = allFilteredResultMatches.concat(childFilteredResultMatches);\n allFilteredTypes = allFilteredTypes.concat(childFilteredTypes);\n matchesCount += childCount;\n\n let expand = !(count === 0 && childCount === 0);\n if (matchInfo.matchesFilter || (parentMatchInfo?.matchesFilter && parentMatchInfo.shouldForceIncludeDescendants)) {\n newRecords[category.name] = records[category.name];\n if (matchInfo.matchesFilter) {\n expand = true;\n }\n const newCategory = copyPropertyCategory(category, filteredCategories, expand);\n newCategories.push(newCategory);\n }\n\n if ((filteredRecords.length !== 0 || filteredCategories.length !== 0) && !matchInfo.matchesFilter && !(parentMatchInfo?.shouldExpandNodeParents && parentMatchInfo.matchesFilter)) {\n const newCategory = copyPropertyCategory(category, filteredCategories, expand);\n newRecords[newCategory.name] = filteredRecords;\n newCategories.push(newCategory);\n }\n }\n\n return { filteredCategories: newCategories, filteredRecords: newRecords, matchesCount, filteredResultMatches: allFilteredResultMatches, filteredTypes: allFilteredTypes };\n}\n\nasync function matchRecordHierarchy(filterer: IPropertyDataFilterer, records: PropertyRecord[], parents: PropertyRecord[], forceIncludeItem: boolean = false): Promise<FilteredRecords> {\n const newMatchedRecords: PropertyRecord[] = [];\n let expandParent = false; // property passed back to parent to indicate whether it should be expanded\n let matchesCount = 0;\n let filteredResultMatches: { id: string, matchesCount: number }[] = [];\n let filteredTypes: FilteredType[] = [];\n\n for (const record of records) {\n const matchInfo = await filterer.recordMatchesFilter(record, parents);\n const shouldForceIncludeDescendants = forceIncludeItem || matchInfo.shouldForceIncludeDescendants;\n const { filteredRecords: filteredChildren, shouldExpandNodeParents, matchesCount: childrenMatchesCount, filteredResultMatches: childrenResultMatches, filteredTypes: childrenFilteredTypes } = await matchRecordHierarchy(filterer, record.getChildrenRecords(), [...parents, record], shouldForceIncludeDescendants);\n filteredResultMatches = filteredResultMatches.concat(childrenResultMatches);\n filteredTypes = [...filteredTypes, ...childrenFilteredTypes];\n matchesCount += childrenMatchesCount;\n // if child hierarchy indicates parents should be expanded, then it should be passed back up to the top parent\n expandParent = expandParent || shouldExpandNodeParents;\n\n let newRecord: PropertyRecord | undefined;\n if (matchInfo.matchesFilter) {\n filteredTypes = [...filteredTypes, ...(matchInfo.filteredTypes ?? [])];\n const recordMatchesCount = matchInfo.matchesCount ?? 0;\n matchesCount += recordMatchesCount;\n // Item is included if it matches filter\n // If at least one matched record from records list needs its parent expanded,\n // then `expandParent` should be set to true\n expandParent = expandParent || !!matchInfo.shouldExpandNodeParents;\n newRecord = copyPropertyRecord(record, filteredChildren, shouldExpandNodeParents);\n filteredResultMatches.push({ id: newRecord.property.name, matchesCount: recordMatchesCount });\n } else if (filteredChildren.length !== 0 || forceIncludeItem) {\n // Item is also included if it has at least one matched child or is forcefully included by its parent\n newRecord = copyPropertyRecord(record, filteredChildren, shouldExpandNodeParents);\n }\n\n if (newRecord)\n newMatchedRecords.push(newRecord);\n }\n\n return { filteredRecords: newMatchedRecords, shouldExpandNodeParents: expandParent, matchesCount, filteredResultMatches, filteredTypes };\n}\n\nfunction copyPropertyCategory(\n propertyCategory: PropertyCategory,\n newChildren: PropertyCategory[],\n expand: boolean,\n): PropertyCategory {\n return {\n ...propertyCategory,\n childCategories: newChildren,\n expand,\n };\n}\n\nfunction copyPropertyRecord(record: PropertyRecord, newChildren: PropertyRecord[], autoExpand: boolean) {\n const r = record.copyWithNewValue(createNewPropertyValue(record.value, newChildren));\n r.autoExpand = autoExpand;\n return r;\n}\n\nfunction createNewPropertyValue(value: PropertyValue, newChildren: PropertyRecord[]): PropertyValue {\n switch (value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return { ...value };\n case PropertyValueFormat.Array:\n return {\n valueFormat: PropertyValueFormat.Array,\n itemsTypeName: value.itemsTypeName,\n items: newChildren,\n };\n case PropertyValueFormat.Struct:\n const members: { [name: string]: PropertyRecord } = {};\n newChildren.forEach((child) => members[child.property.name] = child);\n return {\n valueFormat: PropertyValueFormat.Struct,\n members,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"FilteringDataProvider.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/dataproviders/FilteringDataProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0DAA2F;AAI3F,kEAAyH;AAiCzH;;;GAGG;AACH,MAAa,6BAA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,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IACrF,CAAC,CAAC,UAAU,GAAG,UAAU,CAAC;IAC1B,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAoB,EAAE,WAA6B;IACjF,QAAQ,KAAK,CAAC,WAAW,EAAE;QACzB,KAAK,oCAAmB,CAAC,SAAS;YAChC,yBAAY,KAAK,EAAG;QACtB,KAAK,oCAAmB,CAAC,KAAK;YAC5B,OAAO;gBACL,WAAW,EAAE,oCAAmB,CAAC,KAAK;gBACtC,aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,KAAK,EAAE,WAAW;aACnB,CAAC;QACJ,KAAK,oCAAmB,CAAC,MAAM;YAC7B,MAAM,OAAO,GAAuC,EAAE,CAAC;YACvD,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;YACrE,OAAO;gBACL,WAAW,EAAE,oCAAmB,CAAC,MAAM;gBACvC,OAAO;aACR,CAAC;KACL;AACH,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord, PropertyValue, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { IDisposable } from \"@itwin/core-bentley\";\nimport { HighlightInfo } from \"../../common/HighlightingComponentProps\";\nimport { CategoryRecordsDict } from \"../internal/flat-items/MutableGridCategory\";\nimport { IPropertyDataProvider, PropertyCategory, PropertyData, PropertyDataChangeEvent } from \"../PropertyDataProvider\";\nimport { FilteredType, IPropertyDataFilterer, PropertyDataFilterResult } from \"./filterers/PropertyDataFiltererBase\";\n\ninterface FilteredRecords {\n filteredRecords: PropertyRecord[];\n shouldExpandNodeParents: boolean;\n matchesCount: number;\n activeMatch?: HighlightInfo;\n filteredResultMatches: { id: string, matchesCount: number }[];\n filteredTypes: FilteredType[];\n}\n\n/**\n * Data returned by [[FilteringPropertyDataProvider]]\n * @public\n */\nexport interface FilteredPropertyData extends PropertyData {\n /**\n * Shows how many matches were found when filtering data.\n * `undefined` when filterer is not active\n */\n matchesCount?: number;\n\n /**\n * Function used for getting [[HighlightInfo]] by index from all the filtered matches.\n * `undefined` when filterer is not active\n */\n getMatchByIndex?: (index: number) => HighlightInfo | undefined;\n\n /** Types of objects that were used for filtering. */\n filteredTypes?: FilteredType[];\n}\n\n/**\n * [[IPropertyDataProvider]] implementation which filters wrapped provider [[PropertyData]] using passed [[IPropertyDataFilterer]].\n * @public\n */\nexport class FilteringPropertyDataProvider implements IPropertyDataProvider, IDisposable {\n public onDataChanged = new PropertyDataChangeEvent();\n private _filteredPropertyData: Promise<FilteredPropertyData> | undefined = undefined;\n private _disposeFilterChangedListener: Function;\n private _disposeDataChangedListener: Function;\n\n public constructor(private _dataProvider: IPropertyDataProvider, private _filterer: IPropertyDataFilterer) {\n this._disposeFilterChangedListener = this._filterer.onFilterChanged.addListener(() => { this._filteredPropertyData = undefined; this.onDataChanged.raiseEvent(); });\n this._disposeDataChangedListener = this._dataProvider.onDataChanged.addListener(() => { this._filteredPropertyData = undefined; this.onDataChanged.raiseEvent(); });\n }\n\n public dispose(): void {\n this._disposeDataChangedListener();\n this._disposeFilterChangedListener();\n }\n\n public async getData(): Promise<FilteredPropertyData> {\n if (this._filteredPropertyData) {\n return this._filteredPropertyData;\n }\n\n this._filteredPropertyData = this._dataProvider.getData().then(async (propertyData) => {\n return ((this._filterer.isActive) ?\n this.filterPropertyData(propertyData) : propertyData);\n });\n\n return this._filteredPropertyData;\n }\n\n private async filterPropertyData(propertyData: PropertyData) {\n const { categories, records, label, description } = { ...propertyData };\n const { filteredCategories, filteredRecords, matchesCount, filteredResultMatches, filteredTypes } = await matchHierarchy(this._filterer, categories, records, undefined);\n\n const uniqueTypes = [...new Set(filteredTypes)];\n const getMatchByIndex = (index: number) => {\n let activeMatch: HighlightInfo | undefined;\n if (index <= 0)\n return undefined;\n\n let i = 1;\n for (const record of filteredResultMatches) {\n const fullMatchesCount = record.matchesCount;\n if (index < i + fullMatchesCount) {\n activeMatch = {\n highlightedItemIdentifier: record.id,\n highlightIndex: index - i,\n };\n break;\n }\n\n i += fullMatchesCount;\n }\n return activeMatch;\n };\n\n return {\n label,\n description,\n categories: filteredCategories,\n records: filteredRecords,\n reusePropertyDataState: false,\n matchesCount,\n getMatchByIndex,\n filteredTypes: uniqueTypes,\n };\n }\n}\n\nasync function matchHierarchy(filterer: IPropertyDataFilterer, categories: PropertyCategory[], records: CategoryRecordsDict, newRecords?: CategoryRecordsDict, parentMatchInfo?: PropertyDataFilterResult) {\n const newCategories: PropertyCategory[] = [];\n newRecords = newRecords ?? {};\n let matchesCount = 0;\n let allFilteredResultMatches: { id: string, matchesCount: number }[] = [];\n let allFilteredTypes: FilteredType[] = [];\n\n for (const category of categories) {\n const matchInfo = await filterer.categoryMatchesFilter(category, []);\n\n if (matchInfo.matchesFilter) {\n allFilteredResultMatches.push({ id: category.name, matchesCount: matchInfo.matchesCount ?? 0 });\n allFilteredTypes = allFilteredTypes.concat(matchInfo.filteredTypes ?? []);\n matchesCount += matchInfo.matchesCount ?? 0;\n }\n\n const childRecords = records[category.name] ?? [];\n const { filteredRecords, matchesCount: count, filteredResultMatches, filteredTypes } = await matchRecordHierarchy(filterer, childRecords, []);\n allFilteredResultMatches = allFilteredResultMatches.concat(filteredResultMatches);\n allFilteredTypes = allFilteredTypes.concat(filteredTypes);\n matchesCount += count;\n\n const parentInfo = parentMatchInfo?.matchesFilter ? parentMatchInfo : matchInfo;\n\n const childCategories = category.childCategories ?? [];\n const { filteredCategories, matchesCount: childCount, filteredResultMatches: childFilteredResultMatches, filteredTypes: childFilteredTypes } = await matchHierarchy(filterer, childCategories, records, newRecords, parentInfo);\n allFilteredResultMatches = allFilteredResultMatches.concat(childFilteredResultMatches);\n allFilteredTypes = allFilteredTypes.concat(childFilteredTypes);\n matchesCount += childCount;\n\n let expand = !(count === 0 && childCount === 0);\n if (matchInfo.matchesFilter || (parentMatchInfo?.matchesFilter && parentMatchInfo.shouldForceIncludeDescendants)) {\n newRecords[category.name] = records[category.name];\n if (matchInfo.matchesFilter) {\n expand = true;\n }\n const newCategory = copyPropertyCategory(category, filteredCategories, expand);\n newCategories.push(newCategory);\n }\n\n if ((filteredRecords.length !== 0 || filteredCategories.length !== 0) && !matchInfo.matchesFilter && !(parentMatchInfo?.shouldExpandNodeParents && parentMatchInfo.matchesFilter)) {\n const newCategory = copyPropertyCategory(category, filteredCategories, expand);\n newRecords[newCategory.name] = filteredRecords;\n newCategories.push(newCategory);\n }\n }\n\n return { filteredCategories: newCategories, filteredRecords: newRecords, matchesCount, filteredResultMatches: allFilteredResultMatches, filteredTypes: allFilteredTypes };\n}\n\nasync function matchRecordHierarchy(filterer: IPropertyDataFilterer, records: PropertyRecord[], parents: PropertyRecord[], forceIncludeItem: boolean = false): Promise<FilteredRecords> {\n const newMatchedRecords: PropertyRecord[] = [];\n let expandParent = false; // property passed back to parent to indicate whether it should be expanded\n let matchesCount = 0;\n let filteredResultMatches: { id: string, matchesCount: number }[] = [];\n let filteredTypes: FilteredType[] = [];\n\n for (const record of records) {\n const matchInfo = await filterer.recordMatchesFilter(record, parents);\n const shouldForceIncludeDescendants = forceIncludeItem || matchInfo.shouldForceIncludeDescendants;\n const { filteredRecords: filteredChildren, shouldExpandNodeParents, matchesCount: childrenMatchesCount, filteredResultMatches: childrenResultMatches, filteredTypes: childrenFilteredTypes } = await matchRecordHierarchy(filterer, record.getChildrenRecords(), [...parents, record], shouldForceIncludeDescendants);\n filteredResultMatches = filteredResultMatches.concat(childrenResultMatches);\n filteredTypes = [...filteredTypes, ...childrenFilteredTypes];\n matchesCount += childrenMatchesCount;\n // if child hierarchy indicates parents should be expanded, then it should be passed back up to the top parent\n expandParent = expandParent || shouldExpandNodeParents;\n\n let newRecord: PropertyRecord | undefined;\n if (matchInfo.matchesFilter) {\n filteredTypes = [...filteredTypes, ...(matchInfo.filteredTypes ?? [])];\n const recordMatchesCount = matchInfo.matchesCount ?? 0;\n matchesCount += recordMatchesCount;\n // Item is included if it matches filter\n // If at least one matched record from records list needs its parent expanded,\n // then `expandParent` should be set to true\n expandParent = expandParent || !!matchInfo.shouldExpandNodeParents;\n newRecord = copyPropertyRecord(record, filteredChildren, shouldExpandNodeParents);\n filteredResultMatches.push({ id: newRecord.property.name, matchesCount: recordMatchesCount });\n } else if (filteredChildren.length !== 0 || forceIncludeItem) {\n // Item is also included if it has at least one matched child or is forcefully included by its parent\n newRecord = copyPropertyRecord(record, filteredChildren, shouldExpandNodeParents);\n }\n\n if (newRecord)\n newMatchedRecords.push(newRecord);\n }\n\n return { filteredRecords: newMatchedRecords, shouldExpandNodeParents: expandParent, matchesCount, filteredResultMatches, filteredTypes };\n}\n\nfunction copyPropertyCategory(\n propertyCategory: PropertyCategory,\n newChildren: PropertyCategory[],\n expand: boolean,\n): PropertyCategory {\n return {\n ...propertyCategory,\n childCategories: newChildren,\n expand,\n };\n}\n\nfunction copyPropertyRecord(record: PropertyRecord, newChildren: PropertyRecord[], autoExpand: boolean) {\n const r = record.copyWithNewValue(createNewPropertyValue(record.value, newChildren));\n r.autoExpand = autoExpand;\n return r;\n}\n\nfunction createNewPropertyValue(value: PropertyValue, newChildren: PropertyRecord[]): PropertyValue {\n switch (value.valueFormat) {\n case PropertyValueFormat.Primitive:\n return { ...value };\n case PropertyValueFormat.Array:\n return {\n valueFormat: PropertyValueFormat.Array,\n itemsTypeName: value.itemsTypeName,\n items: newChildren,\n };\n case PropertyValueFormat.Struct:\n const members: { [name: string]: PropertyRecord } = {};\n newChildren.forEach((child) => members[child.property.name] = child);\n return {\n valueFormat: PropertyValueFormat.Struct,\n members,\n };\n }\n}\n"]}
@@ -6,7 +6,7 @@ import { PropertyCategory } from "../../PropertyDataProvider";
6
6
  import { IPropertyDataFilterer, PropertyDataFiltererBase, PropertyDataFilterResult } from "./PropertyDataFiltererBase";
7
7
  /**
8
8
  * Logical operator for composite filterer.
9
- * @beta
9
+ * @public
10
10
  */
11
11
  export declare enum CompositeFilterType {
12
12
  And = 0,
@@ -14,7 +14,7 @@ export declare enum CompositeFilterType {
14
14
  }
15
15
  /**
16
16
  * Composite PropertyData filter which can join two filters using logic operators
17
- * @beta
17
+ * @public
18
18
  */
19
19
  export declare class CompositePropertyDataFilterer extends PropertyDataFiltererBase {
20
20
  private _leftFilterer;
@@ -11,7 +11,7 @@ exports.CompositePropertyDataFilterer = exports.CompositeFilterType = void 0;
11
11
  const PropertyDataFiltererBase_1 = require("./PropertyDataFiltererBase");
12
12
  /**
13
13
  * Logical operator for composite filterer.
14
- * @beta
14
+ * @public
15
15
  */
16
16
  var CompositeFilterType;
17
17
  (function (CompositeFilterType) {
@@ -20,7 +20,7 @@ var CompositeFilterType;
20
20
  })(CompositeFilterType = exports.CompositeFilterType || (exports.CompositeFilterType = {}));
21
21
  /**
22
22
  * Composite PropertyData filter which can join two filters using logic operators
23
- * @beta
23
+ * @public
24
24
  */
25
25
  class CompositePropertyDataFilterer extends PropertyDataFiltererBase_1.PropertyDataFiltererBase {
26
26
  constructor(_leftFilterer, _operator, _rightFilterer) {
@@ -1 +1 @@
1
- {"version":3,"file":"CompositePropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,yEAAqI;AAErI;;;GAGG;AACH,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,2DAAG,CAAA;IACH,yDAAE,CAAA;AACJ,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AAED;;;GAGG;AACH,MAAa,6BAA8B,SAAQ,mDAAwB;IACzE,YAA2B,aAA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AAI,SAAS,KAAK,GAAG,IAAI,SAAS,KAAK,GAAG;QACxC,OAAO,SAAS,CAAC;IACnB,OAAO,CAAC,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,EAAE,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FilteredType, IPropertyDataFilterer, PropertyDataFiltererBase, PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\n\n/**\n * Logical operator for composite filterer.\n * @beta\n */\nexport enum CompositeFilterType {\n And,\n Or,\n}\n\n/**\n * Composite PropertyData filter which can join two filters using logic operators\n * @beta\n */\nexport class CompositePropertyDataFilterer extends PropertyDataFiltererBase {\n public constructor(private _leftFilterer: IPropertyDataFilterer, private _operator: CompositeFilterType, private _rightFilterer: IPropertyDataFilterer) {\n super();\n this._leftFilterer.onFilterChanged.addListener(() => this.onFilterChanged.raiseEvent());\n this._rightFilterer.onFilterChanged.addListener(() => this.onFilterChanged.raiseEvent());\n }\n\n public get isActive() { return this._leftFilterer.isActive || this._rightFilterer.isActive; }\n\n public async recordMatchesFilter(node: PropertyRecord, parents: PropertyRecord[]): Promise<PropertyDataFilterResult> {\n const [lhs, rhs] = await Promise.all([\n this._leftFilterer.recordMatchesFilter(node, parents),\n this._rightFilterer.recordMatchesFilter(node, parents),\n ]);\n\n return this.getFiltererResult(lhs, rhs);\n }\n\n public async categoryMatchesFilter(node: PropertyCategory, parents: PropertyCategory[]): Promise<PropertyDataFilterResult> {\n const [lhs, rhs] = await Promise.all([\n this._leftFilterer.categoryMatchesFilter(node, parents),\n this._rightFilterer.categoryMatchesFilter(node, parents),\n ]);\n\n return this.getFiltererResult(lhs, rhs);\n }\n\n private getFiltererResult(lhs: PropertyDataFilterResult, rhs: PropertyDataFilterResult) {\n const matchesFilter = (this._operator === CompositeFilterType.And) ? (lhs.matchesFilter && rhs.matchesFilter) : (lhs.matchesFilter || rhs.matchesFilter);\n if (!matchesFilter)\n return { matchesFilter: false };\n\n const filteredTypes = joinNullableArrays(lhs.matchesFilter ? lhs.filteredTypes : undefined, rhs.matchesFilter ? rhs.filteredTypes : undefined);\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: lhs.shouldExpandNodeParents || rhs.shouldExpandNodeParents,\n shouldForceIncludeDescendants: lhs.shouldForceIncludeDescendants || rhs.shouldForceIncludeDescendants,\n matchesCount: (sumNullableNumbers(lhs.matchesCount, rhs.matchesCount)),\n filteredTypes,\n };\n }\n}\n\nfunction sumNullableNumbers(lhs: number | undefined, rhs: number | undefined) {\n if (undefined === lhs && undefined === rhs)\n return undefined;\n return (lhs ?? 0) + (rhs ?? 0);\n}\n\nfunction joinNullableArrays(lhs: FilteredType[] | undefined, rhs: FilteredType[] | undefined) {\n if (undefined === lhs && undefined === rhs)\n return undefined;\n return [...lhs ?? [], ...rhs ?? []];\n}\n"]}
1
+ {"version":3,"file":"CompositePropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/CompositePropertyDataFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,yEAAqI;AAErI;;;GAGG;AACH,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,2DAAG,CAAA;IACH,yDAAE,CAAA;AACJ,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B;AAED;;;GAGG;AACH,MAAa,6BAA8B,SAAQ,mDAAwB;IACzE,YAA2B,aAAoC,EAAU,SAA8B,EAAU,cAAqC;QACpJ,KAAK,EAAE,CAAC;QADi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SAAS,CAAC;IACnB,OAAO,CAAC,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,EAAE,GAAG,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FilteredType, IPropertyDataFilterer, PropertyDataFiltererBase, PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\n\n/**\n * Logical operator for composite filterer.\n * @public\n */\nexport enum CompositeFilterType {\n And,\n Or,\n}\n\n/**\n * Composite PropertyData filter which can join two filters using logic operators\n * @public\n */\nexport class CompositePropertyDataFilterer extends PropertyDataFiltererBase {\n public constructor(private _leftFilterer: IPropertyDataFilterer, private _operator: CompositeFilterType, private _rightFilterer: IPropertyDataFilterer) {\n super();\n this._leftFilterer.onFilterChanged.addListener(() => this.onFilterChanged.raiseEvent());\n this._rightFilterer.onFilterChanged.addListener(() => this.onFilterChanged.raiseEvent());\n }\n\n public get isActive() { return this._leftFilterer.isActive || this._rightFilterer.isActive; }\n\n public async recordMatchesFilter(node: PropertyRecord, parents: PropertyRecord[]): Promise<PropertyDataFilterResult> {\n const [lhs, rhs] = await Promise.all([\n this._leftFilterer.recordMatchesFilter(node, parents),\n this._rightFilterer.recordMatchesFilter(node, parents),\n ]);\n\n return this.getFiltererResult(lhs, rhs);\n }\n\n public async categoryMatchesFilter(node: PropertyCategory, parents: PropertyCategory[]): Promise<PropertyDataFilterResult> {\n const [lhs, rhs] = await Promise.all([\n this._leftFilterer.categoryMatchesFilter(node, parents),\n this._rightFilterer.categoryMatchesFilter(node, parents),\n ]);\n\n return this.getFiltererResult(lhs, rhs);\n }\n\n private getFiltererResult(lhs: PropertyDataFilterResult, rhs: PropertyDataFilterResult) {\n const matchesFilter = (this._operator === CompositeFilterType.And) ? (lhs.matchesFilter && rhs.matchesFilter) : (lhs.matchesFilter || rhs.matchesFilter);\n if (!matchesFilter)\n return { matchesFilter: false };\n\n const filteredTypes = joinNullableArrays(lhs.matchesFilter ? lhs.filteredTypes : undefined, rhs.matchesFilter ? rhs.filteredTypes : undefined);\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: lhs.shouldExpandNodeParents || rhs.shouldExpandNodeParents,\n shouldForceIncludeDescendants: lhs.shouldForceIncludeDescendants || rhs.shouldForceIncludeDescendants,\n matchesCount: (sumNullableNumbers(lhs.matchesCount, rhs.matchesCount)),\n filteredTypes,\n };\n }\n}\n\nfunction sumNullableNumbers(lhs: number | undefined, rhs: number | undefined) {\n if (undefined === lhs && undefined === rhs)\n return undefined;\n return (lhs ?? 0) + (rhs ?? 0);\n}\n\nfunction joinNullableArrays(lhs: FilteredType[] | undefined, rhs: FilteredType[] | undefined) {\n if (undefined === lhs && undefined === rhs)\n return undefined;\n return [...lhs ?? [], ...rhs ?? []];\n}\n"]}
@@ -5,7 +5,7 @@ import { PropertyRecord } from "@itwin/appui-abstract";
5
5
  import { PropertyDataFilterResult, PropertyRecordDataFiltererBase } from "./PropertyDataFiltererBase";
6
6
  /**
7
7
  * Property data filterer which matches on Primitive Property Record display value text.
8
- * @beta
8
+ * @public
9
9
  */
10
10
  export declare class DisplayValuePropertyDataFilterer extends PropertyRecordDataFiltererBase {
11
11
  private _filterText;
@@ -13,7 +13,7 @@ const countMatchesInString_1 = require("../../../common/countMatchesInString");
13
13
  const PropertyDataFiltererBase_1 = require("./PropertyDataFiltererBase");
14
14
  /**
15
15
  * Property data filterer which matches on Primitive Property Record display value text.
16
- * @beta
16
+ * @public
17
17
  */
18
18
  class DisplayValuePropertyDataFilterer extends PropertyDataFiltererBase_1.PropertyRecordDataFiltererBase {
19
19
  constructor(filterText = "") {
@@ -1 +1 @@
1
- {"version":3,"file":"DisplayValuePropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0DAA4E;AAC5E,+EAA4E;AAC5E,yEAAoH;AAEpH;;;GAGG;AACH,MAAa,gCAAiC,SAAQ,yDAA8B;IAGlF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,mBAAmB,CAAC,IAAoB;;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEjC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,SAAS;YAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,MAAM,YAAY,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,0CAAE,WAAW,EAAE,mCAAI,EAAE,CAAC;QAClE,MAAM,YAAY,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YACpB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,YAAY;YACZ,aAAa,EAAE,CAAC,uCAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF;AAvCD,4EAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport { FilteredType, PropertyDataFilterResult, PropertyRecordDataFiltererBase } from \"./PropertyDataFiltererBase\";\n\n/**\n * Property data filterer which matches on Primitive Property Record display value text.\n * @beta\n */\nexport class DisplayValuePropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText;\n }\n\n public get filterText(): string { return this._filterText; }\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() { return this.filterText !== \"\"; }\n\n public async recordMatchesFilter(node: PropertyRecord): Promise<PropertyDataFilterResult> {\n if (!this.isActive)\n return { matchesFilter: true };\n\n if (node.value.valueFormat !== PropertyValueFormat.Primitive)\n return { matchesFilter: false };\n\n const displayValue = node.value.displayValue?.toLowerCase() ?? \"\";\n const matchesCount = countMatchesInString(displayValue, this.filterText);\n\n if (matchesCount === 0)\n return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n matchesCount,\n filteredTypes: [FilteredType.Value],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"DisplayValuePropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/DisplayValuePropertyDataFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0DAA4E;AAC5E,+EAA4E;AAC5E,yEAAoH;AAEpH;;;GAGG;AACH,MAAa,gCAAiC,SAAQ,yDAA8B;IAGlF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,mBAAmB,CAAC,IAAoB;;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEjC,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,oCAAmB,CAAC,SAAS;YAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,MAAM,YAAY,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,0CAAE,WAAW,EAAE,mCAAI,EAAE,CAAC;QAClE,MAAM,YAAY,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YACpB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,YAAY;YACZ,aAAa,EAAE,CAAC,uCAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF;AAvCD,4EAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord, PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport { FilteredType, PropertyDataFilterResult, PropertyRecordDataFiltererBase } from \"./PropertyDataFiltererBase\";\n\n/**\n * Property data filterer which matches on Primitive Property Record display value text.\n * @public\n */\nexport class DisplayValuePropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText;\n }\n\n public get filterText(): string { return this._filterText; }\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() { return this.filterText !== \"\"; }\n\n public async recordMatchesFilter(node: PropertyRecord): Promise<PropertyDataFilterResult> {\n if (!this.isActive)\n return { matchesFilter: true };\n\n if (node.value.valueFormat !== PropertyValueFormat.Primitive)\n return { matchesFilter: false };\n\n const displayValue = node.value.displayValue?.toLowerCase() ?? \"\";\n const matchesCount = countMatchesInString(displayValue, this.filterText);\n\n if (matchesCount === 0)\n return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n matchesCount,\n filteredTypes: [FilteredType.Value],\n };\n }\n}\n"]}
@@ -5,7 +5,7 @@ import { PropertyRecord } from "@itwin/appui-abstract";
5
5
  import { PropertyDataFilterResult, PropertyRecordDataFiltererBase } from "./PropertyDataFiltererBase";
6
6
  /**
7
7
  * PropertyData filter which matches on any record type label and includes descendant nodes on match
8
- * @beta
8
+ * @public
9
9
  */
10
10
  export declare class LabelPropertyDataFilterer extends PropertyRecordDataFiltererBase {
11
11
  private _filterText;
@@ -12,7 +12,7 @@ const countMatchesInString_1 = require("../../../common/countMatchesInString");
12
12
  const PropertyDataFiltererBase_1 = require("./PropertyDataFiltererBase");
13
13
  /**
14
14
  * PropertyData filter which matches on any record type label and includes descendant nodes on match
15
- * @beta
15
+ * @public
16
16
  */
17
17
  class LabelPropertyDataFilterer extends PropertyDataFiltererBase_1.PropertyRecordDataFiltererBase {
18
18
  constructor(filterText = "") {
@@ -1 +1 @@
1
- {"version":3,"file":"LabelPropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,+EAA4E;AAC5E,yEAAoH;AAEpH;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,yDAA8B;IAG3E,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,mBAAmB,CAAC,IAAoB;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEjC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAC9D,MAAM,YAAY,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACzE,IAAI,YAAY,KAAK,CAAC;YACpB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,uCAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF;AApCD,8DAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport { FilteredType, PropertyDataFilterResult, PropertyRecordDataFiltererBase } from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filter which matches on any record type label and includes descendant nodes on match\n * @beta\n */\nexport class LabelPropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText;\n }\n\n public get filterText(): string { return this._filterText; }\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() { return this.filterText !== \"\"; }\n\n public async recordMatchesFilter(node: PropertyRecord): Promise<PropertyDataFilterResult> {\n if (!this.isActive)\n return { matchesFilter: true };\n\n const displayLabel = node.property.displayLabel.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n if (matchesCount === 0)\n return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Label],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"LabelPropertyDataFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/LabelPropertyDataFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,+EAA4E;AAC5E,yEAAoH;AAEpH;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,yDAA8B;IAG3E,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,mBAAmB,CAAC,IAAoB;QACnD,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEjC,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAC9D,MAAM,YAAY,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACzE,IAAI,YAAY,KAAK,CAAC;YACpB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,uCAAY,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;CACF;AApCD,8DAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport { FilteredType, PropertyDataFilterResult, PropertyRecordDataFiltererBase } from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filter which matches on any record type label and includes descendant nodes on match\n * @public\n */\nexport class LabelPropertyDataFilterer extends PropertyRecordDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText;\n }\n\n public get filterText(): string { return this._filterText; }\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() { return this.filterText !== \"\"; }\n\n public async recordMatchesFilter(node: PropertyRecord): Promise<PropertyDataFilterResult> {\n if (!this.isActive)\n return { matchesFilter: true };\n\n const displayLabel = node.property.displayLabel.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n if (matchesCount === 0)\n return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Label],\n };\n }\n}\n"]}
@@ -5,7 +5,7 @@ import { PropertyCategory } from "../../PropertyDataProvider";
5
5
  import { PropertyCategoryDataFiltererBase, PropertyDataFilterResult } from "./PropertyDataFiltererBase";
6
6
  /**
7
7
  * PropertyData filterer which matches on PropertyCategory's label.
8
- * @beta
8
+ * @public
9
9
  */
10
10
  export declare class PropertyCategoryLabelFilterer extends PropertyCategoryDataFiltererBase {
11
11
  private _filterText;
@@ -12,7 +12,7 @@ const countMatchesInString_1 = require("../../../common/countMatchesInString");
12
12
  const PropertyDataFiltererBase_1 = require("./PropertyDataFiltererBase");
13
13
  /**
14
14
  * PropertyData filterer which matches on PropertyCategory's label.
15
- * @beta
15
+ * @public
16
16
  */
17
17
  class PropertyCategoryLabelFilterer extends PropertyDataFiltererBase_1.PropertyCategoryDataFiltererBase {
18
18
  constructor(filterText = "") {
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategoryLabelFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+EAA4E;AAE5E,yEAAsH;AAEtH;;;GAGG;AACH,MAAa,6BAA8B,SAAQ,2DAAgC;IAGjF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,qBAAqB,CAAC,IAAsB;QACvD,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEjC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YACpB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,uCAAY,CAAC,QAAQ,CAAC;SACvC,CAAC;IACJ,CAAC;CACF;AArCD,sEAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FilteredType, PropertyCategoryDataFiltererBase, PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filterer which matches on PropertyCategory's label.\n * @beta\n */\nexport class PropertyCategoryLabelFilterer extends PropertyCategoryDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText;\n }\n\n public get filterText(): string { return this._filterText; }\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() { return this.filterText !== \"\"; }\n\n public async categoryMatchesFilter(node: PropertyCategory): Promise<PropertyDataFilterResult> {\n if (!this.isActive)\n return { matchesFilter: true };\n\n const displayLabel = node.label.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n\n if (matchesCount === 0)\n return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Category],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyCategoryLabelFilterer.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyCategoryLabelFilterer.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+EAA4E;AAE5E,yEAAsH;AAEtH;;;GAGG;AACH,MAAa,6BAA8B,SAAQ,2DAAgC;IAGjF,YAAmB,aAAqB,EAAE;QACxC,KAAK,EAAE,CAAC;QAHF,gBAAW,GAAW,EAAE,CAAC;QAI/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,UAAU,CAAC,KAAa;QACjC,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;YAClC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SACnC;IACH,CAAC;IAED,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC;IAEjD,KAAK,CAAC,qBAAqB,CAAC,IAAsB;QACvD,IAAI,CAAC,IAAI,CAAC,QAAQ;YAChB,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;QAEjC,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAA,2CAAoB,EAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEzE,IAAI,YAAY,KAAK,CAAC;YACpB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAElC,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,uBAAuB,EAAE,IAAI;YAC7B,6BAA6B,EAAE,IAAI;YACnC,YAAY;YACZ,aAAa,EAAE,CAAC,uCAAY,CAAC,QAAQ,CAAC;SACvC,CAAC;IACJ,CAAC;CACF;AArCD,sEAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { countMatchesInString } from \"../../../common/countMatchesInString\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\nimport { FilteredType, PropertyCategoryDataFiltererBase, PropertyDataFilterResult } from \"./PropertyDataFiltererBase\";\n\n/**\n * PropertyData filterer which matches on PropertyCategory's label.\n * @public\n */\nexport class PropertyCategoryLabelFilterer extends PropertyCategoryDataFiltererBase {\n private _filterText: string = \"\";\n\n public constructor(filterText: string = \"\") {\n super();\n this._filterText = filterText;\n }\n\n public get filterText(): string { return this._filterText; }\n public set filterText(value: string) {\n const lowerValue = value.toLowerCase().trim();\n if (lowerValue !== this.filterText) {\n this._filterText = lowerValue;\n this.onFilterChanged.raiseEvent();\n }\n }\n\n public get isActive() { return this.filterText !== \"\"; }\n\n public async categoryMatchesFilter(node: PropertyCategory): Promise<PropertyDataFilterResult> {\n if (!this.isActive)\n return { matchesFilter: true };\n\n const displayLabel = node.label.toLowerCase();\n const matchesCount = countMatchesInString(displayLabel, this.filterText);\n\n if (matchesCount === 0)\n return { matchesFilter: false };\n\n return {\n matchesFilter: true,\n shouldExpandNodeParents: true,\n shouldForceIncludeDescendants: true,\n matchesCount,\n filteredTypes: [FilteredType.Category],\n };\n }\n}\n"]}
@@ -1,12 +1,12 @@
1
1
  /** @packageDocumentation
2
2
  * @module PropertyGrid
3
3
  */
4
- import { BeEvent } from "@itwin/core-bentley";
5
4
  import { PropertyRecord } from "@itwin/appui-abstract";
5
+ import { BeEvent } from "@itwin/core-bentley";
6
6
  import { PropertyCategory } from "../../PropertyDataProvider";
7
7
  /**
8
8
  * Enumeration of possible component filtered types
9
- * @beta
9
+ * @public
10
10
  */
11
11
  export declare enum FilteredType {
12
12
  Category = 0,
@@ -14,8 +14,8 @@ export declare enum FilteredType {
14
14
  Value = 2
15
15
  }
16
16
  /**
17
- * Data structure for storing IPropertyDataFilterer matching results
18
- * @beta
17
+ * Data structure for storing [[IPropertyDataFilterer]] matching results
18
+ * @public
19
19
  */
20
20
  export interface PropertyDataFilterResult {
21
21
  /** Indicates whether provided item matched filter */
@@ -41,18 +41,19 @@ export interface PropertyDataFilterResult {
41
41
  }
42
42
  /**
43
43
  * A signature for property data change listeners
44
- * @beta
44
+ * @public
45
45
  */
46
46
  export declare type PropertyFilterChangesListener = () => void;
47
47
  /**
48
48
  * An event broadcasted when property filter changes
49
- * @beta
49
+ * @public
50
50
  */
51
51
  export declare class PropertyFilterChangeEvent extends BeEvent<PropertyFilterChangesListener> {
52
52
  }
53
53
  /**
54
- * Interface to be implemented by Property Data Filter classes
55
- * @beta
54
+ * An interface for a filterer that filters [[PropertyData]] based on content of [[PropertyRecord]]
55
+ * and [[PropertyCategory]] objects.
56
+ * @public
56
57
  */
57
58
  export interface IPropertyDataFilterer {
58
59
  readonly isActive: boolean;
@@ -61,8 +62,8 @@ export interface IPropertyDataFilterer {
61
62
  onFilterChanged: PropertyFilterChangeEvent;
62
63
  }
63
64
  /**
64
- * PropertyDataFilter base which helps implement common logic between all IPropertyDataFilterer
65
- * @beta
65
+ * An abstract implementation of [[IPropertyDataFilterer]] to share common behavior between different implementations.
66
+ * @public
66
67
  */
67
68
  export declare abstract class PropertyDataFiltererBase implements IPropertyDataFilterer {
68
69
  onFilterChanged: PropertyFilterChangeEvent;
@@ -71,15 +72,17 @@ export declare abstract class PropertyDataFiltererBase implements IPropertyDataF
71
72
  abstract categoryMatchesFilter(node: PropertyCategory, parents: PropertyCategory[]): Promise<PropertyDataFilterResult>;
72
73
  }
73
74
  /**
74
- * PropertyDataFilter base which is suited for only Category filtering
75
- * @beta
75
+ * An abstract implementation of [[IPropertyDataFilterer]] that can be used as base for all
76
+ * filterers that filter based on [[PropertyCategory]] content.
77
+ * @public
76
78
  */
77
79
  export declare abstract class PropertyCategoryDataFiltererBase extends PropertyDataFiltererBase {
78
80
  recordMatchesFilter(): Promise<PropertyDataFilterResult>;
79
81
  }
80
82
  /**
81
- * PropertyDataFilter base which is suited for only Record filtering
82
- * @beta
83
+ * An abstract implementation of [[IPropertyDataFilterer]] that can be used as base for all
84
+ * filterers that filter based on [[PropertyRecord]] content.
85
+ * @public
83
86
  */
84
87
  export declare abstract class PropertyRecordDataFiltererBase extends PropertyDataFiltererBase {
85
88
  categoryMatchesFilter(): Promise<PropertyDataFilterResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyDataFiltererBase.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,oBAAY,YAAY;IACtB,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK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AAC,wBAAwB,CAAC;CAGtE;AACD;;;GAGG;AACH,8BAAsB,8BAA+B,SAAQ,wBAAwB;IACtE,qBAAqB,IAAI,OAAO,CAAC,wBAAwB,CAAC;CAGxE"}
1
+ {"version":3,"file":"PropertyDataFiltererBase.d.ts","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;;GAGG;AACH,oBAAY,YAAY;IACtB,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,KAAK,IAAA;CACN;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,qDAAqD;IACrD,aAAa,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAC;IAExC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,MAAM,6BAA6B,GAAG,MAAM,IAAI,CAAC;AAE/D;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,OAAO,CAAC,6BAA6B,CAAC;CAAI;AAEzF;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,mBAAmB,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC5G,qBAAqB,EAAE,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAClH,eAAe,EAAE,yBAAyB,CAAC;CAC5C;AAED;;;GAGG;AACH,8BAAsB,wBAAyB,YAAW,qBAAqB;IACtE,eAAe,EAAE,yBAAyB,CAAmC;IACpF,aAAoB,QAAQ,IAAI,OAAO,CAAC;aACxB,mBAAmB,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;aACvG,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAC9H;AAED;;;;GAIG;AACH,8BAAsB,gCAAiC,SAAQ,wBAAwB;IACxE,mBAAmB,IAAI,OAAO,CAAC,wBAAwB,CAAC;CAGtE;AAED;;;;GAIG;AACH,8BAAsB,8BAA+B,SAAQ,wBAAwB;IACtE,qBAAqB,IAAI,OAAO,CAAC,wBAAwB,CAAC;CAGxE"}
@@ -11,7 +11,7 @@ exports.PropertyRecordDataFiltererBase = exports.PropertyCategoryDataFiltererBas
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  /**
13
13
  * Enumeration of possible component filtered types
14
- * @beta
14
+ * @public
15
15
  */
16
16
  var FilteredType;
17
17
  (function (FilteredType) {
@@ -21,14 +21,14 @@ var FilteredType;
21
21
  })(FilteredType = exports.FilteredType || (exports.FilteredType = {}));
22
22
  /**
23
23
  * An event broadcasted when property filter changes
24
- * @beta
24
+ * @public
25
25
  */
26
26
  class PropertyFilterChangeEvent extends core_bentley_1.BeEvent {
27
27
  }
28
28
  exports.PropertyFilterChangeEvent = PropertyFilterChangeEvent;
29
29
  /**
30
- * PropertyDataFilter base which helps implement common logic between all IPropertyDataFilterer
31
- * @beta
30
+ * An abstract implementation of [[IPropertyDataFilterer]] to share common behavior between different implementations.
31
+ * @public
32
32
  */
33
33
  class PropertyDataFiltererBase {
34
34
  constructor() {
@@ -37,8 +37,9 @@ class PropertyDataFiltererBase {
37
37
  }
38
38
  exports.PropertyDataFiltererBase = PropertyDataFiltererBase;
39
39
  /**
40
- * PropertyDataFilter base which is suited for only Category filtering
41
- * @beta
40
+ * An abstract implementation of [[IPropertyDataFilterer]] that can be used as base for all
41
+ * filterers that filter based on [[PropertyCategory]] content.
42
+ * @public
42
43
  */
43
44
  class PropertyCategoryDataFiltererBase extends PropertyDataFiltererBase {
44
45
  async recordMatchesFilter() {
@@ -47,8 +48,9 @@ class PropertyCategoryDataFiltererBase extends PropertyDataFiltererBase {
47
48
  }
48
49
  exports.PropertyCategoryDataFiltererBase = PropertyCategoryDataFiltererBase;
49
50
  /**
50
- * PropertyDataFilter base which is suited for only Record filtering
51
- * @beta
51
+ * An abstract implementation of [[IPropertyDataFilterer]] that can be used as base for all
52
+ * filterers that filter based on [[PropertyRecord]] content.
53
+ * @public
52
54
  */
53
55
  class PropertyRecordDataFiltererBase extends PropertyDataFiltererBase {
54
56
  async categoryMatchesFilter() {
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyDataFiltererBase.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAI9C;;;GAGG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,uDAAQ,CAAA;IACR,iDAAK,CAAA;IACL,iDAAK,CAAA;AACP,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAuCD;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,sBAAsC;CAAI;AAAzF,8DAAyF;AAazF;;;GAGG;AACH,MAAsB,wBAAwB;IAA9C;QACS,oBAAe,GAA8B,IAAI,yBAAyB,EAAE,CAAC;IAItF,CAAC;CAAA;AALD,4DAKC;AACD;;;GAGG;AACH,MAAsB,gCAAiC,SAAQ,wBAAwB;IAC9E,KAAK,CAAC,mBAAmB;QAC9B,OAAO,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF;AAJD,4EAIC;AACD;;;GAGG;AACH,MAAsB,8BAA+B,SAAQ,wBAAwB;IAC5E,KAAK,CAAC,qBAAqB;QAChC,OAAO,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF;AAJD,wEAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\n\n/**\n * Enumeration of possible component filtered types\n * @beta\n */\nexport enum FilteredType {\n Category,\n Label,\n Value\n}\n\n/**\n * Data structure for storing IPropertyDataFilterer matching results\n * @beta\n */\nexport interface PropertyDataFilterResult {\n /** Indicates whether provided item matched filter */\n matchesFilter: boolean;\n\n /**\n * Indicates whether descendants nodes should be forcefully included in filtered results.\n * Can only be true for nodes that have `matchesFilter` set to true.\n */\n shouldForceIncludeDescendants?: boolean;\n\n /**\n * Indicates whether parents of node should be expanded up to this match node.\n * Can only be true for nodes that have `matchesFilter` set to true.\n */\n shouldExpandNodeParents?: boolean;\n\n /**\n * Indicates how many times filter was matched in the provided item.\n */\n matchesCount?: number;\n\n /**\n * Indicates what item types were matched.\n */\n filteredTypes?: FilteredType[];\n}\n\n/**\n * A signature for property data change listeners\n * @beta\n */\nexport declare type PropertyFilterChangesListener = () => void;\n\n/**\n * An event broadcasted when property filter changes\n * @beta\n */\nexport class PropertyFilterChangeEvent extends BeEvent<PropertyFilterChangesListener> { }\n\n/**\n * Interface to be implemented by Property Data Filter classes\n * @beta\n */\nexport interface IPropertyDataFilterer {\n readonly isActive: boolean;\n recordMatchesFilter: (node: PropertyRecord, parents: PropertyRecord[]) => Promise<PropertyDataFilterResult>;\n categoryMatchesFilter: (node: PropertyCategory, parents: PropertyCategory[]) => Promise<PropertyDataFilterResult>;\n onFilterChanged: PropertyFilterChangeEvent;\n}\n\n/**\n * PropertyDataFilter base which helps implement common logic between all IPropertyDataFilterer\n * @beta\n */\nexport abstract class PropertyDataFiltererBase implements IPropertyDataFilterer {\n public onFilterChanged: PropertyFilterChangeEvent = new PropertyFilterChangeEvent();\n public abstract get isActive(): boolean;\n public abstract recordMatchesFilter(node: PropertyRecord, parents: PropertyRecord[]): Promise<PropertyDataFilterResult>;\n public abstract categoryMatchesFilter(node: PropertyCategory, parents: PropertyCategory[]): Promise<PropertyDataFilterResult>;\n}\n/**\n * PropertyDataFilter base which is suited for only Category filtering\n * @beta\n */\nexport abstract class PropertyCategoryDataFiltererBase extends PropertyDataFiltererBase {\n public async recordMatchesFilter(): Promise<PropertyDataFilterResult> {\n return { matchesFilter: !this.isActive };\n }\n}\n/**\n * PropertyDataFilter base which is suited for only Record filtering\n * @beta\n */\nexport abstract class PropertyRecordDataFiltererBase extends PropertyDataFiltererBase {\n public async categoryMatchesFilter(): Promise<PropertyDataFilterResult> {\n return { matchesFilter: !this.isActive };\n }\n}\n"]}
1
+ {"version":3,"file":"PropertyDataFiltererBase.js","sourceRoot":"","sources":["../../../../../src/components-react/propertygrid/dataproviders/filterers/PropertyDataFiltererBase.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA8C;AAG9C;;;GAGG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,uDAAQ,CAAA;IACR,iDAAK,CAAA;IACL,iDAAK,CAAA;AACP,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAuCD;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,sBAAsC;CAAI;AAAzF,8DAAyF;AAczF;;;GAGG;AACH,MAAsB,wBAAwB;IAA9C;QACS,oBAAe,GAA8B,IAAI,yBAAyB,EAAE,CAAC;IAItF,CAAC;CAAA;AALD,4DAKC;AAED;;;;GAIG;AACH,MAAsB,gCAAiC,SAAQ,wBAAwB;IAC9E,KAAK,CAAC,mBAAmB;QAC9B,OAAO,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF;AAJD,4EAIC;AAED;;;;GAIG;AACH,MAAsB,8BAA+B,SAAQ,wBAAwB;IAC5E,KAAK,CAAC,qBAAqB;QAChC,OAAO,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF;AAJD,wEAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { PropertyCategory } from \"../../PropertyDataProvider\";\n\n/**\n * Enumeration of possible component filtered types\n * @public\n */\nexport enum FilteredType {\n Category,\n Label,\n Value\n}\n\n/**\n * Data structure for storing [[IPropertyDataFilterer]] matching results\n * @public\n */\nexport interface PropertyDataFilterResult {\n /** Indicates whether provided item matched filter */\n matchesFilter: boolean;\n\n /**\n * Indicates whether descendants nodes should be forcefully included in filtered results.\n * Can only be true for nodes that have `matchesFilter` set to true.\n */\n shouldForceIncludeDescendants?: boolean;\n\n /**\n * Indicates whether parents of node should be expanded up to this match node.\n * Can only be true for nodes that have `matchesFilter` set to true.\n */\n shouldExpandNodeParents?: boolean;\n\n /**\n * Indicates how many times filter was matched in the provided item.\n */\n matchesCount?: number;\n\n /**\n * Indicates what item types were matched.\n */\n filteredTypes?: FilteredType[];\n}\n\n/**\n * A signature for property data change listeners\n * @public\n */\nexport declare type PropertyFilterChangesListener = () => void;\n\n/**\n * An event broadcasted when property filter changes\n * @public\n */\nexport class PropertyFilterChangeEvent extends BeEvent<PropertyFilterChangesListener> { }\n\n/**\n * An interface for a filterer that filters [[PropertyData]] based on content of [[PropertyRecord]]\n * and [[PropertyCategory]] objects.\n * @public\n */\nexport interface IPropertyDataFilterer {\n readonly isActive: boolean;\n recordMatchesFilter: (node: PropertyRecord, parents: PropertyRecord[]) => Promise<PropertyDataFilterResult>;\n categoryMatchesFilter: (node: PropertyCategory, parents: PropertyCategory[]) => Promise<PropertyDataFilterResult>;\n onFilterChanged: PropertyFilterChangeEvent;\n}\n\n/**\n * An abstract implementation of [[IPropertyDataFilterer]] to share common behavior between different implementations.\n * @public\n */\nexport abstract class PropertyDataFiltererBase implements IPropertyDataFilterer {\n public onFilterChanged: PropertyFilterChangeEvent = new PropertyFilterChangeEvent();\n public abstract get isActive(): boolean;\n public abstract recordMatchesFilter(node: PropertyRecord, parents: PropertyRecord[]): Promise<PropertyDataFilterResult>;\n public abstract categoryMatchesFilter(node: PropertyCategory, parents: PropertyCategory[]): Promise<PropertyDataFilterResult>;\n}\n\n/**\n * An abstract implementation of [[IPropertyDataFilterer]] that can be used as base for all\n * filterers that filter based on [[PropertyCategory]] content.\n * @public\n */\nexport abstract class PropertyCategoryDataFiltererBase extends PropertyDataFiltererBase {\n public async recordMatchesFilter(): Promise<PropertyDataFilterResult> {\n return { matchesFilter: !this.isActive };\n }\n}\n\n/**\n * An abstract implementation of [[IPropertyDataFilterer]] that can be used as base for all\n * filterers that filter based on [[PropertyRecord]] content.\n * @public\n */\nexport abstract class PropertyRecordDataFiltererBase extends PropertyDataFiltererBase {\n public async categoryMatchesFilter(): Promise<PropertyDataFilterResult> {\n return { matchesFilter: !this.isActive };\n }\n}\n"]}
@@ -6,8 +6,8 @@ import { PropertyGridEventHandler } from "./PropertyGridEventHandler";
6
6
  import { IPropertyGridModel } from "./PropertyGridModel";
7
7
  import { IPropertyGridModelSource, PropertyGridModelSource } from "./PropertyGridModelSource";
8
8
  /**
9
- * Custom hook that gets propertyData from data provider and subscribes to further data changes.
10
- * @beta
9
+ * Custom hook that gets [[PropertyData]] from given [[IPropertyDataProvider]] and subscribes to further data changes.
10
+ * @public
11
11
  */
12
12
  export declare function usePropertyData(props: {
13
13
  dataProvider: IPropertyDataProvider;
@@ -16,14 +16,14 @@ export declare function usePropertyData(props: {
16
16
  inProgress: boolean;
17
17
  };
18
18
  /**
19
- * Custom hook that creates a PropertyGridModelSource and subscribes it to data updates from the data provider.
19
+ * Custom hook that creates a [[PropertyGridModelSource]] and subscribes it to data updates from the data provider.
20
20
  * @beta
21
21
  */
22
22
  export declare function usePropertyGridModelSource(props: {
23
23
  dataProvider: IPropertyDataProvider;
24
24
  }): PropertyGridModelSource;
25
25
  /**
26
- * Custom hook that creates memoized version of PropertyGridEventHandler that modifies given modelSource
26
+ * Custom hook that creates memoized version of [[PropertyGridEventHandler]] that modifies given modelSource
27
27
  * @beta
28
28
  */
29
29
  export declare function usePropertyGridEventHandler(props: {
@@ -14,8 +14,8 @@ const MutableGridItemFactory_1 = require("./flat-items/MutableGridItemFactory");
14
14
  const PropertyGridEventHandler_1 = require("./PropertyGridEventHandler");
15
15
  const PropertyGridModelSource_1 = require("./PropertyGridModelSource");
16
16
  /**
17
- * Custom hook that gets propertyData from data provider and subscribes to further data changes.
18
- * @beta
17
+ * Custom hook that gets [[PropertyData]] from given [[IPropertyDataProvider]] and subscribes to further data changes.
18
+ * @public
19
19
  */
20
20
  function usePropertyData(props) {
21
21
  const { dataProvider } = props;
@@ -25,13 +25,13 @@ function usePropertyData(props) {
25
25
  triggerForcedUpdate();
26
26
  });
27
27
  }, [dataProvider]);
28
- // ForcedUpdate is added to dependency list to re-memo getData promise when onDataChanged emits an event.
28
+ // forcedUpdate is added to dependency list to re-memo getData promise when onDataChanged emits an event.
29
29
  // eslint-disable-next-line react-hooks/exhaustive-deps
30
30
  return (0, UseDebouncedAsyncValue_1.useDebouncedAsyncValue)((0, react_1.useCallback)(async () => dataProvider.getData(), [dataProvider, forcedUpdate]));
31
31
  }
32
32
  exports.usePropertyData = usePropertyData;
33
33
  /**
34
- * Custom hook that creates a PropertyGridModelSource and subscribes it to data updates from the data provider.
34
+ * Custom hook that creates a [[PropertyGridModelSource]] and subscribes it to data updates from the data provider.
35
35
  * @beta
36
36
  */
37
37
  function usePropertyGridModelSource(props) {
@@ -48,7 +48,7 @@ function usePropertyGridModelSource(props) {
48
48
  }
49
49
  exports.usePropertyGridModelSource = usePropertyGridModelSource;
50
50
  /**
51
- * Custom hook that creates memoized version of PropertyGridEventHandler that modifies given modelSource
51
+ * Custom hook that creates memoized version of [[PropertyGridEventHandler]] that modifies given modelSource
52
52
  * @beta
53
53
  */
54
54
  function usePropertyGridEventHandler(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyGridHooks.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/internal/PropertyGridHooks.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAA8E;AAC9E,gFAA6E;AAE7E,gFAA6E;AAC7E,yEAAsE;AAEtE,uEAA8F;AAE9F;;;GAGG;AACH,SAAgB,eAAe,CAAC,KAA8C;IAC5E,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/B,MAAM,CAAC,YAAY,EAAE,mBAAmB,CAAC,GAAG,IAAA,kBAAU,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACvE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,YAAY,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,EAAE;YACjD,mBAAmB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,yGAAyG;IACzG,uDAAuD;IACvD,OAAO,IAAA,+CAAsB,EAAC,IAAA,mBAAW,EAAC,KA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C,CAAC;QACF,YAAY,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,oDAaC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { useCallback, useEffect, useMemo, useReducer, useState } from \"react\";\nimport { useDebouncedAsyncValue } from \"../../common/UseDebouncedAsyncValue\";\nimport { IPropertyDataProvider } from \"../PropertyDataProvider\";\nimport { MutableGridItemFactory } from \"./flat-items/MutableGridItemFactory\";\nimport { PropertyGridEventHandler } from \"./PropertyGridEventHandler\";\nimport { IPropertyGridModel } from \"./PropertyGridModel\";\nimport { IPropertyGridModelSource, PropertyGridModelSource } from \"./PropertyGridModelSource\";\n\n/**\n * Custom hook that gets propertyData from data provider and subscribes to further data changes.\n * @beta\n */\nexport function usePropertyData(props: { dataProvider: IPropertyDataProvider }) {\n const { dataProvider } = props;\n\n const [forcedUpdate, triggerForcedUpdate] = useReducer(() => ({}), {});\n useEffect(() => {\n return dataProvider.onDataChanged.addListener(() => {\n triggerForcedUpdate();\n });\n }, [dataProvider]);\n\n // ForcedUpdate is added to dependency list to re-memo getData promise when onDataChanged emits an event.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useDebouncedAsyncValue(useCallback(async () => dataProvider.getData(), [dataProvider, forcedUpdate]));\n}\n\n/**\n * Custom hook that creates a PropertyGridModelSource and subscribes it to data updates from the data provider.\n * @beta\n */\nexport function usePropertyGridModelSource(props: { dataProvider: IPropertyDataProvider }) {\n const { value: propertyData } = usePropertyData(props);\n const { dataProvider } = { ...props };\n\n // Model source needs to be recreated if data provider changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const modelSource = useMemo(() => new PropertyGridModelSource(new MutableGridItemFactory()), [dataProvider]);\n\n useEffect(() => {\n if (propertyData)\n modelSource.setPropertyData(propertyData);\n }, [modelSource, propertyData]);\n\n return modelSource;\n}\n\n/**\n * Custom hook that creates memoized version of PropertyGridEventHandler that modifies given modelSource\n * @beta\n */\nexport function usePropertyGridEventHandler(props: { modelSource: IPropertyGridModelSource }) {\n return useMemo(() => new PropertyGridEventHandler(props.modelSource), [props.modelSource]);\n}\n\n/**\n * Custom hook that automatically listens and retrieves latest model from model source\n * @beta\n */\nexport function usePropertyGridModel(props: { modelSource: IPropertyGridModelSource }) {\n const { modelSource } = { ...props };\n const [model, setModel] = useState<IPropertyGridModel>();\n\n useEffect(() => {\n const modelChanged = () => {\n setModel(modelSource.getModel());\n };\n modelChanged();\n return modelSource.onModelChanged.addListener(modelChanged);\n }, [modelSource]);\n\n return model;\n}\n"]}
1
+ {"version":3,"file":"PropertyGridHooks.js","sourceRoot":"","sources":["../../../../src/components-react/propertygrid/internal/PropertyGridHooks.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iCAA8E;AAC9E,gFAA6E;AAE7E,gFAA6E;AAC7E,yEAAsE;AAEtE,uEAA8F;AAE9F;;;GAGG;AACH,SAAgB,eAAe,CAAC,KAA8C;IAC5E,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/B,MAAM,CAAC,YAAY,EAAE,mBAAmB,CAAC,GAAG,IAAA,kBAAU,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACvE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,YAAY,CAAC,aAAa,CAAC,WAAW,CAAC,GAAG,EAAE;YACjD,mBAAmB,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,yGAAyG;IACzG,uD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QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnC,CAAC,CAAC;QACF,YAAY,EAAE,CAAC;QACf,OAAO,WAAW,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,oDAaC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport { useCallback, useEffect, useMemo, useReducer, useState } from \"react\";\nimport { useDebouncedAsyncValue } from \"../../common/UseDebouncedAsyncValue\";\nimport { IPropertyDataProvider } from \"../PropertyDataProvider\";\nimport { MutableGridItemFactory } from \"./flat-items/MutableGridItemFactory\";\nimport { PropertyGridEventHandler } from \"./PropertyGridEventHandler\";\nimport { IPropertyGridModel } from \"./PropertyGridModel\";\nimport { IPropertyGridModelSource, PropertyGridModelSource } from \"./PropertyGridModelSource\";\n\n/**\n * Custom hook that gets [[PropertyData]] from given [[IPropertyDataProvider]] and subscribes to further data changes.\n * @public\n */\nexport function usePropertyData(props: { dataProvider: IPropertyDataProvider }) {\n const { dataProvider } = props;\n\n const [forcedUpdate, triggerForcedUpdate] = useReducer(() => ({}), {});\n useEffect(() => {\n return dataProvider.onDataChanged.addListener(() => {\n triggerForcedUpdate();\n });\n }, [dataProvider]);\n\n // forcedUpdate is added to dependency list to re-memo getData promise when onDataChanged emits an event.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return useDebouncedAsyncValue(useCallback(async () => dataProvider.getData(), [dataProvider, forcedUpdate]));\n}\n\n/**\n * Custom hook that creates a [[PropertyGridModelSource]] and subscribes it to data updates from the data provider.\n * @beta\n */\nexport function usePropertyGridModelSource(props: { dataProvider: IPropertyDataProvider }) {\n const { value: propertyData } = usePropertyData(props);\n const { dataProvider } = { ...props };\n\n // Model source needs to be recreated if data provider changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const modelSource = useMemo(() => new PropertyGridModelSource(new MutableGridItemFactory()), [dataProvider]);\n\n useEffect(() => {\n if (propertyData)\n modelSource.setPropertyData(propertyData);\n }, [modelSource, propertyData]);\n\n return modelSource;\n}\n\n/**\n * Custom hook that creates memoized version of [[PropertyGridEventHandler]] that modifies given modelSource\n * @beta\n */\nexport function usePropertyGridEventHandler(props: { modelSource: IPropertyGridModelSource }) {\n return useMemo(() => new PropertyGridEventHandler(props.modelSource), [props.modelSource]);\n}\n\n/**\n * Custom hook that automatically listens and retrieves latest model from model source\n * @beta\n */\nexport function usePropertyGridModel(props: { modelSource: IPropertyGridModelSource }) {\n const { modelSource } = { ...props };\n const [model, setModel] = useState<IPropertyGridModel>();\n\n useEffect(() => {\n const modelChanged = () => {\n setModel(modelSource.getModel());\n };\n modelChanged();\n return modelSource.onModelChanged.addListener(modelChanged);\n }, [modelSource]);\n\n return model;\n}\n"]}