@kep-platform/basic-component 0.0.6 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Columns/Columns.d.ts +2 -1
- package/dist/Columns/Columns.js +7 -4
- package/dist/Spin/Spin.js +4 -3
- package/dist/Table/Table.js +2 -1
- package/package.json +3 -3
@@ -3,6 +3,7 @@ export declare const DefaultColumnWidth = 200;
|
|
3
3
|
export type ColumnsProps = {
|
4
4
|
columns: ColumnType[];
|
5
5
|
rowData: Record<string, any>;
|
6
|
+
rowIndex?: number;
|
6
7
|
isFlex?: boolean;
|
7
8
|
leftBase?: number;
|
8
9
|
columnsKey?: string;
|
@@ -21,4 +22,4 @@ export declare const Column: import("styled-components/dist/types").IStyledCompo
|
|
21
22
|
left?: string | undefined;
|
22
23
|
right?: string | undefined;
|
23
24
|
}>> & string;
|
24
|
-
export default function Columns({ columns, rowData, isFlex, leftBase, columnsKey, ...columnsRestProps }: ColumnsProps): React.JSX.Element;
|
25
|
+
export default function Columns({ columns, rowData, rowIndex, isFlex, leftBase, columnsKey, ...columnsRestProps }: ColumnsProps): React.JSX.Element;
|
package/dist/Columns/Columns.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var _excluded = ["columns", "rowData", "isFlex", "leftBase", "columnsKey"],
|
1
|
+
var _excluded = ["columns", "rowData", "rowIndex", "isFlex", "leftBase", "columnsKey"],
|
2
2
|
_excluded2 = ["dataIndex", "render", "key"];
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
4
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
@@ -57,6 +57,8 @@ var displayColumnsCache = {};
|
|
57
57
|
export default function Columns(_ref) {
|
58
58
|
var columns = _ref.columns,
|
59
59
|
rowData = _ref.rowData,
|
60
|
+
_ref$rowIndex = _ref.rowIndex,
|
61
|
+
rowIndex = _ref$rowIndex === void 0 ? 0 : _ref$rowIndex,
|
60
62
|
_ref$isFlex = _ref.isFlex,
|
61
63
|
isFlex = _ref$isFlex === void 0 ? true : _ref$isFlex,
|
62
64
|
_ref$leftBase = _ref.leftBase,
|
@@ -112,8 +114,9 @@ export default function Columns(_ref) {
|
|
112
114
|
direction: "row"
|
113
115
|
}, columnsRestProps, {
|
114
116
|
widthSum: widthSum,
|
115
|
-
isFlex: isFlex
|
116
|
-
|
117
|
+
isFlex: isFlex,
|
118
|
+
rowIndex: rowIndex
|
119
|
+
}), displayColumns.map(function (_ref3) {
|
117
120
|
var dataIndex = _ref3.dataIndex,
|
118
121
|
render = _ref3.render,
|
119
122
|
key = _ref3.key,
|
@@ -121,6 +124,6 @@ export default function Columns(_ref) {
|
|
121
124
|
return /*#__PURE__*/React.createElement(Column, _extends({}, listItemRestProps, {
|
122
125
|
key: key,
|
123
126
|
isFlex: isFlex
|
124
|
-
}), (render === null || render === void 0 ? void 0 : render(rowData[dataIndex], rowData,
|
127
|
+
}), (render === null || render === void 0 ? void 0 : render(rowData[dataIndex], rowData, rowIndex)) || rowData[dataIndex] || '-');
|
125
128
|
}));
|
126
129
|
}
|
package/dist/Spin/Spin.js
CHANGED
@@ -4,13 +4,14 @@ import styled from 'styled-components';
|
|
4
4
|
var SpinContainer = styled.div.withConfig({
|
5
5
|
displayName: "SpinContainer",
|
6
6
|
componentId: "basic-component-347b__sc-1s1g2fa-0"
|
7
|
-
})(["position:relative;
|
7
|
+
})(["position:relative;"]);
|
8
8
|
var SpinMark = styled.div.withConfig({
|
9
9
|
displayName: "SpinMark",
|
10
10
|
componentId: "basic-component-347b__sc-1s1g2fa-1"
|
11
|
-
})(["position:absolute;
|
11
|
+
})(["position:absolute;inset:0 0 0 0;background-color:rgba(255,255,255,0.5);display:flex;justify-content:center;align-items:center;"]);
|
12
12
|
export default function Spin(props) {
|
13
13
|
return /*#__PURE__*/React.createElement(SpinContainer, null, props.children, /*#__PURE__*/React.createElement(SpinMark, {
|
14
|
-
spinning: props.spinning
|
14
|
+
spinning: props.spinning,
|
15
|
+
hidden: !props.spinning
|
15
16
|
}, /*#__PURE__*/React.createElement(LoadingOutlined, null)));
|
16
17
|
}
|
package/dist/Table/Table.js
CHANGED
@@ -222,10 +222,11 @@ export default function Table(_ref3) {
|
|
222
222
|
isFlex: !scroll
|
223
223
|
}), /*#__PURE__*/React.createElement(TableBody, {
|
224
224
|
direction: "column"
|
225
|
-
}, formatedDataSource.map(function (rowData) {
|
225
|
+
}, formatedDataSource.map(function (rowData, index) {
|
226
226
|
return /*#__PURE__*/React.createElement(TableBodyRow, {
|
227
227
|
key: rowData[rowKey]
|
228
228
|
}, /*#__PURE__*/React.createElement(Columns, {
|
229
|
+
rowIndex: index,
|
229
230
|
rowData: rowData,
|
230
231
|
columns: columns,
|
231
232
|
isFlex: !scroll
|
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.11",
|
4
4
|
"description": "A react library developed with dumi",
|
5
5
|
"module": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -74,10 +74,10 @@
|
|
74
74
|
"react-dom": "^18.0.0",
|
75
75
|
"stylelint": "^14.9.1"
|
76
76
|
},
|
77
|
-
"gitHead": "
|
77
|
+
"gitHead": "26226dbcd50f2ebc2e61d78e2c0eee99db6f7cc6",
|
78
78
|
"dependencies": {
|
79
79
|
"@ant-design/icons": "^5.3.7",
|
80
|
-
"@kep-platform/hooks": "^0.0.
|
80
|
+
"@kep-platform/hooks": "^0.0.11",
|
81
81
|
"color": "^4.2.3",
|
82
82
|
"rc-pagination": "^4.1.0",
|
83
83
|
"styled-components": "^6.1.11"
|