@itwin/grouping-mapping-widget 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/Editing/GroupAction.js +5 -1
- package/lib/cjs/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +44 -12
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Groups/groupsHelpers.d.ts +2 -1
- package/lib/cjs/components/Groups/groupsHelpers.js +8 -5
- 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/Import/SelectIModel.js +1 -2
- package/lib/cjs/components/Mappings/Import/SelectIModel.js.map +1 -1
- 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/Editing/GroupAction.js +5 -1
- package/lib/esm/components/Groups/Editing/GroupAction.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +45 -13
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Groups/groupsHelpers.d.ts +2 -1
- package/lib/esm/components/Groups/groupsHelpers.js +6 -4
- 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/Import/SelectIModel.js +1 -2
- package/lib/esm/components/Mappings/Import/SelectIModel.js.map +1 -1
- 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,147 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.GroupsPropertiesSelectionModal = void 0;
|
|
30
|
+
/*---------------------------------------------------------------------------------------------
|
|
31
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
32
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
33
|
+
*--------------------------------------------------------------------------------------------*/
|
|
34
|
+
const server_1 = require("react-dom/server");
|
|
35
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
36
|
+
const react_1 = __importStar(require("react"));
|
|
37
|
+
const HorizontalTile_1 = require("../../SharedComponents/HorizontalTile");
|
|
38
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
39
|
+
const core_1 = require("@dnd-kit/core");
|
|
40
|
+
const sortable_1 = require("@dnd-kit/sortable");
|
|
41
|
+
const SortableHorizontalTile_1 = __importDefault(require("./SortableHorizontalTile"));
|
|
42
|
+
const react_split_1 = __importDefault(require("react-split"));
|
|
43
|
+
require("./GroupsPropertiesSelectionModal.scss");
|
|
44
|
+
const utils_1 = require("../../../common/utils");
|
|
45
|
+
const core_2 = require("@dnd-kit/core");
|
|
46
|
+
const sortable_2 = require("@dnd-kit/sortable");
|
|
47
|
+
const GroupsPropertiesSelectionModal = ({ showModal, setShowModal, selectedProperties, setSelectedProperties, propertiesMetaData, }) => {
|
|
48
|
+
const [searchInput, setSearchInput] = (0, react_1.useState)("");
|
|
49
|
+
const [activeSearchInput, setActiveSearchInput] = (0, react_1.useState)("");
|
|
50
|
+
const [searched, setSearched] = (0, react_1.useState)(false);
|
|
51
|
+
const sensors = (0, core_2.useSensors)((0, core_2.useSensor)(core_2.PointerSensor), (0, core_2.useSensor)(core_2.KeyboardSensor, {
|
|
52
|
+
coordinateGetter: sortable_2.sortableKeyboardCoordinates,
|
|
53
|
+
}));
|
|
54
|
+
const [activeDragProperty, setActiveDragProperty] = (0, react_1.useState)();
|
|
55
|
+
const handleDragStart = (0, react_1.useCallback)((event) => {
|
|
56
|
+
const { active } = event;
|
|
57
|
+
const activeProperty = selectedProperties.find((p) => active.id === p.key);
|
|
58
|
+
setActiveDragProperty(activeProperty);
|
|
59
|
+
}, [selectedProperties]);
|
|
60
|
+
const handleDragEnd = (0, react_1.useCallback)((event) => {
|
|
61
|
+
const { active, over } = event;
|
|
62
|
+
if (over && (active.id !== over.id)) {
|
|
63
|
+
setSelectedProperties((items) => {
|
|
64
|
+
const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);
|
|
65
|
+
const newIndex = selectedProperties.findIndex((p) => over.id === p.key);
|
|
66
|
+
return (0, sortable_2.arrayMove)(items, oldIndex, newIndex);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
setActiveDragProperty(undefined);
|
|
70
|
+
}, [selectedProperties, setSelectedProperties]);
|
|
71
|
+
const clearSearch = (0, react_1.useCallback)(() => {
|
|
72
|
+
setSearchInput("");
|
|
73
|
+
setActiveSearchInput("");
|
|
74
|
+
setSearched(false);
|
|
75
|
+
}, []);
|
|
76
|
+
const startSearch = (0, react_1.useCallback)(() => {
|
|
77
|
+
if (!searchInput)
|
|
78
|
+
return;
|
|
79
|
+
setActiveSearchInput(searchInput);
|
|
80
|
+
setSearched(true);
|
|
81
|
+
}, [searchInput]);
|
|
82
|
+
const filteredProperties = (0, react_1.useMemo)(() => propertiesMetaData.filter((p) => [p.displayLabel, p.categoryLabel, p.actualECClassName]
|
|
83
|
+
.map((l) => l.toLowerCase())
|
|
84
|
+
.some((l) => l.includes(activeSearchInput.toLowerCase()))), [activeSearchInput, propertiesMetaData]);
|
|
85
|
+
(0, react_1.useEffect)(() => {
|
|
86
|
+
if (searchInput.length === 0) {
|
|
87
|
+
setSearched(false);
|
|
88
|
+
clearSearch();
|
|
89
|
+
}
|
|
90
|
+
}, [searchInput, setSearched, clearSearch]);
|
|
91
|
+
return (react_1.default.createElement(core_2.DndContext, { sensors: sensors, collisionDetection: core_2.closestCenter, onDragStart: handleDragStart, onDragEnd: handleDragEnd },
|
|
92
|
+
react_1.default.createElement(itwinui_react_1.Modal, { title: "Properties Selection", isOpen: showModal, onClose: () => {
|
|
93
|
+
setShowModal(false);
|
|
94
|
+
clearSearch();
|
|
95
|
+
}, closeOnExternalClick: false },
|
|
96
|
+
react_1.default.createElement(react_split_1.default, { expandToMin: false, className: "gmw-property-selection-container", gutterAlign: "center", gutterSize: 2, gutter: () => {
|
|
97
|
+
// Expects HTMLElement
|
|
98
|
+
const dragHangle = (0, server_1.renderToStaticMarkup)(react_1.default.createElement(itwinui_react_1.Icon, { className: "gmw-gutter-drag-icon", size: "large" },
|
|
99
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgMoreVerticalSmall, null)));
|
|
100
|
+
const gutter = document.createElement("div");
|
|
101
|
+
gutter.className = `gmw-gutter`;
|
|
102
|
+
gutter.innerHTML = dragHangle;
|
|
103
|
+
return gutter;
|
|
104
|
+
}, direction: "horizontal" },
|
|
105
|
+
react_1.default.createElement(itwinui_react_1.Surface, { className: "gmw-available-properties", elevation: 1 },
|
|
106
|
+
react_1.default.createElement("div", { className: "gmw-available-properties-header" },
|
|
107
|
+
react_1.default.createElement(itwinui_react_1.Label, { as: "span" }, "Available Properties"),
|
|
108
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { displayStyle: "inline", iconDisplayStyle: "inline", className: "gmw-available-prop-search", value: searchInput, size: "small", placeholder: "Search....", onChange: (event) => {
|
|
109
|
+
const { target: { value }, } = event;
|
|
110
|
+
setSearchInput(value);
|
|
111
|
+
}, onKeyDown: (event) => {
|
|
112
|
+
if (event.key === "Enter") {
|
|
113
|
+
startSearch();
|
|
114
|
+
}
|
|
115
|
+
}, svgIcon: searched ? (react_1.default.createElement(itwinui_react_1.IconButton, { onClick: clearSearch, styleType: "borderless", title: 'Clear Search' },
|
|
116
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgClose, null))) : (react_1.default.createElement(itwinui_react_1.IconButton, { onClick: startSearch, styleType: "borderless", title: 'Search' },
|
|
117
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgSearch, null))) })),
|
|
118
|
+
filteredProperties.length === 0 ?
|
|
119
|
+
react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
120
|
+
react_1.default.createElement(itwinui_react_1.Text, null, "No properties available. ")) :
|
|
121
|
+
react_1.default.createElement("div", { className: "gmw-properties-list" }, filteredProperties.map((property) => (react_1.default.createElement(HorizontalTile_1.HorizontalTile, { key: property.key, title: `${property.displayLabel} (${property.propertyType})`, titleTooltip: `${property.actualECClassName}`, subText: (0, utils_1.getLocalizedStringPresentation)(property.categoryLabel), actionGroup: null, selected: selectedProperties.some((p) => property.key === p.key), onClick: () => setSelectedProperties((sp) => sp.some((p) => property.key === p.key)
|
|
122
|
+
? sp.filter((p) => property.key !== p.key)
|
|
123
|
+
: [...sp, property]) }))))),
|
|
124
|
+
react_1.default.createElement(itwinui_react_1.Surface, { className: "gmw-selected-properties", elevation: 1 },
|
|
125
|
+
react_1.default.createElement(itwinui_react_1.Label, { as: "span" }, "Selected Properties"),
|
|
126
|
+
selectedProperties.length === 0 ?
|
|
127
|
+
react_1.default.createElement("div", { className: "gmw-empty-selection" },
|
|
128
|
+
react_1.default.createElement(itwinui_react_1.Text, null, "No properties selected."),
|
|
129
|
+
react_1.default.createElement(itwinui_react_1.Text, null, "Add some by clicking on the properties shown left.")) :
|
|
130
|
+
react_1.default.createElement("div", { className: "gmw-properties-list" },
|
|
131
|
+
react_1.default.createElement(sortable_1.SortableContext, { items: selectedProperties.map((p) => p.key), strategy: sortable_1.verticalListSortingStrategy }, selectedProperties.map((property) => react_1.default.createElement(SortableHorizontalTile_1.default, { key: property.key, id: property.key, title: `${property.displayLabel} (${property.propertyType})`, titleTooltip: `${property.actualECClassName}`, subText: (0, utils_1.getLocalizedStringPresentation)(property.categoryLabel), actionGroup: react_1.default.createElement("div", null,
|
|
132
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless", title: "Remove", onClick: () => {
|
|
133
|
+
setSelectedProperties((sp) => sp.filter((p) => property.key !== p.key));
|
|
134
|
+
} },
|
|
135
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgRemove, null))) })))))),
|
|
136
|
+
react_1.default.createElement(itwinui_react_1.ModalButtonBar, null,
|
|
137
|
+
react_1.default.createElement(itwinui_react_1.Button, { onClick: () => {
|
|
138
|
+
setShowModal(false);
|
|
139
|
+
clearSearch();
|
|
140
|
+
}, styleType: "high-visibility" }, "Close"))),
|
|
141
|
+
react_1.default.createElement(core_1.DragOverlay, { zIndex: 9999 }, activeDragProperty ?
|
|
142
|
+
react_1.default.createElement(HorizontalTile_1.HorizontalTile, { title: `${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`, titleTooltip: `${activeDragProperty.actualECClassName}`, subText: (0, utils_1.getLocalizedStringPresentation)(activeDragProperty.categoryLabel), actionGroup: react_1.default.createElement(itwinui_react_1.IconButton, { styleType: "borderless" },
|
|
143
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgRemove, null)), dragHandle: react_1.default.createElement(itwinui_react_1.Icon, { className: "gmw-drag-icon", size: "large" },
|
|
144
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgDragHandleVertical, null)) }) : null)));
|
|
145
|
+
};
|
|
146
|
+
exports.GroupsPropertiesSelectionModal = GroupsPropertiesSelectionModal;
|
|
147
|
+
//# sourceMappingURL=GroupsPropertiesSelectionModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsPropertiesSelectionModal.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupsPropertiesSelectionModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAAwD;AACxD,wDAU8B;AAC9B,+CAAyE;AACzE,0EAAuE;AACvE,oEAMoC;AACpC,wCAEuB;AACvB,gDAG2B;AAC3B,sFAA8D;AAC9D,8DAAgC;AAChC,iDAA+C;AAE/C,iDAAuE;AACvE,wCAOuB;AACvB,gDAG2B;AAWpB,MAAM,8BAA8B,GAAG,CAC5C,EACE,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACiB,EACrC,EAAE;IACF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EA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CACd,CAAC;AACJ,CAAC,CAAC;AA5OW,QAAA,8BAA8B,kCA4OzC","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 { renderToStaticMarkup } from \"react-dom/server\";\nimport {\n Button,\n Icon,\n IconButton,\n Label,\n LabeledInput,\n Modal,\n ModalButtonBar,\n Surface,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { HorizontalTile } from \"../../SharedComponents/HorizontalTile\";\nimport {\n SvgClose,\n SvgDragHandleVertical,\n SvgMoreVerticalSmall,\n SvgRemove,\n SvgSearch,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n DragOverlay,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport SortableHorizontalTile from \"./SortableHorizontalTile\";\nimport Split from \"react-split\";\nimport \"./GroupsPropertiesSelectionModal.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport { getLocalizedStringPresentation } from \"../../../common/utils\";\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n sortableKeyboardCoordinates,\n} from \"@dnd-kit/sortable\";\nimport type { DragEndEvent, DragStartEvent } from \"@dnd-kit/core\";\n\nexport interface GroupPropertiesSelectionModalProps {\n showModal: boolean;\n setShowModal: (showModal: boolean) => void;\n selectedProperties: PropertyMetaData[];\n setSelectedProperties: (selectedProperties: (selectedProperties: PropertyMetaData[]) => PropertyMetaData[]) => void;\n propertiesMetaData: PropertyMetaData[];\n}\n\nexport const GroupsPropertiesSelectionModal = (\n {\n showModal,\n setShowModal,\n selectedProperties,\n setSelectedProperties,\n propertiesMetaData,\n }: GroupPropertiesSelectionModalProps\n) => {\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [searched, setSearched] = useState<boolean>(false);\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n const [activeDragProperty, setActiveDragProperty] = useState<PropertyMetaData | undefined>();\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n const { active } = event;\n const activeProperty = selectedProperties.find((p) => active.id === p.key);\n setActiveDragProperty(activeProperty);\n }, [selectedProperties]);\n\n const handleDragEnd = useCallback((event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && (active.id !== over.id)) {\n setSelectedProperties((items) => {\n const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);\n const newIndex = selectedProperties.findIndex((p) => over.id === p.key);\n\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n\n setActiveDragProperty(undefined);\n }, [selectedProperties, setSelectedProperties]);\n\n const clearSearch = useCallback(() => {\n setSearchInput(\"\");\n setActiveSearchInput(\"\");\n setSearched(false);\n }, []);\n\n const startSearch = useCallback(() => {\n if (!searchInput) return;\n setActiveSearchInput(searchInput);\n setSearched(true);\n }, [searchInput]);\n\n const filteredProperties = useMemo(\n () =>\n propertiesMetaData.filter((p) =>\n [p.displayLabel, p.categoryLabel, p.actualECClassName]\n .map((l) => l.toLowerCase())\n .some((l) => l.includes(activeSearchInput.toLowerCase()))\n ),\n [activeSearchInput, propertiesMetaData]\n );\n\n useEffect(() => {\n if (searchInput.length === 0) {\n setSearched(false);\n clearSearch();\n }\n }, [searchInput, setSearched, clearSearch]);\n\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <Modal\n title=\"Properties Selection\"\n isOpen={showModal}\n onClose={() => {\n setShowModal(false);\n clearSearch();\n }}\n closeOnExternalClick={false}\n >\n <Split\n expandToMin={false}\n className=\"gmw-property-selection-container\"\n gutterAlign=\"center\"\n gutterSize={2}\n gutter={() => {\n // Expects HTMLElement\n const dragHangle = renderToStaticMarkup(\n <Icon className=\"gmw-gutter-drag-icon\" size=\"large\">\n <SvgMoreVerticalSmall />\n </Icon>\n );\n const gutter = document.createElement(\"div\");\n gutter.className = `gmw-gutter`;\n gutter.innerHTML = dragHangle;\n return gutter;\n }}\n direction=\"horizontal\">\n <Surface className=\"gmw-available-properties\" elevation={1}>\n <div className=\"gmw-available-properties-header\">\n <Label as=\"span\">Available Properties</Label>\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"gmw-available-prop-search\"\n value={searchInput}\n size=\"small\"\n placeholder=\"Search....\"\n onChange={(event) => {\n const {\n target: { value },\n } = event;\n setSearchInput(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n startSearch();\n }\n }}\n svgIcon={\n searched ? (\n <IconButton onClick={clearSearch} styleType=\"borderless\" title='Clear Search'>\n <SvgClose />\n </IconButton>\n ) : (\n <IconButton onClick={startSearch} styleType=\"borderless\" title='Search'>\n <SvgSearch />\n </IconButton>\n )\n }\n />\n </div>\n {filteredProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties available. </Text>\n </div> :\n <div className=\"gmw-properties-list\">\n {\n filteredProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={getLocalizedStringPresentation(property.categoryLabel)}\n actionGroup={null}\n selected={selectedProperties.some((p) => property.key === p.key)}\n onClick={() =>\n setSelectedProperties((sp) =>\n sp.some((p) => property.key === p.key)\n ? sp.filter(\n (p) => property.key !== p.key\n )\n : [...sp, property]\n )\n }\n />\n ))}\n </div>}\n </Surface>\n <Surface className=\"gmw-selected-properties\" elevation={1}>\n <Label as=\"span\">Selected Properties</Label>\n {selectedProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Add some by clicking on the properties shown left.</Text>\n </div> :\n <div className=\"gmw-properties-list\" >\n <SortableContext\n items={selectedProperties.map((p) => p.key)}\n strategy={verticalListSortingStrategy}\n >\n {selectedProperties.map((property) =>\n <SortableHorizontalTile\n key={property.key}\n id={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={getLocalizedStringPresentation(property.categoryLabel)}\n actionGroup={\n <div>\n <IconButton\n styleType=\"borderless\"\n title=\"Remove\"\n onClick={() => {\n setSelectedProperties((sp) => sp.filter(\n (p) => property.key !== p.key\n ));\n }\n }>\n <SvgRemove />\n </IconButton>\n </div>\n }\n />)}\n </SortableContext>\n </div>}\n </Surface>\n </Split>\n <ModalButtonBar>\n <Button\n onClick={() => {\n setShowModal(false);\n clearSearch();\n }}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n <DragOverlay zIndex={9999}>\n {activeDragProperty ?\n <HorizontalTile\n title={`${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`}\n titleTooltip={`${activeDragProperty.actualECClassName}`}\n subText={getLocalizedStringPresentation(activeDragProperty.categoryLabel)}\n actionGroup={\n <IconButton\n styleType=\"borderless\">\n <SvgRemove />\n </IconButton>}\n dragHandle={\n <Icon className=\"gmw-drag-icon\" size=\"large\">\n <SvgDragHandleVertical />\n </Icon>\n }\n /> : null}\n </DragOverlay>\n </DndContext>\n );\n};\n"]}
|
|
@@ -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,2DAA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S,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;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,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
|