@lemon-fe/components 0.1.55 → 0.1.60
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/es/BaseTable/index.js +4 -1
- package/es/BaseTable/index.less +8 -5
- package/es/Filter/index.js +2 -2
- package/es/FormLayout/index.less +12 -4
- package/es/Table/index.js +2 -2
- package/package.json +3 -4
package/es/BaseTable/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _excluded = ["onWidthChange", "width", "fullTableRef", "children", "className"],
|
|
2
|
-
_excluded2 = ["id", "columns", "defaultColumnProps", "rowKey", "children", "summaryTitle", "summaryRecord", "dataSource", "onSortChange", "sort", "scroll", "virtual", "components", "pagination", "rowHeight", "tableLayout", "rowActions", "style", "locale"];
|
|
2
|
+
_excluded2 = ["id", "columns", "defaultColumnProps", "rowKey", "children", "summaryTitle", "summaryRecord", "dataSource", "onSortChange", "sort", "scroll", "virtual", "components", "pagination", "rowHeight", "tableLayout", "rowActions", "style", "className", "locale"];
|
|
3
3
|
|
|
4
4
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
5
|
|
|
@@ -36,6 +36,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
36
36
|
/// <reference path="../../typings.d.ts" />
|
|
37
37
|
import React, { useMemo, useState, useEffect, useRef } from 'react';
|
|
38
38
|
import { Table as AntdTable } from 'antd';
|
|
39
|
+
import classNames from 'classnames';
|
|
39
40
|
import { get } from 'lodash';
|
|
40
41
|
import ResizeObserver from 'rc-resize-observer';
|
|
41
42
|
import { isColumnType, getColumnKey } from './utils';
|
|
@@ -121,6 +122,7 @@ function BaseTable(props) {
|
|
|
121
122
|
tableLayout = _props$tableLayout === void 0 ? 'fixed' : _props$tableLayout,
|
|
122
123
|
rowActions = props.rowActions,
|
|
123
124
|
style = props.style,
|
|
125
|
+
className = props.className,
|
|
124
126
|
localeProp = props.locale,
|
|
125
127
|
restProps = _objectWithoutProperties(props, _excluded2);
|
|
126
128
|
|
|
@@ -412,6 +414,7 @@ function BaseTable(props) {
|
|
|
412
414
|
var tableNode = /*#__PURE__*/React.createElement(AntdTable, _objectSpread(_objectSpread({
|
|
413
415
|
size: "small",
|
|
414
416
|
ref: fullTableRef,
|
|
417
|
+
className: classNames("".concat(PREFIX_CLS, "-table"), className),
|
|
415
418
|
columns: formatedColumns,
|
|
416
419
|
dataSource: dataSource,
|
|
417
420
|
rowKey: rowKey,
|
package/es/BaseTable/index.less
CHANGED
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
@resize-indicator-color: #333;
|
|
4
4
|
|
|
5
5
|
.@{tablePrefixCls} {
|
|
6
|
-
position: relative;
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
color: @text-color;
|
|
9
|
-
font-size: @font-size-base;
|
|
10
|
-
|
|
11
6
|
.ant-table-cell-row-hover &-operator {
|
|
12
7
|
display: flex;
|
|
13
8
|
}
|
|
14
9
|
|
|
10
|
+
td .ant-input-number-input {
|
|
11
|
+
text-align: inherit;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
td .ant-input-number-handler-wrap {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
15
18
|
&-operator {
|
|
16
19
|
position: absolute;
|
|
17
20
|
top: 0;
|
package/es/Filter/index.js
CHANGED
|
@@ -412,13 +412,13 @@ function Filter(props) {
|
|
|
412
412
|
rows.push([]);
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
var visible = rows.length >
|
|
415
|
+
var visible = rows.length > 1;
|
|
416
416
|
|
|
417
417
|
if (!collapsed || !visible) {
|
|
418
418
|
return [result, visible];
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
return [
|
|
421
|
+
return [rows[0], visible];
|
|
422
422
|
}, [data, width, collapsed, simple, activeKeys]),
|
|
423
423
|
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
424
424
|
cols = _useMemo2[0],
|
package/es/FormLayout/index.less
CHANGED
|
@@ -16,17 +16,19 @@
|
|
|
16
16
|
flex-wrap: wrap;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.col(@colSpan:
|
|
19
|
+
.col(@colSpan: 6) {
|
|
20
20
|
flex-shrink: 0;
|
|
21
21
|
flex-wrap: nowrap;
|
|
22
22
|
width: percentage((@colSpan / 24));
|
|
23
|
-
min-width:
|
|
24
|
-
max-width: if((@colSpan >= 12), 2 * @maxWidth, @maxWidth);
|
|
23
|
+
min-width: (@colSpan / 6) * @minWidth;
|
|
25
24
|
padding: 0 (@spaceX / 2);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
.@{prefixCls}-form {
|
|
29
28
|
&-layout {
|
|
29
|
+
min-width: @minWidth - @spaceX;
|
|
30
|
+
max-width: 4 * @maxWidth - @spaceX;
|
|
31
|
+
|
|
30
32
|
.ant-form-item {
|
|
31
33
|
flex-wrap: nowrap;
|
|
32
34
|
margin-bottom: @spaceY;
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
.wrapper();
|
|
64
66
|
|
|
65
67
|
& > .ant-form-item {
|
|
66
|
-
.col();
|
|
68
|
+
.col(8);
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -93,3 +95,9 @@
|
|
|
93
95
|
max-width: 100%;
|
|
94
96
|
}
|
|
95
97
|
}
|
|
98
|
+
|
|
99
|
+
@media (max-width: 575px) {
|
|
100
|
+
.@{prefixCls}-form-layout .ant-form-item {
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
}
|
|
103
|
+
}
|
package/es/Table/index.js
CHANGED
|
@@ -227,10 +227,10 @@ export default function Table(props) {
|
|
|
227
227
|
src: empty
|
|
228
228
|
}), /*#__PURE__*/React.createElement("div", null, remote.error.message))
|
|
229
229
|
} : undefined,
|
|
230
|
-
pagination: {
|
|
230
|
+
pagination: _objectSpread({
|
|
231
231
|
current: current,
|
|
232
232
|
pageSize: pageSize,
|
|
233
233
|
total: total
|
|
234
|
-
}
|
|
234
|
+
}, pagination)
|
|
235
235
|
}, restProps));
|
|
236
236
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.60",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "鲁盛杰 <lusj@cnlemon.net>",
|
|
6
6
|
"homepage": "",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"registry": "https://registry.npmjs.org"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@lemon-fe/hooks": "^0.1.
|
|
19
|
+
"@lemon-fe/hooks": "^0.1.56",
|
|
20
20
|
"classnames": "^2.2.6",
|
|
21
21
|
"lodash": "^4.17.21",
|
|
22
22
|
"react-resizable": "^3.0.4"
|
|
@@ -40,6 +40,5 @@
|
|
|
40
40
|
"rc-resize-observer": "^1.2.0",
|
|
41
41
|
"react": "^17.0.2",
|
|
42
42
|
"react-dom": "^17.0.2"
|
|
43
|
-
}
|
|
44
|
-
"gitHead": "26cf3c526e121d460bee164784fdd9a16a5b5cdc"
|
|
43
|
+
}
|
|
45
44
|
}
|