openxiangda 1.0.216 → 1.0.217

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.216",
3
+ "version": "1.0.217",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {
@@ -44438,8 +44438,11 @@ function AdminList(props) {
44438
44438
  preserveSelectionAcrossPages = true,
44439
44439
  rowActions = [],
44440
44440
  rowKey,
44441
+ rowSelectable,
44442
+ rowSelectionReason,
44441
44443
  searchFields = [],
44442
44444
  selectable = true,
44445
+ selectedRowKeys: controlledSelectedKeys,
44443
44446
  style,
44444
44447
  toolbar
44445
44448
  } = props;
@@ -44522,6 +44525,40 @@ function AdminList(props) {
44522
44525
  },
44523
44526
  [messageApi, onSelectionChange]
44524
44527
  );
44528
+ (0, import_react21.useEffect)(() => {
44529
+ if (!controlledSelectedKeys) return;
44530
+ const nextKeys = [...controlledSelectedKeys];
44531
+ const nextKeySet = new Set(nextKeys);
44532
+ for (const key of selectedRowsRef.current.keys()) {
44533
+ if (!nextKeySet.has(key)) selectedRowsRef.current.delete(key);
44534
+ }
44535
+ for (const row of rows) {
44536
+ const key = getRowKey(rowKey, row);
44537
+ if (nextKeySet.has(key)) selectedRowsRef.current.set(key, row);
44538
+ }
44539
+ selectedKeysRef.current = nextKeys;
44540
+ setSelectedKeys(nextKeys);
44541
+ }, [controlledSelectedKeys, rowKey, rows]);
44542
+ (0, import_react21.useEffect)(() => {
44543
+ if (!rowSelectable || !selectedKeysRef.current.length || !rows.length) {
44544
+ return;
44545
+ }
44546
+ const disabledKeys = new Set(
44547
+ rows.filter((row) => !rowSelectable(row)).map((row) => getRowKey(rowKey, row))
44548
+ );
44549
+ if (!disabledKeys.size) return;
44550
+ const nextKeys = selectedKeysRef.current.filter(
44551
+ (key) => !disabledKeys.has(key)
44552
+ );
44553
+ if (nextKeys.length === selectedKeysRef.current.length) return;
44554
+ for (const key of disabledKeys) selectedRowsRef.current.delete(key);
44555
+ selectedKeysRef.current = nextKeys;
44556
+ setSelectedKeys(nextKeys);
44557
+ onSelectionChange?.({
44558
+ rowKeys: nextKeys,
44559
+ rows: nextKeys.map((key) => selectedRowsRef.current.get(key)).filter(Boolean)
44560
+ });
44561
+ }, [onSelectionChange, rowKey, rowSelectable, rows]);
44525
44562
  (0, import_react21.useEffect)(() => {
44526
44563
  let active = true;
44527
44564
  setReady(false);
@@ -45505,6 +45542,10 @@ function AdminList(props) {
45505
45542
  rowSelection: selectable ? {
45506
45543
  preserveSelectedRowKeys: preserveSelectionAcrossPages,
45507
45544
  selectedRowKeys: selectedKeys,
45545
+ getCheckboxProps: (row) => ({
45546
+ disabled: rowSelectable ? !rowSelectable(row) : false,
45547
+ title: rowSelectionReason?.(row)
45548
+ }),
45508
45549
  onChange: handleSelectionChange
45509
45550
  } : void 0,
45510
45551
  scroll: { x: "max-content" },