@pisell/materials 1.0.1063 → 1.0.1065

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 (112) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +9 -9
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +26 -26
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +26 -26
  11. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
  12. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +3 -3
  13. package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
  14. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  15. package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
  16. package/es/components/dataSourceComponents/fields/index.d.ts +6 -6
  17. package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +43 -31
  18. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +60 -16
  19. package/es/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +8 -0
  20. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.js +22 -12
  21. package/es/components/pisellFloorMapLayout/components/FloorMapToolbar.less +7 -5
  22. package/es/components/pisellFloorMapLayout/components/MapLayer.js +5 -2
  23. package/es/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
  24. package/es/components/pisellFloorMapLayout/components/ViewControls.js +29 -10
  25. package/es/components/pisellFloorMapLayout/components/ViewControls.less +36 -12
  26. package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +2 -0
  27. package/es/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +3 -1
  28. package/es/components/pisellFloorMapLayout/context/mergeFloorMapLayoutContext.js +2 -2
  29. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +1 -0
  30. package/es/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +166 -43
  31. package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +1 -1
  32. package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +90 -13
  33. package/es/components/pisellFloorMapLayout/index.d.ts +2 -0
  34. package/es/components/pisellFloorMapLayout/index.js +2 -0
  35. package/es/components/pisellFloorMapLayout/locales.d.ts +6 -0
  36. package/es/components/pisellFloorMapLayout/locales.js +9 -3
  37. package/es/components/pisellFloorMapLayout/types.d.ts +9 -2
  38. package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +1 -0
  39. package/es/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +10 -1
  40. package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +11 -0
  41. package/es/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +86 -0
  42. package/es/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +3 -2
  43. package/es/components/pisellRecordBoard/PisellRecordBoard.js +6 -3
  44. package/es/components/pisellRecordBoard/index.d.ts +1 -0
  45. package/es/components/pisellRecordBoard/index.js +2 -1
  46. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +1 -0
  47. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +21 -10
  48. package/es/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +23 -0
  49. package/es/components/pisellRecordBoard/shellFrame/index.d.ts +2 -0
  50. package/es/components/pisellRecordBoard/shellFrame/index.js +9 -3
  51. package/es/components/pisellRecordBoard/shellFrame/shellFrameFloorMap.less +25 -0
  52. package/es/components/pisellRecordBoard/types.d.ts +6 -0
  53. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.js +4 -1
  54. package/es/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +18 -1
  55. package/es/components/pisellReservationScheduleBand/types.d.ts +4 -0
  56. package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +180 -22
  57. package/es/components/pisellTimeNavigator/PisellTimeNavigator.less +11 -0
  58. package/es/components/pisellTimeNavigator/components/CursorLayer.js +4 -4
  59. package/es/components/pisellTimeNavigator/components/ScaleLayer.js +3 -3
  60. package/es/components/pisellTimeNavigator/types.d.ts +11 -0
  61. package/es/hooks/useResponsive.d.ts +1 -1
  62. package/es/index.d.ts +2 -2
  63. package/es/index.js +2 -2
  64. package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +39 -36
  65. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.js +56 -12
  66. package/lib/components/pisellFloorMapLayout/components/FloorMapEditPanel.less +8 -0
  67. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.js +19 -10
  68. package/lib/components/pisellFloorMapLayout/components/FloorMapToolbar.less +7 -5
  69. package/lib/components/pisellFloorMapLayout/components/MapLayer.js +3 -1
  70. package/lib/components/pisellFloorMapLayout/components/ViewControls.d.ts +4 -0
  71. package/lib/components/pisellFloorMapLayout/components/ViewControls.js +28 -6
  72. package/lib/components/pisellFloorMapLayout/components/ViewControls.less +36 -12
  73. package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.d.ts +2 -0
  74. package/lib/components/pisellFloorMapLayout/components/ViewControlsWithZoom.js +3 -1
  75. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.d.ts +1 -0
  76. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapEditState.js +143 -29
  77. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.d.ts +1 -1
  78. package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +86 -13
  79. package/lib/components/pisellFloorMapLayout/index.d.ts +2 -0
  80. package/lib/components/pisellFloorMapLayout/index.js +6 -0
  81. package/lib/components/pisellFloorMapLayout/locales.d.ts +6 -0
  82. package/lib/components/pisellFloorMapLayout/locales.js +9 -3
  83. package/lib/components/pisellFloorMapLayout/types.d.ts +9 -2
  84. package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.d.ts +1 -0
  85. package/lib/components/pisellFloorMapLayout/utils/floorMapDropUtils.js +7 -1
  86. package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.d.ts +11 -0
  87. package/lib/components/pisellFloorMapLayout/utils/floorMapElementKindUtils.js +69 -0
  88. package/lib/components/pisellFloorMapLayout/utils/floorMapFallbackRender.js +2 -1
  89. package/lib/components/pisellRecordBoard/PisellRecordBoard.js +5 -1
  90. package/lib/components/pisellRecordBoard/index.d.ts +1 -0
  91. package/lib/components/pisellRecordBoard/index.js +5 -2
  92. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.d.ts +1 -0
  93. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +13 -5
  94. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/recordBoardToolbar.less +23 -0
  95. package/lib/components/pisellRecordBoard/shellFrame/index.d.ts +2 -0
  96. package/lib/components/pisellRecordBoard/shellFrame/index.js +11 -4
  97. package/lib/components/pisellRecordBoard/shellFrame/shellFrameFloorMap.less +25 -0
  98. package/lib/components/pisellRecordBoard/types.d.ts +6 -0
  99. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.js +2 -1
  100. package/lib/components/pisellReservationScheduleBand/PisellReservationScheduleBand.less +18 -1
  101. package/lib/components/pisellReservationScheduleBand/types.d.ts +4 -0
  102. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +177 -12
  103. package/lib/components/pisellTimeNavigator/PisellTimeNavigator.less +11 -0
  104. package/lib/components/pisellTimeNavigator/types.d.ts +11 -0
  105. package/lib/index.d.ts +2 -2
  106. package/lib/index.js +10 -0
  107. package/lowcode/floor-map-image-element/meta.ts +113 -0
  108. package/lowcode/floor-map-layout-provider/meta.ts +1 -1
  109. package/lowcode/pisell-floor-map-layout/meta.ts +37 -1
  110. package/lowcode/render-figma-style-round-table-card/meta.ts +1 -1
  111. package/lowcode/render-figma-style-table-card/meta.ts +1 -1
  112. package/package.json +3 -3
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 平面视图:工具栏常仅一行(ScheduleBand),去掉 GridPro 默认底内边距。
3
+ * 不用仅依赖 #body:Story/本地预览可能没有 id=body,低代码若再包一层 #body 会导致双前缀失效。
4
+ * !important:确保晚于 @pisellGridPro/ToolBar 中单类 .pisell-grid-pro-toolbar 的 padding-bottom。
5
+ */
6
+ .pisell-grid-pro-toolbar.pisell-record-board-toolbar--floor-map {
7
+ padding-bottom: 0 !important;
8
+ }
9
+
10
+ #body .pisell-grid-pro-toolbar.pisell-record-board-toolbar--floor-map {
11
+ padding-bottom: 0 !important;
12
+ }
13
+
14
+ /* 表格态工具栏与内容对齐:左右留白 16;平面图态不加此内边距 */
15
+ .pisell-grid-pro-toolbar.pisell-record-board-toolbar--grid {
16
+ padding-left: 16px;
17
+ padding-right: 16px;
18
+ }
19
+
20
+ #body .pisell-grid-pro-toolbar.pisell-record-board-toolbar--grid {
21
+ padding-left: 16px;
22
+ padding-right: 16px;
23
+ }
@@ -3,6 +3,7 @@ import RecordBoardToolBar from './ToolBar';
3
3
  import RecordBoardBatchActionBar from './BatchActionBar';
4
4
  import RecordBoardPagination from './Pagination';
5
5
  import RecordBoardSearch from './Search';
6
+ import './shellFrameFloorMap.less';
6
7
  import ToolBarReset from './ToolBarReset';
7
8
  import ToolBarQuickFilter from './ToolBarQuickFilter';
8
9
  import RecordBoardFloorMap from './FloorMap';
@@ -18,3 +19,4 @@ declare const RecordBoardShellFrame: React.FC<{
18
19
  }>;
19
20
  export default RecordBoardShellFrame;
20
21
  export { RecordBoardToolBar, RecordBoardBatchActionBar, RecordBoardPagination, RecordBoardSearch, ToolBarReset, ToolBarQuickFilter, RecordBoardFloorMap };
22
+ export { useRecordBoardShellBodyMeta } from './ShellBodyMetaContext';
@@ -14,6 +14,7 @@ import RecordBoardToolBar from "./ToolBar";
14
14
  import RecordBoardBatchActionBar from "./BatchActionBar";
15
15
  import RecordBoardPagination from "./Pagination";
16
16
  import RecordBoardSearch from "./Search";
17
+ import "./shellFrameFloorMap.less";
17
18
  import ToolBarReset from "./ToolBarReset";
18
19
  import ToolBarQuickFilter from "./ToolBarQuickFilter";
19
20
  import RecordBoardFloorMap from "./FloorMap";
@@ -134,12 +135,14 @@ var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
134
135
  return (_ctx$floorMapLayoutCo = ctx.floorMapLayoutContext) !== null && _ctx$floorMapLayoutCo !== void 0 ? _ctx$floorMapLayoutCo : EMPTY_FLOOR_MAP_LAYOUT_CONTEXT;
135
136
  }, [ctx.floorMapLayoutContext]);
