@itwin/grouping-mapping-widget 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/grouping-mapping-widget.d.ts +3 -0
- package/lib/cjs/grouping-mapping-widget.js +7 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +2 -2
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -119
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyAction.scss +1 -12
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js +154 -0
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
- package/lib/cjs/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -0
- package/lib/cjs/widget/components/GroupAction.js +2 -2
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupColorLegend.d.ts +10 -0
- package/lib/cjs/widget/components/GroupColorLegend.js +20 -0
- package/lib/cjs/widget/components/GroupColorLegend.js.map +1 -0
- package/lib/cjs/widget/components/GroupColorLegend.scss +9 -0
- package/lib/cjs/widget/components/GroupColorToggle.d.ts +9 -0
- package/lib/cjs/widget/components/GroupColorToggle.js +69 -0
- package/lib/cjs/widget/components/GroupColorToggle.js.map +1 -0
- package/lib/cjs/widget/components/GroupItem.d.ts +12 -0
- package/lib/cjs/widget/components/GroupItem.js +19 -0
- package/lib/cjs/widget/components/GroupItem.js.map +1 -0
- package/lib/cjs/widget/components/GroupMenuActions.d.ts +13 -0
- package/lib/cjs/widget/components/GroupMenuActions.js +68 -0
- package/lib/cjs/widget/components/GroupMenuActions.js.map +1 -0
- package/lib/cjs/widget/components/GroupMenuActions.scss +13 -0
- package/lib/cjs/widget/components/Grouping.d.ts +9 -5
- package/lib/cjs/widget/components/Grouping.js +14 -142
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +0 -16
- package/lib/cjs/widget/components/GroupingMapping.js +3 -5
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContext.js +1 -1
- package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingRouter.js +20 -21
- package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/widget/components/GroupsAddButton.d.ts +3 -2
- package/lib/cjs/widget/components/GroupsAddButton.js +4 -3
- package/lib/cjs/widget/components/GroupsAddButton.js.map +1 -1
- package/lib/cjs/widget/components/GroupsAddButton.scss +2 -0
- package/lib/cjs/widget/components/GroupsShowHideButtons.d.ts +11 -0
- package/lib/cjs/widget/components/GroupsShowHideButtons.js +45 -0
- package/lib/cjs/widget/components/GroupsShowHideButtons.js.map +1 -0
- package/lib/cjs/widget/components/GroupsVisualization.d.ts +9 -0
- package/lib/cjs/widget/components/GroupsVisualization.js +137 -0
- package/lib/cjs/widget/components/GroupsVisualization.js.map +1 -0
- package/lib/cjs/widget/components/GroupsVisualization.scss +12 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.d.ts +10 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.js +27 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.js.map +1 -0
- package/lib/cjs/widget/components/GroupsVisualizationActions.scss +9 -0
- package/lib/cjs/widget/components/PropertyMenu.d.ts +1 -2
- package/lib/cjs/widget/components/PropertyMenu.js +6 -49
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenu.scss +2 -17
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js +45 -0
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.js.map +1 -0
- package/lib/cjs/widget/components/PropertyMenuWithVisualization.scss +16 -0
- package/lib/cjs/widget/components/QueryBuilderCustomUI.d.ts +3 -1
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js +2 -1
- package/lib/cjs/widget/components/QueryBuilderCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.d.ts +16 -0
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js +62 -0
- package/lib/cjs/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +2 -2
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +1 -1
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.d.ts +4 -0
- package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/groupsHelpers.d.ts +1 -1
- package/lib/cjs/widget/components/groupsHelpers.js +11 -14
- package/lib/cjs/widget/components/groupsHelpers.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +3 -0
- package/lib/esm/grouping-mapping-widget.js +3 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +2 -2
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.js +9 -121
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyAction.scss +1 -12
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.d.ts +12 -0
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js +128 -0
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.js.map +1 -0
- package/lib/esm/widget/components/CalculatedPropertyActionWithVisuals.scss +27 -0
- package/lib/esm/widget/components/GroupAction.js +2 -2
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupColorLegend.d.ts +10 -0
- package/lib/esm/widget/components/GroupColorLegend.js +13 -0
- package/lib/esm/widget/components/GroupColorLegend.js.map +1 -0
- package/lib/esm/widget/components/GroupColorLegend.scss +9 -0
- package/lib/esm/widget/components/GroupColorToggle.d.ts +9 -0
- package/lib/esm/widget/components/GroupColorToggle.js +46 -0
- package/lib/esm/widget/components/GroupColorToggle.js.map +1 -0
- package/lib/esm/widget/components/GroupItem.d.ts +12 -0
- package/lib/esm/widget/components/GroupItem.js +12 -0
- package/lib/esm/widget/components/GroupItem.js.map +1 -0
- package/lib/esm/widget/components/GroupMenuActions.d.ts +13 -0
- package/lib/esm/widget/components/GroupMenuActions.js +45 -0
- package/lib/esm/widget/components/GroupMenuActions.js.map +1 -0
- package/lib/esm/widget/components/GroupMenuActions.scss +13 -0
- package/lib/esm/widget/components/Grouping.d.ts +9 -5
- package/lib/esm/widget/components/Grouping.js +17 -145
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +0 -16
- package/lib/esm/widget/components/GroupingMapping.js +3 -5
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContent.js +1 -1
- package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContext.js +1 -1
- package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingRouter.js +20 -21
- package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/widget/components/GroupsAddButton.d.ts +3 -2
- package/lib/esm/widget/components/GroupsAddButton.js +5 -4
- package/lib/esm/widget/components/GroupsAddButton.js.map +1 -1
- package/lib/esm/widget/components/GroupsAddButton.scss +2 -0
- package/lib/esm/widget/components/GroupsShowHideButtons.d.ts +11 -0
- package/lib/esm/widget/components/GroupsShowHideButtons.js +22 -0
- package/lib/esm/widget/components/GroupsShowHideButtons.js.map +1 -0
- package/lib/esm/widget/components/GroupsVisualization.d.ts +9 -0
- package/lib/esm/widget/components/GroupsVisualization.js +114 -0
- package/lib/esm/widget/components/GroupsVisualization.js.map +1 -0
- package/lib/esm/widget/components/GroupsVisualization.scss +12 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.d.ts +10 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.js +20 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.js.map +1 -0
- package/lib/esm/widget/components/GroupsVisualizationActions.scss +9 -0
- package/lib/esm/widget/components/PropertyMenu.d.ts +1 -2
- package/lib/esm/widget/components/PropertyMenu.js +7 -50
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/PropertyMenu.scss +2 -17
- package/lib/esm/widget/components/PropertyMenuWithVisualization.d.ts +8 -0
- package/lib/esm/widget/components/PropertyMenuWithVisualization.js +22 -0
- package/lib/esm/widget/components/PropertyMenuWithVisualization.js.map +1 -0
- package/lib/esm/widget/components/PropertyMenuWithVisualization.scss +16 -0
- package/lib/esm/widget/components/QueryBuilderCustomUI.d.ts +3 -1
- package/lib/esm/widget/components/QueryBuilderCustomUI.js +2 -1
- package/lib/esm/widget/components/QueryBuilderCustomUI.js.map +1 -1
- package/lib/esm/widget/components/SharedCalculatedPropertyForms.d.ts +16 -0
- package/lib/esm/widget/components/SharedCalculatedPropertyForms.js +39 -0
- package/lib/esm/widget/components/SharedCalculatedPropertyForms.js.map +1 -0
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +2 -2
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +1 -1
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.d.ts +4 -0
- package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +2 -2
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/groupsHelpers.d.ts +1 -1
- package/lib/esm/widget/components/groupsHelpers.js +11 -14
- package/lib/esm/widget/components/groupsHelpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,21 +7,6 @@
|
|
|
7
7
|
.gmw-property-menu-wrapper {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.gmw-property-header {
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.gmw-property-menu-container {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
overflow: auto;
|
|
21
|
-
gap: $iui-baseline * 2;
|
|
22
|
-
.gmw-property-menu-toolbar {
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: space-between;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
gap: $iui-baseline * 2;
|
|
27
12
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PropertyMenuProps } from "./PropertyMenu";
|
|
3
|
+
import "./PropertyMenuWithVisualization.scss";
|
|
4
|
+
export interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {
|
|
5
|
+
color: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const PropertyMenuWithVisualization: ({ group, color, ...rest }: PropertyMenuWithVisualizationProps) => JSX.Element;
|
|
8
|
+
//# sourceMappingURL=PropertyMenuWithVisualization.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
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.PropertyMenuWithVisualization = 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 react_1 = __importStar(require("react"));
|
|
28
|
+
const PropertyMenu_1 = require("./PropertyMenu");
|
|
29
|
+
const GroupColorToggle_1 = require("./GroupColorToggle");
|
|
30
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
31
|
+
const GroupInformationPanel_1 = require("./GroupInformationPanel");
|
|
32
|
+
const itwinui_icons_react_1 = require("@itwin/itwinui-icons-react");
|
|
33
|
+
require("./PropertyMenuWithVisualization.scss");
|
|
34
|
+
const PropertyMenuWithVisualization = ({ group, color, ...rest }) => {
|
|
35
|
+
const [isInformationPanelOpen, setIsInformationPanelOpen] = react_1.useState(false);
|
|
36
|
+
return (react_1.default.createElement(itwinui_react_1.InformationPanelWrapper, { className: 'gmw-property-menu-vis-wrapper' },
|
|
37
|
+
react_1.default.createElement("div", { className: "gmw-property-menu-vis-toolbar" },
|
|
38
|
+
react_1.default.createElement(GroupColorToggle_1.GroupColorToggle, { group: group, color: color, labelPosition: "left" }),
|
|
39
|
+
react_1.default.createElement(itwinui_react_1.IconButton, { styleType: 'borderless', onClick: () => setIsInformationPanelOpen(true) },
|
|
40
|
+
react_1.default.createElement(itwinui_icons_react_1.SvgProperties, null))),
|
|
41
|
+
react_1.default.createElement(PropertyMenu_1.PropertyMenu, { group: group, ...rest }),
|
|
42
|
+
react_1.default.createElement(GroupInformationPanel_1.GroupInformationPanel, { isOpen: isInformationPanelOpen, onClose: () => setIsInformationPanelOpen(false), query: group.query, groupName: group.groupName })));
|
|
43
|
+
};
|
|
44
|
+
exports.PropertyMenuWithVisualization = PropertyMenuWithVisualization;
|
|
45
|
+
//# sourceMappingURL=PropertyMenuWithVisualization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyMenuWithVisualization.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenuWithVisualization.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,+CAAwC;AAExC,iDAA8C;AAC9C,yDAAsD;AACtD,wDAA2E;AAC3E,mEAAgE;AAChE,oEAA2D;AAC3D,gDAA8C;AAMvC,MAAM,6BAA6B,GAAG,CAAC,EAC5C,KAAK,EACL,KAAK,EACL,GAAG,IAAI,EAC4B,EAAE,EAAE;IACvC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,gBAAQ,CAAU,KAAK,CAAC,CAAC;IAErF,OAAO,CACL,8BAAC,uCAAuB,IAAC,SAAS,EAAC,+BAA+B;QAChE,uCAAK,SAAS,EAAC,+BAA+B;YAC5C,8BAAC,mCAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAC,MAAM,GAAG;YACrE,8BAAC,0BAAU,IACT,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC;gBAE9C,8BAAC,mCAAa,OAAG,CACN,CACT;QACN,8BAAC,2BAAY,IAAC,KAAK,EAAE,KAAK,KAAM,IAAI,GAAI;QACxC,8BAAC,6CAAqB,IACpB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAC/C,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACsB,CAC3B,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,6BAA6B,iCA2BxC","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, { useState } from \"react\";\nimport type { PropertyMenuProps } from \"./PropertyMenu\";\nimport { PropertyMenu } from \"./PropertyMenu\";\nimport { GroupColorToggle } from \"./GroupColorToggle\";\nimport { IconButton, InformationPanelWrapper } from \"@itwin/itwinui-react\";\nimport { GroupInformationPanel } from \"./GroupInformationPanel\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport \"./PropertyMenuWithVisualization.scss\";\n\nexport interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {\n color: string;\n}\n\nexport const PropertyMenuWithVisualization = ({\n group,\n color,\n ...rest\n}: PropertyMenuWithVisualizationProps) => {\n const [isInformationPanelOpen, setIsInformationPanelOpen] = useState<boolean>(false);\n\n return (\n <InformationPanelWrapper className='gmw-property-menu-vis-wrapper'>\n <div className=\"gmw-property-menu-vis-toolbar\">\n <GroupColorToggle group={group} color={color} labelPosition=\"left\" />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <SvgProperties />\n </IconButton>\n </div>\n <PropertyMenu group={group} {...rest} />\n <GroupInformationPanel\n isOpen={isInformationPanelOpen}\n onClose={() => setIsInformationPanelOpen(false)}\n query={group.query}\n groupName={group.groupName}\n />\n </InformationPanelWrapper>\n );\n};\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
|
+
.gmw-property-menu-vis-wrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: $iui-baseline;
|
|
11
|
+
flex-grow: 1;
|
|
12
|
+
.gmw-property-menu-vis-toolbar {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { GroupingCustomUI } from "./customUI/GroupingMappingCustomUI";
|
|
3
|
+
import type { Group } from "@itwin/insights-client";
|
|
3
4
|
export interface QueryBuilderCustomUIProps {
|
|
4
5
|
queryGenerationType: string;
|
|
5
6
|
groupUIs: GroupingCustomUI[];
|
|
6
7
|
isUpdating: boolean;
|
|
7
8
|
resetView: () => Promise<void>;
|
|
8
9
|
setQuery: (query: string) => void;
|
|
10
|
+
group?: Group;
|
|
9
11
|
}
|
|
10
|
-
export declare const QueryBuilderCustomUI: ({ queryGenerationType, groupUIs, isUpdating, resetView, setQuery, }: QueryBuilderCustomUIProps) => JSX.Element;
|
|
12
|
+
export declare const QueryBuilderCustomUI: ({ queryGenerationType, groupUIs, isUpdating, resetView, setQuery, group, }: QueryBuilderCustomUIProps) => JSX.Element;
|
|
11
13
|
//# sourceMappingURL=QueryBuilderCustomUI.d.ts.map
|
|
@@ -10,7 +10,7 @@ exports.QueryBuilderCustomUI = void 0;
|
|
|
10
10
|
*--------------------------------------------------------------------------------------------*/
|
|
11
11
|
const react_1 = __importDefault(require("react"));
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
|
-
const QueryBuilderCustomUI = ({ queryGenerationType, groupUIs, isUpdating, resetView, setQuery, }) => {
|
|
13
|
+
const QueryBuilderCustomUI = ({ queryGenerationType, groupUIs, isUpdating, resetView, setQuery, group, }) => {
|
|
14
14
|
if (queryGenerationType && queryGenerationType.length > 0) {
|
|
15
15
|
const selectedCustomUI = groupUIs.find((e) => e.name === queryGenerationType);
|
|
16
16
|
if (selectedCustomUI) {
|
|
@@ -18,6 +18,7 @@ const QueryBuilderCustomUI = ({ queryGenerationType, groupUIs, isUpdating, reset
|
|
|
18
18
|
updateQuery: setQuery,
|
|
19
19
|
isUpdating,
|
|
20
20
|
resetView,
|
|
21
|
+
initialEditModeQuery: group === null || group === void 0 ? void 0 : group.query,
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilderCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAE1B,mCAAuC;
|
|
1
|
+
{"version":3,"file":"QueryBuilderCustomUI.js","sourceRoot":"","sources":["../../../../src/widget/components/QueryBuilderCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAE1B,mCAAuC;AAYhC,MAAM,oBAAoB,GAAG,CAAC,EACnC,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACR,KAAK,GACqB,EAAE,EAAE;IAC9B,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE;QACzD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC,CAAC;QAC9E,IAAI,gBAAgB,EAAE;YACpB,OAAO,eAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,WAAW,EAAE;gBACvD,WAAW,EAAE,QAAQ;gBACrB,UAAU;gBACV,SAAS;gBACT,oBAAoB,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK;aACnC,CAAC,CAAC;SACJ;KACF;IACD,OAAO,8BAAC,oBAAY,IAAC,OAAO,EAAC,uCAAuC,GAAG,CAAC;AAC1E,CAAC,CAAC;AApBW,QAAA,oBAAoB,wBAoB/B","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 type { GroupingCustomUI } from \"./customUI/GroupingMappingCustomUI\";\nimport { EmptyMessage } from \"./utils\";\nimport type { Group } from \"@itwin/insights-client\";\n\nexport interface QueryBuilderCustomUIProps {\n queryGenerationType: string;\n groupUIs: GroupingCustomUI[];\n isUpdating: boolean;\n resetView: () => Promise<void>;\n setQuery: (query: string) => void;\n group?: Group;\n}\n\nexport const QueryBuilderCustomUI = ({\n queryGenerationType,\n groupUIs,\n isUpdating,\n resetView,\n setQuery,\n group,\n}: QueryBuilderCustomUIProps) => {\n if (queryGenerationType && queryGenerationType.length > 0) {\n const selectedCustomUI = groupUIs.find((e) => e.name === queryGenerationType);\n if (selectedCustomUI) {\n return React.createElement(selectedCustomUI.uiComponent, {\n updateQuery: setQuery,\n isUpdating,\n resetView,\n initialEditModeQuery: group?.query,\n });\n }\n }\n return <EmptyMessage message=\"No query generation method selected. \" />;\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CalculatedPropertyType } from "@itwin/insights-client";
|
|
3
|
+
import type { SelectOption } from "@itwin/itwinui-react";
|
|
4
|
+
import type SimpleReactValidator from "simple-react-validator";
|
|
5
|
+
interface SharedCalculatedPropertyFormsProps {
|
|
6
|
+
propertyName: string;
|
|
7
|
+
setPropertyName: (value: string) => void;
|
|
8
|
+
type: CalculatedPropertyType | undefined;
|
|
9
|
+
setType: (value: CalculatedPropertyType | undefined) => void;
|
|
10
|
+
validator: SimpleReactValidator;
|
|
11
|
+
itemRenderer?: (option: SelectOption<string>) => JSX.Element;
|
|
12
|
+
selectedItemRenderer?: (option: SelectOption<string>) => JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare const SharedCalculatedPropertyForms: ({ propertyName, setPropertyName, type, setType, validator, itemRenderer, selectedItemRenderer, }: SharedCalculatedPropertyFormsProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=SharedCalculatedPropertyForms.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
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.SharedCalculatedPropertyForms = 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 insights_client_1 = require("@itwin/insights-client");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const useValidator_1 = require("../hooks/useValidator");
|
|
30
|
+
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
31
|
+
const SharedCalculatedPropertyForms = ({ propertyName, setPropertyName, type, setType, validator, itemRenderer, selectedItemRenderer, }) => {
|
|
32
|
+
const generateOptionsFromCalculatedPropertyType = react_1.useCallback(() => {
|
|
33
|
+
const options = [];
|
|
34
|
+
const indexableEnum = insights_client_1.CalculatedPropertyType;
|
|
35
|
+
for (const key in indexableEnum) {
|
|
36
|
+
if (typeof indexableEnum[key] === "string" && key !== "Undefined") {
|
|
37
|
+
// Generate labels by adding space between capitals
|
|
38
|
+
const label = key
|
|
39
|
+
.replace(/([A-Z])/g, " $1")
|
|
40
|
+
.trim()
|
|
41
|
+
.replace(/^\w/, (c) => c.toUpperCase());
|
|
42
|
+
options.push({ value: indexableEnum[key], label });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return options;
|
|
46
|
+
}, []);
|
|
47
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
48
|
+
react_1.default.createElement(itwinui_react_1.LabeledInput, { value: propertyName, required: true, name: "name", label: "Name", onChange: (event) => {
|
|
49
|
+
setPropertyName(event.target.value);
|
|
50
|
+
validator.showMessageFor("name");
|
|
51
|
+
}, message: validator.message("name", propertyName, useValidator_1.NAME_REQUIREMENTS), status: validator.message("name", propertyName, useValidator_1.NAME_REQUIREMENTS)
|
|
52
|
+
? "negative"
|
|
53
|
+
: undefined, onBlur: () => {
|
|
54
|
+
validator.showMessageFor("name");
|
|
55
|
+
}, onBlurCapture: (event) => {
|
|
56
|
+
setPropertyName(event.target.value);
|
|
57
|
+
validator.showMessageFor("name");
|
|
58
|
+
} }),
|
|
59
|
+
react_1.default.createElement(itwinui_react_1.LabeledSelect, { label: "Quantity Type", required: true, options: generateOptionsFromCalculatedPropertyType(), value: type, onChange: setType, itemRenderer: itemRenderer, selectedItemRenderer: selectedItemRenderer, onShow: () => { }, onHide: () => { } })));
|
|
60
|
+
};
|
|
61
|
+
exports.SharedCalculatedPropertyForms = SharedCalculatedPropertyForms;
|
|
62
|
+
//# sourceMappingURL=SharedCalculatedPropertyForms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedCalculatedPropertyForms.js","sourceRoot":"","sources":["../../../../src/widget/components/SharedCalculatedPropertyForms.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,4DAEgC;AAChC,+CAA2C;AAC3C,wDAA0D;AAE1D,wDAAmE;AAa5D,MAAM,6BAA6B,GAAG,CAAC,EAC5C,YAAY,EACZ,eAAe,EACf,IAAI,EACJ,OAAO,EACP,SAAS,EACT,YAAY,EACZ,oBAAoB,GACe,EAAE,EAAE;IAEvC,MAAM,yCAAyC,GAAG,mBAAW,CAAC,GAAG,EAAE;QACjE,MAAM,OAAO,GAA2C,EAAE,CAAC;QAE3D,MAAM,aAAa,GAAG,wCAA8D,CAAC;QAEr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CAAC,CAAC;YACnC,CAAC,GACD;QACF,8BAAC,6BAAa,IACZ,KAAK,EAAC,eAAe,EACrB,QAAQ,QACR,OAAO,EAAE,yCAAyC,EAAE,EACpD,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,GACjB,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,6BAA6B,iCAkExC","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 CalculatedPropertyType,\n} from \"@itwin/insights-client\";\nimport React, { useCallback } from \"react\";\nimport { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport { LabeledInput, LabeledSelect } from \"@itwin/itwinui-react\";\nimport type SimpleReactValidator from \"simple-react-validator\";\n\ninterface SharedCalculatedPropertyFormsProps {\n propertyName: string;\n setPropertyName: (value: string) => void;\n type: CalculatedPropertyType | undefined;\n setType: (value: CalculatedPropertyType | undefined) => void;\n validator: SimpleReactValidator;\n itemRenderer?: (option: SelectOption<string>) => JSX.Element;\n selectedItemRenderer?: (option: SelectOption<string>) => JSX.Element;\n}\n\nexport const SharedCalculatedPropertyForms = ({\n propertyName,\n setPropertyName,\n type,\n setType,\n validator,\n itemRenderer,\n selectedItemRenderer,\n}: SharedCalculatedPropertyFormsProps) => {\n\n const generateOptionsFromCalculatedPropertyType = useCallback(() => {\n const options: SelectOption<CalculatedPropertyType>[] = [];\n\n const indexableEnum = CalculatedPropertyType as unknown as { [key: string]: string };\n\n for (const key in indexableEnum) {\n if (typeof indexableEnum[key] === \"string\" && key !== \"Undefined\") {\n // Generate labels by adding space between capitals\n const label = key\n .replace(/([A-Z])/g, \" $1\")\n .trim()\n .replace(/^\\w/, (c) => c.toUpperCase());\n options.push({ value: indexableEnum[key] as CalculatedPropertyType, label });\n }\n }\n return options;\n }, []);\n\n return (\n <>\n <LabeledInput\n value={propertyName}\n required\n name=\"name\"\n label=\"Name\"\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 <LabeledSelect<CalculatedPropertyType>\n label=\"Quantity Type\"\n required\n options={generateOptionsFromCalculatedPropertyType()}\n value={type}\n onChange={setType}\n itemRenderer={itemRenderer}\n selectedItemRenderer={selectedItemRenderer}\n onShow={() => { }}\n onHide={() => { }}\n />\n </>\n );\n};\n"]}
|
|
@@ -8,11 +8,11 @@ export interface QueryCacheItem {
|
|
|
8
8
|
}
|
|
9
9
|
export interface GroupHilitedElements {
|
|
10
10
|
hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;
|
|
11
|
-
hiddenGroupsIds: string
|
|
11
|
+
hiddenGroupsIds: Set<string>;
|
|
12
12
|
showGroupColor: boolean;
|
|
13
13
|
groups: Group[];
|
|
14
14
|
setGroups: (groups: Group[]) => void;
|
|
15
|
-
setHiddenGroupsIds: (hiddenGroupIds: string
|
|
15
|
+
setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;
|
|
16
16
|
setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;
|
|
17
17
|
}
|
|
18
18
|
export declare const GroupHilitedElementsContext: React.Context<GroupHilitedElements>;
|
|
@@ -27,7 +27,7 @@ exports.useGroupHilitedElementsContext = exports.GroupHilitedElementsContext = v
|
|
|
27
27
|
const React = __importStar(require("react"));
|
|
28
28
|
exports.GroupHilitedElementsContext = React.createContext({
|
|
29
29
|
hilitedElementsQueryCache: { current: new Map() },
|
|
30
|
-
hiddenGroupsIds:
|
|
30
|
+
hiddenGroupsIds: new Set(),
|
|
31
31
|
showGroupColor: false,
|
|
32
32
|
groups: [],
|
|
33
33
|
setGroups: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAkBlB,QAAA,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE;IACjD,eAAe,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../../src/widget/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAA+B;AAkBlB,QAAA,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,yBAAyB,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE;IACjD,eAAe,EAAE,IAAI,GAAG,EAAE;IAC1B,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,EAAE;IACV,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;IACpB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,iBAAiB,EAAE,GAAG,EAAE,GAAG,CAAC;CAC7B,CAAC,CAAC;AAEI,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,mCAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AARW,QAAA,8BAA8B,kCAQzC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport type { MutableRefObject } from \"react\";\nimport type { Group } from \"@itwin/insights-client\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nexport interface QueryCacheItem {\n keySet: KeySet;\n ids: string[];\n}\nexport interface GroupHilitedElements {\n hilitedElementsQueryCache: MutableRefObject<Map<string, QueryCacheItem>>;\n hiddenGroupsIds: Set<string>;\n showGroupColor: boolean;\n groups: Group[];\n setGroups: (groups: Group[]) => void;\n setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n}\n\nexport const GroupHilitedElementsContext = React.createContext<GroupHilitedElements>({\n hilitedElementsQueryCache: { current: new Map() },\n hiddenGroupsIds: new Set(),\n showGroupColor: false,\n groups: [],\n setGroups: () => { },\n setHiddenGroupsIds: () => { },\n setShowGroupColor: () => { },\n});\n\nexport const useGroupHilitedElementsContext = (): GroupHilitedElements => {\n const context = React.useContext(GroupHilitedElementsContext);\n if (!context) {\n throw new Error(\n \"useGroupHilitedElementsContext should be used within a GroupHilitedElementsContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -88,5 +88,9 @@ export interface GroupingCustomUIProps {
|
|
|
88
88
|
* To reset the viewer.
|
|
89
89
|
*/
|
|
90
90
|
resetView?: () => Promise<void>;
|
|
91
|
+
/**
|
|
92
|
+
* The initial query for the Group being edited.
|
|
93
|
+
*/
|
|
94
|
+
initialEditModeQuery?: string;
|
|
91
95
|
}
|
|
92
96
|
//# sourceMappingURL=GroupingMappingCustomUI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":";;;AAOA,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC","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 { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?:
|
|
1
|
+
{"version":3,"file":"GroupingMappingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/GroupingMappingCustomUI.ts"],"names":[],"mappings":";;;AAOA,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,qFAAQ,CAAA;IACR,mFAAO,CAAA;AACT,CAAC,EAHW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAGtC","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 { Group, Mapping } from \"@itwin/insights-client\";\nimport type { ReactElement } from \"react\";\n\nexport enum GroupingMappingCustomUIType {\n Grouping,\n Context,\n}\n\nexport type GroupingMappingCustomUI = GroupingCustomUI | ContextCustomUI;\n\n/** Custom UI Definitions. */\n\nexport interface IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType;\n /**\n * Unique identifier of the custom UI.\n */\n name: string;\n /**\n * Display label in the widget.\n */\n displayLabel: string;\n /**\n * Optional icon, will be shown before display label in widget.\n */\n icon?: ReactElement;\n}\n\n/**\n * Context custom UI type definition.\n */\nexport interface ContextCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Context;\n /**\n * User defined component for UI interaction with grouping mapping widget.\n */\n uiComponent?: React.ComponentType<ContextCustomUIProps>;\n /**\n * Callback function for context custom UI menu item click event.\n */\n onClick?: (group: Group, mapping: Mapping, iModelId: string) => void;\n}\n\n/**\n * Group custom UI type definition.\n */\nexport interface GroupingCustomUI extends IGroupingMappingCustomUI {\n /**\n * See GroupingMappingCustomUIType.\n */\n type: GroupingMappingCustomUIType.Grouping;\n /**\n * Custom UI Component to build query interactively. Refer to SearchGroupingCustomUI/ManualGroupingCustomUI.\n */\n uiComponent: (props: GroupingCustomUIProps) => JSX.Element;\n}\n\n/** Custom UI Component props definitions. */\n\n/**\n * Context custom UI component arguments definition.\n */\nexport interface ContextCustomUIProps {\n /**\n * IModel Id.\n */\n iModelId: string;\n /**\n * Mapping Id.\n */\n mappingId: string;\n /**\n * Group Id.\n */\n groupId: string;\n}\n\n/**\n * Group custom UI component arguments definition.\n */\nexport interface GroupingCustomUIProps {\n /**\n * To validate and update current query.\n */\n updateQuery: (query: string) => void;\n /**\n * To get the query loading status.\n */\n isUpdating?: boolean;\n /**\n * To reset the viewer.\n */\n resetView?: () => Promise<void>;\n /**\n * The initial query for the Group being edited.\n */\n initialEditModeQuery?: string;\n\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./ManualGroupingCustomUI.scss";
|
|
3
3
|
import type { GroupingCustomUIProps } from "./GroupingMappingCustomUI";
|
|
4
|
-
export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, }: GroupingCustomUIProps) => JSX.Element;
|
|
4
|
+
export declare const ManualGroupingCustomUI: ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }: GroupingCustomUIProps) => JSX.Element;
|
|
5
5
|
//# sourceMappingURL=ManualGroupingCustomUI.d.ts.map
|
|
@@ -12,8 +12,8 @@ const react_1 = __importDefault(require("react"));
|
|
|
12
12
|
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
13
13
|
const utils_1 = require("../utils");
|
|
14
14
|
require("./ManualGroupingCustomUI.scss");
|
|
15
|
-
const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, }) => {
|
|
16
|
-
const [manualInput, setManualInput] = react_1.default.useState("");
|
|
15
|
+
const ManualGroupingCustomUI = ({ updateQuery, isUpdating, resetView, initialEditModeQuery, }) => {
|
|
16
|
+
const [manualInput, setManualInput] = react_1.default.useState(initialEditModeQuery !== null && initialEditModeQuery !== void 0 ? initialEditModeQuery : "");
|
|
17
17
|
return (react_1.default.createElement("div", { className: 'gmw-manual-form' },
|
|
18
18
|
react_1.default.createElement(itwinui_react_1.Alert, { type: 'informational' }, "Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query."),
|
|
19
19
|
react_1.default.createElement(itwinui_react_1.LabeledTextarea, { label: 'Query', required: true, value: manualInput, onChange: (event) => setManualInput(event.target.value), disabled: isUpdating, placeholder: `E.g. "SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement"` }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,wDAAsE;AACtE,oCAA0C;AAC1C,yCAAuC;AAGhC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,
|
|
1
|
+
{"version":3,"file":"ManualGroupingCustomUI.js","sourceRoot":"","sources":["../../../../../src/widget/components/customUI/ManualGroupingCustomUI.tsx"],"names":[],"mappings":";;;;;;AAAA;;;+FAG+F;AAC/F,kDAA0B;AAC1B,wDAAsE;AACtE,oCAA0C;AAC1C,yCAAuC;AAGhC,MAAM,sBAAsB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,SAAS,EACT,oBAAoB,GACE,EAAE,EAAE;IAC1B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,eAAK,CAAC,QAAQ,CAAC,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,EAAE,CAAC,CAAC;IAEjF,OAAO,CACL,uCAAK,SAAS,EAAC,iBAAiB;QAC9B,8BAAC,qBAAK,IAAC,IAAI,EAAC,eAAe,0GAEnB;QACR,8BAAC,+BAAe,IACd,KAAK,EAAC,OAAO,EACb,QAAQ,QACR,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACvD,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,oEAAoE,GACjF;QACF,uCAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,IAAI,8BAAC,sBAAc,OAAG;YACjC,8BAAC,sBAAM,IAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,YAE5D;YACT,8BAAC,sBAAM,IACL,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,WAAW,CAAC,EAAE,CAAC,CAAC;oBAChB,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,IAAI,SAAS,EAAE;wBACb,MAAM,SAAS,EAAE,CAAC;qBACnB;gBACH,CAAC,YAGM,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAzCW,QAAA,sBAAsB,0BAyCjC","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 { Alert, Button, LabeledTextarea } from \"@itwin/itwinui-react\";\nimport { LoadingSpinner } from \"../utils\";\nimport \"./ManualGroupingCustomUI.scss\";\nimport type { GroupingCustomUIProps } from \"./GroupingMappingCustomUI\";\n\nexport const ManualGroupingCustomUI = ({\n updateQuery,\n isUpdating,\n resetView,\n initialEditModeQuery,\n}: GroupingCustomUIProps) => {\n const [manualInput, setManualInput] = React.useState(initialEditModeQuery ?? \"\");\n\n return (\n <div className='gmw-manual-form'>\n <Alert type='informational'>\n Generate group using an ECSQL query. Please select ECInstanceId and ECClassId columns in the query.\n </Alert>\n <LabeledTextarea\n label='Query'\n required\n value={manualInput}\n onChange={(event) => setManualInput(event.target.value)}\n disabled={isUpdating}\n placeholder={`E.g. \"SELECT ECInstanceId, ECClassId FROM BisCore:PhysicalElement\"`}\n />\n <div className='gmw-manual-actions'>\n {isUpdating && <LoadingSpinner />}\n <Button disabled={isUpdating} onClick={() => updateQuery(manualInput)}>\n Apply\n </Button>\n <Button\n disabled={isUpdating}\n onClick={async () => {\n updateQuery(\"\");\n setManualInput(\"\");\n if (resetView) {\n await resetView();\n }\n }}\n >\n Clear\n </Button>\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -5,6 +5,6 @@ export declare const getGroupColor: (index: number) => string;
|
|
|
5
5
|
export declare const getHiliteIdsFromGroups: (iModelConnection: IModelConnection, groups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<string[]>;
|
|
6
6
|
export declare const hideGroups: (iModelConnection: IModelConnection, viewGroups: Group[], hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<void>;
|
|
7
7
|
export declare const hideGroup: (iModelConnection: IModelConnection, viewGroup: Group, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<void>;
|
|
8
|
-
export declare const visualizeGroupColors: (iModelConnection: IModelConnection, groups: Group[],
|
|
8
|
+
export declare const visualizeGroupColors: (iModelConnection: IModelConnection, groups: Group[], hiddenGroupsIds: Set<string>, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>, doEmphasizeElements?: boolean) => Promise<void>;
|
|
9
9
|
export declare const getHiliteIdsAndKeysetFromGroup: (iModelConnection: IModelConnection, group: Group, hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>) => Promise<QueryCacheItem>;
|
|
10
10
|
//# sourceMappingURL=groupsHelpers.d.ts.map
|
|
@@ -45,21 +45,18 @@ const hideGroup = async (iModelConnection, viewGroup, hilitedElementsQueryCache)
|
|
|
45
45
|
viewerUtils_1.hideElements(result.ids);
|
|
46
46
|
};
|
|
47
47
|
exports.hideGroup = hideGroup;
|
|
48
|
-
const
|
|
48
|
+
const processGroupVisualization = async (iModelConnection, group, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements, groupColor) => {
|
|
49
|
+
const result = await exports.getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
|
|
50
|
+
const hilitedIds = result.ids;
|
|
51
|
+
viewerUtils_1.overrideElements(hilitedIds, groupColor, core_common_1.FeatureOverrideType.ColorAndAlpha);
|
|
52
|
+
doEmphasizeElements && viewerUtils_1.emphasizeElements(hilitedIds, undefined);
|
|
53
|
+
return hiddenGroupsIds.has(group.id) ? [] : hilitedIds;
|
|
54
|
+
};
|
|
55
|
+
const visualizeGroupColors = async (iModelConnection, groups, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements = true) => {
|
|
49
56
|
viewerUtils_1.clearEmphasizedOverriddenElements();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
? viewGroups.findIndex((g) => g.id === group.id)
|
|
54
|
-
: groups.findIndex((g) => g.id === group.id);
|
|
55
|
-
const result = await exports.getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);
|
|
56
|
-
const hilitedIds = result.ids;
|
|
57
|
-
viewerUtils_1.overrideElements(hilitedIds, exports.getGroupColor(index), core_common_1.FeatureOverrideType.ColorAndAlpha);
|
|
58
|
-
doEmphasizeElements && viewerUtils_1.emphasizeElements(hilitedIds, undefined);
|
|
59
|
-
if (!hiddenGroupsIds.includes(group.id)) {
|
|
60
|
-
allIds = allIds.concat(hilitedIds);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
57
|
+
const allIdsPromises = groups.map(async (group, index) => processGroupVisualization(iModelConnection, group, hiddenGroupsIds, hilitedElementsQueryCache, doEmphasizeElements, exports.getGroupColor(index)));
|
|
58
|
+
const allIdsArrays = await Promise.all(allIdsPromises);
|
|
59
|
+
const allIds = allIdsArrays.flat();
|
|
63
60
|
await viewerUtils_1.zoomToElements(allIds);
|
|
64
61
|
};
|
|
65
62
|
exports.visualizeGroupColors = visualizeGroupColors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupsHelpers.js","sourceRoot":"","sources":["../../../../src/widget/components/groupsHelpers.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,oDAAyD;AAGzD,wDAA+C;AAC/C,oEAAoD;AAEpD,+CAAmJ;AAEnJ,MAAM,WAAW,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtC,MAAM,aAAa,GAAG,UAAU,KAAa;IAClD,OAA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QAChD,OAAO,MAAA,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mCAAI,CAAC,EAAE,MAAM,EAAE,IAAI,4BAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KAC5F;IACD,IAAI;QACF,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClE,IAAI,aAAa,KAAK,CAAC,EAAE;YACvB,uBAAO,CAAC,OAAO,CACb,GAAG,KAAK,CAAC,SAAS,4CAA4C,CAC/D,CAAC;SACH;QACD,MAAM,MAAM,GAAG,MAAM,0BAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;QAC3D,yBAAyB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrD,OAAO,MAAM,CAAC;KACf;IAAC,MAAM;QACN,uBAAO,CAAC,QAAQ,CACd,8BAA8B,CAC/B,CAAC;QACF,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,4BAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;KAC5C;AAEH,CAAC,CAAC;AA1BW,QAAA,8BAA8B,kCA0BzC","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 { FeatureOverrideType } from \"@itwin/core-common\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport type { Group } from \"@itwin/insights-client\";\nimport { toaster } from \"@itwin/itwinui-react\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport type { QueryCacheItem } from \"./context/GroupHilitedElementsContext\";\nimport { clearEmphasizedOverriddenElements, emphasizeElements, getHiliteIds, hideElements, overrideElements, zoomToElements } from \"./viewerUtils\";\n\nconst goldenAngle = 180 * (3 - Math.sqrt(5));\n\nexport const getGroupColor = function (index: number) {\n return `hsl(${index * goldenAngle + 60}, 100%, 50%)`;\n};\n\nexport const getHiliteIdsFromGroups = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<{ ids: string[] }>[] = [];\n for (const group of groups) {\n if (!distinctQueries.has(group.query)) {\n distinctQueries.add(group.query);\n promises.push(getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache));\n }\n }\n const results = await Promise.all(promises);\n const allIds = results.flatMap((result) => result.ids);\n return allIds;\n};\n\nexport const hideGroups = async (\n iModelConnection: IModelConnection,\n viewGroups: Group[],\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const distinctQueries = new Set<string>();\n const promises: Promise<void>[] = [];\n\n for (const viewGroup of viewGroups) {\n if (!distinctQueries.has(viewGroup.query)) {\n distinctQueries.add(viewGroup.query);\n promises.push(hideGroup(iModelConnection, viewGroup, hilitedElementsQueryCache));\n }\n }\n await Promise.all(promises);\n};\n\nexport const hideGroup = async (\n iModelConnection: IModelConnection,\n viewGroup: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, viewGroup, hilitedElementsQueryCache);\n hideElements(result.ids);\n};\n\nconst processGroupVisualization = async (\n iModelConnection: IModelConnection,\n group: Group,\n hiddenGroupsIds: Set<string>,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n doEmphasizeElements: boolean,\n groupColor: string\n) => {\n const result = await getHiliteIdsAndKeysetFromGroup(iModelConnection, group, hilitedElementsQueryCache);\n const hilitedIds = result.ids;\n overrideElements(hilitedIds, groupColor, FeatureOverrideType.ColorAndAlpha);\n\n doEmphasizeElements && emphasizeElements(hilitedIds, undefined);\n\n return hiddenGroupsIds.has(group.id) ? [] : hilitedIds;\n};\n\nexport const visualizeGroupColors = async (\n iModelConnection: IModelConnection,\n groups: Group[],\n hiddenGroupsIds: Set<string>,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>,\n doEmphasizeElements: boolean = true\n) => {\n clearEmphasizedOverriddenElements();\n\n const allIdsPromises = groups.map(async (group, index) =>\n processGroupVisualization(\n iModelConnection,\n group,\n hiddenGroupsIds,\n hilitedElementsQueryCache,\n doEmphasizeElements,\n getGroupColor(index)\n )\n );\n\n const allIdsArrays = await Promise.all(allIdsPromises);\n const allIds = allIdsArrays.flat();\n\n await zoomToElements(allIds);\n};\n\nexport const getHiliteIdsAndKeysetFromGroup = async (\n iModelConnection: IModelConnection,\n group: Group,\n hilitedElementsQueryCache: React.MutableRefObject<Map<string, QueryCacheItem>>\n) => {\n const query = group.query;\n if (hilitedElementsQueryCache.current.has(query)) {\n return hilitedElementsQueryCache.current.get(query) ?? ({ keySet: new KeySet(), ids: [] });\n }\n try {\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\n `${group.groupName}'s query is valid but produced no results.`\n );\n }\n const result = await getHiliteIds(query, iModelConnection);\n hilitedElementsQueryCache.current.set(query, result);\n return result;\n } catch {\n toaster.negative(\n `Query could not be resolved.`\n );\n return ({ keySet: new KeySet(), ids: [] });\n }\n\n};\n"]}
|
|
@@ -9,10 +9,13 @@ export { Mappings, MappingsProps } from "./widget/components/Mapping";
|
|
|
9
9
|
export { MappingAction, MappingActionProps } from "./widget/components/MappingAction";
|
|
10
10
|
export { GroupingMappingContext, GroupingMappingContextProps } from "./widget/components/GroupingMappingContext";
|
|
11
11
|
export { Groupings, GroupingProps } from "./widget/components/Grouping";
|
|
12
|
+
export { GroupsVisualization, GroupsVisualizationProps } from "./widget/components/GroupsVisualization";
|
|
12
13
|
export { GroupAction, GroupActionProps } from "./widget/components/GroupAction";
|
|
13
14
|
export { PropertyMenu, PropertyMenuProps } from "./widget/components/PropertyMenu";
|
|
15
|
+
export { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from "./widget/components/PropertyMenuWithVisualization";
|
|
14
16
|
export { GroupPropertyAction, GroupPropertyActionProps } from "./widget/components/GroupPropertyAction";
|
|
15
17
|
export { CalculatedPropertyAction, CalculatedPropertyActionProps } from "./widget/components/CalculatedPropertyAction";
|
|
18
|
+
export { CalculatedPropertyActionWithVisuals, CalculatedPropertyActionWithVisualsProps } from "./widget/components/CalculatedPropertyActionWithVisuals";
|
|
16
19
|
export { CustomCalculationAction, CustomCalculationActionProps } from "./widget/components/CustomCalculationAction";
|
|
17
20
|
export { SearchGroupingCustomUI } from "./widget/components/customUI/SearchGroupingCustomUI";
|
|
18
21
|
export { ManualGroupingCustomUI } from "./widget/components/customUI/ManualGroupingCustomUI";
|
|
@@ -13,10 +13,13 @@ export { Mappings } from "./widget/components/Mapping";
|
|
|
13
13
|
export { MappingAction } from "./widget/components/MappingAction";
|
|
14
14
|
export { GroupingMappingContext } from "./widget/components/GroupingMappingContext";
|
|
15
15
|
export { Groupings } from "./widget/components/Grouping";
|
|
16
|
+
export { GroupsVisualization } from "./widget/components/GroupsVisualization";
|
|
16
17
|
export { GroupAction } from "./widget/components/GroupAction";
|
|
17
18
|
export { PropertyMenu } from "./widget/components/PropertyMenu";
|
|
19
|
+
export { PropertyMenuWithVisualization } from "./widget/components/PropertyMenuWithVisualization";
|
|
18
20
|
export { GroupPropertyAction } from "./widget/components/GroupPropertyAction";
|
|
19
21
|
export { CalculatedPropertyAction } from "./widget/components/CalculatedPropertyAction";
|
|
22
|
+
export { CalculatedPropertyActionWithVisuals } from "./widget/components/CalculatedPropertyActionWithVisuals";
|
|
20
23
|
export { CustomCalculationAction } from "./widget/components/CustomCalculationAction";
|
|
21
24
|
export { SearchGroupingCustomUI } from "./widget/components/customUI/SearchGroupingCustomUI";
|
|
22
25
|
export { ManualGroupingCustomUI } from "./widget/components/customUI/ManualGroupingCustomUI";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-mapping-widget.js","sourceRoot":"","sources":["../../src/grouping-mapping-widget.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,gDAAgD;AAChD,cAAc,gCAAgC,CAAC;AAE/C,0EAA0E;AAC1E,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAC3J,OAAO,EAA4D,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AAC9L,cAAc,wBAAwB,CAAC;AAEvC,yCAAyC;AACzC,OAAO,EAAE,QAAQ,EAAiB,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAsB,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAA+B,MAAM,4CAA4C,CAAC;AACjH,OAAO,EAAE,SAAS,EAAiB,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAoB,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAA4B,MAAM,yCAAyC,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAiC,MAAM,8CAA8C,CAAC;AACvH,OAAO,EAAE,uBAAuB,EAAgC,MAAM,6CAA6C,CAAC;AACpH,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,EAA2B,2BAA2B,EAAkF,MAAM,sDAAsD,CAAC;AAE5M,gCAAgC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,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*--------------------------------------------------------------------------------------------*/\n/** UI Provider for iTwin Viewer Applications */\nexport * from \"./widget/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./widget/components/context/MappingClientContext\";\nexport { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig, GroupingMappingApiConfigContext, useGroupingMappingApiConfig } from \"./widget/components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./widget/components/Mapping\";\nexport { MappingAction, MappingActionProps } from \"./widget/components/MappingAction\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./widget/components/GroupingMappingContext\";\nexport { Groupings, GroupingProps } from \"./widget/components/Grouping\";\nexport { GroupAction, GroupActionProps } from \"./widget/components/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./widget/components/PropertyMenu\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./widget/components/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./widget/components/CalculatedPropertyAction\";\nexport { CustomCalculationAction, CustomCalculationActionProps } from \"./widget/components/CustomCalculationAction\";\nexport { SearchGroupingCustomUI } from \"./widget/components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./widget/components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./widget/components/customUI/GroupQueryBuilderCustomUI\";\nexport { GroupingMappingCustomUI, GroupingMappingCustomUIType, ContextCustomUI, GroupingCustomUI, GroupingCustomUIProps, ContextCustomUIProps } from \"./widget/components/customUI/GroupingMappingCustomUI\";\n\n/** Formula DataType resolver */\nexport { resolveFormulaDataType } from \"./formula/FormulaDataTypeResolver\";\nexport { DataType, PropertyMap } from \"./formula/Types\";\nexport { IResult } from \"./formula/IResult\";\n"]}
|
|
1
|
+
{"version":3,"file":"grouping-mapping-widget.js","source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EAAE,MAAM,mCAAmC,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*--------------------------------------------------------------------------------------------*/\n/** UI Provider for iTwin Viewer Applications */\nexport * from \"./widget/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./widget/components/context/MappingClientContext\";\nexport { ClientPrefix, GetAccessTokenFn, GroupingMappingApiConfig, GroupingMappingApiConfigContext, useGroupingMappingApiConfig } from \"./widget/components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./widget/components/Mapping\";\nexport { MappingAction, MappingActionProps } from \"./widget/components/MappingAction\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./widget/components/GroupingMappingContext\";\nexport { Groupings, GroupingProps } from \"./widget/components/Grouping\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./widget/components/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./widget/components/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./widget/components/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./widget/components/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./widget/components/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./widget/components/CalculatedPropertyAction\";\nexport { CalculatedPropertyActionWithVisuals, CalculatedPropertyActionWithVisualsProps } from \"./widget/components/CalculatedPropertyActionWithVisuals\";\nexport { CustomCalculationAction, CustomCalculationActionProps } from \"./widget/components/CustomCalculationAction\";\nexport { SearchGroupingCustomUI } from \"./widget/components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./widget/components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./widget/components/customUI/GroupQueryBuilderCustomUI\";\nexport { GroupingMappingCustomUI, GroupingMappingCustomUIType, ContextCustomUI, GroupingCustomUI, GroupingCustomUIProps, ContextCustomUIProps } from \"./widget/components/customUI/GroupingMappingCustomUI\";\n\n/** Formula DataType resolver */\nexport { resolveFormulaDataType } from \"./formula/FormulaDataTypeResolver\";\nexport { DataType, PropertyMap } from \"./formula/Types\";\nexport { IResult } from \"./formula/IResult\";\n"]}
|
|
@@ -178,7 +178,7 @@ describe("Groupings View", () => {
|
|
|
178
178
|
// Click on the context ui
|
|
179
179
|
await user.click(contextMenuItems[0]);
|
|
180
180
|
// Callback should have been called with correct parameters
|
|
181
|
-
expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedUIComponent, mockGroups.groups[0]);
|
|
181
|
+
expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedUIComponent, mockGroups.groups[0], mockContextUI.displayLabel);
|
|
182
182
|
});
|
|
183
183
|
it("Set up both grouping and context custom UI", async () => {
|
|
184
184
|
// Arange
|
|
@@ -230,7 +230,7 @@ describe("Groupings View", () => {
|
|
|
230
230
|
// Click on the context ui
|
|
231
231
|
await user.click(contextMenuItems[1]);
|
|
232
232
|
// Callback should have been called with correct parameters
|
|
233
|
-
expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedContextUIComponent, mockGroups.groups[0]);
|
|
233
|
+
expect(onClickRenderContextCustomUIMock).toBeCalledWith(mockedContextUIComponent, mockGroups.groups[0], mockContextUI.displayLabel);
|
|
234
234
|
});
|
|
235
235
|
});
|
|
236
236
|
//# sourceMappingURL=GroupingMappingCustomUI.test.js.map
|