@lemon-fe/kits 1.0.0-123 → 1.0.0-124
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,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ICellRendererParams } from '@ag-grid-community/core';
|
|
3
|
-
export default function CellDeleteRender<TData>(props: ICellRendererParams<TData>
|
|
3
|
+
export default function CellDeleteRender<TData>(props: ICellRendererParams<TData> & {
|
|
4
|
+
enable?: (data: ICellRendererParams<TData>) => boolean;
|
|
5
|
+
}): JSX.Element | null;
|
|
@@ -3,7 +3,8 @@ import React from 'react';
|
|
|
3
3
|
export default function CellDeleteRender(props) {
|
|
4
4
|
var api = props.api,
|
|
5
5
|
data = props.data,
|
|
6
|
-
node = props.node
|
|
6
|
+
node = props.node,
|
|
7
|
+
enable = props.enable;
|
|
7
8
|
|
|
8
9
|
if (node.isRowPinned()) {
|
|
9
10
|
return null;
|
|
@@ -12,6 +13,10 @@ export default function CellDeleteRender(props) {
|
|
|
12
13
|
return /*#__PURE__*/React.createElement(Icons.Delete, {
|
|
13
14
|
key: "delete",
|
|
14
15
|
onClick: function onClick() {
|
|
16
|
+
if (enable && !enable(props)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
if (data !== undefined) {
|
|
16
21
|
api.applyTransaction({
|
|
17
22
|
remove: [data]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/kits",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-124",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@ag-grid-community/react": "29.2.0",
|
|
39
39
|
"@ag-grid-community/styles": "29.2.0",
|
|
40
40
|
"@ant-design/icons": "^4.7.0",
|
|
41
|
-
"@lemon-fe/hooks": "^0.1.
|
|
41
|
+
"@lemon-fe/hooks": "^0.1.150",
|
|
42
42
|
"@lemon-fe/utils": "^0.1.117",
|
|
43
43
|
"antd": "4.24.8",
|
|
44
44
|
"async-validator": "^4.2.5",
|