@lemon-fe/components 1.2.9 → 1.2.11-alpha.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.
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ActionsProps } from '../actions';
|
|
3
|
+
import type { PaginationType } from '../data-grid/typings';
|
|
3
4
|
import type { FilterProps } from '../filter/typings';
|
|
4
5
|
import type { AgGridReactProps } from '@ag-grid-community/react';
|
|
5
6
|
interface ContextProps {
|
|
6
7
|
/** 目前DataGrid由于是类组件,比较难处理,只支持ag-grid自带的属性 */
|
|
7
|
-
DataGrid?: Omit<AgGridReactProps<any>, 'rowSelection' | 'pagination'
|
|
8
|
+
DataGrid?: Omit<AgGridReactProps<any>, 'rowSelection' | 'pagination'> & {
|
|
9
|
+
pagination?: PaginationType;
|
|
10
|
+
};
|
|
8
11
|
Filter?: FilterProps<any>;
|
|
9
12
|
Actions?: Partial<ActionsProps>;
|
|
10
13
|
}
|
package/es/data-grid/index.js
CHANGED
|
@@ -1681,7 +1681,7 @@ var InternalDataGrid = /*#__PURE__*/function (_Component) {
|
|
|
1681
1681
|
enableCellEditingOnBackspace: true,
|
|
1682
1682
|
maintainColumnOrder: true,
|
|
1683
1683
|
suppressCsvExport: true,
|
|
1684
|
-
|
|
1684
|
+
suppressRowClickSelection: gridRowSelection === 'multiple',
|
|
1685
1685
|
noRowsOverlayComponent: this.NoRowsOverlay,
|
|
1686
1686
|
getMainMenuItems: this.getMainMenuItems,
|
|
1687
1687
|
rowBuffer: 20,
|
|
@@ -72,6 +72,11 @@ interface Props<RecordType, ParamsType extends Record<string, any>> extends Pick
|
|
|
72
72
|
set: (data: CustomColumnData) => Promise<void> | void;
|
|
73
73
|
get: () => Promise<CustomColumnData | null | undefined> | CustomColumnData | null | undefined;
|
|
74
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* @description 表格顶部header区域自定义
|
|
77
|
+
* @default null
|
|
78
|
+
*/
|
|
79
|
+
header?: ReactElement | null;
|
|
75
80
|
}
|
|
76
81
|
export default function SelectView<RecordType extends Record<string | number, any>, ParamsType extends Record<string, any>>(props: Props<RecordType, ParamsType>): JSX.Element;
|
|
77
82
|
export {};
|
package/es/select-view/index.js
CHANGED
|
@@ -51,7 +51,9 @@ export default function SelectView(props) {
|
|
|
51
51
|
isRowSelectable = props.isRowSelectable,
|
|
52
52
|
checkSearchParams = props.checkSearchParams,
|
|
53
53
|
sideBar = props.sideBar,
|
|
54
|
-
customColumnPanelStorage = props.customColumnPanelStorage
|
|
54
|
+
customColumnPanelStorage = props.customColumnPanelStorage,
|
|
55
|
+
_props$header = props.header,
|
|
56
|
+
headerProp = _props$header === void 0 ? null : _props$header;
|
|
55
57
|
var prefix = prefixClassName("select-view");
|
|
56
58
|
var _useState = useState(value || emptyValue),
|
|
57
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -150,30 +152,32 @@ export default function SelectView(props) {
|
|
|
150
152
|
};
|
|
151
153
|
var headerNode = null;
|
|
152
154
|
var siderNode = null;
|
|
153
|
-
if (filter) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
155
|
+
if (filter && filter.data) {
|
|
156
|
+
headerNode = /*#__PURE__*/React.createElement(React.Fragment, null, headerProp && /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: prefix('head-wrapper')
|
|
158
|
+
}, headerProp), /*#__PURE__*/React.createElement(Filter, _extends({
|
|
159
|
+
simple: true,
|
|
160
|
+
autoPlaceholder: true,
|
|
161
|
+
form: filterForm
|
|
162
|
+
}, filter, {
|
|
163
|
+
value: cParams,
|
|
164
|
+
onChange: function onChange(val) {
|
|
165
|
+
return handleChangeParams(_objectSpread(_objectSpread({}, cParams), val));
|
|
166
|
+
}
|
|
167
|
+
})));
|
|
168
|
+
} else if (headerProp) {
|
|
169
|
+
headerNode = headerProp;
|
|
170
|
+
}
|
|
171
|
+
if (filter && filter.sider) {
|
|
172
|
+
siderNode = filter.sider({
|
|
173
|
+
/**
|
|
174
|
+
* 原则上这里使用cParams也会有问题,不排除Filter中的条件可能会影响Sider的渲染,但此种情况先忽略,尽可能避免这个情况
|
|
175
|
+
*/
|
|
176
|
+
value: cParams,
|
|
177
|
+
onChange: function onChange(val) {
|
|
178
|
+
handleChangeParams(_objectSpread(_objectSpread(_objectSpread({}, cParams), filterForm.getFieldsValue()), val));
|
|
179
|
+
}
|
|
180
|
+
});
|
|
177
181
|
}
|
|
178
182
|
var dataKeys = useMemo(function () {
|
|
179
183
|
return data.map(getRowKey);
|
|
@@ -234,6 +238,8 @@ export default function SelectView(props) {
|
|
|
234
238
|
handleChangeData([node.id], [node.data], true);
|
|
235
239
|
}
|
|
236
240
|
},
|
|
241
|
+
rowMultiSelectWithClick: true,
|
|
242
|
+
suppressRowClickSelection: false,
|
|
237
243
|
sideBar: sideBar,
|
|
238
244
|
rowHeight: rowHeight,
|
|
239
245
|
defaultColDef: defaultColDef,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11-alpha.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"registry": "https://registry.npmjs.org"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "084f158755b14b82bca352d812f0da492b120b66"
|
|
71
71
|
}
|