136
137
  var floorMapNode = effectiveFloorMapProps && !showGrid ? /*#__PURE__*/React.createElement("div", {
138
+ className: "pisell-record-board-floor-map-viewport",
137
139
  style: {
138
140
  flex: 1,
139
141
  minHeight: 0,
140
142
  display: 'flex',
141
143
  flexDirection: 'column',
142
- overflow: 'hidden'
144
+ overflow: 'hidden',
145
+ position: 'relative'
143
146
  }
144
147
  }, /*#__PURE__*/React.createElement(FloorMapLayoutProvider, {
145
148
  value: floorMapLayoutProviderValue
@@ -156,7 +159,9 @@ var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
156
159
  flex: 1,
157
160
  minHeight: 0
158
161
  }, (_effectiveFloorMapPro3 = effectiveFloorMapProps.style) !== null && _effectiveFloorMapPro3 !== void 0 ? _effectiveFloorMapPro3 : {})
159
- })))) : null;
162
+ }))), ctx.floorMapFooter ? /*#__PURE__*/React.createElement("div", {
163
+ className: "pisell-record-board-floor-map-floating-slot"
164
+ }, ctx.floorMapFooter) : null) : null;
160
165
  var bodyContent = fillHeight ? /*#__PURE__*/React.createElement(React.Fragment, null, showGrid ? /*#__PURE__*/React.createElement(ScrollAreaMeasurer, {
161
166
  onHeight: (_ctx$setScrollAreaHei = ctx === null || ctx === void 0 ? void 0 : ctx.setScrollAreaHeight) !== null && _ctx$setScrollAreaHei !== void 0 ? _ctx$setScrollAreaHei : function () {},
162
167
  autoCalc: ctx === null || ctx === void 0 || (_ctx$childComponentPr = ctx.childComponentProps) === null || _ctx$childComponentPr === void 0 || (_ctx$childComponentPr = _ctx$childComponentPr.grid) === null || _ctx$childComponentPr === void 0 || (_ctx$childComponentPr = _ctx$childComponentPr.scroll) === null || _ctx$childComponentPr === void 0 ? void 0 : _ctx$childComponentPr.autoCalc
@@ -183,4 +188,5 @@ var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
183
188
  };
184
189
  RecordBoardShellFrame.displayName = 'RecordBoard.ShellFrame';
185
190
  export default RecordBoardShellFrame;
186
- export { RecordBoardToolBar, RecordBoardBatchActionBar, RecordBoardPagination, RecordBoardSearch, ToolBarReset, ToolBarQuickFilter, RecordBoardFloorMap };
191
+ export { RecordBoardToolBar, RecordBoardBatchActionBar, RecordBoardPagination, RecordBoardSearch, ToolBarReset, ToolBarQuickFilter, RecordBoardFloorMap };
192
+ export { useRecordBoardShellBodyMeta } from "./ShellBodyMetaContext";
@@ -0,0 +1,25 @@
1
+ /** 平面图区域:画布 + 悬浮层共用,便于底部按钮叠在画布上 */
2
+ .pisell-record-board-floor-map-viewport {
3
+ box-sizing: border-box;
4
+ }
5
+
6
+ /**
7
+ * 画布内底部居中悬浮插槽(如「编辑平面图」)。
8
+ * 容器不接收指针事件,避免挡画布拖拽/缩放;子节点恢复可点。
9
+ */
10
+ .pisell-record-board-floor-map-floating-slot {
11
+ position: absolute;
12
+ left: 0;
13
+ right: 0;
14
+ bottom: 20px;
15
+ display: flex;
16
+ justify-content: center;
17
+ align-items: center;
18
+ pointer-events: none;
19
+ /* 高于 PisellFloorMapLayout 内 ViewControls(20),避免与左下角控件叠次序模糊 */
20
+ z-index: 25;
21
+
22
+ > * {
23
+ pointer-events: auto;
24
+ }
25
+ }
@@ -204,6 +204,10 @@ export interface RecordBoardContextValue {
204
204
  defaultBodyView?: RecordBoardBodyView;
205
205
  /** 挂到 ShellFrame 内 PisellFloorMapLayout,供外部 imperative 调用(如 saveLayout / fitBounds) */
206
206
  floorMapLayoutRef?: Ref<PisellFloorMapLayoutRef | null>;
207
+ /**
208
+ * 平面图视图下叠在画布内的底部居中悬浮区(如「编辑平面图」),不单独占一行 footer。
209
+ */
210
+ floorMapFooter?: ReactNode;
207
211
  }
208
212
  /**
209
213
  * 各 layout 下子组件的可选透传配置(类似 ChildComponentProps)
@@ -370,6 +374,8 @@ export interface RecordBoardProps {
370
374
  bodyViewStorageKey?: string;
371
375
  /** 平面图 Layout 实例 ref,由 ShellFrame 注入 */
372
376
  floorMapLayoutRef?: Ref<PisellFloorMapLayoutRef | null>;
377
+ /** 平面图画布内底部悬浮插槽(如编辑入口),注入 Context 供 ShellFrame 渲染 */
378
+ floorMapFooter?: ReactNode;
373
379
  /** 其他 */
374
380
  [key: string]: any;
375
381
  }
@@ -29,6 +29,7 @@ export function PisellReservationScheduleBand(props) {
29
29
  timeNavigatorProps = props.timeNavigatorProps,
30
30
  scheduleStartSlot = props.scheduleStartSlot,
31
31
  scheduleEndSlot = props.scheduleEndSlot,
32
+ scheduleAfterDateSlot = props.scheduleAfterDateSlot,
32
33
  className = props.className,
33
34
  style = props.style;
34
35
  var isControlled = valueProp !== undefined;
@@ -78,7 +79,9 @@ export function PisellReservationScheduleBand(props) {
78
79
  }, /*#__PURE__*/React.createElement(PisellReservationSchedule, _extends({
79
80
  value: effective.date,
80
81
  onChange: handleDateChange
81
- }, scheduleProps))), /*#__PURE__*/React.createElement("div", {
82
+ }, scheduleProps)), scheduleAfterDateSlot ? /*#__PURE__*/React.createElement("div", {
83
+ className: "pisell-reservation-schedule-band-after-date"
84
+ }, scheduleAfterDateSlot) : null), /*#__PURE__*/React.createElement("div", {
82
85
  className: "pisell-reservation-schedule-band-slot-end"
83
86
  }, scheduleEndSlot)), /*#__PURE__*/React.createElement("div", {
84
87
  className: "pisell-reservation-schedule-band-navigator"
@@ -3,7 +3,7 @@
3
3
  flex-direction: column;
4
4
  align-items: stretch;
5
5
  width: 100%;
6
- gap: 12px;
6
+ gap: 0;
7
7
  box-sizing: border-box;
8
8
  }
9
9
 
@@ -40,7 +40,24 @@
40
40
  justify-self: center;
41
41
  min-width: 0;
42
42
  display: flex;
43
+ flex-direction: row;
44
+ flex-wrap: nowrap;
45
+ align-items: center;
43
46
  justify-content: center;
47
+ gap: 8px;
48
+ }
49
+
50
+ /** 日程组件根节点默认 width:100%,在中间栏会与「日期右侧」插槽分两行;此处收窄为内容宽,保证与 after-date 同一行 */
51
+ .pisell-reservation-schedule-band-schedule > .pisell-reservation-schedule {
52
+ width: auto;
53
+ flex: 0 0 auto;
54
+ min-width: 0;
55
+ }
56
+
57
+ .pisell-reservation-schedule-band-after-date {
58
+ display: flex;
59
+ align-items: center;
60
+ flex-shrink: 0;
44
61
  }
