@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.
Files changed (57) hide show
  1. package/es/Actions/index.d.ts +3 -2
  2. package/es/Actions/index.js +29 -28
  3. package/es/Actions/index.less +26 -51
  4. package/es/BaseTable/Actions.d.ts +8 -0
  5. package/es/BaseTable/Actions.js +119 -0
  6. package/es/BaseTable/ResizeHeaderCell.js +16 -5
  7. package/es/BaseTable/index.js +63 -19
  8. package/es/BaseTable/index.less +99 -0
  9. package/es/BaseTable/typings.d.ts +11 -0
  10. package/es/DurationPicker/index.js +2 -10
  11. package/es/DurationPicker/index.less +4 -4
  12. package/es/Filter/index.js +100 -41
  13. package/es/Filter/index.less +11 -7
  14. package/es/Filter/typings.d.ts +3 -2
  15. package/es/FormLayout/index.less +1 -1
  16. package/es/Icons/Calendar.d.ts +5 -0
  17. package/es/Icons/Calendar.js +47 -0
  18. package/es/Icons/Down.js +10 -5
  19. package/es/Icons/More.d.ts +5 -0
  20. package/es/Icons/More.js +44 -0
  21. package/es/Icons/Search.js +8 -12
  22. package/es/Icons/index.d.ts +4 -0
  23. package/es/Icons/index.js +5 -1
  24. package/es/Layout/index.js +80 -3
  25. package/es/Layout/index.less +69 -25
  26. package/es/MainFramework/components/DropMenu/index.less +2 -32
  27. package/es/MainFramework/components/Menu/index.less +2 -2
  28. package/es/MainFramework/components/RefreshButton/index.less +2 -32
  29. package/es/Portal/index.d.ts +12 -0
  30. package/es/Portal/index.js +72 -0
  31. package/es/Section/TabBar.d.ts +12 -0
  32. package/es/Section/TabBar.js +48 -0
  33. package/es/Section/index.js +38 -53
  34. package/es/Section/index.less +44 -91
  35. package/es/SiderTree/TreeNodeTitle.d.ts +1 -1
  36. package/es/SiderTree/TreeNodeTitle.js +17 -35
  37. package/es/SiderTree/index.d.ts +3 -1
  38. package/es/SiderTree/index.js +40 -64
  39. package/es/SiderTree/index.less +76 -75
  40. package/es/SymbolIcon/index.d.ts +8 -0
  41. package/es/SymbolIcon/index.js +32 -0
  42. package/es/SymbolIcon/index.less +7 -0
  43. package/es/TabBar/index.d.ts +14 -0
  44. package/es/TabBar/index.js +52 -0
  45. package/es/TabBar/index.less +31 -0
  46. package/es/index.d.ts +3 -1
  47. package/es/index.js +3 -1
  48. package/es/index.less +4 -35
  49. package/es/init.js +15 -16
  50. package/es/overrides.less +136 -0
  51. package/es/theme.less +1 -8
  52. package/es/utils.d.ts +2 -0
  53. package/es/utils.js +14 -0
  54. package/es/utils.less +53 -0
  55. package/package.json +3 -3
  56. package/es/BaseTable/Sort.d.ts +0 -10
  57. package/es/BaseTable/Sort.js +0 -122
@@ -1,6 +1,11 @@
1
- @import '../theme.less';
1
+ @indentWidth: 18px;
2
+ @treeNodeHeight: 40px;
2
3
 
