linkmore-design 1.0.42 → 1.0.43
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/dist/CustomTableOption/index.d.ts +2 -1
- package/dist/index.umd.js +15 -5
- package/dist/index.umd.min.js +2 -2
- package/es/CkFilter/baseFilter/index.js +9 -2
- package/es/CustomTableOption/index.d.ts +2 -1
- package/es/CustomTableOption/index.js +7 -3
- package/es/IconFont/font/iconfont.css +23 -15
- package/es/IconFont/font/iconfont.js +6 -6
- package/es/IconFont/font/iconfont.ttf +0 -0
- package/es/IconFont/font/iconfont.woff +0 -0
- package/es/IconFont/font/iconfont.woff2 +0 -0
- package/lib/CkFilter/baseFilter/index.js +9 -2
- package/lib/CustomTableOption/index.d.ts +2 -1
- package/lib/CustomTableOption/index.js +9 -3
- package/lib/IconFont/font/iconfont.css +23 -15
- package/lib/IconFont/font/iconfont.js +6 -6
- package/lib/IconFont/font/iconfont.ttf +0 -0
- package/lib/IconFont/font/iconfont.woff +0 -0
- package/lib/IconFont/font/iconfont.woff2 +0 -0
- package/package.json +1 -1
|
@@ -55,6 +55,13 @@ var Filter = function Filter() {
|
|
|
55
55
|
visibleFields = state.visibleFields,
|
|
56
56
|
orderFields = state.orderFields,
|
|
57
57
|
customFilterValues = state.customFilterValues;
|
|
58
|
+
var hasClear = (0, _react.useMemo)(function () {
|
|
59
|
+
var _Object$keys;
|
|
60
|
+
|
|
61
|
+
var obj = (0, _objectSpread2.default)({}, filterValues);
|
|
62
|
+
delete obj[searchKey];
|
|
63
|
+
return ((_Object$keys = Object.keys(obj)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) || false;
|
|
64
|
+
}, [filterValues]);
|
|
58
65
|
|
|
59
66
|
var handleFilter = function handleFilter(val) {
|
|
60
67
|
var nValue = (0, _objectSpread2.default)({}, filterValues);
|
|
@@ -84,7 +91,7 @@ var Filter = function Filter() {
|
|
|
84
91
|
|
|
85
92
|
dispatch({
|
|
86
93
|
type: 'changeFilterValues',
|
|
87
|
-
filterValues: {}
|
|
94
|
+
filterValues: (0, _defineProperty2.default)({}, searchKey, filterValues[searchKey])
|
|
88
95
|
});
|
|
89
96
|
onChange === null || onChange === void 0 ? void 0 : onChange((0, _defineProperty2.default)({}, searchKey, filterValues[searchKey]), customFilterValues);
|
|
90
97
|
};
|
|
@@ -105,7 +112,7 @@ var Filter = function Filter() {
|
|
|
105
112
|
return /*#__PURE__*/_react.default.createElement(_filterMenu.default, (0, _extends2.default)({
|
|
106
113
|
key: v.field
|
|
107
114
|
}, v));
|
|
108
|
-
}), /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
115
|
+
}), hasClear && /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
|
|
109
116
|
type: "link",
|
|
110
117
|
onClick: handleClear
|
|
111
118
|
}, "\u4E00\u952E\u6E05\u7A7A")), /*#__PURE__*/_react.default.createElement(_NestedFilter.default, null));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TableProps } from 'antd';
|
|
2
|
+
import { TableProps, TooltipProps } from 'antd';
|
|
3
3
|
export interface ICustomTableOptionProps {
|
|
4
4
|
className?: string;
|
|
5
5
|
style?: React.CSSProperties;
|
|
6
6
|
size?: 'small' | 'default' | 'middle';
|
|
7
|
+
tooltip?: TooltipProps;
|
|
7
8
|
filter?: Record<string, any>[];
|
|
8
9
|
columns?: TableProps<any>['columns'];
|
|
9
10
|
onSave?: (data: any) => void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "antd/es/tooltip/style";
|
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
|
1
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
4
|
import React, { forwardRef, useState, useEffect, useRef } from 'react';
|
|
3
5
|
import { Drawer, Tabs, Radio, IconFont, Space, Button, Switch } from 'linkmore-design';
|
|
@@ -27,7 +29,9 @@ var optionsWithDisabled = [{
|
|
|
27
29
|
}];
|
|
28
30
|
var prefixCls = 'lm_custom-table-option';
|
|
29
31
|
var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
|
-
var className = props.className
|
|
32
|
+
var className = props.className,
|
|
33
|
+
_props$tooltip = props.tooltip,
|
|
34
|
+
tooltip = _props$tooltip === void 0 ? {} : _props$tooltip;
|
|
31
35
|
var filterRef = useRef(null);
|
|
32
36
|
var columnsRef = useRef(null); // const sizeRef = useRef(null)
|
|
33
37
|
|
|
@@ -88,12 +92,12 @@ var LMCustomTableOption = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
88
92
|
setVisible(false);
|
|
89
93
|
};
|
|
90
94
|
|
|
91
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
95
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Tooltip, Object.assign({}, tooltip), /*#__PURE__*/React.createElement(Button, {
|
|
92
96
|
onClick: openSetting,
|
|
93
97
|
icon: /*#__PURE__*/React.createElement(IconFont, {
|
|
94
98
|
type: 'lmweb-setting'
|
|
95
99
|
})
|
|
96
|
-
}), /*#__PURE__*/React.createElement(Drawer, {
|
|
100
|
+
})), /*#__PURE__*/React.createElement(Drawer, {
|
|
97
101
|
className: classNames(className, prefixCls),
|
|
98
102
|
title: "\u7B5B\u9009\u8BBE\u7F6E",
|
|
99
103
|
visible: visible,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "iconfont"; /* Project id 2966019 */
|
|
3
|
-
src: url('iconfont.woff2?t=
|
|
4
|
-
url('iconfont.woff?t=
|
|
5
|
-
url('iconfont.ttf?t=
|
|
3
|
+
src: url('iconfont.woff2?t=1659434868739') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1659434868739') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1659434868739') format('truetype');
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.iconfont {
|
|
@@ -13,6 +13,26 @@
|
|
|
13
13
|
-moz-osx-font-smoothing: grayscale;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
.lmweb-icon_china1:before {
|
|
17
|
+
content: "\e6c9";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.lmweb-icon_English1:before {
|
|
21
|
+
content: "\e6ca";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.lmweb-icon_fan1:before {
|
|
25
|
+
content: "\e6cb";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.lmweb-icon_application_light:before {
|
|
29
|
+
content: "\e6c7";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.lmweb-icon_application:before {
|
|
33
|
+
content: "\e6c8";
|
|
34
|
+
}
|
|
35
|
+
|
|
16
36
|
.lmweb-icon-m-receipt:before {
|
|
17
37
|
content: "\e6c6";
|
|
18
38
|
}
|
|
@@ -89,18 +109,6 @@
|
|
|
89
109
|
content: "\e6b9";
|
|
90
110
|
}
|
|
91
111
|
|
|
92
|
-
.lmweb-icon_fan:before {
|
|
93
|
-
content: "\e6b3";
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.lmweb-icon_china:before {
|
|
97
|
-
content: "\e6b1";
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.lmweb-icon_English:before {
|
|
101
|
-
content: "\e6b2";
|
|
102
|
-
}
|
|
103
|
-
|
|
104
112
|
.lmweb-icon_deliver_light:before {
|
|
105
113
|
content: "\e6ac";
|
|
106
114
|
}
|