@kep-platform/basic-component 0.0.58 → 0.0.60
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/@types/index.d.ts +2 -0
- package/dist/Table/Table.js +5 -5
- package/dist/Tree/MainProperties.d.ts +1 -1
- package/dist/Tree/TreeNode.js +10 -5
- package/dist/Tree/test.js +2 -0
- package/package.json +3 -3
package/dist/@types/index.d.ts
CHANGED
package/dist/Table/Table.js
CHANGED
@@ -414,18 +414,18 @@ export default function Table(_ref3) {
|
|
414
414
|
columns: formatedColumns,
|
415
415
|
isFlex: isFlex
|
416
416
|
}));else return undefined;
|
417
|
-
})) : empty), pagination !== false && dataSource.length !== 0 && /*#__PURE__*/React.createElement(Pagination, _extends({}, pagination, {
|
417
|
+
})) : empty), pagination !== false && ((pagination === null || pagination === void 0 ? void 0 : pagination.total) || dataSource.length) !== 0 && /*#__PURE__*/React.createElement(Pagination, _extends({}, pagination, {
|
418
418
|
total: (pagination === null || pagination === void 0 ? void 0 : pagination.total) || dataSource.length,
|
419
419
|
justifyContent: "right",
|
420
420
|
onChange: function onChange(current, pageSize) {
|
421
|
-
_onChange2 === null || _onChange2 === void 0 || _onChange2({
|
421
|
+
_onChange2 === null || _onChange2 === void 0 || _onChange2(_objectSpread(_objectSpread({}, pagination), {}, {
|
422
422
|
current: current,
|
423
423
|
pageSize: pageSize
|
424
|
-
});
|
425
|
-
setPagination({
|
424
|
+
}));
|
425
|
+
setPagination(_objectSpread(_objectSpread({}, pagination), {}, {
|
426
426
|
current: current,
|
427
427
|
pageSize: pageSize
|
428
|
-
});
|
428
|
+
}));
|
429
429
|
}
|
430
430
|
})));
|
431
431
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
|
-
export declare const MainArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("../Flex").FlexItemProps
|
2
|
+
export declare const MainArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HtmlHTMLAttributes<HTMLDivElement> | keyof import("../Flex").FlexItemProps> & import("../Flex").FlexItemProps & React.HtmlHTMLAttributes<HTMLDivElement>, "ref"> & {
|
3
3
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
4
4
|
}, never>> & string;
|
5
5
|
type MainPropertyProps = {
|
package/dist/Tree/TreeNode.js
CHANGED
@@ -99,6 +99,9 @@ var groupTreeNodeByPropertyName = function groupTreeNodeByPropertyName(condition
|
|
99
99
|
export var nodeTypeMap = {
|
100
100
|
virtual: 'virtual'
|
101
101
|
};
|
102
|
+
function isFalse(value) {
|
103
|
+
return typeof value === 'boolean' && value === false;
|
104
|
+
}
|
102
105
|
export var TreeNodeController = observer(function (_ref) {
|
103
106
|
var node = _ref.node,
|
104
107
|
_ref$selectedKeys = _ref.selectedKeys,
|
@@ -122,15 +125,16 @@ export var TreeNodeController = observer(function (_ref) {
|
|
122
125
|
return level + 1;
|
123
126
|
}, [level]);
|
124
127
|
var selected = useMemo(function () {
|
125
|
-
return selectedKeys.includes(node[fieldNames.key]);
|
128
|
+
return selectedKeys.includes(node[fieldNames.key]) && !isFalse(node.selectable);
|
126
129
|
}, [selectedKeys, fieldNames, node]);
|
127
130
|
var expanded = useMemo(function () {
|
128
|
-
return expandedKeys.includes(node[fieldNames.key]) || node.nodeType === nodeTypeMap.virtual;
|
131
|
+
return (expandedKeys.includes(node[fieldNames.key]) || node.nodeType === nodeTypeMap.virtual) && !node.isLeaf;
|
129
132
|
}, [expandedKeys, fieldNames, node]);
|
130
133
|
var treeNodeGroup = useMemo(function () {
|
131
134
|
return groupTreeNodeByPropertyName(node.groupBy, node.children || []);
|
132
135
|
}, [node.children, node.groupBy]);
|
133
136
|
var onClickNodeHandler = useCallback(function (e) {
|
137
|
+
if (typeof node.selectable === 'boolean' && node.selectable === false) return;
|
134
138
|
if (multiple) {
|
135
139
|
if (selected) {
|
136
140
|
onSelect(selectedKeys.filter(function (key) {
|
@@ -154,7 +158,7 @@ export var TreeNodeController = observer(function (_ref) {
|
|
154
158
|
selected: !selected
|
155
159
|
});
|
156
160
|
}
|
157
|
-
}, [onSelect, selectedKeys, multiple, selected]);
|
161
|
+
}, [onSelect, selectedKeys, multiple, selected, node]);
|
158
162
|
var onContextMenuHandler = useCallback(function (e) {
|
159
163
|
onSelect([node[fieldNames.key]], {
|
160
164
|
nativeEvent: e,
|
@@ -192,7 +196,8 @@ export var TreeNodeController = observer(function (_ref) {
|
|
192
196
|
cursor: "pointer",
|
193
197
|
onClick: onClickExpandIconhandler
|
194
198
|
}, /*#__PURE__*/React.createElement(ExpandedIcon, {
|
195
|
-
expanded: expanded
|
199
|
+
expanded: expanded,
|
200
|
+
hidden: node.isLeaf
|
196
201
|
})), /*#__PURE__*/React.createElement(TitleArea, {
|
197
202
|
flex: 1
|
198
203
|
}, titleRender ? titleRender(node) : node[fieldNames.title])),
|
@@ -205,7 +210,7 @@ export var TreeNodeController = observer(function (_ref) {
|
|
205
210
|
});
|
206
211
|
return /*#__PURE__*/React.createElement(React.Fragment, null, node.nodeType !== nodeTypeMap.virtual && /*#__PURE__*/React.createElement(TreeNode, {
|
207
212
|
key: node[fieldNames.key],
|
208
|
-
selected:
|
213
|
+
selected: selected,
|
209
214
|
width: width,
|
210
215
|
onClick: onClickNodeHandler,
|
211
216
|
onContextMenu: onContextMenuHandler
|
package/dist/Tree/test.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kep-platform/basic-component",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.60",
|
4
4
|
"description": "A react library developed with dumi",
|
5
5
|
"license": "MIT",
|
6
6
|
"module": "dist/index.js",
|
@@ -47,7 +47,7 @@
|
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
49
|
"@ant-design/icons": "^5.3.7",
|
50
|
-
"@kep-platform/hooks": "^0.0.
|
50
|
+
"@kep-platform/hooks": "^0.0.60",
|
51
51
|
"color": "^4.2.3",
|
52
52
|
"rc-pagination": "^4.1.0"
|
53
53
|
},
|
@@ -87,5 +87,5 @@
|
|
87
87
|
"authors": [
|
88
88
|
"less-step-jss 1599925910@qq.com"
|
89
89
|
],
|
90
|
-
"gitHead": "
|
90
|
+
"gitHead": "05d862e763f6127675b8c148c87e1671f18ac33e"
|
91
91
|
}
|