3
4
  .@{prefixCls}-tree {
5
+ &-wrapper {
6
+ padding: @space;
7
+ }
8
+
4
9
  &-menu-popover {
5
10
  .ant-popover-arrow {
6
11
  display: none;
@@ -12,95 +17,88 @@
12
17
 
13
18
  .ant-popover-inner-content {
14
19
  min-width: 140px;
15
- padding: 16px;
20
+ padding: 8px 0;
16
21
 
17
22
  & > div > ul {
18
23
  margin: 0;
19
24
  padding: 0;
20
25
 
21
26
  & > li {
22
- color: #888;
23
- line-height: 20px;
27
+ padding: 0 16px;
28
+ color: #333;
29
+ line-height: 36px;
24
30
  list-style: none;
25
31
  cursor: pointer;
32
+ transition: background-color 0.2s;
26
33
 
27
34
  &:hover {
28
- color: .primary(1) [];
35
+ background-color: #eee;
29
36
  }
30
37
  }
31
-
32
- & > li + li {
33
- margin-top: @space;
34
- }
35
38
  }
36
39
  }
37
40
  }
38
41
 
39
- &-wrapper {
40
- padding: 8px;
41
- background: #fff;
42
-
43
- & > .ant-input-affix-wrapper {
44
- height: 32px;
45
- margin-bottom: 8px;
46
- color: #b3b3b3;
47
- background: #f7f6f6;
48
- border: none;
49
- border-radius: 2px;
50
- outline: none;
51
- box-shadow: unset;
52
-
53
- & input {
54
- background: transparent;
55
- }
56
- }
42
+ &-tab-bar {
43
+ margin: 0 @space;
57
44
  }
58
45
 
59
- &-tabs {
60
- display: flex;
61
- padding: 8px;
62
- background-color: #fff;
63
- border-bottom: 1px solid #dfdfdf;
46
+ &-body {
47
+ overflow-x: auto;
64
48
  }
65
49
 
66
- &-tab {
67
- padding: 3px 8px;
68
- color: #61657f;
69
- line-height: 20px;
70
- border-radius: 2px;
71
- cursor: pointer;
72
-
73
- &-active {
74
- color: .primary(1) [];
75
- font-weight: bold;
76
- background: .primary(0.08) [];
77
- }
50
+ &-header + &-body {
51
+ margin-top: 12px;
78
52
  }
79
53
 
80
- &-body {
81
- overflow-x: auto;
54
+ &-header + .ant-tabs {
55
+ margin-top: 8px;
82
56
  }
83
57
 
84
58
  &-treenode {
85
59
  display: flex;
86
60
  align-items: center;
87
- height: 36px;
61
+ height: @treeNodeHeight;
88
62
  }
89
63
 
90
- &-indent-unit {
91
- display: inline-block;
92
- width: 10px;
64
+ &-indent {
65
+ align-self: stretch;
66
+ white-space: nowrap;
67
+ user-select: none;
68
+
69
+ &-unit {
70
+ display: inline-block;
71
+ width: @indentWidth;
72
+ }
73
+ }
74
+
75
+ &-show-line &-indent-unit {
76
+ position: relative;
77
+ height: 100%;
78
+
79
+ &::before {
80
+ position: absolute;
81
+ top: 0;
82
+ right: @indentWidth / 2;
83
+ bottom: 0;
84
+ border-right: 1px solid #c4c4c4;
85
+ content: '';
86
+ }
93
87
  }
94
88
 
95
89
  &-switcher {
90
+ position: relative;
96
91
  display: block;
97
- width: 13px;
98
- height: 13px;
99
- margin-right: 4px;
92
+ flex: none;
93
+ align-self: stretch;
94
+ width: @indentWidth;
95
+ margin: 0;
96
+ line-height: @treeNodeHeight;
97
+ text-align: center;
100
98
  cursor: pointer;
99
+ user-select: none;
101
100
 
102
101
  & svg {
103
- display: block;
104
102
  width: 13px;
105
103
  height: 13px;
106
104
  }
@@ -113,13 +111,9 @@
113
111
  min-width: 0;
114
112
  }
115
113
 
116
- &-node-selected &-title-content {
117
- font-weight: bold;
118
- background: .primary(0.05) [];
119
- }
120
-
121
- &-title:hover &-title-content {
122
- background: .primary(0.05) [];
114
+ &-node-selected &-title {
115
+ color: @primary-color;
116
+ background: .primary(0.1) [] !important;
123
117
  }
124
118
 
125
119
  &-title {
@@ -128,43 +122,50 @@
128
122
  align-items: center;
129
123
  justify-content: space-between;
130
124
  min-width: 0;
125
+ padding: 0 8px;
126
+ border-radius: 4px;
131
127
  cursor: pointer;
128
+ transition: background-color 0.2s;
129
+
130
+ &:hover {
131
+ background-color: #ededed;
132
+ }
132
133
 
133
134
  &-content {
134
135
  display: block;
135
- height: 36px;
136
- padding: 0 4px;
136
+ height: @treeNodeHeight;
137
137
  overflow: hidden;
138
- line-height: 36px;
138
+ line-height: @treeNodeHeight;
139
139
  white-space: nowrap;
140
140
  text-overflow: ellipsis;
141
- border-radius: 4px;
142
- transition: all 0.3s;
143
141
  }
144
142
 
145
143
  &-operators {
146
- flex: 0 0 34px;
147
- justify-content: flex-end;
148
-
149
144
  &-item {
150
- width: 15px;
151
- height: 15px;
145
+ width: 20px;
146
+ height: 20px;
152
147
  margin-left: 4px;
153
- color: .primary(1) [];
154
148
  line-height: 1;
155
149
  text-align: center;
156
- background: .primary(0.05) [];
157
150
  border-radius: 4px;
158
151
 
159
152
  & svg {
160
153
  vertical-align: middle;
161
154
  }
162
155
 
156
+ &-active,
163
157
  &:hover {
164
- color: #fff;
165
- background: .primary(1) [];
158
+ background: #d7d7d7;
166
159
  }
167
160
  }
168
161
  }
169
162
  }
170
163
  }
164
+
165
+ .@{prefixCls}-layout-left .@{prefixCls}-tree-wrapper:first-child .@{prefixCls}-tree-header {
166
+ padding-right: 12px;
167
+ }
168
+
169
+ .ant-tabs-tabpane .@{prefixCls}-tree-wrapper:first-child .@{prefixCls}-tree-header {
170
+ padding-right: 0;
171
+ }
@@ -0,0 +1,8 @@
1
+ import type { CSSProperties } from 'react';
2
+ export default function Icon(props: {
3
+ name: string;
4
+ size?: number;
5
+ color?: string;
6
+ className?: string;
7
+ style?: CSSProperties;
8
+ }): JSX.Element;
@@ -0,0 +1,32 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+
5
+ 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; }
6
+
7
+ import React from 'react';
8
+ import classNames from 'classnames';
9
+ import { PREFIX_CLS } from '../constants';
10
+ export default function Icon(props) {
11
+ var name = props.name,
12
+ size = props.size,
13
+ color = props.color,
14
+ styleProp = props.style,
15
+ className = props.className;
16
+ var style = styleProp;
17
+
18
+ if (size || color) {
19
+ style = _objectSpread(_objectSpread({}, style), {}, {
20
+ fontSize: size,
21
+ color: color
22
+ });
23
+ }
24
+
25
+ return /*#__PURE__*/React.createElement("svg", {
26
+ className: classNames("".concat(PREFIX_CLS, "-symbol-icon"), className),
27
+ "aria-hidden": "true",
28
+ style: style
29
+ }, /*#__PURE__*/React.createElement("use", {
30
+ xlinkHref: "#".concat(name)
31
+ }));
32
+ }
@@ -0,0 +1,7 @@
1
+ .@{prefixCls}-symbol-icon {
2
+ width: 1em;
3
+ height: 1em;
4
+ overflow: hidden;
5
+ vertical-align: -0.15em;
6
+ fill: currentColor;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { CSSProperties } from 'react';
2
+ import type { MouseEvent } from 'react';
3
+ interface Props {
4
+ tabs: {
5
+ title: string;
6
+ key?: string;
7
+ }[];
8
+ activeKey?: string;
9
+ className?: string;
10
+ style?: CSSProperties;
11
+ onTabClick: (key: string, index: number, e: MouseEvent) => void;
12
+ }
13
+ export default function TabBar(props: Props): JSX.Element;
14
+ export {};
@@ -0,0 +1,52 @@
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, { useEffect, useState } from 'react';
16
+ import classNames from 'classnames';
17
+ import { PREFIX_CLS } from '../constants';
18
+ export default function TabBar(props) {
19
+ var tabs = props.tabs,
20
+ onTabClick = props.onTabClick,
21
+ activeKey = props.activeKey,
22
+ style = props.style,
23
+ className = props.className;
24
+ var prefixCls = "".concat(PREFIX_CLS, "-tab-bar");
25
+
26
+ var getKey = function getKey() {
27
+ return activeKey || (tabs.length > 0 ? tabs[0].key || tabs[0].title : undefined);
28
+ };
29
+
30
+ var _useState = useState(getKey()),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ key = _useState2[0],
33
+ setKey = _useState2[1];
34
+
35
+ useEffect(function () {
36
+ setKey(getKey());
37
+ }, [activeKey]);
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ className: classNames(prefixCls, className),
40
+ style: style
41
+ }, tabs.map(function (tab, index) {
42
+ var tabKey = tab.key || tab.title;
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ key: tabKey,
45
+ className: classNames("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-active"), key === tabKey)),
46
+ onClick: function onClick(e) {
47
+ setKey(tabKey);
48
+ onTabClick(tabKey, index, e);
49
+ }
50
+ }, tab.title);
51
+ }));
52
+ }
@@ -0,0 +1,31 @@
1
+ .@{prefixCls}-tab-bar {
2
+ display: flex;
3
+ border-bottom: 1px solid #e5e5e5;
4
+
5
+ &-item {
6
+ position: relative;
7
+ box-sizing: border-box;
8
+ min-width: 52px;
9
+ padding: 12px 12px 14px;
10
+ color: #61657f;
11
+ font-size: 14px;
12
+ line-height: 22px;
13
+ cursor: pointer;
14
+
15
+ &-active {
16
+ color: @primary-color;
17
+ font-weight: 500;
18
+
19
+ &::after {
20
+ position: absolute;
21
+ bottom: -1px;
22
+ left: 0;
23
+ display: block;
24
+ width: 100%;
25
+ height: 2px;
26
+ background-color: @primary-color;
27
+ content: '';
28
+ }
29
+ }
30
+ }
31
+ }
package/es/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './constants';
1
2
  export { default as PageLoading } from './PageLoading';
2
3
  export { default as Actions } from './Actions';
3
4
  export { default as Filter } from './Filter';
@@ -24,4 +25,5 @@ export { default as FormHorizontal } from './FormHorizontal';
24
25
  export { default as FormInline } from './FormInline';
25
26
  export { default as FormTable } from './FormTable';
26
27
  export type { FormTableColumnType, FormTableProps, FormTableRef } from './FormTable/typings';
27
- export * from './constants';
28
+ export { default as TabBar } from './TabBar';
29
+ export { default as SymbolIcon } from './SymbolIcon';
package/es/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './constants';
1
2
  export { default as PageLoading } from './PageLoading';
2
3
  export { default as Actions } from './Actions';
3
4
  export { default as Filter } from './Filter';
@@ -19,4 +20,5 @@ export { default as init } from './init';
19
20
  export { default as FormHorizontal } from './FormHorizontal';
20
21
  export { default as FormInline } from './FormInline';
21
22
  export { default as FormTable } from './FormTable';
22
- export * from './constants';
23
+ export { default as TabBar } from './TabBar';
24
+ export { default as SymbolIcon } from './SymbolIcon';
package/es/index.less CHANGED
@@ -1,4 +1,6 @@
1
1
  @import '~antd/dist/antd.variable.less';
2
+ @import './utils.less';
3
+ @import './overrides.less';
2
4
  @import './theme.less';
3
5
  @import './Actions/index.less';
4
6
  @import './Layout/index.less';
@@ -18,38 +20,5 @@
18
20
  @import './FormHorizontal/index.less';
19
21
  @import './FormInline//index.less';
20
22
  @import './FormTable/index.less';
21
-
22
- @blue-base: #2357df;
23
-
24
- /** basic */
25
-
26
- @height-base: 32px;
27
- @border-color-base: #c0c0c0;
28
- @label-color: #464646;
29
-
30
- /** table */
31
-
32
- @table-header-bg: #f0f0f0;
33
- @table-header-color: rgba(51, 51, 51, 0.65);
34
- @table-padding-vertical: 14px;
35
- @table-border-color: rgba(0, 0, 0, 0.04);
36
-
37
- .ant-modal-confirm-body-wrapper .ant-modal-confirm-body .ant-modal-confirm-content {
38
- color: rgba(0, 0, 0, 0.65);
39
- }
40
-
41
- .ant-pagination-item-active {
42
- background: @primary-color;
43
-
44
- a {
45
- color: #fff;
46
- }
47
-
48
- &:hover a {
49
- color: #fff;
50
- }
51
- }
52
-
53
- a[title='站长统计'] {
54
- display: none;
55
- }
23
+ @import './TabBar/index.less';
24
+ @import './SymbolIcon/index.less';
package/es/init.js CHANGED
@@ -7,7 +7,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7
7
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
8
8
 
9
9
  import React from 'react';
10
- import { message, Modal, Empty, Select, ConfigProvider, Result, Button } from 'antd';
10
+ import { message, Modal, Empty, Select, ConfigProvider, Result, Button, version, DatePicker } from 'antd';
11
11
  import { config } from '@lemon-fe/hooks';
12
12
  import PageLoading from './PageLoading';
13
13
  import Icons from './Icons';
@@ -19,12 +19,13 @@ export default function init() {
19
19
 
20
20
  // 添加站长统计
21
21
  if (opts.enableCNZZ) {
22
- var node = document.createElement('script');
23
- node.innerHTML = "\n var _czc = _czc || [];\n window._czc&&window._czc.push(['_setAutoPageview', false]);\n ";
24
- document.body.appendChild(node);
25
- node = document.createElement('script');
26
- node.src = '//v1.cnzz.com/z_stat.php?id=1280732258&web_id=1280732258';
27
- document.body.appendChild(node);
22
+ var _node = document.createElement('script');
23
+
24
+ _node.innerHTML = "\n var _czc = _czc || [];\n window._czc&&window._czc.push(['_setAutoPageview', false]);\n ";
25
+ document.body.appendChild(_node);
26
+ _node = document.createElement('script');
27
+ _node.src = '//v1.cnzz.com/z_stat.php?id=1280732258&web_id=1280732258';
28
+ document.body.appendChild(_node);
28
29
  }
29
30
 
30
31
  var types = ['success', 'error', 'warning', 'info'];
@@ -81,24 +82,22 @@ export default function init() {
81
82
  }
82
83
  })
