@itwin/grouping-mapping-widget 0.23.1 → 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 (203) 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/GroupsVisualization.js +31 -9
  9. package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
  10. package/lib/cjs/components/Groups/groupsHelpers.d.ts +1 -1
  11. package/lib/cjs/components/Groups/groupsHelpers.js +1 -1
  12. package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
  13. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
  14. package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  15. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
  16. package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  17. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
  18. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +17 -0
  19. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
  20. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
  21. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +16 -0
  22. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
  23. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
  24. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +17 -0
  25. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
  26. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
  27. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +21 -0
  28. package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
  29. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
  30. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +79 -0
  31. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
  32. package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
  33. package/lib/cjs/components/Mappings/MappingListItem.d.ts +20 -0
  34. package/lib/cjs/components/Mappings/MappingListItem.js +96 -0
  35. package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -0
  36. package/lib/cjs/components/Mappings/MappingListItem.scss +25 -0
  37. package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -0
  38. package/lib/cjs/components/Mappings/MappingsView.js +28 -4
  39. package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
  40. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
  41. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
  42. package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  43. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
  44. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +55 -0
  45. package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
  46. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
  47. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +29 -5
  48. package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  49. package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
  50. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +42 -0
  51. package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -0
  52. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
  53. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  54. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
  55. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  56. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
  57. package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
  58. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +28 -59
  59. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  60. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
  61. package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
  62. package/lib/cjs/components/Properties/GroupColorToggle.js +30 -26
  63. package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
  64. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +61 -166
  65. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  66. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
  67. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
  68. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  69. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
  70. package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  71. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
  72. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +147 -0
  73. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
  74. package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
  75. package/lib/cjs/components/Properties/PropertyMenu.js +11 -15
  76. package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
  77. package/lib/cjs/components/Properties/PropertyTable.js +1 -1
  78. package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
  79. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
  80. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +12 -0
  81. package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
  82. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
  83. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +12 -0
  84. package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
  85. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
  86. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +12 -0
  87. package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
  88. package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +1 -2
  89. package/lib/cjs/components/SharedComponents/DeleteModal.js +1 -2
  90. package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
  91. package/lib/cjs/components/context/ExtractionStateJobContext.d.ts +8 -0
  92. package/lib/cjs/components/context/ExtractionStateJobContext.js +44 -0
  93. package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -0
  94. package/lib/cjs/components/context/PropertiesGroupColorContext.d.ts +8 -0
  95. package/lib/cjs/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +7 -10
  96. package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -0
  97. package/lib/esm/WidgetShell/GroupingMappingContent.js +2 -2
  98. package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
  99. package/lib/esm/components/Constants.d.ts +3 -0
  100. package/lib/esm/components/Constants.js +3 -0
  101. package/lib/esm/components/Constants.js.map +1 -1
  102. package/lib/esm/components/GroupingMappingContext.js +12 -14
  103. package/lib/esm/components/GroupingMappingContext.js.map +1 -1
  104. package/lib/esm/components/Groups/GroupsVisualization.js +31 -9
  105. package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
  106. package/lib/esm/components/Groups/groupsHelpers.d.ts +1 -1
  107. package/lib/esm/components/Groups/groupsHelpers.js +1 -1
  108. package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
  109. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
  110. package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
  111. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
  112. package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
  113. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
  114. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +10 -0
  115. package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
  116. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
  117. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +9 -0
  118. package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
  119. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
  120. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +10 -0
  121. package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
  122. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
  123. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +14 -0
  124. package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
  125. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
  126. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js +52 -0
  127. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
  128. package/lib/esm/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
  129. package/lib/esm/components/Mappings/MappingListItem.d.ts +20 -0
  130. package/lib/esm/components/Mappings/MappingListItem.js +69 -0
  131. package/lib/esm/components/Mappings/MappingListItem.js.map +1 -0
  132. package/lib/esm/components/Mappings/MappingListItem.scss +25 -0
  133. package/lib/esm/components/Mappings/MappingsView.d.ts +2 -0
  134. package/lib/esm/components/Mappings/MappingsView.js +30 -6
  135. package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
  136. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
  137. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
  138. package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
  139. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
  140. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +49 -0
  141. package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
  142. package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
  143. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +30 -6
  144. package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
  145. package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
  146. package/lib/esm/components/Mappings/hooks/useRunExtraction.js +38 -0
  147. package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -0
  148. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
  149. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
  150. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
  151. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
  152. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
  153. package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
  154. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +29 -60
  155. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
  156. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
  157. package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
  158. package/lib/esm/components/Properties/GroupColorToggle.js +32 -28
  159. package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
  160. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +63 -168
  161. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
  162. package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
  163. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
  164. package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
  165. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
  166. package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
  167. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
  168. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +117 -0
  169. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
  170. package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
  171. package/lib/esm/components/Properties/PropertyMenu.js +12 -16
  172. package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
  173. package/lib/esm/components/Properties/PropertyTable.js +1 -1
  174. package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
  175. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
  176. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +8 -0
  177. package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
  178. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
  179. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +8 -0
  180. package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
  181. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
  182. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +8 -0
  183. package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
  184. package/lib/esm/components/SharedComponents/DeleteModal.d.ts +1 -2
  185. package/lib/esm/components/SharedComponents/DeleteModal.js +1 -2
  186. package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
  187. package/lib/esm/components/context/ExtractionStateJobContext.d.ts +8 -0
  188. package/lib/esm/components/context/ExtractionStateJobContext.js +17 -0
  189. package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -0
  190. package/lib/esm/components/context/PropertiesGroupColorContext.d.ts +8 -0
  191. package/lib/esm/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +5 -8
  192. package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -0
  193. package/package.json +3 -2
  194. package/lib/cjs/components/Properties/hooks/useFetchData.d.ts +0 -7
  195. package/lib/cjs/components/Properties/hooks/useFetchData.js +0 -43
  196. package/lib/cjs/components/Properties/hooks/useFetchData.js.map +0 -1
  197. package/lib/cjs/components/context/PropertiesContext.d.ts +0 -15
  198. package/lib/cjs/components/context/PropertiesContext.js.map +0 -1
  199. package/lib/esm/components/Properties/hooks/useFetchData.d.ts +0 -7
  200. package/lib/esm/components/Properties/hooks/useFetchData.js +0 -37
  201. package/lib/esm/components/Properties/hooks/useFetchData.js.map +0 -1
  202. package/lib/esm/components/context/PropertiesContext.d.ts +0 -15
  203. package/lib/esm/components/context/PropertiesContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyTable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,sBAAsB,CAAC;AAiB9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAA8B,EACzD,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc,GACQ,EAAE,EAAE;IAE1B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAgB,SAAS,CAAC,CAAC;IAEjF,MAAM,oBAAoB,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QAClD,MAAM,cAAc,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;IAE1C,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,QAAW,EAAE,EAAE;QACxD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAClC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,CACnC,cAAc,CAAC,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAElF,OAAO,CACL,6BAAK,SAAS,EAAC,8BAA8B;QAC3C,oBAAC,oBAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,UAAU,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,GACpB;QACF,oBAAC,KAAK,IACJ,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAC3B,OAAO,EAAC,iBAAiB,EACzB,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,YAAY,aAAa,EAClD,UAAU,QACV,SAAS,EAAE,SAAS,GACpB;QACD,eAAe;YACd,oBAAC,WAAW,IACV,UAAU,EAAE,eAAe,CAAC,YAAY,EACxC,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,iBAAiB,GAC1B,CACA,CACP,CAAC;AACJ,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 { Table } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Column } from \"react-table\";\nimport type { CreateTypeFromInterface } from \"../../common/utils\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { PropertyTableToolbar } from \"./PropertyTableToolbar\";\nimport \"./PropertyTable.scss\";\n\nexport interface PropertyTableItem {\n propertyName: string;\n id: string;\n}\n\nexport interface PropertyTableProps<T extends PropertyTableItem> {\n propertyType: string;\n columnsFactory: (handleShowDeleteModal: (value: T) => void) => Array<Column<T>>;\n data: T[];\n isLoading: boolean;\n onClickAdd?: () => void;\n refreshProperties: () => Promise<void>;\n deleteProperty: (propertyId: string) => Promise<void>;\n}\n\nexport const PropertyTable = <T extends PropertyTableItem>({\n propertyType,\n columnsFactory,\n data,\n isLoading,\n onClickAdd,\n refreshProperties,\n deleteProperty,\n}: PropertyTableProps<T>) => {\n\n const [showDeleteModal, setShowDeleteModal] = useState<T | undefined>(undefined);\n\n const handleDeleteProperty = useCallback(async () => {\n await deleteProperty(showDeleteModal?.id ?? \"\");\n }, [deleteProperty, showDeleteModal?.id]);\n\n const handleShowDeleteModal = useCallback((property: T) => {\n setShowDeleteModal(property);\n }, []);\n\n const handleCloseDeleteModal = () => {\n setShowDeleteModal(undefined);\n };\n\n const memoizedColumns = useMemo(() =>\n columnsFactory(handleShowDeleteModal), [columnsFactory, handleShowDeleteModal]);\n\n return (\n <div className=\"gmw-property-table-container\">\n <PropertyTableToolbar\n propertyType={propertyType}\n onClickAddProperty={onClickAdd}\n refreshProperties={refreshProperties}\n isLoading={isLoading}\n />\n <Table<CreateTypeFromInterface<T>>\n data={isLoading ? [] : data}\n density='extra-condensed'\n columns={memoizedColumns}\n emptyTableContent={`No ${propertyType} Properties`}\n isSortable\n isLoading={isLoading}\n />\n {showDeleteModal &&\n <DeleteModal\n entityName={showDeleteModal.propertyName}\n onClose={handleCloseDeleteModal}\n onDelete={handleDeleteProperty}\n refresh={refreshProperties}\n />}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyTable.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,sBAAsB,CAAC;AAiB9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAA8B,EACzD,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc,GACQ,EAAE,EAAE;IAE1B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAgB,SAAS,CAAC,CAAC;IAEjF,MAAM,oBAAoB,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QAClD,MAAM,cAAc,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC,CAAC;IAE1C,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,QAAW,EAAE,EAAE;QACxD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAClC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,CACnC,cAAc,CAAC,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAElF,OAAO,CACL,6BAAK,SAAS,EAAC,8BAA8B;QAC3C,oBAAC,oBAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,UAAU,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,GACpB;QACF,oBAAC,KAAK,IACJ,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAC3B,OAAO,EAAC,iBAAiB,EACzB,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,YAAY,aAAa,EAClD,UAAU,QACV,SAAS,EAAE,SAAS,GACpB;QACD,eAAe;YACd,oBAAC,WAAW,IACV,UAAU,EAAE,eAAe,CAAC,YAAY,EACxC,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,oBAAoB,GAC9B,CACA,CACP,CAAC;AACJ,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 { Table } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Column } from \"react-table\";\nimport type { CreateTypeFromInterface } from \"../../common/utils\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { PropertyTableToolbar } from \"./PropertyTableToolbar\";\nimport \"./PropertyTable.scss\";\n\nexport interface PropertyTableItem {\n propertyName: string;\n id: string;\n}\n\nexport interface PropertyTableProps<T extends PropertyTableItem> {\n propertyType: string;\n columnsFactory: (handleShowDeleteModal: (value: T) => void) => Array<Column<T>>;\n data: T[];\n isLoading: boolean;\n onClickAdd?: () => void;\n refreshProperties: () => Promise<void>;\n deleteProperty: (propertyId: string) => Promise<void>;\n}\n\nexport const PropertyTable = <T extends PropertyTableItem>({\n propertyType,\n columnsFactory,\n data,\n isLoading,\n onClickAdd,\n refreshProperties,\n deleteProperty,\n}: PropertyTableProps<T>) => {\n\n const [showDeleteModal, setShowDeleteModal] = useState<T | undefined>(undefined);\n\n const handleDeleteProperty = useCallback(async () => {\n await deleteProperty(showDeleteModal?.id ?? \"\");\n }, [deleteProperty, showDeleteModal?.id]);\n\n const handleShowDeleteModal = useCallback((property: T) => {\n setShowDeleteModal(property);\n }, []);\n\n const handleCloseDeleteModal = () => {\n setShowDeleteModal(undefined);\n };\n\n const memoizedColumns = useMemo(() =>\n columnsFactory(handleShowDeleteModal), [columnsFactory, handleShowDeleteModal]);\n\n return (\n <div className=\"gmw-property-table-container\">\n <PropertyTableToolbar\n propertyType={propertyType}\n onClickAddProperty={onClickAdd}\n refreshProperties={refreshProperties}\n isLoading={isLoading}\n />\n <Table<CreateTypeFromInterface<T>>\n data={isLoading ? [] : data}\n density='extra-condensed'\n columns={memoizedColumns}\n emptyTableContent={`No ${propertyType} Properties`}\n isSortable\n isLoading={isLoading}\n />\n {showDeleteModal &&\n <DeleteModal\n entityName={showDeleteModal.propertyName}\n onClose={handleCloseDeleteModal}\n onDelete={handleDeleteProperty}\n />}\n </div>\n );\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import type { IMappingsClient } from "@itwin/insights-client";
