Redo changes
This commit is contained in:
parent
0f7e576f19
commit
5df34310d4
|
@ -48,22 +48,28 @@ export const createStores = () => {
|
||||||
export const deriveStores = context => {
|
export const deriveStores = context => {
|
||||||
const { columns, stickyColumn } = context
|
const { columns, stickyColumn } = context
|
||||||
|
|
||||||
// Derive if we have any normal columns
|
// Quick access to all columns
|
||||||
const hasNonAutoColumn = derived(
|
const allColumns = derived(
|
||||||
[columns, stickyColumn],
|
[columns, stickyColumn],
|
||||||
([$columns, $stickyColumn]) => {
|
([$columns, $stickyColumn]) => {
|
||||||
let allCols = $columns || []
|
let allCols = $columns || []
|
||||||
if ($stickyColumn) {
|
if ($stickyColumn) {
|
||||||
allCols = [...allCols, $stickyColumn]
|
allCols = [...allCols, $stickyColumn]
|
||||||
}
|
}
|
||||||
const normalCols = allCols.filter(column => {
|
return allCols
|
||||||
return !column.schema?.autocolumn
|
|
||||||
})
|
|
||||||
return normalCols.length > 0
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Derive if we have any normal columns
|
||||||
|
const hasNonAutoColumn = derived(allColumns, $allColumns => {
|
||||||
|
const normalCols = $allColumns.filter(column => {
|
||||||
|
return !column.schema?.autocolumn
|
||||||
|
})
|
||||||
|
return normalCols.length > 0
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
allColumns,
|
||||||
hasNonAutoColumn,
|
hasNonAutoColumn,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue