@sia.soul/sia-react-ui 0.1.63 → 0.1.65

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.css CHANGED
@@ -2496,7 +2496,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
2496
2496
  align-items: center;
2497
2497
  justify-content: space-between;
2498
2498
  gap: 16px;
2499
- min-height: 56px;
2499
+ min-height: 40px;
2500
2500
  margin-inline: 16px;
2501
2501
  border-bottom: 1px solid var(--sia-color-border);
2502
2502
  }
@@ -2538,7 +2538,7 @@ fieldset:disabled .sia-input-number__floating-placeholder {
2538
2538
  line-height: 1.55;
2539
2539
  }
2540
2540
  .sia-card__body {
2541
- padding: var(--sia-spacing);
2541
+ padding: 6px var(--sia-spacing);
2542
2542
  }
2543
2543
  .sia-card__collapse-trigger {
2544
2544
  display: flex;
@@ -9474,6 +9474,55 @@ body > .sia-popup-portal[data-sia-popup-layer] {
9474
9474
  display: grid;
9475
9475
  color: var(--sia-color-text);
9476
9476
  }
9477
+ .sia-tree--virtual {
9478
+ position: relative;
9479
+ display: block;
9480
+ }
9481
+ .sia-tree__virtual-space {
9482
+ position: relative;
9483
+ min-width: 100%;
9484
+ }
9485
+ .sia-tree__virtual-node,
9486
+ .sia-tree__virtual-sticky-node {
9487
+ position: absolute;
9488
+ right: 0;
9489
+ left: 0;
9490
+ box-sizing: border-box;
9491
+ contain: layout style;
9492
+ }
9493
+ .sia-tree__virtual-node {
9494
+ top: 0;
9495
+ will-change: transform;
9496
+ }
9497
+ .sia-tree__virtual-node > .sia-tree__row,
9498
+ .sia-tree__virtual-sticky-node > .sia-tree__row {
9499
+ position: relative;
9500
+ z-index: 1;
9501
+ min-height: 0;
9502
+ }
9503
+ .sia-tree__virtual-sticky-layer {
9504
+ position: sticky;
9505
+ z-index: 120;
9506
+ top: 0;
9507
+ height: 0;
9508
+ overflow: visible;
9509
+ }
9510
+ .sia-tree__virtual-sticky-node > .sia-tree__row {
9511
+ background: var(--sia-color-surface);
9512
+ }
9513
+ .sia-tree__virtual-guides {
9514
+ position: absolute;
9515
+ z-index: 0;
9516
+ inset: 0;
9517
+ pointer-events: none;
9518
+ }
9519
+ .sia-tree__virtual-guide {
9520
+ position: absolute;
9521
+ top: 0;
9522
+ bottom: 0;
9523
+ width: 1px;
9524
+ background: var(--sia-color-border);
9525
+ }
9477
9526
  .sia-tree__row {
9478
9527
  display: flex;
9479
9528
  align-items: center;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TagStatus, B as BadgeProps } from './core-C4ayGoM8.cjs';
2
- 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 ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-C4ayGoM8.cjs';
1
+ import { T as TagStatus, B as BadgeProps } from './core-hpkUd4EO.cjs';
2
+ 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 ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-hpkUd4EO.cjs';
3
3
  import * as react from 'react';
4
4
  import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
5
5
  import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.cjs';
@@ -752,7 +752,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
752
752
  * @defaultValue true
753
753
  */
754
754
  requiredMark?: boolean | "optional";
755
- /** 提交并且校验通过时调用,参数为完整的表单字段值。 */
755
+ /** 当前表单提交并且校验通过时调用,参数为完整的表单字段值;提交事件不会冒泡触发祖先表单,包含 Portal 内的子表单。 */
756
756
  onFinish?: (values: FormValues) => void;
757
757
  /** 表单提交校验失败时调用,参数包含字段值和错误列表。 */
758
758
  onFinishFailed?: (info: {
@@ -2430,7 +2430,9 @@ interface TableSelectionPluginOptions<T> {
2430
2430
  childrenColumnName?: string;
2431
2431
  }
2432
2432
  /** 行勾选和已选面板状态。 */
2433
- interface SelectionState {
2433
+ interface SelectionState<T> {
2434
+ /** 当前表格独立保存的跨页行缓存,重建插件时保留,表格卸载后释放。 */
2435
+ preservedRows: Map<TableKey, T>;
2434
2436
  /** 当前选中的行标识。 */
2435
2437
  selectedKeys: readonly TableKey[];
2436
2438
  /** 是否跨页保留选中行。 */
@@ -2455,8 +2457,8 @@ interface TableSelectionApi<T> {
2455
2457
  /** 设置是否跨页保留选中行。 */
2456
2458
  setPreserveSelectedRowKeys: (preserve: boolean) => void;
2457
2459
  }
2458
- /** 创建表格行勾选插件。将返回值加入 Table 的 plugins 后生效。 */
2459
- declare function createSelectionPlugin<T extends Record<string, unknown>>(options?: TableSelectionPluginOptions<T>): TablePlugin<T, SelectionState, TableSelectionApi<T>>;
2460
+ /** 创建表格行勾选插件。将返回值加入 Table 的 plugins 后生效;跨页行缓存属于表格实例,重新创建插件不会清空缓存,不同表格互不共享。 */
2461
+ declare function createSelectionPlugin<T extends Record<string, unknown>>(options?: TableSelectionPluginOptions<T>): TablePlugin<T, SelectionState<T>, TableSelectionApi<T>>;
2460
2462
  /** TableSort的插件配置。 */
2461
2463
  interface TableSortPluginOptions {
2462
2464
  /** 展示或交互模式;可选值见类型定义。 */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TagStatus, B as BadgeProps } from './core-BemUqBUF.js';
2
- 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 ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-BemUqBUF.js';
1
+ import { T as TagStatus, B as BadgeProps } from './core-DrNZuMER.js';
2
+ 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 ImagePreviewProps, S as ImageProps, U as Input, V as InputProps, W as Menu, X as MenuClickInfo, Y as MenuItem, Z as MenuMode, _ as MenuProps, $ as MenuTheme, a0 as MessageConfig, a1 as MessageHandle, a2 as MessageKey, a3 as MessageType, a4 as NotificationConfig, a5 as NotificationPlacement, a6 as NotificationType, a7 as Popconfirm, a8 as PopconfirmProps, a9 as Popover, aa as PopoverProps, ab as Progress, ac as ProgressProps, ad as ProgressStatus, ae as Rate, af as RateProps, ag as Segmented, ah as SegmentedOption, ai as SegmentedProps, aj as SegmentedValue, ak as Spin, al as SpinProps, am as StepItem, an as StepStatus, ao as Steps, ap as StepsProps, aq as TabItem, ar as Tabs, as as TabsContextMenuClickInfo, at as TabsOrientation, au as TabsPosition, av as TabsProps, aw as TabsType, ax as Tag, ay as TagProps, az as TagSize, aA as TagVariant, aB as Timeline, aC as TimelineItem, aD as TimelineProps, aE as Toolbar, aF as ToolbarItem, aG as ToolbarProps, aH as Tooltip, aI as TooltipProps, aJ as Tour, aK as TourProps, aL as TourStep, aM as Tree, aN as TreeDropPosition, aO as TreeKey, aP as TreeNode, aQ as TreeProps, aR as Typography, aS as TypographyLinkProps, aT as TypographyProps, aU as TypographyTitleProps, aV as TypographyType, aW as Upload, aX as UploadChangeInfo, aY as UploadDraggerProps, aZ as UploadFile, a_ as UploadFileStatus, a$ as UploadHttpRequest, b0 as UploadItemActions, b1 as UploadProps, b2 as UploadRef, b3 as UploadRejectInfo, b4 as UploadRequestHandle, b5 as UploadRequestOptions, b6 as Watermark, b7 as WatermarkFont, b8 as WatermarkProps, b9 as message, ba as notification } from './core-DrNZuMER.js';
3
3
  import * as react from 'react';
4
4
  import { HTMLAttributes, ReactNode, CSSProperties, ElementType, FormHTMLAttributes, InputHTMLAttributes, ChangeEvent, TextareaHTMLAttributes, MouseEvent, Key, PointerEvent, Ref, ReactElement, ButtonHTMLAttributes, RefObject } from 'react';
5
5
  import { C as ControlSize, I as InputPlaceholderMode, a as ControlStatus } from './shared-Bx4B28Wh.js';
@@ -752,7 +752,7 @@ interface FormProps extends Omit<FormHTMLAttributes<HTMLFormElement>, "onSubmit"
752
752
  * @defaultValue true
753
753
  */
754
754
  requiredMark?: boolean | "optional";
755
- /** 提交并且校验通过时调用,参数为完整的表单字段值。 */
755
+ /** 当前表单提交并且校验通过时调用,参数为完整的表单字段值;提交事件不会冒泡触发祖先表单,包含 Portal 内的子表单。 */
756
756
  onFinish?: (values: FormValues) => void;
757
757
  /** 表单提交校验失败时调用,参数包含字段值和错误列表。 */
758
758
  onFinishFailed?: (info: {
@@ -2430,7 +2430,9 @@ interface TableSelectionPluginOptions<T> {
2430
2430
  childrenColumnName?: string;
2431
2431
  }
2432
2432
  /** 行勾选和已选面板状态。 */
2433
- interface SelectionState {
2433
+ interface SelectionState<T> {
2434
+ /** 当前表格独立保存的跨页行缓存,重建插件时保留,表格卸载后释放。 */
2435
+ preservedRows: Map<TableKey, T>;
2434
2436
  /** 当前选中的行标识。 */
2435
2437
  selectedKeys: readonly TableKey[];
2436
2438
  /** 是否跨页保留选中行。 */
@@ -2455,8 +2457,8 @@ interface TableSelectionApi<T> {
2455
2457
  /** 设置是否跨页保留选中行。 */
2456
2458
  setPreserveSelectedRowKeys: (preserve: boolean) => void;
2457
2459
  }
2458
- /** 创建表格行勾选插件。将返回值加入 Table 的 plugins 后生效。 */
2459
- declare function createSelectionPlugin<T extends Record<string, unknown>>(options?: TableSelectionPluginOptions<T>): TablePlugin<T, SelectionState, TableSelectionApi<T>>;
2460
+ /** 创建表格行勾选插件。将返回值加入 Table 的 plugins 后生效;跨页行缓存属于表格实例,重新创建插件不会清空缓存,不同表格互不共享。 */
2461
+ declare function createSelectionPlugin<T extends Record<string, unknown>>(options?: TableSelectionPluginOptions<T>): TablePlugin<T, SelectionState<T>, TableSelectionApi<T>>;
2460
2462
  /** TableSort的插件配置。 */
2461
2463
  interface TableSortPluginOptions {
2462
2464
  /** 展示或交互模式;可选值见类型定义。 */
package/dist/index.js CHANGED
@@ -80,7 +80,7 @@ import {
80
80
  Watermark,
81
81
  message,
82
82
  notification
83
- } from "./chunk-NV4QPQSP.js";
83
+ } from "./chunk-NKSPPR2A.js";
84
84
  import {
85
85
  TextArea
86
86
  } from "./chunk-SMCYEPBL.js";
@@ -95,7 +95,7 @@ import {
95
95
  DatePicker,
96
96
  SelectDateRange,
97
97
  TimePanel
98
- } from "./chunk-7CAQPLKC.js";
98
+ } from "./chunk-VGIGEDUP.js";
99
99
  import {
100
100
  Checkbox,
101
101
  FloatingScrollbarProvider,
@@ -110,7 +110,7 @@ import {
110
110
  Tree,
111
111
  useOverlayLifecycle,
112
112
  useScrollbarProximity
113
- } from "./chunk-F4XMRO6G.js";
113
+ } from "./chunk-B42RCR7O.js";
114
114
  import {
115
115
  Dropdown,
116
116
  FILLED_ICON_NAMES,
@@ -1710,6 +1710,7 @@ function FormRoot({
1710
1710
  "data-required-mark": requiredMark,
1711
1711
  onSubmit: (event) => {
1712
1712
  event.preventDefault();
1713
+ event.stopPropagation();
1713
1714
  instance.submit();
1714
1715
  },
1715
1716
  children: /* @__PURE__ */ jsx9("fieldset", { disabled, children })
@@ -5718,7 +5719,6 @@ function TableSelectedItemsPanel({
5718
5719
  }
5719
5720
  function createSelectionPlugin(options = {}) {
5720
5721
  const { mode = "multiple", childrenColumnName = "children" } = options;
5721
- const preservedRows = /* @__PURE__ */ new Map();
5722
5722
  function selected(context) {
5723
5723
  return options.selectedKeys ?? context.state.selectedKeys ?? [];
5724
5724
  }
@@ -5729,6 +5729,7 @@ function createSelectionPlugin(options = {}) {
5729
5729
  return flattenRecords(context.sourceData, childrenColumnName);
5730
5730
  }
5731
5731
  function entriesForKeys(keys, context) {
5732
+ const preservedRows = context.state.preservedRows;
5732
5733
  const records = allRecords(context);
5733
5734
  const currentRows = new Map(
5734
5735
  records.map(
@@ -5763,7 +5764,7 @@ function createSelectionPlugin(options = {}) {
5763
5764
  return entriesForKeys(keys, context).map((entry) => entry.record);
5764
5765
  }
5765
5766
  function setKeys(keys, context) {
5766
- if (keys.length === 0) preservedRows.clear();
5767
+ if (keys.length === 0) context.state.preservedRows.clear();
5767
5768
  context.setState((state) => ({
5768
5769
  ...state,
5769
5770
  selectedKeys: keys,
@@ -5779,7 +5780,7 @@ function createSelectionPlugin(options = {}) {
5779
5780
  (key) => pageKeys.has(key)
5780
5781
  );
5781
5782
  setKeys(currentPageKeys, context);
5782
- preservedRows.clear();
5783
+ context.state.preservedRows.clear();
5783
5784
  }
5784
5785
  context.setState((state) => ({
5785
5786
  ...state,
@@ -5801,11 +5802,13 @@ function createSelectionPlugin(options = {}) {
5801
5802
  return {
5802
5803
  id: "selection",
5803
5804
  order: 20,
5804
- initialState: {
5805
+ // 用工厂给每个表格创建独立缓存,避免同一插件对象被多个表格复用时串数据。
5806
+ initialState: () => ({
5807
+ preservedRows: /* @__PURE__ */ new Map(),
5805
5808
  selectedKeys: options.defaultSelectedKeys ?? [],
5806
5809
  preserveSelectedRowKeys: options.preserveSelectedRowKeys ?? false,
5807
5810
  panelOpen: false
5808
- },
5811
+ }),
5809
5812
  transformColumns(columns, context) {
5810
5813
  if (mode === "row") return columns;
5811
5814
  const selectionColumn = {
@@ -5953,7 +5956,7 @@ function createSelectionPlugin(options = {}) {
5953
5956
  const records = allRecords(context);
5954
5957
  const record = records.find(
5955
5958
  (item, index) => Object.is(context.getRowKey(item, index), key)
5956
- ) ?? preservedRows.get(key);
5959
+ ) ?? context.state.preservedRows.get(key);
5957
5960
  if (record) toggle(key, record, context, checked);
5958
5961
  },
5959
5962
  getSelectedRows: () => rowsForKeys(selected(context), context),
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SelectDateRange
3
- } from "./chunk-7CAQPLKC.js";
4
- import "./chunk-F4XMRO6G.js";
3
+ } from "./chunk-VGIGEDUP.js";
4
+ import "./chunk-B42RCR7O.js";
5
5
  import "./chunk-IUZ2RSI5.js";
6
6
  import "./chunk-IKAMZNCK.js";
7
7
  import "./chunk-H7IAG72O.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.63",
3
+ "version": "0.1.65",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",