@lemon-fe/kits 1.0.0-169 → 1.0.0-171
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.js +11 -2
- package/es/components/DataGrid/index.less +1 -1
- package/es/components/DataGrid/typings.d.ts +1 -1
- package/es/components/Filter/index.js +13 -4
- package/es/components/Filter/typings.d.ts +5 -0
- package/es/components/State/index.d.ts +1 -1
- package/es/components/State/index.less +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
|
});
|
|
@@ -104,6 +104,7 @@ var defaultColDef = {
|
|
|
104
104
|
};
|
|
105
105
|
var defaultComponents = {
|
|
106
106
|
agColumnHeader: HeaderRenderer,
|
|
107
|
+
agColumnGroupHeader: HeaderRenderer,
|
|
107
108
|
'text-editor': TextEditor,
|
|
108
109
|
'number-editor': NumberEditor,
|
|
109
110
|
'date-editor': DateEditor,
|
|
@@ -803,7 +804,12 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
803
804
|
children: map(children)
|
|
804
805
|
};
|
|
805
806
|
|
|
806
|
-
if (title
|
|
807
|
+
if (_typeof(title) === 'object' || typeof title === 'function') {
|
|
808
|
+
opts.headerGroupComponentParams = _objectSpread(_objectSpread({}, opts.headerGroupComponentParams), {}, {
|
|
809
|
+
title: title
|
|
810
|
+
});
|
|
811
|
+
opts.headerGroupComponent = HeaderRenderer;
|
|
812
|
+
} else if (title !== undefined) {
|
|
807
813
|
opts.headerName = title.toString();
|
|
808
814
|
}
|
|
809
815
|
|
|
@@ -1410,7 +1416,10 @@ var DataGrid = /*#__PURE__*/function (_Component) {
|
|
|
1410
1416
|
}, /*#__PURE__*/React.createElement(AgGridReact, _extends({
|
|
1411
1417
|
singleClickEdit: true,
|
|
1412
1418
|
suppressPaginationPanel: true,
|
|
1413
|
-
suppressCopyRowsToClipboard: true
|
|
1419
|
+
suppressCopyRowsToClipboard: true
|
|
1420
|
+
/** 防止粘贴错误的值到可编辑表格 */
|
|
1421
|
+
,
|
|
1422
|
+
suppressClipboardPaste: true,
|
|
1414
1423
|
enableCellEditingOnBackspace: true,
|
|
1415
1424
|
loadingOverlayComponent: this.LoadingOverlay,
|
|
1416
1425
|
noRowsOverlayComponent: this.NoRowsOverlay,
|
|
@@ -50,7 +50,7 @@ export interface ColType<TData> extends Omit<ColDef<TData>, 'editable'> {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
export interface ColGroupType<T> extends Omit<ColGroupDef<T>, 'children'> {
|
|
53
|
-
title?:
|
|
53
|
+
title?: ReactNode | ((params: IHeaderParams) => ReactNode);
|
|
54
54
|
children: ColsType<T>;
|
|
55
55
|
key?: string;
|
|
56
56
|
}
|
|
@@ -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 {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface Props {
|
|
3
3
|
shape?: 'default' | 'order' | 'text';
|
|
4
|
-
type?: 'default' | 'success' | 'warning' | 'error' | 'disabled';
|
|
4
|
+
type?: 'default' | 'success' | 'warning' | 'error' | 'disabled' | 'processing';
|
|
5
5
|
children?: string;
|
|
6
6
|
}
|
|
7
7
|
export default function State(props: Props): JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@color-success: #2ca471;
|
|
2
2
|
@color-warning: #e37319;
|
|
3
3
|
@color-error: #d54a42;
|
|
4
|
+
@color-processing: #16c0ff;
|
|
4
5
|
@color-disabled: rgba(51, 51, 51, 0.5);
|
|
5
6
|
|
|
6
7
|
.@{prefixCls}-state {
|
|
@@ -74,6 +75,10 @@
|
|
|
74
75
|
.defaultShapeColor(@color-success);
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
&-type-processing&-shape-default {
|
|
79
|
+
.defaultShapeColor(@color-processing);
|
|
80
|
+
}
|
|
81
|
+
|
|
77
82
|
&-type-warning&-shape-default {
|
|
78
83
|
.defaultShapeColor(@color-warning);
|
|
79
84
|
}
|