qbs-react-grid 1.0.47 → 1.0.49
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/qbsTable/CustomTableCell.js +8 -13
- package/es/qbsTable/Toolbar.js +10 -1
- package/es/qbsTable/commontypes.d.ts +3 -6
- package/es/qbsTable/commontypes.js +0 -6
- package/lib/qbsTable/CustomTableCell.js +8 -13
- package/lib/qbsTable/Toolbar.js +10 -1
- package/lib/qbsTable/commontypes.d.ts +3 -6
- package/lib/qbsTable/commontypes.js +1 -7
- package/package.json +1 -1
- package/src/qbsTable/CustomTableCell.tsx +0 -2
- package/src/qbsTable/Toolbar.tsx +10 -2
- package/src/qbsTable/commontypes.ts +3 -6
|
@@ -80,17 +80,12 @@ export var CustomTableCell = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
80
80
|
rowClick = _ref4.rowClick,
|
|
81
81
|
link = _ref4.link,
|
|
82
82
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded3);
|
|
83
|
-
return (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
className: "qbs-table-row-link"
|
|
93
|
-
}, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : rowData[dataKey]) : /*#__PURE__*/React.createElement(React.Fragment, null, (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell))
|
|
94
|
-
// </TooltipComponent>
|
|
95
|
-
);
|
|
83
|
+
return /*#__PURE__*/React.createElement(Cell, _extends({}, props, {
|
|
84
|
+
dataKey: dataKey
|
|
85
|
+
}), link ? /*#__PURE__*/React.createElement("a", {
|
|
86
|
+
onClick: function onClick() {
|
|
87
|
+
return rowClick === null || rowClick === void 0 ? void 0 : rowClick(rowData);
|
|
88
|
+
},
|
|
89
|
+
className: "qbs-table-row-link"
|
|
90
|
+
}, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : rowData[dataKey]) : /*#__PURE__*/React.createElement(React.Fragment, null, (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell));
|
|
96
91
|
});
|
package/es/qbsTable/Toolbar.js
CHANGED
|
@@ -32,6 +32,15 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
32
32
|
handleSearchValue === null || handleSearchValue === void 0 ? void 0 : handleSearchValue(e);
|
|
33
33
|
}
|
|
34
34
|
}, [asyncSearch, handleSearch, handleSearchValue]);
|
|
35
|
+
var handleHide = function handleHide(actions) {
|
|
36
|
+
if (actions.hidden) {
|
|
37
|
+
return false;
|
|
38
|
+
} else if (actions.customHide == '>2') {
|
|
39
|
+
return checkedKeys && (checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) >= 2 ? true : false;
|
|
40
|
+
} else {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
35
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
36
45
|
className: "qbs-table-toolbar-container"
|
|
37
46
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -67,7 +76,7 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
67
76
|
return onSelect === null || onSelect === void 0 ? void 0 : onSelect([]);
|
|
68
77
|
}
|
|
69
78
|
}, "Clear"), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
|
|
70
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
79
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, handleHide(actions) && /*#__PURE__*/React.createElement("button", {
|
|
71
80
|
key: index.toString(),
|
|
72
81
|
className: "btn",
|
|
73
82
|
disabled: actions.disabled,
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode } from 'react';
|
|
2
|
-
declare enum Align {
|
|
3
|
-
Center = "center",
|
|
4
|
-
Left = "left",
|
|
5
|
-
Right = "right"
|
|
6
|
-
}
|
|
7
2
|
interface Content {
|
|
8
3
|
cell: ReactNode | string;
|
|
9
4
|
toolTip?: string;
|
|
@@ -14,7 +9,7 @@ export interface ColumnBase {
|
|
|
14
9
|
sortable?: boolean;
|
|
15
10
|
resizable?: boolean;
|
|
16
11
|
fixed?: boolean;
|
|
17
|
-
align?:
|
|
12
|
+
align?: 'left' | 'right' | 'center';
|
|
18
13
|
colWidth?: number;
|
|
19
14
|
renderCell?: (rowData: any) => Content;
|
|
20
15
|
customCell?: boolean;
|
|
@@ -88,6 +83,7 @@ export interface QbsTableProps {
|
|
|
88
83
|
action: (checked: (number | string)[]) => void;
|
|
89
84
|
disabled?: boolean;
|
|
90
85
|
hidden?: boolean;
|
|
86
|
+
customHide?: string;
|
|
91
87
|
}[];
|
|
92
88
|
selectedRows?: (number | string)[];
|
|
93
89
|
classes?: {
|
|
@@ -123,6 +119,7 @@ export interface QbsTableToolbarProps {
|
|
|
123
119
|
action: (checked: (number | string)[]) => void;
|
|
124
120
|
disabled?: boolean;
|
|
125
121
|
hidden?: boolean;
|
|
122
|
+
customHide?: string;
|
|
126
123
|
}[];
|
|
127
124
|
}
|
|
128
125
|
export {};
|
|
@@ -88,18 +88,13 @@ var CustomTableCell = /*#__PURE__*/_react["default"].memo(function (_ref4) {
|
|
|
88
88
|
rowClick = _ref4.rowClick,
|
|
89
89
|
link = _ref4.link,
|
|
90
90
|
props = (0, _objectWithoutPropertiesLoose2["default"])(_ref4, _excluded3);
|
|
91
|
-
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
className: "qbs-table-row-link"
|
|
101
|
-
}, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : rowData[dataKey]) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell))
|
|
102
|
-
// </TooltipComponent>
|
|
103
|
-
);
|
|
91
|
+
return /*#__PURE__*/_react["default"].createElement(_Cell["default"], (0, _extends2["default"])({}, props, {
|
|
92
|
+
dataKey: dataKey
|
|
93
|
+
}), link ? /*#__PURE__*/_react["default"].createElement("a", {
|
|
94
|
+
onClick: function onClick() {
|
|
95
|
+
return rowClick === null || rowClick === void 0 ? void 0 : rowClick(rowData);
|
|
96
|
+
},
|
|
97
|
+
className: "qbs-table-row-link"
|
|
98
|
+
}, renderCell ? (_renderCell = renderCell(rowData)) === null || _renderCell === void 0 ? void 0 : _renderCell.cell : rowData[dataKey]) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, (_renderCell2 = renderCell(rowData)) === null || _renderCell2 === void 0 ? void 0 : _renderCell2.cell));
|
|
104
99
|
});
|
|
105
100
|
exports.CustomTableCell = CustomTableCell;
|
package/lib/qbsTable/Toolbar.js
CHANGED
|
@@ -39,6 +39,15 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
39
39
|
handleSearchValue === null || handleSearchValue === void 0 ? void 0 : handleSearchValue(e);
|
|
40
40
|
}
|
|
41
41
|
}, [asyncSearch, handleSearch, handleSearchValue]);
|
|
42
|
+
var handleHide = function handleHide(actions) {
|
|
43
|
+
if (actions.hidden) {
|
|
44
|
+
return false;
|
|
45
|
+
} else if (actions.customHide == '>2') {
|
|
46
|
+
return checkedKeys && (checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) >= 2 ? true : false;
|
|
47
|
+
} else {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
42
51
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
43
52
|
className: "qbs-table-toolbar-container"
|
|
44
53
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -74,7 +83,7 @@ var ToolBar = function ToolBar(_ref) {
|
|
|
74
83
|
return onSelect === null || onSelect === void 0 ? void 0 : onSelect([]);
|
|
75
84
|
}
|
|
76
85
|
}, "Clear"), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
|
|
77
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null,
|
|
86
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, handleHide(actions) && /*#__PURE__*/_react["default"].createElement("button", {
|
|
78
87
|
key: index.toString(),
|
|
79
88
|
className: "btn",
|
|
80
89
|
disabled: actions.disabled,
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode } from 'react';
|
|
2
|
-
declare enum Align {
|
|
3
|
-
Center = "center",
|
|
4
|
-
Left = "left",
|
|
5
|
-
Right = "right"
|
|
6
|
-
}
|
|
7
2
|
interface Content {
|
|
8
3
|
cell: ReactNode | string;
|
|
9
4
|
toolTip?: string;
|
|
@@ -14,7 +9,7 @@ export interface ColumnBase {
|
|
|
14
9
|
sortable?: boolean;
|
|
15
10
|
resizable?: boolean;
|
|
16
11
|
fixed?: boolean;
|
|
17
|
-
align?:
|
|
12
|
+
align?: 'left' | 'right' | 'center';
|
|
18
13
|
colWidth?: number;
|
|
19
14
|
renderCell?: (rowData: any) => Content;
|
|
20
15
|
customCell?: boolean;
|
|
@@ -88,6 +83,7 @@ export interface QbsTableProps {
|
|
|
88
83
|
action: (checked: (number | string)[]) => void;
|
|
89
84
|
disabled?: boolean;
|
|
90
85
|
hidden?: boolean;
|
|
86
|
+
customHide?: string;
|
|
91
87
|
}[];
|
|
92
88
|
selectedRows?: (number | string)[];
|
|
93
89
|
classes?: {
|
|
@@ -123,6 +119,7 @@ export interface QbsTableToolbarProps {
|
|
|
123
119
|
action: (checked: (number | string)[]) => void;
|
|
124
120
|
disabled?: boolean;
|
|
125
121
|
hidden?: boolean;
|
|
122
|
+
customHide?: string;
|
|
126
123
|
}[];
|
|
127
124
|
}
|
|
128
125
|
export {};
|
package/package.json
CHANGED
|
@@ -63,7 +63,6 @@ export const ExpandCell: React.FC<any> = React.memo(
|
|
|
63
63
|
export const CustomTableCell: React.FC<any> = React.memo(
|
|
64
64
|
({ rowData, renderCell, toolTip, dataKey, onChange, rowClick, link, ...props }) => {
|
|
65
65
|
return (
|
|
66
|
-
// <TooltipComponent title={renderCell ? renderCell(rowData)?.toolTip : toolTip}>
|
|
67
66
|
<Cell {...props} dataKey={dataKey}>
|
|
68
67
|
{link ? (
|
|
69
68
|
<a onClick={() => rowClick?.(rowData)} className="qbs-table-row-link">
|
|
@@ -73,7 +72,6 @@ export const CustomTableCell: React.FC<any> = React.memo(
|
|
|
73
72
|
<>{renderCell(rowData)?.cell}</>
|
|
74
73
|
)}
|
|
75
74
|
</Cell>
|
|
76
|
-
// </TooltipComponent>
|
|
77
75
|
);
|
|
78
76
|
}
|
|
79
77
|
);
|
package/src/qbsTable/Toolbar.tsx
CHANGED
|
@@ -42,7 +42,15 @@ const ToolBar: React.FC<QbsTableToolbarProps> = ({
|
|
|
42
42
|
},
|
|
43
43
|
[asyncSearch, handleSearch, handleSearchValue]
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
const handleHide = (actions: any) => {
|
|
46
|
+
if (actions.hidden) {
|
|
47
|
+
return false;
|
|
48
|
+
} else if (actions.customHide == '>2') {
|
|
49
|
+
return checkedKeys && checkedKeys?.length >= 2 ? true : false;
|
|
50
|
+
} else {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
46
54
|
return (
|
|
47
55
|
<div className="qbs-table-toolbar-container">
|
|
48
56
|
<div className={`qbs-table-toolbar ${className}`}>
|
|
@@ -75,7 +83,7 @@ const ToolBar: React.FC<QbsTableToolbarProps> = ({
|
|
|
75
83
|
</button>
|
|
76
84
|
{selectedRowActions?.map((actions, index: number) => (
|
|
77
85
|
<>
|
|
78
|
-
{
|
|
86
|
+
{handleHide(actions) && (
|
|
79
87
|
<button
|
|
80
88
|
key={index.toString()}
|
|
81
89
|
className="btn"
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
enum Align {
|
|
4
|
-
Center = 'center',
|
|
5
|
-
Left = 'left',
|
|
6
|
-
Right = 'right'
|
|
7
|
-
}
|
|
8
3
|
interface Content {
|
|
9
4
|
cell: ReactNode | string;
|
|
10
5
|
toolTip?: string;
|
|
@@ -15,7 +10,7 @@ export interface ColumnBase {
|
|
|
15
10
|
sortable?: boolean;
|
|
16
11
|
resizable?: boolean;
|
|
17
12
|
fixed?: boolean;
|
|
18
|
-
align?:
|
|
13
|
+
align?: 'left' | 'right' | 'center';
|
|
19
14
|
colWidth?: number;
|
|
20
15
|
renderCell?: (rowData: any) => Content;
|
|
21
16
|
customCell?: boolean;
|
|
@@ -93,6 +88,7 @@ export interface QbsTableProps {
|
|
|
93
88
|
action: (checked: (number | string)[]) => void;
|
|
94
89
|
disabled?: boolean;
|
|
95
90
|
hidden?: boolean;
|
|
91
|
+
customHide?: string;
|
|
96
92
|
}[];
|
|
97
93
|
selectedRows?: (number | string)[];
|
|
98
94
|
classes?: { [key: string]: any };
|
|
@@ -127,5 +123,6 @@ export interface QbsTableToolbarProps {
|
|
|
127
123
|
action: (checked: (number | string)[]) => void;
|
|
128
124
|
disabled?: boolean;
|
|
129
125
|
hidden?: boolean;
|
|
126
|
+
customHide?: string;
|
|
130
127
|
}[];
|
|
131
128
|
}
|