chore: environment selector with new ux (#3052)

Co-authored-by: Nivedin <nivedinp@gmail.com>
This commit is contained in:
Liyas Thomas
2023-05-31 03:17:37 +05:30
committed by GitHub
parent 9a40058329
commit 397b26a9f3
5 changed files with 162 additions and 103 deletions

View File

@@ -100,7 +100,9 @@
</div>
</div>
<slot name="actions" />
<div v-if="hasActions" class="w-64">
<slot name="actions" />
</div>
<input
type="range"
@@ -111,10 +113,10 @@
:class="{
'!block': scrollThumb.show,
}"
:style="{
'--thumb-width': scrollThumb.width + 'px',
}"
style="width: calc(100% - 3rem)"
:style="[
`--thumb-width: ${scrollThumb.width}px`,
`width: calc(100% - ${hasActions ? '19rem' : '3rem'})`,
]"
id="myRange"
/>
</div>
@@ -140,6 +142,7 @@ import {
inject,
watch,
nextTick,
useSlots,
} from "vue"
import { useElementSize } from "@vueuse/core"
import type { Slot } from "vue"
@@ -191,6 +194,12 @@ const emit = defineEmits<{
(e: "addTab"): void
}>()
const slots = useSlots()
const hasActions = computed(() => {
return !!slots.actions
})
const throwError = (message: string): never => {
throw new Error(message)
}