@coreui/react-pro 4.11.0 → 4.11.2

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/dist/index.js CHANGED
@@ -7317,7 +7317,7 @@ var CFormCheck = React$1.forwardRef(function (_a, ref) {
7317
7317
  if (inputRef.current && indeterminate) {
7318
7318
  inputRef.current.indeterminate = indeterminate;
7319
7319
  }
7320
- }, [indeterminate]);
7320
+ }, [indeterminate, inputRef.current]);
7321
7321
  var FormControl = function () { return (React$1.createElement("input", __assign$1({ type: type, className: classNames$1(button ? 'btn-check' : 'form-check-input', {
7322
7322
  'is-invalid': invalid,
7323
7323
  'is-valid': valid,
@@ -13864,12 +13864,6 @@ var getColumnLabel = function (column) {
13864
13864
  : pretifyName(column.key)
13865
13865
  : pretifyName(column);
13866
13866
  };
13867
- // export const getColumnNames = (columns: (string | Column)[] | undefined, items: Item[]) =>
13868
- // columns
13869
- // ? columns.map((column: Column | string) => {
13870
- // return typeof column === 'object' ? column.key : column
13871
- // })
13872
- // : getColumnNamesFromItems(items)
13873
13867
  var getColumnNames = function (columns, items) {
13874
13868
  if (columns) {
13875
13869
  var _columns = [];
@@ -14064,7 +14058,8 @@ var CSmartTableBody = React$1.forwardRef(function (_a, ref) {
14064
14058
  React$1.cloneElement(scopedColumns[colName](item, trIndex + firstItemOnActivePageIndex), {
14065
14059
  key: index,
14066
14060
  })) ||
14067
- (item[colName] && (React$1.createElement(CTableDataCell, __assign$1({}, getTableDataCellProps(item, colName), { key: index }), String(item[colName])))));
14061
+ // eslint-disable-next-line unicorn/no-typeof-undefined
14062
+ (typeof item[colName] !== 'undefined' && (React$1.createElement(CTableDataCell, __assign$1({}, getTableDataCellProps(item, colName), { key: index }), String(item[colName])))));
14068
14063
  })),
14069
14064
  scopedColumns && scopedColumns.details && (React$1.createElement(React$1.Fragment, null,
14070
14065
  React$1.createElement(CTableRow, null,
@@ -14110,16 +14105,6 @@ var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
14110
14105
  var _d = React$1.useState(false), refresh = _d[0], setRefresh = _d[1];
14111
14106
  var _columns = React$1.useMemo(function () { return getColumns(columns); }, [columns]);
14112
14107
  var groups = React$1.useMemo(function () { return getColumnGroups(columns); }, [columns]);
14113
- React$1.useEffect(function () {
14114
- if (selectedAll === 'indeterminate') {
14115
- if (selectAllcheckboxRef.current)
14116
- selectAllcheckboxRef.current.indeterminate = true;
14117
- }
14118
- else {
14119
- if (selectAllcheckboxRef.current)
14120
- selectAllcheckboxRef.current.indeterminate = false;
14121
- }
14122
- }, [selectedAll]);
14123
14108
  React$1.useEffect(function () {
14124
14109
  if (columnFilterState && Object.keys(columnFilterState).length === 0) {
14125
14110
  setRefresh(true);
@@ -14153,7 +14138,7 @@ var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
14153
14138
  selectable && React$1.createElement(CTableHeaderCell, null),
14154
14139
  row.map(function (cell, index) { return (React$1.createElement(CTableHeaderCell, __assign$1({ colSpan: cell.colspan }, getTableHeaderCellProps(cell), { key: index }), cell.label)); }))); }),
14155
14140
  React$1.createElement(CTableRow, null,
14156
- selectable && (React$1.createElement(CTableHeaderCell, null, selectAll && (React$1.createElement(CFormCheck, { checked: typeof selectedAll === 'boolean' ? selectedAll : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: selectAllcheckboxRef })))),
14141
+ selectable && (React$1.createElement(CTableHeaderCell, null, selectAll && (React$1.createElement(CFormCheck, { checked: typeof selectedAll === 'boolean' ? selectedAll : false, indeterminate: selectedAll === 'indeterminate' ? true : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: selectAllcheckboxRef })))),
14157
14142
  _columns.map(function (column, index) {
14158
14143
  return (React$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), { onClick: function () { return handleSort && handleSort(getColumnKey(column), index); }, style: getTableHeaderCellStyles(column, columnSorter), key: index }),
14159
14144
  React$1.createElement("div", { className: "d-inline" }, getColumnLabel(column)),
@@ -14345,7 +14330,7 @@ var CSmartTable = React$1.forwardRef(function (_a, ref) {
14345
14330
  if (selectAll && typeof selectAll === 'object' && selectAll.external) {
14346
14331
  return;
14347
14332
  }
14348
- setSelected(_items.map(function (item) {
14333
+ setSelected(__assign$1({}, _items).map(function (item) {
14349
14334
  delete item['_cellProps'];
14350
14335
  delete item['_props'];
14351
14336
  delete item['_selected'];