Skip to content

Commit

Permalink
add 'indeterminate' value in haeder checkbox for selectable table ele…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
LrxGaelle committed May 17, 2024
1 parent 9ea629f commit 2e19da0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/BIMDataComponents/BIMDataTable/BIMDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
<th class="cell-checkbox" v-if="selectable">
<BIMDataCheckbox
:disabled="rows.length === 0"
:modelValue="
rows.length > 0 && rowSelection.size === rows.length
"
:modelValue="selectedElements"
@update:modelValue="toggleAll"
/>
</th>
Expand Down Expand Up @@ -278,6 +276,14 @@ export default {
}
);
const selectedElements = computed(() =>
rowSelection.value.size < props.rows.length
? rowSelection.value.size > 0
? null
: false
: rowSelection.value.size > 0
);
const toggleRow = row => {
if (props.selectable) {
toggleRowSelection(row);
Expand Down Expand Up @@ -470,6 +476,7 @@ export default {
displayedColumnFilterId,
filteringColumns,
filters,
selectedElements,
sortObject,
// Methods
awayFromFilter,
Expand Down

0 comments on commit 2e19da0

Please sign in to comment.