@ederzeel/nuxt-schema-form-nightly 0.1.0-29021289.98b222b → 0.1.0-29022346.1443684

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.
@@ -12,6 +12,7 @@ export type SComponentProps = {
12
12
  type: string
13
13
  properties?: Properties
14
14
  enum?: string[]
15
+ enum_titles?: string[]
15
16
  format?: string
16
17
  description?: string
17
18
  jsonSchemaPath?: string
@@ -1,18 +1,29 @@
1
1
  <script lang="ts" setup>
2
+ import { computed } from 'vue'
3
+
2
4
  const props = defineProps<{
3
5
  id: string
4
6
  title?: string
5
7
  description?: string
6
8
  enum: string[]
9
+ enum_titles: string[]
7
10
  }>()
8
11
 
12
+ const options = computed(() => props.enum.map((x, i) => ({ key: props?.enum_titles?.[i] ?? x, value: x })))
13
+
9
14
  const value = defineModel<string>({ required: true })
10
15
  </script>
11
16
 
12
17
  <template>
13
18
  <div>
14
19
  <UFormGroup :label="props.title || id" :description="props.description" :name="props.id">
15
- <USelect v-model="value" placeholder="select size" :options="props.enum" />
20
+ <USelect
21
+ v-model="value"
22
+ placeholder="select size"
23
+ :options="options"
24
+ value-attribute="value"
25
+ option-attribute="key"
26
+ />
16
27
  </UFormGroup>
17
28
  </div>
18
29
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ederzeel/nuxt-schema-form-nightly",
3
- "version": "0.1.0-29021289.98b222b",
3
+ "version": "0.1.0-29022346.1443684",
4
4
  "description": "A runtime form generator for nuxt",
5
5
  "type": "module",
6
6
  "exports": {