2
+ import type { GetAccessTokenFn } from "../../context/GroupingApiConfigContext";
3
+ export declare const useCalculatedPropertiesQuery: (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, mappingsClient: IMappingsClient) => import("@tanstack/react-query").UseQueryResult<import("@itwin/insights-client").CalculatedProperty[], unknown>;
4
+ //# sourceMappingURL=useCalculatedPropertiesQuery.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ export const useCalculatedPropertiesQuery = (iModelId, mappingId, groupId, getAccessToken, mappingsClient) => {
3
+ return useQuery({
4
+ queryKey: ["calculatedProperties", iModelId, mappingId, groupId],
5
+ queryFn: async () => mappingsClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId),
6
+ });
7
+ };
8
+ //# sourceMappingURL=useCalculatedPropertiesQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCalculatedPropertiesQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useCalculatedPropertiesQuery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,cAA+B,EAAE,EAAE;IACtK,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,sBAAsB,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;QAChE,OAAO,EAAG,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,uBAAuB,CAAC,MAAM,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;KACnH,CAAC,CAAC;AACL,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 type { IMappingsClient } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\n\nexport const useCalculatedPropertiesQuery = (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, mappingsClient: IMappingsClient) => {\n return useQuery({\n queryKey: [\"calculatedProperties\", iModelId, mappingId, groupId],\n queryFn: async () => mappingsClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId),\n });\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import type { IMappingsClient } from "@itwin/insights-client";
2
+ import type { GetAccessTokenFn } from "../../context/GroupingApiConfigContext";
3
+ export declare const useCustomCalculationsQuery: (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, mappingsClient: IMappingsClient) => import("@tanstack/react-query").UseQueryResult<import("@itwin/insights-client").CustomCalculation[], unknown>;
4
+ //# sourceMappingURL=useCustomCalculationsQuery.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ export const useCustomCalculationsQuery = (iModelId, mappingId, groupId, getAccessToken, mappingsClient) => {
3
+ return useQuery({
4
+ queryKey: ["customCalculations", iModelId, mappingId, groupId],
5
+ queryFn: async () => mappingsClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId),
6
+ });
7
+ };
8
+ //# sourceMappingURL=useCustomCalculationsQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomCalculationsQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useCustomCalculationsQuery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,cAA+B,EAAE,EAAE;IACpK,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,oBAAoB,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;QAC9D,OAAO,EAAG,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,MAAM,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;KACjH,CAAC,CAAC;AACL,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 type { IMappingsClient } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\n\nexport const useCustomCalculationsQuery = (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, mappingsClient: IMappingsClient) => {\n return useQuery({\n queryKey: [\"customCalculations\", iModelId, mappingId, groupId],\n queryFn: async () => mappingsClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId),\n });\n};\n"]}
@@ -0,0 +1,4 @@
1
+ import type { IMappingsClient } from "@itwin/insights-client";
2
+ import type { GetAccessTokenFn } from "../../context/GroupingApiConfigContext";
3
+ export declare const useGroupPropertiesQuery: (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, mappingsClient: IMappingsClient) => import("@tanstack/react-query").UseQueryResult<import("@itwin/insights-client").GroupProperty[], unknown>;
4
+ //# sourceMappingURL=useGroupPropertiesQuery.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ export const useGroupPropertiesQuery = (iModelId, mappingId, groupId, getAccessToken, mappingsClient) => {
3
+ return useQuery({
4
+ queryKey: ["groupProperties", iModelId, mappingId, groupId],
5
+ queryFn: async () => mappingsClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId),
6
+ });
7
+ };
8
+ //# sourceMappingURL=useGroupPropertiesQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGroupPropertiesQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useGroupPropertiesQuery.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,cAA+B,EAAE,EAAE;IACjK,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;QAC3D,OAAO,EAAG,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,kBAAkB,CAAC,MAAM,cAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;KAC9G,CAAC,CAAC;AACL,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 type { IMappingsClient } from \"@itwin/insights-client\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { GetAccessTokenFn } from \"../../context/GroupingApiConfigContext\";\n\nexport const useGroupPropertiesQuery = (iModelId: string, mappingId: string, groupId: string, getAccessToken: GetAccessTokenFn, mappingsClient: IMappingsClient) => {\n return useQuery({\n queryKey: [\"groupProperties\", iModelId, mappingId, groupId],\n queryFn: async () => mappingsClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId),\n });\n};\n"]}
@@ -4,8 +4,7 @@ export interface DeleteModalProps {
4
4
  entityName: string;
5
5
  onClose: () => void;
6
6
  onDelete: () => Promise<void>;
7
- refresh?: () => Promise<void>;
8
7
  }
