@zhenliang/sheet 0.1.14 → 0.1.15

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.
@@ -21,8 +21,8 @@
21
21
  }
22
22
  }
23
23
 
24
- }
24
+ .ant-cascader-menu {
25
+ font-size: 12px;
26
+ }
25
27
 
26
- .ant-cascader-menu {
27
- font-size: 12px;
28
- }
28
+ }
@@ -2,5 +2,7 @@ import type { SheetType } from "../../../type";
2
2
  import { InputNumberProps } from 'antd';
3
3
  import 'antd/es/input-number/style/index.css';
4
4
  import './index.less';
5
+ declare type inputProps = Partial<Pick<InputNumberProps, 'max' | 'min' | 'addonBefore' | 'addonAfter' | 'precision'>>;
5
6
  export declare const NumberEditor: SheetType.CellEditor;
6
- export declare const getNumberEditor: (extraProps?: Partial<Pick<InputNumberProps, 'max' | 'min' | 'addonBefore' | 'addonAfter' | 'precision'>>) => SheetType.CellEditor;
7
+ export declare const getNumberEditor: (extraProps?: inputProps, getExtraProps?: ((props: SheetType.CellEditorProps) => inputProps) | undefined) => SheetType.CellEditor;
8
+ export {};
@@ -34,7 +34,7 @@ export var NumberEditor = function NumberEditor(props) {
34
34
  onChange: onChange
35
35
  });
36
36
  };
