@typeolymp/ui-components 1.19.32 → 1.19.34

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/build/index.es.js CHANGED
@@ -48538,9 +48538,6 @@ var templateObject_1$1, templateObject_2$1, templateObject_3$1, templateObject_4
48538
48538
  var Table = function (_a) {
48539
48539
  var columns = _a.columns, data = _a.data, emptyText = _a.emptyText, rowSelection = _a.rowSelection;
48540
48540
  var _b = useState([]), selectedRowKeys = _b[0], setSelectedRowKeys = _b[1];
48541
- useEffect(function () {
48542
- setSelectedRowKeys([]);
48543
- }, [data]);
48544
48541
  var onSelectRow = function (selectedKey) {
48545
48542
  var index = selectedRowKeys.indexOf(selectedKey);
48546
48543
  var newSelectedRowKeys = __spreadArray([], selectedRowKeys, true);
@@ -48581,10 +48578,10 @@ var Table = function (_a) {
48581
48578
  display: "flex",
48582
48579
  justifyContent: "center",
48583
48580
  marginTop: 10,
48584
- } }, { children: jsx$1(Checkbox, { id: "selectAll", name: "selectAll", value: "selectAll", checked: selectedRowKeys.length === data.length, onChange: onSelectAllRows }) }))), columns.map(function (_a, index) {
48581
+ } }, { children: jsx$1(Checkbox, { id: "selectAll", name: "selectAll", value: "selectAll", checked: selectedRowKeys.length > 0 && selectedRowKeys.length === data.length, onChange: onSelectAllRows }) }))), columns.map(function (_a, index) {
48585
48582
  var title = _a.title, titlePopup = _a.titlePopup, dataIndex = _a.dataIndex;
48586
48583
  return (jsx$1(ColumnTitle, { children: jsxs("div", __assign$2({ style: { display: "flex", alignItems: "center", gap: 5 } }, { children: [title && (jsx$1(Heading, __assign$2({ type: "h6", as: "span" }, { children: title }))), titlePopup && (jsx$1(Popup, __assign$2({ content: titlePopup }, { children: jsx$1(Icon, { type: "questionCircle", size: "tiny", color: "lightGray" }) })))] })) }, "".concat(dataIndex, "-").concat(index)));
48587
- })] }) }), jsx$1(TableBody, { children: data.length === 0 ? (jsx$1(TableRow, { children: jsx$1(EmptyTableCell, __assign$2({ colSpan: columns.length }, { children: jsx$1(Paragraph, __assign$2({ align: "center", size: "small", weight: "regular" }, { children: emptyText || "No data" })) })) })) : (data.map(function (row, rowIndex) { return (jsxs(TableRow, { children: [rowSelection && (jsx$1(TableCell, { children: jsx$1(Checkbox, { id: rowIndex.toString(), name: rowIndex.toString(), value: row.key, checked: selectedRowKeys.includes(row.key), onChange: onSelectRow }) }, "row-select-".concat(rowIndex))), columns.map(function (_a, colIndex) {
48584
+ })] }) }), jsx$1(TableBody, { children: data.length === 0 ? (jsx$1(TableRow, { children: jsx$1(EmptyTableCell, __assign$2({ colSpan: rowSelection ? columns.length + 1 : columns.length }, { children: jsx$1(Paragraph, __assign$2({ align: "center", size: "small", weight: "regular" }, { children: emptyText || "No data" })) })) })) : (data.map(function (row, rowIndex) { return (jsxs(TableRow, { children: [rowSelection && (jsx$1(TableCell, { children: jsx$1(Checkbox, { id: rowIndex.toString(), name: rowIndex.toString(), value: row.key, checked: selectedRowKeys.includes(row.key), onChange: onSelectRow }) }, "row-select-".concat(rowIndex))), columns.map(function (_a, colIndex) {
48588
48585
  var dataIndex = _a.dataIndex, render = _a.render, align = _a.align;
48589
48586
  var data = row[dataIndex];
48590
48587
  return (jsx$1(TableCell, __assign$2({ align: align }, { children: render ? render(data, row) : data }), "col-".concat(colIndex)));