mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-27 16:02:43 +00:00
* wip * feat(frontend): Add disable prop to App Toggles * feat(frontend): run page v2 * feat(frontend): column ordering + load more * feat(frontend): column ordering + load more * feat(frontend): revert old coode * feat(frontend): simplify table + fix load more style + add groups * feat(frontend): Done * feat(frontend): Fix styling issues * feat(frontend): Fix styling issues * feat(frontend): Simplify filters * feat(frontend): Rework runs done * feat(frontend): fix drawer * feat(frontend): rework the filters * feat(frontend): rework the filters * feat(frontend): small ui fix * feat(frontend): correctly display title * feat(frontend): fix dark mode switch * feat(frontend): fix reset/clear buttons * feat(frontend): Rework runs done
41 lines
1.0 KiB
Svelte
41 lines
1.0 KiB
Svelte
<script context="module" lang="ts">
|
|
export type ToggleButtonContext = {
|
|
selected: Writable<any>
|
|
select: (value: any) => void
|
|
}
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import { createEventDispatcher, setContext } from 'svelte'
|
|
import { writable, type Writable } from 'svelte/store'
|
|
import { TabGroup, TabList } from '@rgossiaux/svelte-headlessui'
|
|
import { twMerge } from 'tailwind-merge'
|
|
|
|
export let selected: any
|
|
export let noWFull: boolean = false
|
|
|
|
const dispatch = createEventDispatcher()
|
|
const selectedContent = writable(selected)
|
|
|
|
function setSelected(selected: any) {
|
|
selectedContent.set(selected)
|
|
}
|
|
|
|
$: setSelected(selected)
|
|
|
|
$: dispatch('selected', $selectedContent)
|
|
setContext<ToggleButtonContext>('ToggleButtonGroup', {
|
|
selected: selectedContent,
|
|
select: (value: any) => {
|
|
selectedContent.set(value)
|
|
selected = value
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<TabGroup class={twMerge(`h-8 flex ${noWFull ? '' : 'w-full'}`, $$props.class)}>
|
|
<TabList class="flex bg-surface-secondary rounded-md p-0.5 gap-1 h-full ">
|
|
<slot />
|
|
</TabList>
|
|
</TabGroup>
|