@itwin/grouping-mapping-widget 0.30.1 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js +3 -1
- package/lib/cjs/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/cjs/components/GroupingMappingContext.js +5 -0
- package/lib/cjs/components/GroupingMappingContext.js.map +1 -1
- package/lib/cjs/components/Groups/GroupColorLegend.d.ts +2 -4
- package/lib/cjs/components/Groups/GroupColorLegend.js +2 -3
- package/lib/cjs/components/Groups/GroupColorLegend.js.map +1 -1
- package/lib/cjs/components/Groups/GroupsVisualization.d.ts +2 -1
- package/lib/cjs/components/Groups/GroupsVisualization.js +10 -5
- package/lib/cjs/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/cjs/components/Properties/GroupColorToggle.d.ts +2 -1
- package/lib/cjs/components/Properties/GroupColorToggle.js +11 -2
- package/lib/cjs/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.d.ts +2 -1
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js +2 -2
- package/lib/cjs/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenu.d.ts +2 -1
- package/lib/cjs/components/Properties/PropertyMenu.js +2 -2
- package/lib/cjs/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.d.ts +3 -1
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js +2 -2
- package/lib/cjs/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/cjs/components/Properties/PropertyTable.d.ts +2 -1
- package/lib/cjs/components/Properties/PropertyTable.js +3 -2
- package/lib/cjs/components/Properties/PropertyTable.js.map +1 -1
- package/lib/cjs/components/context/GroupHilitedElementsContext.d.ts +14 -0
- package/lib/cjs/components/context/GroupHilitedElementsContext.js +10 -0
- package/lib/cjs/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +1 -0
- package/lib/cjs/grouping-mapping-widget.js +4 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js +3 -1
- package/lib/esm/WidgetShell/Router/GroupingMappingRouter.js.map +1 -1
- package/lib/esm/components/GroupingMappingContext.js +5 -0
- package/lib/esm/components/GroupingMappingContext.js.map +1 -1
- package/lib/esm/components/Groups/GroupColorLegend.d.ts +2 -4
- package/lib/esm/components/Groups/GroupColorLegend.js +2 -3
- package/lib/esm/components/Groups/GroupColorLegend.js.map +1 -1
- package/lib/esm/components/Groups/GroupsVisualization.d.ts +2 -1
- package/lib/esm/components/Groups/GroupsVisualization.js +11 -6
- package/lib/esm/components/Groups/GroupsVisualization.js.map +1 -1
- package/lib/esm/components/Properties/GroupColorToggle.d.ts +2 -1
- package/lib/esm/components/Properties/GroupColorToggle.js +11 -2
- package/lib/esm/components/Properties/GroupColorToggle.js.map +1 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.d.ts +2 -1
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js +2 -2
- package/lib/esm/components/Properties/GroupProperties/GroupPropertyTable.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenu.d.ts +2 -1
- package/lib/esm/components/Properties/PropertyMenu.js +2 -2
- package/lib/esm/components/Properties/PropertyMenu.js.map +1 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.d.ts +3 -1
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js +2 -2
- package/lib/esm/components/Properties/PropertyMenuWithVisualization.js.map +1 -1
- package/lib/esm/components/Properties/PropertyTable.d.ts +2 -1
- package/lib/esm/components/Properties/PropertyTable.js +3 -2
- package/lib/esm/components/Properties/PropertyTable.js.map +1 -1
- package/lib/esm/components/context/GroupHilitedElementsContext.d.ts +14 -0
- package/lib/esm/components/context/GroupHilitedElementsContext.js +10 -0
- package/lib/esm/components/context/GroupHilitedElementsContext.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +1 -0
- package/lib/esm/grouping-mapping-widget.js +1 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupsVisualization.js","sourceRoot":"","sources":["../../../../src/components/Groups/GroupsVisualization.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC7H,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzJ,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,w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,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B;QACvC,oBAAC,yBAAyB,IACxB,QAAQ,EAAE,CAAC,CAAC,uBAAuB,IAAI,eAAe,IAAI,oBAAoB,CAAC,EAC/E,sBAAsB,EAAE,uBAAuB,EAC/C,0BAA0B,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EACvE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,uBAAuB,EAAE,uBAAuB,GAChD;QACF,oBAAC,MAAM,IACL,kBAAkB,EAAE,QAAQ,EAC5B,eAAe,EAAE,UAAU,EAC3B,qBAAqB,EAAE,0BAA0B,EACjD,OAAO,EAAE,OAAO,KACZ,IAAI,EACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,eAAe,EACtB,eAAe,EAAE,eAAe,EAChC,gCAAgC,EAAE,gCAAgC,EAClE,mBAAmB,EAAE,mBAAmB,GACxC,CACE,CACP,CAAC;AACJ,CAAC,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 type { GroupMinimal } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { OverlappedElementGroupPairs } from \"../context/GroupHilitedElementsContext\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport { generateOverlappedGroups, hideGroupConsideringOverlaps, hideGroupIds, visualizeGroupColors } from \"./groupsHelpers\";\nimport { clearEmphasizedElements, clearEmphasizedOverriddenElements, clearHiddenElements, hideElements, zoomToElements } from \"../../common/viewerUtils\";\nimport type { GroupsProps } from \"./Groups\";\nimport { Groups } from \"./Groups\";\nimport { GroupColorLegend } from \"./GroupColorLegend\";\nimport { GroupVisualizationActions } from \"./GroupsVisualizationActions\";\nimport { GroupsShowHideButtons } from \"./GroupsShowHideButtons\";\nimport \"./GroupsVisualization.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { ActionButtonRenderer, ActionButtonRendererProps } from \"./GroupsView\";\nimport { Alert, Icon, Text } from \"@itwin/itwinui-react\";\nimport { SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useFetchGroups } from \"./hooks/useFetchGroups\";\nimport { useKeySetHiliteQueries } from \"./hooks/useKeySetHiliteQueries\";\nimport { useGroupsClient } from \"../context/GroupsClientContext\";\n\n/**\n * Props for the {@link GroupsVisualization} component.\n * @public\n */\nexport interface GroupsVisualizationProps extends GroupsProps {\n isNonEmphasizedSelectable?: boolean;\n emphasizeElements?: boolean;\n hideVisualizationToggle?: boolean;\n hideRefreshIcon?: boolean;\n deleteConfirmationContentFactory?: (group: GroupMinimal) => JSX.Element;\n groupDeleteCallback?: (group: GroupMinimal) => void;\n}\n\n/**\n * Component to visualize groups and their elements.\n * @public\n */\nexport const GroupsVisualization = ({\n emphasizeElements = true,\n isNonEmphasizedSelectable = false,\n onClickGroupModify,\n onClickAddGroup,\n mapping,\n hideVisualizationToggle,\n hideRefreshIcon,\n deleteConfirmationContentFactory,\n groupDeleteCallback,\n ...rest\n}: GroupsVisualizationProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [isAlertClosed, setIsAlertClosed] = useState<boolean>(true);\n const [isAlertExpanded, setIsAlertExpanded] = useState<boolean>(false);\n const {\n hiddenGroupsIds,\n showGroupColor,\n setShowGroupColor,\n isOverlappedColored,\n setHiddenGroupsIds,\n setNumberOfVisualizedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n } = useGroupHilitedElementsContext();\n const { getAccessToken } = useGroupingMappingApiConfig();\n const groupsClient = useGroupsClient();\n const { data: groups, isFetched: isGroupsFetched, isFetching: isGroupsFetching } = useFetchGroups(mapping.id, getAccessToken, groupsClient);\n const isMounted = useIsMounted();\n const [enableGroupQueries, setEnableGroupQueries] = useState<boolean>(false);\n const { groupQueries } = useKeySetHiliteQueries(groups ?? [], enableGroupQueries, iModelConnection);\n\n const triggerVisualization = useCallback(\n async (groupsWithGroupedOverlaps: OverlappedElementGroupPairs[]) =>\n visualizeGroupColors(hiddenGroupsIds, groupsWithGroupedOverlaps, setNumberOfVisualizedGroups, emphasizeElements),\n [emphasizeElements, hiddenGroupsIds, setNumberOfVisualizedGroups],\n );\n\n const zoomToElementsMutation = useMutation({\n mutationFn: zoomToElements,\n onSuccess: () => {\n if (isMounted) {\n isNonEmphasizedSelectable && clearEmphasizedElements();\n }\n },\n });\n\n const visualizationMutation = useMutation({\n mutationFn: triggerVisualization,\n onSuccess: (allIds) => {\n if (isMounted) {\n zoomToElementsMutation.mutate(allIds);\n }\n },\n });\n\n const isGroupsQueriesReady = useMemo(() => groupQueries.every((query) => query.isFetched && query.data) && groupQueries.length > 0, [groupQueries]);\n const groupQueriesProgressCount = useMemo(() => groupQueries.filter((query) => query.isFetched).length, [groupQueries]);\n const isResolvingGroupQueries = useMemo(() => groupQueries.some((query) => query.isFetching), [groupQueries]);\n\n const hiliteIds = useMemo(() => {\n if (!isGroupsQueriesReady || !groups) return [];\n\n // Map to track which groups have been processed for each query to ensure unique associations between groups and queries\n const processedGroupIds = new Map<string, string[]>();\n\n return groupQueries.flatMap((query) => {\n // Find all groups that match the current query and haven't been processed yet for this query\n const matchingGroups = groups.filter((group) => {\n const isMatch = group.query === query.data!.query;\n const isProcessed = processedGroupIds.get(query.data!.query)?.includes(group.id);\n return isMatch && !isProcessed;\n });\n\n matchingGroups.forEach((group) => {\n const existingGroupIds = processedGroupIds.get(query.data!.query);\n if (existingGroupIds) {\n existingGroupIds.push(group.id);\n } else {\n processedGroupIds.set(query.data!.query, [group.id]);\n }\n });\n\n // Map each matching group to an object with groupId and elementIds\n return matchingGroups.map((group) => ({\n groupId: group.id,\n elementIds: query.data!.result.ids,\n }));\n });\n }, [groupQueries, isGroupsQueriesReady, groups]);\n\n const getHiliteIdsFromGroupsWrapper = useCallback(\n (groups: GroupMinimal[]) => hiliteIds.filter((id) => groups.some((group) => group.id === id.groupId)).flatMap((id) => id.elementIds),\n [hiliteIds],\n );\n\n useEffect(() => {\n const processOverlappedGroups = async () => {\n const results = generateOverlappedGroups(hiliteIds);\n const { groupsWithGroupedOverlaps, overlappedElementsInfo, numberOfElementsInGroups } = results;\n\n setOverlappedElementsMetadata({\n overlappedElementsInfo,\n groupElementsInfo: numberOfElementsInGroups,\n overlappedElementGroupPairs: groupsWithGroupedOverlaps,\n });\n\n if (showGroupColor) {\n await visualizationMutation.mutateAsync(groupsWithGroupedOverlaps);\n } else {\n clearEmphasizedOverriddenElements();\n }\n\n clearHiddenElements();\n hideGroupIds(hiddenGroupsIds, groupsWithGroupedOverlaps);\n };\n\n const shouldProcessOverlappedGroups = () => !isOverlappedColored && hiliteIds.length > 0 && !isGroupsFetching;\n\n if (shouldProcessOverlappedGroups()) {\n void processOverlappedGroups();\n }\n // We don't want to trigger full visualization when toggling individual groups.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showGroupColor, isOverlappedColored, hiliteIds]);\n\n useEffect(() => {\n if (isVisualizationsEnabled) {\n setEnableGroupQueries(true);\n } else {\n setShowGroupColor(false);\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }\n }, [isVisualizationsEnabled, setHiddenGroupsIds, setIsVisualizationsEnabled, setShowGroupColor]);\n\n useEffect(() => {\n if (hideVisualizationToggle) {\n setIsVisualizationsEnabled(true);\n }\n }, [hideVisualizationToggle, setIsVisualizationsEnabled]);\n\n const hideAllGroups = useCallback(() => {\n if (!groups) return;\n hideElements(getHiliteIdsFromGroupsWrapper(groups));\n }, [getHiliteIdsFromGroupsWrapper, groups]);\n\n const hideSingleGroupWrapper = useCallback(\n (groupToHide: GroupMinimal) => {\n hideGroupConsideringOverlaps(overlappedElementsMetadata.overlappedElementGroupPairs, groupToHide.id, hiddenGroupsIds);\n },\n [hiddenGroupsIds, overlappedElementsMetadata.overlappedElementGroupPairs],\n );\n\n const showGroup = useCallback(\n (viewGroup: GroupMinimal) => {\n if (!groups) return;\n clearHiddenElements();\n\n // hide group Ids filter\n const newHiddenGroups: GroupMinimal[] = groups.filter((g) => hiddenGroupsIds.has(g.id) && g.id !== viewGroup.id);\n\n // view group Ids filter\n const viewGroups = groups.filter((g) => !hiddenGroupsIds.has(g.id) || g.id === viewGroup.id);\n const viewIds = getHiliteIdsFromGroupsWrapper(viewGroups);\n\n let hiddenIds = getHiliteIdsFromGroupsWrapper(newHiddenGroups);\n hiddenIds = hiddenIds.filter((id) => !viewIds.includes(id));\n hideElements(hiddenIds);\n },\n [groups, hiddenGroupsIds, getHiliteIdsFromGroupsWrapper],\n );\n\n const showAll = useCallback(() => {\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }, [setHiddenGroupsIds]);\n\n const hideAll = useCallback(() => {\n if (!groups) return;\n hideAllGroups();\n setHiddenGroupsIds(new Set(groups.map((g) => g.id)));\n }, [setHiddenGroupsIds, groups, hideAllGroups]);\n\n const onModify = useCallback(\n (group: GroupMinimal, type: string) => {\n if (!onClickGroupModify) return;\n if (group.id && hiddenGroupsIds.has(group.id)) {\n showGroup(group);\n setHiddenGroupsIds(new Set([...hiddenGroupsIds].filter((id) => id !== group.id)));\n }\n clearEmphasizedElements();\n onClickGroupModify(group, type);\n },\n [hiddenGroupsIds, onClickGroupModify, setHiddenGroupsIds, showGroup],\n );\n\n const onAddGroup = useCallback(\n (type: string) => {\n if (!onClickAddGroup) return;\n onClickAddGroup(type);\n clearEmphasizedElements();\n },\n [onClickAddGroup],\n );\n\n const groupActionButtonRenderers: ActionButtonRenderer[] = useMemo(\n () =>\n isVisualizationsEnabled\n ? [\n (props: ActionButtonRendererProps) => (showGroupColor ? <GroupColorLegend {...props} groups={groups ?? []} /> : []),\n (props: ActionButtonRendererProps) => (\n <GroupsShowHideButtons\n {...props}\n isLoadingQuery={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n showGroup={showGroup}\n hideGroup={hideSingleGroupWrapper}\n />\n ),\n ].flat()\n : [],\n [groups, hideSingleGroupWrapper, isGroupsFetched, isGroupsQueriesReady, isVisualizationsEnabled, showGroup, showGroupColor],\n );\n\n const overlappedAlert = useMemo(\n () =>\n overlappedElementsMetadata.overlappedElementsInfo.size > 0 && isAlertClosed && showGroupColor ? (\n <Alert\n onClose={() => setIsAlertClosed(false)}\n clickableText={isAlertExpanded ? \"Less Details\" : \"More Details\"}\n clickableTextProps={{ onClick: () => setIsAlertExpanded(!isAlertExpanded) }}\n >\n Overlapping elements are colored <Text className=\"gmw-red-text\">red</Text> in the viewer.\n {isAlertExpanded ? (\n <>\n <br />\n To get overlap info in detail, click the{\" \"}\n <Icon>\n <SvgMore />\n </Icon>{\" \"}\n button then “Overlap Info”\n </>\n ) : undefined}\n </Alert>\n ) : undefined,\n [isAlertClosed, isAlertExpanded, overlappedElementsMetadata.overlappedElementsInfo.size, showGroupColor],\n );\n\n const progressConfig = useMemo(\n () =>\n isVisualizationsEnabled && isResolvingGroupQueries\n ? {\n hilitedGroupsProgress: {\n currentHilitedGroups: groupQueriesProgressCount,\n totalNumberOfGroups: groups?.length ?? 0,\n },\n }\n : undefined,\n [groupQueriesProgressCount, groups, isResolvingGroupQueries, isVisualizationsEnabled],\n );\n\n return (\n <div className=\"gmw-groups-vis-container\">\n <GroupVisualizationActions\n disabled={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n isVisualizationEnabled={isVisualizationsEnabled}\n onClickVisualizationButton={() => setIsVisualizationsEnabled((b) => !b)}\n showAll={showAll}\n hideAll={hideAll}\n hideVisualizationToggle={hideVisualizationToggle}\n />\n <Groups\n onClickGroupModify={onModify}\n onClickAddGroup={onAddGroup}\n actionButtonRenderers={groupActionButtonRenderers}\n mapping={mapping}\n {...rest}\n progressConfig={progressConfig}\n alert={overlappedAlert}\n hideRefreshIcon={hideRefreshIcon}\n deleteConfirmationContentFactory={deleteConfirmationContentFactory}\n groupDeleteCallback={groupDeleteCallback}\n />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupsVisualization.js","sourceRoot":"","sources":["../../../../src/components/Groups/GroupsVisualization.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,4BAA4B,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5I,OAAO,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAEzJ,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB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,SAAS,EACf,CAAC,aAAa,EAAE,eAAe,EAAE,0BAA0B,CAAC,sBAAsB,CAAC,IAAI,EAAE,cAAc,CAAC,CACzG,CAAC;IAEF,MAAM,cAAc,GAAG,OAAO,CAC5B,GAAG,EAAE,CACH,uBAAuB,IAAI,uBAAuB;QAChD,CAAC,CAAC;YACE,qBAAqB,EAAE;gBACrB,oBAAoB,EAAE,yBAAyB;gBAC/C,mBAAmB,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;aACzC;SACF;QACH,CAAC,CAAC,SAAS,EACf,CAAC,yBAAyB,EAAE,MAAM,EAAE,uBAAuB,EAAE,uBAAuB,CAAC,CACtF,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAC,0BAA0B;QACvC,oBAAC,yBAAyB,IACxB,QAAQ,EAAE,CAAC,CAAC,uBAAuB,IAAI,eAAe,IAAI,oBAAoB,CAAC,EAC/E,sBAAsB,EAAE,uBAAuB,EAC/C,0BAA0B,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EACvE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,uBAAuB,EAAE,uBAAuB,GAChD;QACF,oBAAC,MAAM,IACL,kBAAkB,EAAE,QAAQ,EAC5B,eAAe,EAAE,UAAU,EAC3B,qBAAqB,EAAE,0BAA0B,EACjD,OAAO,EAAE,OAAO,KACZ,IAAI,EACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,eAAe,EACtB,eAAe,EAAE,eAAe,EAChC,gCAAgC,EAAE,gCAAgC,EAClE,mBAAmB,EAAE,mBAAmB,GACxC,CACE,CACP,CAAC;AACJ,CAAC,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 type { GroupMinimal } from \"@itwin/insights-client\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport type { OverlappedElementGroupPairs } from \"../context/GroupHilitedElementsContext\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\nimport { generateOverlappedGroups, getGroupColor, hideGroupConsideringOverlaps, hideGroupIds, visualizeGroupColors } from \"./groupsHelpers\";\nimport { clearEmphasizedElements, clearEmphasizedOverriddenElements, clearHiddenElements, hideElements, zoomToElements } from \"../../common/viewerUtils\";\nimport type { GroupsProps } from \"./Groups\";\nimport { Groups } from \"./Groups\";\nimport { GroupColorLegend } from \"./GroupColorLegend\";\nimport { GroupVisualizationActions } from \"./GroupsVisualizationActions\";\nimport { GroupsShowHideButtons } from \"./GroupsShowHideButtons\";\nimport \"./GroupsVisualization.scss\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { ActionButtonRenderer, ActionButtonRendererProps } from \"./GroupsView\";\nimport { Alert, Icon, Text } from \"@itwin/itwinui-react\";\nimport { SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useFetchGroups } from \"./hooks/useFetchGroups\";\nimport { useKeySetHiliteQueries } from \"./hooks/useKeySetHiliteQueries\";\nimport { useGroupsClient } from \"../context/GroupsClientContext\";\n\n/**\n * Props for the {@link GroupsVisualization} component.\n * @public\n */\nexport interface GroupsVisualizationProps extends GroupsProps {\n isNonEmphasizedSelectable?: boolean;\n emphasizeElements?: boolean;\n hideVisualizationToggle?: boolean;\n hideRefreshIcon?: boolean;\n deleteConfirmationContentFactory?: (group: GroupMinimal) => JSX.Element;\n groupDeleteCallback?: (group: GroupMinimal) => void;\n disableZoom?: boolean;\n}\n\n/**\n * Component to visualize groups and their elements.\n * @public\n */\nexport const GroupsVisualization = ({\n emphasizeElements = true,\n isNonEmphasizedSelectable = false,\n onClickGroupModify,\n onClickAddGroup,\n mapping,\n hideVisualizationToggle,\n hideRefreshIcon,\n deleteConfirmationContentFactory,\n groupDeleteCallback,\n disableZoom,\n ...rest\n}: GroupsVisualizationProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const [isAlertClosed, setIsAlertClosed] = useState<boolean>(true);\n const [isAlertExpanded, setIsAlertExpanded] = useState<boolean>(false);\n const {\n hiddenGroupsIds,\n showGroupColor,\n setShowGroupColor,\n isOverlappedColored,\n setHiddenGroupsIds,\n setNumberOfVisualizedGroups,\n isVisualizationsEnabled,\n setIsVisualizationsEnabled,\n overlappedElementsMetadata,\n setOverlappedElementsMetadata,\n groupColors,\n setGroupColors,\n } = useGroupHilitedElementsContext();\n const { getAccessToken } = useGroupingMappingApiConfig();\n const groupsClient = useGroupsClient();\n const { data: groups, isFetched: isGroupsFetched, isFetching: isGroupsFetching } = useFetchGroups(mapping.id, getAccessToken, groupsClient);\n const isMounted = useIsMounted();\n const [enableGroupQueries, setEnableGroupQueries] = useState<boolean>(false);\n const { groupQueries } = useKeySetHiliteQueries(groups ?? [], enableGroupQueries, iModelConnection);\n\n const triggerVisualization = useCallback(\n async (groupsWithGroupedOverlaps: OverlappedElementGroupPairs[]) =>\n visualizeGroupColors(hiddenGroupsIds, groupsWithGroupedOverlaps, setNumberOfVisualizedGroups, emphasizeElements),\n [emphasizeElements, hiddenGroupsIds, setNumberOfVisualizedGroups],\n );\n\n const zoomToElementsMutation = useMutation({\n mutationFn: zoomToElements,\n onSuccess: () => {\n if (isMounted) {\n isNonEmphasizedSelectable && clearEmphasizedElements();\n }\n },\n });\n\n const visualizationMutation = useMutation({\n mutationFn: triggerVisualization,\n onSuccess: (allIds) => {\n if (isMounted && !disableZoom) {\n zoomToElementsMutation.mutate(allIds);\n }\n },\n });\n\n const isGroupsQueriesReady = useMemo(() => groupQueries.every((query) => query.isFetched && query.data) && groupQueries.length > 0, [groupQueries]);\n const groupQueriesProgressCount = useMemo(() => groupQueries.filter((query) => query.isFetched).length, [groupQueries]);\n const isResolvingGroupQueries = useMemo(() => groupQueries.some((query) => query.isFetching), [groupQueries]);\n\n const hiliteIds = useMemo(() => {\n if (!isGroupsQueriesReady || !groups) return [];\n\n // Map to track which groups have been processed for each query to ensure unique associations between groups and queries\n const processedGroupIds = new Map<string, string[]>();\n\n return groupQueries.flatMap((query) => {\n // Find all groups that match the current query and haven't been processed yet for this query\n const matchingGroups = groups.filter((group) => {\n const isMatch = group.query === query.data!.query;\n const isProcessed = processedGroupIds.get(query.data!.query)?.includes(group.id);\n return isMatch && !isProcessed;\n });\n\n matchingGroups.forEach((group) => {\n const existingGroupIds = processedGroupIds.get(query.data!.query);\n if (existingGroupIds) {\n existingGroupIds.push(group.id);\n } else {\n processedGroupIds.set(query.data!.query, [group.id]);\n }\n });\n\n // Map each matching group to an object with groupId and elementIds\n return matchingGroups.map((group) => ({\n groupId: group.id,\n elementIds: query.data!.result.ids,\n }));\n });\n }, [groupQueries, isGroupsQueriesReady, groups]);\n\n const getHiliteIdsFromGroupsWrapper = useCallback(\n (groups: GroupMinimal[]) => hiliteIds.filter((id) => groups.some((group) => group.id === id.groupId)).flatMap((id) => id.elementIds),\n [hiliteIds],\n );\n\n useEffect(() => {\n const processOverlappedGroups = async () => {\n const results = generateOverlappedGroups(hiliteIds);\n const { groupsWithGroupedOverlaps, overlappedElementsInfo, numberOfElementsInGroups } = results;\n\n setOverlappedElementsMetadata({\n overlappedElementsInfo,\n groupElementsInfo: numberOfElementsInGroups,\n overlappedElementGroupPairs: groupsWithGroupedOverlaps,\n });\n\n if (showGroupColor) {\n await visualizationMutation.mutateAsync(groupsWithGroupedOverlaps);\n } else {\n clearEmphasizedOverriddenElements();\n }\n\n clearHiddenElements();\n hideGroupIds(hiddenGroupsIds, groupsWithGroupedOverlaps);\n };\n\n const shouldProcessOverlappedGroups = () => !isOverlappedColored && hiliteIds.length > 0 && !isGroupsFetching;\n\n if (shouldProcessOverlappedGroups()) {\n void processOverlappedGroups();\n }\n // We don't want to trigger full visualization when toggling individual groups.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showGroupColor, isOverlappedColored, hiliteIds]);\n\n useEffect(() => {\n if (isVisualizationsEnabled) {\n setEnableGroupQueries(true);\n } else {\n setShowGroupColor(false);\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }\n }, [isVisualizationsEnabled, setHiddenGroupsIds, setIsVisualizationsEnabled, setShowGroupColor]);\n\n useEffect(() => {\n if (hideVisualizationToggle) {\n setIsVisualizationsEnabled(true);\n }\n }, [hideVisualizationToggle, setIsVisualizationsEnabled]);\n\n const hideAllGroups = useCallback(() => {\n if (!groups) return;\n hideElements(getHiliteIdsFromGroupsWrapper(groups));\n }, [getHiliteIdsFromGroupsWrapper, groups]);\n\n const hideSingleGroupWrapper = useCallback(\n (groupToHide: GroupMinimal) => {\n hideGroupConsideringOverlaps(overlappedElementsMetadata.overlappedElementGroupPairs, groupToHide.id, hiddenGroupsIds);\n },\n [hiddenGroupsIds, overlappedElementsMetadata.overlappedElementGroupPairs],\n );\n\n const showGroup = useCallback(\n (viewGroup: GroupMinimal) => {\n if (!groups) return;\n clearHiddenElements();\n\n // hide group Ids filter\n const newHiddenGroups: GroupMinimal[] = groups.filter((g) => hiddenGroupsIds.has(g.id) && g.id !== viewGroup.id);\n\n // view group Ids filter\n const viewGroups = groups.filter((g) => !hiddenGroupsIds.has(g.id) || g.id === viewGroup.id);\n const viewIds = getHiliteIdsFromGroupsWrapper(viewGroups);\n\n let hiddenIds = getHiliteIdsFromGroupsWrapper(newHiddenGroups);\n hiddenIds = hiddenIds.filter((id) => !viewIds.includes(id));\n hideElements(hiddenIds);\n },\n [groups, hiddenGroupsIds, getHiliteIdsFromGroupsWrapper],\n );\n\n const showAll = useCallback(() => {\n clearHiddenElements();\n setHiddenGroupsIds(new Set());\n }, [setHiddenGroupsIds]);\n\n const hideAll = useCallback(() => {\n if (!groups) return;\n hideAllGroups();\n setHiddenGroupsIds(new Set(groups.map((g) => g.id)));\n }, [setHiddenGroupsIds, groups, hideAllGroups]);\n\n const onModify = useCallback(\n (group: GroupMinimal, type: string) => {\n if (!onClickGroupModify) return;\n if (group.id && hiddenGroupsIds.has(group.id)) {\n showGroup(group);\n setHiddenGroupsIds(new Set([...hiddenGroupsIds].filter((id) => id !== group.id)));\n }\n clearEmphasizedElements();\n onClickGroupModify(group, type);\n },\n [hiddenGroupsIds, onClickGroupModify, setHiddenGroupsIds, showGroup],\n );\n\n const onAddGroup = useCallback(\n (type: string) => {\n if (!onClickAddGroup) return;\n onClickAddGroup(type);\n clearEmphasizedElements();\n },\n [onClickAddGroup],\n );\n\n useEffect(() => {\n if (isGroupsFetched) {\n setGroupColors(new Map(groups?.map((g, i) => [g.id, getGroupColor(i)]) ?? []));\n }\n }, [groups, isGroupsFetched, setGroupColors]);\n\n const groupActionButtonRenderers: ActionButtonRenderer[] = useMemo(\n () =>\n isVisualizationsEnabled\n ? [\n (props: ActionButtonRendererProps) => (showGroupColor ? <GroupColorLegend backgroundColor={groupColors.get(props.group.id) ?? \"\"} /> : []),\n (props: ActionButtonRendererProps) => (\n <GroupsShowHideButtons\n {...props}\n isLoadingQuery={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n showGroup={showGroup}\n hideGroup={hideSingleGroupWrapper}\n />\n ),\n ].flat()\n : [],\n [hideSingleGroupWrapper, isGroupsFetched, isGroupsQueriesReady, isVisualizationsEnabled, showGroup, showGroupColor, groupColors],\n );\n\n const overlappedAlert = useMemo(\n () =>\n overlappedElementsMetadata.overlappedElementsInfo.size > 0 && isAlertClosed && showGroupColor ? (\n <Alert\n onClose={() => setIsAlertClosed(false)}\n clickableText={isAlertExpanded ? \"Less Details\" : \"More Details\"}\n clickableTextProps={{ onClick: () => setIsAlertExpanded(!isAlertExpanded) }}\n >\n Overlapping elements are colored <Text className=\"gmw-red-text\">red</Text> in the viewer.\n {isAlertExpanded ? (\n <>\n <br />\n To get overlap info in detail, click the{\" \"}\n <Icon>\n <SvgMore />\n </Icon>{\" \"}\n button then “Overlap Info”\n </>\n ) : undefined}\n </Alert>\n ) : undefined,\n [isAlertClosed, isAlertExpanded, overlappedElementsMetadata.overlappedElementsInfo.size, showGroupColor],\n );\n\n const progressConfig = useMemo(\n () =>\n isVisualizationsEnabled && isResolvingGroupQueries\n ? {\n hilitedGroupsProgress: {\n currentHilitedGroups: groupQueriesProgressCount,\n totalNumberOfGroups: groups?.length ?? 0,\n },\n }\n : undefined,\n [groupQueriesProgressCount, groups, isResolvingGroupQueries, isVisualizationsEnabled],\n );\n\n return (\n <div className=\"gmw-groups-vis-container\">\n <GroupVisualizationActions\n disabled={!(isVisualizationsEnabled && isGroupsFetched && isGroupsQueriesReady)}\n isVisualizationEnabled={isVisualizationsEnabled}\n onClickVisualizationButton={() => setIsVisualizationsEnabled((b) => !b)}\n showAll={showAll}\n hideAll={hideAll}\n hideVisualizationToggle={hideVisualizationToggle}\n />\n <Groups\n onClickGroupModify={onModify}\n onClickAddGroup={onAddGroup}\n actionButtonRenderers={groupActionButtonRenderers}\n mapping={mapping}\n {...rest}\n progressConfig={progressConfig}\n alert={overlappedAlert}\n hideRefreshIcon={hideRefreshIcon}\n deleteConfirmationContentFactory={deleteConfirmationContentFactory}\n groupDeleteCallback={groupDeleteCallback}\n />\n </div>\n );\n};\n"]}
|
|
@@ -4,6 +4,7 @@ import type { GroupMinimal } from "@itwin/insights-client";
|
|
|
4
4
|
export declare type GroupColorToggleProps = Partial<ToggleSwitchProps> & {
|
|
5
5
|
color: string;
|
|
6
6
|
group: GroupMinimal;
|
|
7
|
+
disableZoom?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export declare const GroupColorToggle: ({ color, group, ...rest }: GroupColorToggleProps) => JSX.Element;
|
|
9
|
+
export declare const GroupColorToggle: ({ color, group, disableZoom, ...rest }: GroupColorToggleProps) => JSX.Element;
|
|
9
10
|
//# sourceMappingURL=GroupColorToggle.d.ts.map
|
|
@@ -11,12 +11,14 @@ import { useGroupKeySetQuery } from "../Groups/hooks/useKeySetHiliteQueries";
|
|
|
11
11
|
import { usePropertiesGroupColorContext } from "../context/PropertiesGroupColorContext";
|
|
12
12
|
import { useMutation } from "@tanstack/react-query";
|
|
13
13
|
import { useIsMounted } from "../../common/hooks/useIsMounted";
|
|
14
|
-
|
|
14
|
+
import { useGroupHilitedElementsContext } from "../context/GroupHilitedElementsContext";
|
|
15
|
+
export const GroupColorToggle = ({ color, group, disableZoom, ...rest }) => {
|
|
15
16
|
const { iModelConnection } = useGroupingMappingApiConfig();
|
|
16
17
|
if (!iModelConnection) {
|
|
17
18
|
throw new Error("This component requires an active iModelConnection.");
|
|
18
19
|
}
|
|
19
20
|
const { showGroupColor, setShowGroupColor } = usePropertiesGroupColorContext();
|
|
21
|
+
const { showGroupColor: isGroupsVisualizationOn } = useGroupHilitedElementsContext();
|
|
20
22
|
const { data: hiliteIdsResult, isFetched, isFetching } = useGroupKeySetQuery(group, iModelConnection, showGroupColor);
|
|
21
23
|
const isMounted = useIsMounted();
|
|
22
24
|
const { mutate: mutateVisualization, isLoading: isVisualizing } = useMutation({
|
|
@@ -24,7 +26,9 @@ export const GroupColorToggle = ({ color, group, ...rest }) => {
|
|
|
24
26
|
clearAll();
|
|
25
27
|
Presentation.selection.clearSelection("GroupingMappingWidget", iModelConnection);
|
|
26
28
|
visualizeElements(hiliteIds.result.ids, color);
|
|
27
|
-
|
|
29
|
+
if (!disableZoom) {
|
|
30
|
+
await zoomToElements(hiliteIds.result.ids);
|
|
31
|
+
}
|
|
28
32
|
},
|
|
29
33
|
onError: (error) => {
|
|
30
34
|
toaster.negative("There was an error visualizing group.");
|
|
@@ -35,6 +39,11 @@ export const GroupColorToggle = ({ color, group, ...rest }) => {
|
|
|
35
39
|
useEffect(() => {
|
|
36
40
|
isFetched && showGroupColor && hiliteIdsResult && isMounted && mutateVisualization(hiliteIdsResult);
|
|
37
41
|
}, [hiliteIdsResult, isFetched, isMounted, showGroupColor, mutateVisualization]);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (isGroupsVisualizationOn) {
|
|
44
|
+
setShowGroupColor(true);
|
|
45
|
+
}
|
|
46
|
+
}, [isGroupsVisualizationOn, setShowGroupColor]);
|
|
38
47
|
const handleToggleChange = useCallback(() => {
|
|
39
48
|
setShowGroupColor((b) => {
|
|
40
49
|
if (b) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupColorToggle.js","sourceRoot":"","sources":["../../../../src/components/Properties/GroupColorToggle.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAA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KAAK,CAAC,CAAC;YAC/C,IAAI,CAAC,WAAW,EAAE;gBAChB,MAAM,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAC5C;QACH,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,CAAC,QAAQ,CAAC,uCAAuC,CAAC,CAAC;YAC1D,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;KACF,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,IAAI,cAAc,IAAI,eAAe,IAAI,SAAS,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACtG,CAAC,EAAE,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAEjF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,uBAAuB,EAAE;YAC3B,iBAAiB,CAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC,EAAE,CAAC,uBAAuB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEjD,MAAM,kBAAkB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC1C,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;YACtB,IAAI,CAAC,EAAE;gBACL,QAAQ,EAAE,CAAC;aACZ;YACD,OAAO,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,MAAM,SAAS,GAAG,UAAU,IAAI,aAAa,CAAC;IAE9C,OAAO,oBAAC,YAAY,IAAC,KAAK,EAAC,aAAa,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,KAAM,IAAI,GAAiB,CAAC;AACjJ,CAAC,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, { useCallback, useEffect } from \"react\";\nimport type { ToggleSwitchProps } from \"@itwin/itwinui-react\";\nimport { toaster, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport type { GroupMinimal } from \"@itwin/insights-client\";\nimport { clearAll, visualizeElements, zoomToElements } from \"../../common/viewerUtils\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { QueryResults } from \"../Groups/hooks/useKeySetHiliteQueries\";\nimport { useGroupKeySetQuery } from \"../Groups/hooks/useKeySetHiliteQueries\";\nimport { usePropertiesGroupColorContext } from \"../context/PropertiesGroupColorContext\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { useIsMounted } from \"../../common/hooks/useIsMounted\";\nimport { useGroupHilitedElementsContext } from \"../context/GroupHilitedElementsContext\";\n\nexport type GroupColorToggleProps = Partial<ToggleSwitchProps> & {\n color: string;\n group: GroupMinimal;\n disableZoom?: boolean;\n};\n\nexport const GroupColorToggle = ({ color, group, disableZoom, ...rest }: GroupColorToggleProps) => {\n const { iModelConnection } = useGroupingMappingApiConfig();\n if (!iModelConnection) {\n throw new Error(\"This component requires an active iModelConnection.\");\n }\n const { showGroupColor, setShowGroupColor } = usePropertiesGroupColorContext();\n const { showGroupColor: isGroupsVisualizationOn } = useGroupHilitedElementsContext();\n const { data: hiliteIdsResult, isFetched, isFetching } = useGroupKeySetQuery(group, iModelConnection, showGroupColor);\n const isMounted = useIsMounted();\n\n const { mutate: mutateVisualization, isLoading: isVisualizing } = useMutation({\n mutationFn: async (hiliteIds: QueryResults) => {\n clearAll();\n Presentation.selection.clearSelection(\"GroupingMappingWidget\", iModelConnection);\n visualizeElements(hiliteIds.result.ids, color);\n if (!disableZoom) {\n await zoomToElements(hiliteIds.result.ids);\n }\n },\n onError: (error) => {\n toaster.negative(\"There was an error visualizing group.\");\n // eslint-disable-next-line no-console\n console.error(error);\n },\n });\n\n useEffect(() => {\n isFetched && showGroupColor && hiliteIdsResult && isMounted && mutateVisualization(hiliteIdsResult);\n }, [hiliteIdsResult, isFetched, isMounted, showGroupColor, mutateVisualization]);\n\n useEffect(() => {\n if (isGroupsVisualizationOn) {\n setShowGroupColor(true);\n }\n }, [isGroupsVisualizationOn, setShowGroupColor]);\n\n const handleToggleChange = useCallback(() => {\n setShowGroupColor((b) => {\n if (b) {\n clearAll();\n }\n return !b;\n });\n }, [setShowGroupColor]);\n\n const isLoading = isFetching || isVisualizing;\n\n return <ToggleSwitch label=\"Color Group\" disabled={isLoading} checked={showGroupColor} onChange={handleToggleChange} {...rest}></ToggleSwitch>;\n};\n"]}
|
|
@@ -10,6 +10,7 @@ export interface GroupPropertyTableProps {
|
|
|
10
10
|
groupProperties: Property[];
|
|
11
11
|
refresh: () => Promise<void>;
|
|
12
12
|
hideRefreshIcon?: boolean;
|
|
13
|
+
onGroupPropertyDelete?: () => void;
|
|
13
14
|
}
|
|
14
|
-
export declare const GroupPropertyTable: ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, groupProperties, refresh, hideRefreshIcon, }: GroupPropertyTableProps) => JSX.Element;
|
|
15
|
+
export declare const GroupPropertyTable: ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, groupProperties, refresh, hideRefreshIcon, onGroupPropertyDelete, }: GroupPropertyTableProps) => JSX.Element;
|
|
15
16
|
//# sourceMappingURL=GroupPropertyTable.d.ts.map
|
|
@@ -10,7 +10,7 @@ import { PropertyTable } from "../PropertyTable";
|
|
|
10
10
|
import { useGroupingMappingApiConfig } from "../../context/GroupingApiConfigContext";
|
|
11
11
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
12
12
|
import { usePropertiesClient } from "../../context/PropertiesClientContext";
|
|
13
|
-
export const GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, groupProperties, refresh, hideRefreshIcon, }) => {
|
|
13
|
+
export const GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModify, isLoading, groupProperties, refresh, hideRefreshIcon, onGroupPropertyDelete, }) => {
|
|
14
14
|
const propertiesClient = usePropertiesClient();
|
|
15
15
|
const { getAccessToken, iModelId } = useGroupingMappingApiConfig();
|
|
16
16
|
const queryClient = useQueryClient();
|
|
@@ -62,6 +62,6 @@ export const GroupPropertyTable = ({ mappingId, groupId, onClickAdd, onClickModi
|
|
|
62
62
|
await queryClient.invalidateQueries({ queryKey: ["properties", iModelId, mappingId, groupId] });
|
|
63
63
|
},
|
|
64
64
|
});
|
|
65
|
-
return (React.createElement(PropertyTable, { propertyType: "Group", columnsFactory: columnsFactory, data: groupProperties, isLoading: isLoading, onClickAdd: onClickAdd, refreshProperties: refresh, deleteProperty: deleteProperty, hideRefreshIcon: hideRefreshIcon }));
|
|
65
|
+
return (React.createElement(PropertyTable, { propertyType: "Group", columnsFactory: columnsFactory, data: groupProperties, isLoading: isLoading, onClickAdd: onClickAdd, refreshProperties: refresh, deleteProperty: deleteProperty, hideRefreshIcon: hideRefreshIcon, onGroupPropertyDelete: onGroupPropertyDelete }));
|
|
66
66
|
};
|
|
67
67
|
//# sourceMappingURL=GroupPropertyTable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyTable.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupPropertyTable.js","sourceRoot":"","sources":["../../../../../src/components/Properties/GroupProperties/GroupPropertyTable.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAe5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,SAAS,EACT,OAAO,EACP,UAAU,EACV,aAAa,EACb,SAAS,EACT,eAAe,EACf,OAAO,EACP,eAAe,EACf,qBAAqB,GACG,EAAE,EAAE;IAC5B,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAC;IAC/C,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,2BAA2B,EAAE,CAAC;IACnE,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM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,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;AACJ,CAAC,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 { SvgDelete, SvgEdit, SvgFunction, SvgLabel, SvgMeasure, SvgMore } from \"@itwin/itwinui-icons-react\";\nimport { DropdownMenu, Flex, Icon, IconButton, MenuItem } from \"@itwin/itwinui-react\";\nimport React, { useCallback } from \"react\";\nimport type { CellProps, Column } from \"react-table\";\nimport type { Property } from \"@itwin/insights-client\";\nimport { PropertyNameCell } from \"../PropertyNameCell\";\nimport { PropertyTable } from \"../PropertyTable\";\nimport { useGroupingMappingApiConfig } from \"../../context/GroupingApiConfigContext\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../../context/PropertiesClientContext\";\n\nexport interface GroupPropertyTableProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n onClickAdd?: () => void;\n onClickModify?: (value: Property) => void;\n isLoading: boolean;\n groupProperties: Property[];\n refresh: () => Promise<void>;\n hideRefreshIcon?: boolean;\n onGroupPropertyDelete?: () => void;\n}\n\nexport const GroupPropertyTable = ({\n mappingId,\n groupId,\n onClickAdd,\n onClickModify,\n isLoading,\n groupProperties,\n refresh,\n hideRefreshIcon,\n onGroupPropertyDelete,\n}: GroupPropertyTableProps) => {\n const propertiesClient = usePropertiesClient();\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const queryClient = useQueryClient();\n\n const columnsFactory = useCallback(\n (handleShowDeleteModal: (value: Property) => void): Column<Property>[] => [\n {\n id: \"propertyName\",\n accessor: \"propertyName\",\n Cell: (value: CellProps<Property>) => <PropertyNameCell property={value.row.original} onClickModify={onClickModify} />,\n },\n {\n id: \"propertyTypeIcons\",\n Cell: (value: CellProps<Property>) => (\n <Flex flexDirection={\"row\"} gap=\"xs\">\n <Icon fill={value.row.original.ecProperties ? \"informational\" : \"default\"}>\n <SvgLabel />\n </Icon>\n <Icon fill={value.row.original.calculatedPropertyType ? \"informational\" : \"default\"}>\n <SvgMeasure />\n </Icon>\n <Icon fill={value.row.original.formula ? \"informational\" : \"default\"}>\n <SvgFunction />\n </Icon>\n </Flex>\n ),\n },\n {\n id: \"dropdown\",\n width: 80,\n Cell: (value: CellProps<Property>) => {\n return (\n <DropdownMenu\n menuItems={(close: () => void) =>\n [\n onClickModify\n ? [\n <MenuItem\n key={0}\n onClick={() => {\n onClickModify(value.row.original);\n close();\n }}\n icon={<SvgEdit />}\n >\n Modify\n </MenuItem>,\n ]\n : [],\n <MenuItem\n key={1}\n onClick={() => {\n handleShowDeleteModal(value.row.original);\n close();\n }}\n icon={<SvgDelete />}\n >\n Remove\n </MenuItem>,\n ].flatMap((p) => p)\n }\n >\n <IconButton styleType=\"borderless\" title=\"Property Options\">\n <SvgMore />\n </IconButton>\n </DropdownMenu>\n );\n },\n },\n ],\n [onClickModify],\n );\n\n const { mutateAsync: deleteProperty } = useMutation({\n mutationFn: async (propertyId: string) => {\n const accessToken = await getAccessToken();\n await propertiesClient.deleteProperty(accessToken, mappingId, groupId, propertyId);\n },\n onSuccess: async () => {\n await queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, groupId] });\n },\n });\n\n return (\n <PropertyTable\n propertyType=\"Group\"\n columnsFactory={columnsFactory}\n data={groupProperties}\n isLoading={isLoading}\n onClickAdd={onClickAdd}\n refreshProperties={refresh}\n deleteProperty={deleteProperty}\n hideRefreshIcon={hideRefreshIcon}\n onGroupPropertyDelete={onGroupPropertyDelete}\n />\n );\n};\n"]}
|
|
@@ -18,10 +18,11 @@ export interface PropertyMenuProps {
|
|
|
18
18
|
hideCalculatedProps?: boolean;
|
|
19
19
|
hideCustomCalculationProps?: boolean;
|
|
20
20
|
hideRefreshIcon?: boolean;
|
|
21
|
+
onGroupPropertyDelete?: () => void;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* Component to display the properties of a group.
|
|
24
25
|
* @public
|
|
25
26
|
*/
|
|
26
|
-
export declare const PropertyMenu: ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, hideRefreshIcon, hideGroupProps, }: PropertyMenuProps) => JSX.Element;
|
|
27
|
+
export declare const PropertyMenu: ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, hideRefreshIcon, onGroupPropertyDelete, hideGroupProps, }: PropertyMenuProps) => JSX.Element;
|
|
27
28
|
//# sourceMappingURL=PropertyMenu.d.ts.map
|
|
@@ -13,7 +13,7 @@ import { usePropertiesClient } from "../context/PropertiesClientContext";
|
|
|
13
13
|
* Component to display the properties of a group.
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, hideRefreshIcon, hideGroupProps = false, }) => {
|
|
16
|
+
export const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickModifyGroupProperty, hideRefreshIcon, onGroupPropertyDelete, hideGroupProps = false, }) => {
|
|
17
17
|
const groupId = group.id;
|
|
18
18
|
const mappingId = mapping.id;
|
|
19
19
|
const { getAccessToken, iModelId } = useGroupingMappingApiConfig();
|
|
@@ -21,6 +21,6 @@ export const PropertyMenu = ({ mapping, group, onClickAddGroupProperty, onClickM
|
|
|
21
21
|
const queryClient = useQueryClient();
|
|
22
22
|
const { data: groupProperties, isFetching: isLoadingGroupProperties } = usePropertiesQuery(iModelId, mappingId, groupId, getAccessToken, propertiesClient);
|
|
23
23
|
const refreshGroupProperties = useCallback(async () => queryClient.invalidateQueries({ queryKey: ["properties", iModelId, mappingId, group.id] }), [group.id, iModelId, mappingId, queryClient]);
|
|
24
|
-
return (React.createElement("div", { className: "gmw-property-menu-wrapper" }, !hideGroupProps && (React.createElement(GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties ? groupProperties.properties : [], refresh: refreshGroupProperties, hideRefreshIcon: hideRefreshIcon }))));
|
|
24
|
+
return (React.createElement("div", { className: "gmw-property-menu-wrapper" }, !hideGroupProps && (React.createElement(GroupPropertyTable, { iModelId: iModelId, mappingId: mappingId, groupId: groupId, onClickAdd: onClickAddGroupProperty, onClickModify: onClickModifyGroupProperty, isLoading: isLoadingGroupProperties, groupProperties: groupProperties ? groupProperties.properties : [], refresh: refreshGroupProperties, hideRefreshIcon: hideRefreshIcon, onGroupPropertyDelete: onGroupPropertyDelete }))));
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=PropertyMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC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AE,OAAO,EAChB,UAAU,EAAE,uBAAuB,EACnC,aAAa,EAAE,0BAA0B,EACzC,SAAS,EAAE,wBAAwB,EACnC,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAClE,OAAO,EAAE,sBAAsB,EAC/B,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CACG,CACP,CAAC;AACJ,CAAC,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, { useCallback } from \"react\";\nimport \"./PropertyMenu.scss\";\nimport { GroupPropertyTable } from \"./GroupProperties/GroupPropertyTable\";\nimport { useGroupingMappingApiConfig } from \"../context/GroupingApiConfigContext\";\nimport type { GroupMinimal, Mapping, Property } from \"@itwin/insights-client\";\nimport { usePropertiesQuery } from \"./hooks/usePropertiesQuery\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { usePropertiesClient } from \"../context/PropertiesClientContext\";\n\n/**\n * Props for the {@link PropertyMenu} component.\n * @public\n */\nexport interface PropertyMenuProps {\n mapping: Mapping;\n group: GroupMinimal;\n onClickAddGroupProperty?: () => void;\n onClickModifyGroupProperty?: (groupProperty: Property) => void;\n onClickAddCalculatedProperty?: () => void;\n onClickModifyCalculatedProperty?: (calculatedProperty: Property) => void;\n onClickAddCustomCalculationProperty?: () => void;\n onClickModifyCustomCalculation?: (customCalculation: Property) => void;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n hideRefreshIcon?: boolean;\n onGroupPropertyDelete?: () => void;\n}\n\n/**\n * Component to display the properties of a group.\n * @public\n */\nexport const PropertyMenu = ({\n mapping,\n group,\n onClickAddGroupProperty,\n onClickModifyGroupProperty,\n hideRefreshIcon,\n onGroupPropertyDelete,\n hideGroupProps = false,\n}: PropertyMenuProps) => {\n const groupId = group.id;\n const mappingId = mapping.id;\n const { getAccessToken, iModelId } = useGroupingMappingApiConfig();\n const propertiesClient = usePropertiesClient();\n const queryClient = useQueryClient();\n\n const { data: groupProperties, isFetching: isLoadingGroupProperties } = usePropertiesQuery(iModelId, mappingId, groupId, getAccessToken, propertiesClient);\n\n const refreshGroupProperties = useCallback(\n async () => queryClient.invalidateQueries({ queryKey: [\"properties\", iModelId, mappingId, group.id] }),\n [group.id, iModelId, mappingId, queryClient],\n );\n\n return (\n <div className=\"gmw-property-menu-wrapper\">\n {!hideGroupProps && (\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onClickAdd={onClickAddGroupProperty}\n onClickModify={onClickModifyGroupProperty}\n isLoading={isLoadingGroupProperties}\n groupProperties={groupProperties ? groupProperties.properties : []}\n refresh={refreshGroupProperties}\n hideRefreshIcon={hideRefreshIcon}\n onGroupPropertyDelete={onGroupPropertyDelete}\n />\n )}\n </div>\n );\n};\n"]}
|
|
@@ -7,10 +7,12 @@ import "./PropertyMenuWithVisualization.scss";
|
|
|
7
7
|
*/
|
|
8
8
|
export interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {
|
|
9
9
|
color: string;
|
|
10
|
+
disableZoom?: boolean;
|
|
11
|
+
onGroupPropertyDelete?: () => void;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
12
14
|
* Component to display a property menu with visualization.
|
|
13
15
|
* @public
|
|
14
16
|
*/
|
|
15
|
-
export declare const PropertyMenuWithVisualization: ({ group, color, hideRefreshIcon, ...rest }: PropertyMenuWithVisualizationProps) => JSX.Element;
|
|
17
|
+
export declare const PropertyMenuWithVisualization: ({ group, color, hideRefreshIcon, disableZoom, ...rest }: PropertyMenuWithVisualizationProps) => JSX.Element;
|
|
16
18
|
//# sourceMappingURL=PropertyMenuWithVisualization.d.ts.map
|
|
@@ -13,11 +13,11 @@ import "./PropertyMenuWithVisualization.scss";
|
|
|
13
13
|
* Component to display a property menu with visualization.
|
|
14
14
|
* @public
|
|
15
15
|
*/
|
|
16
|
-
export const PropertyMenuWithVisualization = ({ group, color, hideRefreshIcon, ...rest }) => {
|
|
16
|
+
export const PropertyMenuWithVisualization = ({ group, color, hideRefreshIcon, disableZoom, ...rest }) => {
|
|
17
17
|
const [isInformationPanelOpen, setIsInformationPanelOpen] = useState(false);
|
|
18
18
|
return (React.createElement(InformationPanelWrapper, { className: "gmw-property-menu-vis-wrapper" },
|
|
19
19
|
React.createElement("div", { className: "gmw-property-menu-vis-toolbar" },
|
|
20
|
-
React.createElement(GroupColorToggle, { group: group, color: color, labelPosition: "left" }),
|
|
20
|
+
React.createElement(GroupColorToggle, { group: group, color: color, labelPosition: "left", disableZoom: disableZoom }),
|
|
21
21
|
React.createElement(IconButton, { styleType: "borderless", onClick: () => setIsInformationPanelOpen(true), title: "Group Information" },
|
|
22
22
|
React.createElement(SvgProperties, null))),
|
|
23
23
|
React.createElement(PropertyMenu, { group: group, hideRefreshIcon: hideRefreshIcon, ...rest }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenuWithVisualization.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyMenuWithVisualization.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyMenuWithVisualization.js","sourceRoot":"","sources":["../../../../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K,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAI,CAClI,CAC3B,CAAC;AACJ,CAAC,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, { 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\n/**\n * Properties for the {@link PropertyMenuWithVisualization} component.\n * @public\n */\nexport interface PropertyMenuWithVisualizationProps extends PropertyMenuProps {\n color: string;\n disableZoom?: boolean;\n onGroupPropertyDelete?: () => void;\n}\n\n/**\n * Component to display a property menu with visualization.\n * @public\n */\nexport const PropertyMenuWithVisualization = ({ group, color, hideRefreshIcon, disableZoom, ...rest }: 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\" disableZoom={disableZoom} />\n <IconButton styleType=\"borderless\" onClick={() => setIsInformationPanelOpen(true)} title=\"Group Information\">\n <SvgProperties />\n </IconButton>\n </div>\n <PropertyMenu group={group} hideRefreshIcon={hideRefreshIcon} {...rest} />\n <GroupInformationPanel isOpen={isInformationPanelOpen} onClose={() => setIsInformationPanelOpen(false)} query={group.query} groupName={group.groupName} />\n </InformationPanelWrapper>\n );\n};\n"]}
|
|
@@ -14,6 +14,7 @@ export interface PropertyTableProps<T extends PropertyTableItem> {
|
|
|
14
14
|
refreshProperties: () => Promise<void>;
|
|
15
15
|
deleteProperty: (propertyId: string) => Promise<void>;
|
|
16
16
|
hideRefreshIcon?: boolean;
|
|
17
|
+
onGroupPropertyDelete?: () => void;
|
|
17
18
|
}
|
|
18
|
-
export declare const PropertyTable: <T extends PropertyTableItem>({ propertyType, columnsFactory, data, isLoading, onClickAdd, refreshProperties, deleteProperty, hideRefreshIcon, }: PropertyTableProps<T>) => JSX.Element;
|
|
19
|
+
export declare const PropertyTable: <T extends PropertyTableItem>({ propertyType, columnsFactory, data, isLoading, onClickAdd, refreshProperties, deleteProperty, hideRefreshIcon, onGroupPropertyDelete, }: PropertyTableProps<T>) => JSX.Element;
|
|
19
20
|
//# sourceMappingURL=PropertyTable.d.ts.map
|
|
@@ -7,11 +7,12 @@ import React, { useCallback, useMemo, useState } from "react";
|
|
|
7
7
|
import DeleteModal from "../SharedComponents/DeleteModal";
|
|
8
8
|
import { PropertyTableToolbar } from "./PropertyTableToolbar";
|
|
9
9
|
import "./PropertyTable.scss";
|
|
10
|
-
export const PropertyTable = ({ propertyType, columnsFactory, data, isLoading, onClickAdd, refreshProperties, deleteProperty, hideRefreshIcon, }) => {
|
|
10
|
+
export const PropertyTable = ({ propertyType, columnsFactory, data, isLoading, onClickAdd, refreshProperties, deleteProperty, hideRefreshIcon, onGroupPropertyDelete, }) => {
|
|
11
11
|
const [showDeleteModal, setShowDeleteModal] = useState(undefined);
|
|
12
12
|
const handleDeleteProperty = useCallback(async () => {
|
|
13
13
|
await deleteProperty(showDeleteModal?.id ?? "");
|
|
14
|
-
|
|
14
|
+
onGroupPropertyDelete?.();
|
|
15
|
+
}, [deleteProperty, showDeleteModal?.id, onGroupPropertyDelete]);
|
|
15
16
|
const handleShowDeleteModal = useCallback((property) => {
|
|
16
17
|
setShowDeleteModal(property);
|
|
17
18
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyTable.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"PropertyTable.js","sourceRoot":"","sources":["../../../../src/components/Properties/PropertyTable.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,sBAAsB,CAAC;AAmB9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAA8B,EACzD,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,qBAAqB,GACC,EAAE,EAAE;IAC1B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAgB,SAAS,CAAC,CAAC;IAEjF,MAAM,oBAAoB,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QAClD,MAAM,cAAc,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,qBAAqB,EAAE,EAAE,CAAC;IAC5B,CAAC,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEjE,MAAM,qBAAqB,GAAG,WAAW,CAAC,CAAC,QAAW,EAAE,EAAE;QACxD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,sBAAsB,GAAG,GAAG,EAAE;QAClC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;IAEtH,OAAO,CACL,6BAAK,SAAS,EAAC,8BAA8B;QAC3C,oBAAC,oBAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,UAAU,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,eAAe,GAChC;QACF,oBAAC,KAAK,IACJ,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAC3B,OAAO,EAAC,iBAAiB,EACzB,OAAO,EAAE,eAAe,EACxB,iBAAiB,EAAE,MAAM,YAAY,aAAa,EAClD,UAAU,QACV,SAAS,EAAE,SAAS,GACpB;QACD,eAAe,IAAI,oBAAC,WAAW,IAAC,UAAU,EAAE,eAAe,CAAC,YAAY,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,oBAAoB,GAAI,CAC1I,CACP,CAAC;AACJ,CAAC,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 { Table } from \"@itwin/itwinui-react\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport type { Column } from \"react-table\";\nimport type { CreateTypeFromInterface } from \"../../common/utils\";\nimport DeleteModal from \"../SharedComponents/DeleteModal\";\nimport { PropertyTableToolbar } from \"./PropertyTableToolbar\";\nimport \"./PropertyTable.scss\";\n\nexport interface PropertyTableItem {\n propertyName: string;\n id: string;\n}\n\nexport interface PropertyTableProps<T extends PropertyTableItem> {\n propertyType: string;\n columnsFactory: (handleShowDeleteModal: (value: T) => void) => Array<Column<T>>;\n data: T[];\n isLoading: boolean;\n onClickAdd?: () => void;\n refreshProperties: () => Promise<void>;\n deleteProperty: (propertyId: string) => Promise<void>;\n hideRefreshIcon?: boolean;\n onGroupPropertyDelete?: () => void;\n}\n\nexport const PropertyTable = <T extends PropertyTableItem>({\n propertyType,\n columnsFactory,\n data,\n isLoading,\n onClickAdd,\n refreshProperties,\n deleteProperty,\n hideRefreshIcon,\n onGroupPropertyDelete,\n}: PropertyTableProps<T>) => {\n const [showDeleteModal, setShowDeleteModal] = useState<T | undefined>(undefined);\n\n const handleDeleteProperty = useCallback(async () => {\n await deleteProperty(showDeleteModal?.id ?? \"\");\n onGroupPropertyDelete?.();\n }, [deleteProperty, showDeleteModal?.id, onGroupPropertyDelete]);\n\n const handleShowDeleteModal = useCallback((property: T) => {\n setShowDeleteModal(property);\n }, []);\n\n const handleCloseDeleteModal = () => {\n setShowDeleteModal(undefined);\n };\n\n const memoizedColumns = useMemo(() => columnsFactory(handleShowDeleteModal), [columnsFactory, handleShowDeleteModal]);\n\n return (\n <div className=\"gmw-property-table-container\">\n <PropertyTableToolbar\n propertyType={propertyType}\n onClickAddProperty={onClickAdd}\n refreshProperties={refreshProperties}\n isLoading={isLoading}\n hideRefreshIcon={hideRefreshIcon}\n />\n <Table<CreateTypeFromInterface<T>>\n data={isLoading ? [] : data}\n density=\"extra-condensed\"\n columns={memoizedColumns}\n emptyTableContent={`No ${propertyType} Properties`}\n isSortable\n isLoading={isLoading}\n />\n {showDeleteModal && <DeleteModal entityName={showDeleteModal.propertyName} onClose={handleCloseDeleteModal} onDelete={handleDeleteProperty} />}\n </div>\n );\n};\n"]}
|
|
@@ -12,6 +12,10 @@ export interface OverlappedElementsMetadata {
|
|
|
12
12
|
groupElementsInfo: Map<string, number>;
|
|
13
13
|
overlappedElementGroupPairs: OverlappedElementGroupPairs[];
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* The type for the {@link GroupHilitedElementsContext} context.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
15
19
|
export interface GroupHilitedElements {
|
|
16
20
|
hiddenGroupsIds: Set<string>;
|
|
17
21
|
showGroupColor: boolean;
|
|
@@ -25,7 +29,17 @@ export interface GroupHilitedElements {
|
|
|
25
29
|
setOverlappedElementsMetadata: (overlappedElementsMetaData: OverlappedElementsMetadata) => void;
|
|
26
30
|
setIsOverlappedColored: (isOverlappedColored: boolean | ((isOverlappedColored: boolean) => boolean)) => void;
|
|
27
31
|
setIsVisualizationsEnabled: (isVisualizationsEnabled: boolean | ((isVisualizationsEnabled: boolean) => boolean)) => void;
|
|
32
|
+
groupColors: Map<string, string>;
|
|
33
|
+
setGroupColors: (colors: Map<string, string>) => void;
|
|
28
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The context which provides metadata for group highlighting.
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
29
39
|
export declare const GroupHilitedElementsContext: React.Context<GroupHilitedElements>;
|
|
40
|
+
/**
|
|
41
|
+
* The hook which provides context for group highlighting.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
30
44
|
export declare const useGroupHilitedElementsContext: () => GroupHilitedElements;
|
|
31
45
|
//# sourceMappingURL=GroupHilitedElementsContext.d.ts.map
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from "react";
|
|
6
|
+
/**
|
|
7
|
+
* The context which provides metadata for group highlighting.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
6
10
|
export const GroupHilitedElementsContext = React.createContext({
|
|
7
11
|
hiddenGroupsIds: new Set(),
|
|
8
12
|
showGroupColor: false,
|
|
@@ -20,7 +24,13 @@ export const GroupHilitedElementsContext = React.createContext({
|
|
|
20
24
|
setOverlappedElementsMetadata: () => { },
|
|
21
25
|
setIsOverlappedColored: () => { },
|
|
22
26
|
setIsVisualizationsEnabled: () => { },
|
|
27
|
+
setGroupColors: () => { },
|
|
28
|
+
groupColors: new Map(),
|
|
23
29
|
});
|
|
30
|
+
/**
|
|
31
|
+
* The hook which provides context for group highlighting.
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
24
34
|
export const useGroupHilitedElementsContext = () => {
|
|
25
35
|
const context = React.useContext(GroupHilitedElementsContext);
|
|
26
36
|
if (!context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../src/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupHilitedElementsContext.js","sourceRoot":"","sources":["../../../../src/components/context/GroupHilitedElementsContext.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsC/B;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,CAAC,aAAa,CAAuB;IACnF,eAAe,EAAE,IAAI,GAAG,EAAE;IAC1B,cAAc,EAAE,KAAK;IACrB,oBAAoB,EAAE,CAAC;IACvB,0BAA0B,EAAE;QAC1B,sBAAsB,EAAE,IAAI,GAAG,EAAE;QACjC,iBAAiB,EAAE,IAAI,GAAG,EAAE;QAC5B,2BAA2B,EAAE,EAAE;KAChC;IACD,uBAAuB,EAAE,KAAK;IAC9B,mBAAmB,EAAE,KAAK;IAC1B,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC5B,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC3B,2BAA2B,EAAE,GAAG,EAAE,GAAE,CAAC;IACrC,6BAA6B,EAAE,GAAG,EAAE,GAAE,CAAC;IACvC,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC;IAChC,0BAA0B,EAAE,GAAG,EAAE,GAAE,CAAC;IACpC,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,WAAW,EAAE,IAAI,GAAG,EAAE;CACvB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAyB,EAAE;IACvE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;KAChH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,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 * as React from \"react\";\nexport interface OverlappedInfo {\n groupIds: string[];\n elements: string[];\n}\n\nexport interface OverlappedElementGroupPairs {\n elementIds: Set<string>;\n groupIds: Set<string>;\n}\n\nexport interface OverlappedElementsMetadata {\n overlappedElementsInfo: Map<string, OverlappedInfo[]>;\n groupElementsInfo: Map<string, number>;\n overlappedElementGroupPairs: OverlappedElementGroupPairs[];\n}\n\n/**\n * The type for the {@link GroupHilitedElementsContext} context.\n * @public\n */\nexport interface GroupHilitedElements {\n hiddenGroupsIds: Set<string>;\n showGroupColor: boolean;\n currentHilitedGroups: number;\n overlappedElementsMetadata: OverlappedElementsMetadata;\n isVisualizationsEnabled: boolean;\n isOverlappedColored: boolean;\n setHiddenGroupsIds: (hiddenGroupIds: Set<string>) => void;\n setShowGroupColor: (showGroupColor: boolean | ((showGroupColor: boolean) => boolean)) => void;\n setNumberOfVisualizedGroups: (numberOfVisualizedGroups: number | ((numberOfVisualizedGroups: number) => number)) => void;\n setOverlappedElementsMetadata: (overlappedElementsMetaData: OverlappedElementsMetadata) => void;\n setIsOverlappedColored: (isOverlappedColored: boolean | ((isOverlappedColored: boolean) => boolean)) => void;\n setIsVisualizationsEnabled: (isVisualizationsEnabled: boolean | ((isVisualizationsEnabled: boolean) => boolean)) => void;\n groupColors: Map<string, string>;\n setGroupColors: (colors: Map<string, string>) => void;\n}\n\n/**\n * The context which provides metadata for group highlighting.\n * @public\n */\nexport const GroupHilitedElementsContext = React.createContext<GroupHilitedElements>({\n hiddenGroupsIds: new Set(),\n showGroupColor: false,\n currentHilitedGroups: 0,\n overlappedElementsMetadata: {\n overlappedElementsInfo: new Map(),\n groupElementsInfo: new Map(),\n overlappedElementGroupPairs: [],\n },\n isVisualizationsEnabled: false,\n isOverlappedColored: false,\n setHiddenGroupsIds: () => {},\n setShowGroupColor: () => {},\n setNumberOfVisualizedGroups: () => {},\n setOverlappedElementsMetadata: () => {},\n setIsOverlappedColored: () => {},\n setIsVisualizationsEnabled: () => {},\n setGroupColors: () => {},\n groupColors: new Map(),\n});\n\n/**\n * The hook which provides context for group highlighting.\n * @public\n */\nexport const useGroupHilitedElementsContext = (): GroupHilitedElements => {\n const context = React.useContext(GroupHilitedElementsContext);\n if (!context) {\n throw new Error(\"useGroupHilitedElementsContext should be used within a GroupHilitedElementsContext provider\");\n }\n return context;\n};\n"]}
|
|
@@ -14,6 +14,7 @@ export { MappingsView, MappingsViewProps } from "./components/Mappings/MappingsV
|
|
|
14
14
|
export { useGroupsOperations, GroupsOperationsProps } from "./components/Groups/hooks/useGroupsOperations";
|
|
15
15
|
export { GroupsView, GroupsViewProps } from "./components/Groups/GroupsView";
|
|
16
16
|
export { GroupingMappingContext, GroupingMappingContextProps } from "./components/GroupingMappingContext";
|
|
17
|
+
export { useGroupHilitedElementsContext, GroupHilitedElements, GroupHilitedElementsContext } from "./components/context/GroupHilitedElementsContext";
|
|
17
18
|
export { Groups, GroupsProps } from "./components/Groups/Groups";
|
|
18
19
|
export { GroupsVisualization, GroupsVisualizationProps } from "./components/Groups/GroupsVisualization";
|
|
19
20
|
export { GroupAction, GroupActionProps } from "./components/Groups/Editing/GroupAction";
|
|
@@ -18,6 +18,7 @@ export { MappingsView } from "./components/Mappings/MappingsView";
|
|
|
18
18
|
export { useGroupsOperations } from "./components/Groups/hooks/useGroupsOperations";
|
|
19
19
|
export { GroupsView } from "./components/Groups/GroupsView";
|
|
20
20
|
export { GroupingMappingContext } from "./components/GroupingMappingContext";
|
|
21
|
+
export { useGroupHilitedElementsContext, GroupHilitedElementsContext } from "./components/context/GroupHilitedElementsContext";
|
|
21
22
|
export { Groups } from "./components/Groups/Groups";
|
|
22
23
|
export { GroupsVisualization } from "./components/Groups/GroupsVisualization";
|
|
23
24
|
export { GroupAction } from "./components/Groups/Editing/GroupAction";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping-mapping-widget.js","sourceRoot":"","sources":["../../src/grouping-mapping-widget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,gDAAgD;AAChD,cAAc,qCAAqC,CAAC;AAEpD,0EAA0E;AAC1E,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AACpJ,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC/I,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAIL,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,+CAA+C,CAAC;AACvD,cAAc,wBAAwB,CAAC;AAEvC,yCAAyC;AACzC,OAAO,EAAE,QAAQ,EAAiB,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAA2B,MAAM,mDAAmD,CAAC;AACnH,OAAO,EAAE,aAAa,EAAsB,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,YAAY,EAAqB,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAyB,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAmB,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAA+B,MAAM,qCAAqC,CAAC;AAC1G,OAAO,EAAE,MAAM,EAAe,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAA4B,MAAM,yCAAyC,CAAC;AACxG,OAAO,EAAE,WAAW,EAAoB,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAqB,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,6BAA6B,EAAsC,MAAM,uDAAuD,CAAC;AAC1I,OAAO,EAAE,mBAAmB,EAA4B,MAAM,6DAA6D,CAAC;AAC5H,OAAO,EAAE,wBAAwB,EAAiC,MAAM,uEAAuE,CAAC;AAChJ,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAEL,2BAA2B,GAK5B,MAAM,+CAA+C,CAAC;AAEvD,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 \"./WidgetShell/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./components/context/MappingClientContext\";\nexport { createDefaultGroupsClient, createGroupsClient, GroupsClientContext, useGroupsClient } from \"./components/context/GroupsClientContext\";\nexport {\n createDefaultPropertiesClient,\n createPropertiesClient,\n PropertiesClientContext,\n usePropertiesClient,\n} from \"./components/context/PropertiesClientContext\";\nexport {\n ClientPrefix,\n GetAccessTokenFn,\n GroupingMappingApiConfig,\n GroupingMappingApiConfigContext,\n useGroupingMappingApiConfig,\n} from \"./components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./components/Mappings/Mappings\";\nexport { useMappingsOperations, MappingsOperationsProps } from \"./components/Mappings/hooks/useMappingsOperations\";\nexport { MappingAction, MappingActionProps } from \"./components/Mappings/Editing/MappingAction\";\nexport { MappingsView, MappingsViewProps } from \"./components/Mappings/MappingsView\";\nexport { useGroupsOperations, GroupsOperationsProps } from \"./components/Groups/hooks/useGroupsOperations\";\nexport { GroupsView, GroupsViewProps } from \"./components/Groups/GroupsView\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./components/GroupingMappingContext\";\nexport { Groups, GroupsProps } from \"./components/Groups/Groups\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./components/Groups/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./components/Groups/Editing/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./components/Properties/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./components/Properties/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./components/Properties/GroupProperties/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./components/Properties/CalculatedProperties/CalculatedPropertyAction\";\nexport { SearchGroupingCustomUI } from \"./components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./components/customUI/GroupQueryBuilderCustomUI\";\nexport {\n GroupingMappingCustomUI,\n GroupingMappingCustomUIType,\n ContextCustomUI,\n GroupingCustomUI,\n GroupingCustomUIProps,\n ContextCustomUIProps,\n} from \"./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","sourceRoot":"","sources":["../../src/grouping-mapping-widget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,gDAAgD;AAChD,cAAc,qCAAqC,CAAC;AAEpD,0EAA0E;AAC1E,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AACpJ,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC/I,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAIL,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,+CAA+C,CAAC;AACvD,cAAc,wBAAwB,CAAC;AAEvC,yCAAyC;AACzC,OAAO,EAAE,QAAQ,EAAiB,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAA2B,MAAM,mDAAmD,CAAC;AACnH,OAAO,EAAE,aAAa,EAAsB,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,YAAY,EAAqB,MAAM,oCAAoC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAyB,MAAM,+CAA+C,CAAC;AAC3G,OAAO,EAAE,UAAU,EAAmB,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAA+B,MAAM,qCAAqC,CAAC;AAC1G,OAAO,EAAE,8BAA8B,EAAwB,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AACrJ,OAAO,EAAE,MAAM,EAAe,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAA4B,MAAM,yCAAyC,CAAC;AACxG,OAAO,EAAE,WAAW,EAAoB,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,YAAY,EAAqB,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,6BAA6B,EAAsC,MAAM,uDAAuD,CAAC;AAC1I,OAAO,EAAE,mBAAmB,EAA4B,MAAM,6DAA6D,CAAC;AAC5H,OAAO,EAAE,wBAAwB,EAAiC,MAAM,uEAAuE,CAAC;AAChJ,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAEL,2BAA2B,GAK5B,MAAM,+CAA+C,CAAC;AAEvD,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 \"./WidgetShell/GroupingMappingWidget\";\n\n/** Interfaces for providing custom MappingClient and API configuration */\nexport { createDefaultMappingClient, createMappingClient, MappingClientContext, useMappingClient } from \"./components/context/MappingClientContext\";\nexport { createDefaultGroupsClient, createGroupsClient, GroupsClientContext, useGroupsClient } from \"./components/context/GroupsClientContext\";\nexport {\n createDefaultPropertiesClient,\n createPropertiesClient,\n PropertiesClientContext,\n usePropertiesClient,\n} from \"./components/context/PropertiesClientContext\";\nexport {\n ClientPrefix,\n GetAccessTokenFn,\n GroupingMappingApiConfig,\n GroupingMappingApiConfigContext,\n useGroupingMappingApiConfig,\n} from \"./components/context/GroupingApiConfigContext\";\nexport * from \"@itwin/insights-client\";\n\n/** Internal components for custom UIs */\nexport { Mappings, MappingsProps } from \"./components/Mappings/Mappings\";\nexport { useMappingsOperations, MappingsOperationsProps } from \"./components/Mappings/hooks/useMappingsOperations\";\nexport { MappingAction, MappingActionProps } from \"./components/Mappings/Editing/MappingAction\";\nexport { MappingsView, MappingsViewProps } from \"./components/Mappings/MappingsView\";\nexport { useGroupsOperations, GroupsOperationsProps } from \"./components/Groups/hooks/useGroupsOperations\";\nexport { GroupsView, GroupsViewProps } from \"./components/Groups/GroupsView\";\nexport { GroupingMappingContext, GroupingMappingContextProps } from \"./components/GroupingMappingContext\";\nexport { useGroupHilitedElementsContext, GroupHilitedElements, GroupHilitedElementsContext } from \"./components/context/GroupHilitedElementsContext\";\nexport { Groups, GroupsProps } from \"./components/Groups/Groups\";\nexport { GroupsVisualization, GroupsVisualizationProps } from \"./components/Groups/GroupsVisualization\";\nexport { GroupAction, GroupActionProps } from \"./components/Groups/Editing/GroupAction\";\nexport { PropertyMenu, PropertyMenuProps } from \"./components/Properties/PropertyMenu\";\nexport { PropertyMenuWithVisualization, PropertyMenuWithVisualizationProps } from \"./components/Properties/PropertyMenuWithVisualization\";\nexport { GroupPropertyAction, GroupPropertyActionProps } from \"./components/Properties/GroupProperties/GroupPropertyAction\";\nexport { CalculatedPropertyAction, CalculatedPropertyActionProps } from \"./components/Properties/CalculatedProperties/CalculatedPropertyAction\";\nexport { SearchGroupingCustomUI } from \"./components/customUI/SearchGroupingCustomUI\";\nexport { ManualGroupingCustomUI } from \"./components/customUI/ManualGroupingCustomUI\";\nexport { GroupQueryBuilderCustomUI } from \"./components/customUI/GroupQueryBuilderCustomUI\";\nexport {\n GroupingMappingCustomUI,\n GroupingMappingCustomUIType,\n ContextCustomUI,\n GroupingCustomUI,\n GroupingCustomUIProps,\n ContextCustomUIProps,\n} from \"./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"]}
|