@lemon-fe/components 0.0.27 → 0.1.0-alpha.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.
@@ -3,11 +3,12 @@ import type { CSSProperties } from 'react';
3
3
  import { ButtonProps } from 'antd';
4
4
  interface ActionBtn extends ButtonProps {
5
5
  text: string | ReactElement;
6
+ onClick?: () => void;
6
7
  /**
7
- * deprecated please use onClick
8
+ * @deprecated
9
+ * 请不要使用
8
10
  */
9
11
  action?: () => void;
10
- onClick?: () => void;
11
12
  dropDown?: ({
12
13
  text: string;
13
14
  onClick: () => void;
@@ -1,4 +1,4 @@
1
- var _excluded = ["disabled", "dropDown", "text", "action", "onClick", "icon"];
1
+ var _excluded = ["disabled", "dropDown", "text", "onClick", "icon", "action"];
2
2
 
3
3
  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; }
4
4
 
@@ -65,9 +65,9 @@ function Actions(props) {
65
65
  var disabled = item.disabled,
66
66
  dropDown = item.dropDown,
67
67
  text = item.text,
68
- action = item.action,
69
68
  onClick = item.onClick,
70
69
  icon = item.icon,
70
+ action = item.action,
71
71
  rest = _objectWithoutProperties(item, _excluded);
72
72
 
73
73
  if ( /*#__PURE__*/React.isValidElement(text)) {
@@ -94,13 +94,11 @@ function Actions(props) {
94
94
  if (handleClick !== undefined) {
95
95
  return /*#__PURE__*/React.createElement(Dropdown.Button, {
96
96
  key: text,
97
- type: 'text',
98
97
  disabled: disabled,
99
98
  overlay: overlay,
100
- onClick: handleClick
101
- }, icon ? /*#__PURE__*/React.createElement("span", {
102
- className: "".concat(prefixCls, "-actions-icon")
103
- }, icon) : null, text);
99
+ onClick: handleClick,
100
+ icon: icon
101
+ }, text);
104
102
  }
105
103
 
106
104
  return /*#__PURE__*/React.createElement(Dropdown, {
@@ -109,20 +107,16 @@ function Actions(props) {
109
107
  overlay: overlay
110
108
  }, /*#__PURE__*/React.createElement(Button, _objectSpread({
111
109
  disabled: disabled,
112
- type: "text"
113
- }, rest), icon ? /*#__PURE__*/React.createElement("span", {
114
- className: "".concat(prefixCls, "-actions-icon")
115
- }, icon) : null, text, /*#__PURE__*/React.createElement(Down, null)));
110
+ icon: icon
111
+ }, rest), text, /*#__PURE__*/React.createElement(Down, null)));
116
112
  }
117
113
 
118
- return /*#__PURE__*/React.createElement(Button, {
114
+ return /*#__PURE__*/React.createElement(Button, _objectSpread({
119
115
  key: text,
120
116
  disabled: disabled,
121
117
  onClick: handleClick,
122
- type: "text"
123
- }, icon ? /*#__PURE__*/React.createElement("span", {
124
- className: "".concat(prefixCls, "-actions-icon")
125
- }, icon) : null, text);
118
+ icon: icon
119
+ }, rest), text);
126
120
  }), collapsedBtns.length > 0 ? /*#__PURE__*/React.createElement(Popover, {
127
121
  placement: "bottomRight",
128
122
  overlayClassName: "".concat(prefixCls, "-actions-popover"),
@@ -161,7 +155,6 @@ function Actions(props) {
161
155
  }, item.text);
162
156
  }))
163
157
  }, /*#__PURE__*/React.createElement(Button, {
164
- type: "text",
165
158
  icon: /*#__PURE__*/React.createElement(EllipsisOutlined, null)
166
159
  })) : null));
167
160
  }
@@ -51,45 +51,20 @@
51
51
  }
52
52
  }
53
53
 
