@@ -84,6 +84,7 @@ const tableStep = ref(0);
8484const step = ref (0 );
8585const source = ref (null );
8686const tableUnit = ref (null );
87+ const userOptionsRef = ref (null );
8788
8889const FINAL_CONFIG = ref (prepareConfig ());
8990
@@ -576,7 +577,15 @@ watch(() => mutableConfig.value.showTable, v => {
576577 tableUnit .value .close ()
577578 }
578579 }
579- })
580+ });
581+
582+
583+ function closeTable () {
584+ mutableConfig .value .showTable = false ;
585+ if (userOptionsRef .value ) {
586+ userOptionsRef .value .setTableIconState (false );
587+ }
588+ }
580589
581590defineExpose ({
582591 getData,
@@ -619,21 +628,39 @@ defineExpose({
619628 }" />
620629 </div >
621630
622- <UserOptions ref =" details" :key =" `user_option_${step}`"
631+ <UserOptions
632+ ref =" userOptionsRef"
633+ :key =" `user_option_${step}`"
623634 v-if =" FINAL_CONFIG.userOptions.show && isDataset && (keepUserOptionState ? true : userOptionsVisible)"
624- :backgroundColor =" FINAL_CONFIG.style.chart.backgroundColor" :color =" FINAL_CONFIG.style.chart.color"
625- :isPrinting =" isPrinting" :isImaging =" isImaging" :uid =" uid" :hasTooltip =" false" :hasLabel =" false"
626- :hasPdf =" FINAL_CONFIG.userOptions.buttons.pdf" :hasImg =" FINAL_CONFIG.userOptions.buttons.img"
627- :hasXls =" FINAL_CONFIG.userOptions.buttons.csv" :hasTable =" FINAL_CONFIG.userOptions.buttons.table"
628- :hasFullscreen =" FINAL_CONFIG.userOptions.buttons.fullscreen" :isFullscreen =" isFullscreen"
629- :chartElement =" circlePackChart" :position =" FINAL_CONFIG.userOptions.position" :callbacks =" FINAL_CONFIG.userOptions.callbacks"
635+ :backgroundColor =" FINAL_CONFIG.style.chart.backgroundColor"
636+ :color =" FINAL_CONFIG.style.chart.color"
637+ :isPrinting =" isPrinting"
638+ :isImaging =" isImaging"
639+ :uid =" uid"
640+ :hasTooltip =" false"
641+ :hasLabel =" false"
642+ :hasPdf =" FINAL_CONFIG.userOptions.buttons.pdf"
643+ :hasImg =" FINAL_CONFIG.userOptions.buttons.img"
644+ :hasXls =" FINAL_CONFIG.userOptions.buttons.csv"
645+ :hasTable =" FINAL_CONFIG.userOptions.buttons.table"
646+ :hasFullscreen =" FINAL_CONFIG.userOptions.buttons.fullscreen"
647+ :isFullscreen =" isFullscreen"
648+ :chartElement =" circlePackChart"
649+ :position =" FINAL_CONFIG.userOptions.position"
650+ :callbacks =" FINAL_CONFIG.userOptions.callbacks"
630651 :printScale =" FINAL_CONFIG.userOptions.print.scale"
631652 :titles =" { ...FINAL_CONFIG.userOptions.buttonTitles }"
632- :hasAnnotator =" FINAL_CONFIG.userOptions.buttons.annotator" :isAnnotation =" isAnnotator"
633- @toggleFullscreen =" toggleFullscreen" @generatePdf =" generatePdf" @generateCsv =" generateCsv"
634- @generateImage =" generateImage" @toggleTable =" toggleTable" @toggleAnnotator =" toggleAnnotator" :style =" {
635- visibility: keepUserOptionState ? userOptionsVisible ? 'visible' : 'hidden' : 'visible'
636- }" >
653+ :hasAnnotator =" FINAL_CONFIG.userOptions.buttons.annotator"
654+ :isAnnotation =" isAnnotator"
655+ :tableDialog =" FINAL_CONFIG.table.useDialog"
656+ @toggleFullscreen =" toggleFullscreen"
657+ @generatePdf =" generatePdf"
658+ @generateCsv =" generateCsv"
659+ @generateImage =" generateImage"
660+ @toggleTable =" toggleTable"
661+ @toggleAnnotator =" toggleAnnotator"
662+ :style =" { visibility: keepUserOptionState ? userOptionsVisible ? 'visible' : 'hidden' : 'visible' }"
663+ >
637664 <template #menuIcon =" { isOpen , color } " v-if =" $slots .menuIcon " >
638665 <slot name =" menuIcon" v-bind =" { isOpen, color }" />
639666 </template >
@@ -790,11 +817,11 @@ defineExpose({
790817 </div >
791818
792819 <component
793- v-if =" isDataset"
820+ v-if =" isDataset && FINAL_CONFIG.userOptions.buttons.table "
794821 :is =" tableComponent.component"
795822 v-bind =" tableComponent.props"
796823 ref =" tableUnit"
797- @close =" mutableConfig.showTable = false "
824+ @close =" closeTable "
798825 >
799826 <template #title v-if =" FINAL_CONFIG .table .useDialog " >
800827 {{ tableComponent.title }}
@@ -813,7 +840,7 @@ defineExpose({
813840 :config =" dataTable.config"
814841 :title =" FINAL_CONFIG.table.useDialog ? '' : tableComponent.title"
815842 :withCloseButton =" !FINAL_CONFIG.table.useDialog"
816- @close =" mutableConfig.showTable = false "
843+ @close =" closeTable "
817844 >
818845 <template #th =" { th } " >
819846 <div v-html =" th" style =" display :flex ;align-items :center " ></div >
0 commit comments