@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/README.md +1 -1
- package/dist/index.es.js +5 -20
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +5 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/form/CFormCheck.tsx +1 -1
- package/src/components/smart-table/CSmartTable.tsx +1 -1
- package/src/components/smart-table/CSmartTableBody.tsx +2 -1
- package/src/components/smart-table/CSmartTableHead.tsx +5 -12
- package/src/components/smart-table/utils.ts +0 -7
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
Several quick start options are available:
|
|
44
44
|
|
|
45
|
-
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.11.
|
|
45
|
+
- [Download the latest release](https://github.com/coreui/coreui-react-pro/archive/v4.11.2.zip)
|
|
46
46
|
- Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
|
|
47
47
|
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
|
|
48
48
|
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
|
package/dist/index.es.js
CHANGED
|
@@ -7297,7 +7297,7 @@ var CFormCheck = forwardRef(function (_a, ref) {
|
|
|
7297
7297
|
if (inputRef.current && indeterminate) {
|
|
7298
7298
|
inputRef.current.indeterminate = indeterminate;
|
|
7299
7299
|
}
|
|
7300
|
-
}, [indeterminate]);
|
|
7300
|
+
}, [indeterminate, inputRef.current]);
|
|
7301
7301
|
var FormControl = function () { return (React__default$1.createElement("input", __assign$1({ type: type, className: classNames$1(button ? 'btn-check' : 'form-check-input', {
|
|
7302
7302
|
'is-invalid': invalid,
|
|
7303
7303
|
'is-valid': valid,
|
|
@@ -13844,12 +13844,6 @@ var getColumnLabel = function (column) {
|
|
|
13844
13844
|
: pretifyName(column.key)
|
|
13845
13845
|
: pretifyName(column);
|
|
13846
13846
|
};
|
|
13847
|
-
// export const getColumnNames = (columns: (string | Column)[] | undefined, items: Item[]) =>
|
|
13848
|
-
// columns
|
|
13849
|
-
// ? columns.map((column: Column | string) => {
|
|
13850
|
-
// return typeof column === 'object' ? column.key : column
|
|
13851
|
-
// })
|
|
13852
|
-
// : getColumnNamesFromItems(items)
|
|
13853
13847
|
var getColumnNames = function (columns, items) {
|
|
13854
13848
|
if (columns) {
|
|
13855
13849
|
var _columns = [];
|
|
@@ -14044,7 +14038,8 @@ var CSmartTableBody = forwardRef(function (_a, ref) {
|
|
|
14044
14038
|
React__default$1.cloneElement(scopedColumns[colName](item, trIndex + firstItemOnActivePageIndex), {
|
|
14045
14039
|
key: index,
|
|
14046
14040
|
})) ||
|
|
14047
|
-
|
|
14041
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined
|
|
14042
|
+
(typeof item[colName] !== 'undefined' && (React__default$1.createElement(CTableDataCell, __assign$1({}, getTableDataCellProps(item, colName), { key: index }), String(item[colName])))));
|
|
14048
14043
|
})),
|
|
14049
14044
|
scopedColumns && scopedColumns.details && (React__default$1.createElement(React__default$1.Fragment, null,
|
|
14050
14045
|
React__default$1.createElement(CTableRow, null,
|
|
@@ -14090,16 +14085,6 @@ var CSmartTableHead = forwardRef(function (_a, ref) {
|
|
|
14090
14085
|
var _d = useState(false), refresh = _d[0], setRefresh = _d[1];
|
|
14091
14086
|
var _columns = useMemo(function () { return getColumns(columns); }, [columns]);
|
|
14092
14087
|
var groups = useMemo(function () { return getColumnGroups(columns); }, [columns]);
|
|
14093
|
-
useEffect(function () {
|
|
14094
|
-
if (selectedAll === 'indeterminate') {
|
|
14095
|
-
if (selectAllcheckboxRef.current)
|
|
14096
|
-
selectAllcheckboxRef.current.indeterminate = true;
|
|
14097
|
-
}
|
|
14098
|
-
else {
|
|
14099
|
-
if (selectAllcheckboxRef.current)
|
|
14100
|
-
selectAllcheckboxRef.current.indeterminate = false;
|
|
14101
|
-
}
|
|
14102
|
-
}, [selectedAll]);
|
|
14103
14088
|
useEffect(function () {
|
|
14104
14089
|
if (columnFilterState && Object.keys(columnFilterState).length === 0) {
|
|
14105
14090
|
setRefresh(true);
|
|
@@ -14133,7 +14118,7 @@ var CSmartTableHead = forwardRef(function (_a, ref) {
|
|
|
14133
14118
|
selectable && React__default$1.createElement(CTableHeaderCell, null),
|
|
14134
14119
|
row.map(function (cell, index) { return (React__default$1.createElement(CTableHeaderCell, __assign$1({ colSpan: cell.colspan }, getTableHeaderCellProps(cell), { key: index }), cell.label)); }))); }),
|
|
14135
14120
|
React__default$1.createElement(CTableRow, null,
|
|
14136
|
-
selectable && (React__default$1.createElement(CTableHeaderCell, null, selectAll && (React__default$1.createElement(CFormCheck, { checked: typeof selectedAll === 'boolean' ? selectedAll : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: selectAllcheckboxRef })))),
|
|
14121
|
+
selectable && (React__default$1.createElement(CTableHeaderCell, null, selectAll && (React__default$1.createElement(CFormCheck, { checked: typeof selectedAll === 'boolean' ? selectedAll : false, indeterminate: selectedAll === 'indeterminate' ? true : false, onChange: function () { return handleSelectAllChecked && handleSelectAllChecked(); }, ref: selectAllcheckboxRef })))),
|
|
14137
14122
|
_columns.map(function (column, index) {
|
|
14138
14123
|
return (React__default$1.createElement(CTableHeaderCell, __assign$1({}, getTableHeaderCellProps(column), { onClick: function () { return handleSort && handleSort(getColumnKey(column), index); }, style: getTableHeaderCellStyles(column, columnSorter), key: index }),
|
|
14139
14124
|
React__default$1.createElement("div", { className: "d-inline" }, getColumnLabel(column)),
|
|
@@ -14325,7 +14310,7 @@ var CSmartTable = forwardRef(function (_a, ref) {
|
|
|
14325
14310
|
if (selectAll && typeof selectAll === 'object' && selectAll.external) {
|
|
14326
14311
|
return;
|
|
14327
14312
|
}
|
|
14328
|
-
setSelected(_items.map(function (item) {
|
|
14313
|
+
setSelected(__assign$1({}, _items).map(function (item) {
|
|
14329
14314
|
delete item['_cellProps'];
|
|
14330
14315
|
delete item['_props'];
|
|
14331
14316
|
delete item['_selected'];
|