@pisell/materials 1.0.1059 → 1.0.1062
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/README.md +285 -285
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +9 -9
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +27 -27
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +27 -27
- package/es/components/PisellLayouts/index.d.ts +2 -1
- package/es/components/PisellLayouts/index.js +17 -15
- package/es/components/cardMetricItem/index.js +2 -2
- package/es/components/pisellFilter/type.d.ts +4 -2
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +1 -1
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +474 -202
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.less +70 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +13 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +469 -38
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +22 -0
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.js +203 -0
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.less +189 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +37 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.js +341 -0
- package/es/components/pisellFloorMapLayout/components/EditableItemLayer.less +89 -0
- package/es/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +39 -0
- package/es/components/pisellFloorMapLayout/components/FigmaTableCard.js +432 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.d.ts +17 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.js +131 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.less +7 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +497 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +154 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +34 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.js +130 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.less +131 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +6 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.js +69 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +35 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.js +361 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +237 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +7 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.js +37 -11
- package/es/components/pisellFloorMapLayout/components/MapLayer.d.ts +4 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.js +11 -3
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +2 -2
- package/es/components/pisellFloorMapLayout/components/ViewControls.less +3 -2
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +27 -0
- package/es/components/pisellFloorMapLayout/components/index.d.ts +14 -0
- package/es/components/pisellFloorMapLayout/components/index.js +8 -1
- package/es/components/pisellFloorMapLayout/context/FloorMapLayoutContext.d.ts +16 -0
- package/es/components/pisellFloorMapLayout/context/FloorMapLayoutContext.js +21 -0
- package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.d.ts +5 -0
- package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +28 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +62 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +438 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.d.ts +21 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.js +122 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +67 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +322 -0
- package/es/components/pisellFloorMapLayout/index.d.ts +9 -2
- package/es/components/pisellFloorMapLayout/index.js +7 -2
- package/es/components/pisellFloorMapLayout/locales.d.ts +186 -0
- package/es/components/pisellFloorMapLayout/locales.js +185 -0
- package/es/components/pisellFloorMapLayout/types.d.ts +362 -1
- package/es/components/pisellFloorMapLayout/types.js +148 -1
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +20 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.js +129 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +87 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +26 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +47 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +69 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +88 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapStageDefaults.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapStageDefaults.js +8 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.d.ts +8 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.js +108 -0
- package/es/components/pisellFloorMapLayout/utils/layoutMeasurements.d.ts +30 -0
- package/es/components/pisellFloorMapLayout/utils/layoutMeasurements.js +125 -0
- package/es/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.d.ts +7 -0
- package/es/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.js +29 -0
- package/es/components/pisellFloorMapLayout/utils/snap.d.ts +10 -0
- package/es/components/pisellFloorMapLayout/utils/snap.js +21 -0
- package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.d.ts +6 -0
- package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.js +175 -0
- package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.less +129 -0
- package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.d.ts +10 -0
- package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.js +237 -0
- package/es/components/pisellHierarchicalSummaryList/components/Row.d.ts +35 -0
- package/es/components/pisellHierarchicalSummaryList/components/Row.js +313 -0
- package/es/components/pisellHierarchicalSummaryList/components/index.d.ts +1 -0
- package/es/components/pisellHierarchicalSummaryList/components/index.js +1 -0
- package/es/components/pisellHierarchicalSummaryList/hooks/index.d.ts +2 -0
- package/es/components/pisellHierarchicalSummaryList/hooks/index.js +1 -0
- package/es/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.d.ts +15 -0
- package/es/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.js +34 -0
- package/es/components/pisellHierarchicalSummaryList/index.d.ts +5 -0
- package/es/components/pisellHierarchicalSummaryList/index.js +5 -0
- package/es/components/pisellHierarchicalSummaryList/types.d.ts +248 -0
- package/es/components/pisellHierarchicalSummaryList/types.js +1 -0
- package/es/components/pisellLookup/PisellLookup.js +82 -82
- package/es/components/pisellMultipleSelect/PisellMultipleSelect.stories.js +34 -34
- package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +2 -1
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +95 -18
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +4 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +1315 -383
- package/es/components/pisellRecordBoard/index.d.ts +7 -2
- package/es/components/pisellRecordBoard/index.js +2 -1
- package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +1 -3
- package/es/components/pisellRecordBoard/shellFrame/FloorMap.d.ts +14 -0
- package/es/components/pisellRecordBoard/shellFrame/FloorMap.js +15 -0
- package/es/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.d.ts +16 -0
- package/es/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.js +11 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +47 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +57 -10
- package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +3 -3
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +4 -10
- package/es/components/pisellRecordBoard/shellFrame/index.js +101 -19
- package/es/components/pisellRecordBoard/types.d.ts +62 -2
- package/es/components/pisellRecordBoard/utils/partitionShellFrameChildren.d.ts +15 -0
- package/es/components/pisellRecordBoard/utils/partitionShellFrameChildren.js +57 -0
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +10 -0
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.js +156 -0
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.less +88 -0
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.stories.d.ts +12 -0
- package/es/components/pisellReservationSchedule/PisellReservationSchedule.stories.js +105 -0
- package/es/components/pisellReservationSchedule/index.d.ts +2 -0
- package/es/components/pisellReservationSchedule/index.js +1 -0
- package/es/components/pisellReservationSchedule/locales.d.ts +25 -0
- package/es/components/pisellReservationSchedule/locales.js +24 -0
- package/es/components/pisellReservationSchedule/types.d.ts +42 -0
- package/es/components/pisellReservationSchedule/types.js +1 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +10 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.js +91 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +49 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts +16 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.js +197 -0
- package/es/components/pisellReservationScheduleBand/index.d.ts +2 -0
- package/es/components/pisellReservationScheduleBand/index.js +1 -0
- package/es/components/pisellReservationScheduleBand/types.d.ts +45 -0
- package/es/components/pisellReservationScheduleBand/types.js +1 -0
- package/es/components/pisellRow/index.js +7 -7
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +609 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.less +412 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.stories.d.ts +79 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.stories.js +290 -0
- package/es/components/pisellTimeNavigator/components/BackgroundLayer.d.ts +14 -0
- package/es/components/pisellTimeNavigator/components/BackgroundLayer.js +30 -0
- package/es/components/pisellTimeNavigator/components/CursorLayer.d.ts +20 -0
- package/es/components/pisellTimeNavigator/components/CursorLayer.js +46 -0
- package/es/components/pisellTimeNavigator/components/GestureLayer.d.ts +31 -0
- package/es/components/pisellTimeNavigator/components/GestureLayer.js +82 -0
- package/es/components/pisellTimeNavigator/components/NowButton.d.ts +14 -0
- package/es/components/pisellTimeNavigator/components/NowButton.js +38 -0
- package/es/components/pisellTimeNavigator/components/ScaleLayer.d.ts +17 -0
- package/es/components/pisellTimeNavigator/components/ScaleLayer.js +51 -0
- package/es/components/pisellTimeNavigator/components/index.d.ts +5 -0
- package/es/components/pisellTimeNavigator/components/index.js +5 -0
- package/es/components/pisellTimeNavigator/hooks/index.d.ts +5 -0
- package/es/components/pisellTimeNavigator/hooks/index.js +3 -0
- package/es/components/pisellTimeNavigator/hooks/useDragInertia.d.ts +14 -0
- package/es/components/pisellTimeNavigator/hooks/useDragInertia.js +109 -0
- package/es/components/pisellTimeNavigator/hooks/useRealtime.d.ts +5 -0
- package/es/components/pisellTimeNavigator/hooks/useRealtime.js +16 -0
- package/es/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +27 -0
- package/es/components/pisellTimeNavigator/hooks/useTimeAxis.js +76 -0
- package/es/components/pisellTimeNavigator/index.d.ts +4 -0
- package/es/components/pisellTimeNavigator/index.js +3 -0
- package/es/components/pisellTimeNavigator/locales.d.ts +22 -0
- package/es/components/pisellTimeNavigator/locales.js +21 -0
- package/es/components/pisellTimeNavigator/types.d.ts +149 -0
- package/es/components/pisellTimeNavigator/types.js +1 -0
- package/es/components/pisellTimeNavigator/utils/index.d.ts +30 -0
- package/es/components/pisellTimeNavigator/utils/index.js +116 -0
- package/es/index.d.ts +15 -5
- package/es/index.js +7 -1
- package/es/locales/en-US.d.ts +2 -0
- package/es/locales/en-US.js +6 -4
- package/es/locales/zh-CN.d.ts +2 -0
- package/es/locales/zh-CN.js +6 -4
- package/es/locales/zh-TW.d.ts +2 -0
- package/es/locales/zh-TW.js +6 -4
- package/lib/components/PisellLayouts/index.d.ts +2 -1
- package/lib/components/PisellLayouts/index.js +13 -1
- package/lib/components/pisellFilter/type.d.ts +4 -2
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +1 -1
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +566 -181
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.less +70 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +13 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +682 -84
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +22 -0
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.js +237 -0
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.less +189 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +37 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.js +358 -0
- package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.less +89 -0
- package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +39 -0
- package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.js +482 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.d.ts +17 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.js +117 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.less +7 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +508 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +154 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +34 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.js +188 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.less +131 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +6 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.js +94 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +35 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.js +333 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +237 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +7 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.js +26 -5
- package/lib/components/pisellFloorMapLayout/components/MapLayer.d.ts +4 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.js +7 -2
- package/lib/components/pisellFloorMapLayout/components/ViewControls.less +3 -2
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +63 -0
- package/lib/components/pisellFloorMapLayout/components/index.d.ts +14 -0
- package/lib/components/pisellFloorMapLayout/components/index.js +23 -2
- package/lib/components/pisellFloorMapLayout/context/FloorMapLayoutContext.d.ts +16 -0
- package/lib/components/pisellFloorMapLayout/context/FloorMapLayoutContext.js +54 -0
- package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.d.ts +5 -0
- package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +47 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +62 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +431 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.d.ts +21 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.js +146 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +67 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +309 -0
- package/lib/components/pisellFloorMapLayout/index.d.ts +9 -2
- package/lib/components/pisellFloorMapLayout/index.js +31 -2
- package/lib/components/pisellFloorMapLayout/locales.d.ts +186 -0
- package/lib/components/pisellFloorMapLayout/locales.js +206 -0
- package/lib/components/pisellFloorMapLayout/types.d.ts +362 -1
- package/lib/components/pisellFloorMapLayout/types.js +15 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +20 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.js +126 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +66 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +26 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +61 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +70 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +135 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapStageDefaults.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapStageDefaults.js +33 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.d.ts +8 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.js +128 -0
- package/lib/components/pisellFloorMapLayout/utils/layoutMeasurements.d.ts +30 -0
- package/lib/components/pisellFloorMapLayout/utils/layoutMeasurements.js +96 -0
- package/lib/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.d.ts +7 -0
- package/lib/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.js +41 -0
- package/lib/components/pisellFloorMapLayout/utils/snap.d.ts +10 -0
- package/lib/components/pisellFloorMapLayout/utils/snap.js +43 -0
- package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.d.ts +6 -0
- package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.js +179 -0
- package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.less +129 -0
- package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.d.ts +10 -0
- package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.js +218 -0
- package/lib/components/pisellHierarchicalSummaryList/components/Row.d.ts +35 -0
- package/lib/components/pisellHierarchicalSummaryList/components/Row.js +343 -0
- package/lib/components/pisellHierarchicalSummaryList/components/index.d.ts +1 -0
- package/lib/components/pisellHierarchicalSummaryList/components/index.js +29 -0
- package/lib/components/pisellHierarchicalSummaryList/hooks/index.d.ts +2 -0
- package/lib/components/pisellHierarchicalSummaryList/hooks/index.js +29 -0
- package/lib/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.d.ts +15 -0
- package/lib/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.js +51 -0
- package/lib/components/pisellHierarchicalSummaryList/index.d.ts +5 -0
- package/lib/components/pisellHierarchicalSummaryList/index.js +31 -0
- package/lib/components/pisellHierarchicalSummaryList/types.d.ts +248 -0
- package/lib/components/pisellHierarchicalSummaryList/types.js +17 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +2 -1
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +82 -8
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +4 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.js +915 -25
- package/lib/components/pisellRecordBoard/index.d.ts +7 -2
- package/lib/components/pisellRecordBoard/index.js +1 -0
- package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +8 -2
- package/lib/components/pisellRecordBoard/shellFrame/FloorMap.d.ts +14 -0
- package/lib/components/pisellRecordBoard/shellFrame/FloorMap.js +27 -0
- package/lib/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.d.ts +16 -0
- package/lib/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.js +45 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +47 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +48 -4
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +4 -10
- package/lib/components/pisellRecordBoard/shellFrame/index.js +88 -6
- package/lib/components/pisellRecordBoard/types.d.ts +62 -2
- package/lib/components/pisellRecordBoard/utils/partitionShellFrameChildren.d.ts +15 -0
- package/lib/components/pisellRecordBoard/utils/partitionShellFrameChildren.js +88 -0
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +10 -0
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.js +200 -0
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.less +88 -0
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.stories.d.ts +12 -0
- package/lib/components/pisellReservationSchedule/PisellReservationSchedule.stories.js +116 -0
- package/lib/components/pisellReservationSchedule/index.d.ts +2 -0
- package/lib/components/pisellReservationSchedule/index.js +29 -0
- package/lib/components/pisellReservationSchedule/locales.d.ts +25 -0
- package/lib/components/pisellReservationSchedule/locales.js +47 -0
- package/lib/components/pisellReservationSchedule/types.d.ts +42 -0
- package/lib/components/pisellReservationSchedule/types.js +17 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +10 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.js +127 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +49 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts +16 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.js +181 -0
- package/lib/components/pisellReservationScheduleBand/index.d.ts +2 -0
- package/lib/components/pisellReservationScheduleBand/index.js +29 -0
- package/lib/components/pisellReservationScheduleBand/types.d.ts +45 -0
- package/lib/components/pisellReservationScheduleBand/types.js +17 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +716 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.less +412 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.stories.d.ts +79 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.stories.js +273 -0
- package/lib/components/pisellTimeNavigator/components/BackgroundLayer.d.ts +14 -0
- package/lib/components/pisellTimeNavigator/components/BackgroundLayer.js +81 -0
- package/lib/components/pisellTimeNavigator/components/CursorLayer.d.ts +20 -0
- package/lib/components/pisellTimeNavigator/components/CursorLayer.js +74 -0
- package/lib/components/pisellTimeNavigator/components/GestureLayer.d.ts +31 -0
- package/lib/components/pisellTimeNavigator/components/GestureLayer.js +159 -0
- package/lib/components/pisellTimeNavigator/components/NowButton.d.ts +14 -0
- package/lib/components/pisellTimeNavigator/components/NowButton.js +81 -0
- package/lib/components/pisellTimeNavigator/components/ScaleLayer.d.ts +17 -0
- package/lib/components/pisellTimeNavigator/components/ScaleLayer.js +95 -0
- package/lib/components/pisellTimeNavigator/components/index.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/components/index.js +41 -0
- package/lib/components/pisellTimeNavigator/hooks/index.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/hooks/index.js +35 -0
- package/lib/components/pisellTimeNavigator/hooks/useDragInertia.d.ts +14 -0
- package/lib/components/pisellTimeNavigator/hooks/useDragInertia.js +136 -0
- package/lib/components/pisellTimeNavigator/hooks/useRealtime.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/hooks/useRealtime.js +49 -0
- package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +27 -0
- package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.js +81 -0
- package/lib/components/pisellTimeNavigator/index.d.ts +4 -0
- package/lib/components/pisellTimeNavigator/index.js +42 -0
- package/lib/components/pisellTimeNavigator/locales.d.ts +22 -0
- package/lib/components/pisellTimeNavigator/locales.js +41 -0
- package/lib/components/pisellTimeNavigator/types.d.ts +149 -0
- package/lib/components/pisellTimeNavigator/types.js +17 -0
- package/lib/components/pisellTimeNavigator/utils/index.d.ts +30 -0
- package/lib/components/pisellTimeNavigator/utils/index.js +107 -0
- package/lib/index.d.ts +15 -5
- package/lib/index.js +35 -0
- package/lib/locales/en-US.d.ts +2 -0
- package/lib/locales/en-US.js +2 -0
- package/lib/locales/zh-CN.d.ts +2 -0
- package/lib/locales/zh-CN.js +2 -0
- package/lib/locales/zh-TW.d.ts +2 -0
- package/lib/locales/zh-TW.js +2 -0
- package/lowcode/floor-map-layout-provider/meta.ts +65 -0
- package/lowcode/pisell-floor-map-layout/meta.ts +3894 -1
- package/lowcode/pisell-hierarchical-summary-list/meta.ts +244 -0
- package/lowcode/pisell-reservation-schedule/index.ts +3 -0
- package/lowcode/pisell-reservation-schedule/meta.ts +69 -0
- package/lowcode/pisell-reservation-schedule/snippets.ts +1 -0
- package/lowcode/pisell-reservation-schedule-band/index.ts +3 -0
- package/lowcode/pisell-reservation-schedule-band/meta.ts +96 -0
- package/lowcode/pisell-reservation-schedule-band/snippets.ts +1 -0
- package/lowcode/pisell-time-navigator/index.ts +3 -0
- package/lowcode/pisell-time-navigator/meta.ts +298 -0
- package/lowcode/pisell-time-navigator/snippets.ts +1 -0
- package/lowcode/render-figma-style-round-table-card/meta.ts +589 -0
- package/lowcode/render-figma-style-table-card/meta.ts +589 -0
- package/package.json +3 -3
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function (_e) { function e(_x) { return _e.apply(this, arguments); } e.toString = function () { return _e.toString(); }; return e; }(function (e) { throw e; }), f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function (_e2) { function e(_x2) { return _e2.apply(this, arguments); } e.toString = function () { return _e2.toString(); }; return e; }(function (e) { didErr = true; err = e; }), f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
/**
|
|
15
|
+
* FloorMapToolbar - 编辑态左侧侧边栏:按分类添加图元、绑定数据源与行;保存可选(默认用顶栏)
|
|
16
|
+
*/
|
|
17
|
+
import React, { useMemo } from 'react';
|
|
18
|
+
import classNames from 'classnames';
|
|
19
|
+
import { Select } from 'antd';
|
|
20
|
+
import { FLOOR_MAP_IMAGE_ELEMENT_KIND, FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types";
|
|
21
|
+
import { resolveDataBindingPolicy } from "../utils/floorMapElementKindUtils";
|
|
22
|
+
import { FLOOR_MAP_PALETTE_DRAG_MIME } from "../utils/floorMapDropUtils";
|
|
23
|
+
import "./FloorMapToolbar.less";
|
|
24
|
+
var PREFIX = 'pisell-floor-map-layout';
|
|
25
|
+
var DEFAULT_PLACEMENT_SIZE = {
|
|
26
|
+
width: 180,
|
|
27
|
+
height: 120
|
|
28
|
+
};
|
|
29
|
+
var DEFAULT_DECORATION_SIZE = 48;
|
|
30
|
+
function formatDataRecordOptionLabel(record) {
|
|
31
|
+
var name = record.name != null ? String(record.name) : '';
|
|
32
|
+
var status = record.status != null ? String(record.status) : '';
|
|
33
|
+
if (name && status) return "".concat(name, "\uFF08").concat(status, "\uFF09");
|
|
34
|
+
return name || String(record.id);
|
|
35
|
+
}
|
|
36
|
+
function getUnplacedRecordsForKey(dataSourceKey, dataSources, elements) {
|
|
37
|
+
var _dataSources$dataSour;
|
|
38
|
+
var used = new Set(elements.filter(function (e) {
|
|
39
|
+
var _e$dataBinding;
|
|
40
|
+
return ((_e$dataBinding = e.dataBinding) === null || _e$dataBinding === void 0 ? void 0 : _e$dataBinding.dataSourceKey) === dataSourceKey;
|
|
41
|
+
}).map(function (e) {
|
|
42
|
+
return e.dataBinding.recordId;
|
|
43
|
+
}));
|
|
44
|
+
var list = (_dataSources$dataSour = dataSources[dataSourceKey]) !== null && _dataSources$dataSour !== void 0 ? _dataSources$dataSour : [];
|
|
45
|
+
return list.filter(function (r) {
|
|
46
|
+
return r && typeof r.id === 'string' && !used.has(r.id);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function buildScenePreviewMergedItem(kind, dataSourceKey, size) {
|
|
50
|
+
var el = _objectSpread({
|
|
51
|
+
instanceId: "preview_".concat(kind.value),
|
|
52
|
+
canvasId: '',
|
|
53
|
+
x: 0,
|
|
54
|
+
y: 0,
|
|
55
|
+
width: size.width,
|
|
56
|
+
height: size.height,
|
|
57
|
+
elementKind: kind.value,
|
|
58
|
+
shape: kind.defaultShape,
|
|
59
|
+
dataBinding: dataSourceKey && resolveDataBindingPolicy(kind) !== 'none' ? {
|
|
60
|
+
dataSourceKey: dataSourceKey,
|
|
61
|
+
recordId: ''
|
|
62
|
+
} : undefined
|
|
63
|
+
}, kind.value === FLOOR_MAP_IMAGE_ELEMENT_KIND ? {
|
|
64
|
+
imageUrl: ''
|
|
65
|
+
} : {});
|
|
66
|
+
return {
|
|
67
|
+
id: el.instanceId,
|
|
68
|
+
instanceId: el.instanceId,
|
|
69
|
+
x: 0,
|
|
70
|
+
y: 0,
|
|
71
|
+
width: size.width,
|
|
72
|
+
height: size.height,
|
|
73
|
+
shape: kind.defaultShape,
|
|
74
|
+
elementKind: kind.value,
|
|
75
|
+
_sceneElement: el
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
var STAGE_PREVIEW_SIZE = {
|
|
79
|
+
width: 160,
|
|
80
|
+
height: 64
|
|
81
|
+
};
|
|
82
|
+
var IMAGE_PREVIEW_SIZE = {
|
|
83
|
+
width: 140,
|
|
84
|
+
height: 80
|
|
85
|
+
};
|
|
86
|
+
export function FloorMapToolbar(props) {
|
|
87
|
+
var config = props.config,
|
|
88
|
+
dataSources = props.dataSources,
|
|
89
|
+
_props$dataSourceLabe = props.dataSourceLabels,
|
|
90
|
+
dataSourceLabels = _props$dataSourceLabe === void 0 ? {} : _props$dataSourceLabe,
|
|
91
|
+
canCreate = props.canCreate,
|
|
92
|
+
placeMode = props.placeMode,
|
|
93
|
+
onPlaceModeChange = props.onPlaceModeChange,
|
|
94
|
+
renderPreviewItem = props.renderPreviewItem,
|
|
95
|
+
_props$placementPrevi = props.placementPreviewSize,
|
|
96
|
+
placementPreviewSize = _props$placementPrevi === void 0 ? DEFAULT_PLACEMENT_SIZE : _props$placementPrevi,
|
|
97
|
+
_props$decorationPrev = props.decorationPreviewSize,
|
|
98
|
+
decorationPreviewSize = _props$decorationPrev === void 0 ? DEFAULT_DECORATION_SIZE : _props$decorationPrev,
|
|
99
|
+
_props$sceneElements = props.sceneElements,
|
|
100
|
+
sceneElements = _props$sceneElements === void 0 ? [] : _props$sceneElements,
|
|
101
|
+
onSave = props.onSave,
|
|
102
|
+
saving = props.saving,
|
|
103
|
+
saveError = props.saveError,
|
|
104
|
+
layoutDirty = props.layoutDirty,
|
|
105
|
+
className = props.className,
|
|
106
|
+
onPaletteCardPointerDown = props.onPaletteCardPointerDown,
|
|
107
|
+
consumeToolbarClickIfTouchDrag = props.consumeToolbarClickIfTouchDrag;
|
|
108
|
+
var paletteKinds = useMemo(function () {
|
|
109
|
+
var _config$elementKinds;
|
|
110
|
+
return ((_config$elementKinds = config.elementKinds) !== null && _config$elementKinds !== void 0 ? _config$elementKinds : []).filter(function (k) {
|
|
111
|
+
return k.showInPalette !== false;
|
|
112
|
+
});
|
|
113
|
+
}, [config.elementKinds]);
|
|
114
|
+
var categories = useMemo(function () {
|
|
115
|
+
var _config$elementKindCa;
|
|
116
|
+
var raw = (_config$elementKindCa = config.elementKindCategories) !== null && _config$elementKindCa !== void 0 ? _config$elementKindCa : [];
|
|
117
|
+
var sorted = _toConsumableArray(raw).sort(function (a, b) {
|
|
118
|
+
var _a$order, _b$order;
|
|
119
|
+
return ((_a$order = a.order) !== null && _a$order !== void 0 ? _a$order : 0) - ((_b$order = b.order) !== null && _b$order !== void 0 ? _b$order : 0);
|
|
120
|
+
});
|
|
121
|
+
return sorted.length ? sorted : [{
|
|
122
|
+
id: '_uncat',
|
|
123
|
+
label: '图元',
|
|
124
|
+
order: 0
|
|
125
|
+
}];
|
|
126
|
+
}, [config.elementKindCategories]);
|
|
127
|
+
var kindsByCategory = useMemo(function () {
|
|
128
|
+
var _categories$0$id, _categories$;
|
|
129
|
+
var map = new Map();
|
|
130
|
+
var _iterator = _createForOfIteratorHelper(categories),
|
|
131
|
+
_step;
|
|
132
|
+
try {
|
|
133
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
134
|
+
var c = _step.value;
|
|
135
|
+
map.set(c.id, []);
|
|
136
|
+
}
|
|
137
|
+
} catch (err) {
|
|
138
|
+
_iterator.e(err);
|
|
139
|
+
} finally {
|
|
140
|
+
_iterator.f();
|
|
141
|
+
}
|
|
142
|
+
var fallbackId = (_categories$0$id = (_categories$ = categories[0]) === null || _categories$ === void 0 ? void 0 : _categories$.id) !== null && _categories$0$id !== void 0 ? _categories$0$id : '_uncat';
|
|
143
|
+
var _iterator2 = _createForOfIteratorHelper(paletteKinds),
|
|
144
|
+
_step2;
|
|
145
|
+
try {
|
|
146
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
147
|
+
var _k$categoryId;
|
|
148
|
+
var _k = _step2.value;
|
|
149
|
+
var cid = (_k$categoryId = _k.categoryId) !== null && _k$categoryId !== void 0 ? _k$categoryId : fallbackId;
|
|
150
|
+
if (!map.has(cid)) map.set(cid, []);
|
|
151
|
+
map.get(cid).push(_k);
|
|
152
|
+
}
|
|
153
|
+
} catch (err) {
|
|
154
|
+
_iterator2.e(err);
|
|
155
|
+
} finally {
|
|
156
|
+
_iterator2.f();
|
|
157
|
+
}
|
|
158
|
+
return map;
|
|
159
|
+
}, [categories, paletteKinds]);
|
|
160
|
+
var handleSelectKind = function handleSelectKind(kind) {
|
|
161
|
+
var policy = resolveDataBindingPolicy(kind);
|
|
162
|
+
var next = {
|
|
163
|
+
type: 'scene',
|
|
164
|
+
elementKind: kind.value,
|
|
165
|
+
/** 不预锁单一数据源,由用户在工具栏「数据源」中选择;落点时用 allowedKeys[0] 作兜底 */
|
|
166
|
+
dataSourceKey: undefined,
|
|
167
|
+
recordId: undefined
|
|
168
|
+
};
|
|
169
|
+
var isSame = (placeMode === null || placeMode === void 0 ? void 0 : placeMode.type) === 'scene' && placeMode.elementKind === kind.value;
|
|
170
|
+
onPlaceModeChange(isSame ? null : next);
|
|
171
|
+
void policy;
|
|
172
|
+
};
|
|
173
|
+
var handleDsChange = function handleDsChange(mode, key) {
|
|
174
|
+
onPlaceModeChange(_objectSpread(_objectSpread({}, mode), {}, {
|
|
175
|
+
dataSourceKey: key,
|
|
176
|
+
recordId: undefined
|
|
177
|
+
}));
|
|
178
|
+
};
|
|
179
|
+
var handleRecordChange = function handleRecordChange(mode, recordId) {
|
|
180
|
+
onPlaceModeChange(_objectSpread(_objectSpread({}, mode), {}, {
|
|
181
|
+
recordId: recordId || undefined
|
|
182
|
+
}));
|
|
183
|
+
};
|
|
184
|
+
var cancelPlaceMode = function cancelPlaceMode() {
|
|
185
|
+
return onPlaceModeChange(null);
|
|
186
|
+
};
|
|
187
|
+
var renderKindCard = function renderKindCard(k) {
|
|
188
|
+
var _k$allowedDataSourceK;
|
|
189
|
+
var policy = resolveDataBindingPolicy(k);
|
|
190
|
+
var isStage = k.value === FLOOR_MAP_STAGE_ELEMENT_KIND;
|
|
191
|
+
var isImageKind = k.value === FLOOR_MAP_IMAGE_ELEMENT_KIND;
|
|
192
|
+
var placementLike = policy !== 'none' && !isStage || isImageKind;
|
|
193
|
+
var size = isStage ? STAGE_PREVIEW_SIZE : placementLike ? isImageKind ? IMAGE_PREVIEW_SIZE : placementPreviewSize : {
|
|
194
|
+
width: decorationPreviewSize,
|
|
195
|
+
height: decorationPreviewSize
|
|
196
|
+
};
|
|
197
|
+
var activeDs = (placeMode === null || placeMode === void 0 ? void 0 : placeMode.type) === 'scene' && placeMode.elementKind === k.value ? placeMode.dataSourceKey : undefined;
|
|
198
|
+
var item = buildScenePreviewMergedItem(k, activeDs, size);
|
|
199
|
+
var isActive = (placeMode === null || placeMode === void 0 ? void 0 : placeMode.type) === 'scene' && placeMode.elementKind === k.value;
|
|
200
|
+
var cellW = isStage ? 92 : placementLike ? 80 : decorationPreviewSize;
|
|
201
|
+
var cellH = isStage ? 40 : placementLike ? 54 : decorationPreviewSize;
|
|
202
|
+
var previewW = isImageKind ? IMAGE_PREVIEW_SIZE.width : placementPreviewSize.width;
|
|
203
|
+
var previewH = isImageKind ? IMAGE_PREVIEW_SIZE.height : placementPreviewSize.height;
|
|
204
|
+
var placeScale = placementLike ? Math.min(cellW / previewW, cellH / previewH) : 1;
|
|
205
|
+
var stageScale = isStage ? Math.min(cellW / item.width, cellH / item.height, 1) : 1;
|
|
206
|
+
var allKeys = Object.keys(dataSources);
|
|
207
|
+
var allowedKeys = (_k$allowedDataSourceK = k.allowedDataSourceKeys) !== null && _k$allowedDataSourceK !== void 0 && _k$allowedDataSourceK.length ? k.allowedDataSourceKeys.filter(function (x) {
|
|
208
|
+
return allKeys.includes(x);
|
|
209
|
+
}) : allKeys;
|
|
210
|
+
var paletteDragPayload = _objectSpread({
|
|
211
|
+
elementKind: k.value
|
|
212
|
+
}, (placeMode === null || placeMode === void 0 ? void 0 : placeMode.type) === 'scene' && placeMode.elementKind === k.value ? {
|
|
213
|
+
dataSourceKey: placeMode.dataSourceKey,
|
|
214
|
+
recordId: placeMode.recordId
|
|
215
|
+
} : {});
|
|
216
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
key: k.value,
|
|
218
|
+
className: "".concat(PREFIX, "-toolbar-preview-card-wrap")
|
|
219
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
220
|
+
type: "button",
|
|
221
|
+
draggable: true,
|
|
222
|
+
className: classNames("".concat(PREFIX, "-toolbar-preview-card"), !placementLike ? "".concat(PREFIX, "-toolbar-preview-card-deco") : undefined, _defineProperty({}, "".concat(PREFIX, "-toolbar-preview-card-active"), isActive)),
|
|
223
|
+
onClick: function onClick() {
|
|
224
|
+
if (consumeToolbarClickIfTouchDrag !== null && consumeToolbarClickIfTouchDrag !== void 0 && consumeToolbarClickIfTouchDrag()) return;
|
|
225
|
+
handleSelectKind(k);
|
|
226
|
+
},
|
|
227
|
+
onPointerDown: function onPointerDown(e) {
|
|
228
|
+
return onPaletteCardPointerDown === null || onPaletteCardPointerDown === void 0 ? void 0 : onPaletteCardPointerDown(paletteDragPayload, e);
|
|
229
|
+
},
|
|
230
|
+
onDragStart: function onDragStart(e) {
|
|
231
|
+
e.dataTransfer.setData(FLOOR_MAP_PALETTE_DRAG_MIME, JSON.stringify(paletteDragPayload));
|
|
232
|
+
e.dataTransfer.effectAllowed = 'copy';
|
|
233
|
+
},
|
|
234
|
+
title: "\u70B9\u51FB\u540E\u753B\u5E03\u843D\u70B9\uFF0C\u6216\u62D6\u62FD\u5230\u753B\u5E03\u751F\u6210\u300C".concat(k.label, "\u300D")
|
|
235
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
236
|
+
className: "".concat(PREFIX, "-toolbar-preview-cell"),
|
|
237
|
+
style: {
|
|
238
|
+
width: cellW,
|
|
239
|
+
height: cellH
|
|
240
|
+
}
|
|
241
|
+
}, renderPreviewItem ? /*#__PURE__*/React.createElement("div", {
|
|
242
|
+
className: "".concat(PREFIX, "-toolbar-preview-content"),
|
|
243
|
+
style: placementLike ? {
|
|
244
|
+
width: previewW,
|
|
245
|
+
height: previewH,
|
|
246
|
+
transform: "scale(".concat(placeScale, ")"),
|
|
247
|
+
transformOrigin: 'top left'
|
|
248
|
+
} : isStage ? {
|
|
249
|
+
width: item.width,
|
|
250
|
+
height: item.height,
|
|
251
|
+
transform: "scale(".concat(stageScale, ")"),
|
|
252
|
+
transformOrigin: 'top left'
|
|
253
|
+
} : undefined
|
|
254
|
+
}, renderPreviewItem(item)) : /*#__PURE__*/React.createElement("span", {
|
|
255
|
+
className: "".concat(PREFIX, "-toolbar-preview-fallback")
|
|
256
|
+
}, k.label)), /*#__PURE__*/React.createElement("span", {
|
|
257
|
+
className: "".concat(PREFIX, "-toolbar-preview-card-label")
|
|
258
|
+
}, k.label)), isActive && policy !== 'none' && /*#__PURE__*/React.createElement(React.Fragment, null, allowedKeys.length >= 1 && /*#__PURE__*/React.createElement("div", {
|
|
259
|
+
className: "".concat(PREFIX, "-toolbar-record-pick")
|
|
260
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
261
|
+
className: "".concat(PREFIX, "-toolbar-record-pick-label")
|
|
262
|
+
}, "\u6570\u636E\u7ED1\u5B9A\uFF08\u53EF\u9009\uFF09"), /*#__PURE__*/React.createElement(Select, {
|
|
263
|
+
placeholder: "\u9009\u62E9\u6570\u636E\u6E90",
|
|
264
|
+
allowClear: true,
|
|
265
|
+
value: placeMode.type === 'scene' ? placeMode.dataSourceKey : undefined,
|
|
266
|
+
options: allowedKeys.map(function (key) {
|
|
267
|
+
var _dataSourceLabels$key;
|
|
268
|
+
return {
|
|
269
|
+
value: key,
|
|
270
|
+
label: (_dataSourceLabels$key = dataSourceLabels[key]) !== null && _dataSourceLabels$key !== void 0 ? _dataSourceLabels$key : key
|
|
271
|
+
};
|
|
272
|
+
}),
|
|
273
|
+
onChange: function onChange(v) {
|
|
274
|
+
if ((placeMode === null || placeMode === void 0 ? void 0 : placeMode.type) === 'scene') handleDsChange(placeMode, v);
|
|
275
|
+
},
|
|
276
|
+
size: "small",
|
|
277
|
+
style: {
|
|
278
|
+
width: '100%'
|
|
279
|
+
}
|
|
280
|
+
}), function () {
|
|
281
|
+
var mode = (placeMode === null || placeMode === void 0 ? void 0 : placeMode.type) === 'scene' ? placeMode : null;
|
|
282
|
+
var key = mode === null || mode === void 0 ? void 0 : mode.dataSourceKey;
|
|
283
|
+
if (!key) {
|
|
284
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
285
|
+
className: "".concat(PREFIX, "-toolbar-record-pick-hint")
|
|
286
|
+
}, "\u9009\u62E9\u6570\u636E\u6E90\u540E\u53EF\u9009\u7ED1\u5B9A\u6570\u636E\u884C\uFF0C\u6216\u76F4\u63A5\u843D\u70B9\u5360\u4F4D\u3002");
|
|
287
|
+
}
|
|
288
|
+
var unplaced = getUnplacedRecordsForKey(key, dataSources, sceneElements);
|
|
289
|
+
if (unplaced.length === 0) {
|
|
290
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
291
|
+
className: "".concat(PREFIX, "-toolbar-record-pick-hint")
|
|
292
|
+
}, "\u5F53\u524D\u6570\u636E\u6E90\u65E0\u672A\u7ED1\u5B9A\u8BB0\u5F55\uFF0C\u6216\u5217\u8868\u4E3A\u7A7A\uFF1B\u53EF\u76F4\u63A5\u5728\u753B\u5E03\u843D\u70B9\u5360\u4F4D\u3002");
|
|
293
|
+
}
|
|
294
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Select, {
|
|
295
|
+
placeholder: "\u9009\u62E9\u8981\u5C55\u793A\u7684\u8BB0\u5F55\uFF08\u53EF\u9009\uFF09",
|
|
296
|
+
allowClear: true,
|
|
297
|
+
value: mode === null || mode === void 0 ? void 0 : mode.recordId,
|
|
298
|
+
options: unplaced.map(function (r) {
|
|
299
|
+
return {
|
|
300
|
+
value: r.id,
|
|
301
|
+
label: formatDataRecordOptionLabel(r)
|
|
302
|
+
};
|
|
303
|
+
}),
|
|
304
|
+
onChange: function onChange(v) {
|
|
305
|
+
if (mode) handleRecordChange(mode, v);
|
|
306
|
+
},
|
|
307
|
+
size: "small",
|
|
308
|
+
style: {
|
|
309
|
+
width: '100%',
|
|
310
|
+
marginTop: 4
|
|
311
|
+
}
|
|
312
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
313
|
+
className: "".concat(PREFIX, "-toolbar-record-pick-hint")
|
|
314
|
+
}, "\u9009\u4E2D\u540E\u5728\u753B\u5E03\u70B9\u51FB\u5B8C\u6210\u843D\u4F4D\uFF1B\u7559\u7A7A\u5219\u5148\u5360\u4F4D\uFF0C\u7A0D\u540E\u5728\u4FA7\u680F\u7ED1\u5B9A\u3002"));
|
|
315
|
+
}()), allowedKeys.length === 0 && /*#__PURE__*/React.createElement("div", {
|
|
316
|
+
className: "".concat(PREFIX, "-toolbar-record-hint")
|
|
317
|
+
}, "\u65E0\u53EF\u7528\u6570\u636E\u6E90"), /*#__PURE__*/React.createElement("button", {
|
|
318
|
+
type: "button",
|
|
319
|
+
className: "".concat(PREFIX, "-toolbar-btn cancel-inline"),
|
|
320
|
+
onClick: cancelPlaceMode
|
|
321
|
+
}, "\u53D6\u6D88\u65B0\u5EFA")), isActive && policy === 'none' && /*#__PURE__*/React.createElement("button", {
|
|
322
|
+
type: "button",
|
|
323
|
+
className: "".concat(PREFIX, "-toolbar-btn cancel-inline"),
|
|
324
|
+
onClick: cancelPlaceMode
|
|
325
|
+
}, "\u53D6\u6D88\u65B0\u5EFA"));
|
|
326
|
+
};
|
|
327
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
328
|
+
className: classNames("".concat(PREFIX, "-toolbar"), "".concat(PREFIX, "-toolbar-sidebar"), className)
|
|
329
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
330
|
+
className: "".concat(PREFIX, "-toolbar-body")
|
|
331
|
+
}, canCreate && /*#__PURE__*/React.createElement(React.Fragment, null, categories.map(function (cat) {
|
|
332
|
+
var _kindsByCategory$get;
|
|
333
|
+
var kinds = (_kindsByCategory$get = kindsByCategory.get(cat.id)) !== null && _kindsByCategory$get !== void 0 ? _kindsByCategory$get : [];
|
|
334
|
+
if (!kinds.length) return null;
|
|
335
|
+
return /*#__PURE__*/React.createElement("section", {
|
|
336
|
+
key: cat.id,
|
|
337
|
+
className: "".concat(PREFIX, "-toolbar-section")
|
|
338
|
+
}, /*#__PURE__*/React.createElement("h3", {
|
|
339
|
+
className: "".concat(PREFIX, "-toolbar-section-title")
|
|
340
|
+
}, cat.label), /*#__PURE__*/React.createElement("div", {
|
|
341
|
+
className: "".concat(PREFIX, "-toolbar-preview-list")
|
|
342
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
343
|
+
className: "".concat(PREFIX, "-toolbar-preview-group")
|
|
344
|
+
}, kinds.map(function (k) {
|
|
345
|
+
return renderKindCard(k);
|
|
346
|
+
}))));
|
|
347
|
+
}))), onSave && config.canvasUi.canEdit && /*#__PURE__*/React.createElement("div", {
|
|
348
|
+
className: "".concat(PREFIX, "-toolbar-footer")
|
|
349
|
+
}, layoutDirty ? /*#__PURE__*/React.createElement("span", {
|
|
350
|
+
className: "".concat(PREFIX, "-toolbar-dirty-hint"),
|
|
351
|
+
role: "status"
|
|
352
|
+
}, "\u5E03\u5C40\u5DF2\u4FEE\u6539\uFF0C\u8BF7\u70B9\u51FB\u300C\u4FDD\u5B58\u300D\u6301\u4E45\u5316\u3002") : null, saveError && /*#__PURE__*/React.createElement("span", {
|
|
353
|
+
className: "".concat(PREFIX, "-toolbar-error")
|
|
354
|
+
}, typeof saveError === 'string' ? saveError : saveError === null || saveError === void 0 ? void 0 : saveError.message), /*#__PURE__*/React.createElement("button", {
|
|
355
|
+
type: "button",
|
|
356
|
+
className: classNames("".concat(PREFIX, "-toolbar-btn"), 'primary', _defineProperty({}, "".concat(PREFIX, "-toolbar-save-dirty"), layoutDirty)),
|
|
357
|
+
disabled: saving,
|
|
358
|
+
onClick: onSave
|
|
359
|
+
}, saving ? '保存中...' : '保存')));
|
|
360
|
+
}
|
|
361
|
+
export default FloorMapToolbar;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/* 左侧侧边栏:添加数据图元 / 添加装饰(图元预览)+ 保存 */
|
|
2
|
+
.pisell-floor-map-layout-toolbar {
|
|
3
|
+
&.pisell-floor-map-layout-toolbar-sidebar {
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 220px;
|
|
6
|
+
flex-shrink: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
background: #fff;
|
|
10
|
+
border-right: 1px solid #e8e8e8;
|
|
11
|
+
z-index: 10;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-body {
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
padding: 12px 10px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-section {
|
|
22
|
+
margin-bottom: 16px;
|
|
23
|
+
|
|
24
|
+
&:last-of-type {
|
|
25
|
+
margin-bottom: 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-section-title {
|
|
30
|
+
margin: 0 0 8px 0;
|
|
31
|
+
padding: 0 4px;
|
|
32
|
+
font-size: 13px;
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
color: #262626;
|
|
35
|
+
line-height: 20px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-preview-list {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 8px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-preview-group {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
gap: 6px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-preview-group-label {
|
|
51
|
+
padding: 0 4px;
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
color: #8c8c8c;
|
|
54
|
+
line-height: 18px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&-preview-card-wrap {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: 6px;
|
|
61
|
+
align-items: stretch;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-preview-card {
|
|
65
|
+
display: block;
|
|
66
|
+
width: 100%;
|
|
67
|
+
padding: 6px;
|
|
68
|
+
text-align: center;
|
|
69
|
+
background: #fafafa;
|
|
70
|
+
border: 1px solid #e8e8e8;
|
|
71
|
+
border-radius: 6px;
|
|
72
|
+
cursor: grab;
|
|
73
|
+
transition: border-color 0.2s, background 0.2s;
|
|
74
|
+
|
|
75
|
+
&:hover {
|
|
76
|
+
background: #f0f7ff;
|
|
77
|
+
border-color: #91caff;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.pisell-floor-map-layout-toolbar-preview-card-active {
|
|
81
|
+
background: #e6f4ff;
|
|
82
|
+
border-color: #1677ff;
|
|
83
|
+
box-shadow: 0 0 0 1px #1677ff;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.pisell-floor-map-layout-toolbar-preview-card-deco {
|
|
87
|
+
.pisell-floor-map-layout-toolbar-preview-cell {
|
|
88
|
+
margin: 0 auto;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&-preview-card-label {
|
|
94
|
+
display: block;
|
|
95
|
+
margin-top: 4px;
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
color: #262626;
|
|
98
|
+
line-height: 18px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&-preview-cell {
|
|
102
|
+
position: relative;
|
|
103
|
+
margin: 0 auto;
|
|
104
|
+
overflow: hidden;
|
|
105
|
+
border-radius: 4px;
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-preview-content {
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&-preview-cell {
|
|
114
|
+
.pisell-floor-map-layout-toolbar-preview-content {
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&-preview-fallback {
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
width: 100%;
|
|
124
|
+
height: 100%;
|
|
125
|
+
min-height: 40px;
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
color: #8c8c8c;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&-btn {
|
|
131
|
+
display: block;
|
|
132
|
+
width: 100%;
|
|
133
|
+
margin-top: 8px;
|
|
134
|
+
padding: 8px 12px;
|
|
135
|
+
font-size: 13px;
|
|
136
|
+
color: #333;
|
|
137
|
+
background: #f5f5f5;
|
|
138
|
+
border: 1px solid #d9d9d9;
|
|
139
|
+
border-radius: 6px;
|
|
140
|
+
cursor: pointer;
|
|
141
|
+
|
|
142
|
+
&:hover {
|
|
143
|
+
color: #1677ff;
|
|
144
|
+
border-color: #1677ff;
|
|
145
|
+
background: #e6f4ff;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.cancel {
|
|
149
|
+
color: #8c8c8c;
|
|
150
|
+
margin-top: 12px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.cancel-inline {
|
|
154
|
+
margin-top: 0;
|
|
155
|
+
padding: 4px 8px;
|
|
156
|
+
font-size: 12px;
|
|
157
|
+
color: #8c8c8c;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&.primary {
|
|
161
|
+
color: #fff;
|
|
162
|
+
background: #1677ff;
|
|
163
|
+
border-color: #1677ff;
|
|
164
|
+
|
|
165
|
+
&:hover:not(:disabled) {
|
|
166
|
+
background: #4096ff;
|
|
167
|
+
border-color: #4096ff;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&:disabled {
|
|
171
|
+
opacity: 0.6;
|
|
172
|
+
cursor: not-allowed;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&-footer {
|
|
178
|
+
flex-shrink: 0;
|
|
179
|
+
padding: 12px 10px;
|
|
180
|
+
border-top: 1px solid #f0f0f0;
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
gap: 8px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&-dirty-hint {
|
|
187
|
+
font-size: 12px;
|
|
188
|
+
line-height: 1.45;
|
|
189
|
+
color: #d48806;
|
|
190
|
+
padding: 6px 8px;
|
|
191
|
+
background: #fffbe6;
|
|
192
|
+
border: 1px solid #ffe58f;
|
|
193
|
+
border-radius: 6px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
&-save-dirty {
|
|
197
|
+
box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.35);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&-error {
|
|
201
|
+
font-size: 12px;
|
|
202
|
+
color: #ff4d4f;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&-record-pick {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: column;
|
|
208
|
+
gap: 6px;
|
|
209
|
+
padding: 8px;
|
|
210
|
+
margin-top: 4px;
|
|
211
|
+
background: #f5f5f5;
|
|
212
|
+
border-radius: 6px;
|
|
213
|
+
border: 1px solid #e8e8e8;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&-record-pick-label {
|
|
217
|
+
font-size: 12px;
|
|
218
|
+
font-weight: 600;
|
|
219
|
+
color: #434343;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
&-record-pick-hint {
|
|
223
|
+
font-size: 11px;
|
|
224
|
+
color: #8c8c8c;
|
|
225
|
+
line-height: 1.45;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&-record-hint {
|
|
229
|
+
font-size: 11px;
|
|
230
|
+
color: #8c8c8c;
|
|
231
|
+
padding: 6px 8px;
|
|
232
|
+
margin-top: 4px;
|
|
233
|
+
line-height: 1.45;
|
|
234
|
+
background: #fafafa;
|
|
235
|
+
border-radius: 4px;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { FloorMapItemBase, FloorMapItemUnit } from '../types';
|
|
7
|
+
import type { CSSProperties } from 'react';
|
|
7
8
|
import './ItemLayer.less';
|
|
8
9
|
export interface ItemLayerProps<T extends FloorMapItemBase> {
|
|
9
10
|
/** 资源列表 */
|
|
@@ -22,6 +23,10 @@ export interface ItemLayerProps<T extends FloorMapItemBase> {
|
|
|
22
23
|
contentWidth: number;
|
|
23
24
|
/** 内容区总高度(像素) */
|
|
24
25
|
contentHeight: number;
|
|
26
|
+
/** 内容区 X 偏移(画布包围盒向左/上扩展时,图元层整体平移) */
|
|
27
|
+
contentOffsetX?: number;
|
|
28
|
+
/** 内容区 Y 偏移 */
|
|
29
|
+
contentOffsetY?: number;
|
|
25
30
|
/** 是否启用 hover 事件 */
|
|
26
31
|
enableHover?: boolean;
|
|
27
32
|
/** 点击回调 */
|
|
@@ -30,6 +35,8 @@ export interface ItemLayerProps<T extends FloorMapItemBase> {
|
|
|
30
35
|
onItemHover?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
|
|
31
36
|
/** hover 离开 */
|
|
32
37
|
onItemLeave?: (item: T, index: number, e: React.MouseEvent<HTMLElement>) => void;
|
|
38
|
+
/** 每项外层容器额外样式(与定位样式合并) */
|
|
39
|
+
getMergedItemWrapperStyle?: (item: T, index: number) => CSSProperties | undefined;
|
|
33
40
|
className?: string;
|
|
34
41
|
}
|
|
35
42
|
export declare function ItemLayer<T extends FloorMapItemBase>(props: ItemLayerProps<T>): JSX.Element;
|