Skip to content

Commit 8f26531

Browse files
committed
Improvement - Don't show data table in the dom when buttons.table is false
1 parent ce3e6c7 commit 8f26531

33 files changed

+84
-49
lines changed

src/components/vue-ui-3d-bar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ defineExpose({
13141314
</div>
13151315

13161316
<component
1317-
v-if="isDataset && hasStack"
1317+
v-if="isDataset && hasStack && FINAL_CONFIG.userOptions.buttons.table"
13181318
:is="tableComponent.component"
13191319
v-bind="tableComponent.props"
13201320
ref="tableUnit"

src/components/vue-ui-age-pyramid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ defineExpose({
10831083
</Tooltip>
10841084
10851085
<component
1086-
v-if="isDataset"
1086+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
10871087
:is="tableComponent.component"
10881088
v-bind="tableComponent.props"
10891089
ref="tableUnit"

src/components/vue-ui-candlestick.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ defineExpose({
13681368
</Tooltip>
13691369

13701370
<component
1371-
v-if="isDataset"
1371+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
13721372
:is="tableComponent.component"
13731373
v-bind="tableComponent.props"
13741374
ref="tableUnit"

src/components/vue-ui-chestnut.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ defineExpose({
14851485
</div>
14861486

14871487
<component
1488-
v-if="isDataset"
1488+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
14891489
:is="tableComponent.component"
14901490
v-bind="tableComponent.props"
14911491
ref="tableUnit"

src/components/vue-ui-chord.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ defineExpose({
14601460
</div>
14611461
14621462
<component
1463-
v-if="isDataset"
1463+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
14641464
:is="tableComponent.component"
14651465
v-bind="tableComponent.props"
14661466
ref="tableUnit"

src/components/vue-ui-circle-pack.vue

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const tableStep = ref(0);
8484
const step = ref(0);
8585
const source = ref(null);
8686
const tableUnit = ref(null);
87+
const userOptionsRef = ref(null);
8788
8889
const 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
581590
defineExpose({
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>

src/components/vue-ui-donut-evolution.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ defineExpose({
14531453
</div>
14541454
14551455
<component
1456-
v-if="isDataset"
1456+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
14571457
:is="tableComponent.component"
14581458
v-bind="tableComponent.props"
14591459
ref="tableUnit"

src/components/vue-ui-donut.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ defineExpose({
19011901
</Tooltip>
19021902
19031903
<component
1904-
v-if="isDataset"
1904+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
19051905
:is="tableComponent.component"
19061906
v-bind="tableComponent.props"
19071907
ref="tableUnit"

src/components/vue-ui-dumbbell.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ defineExpose({
14061406
</div>
14071407
14081408
<component
1409-
v-if="isDataset"
1409+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
14101410
:is="tableComponent.component"
14111411
v-bind="tableComponent.props"
14121412
ref="tableUnit"

src/components/vue-ui-flow.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ defineExpose({
12501250
</Tooltip>
12511251
12521252
<component
1253-
v-if="isDataset"
1253+
v-if="isDataset && FINAL_CONFIG.userOptions.buttons.table"
12541254
:is="tableComponent.component"
12551255
v-bind="tableComponent.props"
12561256
ref="tableUnit"

0 commit comments

Comments
 (0)