-
Notifications
You must be signed in to change notification settings - Fork 1
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
17 changed files
with
139 additions
and
664 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import DefaultTheme from 'vitepress/theme'; | ||
|
||
import 'virtual:uno.css'; | ||
import './main.scss'; | ||
|
||
export default { | ||
|
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,14 +1,43 @@ | ||
.v-form { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
|
||
button { | ||
display: inline-flex; | ||
justify-content: center; | ||
padding: 0.5rem 1.5rem; | ||
font-size: 0.875rem; | ||
font-weight: 600; | ||
border: 1px solid rgb(209, 213, 219); | ||
border-radius: 0.375rem; | ||
background: rgba(209, 213, 219, 0.2); | ||
margin-top: 1rem; | ||
|
||
&:hover { | ||
background: rgba(209, 213, 219, 0.4); | ||
} | ||
} | ||
} | ||
|
||
.v-label { | ||
display: flex; | ||
flex-direction: column; | ||
font-size: 0.875rem; | ||
line-height: 1.25rem; | ||
font-weight: 600; | ||
padding-left: 1rem; | ||
|
||
& input { | ||
color: black; | ||
background: white; | ||
& .v-input { | ||
font-family: inherit; | ||
appearance: none; | ||
border: 1px solid rgb(209, 213, 219); | ||
border-radius: 0.375rem; | ||
padding: 0.5rem 1rem; | ||
margin-left: -1rem; | ||
margin-top: 0.25rem; | ||
font-size: 1rem; | ||
line-height: 1.5rem; | ||
box-shadow: 0 2px 2px #0000000d; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
# Components |
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 @@ | ||
# Define a Form |
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,7 @@ | ||
# Plugins | ||
|
||
## Storage Plugin | ||
|
||
## Local Storage Plugin | ||
|
||
## Session Storage Plugin |
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 @@ | ||
# Validators |
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
<template> | ||
<UForm :form="form" @v-submit="onSubmit"> | ||
<UField> | ||
Email: | ||
<input type="email" name="email" /> | ||
</UField> | ||
|
||
<div> | ||
<span v-for="error in form.fields.email.errors">{{ error }}</span> | ||
</div> | ||
|
||
<UField> | ||
Password: | ||
<input type="password" name="password" /> | ||
</UField> | ||
|
||
<button>Submit</button> | ||
</UForm> | ||
</template> | ||
|
||
<script setup> | ||
import { UField, UForm, email, minLength, required, useForm } from '@vuetils/form'; | ||
const form = useForm({ | ||
email: ['', [required, email]], | ||
password: ['', [required, minLength(6)]], | ||
}); | ||
</script> |
File renamed without changes.
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,46 @@ | ||
# Introduction | ||
|
||
## Installation | ||
|
||
::: code-group | ||
|
||
```sh [npm] | ||
$ npm install @vuetils/form | ||
``` | ||
|
||
```sh [pnpm] | ||
$ pnpm add @vuetils/form@latest | ||
``` | ||
|
||
```sh [yarn] | ||
$ yarn add @vuetils/form | ||
``` | ||
|
||
::: | ||
|
||
## How it works | ||
|
||
You start of by creating a form object with [`useForm()`](api#useForm). The function takes in an object where every property represents an input element in your form. The key of the property coorolates to the name attribute of an input element and the value is and array where the first element is the initial value of the input and the second element is an array of [validators](api#validators) . `@vuetils/form` comes with a set of [validators](api#validators) that you can use to validate your form. | ||
|
||
```js | ||
import { email, minLength, required, useForm } from '@vuetils/form'; | ||
|
||
const form = useForm({ | ||
email: ['', [required, email]], | ||
password: ['', [required, minLength(6)]], | ||
}); | ||
``` | ||
|
||
## Usage | ||
|
||
<<< ./GettingStarted.vue | ||
|
||
<script setup> | ||
import GettingStarted from './GettingStarted.vue' | ||
</script> | ||
|
||
<GettingStarted /> | ||
|
||
## What's Next? | ||
|
||
- TODO |
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 @@ | ||
# Components |
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
Oops, something went wrong.