@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.
- package/lib/cjs/WidgetShell/GroupingMappingContent.js +2 -2
- package/lib/cjs/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/components/Constants.d.ts +3 -0
- package/lib/cjs/components/Constants.js +5 -2
- package/lib/cjs/components/Constants.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.js +12 -14
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +31 -9
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.js +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
- package/lib/cjs/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
- package/lib/cjs/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +17 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +16 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +17 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +21 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js +79 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
- package/lib/cjs/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
- package/lib/cjs/components/Mappings/MappingListItem.d.ts +20 -0
- package/lib/cjs/components/Mappings/MappingListItem.js +96 -0
- package/lib/cjs/components/Mappings/MappingListItem.js.map +1 -0
- package/lib/cjs/components/Mappings/MappingListItem.scss +25 -0
- package/lib/cjs/components/Mappings/MappingsView.d.ts +2 -0
- package/lib/cjs/components/Mappings/MappingsView.js +28 -4
- package/lib/cjs/components/Mappings/MappingsView.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
- package/lib/cjs/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js +55 -0
- package/lib/cjs/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js +29 -5
- package/lib/cjs/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js +42 -0
- package/lib/cjs/components/Mappings/hooks/useRunExtraction.js.map +1 -0
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
- package/lib/cjs/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js +28 -59
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
- package/lib/cjs/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.js +30 -26
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js +61 -166
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +147 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
- package/lib/cjs/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
- package/lib/cjs/components/Properties/PropertyMenu.js +11 -15
- package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js +1 -1
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js +12 -0
- package/lib/cjs/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
- package/lib/cjs/components/SharedComponents/DeleteModal.d.ts +1 -2
- package/lib/cjs/components/SharedComponents/DeleteModal.js +1 -2
- package/lib/cjs/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/cjs/components/context/ExtractionStateJobContext.d.ts +8 -0
- package/lib/cjs/components/context/ExtractionStateJobContext.js +44 -0
- package/lib/cjs/components/context/ExtractionStateJobContext.js.map +1 -0
- package/lib/cjs/components/context/PropertiesGroupColorContext.d.ts +8 -0
- package/lib/cjs/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +7 -10
- package/lib/cjs/components/context/PropertiesGroupColorContext.js.map +1 -0
- package/lib/esm/WidgetShell/GroupingMappingContent.js +2 -2
- package/lib/esm/WidgetShell/GroupingMappingContent.js.map +1 -1
- package/lib/esm/components/Constants.d.ts +3 -0
- package/lib/esm/components/Constants.js +3 -0
- package/lib/esm/components/Constants.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.js +12 -14
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +31 -9
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +1 -1
- package/lib/esm/components/Groups/groupsHelpers.js +1 -1
- package/lib/esm/components/Groups/groupsHelpers.js.map +1 -1
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.d.ts +2 -2
- package/lib/esm/components/Groups/hooks/useKeySetHiliteQueries.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js +27 -18
- package/lib/esm/components/Mappings/Extraction/ExtractionMessageModal.js.map +1 -1
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.d.ts +3 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js +10 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/QueuedExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.d.ts +3 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js +9 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/RunningExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.d.ts +3 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js +10 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/StartingExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.d.ts +9 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js +14 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStates/TerminalExtractionState.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.d.ts +17 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js +52 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.js.map +1 -0
- package/lib/esm/components/Mappings/Extraction/ExtractionStatus.scss +40 -0
- package/lib/esm/components/Mappings/MappingListItem.d.ts +20 -0
- package/lib/esm/components/Mappings/MappingListItem.js +69 -0
- package/lib/esm/components/Mappings/MappingListItem.js.map +1 -0
- package/lib/esm/components/Mappings/MappingListItem.scss +25 -0
- package/lib/esm/components/Mappings/MappingsView.d.ts +2 -0
- package/lib/esm/components/Mappings/MappingsView.js +30 -6
- package/lib/esm/components/Mappings/MappingsView.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.d.ts +3 -1
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js +7 -4
- package/lib/esm/components/Mappings/hooks/useFetchExtractionStatus.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.d.ts +20 -0
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js +49 -0
- package/lib/esm/components/Mappings/hooks/useFetchMappingExtractionStatus.js.map +1 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.d.ts +8 -0
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js +30 -6
- package/lib/esm/components/Mappings/hooks/useMappingsOperations.js.map +1 -1
- package/lib/esm/components/Mappings/hooks/useRunExtraction.d.ts +14 -0
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js +38 -0
- package/lib/esm/components/Mappings/hooks/useRunExtraction.js.map +1 -0
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js +17 -25
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js +18 -25
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyActionWithVisuals.js.map +1 -1
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js +35 -38
- package/lib/esm/components/Properties/CalculatedProperties/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js +29 -60
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationAction.js.map +1 -1
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js +37 -40
- package/lib/esm/components/Properties/CustomCalculations/CustomCalculationTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.js +32 -28
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js +63 -168
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyAction.scss +1 -46
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +34 -37
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js +65 -51
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyUtils.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.d.ts +12 -0
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js +117 -0
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.js.map +1 -0
- package/lib/esm/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.scss +49 -0
- package/lib/esm/components/Properties/PropertyMenu.js +12 -16
- package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTable.js +1 -1
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/useCalculatedPropertiesQuery.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/useCustomCalculationsQuery.js.map +1 -0
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.d.ts +4 -0
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js +8 -0
- package/lib/esm/components/Properties/hooks/useGroupPropertiesQuery.js.map +1 -0
- package/lib/esm/components/SharedComponents/DeleteModal.d.ts +1 -2
- package/lib/esm/components/SharedComponents/DeleteModal.js +1 -2
- package/lib/esm/components/SharedComponents/DeleteModal.js.map +1 -1
- package/lib/esm/components/context/ExtractionStateJobContext.d.ts +8 -0
- package/lib/esm/components/context/ExtractionStateJobContext.js +17 -0
- package/lib/esm/components/context/ExtractionStateJobContext.js.map +1 -0
- package/lib/esm/components/context/PropertiesGroupColorContext.d.ts +8 -0
- package/lib/esm/components/context/{PropertiesContext.js → PropertiesGroupColorContext.js} +5 -8
- package/lib/esm/components/context/PropertiesGroupColorContext.js.map +1 -0
- package/package.json +3 -2
- package/lib/cjs/components/Properties/hooks/useFetchData.d.ts +0 -7
- package/lib/cjs/components/Properties/hooks/useFetchData.js +0 -43
- package/lib/cjs/components/Properties/hooks/useFetchData.js.map +0 -1
- package/lib/cjs/components/context/PropertiesContext.d.ts +0 -15
- package/lib/cjs/components/context/PropertiesContext.js.map +0 -1
- package/lib/esm/components/Properties/hooks/useFetchData.d.ts +0 -7
- package/lib/esm/components/Properties/hooks/useFetchData.js +0 -37
- package/lib/esm/components/Properties/hooks/useFetchData.js.map +0 -1
- package/lib/esm/components/context/PropertiesContext.d.ts +0 -15
- package/lib/esm/components/context/PropertiesContext.js.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
|
|
6
|
+
.gmw-property-selection-container {
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: var(--iui-size-xs);
|
|
9
|
+
width: 45vw;
|
|
10
|
+
min-width: 100%;
|
|
11
|
+
height: 75vh;
|
|
12
|
+
|
|
13
|
+
.gmw-gutter {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.gmw-selected-properties {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--iui-size-s);
|
|
24
|
+
padding: var(--iui-size-s) var(--iui-size-m);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.gmw-available-properties {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--iui-size-s);
|
|
31
|
+
padding: var(--iui-size-s) var(--iui-size-m);
|
|
32
|
+
.gmw-available-properties-header {
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
gap: var(--iui-size-xs);
|
|
37
|
+
.gmw-available-prop-search {
|
|
38
|
+
flex: 1 1 80px;
|
|
39
|
+
min-width: 80px;
|
|
40
|
+
max-width: 300px;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.gmw-gutter-drag-icon {
|
|
47
|
+
justify-content: center;
|
|
48
|
+
cursor: col-resize;
|
|
49
|
+
}
|
|
@@ -31,30 +31,26 @@ exports.PropertyMenu = void 0;
|
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
require("./PropertyMenu.scss");
|
|
33
33
|
const GroupPropertyTable_1 = require("./GroupProperties/GroupPropertyTable");
|
|
34
|
-
const useFetchData_1 = require("./hooks/useFetchData");
|
|
35
34
|
const MappingClientContext_1 = require("../context/MappingClientContext");
|
|
36
35
|
const GroupingApiConfigContext_1 = require("../context/GroupingApiConfigContext");
|
|
37
|
-
const PropertiesContext_1 = require("../context/PropertiesContext");
|
|
38
36
|
const CalculatedPropertyTable_1 = require("./CalculatedProperties/CalculatedPropertyTable");
|
|
39
37
|
const CustomCalculationTable_1 = require("./CustomCalculations/CustomCalculationTable");
|
|
38
|
+
const useGroupPropertiesQuery_1 = require("./hooks/useGroupPropertiesQuery");
|
|
39
|
+
const useCalculatedPropertiesQuery_1 = require("./hooks/useCalculatedPropertiesQuery");
|
|
40
|
+
const useCustomCalculationsQuery_1 = require("./hooks/useCustomCalculationsQuery");
|
|
41
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
40
42
|
const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, onClickAddCalculatedProperty, onClickModifyCalculatedProperty, onClickAddCustomCalculationProperty, onClickModifyCustomCalculation, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
|
|
41
43
|
const groupId = group.id;
|
|
42
44
|
const mappingId = mapping.id;
|
|
43
45
|
const { getAccessToken, iModelId } = (0, GroupingApiConfigContext_1.useGroupingMappingApiConfig)();
|
|
44
46
|
const mappingClient = (0, MappingClientContext_1.useMappingClient)();
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
}, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
|
|
53
|
-
const { isLoading: isLoadingCalculatedProperties, refreshData: refreshCalculatedProperties } = (0, useFetchData_1.useCombinedFetchRefresh)(fetchCalculatedProperties, setCalculatedProperties);
|
|
54
|
-
const fetchCustomCalculations = (0, react_1.useMemo)(() => {
|
|
55
|
-
return async () => mappingClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId);
|
|
56
|
-
}, [getAccessToken, mappingClient, iModelId, mappingId, groupId]);
|
|
57
|
-
const { isLoading: isLoadingCustomCalculations, refreshData: refreshCustomCalculations } = (0, useFetchData_1.useCombinedFetchRefresh)(fetchCustomCalculations, setCustomCalculationProperties);
|
|
47
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
48
|
+
const { data: groupProperties, isFetching: isLoadingGroupProperties } = (0, useGroupPropertiesQuery_1.useGroupPropertiesQuery)(iModelId, mappingId, groupId, getAccessToken, mappingClient);
|
|
49
|
+
const { data: calculatedProperties, isFetching: isLoadingCalculatedProperties } = (0, useCalculatedPropertiesQuery_1.useCalculatedPropertiesQuery)(iModelId, mappingId, groupId, getAccessToken, mappingClient);
|
|
50
|
+
const { data: customCalculationProperties, isFetching: isLoadingCustomCalculations } = (0, useCustomCalculationsQuery_1.useCustomCalculationsQuery)(iModelId, mappingId, groupId, getAccessToken, mappingClient);
|
|
51
|
+
const refreshGroupProperties = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["groupProperties", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
52
|
+
const refreshCalculatedProperties = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["calculatedProperties", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
53
|
+
const refreshCustomCalculations = (0, react_1.useCallback)(async () => queryClient.invalidateQueries({ queryKey: ["customCalculations", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
58
54
|
return (react_1.default.createElement("div", { className: 'gmw-property-menu-wrapper' },
|
|
59
55
|
!hideGroupProps && (react_1.default.createElement(GroupPropertyTable_1.GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties ?? [], refresh: refreshGroupProperties })),
|
|
60
56
|
!hideCalculatedProps && (react_1.default.createElement(CalculatedPropertyTable_1.CalculatedPropertyTable, { mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddCalculatedProperty, onClickModify: onClickModifyCalculatedProperty, isLoading: isLoadingCalculatedProperties, calculatedProperties: calculatedProperties ?? [], refresh: refreshCalculatedProperties })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+
|
|
1
|
+
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAA2C;AAC3C,+BAA6B;AAC7B,6EAA0E;AAC1E,0EAAmE;AACnE,kFAAkF;AAElF,4FAAyF;AACzF,wFAAqF;AACrF,6EAA0E;AAC1E,uFAAoF;AACpF,mFAAgF;AAChF,uDAAuD;AAgBhD,MAAM,YAAY,GAAG,CAAC,EAC3B,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,cAAc,GAAG,KAAK,EACtB,mBAAmB,GAAG,KAAK,EAC3B,0BAA0B,GAAG,KAAK,GAChB,EAAE,EAAE;IACtB,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;IAC7B,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAA,sDAA2B,GAAE,CAAC;IACnE,MAAM,aAAa,GAAG,IAAA,uCAAgB,GAAE,CAAC;IACzC,MAAM,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;IAErC,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,wBAAwB,EAAE,GAAG,IAAA,iDAAuB,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAC7J,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,UAAU,EAAE,6BAA6B,EAAE,GAAG,IAAA,2DAA4B,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAC5K,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,UAAU,EAAE,2BAA2B,EAAE,GAAG,IAAA,uDAA0B,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IAE/K,MAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IACtM,MAAM,2BAA2B,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,sBAAsB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAChN,MAAM,yBAAyB,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,oBAAoB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5M,OAAO,CACL,uCAAK,SAAS,EAAC,2BAA2B;QACvC,CAAC,cAAc,IAAI,CAClB,8BAAC,uCAAkB,IACjB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,uBAAuB,EACnC,aAAa,EAAE,0BAA0B,EACzC,SAAS,EAAE,wBAAwB,EACnC,eAAe,EAAE,eAAe,IAAI,EAAE,EACtC,OAAO,EAAE,sBAAsB,GAC/B,CACH;QACA,CAAC,mBAAmB,IAAI,CACvB,8BAAC,iDAAuB,IACtB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,4BAA4B,EACxC,aAAa,EAAE,+BAA+B,EAC9C,SAAS,EAAE,6BAA6B,EACxC,oBAAoB,EAAE,oBAAoB,IAAI,EAAE,EAChD,OAAO,EAAE,2BAA2B,GACpC,CACH;QACA,CAAC,0BAA0B,IAAI,CAC9B,8BAAC,+CAAsB,IACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,mCAAmC,EAC/C,aAAa,EAAE,8BAA8B,EAC7C,SAAS,EAAE,2BAA2B,EACtC,kBAAkB,EAAE,2BAA2B,IAAI,EAAE,EACrD,OAAO,EAAE,yBAAyB,GAClC,CACH,CACG,CACP,CAAC;AACJ,CAAC,CAAC;AAjEW,QAAA,YAAY,gBAiEvB","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 React, { useCallback } from \"react\";\nimport \"./PropertyMenu.scss\";\nimport { GroupPropertyTable } from \"./GroupProperties/GroupPropertyTable\";\nimport { useMappingClient } from \"../context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { CalculatedProperty, CustomCalculation, Group, GroupProperty, Mapping } from \"@itwin/insights-client\";\nimport { CalculatedPropertyTable } from \"./CalculatedProperties/CalculatedPropertyTable\";\nimport { CustomCalculationTable } from \"./CustomCalculations/CustomCalculationTable\";\nimport { useGroupPropertiesQuery } from \"./hooks/useGroupPropertiesQuery\";\nimport { useCalculatedPropertiesQuery } from \"./hooks/useCalculatedPropertiesQuery\";\nimport { useCustomCalculationsQuery } from \"./hooks/useCustomCalculationsQuery\";\nimport { useQueryClient } from \"@tanstack/react-query\";\n\nexport interface PropertyMenuProps {\n mapping: Mapping;\n group: Group;\n onClickAddGroupProperty?: () => void;\n onClickModifyGroupProperty?: (groupProperty: GroupProperty) => void;\n onClickAddCalculatedProperty?: () => void;\n onClickModifyCalculatedProperty?: (calculatedProperty: CalculatedProperty) => void;\n onClickAddCustomCalculationProperty?: () => void;\n onClickModifyCustomCalculation?: (customCalculation: CustomCalculation) => void;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport const PropertyMenu = ({\n mapping,\n group,\n onClickAddGroupProperty,\n onClickModifyGroupProperty,\n onClickAddCalculatedProperty,\n onClickModifyCalculatedProperty,\n onClickAddCustomCalculationProperty,\n onClickModifyCustomCalculation,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyMenuProps) => {\n const groupId = group.id;\n const mappingId = mapping.id;\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const queryClient = useQueryClient();\n\n const { data: groupProperties, isFetching: isLoadingGroupProperties } = useGroupPropertiesQuery(iModelId, mappingId, groupId, getAccessToken, mappingClient);\n const { data: calculatedProperties, isFetching: isLoadingCalculatedProperties } = useCalculatedPropertiesQuery(iModelId, mappingId, groupId, getAccessToken, mappingClient);\n const { data: customCalculationProperties, isFetching: isLoadingCustomCalculations } = useCustomCalculationsQuery(iModelId, mappingId, groupId, getAccessToken, mappingClient);\n\n const refreshGroupProperties = useCallback(async () => queryClient.invalidateQueries({ queryKey: [\"groupProperties\", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);\n const refreshCalculatedProperties = useCallback(async () => queryClient.invalidateQueries({ queryKey: [\"calculatedProperties\", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);\n const refreshCustomCalculations = useCallback(async () => queryClient.invalidateQueries({ queryKey: [\"customCalculations\", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);\n\n return (\n <div className='gmw-property-menu-wrapper'>\n {!hideGroupProps && (\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddGroupProperty}\n onClickModify={onClickModifyGroupProperty}\n isLoading={isLoadingGroupProperties}\n groupProperties={groupProperties ?? []}\n refresh={refreshGroupProperties}\n />\n )}\n {!hideCalculatedProps && (\n <CalculatedPropertyTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCalculatedProperty}\n onClickModify={onClickModifyCalculatedProperty}\n isLoading={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties ?? []}\n refresh={refreshCalculatedProperties}\n />\n )}\n {!hideCustomCalculationProps && (\n <CustomCalculationTable\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddCustomCalculationProperty}\n onClickModify={onClickModifyCustomCalculation}\n isLoading={isLoadingCustomCalculations}\n customCalculations={customCalculationProperties ?? []}\n refresh={refreshCustomCalculations}\n />\n )}\n </div>\n );\n};\n"]}
|
|
@@ -52,7 +52,7 @@ const PropertyTable = ({ propertyType, columnsFactory, data, isLoading, onClickA
|
|
|
52
52
|
react_1.default.createElement(PropertyTableToolbar_1.PropertyTableToolbar, { propertyType: propertyType, onClickAddProperty: onClickAdd, refreshProperties: refreshProperties, isLoading: isLoading }),
|
|
53
53
|
react_1.default.createElement(itwinui_react_1.Table, { data: isLoading ? [] : data, density: 'extra-condensed', columns: memoizedColumns, emptyTableContent: `No ${propertyType} Properties`, isSortable: true, isLoading: isLoading }),
|
|
54
54
|
showDeleteModal &&
|
|
55
|
-
react_1.default.createElement(DeleteModal_1.default, { entityName: showDeleteModal.propertyName, onClose: handleCloseDeleteModal, onDelete: handleDeleteProperty
|
|
55
|
+
react_1.default.createElement(DeleteModal_1.default, { entityName: showDeleteModal.propertyName, onClose: handleCloseDeleteModal, onDelete: handleDeleteProperty })));
|
|
56
56
|
};
|
|
57
57
|
exports.PropertyTable = PropertyTable;
|
|
58
58
|
//# sourceMappingURL=PropertyTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAA6C;AAC7C,+CAA8D;AAG9D,kFAA0D;AAC1D,iEAA8D;AAC9D,gCAA8B;AAiBvB,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,IAAA,gBAAQ,EAAgB,SAAS,CAAC,CAAC;IAEjF,MAAM,oBAAoB,GAAG,IAAA,mBAAW,EAAC,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,IAAA,mBAAW,EAAC,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,IAAA,eAAO,EAAC,GAAG,EAAE,CACnC,cAAc,CAAC,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAElF,OAAO,CACL,uCAAK,SAAS,EAAC,8BAA8B;QAC3C,8BAAC,2CAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,UAAU,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,GACpB;QACF,8BAAC,qBAAK,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,8BAAC,qBAAW,IACV,UAAU,EAAE,eAAe,CAAC,YAAY,EACxC,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAA6C;AAC7C,+CAA8D;AAG9D,kFAA0D;AAC1D,iEAA8D;AAC9D,gCAA8B;AAiBvB,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,IAAA,gBAAQ,EAAgB,SAAS,CAAC,CAAC;IAEjF,MAAM,oBAAoB,GAAG,IAAA,mBAAW,EAAC,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,IAAA,mBAAW,EAAC,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,IAAA,eAAO,EAAC,GAAG,EAAE,CACnC,cAAc,CAAC,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAElF,OAAO,CACL,uCAAK,SAAS,EAAC,8BAA8B;QAC3C,8BAAC,2CAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,UAAU,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,GACpB;QACF,8BAAC,qBAAK,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,8BAAC,qBAAW,IACV,UAAU,EAAE,eAAe,CAAC,YAAY,EACxC,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,oBAAoB,GAC9B,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAnDW,QAAA,aAAa,iBAmDxB","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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCalculatedPropertiesQuery = void 0;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useCalculatedPropertiesQuery = (iModelId, mappingId, groupId, getAccessToken, mappingsClient) => {
|
|
6
|
+
return (0, react_query_1.useQuery)({
|
|
7
|
+
queryKey: ["calculatedProperties", iModelId, mappingId, groupId],
|
|
8
|
+
queryFn: async () => mappingsClient.getCalculatedProperties(await getAccessToken(), iModelId, mappingId, groupId),
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.useCalculatedPropertiesQuery = useCalculatedPropertiesQuery;
|
|
12
|
+
//# sourceMappingURL=useCalculatedPropertiesQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCalculatedPropertiesQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useCalculatedPropertiesQuery.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAG1C,MAAM,4BAA4B,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,cAA+B,EAAE,EAAE;IACtK,OAAO,IAAA,sBAAQ,EAAC;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;AALW,QAAA,4BAA4B,gCAKvC","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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCustomCalculationsQuery = void 0;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useCustomCalculationsQuery = (iModelId, mappingId, groupId, getAccessToken, mappingsClient) => {
|
|
6
|
+
return (0, react_query_1.useQuery)({
|
|
7
|
+
queryKey: ["customCalculations", iModelId, mappingId, groupId],
|
|
8
|
+
queryFn: async () => mappingsClient.getCustomCalculations(await getAccessToken(), iModelId, mappingId, groupId),
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.useCustomCalculationsQuery = useCustomCalculationsQuery;
|
|
12
|
+
//# sourceMappingURL=useCustomCalculationsQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCustomCalculationsQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useCustomCalculationsQuery.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAG1C,MAAM,0BAA0B,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,cAA+B,EAAE,EAAE;IACpK,OAAO,IAAA,sBAAQ,EAAC;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;AALW,QAAA,0BAA0B,8BAKrC","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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGroupPropertiesQuery = void 0;
|
|
4
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
5
|
+
const useGroupPropertiesQuery = (iModelId, mappingId, groupId, getAccessToken, mappingsClient) => {
|
|
6
|
+
return (0, react_query_1.useQuery)({
|
|
7
|
+
queryKey: ["groupProperties", iModelId, mappingId, groupId],
|
|
8
|
+
queryFn: async () => mappingsClient.getGroupProperties(await getAccessToken(), iModelId, mappingId, groupId),
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.useGroupPropertiesQuery = useGroupPropertiesQuery;
|
|
12
|
+
//# sourceMappingURL=useGroupPropertiesQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGroupPropertiesQuery.js","sourceRoot":"","sources":["../../../../../src/components/Properties/hooks/useGroupPropertiesQuery.ts"],"names":[],"mappings":";;;AAKA,uDAAiD;AAG1C,MAAM,uBAAuB,GAAG,CAAC,QAAgB,EAAE,SAAiB,EAAE,OAAe,EAAE,cAAgC,EAAE,cAA+B,EAAE,EAAE;IACjK,OAAO,IAAA,sBAAQ,EAAC;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;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 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,
|
|
8
|
+
export declare const DeleteModal: ({ entityName, onClose, onDelete, }: DeleteModalProps) => JSX.Element;
|
|
10
9
|
export default DeleteModal;
|
|
11
10
|
//# sourceMappingURL=DeleteModal.d.ts.map
|
|
@@ -33,12 +33,11 @@ const react_query_1 = require("@tanstack/react-query");
|
|
|
33
33
|
const react_1 = __importStar(require("react"));
|
|
34
34
|
require("./DeleteModal.scss");
|
|
35
35
|
const LoadingSpinner_1 = require("./LoadingSpinner");
|
|
36
|
-
const DeleteModal = ({ entityName, onClose, onDelete,
|
|
36
|
+
const DeleteModal = ({ entityName, onClose, onDelete, }) => {
|
|
37
37
|
const [localEntityName] = (0, react_1.useState)(entityName);
|
|
38
38
|
const deleteMutation = (0, react_query_1.useMutation)({
|
|
39
39
|
mutationFn: onDelete,
|
|
40
40
|
onSuccess: async () => {
|
|
41
|
-
refresh && await refresh();
|
|
42
41
|
onClose();
|
|
43
42
|
},
|
|
44
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteModal.js","sourceRoot":"","sources":["../../../../src/components/SharedComponents/DeleteModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAM8B;AAC9B,uDAAoD;AACpD,+CAAqD;AACrD,8BAA4B;AAC5B,qDAAkD;
|
|
1
|
+
{"version":3,"file":"DeleteModal.js","sourceRoot":"","sources":["../../../../src/components/SharedComponents/DeleteModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAM8B;AAC9B,uDAAoD;AACpD,+CAAqD;AACrD,8BAA4B;AAC5B,qDAAkD;AAQ3C,MAAM,WAAW,GAAG,CAAC,EAC1B,UAAU,EACV,OAAO,EACP,QAAQ,GACS,EAAE,EAAE;IACrB,MAAM,CAAC,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,CAAC;IAE/C,MAAM,cAAc,GAAG,IAAA,yBAAW,EAAC;QACjC,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,KAAK,IAAI,EAAE;YACpB,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACtC,cAAc,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,OAAO,CACL;QACE,8BAAC,qBAAK,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,uCAAK,SAAS,EAAC,4BAA4B;gBACzC,8BAAC,oBAAI,IAAC,OAAO,EAAC,SAAS,EAAC,EAAE,EAAC,IAAI,sCAExB;gBACP,8CACG,8BAAC,oCAAoB,IAAC,IAAI,EAAE,GAAG,UAAU,GAAG,GAAI,CAC1C,CACL;YACN,8BAAC,8BAAc;gBACZ,cAAc,CAAC,SAAS;oBACvB,uCAAK,SAAS,EAAC,oBAAoB;wBACjC,8BAAC,+BAAc,OAAG,CACd;gBACR,8BAAC,sBAAM,IAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,SAAS,aAEtF;gBACT,8BAAC,sBAAM,IACL,SAAS,EAAC,SAAS,EACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,CAAC,SAAS,aAG3B,CACM,CACX,CACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAtDW,QAAA,WAAW,eAsDtB;AAEF,kBAAe,mBAAW,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,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useExtractionStateJobContext = exports.ExtractionStatusJobContext = void 0;
|
|
27
|
+
/*---------------------------------------------------------------------------------------------
|
|
28
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
|
+
*--------------------------------------------------------------------------------------------*/
|
|
31
|
+
const React = __importStar(require("react"));
|
|
32
|
+
exports.ExtractionStatusJobContext = React.createContext({
|
|
33
|
+
mappingIdJobInfo: new Map(),
|
|
34
|
+
setMappingIdJobInfo: () => { },
|
|
35
|
+
});
|
|
36
|
+
const useExtractionStateJobContext = () => {
|
|
37
|
+
const context = React.useContext(exports.ExtractionStatusJobContext);
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error("useExtractionStateJobContext should be used within a ExtractionStatusJobContext provider");
|
|
40
|
+
}
|
|
41
|
+
return context;
|
|
42
|
+
};
|
|
43
|
+
exports.useExtractionStateJobContext = useExtractionStateJobContext;
|
|
44
|
+
//# 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,6CAA+B;AAOlB,QAAA,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAsB;IACjF,gBAAgB,EAAE,IAAI,GAAG,EAAE;IAC3B,mBAAmB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC/B,CAAC,CAAC;AAEI,MAAM,4BAA4B,GAAG,GAAwB,EAAE;IACpE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,kCAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,0FAA0F,CAC3F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,4BAA4B,gCAQvC","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
|
|
@@ -23,25 +23,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.usePropertiesGroupColorContext = exports.PropertiesGroupColorContext = void 0;
|
|
27
27
|
/*---------------------------------------------------------------------------------------------
|
|
28
28
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
29
29
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
30
30
|
*--------------------------------------------------------------------------------------------*/
|
|
31
31
|
const React = __importStar(require("react"));
|
|
32
|
-
exports.
|
|
32
|
+
exports.PropertiesGroupColorContext = React.createContext({
|
|
33
33
|
showGroupColor: false,
|
|
34
|
-
setGroupProperties: () => { },
|
|
35
|
-
setCalculatedProperties: () => { },
|
|
36
|
-
setCustomCalculationProperties: () => { },
|
|
37
34
|
setShowGroupColor: () => { },
|
|
38
35
|
});
|
|
39
|
-
const
|
|
40
|
-
const context = React.useContext(exports.
|
|
36
|
+
const usePropertiesGroupColorContext = () => {
|
|
37
|
+
const context = React.useContext(exports.PropertiesGroupColorContext);
|
|
41
38
|
if (!context) {
|
|
42
|
-
throw new Error("
|
|
39
|
+
throw new Error("usePropertiesGroupColorContext should be used within a PropertiesGroupColorContext provider");
|
|
43
40
|
}
|
|
44
41
|
return context;
|
|
45
42
|
};
|
|
46
|
-
exports.
|
|
47
|
-
//# sourceMappingURL=
|
|
43
|
+
exports.usePropertiesGroupColorContext = usePropertiesGroupColorContext;
|
|
44
|
+
//# 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,6CAA+B;AAOlB,QAAA,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,cAAc,EAAE,KAAK;IACrB,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEI,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,mCAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,8BAA8B,kCAQzC","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"]}
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import React, { useEffect } from "react";
|
|
6
6
|
import { useGroupHilitedElementsContext } from "../components/context/GroupHilitedElementsContext";
|
|
7
|
-
import {
|
|
7
|
+
import { usePropertiesGroupColorContext } from "../components/context/PropertiesGroupColorContext";
|
|
8
8
|
import { GroupingMappingRouter } from "./Router/GroupingMappingRouter";
|
|
9
9
|
import { clearAll } from "../common/viewerUtils";
|
|
10
10
|
export const GroupingMappingContent = ({ routingHistory, navigateTo, goBack, }) => {
|
|
11
11
|
const { setShowGroupColor, setHiddenGroupsIds } = useGroupHilitedElementsContext();
|
|
12
|
-
const { setShowGroupColor: setPropertiesShowGroup } =
|
|
12
|
+
const { setShowGroupColor: setPropertiesShowGroup } = usePropertiesGroupColorContext();
|
|
13
13
|
const currentRoute = routingHistory[routingHistory.length - 1];
|
|
14
14
|
// Clean up group visualization when in mappings
|
|
15
15
|
useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingContent.js","sourceRoot":"","sources":["../../../src/WidgetShell/GroupingMappingContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"GroupingMappingContent.js","sourceRoot":"","sources":["../../../src/WidgetShell/GroupingMappingContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AACnG,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAC;AAEnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,cAAc,EACd,UAAU,EACV,MAAM,GAKP,EAAE,EAAE;IACH,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,GAAG,8BAA8B,EAAE,CAAC;IACnF,MAAM,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,GAAG,8BAA8B,EAAE,CAAC;IACvF,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAE/D,gDAAgD;IAChD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/B,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,kBAAkB,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;YAC9B,QAAQ,EAAE,CAAC;YACX,2CAA2C;SAC5C;aAAM,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YACtC,sBAAsB,CAAC,KAAK,CAAC,CAAC;SAC/B;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEpF,OAAO,CACL,oBAAC,qBAAqB,IACpB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACd,CACH,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 React, { useEffect } from \"react\";\nimport { useGroupHilitedElementsContext } from \"../components/context/GroupHilitedElementsContext\";\nimport { usePropertiesGroupColorContext } from \"../components/context/PropertiesGroupColorContext\";\nimport type { Route } from \"./GroupingMapping\";\nimport { GroupingMappingRouter } from \"./Router/GroupingMappingRouter\";\nimport { clearAll } from \"../common/viewerUtils\";\n\nexport const GroupingMappingContent = ({\n routingHistory,\n navigateTo,\n goBack,\n}: {\n routingHistory: Route[];\n navigateTo: (toRoute: (prev: Route | undefined) => Route) => void;\n goBack: () => void;\n}) => {\n const { setShowGroupColor, setHiddenGroupsIds } = useGroupHilitedElementsContext();\n const { setShowGroupColor: setPropertiesShowGroup } = usePropertiesGroupColorContext();\n const currentRoute = routingHistory[routingHistory.length - 1];\n\n // Clean up group visualization when in mappings\n useEffect(() => {\n if (routingHistory.length === 1) {\n setShowGroupColor(false);\n setHiddenGroupsIds(new Set());\n clearAll();\n // Turn off visualiztion in properties menu\n } else if (routingHistory.length === 2) {\n setPropertiesShowGroup(false);\n }\n }, [routingHistory, setHiddenGroupsIds, setPropertiesShowGroup, setShowGroupColor]);\n\n return (\n <GroupingMappingRouter\n currentRoute={currentRoute}\n navigateTo={navigateTo}\n goBack={goBack}\n />\n );\n};\n"]}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
export const STATUS_CHECK_INTERVAL = 5000;
|
|
6
|
+
export const ANIMATION_DELAY = "3s";
|
|
7
|
+
export const ANIMATION_DURATION = "1s";
|
|
5
8
|
// Types of error codes that get handled by query cache error handler.
|
|
6
9
|
export var TErrCodes;
|
|
7
10
|
(function (TErrCodes) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/components/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/components/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC,sEAAsE;AACtE,MAAM,CAAN,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,mFAAyB,CAAA,CAAC,2DAA2D;AACvF,CAAC,EAFW,SAAS,KAAT,SAAS,QAEpB","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*--------------------------------------------------------------------------------------------*/\nexport const STATUS_CHECK_INTERVAL = 5000;\nexport const ANIMATION_DELAY = \"3s\";\nexport const ANIMATION_DURATION = \"1s\";\n\n// Types of error codes that get handled by query cache error handler.\nexport enum TErrCodes {\n QUERY_HILITE_FETCH_FAILED // Error code when failing to fetch hilite ids for a group.\n}\n"]}
|
|
@@ -8,13 +8,14 @@ import { GroupingMappingApiConfigContext } from "./context/GroupingApiConfigCont
|
|
|
8
8
|
import { createMappingClient, MappingClientContext, } from "./context/MappingClientContext";
|
|
9
9
|
import { createGroupingMappingCustomUI, GroupingMappingCustomUIContext } from "./context/GroupingMappingCustomUIContext";
|
|
10
10
|
import { GroupHilitedElementsContext } from "./context/GroupHilitedElementsContext";
|
|
11
|
-
import {
|
|
11
|
+
import { PropertiesGroupColorContext } from "./context/PropertiesGroupColorContext";
|
|
12
12
|
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
13
13
|
import { createExtractionClient, ExtractionClientContext } from "./context/ExtractionClientContext";
|
|
14
14
|
import { MutationCache, QueryCache, QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
15
15
|
import { toaster } from "@itwin/itwinui-react";
|
|
16
16
|
import { getErrorMessage } from "../common/utils";
|
|
17
17
|
import { TErrCodes } from "./Constants";
|
|
18
|
+
import { ExtractionStatusJobContext } from "./context/ExtractionStateJobContext";
|
|
18
19
|
const authorizationClientGetAccessToken = async () => (await IModelApp.authorizationClient?.getAccessToken()) ?? "";
|
|
19
20
|
const defaultQueryClient = new QueryClient({
|
|
20
21
|
defaultOptions: {
|
|
@@ -63,9 +64,6 @@ export const GroupingMappingContext = (props) => {
|
|
|
63
64
|
const [showGroupColor, setShowGroupColor] = useState(false);
|
|
64
65
|
const [propertiesShowGroup, setPropertiesShowGroup] = useState(false);
|
|
65
66
|
const [groups, setGroups] = useState([]);
|
|
66
|
-
const [groupProperties, setGroupProperties] = useState([]);
|
|
67
|
-
const [calculatedProperties, setCalculatedProperties] = useState([]);
|
|
68
|
-
const [customCalculationProperties, setCustomCalculationProperties] = useState([]);
|
|
69
67
|
const [numberOfVisualizedGroups, setNumberOfVisualizedGroups] = useState(0);
|
|
70
68
|
const [isOverlappedColored, setIsOverlappedColored] = useState(false);
|
|
71
69
|
const [currentHilitedGroups, setCurrentHilitedGroups] = useState(1);
|
|
@@ -76,6 +74,7 @@ export const GroupingMappingContext = (props) => {
|
|
|
76
74
|
overlappedElementGroupPairs: [],
|
|
77
75
|
});
|
|
78
76
|
const queryClient = props.queryClient ?? defaultQueryClient;
|
|
77
|
+
const [mappingIdJobInfo, setMappingIdJobInfo] = useState(new Map());
|
|
79
78
|
useEffect(() => {
|
|
80
79
|
setApiConfig(() => ({
|
|
81
80
|
prefix: props.prefix,
|
|
@@ -114,23 +113,22 @@ export const GroupingMappingContext = (props) => {
|
|
|
114
113
|
const propertiesContextValue = useMemo(() => ({
|
|
115
114
|
showGroupColor: propertiesShowGroup,
|
|
116
115
|
setShowGroupColor: setPropertiesShowGroup,
|
|
117
|
-
|
|
118
|
-
setGroupProperties,
|
|
119
|
-
calculatedProperties,
|
|
120
|
-
setCalculatedProperties,
|
|
121
|
-
customCalculationProperties,
|
|
122
|
-
setCustomCalculationProperties,
|
|
123
|
-
}), [calculatedProperties, customCalculationProperties, groupProperties, propertiesShowGroup]);
|
|
116
|
+
}), [propertiesShowGroup]);
|
|
124
117
|
const customUIContextValue = useMemo(() => ({
|
|
125
118
|
customUIs,
|
|
126
119
|
setCustomUIs,
|
|
127
120
|
}), [customUIs]);
|
|
121
|
+
const extractionStateJobContextValue = useMemo(() => ({
|
|
122
|
+
mappingIdJobInfo,
|
|
123
|
+
setMappingIdJobInfo,
|
|
124
|
+
}), [mappingIdJobInfo]);
|
|
128
125
|
return (React.createElement(QueryClientProvider, { client: queryClient },
|
|
129
126
|
React.createElement(GroupingMappingApiConfigContext.Provider, { value: apiConfig },
|
|
130
127
|
React.createElement(MappingClientContext.Provider, { value: mappingClient },
|
|
131
128
|
React.createElement(ExtractionClientContext.Provider, { value: extractionClient },
|
|
132
|
-
React.createElement(
|
|
133
|
-
React.createElement(
|
|
134
|
-
React.createElement(
|
|
129
|
+
React.createElement(ExtractionStatusJobContext.Provider, { value: extractionStateJobContextValue },
|
|
130
|
+
React.createElement(GroupingMappingCustomUIContext.Provider, { value: customUIContextValue },
|
|
131
|
+
React.createElement(GroupHilitedElementsContext.Provider, { value: hilitedElementsContextValue },
|
|
132
|
+
React.createElement(PropertiesGroupColorContext.Provider, { value: propertiesContextValue }, props.children)))))))));
|
|
135
133
|
};
|
|
136
134
|
//# sourceMappingURL=GroupingMappingContext.js.map
|