@lemon-fe/kits 1.0.0-113 → 1.0.0-115

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.
@@ -18,7 +18,7 @@
18
18
  &-column-sorter {
19
19
  display: inline-flex;
20
20
  flex-direction: column;
21
- margin-left: 4px;
21
+ margin: 0 4px;
22
22
  color: fade(#333, 50);
23
23
 
24
24
  &-down {
@@ -0,0 +1,3 @@
1
+ import type { ComponentProps } from 'react';
2
+ import Icon from '@ant-design/icons';
3
+ export default function Clear(props: ComponentProps<typeof Icon>): JSX.Element;
@@ -0,0 +1,22 @@
1
+ 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); }
2
+
3
+ import React from 'react';
4
+ import Icon from '@ant-design/icons';
5
+
6
+ var Svg = function Svg(props) {
7
+ return /*#__PURE__*/React.createElement("svg", _extends({
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ viewBox: "0 0 12 12"
10
+ }, props), /*#__PURE__*/React.createElement("path", {
11
+ fill: "currentColor",
12
+ fillRule: "evenodd",
13
+ d: "M6 0a6 6 0 1 1 0 12A6 6 0 0 1 6 0ZM4.94 3.879a.75.75 0 1 0-1.061 1.06L4.939 6l-1.06 1.06a.75.75 0 1 0 1.06 1.061L6 7.061l1.06 1.06a.75.75 0 0 0 .977.073l.084-.073a.75.75 0 0 0 0-1.06L7.061 6l1.06-1.06a.75.75 0 1 0-1.06-1.061L6 4.939Z",
14
+ opacity: "1"
15
+ }));
16
+ };
17
+
18
+ export default function Clear(props) {
19
+ return /*#__PURE__*/React.createElement(Icon, _extends({
20
+ component: Svg
21
+ }, props));
22
+ }
@@ -11,6 +11,7 @@ import CollapseUp from './CollapseUp';
11
11
  import Close from './Close';
12
12
  import Delete from './Delete';
13
13
  import Add from './Add';
14
+ import Clear from './Clear';
14
15
  declare const Icons: {
15
16
  Search: typeof Search;
16
17
  Down: typeof Down;
@@ -25,5 +26,6 @@ declare const Icons: {
25
26
  Close: typeof Close;
26
27
  Delete: typeof Delete;
27
28
  Add: typeof Add;
29
+ Clear: typeof Clear;
28
30
  };
29
31
  export default Icons;
@@ -11,6 +11,7 @@ import CollapseUp from "./CollapseUp";
11
11
  import Close from "./Close";
12
12
  import Delete from "./Delete";
13
13
  import Add from "./Add";
14
+ import Clear from "./Clear";
14
15
  var Icons = {
15
16
  Search: Search,
16
17
  Down: Down,
@@ -24,6 +25,7 @@ var Icons = {
24
25
  CollapseUp: CollapseUp,
25
26
  Close: Close,
26
27
  Delete: Delete,
27
- Add: Add
28
+ Add: Add,
29
+ Clear: Clear
28
30
  };
29
31
  export default Icons;
@@ -28,9 +28,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
28
28
 
29
29
  import React, { useState, cloneElement, useRef, useEffect, useContext } from 'react';
30
30
  import { Modal, Input, message, ConfigProvider } from 'antd';
31
- import { CloseCircleFilled } from '@ant-design/icons';
32
31
  import SearchIcon from "../Icons/Search";
33
32
  import { prefixClassName } from "../utils";
33
+ import Icons from "../Icons";
34
34
  var prefix = prefixClassName('popup');
35
35
 
36
36
  function Popup(props) {
@@ -270,8 +270,8 @@ function Popup(props) {
270
270
  placeholder: placeholder,
271
271
  bordered: bordered,
272
272
  allowClear: allowClear,
273
- suffix: /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && !readOnly && allowClear && label && /*#__PURE__*/React.createElement(CloseCircleFilled, {
274
- className: "".concat(getPrefixCls('input'), "-clear-icon"),
273
+ suffix: /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && !readOnly && allowClear && label && /*#__PURE__*/React.createElement(Icons.Clear, {
274
+ className: "".concat(getPrefixCls('input'), "-clear-icon ").concat(prefix('input-clear')),
275
275
  onClick: handleClear
276
276
  }), /*#__PURE__*/React.createElement(SearchIcon, null))
277
277
  });
@@ -4,6 +4,28 @@
4
4
  &-wrapper {
5
5
  width: 100%;
6
6
  height: 100%;
7
+
8
+ .@{ant-prefix}-input-suffix {
9
+ position: relative;
10
+
11
+ .@{ant-prefix}-input-clear-icon:first-child {
12
+ display: none;
13
+ }
14
+ }
15
+ }
16
+
17
+ &-input-clear {
18
+ position: absolute;
19
+ top: 50%;
20
+ padding: 1px;
21
+ background-color: #fff;
22
+ transform: translateY(-50%);
23
+ opacity: 0;
24
+ transition: opacity 0.3s, color 0.3s !important;
25
+ }
26
+
27
+ &-wrapper:hover &-input-clear {
28
+ opacity: 1;
7
29
  }
8
30
 
9
31
  &-input input {
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, Select, ConfigProvider, Result, Button, version, DatePicker, Cascader, TreeSelect, Empty, Menu } from 'antd';
10
+ import { message, Modal, Select, ConfigProvider, Result, Button, DatePicker, Cascader, TreeSelect, Empty, Menu } from 'antd';
11
11
  import { config } from '@lemon-fe/hooks';
12
12
  import PageLoading from "./components/PageLoading";
13
13
  import Icons from "./components/Icons";
@@ -15,7 +15,8 @@ import empty from "./styles/empty.png";
15
15
  var Tip = Icons.Tip,
16
16
  Down = Icons.Down,
17
17
  BigTip = Icons.BigTip,
18
- Close = Icons.Close;
18
+ Close = Icons.Close,
19
+ Clear = Icons.Clear;
19
20
  export default function init() {
20
21
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
21
22
 
@@ -102,9 +103,8 @@ export default function init() {
102
103
  height: 60
103
104
  }
104
105
  }),
105
- suffixIcon: version >= '4.18.9' ? node : function () {
106
- return node;
107
- }
106
+ suffixIcon: node,
107
+ clearIcon: /*#__PURE__*/React.createElement(Clear, null)
108
108
  }; //@ts-ignore
109
109
 
110
110
  TreeSelect.defaultProps = {
@@ -113,20 +113,22 @@ export default function init() {
113
113
  height: 60
114
114
  }
115
115
  }),
116
- suffixIcon: version >= '4.18.9' ? node : function () {
117
- return node;
118
- }
116
+ suffixIcon: node,
117
+ clearIcon: /*#__PURE__*/React.createElement(Clear, null)
119
118
  }; //@ts-ignore
