@ederzeel/nuxt-schema-form-nightly 0.1.0-29072956.a460a81 → 0.1.0-29079172.693cbb7

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.
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { Draft2019 } from 'json-schema-library'
3
- import SComponent from './SComponent.vue'
3
+ import SComponent from './Component.vue'
4
4
  import { ref, computed } from 'vue'
5
5
 
6
6
  const props = defineProps<{
@@ -167,15 +167,8 @@ const options = computed(() => {
167
167
  <div>
168
168
  <div class="flex justify-between items-center w-full px-4 py-3">
169
169
  <div class="flex gap-1.5 items-center">
170
- <UButton
171
- v-if="edit"
172
- :disabled="maxItems && values.length >= maxItems"
173
- @click="add"
174
- icon="i-heroicons-plus"
175
- trailing
176
- color="neutral"
177
- size="xs"
178
- />
170
+ <UButton v-if="edit" :disabled="maxItems && values.length >= maxItems" @click="add" icon="i-heroicons-plus"
171
+ trailing color="neutral" size="xs" />
179
172
  </div>
180
173
  <div class="flex gap-1.5 items-center">
181
174
  <UDropdownMenu v-if="selectedRows.length > 0" :items="massActions">
@@ -187,21 +180,15 @@ const options = computed(() => {
187
180
  <template #name-data="{ row }">
188
181
  <span :class="[selected.find(person => person.id === row.id) && 'text-primary-500 dark:text-primary-400']">{{
189
182
  row.name
190
- }}</span>
183
+ }}</span>
191
184
  </template>
192
185
 
193
186
  <template #expand="{ row, index }">
194
187
  <div class="p-4">
195
- <SComponent
196
- :id="id.length <= 0 ? `${index}` : `${id}[${index}].${items.id}`"
197
- :model-value="row"
188
+ <SComponent :id="id.length <= 0 ? `${index}` : `${id}[${index}].${items.id}`" :model-value="row"
198
189
  :json-schema-path="jsonSchemaPath?.length <= 0 ? `properties.${index}` : `${jsonSchemaPath}[${index}]`"
199
- v-bind="items"
200
- :isRequired="false"
201
- class="mt-4"
202
- @update:model-value="event => onInput(event, index)"
203
- @submit="() => emit('submit')"
204
- />
190
+ v-bind="items" :isRequired="false" class="mt-4" @update:model-value="event => onInput(event, index)"
191
+ @submit="() => emit('submit')" />
205
192
  </div>
206
193
  </template>
207
194
 
@@ -214,18 +201,10 @@ const options = computed(() => {
214
201
  </div>
215
202
  <UModal v-model:open="model.open">
216
203
  <UCard>
217
- <SComponent
218
- :id="id.length <= 0 ? `${model.index}` : `${id}[0].${items.id}`"
219
- :model-value="values[model.index]"
220
- :json-schema-path="
221
- jsonSchemaPath?.length <= 0 ? `properties.${model.index}` : `${jsonSchemaPath}[${model.index}]`
222
- "
223
- v-bind="items"
224
- :isRequired="false"
225
- class="mt-4"
226
- @update:model-value="event => onInput(event, model.index)"
227
- @submit="() => emit('submit')"
228
- />
204
+ <SComponent :id="id.length <= 0 ? `${model.index}` : `${id}[0].${items.id}`" :model-value="values[model.index]"
205
+ :json-schema-path="jsonSchemaPath?.length <= 0 ? `properties.${model.index}` : `${jsonSchemaPath}[${model.index}]`
206
+ " v-bind="items" :isRequired="false" class="mt-4" @update:model-value="event => onInput(event, model.index)"
207
+ @submit="() => emit('submit')" />
229
208
  <template #footer>
230
209
  <UButton>Save</UButton>
231
210
  </template>
@@ -1,5 +1,11 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed } from 'vue'
3
+ import SObject from './Object.vue'
4
+ import SDate from './Date.vue'
5
+ import SToggle from './Toggle.vue'
6
+ import SArray from './Array.vue'
7
+ import SInputNumber from './InputNumber.vue'
8
+ import SInputField from './InputField.vue'
3
9
 
4
10
  type Properties = {
5
11
  properties?: { [key: string]: unknown }
@@ -41,7 +47,7 @@ const onSubmit = () => {
41
47
 
42
48
  <template>
43
49
  <div class="s-form-group">
44
- <template v-if="renderer != null && renderer === 'none'">test</template>
50
+ <template v-if="renderer != null && renderer === 'none'">{{ undefined }}</template>
45
51
  <component v-else-if="renderer" v-bind="options" v-model="value"
46
52
  :is="typeof renderer === 'string' ? renderer : undefined" @submit="onSubmit" />
47
53
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import SComponent from './SComponent.vue'
2
+ import SComponent from './Component.vue'
3
3
  import convertToYup from 'json-schema-yup-transformer'
4
4
  import type { JsonSchema } from 'json-schema-library'
5
5
  import { computed, ref } from 'vue'
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import SComponent from './SComponent.vue'
2
+ import SComponent from './Component.vue'
3
3
 
4
4
  const props = defineProps<{
5
5
  id: string
@@ -26,17 +26,10 @@ const onInput = (value: unknown, key: string) => {
26
26
  <h2 v-if="props.title" class="mb-4 text-2xl leading-none tracking-tight">{{ props.title }}</h2>
27
27
  <p v-if="props.description" class="mb-4">{{ props.description }}</p>
28
28
 
29
- <SComponent
30
- v-for="[key, options] of Object.entries(properties)"
31
- :id="id.length <= 0 ? `${key}` : `${id}.${key}`"
32
- :key="key"
33
- :model-value="modelValue[key]"
29
+ <SComponent v-for="[key, options] of Object.entries(properties)" :id="id.length <= 0 ? `${key}` : `${id}.${key}`"
30
+ :key="key" :model-value="modelValue[key]"
34
31
  :json-schema-path="jsonSchemaPath?.length <= 0 ? `properties.${key}` : `${jsonSchemaPath}.properties.${key}`"
35
- v-bind="options"
36
- :isRequired="required.includes(key)"
37
- class="mt-4"
38
- @update:model-value="event => onInput(event, key)"
39
- @submit="() => emit('submit')"
40
- />
32
+ v-bind="options" :isRequired="required.includes(key)" class="mt-4"
33
+ @update:model-value="event => onInput(event, key)" @submit="() => emit('submit')" />
41
34
  </div>
42
35
  </template>
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import SComponent from './SComponent.vue'
2
+ import SComponent from './Component.vue'
3
3
 
4
4
  const props = defineProps<{
5
5
  id: string
@@ -26,16 +26,10 @@ const onInput = (value: unknown, key: string) => {
26
26
  <h2 v-if="props.title" class="mb-4 text-2xl leading-none tracking-tight">{{ props.title }}</h2>
27
27
  <p v-if="props.description" class="mb-4">{{ props.description }}</p>
28
28
 
29
- <SComponent
30
- v-for="[key, options] of Object.entries(properties)"
31
- :id="id.length <= 0 ? `${key}` : `${id}.${key}`"
32
- :key="key"
33
- :model-value="modelValue[key]"
29
+ <SComponent v-for="[key, options] of Object.entries(properties)" :id="id.length <= 0 ? `${key}` : `${id}.${key}`"
30
+ :key="key" :model-value="modelValue[key]"
34
31
  :json-schema-path="jsonSchemaPath?.length <= 0 ? `properties.${key}` : `${jsonSchemaPath}.properties.${key}`"
35
- v-bind="options"
36
- :isRequired="required.includes(key)"
37
- class="flex flex-col flex-1"
38
- @update:model-value="event => onInput(event, key)"
39
- />
32
+ v-bind="options" :isRequired="required.includes(key)" class="flex flex-col flex-1"
33
+ @update:model-value="event => onInput(event, key)" />
40
34
  </div>
41
35
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ederzeel/nuxt-schema-form-nightly",
3
- "version": "0.1.0-29072956.a460a81",
3
+ "version": "0.1.0-29079172.693cbb7",
4
4
  "description": "A runtime form generator for nuxt",
5
5
  "type": "module",
6
6
  "exports": {
File without changes