@pisell/materials 6.11.17 → 6.11.18
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/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 +32 -32
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +25 -25
- package/es/components/PisellLayouts/index.d.ts +10 -5
- package/es/components/PisellLayouts/index.js +8 -4
- package/es/components/dataSourceComponents/dataSourceSubForm/index.d.ts +13 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/index.js +274 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/index.less +19 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +544 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/schema-simple-example.json +174 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/types.d.ts +117 -0
- package/es/components/dataSourceComponents/dataSourceSubForm/types.js +1 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.js +61 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +176 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +12 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.js +11 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts +87 -0
- package/es/components/dataSourceComponents/fields/RecordListWrapper/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Tabs/ReadPretty.d.ts +9 -0
- package/es/components/dataSourceComponents/fields/Tabs/ReadPretty.js +16 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.d.ts +23 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.js +93 -0
- package/es/components/dataSourceComponents/fields/Tabs/Tabs.less +64 -0
- package/es/components/dataSourceComponents/fields/Tabs/WithMode.d.ts +6 -0
- package/es/components/dataSourceComponents/fields/Tabs/WithMode.js +9 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +12 -0
- package/es/components/dataSourceComponents/fields/Tabs/index.js +18 -0
- package/es/components/dataSourceComponents/fields/Tabs/type.d.ts +38 -0
- package/es/components/dataSourceComponents/fields/Tabs/type.js +1 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +39 -1
- package/es/components/dataSourceComponents/fields/index.js +5 -1
- package/es/components/dataSourceComponents/fields/utils.js +3 -0
- package/es/components/pisellFilter/type.d.ts +4 -2
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +12 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +611 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.less +92 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +55 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +1667 -0
- package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -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 +43 -0
- package/es/components/pisellFloorMapLayout/components/FigmaTableCard.js +432 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.d.ts +21 -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 +14 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +543 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +162 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +36 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.js +135 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.less +149 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +9 -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 +366 -0
- package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +239 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +48 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.js +195 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.less +19 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.d.ts +27 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.js +85 -0
- package/es/components/pisellFloorMapLayout/components/MapLayer.less +7 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +33 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.js +88 -0
- package/es/components/pisellFloorMapLayout/components/ViewControls.less +101 -0
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +16 -0
- package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +29 -0
- package/es/components/pisellFloorMapLayout/components/index.d.ts +21 -0
- package/es/components/pisellFloorMapLayout/components/index.js +13 -0
- 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 +63 -0
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +561 -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 +399 -0
- package/es/components/pisellFloorMapLayout/index.d.ts +15 -0
- package/es/components/pisellFloorMapLayout/index.js +12 -0
- package/es/components/pisellFloorMapLayout/locales.d.ts +192 -0
- package/es/components/pisellFloorMapLayout/locales.js +191 -0
- package/es/components/pisellFloorMapLayout/types.d.ts +586 -0
- package/es/components/pisellFloorMapLayout/types.js +152 -0
- 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/floorMapDataRecordLabel.d.ts +9 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapDataRecordLabel.js +24 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +27 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +56 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +22 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +155 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +89 -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/pisellRecordBoard/PisellRecordBoard.d.ts +2 -1
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +98 -18
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +4 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +1276 -344
- package/es/components/pisellRecordBoard/index.d.ts +8 -2
- package/es/components/pisellRecordBoard/index.js +4 -2
- 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 +61 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +1 -0
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +69 -11
- package/es/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +23 -0
- package/es/components/pisellRecordBoard/shellFrame/index.d.ts +6 -10
- package/es/components/pisellRecordBoard/shellFrame/index.js +111 -20
- package/es/components/pisellRecordBoard/shellFrame/shellFrameFloorMap.less +25 -0
- package/es/components/pisellRecordBoard/types.d.ts +68 -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 +94 -0
- package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +66 -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 +49 -0
- package/es/components/pisellReservationScheduleBand/types.js +1 -0
- package/es/components/pisellShellFrame/PisellShellFrame.less +11 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +787 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.less +461 -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 +25 -0
- package/es/components/pisellTimeNavigator/components/CursorLayer.js +77 -0
- package/es/components/pisellTimeNavigator/components/GestureLayer.d.ts +33 -0
- package/es/components/pisellTimeNavigator/components/GestureLayer.js +91 -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 +22 -0
- package/es/components/pisellTimeNavigator/components/ScaleLayer.js +73 -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 +5 -0
- package/es/components/pisellTimeNavigator/index.js +4 -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 +160 -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/components/pisellWalletPassCard/index.js +1 -1
- package/es/components/table/index.js +1 -1
- package/es/index.d.ts +49 -33
- package/es/index.js +47 -27
- package/es/locales/en-US.d.ts +2 -0
- package/es/locales/en-US.js +2 -0
- package/es/locales/zh-CN.d.ts +2 -0
- package/es/locales/zh-CN.js +2 -0
- package/es/locales/zh-TW.d.ts +2 -0
- package/es/locales/zh-TW.js +2 -0
- package/lib/components/PisellLayouts/index.d.ts +10 -5
- package/lib/components/PisellLayouts/index.js +15 -1
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.d.ts +13 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.js +229 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/index.less +19 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-full-example.json +544 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/schema-simple-example.json +174 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/types.d.ts +117 -0
- package/lib/components/dataSourceComponents/dataSourceSubForm/types.js +17 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/ReadPretty.js +64 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/WithMode.js +157 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +12 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/type.d.ts +87 -0
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Tabs/ReadPretty.d.ts +9 -0
- package/lib/components/dataSourceComponents/fields/Tabs/ReadPretty.js +45 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.d.ts +23 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.js +95 -0
- package/lib/components/dataSourceComponents/fields/Tabs/Tabs.less +64 -0
- package/lib/components/dataSourceComponents/fields/Tabs/WithMode.d.ts +6 -0
- package/lib/components/dataSourceComponents/fields/Tabs/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +12 -0
- package/lib/components/dataSourceComponents/fields/Tabs/index.js +40 -0
- package/lib/components/dataSourceComponents/fields/Tabs/type.d.ts +38 -0
- package/lib/components/dataSourceComponents/fields/Tabs/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +39 -1
- package/lib/components/dataSourceComponents/fields/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/utils.js +3 -0
- package/lib/components/pisellFilter/type.d.ts +4 -2
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +12 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +709 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.less +92 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +55 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +1353 -0
- package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +27 -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 +43 -0
- package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.js +482 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.d.ts +21 -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 +14 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +556 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +162 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +36 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.js +195 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.less +149 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +9 -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 +337 -0
- package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +239 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +48 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.js +219 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.less +19 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.d.ts +27 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.js +110 -0
- package/lib/components/pisellFloorMapLayout/components/MapLayer.less +7 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +33 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.js +121 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControls.less +101 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +16 -0
- package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +65 -0
- package/lib/components/pisellFloorMapLayout/components/index.d.ts +21 -0
- package/lib/components/pisellFloorMapLayout/components/index.js +56 -0
- 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 +63 -0
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +545 -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 +382 -0
- package/lib/components/pisellFloorMapLayout/index.d.ts +15 -0
- package/lib/components/pisellFloorMapLayout/index.js +64 -0
- package/lib/components/pisellFloorMapLayout/locales.d.ts +192 -0
- package/lib/components/pisellFloorMapLayout/locales.js +212 -0
- package/lib/components/pisellFloorMapLayout/types.d.ts +586 -0
- package/lib/components/pisellFloorMapLayout/types.js +32 -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/floorMapDataRecordLabel.d.ts +9 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapDataRecordLabel.js +44 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +27 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +67 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +22 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +139 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
- package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +136 -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 +185 -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 +49 -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 +86 -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 +8 -2
- package/lib/components/pisellRecordBoard/index.js +6 -2
- 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 +61 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +1 -0
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +60 -8
- package/lib/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +23 -0
- package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +6 -10
- package/lib/components/pisellRecordBoard/shellFrame/index.js +101 -9
- package/lib/components/pisellRecordBoard/shellFrame/shellFrameFloorMap.less +25 -0
- package/lib/components/pisellRecordBoard/types.d.ts +68 -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 +128 -0
- package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +66 -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 +49 -0
- package/lib/components/pisellReservationScheduleBand/types.js +17 -0
- package/lib/components/pisellShellFrame/PisellShellFrame.less +11 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +901 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.less +461 -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 +78 -0
- package/lib/components/pisellTimeNavigator/components/CursorLayer.d.ts +25 -0
- package/lib/components/pisellTimeNavigator/components/CursorLayer.js +111 -0
- package/lib/components/pisellTimeNavigator/components/GestureLayer.d.ts +33 -0
- package/lib/components/pisellTimeNavigator/components/GestureLayer.js +170 -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 +22 -0
- package/lib/components/pisellTimeNavigator/components/ScaleLayer.js +116 -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 +87 -0
- package/lib/components/pisellTimeNavigator/index.d.ts +5 -0
- package/lib/components/pisellTimeNavigator/index.js +47 -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 +160 -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/components/pisellWalletPassCard/index.js +1 -1
- package/lib/components/table/index.js +2 -2
- package/lib/index.d.ts +49 -33
- package/lib/index.js +93 -27
- 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/data-source-form/constants.ts +3 -0
- package/lowcode/data-source-form/utils.ts +31 -5
- package/lowcode/data-source-sub-form/meta.ts +259 -0
- package/lowcode/data-source-sub-form/snippets.ts +21 -0
- package/lowcode/floor-map-image-element/meta.ts +113 -0
- package/lowcode/floor-map-layout-provider/meta.ts +65 -0
- package/lowcode/form-item-record-list-wrapper/meta.ts +180 -0
- package/lowcode/form-item-record-list-wrapper/snippets.ts +18 -0
- package/lowcode/form-item-tabs/meta.ts +172 -0
- package/lowcode/pisell-floor-map-layout/meta.ts +5599 -0
- package/lowcode/pisell-hierarchical-summary-list/meta.ts +240 -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 -2
|
@@ -0,0 +1,155 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
8
|
+
/**
|
|
9
|
+
* 图元种类解析与绑定展示前校验(供合并项渲染、工具栏逻辑复用)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { FLOOR_MAP_IMAGE_ELEMENT_KIND, FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types";
|
|
13
|
+
import { STAGE_DECO_DEFAULT } from "./floorMapStageDefaults";
|
|
14
|
+
|
|
15
|
+
/** 与 RecordBoard Story 一致:`floorMapImage` */
|
|
16
|
+
export function isFloorMapImageElementKind(kind) {
|
|
17
|
+
return kind === FLOOR_MAP_IMAGE_ELEMENT_KIND;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** dataBindingPolicy 缺省视为 none */
|
|
21
|
+
export function resolveDataBindingPolicy(kind) {
|
|
22
|
+
var _kind$dataBindingPoli;
|
|
23
|
+
return (_kind$dataBindingPoli = kind === null || kind === void 0 ? void 0 : kind.dataBindingPolicy) !== null && _kind$dataBindingPoli !== void 0 ? _kind$dataBindingPoli : 'none';
|
|
24
|
+
}
|
|
25
|
+
export function getElementKindConfig(config, elementKind) {
|
|
26
|
+
var _config$elementKinds;
|
|
27
|
+
if (!elementKind || !(config !== null && config !== void 0 && (_config$elementKinds = config.elementKinds) !== null && _config$elementKinds !== void 0 && _config$elementKinds.length)) return undefined;
|
|
28
|
+
return config.elementKinds.find(function (k) {
|
|
29
|
+
return k.value === elementKind;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 与调色板分组一致:取与当前图元 **同一 categoryId**(含未填 categoryId 时落到首个分类)下的可切换种类,
|
|
35
|
+
* 排除舞台、底图。若仅有一种则编辑面板可不展示切换器。
|
|
36
|
+
*/
|
|
37
|
+
export function getSwappableElementKindsInSameCategory(config, elementKind) {
|
|
38
|
+
var _config$elementKinds2, _config$elementKindCa, _sorted$0$id, _sorted$, _self$categoryId;
|
|
39
|
+
if (!elementKind || !((_config$elementKinds2 = config.elementKinds) !== null && _config$elementKinds2 !== void 0 && _config$elementKinds2.length)) return [];
|
|
40
|
+
var rawCats = (_config$elementKindCa = config.elementKindCategories) !== null && _config$elementKindCa !== void 0 ? _config$elementKindCa : [];
|
|
41
|
+
var sorted = _toConsumableArray(rawCats).sort(function (a, b) {
|
|
42
|
+
var _a$order, _b$order;
|
|
43
|
+
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);
|
|
44
|
+
});
|
|
45
|
+
var fallbackId = (_sorted$0$id = (_sorted$ = sorted[0]) === null || _sorted$ === void 0 ? void 0 : _sorted$.id) !== null && _sorted$0$id !== void 0 ? _sorted$0$id : '_uncat';
|
|
46
|
+
var self = config.elementKinds.find(function (k) {
|
|
47
|
+
return k.value === elementKind;
|
|
48
|
+
});
|
|
49
|
+
if (!self) return [];
|
|
50
|
+
var cid = (_self$categoryId = self.categoryId) !== null && _self$categoryId !== void 0 ? _self$categoryId : fallbackId;
|
|
51
|
+
return config.elementKinds.filter(function (k) {
|
|
52
|
+
var _k$categoryId;
|
|
53
|
+
if (k.showInPalette === false) return false;
|
|
54
|
+
if (k.value === FLOOR_MAP_STAGE_ELEMENT_KIND) return false;
|
|
55
|
+
if (k.value === FLOOR_MAP_IMAGE_ELEMENT_KIND) return false;
|
|
56
|
+
return ((_k$categoryId = k.categoryId) !== null && _k$categoryId !== void 0 ? _k$categoryId : fallbackId) === cid;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
var DEFAULT_PLACE_W = 180;
|
|
60
|
+
var DEFAULT_PLACE_H = 120;
|
|
61
|
+
var IMAGE_PLACE_W = 400;
|
|
62
|
+
var IMAGE_PLACE_H = 240;
|
|
63
|
+
var DECO_SIZE = 48;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 在右侧编辑面板将图元改为同分类下的另一种 kind 时的草稿 patch(绑定不兼容则清空)
|
|
67
|
+
*/
|
|
68
|
+
export function patchSceneElementForKindSwitch(config, element, nextKindValue) {
|
|
69
|
+
var _nextCfg$allowedDataS, _element$width, _element$width2, _element$height, _element$height2, _nextCfg$defaultPrese;
|
|
70
|
+
var nextCfg = getElementKindConfig(config, nextKindValue);
|
|
71
|
+
var nextPol = resolveDataBindingPolicy(nextCfg);
|
|
72
|
+
var binding = element.dataBinding;
|
|
73
|
+
var isNextImage = isFloorMapImageElementKind(nextKindValue);
|
|
74
|
+
var isNextStage = nextKindValue === FLOOR_MAP_STAGE_ELEMENT_KIND;
|
|
75
|
+
var clearBinding = false;
|
|
76
|
+
if (nextPol === 'none') {
|
|
77
|
+
clearBinding = true;
|
|
78
|
+
} else if (binding && nextCfg !== null && nextCfg !== void 0 && (_nextCfg$allowedDataS = nextCfg.allowedDataSourceKeys) !== null && _nextCfg$allowedDataS !== void 0 && _nextCfg$allowedDataS.length) {
|
|
79
|
+
if (!nextCfg.allowedDataSourceKeys.includes(binding.dataSourceKey)) {
|
|
80
|
+
clearBinding = true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
var nextW = isNextImage ? IMAGE_PLACE_W : isNextStage ? STAGE_DECO_DEFAULT.width : DEFAULT_PLACE_W;
|
|
84
|
+
var nextH = isNextImage ? IMAGE_PLACE_H : isNextStage ? STAGE_DECO_DEFAULT.height : DEFAULT_PLACE_H;
|
|
85
|
+
var useDecoSize = nextPol === 'none' && nextKindValue !== FLOOR_MAP_STAGE_ELEMENT_KIND && !isNextImage;
|
|
86
|
+
var width = useDecoSize ? Math.max((_element$width = element.width) !== null && _element$width !== void 0 ? _element$width : DECO_SIZE, DECO_SIZE) : Math.max((_element$width2 = element.width) !== null && _element$width2 !== void 0 ? _element$width2 : nextW, nextW);
|
|
87
|
+
var height = useDecoSize ? Math.max((_element$height = element.height) !== null && _element$height !== void 0 ? _element$height : DECO_SIZE, DECO_SIZE) : Math.max((_element$height2 = element.height) !== null && _element$height2 !== void 0 ? _element$height2 : nextH, nextH);
|
|
88
|
+
var patch = {
|
|
89
|
+
elementKind: nextKindValue,
|
|
90
|
+
shape: isNextStage || isNextImage ? 'rect' : nextCfg === null || nextCfg === void 0 ? void 0 : nextCfg.defaultShape,
|
|
91
|
+
width: width,
|
|
92
|
+
height: height,
|
|
93
|
+
name: (nextCfg === null || nextCfg === void 0 || (_nextCfg$defaultPrese = nextCfg.defaultPresentation) === null || _nextCfg$defaultPrese === void 0 ? void 0 : _nextCfg$defaultPrese.title) != null && String(nextCfg.defaultPresentation.title).trim() !== '' ? String(nextCfg.defaultPresentation.title) : element.name
|
|
94
|
+
};
|
|
95
|
+
if (clearBinding) {
|
|
96
|
+
patch.dataBinding = undefined;
|
|
97
|
+
}
|
|
98
|
+
if (isNextImage) {
|
|
99
|
+
var _element$imageUrl;
|
|
100
|
+
patch.imageUrl = (_element$imageUrl = element.imageUrl) !== null && _element$imageUrl !== void 0 ? _element$imageUrl : '';
|
|
101
|
+
} else {
|
|
102
|
+
patch.imageUrl = undefined;
|
|
103
|
+
}
|
|
104
|
+
return patch;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @returns 人类可读错误文案;无问题时返回 null
|
|
109
|
+
*/
|
|
110
|
+
export function getSceneElementRenderIssue(element, kind, dataSources) {
|
|
111
|
+
var policy = resolveDataBindingPolicy(kind);
|
|
112
|
+
var binding = element.dataBinding;
|
|
113
|
+
if (policy === 'required' && !binding) {
|
|
114
|
+
return '该图元须绑定数据源行';
|
|
115
|
+
}
|
|
116
|
+
if (!binding) return null;
|
|
117
|
+
var keys = kind === null || kind === void 0 ? void 0 : kind.allowedDataSourceKeys;
|
|
118
|
+
if (keys !== null && keys !== void 0 && keys.length && !keys.includes(binding.dataSourceKey)) {
|
|
119
|
+
return "\u6570\u636E\u6E90\u300C".concat(binding.dataSourceKey, "\u300D\u4E0D\u5728\u8BE5\u56FE\u5143\u5141\u8BB8\u5217\u8868\u5185");
|
|
120
|
+
}
|
|
121
|
+
var rows = dataSources === null || dataSources === void 0 ? void 0 : dataSources[binding.dataSourceKey];
|
|
122
|
+
var rid = binding.recordId != null ? String(binding.recordId).trim() : '';
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 未选行、new_ 占位、或列表中已无该行:不在这里拦截,
|
|
126
|
+
* 交给 renderItemByKind(方桌/圆桌/蘸料等)使用统一的浅底虚线占位,避免只有红字无卡片感。
|
|
127
|
+
*/
|
|
128
|
+
if (rid === '' || rid.startsWith('new_')) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
var row = rows === null || rows === void 0 ? void 0 : rows.find(function (r) {
|
|
132
|
+
return r.id === rid;
|
|
133
|
+
});
|
|
134
|
+
if (!row) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
var expected = kind === null || kind === void 0 ? void 0 : kind.expectedRecordFields;
|
|
138
|
+
if (expected !== null && expected !== void 0 && expected.length) {
|
|
139
|
+
var _iterator = _createForOfIteratorHelper(expected),
|
|
140
|
+
_step;
|
|
141
|
+
try {
|
|
142
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
143
|
+
var f = _step.value;
|
|
144
|
+
if (row[f] === undefined || row[f] === null || row[f] === '') {
|
|
145
|
+
return "\u6570\u636E\u884C\u7F3A\u5C11\u5FC5\u586B\u5B57\u6BB5\uFF1A".concat(f);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
} catch (err) {
|
|
149
|
+
_iterator.e(err);
|
|
150
|
+
} finally {
|
|
151
|
+
_iterator.f();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
@@ -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,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 无 renderItemByKind 时的占位渲染(装饰、舞台等),避免画布上不显示
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types";
|
|
6
|
+
import { isFloorMapImageElementKind } from "./floorMapElementKindUtils";
|
|
7
|
+
import { FloorMapImageElement } from "../components/FloorMapImageElement";
|
|
8
|
+
import { STAGE_DECO_DEFAULT } from "./floorMapStageDefaults";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @returns 与 PisellFloorMapLayout 内联 fallback 一致的渲染函数(useCallback 由调用方包裹)
|
|
12
|
+
*/
|
|
13
|
+
/** 绑定校验失败或 renderItemByKind 抛错时的占位 */
|
|
14
|
+
export function renderFloorMapRenderError(message) {
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
style: {
|
|
17
|
+
padding: 8,
|
|
18
|
+
fontSize: 12,
|
|
19
|
+
color: '#cf1322',
|
|
20
|
+
background: '#fff2f0',
|
|
21
|
+
border: '1px solid #ffccc7',
|
|
22
|
+
borderRadius: 4,
|
|
23
|
+
height: '100%',
|
|
24
|
+
boxSizing: 'border-box',
|
|
25
|
+
display: 'flex',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
textAlign: 'center',
|
|
29
|
+
wordBreak: 'break-word'
|
|
30
|
+
}
|
|
31
|
+
}, message);
|
|
32
|
+
}
|
|
33
|
+
export function renderFloorMapFallbackPlaceholder(item) {
|
|
34
|
+
var kind = (item === null || item === void 0 ? void 0 : item.elementKind) || 'item';
|
|
35
|
+
var isCircle = (item === null || item === void 0 ? void 0 : item.shape) === 'circle';
|
|
36
|
+
var isStage = kind === FLOOR_MAP_STAGE_ELEMENT_KIND;
|
|
37
|
+
var nameText = (item === null || item === void 0 ? void 0 : item.name) != null ? String(item.name).trim() : '';
|
|
38
|
+
var fallbackLabel = nameText || kind;
|
|
39
|
+
if (isFloorMapImageElementKind(kind)) {
|
|
40
|
+
var _item$_sceneElement, _item$name, _item$_sceneElement2;
|
|
41
|
+
var url = (_item$_sceneElement = item._sceneElement) === null || _item$_sceneElement === void 0 ? void 0 : _item$_sceneElement.imageUrl;
|
|
42
|
+
return /*#__PURE__*/React.createElement(FloorMapImageElement, {
|
|
43
|
+
imageUrl: url,
|
|
44
|
+
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
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (isStage) {
|
|
48
|
+
var display = nameText || STAGE_DECO_DEFAULT.name;
|
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
style: {
|
|
51
|
+
width: '100%',
|
|
52
|
+
height: '100%',
|
|
53
|
+
boxSizing: 'border-box',
|
|
54
|
+
display: 'flex',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
padding: 8,
|
|
58
|
+
background: 'linear-gradient(180deg, #fafafa 0%, #ececec 100%)',
|
|
59
|
+
border: '2px dashed #595959',
|
|
60
|
+
borderRadius: 8,
|
|
61
|
+
fontSize: 15,
|
|
62
|
+
fontWeight: 600,
|
|
63
|
+
color: '#262626',
|
|
64
|
+
textAlign: 'center',
|
|
65
|
+
wordBreak: 'break-word',
|
|
66
|
+
lineHeight: 1.35,
|
|
67
|
+
overflow: 'hidden'
|
|
68
|
+
}
|
|
69
|
+
}, display);
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
style: {
|
|
73
|
+
width: '100%',
|
|
74
|
+
height: '100%',
|
|
75
|
+
display: 'flex',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
justifyContent: 'center',
|
|
78
|
+
background: '#f0f0f0',
|
|
79
|
+
border: '1px solid #d9d9d9',
|
|
80
|
+
borderRadius: isCircle ? '50%' : 4,
|
|
81
|
+
fontSize: 12,
|
|
82
|
+
color: '#666',
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
padding: 4,
|
|
85
|
+
textAlign: 'center',
|
|
86
|
+
wordBreak: 'break-word'
|
|
87
|
+
}
|
|
88
|
+
}, fallbackLabel);
|
|
89
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FloorMapViewConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 与 {@link useFloorMapEditState} 中 `useEffect` 逻辑一致:补全 `canvasUi`、空 `elementKinds` 时的默认调色板、`sceneElements`。
|
|
4
|
+
* 用于从上游 prop 得到「可与当前 draft 公平比较」的基准配置。
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeFloorMapViewConfigFromProp(floorMapConfigProp: FloorMapViewConfig): FloorMapViewConfig;
|
|
7
|
+
/** 判断当前编辑草稿是否与基准配置一致(数组顺序无关) */
|
|
8
|
+
export declare function floorMapViewConfigsEqual(a: FloorMapViewConfig, b: FloorMapViewConfig): boolean;
|
|
@@ -0,0 +1,108 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
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); }
|
|
13
|
+
/**
|
|
14
|
+
* 平面图 FloorMapViewConfig:与 props 同步时的规范化、以及草稿与持久化配置是否一致的比较
|
|
15
|
+
*/
|
|
16
|
+
import isEqual from 'lodash/isEqual';
|
|
17
|
+
import { FLOOR_MAP_IMAGE_ELEMENT_KIND, FLOOR_MAP_STAGE_ELEMENT_KIND } from "../types";
|
|
18
|
+
/**
|
|
19
|
+
* 与 {@link useFloorMapEditState} 中 `useEffect` 逻辑一致:补全 `canvasUi`、空 `elementKinds` 时的默认调色板、`sceneElements`。
|
|
20
|
+
* 用于从上游 prop 得到「可与当前 draft 公平比较」的基准配置。
|
|
21
|
+
*/
|
|
22
|
+
export function normalizeFloorMapViewConfigFromProp(floorMapConfigProp) {
|
|
23
|
+
var _src$canCreate, _src$canEdit;
|
|
24
|
+
var src = floorMapConfigProp;
|
|
25
|
+
var base = src.canvasUi != null ? structuredClone(src) : structuredClone(_objectSpread(_objectSpread({}, src), {}, {
|
|
26
|
+
canvasUi: {
|
|
27
|
+
canCreate: (_src$canCreate = src.canCreate) !== null && _src$canCreate !== void 0 ? _src$canCreate : false,
|
|
28
|
+
canEdit: (_src$canEdit = src.canEdit) !== null && _src$canEdit !== void 0 ? _src$canEdit : false
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
if (base.canvasUi.canCreate && (!base.elementKinds || base.elementKinds.length === 0)) {
|
|
32
|
+
base.elementKindCategories = [{
|
|
33
|
+
id: 'furniture',
|
|
34
|
+
label: '桌椅设施',
|
|
35
|
+
order: 0
|
|
36
|
+
}, {
|
|
37
|
+
id: 'decoration',
|
|
38
|
+
label: '装饰与区域',
|
|
39
|
+
order: 1
|
|
40
|
+
}];
|
|
41
|
+
base.elementKinds = [{
|
|
42
|
+
value: 'table',
|
|
43
|
+
label: '方桌',
|
|
44
|
+
categoryId: 'furniture',
|
|
45
|
+
dataBindingPolicy: 'optional',
|
|
46
|
+
allowedDataSourceKeys: ['sales'],
|
|
47
|
+
showInPalette: true
|
|
48
|
+
}, {
|
|
49
|
+
value: 'marker',
|
|
50
|
+
label: '标记',
|
|
51
|
+
categoryId: 'decoration',
|
|
52
|
+
dataBindingPolicy: 'none',
|
|
53
|
+
showInPalette: true
|
|
54
|
+
}, {
|
|
55
|
+
value: FLOOR_MAP_STAGE_ELEMENT_KIND,
|
|
56
|
+
label: '舞台/区域',
|
|
57
|
+
categoryId: 'decoration',
|
|
58
|
+
dataBindingPolicy: 'none',
|
|
59
|
+
showInPalette: true
|
|
60
|
+
}, {
|
|
61
|
+
value: FLOOR_MAP_IMAGE_ELEMENT_KIND,
|
|
62
|
+
label: '图片(底图)',
|
|
63
|
+
categoryId: 'decoration',
|
|
64
|
+
dataBindingPolicy: 'none',
|
|
65
|
+
showInPalette: true
|
|
66
|
+
}, {
|
|
67
|
+
value: 'icon',
|
|
68
|
+
label: '图标',
|
|
69
|
+
categoryId: 'decoration',
|
|
70
|
+
dataBindingPolicy: 'none',
|
|
71
|
+
defaultShape: 'circle',
|
|
72
|
+
showInPalette: true
|
|
73
|
+
}];
|
|
74
|
+
}
|
|
75
|
+
if (!base.sceneElements) base.sceneElements = [];
|
|
76
|
+
return base;
|
|
77
|
+
}
|
|
78
|
+
function sortStableForCompare(config) {
|
|
79
|
+
var _c$sceneElements, _c$elementKinds, _c$elementKindCategor, _c$edges;
|
|
80
|
+
var c = structuredClone(config);
|
|
81
|
+
c.canvases = _toConsumableArray(c.canvases).sort(function (a, b) {
|
|
82
|
+
return String(a.id).localeCompare(String(b.id));
|
|
83
|
+
});
|
|
84
|
+
c.sceneElements = _toConsumableArray((_c$sceneElements = c.sceneElements) !== null && _c$sceneElements !== void 0 ? _c$sceneElements : []).sort(function (a, b) {
|
|
85
|
+
return String(a.instanceId).localeCompare(String(b.instanceId));
|
|
86
|
+
});
|
|
87
|
+
if ((_c$elementKinds = c.elementKinds) !== null && _c$elementKinds !== void 0 && _c$elementKinds.length) {
|
|
88
|
+
c.elementKinds = _toConsumableArray(c.elementKinds).sort(function (a, b) {
|
|
89
|
+
return String(a.value).localeCompare(String(b.value));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if ((_c$elementKindCategor = c.elementKindCategories) !== null && _c$elementKindCategor !== void 0 && _c$elementKindCategor.length) {
|
|
93
|
+
c.elementKindCategories = _toConsumableArray(c.elementKindCategories).sort(function (a, b) {
|
|
94
|
+
return String(a.id).localeCompare(String(b.id));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if ((_c$edges = c.edges) !== null && _c$edges !== void 0 && _c$edges.length) {
|
|
98
|
+
c.edges = _toConsumableArray(c.edges).sort(function (a, b) {
|
|
99
|
+
return String(a.id).localeCompare(String(b.id));
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return c;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** 判断当前编辑草稿是否与基准配置一致(数组顺序无关) */
|
|
106
|
+
export function floorMapViewConfigsEqual(a, b) {
|
|
107
|
+
return isEqual(sortStableForCompare(a), sortStableForCompare(b));
|
|
108
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 平面图/布局内容区尺寸计算:格子与像素单位、gap 解析、包围盒
|
|
3
|
+
*/
|
|
4
|
+
import type { FloorMapItemBase, FloorMapItemUnit } from '../types';
|
|
5
|
+
/** 默认每格像素 */
|
|
6
|
+
export declare const DEFAULT_CELL_SIZE = 64;
|
|
7
|
+
/** 默认 item 间距(像素) */
|
|
8
|
+
export declare const DEFAULT_ITEM_GAP = 8;
|
|
9
|
+
/**
|
|
10
|
+
* 将 mapLayer.gap 解析为像素数
|
|
11
|
+
*/
|
|
12
|
+
export declare function gapToPx(gap: number | string | undefined): number;
|
|
13
|
+
/**
|
|
14
|
+
* 根据 items 计算内容区像素宽高
|
|
15
|
+
* - cell:按格子数 + cellSize + itemGap 计算
|
|
16
|
+
* - pixel:按 item 的 x/y/width/height 像素取边界(仅右/下边界,用于非 floor map 或兼容)
|
|
17
|
+
*/
|
|
18
|
+
export declare function getContentSize<T extends FloorMapItemBase>(items: T[], cellSize: number, itemGap: number, itemUnit: FloorMapItemUnit): {
|
|
19
|
+
contentWidth: number;
|
|
20
|
+
contentHeight: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* pixel 模式下取 items 包围盒(含左/上),用于画布四周扩 padding 时的尺寸与偏移
|
|
24
|
+
*/
|
|
25
|
+
export declare function getPixelBoundingBox<T extends FloorMapItemBase>(items: T[], cellSize: number): {
|
|
26
|
+
minLeft: number;
|
|
27
|
+
minTop: number;
|
|
28
|
+
maxRight: number;
|
|
29
|
+
maxBottom: number;
|
|
30
|
+
} | null;
|
|
@@ -0,0 +1,125 @@
|
|
|
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
|
+
* 平面图/布局内容区尺寸计算:格子与像素单位、gap 解析、包围盒
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** 默认每格像素 */
|
|
9
|
+
export var DEFAULT_CELL_SIZE = 64;
|
|
10
|
+
|
|
11
|
+
/** 默认 item 间距(像素) */
|
|
12
|
+
export var DEFAULT_ITEM_GAP = 8;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 将 mapLayer.gap 解析为像素数
|
|
16
|
+
*/
|
|
17
|
+
export function gapToPx(gap) {
|
|
18
|
+
if (gap === undefined) return DEFAULT_ITEM_GAP;
|
|
19
|
+
if (typeof gap === 'number') return gap;
|
|
20
|
+
var match = String(gap).match(/^(\d+(?:\.\d+)?)\s*px?$/i);
|
|
21
|
+
return match ? Number(match[1]) : DEFAULT_ITEM_GAP;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 根据 items 计算内容区像素宽高
|
|
26
|
+
* - cell:按格子数 + cellSize + itemGap 计算
|
|
27
|
+
* - pixel:按 item 的 x/y/width/height 像素取边界(仅右/下边界,用于非 floor map 或兼容)
|
|
28
|
+
*/
|
|
29
|
+
export function getContentSize(items, cellSize, itemGap, itemUnit) {
|
|
30
|
+
if (!items.length) {
|
|
31
|
+
if (itemUnit === 'pixel') {
|
|
32
|
+
return {
|
|
33
|
+
contentWidth: cellSize * 4,
|
|
34
|
+
contentHeight: cellSize * 3
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
var _g = itemGap;
|
|
38
|
+
return {
|
|
39
|
+
contentWidth: 4 * (cellSize + _g) + _g,
|
|
40
|
+
contentHeight: 3 * (cellSize + _g) + _g
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (itemUnit === 'pixel') {
|
|
44
|
+
var maxRight = 0;
|
|
45
|
+
var maxBottom = 0;
|
|
46
|
+
var _iterator = _createForOfIteratorHelper(items),
|
|
47
|
+
_step;
|
|
48
|
+
try {
|
|
49
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
50
|
+
var _item$width, _item$height;
|
|
51
|
+
var item = _step.value;
|
|
52
|
+
var w = (_item$width = item.width) !== null && _item$width !== void 0 ? _item$width : cellSize;
|
|
53
|
+
var h = (_item$height = item.height) !== null && _item$height !== void 0 ? _item$height : cellSize;
|
|
54
|
+
maxRight = Math.max(maxRight, item.x + w);
|
|
55
|
+
maxBottom = Math.max(maxBottom, item.y + h);
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
_iterator.e(err);
|
|
59
|
+
} finally {
|
|
60
|
+
_iterator.f();
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
contentWidth: maxRight,
|
|
64
|
+
contentHeight: maxBottom
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
var maxX = 0;
|
|
68
|
+
var maxY = 0;
|
|
69
|
+
var _iterator2 = _createForOfIteratorHelper(items),
|
|
70
|
+
_step2;
|
|
71
|
+
try {
|
|
72
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
73
|
+
var _item$width2, _item$height2;
|
|
74
|
+
var _item = _step2.value;
|
|
75
|
+
var _w = (_item$width2 = _item.width) !== null && _item$width2 !== void 0 ? _item$width2 : 1;
|
|
76
|
+
var _h = (_item$height2 = _item.height) !== null && _item$height2 !== void 0 ? _item$height2 : 1;
|
|
77
|
+
maxX = Math.max(maxX, _item.x + _w);
|
|
78
|
+
maxY = Math.max(maxY, _item.y + _h);
|
|
79
|
+
}
|
|
80
|
+
} catch (err) {
|
|
81
|
+
_iterator2.e(err);
|
|
82
|
+
} finally {
|
|
83
|
+
_iterator2.f();
|
|
84
|
+
}
|
|
85
|
+
var g = itemGap;
|
|
86
|
+
return {
|
|
87
|
+
contentWidth: maxX * (cellSize + g) + g,
|
|
88
|
+
contentHeight: maxY * (cellSize + g) + g
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* pixel 模式下取 items 包围盒(含左/上),用于画布四周扩 padding 时的尺寸与偏移
|
|
94
|
+
*/
|
|
95
|
+
export function getPixelBoundingBox(items, cellSize) {
|
|
96
|
+
if (!items.length) return null;
|
|
97
|
+
var minLeft = Infinity;
|
|
98
|
+
var minTop = Infinity;
|
|
99
|
+
var maxRight = -Infinity;
|
|
100
|
+
var maxBottom = -Infinity;
|
|
101
|
+
var _iterator3 = _createForOfIteratorHelper(items),
|
|
102
|
+
_step3;
|
|
103
|
+
try {
|
|
104
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
105
|
+
var _item$width3, _item$height3;
|
|
106
|
+
var item = _step3.value;
|
|
107
|
+
var w = (_item$width3 = item.width) !== null && _item$width3 !== void 0 ? _item$width3 : cellSize;
|
|
108
|
+
var h = (_item$height3 = item.height) !== null && _item$height3 !== void 0 ? _item$height3 : cellSize;
|
|
109
|
+
minLeft = Math.min(minLeft, item.x);
|
|
110
|
+
minTop = Math.min(minTop, item.y);
|
|
111
|
+
maxRight = Math.max(maxRight, item.x + w);
|
|
112
|
+
maxBottom = Math.max(maxBottom, item.y + h);
|
|
113
|
+
}
|
|
114
|
+
} catch (err) {
|
|
115
|
+
_iterator3.e(err);
|
|
116
|
+
} finally {
|
|
117
|
+
_iterator3.f();
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
minLeft: minLeft,
|
|
121
|
+
minTop: minTop,
|
|
122
|
+
maxRight: maxRight,
|
|
123
|
+
maxBottom: maxBottom
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FloorMapCanvas, FloorMapViewConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* 为画布 Tab 合并展示用字段:
|
|
4
|
+
* - `tabBadge` 若在配置中已给出则原样使用(含 0);
|
|
5
|
+
* - 否则用当前 `sceneElements` 中属于该画布的数量,且仅在大于 0 时展示角标。
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeCanvasesForTabs(config: FloorMapViewConfig): FloorMapCanvas[];
|
|
@@ -0,0 +1,29 @@
|
|
|
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 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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
/**
|
|
8
|
+
* 为画布 Tab 合并展示用字段:
|
|
9
|
+
* - `tabBadge` 若在配置中已给出则原样使用(含 0);
|
|
10
|
+
* - 否则用当前 `sceneElements` 中属于该画布的数量,且仅在大于 0 时展示角标。
|
|
11
|
+
*/
|
|
12
|
+
export function mergeCanvasesForTabs(config) {
|
|
13
|
+
var _config$sceneElements;
|
|
14
|
+
var elements = (_config$sceneElements = config.sceneElements) !== null && _config$sceneElements !== void 0 ? _config$sceneElements : [];
|
|
15
|
+
return config.canvases.map(function (c) {
|
|
16
|
+
var autoCount = elements.filter(function (e) {
|
|
17
|
+
return e.canvasId === c.id;
|
|
18
|
+
}).length;
|
|
19
|
+
var tabBadge;
|
|
20
|
+
if (c.tabBadge !== undefined && c.tabBadge !== null) {
|
|
21
|
+
tabBadge = c.tabBadge;
|
|
22
|
+
} else if (autoCount > 0) {
|
|
23
|
+
tabBadge = autoCount;
|
|
24
|
+
}
|
|
25
|
+
return _objectSpread(_objectSpread({}, c), {}, {
|
|
26
|
+
tabBadge: tabBadge
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 吸附:将坐标或尺寸按 snapStep 取整;snapStep 为 0 不吸附
|
|
3
|
+
*/
|
|
4
|
+
export declare function snapValue(value: number, snapStep: number): number;
|
|
5
|
+
export declare function snapRect(x: number, y: number, width: number, height: number, snapStep: number): {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 吸附:将坐标或尺寸按 snapStep 取整;snapStep 为 0 不吸附
|
|
3
|
+
*/
|
|
4
|
+
export function snapValue(value, snapStep) {
|
|
5
|
+
if (!snapStep || snapStep <= 0) return value;
|
|
6
|
+
return Math.round(value / snapStep) * snapStep;
|
|
7
|
+
}
|
|
8
|
+
export function snapRect(x, y, width, height, snapStep) {
|
|
9
|
+
if (!snapStep || snapStep <= 0) return {
|
|
10
|
+
x: x,
|
|
11
|
+
y: y,
|
|
12
|
+
width: width,
|
|
13
|
+
height: height
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
x: snapValue(x, snapStep),
|
|
17
|
+
y: snapValue(y, snapStep),
|
|
18
|
+
width: Math.max(snapStep, snapValue(width, snapStep)),
|
|
19
|
+
height: Math.max(snapStep, snapValue(height, snapStep))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PisellHierarchicalSummaryListProps } from './types';
|
|
3
|
+
import './PisellHierarchicalSummaryList.less';
|
|
4
|
+
/** 根节点类名,供上层用同一 DOM 包裹列表与其它区块时使用 */
|
|
5
|
+
export declare const PREFIX_CLS = "pisell-hierarchical-summary-list";
|
|
6
|
+
export declare const PisellHierarchicalSummaryList: React.FC<PisellHierarchicalSummaryListProps>;
|