@pisell/materials 1.8.31 → 1.8.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/Pagination/index.d.ts +2 -1
- package/es/components/Pagination/index.js +58 -24
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +201 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +4 -2
- package/es/components/dataSourceComponents/fields/index.d.ts +13 -12
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/es/components/pisellFloorMapLayout/PisellFloorMapLayout.js +3 -1
- package/es/components/pisellFloorMapLayout/components/ItemLayer.d.ts +4 -0
- package/es/components/pisellFloorMapLayout/components/ItemLayer.js +9 -4
- package/es/components/pisellFloorMapLayout/components/ItemLayer.less +9 -2
- package/es/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +74 -23
- package/es/components/pisellFloorMapLayout/types.d.ts +5 -0
- package/es/components/pisellRecordBoard/PisellRecordBoard.js +14 -6
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +193 -9
- package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +31 -0
- package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +6 -3
- package/es/components/pisellRecordBoard/shellFrame/index.js +4 -1
- package/es/components/pisellRecordBoard/types.d.ts +9 -0
- package/es/components/pisellTimeNavigator/PisellTimeNavigator.js +13 -1
- package/es/locales/en-US.d.ts +4 -1
- package/es/locales/en-US.js +5 -2
- package/es/locales/ja.d.ts +3 -0
- package/es/locales/ja.js +3 -0
- package/es/locales/pt.d.ts +3 -0
- package/es/locales/pt.js +3 -0
- package/es/locales/zh-CN.d.ts +4 -1
- package/es/locales/zh-CN.js +5 -2
- package/es/locales/zh-TW.d.ts +4 -1
- package/es/locales/zh-TW.js +5 -2
- package/es/pisell-materials.tw.css +1 -1
- package/lib/components/Pagination/index.d.ts +2 -1
- package/lib/components/Pagination/index.js +50 -7
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +201 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +4 -2
- package/lib/components/dataSourceComponents/fields/index.d.ts +13 -12
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/lib/components/pisellFloorMapLayout/PisellFloorMapLayout.js +3 -1
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.d.ts +4 -0
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.js +8 -3
- package/lib/components/pisellFloorMapLayout/components/ItemLayer.less +9 -2
- package/lib/components/pisellFloorMapLayout/hooks/useFloorMapTransformMetrics.js +53 -18
- package/lib/components/pisellFloorMapLayout/types.d.ts +5 -0
- package/lib/components/pisellRecordBoard/PisellRecordBoard.js +16 -6
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +189 -32
- package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +31 -0
- package/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js +99 -96
- package/lib/components/pisellRecordBoard/shellFrame/index.js +2 -1
- package/lib/components/pisellRecordBoard/types.d.ts +9 -0
- package/lib/components/pisellTimeNavigator/PisellTimeNavigator.js +9 -1
- package/lib/locales/en-US.d.ts +4 -1
- package/lib/locales/en-US.js +4 -1
- package/lib/locales/ja.d.ts +3 -0
- package/lib/locales/ja.js +3 -0
- package/lib/locales/pt.d.ts +3 -0
- package/lib/locales/pt.js +3 -0
- package/lib/locales/zh-CN.d.ts +4 -1
- package/lib/locales/zh-CN.js +4 -1
- package/lib/locales/zh-TW.d.ts +4 -1
- package/lib/locales/zh-TW.js +4 -1
- package/lib/pisell-materials.tw.css +1 -1
- package/lowcode/pisell-record-board-calendar-view/meta.ts +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,12 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } fr
|
|
|
17
17
|
import { getContentSize, getPixelBoundingBox } from "../utils/layoutMeasurements";
|
|
18
18
|
import { DEFAULT_BOUNDING_PADDING, FIT_BOUNDS_MATCH_POS_EPSILON, FIT_BOUNDS_MATCH_SCALE_EPSILON, VIEWPORT_PERSIST_DEBOUNCE_MS, VIEWPORT_TOP_LEFT_MARGIN, readPersistedViewport, readPersistedViewportLock, writePersistedViewport, writePersistedViewportLock } from "./floorMapViewportPersistence";
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* react-zoom-pan-pinch:`setTransform` 未显式传 `animationTime` 时默认约 200ms 缓动;
|
|
22
|
+
* 兜底清除「全览激活保持」略大于该值,避免极少数帧未到容差时限位不解除。
|
|
23
|
+
*/
|
|
24
|
+
var FIT_BOUNDS_PROGRAMMATIC_TWEEN_GUARD_MS = 400;
|
|
25
|
+
|
|
20
26
|
/** react-zoom-pan-pinch TransformWrapper render 注入的上下文 */
|
|
21
27
|
|
|
22
28
|
export function useFloorMapTransformMetrics(params) {
|
|
@@ -116,6 +122,20 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
116
122
|
isAtFitBounds = _useState10[0],
|
|
117
123
|
setIsAtFitBounds = _useState10[1];
|
|
118
124
|
|
|
125
|
+
/**
|
|
126
|
+
* 程序化 fitBounds 使用库默认缓动时,`onTransformed` 中间帧与快照不等会关掉「全览」激活态。
|
|
127
|
+
* 缓动持有期内不按中间帧降级,仅在到达快照(容差内)或兜底超时后再按真实 transform 对齐。
|
|
128
|
+
*/
|
|
129
|
+
var fitBoundsTweenHoldRef = useRef(false);
|
|
130
|
+
var fitBoundsTweenHoldClearTimerRef = useRef(null);
|
|
131
|
+
var clearFitBoundsTweenHold = useCallback(function () {
|
|
132
|
+
if (fitBoundsTweenHoldClearTimerRef.current != null) {
|
|
133
|
+
clearTimeout(fitBoundsTweenHoldClearTimerRef.current);
|
|
134
|
+
fitBoundsTweenHoldClearTimerRef.current = null;
|
|
135
|
+
}
|
|
136
|
+
fitBoundsTweenHoldRef.current = false;
|
|
137
|
+
}, []);
|
|
138
|
+
|
|
119
139
|
/**
|
|
120
140
|
* 视口锁定态:按 viewportPersistKey 维度持久化到 localStorage。
|
|
121
141
|
* - 切 / 挂载时按 key 读初始值;
|
|
@@ -302,7 +322,37 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
302
322
|
var wrapper = container.querySelector('.react-transform-wrapper');
|
|
303
323
|
if (!wrapper) return false;
|
|
304
324
|
var wrapperRect = wrapper.getBoundingClientRect();
|
|
305
|
-
|
|
325
|
+
var wEl = wrapper;
|
|
326
|
+
/**
|
|
327
|
+
* 祖先链上若有 transform: scale / zoom,getBoundingClientRect 为「视觉」尺寸,
|
|
328
|
+
* clientWidth/Height 为布局盒尺寸。react-zoom-pan-pinch 的平移/缩放工作在布局坐标系,
|
|
329
|
+
* 若全览仅用 rect 算 avail 与 position,会与库内部不一致(日志:visual/layout≈0.864)。
|
|
330
|
+
*/
|
|
331
|
+
var layoutW = wEl.clientWidth > 0 ? wEl.clientWidth : wrapperRect.width;
|
|
332
|
+
var layoutH = wEl.clientHeight > 0 ? wEl.clientHeight : wrapperRect.height;
|
|
333
|
+
if (layoutW <= 0 || layoutH <= 0) return false;
|
|
334
|
+
|
|
335
|
+
/** 程序化 setTransform 默认带缓动:写入快照后立即保持「全览激活」,缓动结束前不因中间帧关掉 */
|
|
336
|
+
var applyProgrammaticFit = function applyProgrammaticFit(fx, fy, fScale) {
|
|
337
|
+
clearFitBoundsTweenHold();
|
|
338
|
+
lastFitSnapshotRef.current = {
|
|
339
|
+
x: fx,
|
|
340
|
+
y: fy,
|
|
341
|
+
scale: fScale
|
|
342
|
+
};
|
|
343
|
+
setIsAtFitBounds(true);
|
|
344
|
+
fitBoundsTweenHoldRef.current = true;
|
|
345
|
+
fitBoundsTweenHoldClearTimerRef.current = setTimeout(function () {
|
|
346
|
+
fitBoundsTweenHoldClearTimerRef.current = null;
|
|
347
|
+
fitBoundsTweenHoldRef.current = false;
|
|
348
|
+
var cur = lastTransformRef.current;
|
|
349
|
+
var s = lastFitSnapshotRef.current;
|
|
350
|
+
if (!s) return;
|
|
351
|
+
var same = Math.abs(s.x - cur.x) < FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(s.y - cur.y) < FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(s.scale - cur.scale) < FIT_BOUNDS_MATCH_SCALE_EPSILON;
|
|
352
|
+
setIsAtFitBounds(same);
|
|
353
|
+
}, FIT_BOUNDS_PROGRAMMATIC_TWEEN_GUARD_MS);
|
|
354
|
+
ctx.setTransform(fx, fy, fScale);
|
|
355
|
+
};
|
|
306
356
|
|
|
307
357
|
/**
|
|
308
358
|
* 平面图像素模式:按「图元轴对齐包围盒」缩放并居中,不按整块 content(含编辑态撑满视口的空白)适配。
|
|
@@ -314,40 +364,28 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
314
364
|
var bw = Math.max(1, pixelBox.maxRight - pixelBox.minLeft);
|
|
315
365
|
var bh = Math.max(1, pixelBox.maxBottom - pixelBox.minTop);
|
|
316
366
|
var edgePx = 0;
|
|
317
|
-
var availW = Math.max(1,
|
|
318
|
-
var availH = Math.max(1,
|
|
367
|
+
var availW = Math.max(1, layoutW - 2 * edgePx);
|
|
368
|
+
var availH = Math.max(1, layoutH - 2 * edgePx);
|
|
319
369
|
var _raw = Math.min(availW / bw, availH / bh);
|
|
320
370
|
var _nextScale = Math.min(_raw, (_zoom$max2 = zoom.max) !== null && _zoom$max2 !== void 0 ? _zoom$max2 : 2);
|
|
321
371
|
var ap = alignPadSingle !== null && alignPadSingle !== void 0 ? alignPadSingle : padSingle;
|
|
322
372
|
var bboxCx = ap + bw / 2;
|
|
323
373
|
var bboxCy = ap + bh / 2;
|
|
324
|
-
var _x =
|
|
325
|
-
var _y =
|
|
326
|
-
|
|
327
|
-
lastFitSnapshotRef.current = {
|
|
328
|
-
x: _x,
|
|
329
|
-
y: _y,
|
|
330
|
-
scale: _nextScale
|
|
331
|
-
};
|
|
332
|
-
setIsAtFitBounds(true);
|
|
374
|
+
var _x = layoutW / 2 - bboxCx * _nextScale;
|
|
375
|
+
var _y = layoutH / 2 - bboxCy * _nextScale;
|
|
376
|
+
applyProgrammaticFit(_x, _y, _nextScale);
|
|
333
377
|
return true;
|
|
334
378
|
}
|
|
335
379
|
if (contentWidth <= 0 || contentHeight <= 0) return false;
|
|
336
380
|
/** 非平面图或无图元:仍按整块 content 适配 */
|
|
337
|
-
var raw = Math.min(
|
|
381
|
+
var raw = Math.min(layoutW / contentWidth, layoutH / contentHeight);
|
|
338
382
|
var nextScale = Math.min(raw, (_zoom$max3 = zoom.max) !== null && _zoom$max3 !== void 0 ? _zoom$max3 : 2);
|
|
339
383
|
var padA = alignPadSingle !== null && alignPadSingle !== void 0 ? alignPadSingle : 0;
|
|
340
384
|
var x = VIEWPORT_TOP_LEFT_MARGIN - padA * nextScale;
|
|
341
385
|
var y = VIEWPORT_TOP_LEFT_MARGIN - padA * nextScale;
|
|
342
|
-
|
|
343
|
-
lastFitSnapshotRef.current = {
|
|
344
|
-
x: x,
|
|
345
|
-
y: y,
|
|
346
|
-
scale: nextScale
|
|
347
|
-
};
|
|
348
|
-
setIsAtFitBounds(true);
|
|
386
|
+
applyProgrammaticFit(x, y, nextScale);
|
|
349
387
|
return true;
|
|
350
|
-
}, [contentWidth, contentHeight, zoom
|
|
388
|
+
}, [clearFitBoundsTweenHold, contentWidth, contentHeight, zoom, transformRef, alignPadSingle, isFloorMapView, effectiveItemUnit, items, cellSize, padSingle]);
|
|
351
389
|
|
|
352
390
|
/** 让"进入伪全屏后自动 fit"的 effect 能拿到最新的 fitBounds 实现 */
|
|
353
391
|
fitBoundsRef.current = fitBounds;
|
|
@@ -528,6 +566,14 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
528
566
|
var snap = lastFitSnapshotRef.current;
|
|
529
567
|
if (snap) {
|
|
530
568
|
var same = Math.abs(snap.x - x) < FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(snap.y - y) < FIT_BOUNDS_MATCH_POS_EPSILON && Math.abs(snap.scale - nextScale) < FIT_BOUNDS_MATCH_SCALE_EPSILON;
|
|
569
|
+
if (fitBoundsTweenHoldRef.current) {
|
|
570
|
+
if (same) {
|
|
571
|
+
clearFitBoundsTweenHold();
|
|
572
|
+
setIsAtFitBounds(true);
|
|
573
|
+
}
|
|
574
|
+
/** 缓动中间帧:保持已设的「全览激活」,不因尚未对齐快照而关掉 */
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
531
577
|
setIsAtFitBounds(function (prev) {
|
|
532
578
|
return prev === same ? prev : same;
|
|
533
579
|
});
|
|
@@ -536,7 +582,7 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
536
582
|
return prev ? false : prev;
|
|
537
583
|
});
|
|
538
584
|
}
|
|
539
|
-
}, []);
|
|
585
|
+
}, [clearFitBoundsTweenHold]);
|
|
540
586
|
|
|
541
587
|
/**
|
|
542
588
|
* 用户交互结束时(pan / zoom / pinch / wheel stop)调用:
|
|
@@ -572,6 +618,7 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
572
618
|
* 防止后续 effect 反向覆盖缓存值。
|
|
573
619
|
*/
|
|
574
620
|
var applyPersistedViewport = useCallback(function (cached) {
|
|
621
|
+
clearFitBoundsTweenHold();
|
|
575
622
|
var ctx = transformRef.current;
|
|
576
623
|
if (!ctx) return false;
|
|
577
624
|
ctx.setTransform(cached.x, cached.y, cached.scale, 0);
|
|
@@ -585,7 +632,7 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
585
632
|
cachedRestoredFrameRef.current = String(currentFrame);
|
|
586
633
|
}
|
|
587
634
|
return true;
|
|
588
|
-
}, [transformRef]);
|
|
635
|
+
}, [clearFitBoundsTweenHold, transformRef]);
|
|
589
636
|
|
|
590
637
|
/**
|
|
591
638
|
* 切换 viewportPersistKey 或 frameResetKey 时(含挂载、wrapper 重挂载):
|
|
@@ -683,6 +730,10 @@ export function useFloorMapTransformMetrics(params) {
|
|
|
683
730
|
}
|
|
684
731
|
(_flushPersistRef$curr = flushPersistRef.current) === null || _flushPersistRef$curr === void 0 || _flushPersistRef$curr.call(flushPersistRef);
|
|
685
732
|
flushPersistRef.current = null;
|
|
733
|
+
if (fitBoundsTweenHoldClearTimerRef.current != null) {
|
|
734
|
+
clearTimeout(fitBoundsTweenHoldClearTimerRef.current);
|
|
735
|
+
fitBoundsTweenHoldClearTimerRef.current = null;
|
|
736
|
+
}
|
|
686
737
|
};
|
|
687
738
|
}, [viewportPersistKey]);
|
|
688
739
|
return {
|
|
@@ -528,6 +528,11 @@ export interface PisellFloorMapLayoutProps<T extends FloorMapItemBase = FloorMap
|
|
|
528
528
|
* 是否开启 hover 高亮或 hover 事件,默认 true
|
|
529
529
|
*/
|
|
530
530
|
enableHover?: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* 阅读态(`mode === 'read'`):与 {@link rowKey} 解析出的图元 id 相等时,外层容器加选中描边(如详情弹层打开时锚定画布上的桌位)。
|
|
533
|
+
* 传 `null` / `undefined` / 空字符串时不展示选中外圈。
|
|
534
|
+
*/
|
|
535
|
+
readModeSelectedItemId?: string | null;
|
|
531
536
|
/**
|
|
532
537
|
* 资源项点击回调
|
|
533
538
|
*/
|
|
@@ -102,7 +102,7 @@ function getDefaultRecordBoardContext(layoutType, selection, rowKey) {
|
|
|
102
102
|
* 平面图推荐在 ShellFrame 内使用 **PisellRecordBoard.FloorMap** 声明,与根级 `floorMap` 合并(子优先)。
|
|
103
103
|
*/
|
|
104
104
|
var PisellRecordBoard = function PisellRecordBoard(props) {
|
|
105
|
-
var _props$columnVisibili;
|
|
105
|
+
var _props$columnVisibili, _props$grid4;
|
|
106
106
|
var children = props.children,
|
|
107
107
|
_props$layoutType = props.layoutType,
|
|
108
108
|
layoutType = _props$layoutType === void 0 ? 'grid' : _props$layoutType,
|
|
@@ -249,7 +249,7 @@ var PisellRecordBoard = function PisellRecordBoard(props) {
|
|
|
249
249
|
setInternalColumnOrder(columnKeys);
|
|
250
250
|
}, []);
|
|
251
251
|
var contextValue = useMemo(function () {
|
|
252
|
-
var _gridSelection$select;
|
|
252
|
+
var _props$grid3, _gridSelection$select;
|
|
253
253
|
var defaultCtx = getDefaultRecordBoardContext(layoutType, {
|
|
254
254
|
selectedKeys: internalSelectedKeys,
|
|
255
255
|
selectedRows: internalSelectedRows,
|
|
@@ -258,11 +258,13 @@ var PisellRecordBoard = function PisellRecordBoard(props) {
|
|
|
258
258
|
|
|
259
259
|
/** 分页状态(推导表格切片前需要) */
|
|
260
260
|
var pagination = paginationProp !== undefined ? paginationProp : defaultCtx.pagination;
|
|
261
|
+
var gridInfiniteScroll = ((_props$grid3 = props.grid) === null || _props$grid3 === void 0 ? void 0 : _props$grid3.infiniteScroll) === true;
|
|
261
262
|
|
|
262
263
|
/**
|
|
263
264
|
* 表格数据:
|
|
264
265
|
* - 显式传入 `data` 时始终用 `data`(如服务端分页当前页);
|
|
265
266
|
* - 否则若存在 `dataSources` + `gridDataSourceKey`,从对应数组做客户端分页切片。
|
|
267
|
+
* - `infiniteScroll` 时对该路径做**累积**切片:slice(0, pageNumber * pageSize),与触底加载多页一致。
|
|
266
268
|
*/
|
|
267
269
|
var data;
|
|
268
270
|
var total;
|
|
@@ -276,8 +278,13 @@ var PisellRecordBoard = function PisellRecordBoard(props) {
|
|
|
276
278
|
var pageNumber = pagination.pageNumber,
|
|
277
279
|
pageSize = pagination.pageSize;
|
|
278
280
|
var safeSize = Math.max(1, pageSize);
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
if (gridInfiniteScroll) {
|
|
282
|
+
var end = Math.min(raw.length, pageNumber * safeSize);
|
|
283
|
+
data = raw.slice(0, end);
|
|
284
|
+
} else {
|
|
285
|
+
var start = Math.max(0, (pageNumber - 1) * safeSize);
|
|
286
|
+
data = raw.slice(start, start + safeSize);
|
|
287
|
+
}
|
|
281
288
|
} else {
|
|
282
289
|
data = defaultCtx.data;
|
|
283
290
|
total = totalProp !== undefined ? totalProp : defaultCtx.total;
|
|
@@ -333,9 +340,10 @@ var PisellRecordBoard = function PisellRecordBoard(props) {
|
|
|
333
340
|
* 业务方传入的自定义分页渲染:注入 ctx 后,shellFrame 内置的
|
|
334
341
|
* `<RecordBoardPagination />` 会优先使用它(详见 RecordBoardPagination 实现)。
|
|
335
342
|
*/
|
|
336
|
-
paginationRender: props.paginationRender
|
|
343
|
+
paginationRender: props.paginationRender,
|
|
344
|
+
gridInfiniteScroll: gridInfiniteScroll
|
|
337
345
|
});
|
|
338
|
-
}, [layoutType, rowKeyProp, dataProp, dataSourcesProp, gridDataSourceKeyProp, loadingProp, totalProp, paginationProp, onPageChangeProp, searchParamsProp, onSearchProp, onResetProp, mergedChildComponentProps, internalSelectedKeys, internalSelectedRows, onSelectionChangeInternal, internalColumnVisibility, onColumnVisibilityChangeInternal, internalColumnOrder, onColumnOrderChangeInternal, fillHeight, scrollAreaHeight, filterResetKey, floorMapProp, floorMapLayoutContextProp, defaultBodyView, bodyViewSwitchable, floorMapLayoutRef, floorMapFooter, calendarProp, resourceWallProp, bodyView, setBodyView, props.paginationRender]);
|
|
346
|
+
}, [layoutType, rowKeyProp, dataProp, dataSourcesProp, gridDataSourceKeyProp, loadingProp, totalProp, paginationProp, onPageChangeProp, searchParamsProp, onSearchProp, onResetProp, mergedChildComponentProps, internalSelectedKeys, internalSelectedRows, onSelectionChangeInternal, internalColumnVisibility, onColumnVisibilityChangeInternal, internalColumnOrder, onColumnOrderChangeInternal, fillHeight, scrollAreaHeight, filterResetKey, floorMapProp, floorMapLayoutContextProp, defaultBodyView, bodyViewSwitchable, floorMapLayoutRef, floorMapFooter, calendarProp, resourceWallProp, bodyView, setBodyView, props.paginationRender, (_props$grid4 = props.grid) === null || _props$grid4 === void 0 ? void 0 : _props$grid4.infiniteScroll]);
|
|
339
347
|
var content = /*#__PURE__*/React.createElement(RecordBoardProvider, {
|
|
340
348
|
value: contextValue
|
|
341
349
|
}, children);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var _excluded = ["render", "columns", "rowKey", "rowSelection"],
|
|
2
|
-
_excluded2 = ["autoCalc"]
|
|
2
|
+
_excluded2 = ["autoCalc"],
|
|
3
|
+
_excluded3 = ["onScroll"],
|
|
4
|
+
_excluded4 = ["summary"];
|
|
3
5
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -17,7 +19,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
17
19
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
20
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
21
|
import React, { useMemo, useRef, useState, useEffect } from 'react';
|
|
20
|
-
import { Table } from 'antd';
|
|
22
|
+
import { Table, Spin } from 'antd';
|
|
21
23
|
import { useRecordBoardContext } from "../../hooks/useRecordBoardContext";
|
|
22
24
|
import { processColumnsForGrid, getRecordBoardColumnKey, computeUniformColumnSummary, isTrivialUniformSummaryReactContent } from "../../utils/recordBoardColumns";
|
|
23
25
|
import { getText } from "../../../../locales";
|
|
@@ -37,9 +39,9 @@ function getRowKey(record, rowKey) {
|
|
|
37
39
|
* Grid 布局下的数据视图:使用 antd Table,从 context 取 data / loading / 多选态。
|
|
38
40
|
*/
|
|
39
41
|
/** Context 中与 Table 无关的 key,透传 Table 时排除,避免覆盖或无效传递(含 grid 合并进的 columns/scroll 等) */
|
|
40
|
-
var CONTEXT_ONLY_KEYS = ['data', 'loading', 'total', 'pagination', 'onPageChange', 'searchParams', 'onSearch', 'onReset', 'layoutType', 'selectedKeys', 'selectedRows', 'onSelectionChange', 'rowKey', 'childComponentProps', 'columnVisibility', 'onColumnVisibilityChange', 'columns', 'scroll', 'size', 'defaultHiddenColumnKeys', 'scrollAreaHeight', 'setScrollAreaHeight', 'collapseUniformColumns', 'columnOrder', 'onColumnOrderChange'];
|
|
42
|
+
var CONTEXT_ONLY_KEYS = ['data', 'loading', 'total', 'pagination', 'onPageChange', 'searchParams', 'onSearch', 'onReset', 'layoutType', 'selectedKeys', 'selectedRows', 'onSelectionChange', 'rowKey', 'childComponentProps', 'columnVisibility', 'onColumnVisibilityChange', 'columns', 'scroll', 'size', 'defaultHiddenColumnKeys', 'scrollAreaHeight', 'setScrollAreaHeight', 'collapseUniformColumns', 'columnOrder', 'onColumnOrderChange', 'gridInfiniteScroll', 'infiniteScroll', 'paginationRender'];
|
|
41
43
|
var RecordBoardGridView = function RecordBoardGridView(props) {
|
|
42
|
-
var _ref2, _ctx$data2, _ctx$
|
|
44
|
+
var _ref2, _ctx$data2, _ctx$data4;
|
|
43
45
|
var ctx = useRecordBoardContext({
|
|
44
46
|
displayName: 'grid'
|
|
45
47
|
});
|
|
@@ -171,6 +173,7 @@ var RecordBoardGridView = function RecordBoardGridView(props) {
|
|
|
171
173
|
var gridTableProps = useMemo(function () {
|
|
172
174
|
var picked = {};
|
|
173
175
|
Object.keys(ctx).forEach(function (k) {
|
|
176
|
+
if (k === 'onScroll') return;
|
|
174
177
|
if (CONTEXT_ONLY_KEYS.includes(k)) return;
|
|
175
178
|
picked[k] = ctx[k];
|
|
176
179
|
});
|
|
@@ -187,6 +190,7 @@ var RecordBoardGridView = function RecordBoardGridView(props) {
|
|
|
187
190
|
return sum + ((_col$width = col.width) !== null && _col$width !== void 0 ? _col$width : 250);
|
|
188
191
|
}, 0) || 2000;
|
|
189
192
|
}, [columns]);
|
|
193
|
+
var gridInfiniteScroll = ctx.gridInfiniteScroll === true;
|
|
190
194
|
|
|
191
195
|
// 与 materials Table useGenScroll 对齐:autoCalc 时根据 scrollAreaHeight 计算 scroll.y;无数据且 scroll.x 非数字时用列宽之和避免表头被压窄换行
|
|
192
196
|
var tableScroll = useMemo(function () {
|
|
@@ -200,7 +204,7 @@ var RecordBoardGridView = function RecordBoardGridView(props) {
|
|
|
200
204
|
return {
|
|
201
205
|
x: scrollX !== null && scrollX !== void 0 ? scrollX : sumColumnWidths,
|
|
202
206
|
y: Math.max(wrapHeight - reservedHeight, 100),
|
|
203
|
-
scrollToFirstRowOnChange: scroll.scrollToFirstRowOnChange
|
|
207
|
+
scrollToFirstRowOnChange: gridInfiniteScroll ? false : scroll.scrollToFirstRowOnChange
|
|
204
208
|
};
|
|
205
209
|
}
|
|
206
210
|
if (scroll && _typeof(scroll) === 'object') {
|
|
@@ -212,13 +216,192 @@ var RecordBoardGridView = function RecordBoardGridView(props) {
|
|
|
212
216
|
var _ref6;
|
|
213
217
|
return _objectSpread(_objectSpread({}, resolved), {}, {
|
|
214
218
|
x: (_ref6 = scrollX !== null && scrollX !== void 0 ? scrollX : resolved.x) !== null && _ref6 !== void 0 ? _ref6 : sumColumnWidths
|
|
215
|
-
}
|
|
219
|
+
}, gridInfiniteScroll ? {
|
|
220
|
+
scrollToFirstRowOnChange: false
|
|
221
|
+
} : {});
|
|
216
222
|
}
|
|
217
223
|
return resolved;
|
|
218
224
|
}
|
|
219
225
|
return scroll;
|
|
220
|
-
}, [rest.scroll, ctx.scroll, ctx.scrollAreaHeight, ctx.pagination, columns, sumColumnWidths, isEmpty, uniformSummaryHeight]);
|
|
226
|
+
}, [rest.scroll, ctx.scroll, ctx.scrollAreaHeight, ctx.pagination, columns, sumColumnWidths, isEmpty, uniformSummaryHeight, gridInfiniteScroll]);
|
|
227
|
+
|
|
228
|
+
/** 触底加载下一页:距底部约 48px 内触发,避免 loading 与重复 onPageChange */
|
|
229
|
+
var infiniteLoadLockRef = useRef(false);
|
|
230
|
+
/** 已触发 onPageChange、等待下一页数据:宿主可能不设 ctx.loading,需单独驱动表尾「加载中」 */
|
|
231
|
+
var _useState3 = useState(false),
|
|
232
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
233
|
+
infiniteScrollFetching = _useState4[0],
|
|
234
|
+
setInfiniteScrollFetching = _useState4[1];
|
|
235
|
+
// 与 dataSource.length 组合:宿主若不在请求期间置 loading,仅靠 loading 无法在下一次数据追加后清锁
|
|
236
|
+
useEffect(function () {
|
|
237
|
+
if (!ctx.loading) {
|
|
238
|
+
infiniteLoadLockRef.current = false;
|
|
239
|
+
}
|
|
240
|
+
}, [ctx.loading, dataSource.length]);
|
|
241
|
+
useEffect(function () {
|
|
242
|
+
setInfiniteScrollFetching(false);
|
|
243
|
+
}, [dataSource.length]);
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* 无限滚动:监听**实际发生滚动**的节点。
|
|
247
|
+
* - 有 `scroll.y` 时表体在内部滚动,类名在 ConfigProvider 下为 `.pisell-lowcode-table-body`(非 `.ant-table-body`);
|
|
248
|
+
* - `scrollAreaHeight` 未就绪或仅 `autoCalc` 未算高时,整表在 Shell 的 `.pisell-record-board-scroll-body` 内滚,仅绑表体会漏事件(如 HUD 抽屉内嵌表)。
|
|
249
|
+
*/
|
|
250
|
+
var gridWrapRef = useRef(null);
|
|
251
|
+
var ctxRef = useRef(ctx);
|
|
252
|
+
ctxRef.current = ctx;
|
|
253
|
+
var restRef = useRef(rest);
|
|
254
|
+
restRef.current = rest;
|
|
255
|
+
var gridInfiniteRef = useRef(false);
|
|
256
|
+
gridInfiniteRef.current = gridInfiniteScroll;
|
|
257
|
+
useEffect(function () {
|
|
258
|
+
if (!gridInfiniteScroll) return;
|
|
259
|
+
var root = gridWrapRef.current;
|
|
260
|
+
if (!root) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
var handler = function handler(e) {
|
|
264
|
+
var _r$onScroll, _onScroll2, _ref7, _e$currentTarget, _c$data, _c$total;
|
|
265
|
+
var r = restRef.current;
|
|
266
|
+
var c = ctxRef.current;
|
|
267
|
+
var ev = e;
|
|
268
|
+
(_r$onScroll = r.onScroll) === null || _r$onScroll === void 0 || _r$onScroll.call(r, ev);
|
|
269
|
+
(_onScroll2 = (_ref7 = c).onScroll) === null || _onScroll2 === void 0 || _onScroll2.call(_ref7, ev);
|
|
270
|
+
if (!gridInfiniteRef.current) return;
|
|
271
|
+
if (c.loading || infiniteLoadLockRef.current) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
var st = (_e$currentTarget = e.currentTarget) !== null && _e$currentTarget !== void 0 ? _e$currentTarget : e.target;
|
|
275
|
+
var dataLen = ((_c$data = c.data) !== null && _c$data !== void 0 ? _c$data : []).length;
|
|
276
|
+
var tot = (_c$total = c.total) !== null && _c$total !== void 0 ? _c$total : 0;
|
|
277
|
+
var scrollTop = st.scrollTop,
|
|
278
|
+
clientHeight = st.clientHeight,
|
|
279
|
+
scrollHeight = st.scrollHeight;
|
|
280
|
+
var dist = scrollHeight - scrollTop - clientHeight;
|
|
281
|
+
if (dataLen >= tot) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (dist > 48) return;
|
|
285
|
+
infiniteLoadLockRef.current = true;
|
|
286
|
+
setInfiniteScrollFetching(true);
|
|
287
|
+
c.onPageChange(c.pagination.pageNumber + 1, c.pagination.pageSize);
|
|
288
|
+
};
|
|
289
|
+
var listScrollTargets = function listScrollTargets(r) {
|
|
290
|
+
var out = [];
|
|
291
|
+
var seen = new Set();
|
|
292
|
+
var add = function add(el) {
|
|
293
|
+
if (el && !seen.has(el)) {
|
|
294
|
+
seen.add(el);
|
|
295
|
+
out.push(el);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
// 与 Grid.less 一致:项目 antd prefixCls 为 pisell-lowcode
|
|
299
|
+
r.querySelectorAll('.ant-table-body, .pisell-lowcode-table-body').forEach(function (n) {
|
|
300
|
+
return add(n);
|
|
301
|
+
});
|
|
302
|
+
add(r.closest('.pisell-record-board-scroll-body'));
|
|
303
|
+
return out;
|
|
304
|
+
};
|
|
305
|
+
var cleanups = [];
|
|
306
|
+
var bind = function bind() {
|
|
307
|
+
cleanups.forEach(function (fn) {
|
|
308
|
+
return fn();
|
|
309
|
+
});
|
|
310
|
+
cleanups.length = 0;
|
|
311
|
+
var targets = listScrollTargets(root);
|
|
312
|
+
targets.forEach(function (el) {
|
|
313
|
+
el.addEventListener('scroll', handler, {
|
|
314
|
+
passive: true
|
|
315
|
+
});
|
|
316
|
+
cleanups.push(function () {
|
|
317
|
+
return el.removeEventListener('scroll', handler);
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
var t0 = window.setTimeout(function () {
|
|
322
|
+
return bind();
|
|
323
|
+
}, 0);
|
|
324
|
+
var t1 = window.setTimeout(function () {
|
|
325
|
+
return bind();
|
|
326
|
+
}, 120);
|
|
327
|
+
var t2 = window.setTimeout(function () {
|
|
328
|
+
return bind();
|
|
329
|
+
}, 400);
|
|
330
|
+
return function () {
|
|
331
|
+
clearTimeout(t0);
|
|
332
|
+
clearTimeout(t1);
|
|
333
|
+
clearTimeout(t2);
|
|
334
|
+
cleanups.forEach(function (fn) {
|
|
335
|
+
return fn();
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
}, [gridInfiniteScroll, dataSource.length, isEmpty, ctx.scrollAreaHeight, columns, summaryItems.length]);
|
|
339
|
+
var tableRest = useMemo(function () {
|
|
340
|
+
if (!gridInfiniteScroll) return rest;
|
|
341
|
+
var _ref8 = rest,
|
|
342
|
+
_onScroll = _ref8.onScroll,
|
|
343
|
+
r = _objectWithoutProperties(_ref8, _excluded3);
|
|
344
|
+
return r;
|
|
345
|
+
}, [gridInfiniteScroll, rest]);
|
|
346
|
+
var userGridSummary = gridTableProps.summary;
|
|
347
|
+
var infiniteSummaryColSpan = useMemo(function () {
|
|
348
|
+
var n = Array.isArray(columns) ? columns.length : 1;
|
|
349
|
+
return n + (rowSelection ? 1 : 0);
|
|
350
|
+
}, [columns, rowSelection]);
|
|
351
|
+
|
|
352
|
+
/** 无限滚动:在 Table.Summary 内展示状态(与宿主 summary 合并) */
|
|
353
|
+
var mergedTableSummary = useMemo(function () {
|
|
354
|
+
if (!gridInfiniteScroll) {
|
|
355
|
+
return userGridSummary;
|
|
356
|
+
}
|
|
357
|
+
return function (pageData) {
|
|
358
|
+
var _ctx$data3;
|
|
359
|
+
var userNode = typeof userGridSummary === 'function' ? userGridSummary(pageData) : userGridSummary;
|
|
360
|
+
var len = ((_ctx$data3 = ctx.data) !== null && _ctx$data3 !== void 0 ? _ctx$data3 : []).length;
|
|
361
|
+
var tot = ctx.total;
|
|
362
|
+
var loading = !!ctx.loading;
|
|
363
|
+
var loadingMore = loading || infiniteScrollFetching;
|
|
364
|
+
var showBar = len > 0 || loadingMore;
|
|
365
|
+
if (!showBar && !userNode) {
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
var hasMore = tot == null || typeof tot !== 'number' ? true : len < tot;
|
|
369
|
+
var allLoaded = typeof tot === 'number' && tot > 0 && len > 0 && len >= tot;
|
|
370
|
+
var statusInner = null;
|
|
371
|
+
if (showBar) {
|
|
372
|
+
// 先有「已全部加载」再判断加载:只要还有总数意义上的后续条(hasMore)且本地已有展示行,表尾一律显示加载中(含未到触底、未置 loading / 未打 fetching 的中间态)
|
|
373
|
+
if (allLoaded) {
|
|
374
|
+
statusInner = /*#__PURE__*/React.createElement("span", {
|
|
375
|
+
className: "pisell-record-board-infinite-scroll-tip-done"
|
|
376
|
+
}, getText('record-board-infinite-scroll-all-loaded'));
|
|
377
|
+
} else if (hasMore && len > 0) {
|
|
378
|
+
statusInner = /*#__PURE__*/React.createElement("span", {
|
|
379
|
+
className: "pisell-record-board-infinite-scroll-tip-loading"
|
|
380
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
381
|
+
size: "small"
|
|
382
|
+
}), /*#__PURE__*/React.createElement("span", null, getText('record-board-infinite-scroll-loading-more')));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
var statusBlock = statusInner != null ? /*#__PURE__*/React.createElement(Table.Summary, {
|
|
386
|
+
fixed: "bottom"
|
|
387
|
+
}, /*#__PURE__*/React.createElement(Table.Summary.Row, {
|
|
388
|
+
className: "pisell-record-board-infinite-scroll-summary-row"
|
|
389
|
+
}, /*#__PURE__*/React.createElement(Table.Summary.Cell, {
|
|
390
|
+
index: 0,
|
|
391
|
+
colSpan: infiniteSummaryColSpan,
|
|
392
|
+
align: "left"
|
|
393
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
394
|
+
className: "pisell-record-board-infinite-scroll-tip"
|
|
395
|
+
}, statusInner)))) : null;
|
|
396
|
+
if (!userNode && !statusBlock) return null;
|
|
397
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, userNode, statusBlock);
|
|
398
|
+
};
|
|
399
|
+
}, [gridInfiniteScroll, userGridSummary, infiniteSummaryColSpan, ctx.data, ctx.total, ctx.loading, infiniteScrollFetching]);
|
|
400
|
+
var _ref9 = gridTableProps,
|
|
401
|
+
_userSummaryOmitted = _ref9.summary,
|
|
402
|
+
gridTablePropsWithoutSummary = _objectWithoutProperties(_ref9, _excluded4);
|
|
221
403
|
return /*#__PURE__*/React.createElement("div", {
|
|
404
|
+
ref: gridWrapRef,
|
|
222
405
|
"data-layout-slot": "grid",
|
|
223
406
|
className: "pisell-lowcode-record-board-grid"
|
|
224
407
|
}, summaryItems.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
@@ -240,10 +423,11 @@ var RecordBoardGridView = function RecordBoardGridView(props) {
|
|
|
240
423
|
}, item.title), /*#__PURE__*/React.createElement("span", {
|
|
241
424
|
className: "pisell-record-board-uniform-summary-value"
|
|
242
425
|
}, content));
|
|
243
|
-
})), /*#__PURE__*/React.createElement(Table, _extends({},
|
|
426
|
+
})), /*#__PURE__*/React.createElement(Table, _extends({}, tableRest, gridTablePropsWithoutSummary, {
|
|
427
|
+
summary: mergedTableSummary,
|
|
244
428
|
scroll: tableScroll,
|
|
245
429
|
rowKey: tableRowKey,
|
|
246
|
-
dataSource: (_ctx$
|
|
430
|
+
dataSource: (_ctx$data4 = ctx.data) !== null && _ctx$data4 !== void 0 ? _ctx$data4 : [],
|
|
247
431
|
loading: ctx.loading,
|
|
248
432
|
columns: columns,
|
|
249
433
|
rowSelection: rowSelection,
|
|
@@ -111,3 +111,34 @@
|
|
|
111
111
|
.pisell-record-board-row-cancelled {
|
|
112
112
|
background: #fff1f0;
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
// 无限滚动:表尾 Table.Summary 一行,文案靠左
|
|
116
|
+
// 不再加 border-top:上方数据行已有 border-bottom,再画 top 会与 antd 格线叠成双线
|
|
117
|
+
.pisell-record-board-infinite-scroll-summary-row > .pisell-lowcode-table-cell,
|
|
118
|
+
.pisell-record-board-infinite-scroll-summary-row > .ant-table-cell {
|
|
119
|
+
background: var(--ant-color-bg-container, #ffffff) !important;
|
|
120
|
+
border-top: none !important;
|
|
121
|
+
text-align: left !important;
|
|
122
|
+
vertical-align: middle;
|
|
123
|
+
padding: 8px 12px !important;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.pisell-record-board-infinite-scroll-tip {
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: flex-start;
|
|
130
|
+
gap: 8px;
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
line-height: 18px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.pisell-record-board-infinite-scroll-tip-loading {
|
|
136
|
+
display: inline-flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
gap: 8px;
|
|
139
|
+
color: #475467;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.pisell-record-board-infinite-scroll-tip-done {
|
|
143
|
+
color: #667085;
|
|
144
|
+
}
|
package/es/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js
CHANGED
|
@@ -71,12 +71,15 @@ export function BookingCalendarMonthView(_ref) {
|
|
|
71
71
|
className: "h-3 w-3 rounded-full bg-violet-500"
|
|
72
72
|
}), (day.blockCount > 0 || day.fullyBooked) && /*#__PURE__*/React.createElement("span", {
|
|
73
73
|
className: "h-3 w-3 rounded-full bg-red-500"
|
|
74
|
-
})), dayItems.length > 0 ?
|
|
75
|
-
|
|
74
|
+
})), dayItems.length > 0 ?
|
|
75
|
+
/*#__PURE__*/
|
|
76
|
+
/** 顶对齐:日期区为 top-3(12px) + h-11(44px)=56px,原先 mt-10(40px) 与数字圈底不齐,易多出一条缝 */
|
|
77
|
+
React.createElement("div", {
|
|
78
|
+
className: "mt-14 flex w-full flex-col items-start gap-1.5"
|
|
76
79
|
}, dayItems.map(function (item, i) {
|
|
77
80
|
var isLastVisible = i === dayItems.length - 1;
|
|
78
81
|
var shrinkForMore = showMoreTile && isLastVisible;
|
|
79
|
-
var layoutClassName = "block rounded-md px-2
|
|
82
|
+
var layoutClassName = "block rounded-md px-2 pt-1.5 pb-2 text-xs text-left ".concat(getGridBookingRowStateClasses(item), " ").concat(shrinkForMore ? 'flex-1 min-w-0' : 'w-full');
|
|
80
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
81
84
|
key: i,
|
|
82
85
|
className: "flex w-full items-stretch gap-2"
|
|
@@ -167,6 +167,9 @@ var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
|
|
|
167
167
|
var showGrid = useMemo(function () {
|
|
168
168
|
return hasGridContent && ctx.bodyView === 'grid';
|
|
169
169
|
}, [hasGridContent, ctx.bodyView]);
|
|
170
|
+
|
|
171
|
+
/** 无限滚动时不展示底部分页(含 paginationRender 挂载点) */
|
|
172
|
+
var showGridPagination = showGrid && ctx.gridInfiniteScroll !== true;
|
|
170
173
|
var showFloorMap = useMemo(function () {
|
|
171
174
|
return hasFloorMapSlot && effectiveFloorMapProps != null && ctx.bodyView === 'floorMap';
|
|
172
175
|
}, [hasFloorMapSlot, effectiveFloorMapProps, ctx.bodyView]);
|
|
@@ -259,7 +262,7 @@ var RecordBoardShellFrame = function RecordBoardShellFrame(_ref2) {
|
|
|
259
262
|
var bodyContent = fillHeight ? /*#__PURE__*/React.createElement(React.Fragment, null, showGrid ? /*#__PURE__*/React.createElement(ScrollAreaMeasurer, {
|
|
260
263
|
onHeight: (_ctx$setScrollAreaHei = ctx === null || ctx === void 0 ? void 0 : ctx.setScrollAreaHeight) !== null && _ctx$setScrollAreaHei !== void 0 ? _ctx$setScrollAreaHei : function () {},
|
|
261
264
|
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
|
|
262
|
-
}, gridChildren) : showResourceWall ? resourceWallNode : showCalendar ? calendarNode : floorMapNode,
|
|
265
|
+
}, gridChildren) : showResourceWall ? resourceWallNode : showCalendar ? calendarNode : floorMapNode, showGridPagination ? /*#__PURE__*/React.createElement(RecordBoardPagination, null) : null) : /*#__PURE__*/React.createElement(React.Fragment, null, showGrid ? gridChildren : showResourceWall ? resourceWallNode : showCalendar ? calendarNode : floorMapNode, showGridPagination ? /*#__PURE__*/React.createElement(RecordBoardPagination, null) : null);
|
|
263
266
|
var shellStyle = fillHeight && style ? _objectSpread(_objectSpread({}, style), FILL_HEIGHT_WRAPPER_STYLE) : fillHeight ? FILL_HEIGHT_WRAPPER_STYLE : style;
|
|
264
267
|
var wrapper = /*#__PURE__*/React.createElement(RecordBoardShellBodyMetaContext.Provider, {
|
|
265
268
|
value: shellBodyMeta
|
|
@@ -540,6 +540,10 @@ export interface RecordBoardContextValue {
|
|
|
540
540
|
* `<RecordBoardPagination />` 优先级:组件 `render` prop > 此 ctx 字段 > 默认 materials Pagination。
|
|
541
541
|
*/
|
|
542
542
|
paginationRender?: (ctx: RecordBoardContextValue) => React.ReactNode;
|
|
543
|
+
/**
|
|
544
|
+
* 与 `grid.infiniteScroll` 同步:为 true 时不渲染 ShellFrame 底部分页,由 Grid 表体触底触发翻页。
|
|
545
|
+
*/
|
|
546
|
+
gridInfiniteScroll?: boolean;
|
|
543
547
|
/** 是否占满父容器高度,供 ShellFrame 做弹性布局(内容区纯 CSS 滚动 + 表头 sticky;scroll.autoCalc 时用测量高度) */
|
|
544
548
|
fillHeight?: boolean;
|
|
545
549
|
/** 内容区滚动容器高度(fillHeight 且 grid.scroll.autoCalc 时由 ShellFrame 测量),供 Grid 计算 scroll.y */
|
|
@@ -658,6 +662,11 @@ export declare type RecordBoardGridProps = {
|
|
|
658
662
|
autoCalc?: boolean;
|
|
659
663
|
scrollToFirstRowOnChange?: boolean;
|
|
660
664
|
};
|
|
665
|
+
/**
|
|
666
|
+
* 为 true 时:表体滚动触底触发 `onPageChange` 加载下一页,ShellFrame **不展示**底部分页条。
|
|
667
|
+
* 宿主需保证 `data` 为已加载的**累积**行(或 dataSources 模式由容器做累积切片),且 `total` 为总量;触底停更条件为 `data.length < total`。
|
|
668
|
+
*/
|
|
669
|
+
infiniteScroll?: boolean;
|
|
661
670
|
/** 表格尺寸 */
|
|
662
671
|
size?: 'small' | 'middle' | 'default';
|
|
663
672
|
/** 当前选中的行 key 列表(多选) */
|
|
@@ -92,21 +92,33 @@ export function PisellTimeNavigator(props) {
|
|
|
92
92
|
densityLoaded = _useState2[0],
|
|
93
93
|
setDensityLoaded = _useState2[1];
|
|
94
94
|
var densityReqId = useRef(0);
|
|
95
|
+
/**
|
|
96
|
+
* 仅当日历锚定日或 step 变化时清空密度折线;`loadDensity` 回调因上游 deps 变引用而变时
|
|
97
|
+
* 保留上一帧数据直至新请求返回,避免预约页列表/高光周期性更新导致整轴「闪一下」。
|
|
98
|
+
*/
|
|
99
|
+
var densityAxisKeyRef = useRef(null);
|
|
95
100
|
var densityGradientId = useMemo(function () {
|
|
96
101
|
return "pisell-time-density-fill-".concat(Math.random().toString(36).slice(2, 8));
|
|
97
102
|
}, []);
|
|
98
103
|
useEffect(function () {
|
|
104
|
+
var axisKey = "".concat(referenceDayKey, "|").concat(stepMinutes);
|
|
105
|
+
var axisKeyChanged = densityAxisKeyRef.current === null || densityAxisKeyRef.current !== axisKey;
|
|
99
106
|
if (densitySeriesProp !== undefined) {
|
|
107
|
+
densityAxisKeyRef.current = null;
|
|
100
108
|
setDensityLoaded(undefined);
|
|
101
109
|
return;
|
|
102
110
|
}
|
|
103
111
|
if (!loadDensityProp) {
|
|
112
|
+
densityAxisKeyRef.current = null;
|
|
104
113
|
setDensityLoaded(undefined);
|
|
105
114
|
return;
|
|
106
115
|
}
|
|
116
|
+
densityAxisKeyRef.current = axisKey;
|
|
107
117
|
var req = ++densityReqId.current;
|
|
108
118
|
var cancelled = false;
|
|
109
|
-
|
|
119
|
+
if (axisKeyChanged) {
|
|
120
|
+
setDensityLoaded(undefined);
|
|
121
|
+
}
|
|
110
122
|
var refDay = dayjs(referenceDayKey).startOf('day');
|
|
111
123
|
void loadDensityProp({
|
|
112
124
|
referenceDate: refDay,
|