45
62
 
46
63
  .pisell-reservation-schedule-band-navigator {
@@ -40,6 +40,10 @@ export interface PisellReservationScheduleBandProps {
40
40
  * 顶栏日程行:PisellReservationSchedule 右侧自定义内容(如状态、主按钮)
41
41
  */
42
42
  scheduleEndSlot?: ReactNode;
43
+ /**
44
+ * 顶栏日程行:紧挨在选日组件之后(如「跟随当前」),与中间列同一 flex 区
45
+ */
46
+ scheduleAfterDateSlot?: ReactNode;
43
47
  className?: string;
44
48
  style?: CSSProperties;
45
49
  }
@@ -4,6 +4,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
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
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
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
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
12
  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."); }
9
13
  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); }
@@ -32,6 +36,8 @@ var CURSOR_MOVES_NOW_RESERVE_PX = 56;
32
36
  var CURSOR_MOVES_H_PADDING_PX = 8;
33
37
  /** cursor-moves 横向:每格最小宽度(再小刻度不可读) */
34
38
  var CURSOR_MOVES_MIN_CELL_PX = 8;
39
+ /** 密度层高度:时间轴 48px 内留少量上下边距 */
40
+ var DENSITY_LAYER_HEIGHT = 46;
35
41
 
36
42
  /**
37
43
  * PisellTimeNavigator:可拖动的时间导航轴,时间范围内浏览、选择、控制
@@ -74,7 +80,9 @@ export function PisellTimeNavigator(props) {
74
80
  _props$timeFormat = props.timeFormat,
75
81
  timeFormat = _props$timeFormat === void 0 ? 'HH:mm' : _props$timeFormat,
76
82
  renderNowButton = props.renderNowButton,
77
- onUserInteraction = props.onUserInteraction;
83
+ onUserInteraction = props.onUserInteraction,
84
+ densitySeriesProp = props.densitySeries,
85
+ loadDensityProp = props.loadDensity;
78
86
  var context = useEngineContext();
79
87
  locales.init(pisellTimeNavigatorLocales, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
80
88
 
@@ -88,14 +96,53 @@ export function PisellTimeNavigator(props) {
88
96
  }, [referenceDateProp]);
89
97
  var referenceDate = referenceDateFromProp !== null && referenceDateFromProp !== void 0 ? referenceDateFromProp : dayjs().startOf('day');
90
98
  var isHorizontal = orientation === 'horizontal';
99
+
100
+ /** 按自然日稳定依赖,避免无 referenceDate prop 时每次 render 新建 dayjs 触发重复 loadDensity */
101
+ var referenceDayKey = referenceDateFromProp != null ? referenceDateFromProp.format('YYYY-MM-DD') : dayjs().format('YYYY-MM-DD');
102
+ var _useState = useState(),
103
+ _useState2 = _slicedToArray(_useState, 2),
104
+ densityLoaded = _useState2[0],
105
+ setDensityLoaded = _useState2[1];
106
+ var densityReqId = useRef(0);
107
+ var densityGradientId = useMemo(function () {
108
+ return "pisell-time-density-fill-".concat(Math.random().toString(36).slice(2, 8));
109
+ }, []);
110
+ useEffect(function () {
111
+ if (densitySeriesProp !== undefined) {
112
+ setDensityLoaded(undefined);
113
+ return;
114
+ }
115
+ if (!loadDensityProp) {
116
+ setDensityLoaded(undefined);
117
+ return;
118
+ }
119
+ var req = ++densityReqId.current;
120
+ var cancelled = false;
121
+ setDensityLoaded(undefined);
122
+ var refDay = dayjs(referenceDayKey).startOf('day');
123
+ void loadDensityProp({
124
+ referenceDate: refDay,
125
+ stepMinutes: stepMinutes
126
+ }).then(function (arr) {
127
+ if (cancelled || req !== densityReqId.current) return;
128
+ setDensityLoaded(Array.isArray(arr) ? arr : []);
129
+ }).catch(function () {
130
+ if (cancelled || req !== densityReqId.current) return;
131
+ setDensityLoaded(undefined);
132
+ });
133
+ return function () {
134
+ cancelled = true;
135
+ };
136
+ }, [referenceDayKey, stepMinutes, loadDensityProp, densitySeriesProp]);
137
+ var resolvedDensity = densitySeriesProp !== undefined ? densitySeriesProp : densityLoaded;
91
138
  var isAxisMoves = cursorMode === 'axis-moves';
