@lemon-fe/components 0.1.0-alpha.0 → 0.1.3
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/Actions/index.js +21 -13
- package/es/Actions/index.less +25 -25
- package/es/BaseTable/Actions.d.ts +8 -0
- package/es/BaseTable/Actions.js +129 -0
- package/es/BaseTable/empty.png +0 -0
- package/es/BaseTable/index.d.ts +1 -0
- package/es/BaseTable/index.js +31 -30
- package/es/BaseTable/index.less +69 -2
- package/es/BaseTable/typings.d.ts +8 -4
- package/es/DurationPicker/index.js +2 -10
- package/es/DurationPicker/index.less +4 -4
- package/es/Filter/index.js +4 -7
- package/es/Filter/index.less +1 -0
- package/es/FormLayout/index.less +2 -1
- package/es/Icons/BigTip/error.png +0 -0
- package/es/Icons/BigTip/index.d.ts +6 -0
- package/es/Icons/BigTip/index.js +50 -0
- package/es/Icons/BigTip/info.png +0 -0
- package/es/Icons/BigTip/success.png +0 -0
- package/es/Icons/BigTip/warning.png +0 -0
- package/es/Icons/Calendar.d.ts +5 -0
- package/es/Icons/Calendar.js +47 -0
- package/es/Icons/Down.js +0 -1
- package/es/Icons/More.d.ts +5 -0
- package/es/Icons/More.js +44 -0
- package/es/Icons/index.d.ts +6 -0
- package/es/Icons/index.js +7 -1
- package/es/Layout/index.less +0 -4
- package/es/MainFramework/components/{DownBar → DropMenu}/index.d.ts +1 -1
- package/es/MainFramework/components/DropMenu/index.js +104 -0
- package/es/MainFramework/components/DropMenu/index.less +59 -0
- package/es/MainFramework/components/Menu/index.js +4 -8
- package/es/MainFramework/components/Menu/index.less +3 -3
- package/es/MainFramework/components/RefreshButton/index.d.ts +5 -0
- package/es/MainFramework/components/RefreshButton/index.js +72 -0
- package/es/MainFramework/components/RefreshButton/index.less +30 -0
- package/es/MainFramework/components/TabBar/index.js +64 -3
- package/es/MainFramework/components/TabBar/index.less +14 -0
- package/es/MainFramework/index.d.ts +3 -0
- package/es/MainFramework/index.js +12 -57
- package/es/MainFramework/index.less +10 -3
- package/es/SiderTree/empty.png +0 -0
- package/es/SiderTree/index.js +7 -4
- package/es/SiderTree/index.less +32 -4
- package/es/SymbolIcon/index.d.ts +8 -0
- package/es/SymbolIcon/index.js +32 -0
- package/es/SymbolIcon/index.less +7 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/index.less +3 -123
- package/es/init.js +13 -18
- package/es/overrides.less +131 -0
- package/es/theme.less +1 -8
- package/es/utils.less +53 -0
- package/package.json +4 -4
- package/es/MainFramework/components/DownBar/index.js +0 -84
- package/es/MainFramework/components/DownBar/index.less +0 -108
package/es/Actions/index.js
CHANGED
|
@@ -24,9 +24,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
24
24
|
|
|
25
25
|
import React, { Fragment, useState } from 'react';
|
|
26
26
|
import { Space, Dropdown, Menu, Button, Popover } from 'antd';
|
|
27
|
-
import { EllipsisOutlined } from '@ant-design/icons';
|
|
28
27
|
import classNames from 'classnames';
|
|
29
|
-
import
|
|
28
|
+
import Icons from '../Icons';
|
|
30
29
|
import { PREFIX_CLS } from '../constants';
|
|
31
30
|
|
|
32
31
|
function Actions(props) {
|
|
@@ -97,7 +96,15 @@ function Actions(props) {
|
|
|
97
96
|
disabled: disabled,
|
|
98
97
|
overlay: overlay,
|
|
99
98
|
onClick: handleClick,
|
|
100
|
-
|
|
99
|
+
buttonsRender: function buttonsRender(_ref) {
|
|
100
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
101
|
+
leftBtn = _ref2[0],
|
|
102
|
+
_ = _ref2[1];
|
|
103
|
+
|
|
104
|
+
return [leftBtn, /*#__PURE__*/React.createElement(Button, {
|
|
105
|
+
icon: /*#__PURE__*/React.createElement(Icons.More, null)
|
|
106
|
+
})];
|
|
107
|
+
}
|
|
101
108
|
}, text);
|
|
102
109
|
}
|
|
103
110
|
|
|
@@ -108,7 +115,12 @@ function Actions(props) {
|
|
|
108
115
|
}, /*#__PURE__*/React.createElement(Button, _objectSpread({
|
|
109
116
|
disabled: disabled,
|
|
110
117
|
icon: icon
|
|
111
|
-
}, rest), text, /*#__PURE__*/React.createElement(Down,
|
|
118
|
+
}, rest), text, /*#__PURE__*/React.createElement(Icons.Down, {
|
|
119
|
+
style: {
|
|
120
|
+
opacity: 0.7,
|
|
121
|
+
fontSize: 16
|
|
122
|
+
}
|
|
123
|
+
})));
|
|
112
124
|
}
|
|
113
125
|
|
|
114
126
|
return /*#__PURE__*/React.createElement(Button, _objectSpread({
|
|
@@ -123,11 +135,7 @@ function Actions(props) {
|
|
|
123
135
|
onVisibleChange: setVisible,
|
|
124
136
|
visible: visible,
|
|
125
137
|
trigger: "click",
|
|
126
|
-
content:
|
|
127
|
-
className: "".concat(prefixCls, "-actions-popover-list")
|
|
128
|
-
}, collapsedBtns.map(function (item, index) {
|
|
129
|
-
var _classNames;
|
|
130
|
-
|
|
138
|
+
content: collapsedBtns.map(function (item, index) {
|
|
131
139
|
if (item === null) {
|
|
132
140
|
return item;
|
|
133
141
|
}
|
|
@@ -139,8 +147,8 @@ function Actions(props) {
|
|
|
139
147
|
}
|
|
140
148
|
|
|
141
149
|
var disabled = item.disabled;
|
|
142
|
-
return /*#__PURE__*/React.createElement("
|
|
143
|
-
className: classNames(
|
|
150
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: classNames("".concat(prefixCls, "-actions-popover-item"), _defineProperty({}, "".concat(prefixCls, "-actions-popover-item-disabled"), disabled)),
|
|
144
152
|
key: index,
|
|
145
153
|
onClick: function onClick() {
|
|
146
154
|
if (!disabled) {
|
|
@@ -153,9 +161,9 @@ function Actions(props) {
|
|
|
153
161
|
}
|
|
154
162
|
}
|
|
155
163
|
}, item.text);
|
|
156
|
-
})
|
|
164
|
+
})
|
|
157
165
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
158
|
-
icon: /*#__PURE__*/React.createElement(
|
|
166
|
+
icon: /*#__PURE__*/React.createElement(Icons.More, null)
|
|
159
167
|
})) : null));
|
|
160
168
|
}
|
|
161
169
|
|
package/es/Actions/index.less
CHANGED
|
@@ -6,11 +6,16 @@
|
|
|
6
6
|
padding-top: 0;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
.ant-popover-inner {
|
|
10
|
+
padding: 8px 0;
|
|
11
|
+
border-radius: 8px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ant-popover-inner-content {
|
|
10
15
|
padding: 0;
|
|
11
16
|
}
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
.ant-popover-arrow {
|
|
14
19
|
display: none;
|
|
15
20
|
}
|
|
16
21
|
|
|
@@ -21,31 +26,22 @@
|
|
|
21
26
|
|
|
22
27
|
&-item {
|
|
23
28
|
box-sizing: border-box;
|
|
24
|
-
width:
|
|
29
|
+
width: 120px;
|
|
25
30
|
height: 38px;
|
|
26
|
-
padding:
|
|
27
|
-
color: #
|
|
28
|
-
line-height:
|
|
29
|
-
text-align: left;
|
|
31
|
+
padding: 0 16px;
|
|
32
|
+
color: #333;
|
|
33
|
+
line-height: 38px;
|
|
30
34
|
list-style: none;
|
|
31
|
-
border-radius: 2px;
|
|
32
35
|
cursor: pointer;
|
|
36
|
+
transition: background-color 0.2s;
|
|
33
37
|
|
|
34
38
|
&:hover {
|
|
35
|
-
color:
|
|
36
|
-
background: .primary(0.08) [];
|
|
39
|
+
background-color: #eee;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
&-disabled {
|
|
40
|
-
box-sizing: border-box;
|
|
41
|
-
width: 124px;
|
|
42
|
-
height: 38px;
|
|
43
|
-
padding: 8px;
|
|
44
43
|
color: rgba(0, 0, 0, 0.25);
|
|
45
|
-
|
|
46
|
-
text-align: left;
|
|
47
|
-
list-style: none;
|
|
48
|
-
border-radius: 2px;
|
|
44
|
+
background-color: #fff !important;
|
|
49
45
|
cursor: not-allowed;
|
|
50
46
|
}
|
|
51
47
|
}
|
|
@@ -54,17 +50,21 @@
|
|
|
54
50
|
.ant-btn:not(.ant-btn-icon-only) {
|
|
55
51
|
min-width: 80px;
|
|
56
52
|
padding: 4px 12px;
|
|
57
|
-
}
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
.@{prefixCls}-symbol-icon {
|
|
55
|
+
margin-right: 8px;
|
|
56
|
+
font-size: 20px;
|
|
57
|
+
vertical-align: -5px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
.ant-btn-default {
|
|
62
|
+
.@{prefixCls}-symbol-icon {
|
|
63
|
+
opacity: 0.7;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
&:
|
|
67
|
-
color:
|
|
66
|
+
&:not(:disabled) {
|
|
67
|
+
background-color: #fff;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
import React, { useRef, useState } from 'react';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
import { createPortal } from 'react-dom';
|
|
18
|
+
import { PREFIX_CLS } from '../constants';
|
|
19
|
+
import Icons from '../Icons';
|
|
20
|
+
export default function Actions(props) {
|
|
21
|
+
var actions = props.actions,
|
|
22
|
+
row = props.row,
|
|
23
|
+
index = props.index;
|
|
24
|
+
|
|
25
|
+
var _useState = useState(null),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
pop = _useState2[0],
|
|
28
|
+
setPop = _useState2[1];
|
|
29
|
+
|
|
30
|
+
var _useState3 = useState(false),
|
|
31
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
32
|
+
visible = _useState4[0],
|
|
33
|
+
setVisible = _useState4[1];
|
|
34
|
+
|
|
35
|
+
var prefixCls = "".concat(PREFIX_CLS, "-table-operator");
|
|
36
|
+
var ref = useRef(null);
|
|
37
|
+
|
|
38
|
+
var openPop = function openPop(data) {
|
|
39
|
+
setPop(data);
|
|
40
|
+
setTimeout(function () {
|
|
41
|
+
setVisible(true);
|
|
42
|
+
}, 16);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var closePop = function closePop() {
|
|
46
|
+
if (visible === false) {
|
|
47
|
+
setPop(null);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (ref.current !== null) {
|
|
52
|
+
var node = ref.current;
|
|
53
|
+
setVisible(false);
|
|
54
|
+
|
|
55
|
+
var handler = function handler() {
|
|
56
|
+
node.removeEventListener('transitionend', handler);
|
|
57
|
+
setPop(null);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
node.addEventListener('transitionend', handler);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: prefixCls,
|
|
66
|
+
onMouseLeave: closePop
|
|
67
|
+
}, actions.map(function (item) {
|
|
68
|
+
if (item === null) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var key = item.text;
|
|
73
|
+
var dropDown = item.dropDown ? item.dropDown.filter(function (item) {
|
|
74
|
+
return item !== null;
|
|
75
|
+
}) : [];
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: classNames("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-disabled"), item.disabled)),
|
|
78
|
+
key: item.text,
|
|
79
|
+
onMouseEnter: function onMouseEnter() {
|
|
80
|
+
if (pop !== null && pop.key !== key) {
|
|
81
|
+
closePop();
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
onClick: function onClick(e) {
|
|
85
|
+
if (item.disabled) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (dropDown.length > 0) {
|
|
90
|
+
var rect = e.target.getBoundingClientRect();
|
|
91
|
+
openPop({
|
|
92
|
+
key: key,
|
|
93
|
+
top: rect.top + rect.height,
|
|
94
|
+
right: document.body.clientWidth - rect.right,
|
|
95
|
+
items: dropDown
|
|
96
|
+
});
|
|
97
|
+
} else {
|
|
98
|
+
var _item$onClick;
|
|
99
|
+
|
|
100
|
+
(_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, row, index);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}, item.text, dropDown.length > 0 && /*#__PURE__*/React.createElement(Icons.Down, null));
|
|
104
|
+
}), pop !== null && /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: "".concat(prefixCls, "-popover"),
|
|
106
|
+
style: {
|
|
107
|
+
top: pop.top,
|
|
108
|
+
right: pop.right
|
|
109
|
+
}
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
ref: ref,
|
|
112
|
+
className: classNames("".concat(prefixCls, "-popover-items"), {
|
|
113
|
+
animated: visible
|
|
114
|
+
})
|
|
115
|
+
}, pop.items.map(function (item) {
|
|
116
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: classNames("".concat(prefixCls, "-popover-item"), _defineProperty({}, "".concat(prefixCls, "-popover-item-disabled"), item.disabled)),
|
|
118
|
+
key: item.text,
|
|
119
|
+
onClick: function onClick() {
|
|
120
|
+
if (!item.disabled) {
|
|
121
|
+
var _item$onClick2;
|
|
122
|
+
|
|
123
|
+
closePop();
|
|
124
|
+
(_item$onClick2 = item.onClick) === null || _item$onClick2 === void 0 ? void 0 : _item$onClick2.call(item, row, index);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, item.text);
|
|
128
|
+
}))), document.body));
|
|
129
|
+
}
|
|
Binary file
|
package/es/BaseTable/index.d.ts
CHANGED
package/es/BaseTable/index.js
CHANGED
|
@@ -33,6 +33,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
33
33
|
|
|
34
34
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
35
|
|
|
36
|
+
/// <reference path="../../typings.d.ts" />
|
|
36
37
|
import React, { useMemo, useState, useEffect, useRef } from 'react';
|
|
37
38
|
import { Table as AntdTable } from 'antd';
|
|
38
39
|
import { get } from 'lodash';
|
|
@@ -42,6 +43,8 @@ import ResizeHeaderCell from './ResizeHeaderCell';
|
|
|
42
43
|
import { PREFIX_CLS } from '../constants';
|
|
43
44
|
import VirtualList from './VirtualBody';
|
|
44
45
|
import BaseTableContext from './BaseTableContext';
|
|
46
|
+
import Actions from './Actions';
|
|
47
|
+
import empty from './empty.png';
|
|
45
48
|
|
|
46
49
|
function formatSummary(summary) {
|
|
47
50
|
if (!summary) {
|
|
@@ -114,11 +117,9 @@ function BaseTable(props) {
|
|
|
114
117
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
115
118
|
colsState = _useState4[0],
|
|
116
119
|
setColsState = _useState4[1];
|
|
117
|
-
|
|
118
|
-
var actions = useRef(rowActions);
|
|
119
|
-
actions.current = rowActions;
|
|
120
120
|
/** auto scroll y */
|
|
121
121
|
|
|
122
|
+
|
|
122
123
|
var calcScrollY = function calcScrollY() {
|
|
123
124
|
var wrapper = fullTableRef.current;
|
|
124
125
|
|
|
@@ -306,34 +307,27 @@ function BaseTable(props) {
|
|
|
306
307
|
/** row actions */
|
|
307
308
|
|
|
308
309
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}));
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
formatedColumns.push(actionCol);
|
|
332
|
-
flattenColumns.push(actionCol);
|
|
333
|
-
}
|
|
310
|
+
useMemo(function () {
|
|
311
|
+
if (rowActions !== undefined && rowActions.length > 0) {
|
|
312
|
+
var actionCol = {
|
|
313
|
+
title: '',
|
|
314
|
+
className: "".concat(PREFIX_CLS, "-table-operator-column"),
|
|
315
|
+
width: 1,
|
|
316
|
+
fixed: 'right',
|
|
317
|
+
render: function render(_, row, index) {
|
|
318
|
+
return /*#__PURE__*/React.createElement(Actions, {
|
|
319
|
+
actions: rowActions,
|
|
320
|
+
row: row,
|
|
321
|
+
index: index
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
formatedColumns.push(actionCol);
|
|
326
|
+
flattenColumns.push(actionCol);
|
|
327
|
+
}
|
|
328
|
+
}, [rowActions, flattenColumns, formatedColumns]);
|
|
334
329
|
/** virtualize scroll */
|
|
335
330
|
|
|
336
|
-
|
|
337
331
|
var _useMemo3 = useMemo(function () {
|
|
338
332
|
return {
|
|
339
333
|
components: _objectSpread({
|
|
@@ -404,7 +398,14 @@ function BaseTable(props) {
|
|
|
404
398
|
},
|
|
405
399
|
components: components,
|
|
406
400
|
onChange: handleChange,
|
|
407
|
-
tableLayout: tableLayout
|
|
401
|
+
tableLayout: tableLayout,
|
|
402
|
+
locale: {
|
|
403
|
+
emptyText: /*#__PURE__*/React.createElement("div", {
|
|
404
|
+
className: "".concat(PREFIX_CLS, "-table-empty")
|
|
405
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
406
|
+
src: empty
|
|
407
|
+
}), /*#__PURE__*/React.createElement("div", null, "\u6682\u65E0\u6570\u636E"))
|
|
408
|
+
}
|
|
408
409
|
}, restProps), {}, {
|
|
409
410
|
pagination: paginationProp !== false ? _objectSpread({
|
|
410
411
|
size: 'small',
|
package/es/BaseTable/index.less
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
color: @text-color;
|
|
50
50
|
font-size: @font-size-base;
|
|
51
51
|
|
|
52
|
-
.ant-table-
|
|
52
|
+
.ant-table-cell-row-hover &-operator {
|
|
53
53
|
display: flex;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -62,9 +62,20 @@
|
|
|
62
62
|
align-items: center;
|
|
63
63
|
justify-content: flex-end;
|
|
64
64
|
height: 100%;
|
|
65
|
-
padding:
|
|
65
|
+
padding-left: 16px;
|
|
66
66
|
white-space: nowrap;
|
|
67
67
|
background-color: @table-row-hover-bg;
|
|
68
|
+
background-clip: content-box;
|
|
69
|
+
|
|
70
|
+
&::before {
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: 0;
|
|
73
|
+
left: 0;
|
|
74
|
+
width: 16px;
|
|
75
|
+
height: 100%;
|
|
76
|
+
background: linear-gradient(90deg, rgba(248, 248, 248, 0) 0%, @table-row-hover-bg 100%);
|
|
77
|
+
content: '';
|
|
78
|
+
}
|
|
68
79
|
|
|
69
80
|
&-column::after {
|
|
70
81
|
display: none !important;
|
|
@@ -80,6 +91,7 @@
|
|
|
80
91
|
border-radius: 4px;
|
|
81
92
|
outline: none;
|
|
82
93
|
cursor: pointer;
|
|
94
|
+
transition: background-color 0.2s;
|
|
83
95
|
user-select: none;
|
|
84
96
|
|
|
85
97
|
&:hover {
|
|
@@ -89,6 +101,50 @@
|
|
|
89
101
|
&:active {
|
|
90
102
|
color: .primary(0.8) [];
|
|
91
103
|
}
|
|
104
|
+
|
|
105
|
+
&-disabled {
|
|
106
|
+
color: rgba(51, 51, 51, 0.5) !important;
|
|
107
|
+
cursor: not-allowed;
|
|
108
|
+
|
|
109
|
+
&:hover {
|
|
110
|
+
background-color: rgba(51, 51, 51, 0.06);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&-popover {
|
|
116
|
+
position: absolute;
|
|
117
|
+
z-index: 1000;
|
|
118
|
+
width: 120px;
|
|
119
|
+
|
|
120
|
+
&-items {
|
|
121
|
+
transform: scale(0.6);
|
|
122
|
+
transform-origin: 100% 0;
|
|
123
|
+
opacity: 0;
|
|
124
|
+
transition: transform 0.2s, opacity 0.2s;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
|
|
127
|
+
.popoverInner();
|
|
128
|
+
|
|
129
|
+
&.animated {
|
|
130
|
+
transform: scale(1);
|
|
131
|
+
opacity: 1;
|
|
132
|
+
pointer-events: visible;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&-item {
|
|
137
|
+
text-align: left;
|
|
138
|
+
background-color: #fff;
|
|
139
|
+
border: none;
|
|
140
|
+
outline: none;
|
|
141
|
+
.popoverItem();
|
|
142
|
+
|
|
143
|
+
&-disabled {
|
|
144
|
+
color: rgba(51, 51, 51, 0.5);
|
|
145
|
+
cursor: not-allowed;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
92
148
|
}
|
|
93
149
|
}
|
|
94
150
|
|
|
@@ -141,4 +197,15 @@
|
|
|
141
197
|
font-size: 12px;
|
|
142
198
|
}
|
|
143
199
|
}
|
|
200
|
+
|
|
201
|
+
&-empty {
|
|
202
|
+
display: inline-block;
|
|
203
|
+
text-align: center;
|
|
204
|
+
|
|
205
|
+
& > img {
|
|
206
|
+
display: block;
|
|
207
|
+
width: 120px;
|
|
208
|
+
height: 120px;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
144
211
|
}
|
|
@@ -7,6 +7,13 @@ export type ColumnGroupType<T> = TableColumnGroupType<T>;
|
|
|
7
7
|
|
|
8
8
|
export type ColumnsType<T> = TableColumnsType<T>;
|
|
9
9
|
|
|
10
|
+
export interface RowAction<T> {
|
|
11
|
+
text: string;
|
|
12
|
+
onClick?: (row: T, index: number) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
dropDown?: (RowAction<T> | null)[];
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
export interface BaseTableProps<T> extends Omit<TableProps<T>, 'columns' | 'scroll'> {
|
|
11
18
|
defaultColumnProps?: Partial<ColumnType<T>>;
|
|
12
19
|
/**
|
|
@@ -32,8 +39,5 @@ export interface BaseTableProps<T> extends Omit<TableProps<T>, 'columns' | 'scro
|
|
|
32
39
|
/**
|
|
33
40
|
* @description 行操作按钮组
|
|
34
41
|
*/
|
|
35
|
-
rowActions?:
|
|
36
|
-
title: string;
|
|
37
|
-
onClick: (row: T, index: number) => void;
|
|
38
|
-
}[];
|
|
42
|
+
rowActions?: (RowAction<T> | null)[];
|
|
39
43
|
}
|
|
@@ -205,11 +205,7 @@ export default function DurationPicker(props) {
|
|
|
205
205
|
}))
|
|
206
206
|
}, /*#__PURE__*/React.createElement("div", {
|
|
207
207
|
className: "".concat(prefixCls, "-duration-type")
|
|
208
|
-
}, (_result$type = result.type) === null || _result$type === void 0 ? void 0 : _result$type.label, /*#__PURE__*/React.createElement(Down, {
|
|
209
|
-
style: {
|
|
210
|
-
color: '#BFBFBF'
|
|
211
|
-
}
|
|
212
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
208
|
+
}, (_result$type = result.type) === null || _result$type === void 0 ? void 0 : _result$type.label, /*#__PURE__*/React.createElement(Down, null))), /*#__PURE__*/React.createElement("div", {
|
|
213
209
|
className: "".concat(prefixCls, "-duration-picker")
|
|
214
210
|
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
215
211
|
overlay: /*#__PURE__*/React.createElement(Menu, null, options.map(function (item) {
|
|
@@ -222,11 +218,7 @@ export default function DurationPicker(props) {
|
|
|
222
218
|
}))
|
|
223
219
|
}, /*#__PURE__*/React.createElement("div", {
|
|
224
220
|
className: "".concat(prefixCls, "-duration-option")
|
|
225
|
-
}, (_result$option = result.option) === null || _result$option === void 0 ? void 0 : _result$option.label, /*#__PURE__*/React.createElement(Down, {
|
|
226
|
-
style: {
|
|
227
|
-
color: '#BFBFBF'
|
|
228
|
-
}
|
|
229
|
-
}))), /*#__PURE__*/React.createElement(DatePicker.RangePicker, {
|
|
221
|
+
}, (_result$option = result.option) === null || _result$option === void 0 ? void 0 : _result$option.label, /*#__PURE__*/React.createElement(Down, null))), /*#__PURE__*/React.createElement(DatePicker.RangePicker, {
|
|
230
222
|
value: result.dates,
|
|
231
223
|
onChange: handleChangeDates,
|
|
232
224
|
disabled: ((_result$option2 = result.option) === null || _result$option2 === void 0 ? void 0 : _result$option2.value) !== null
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
align-items: center;
|
|
11
11
|
justify-content: space-between;
|
|
12
12
|
height: 100%;
|
|
13
|
-
padding: 0
|
|
14
|
-
color:
|
|
13
|
+
padding: 0 8px;
|
|
14
|
+
color: rgba(51, 51, 51, 0.7);
|
|
15
15
|
font-size: 14px;
|
|
16
16
|
text-align: center;
|
|
17
17
|
cursor: pointer;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&-type.ant-dropdown-trigger {
|
|
26
|
-
flex: 0 0
|
|
26
|
+
flex: 0 0 124px;
|
|
27
27
|
margin-right: 8px;
|
|
28
28
|
border: 1px solid @select-border-color;
|
|
29
29
|
border-radius: @border-radius-base;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
&-option.ant-dropdown-trigger {
|
|
33
33
|
position: relative;
|
|
34
|
-
flex: 0 0
|
|
34
|
+
flex: 0 0 110px;
|
|
35
35
|
|
|
36
36
|
&::after {
|
|
37
37
|
position: absolute;
|
package/es/Filter/index.js
CHANGED
|
@@ -30,9 +30,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
30
30
|
|
|
31
31
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
32
32
|
import { Button, Checkbox, Form, Input, Popover, Space, Dropdown, Menu, Modal, message, Select, Empty, InputNumber } from 'antd';
|
|
33
|
-
import { EllipsisOutlined } from '@ant-design/icons';
|
|
34
33
|
import { useDebounce, useRequest } from '@lemon-fe/hooks';
|
|
35
|
-
import
|
|
34
|
+
import Icons from '../Icons';
|
|
36
35
|
import DurationPicker from '../DurationPicker';
|
|
37
36
|
import FormLayout from '../FormLayout';
|
|
38
37
|
import { PREFIX_CLS } from '../constants';
|
|
@@ -431,10 +430,8 @@ function Filter(props) {
|
|
|
431
430
|
onClick: handleDelete
|
|
432
431
|
}, "\u5220\u9664\u65B9\u6848"))
|
|
433
432
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
}, /*#__PURE__*/React.createElement(EllipsisOutlined, null))), /*#__PURE__*/React.createElement(Popover, {
|
|
433
|
+
icon: /*#__PURE__*/React.createElement(Icons.More, null)
|
|
434
|
+
})), /*#__PURE__*/React.createElement(Popover, {
|
|
438
435
|
trigger: "click",
|
|
439
436
|
overlayClassName: "".concat(prefixCls, "-filter-popover"),
|
|
440
437
|
destroyTooltipOnHide: true,
|
|
@@ -442,7 +439,7 @@ function Filter(props) {
|
|
|
442
439
|
placeholder: "\u641C\u7D22\u9009\u9879",
|
|
443
440
|
allowClear: true,
|
|
444
441
|
className: "".concat(prefixCls, "-filter-items-search"),
|
|
445
|
-
suffix: /*#__PURE__*/React.createElement(Search, {
|
|
442
|
+
suffix: /*#__PURE__*/React.createElement(Icons.Search, {
|
|
446
443
|
style: {
|
|
447
444
|
color: '#686868'
|
|
448
445
|
}
|
package/es/Filter/index.less
CHANGED
package/es/FormLayout/index.less
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
.col(@colSpan: 8) {
|
|
19
19
|
flex-shrink: 0;
|
|
20
|
+
flex-wrap: nowrap;
|
|
20
21
|
width: percentage((@colSpan / 24));
|
|
21
22
|
min-width: if((@colSpan >= 12), 2 * @minWidth, @minWidth);
|
|
22
23
|
padding: 0 (@spaceX / 2);
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
&-label > label::after {
|
|
38
|
-
margin: 0
|
|
39
|
+
margin: 0 8px 0 0;
|
|
39
40
|
content: '';
|
|
40
41
|
}
|
|
41
42
|
|
|
Binary file
|