@itwin/grouping-mapping-widget 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/lib/cjs/WidgetShell/GroupingMappingContent.js +2 -2
  2. package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -1
  3. package/lib/cjs/components/Constants.d.ts +3 -0
  4. package/lib/cjs/components/Constants.js +5 -2
  5. package/lib/cjs/components/Constants.js.map +1 -1
  6. package/lib/cjs/components/GroupingMappingContext.js +12 -14
  7. package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
  8. package/lib/cjs/components/Groups/Editing/GroupAction.js +5 -1
  9. package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
  10. package/lib/cjs/components/Groups/GroupsVisualization.js +44 -12
  11. package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
  12. package/lib/cjs/components/Groups/groupsHelpers.d.ts +2 -1
  13. package/lib/cjs/components/Groups/groupsHelpers.js +8 -5
  14. package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
  15. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
  16. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  17. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
  18. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  19. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
  20. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +17 -0
  21. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
  22. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
  23. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +16 -0
  24. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
  25. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
  26. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +17 -0
  27. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
  28. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
  29. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +21 -0
  30. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
  31. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
  32. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +79 -0
  33. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
  34. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
  35. package/lib/cjs/components/Mappings/Import/SelectIModel.js +1 -2
  36. package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
  37. package/lib/cjs/components/Mappings/MappingListItem.d.ts +20 -0
  38. package/lib/cjs/components/Mappings/MappingListItem.js +96 -0
  39. package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -0
  40. package/lib/cjs/components/Mappings/MappingListItem.scss +25 -0
  41. package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -0
  42. package/lib/cjs/components/Mappings/MappingsView.js +28 -4
  43. package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
  44. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
  45. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
  46. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  47. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
  48. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +55 -0
  49. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
  50. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
  51. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +29 -5
  52. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  53. package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
  54. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +42 -0
  55. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -0
  56. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
  57. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  58. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
  59. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  60. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
  61. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
  62. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +28 -59
  63. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  64. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
  65. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
  66. package/lib/cjs/components/Properties/GroupColorToggle.js +30 -26
  67. package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
  68. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +61 -166
  69. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  70. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
  71. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
  72. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  73. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
  74. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  75. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
  76. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +147 -0
  77. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
  78. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
  79. package/lib/cjs/components/Properties/PropertyMenu.js +11 -15
  80. package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
  81. package/lib/cjs/components/Properties/PropertyTable.js +1 -1
  82. package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
  83. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
  84. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +12 -0
  85. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
  86. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
  87. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +12 -0
  88. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
  89. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
  90. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +12 -0
  91. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
  92. package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +1 -2
  93. package/lib/cjs/components/SharedComponents/DeleteModal.js +1 -2
  94. package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
  95. package/lib/cjs/components/context/ExtractionStateJobContext.d.ts +8 -0
  96. package/lib/cjs/components/context/ExtractionStateJobContext.js +44 -0
  97. package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -0
  98. package/lib/cjs/components/context/PropertiesGroupColorContext.d.ts +8 -0
  99. package/lib/cjs/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +7 -10
  100. package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -0
  101. package/lib/esm/WidgetShell/GroupingMappingContent.js +2 -2
  102. package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
  103. package/lib/esm/components/Constants.d.ts +3 -0
  104. package/lib/esm/components/Constants.js +3 -0
  105. package/lib/esm/components/Constants.js.map +1 -1
  106. package/lib/esm/components/GroupingMappingContext.js +12 -14
  107. package/lib/esm/components/GroupingMappingContext.js.map +1 -1
  108. package/lib/esm/components/Groups/Editing/GroupAction.js +5 -1
  109. package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
  110. package/lib/esm/components/Groups/GroupsVisualization.js +45 -13
  111. package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
  112. package/lib/esm/components/Groups/groupsHelpers.d.ts +2 -1
  113. package/lib/esm/components/Groups/groupsHelpers.js +6 -4
  114. package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
  115. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
  116. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  117. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
  118. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  119. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
  120. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +10 -0
  121. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
  122. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
  123. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +9 -0
  124. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
  125. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
  126. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +10 -0
  127. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
  128. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
  129. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +14 -0
  130. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
  131. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
  132. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js +52 -0
  133. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
  134. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
  135. package/lib/esm/components/Mappings/Import/SelectIModel.js +1 -2
  136. package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
  137. package/lib/esm/components/Mappings/MappingListItem.d.ts +20 -0
  138. package/lib/esm/components/Mappings/MappingListItem.js +69 -0
  139. package/lib/esm/components/Mappings/MappingListItem.js.map +1 -0
  140. package/lib/esm/components/Mappings/MappingListItem.scss +25 -0
  141. package/lib/esm/components/Mappings/MappingsView.d.ts +2 -0
  142. package/lib/esm/components/Mappings/MappingsView.js +30 -6
  143. package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
  144. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
  145. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
  146. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  147. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
  148. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +49 -0
  149. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
  150. package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
  151. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +30 -6
  152. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  153. package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
  154. package/lib/esm/components/Mappings/hooks/useRunExtraction.js +38 -0
  155. package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -0
  156. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
  157. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  158. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
  159. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  160. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
  161. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
  162. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +29 -60
  163. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  164. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
  165. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
  166. package/lib/esm/components/Properties/GroupColorToggle.js +32 -28
  167. package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
  168. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +63 -168
  169. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  170. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
  171. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
  172. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  173. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
  174. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  175. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
  176. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +117 -0
  177. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
  178. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
  179. package/lib/esm/components/Properties/PropertyMenu.js +12 -16
  180. package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
  181. package/lib/esm/components/Properties/PropertyTable.js +1 -1
  182. package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
  183. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
  184. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +8 -0
  185. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
  186. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
  187. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +8 -0
  188. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
  189. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
  190. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +8 -0
  191. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
  192. package/lib/esm/components/SharedComponents/DeleteModal.d.ts +1 -2
  193. package/lib/esm/components/SharedComponents/DeleteModal.js +1 -2
  194. package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
  195. package/lib/esm/components/context/ExtractionStateJobContext.d.ts +8 -0
  196. package/lib/esm/components/context/ExtractionStateJobContext.js +17 -0
  197. package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -0
  198. package/lib/esm/components/context/PropertiesGroupColorContext.d.ts +8 -0
  199. package/lib/esm/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +5 -8
  200. package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -0
  201. package/package.json +3 -2
  202. package/lib/cjs/components/Properties/hooks/useFetchData.d.ts +0 -7
  203. package/lib/cjs/components/Properties/hooks/useFetchData.js +0 -43
  204. package/lib/cjs/components/Properties/hooks/useFetchData.js.map +0 -1
  205. package/lib/cjs/components/context/PropertiesContext.d.ts +0 -15
  206. package/lib/cjs/components/context/PropertiesContext.js.map +0 -1
  207. package/lib/esm/components/Properties/hooks/useFetchData.d.ts +0 -7
  208. package/lib/esm/components/Properties/hooks/useFetchData.js +0 -37
  209. package/lib/esm/components/Properties/hooks/useFetchData.js.map +0 -1
  210. package/lib/esm/components/context/PropertiesContext.d.ts +0 -15
  211. package/lib/esm/components/context/PropertiesContext.js.map +0 -1
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCombinedFetchRefresh = exports.useRefreshData = exports.useFetchData = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const react_1 = require("react");
9
- const utils_1 = require("../../../common/utils");
10
- const fetchData = async (setData, fetchFunc, setIsLoading) => {
11
- try {
12
- setIsLoading(true);
13
- const data = await fetchFunc();
14
- setData(data ?? []);
15
- }
16
- catch (error) {
17
- (0, utils_1.handleError)(error.status);
18
- }
19
- finally {
20
- setIsLoading(false);
21
- }
22
- };
23
- const useFetchData = (fetchFunc, setData, setIsLoading) => {
24
- (0, react_1.useEffect)(() => {
25
- void fetchData(setData, fetchFunc, setIsLoading);
26
- }, [fetchFunc, setData, setIsLoading]);
27
- };
28
- exports.useFetchData = useFetchData;
29
- const useRefreshData = (setData, fetchFunc, setIsLoading) => {
30
- return (0, react_1.useCallback)(async () => {
31
- setData([]);
32
- await fetchData(setData, fetchFunc, setIsLoading);
33
- }, [setData, fetchFunc, setIsLoading]);
34
- };
35
- exports.useRefreshData = useRefreshData;
36
- const useCombinedFetchRefresh = (fetchFunc, setData) => {
37
- const [isLoading, setIsLoading] = (0, react_1.useState)(true);
38
- (0, exports.useFetchData)(fetchFunc, setData, setIsLoading);
39
- const refreshData = (0, exports.useRefreshData)(setData, fetchFunc, setIsLoading);
40
- return { isLoading, refreshData };
41
- };
42
- exports.useCombinedFetchRefresh = useCombinedFetchRefresh;
43
- //# sourceMappingURL=useFetchData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFetchData.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useFetchData.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,iCAAyD;AACzD,iDAAoD;AAEpD,MAAM,SAAS,GAAG,KAAK,EACrB,OAA4B,EAC5B,SAAyC,EACzC,YAA0C,EAC1C,EAAE;IACF,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;KACrB;IAAC,OAAO,KAAU,EAAE;QACnB,IAAA,mBAAW,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC3B;YAAS;QACR,YAAY,CAAC,KAAK,CAAC,CAAC;KACrB;AACH,CAAC,CAAC;AAEK,MAAM,YAAY,GAAG,CAC1B,SAAyC,EACzC,OAA4B,EAC5B,YAA0C,EAC1C,EAAE;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,KAAK,SAAS,CACZ,OAAO,EACP,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC;AAbW,QAAA,YAAY,gBAavB;AAEK,MAAM,cAAc,GAAG,CAC5B,OAA4B,EAC5B,SAAyC,EACzC,YAA0C,EACrB,EAAE;IACvB,OAAO,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAC5B,OAAO,CAAC,EAAE,CAAC,CAAC;QACZ,MAAM,SAAS,CACb,OAAO,EACP,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC;AAbW,QAAA,cAAc,kBAazB;AAEK,MAAM,uBAAuB,GAAG,CAAI,SAAyC,EAAE,OAA4B,EAAE,EAAE;IACpH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAU,IAAI,CAAC,CAAC;IAC1D,IAAA,oBAAY,EAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,IAAA,sBAAc,EAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACrE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useCallback, useEffect, useState } from \"react\";\nimport { handleError } from \"../../../common/utils\";\n\nconst fetchData = async<T>(\n setData: (data: T[]) => void,\n fetchFunc: () => Promise<T[] | undefined>,\n setIsLoading: (isLoading: boolean) => void,\n) => {\n try {\n setIsLoading(true);\n const data = await fetchFunc();\n setData(data ?? []);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\nexport const useFetchData = <T>(\n fetchFunc: () => Promise<T[] | undefined>,\n setData: (data: T[]) => void,\n setIsLoading: (isLoading: boolean) => void,\n) => {\n\n useEffect(() => {\n void fetchData(\n setData,\n fetchFunc,\n setIsLoading,\n );\n }, [fetchFunc, setData, setIsLoading]);\n};\n\nexport const useRefreshData = <T>(\n setData: (data: T[]) => void,\n fetchFunc: () => Promise<T[] | undefined>,\n setIsLoading: (isLoading: boolean) => void,\n): () => Promise<void> => {\n return useCallback(async () => {\n setData([]);\n await fetchData(\n setData,\n fetchFunc,\n setIsLoading,\n );\n }, [setData, fetchFunc, setIsLoading]);\n};\n\nexport const useCombinedFetchRefresh = <T>(fetchFunc: () => Promise<T[] | undefined>, setData: (data: T[]) => void) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n useFetchData(fetchFunc, setData, setIsLoading);\n const refreshData = useRefreshData(setData, fetchFunc, setIsLoading);\n return { isLoading, refreshData };\n};\n"]}
@@ -1,15 +0,0 @@
1
- import * as React from "react";
2
- import type { CalculatedProperty, CustomCalculation, GroupProperty } from "@itwin/insights-client";
3
- export interface Properties {
4
- showGroupColor: boolean;
5
- groupProperties?: GroupProperty[];
6
- calculatedProperties?: CalculatedProperty[];
7
- customCalculationProperties?: CustomCalculation[];
8
- setGroupProperties: (groupProperties: GroupProperty[]) => void;
9
- setCalculatedProperties: (calculatedProperties: CalculatedProperty[]) => void;
10
- setCustomCalculationProperties: (customCalculationProperties: CustomCalculation[]) => void;
11
- setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;
12
- }
13
- export declare const PropertiesContext: React.Context<Properties>;
14
- export declare const usePropertiesContext: () => Properties;
15
- //# sourceMappingURL=PropertiesContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertiesContext.js","sourceRoot":"","sources":["../../../../src/components/context/PropertiesContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAclB,QAAA,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAa;IAC/D,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC;IAClC,8BAA8B,EAAE,GAAG,EAAE,GAAG,CAAC;IACzC,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEI,MAAM,oBAAoB,GAAG,GAAe,EAAE;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,yBAAiB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,oBAAoB,wBAQ/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { CalculatedProperty, CustomCalculation, GroupProperty } from \"@itwin/insights-client\";\n\nexport interface Properties {\n showGroupColor: boolean;\n groupProperties?: GroupProperty[];\n calculatedProperties?: CalculatedProperty[];\n customCalculationProperties?: CustomCalculation[];\n setGroupProperties: (groupProperties: GroupProperty[]) => void;\n setCalculatedProperties: (calculatedProperties: CalculatedProperty[]) => void;\n setCustomCalculationProperties: (customCalculationProperties: CustomCalculation[]) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const PropertiesContext = React.createContext<Properties>({\n showGroupColor: false,\n setGroupProperties: () => { },\n setCalculatedProperties: () => { },\n setCustomCalculationProperties: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const usePropertiesContext = (): Properties => {\n const context = React.useContext(PropertiesContext);\n if (!context) {\n throw new Error(\n \"usePropertiesContext should be used within a PropertiesContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -1,7 +0,0 @@
1
- export declare const useFetchData: <T>(fetchFunc: () => Promise<T[] | undefined>, setData: (data: T[]) => void, setIsLoading: (isLoading: boolean) => void) => void;
2
- export declare const useRefreshData: <T>(setData: (data: T[]) => void, fetchFunc: () => Promise<T[] | undefined>, setIsLoading: (isLoading: boolean) => void) => () => Promise<void>;
3
- export declare const useCombinedFetchRefresh: <T>(fetchFunc: () => Promise<T[] | undefined>, setData: (data: T[]) => void) => {
4
- isLoading: boolean;
5
- refreshData: () => Promise<void>;
6
- };
7
- //# sourceMappingURL=useFetchData.d.ts.map
@@ -1,37 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import { useCallback, useEffect, useState } from "react";
6
- import { handleError } from "../../../common/utils";
7
- const fetchData = async (setData, fetchFunc, setIsLoading) => {
8
- try {
9
- setIsLoading(true);
10
- const data = await fetchFunc();
11
- setData(data ?? []);
12
- }
13
- catch (error) {
14
- handleError(error.status);
15
- }
16
- finally {
17
- setIsLoading(false);
18
- }
19
- };
20
- export const useFetchData = (fetchFunc, setData, setIsLoading) => {
21
- useEffect(() => {
22
- void fetchData(setData, fetchFunc, setIsLoading);
23
- }, [fetchFunc, setData, setIsLoading]);
24
- };
25
- export const useRefreshData = (setData, fetchFunc, setIsLoading) => {
26
- return useCallback(async () => {
27
- setData([]);
28
- await fetchData(setData, fetchFunc, setIsLoading);
29
- }, [setData, fetchFunc, setIsLoading]);
30
- };
31
- export const useCombinedFetchRefresh = (fetchFunc, setData) => {
32
- const [isLoading, setIsLoading] = useState(true);
33
- useFetchData(fetchFunc, setData, setIsLoading);
34
- const refreshData = useRefreshData(setData, fetchFunc, setIsLoading);
35
- return { isLoading, refreshData };
36
- };
37
- //# sourceMappingURL=useFetchData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFetchData.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useFetchData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,SAAS,GAAG,KAAK,EACrB,OAA4B,EAC5B,SAAyC,EACzC,YAA0C,EAC1C,EAAE;IACF,IAAI;QACF,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,SAAS,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;KACrB;IAAC,OAAO,KAAU,EAAE;QACnB,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KAC3B;YAAS;QACR,YAAY,CAAC,KAAK,CAAC,CAAC;KACrB;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,SAAyC,EACzC,OAA4B,EAC5B,YAA0C,EAC1C,EAAE;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,SAAS,CACZ,OAAO,EACP,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,OAA4B,EAC5B,SAAyC,EACzC,YAA0C,EACrB,EAAE;IACvB,OAAO,WAAW,CAAC,KAAK,IAAI,EAAE;QAC5B,OAAO,CAAC,EAAE,CAAC,CAAC;QACZ,MAAM,SAAS,CACb,OAAO,EACP,SAAS,EACT,YAAY,CACb,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAI,SAAyC,EAAE,OAA4B,EAAE,EAAE;IACpH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAC1D,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAC/C,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACrE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACpC,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useCallback, useEffect, useState } from \"react\";\nimport { handleError } from \"../../../common/utils\";\n\nconst fetchData = async<T>(\n setData: (data: T[]) => void,\n fetchFunc: () => Promise<T[] | undefined>,\n setIsLoading: (isLoading: boolean) => void,\n) => {\n try {\n setIsLoading(true);\n const data = await fetchFunc();\n setData(data ?? []);\n } catch (error: any) {\n handleError(error.status);\n } finally {\n setIsLoading(false);\n }\n};\n\nexport const useFetchData = <T>(\n fetchFunc: () => Promise<T[] | undefined>,\n setData: (data: T[]) => void,\n setIsLoading: (isLoading: boolean) => void,\n) => {\n\n useEffect(() => {\n void fetchData(\n setData,\n fetchFunc,\n setIsLoading,\n );\n }, [fetchFunc, setData, setIsLoading]);\n};\n\nexport const useRefreshData = <T>(\n setData: (data: T[]) => void,\n fetchFunc: () => Promise<T[] | undefined>,\n setIsLoading: (isLoading: boolean) => void,\n): () => Promise<void> => {\n return useCallback(async () => {\n setData([]);\n await fetchData(\n setData,\n fetchFunc,\n setIsLoading,\n );\n }, [setData, fetchFunc, setIsLoading]);\n};\n\nexport const useCombinedFetchRefresh = <T>(fetchFunc: () => Promise<T[] | undefined>, setData: (data: T[]) => void) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n useFetchData(fetchFunc, setData, setIsLoading);\n const refreshData = useRefreshData(setData, fetchFunc, setIsLoading);\n return { isLoading, refreshData };\n};\n"]}
@@ -1,15 +0,0 @@
1
- import * as React from "react";
2
- import type { CalculatedProperty, CustomCalculation, GroupProperty } from "@itwin/insights-client";
3
- export interface Properties {
4
- showGroupColor: boolean;
5
- groupProperties?: GroupProperty[];
6
- calculatedProperties?: CalculatedProperty[];
7
- customCalculationProperties?: CustomCalculation[];
8
- setGroupProperties: (groupProperties: GroupProperty[]) => void;
9
- setCalculatedProperties: (calculatedProperties: CalculatedProperty[]) => void;
10
- setCustomCalculationProperties: (customCalculationProperties: CustomCalculation[]) => void;
11
- setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;
12
- }
13
- export declare const PropertiesContext: React.Context<Properties>;
14
- export declare const usePropertiesContext: () => Properties;
15
- //# sourceMappingURL=PropertiesContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PropertiesContext.js","sourceRoot":"","sources":["../../../../src/components/context/PropertiesContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAa;IAC/D,cAAc,EAAE,KAAK;IACrB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC;IAClC,8BAA8B,EAAE,GAAG,EAAE,GAAG,CAAC;IACzC,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAe,EAAE;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { CalculatedProperty, CustomCalculation, GroupProperty } from \"@itwin/insights-client\";\n\nexport interface Properties {\n showGroupColor: boolean;\n groupProperties?: GroupProperty[];\n calculatedProperties?: CalculatedProperty[];\n customCalculationProperties?: CustomCalculation[];\n setGroupProperties: (groupProperties: GroupProperty[]) => void;\n setCalculatedProperties: (calculatedProperties: CalculatedProperty[]) => void;\n setCustomCalculationProperties: (customCalculationProperties: CustomCalculation[]) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const PropertiesContext = React.createContext<Properties>({\n showGroupColor: false,\n setGroupProperties: () => { },\n setCalculatedProperties: () => { },\n setCustomCalculationProperties: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const usePropertiesContext = (): Properties => {\n const context = React.useContext(PropertiesContext);\n if (!context) {\n throw new Error(\n \"usePropertiesContext should be used within a PropertiesContext provider\"\n );\n }\n return context;\n};\n"]}