qbs-react-grid 1.0.48 → 1.0.50
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/QbsTable.js +5 -2
- package/es/qbsTable/commontypes.d.ts +1 -6
- package/es/qbsTable/commontypes.js +0 -6
- package/lib/qbsTable/CustomTableCell.js +8 -13
- package/lib/qbsTable/QbsTable.js +4 -1
- package/lib/qbsTable/commontypes.d.ts +1 -6
- package/lib/qbsTable/commontypes.js +1 -7
- package/package.json +1 -1
- package/src/qbsTable/CustomTableCell.tsx +0 -2
- package/src/qbsTable/QbsTable.tsx +6 -2
- package/src/qbsTable/commontypes.ts +2 -7
|
@@ -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/QbsTable.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React, { useCallback, useEffect, useMemo,
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import Cell from '../Cell';
|
|
4
4
|
import Column from '../Column';
|
|
5
5
|
import ColumnGroup from '../ColumnGroup';
|
|
@@ -10,9 +10,9 @@ import { ActionCell, CheckCell, CustomTableCell, ExpandCell } from './CustomTabl
|
|
|
10
10
|
import ToolBar from './Toolbar';
|
|
11
11
|
import ColumToggle from './utilities/ColumShowHide';
|
|
12
12
|
import debounce from './utilities/debounce';
|
|
13
|
+
import { deepEqual } from './utilities/deepEqual';
|
|
13
14
|
import { SettingsIcon } from './utilities/icons';
|
|
14
15
|
import '../../dist/css/qbs-react-grid.css';
|
|
15
|
-
import { deepEqual } from './utilities/deepEqual';
|
|
16
16
|
var CHECKBOX_LINE_HEIGHT = '36px';
|
|
17
17
|
var COLUMN_WIDTH = 250;
|
|
18
18
|
var QbsTable = function QbsTable(_ref) {
|
|
@@ -258,6 +258,9 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
258
258
|
});
|
|
259
259
|
setColumns(reColumns);
|
|
260
260
|
}, [columns]);
|
|
261
|
+
useEffect(function () {
|
|
262
|
+
setColumns(propColumn);
|
|
263
|
+
}, [propColumn]);
|
|
261
264
|
useEffect(function () {
|
|
262
265
|
if (!deepEqual(columns, prevColumns.current)) {
|
|
263
266
|
handleColumnsResizable();
|
|
@@ -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,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/QbsTable.js
CHANGED
|
@@ -15,9 +15,9 @@ var _CustomTableCell = require("./CustomTableCell");
|
|
|
15
15
|
var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
16
16
|
var _ColumShowHide = _interopRequireDefault(require("./utilities/ColumShowHide"));
|
|
17
17
|
var _debounce = _interopRequireDefault(require("./utilities/debounce"));
|
|
18
|
+
var _deepEqual = require("./utilities/deepEqual");
|
|
18
19
|
var _icons = require("./utilities/icons");
|
|
19
20
|
require("../../dist/css/qbs-react-grid.css");
|
|
20
|
-
var _deepEqual = require("./utilities/deepEqual");
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
var CHECKBOX_LINE_HEIGHT = '36px';
|
|
@@ -265,6 +265,9 @@ var QbsTable = function QbsTable(_ref) {
|
|
|
265
265
|
});
|
|
266
266
|
setColumns(reColumns);
|
|
267
267
|
}, [columns]);
|
|
268
|
+
(0, _react.useEffect)(function () {
|
|
269
|
+
setColumns(propColumn);
|
|
270
|
+
}, [propColumn]);
|
|
268
271
|
(0, _react.useEffect)(function () {
|
|
269
272
|
if (!(0, _deepEqual.deepEqual)(columns, prevColumns.current)) {
|
|
270
273
|
handleColumnsResizable();
|
|
@@ -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;
|
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
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useMemo,
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import Cell from '../Cell';
|
|
4
4
|
import Column from '../Column';
|
|
@@ -11,10 +11,10 @@ import { ActionCell, CheckCell, CustomTableCell, ExpandCell } from './CustomTabl
|
|
|
11
11
|
import ToolBar from './Toolbar';
|
|
12
12
|
import ColumToggle from './utilities/ColumShowHide';
|
|
13
13
|
import debounce from './utilities/debounce';
|
|
14
|
+
import { deepEqual } from './utilities/deepEqual';
|
|
14
15
|
import { SettingsIcon } from './utilities/icons';
|
|
15
16
|
|
|
16
17
|
import '../../dist/css/qbs-react-grid.css';
|
|
17
|
-
import { deepEqual } from './utilities/deepEqual';
|
|
18
18
|
|
|
19
19
|
const CHECKBOX_LINE_HEIGHT = '36px';
|
|
20
20
|
const COLUMN_WIDTH = 250;
|
|
@@ -246,6 +246,10 @@ const QbsTable: React.FC<QbsTableProps> = ({
|
|
|
246
246
|
setColumns(reColumns);
|
|
247
247
|
}, [columns]);
|
|
248
248
|
|
|
249
|
+
useEffect(() => {
|
|
250
|
+
setColumns(propColumn);
|
|
251
|
+
}, [propColumn]);
|
|
252
|
+
|
|
249
253
|
useEffect(() => {
|
|
250
254
|
if (!deepEqual(columns, prevColumns.current)) {
|
|
251
255
|
handleColumnsResizable();
|
|
@@ -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;
|
|
@@ -128,6 +123,6 @@ export interface QbsTableToolbarProps {
|
|
|
128
123
|
action: (checked: (number | string)[]) => void;
|
|
129
124
|
disabled?: boolean;
|
|
130
125
|
hidden?: boolean;
|
|
131
|
-
customHide?:string
|
|
126
|
+
customHide?: string;
|
|
132
127
|
}[];
|
|
133
128
|
}
|