This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mitt package to desktop for global event bus. ListView will be re…
…written. ListView will be rewritten. Using Radix's Listbox has too much restrictions, I can't control which row to highlight programmatically.
- Loading branch information
1 parent
c6e5912
commit d34852a
Showing
9 changed files
with
67 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
<script setup lang="ts"> | ||
import type { HTMLAttributes } from 'vue' | ||
import { useVModel } from '@vueuse/core' | ||
import { cn } from '@/lib/utils' | ||
import type { HTMLAttributes } from "vue"; | ||
import { useVModel } from "@vueuse/core"; | ||
import { cn } from "@/lib/utils"; | ||
const props = defineProps<{ | ||
defaultValue?: string | number | ||
modelValue?: string | number | ||
class?: HTMLAttributes['class'] | ||
}>() | ||
defaultValue?: string | number; | ||
modelValue?: string | number; | ||
class?: HTMLAttributes["class"]; | ||
}>(); | ||
const emits = defineEmits<{ | ||
(e: 'update:modelValue', payload: string | number): void | ||
}>() | ||
(e: "update:modelValue", payload: string | number): void; | ||
(e: "keydown", payload: KeyboardEvent): void; | ||
}>(); | ||
const modelValue = useVModel(props, 'modelValue', emits, { | ||
const modelValue = useVModel(props, "modelValue", emits, { | ||
passive: true, | ||
defaultValue: props.defaultValue, | ||
}) | ||
}); | ||
</script> | ||
|
||
<template> | ||
<input v-model="modelValue" :class="cn('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', props.class)"> | ||
<input | ||
v-model="modelValue" | ||
@keydown="(e) => emits('keydown', e)" | ||
:class=" | ||
cn( | ||
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', | ||
props.class, | ||
) | ||
" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import mitt from "mitt"; | ||
|
||
export const GlobalEventBus = mitt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.