@ederzeel/nuxt-schema-form-nightly 0.1.0-29072969.076bdd0 → 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.
- package/dist/runtime/components/{SArray.vue → Array.vue} +11 -32
- package/dist/runtime/components/{SComponent.vue → Component.vue} +6 -0
- package/dist/runtime/components/Form.vue +1 -1
- package/dist/runtime/components/{SObject.vue → Object.vue} +5 -12
- package/dist/runtime/components/{SRow.vue → Row.vue} +5 -11
- package/package.json +1 -1
- /package/dist/runtime/components/{SDate.vue → Date.vue} +0 -0
- /package/dist/runtime/components/{SInputField.vue → InputField.vue} +0 -0
- /package/dist/runtime/components/{SInputNumber.vue → InputNumber.vue} +0 -0
- /package/dist/runtime/components/{SSelect.vue → Select.vue} +0 -0
- /package/dist/runtime/components/{STextarea.vue → Textarea.vue} +0 -0
- /package/dist/runtime/components/{SToggle.vue → Toggle.vue} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { Draft2019 } from 'json-schema-library'
|
|
3
|
-
import SComponent from './
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
:
|
|
219
|
-
|
|
220
|
-
|
|
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 }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import SComponent from './
|
|
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
|
-
|
|
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
|
-
:
|
|
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 './
|
|
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
|
-
|
|
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
|
-
:
|
|
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
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|