11<template >
2- <div :id =" uid " :style =" tableStyle" class =" cv-data-table" >
2+ <div :id =" cvId " :style =" tableStyle" class =" cv-data-table" >
33 <div
44 :class =" [
55 `${carbonPrefix}--data-table-container`,
5555 <div
5656 v-if =" onSearch"
5757 ref =" searchContainer"
58- :aria-labelledby =" `${uid }-search`"
58+ :aria-labelledby =" `${cvId }-search`"
5959 :class =" [
6060 `${carbonPrefix}--search `,
6161 {
7373 <Search16 :class =" `${carbonPrefix}--search-magnifier-icon`" />
7474 </div >
7575 <label
76- :id =" `${uid }-search`"
77- :for =" `searchbox-${uid }`"
76+ :id =" `${cvId }-search`"
77+ :for =" `searchbox-${cvId }`"
7878 :class =" `${carbonPrefix}--label`"
7979 >{{ searchLabel }}</label
8080 >
8181 <input
82- :id =" `searchbox-${uid }`"
82+ :id =" `searchbox-${cvId }`"
8383 ref =" search"
8484 v-model =" searchValue"
8585 :class =" `${carbonPrefix}--search-input`"
8686 type =" text"
8787 role =" searchbox"
8888 :placeholder =" searchPlaceholder"
89- :aria-labelledby =" `searchbox-${uid }`"
89+ :aria-labelledby =" `searchbox-${cvId }`"
9090 @input =" onInternalSearch"
9191 @click =" checkSearchExpand(true)"
9292 @keydown.esc.prevent =" checkSearchExpand(false)"
160160 <cv-checkbox-skeleton v-if =" isSkeleton" />
161161 <cv-checkbox
162162 v-else
163+ :id =" `${cvId}-headingCheck`"
163164 v-model =" headingChecked"
164165 :form-item =" false"
165166 value =" headingCheck"
187188 <slot name =" data" >
188189 <cv-data-table-row
189190 v-for =" (row, rowIndex) in data"
191+ :id =" `${cvId}-${rowIndex}`"
190192 :key =" `row:${rowIndex}`"
191193 ref =" dataRows"
192194 :value =" `${rowIndex}`"
211213 <cv-pagination
212214 v-if =" pagination"
213215 v-bind =" internalPagination"
216+ :id =" `${cvId}-pagination`"
214217 :number-of-items =" internalNumberOfItems"
215218 @change =" $emit('pagination', $event)"
216219 >
@@ -343,7 +346,7 @@ const props = defineProps({
343346 onSearch: { type: Function , default: undefined },
344347 ... propsCvId,
345348});
346- const uid = useCvId (props, true );
349+ const cvId = useCvId (props, true );
347350
348351const isSkeleton = ref (props .skeleton );
349352provide (' is-skeleton' , isSkeleton);
@@ -361,12 +364,16 @@ const search = ref(null);
361364/** @type {Ref<Set<String>>} */
362365const expandingRowIds = ref (new Set ());
363366provide (' expanding-row-ids' , expandingRowIds);
367+
368+ const tableExpandable = ref (props .expandable );
369+ provide (' table-expandable' , tableExpandable);
364370onMounted (() => {
365371 if (props .expandable ) expandingRowIds .value .add (' table-expand-row' );
366372});
367373watch (
368374 () => props .expandable ,
369375 () => {
376+ tableExpandable .value = props .expandable ;
370377 if (props .expandable ) expandingRowIds .value .add (' table-expand-row' );
371378 else expandingRowIds .value .delete (' table-expand-row' );
372379 }
0 commit comments