srcdev-nuxt-forms 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composables/useZodValidation.ts +1 -0
- package/package.json +19 -2
- package/.editorconfig +0 -12
- package/.eslintignore +0 -7
- package/.eslintrc.cjs +0 -12
- package/.nmprc +0 -2
- package/.nuxtrc +0 -1
- package/.playground/components/scaffolding/footer/NavFooter.vue +0 -62
- package/.playground/components/ui/content-grid/ContentGrid.vue +0 -85
- package/.playground/composables/useApiRequest.ts +0 -25
- package/.playground/composables/useErrorMessages.ts +0 -59
- package/.playground/composables/useFormControl.ts +0 -248
- package/.playground/composables/useSleep.ts +0 -5
- package/.playground/composables/useStyleClassPassthrough.ts +0 -30
- package/.playground/composables/useZodValidation.ts +0 -120
- package/.playground/layouts/default.vue +0 -72
- package/.playground/nuxt.config.ts +0 -27
- package/.playground/pages/forms/examples/buttons/index.vue +0 -155
- package/.playground/pages/forms/examples/material/cssbattle.vue +0 -60
- package/.playground/pages/forms/examples/material/text-fields.vue +0 -594
- package/.playground/pages/index.vue +0 -33
- package/.playground/pages/limit-text.vue +0 -43
- package/.playground/pages/typography.vue +0 -83
- package/.playground/server/api/places/list.get.ts +0 -23
- package/.playground/server/api/textFields.post.ts +0 -37
- package/.playground/server/api/utils/index.get.ts +0 -20
- package/.playground/server/data/places/cities.json +0 -43
- package/.playground/server/data/places/countries.json +0 -55
- package/.playground/server/data/utils/title.json +0 -49
- package/.playground/types/types.places.ts +0 -8
- package/.prettierrc +0 -5
- package/.release-it.json +0 -6
- package/tsconfig.json +0 -3
- /package/{.playground/types → types}/types.forms.ts +0 -0
- /package/{.playground/types → types}/types.zodFormControl.ts +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<NuxtLayout name="default">
|
|
4
|
-
<template #layout-content>
|
|
5
|
-
<h1 class="heading-3">Typography</h1>
|
|
6
|
-
<h2 class="heading-4">Headings</h2>
|
|
7
|
-
<ul>
|
|
8
|
-
<li class="heading-1">Heading 1</li>
|
|
9
|
-
<li class="heading-2">Heading 2</li>
|
|
10
|
-
<li class="heading-3">Heading 3</li>
|
|
11
|
-
<li class="heading-4">Heading 4</li>
|
|
12
|
-
<li class="heading-5">Heading 5</li>
|
|
13
|
-
<li class="heading-6">Heading 6</li>
|
|
14
|
-
</ul>
|
|
15
|
-
|
|
16
|
-
<h2 class="heading-4">Body Regular</h2>
|
|
17
|
-
<ul>
|
|
18
|
-
<li class="body-large">Body Large</li>
|
|
19
|
-
<li class="body-normal">Body Normal</li>
|
|
20
|
-
<li class="body-small">Body Small</li>
|
|
21
|
-
<li class="body-xsmall">Body X-Small</li>
|
|
22
|
-
</ul>
|
|
23
|
-
|
|
24
|
-
<h2 class="heading-4">Body Semi-Bold</h2>
|
|
25
|
-
<ul>
|
|
26
|
-
<li class="body-large-semibold">Body Large Semi-Bold</li>
|
|
27
|
-
<li class="body-normal-semibold">Body Normal Semi-Bold</li>
|
|
28
|
-
<li class="body-small-semibold">Body Small Semi-Bold</li>
|
|
29
|
-
<li class="body-xsmall-semibold">Body X-Small Semi-Bold</li>
|
|
30
|
-
</ul>
|
|
31
|
-
|
|
32
|
-
<h2 class="heading-4">Body Bold</h2>
|
|
33
|
-
<ul>
|
|
34
|
-
<li class="body-large-bold">Body Large Bold</li>
|
|
35
|
-
<li class="body-normal-bold">Body Normal Bold</li>
|
|
36
|
-
<li class="body-small-bold">Body Small Bold</li>
|
|
37
|
-
<li class="body-xsmall-bold">Body X-Small Bold</li>
|
|
38
|
-
</ul>
|
|
39
|
-
|
|
40
|
-
<h2 class="heading-4">Links</h2>
|
|
41
|
-
<ul>
|
|
42
|
-
<li class="link-large">Link Large</li>
|
|
43
|
-
<li class="link-normal">Link Normal</li>
|
|
44
|
-
<li class="link-small">Link Small</li>
|
|
45
|
-
<li class="link-xsmall">Link X-Small</li>
|
|
46
|
-
</ul>
|
|
47
|
-
</template>
|
|
48
|
-
</NuxtLayout>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
|
|
52
|
-
<script setup lang="ts">
|
|
53
|
-
definePageMeta({
|
|
54
|
-
layout: false,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
useHead({
|
|
58
|
-
title: 'Typography Examples',
|
|
59
|
-
meta: [{ name: 'description', content: 'Typography' }],
|
|
60
|
-
bodyAttrs: {
|
|
61
|
-
class: 'typography',
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<style lang="css">
|
|
67
|
-
.typography {
|
|
68
|
-
/* font-family: 'Poppins', Sans-serif; */
|
|
69
|
-
/* font-family: var(--font-family); */
|
|
70
|
-
|
|
71
|
-
ul {
|
|
72
|
-
list-style-type: none;
|
|
73
|
-
padding: 0;
|
|
74
|
-
|
|
75
|
-
li {
|
|
76
|
-
background: var(--surface-subtle);
|
|
77
|
-
border-radius: 5px;
|
|
78
|
-
padding: 10px;
|
|
79
|
-
margin-block-end: 20px;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
</style>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import cities from '../../data/places/cities.json';
|
|
2
|
-
import countries from '../../data/places/countries.json';
|
|
3
|
-
|
|
4
|
-
export default defineEventHandler(async (event) => {
|
|
5
|
-
const sleep = async (ms: number) => {
|
|
6
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const query = getQuery(event);
|
|
10
|
-
|
|
11
|
-
let timeout = 0;
|
|
12
|
-
if (typeof query.delay !== 'undefined') {
|
|
13
|
-
timeout = Number(query.delay);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
await sleep(timeout);
|
|
17
|
-
|
|
18
|
-
if (query.category === 'cities') {
|
|
19
|
-
return cities;
|
|
20
|
-
} else if (query.category === 'countries') {
|
|
21
|
-
return countries;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { createError } from 'h3';
|
|
2
|
-
|
|
3
|
-
export default defineEventHandler(async (event: any) => {
|
|
4
|
-
const body = await readBody<{ emailAddress: string; password: string; username: string }>(event);
|
|
5
|
-
|
|
6
|
-
const { emailAddress, password, username } = body;
|
|
7
|
-
|
|
8
|
-
let throwError = false;
|
|
9
|
-
|
|
10
|
-
if (emailAddress === 'test@test.com') {
|
|
11
|
-
throwError = true;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const response = {
|
|
15
|
-
status: 200,
|
|
16
|
-
statusText: 'success',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// set some other response status cde
|
|
20
|
-
// setResponseStatus(event, 202)
|
|
21
|
-
|
|
22
|
-
// Throw some server side errors
|
|
23
|
-
if (throwError) {
|
|
24
|
-
throw createError({
|
|
25
|
-
statusCode: 400,
|
|
26
|
-
statusMessage: 'error',
|
|
27
|
-
data: {
|
|
28
|
-
errors: {
|
|
29
|
-
emailAddress: 'Email address already registered',
|
|
30
|
-
username: 'Username already registered',
|
|
31
|
-
password: ['Password is too weak', 'Password is too short'],
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return response;
|
|
37
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import title from '../../data/utils/title.json';
|
|
2
|
-
|
|
3
|
-
export default defineEventHandler(async (event) => {
|
|
4
|
-
const sleep = async (ms: number) => {
|
|
5
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const query = getQuery(event);
|
|
9
|
-
|
|
10
|
-
let timeout = 0;
|
|
11
|
-
if (typeof query.delay !== 'undefined') {
|
|
12
|
-
timeout = Number(query.delay);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
await sleep(timeout);
|
|
16
|
-
|
|
17
|
-
if (query.category === 'title') {
|
|
18
|
-
return title;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"id": "bradford-on-avon",
|
|
5
|
-
"name": "cities",
|
|
6
|
-
"value": "cities-2",
|
|
7
|
-
"label": "Bradford on Avon"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "bath",
|
|
11
|
-
"name": "cities",
|
|
12
|
-
"value": "cities-12",
|
|
13
|
-
"label": "Bath"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "bristol",
|
|
17
|
-
"name": "cities",
|
|
18
|
-
"value": "cities-23",
|
|
19
|
-
"label": "Bristol"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "london",
|
|
23
|
-
"name": "cities",
|
|
24
|
-
"value": "cities-42",
|
|
25
|
-
"label": "London"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "sunderland",
|
|
29
|
-
"name": "cities",
|
|
30
|
-
"value": "cities-56",
|
|
31
|
-
"label": "Sunderland"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "penzance",
|
|
35
|
-
"name": "cities",
|
|
36
|
-
"value": "cities-09",
|
|
37
|
-
"label": "Penzance"
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
"total": 6,
|
|
41
|
-
"skip": 0,
|
|
42
|
-
"limit": 10
|
|
43
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"id": "uk",
|
|
5
|
-
"name": "countries",
|
|
6
|
-
"value": "countries-12",
|
|
7
|
-
"label": "United Kingdom"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "france",
|
|
11
|
-
"name": "countries",
|
|
12
|
-
"value": "countries-23",
|
|
13
|
-
"label": "France"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "spain",
|
|
17
|
-
"name": "countries",
|
|
18
|
-
"value": "countries-42",
|
|
19
|
-
"label": "Spain"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "italy",
|
|
23
|
-
"name": "countries",
|
|
24
|
-
"value": "countries-56",
|
|
25
|
-
"label": "Italy"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "greece",
|
|
29
|
-
"name": "countries",
|
|
30
|
-
"value": "countries-09",
|
|
31
|
-
"label": "Greece"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "turkey",
|
|
35
|
-
"name": "countries",
|
|
36
|
-
"value": "countries-13",
|
|
37
|
-
"label": "Turkey"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "germany",
|
|
41
|
-
"name": "countries",
|
|
42
|
-
"value": "countries-76",
|
|
43
|
-
"label": "Germany"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "portugal",
|
|
47
|
-
"name": "countries",
|
|
48
|
-
"value": "countries-34",
|
|
49
|
-
"label": "Portugal"
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"total": 5,
|
|
53
|
-
"skip": 0,
|
|
54
|
-
"limit": 10
|
|
55
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"id": "mr",
|
|
5
|
-
"name": "title",
|
|
6
|
-
"value": "title-12",
|
|
7
|
-
"label": "Mr"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "Mrs",
|
|
11
|
-
"name": "title",
|
|
12
|
-
"value": "title-23",
|
|
13
|
-
"label": "Mrs"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "ms",
|
|
17
|
-
"name": "title",
|
|
18
|
-
"value": "title-42",
|
|
19
|
-
"label": "Ms"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "madam",
|
|
23
|
-
"name": "title",
|
|
24
|
-
"value": "title-56",
|
|
25
|
-
"label": "Madam"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "prof",
|
|
29
|
-
"name": "title",
|
|
30
|
-
"value": "title-09",
|
|
31
|
-
"label": "Professor"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "sir",
|
|
35
|
-
"name": "title",
|
|
36
|
-
"value": "title-11",
|
|
37
|
-
"label": "Sir"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "lady",
|
|
41
|
-
"name": "title",
|
|
42
|
-
"value": "title-22",
|
|
43
|
-
"label": "Lady"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"total": 5,
|
|
47
|
-
"skip": 0,
|
|
48
|
-
"limit": 10
|
|
49
|
-
}
|
package/.prettierrc
DELETED
package/.release-it.json
DELETED
package/tsconfig.json
DELETED
|
File without changes
|
|
File without changes
|