@itwin/grouping-mapping-widget 0.5.3 → 0.5.6
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/widget/components/GroupAction.js +2 -3
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js +1 -3
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.js +15 -18
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +7 -0
- package/lib/cjs/widget/components/HorizontalTile.d.ts +13 -0
- package/lib/cjs/widget/components/{GroupTile.js → HorizontalTile.js} +6 -6
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -0
- package/lib/{esm/widget/components/GroupTile.scss → cjs/widget/components/HorizontalTile.scss} +2 -2
- package/lib/cjs/widget/components/Mapping.js +37 -57
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/Mapping.scss +21 -7
- package/lib/cjs/widget/components/PropertyMenu.js +4 -3
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/SelectProject.js +28 -20
- package/lib/cjs/widget/components/SelectProject.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js +6 -6
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.scss +12 -12
- package/lib/cjs/widget/components/property-grid/PropertyList.js +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyList.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.js +5 -5
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.scss +13 -62
- package/lib/cjs/widget/components/viewerUtils.d.ts +7 -7
- package/lib/cjs/widget/components/viewerUtils.js +32 -51
- package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.js +4 -5
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.js +2 -4
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/Grouping.js +19 -22
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +7 -0
- package/lib/esm/widget/components/HorizontalTile.d.ts +13 -0
- package/lib/esm/widget/components/{GroupTile.js → HorizontalTile.js} +4 -4
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -0
- package/lib/{cjs/widget/components/GroupTile.scss → esm/widget/components/HorizontalTile.scss} +2 -2
- package/lib/esm/widget/components/Mapping.js +40 -60
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/Mapping.scss +21 -7
- package/lib/esm/widget/components/PropertyMenu.js +5 -4
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/SelectProject.js +30 -22
- package/lib/esm/widget/components/SelectProject.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.js +6 -6
- package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.scss +12 -12
- package/lib/esm/widget/components/property-grid/PropertyList.js +1 -1
- package/lib/esm/widget/components/property-grid/PropertyList.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyView.js +5 -5
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyView.scss +13 -62
- package/lib/esm/widget/components/viewerUtils.d.ts +7 -7
- package/lib/esm/widget/components/viewerUtils.js +27 -46
- package/lib/esm/widget/components/viewerUtils.js.map +1 -1
- package/package.json +3 -2
- package/lib/cjs/widget/components/GroupTile.d.ts +0 -13
- package/lib/cjs/widget/components/GroupTile.js.map +0 -1
- package/lib/cjs/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +0 -16
- package/lib/esm/widget/components/GroupTile.d.ts +0 -13
- package/lib/esm/widget/components/GroupTile.js.map +0 -1
- package/lib/esm/widget/components/property-grid/NonPrimitivePropertyRenderer.scss +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EACL,iCAAiC,EACjC,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC;AAEvB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAItD,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,OAAO,GACR,MAAM,sBAAsB,CAAC;AAK9B,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EA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E,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,yBAAyB,EAAE,yBAAyB,EACpD,4BAA4B,EAAE,4BAA4B,EAC1D,kBAAkB,EAAE,mBAAmB,EACvC,2BAA2B,EAAE,2BAA2B,EACxD,kBAAkB,EAAE,kBAAkB,EACtC,yBAAyB,EAAE,yBAAyB,EACpD,yBAAyB,EAAE,yBAAyB,GACpD,CACE,CACP,CACG;gBACN,oBAAC,gBAAgB,IACf,SAAS,EAAC,mBAAmB,EAC7B,MAAM,EAAE,sBAAsB;oBAE9B,oBAAC,sBAAsB,IACrB,OAAO,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC;wBAE/C,oBAAC,IAAI,IAAC,OAAO,EAAC,YAAY,IAAE,GAAG,MAAA,KAAK,CAAC,SAAS,mCAAI,EAAE,cAAc,CAAQ,CACnD;oBACzB,oBAAC,oBAAoB;wBACnB,6BAAK,SAAS,EAAC,kBAAkB;4BAC/B,oBAAC,eAAe,IACd,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,EAAE,EACR,QAAQ,QACR,YAAY,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,EAAE,GAC/B,CACE,CACe,CACN,CACK,CAC3B,CAAC;KACL;AACH,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 { IModelConnection } from \"@itwin/core-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\n\nimport { fetchIdsFromQuery, WidgetHeader } from \"./utils\";\nimport {\n clearEmphasizedOverriddenElements,\n manufactureKeys,\n visualizeElements,\n visualizeElementsByKeys,\n zoomToElements,\n} from \"./viewerUtils\";\nimport type { GroupType } from \"./Grouping\";\nimport \"./PropertyMenu.scss\";\nimport GroupPropertyAction from \"./GroupPropertyAction\";\nimport CalculatedPropertyAction from \"./CalculatedPropertyAction\";\nimport type { GroupPropertyType } from \"./GroupPropertyTable\";\nimport GroupPropertyTable from \"./GroupPropertyTable\";\nimport type {\n CalculatedPropertyType,\n} from \"./CalculatedPropertyTable\";\nimport CalculatedPropertyTable from \"./CalculatedPropertyTable\";\nimport {\n IconButton,\n InformationPanel,\n InformationPanelBody,\n InformationPanelHeader,\n InformationPanelWrapper,\n LabeledTextarea,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport type { CellProps } from \"react-table\";\nimport type {\n CustomCalculationType,\n} from \"./CustomCalculationTable\";\nimport CustomCalculationTable from \"./CustomCalculationTable\";\nimport CustomCalculationAction from \"./CustomCalculationAction\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport type { PossibleDataType, PropertyMap } from \"../../formula/Types\";\nimport { useCombinedFetchRefresh } from \"../hooks/useFetchData\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\ninterface PropertyModifyProps {\n iModelId: string;\n mappingId: string;\n group: GroupType;\n goBack: () => Promise<void>;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport enum PropertyMenuView {\n DEFAULT = \"default\",\n ADD_GROUP_PROPERTY = \"add_group_property\",\n MODIFY_GROUP_PROPERTY = \"modify_group_property\",\n ADD_CALCULATED_PROPERTY = \"add_calculated_property\",\n MODIFY_CALCULATED_PROPERTY = \"modify_calculated_property\",\n ADD_CUSTOM_CALCULATION = \"add_custom_calculation\",\n MODIFY_CUSTOM_CALCULATION = \"modify_custom_calculation\",\n}\n\nconst stringToPossibleDataType = (str?: string): PossibleDataType => {\n if (!str)\n return \"Undefined\";\n\n switch (str.toLowerCase()) {\n case \"double\":\n case \"number\": return \"Number\";\n case \"string\": return \"String\";\n case \"boolean\": return \"Boolean\";\n default: return \"Undefined\";\n }\n};\n\nconst convertToPropertyMap = (\n groupProperties: GroupPropertyType[],\n calculatedProperties: CalculatedPropertyType[],\n customCalculations: CustomCalculationType[],\n selectedPropertyName?: string\n): PropertyMap => {\n const map: PropertyMap = {};\n const selectedLowerName = selectedPropertyName?.toLowerCase();\n\n groupProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n calculatedProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName)\n map[lowerName] = \"Number\";\n });\n\n customCalculations.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n return map;\n};\n\nexport const PropertyMenu = ({\n iModelId,\n mappingId,\n group,\n goBack,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyModifyProps) => {\n const groupId = group.id ?? \"\";\n\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const [propertyMenuView, setPropertyMenuView] = useState<PropertyMenuView>(\n PropertyMenuView.DEFAULT,\n );\n const [selectedGroupProperty, setSelectedGroupProperty] =\n useState<GroupPropertyType | undefined>(undefined);\n const [selectedCalculatedProperty, setSelectedCalculatedProperty] =\n useState<CalculatedPropertyType | undefined>(undefined);\n const [selectedCustomCalculation, setSelectedCustomCalculation] =\n useState<CustomCalculationType | undefined>(undefined);\n const [isInformationPanelOpen, setIsInformationPanelOpen] =\n useState<boolean>(false);\n const [resolvedHiliteIds, setResolvedHiliteIds] = useState<string[]>([]);\n const [keySet, setKeySet] = useState<KeySet>();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n\n const fetchGroupProperties = useMemo(\n () => {\n return async () => mappingClient.getGroupProperties((await getAccessToken()), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingGroupProperties, data: groupProperties, refreshData: refreshGroupProperties } =\n useCombinedFetchRefresh<GroupPropertyType>(fetchGroupProperties);\n\n const fetchCalculatedProperties = useMemo(\n () => {\n return async () => mappingClient.getCalculatedProperties((await getAccessToken()), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCalculatedProperties, data: calculatedProperties, refreshData: refreshCalculatedProperties } =\n useCombinedFetchRefresh<CalculatedPropertyType>(fetchCalculatedProperties);\n\n const fetchCustomCalculations = useMemo(\n () => {\n return async () => mappingClient.getCustomCalculations((await getAccessToken()), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCustomCalculations, data: customCalculations, refreshData: refreshCustomCalculations } =\n useCombinedFetchRefresh<CustomCalculationType>(fetchCustomCalculations);\n\n useEffect(() => {\n const initialize = async () => {\n try {\n const ids = await fetchIdsFromQuery(group.query ?? \"\", iModelConnection);\n if (ids.length === 0) {\n toaster.warning(\"The query is valid but produced no results.\");\n await goBack();\n }\n const keys = await manufactureKeys(ids, iModelConnection);\n setKeySet(keys);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n clearEmphasizedOverriddenElements();\n const resolvedIds = await visualizeElementsByKeys(keys, \"red\");\n await zoomToElements(resolvedIds);\n setResolvedHiliteIds(resolvedIds);\n setIsLoading(false);\n } catch {\n toaster.negative(`Could not load ${group.groupName}.`);\n await goBack();\n }\n };\n void initialize();\n }, [iModelConnection, group.query, goBack, group.groupName]);\n\n const onGroupPropertyModify = useCallback(\n (value: CellProps<GroupPropertyType>) => {\n setSelectedGroupProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_GROUP_PROPERTY);\n },\n [],\n );\n\n const onCalculatedPropertyModify = useCallback(\n (value: CellProps<CalculatedPropertyType>) => {\n setSelectedCalculatedProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CALCULATED_PROPERTY);\n },\n [],\n );\n\n const onCustomCalculationModify = useCallback(\n (value: CellProps<CustomCalculationType>) => {\n setSelectedCustomCalculation(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CUSTOM_CALCULATION);\n },\n [],\n );\n\n const groupPropertyReturn = useCallback(async (modified: boolean) => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshGroupProperties();\n }, [refreshGroupProperties]);\n\n const calculatedPropertyReturn = useCallback(async (modified: boolean) => {\n visualizeElements(resolvedHiliteIds, \"red\");\n await zoomToElements(resolvedHiliteIds);\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshCalculatedProperties();\n }, [resolvedHiliteIds, refreshCalculatedProperties]);\n\n const customCalculationReturn = useCallback(async (modified: boolean) => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshCustomCalculations();\n }, [refreshCustomCalculations]);\n\n if (isLoading) {\n return (\n <div className='loading-overlay'>\n <Text>Loading Group</Text>\n <ProgressRadial indeterminate />\n <Text>Please wait...</Text>\n </div>\n );\n }\n\n switch (propertyMenuView) {\n case PropertyMenuView.ADD_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n keySet={keySet ?? new KeySet()}\n returnFn={groupPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n keySet={keySet ?? new KeySet()}\n groupPropertyId={selectedGroupProperty?.id ?? \"\"}\n groupPropertyName={selectedGroupProperty?.propertyName ?? \"\"}\n returnFn={groupPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n property={selectedCalculatedProperty}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n properties={convertToPropertyMap(groupProperties, calculatedProperties, customCalculations)}\n returnFn={customCalculationReturn}\n />\n );\n case PropertyMenuView.MODIFY_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n properties={convertToPropertyMap(groupProperties, calculatedProperties, customCalculations, selectedCustomCalculation?.propertyName)}\n customCalculation={selectedCustomCalculation}\n returnFn={customCalculationReturn}\n />\n );\n default:\n return (\n <InformationPanelWrapper className='property-menu-wrapper'>\n <div className='property-header'>\n <WidgetHeader\n title={`${group.groupName ?? \"\"}`}\n returnFn={goBack}\n />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <SvgProperties />\n </IconButton>\n </div>\n <div className='property-menu-container'>\n {!hideGroupProps && (\n <div className='property-table'>\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onGroupPropertyModify={onGroupPropertyModify}\n setSelectedGroupProperty={setSelectedGroupProperty}\n setGroupModifyView={setPropertyMenuView}\n isLoadingGroupProperties={isLoadingGroupProperties}\n groupProperties={groupProperties}\n refreshGroupProperties={refreshGroupProperties}\n selectedGroupProperty={selectedGroupProperty}\n />\n </div>\n )}\n\n {!hideCalculatedProps && (\n <div className='property-table'>\n <CalculatedPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onCalculatedPropertyModify={onCalculatedPropertyModify}\n setSelectedCalculatedProperty={setSelectedCalculatedProperty}\n setGroupModifyView={setPropertyMenuView}\n isLoadingCalculatedProperties={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties}\n refreshCalculatedProperties={refreshCalculatedProperties}\n selectedCalculatedProperty={selectedCalculatedProperty}\n />\n </div>\n )}\n {!hideCustomCalculationProps && (\n <div className='property-table'>\n <CustomCalculationTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onCustomCalculationModify={onCustomCalculationModify}\n setSelectedCustomCalculation={setSelectedCustomCalculation}\n setGroupModifyView={setPropertyMenuView}\n isLoadingCustomCalculations={isLoadingCustomCalculations}\n customCalculations={customCalculations}\n refreshCustomCalculations={refreshCustomCalculations}\n selectedCustomCalculation={selectedCustomCalculation}\n />\n </div>\n )}\n </div>\n <InformationPanel\n className='information-panel'\n isOpen={isInformationPanelOpen}\n >\n <InformationPanelHeader\n onClose={() => setIsInformationPanelOpen(false)}\n >\n <Text variant='subheading'>{`${group.groupName ?? \"\"} Information`}</Text>\n </InformationPanelHeader>\n <InformationPanelBody>\n <div className='information-body'>\n <LabeledTextarea\n label='Query'\n rows={15}\n readOnly\n defaultValue={group.query ?? \"\"}\n />\n </div>\n </InformationPanelBody>\n </InformationPanel>\n </InformationPanelWrapper>\n );\n }\n};\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyMenu.js","sourceRoot":"","sources":["../../../../src/widget/components/PropertyMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,iCAAiC,EACjC,eAAe,EACf,iB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AC,oBAAoB;wBACnB,6BAAK,SAAS,EAAC,kBAAkB;4BAC/B,oBAAC,eAAe,IACd,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,EAAE,EACR,QAAQ,QACR,YAAY,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,EAAE,GAC/B,CACE,CACe,CACN,CACK,CAC3B,CAAC;KACL;AACH,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 { IModelConnection } from \"@itwin/core-frontend\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\n\nimport { WidgetHeader } from \"./utils\";\nimport {\n clearEmphasizedOverriddenElements,\n manufactureKeys,\n visualizeElements,\n visualizeElementsByKeys,\n zoomToElements,\n} from \"./viewerUtils\";\nimport type { GroupType } from \"./Grouping\";\nimport \"./PropertyMenu.scss\";\nimport GroupPropertyAction from \"./GroupPropertyAction\";\nimport CalculatedPropertyAction from \"./CalculatedPropertyAction\";\nimport type { GroupPropertyType } from \"./GroupPropertyTable\";\nimport GroupPropertyTable from \"./GroupPropertyTable\";\nimport type {\n CalculatedPropertyType,\n} from \"./CalculatedPropertyTable\";\nimport CalculatedPropertyTable from \"./CalculatedPropertyTable\";\nimport {\n IconButton,\n InformationPanel,\n InformationPanelBody,\n InformationPanelHeader,\n InformationPanelWrapper,\n LabeledTextarea,\n ProgressRadial,\n Text,\n toaster,\n} from \"@itwin/itwinui-react\";\nimport type { CellProps } from \"react-table\";\nimport type {\n CustomCalculationType,\n} from \"./CustomCalculationTable\";\nimport CustomCalculationTable from \"./CustomCalculationTable\";\nimport CustomCalculationAction from \"./CustomCalculationAction\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { SvgProperties } from \"@itwin/itwinui-icons-react\";\nimport type { PossibleDataType, PropertyMap } from \"../../formula/Types\";\nimport { useCombinedFetchRefresh } from \"../hooks/useFetchData\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\n\ninterface PropertyModifyProps {\n iModelId: string;\n mappingId: string;\n group: GroupType;\n goBack: () => Promise<void>;\n hideGroupProps?: boolean;\n hideCalculatedProps?: boolean;\n hideCustomCalculationProps?: boolean;\n}\n\nexport enum PropertyMenuView {\n DEFAULT = \"default\",\n ADD_GROUP_PROPERTY = \"add_group_property\",\n MODIFY_GROUP_PROPERTY = \"modify_group_property\",\n ADD_CALCULATED_PROPERTY = \"add_calculated_property\",\n MODIFY_CALCULATED_PROPERTY = \"modify_calculated_property\",\n ADD_CUSTOM_CALCULATION = \"add_custom_calculation\",\n MODIFY_CUSTOM_CALCULATION = \"modify_custom_calculation\",\n}\n\nconst stringToPossibleDataType = (str?: string): PossibleDataType => {\n if (!str)\n return \"Undefined\";\n\n switch (str.toLowerCase()) {\n case \"double\":\n case \"number\": return \"Number\";\n case \"string\": return \"String\";\n case \"boolean\": return \"Boolean\";\n default: return \"Undefined\";\n }\n};\n\nconst convertToPropertyMap = (\n groupProperties: GroupPropertyType[],\n calculatedProperties: CalculatedPropertyType[],\n customCalculations: CustomCalculationType[],\n selectedPropertyName?: string\n): PropertyMap => {\n const map: PropertyMap = {};\n const selectedLowerName = selectedPropertyName?.toLowerCase();\n\n groupProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n calculatedProperties.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName)\n map[lowerName] = \"Number\";\n });\n\n customCalculations.forEach((p) => {\n const lowerName = p.propertyName?.toLowerCase();\n if (lowerName && lowerName !== selectedLowerName)\n map[lowerName] = stringToPossibleDataType(p.dataType);\n });\n\n return map;\n};\n\nexport const PropertyMenu = ({\n iModelId,\n mappingId,\n group,\n goBack,\n hideGroupProps = false,\n hideCalculatedProps = false,\n hideCustomCalculationProps = false,\n}: PropertyModifyProps) => {\n const groupId = group.id ?? \"\";\n\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n\n const iModelConnection = useActiveIModelConnection() as IModelConnection;\n const [propertyMenuView, setPropertyMenuView] = useState<PropertyMenuView>(\n PropertyMenuView.DEFAULT,\n );\n const [selectedGroupProperty, setSelectedGroupProperty] =\n useState<GroupPropertyType | undefined>(undefined);\n const [selectedCalculatedProperty, setSelectedCalculatedProperty] =\n useState<CalculatedPropertyType | undefined>(undefined);\n const [selectedCustomCalculation, setSelectedCustomCalculation] =\n useState<CustomCalculationType | undefined>(undefined);\n const [isInformationPanelOpen, setIsInformationPanelOpen] =\n useState<boolean>(false);\n const [resolvedHiliteIds, setResolvedHiliteIds] = useState<string[]>([]);\n const [keySet, setKeySet] = useState<KeySet>();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n\n const fetchGroupProperties = useMemo(\n () => {\n return async () => mappingClient.getGroupProperties((await getAccessToken()), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingGroupProperties, data: groupProperties, refreshData: refreshGroupProperties } =\n useCombinedFetchRefresh<GroupPropertyType>(fetchGroupProperties);\n\n const fetchCalculatedProperties = useMemo(\n () => {\n return async () => mappingClient.getCalculatedProperties((await getAccessToken()), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCalculatedProperties, data: calculatedProperties, refreshData: refreshCalculatedProperties } =\n useCombinedFetchRefresh<CalculatedPropertyType>(fetchCalculatedProperties);\n\n const fetchCustomCalculations = useMemo(\n () => {\n return async () => mappingClient.getCustomCalculations((await getAccessToken()), iModelId, mappingId, groupId);\n },\n [getAccessToken, mappingClient, iModelId, mappingId, groupId],\n );\n const { isLoading: isLoadingCustomCalculations, data: customCalculations, refreshData: refreshCustomCalculations } =\n useCombinedFetchRefresh<CustomCalculationType>(fetchCustomCalculations);\n\n useEffect(() => {\n const initialize = async () => {\n try {\n const query = group.query ?? \"\";\n const queryRowCount = await iModelConnection.queryRowCount(query);\n if (queryRowCount === 0) {\n toaster.warning(\"The query is valid but produced no results.\");\n await goBack();\n }\n const keys = await manufactureKeys(query, iModelConnection);\n setKeySet(keys);\n Presentation.selection.clearSelection(\n \"GroupingMappingWidget\",\n iModelConnection,\n );\n clearEmphasizedOverriddenElements();\n const resolvedIds = await visualizeElementsByKeys(keys, \"red\");\n await zoomToElements(resolvedIds);\n setResolvedHiliteIds(resolvedIds);\n setIsLoading(false);\n } catch {\n toaster.negative(`Could not load ${group.groupName}.`);\n await goBack();\n }\n };\n void initialize();\n }, [iModelConnection, group.query, goBack, group.groupName]);\n\n const onGroupPropertyModify = useCallback(\n (value: CellProps<GroupPropertyType>) => {\n setSelectedGroupProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_GROUP_PROPERTY);\n },\n [],\n );\n\n const onCalculatedPropertyModify = useCallback(\n (value: CellProps<CalculatedPropertyType>) => {\n setSelectedCalculatedProperty(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CALCULATED_PROPERTY);\n },\n [],\n );\n\n const onCustomCalculationModify = useCallback(\n (value: CellProps<CustomCalculationType>) => {\n setSelectedCustomCalculation(value.row.original);\n setPropertyMenuView(PropertyMenuView.MODIFY_CUSTOM_CALCULATION);\n },\n [],\n );\n\n const groupPropertyReturn = useCallback(async (modified: boolean) => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshGroupProperties();\n }, [refreshGroupProperties]);\n\n const calculatedPropertyReturn = useCallback(async (modified: boolean) => {\n visualizeElements(resolvedHiliteIds, \"red\");\n await zoomToElements(resolvedHiliteIds);\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshCalculatedProperties();\n }, [resolvedHiliteIds, refreshCalculatedProperties]);\n\n const customCalculationReturn = useCallback(async (modified: boolean) => {\n setPropertyMenuView(PropertyMenuView.DEFAULT);\n modified && await refreshCustomCalculations();\n }, [refreshCustomCalculations]);\n\n if (isLoading) {\n return (\n <div className='loading-overlay'>\n <Text>Loading Group</Text>\n <ProgressRadial indeterminate />\n <Text>Please wait...</Text>\n </div>\n );\n }\n\n switch (propertyMenuView) {\n case PropertyMenuView.ADD_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n keySet={keySet ?? new KeySet()}\n returnFn={groupPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_GROUP_PROPERTY:\n return (\n <GroupPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n keySet={keySet ?? new KeySet()}\n groupPropertyId={selectedGroupProperty?.id ?? \"\"}\n groupPropertyName={selectedGroupProperty?.propertyName ?? \"\"}\n returnFn={groupPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.MODIFY_CALCULATED_PROPERTY:\n return (\n <CalculatedPropertyAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n property={selectedCalculatedProperty}\n ids={resolvedHiliteIds}\n returnFn={calculatedPropertyReturn}\n />\n );\n case PropertyMenuView.ADD_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n properties={convertToPropertyMap(groupProperties, calculatedProperties, customCalculations)}\n returnFn={customCalculationReturn}\n />\n );\n case PropertyMenuView.MODIFY_CUSTOM_CALCULATION:\n return (\n <CustomCalculationAction\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n properties={convertToPropertyMap(groupProperties, calculatedProperties, customCalculations, selectedCustomCalculation?.propertyName)}\n customCalculation={selectedCustomCalculation}\n returnFn={customCalculationReturn}\n />\n );\n default:\n return (\n <InformationPanelWrapper className='property-menu-wrapper'>\n <div className='property-header'>\n <WidgetHeader\n title={`${group.groupName ?? \"\"}`}\n returnFn={goBack}\n />\n <IconButton\n styleType='borderless'\n onClick={() => setIsInformationPanelOpen(true)}\n >\n <SvgProperties />\n </IconButton>\n </div>\n <div className='property-menu-container'>\n {!hideGroupProps && (\n <div className='property-table'>\n <GroupPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onGroupPropertyModify={onGroupPropertyModify}\n setSelectedGroupProperty={setSelectedGroupProperty}\n setGroupModifyView={setPropertyMenuView}\n isLoadingGroupProperties={isLoadingGroupProperties}\n groupProperties={groupProperties}\n refreshGroupProperties={refreshGroupProperties}\n selectedGroupProperty={selectedGroupProperty}\n />\n </div>\n )}\n\n {!hideCalculatedProps && (\n <div className='property-table'>\n <CalculatedPropertyTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onCalculatedPropertyModify={onCalculatedPropertyModify}\n setSelectedCalculatedProperty={setSelectedCalculatedProperty}\n setGroupModifyView={setPropertyMenuView}\n isLoadingCalculatedProperties={isLoadingCalculatedProperties}\n calculatedProperties={calculatedProperties}\n refreshCalculatedProperties={refreshCalculatedProperties}\n selectedCalculatedProperty={selectedCalculatedProperty}\n />\n </div>\n )}\n {!hideCustomCalculationProps && (\n <div className='property-table'>\n <CustomCalculationTable\n iModelId={iModelId}\n mappingId={mappingId}\n groupId={groupId}\n onCustomCalculationModify={onCustomCalculationModify}\n setSelectedCustomCalculation={setSelectedCustomCalculation}\n setGroupModifyView={setPropertyMenuView}\n isLoadingCustomCalculations={isLoadingCustomCalculations}\n customCalculations={customCalculations}\n refreshCustomCalculations={refreshCustomCalculations}\n selectedCustomCalculation={selectedCustomCalculation}\n />\n </div>\n )}\n </div>\n <InformationPanel\n className='information-panel'\n isOpen={isInformationPanelOpen}\n >\n <InformationPanelHeader\n onClose={() => setIsInformationPanelOpen(false)}\n >\n <Text variant='subheading'>{`${group.groupName ?? \"\"} Information`}</Text>\n </InformationPanelHeader>\n <InformationPanelBody>\n <div className='information-body'>\n <LabeledTextarea\n label='Query'\n rows={15}\n readOnly\n defaultValue={group.query ?? \"\"}\n />\n </div>\n </InformationPanelBody>\n </InformationPanel>\n </InformationPanelWrapper>\n );\n }\n};\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ProjectGrid
|
|
2
|
-
import { SvgCalendar, SvgList, SvgSearch, SvgStarHollow, } from "@itwin/itwinui-icons-react";
|
|
1
|
+
import { ProjectGrid } from "@itwin/imodel-browser-react";
|
|
2
|
+
import { SvgCalendar, SvgClose, SvgList, SvgSearch, SvgStarHollow, } from "@itwin/itwinui-icons-react";
|
|
3
3
|
import { Button, HorizontalTabs, IconButton, LabeledInput, Tab, } from "@itwin/itwinui-react";
|
|
4
4
|
import React, { useCallback, useEffect, useState } from "react";
|
|
5
5
|
import { useGroupingMappingApiConfig } from "./context/GroupingApiConfigContext";
|
|
6
6
|
import "./SelectProject.scss";
|
|
7
7
|
const tabsWithIcons = [
|
|
8
|
-
React.createElement(Tab, { key:
|
|
9
|
-
React.createElement(Tab, { key:
|
|
10
|
-
React.createElement(Tab, { key:
|
|
8
|
+
React.createElement(Tab, { key: "favorite", label: "Favorite projects", startIcon: React.createElement(SvgStarHollow, null) }),
|
|
9
|
+
React.createElement(Tab, { key: "recents", label: "Recent projects", startIcon: React.createElement(SvgCalendar, null) }),
|
|
10
|
+
React.createElement(Tab, { key: "all", label: "My projects", startIcon: React.createElement(SvgList, null) }),
|
|
11
11
|
];
|
|
12
12
|
const SelectProject = ({ onSelect, onCancel }) => {
|
|
13
13
|
const { getAccessToken, prefix } = useGroupingMappingApiConfig();
|
|
@@ -15,7 +15,10 @@ const SelectProject = ({ onSelect, onCancel }) => {
|
|
|
15
15
|
const [searchInput, setSearchInput] = useState("");
|
|
16
16
|
const [activeSearchInput, setActiveSearchInput] = useState("");
|
|
17
17
|
const [accessToken, setAccessToken] = useState();
|
|
18
|
-
const [apiOverrides, setApiOverrides] = useState({
|
|
18
|
+
const [apiOverrides, setApiOverrides] = useState({
|
|
19
|
+
serverEnvironmentPrefix: prefix,
|
|
20
|
+
});
|
|
21
|
+
const [searched, setSearched] = useState(false);
|
|
19
22
|
useEffect(() => setApiOverrides({ serverEnvironmentPrefix: prefix }), [prefix]);
|
|
20
23
|
useEffect(() => {
|
|
21
24
|
const fetchAccessToken = async () => {
|
|
@@ -26,29 +29,34 @@ const SelectProject = ({ onSelect, onCancel }) => {
|
|
|
26
29
|
}, [getAccessToken]);
|
|
27
30
|
const startSearch = useCallback(() => {
|
|
28
31
|
setActiveSearchInput(searchInput);
|
|
32
|
+
setSearched(true);
|
|
29
33
|
}, [searchInput]);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
const clearSearch = useCallback(() => {
|
|
35
|
+
setSearchInput("");
|
|
36
|
+
setActiveSearchInput("");
|
|
37
|
+
setSearched(false);
|
|
38
|
+
}, []);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (searchInput.length === 0) {
|
|
41
|
+
setSearched(false);
|
|
42
|
+
clearSearch();
|
|
43
|
+
}
|
|
44
|
+
}, [searchInput, setSearched, clearSearch]);
|
|
45
|
+
return (React.createElement("div", { className: "select-project-grid-container" },
|
|
46
|
+
React.createElement(HorizontalTabs, { labels: tabsWithIcons, onTabSelected: setProjectType, activeIndex: projectType, type: "borderless", contentClassName: "grid-holding-tab" },
|
|
47
|
+
React.createElement(LabeledInput, { displayStyle: "inline", iconDisplayStyle: "inline", className: "search-input", label: "Search", value: searchInput, placeholder: "Search....", onChange: (event) => {
|
|
33
48
|
const { target: { value }, } = event;
|
|
34
49
|
setSearchInput(value);
|
|
35
50
|
}, onKeyDown: (event) => {
|
|
36
51
|
if (event.key === "Enter") {
|
|
37
52
|
startSearch();
|
|
38
53
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
React.createElement("div", { className: 'project-grid' },
|
|
46
|
-
React.createElement(ProjectGrid, { onThumbnailClick: onSelect, accessToken: accessToken, apiOverrides: apiOverrides, filterOptions: activeSearchInput, requestType: projectType === 0
|
|
47
|
-
? "favorites"
|
|
48
|
-
: projectType === 1
|
|
49
|
-
? "recents"
|
|
50
|
-
: "" })),
|
|
51
|
-
React.createElement("div", { className: 'select-project-action-panel' },
|
|
54
|
+
}, svgIcon: searched ? (React.createElement(IconButton, { onClick: clearSearch, styleType: "borderless" },
|
|
55
|
+
React.createElement(SvgClose, null))) : (React.createElement(IconButton, { onClick: startSearch, styleType: "borderless" },
|
|
56
|
+
React.createElement(SvgSearch, null))) })),
|
|
57
|
+
React.createElement("div", { className: "project-grid" },
|
|
58
|
+
React.createElement(ProjectGrid, { onThumbnailClick: onSelect, accessToken: accessToken, apiOverrides: apiOverrides, filterOptions: activeSearchInput, requestType: projectType === 0 ? "favorites" : projectType === 1 ? "recents" : "" })),
|
|
59
|
+
React.createElement("div", { className: "select-project-action-panel" },
|
|
52
60
|
React.createElement(Button, { onClick: onCancel }, "Cancel"))));
|
|
53
61
|
};
|
|
54
62
|
export default SelectProject;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectProject.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectProject.tsx"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"SelectProject.js","sourceRoot":"","sources":["../../../../src/widget/components/SelectProject.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,aAAa,GACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,MAAM,EACN,cAAc,EACd,UAAU,EACV,YA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EAAC,cAAc,EACxB,KAAK,EAAC,QAAQ,EACd,KAAK,EAAE,WAAW,EAClB,WAAW,EAAC,YAAY,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,MAAM,EACJ,MAAM,EAAE,EAAE,KAAK,EAAE,GAClB,GAAG,KAAK,CAAC;oBACV,cAAc,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC,EACD,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;oBACnB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE;wBACzB,WAAW,EAAE,CAAC;qBACf;gBACH,CAAC,EACD,OAAO,EACL,QAAQ,CAAC,CAAC,CAAC,CACT,oBAAC,UAAU,IAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAC,YAAY;oBACtD,oBAAC,QAAQ,OAAG,CACD,CACd,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU,IAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAC,YAAY;oBACtD,oBAAC,SAAS,OAAG,CACF,CACd,GAEH,CACa;QACjB,6BAAK,SAAS,EAAC,cAAc;YAC3B,oBAAC,WAAW,IACV,gBAAgB,EAAE,QAAQ,EAC1B,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,iBAAiB,EAChC,WAAW,EACT,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAEtE,CACE;QACN,6BAAK,SAAS,EAAC,6BAA6B;YAC1C,oBAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,aAAiB,CACtC,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport type {\n ApiOverrides,\n IModelFull,\n ProjectFull,\n} from \"@itwin/imodel-browser-react\";\nimport { ProjectGrid } from \"@itwin/imodel-browser-react\";\nimport {\n SvgCalendar,\n SvgClose,\n SvgList,\n SvgSearch,\n SvgStarHollow,\n} from \"@itwin/itwinui-icons-react\";\nimport {\n Button,\n HorizontalTabs,\n IconButton,\n LabeledInput,\n Tab,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport \"./SelectProject.scss\";\n\nconst tabsWithIcons = [\n <Tab\n key=\"favorite\"\n label=\"Favorite projects\"\n startIcon={<SvgStarHollow />}\n />,\n <Tab key=\"recents\" label=\"Recent projects\" startIcon={<SvgCalendar />} />,\n <Tab key=\"all\" label=\"My projects\" startIcon={<SvgList />} />,\n];\ninterface SelectProjectProps {\n onSelect: (project: ProjectFull) => void;\n onCancel: () => void;\n}\nconst SelectProject = ({ onSelect, onCancel }: SelectProjectProps) => {\n const { getAccessToken, prefix } = useGroupingMappingApiConfig();\n const [projectType, setProjectType] = useState<number>(0);\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [accessToken, setAccessToken] = useState<AccessToken>();\n const [apiOverrides, setApiOverrides] = useState<ApiOverrides<IModelFull[]>>({\n serverEnvironmentPrefix: prefix,\n });\n const [searched, setSearched] = useState<boolean>(false);\n\n useEffect(\n () => setApiOverrides({ serverEnvironmentPrefix: prefix }),\n [prefix]\n );\n\n useEffect(() => {\n const fetchAccessToken = async () => {\n const accessToken = await getAccessToken();\n setAccessToken(accessToken);\n };\n void fetchAccessToken();\n }, [getAccessToken]);\n\n const startSearch = useCallback(() => {\n setActiveSearchInput(searchInput);\n setSearched(true);\n }, [searchInput]);\n\n const clearSearch = useCallback(() => {\n setSearchInput(\"\");\n setActiveSearchInput(\"\");\n setSearched(false);\n }, []);\n\n useEffect(() => {\n if (searchInput.length === 0) {\n setSearched(false);\n clearSearch();\n }\n }, [searchInput, setSearched, clearSearch]);\n\n return (\n <div className=\"select-project-grid-container\">\n <HorizontalTabs\n labels={tabsWithIcons}\n onTabSelected={setProjectType}\n activeIndex={projectType}\n type={\"borderless\"}\n contentClassName=\"grid-holding-tab\"\n >\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"search-input\"\n label=\"Search\"\n value={searchInput}\n placeholder=\"Search....\"\n onChange={(event) => {\n const {\n target: { value },\n } = event;\n setSearchInput(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n startSearch();\n }\n }}\n svgIcon={\n searched ? (\n <IconButton onClick={clearSearch} styleType=\"borderless\">\n <SvgClose />\n </IconButton>\n ) : (\n <IconButton onClick={startSearch} styleType=\"borderless\">\n <SvgSearch />\n </IconButton>\n )\n }\n />\n </HorizontalTabs>\n <div className=\"project-grid\">\n <ProjectGrid\n onThumbnailClick={onSelect}\n accessToken={accessToken}\n apiOverrides={apiOverrides}\n filterOptions={activeSearchInput}\n requestType={\n projectType === 0 ? \"favorites\" : projectType === 1 ? \"recents\" : \"\"\n }\n />\n </div>\n <div className=\"select-project-action-panel\">\n <Button onClick={onCancel}>Cancel</Button>\n </div>\n </div>\n );\n};\n\nexport default SelectProject;\n"]}
|
|
@@ -138,13 +138,13 @@ export class PropertyGrid extends React.Component {
|
|
|
138
138
|
render() {
|
|
139
139
|
var _a, _b;
|
|
140
140
|
if (this.state.loadStart) {
|
|
141
|
-
return (React.createElement("div", { className: "
|
|
141
|
+
return (React.createElement("div", { className: "gmw-components-property-grid-loader" },
|
|
142
142
|
React.createElement(ProgressRadial, { indeterminate: true })));
|
|
143
143
|
}
|
|
144
|
-
return (React.createElement("div", { className: "table-box-inner" },
|
|
145
|
-
React.createElement(PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: (_a = this.props.isPropertySelectionEnabled) !== null && _a !== void 0 ? _a : false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, isPropertyHoverEnabled: (_b = this.props.isPropertyHoverEnabled) !== null && _b !== void 0 ? _b : false, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged }, (selectionContext) => (React.createElement("div", { className: classnames("components-property-grid-wrapper", this.props.className), style: this.props.style },
|
|
146
|
-
React.createElement("div", { className: classnames("components-property-grid", "components-smallEditor-host") },
|
|
147
|
-
React.createElement("div", { className: "property-categories" }, this.state.categories.map((categorizedRecords) => (React.createElement(NestedCategoryBlock, { ...selectionContext, key: categorizedRecords.category.name, categorizedRecords: categorizedRecords, onCategoryExpansionToggled: this._onCategoryExpansionToggled, orientation: this.state.orientation, propertyValueRendererManager: this.props.propertyValueRendererManager, actionButtonRenderers: this.props.actionButtonRenderers }))))),
|
|
144
|
+
return (React.createElement("div", { className: "gmw-table-box-inner" },
|
|
145
|
+
React.createElement(PropertyGridEventsRelatedPropsSupplier, { isPropertySelectionEnabled: (_a = this.props.isPropertySelectionEnabled) !== null && _a !== void 0 ? _a : false, isPropertySelectionOnRightClickEnabled: this.props.isPropertySelectionOnRightClickEnabled, isPropertyEditingEnabled: this.props.isPropertyEditingEnabled, isPropertyHoverEnabled: (_b = this.props.isPropertyHoverEnabled) !== null && _b !== void 0 ? _b : false, onPropertyContextMenu: this.props.onPropertyContextMenu, onPropertyUpdated: this.props.onPropertyUpdated, onPropertySelectionChanged: this.props.onPropertySelectionChanged }, (selectionContext) => (React.createElement("div", { className: classnames("gmw-components-property-grid-wrapper", this.props.className), style: this.props.style },
|
|
146
|
+
React.createElement("div", { className: classnames("gmw-components-property-grid", "components-smallEditor-host") },
|
|
147
|
+
React.createElement("div", { className: "gmw-property-categories" }, this.state.categories.map((categorizedRecords) => (React.createElement(NestedCategoryBlock, { ...selectionContext, key: categorizedRecords.category.name, categorizedRecords: categorizedRecords, onCategoryExpansionToggled: this._onCategoryExpansionToggled, orientation: this.state.orientation, propertyValueRendererManager: this.props.propertyValueRendererManager, actionButtonRenderers: this.props.actionButtonRenderers }))))),
|
|
148
148
|
React.createElement(ResizableContainerObserver, { onResize: this._onResize }))))));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
@@ -167,6 +167,6 @@ const NestedCategoryBlock = (props) => {
|
|
|
167
167
|
const [width, setWidth] = React.useState(1);
|
|
168
168
|
return (React.createElement(PropertyCategoryBlock, { category: props.categorizedRecords.category, onExpansionToggled: props.onCategoryExpansionToggled },
|
|
169
169
|
props.categorizedRecords.records.length ? (React.createElement(ColumnResizingPropertyListPropsSupplier, { orientation: props.orientation, width: width }, (partialListProps) => (React.createElement(PropertyList, { ...partialListProps, orientation: props.orientation, category: props.categorizedRecords.category, properties: props.categorizedRecords.records, selectedPropertyKey: props.selectedPropertyKey, onPropertyClicked: props.onPropertyClicked, onPropertyRightClicked: props.onPropertyRightClicked, onPropertyContextMenu: props.onPropertyContextMenu, propertyValueRendererManager: props.propertyValueRendererManager, editingPropertyKey: props.editingPropertyKey, onEditCommit: props.onEditCommit, onEditCancel: props.onEditCancel, isPropertyHoverEnabled: props.isPropertyHoverEnabled, isPropertySelectionEnabled: props.isPropertySelectionEnabled, isPropertyRightClickSelectionEnabled: props.isPropertyRightClickSelectionEnabled, actionButtonRenderers: props.actionButtonRenderers, setWidth: setWidth, width: width })))) : undefined,
|
|
170
|
-
props.categorizedRecords.children.length ? (React.createElement("div", { className: "property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
|
|
170
|
+
props.categorizedRecords.children.length ? (React.createElement("div", { className: "gmw-property-categories" }, props.categorizedRecords.children.map((categorizedChildRecords) => (React.createElement(NestedCategoryBlock, { ...props, key: categorizedChildRecords.category.name, categorizedRecords: categorizedChildRecords }))))) : undefined));
|
|
171
171
|
};
|
|
172
172
|
//# sourceMappingURL=PropertyGrid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyGrid.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,uCAAuC,EAAE,MAAM,iHAAiH,CAAC;AAC1K,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,qBAAqB,CAAC;AAG7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAwCtD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAGvC;IAQC,gBAAgB;IAChB,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QARP,eAAU,GAAG,KAAK,CAAC;QACnB,qBAAgB,GAAG,KAAK,CAAC;QACzB,2BAAsB,GAAG,KAAK,CAAC;QA2D/B,2BAAsB,GAAG,GAAG,EAAE;YACpC,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;QACzB,CAAC,CAAC;QAqEM,cAAS,GAAG,CAAC,KAAa,EAAE,EAAE;YACpC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC;QAEM,gCAA2B,GAAG,CAAC,YAAoB,EA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AAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAC1C,kBAAkB,EAAE,uBAAuB,GAC3C,CACH,CAAC,CACE,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,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 classnames from \"classnames\";\nimport { produce } from \"immer\";\nimport * as React from \"react\";\nimport type { DisposeFunc } from \"@itwin/core-bentley\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n CommonPropertyGridProps,\n PropertyCategory,\n PropertyData,\n} from \"@itwin/components-react\";\nimport {\n PropertyCategoryBlock,\n PropertyGridCommons,\n PropertyGridEventsRelatedPropsSupplier,\n} from \"@itwin/components-react\";\nimport type { ColumnResizeRelatedPropertyListProps } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { ColumnResizingPropertyListPropsSupplier } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\n\nimport type { PropertyListProps } from \"./PropertyList\";\nimport { PropertyList } from \"./PropertyList\";\nimport \"./PropertyGrid.scss\";\n\nimport type { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport { GroupQueryBuilderContext } from \"../context/GroupQueryBuilderContext\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/** Properties for [[PropertyGrid]] React component\n * @public\n */\nexport interface PropertyGridProps extends CommonPropertyGridProps {\n /** Property data provider */\n dataProvider: PresentationPropertyDataProvider;\n}\n\n/** Property Category in the [[PropertyGrid]] state\n * @public\n * @deprecated This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.\n */\nexport interface PropertyGridCategory {\n propertyCategory: PropertyCategory;\n propertyCount: number;\n properties: PropertyRecord[];\n}\n\ninterface CategorizedPropertyGridRecords {\n category: PropertyCategory;\n records: PropertyRecord[];\n children: CategorizedPropertyGridRecords[];\n}\n\n/** State of [[PropertyGrid]] React component\n * @internal\n */\ninterface PropertyGridState {\n /** List of PropertyGrid categories */\n categories: CategorizedPropertyGridRecords[];\n /** Actual orientation used by the property grid */\n orientation: Orientation;\n /** If property grid currently loading data, the loading start time */\n loadStart?: Date;\n /** Width of PropertyGrid */\n width: number;\n}\n\n/** PropertyGrid React component.\n * @public\n */\nexport class PropertyGrid extends React.Component<\nPropertyGridProps,\nPropertyGridState\n> {\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\n private _isMounted = false;\n private _isInDataRequest = false;\n private _hasPendingDataRequest = false;\n\n static override contextType = GroupQueryBuilderContext;\n\n /** @internal */\n constructor(props: PropertyGridProps) {\n super(props);\n this.state = {\n categories: [],\n orientation: this.getPreferredOrientation(),\n width: 0,\n };\n }\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n /** @internal */\n public override componentWillUnmount() {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n this._dataChangesListenerDisposeFunc = undefined;\n }\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyGridProps) {\n if (this.props.dataProvider !== prevProps.dataProvider) {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n }\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n if (\n this.props.orientation !== prevProps.orientation ||\n this.props.isOrientationFixed !== prevProps.isOrientationFixed ||\n this.props.horizontalOrientationMinWidth !==\n prevProps.horizontalOrientationMinWidth\n ) {\n this.updateOrientation(this.state.width);\n }\n }\n\n private _onPropertyDataChanged = () => {\n void this.gatherData();\n };\n\n private async gatherData(): Promise<void> {\n if (this._isInDataRequest) {\n this._hasPendingDataRequest = true;\n return;\n }\n\n this.setState((prev) =>\n prev.loadStart ? null : { loadStart: new Date() }\n );\n\n this._isInDataRequest = true;\n let propertyData: PropertyData;\n try {\n propertyData = await this.props.dataProvider.getData();\n } finally {\n this._isInDataRequest = false;\n }\n\n if (!this._isMounted) {\n return;\n }\n\n if (this._hasPendingDataRequest) {\n this._hasPendingDataRequest = false;\n return this.gatherData();\n }\n\n this.setState((prevState) => {\n const buildCategoriesHierarchy = (\n newCategories: PropertyCategory[],\n stateCategories: CategorizedPropertyGridRecords[] | undefined\n ) =>\n newCategories.map((category): CategorizedPropertyGridRecords => {\n const matchingStateCategory = findCategory(\n stateCategories ?? [],\n category.name,\n false\n );\n return {\n category: {\n ...category,\n expand:\n matchingStateCategory?.category?.expand ?? category.expand,\n },\n records: propertyData.records[category.name] ?? [],\n children: buildCategoriesHierarchy(\n category.childCategories ?? [],\n matchingStateCategory?.children\n ),\n };\n });\n return {\n categories: buildCategoriesHierarchy(\n propertyData.categories,\n prevState.categories\n ),\n loadStart: undefined,\n };\n });\n }\n\n private getPreferredOrientation(): Orientation {\n return this.props.orientation !== undefined\n ? this.props.orientation\n : Orientation.Horizontal;\n }\n\n private _onResize = (width: number) => {\n this.updateOrientation(width);\n };\n\n private _onCategoryExpansionToggled = (categoryName: string) => {\n this.setState((state) => {\n return produce(state, (draft) => {\n const records = findCategory(draft.categories, categoryName, true);\n // istanbul ignore else\n if (records) {\n const category = records.category;\n category.expand = !category.expand;\n }\n });\n });\n };\n\n private updateOrientation(width: number): void {\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {\n ...this.props,\n };\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(\n width,\n orientation,\n isOrientationFixed,\n horizontalOrientationMinWidth\n );\n\n if (\n currentOrientation !== this.state.orientation ||\n width !== this.state.width\n ) {\n this.setState({ orientation: currentOrientation, width });\n }\n }\n\n /** @internal */\n public override render() {\n if (this.state.loadStart) {\n return (\n <div className=\"gm-components-property-grid-loader\">\n <ProgressRadial indeterminate />\n </div>\n );\n }\n\n return (\n <div className=\"table-box-inner\">\n <PropertyGridEventsRelatedPropsSupplier\n isPropertySelectionEnabled={\n this.props.isPropertySelectionEnabled ?? false\n }\n isPropertySelectionOnRightClickEnabled={\n this.props.isPropertySelectionOnRightClickEnabled\n }\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\n onPropertyContextMenu={this.props.onPropertyContextMenu}\n onPropertyUpdated={this.props.onPropertyUpdated}\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\n >\n {(selectionContext) => (\n <div\n className={classnames(\n \"components-property-grid-wrapper\",\n this.props.className\n )}\n style={this.props.style}\n >\n <div\n className={classnames(\n \"components-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <div className=\"property-categories\">\n {this.state.categories.map(\n (categorizedRecords: CategorizedPropertyGridRecords) => (\n <NestedCategoryBlock\n {...selectionContext}\n key={categorizedRecords.category.name}\n categorizedRecords={categorizedRecords}\n onCategoryExpansionToggled={\n this._onCategoryExpansionToggled\n }\n orientation={this.state.orientation}\n propertyValueRendererManager={\n this.props.propertyValueRendererManager\n }\n actionButtonRenderers={this.props.actionButtonRenderers}\n />\n )\n )}\n </div>\n </div>\n <ResizableContainerObserver onResize={this._onResize} />\n </div>\n )}\n </PropertyGridEventsRelatedPropsSupplier>\n </div>\n );\n }\n}\n\nfunction findCategory(\n categories: CategorizedPropertyGridRecords[],\n lookupName: string,\n recurseIntoChildren: boolean\n): CategorizedPropertyGridRecords | undefined {\n for (const category of categories) {\n if (category.category.name === lookupName) {\n return category;\n }\n if (recurseIntoChildren) {\n const matchingChild = findCategory(\n category.children,\n lookupName,\n recurseIntoChildren\n );\n if (matchingChild) {\n return matchingChild;\n }\n }\n }\n return undefined;\n}\n\ninterface NestedCategoryBlockProps\n extends Omit<\n PropertyListProps,\n keyof ColumnResizeRelatedPropertyListProps | \"properties\"\n > {\n categorizedRecords: CategorizedPropertyGridRecords;\n onCategoryExpansionToggled: (categoryName: string) => void;\n orientation: Orientation;\n}\nconst NestedCategoryBlock = (props: NestedCategoryBlockProps) => {\n const [width, setWidth] = React.useState(1);\n return (\n <PropertyCategoryBlock\n category={props.categorizedRecords.category}\n onExpansionToggled={props.onCategoryExpansionToggled}\n >\n {props.categorizedRecords.records.length ? (\n <ColumnResizingPropertyListPropsSupplier\n orientation={props.orientation}\n width={width}\n >\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\n <PropertyList\n {...partialListProps}\n orientation={props.orientation}\n category={props.categorizedRecords.category}\n properties={props.categorizedRecords.records}\n selectedPropertyKey={props.selectedPropertyKey}\n onPropertyClicked={props.onPropertyClicked}\n onPropertyRightClicked={props.onPropertyRightClicked}\n onPropertyContextMenu={props.onPropertyContextMenu}\n propertyValueRendererManager={props.propertyValueRendererManager}\n editingPropertyKey={props.editingPropertyKey}\n onEditCommit={props.onEditCommit}\n onEditCancel={props.onEditCancel}\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\n isPropertyRightClickSelectionEnabled={\n props.isPropertyRightClickSelectionEnabled\n }\n actionButtonRenderers={props.actionButtonRenderers}\n setWidth={setWidth}\n width={width}\n />\n )}\n </ColumnResizingPropertyListPropsSupplier>\n ) : undefined}\n {props.categorizedRecords.children.length ? (\n <div className=\"property-categories\">\n {props.categorizedRecords.children.map((categorizedChildRecords) => (\n <NestedCategoryBlock\n {...props}\n key={categorizedChildRecords.category.name}\n categorizedRecords={categorizedChildRecords}\n />\n ))}\n </div>\n ) : undefined}\n </PropertyCategoryBlock>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyGrid.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyGrid.tsx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AAE,EAAE,CAAC,CAC3D,oBAAC,YAAY,OACP,gBAAgB,EACpB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,QAAQ,EAC3C,UAAU,EAAE,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAC5C,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,4BAA4B,EAAE,KAAK,CAAC,4BAA4B,EAChE,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,0BAA0B,EAAE,KAAK,CAAC,0BAA0B,EAC5D,oCAAoC,EAClC,KAAK,CAAC,oCAAoC,EAE5C,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,GACZ,CACH,CACuC,CAC3C,CAAC,CAAC,CAAC,SAAS;QACZ,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1C,6BAAK,SAAS,EAAC,yBAAyB,IACrC,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAClE,oBAAC,mBAAmB,OACd,KAAK,EACT,GAAG,EAAE,uBAAuB,CAAC,QAAQ,CAAC,IAAI,EAC1C,kBAAkB,EAAE,uBAAuB,GAC3C,CACH,CAAC,CACE,CACP,CAAC,CAAC,CAAC,SAAS,CACS,CACzB,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 classnames from \"classnames\";\nimport { produce } from \"immer\";\nimport * as React from \"react\";\nimport type { DisposeFunc } from \"@itwin/core-bentley\";\nimport type { PropertyRecord } from \"@itwin/appui-abstract\";\nimport type {\n CommonPropertyGridProps,\n PropertyCategory,\n PropertyData,\n} from \"@itwin/components-react\";\nimport {\n PropertyCategoryBlock,\n PropertyGridCommons,\n PropertyGridEventsRelatedPropsSupplier,\n} from \"@itwin/components-react\";\nimport type { ColumnResizeRelatedPropertyListProps } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { ColumnResizingPropertyListPropsSupplier } from \"@itwin/components-react/lib/cjs/components-react/propertygrid/component/ColumnResizingPropertyListPropsSupplier\";\nimport { Orientation, ResizableContainerObserver } from \"@itwin/core-react\";\n\nimport type { PropertyListProps } from \"./PropertyList\";\nimport { PropertyList } from \"./PropertyList\";\nimport \"./PropertyGrid.scss\";\n\nimport type { PresentationPropertyDataProvider } from \"@itwin/presentation-components\";\nimport { GroupQueryBuilderContext } from \"../context/GroupQueryBuilderContext\";\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\n\n/** Properties for [[PropertyGrid]] React component\n * @public\n */\nexport interface PropertyGridProps extends CommonPropertyGridProps {\n /** Property data provider */\n dataProvider: PresentationPropertyDataProvider;\n}\n\n/** Property Category in the [[PropertyGrid]] state\n * @public\n * @deprecated This was part of [[PropertyGrid]] internal state and should've never been public. The component is not using it anymore.\n */\nexport interface PropertyGridCategory {\n propertyCategory: PropertyCategory;\n propertyCount: number;\n properties: PropertyRecord[];\n}\n\ninterface CategorizedPropertyGridRecords {\n category: PropertyCategory;\n records: PropertyRecord[];\n children: CategorizedPropertyGridRecords[];\n}\n\n/** State of [[PropertyGrid]] React component\n * @internal\n */\ninterface PropertyGridState {\n /** List of PropertyGrid categories */\n categories: CategorizedPropertyGridRecords[];\n /** Actual orientation used by the property grid */\n orientation: Orientation;\n /** If property grid currently loading data, the loading start time */\n loadStart?: Date;\n /** Width of PropertyGrid */\n width: number;\n}\n\n/** PropertyGrid React component.\n * @public\n */\nexport class PropertyGrid extends React.Component<\nPropertyGridProps,\nPropertyGridState\n> {\n private _dataChangesListenerDisposeFunc?: DisposeFunc;\n private _isMounted = false;\n private _isInDataRequest = false;\n private _hasPendingDataRequest = false;\n\n static override contextType = GroupQueryBuilderContext;\n\n /** @internal */\n constructor(props: PropertyGridProps) {\n super(props);\n this.state = {\n categories: [],\n orientation: this.getPreferredOrientation(),\n width: 0,\n };\n }\n\n /** @internal */\n public override componentDidMount() {\n this._isMounted = true;\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n /** @internal */\n public override componentWillUnmount() {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n this._dataChangesListenerDisposeFunc = undefined;\n }\n this._isMounted = false;\n }\n\n public override componentDidUpdate(prevProps: PropertyGridProps) {\n if (this.props.dataProvider !== prevProps.dataProvider) {\n // istanbul ignore else\n if (this._dataChangesListenerDisposeFunc) {\n this._dataChangesListenerDisposeFunc();\n }\n this._dataChangesListenerDisposeFunc =\n this.props.dataProvider.onDataChanged.addListener(\n this._onPropertyDataChanged\n );\n\n void this.gatherData();\n }\n\n if (\n this.props.orientation !== prevProps.orientation ||\n this.props.isOrientationFixed !== prevProps.isOrientationFixed ||\n this.props.horizontalOrientationMinWidth !==\n prevProps.horizontalOrientationMinWidth\n ) {\n this.updateOrientation(this.state.width);\n }\n }\n\n private _onPropertyDataChanged = () => {\n void this.gatherData();\n };\n\n private async gatherData(): Promise<void> {\n if (this._isInDataRequest) {\n this._hasPendingDataRequest = true;\n return;\n }\n\n this.setState((prev) =>\n prev.loadStart ? null : { loadStart: new Date() }\n );\n\n this._isInDataRequest = true;\n let propertyData: PropertyData;\n try {\n propertyData = await this.props.dataProvider.getData();\n } finally {\n this._isInDataRequest = false;\n }\n\n if (!this._isMounted) {\n return;\n }\n\n if (this._hasPendingDataRequest) {\n this._hasPendingDataRequest = false;\n return this.gatherData();\n }\n\n this.setState((prevState) => {\n const buildCategoriesHierarchy = (\n newCategories: PropertyCategory[],\n stateCategories: CategorizedPropertyGridRecords[] | undefined\n ) =>\n newCategories.map((category): CategorizedPropertyGridRecords => {\n const matchingStateCategory = findCategory(\n stateCategories ?? [],\n category.name,\n false\n );\n return {\n category: {\n ...category,\n expand:\n matchingStateCategory?.category?.expand ?? category.expand,\n },\n records: propertyData.records[category.name] ?? [],\n children: buildCategoriesHierarchy(\n category.childCategories ?? [],\n matchingStateCategory?.children\n ),\n };\n });\n return {\n categories: buildCategoriesHierarchy(\n propertyData.categories,\n prevState.categories\n ),\n loadStart: undefined,\n };\n });\n }\n\n private getPreferredOrientation(): Orientation {\n return this.props.orientation !== undefined\n ? this.props.orientation\n : Orientation.Horizontal;\n }\n\n private _onResize = (width: number) => {\n this.updateOrientation(width);\n };\n\n private _onCategoryExpansionToggled = (categoryName: string) => {\n this.setState((state) => {\n return produce(state, (draft) => {\n const records = findCategory(draft.categories, categoryName, true);\n // istanbul ignore else\n if (records) {\n const category = records.category;\n category.expand = !category.expand;\n }\n });\n });\n };\n\n private updateOrientation(width: number): void {\n const { orientation, isOrientationFixed, horizontalOrientationMinWidth } = {\n ...this.props,\n };\n const currentOrientation = PropertyGridCommons.getCurrentOrientation(\n width,\n orientation,\n isOrientationFixed,\n horizontalOrientationMinWidth\n );\n\n if (\n currentOrientation !== this.state.orientation ||\n width !== this.state.width\n ) {\n this.setState({ orientation: currentOrientation, width });\n }\n }\n\n /** @internal */\n public override render() {\n if (this.state.loadStart) {\n return (\n <div className=\"gmw-components-property-grid-loader\">\n <ProgressRadial indeterminate />\n </div>\n );\n }\n\n return (\n <div className=\"gmw-table-box-inner\">\n <PropertyGridEventsRelatedPropsSupplier\n isPropertySelectionEnabled={\n this.props.isPropertySelectionEnabled ?? false\n }\n isPropertySelectionOnRightClickEnabled={\n this.props.isPropertySelectionOnRightClickEnabled\n }\n isPropertyEditingEnabled={this.props.isPropertyEditingEnabled}\n isPropertyHoverEnabled={this.props.isPropertyHoverEnabled ?? false}\n onPropertyContextMenu={this.props.onPropertyContextMenu}\n onPropertyUpdated={this.props.onPropertyUpdated}\n onPropertySelectionChanged={this.props.onPropertySelectionChanged}\n >\n {(selectionContext) => (\n <div\n className={classnames(\n \"gmw-components-property-grid-wrapper\",\n this.props.className\n )}\n style={this.props.style}\n >\n <div\n className={classnames(\n \"gmw-components-property-grid\",\n \"components-smallEditor-host\"\n )}\n >\n <div className= \"gmw-property-categories\">\n {this.state.categories.map(\n (categorizedRecords: CategorizedPropertyGridRecords) => (\n <NestedCategoryBlock\n {...selectionContext}\n key={categorizedRecords.category.name}\n categorizedRecords={categorizedRecords}\n onCategoryExpansionToggled={\n this._onCategoryExpansionToggled\n }\n orientation={this.state.orientation}\n propertyValueRendererManager={\n this.props.propertyValueRendererManager\n }\n actionButtonRenderers={this.props.actionButtonRenderers}\n />\n )\n )}\n </div>\n </div>\n <ResizableContainerObserver onResize={this._onResize} />\n </div>\n )}\n </PropertyGridEventsRelatedPropsSupplier>\n </div>\n );\n }\n}\n\nfunction findCategory(\n categories: CategorizedPropertyGridRecords[],\n lookupName: string,\n recurseIntoChildren: boolean\n): CategorizedPropertyGridRecords | undefined {\n for (const category of categories) {\n if (category.category.name === lookupName) {\n return category;\n }\n if (recurseIntoChildren) {\n const matchingChild = findCategory(\n category.children,\n lookupName,\n recurseIntoChildren\n );\n if (matchingChild) {\n return matchingChild;\n }\n }\n }\n return undefined;\n}\n\ninterface NestedCategoryBlockProps\n extends Omit<\n PropertyListProps,\n keyof ColumnResizeRelatedPropertyListProps | \"properties\"\n > {\n categorizedRecords: CategorizedPropertyGridRecords;\n onCategoryExpansionToggled: (categoryName: string) => void;\n orientation: Orientation;\n}\nconst NestedCategoryBlock = (props: NestedCategoryBlockProps) => {\n const [width, setWidth] = React.useState(1);\n return (\n <PropertyCategoryBlock\n category={props.categorizedRecords.category}\n onExpansionToggled={props.onCategoryExpansionToggled}\n >\n {props.categorizedRecords.records.length ? (\n <ColumnResizingPropertyListPropsSupplier\n orientation={props.orientation}\n width={width}\n >\n {(partialListProps: ColumnResizeRelatedPropertyListProps) => (\n <PropertyList\n {...partialListProps}\n orientation={props.orientation}\n category={props.categorizedRecords.category}\n properties={props.categorizedRecords.records}\n selectedPropertyKey={props.selectedPropertyKey}\n onPropertyClicked={props.onPropertyClicked}\n onPropertyRightClicked={props.onPropertyRightClicked}\n onPropertyContextMenu={props.onPropertyContextMenu}\n propertyValueRendererManager={props.propertyValueRendererManager}\n editingPropertyKey={props.editingPropertyKey}\n onEditCommit={props.onEditCommit}\n onEditCancel={props.onEditCancel}\n isPropertyHoverEnabled={props.isPropertyHoverEnabled}\n isPropertySelectionEnabled={props.isPropertySelectionEnabled}\n isPropertyRightClickSelectionEnabled={\n props.isPropertyRightClickSelectionEnabled\n }\n actionButtonRenderers={props.actionButtonRenderers}\n setWidth={setWidth}\n width={width}\n />\n )}\n </ColumnResizingPropertyListPropsSupplier>\n ) : undefined}\n {props.categorizedRecords.children.length ? (\n <div className=\"gmw-property-categories\">\n {props.categorizedRecords.children.map((categorizedChildRecords) => (\n <NestedCategoryBlock\n {...props}\n key={categorizedChildRecords.category.name}\n categorizedRecords={categorizedChildRecords}\n />\n ))}\n </div>\n ) : undefined}\n </PropertyCategoryBlock>\n );\n};\n"]}
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
@import '~@itwin/core-react/lib/cjs/core-react/expandable/list';
|
|
6
6
|
@import '~@itwin/core-react/lib/cjs/core-react/scrollbar';
|
|
7
7
|
|
|
8
|
-
.
|
|
8
|
+
.gmw-components-property-grid-loader {
|
|
9
9
|
display: flex;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
align-items: center;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.components-property-grid {
|
|
15
|
-
.property-categories {
|
|
14
|
+
.gmw-components-property-grid {
|
|
15
|
+
.gmw-property-categories {
|
|
16
16
|
@include uicore-expandable-blocks-list;
|
|
17
17
|
|
|
18
18
|
display: grid;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
color: $buic-foreground-body;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.components-property-grid-wrapper {
|
|
30
|
+
.gmw-components-property-grid-wrapper {
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 100%;
|
|
33
33
|
overflow-y: auto;
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
@include uicore-scrollbar();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
@mixin components-property-list {
|
|
39
|
+
@mixin gmw-components-property-list {
|
|
40
40
|
width: 100%;
|
|
41
41
|
|
|
42
|
-
.components--selected {
|
|
42
|
+
.gmw-components--selected {
|
|
43
43
|
background-color: $buic-row-selection;
|
|
44
44
|
outline: 1px solid $buic-foreground-primary;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.components--clickable {
|
|
47
|
+
.gmw-components--clickable {
|
|
48
48
|
cursor: pointer;
|
|
49
49
|
|
|
50
50
|
&:hover {
|
|
@@ -52,20 +52,20 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.components--hoverable:hover {
|
|
55
|
+
.gmw-components--hoverable:hover {
|
|
56
56
|
background-color: $buic-row-hover;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.components-property-list--horizontal {
|
|
61
|
-
@include components-property-list;
|
|
60
|
+
.gmw-components-property-list--horizontal {
|
|
61
|
+
@include gmw-components-property-list;
|
|
62
62
|
|
|
63
63
|
display: grid;
|
|
64
64
|
grid-row-gap: 0px;
|
|
65
65
|
overflow: hidden;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.components-property-list--vertical {
|
|
69
|
-
@include components-property-list;
|
|
68
|
+
.gmw-components-property-list--vertical {
|
|
69
|
+
@include gmw-components-property-list;
|
|
70
70
|
// margin-top: -13px;
|
|
71
71
|
}
|
|
@@ -50,7 +50,7 @@ export class PropertyList extends React.Component {
|
|
|
50
50
|
}
|
|
51
51
|
/** @internal */
|
|
52
52
|
render() {
|
|
53
|
-
const propertyListClassName = classnames((this.props.orientation === Orientation.Horizontal) ? "components-property-list--horizontal" : "components-property-list--vertical", this.props.className);
|
|
53
|
+
const propertyListClassName = classnames((this.props.orientation === Orientation.Horizontal) ? "gmw-components-property-list--horizontal" : "gmw-components-property-list--vertical", this.props.className);
|
|
54
54
|
return (React.createElement("div", { className: propertyListClassName, style: this.props.style, ref: this._listRef }, this.props.properties.map((propertyRecord) => {
|
|
55
55
|
const key = this.props.category ? getPropertyKey(this.props.category, propertyRecord) : propertyRecord.property.name;
|
|
56
56
|
return (React.createElement(PropertyRenderer, { key: key, uniqueKey: key, isHoverable: this.props.isPropertyHoverEnabled, isSelectable: this.props.isPropertySelectionEnabled, isSelected: key === this.props.selectedPropertyKey, propertyRecord: propertyRecord, orientation: this.props.orientation, onClick: propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyClicked : undefined, onRightClick: propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyRightClicked : undefined, onContextMenu: this.props.onPropertyContextMenu, columnRatio: this.props.columnRatio, onColumnRatioChanged: this.props.onColumnChanged, propertyValueRendererManager: this.props.propertyValueRendererManager, isEditing: key === this.props.editingPropertyKey, onEditCommit: this._onEditCommit, onEditCancel: this.props.onEditCancel, actionButtonRenderers: this.props.actionButtonRenderers, isResizeHandleHovered: this.props.isResizeHandleHovered, onResizeHandleHoverChanged: this.props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: this.props.isResizeHandleBeingDragged, onResizeHandleDragChanged: this.props.onResizeHandleDragChanged, columnInfo: this.props.columnInfo, width: this.props.width }));
|
|
@@ -1 +1 @@
|
|
|
1
|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,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACrD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC5B;IACH,CAAC;IAED,gBAAgB;IACA,iBAAiB;QAC/B,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,gBAAgB;IACA,kBAAkB;QAChC,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,qBAAqB,GAAG,UAAU,CACtC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,KAAK,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"PropertyList.js","sourceRoot":"","sources":["../../../../../src/widget/components/property-grid/PropertyList.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AA2CpD;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,gBAAkC,EAAE,cAA8B;IAC/F,OAAO,gBAAgB,CAAC,IAAI,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK,CAAC,SAA4B;IAElE,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QAGP,aAAQ,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAC;QAE7C,kBAAa,GAAG,CAAC,IAAyB,EAAE,EAAE;YACpD,uBAAuB;YACvB,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,IAAI,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AA0B,EACjE,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,0BAA0B,EACjE,yBAAyB,EAAE,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAC/D,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GACvB,CAAC,CAAC;QACR,CAAC,CAAC,CACE,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PropertyGrid\n */\n\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type { PropertyRecord} from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport type { CommonProps, RatioChangeResult } from \"@itwin/core-react\";\nimport { Orientation } from \"@itwin/core-react\";\nimport type {\n ActionButtonRenderer,\n PropertyCategory,\n PropertyUpdatedArgs,\n PropertyValueRendererManager,\n} from \"@itwin/components-react\";\n\nimport { PropertyRenderer } from \"./PropertyRender\";\nimport type { PropertyGridColumnInfo } from \"@itwin/components-react/lib/cjs/components-react/properties/renderers/PropertyGridColumns\";\n\n/** Properties of [[PropertyList]] React component\n * @public\n */\nexport interface PropertyListProps extends CommonProps {\n orientation: Orientation;\n category?: PropertyCategory;\n properties: PropertyRecord[];\n selectedPropertyKey?: string;\n onPropertyClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyRightClicked?: (property: PropertyRecord, key?: string) => void;\n onPropertyContextMenu?: (property: PropertyRecord, e: React.MouseEvent) => void;\n columnRatio?: number;\n /** Callback to column ratio changed event */\n onColumnChanged?: (ratio: number) => void | RatioChangeResult;\n propertyValueRendererManager?: PropertyValueRendererManager;\n editingPropertyKey?: string;\n onEditCommit?: (args: PropertyUpdatedArgs, category: PropertyCategory) => void;\n onEditCancel?: () => void;\n /** Enables/disables property hovering effect */\n isPropertyHoverEnabled?: boolean;\n /** Enables/disables property selection */\n isPropertySelectionEnabled?: boolean;\n /** Enables/disables property right click selection */\n isPropertyRightClickSelectionEnabled?: boolean;\n /** Array of action button renderers */\n actionButtonRenderers?: ActionButtonRenderer[];\n /** Is resize handle hovered */\n isResizeHandleHovered?: boolean;\n /** Callback to hover event change */\n onResizeHandleHoverChanged?: (isHovered: boolean) => void;\n /** Is resize handle being dragged */\n isResizeHandleBeingDragged?: boolean;\n /** Callback to drag event change */\n onResizeHandleDragChanged?: (isDragStarted: boolean) => void;\n /** Information for styling property grid columns */\n columnInfo?: PropertyGridColumnInfo;\n setWidth?: React.Dispatch<React.SetStateAction<number>>;\n width: number;\n}\n\n/**\n * Get unique key for property record\n * @internal\n */\nexport function getPropertyKey(propertyCategory: PropertyCategory, propertyRecord: PropertyRecord) {\n return propertyCategory.name + propertyRecord.property.name;\n}\n\n/** A React component that renders multiple properties within a category as a list.\n * @public\n */\nexport class PropertyList extends React.Component<PropertyListProps> {\n\n constructor(props: PropertyListProps) {\n super(props);\n }\n\n private _listRef = React.createRef<HTMLDivElement>();\n\n private _onEditCommit = (args: PropertyUpdatedArgs) => {\n // istanbul ignore else\n if (this.props.onEditCommit && this.props.category)\n this.props.onEditCommit(args, this.props.category);\n };\n\n private afterRender() {\n if (\n this.props.orientation !== Orientation.Horizontal ||\n !this._listRef.current\n ) {\n return;\n }\n const width = this._listRef.current.getBoundingClientRect().width;\n if (this.props.setWidth && width !== this.props.width) {\n this.props.setWidth(width);\n }\n }\n\n /** @internal */\n public override componentDidMount() {\n this.afterRender();\n }\n\n /** @internal */\n public override componentDidUpdate() {\n this.afterRender();\n }\n\n /** @internal */\n public override render() {\n const propertyListClassName = classnames(\n (this.props.orientation === Orientation.Horizontal) ? \"gmw-components-property-list--horizontal\" : \"gmw-components-property-list--vertical\",\n this.props.className,\n );\n\n return (\n <div className={propertyListClassName} style={this.props.style} ref={this._listRef}>\n {this.props.properties.map((propertyRecord: PropertyRecord) => {\n const key = this.props.category ? getPropertyKey(this.props.category, propertyRecord) : propertyRecord.property.name;\n return (\n <PropertyRenderer\n key={key}\n uniqueKey={key}\n isHoverable={this.props.isPropertyHoverEnabled}\n isSelectable={this.props.isPropertySelectionEnabled}\n isSelected={key === this.props.selectedPropertyKey}\n propertyRecord={propertyRecord}\n orientation={this.props.orientation}\n onClick={propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyClicked : undefined}\n onRightClick={propertyRecord.value.valueFormat === PropertyValueFormat.Primitive ? this.props.onPropertyRightClicked : undefined}\n onContextMenu={this.props.onPropertyContextMenu}\n columnRatio={this.props.columnRatio}\n onColumnRatioChanged={this.props.onColumnChanged}\n propertyValueRendererManager={this.props.propertyValueRendererManager}\n isEditing={key === this.props.editingPropertyKey}\n onEditCommit={this._onEditCommit}\n onEditCancel={this.props.onEditCancel}\n actionButtonRenderers={this.props.actionButtonRenderers}\n isResizeHandleHovered={this.props.isResizeHandleHovered}\n onResizeHandleHoverChanged={this.props.onResizeHandleHoverChanged}\n isResizeHandleBeingDragged={this.props.isResizeHandleBeingDragged}\n onResizeHandleDragChanged={this.props.onResizeHandleDragChanged}\n columnInfo={this.props.columnInfo}\n width={this.props.width}\n />);\n })}\n </div>\n );\n }\n}\n"]}
|
|
@@ -172,8 +172,8 @@ export const PropertyView = (props) => {
|
|
|
172
172
|
};
|
|
173
173
|
const getClassName = (viewProps) => {
|
|
174
174
|
let propertyRecordClassName = viewProps.orientation === Orientation.Horizontal
|
|
175
|
-
? "components-property-record--horizontal"
|
|
176
|
-
: "components-property-record--vertical";
|
|
175
|
+
? "gmw-components-property-record--horizontal"
|
|
176
|
+
: "gmw-components-property-record--vertical";
|
|
177
177
|
if (viewProps.isSelected) {
|
|
178
178
|
propertyRecordClassName += " components--selected";
|
|
179
179
|
}
|
|
@@ -192,15 +192,15 @@ export const PropertyView = (props) => {
|
|
|
192
192
|
const columnsStyleProvider = new PropertyGridColumnStyleProvider(props.columnInfo);
|
|
193
193
|
const offset = CommonPropertyRenderer.getLabelOffset(props.indentation, props.orientation, props.width, props.columnRatio, (_a = props.columnInfo) === null || _a === void 0 ? void 0 : _a.minLabelWidth);
|
|
194
194
|
return (React.createElement("div", { style: columnsStyleProvider.getStyle(props.orientation, needActionButtons, ratio, needElementSeparator), className: getClassName(props), onClick: _onClick, onContextMenu: _onContextMenu, onMouseEnter: _onMouseEnter, onMouseLeave: _onMouseLeave, role: "presentation" },
|
|
195
|
-
React.createElement("div", { className: "components-property-record-label" },
|
|
195
|
+
React.createElement("div", { className: "gmw-components-property-record-label" },
|
|
196
196
|
props.propertyRecord.value.valueFormat ===
|
|
197
|
-
PropertyValueFormat.Primitive && (React.createElement(Checkbox, { style: { marginLeft: offset }, className: "components-property-selection-checkbox", checked: isPropertySelected, onChange: _onPropertySelectionChanged, disabled: context.isLoading ||
|
|
197
|
+
PropertyValueFormat.Primitive && (React.createElement(Checkbox, { style: { marginLeft: offset }, className: "gmw-components-property-selection-checkbox", checked: isPropertySelected, onChange: _onPropertySelectionChanged, disabled: context.isLoading ||
|
|
198
198
|
context.isRendering ||
|
|
199
199
|
props.propertyRecord.value.value === undefined, isLoading: isCheckboxLoading })),
|
|
200
200
|
props.labelElement),
|
|
201
201
|
needElementSeparator ? (React.createElement(ElementSeparator, { movableArea: props.width, onRatioChanged: props.onColumnRatioChanged, ratio: ratio, orientation: props.orientation, isResizeHandleHovered: props.isResizeHandleHovered, onResizeHandleHoverChanged: props.onResizeHandleHoverChanged, isResizeHandleBeingDragged: props.isResizeHandleBeingDragged, onResizeHandleDragChanged: props.onResizeHandleDragChanged })) : undefined,
|
|
202
202
|
props.propertyRecord.value.valueFormat ===
|
|
203
|
-
PropertyValueFormat.Primitive ? (React.createElement("div", { className: "components-property-record-value" },
|
|
203
|
+
PropertyValueFormat.Primitive ? (React.createElement("div", { className: "gmw-components-property-record-value" },
|
|
204
204
|
React.createElement("span", null, props.valueElementRenderer
|
|
205
205
|
? props.valueElementRenderer()
|
|
206
206
|
: props.valueElement))) : undefined,
|