@zhenliang/sheet 0.1.31 → 0.1.33

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.
@@ -131,6 +131,8 @@ export var formatGroupData = function formatGroupData(param) {
131
131
  dataEditor: colInfo.editor ? colInfo.editor : undefined,
132
132
  row: currentIndex,
133
133
  className: !(((_colInfo$cellConfig = colInfo.cellConfig) === null || _colInfo$cellConfig === void 0 ? void 0 : _colInfo$cellConfig.className) instanceof Function) ? (_colInfo$cellConfig2 = colInfo.cellConfig) === null || _colInfo$cellConfig2 === void 0 ? void 0 : _colInfo$cellConfig2.className : (_colInfo$cellConfig3 = colInfo.cellConfig) === null || _colInfo$cellConfig3 === void 0 ? void 0 : _colInfo$cellConfig3.className(value, itemRow, currentIndex),
134
+ dataIndex: colInfo.dataIndex,
135
+ key: colInfo.key,
134
136
  col: col
135
137
  });
136
138
  });
@@ -66,7 +66,9 @@ export var formatSelectionData = function formatSelectionData(param) {
66
66
  dataEditor: colInfo.editor ? colInfo.editor : undefined,
67
67
  className: !(((_colInfo$cellConfig = colInfo.cellConfig) === null || _colInfo$cellConfig === void 0 ? void 0 : _colInfo$cellConfig.className) instanceof Function) ? (_colInfo$cellConfig2 = colInfo.cellConfig) === null || _colInfo$cellConfig2 === void 0 ? void 0 : _colInfo$cellConfig2.className : (_colInfo$cellConfig3 = colInfo.cellConfig) === null || _colInfo$cellConfig3 === void 0 ? void 0 : _colInfo$cellConfig3.className(value, item, row),
68
68
  row: row,
69
- col: col
69
+ col: col,
70
+ dataIndex: colInfo.dataIndex,
71
+ key: colInfo.key
70
72
  });
71
73
  });
72
74
  return rows;
@@ -5,17 +5,23 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  export var SwitchViewer = function SwitchViewer(props) {
6
6
  var value = props.value,
7
7
  row = props.row,
8
- record = props.record;
8
+ record = props.record,
9
+ cell = props.cell;
10
+ var _ref = cell !== null && cell !== void 0 ? cell : {},
11
+ key = _ref.key,
12
+ readonly = _ref.readonly;
9
13
  var eventBus = useSheetEvent();
10
14
  var handleChange = useCallback(function () {
11
15
  if (!eventBus) return;
12
16
  eventBus.emit('cell-switch', {
13
17
  row: row,
14
18
  record: record,
15
- value: !value
19
+ value: !value,
20
+ key: key
16
21
  });
17
22
  }, [eventBus, row, record, value]);
18
23
  return /*#__PURE__*/_jsx(Switch, {
24
+ disabled: readonly,
19
25
  checked: value,
20
26
  onChange: handleChange
21
27
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",