@lemon-fe/kits 1.0.0-169 → 1.0.0-170
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/es/components/DataGrid/components/Selected.js +3 -3
- package/es/components/DataGrid/index.d.ts +1 -1
- package/es/components/DataGrid/index.js +4 -1
- package/es/components/DataGrid/index.less +1 -1
- package/es/components/Filter/index.js +13 -4
- package/es/components/Filter/typings.d.ts +5 -0
- package/package.json +1 -1
|
@@ -24,9 +24,9 @@ export default /*#__PURE__*/memo(function Selected(props) {
|
|
|
24
24
|
useEffect(function () {
|
|
25
25
|
return selection.listen(setKeys);
|
|
26
26
|
}, []);
|
|
27
|
-
return /*#__PURE__*/React.createElement("span", {
|
|
27
|
+
return keys.length > 0 ? /*#__PURE__*/React.createElement("span", {
|
|
28
28
|
className: prefix('selected')
|
|
29
|
-
}, "\u5DF2\u9009", keys.length, "\u6761
|
|
29
|
+
}, "\u5DF2\u9009", keys.length, "\u6761", /*#__PURE__*/React.createElement("a", {
|
|
30
30
|
onClick: onClear
|
|
31
|
-
}, "\u6E05\u7A7A\u5DF2\u9009"));
|
|
31
|
+
}, "\u6E05\u7A7A\u5DF2\u9009")) : null;
|
|
32
32
|
});
|
|
@@ -50,7 +50,7 @@ export default class DataGrid<TData extends Record<string, any>> extends Compone
|
|
|
50
50
|
Text: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").TextEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
51
51
|
Date: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").DateEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
52
52
|
Number: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & import("./typings").NumberEditorParams<any> & React.RefAttributes<import("@ag-grid-community/react").ICellEditorReactComp>>;
|
|
53
|
-
Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "
|
|
53
|
+
Select: React.ForwardRefExoticComponent<import("@ag-grid-community/core").ICellEditorParams<any, any, any> & Pick<import("antd").SelectProps<any, import("antd/lib/select").BaseOptionType>, "disabled" | "mode" | "allowClear" | "options" | "virtual" | "showSearch" | "listHeight"> & {
|
|
54
54
|
fieldNames?: {
|
|
55
55
|
label: string;
|
|
56
56
|
value: string;
|
|
@@ -1410,7 +1410,10 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
1410
1410
|
}, /*#__PURE__*/React.createElement(AgGridReact, _extends({
|
|
1411
1411
|
singleClickEdit: true,
|
|
1412
1412
|
suppressPaginationPanel: true,
|
|
1413
|
-
suppressCopyRowsToClipboard: true
|
|
1413
|
+
suppressCopyRowsToClipboard: true
|
|
1414
|
+
/** 防止粘贴错误的值到可编辑表格 */
|
|
1415
|
+
,
|
|
1416
|
+
suppressClipboardPaste: true,
|
|
1414
1417
|
enableCellEditingOnBackspace: true,
|
|
1415
1418
|
loadingOverlayComponent: this.LoadingOverlay,
|
|
1416
1419
|
noRowsOverlayComponent: this.NoRowsOverlay,
|
|
@@ -49,7 +49,10 @@ import { prefixClassName } from "../utils";
|
|
|
49
49
|
var components = [{
|
|
50
50
|
type: 'input',
|
|
51
51
|
render: function render(item) {
|
|
52
|
-
return /*#__PURE__*/React.createElement(Input,
|
|
52
|
+
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
53
|
+
allowClear: true,
|
|
54
|
+
maxLength: 125
|
|
55
|
+
}, item.extraProps));
|
|
53
56
|
}
|
|
54
57
|
}, {
|
|
55
58
|
type: 'input-number',
|
|
@@ -126,13 +129,14 @@ function Filter(props) {
|
|
|
126
129
|
defaultCollapsed = _props$defaultCollaps === void 0 ? true : _props$defaultCollaps,
|
|
127
130
|
autoPlaceholder = props.autoPlaceholder,
|
|
128
131
|
_props$preserveFields = props.preserveFields,
|
|
129
|
-
preserveFields = _props$preserveFields === void 0 ? true : _props$preserveFields
|
|
132
|
+
preserveFields = _props$preserveFields === void 0 ? true : _props$preserveFields,
|
|
133
|
+
legacyReset = props.legacyReset;
|
|
130
134
|
var prefix = prefixClassName('filter');
|
|
131
135
|
var emptyValue = useMemo(function () {
|
|
132
136
|
return Object.fromEntries(data.map(function (item) {
|
|
133
137
|
return [item.key, undefined];
|
|
134
138
|
}));
|
|
135
|
-
}, []);
|
|
139
|
+
}, [data]);
|
|
136
140
|
var defaultValue = useMemo(function () {
|
|
137
141
|
return defaultValueProp || value;
|
|
138
142
|
}, []);
|
|
@@ -346,7 +350,12 @@ function Filter(props) {
|
|
|
346
350
|
};
|
|
347
351
|
|
|
348
352
|
var handleReset = function handleReset() {
|
|
349
|
-
|
|
353
|
+
if (legacyReset) {
|
|
354
|
+
form.resetFields();
|
|
355
|
+
} else {
|
|
356
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, emptyValue), defaultValue));
|
|
357
|
+
}
|
|
358
|
+
|
|
350
359
|
handleFinish(form.getFieldsValue(), 'reset');
|
|
351
360
|
};
|
|
352
361
|
|
|
@@ -55,6 +55,11 @@ export interface FilterProps<T extends Record<string, any> = Record<string, any>
|
|
|
55
55
|
* @default true
|
|
56
56
|
*/
|
|
57
57
|
preserveFields?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @description reset行为通过form.resetFields实现,与原先保持一致
|
|
60
|
+
* 当前reset行为是通过内部的emptyValue以及defaultValue
|
|
61
|
+
*/
|
|
62
|
+
legacyReset?: true;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
export interface ComponentOption {
|