@sia.soul/sia-react-ui 0.1.132 → 0.1.134

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/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(() => props.toggle(item.key, false), 100);
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 shouldOpen = force ?? !open.includes(key);
2700
- setOpen(shouldOpen ? open.includes(key) ? open : [...open, key] : open.filter((item) => item !== key));
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 targets = fields ?? [...this.fields.values()];
7460
- const results = await Promise.all(targets.map(async (field) => ({ field, errors: await this.validateField(field.name) })));
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,46 @@ 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 paths = [12, 6, 2].map((length) => {
13853
+ const path = document.createElementNS(namespace, "path");
13854
+ path.setAttribute("pathLength", "100");
13855
+ path.style.setProperty("--sia-cell-focus-tail", String(length));
13856
+ path.setAttribute("stroke-dasharray", `${length} ${100 - length}`);
13857
+ glow.appendChild(path);
13858
+ return path;
13859
+ });
13860
+ let frame = 0, disposed = false;
13861
+ const cleanup2 = () => {
13862
+ if (disposed) return;
13863
+ disposed = true;
13864
+ cancelAnimationFrame(frame);
13865
+ glow.remove();
13866
+ onFinish();
13867
+ };
13868
+ const position = () => {
13869
+ if (!cell.isConnected || !isVisible()) {
13870
+ cleanup2();
13871
+ return;
13872
+ }
13873
+ const rect = cell.getBoundingClientRect();
13874
+ Object.assign(glow.style, { left: `${rect.left}px`, top: `${rect.top}px`, width: `${rect.width}px`, height: `${rect.height}px` });
13875
+ paths.forEach((path) => path.setAttribute("d", `M 1.5 1.5 H ${rect.width - 1.5} V ${rect.height - 1.5} H 1.5 Z`));
13876
+ frame = requestAnimationFrame(position);
13877
+ };
13878
+ position();
13879
+ if (!disposed) document.body.appendChild(glow);
13880
+ glow.addEventListener("animationend", (event) => {
13881
+ if (event.target === glow) cleanup2();
13882
+ });
13883
+ return cleanup2;
13884
+ }
13885
+
13777
13886
  // src/components/Table/Table.tsx
13778
13887
  var import_react57 = require("react");
13779
13888
 
