@zhenliang/sheet 0.1.2 → 0.1.3
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.
|
@@ -106,14 +106,18 @@ export var stateReducer = {
|
|
|
106
106
|
});
|
|
107
107
|
},
|
|
108
108
|
selectRow: function selectRow(state, payload) {
|
|
109
|
-
var _state$data4, _state$data4$, _state$data5, _state$data5$, _state$data6, _state$data6$;
|
|
109
|
+
var _state$data4, _state$data4$, _state$data$0$length, _state$data5, _state$data5$, _state$data6, _state$data6$;
|
|
110
110
|
var startCol = ((_state$data4 = state.data) === null || _state$data4 === void 0 ? void 0 : (_state$data4$ = _state$data4[0]) === null || _state$data4$ === void 0 ? void 0 : _state$data4$.findIndex(function (item) {
|
|
111
111
|
return !item.fixed;
|
|
112
112
|
})) || 0;
|
|
113
|
-
var endCol = (((_state$data5 = state.data) === null || _state$data5 === void 0 ? void 0 : (_state$data5$ = _state$data5[0]) === null || _state$data5$ === void 0 ? void 0 : _state$data5$.
|
|
113
|
+
var endCol = ((_state$data$0$length = (_state$data5 = state.data) === null || _state$data5 === void 0 ? void 0 : (_state$data5$ = _state$data5[0]) === null || _state$data5$ === void 0 ? void 0 : _state$data5$.length) !== null && _state$data$0$length !== void 0 ? _state$data$0$length : 0) - 1;
|
|
114
|
+
var lastFixed = (_state$data6 = state.data) === null || _state$data6 === void 0 ? void 0 : (_state$data6$ = _state$data6[0]) === null || _state$data6$ === void 0 ? void 0 : _state$data6$.find(function (item) {
|
|
114
115
|
return item.fixed === SheetType.CellAlign.right;
|
|
115
|
-
})
|
|
116
|
-
|
|
116
|
+
});
|
|
117
|
+
if (lastFixed) {
|
|
118
|
+
var _state$data$0$indexOf, _state$data7;
|
|
119
|
+
endCol = (_state$data$0$indexOf = (_state$data7 = state.data) === null || _state$data7 === void 0 ? void 0 : _state$data7[0].indexOf(lastFixed)) !== null && _state$data$0$indexOf !== void 0 ? _state$data$0$indexOf : 0 - 1;
|
|
120
|
+
}
|
|
117
121
|
if (startCol >= 0 && endCol >= 0) {
|
|
118
122
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
119
123
|
start: {
|
|
@@ -130,7 +134,7 @@ export var stateReducer = {
|
|
|
130
134
|
}
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
|
-
return
|
|
137
|
+
return state;
|
|
134
138
|
},
|
|
135
139
|
clearSelect: function clearSelect(state) {
|
|
136
140
|
var start = state.start,
|
package/dist/core/sheet/index.js
CHANGED
|
@@ -202,7 +202,7 @@ var Sheet = function Sheet(props) {
|
|
|
202
202
|
paddingBottom: paddingTop,
|
|
203
203
|
display: 'block'
|
|
204
204
|
}
|
|
205
|
-
}), rowElements, /*#__PURE__*/_jsx("tr", {
|
|
205
|
+
}), rowElements, virtualized && paddingBottom > 0 && /*#__PURE__*/_jsx("tr", {
|
|
206
206
|
style: {
|
|
207
207
|
height: 0,
|
|
208
208
|
paddingBottom: paddingBottom,
|
|
@@ -27,13 +27,21 @@ span.harvest-sheet-container, span.harvest-sheet-container:focus {
|
|
|
27
27
|
tr{
|
|
28
28
|
height:var(--row-height);
|
|
29
29
|
|
|
30
|
-
th{
|
|
30
|
+
th.cell-title{
|
|
31
31
|
line-height: var(--row-height);
|
|
32
|
+
border-bottom: 1px solid transparent;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
td{
|
|
35
36
|
line-height: var(--row-height);
|
|
36
37
|
}
|
|
38
|
+
|
|
39
|
+
&:last-of-type{
|
|
40
|
+
.td{
|
|
41
|
+
border-bottom: 1px solid transparent;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
}
|
|
@@ -239,6 +247,7 @@ span.harvest-sheet-container, span.harvest-sheet-container:focus {
|
|
|
239
247
|
display: block;
|
|
240
248
|
font-size: var(--cell-font-size);
|
|
241
249
|
line-height:var(--cell-inner-height) ;
|
|
250
|
+
height:var(--cell-inner-height) ;
|
|
242
251
|
padding:0
|
|
243
252
|
}
|
|
244
253
|
|
|
@@ -80,6 +80,8 @@ export declare type TableProps = {
|
|
|
80
80
|
backEditStyle?: Partial<CSSStyleDeclaration>;
|
|
81
81
|
rowSelection?: TableRowSelection;
|
|
82
82
|
groupConfig?: TableGroupConfig;
|
|
83
|
+
menuRenderer?: React.FC<SheetType.MenuRenderProps>;
|
|
84
|
+
onContextMenu?: (event: any) => void;
|
|
83
85
|
onChange: (changes: TableChange[], extChanges?: TableChange[]) => void;
|
|
84
86
|
handleAdd?: () => void;
|
|
85
87
|
eventHandler?: Record<'reverse' | 'btn-click' | 'cell-edit' | 'cell-switch' | string, undefined | EventHandler>;
|