-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
144 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as z from 'zod'; | ||
|
||
export const validationColumnRules = z.object({ | ||
name: z.string({ required_error: 'Name is a required field' }) | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<script setup lang="ts"> | ||
import { useI18n } from 'vue-i18n'; | ||
import { useField, useForm } from 'vee-validate'; | ||
import { toTypedSchema } from '@vee-validate/zod'; | ||
import { UiButton, UiInput } from '@/shared/ui'; | ||
import { validationColumnRules } from '../../config/validation'; | ||
const validationSchema = toTypedSchema(validationColumnRules); | ||
const { t } = useI18n(); | ||
const { handleSubmit, errors } = useForm({ | ||
validationSchema | ||
}); | ||
const { value: name } = useField('name'); | ||
const createColumn = handleSubmit((values) => { | ||
// create new column | ||
}); | ||
</script> | ||
<template> | ||
<form @submit.prevent="createColumn"> | ||
<div :class="$style.form_container"> | ||
<div v-auto-animate :class="$style.field"> | ||
<label class="text-sm" for="name">{{ t('kanban.sheet.column.form.label') }}</label> | ||
<UiInput id="name" v-model="name" :placeholder="t('kanban.sheet.column.form.placeholder')" /> | ||
<span v-if="errors.name" class="text-xs">{{ errors.name }}</span> | ||
</div> | ||
<UiButton style="width: 100%" type="submit"> {{ t('kanban.sheet.column.form.submit') }} </UiButton> | ||
</div> | ||
</form> | ||
</template> | ||
|
||
<style module lang="scss"> | ||
@import '@/app/styles/mixins'; | ||
.form_container { | ||
display: grid; | ||
gap: 24px; | ||
.field { | ||
display: grid; | ||
justify-items: flex-start; | ||
gap: 8px; | ||
& label { | ||
color: var(--zinc-950); | ||
font-weight: 500 !important; | ||
} | ||
& span { | ||
color: var(--destructive); | ||
} | ||
} | ||
} | ||
:global(html.dark) { | ||
.form_container { | ||
.field { | ||
& label { | ||
color: var(--zinc-200); | ||
} | ||
} | ||
} | ||
} | ||
</style> |
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 AddColumn from './AddColumn.vue'; | ||
|
||
export { AddColumn }; |
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,8 +1,8 @@ | ||
import AddColumn from './AddColumn.vue'; | ||
import DragCards from './DragCards.vue'; | ||
import DragColumns from './DragColumns.vue'; | ||
import SettingsSheet from './SettingsSheet.vue'; | ||
import SortingItems from './SortingItems.vue'; | ||
import { AddColumn } from './add-column'; | ||
import RemoveBoard from './RemoveBoard.vue'; | ||
|
||
export { AddColumn, DragCards, DragColumns, SortingItems, SettingsSheet, RemoveBoard }; |
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