Line data Source code
1 : <template>
2 0 : <div
3 : :class="
4 : cn(
5 : 'minimap-panel flex flex-col gap-2 bg-background p-3 text-sm shadow-md',
6 : isMobile ? 'mb-2' : 'mr-2'
7 : )
8 : "
9 : :style="panelStyles"
10 : >
11 : <div class="flex items-center gap-2">
12 : <Checkbox
13 : id="node-colors"
14 : name="node-colors"
15 : :model-value="nodeColors"
16 : @update:model-value="
17 : (value) => updateOption('Comfy.Minimap.NodeColors', value)
18 : "
19 : />
20 : <i class="icon-[lucide--palette]" />
21 : <label for="node-colors">{{ $t('minimap.nodeColors') }}</label>
22 : </div>
23 :
24 : <div class="flex items-center gap-2">
25 : <Checkbox
26 : id="show-links"
27 : name="show-links"
28 : :model-value="showLinks"
29 : @update:model-value="
30 : (value) => updateOption('Comfy.Minimap.ShowLinks', value)
31 : "
32 : />
33 : <i class="icon-[lucide--route]" />
34 : <label for="show-links">{{ $t('minimap.showLinks') }}</label>
35 : </div>
36 :
37 : <div class="flex items-center gap-2">
38 : <Checkbox
39 : id="show-groups"
40 : name="show-groups"
41 : :model-value="showGroups"
42 : @update:model-value="
43 : (value) => updateOption('Comfy.Minimap.ShowGroups', value)
44 : "
45 : />
46 : <i class="icon-[lucide--frame]" />
47 : <label for="show-groups">{{ $t('minimap.showGroups') }}</label>
48 : </div>
49 :
50 : <div class="flex items-center gap-2">
51 : <Checkbox
52 : id="render-bypass"
53 : name="render-bypass"
54 : :model-value="renderBypass"
55 : @update:model-value="
56 : (value) => updateOption('Comfy.Minimap.RenderBypassState', value)
57 : "
58 : />
59 : <i class="icon-[lucide--circle-slash-2]" />
60 : <label for="render-bypass">{{ $t('minimap.renderBypassState') }}</label>
61 : </div>
62 :
63 : <div class="flex items-center gap-2">
64 : <Checkbox
65 : id="render-error"
66 : name="render-error"
67 : :model-value="renderError"
68 : @update:model-value="
69 : (value) => updateOption('Comfy.Minimap.RenderErrorState', value)
70 : "
71 : />
72 : <i class="icon-[lucide--message-circle-warning]" />
73 : <label for="render-error">{{ $t('minimap.renderErrorState') }}</label>
74 : </div>
75 : </div>
76 : </template>
77 :
78 : <script setup lang="ts">
79 : import type { CSSProperties, Ref } from 'vue'
80 : import type { CheckboxRootEmits } from 'reka-ui'
81 :
82 : import Checkbox from '@comfyorg/design-system/checkbox/Checkbox'
83 : import type { MinimapSettingsKey } from '@/renderer/extensions/minimap/types'
84 : import { cn } from '@comfyorg/tailwind-utils'
85 :
86 : defineProps<{
87 : panelStyles: CSSProperties
88 : nodeColors: boolean
89 : showLinks: boolean
90 : showGroups: boolean
91 : renderBypass: boolean
92 : renderError: boolean
93 : isMobile: Ref<boolean> | boolean
94 : }>()
95 :
96 0 : const emit = defineEmits<{
97 : updateOption: [key: MinimapSettingsKey, value: boolean]
98 : }>()
99 :
100 0 : function updateOption(
101 : key: MinimapSettingsKey,
102 : value: CheckboxRootEmits['update:modelValue'][0]
103 : ) {
104 0 : if (typeof value === 'boolean') emit('updateOption', key, value)
105 : }
106 : </script>
|