srcdev-nuxt-forms 0.1.0 → 1.0.0

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.
Files changed (87) hide show
  1. package/LICENSE +21 -0
  2. package/assets/styles/brand/_brand.css +150 -0
  3. package/assets/styles/brand/_brand_dark.css +152 -0
  4. package/assets/styles/brand/_palette_dark.css +148 -0
  5. package/assets/styles/brand/_palette_light.css +148 -0
  6. package/assets/styles/brand/_typography.css +176 -0
  7. package/assets/styles/brand/index.css +1 -0
  8. package/assets/styles/forms/index.css +1 -1
  9. package/assets/styles/forms/themes/_default.css +3 -0
  10. package/assets/styles/forms/themes/_error.css +45 -11
  11. package/assets/styles/forms/themes/_ghost.css +42 -10
  12. package/assets/styles/forms/themes/_primary.css +42 -10
  13. package/assets/styles/forms/themes/_secondary.css +42 -10
  14. package/assets/styles/forms/themes/_success.css +42 -11
  15. package/assets/styles/forms/themes/_tertiary.css +42 -10
  16. package/assets/styles/forms/themes/_warning.css +42 -10
  17. package/assets/styles/forms/themes/index.css +1 -0
  18. package/assets/styles/forms/variables/_palette.css +104 -0
  19. package/assets/styles/forms/variables/_theme.css +12 -18
  20. package/assets/styles/forms/variables/index.css +2 -0
  21. package/assets/styles/main.css +2 -0
  22. package/assets/styles/scaffolding/_margin-helpers.css +308 -0
  23. package/assets/styles/scaffolding/_padding-helpers.css +308 -0
  24. package/assets/styles/scaffolding/_page.css +23 -0
  25. package/assets/styles/scaffolding/index.css +3 -0
  26. package/assets/styles/variables/colors/_blue.css +2 -2
  27. package/assets/styles/variables/colors/_gray.css +2 -1
  28. package/assets/styles/variables/colors/_green.css +2 -2
  29. package/assets/styles/variables/colors/_orange.css +2 -2
  30. package/assets/styles/variables/colors/_red.css +2 -2
  31. package/assets/styles/variables/colors/_yellow.css +1 -1
  32. package/components/forms/c12/prop-validators/index.ts +8 -20
  33. package/components/forms/c12/utils.ts +14 -0
  34. package/components/forms/c12/validation-patterns/en.json +12 -0
  35. package/components/forms/form-errors/InputError.vue +177 -0
  36. package/components/forms/input-button/InputButtonCore.vue +33 -109
  37. package/components/forms/input-button/variants/InputButtonConfirm.vue +1 -1
  38. package/components/forms/input-button/variants/InputButtonSubmit.vue +1 -1
  39. package/components/forms/input-checkbox/InputCheckboxCore.vue +263 -0
  40. package/components/forms/input-checkbox/InputCheckboxWithLabel.vue +116 -0
  41. package/components/forms/input-checkbox/variants/MultipleCheckboxes.vue +167 -0
  42. package/components/forms/input-checkbox/variants/SingleCheckbox.vue +172 -0
  43. package/components/forms/input-number/InputNumberCore.vue +184 -0
  44. package/components/forms/input-number/variants/InputNumberDefault.vue +155 -0
  45. package/components/forms/input-radio/InputRadiobuttonCore.vue +212 -0
  46. package/components/forms/input-radio/InputRadiobuttonWithLabel.vue +103 -0
  47. package/components/forms/input-radio/variants/MultipleRadiobuttons.vue +166 -0
  48. package/components/forms/input-range/InputRangeCore.vue +153 -0
  49. package/components/forms/input-range/variants/InputRangeDefault.vue +159 -0
  50. package/components/forms/input-text/InputTextCore.vue +149 -87
  51. package/components/forms/input-text/variants/material/InputPasswordWithLabel.vue +99 -0
  52. package/components/forms/input-text/variants/material/InputTextAsNumberWithLabel.vue +142 -0
  53. package/components/forms/input-text/variants/material/InputTextWithLabel.vue +125 -0
  54. package/components/forms/input-textarea/InputTextareaCore.vue +161 -0
  55. package/components/forms/input-textarea/variants/InputTextareaWithLabel.vue +106 -0
  56. package/components/scaffolding/footer/NavFooter.vue +62 -0
  57. package/components/ui/content-grid/ContentGrid.vue +85 -0
  58. package/composables/useApiRequest.ts +25 -0
  59. package/composables/useErrorMessages.ts +17 -5
  60. package/composables/useFormControl.ts +149 -37
  61. package/composables/useSleep.ts +2 -2
  62. package/composables/useStyleClassPassthrough.ts +30 -0
  63. package/composables/useZodValidation.ts +120 -0
  64. package/layouts/default.vue +26 -16
  65. package/nuxt.config.ts +22 -0
  66. package/package.json +13 -8
  67. package/pages/forms/examples/buttons/index.vue +14 -13
  68. package/pages/forms/examples/material/cssbattle.vue +60 -0
  69. package/pages/forms/examples/material/text-fields.vue +551 -93
  70. package/pages/index.vue +2 -2
  71. package/pages/limit-text.vue +43 -0
  72. package/pages/typography.vue +83 -0
  73. package/server/api/places/list.get.ts +23 -0
  74. package/server/api/textFields.post.ts +37 -0
  75. package/server/api/utils/index.get.ts +20 -0
  76. package/server/data/places/cities.json +43 -0
  77. package/server/data/places/countries.json +55 -0
  78. package/server/data/utils/title.json +49 -0
  79. package/types/types.forms.ts +135 -3
  80. package/types/types.places.ts +8 -0
  81. package/types/types.zodFormControl.ts +21 -0
  82. package/components/forms/input-text/variants/material/InputEmailMaterial.vue +0 -72
  83. package/components/forms/input-text/variants/material/InputPasswordMaterial.vue +0 -88
  84. package/components/forms/input-text/variants/material/InputTextMaterial.vue +0 -75
  85. package/components/forms/input-text/variants/material/InputTextMaterialCore.vue +0 -258
  86. package/composables/useUpdateStyleClassPassthrough.ts +0 -29
  87. package/pages/forms/examples/material/text-fields-compact.vue +0 -136
