@lemon-fe/components 0.1.42 → 0.1.47

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.
@@ -172,39 +172,18 @@ function Filter(props) {
172
172
  width = _useState12[0],
173
173
  setWidth = _useState12[1];
174
174
 
175
- var _useState13 = useState(false),
175
+ var _useState13 = useState(true),
176
176
  _useState14 = _slicedToArray(_useState13, 2),
177
177
  collapsed = _useState14[0],
178
178
  setCollapsed = _useState14[1];
179
179
 
180
- var _useRequest = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
181
- var tabsData;
182
- return regeneratorRuntime.wrap(function _callee$(_context) {
183
- while (1) {
184
- switch (_context.prev = _context.next) {
185
- case 0:
186
- if (storageKey) {
187
- _context.next = 2;
188
- break;
189
- }
190
-
191
- return _context.abrupt("return", null);
192
-
193
- case 2:
194
- _context.next = 4;
195
- return getStorageData(storageKey);
196
-
197
- case 4:
198
- tabsData = _context.sent;
199
- return _context.abrupt("return", tabsData);
180
+ var _useRequest = useRequest(function () {
181
+ if (!storageKey) {
182
+ return null;
183
+ }
200
184
 
201
- case 6:
202
- case "end":
203
- return _context.stop();
204
- }
205
- }
206
- }, _callee);
207
- })), {
185
+ return getStorageData(storageKey);
186
+ }, {
208
187
  loadingState: false,
209
188
  onSuccess: function onSuccess(res) {
210
189
  if (res !== null) {
@@ -236,8 +215,8 @@ function Filter(props) {
236
215
  onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(changedValues, allValues, form);
237
216
  };
238
217
 
239
- var handleSave = function handleSave(_ref2) {
240
- var title = _ref2.name;
218
+ var handleSave = function handleSave(_ref) {
219
+ var title = _ref.name;
241
220
  var index = tabs.findIndex(function (item) {
242
221
  return item.title === title;
243
222
  });
@@ -266,36 +245,36 @@ function Filter(props) {
266
245
  };
267
246
 
268
247
  var handleOk = /*#__PURE__*/function () {
269
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
248
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
270
249
  var values;
271
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
250
+ return regeneratorRuntime.wrap(function _callee$(_context) {
272
251
  while (1) {
273
- switch (_context2.prev = _context2.next) {
252
+ switch (_context.prev = _context.next) {
274
253
  case 0:
275
- _context2.prev = 0;
276
- _context2.next = 3;
254
+ _context.prev = 0;
255
+ _context.next = 3;
277
256
  return modalForm.validateFields();
278
257
 
279
258
  case 3:
280
- values = _context2.sent;
259
+ values = _context.sent;
281
260
  handleSave(values);
282
- _context2.next = 9;
261
+ _context.next = 9;
283
262
  break;
284
263
 
285
264
  case 7:
286
- _context2.prev = 7;
287
- _context2.t0 = _context2["catch"](0);
265
+ _context.prev = 7;
266
+ _context.t0 = _context["catch"](0);
288
267
 
289
268
  case 9:
290
269
  case "end":
291
- return _context2.stop();
270
+ return _context.stop();
292
271
  }
293
272
  }
294
- }, _callee2, null, [[0, 7]]);
273
+ }, _callee, null, [[0, 7]]);
295
274
  }));
296
275
 
297
276
  return function handleOk() {
298
- return _ref3.apply(this, arguments);
277
+ return _ref2.apply(this, arguments);
299
278
  };
300
279
  }();
301
280
 
@@ -574,18 +553,48 @@ function Filter(props) {
574
553
  style: {
575
554
  visibility: showCollapse ? 'visible' : 'hidden'
576
555
  },
577
- className: "".concat(prefixCls, "-btn"),
578
556
  onClick: function onClick() {
579
557
  return setCollapsed(function (prev) {
580
558
  return !prev;
581
559
  });
582
560
  },
583
- icon: /*#__PURE__*/React.createElement(Icons.CollapseUp, {
584
- style: {
585
- transform: collapsed ? 'rotateX(180deg)' : undefined
586
- }
587
- })
588
- })))))));
561
+ type: "link",
562
+ className: "".concat(prefixCls, "-collapse")
563
+ }, collapsed ? '高级搜索' : '收起搜索', /*#__PURE__*/React.createElement("svg", {
564
+ width: "10",
565
+ height: "10",
566
+ viewBox: "0 0 10 10",
567
+ xmlns: "http://www.w3.org/2000/svg",
568
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
569
+ style: collapsed ? {
570
+ transform: 'rotate(180deg)'
571
+ } : undefined
572
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("path", {
573
+ id: "a",
574
+ d: "M0 0h10v10H0z"
575
+ })), /*#__PURE__*/React.createElement("g", {
576
+ transform: "matrix(1 0 0 -1 0 10)",
577
+ fill: "none",
578
+ fillRule: "evenodd"
579
+ }, /*#__PURE__*/React.createElement("mask", {
580
+ id: "b",
581
+ fill: "#fff"
582
+ }, /*#__PURE__*/React.createElement("use", {
583
+ xlinkHref: "#a",
584
+ transform: "rotate(-90 5 5)"
585
+ })), /*#__PURE__*/React.createElement("use", {
586
+ fillOpacity: "0",
587
+ fill: "#C4C4C4",
588
+ transform: "rotate(-90 5 5)",
589
+ xlinkHref: "#a"
590
+ }), /*#__PURE__*/React.createElement("path", {
591
+ d: "M2.172 1.757 5 4.586l2.828-2.829M2.172 5.757 5 8.586l2.828-2.829",
592
+ stroke: "currentColor",
593
+ strokeLinecap: "round",
594
+ strokeLinejoin: "round",
595
+ strokeDasharray: "0,0",
596
+ mask: "url(#b)"
597
+ }))))))))));
589
598
  }
