@teamix/pro 1.2.19 → 1.2.23
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/212.js +49 -49
- package/dist/pro.css +1 -1
- package/dist/pro.js +3400 -880
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog.js +10 -24
- package/es/actions/index.d.ts +10 -0
- package/es/actions/index.js +11 -16
- package/es/form/Components/LightFilter/componentMap.js +2 -1
- package/es/form/Components/LightFilter/index.js +16 -4
- package/es/form/Components/LightFilter/index.scss +1 -1
- package/es/form/Components/SelectTable/index.d.ts +24 -0
- package/es/form/Components/SelectTable/index.js +135 -0
- package/es/form/Components/SelectTable/index.scss +28 -0
- package/es/form/Components/SelectTable/table.d.ts +6 -0
- package/es/form/Components/SelectTable/table.js +64 -0
- package/es/form/Filter/AdvancedFilter.d.ts +7 -0
- package/es/form/Filter/AdvancedFilter.js +114 -0
- package/es/form/Filter/LightFilter.d.ts +7 -0
- package/es/form/Filter/LightFilter.js +79 -0
- package/es/form/Filter/SimpleFilter.d.ts +7 -0
- package/es/form/Filter/SimpleFilter.js +74 -0
- package/es/form/Filter/index2.js +203 -257
- package/es/form/ProForm/index.js +12 -9
- package/es/form/ProForm/index.scss +40 -6
- package/es/form/ProForm/useFormDisplayValues.js +4 -2
- package/es/form/SchemaForm/index.js +16 -10
- package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +4 -9
- package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.js +4 -10
- package/es/form/SchemaForm/initializeRules.d.ts +7 -1
- package/es/form/SchemaForm/initializeRules.js +9 -13
- package/es/form/SchemaForm/reactions.d.ts +5 -5
- package/es/form/SchemaForm/reactions.js +27 -29
- package/es/form/global.scss +1 -0
- package/es/form/typing.d.ts +7 -3
- package/es/form/utils.d.ts +8 -7
- package/es/form/utils.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/table/components/Filter/index.js +1 -0
- package/es/table/components/Layout/index.js +22 -12
- package/es/table/components/Pagination/index.d.ts +7 -0
- package/es/table/components/Pagination/index.js +245 -0
- package/es/table/components/Pagination/index.scss +50 -0
- package/es/table/components/ToolBar/FilterColumnIcon.js +41 -7
- package/es/table/components/ToolBar/index.scss +17 -6
- package/es/table/index.js +96 -37
- package/es/table/index.scss +7 -1
- package/es/table/typing.d.ts +9 -2
- package/es/table/utils/columnRender.js +2 -1
- package/es/table/utils/index.d.ts +7 -0
- package/es/table/utils/index.js +38 -4
- package/lib/actions/dialog.js +9 -23
- package/lib/actions/index.d.ts +10 -0
- package/lib/actions/index.js +11 -16
- package/lib/form/Components/LightFilter/componentMap.js +2 -1
- package/lib/form/Components/LightFilter/index.js +15 -4
- package/lib/form/Components/LightFilter/index.scss +1 -1
- package/lib/form/Components/SelectTable/index.d.ts +24 -0
- package/lib/form/Components/SelectTable/index.js +157 -0
- package/lib/form/Components/SelectTable/index.scss +28 -0
- package/lib/form/Components/SelectTable/table.d.ts +6 -0
- package/lib/form/Components/SelectTable/table.js +76 -0
- package/lib/form/Filter/AdvancedFilter.d.ts +7 -0
- package/lib/form/Filter/AdvancedFilter.js +134 -0
- package/lib/form/Filter/LightFilter.d.ts +7 -0
- package/lib/form/Filter/LightFilter.js +99 -0
- package/lib/form/Filter/SimpleFilter.d.ts +7 -0
- package/lib/form/Filter/SimpleFilter.js +93 -0
- package/lib/form/Filter/index2.js +207 -258
- package/lib/form/ProForm/index.js +11 -9
- package/lib/form/ProForm/index.scss +40 -6
- package/lib/form/ProForm/useFormDisplayValues.js +3 -1
- package/lib/form/SchemaForm/index.js +16 -9
- package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +4 -11
- package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +4 -11
- package/lib/form/SchemaForm/initializeRules.d.ts +7 -1
- package/lib/form/SchemaForm/initializeRules.js +9 -16
- package/lib/form/SchemaForm/reactions.d.ts +5 -5
- package/lib/form/SchemaForm/reactions.js +29 -31
- package/lib/form/global.scss +1 -0
- package/lib/form/typing.d.ts +7 -3
- package/lib/form/utils.d.ts +8 -7
- package/lib/form/utils.js +6 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/table/components/Layout/index.js +21 -11
- package/lib/table/components/Pagination/index.d.ts +7 -0
- package/lib/table/components/Pagination/index.js +265 -0
- package/lib/table/components/Pagination/index.scss +50 -0
- package/lib/table/components/ToolBar/FilterColumnIcon.js +40 -6
- package/lib/table/components/ToolBar/index.scss +17 -6
- package/lib/table/index.js +96 -36
- package/lib/table/index.scss +7 -1
- package/lib/table/typing.d.ts +9 -2
- package/lib/table/utils/columnRender.js +2 -1
- package/lib/table/utils/index.d.ts +7 -0
- package/lib/table/utils/index.js +46 -4
- package/package.json +2 -2
@@ -0,0 +1,245 @@
|
|
1
|
+
var _excluded = ["className", "onChange", "total", "totalRender", "pageSize", "current", "pageSizeList", "pageSizeSelector", "type", "onPageSizeChange", "responsivePaginationType"];
|
2
|
+
|
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
|
+
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
|
+
|
11
|
+
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."); }
|
12
|
+
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
14
|
+
|
15
|
+
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; }
|
16
|
+
|
17
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
18
|
+
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
20
|
+
|
21
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
22
|
+
|
23
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
24
|
+
|
25
|
+
// 自适应宽度的翻页器
|
26
|
+
import React, { useState } from 'react';
|
27
|
+
import { Pagination, Balloon, Select, Button, Input, Icon } from '@alicloudfe/components';
|
28
|
+
import { getMessage, baseClass } from '@teamix/utils';
|
29
|
+
import { useResponsiveProps } from '@teamix/hooks';
|
30
|
+
import './index.scss';
|
31
|
+
var cls = baseClass('teamix-pro-pagination');
|
32
|
+
export default (function (props) {
|
33
|
+
var className = props.className,
|
34
|
+
propsOnChange = props.onChange,
|
35
|
+
total = props.total,
|
36
|
+
totalRender = props.totalRender,
|
37
|
+
pageSize = props.pageSize,
|
38
|
+
current = props.current,
|
39
|
+
pageSizeList = props.pageSizeList,
|
40
|
+
pageSizeSelector = props.pageSizeSelector,
|
41
|
+
type = props.type,
|
42
|
+
onPageSizeChange = props.onPageSizeChange,
|
43
|
+
responsivePaginationType = props.responsivePaginationType,
|
44
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
45
|
+
|
46
|
+
var _useResponsiveProps = useResponsiveProps([480, 590, 700], ['mini', 'small', 'simple', 'normal']),
|
47
|
+
responsiveProps = _useResponsiveProps.responsiveProps,
|
48
|
+
paginationWrapperRef = _useResponsiveProps.ref;
|
49
|
+
|
50
|
+
var _useState = useState(false),
|
51
|
+
_useState2 = _slicedToArray(_useState, 2),
|
52
|
+
visible = _useState2[0],
|
53
|
+
setVisible = _useState2[1];
|
54
|
+
|
55
|
+
var _useState3 = useState(current),
|
56
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
57
|
+
currentPage = _useState4[0],
|
58
|
+
setCurrentPage = _useState4[1];
|
59
|
+
|
60
|
+
var commonPaginationProps = {
|
61
|
+
className: className,
|
62
|
+
onChange: propsOnChange,
|
63
|
+
total: total,
|
64
|
+
pageSize: pageSize,
|
65
|
+
shape: 'arrow-only',
|
66
|
+
pageSizeList: pageSizeList,
|
67
|
+
pageSizeSelector: pageSizeSelector,
|
68
|
+
pageSizePosition: 'end',
|
69
|
+
onPageSizeChange: onPageSizeChange
|
70
|
+
}; // 自定义总数,用于 small、mini
|
71
|
+
|
72
|
+
var customTotalRender = function customTotalRender(total) {
|
73
|
+
return /*#__PURE__*/React.createElement(Balloon, {
|
74
|
+
visible: visible,
|
75
|
+
closable: false,
|
76
|
+
onVisibleChange: function onVisibleChange(visible) {
|
77
|
+
return setVisible(visible);
|
78
|
+
},
|
79
|
+
align: "t",
|
80
|
+
// triggerType="click"
|
81
|
+
trigger: /*#__PURE__*/React.createElement(Button, {
|
82
|
+
text: true,
|
83
|
+
onMouseEnter: function onMouseEnter() {
|
84
|
+
return setVisible(true);
|
85
|
+
}
|
86
|
+
}, getMessage('total', {
|
87
|
+
total: total
|
88
|
+
}))
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
90
|
+
className: cls('custom-total-content')
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
92
|
+
className: "title"
|
93
|
+
}, getMessage('pageSize')), /*#__PURE__*/React.createElement(Select, {
|
94
|
+
className: cls('custom-page-size-selector'),
|
95
|
+
dataSource: pageSizeList,
|
96
|
+
defaultValue: pageSize,
|
97
|
+
followTrigger: true,
|
98
|
+
menuProps: {
|
99
|
+
hasSelectedIcon: false
|
100
|
+
},
|
101
|
+
onChange: function onChange(value) {
|
102
|
+
setVisible(false);
|
103
|
+
setCurrentPage(1);
|
104
|
+
onPageSizeChange === null || onPageSizeChange === void 0 ? void 0 : onPageSizeChange(value);
|
105
|
+
}
|
106
|
+
})));
|
107
|
+
}; // 获取页总数
|
108
|
+
|
109
|
+
|
110
|
+
function getTotalPage(total, currentPageSize) {
|
111
|
+
var totalPage = Math.ceil(total / currentPageSize);
|
112
|
+
return totalPage <= 0 ? 1 : totalPage;
|
113
|
+
} // 自定义翻页,用于 mini
|
114
|
+
|
115
|
+
|
116
|
+
var customJumpRender = function customJumpRender() {
|
117
|
+
var handleInputChange = function handleInputChange(value, e) {
|
118
|
+
setCurrentPage(value);
|
119
|
+
}; // 回车触发跳转
|
120
|
+
|
121
|
+
|
122
|
+
var handleJump = function handleJump(e) {
|
123
|
+
var totalPage = getTotalPage(total, pageSize);
|
124
|
+
var value = Number(currentPage);
|
125
|
+
|
126
|
+
if (isNaN(value)) {
|
127
|
+
value = '';
|
128
|
+
} else if (value < 1) {
|
129
|
+
value = 1;
|
130
|
+
} else if (value > totalPage) {
|
131
|
+
value = totalPage;
|
132
|
+
}
|
133
|
+
|
134
|
+
if (value && value !== current) {
|
135
|
+
setCurrentPage(value);
|
136
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(value, e);
|
137
|
+
}
|
138
|
+
};
|
139
|
+
|
140
|
+
var handlePrevClick = function handlePrevClick(e) {
|
141
|
+
setCurrentPage(currentPage - 1);
|
142
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(currentPage - 1, e);
|
143
|
+
};
|
144
|
+
|
145
|
+
var handleNextClick = function handleNextClick(e) {
|
146
|
+
setCurrentPage(currentPage + 1);
|
147
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(currentPage + 1, e);
|
148
|
+
};
|
149
|
+
|
150
|
+
return /*#__PURE__*/React.createElement("div", {
|
151
|
+
className: cls('custom-jumper')
|
152
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
153
|
+
className: "next-prev next-pagination-item",
|
154
|
+
onClick: handlePrevClick,
|
155
|
+
disabled: Number(currentPage) <= 1
|
156
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
157
|
+
size: "small",
|
158
|
+
type: "arrow-left"
|
159
|
+
})), /*#__PURE__*/React.createElement(Input, {
|
160
|
+
className: "jump-input",
|
161
|
+
value: currentPage,
|
162
|
+
onChange: handleInputChange,
|
163
|
+
onKeyDown: function onKeyDown(e) {
|
164
|
+
if (e.keyCode === 13) {
|
165
|
+
handleJump(e);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}), /*#__PURE__*/React.createElement("div", {
|
169
|
+
className: "total"
|
170
|
+
}, /*#__PURE__*/React.createElement("span", {
|
171
|
+
style: {
|
172
|
+
marginRight: 4
|
173
|
+
}
|
174
|
+
}, "/"), getTotalPage(total, pageSize)), /*#__PURE__*/React.createElement(Button, {
|
175
|
+
className: "next-next next-pagination-item",
|
176
|
+
onClick: handleNextClick,
|
177
|
+
//@ts-ignore
|
178
|
+
disabled: total && Number(currentPage) >= getTotalPage(total, pageSize)
|
179
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
180
|
+
size: "small",
|
181
|
+
type: "arrow-right"
|
182
|
+
})));
|
183
|
+
};
|
184
|
+
|
185
|
+
var renderMiniPagination = function renderMiniPagination() {
|
186
|
+
if (total && pageSize) {
|
187
|
+
if (total / pageSize <= 2) {
|
188
|
+
return /*#__PURE__*/React.createElement(Pagination, _objectSpread(_objectSpread({}, commonPaginationProps), {}, {
|
189
|
+
type: "simple"
|
190
|
+
}, otherProps));
|
191
|
+
} else {
|
192
|
+
return /*#__PURE__*/React.createElement("div", {
|
193
|
+
className: "".concat(cls('custom-mini-pagination'), " next-pagination")
|
194
|
+
}, customTotalRender(total), customJumpRender());
|
195
|
+
}
|
196
|
+
}
|
197
|
+
};
|
198
|
+
|
199
|
+
var renderPagination = function renderPagination() {
|
200
|
+
switch (responsivePaginationType || responsiveProps) {
|
201
|
+
case 'normal':
|
202
|
+
return /*#__PURE__*/React.createElement(Pagination, _objectSpread(_objectSpread({}, commonPaginationProps), {}, {
|
203
|
+
totalRender: function totalRender(total) {
|
204
|
+
return getMessage('total', {
|
205
|
+
total: total
|
206
|
+
});
|
207
|
+
}
|
208
|
+
}, otherProps));
|
209
|
+
|
210
|
+
case 'simple':
|
211
|
+
return /*#__PURE__*/React.createElement(Pagination, _objectSpread(_objectSpread({}, commonPaginationProps), {}, {
|
212
|
+
pageShowCount: 3,
|
213
|
+
totalRender: function totalRender(total) {
|
214
|
+
return getMessage('total', {
|
215
|
+
total: total
|
216
|
+
});
|
217
|
+
}
|
218
|
+
}, otherProps));
|
219
|
+
|
220
|
+
case 'small':
|
221
|
+
return /*#__PURE__*/React.createElement(Pagination, _objectSpread(_objectSpread({}, commonPaginationProps), {}, {
|
222
|
+
pageShowCount: 3,
|
223
|
+
pageSizeSelector: false,
|
224
|
+
totalRender: function totalRender(total) {
|
225
|
+
return customTotalRender(total);
|
226
|
+
}
|
227
|
+
}, otherProps));
|
228
|
+
|
229
|
+
case 'mini':
|
230
|
+
return renderMiniPagination();
|
231
|
+
|
232
|
+
default:
|
233
|
+
return /*#__PURE__*/React.createElement(Pagination, _objectSpread(_objectSpread({}, commonPaginationProps), otherProps));
|
234
|
+
}
|
235
|
+
};
|
236
|
+
|
237
|
+
return (
|
238
|
+
/*#__PURE__*/
|
239
|
+
// 用于获取翻页器响应式 ref
|
240
|
+
React.createElement("div", {
|
241
|
+
ref: paginationWrapperRef,
|
242
|
+
className: cls('wrapper')
|
243
|
+
}, renderPagination())
|
244
|
+
);
|
245
|
+
});
|
@@ -0,0 +1,50 @@
|
|
1
|
+
$prefix: 'teamix-pro-pagination';
|
2
|
+
|
3
|
+
.#{$prefix} {
|
4
|
+
&-custom-total {
|
5
|
+
&-content {
|
6
|
+
display: flex;
|
7
|
+
align-items: center;
|
8
|
+
.next-menu {
|
9
|
+
min-width: 56px !important;
|
10
|
+
.next-menu-item.next-select-menu-item {
|
11
|
+
padding: 0 8px !important;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
&-custom-mini-pagination {
|
17
|
+
display: flex;
|
18
|
+
align-items: center;
|
19
|
+
}
|
20
|
+
&-custom-jumper {
|
21
|
+
display: flex;
|
22
|
+
align-items: center;
|
23
|
+
.jump-input {
|
24
|
+
width: 36px;
|
25
|
+
input {
|
26
|
+
padding: 0 3px;
|
27
|
+
text-align: center;
|
28
|
+
line-height: 30px;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
.total {
|
32
|
+
margin-left: 8px;
|
33
|
+
margin-right: 4px;
|
34
|
+
color: var(--color-text1-2);
|
35
|
+
}
|
36
|
+
.next-prev {
|
37
|
+
margin-left: 8px;
|
38
|
+
margin-right: 4px;
|
39
|
+
}
|
40
|
+
.next-pagination-item:disabled i {
|
41
|
+
color: var(--btn-pure-normal-color-disabled, #CCCCCC) !important;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
&-custom-page-size-selector.next-select-trigger {
|
45
|
+
min-width: 56px;
|
46
|
+
.next-select-inner {
|
47
|
+
min-width: 56px;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
@@ -31,7 +31,7 @@ import { Button, Dropdown, Menu, Dialog, Grid, Checkbox } from '@alicloudfe/comp
|
|
31
31
|
import TeamixIcon from '@teamix/icon';
|
32
32
|
import { baseClass, getMessage } from '@teamix/utils';
|
33
33
|
import React, { useState, useEffect } from 'react';
|
34
|
-
import { cloneDeep } from '../../utils';
|
34
|
+
import { cloneDeep, off, on } from '../../utils';
|
35
35
|
import './index.scss';
|
36
36
|
import { Ellipsis } from '@teamix/utils';
|
37
37
|
var CheckboxItem = Menu.CheckboxItem;
|
@@ -54,7 +54,8 @@ var processColumns = function processColumns(columns) {
|
|
54
54
|
var FilterColumnIcon = function FilterColumnIcon(props) {
|
55
55
|
var _props$columns = props.columns,
|
56
56
|
columns = _props$columns === void 0 ? [] : _props$columns,
|
57
|
-
actionRef = props.actionRef
|
57
|
+
actionRef = props.actionRef,
|
58
|
+
filterColumnType = props.filterColumnType;
|
58
59
|
|
59
60
|
var _useState = useState(true),
|
60
61
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -84,6 +85,26 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
84
85
|
dropdownVisible = _useState10[0],
|
85
86
|
setDropdownVisible = _useState10[1];
|
86
87
|
|
88
|
+
useEffect(function () {
|
89
|
+
on === null || on === void 0 ? void 0 : on(function (stateFilterColumns) {
|
90
|
+
if (stateFilterColumns && stateFilterColumns.length > 0) {
|
91
|
+
var showDataIndex = stateFilterColumns.map(function (item) {
|
92
|
+
return item.dataIndex;
|
93
|
+
});
|
94
|
+
var stateColumns = cloneDeep(processColumns(columns)).map(function (item) {
|
95
|
+
if (!showDataIndex.includes(item.dataIndex)) {
|
96
|
+
item.columnFilters = false;
|
97
|
+
}
|
98
|
+
|
99
|
+
return item;
|
100
|
+
});
|
101
|
+
setNewColumns(stateColumns);
|
102
|
+
}
|
103
|
+
}, 'refreshFilterState');
|
104
|
+
return function () {
|
105
|
+
off('refreshFilterState');
|
106
|
+
};
|
107
|
+
});
|
87
108
|
useEffect(function () {
|
88
109
|
setNewColumns(processColumns(columns));
|
89
110
|
}, [columns]); // 全选
|
@@ -195,7 +216,7 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
195
216
|
|
196
217
|
calculateSelectAllState(columns);
|
197
218
|
setNewColumns(columns);
|
198
|
-
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setColumn) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, columns);
|
219
|
+
(_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$se = _actionRef$current.setColumn) === null || _actionRef$current$se === void 0 ? void 0 : _actionRef$current$se.call(_actionRef$current, columns, false);
|
199
220
|
}; // 计算全选状态
|
200
221
|
|
201
222
|
|
@@ -241,7 +262,9 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
241
262
|
align: "tr br"
|
242
263
|
}, /*#__PURE__*/React.createElement("div", {
|
243
264
|
className: cls()
|
244
|
-
}, /*#__PURE__*/React.createElement(Menu,
|
265
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
266
|
+
className: cls('all-select')
|
267
|
+
}, /*#__PURE__*/React.createElement(CheckboxItem, {
|
245
268
|
indeterminate: indeterminate,
|
246
269
|
checked: allVisible,
|
247
270
|
onChange: onChangeAllColumns
|
@@ -254,7 +277,9 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
254
277
|
type: "primary"
|
255
278
|
}, getMessage('reset'))), /*#__PURE__*/React.createElement(Menu.Divider, {
|
256
279
|
key: "divider"
|
257
|
-
}),
|
280
|
+
})), /*#__PURE__*/React.createElement(Menu, {
|
281
|
+
className: cls('checkbox-group')
|
282
|
+
}, newColumns.map(function (_ref9, index) {
|
258
283
|
var _newColumns$find;
|
259
284
|
|
260
285
|
var dataIndex = _ref9.dataIndex,
|
@@ -312,7 +337,8 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
312
337
|
onOk: onChangeColumnsForDialog,
|
313
338
|
onCancel: dialogOnClose,
|
314
339
|
onClose: dialogOnClose,
|
315
|
-
width: 480
|
340
|
+
width: 480,
|
341
|
+
className: cls('dialog')
|
316
342
|
}, /*#__PURE__*/React.createElement(Row, {
|
317
343
|
gutter: 20,
|
318
344
|
wrap: true,
|
@@ -349,7 +375,15 @@ var FilterColumnIcon = function FilterColumnIcon(props) {
|
|
349
375
|
}))));
|
350
376
|
};
|
351
377
|
|
352
|
-
if (
|
378
|
+
if (filterColumnType === 'dialog') {
|
379
|
+
return renderDialog();
|
380
|
+
}
|
381
|
+
|
382
|
+
if (filterColumnType === 'dropdown') {
|
383
|
+
return renderDropdown();
|
384
|
+
}
|
385
|
+
|
386
|
+
if (newColumns.length >= 20) {
|
353
387
|
return renderDialog();
|
354
388
|
}
|
355
389
|
|
@@ -18,10 +18,14 @@
|
|
18
18
|
// FilterColumn
|
19
19
|
.teamix-pro-table-toolbar-filter-column {
|
20
20
|
min-width: 180px;
|
21
|
-
max-height: 350px;
|
22
|
-
overflow: auto;
|
23
21
|
box-shadow: var(--popup-local-shadow, 0px 6px 24px 0px rgba(0, 0, 0, 0.1));
|
24
22
|
background: var(--menu-background);
|
23
|
+
|
24
|
+
&-dialog {
|
25
|
+
.next-checkbox-label {
|
26
|
+
line-height: var(--checkbox-size,16px);
|
27
|
+
}
|
28
|
+
}
|
25
29
|
&-reset {
|
26
30
|
position: absolute;
|
27
31
|
right: 16px;
|
@@ -40,7 +44,6 @@
|
|
40
44
|
visibility: visible;
|
41
45
|
cursor: pointer;
|
42
46
|
}
|
43
|
-
|
44
47
|
}
|
45
48
|
}
|
46
49
|
.next-menu-item-text {
|
@@ -76,6 +79,14 @@
|
|
76
79
|
align-items: center;
|
77
80
|
}
|
78
81
|
}
|
82
|
+
.teamix-pro-table-toolbar-filter-column-all-select.teamix-pro-table-toolbar-filter-column-all-select {
|
83
|
+
padding-bottom: 0;
|
84
|
+
}
|
85
|
+
.teamix-pro-table-toolbar-filter-column-checkbox-group.teamix-pro-table-toolbar-filter-column-checkbox-group {
|
86
|
+
padding-top: 0;
|
87
|
+
max-height: 310px;
|
88
|
+
overflow: auto;
|
89
|
+
}
|
79
90
|
|
80
91
|
// fullscreen
|
81
92
|
.teamix-pro-table-full-screen {
|
@@ -88,7 +99,7 @@
|
|
88
99
|
background-color: var(--balloon-tooltip-color-bg, #292929);
|
89
100
|
border-color: var(--balloon-tooltip-color-border, transparent);
|
90
101
|
box-shadow: var(--balloon-tooltip-shadow, none);
|
91
|
-
color: var(--balloon-tooltip-color, #
|
102
|
+
color: var(--balloon-tooltip-color, #ffffff);
|
92
103
|
display: flex;
|
93
104
|
align-items: center;
|
94
105
|
height: 36px;
|
@@ -99,7 +110,7 @@
|
|
99
110
|
display: none;
|
100
111
|
}
|
101
112
|
.next-message-content {
|
102
|
-
color: var(--balloon-tooltip-color, #
|
113
|
+
color: var(--balloon-tooltip-color, #ffffff);
|
103
114
|
padding: 0;
|
104
115
|
}
|
105
116
|
.teamix-pro-table-full-screen-message-esc {
|
@@ -108,7 +119,7 @@
|
|
108
119
|
padding: 0 2px;
|
109
120
|
position: relative;
|
110
121
|
// box-shadow: inset 0 0 1px 1px var(--color-fill1-1);
|
111
|
-
border: 1px solid var(--balloon-tooltip-color, #
|
122
|
+
border: 1px solid var(--balloon-tooltip-color, #ffffff);
|
112
123
|
display: inline-block;
|
113
124
|
line-height: 1;
|
114
125
|
&-title {
|