@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
|
@@ -1 +1,148 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 资源项形状
|
|
3
|
+
* @description 展示层支持的基础形状
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 底层背景类型
|
|
8
|
+
* @description 地图底层的展示方式
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 平移边界策略
|
|
13
|
+
* @description 拖拽/手势平移时的边界行为
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 资源项坐标/尺寸单位
|
|
18
|
+
* - cell:x/y/width/height 为格子数,由 cellSize 转为像素
|
|
19
|
+
* - pixel:x/y/width/height 为像素
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 资源项基础类型
|
|
24
|
+
* @description 每个资源至少包含 id 与坐标 (x, y),其余由外部扩展。
|
|
25
|
+
* 单位由布局的 itemUnit 决定:cell 时为格子数,pixel 时为像素。
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 底层(MapLayer)配置
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 缩放配置
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 平移配置
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 视图控制显隐(默认仅显示放大/缩小,复位与区域定位需配置开启)
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 布局模式(规则网格 vs 完全自由坐标)
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 规则网格布局配置(layoutMode 为 grid 时可用)
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
// ---------- 方案:画布 / 图元 / 视图配置 ----------
|
|
53
|
+
|
|
54
|
+
/** 图元类型:是否绑定业务资源 */
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 画布名称多语言结构(与低代码 Translation 字段一致)
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/** 画布(对应一个 Tab,如 1楼、2楼) */
|
|
61
|
+
|
|
62
|
+
/** 文字槽位(编辑时在 SVG 上添加,阅读态通过参数传文案) */
|
|
63
|
+
|
|
64
|
+
/** 地图图元:资源或装饰,编辑与阅读共用(name/zIndex 继承自 FloorMapItemBase) */
|
|
65
|
+
|
|
66
|
+
/** 单门店 Floor Map 数据(编辑/阅读共用) */
|
|
67
|
+
|
|
68
|
+
/** 多数据源:key 为数据源标识,value 为该数据源下的记录列表 */
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 画布图元与可选数据源行的绑定(无绑定时仅展示图元种类默认态)
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 画布上的单一图元实例(原 dataSourcePlacements + decorations 合并为同一结构)
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 矩形区域类装饰(无数据源绑定),如画布上的「舞台/舞池」等。
|
|
80
|
+
* 在 `elementKinds` 中配置 `{ value: 'stage', label: '…', showInPalette: true }`,名称在编辑面板「显示名称」中修改。
|
|
81
|
+
*/
|
|
82
|
+
export var FLOOR_MAP_STAGE_ELEMENT_KIND = 'stage';
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 图片图元:无数据源绑定,通过 `imageUrl` 展示位图;适合铺底图或与业务图元叠放(调 `zIndex`)。
|
|
86
|
+
*/
|
|
87
|
+
export var FLOOR_MAP_IMAGE_ELEMENT_KIND = 'floorMapImage';
|
|
88
|
+
|
|
89
|
+
/** 图元是否接受数据源及是否必填 */
|
|
90
|
+
|
|
91
|
+
/** 图元种类所属分类(调色板分组) */
|
|
92
|
+
|
|
93
|
+
/** 无数据源行时的占位展示文案/扩展(与 defaultShape 等并列) */
|
|
94
|
+
|
|
95
|
+
/** 图元间连线(边) */
|
|
96
|
+
|
|
97
|
+
/** 图元种类配置(由后端或上层注入) */
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 画布/编辑器层能力:新建图元、布局与画布 Tab 的编辑权限
|
|
101
|
+
* @description 与 `canvases` 列表配合使用,统一挂在平面图配置的「画布 UI」下
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
/** Floor Map 视图配置(仅平面图视图需要持久化) */
|
|
105
|
+
|
|
106
|
+
/** 编辑态:选中图元种类后的放置模式(点击画布落点) */
|
|
107
|
+
|
|
108
|
+
/** 阅读态 renderItem 可选第三参数 */
|
|
109
|
+
|
|
110
|
+
/** 数据源记录表单列配置(用于编辑面板中的「数据源记录」区块) */
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 自定义「数据源记录」表单(ReactNode 或 render prop)可用的上下文
|
|
114
|
+
* @description 与内置 {@link FloorMapDataForm} 数据源一致,便于复杂表单、多步校验、联动等
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 按 dataSourceKey 替换「数据源记录」区块的表单内容:静态节点或通过 context 渲染
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/** 选中图元后编辑面板参数 */
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 合并当前画布的 sceneElements 为 items(用于 Layout 渲染)
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 平面图编辑态全屏 UI 策略(`floorMapFullscreenMode`)
|
|
129
|
+
*
|
|
130
|
+
* - **toggle**(默认):顶栏提供进入/退出全屏,与浏览器 Fullscreen API 联动
|
|
131
|
+
* - **locked**:始终使用全屏顶栏(Tab + 保存等),**不提供退出全屏**;适合外层遮罩铺满
|
|
132
|
+
* - **disabled**:**不提供全屏按钮**,仅小屏顶栏 + 侧栏保存
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* 平面图 Layout 注入上下文:数据、保存、侧栏表单与状态等(不包含 renderItem/mapLayer 等展示向 props)。
|
|
137
|
+
* 由 `FloorMapLayoutProvider` / RecordBoard `floorMapLayoutContext` 提供,与 `PisellFloorMapLayout` props 按 `??` 合并,props 优先。
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* PisellFloorMapLayout 组件 Props
|
|
142
|
+
* @template T - 资源项类型,需继承 FloorMapItemBase 或兼容 id/x/y
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* PisellFloorMapLayout Ref 方法
|
|
147
|
+
* @description 供外部调用缩放、复位、区域定位等
|
|
148
|
+
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { FloorMapCanvas, FloorMapCanvasNameI18n } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 合并平面图 Tab 用多语言包(与业务侧 `locales.init` 可叠加)。
|
|
4
|
+
*/
|
|
5
|
+
export declare function initFloorMapLayoutLocales(engineLocale: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* 从多语言对象中取当前 locale 下展示字符串,缺省按 en → 其余首个非空。
|
|
8
|
+
*/
|
|
9
|
+
export declare function pickFloorMapCanvasI18nString(obj: FloorMapCanvasNameI18n, engineLocale: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* 画布在 Tab / 下拉中的展示名:
|
|
12
|
+
* 1. `name` 为多语言对象时 **优先** 按引擎 locale 取字段(与配置内嵌文案一致);
|
|
13
|
+
* 2. 否则 `nameKey` + `locales.getText`(需业务侧已 init 对应语言包);
|
|
14
|
+
* 3. 否则 `name` 字符串。
|
|
15
|
+
*/
|
|
16
|
+
export declare function getFloorMapCanvasDisplayName(canvas: FloorMapCanvas, engineLocale: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* 打开重命名弹层时的初始多语言值(与 Translation 表单一致)。
|
|
19
|
+
*/
|
|
20
|
+
export declare function seedFloorMapCanvasNameI18n(canvas: FloorMapCanvas, displayFallback: string): FloorMapCanvasNameI18n;
|
|
@@ -0,0 +1,129 @@
|
|
|
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(_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 e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
import { locales } from '@pisell/utils';
|
|
6
|
+
import floorMapLayoutLocales from "../locales";
|
|
7
|
+
import { createTranslationText } from "../../translation/utils";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 合并平面图 Tab 用多语言包(与业务侧 `locales.init` 可叠加)。
|
|
11
|
+
*/
|
|
12
|
+
export function initFloorMapLayoutLocales(engineLocale) {
|
|
13
|
+
locales.init(floorMapLayoutLocales, engineLocale);
|
|
14
|
+
}
|
|
15
|
+
var I18N_LOCALE_ORDER = ['en', 'zh-CN', 'zh-HK', 'ja', 'pt'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 引擎 locale 与画布 name 对象字段对齐(如 en-US → en、zh_CN → zh-CN)。
|
|
19
|
+
*/
|
|
20
|
+
function localeKeysToTryForCanvasName(engineLocale) {
|
|
21
|
+
var out = [];
|
|
22
|
+
var push = function push(k) {
|
|
23
|
+
if (!out.includes(k)) out.push(k);
|
|
24
|
+
};
|
|
25
|
+
push(engineLocale);
|
|
26
|
+
if (engineLocale === 'en-US' || engineLocale === 'en-GB') {
|
|
27
|
+
push('en');
|
|
28
|
+
}
|
|
29
|
+
if (engineLocale === 'zh_CN' || engineLocale === 'zh') {
|
|
30
|
+
push('zh-CN');
|
|
31
|
+
}
|
|
32
|
+
var _iterator = _createForOfIteratorHelper(I18N_LOCALE_ORDER),
|
|
33
|
+
_step;
|
|
34
|
+
try {
|
|
35
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
36
|
+
var k = _step.value;
|
|
37
|
+
push(k);
|
|
38
|
+
}
|
|
39
|
+
} catch (err) {
|
|
40
|
+
_iterator.e(err);
|
|
41
|
+
} finally {
|
|
42
|
+
_iterator.f();
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 从多语言对象中取当前 locale 下展示字符串,缺省按 en → 其余首个非空。
|
|
49
|
+
*/
|
|
50
|
+
export function pickFloorMapCanvasI18nString(obj, engineLocale) {
|
|
51
|
+
var _iterator2 = _createForOfIteratorHelper(localeKeysToTryForCanvasName(engineLocale)),
|
|
52
|
+
_step2;
|
|
53
|
+
try {
|
|
54
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
55
|
+
var loc = _step2.value;
|
|
56
|
+
var _v = obj[loc];
|
|
57
|
+
if (typeof _v === 'string' && _v.trim()) return _v.trim();
|
|
58
|
+
}
|
|
59
|
+
} catch (err) {
|
|
60
|
+
_iterator2.e(err);
|
|
61
|
+
} finally {
|
|
62
|
+
_iterator2.f();
|
|
63
|
+
}
|
|
64
|
+
for (var _i = 0, _Object$values = Object.values(obj); _i < _Object$values.length; _i++) {
|
|
65
|
+
var v = _Object$values[_i];
|
|
66
|
+
if (typeof v === 'string' && v.trim()) return v.trim();
|
|
67
|
+
}
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
function isCanvasNameI18nObject(n) {
|
|
71
|
+
if (!n || _typeof(n) !== 'object' || Array.isArray(n)) return false;
|
|
72
|
+
var o = n;
|
|
73
|
+
var _iterator3 = _createForOfIteratorHelper(I18N_LOCALE_ORDER),
|
|
74
|
+
_step3;
|
|
75
|
+
try {
|
|
76
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
77
|
+
var k = _step3.value;
|
|
78
|
+
if (typeof o[k] === 'string') return true;
|
|
79
|
+
}
|
|
80
|
+
} catch (err) {
|
|
81
|
+
_iterator3.e(err);
|
|
82
|
+
} finally {
|
|
83
|
+
_iterator3.f();
|
|
84
|
+
}
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 画布在 Tab / 下拉中的展示名:
|
|
90
|
+
* 1. `name` 为多语言对象时 **优先** 按引擎 locale 取字段(与配置内嵌文案一致);
|
|
91
|
+
* 2. 否则 `nameKey` + `locales.getText`(需业务侧已 init 对应语言包);
|
|
92
|
+
* 3. 否则 `name` 字符串。
|
|
93
|
+
*/
|
|
94
|
+
export function getFloorMapCanvasDisplayName(canvas, engineLocale) {
|
|
95
|
+
initFloorMapLayoutLocales(engineLocale);
|
|
96
|
+
var n = canvas.name;
|
|
97
|
+
if (isCanvasNameI18nObject(n)) {
|
|
98
|
+
var fromObj = pickFloorMapCanvasI18nString(n, engineLocale);
|
|
99
|
+
if (fromObj) return fromObj;
|
|
100
|
+
}
|
|
101
|
+
if (canvas.nameKey) {
|
|
102
|
+
var t = locales.getText(canvas.nameKey);
|
|
103
|
+
if (t !== canvas.nameKey) return t;
|
|
104
|
+
}
|
|
105
|
+
if (typeof n === 'string') return n;
|
|
106
|
+
if (n && _typeof(n) === 'object' && !Array.isArray(n)) {
|
|
107
|
+
return pickFloorMapCanvasI18nString(n, engineLocale);
|
|
108
|
+
}
|
|
109
|
+
return '';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 打开重命名弹层时的初始多语言值(与 Translation 表单一致)。
|
|
114
|
+
*/
|
|
115
|
+
export function seedFloorMapCanvasNameI18n(canvas, displayFallback) {
|
|
116
|
+
var n = canvas.name;
|
|
117
|
+
if (n && _typeof(n) === 'object') {
|
|
118
|
+
var _n$en, _n$zhCN, _n$zhHK, _n$ja, _n$pt;
|
|
119
|
+
return {
|
|
120
|
+
en: (_n$en = n.en) !== null && _n$en !== void 0 ? _n$en : '',
|
|
121
|
+
'zh-CN': (_n$zhCN = n['zh-CN']) !== null && _n$zhCN !== void 0 ? _n$zhCN : '',
|
|
122
|
+
'zh-HK': (_n$zhHK = n['zh-HK']) !== null && _n$zhHK !== void 0 ? _n$zhHK : '',
|
|
123
|
+
ja: (_n$ja = n.ja) !== null && _n$ja !== void 0 ? _n$ja : '',
|
|
124
|
+
pt: (_n$pt = n.pt) !== null && _n$pt !== void 0 ? _n$pt : ''
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
var s = typeof n === 'string' && n.trim() ? n.trim() : displayFallback;
|
|
128
|
+
return createTranslationText(s, true);
|
|
129
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将当前画布的 sceneElements 合并为 Layout 使用的 FloorMapMergedItem[]
|
|
3
|
+
*/
|
|
4
|
+
import type { FloorMapViewConfig, FloorMapMergedItem } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* 合并指定画布下的 sceneElements 为一份 items(用于 ItemLayer / EditableItemLayer)
|
|
7
|
+
*/
|
|
8
|
+
export declare function mergeCanvasItems(canvasId: string, config: Pick<FloorMapViewConfig, 'sceneElements' | 'elementKinds'>, defaultCellSize?: number): FloorMapMergedItem[];
|
|
@@ -0,0 +1,87 @@
|
|
|
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(_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 e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
/**
|
|
11
|
+
* 将当前画布的 sceneElements 合并为 Layout 使用的 FloorMapMergedItem[]
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { FLOOR_MAP_IMAGE_ELEMENT_KIND } from "../types";
|
|
15
|
+
import { getElementKindConfig } from "./floorMapElementKindUtils";
|
|
16
|
+
var DEFAULT_SIZE = 48;
|
|
17
|
+
var IMAGE_KIND_DEFAULT_SIZE = {
|
|
18
|
+
width: 400,
|
|
19
|
+
height: 240
|
|
20
|
+
};
|
|
21
|
+
function getDefaultSize(elementKind, elementKinds) {
|
|
22
|
+
if (!elementKind) return {
|
|
23
|
+
width: DEFAULT_SIZE,
|
|
24
|
+
height: DEFAULT_SIZE
|
|
25
|
+
};
|
|
26
|
+
if (elementKind === FLOOR_MAP_IMAGE_ELEMENT_KIND) {
|
|
27
|
+
return _objectSpread({}, IMAGE_KIND_DEFAULT_SIZE);
|
|
28
|
+
}
|
|
29
|
+
var found = elementKinds.find(function (k) {
|
|
30
|
+
return k.value === elementKind;
|
|
31
|
+
});
|
|
32
|
+
if (!found) return {
|
|
33
|
+
width: DEFAULT_SIZE,
|
|
34
|
+
height: DEFAULT_SIZE
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
width: DEFAULT_SIZE,
|
|
38
|
+
height: DEFAULT_SIZE
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 合并指定画布下的 sceneElements 为一份 items(用于 ItemLayer / EditableItemLayer)
|
|
44
|
+
*/
|
|
45
|
+
export function mergeCanvasItems(canvasId, config) {
|
|
46
|
+
var defaultCellSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_SIZE;
|
|
47
|
+
var _config$sceneElements = config.sceneElements,
|
|
48
|
+
sceneElements = _config$sceneElements === void 0 ? [] : _config$sceneElements,
|
|
49
|
+
_config$elementKinds = config.elementKinds,
|
|
50
|
+
elementKinds = _config$elementKinds === void 0 ? [] : _config$elementKinds;
|
|
51
|
+
var items = [];
|
|
52
|
+
var onCanvas = sceneElements.filter(function (el) {
|
|
53
|
+
return el.canvasId === canvasId;
|
|
54
|
+
});
|
|
55
|
+
var _iterator = _createForOfIteratorHelper(onCanvas),
|
|
56
|
+
_step;
|
|
57
|
+
try {
|
|
58
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
59
|
+
var _ref, _el$width, _ref2, _el$height, _el$shape;
|
|
60
|
+
var el = _step.value;
|
|
61
|
+
var size = getDefaultSize(el.elementKind, elementKinds);
|
|
62
|
+
var w = (_ref = (_el$width = el.width) !== null && _el$width !== void 0 ? _el$width : size.width) !== null && _ref !== void 0 ? _ref : defaultCellSize;
|
|
63
|
+
var h = (_ref2 = (_el$height = el.height) !== null && _el$height !== void 0 ? _el$height : size.height) !== null && _ref2 !== void 0 ? _ref2 : defaultCellSize;
|
|
64
|
+
var kindConfig = getElementKindConfig({
|
|
65
|
+
elementKinds: elementKinds
|
|
66
|
+
}, el.elementKind);
|
|
67
|
+
items.push({
|
|
68
|
+
id: el.instanceId,
|
|
69
|
+
instanceId: el.instanceId,
|
|
70
|
+
x: el.x,
|
|
71
|
+
y: el.y,
|
|
72
|
+
width: w,
|
|
73
|
+
height: h,
|
|
74
|
+
name: el.name,
|
|
75
|
+
zIndex: el.zIndex,
|
|
76
|
+
shape: (_el$shape = el.shape) !== null && _el$shape !== void 0 ? _el$shape : kindConfig === null || kindConfig === void 0 ? void 0 : kindConfig.defaultShape,
|
|
77
|
+
elementKind: el.elementKind,
|
|
78
|
+
_sceneElement: el
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
} catch (err) {
|
|
82
|
+
_iterator.e(err);
|
|
83
|
+
} finally {
|
|
84
|
+
_iterator.f();
|
|
85
|
+
}
|
|
86
|
+
return items;
|
|
87
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 平面图编辑态:侧栏图元拖拽到画布的 DataTransfer 与坐标
|
|
3
|
+
*/
|
|
4
|
+
/** 与 setData 一致,用于识别左侧图元栏发起的拖拽 */
|
|
5
|
+
export declare const FLOOR_MAP_PALETTE_DRAG_MIME = "application/x-pisell-floor-map-element";
|
|
6
|
+
export interface FloorMapPaletteDragPayload {
|
|
7
|
+
elementKind: string;
|
|
8
|
+
dataSourceKey?: string;
|
|
9
|
+
recordId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 与 {@link useFloorMapEditState} 落点一致:内容区 drop 的 offset 减去内容区 padding 偏移
|
|
13
|
+
*/
|
|
14
|
+
export declare function sceneXYFromContentDropOffset(offsetX: number, offsetY: number, contentOffset: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
/** 是否为左侧图元栏拖拽(非本地文件 / 外链图片) */
|
|
22
|
+
export declare function isFloorMapPaletteDrag(dt: DataTransfer | null): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 解析侧栏拖拽 payload;非法时返回 null
|
|
25
|
+
*/
|
|
26
|
+
export declare function parsePaletteDragPayload(dt: DataTransfer): FloorMapPaletteDragPayload | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
/**
|
|
3
|
+
* 平面图编辑态:侧栏图元拖拽到画布的 DataTransfer 与坐标
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** 与 setData 一致,用于识别左侧图元栏发起的拖拽 */
|
|
7
|
+
export var FLOOR_MAP_PALETTE_DRAG_MIME = 'application/x-pisell-floor-map-element';
|
|
8
|
+
/**
|
|
9
|
+
* 与 {@link useFloorMapEditState} 落点一致:内容区 drop 的 offset 减去内容区 padding 偏移
|
|
10
|
+
*/
|
|
11
|
+
export function sceneXYFromContentDropOffset(offsetX, offsetY, contentOffset) {
|
|
12
|
+
return {
|
|
13
|
+
x: Math.round(offsetX - contentOffset.x),
|
|
14
|
+
y: Math.round(offsetY - contentOffset.y)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 是否为左侧图元栏拖拽(非本地文件 / 外链图片) */
|
|
19
|
+
export function isFloorMapPaletteDrag(dt) {
|
|
20
|
+
var _dt$types;
|
|
21
|
+
if (!dt) return false;
|
|
22
|
+
return Array.from((_dt$types = dt.types) !== null && _dt$types !== void 0 ? _dt$types : []).includes(FLOOR_MAP_PALETTE_DRAG_MIME);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 解析侧栏拖拽 payload;非法时返回 null
|
|
27
|
+
*/
|
|
28
|
+
export function parsePaletteDragPayload(dt) {
|
|
29
|
+
try {
|
|
30
|
+
var raw = dt.getData(FLOOR_MAP_PALETTE_DRAG_MIME);
|
|
31
|
+
if (!raw) return null;
|
|
32
|
+
var o = JSON.parse(raw);
|
|
33
|
+
if (!o || _typeof(o) !== 'object') return null;
|
|
34
|
+
var rec = o;
|
|
35
|
+
var elementKind = rec.elementKind;
|
|
36
|
+
if (typeof elementKind !== 'string' || !elementKind) return null;
|
|
37
|
+
var dataSourceKey = typeof rec.dataSourceKey === 'string' ? rec.dataSourceKey : undefined;
|
|
38
|
+
var recordId = typeof rec.recordId === 'string' ? rec.recordId : undefined;
|
|
39
|
+
return {
|
|
40
|
+
elementKind: elementKind,
|
|
41
|
+
dataSourceKey: dataSourceKey,
|
|
42
|
+
recordId: recordId
|
|
43
|
+
};
|
|
44
|
+
} catch (_unused) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图元种类解析与绑定展示前校验(供合并项渲染、工具栏逻辑复用)
|
|
3
|
+
*/
|
|
4
|
+
import type { FloorMapElementKindConfig, FloorMapViewConfig, FloorMapSceneElement, FloorMapDataSources, FloorMapElementDataBindingPolicy } from '../types';
|
|
5
|
+
/** dataBindingPolicy 缺省视为 none */
|
|
6
|
+
export declare function resolveDataBindingPolicy(kind: FloorMapElementKindConfig | undefined): FloorMapElementDataBindingPolicy;
|
|
7
|
+
export declare function getElementKindConfig(config: Pick<FloorMapViewConfig, 'elementKinds'> | undefined, elementKind: string | undefined): FloorMapElementKindConfig | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* @returns 人类可读错误文案;无问题时返回 null
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSceneElementRenderIssue(element: FloorMapSceneElement, kind: FloorMapElementKindConfig | undefined, dataSources: FloorMapDataSources | undefined): string | null;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
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(_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 e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
|
+
/**
|
|
5
|
+
* 图元种类解析与绑定展示前校验(供合并项渲染、工具栏逻辑复用)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** dataBindingPolicy 缺省视为 none */
|
|
9
|
+
export function resolveDataBindingPolicy(kind) {
|
|
10
|
+
var _kind$dataBindingPoli;
|
|
11
|
+
return (_kind$dataBindingPoli = kind === null || kind === void 0 ? void 0 : kind.dataBindingPolicy) !== null && _kind$dataBindingPoli !== void 0 ? _kind$dataBindingPoli : 'none';
|
|
12
|
+
}
|
|
13
|
+
export function getElementKindConfig(config, elementKind) {
|
|
14
|
+
var _config$elementKinds;
|
|
15
|
+
if (!elementKind || !(config !== null && config !== void 0 && (_config$elementKinds = config.elementKinds) !== null && _config$elementKinds !== void 0 && _config$elementKinds.length)) return undefined;
|
|
16
|
+
return config.elementKinds.find(function (k) {
|
|
17
|
+
return k.value === elementKind;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @returns 人类可读错误文案;无问题时返回 null
|
|
23
|
+
*/
|
|
24
|
+
export function getSceneElementRenderIssue(element, kind, dataSources) {
|
|
25
|
+
var policy = resolveDataBindingPolicy(kind);
|
|
26
|
+
var binding = element.dataBinding;
|
|
27
|
+
if (policy === 'required' && !binding) {
|
|
28
|
+
return '该图元须绑定数据源行';
|
|
29
|
+
}
|
|
30
|
+
if (!binding) return null;
|
|
31
|
+
var keys = kind === null || kind === void 0 ? void 0 : kind.allowedDataSourceKeys;
|
|
32
|
+
if (keys !== null && keys !== void 0 && keys.length && !keys.includes(binding.dataSourceKey)) {
|
|
33
|
+
return "\u6570\u636E\u6E90\u300C".concat(binding.dataSourceKey, "\u300D\u4E0D\u5728\u8BE5\u56FE\u5143\u5141\u8BB8\u5217\u8868\u5185");
|
|
34
|
+
}
|
|
35
|
+
var rows = dataSources === null || dataSources === void 0 ? void 0 : dataSources[binding.dataSourceKey];
|
|
36
|
+
var rid = binding.recordId != null ? String(binding.recordId).trim() : '';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 未选行、new_ 占位、或列表中已无该行:不在这里拦截,
|
|
40
|
+
* 交给 renderItemByKind(方桌/圆桌/蘸料等)使用统一的浅底虚线占位,避免只有红字无卡片感。
|
|
41
|
+
*/
|
|
42
|
+
if (rid === '' || rid.startsWith('new_')) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
var row = rows === null || rows === void 0 ? void 0 : rows.find(function (r) {
|
|
46
|
+
return r.id === rid;
|
|
47
|
+
});
|
|
48
|
+
if (!row) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
var expected = kind === null || kind === void 0 ? void 0 : kind.expectedRecordFields;
|
|
52
|
+
if (expected !== null && expected !== void 0 && expected.length) {
|
|
53
|
+
var _iterator = _createForOfIteratorHelper(expected),
|
|
54
|
+
_step;
|
|
55
|
+
try {
|
|
56
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
57
|
+
var f = _step.value;
|
|
58
|
+
if (row[f] === undefined || row[f] === null || row[f] === '') {
|
|
59
|
+
return "\u6570\u636E\u884C\u7F3A\u5C11\u5FC5\u586B\u5B57\u6BB5\uFF1A".concat(f);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} catch (err) {
|
|
63
|
+
_iterator.e(err);
|
|
64
|
+
} finally {
|
|
65
|
+
_iterator.f();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 无 renderItemByKind 时的占位渲染(装饰、舞台等),避免画布上不显示
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { FloorMapMergedItem } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* @returns 与 PisellFloorMapLayout 内联 fallback 一致的渲染函数(useCallback 由调用方包裹)
|
|
8
|
+
*/
|
|
9
|
+
/** 绑定校验失败或 renderItemByKind 抛错时的占位 */
|
|
10
|
+
export declare function renderFloorMapRenderError(message: string): React.ReactNode;
|
|
11
|
+
export declare function renderFloorMapFallbackPlaceholder(item: FloorMapMergedItem): React.ReactNode;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 无 renderItemByKind 时的占位渲染(装饰、舞台等),避免画布上不显示
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { FLOOR_MAP_IMAGE_ELEMENT_KIND, FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types";
|
|
6
|
+
import { FloorMapImageElement } from "../components/FloorMapImageElement";
|
|
7
|
+
import { STAGE_DECO_DEFAULT } from "./floorMapStageDefaults";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @returns 与 PisellFloorMapLayout 内联 fallback 一致的渲染函数(useCallback 由调用方包裹)
|
|
11
|
+
*/
|
|
12
|
+
/** 绑定校验失败或 renderItemByKind 抛错时的占位 */
|
|
13
|
+
export function renderFloorMapRenderError(message) {
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
style: {
|
|
16
|
+
padding: 8,
|
|
17
|
+
fontSize: 12,
|
|
18
|
+
color: '#cf1322',
|
|
19
|
+
background: '#fff2f0',
|
|
20
|
+
border: '1px solid #ffccc7',
|
|
21
|
+
borderRadius: 4,
|
|
22
|
+
height: '100%',
|
|
23
|
+
boxSizing: 'border-box',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
textAlign: 'center',
|
|
28
|
+
wordBreak: 'break-word'
|
|
29
|
+
}
|
|
30
|
+
}, message);
|
|
31
|
+
}
|
|
32
|
+
export function renderFloorMapFallbackPlaceholder(item) {
|
|
33
|
+
var kind = (item === null || item === void 0 ? void 0 : item.elementKind) || 'item';
|
|
34
|
+
var isCircle = (item === null || item === void 0 ? void 0 : item.shape) === 'circle';
|
|
35
|
+
var isStage = kind === FLOOR_MAP_STAGE_ELEMENT_KIND;
|
|
36
|
+
var nameText = (item === null || item === void 0 ? void 0 : item.name) != null ? String(item.name).trim() : '';
|
|
37
|
+
var fallbackLabel = nameText || kind;
|
|
38
|
+
if (kind === FLOOR_MAP_IMAGE_ELEMENT_KIND) {
|
|
39
|
+
var _item$_sceneElement, _item$name, _item$_sceneElement2;
|
|
40
|
+
var url = (_item$_sceneElement = item._sceneElement) === null || _item$_sceneElement === void 0 ? void 0 : _item$_sceneElement.imageUrl;
|
|
41
|
+
return /*#__PURE__*/React.createElement(FloorMapImageElement, {
|
|
42
|
+
imageUrl: url,
|
|
43
|
+
name: (_item$name = item.name) !== null && _item$name !== void 0 ? _item$name : (_item$_sceneElement2 = item._sceneElement) === null || _item$_sceneElement2 === void 0 ? void 0 : _item$_sceneElement2.name
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (isStage) {
|
|
47
|
+
var display = nameText || STAGE_DECO_DEFAULT.name;
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
width: '100%',
|
|
51
|
+
height: '100%',
|
|
52
|
+
boxSizing: 'border-box',
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
padding: 8,
|
|
57
|
+
background: 'linear-gradient(180deg, #fafafa 0%, #ececec 100%)',
|
|
58
|
+
border: '2px dashed #595959',
|
|
59
|
+
borderRadius: 8,
|
|
60
|
+
fontSize: 15,
|
|
61
|
+
fontWeight: 600,
|
|
62
|
+
color: '#262626',
|
|
63
|
+
textAlign: 'center',
|
|
64
|
+
wordBreak: 'break-word',
|
|
65
|
+
lineHeight: 1.35,
|
|
66
|
+
overflow: 'hidden'
|
|
67
|
+
}
|
|
68
|
+
}, display);
|
|
69
|
+
}
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
style: {
|
|
72
|
+
width: '100%',
|
|
73
|
+
height: '100%',
|
|
74
|
+
display: 'flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
background: '#f0f0f0',
|
|
78
|
+
border: '1px solid #d9d9d9',
|
|
79
|
+
borderRadius: isCircle ? '50%' : 4,
|
|
80
|
+
fontSize: 12,
|
|
81
|
+
color: '#666',
|
|
82
|
+
overflow: 'hidden',
|
|
83
|
+
padding: 4,
|
|
84
|
+
textAlign: 'center',
|
|
85
|
+
wordBreak: 'break-word'
|
|
86
|
+
}
|
|
87
|
+
}, fallbackLabel);
|
|
88
|
+
}
|