120
119
 
121
120
  Cascader.defaultProps = {
122
- suffixIcon: node
123
- };
124
- DatePicker.RangePicker.defaultProps = {
125
- suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
121
+ suffixIcon: node,
122
+ clearIcon: /*#__PURE__*/React.createElement(Clear, null)
126
123
  };
127
- DatePicker.defaultProps = {
128
- suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null)
129
- }; //@ts-ignore
124
+ DatePicker.RangePicker.defaultProps = _objectSpread(_objectSpread({}, DatePicker.RangePicker.defaultProps), {}, {
125
+ suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null),
126
+ clearIcon: /*#__PURE__*/React.createElement(Clear, null)
127
+ });
128
+ DatePicker.defaultProps = _objectSpread(_objectSpread({}, DatePicker.defaultProps), {}, {
129
+ suffixIcon: /*#__PURE__*/React.createElement(Icons.Calendar, null),
130
+ clearIcon: /*#__PURE__*/React.createElement(Clear, null)
131
+ }); //@ts-ignore
130
132
 
131
133
  Menu.defaultProps = {
132
134
  expandIcon: /*#__PURE__*/React.createElement(Down, {
@@ -153,13 +153,6 @@ a[title='站长统计'] {
153
153
  width: auto;
154
154
  }
155
155
 
156
- /** select */
157
-
158
- .@{ant-prefix}-select-arrow {
159
- color: fade(#333, 70);
160
- font-size: 14px;
161
- }
162
-
163
156
  /** input */
164
157
  @input-height-base: 28px;
165
158
  @input-padding-horizontal-base: 8px;
@@ -173,18 +166,40 @@ a[title='站长统计'] {
173
166
  /** picker */
174
167
  .@{ant-prefix}-picker {
175
168
  .@{ant-prefix}-picker-clear {
176
- box-sizing: border-box;
177
- width: 16px;
178
- height: 16px;
179
169
  padding: 1px;
170
+ font-size: 14px;
171
+ background-color: #fff;
180
172
  }
181
173
 
182
174
  &-suffix {
183
- color: rgba(51, 51, 51, 0.7);
175
+ color: fade(#333, 70);
184
176
  font-size: 16px;
185
177
  }
178
+
179
+ &&-disabled &-suffix {
180
+ color: fade(#333, 49);
181
+ }
186
182
  }
187
183
 
184
+ /** select */
185
+ @select-multiple-item-disabled-color: @input-disabled-color;
186
+ .@{ant-prefix}-select {
187
+ &-arrow {
188
+ color: fade(#333, 70);
189
+ font-size: 14px;
190
+ }
191
+
192
+ &-disabled&:not(&-customize-input) &-selector {
193
+ color: @input-disabled-color;
194
+ }
195
+
196
+ &-disabled &-arrow {
197
+ color: fade(#333, 49);
198
+ }
199
+ }
200
+
201
+ /** treeselect */
202
+
188
203
  /** button **/
189
204
  @btn-height-base: 28px;
190
205
  @btn-height-sm: 24px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/kits",
3
- "version": "1.0.0-113",
3
+ "version": "1.0.0-115",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",