@zhenliang/sheet 0.2.5-beta.11 → 0.2.5-beta.12

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.
@@ -43,6 +43,7 @@ export var getFormulaInputEditor = function getFormulaInputEditor(options, repla
43
43
  inputArgs = Object.assign({}, (_objectDestructuringEmpty(_ref2), _ref2));
44
44
  var replaceValue = replaceIndex ? (_get = get(record, [replaceIndex])) !== null && _get !== void 0 ? _get : '' : originValue;
45
45
  var calcValue = replaceValue.startsWith('=') ? replaceValue : "=".concat(replaceValue);
46
+ var originContainerValue = replaceValue === '' || replaceValue === null ? '' : calcValue;
46
47
  var _useState = useState(calcValue),
47
48
  _useState2 = _slicedToArray(_useState, 1),
48
49
  inputValue = _useState2[0];
@@ -51,7 +52,7 @@ export var getFormulaInputEditor = function getFormulaInputEditor(options, repla
51
52
  offsetX = _useState4[0],
52
53
  setOffsetX = _useState4[1];
53
54
  // 为了不重新render,再写一个
54
- var _useState5 = useState(replaceValue),
55
+ var _useState5 = useState(originContainerValue),
55
56
  _useState6 = _slicedToArray(_useState5, 2),
56
57
  containerValue = _useState6[0],
57
58
  setContainerValue = _useState6[1];
@@ -11,6 +11,7 @@
11
11
  top: 0;
12
12
  background: #fff;
13
13
  padding-right: 8px;
14
+ z-index: 5;
14
15
  }
15
16
 
16
17
  .formula-editor-equal {
@@ -54,7 +54,7 @@ var useKeyEventEffect = function useKeyEventEffect(_ref) {
54
54
  }, [closeDorpDown, setOffsetX, setOpen]);
55
55
  var handleKeyDown = useCallback(function (e) {
56
56
  var _currentSpan$textCont, _currentSpan$textCont2;
57
- if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
57
+ if (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'Delete') {
58
58
  e.preventDefault();
59
59
  e.stopPropagation();
60
60
  return;
@@ -1,5 +1,5 @@
1
1
  import { SheetTableType } from "../..";
2
2
  export declare const useRowSelection: (dataSource: Record<string, unknown>[], rowSelection?: SheetTableType.TableRowSelection, hasChildren?: boolean) => [boolean[], (value: boolean[]) => void];
3
- export declare const formatSelectionData: (param: Pick<SheetTableType.TableProps, "columns" | "dataSource" | "rowKey" | "showRemark" | "rowSelection"> & {
3
+ export declare const formatSelectionData: (param: Pick<SheetTableType.TableProps, "columns" | "showRemark" | "rowSelection" | "dataSource" | "rowKey"> & {
4
4
  checked: boolean[];
5
5
  }) => any[][];
@@ -197,7 +197,7 @@ var App = function App() {
197
197
  var row = _ref4.row,
198
198
  key = _ref4.key,
199
199
  value = _ref4.value;
200
- newData[row] = _objectSpread(_objectSpread({}, newData[row]), {}, _defineProperty({}, key, key === 'tags' ? (_String = String(value)) === null || _String === void 0 ? void 0 : _String.split(',') : value));
200
+ newData[row] = _objectSpread(_objectSpread({}, newData[row]), {}, _defineProperty({}, key === 'amount' ? 'formula' : key, key === 'tags' ? (_String = String(value)) === null || _String === void 0 ? void 0 : _String.split(',') : value));
201
201
  });
202
202
  setData(newData);
203
203
  }, [dataSource]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.2.5-beta.11",
3
+ "version": "0.2.5-beta.12",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",