@ederzeel/nuxt-schema-form-nightly 0.1.0-29162300.5cf4e71 → 0.1.0-29244394.afb9630

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.
@@ -32,6 +32,8 @@ export type SComponentProps = {
32
32
  edit?: boolean
33
33
  minItems?: number
34
34
  maxItems?: number
35
+ minimum?: number
36
+ maximum?: number
35
37
  editInline?: boolean
36
38
  columns?: TableColumn<{}>[]
37
39
  validateFields?: (fields: string[]) => Promise<boolean>
@@ -4,6 +4,8 @@ const props = defineProps<{
4
4
  title?: string
5
5
  description?: string
6
6
  type: string
7
+ minimum?: number
8
+ maximum?: number
7
9
  isRequired: boolean
8
10
  }>()
9
11
 
@@ -22,6 +24,8 @@ const value = defineModel<number>({ required: true, default: 0 })
22
24
  v-model="value"
23
25
  class="w-full"
24
26
  orientation="vertical"
27
+ :min="minimum"
28
+ :max="maximum"
25
29
  :step="0.01"
26
30
  :stepSnapping="props.type === 'integer'"
27
31
  :format-options="{
@@ -0,0 +1,26 @@
1
+ <script lang="ts" setup>
2
+ const props = defineProps<{
3
+ id: string
4
+ title?: string
5
+ description?: string
6
+ type: string
7
+ minimum?: number
8
+ maximum?: number
9
+ isRequired: boolean
10
+ }>()
11
+
12
+ const value = defineModel<number>({ required: true, default: 0 })
13
+ </script>
14
+
15
+ <template>
16
+ <div>
17
+ <UFormField
18
+ :label="props.title || id"
19
+ :hint="!props.isRequired ? 'optional' : undefined"
20
+ :description="props.description"
21
+ :name="props.id"
22
+ >
23
+ <USlider class="mt-2" :min="props.minimum" :max="props.maximum" :step="1" v-model="value" tooltip />
24
+ </UFormField>
25
+ </div>
26
+ </template>
@@ -61,10 +61,6 @@ const values = computed(() => {
61
61
  return []
62
62
  })
63
63
 
64
- type Entries<T> = {
65
- [K in keyof T]: [K, T[K]]
66
- }[keyof T][]
67
-
68
64
  const geneateColumnsFromSchema = (items: PropertiesType): TableColumn<{}>[] => {
69
65
  if (!items.properties) return []
70
66
  const res: TableColumn<{}>[] = (Object.entries(items.properties) as [string, PropertiesType][]).map(
@@ -89,7 +85,6 @@ const geneateColumnsFromSchema = (items: PropertiesType): TableColumn<{}>[] => {
89
85
  }
90
86
 
91
87
  const columns = computed<TableColumn<{}>[]>(() => {
92
- console.log(geneateColumnsFromSchema(props.items))
93
88
  const columns = props.columns ? Array.from(props.columns) : geneateColumnsFromSchema(props.items)
94
89
 
95
90
  if (props.editInline) {
@@ -113,7 +108,6 @@ const columns = computed<TableColumn<{}>[]>(() => {
113
108
  if (props.edit) {
114
109
  columns.push({
115
110
  id: 'actions',
116
- rowClass: 'text-right',
117
111
  cell: ({ row }) => {
118
112
  return h(
119
113
  'div',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ederzeel/nuxt-schema-form-nightly",
3
- "version": "0.1.0-29162300.5cf4e71",
3
+ "version": "0.1.0-29244394.afb9630",
4
4
  "description": "A runtime form generator for nuxt",
5
5
  "type": "module",
6
6
  "exports": {