83
84
  }, arguments.length <= 0 ? undefined : arguments[0]));
84
- }; //@ts-ignore
85
+ };
85
86
 
87
+ var node = /*#__PURE__*/React.createElement(Down, null); //@ts-ignore
86
88
 
87
89
  Select.defaultProps = {
88
- suffixIcon: function suffixIcon() {
89
- return /*#__PURE__*/React.createElement("div", {
90
- style: {
91
- margin: '-2px 0 0 -2px',
92
- fontSize: 16,
93
- color: '#BFBFBF'
94
- }
95
- }, /*#__PURE__*/React.createElement(Down, null));
90
+ suffixIcon: version >= '4.18.9' ? node : function () {
91
+ return node;
96
92
  }
97
93
  };
98
94
  Empty.PRESENTED_IMAGE_DEFAULT = /*#__PURE__*/React.createElement(EmptyIcon, null);
99
95
  Empty.defaultProps = {
100
96
  image: Empty.PRESENTED_IMAGE_DEFAULT
101
97
  };
98
+ DatePicker.RangePicker.defaultProps = {
99
+ suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
100
+ };
102
101
  config({
103
102
  showToast: function showToast() {
104
103
  return message.loading('请稍等', 0);
@@ -0,0 +1,136 @@
1
+ a[title='站长统计'] {
2
+ display: none;
3
+ }
4
+
5
+ @blue-base: #2357df;
6
+
7
+ /** basic */
8
+
9
+ @height-base: 32px;
10
+ @border-color-base: #c0c0c0;
11
+ @border-radius-base: 4px;
12
+ @label-color: #464646;
13
+
14
+ /** table */
15
+
16
+ @table-header-bg: #f0f0f0;
17
+ @table-header-color: rgba(51, 51, 51, 0.65);
18
+ @table-padding-vertical: 14px;
19
+ @table-border-color: rgba(0, 0, 0, 0.04);
20
+ @table-border-radius-base: 4px;
21
+
22
+ /** button */
23
+
24
+ @btn-default-border: #c4c4c4;
25
+
26
+ /** modal */
27
+
28
+ .ant-modal-content {
29
+ border-radius: 8px;
30
+ }
31
+
32
+ .ant-modal-confirm {
33
+ .ant-modal-body {
34
+ padding: 0;
35
+ }
36
+
37
+ .ant-modal-confirm-body {
38
+ padding: 40px 48px;
39
+ overflow: hidden;
40
+
41
+ & > .anticon:first-child {
42
+ position: absolute;
43
+ top: 40px;
44
+ left: 48px;
45
+ padding: 2px;
46
+ }
47
+
48
+ & > .anticon + .ant-modal-confirm-title + .ant-modal-confirm-content {
49
+ margin-left: 36px;
50
+ }
51
+ }
52
+
53
+ .ant-modal-confirm-btns {
54
+ float: none;
55
+ margin-top: 0;
56
+ padding: 10px 16px;
57
+ text-align: right;
58
+ background: transparent;
59
+ border-top: 1px solid rgba(0, 0, 0, 0.06);
60
+ border-radius: 0 0 2px 2px;
61
+
62
+ & > .ant-btn {
63
+ min-width: 72px;
64
+ }
65
+ }
66
+
67
+ .ant-modal-confirm-title {
68
+ float: none;
69
+ margin-left: 36px;
70
+ font-weight: 600;
71
+ line-height: 24px;
72
+ }
73
+
74
+ .ant-modal-confirm-content {
75
+ float: none;
76
+ margin: 2px 0 0 36px;
77
+ color: rgba(51, 51, 51, 0.5);
78
+ line-height: 22px;
79
+ }
80
+ }
81
+
82
+ /** pagination */
83
+
84
+ .ant-pagination {
85
+ color: #666;
86
+
87
+ .ant-select {
88
+ color: #666;
89
+ }
90
+ }
91
+
92
+ .ant-pagination-item {
93
+ font-size: 12px;
94
+
95
+ a {
96
+ color: #666;
97
+ }
98
+ }
99
+
100
+ .ant-pagination-item-active {
101
+ background: @primary-color;
102
+
103
+ a {
104
+ color: #fff;
105
+ }
106
+
107
+ &:hover a {
108
+ color: #fff;
109
+ }
110
+ }
111
+
112
+ /** select */
113
+
114
+ .ant-select-arrow {
115
+ color: rgba(51, 51, 51, 0.7);
116
+ font-size: 16px;
117
+ }
118
+
119
+ /** input */
120
+ @input-padding-horizontal-base: 8px;
121
+ @input-icon-color: rgba(51, 51, 51, 0.7);
122
+
123
+ /** picker */
124
+ .ant-picker {
125
+ .ant-picker-clear {
126
+ box-sizing: border-box;
127
+ width: 16px;
128
+ height: 16px;
129
+ padding: 1px;
130
+ }
131
+
132
+ &-suffix {
133
+ color: rgba(51, 51, 51, 0.7);
134
+ font-size: 16px;
135
+ }
136
+ }
package/es/theme.less CHANGED
@@ -1,13 +1,6 @@
1
- /* stylelint-disable property-no-unknown */
2
1
  @prefixCls: lemon;
2
+ @space: 16px;
3
3
 
4
4
  html {
5
5
  --lemon-primary-color: 35, 87, 223;
6
6
  }
7
-
8
- .primary(@alpha: 1) {
9
- rgb: rgb(var(--lemon-primary-color));
10
- rgba: rgba(var(--lemon-primary-color), @alpha);
11
- }
12
-
13
- @space: 16px;
package/es/utils.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare const mapChildren: (children: ReactNode, cb: (node: ReactNode, index: number) => ReactNode) => ReactNode[];
package/es/utils.js ADDED
@@ -0,0 +1,14 @@
1
+ // 不使用Children.map的原因是由于它会给子节点生成一个key与tabs的activeTabKey无法对应
2
+ export var mapChildren = function mapChildren(children, cb) {
3
+ var nodes = [];
4
+
5
+ if (Array.isArray(children)) {
6
+ nodes = children;
7
+ } else {
8
+ nodes = [children];
9
+ }
10
+
11
+ return nodes.filter(function (item) {
12
+ return item !== null;
13
+ }).map(cb);
14
+ };