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

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
@@ -13117,6 +13117,10 @@ function createSelectionPlugin(options = {}) {
13117
13117
  )
13118
13118
  );
13119
13119
  if (preserving(context)) {
13120
+ (options.selectedRows ?? []).forEach((record, index) => {
13121
+ const key = context.getRowKey(record, index);
13122
+ if (keys.includes(key)) preservedRows.set(key, record);
13123
+ });
13120
13124
  for (const key of keys) {
13121
13125
  const entry = currentRows.get(key);
13122
13126
  if (entry) preservedRows.set(key, entry.record);
@@ -13266,6 +13270,7 @@ function createSelectionPlugin(options = {}) {
13266
13270
  if (!options.showSelectedCount) return null;
13267
13271
  const keys = selected(context);
13268
13272
  const entries = entriesForKeys(keys, context);
13273
+ const selectedCount = preserving(context) ? new Set(keys).size : entries.length;
13269
13274
  const columns = flattenTableColumns(context.columns).filter(
13270
13275
  (column) => !column.hidden && column.meta?.plugin !== "selection"
13271
13276
  ).slice(0, Math.max(1, options.selectionPanelColumnCount ?? 4));
@@ -13303,7 +13308,7 @@ function createSelectionPlugin(options = {}) {
13303
13308
  disabled: entries.length === 0,
13304
13309
  children: [
13305
13310
  "\u5DF2\u9009 ",
13306
- entries.length,
13311
+ selectedCount,
13307
13312
  " \u6761"
13308
13313
  ]
13309
13314
  }
package/dist/index.d.cts CHANGED
@@ -2408,6 +2408,8 @@ interface TableSelectionPluginOptions<T> {
2408
2408
  mode?: TableSelectionMode;
2409
2409
  /** 当前选中项目的标识集合;传入后由外部控制。 */
2410
2410
  selectedKeys?: readonly TableKey[];
2411
+ /** 跨页保留时补充已选行数据,用于弹框重新挂载后恢复已选明细;按 Table.rowKey 匹配,仅缓存当前已选标识对应的行,当前数据源的同键行优先。不会添加选择或改变当前页列表。 */
2412
+ selectedRows?: readonly T[];
2411
2413
  /** 非受控模式下初始选中的项目标识集合。 */
2412
2414
  defaultSelectedKeys?: readonly TableKey[];
2413
2415
  /** 值发生变化时调用;参数为新值及类型声明中列出的关联信息。 */
package/dist/index.d.ts CHANGED
@@ -2408,6 +2408,8 @@ interface TableSelectionPluginOptions<T> {
2408
2408
  mode?: TableSelectionMode;
2409
2409
  /** 当前选中项目的标识集合;传入后由外部控制。 */
2410
2410
  selectedKeys?: readonly TableKey[];
2411
+ /** 跨页保留时补充已选行数据,用于弹框重新挂载后恢复已选明细;按 Table.rowKey 匹配,仅缓存当前已选标识对应的行,当前数据源的同键行优先。不会添加选择或改变当前页列表。 */
2412
+ selectedRows?: readonly T[];
2411
2413
  /** 非受控模式下初始选中的项目标识集合。 */
2412
2414
  defaultSelectedKeys?: readonly TableKey[];
2413
2415
  /** 值发生变化时调用;参数为新值及类型声明中列出的关联信息。 */
package/dist/index.js CHANGED
@@ -5744,6 +5744,10 @@ function createSelectionPlugin(options = {}) {
5744
5744
  )
5745
5745
  );
5746
5746
  if (preserving(context)) {
5747
+ (options.selectedRows ?? []).forEach((record, index) => {
5748
+ const key = context.getRowKey(record, index);
5749
+ if (keys.includes(key)) preservedRows.set(key, record);
5750
+ });
5747
5751
  for (const key of keys) {
5748
5752
  const entry = currentRows.get(key);
5749
5753
  if (entry) preservedRows.set(key, entry.record);
@@ -5893,6 +5897,7 @@ function createSelectionPlugin(options = {}) {
5893
5897
  if (!options.showSelectedCount) return null;
5894
5898
  const keys = selected(context);
5895
5899
  const entries = entriesForKeys(keys, context);
5900
+ const selectedCount = preserving(context) ? new Set(keys).size : entries.length;
5896
5901
  const columns = flattenTableColumns(context.columns).filter(
5897
5902
  (column) => !column.hidden && column.meta?.plugin !== "selection"
5898
5903
  ).slice(0, Math.max(1, options.selectionPanelColumnCount ?? 4));
@@ -5930,7 +5935,7 @@ function createSelectionPlugin(options = {}) {
5930
5935
  disabled: entries.length === 0,
5931
5936
  children: [
5932
5937
  "\u5DF2\u9009 ",
5933
- entries.length,
5938
+ selectedCount,
5934
5939
  " \u6761"
5935
5940
  ]
5936
5941
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sia.soul/sia-react-ui",
3
- "version": "0.1.65",
3
+ "version": "0.1.66",
4
4
  "description": "Sia Design components and tokens for React",
5
5
  "publishConfig": {
6
6
  "access": "public",