92
- var _useState = useState({
139
+ var _useState3 = useState({
93
140
  w: 0,
94
141
  h: 0
95
142
  }),
96
- _useState2 = _slicedToArray(_useState, 2),
97
- viewportSize = _useState2[0],
98
- setViewportSize = _useState2[1];
143
+ _useState4 = _slicedToArray(_useState3, 2),
144
+ viewportSize = _useState4[0],
145
+ setViewportSize = _useState4[1];
99
146
 
100
147
  /** 挂载和视口变化时同步尺寸(需在 cellSize 计算之前声明 state) */
101
148
  var viewportWrapRef = useRef(null);
@@ -142,14 +189,54 @@ export function PisellTimeNavigator(props) {
142
189
  orientation: orientation,
143
190
  cellSizePx: cellSizePx
144
191
  });
192
+ var horizontalDensityCurve = useMemo(function () {
193
+ if (!isHorizontal || !(resolvedDensity !== null && resolvedDensity !== void 0 && resolvedDensity.length)) return null;
194
+ var ticksN = axis.ticks.length;
195
+ var n = Math.min(resolvedDensity.length, ticksN);
196
+ if (n < 2) return null;
197
+ var slice = resolvedDensity.slice(0, n);
198
+ var maxV = Math.max.apply(Math, _toConsumableArray(slice).concat([0]));
199
+ var minV = Math.min.apply(Math, _toConsumableArray(slice).concat([0]));
200
+ var span = Math.max(1, maxV - minV);
201
+ var h = DENSITY_LAYER_HEIGHT;
202
+ var points = slice.map(function (v, i) {
203
+ var x = i * cellSizePx + cellSizePx / 2;
204
+ /** 映射到 [0,1]:最低值贴底,最高值接近顶部,基本吃满密度层高度 */
205
+ var t = (v - minV) / span;
206
+ var y = h - 1 - t * (h - 3);
207
+ return {
208
+ x: x,
209
+ y: y
210
+ };
211
+ });
212
+ var first = points[0];
213
+ var last = points[points.length - 1];
214
+ var linePath = "M ".concat(first.x, " ").concat(first.y);
215
+ for (var i = 0; i < points.length - 1; i += 1) {
216
+ var p0 = points[i];
217
+ var p1 = points[i + 1];
218
+ var cx = (p0.x + p1.x) / 2;
219
+ var cy = (p0.y + p1.y) / 2;
220
+ linePath += " Q ".concat(p0.x, " ").concat(p0.y, " ").concat(cx, " ").concat(cy);
221
+ }
222
+ linePath += " T ".concat(last.x, " ").concat(last.y);
223
+ var areaPath = "".concat(linePath, " L ").concat(last.x, " ").concat(h, " L ").concat(first.x, " ").concat(h, " Z");
224
+ return {
225
+ points: points,
226
+ linePath: linePath,
227
+ areaPath: areaPath,
228
+ h: h,
229
+ w: axis.totalLengthPx
230
+ };
231
+ }, [isHorizontal, resolvedDensity, axis.ticks, axis.totalLengthPx, cellSizePx]);
145
232
  var isControlled = valueProp !== undefined;
146
- var _useState3 = useState(function () {
233
+ var _useState5 = useState(function () {
147
234
  var v = valueProp !== null && valueProp !== void 0 ? valueProp : defaultValue;
148
235
  return parseValue(v, referenceDate);
149
236
  }),
150
- _useState4 = _slicedToArray(_useState3, 2),
151
- internalValue = _useState4[0],
152
- setInternalValue = _useState4[1];
237
+ _useState6 = _slicedToArray(_useState5, 2),
238
+ internalValue = _useState6[0],
239
+ setInternalValue = _useState6[1];
153
240
  var value = isControlled ? valueProp != null ? parseValue(valueProp, referenceDate) : null : internalValue;
154
241
  var effectiveValue = value !== null && value !== void 0 ? value : axis.rangeStart;
155
242
  var scrollRef = useRef(null);
@@ -159,17 +246,17 @@ export function PisellTimeNavigator(props) {
159
246
  var valueUpdatedByScrollRef = useRef(false);
160
247
  /** 手指是否仍按在滚动区域上;仅当完全松手后才执行吸附 */
161
248
  var isPointerDownRef = useRef(false);
162
- var _useState5 = useState({
249
+ var _useState7 = useState({
163
250
  scrollLeft: 0,
164
251
  scrollTop: 0
165
252
  }),
166
- _useState6 = _slicedToArray(_useState5, 2),
167
- scrollPosition = _useState6[0],
168
- setScrollPosition = _useState6[1];
169
- /** 每分钟更新一次,使当前时间线/渐变块随真实时间移动 */
170
- var _useState7 = useState(0),
171
253
  _useState8 = _slicedToArray(_useState7, 2),
172
- setNowTick = _useState8[1];
254
+ scrollPosition = _useState8[0],
255
+ setScrollPosition = _useState8[1];
256
+ /** 每分钟更新一次,使当前时间线/渐变块随真实时间移动 */
257
+ var _useState9 = useState(0),
258
+ _useState10 = _slicedToArray(_useState9, 2),
259
+ setNowTick = _useState10[1];
173
260
  useEffect(function () {
174
261
  var id = setInterval(function () {
175
262
  return setNowTick(function (n) {
@@ -208,6 +295,43 @@ export function PisellTimeNavigator(props) {
208
295
  var axisStartMarginW = isHorizontal && !isAxisMoves ? CURSOR_MOVES_H_PADDING_PX : Math.max(0, halfViewportW - dotOffsetPx);
209
296
  var axisStartMarginH = Math.max(0, halfViewportH - dotOffsetPx);
210
297
 
298
+ /**
299
+ * 横向 axis-wrap:无 Now 时用 width:100% + minWidth:自然内容宽,铺满滚动视口;内容更长时仍可横向滚动。
300
+ * 依赖 effectiveViewportW(须在 viewportSize 之后计算)。
301
+ */
302
+ var horizontalAxisWrapStyle = useMemo(function () {
303
+ if (!isHorizontal) return null;
304
+ var minHeight = 48;
305
+ if (isAxisMoves) {
306
+ var _natural = axis.totalLengthPx + (effectiveViewportW - cellSizePx);
307
+ if (!showNowButton) {
308
+ return {
309
+ width: '100%',
310
+ minWidth: _natural,
311
+ minHeight: minHeight,
312
+ boxSizing: 'border-box'
313
+ };
314
+ }
315
+ return {
316
+ width: _natural,
317
+ minHeight: minHeight
318
+ };
319
+ }
320
+ var natural = CURSOR_MOVES_H_PADDING_PX + axis.totalLengthPx + CURSOR_MOVES_H_PADDING_PX;
321
+ if (!showNowButton) {
322
+ return {
323
+ width: '100%',
324
+ minWidth: natural,
325
+ minHeight: minHeight,
326
+ boxSizing: 'border-box'
327
+ };
328
+ }
329
+ return {
330
+ width: natural,
331
+ minHeight: minHeight
332
+ };
333
+ }, [isHorizontal, isAxisMoves, axis.totalLengthPx, effectiveViewportW, cellSizePx, showNowButton]);
334
+
211
335
  /** 拖动中:用连续映射按 1 分钟步长显示时间(不吸附到 stepMinutes) */
212
336
  var handleScroll = useCallback(function (data) {
213
337
  /** 程序性滚动到中心(如点 Now)过程中不更新任何状态,避免时间轴再动、value 被覆盖 */
@@ -519,11 +643,7 @@ export function PisellTimeNavigator(props) {
519
643
  onPointerLeave: inertiaHandlers.onPointerUp
520
644
  }, /*#__PURE__*/React.createElement("div", {
521
645
  className: "pisell-time-navigator-axis-wrap",
522
- style: isHorizontal ? isAxisMoves ? {
523
- width: axis.totalLengthPx + (effectiveViewportW - cellSizePx),
524
- minHeight: 48
525
- } : {
526
- width: CURSOR_MOVES_H_PADDING_PX + axis.totalLengthPx + CURSOR_MOVES_H_PADDING_PX,
646
+ style: isHorizontal ? horizontalAxisWrapStyle !== null && horizontalAxisWrapStyle !== void 0 ? horizontalAxisWrapStyle : {
527
647
  minHeight: 48
528
648
  } : {
529
649
  width: '100%'
@@ -555,7 +675,45 @@ export function PisellTimeNavigator(props) {
555
675
  orientation: orientation,
556
676
  pastTimeFade: pastTimeFade,
557
677
  businessHoursPx: businessHoursPx
558
- }), /*#__PURE__*/React.createElement(ScaleLayer, {
678
+ }), horizontalDensityCurve ? /*#__PURE__*/React.createElement("svg", {
679
+ className: "pisell-time-navigator-density-layer",
680
+ width: horizontalDensityCurve.w,
681
+ height: horizontalDensityCurve.h,
682
+ viewBox: "0 0 ".concat(horizontalDensityCurve.w, " ").concat(horizontalDensityCurve.h),
683
+ preserveAspectRatio: "none",
684
+ "aria-hidden": true
685
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
686
+ id: densityGradientId,
687
+ x1: "0",
688
+ y1: "0",
689
+ x2: "0",
690
+ y2: "1"
691
+ }, /*#__PURE__*/React.createElement("stop", {
692
+ offset: "0%",
693
+ stopColor: "#ff9c66",
694
+ stopOpacity: "0.32"
695
+ }), /*#__PURE__*/React.createElement("stop", {
696
+ offset: "100%",
697
+ stopColor: "#ff9c66",
698
+ stopOpacity: "0.02"
699
+ }))), /*#__PURE__*/React.createElement("path", {
700
+ d: horizontalDensityCurve.areaPath,
701
+ fill: "url(#".concat(densityGradientId, ")")
702
+ }), /*#__PURE__*/React.createElement("path", {
703
+ d: horizontalDensityCurve.linePath,
704
+ fill: "none",
705
+ stroke: "#ff8a4a",
706
+ strokeWidth: 1.8,
707
+ vectorEffect: "non-scaling-stroke"
708
+ }), horizontalDensityCurve.points.map(function (p, i) {
709
+ return /*#__PURE__*/React.createElement("circle", {
710
+ key: i,
711
+ cx: p.x,
712
+ cy: p.y,
713
+ r: 1.4,
714
+ fill: "#ff8a4a"
715
+ });
716
+ })) : null, /*#__PURE__*/React.createElement(ScaleLayer, {
559
717
  orientation: orientation,
560
718
  ticks: axis.ticks,
561
719
  stepMinutes: stepMinutes,
@@ -128,6 +128,15 @@
128
128
  flex-shrink: 0;
129
129
  }
130
130
 
131
+ .pisell-time-navigator-density-layer {
132
+ position: absolute;
133
+ left: 0;
134
+ top: 1px;
135
+ z-index: 0;
136
+ pointer-events: none;
137
+ overflow: visible;
138
+ }
139
+
131
140
  /* 背景层(营业时间、过去时间淡化等;当前时间渐变已拆出为独立块) */
132
141
  .pisell-time-navigator-background {
133
142
  position: absolute;
@@ -369,6 +378,8 @@
369
378
 
370
379
  &--horizontal {
371
380
  height: 100%;
381
+ width: 100%;
382
+ box-sizing: border-box;
372
383
  }
373
384
 
374
385
  &--vertical {
@@ -10,10 +10,10 @@ import classNames from 'classnames';
10
10
  var CURSOR_LINE_WIDTH_H = 3;
11
11
  var CURSOR_LINE_HEIGHT_V = 2;
12
12
 
13
- /**
14
- * 时间指示器层:竖线/横线 + 时间气泡
15
- * 对齐基准为内部的竖线/横线,不是整块(气泡)的边或中心。
16
- * 横向:竖线 3px;竖向:横线 2px。Realtime 态 #FF692E,浏览态 #344054
13
+ /**
14
+ * 时间指示器层:竖线/横线 + 时间气泡
15
+ * 对齐基准为内部的竖线/横线,不是整块(气泡)的边或中心。
16
+ * 横向:竖线 3px;竖向:横线 2px。Realtime 态 #FF692E,浏览态 #344054
17
17
  */
18
18
  export function CursorLayer(_ref) {
19
19
  var orientation = _ref.orientation,
@@ -6,9 +6,9 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
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
7
  import React from 'react';
8
8
  import classNames from 'classnames';
9
- /**
10
- * 刻度层:渲染时间刻度与标签
11
- * 横向:整点数字 + 小圆点;竖向:整点/半点数字 + 分割线
9
+ /**
10
+ * 刻度层:渲染时间刻度与标签
11
+ * 横向:整点数字 + 小圆点;竖向:整点/半点数字 + 分割线
12
12
  */
13
13
  export function ScaleLayer(_ref) {
14
14
  var orientation = _ref.orientation,
@@ -142,6 +142,17 @@ export interface PisellTimeNavigatorProps {
142
142
  * 自定义 Now 按钮内容(覆盖默认文案与图标时使用)
143
143
  */
144
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[]>;
145
156
  /**
146
157
  * 用户开始操作时间轴(拖轴、点刻度、键盘、拖指针等)时回调;用于上层关闭「跟随当前」等。
147
158
  */
@@ -1,4 +1,4 @@
1
1
  declare type ResponsiveConfig = Record<string, number>;
2
2
  export declare function configResponsive(config: ResponsiveConfig): void;
3
- export default function useResponsive(): "pc" | "ipad" | "phone";
3
+ export default function useResponsive(): "phone" | "pc" | "ipad";
4
4
  export {};
package/es/index.d.ts CHANGED
@@ -129,7 +129,7 @@ export { default as PisellRow } from './components/pisellRow';
129
129
  export { default as Div } from './components/div';
130
130
  export { default as PisellBasicGrid } from './components/PisellBasicGrid';
131
131
  export { default as PisellScrollView } from './components/PisellScrollView';
132
- export { PisellFloorMapLayout, FloorMapLayoutProvider, useFloorMapLayoutContext, EMPTY_FLOOR_MAP_LAYOUT_CONTEXT, mergeFloorMapLayoutPropsFromContext, getFigmaTableCardFromMerged, renderFigmaStyleTableCard, renderFigmaStyleRoundTableCard, getRenderItemByKindTable, getRenderItemByKindRoundTable, } from './components/pisellFloorMapLayout';
132
+ export { PisellFloorMapLayout, FloorMapLayoutProvider, useFloorMapLayoutContext, EMPTY_FLOOR_MAP_LAYOUT_CONTEXT, mergeFloorMapLayoutPropsFromContext, getFigmaTableCardFromMerged, renderFigmaStyleTableCard, renderFigmaStyleRoundTableCard, getRenderItemByKindTable, getRenderItemByKindRoundTable, FloorMapImageElement, FLOOR_MAP_IMAGE_ELEMENT_KIND, renderFloorMapFallbackPlaceholder, isFloorMapImageElementKind, } from './components/pisellFloorMapLayout';
133
133
  export type { FloorMapViewConfig, FloorMapSceneElement, FloorMapCanvasNameI18n, FloorMapMergedItem, FloorMapDataSources, FloorMapItemBase, FloorMapRenderOptions, } from './components/pisellFloorMapLayout';
134
134
  /** PisellLayouts 命名空间另含 PisellFloorMapLayoutProps 等;平面图场景细粒度类型见上方 */
135
135
  export { default as PisellViewGrid } from './components/pisellViewGrid';
@@ -141,7 +141,7 @@ export type { ToolBarProps } from './components/pisellGridPro/ToolBar';
141
141
  export { default as PisellGridPro } from './components/pisellGridPro';
142
142
  export type { GridProProps } from './components/pisellGridPro';
143
143
  export { default as RecordView } from './components/record-view';
144
- export { default as PisellRecordBoard, useRecordBoardContext, } from './components/pisellRecordBoard';
144
+ export { default as PisellRecordBoard, useRecordBoardContext, useRecordBoardShellBodyMeta } from './components/pisellRecordBoard';
145
145
  export type { RecordBoardProps, RecordBoardLayoutType, RecordBoardContextValue, RecordBoardChildComponentProps, RecordBoardGridProps, RecordBoardColumnType, RecordBoardFieldType, RecordBoardColumnFilterConfig, RecordBoardOptionItem, RecordBoardGetOptions, RecordBoardBodyView, RecordBoardFloorMapProps, RecordBoardToolBarProps, } from './components/pisellRecordBoard';
146
146
  export { PisellShellFrame } from './components/pisellShellFrame';
147
147
  export type { PisellShellFrameProps, PisellShellFrameConfig, PisellShellFrameScrollConfig, } from './components/pisellShellFrame';
package/es/index.js CHANGED
@@ -134,7 +134,7 @@ export { default as Div } from "./components/div";
134
134
  export { default as PisellBasicGrid } from "./components/PisellBasicGrid";
135
135
  // 类型已在 PisellLayouts 命名空间中导出
136
136
  export { default as PisellScrollView } from "./components/PisellScrollView";
137
- export { PisellFloorMapLayout, FloorMapLayoutProvider, useFloorMapLayoutContext, EMPTY_FLOOR_MAP_LAYOUT_CONTEXT, mergeFloorMapLayoutPropsFromContext, getFigmaTableCardFromMerged, renderFigmaStyleTableCard, renderFigmaStyleRoundTableCard, getRenderItemByKindTable, getRenderItemByKindRoundTable } from "./components/pisellFloorMapLayout";
137
+ export { PisellFloorMapLayout, FloorMapLayoutProvider, useFloorMapLayoutContext, EMPTY_FLOOR_MAP_LAYOUT_CONTEXT, mergeFloorMapLayoutPropsFromContext, getFigmaTableCardFromMerged, renderFigmaStyleTableCard, renderFigmaStyleRoundTableCard, getRenderItemByKindTable, getRenderItemByKindRoundTable, FloorMapImageElement, FLOOR_MAP_IMAGE_ELEMENT_KIND, renderFloorMapFallbackPlaceholder, isFloorMapImageElementKind } from "./components/pisellFloorMapLayout";
138
138
  /** PisellLayouts 命名空间另含 PisellFloorMapLayoutProps 等;平面图场景细粒度类型见上方 */
139
139
  export { default as PisellViewGrid } from "./components/pisellViewGrid";
140
140
 
@@ -145,7 +145,7 @@ export { default as PisellGridView } from "./components/pisellGridPro/GridView";
145
145
  export { default as PisellToolBar } from "./components/pisellGridPro/ToolBar";
146
146
  export { default as PisellGridPro } from "./components/pisellGridPro";
147
147
  export { default as RecordView } from "./components/record-view";
148
- export { default as PisellRecordBoard, useRecordBoardContext } from "./components/pisellRecordBoard";
148
+ export { default as PisellRecordBoard, useRecordBoardContext, useRecordBoardShellBodyMeta } from "./components/pisellRecordBoard";
149
149
  export { PisellShellFrame } from "./components/pisellShellFrame";
150
150
  // ==================== 表单组件 (Form) ====================
151
151
  // 表单及表单项组件