@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,73 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
/**
|
|
10
|
+
* 刻度层:渲染时间刻度与标签
|
|
11
|
+
* 横向:整点数字 + 小圆点;竖向:整点/半点数字 + 分割线
|
|
12
|
+
*/
|
|
13
|
+
export function ScaleLayer(_ref) {
|
|
14
|
+
var orientation = _ref.orientation,
|
|
15
|
+
ticks = _ref.ticks,
|
|
16
|
+
stepMinutes = _ref.stepMinutes,
|
|
17
|
+
majorStepMinutes = _ref.majorStepMinutes,
|
|
18
|
+
timeFormat = _ref.timeFormat,
|
|
19
|
+
locale = _ref.locale,
|
|
20
|
+
style = _ref.style,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
horizontalCellSizePx = _ref.horizontalCellSizePx;
|
|
23
|
+
var isHorizontal = orientation === 'horizontal';
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classNames('pisell-time-navigator-scale', "pisell-time-navigator-scale--".concat(orientation), className),
|
|
26
|
+
style: style
|
|
27
|
+
}, ticks.map(function (tick, i) {
|
|
28
|
+
var isMajor = tick.minute() % majorStepMinutes === 0;
|
|
29
|
+
/** 横向整点只展示小时,非整点用 timeFormat;竖向沿用 timeFormat */
|
|
30
|
+
var label = isHorizontal && isMajor ? locale ? tick.locale(locale).format('H') : tick.format('H') : locale ? tick.locale(locale).format(timeFormat) : tick.format(timeFormat);
|
|
31
|
+
if (isHorizontal) {
|
|
32
|
+
var cw = horizontalCellSizePx != null && horizontalCellSizePx > 0 ? horizontalCellSizePx : undefined;
|
|
33
|
+
var compactPad = cw != null ? cw < 36 ? 2 : cw < 52 ? 6 : 10 : undefined;
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
key: i,
|
|
36
|
+
className: classNames('pisell-time-navigator-scale-cell', 'pisell-time-navigator-scale-cell--h', {
|
|
37
|
+
'pisell-time-navigator-scale-cell--major': isMajor
|
|
38
|
+
}),
|
|
39
|
+
style: cw != null ? _objectSpread({
|
|
40
|
+
width: cw,
|
|
41
|
+
minWidth: cw,
|
|
42
|
+
maxWidth: cw,
|
|
43
|
+
flex: '0 0 auto',
|
|
44
|
+
boxSizing: 'border-box'
|
|
45
|
+
}, compactPad != null ? {
|
|
46
|
+
padding: compactPad
|
|
47
|
+
} : {}) : undefined
|
|
48
|
+
}, isMajor && /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
className: "pisell-time-navigator-scale-label",
|
|
50
|
+
style: cw != null && cw < 48 ? {
|
|
51
|
+
fontSize: Math.max(10, Math.round(cw * 0.32)),
|
|
52
|
+
lineHeight: 1.15
|
|
53
|
+
} : undefined
|
|
54
|
+
}, label), !isMajor && /*#__PURE__*/React.createElement("span", {
|
|
55
|
+
className: "pisell-time-navigator-scale-dot",
|
|
56
|
+
"aria-hidden": true
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* 竖向:仅展示整点时间;整点格加 --major,顶部粗线 */
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
key: i,
|
|
63
|
+
className: classNames('pisell-time-navigator-scale-cell', 'pisell-time-navigator-scale-cell--v', {
|
|
64
|
+
'pisell-time-navigator-scale-cell--major': isMajor
|
|
65
|
+
})
|
|
66
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
67
|
+
className: "pisell-time-navigator-scale-divider",
|
|
68
|
+
"aria-hidden": true
|
|
69
|
+
}), isMajor && /*#__PURE__*/React.createElement("span", {
|
|
70
|
+
className: "pisell-time-navigator-scale-label"
|
|
71
|
+
}, label));
|
|
72
|
+
}));
|
|
73
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useTimeAxis } from './useTimeAxis';
|
|
2
|
+
export type { UseTimeAxisOptions, TimeAxisState } from './useTimeAxis';
|
|
3
|
+
export { useRealtime } from './useRealtime';
|
|
4
|
+
export { useDragInertia } from './useDragInertia';
|
|
5
|
+
export type { UseDragInertiaOptions } from './useDragInertia';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface UseDragInertiaOptions {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
orientation: 'horizontal' | 'vertical';
|
|
4
|
+
getScrollContainer: () => HTMLElement | null;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 惯性滚动:根据拖动末段速度在松手后继续滚动并衰减
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDragInertia(options: UseDragInertiaOptions): {
|
|
10
|
+
onPointerDown: (e: React.PointerEvent) => void;
|
|
11
|
+
onPointerMove: (e: React.PointerEvent) => void;
|
|
12
|
+
onPointerUp: (e: React.PointerEvent) => void;
|
|
13
|
+
stopInertia: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
var DECAY = 0.95;
|
|
3
|
+
var MIN_VELOCITY = 0.5;
|
|
4
|
+
var SAMPLE_MS = 50;
|
|
5
|
+
/**
|
|
6
|
+
* 惯性滚动:根据拖动末段速度在松手后继续滚动并衰减
|
|
7
|
+
*/
|
|
8
|
+
export function useDragInertia(options) {
|
|
9
|
+
var enabled = options.enabled,
|
|
10
|
+
orientation = options.orientation,
|
|
11
|
+
getScrollContainer = options.getScrollContainer;
|
|
12
|
+
var rafId = useRef(null);
|
|
13
|
+
var lastPos = useRef(0);
|
|
14
|
+
var lastTime = useRef(0);
|
|
15
|
+
var velocity = useRef(0);
|
|
16
|
+
var samples = useRef([]);
|
|
17
|
+
var applyScroll = useCallback(function (delta) {
|
|
18
|
+
var el = getScrollContainer();
|
|
19
|
+
if (!el) return;
|
|
20
|
+
if (orientation === 'horizontal') {
|
|
21
|
+
el.scrollLeft = Math.max(0, el.scrollLeft + delta);
|
|
22
|
+
} else {
|
|
23
|
+
el.scrollTop = Math.max(0, el.scrollTop + delta);
|
|
24
|
+
}
|
|
25
|
+
}, [getScrollContainer, orientation]);
|
|
26
|
+
var lastTickTime = useRef(0);
|
|
27
|
+
var tick = useCallback(function (now) {
|
|
28
|
+
var t = now !== null && now !== void 0 ? now : performance.now();
|
|
29
|
+
var dt = lastTickTime.current ? (t - lastTickTime.current) / 1000 : 0.016;
|
|
30
|
+
lastTickTime.current = t;
|
|
31
|
+
var v = velocity.current;
|
|
32
|
+
if (Math.abs(v) < MIN_VELOCITY) {
|
|
33
|
+
velocity.current = 0;
|
|
34
|
+
lastTickTime.current = 0;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
applyScroll(v * dt);
|
|
38
|
+
velocity.current = v * DECAY;
|
|
39
|
+
rafId.current = requestAnimationFrame(tick);
|
|
40
|
+
}, [applyScroll]);
|
|
41
|
+
var stopInertia = useCallback(function () {
|
|
42
|
+
if (rafId.current != null) {
|
|
43
|
+
cancelAnimationFrame(rafId.current);
|
|
44
|
+
rafId.current = null;
|
|
45
|
+
}
|
|
46
|
+
velocity.current = 0;
|
|
47
|
+
samples.current = [];
|
|
48
|
+
}, []);
|
|
49
|
+
var onPointerDown = useCallback(function (e) {
|
|
50
|
+
if (!enabled) return;
|
|
51
|
+
stopInertia();
|
|
52
|
+
var pos = orientation === 'horizontal' ? e.clientX : e.clientY;
|
|
53
|
+
lastPos.current = pos;
|
|
54
|
+
lastTime.current = Date.now();
|
|
55
|
+
samples.current = [{
|
|
56
|
+
pos: pos,
|
|
57
|
+
t: lastTime.current
|
|
58
|
+
}];
|
|
59
|
+
}, [enabled, orientation, stopInertia]);
|
|
60
|
+
var onPointerMove = useCallback(function (e) {
|
|
61
|
+
if (!enabled) return;
|
|
62
|
+
var pos = orientation === 'horizontal' ? e.clientX : e.clientY;
|
|
63
|
+
var t = Date.now();
|
|
64
|
+
var el = getScrollContainer();
|
|
65
|
+
if (el) {
|
|
66
|
+
var scroll = orientation === 'horizontal' ? el.scrollLeft : el.scrollTop;
|
|
67
|
+
var delta = pos - lastPos.current;
|
|
68
|
+
var maxScroll = orientation === 'horizontal' ? el.scrollWidth - el.clientWidth : el.scrollHeight - el.clientHeight;
|
|
69
|
+
var next = Math.max(0, Math.min(maxScroll, scroll + delta));
|
|
70
|
+
if (orientation === 'horizontal') {
|
|
71
|
+
el.scrollLeft = next;
|
|
72
|
+
} else {
|
|
73
|
+
el.scrollTop = next;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
lastPos.current = pos;
|
|
77
|
+
lastTime.current = t;
|
|
78
|
+
samples.current.push({
|
|
79
|
+
pos: pos,
|
|
80
|
+
t: t
|
|
81
|
+
});
|
|
82
|
+
var cutoff = t - SAMPLE_MS;
|
|
83
|
+
while (samples.current.length > 1 && samples.current[0].t < cutoff) {
|
|
84
|
+
samples.current.shift();
|
|
85
|
+
}
|
|
86
|
+
}, [enabled, orientation, getScrollContainer]);
|
|
87
|
+
var onPointerUp = useCallback(function (e) {
|
|
88
|
+
if (!enabled) return;
|
|
89
|
+
var arr = samples.current;
|
|
90
|
+
if (arr.length < 2) return;
|
|
91
|
+
var first = arr[0];
|
|
92
|
+
var last = arr[arr.length - 1];
|
|
93
|
+
var dt = (last.t - first.t) / 1000;
|
|
94
|
+
if (dt <= 0) return;
|
|
95
|
+
var scrollEl = getScrollContainer();
|
|
96
|
+
if (!scrollEl) return;
|
|
97
|
+
var scroll = orientation === 'horizontal' ? scrollEl.scrollLeft : scrollEl.scrollTop;
|
|
98
|
+
var totalDelta = last.pos - first.pos;
|
|
99
|
+
velocity.current = totalDelta / dt;
|
|
100
|
+
stopInertia();
|
|
101
|
+
rafId.current = requestAnimationFrame(tick);
|
|
102
|
+
}, [enabled, orientation, getScrollContainer, stopInertia, tick]);
|
|
103
|
+
return {
|
|
104
|
+
onPointerDown: onPointerDown,
|
|
105
|
+
onPointerMove: onPointerMove,
|
|
106
|
+
onPointerUp: onPointerUp,
|
|
107
|
+
stopInertia: stopInertia
|
|
108
|
+
};
|
|
109
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
/**
|
|
4
|
+
* Realtime 模式:每秒将当前系统时间通过 onTick 回传
|
|
5
|
+
*/
|
|
6
|
+
export function useRealtime(enabled, onTick) {
|
|
7
|
+
useEffect(function () {
|
|
8
|
+
if (!enabled) return;
|
|
9
|
+
var id = setInterval(function () {
|
|
10
|
+
onTick(dayjs());
|
|
11
|
+
}, 1000);
|
|
12
|
+
return function () {
|
|
13
|
+
return clearInterval(id);
|
|
14
|
+
};
|
|
15
|
+
}, [enabled, onTick]);
|
|
16
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Dayjs } from 'dayjs';
|
|
2
|
+
import type { TimeRangeOption } from '../types';
|
|
3
|
+
export interface UseTimeAxisOptions {
|
|
4
|
+
range?: TimeRangeOption;
|
|
5
|
+
stepMinutes: number;
|
|
6
|
+
referenceDate: Dayjs;
|
|
7
|
+
orientation: 'horizontal' | 'vertical';
|
|
8
|
+
/** 横向时每格宽度(px),竖向时每格高度(px) */
|
|
9
|
+
cellSizePx: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TimeAxisState {
|
|
12
|
+
rangeStart: Dayjs;
|
|
13
|
+
rangeEnd: Dayjs;
|
|
14
|
+
ticks: Dayjs[];
|
|
15
|
+
/** 时间转主轴偏移(px) */
|
|
16
|
+
timeToOffset: (t: Dayjs) => number;
|
|
17
|
+
/** 主轴偏移(px)转时间(最近刻度,用于刻度对齐) */
|
|
18
|
+
offsetToTime: (offset: number) => Dayjs | null;
|
|
19
|
+
/** 主轴偏移(px)转时间(连续插值,用于拖动时按分钟步长显示) */
|
|
20
|
+
offsetToTimeContinuous: (offset: number) => Dayjs | null;
|
|
21
|
+
/** 主轴总长度(px) */
|
|
22
|
+
totalLengthPx: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 时间轴刻度与时间↔像素换算
|
|
26
|
+
*/
|
|
27
|
+
export declare function useTimeAxis(options: UseTimeAxisOptions): TimeAxisState;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
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 _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useMemo } from 'react';
|
|
8
|
+
import { getRangeBounds, getTicks } from "../utils";
|
|
9
|
+
/**
|
|
10
|
+
* 时间轴刻度与时间↔像素换算
|
|
11
|
+
*/
|
|
12
|
+
export function useTimeAxis(options) {
|
|
13
|
+
var range = options.range,
|
|
14
|
+
stepMinutes = options.stepMinutes,
|
|
15
|
+
referenceDate = options.referenceDate,
|
|
16
|
+
orientation = options.orientation,
|
|
17
|
+
cellSizePx = options.cellSizePx;
|
|
18
|
+
return useMemo(function () {
|
|
19
|
+
var _getRangeBounds = getRangeBounds(range, referenceDate),
|
|
20
|
+
_getRangeBounds2 = _slicedToArray(_getRangeBounds, 2),
|
|
21
|
+
rangeStart = _getRangeBounds2[0],
|
|
22
|
+
rangeEnd = _getRangeBounds2[1];
|
|
23
|
+
var ticks = getTicks(rangeStart, rangeEnd, stepMinutes);
|
|
24
|
+
/**
|
|
25
|
+
* 仅当范围结束晚于最后一个刻度时(如全天 23:59)才多一格尾段,使最后一刻可滚到视口中心。
|
|
26
|
+
* 自定义范围如 08:00–20:00 的最后一格已是 20:00,不再多一格。
|
|
27
|
+
*/
|
|
28
|
+
var lastTick = ticks.length > 0 ? ticks[ticks.length - 1] : null;
|
|
29
|
+
/** 横向:仅当范围结束晚于最后刻度时多一格尾段 */
|
|
30
|
+
var needTailCell = orientation === 'horizontal' && lastTick != null && rangeEnd.isAfter(lastTick);
|
|
31
|
+
/** 竖向:范围结束恰在最后刻度时(如 08:00–20:00 的 20:00)不保留最后一格高度,与横向自定义范围一致 */
|
|
32
|
+
var noTailVertical = orientation === 'vertical' && lastTick != null && !rangeEnd.isAfter(lastTick);
|
|
33
|
+
var effectiveTicks = noTailVertical && ticks.length > 0 ? ticks.slice(0, -1) : ticks;
|
|
34
|
+
var rawTotalPx = orientation === 'vertical' ? effectiveTicks.length * cellSizePx : (ticks.length + (needTailCell ? 1 : 0)) * cellSizePx;
|
|
35
|
+
/** 防止异常 range/step 导致轴长爆炸(如竖向出现 33M 高度),上限约 2 天 15 分钟步进 */
|
|
36
|
+
var totalLengthPx = Math.min(rawTotalPx, 500000);
|
|
37
|
+
/**
|
|
38
|
+
* 横向:每格中心为「时间下面的点」,dotOffsetPx = cellSizePx/2。
|
|
39
|
+
* 竖向:对齐整点上面的粗线(格顶),dotOffsetPx = 0。
|
|
40
|
+
*/
|
|
41
|
+
var dotOffsetPx = orientation === 'vertical' ? 0 : cellSizePx / 2;
|
|
42
|
+
/** 最大偏移:竖向为最后一格顶;横向有尾格时为最后一格中心延伸,无尾格时为最后一格中心 */
|
|
43
|
+
var maxOffsetPx = orientation === 'vertical' ? totalLengthPx : dotOffsetPx + (needTailCell ? ticks.length : Math.max(0, ticks.length - 1)) * cellSizePx;
|
|
44
|
+
var timeToOffset = function timeToOffset(t) {
|
|
45
|
+
var diffMs = t.diff(rangeStart);
|
|
46
|
+
var diffMin = diffMs / (60 * 1000);
|
|
47
|
+
var index = diffMin / stepMinutes;
|
|
48
|
+
var px = dotOffsetPx + index * cellSizePx;
|
|
49
|
+
return Math.max(dotOffsetPx, Math.min(px, maxOffsetPx));
|
|
50
|
+
};
|
|
51
|
+
var offsetToTime = function offsetToTime(offset) {
|
|
52
|
+
var index = Math.round((offset - dotOffsetPx) / cellSizePx);
|
|
53
|
+
var tick = effectiveTicks[index];
|
|
54
|
+
return tick !== null && tick !== void 0 ? tick : null;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** 偏移对应连续时间;横向以格点为中心,竖向以格顶为基准 */
|
|
58
|
+
var offsetToTimeContinuous = function offsetToTimeContinuous(offset) {
|
|
59
|
+
var index = (offset - dotOffsetPx) / cellSizePx;
|
|
60
|
+
var minutesFromStart = index * stepMinutes;
|
|
61
|
+
var t = rangeStart.add(minutesFromStart, 'minute');
|
|
62
|
+
if (t.isBefore(rangeStart)) return rangeStart;
|
|
63
|
+
if (t.isAfter(rangeEnd)) return rangeEnd;
|
|
64
|
+
return t;
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
rangeStart: rangeStart,
|
|
68
|
+
rangeEnd: rangeEnd,
|
|
69
|
+
ticks: effectiveTicks,
|
|
70
|
+
timeToOffset: timeToOffset,
|
|
71
|
+
offsetToTime: offsetToTime,
|
|
72
|
+
offsetToTimeContinuous: offsetToTimeContinuous,
|
|
73
|
+
totalLengthPx: totalLengthPx
|
|
74
|
+
};
|
|
75
|
+
}, [range === null || range === void 0 ? void 0 : range.start, range === null || range === void 0 ? void 0 : range.end, stepMinutes, referenceDate.valueOf(), orientation, cellSizePx]);
|
|
76
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PisellTimeNavigator } from './PisellTimeNavigator';
|
|
2
|
+
export { getHorizontalAxisSlotCount, getRangeBounds } from './utils';
|
|
3
|
+
export type { PisellTimeNavigatorProps, TimeNavigatorValue, TimeRangeOption, CursorMode, TimeNavigatorOrientation, } from './types';
|
|
4
|
+
/** 多语言文案(en / zh-CN / zh-HK / ja / pt),使用前请在应用内通过 locales.init(pisellTimeNavigatorLocales, lang) 合并 */
|
|
5
|
+
export { default as pisellTimeNavigatorLocales } from './locales';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { PisellTimeNavigator } from "./PisellTimeNavigator";
|
|
2
|
+
export { getHorizontalAxisSlotCount, getRangeBounds } from "./utils";
|
|
3
|
+
/** 多语言文案(en / zh-CN / zh-HK / ja / pt),使用前请在应用内通过 locales.init(pisellTimeNavigatorLocales, lang) 合并 */
|
|
4
|
+
export { default as pisellTimeNavigatorLocales } from "./locales";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellTimeNavigator 多语言文案
|
|
3
|
+
* 使用前请在应用内通过 locales.init() 合并本模块导出的 key
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: {
|
|
6
|
+
en: {
|
|
7
|
+
'pisell-time-navigator.now': string;
|
|
8
|
+
};
|
|
9
|
+
'zh-CN': {
|
|
10
|
+
'pisell-time-navigator.now': string;
|
|
11
|
+
};
|
|
12
|
+
'zh-HK': {
|
|
13
|
+
'pisell-time-navigator.now': string;
|
|
14
|
+
};
|
|
15
|
+
ja: {
|
|
16
|
+
'pisell-time-navigator.now': string;
|
|
17
|
+
};
|
|
18
|
+
pt: {
|
|
19
|
+
'pisell-time-navigator.now': string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PisellTimeNavigator 多语言文案
|
|
3
|
+
* 使用前请在应用内通过 locales.init() 合并本模块导出的 key
|
|
4
|
+
*/
|
|
5
|
+
export default {
|
|
6
|
+
en: {
|
|
7
|
+
'pisell-time-navigator.now': 'Now'
|
|
8
|
+
},
|
|
9
|
+
'zh-CN': {
|
|
10
|
+
'pisell-time-navigator.now': '现在'
|
|
11
|
+
},
|
|
12
|
+
'zh-HK': {
|
|
13
|
+
'pisell-time-navigator.now': '現在'
|
|
14
|
+
},
|
|
15
|
+
ja: {
|
|
16
|
+
'pisell-time-navigator.now': '今'
|
|
17
|
+
},
|
|
18
|
+
pt: {
|
|
19
|
+
'pisell-time-navigator.now': 'Agora'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
/**
|
|
4
|
+
* value / defaultValue 的 dayjs 兼容类型(组件内部统一为 Dayjs)
|
|
5
|
+
*/
|
|
6
|
+
export declare type TimeNavigatorValue = Dayjs | string | null;
|
|
7
|
+
/**
|
|
8
|
+
* 时间范围(HH:mm 或 HH:mm:ss,相对 referenceDate 的营业日)
|
|
9
|
+
* - 同自然日:如 08:00–22:00
|
|
10
|
+
* - 跨日:结束钟面 ≤ 开始时视为次日结束,如 02:01–02:00 表示至次日 02:00
|
|
11
|
+
*/
|
|
12
|
+
export interface TimeRangeOption {
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 拖动/指示器模式
|
|
18
|
+
* - axis-moves:指示器固定视口中央,刻度移动(默认)
|
|
19
|
+
* - cursor-moves:刻度固定,指示器在轴上移动
|
|
20
|
+
*/
|
|
21
|
+
export declare type CursorMode = 'axis-moves' | 'cursor-moves';
|
|
22
|
+
/**
|
|
23
|
+
* 布局方向
|
|
24
|
+
*/
|
|
25
|
+
export declare type TimeNavigatorOrientation = 'horizontal' | 'vertical';
|
|
26
|
+
/**
|
|
27
|
+
* PisellTimeNavigator 组件 Props
|
|
28
|
+
*/
|
|
29
|
+
export interface PisellTimeNavigatorProps {
|
|
30
|
+
/**
|
|
31
|
+
* 当前选中时间(受控)。支持 dayjs 实例或可被 dayjs 解析的字符串
|
|
32
|
+
*/
|
|
33
|
+
value?: TimeNavigatorValue;
|
|
34
|
+
/**
|
|
35
|
+
* 时间变更回调(受控时必传)
|
|
36
|
+
*/
|
|
37
|
+
onChange?: (value: Dayjs) => void;
|
|
38
|
+
/**
|
|
39
|
+
* 默认选中时间(非受控)
|
|
40
|
+
*/
|
|
41
|
+
defaultValue?: TimeNavigatorValue;
|
|
42
|
+
/**
|
|
43
|
+
* 时间轴锚定到的日历日(startOf day)。`range` 的 HH:mm 均相对于该日。
|
|
44
|
+
* 不传则与历史一致:取「当天」0 点,避免跨天后刻度错位。
|
|
45
|
+
*/
|
|
46
|
+
referenceDate?: TimeNavigatorValue;
|
|
47
|
+
/**
|
|
48
|
+
* 是否 Realtime 模式:value 自动跟随系统当前时间更新
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
realtime?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 时间范围(支持跨日营业,见 {@link TimeRangeOption})。不传则默认当日 00:00–24:00
|
|
54
|
+
*/
|
|
55
|
+
range?: TimeRangeOption;
|
|
56
|
+
/**
|
|
57
|
+
* 吸附步长(分钟),如 15、30、60
|
|
58
|
+
* @default 15
|
|
59
|
+
*/
|
|
60
|
+
stepMinutes?: number;
|
|
61
|
+
/**
|
|
62
|
+
* 大刻度间隔(分钟),用于整点刻度;不传则与 stepMinutes 一致或 60
|
|
63
|
+
* @default 60
|
|
64
|
+
*/
|
|
65
|
+
majorStepMinutes?: number;
|
|
66
|
+
/**
|
|
67
|
+
* 指示器/轴移动模式
|
|
68
|
+
* @default 'axis-moves'
|
|
69
|
+
*/
|
|
70
|
+
cursorMode?: CursorMode;
|
|
71
|
+
/**
|
|
72
|
+
* 横向或竖向展示
|
|
73
|
+
* @default 'horizontal'
|
|
74
|
+
*/
|
|
75
|
+
orientation?: TimeNavigatorOrientation;
|
|
76
|
+
/**
|
|
77
|
+
* 营业时间范围(视觉高亮,可选限制选择范围)
|
|
78
|
+
*/
|
|
79
|
+
businessHours?: TimeRangeOption;
|
|
80
|
+
/**
|
|
81
|
+
* 禁用时间段,禁止选中(点击/吸附到该区间无效)
|
|
82
|
+
*/
|
|
83
|
+
disabledRanges?: TimeRangeOption[];
|
|
84
|
+
/**
|
|
85
|
+
* 是否显示 Now 按钮(固定入口)
|
|
86
|
+
* @default true
|
|
87
|
+
*/
|
|
88
|
+
showNowButton?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 为 true 时禁止用户拖动/滚动时间轴、点击刻度改时间(仍随 `value` 程序性对齐视口;用于「跟随当前时刻」等只读轴)
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
userInteractionLocked?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 是否吸附到 step 刻度
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
snapToStep?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* 是否开启惯性滚动(拖动松手后减速)
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
inertia?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 过去时间淡化背景色(CSS 颜色值)
|
|
106
|
+
*/
|
|
107
|
+
pastTimeFade?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 容器样式覆盖
|
|
110
|
+
*/
|
|
111
|
+
containerStyle?: CSSProperties;
|
|
112
|
+
/**
|
|
113
|
+
* 刻度层样式覆盖
|
|
114
|
+
*/
|
|
115
|
+
scaleStyle?: CSSProperties;
|
|
116
|
+
/**
|
|
117
|
+
* 时间气泡/竖线样式覆盖(区分 realtime 时由组件内部应用主题色)
|
|
118
|
+
*/
|
|
119
|
+
cursorStyle?: CSSProperties;
|
|
120
|
+
/**
|
|
121
|
+
* Now 按钮样式覆盖
|
|
122
|
+
*/
|
|
123
|
+
nowButtonStyle?: CSSProperties;
|
|
124
|
+
/**
|
|
125
|
+
* 自定义类名
|
|
126
|
+
*/
|
|
127
|
+
className?: string;
|
|
128
|
+
/**
|
|
129
|
+
* 根节点自定义样式
|
|
130
|
+
*/
|
|
131
|
+
style?: CSSProperties;
|
|
132
|
+
/**
|
|
133
|
+
* dayjs locale
|
|
134
|
+
*/
|
|
135
|
+
locale?: string;
|
|
136
|
+
/**
|
|
137
|
+
* 时间气泡展示格式(dayjs format)
|
|
138
|
+
* @default 'HH:mm'
|
|
139
|
+
*/
|
|
140
|
+
timeFormat?: string;
|
|
141
|
+
/**
|
|
142
|
+
* 自定义 Now 按钮内容(覆盖默认文案与图标时使用)
|
|
143
|
+
*/
|
|
144
|
+
renderNowButton?: () => ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* 横向轴上与刻度槽位数一致的密度序列(任意正数,内部按最大值归一化折线高度)
|
|
147
|
+
*/
|
|
148
|
+
densitySeries?: number[];
|
|
149
|
+
/**
|
|
150
|
+
* 未传 `densitySeries` 时按 `referenceDate` 拉取;日历日变更会重新请求,过期响应丢弃
|
|
151
|
+
*/
|
|
152
|
+
loadDensity?: (params: {
|
|
153
|
+
referenceDate: Dayjs;
|
|
154
|
+
stepMinutes: number;
|
|
155
|
+
}) => Promise<number[]>;
|
|
156
|
+
/**
|
|
157
|
+
* 用户开始操作时间轴(拖轴、点刻度、键盘、拖指针等)时回调;用于上层关闭「跟随当前」等。
|
|
158
|
+
*/
|
|
159
|
+
onUserInteraction?: () => void;
|
|
160
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Dayjs } from 'dayjs';
|
|
2
|
+
import type { TimeNavigatorValue, TimeRangeOption } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* 解析 value 为 Dayjs,无效则返回 null。
|
|
5
|
+
* 支持 dayjs 可解析的日期时间;纯时间字符串(如 '12:00'、'14:30')会基于 reference 的日期解析。
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseValue(value: TimeNavigatorValue, reference?: Dayjs): Dayjs | null;
|
|
8
|
+
/**
|
|
9
|
+
* 将 range 转为 [startDayjs, endDayjs](reference 为营业锚定日的 0 点)
|
|
10
|
+
* - 同日内:如 08:00–22:00
|
|
11
|
+
* - 跨日营业:结束钟面早于或等于开始(如 02:01–次日 02:00)时,end 解析为 reference 的次日同一时刻
|
|
12
|
+
*/
|
|
13
|
+
export declare function getRangeBounds(range: TimeRangeOption | undefined, reference: Dayjs): [Dayjs, Dayjs];
|
|
14
|
+
/**
|
|
15
|
+
* 将时间吸附到 step 分钟刻度(0、15、30、45 等):四舍五入到最近刻度。
|
|
16
|
+
*/
|
|
17
|
+
export declare function snapToStepMinutes(t: Dayjs, stepMinutes: number): Dayjs;
|
|
18
|
+
/**
|
|
19
|
+
* 判断时间是否落在任一禁用区间内(按绝对时间与区间 [start,end) 比较)
|
|
20
|
+
* 注:与主时间轴同 reference 的跨日 range 一致时需传入同一营业锚定日解析出的区间。
|
|
21
|
+
*/
|
|
22
|
+
export declare function isInDisabledRanges(t: Dayjs, disabledRanges: TimeRangeOption[] | undefined): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 在 [rangeStart, rangeEnd] 内按 stepMinutes 生成刻度时间列表(Dayjs)
|
|
25
|
+
*/
|
|
26
|
+
export declare function getTicks(rangeStart: Dayjs, rangeEnd: Dayjs, stepMinutes: number): Dayjs[];
|
|
27
|
+
/**
|
|
28
|
+
* 横向时间轴「格」数量,与 useTimeAxis 中 totalLengthPx 算法一致(含尾格)
|
|
29
|
+
*/
|
|
30
|
+
export declare function getHorizontalAxisSlotCount(range: TimeRangeOption | undefined, referenceDate: Dayjs, stepMinutes: number): number;
|