@coreui/react-pro 4.11.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/react-pro",
3
- "version": "4.11.1",
3
+ "version": "4.11.2",
4
4
  "description": "UI Components Library for React.js",
5
5
  "keywords": [
6
6
  "react",
@@ -112,7 +112,7 @@ export const CFormCheck = forwardRef<HTMLInputElement, CFormCheckProps>(
112
112
  if (inputRef.current && indeterminate) {
113
113
  inputRef.current.indeterminate = indeterminate
114
114
  }
115
- }, [indeterminate])
115
+ }, [indeterminate, inputRef.current])
116
116
 
117
117
  const FormControl = () => (
118
118
  <input
@@ -266,7 +266,7 @@ export const CSmartTable = forwardRef<HTMLDivElement, CSmartTableProps>(
266
266
  }
267
267
 
268
268
  setSelected(
269
- _items.map((item) => {
269
+ { ..._items }.map((item) => {
270
270
  delete item['_cellProps']
271
271
  delete item['_props']
272
272
  delete item['_selected']
@@ -80,14 +80,6 @@ export const CSmartTableHead = forwardRef<HTMLTableSectionElement, CSmartTableHe
80
80
  const _columns = useMemo(() => getColumns(columns), [columns])
81
81
  const groups = useMemo(() => getColumnGroups(columns), [columns])
82
82
 
83
- useEffect(() => {
84
- if (selectedAll === 'indeterminate') {
85
- if (selectAllcheckboxRef.current) selectAllcheckboxRef.current.indeterminate = true
86
- } else {
87
- if (selectAllcheckboxRef.current) selectAllcheckboxRef.current.indeterminate = false
88
- }
89
- }, [selectedAll])
90
-
91
83
  useEffect(() => {
92
84
  if (columnFilterState && Object.keys(columnFilterState).length === 0) {
93
85
  setRefresh(true)
@@ -145,6 +137,7 @@ export const CSmartTableHead = forwardRef<HTMLTableSectionElement, CSmartTableHe
145
137
  {selectAll && (
146
138
  <CFormCheck
147
139
  checked={typeof selectedAll === 'boolean' ? selectedAll : false}
140
+ indeterminate={selectedAll === 'indeterminate' ? true : false}
148
141
  onChange={() => handleSelectAllChecked && handleSelectAllChecked()}
149
142
  ref={selectAllcheckboxRef}
150
143
  />
@@ -163,8 +156,8 @@ export const CSmartTableHead = forwardRef<HTMLTableSectionElement, CSmartTableHe
163
156
  {columnSorter &&
164
157
  (typeof column === 'object'
165
158
  ? typeof column.sorter === 'undefined'
166
- ? true
167
- : column.sorter
159
+ ? true
160
+ : column.sorter
168
161
  : true) &&
169
162
  columnSorterIcon(column)}
170
163
  </CTableHeaderCell>
@@ -180,8 +173,8 @@ export const CSmartTableHead = forwardRef<HTMLTableSectionElement, CSmartTableHe
180
173
  {(
181
174
  typeof column === 'object'
182
175
  ? column.filter === undefined
183
- ? true
184
- : column.filter
176
+ ? true
177
+ : column.filter
185
178
  : true
186
179
  ) ? (
187
180
  typeof column !== 'string' && typeof column.filter === 'function' ? (
@@ -78,13 +78,6 @@ export const getColumnLabel = (column: Column | string) =>
78
78
  : pretifyName(column.key)
79
79
  : pretifyName(column)
80
80
 
81
- // export const getColumnNames = (columns: (string | Column)[] | undefined, items: Item[]) =>
82
- // columns
83
- // ? columns.map((column: Column | string) => {
84
- // return typeof column === 'object' ? column.key : column
85
- // })
86
- // : getColumnNamesFromItems(items)
87
-
88
81
  export const getColumnNames = (
89
82
  columns: (string | Column)[] | undefined,
90
83
  items: Item[],