@zhenliang/sheet 0.1.52 → 0.1.54
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.
|
@@ -94,6 +94,9 @@ export var getNumberEditor = function getNumberEditor(extraProps, getExtraProps)
|
|
|
94
94
|
if (!isNumber(+value)) {
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
+
if (!value) {
|
|
98
|
+
return handleChange('');
|
|
99
|
+
}
|
|
97
100
|
if (max && +value > max) {
|
|
98
101
|
handleChange(max);
|
|
99
102
|
} else if (min && +value < min) {
|
|
@@ -66,12 +66,12 @@ export var keyboardReducer = {
|
|
|
66
66
|
return state;
|
|
67
67
|
},
|
|
68
68
|
enter: function enter(state, payload) {
|
|
69
|
-
var _data$start$row;
|
|
69
|
+
var _data$start$row, _data$start$row2;
|
|
70
70
|
var start = state.start,
|
|
71
71
|
end = state.end,
|
|
72
72
|
editing = state.editing,
|
|
73
73
|
data = state.data;
|
|
74
|
-
if (!start || !end || data !== null && data !== void 0 && (_data$start$row = data[start.row]) !== null && _data$start$row !== void 0 && _data$start$row[start.col].readonly) {
|
|
74
|
+
if (!start || !end || data !== null && data !== void 0 && (_data$start$row = data[start.row]) !== null && _data$start$row !== void 0 && _data$start$row[start.col].readonly || !(data !== null && data !== void 0 && (_data$start$row2 = data[start.row]) !== null && _data$start$row2 !== void 0 && _data$start$row2[start.col].editable)) {
|
|
75
75
|
return state;
|
|
76
76
|
}
|
|
77
77
|
if (!editing) {
|
|
@@ -135,16 +135,16 @@ export var formatGroupData = function formatGroupData(param) {
|
|
|
135
135
|
className: 'sheet-control'
|
|
136
136
|
});
|
|
137
137
|
columns.forEach(function (colInfo, col) {
|
|
138
|
-
var _colInfo$cellConfig, _colInfo$cellConfig2, _colInfo$cellConfig3;
|
|
138
|
+
var _colInfo$readonly, _colInfo$editable, _colInfo$cellConfig, _colInfo$cellConfig2, _colInfo$cellConfig3;
|
|
139
139
|
var value = itemRow[colInfo.dataIndex || ''];
|
|
140
140
|
dataRow.push({
|
|
141
141
|
id: rowId,
|
|
142
142
|
value: value,
|
|
143
143
|
record: itemRow,
|
|
144
|
-
readonly: !(colInfo.readonly instanceof Function) ? colInfo.readonly : colInfo.readonly(value, itemRow, currentIndex, col),
|
|
144
|
+
readonly: !(colInfo.readonly instanceof Function) ? (_colInfo$readonly = colInfo.readonly) !== null && _colInfo$readonly !== void 0 ? _colInfo$readonly : false : colInfo.readonly(value, itemRow, currentIndex, col),
|
|
145
145
|
align: colInfo.align,
|
|
146
146
|
fixed: colInfo.fixed,
|
|
147
|
-
editable: !(colInfo.editable instanceof Function) ? colInfo.editable : colInfo.editable(value, itemRow, currentIndex, col),
|
|
147
|
+
editable: !(colInfo.editable instanceof Function) ? (_colInfo$editable = colInfo.editable) !== null && _colInfo$editable !== void 0 ? _colInfo$editable : true : colInfo.editable(value, itemRow, currentIndex, col),
|
|
148
148
|
valueViewer: colInfo.render ? colInfo.render : undefined,
|
|
149
149
|
dataEditor: colInfo.editor ? colInfo.editor : undefined,
|
|
150
150
|
searchKey: colInfo.searchKey,
|
|
@@ -52,16 +52,16 @@ export var formatSelectionData = function formatSelectionData(param) {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
columns.forEach(function (colInfo, col) {
|
|
55
|
-
var _colInfo$cellConfig, _colInfo$cellConfig2, _colInfo$cellConfig3;
|
|
55
|
+
var _colInfo$readonly, _colInfo$editable, _colInfo$cellConfig, _colInfo$cellConfig2, _colInfo$cellConfig3;
|
|
56
56
|
var value = item[colInfo.dataIndex || ''];
|
|
57
57
|
rows.push({
|
|
58
58
|
id: rowId,
|
|
59
59
|
value: value,
|
|
60
60
|
record: item,
|
|
61
|
-
readonly: !(colInfo.readonly instanceof Function) ? colInfo.readonly : colInfo.readonly(value, item, row, col),
|
|
61
|
+
readonly: !(colInfo.readonly instanceof Function) ? (_colInfo$readonly = colInfo.readonly) !== null && _colInfo$readonly !== void 0 ? _colInfo$readonly : false : colInfo.readonly(value, item, row, col),
|
|
62
62
|
align: colInfo.align,
|
|
63
63
|
fixed: colInfo.fixed,
|
|
64
|
-
editable: !(colInfo.editable instanceof Function) ? colInfo.editable : colInfo.editable(value, item, row),
|
|
64
|
+
editable: !(colInfo.editable instanceof Function) ? (_colInfo$editable = colInfo.editable) !== null && _colInfo$editable !== void 0 ? _colInfo$editable : true : colInfo.editable(value, item, row),
|
|
65
65
|
valueViewer: colInfo.render ? colInfo.render : undefined,
|
|
66
66
|
dataEditor: colInfo.editor ? colInfo.editor : undefined,
|
|
67
67
|
searchKey: colInfo.searchKey,
|