Skip to content

Commit 47aa05d

Browse files
committed
Improvement - Expose slots to customize icons in chart annotator menu
1 parent 8f56969 commit 47aa05d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+837
-59
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,26 @@ defineExpose({
791791
:color="FINAL_CONFIG.style.chart.color"
792792
:active="isAnnotator"
793793
@close="toggleAnnotator"
794-
/>
794+
>
795+
<template #annotator-action-close>
796+
<slot name="annotator-action-close"/>
797+
</template>
798+
<template #annotator-action-color="{ color }">
799+
<slot name="annotator-action-color" v-bind="{ color }"/>
800+
</template>
801+
<template #annotator-action-draw="{ mode }">
802+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
803+
</template>
804+
<template #annotator-action-undo="{ disabled }">
805+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
806+
</template>
807+
<template #annotator-action-redo="{ disabled }">
808+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
809+
</template>
810+
<template #annotator-action-delete="{ disabled }">
811+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
812+
</template>
813+
</PenAndPaper>
795814

796815
<div ref="chartTitle" v-if="FINAL_CONFIG.style.chart.title.text" :style="`width:100%;background:transparent`">
797816
<!-- TITLE AS DIV -->

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,26 @@ defineExpose({
716716
:color="FINAL_CONFIG.style.color"
717717
:active="isAnnotator"
718718
@close="toggleAnnotator"
719-
/>
719+
>
720+
<template #annotator-action-close>
721+
<slot name="annotator-action-close"/>
722+
</template>
723+
<template #annotator-action-color="{ color }">
724+
<slot name="annotator-action-color" v-bind="{ color }"/>
725+
</template>
726+
<template #annotator-action-draw="{ mode }">
727+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
728+
</template>
729+
<template #annotator-action-undo="{ disabled }">
730+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
731+
</template>
732+
<template #annotator-action-redo="{ disabled }">
733+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
734+
</template>
735+
<template #annotator-action-delete="{ disabled }">
736+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
737+
</template>
738+
</PenAndPaper>
720739
721740
<div
722741
ref="noTitle"

src/components/vue-ui-bullet.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,26 @@ defineExpose({
535535
:color="FINAL_CONFIG.style.chart.color"
536536
:active="isAnnotator"
537537
@close="toggleAnnotator"
538-
/>
538+
>
539+
<template #annotator-action-close>
540+
<slot name="annotator-action-close"/>
541+
</template>
542+
<template #annotator-action-color="{ color }">
543+
<slot name="annotator-action-color" v-bind="{ color }"/>
544+
</template>
545+
<template #annotator-action-draw="{ mode }">
546+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
547+
</template>
548+
<template #annotator-action-undo="{ disabled }">
549+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
550+
</template>
551+
<template #annotator-action-redo="{ disabled }">
552+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
553+
</template>
554+
<template #annotator-action-delete="{ disabled }">
555+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
556+
</template>
557+
</PenAndPaper>
539558

540559
<div
541560
ref="noTitle"

src/components/vue-ui-candlestick.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,26 @@ defineExpose({
13131313
:color="FINAL_CONFIG.style.color"
13141314
:active="isAnnotator"
13151315
@close="toggleAnnotator"
1316-
/>
1316+
>
1317+
<template #annotator-action-close>
1318+
<slot name="annotator-action-close"/>
1319+
</template>
1320+
<template #annotator-action-color="{ color }">
1321+
<slot name="annotator-action-color" v-bind="{ color }"/>
1322+
</template>
1323+
<template #annotator-action-draw="{ mode }">
1324+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
1325+
</template>
1326+
<template #annotator-action-undo="{ disabled }">
1327+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
1328+
</template>
1329+
<template #annotator-action-redo="{ disabled }">
1330+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
1331+
</template>
1332+
<template #annotator-action-delete="{ disabled }">
1333+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
1334+
</template>
1335+
</PenAndPaper>
13171336
13181337
<div
13191338
ref="noTitle"

src/components/vue-ui-chestnut.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,26 @@ defineExpose({
811811
:color="FINAL_CONFIG.style.chart.color"
812812
:active="isAnnotator"
813813
@close="toggleAnnotator"
814-
/>
814+
>
815+
<template #annotator-action-close>
816+
<slot name="annotator-action-close"/>
817+
</template>
818+
<template #annotator-action-color="{ color }">
819+
<slot name="annotator-action-color" v-bind="{ color }"/>
820+
</template>
821+
<template #annotator-action-draw="{ mode }">
822+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
823+
</template>
824+
<template #annotator-action-undo="{ disabled }">
825+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
826+
</template>
827+
<template #annotator-action-redo="{ disabled }">
828+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
829+
</template>
830+
<template #annotator-action-delete="{ disabled }">
831+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
832+
</template>
833+
</PenAndPaper>
815834

816835
<div
817836
ref="noTitle"

src/components/vue-ui-chord.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,26 @@ defineExpose({
10751075
:active="isAnnotator"
10761076
:svgRef="svgRef"
10771077
@close="toggleAnnotator"
1078-
/>
1078+
>
1079+
<template #annotator-action-close>
1080+
<slot name="annotator-action-close"/>
1081+
</template>
1082+
<template #annotator-action-color="{ color }">
1083+
<slot name="annotator-action-color" v-bind="{ color }"/>
1084+
</template>
1085+
<template #annotator-action-draw="{ mode }">
1086+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
1087+
</template>
1088+
<template #annotator-action-undo="{ disabled }">
1089+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
1090+
</template>
1091+
<template #annotator-action-redo="{ disabled }">
1092+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
1093+
</template>
1094+
<template #annotator-action-delete="{ disabled }">
1095+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
1096+
</template>
1097+
</PenAndPaper>
10791098
10801099
<slot name="userConfig"></slot>
10811100

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,27 @@ defineExpose({
628628
@mouseenter="() => setUserOptionsVisibility(true)" @mouseleave="() => setUserOptionsVisibility(false)">
629629
<PenAndPaper v-if="FINAL_CONFIG.userOptions.buttons.annotator" :svgRef="svgRef"
630630
:backgroundColor="FINAL_CONFIG.style.chart.backgroundColor" :color="FINAL_CONFIG.style.chart.color"
631-
:active="isAnnotator" :scale="maxRadius / 100" @close="toggleAnnotator" />
631+
:active="isAnnotator" :scale="maxRadius / 100" @close="toggleAnnotator"
632+
>
633+
<template #annotator-action-close>
634+
<slot name="annotator-action-close"/>
635+
</template>
636+
<template #annotator-action-color="{ color }">
637+
<slot name="annotator-action-color" v-bind="{ color }"/>
638+
</template>
639+
<template #annotator-action-draw="{ mode }">
640+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
641+
</template>
642+
<template #annotator-action-undo="{ disabled }">
643+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
644+
</template>
645+
<template #annotator-action-redo="{ disabled }">
646+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
647+
</template>
648+
<template #annotator-action-delete="{ disabled }">
649+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
650+
</template>
651+
</PenAndPaper>
632652

633653
<slot name="userConfig" />
634654

src/components/vue-ui-dashboard.vue

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,26 @@ defineExpose({
519519
:style="{
520520
zIndex: resolvedItems.length + 1
521521
}"
522-
/>
522+
>
523+
<template #annotator-action-close>
524+
<slot name="annotator-action-close"/>
525+
</template>
526+
<template #annotator-action-color="{ color }">
527+
<slot name="annotator-action-color" v-bind="{ color }"/>
528+
</template>
529+
<template #annotator-action-draw="{ mode }">
530+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
531+
</template>
532+
<template #annotator-action-undo="{ disabled }">
533+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
534+
</template>
535+
<template #annotator-action-redo="{ disabled }">
536+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
537+
</template>
538+
<template #annotator-action-delete="{ disabled }">
539+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
540+
</template>
541+
</PenAndPaper>
523542

524543
<UserOptions
525544
v-if="((FINAL_CONFIG.allowPrint /* deprecated, but still ok */) || FINAL_CONFIG.userOptions.show) && (FINAL_CONFIG.userOptions.buttons.pdf || FINAL_CONFIG.userOptions.buttons.img)"

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,26 @@ defineExpose({
10521052
:color="FINAL_CONFIG.style.chart.color"
10531053
:active="isAnnotator"
10541054
@close="toggleAnnotator"
1055-
/>
1055+
>
1056+
<template #annotator-action-close>
1057+
<slot name="annotator-action-close"/>
1058+
</template>
1059+
<template #annotator-action-color="{ color }">
1060+
<slot name="annotator-action-color" v-bind="{ color }"/>
1061+
</template>
1062+
<template #annotator-action-draw="{ mode }">
1063+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
1064+
</template>
1065+
<template #annotator-action-undo="{ disabled }">
1066+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
1067+
</template>
1068+
<template #annotator-action-redo="{ disabled }">
1069+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
1070+
</template>
1071+
<template #annotator-action-delete="{ disabled }">
1072+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
1073+
</template>
1074+
</PenAndPaper>
10561075
10571076
<div
10581077
ref="noTitle"

src/components/vue-ui-donut.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,28 @@ defineExpose({
12841284
12851285
<PenAndPaper v-if="FINAL_CONFIG.userOptions.buttons.annotator && svgRef" :color="FINAL_CONFIG.style.chart.color"
12861286
:backgroundColor="FINAL_CONFIG.style.chart.backgroundColor" :active="isAnnotator" :svgRef="svgRef"
1287-
@close="toggleAnnotator" />
1287+
@close="toggleAnnotator"
1288+
>
1289+
<template #annotator-action-close>
1290+
<slot name="annotator-action-close"/>
1291+
</template>
1292+
<template #annotator-action-color="{ color }">
1293+
<slot name="annotator-action-color" v-bind="{ color }"/>
1294+
</template>
1295+
<template #annotator-action-draw="{ mode }">
1296+
<slot name="annotator-action-draw" v-bind="{ mode }"/>
1297+
</template>
1298+
<template #annotator-action-undo="{ disabled }">
1299+
<slot name="annotator-action-undo" v-bind="{ disabled }"/>
1300+
</template>
1301+
<template #annotator-action-redo="{ disabled }">
1302+
<slot name="annotator-action-redo" v-bind="{ disabled }"/>
1303+
</template>
1304+
<template #annotator-action-delete="{ disabled }">
1305+
<slot name="annotator-action-delete" v-bind="{ disabled }"/>
1306+
</template>
1307+
</PenAndPaper>
1308+
12881309
<slot name="userConfig"></slot>
12891310
12901311
<div ref="noTitle" v-if="hasOptionsNoTitle" class="vue-data-ui-no-title-space"

0 commit comments

Comments
 (0)