9
- export declare const DeleteModal: ({ entityName, onClose, onDelete, refresh, }: DeleteModalProps) => JSX.Element;
8
+ export declare const DeleteModal: ({ entityName, onClose, onDelete, }: DeleteModalProps) => JSX.Element;
10
9
  export default DeleteModal;
11
10
  //# sourceMappingURL=DeleteModal.d.ts.map
@@ -7,12 +7,11 @@ import { useMutation } from "@tanstack/react-query";
7
7
  import React, { useCallback, useState } from "react";
8
8
  import "./DeleteModal.scss";
9
9
  import { LoadingSpinner } from "./LoadingSpinner";
10
- export const DeleteModal = ({ entityName, onClose, onDelete, refresh, }) => {
10
+ export const DeleteModal = ({ entityName, onClose, onDelete, }) => {
11
11
  const [localEntityName] = useState(entityName);
12
12
  const deleteMutation = useMutation({
13
13
  mutationFn: onDelete,
14
14
  onSuccess: async () => {
15
- refresh && await refresh();
16
15
  onClose();
17
16
  },
18
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteModal.js","sourceRoot":"","sources":["../../../../src/components/SharedComponents/DeleteModal.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,KAAK,EACL,cAAc,EACd,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AASlD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,UAAU,EACV,OAAO,EACP,QAAQ,EACR,OAAO,GACU,EAAE,EAAE;IACrB,MAAM,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,cAAc,GAAG,WAAW,CAAC;QACjC,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,OAAO,IAAI,MAAM,OAAO,EAAE,CAAC;YAC3B,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,cAAc,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL;QACE,oBAAC,KAAK,IACJ,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,yBAAyB,EACrC,MAAM,EAAE,CAAC,CAAC,eAAe,EACzB,aAAa,EAAE,CAAC,cAAc,CAAC,SAAS,EACxC,OAAO,EAAE,OAAO;YAEhB,6BAAK,SAAS,EAAC,4BAA4B;gBACzC,oBAAC,IAAI,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAC,IAAI,sCAExB;gBACP,oCACG,oBAAC,oBAAoB,IAAC,IAAI,EAAE,GAAG,UAAU,GAAG,GAAI,CAC1C,CACL;YACN,oBAAC,cAAc;gBACZ,cAAc,CAAC,SAAS;oBACvB,6BAAK,SAAS,EAAC,oBAAoB;wBACjC,oBAAC,cAAc,OAAG,CACd;gBACR,oBAAC,MAAM,IAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,SAAS,aAEtF;gBACT,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,CAAC,SAAS,aAG3B,CACM,CACX,CACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,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 {\n Button,\n MiddleTextTruncation,\n Modal,\n ModalButtonBar,\n Text,\n} from \"@itwin/itwinui-react\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport React, { useCallback, useState } from \"react\";\nimport \"./DeleteModal.scss\";\nimport { LoadingSpinner } from \"./LoadingSpinner\";\n\nexport interface DeleteModalProps {\n entityName: string;\n onClose: () => void;\n onDelete: () => Promise<void>;\n refresh?: () => Promise<void>;\n}\n\nexport const DeleteModal = ({\n entityName,\n onClose,\n onDelete,\n refresh,\n}: DeleteModalProps) => {\n const [localEntityName] = useState(entityName);\n\n const deleteMutation = useMutation({\n mutationFn: onDelete,\n onSuccess: async () => {\n refresh && await refresh();\n onClose();\n },\n });\n\n const deleteCallback = useCallback(() => {\n deleteMutation.mutate();\n }, [deleteMutation]);\n\n return (\n <>\n <Modal\n title='Confirm'\n modalRootId='grouping-mapping-widget'\n isOpen={!!localEntityName}\n isDismissible={!deleteMutation.isLoading}\n onClose={onClose}\n >\n <div className=\"gmw-delete-modal-body-text\">\n <Text variant=\"leading\" as=\"h3\">\n Are you sure you want to delete\n </Text>\n <strong>\n {<MiddleTextTruncation text={`${entityName}?`} />}\n </strong>\n </div>\n <ModalButtonBar>\n {deleteMutation.isLoading &&\n <div className=\"gmw-loading-delete\">\n <LoadingSpinner />\n </div>}\n <Button styleType='high-visibility' onClick={deleteCallback} disabled={deleteMutation.isLoading}>\n Delete\n </Button>\n <Button\n styleType='default'\n onClick={onClose}\n disabled={deleteMutation.isLoading}\n >\n Cancel\n </Button>\n </ModalButtonBar>\n </Modal>\n </>\n );\n};\n\nexport default DeleteModal;\n"]}
1
+ {"version":3,"file":"DeleteModal.js","sourceRoot":"","sources":["../../../../src/components/SharedComponents/DeleteModal.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,KAAK,EACL,cAAc,EACd,IAAI,GACL,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQlD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,UAAU,EACV,OAAO,EACP,QAAQ,GACS,EAAE,EAAE;IACrB,MAAM,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,cAAc,GAAG,WAAW,CAAC;QACjC,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,cAAc,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL;QACE,oBAAC,KAAK,IACJ,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,yBAAyB,EACrC,MAAM,EAAE,CAAC,CAAC,eAAe,EACzB,aAAa,EAAE,CAAC,cAAc,CAAC,SAAS,EACxC,OAAO,EAAE,OAAO;YAEhB,6BAAK,SAAS,EAAC,4BAA4B;gBACzC,oBAAC,IAAI,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAC,IAAI,sCAExB;gBACP,oCACG,oBAAC,oBAAoB,IAAC,IAAI,EAAE,GAAG,UAAU,GAAG,GAAI,CAC1C,CACL;YACN,oBAAC,cAAc;gBACZ,cAAc,CAAC,SAAS;oBACvB,6BAAK,SAAS,EAAC,oBAAoB;wBACjC,oBAAC,cAAc,OAAG,CACd;gBACR,oBAAC,MAAM,IAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,SAAS,aAEtF;gBACT,oBAAC,MAAM,IACL,SAAS,EAAC,SAAS,EACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,CAAC,SAAS,aAG3B,CACM,CACX,CACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,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 {\n Button,\n MiddleTextTruncation,\n Modal,\n ModalButtonBar,\n Text,\n} from \"@itwin/itwinui-react\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport React, { useCallback, useState } from \"react\";\nimport \"./DeleteModal.scss\";\nimport { LoadingSpinner } from \"./LoadingSpinner\";\n\nexport interface DeleteModalProps {\n entityName: string;\n onClose: () => void;\n onDelete: () => Promise<void>;\n}\n\nexport const DeleteModal = ({\n entityName,\n onClose,\n onDelete,\n}: DeleteModalProps) => {\n const [localEntityName] = useState(entityName);\n\n const deleteMutation = useMutation({\n mutationFn: onDelete,\n onSuccess: async () => {\n onClose();\n },\n });\n\n const deleteCallback = useCallback(() => {\n deleteMutation.mutate();\n }, [deleteMutation]);\n\n return (\n <>\n <Modal\n title='Confirm'\n modalRootId='grouping-mapping-widget'\n isOpen={!!localEntityName}\n isDismissible={!deleteMutation.isLoading}\n onClose={onClose}\n >\n <div className=\"gmw-delete-modal-body-text\">\n <Text variant=\"leading\" as=\"h3\">\n Are you sure you want to delete\n </Text>\n <strong>\n {<MiddleTextTruncation text={`${entityName}?`} />}\n </strong>\n </div>\n <ModalButtonBar>\n {deleteMutation.isLoading &&\n <div className=\"gmw-loading-delete\">\n <LoadingSpinner />\n </div>}\n <Button styleType='high-visibility' onClick={deleteCallback} disabled={deleteMutation.isLoading}>\n Delete\n </Button>\n <Button\n styleType='default'\n onClick={onClose}\n disabled={deleteMutation.isLoading}\n >\n Cancel\n </Button>\n </ModalButtonBar>\n </Modal>\n </>\n );\n};\n\nexport default DeleteModal;\n"]}
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export interface ExtractionStatusJob {
3
+ mappingIdJobInfo: Map<string, string>;
4
+ setMappingIdJobInfo: (mappingIdJobInfo: Map<string, string> | ((mappingIdJobInfo: Map<string, string>) => Map<string, string>)) => void;
5
+ }
6
+ export declare const ExtractionStatusJobContext: React.Context<ExtractionStatusJob>;
7
+ export declare const useExtractionStateJobContext: () => ExtractionStatusJob;
8
+ //# sourceMappingURL=ExtractionStateJobContext.d.ts.map
@@ -0,0 +1,17 @@
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 * as React from "react";
6
+ export const ExtractionStatusJobContext = React.createContext({
7
+ mappingIdJobInfo: new Map(),
8
+ setMappingIdJobInfo: () => { },
9
+ });
10
+ export const useExtractionStateJobContext = () => {
11
+ const context = React.useContext(ExtractionStatusJobContext);
12
+ if (!context) {
13
+ throw new Error("useExtractionStateJobContext should be used within a ExtractionStatusJobContext provider");
14
+ }
15
+ return context;
16
+ };
17
+ //# sourceMappingURL=ExtractionStateJobContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExtractionStateJobContext.js","sourceRoot":"","sources":["../../../../src/components/context/ExtractionStateJobContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAsB;IACjF,gBAAgB,EAAE,IAAI,GAAG,EAAE;IAC3B,mBAAmB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAwB,EAAE;IACpE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,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\";\n\nexport interface ExtractionStatusJob {\n mappingIdJobInfo: Map<string, string>; // key: mappingId, value: jobId\n setMappingIdJobInfo: (mappingIdJobInfo: Map<string, string> | ((mappingIdJobInfo: Map<string, string>) => Map<string, string>)) => void;\n}\n\nexport const ExtractionStatusJobContext = React.createContext<ExtractionStatusJob>({\n mappingIdJobInfo: new Map(),\n setMappingIdJobInfo: () => { },\n});\n\nexport const useExtractionStateJobContext = (): ExtractionStatusJob => {\n const context = React.useContext(ExtractionStatusJobContext);\n if (!context) {\n throw new Error(\n \"useExtractionStateJobContext should be used within a ExtractionStatusJobContext provider\"\n );\n }\n return context;\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export interface PropertiesGroupColor {
3
+ showGroupColor: boolean;
4
+ setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;
5
+ }
6
+ export declare const PropertiesGroupColorContext: React.Context<PropertiesGroupColor>;
7
+ export declare const usePropertiesGroupColorContext: () => PropertiesGroupColor;
8
+ //# sourceMappingURL=PropertiesGroupColorContext.d.ts.map
@@ -3,18 +3,15 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  import * as React from "react";
6
- export const PropertiesContext = React.createContext({
6
+ export const PropertiesGroupColorContext = React.createContext({
7
7
  showGroupColor: false,
8
- setGroupProperties: () => { },
9
- setCalculatedProperties: () => { },
10
- setCustomCalculationProperties: () => { },
11
8
  setShowGroupColor: () => { },
12
9
  });
13
- export const usePropertiesContext = () => {
14
- const context = React.useContext(PropertiesContext);
10
+ export const usePropertiesGroupColorContext = () => {
11
+ const context = React.useContext(PropertiesGroupColorContext);
15
12
  if (!context) {
16
- throw new Error("usePropertiesContext should be used within a PropertiesContext provider");
13
+ throw new Error("usePropertiesGroupColorContext should be used within a PropertiesGroupColorContext provider");
17
14
  }
18
15
  return context;
19
16
  };
20
- //# sourceMappingURL=PropertiesContext.js.map
17
+ //# sourceMappingURL=PropertiesGroupColorContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PropertiesGroupColorContext.js","sourceRoot":"","sources":["../../../../src/components/context/PropertiesGroupColorContext.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,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\";\n\nexport interface PropertiesGroupColor {\n showGroupColor: boolean;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const PropertiesGroupColorContext = React.createContext<PropertiesGroupColor>({\n showGroupColor: false,\n setShowGroupColor: () => { },\n});\n\nexport const usePropertiesGroupColorContext = (): PropertiesGroupColor => {\n const context = React.useContext(PropertiesGroupColorContext);\n if (!context) {\n throw new Error(\n \"usePropertiesGroupColorContext should be used within a PropertiesGroupColorContext provider\"\n );\n }\n return context;\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/grouping-mapping-widget",
3
- "version": "0.23.1",
3
+ "version": "0.24.0",
4
4
  "description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
5
5
  "keywords": [
6
6
  "Bentley",
@@ -61,9 +61,10 @@
61
61
  "@itwin/imodels-access-common": "^4.1.2",
62
62
  "@itwin/imodels-access-frontend": "^4.1.2",
63
63
  "@itwin/imodels-client-management": "^4.2.1",
64
- "@itwin/insights-client": "^0.4.0",
64
+ "@itwin/insights-client": "^0.6.0",
65
65
  "@itwin/itwins-client": "^1.1.0",
66
66
  "@itwin/itwinui-icons-react": "^2.2.0",
67
+ "@itwin/itwinui-icons-color-react": "2.1.0",
67
68
  "@itwin/itwinui-react": "^2.11.2",
68
69
  "@tanstack/query-core": "^4.36.1",
69
70
  "@tanstack/react-query": "^4.36.1",
@@ -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,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"]}