37
- export var getNumberEditor = function getNumberEditor(extraProps) {
37
+ export var getNumberEditor = function getNumberEditor(extraProps, getExtraProps) {
38
38
  var NumberEditor = function NumberEditor(props) {
39
39
  var value = props.value,
40
40
  onChange = props.onChange;
@@ -43,7 +43,7 @@ export var getNumberEditor = function getNumberEditor(extraProps) {
43
43
  var _inputNumberRef$curre2;
44
44
  inputNumberRef === null || inputNumberRef === void 0 ? void 0 : (_inputNumberRef$curre2 = inputNumberRef.current) === null || _inputNumberRef$curre2 === void 0 ? void 0 : _inputNumberRef$curre2.focus();
45
45
  }, []);
46
- var _ref = extraProps || {},
46
+ var _ref = getExtraProps ? getExtraProps(props) : extraProps !== null && extraProps !== void 0 ? extraProps : {},
47
47
  precision = _ref.precision,
48
48
  inputArgs = _objectWithoutProperties(_ref, _excluded);
49
49
  var valueFormatter = useCallback(function (value) {
@@ -1,10 +1,11 @@
1
- .select-editor,.ant-select-selector {
1
+ .select-editor {
2
2
  // select style
3
3
  width: 100%;
4
4
  line-height: 20px;
5
5
  height: 20px;
6
6
 
7
7
  .ant-select-selector {
8
+ width: 100%;
8
9
  border: none !important;
9
10
  background: transparent !important;
10
11
  box-shadow: none !important;
@@ -36,8 +37,7 @@
36
37
  box-shadow: inset 0 -100px 0 rgba(33,133,208,15%);
37
38
  }
38
39
 
40
+ .ant-select-item {
41
+ font-size: 12px !important;
42
+ }
39
43
  }
40
-
41
- .ant-select-item {
42
- font-size: 12px !important;
43
- }
@@ -138,18 +138,22 @@ span.harvest-sheet-container, span.harvest-sheet-container:focus {
138
138
 
139
139
  .harvest-sheet-container .harvest-sheet .cell.selected-top{
140
140
  border-top-color: var(--resizer);
141
+ border-top-width: 1px;
141
142
  }
142
143
 
143
144
  .harvest-sheet-container .harvest-sheet .cell.selected-left{
144
145
  border-left-color: var(--resizer);
145
- }
146
+ border-left-width:1px;
147
+ }
146
148
 
147
149
  .harvest-sheet-container .harvest-sheet .cell.selected-bottom{
148
150
  border-bottom-color: var(--resizer);
151
+ border-bottom-width:1px;
149
152
  }
150
153
 
151
154
  .harvest-sheet-container .harvest-sheet .cell.selected-right{
152
155
  border-right-color: var(--resizer);
156
+ border-right-width:1px;
153
157
  }
154
158
 
155
159
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { SheetType } from "../../../type";
2
3
  import './index.less';
3
4
  export declare const DraggableShell: ({ columns, className, showGroup, showSelect, controlProps, controlWidth, }: SheetType.SheetShell) => import("react").FC<{
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { SheetType } from "../../type";
2
3
  import './draggableShell/index.less';
3
4
  export declare const TableShell: ({ columns, className, showGroup, showSelect, controlProps, controlWidth, }: SheetType.SheetShell) => import("react").FC<{
@@ -122,10 +122,10 @@ var Table = function Table(_ref) {
122
122
  id: rowId,
123
123
  value: value,
124
124
  record: itemRow,
125
- readonly: !(colInfo.readonly instanceof Function) ? colInfo.readonly : colInfo.readonly(value, itemRow, currentIndex),
125
+ readonly: !(colInfo.readonly instanceof Function) ? colInfo.readonly : colInfo.readonly(value, itemRow, currentIndex, col),
126
126
  align: colInfo.align,
127
127
  fixed: colInfo.fixed,
128
- editable: !(colInfo.editable instanceof Function) ? colInfo.editable : colInfo.editable(value, itemRow, currentIndex),
128
+ editable: !(colInfo.editable instanceof Function) ? colInfo.editable : colInfo.editable(value, itemRow, currentIndex, col),
129
129
  valueViewer: colInfo.render ? colInfo.render : undefined,
130
130
  dataEditor: colInfo.editor ? colInfo.editor : undefined,
131
131
  row: currentIndex,
@@ -171,7 +171,7 @@ var Table = function Table(_ref) {
171
171
  id: rowId,
172
172
  value: value,
173
173
  record: item,
174
- readonly: !(colInfo.readonly instanceof Function) ? colInfo.readonly : colInfo.readonly(value, item, row),
174
+ readonly: !(colInfo.readonly instanceof Function) ? colInfo.readonly : colInfo.readonly(value, item, row, col),
175
175
  align: colInfo.align,
176
176
  fixed: colInfo.fixed,
177
177
  editable: !(colInfo.editable instanceof Function) ? colInfo.editable : colInfo.editable(value, item, row),
@@ -193,6 +193,7 @@ var Table = function Table(_ref) {
193
193
  var handleChanges = useCallback(function (changes, extChange) {
194
194
  onChange && onChange(changes.map(function (item) {
195
195
  return {
196
+ col: item.col,
196
197
  row: item.row,
197
198
  id: item.id,
198
199
  key: columns[hasControl ? item.col - 1 : item.col].dataIndex,
@@ -200,6 +201,7 @@ var Table = function Table(_ref) {
200
201
  };
201
202
  }), extChange === null || extChange === void 0 ? void 0 : extChange.map(function (item) {
202
203
  return {
204
+ col: item.col,
203
205
  row: item.row,
204
206
  id: item.id,
205
207
  key: columns[hasControl ? item.col - 1 : item.col].dataIndex,
@@ -5,7 +5,7 @@ export declare type refAssertion = {
5
5
  focus?: () => boolean;
6
6
  } & HTMLTableSectionElement;
7
7
  export declare type CellFixed = SheetType.CellAlign;
8
- export declare type RecordRowMap<T> = (value: unknown, record: Record<string, unknown>, index: number) => T;
8
+ export declare type RecordRowMap<T> = (value: unknown, record: Record<string, unknown>, index: number, colIndex?: number) => T;
9
9
  export declare type ColumnProps = {
10
10
  /**
11
11
  * @description 对齐
@@ -38,6 +38,7 @@ export declare type ColumnProps = {
38
38
  editor?: SheetType.CellEditor;
39
39
  };
40
40
  export declare type TableChange = {
41
+ col?: number;
41
42
  row: number;
42
43
  id: string;
43
44
  key: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhenliang/sheet",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",