@coreui/react-pro 4.11.1 → 4.11.3

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 = [];
@@ -14111,16 +14105,6 @@ var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
14111
14105
  var _d = React$1.useState(false), refresh = _d[0], setRefresh = _d[1];
14112
14106
  var _columns = React$1.useMemo(function () { return getColumns(columns); }, [columns]);
14113
14107
  var groups = React$1.useMemo(function () { return getColumnGroups(columns); }, [columns]);
14114
- React$1.useEffect(function () {
14115
- if (selectedAll === 'indeterminate') {
14116
- if (selectAllcheckboxRef.current)
14117
- selectAllcheckboxRef.current.indeterminate = true;
14118
- }
14119
- else {
14120
- if (selectAllcheckboxRef.current)
14121
- selectAllcheckboxRef.current.indeterminate = false;
14122
- }
14123
- }, [selectedAll]);
14124
14108
  React$1.useEffect(function () {
14125
14109
  if (columnFilterState && Object.keys(columnFilterState).length === 0) {
14126
14110
  setRefresh(true);
@@ -14154,7 +14138,7 @@ var CSmartTableHead = React$1.forwardRef(function (_a, ref) {
14154
14138
  selectable && React$1.createElement(CTableHeaderCell, null),
14155
14139
  row.map(function (cell, index) { return (React$1.createElement(CTableHeaderCell, __assign$1({ colSpan: cell.colspan }, getTableHeaderCellProps(cell), { key: index }), cell.label)); }))); }),
14156
14140
  React$1.createElement(CTableRow, null,
14157
- 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 })))),
14158
14142
  _columns.map(function (column, index) {
14159
14143
  return (React$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), { onClick: function () { return handleSort && handleSort(getColumnKey(column), index); }, style: getTableHeaderCellStyles(column, columnSorter), key: index }),
14160
14144
  React$1.createElement("div", { className: "d-inline" }, getColumnLabel(column)),
@@ -14346,7 +14330,10 @@ var CSmartTable = React$1.forwardRef(function (_a, ref) {
14346
14330
  if (selectAll && typeof selectAll === 'object' && selectAll.external) {
14347
14331
  return;
14348
14332
  }
14349
- setSelected(_items.map(function (item) {
14333
+ var selected = _items.map(function (item) {
14334
+ return __assign$1({}, item);
14335
+ });
14336
+ setSelected(selected.map(function (item) {
14350
14337
  delete item['_cellProps'];
14351
14338
  delete item['_props'];
14352
14339
  delete item['_selected'];