@4399ywkf/design 1.3.12 → 2.0.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.
- package/dist/Table/components/ColumnSetting/index.js +25 -35
- package/dist/Table/components/ColumnSetting/style.d.ts +16 -0
- package/dist/Table/components/ColumnSetting/style.js +19 -0
- package/dist/Table/components/EnumFilter/index.d.ts +8 -8
- package/dist/Table/components/EnumFilter/index.js +34 -36
- package/dist/Table/components/EnumFilter/style.d.ts +54 -0
- package/dist/Table/components/EnumFilter/style.js +58 -0
- package/dist/Table/components/Export/RadioMode.d.ts +1 -5
- package/dist/Table/components/Export/RadioMode.js +10 -11
- package/dist/Table/components/Export/index.js +160 -207
- package/dist/Table/components/Export/style.d.ts +15 -0
- package/dist/Table/components/Export/style.js +19 -0
- package/dist/Table/components/FilterDropdown/index.d.ts +7 -7
- package/dist/Table/components/FilterDropdown/index.js +6 -7
- package/dist/Table/components/FilterDropdown/style.d.ts +13 -0
- package/dist/Table/components/FilterDropdown/style.js +17 -0
- package/dist/Table/components/FilterKeys/index.d.ts +2 -2
- package/dist/Table/components/FilterKeys/index.js +51 -69
- package/dist/Table/components/FilterKeys/style.d.ts +29 -0
- package/dist/Table/components/FilterKeys/style.js +33 -0
- package/dist/Table/components/Reload/index.js +8 -21
- package/dist/Table/components/SearchInput/index.d.ts +3 -4
- package/dist/Table/components/SearchInput/index.js +50 -38
- package/dist/Table/components/SearchInput/style.d.ts +11 -0
- package/dist/Table/components/SearchInput/style.js +15 -0
- package/dist/Table/components/TableSize/index.js +7 -10
- package/dist/Table/components/TableTitle/index.d.ts +1 -1
- package/dist/Table/components/TableTitle/index.js +36 -38
- package/dist/Table/components/TableTitle/style.d.ts +25 -0
- package/dist/Table/components/TableTitle/style.js +29 -0
- package/dist/Table/context.d.ts +32 -0
- package/dist/Table/context.js +31 -0
- package/dist/Table/hooks/index.d.ts +8 -0
- package/dist/Table/hooks/index.js +8 -0
- package/dist/Table/hooks/useColumnsInit.d.ts +6 -0
- package/dist/Table/hooks/useColumnsInit.js +44 -0
- package/dist/Table/hooks/useEmptyText.d.ts +11 -0
- package/dist/Table/hooks/useEmptyText.js +34 -0
- package/dist/Table/hooks/usePagination.d.ts +9 -0
- package/dist/Table/hooks/usePagination.js +50 -0
- package/dist/Table/hooks/useQuerySnapshot.d.ts +6 -0
- package/dist/Table/hooks/useQuerySnapshot.js +63 -0
- package/dist/Table/hooks/useRowSelection.d.ts +11 -0
- package/dist/Table/hooks/useRowSelection.js +34 -0
- package/dist/Table/hooks/useSearchEffect.d.ts +9 -0
- package/dist/Table/hooks/useSearchEffect.js +48 -0
- package/dist/Table/hooks/useTableChange.d.ts +10 -0
- package/dist/Table/hooks/useTableChange.js +56 -0
- package/dist/Table/hooks/useTriggerSearch.d.ts +22 -0
- package/dist/Table/hooks/useTriggerSearch.js +130 -0
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +25 -1
- package/dist/Table/store/createStore.d.ts +2 -0
- package/dist/Table/store/createStore.js +30 -0
- package/dist/Table/store/hooks.d.ts +33 -0
- package/dist/Table/store/hooks.js +98 -0
- package/dist/Table/store/slices/column/actions.d.ts +9 -0
- package/dist/Table/store/slices/column/actions.js +10 -0
- package/dist/Table/store/slices/column/initialState.d.ts +2 -0
- package/dist/Table/store/slices/column/initialState.js +3 -0
- package/dist/Table/store/slices/persist/actions.d.ts +10 -0
- package/dist/Table/store/slices/persist/actions.js +28 -0
- package/dist/Table/store/slices/persist/api.d.ts +8 -0
- package/dist/Table/store/slices/persist/api.js +40 -0
- package/dist/Table/store/slices/query/actions.d.ts +32 -0
- package/dist/Table/store/slices/query/actions.js +129 -0
- package/dist/Table/store/slices/query/initialState.d.ts +2 -0
- package/dist/Table/store/slices/query/initialState.js +5 -0
- package/dist/Table/store/slices/request/actions.d.ts +8 -0
- package/dist/Table/store/slices/request/actions.js +14 -0
- package/dist/Table/store/slices/request/initialState.d.ts +2 -0
- package/dist/Table/store/slices/request/initialState.js +7 -0
- package/dist/Table/store/slices/ui/actions.d.ts +11 -0
- package/dist/Table/store/slices/ui/actions.js +15 -0
- package/dist/Table/store/slices/ui/initialState.d.ts +2 -0
- package/dist/Table/store/slices/ui/initialState.js +4 -0
- package/dist/Table/store/types.d.ts +79 -0
- package/dist/Table/store/types.js +1 -0
- package/dist/Table/style.d.ts +3 -0
- package/dist/Table/style.js +10 -0
- package/dist/Table/table.d.ts +2 -8
- package/dist/Table/table.js +160 -185
- package/dist/Table/type.d.ts +50 -64
- package/dist/Table/type.js +1 -3
- package/dist/Table/utils/Provide.d.ts +6 -9
- package/dist/Table/utils/Provide.js +4 -258
- package/dist/Table/utils/columnKey.d.ts +2 -0
- package/dist/Table/utils/columnKey.js +6 -0
- package/dist/Table/utils/getColumn.d.ts +7 -7
- package/dist/Table/utils/getColumnEnumProps.d.ts +4 -2
- package/dist/Table/utils/getColumnEnumProps.js +8 -6
- package/dist/Table/utils/getColumnMerge.d.ts +7 -2
- package/dist/Table/utils/getColumnMerge.js +3 -2
- package/dist/Table/utils/getDateColumn.d.ts +8 -7
- package/dist/Table/utils/getDateColumn.js +22 -68
- package/dist/Table/utils/getInputColumn.d.ts +2 -1
- package/dist/Table/utils/getInputColumn.js +2 -6
- package/dist/Table/utils/getSort.d.ts +4 -2
- package/dist/Table/utils/getSort.js +15 -12
- package/dist/Table/utils/index.d.ts +5 -20
- package/dist/Table/utils/index.js +16 -136
- package/dist/WaterfallVirtual/index.js +1 -1
- package/dist/WaterfallVirtual/types.d.ts +1 -2
- package/package.json +34 -25
- package/dist/Table/components/ColumnSetting/index.css +0 -4
- package/dist/Table/components/EnumFilter/index.css +0 -57
- package/dist/Table/components/FilterDropdown/index.css +0 -11
- package/dist/Table/components/FilterKeys/index.css +0 -19
- package/dist/Table/components/SearchInput/style.css +0 -10
- package/dist/Table/style.css +0 -42
|
@@ -6,31 +6,32 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
7
|
import { SettingOutlined } from '@ant-design/icons';
|
|
8
8
|
import { Button, Checkbox, Col, Popover, Row, Tooltip } from 'antd';
|
|
9
|
-
import React, {
|
|
10
|
-
import {
|
|
9
|
+
import React, { useMemo } from 'react';
|
|
10
|
+
import { useColumns } from "../../store/hooks";
|
|
11
11
|
import { genColumnKey } from "../../utils";
|
|
12
|
-
import {
|
|
12
|
+
import { useStyles } from "./style";
|
|
13
13
|
var ColumnSetting = function ColumnSetting() {
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
columnSetting =
|
|
19
|
-
setColumnSetting =
|
|
14
|
+
var _useStyles = useStyles(),
|
|
15
|
+
styles = _useStyles.styles;
|
|
16
|
+
var _useColumns = useColumns(),
|
|
17
|
+
columns = _useColumns.columns,
|
|
18
|
+
columnSetting = _useColumns.columnSetting,
|
|
19
|
+
setColumnSetting = _useColumns.setColumnSetting;
|
|
20
20
|
var checkboxColumnSetting = useMemo(function () {
|
|
21
21
|
return columnSetting.map(function (col, index) {
|
|
22
|
-
var
|
|
22
|
+
var _find;
|
|
23
|
+
var currentColumnTitle = (_find = columns.find(function (column, columnIndex) {
|
|
24
|
+
var _column$dataIndex;
|
|
25
|
+
var columnKey = genColumnKey(column.key || (Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.toString()), columnIndex);
|
|
26
|
+
return columnKey === col.key;
|
|
27
|
+
})) === null || _find === void 0 ? void 0 : _find.title;
|
|
23
28
|
return /*#__PURE__*/React.createElement(Col, {
|
|
24
29
|
span: 24,
|
|
25
30
|
key: index
|
|
26
31
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
27
32
|
value: col.key,
|
|
28
33
|
key: index
|
|
29
|
-
},
|
|
30
|
-
var _column$dataIndex;
|
|
31
|
-
var columnKey = genColumnKey(column.key || (Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : (_column$dataIndex = column.dataIndex) === null || _column$dataIndex === void 0 ? void 0 : _column$dataIndex.toString()), index);
|
|
32
|
-
return columnKey === col.key;
|
|
33
|
-
})) === null || _columns$find === void 0 ? void 0 : _columns$find.title));
|
|
34
|
+
}, typeof currentColumnTitle === 'function' ? col.key : currentColumnTitle));
|
|
34
35
|
});
|
|
35
36
|
}, [columnSetting, columns]);
|
|
36
37
|
var onChangeCheckboxGroup = function onChangeCheckboxGroup(v) {
|
|
@@ -48,8 +49,6 @@ var ColumnSetting = function ColumnSetting() {
|
|
|
48
49
|
return o.key;
|
|
49
50
|
});
|
|
50
51
|
}, [columnSetting]);
|
|
51
|
-
|
|
52
|
-
// ====================== 列展示的控制 ======================
|
|
53
52
|
var allColumnSetting = useMemo(function () {
|
|
54
53
|
return columnSetting.filter(function (o) {
|
|
55
54
|
return !o.hidden;
|
|
@@ -64,32 +63,28 @@ var ColumnSetting = function ColumnSetting() {
|
|
|
64
63
|
}, [columnSetting]);
|
|
65
64
|
var onChangeAll = function onChangeAll(e) {
|
|
66
65
|
var filterDisabledSetting = columnSetting.map(function (o) {
|
|
67
|
-
return o;
|
|
66
|
+
return _objectSpread({}, o);
|
|
68
67
|
});
|
|
69
68
|
if (e.target.checked) {
|
|
70
|
-
|
|
71
|
-
filterDisabledSetting.map(function (o) {
|
|
69
|
+
filterDisabledSetting.forEach(function (o) {
|
|
72
70
|
if (o.disabled) {
|
|
73
|
-
return
|
|
71
|
+
return;
|
|
74
72
|
}
|
|
75
73
|
o.hidden = false;
|
|
76
|
-
return o;
|
|
77
74
|
});
|
|
78
75
|
} else {
|
|
79
|
-
|
|
80
|
-
filterDisabledSetting.map(function (o) {
|
|
76
|
+
filterDisabledSetting.forEach(function (o) {
|
|
81
77
|
if (o.disabled) {
|
|
82
|
-
return
|
|
78
|
+
return;
|
|
83
79
|
}
|
|
84
80
|
o.hidden = true;
|
|
85
|
-
return o;
|
|
86
81
|
});
|
|
87
82
|
}
|
|
88
83
|
setColumnSetting(filterDisabledSetting);
|
|
89
84
|
};
|
|
90
85
|
var resetColumnSetting = function resetColumnSetting() {
|
|
91
86
|
var columnSettingList = [];
|
|
92
|
-
columns.
|
|
87
|
+
columns.forEach(function (col, index) {
|
|
93
88
|
var _col$dataIndex;
|
|
94
89
|
var columnKey = genColumnKey(col.key || (Array.isArray(col.dataIndex) ? col.dataIndex.join('.') : (_col$dataIndex = col.dataIndex) === null || _col$dataIndex === void 0 ? void 0 : _col$dataIndex.toString()), index);
|
|
95
90
|
columnSettingList.push({
|
|
@@ -106,7 +101,7 @@ var ColumnSetting = function ColumnSetting() {
|
|
|
106
101
|
placement: 'bottomRight',
|
|
107
102
|
trigger: 'click',
|
|
108
103
|
title: /*#__PURE__*/React.createElement("div", {
|
|
109
|
-
className:
|
|
104
|
+
className: styles.title
|
|
110
105
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
111
106
|
onChange: onChangeAll,
|
|
112
107
|
checked: allColumnSetting,
|
|
@@ -114,16 +109,11 @@ var ColumnSetting = function ColumnSetting() {
|
|
|
114
109
|
}, "\u5217\u5C55\u793A"), /*#__PURE__*/React.createElement(Button, {
|
|
115
110
|
onClick: resetColumnSetting,
|
|
116
111
|
type: 'link',
|
|
117
|
-
|
|
118
|
-
paddingRight: 0
|
|
119
|
-
}
|
|
112
|
+
className: styles.resetButton
|
|
120
113
|
}, "\u91CD\u7F6E")),
|
|
121
114
|
content: /*#__PURE__*/React.createElement(Checkbox.Group, {
|
|
122
|
-
className:
|
|
115
|
+
className: styles.content,
|
|
123
116
|
onChange: onChangeCheckboxGroup,
|
|
124
|
-
style: {
|
|
125
|
-
width: 200
|
|
126
|
-
},
|
|
127
117
|
value: columnShow
|
|
128
118
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
129
119
|
gutter: [0, 8]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
title: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
alignItems: "center";
|
|
5
|
+
justifyContent: "space-between";
|
|
6
|
+
height: number;
|
|
7
|
+
};
|
|
8
|
+
content: {
|
|
9
|
+
maxHeight: number;
|
|
10
|
+
overflow: "auto";
|
|
11
|
+
width: number;
|
|
12
|
+
};
|
|
13
|
+
resetButton: {
|
|
14
|
+
paddingRight: number;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createStyles } from 'antd-style';
|
|
2
|
+
export var useStyles = createStyles(function () {
|
|
3
|
+
return {
|
|
4
|
+
title: {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
justifyContent: 'space-between',
|
|
8
|
+
height: 32
|
|
9
|
+
},
|
|
10
|
+
content: {
|
|
11
|
+
maxHeight: 200,
|
|
12
|
+
overflow: 'auto',
|
|
13
|
+
width: 200
|
|
14
|
+
},
|
|
15
|
+
resetButton: {
|
|
16
|
+
paddingRight: 0
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type EnumOption = {
|
|
3
|
+
text: React.ReactNode;
|
|
4
|
+
value: React.Key;
|
|
5
|
+
};
|
|
3
6
|
interface EnumFilterProps {
|
|
4
|
-
options:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
columnKey: any;
|
|
9
|
-
onChange: any;
|
|
10
|
-
value: string[];
|
|
7
|
+
options: EnumOption[];
|
|
8
|
+
columnKey: string;
|
|
9
|
+
onChange: (values: React.Key[]) => void;
|
|
10
|
+
value: React.Key[];
|
|
11
11
|
mode?: 'multiple' | 'radio';
|
|
12
12
|
}
|
|
13
13
|
declare const EnumFilter: (props: EnumFilterProps) => React.JSX.Element;
|
|
@@ -13,11 +13,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
import React, { useMemo, useState } from 'react';
|
|
14
14
|
import { Button, Checkbox, Input } from 'antd';
|
|
15
15
|
import { SearchOutlined } from '@ant-design/icons';
|
|
16
|
-
import "./index.css";
|
|
17
16
|
import _ from 'lodash-es';
|
|
17
|
+
import { useStyles } from "./style";
|
|
18
18
|
var EnumFilter = function EnumFilter(props) {
|
|
19
|
+
var _useStyles = useStyles(),
|
|
20
|
+
styles = _useStyles.styles,
|
|
21
|
+
cx = _useStyles.cx;
|
|
19
22
|
var options = props.options,
|
|
20
|
-
columnKey = props.columnKey,
|
|
21
23
|
onChange = props.onChange,
|
|
22
24
|
value = props.value,
|
|
23
25
|
_props$mode = props.mode,
|
|
@@ -26,6 +28,19 @@ var EnumFilter = function EnumFilter(props) {
|
|
|
26
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
29
|
filterValue = _useState2[0],
|
|
28
30
|
setFilterValue = _useState2[1];
|
|
31
|
+
var filterOptions = useMemo(function () {
|
|
32
|
+
return options.filter(function (o) {
|
|
33
|
+
var _o$text;
|
|
34
|
+
return String((_o$text = o.text) !== null && _o$text !== void 0 ? _o$text : '').toUpperCase().includes(filterValue.toUpperCase());
|
|
35
|
+
});
|
|
36
|
+
}, [options, filterValue]);
|
|
37
|
+
var filterCheckboxValue = useMemo(function () {
|
|
38
|
+
return value.filter(function (o) {
|
|
39
|
+
return filterOptions.map(function (option) {
|
|
40
|
+
return option.value;
|
|
41
|
+
}).includes(o);
|
|
42
|
+
});
|
|
43
|
+
}, [value, filterOptions]);
|
|
29
44
|
var onCheckChange = function onCheckChange(e) {
|
|
30
45
|
// 首先需要知道当前的过滤项有哪些
|
|
31
46
|
// 如果e的值存在 filterOptions里面,代表新增
|
|
@@ -77,12 +92,6 @@ var EnumFilter = function EnumFilter(props) {
|
|
|
77
92
|
var onChangeFilter = function onChangeFilter(e) {
|
|
78
93
|
setFilterValue(e.target.value);
|
|
79
94
|
};
|
|
80
|
-
var filterOptions = useMemo(function () {
|
|
81
|
-
return options.filter(function (o) {
|
|
82
|
-
var _o$text;
|
|
83
|
-
return (_o$text = o.text) === null || _o$text === void 0 ? void 0 : _o$text.toUpperCase().includes(filterValue === null || filterValue === void 0 ? void 0 : filterValue.toUpperCase());
|
|
84
|
-
});
|
|
85
|
-
}, [options, filterValue]);
|
|
86
95
|
var onChangeSelectAll = function onChangeSelectAll(e) {
|
|
87
96
|
if (e.target.checked) {
|
|
88
97
|
// 全选
|
|
@@ -99,24 +108,17 @@ var EnumFilter = function EnumFilter(props) {
|
|
|
99
108
|
*/
|
|
100
109
|
var onCounterElection = function onCounterElection() {
|
|
101
110
|
var copyFilterOptions = _.cloneDeep(filterOptions);
|
|
102
|
-
var res = copyFilterOptions.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
111
|
+
var res = copyFilterOptions.filter(function (o) {
|
|
112
|
+
return !filterCheckboxValue.includes(o.value);
|
|
113
|
+
}).map(function (o) {
|
|
114
|
+
return o.value;
|
|
115
|
+
});
|
|
107
116
|
onCheckChange(res);
|
|
108
117
|
};
|
|
109
|
-
var filterCheckboxValue = useMemo(function () {
|
|
110
|
-
return value.filter(function (o) {
|
|
111
|
-
return filterOptions.map(function (o) {
|
|
112
|
-
return o.value;
|
|
113
|
-
}).includes(o);
|
|
114
|
-
});
|
|
115
|
-
}, [value, filterOptions]);
|
|
116
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className:
|
|
119
|
+
className: styles.dropdown
|
|
118
120
|
}, /*#__PURE__*/React.createElement("div", {
|
|
119
|
-
className:
|
|
121
|
+
className: styles.search
|
|
120
122
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
121
123
|
value: filterValue,
|
|
122
124
|
onChange: onChangeFilter,
|
|
@@ -124,13 +126,13 @@ var EnumFilter = function EnumFilter(props) {
|
|
|
124
126
|
placeholder: '在筛序选项中搜索',
|
|
125
127
|
allowClear: true
|
|
126
128
|
})), /*#__PURE__*/React.createElement("div", {
|
|
127
|
-
className:
|
|
129
|
+
className: styles.menu
|
|
128
130
|
}, mode === 'multiple' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
129
|
-
className:
|
|
131
|
+
className: styles.action
|
|
130
132
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
131
133
|
onChange: onChangeSelectAll,
|
|
132
|
-
checked: filterCheckboxValue.length
|
|
133
|
-
indeterminate: filterCheckboxValue.length > 0 && filterCheckboxValue.length
|
|
134
|
+
checked: filterCheckboxValue.length === filterOptions.length,
|
|
135
|
+
indeterminate: filterCheckboxValue.length > 0 && filterCheckboxValue.length !== filterOptions.length
|
|
134
136
|
}, "\u5168\u9009"), /*#__PURE__*/React.createElement(Button, {
|
|
135
137
|
size: 'small',
|
|
136
138
|
type: 'link',
|
|
@@ -142,32 +144,28 @@ var EnumFilter = function EnumFilter(props) {
|
|
|
142
144
|
disabled: _.isEmpty(filterCheckboxValue),
|
|
143
145
|
onClick: onCancel
|
|
144
146
|
}, "\u53D6\u6D88")), /*#__PURE__*/React.createElement(Checkbox.Group, {
|
|
145
|
-
className:
|
|
147
|
+
className: styles.menuList,
|
|
146
148
|
onChange: onCheckChange,
|
|
147
149
|
value: value
|
|
148
150
|
}, filterOptions.map(function (o, index) {
|
|
149
151
|
return /*#__PURE__*/React.createElement("div", {
|
|
150
152
|
key: index,
|
|
151
|
-
className:
|
|
153
|
+
className: cx(styles.menuItem, (value === null || value === void 0 ? void 0 : value.includes(o.value)) && styles.menuItemSelected)
|
|
152
154
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
153
|
-
|
|
154
|
-
width: '100%'
|
|
155
|
-
},
|
|
155
|
+
className: styles.fullWidth,
|
|
156
156
|
value: o.value
|
|
157
157
|
}, o.text));
|
|
158
158
|
}))), mode === 'radio' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
159
|
-
className:
|
|
159
|
+
className: styles.menuList
|
|
160
160
|
}, filterOptions.map(function (o, index) {
|
|
161
161
|
return /*#__PURE__*/React.createElement("div", {
|
|
162
162
|
key: index,
|
|
163
|
-
className:
|
|
163
|
+
className: cx(styles.menuItem, (value === null || value === void 0 ? void 0 : value.includes(o.value)) && styles.menuItemSelected)
|
|
164
164
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
165
165
|
onChange: function onChange() {
|
|
166
166
|
return onRadioCheckChange(o.value);
|
|
167
167
|
},
|
|
168
|
-
|
|
169
|
-
width: '100%'
|
|
170
|
-
},
|
|
168
|
+
className: styles.fullWidth,
|
|
171
169
|
checked: o.value === (value === null || value === void 0 ? void 0 : value[0])
|
|
172
170
|
}, o.text));
|
|
173
171
|
})))));
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
dropdown: {
|
|
3
|
+
minWidth: number;
|
|
4
|
+
};
|
|
5
|
+
search: {
|
|
6
|
+
padding: string;
|
|
7
|
+
borderBottom: string;
|
|
8
|
+
};
|
|
9
|
+
menu: {
|
|
10
|
+
maxHeight: number;
|
|
11
|
+
border: number;
|
|
12
|
+
overflowX: "hidden";
|
|
13
|
+
overflowY: "auto";
|
|
14
|
+
background: string;
|
|
15
|
+
paddingTop: number;
|
|
16
|
+
};
|
|
17
|
+
menuList: {
|
|
18
|
+
display: "flex !important";
|
|
19
|
+
flexDirection: "column";
|
|
20
|
+
gap: number;
|
|
21
|
+
};
|
|
22
|
+
menuItem: {
|
|
23
|
+
clear: "both";
|
|
24
|
+
margin: number;
|
|
25
|
+
padding: string;
|
|
26
|
+
color: string;
|
|
27
|
+
fontWeight: number;
|
|
28
|
+
fontSize: number;
|
|
29
|
+
lineHeight: number;
|
|
30
|
+
cursor: "pointer";
|
|
31
|
+
transition: "all 0.2s";
|
|
32
|
+
borderRadius: number;
|
|
33
|
+
'&:hover': {
|
|
34
|
+
backgroundColor: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
menuItemSelected: {
|
|
38
|
+
color: string;
|
|
39
|
+
backgroundColor: string;
|
|
40
|
+
'&:hover': {
|
|
41
|
+
backgroundColor: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
action: {
|
|
45
|
+
padding: string;
|
|
46
|
+
display: "flex";
|
|
47
|
+
flexDirection: "row";
|
|
48
|
+
justifyContent: "space-between";
|
|
49
|
+
alignItems: "center";
|
|
50
|
+
};
|
|
51
|
+
fullWidth: {
|
|
52
|
+
width: string;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createStyles } from 'antd-style';
|
|
2
|
+
export var useStyles = createStyles(function (_ref) {
|
|
3
|
+
var token = _ref.token;
|
|
4
|
+
return {
|
|
5
|
+
dropdown: {
|
|
6
|
+
minWidth: 120
|
|
7
|
+
},
|
|
8
|
+
search: {
|
|
9
|
+
padding: "".concat(token.paddingXS, "px ").concat(token.paddingXXS, "px"),
|
|
10
|
+
borderBottom: "1px solid ".concat(token.colorBorderSecondary)
|
|
11
|
+
},
|
|
12
|
+
menu: {
|
|
13
|
+
maxHeight: 264,
|
|
14
|
+
border: 0,
|
|
15
|
+
overflowX: 'hidden',
|
|
16
|
+
overflowY: 'auto',
|
|
17
|
+
background: token.colorBgContainer,
|
|
18
|
+
paddingTop: token.paddingXXS
|
|
19
|
+
},
|
|
20
|
+
menuList: {
|
|
21
|
+
display: 'flex !important',
|
|
22
|
+
flexDirection: 'column',
|
|
23
|
+
gap: token.marginXXS
|
|
24
|
+
},
|
|
25
|
+
menuItem: {
|
|
26
|
+
clear: 'both',
|
|
27
|
+
margin: 0,
|
|
28
|
+
padding: '5px 12px',
|
|
29
|
+
color: token.colorText,
|
|
30
|
+
fontWeight: token.fontWeightStrong,
|
|
31
|
+
fontSize: token.fontSize,
|
|
32
|
+
lineHeight: token.lineHeight,
|
|
33
|
+
cursor: 'pointer',
|
|
34
|
+
transition: 'all 0.2s',
|
|
35
|
+
borderRadius: token.borderRadiusSM,
|
|
36
|
+
'&:hover': {
|
|
37
|
+
backgroundColor: token.colorFillSecondary
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
menuItemSelected: {
|
|
41
|
+
color: token.colorPrimary,
|
|
42
|
+
backgroundColor: token.colorPrimaryBg,
|
|
43
|
+
'&:hover': {
|
|
44
|
+
backgroundColor: token.colorPrimaryBgHover
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
action: {
|
|
48
|
+
padding: "".concat(token.paddingXXS, "px 12px"),
|
|
49
|
+
display: 'flex',
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
justifyContent: 'space-between',
|
|
52
|
+
alignItems: 'center'
|
|
53
|
+
},
|
|
54
|
+
fullWidth: {
|
|
55
|
+
width: '100%'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { RadioChangeEvent } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
interface RadioModeProps {
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange: (v: RadioChangeEvent) => void;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* 导出范围单选框
|
|
9
|
-
* @constructor
|
|
10
|
-
*/
|
|
11
7
|
declare const RadioMode: (props: RadioModeProps) => React.JSX.Element;
|
|
12
8
|
export default RadioMode;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
import { Radio, Space } from 'antd';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
* 导出范围单选框
|
|
6
|
-
* @constructor
|
|
7
|
-
*/
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useTableContext } from "../../context";
|
|
8
5
|
var RadioMode = function RadioMode(props) {
|
|
9
6
|
var value = props.value,
|
|
10
7
|
onChange = props.onChange;
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
rowSelection =
|
|
8
|
+
var ctx = useTableContext();
|
|
9
|
+
var isShowExport = ctx.isShowExport,
|
|
10
|
+
rowSelection = ctx.rowSelection;
|
|
11
|
+
var exportConfig = isShowExport && _typeof(isShowExport) === 'object' ? isShowExport : undefined;
|
|
14
12
|
var radioOptions = [{
|
|
15
13
|
label: '仅导出搜索结果',
|
|
16
14
|
value: 'part'
|
|
@@ -21,11 +19,11 @@ var RadioMode = function RadioMode(props) {
|
|
|
21
19
|
}, {
|
|
22
20
|
label: '导出全部结果',
|
|
23
21
|
value: 'all',
|
|
24
|
-
disabled: !
|
|
22
|
+
disabled: !(exportConfig !== null && exportConfig !== void 0 && exportConfig.query)
|
|
25
23
|
}, {
|
|
26
24
|
label: '导出全部结果(异步)',
|
|
27
25
|
value: 'async',
|
|
28
|
-
disabled: !
|
|
26
|
+
disabled: !(exportConfig !== null && exportConfig !== void 0 && exportConfig.query)
|
|
29
27
|
}];
|
|
30
28
|
return /*#__PURE__*/React.createElement(Radio.Group, {
|
|
31
29
|
value: value,
|
|
@@ -34,6 +32,7 @@ var RadioMode = function RadioMode(props) {
|
|
|
34
32
|
direction: 'vertical'
|
|
35
33
|
}, radioOptions.map(function (o) {
|
|
36
34
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
35
|
+
key: o.value,
|
|
37
36
|
value: o.value,
|
|
38
37
|
disabled: o.disabled
|
|
39
38
|
}, o.label);
|