Skip to content

Commit

Permalink
add header select disable option to card tables
Browse files Browse the repository at this point in the history
  • Loading branch information
shachiniM committed Dec 10, 2024
1 parent 807f15a commit eadf478
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template>
<pre>{{ showHeader }}</pre>
<pre>{{ tableProps.hideHeaders }}</pre>
<oxd-card-thead v-if="showHeader && !tableProps.hideHeaders">
<oxd-card-tr :clickable="false">
<oxd-card-th
Expand All @@ -9,6 +11,7 @@
>
<oxd-checkbox-input
:checkIcon="checkIcon"
:disabled="allSelectDisabled"
v-model="selectedAll"
@change="onChangeSelectAll"
/>
Expand Down Expand Up @@ -89,6 +92,10 @@ export default defineComponent({
: 'dash';
};
const allSelectDisabled = computed(() => {
return tableProps.items.every(item => item.isSelectDisabled === true);
});
const state: State = reactive({
checkIcon: 'oxd-check',
checkedItems: [...tableProps.selected],
Expand Down Expand Up @@ -137,6 +144,7 @@ export default defineComponent({
tableProps,
screenState,
showHeader,
allSelectDisabled,
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RowOptions.args = {
items: [
{col1: 'Data 1', col2: 'Data 2', isSelectable: false, isDisabled: false},
{col1: 'Data 2', col2: 'Data 2', isSelectable: true, isDisabled: false},
{col1: 'Data 3', col2: 'Data 3', isDisabled: false, isSelectDisabled: true, selectDisabledTooltip: "Not allowed to delete data in progress"}
],
};

Expand Down

0 comments on commit eadf478

Please sign in to comment.