package/pages/index.vue CHANGED
@@ -27,7 +27,7 @@ useHead({
27
27
  </script>
28
28
 
29
29
  <style lang="css">
30
- p {
30
+ /* p {
31
31
  color: initial;
32
- }
32
+ } */
33
33
  </style>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div class="wrapper">
3
+ <div class="text-wrapper">
4
+ <p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p>
5
+ </div>
6
+ <div class="text-wrapper">
7
+ <p>Nisi harum impedit, expedita eius doloremque dicta obcaecati tempora dolorem eum fuga deserunt minus facere error mollitia pariatur cum tempore, reiciendis molestiae?</p>
8
+ </div>
9
+ <div class="text-wrapper">
10
+ <p>
11
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Nisi harum impedit, expedita eius doloremque dicta obcaecati tempora dolorem eum fuga deserunt minus facere error mollitia pariatur cum
12
+ tempore, reiciendis molestiae?
13
+ </p>
14
+ </div>
15
+ </div>
16
+ </template>
17
+ <script setup lang="ts">
18
+ definePageMeta({
19
+ layout: false,
20
+ });
21
+ </script>
22
+ <style lang="css">
23
+ .wrapper {
24
+ display: grid;
25
+ grid-template-columns: 1fr 1fr 1fr;
26
+ gap: 20px;
27
+ }
28
+
29
+ .text-wrapper {
30
+ max-height: 100px;
31
+ width: 200px;
32
+ padding: 20px;
33
+ outline: 1px solid black;
34
+
35
+ p {
36
+ display: -webkit-box;
37
+ -webkit-box-orient: vertical;
38
+ line-clamp: 3;
39
+ -webkit-line-clamp: 3;
40
+ overflow: hidden;
41
+ }
42
+ }
43
+ </style>
@@ -0,0 +1,83 @@
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: #ffffff;
77
+ border-radius: 5px;
78
+ padding: 10px;
79
+ margin-block-end: 20px;
80
+ }
81
+ }
82
+ }
83
+ </style>
@@ -0,0 +1,23 @@
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
+ });
@@ -0,0 +1,37 @@
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
+ });
@@ -0,0 +1,20 @@
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
+ });
@@ -0,0 +1,43 @@
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
+ }
@@ -0,0 +1,55 @@
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
+ }
@@ -0,0 +1,49 @@
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
+ }
@@ -12,6 +12,13 @@ export interface IOptionsConfig {
12
12
  label: string;
13
13
  }
