@sia.soul/sia-react-ui 0.1.132 → 0.1.136
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/dist/{chunk-NYU3DJVZ.js → chunk-436QH6XH.js} +10 -2
- package/dist/{chunk-OHIBJFX5.js → chunk-4KNFPQEV.js} +2 -2
- package/dist/{chunk-J3RX7GCZ.js → chunk-L2S7IPSM.js} +1 -1
- package/dist/{chunk-EWEDQ3VJ.js → chunk-UVHC6OEX.js} +70 -5
- package/dist/{chunk-RC5MXFLI.js → chunk-WIRIEIRO.js} +1 -1
- package/dist/{core-DoyeSoBN.d.ts → core-Bkk7-59o.d.ts} +3 -3
- package/dist/{core-DUmn3A2b.d.cts → core-lZIzt-an.d.cts} +3 -3
- package/dist/core.cjs +74 -5
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +3 -3
- package/dist/index.cjs +137 -23
- package/dist/index.css +19 -24
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +63 -18
- package/dist/rich-text-editor.cjs +58 -5
- package/dist/rich-text-editor.js +2 -2
- package/dist/select-date-range.cjs +19 -0
- package/dist/select-date-range.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2484,10 +2484,35 @@ var import_react12 = require("react");
|
|
|
2484
2484
|
|
|
2485
2485
|
// src/components/Navigation.tsx
|
|
2486
2486
|
var import_react10 = require("react");
|
|
2487
|
+
|
|
2488
|
+
// src/components/floatingScrollbarOwnership.ts
|
|
2489
|
+
var targets = /* @__PURE__ */ new Map();
|
|
2490
|
+
function registerFloatingScrollbar(track, target) {
|
|
2491
|
+
targets.set(track, { target, dragging: false });
|
|
2492
|
+
return () => {
|
|
2493
|
+
targets.delete(track);
|
|
2494
|
+
};
|
|
2495
|
+
}
|
|
2496
|
+
function setFloatingScrollbarDragging(track, dragging) {
|
|
2497
|
+
const entry = targets.get(track);
|
|
2498
|
+
if (entry) entry.dragging = dragging;
|
|
2499
|
+
}
|
|
2500
|
+
function resolveFloatingScrollbarTarget(target) {
|
|
2501
|
+
const track = target instanceof Element ? target.closest(".sia-floating-scrollbar") : null;
|
|
2502
|
+
return track && targets.get(track)?.target || target;
|
|
2503
|
+
}
|
|
2504
|
+
function hasFloatingScrollbarInteraction(container) {
|
|
2505
|
+
if (!container) return false;
|
|
2506
|
+
return [...targets].some(([track, entry]) => container.contains(entry.target) && (entry.dragging || track.matches(":hover")));
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
// src/components/Navigation.tsx
|
|
2487
2510
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2488
2511
|
var import_react11 = require("react");
|
|
2489
2512
|
function MenuPopup({
|
|
2490
2513
|
anchorRef,
|
|
2514
|
+
popupRef,
|
|
2515
|
+
keyPath,
|
|
2491
2516
|
open,
|
|
2492
2517
|
placement,
|
|
2493
2518
|
menuId,
|
|
@@ -2518,13 +2543,15 @@ function MenuPopup({
|
|
|
2518
2543
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2519
2544
|
PopupPortal,
|
|
2520
2545
|
{
|
|
2546
|
+
ref: popupRef,
|
|
2521
2547
|
anchorRef,
|
|
2522
2548
|
open: mounted,
|
|
2523
2549
|
placement,
|
|
2524
|
-
offset: 4,
|
|
2550
|
+
offset: placement.startsWith("right") || placement.startsWith("left") ? 16 : 4,
|
|
2525
2551
|
className: `sia-menu__popup sia-menu--${theme}${open ? " is-open" : " is-closing"}`,
|
|
2526
2552
|
style: { fontSize },
|
|
2527
2553
|
"data-sia-menu-owner": menuId,
|
|
2554
|
+
"data-sia-menu-path": JSON.stringify(keyPath),
|
|
2528
2555
|
onMouseEnter,
|
|
2529
2556
|
onMouseLeave,
|
|
2530
2557
|
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "sia-menu__popup-list", role: "menu", children })
|
|
@@ -2539,7 +2566,12 @@ function MenuEntry({
|
|
|
2539
2566
|
reserveIcon
|
|
2540
2567
|
}) {
|
|
2541
2568
|
const anchorRef = (0, import_react10.useRef)(null);
|
|
2569
|
+
const popupRef = (0, import_react10.useRef)(null);
|
|
2542
2570
|
const closeTimerRef = (0, import_react10.useRef)(void 0);
|
|
2571
|
+
const toggleRef = (0, import_react10.useRef)(props.toggle);
|
|
2572
|
+
(0, import_react10.useLayoutEffect)(() => {
|
|
2573
|
+
toggleRef.current = props.toggle;
|
|
2574
|
+
});
|
|
2543
2575
|
const hasChildren = Boolean(item.children?.length);
|
|
2544
2576
|
const isOpen = props.open.includes(item.key);
|
|
2545
2577
|
const isSelected = props.selected.includes(item.key);
|
|
@@ -2557,7 +2589,14 @@ function MenuEntry({
|
|
|
2557
2589
|
}
|
|
2558
2590
|
function scheduleClose() {
|
|
2559
2591
|
cancelClose();
|
|
2560
|
-
closeTimerRef.current = window.setTimeout(() =>
|
|
2592
|
+
closeTimerRef.current = window.setTimeout(() => {
|
|
2593
|
+
const interacting = hasFloatingScrollbarInteraction(popupRef.current) || [...document.querySelectorAll(".sia-menu__popup[data-sia-menu-owner]")].some((popup) => popup.dataset.siaMenuOwner === props.menuId && JSON.parse(popup.dataset.siaMenuPath ?? "[]").includes(item.key) && hasFloatingScrollbarInteraction(popup));
|
|
2594
|
+
if (interacting) {
|
|
2595
|
+
scheduleClose();
|
|
2596
|
+
return;
|
|
2597
|
+
}
|
|
2598
|
+
toggleRef.current(item.key, false);
|
|
2599
|
+
}, 100);
|
|
2561
2600
|
}
|
|
2562
2601
|
const hover = props.triggerSubMenuAction === "hover" && hasChildren && !inlineSubmenu;
|
|
2563
2602
|
const submenu = hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuLevel, { items: item.children ?? [], level: level + 1, parents: [item.key, ...parents], props }) : null;
|
|
@@ -2600,6 +2639,8 @@ function MenuEntry({
|
|
|
2600
2639
|
MenuPopup,
|
|
2601
2640
|
{
|
|
2602
2641
|
anchorRef,
|
|
2642
|
+
popupRef,
|
|
2643
|
+
keyPath: path,
|
|
2603
2644
|
open: isOpen,
|
|
2604
2645
|
placement: popupPlacement,
|
|
2605
2646
|
menuId: props.menuId,
|
|
@@ -2660,6 +2701,22 @@ function Menu({
|
|
|
2660
2701
|
const rootRef = (0, import_react10.useRef)(null);
|
|
2661
2702
|
const [selected, setSelected] = useControllableState({ value: selectedKeys, defaultValue: defaultSelectedKeys });
|
|
2662
2703
|
const [open, setOpen] = useControllableState({ value: openKeys, defaultValue: defaultOpenKeys, onChange: (next) => onOpenChange?.([...next]) });
|
|
2704
|
+
const pendingOpenRef = (0, import_react10.useRef)(open);
|
|
2705
|
+
(0, import_react10.useLayoutEffect)(() => {
|
|
2706
|
+
pendingOpenRef.current = open;
|
|
2707
|
+
});
|
|
2708
|
+
const popupPaths = (0, import_react10.useMemo)(() => {
|
|
2709
|
+
const paths = /* @__PURE__ */ new Map();
|
|
2710
|
+
const visit = (entries, parents) => {
|
|
2711
|
+
for (const entry of entries) {
|
|
2712
|
+
const path = [...parents, entry.key];
|
|
2713
|
+
paths.set(entry.key, path);
|
|
2714
|
+
if (entry.children) visit(entry.children, path);
|
|
2715
|
+
}
|
|
2716
|
+
};
|
|
2717
|
+
visit(items, []);
|
|
2718
|
+
return paths;
|
|
2719
|
+
}, [items]);
|
|
2663
2720
|
const revealedKey = (0, import_react10.useRef)();
|
|
2664
2721
|
const firstSelected = selected[0];
|
|
2665
2722
|
(0, import_react10.useLayoutEffect)(() => {
|
|
@@ -2687,7 +2744,7 @@ function Menu({
|
|
|
2687
2744
|
(0, import_react10.useEffect)(() => {
|
|
2688
2745
|
if (mode === "inline" || !open.length) return void 0;
|
|
2689
2746
|
const closeOutside = (event) => {
|
|
2690
|
-
const target = event.target;
|
|
2747
|
+
const target = resolveFloatingScrollbarTarget(event.target);
|
|
2691
2748
|
if (rootRef.current?.contains(target)) return;
|
|
2692
2749
|
const owner = target instanceof Element ? target.closest("[data-sia-menu-owner]")?.getAttribute("data-sia-menu-owner") : null;
|
|
2693
2750
|
if (owner !== menuId) setOpen([]);
|
|
@@ -2696,8 +2753,14 @@ function Menu({
|
|
|
2696
2753
|
return () => document.removeEventListener("pointerdown", closeOutside);
|
|
2697
2754
|
}, [menuId, mode, open.length, setOpen]);
|
|
2698
2755
|
function toggle(key, force) {
|
|
2699
|
-
const
|
|
2700
|
-
|
|
2756
|
+
const current = pendingOpenRef.current;
|
|
2757
|
+
const shouldOpen = force ?? !current.includes(key);
|
|
2758
|
+
if (shouldOpen === current.includes(key)) return;
|
|
2759
|
+
const cascading = mode !== "inline" || inlineCollapsed;
|
|
2760
|
+
const branch = popupPaths.get(key) ?? [key];
|
|
2761
|
+
const next = shouldOpen ? [...current.filter((item) => !cascading || branch.includes(item)), key] : current.filter((item) => item !== key && (!cascading || !popupPaths.get(item)?.includes(key)));
|
|
2762
|
+
pendingOpenRef.current = next;
|
|
2763
|
+
setOpen(next);
|
|
2701
2764
|
}
|
|
2702
2765
|
function select(item, keyPath, domEvent) {
|
|
2703
2766
|
const info = { key: item.key, keyPath, domEvent, item };
|
|
@@ -4003,6 +4066,7 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
4003
4066
|
event.preventDefault();
|
|
4004
4067
|
event.stopPropagation();
|
|
4005
4068
|
entry.dragging = true;
|
|
4069
|
+
setFloatingScrollbarDragging(track, true);
|
|
4006
4070
|
showEntry(entry);
|
|
4007
4071
|
thumb.setPointerCapture(event.pointerId);
|
|
4008
4072
|
const startPointer = axis === "vertical" ? event.clientY : event.clientX;
|
|
@@ -4023,6 +4087,7 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
4023
4087
|
const onPointerUp = (upEvent) => {
|
|
4024
4088
|
if (upEvent.pointerId !== event.pointerId) return;
|
|
4025
4089
|
entry.dragging = false;
|
|
4090
|
+
setFloatingScrollbarDragging(track, false);
|
|
4026
4091
|
thumb.releasePointerCapture(event.pointerId);
|
|
4027
4092
|
window.removeEventListener("pointermove", onPointerMove);
|
|
4028
4093
|
window.removeEventListener("pointerup", onPointerUp);
|
|
@@ -4054,6 +4119,8 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
4054
4119
|
if (entries.has(target)) return;
|
|
4055
4120
|
const horizontal = createTrack("horizontal");
|
|
4056
4121
|
const vertical = createTrack("vertical");
|
|
4122
|
+
const releaseHorizontalOwner = registerFloatingScrollbar(horizontal.track, target);
|
|
4123
|
+
const releaseVerticalOwner = registerFloatingScrollbar(vertical.track, target);
|
|
4057
4124
|
layer.append(horizontal.track, vertical.track);
|
|
4058
4125
|
const onPointerEnter = () => {
|
|
4059
4126
|
const entry2 = entries.get(target);
|
|
@@ -4095,6 +4162,8 @@ function FloatingScrollbarProvider({ disabled = false, targetRef }) {
|
|
|
4095
4162
|
if (entry.hideTimer !== null) window.clearTimeout(entry.hideTimer);
|
|
4096
4163
|
cleanupHorizontal();
|
|
4097
4164
|
cleanupVertical();
|
|
4165
|
+
releaseHorizontalOwner();
|
|
4166
|
+
releaseVerticalOwner();
|
|
4098
4167
|
target.removeEventListener("pointerenter", onPointerEnter);
|
|
4099
4168
|
target.removeEventListener("pointerleave", onPointerLeave);
|
|
4100
4169
|
target.removeEventListener("scroll", onScroll);
|
|
@@ -7456,8 +7525,8 @@ var FormStore = class {
|
|
|
7456
7525
|
}
|
|
7457
7526
|
validateFields = async (names) => {
|
|
7458
7527
|
const fields = names?.map((name) => this.fields.get(pathKey2(name))).filter(Boolean);
|
|
7459
|
-
const
|
|
7460
|
-
const results = await Promise.all(
|
|
7528
|
+
const targets2 = fields ?? [...this.fields.values()];
|
|
7529
|
+
const results = await Promise.all(targets2.map(async (field) => ({ field, errors: await this.validateField(field.name) })));
|
|
7461
7530
|
const errorFields = results.filter((item) => item.errors.length).map((item) => ({ name: item.field.name, errors: item.errors }));
|
|
7462
7531
|
const values = this.getFieldsValue();
|
|
7463
7532
|
if (errorFields.length) throw { values, errorFields };
|
|
@@ -13774,6 +13843,41 @@ function createRowIdentity() {
|
|
|
13774
13843
|
};
|
|
13775
13844
|
}
|
|
13776
13845
|
|
|
13846
|
+
// src/components/Table/cellFocus.ts
|
|
13847
|
+
function playCellFocusGlow(cell, isVisible, onFinish) {
|
|
13848
|
+
const namespace = "http://www.w3.org/2000/svg";
|
|
13849
|
+
const glow = document.createElementNS(namespace, "svg");
|
|
13850
|
+
glow.classList.add("sia-table__cell-focus-glow");
|
|
13851
|
+
glow.setAttribute("aria-hidden", "true");
|
|
13852
|
+
const path = document.createElementNS(namespace, "path");
|
|
13853
|
+
path.setAttribute("pathLength", "100");
|
|
13854
|
+
glow.appendChild(path);
|
|
13855
|
+
let frame = 0, disposed = false;
|
|
13856
|
+
const cleanup2 = () => {
|
|
13857
|
+
if (disposed) return;
|
|
13858
|
+
disposed = true;
|
|
13859
|
+
cancelAnimationFrame(frame);
|
|
13860
|
+
glow.remove();
|
|
13861
|
+
onFinish();
|
|
13862
|
+
};
|
|
13863
|
+
const position = () => {
|
|
13864
|
+
if (!cell.isConnected || !isVisible()) {
|
|
13865
|
+
cleanup2();
|
|
13866
|
+
return;
|
|
13867
|
+
}
|
|
13868
|
+
const rect = cell.getBoundingClientRect();
|
|
13869
|
+
Object.assign(glow.style, { left: `${rect.left}px`, top: `${rect.top}px`, width: `${rect.width}px`, height: `${rect.height}px` });
|
|
13870
|
+
path.setAttribute("d", `M 2 2 H ${rect.width - 2} V ${rect.height - 2} H 2 Z`);
|
|
13871
|
+
frame = requestAnimationFrame(position);
|
|
13872
|
+
};
|
|
13873
|
+
position();
|
|
13874
|
+
if (!disposed) document.body.appendChild(glow);
|
|
13875
|
+
glow.addEventListener("animationend", (event) => {
|
|
13876
|
+
if (event.target === glow) cleanup2();
|
|
13877
|
+
});
|
|
13878
|
+
return cleanup2;
|
|
13879
|
+
}
|
|
13880
|
+
|
|
13777
13881
|
// src/components/Table/Table.tsx
|
|
13778
13882
|
var import_react57 = require("react");
|
|
13779
13883
|
|
|
@@ -16528,7 +16632,7 @@ function TableInner(props, ref) {
|
|
|
16528
16632
|
const cellGlow = (0, import_react57.useRef)(null);
|
|
16529
16633
|
(0, import_react57.useEffect)(() => () => {
|
|
16530
16634
|
cellFocusRequest.current++;
|
|
16531
|
-
cellGlow.current?.
|
|
16635
|
+
cellGlow.current?.();
|
|
16532
16636
|
}, []);
|
|
16533
16637
|
const tableRef = (0, import_react57.useRef)(null);
|
|
16534
16638
|
useScrollbarProximity();
|
|
@@ -16907,7 +17011,7 @@ function TableInner(props, ref) {
|
|
|
16907
17011
|
},
|
|
16908
17012
|
focusCell: async (key, columnKey, options) => {
|
|
16909
17013
|
const request = ++cellFocusRequest.current;
|
|
16910
|
-
cellGlow.current?.
|
|
17014
|
+
cellGlow.current?.();
|
|
16911
17015
|
cellGlow.current = null;
|
|
16912
17016
|
const viewport = scrollRef.current;
|
|
16913
17017
|
const columnIndex = leafColumns.findIndex((column2) => column2.key === columnKey);
|
|
@@ -16922,28 +17026,37 @@ function TableInner(props, ref) {
|
|
|
16922
17026
|
if (canvas) setScrollLeft(viewport.scrollLeft);
|
|
16923
17027
|
}
|
|
16924
17028
|
updateScrollMetrics();
|
|
16925
|
-
|
|
17029
|
+
let previousRect;
|
|
17030
|
+
for (let frame = 0; frame < 20; frame++) {
|
|
16926
17031
|
await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
16927
17032
|
if (request !== cellFocusRequest.current || !viewport.isConnected || !viewport.clientHeight) return false;
|
|
16928
17033
|
const row = Array.from(tableRef.current?.tBodies[0]?.rows ?? []).find((item) => item.dataset.rowKey === String(key));
|
|
16929
17034
|
const cell = Array.from(row?.cells ?? []).find((item) => item.dataset.columnKey === columnKey);
|
|
16930
17035
|
if (!cell || !cell.offsetWidth) continue;
|
|
16931
17036
|
api.scrollToRow(key);
|
|
17037
|
+
const visible = () => {
|
|
17038
|
+
if (!cell.isConnected || !viewport.clientHeight || !cell.offsetWidth) return false;
|
|
17039
|
+
const bounds = viewport.getBoundingClientRect(), rect2 = cell.getBoundingClientRect();
|
|
17040
|
+
const top = bounds.top + viewport.clientTop + (stickyHeader ? tableRef.current?.tHead?.offsetHeight ?? 0 : 0);
|
|
17041
|
+
const bottom = bounds.top + viewport.clientTop + viewport.clientHeight - (tableRef.current?.tFoot?.offsetHeight ?? 0);
|
|
17042
|
+
const fixed = normalizeFixed(column.fixed);
|
|
17043
|
+
return rect2.top >= Math.max(0, top) - 1 && rect2.bottom <= Math.min(window.innerHeight, bottom) + 1 && rect2.left >= Math.max(0, bounds.left + viewport.clientLeft + (fixed ? 0 : left)) - 1 && rect2.right <= Math.min(window.innerWidth, bounds.left + viewport.clientLeft + viewport.clientWidth - (fixed ? 0 : right)) + 1;
|
|
17044
|
+
};
|
|
17045
|
+
const rect = cell.getBoundingClientRect();
|
|
17046
|
+
const stable = previousRect && Math.abs(rect.top - previousRect.top) < 0.5 && Math.abs(rect.left - previousRect.left) < 0.5 && Math.abs(rect.width - previousRect.width) < 0.5 && Math.abs(rect.height - previousRect.height) < 0.5;
|
|
17047
|
+
previousRect = rect;
|
|
17048
|
+
if (!visible() || !stable) continue;
|
|
16932
17049
|
const address = { rowKey: key, columnKey };
|
|
16933
17050
|
pluginApisRef.current.cellSelection?.setRange({ anchor: address, focus: address });
|
|
16934
17051
|
cell.tabIndex = -1;
|
|
16935
17052
|
cell.focus({ preventScroll: true });
|
|
17053
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
17054
|
+
if (request !== cellFocusRequest.current || !visible()) return false;
|
|
16936
17055
|
if (options?.highlight !== false) {
|
|
16937
|
-
const
|
|
16938
|
-
|
|
16939
|
-
glow.setAttribute("aria-hidden", "true");
|
|
16940
|
-
cell.appendChild(glow);
|
|
16941
|
-
cellGlow.current = glow;
|
|
16942
|
-
glow.addEventListener("animationend", (event) => {
|
|
16943
|
-
if (event.target !== glow) return;
|
|
16944
|
-
glow.remove();
|
|
16945
|
-
if (cellGlow.current === glow) cellGlow.current = null;
|
|
17056
|
+
const cleanup2 = playCellFocusGlow(cell, visible, () => {
|
|
17057
|
+
cellGlow.current = null;
|
|
16946
17058
|
});
|
|
17059
|
+
cellGlow.current = cleanup2;
|
|
16947
17060
|
}
|
|
16948
17061
|
return true;
|
|
16949
17062
|
}
|
|
@@ -17702,7 +17815,8 @@ function createWorksheetPlugin(options) {
|
|
|
17702
17815
|
...column,
|
|
17703
17816
|
render: (value, record, index, info) => {
|
|
17704
17817
|
const area = bounds(), cols = columns();
|
|
17705
|
-
const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key &&
|
|
17818
|
+
const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && // 填充入口与编辑权限一致,避免只读格或保存锁定后仍暗示可以拖拽修改。
|
|
17819
|
+
editable(record, column) && (suppressEditing || !context.state.editing);
|
|
17706
17820
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
17707
17821
|
render ? render(value, record, index, info) : value,
|
|
17708
17822
|
handle && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
@@ -21003,9 +21117,9 @@ function chordMatrixLayout(matrix, options = {}) {
|
|
|
21003
21117
|
let angle = options.startAngle ?? -Math.PI / 2;
|
|
21004
21118
|
const subSort = options.legacySubSort ? options.sortSub === "ascending" ? "ascending" : options.sort === "descending" ? "descending" : "none" : options.sortSub;
|
|
21005
21119
|
const groups = order.map((index) => {
|
|
21006
|
-
const start = angle,
|
|
21007
|
-
if (subSort && subSort !== "none")
|
|
21008
|
-
for (const target of
|
|
21120
|
+
const start = angle, targets2 = Array.from({ length: n }, (_, i) => i);
|
|
21121
|
+
if (subSort && subSort !== "none") targets2.sort((a, b) => (values[index][a] - values[index][b]) * (subSort === "ascending" ? 1 : -1) || a - b);
|
|
21122
|
+
for (const target of targets2) {
|
|
21009
21123
|
const value = values[index][target], end = angle + direction * value * factor;
|
|
21010
21124
|
segments[index][target] = { index, target, start: angle, end, value };
|
|
21011
21125
|
angle = end;
|
package/dist/index.css
CHANGED
|
@@ -11188,37 +11188,31 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11188
11188
|
|
|
11189
11189
|
/* src/components/Table/cellFocus.css */
|
|
11190
11190
|
.sia-table__cell-focus-glow {
|
|
11191
|
-
position:
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
overflow: hidden;
|
|
11191
|
+
position: fixed;
|
|
11192
|
+
z-index: 2147483647;
|
|
11193
|
+
overflow: visible;
|
|
11195
11194
|
pointer-events: none;
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
animation: sia-table-cell-focus-fade 900ms ease-out forwards;
|
|
11195
|
+
fill: none;
|
|
11196
|
+
animation: sia-table-cell-focus-fade 1100ms linear forwards;
|
|
11199
11197
|
}
|
|
11200
|
-
.sia-table__cell-focus-glow
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
transparent 20%,
|
|
11208
|
-
color-mix(in srgb, var(--sia-color-primary) 55%, white) 50%,
|
|
11209
|
-
transparent 80%);
|
|
11210
|
-
animation: sia-table-cell-focus-sweep 500ms ease-out forwards;
|
|
11198
|
+
.sia-table__cell-focus-glow path {
|
|
11199
|
+
stroke: #ff303b;
|
|
11200
|
+
stroke-width: 4px;
|
|
11201
|
+
stroke-linecap: round;
|
|
11202
|
+
stroke-dashoffset: 0;
|
|
11203
|
+
filter: drop-shadow(0 0 3px rgb(255 48 59 / 55%));
|
|
11204
|
+
animation: sia-table-cell-focus-grow 900ms linear forwards;
|
|
11211
11205
|
}
|
|
11212
|
-
@keyframes sia-table-cell-focus-
|
|
11206
|
+
@keyframes sia-table-cell-focus-grow {
|
|
11213
11207
|
from {
|
|
11214
|
-
|
|
11208
|
+
stroke-dasharray: 0px 100px;
|
|
11215
11209
|
}
|
|
11216
11210
|
to {
|
|
11217
|
-
|
|
11211
|
+
stroke-dasharray: 100px 0px;
|
|
11218
11212
|
}
|
|
11219
11213
|
}
|
|
11220
11214
|
@keyframes sia-table-cell-focus-fade {
|
|
11221
|
-
0%,
|
|
11215
|
+
0%, 82% {
|
|
11222
11216
|
opacity: 1;
|
|
11223
11217
|
}
|
|
11224
11218
|
100% {
|
|
@@ -11229,8 +11223,9 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
|
|
|
11229
11223
|
.sia-table__cell-focus-glow {
|
|
11230
11224
|
animation-duration: 200ms;
|
|
11231
11225
|
}
|
|
11232
|
-
.sia-table__cell-focus-glow
|
|
11233
|
-
|
|
11226
|
+
.sia-table__cell-focus-glow path {
|
|
11227
|
+
animation: none;
|
|
11228
|
+
stroke-dasharray: none;
|
|
11234
11229
|
}
|
|
11235
11230
|
}
|
|
11236
11231
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
4
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-lZIzt-an.cjs';
|
|
4
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-lZIzt-an.cjs';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
|
|
6
6
|
import { B as ButtonProps, a as ButtonSize } from './Button-O_pNB3SQ.cjs';
|
|
7
7
|
export { b as Button, c as ButtonVariant } from './Button-O_pNB3SQ.cjs';
|
|
@@ -2361,9 +2361,9 @@ interface TableRef<T> {
|
|
|
2361
2361
|
scrollTo: (options: ScrollToOptions) => void;
|
|
2362
2362
|
/** 按 rowKey 定位当前筛选、排序、分页及树展开后列表中的行,仅在该行被遮挡时立即纵向滚动,使其避开吸顶表头和合计行;支持虚拟列表,不改变横向位置或焦点。返回是否找到目标且视口可见;目标被筛掉、位于其他页、表格隐藏或未挂载时返回 false,不自动切页。应在数据提交和弹框显示后调用。 */
|
|
2363
2363
|
scrollToRow: (key: TableKey) => boolean;
|
|
2364
|
-
/**
|
|
2364
|
+
/** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载、位置稳定且整格在可视区后返回成功,再由顶层浮层从左上角沿边框顺时针增长红线:尾端固定,约 900 毫秒围满一圈,随后 200 毫秒渐隐消失;不拦截操作,减少动态效果时仅红框淡出。隐藏列、其它页、无法完整显示的单元格、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用;再次定位、目标滚出可视区或卸载会清理动效。 */
|
|
2365
2365
|
focusCell: (rowKey: TableKey, columnKey: string, options?: {
|
|
2366
|
-
/**
|
|
2366
|
+
/** 是否在目标可见后播放尾端固定、沿边框增长一圈的红光渐隐,默认 true;false 仅滚动、选中和聚焦。 */
|
|
2367
2367
|
highlight?: boolean;
|
|
2368
2368
|
}) => Promise<boolean>;
|
|
2369
2369
|
/** 切换加载状态。 */
|
|
@@ -3094,6 +3094,7 @@ interface WorksheetState {
|
|
|
3094
3094
|
* 与 Table 默认单元格选择配合,勿再同时安装 createEditablePlugin;使用稳定 rowKey。
|
|
3095
3095
|
* 每个表格用 useMemo 创建独立实例,onChange 必须同步更新不可变 dataSource;外部换表自动清空历史。
|
|
3096
3096
|
* 输入框中的原生复制、粘贴和撤销保留;快捷键只在当前工作表内生效,不发送网络请求。
|
|
3097
|
+
* 填充柄仅在选区右下角单元格可编辑时显示,遵循 editable 与 editable.canEdit;只读格仍可选中和复制。
|
|
3097
3098
|
*/
|
|
3098
3099
|
declare function createWorksheetPlugin<T extends Record<string, unknown>>(options: TableWorksheetPluginOptions<T>): TablePlugin<T, WorksheetState, TableWorksheetApi<T>>;
|
|
3099
3100
|
|
|
@@ -3127,7 +3128,7 @@ interface FloatingScrollbarProviderProps {
|
|
|
3127
3128
|
/** 仅接管指定容器;不传时接管页面中的滚动容器。 */
|
|
3128
3129
|
targetRef?: RefObject<HTMLElement | null>;
|
|
3129
3130
|
}
|
|
3130
|
-
/**
|
|
3131
|
+
/** 为页面或指定容器接入浮动滚动条;悬停、滚动或拖动时显示,离开且停止交互后隐藏,不占用布局宽度。轨道保留滚动容器的交互归属,供菜单判断内部操作;布局变化重新发现容器,定尺寸脱离文档流元素的定位变化仅复核相关子树与祖先。 */
|
|
3131
3132
|
declare function FloatingScrollbarProvider({ disabled, targetRef }: FloatingScrollbarProviderProps): null;
|
|
3132
3133
|
|
|
3133
3134
|
/** SiaTheme的模式类型。 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
|
|
3
|
-
import { T as TagStatus, B as BadgeProps } from './core-
|
|
4
|
-
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-
|
|
3
|
+
import { T as TagStatus, B as BadgeProps } from './core-Bkk7-59o.js';
|
|
4
|
+
export { a as Badge, b as BadgeRibbonProps, c as BadgeStatus, d as Breadcrumb, e as BreadcrumbItem, f as BreadcrumbProps, C as Calendar, g as CalendarProps, h as Card, i as CardAccent, j as CardProps, k as Carousel, l as CarouselProps, m as CarouselRef, n as Collapse, o as CollapseItem, p as CollapseKey, q as CollapseProps, D as Dropdown, r as DropdownButtonProps, s as DropdownMenuProps, t as DropdownOpenSource, u as DropdownPlacement, v as DropdownProps, w as DropdownTrigger, F as FILLED_ICON_NAMES, x as FilledIconName, y as FloatButton, z as FloatButtonBackTopProps, A as FloatButtonGroupProps, E as FloatButtonProps, G as FloatButtonShape, H as FloatingPlacement, I as FloatingTrigger, J as ICON_NAMES, K as Icon, L as IconName, M as IconProps, N as IconVariant, O as Image, P as ImagePreview, Q as ImagePreviewConfig, R as ImagePreviewGroup, S as ImagePreviewGroupProps, U as ImagePreviewProps, V as ImageProps, W as Input, X as InputProps, Y as Menu, Z as MenuClickInfo, _ as MenuItem, $ as MenuMode, a0 as MenuProps, a1 as MenuTheme, a2 as MessageConfig, a3 as MessageHandle, a4 as MessageKey, a5 as MessageType, a6 as NotificationConfig, a7 as NotificationPlacement, a8 as NotificationType, a9 as Popconfirm, aa as PopconfirmProps, ab as Popover, ac as PopoverProps, ad as Progress, ae as ProgressProps, af as ProgressStatus, ag as Rate, ah as RateProps, ai as Result, aj as ResultProps, ak as ResultStatus, al as Segmented, am as SegmentedOption, an as SegmentedProps, ao as SegmentedValue, ap as Spin, aq as SpinProps, ar as StepItem, as as StepStatus, at as Steps, au as StepsProps, av as TabItem, aw as Tabs, ax as TabsContextMenuClickInfo, ay as TabsOrientation, az as TabsPosition, aA as TabsProps, aB as TabsType, aC as Tag, aD as TagProps, aE as TagSize, aF as TagVariant, aG as Timeline, aH as TimelineItem, aI as TimelineProps, aJ as Toolbar, aK as ToolbarItem, aL as ToolbarProps, aM as Tooltip, aN as TooltipProps, aO as Tour, aP as TourProps, aQ as TourStep, aR as Tree, aS as TreeDropPosition, aT as TreeKey, aU as TreeNode, aV as TreeProps, aW as Typography, aX as TypographyLinkProps, aY as TypographyProps, aZ as TypographyTitleProps, a_ as TypographyType, a$ as Upload, b0 as UploadChangeInfo, b1 as UploadDraggerProps, b2 as UploadFile, b3 as UploadFileStatus, b4 as UploadHttpRequest, b5 as UploadItemActions, b6 as UploadProps, b7 as UploadRef, b8 as UploadRejectInfo, b9 as UploadRequestHandle, ba as UploadRequestOptions, bb as Watermark, bc as WatermarkFont, bd as WatermarkProps, be as message, bf as notification } from './core-Bkk7-59o.js';
|
|
5
5
|
import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
|
|
6
6
|
import { B as ButtonProps, a as ButtonSize } from './Button-BiL3Wjsd.js';
|
|
7
7
|
export { b as Button, c as ButtonVariant } from './Button-BiL3Wjsd.js';
|
|
@@ -2361,9 +2361,9 @@ interface TableRef<T> {
|
|
|
2361
2361
|
scrollTo: (options: ScrollToOptions) => void;
|
|
2362
2362
|
/** 按 rowKey 定位当前筛选、排序、分页及树展开后列表中的行,仅在该行被遮挡时立即纵向滚动,使其避开吸顶表头和合计行;支持虚拟列表,不改变横向位置或焦点。返回是否找到目标且视口可见;目标被筛掉、位于其他页、表格隐藏或未挂载时返回 false,不自动切页。应在数据提交和弹框显示后调用。 */
|
|
2363
2363
|
scrollToRow: (key: TableKey) => boolean;
|
|
2364
|
-
/**
|
|
2364
|
+
/** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载、位置稳定且整格在可视区后返回成功,再由顶层浮层从左上角沿边框顺时针增长红线:尾端固定,约 900 毫秒围满一圈,随后 200 毫秒渐隐消失;不拦截操作,减少动态效果时仅红框淡出。隐藏列、其它页、无法完整显示的单元格、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用;再次定位、目标滚出可视区或卸载会清理动效。 */
|
|
2365
2365
|
focusCell: (rowKey: TableKey, columnKey: string, options?: {
|
|
2366
|
-
/**
|
|
2366
|
+
/** 是否在目标可见后播放尾端固定、沿边框增长一圈的红光渐隐,默认 true;false 仅滚动、选中和聚焦。 */
|
|
2367
2367
|
highlight?: boolean;
|
|
2368
2368
|
}) => Promise<boolean>;
|
|
2369
2369
|
/** 切换加载状态。 */
|
|
@@ -3094,6 +3094,7 @@ interface WorksheetState {
|
|
|
3094
3094
|
* 与 Table 默认单元格选择配合,勿再同时安装 createEditablePlugin;使用稳定 rowKey。
|
|
3095
3095
|
* 每个表格用 useMemo 创建独立实例,onChange 必须同步更新不可变 dataSource;外部换表自动清空历史。
|
|
3096
3096
|
* 输入框中的原生复制、粘贴和撤销保留;快捷键只在当前工作表内生效,不发送网络请求。
|
|
3097
|
+
* 填充柄仅在选区右下角单元格可编辑时显示,遵循 editable 与 editable.canEdit;只读格仍可选中和复制。
|
|
3097
3098
|
*/
|
|
3098
3099
|
declare function createWorksheetPlugin<T extends Record<string, unknown>>(options: TableWorksheetPluginOptions<T>): TablePlugin<T, WorksheetState, TableWorksheetApi<T>>;
|
|
3099
3100
|
|
|
@@ -3127,7 +3128,7 @@ interface FloatingScrollbarProviderProps {
|
|
|
3127
3128
|
/** 仅接管指定容器;不传时接管页面中的滚动容器。 */
|
|
3128
3129
|
targetRef?: RefObject<HTMLElement | null>;
|
|
3129
3130
|
}
|
|
3130
|
-
/**
|
|
3131
|
+
/** 为页面或指定容器接入浮动滚动条;悬停、滚动或拖动时显示,离开且停止交互后隐藏,不占用布局宽度。轨道保留滚动容器的交互归属,供菜单判断内部操作;布局变化重新发现容器,定尺寸脱离文档流元素的定位变化仅复核相关子树与祖先。 */
|
|
3131
3132
|
declare function FloatingScrollbarProvider({ disabled, targetRef }: FloatingScrollbarProviderProps): null;
|
|
3132
3133
|
|
|
3133
3134
|
/** SiaTheme的模式类型。 */
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
Watermark,
|
|
83
83
|
message,
|
|
84
84
|
notification
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-4KNFPQEV.js";
|
|
86
86
|
import "./chunk-RX242MUO.js";
|
|
87
87
|
import {
|
|
88
88
|
MarkdownEditor
|
|
@@ -90,12 +90,12 @@ import {
|
|
|
90
90
|
import {
|
|
91
91
|
RichTextContent,
|
|
92
92
|
RichTextEditor
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-WIRIEIRO.js";
|
|
94
94
|
import {
|
|
95
95
|
DatePicker,
|
|
96
96
|
SelectDateRange,
|
|
97
97
|
TimePanel
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-L2S7IPSM.js";
|
|
99
99
|
import {
|
|
100
100
|
Checkbox,
|
|
101
101
|
FloatingScrollbarProvider,
|
|
@@ -107,14 +107,14 @@ import {
|
|
|
107
107
|
Tooltip,
|
|
108
108
|
Tree,
|
|
109
109
|
useScrollbarProximity
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-436QH6XH.js";
|
|
111
111
|
import {
|
|
112
112
|
Dropdown,
|
|
113
113
|
Input,
|
|
114
114
|
Menu,
|
|
115
115
|
Segmented,
|
|
116
116
|
Steps
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-UVHC6OEX.js";
|
|
118
118
|
import {
|
|
119
119
|
TextArea
|
|
120
120
|
} from "./chunk-SCEHVGKV.js";
|
|
@@ -5698,6 +5698,41 @@ function createRowIdentity() {
|
|
|
5698
5698
|
};
|
|
5699
5699
|
}
|
|
5700
5700
|
|
|
5701
|
+
// src/components/Table/cellFocus.ts
|
|
5702
|
+
function playCellFocusGlow(cell, isVisible, onFinish) {
|
|
5703
|
+
const namespace = "http://www.w3.org/2000/svg";
|
|
5704
|
+
const glow = document.createElementNS(namespace, "svg");
|
|
5705
|
+
glow.classList.add("sia-table__cell-focus-glow");
|
|
5706
|
+
glow.setAttribute("aria-hidden", "true");
|
|
5707
|
+
const path = document.createElementNS(namespace, "path");
|
|
5708
|
+
path.setAttribute("pathLength", "100");
|
|
5709
|
+
glow.appendChild(path);
|
|
5710
|
+
let frame = 0, disposed = false;
|
|
5711
|
+
const cleanup = () => {
|
|
5712
|
+
if (disposed) return;
|
|
5713
|
+
disposed = true;
|
|
5714
|
+
cancelAnimationFrame(frame);
|
|
5715
|
+
glow.remove();
|
|
5716
|
+
onFinish();
|
|
5717
|
+
};
|
|
5718
|
+
const position = () => {
|
|
5719
|
+
if (!cell.isConnected || !isVisible()) {
|
|
5720
|
+
cleanup();
|
|
5721
|
+
return;
|
|
5722
|
+
}
|
|
5723
|
+
const rect = cell.getBoundingClientRect();
|
|
5724
|
+
Object.assign(glow.style, { left: `${rect.left}px`, top: `${rect.top}px`, width: `${rect.width}px`, height: `${rect.height}px` });
|
|
5725
|
+
path.setAttribute("d", `M 2 2 H ${rect.width - 2} V ${rect.height - 2} H 2 Z`);
|
|
5726
|
+
frame = requestAnimationFrame(position);
|
|
5727
|
+
};
|
|
5728
|
+
position();
|
|
5729
|
+
if (!disposed) document.body.appendChild(glow);
|
|
5730
|
+
glow.addEventListener("animationend", (event) => {
|
|
5731
|
+
if (event.target === glow) cleanup();
|
|
5732
|
+
});
|
|
5733
|
+
return cleanup;
|
|
5734
|
+
}
|
|
5735
|
+
|
|
5701
5736
|
// src/components/Table/Table.tsx
|
|
5702
5737
|
import { Fragment as Fragment9, forwardRef as forwardRef5, isValidElement as isValidElement4, memo, useCallback as useCallback2, useEffect as useEffect15, useImperativeHandle, useMemo as useMemo9, useRef as useRef19, useState as useState22 } from "react";
|
|
5703
5738
|
|
|
@@ -8452,7 +8487,7 @@ function TableInner(props, ref) {
|
|
|
8452
8487
|
const cellGlow = useRef19(null);
|
|
8453
8488
|
useEffect15(() => () => {
|
|
8454
8489
|
cellFocusRequest.current++;
|
|
8455
|
-
cellGlow.current?.
|
|
8490
|
+
cellGlow.current?.();
|
|
8456
8491
|
}, []);
|
|
8457
8492
|
const tableRef = useRef19(null);
|
|
8458
8493
|
useScrollbarProximity();
|
|
@@ -8831,7 +8866,7 @@ function TableInner(props, ref) {
|
|
|
8831
8866
|
},
|
|
8832
8867
|
focusCell: async (key, columnKey, options) => {
|
|
8833
8868
|
const request = ++cellFocusRequest.current;
|
|
8834
|
-
cellGlow.current?.
|
|
8869
|
+
cellGlow.current?.();
|
|
8835
8870
|
cellGlow.current = null;
|
|
8836
8871
|
const viewport = scrollRef.current;
|
|
8837
8872
|
const columnIndex = leafColumns.findIndex((column2) => column2.key === columnKey);
|
|
@@ -8846,28 +8881,37 @@ function TableInner(props, ref) {
|
|
|
8846
8881
|
if (canvas) setScrollLeft(viewport.scrollLeft);
|
|
8847
8882
|
}
|
|
8848
8883
|
updateScrollMetrics();
|
|
8849
|
-
|
|
8884
|
+
let previousRect;
|
|
8885
|
+
for (let frame = 0; frame < 20; frame++) {
|
|
8850
8886
|
await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
8851
8887
|
if (request !== cellFocusRequest.current || !viewport.isConnected || !viewport.clientHeight) return false;
|
|
8852
8888
|
const row = Array.from(tableRef.current?.tBodies[0]?.rows ?? []).find((item) => item.dataset.rowKey === String(key));
|
|
8853
8889
|
const cell = Array.from(row?.cells ?? []).find((item) => item.dataset.columnKey === columnKey);
|
|
8854
8890
|
if (!cell || !cell.offsetWidth) continue;
|
|
8855
8891
|
api.scrollToRow(key);
|
|
8892
|
+
const visible = () => {
|
|
8893
|
+
if (!cell.isConnected || !viewport.clientHeight || !cell.offsetWidth) return false;
|
|
8894
|
+
const bounds = viewport.getBoundingClientRect(), rect2 = cell.getBoundingClientRect();
|
|
8895
|
+
const top = bounds.top + viewport.clientTop + (stickyHeader ? tableRef.current?.tHead?.offsetHeight ?? 0 : 0);
|
|
8896
|
+
const bottom = bounds.top + viewport.clientTop + viewport.clientHeight - (tableRef.current?.tFoot?.offsetHeight ?? 0);
|
|
8897
|
+
const fixed = normalizeFixed(column.fixed);
|
|
8898
|
+
return rect2.top >= Math.max(0, top) - 1 && rect2.bottom <= Math.min(window.innerHeight, bottom) + 1 && rect2.left >= Math.max(0, bounds.left + viewport.clientLeft + (fixed ? 0 : left)) - 1 && rect2.right <= Math.min(window.innerWidth, bounds.left + viewport.clientLeft + viewport.clientWidth - (fixed ? 0 : right)) + 1;
|
|
8899
|
+
};
|
|
8900
|
+
const rect = cell.getBoundingClientRect();
|
|
8901
|
+
const stable = previousRect && Math.abs(rect.top - previousRect.top) < 0.5 && Math.abs(rect.left - previousRect.left) < 0.5 && Math.abs(rect.width - previousRect.width) < 0.5 && Math.abs(rect.height - previousRect.height) < 0.5;
|
|
8902
|
+
previousRect = rect;
|
|
8903
|
+
if (!visible() || !stable) continue;
|
|
8856
8904
|
const address = { rowKey: key, columnKey };
|
|
8857
8905
|
pluginApisRef.current.cellSelection?.setRange({ anchor: address, focus: address });
|
|
8858
8906
|
cell.tabIndex = -1;
|
|
8859
8907
|
cell.focus({ preventScroll: true });
|
|
8908
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve()));
|
|
8909
|
+
if (request !== cellFocusRequest.current || !visible()) return false;
|
|
8860
8910
|
if (options?.highlight !== false) {
|
|
8861
|
-
const
|
|
8862
|
-
|
|
8863
|
-
glow.setAttribute("aria-hidden", "true");
|
|
8864
|
-
cell.appendChild(glow);
|
|
8865
|
-
cellGlow.current = glow;
|
|
8866
|
-
glow.addEventListener("animationend", (event) => {
|
|
8867
|
-
if (event.target !== glow) return;
|
|
8868
|
-
glow.remove();
|
|
8869
|
-
if (cellGlow.current === glow) cellGlow.current = null;
|
|
8911
|
+
const cleanup = playCellFocusGlow(cell, visible, () => {
|
|
8912
|
+
cellGlow.current = null;
|
|
8870
8913
|
});
|
|
8914
|
+
cellGlow.current = cleanup;
|
|
8871
8915
|
}
|
|
8872
8916
|
return true;
|
|
8873
8917
|
}
|
|
@@ -9626,7 +9670,8 @@ function createWorksheetPlugin(options) {
|
|
|
9626
9670
|
...column,
|
|
9627
9671
|
render: (value, record, index, info) => {
|
|
9628
9672
|
const area = bounds(), cols = columns();
|
|
9629
|
-
const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key &&
|
|
9673
|
+
const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && // 填充入口与编辑权限一致,避免只读格或保存锁定后仍暗示可以拖拽修改。
|
|
9674
|
+
editable(record, column) && (suppressEditing || !context.state.editing);
|
|
9630
9675
|
return /* @__PURE__ */ jsxs24(Fragment10, { children: [
|
|
9631
9676
|
render ? render(value, record, index, info) : value,
|
|
9632
9677
|
handle && /* @__PURE__ */ jsx26(
|