590
599
 
591
600
  Filter.setComponents = setComponents;
@@ -1,6 +1,10 @@
1
1
  .@{prefixCls}-filter {
2
2
  &-tab-bar {
3
- margin-bottom: 16px;
3
+ margin-bottom: 12px;
4
+
5
+ .@{prefixCls}-tab-bar-item {
6
+ padding: 8px 12px;
7
+ }
4
8
  }
5
9
 
6
10
  &-btn {
@@ -13,9 +17,19 @@
13
17
  }
14
18
  }
15
19
 
20
+ &-collapse {
21
+ padding: 4px 0;
22
+ font-size: 12px;
23
+ line-height: 1;
24
+
25
+ & > svg {
26
+ vertical-align: -1px;
27
+ }
28
+ }
29
+
16
30
  &-btns {
17
31
  display: flex;
18
- margin-bottom: 16px;
32
+ margin-bottom: 8px;
19
33
  padding: 0 8px;
20
34
  }
21
35
 
@@ -52,5 +66,5 @@
52
66
  }
53
67
 
54
68
  .@{prefixCls}-section-body > .@{prefixCls}-filter:not(.@{prefixCls}-filter-simple):first-child {
55
- margin-top: -16px;
69
+ margin-top: -12px;
56
70
  }
@@ -1,8 +1,9 @@
1
1
  @import '../theme.less';
2
2
 
3
3
  @spaceX: 16px;
4
- @spaceY: 16px;
5
- @minWidth: 300px;
4
+ @spaceY: 8px;
5
+ @minWidth: 350px;
6
+ @maxWidth: 94px + 422px;
6
7
 
7
8
  .wrapper() {
8
9
  margin-right: (-@spaceX / 2);
@@ -20,14 +21,15 @@
20
21
  flex-wrap: nowrap;
21
22
  width: percentage((@colSpan / 24));
22
23
  min-width: if((@colSpan >= 12), 2 * @minWidth, @minWidth);
24
+ max-width: if((@colSpan >= 12), 2 * @maxWidth, @maxWidth);
23
25
  padding: 0 (@spaceX / 2);
24
26
  }
25
27
 
26
28
  .@{prefixCls}-form {
27
29
  &-layout {
28
30
  .ant-form-item {
29
- margin-bottom: @spaceY;
30
31
  flex-wrap: nowrap;
32
+ margin-bottom: @spaceY;
31
33
 
32
34
  &-label {
33
35
  flex: 0 0 94px;
@@ -7,7 +7,7 @@
7
7
  background: #f2f2f2;
8
8
 
9
9
  &-header {
10
- padding: @space 0;
10
+ padding: 8px 0;
11
11
  background-color: #f2f2f2;
12
12
  }
13
13
 
@@ -16,7 +16,7 @@
16
16
  min-height: 0;
17
17
 
18
18
  &:first-child {
19
- margin-top: @space;
19
+ margin-top: 8px;
20
20
  }
21
21
  }
22
22
 
@@ -3,7 +3,7 @@
3
3
  .@{prefixCls}-section {
4
4
  position: relative;
5
5
  width: 100%;
6
- padding: @space;
6
+ padding: 12px 16px;
7
7
  color: #333;
8
8
 
9
9
  & + & {
@@ -24,8 +24,7 @@
24
24
  &-header {
25
25
  display: flex;
26
26
  align-items: flex-end;
27
- margin-bottom: @space;
28
- padding: 8px 0;
27
+ margin-bottom: 12px;
29
28
  }
30
29
 
31
30
  &-title {
@@ -198,7 +198,7 @@ export default function SelectView(props) {
198
198
  return item === key;
199
199
  });
200
200
 
201
- if (index > 0) {
201
+ if (index >= 0) {
202
202
  keys.splice(index, 1);
203
203
  } else {
204
204
  keys.push(key);
@@ -45,6 +45,7 @@
45
45
  display: flex;
46
46
  flex: 1;
47
47
  flex-direction: column;
48
+ min-width: 0;
48
49
  padding: 16px;
49
50
  }
50
51
 
@@ -1,5 +1,5 @@
1
1
  @indentWidth: 18px;
2
- @treeNodeHeight: 40px;
2
+ @treeNodeHeight: 36px;
3
3
 
4
4
  .@{prefixCls}-tree {
5
5
  &-wrapper {
package/es/utils.less CHANGED
@@ -62,8 +62,10 @@
62
62
  height: 100%;
63
63
 
64
64
  & > .ant-tabs-nav {
65
+ margin-bottom: 12px;
66
+
65
67
  .ant-tabs-tab {
66
- padding: 12px 12px 14px;
68
+ padding: 8px 12px;
67
69
 
68
70
  &.ant-tabs-tab-active .ant-tabs-tab-btn {
69
71
  text-shadow: unset;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.42",
3
+ "version": "0.1.47",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -41,5 +41,5 @@
41
41
  "react": "^17.0.2",
42
42
  "react-dom": "^17.0.2"
43
43
  },
44
- "gitHead": "e08613f24c7f5469133faffbed885dfed240b49c"
44
+ "gitHead": "a64ea25d2d8ddc113c54347d040455e3bec2d813"
45
45
  }