@itwin/grouping-mapping-widget 0.2.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/LICENSE.md +9 -0
- package/README.md +26 -0
- package/lib/cjs/api/GroupQueryBuilderApi.d.ts +15 -0
- package/lib/cjs/api/GroupQueryBuilderApi.js +27 -0
- package/lib/cjs/api/GroupQueryBuilderApi.js.map +1 -0
- package/lib/cjs/api/generated/api.d.ts +3222 -0
- package/lib/cjs/api/generated/api.js +5291 -0
- package/lib/cjs/api/generated/api.js.map +1 -0
- package/lib/cjs/api/generated/configuration.d.ts +56 -0
- package/lib/cjs/api/generated/configuration.js +30 -0
- package/lib/cjs/api/generated/configuration.js.map +1 -0
- package/lib/cjs/api/generated/index.d.ts +14 -0
- package/lib/cjs/api/generated/index.js +31 -0
- package/lib/cjs/api/generated/index.js.map +1 -0
- package/lib/cjs/api/reportingClient.d.ts +34 -0
- package/lib/cjs/api/reportingClient.js +177 -0
- package/lib/cjs/api/reportingClient.js.map +1 -0
- package/lib/cjs/decorators/BboxDimensionsDecorator.d.ts +82 -0
- package/lib/cjs/decorators/BboxDimensionsDecorator.js +418 -0
- package/lib/cjs/decorators/BboxDimensionsDecorator.js.map +1 -0
- package/lib/cjs/grouping-mapping-widget.d.ts +7 -0
- package/lib/cjs/grouping-mapping-widget.js +27 -0
- package/lib/cjs/grouping-mapping-widget.js.map +1 -0
- package/lib/cjs/widget/GroupingMappingWidget.d.ts +7 -0
- package/lib/cjs/widget/GroupingMappingWidget.js +51 -0
- package/lib/cjs/widget/GroupingMappingWidget.js.map +1 -0
- package/lib/cjs/widget/components/ActionPanel.d.ts +11 -0
- package/lib/cjs/widget/components/ActionPanel.js +37 -0
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -0
- package/lib/cjs/widget/components/ActionPanel.scss +12 -0
- package/lib/cjs/widget/components/CalculatedPropertyAction.d.ts +14 -0
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +160 -0
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -0
- package/lib/cjs/widget/components/CalculatedPropertyAction.scss +27 -0
- package/lib/cjs/widget/components/CalculatedPropertyTable.d.ts +18 -0
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +109 -0
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -0
- package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +16 -0
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +112 -0
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -0
- package/lib/cjs/widget/components/ConfirmMappingsImport.scss +84 -0
- package/lib/cjs/widget/components/CustomCalculationAction.d.ts +14 -0
- package/lib/cjs/widget/components/CustomCalculationAction.js +103 -0
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -0
- package/lib/cjs/widget/components/CustomCalculationAction.scss +16 -0
- package/lib/cjs/widget/components/CustomCalculationTable.d.ts +18 -0
- package/lib/cjs/widget/components/CustomCalculationTable.js +114 -0
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -0
- package/lib/cjs/widget/components/DeleteModal.d.ts +12 -0
- package/lib/cjs/widget/components/DeleteModal.js +64 -0
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -0
- package/lib/cjs/widget/components/DeleteModal.scss +12 -0
- package/lib/cjs/widget/components/GroupAction.d.ts +12 -0
- package/lib/cjs/widget/components/GroupAction.js +166 -0
- package/lib/cjs/widget/components/GroupAction.js.map +1 -0
- package/lib/cjs/widget/components/GroupAction.scss +19 -0
- package/lib/cjs/widget/components/GroupPropertyAction.d.ts +17 -0
- package/lib/cjs/widget/components/GroupPropertyAction.js +372 -0
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -0
- package/lib/cjs/widget/components/GroupPropertyAction.scss +36 -0
- package/lib/cjs/widget/components/GroupPropertyTable.d.ts +18 -0
- package/lib/cjs/widget/components/GroupPropertyTable.js +109 -0
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -0
- package/lib/cjs/widget/components/GroupQueryBuilder.scss +24 -0
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.d.ts +4 -0
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js +66 -0
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js.map +1 -0
- package/lib/cjs/widget/components/GroupQueryBuilderContext.d.ts +13 -0
- package/lib/cjs/widget/components/GroupQueryBuilderContext.js +37 -0
- package/lib/cjs/widget/components/GroupQueryBuilderContext.js.map +1 -0
- package/lib/cjs/widget/components/Grouping.d.ts +12 -0
- package/lib/cjs/widget/components/Grouping.js +214 -0
- package/lib/cjs/widget/components/Grouping.js.map +1 -0
- package/lib/cjs/widget/components/Grouping.scss +15 -0
- package/lib/cjs/widget/components/GroupingMapping.d.ts +5 -0
- package/lib/cjs/widget/components/GroupingMapping.js +34 -0
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -0
- package/lib/cjs/widget/components/GroupingMapping.scss +24 -0
- package/lib/cjs/widget/components/Mapping.d.ts +7 -0
- package/lib/cjs/widget/components/Mapping.js +162 -0
- package/lib/cjs/widget/components/Mapping.js.map +1 -0
- package/lib/cjs/widget/components/Mapping.scss +26 -0
- package/lib/cjs/widget/components/MappingAction.d.ts +11 -0
- package/lib/cjs/widget/components/MappingAction.js +98 -0
- package/lib/cjs/widget/components/MappingAction.js.map +1 -0
- package/lib/cjs/widget/components/MappingAction.scss +16 -0
- package/lib/cjs/widget/components/MappingImportWizardModal.d.ts +10 -0
- package/lib/cjs/widget/components/MappingImportWizardModal.js +102 -0
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -0
- package/lib/cjs/widget/components/MappingImportWizardModal.scss +21 -0
- package/lib/cjs/widget/components/PropertyMenu.d.ts +24 -0
- package/lib/cjs/widget/components/PropertyMenu.js +141 -0
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -0
- package/lib/cjs/widget/components/PropertyMenu.scss +48 -0
- package/lib/cjs/widget/components/QueryBuilder.d.ts +39 -0
- package/lib/cjs/widget/components/QueryBuilder.js +345 -0
- package/lib/cjs/widget/components/QueryBuilder.js.map +1 -0
- package/lib/cjs/widget/components/SelectIModel.d.ts +12 -0
- package/lib/cjs/widget/components/SelectIModel.js +42 -0
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -0
- package/lib/cjs/widget/components/SelectIModel.scss +20 -0
- package/lib/cjs/widget/components/SelectMapping.scss +17 -0
- package/lib/cjs/widget/components/SelectMappings.d.ts +12 -0
- package/lib/cjs/widget/components/SelectMappings.js +82 -0
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -0
- package/lib/cjs/widget/components/SelectProject.d.ts +10 -0
- package/lib/cjs/widget/components/SelectProject.js +71 -0
- package/lib/cjs/widget/components/SelectProject.js.map +1 -0
- package/lib/cjs/widget/components/SelectProject.scss +38 -0
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +33 -0
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js +92 -0
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +16 -0
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +26 -0
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js +58 -0
- package/lib/cjs/widget/components/property-grid/PrimitivePropertyRenderer.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +67 -0
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js +198 -0
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +71 -0
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +17 -0
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +67 -0
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyList.d.ts +69 -0
- package/lib/cjs/widget/components/property-grid/PropertyList.js +87 -0
- package/lib/cjs/widget/components/property-grid/PropertyList.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyRender.d.ts +92 -0
- package/lib/cjs/widget/components/property-grid/PropertyRender.js +111 -0
- package/lib/cjs/widget/components/property-grid/PropertyRender.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyView.d.ts +20 -0
- package/lib/cjs/widget/components/property-grid/PropertyView.js +218 -0
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyView.scss +111 -0
- package/lib/cjs/widget/components/utils.d.ts +14 -0
- package/lib/cjs/widget/components/utils.js +82 -0
- package/lib/cjs/widget/components/utils.js.map +1 -0
- package/lib/cjs/widget/components/utils.scss +36 -0
- package/lib/cjs/widget/components/viewerUtils.d.ts +9 -0
- package/lib/cjs/widget/components/viewerUtils.js +115 -0
- package/lib/cjs/widget/components/viewerUtils.js.map +1 -0
- package/lib/cjs/widget/hooks/useFetchAccessToken.d.ts +3 -0
- package/lib/cjs/widget/hooks/useFetchAccessToken.js +22 -0
- package/lib/cjs/widget/hooks/useFetchAccessToken.js.map +1 -0
- package/lib/cjs/widget/hooks/useValidator.d.ts +45 -0
- package/lib/cjs/widget/hooks/useValidator.js +53 -0
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -0
- package/lib/cjs/widget/icons/DatabaseInfo.d.ts +5 -0
- package/lib/cjs/widget/icons/DatabaseInfo.js +19 -0
- package/lib/cjs/widget/icons/DatabaseInfo.js.map +1 -0
- package/lib/cjs/widget/icons/DatabaseInfo.scss +12 -0
- package/lib/cjs/widget/utils.d.ts +4 -0
- package/lib/cjs/widget/utils.js +3 -0
- package/lib/cjs/widget/utils.js.map +1 -0
- package/lib/esm/api/GroupQueryBuilderApi.d.ts +15 -0
- package/lib/esm/api/GroupQueryBuilderApi.js +23 -0
- package/lib/esm/api/GroupQueryBuilderApi.js.map +1 -0
- package/lib/esm/api/generated/api.d.ts +3222 -0
- package/lib/esm/api/generated/api.js +5248 -0
- package/lib/esm/api/generated/api.js.map +1 -0
- package/lib/esm/api/generated/configuration.d.ts +56 -0
- package/lib/esm/api/generated/configuration.js +26 -0
- package/lib/esm/api/generated/configuration.js.map +1 -0
- package/lib/esm/api/generated/index.d.ts +14 -0
- package/lib/esm/api/generated/index.js +19 -0
- package/lib/esm/api/generated/index.js.map +1 -0
- package/lib/esm/api/reportingClient.d.ts +34 -0
- package/lib/esm/api/reportingClient.js +173 -0
- package/lib/esm/api/reportingClient.js.map +1 -0
- package/lib/esm/decorators/BboxDimensionsDecorator.d.ts +82 -0
- package/lib/esm/decorators/BboxDimensionsDecorator.js +414 -0
- package/lib/esm/decorators/BboxDimensionsDecorator.js.map +1 -0
- package/lib/esm/grouping-mapping-widget.d.ts +7 -0
- package/lib/esm/grouping-mapping-widget.js +11 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -0
- package/lib/esm/widget/GroupingMappingWidget.d.ts +7 -0
- package/lib/esm/widget/GroupingMappingWidget.js +25 -0
- package/lib/esm/widget/GroupingMappingWidget.js.map +1 -0
- package/lib/esm/widget/components/ActionPanel.d.ts +11 -0
- package/lib/esm/widget/components/ActionPanel.js +16 -0
- package/lib/esm/widget/components/ActionPanel.js.map +1 -0
- package/lib/esm/widget/components/ActionPanel.scss +12 -0
- package/lib/esm/widget/components/CalculatedPropertyAction.d.ts +14 -0
- package/lib/esm/widget/components/CalculatedPropertyAction.js +136 -0
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -0
- package/lib/esm/widget/components/CalculatedPropertyAction.scss +27 -0
- package/lib/esm/widget/components/CalculatedPropertyTable.d.ts +18 -0
- package/lib/esm/widget/components/CalculatedPropertyTable.js +85 -0
- package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -0
- package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +16 -0
- package/lib/esm/widget/components/ConfirmMappingsImport.js +91 -0
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -0
- package/lib/esm/widget/components/ConfirmMappingsImport.scss +84 -0
- package/lib/esm/widget/components/CustomCalculationAction.d.ts +14 -0
- package/lib/esm/widget/components/CustomCalculationAction.js +79 -0
- package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -0
- package/lib/esm/widget/components/CustomCalculationAction.scss +16 -0
- package/lib/esm/widget/components/CustomCalculationTable.d.ts +18 -0
- package/lib/esm/widget/components/CustomCalculationTable.js +90 -0
- package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -0
- package/lib/esm/widget/components/DeleteModal.d.ts +12 -0
- package/lib/esm/widget/components/DeleteModal.js +41 -0
- package/lib/esm/widget/components/DeleteModal.js.map +1 -0
- package/lib/esm/widget/components/DeleteModal.scss +12 -0
- package/lib/esm/widget/components/GroupAction.d.ts +12 -0
- package/lib/esm/widget/components/GroupAction.js +142 -0
- package/lib/esm/widget/components/GroupAction.js.map +1 -0
- package/lib/esm/widget/components/GroupAction.scss +19 -0
- package/lib/esm/widget/components/GroupPropertyAction.d.ts +17 -0
- package/lib/esm/widget/components/GroupPropertyAction.js +347 -0
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -0
- package/lib/esm/widget/components/GroupPropertyAction.scss +36 -0
- package/lib/esm/widget/components/GroupPropertyTable.d.ts +18 -0
- package/lib/esm/widget/components/GroupPropertyTable.js +85 -0
- package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -0
- package/lib/esm/widget/components/GroupQueryBuilder.scss +24 -0
- package/lib/esm/widget/components/GroupQueryBuilderContainer.d.ts +4 -0
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js +43 -0
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js.map +1 -0
- package/lib/esm/widget/components/GroupQueryBuilderContext.d.ts +13 -0
- package/lib/esm/widget/components/GroupQueryBuilderContext.js +15 -0
- package/lib/esm/widget/components/GroupQueryBuilderContext.js.map +1 -0
- package/lib/esm/widget/components/Grouping.d.ts +12 -0
- package/lib/esm/widget/components/Grouping.js +188 -0
- package/lib/esm/widget/components/Grouping.js.map +1 -0
- package/lib/esm/widget/components/Grouping.scss +15 -0
- package/lib/esm/widget/components/GroupingMapping.d.ts +5 -0
- package/lib/esm/widget/components/GroupingMapping.js +13 -0
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -0
- package/lib/esm/widget/components/GroupingMapping.scss +24 -0
- package/lib/esm/widget/components/Mapping.d.ts +7 -0
- package/lib/esm/widget/components/Mapping.js +136 -0
- package/lib/esm/widget/components/Mapping.js.map +1 -0
- package/lib/esm/widget/components/Mapping.scss +26 -0
- package/lib/esm/widget/components/MappingAction.d.ts +11 -0
- package/lib/esm/widget/components/MappingAction.js +74 -0
- package/lib/esm/widget/components/MappingAction.js.map +1 -0
- package/lib/esm/widget/components/MappingAction.scss +16 -0
- package/lib/esm/widget/components/MappingImportWizardModal.d.ts +10 -0
- package/lib/esm/widget/components/MappingImportWizardModal.js +76 -0
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -0
- package/lib/esm/widget/components/MappingImportWizardModal.scss +21 -0
- package/lib/esm/widget/components/PropertyMenu.d.ts +24 -0
- package/lib/esm/widget/components/PropertyMenu.js +115 -0
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -0
- package/lib/esm/widget/components/PropertyMenu.scss +48 -0
- package/lib/esm/widget/components/QueryBuilder.d.ts +39 -0
- package/lib/esm/widget/components/QueryBuilder.js +341 -0
- package/lib/esm/widget/components/QueryBuilder.js.map +1 -0
- package/lib/esm/widget/components/SelectIModel.d.ts +12 -0
- package/lib/esm/widget/components/SelectIModel.js +18 -0
- package/lib/esm/widget/components/SelectIModel.js.map +1 -0
- package/lib/esm/widget/components/SelectIModel.scss +20 -0
- package/lib/esm/widget/components/SelectMapping.scss +17 -0
- package/lib/esm/widget/components/SelectMappings.d.ts +12 -0
- package/lib/esm/widget/components/SelectMappings.js +61 -0
- package/lib/esm/widget/components/SelectMappings.js.map +1 -0
- package/lib/esm/widget/components/SelectProject.d.ts +10 -0
- package/lib/esm/widget/components/SelectProject.js +47 -0
- package/lib/esm/widget/components/SelectProject.js.map +1 -0
- package/lib/esm/widget/components/SelectProject.scss +38 -0
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.d.ts +33 -0
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js +69 -0
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.js.map +1 -0
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +16 -0
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.d.ts +26 -0
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js +35 -0
- package/lib/esm/widget/components/property-grid/PrimitivePropertyRenderer.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +67 -0
- package/lib/esm/widget/components/property-grid/PropertyGrid.js +172 -0
- package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyGrid.scss +71 -0
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +17 -0
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +44 -0
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyList.d.ts +69 -0
- package/lib/esm/widget/components/property-grid/PropertyList.js +60 -0
- package/lib/esm/widget/components/property-grid/PropertyList.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyRender.d.ts +92 -0
- package/lib/esm/widget/components/property-grid/PropertyRender.js +88 -0
- package/lib/esm/widget/components/property-grid/PropertyRender.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyView.d.ts +20 -0
- package/lib/esm/widget/components/property-grid/PropertyView.js +195 -0
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyView.scss +111 -0
- package/lib/esm/widget/components/utils.d.ts +14 -0
- package/lib/esm/widget/components/utils.js +72 -0
- package/lib/esm/widget/components/utils.js.map +1 -0
- package/lib/esm/widget/components/utils.scss +36 -0
- package/lib/esm/widget/components/viewerUtils.d.ts +9 -0
- package/lib/esm/widget/components/viewerUtils.js +106 -0
- package/lib/esm/widget/components/viewerUtils.js.map +1 -0
- package/lib/esm/widget/hooks/useFetchAccessToken.d.ts +3 -0
- package/lib/esm/widget/hooks/useFetchAccessToken.js +20 -0
- package/lib/esm/widget/hooks/useFetchAccessToken.js.map +1 -0
- package/lib/esm/widget/hooks/useValidator.d.ts +45 -0
- package/lib/esm/widget/hooks/useValidator.js +47 -0
- package/lib/esm/widget/hooks/useValidator.js.map +1 -0
- package/lib/esm/widget/icons/DatabaseInfo.d.ts +5 -0
- package/lib/esm/widget/icons/DatabaseInfo.js +14 -0
- package/lib/esm/widget/icons/DatabaseInfo.js.map +1 -0
- package/lib/esm/widget/icons/DatabaseInfo.scss +12 -0
- package/lib/esm/widget/utils.d.ts +4 -0
- package/lib/esm/widget/utils.js +2 -0
- package/lib/esm/widget/utils.js.map +1 -0
- package/package.json +116 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
/*---------------------------------------------------------------------------------------------
|
|
26
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
27
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
28
|
+
*--------------------------------------------------------------------------------------------*/
|
|
29
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const reportingClient_1 = require("../../api/reportingClient");
|
|
32
|
+
const ActionPanel_1 = __importDefault(require("./ActionPanel"));
|
|
33
|
+
const useValidator_1 = __importStar(require("../hooks/useValidator"));
|
|
34
|
+
const utils_1 = require("./utils");
|
|
35
|
+
require("./MappingAction.scss");
|
|
36
|
+
const MappingAction = ({ iModelId, mapping, returnFn }) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const [values, setValues] = react_1.useState({
|
|
39
|
+
name: (_a = mapping === null || mapping === void 0 ? void 0 : mapping.mappingName) !== null && _a !== void 0 ? _a : "",
|
|
40
|
+
description: (_b = mapping === null || mapping === void 0 ? void 0 : mapping.description) !== null && _b !== void 0 ? _b : "",
|
|
41
|
+
});
|
|
42
|
+
const [validator, showValidationMessage] = useValidator_1.default();
|
|
43
|
+
const [isLoading, setIsLoading] = react_1.useState(false);
|
|
44
|
+
// TODO ERRORED STATE
|
|
45
|
+
const onSave = async () => {
|
|
46
|
+
var _a;
|
|
47
|
+
try {
|
|
48
|
+
if (!validator.allValid()) {
|
|
49
|
+
showValidationMessage(true);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setIsLoading(true);
|
|
53
|
+
mapping
|
|
54
|
+
? await reportingClient_1.reportingClientApi.updateMapping(iModelId, (_a = mapping.id) !== null && _a !== void 0 ? _a : "", {
|
|
55
|
+
mappingName: values.name,
|
|
56
|
+
description: values.description,
|
|
57
|
+
})
|
|
58
|
+
: await reportingClient_1.reportingClientApi.createMapping(iModelId, {
|
|
59
|
+
mappingName: values.name,
|
|
60
|
+
description: values.description,
|
|
61
|
+
});
|
|
62
|
+
await returnFn();
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
setIsLoading(false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
69
|
+
react_1.default.createElement(utils_1.WidgetHeader, { title: mapping ? "Modify Mapping" : "Add Mapping", returnFn: returnFn }),
|
|
70
|
+
react_1.default.createElement("div", { className: 'details-form-container' },
|
|
71
|
+
react_1.default.createElement(itwinui_react_1.Fieldset, { legend: 'Mapping Details', className: 'details-form' },
|
|
72
|
+
react_1.default.createElement(itwinui_react_1.Small, { className: 'field-legend' }, "Asterisk * indicates mandatory fields."),
|
|
73
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { id: 'name', name: 'name', label: 'Name', value: values.name, required: true, onChange: (event) => {
|
|
74
|
+
utils_1.handleInputChange(event, values, setValues);
|
|
75
|
+
validator.showMessageFor("name");
|
|
76
|
+
}, message: validator.message("name", values.name, useValidator_1.NAME_REQUIREMENTS), status: validator.message("name", values.name, useValidator_1.NAME_REQUIREMENTS)
|
|
77
|
+
? "negative"
|
|
78
|
+
: undefined, onBlur: () => {
|
|
79
|
+
validator.showMessageFor("name");
|
|
80
|
+
}, onBlurCapture: (event) => {
|
|
81
|
+
utils_1.handleInputChange(event, values, setValues);
|
|
82
|
+
validator.showMessageFor("name");
|
|
83
|
+
} }),
|
|
84
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { id: 'description', required: true, name: 'description', label: 'Description', value: values.description, onChange: (event) => {
|
|
85
|
+
utils_1.handleInputChange(event, values, setValues);
|
|
86
|
+
validator.showMessageFor("description");
|
|
87
|
+
}, message: validator.message("description", values.description, "required"), status: validator.message("description", values.description, "required")
|
|
88
|
+
? "negative"
|
|
89
|
+
: undefined, onBlur: () => {
|
|
90
|
+
validator.showMessageFor("description");
|
|
91
|
+
}, onBlurCapture: (event) => {
|
|
92
|
+
utils_1.handleInputChange(event, values, setValues);
|
|
93
|
+
validator.showMessageFor("description");
|
|
94
|
+
} }))),
|
|
95
|
+
react_1.default.createElement(ActionPanel_1.default, { onSave: onSave, onCancel: returnFn, disabled: !(values.name && values.description), isLoading: isLoading })));
|
|
96
|
+
};
|
|
97
|
+
exports.default = MappingAction;
|
|
98
|
+
//# sourceMappingURL=MappingAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MappingAction.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,wDAAqE;AACrE,+CAAwC;AAExC,+DAA+D;AAC/D,gEAAwC;AACxC,sEAAwE;AACxE,mCAA0D;AAC1D,gCAA8B;AAQ9B,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAsB,EAAE,EAAE;;IAC5E,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,gBAAQ,CAAC;QACnC,IAAI,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,EAAE;QAChC,WAAW,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,EAAE;KACxC,CAAC,CAAC;IACH,MAAM,CAAC,SAAS,EAAE,qBAAqB,CAAC,GAAG,sBAAY,EAAE,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,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1C,CAAC,EACD,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;wBACvB,yBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;wBAC5C,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;oBAC1C,CAAC,GACD,CACO,CACP;QACN,8BAAC,qBAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,WAAW,CAAC,EAC9C,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,aAAa,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 { Fieldset, LabeledInput, Small } from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport type { MappingReportingAPI } from \"../../api/generated/api\";\nimport { reportingClientApi } from \"../../api/reportingClient\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleInputChange, WidgetHeader } from \"./utils\";\nimport \"./MappingAction.scss\";\n\ninterface MappingActionProps {\n iModelId: string;\n mapping?: MappingReportingAPI;\n returnFn: () => Promise<void>;\n}\n\nconst MappingAction = ({ iModelId, mapping, returnFn }: MappingActionProps) => {\n const [values, setValues] = useState({\n name: mapping?.mappingName ?? \"\",\n description: mapping?.description ?? \"\",\n });\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n // TODO ERRORED STATE\n const onSave = async () => {\n try {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n setIsLoading(true);\n mapping\n ? await reportingClientApi.updateMapping(iModelId, mapping.id ?? \"\", {\n mappingName: values.name,\n description: values.description,\n })\n : await reportingClientApi.createMapping(iModelId, {\n mappingName: values.name,\n description: values.description,\n });\n await returnFn();\n } catch {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <WidgetHeader\n title={mapping ? \"Modify Mapping\" : \"Add Mapping\"}\n returnFn={returnFn}\n />\n <div className='details-form-container'>\n <Fieldset legend='Mapping Details' className='details-form'>\n <Small className='field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='name'\n name='name'\n label='Name'\n value={values.name}\n required\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", values.name, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", values.name, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledInput\n id='description'\n required\n name='description'\n label='Description'\n value={values.description}\n onChange={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"description\");\n }}\n message={validator.message(\n \"description\",\n values.description,\n \"required\",\n )}\n status={\n validator.message(\"description\", values.description, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"description\");\n }}\n onBlurCapture={(event) => {\n handleInputChange(event, values, setValues);\n validator.showMessageFor(\"description\");\n }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={returnFn}\n disabled={!(values.name && values.description)}\n isLoading={isLoading}\n />\n </>\n );\n};\n\nexport default MappingAction;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import '~@itwin/itwinui-css/scss/variables';
|
|
6
|
+
|
|
7
|
+
.details-form-container {
|
|
8
|
+
overflow-x: auto;
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
.details-form {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: $iui-baseline;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./MappingImportWizardModal.scss";
|
|
3
|
+
interface MappingImportWizardModalProps {
|
|
4
|
+
show: boolean;
|
|
5
|
+
setShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
6
|
+
onFinish: () => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const MappingImportWizardModal: ({ show, setShow, onFinish, }: MappingImportWizardModalProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=MappingImportWizardModal.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.MappingImportWizardModal = void 0;
|
|
26
|
+
/*---------------------------------------------------------------------------------------------
|
|
27
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
28
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
29
|
+
*--------------------------------------------------------------------------------------------*/
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
32
|
+
const SelectProject_1 = __importDefault(require("./SelectProject"));
|
|
33
|
+
require("./MappingImportWizardModal.scss");
|
|
34
|
+
const SelectIModel_1 = __importDefault(require("./SelectIModel"));
|
|
35
|
+
const SelectMappings_1 = __importDefault(require("./SelectMappings"));
|
|
36
|
+
const ConfirmMappingsImport_1 = __importDefault(require("./ConfirmMappingsImport"));
|
|
37
|
+
const MappingImportWizardModal = ({ show, setShow, onFinish, }) => {
|
|
38
|
+
const [currentStep, setCurrentStep] = react_1.useState(0);
|
|
39
|
+
const [selectedProjectId, setSelectedProjectId] = react_1.useState("");
|
|
40
|
+
const [selectedIModelId, setSelectedIModelId] = react_1.useState("");
|
|
41
|
+
const [selectedMappings, setSelectedMappings] = react_1.useState([]);
|
|
42
|
+
const [importing, setImporting] = react_1.useState(false);
|
|
43
|
+
const steps = react_1.useRef([
|
|
44
|
+
{
|
|
45
|
+
name: "Select source project",
|
|
46
|
+
description: "Select the source project to bring your mappings from.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "Select iModel",
|
|
50
|
+
description: "Select an iModel within the project you have selected.",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "Select Mapping",
|
|
54
|
+
description: "Select one or more mappings to import.",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "Rename & Confirm",
|
|
58
|
+
description: "Rename and confirm your selections. Click import when finished.",
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
61
|
+
const onClose = async () => {
|
|
62
|
+
setShow(false);
|
|
63
|
+
await onFinish();
|
|
64
|
+
};
|
|
65
|
+
return (react_1.default.createElement(itwinui_react_1.Modal, { title: 'Import Mappings', modalRootId: 'grouping-mapping-widget', isOpen: show, closeOnEsc: false, closeOnExternalClick: false, isDismissible: !importing, onClose: async () => {
|
|
66
|
+
await onClose();
|
|
67
|
+
} },
|
|
68
|
+
react_1.default.createElement("div", { className: 'import-wizard-body-container' },
|
|
69
|
+
react_1.default.createElement(itwinui_react_1.Wizard, { currentStep: currentStep, steps: steps.current, onStepClick: importing ? undefined : (index) => setCurrentStep(index) }),
|
|
70
|
+
(() => {
|
|
71
|
+
switch (currentStep) {
|
|
72
|
+
case 0:
|
|
73
|
+
return (react_1.default.createElement(SelectProject_1.default, { onSelect: (project) => {
|
|
74
|
+
setSelectedProjectId(project.id);
|
|
75
|
+
setCurrentStep(1);
|
|
76
|
+
}, onCancel: onClose }));
|
|
77
|
+
case 1:
|
|
78
|
+
return (react_1.default.createElement(SelectIModel_1.default, { projectId: selectedProjectId, onSelect: (iModel) => {
|
|
79
|
+
setSelectedIModelId(iModel.id);
|
|
80
|
+
setCurrentStep(2);
|
|
81
|
+
}, backFn: () => setCurrentStep(currentStep - 1), onCancel: onClose }));
|
|
82
|
+
case 2:
|
|
83
|
+
case 3:
|
|
84
|
+
// Preserve table state within Select Mappings
|
|
85
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
86
|
+
react_1.default.createElement("div", { style: { display: currentStep === 2 ? "block" : "none" } },
|
|
87
|
+
react_1.default.createElement(SelectMappings_1.default, { iModelId: selectedIModelId, onSelect: (selectedMappings) => {
|
|
88
|
+
setSelectedMappings(selectedMappings);
|
|
89
|
+
setCurrentStep(3);
|
|
90
|
+
}, onCancel: onClose, backFn: () => setCurrentStep(currentStep - 1) })),
|
|
91
|
+
currentStep === 3 && (react_1.default.createElement(ConfirmMappingsImport_1.default, { sourceiModelId: selectedIModelId, selectedMappings: selectedMappings, importing: importing, setImporting: setImporting, setSelectedMappings: setSelectedMappings, backFn: () => setCurrentStep(currentStep - 1), onCancel: onClose, onFinish: async () => {
|
|
92
|
+
await onClose();
|
|
93
|
+
setCurrentStep(0);
|
|
94
|
+
setImporting(false);
|
|
95
|
+
} }))));
|
|
96
|
+
default:
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
})())));
|
|
100
|
+
};
|
|
101
|
+
exports.MappingImportWizardModal = MappingImportWizardModal;
|
|
102
|
+
//# sourceMappingURL=MappingImportWizardModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MappingImportWizardModal.js","sourceRoot":"","sources":["../../../../src/widget/components/MappingImportWizardModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAgD;AAEhD,wDAAqD;AACrD,oEAA4C;AAC5C,2CAAyC;AACzC,kEAA0C;AAC1C,sEAA8C;AAE9C,oFAA2D;AAQpD,MAAM,wBAAwB,GAAG,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,QAAQ,GACsB,EAAE,EAAE;IAClC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,gBAAQ,CAAS,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,gBAAQ,CAAS,EAAE,CAAC,CAAC;IACvE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,gBAAQ,CAAS,EAAE,CAAC,CAAC;IACrE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,gBAAQ,CAAY,EAAE,CAAC,CAAC;IACxE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG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CAAC,CAAC;oCAClB,YAAY,CAAC,KAAK,CAAC,CAAC;gCACtB,CAAC,GACD,CACH,CACA,CACJ,CAAC;oBACJ;wBACE,OAAO,IAAI,CAAC;iBACf;YACH,CAAC,CAAC,EAAE,CACA,CACA,CACT,CAAC;AACJ,CAAC,CAAC;AA5HW,QAAA,wBAAwB,4BA4HnC","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, { useRef, useState } from \"react\";\nimport type { StepProperties} from \"@itwin/itwinui-react\";\nimport { Modal, Wizard } from \"@itwin/itwinui-react\";\nimport SelectProject from \"./SelectProject\";\nimport \"./MappingImportWizardModal.scss\";\nimport SelectIModel from \"./SelectIModel\";\nimport SelectMappings from \"./SelectMappings\";\nimport type { Mapping } from \"./Mapping\";\nimport ConfirmMappingImport from \"./ConfirmMappingsImport\";\n\ninterface MappingImportWizardModalProps {\n show: boolean;\n setShow: React.Dispatch<React.SetStateAction<boolean>>;\n onFinish: () => Promise<void>;\n}\n\nexport const MappingImportWizardModal = ({\n show,\n setShow,\n onFinish,\n}: MappingImportWizardModalProps) => {\n const [currentStep, setCurrentStep] = useState<number>(0);\n const [selectedProjectId, setSelectedProjectId] = useState<string>(\"\");\n const [selectedIModelId, setSelectedIModelId] = useState<string>(\"\");\n const [selectedMappings, setSelectedMappings] = useState<Mapping[]>([]);\n const [importing, setImporting] = useState<boolean>(false);\n\n const steps = useRef<StepProperties[]>([\n {\n name: \"Select source project\",\n description: \"Select the source project to bring your mappings from.\",\n },\n {\n name: \"Select iModel\",\n description: \"Select an iModel within the project you have selected.\",\n },\n {\n name: \"Select Mapping\",\n description: \"Select one or more mappings to import.\",\n },\n {\n name: \"Rename & Confirm\",\n description:\n \"Rename and confirm your selections. Click import when finished.\",\n },\n ]);\n\n const onClose = async () => {\n setShow(false);\n await onFinish();\n };\n\n return (\n <Modal\n title='Import Mappings'\n modalRootId='grouping-mapping-widget'\n isOpen={show}\n closeOnEsc={false}\n closeOnExternalClick={false}\n isDismissible={!importing}\n onClose={async () => {\n await onClose();\n }}\n >\n <div className='import-wizard-body-container'>\n <Wizard\n currentStep={currentStep}\n steps={steps.current}\n onStepClick={\n importing ? undefined : (index: number) => setCurrentStep(index)\n }\n />\n\n {(() => {\n switch (currentStep) {\n case 0:\n return (\n <SelectProject\n onSelect={(project) => {\n setSelectedProjectId(project.id);\n setCurrentStep(1);\n }}\n onCancel={onClose}\n />\n );\n case 1:\n return (\n <SelectIModel\n projectId={selectedProjectId}\n onSelect={(iModel) => {\n setSelectedIModelId(iModel.id);\n setCurrentStep(2);\n }}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n />\n );\n case 2:\n case 3:\n // Preserve table state within Select Mappings\n return (\n <>\n <div\n style={{ display: currentStep === 2 ? \"block\" : \"none\" }}\n >\n <SelectMappings\n iModelId={selectedIModelId}\n onSelect={(selectedMappings) => {\n setSelectedMappings(selectedMappings);\n setCurrentStep(3);\n }}\n onCancel={onClose}\n backFn={() => setCurrentStep(currentStep - 1)}\n />\n </div>\n {currentStep === 3 && (\n <ConfirmMappingImport\n sourceiModelId={selectedIModelId}\n selectedMappings={selectedMappings}\n importing={importing}\n setImporting={setImporting}\n setSelectedMappings={setSelectedMappings}\n backFn={() => setCurrentStep(currentStep - 1)}\n onCancel={onClose}\n onFinish={async () => {\n await onClose();\n setCurrentStep(0);\n setImporting(false);\n }}\n />\n )}\n </>\n );\n default:\n return null;\n }\n })()}\n </div>\n </Modal>\n );\n};\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import '~@itwin/itwinui-css/scss/variables';
|
|
6
|
+
|
|
7
|
+
.import-wizard-body-container {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: $iui-baseline * 2;
|
|
11
|
+
margin-top: $iui-baseline * 2;
|
|
12
|
+
width: 50vw;
|
|
13
|
+
min-width: 400px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.import-action-panel {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
padding: $iui-baseline * 2 $iui-m $iui-baseline;
|
|
20
|
+
gap: $iui-s;
|
|
21
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Group } from "./Grouping";
|
|
3
|
+
import "./PropertyMenu.scss";
|
|
4
|
+
interface PropertyModifyProps {
|
|
5
|
+
iModelId: string;
|
|
6
|
+
mappingId: string;
|
|
7
|
+
group: Group;
|
|
8
|
+
goBack: () => Promise<void>;
|
|
9
|
+
hideGroupProps?: boolean;
|
|
10
|
+
hideCalculatedProps?: boolean;
|
|
11
|
+
hideCustomCalculationProps?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare enum PropertyMenuView {
|
|
14
|
+
DEFAULT = "default",
|
|
15
|
+
ADD_GROUP_PROPERTY = "add_group_property",
|
|
16
|
+
MODIFY_GROUP_PROPERTY = "modify_group_property",
|
|
17
|
+
ADD_CALCULATED_PROPERTY = "add_calculated_property",
|
|
18
|
+
MODIFY_CALCULATED_PROPERTY = "modify_calculated_property",
|
|
19
|
+
ADD_CUSTOM_CALCULATION = "add_custom_calculation",
|
|
20
|
+
MODIFY_CUSTOM_CALCULATION = "modify_custom_calculation"
|
|
21
|
+
}
|
|
22
|
+
export declare const PropertyMenu: ({ iModelId, mappingId, group, goBack, hideGroupProps, hideCalculatedProps, hideCustomCalculationProps, }: PropertyModifyProps) => JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=PropertyMenu.d.ts.map
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.PropertyMenu = exports.PropertyMenuView = void 0;
|
|
26
|
+
const presentation_frontend_1 = require("@itwin/presentation-frontend");
|
|
27
|
+
const appui_react_1 = require("@itwin/appui-react");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const utils_1 = require("./utils");
|
|
30
|
+
const viewerUtils_1 = require("./viewerUtils");
|
|
31
|
+
require("./PropertyMenu.scss");
|
|
32
|
+
const GroupPropertyAction_1 = __importDefault(require("./GroupPropertyAction"));
|
|
33
|
+
const CalculatedPropertyAction_1 = __importDefault(require("./CalculatedPropertyAction"));
|
|
34
|
+
const GroupPropertyTable_1 = __importDefault(require("./GroupPropertyTable"));
|
|
35
|
+
const CalculatedPropertyTable_1 = __importDefault(require("./CalculatedPropertyTable"));
|
|
36
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
37
|
+
const DatabaseInfo_1 = __importDefault(require("../icons/DatabaseInfo"));
|
|
38
|
+
const CustomCalculationTable_1 = __importDefault(require("./CustomCalculationTable"));
|
|
39
|
+
const CustomCalculationAction_1 = __importDefault(require("./CustomCalculationAction"));
|
|
40
|
+
const presentation_common_1 = require("@itwin/presentation-common");
|
|
41
|
+
var PropertyMenuView;
|
|
42
|
+
(function (PropertyMenuView) {
|
|
43
|
+
PropertyMenuView["DEFAULT"] = "default";
|
|
44
|
+
PropertyMenuView["ADD_GROUP_PROPERTY"] = "add_group_property";
|
|
45
|
+
PropertyMenuView["MODIFY_GROUP_PROPERTY"] = "modify_group_property";
|
|
46
|
+
PropertyMenuView["ADD_CALCULATED_PROPERTY"] = "add_calculated_property";
|
|
47
|
+
PropertyMenuView["MODIFY_CALCULATED_PROPERTY"] = "modify_calculated_property";
|
|
48
|
+
PropertyMenuView["ADD_CUSTOM_CALCULATION"] = "add_custom_calculation";
|
|
49
|
+
PropertyMenuView["MODIFY_CUSTOM_CALCULATION"] = "modify_custom_calculation";
|
|
50
|
+
})(PropertyMenuView = exports.PropertyMenuView || (exports.PropertyMenuView = {}));
|
|
51
|
+
const PropertyMenu = ({ iModelId, mappingId, group, goBack, hideGroupProps = false, hideCalculatedProps = false, hideCustomCalculationProps = false, }) => {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
53
|
+
const iModelConnection = appui_react_1.useActiveIModelConnection();
|
|
54
|
+
const [propertyMenuView, setPropertyMenuView] = react_1.useState(PropertyMenuView.DEFAULT);
|
|
55
|
+
const [selectedGroupProperty, setSelectedGroupProperty] = react_1.useState(undefined);
|
|
56
|
+
const [selectedCalculatedProperty, setSelectedCalculatedProperty] = react_1.useState(undefined);
|
|
57
|
+
const [selectedCustomCalculation, setSelectedCustomCalculation] = react_1.useState(undefined);
|
|
58
|
+
const [isInformationPanelOpen, setIsInformationPanelOpen] = react_1.useState(false);
|
|
59
|
+
const [resolvedHiliteIds, setResolvedHiliteIds] = react_1.useState([]);
|
|
60
|
+
const [keySet, setKeySet] = react_1.useState();
|
|
61
|
+
const [isLoading, setIsLoading] = react_1.useState(true);
|
|
62
|
+
react_1.useEffect(() => {
|
|
63
|
+
const initialize = async () => {
|
|
64
|
+
var _a;
|
|
65
|
+
const ids = await utils_1.fetchIdsFromQuery((_a = group.query) !== null && _a !== void 0 ? _a : "", iModelConnection);
|
|
66
|
+
const keys = await viewerUtils_1.manufactureKeys(ids, iModelConnection);
|
|
67
|
+
setKeySet(keys);
|
|
68
|
+
presentation_frontend_1.Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
|
|
69
|
+
viewerUtils_1.clearEmphasizedElements();
|
|
70
|
+
const resolvedIds = await viewerUtils_1.visualizeElementsByKeys(keys, "red");
|
|
71
|
+
await viewerUtils_1.zoomToElements(resolvedIds);
|
|
72
|
+
setResolvedHiliteIds(resolvedIds);
|
|
73
|
+
setIsLoading(false);
|
|
74
|
+
};
|
|
75
|
+
void initialize();
|
|
76
|
+
}, [iModelConnection, group.query]);
|
|
77
|
+
const onGroupPropertyModify = react_1.useCallback((value) => {
|
|
78
|
+
setSelectedGroupProperty(value.row.original);
|
|
79
|
+
setPropertyMenuView(PropertyMenuView.MODIFY_GROUP_PROPERTY);
|
|
80
|
+
}, []);
|
|
81
|
+
const onCalculatedPropertyModify = react_1.useCallback((value) => {
|
|
82
|
+
setSelectedCalculatedProperty(value.row.original);
|
|
83
|
+
setPropertyMenuView(PropertyMenuView.MODIFY_CALCULATED_PROPERTY);
|
|
84
|
+
}, []);
|
|
85
|
+
const onCustomCalculationModify = react_1.useCallback((value) => {
|
|
86
|
+
setSelectedCustomCalculation(value.row.original);
|
|
87
|
+
setPropertyMenuView(PropertyMenuView.MODIFY_CUSTOM_CALCULATION);
|
|
88
|
+
}, []);
|
|
89
|
+
const calculatedPropertyReturn = react_1.useCallback(async () => {
|
|
90
|
+
viewerUtils_1.visualizeElements(resolvedHiliteIds, "red");
|
|
91
|
+
await viewerUtils_1.zoomToElements(resolvedHiliteIds);
|
|
92
|
+
setPropertyMenuView(PropertyMenuView.DEFAULT);
|
|
93
|
+
}, [resolvedHiliteIds]);
|
|
94
|
+
if (isLoading) {
|
|
95
|
+
return (react_1.default.createElement("div", { className: 'loading-overlay' },
|
|
96
|
+
react_1.default.createElement(itwinui_react_1.Text, null, "Loading Group"),
|
|
97
|
+
react_1.default.createElement(itwinui_react_1.ProgressRadial, { indeterminate: true }),
|
|
98
|
+
react_1.default.createElement(itwinui_react_1.Text, null, "Please wait...")));
|
|
99
|
+
}
|
|
100
|
+
switch (propertyMenuView) {
|
|
101
|
+
case PropertyMenuView.ADD_GROUP_PROPERTY:
|
|
102
|
+
return (react_1.default.createElement(GroupPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_a = group.id) !== null && _a !== void 0 ? _a : "", keySet: keySet !== null && keySet !== void 0 ? keySet : new presentation_common_1.KeySet(), returnFn: async () => {
|
|
103
|
+
setPropertyMenuView(PropertyMenuView.DEFAULT);
|
|
104
|
+
} }));
|
|
105
|
+
case PropertyMenuView.MODIFY_GROUP_PROPERTY:
|
|
106
|
+
return (react_1.default.createElement(GroupPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_b = group.id) !== null && _b !== void 0 ? _b : "", keySet: keySet !== null && keySet !== void 0 ? keySet : new presentation_common_1.KeySet(), groupPropertyId: (_c = selectedGroupProperty === null || selectedGroupProperty === void 0 ? void 0 : selectedGroupProperty.id) !== null && _c !== void 0 ? _c : "", groupPropertyName: (_d = selectedGroupProperty === null || selectedGroupProperty === void 0 ? void 0 : selectedGroupProperty.propertyName) !== null && _d !== void 0 ? _d : "", returnFn: async () => {
|
|
107
|
+
setPropertyMenuView(PropertyMenuView.DEFAULT);
|
|
108
|
+
} }));
|
|
109
|
+
case PropertyMenuView.ADD_CALCULATED_PROPERTY:
|
|
110
|
+
return (react_1.default.createElement(CalculatedPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_e = group.id) !== null && _e !== void 0 ? _e : "", ids: resolvedHiliteIds, returnFn: calculatedPropertyReturn }));
|
|
111
|
+
case PropertyMenuView.MODIFY_CALCULATED_PROPERTY:
|
|
112
|
+
return (react_1.default.createElement(CalculatedPropertyAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_f = group.id) !== null && _f !== void 0 ? _f : "", property: selectedCalculatedProperty, ids: resolvedHiliteIds, returnFn: calculatedPropertyReturn }));
|
|
113
|
+
case PropertyMenuView.ADD_CUSTOM_CALCULATION:
|
|
114
|
+
return (react_1.default.createElement(CustomCalculationAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_g = group.id) !== null && _g !== void 0 ? _g : "", returnFn: async () => {
|
|
115
|
+
setPropertyMenuView(PropertyMenuView.DEFAULT);
|
|
116
|
+
} }));
|
|
117
|
+
case PropertyMenuView.MODIFY_CUSTOM_CALCULATION:
|
|
118
|
+
return (react_1.default.createElement(CustomCalculationAction_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_h = group.id) !== null && _h !== void 0 ? _h : "", customCalculation: selectedCustomCalculation, returnFn: calculatedPropertyReturn }));
|
|
119
|
+
default:
|
|
120
|
+
return (react_1.default.createElement(itwinui_react_1.InformationPanelWrapper, { className: 'property-menu-wrapper' },
|
|
121
|
+
react_1.default.createElement("div", { className: 'property-header' },
|
|
122
|
+
react_1.default.createElement(utils_1.WidgetHeader, { title: `${(_j = group.groupName) !== null && _j !== void 0 ? _j : ""}`, returnFn: goBack }),
|
|
123
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless', onClick: () => setIsInformationPanelOpen(true) },
|
|
124
|
+
react_1.default.createElement(DatabaseInfo_1.default, null))),
|
|
125
|
+
react_1.default.createElement("div", { className: 'property-menu-container' },
|
|
126
|
+
!hideGroupProps && (react_1.default.createElement("div", { className: 'property-table' },
|
|
127
|
+
react_1.default.createElement(GroupPropertyTable_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_k = group.id) !== null && _k !== void 0 ? _k : "", onGroupPropertyModify: onGroupPropertyModify, setSelectedGroupProperty: setSelectedGroupProperty, setGroupModifyView: setPropertyMenuView, selectedGroupProperty: selectedGroupProperty }))),
|
|
128
|
+
!hideCalculatedProps && (react_1.default.createElement("div", { className: 'property-table' },
|
|
129
|
+
react_1.default.createElement(CalculatedPropertyTable_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_l = group.id) !== null && _l !== void 0 ? _l : "", onCalculatedPropertyModify: onCalculatedPropertyModify, setSelectedCalculatedProperty: setSelectedCalculatedProperty, setGroupModifyView: setPropertyMenuView, selectedCalculatedProperty: selectedCalculatedProperty }))),
|
|
130
|
+
!hideCustomCalculationProps && (react_1.default.createElement("div", { className: 'property-table' },
|
|
131
|
+
react_1.default.createElement(CustomCalculationTable_1.default, { iModelId: iModelId, mappingId: mappingId, groupId: (_m = group.id) !== null && _m !== void 0 ? _m : "", onCustomCalculationModify: onCustomCalculationModify, setSelectedCustomCalculation: setSelectedCustomCalculation, setGroupModifyView: setPropertyMenuView, selectedCustomCalculation: selectedCustomCalculation })))),
|
|
132
|
+
react_1.default.createElement(itwinui_react_1.InformationPanel, { className: 'information-panel', isOpen: isInformationPanelOpen },
|
|
133
|
+
react_1.default.createElement(itwinui_react_1.InformationPanelHeader, { onClose: () => setIsInformationPanelOpen(false) },
|
|
134
|
+
react_1.default.createElement(itwinui_react_1.Text, { variant: 'subheading' }, `${(_o = group.groupName) !== null && _o !== void 0 ? _o : ""} Information`)),
|
|
135
|
+
react_1.default.createElement(itwinui_react_1.InformationPanelBody, null,
|
|
136
|
+
react_1.default.createElement("div", { className: 'information-body' },
|
|
137
|
+
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: 'Query', rows: 15, readOnly: true, defaultValue: (_p = group.query) !== null && _p !== void 0 ? _p : "" }))))));
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
exports.PropertyMenu = PropertyMenu;
|
|
141
|
+
//# sourceMappingURL=PropertyMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wEAA4D;AAC5D,oDAA+D;AAC/D,+CAAgE;AAEhE,mCAA0D;AAC1D,+CAMuB;AAEvB,+BAA6B;AAC7B,gFAAwD;AACxD,0FAAkE;AAElE,8EAAsD;AAItD,wFAAgE;AAChE,wDAS8B;AAC9B,yEAAqD;AAKrD,sFAA8D;AAC9D,wFAAgE;AAChE,oEAAoD;AAYpD,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,6DAAyC,CAAA;IACzC,mEAA+C,CAAA;IAC/C,uEAAmD,CAAA;IACnD,6EAAyD,CAAA;IACzD,qEAAiD,CAAA;IACjD,2EAAuD,CAAA;AACzD,CAAC,EARW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAQ3B;AAEM,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,GAAG,KAAK,EACtB,mBAAmB,GAAG,KAAK,EAC3B,0BAA0B,GAAG,KAAK,GACd,EAAE,EAAE;;IACxB,MAAM,gBAAgB,GAAG,uCAAyB,EAAsB,CAAC;IACzE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,gBAAQ,CACtD,gBAAgB,CAAC,OAAO,CACzB,CAAC;IACF,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,gBAAQ,CAEhE,SAAS,CAAC,CAAC;IACb,MAAM,CAAC,0BA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ACN,CACK,CAC3B,CAAC;KACL;AACH,CAAC,CAAC;AA7OW,QAAA,YAAY,gBA6OvB","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 { IModelConnection } from \"@itwin/core-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\n\nimport { fetchIdsFromQuery, WidgetHeader } from \"./utils\";\nimport {\n clearEmphasizedElements,\n manufactureKeys,\n visualizeElements,\n visualizeElementsByKeys,\n zoomToElements,\n} from \"./viewerUtils\";\nimport type { Group } from \"./Grouping\";\nimport \"./PropertyMenu.scss\";\nimport GroupPropertyAction from \"./GroupPropertyAction\";\nimport CalculatedPropertyAction from \"./CalculatedPropertyAction\";\nimport type { GroupProperty } from \"./GroupPropertyTable\";\nimport GroupPropertyTable from \"./GroupPropertyTable\";\nimport type {\n CalculatedProperty,\n} from \"./CalculatedPropertyTable\";\nimport CalculatedPropertyTable from \"./CalculatedPropertyTable\";\nimport {\n IconButton,\n InformationPanel,\n InformationPanelBody,\n InformationPanelHeader,\n InformationPanelWrapper,\n LabeledTextarea,\n ProgressRadial,\n Text,\n} from \"@itwin/itwinui-react\";\nimport DatabaseInfoIcon from \"../icons/DatabaseInfo\";\nimport type { CellProps } from \"react-table\";\nimport type {\n CustomCalculation,\n} from \"./CustomCalculationTable\";\nimport CustomCalculationTable from \"./CustomCalculationTable\";\nimport CustomCalculationAction from \"./CustomCalculationAction\";\nimport { KeySet } from \"@itwin/presentation-common\";\n\ninterface PropertyModifyProps {\n iModelId: string;\n mappingId: string;\n group: Group;\n goBack: () => Promise<void>;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport enum PropertyMenuView {\n DEFAULT = \"default\",\n ADD_GROUP_PROPERTY = \"add_group_property\",\n MODIFY_GROUP_PROPERTY = \"modify_group_property\",\n ADD_CALCULATED_PROPERTY = \"add_calculated_property\",\n MODIFY_CALCULATED_PROPERTY = \"modify_calculated_property\",\n ADD_CUSTOM_CALCULATION = \"add_custom_calculation\",\n MODIFY_CUSTOM_CALCULATION = \"modify_custom_calculation\",\n}\n\nexport const PropertyMenu = ({\n iModelId,\n mappingId,\n group,\n goBack,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyModifyProps) => {\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const [propertyMenuView, setPropertyMenuView] = useState<PropertyMenuView>(\n PropertyMenuView.DEFAULT,\n );\n const [selectedGroupProperty, setSelectedGroupProperty] = useState<\n GroupProperty | undefined\n >(undefined);\n const [selectedCalculatedProperty, setSelectedCalculatedProperty] = useState<\n CalculatedProperty | undefined\n >(undefined);\n const [selectedCustomCalculation, setSelectedCustomCalculation] = useState<\n CustomCalculation | undefined\n >(undefined);\n const [isInformationPanelOpen, setIsInformationPanelOpen] =\n useState<boolean>(false);\n const [resolvedHiliteIds, setResolvedHiliteIds] = useState<string[]>([]);\n const [keySet, setKeySet] = useState<KeySet>();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n\n useEffect(() => {\n const initialize = async () => {\n const ids = await fetchIdsFromQuery(group.query ?? \"\", iModelConnection);\n const keys = await manufactureKeys(ids, iModelConnection);\n setKeySet(keys);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n clearEmphasizedElements();\n const resolvedIds = await visualizeElementsByKeys(keys, \"red\");\n await zoomToElements(resolvedIds);\n setResolvedHiliteIds(resolvedIds);\n setIsLoading(false);\n };\n void initialize();\n }, [iModelConnection, group.query]);\n\n const onGroupPropertyModify = useCallback(\n (value: CellProps<GroupProperty>) => {\n setSelectedGroupProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_GROUP_PROPERTY);\n },\n [],\n );\n\n const onCalculatedPropertyModify = useCallback(\n (value: CellProps<CalculatedProperty>) => {\n setSelectedCalculatedProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CALCULATED_PROPERTY);\n },\n [],\n );\n\n const onCustomCalculationModify = useCallback(\n (value: CellProps<CustomCalculation>) => {\n setSelectedCustomCalculation(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CUSTOM_CALCULATION);\n },\n [],\n );\n\n const calculatedPropertyReturn = useCallback(async () => {\n visualizeElements(resolvedHiliteIds, \"red\");\n await zoomToElements(resolvedHiliteIds);\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n }, [resolvedHiliteIds]);\n\n if (isLoading) {\n return (\n <div className='loading-overlay'>\n <Text>Loading Group</Text>\n <ProgressRadial indeterminate />\n <Text>Please wait...</Text>\n </div>\n );\n }\n\n switch (propertyMenuView) {\n case PropertyMenuView.ADD_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n keySet={keySet ?? new KeySet()}\n returnFn={async () => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n }}\n />\n );\n case PropertyMenuView.MODIFY_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n keySet={keySet ?? new KeySet()}\n groupPropertyId={selectedGroupProperty?.id ?? \"\"}\n groupPropertyName={selectedGroupProperty?.propertyName ?? \"\"}\n returnFn={async () => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n }}\n />\n );\n case PropertyMenuView.ADD_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n property={selectedCalculatedProperty}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n returnFn={async () => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n }}\n />\n );\n case PropertyMenuView.MODIFY_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n customCalculation={selectedCustomCalculation}\n returnFn={calculatedPropertyReturn}\n />\n );\n default:\n return (\n <InformationPanelWrapper className='property-menu-wrapper'>\n <div className='property-header'>\n <WidgetHeader\n title={`${group.groupName ?? \"\"}`}\n returnFn={goBack}\n />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <DatabaseInfoIcon />\n </IconButton>\n </div>\n <div className='property-menu-container'>\n {!hideGroupProps && (\n <div className='property-table'>\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n onGroupPropertyModify={onGroupPropertyModify}\n setSelectedGroupProperty={setSelectedGroupProperty}\n setGroupModifyView={setPropertyMenuView}\n selectedGroupProperty={selectedGroupProperty}\n />\n </div>\n )}\n\n {!hideCalculatedProps && (\n <div className='property-table'>\n <CalculatedPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n onCalculatedPropertyModify={onCalculatedPropertyModify}\n setSelectedCalculatedProperty={setSelectedCalculatedProperty}\n setGroupModifyView={setPropertyMenuView}\n selectedCalculatedProperty={selectedCalculatedProperty}\n />\n </div>\n )}\n {!hideCustomCalculationProps && (\n <div className='property-table'>\n <CustomCalculationTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={group.id ?? \"\"}\n onCustomCalculationModify={onCustomCalculationModify}\n setSelectedCustomCalculation={setSelectedCustomCalculation}\n setGroupModifyView={setPropertyMenuView}\n selectedCustomCalculation={selectedCustomCalculation}\n />\n </div>\n )}\n </div>\n <InformationPanel\n className='information-panel'\n isOpen={isInformationPanelOpen}\n >\n <InformationPanelHeader\n onClose={() => setIsInformationPanelOpen(false)}\n >\n <Text variant='subheading'>{`${\n group.groupName ?? \"\"\n } Information`}</Text>\n </InformationPanelHeader>\n <InformationPanelBody>\n <div className='information-body'>\n <LabeledTextarea\n label='Query'\n rows={15}\n readOnly\n defaultValue={group.query ?? \"\"}\n />\n </div>\n </InformationPanelBody>\n </InformationPanel>\n </InformationPanelWrapper>\n );\n }\n};\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@import '~@itwin/itwinui-css/scss/variables';
|
|
6
|
+
|
|
7
|
+
.loading-overlay {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: $iui-baseline;
|
|
13
|
+
height: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.property-menu-wrapper {
|
|
17
|
+
height: 100%;
|
|
18
|
+
|
|
19
|
+
.information-panel {
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
width: 100%;
|
|
22
|
+
|
|
23
|
+
.information-body {
|
|
24
|
+
textarea {
|
|
25
|
+
resize: vertical;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.property-header {
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.property-menu-container {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
gap: $iui-baseline * 3;
|
|
39
|
+
.property-table {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: $iui-baseline;
|
|
43
|
+
button {
|
|
44
|
+
align-self: flex-start;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PresentationPropertyDataProvider } from "@itwin/presentation-components";
|
|
2
|
+
import type { PropertiesField } from "@itwin/presentation-common";
|
|
3
|
+
import type { Primitives, PropertyRecord } from "@itwin/appui-abstract";
|
|
4
|
+
import "core-js/features/string/virtual";
|
|
5
|
+
export interface Query {
|
|
6
|
+
classes: QueryClass[];
|
|
7
|
+
}
|
|
8
|
+
export interface QueryClass {
|
|
9
|
+
className: string;
|
|
10
|
+
properties: QueryProperty[];
|
|
11
|
+
isAspect: boolean;
|
|
12
|
+
isRelational?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface QueryProperty {
|
|
15
|
+
name: string;
|
|
16
|
+
value: Primitives.Value;
|
|
17
|
+
needsQuote: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class QueryBuilder {
|
|
20
|
+
static readonly MULTI_ASPECT_PRIMARY_CLASS = "BisCore:ElementOwnsMultiAspects";
|
|
21
|
+
static readonly UNIQUE_ASPECT_PRIMARY_CLASS = "BisCore:ElementOwnsUniqueAspect";
|
|
22
|
+
static readonly DEFAULT_DOUBLE_PRECISION = 4;
|
|
23
|
+
dataProvider: PresentationPropertyDataProvider | undefined;
|
|
24
|
+
query: Query | undefined;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
constructor(provider: PresentationPropertyDataProvider | undefined);
|
|
29
|
+
addProperty(prop: PropertyRecord): Promise<void>;
|
|
30
|
+
private _needsQuote;
|
|
31
|
+
addRelatedProperty(propertyField: PropertiesField, propertyName: string, propertyValue: Primitives.Value, isAspect: boolean): void;
|
|
32
|
+
addPropertyToQuery(className: string, propertyName: string, propertyValue: Primitives.Value, isAspect: boolean, needsQuote: boolean, isRelational?: boolean): void;
|
|
33
|
+
removeProperty(prop: PropertyRecord): Promise<void>;
|
|
34
|
+
removeRelatedProperty(propertyField: PropertiesField, propertyName: string): void;
|
|
35
|
+
removePropertyFromQuery(className: string, propertyName: string): void;
|
|
36
|
+
buildQueryString(): string;
|
|
37
|
+
private _isFloat;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=QueryBuilder.d.ts.map
|