@ederzeel/nuxt-schema-form-nightly 0.1.0-29120408.504cd02 → 0.1.0-29120910.2e7f39c

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.
@@ -6,6 +6,7 @@ import SToggle from './Toggle.vue'
6
6
  import SArray from './Array.vue'
7
7
  import SInputNumber from './InputNumber.vue'
8
8
  import SInputField from './InputField.vue'
9
+ import SSelect from './Select.vue'
9
10
  import type { PropertiesType } from '../types'
10
11
  import type { TableColumn } from '@nuxt/ui'
11
12
 
@@ -61,6 +62,7 @@ const Render = () => {
61
62
  }
62
63
  })
63
64
  } else if (type === 'string') {
65
+ const { enum: eenum } = props
64
66
  if (format === 'full-date') {
65
67
  return h(SDate, {
66
68
  id: props.id,
@@ -74,10 +76,25 @@ const Render = () => {
74
76
  value.value = v
75
77
  }
76
78
  })
79
+ } else if (eenum) {
80
+ return h(SSelect, {
81
+ id: props.id,
82
+ title: props.title,
83
+ description: props.description,
84
+ enum: eenum,
85
+ enum_titles: props.enum_titles,
86
+ isRequired: props.isRequired,
87
+ jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
88
+ modelValue: value.value as string,
89
+ 'onUpdate:modelValue': (v: string) => {
90
+ value.value = v
91
+ }
92
+ })
77
93
  } else {
78
94
  return h(SInputField, {
79
95
  id: props.id,
80
96
  title: props.title,
97
+ description: props.description,
81
98
  isRequired: props.isRequired,
82
99
  type,
83
100
  jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
@@ -13,7 +13,7 @@ const props = defineProps<{
13
13
 
14
14
  const options = computed(() => props.enum.map((x, i) => ({ label: props?.enum_titles?.[i] ?? x, value: x })))
15
15
 
16
- const value = defineModel<string>({ required: true })
16
+ const value = defineModel<string>()
17
17
  </script>
18
18
 
19
19
  <template>
@@ -25,12 +25,13 @@ const value = defineModel<string>({ required: true })
25
25
  :name="props.id"
26
26
  >
27
27
  <USelect
28
- v-model="value"
29
28
  :placeholder="props.placeholder || 'Make a seletion'"
30
29
  :items="options"
31
30
  value-attribute="value"
32
31
  option-attribute="key"
33
32
  class="w-full"
33
+ :modelValue="value || ''"
34
+ @update:modelValue="value = $event"
34
35
  />
35
36
  </UFormField>
36
37
  </div>
@@ -17,7 +17,7 @@ const value = defineModel<string>()
17
17
  :description="props.description"
18
18
  :name="props.id"
19
19
  >
20
- <UTextarea class="w-full" :value="value || ''" @input="value = $event.target.value" />
20
+ <UTextarea class="w-full" :modelValue="value || ''" @update:modelValue="value = $event" />
21
21
  </UFormField>
22
22
  </div>
23
23
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ederzeel/nuxt-schema-form-nightly",
3
- "version": "0.1.0-29120408.504cd02",
3
+ "version": "0.1.0-29120910.2e7f39c",
4
4
  "description": "A runtime form generator for nuxt",
5
5
  "type": "module",
6
6
  "exports": {
@@ -59,7 +59,6 @@
59
59
  "globals": "^15.14.0",
60
60
  "jiti": "^2.4.2",
61
61
  "json-schema-library": "10.0.0-rc7",
62
- "json-schema-yup-transformer": "^1.6.12",
63
62
  "magic-string": "^0.30.17",
64
63
  "mlly": "^1.7.4",
65
64
  "nuxt": "^3.16.0",
@@ -76,7 +75,8 @@
76
75
  "yup": "^1.6.1"
77
76
  },
78
77
  "dependencies": {
79
- "@internationalized/date": "^3.7.0"
78
+ "@internationalized/date": "^3.7.0",
79
+ "json-schema-yup-transformer": "^1.6.12"
80
80
  },
81
81
  "resolutions": {
82
82
  "@ederzeel/nuxt-schema-form": "workspace:*"