@lemon-fe/components 0.0.32 → 0.1.0
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.d.ts +3 -2
- package/es/Actions/index.js +29 -28
- package/es/Actions/index.less +26 -51
- package/es/BaseTable/Actions.d.ts +8 -0
- package/es/BaseTable/Actions.js +119 -0
- package/es/BaseTable/ResizeHeaderCell.js +16 -5
- package/es/BaseTable/index.js +63 -19
- package/es/BaseTable/index.less +99 -0
- package/es/BaseTable/typings.d.ts +11 -0
- package/es/DurationPicker/index.js +2 -10
- package/es/DurationPicker/index.less +4 -4
- package/es/Filter/index.js +100 -41
- package/es/Filter/index.less +11 -7
- package/es/Filter/typings.d.ts +3 -2
- package/es/FormLayout/index.less +1 -1
- package/es/Icons/Calendar.d.ts +5 -0
- package/es/Icons/Calendar.js +47 -0
- package/es/Icons/Down.js +10 -5
- package/es/Icons/More.d.ts +5 -0
- package/es/Icons/More.js +44 -0
- package/es/Icons/Search.js +8 -12
- package/es/Icons/index.d.ts +4 -0
- package/es/Icons/index.js +5 -1
- package/es/Layout/index.js +80 -3
- package/es/Layout/index.less +69 -25
- package/es/MainFramework/components/DropMenu/index.less +2 -32
- package/es/MainFramework/components/Menu/index.less +2 -2
- package/es/MainFramework/components/RefreshButton/index.less +2 -32
- package/es/Portal/index.d.ts +12 -0
- package/es/Portal/index.js +72 -0
- package/es/Section/TabBar.d.ts +12 -0
- package/es/Section/TabBar.js +48 -0
- package/es/Section/index.js +38 -53
- package/es/Section/index.less +44 -91
- package/es/SiderTree/TreeNodeTitle.d.ts +1 -1
- package/es/SiderTree/TreeNodeTitle.js +17 -35
- package/es/SiderTree/index.d.ts +3 -1
- package/es/SiderTree/index.js +40 -64
- package/es/SiderTree/index.less +76 -75
- package/es/SymbolIcon/index.d.ts +8 -0
- package/es/SymbolIcon/index.js +32 -0
- package/es/SymbolIcon/index.less +7 -0
- package/es/TabBar/index.d.ts +14 -0
- package/es/TabBar/index.js +52 -0
- package/es/TabBar/index.less +31 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/index.less +4 -35
- package/es/init.js +15 -16
- package/es/overrides.less +136 -0
- package/es/theme.less +1 -8
- package/es/utils.d.ts +2 -0
- package/es/utils.js +14 -0
- package/es/utils.less +53 -0
- package/package.json +3 -3
- package/es/BaseTable/Sort.d.ts +0 -10
- package/es/BaseTable/Sort.js +0 -122
package/es/utils.less
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* stylelint-disable property-no-unknown */
|
|
2
|
+
|
|
3
|
+
.primary(@alpha: 1) {
|
|
4
|
+
rgb: rgb(var(--lemon-primary-color));
|
|
5
|
+
rgba: rgba(var(--lemon-primary-color), @alpha);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.popoverInner(@width: 120px) {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: @width;
|
|
11
|
+
padding: 8px 0;
|
|
12
|
+
background-color: #fff;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
border-image: linear-gradient(147deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)) 1 1;
|
|
15
|
+
box-shadow: 0 12px 48px 16px rgba(0, 0, 0, 0.03), 0 9px 28px 0 rgba(0, 0, 0, 0.05),
|
|
16
|
+
0 6px 16px -8px rgba(0, 0, 0, 0.08);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.popover(@width: 120px) {
|
|
20
|
+
padding-top: 0 !important;
|
|
21
|
+
|
|
22
|
+
.ant-popover-arrow {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ant-popover-inner {
|
|
27
|
+
.popoverInner(@width);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ant-popover-inner-content {
|
|
31
|
+
padding: 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.popoverItem() {
|
|
36
|
+
position: relative;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 36px;
|
|
39
|
+
padding: 0 16px;
|
|
40
|
+
overflow-x: hidden;
|
|
41
|
+
color: #333;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
line-height: 36px;
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
transition: background-color 0.2s;
|
|
48
|
+
user-select: none;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: #eee;
|
|
52
|
+
}
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
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.0.
|
|
19
|
+
"@lemon-fe/hooks": "^0.0.33",
|
|
20
20
|
"antd": "^4.17.0",
|
|
21
21
|
"classnames": "^2.2.6",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@types/lodash": "^4.14.179",
|
|
40
40
|
"@types/react-resizable": "^1.7.4"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "194106879a74eb16c75e56c3832a2f555627a8ee"
|
|
43
43
|
}
|
package/es/BaseTable/Sort.d.ts
DELETED
package/es/BaseTable/Sort.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
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."); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
|
-
import React, { useState, useEffect, useCallback } from 'react';
|
|
14
|
-
import { debounce } from 'lodash';
|
|
15
|
-
var SortValue;
|
|
16
|
-
|
|
17
|
-
(function (SortValue) {
|
|
18
|
-
SortValue["ASC"] = "asc";
|
|
19
|
-
SortValue["DESC"] = "desc";
|
|
20
|
-
})(SortValue || (SortValue = {}));
|
|
21
|
-
|
|
22
|
-
export default function Sort(props) {
|
|
23
|
-
var value = props.value,
|
|
24
|
-
title = props.title,
|
|
25
|
-
onChange = props.onChange,
|
|
26
|
-
align = props.align,
|
|
27
|
-
index = props.index;
|
|
28
|
-
|
|
29
|
-
var _useState = useState(value),
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
val = _useState2[0],
|
|
32
|
-
setVal = _useState2[1];
|
|
33
|
-
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
setVal(value);
|
|
36
|
-
}, [value]);
|
|
37
|
-
var handleChange = useCallback(debounce(function (result) {
|
|
38
|
-
onChange(result);
|
|
39
|
-
}, 500), [onChange]);
|
|
40
|
-
var node;
|
|
41
|
-
|
|
42
|
-
if (val === SortValue.DESC) {
|
|
43
|
-
node = /*#__PURE__*/React.createElement("svg", {
|
|
44
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
45
|
-
width: "8px",
|
|
46
|
-
height: "10px"
|
|
47
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
48
|
-
fillRule: "evenodd",
|
|
49
|
-
fill: "rgb(6, 57, 133)",
|
|
50
|
-
d: "M3.971,9.785 L-0.000,6.000 L8.000,6.000 L3.971,9.785 Z"
|
|
51
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
52
|
-
fillRule: "evenodd",
|
|
53
|
-
fill: "rgb(153, 153, 153)",
|
|
54
|
-
d: "M4.000,-0.000 L8.000,4.000 L-0.000,4.000 L4.000,-0.000 Z"
|
|
55
|
-
}));
|
|
56
|
-
} else if (val === SortValue.ASC) {
|
|
57
|
-
node = /*#__PURE__*/React.createElement("svg", {
|
|
58
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
-
width: "8px",
|
|
60
|
-
height: "10px"
|
|
61
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
62
|
-
fillRule: "evenodd",
|
|
63
|
-
fill: "rgb(6, 57, 133)",
|
|
64
|
-
d: "M4.029,0.215 L8.000,4.000 L-0.000,4.000 L4.029,0.215 Z"
|
|
65
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
66
|
-
fillRule: "evenodd",
|
|
67
|
-
fill: "rgb(153, 153, 153)",
|
|
68
|
-
d: "M4.000,10.000 L-0.000,6.000 L8.000,6.000 L4.000,10.000 Z"
|
|
69
|
-
}));
|
|
70
|
-
} else {
|
|
71
|
-
node = /*#__PURE__*/React.createElement("svg", {
|
|
72
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
73
|
-
width: "8px",
|
|
74
|
-
height: "10px"
|
|
75
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
76
|
-
fillRule: "evenodd",
|
|
77
|
-
fill: "rgb(153, 153, 153)",
|
|
78
|
-
d: "M4.029,0.215 L8.000,4.000 L-0.000,4.000 L4.029,0.215 ZM4.000,10.000 L0.004,6.008 L8.000,6.000 L4.000,10.000 Z"
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var handleClick = function handleClick() {
|
|
83
|
-
var nextVal;
|
|
84
|
-
|
|
85
|
-
if (val === SortValue.DESC) {
|
|
86
|
-
nextVal = undefined;
|
|
87
|
-
} else if (val === SortValue.ASC) {
|
|
88
|
-
nextVal = SortValue.DESC;
|
|
89
|
-
} else {
|
|
90
|
-
nextVal = SortValue.ASC;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
setVal(nextVal);
|
|
94
|
-
handleChange(nextVal);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
var justify;
|
|
98
|
-
|
|
99
|
-
switch (align) {
|
|
100
|
-
case 'right':
|
|
101
|
-
justify = 'flex-end';
|
|
102
|
-
break;
|
|
103
|
-
|
|
104
|
-
case 'center':
|
|
105
|
-
justify = 'center';
|
|
106
|
-
break;
|
|
107
|
-
|
|
108
|
-
default:
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
112
|
-
className: "lemon-table-sort",
|
|
113
|
-
onClick: handleClick,
|
|
114
|
-
style: justify ? {
|
|
115
|
-
justifyContent: justify
|
|
116
|
-
} : undefined
|
|
117
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
-
className: "lemon-table-sort-title"
|
|
119
|
-
}, title), /*#__PURE__*/React.createElement("div", null, node, index !== undefined && /*#__PURE__*/React.createElement("span", {
|
|
120
|
-
className: "lemon-table-sort-number"
|
|
121
|
-
}, index)));
|
|
122
|
-
}
|