@arim-aisdc/public-components 2.3.8 → 2.3.11
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/assets/iconfont/public/iconfont.css +69 -69
- package/dist/components/CustomForm/CustomForm.js +7 -4
- package/dist/components/CustomForm/type.d.ts +5 -2
- package/dist/components/QueryFilter/RemoteSelectCom/index.js +1 -1
- package/dist/components/TableMax/TableBody/Row.js +4 -4
- package/dist/components/TableMax/TableHeader/index.less +2 -2
- package/dist/components/TableMax/TableMax.js +5 -4
- package/dist/components/TableMax/components/ColumnFilterV2/Filter.js +6 -4
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.d.ts +2 -2
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.js +7 -7
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.less +3 -3
- package/dist/components/TableMax/components/ColumnFilterV2/SingleSelect/index.d.ts +2 -2
- package/dist/components/TableMax/components/ColumnFilterV2/SingleSelect/index.js +7 -7
- package/dist/components/TableMax/components/ColumnFilterV2/SingleSelect/index.less +3 -3
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/components/ColumnSort/index.less +4 -4
- package/dist/components/TableMax/type.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: "iconfont-public"; /* Project id 4386651 */
|
|
3
|
-
src: url('./iconfont.ttf?t=1730099749830') format('truetype');
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.iconfont-public {
|
|
7
|
-
font-family: "iconfont-public" !important;
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
font-style: normal;
|
|
10
|
-
-webkit-font-smoothing: antialiased;
|
|
11
|
-
-moz-osx-font-smoothing: grayscale;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.icon-public-guanbiqita:before {
|
|
15
|
-
content: "\e6db";
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.icon-public-shuaxinbiaoqian:before {
|
|
19
|
-
content: "\e6dc";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.icon-public-guanbibiaoqian:before {
|
|
23
|
-
content: "\e6dd";
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.icon-public-upload:before {
|
|
27
|
-
content: "\e877";
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.icon-public-download:before {
|
|
31
|
-
content: "\e878";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.icon-public-refresh:before {
|
|
35
|
-
content: "\e7c1";
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.icon-public-edit:before {
|
|
39
|
-
content: "\e7c2";
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.icon-public-calendar:before {
|
|
43
|
-
content: "\e7c3";
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.icon-public-reduce:before {
|
|
47
|
-
content: "\e7c4";
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.icon-public-setting:before {
|
|
51
|
-
content: "\e7bc";
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.icon-public-delete:before {
|
|
55
|
-
content: "\e7bd";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.icon-public-drag:before {
|
|
59
|
-
content: "\e7be";
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.icon-public-down:before {
|
|
63
|
-
content: "\e7bf";
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.icon-public-pin:before {
|
|
67
|
-
content: "\e7c0";
|
|
68
|
-
}
|
|
69
|
-
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "iconfont-public"; /* Project id 4386651 */
|
|
3
|
+
src: url('./iconfont.ttf?t=1730099749830') format('truetype');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.iconfont-public {
|
|
7
|
+
font-family: "iconfont-public" !important;
|
|
8
|
+
font-size: 16px;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.icon-public-guanbiqita:before {
|
|
15
|
+
content: "\e6db";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon-public-shuaxinbiaoqian:before {
|
|
19
|
+
content: "\e6dc";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.icon-public-guanbibiaoqian:before {
|
|
23
|
+
content: "\e6dd";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.icon-public-upload:before {
|
|
27
|
+
content: "\e877";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.icon-public-download:before {
|
|
31
|
+
content: "\e878";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.icon-public-refresh:before {
|
|
35
|
+
content: "\e7c1";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.icon-public-edit:before {
|
|
39
|
+
content: "\e7c2";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.icon-public-calendar:before {
|
|
43
|
+
content: "\e7c3";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon-public-reduce:before {
|
|
47
|
+
content: "\e7c4";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon-public-setting:before {
|
|
51
|
+
content: "\e7bc";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.icon-public-delete:before {
|
|
55
|
+
content: "\e7bd";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.icon-public-drag:before {
|
|
59
|
+
content: "\e7be";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.icon-public-down:before {
|
|
63
|
+
content: "\e7bf";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.icon-public-pin:before {
|
|
67
|
+
content: "\e7c0";
|
|
68
|
+
}
|
|
69
|
+
|
|
@@ -252,7 +252,9 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
252
252
|
handleInputClear === null || handleInputClear === void 0 || handleInputClear();
|
|
253
253
|
}
|
|
254
254
|
run(e, item);
|
|
255
|
-
}
|
|
255
|
+
},
|
|
256
|
+
maxLength: item.maxLength,
|
|
257
|
+
showCount: item.maxLength ? true : false
|
|
256
258
|
});
|
|
257
259
|
break;
|
|
258
260
|
case CustomFormItemType.TextArea:
|
|
@@ -415,9 +417,9 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
415
417
|
onChange: function onChange(e) {
|
|
416
418
|
commonChange(e, item);
|
|
417
419
|
},
|
|
418
|
-
disabled: item === null || item === void 0 ? void 0 : item.disabled
|
|
419
|
-
|
|
420
|
-
,
|
|
420
|
+
disabled: item === null || item === void 0 ? void 0 : item.disabled,
|
|
421
|
+
disabledDate: item === null || item === void 0 ? void 0 : item.disabledDate,
|
|
422
|
+
disabledTime: item === null || item === void 0 ? void 0 : item.disabledTime,
|
|
421
423
|
suffixIcon: /*#__PURE__*/_jsx("i", {
|
|
422
424
|
className: "iconfont-other icon-other-calendar"
|
|
423
425
|
}),
|
|
@@ -447,6 +449,7 @@ var CustomForm = function CustomForm(_ref, ref) {
|
|
|
447
449
|
placeholder: [item.inputTips, item.inputTips],
|
|
448
450
|
picker: item === null || item === void 0 ? void 0 : item.picker,
|
|
449
451
|
disabledDate: item === null || item === void 0 ? void 0 : item.disabledDate,
|
|
452
|
+
disabledTime: item === null || item === void 0 ? void 0 : item.disabledTime,
|
|
450
453
|
allowClear: item.allowClear === false ? false : true,
|
|
451
454
|
presets: item === null || item === void 0 ? void 0 : item.presets
|
|
452
455
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { TimePickerProps, TimeRangePickerProps } from 'antd';
|
|
2
|
-
import { FormProps } from 'antd';
|
|
1
|
+
import type { TimePickerProps, TimeRangePickerProps, GetProps } from 'antd';
|
|
2
|
+
import { FormProps, DatePicker } from 'antd';
|
|
3
3
|
import { FormLabelAlign } from 'antd/es/form/interface';
|
|
4
4
|
import { MouseEventHandler, ReactNode } from 'react';
|
|
5
|
+
type RangePickerProps = GetProps<typeof DatePicker.RangePicker>;
|
|
5
6
|
export interface fieldType {
|
|
6
7
|
field: string;
|
|
7
8
|
label?: string;
|
|
@@ -79,6 +80,8 @@ export type CustomSearchFieldType = {
|
|
|
79
80
|
allowClear?: boolean;
|
|
80
81
|
isShowInterval?: boolean;
|
|
81
82
|
disabled?: boolean;
|
|
83
|
+
disabledDate?: RangePickerProps['disabledDate'];
|
|
84
|
+
disabledTime?: RangePickerProps['disabledTime'];
|
|
82
85
|
min?: number;
|
|
83
86
|
max?: number;
|
|
84
87
|
step?: number;
|
|
@@ -51,7 +51,7 @@ var RemoteSelect = function RemoteSelect(_ref) {
|
|
|
51
51
|
return /*#__PURE__*/_jsx(Select, {
|
|
52
52
|
className: "queryFilter-remoteSelect",
|
|
53
53
|
mode: item.mode ? item.mode : undefined,
|
|
54
|
-
showSearch: item.showSearch,
|
|
54
|
+
showSearch: !!item.showSearch,
|
|
55
55
|
placeholder: item.inputTips,
|
|
56
56
|
allowClear: item.allowClear,
|
|
57
57
|
value: value,
|
|
@@ -287,12 +287,12 @@ var Row = function Row(_ref) {
|
|
|
287
287
|
return 'tbody-tr-highlight';
|
|
288
288
|
} else if (canSelection) {
|
|
289
289
|
// 多选
|
|
290
|
-
if (row.
|
|
291
|
-
// checked选中用选中色
|
|
292
|
-
return 'tbody-tr-selected';
|
|
293
|
-
} else if (String(row.id) === String(rowHighLightId)) {
|
|
290
|
+
if (String(row.id) === String(rowHighLightId)) {
|
|
294
291
|
// 高亮状态
|
|
295
292
|
return 'tbody-tr-highlight';
|
|
293
|
+
} else if (row.getIsSelected()) {
|
|
294
|
+
// checked选中用选中色
|
|
295
|
+
return 'tbody-tr-selected';
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
return '';
|
|
@@ -59,7 +59,7 @@ table {
|
|
|
59
59
|
|
|
60
60
|
.cell-right {
|
|
61
61
|
display: flex;
|
|
62
|
-
gap: 4px;
|
|
62
|
+
// gap: 4px;
|
|
63
63
|
align-items: center;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -105,7 +105,7 @@ table {
|
|
|
105
105
|
|
|
106
106
|
&:hover {
|
|
107
107
|
.sort-flag {
|
|
108
|
-
display:
|
|
108
|
+
display: flex;
|
|
109
109
|
}
|
|
110
110
|
.filter-icon {
|
|
111
111
|
display: inline-block;
|
|
@@ -845,23 +845,24 @@ var TableMax = function TableMax(_ref) {
|
|
|
845
845
|
// 是否可点击编辑按钮:当且仅当选中一行时可点击编辑按钮
|
|
846
846
|
var canClickEditIcon = useMemo(function () {
|
|
847
847
|
var rowObjs = table.getSelectedRowModel().rows;
|
|
848
|
-
return !!rowSelectedId || rowObjs.length
|
|
848
|
+
return !!rowSelectedId || rowObjs.length > 0;
|
|
849
849
|
}, [rowSelectedId, rowSelection]);
|
|
850
850
|
|
|
851
851
|
// 点击【编辑】图标
|
|
852
852
|
var editFun = function editFun() {
|
|
853
|
-
var _selectedTableRows
|
|
853
|
+
var _selectedTableRows, _tableRows$find, _selectedTableRows2;
|
|
854
854
|
if (!canClickEditIcon) return;
|
|
855
855
|
var selectedTableRows = table.getSelectedRowModel().rows;
|
|
856
|
+
var selectedTableRowsLength = selectedTableRows.length;
|
|
856
857
|
var _table$getRowModel2 = table.getRowModel(),
|
|
857
858
|
tableRows = _table$getRowModel2.rows;
|
|
858
859
|
var selectRow =
|
|
859
860
|
// eslint-disable-next-line eqeqeq
|
|
860
|
-
(canSelection ? (_selectedTableRows
|
|
861
|
+
(canSelection ? (_selectedTableRows = selectedTableRows[selectedTableRowsLength - 1]) === null || _selectedTableRows === void 0 ? void 0 : _selectedTableRows.original : (_tableRows$find = tableRows.find(function (item) {
|
|
861
862
|
return item.id == rowSelectedId;
|
|
862
863
|
})) === null || _tableRows$find === void 0 ? void 0 : _tableRows$find.original) || {};
|
|
863
864
|
setFormData(selectRow);
|
|
864
|
-
setEditingRowId((canSelection ? (
|
|
865
|
+
setEditingRowId((canSelection ? (_selectedTableRows2 = selectedTableRows[selectedTableRowsLength - 1]) === null || _selectedTableRows2 === void 0 ? void 0 : _selectedTableRows2.id : rowSelectedId) || '');
|
|
865
866
|
};
|
|
866
867
|
|
|
867
868
|
// 点击【取消编辑】按钮
|
|
@@ -8,6 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
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; }
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import { useTranslation } from "../../../../hooks/useTranslation";
|
|
11
12
|
import { AutoComplete, DatePicker, Input, InputNumber } from 'antd';
|
|
12
13
|
import dayjs from 'dayjs';
|
|
13
14
|
import { debounce } from 'lodash';
|
|
@@ -17,7 +18,6 @@ import { DateRange } from "./DateRange";
|
|
|
17
18
|
import MultipleSelect from "./MultipleSelect";
|
|
18
19
|
import NumberRange from "./NumberRange";
|
|
19
20
|
import SingleSelect from "./SingleSelect";
|
|
20
|
-
import { useTranslation } from "../../../../hooks/useTranslation";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
var Filter = function Filter(_ref) {
|
|
23
23
|
var column = _ref.column,
|
|
@@ -27,7 +27,9 @@ var Filter = function Filter(_ref) {
|
|
|
27
27
|
// 筛选组件类型
|
|
28
28
|
var filterType = columnDef.filterType,
|
|
29
29
|
filterOptions = columnDef.filterOptions,
|
|
30
|
-
getFilterOptionsFn = columnDef.getFilterOptionsFn
|
|
30
|
+
getFilterOptionsFn = columnDef.getFilterOptionsFn,
|
|
31
|
+
_columnDef$isFilterOp = columnDef.isFilterOptionsFrontSearch,
|
|
32
|
+
isFilterOptionsFrontSearch = _columnDef$isFilterOp === void 0 ? false : _columnDef$isFilterOp;
|
|
31
33
|
|
|
32
34
|
// 获取最新的筛选值
|
|
33
35
|
var _useState = useState(column.getFilterValue()),
|
|
@@ -254,7 +256,7 @@ var Filter = function Filter(_ref) {
|
|
|
254
256
|
onChange: handleChangeFilterValue,
|
|
255
257
|
onSearch: onSearch,
|
|
256
258
|
options: options,
|
|
257
|
-
|
|
259
|
+
isFrontSearch: isFilterOptionsFrontSearch,
|
|
258
260
|
onCloseFilterPanel: onCloseFilterPanel,
|
|
259
261
|
loading: apiLoading
|
|
260
262
|
});
|
|
@@ -266,7 +268,7 @@ var Filter = function Filter(_ref) {
|
|
|
266
268
|
onSearch: onSearch,
|
|
267
269
|
options: options,
|
|
268
270
|
loading: apiLoading,
|
|
269
|
-
|
|
271
|
+
isFrontSearch: isFilterOptionsFrontSearch,
|
|
270
272
|
onCloseFilterPanel: onCloseFilterPanel
|
|
271
273
|
});
|
|
272
274
|
}
|
|
@@ -4,9 +4,9 @@ interface IProps {
|
|
|
4
4
|
options: any[];
|
|
5
5
|
onChange: (value: any[]) => void;
|
|
6
6
|
onSearch: (value: string) => void;
|
|
7
|
-
|
|
7
|
+
isFrontSearch: boolean;
|
|
8
8
|
loading: boolean;
|
|
9
9
|
onCloseFilterPanel: () => void;
|
|
10
10
|
}
|
|
11
|
-
declare const MultipleSelect: ({ value, onChange, options, onSearch,
|
|
11
|
+
declare const MultipleSelect: ({ value, onChange, options, onSearch, isFrontSearch, loading, onCloseFilterPanel, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default MultipleSelect;
|
|
@@ -4,11 +4,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
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; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useTranslation } from "../../../../../hooks/useTranslation";
|
|
7
8
|
import { useUpdateEffect } from 'ahooks';
|
|
8
9
|
import { Button, Checkbox, Input, Spin } from 'antd';
|
|
9
10
|
import { useMemo, useState } from 'react';
|
|
10
11
|
import "./index.less";
|
|
11
|
-
import { useTranslation } from "../../../../../hooks/useTranslation";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -19,7 +19,7 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
19
19
|
onChange = _ref.onChange,
|
|
20
20
|
options = _ref.options,
|
|
21
21
|
onSearch = _ref.onSearch,
|
|
22
|
-
|
|
22
|
+
isFrontSearch = _ref.isFrontSearch,
|
|
23
23
|
loading = _ref.loading,
|
|
24
24
|
onCloseFilterPanel = _ref.onCloseFilterPanel;
|
|
25
25
|
// 内部state
|
|
@@ -67,7 +67,7 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
67
67
|
};
|
|
68
68
|
var handleInputChange = function handleInputChange(e) {
|
|
69
69
|
var value = e.target.value;
|
|
70
|
-
if (
|
|
70
|
+
if (!isFrontSearch) {
|
|
71
71
|
onSearch(value);
|
|
72
72
|
} else {
|
|
73
73
|
setFrontendSearchValue(value);
|
|
@@ -76,7 +76,7 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
76
76
|
|
|
77
77
|
// 最终的可选值
|
|
78
78
|
var finalOptions = useMemo(function () {
|
|
79
|
-
if (
|
|
79
|
+
if (!isFrontSearch) {
|
|
80
80
|
return options;
|
|
81
81
|
}
|
|
82
82
|
var input = (frontendSearchValue !== null && frontendSearchValue !== void 0 ? frontendSearchValue : '').toUpperCase().trim();
|
|
@@ -89,13 +89,13 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
89
89
|
return /*#__PURE__*/_jsxs("div", {
|
|
90
90
|
className: "tableMax-filter-multipleSelect",
|
|
91
91
|
children: [/*#__PURE__*/_jsx("div", {
|
|
92
|
-
className: "header",
|
|
92
|
+
className: "tableMax-filter-multipleSelect-header",
|
|
93
93
|
children: /*#__PURE__*/_jsx(Input, {
|
|
94
94
|
placeholder: t('global.placeholder.input'),
|
|
95
95
|
onChange: handleInputChange
|
|
96
96
|
})
|
|
97
97
|
}), /*#__PURE__*/_jsx("div", {
|
|
98
|
-
className: "body",
|
|
98
|
+
className: "tableMax-filter-multipleSelect-body",
|
|
99
99
|
children: loading ? /*#__PURE__*/_jsx("div", {
|
|
100
100
|
className: "loading",
|
|
101
101
|
children: /*#__PURE__*/_jsx(Spin, {})
|
|
@@ -112,7 +112,7 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
112
112
|
})]
|
|
113
113
|
})
|
|
114
114
|
}), /*#__PURE__*/_jsxs("div", {
|
|
115
|
-
className: "footer",
|
|
115
|
+
className: "tableMax-filter-multipleSelect-footer",
|
|
116
116
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
117
117
|
type: "text",
|
|
118
118
|
onClick: handleReset,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.tableMax-filter-multipleSelect {
|
|
2
2
|
width: 212px;
|
|
3
|
-
.header {
|
|
3
|
+
.tableMax-filter-multipleSelect-header {
|
|
4
4
|
border-bottom: 1px solid @tableColor7;
|
|
5
5
|
padding: 8px 12px;
|
|
6
6
|
}
|
|
7
|
-
.body {
|
|
7
|
+
.tableMax-filter-multipleSelect-body {
|
|
8
8
|
height: 220px;
|
|
9
9
|
overflow-y: auto;
|
|
10
10
|
padding: 4px 12px;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
.footer {
|
|
26
|
+
.tableMax-filter-multipleSelect-footer {
|
|
27
27
|
border-top: 1px solid @tableColor7;
|
|
28
28
|
padding: 8px 12px;
|
|
29
29
|
display: flex;
|
|
@@ -4,9 +4,9 @@ interface IProps {
|
|
|
4
4
|
options: any[];
|
|
5
5
|
onChange: (value: string | number | undefined) => void;
|
|
6
6
|
onSearch: (value: string) => void;
|
|
7
|
-
|
|
7
|
+
isFrontSearch: boolean;
|
|
8
8
|
loading: boolean;
|
|
9
9
|
onCloseFilterPanel: () => void;
|
|
10
10
|
}
|
|
11
|
-
declare const SingleSelect: ({ value, onChange, options, onSearch,
|
|
11
|
+
declare const SingleSelect: ({ value, onChange, options, onSearch, isFrontSearch, loading, onCloseFilterPanel, }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default SingleSelect;
|
|
@@ -4,11 +4,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
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; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useTranslation } from "../../../../../hooks/useTranslation";
|
|
7
8
|
import { useUpdateEffect } from 'ahooks';
|
|
8
9
|
import { Button, Input, Spin } from 'antd';
|
|
9
10
|
import { useMemo, useState } from 'react';
|
|
10
11
|
import "./index.less";
|
|
11
|
-
import { useTranslation } from "../../../../../hooks/useTranslation";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
var SingleSelect = function SingleSelect(_ref) {
|
|
@@ -17,7 +17,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
17
17
|
onChange = _ref.onChange,
|
|
18
18
|
options = _ref.options,
|
|
19
19
|
onSearch = _ref.onSearch,
|
|
20
|
-
|
|
20
|
+
isFrontSearch = _ref.isFrontSearch,
|
|
21
21
|
loading = _ref.loading,
|
|
22
22
|
onCloseFilterPanel = _ref.onCloseFilterPanel;
|
|
23
23
|
// 内部state
|
|
@@ -52,7 +52,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
52
52
|
}, [value]);
|
|
53
53
|
var handleInputChange = function handleInputChange(e) {
|
|
54
54
|
var value = e.target.value;
|
|
55
|
-
if (
|
|
55
|
+
if (!isFrontSearch) {
|
|
56
56
|
onSearch(value);
|
|
57
57
|
} else {
|
|
58
58
|
setFrontendSearchValue(value);
|
|
@@ -61,7 +61,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
61
61
|
|
|
62
62
|
// 最终的可选值
|
|
63
63
|
var finalOptions = useMemo(function () {
|
|
64
|
-
if (
|
|
64
|
+
if (!isFrontSearch) {
|
|
65
65
|
return options;
|
|
66
66
|
}
|
|
67
67
|
var input = (frontendSearchValue !== null && frontendSearchValue !== void 0 ? frontendSearchValue : '').toUpperCase().trim();
|
|
@@ -74,13 +74,13 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
74
74
|
return /*#__PURE__*/_jsxs("div", {
|
|
75
75
|
className: "tableMax-filter-singleSelect",
|
|
76
76
|
children: [/*#__PURE__*/_jsx("div", {
|
|
77
|
-
className: "header",
|
|
77
|
+
className: "tableMax-filter-singleSelect-header",
|
|
78
78
|
children: /*#__PURE__*/_jsx(Input, {
|
|
79
79
|
placeholder: t('global.placeholder.input'),
|
|
80
80
|
onChange: handleInputChange
|
|
81
81
|
})
|
|
82
82
|
}), /*#__PURE__*/_jsx("div", {
|
|
83
|
-
className: "body",
|
|
83
|
+
className: "tableMax-filter-singleSelect-body",
|
|
84
84
|
children: loading ? /*#__PURE__*/_jsx("div", {
|
|
85
85
|
className: "loading",
|
|
86
86
|
children: /*#__PURE__*/_jsx(Spin, {})
|
|
@@ -95,7 +95,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
95
95
|
}, option.value);
|
|
96
96
|
})
|
|
97
97
|
}), /*#__PURE__*/_jsxs("div", {
|
|
98
|
-
className: "footer",
|
|
98
|
+
className: "tableMax-filter-singleSelect-footer",
|
|
99
99
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
100
100
|
type: "text",
|
|
101
101
|
onClick: handleReset,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
.tableMax-filter-singleSelect {
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
width: 212px;
|
|
4
|
-
.header {
|
|
4
|
+
.tableMax-filter-singleSelect-header {
|
|
5
5
|
border-bottom: 1px solid @tableColor7;
|
|
6
6
|
padding: 8px 12px;
|
|
7
7
|
}
|
|
8
|
-
.body {
|
|
8
|
+
.tableMax-filter-singleSelect-body {
|
|
9
9
|
height: 220px;
|
|
10
10
|
overflow-y: auto;
|
|
11
11
|
padding: 4px 12px;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
background-color: @tableColor8;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
.footer {
|
|
37
|
+
.tableMax-filter-singleSelect-footer {
|
|
38
38
|
border-top: 1px solid @tableColor7;
|
|
39
39
|
padding: 8px 12px;
|
|
40
40
|
display: flex;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.sort-flag {
|
|
2
|
-
display: flex;
|
|
3
2
|
justify-content: center;
|
|
4
3
|
align-items: center;
|
|
5
4
|
flex-direction: column;
|
|
6
5
|
width: 16px;
|
|
6
|
+
height: 16px;
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
display: none;
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
height: 0;
|
|
14
14
|
border-left: 4px solid transparent;
|
|
15
15
|
border-right: 4px solid transparent;
|
|
16
|
-
border-bottom: 6px solid #
|
|
16
|
+
border-bottom: 6px solid #fff;
|
|
17
17
|
|
|
18
18
|
&-red {
|
|
19
19
|
border-bottom: 6px solid #fa541cff;
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
margin-top: 3px;
|
|
28
28
|
border-left: 4px solid transparent;
|
|
29
29
|
border-right: 4px solid transparent;
|
|
30
|
-
border-top: 6px solid #
|
|
30
|
+
border-top: 6px solid #fff;
|
|
31
31
|
|
|
32
32
|
&-red {
|
|
33
33
|
border-top: 6px solid #fa541cff;
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.show-sort-flag {
|
|
39
|
-
display:
|
|
39
|
+
display: flex !important;
|
|
40
40
|
}
|
|
@@ -340,6 +340,8 @@ export interface TableMaxColumnType {
|
|
|
340
340
|
}[];
|
|
341
341
|
/**通过该函数获取可选项 */
|
|
342
342
|
getFilterOptionsFn?: IGetOptionType;
|
|
343
|
+
/** 表头筛选组件SingleSelect/MultiSelect中,输入字符串时对可选项进行过滤,是否前端过滤,默认false */
|
|
344
|
+
isFilterOptionsFrontSearch?: boolean;
|
|
343
345
|
/**列筛选时 使用的过滤函数 */
|
|
344
346
|
filterFn?: FilterFnType | ((row: any, columnId: any, filterValue: any) => boolean);
|
|
345
347
|
/**筛选组件属性配置 */
|