@@ -16528,7 +16637,7 @@ function TableInner(props, ref) {
16528
16637
  const cellGlow = (0, import_react57.useRef)(null);
16529
16638
  (0, import_react57.useEffect)(() => () => {
16530
16639
  cellFocusRequest.current++;
16531
- cellGlow.current?.remove();
16640
+ cellGlow.current?.();
16532
16641
  }, []);
16533
16642
  const tableRef = (0, import_react57.useRef)(null);
16534
16643
  useScrollbarProximity();
@@ -16907,7 +17016,7 @@ function TableInner(props, ref) {
16907
17016
  },
16908
17017
  focusCell: async (key, columnKey, options) => {
16909
17018
  const request = ++cellFocusRequest.current;
16910
- cellGlow.current?.remove();
17019
+ cellGlow.current?.();
16911
17020
  cellGlow.current = null;
16912
17021
  const viewport = scrollRef.current;
16913
17022
  const columnIndex = leafColumns.findIndex((column2) => column2.key === columnKey);
@@ -16922,28 +17031,37 @@ function TableInner(props, ref) {
16922
17031
  if (canvas) setScrollLeft(viewport.scrollLeft);
16923
17032
  }
16924
17033
  updateScrollMetrics();
16925
- for (let frame = 0; frame < 12; frame++) {
17034
+ let previousRect;
17035
+ for (let frame = 0; frame < 20; frame++) {
16926
17036
  await new Promise((resolve) => requestAnimationFrame(() => resolve()));
16927
17037
  if (request !== cellFocusRequest.current || !viewport.isConnected || !viewport.clientHeight) return false;
16928
17038
  const row = Array.from(tableRef.current?.tBodies[0]?.rows ?? []).find((item) => item.dataset.rowKey === String(key));
16929
17039
  const cell = Array.from(row?.cells ?? []).find((item) => item.dataset.columnKey === columnKey);
16930
17040
  if (!cell || !cell.offsetWidth) continue;
16931
17041
  api.scrollToRow(key);
17042
+ const visible = () => {
17043
+ if (!cell.isConnected || !viewport.clientHeight || !cell.offsetWidth) return false;
17044
+ const bounds = viewport.getBoundingClientRect(), rect2 = cell.getBoundingClientRect();
17045
+ const top = bounds.top + viewport.clientTop + (stickyHeader ? tableRef.current?.tHead?.offsetHeight ?? 0 : 0);
17046
+ const bottom = bounds.top + viewport.clientTop + viewport.clientHeight - (tableRef.current?.tFoot?.offsetHeight ?? 0);
17047
+ const fixed = normalizeFixed(column.fixed);
17048
+ 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;
17049
+ };
17050
+ const rect = cell.getBoundingClientRect();
17051
+ 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;
17052
+ previousRect = rect;
17053
+ if (!visible() || !stable) continue;
16932
17054
  const address = { rowKey: key, columnKey };
16933
17055
  pluginApisRef.current.cellSelection?.setRange({ anchor: address, focus: address });
16934
17056
  cell.tabIndex = -1;
16935
17057
  cell.focus({ preventScroll: true });
17058
+ await new Promise((resolve) => requestAnimationFrame(() => resolve()));
17059
+ if (request !== cellFocusRequest.current || !visible()) return false;
16936
17060
  if (options?.highlight !== false) {
16937
- const glow = document.createElement("span");
16938
- glow.className = "sia-table__cell-focus-glow";
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;
17061
+ const cleanup2 = playCellFocusGlow(cell, visible, () => {
17062
+ cellGlow.current = null;
16946
17063
  });
17064
+ cellGlow.current = cleanup2;
16947
17065
  }
16948
17066
  return true;
16949
17067
  }
@@ -17702,7 +17820,8 @@ function createWorksheetPlugin(options) {
17702
17820
  ...column,
17703
17821
  render: (value, record, index, info) => {
17704
17822
  const area = bounds(), cols = columns();
17705
- const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && (suppressEditing || !context.state.editing);
17823
+ const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && // 填充入口与编辑权限一致,避免只读格或保存锁定后仍暗示可以拖拽修改。
17824
+ editable(record, column) && (suppressEditing || !context.state.editing);
17706
17825
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
17707
17826
  render ? render(value, record, index, info) : value,
17708
17827
  handle && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
@@ -21003,9 +21122,9 @@ function chordMatrixLayout(matrix, options = {}) {
21003
21122
  let angle = options.startAngle ?? -Math.PI / 2;
21004
21123
  const subSort = options.legacySubSort ? options.sortSub === "ascending" ? "ascending" : options.sort === "descending" ? "descending" : "none" : options.sortSub;
21005
21124
  const groups = order.map((index) => {
21006
- const start = angle, targets = Array.from({ length: n }, (_, i) => i);
21007
- if (subSort && subSort !== "none") targets.sort((a, b) => (values[index][a] - values[index][b]) * (subSort === "ascending" ? 1 : -1) || a - b);
21008
- for (const target of targets) {
21125
+ const start = angle, targets2 = Array.from({ length: n }, (_, i) => i);
21126
+ if (subSort && subSort !== "none") targets2.sort((a, b) => (values[index][a] - values[index][b]) * (subSort === "ascending" ? 1 : -1) || a - b);
21127
+ for (const target of targets2) {
21009
21128
  const value = values[index][target], end = angle + direction * value * factor;
21010
21129
  segments[index][target] = { index, target, start: angle, end, value };
21011
21130
  angle = end;
package/dist/index.css CHANGED
@@ -11188,37 +11188,37 @@ 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: absolute;
11192
- inset: 0;
11193
- z-index: 2;
11194
- overflow: hidden;
11191
+ position: fixed;
11192
+ z-index: 2147483647;
11193
+ overflow: visible;
11195
11194
  pointer-events: none;
11196
- box-shadow: inset 0 0 0 2px var(--sia-color-primary);
11197
- background: color-mix(in srgb, var(--sia-color-primary) 16%, transparent);
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::after {
11201
- content: "";
11202
- position: absolute;
11203
- inset: 0;
11204
- background:
11205
- linear-gradient(
11206
- 110deg,
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: 3px;
11201
+ stroke-linecap: round;
11202
+ opacity: .25;
11203
+ filter: drop-shadow(0 0 3px #ff303b);
11204
+ animation: sia-table-cell-focus-orbit 900ms linear forwards;
11211
11205
  }
11212
- @keyframes sia-table-cell-focus-sweep {
11206
+ .sia-table__cell-focus-glow path:nth-child(2) {
11207
+ opacity: .6;
11208
+ }
11209
+ .sia-table__cell-focus-glow path:nth-child(3) {
11210
+ opacity: 1;
11211
+ }
11212
+ @keyframes sia-table-cell-focus-orbit {
11213
11213
  from {
11214
- transform: translateX(-100%);
11214
+ stroke-dashoffset: var(--sia-cell-focus-tail);
11215
11215
  }
11216
11216
  to {
11217
- transform: translateX(100%);
11217
+ stroke-dashoffset: calc(var(--sia-cell-focus-tail) - 100);
11218
11218
  }
11219
11219
  }
11220
11220
  @keyframes sia-table-cell-focus-fade {
11221
- 0%, 45% {
11221
+ 0%, 82% {
11222
11222
  opacity: 1;
11223
11223
  }
11224
11224
  100% {
@@ -11229,7 +11229,11 @@ body > .sia-title-tooltip[data-sia-popup-layer] {
11229
11229
  .sia-table__cell-focus-glow {
11230
11230
  animation-duration: 200ms;
11231
11231
  }
11232
- .sia-table__cell-focus-glow::after {
11232
+ .sia-table__cell-focus-glow path {
11233
+ animation: none;
11234
+ stroke-dasharray: none;
11235
+ }
11236
+ .sia-table__cell-focus-glow path:not(:last-child) {
11233
11237
  display: none;
11234
11238
  }
11235
11239
  }
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-DUmn3A2b.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-DUmn3A2b.cjs';
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
- /** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载后返回是否成功;隐藏列、其它页、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用。默认播放约 900 毫秒流光渐隐,减少动态效果偏好下仅淡出。 */
2364
+ /** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载、位置稳定且整格在可视区后返回成功,再由顶层浮层沿边框顺时针播放一圈红色流光渐隐(绕行约 900 毫秒,随后 200 毫秒消失);不拦截操作,减少动态效果时仅红框淡出。隐藏列、其它页、无法完整显示的单元格、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用;再次定位、目标滚出可视区或卸载会清理动效。 */
2365
2365
  focusCell: (rowKey: TableKey, columnKey: string, options?: {
2366
- /** 是否播放一次流光渐隐,默认 true;false 仅滚动、选中和聚焦。 */
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-DoyeSoBN.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-DoyeSoBN.js';
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
- /** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载后返回是否成功;隐藏列、其它页、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用。默认播放约 900 毫秒流光渐隐,减少动态效果偏好下仅淡出。 */
2364
+ /** 按稳定行键和叶子列键定位单元格,横纵滚动避开吸顶表头、固定列及合计行,选中并聚焦但不进入编辑。等待虚拟行挂载、位置稳定且整格在可视区后返回成功,再由顶层浮层沿边框顺时针播放一圈红色流光渐隐(绕行约 900 毫秒,随后 200 毫秒消失);不拦截操作,减少动态效果时仅红框淡出。隐藏列、其它页、无法完整显示的单元格、不可见表格或被后续定位取代时返回 false,不自动切页或显示隐藏列。应在数据更新及弹框关闭动画完成后调用;再次定位、目标滚出可视区或卸载会清理动效。 */
2365
2365
  focusCell: (rowKey: TableKey, columnKey: string, options?: {
2366
- /** 是否播放一次流光渐隐,默认 true;false 仅滚动、选中和聚焦。 */
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-OHIBJFX5.js";
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-RC5MXFLI.js";
93
+ } from "./chunk-WIRIEIRO.js";
94
94
  import {
95
95
  DatePicker,
96
96
  SelectDateRange,
97
97
  TimePanel
98
- } from "./chunk-J3RX7GCZ.js";
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-NYU3DJVZ.js";
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-EWEDQ3VJ.js";
117
+ } from "./chunk-UVHC6OEX.js";
118
118
  import {
119
119
  TextArea
120
120
  } from "./chunk-SCEHVGKV.js";
@@ -5698,6 +5698,46 @@ 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 paths = [12, 6, 2].map((length) => {
5708
+ const path = document.createElementNS(namespace, "path");
5709
+ path.setAttribute("pathLength", "100");
5710
+ path.style.setProperty("--sia-cell-focus-tail", String(length));
5711
+ path.setAttribute("stroke-dasharray", `${length} ${100 - length}`);
5712
+ glow.appendChild(path);
5713
+ return path;
5714
+ });
5715
+ let frame = 0, disposed = false;
5716
+ const cleanup = () => {
5717
+ if (disposed) return;
5718
+ disposed = true;
5719
+ cancelAnimationFrame(frame);
5720
+ glow.remove();
5721
+ onFinish();
5722
+ };
5723
+ const position = () => {
5724
+ if (!cell.isConnected || !isVisible()) {
5725
+ cleanup();
5726
+ return;
5727
+ }
5728
+ const rect = cell.getBoundingClientRect();
5729
+ Object.assign(glow.style, { left: `${rect.left}px`, top: `${rect.top}px`, width: `${rect.width}px`, height: `${rect.height}px` });
5730
+ paths.forEach((path) => path.setAttribute("d", `M 1.5 1.5 H ${rect.width - 1.5} V ${rect.height - 1.5} H 1.5 Z`));
5731
+ frame = requestAnimationFrame(position);
5732
+ };
5733
+ position();
5734
+ if (!disposed) document.body.appendChild(glow);
5735
+ glow.addEventListener("animationend", (event) => {
5736
+ if (event.target === glow) cleanup();
5737
+ });
5738
+ return cleanup;
5739
+ }
5740
+
5701
5741
  // src/components/Table/Table.tsx
5702
5742
  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
5743
 
@@ -8452,7 +8492,7 @@ function TableInner(props, ref) {
8452
8492
  const cellGlow = useRef19(null);
8453
8493
  useEffect15(() => () => {
8454
8494
  cellFocusRequest.current++;
8455
- cellGlow.current?.remove();
8495
+ cellGlow.current?.();
8456
8496
  }, []);
8457
8497
  const tableRef = useRef19(null);
8458
8498
  useScrollbarProximity();
@@ -8831,7 +8871,7 @@ function TableInner(props, ref) {
8831
8871
  },
8832
8872
  focusCell: async (key, columnKey, options) => {
8833
8873
  const request = ++cellFocusRequest.current;
8834
- cellGlow.current?.remove();
8874
+ cellGlow.current?.();
8835
8875
  cellGlow.current = null;
8836
8876
  const viewport = scrollRef.current;
8837
8877
  const columnIndex = leafColumns.findIndex((column2) => column2.key === columnKey);
@@ -8846,28 +8886,37 @@ function TableInner(props, ref) {
8846
8886
  if (canvas) setScrollLeft(viewport.scrollLeft);
8847
8887
  }
8848
8888
  updateScrollMetrics();
8849
- for (let frame = 0; frame < 12; frame++) {
8889
+ let previousRect;
8890
+ for (let frame = 0; frame < 20; frame++) {
8850
8891
  await new Promise((resolve) => requestAnimationFrame(() => resolve()));
8851
8892
  if (request !== cellFocusRequest.current || !viewport.isConnected || !viewport.clientHeight) return false;
8852
8893
  const row = Array.from(tableRef.current?.tBodies[0]?.rows ?? []).find((item) => item.dataset.rowKey === String(key));
8853
8894
  const cell = Array.from(row?.cells ?? []).find((item) => item.dataset.columnKey === columnKey);
8854
8895
  if (!cell || !cell.offsetWidth) continue;
8855
8896
  api.scrollToRow(key);
8897
+ const visible = () => {
8898
+ if (!cell.isConnected || !viewport.clientHeight || !cell.offsetWidth) return false;
8899
+ const bounds = viewport.getBoundingClientRect(), rect2 = cell.getBoundingClientRect();
8900
+ const top = bounds.top + viewport.clientTop + (stickyHeader ? tableRef.current?.tHead?.offsetHeight ?? 0 : 0);
8901
+ const bottom = bounds.top + viewport.clientTop + viewport.clientHeight - (tableRef.current?.tFoot?.offsetHeight ?? 0);
8902
+ const fixed = normalizeFixed(column.fixed);
8903
+ 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;
8904
+ };
8905
+ const rect = cell.getBoundingClientRect();
8906
+ 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;
8907
+ previousRect = rect;
8908
+ if (!visible() || !stable) continue;
8856
8909
  const address = { rowKey: key, columnKey };
8857
8910
  pluginApisRef.current.cellSelection?.setRange({ anchor: address, focus: address });
8858
8911
  cell.tabIndex = -1;
8859
8912
  cell.focus({ preventScroll: true });
8913
+ await new Promise((resolve) => requestAnimationFrame(() => resolve()));
8914
+ if (request !== cellFocusRequest.current || !visible()) return false;
8860
8915
  if (options?.highlight !== false) {
8861
- const glow = document.createElement("span");
8862
- glow.className = "sia-table__cell-focus-glow";
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;
8916
+ const cleanup = playCellFocusGlow(cell, visible, () => {
8917
+ cellGlow.current = null;
8870
8918
  });
8919
+ cellGlow.current = cleanup;
8871
8920
  }
8872
8921
  return true;
8873
8922
  }
@@ -9626,7 +9675,8 @@ function createWorksheetPlugin(options) {
9626
9675
  ...column,
9627
9676
  render: (value, record, index, info) => {
9628
9677
  const area = bounds(), cols = columns();
9629
- const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && (suppressEditing || !context.state.editing);
9678
+ const handle = area && context.rows[area.bottom]?.key === info.row.key && cols[area.right]?.key === column.key && // 填充入口与编辑权限一致,避免只读格或保存锁定后仍暗示可以拖拽修改。
9679
+ editable(record, column) && (suppressEditing || !context.state.editing);
9630
9680
  return /* @__PURE__ */ jsxs24(Fragment10, { children: [
9631
9681
  render ? render(value, record, index, info) : value,
9632
9682
  handle && /* @__PURE__ */ jsx26(