@zhenliang/sheet 0.0.4 → 0.0.6

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.
@@ -0,0 +1,40 @@
1
+ # @zhenliang/sheet
2
+
3
+ [![NPM version](https://img.shields.io/npm/v/@zhenliang/sheet.svg?style=flat)](https://npmjs.org/package/@zhenliang/sheet)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/@zhenliang/sheet.svg?style=flat)](https://npmjs.org/package/@zhenliang/sheet)
5
+
6
+ A react library developed with dumi
7
+
8
+ ## Usage
9
+
10
+ TODO
11
+
12
+ ## Options
13
+
14
+ TODO
15
+
16
+ ## Development
17
+
18
+ ```bash
19
+ # install dependencies
20
+ $ pnpm install
21
+
22
+ # develop library by docs demo
23
+ $ pnpm start
24
+
25
+ # build library source code
26
+ $ pnpm run build
27
+
28
+ # build library source code in watch mode
29
+ $ pnpm run build:watch
30
+
31
+ # build docs
32
+ $ pnpm run docs:build
33
+
34
+ # check your project for potential problems
35
+ $ pnpm run doctor
36
+ ```
37
+
38
+ ## LICENSE
39
+
40
+ MIT
@@ -13,5 +13,6 @@
13
13
  .ant-input-number-group-addon{
14
14
  background: transparent;
15
15
  border: none;
16
+ padding:0
16
17
  }
17
18
  }
@@ -57,7 +57,7 @@ export var mouseReducer = {
57
57
  row = _ref2.row,
58
58
  col = _ref2.col;
59
59
  var data = state.data;
60
- if (state.mouseDown === false || data !== null && data !== void 0 && data[row][col].readonly) return state;
60
+ if (state.mouseDown === false || data !== null && data !== void 0 && data[row][col].fixed) return state;
61
61
  return _objectSpread(_objectSpread({}, state), {}, {
62
62
  end: {
63
63
  row: row,
@@ -240,7 +240,9 @@ export var sideEffectReducer = {
240
240
  end = _getState9.end,
241
241
  data = _getState9.data,
242
242
  history = _getState9.history,
243
- groupConfig = _getState9.groupConfig;
243
+ groupConfig = _getState9.groupConfig,
244
+ editing = _getState9.editing;
245
+ if (editing) return;
244
246
  var groupMap = groupConfigToGroupMap(groupConfig);
245
247
  var cellIndex = flatRowColIndex(start, end);
246
248
  var changes = cellIndex.filter(function (item) {
@@ -106,6 +106,10 @@ span.harvest-sheet-container, span.harvest-sheet-container:focus {
106
106
 
107
107
 
108
108
  }
109
+
110
+ &.fixed-unset{
111
+ position: unset;
112
+ }
109
113
  }
110
114
 
111
115
 
@@ -12,7 +12,7 @@ export var SwitchViewer = function SwitchViewer(props) {
12
12
  eventBus.emit('cell-switch', {
13
13
  row: row,
14
14
  record: record,
15
- value: value
15
+ value: !value
16
16
  });
17
17
  }, [eventBus, row, record, value]);
18
18
  return /*#__PURE__*/_jsx(Switch, {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import EventEmitter from 'events';
3
2
  declare const useEventBus: () => EventEmitter;
4
3
  export { useEventBus };
@@ -5,7 +5,8 @@ import { SheetTableType } from '.';
5
5
  export declare enum CellAlign {
6
6
  left = "left",
7
7
  center = "center",
8
- right = "right"
8
+ right = "right",
9
+ unset = "unset"
9
10
  }
10
11
  export declare type Cell = {
11
12
  id: string;
@@ -2,6 +2,7 @@ export var CellAlign = /*#__PURE__*/function (CellAlign) {
2
2
  CellAlign["left"] = "left";
3
3
  CellAlign["center"] = "center";
4
4
  CellAlign["right"] = "right";
5
+ CellAlign["unset"] = "unset";
5
6
  return CellAlign;
6
7
  }({});
7
8
 
@@ -4,11 +4,10 @@ export declare type refAssertion = {
4
4
  contains?: (target: EventTarget | null) => boolean;
5
5
  focus?: () => boolean;
6
6
  } & HTMLTableSectionElement;
7
- export declare type CellAlign = 'left' | 'right' | 'center';
8
- export declare type CellFixed = 'left' | 'right';
7
+ export declare type CellFixed = SheetType.CellAlign;
9
8
  export declare type ColumnProps = {
10
- align?: CellAlign;
11
- fixed?: CellFixed;
9
+ align?: SheetType.CellAlign;
10
+ fixed?: Omit<CellFixed, 'center'>;
12
11
  width?: string | number;
13
12
  dataIndex?: string;
14
13
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -67,8 +67,6 @@
67
67
  "prettier": "^2.7.1",
68
68
  "prettier-plugin-organize-imports": "^3.0.0",
69
69
  "prettier-plugin-packagejson": "^2.2.18",
70
- "react": "^18.0.0",
71
- "react-dom": "^18.0.0",
72
70
  "stylelint": "^14.9.1"
73
71
  },
74
72
  "peerDependencies": {