@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
|
@@ -103,6 +103,7 @@ function getDefaultRecordBoardContext(layoutType, selection, rowKey) {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
var PisellRecordBoard = (props) => {
|
|
106
|
+
var _a;
|
|
106
107
|
const {
|
|
107
108
|
children,
|
|
108
109
|
layoutType = "grid",
|
|
@@ -187,8 +188,8 @@ var PisellRecordBoard = (props) => {
|
|
|
187
188
|
bodyView
|
|
188
189
|
]);
|
|
189
190
|
const [internalColumnVisibility, setInternalColumnVisibility] = (0, import_react.useState)(() => {
|
|
190
|
-
var
|
|
191
|
-
const fromConfig = ((
|
|
191
|
+
var _a2, _b;
|
|
192
|
+
const fromConfig = ((_a2 = props.grid) == null ? void 0 : _a2.defaultHiddenColumnKeys) ?? [];
|
|
192
193
|
const fromColumns = (((_b = props.grid) == null ? void 0 : _b.columns) ?? []).filter(
|
|
193
194
|
(col) => col.hidden === true
|
|
194
195
|
).map((col) => (0, import_recordBoardColumns.getRecordBoardColumnKey)(col)).filter(Boolean);
|
|
@@ -247,6 +248,7 @@ var PisellRecordBoard = (props) => {
|
|
|
247
248
|
setInternalColumnOrder(columnKeys);
|
|
248
249
|
}, []);
|
|
249
250
|
const contextValue = (0, import_react.useMemo)(() => {
|
|
251
|
+
var _a2;
|
|
250
252
|
const defaultCtx = getDefaultRecordBoardContext(
|
|
251
253
|
layoutType,
|
|
252
254
|
{
|
|
@@ -257,6 +259,7 @@ var PisellRecordBoard = (props) => {
|
|
|
257
259
|
rowKeyProp
|
|
258
260
|
);
|
|
259
261
|
const pagination = paginationProp !== void 0 ? paginationProp : defaultCtx.pagination;
|
|
262
|
+
const gridInfiniteScroll = ((_a2 = props.grid) == null ? void 0 : _a2.infiniteScroll) === true;
|
|
260
263
|
let data;
|
|
261
264
|
let total;
|
|
262
265
|
if (dataProp !== void 0) {
|
|
@@ -267,8 +270,13 @@ var PisellRecordBoard = (props) => {
|
|
|
267
270
|
total = totalProp !== void 0 ? totalProp : raw.length;
|
|
268
271
|
const { pageNumber, pageSize } = pagination;
|
|
269
272
|
const safeSize = Math.max(1, pageSize);
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
if (gridInfiniteScroll) {
|
|
274
|
+
const end = Math.min(raw.length, pageNumber * safeSize);
|
|
275
|
+
data = raw.slice(0, end);
|
|
276
|
+
} else {
|
|
277
|
+
const start = Math.max(0, (pageNumber - 1) * safeSize);
|
|
278
|
+
data = raw.slice(start, start + safeSize);
|
|
279
|
+
}
|
|
272
280
|
} else {
|
|
273
281
|
data = defaultCtx.data;
|
|
274
282
|
total = totalProp !== void 0 ? totalProp : defaultCtx.total;
|
|
@@ -325,7 +333,8 @@ var PisellRecordBoard = (props) => {
|
|
|
325
333
|
* 业务方传入的自定义分页渲染:注入 ctx 后,shellFrame 内置的
|
|
326
334
|
* `<RecordBoardPagination />` 会优先使用它(详见 RecordBoardPagination 实现)。
|
|
327
335
|
*/
|
|
328
|
-
paginationRender: props.paginationRender
|
|
336
|
+
paginationRender: props.paginationRender,
|
|
337
|
+
gridInfiniteScroll
|
|
329
338
|
};
|
|
330
339
|
}, [
|
|
331
340
|
layoutType,
|
|
@@ -361,7 +370,8 @@ var PisellRecordBoard = (props) => {
|
|
|
361
370
|
resourceWallProp,
|
|
362
371
|
bodyView,
|
|
363
372
|
setBodyView,
|
|
364
|
-
props.paginationRender
|
|
373
|
+
props.paginationRender,
|
|
374
|
+
(_a = props.grid) == null ? void 0 : _a.infiniteScroll
|
|
365
375
|
]);
|
|
366
376
|
const content = /* @__PURE__ */ import_react.default.createElement(import_RecordBoardProvider.RecordBoardProvider, { value: contextValue }, children);
|
|
367
377
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -72,7 +72,10 @@ var CONTEXT_ONLY_KEYS = [
|
|
|
72
72
|
"setScrollAreaHeight",
|
|
73
73
|
"collapseUniformColumns",
|
|
74
74
|
"columnOrder",
|
|
75
|
-
"onColumnOrderChange"
|
|
75
|
+
"onColumnOrderChange",
|
|
76
|
+
"gridInfiniteScroll",
|
|
77
|
+
"infiniteScroll",
|
|
78
|
+
"paginationRender"
|
|
76
79
|
];
|
|
77
80
|
var RecordBoardGridView = (props) => {
|
|
78
81
|
const ctx = (0, import_useRecordBoardContext.useRecordBoardContext)({ displayName: "grid" });
|
|
@@ -186,6 +189,7 @@ var RecordBoardGridView = (props) => {
|
|
|
186
189
|
const gridTableProps = (0, import_react.useMemo)(() => {
|
|
187
190
|
const picked = {};
|
|
188
191
|
Object.keys(ctx).forEach((k) => {
|
|
192
|
+
if (k === "onScroll") return;
|
|
189
193
|
if (CONTEXT_ONLY_KEYS.includes(
|
|
190
194
|
k
|
|
191
195
|
))
|
|
@@ -205,6 +209,7 @@ var RecordBoardGridView = (props) => {
|
|
|
205
209
|
0
|
|
206
210
|
) || 2e3;
|
|
207
211
|
}, [columns]);
|
|
212
|
+
const gridInfiniteScroll = ctx.gridInfiniteScroll === true;
|
|
208
213
|
const tableScroll = (0, import_react.useMemo)(() => {
|
|
209
214
|
const scroll = rest.scroll ?? ctx.scroll;
|
|
210
215
|
const scrollX = isEmpty && scroll && typeof scroll.x !== "number" ? sumColumnWidths : scroll == null ? void 0 : scroll.x;
|
|
@@ -214,7 +219,7 @@ var RecordBoardGridView = (props) => {
|
|
|
214
219
|
return {
|
|
215
220
|
x: scrollX ?? sumColumnWidths,
|
|
216
221
|
y: Math.max(wrapHeight - reservedHeight, 100),
|
|
217
|
-
scrollToFirstRowOnChange: scroll.scrollToFirstRowOnChange
|
|
222
|
+
scrollToFirstRowOnChange: gridInfiniteScroll ? false : scroll.scrollToFirstRowOnChange
|
|
218
223
|
};
|
|
219
224
|
}
|
|
220
225
|
if (scroll && typeof scroll === "object") {
|
|
@@ -223,7 +228,8 @@ var RecordBoardGridView = (props) => {
|
|
|
223
228
|
if (resolved) {
|
|
224
229
|
return {
|
|
225
230
|
...resolved,
|
|
226
|
-
x: scrollX ?? resolved.x ?? sumColumnWidths
|
|
231
|
+
x: scrollX ?? resolved.x ?? sumColumnWidths,
|
|
232
|
+
...gridInfiniteScroll ? { scrollToFirstRowOnChange: false } : {}
|
|
227
233
|
};
|
|
228
234
|
}
|
|
229
235
|
return resolved;
|
|
@@ -237,36 +243,187 @@ var RecordBoardGridView = (props) => {
|
|
|
237
243
|
columns,
|
|
238
244
|
sumColumnWidths,
|
|
239
245
|
isEmpty,
|
|
240
|
-
uniformSummaryHeight
|
|
246
|
+
uniformSummaryHeight,
|
|
247
|
+
gridInfiniteScroll
|
|
241
248
|
]);
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
const content = useRender ? processedCol.render(item.cellValue, item.record ?? {}, 0) : item.type === "empty" ? (0, import_locales.getText)("record-board-uniform-summary-empty") : item.displayValue ?? (0, import_locales.getText)("record-board-uniform-summary-same");
|
|
248
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
249
|
-
"div",
|
|
250
|
-
{
|
|
251
|
-
key: item.columnKey,
|
|
252
|
-
className: "pisell-record-board-uniform-summary-item"
|
|
253
|
-
},
|
|
254
|
-
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-record-board-uniform-summary-label" }, item.title),
|
|
255
|
-
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-record-board-uniform-summary-value" }, content)
|
|
256
|
-
);
|
|
257
|
-
})), /* @__PURE__ */ import_react.default.createElement(
|
|
258
|
-
import_antd.Table,
|
|
259
|
-
{
|
|
260
|
-
...rest,
|
|
261
|
-
...gridTableProps,
|
|
262
|
-
scroll: tableScroll,
|
|
263
|
-
rowKey: tableRowKey,
|
|
264
|
-
dataSource: ctx.data ?? [],
|
|
265
|
-
loading: ctx.loading,
|
|
266
|
-
columns,
|
|
267
|
-
rowSelection,
|
|
268
|
-
pagination: false
|
|
249
|
+
const infiniteLoadLockRef = (0, import_react.useRef)(false);
|
|
250
|
+
const [infiniteScrollFetching, setInfiniteScrollFetching] = (0, import_react.useState)(false);
|
|
251
|
+
(0, import_react.useEffect)(() => {
|
|
252
|
+
if (!ctx.loading) {
|
|
253
|
+
infiniteLoadLockRef.current = false;
|
|
269
254
|
}
|
|
270
|
-
)
|
|
255
|
+
}, [ctx.loading, dataSource.length]);
|
|
256
|
+
(0, import_react.useEffect)(() => {
|
|
257
|
+
setInfiniteScrollFetching(false);
|
|
258
|
+
}, [dataSource.length]);
|
|
259
|
+
const gridWrapRef = (0, import_react.useRef)(null);
|
|
260
|
+
const ctxRef = (0, import_react.useRef)(ctx);
|
|
261
|
+
ctxRef.current = ctx;
|
|
262
|
+
const restRef = (0, import_react.useRef)(rest);
|
|
263
|
+
restRef.current = rest;
|
|
264
|
+
const gridInfiniteRef = (0, import_react.useRef)(false);
|
|
265
|
+
gridInfiniteRef.current = gridInfiniteScroll;
|
|
266
|
+
(0, import_react.useEffect)(() => {
|
|
267
|
+
if (!gridInfiniteScroll) return;
|
|
268
|
+
const root = gridWrapRef.current;
|
|
269
|
+
if (!root) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const handler = (e) => {
|
|
273
|
+
var _a, _b;
|
|
274
|
+
const r = restRef.current;
|
|
275
|
+
const c = ctxRef.current;
|
|
276
|
+
const ev = e;
|
|
277
|
+
(_a = r.onScroll) == null ? void 0 : _a.call(r, ev);
|
|
278
|
+
(_b = c.onScroll) == null ? void 0 : _b.call(
|
|
279
|
+
c,
|
|
280
|
+
ev
|
|
281
|
+
);
|
|
282
|
+
if (!gridInfiniteRef.current) return;
|
|
283
|
+
if (c.loading || infiniteLoadLockRef.current) {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const st = e.currentTarget ?? e.target;
|
|
287
|
+
const dataLen = (c.data ?? []).length;
|
|
288
|
+
const tot = c.total ?? 0;
|
|
289
|
+
const { scrollTop, clientHeight, scrollHeight } = st;
|
|
290
|
+
const dist = scrollHeight - scrollTop - clientHeight;
|
|
291
|
+
if (dataLen >= tot) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (dist > 48) return;
|
|
295
|
+
infiniteLoadLockRef.current = true;
|
|
296
|
+
setInfiniteScrollFetching(true);
|
|
297
|
+
c.onPageChange(c.pagination.pageNumber + 1, c.pagination.pageSize);
|
|
298
|
+
};
|
|
299
|
+
const listScrollTargets = (r) => {
|
|
300
|
+
const out = [];
|
|
301
|
+
const seen = /* @__PURE__ */ new Set();
|
|
302
|
+
const add = (el) => {
|
|
303
|
+
if (el && !seen.has(el)) {
|
|
304
|
+
seen.add(el);
|
|
305
|
+
out.push(el);
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
r.querySelectorAll(".ant-table-body, .pisell-lowcode-table-body").forEach(
|
|
309
|
+
(n) => add(n)
|
|
310
|
+
);
|
|
311
|
+
add(r.closest(".pisell-record-board-scroll-body"));
|
|
312
|
+
return out;
|
|
313
|
+
};
|
|
314
|
+
const cleanups = [];
|
|
315
|
+
const bind = () => {
|
|
316
|
+
cleanups.forEach((fn) => fn());
|
|
317
|
+
cleanups.length = 0;
|
|
318
|
+
const targets = listScrollTargets(root);
|
|
319
|
+
targets.forEach((el) => {
|
|
320
|
+
el.addEventListener("scroll", handler, { passive: true });
|
|
321
|
+
cleanups.push(() => el.removeEventListener("scroll", handler));
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
const t0 = window.setTimeout(() => bind(), 0);
|
|
325
|
+
const t1 = window.setTimeout(() => bind(), 120);
|
|
326
|
+
const t2 = window.setTimeout(() => bind(), 400);
|
|
327
|
+
return () => {
|
|
328
|
+
clearTimeout(t0);
|
|
329
|
+
clearTimeout(t1);
|
|
330
|
+
clearTimeout(t2);
|
|
331
|
+
cleanups.forEach((fn) => fn());
|
|
332
|
+
};
|
|
333
|
+
}, [
|
|
334
|
+
gridInfiniteScroll,
|
|
335
|
+
dataSource.length,
|
|
336
|
+
isEmpty,
|
|
337
|
+
ctx.scrollAreaHeight,
|
|
338
|
+
columns,
|
|
339
|
+
summaryItems.length
|
|
340
|
+
]);
|
|
341
|
+
const tableRest = (0, import_react.useMemo)(() => {
|
|
342
|
+
if (!gridInfiniteScroll) return rest;
|
|
343
|
+
const { onScroll: _onScroll, ...r } = rest;
|
|
344
|
+
return r;
|
|
345
|
+
}, [gridInfiniteScroll, rest]);
|
|
346
|
+
const userGridSummary = gridTableProps.summary;
|
|
347
|
+
const infiniteSummaryColSpan = (0, import_react.useMemo)(() => {
|
|
348
|
+
const n = Array.isArray(columns) ? columns.length : 1;
|
|
349
|
+
return n + (rowSelection ? 1 : 0);
|
|
350
|
+
}, [columns, rowSelection]);
|
|
351
|
+
const mergedTableSummary = (0, import_react.useMemo)(() => {
|
|
352
|
+
if (!gridInfiniteScroll) {
|
|
353
|
+
return userGridSummary;
|
|
354
|
+
}
|
|
355
|
+
return (pageData) => {
|
|
356
|
+
const userNode = typeof userGridSummary === "function" ? userGridSummary(pageData) : userGridSummary;
|
|
357
|
+
const len = (ctx.data ?? []).length;
|
|
358
|
+
const tot = ctx.total;
|
|
359
|
+
const loading = !!ctx.loading;
|
|
360
|
+
const loadingMore = loading || infiniteScrollFetching;
|
|
361
|
+
const showBar = len > 0 || loadingMore;
|
|
362
|
+
if (!showBar && !userNode) {
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
const hasMore = tot == null || typeof tot !== "number" ? true : len < tot;
|
|
366
|
+
const allLoaded = typeof tot === "number" && tot > 0 && len > 0 && len >= tot;
|
|
367
|
+
let statusInner = null;
|
|
368
|
+
if (showBar) {
|
|
369
|
+
if (allLoaded) {
|
|
370
|
+
statusInner = /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-record-board-infinite-scroll-tip-done" }, (0, import_locales.getText)("record-board-infinite-scroll-all-loaded"));
|
|
371
|
+
} else if (hasMore && len > 0) {
|
|
372
|
+
statusInner = /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-record-board-infinite-scroll-tip-loading" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { size: "small" }), /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("record-board-infinite-scroll-loading-more")));
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
const statusBlock = statusInner != null ? /* @__PURE__ */ import_react.default.createElement(import_antd.Table.Summary, { fixed: "bottom" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Table.Summary.Row, { className: "pisell-record-board-infinite-scroll-summary-row" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Table.Summary.Cell, { index: 0, colSpan: infiniteSummaryColSpan, align: "left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-record-board-infinite-scroll-tip" }, statusInner)))) : null;
|
|
376
|
+
if (!userNode && !statusBlock) return null;
|
|
377
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, userNode, statusBlock);
|
|
378
|
+
};
|
|
379
|
+
}, [
|
|
380
|
+
gridInfiniteScroll,
|
|
381
|
+
userGridSummary,
|
|
382
|
+
infiniteSummaryColSpan,
|
|
383
|
+
ctx.data,
|
|
384
|
+
ctx.total,
|
|
385
|
+
ctx.loading,
|
|
386
|
+
infiniteScrollFetching
|
|
387
|
+
]);
|
|
388
|
+
const { summary: _userSummaryOmitted, ...gridTablePropsWithoutSummary } = gridTableProps;
|
|
389
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
ref: gridWrapRef,
|
|
393
|
+
"data-layout-slot": "grid",
|
|
394
|
+
className: "pisell-lowcode-record-board-grid"
|
|
395
|
+
},
|
|
396
|
+
summaryItems.length > 0 && /* @__PURE__ */ import_react.default.createElement("div", { ref: summaryRef, className: "pisell-record-board-uniform-summary" }, summaryItems.map((item) => {
|
|
397
|
+
const processedCol = processedColumnsForSummary == null ? void 0 : processedColumnsForSummary.find(
|
|
398
|
+
(c) => (0, import_recordBoardColumns.getRecordBoardColumnKey)(c) === item.columnKey
|
|
399
|
+
);
|
|
400
|
+
const useRender = typeof (processedCol == null ? void 0 : processedCol.render) === "function";
|
|
401
|
+
const content = useRender ? processedCol.render(item.cellValue, item.record ?? {}, 0) : item.type === "empty" ? (0, import_locales.getText)("record-board-uniform-summary-empty") : item.displayValue ?? (0, import_locales.getText)("record-board-uniform-summary-same");
|
|
402
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
403
|
+
"div",
|
|
404
|
+
{
|
|
405
|
+
key: item.columnKey,
|
|
406
|
+
className: "pisell-record-board-uniform-summary-item"
|
|
407
|
+
},
|
|
408
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-record-board-uniform-summary-label" }, item.title),
|
|
409
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-record-board-uniform-summary-value" }, content)
|
|
410
|
+
);
|
|
411
|
+
})),
|
|
412
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
413
|
+
import_antd.Table,
|
|
414
|
+
{
|
|
415
|
+
...tableRest,
|
|
416
|
+
...gridTablePropsWithoutSummary,
|
|
417
|
+
summary: mergedTableSummary,
|
|
418
|
+
scroll: tableScroll,
|
|
419
|
+
rowKey: tableRowKey,
|
|
420
|
+
dataSource: ctx.data ?? [],
|
|
421
|
+
loading: ctx.loading,
|
|
422
|
+
columns,
|
|
423
|
+
rowSelection,
|
|
424
|
+
pagination: false
|
|
425
|
+
}
|
|
426
|
+
)
|
|
427
|
+
);
|
|
271
428
|
};
|
|
272
429
|
var Grid_default = RecordBoardGridView;
|
|
@@ -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/lib/components/pisellRecordBoard/shellFrame/Calendar/view/BookingCalendarMonthView.js
CHANGED
|
@@ -101,123 +101,126 @@ function BookingCalendarMonthView({
|
|
|
101
101
|
)
|
|
102
102
|
),
|
|
103
103
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "absolute right-3 top-3 flex gap-1 pt-1" }, day.bookingCount > 0 && /* @__PURE__ */ import_react.default.createElement("span", { className: "h-3 w-3 rounded-full bg-violet-500" }), (day.blockCount > 0 || day.fullyBooked) && /* @__PURE__ */ import_react.default.createElement("span", { className: "h-3 w-3 rounded-full bg-red-500" })),
|
|
104
|
-
dayItems.length > 0 ?
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
key: i,
|
|
114
|
-
className: "flex w-full items-stretch gap-2"
|
|
115
|
-
},
|
|
116
|
-
renderMonthWeekBooking ? /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
dayItems.length > 0 ? (
|
|
105
|
+
/** 顶对齐:日期区为 top-3(12px) + h-11(44px)=56px,原先 mt-10(40px) 与数字圈底不齐,易多出一条缝 */
|
|
106
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "mt-14 flex w-full flex-col items-start gap-1.5" }, dayItems.map((item, i) => {
|
|
107
|
+
const isLastVisible = i === dayItems.length - 1;
|
|
108
|
+
const shrinkForMore = showMoreTile && isLastVisible;
|
|
109
|
+
const layoutClassName = `block rounded-md px-2 pt-1.5 pb-2 text-xs text-left ${(0, import_BookingCalendarStyle.getGridBookingRowStateClasses)(
|
|
110
|
+
item
|
|
111
|
+
)} ${shrinkForMore ? "flex-1 min-w-0" : "w-full"}`;
|
|
112
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
117
113
|
"div",
|
|
118
114
|
{
|
|
119
|
-
|
|
115
|
+
key: i,
|
|
116
|
+
className: "flex w-full items-stretch gap-2"
|
|
120
117
|
},
|
|
121
|
-
renderMonthWeekBooking(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
isLight,
|
|
126
|
-
layoutClassName,
|
|
127
|
-
onOpenDetail: openBookingDetail,
|
|
128
|
-
onDragStart: (it) => setDraggingItem(it),
|
|
129
|
-
draggable: item.kind !== "block"
|
|
130
|
-
})
|
|
131
|
-
) : /* @__PURE__ */ import_react.default.createElement(
|
|
132
|
-
"button",
|
|
133
|
-
{
|
|
134
|
-
type: "button",
|
|
135
|
-
draggable: item.kind !== "block",
|
|
136
|
-
onDragStart: (e) => {
|
|
137
|
-
if (item.kind !== "block") {
|
|
138
|
-
e.stopPropagation();
|
|
139
|
-
setDraggingItem(item);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
onClick: (e) => {
|
|
143
|
-
e.stopPropagation();
|
|
144
|
-
openBookingDetail(item);
|
|
118
|
+
renderMonthWeekBooking ? /* @__PURE__ */ import_react.default.createElement(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
className: shrinkForMore ? "flex-1 min-w-0" : "w-full"
|
|
145
122
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
123
|
+
renderMonthWeekBooking({
|
|
124
|
+
item,
|
|
125
|
+
dateKey: day.key,
|
|
126
|
+
view: "month",
|
|
127
|
+
isLight,
|
|
128
|
+
layoutClassName,
|
|
129
|
+
onOpenDetail: openBookingDetail,
|
|
130
|
+
onDragStart: (it) => setDraggingItem(it),
|
|
131
|
+
draggable: item.kind !== "block"
|
|
132
|
+
})
|
|
133
|
+
) : /* @__PURE__ */ import_react.default.createElement(
|
|
158
134
|
"button",
|
|
159
135
|
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
});
|
|
136
|
+
type: "button",
|
|
137
|
+
draggable: item.kind !== "block",
|
|
138
|
+
onDragStart: (e) => {
|
|
139
|
+
if (item.kind !== "block") {
|
|
140
|
+
e.stopPropagation();
|
|
141
|
+
setDraggingItem(item);
|
|
142
|
+
}
|
|
168
143
|
},
|
|
169
144
|
onClick: (e) => {
|
|
170
145
|
e.stopPropagation();
|
|
171
|
-
|
|
172
|
-
setOverflowListModal(
|
|
173
|
-
(prev) => prev && prev.scope === "month" && prev.date === day.key ? null : {
|
|
174
|
-
scope: "month",
|
|
175
|
-
date: day.key,
|
|
176
|
-
title: (0, import_calendarI18n.tCal)(
|
|
177
|
-
"pisell2.recordBoard.calendar.overflow.listTitleBookings",
|
|
178
|
-
{ date: day.key }
|
|
179
|
-
),
|
|
180
|
-
items: allItems.filter(
|
|
181
|
-
(x) => x.kind === "booking"
|
|
182
|
-
)
|
|
183
|
-
}
|
|
184
|
-
);
|
|
146
|
+
openBookingDetail(item);
|
|
185
147
|
},
|
|
186
|
-
className:
|
|
148
|
+
className: layoutClassName
|
|
187
149
|
},
|
|
188
|
-
"
|
|
189
|
-
|
|
150
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "truncate" }, item.name),
|
|
151
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "mt-1 opacity-80" }, (0, import_bookingCalendarDateUtils.formatHourLabel)(item.startHour), " -", " ", (0, import_bookingCalendarDateUtils.formatHourLabel)(item.endHour))
|
|
190
152
|
),
|
|
191
|
-
|
|
153
|
+
shrinkForMore && /* @__PURE__ */ import_react.default.createElement(
|
|
192
154
|
"div",
|
|
193
155
|
{
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
setOverflowPopover(null);
|
|
197
|
-
},
|
|
198
|
-
className: `absolute right-0 top-[60px] z-20 flex min-w-[240px] max-h-[360px] flex-col rounded-xl border p-3 shadow-2xl ${isLight ? "theme-panel theme-border" : "border-zinc-700 bg-[#111218]"}`
|
|
156
|
+
className: "relative h-[52px] w-[52px] shrink-0",
|
|
157
|
+
ref: (overflowPopover == null ? void 0 : overflowPopover.courtId) === "month" && (overflowPopover == null ? void 0 : overflowPopover.date) === day.key ? overflowPanelRef : null
|
|
199
158
|
},
|
|
200
159
|
/* @__PURE__ */ import_react.default.createElement(
|
|
201
|
-
"
|
|
160
|
+
"button",
|
|
202
161
|
{
|
|
203
|
-
|
|
162
|
+
onMouseEnter: (e) => {
|
|
163
|
+
e.stopPropagation();
|
|
164
|
+
setOverflowPopover({
|
|
165
|
+
courtId: "month",
|
|
166
|
+
date: day.key,
|
|
167
|
+
items: moreItems,
|
|
168
|
+
pinned: false
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
onClick: (e) => {
|
|
172
|
+
e.stopPropagation();
|
|
173
|
+
setOverflowPopover(null);
|
|
174
|
+
setOverflowListModal(
|
|
175
|
+
(prev) => prev && prev.scope === "month" && prev.date === day.key ? null : {
|
|
176
|
+
scope: "month",
|
|
177
|
+
date: day.key,
|
|
178
|
+
title: (0, import_calendarI18n.tCal)(
|
|
179
|
+
"pisell2.recordBoard.calendar.overflow.listTitleBookings",
|
|
180
|
+
{ date: day.key }
|
|
181
|
+
),
|
|
182
|
+
items: allItems.filter(
|
|
183
|
+
(x) => x.kind === "booking"
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
},
|
|
188
|
+
className: "flex h-[52px] w-[52px] items-center justify-center rounded-xl bg-violet-700/90 text-sm font-semibold text-white"
|
|
204
189
|
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
)
|
|
190
|
+
"+",
|
|
191
|
+
moreCount
|
|
208
192
|
),
|
|
209
|
-
|
|
210
|
-
|
|
193
|
+
(overflowPopover == null ? void 0 : overflowPopover.courtId) === "month" && (overflowPopover == null ? void 0 : overflowPopover.date) === day.key && !overflowListModal && /* @__PURE__ */ import_react.default.createElement(
|
|
194
|
+
"div",
|
|
211
195
|
{
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
196
|
+
onMouseLeave: () => {
|
|
197
|
+
if (!(overflowPopover == null ? void 0 : overflowPopover.pinned))
|
|
198
|
+
setOverflowPopover(null);
|
|
199
|
+
},
|
|
200
|
+
className: `absolute right-0 top-[60px] z-20 flex min-w-[240px] max-h-[360px] flex-col rounded-xl border p-3 shadow-2xl ${isLight ? "theme-panel theme-border" : "border-zinc-700 bg-[#111218]"}`
|
|
201
|
+
},
|
|
202
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
className: `mb-3 shrink-0 text-xs font-semibold ${isLight ? "theme-text-soft" : "text-zinc-300"}`
|
|
206
|
+
},
|
|
207
|
+
(0, import_calendarI18n.tCal)(
|
|
208
|
+
"pisell2.recordBoard.calendar.overflow.bookingsForDay"
|
|
209
|
+
)
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "min-h-0 flex-1 overflow-hidden" }, /* @__PURE__ */ import_react.default.createElement(
|
|
212
|
+
import_OverflowPopover.MonthGridOverflowVirtualList,
|
|
213
|
+
{
|
|
214
|
+
items: overflowPopover.items,
|
|
215
|
+
listWidth: 214,
|
|
216
|
+
onPickItem: openBookingDetail
|
|
217
|
+
}
|
|
218
|
+
))
|
|
219
|
+
)
|
|
217
220
|
)
|
|
218
|
-
)
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
+
);
|
|
222
|
+
}))
|
|
223
|
+
) : null
|
|
221
224
|
);
|
|
222
225
|
}))))
|
|
223
226
|
);
|
|
@@ -192,6 +192,7 @@ var RecordBoardShellFrame = ({ children, className, style, belowToolbar }) => {
|
|
|
192
192
|
() => hasGridContent && ctx.bodyView === "grid",
|
|
193
193
|
[hasGridContent, ctx.bodyView]
|
|
194
194
|
);
|
|
195
|
+
const showGridPagination = showGrid && ctx.gridInfiniteScroll !== true;
|
|
195
196
|
const showFloorMap = (0, import_react.useMemo)(
|
|
196
197
|
() => hasFloorMapSlot && effectiveFloorMapProps != null && ctx.bodyView === "floorMap",
|
|
197
198
|
[hasFloorMapSlot, effectiveFloorMapProps, ctx.bodyView]
|
|
@@ -306,7 +307,7 @@ var RecordBoardShellFrame = ({ children, className, style, belowToolbar }) => {
|
|
|
306
307
|
autoCalc: (_c = (_b = (_a = ctx == null ? void 0 : ctx.childComponentProps) == null ? void 0 : _a.grid) == null ? void 0 : _b.scroll) == null ? void 0 : _c.autoCalc
|
|
307
308
|
},
|
|
308
309
|
gridChildren
|
|
309
|
-
) : showResourceWall ? resourceWallNode : showCalendar ? calendarNode : floorMapNode,
|
|
310
|
+
) : showResourceWall ? resourceWallNode : showCalendar ? calendarNode : floorMapNode, showGridPagination ? /* @__PURE__ */ import_react.default.createElement(import_Pagination.default, null) : null) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showGrid ? gridChildren : showResourceWall ? resourceWallNode : showCalendar ? calendarNode : floorMapNode, showGridPagination ? /* @__PURE__ */ import_react.default.createElement(import_Pagination.default, null) : null);
|
|
310
311
|
const shellStyle = fillHeight && style ? { ...style, ...FILL_HEIGHT_WRAPPER_STYLE } : fillHeight ? FILL_HEIGHT_WRAPPER_STYLE : style;
|
|
311
312
|
const wrapper = /* @__PURE__ */ import_react.default.createElement(import_ShellBodyMetaContext.RecordBoardShellBodyMetaContext.Provider, { value: shellBodyMeta }, /* @__PURE__ */ import_react.default.createElement(
|
|
312
313
|
import_pisellShellFrame.PisellShellFrame,
|
|
@@ -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 列表(多选) */
|