mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
fix submit handler
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="breadcrumbs">
|
||||
<div class="breadcrumbs sticky top-0">
|
||||
<ul>
|
||||
<li>
|
||||
<NuxtLinkLocale :to="{ name: 'passwordGroupItems' }">
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
:title="mode === 'create' ? t('title.create') : t('title.edit')"
|
||||
icon="mdi:folder-plus-outline"
|
||||
@close="$emit('close')"
|
||||
body-class="px-0"
|
||||
>
|
||||
<form
|
||||
class="flex flex-col gap-4 w-full p-4"
|
||||
@ -17,6 +18,7 @@
|
||||
autofocus
|
||||
v-model="group.name"
|
||||
ref="nameRef"
|
||||
@keyup.enter="$emit('submit')"
|
||||
/>
|
||||
|
||||
<UiInput
|
||||
@ -24,9 +26,10 @@
|
||||
:check-input="check"
|
||||
:label="t('description')"
|
||||
:placeholder="t('description')"
|
||||
@keyup.enter="$emit('submit')"
|
||||
/>
|
||||
|
||||
<div class="flex gap-4">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<UiSelectIcon
|
||||
v-model="group.icon"
|
||||
default-icon="mdi:folder-outline"
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
<template>
|
||||
<div class="h-full overflow-scroll">
|
||||
<div class="flex flex-col gap-4 w-full p-4">
|
||||
<form
|
||||
class="flex flex-col gap-4 w-full p-4"
|
||||
@submit.prevent="$emit('submit')"
|
||||
>
|
||||
<UiInput
|
||||
v-show="!read_only || itemDetails.title"
|
||||
:check-input="check"
|
||||
@ -11,6 +14,7 @@
|
||||
autofocus
|
||||
ref="titleRef"
|
||||
v-model.trim="itemDetails.title"
|
||||
@keyup.enter="$emit('submit')"
|
||||
/>
|
||||
|
||||
<UiInput
|
||||
@ -66,7 +70,7 @@
|
||||
@keyup.enter.stop
|
||||
class="h-52"
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -79,6 +83,7 @@ defineProps<{
|
||||
withCopyButton?: boolean
|
||||
}>()
|
||||
|
||||
defineEmits(['submit'])
|
||||
const { t } = useI18n()
|
||||
|
||||
const itemDetails = defineModel<SelectHaexPasswordsItemDetails>({
|
||||
@ -89,10 +94,10 @@ const preventClose = defineModel<boolean>('preventClose')
|
||||
|
||||
const check = defineModel<boolean>('check-input', { default: false })
|
||||
|
||||
onKeyStroke('escape', (e) => {
|
||||
/* onKeyStroke('escape', (e) => {
|
||||
e.stopPropagation()
|
||||
e.stopImmediatePropagation()
|
||||
})
|
||||
}) */
|
||||
|
||||
const titleRef = useTemplateRef('titleRef')
|
||||
onStartTyping(() => {
|
||||
|
||||
@ -78,6 +78,7 @@
|
||||
:read_only
|
||||
:defaultIcon
|
||||
v-model:prevent-close="preventClose"
|
||||
@submit="$emit('submit')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -127,6 +128,7 @@ const emit = defineEmits<{
|
||||
close: [void]
|
||||
addKeyValue: [void]
|
||||
removeKeyValue: [string]
|
||||
submit: [void]
|
||||
}>()
|
||||
|
||||
const read_only = defineModel<boolean>('read_only', { default: false })
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="card">
|
||||
<div class="card min-w-56">
|
||||
<slot name="image" />
|
||||
|
||||
<div
|
||||
|
||||
@ -22,9 +22,10 @@
|
||||
:placeholder="placeholder || label"
|
||||
:readonly="read_only"
|
||||
:type
|
||||
class="ps-3"
|
||||
class="ps-2"
|
||||
ref="inputRef"
|
||||
v-model="input"
|
||||
@keyup="(e) => $emit('keyup', e)"
|
||||
/>
|
||||
<label
|
||||
:for="id"
|
||||
@ -80,6 +81,11 @@ const input = defineModel<string | number | undefined | null>({
|
||||
const inputRef = useTemplateRef('inputRef')
|
||||
defineExpose({ inputRef })
|
||||
|
||||
const emit = defineEmits<{
|
||||
error: [string[]]
|
||||
keyup: [KeyboardEvent]
|
||||
}>()
|
||||
|
||||
const props = defineProps({
|
||||
placeholder: {
|
||||
type: String,
|
||||
@ -148,8 +154,6 @@ watch(
|
||||
},
|
||||
)
|
||||
|
||||
const emit = defineEmits(['error'])
|
||||
|
||||
const checkInput = () => {
|
||||
if (props.rules) {
|
||||
const result = props.rules.safeParse(input.value)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="flex items-center gap-4 relative">
|
||||
<div class="flex flex-wrap items-center gap-4 relative">
|
||||
<UiButton
|
||||
:style="{ 'background-color': model }"
|
||||
:class="[textColorClass]"
|
||||
|
||||
Reference in New Issue
Block a user