@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/README.md +1 -1
- package/dist/index.es.js +6 -19
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +6 -19
- 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 +5 -1
- package/src/components/smart-table/CSmartTableHead.tsx +5 -12
- package/src/components/smart-table/utils.ts +0 -7
package/package.json
CHANGED
|
@@ -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
|
|
@@ -265,8 +265,12 @@ export const CSmartTable = forwardRef<HTMLDivElement, CSmartTableProps>(
|
|
|
265
265
|
return
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
const selected = _items.map((item) => {
|
|
269
|
+
return { ...item }
|
|
270
|
+
})
|
|
271
|
+
|
|
268
272
|
setSelected(
|
|
269
|
-
|
|
273
|
+
selected.map((item) => {
|
|
270
274
|
delete item['_cellProps']
|
|
271
275
|
delete item['_props']
|
|
272
276
|
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
|
-
|
|
167
|
-
|
|
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
|
-
|
|
184
|
-
|
|
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[],
|