14
14
 
15
+ export interface IFormMultipleOptions {
16
+ data: IOptionsConfig[];
17
+ total: number;
18
+ skip: number;
19
+ limit: number;
20
+ }
21
+
15
22
  export interface IOptionsValueArr {
16
23
  [key: string]: string | boolean | number | URL | object;
17
24
  }
@@ -20,6 +27,10 @@ export interface IFieldsInitialState {
20
27
  [key: string]: null | string | boolean | number | URL | object | IOptionsValueArr[];
21
28
  }
22
29
 
30
+ export type TFieldsInitialState = {
31
+ [key: string]: null | string | boolean | number | URL | object | IOptionsValueArr[];
32
+ };
33
+
23
34
  export interface IValidityState {
24
35
  badInput: boolean;
25
36
  customError: boolean;
@@ -65,10 +76,36 @@ export interface InpuTextC12 {
65
76
  errorMessage: string;
66
77
  }
67
78
 
68
- export interface ICustomErrorMessagesArr {
79
+ export interface IErrorMessagesArr {
69
80
  [x: string]: ICustomErrorMessage;
70
81
  }
71
82
 
83
+ export interface IFormFieldC12 {
84
+ label: string;
85
+ placeholder: string;
86
+ errorMessage: string;
87
+ useCustomError: boolean;
88
+ customErrors: null | string | string[];
89
+ isValid: boolean;
90
+ isDirty: boolean;
91
+ type: string;
92
+ previousValue: null | string | boolean | number | URL | object;
93
+ }
94
+
95
+ export interface IFormFieldsC12 {
96
+ [x: string]: IFormFieldC12;
97
+ }
98
+
99
+ export interface IFormFieldState {
100
+ isValid: boolean;
101
+ isDirty: boolean;
102
+ previousValue: null | string | boolean | number | URL | object;
103
+ }
104
+
105
+ export interface IFormFieldStateObj {
106
+ [x: string]: IFormFieldState;
107
+ }
108
+
72
109
  export interface IFormData {
73
110
  [x: string]: string | boolean | number | URL | object;
74
111
  data: IFieldsInitialState;
@@ -77,8 +114,103 @@ export interface IFormData {
77
114
  focusedField: string;
78
115
  isPending: boolean;
79
116
  errorCount: number;
80
- customErrorMessages: ICustomErrorMessagesArr;
117
+ errorMessages: IErrorMessagesArr;
118
+ formFieldsC12: IFormFieldsC12;
81
119
  formIsValid: boolean;
82
- submitSuccess: boolean;
120
+ submitAttempted: boolean;
83
121
  submitDisabled: boolean;
122
+ submitSuccess: boolean;
123
+ displayErrorMessages: boolean;
124
+ }
125
+
126
+ export interface IApiErrorMessages {
127
+ [x: string]: string;
128
+ }
129
+
130
+ // New types
131
+
132
+ export interface C12nInputText {
133
+ type: string;
134
+ id: string;
135
+ name: string;
136
+ label: string;
137
+ placeholder: string;
138
+ errorMessage: string;
139
+ fieldHasError: boolean;
140
+ required: boolean;
141
+ styleClassPassthrough: string[];
142
+ }
143
+
144
+ export interface C12nMultipleCheckboxes {
145
+ id: string;
146
+ name: string;
147
+ label: string;
148
+ legend: string;
149
+ placeholder: string;
150
+ errorMessage: string;
151
+ fieldHasError: boolean;
152
+ required: boolean;
153
+ styleClassPassthrough: string[];
154
+ }
155
+
156
+ export interface C12nInputCheckboxWithLabel {
157
+ id: string;
158
+ name: string;
159
+ required: string;
160
+ label: string;
161
+ placeholder: string;
162
+ errorMessage: string | string[];
163
+ fieldHasError: boolean;
164
+ styleClassPassthrough: string[];
165
+ }
166
+
167
+ export interface C12nInputRange {
168
+ id: string;
169
+ name: string;
170
+ label: string;
171
+ min: number;
172
+ max: number;
173
+ step: number;
174
+ placeholder: string;
175
+ errorMessage: string;
176
+ fieldHasError: boolean;
177
+ required: boolean;
178
+ styleClassPassthrough: string[];
179
+ }
180
+
181
+ export interface C12nInputTextCore {
182
+ type: string;
183
+ id: string;
184
+ name: string;
185
+ label: string;
186
+ placeholder: string;
187
+ errorMessage: string;
188
+ fieldHasError: boolean;
189
+ required: boolean;
190
+ }
191
+
192
+ export interface InputTextWithLabel {
193
+ type: string;
194
+ id: string;
195
+ name: string;
196
+ label: string;
197
+ placeholder: string;
198
+ errorMessage: string;
199
+ fieldHasError: boolean;
200
+ required: boolean;
201
+ styleClassPassthrough: string[];
202
+ deepCssClassPassthrough: string[];
203
+ }
204
+
205
+ export interface ApiErrorResponse {
206
+ url: string;
207
+ statusCode: number;
208
+ statusMessage: string;
209
+ message: string;
210
+ stack: string;
211
+ data: {
212
+ errors: {
213
+ [key: string]: string | string[]; // Index signature for dynamic keys
214
+ };
215
+ };
84
216
  }
@@ -0,0 +1,8 @@
1
+ import type { IOptionsConfig } from '@/types/types.forms';
2
+
3
+ export interface IFormMultipleOptions {
4
+ data: IOptionsConfig[];
5
+ total: number;
6
+ skip: number;
7
+ limit: number;
8
+ }
@@ -0,0 +1,21 @@
1
+ import type { IFieldsInitialState, IFormFieldsState, IFormFieldsC12, IFormFieldC12, IApiErrorMessages, ICustomErrorMessage, IErrorMessagesArr } from '@/types/types.forms';
2
+
3
+ export interface IZodeFormControl {
4
+ [x: string]: string | boolean | number | URL | object;
5
+ data: IFieldsInitialState;
6
+ validityState: IFormFieldsState;
7
+ dirtyFields: IFormFieldsState;
8
+ focusedField: string;
9
+ isDisabled: boolean;
10
+ isPending: boolean;
11
+ errorCount: number;
12
+ errorMessages: IErrorMessagesArr;
13
+ formFieldsC12: IFormFieldsC12;
14
+ formIsValid: boolean;
15
+ submitAttempted: boolean;
16
+ submitDisabled: boolean;
17
+ submitSuccess: boolean;
18
+ displayErrorMessages: boolean;
19
+ displayLoader: boolean;
20
+ submitSuccessful: boolean;
21
+ }
@@ -1,72 +0,0 @@
1
- <template>
2
- <InputTextMaterialCore type="email" :id :name :required :c12 :styleClassPassthrough :theme v-model="modelValue">
3
- <template #input>
4
- <InputTextCore :id :name type="email" :validation :required v-model="modelValue" :c12 :style-class-passthrough="styleClassPassthrough">
5
- <template #left>
6
- <Icon name="radix-icons:envelope-closed" class="icon" />
7
- </template>
8
- </InputTextCore>
9
- </template>
10
- </InputTextMaterialCore>
11
- </template>
12
-
13
- <script setup lang="ts">
14
- import type { InpuTextC12, IFormData } from '@/types/types.forms';
15
-
16
- import propValidators from '../../../c12/prop-validators';
17
-
18
- const props = defineProps({
19
- size: {
20
- type: String as PropType<string>,
21
- default: 'normal',
22
- validator(value: string) {
23
- return propValidators.size.includes(value);
24
- },
25
- },
26
- weight: {
27
- type: String as PropType<string>,
28
- default: 'wght-400',
29
- validator(value: string) {
30
- return propValidators.weight.includes(value);
31
- },
32
- },
33
- theme: {
34
- type: String as PropType<string>,
35
- default: 'primary',
36
- validator(value: string) {
37
- return propValidators.theme.includes(value);
38
- },
39
- },
40
- id: {
41
- // type: String as PropType<string>,
42
- type: String,
43
- required: true,
44
- },
45
- name: {
46
- type: String,
47
- default: null,
48
- },
49
- validation: {
50
- type: String,
51
- default: '',
52
- },
53
- required: {
54
- type: Boolean,
55
- value: false,
56
- },
57
- c12: {
58
- type: Object as PropType<InpuTextC12>,
59
- required: true,
60
- },
61
- styleClassPassthrough: {
62
- type: String,
63
- default: '',
64
- },
65
- });
66
-
67
- const name = computed(() => {
68
- return props.name !== null ? props.name : props.id;
69
- });
70
-
71
- const modelValue = defineModel() as Ref<IFormData>;
72
- </script>