@pisell/materials 1.0.1059 → 1.0.1062

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +285 -285
  2. package/build/lowcode/assets-daily.json +11 -11
  3. package/build/lowcode/assets-dev.json +2 -2
  4. package/build/lowcode/assets-prod.json +11 -11
  5. package/build/lowcode/index.js +1 -1
  6. package/build/lowcode/meta.js +7 -7
  7. package/build/lowcode/preview.js +9 -9
  8. package/build/lowcode/render/default/view.css +1 -1
  9. package/build/lowcode/render/default/view.js +27 -27
  10. package/build/lowcode/view.css +1 -1
  11. package/build/lowcode/view.js +27 -27
  12. package/es/components/PisellLayouts/index.d.ts +2 -1
  13. package/es/components/PisellLayouts/index.js +17 -15
  14. package/es/components/cardMetricItem/index.js +2 -2
  15. package/es/components/pisellFilter/type.d.ts +4 -2
  16. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +1 -1
  17. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +474 -202
  18. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.less +70 -0
  19. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +13 -0
  20. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +469 -38
  21. package/es/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +22 -0
  22. package/es/components/pisellFloorMapLayout/components/CanvasTabs.js +203 -0
  23. package/es/components/pisellFloorMapLayout/components/CanvasTabs.less +189 -0
  24. package/es/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +37 -0
  25. package/es/components/pisellFloorMapLayout/components/EditableItemLayer.js +341 -0
  26. package/es/components/pisellFloorMapLayout/components/EditableItemLayer.less +89 -0
  27. package/es/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +39 -0
  28. package/es/components/pisellFloorMapLayout/components/FigmaTableCard.js +432 -0
  29. package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.d.ts +17 -0
  30. package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.js +131 -0
  31. package/es/components/pisellFloorMapLayout/components/FloorMapDataForm.less +7 -0
  32. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +11 -0
  33. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +497 -0
  34. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +154 -0
  35. package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +34 -0
  36. package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.js +130 -0
  37. package/es/components/pisellFloorMapLayout/components/FloorMapEditTopBar.less +131 -0
  38. package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +6 -0
  39. package/es/components/pisellFloorMapLayout/components/FloorMapImageElement.js +69 -0
  40. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +35 -0
  41. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.js +361 -0
  42. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +237 -0
  43. package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +7 -0
  44. package/es/components/pisellFloorMapLayout/components/ItemLayer.js +37 -11
  45. package/es/components/pisellFloorMapLayout/components/MapLayer.d.ts +4 -0
  46. package/es/components/pisellFloorMapLayout/components/MapLayer.js +11 -3
  47. package/es/components/pisellFloorMapLayout/components/ViewControls.js +2 -2
  48. package/es/components/pisellFloorMapLayout/components/ViewControls.less +3 -2
  49. package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +11 -0
  50. package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +27 -0
  51. package/es/components/pisellFloorMapLayout/components/index.d.ts +14 -0
  52. package/es/components/pisellFloorMapLayout/components/index.js +8 -1
  53. package/es/components/pisellFloorMapLayout/context/FloorMapLayoutContext.d.ts +16 -0
  54. package/es/components/pisellFloorMapLayout/context/FloorMapLayoutContext.js +21 -0
  55. package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.d.ts +5 -0
  56. package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +28 -0
  57. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +62 -0
  58. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +438 -0
  59. package/es/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.d.ts +21 -0
  60. package/es/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.js +122 -0
  61. package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +67 -0
  62. package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +322 -0
  63. package/es/components/pisellFloorMapLayout/index.d.ts +9 -2
  64. package/es/components/pisellFloorMapLayout/index.js +7 -2
  65. package/es/components/pisellFloorMapLayout/locales.d.ts +186 -0
  66. package/es/components/pisellFloorMapLayout/locales.js +185 -0
  67. package/es/components/pisellFloorMapLayout/types.d.ts +362 -1
  68. package/es/components/pisellFloorMapLayout/types.js +148 -1
  69. package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +20 -0
  70. package/es/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.js +129 -0
  71. package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
  72. package/es/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +87 -0
  73. package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +26 -0
  74. package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +47 -0
  75. package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +11 -0
  76. package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +69 -0
  77. package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
  78. package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +88 -0
  79. package/es/components/pisellFloorMapLayout/utils/floorMapStageDefaults.d.ts +8 -0
  80. package/es/components/pisellFloorMapLayout/utils/floorMapStageDefaults.js +8 -0
  81. package/es/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.d.ts +8 -0
  82. package/es/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.js +108 -0
  83. package/es/components/pisellFloorMapLayout/utils/layoutMeasurements.d.ts +30 -0
  84. package/es/components/pisellFloorMapLayout/utils/layoutMeasurements.js +125 -0
  85. package/es/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.d.ts +7 -0
  86. package/es/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.js +29 -0
  87. package/es/components/pisellFloorMapLayout/utils/snap.d.ts +10 -0
  88. package/es/components/pisellFloorMapLayout/utils/snap.js +21 -0
  89. package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.d.ts +6 -0
  90. package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.js +175 -0
  91. package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.less +129 -0
  92. package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.d.ts +10 -0
  93. package/es/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.js +237 -0
  94. package/es/components/pisellHierarchicalSummaryList/components/Row.d.ts +35 -0
  95. package/es/components/pisellHierarchicalSummaryList/components/Row.js +313 -0
  96. package/es/components/pisellHierarchicalSummaryList/components/index.d.ts +1 -0
  97. package/es/components/pisellHierarchicalSummaryList/components/index.js +1 -0
  98. package/es/components/pisellHierarchicalSummaryList/hooks/index.d.ts +2 -0
  99. package/es/components/pisellHierarchicalSummaryList/hooks/index.js +1 -0
  100. package/es/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.d.ts +15 -0
  101. package/es/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.js +34 -0
  102. package/es/components/pisellHierarchicalSummaryList/index.d.ts +5 -0
  103. package/es/components/pisellHierarchicalSummaryList/index.js +5 -0
  104. package/es/components/pisellHierarchicalSummaryList/types.d.ts +248 -0
  105. package/es/components/pisellHierarchicalSummaryList/types.js +1 -0
  106. package/es/components/pisellLookup/PisellLookup.js +82 -82
  107. package/es/components/pisellMultipleSelect/PisellMultipleSelect.stories.js +34 -34
  108. package/es/components/pisellRecordBoard/PisellRecordBoard.d.ts +2 -1
  109. package/es/components/pisellRecordBoard/PisellRecordBoard.js +95 -18
  110. package/es/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +4 -0
  111. package/es/components/pisellRecordBoard/PisellRecordBoard.stories.js +1315 -383
  112. package/es/components/pisellRecordBoard/index.d.ts +7 -2
  113. package/es/components/pisellRecordBoard/index.js +2 -1
  114. package/es/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +1 -3
  115. package/es/components/pisellRecordBoard/shellFrame/FloorMap.d.ts +14 -0
  116. package/es/components/pisellRecordBoard/shellFrame/FloorMap.js +15 -0
  117. package/es/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.d.ts +16 -0
  118. package/es/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.js +11 -0
  119. package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +47 -0
  120. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +57 -10
  121. package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +3 -3
  122. package/es/components/pisellRecordBoard/shellFrame/index.d.ts +4 -10
  123. package/es/components/pisellRecordBoard/shellFrame/index.js +101 -19
  124. package/es/components/pisellRecordBoard/types.d.ts +62 -2
  125. package/es/components/pisellRecordBoard/utils/partitionShellFrameChildren.d.ts +15 -0
  126. package/es/components/pisellRecordBoard/utils/partitionShellFrameChildren.js +57 -0
  127. package/es/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +10 -0
  128. package/es/components/pisellReservationSchedule/PisellReservationSchedule.js +156 -0
  129. package/es/components/pisellReservationSchedule/PisellReservationSchedule.less +88 -0
  130. package/es/components/pisellReservationSchedule/PisellReservationSchedule.stories.d.ts +12 -0
  131. package/es/components/pisellReservationSchedule/PisellReservationSchedule.stories.js +105 -0
  132. package/es/components/pisellReservationSchedule/index.d.ts +2 -0
  133. package/es/components/pisellReservationSchedule/index.js +1 -0
  134. package/es/components/pisellReservationSchedule/locales.d.ts +25 -0
  135. package/es/components/pisellReservationSchedule/locales.js +24 -0
  136. package/es/components/pisellReservationSchedule/types.d.ts +42 -0
  137. package/es/components/pisellReservationSchedule/types.js +1 -0
  138. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +10 -0
  139. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.js +91 -0
  140. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +49 -0
  141. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts +16 -0
  142. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.js +197 -0
  143. package/es/components/pisellReservationScheduleBand/index.d.ts +2 -0
  144. package/es/components/pisellReservationScheduleBand/index.js +1 -0
  145. package/es/components/pisellReservationScheduleBand/types.d.ts +45 -0
  146. package/es/components/pisellReservationScheduleBand/types.js +1 -0
  147. package/es/components/pisellRow/index.js +7 -7
  148. package/es/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
  149. package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +609 -0
  150. package/es/components/pisellTimeNavigator/PisellTimeNavigator.less +412 -0
  151. package/es/components/pisellTimeNavigator/PisellTimeNavigator.stories.d.ts +79 -0
  152. package/es/components/pisellTimeNavigator/PisellTimeNavigator.stories.js +290 -0
  153. package/es/components/pisellTimeNavigator/components/BackgroundLayer.d.ts +14 -0
  154. package/es/components/pisellTimeNavigator/components/BackgroundLayer.js +30 -0
  155. package/es/components/pisellTimeNavigator/components/CursorLayer.d.ts +20 -0
  156. package/es/components/pisellTimeNavigator/components/CursorLayer.js +46 -0
  157. package/es/components/pisellTimeNavigator/components/GestureLayer.d.ts +31 -0
  158. package/es/components/pisellTimeNavigator/components/GestureLayer.js +82 -0
  159. package/es/components/pisellTimeNavigator/components/NowButton.d.ts +14 -0
  160. package/es/components/pisellTimeNavigator/components/NowButton.js +38 -0
  161. package/es/components/pisellTimeNavigator/components/ScaleLayer.d.ts +17 -0
  162. package/es/components/pisellTimeNavigator/components/ScaleLayer.js +51 -0
  163. package/es/components/pisellTimeNavigator/components/index.d.ts +5 -0
  164. package/es/components/pisellTimeNavigator/components/index.js +5 -0
  165. package/es/components/pisellTimeNavigator/hooks/index.d.ts +5 -0
  166. package/es/components/pisellTimeNavigator/hooks/index.js +3 -0
  167. package/es/components/pisellTimeNavigator/hooks/useDragInertia.d.ts +14 -0
  168. package/es/components/pisellTimeNavigator/hooks/useDragInertia.js +109 -0
  169. package/es/components/pisellTimeNavigator/hooks/useRealtime.d.ts +5 -0
  170. package/es/components/pisellTimeNavigator/hooks/useRealtime.js +16 -0
  171. package/es/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +27 -0
  172. package/es/components/pisellTimeNavigator/hooks/useTimeAxis.js +76 -0
  173. package/es/components/pisellTimeNavigator/index.d.ts +4 -0
  174. package/es/components/pisellTimeNavigator/index.js +3 -0
  175. package/es/components/pisellTimeNavigator/locales.d.ts +22 -0
  176. package/es/components/pisellTimeNavigator/locales.js +21 -0
  177. package/es/components/pisellTimeNavigator/types.d.ts +149 -0
  178. package/es/components/pisellTimeNavigator/types.js +1 -0
  179. package/es/components/pisellTimeNavigator/utils/index.d.ts +30 -0
  180. package/es/components/pisellTimeNavigator/utils/index.js +116 -0
  181. package/es/index.d.ts +15 -5
  182. package/es/index.js +7 -1
  183. package/es/locales/en-US.d.ts +2 -0
  184. package/es/locales/en-US.js +6 -4
  185. package/es/locales/zh-CN.d.ts +2 -0
  186. package/es/locales/zh-CN.js +6 -4
  187. package/es/locales/zh-TW.d.ts +2 -0
  188. package/es/locales/zh-TW.js +6 -4
  189. package/lib/components/PisellLayouts/index.d.ts +2 -1
  190. package/lib/components/PisellLayouts/index.js +13 -1
  191. package/lib/components/pisellFilter/type.d.ts +4 -2
  192. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.d.ts +1 -1
  193. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +566 -181
  194. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.less +70 -0
  195. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.d.ts +13 -0
  196. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.stories.js +682 -84
  197. package/lib/components/pisellFloorMapLayout/components/CanvasTabs.d.ts +22 -0
  198. package/lib/components/pisellFloorMapLayout/components/CanvasTabs.js +237 -0
  199. package/lib/components/pisellFloorMapLayout/components/CanvasTabs.less +189 -0
  200. package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.d.ts +37 -0
  201. package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.js +358 -0
  202. package/lib/components/pisellFloorMapLayout/components/EditableItemLayer.less +89 -0
  203. package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.d.ts +39 -0
  204. package/lib/components/pisellFloorMapLayout/components/FigmaTableCard.js +482 -0
  205. package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.d.ts +17 -0
  206. package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.js +117 -0
  207. package/lib/components/pisellFloorMapLayout/components/FloorMapDataForm.less +7 -0
  208. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.d.ts +11 -0
  209. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +508 -0
  210. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +154 -0
  211. package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.d.ts +34 -0
  212. package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.js +188 -0
  213. package/lib/components/pisellFloorMapLayout/components/FloorMapEditTopBar.less +131 -0
  214. package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.d.ts +6 -0
  215. package/lib/components/pisellFloorMapLayout/components/FloorMapImageElement.js +94 -0
  216. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.d.ts +35 -0
  217. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.js +333 -0
  218. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +237 -0
  219. package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +7 -0
  220. package/lib/components/pisellFloorMapLayout/components/ItemLayer.js +26 -5
  221. package/lib/components/pisellFloorMapLayout/components/MapLayer.d.ts +4 -0
  222. package/lib/components/pisellFloorMapLayout/components/MapLayer.js +7 -2
  223. package/lib/components/pisellFloorMapLayout/components/ViewControls.less +3 -2
  224. package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +11 -0
  225. package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +63 -0
  226. package/lib/components/pisellFloorMapLayout/components/index.d.ts +14 -0
  227. package/lib/components/pisellFloorMapLayout/components/index.js +23 -2
  228. package/lib/components/pisellFloorMapLayout/context/FloorMapLayoutContext.d.ts +16 -0
  229. package/lib/components/pisellFloorMapLayout/context/FloorMapLayoutContext.js +54 -0
  230. package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.d.ts +5 -0
  231. package/lib/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +47 -0
  232. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +62 -0
  233. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +431 -0
  234. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.d.ts +21 -0
  235. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapPaletteTouchDrag.js +146 -0
  236. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +67 -0
  237. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +309 -0
  238. package/lib/components/pisellFloorMapLayout/index.d.ts +9 -2
  239. package/lib/components/pisellFloorMapLayout/index.js +31 -2
  240. package/lib/components/pisellFloorMapLayout/locales.d.ts +186 -0
  241. package/lib/components/pisellFloorMapLayout/locales.js +206 -0
  242. package/lib/components/pisellFloorMapLayout/types.d.ts +362 -1
  243. package/lib/components/pisellFloorMapLayout/types.js +15 -0
  244. package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.d.ts +20 -0
  245. package/lib/components/pisellFloorMapLayout/utils/floorMapCanvasDisplay.js +126 -0
  246. package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.d.ts +8 -0
  247. package/lib/components/pisellFloorMapLayout/utils/floorMapConfigMerge.js +66 -0
  248. package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +26 -0
  249. package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +61 -0
  250. package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +11 -0
  251. package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +70 -0
  252. package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.d.ts +11 -0
  253. package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +135 -0
  254. package/lib/components/pisellFloorMapLayout/utils/floorMapStageDefaults.d.ts +8 -0
  255. package/lib/components/pisellFloorMapLayout/utils/floorMapStageDefaults.js +33 -0
  256. package/lib/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.d.ts +8 -0
  257. package/lib/components/pisellFloorMapLayout/utils/floorMapViewConfigDiff.js +128 -0
  258. package/lib/components/pisellFloorMapLayout/utils/layoutMeasurements.d.ts +30 -0
  259. package/lib/components/pisellFloorMapLayout/utils/layoutMeasurements.js +96 -0
  260. package/lib/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.d.ts +7 -0
  261. package/lib/components/pisellFloorMapLayout/utils/mergeCanvasesForTabs.js +41 -0
  262. package/lib/components/pisellFloorMapLayout/utils/snap.d.ts +10 -0
  263. package/lib/components/pisellFloorMapLayout/utils/snap.js +43 -0
  264. package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.d.ts +6 -0
  265. package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.js +179 -0
  266. package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.less +129 -0
  267. package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.d.ts +10 -0
  268. package/lib/components/pisellHierarchicalSummaryList/PisellHierarchicalSummaryList.stories.js +218 -0
  269. package/lib/components/pisellHierarchicalSummaryList/components/Row.d.ts +35 -0
  270. package/lib/components/pisellHierarchicalSummaryList/components/Row.js +343 -0
  271. package/lib/components/pisellHierarchicalSummaryList/components/index.d.ts +1 -0
  272. package/lib/components/pisellHierarchicalSummaryList/components/index.js +29 -0
  273. package/lib/components/pisellHierarchicalSummaryList/hooks/index.d.ts +2 -0
  274. package/lib/components/pisellHierarchicalSummaryList/hooks/index.js +29 -0
  275. package/lib/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.d.ts +15 -0
  276. package/lib/components/pisellHierarchicalSummaryList/hooks/useExpandedKeys.js +51 -0
  277. package/lib/components/pisellHierarchicalSummaryList/index.d.ts +5 -0
  278. package/lib/components/pisellHierarchicalSummaryList/index.js +31 -0
  279. package/lib/components/pisellHierarchicalSummaryList/types.d.ts +248 -0
  280. package/lib/components/pisellHierarchicalSummaryList/types.js +17 -0
  281. package/lib/components/pisellRecordBoard/PisellRecordBoard.d.ts +2 -1
  282. package/lib/components/pisellRecordBoard/PisellRecordBoard.js +82 -8
  283. package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.d.ts +4 -0
  284. package/lib/components/pisellRecordBoard/PisellRecordBoard.stories.js +915 -25
  285. package/lib/components/pisellRecordBoard/index.d.ts +7 -2
  286. package/lib/components/pisellRecordBoard/index.js +1 -0
  287. package/lib/components/pisellRecordBoard/shellFrame/ColumnSetting/index.js +8 -2
  288. package/lib/components/pisellRecordBoard/shellFrame/FloorMap.d.ts +14 -0
  289. package/lib/components/pisellRecordBoard/shellFrame/FloorMap.js +27 -0
  290. package/lib/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.d.ts +16 -0
  291. package/lib/components/pisellRecordBoard/shellFrame/ShellBodyMetaContext.js +45 -0
  292. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +47 -0
  293. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +48 -4
  294. package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +4 -10
  295. package/lib/components/pisellRecordBoard/shellFrame/index.js +88 -6
  296. package/lib/components/pisellRecordBoard/types.d.ts +62 -2
  297. package/lib/components/pisellRecordBoard/utils/partitionShellFrameChildren.d.ts +15 -0
  298. package/lib/components/pisellRecordBoard/utils/partitionShellFrameChildren.js +88 -0
  299. package/lib/components/pisellReservationSchedule/PisellReservationSchedule.d.ts +10 -0
  300. package/lib/components/pisellReservationSchedule/PisellReservationSchedule.js +200 -0
  301. package/lib/components/pisellReservationSchedule/PisellReservationSchedule.less +88 -0
  302. package/lib/components/pisellReservationSchedule/PisellReservationSchedule.stories.d.ts +12 -0
  303. package/lib/components/pisellReservationSchedule/PisellReservationSchedule.stories.js +116 -0
  304. package/lib/components/pisellReservationSchedule/index.d.ts +2 -0
  305. package/lib/components/pisellReservationSchedule/index.js +29 -0
  306. package/lib/components/pisellReservationSchedule/locales.d.ts +25 -0
  307. package/lib/components/pisellReservationSchedule/locales.js +47 -0
  308. package/lib/components/pisellReservationSchedule/types.d.ts +42 -0
  309. package/lib/components/pisellReservationSchedule/types.js +17 -0
  310. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.d.ts +10 -0
  311. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.js +127 -0
  312. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +49 -0
  313. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.d.ts +16 -0
  314. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.stories.js +181 -0
  315. package/lib/components/pisellReservationScheduleBand/index.d.ts +2 -0
  316. package/lib/components/pisellReservationScheduleBand/index.js +29 -0
  317. package/lib/components/pisellReservationScheduleBand/types.d.ts +45 -0
  318. package/lib/components/pisellReservationScheduleBand/types.js +17 -0
  319. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.d.ts +10 -0
  320. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +716 -0
  321. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.less +412 -0
  322. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.stories.d.ts +79 -0
  323. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.stories.js +273 -0
  324. package/lib/components/pisellTimeNavigator/components/BackgroundLayer.d.ts +14 -0
  325. package/lib/components/pisellTimeNavigator/components/BackgroundLayer.js +81 -0
  326. package/lib/components/pisellTimeNavigator/components/CursorLayer.d.ts +20 -0
  327. package/lib/components/pisellTimeNavigator/components/CursorLayer.js +74 -0
  328. package/lib/components/pisellTimeNavigator/components/GestureLayer.d.ts +31 -0
  329. package/lib/components/pisellTimeNavigator/components/GestureLayer.js +159 -0
  330. package/lib/components/pisellTimeNavigator/components/NowButton.d.ts +14 -0
  331. package/lib/components/pisellTimeNavigator/components/NowButton.js +81 -0
  332. package/lib/components/pisellTimeNavigator/components/ScaleLayer.d.ts +17 -0
  333. package/lib/components/pisellTimeNavigator/components/ScaleLayer.js +95 -0
  334. package/lib/components/pisellTimeNavigator/components/index.d.ts +5 -0
  335. package/lib/components/pisellTimeNavigator/components/index.js +41 -0
  336. package/lib/components/pisellTimeNavigator/hooks/index.d.ts +5 -0
  337. package/lib/components/pisellTimeNavigator/hooks/index.js +35 -0
  338. package/lib/components/pisellTimeNavigator/hooks/useDragInertia.d.ts +14 -0
  339. package/lib/components/pisellTimeNavigator/hooks/useDragInertia.js +136 -0
  340. package/lib/components/pisellTimeNavigator/hooks/useRealtime.d.ts +5 -0
  341. package/lib/components/pisellTimeNavigator/hooks/useRealtime.js +49 -0
  342. package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.d.ts +27 -0
  343. package/lib/components/pisellTimeNavigator/hooks/useTimeAxis.js +81 -0
  344. package/lib/components/pisellTimeNavigator/index.d.ts +4 -0
  345. package/lib/components/pisellTimeNavigator/index.js +42 -0
  346. package/lib/components/pisellTimeNavigator/locales.d.ts +22 -0
  347. package/lib/components/pisellTimeNavigator/locales.js +41 -0
  348. package/lib/components/pisellTimeNavigator/types.d.ts +149 -0
  349. package/lib/components/pisellTimeNavigator/types.js +17 -0
  350. package/lib/components/pisellTimeNavigator/utils/index.d.ts +30 -0
  351. package/lib/components/pisellTimeNavigator/utils/index.js +107 -0
  352. package/lib/index.d.ts +15 -5
  353. package/lib/index.js +35 -0
  354. package/lib/locales/en-US.d.ts +2 -0
  355. package/lib/locales/en-US.js +2 -0
  356. package/lib/locales/zh-CN.d.ts +2 -0
  357. package/lib/locales/zh-CN.js +2 -0
  358. package/lib/locales/zh-TW.d.ts +2 -0
  359. package/lib/locales/zh-TW.js +2 -0
  360. package/lowcode/floor-map-layout-provider/meta.ts +65 -0
  361. package/lowcode/pisell-floor-map-layout/meta.ts +3894 -1
  362. package/lowcode/pisell-hierarchical-summary-list/meta.ts +244 -0
  363. package/lowcode/pisell-reservation-schedule/index.ts +3 -0
  364. package/lowcode/pisell-reservation-schedule/meta.ts +69 -0
  365. package/lowcode/pisell-reservation-schedule/snippets.ts +1 -0
  366. package/lowcode/pisell-reservation-schedule-band/index.ts +3 -0
  367. package/lowcode/pisell-reservation-schedule-band/meta.ts +96 -0
  368. package/lowcode/pisell-reservation-schedule-band/snippets.ts +1 -0
  369. package/lowcode/pisell-time-navigator/index.ts +3 -0
  370. package/lowcode/pisell-time-navigator/meta.ts +298 -0
  371. package/lowcode/pisell-time-navigator/snippets.ts +1 -0
  372. package/lowcode/render-figma-style-round-table-card/meta.ts +589 -0
  373. package/lowcode/render-figma-style-table-card/meta.ts +589 -0
  374. package/package.json +3 -3
