@itwin/grouping-mapping-widget 0.9.3 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/grouping-mapping-widget.d.ts +9 -3
- package/lib/cjs/grouping-mapping-widget.js +15 -3
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/test/GroupingMappingCustomUI.test.js +49 -86
- package/lib/cjs/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/cjs/test/test-utils.d.ts +0 -6
- package/lib/cjs/test/test-utils.js +8 -24
- package/lib/cjs/test/test-utils.js.map +1 -1
- package/lib/cjs/widget/components/ActionPanel.d.ts +1 -1
- package/lib/cjs/widget/components/ActionPanel.js +1 -1
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.d.ts +5 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +10 -9
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.d.ts +13 -9
- package/lib/cjs/widget/components/GroupAction.js +56 -58
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.d.ts +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyUtils.js +4 -0
- package/lib/cjs/widget/components/GroupPropertyUtils.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.d.ts +8 -9
- package/lib/cjs/widget/components/Grouping.js +118 -273
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +2 -2
- package/lib/cjs/widget/components/GroupingMapping.d.ts +28 -21
- package/lib/cjs/widget/components/GroupingMapping.js +59 -38
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/GroupingMappingContent.d.ts +8 -0
- package/lib/cjs/widget/components/GroupingMappingContent.js +47 -0
- package/lib/cjs/widget/components/GroupingMappingContent.js.map +1 -0
- package/lib/cjs/widget/components/GroupingMappingContext.d.ts +31 -0
- package/lib/cjs/widget/components/GroupingMappingContext.js +84 -0
- package/lib/cjs/widget/components/GroupingMappingContext.js.map +1 -0
- package/lib/cjs/widget/components/GroupingMappingHeader.d.ts +8 -0
- package/lib/cjs/widget/components/GroupingMappingHeader.js +17 -0
- package/lib/cjs/widget/components/GroupingMappingHeader.js.map +1 -0
- package/lib/cjs/widget/components/GroupingMappingRouter.d.ts +8 -0
- package/lib/cjs/widget/components/GroupingMappingRouter.js +87 -0
- package/lib/cjs/widget/components/GroupingMappingRouter.js.map +1 -0
- package/lib/cjs/widget/components/Mapping.d.ts +12 -2
- package/lib/cjs/widget/components/Mapping.js +57 -84
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.d.ts +9 -5
- package/lib/cjs/widget/components/MappingAction.js +19 -8
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.d.ts +5 -1
- package/lib/cjs/widget/components/MappingImportWizardModal.js +11 -7
- package/lib/cjs/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/cjs/widget/components/QueryBuilder.js +2 -7
- package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
- package/lib/cjs/widget/components/SelectMappings.d.ts +5 -1
- package/lib/cjs/widget/components/SelectMappings.js +8 -4
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.d.ts +15 -0
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js +45 -0
- package/lib/cjs/widget/components/context/GroupHilitedElementsContext.js.map +1 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.d.ts +1 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js +1 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.d.ts +6 -2
- package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js +5 -5
- package/lib/cjs/widget/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/cjs/widget/components/customUI/DefaultGroupingUI.d.ts +3 -0
- package/lib/cjs/widget/components/customUI/DefaultGroupingUI.js +40 -0
- package/lib/cjs/widget/components/customUI/DefaultGroupingUI.js.map +1 -0
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +5 -0
- package/lib/cjs/widget/components/{GroupQueryBuilderContainer.js → customUI/GroupQueryBuilderCustomUI.js} +36 -16
- package/lib/cjs/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -0
- package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.d.ts +3 -2
- package/lib/cjs/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -2
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js +2 -1
- package/lib/cjs/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.d.ts +1 -2
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js +2 -1
- package/lib/cjs/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/cjs/widget/components/groupsHelpers.d.ts +7 -0
- package/lib/cjs/widget/components/groupsHelpers.js +84 -0
- package/lib/cjs/widget/components/groupsHelpers.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.js +29 -15
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/cjs/widget/components/utils.d.ts +1 -3
- package/lib/cjs/widget/components/utils.js +1 -26
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +9 -3
- package/lib/esm/grouping-mapping-widget.js +7 -1
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/test/GroupingMappingCustomUI.test.js +46 -83
- package/lib/esm/test/GroupingMappingCustomUI.test.js.map +1 -1
- package/lib/esm/test/test-utils.d.ts +0 -6
- package/lib/esm/test/test-utils.js +7 -22
- package/lib/esm/test/test-utils.js.map +1 -1
- package/lib/esm/widget/components/ActionPanel.d.ts +1 -1
- package/lib/esm/widget/components/ActionPanel.js +1 -1
- package/lib/esm/widget/components/ActionPanel.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.d.ts +5 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js +10 -9
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.d.ts +13 -9
- package/lib/esm/widget/components/GroupAction.js +57 -61
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.d.ts +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyUtils.js +4 -0
- package/lib/esm/widget/components/GroupPropertyUtils.js.map +1 -1
- package/lib/esm/widget/components/Grouping.d.ts +8 -9
- package/lib/esm/widget/components/Grouping.js +122 -277
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +2 -2
- package/lib/esm/widget/components/GroupingMapping.d.ts +28 -21
- package/lib/esm/widget/components/GroupingMapping.js +59 -39
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/GroupingMappingContent.d.ts +8 -0
- package/lib/esm/widget/components/GroupingMappingContent.js +24 -0
- package/lib/esm/widget/components/GroupingMappingContent.js.map +1 -0
- package/lib/esm/widget/components/GroupingMappingContext.d.ts +31 -0
- package/lib/esm/widget/components/GroupingMappingContext.js +61 -0
- package/lib/esm/widget/components/GroupingMappingContext.js.map +1 -0
- package/lib/esm/widget/components/GroupingMappingHeader.d.ts +8 -0
- package/lib/esm/widget/components/GroupingMappingHeader.js +10 -0
- package/lib/esm/widget/components/GroupingMappingHeader.js.map +1 -0
- package/lib/esm/widget/components/GroupingMappingRouter.d.ts +8 -0
- package/lib/esm/widget/components/GroupingMappingRouter.js +80 -0
- package/lib/esm/widget/components/GroupingMappingRouter.js.map +1 -0
- package/lib/esm/widget/components/Mapping.d.ts +12 -2
- package/lib/esm/widget/components/Mapping.js +59 -86
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/MappingAction.d.ts +9 -5
- package/lib/esm/widget/components/MappingAction.js +18 -9
- package/lib/esm/widget/components/MappingAction.js.map +1 -1
- package/lib/esm/widget/components/MappingImportWizardModal.d.ts +5 -1
- package/lib/esm/widget/components/MappingImportWizardModal.js +11 -7
- package/lib/esm/widget/components/MappingImportWizardModal.js.map +1 -1
- package/lib/esm/widget/components/QueryBuilder.js +2 -7
- package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
- package/lib/esm/widget/components/SelectMappings.d.ts +5 -1
- package/lib/esm/widget/components/SelectMappings.js +8 -4
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.d.ts +15 -0
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js +22 -0
- package/lib/esm/widget/components/context/GroupHilitedElementsContext.js.map +1 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.d.ts +1 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js +1 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js.map +1 -1
- package/lib/esm/widget/components/context/GroupingMappingCustomUIContext.d.ts +6 -2
- package/lib/esm/widget/components/context/GroupingMappingCustomUIContext.js +5 -5
- package/lib/esm/widget/components/context/GroupingMappingCustomUIContext.js.map +1 -1
- package/lib/esm/widget/components/customUI/DefaultGroupingUI.d.ts +3 -0
- package/lib/esm/widget/components/customUI/DefaultGroupingUI.js +34 -0
- package/lib/esm/widget/components/customUI/DefaultGroupingUI.js.map +1 -0
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.d.ts +5 -0
- package/lib/esm/widget/components/{GroupQueryBuilderContainer.js → customUI/GroupQueryBuilderCustomUI.js} +11 -7
- package/lib/esm/widget/components/customUI/GroupQueryBuilderCustomUI.js.map +1 -0
- package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.d.ts +3 -2
- package/lib/esm/widget/components/customUI/GroupingMappingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.d.ts +1 -2
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js +1 -2
- package/lib/esm/widget/components/customUI/ManualGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.d.ts +1 -2
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js +1 -2
- package/lib/esm/widget/components/customUI/SearchGroupingCustomUI.js.map +1 -1
- package/lib/esm/widget/components/groupsHelpers.d.ts +7 -0
- package/lib/esm/widget/components/groupsHelpers.js +77 -0
- package/lib/esm/widget/components/groupsHelpers.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyView.js +1 -3
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/esm/widget/components/utils.d.ts +1 -3
- package/lib/esm/widget/components/utils.js +0 -24
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/package.json +3 -3
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.d.ts +0 -5
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js.map +0 -1
- package/lib/esm/widget/components/GroupQueryBuilderContainer.d.ts +0 -5
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js.map +0 -1
- /package/lib/cjs/widget/components/{GroupQueryBuilder.scss → customUI/GroupQueryBuilderCustomUI.scss} +0 -0
- /package/lib/esm/widget/components/{GroupQueryBuilder.scss → customUI/GroupQueryBuilderCustomUI.scss} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,6CAAwD;AAExD,oEAAiE;AACjE,oDAA+D;AAE/D,wDAa8B;AAC9B,+CAAyE;AACzE,gEAAwC;AACxC,sEAAwE;AACxE,mCAAoD;AACpD,yEAAkE;AAClE,iFAAiF;AACjF,qDAAkD;AAClD,4DAAgE;AAKhE,oEAMoC;AAEpC,wCAQuB;AACvB,gDAK2B;AAC3B,sFAA8D;AAC9D,8DAAgC;AAChC,sCAAoC;AAEpC,6DAK8B;AAYjB,QAAA,6BAA6B,GAAiC;IACzE,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7C,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE;IACnD,EAAE,KAAK,EAAE,8BAAY,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3C,EAAE,KAAK,EAAE,8BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC/C,EA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,CAAC,iBAAiB,EAAE,EACvD,OAAO,EAAE,kBAAkB,CAAC,aAAa,EACzC,WAAW,EACT,8BAAC,0BAAU,IACT,SAAS,EAAC,YAAY;oBACtB,8BAAC,+BAAS,OAAG,CACF,EACf,UAAU,EAAE,uCAAK,SAAS,EAAC,eAAe;oBAAE,8BAAC,2CAAqB,OAAG,CAAM,GAC3E,CAAC,CAAC,CAAC,IAAI,CACC,CACH,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { renderToStaticMarkup } from \"react-dom/server\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nimport { PropertyValueFormat } from \"@itwin/presentation-common\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport {\n Alert,\n Button,\n Fieldset,\n IconButton,\n Label,\n LabeledInput,\n LabeledSelect,\n Modal,\n ModalButtonBar,\n Small,\n Surface,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, WidgetHeader } from \"./utils\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { HorizontalTile } from \"./HorizontalTile\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport type {\n GroupProperty,\n GroupPropertyCreate,\n} from \"@itwin/insights-client\";\nimport {\n SvgClose,\n SvgDragHandleVertical,\n SvgMoreVerticalSmall,\n SvgRemove,\n SvgSearch,\n} from \"@itwin/itwinui-icons-react\";\nimport type { DragEndEvent, DragStartEvent } from \"@dnd-kit/core\";\nimport {\n closestCenter,\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport SortableHorizontalTile from \"./SortableHorizontalTile\";\nimport Split from \"react-split\";\nimport \"./GroupPropertyAction.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport {\n convertPresentationFields,\n convertToECProperties,\n fetchPresentationDescriptor,\n findProperties,\n} from \"./GroupPropertyUtils\";\n\ninterface GroupPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n groupPropertyId?: string;\n groupPropertyName?: string;\n keySet: KeySet;\n returnFn: (modified: boolean) => Promise<void>;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<QuantityType>[] = [\n { value: QuantityType.Area, label: \"Area\" },\n { value: QuantityType.Distance, label: \"Distance\" },\n { value: QuantityType.Force, label: \"Force\" },\n { value: QuantityType.Mass, label: \"Mass\" },\n { value: QuantityType.Monetary, label: \"Monetary\" },\n { value: QuantityType.Time, label: \"Time\" },\n { value: QuantityType.Volume, label: \"Volume\" },\n { value: QuantityType.Undefined, label: \"No Quantity Type\" },\n];\n\nconst GroupPropertyAction = ({\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupPropertyName,\n keySet,\n returnFn,\n}: GroupPropertyActionProps) => {\n const iModelConnection = useActiveIModelConnection();\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(DataType.Undefined);\n const [quantityType, setQuantityType] = useState<QuantityType>(QuantityType.Undefined);\n const [selectedProperties, setSelectedProperties] = useState<PropertyMetaData[]>([]);\n const [propertiesMetaData, setPropertiesMetaData] = useState<PropertyMetaData[]>([]);\n const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = useState<boolean>(false);\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [searched, setSearched] = useState<boolean>(false);\n const [activeDragProperty, setActiveDragProperty] = useState<PropertyMetaData | undefined>();\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n const [showModal, setShowModal] = useState<boolean>(false);\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n const { active } = event;\n const activeProperty = selectedProperties.find((p) => active.id === p.key);\n setActiveDragProperty(activeProperty);\n }, [selectedProperties]);\n\n const handleDragEnd = useCallback((event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && (active.id !== over.id)) {\n setSelectedProperties((items) => {\n const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);\n const newIndex = selectedProperties.findIndex((p) => over.id === p.key);\n\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n\n setActiveDragProperty(undefined);\n }, [selectedProperties]);\n\n const filteredProperties = useMemo(\n () =>\n propertiesMetaData.filter((p) =>\n [p.displayLabel, p.categoryLabel, p.actualECClassName]\n .map((l) => l.toLowerCase())\n .some((l) => l.includes(activeSearchInput.toLowerCase()))\n ),\n [activeSearchInput, propertiesMetaData]\n );\n\n useEffect(() => {\n const generateProperties = async () => {\n setIsLoading(true);\n\n if (!iModelConnection) return;\n\n const descriptor = await fetchPresentationDescriptor(iModelConnection, keySet);\n\n // Only allow primitives and structs\n const propertyFields =\n descriptor?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n const propertiesMetaData = convertPresentationFields(propertyFields);\n\n setPropertiesMetaData(propertiesMetaData);\n\n if (groupPropertyId) {\n const accessToken = await getAccessToken();\n let response: GroupProperty | undefined;\n try {\n response = await mappingClient.getGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId\n );\n\n setPropertyName(response.propertyName);\n setDataType(response.dataType);\n setQuantityType(response.quantityType);\n const properties = findProperties(response.ecProperties, propertiesMetaData);\n if (properties.length === 0) {\n setPropertiesNotFoundAlert(true);\n }\n\n setSelectedProperties(properties);\n } catch (error: any) {\n handleError(error.status);\n }\n }\n\n setIsLoading(false);\n };\n void generateProperties();\n }, [getAccessToken, mappingClient, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);\n\n const onSave = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const groupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: selectedProperties.map((p) => convertToECProperties(p)).flat(),\n };\n groupPropertyId\n ? await mappingClient.updateGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupProperty\n )\n : await mappingClient.createGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupProperty\n );\n await returnFn(true);\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n };\n\n const startSearch = useCallback(() => {\n if (!searchInput) return;\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 <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <WidgetHeader\n title={groupPropertyName ?? \"Add Property\"}\n returnFn={async () => returnFn(false)}\n />\n <div className='gmw-group-property-action-container'>\n <Fieldset disabled={isLoading} className='gmw-property-options' legend='Property Details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={\"Data Type\"}\n id='dataType'\n options={[\n { value: DataType.Boolean, label: \"Boolean\" },\n { value: DataType.Number, label: \"Number\" },\n { value: DataType.String, label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n {propertiesNotFoundAlert &&\n <Alert type=\"warning\">\n Warning: Could not match saved properties from the current generated list. It does not confirm or deny validity. Overwriting will occur if a new selection is made and saved.\n </Alert>\n }\n <Fieldset className='gmw-property-view-container' legend=\"Mapped Properties\">\n <div className=\"gmw-property-view-button\">\n <Button\n onClick={async () => setShowModal(true)}\n disabled={isLoading}\n >\n Select Properties\n </Button>\n </div>\n <div className=\"gmw-properties-list\">\n {selectedProperties.length === 0 && !isLoading ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Press the "Select Properties" button for options.</Text>\n </div> :\n selectedProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={null}\n />\n ))}\n </div>\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={async () => returnFn(false)}\n isLoading={isLoading}\n isSavingDisabled={\n selectedProperties.length === 0 || !propertyName || !dataType\n }\n />\n <Modal\n title=\"Properties Selection\"\n isOpen={showModal}\n onClose={() => {\n setShowModal(false);\n clearSearch();\n }}\n closeOnExternalClick={false}\n >\n <Split\n expandToMin={false}\n className=\"gmw-property-selection-container\"\n gutterAlign=\"center\"\n gutterSize={2}\n gutter={() => {\n // Expects HTMLElement\n const dragHangle = renderToStaticMarkup(<div className=\"gmw-gutter-drag-icon\"><SvgMoreVerticalSmall /></div>);\n const gutter = document.createElement(\"div\");\n gutter.className = `gmw-gutter`;\n gutter.innerHTML = dragHangle;\n return gutter;\n }}\n direction=\"horizontal\">\n <Surface className=\"gmw-available-properties\" elevation={1}>\n <div className=\"gmw-available-properties-header\">\n <Label as=\"span\">Available Properties</Label>\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"gmw-available-prop-search\"\n value={searchInput}\n size=\"small\"\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 </div>\n {filteredProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties available. </Text>\n </div> :\n <div className=\"gmw-properties-list\">\n {\n filteredProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={null}\n selected={selectedProperties.some((p) => property.key === p.key)}\n onClick={() =>\n setSelectedProperties((sp) =>\n sp.some((p) => property.key === p.key)\n ? sp.filter(\n (p) => property.key !== p.key\n )\n : [...sp, property]\n )\n }\n />\n ))}\n </div>}\n </Surface>\n <Surface className=\"gmw-selected-properties\" elevation={1}>\n <Label as=\"span\">Selected Properties</Label>\n {selectedProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Add some by clicking on the properties shown left.</Text>\n </div> :\n <div className=\"gmw-properties-list\" >\n <SortableContext\n items={selectedProperties.map((p) => p.key)}\n strategy={verticalListSortingStrategy}\n >\n {selectedProperties.map((property) =>\n <SortableHorizontalTile\n key={property.key}\n id={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={\n <div>\n <IconButton\n styleType=\"borderless\"\n title=\"Remove\"\n onClick={() => {\n setSelectedProperties((sp) => sp.filter(\n (p) => property.key !== p.key\n ));\n }\n }>\n <SvgRemove />\n </IconButton>\n </div>\n }\n />)}\n </SortableContext>\n </div>}\n </Surface>\n </Split>\n <ModalButtonBar>\n <Button\n onClick={() => {\n setShowModal(false);\n clearSearch();\n }}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n <DragOverlay zIndex={9999}>\n {activeDragProperty ?\n <HorizontalTile\n title={`${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`}\n titleTooltip={`${activeDragProperty.actualECClassName}`}\n subText={activeDragProperty.categoryLabel}\n actionGroup={\n <IconButton\n styleType=\"borderless\">\n <SvgRemove />\n </IconButton>}\n dragHandle={<div className=\"gmw-drag-icon\" ><SvgDragHandleVertical /></div>}\n /> : null}\n </DragOverlay>\n </DndContext>\n );\n};\n\nexport default GroupPropertyAction;\n\n"]}
|
|
1
|
+
{"version":3,"file":"GroupPropertyAction.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyAction.tsx"],"names":[],"mappings":";;;;;;;;;;;;;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YAAY,KAAK,QAAQ,CAAC,YAAY,GAAG,EAC5D,YAAY,EAAE,GAAG,QAAQ,CAAC,iBAAiB,EAAE,EAC7C,OAAO,EAAE,QAAQ,CAAC,aAAa,EAC/B,WAAW,EACT;oCACE,8BAAC,0BAAU,IACT,SAAS,EAAC,YAAY,EACtB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAE,GAAG,EAAE;4CACZ,qBAAqB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CACrC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAC9B,CAAC,CAAC;wCACL,CAAC;wCAED,8BAAC,+BAAS,OAAG,CACF,CACT,GAER,CAAC,CACW,CACd,CACA,CACJ;YACR,8BAAC,8BAAc;gBACb,8BAAC,sBAAM,IACL,OAAO,EAAE,GAAG,EAAE;wBACZ,YAAY,CAAC,KAAK,CAAC,CAAC;wBACpB,WAAW,EAAE,CAAC;oBAChB,CAAC,EACD,SAAS,EAAC,iBAAiB,YAGpB,CACM,CACX;QACR,8BAAC,kBAAW,IAAC,MAAM,EAAE,IAAI,IACtB,kBAAkB,CAAC,CAAC;YACnB,8BAAC,+BAAc,IACb,KAAK,EAAE,GAAG,kBAAkB,CAAC,YAAY,KAAK,kBAAkB,CAAC,YAAY,GAAG,EAChF,YAAY,EAAE,GAAG,kBAAkB,CAAC,iBAAiB,EAAE,EACvD,OAAO,EAAE,kBAAkB,CAAC,aAAa,EACzC,WAAW,EACT,8BAAC,0BAAU,IACT,SAAS,EAAC,YAAY;oBACtB,8BAAC,+BAAS,OAAG,CACF,EACf,UAAU,EAAE,uCAAK,SAAS,EAAC,eAAe;oBAAE,8BAAC,2CAAqB,OAAG,CAAM,GAC3E,CAAC,CAAC,CAAC,IAAI,CACC,CACH,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { renderToStaticMarkup } from \"react-dom/server\";\nimport type { KeySet } from \"@itwin/presentation-common\";\nimport { PropertyValueFormat } from \"@itwin/presentation-common\";\nimport { useActiveIModelConnection } from \"@itwin/appui-react\";\nimport type { SelectOption } from \"@itwin/itwinui-react\";\nimport {\n Alert,\n Button,\n Fieldset,\n IconButton,\n Label,\n LabeledInput,\n LabeledSelect,\n Modal,\n ModalButtonBar,\n Small,\n Surface,\n Text,\n} from \"@itwin/itwinui-react\";\nimport React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport ActionPanel from \"./ActionPanel\";\nimport useValidator, { NAME_REQUIREMENTS } from \"../hooks/useValidator\";\nimport { handleError, WidgetHeader } from \"./utils\";\nimport { useMappingClient } from \"./context/MappingClientContext\";\nimport { useGroupingMappingApiConfig } from \"./context/GroupingApiConfigContext\";\nimport { HorizontalTile } from \"./HorizontalTile\";\nimport { DataType, QuantityType } from \"@itwin/insights-client\";\nimport type {\n GroupProperty,\n GroupPropertyCreate,\n} from \"@itwin/insights-client\";\nimport {\n SvgClose,\n SvgDragHandleVertical,\n SvgMoreVerticalSmall,\n SvgRemove,\n SvgSearch,\n} from \"@itwin/itwinui-icons-react\";\nimport type { DragEndEvent, DragStartEvent } from \"@dnd-kit/core\";\nimport {\n closestCenter,\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n arrayMove,\n SortableContext,\n sortableKeyboardCoordinates,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport SortableHorizontalTile from \"./SortableHorizontalTile\";\nimport Split from \"react-split\";\nimport \"./GroupPropertyAction.scss\";\nimport type { PropertyMetaData } from \"./GroupPropertyUtils\";\nimport {\n convertPresentationFields,\n convertToECProperties,\n fetchPresentationDescriptor,\n findProperties,\n} from \"./GroupPropertyUtils\";\n\nexport interface GroupPropertyActionProps {\n iModelId: string;\n mappingId: string;\n groupId: string;\n groupPropertyId?: string;\n groupPropertyName?: string;\n keySet: KeySet;\n returnFn: (modified: boolean) => Promise<void>;\n}\n\nexport const quantityTypesSelectionOptions: SelectOption<QuantityType>[] = [\n { value: QuantityType.Area, label: \"Area\" },\n { value: QuantityType.Distance, label: \"Distance\" },\n { value: QuantityType.Force, label: \"Force\" },\n { value: QuantityType.Mass, label: \"Mass\" },\n { value: QuantityType.Monetary, label: \"Monetary\" },\n { value: QuantityType.Time, label: \"Time\" },\n { value: QuantityType.Volume, label: \"Volume\" },\n { value: QuantityType.Undefined, label: \"No Quantity Type\" },\n];\n\nconst GroupPropertyAction = ({\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupPropertyName,\n keySet,\n returnFn,\n}: GroupPropertyActionProps) => {\n const iModelConnection = useActiveIModelConnection();\n const { getAccessToken } = useGroupingMappingApiConfig();\n const mappingClient = useMappingClient();\n const [propertyName, setPropertyName] = useState<string>(\"\");\n const [dataType, setDataType] = useState<DataType>(DataType.Undefined);\n const [quantityType, setQuantityType] = useState<QuantityType>(QuantityType.Undefined);\n const [selectedProperties, setSelectedProperties] = useState<PropertyMetaData[]>([]);\n const [propertiesMetaData, setPropertiesMetaData] = useState<PropertyMetaData[]>([]);\n const [propertiesNotFoundAlert, setPropertiesNotFoundAlert] = useState<boolean>(false);\n const [validator, showValidationMessage] = useValidator();\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [searchInput, setSearchInput] = useState<string>(\"\");\n const [activeSearchInput, setActiveSearchInput] = useState<string>(\"\");\n const [searched, setSearched] = useState<boolean>(false);\n const [activeDragProperty, setActiveDragProperty] = useState<PropertyMetaData | undefined>();\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n })\n );\n const [showModal, setShowModal] = useState<boolean>(false);\n\n const handleDragStart = useCallback((event: DragStartEvent) => {\n const { active } = event;\n const activeProperty = selectedProperties.find((p) => active.id === p.key);\n setActiveDragProperty(activeProperty);\n }, [selectedProperties]);\n\n const handleDragEnd = useCallback((event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && (active.id !== over.id)) {\n setSelectedProperties((items) => {\n const oldIndex = selectedProperties.findIndex((p) => active.id === p.key);\n const newIndex = selectedProperties.findIndex((p) => over.id === p.key);\n\n return arrayMove(items, oldIndex, newIndex);\n });\n }\n\n setActiveDragProperty(undefined);\n }, [selectedProperties]);\n\n const filteredProperties = useMemo(\n () =>\n propertiesMetaData.filter((p) =>\n [p.displayLabel, p.categoryLabel, p.actualECClassName]\n .map((l) => l.toLowerCase())\n .some((l) => l.includes(activeSearchInput.toLowerCase()))\n ),\n [activeSearchInput, propertiesMetaData]\n );\n\n useEffect(() => {\n const generateProperties = async () => {\n setIsLoading(true);\n\n if (!iModelConnection) return;\n\n const descriptor = await fetchPresentationDescriptor(iModelConnection, keySet);\n\n // Only allow primitives and structs\n const propertyFields =\n descriptor?.fields.filter(\n (field) =>\n field.type.valueFormat === PropertyValueFormat.Primitive ||\n field.type.valueFormat === PropertyValueFormat.Struct\n ) ?? [];\n\n const propertiesMetaData = convertPresentationFields(propertyFields);\n\n setPropertiesMetaData(propertiesMetaData);\n\n if (groupPropertyId) {\n const accessToken = await getAccessToken();\n let response: GroupProperty | undefined;\n try {\n response = await mappingClient.getGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId\n );\n\n setPropertyName(response.propertyName);\n setDataType(response.dataType);\n setQuantityType(response.quantityType);\n const properties = findProperties(response.ecProperties, propertiesMetaData);\n if (properties.length === 0) {\n setPropertiesNotFoundAlert(true);\n }\n\n setSelectedProperties(properties);\n } catch (error: any) {\n handleError(error.status);\n }\n }\n\n setIsLoading(false);\n };\n void generateProperties();\n }, [getAccessToken, mappingClient, groupId, groupPropertyId, iModelConnection, iModelId, keySet, mappingId]);\n\n const onSave = async () => {\n if (!validator.allValid()) {\n showValidationMessage(true);\n return;\n }\n try {\n setIsLoading(true);\n const accessToken = await getAccessToken();\n const groupProperty: GroupPropertyCreate = {\n propertyName,\n dataType,\n quantityType,\n ecProperties: selectedProperties.map((p) => convertToECProperties(p)).flat(),\n };\n groupPropertyId\n ? await mappingClient.updateGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupPropertyId,\n groupProperty\n )\n : await mappingClient.createGroupProperty(\n accessToken,\n iModelId,\n mappingId,\n groupId,\n groupProperty\n );\n await returnFn(true);\n } catch (error: any) {\n handleError(error.status);\n setIsLoading(false);\n }\n };\n\n const startSearch = useCallback(() => {\n if (!searchInput) return;\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 <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragStart={handleDragStart}\n onDragEnd={handleDragEnd}\n >\n <WidgetHeader\n title={groupPropertyName ?? \"Add Property\"}\n returnFn={async () => returnFn(false)}\n />\n <div className='gmw-group-property-action-container'>\n <Fieldset disabled={isLoading} className='gmw-property-options' legend='Property Details'>\n <Small className='gmw-field-legend'>\n Asterisk * indicates mandatory fields.\n </Small>\n <LabeledInput\n id='propertyName'\n label='Property Name'\n value={propertyName}\n required\n onChange={(event) => {\n setPropertyName(event.target.value);\n validator.showMessageFor(\"propertyName\");\n }}\n message={validator.message(\n \"propertyName\",\n propertyName,\n NAME_REQUIREMENTS\n )}\n status={\n validator.message(\"propertyName\", propertyName, NAME_REQUIREMENTS)\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"propertyName\");\n }}\n />\n <LabeledSelect<DataType>\n label={\"Data Type\"}\n id='dataType'\n options={[\n { value: DataType.Boolean, label: \"Boolean\" },\n { value: DataType.Number, label: \"Number\" },\n { value: DataType.String, label: \"String\" },\n ]}\n required\n value={dataType}\n onChange={(value) => {\n validator.showMessageFor(\"dataType\");\n setDataType(value);\n }}\n message={validator.message(\"dataType\", propertyName, \"required\")}\n status={\n validator.message(\"dataType\", propertyName, \"required\")\n ? \"negative\"\n : undefined\n }\n onBlur={() => {\n validator.showMessageFor(\"dataType\");\n }}\n onShow={() => { }}\n onHide={() => { }}\n />\n <LabeledSelect<QuantityType>\n label='Quantity Type'\n options={quantityTypesSelectionOptions}\n value={quantityType}\n onChange={setQuantityType}\n onShow={() => { }}\n onHide={() => { }}\n />\n </Fieldset>\n {propertiesNotFoundAlert &&\n <Alert type=\"warning\">\n Warning: Could not match saved properties from the current generated list. It does not confirm or deny validity. Overwriting will occur if a new selection is made and saved.\n </Alert>\n }\n <Fieldset className='gmw-property-view-container' legend=\"Mapped Properties\">\n <div className=\"gmw-property-view-button\">\n <Button\n onClick={async () => setShowModal(true)}\n disabled={isLoading}\n >\n Select Properties\n </Button>\n </div>\n <div className=\"gmw-properties-list\">\n {selectedProperties.length === 0 && !isLoading ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Press the "Select Properties" button for options.</Text>\n </div> :\n selectedProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={null}\n />\n ))}\n </div>\n </Fieldset>\n </div>\n <ActionPanel\n onSave={onSave}\n onCancel={async () => returnFn(false)}\n isLoading={isLoading}\n isSavingDisabled={\n selectedProperties.length === 0 || !propertyName || !dataType\n }\n />\n <Modal\n title=\"Properties Selection\"\n isOpen={showModal}\n onClose={() => {\n setShowModal(false);\n clearSearch();\n }}\n closeOnExternalClick={false}\n >\n <Split\n expandToMin={false}\n className=\"gmw-property-selection-container\"\n gutterAlign=\"center\"\n gutterSize={2}\n gutter={() => {\n // Expects HTMLElement\n const dragHangle = renderToStaticMarkup(<div className=\"gmw-gutter-drag-icon\"><SvgMoreVerticalSmall /></div>);\n const gutter = document.createElement(\"div\");\n gutter.className = `gmw-gutter`;\n gutter.innerHTML = dragHangle;\n return gutter;\n }}\n direction=\"horizontal\">\n <Surface className=\"gmw-available-properties\" elevation={1}>\n <div className=\"gmw-available-properties-header\">\n <Label as=\"span\">Available Properties</Label>\n <LabeledInput\n displayStyle=\"inline\"\n iconDisplayStyle=\"inline\"\n className=\"gmw-available-prop-search\"\n value={searchInput}\n size=\"small\"\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 </div>\n {filteredProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties available. </Text>\n </div> :\n <div className=\"gmw-properties-list\">\n {\n filteredProperties.map((property) => (\n <HorizontalTile\n key={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={null}\n selected={selectedProperties.some((p) => property.key === p.key)}\n onClick={() =>\n setSelectedProperties((sp) =>\n sp.some((p) => property.key === p.key)\n ? sp.filter(\n (p) => property.key !== p.key\n )\n : [...sp, property]\n )\n }\n />\n ))}\n </div>}\n </Surface>\n <Surface className=\"gmw-selected-properties\" elevation={1}>\n <Label as=\"span\">Selected Properties</Label>\n {selectedProperties.length === 0 ?\n <div className=\"gmw-empty-selection\">\n <Text>No properties selected.</Text>\n <Text>Add some by clicking on the properties shown left.</Text>\n </div> :\n <div className=\"gmw-properties-list\" >\n <SortableContext\n items={selectedProperties.map((p) => p.key)}\n strategy={verticalListSortingStrategy}\n >\n {selectedProperties.map((property) =>\n <SortableHorizontalTile\n key={property.key}\n id={property.key}\n title={`${property.displayLabel} (${property.propertyType})`}\n titleTooltip={`${property.actualECClassName}`}\n subText={property.categoryLabel}\n actionGroup={\n <div>\n <IconButton\n styleType=\"borderless\"\n title=\"Remove\"\n onClick={() => {\n setSelectedProperties((sp) => sp.filter(\n (p) => property.key !== p.key\n ));\n }\n }>\n <SvgRemove />\n </IconButton>\n </div>\n }\n />)}\n </SortableContext>\n </div>}\n </Surface>\n </Split>\n <ModalButtonBar>\n <Button\n onClick={() => {\n setShowModal(false);\n clearSearch();\n }}\n styleType=\"high-visibility\"\n >\n Close\n </Button>\n </ModalButtonBar>\n </Modal>\n <DragOverlay zIndex={9999}>\n {activeDragProperty ?\n <HorizontalTile\n title={`${activeDragProperty.displayLabel} (${activeDragProperty.propertyType})`}\n titleTooltip={`${activeDragProperty.actualECClassName}`}\n subText={activeDragProperty.categoryLabel}\n actionGroup={\n <IconButton\n styleType=\"borderless\">\n <SvgRemove />\n </IconButton>}\n dragHandle={<div className=\"gmw-drag-icon\" ><SvgDragHandleVertical /></div>}\n /> : null}\n </DragOverlay>\n </DndContext>\n );\n};\n\nexport default GroupPropertyAction;\n\n"]}
|
|
@@ -274,6 +274,10 @@ const fetchPresentationDescriptor = async (iModelConnection, keySet) => {
|
|
|
274
274
|
specifications: [
|
|
275
275
|
{
|
|
276
276
|
specType: presentation_common_1.ContentSpecificationTypes.SelectedNodeInstances,
|
|
277
|
+
propertyOverrides: [{
|
|
278
|
+
name: "*",
|
|
279
|
+
isDisplayed: true,
|
|
280
|
+
}],
|
|
277
281
|
},
|
|
278
282
|
],
|
|
279
283
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupPropertyUtils.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyUtils.ts"],"names":[],"mappings":";;;AAMA,4DAAkD;AAWlD,oEAMoC;AACpC,wEAA4D;AAC5D,6CAAwC;AAexC,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EAAE;gBACvC,QAAQ,GAAG,IAAI,CAAC;aACjB;SACF;QACD,IAAI,QAAQ;YACV,MAAM;KACT;IACD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,wBAAwB,CAAC;AAClD,CAAC,CAAC;AArBW,QAAA,cAAc,kBAqBzB;AAEK,MAAM,2BAA2B,GAAG,KAAK,EAAE,gBAAkC,EAAE,MAAc,EAAE,EAAE;IACtG,MAAM,OAAO,GAAY;QACvB,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,+BAAS,CAAC,OAAO;gBAC3B,cAAc,EAAE;oBACd;wBACE,QAAQ,EAAE,+CAAyB,CAAC,qBAAqB;qBAC1D;iBACF;aACF;SAAC;KACL,CAAC;IACF,MAAM,cAAc,GAA+E;QACjG,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,gDAA0B,CAAC,YAAY;KACrD,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,oCAAY,CAAC,YAAY,CAAC,oBAAoB,CACrE,cAAc,CACf,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAvBW,QAAA,2BAA2B,+BAuBtC","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 type { ECProperty } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { deepEqual } from \"fast-equals\";\n\nexport interface PropertyMetaData {\n displayLabel: string;\n sourceSchema: string;\n sourceClassName: string;\n categoryLabel: string;\n propertyType: DataType;\n actualECClassName: string;\n parentPropertyClassName: string | undefined;\n ecPropertyTraversal: string[];\n primitiveNavigationClass: string;\n key: string;\n}\n\nconst convertType = (type: string): DataType => {\n switch (type) {\n case \"int\":\n case \"enum\":\n case \"long\":\n return DataType.Integer;\n case \"boolean\":\n return DataType.Boolean;\n case \"double\":\n return DataType.Double;\n case \"number\":\n return DataType.Number;\n default:\n return DataType.String;\n }\n};\n\nconst extractPrimitives = (\n propertyTraversal: string[],\n propertyField: PropertiesField\n): PropertyMetaData[] => propertyField.properties.map((property) => {\n const propertyName = property.property.name;\n const displayLabel = propertyField.label;\n // It belongs to this parent class\n const parentPropertyClassName = propertyField.parent?.contentClassInfo.name;\n const primitiveNavigationClass = property.property.navigationPropertyInfo?.classInfo.name ?? \"\";\n /* Presentation assigns primitive navigations properties as a long type due to how it stores the\n ECInstanceId of the class in the meta.ECClassDef table on the C++ layer.\n We are handling this special case.\n */\n const propertyType = primitiveNavigationClass ? DataType.String : convertType(property.property.type);\n const actualECClassName = property.property.classInfo.name;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return (\n {\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass,\n actualECClassName,\n parentPropertyClassName,\n key: `${parentPropertyClassName}|${actualECClassName}|${newPropertyTraversal.join(\"|\")}`,\n categoryLabel: propertyField.category.label,\n }\n );\n});\n\nconst extractPrimitiveStructProperties = (\n propertyTraversal: string[],\n members: StructFieldMemberDescription[],\n categoryLabel: string,\n actualECClassName: string,\n parentPropertyClassName?: string,\n): PropertyMetaData[] => members.flatMap((member) => {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n const propertyName = member.name;\n const displayLabel = member.label;\n const propertyType = convertType(member.type.typeName);\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return ({\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass: \"\",\n actualECClassName,\n parentPropertyClassName,\n key: `${parentPropertyClassName}|${actualECClassName}|${newPropertyTraversal.join(\"|\")}`,\n categoryLabel,\n });\n\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n const structName = member.name;\n return extractPrimitiveStructProperties(\n [...propertyTraversal, structName],\n member.type.members,\n categoryLabel,\n actualECClassName,\n parentPropertyClassName\n );\n }\n\n return [];\n});\n\nconst extractStruct = (property: Field) => {\n if (property.type.valueFormat !== PropertyValueFormat.Struct) {\n return [];\n }\n\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const actualECClassName = (property as PropertiesField).properties[0].property.classInfo.name;\n return extractPrimitiveStructProperties(\n [columnName],\n property.type.members,\n property.category.label,\n actualECClassName\n );\n};\n\nconst extractNested = (propertyTraversal: string[], propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n return extractPrimitives([...propertyTraversal], property as PropertiesField);\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n // Hardcoded navigation to external source repository metadata.\n if (nestedContentField.contentClassInfo.name === \"BisCore:RepositoryLink\") {\n return extractNested([...propertyTraversal, \"Source\", \"Repository\"], nestedContentField.nestedFields);\n }\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n // Aspects are not looked at again. Extraction does not support aspects within navigations.\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([...propertyTraversal, \"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertPresentationFields = (propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n const extractedPrimitives = extractPrimitives([], property as PropertiesField);\n for (const extractedPrimitive of extractedPrimitives) {\n extractedPrimitive.sourceSchema = \"*\";\n extractedPrimitive.sourceClassName = \"*\";\n return extractedPrimitive;\n }\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects.\n if (\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const fullClassName = nestedContentField.contentClassInfo.name;\n const sourceSchema = fullClassName.split(\":\")[0];\n const sourceClassName = fullClassName.split(\":\")[1];\n const extractedNested = extractNested([], nestedContentField.nestedFields);\n const aspectExtractedNested = extractedNested.map((ecProperty) => ({ ...ecProperty, sourceSchema, sourceClassName }));\n return aspectExtractedNested;\n }\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([\"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertToECProperties = (property: PropertyMetaData): ECProperty[] => {\n const ecProperty: ECProperty = {\n ecSchemaName: property.sourceSchema,\n ecClassName: property.sourceClassName,\n ecPropertyType: property.propertyType,\n ecPropertyName: \"\",\n };\n switch (property.primitiveNavigationClass) {\n // Hardcode Models navigation path and label behavior\n case \"BisCore:ModelContainsElements\": {\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n }\n // Hardcode Category and Physical Material navigation path and label behavior\n case \"BisCore:GeometricElement3dIsInCategory\":\n case \"BisCore:PhysicalElementIsOfPhysicalMaterial\":\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n default: {\n return [\n {\n ...ecProperty,\n ecPropertyName: property.ecPropertyTraversal.join(\".\"),\n },\n ];\n }\n }\n};\n\nexport const findProperties = (ecProperties: ECProperty[], propertiesMetaData: PropertyMetaData[]) => {\n let ecPropertiesCopy = [...ecProperties];\n const propertiesMetaDataResult: PropertyMetaData[] = new Array<PropertyMetaData>();\n let notFound = false;\n while (ecPropertiesCopy.length !== 0) {\n for (let i = 0; i < propertiesMetaData.length; i++) {\n const generatedProperty = convertToECProperties(propertiesMetaData[i]);\n const slicedEcProperties = ecPropertiesCopy.slice(0, generatedProperty.length);\n if (deepEqual(generatedProperty, slicedEcProperties)) {\n propertiesMetaDataResult.push(propertiesMetaData[i]);\n ecPropertiesCopy = ecPropertiesCopy.slice(generatedProperty.length);\n break;\n }\n if (i === propertiesMetaData.length - 1) {\n notFound = true;\n }\n }\n if (notFound)\n break;\n }\n return notFound ? [] : propertiesMetaDataResult;\n};\n\nexport const fetchPresentationDescriptor = async (iModelConnection: IModelConnection, keySet: KeySet) => {\n const ruleSet: Ruleset = {\n id: \"gmw-element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const descriptor = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n return descriptor;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupPropertyUtils.js","sourceRoot":"","sources":["../../../../src/widget/components/GroupPropertyUtils.ts"],"names":[],"mappings":";;;AAMA,4DAAkD;AAWlD,oEAMoC;AACpC,wEAA4D;AAC5D,6CAAwC;AAexC,MAAM,WAAW,GAAG,CAAC,IAAY,EAAY,EAAE;IAC7C,QAAQ,IAAI,EAAE;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM;YACT,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,SAAS;YACZ,OAAO,0BAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,0BAAQ,CAAC,MAAM,CAAC;QACzB;YACE,OAAO,0BAAQ,CAAC,MAAM,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CACxB,iBAA2B,EAC3B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BACzD,iBAAiB,EAAE,CAAC;gCAClB,IAAI,EAAE,GAAG;gCACT,WAAW,EAAE,IAAI;6BAClB,CAAC;qBACH;iBACF;aACF;SAAC;KACL,CAAC;IACF,MAAM,cAAc,GAA+E;QACjG,MAAM,EAAE,gBAAgB;QACxB,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,OAAO;QACpB,WAAW,EAAE,gDAA0B,CAAC,YAAY;KACrD,CAAC;IACF,MAAM,UAAU,GAAG,MAAM,oCAAY,CAAC,YAAY,CAAC,oBAAoB,CACrE,cAAc,CACf,CAAC;IACF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AA3BW,QAAA,2BAA2B,+BA2BtC","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 type { ECProperty } from \"@itwin/insights-client\";\nimport { DataType } from \"@itwin/insights-client\";\nimport type {\n ContentDescriptorRequestOptions,\n Field,\n KeySet,\n NestedContentField,\n PropertiesField,\n Ruleset,\n RulesetVariable,\n StructFieldMemberDescription,\n} from \"@itwin/presentation-common\";\nimport {\n ContentSpecificationTypes,\n DefaultContentDisplayTypes,\n PropertyValueFormat,\n RelationshipMeaning,\n RuleTypes,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"@itwin/presentation-frontend\";\nimport { deepEqual } from \"fast-equals\";\n\nexport interface PropertyMetaData {\n displayLabel: string;\n sourceSchema: string;\n sourceClassName: string;\n categoryLabel: string;\n propertyType: DataType;\n actualECClassName: string;\n parentPropertyClassName: string | undefined;\n ecPropertyTraversal: string[];\n primitiveNavigationClass: string;\n key: string;\n}\n\nconst convertType = (type: string): DataType => {\n switch (type) {\n case \"int\":\n case \"enum\":\n case \"long\":\n return DataType.Integer;\n case \"boolean\":\n return DataType.Boolean;\n case \"double\":\n return DataType.Double;\n case \"number\":\n return DataType.Number;\n default:\n return DataType.String;\n }\n};\n\nconst extractPrimitives = (\n propertyTraversal: string[],\n propertyField: PropertiesField\n): PropertyMetaData[] => propertyField.properties.map((property) => {\n const propertyName = property.property.name;\n const displayLabel = propertyField.label;\n // It belongs to this parent class\n const parentPropertyClassName = propertyField.parent?.contentClassInfo.name;\n const primitiveNavigationClass = property.property.navigationPropertyInfo?.classInfo.name ?? \"\";\n /* Presentation assigns primitive navigations properties as a long type due to how it stores the\n ECInstanceId of the class in the meta.ECClassDef table on the C++ layer.\n We are handling this special case.\n */\n const propertyType = primitiveNavigationClass ? DataType.String : convertType(property.property.type);\n const actualECClassName = property.property.classInfo.name;\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return (\n {\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass,\n actualECClassName,\n parentPropertyClassName,\n key: `${parentPropertyClassName}|${actualECClassName}|${newPropertyTraversal.join(\"|\")}`,\n categoryLabel: propertyField.category.label,\n }\n );\n});\n\nconst extractPrimitiveStructProperties = (\n propertyTraversal: string[],\n members: StructFieldMemberDescription[],\n categoryLabel: string,\n actualECClassName: string,\n parentPropertyClassName?: string,\n): PropertyMetaData[] => members.flatMap((member) => {\n if (member.type.valueFormat === PropertyValueFormat.Primitive) {\n const propertyName = member.name;\n const displayLabel = member.label;\n const propertyType = convertType(member.type.typeName);\n const newPropertyTraversal = [...propertyTraversal, propertyName];\n\n return ({\n displayLabel,\n sourceSchema: \"*\",\n sourceClassName: \"*\",\n ecPropertyTraversal: newPropertyTraversal,\n propertyType,\n primitiveNavigationClass: \"\",\n actualECClassName,\n parentPropertyClassName,\n key: `${parentPropertyClassName}|${actualECClassName}|${newPropertyTraversal.join(\"|\")}`,\n categoryLabel,\n });\n\n } else if (member.type.valueFormat === PropertyValueFormat.Struct) {\n const structName = member.name;\n return extractPrimitiveStructProperties(\n [...propertyTraversal, structName],\n member.type.members,\n categoryLabel,\n actualECClassName,\n parentPropertyClassName\n );\n }\n\n return [];\n});\n\nconst extractStruct = (property: Field) => {\n if (property.type.valueFormat !== PropertyValueFormat.Struct) {\n return [];\n }\n\n const columnName = (property as PropertiesField).properties[0]\n .property.name;\n const actualECClassName = (property as PropertiesField).properties[0].property.classInfo.name;\n return extractPrimitiveStructProperties(\n [columnName],\n property.type.members,\n property.category.label,\n actualECClassName\n );\n};\n\nconst extractNested = (propertyTraversal: string[], propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n return extractPrimitives([...propertyTraversal], property as PropertiesField);\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n // Hardcoded navigation to external source repository metadata.\n if (nestedContentField.contentClassInfo.name === \"BisCore:RepositoryLink\") {\n return extractNested([...propertyTraversal, \"Source\", \"Repository\"], nestedContentField.nestedFields);\n }\n break;\n }\n\n switch (nestedContentField.relationshipMeaning) {\n // Aspects are not looked at again. Extraction does not support aspects within navigations.\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([...propertyTraversal, \"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertPresentationFields = (propertyFields: Field[]): PropertyMetaData[] =>\n propertyFields.flatMap((property) => {\n // Generate base ECProperty\n switch (property.type.valueFormat) {\n case PropertyValueFormat.Primitive: {\n const extractedPrimitives = extractPrimitives([], property as PropertiesField);\n for (const extractedPrimitive of extractedPrimitives) {\n extractedPrimitive.sourceSchema = \"*\";\n extractedPrimitive.sourceClassName = \"*\";\n return extractedPrimitive;\n }\n break;\n }\n // Get structs\n case PropertyValueFormat.Struct: {\n const nestedContentField = property as NestedContentField;\n // Only handling single path and not handling nested content fields within navigations\n if (\n nestedContentField.pathToPrimaryClass &&\n nestedContentField.pathToPrimaryClass.length > 1\n ) {\n break;\n }\n switch (nestedContentField.relationshipMeaning) {\n case RelationshipMeaning.SameInstance: {\n // Check for aspects.\n if (\n (nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsUniqueAspect\" ||\n nestedContentField.pathToPrimaryClass[0].relationshipInfo\n .name === \"BisCore:ElementOwnsMultiAspects\")\n ) {\n const fullClassName = nestedContentField.contentClassInfo.name;\n const sourceSchema = fullClassName.split(\":\")[0];\n const sourceClassName = fullClassName.split(\":\")[1];\n const extractedNested = extractNested([], nestedContentField.nestedFields);\n const aspectExtractedNested = extractedNested.map((ecProperty) => ({ ...ecProperty, sourceSchema, sourceClassName }));\n return aspectExtractedNested;\n }\n break;\n }\n // Navigation properties\n case RelationshipMeaning.RelatedInstance: {\n if (\n // Deal with a TypeDefinition\n nestedContentField.pathToPrimaryClass[0].relationshipInfo.name ===\n \"BisCore:GeometricElement3dHasTypeDefinition\"\n ) {\n return extractNested([\"TypeDefinition\"], nestedContentField.nestedFields);\n }\n break;\n }\n default: {\n // Some elements don't have a path to primary class or relationship meaning..\n // Most likely a simple struct property\n if (!nestedContentField.pathToPrimaryClass) {\n return extractStruct(property);\n }\n }\n }\n }\n }\n return [];\n });\n\nexport const convertToECProperties = (property: PropertyMetaData): ECProperty[] => {\n const ecProperty: ECProperty = {\n ecSchemaName: property.sourceSchema,\n ecClassName: property.sourceClassName,\n ecPropertyType: property.propertyType,\n ecPropertyName: \"\",\n };\n switch (property.primitiveNavigationClass) {\n // Hardcode Models navigation path and label behavior\n case \"BisCore:ModelContainsElements\": {\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"ModeledElement\",\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n }\n // Hardcode Category and Physical Material navigation path and label behavior\n case \"BisCore:GeometricElement3dIsInCategory\":\n case \"BisCore:PhysicalElementIsOfPhysicalMaterial\":\n return [\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"UserLabel\",\n ].join(\".\"),\n },\n {\n ...ecProperty,\n ecPropertyName: [\n ...property.ecPropertyTraversal,\n \"CodeValue\",\n ].join(\".\"),\n },\n ];\n default: {\n return [\n {\n ...ecProperty,\n ecPropertyName: property.ecPropertyTraversal.join(\".\"),\n },\n ];\n }\n }\n};\n\nexport const findProperties = (ecProperties: ECProperty[], propertiesMetaData: PropertyMetaData[]) => {\n let ecPropertiesCopy = [...ecProperties];\n const propertiesMetaDataResult: PropertyMetaData[] = new Array<PropertyMetaData>();\n let notFound = false;\n while (ecPropertiesCopy.length !== 0) {\n for (let i = 0; i < propertiesMetaData.length; i++) {\n const generatedProperty = convertToECProperties(propertiesMetaData[i]);\n const slicedEcProperties = ecPropertiesCopy.slice(0, generatedProperty.length);\n if (deepEqual(generatedProperty, slicedEcProperties)) {\n propertiesMetaDataResult.push(propertiesMetaData[i]);\n ecPropertiesCopy = ecPropertiesCopy.slice(generatedProperty.length);\n break;\n }\n if (i === propertiesMetaData.length - 1) {\n notFound = true;\n }\n }\n if (notFound)\n break;\n }\n return notFound ? [] : propertiesMetaDataResult;\n};\n\nexport const fetchPresentationDescriptor = async (iModelConnection: IModelConnection, keySet: KeySet) => {\n const ruleSet: Ruleset = {\n id: \"gmw-element-properties\",\n rules: [\n {\n ruleType: RuleTypes.Content,\n specifications: [\n {\n specType: ContentSpecificationTypes.SelectedNodeInstances,\n propertyOverrides: [{\n name: \"*\",\n isDisplayed: true,\n }],\n },\n ],\n }],\n };\n const requestOptions: ContentDescriptorRequestOptions<IModelConnection, KeySet, RulesetVariable> = {\n imodel: iModelConnection,\n keys: keySet,\n rulesetOrId: ruleSet,\n displayType: DefaultContentDisplayTypes.PropertyPane,\n };\n const descriptor = await Presentation.presentation.getContentDescriptor(\n requestOptions\n );\n return descriptor;\n};\n"]}
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
import type { CreateTypeFromInterface } from "../utils";
|
|
3
3
|
import "./Grouping.scss";
|
|
4
4
|
import type { Group, Mapping } from "@itwin/insights-client";
|
|
5
|
+
import type { ContextCustomUI } from "./customUI/GroupingMappingCustomUI";
|
|
5
6
|
export declare type IGroupTyped = CreateTypeFromInterface<Group>;
|
|
6
|
-
export
|
|
7
|
-
name: string;
|
|
8
|
-
displayLabel: string;
|
|
9
|
-
icon: JSX.Element;
|
|
10
|
-
}[];
|
|
11
|
-
interface GroupsTreeProps {
|
|
7
|
+
export interface GroupingProps {
|
|
12
8
|
mapping: Mapping;
|
|
13
|
-
|
|
9
|
+
onClickAddGroup?: (queryGenerationType: string) => void;
|
|
10
|
+
onClickGroupTitle?: (group: Group) => void;
|
|
11
|
+
onClickGroupModify?: (group: Group, queryGenerationType: string) => void;
|
|
12
|
+
onClickRenderContextCustomUI?: (contextCustomUI: Exclude<ContextCustomUI["uiComponent"], undefined>, group: Group) => void;
|
|
13
|
+
emphasizeElements?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare const Groupings: ({ mapping,
|
|
16
|
-
export {};
|
|
15
|
+
export declare const Groupings: ({ mapping, onClickAddGroup, onClickGroupTitle, onClickGroupModify, onClickRenderContextCustomUI, emphasizeElements, }: GroupingProps) => JSX.Element;
|
|
17
16
|
//# sourceMappingURL=Grouping.d.ts.map
|