@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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchIdsFromQuery = exports.handleInputChange = exports.WidgetHeader = exports.onSelectionChanged = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
12
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
|
+
require("./utils.scss");
|
|
14
|
+
const react_1 = __importDefault(require("react"));
|
|
15
|
+
const core_common_1 = require("@itwin/core-common");
|
|
16
|
+
const onSelectionChanged = (evt, selectionProvider) => {
|
|
17
|
+
/* eslint-disable no-console */
|
|
18
|
+
const selection = selectionProvider.getSelection(evt.imodel, evt.level);
|
|
19
|
+
if (selection.isEmpty) {
|
|
20
|
+
console.log("========== Selection cleared ==========");
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.log("========== Selection change ===========");
|
|
24
|
+
if (selection.instanceKeys.size !== 0) {
|
|
25
|
+
// log all selected ECInstance ids grouped by ECClass name
|
|
26
|
+
console.log("ECInstances:");
|
|
27
|
+
selection.instanceKeys.forEach((ids, ecclass) => {
|
|
28
|
+
console.log(`${ecclass}: [${[...ids].join(",")}]`);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (selection.nodeKeys.size !== 0) {
|
|
32
|
+
// log all selected node keys
|
|
33
|
+
console.log("Nodes:");
|
|
34
|
+
selection.nodeKeys.forEach((key) => console.log(JSON.stringify(key)));
|
|
35
|
+
}
|
|
36
|
+
console.log("=======================================");
|
|
37
|
+
}
|
|
38
|
+
/* eslint-enable no-console */
|
|
39
|
+
};
|
|
40
|
+
exports.onSelectionChanged = onSelectionChanged;
|
|
41
|
+
const WidgetHeader = ({ title, disabled = false, returnFn, }) => {
|
|
42
|
+
return (react_1.default.createElement("div", { className: 'widget-header-container' },
|
|
43
|
+
returnFn && (react_1.default.createElement("div", { className: disabled ? "chevron-disabled" : "chevron", onClick: disabled ? undefined : returnFn },
|
|
44
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgChevronLeft, null))),
|
|
45
|
+
react_1.default.createElement(itwinui_react_1.Text, { className: 'title', variant: 'title' }, title)));
|
|
46
|
+
};
|
|
47
|
+
exports.WidgetHeader = WidgetHeader;
|
|
48
|
+
const handleInputChange = (e, values, setValues) => {
|
|
49
|
+
const { name, value } = e.target;
|
|
50
|
+
setValues({
|
|
51
|
+
...values,
|
|
52
|
+
[name]: value,
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
exports.handleInputChange = handleInputChange;
|
|
56
|
+
const fetchIdsFromQuery = async (query, iModelConnection) => {
|
|
57
|
+
if (query === "") {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
const ids = [];
|
|
61
|
+
const rowIterator = iModelConnection.query(query, undefined, {
|
|
62
|
+
rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames,
|
|
63
|
+
});
|
|
64
|
+
while (true) {
|
|
65
|
+
const { done, value } = await rowIterator.next();
|
|
66
|
+
if (done) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
if (Object.keys(value).includes("id")) {
|
|
70
|
+
// eslint-disable-next-line dot-notation
|
|
71
|
+
ids.push(value.id);
|
|
72
|
+
}
|
|
73
|
+
else if (Object.keys(value).includes("element.id")) {
|
|
74
|
+
ids.push(value["element.id"]);
|
|
75
|
+
}
|
|
76
|
+
// eslint-disable-next-line dot-notation
|
|
77
|
+
ids.push(value.id);
|
|
78
|
+
}
|
|
79
|
+
return ids;
|
|
80
|
+
};
|
|
81
|
+
exports.fetchIdsFromQuery = fetchIdsFromQuery;
|
|
82
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/widget/components/utils.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,oEAA4D;AAC5D,wDAA4C;AAC5C,wBAAsB;AACtB,kDAA0B;AAM1B,oDAAoD;AAE7C,MAAM,kBAAkB,GAAG,CAChC,GAA6B,EAC7B,iBAAqC,EACrC,EAAE;IACF,+BAA+B;IAC/B,MAAM,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IACxE,IAAI,SAAS,CAAC,OAAO,EAAE;QACr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K,CAAC,EAAE,CAAC,CAAC;KACpB;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AA1BW,QAAA,iBAAiB,qBA0B5B","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 { SvgChevronLeft } from \"@itwin/itwinui-icons-react\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport \"./utils.scss\";\nimport React from \"react\";\nimport type {\n ISelectionProvider,\n SelectionChangeEventArgs,\n} from \"@itwin/presentation-frontend\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { QueryRowFormat } from \"@itwin/core-common\";\n\nexport const onSelectionChanged = (\n evt: SelectionChangeEventArgs,\n selectionProvider: ISelectionProvider,\n) => {\n /* eslint-disable no-console */\n const selection = selectionProvider.getSelection(evt.imodel, evt.level);\n if (selection.isEmpty) {\n console.log(\"========== Selection cleared ==========\");\n } else {\n console.log(\"========== Selection change ===========\");\n if (selection.instanceKeys.size !== 0) {\n // log all selected ECInstance ids grouped by ECClass name\n console.log(\"ECInstances:\");\n selection.instanceKeys.forEach((ids, ecclass) => {\n console.log(`${ecclass}: [${[...ids].join(\",\")}]`);\n });\n }\n if (selection.nodeKeys.size !== 0) {\n // log all selected node keys\n console.log(\"Nodes:\");\n selection.nodeKeys.forEach((key) => console.log(JSON.stringify(key)));\n }\n console.log(\"=======================================\");\n }\n /* eslint-enable no-console */\n};\n\nexport interface WidgetHeaderProps {\n title: string;\n disabled?: boolean;\n returnFn?: () => Promise<void>;\n}\n\nexport const WidgetHeader = ({\n title,\n disabled = false,\n returnFn,\n}: WidgetHeaderProps) => {\n return (\n <div className='widget-header-container'>\n {returnFn && (\n <div\n className={disabled ? \"chevron-disabled\" : \"chevron\"}\n onClick={disabled ? undefined : returnFn}\n >\n <SvgChevronLeft />\n </div>\n )}\n <Text className='title' variant='title'>\n {title}\n </Text>\n </div>\n );\n};\n\nexport const handleInputChange = <T,>(\n e: React.ChangeEvent<HTMLInputElement>,\n values: T,\n setValues: React.Dispatch<React.SetStateAction<T>>,\n) => {\n const { name, value } = e.target;\n\n setValues({\n ...values,\n [name]: value,\n });\n};\n\nexport const fetchIdsFromQuery = async (\n query: string,\n iModelConnection: IModelConnection,\n) => {\n if (query === \"\") {\n return [];\n }\n const ids: string[] = [];\n const rowIterator = iModelConnection.query(query, undefined, {\n rowFormat: QueryRowFormat.UseJsPropertyNames,\n });\n while (true) {\n const { done, value } = await rowIterator.next();\n if (done) {\n break;\n }\n if (Object.keys(value).includes(\"id\")) {\n // eslint-disable-next-line dot-notation\n ids.push(value.id);\n } else if (Object.keys(value).includes(\"element.id\")) {\n ids.push(value[\"element.id\"]);\n }\n // eslint-disable-next-line dot-notation\n ids.push(value.id);\n }\n return ids;\n};\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
@import '~@itwin/itwinui-css/scss/icon/index';
|
|
7
|
+
@import '~@itwin/itwinui-css/scss/button/index';
|
|
8
|
+
|
|
9
|
+
.widget-header-container {
|
|
10
|
+
display: flex;
|
|
11
|
+
margin-bottom: $iui-baseline * 3;
|
|
12
|
+
|
|
13
|
+
.chevron {
|
|
14
|
+
@include iui-icons-large();
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
align-self: center;
|
|
17
|
+
margin-right: $iui-s;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.chevron-disabled {
|
|
21
|
+
@include iui-icons-large();
|
|
22
|
+
@include themed {
|
|
23
|
+
fill: t(iui-icons-color-actionable-disabled);
|
|
24
|
+
}
|
|
25
|
+
cursor: not-allowed;
|
|
26
|
+
|
|
27
|
+
align-self: center;
|
|
28
|
+
margin-right: $iui-s;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.title {
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
text-overflow: ellipsis;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
2
|
+
import { KeySet } from "@itwin/presentation-common";
|
|
3
|
+
export declare const visualizeElementsById: (elementIds: string[], color: string, iModelConnection: IModelConnection, replace?: boolean, wantEmphasis?: boolean) => Promise<string[]>;
|
|
4
|
+
export declare const visualizeElementsByKeys: (keySet: KeySet, color: string, replace?: boolean, wantEmphasis?: boolean) => Promise<string[]>;
|
|
5
|
+
export declare const visualizeElements: (elementIds: string[], color: string, replace?: boolean, wantEmphasis?: boolean) => void;
|
|
6
|
+
export declare const zoomToElements: (elementIds: string[]) => Promise<void>;
|
|
7
|
+
export declare const manufactureKeys: (elementIds: string[], iModelConnection: IModelConnection) => Promise<KeySet>;
|
|
8
|
+
export declare const clearEmphasizedElements: () => void;
|
|
9
|
+
//# sourceMappingURL=viewerUtils.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clearEmphasizedElements = exports.manufactureKeys = exports.zoomToElements = exports.visualizeElements = exports.visualizeElementsByKeys = exports.visualizeElementsById = void 0;
|
|
4
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
5
|
+
const core_common_1 = require("@itwin/core-common");
|
|
6
|
+
const presentation_common_1 = require("@itwin/presentation-common");
|
|
7
|
+
const presentation_frontend_1 = require("@itwin/presentation-frontend");
|
|
8
|
+
const visualizeElementsById = async (elementIds, color, iModelConnection, replace = false, wantEmphasis = true) => {
|
|
9
|
+
if (!core_frontend_1.IModelApp.viewManager.selectedView) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
13
|
+
const keySet = await exports.manufactureKeys(elementIds, iModelConnection);
|
|
14
|
+
const hiliteProvider = presentation_frontend_1.HiliteSetProvider.create({
|
|
15
|
+
imodel: vp.iModel,
|
|
16
|
+
});
|
|
17
|
+
const set = await hiliteProvider.getHiliteSet(keySet);
|
|
18
|
+
if (set.elements) {
|
|
19
|
+
const ids = [...set.elements];
|
|
20
|
+
exports.visualizeElements(ids, color, replace, wantEmphasis);
|
|
21
|
+
return ids;
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
};
|
|
25
|
+
exports.visualizeElementsById = visualizeElementsById;
|
|
26
|
+
const visualizeElementsByKeys = async (keySet, color, replace = false, wantEmphasis = true) => {
|
|
27
|
+
if (!core_frontend_1.IModelApp.viewManager.selectedView) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
31
|
+
const hiliteProvider = presentation_frontend_1.HiliteSetProvider.create({
|
|
32
|
+
imodel: vp.iModel,
|
|
33
|
+
});
|
|
34
|
+
const set = await hiliteProvider.getHiliteSet(keySet);
|
|
35
|
+
if (set.elements) {
|
|
36
|
+
const ids = [...set.elements];
|
|
37
|
+
exports.visualizeElements(ids, color, replace, wantEmphasis);
|
|
38
|
+
return ids;
|
|
39
|
+
}
|
|
40
|
+
return [];
|
|
41
|
+
};
|
|
42
|
+
exports.visualizeElementsByKeys = visualizeElementsByKeys;
|
|
43
|
+
const visualizeElements = (elementIds, color, replace = false, wantEmphasis = true) => {
|
|
44
|
+
if (!core_frontend_1.IModelApp.viewManager.selectedView) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
48
|
+
const emph = core_frontend_1.EmphasizeElements.getOrCreate(vp);
|
|
49
|
+
emph.overrideElements(elementIds, vp, core_common_1.ColorDef.fromString(color), core_common_1.FeatureOverrideType.ColorOnly, true);
|
|
50
|
+
if (!wantEmphasis) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
emph.wantEmphasis = true;
|
|
54
|
+
emph.emphasizeElements(elementIds, vp, undefined, replace);
|
|
55
|
+
};
|
|
56
|
+
exports.visualizeElements = visualizeElements;
|
|
57
|
+
const zoomToElements = async (elementIds) => {
|
|
58
|
+
if (!core_frontend_1.IModelApp.viewManager.selectedView) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
62
|
+
const viewChangeOpts = {};
|
|
63
|
+
viewChangeOpts.animateFrustumChange = true;
|
|
64
|
+
// It was removed. Should be a prop to be passed to lookAtViewAlignedVolume within the implementation.
|
|
65
|
+
// viewChangeOpts.marginPercent = new MarginPercent(0.1, 0.1, 0.1, 0.1);
|
|
66
|
+
await vp.zoomToElements(elementIds, { ...viewChangeOpts });
|
|
67
|
+
};
|
|
68
|
+
exports.zoomToElements = zoomToElements;
|
|
69
|
+
const manufactureKeys = async (elementIds, iModelConnection) => {
|
|
70
|
+
// segment ids into batches
|
|
71
|
+
const batches = [];
|
|
72
|
+
let currBatch = [];
|
|
73
|
+
const batchSize = 100000;
|
|
74
|
+
for (const id of elementIds) {
|
|
75
|
+
if (currBatch.length < batchSize) {
|
|
76
|
+
currBatch.push(id);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
batches.push(currBatch);
|
|
80
|
+
currBatch = [id];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (currBatch.length > 0 && currBatch.length <= batchSize) {
|
|
84
|
+
batches.push(currBatch);
|
|
85
|
+
}
|
|
86
|
+
// retrieve element properties in batches
|
|
87
|
+
let elemProps = [];
|
|
88
|
+
for (const batch of batches) {
|
|
89
|
+
const props = await iModelConnection.elements.getProps(batch);
|
|
90
|
+
elemProps = elemProps.concat(props);
|
|
91
|
+
}
|
|
92
|
+
const isElementId = (elem) => {
|
|
93
|
+
return elem.id !== undefined;
|
|
94
|
+
};
|
|
95
|
+
// create keyset from the element properties
|
|
96
|
+
const keys = elemProps
|
|
97
|
+
.map((elem) => ({
|
|
98
|
+
id: elem.id,
|
|
99
|
+
className: elem.classFullName,
|
|
100
|
+
}))
|
|
101
|
+
.filter(isElementId);
|
|
102
|
+
return new presentation_common_1.KeySet(keys);
|
|
103
|
+
};
|
|
104
|
+
exports.manufactureKeys = manufactureKeys;
|
|
105
|
+
const clearEmphasizedElements = () => {
|
|
106
|
+
if (!core_frontend_1.IModelApp.viewManager.selectedView) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const vp = core_frontend_1.IModelApp.viewManager.selectedView;
|
|
110
|
+
const emph = core_frontend_1.EmphasizeElements.getOrCreate(vp);
|
|
111
|
+
emph.clearEmphasizedElements(vp);
|
|
112
|
+
emph.clearOverriddenElements(vp);
|
|
113
|
+
};
|
|
114
|
+
exports.clearEmphasizedElements = clearEmphasizedElements;
|
|
115
|
+
//# sourceMappingURL=viewerUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewerUtils.js","sourceRoot":"","sources":["../../../../src/widget/components/viewerUtils.tsx"],"names":[],"mappings":";;;AAOA,wDAG8B;AAG9B,oDAG4B;AAC5B,oEAAoD;AACpD,wEAAiE;AAE1D,MAAM,qBAAqB,GAAG,KAAK,EACxC,UAAoB,EACpB,KAAa,EACb,gBAAkC,EAClC,OAAO,GAAG,KAAK,EACf,YAAY,GAAG,IAAI,EACnB,EAAE;IACF,IAAI,CAAC,yBAAS,CAAC,WAAW,CAAC,YAAY,EAAE;QACvC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,EAAE,GAAG,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAE9C,MAAM,MAAM,GAAG,MAAM,uBAAe,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACn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,yBAAS,CAAC,WAAW,CAAC,YAAY,CAAC;IAC9C,MAAM,IAAI,GAAG,iCAAiB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC/C,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACjC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC;AARW,QAAA,uBAAuB,2BAQlC","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 {\n IModelConnection,\n ViewChangeOptions} from \"@itwin/core-frontend\";\nimport {\n EmphasizeElements,\n IModelApp,\n} from \"@itwin/core-frontend\";\nimport type {\n ElementProps} from \"@itwin/core-common\";\nimport {\n ColorDef,\n FeatureOverrideType,\n} from \"@itwin/core-common\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { HiliteSetProvider } from \"@itwin/presentation-frontend\";\n\nexport const visualizeElementsById = async (\n elementIds: string[],\n color: string,\n iModelConnection: IModelConnection,\n replace = false,\n wantEmphasis = true,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const keySet = await manufactureKeys(elementIds, iModelConnection);\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElementsByKeys = async (\n keySet: KeySet,\n color: string,\n replace = false,\n wantEmphasis = true,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return [];\n }\n\n const vp = IModelApp.viewManager.selectedView;\n\n const hiliteProvider: HiliteSetProvider = HiliteSetProvider.create({\n imodel: vp.iModel,\n });\n const set = await hiliteProvider.getHiliteSet(keySet);\n if (set.elements) {\n const ids = [...set.elements];\n visualizeElements(ids, color, replace, wantEmphasis);\n return ids;\n }\n return [];\n};\n\nexport const visualizeElements = (\n elementIds: string[],\n color: string,\n replace = false,\n wantEmphasis = true,\n) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n\n emph.overrideElements(\n elementIds,\n vp,\n ColorDef.fromString(color),\n FeatureOverrideType.ColorOnly,\n true,\n );\n if (!wantEmphasis) {\n return;\n }\n emph.wantEmphasis = true;\n emph.emphasizeElements(elementIds, vp, undefined, replace);\n};\n\nexport const zoomToElements = async (elementIds: string[]) => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n\n const vp = IModelApp.viewManager.selectedView;\n const viewChangeOpts: ViewChangeOptions = {};\n viewChangeOpts.animateFrustumChange = true;\n // It was removed. Should be a prop to be passed to lookAtViewAlignedVolume within the implementation.\n // viewChangeOpts.marginPercent = new MarginPercent(0.1, 0.1, 0.1, 0.1);\n await vp.zoomToElements(elementIds, { ...viewChangeOpts });\n};\n\nexport const manufactureKeys = async (\n elementIds: string[],\n iModelConnection: IModelConnection,\n): Promise<KeySet> => {\n // segment ids into batches\n const batches: string[][] = [];\n let currBatch: string[] = [];\n const batchSize = 100000;\n for (const id of elementIds) {\n if (currBatch.length < batchSize) {\n currBatch.push(id);\n } else {\n batches.push(currBatch);\n currBatch = [id];\n }\n }\n if (currBatch.length > 0 && currBatch.length <= batchSize) {\n batches.push(currBatch);\n }\n\n // retrieve element properties in batches\n let elemProps: ElementProps[] = [];\n for (const batch of batches) {\n const props = await iModelConnection.elements.getProps(batch);\n elemProps = elemProps.concat(props);\n }\n\n const isElementId = (elem: {\n id: string | undefined;\n className: string;\n }): elem is {\n id: string;\n className: string;\n } => {\n return elem.id !== undefined;\n };\n\n // create keyset from the element properties\n const keys = elemProps\n .map((elem: ElementProps) => ({\n id: elem.id,\n className: elem.classFullName,\n }))\n .filter(isElementId);\n return new KeySet(keys);\n};\n\nexport const clearEmphasizedElements = () => {\n if (!IModelApp.viewManager.selectedView) {\n return;\n }\n const vp = IModelApp.viewManager.selectedView;\n const emph = EmphasizeElements.getOrCreate(vp);\n emph.clearEmphasizedElements(vp);\n emph.clearOverriddenElements(vp);\n};\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*---------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
5
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
6
|
+
*--------------------------------------------------------------------------------------------*/
|
|
7
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const useFetchAccessToken = () => {
|
|
10
|
+
const [accessToken, setAccessToken] = react_1.useState("");
|
|
11
|
+
react_1.useEffect(() => {
|
|
12
|
+
const fetchAccessToken = async () => {
|
|
13
|
+
var _a;
|
|
14
|
+
const accessToken = await ((_a = core_frontend_1.IModelApp.authorizationClient) === null || _a === void 0 ? void 0 : _a.getAccessToken());
|
|
15
|
+
setAccessToken(accessToken !== null && accessToken !== void 0 ? accessToken : "");
|
|
16
|
+
};
|
|
17
|
+
void fetchAccessToken();
|
|
18
|
+
}, []);
|
|
19
|
+
return accessToken;
|
|
20
|
+
};
|
|
21
|
+
exports.default = useFetchAccessToken;
|
|
22
|
+
//# sourceMappingURL=useFetchAccessToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchAccessToken.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useFetchAccessToken.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,wDAAiD;AACjD,iCAA4C;AAE5C,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,gBAAQ,CAAS,EAAE,CAAC,CAAC;IAE3D,iBAAS,CAAC,GAAG,EAAE;QACb,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;;YAClC,MAAM,WAAW,GAAG,MAAM,CAAA,MAAA,yBAAS,CAAC,mBAAmB,0CAAE,cAAc,EAAE,CAAA,CAAC;YAC1E,cAAc,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAC,CAAC;QACpC,CAAC,CAAC;QACF,KAAK,gBAAgB,EAAE,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,kBAAe,mBAAmB,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 { IModelApp } from \"@itwin/core-frontend\";\nimport { useEffect, useState } from \"react\";\n\nconst useFetchAccessToken = () => {\n const [accessToken, setAccessToken] = useState<string>(\"\");\n\n useEffect(() => {\n const fetchAccessToken = async () => {\n const accessToken = await IModelApp.authorizationClient?.getAccessToken();\n setAccessToken(accessToken ?? \"\");\n };\n void fetchAccessToken();\n }, []);\n\n return accessToken;\n};\n\nexport default useFetchAccessToken;\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import SimpleReactValidator from "simple-react-validator";
|
|
2
|
+
export declare const Validators: {
|
|
3
|
+
NoDuplicateUnderscore: {
|
|
4
|
+
message: string;
|
|
5
|
+
rule: (val: string) => boolean;
|
|
6
|
+
};
|
|
7
|
+
OnlyBeginsWithLetterOrUnderscore: {
|
|
8
|
+
message: string;
|
|
9
|
+
rule: (val: string) => boolean;
|
|
10
|
+
};
|
|
11
|
+
FollowedByLettersUnderscoresAndDigits: {
|
|
12
|
+
message: string;
|
|
13
|
+
rule: (val: string) => boolean;
|
|
14
|
+
};
|
|
15
|
+
CharLimit: {
|
|
16
|
+
message: string;
|
|
17
|
+
rule: (val: string) => boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresAndDigits|CharLimit";
|
|
21
|
+
export declare const Messages: {
|
|
22
|
+
required: string;
|
|
23
|
+
};
|
|
24
|
+
declare const useValidator: (customMessage?: {
|
|
25
|
+
required: string;
|
|
26
|
+
}, customValidator?: {
|
|
27
|
+
NoDuplicateUnderscore: {
|
|
28
|
+
message: string;
|
|
29
|
+
rule: (val: string) => boolean;
|
|
30
|
+
};
|
|
31
|
+
OnlyBeginsWithLetterOrUnderscore: {
|
|
32
|
+
message: string;
|
|
33
|
+
rule: (val: string) => boolean;
|
|
34
|
+
};
|
|
35
|
+
FollowedByLettersUnderscoresAndDigits: {
|
|
36
|
+
message: string;
|
|
37
|
+
rule: (val: string) => boolean;
|
|
38
|
+
};
|
|
39
|
+
CharLimit: {
|
|
40
|
+
message: string;
|
|
41
|
+
rule: (val: string) => boolean;
|
|
42
|
+
};
|
|
43
|
+
}) => [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>];
|
|
44
|
+
export default useValidator;
|
|
45
|
+
//# sourceMappingURL=useValidator.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Messages = exports.NAME_REQUIREMENTS = exports.Validators = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
9
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const simple_react_validator_1 = __importDefault(require("simple-react-validator"));
|
|
13
|
+
exports.Validators = {
|
|
14
|
+
NoDuplicateUnderscore: {
|
|
15
|
+
message: 'Remove duplicate "_"',
|
|
16
|
+
rule: (val) => {
|
|
17
|
+
return !val.match(/__+/i);
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
OnlyBeginsWithLetterOrUnderscore: {
|
|
21
|
+
message: "Name can only start with a letter or underscore.",
|
|
22
|
+
rule: (val) => {
|
|
23
|
+
return !val.match(/^[\W\d]+/i);
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
FollowedByLettersUnderscoresAndDigits: {
|
|
27
|
+
message: "Name can only contain letters, underscores, or digits",
|
|
28
|
+
rule: (val) => {
|
|
29
|
+
return !val.match(/\W+/i);
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
CharLimit: {
|
|
33
|
+
message: "There is an 128 character limit.",
|
|
34
|
+
rule: (val) => {
|
|
35
|
+
return val.length <= 128;
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
exports.NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresAndDigits|CharLimit";
|
|
40
|
+
exports.Messages = { required: "This field is required." };
|
|
41
|
+
const useValidator = (customMessage = exports.Messages, customValidator = exports.Validators) => {
|
|
42
|
+
const [show, setShow] = react_1.useState(false);
|
|
43
|
+
const validator = new simple_react_validator_1.default({
|
|
44
|
+
messages: customMessage,
|
|
45
|
+
validators: customValidator,
|
|
46
|
+
});
|
|
47
|
+
if (show) {
|
|
48
|
+
validator.showMessages();
|
|
49
|
+
}
|
|
50
|
+
return [validator, setShow];
|
|
51
|
+
};
|
|
52
|
+
exports.default = useValidator;
|
|
53
|
+
//# sourceMappingURL=useValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../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1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,kBAAe,YAAY,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 { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\n\nexport const Validators = {\n NoDuplicateUnderscore: {\n message: 'Remove duplicate \"_\"',\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: \"Name can only start with a letter or underscore.\",\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresAndDigits: {\n message: \"Name can only contain letters, underscores, or digits\",\n rule: (val: string) => {\n return !val.match(/\\W+/i);\n },\n },\n CharLimit: {\n message: \"There is an 128 character limit.\",\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n};\n\nexport const NAME_REQUIREMENTS =\n \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresAndDigits|CharLimit\";\n\nexport const Messages = { required: \"This field is required.\" };\n\nconst useValidator = (\n customMessage = Messages,\n customValidator = Validators,\n): [SimpleReactValidator, React.Dispatch<React.SetStateAction<boolean>>] => {\n const [show, setShow] = useState(false);\n const validator = new SimpleReactValidator({\n messages: customMessage,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/*---------------------------------------------------------------------------------------------
|
|
7
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
8
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
9
|
+
*--------------------------------------------------------------------------------------------*/
|
|
10
|
+
const react_1 = __importDefault(require("react"));
|
|
11
|
+
require("./DatabaseInfo.scss");
|
|
12
|
+
const DatabaseInfoIcon = () => {
|
|
13
|
+
return (react_1.default.createElement("svg", { className: 'database-info-icon', version: '1.1', viewBox: '0 0 16 16', xmlns: 'http://www.w3.org/2000/svg' },
|
|
14
|
+
react_1.default.createElement("g", { transform: 'translate(-76.395 -115.93)' },
|
|
15
|
+
react_1.default.createElement("path", { d: 'm91.293 123.66a0.77217 0.77217 0 0 1 0.83377 0.70519q0.0019 0.0233 0.0019 0.0473a1.095 1.095 0 0 1-1.0871 1.0035 0.79008 0.79008 0 0 1-0.83626-0.83626 1.0271 1.0271 0 0 1 1.0871-0.91987m-1.6723 8.0281c-0.41796 0-0.75264-0.25105-0.41796-1.4215l0.50175-2.007c0.08327-0.33447 0.08327-0.41848-4.93e-4 -0.41848-0.16708-0.0838-0.75264 0.16724-1.0873 0.41798l-0.16708-0.41798c1.0035-0.83641 2.1741-1.3382 2.7597-1.3382 0.41795 0 0.50175 0.50178 0.25089 1.3382l-0.58506 2.1746c-0.08381 0.41797-0.08381 0.50175 0.08381 0.50175a1.6749 1.6749 0 0 0 0.91989-0.50175l0.25089 0.33486a4.8242 4.8242 0 0 1-2.5091 1.3377', strokeWidth: '.50175' }),
|
|
16
|
+
react_1.default.createElement("path", { d: 'm82.2 116.09c-2.4283 0-5.3503 0.45305-5.666 1.0765v2.9707c0.04028 0.16181 0.30758 0.31546 0.72039 0.46923a1.3194 1.3194 0 0 0-0.72039 0.42085v2.922c0.04028 0.1618 0.32376 0.33175 0.75276 0.48568a1.3841 1.3841 0 0 0-0.75276 0.45305v2.9301c0.16188 0.60709 3.7557 1.2222 5.666 1.2222 1.9103 0 5.5041-0.61516 5.666-1.2303v-2.922c-0.04866-0.13736-0.37238-0.29179-0.80944-0.43691 0.46949-0.1618 0.80944-0.32361 0.80944-0.50186v-2.922c-0.04866-0.13775-0.36423-0.27549-0.80944-0.42084 0.4614-0.15405 0.80944-0.32361 0.80944-0.50187v-2.9382c-0.1618-0.4612-3.2377-1.0766-5.666-1.0766zm-4.8566 1.1655h0.08106a10.085 10.085 0 0 0 1.4084 0.45355 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8102 9.8102 0 0 0 1.4327-0.38829l0.22668 0.0974v0.46923a10.401 10.401 0 0 1-1.5298 0.40454 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.652 10.652 0 0 1-1.546-0.40454l-0.11318-0.0485v-0.45355s0.06488-0.0485 0.28329-0.1296zm0 3.8448 0.09697 0.0485a10.296 10.296 0 0 0 1.4489 0.37211 19.677 19.677 0 0 0 3.432 0.38829 19.685 19.685 0 0 0 3.432-0.38829 10.005 10.005 0 0 0 1.4327-0.37211l0.22668 0.0974v0.46923a10.409 10.409 0 0 1-1.5298 0.40458 19.977 19.977 0 0 1-3.5534 0.38825 19.977 19.977 0 0 1-3.5534-0.38825 10.668 10.668 0 0 1-1.546-0.40458l-0.11318-0.0485v-0.43687s0.02445-0.0485 0.17011-0.12959zm0 3.8934h0.08106a10.077 10.077 0 0 0 1.4489 0.38829 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8021 9.8021 0 0 0 1.3922-0.38829l0.22668 0.097v0.46927a10.264 10.264 0 0 1-1.5298 0.42084 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.523 10.523 0 0 1-1.546-0.42084l-0.11318-0.0485v-0.42084s0.08102-0.0485 0.28329-0.097z', strokeWidth: '.80942' }))));
|
|
17
|
+
};
|
|
18
|
+
exports.default = DatabaseInfoIcon;
|
|
19
|
+
//# sourceMappingURL=DatabaseInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabaseInfo.js","sourceRoot":"","sources":["../../../../src/widget/icons/DatabaseInfo.tsx"],"names":[],"mappings":";;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,+BAA6B;AAE7B,MAAM,gBAAgB,GAAG,GAAgB,EAAE;IACzC,OAAO,CACL,uCACE,SAAS,EAAC,oBAAoB,EAC9B,OAAO,EAAC,KAAK,EACb,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;QAElC,qCAAG,SAAS,EAAC,4BAA4B;YACvC,wCACE,CAAC,EAAC,6lBAA6lB,EAC/lB,WAAW,EAAC,QAAQ,GACpB;YACF,wCACE,CAAC,EAAC,2qDAA2qD,EAC7qD,WAAW,EAAC,QAAQ,GACpB,CACA,CACA,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport React from \"react\";\nimport \"./DatabaseInfo.scss\";\n\nconst DatabaseInfoIcon = (): JSX.Element => {\n return (\n <svg\n className='database-info-icon'\n version='1.1'\n viewBox='0 0 16 16'\n xmlns='http://www.w3.org/2000/svg'\n >\n <g transform='translate(-76.395 -115.93)'>\n <path\n d='m91.293 123.66a0.77217 0.77217 0 0 1 0.83377 0.70519q0.0019 0.0233 0.0019 0.0473a1.095 1.095 0 0 1-1.0871 1.0035 0.79008 0.79008 0 0 1-0.83626-0.83626 1.0271 1.0271 0 0 1 1.0871-0.91987m-1.6723 8.0281c-0.41796 0-0.75264-0.25105-0.41796-1.4215l0.50175-2.007c0.08327-0.33447 0.08327-0.41848-4.93e-4 -0.41848-0.16708-0.0838-0.75264 0.16724-1.0873 0.41798l-0.16708-0.41798c1.0035-0.83641 2.1741-1.3382 2.7597-1.3382 0.41795 0 0.50175 0.50178 0.25089 1.3382l-0.58506 2.1746c-0.08381 0.41797-0.08381 0.50175 0.08381 0.50175a1.6749 1.6749 0 0 0 0.91989-0.50175l0.25089 0.33486a4.8242 4.8242 0 0 1-2.5091 1.3377'\n strokeWidth='.50175'\n />\n <path\n d='m82.2 116.09c-2.4283 0-5.3503 0.45305-5.666 1.0765v2.9707c0.04028 0.16181 0.30758 0.31546 0.72039 0.46923a1.3194 1.3194 0 0 0-0.72039 0.42085v2.922c0.04028 0.1618 0.32376 0.33175 0.75276 0.48568a1.3841 1.3841 0 0 0-0.75276 0.45305v2.9301c0.16188 0.60709 3.7557 1.2222 5.666 1.2222 1.9103 0 5.5041-0.61516 5.666-1.2303v-2.922c-0.04866-0.13736-0.37238-0.29179-0.80944-0.43691 0.46949-0.1618 0.80944-0.32361 0.80944-0.50186v-2.922c-0.04866-0.13775-0.36423-0.27549-0.80944-0.42084 0.4614-0.15405 0.80944-0.32361 0.80944-0.50187v-2.9382c-0.1618-0.4612-3.2377-1.0766-5.666-1.0766zm-4.8566 1.1655h0.08106a10.085 10.085 0 0 0 1.4084 0.45355 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8102 9.8102 0 0 0 1.4327-0.38829l0.22668 0.0974v0.46923a10.401 10.401 0 0 1-1.5298 0.40454 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.652 10.652 0 0 1-1.546-0.40454l-0.11318-0.0485v-0.45355s0.06488-0.0485 0.28329-0.1296zm0 3.8448 0.09697 0.0485a10.296 10.296 0 0 0 1.4489 0.37211 19.677 19.677 0 0 0 3.432 0.38829 19.685 19.685 0 0 0 3.432-0.38829 10.005 10.005 0 0 0 1.4327-0.37211l0.22668 0.0974v0.46923a10.409 10.409 0 0 1-1.5298 0.40458 19.977 19.977 0 0 1-3.5534 0.38825 19.977 19.977 0 0 1-3.5534-0.38825 10.668 10.668 0 0 1-1.546-0.40458l-0.11318-0.0485v-0.43687s0.02445-0.0485 0.17011-0.12959zm0 3.8934h0.08106a10.077 10.077 0 0 0 1.4489 0.38829 19.556 19.556 0 0 0 3.432 0.37211 19.564 19.564 0 0 0 3.432-0.37211 9.8021 9.8021 0 0 0 1.3922-0.38829l0.22668 0.097v0.46927a10.264 10.264 0 0 1-1.5298 0.42084 19.977 19.977 0 0 1-3.5534 0.38829 19.977 19.977 0 0 1-3.5534-0.38829 10.523 10.523 0 0 1-1.546-0.42084l-0.11318-0.0485v-0.42084s0.08102-0.0485 0.28329-0.097z'\n strokeWidth='.80942'\n />\n </g>\n </svg>\n );\n};\n\nexport default DatabaseInfoIcon;\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
|
+
@import '~@itwin/itwinui-css/scss/icon/index';
|
|
6
|
+
|
|
7
|
+
.database-info-icon {
|
|
8
|
+
@include iui-icons-default();
|
|
9
|
+
@include themed {
|
|
10
|
+
fill: t(iui-icons-color-actionable);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/widget/utils.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nexport type CreateTypeFromInterface<Interface> = {\n [Property in keyof Interface]: Interface[Property];\n};\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { KeySet } from "@itwin/presentation-common";
|
|
2
|
+
import type { SelectionChangesListener } from "@itwin/presentation-frontend";
|
|
3
|
+
import { PresentationPropertyDataProvider } from "@itwin/presentation-components";
|
|
4
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
5
|
+
export interface PropertyProps {
|
|
6
|
+
keys: KeySet;
|
|
7
|
+
imodel?: IModelConnection;
|
|
8
|
+
}
|
|
9
|
+
export declare class GroupQueryBuilderApi {
|
|
10
|
+
private static selectionListener;
|
|
11
|
+
static addSelectionListener(listener: SelectionChangesListener): void;
|
|
12
|
+
static removeSelectionListener(): void;
|
|
13
|
+
static createPropertyDataProvider(keys: KeySet, imodel: IModelConnection): PresentationPropertyDataProvider;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=GroupQueryBuilderApi.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Presentation, } from "@itwin/presentation-frontend";
|
|
2
|
+
import { DEFAULT_PROPERTY_GRID_RULESET, PresentationPropertyDataProvider, } from "@itwin/presentation-components";
|
|
3
|
+
/* This class demonstrates the key APIs needed to access formatted property information
|
|
4
|
+
suitable to present to end users. */
|
|
5
|
+
export class GroupQueryBuilderApi {
|
|
6
|
+
static addSelectionListener(listener) {
|
|
7
|
+
this.selectionListener = listener;
|
|
8
|
+
Presentation.selection.selectionChange.addListener(this.selectionListener);
|
|
9
|
+
}
|
|
10
|
+
static removeSelectionListener() {
|
|
11
|
+
Presentation.selection.selectionChange.removeListener(this.selectionListener);
|
|
12
|
+
}
|
|
13
|
+
static createPropertyDataProvider(keys, imodel) {
|
|
14
|
+
const dataProvider = new PresentationPropertyDataProvider({
|
|
15
|
+
imodel,
|
|
16
|
+
ruleset: DEFAULT_PROPERTY_GRID_RULESET,
|
|
17
|
+
});
|
|
18
|
+
dataProvider.keys = keys;
|
|
19
|
+
dataProvider.isNestedPropertyCategoryGroupingEnabled = true;
|
|
20
|
+
return dataProvider;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=GroupQueryBuilderApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupQueryBuilderApi.js","sourceRoot":"","sources":["../../../src/api/GroupQueryBuilderApi.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,YAAY,GACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AAQxC;uCACuC;AACvC,MAAM,OAAO,oBAAoB;IAGxB,MAAM,CAAC,oBAAoB,CAAC,QAAkC;QACnE,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC;QAClC,YAAY,CAAC,SAAS,CAAC,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC7E,CAAC;IAEM,MAAM,CAAC,uBAAuB;QACnC,YAAY,CAAC,SAAS,CAAC,eAAe,CAAC,cAAc,CACnD,IAAI,CAAC,iBAAiB,CACvB,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,0BAA0B,CACtC,IAAY,EACZ,MAAwB;QAExB,MAAM,YAAY,GAAG,IAAI,gCAAgC,CAAC;YACxD,MAAM;YACN,OAAO,EAAE,6BAA6B;SACvC,CAAC,CAAC;QACH,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,YAAY,CAAC,uCAAuC,GAAG,IAAI,CAAC;QAC5D,OAAO,YAAY,CAAC;IACtB,CAAC;CACF","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 { KeySet } from \"@itwin/presentation-common\";\nimport type {\n SelectionChangesListener} from \"@itwin/presentation-frontend\";\nimport {\n Presentation,\n} from \"@itwin/presentation-frontend\";\nimport {\n DEFAULT_PROPERTY_GRID_RULESET,\n PresentationPropertyDataProvider,\n} from \"@itwin/presentation-components\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\n\nexport interface PropertyProps {\n keys: KeySet;\n imodel?: IModelConnection;\n}\n\n/* This class demonstrates the key APIs needed to access formatted property information\n suitable to present to end users. */\nexport class GroupQueryBuilderApi {\n private static selectionListener: SelectionChangesListener;\n\n public static addSelectionListener(listener: SelectionChangesListener) {\n this.selectionListener = listener;\n Presentation.selection.selectionChange.addListener(this.selectionListener);\n }\n\n public static removeSelectionListener() {\n Presentation.selection.selectionChange.removeListener(\n this.selectionListener,\n );\n }\n\n public static createPropertyDataProvider(\n keys: KeySet,\n imodel: IModelConnection,\n ) {\n const dataProvider = new PresentationPropertyDataProvider({\n imodel,\n ruleset: DEFAULT_PROPERTY_GRID_RULESET,\n });\n dataProvider.keys = keys;\n dataProvider.isNestedPropertyCategoryGroupingEnabled = true;\n return dataProvider;\n }\n}\n"]}
|