54
- .ant-btn {
55
- padding: 0 8px;
56
- font-size: 14px;
57
- border-radius: 2px;
54
+ .ant-btn:not(.ant-btn-icon-only) {
55
+ min-width: 80px;
56
+ padding: 4px 12px;
58
57
  }
59
58
 
60
- .ant-dropdown-button.ant-btn-group > .ant-btn:last-child:not(:first-child) {
61
- padding-right: 4px;
62
- padding-left: 4px;
63
- }
64
-
65
- .ant-btn-text {
66
- display: inline-flex;
67
- align-items: center;
68
-
69
- &:not(:disabled) {
70
- color: rgba(51, 51, 51, 0.65);
71
-
72
- &:hover {
73
- background: rgba(0, 0, 0, 0.08);
74
- }
75
- }
76
- }
59
+ .ant-btn-default:not(:disabled) {
60
+ background-color: #fff;
77
61
 
78
- &-icon {
79
- margin-right: 8px;
80
- font-size: 20px;
81
- line-height: 1;
82
-
83
- svg > use {
84
- color: .primary() [rgb];
85
- fill: #595959;
62
+ .anticon {
63
+ color: rgba(51, 51, 51, 0.7);
86
64
  }
87
- }
88
65
 
89
- button:disabled &-icon {
90
- svg > use {
91
- color: inherit;
92
- fill: currentColor;
66
+ &:hover .anticon {
67
+ color: var(--ant-primary-color);
93
68
  }
94
69
  }
95
70
  }
@@ -36,13 +36,24 @@ export default function ResizeHeaderCell(props) {
36
36
  setSize(width);
37
37
  }, [width]);
38
38
 
39
+ var getTable = function getTable() {
40
+ if (fullTableRef.current === null) {
41
+ return null;
42
+ }
43
+
44
+ return fullTableRef.current.querySelector('.ant-table');
45
+ };
46
+
39
47
  var handleResizeStart = function handleResizeStart() {
40
- var _fullTableRef$current;
48
+ var table = getTable();
49
+
50
+ if (table === null) {
51
+ return;
52
+ }
41
53
 
42
54
  var elm = document.createElement('div');
43
- elm.style.height = "".concat(((_fullTableRef$current = fullTableRef.current) === null || _fullTableRef$current === void 0 ? void 0 : _fullTableRef$current.offsetHeight) || 0, "px");
55
+ elm.style.height = "".concat(table.offsetHeight || 0, "px");
44
56
  elm.classList.add("".concat(prefixCls, "-resizable-indicator"));
45
- var table = fullTableRef.current;
46
57
 
47
58
  if (table) {
48
59
  table.appendChild(elm);
@@ -73,9 +84,9 @@ export default function ResizeHeaderCell(props) {
73
84
  };
74
85
 
75
86
  var handleResizeStop = function handleResizeStop() {
76
- var table = fullTableRef.current;
87
+ var table = getTable();
77
88
 
78
- if (table && indicator.current) {
89
+ if (table !== null && indicator.current !== undefined) {
79
90
  table.removeChild(indicator.current);
80
91
  table.classList.remove("".concat(prefixCls, "-resizing-col"));
81
92
 
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["onWidthChange", "width", "fullTableRef"],
2
- _excluded2 = ["id", "columns", "defaultColumnProps", "rowKey", "children", "summaryTitle", "summaryRecord", "dataSource", "onSortChange", "sort", "scroll", "virtual", "components", "pagination", "onChange", "rowHeight", "tableLayout"];
2
+ _excluded2 = ["id", "columns", "defaultColumnProps", "rowKey", "children", "summaryTitle", "summaryRecord", "dataSource", "onSortChange", "sort", "scroll", "virtual", "components", "pagination", "onChange", "rowHeight", "tableLayout", "rowActions"];
3
3
 
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
5
 
@@ -9,6 +9,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
9
9
 
10
10
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
11
 
12
+ 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); }
13
+
12
14
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
15
 
14
16
  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."); }
@@ -35,7 +37,7 @@ import React, { useMemo, useState, useEffect, useRef } from 'react';
35
37
  import { Table as AntdTable } from 'antd';
36
38
  import { get } from 'lodash';
37
39
  import { useThrottle } from '@lemon-fe/hooks';
38
- import { isColumnType, getColumnKey, randomStr } from './utils';
40
+ import { isColumnType, getColumnKey } from './utils';
39
41
  import ResizeHeaderCell from './ResizeHeaderCell';
40
42
  import { PREFIX_CLS } from '../constants';
41
43
  import VirtualList from './VirtualBody';
@@ -98,12 +100,10 @@ function BaseTable(props) {
98
100
  rowHeight = props.rowHeight,
99
101
  _props$tableLayout = props.tableLayout,
100
102
  tableLayout = _props$tableLayout === void 0 ? 'fixed' : _props$tableLayout,
103
+ rowActions = props.rowActions,
101
104
  restProps = _objectWithoutProperties(props, _excluded2);
102
105
 
103
106
  var fullTableRef = useRef(null);
104
- var tableID = useMemo(function () {
105
- return id || randomStr();
106
- }, [id]);
107
107
 
108
108
  var _useState = useState(0),
109
109
  _useState2 = _slicedToArray(_useState, 2),
@@ -115,22 +115,21 @@ function BaseTable(props) {
115
115
  colsState = _useState4[0],
116
116
  setColsState = _useState4[1];
117
117
 
118
- useEffect(function () {
119
- fullTableRef.current = document.getElementById(tableID);
120
- }, [tableID]);
118
+ var actions = useRef(rowActions);
119
+ actions.current = rowActions;
121
120
  /** auto scroll y */
122
121
 
123
122
  var calcScrollY = function calcScrollY() {
124
- var table = fullTableRef.current;
123
+ var wrapper = fullTableRef.current;
125
124
 
126
- if (table === null) {
125
+ if (wrapper === null) {
127
126
  return null;
128
127
  }
129
128
 
130
- var wrapper = table.closest('.ant-table-wrapper');
131
- var tableBody = table.querySelector('.ant-table-body');
129
+ var table = wrapper.querySelector('.ant-table');
130
+ var tableBody = wrapper.querySelector('.ant-table-body');
132
131
 
133
- if (tableBody === null || wrapper === null) {
132
+ if (tableBody === null || table === null) {
134
133
  return null;
135
134
  }
136
135
 
@@ -165,13 +164,38 @@ function BaseTable(props) {
165
164
  };
166
165
 
167
166
  var changeScrollY = useThrottle(function () {
167
+ var nextScrollY = scrollY;
168
+
168
169
  if ((scroll === null || scroll === void 0 ? void 0 : scroll.y) === true) {
169
170
  var y = calcScrollY();
170
- setScrollY(y || undefined);
171
+ nextScrollY = y || undefined;
171
172
  } else {
172
- setScrollY(scroll === null || scroll === void 0 ? void 0 : scroll.y);
173
+ nextScrollY = scroll === null || scroll === void 0 ? void 0 : scroll.y;
174
+ }
175
+
176
+ setScrollY(nextScrollY);
177
+
178
+ if (fullTableRef.current !== null) {
179
+ var body = fullTableRef.current.querySelector('.ant-table-body');
180
+
181
+ if (body !== null) {
182
+ var dataType = _typeof(nextScrollY);
183
+
184
+ switch (dataType) {
185
+ case 'string':
186
+ body.style.height = nextScrollY;
187
+ break;
188
+
189
+ case 'number':
190
+ body.style.height = nextScrollY + 'px';
191
+ break;
192
+
193
+ default:
194
+ body.style.height = 'auto';
195
+ }
196
+ }
173
197
  }
174
- }, 80, {
198
+ }, 100, {
175
199
  trailing: true
176
200
  });
177
201
  useEffect(function () {
@@ -279,6 +303,34 @@ function BaseTable(props) {
279
303
  _useMemo2 = _slicedToArray(_useMemo, 2),
280
304
  formatedColumns = _useMemo2[0],
281
305
  flattenColumns = _useMemo2[1];
306
+ /** row actions */
307
+
308
+
309
+ if (rowActions !== undefined && rowActions.length > 0) {
310
+ var actionCol = {
311
+ title: '',
312
+ className: "".concat(PREFIX_CLS, "-table-operator-column"),
313
+ width: 1,
314
+ fixed: 'right',
315
+ render: function render(_, row, index) {
316
+ var _actions$current;
317
+
318
+ return /*#__PURE__*/React.createElement("div", {
319
+ className: "".concat(PREFIX_CLS, "-table-operator")
320
+ }, (_actions$current = actions.current) === null || _actions$current === void 0 ? void 0 : _actions$current.map(function (item) {
321
+ return /*#__PURE__*/React.createElement("button", {
322
+ className: "".concat(PREFIX_CLS, "-table-operator-item"),
323
+ key: item.title,
324
+ onClick: function onClick() {
325
+ item.onClick(row, index);
326
+ }
327
+ }, item.title);
328
+ }));
329
+ }
330
+ };
331
+ formatedColumns.push(actionCol);
332
+ flattenColumns.push(actionCol);
333
+ }
282
334
  /** virtualize scroll */
283
335
 
284
336
 
@@ -341,7 +393,7 @@ function BaseTable(props) {
341
393
  value: ctx
342
394
  }, /*#__PURE__*/React.createElement(AntdTable, _objectSpread(_objectSpread({
343
395
  size: "small",
344
- id: tableID,
396
+ ref: fullTableRef,
345
397
  columns: formatedColumns,
346
398
  dataSource: dataSource,
347
399
  rowKey: rowKey,
@@ -49,6 +49,49 @@
49
49
  color: @text-color;
50
50
  font-size: @font-size-base;
51
51
 
52
+ .ant-table-tbody > tr:hover > td > &-operator {
53
+ display: flex;
54
+ }
55
+
56
+ &-operator {
57
+ position: absolute;
58
+ top: 0;
59
+ right: 0;
60
+ z-index: 10;
61
+ display: none;
62
+ align-items: center;
63
+ justify-content: flex-end;
64
+ height: 100%;
65
+ padding: 0 !important;
66
+ white-space: nowrap;
67
+ background-color: @table-row-hover-bg;
68
+
69
+ &-column::after {
70
+ display: none !important;
71
+ }
72
+
73
+ &-item {
74
+ margin-right: 8px;
75
+ padding: 0 8px;
76
+ color: @primary-color;
77
+ line-height: 28px;
78
+ background-color: transparent;
79
+ border: none;
80
+ border-radius: 4px;
81
+ outline: none;
82
+ cursor: pointer;
83
+ user-select: none;
84
+
85
+ &:hover {
86
+ background-color: .primary(0.12) [];
87
+ }
88
+
89
+ &:active {
90
+ color: .primary(0.8) [];
91
+ }
92
+ }
93
+ }
94
+
52
95
  &-resizable-handle {
53
96
  position: absolute;
54
97
  top: 50%;
@@ -29,4 +29,11 @@ export interface BaseTableProps<T> extends Omit<TableProps<T>, 'columns' | 'scro
29
29
  x?: number | string | true;
30
30
  y?: number | string | true;
31
31
  };
32
+ /**
33
+ * @description 行操作按钮组
34
+ */
35
+ rowActions?: {
36
+ title: string;
37
+ onClick: (row: T, index: number) => void;
38
+ }[];
32
39
  }
@@ -29,18 +29,28 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
29
29
  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; }
30
30
 
31
31
  import React, { useEffect, useMemo, useState } from 'react';
32
- import { Button, Col, Checkbox, Form, Input, Popover, Row, Space, Dropdown, Menu, Modal, message, Select, Empty } from 'antd';
33
- import { EllipsisOutlined, UnorderedListOutlined } from '@ant-design/icons';
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
34
  import { useDebounce, useRequest } from '@lemon-fe/hooks';
35
35
  import Search from '../Icons/Search';
36
36
  import DurationPicker from '../DurationPicker';
37
37
  import FormLayout from '../FormLayout';
38
38
  import { PREFIX_CLS } from '../constants';
39
+ import TabBar from '../TabBar';
39
40
  var components = [{
40
41
  type: 'input',
41
42
  render: function render(item) {
42
43
  return /*#__PURE__*/React.createElement(Input, _objectSpread({}, item.extraProps));
43
44
  }
45
+ }, {
46
+ type: 'input-number',
47
+ render: function render(item) {
48
+ return /*#__PURE__*/React.createElement(InputNumber, _objectSpread({
49
+ style: {
50
+ width: '100%'
51
+ }
52
+ }, item.extraProps));
53
+ }
44
54
  }, {
45
55
  type: 'select',
46
56
  render: function render(item) {
@@ -77,7 +87,8 @@ function Filter(props) {
77
87
  value = props.value,
78
88
  defaultActiveKeys = props.defaultActiveKeys,
79
89
  storageKey = props.storageKey,
80
- onValuesChange = props.onValuesChange;
90
+ onValuesChange = props.onValuesChange,
91
+ style = props.style;
81
92
  var prefixCls = PREFIX_CLS;
82
93
  var defaultValue = useMemo(function () {
83
94
  return defaultValueProp || value;
@@ -337,6 +348,15 @@ function Filter(props) {
337
348
 
338
349
  return data;
339
350
  }, [keywords, data]);
351
+
352
+ var getColStyle = function getColStyle() {
353
+ var colSpan = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
354
+ return {
355
+ width: colSpan * 348,
356
+ padding: '0 8px'
357
+ };
358
+ };
359
+
340
360
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
341
361
  destroyOnClose: true,
342
362
  visible: showModal,
@@ -364,29 +384,16 @@ function Filter(props) {
364
384
  onFinish: handleFinish,
365
385
  form: form,
366
386
  className: "".concat(prefixCls, "-filter"),
367
- onValuesChange: handleValuesChange
368
- }, /*#__PURE__*/React.createElement(Row, {
369
- align: "bottom",
370
- justify: "space-between",
371
- wrap: false,
372
- gutter: [16, 16]
373
- }, /*#__PURE__*/React.createElement(Col, {
374
- flex: 1
375
- }, /*#__PURE__*/React.createElement("div", {
376
- style: {
377
- maxWidth: '1334px'
378
- }
379
- }, /*#__PURE__*/React.createElement("div", {
387
+ onValuesChange: handleValuesChange,
388
+ style: style
389
+ }, /*#__PURE__*/React.createElement(TabBar, {
390
+ tabs: tabs,
391
+ activeKey: tabs[active].title,
392
+ onTabClick: function onTabClick(_, index) {
393
+ return handleTabChange(index);
394
+ },
380
395
  className: "".concat(prefixCls, "-filter-tab-bar")
381
- }, tabs.map(function (item, index) {
382
- return /*#__PURE__*/React.createElement("div", {
383
- className: "".concat(prefixCls, "-filter-tab").concat(active === index ? '-active' : ''),
384
- key: item.title,
385
- onClick: function onClick() {
386
- return handleTabChange(index);
387
- }
388
- }, item.title);
389
- })), /*#__PURE__*/React.createElement(FormLayout, {
396
+ }), /*#__PURE__*/React.createElement(FormLayout, {
390
397
  direction: "row"
391
398
  }, data.map(function (item) {
392
399
  var visible = activeKeys.has(item.key);
@@ -396,18 +403,22 @@ function Filter(props) {
396
403
  return null;
397
404
  }
398
405
 
399
- return /*#__PURE__*/React.createElement(FormLayout.Col, {
400
- span: (item.colSpan || target.colSpan || 1) * 6,
406
+ return /*#__PURE__*/React.createElement("div", {
407
+ style: getColStyle(item.colSpan || target.colSpan),
401
408
  key: item.key
402
409
  }, /*#__PURE__*/React.createElement(Form.Item, {
403
410
  key: item.key,
404
411
  name: item.key,
405
412
  label: item.hideLabel ? undefined : item.label
406
413
  }, target.render(item)));
407
- })))), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
408
- type: "primary",
409
- htmlType: "submit"
410
- }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Dropdown, {
414
+ }), /*#__PURE__*/React.createElement("div", {
415
+ style: getColStyle()
416
+ }, /*#__PURE__*/React.createElement(Form.Item, {
417
+ label: /*#__PURE__*/React.createElement(Button, {
418
+ type: "primary",
419
+ htmlType: "submit"
420
+ }, "\u67E5\u8BE2")
421
+ }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Dropdown, {
411
422
  placement: "bottomRight",
412
423
  overlay: /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, {
413
424
  key: "reset",
@@ -456,13 +467,64 @@ function Filter(props) {
456
467
  }))),
457
468
  placement: "bottomRight"
458
469
  }, /*#__PURE__*/React.createElement(Button, {
459
- style: {
460
- padding: '4px 8px'
461
- },
470
+ className: "".concat(prefixCls, "-filter-btn"),
462
471
  onClick: function onClick() {
463
472
  setKeywords('');
464
473
  }
465
- }, /*#__PURE__*/React.createElement(UnorderedListOutlined, null))))))));
474
+ }, /*#__PURE__*/React.createElement("svg", {
475
+ width: "18",
476
+ height: "18",
477
+ viewBox: "0 0 18 18",
478
+ xmlns: "http://www.w3.org/2000/svg"
479
+ }, /*#__PURE__*/React.createElement("g", {
480
+ transform: "translate(2 2)",
481
+ fill: "none",
482
+ fillRule: "evenodd"
483
+ }, /*#__PURE__*/React.createElement("rect", {
484
+ fillOpacity: ".65",
485
+ fill: "currentColor",
486
+ y: "4",
487
+ width: "14",
488
+ height: "1.5",
489
+ rx: ".75"
490
+ }), /*#__PURE__*/React.createElement("rect", {
491
+ fillOpacity: ".65",
492
+ fill: "currentColor",
493
+ y: "8",
494
+ width: "6",
495
+ height: "1.5",
496
+ rx: ".75"
497
+ }), /*#__PURE__*/React.createElement("rect", {
498
+ fillOpacity: ".65",
499
+ fill: "currentColor",
500
+ y: "12",
501
+ width: "6",
502
+ height: "1.5",
503
+ rx: ".75"
504
+ }), /*#__PURE__*/React.createElement("rect", {
505
+ fillOpacity: ".65",
506
+ fill: "currentColor",
507
+ width: "14",
508
+ height: "1.5",
509
+ rx: ".75"
510
+ }), /*#__PURE__*/React.createElement("g", {
511
+ transform: "rotate(-45 15.45 -2.157)"
512
+ }, /*#__PURE__*/React.createElement("circle", {
513
+ strokeOpacity: ".65",
514
+ stroke: "currentColor",
515
+ strokeWidth: "1.5",
516
+ cx: "3",
517
+ cy: "3",
518
+ r: "2.25"
519
+ }), /*#__PURE__*/React.createElement("rect", {
520
+ strokeOpacity: ".65",
521
+ stroke: "currentColor",
522
+ x: "2.75",
523
+ y: "5.5",
524
+ width: "1",
525
+ height: "2",
526
+ rx: ".5"
527
+ }))))))))))));
466
528
  }
467
529
 
468
530
  Filter.setComponents = setComponents;
@@ -6,14 +6,7 @@
6
6
  cursor: pointer;
7
7
 
8
8
  &-bar {
9
- display: flex;
10
- height: 25px;
11
9
  margin-bottom: 16px;
12
- line-height: 1;
13
-
14
- & > div + div {
15
- margin-left: 32px;
16
- }
17
10
  }
18
11
 
19
12
  &-active {
@@ -34,8 +27,19 @@
34
27
  }
35
28
  }
36
29
 
30
+ &-btn {
31
+ padding: 6px;
32
+
33
+ & > svg {
34
+ display: block;
35
+ width: 18px;
36
+ height: 18px;
37
+ }
38
+ }
39
+
37
40
  &-popover {
38
41
  width: 227px;
42
+ padding-top: 0;
39
43
 
40
44
  .ant-popover-arrow {
41
45
  display: none;
@@ -1,5 +1,5 @@
1
- import { FormInstance } from 'antd';
2
- import { ReactNode } from 'react';
1
+ import type { FormInstance } from 'antd';
2
+ import type { CSSProperties, ReactNode } from 'react';
3
3
 
4
4
  export interface FilterItemType {
5
5
  key: string;
@@ -18,6 +18,7 @@ export interface FilterProps<T extends Record<string, any> = Record<string, any>
18
18
  onValuesChange?: (changedValues: Partial<T>, allValues: T, form: FormInstance<T>) => void;
19
19
  defaultActiveKeys?: string[];
20
20
  storageKey?: string;
21
+ style?: CSSProperties;
21
22
  }
22
23
 
23
24
  export interface ComponentOption {
package/es/Icons/Down.js CHANGED
@@ -9,14 +9,20 @@ import Icon from '@ant-design/icons';
9
9
 
10
10
  var DownSvg = function DownSvg(props) {
11
11
  return /*#__PURE__*/React.createElement("svg", _objectSpread({
12
- width: "1em",
13
- height: "1em",
12
+ width: "16",
13
+ height: "16",
14
14
  viewBox: "0 0 16 16",
15
15
  xmlns: "http://www.w3.org/2000/svg"
16
16
  }, props), /*#__PURE__*/React.createElement("path", {
17
- d: "M4.707 5.293L3.293 6.707 8 11.414l4.707-4.707-1.414-1.414L8 8.586z",
18
- fill: "currentColor",
19
- fillRule: "nonzero"
17
+ d: "M3.757 5.757 8 10l4.243-4.243",
18
+ stroke: "currentColor",
19
+ strokeWidth: "1.5",
20
+ opacity: ".7",
21
+ strokeLinecap: "round",
22
+ strokeLinejoin: "round",
23
+ strokeDasharray: "0,0",
24
+ fill: "none",
25
+ fillRule: "evenodd"
20
26
  }));
21
27
  };
22
28