@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,84 @@
|
|
|
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
|
+
.border-div {
|
|
8
|
+
border-bottom: 1px solid var(--iui-color-background-4);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.mapping-row {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: 1fr 1fr;
|
|
14
|
+
grid-column-gap: $iui-xl;
|
|
15
|
+
justify-items: stretch;
|
|
16
|
+
align-items: center;
|
|
17
|
+
padding: $iui-baseline $iui-m $iui-baseline $iui-m;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.import-progress-container {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
height: 66vh;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
|
|
26
|
+
.import-progress-bar {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
flex-grow: 1;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: $iui-baseline * 2;
|
|
33
|
+
|
|
34
|
+
.import-progress-bar-description {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
> .iui-progress-indicator-linear {
|
|
41
|
+
width: 50%;
|
|
42
|
+
|
|
43
|
+
span:first-of-type {
|
|
44
|
+
display: flex;
|
|
45
|
+
width: 80%;
|
|
46
|
+
gap: $iui-xs;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.finish-bar {
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: right;
|
|
54
|
+
padding: $iui-baseline * 2 $iui-m $iui-baseline;
|
|
55
|
+
gap: $iui-s;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rename-confirm-container {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
height: 66vh;
|
|
63
|
+
|
|
64
|
+
.mapping-rename-container {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
flex-grow: 1;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
|
|
70
|
+
.mapping-row-header-container {
|
|
71
|
+
position: sticky;
|
|
72
|
+
top: 0;
|
|
73
|
+
background-color: var(--iui-color-background-3);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.mapping-row-body {
|
|
77
|
+
overflow-y: auto;
|
|
78
|
+
|
|
79
|
+
.mapping-row-container {
|
|
80
|
+
background-color: var(--iui-color-background-2);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./CalculatedPropertyAction.scss";
|
|
3
|
+
import type { CustomCalculation } from "./CustomCalculationTable";
|
|
4
|
+
import "./CustomCalculationAction.scss";
|
|
5
|
+
interface CalculatedPropertyActionProps {
|
|
6
|
+
iModelId: string;
|
|
7
|
+
mappingId: string;
|
|
8
|
+
groupId: string;
|
|
9
|
+
customCalculation?: CustomCalculation;
|
|
10
|
+
returnFn: () => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
declare const CustomCalculationAction: ({ iModelId, mappingId, groupId, customCalculation, returnFn, }: CalculatedPropertyActionProps) => JSX.Element;
|
|
13
|
+
export default CustomCalculationAction;
|
|
14
|
+
//# sourceMappingURL=CustomCalculationAction.d.ts.map
|
|
@@ -0,0 +1,103 @@
|
|
|
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("./CalculatedPropertyAction.scss");
|
|
36
|
+
require("./CustomCalculationAction.scss");
|
|
37
|
+
const GroupPropertyAction_1 = require("./GroupPropertyAction");
|
|
38
|
+
const CustomCalculationAction = ({ iModelId, mappingId, groupId, customCalculation, returnFn, }) => {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
|
+
const [propertyName, setPropertyName] = react_1.useState((_a = customCalculation === null || customCalculation === void 0 ? void 0 : customCalculation.propertyName) !== null && _a !== void 0 ? _a : "");
|
|
41
|
+
const [formula, setFormula] = react_1.useState((_b = customCalculation === null || customCalculation === void 0 ? void 0 : customCalculation.formula) !== null && _b !== void 0 ? _b : "");
|
|
42
|
+
const [quantityType, setQuantityType] = react_1.useState((_c = customCalculation === null || customCalculation === void 0 ? void 0 : customCalculation.quantityType) !== null && _c !== void 0 ? _c : "Undefined");
|
|
43
|
+
const [isLoading, setIsLoading] = react_1.useState(false);
|
|
44
|
+
const [formulaErrorMessage, setFormulaErrorMessage] = react_1.useState("");
|
|
45
|
+
const [validator, showValidationMessage] = useValidator_1.default();
|
|
46
|
+
const onSave = async () => {
|
|
47
|
+
var _a;
|
|
48
|
+
if (!validator.allValid()) {
|
|
49
|
+
showValidationMessage(true);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
const newCustomCalculation = {
|
|
55
|
+
propertyName,
|
|
56
|
+
formula,
|
|
57
|
+
quantityType,
|
|
58
|
+
};
|
|
59
|
+
customCalculation
|
|
60
|
+
? await reportingClient_1.reportingClientApi.updateCustomCalculation(iModelId, mappingId, groupId, (_a = customCalculation.id) !== null && _a !== void 0 ? _a : "", newCustomCalculation)
|
|
61
|
+
: await reportingClient_1.reportingClientApi.createCustomCalculation(iModelId, mappingId, groupId, newCustomCalculation);
|
|
62
|
+
await returnFn();
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
// error instanceof Response refuses to be true when it should be.
|
|
67
|
+
if (error.status === 422) {
|
|
68
|
+
error = error;
|
|
69
|
+
const erroredResponse = await error.json();
|
|
70
|
+
if (erroredResponse.error.code === "InvalidInsightsRequest" &&
|
|
71
|
+
erroredResponse.error.target === "formula") {
|
|
72
|
+
setFormulaErrorMessage(erroredResponse.error.message);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
setIsLoading(false);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
|
+
react_1.default.createElement(utils_1.WidgetHeader, { title: customCalculation
|
|
80
|
+
? `${(_d = customCalculation === null || customCalculation === void 0 ? void 0 : customCalculation.propertyName) !== null && _d !== void 0 ? _d : ""}`
|
|
81
|
+
: "Create Custom Calculation", returnFn: returnFn }),
|
|
82
|
+
react_1.default.createElement("div", { className: 'custom-calculation-action-container' },
|
|
83
|
+
react_1.default.createElement(itwinui_react_1.Fieldset, { legend: 'Custom Calculation Details', className: 'details-form' },
|
|
84
|
+
react_1.default.createElement(itwinui_react_1.Small, { className: 'field-legend' }, "Asterisk * indicates mandatory fields."),
|
|
85
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { value: propertyName, required: true, name: 'name', label: 'Name', disabled: isLoading, onChange: (event) => {
|
|
86
|
+
setPropertyName(event.target.value);
|
|
87
|
+
validator.showMessageFor("name");
|
|
88
|
+
}, message: validator.message("name", propertyName, useValidator_1.NAME_REQUIREMENTS), status: validator.message("name", propertyName, useValidator_1.NAME_REQUIREMENTS)
|
|
89
|
+
? "negative"
|
|
90
|
+
: undefined, onBlur: () => {
|
|
91
|
+
validator.showMessageFor("name");
|
|
92
|
+
}, onBlurCapture: (event) => {
|
|
93
|
+
setPropertyName(event.target.value);
|
|
94
|
+
validator.showMessageFor("name");
|
|
95
|
+
} }),
|
|
96
|
+
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { value: formula, required: true, name: 'formula', label: 'Formula', disabled: isLoading, onChange: (event) => {
|
|
97
|
+
setFormula(event.target.value);
|
|
98
|
+
}, message: formulaErrorMessage, status: formulaErrorMessage ? "negative" : undefined }),
|
|
99
|
+
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: 'Quantity Type', disabled: isLoading, options: GroupPropertyAction_1.quantityTypesSelectionOptions, value: quantityType, onChange: setQuantityType, onShow: () => { }, onHide: () => { } }))),
|
|
100
|
+
react_1.default.createElement(ActionPanel_1.default, { onSave: onSave, onCancel: returnFn, disabled: !(formula && propertyName), isLoading: isLoading })));
|
|
101
|
+
};
|
|
102
|
+
exports.default = CustomCalculationAction;
|
|
103
|
+
//# sourceMappingURL=CustomCalculationAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomCalculationAction.js","sourceRoot":"","sources":["../../../../src/widget/components/CustomCalculationAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;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jB,CACO,CACP;QACN,8BAAC,qBAAW,IACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,CAAC,OAAO,IAAI,YAAY,CAAC,EACpC,SAAS,EAAE,SAAS,GACpB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,uBAAuB,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 Fieldset,\n LabeledInput,\n LabeledSelect,\n LabeledTextarea,\n Small,\n} from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport { reportingClientApi } from \"../../api/reportingClient\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { WidgetHeader } from \"./utils\";\nimport \"./CalculatedPropertyAction.scss\";\nimport type { CustomCalculation } from \"./CustomCalculationTable\";\nimport type { CustomCalculationCreateReportingAPI } from \"../../api/generated/api\";\nimport \"./CustomCalculationAction.scss\";\nimport { quantityTypesSelectionOptions } from \"./GroupPropertyAction\";\n\ninterface CalculatedPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n customCalculation?: CustomCalculation;\n returnFn: () => Promise<void>;\n}\n\nconst CustomCalculationAction = ({\n iModelId,\n mappingId,\n groupId,\n customCalculation,\n returnFn,\n}: CalculatedPropertyActionProps) => {\n const [propertyName, setPropertyName] = useState<string>(\n customCalculation?.propertyName ?? \"\",\n );\n const [formula, setFormula] = useState<string>(\n customCalculation?.formula ?? \"\",\n );\n const [quantityType, setQuantityType] = useState<string>(customCalculation?.quantityType ?? \"Undefined\");\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [formulaErrorMessage, setFormulaErrorMessage] = useState<string>(\"\");\n const [validator, showValidationMessage] = useValidator();\n\n const onSave = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n\n const newCustomCalculation: CustomCalculationCreateReportingAPI = {\n propertyName,\n formula,\n quantityType,\n };\n\n customCalculation\n ? await reportingClientApi.updateCustomCalculation(\n iModelId,\n mappingId,\n groupId,\n customCalculation.id ?? \"\",\n newCustomCalculation,\n )\n : await reportingClientApi.createCustomCalculation(\n iModelId,\n mappingId,\n groupId,\n newCustomCalculation,\n );\n await returnFn();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n // error instanceof Response refuses to be true when it should be.\n if (error.status === 422) {\n error = error as Response;\n const erroredResponse = await error.json();\n if (\n erroredResponse.error.code === \"InvalidInsightsRequest\" &&\n erroredResponse.error.target === \"formula\"\n ) {\n setFormulaErrorMessage(erroredResponse.error.message);\n }\n }\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <WidgetHeader\n title={\n customCalculation\n ? `${customCalculation?.propertyName ?? \"\"}`\n : \"Create Custom Calculation\"\n }\n returnFn={returnFn}\n />\n <div className='custom-calculation-action-container'>\n <Fieldset legend='Custom Calculation Details' className='details-form'>\n <Small className='field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n value={propertyName}\n required\n name='name'\n label='Name'\n disabled={isLoading}\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n message={validator.message(\"name\", propertyName, NAME_REQUIREMENTS)}\n status={\n validator.message(\"name\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"name\");\n }}\n onBlurCapture={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"name\");\n }}\n />\n <LabeledTextarea\n value={formula}\n required\n name='formula'\n label='Formula'\n disabled={isLoading}\n onChange={(event) => {\n setFormula(event.target.value);\n }}\n message={formulaErrorMessage}\n status={formulaErrorMessage ? \"negative\" : undefined}\n />\n <LabeledSelect<string>\n label='Quantity Type'\n disabled={isLoading}\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={returnFn}\n disabled={!(formula && propertyName)}\n isLoading={isLoading}\n />\n </>\n );\n};\n\nexport default CustomCalculationAction;\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
|
+
.custom-calculation-action-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,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CustomCalculationReportingAPI } from "../../api/generated/api";
|
|
3
|
+
import type { CreateTypeFromInterface } from "../utils";
|
|
4
|
+
import { PropertyMenuView } from "./PropertyMenu";
|
|
5
|
+
import type { CellProps } from "react-table";
|
|
6
|
+
export declare type CustomCalculation = CreateTypeFromInterface<CustomCalculationReportingAPI>;
|
|
7
|
+
interface CustomCalculationTableProps {
|
|
8
|
+
iModelId: string;
|
|
9
|
+
mappingId: string;
|
|
10
|
+
groupId: string;
|
|
11
|
+
setSelectedCustomCalculation: React.Dispatch<React.SetStateAction<CreateTypeFromInterface<CustomCalculationReportingAPI> | undefined>>;
|
|
12
|
+
setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;
|
|
13
|
+
onCustomCalculationModify: (value: CellProps<CustomCalculation>) => void;
|
|
14
|
+
selectedCustomCalculation?: CustomCalculation;
|
|
15
|
+
}
|
|
16
|
+
declare const CustomCalculationTable: ({ iModelId, mappingId, groupId, setSelectedCustomCalculation, setGroupModifyView, onCustomCalculationModify, selectedCustomCalculation, }: CustomCalculationTableProps) => JSX.Element;
|
|
17
|
+
export default CustomCalculationTable;
|
|
18
|
+
//# sourceMappingURL=CustomCalculationTable.d.ts.map
|
|
@@ -0,0 +1,114 @@
|
|
|
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_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
30
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const reportingClient_1 = require("../../api/reportingClient");
|
|
33
|
+
const PropertyMenu_1 = require("./PropertyMenu");
|
|
34
|
+
const DeleteModal_1 = __importDefault(require("./DeleteModal"));
|
|
35
|
+
const fetchCustomCalculations = async (setCustomCalculations, iModelId, mappingId, groupId, setIsLoading) => {
|
|
36
|
+
var _a;
|
|
37
|
+
try {
|
|
38
|
+
setIsLoading(true);
|
|
39
|
+
const customCalculations = await reportingClient_1.reportingClientApi.getCustomCalculations(iModelId, mappingId, groupId);
|
|
40
|
+
setCustomCalculations((_a = customCalculations.customCalculations) !== null && _a !== void 0 ? _a : []);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// TODO Toaster
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setIsLoading(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const useFetchCustomCalculations = (iModelId, mappingId, groupId, setIsLoading) => {
|
|
50
|
+
const [CustomCalculations, setCustomCalculations] = react_1.useState([]);
|
|
51
|
+
react_1.useEffect(() => {
|
|
52
|
+
void fetchCustomCalculations(setCustomCalculations, iModelId, mappingId, groupId, setIsLoading);
|
|
53
|
+
}, [groupId, iModelId, mappingId, setIsLoading]);
|
|
54
|
+
return [CustomCalculations, setCustomCalculations];
|
|
55
|
+
};
|
|
56
|
+
const CustomCalculationTable = ({ iModelId, mappingId, groupId, setSelectedCustomCalculation, setGroupModifyView, onCustomCalculationModify, selectedCustomCalculation, }) => {
|
|
57
|
+
var _a;
|
|
58
|
+
const [isLoading, setIsLoading] = react_1.useState(true);
|
|
59
|
+
const [customCalculations, setCustomCalculations] = useFetchCustomCalculations(iModelId, mappingId, groupId, setIsLoading);
|
|
60
|
+
const [showCustomCalculationDeleteModal, setShowCustomCalculationDeleteModal,] = react_1.useState(false);
|
|
61
|
+
const refresh = react_1.useCallback(async () => {
|
|
62
|
+
setCustomCalculations([]);
|
|
63
|
+
await fetchCustomCalculations(setCustomCalculations, iModelId, mappingId, groupId, setIsLoading);
|
|
64
|
+
}, [groupId, iModelId, mappingId, setCustomCalculations]);
|
|
65
|
+
const CustomCalculationsColumns = react_1.useMemo(() => [
|
|
66
|
+
{
|
|
67
|
+
Header: "Table",
|
|
68
|
+
columns: [
|
|
69
|
+
{
|
|
70
|
+
id: "propertyName",
|
|
71
|
+
Header: "Calculated Property",
|
|
72
|
+
accessor: "propertyName",
|
|
73
|
+
Cell: (value) => (react_1.default.createElement("div", { className: 'iui-anchor', onClick: () => onCustomCalculationModify(value) }, value.row.original.propertyName)),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "formula",
|
|
77
|
+
Header: "Formula",
|
|
78
|
+
accessor: "formula",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "dropdown",
|
|
82
|
+
Header: "",
|
|
83
|
+
width: 80,
|
|
84
|
+
Cell: (value) => {
|
|
85
|
+
return (react_1.default.createElement(itwinui_react_1.DropdownMenu, { menuItems: (close) => [
|
|
86
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 0, onClick: () => onCustomCalculationModify(value), icon: react_1.default.createElement(itwinui_icons_react_1.SvgEdit, null) }, "Modify"),
|
|
87
|
+
react_1.default.createElement(itwinui_react_1.MenuItem, { key: 1, onClick: () => {
|
|
88
|
+
setSelectedCustomCalculation(value.row.original);
|
|
89
|
+
setShowCustomCalculationDeleteModal(true);
|
|
90
|
+
close();
|
|
91
|
+
}, icon: react_1.default.createElement(itwinui_icons_react_1.SvgDelete, null) }, "Remove"),
|
|
92
|
+
] },
|
|
93
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless' },
|
|
94
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgMore, { style: {
|
|
95
|
+
width: "16px",
|
|
96
|
+
height: "16px",
|
|
97
|
+
} }))));
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
], [onCustomCalculationModify, setSelectedCustomCalculation]);
|
|
103
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
104
|
+
react_1.default.createElement(itwinui_react_1.Button, { startIcon: react_1.default.createElement(itwinui_icons_react_1.SvgAdd, null), styleType: 'high-visibility', onClick: () => {
|
|
105
|
+
setGroupModifyView(PropertyMenu_1.PropertyMenuView.ADD_CUSTOM_CALCULATION);
|
|
106
|
+
} }, "Add Custom Calculation"),
|
|
107
|
+
react_1.default.createElement(itwinui_react_1.Table, { data: customCalculations, density: 'extra-condensed', columns: CustomCalculationsColumns, emptyTableContent: 'No Custom Calculations', isSortable: true, isLoading: isLoading }),
|
|
108
|
+
react_1.default.createElement(DeleteModal_1.default, { entityName: (_a = selectedCustomCalculation === null || selectedCustomCalculation === void 0 ? void 0 : selectedCustomCalculation.propertyName) !== null && _a !== void 0 ? _a : "", show: showCustomCalculationDeleteModal, setShow: setShowCustomCalculationDeleteModal, onDelete: async () => {
|
|
109
|
+
var _a;
|
|
110
|
+
await reportingClient_1.reportingClientApi.deleteCustomCalculation(iModelId, mappingId, groupId, (_a = selectedCustomCalculation === null || selectedCustomCalculation === void 0 ? void 0 : selectedCustomCalculation.id) !== null && _a !== void 0 ? _a : "");
|
|
111
|
+
}, refresh: refresh })));
|
|
112
|
+
};
|
|
113
|
+
exports.default = CustomCalculationTable;
|
|
114
|
+
//# sourceMappingURL=CustomCalculationTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomCalculationTable.js","sourceRoot":"","sources":["../../../../src/widget/components/CustomCalculationTable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,oEAKoC;AACpC,wDAM8B;AAC9B,+CAAyE;AAEzE,+DAA+D;AAE/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,EAAE,mCAAI,EAAE,CACpC,CAAC;YACJ,CAAC,EACD,OAAO,EAAE,OAAO,GAChB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,sBAAsB,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 SvgAdd,\n SvgDelete,\n SvgEdit,\n SvgMore,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n DropdownMenu,\n IconButton,\n MenuItem,\n Table,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { CustomCalculationReportingAPI } from \"../../api/generated/api\";\nimport { reportingClientApi } from \"../../api/reportingClient\";\nimport type { CreateTypeFromInterface } from \"../utils\";\nimport { PropertyMenuView } from \"./PropertyMenu\";\nimport type { CellProps } from \"react-table\";\nimport DeleteModal from \"./DeleteModal\";\n\nexport type CustomCalculation =\n CreateTypeFromInterface<CustomCalculationReportingAPI>;\n\nconst fetchCustomCalculations = async (\n setCustomCalculations: React.Dispatch<\n React.SetStateAction<CustomCalculation[]>\n >,\n iModelId: string,\n mappingId: string,\n groupId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n) => {\n try {\n setIsLoading(true);\n const customCalculations = await reportingClientApi.getCustomCalculations(\n iModelId,\n mappingId,\n groupId,\n );\n setCustomCalculations(customCalculations.customCalculations ?? []);\n } catch {\n // TODO Toaster\n } finally {\n setIsLoading(false);\n }\n};\n\nconst useFetchCustomCalculations = (\n iModelId: string,\n mappingId: string,\n groupId: string,\n setIsLoading: React.Dispatch<React.SetStateAction<boolean>>,\n): [\n CustomCalculation[],\n React.Dispatch<React.SetStateAction<CustomCalculation[]>>,\n] => {\n const [CustomCalculations, setCustomCalculations] = useState<\n CustomCalculation[]\n >([]);\n\n useEffect(() => {\n void fetchCustomCalculations(\n setCustomCalculations,\n iModelId,\n mappingId,\n groupId,\n setIsLoading,\n );\n }, [groupId, iModelId, mappingId, setIsLoading]);\n\n return [CustomCalculations, setCustomCalculations];\n};\n\ninterface CustomCalculationTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n\n setSelectedCustomCalculation: React.Dispatch<\n React.SetStateAction<\n CreateTypeFromInterface<CustomCalculationReportingAPI> | undefined\n >\n >;\n setGroupModifyView: React.Dispatch<React.SetStateAction<PropertyMenuView>>;\n onCustomCalculationModify: (value: CellProps<CustomCalculation>) => void;\n selectedCustomCalculation?: CustomCalculation;\n}\n\nconst CustomCalculationTable = ({\n iModelId,\n mappingId,\n groupId,\n setSelectedCustomCalculation,\n setGroupModifyView,\n onCustomCalculationModify,\n selectedCustomCalculation,\n}: CustomCalculationTableProps) => {\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [customCalculations, setCustomCalculations] =\n useFetchCustomCalculations(iModelId, mappingId, groupId, setIsLoading);\n const [\n showCustomCalculationDeleteModal,\n setShowCustomCalculationDeleteModal,\n ] = useState<boolean>(false);\n\n const refresh = useCallback(async () => {\n setCustomCalculations([]);\n await fetchCustomCalculations(\n setCustomCalculations,\n iModelId,\n mappingId,\n groupId,\n setIsLoading,\n );\n }, [groupId, iModelId, mappingId, setCustomCalculations]);\n\n const CustomCalculationsColumns = useMemo(\n () => [\n {\n Header: \"Table\",\n columns: [\n {\n id: \"propertyName\",\n Header: \"Calculated Property\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<CustomCalculation>) => (\n <div\n className='iui-anchor'\n onClick={() => onCustomCalculationModify(value)}\n >\n {value.row.original.propertyName}\n </div>\n ),\n },\n {\n id: \"formula\",\n Header: \"Formula\",\n accessor: \"formula\",\n },\n {\n id: \"dropdown\",\n Header: \"\",\n width: 80,\n Cell: (value: CellProps<CustomCalculation>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) => [\n <MenuItem\n key={0}\n onClick={() => onCustomCalculationModify(value)}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n <MenuItem\n key={1}\n onClick={() => {\n setSelectedCustomCalculation(value.row.original);\n setShowCustomCalculationDeleteModal(true);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ]}\n >\n <IconButton styleType='borderless'>\n <SvgMore\n style={{\n width: \"16px\",\n height: \"16px\",\n }}\n />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n },\n ],\n [onCustomCalculationModify, setSelectedCustomCalculation],\n );\n\n return (\n <>\n <Button\n startIcon={<SvgAdd />}\n styleType='high-visibility'\n onClick={() => {\n setGroupModifyView(PropertyMenuView.ADD_CUSTOM_CALCULATION);\n }}\n >\n Add Custom Calculation\n </Button>\n <Table<CustomCalculation>\n data={customCalculations}\n density='extra-condensed'\n columns={CustomCalculationsColumns}\n emptyTableContent='No Custom Calculations'\n isSortable\n isLoading={isLoading}\n />\n\n <DeleteModal\n entityName={selectedCustomCalculation?.propertyName ?? \"\"}\n show={showCustomCalculationDeleteModal}\n setShow={setShowCustomCalculationDeleteModal}\n onDelete={async () => {\n await reportingClientApi.deleteCustomCalculation(\n iModelId,\n mappingId,\n groupId,\n selectedCustomCalculation?.id ?? \"\",\n );\n }}\n refresh={refresh}\n />\n </>\n );\n};\n\nexport default CustomCalculationTable;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./DeleteModal.scss";
|
|
3
|
+
export interface DeleteModalProps {
|
|
4
|
+
entityName: string;
|
|
5
|
+
show: boolean;
|
|
6
|
+
setShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
|
+
onDelete: () => Promise<void>;
|
|
8
|
+
refresh: () => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const DeleteModal: ({ entityName, show, setShow, onDelete, refresh, }: DeleteModalProps) => JSX.Element;
|
|
11
|
+
export default DeleteModal;
|
|
12
|
+
//# sourceMappingURL=DeleteModal.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.DeleteModal = void 0;
|
|
23
|
+
/*---------------------------------------------------------------------------------------------
|
|
24
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
25
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
26
|
+
*--------------------------------------------------------------------------------------------*/
|
|
27
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
require("./DeleteModal.scss");
|
|
30
|
+
const DeleteModal = ({ entityName, show, setShow, onDelete, refresh, }) => {
|
|
31
|
+
const [isLoading, setIsLoading] = react_1.useState(false);
|
|
32
|
+
const deleteCallback = async () => {
|
|
33
|
+
try {
|
|
34
|
+
setIsLoading(true);
|
|
35
|
+
await onDelete();
|
|
36
|
+
setShow(false);
|
|
37
|
+
await refresh();
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
// toaster.negative(`${err.response?.data ?? 'Failed to revoke key.'}`, {
|
|
41
|
+
// hasCloseButton: true,
|
|
42
|
+
// });
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
setIsLoading(false);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
49
|
+
react_1.default.createElement(itwinui_react_1.Modal, { title: 'Confirm', modalRootId: 'grouping-mapping-widget', isOpen: show, isDismissible: !isLoading, onClose: () => {
|
|
50
|
+
setShow(false);
|
|
51
|
+
} },
|
|
52
|
+
react_1.default.createElement("div", { className: "delete-modal-body-text" },
|
|
53
|
+
react_1.default.createElement(itwinui_react_1.Leading, null, "Are you sure you want to delete"),
|
|
54
|
+
react_1.default.createElement("strong", null, react_1.default.createElement(itwinui_react_1.MiddleTextTruncation, { text: `${entityName}?` }))),
|
|
55
|
+
react_1.default.createElement(itwinui_react_1.ModalButtonBar, null,
|
|
56
|
+
isLoading ? (react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'high-visibility' },
|
|
57
|
+
react_1.default.createElement(itwinui_react_1.ProgressRadial, { size: "small", indeterminate: true }))) : (react_1.default.createElement(itwinui_react_1.Button, { styleType: 'high-visibility', onClick: deleteCallback }, "Delete")),
|
|
58
|
+
react_1.default.createElement(itwinui_react_1.Button, { styleType: 'default', onClick: () => {
|
|
59
|
+
setShow(false);
|
|
60
|
+
}, disabled: isLoading }, "Cancel")))));
|
|
61
|
+
};
|
|
62
|
+
exports.DeleteModal = DeleteModal;
|
|
63
|
+
exports.default = exports.DeleteModal;
|
|
64
|
+
//# sourceMappingURL=DeleteModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteModal.js","sourceRoot":"","sources":["../../../../src/widget/components/DeleteModal.tsx"],"names":[],"mappings":";;;;;;;;;;;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BAAC,sBAAM,IACL,SAAS,EAAC,SAAS,EACnB,OAAO,EAAE,GAAG,EAAE;wBACZ,OAAO,CAAC,KAAK,CAAC,CAAC;oBACjB,CAAC,EACD,QAAQ,EAAE,SAAS,aAGZ,CACM,CACX,CACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,WAAW,eAkEtB;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 IconButton,\n Leading,\n MiddleTextTruncation,\n Modal,\n ModalButtonBar,\n ProgressRadial,\n} from \"@itwin/itwinui-react\";\nimport React, { useState } from \"react\";\nimport \"./DeleteModal.scss\";\n\nexport interface DeleteModalProps {\n entityName: string;\n show: boolean;\n setShow: React.Dispatch<React.SetStateAction<boolean>>;\n onDelete: () => Promise<void>;\n refresh: () => Promise<void>;\n}\n\nexport const DeleteModal = ({\n entityName,\n show,\n setShow,\n onDelete,\n refresh,\n}: DeleteModalProps) => {\n const [isLoading, setIsLoading] = useState<boolean>(false);\n\n const deleteCallback = async () => {\n try {\n setIsLoading(true);\n await onDelete();\n setShow(false);\n await refresh();\n } catch (err) {\n // toaster.negative(`${err.response?.data ?? 'Failed to revoke key.'}`, {\n // hasCloseButton: true,\n // });\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <>\n <Modal\n title='Confirm'\n modalRootId='grouping-mapping-widget'\n isOpen={show}\n isDismissible={!isLoading}\n onClose={() => {\n setShow(false);\n }}\n >\n <div className=\"delete-modal-body-text\">\n <Leading>\n Are you sure you want to delete\n </Leading>\n <strong>\n {<MiddleTextTruncation text={`${entityName}?`} />}\n </strong>\n </div>\n <ModalButtonBar>\n {isLoading ? (\n <IconButton styleType='high-visibility'>\n <ProgressRadial size=\"small\" indeterminate />\n </IconButton>\n ) : (\n <Button styleType='high-visibility' onClick={deleteCallback}>\n Delete\n </Button>\n )}\n <Button\n styleType='default'\n onClick={() => {\n setShow(false);\n }}\n disabled={isLoading}\n >\n Cancel\n </Button>\n </ModalButtonBar>\n </Modal>\n </>\n );\n};\n\nexport default DeleteModal;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
.delete-modal-body-text {
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 4px;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
> strong {
|
|
10
|
+
min-width: 0px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Group } from "./Grouping";
|
|
3
|
+
import "./GroupAction.scss";
|
|
4
|
+
interface GroupActionProps {
|
|
5
|
+
iModelId: string;
|
|
6
|
+
mappingId: string;
|
|
7
|
+
group?: Group;
|
|
8
|
+
goBack: () => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
declare const GroupAction: ({ iModelId, mappingId, group, goBack, }: GroupActionProps) => JSX.Element;
|
|
11
|
+
export default GroupAction;
|
|
12
|
+
//# sourceMappingURL=GroupAction.d.ts.map
|