@zhenliang/sheet 0.1.57-beta.0 → 0.1.58

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.
@@ -150,7 +150,6 @@ span.harvest-sheet-container:focus {
150
150
 
151
151
 
152
152
  .harvest-sheet-container .harvest-sheet .cell.selected {
153
- border: 1px double;
154
153
  border-color: var(--cell-border-color);
155
154
  box-shadow: var(--cell-box-shadow);
156
155
  }
@@ -162,11 +161,13 @@ span.harvest-sheet-container:focus {
162
161
  .harvest-sheet-container .harvest-sheet .cell.selected-top {
163
162
  border-top-color: var(--resizer);
164
163
  border-top-width: 1px;
164
+ border-top-style: double;
165
165
  }
166
166
 
167
167
  .harvest-sheet-container .harvest-sheet .cell.selected-left {
168
168
  border-left-color: var(--resizer);
169
169
  border-left-width: 1px;
170
+ border-left-style: double;
170
171
  }
171
172
 
172
173
  .harvest-sheet-container .harvest-sheet .cell.selected-bottom {
@@ -1,6 +1,6 @@
1
1
  import { useKeyBoard } from "../..";
2
2
  import { sideEffectReducer } from "../reducers/sideEffectReducer";
3
- import { getRowHeight } from "../util";
3
+ import { ensureFocus, getRowHeight } from "../util";
4
4
  export var useKeyBoardEvent = function useKeyBoardEvent(dispatch, elementRef) {
5
5
  useKeyBoard({
6
6
  move: function move(e, value) {
@@ -34,6 +34,7 @@ export var useKeyBoardEvent = function useKeyBoardEvent(dispatch, elementRef) {
34
34
  },
35
35
  reverse: function reverse() {
36
36
  dispatch(sideEffectReducer.reverse);
37
+ ensureFocus(elementRef.current);
37
38
  },
38
39
  recover: function recover(e) {
39
40
  e.preventDefault();
@@ -60,3 +60,4 @@ export declare const stripRowIndex: (data: SheetType.Cell[][]) => {
60
60
  startIndex: number;
61
61
  endIndex: number;
62
62
  };
63
+ export declare const ensureFocus: (container?: HTMLElement | null) => void;
package/dist/core/util.js CHANGED
@@ -475,4 +475,19 @@ export var stripRowIndex = function stripRowIndex(data) {
475
475
  startIndex: startIndex,
476
476
  endIndex: endIndex
477
477
  };
478
+ };
479
+ var focusInterval;
480
+ export var ensureFocus = function ensureFocus(container) {
481
+ if (!container) return;
482
+ if (focusInterval) {
483
+ clearInterval(focusInterval);
484
+ focusInterval = undefined;
485
+ }
486
+ focusInterval = setInterval(function () {
487
+ container === null || container === void 0 || container.focus();
488
+ }, 100);
489
+ setTimeout(function () {
490
+ clearInterval(focusInterval);
491
+ focusInterval = undefined;
492
+ }, 1000);
478
493
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.57-beta.0",
3
+ "version": "0.1.58",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",