@@ -0,0 +1,716 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/pisellTimeNavigator/PisellTimeNavigator.tsx
30
+ var PisellTimeNavigator_exports = {};
31
+ __export(PisellTimeNavigator_exports, {
32
+ PisellTimeNavigator: () => PisellTimeNavigator
33
+ });
34
+ module.exports = __toCommonJS(PisellTimeNavigator_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_dayjs = __toESM(require("dayjs"));
37
+ var import_classnames = __toESM(require("classnames"));
38
+ var import_PisellScrollView = __toESM(require("../PisellScrollView"));
39
+ var import_utils = require("./utils");
40
+ var import_hooks = require("./hooks");
41
+ var import_components = require("./components");
42
+ var import_utils2 = require("@pisell/utils");
43
+ var import_locales = __toESM(require("./locales"));
44
+ var import_PisellTimeNavigator = require("./PisellTimeNavigator.less");
45
+ var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
46
+ var CELL_SIZE_H = 82;
47
+ var CELL_SIZE_V = 20;
48
+ var CURSOR_MOVES_NOW_RESERVE_PX = 56;
49
+ var CURSOR_MOVES_H_PADDING_PX = 8;
50
+ var CURSOR_MOVES_MIN_CELL_PX = 8;
51
+ function PisellTimeNavigator(props) {
52
+ var _a, _b;
53
+ const {
54
+ value: valueProp,
55
+ onChange,
56
+ defaultValue,
57
+ referenceDate: referenceDateProp,
58
+ realtime = false,
59
+ range,
60
+ stepMinutes = 15,
61
+ majorStepMinutes = 60,
62
+ cursorMode = "axis-moves",
63
+ orientation = "horizontal",
64
+ disabledRanges,
65
+ showNowButton = true,
66
+ userInteractionLocked = false,
67
+ snapToStep = true,
68
+ inertia = false,
69
+ businessHours,
70
+ pastTimeFade,
71
+ containerStyle,
72
+ scaleStyle,
73
+ cursorStyle,
74
+ nowButtonStyle,
75
+ className,
76
+ style,
77
+ locale,
78
+ timeFormat = "HH:mm",
79
+ renderNowButton,
80
+ onUserInteraction
81
+ } = props;
82
+ const context = (0, import_useEngineContext.default)();
83
+ import_utils2.locales.init(
84
+ import_locales.default,
85
+ ((_b = (_a = context == null ? void 0 : context.engine) == null ? void 0 : _a.props) == null ? void 0 : _b.locale) || "en"
86
+ );
87
+ const referenceDateFromProp = (0, import_react.useMemo)(() => {
88
+ if (referenceDateProp == null) return void 0;
89
+ const d = (0, import_utils.parseValue)(referenceDateProp, (0, import_dayjs.default)());
90
+ return (d ?? (0, import_dayjs.default)()).startOf("day");
91
+ }, [referenceDateProp]);
92
+ const referenceDate = referenceDateFromProp ?? (0, import_dayjs.default)().startOf("day");
93
+ const isHorizontal = orientation === "horizontal";
94
+ const isAxisMoves = cursorMode === "axis-moves";
95
+ const [viewportSize, setViewportSize] = (0, import_react.useState)({ w: 0, h: 0 });
96
+ const viewportWrapRef = (0, import_react.useRef)(null);
97
+ (0, import_react.useEffect)(() => {
98
+ const el = viewportWrapRef.current;
99
+ if (!el) return;
100
+ const setSize = () => {
101
+ const w = el.clientWidth;
102
+ const h = el.clientHeight;
103
+ setViewportSize(
104
+ (prev) => prev.w === w && prev.h === h ? prev : { w, h }
105
+ );
106
+ };
107
+ setSize();
108
+ const ro = new ResizeObserver(setSize);
109
+ ro.observe(el);
110
+ return () => ro.disconnect();
111
+ }, []);
112
+ const horizontalSlotCount = (0, import_react.useMemo)(
113
+ () => isHorizontal ? (0, import_utils.getHorizontalAxisSlotCount)(range, referenceDate, stepMinutes) : 0,
114
+ [isHorizontal, range == null ? void 0 : range.start, range == null ? void 0 : range.end, referenceDate, stepMinutes]
115
+ );
116
+ const cellSizePx = (0, import_react.useMemo)(() => {
117
+ if (!isHorizontal) return CELL_SIZE_V;
118
+ if (isAxisMoves) return CELL_SIZE_H;
119
+ const n = horizontalSlotCount;
120
+ if (n <= 0) return CELL_SIZE_H;
121
+ const vpW = Math.max(1, viewportSize.w || 400);
122
+ const reserve = showNowButton ? CURSOR_MOVES_NOW_RESERVE_PX : 0;
123
+ const usable = Math.max(40, vpW - reserve - CURSOR_MOVES_H_PADDING_PX * 2);
124
+ const raw = Math.floor(usable / n);
125
+ return Math.max(CURSOR_MOVES_MIN_CELL_PX, Math.min(CELL_SIZE_H, raw));
126
+ }, [
127
+ isHorizontal,
128
+ isAxisMoves,
129
+ horizontalSlotCount,
130
+ viewportSize.w,
131
+ showNowButton
132
+ ]);
133
+ const axis = (0, import_hooks.useTimeAxis)({
134
+ range,
135
+ stepMinutes,
136
+ referenceDate,
137
+ orientation,
138
+ cellSizePx
139
+ });
140
+ const isControlled = valueProp !== void 0;
141
+ const [internalValue, setInternalValue] = (0, import_react.useState)(() => {
142
+ const v = valueProp ?? defaultValue;
143
+ return (0, import_utils.parseValue)(v, referenceDate);
144
+ });
145
+ const value = isControlled ? valueProp != null ? (0, import_utils.parseValue)(valueProp, referenceDate) : null : internalValue;
146
+ const effectiveValue = value ?? axis.rangeStart;
147
+ const scrollRef = (0, import_react.useRef)(null);
148
+ const scrollToCenterInProgressRef = (0, import_react.useRef)(false);
149
+ const valueUpdatedByScrollRef = (0, import_react.useRef)(false);
150
+ const isPointerDownRef = (0, import_react.useRef)(false);
151
+ const [scrollPosition, setScrollPosition] = (0, import_react.useState)({
152
+ scrollLeft: 0,
153
+ scrollTop: 0
154
+ });
155
+ const [, setNowTick] = (0, import_react.useState)(0);
156
+ (0, import_react.useEffect)(() => {
157
+ const id = setInterval(() => setNowTick((n) => n + 1), 60 * 1e3);
158
+ return () => clearInterval(id);
159
+ }, []);
160
+ const cursorDragActiveRef = (0, import_react.useRef)(false);
161
+ const cursorDragBaseRef = (0, import_react.useRef)({ startClient: 0, startOffset: 0 });
162
+ const getScrollContainer = (0, import_react.useCallback)(
163
+ () => {
164
+ var _a2, _b2;
165
+ return ((_b2 = (_a2 = scrollRef.current) == null ? void 0 : _a2.getScrollContainer) == null ? void 0 : _b2.call(_a2)) ?? null;
166
+ },
167
+ []
168
+ );
169
+ const inertiaHandlers = (0, import_hooks.useDragInertia)({
170
+ enabled: inertia && !userInteractionLocked,
171
+ orientation,
172
+ getScrollContainer
173
+ });
174
+ const effectiveViewportW = viewportSize.w || 400;
175
+ const effectiveViewportH = viewportSize.h || 300;
176
+ const halfViewportW = effectiveViewportW / 2;
177
+ const halfViewportH = effectiveViewportH / 2;
178
+ const dotOffsetPx = isHorizontal ? cellSizePx / 2 : 0;
179
+ const axisStartMarginW = isHorizontal && !isAxisMoves ? CURSOR_MOVES_H_PADDING_PX : Math.max(0, halfViewportW - dotOffsetPx);
180
+ const axisStartMarginH = Math.max(0, halfViewportH - dotOffsetPx);
181
+ const handleScroll = (0, import_react.useCallback)(
182
+ (data) => {
183
+ if (scrollToCenterInProgressRef.current) return;
184
+ setScrollPosition({
185
+ scrollLeft: data.scrollLeft,
186
+ scrollTop: data.scrollTop
187
+ });
188
+ setViewportSize({ w: data.clientWidth, h: data.clientHeight });
189
+ if (userInteractionLocked) return;
190
+ if (!isAxisMoves || data.clientWidth <= 0 && data.clientHeight <= 0)
191
+ return;
192
+ const halfW = data.clientWidth / 2;
193
+ const halfH = data.clientHeight / 2;
194
+ const hasPadding = isHorizontal ? effectiveViewportW > 0 : effectiveViewportH > 0;
195
+ const centerOffset = isHorizontal ? hasPadding ? data.scrollLeft + dotOffsetPx : data.scrollLeft + halfW : hasPadding ? data.scrollTop + dotOffsetPx : data.scrollTop + halfH;
196
+ const t = axis.offsetToTimeContinuous(centerOffset);
197
+ if (!t) return;
198
+ const tMinute = t.startOf("minute");
199
+ if ((0, import_utils.isInDisabledRanges)(tMinute, disabledRanges)) return;
200
+ valueUpdatedByScrollRef.current = true;
201
+ if (!isControlled) setInternalValue(tMinute);
202
+ onChange == null ? void 0 : onChange(tMinute);
203
+ },
204
+ [
205
+ isAxisMoves,
206
+ isHorizontal,
207
+ isControlled,
208
+ axis.offsetToTimeContinuous,
209
+ disabledRanges,
210
+ onChange,
211
+ effectiveViewportW,
212
+ effectiveViewportH,
213
+ dotOffsetPx,
214
+ userInteractionLocked
215
+ ]
216
+ );
217
+ const performSnapFromScrollPosition = (0, import_react.useCallback)(
218
+ (scrollLeft, scrollTop, clientWidth, clientHeight) => {
219
+ if (!isAxisMoves || clientWidth <= 0 && clientHeight <= 0) return;
220
+ valueUpdatedByScrollRef.current = false;
221
+ const hasPadding = isHorizontal ? effectiveViewportW > 0 : effectiveViewportH > 0;
222
+ const centerOffset = isHorizontal ? hasPadding ? scrollLeft + dotOffsetPx : scrollLeft + clientWidth / 2 : hasPadding ? scrollTop + dotOffsetPx : scrollTop + clientHeight / 2;
223
+ const t = axis.offsetToTimeContinuous(centerOffset);
224
+ if (!t) return;
225
+ const snapped = snapToStep ? (0, import_utils.snapToStepMinutes)(t, stepMinutes) : t.startOf("minute");
226
+ if ((0, import_utils.isInDisabledRanges)(snapped, disabledRanges)) return;
227
+ if (!isControlled) setInternalValue(snapped);
228
+ onChange == null ? void 0 : onChange(snapped);
229
+ },
230
+ [
231
+ isAxisMoves,
232
+ isHorizontal,
233
+ isControlled,
234
+ axis.offsetToTimeContinuous,
235
+ snapToStep,
236
+ stepMinutes,
237
+ disabledRanges,
238
+ onChange,
239
+ effectiveViewportW,
240
+ effectiveViewportH,
241
+ dotOffsetPx
242
+ ]
243
+ );
244
+ const scrollEndClearTimeoutRef = (0, import_react.useRef)(
245
+ null
246
+ );
247
+ const handleScrollEnd = (0, import_react.useCallback)(
248
+ (data) => {
249
+ if (userInteractionLocked) return;
250
+ if (scrollToCenterInProgressRef.current) {
251
+ if (scrollEndClearTimeoutRef.current)
252
+ clearTimeout(scrollEndClearTimeoutRef.current);
253
+ scrollEndClearTimeoutRef.current = setTimeout(() => {
254
+ scrollToCenterInProgressRef.current = false;
255
+ scrollEndClearTimeoutRef.current = null;
256
+ }, 500);
257
+ return;
258
+ }
259
+ if (isPointerDownRef.current) return;
260
+ performSnapFromScrollPosition(
261
+ data.scrollLeft,
262
+ data.scrollTop,
263
+ data.clientWidth,
264
+ data.clientHeight
265
+ );
266
+ },
267
+ [performSnapFromScrollPosition, userInteractionLocked]
268
+ );
269
+ const handlePointerUp = (0, import_react.useCallback)(
270
+ (e) => {
271
+ var _a2, _b2, _c, _d;
272
+ isPointerDownRef.current = false;
273
+ if (userInteractionLocked) return;
274
+ if ((_b2 = (_a2 = e.target) == null ? void 0 : _a2.closest) == null ? void 0 : _b2.call(_a2, ".pisell-time-navigator-now"))
275
+ return;
276
+ if (!isAxisMoves) return;
277
+ const container = (_d = (_c = scrollRef.current) == null ? void 0 : _c.getScrollContainer) == null ? void 0 : _d.call(_c);
278
+ if (!container) return;
279
+ performSnapFromScrollPosition(
280
+ container.scrollLeft,
281
+ container.scrollTop,
282
+ container.clientWidth,
283
+ container.clientHeight
284
+ );
285
+ },
286
+ [isAxisMoves, performSnapFromScrollPosition, userInteractionLocked]
287
+ );
288
+ const snapFn = (0, import_react.useCallback)(
289
+ (t) => (0, import_utils.snapToStepMinutes)(t, stepMinutes),
290
+ [stepMinutes]
291
+ );
292
+ const isInDisabled = (0, import_react.useCallback)(
293
+ (t) => (0, import_utils.isInDisabledRanges)(t, disabledRanges),
294
+ [disabledRanges]
295
+ );
296
+ const handleChange = (0, import_react.useCallback)(
297
+ (next) => {
298
+ if (isInDisabled(next)) return;
299
+ if (!isControlled) setInternalValue(next);
300
+ onChange == null ? void 0 : onChange(next);
301
+ },
302
+ [isControlled, onChange, isInDisabled]
303
+ );
304
+ (0, import_hooks.useRealtime)(realtime, () => {
305
+ const wall = (0, import_dayjs.default)().startOf("minute");
306
+ const [rangeStart, rangeEnd] = (0, import_utils.getRangeBounds)(range, referenceDate);
307
+ const clamped = wall.isBefore(rangeStart) ? rangeStart : wall.isAfter(rangeEnd) ? rangeEnd : wall;
308
+ const snapped = snapToStep ? snapFn(clamped) : clamped;
309
+ if (!isInDisabled(snapped)) handleChange(snapped);
310
+ });
311
+ (0, import_react.useEffect)(() => {
312
+ if (!isControlled && valueProp !== void 0) {
313
+ setInternalValue((0, import_utils.parseValue)(valueProp, referenceDate));
314
+ }
315
+ }, [isControlled, valueProp, referenceDate]);
316
+ const referenceDayMs = referenceDate.valueOf();
317
+ (0, import_react.useEffect)(() => {
318
+ if (isControlled) return;
319
+ setInternalValue((prev) => {
320
+ if (!prev) {
321
+ return (0, import_utils.parseValue)(defaultValue, referenceDate);
322
+ }
323
+ return referenceDate.hour(prev.hour()).minute(prev.minute()).second(0).millisecond(0);
324
+ });
325
+ }, [referenceDayMs, isControlled, defaultValue]);
326
+ const cursorOffsetPx = axis.timeToOffset(effectiveValue);
327
+ const wallAligned = (0, import_dayjs.default)().startOf("minute");
328
+ const currentTimeInRange = !wallAligned.isBefore(axis.rangeStart) && !wallAligned.isAfter(axis.rangeEnd);
329
+ const currentTimeOffsetPx = currentTimeInRange ? axis.timeToOffset(wallAligned) : void 0;
330
+ const SCROLL_SYNC_THRESHOLD_PX = 2;
331
+ const hasScrollPadding = isHorizontal ? effectiveViewportW > 0 : effectiveViewportH > 0;
332
+ const verticalTailPx = effectiveViewportH / 2;
333
+ const verticalWrapHeight = axisStartMarginH + axis.totalLengthPx + verticalTailPx;
334
+ const maxScrollPx = isHorizontal ? Math.max(0, axis.totalLengthPx - cellSizePx) : Math.max(0, verticalWrapHeight - effectiveViewportH);
335
+ (0, import_react.useEffect)(() => {
336
+ var _a2, _b2, _c, _d;
337
+ if (!isAxisMoves && isHorizontal) {
338
+ const container2 = (_b2 = (_a2 = scrollRef.current) == null ? void 0 : _a2.getScrollContainer) == null ? void 0 : _b2.call(_a2);
339
+ if (container2 && container2.scrollLeft !== 0) {
340
+ container2.scrollTo({ left: 0, behavior: "auto" });
341
+ }
342
+ return;
343
+ }
344
+ if (!isAxisMoves && cursorDragActiveRef.current) return;
345
+ if (valueUpdatedByScrollRef.current) {
346
+ valueUpdatedByScrollRef.current = false;
347
+ return;
348
+ }
349
+ const container = (_d = (_c = scrollRef.current) == null ? void 0 : _c.getScrollContainer) == null ? void 0 : _d.call(_c);
350
+ if (!container) return;
351
+ const viewportPx = isHorizontal ? container.clientWidth : container.clientHeight;
352
+ const targetScroll = hasScrollPadding ? Math.max(0, Math.min(cursorOffsetPx - dotOffsetPx, maxScrollPx)) : Math.max(
353
+ 0,
354
+ Math.min(
355
+ cursorOffsetPx - viewportPx / 2,
356
+ Math.max(0, axis.totalLengthPx - viewportPx)
357
+ )
358
+ );
359
+ const currentScroll = isHorizontal ? container.scrollLeft : container.scrollTop;
360
+ if (Math.abs(currentScroll - targetScroll) <= SCROLL_SYNC_THRESHOLD_PX)
361
+ return;
362
+ scrollToCenterInProgressRef.current = true;
363
+ if (isHorizontal) {
364
+ container.scrollTo({ left: targetScroll, behavior: "smooth" });
365
+ } else {
366
+ container.scrollTo({ top: targetScroll, behavior: "smooth" });
367
+ }
368
+ }, [
369
+ effectiveValue.valueOf(),
370
+ isHorizontal,
371
+ cursorOffsetPx,
372
+ maxScrollPx,
373
+ hasScrollPadding,
374
+ dotOffsetPx,
375
+ cellSizePx,
376
+ axis.totalLengthPx,
377
+ isAxisMoves
378
+ ]);
379
+ const scrollToCenterTime = (0, import_react.useCallback)(
380
+ (t) => {
381
+ const container = getScrollContainer();
382
+ if (!container) return;
383
+ const offset = axis.timeToOffset(t);
384
+ const viewportPx = isHorizontal ? container.clientWidth : container.clientHeight;
385
+ const maxScroll = hasScrollPadding ? maxScrollPx : Math.max(0, axis.totalLengthPx - viewportPx);
386
+ const target = hasScrollPadding ? Math.max(0, Math.min(offset - dotOffsetPx, maxScrollPx)) : Math.max(0, Math.min(offset - viewportPx / 2, maxScroll));
387
+ scrollToCenterInProgressRef.current = true;
388
+ container.scrollTo({
389
+ left: isHorizontal ? target : 0,
390
+ top: isHorizontal ? 0 : target,
391
+ behavior: "smooth"
392
+ });
393
+ },
394
+ [
395
+ getScrollContainer,
396
+ axis.timeToOffset,
397
+ axis.totalLengthPx,
398
+ isHorizontal,
399
+ hasScrollPadding,
400
+ dotOffsetPx,
401
+ maxScrollPx
402
+ ]
403
+ );
404
+ const handleSelectTime = (0, import_react.useCallback)(
405
+ (t) => {
406
+ handleChange(t);
407
+ if (isAxisMoves) scrollToCenterTime(t);
408
+ },
409
+ [handleChange, isAxisMoves, scrollToCenterTime]
410
+ );
411
+ const handleNow = (0, import_react.useCallback)(() => {
412
+ valueUpdatedByScrollRef.current = false;
413
+ const wall = (0, import_dayjs.default)().startOf("minute");
414
+ const [rangeStart, rangeEnd] = (0, import_utils.getRangeBounds)(range, referenceDate);
415
+ const clamped = wall.isBefore(rangeStart) ? rangeStart : wall.isAfter(rangeEnd) ? rangeEnd : wall;
416
+ handleChange(clamped);
417
+ }, [range, referenceDate, handleChange]);
418
+ const applyOffsetToNavigatorValue = (0, import_react.useCallback)(
419
+ (offsetPx, snap) => {
420
+ const maxO = Math.max(0, axis.totalLengthPx - 1e-3);
421
+ const nextOff = Math.max(0, Math.min(offsetPx, maxO));
422
+ const t = axis.offsetToTimeContinuous(nextOff);
423
+ if (!t) return;
424
+ const out = snap ? snapToStep ? (0, import_utils.snapToStepMinutes)(t, stepMinutes) : t.startOf("minute") : t.startOf("minute");
425
+ if ((0, import_utils.isInDisabledRanges)(out, disabledRanges)) return;
426
+ if (!isControlled) setInternalValue(out);
427
+ onChange == null ? void 0 : onChange(out);
428
+ },
429
+ [
430
+ axis.totalLengthPx,
431
+ axis.offsetToTimeContinuous,
432
+ snapToStep,
433
+ stepMinutes,
434
+ disabledRanges,
435
+ isControlled,
436
+ onChange
437
+ ]
438
+ );
439
+ const handleCursorDragPointerDown = (0, import_react.useCallback)(
440
+ (e) => {
441
+ if (userInteractionLocked || isAxisMoves) return;
442
+ e.preventDefault();
443
+ e.stopPropagation();
444
+ onUserInteraction == null ? void 0 : onUserInteraction();
445
+ cursorDragActiveRef.current = true;
446
+ cursorDragBaseRef.current = {
447
+ startClient: isHorizontal ? e.clientX : e.clientY,
448
+ startOffset: cursorOffsetPx
449
+ };
450
+ valueUpdatedByScrollRef.current = true;
451
+ e.currentTarget.setPointerCapture(e.pointerId);
452
+ },
453
+ [
454
+ userInteractionLocked,
455
+ isAxisMoves,
456
+ isHorizontal,
457
+ cursorOffsetPx,
458
+ onUserInteraction
459
+ ]
460
+ );
461
+ const handleCursorDragPointerMove = (0, import_react.useCallback)(
462
+ (e) => {
463
+ if (!cursorDragActiveRef.current) return;
464
+ const client = isHorizontal ? e.clientX : e.clientY;
465
+ const delta = client - cursorDragBaseRef.current.startClient;
466
+ const nextOff = cursorDragBaseRef.current.startOffset + delta;
467
+ applyOffsetToNavigatorValue(nextOff, false);
468
+ },
469
+ [isHorizontal, applyOffsetToNavigatorValue]
470
+ );
471
+ const handleCursorDragPointerUp = (0, import_react.useCallback)(
472
+ (e) => {
473
+ if (!cursorDragActiveRef.current) return;
474
+ cursorDragActiveRef.current = false;
475
+ try {
476
+ e.currentTarget.releasePointerCapture(e.pointerId);
477
+ } catch {
478
+ }
479
+ const client = isHorizontal ? e.clientX : e.clientY;
480
+ const delta = client - cursorDragBaseRef.current.startClient;
481
+ const nextOff = cursorDragBaseRef.current.startOffset + delta;
482
+ valueUpdatedByScrollRef.current = false;
483
+ applyOffsetToNavigatorValue(nextOff, true);
484
+ },
485
+ [isHorizontal, applyOffsetToNavigatorValue]
486
+ );
487
+ const businessHoursPx = (0, import_react.useMemo)(() => {
488
+ if (!businessHours) return void 0;
489
+ const [s, e] = (0, import_utils.getRangeBounds)(businessHours, referenceDate);
490
+ return [axis.timeToOffset(s), axis.timeToOffset(e)];
491
+ }, [businessHours, referenceDate, axis.timeToOffset]);
492
+ const scrollConfig = (0, import_react.useMemo)(
493
+ () => ({
494
+ show: false,
495
+ type: isHorizontal ? "lrArrows" : "tbArrows",
496
+ scrollDistance: cellSizePx
497
+ }),
498
+ [isHorizontal, cellSizePx]
499
+ );
500
+ return /* @__PURE__ */ import_react.default.createElement(
501
+ "div",
502
+ {
503
+ className: (0, import_classnames.default)(
504
+ "pisell-time-navigator",
505
+ `pisell-time-navigator--${orientation}`,
506
+ userInteractionLocked && "pisell-time-navigator--interaction-locked",
507
+ className
508
+ ),
509
+ style: isHorizontal ? style : { height: "100%", minHeight: 200, ...style }
510
+ },
511
+ /* @__PURE__ */ import_react.default.createElement(
512
+ "div",
513
+ {
514
+ ref: viewportWrapRef,
515
+ className: "pisell-time-navigator-viewport-wrap",
516
+ style: isHorizontal ? void 0 : { height: "100%", minHeight: 200, maxHeight: 800 },
517
+ onPointerDownCapture: () => {
518
+ isPointerDownRef.current = true;
519
+ },
520
+ onPointerUpCapture: handlePointerUp,
521
+ onPointerLeaveCapture: handlePointerUp
522
+ },
523
+ /* @__PURE__ */ import_react.default.createElement(
524
+ "div",
525
+ {
526
+ className: (0, import_classnames.default)(
527
+ "pisell-time-navigator-scroll-host",
528
+ userInteractionLocked && "pisell-time-navigator-scroll-host--interaction-locked"
529
+ )
530
+ },
531
+ /* @__PURE__ */ import_react.default.createElement(
532
+ import_PisellScrollView.default,
533
+ {
534
+ ref: scrollRef,
535
+ width: "100%",
536
+ height: "100%",
537
+ overflow: isHorizontal ? "x" : "y",
538
+ showScrollButtons: false,
539
+ scrollbarStyle: "none",
540
+ scrollActionsConfig: scrollConfig,
541
+ onScroll: handleScroll,
542
+ onScrollEnd: handleScrollEnd,
543
+ style: {
544
+ ...isHorizontal ? { height: 48 } : {
545
+ width: 54,
546
+ minHeight: 200,
547
+ height: "100%",
548
+ maxHeight: 800
549
+ },
550
+ ...containerStyle
551
+ }
552
+ },
553
+ /* @__PURE__ */ import_react.default.createElement(
554
+ import_components.GestureLayer,
555
+ {
556
+ orientation,
557
+ cellSizePx,
558
+ axisStartMarginPx: isHorizontal ? axisStartMarginW : axisStartMarginH,
559
+ offsetToTime: axis.offsetToTime,
560
+ onSelectTime: handleSelectTime,
561
+ isInDisabledRanges: isInDisabled,
562
+ snapToStep,
563
+ stepMinutes,
564
+ snapFn,
565
+ scrollPosition,
566
+ viewportSize,
567
+ onUserInteraction,
568
+ onPointerDown: inertiaHandlers.onPointerDown,
569
+ onPointerMove: inertiaHandlers.onPointerMove,
570
+ onPointerUp: inertiaHandlers.onPointerUp,
571
+ onPointerLeave: inertiaHandlers.onPointerUp
572
+ },
573
+ /* @__PURE__ */ import_react.default.createElement(
574
+ "div",
575
+ {
576
+ className: "pisell-time-navigator-axis-wrap",
577
+ style: isHorizontal ? isAxisMoves ? {
578
+ width: axis.totalLengthPx + (effectiveViewportW - cellSizePx),
579
+ minHeight: 48
580
+ } : {
581
+ width: CURSOR_MOVES_H_PADDING_PX + axis.totalLengthPx + CURSOR_MOVES_H_PADDING_PX,
582
+ minHeight: 48
583
+ } : {
584
+ width: "100%"
585
+ /* 不设 height,由轴(marginTop + 内容 + marginBottom)自然撑开,避免固定高度与 margin 的 CSS 盒模型歧义 */
586
+ }
587
+ },
588
+ isHorizontal && currentTimeOffsetPx != null && currentTimeOffsetPx >= 0 && /* @__PURE__ */ import_react.default.createElement(
589
+ "div",
590
+ {
591
+ className: "pisell-time-navigator-current-gradient pisell-time-navigator-current-gradient--horizontal",
592
+ style: {
593
+ left: axisStartMarginW + Math.max(0, currentTimeOffsetPx - cellSizePx),
594
+ top: 0,
595
+ width: Math.min(cellSizePx, currentTimeOffsetPx),
596
+ height: 48
597
+ },
598
+ "aria-hidden": true
599
+ }
600
+ ),
601
+ /* @__PURE__ */ import_react.default.createElement(
602
+ "div",
603
+ {
604
+ className: (0, import_classnames.default)(
605
+ "pisell-time-navigator-axis",
606
+ `pisell-time-navigator-axis--${orientation}`
607
+ ),
608
+ "data-time-navigator-axis": true,
609
+ style: isHorizontal ? {
610
+ width: axis.totalLengthPx,
611
+ height: 48,
612
+ marginLeft: axisStartMarginW
613
+ } : {
614
+ height: axis.totalLengthPx,
615
+ width: "100%",
616
+ marginTop: axisStartMarginH,
617
+ marginBottom: verticalTailPx
618
+ }
619
+ },
620
+ /* @__PURE__ */ import_react.default.createElement(
621
+ import_components.BackgroundLayer,
622
+ {
623
+ orientation,
624
+ pastTimeFade,
625
+ businessHoursPx
626
+ }
627
+ ),
628
+ /* @__PURE__ */ import_react.default.createElement(
629
+ import_components.ScaleLayer,
630
+ {
631
+ orientation,
632
+ ticks: axis.ticks,
633
+ stepMinutes,
634
+ majorStepMinutes,
635
+ timeFormat,
636
+ locale,
637
+ style: scaleStyle,
638
+ horizontalCellSizePx: isHorizontal ? cellSizePx : void 0
639
+ }
640
+ ),
641
+ !isHorizontal && currentTimeOffsetPx != null && currentTimeOffsetPx >= 0 && /* @__PURE__ */ import_react.default.createElement(
642
+ "div",
643
+ {
644
+ className: "pisell-time-navigator-current-line",
645
+ style: {
646
+ left: 0,
647
+ top: currentTimeOffsetPx - 1,
648
+ width: "100%",
649
+ height: 2,
650
+ background: "#FF692E"
651
+ },
652
+ "aria-hidden": true
653
+ }
654
+ ),
655
+ !isAxisMoves && /* @__PURE__ */ import_react.default.createElement(
656
+ import_components.CursorLayer,
657
+ {
658
+ orientation,
659
+ value: effectiveValue,
660
+ timeFormat,
661
+ locale,
662
+ isRealtime: realtime,
663
+ offsetPx: cursorOffsetPx,
664
+ style: cursorStyle,
665
+ dragInteractive: !userInteractionLocked,
666
+ onDragPointerDown: handleCursorDragPointerDown,
667
+ onDragPointerMove: handleCursorDragPointerMove,
668
+ onDragPointerUp: handleCursorDragPointerUp,
669
+ onDragPointerCancel: handleCursorDragPointerUp
670
+ }
671
+ )
672
+ )
673
+ )
674
+ )
675
+ )
676
+ ),
677
+ isAxisMoves && /* @__PURE__ */ import_react.default.createElement(
678
+ "div",
679
+ {
680
+ className: (0, import_classnames.default)(
681
+ "pisell-time-navigator-cursor-fixed",
682
+ `pisell-time-navigator-cursor-fixed--${orientation}`
683
+ ),
684
+ "aria-hidden": true
685
+ },
686
+ /* @__PURE__ */ import_react.default.createElement(
687
+ import_components.CursorLayer,
688
+ {
689
+ orientation,
690
+ value: effectiveValue,
691
+ timeFormat,
692
+ locale,
693
+ isRealtime: realtime,
694
+ offsetPx: 0,
695
+ fixedCenter: true,
696
+ style: cursorStyle
697
+ }
698
+ )
699
+ ),
700
+ showNowButton && /* @__PURE__ */ import_react.default.createElement(
701
+ import_components.NowButton,
702
+ {
703
+ orientation,
704
+ onClick: handleNow,
705
+ style: nowButtonStyle,
706
+ renderCustom: renderNowButton
707
+ }
708
+ )
709
+ )
710
+ );
711
+ }
712
+ PisellTimeNavigator.displayName = "PisellTimeNavigator";
713
+ // Annotate the CommonJS export names for ESM import in node:
714
+ 0 && (module.exports = {
715
+ PisellTimeNavigator
716
+ });