@zhenliang/sheet 0.1.10 → 0.1.13
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.
- package/dist/core/editor/cascaderEditor/index.js +1 -0
- package/dist/core/reducers/stateReducer.js +1 -1
- package/dist/core/sheet/Cell.js +1 -1
- package/dist/core/sheet/index.less +1 -2
- package/dist/core/shell/draggableShell/index.d.ts +0 -1
- package/dist/core/shell/tableShell.d.ts +0 -1
- package/dist/core/table/index.js +0 -1
- package/dist/core/table/useGroupConfig.js +14 -5
- package/dist/hooks/useEventBus.d.ts +0 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ var getCascaderEditor = function getCascaderEditor(options, getCustomOptions) {
|
|
|
10
10
|
onConfirm = props.onConfirm;
|
|
11
11
|
var val = useMemo(function () {
|
|
12
12
|
var res = optionsToValuesFromLabelOrValue(options, value);
|
|
13
|
+
console.log('cascader-editor', options, res, value);
|
|
13
14
|
return res;
|
|
14
15
|
}, [value, options]);
|
|
15
16
|
var handleChange = function handleChange(opt) {
|
|
@@ -116,7 +116,7 @@ export var stateReducer = {
|
|
|
116
116
|
});
|
|
117
117
|
if (lastFixed) {
|
|
118
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;
|
|
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
120
|
}
|
|
121
121
|
if (startCol >= 0 && endCol >= 0) {
|
|
122
122
|
return _objectSpread(_objectSpread({}, state), {}, {
|
package/dist/core/sheet/Cell.js
CHANGED
|
@@ -70,7 +70,7 @@ var Cell = function Cell(props) {
|
|
|
70
70
|
} else if (eventInfo.value && eventInfo.editing) {
|
|
71
71
|
var _cell$dataEditor, _cell$dataEditor2, _cell$dataEditor2$par;
|
|
72
72
|
// 单元格直接键盘编辑,设置为输入值
|
|
73
|
-
setValue((_cell$dataEditor = cell.dataEditor) !== null && _cell$dataEditor !== void 0 && _cell$dataEditor.parser ? cell === null || cell === void 0 ? void 0 : (_cell$dataEditor2 = cell.dataEditor) === null || _cell$dataEditor2 === void 0 ? void 0 : (_cell$dataEditor2$par = _cell$dataEditor2.parser) === null || _cell$dataEditor2$par === void 0 ? void 0 : _cell$dataEditor2$par.call(_cell$dataEditor2, eventInfo.value) : value);
|
|
73
|
+
setValue((_cell$dataEditor = cell.dataEditor) !== null && _cell$dataEditor !== void 0 && _cell$dataEditor.parser ? cell === null || cell === void 0 ? void 0 : (_cell$dataEditor2 = cell.dataEditor) === null || _cell$dataEditor2 === void 0 ? void 0 : (_cell$dataEditor2$par = _cell$dataEditor2.parser) === null || _cell$dataEditor2$par === void 0 ? void 0 : _cell$dataEditor2$par.call(_cell$dataEditor2, eventInfo.value) : eventInfo.value);
|
|
74
74
|
}
|
|
75
75
|
setEventState(eventInfo);
|
|
76
76
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { SheetType } from "../../type";
|
|
3
2
|
import './draggableShell/index.less';
|
|
4
3
|
export declare const TableShell: ({ columns, className, showGroup, showSelect, controlProps, controlWidth, }: SheetType.SheetShell) => import("react").FC<{
|
package/dist/core/table/index.js
CHANGED
|
@@ -28,21 +28,30 @@ export var useGroupConfig = function useGroupConfig(dataSource, tableGroupConfig
|
|
|
28
28
|
if (!hasChildren) return;
|
|
29
29
|
var rowConfig = dataSourceToRowConfig(dataSource, tableGroupConfig === null || tableGroupConfig === void 0 ? void 0 : tableGroupConfig.defaultOpen);
|
|
30
30
|
if (groupConfigRef.current) {
|
|
31
|
-
|
|
32
|
-
var _groupConfigRef$curre;
|
|
31
|
+
rowConfig.groups.forEach(function (_ref, index) {
|
|
32
|
+
var _groupConfigRef$curre, _groupConfigRef$curre2;
|
|
33
33
|
var groupName = _ref.groupName;
|
|
34
|
-
var rowIndex =
|
|
34
|
+
var rowIndex = (_groupConfigRef$curre = (_groupConfigRef$curre2 = groupConfigRef.current) === null || _groupConfigRef$curre2 === void 0 ? void 0 : _groupConfigRef$curre2.groups.findIndex(function (item) {
|
|
35
35
|
return item.groupName === groupName;
|
|
36
|
-
});
|
|
37
|
-
|
|
36
|
+
})) !== null && _groupConfigRef$curre !== void 0 ? _groupConfigRef$curre : -1;
|
|
37
|
+
if (rowIndex >= 0) {
|
|
38
|
+
var _groupConfigRef$curre3, _groupConfigRef$curre4, _groupConfigRef$curre5;
|
|
39
|
+
var hasNewLine = rowConfig.groups[rowIndex].groupEnd !== ((_groupConfigRef$curre3 = groupConfigRef.current) === null || _groupConfigRef$curre3 === void 0 ? void 0 : (_groupConfigRef$curre4 = _groupConfigRef$curre3.groups[index]) === null || _groupConfigRef$curre4 === void 0 ? void 0 : _groupConfigRef$curre4.groupEnd);
|
|
40
|
+
rowConfig.groupOpen[rowIndex] = hasNewLine ? true : (_groupConfigRef$curre5 = groupConfigRef.current) === null || _groupConfigRef$curre5 === void 0 ? void 0 : _groupConfigRef$curre5.groupOpen[index];
|
|
41
|
+
} else {
|
|
42
|
+
// 新子行
|
|
43
|
+
rowConfig.groupOpen[index] = true;
|
|
44
|
+
}
|
|
38
45
|
});
|
|
39
46
|
}
|
|
40
47
|
setGroupConfig(rowConfig);
|
|
41
48
|
groupConfigRef.current = rowConfig;
|
|
42
49
|
}, [dataSource.length, childrenLength, hasChildren]);
|
|
43
50
|
var handleGroupChange = useCallback(function (value) {
|
|
51
|
+
var _groupConfigRef$curre6;
|
|
44
52
|
setGroupConfig(value);
|
|
45
53
|
groupConfigRef.current = value;
|
|
54
|
+
console.log('handler', childrenLength, (_groupConfigRef$curre6 = groupConfigRef.current) === null || _groupConfigRef$curre6 === void 0 ? void 0 : _groupConfigRef$curre6.groupOpen);
|
|
46
55
|
}, [setGroupConfig]);
|
|
47
56
|
return [groupConfig, handleGroupChange];
|
|
48
57
|
};
|