jsonforms-nuxt-ui-renderers 0.2.0 → 0.2.2
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/README.md +36 -4
- package/dist/index.cjs +296 -248
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +169 -123
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,8 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
controlDescription: () => controlDescription,
|
|
23
24
|
createNuxtUiRenderers: () => createNuxtUiRenderers,
|
|
24
25
|
defaultTheme: () => defaultTheme,
|
|
26
|
+
getDocsPathFromSchema: () => getDocsPathFromSchema,
|
|
25
27
|
mergeTheme: () => mergeTheme,
|
|
26
28
|
nuxtUiRenderers: () => nuxtUiRenderers
|
|
27
29
|
});
|
|
@@ -29,35 +31,70 @@ module.exports = __toCommonJS(index_exports);
|
|
|
29
31
|
|
|
30
32
|
// src/nuxtUiRenderers.ts
|
|
31
33
|
var import_core3 = require("@jsonforms/core");
|
|
32
|
-
var
|
|
34
|
+
var import_vue35 = require("vue");
|
|
33
35
|
|
|
34
36
|
// src/renderers/complex/NuxtUiArrayListRenderer.ts
|
|
35
37
|
var import_core = require("@jsonforms/core");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
+
var import_vue3 = require("@jsonforms/vue");
|
|
39
|
+
var import_vue4 = require("vue");
|
|
38
40
|
|
|
39
41
|
// src/renderers/util.ts
|
|
40
42
|
var import_vue = require("vue");
|
|
43
|
+
var import_vue2 = require("vue");
|
|
44
|
+
function getDocsPathFromSchema(schema) {
|
|
45
|
+
if (!schema || typeof schema !== "object" || Array.isArray(schema))
|
|
46
|
+
return null;
|
|
47
|
+
const s = schema;
|
|
48
|
+
const path = s["x-docs-path"];
|
|
49
|
+
if (typeof path === "string" && path.startsWith("/")) return path;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
function renderDocsHintSlot(schema, label, docsUrl, resolveComponent10) {
|
|
53
|
+
const path = getDocsPathFromSchema(schema);
|
|
54
|
+
if (!path || !docsUrl) return void 0;
|
|
55
|
+
const ULink = resolveComponent10("ULink");
|
|
56
|
+
const UIcon = resolveComponent10("UIcon");
|
|
57
|
+
if (!ULink || !UIcon) return void 0;
|
|
58
|
+
const href = docsUrl(path);
|
|
59
|
+
return () => (0, import_vue.h)(
|
|
60
|
+
ULink,
|
|
61
|
+
{
|
|
62
|
+
href,
|
|
63
|
+
target: "_blank",
|
|
64
|
+
rel: "noopener noreferrer",
|
|
65
|
+
class: "inline-flex items-center text-muted hover:text-primary",
|
|
66
|
+
"aria-label": `${label} docs`,
|
|
67
|
+
title: `${label} docs`
|
|
68
|
+
},
|
|
69
|
+
() => (0, import_vue.h)(UIcon, { name: "i-heroicons-information-circle" })
|
|
70
|
+
);
|
|
71
|
+
}
|
|
41
72
|
function trimmedOrUndefined(input) {
|
|
42
73
|
const v = input?.trim();
|
|
43
74
|
return v ? v : void 0;
|
|
44
75
|
}
|
|
76
|
+
function controlDescription(control) {
|
|
77
|
+
const d = control.description?.trim();
|
|
78
|
+
if (d) return d;
|
|
79
|
+
const sd = control.schema?.description;
|
|
80
|
+
return typeof sd === "string" && sd.trim() ? sd.trim() : void 0;
|
|
81
|
+
}
|
|
45
82
|
|
|
46
83
|
// src/renderers/complex/NuxtUiArrayListRenderer.ts
|
|
47
84
|
function createNuxtUiArrayListRenderer(theme) {
|
|
48
|
-
return (0,
|
|
85
|
+
return (0, import_vue4.defineComponent)({
|
|
49
86
|
name: "NuxtUiArrayListRenderer",
|
|
50
|
-
components: { DispatchRenderer:
|
|
51
|
-
props: (0,
|
|
87
|
+
components: { DispatchRenderer: import_vue3.DispatchRenderer },
|
|
88
|
+
props: (0, import_vue3.rendererProps)(),
|
|
52
89
|
setup(props) {
|
|
53
|
-
const { control, addItem, removeItems, moveUp, moveDown } = (0,
|
|
90
|
+
const { control, addItem, removeItems, moveUp, moveDown } = (0, import_vue3.useJsonFormsArrayControl)(
|
|
54
91
|
props
|
|
55
92
|
);
|
|
56
|
-
const errorMessage = (0,
|
|
57
|
-
const items = (0,
|
|
93
|
+
const errorMessage = (0, import_vue4.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
94
|
+
const items = (0, import_vue4.computed)(
|
|
58
95
|
() => Array.isArray(control.value.data) ? control.value.data : []
|
|
59
96
|
);
|
|
60
|
-
const arraySchema = (0,
|
|
97
|
+
const arraySchema = (0, import_vue4.computed)(() => {
|
|
61
98
|
try {
|
|
62
99
|
return import_core.Resolve.schema(
|
|
63
100
|
props.schema,
|
|
@@ -68,15 +105,15 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
68
105
|
return void 0;
|
|
69
106
|
}
|
|
70
107
|
});
|
|
71
|
-
const maxItemsReached = (0,
|
|
108
|
+
const maxItemsReached = (0, import_vue4.computed)(() => {
|
|
72
109
|
const max = arraySchema.value?.maxItems;
|
|
73
110
|
return typeof max === "number" ? items.value.length >= max : false;
|
|
74
111
|
});
|
|
75
|
-
const minItemsReached = (0,
|
|
112
|
+
const minItemsReached = (0, import_vue4.computed)(() => {
|
|
76
113
|
const min = arraySchema.value?.minItems;
|
|
77
114
|
return typeof min === "number" ? items.value.length <= min : false;
|
|
78
115
|
});
|
|
79
|
-
const childUiSchema = (0,
|
|
116
|
+
const childUiSchema = (0, import_vue4.computed)(
|
|
80
117
|
() => (0, import_core.findUISchema)(
|
|
81
118
|
control.value.uischemas,
|
|
82
119
|
control.value.schema,
|
|
@@ -112,12 +149,12 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
112
149
|
}
|
|
113
150
|
return () => {
|
|
114
151
|
if (!control.value.visible) return null;
|
|
115
|
-
const UFormField = (0,
|
|
116
|
-
const UButton = (0,
|
|
117
|
-
return (0,
|
|
152
|
+
const UFormField = (0, import_vue4.resolveComponent)("UFormField");
|
|
153
|
+
const UButton = (0, import_vue4.resolveComponent)("UButton");
|
|
154
|
+
return (0, import_vue4.h)(
|
|
118
155
|
"div",
|
|
119
156
|
{},
|
|
120
|
-
(0,
|
|
157
|
+
(0, import_vue4.h)(
|
|
121
158
|
UFormField,
|
|
122
159
|
{
|
|
123
160
|
label: control.value.label,
|
|
@@ -126,14 +163,14 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
126
163
|
error: errorMessage.value
|
|
127
164
|
},
|
|
128
165
|
{
|
|
129
|
-
default: () => (0,
|
|
130
|
-
(0,
|
|
131
|
-
(0,
|
|
166
|
+
default: () => (0, import_vue4.h)("div", { class: theme.layoutVertical }, [
|
|
167
|
+
(0, import_vue4.h)("div", { class: theme.flexBetween }, [
|
|
168
|
+
(0, import_vue4.h)(
|
|
132
169
|
"div",
|
|
133
170
|
{ class: theme.textMutedXs },
|
|
134
171
|
`${items.value.length} items`
|
|
135
172
|
),
|
|
136
|
-
(0,
|
|
173
|
+
(0, import_vue4.h)(
|
|
137
174
|
UButton,
|
|
138
175
|
{
|
|
139
176
|
type: "button",
|
|
@@ -146,26 +183,26 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
146
183
|
{ default: () => "Add" }
|
|
147
184
|
)
|
|
148
185
|
]),
|
|
149
|
-
items.value.length === 0 ? (0,
|
|
186
|
+
items.value.length === 0 ? (0, import_vue4.h)("div", { class: theme.textMuted }, "No items.") : null,
|
|
150
187
|
...items.value.map(
|
|
151
|
-
(_item, index) => (0,
|
|
188
|
+
(_item, index) => (0, import_vue4.h)(
|
|
152
189
|
"div",
|
|
153
190
|
{
|
|
154
191
|
key: `${control.value.path}-${index}`,
|
|
155
192
|
class: theme.panel
|
|
156
193
|
},
|
|
157
194
|
[
|
|
158
|
-
(0,
|
|
195
|
+
(0, import_vue4.h)(
|
|
159
196
|
"div",
|
|
160
197
|
{ class: theme.arrayItemToolbar },
|
|
161
198
|
[
|
|
162
|
-
(0,
|
|
163
|
-
(0,
|
|
199
|
+
(0, import_vue4.h)("div", { class: "jf-min-w-0" }, [
|
|
200
|
+
(0, import_vue4.h)(
|
|
164
201
|
"div",
|
|
165
202
|
{ class: theme.textItemTitle },
|
|
166
203
|
[
|
|
167
204
|
`Item ${index + 1}`,
|
|
168
|
-
childLabelForIndex(index) ? (0,
|
|
205
|
+
childLabelForIndex(index) ? (0, import_vue4.h)(
|
|
169
206
|
"span",
|
|
170
207
|
{ class: theme.textItemSuffix },
|
|
171
208
|
` \u2014 ${childLabelForIndex(index)}`
|
|
@@ -173,8 +210,8 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
173
210
|
]
|
|
174
211
|
)
|
|
175
212
|
]),
|
|
176
|
-
(0,
|
|
177
|
-
(0,
|
|
213
|
+
(0, import_vue4.h)("div", { class: theme.flexActions }, [
|
|
214
|
+
(0, import_vue4.h)(
|
|
178
215
|
UButton,
|
|
179
216
|
{
|
|
180
217
|
type: "button",
|
|
@@ -186,7 +223,7 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
186
223
|
},
|
|
187
224
|
{ default: () => "Up" }
|
|
188
225
|
),
|
|
189
|
-
(0,
|
|
226
|
+
(0, import_vue4.h)(
|
|
190
227
|
UButton,
|
|
191
228
|
{
|
|
192
229
|
type: "button",
|
|
@@ -198,7 +235,7 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
198
235
|
},
|
|
199
236
|
{ default: () => "Down" }
|
|
200
237
|
),
|
|
201
|
-
(0,
|
|
238
|
+
(0, import_vue4.h)(
|
|
202
239
|
UButton,
|
|
203
240
|
{
|
|
204
241
|
type: "button",
|
|
@@ -215,7 +252,7 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
215
252
|
])
|
|
216
253
|
]
|
|
217
254
|
),
|
|
218
|
-
(0,
|
|
255
|
+
(0, import_vue4.h)(import_vue3.DispatchRenderer, {
|
|
219
256
|
schema: control.value.schema,
|
|
220
257
|
uischema: childUiSchema.value,
|
|
221
258
|
path: (0, import_core.composePaths)(control.value.path, `${index}`),
|
|
@@ -237,17 +274,17 @@ function createNuxtUiArrayListRenderer(theme) {
|
|
|
237
274
|
|
|
238
275
|
// src/renderers/complex/NuxtUiObjectRenderer.ts
|
|
239
276
|
var import_core2 = require("@jsonforms/core");
|
|
240
|
-
var
|
|
241
|
-
var
|
|
242
|
-
var NuxtUiObjectRenderer = (0,
|
|
277
|
+
var import_vue5 = require("@jsonforms/vue");
|
|
278
|
+
var import_vue6 = require("vue");
|
|
279
|
+
var NuxtUiObjectRenderer = (0, import_vue6.defineComponent)({
|
|
243
280
|
name: "NuxtUiObjectRenderer",
|
|
244
|
-
components: { DispatchRenderer:
|
|
245
|
-
props: (0,
|
|
281
|
+
components: { DispatchRenderer: import_vue5.DispatchRenderer },
|
|
282
|
+
props: (0, import_vue5.rendererProps)(),
|
|
246
283
|
setup(props) {
|
|
247
|
-
const { control } = (0,
|
|
284
|
+
const { control } = (0, import_vue5.useJsonFormsControlWithDetail)(
|
|
248
285
|
props
|
|
249
286
|
);
|
|
250
|
-
const detailUiSchema = (0,
|
|
287
|
+
const detailUiSchema = (0, import_vue6.computed)(() => {
|
|
251
288
|
const uiSchemaGenerator = () => {
|
|
252
289
|
const uiSchema = import_core2.Generate.uiSchema(
|
|
253
290
|
control.value.schema,
|
|
@@ -275,7 +312,7 @@ var NuxtUiObjectRenderer = (0, import_vue5.defineComponent)({
|
|
|
275
312
|
});
|
|
276
313
|
return () => {
|
|
277
314
|
if (!control.value.visible) return null;
|
|
278
|
-
return (0,
|
|
315
|
+
return (0, import_vue6.h)(import_vue5.DispatchRenderer, {
|
|
279
316
|
visible: control.value.visible,
|
|
280
317
|
enabled: control.value.enabled,
|
|
281
318
|
schema: control.value.schema,
|
|
@@ -289,41 +326,41 @@ var NuxtUiObjectRenderer = (0, import_vue5.defineComponent)({
|
|
|
289
326
|
});
|
|
290
327
|
|
|
291
328
|
// src/renderers/controls/NuxtUiBooleanControl.ts
|
|
292
|
-
var
|
|
293
|
-
var
|
|
329
|
+
var import_vue7 = require("@jsonforms/vue");
|
|
330
|
+
var import_vue8 = require("vue");
|
|
294
331
|
function createNuxtUiBooleanControl(theme) {
|
|
295
|
-
return (0,
|
|
332
|
+
return (0, import_vue8.defineComponent)({
|
|
296
333
|
name: "NuxtUiBooleanControl",
|
|
297
|
-
props: (0,
|
|
334
|
+
props: (0, import_vue7.rendererProps)(),
|
|
298
335
|
setup(props) {
|
|
299
|
-
const { control, handleChange } = (0,
|
|
336
|
+
const { control, handleChange } = (0, import_vue7.useJsonFormsControl)(
|
|
300
337
|
props
|
|
301
338
|
);
|
|
302
|
-
const errorMessage = (0,
|
|
303
|
-
const modelValue = (0,
|
|
339
|
+
const errorMessage = (0, import_vue8.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
340
|
+
const modelValue = (0, import_vue8.computed)({
|
|
304
341
|
get: () => Boolean(control.value.data),
|
|
305
342
|
set: (v) => handleChange(control.value.path, v)
|
|
306
343
|
});
|
|
307
344
|
return () => {
|
|
308
345
|
if (!control.value.visible) return null;
|
|
309
|
-
const UFormField = (0,
|
|
310
|
-
const USwitch = (0,
|
|
311
|
-
return (0,
|
|
346
|
+
const UFormField = (0, import_vue8.resolveComponent)("UFormField");
|
|
347
|
+
const USwitch = (0, import_vue8.resolveComponent)("USwitch");
|
|
348
|
+
return (0, import_vue8.h)(
|
|
312
349
|
"div",
|
|
313
350
|
{},
|
|
314
|
-
(0,
|
|
351
|
+
(0, import_vue8.h)(
|
|
315
352
|
UFormField,
|
|
316
353
|
{
|
|
317
354
|
label: control.value.label,
|
|
318
|
-
description: control.value
|
|
355
|
+
description: controlDescription(control.value),
|
|
319
356
|
required: control.value.required,
|
|
320
357
|
error: errorMessage.value
|
|
321
358
|
},
|
|
322
359
|
{
|
|
323
|
-
default: () => (0,
|
|
360
|
+
default: () => (0, import_vue8.h)(
|
|
324
361
|
"div",
|
|
325
362
|
{ class: theme.flexBetween },
|
|
326
|
-
(0,
|
|
363
|
+
(0, import_vue8.h)(USwitch, {
|
|
327
364
|
modelValue: modelValue.value,
|
|
328
365
|
disabled: !control.value.enabled,
|
|
329
366
|
"aria-invalid": Boolean(errorMessage.value),
|
|
@@ -341,8 +378,8 @@ function createNuxtUiBooleanControl(theme) {
|
|
|
341
378
|
}
|
|
342
379
|
|
|
343
380
|
// src/renderers/controls/NuxtUiEnumControl.ts
|
|
344
|
-
var
|
|
345
|
-
var
|
|
381
|
+
var import_vue9 = require("@jsonforms/vue");
|
|
382
|
+
var import_vue10 = require("vue");
|
|
346
383
|
function schemaEnumOptions(schema) {
|
|
347
384
|
if (!schema) return [];
|
|
348
385
|
if (Array.isArray(schema.enum)) {
|
|
@@ -362,36 +399,36 @@ function schemaEnumOptions(schema) {
|
|
|
362
399
|
}
|
|
363
400
|
return out;
|
|
364
401
|
}
|
|
365
|
-
var NuxtUiEnumControl = (0,
|
|
402
|
+
var NuxtUiEnumControl = (0, import_vue10.defineComponent)({
|
|
366
403
|
name: "NuxtUiEnumControl",
|
|
367
|
-
props: (0,
|
|
404
|
+
props: (0, import_vue9.rendererProps)(),
|
|
368
405
|
setup(props) {
|
|
369
|
-
const { control, handleChange } = (0,
|
|
406
|
+
const { control, handleChange } = (0, import_vue9.useJsonFormsControl)(
|
|
370
407
|
props
|
|
371
408
|
);
|
|
372
|
-
const errorMessage = (0,
|
|
373
|
-
const options = (0,
|
|
374
|
-
const selectedValue = (0,
|
|
409
|
+
const errorMessage = (0, import_vue10.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
410
|
+
const options = (0, import_vue10.computed)(() => schemaEnumOptions(control.value.schema));
|
|
411
|
+
const selectedValue = (0, import_vue10.computed)({
|
|
375
412
|
get: () => control.value.data,
|
|
376
413
|
set: (v) => handleChange(control.value.path, v)
|
|
377
414
|
});
|
|
378
415
|
return () => {
|
|
379
416
|
if (!control.value.visible) return null;
|
|
380
|
-
const UFormField = (0,
|
|
381
|
-
const USelectMenu = (0,
|
|
382
|
-
return (0,
|
|
417
|
+
const UFormField = (0, import_vue10.resolveComponent)("UFormField");
|
|
418
|
+
const USelectMenu = (0, import_vue10.resolveComponent)("USelectMenu");
|
|
419
|
+
return (0, import_vue10.h)(
|
|
383
420
|
"div",
|
|
384
421
|
{},
|
|
385
|
-
(0,
|
|
422
|
+
(0, import_vue10.h)(
|
|
386
423
|
UFormField,
|
|
387
424
|
{
|
|
388
425
|
label: control.value.label,
|
|
389
|
-
description: control.value
|
|
426
|
+
description: controlDescription(control.value),
|
|
390
427
|
required: control.value.required,
|
|
391
428
|
error: errorMessage.value
|
|
392
429
|
},
|
|
393
430
|
{
|
|
394
|
-
default: () => (0,
|
|
431
|
+
default: () => (0, import_vue10.h)(USelectMenu, {
|
|
395
432
|
modelValue: selectedValue.value,
|
|
396
433
|
items: options.value,
|
|
397
434
|
valueKey: "value",
|
|
@@ -412,17 +449,17 @@ var NuxtUiEnumControl = (0, import_vue9.defineComponent)({
|
|
|
412
449
|
});
|
|
413
450
|
|
|
414
451
|
// src/renderers/controls/NuxtUiIntegerControl.ts
|
|
415
|
-
var
|
|
416
|
-
var
|
|
417
|
-
var NuxtUiIntegerControl = (0,
|
|
452
|
+
var import_vue11 = require("@jsonforms/vue");
|
|
453
|
+
var import_vue12 = require("vue");
|
|
454
|
+
var NuxtUiIntegerControl = (0, import_vue12.defineComponent)({
|
|
418
455
|
name: "NuxtUiIntegerControl",
|
|
419
|
-
props: (0,
|
|
456
|
+
props: (0, import_vue11.rendererProps)(),
|
|
420
457
|
setup(props) {
|
|
421
|
-
const { control, handleChange } = (0,
|
|
458
|
+
const { control, handleChange } = (0, import_vue11.useJsonFormsControl)(
|
|
422
459
|
props
|
|
423
460
|
);
|
|
424
|
-
const errorMessage = (0,
|
|
425
|
-
const modelValue = (0,
|
|
461
|
+
const errorMessage = (0, import_vue12.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
462
|
+
const modelValue = (0, import_vue12.computed)(() => {
|
|
426
463
|
const v = control.value.data;
|
|
427
464
|
return v === null || v === void 0 ? "" : String(v);
|
|
428
465
|
});
|
|
@@ -437,21 +474,21 @@ var NuxtUiIntegerControl = (0, import_vue11.defineComponent)({
|
|
|
437
474
|
}
|
|
438
475
|
return () => {
|
|
439
476
|
if (!control.value.visible) return null;
|
|
440
|
-
const UFormField = (0,
|
|
441
|
-
const UInput = (0,
|
|
442
|
-
return (0,
|
|
477
|
+
const UFormField = (0, import_vue12.resolveComponent)("UFormField");
|
|
478
|
+
const UInput = (0, import_vue12.resolveComponent)("UInput");
|
|
479
|
+
return (0, import_vue12.h)(
|
|
443
480
|
"div",
|
|
444
481
|
{},
|
|
445
|
-
(0,
|
|
482
|
+
(0, import_vue12.h)(
|
|
446
483
|
UFormField,
|
|
447
484
|
{
|
|
448
485
|
label: control.value.label,
|
|
449
|
-
description: control.value
|
|
486
|
+
description: controlDescription(control.value),
|
|
450
487
|
required: control.value.required,
|
|
451
488
|
error: errorMessage.value
|
|
452
489
|
},
|
|
453
490
|
{
|
|
454
|
-
default: () => (0,
|
|
491
|
+
default: () => (0, import_vue12.h)(UInput, {
|
|
455
492
|
type: "number",
|
|
456
493
|
inputmode: "numeric",
|
|
457
494
|
step: "1",
|
|
@@ -469,8 +506,8 @@ var NuxtUiIntegerControl = (0, import_vue11.defineComponent)({
|
|
|
469
506
|
});
|
|
470
507
|
|
|
471
508
|
// src/renderers/controls/NuxtUiMultiEnumControl.ts
|
|
472
|
-
var
|
|
473
|
-
var
|
|
509
|
+
var import_vue13 = require("@jsonforms/vue");
|
|
510
|
+
var import_vue14 = require("vue");
|
|
474
511
|
function schemaEnumOptions2(schema) {
|
|
475
512
|
if (!schema) return [];
|
|
476
513
|
if (Array.isArray(schema.enum)) {
|
|
@@ -496,38 +533,38 @@ function arrayItemsSchema(schema) {
|
|
|
496
533
|
if (typeof items !== "object" || items === null) return void 0;
|
|
497
534
|
return items;
|
|
498
535
|
}
|
|
499
|
-
var NuxtUiMultiEnumControl = (0,
|
|
536
|
+
var NuxtUiMultiEnumControl = (0, import_vue14.defineComponent)({
|
|
500
537
|
name: "NuxtUiMultiEnumControl",
|
|
501
|
-
props: (0,
|
|
538
|
+
props: (0, import_vue13.rendererProps)(),
|
|
502
539
|
setup(props) {
|
|
503
|
-
const { control, handleChange } = (0,
|
|
540
|
+
const { control, handleChange } = (0, import_vue13.useJsonFormsControl)(
|
|
504
541
|
props
|
|
505
542
|
);
|
|
506
|
-
const errorMessage = (0,
|
|
507
|
-
const options = (0,
|
|
543
|
+
const errorMessage = (0, import_vue14.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
544
|
+
const options = (0, import_vue14.computed)(
|
|
508
545
|
() => schemaEnumOptions2(arrayItemsSchema(control.value.schema))
|
|
509
546
|
);
|
|
510
|
-
const selectedValues = (0,
|
|
547
|
+
const selectedValues = (0, import_vue14.computed)({
|
|
511
548
|
get: () => Array.isArray(control.value.data) ? control.value.data : [],
|
|
512
549
|
set: (v) => handleChange(control.value.path, v)
|
|
513
550
|
});
|
|
514
551
|
return () => {
|
|
515
552
|
if (!control.value.visible) return null;
|
|
516
|
-
const UFormField = (0,
|
|
517
|
-
const USelectMenu = (0,
|
|
518
|
-
return (0,
|
|
553
|
+
const UFormField = (0, import_vue14.resolveComponent)("UFormField");
|
|
554
|
+
const USelectMenu = (0, import_vue14.resolveComponent)("USelectMenu");
|
|
555
|
+
return (0, import_vue14.h)(
|
|
519
556
|
"div",
|
|
520
557
|
{},
|
|
521
|
-
(0,
|
|
558
|
+
(0, import_vue14.h)(
|
|
522
559
|
UFormField,
|
|
523
560
|
{
|
|
524
561
|
label: control.value.label,
|
|
525
|
-
description: control.value
|
|
562
|
+
description: controlDescription(control.value),
|
|
526
563
|
required: control.value.required,
|
|
527
564
|
error: errorMessage.value
|
|
528
565
|
},
|
|
529
566
|
{
|
|
530
|
-
default: () => (0,
|
|
567
|
+
default: () => (0, import_vue14.h)(USelectMenu, {
|
|
531
568
|
multiple: true,
|
|
532
569
|
modelValue: selectedValues.value,
|
|
533
570
|
items: options.value,
|
|
@@ -549,17 +586,17 @@ var NuxtUiMultiEnumControl = (0, import_vue13.defineComponent)({
|
|
|
549
586
|
});
|
|
550
587
|
|
|
551
588
|
// src/renderers/controls/NuxtUiNumberControl.ts
|
|
552
|
-
var
|
|
553
|
-
var
|
|
554
|
-
var NuxtUiNumberControl = (0,
|
|
589
|
+
var import_vue15 = require("@jsonforms/vue");
|
|
590
|
+
var import_vue16 = require("vue");
|
|
591
|
+
var NuxtUiNumberControl = (0, import_vue16.defineComponent)({
|
|
555
592
|
name: "NuxtUiNumberControl",
|
|
556
|
-
props: (0,
|
|
593
|
+
props: (0, import_vue15.rendererProps)(),
|
|
557
594
|
setup(props) {
|
|
558
|
-
const { control, handleChange } = (0,
|
|
595
|
+
const { control, handleChange } = (0, import_vue15.useJsonFormsControl)(
|
|
559
596
|
props
|
|
560
597
|
);
|
|
561
|
-
const errorMessage = (0,
|
|
562
|
-
const modelValue = (0,
|
|
598
|
+
const errorMessage = (0, import_vue16.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
599
|
+
const modelValue = (0, import_vue16.computed)(() => {
|
|
563
600
|
const v = control.value.data;
|
|
564
601
|
return v === null || v === void 0 ? "" : String(v);
|
|
565
602
|
});
|
|
@@ -574,21 +611,21 @@ var NuxtUiNumberControl = (0, import_vue15.defineComponent)({
|
|
|
574
611
|
}
|
|
575
612
|
return () => {
|
|
576
613
|
if (!control.value.visible) return null;
|
|
577
|
-
const UFormField = (0,
|
|
578
|
-
const UInput = (0,
|
|
579
|
-
return (0,
|
|
614
|
+
const UFormField = (0, import_vue16.resolveComponent)("UFormField");
|
|
615
|
+
const UInput = (0, import_vue16.resolveComponent)("UInput");
|
|
616
|
+
return (0, import_vue16.h)(
|
|
580
617
|
"div",
|
|
581
618
|
{},
|
|
582
|
-
(0,
|
|
619
|
+
(0, import_vue16.h)(
|
|
583
620
|
UFormField,
|
|
584
621
|
{
|
|
585
622
|
label: control.value.label,
|
|
586
|
-
description: control.value
|
|
623
|
+
description: controlDescription(control.value),
|
|
587
624
|
required: control.value.required,
|
|
588
625
|
error: errorMessage.value
|
|
589
626
|
},
|
|
590
627
|
{
|
|
591
|
-
default: () => (0,
|
|
628
|
+
default: () => (0, import_vue16.h)(UInput, {
|
|
592
629
|
type: "number",
|
|
593
630
|
inputmode: "decimal",
|
|
594
631
|
modelValue: modelValue.value,
|
|
@@ -605,36 +642,36 @@ var NuxtUiNumberControl = (0, import_vue15.defineComponent)({
|
|
|
605
642
|
});
|
|
606
643
|
|
|
607
644
|
// src/renderers/controls/NuxtUiPasswordControl.ts
|
|
608
|
-
var
|
|
609
|
-
var
|
|
610
|
-
var NuxtUiPasswordControl = (0,
|
|
645
|
+
var import_vue17 = require("@jsonforms/vue");
|
|
646
|
+
var import_vue18 = require("vue");
|
|
647
|
+
var NuxtUiPasswordControl = (0, import_vue18.defineComponent)({
|
|
611
648
|
name: "NuxtUiPasswordControl",
|
|
612
|
-
props: (0,
|
|
649
|
+
props: (0, import_vue17.rendererProps)(),
|
|
613
650
|
setup(props) {
|
|
614
|
-
const { control, handleChange } = (0,
|
|
651
|
+
const { control, handleChange } = (0, import_vue17.useJsonFormsControl)(
|
|
615
652
|
props
|
|
616
653
|
);
|
|
617
|
-
const errorMessage = (0,
|
|
618
|
-
const showPassword = (0,
|
|
619
|
-
const inputType = (0,
|
|
654
|
+
const errorMessage = (0, import_vue18.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
655
|
+
const showPassword = (0, import_vue18.ref)(false);
|
|
656
|
+
const inputType = (0, import_vue18.computed)(() => showPassword.value ? "text" : "password");
|
|
620
657
|
return () => {
|
|
621
658
|
if (!control.value.visible) return null;
|
|
622
|
-
const UFormField = (0,
|
|
623
|
-
const UInput = (0,
|
|
624
|
-
const UButton = (0,
|
|
625
|
-
return (0,
|
|
659
|
+
const UFormField = (0, import_vue18.resolveComponent)("UFormField");
|
|
660
|
+
const UInput = (0, import_vue18.resolveComponent)("UInput");
|
|
661
|
+
const UButton = (0, import_vue18.resolveComponent)("UButton");
|
|
662
|
+
return (0, import_vue18.h)(
|
|
626
663
|
"div",
|
|
627
664
|
{},
|
|
628
|
-
(0,
|
|
665
|
+
(0, import_vue18.h)(
|
|
629
666
|
UFormField,
|
|
630
667
|
{
|
|
631
668
|
label: control.value.label,
|
|
632
|
-
description: control.value
|
|
669
|
+
description: controlDescription(control.value),
|
|
633
670
|
required: control.value.required,
|
|
634
671
|
error: errorMessage.value
|
|
635
672
|
},
|
|
636
673
|
{
|
|
637
|
-
default: () => (0,
|
|
674
|
+
default: () => (0, import_vue18.h)(
|
|
638
675
|
UInput,
|
|
639
676
|
{
|
|
640
677
|
modelValue: control.value.data ?? "",
|
|
@@ -647,7 +684,7 @@ var NuxtUiPasswordControl = (0, import_vue17.defineComponent)({
|
|
|
647
684
|
"onUpdate:modelValue": (v) => handleChange(control.value.path, v)
|
|
648
685
|
},
|
|
649
686
|
{
|
|
650
|
-
trailing: () => (0,
|
|
687
|
+
trailing: () => (0, import_vue18.h)(UButton, {
|
|
651
688
|
type: "button",
|
|
652
689
|
color: "neutral",
|
|
653
690
|
variant: "ghost",
|
|
@@ -670,75 +707,83 @@ var NuxtUiPasswordControl = (0, import_vue17.defineComponent)({
|
|
|
670
707
|
});
|
|
671
708
|
|
|
672
709
|
// src/renderers/controls/NuxtUiStringControl.ts
|
|
673
|
-
var
|
|
674
|
-
var
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
"
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
710
|
+
var import_vue19 = require("@jsonforms/vue");
|
|
711
|
+
var import_vue20 = require("vue");
|
|
712
|
+
function createNuxtUiStringControl(docsUrl) {
|
|
713
|
+
return (0, import_vue20.defineComponent)({
|
|
714
|
+
name: "NuxtUiStringControl",
|
|
715
|
+
props: (0, import_vue19.rendererProps)(),
|
|
716
|
+
setup(props) {
|
|
717
|
+
const { control, handleChange } = (0, import_vue19.useJsonFormsControl)(
|
|
718
|
+
props
|
|
719
|
+
);
|
|
720
|
+
const errorMessage = (0, import_vue20.computed)(
|
|
721
|
+
() => trimmedOrUndefined(control.value.errors)
|
|
722
|
+
);
|
|
723
|
+
return () => {
|
|
724
|
+
if (!control.value.visible) return null;
|
|
725
|
+
const UFormField = (0, import_vue20.resolveComponent)("UFormField");
|
|
726
|
+
const UInput = (0, import_vue20.resolveComponent)("UInput");
|
|
727
|
+
const slots = {
|
|
728
|
+
default: () => (0, import_vue20.h)(UInput, {
|
|
729
|
+
modelValue: control.value.data ?? "",
|
|
730
|
+
class: "w-full",
|
|
731
|
+
disabled: !control.value.enabled,
|
|
732
|
+
color: errorMessage.value ? "error" : void 0,
|
|
733
|
+
"aria-invalid": Boolean(errorMessage.value),
|
|
734
|
+
"onUpdate:modelValue": (v) => handleChange(control.value.path, v)
|
|
735
|
+
})
|
|
736
|
+
};
|
|
737
|
+
const hintSlot = renderDocsHintSlot(
|
|
738
|
+
control.value.schema,
|
|
739
|
+
control.value.label ?? "",
|
|
740
|
+
docsUrl,
|
|
741
|
+
import_vue20.resolveComponent
|
|
742
|
+
);
|
|
743
|
+
if (hintSlot) slots.hint = hintSlot;
|
|
744
|
+
return (0, import_vue20.h)(
|
|
745
|
+
"div",
|
|
746
|
+
{},
|
|
747
|
+
(0, import_vue20.h)(UFormField, {
|
|
693
748
|
label: control.value.label,
|
|
694
|
-
description: control.value
|
|
749
|
+
description: controlDescription(control.value),
|
|
695
750
|
required: control.value.required,
|
|
696
751
|
error: errorMessage.value
|
|
697
|
-
},
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
color: errorMessage.value ? "error" : void 0,
|
|
704
|
-
"aria-invalid": Boolean(errorMessage.value),
|
|
705
|
-
"onUpdate:modelValue": (v) => handleChange(control.value.path, v)
|
|
706
|
-
})
|
|
707
|
-
}
|
|
708
|
-
)
|
|
709
|
-
);
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
});
|
|
752
|
+
}, slots)
|
|
753
|
+
);
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
}
|
|
713
758
|
|
|
714
759
|
// src/renderers/controls/NuxtUiTextareaControl.ts
|
|
715
|
-
var
|
|
716
|
-
var
|
|
717
|
-
var NuxtUiTextareaControl = (0,
|
|
760
|
+
var import_vue21 = require("@jsonforms/vue");
|
|
761
|
+
var import_vue22 = require("vue");
|
|
762
|
+
var NuxtUiTextareaControl = (0, import_vue22.defineComponent)({
|
|
718
763
|
name: "NuxtUiTextareaControl",
|
|
719
|
-
props: (0,
|
|
764
|
+
props: (0, import_vue21.rendererProps)(),
|
|
720
765
|
setup(props) {
|
|
721
|
-
const { control, handleChange } = (0,
|
|
766
|
+
const { control, handleChange } = (0, import_vue21.useJsonFormsControl)(
|
|
722
767
|
props
|
|
723
768
|
);
|
|
724
|
-
const errorMessage = (0,
|
|
769
|
+
const errorMessage = (0, import_vue22.computed)(() => trimmedOrUndefined(control.value.errors));
|
|
725
770
|
return () => {
|
|
726
771
|
if (!control.value.visible) return null;
|
|
727
|
-
const UFormField = (0,
|
|
728
|
-
const UTextarea = (0,
|
|
729
|
-
return (0,
|
|
772
|
+
const UFormField = (0, import_vue22.resolveComponent)("UFormField");
|
|
773
|
+
const UTextarea = (0, import_vue22.resolveComponent)("UTextarea");
|
|
774
|
+
return (0, import_vue22.h)(
|
|
730
775
|
"div",
|
|
731
776
|
{},
|
|
732
|
-
(0,
|
|
777
|
+
(0, import_vue22.h)(
|
|
733
778
|
UFormField,
|
|
734
779
|
{
|
|
735
780
|
label: control.value.label,
|
|
736
|
-
description: control.value
|
|
781
|
+
description: controlDescription(control.value),
|
|
737
782
|
required: control.value.required,
|
|
738
783
|
error: errorMessage.value
|
|
739
784
|
},
|
|
740
785
|
{
|
|
741
|
-
default: () => (0,
|
|
786
|
+
default: () => (0, import_vue22.h)(UTextarea, {
|
|
742
787
|
modelValue: control.value.data ?? "",
|
|
743
788
|
class: "w-full",
|
|
744
789
|
disabled: !control.value.enabled,
|
|
@@ -755,41 +800,41 @@ var NuxtUiTextareaControl = (0, import_vue21.defineComponent)({
|
|
|
755
800
|
});
|
|
756
801
|
|
|
757
802
|
// src/renderers/layouts/NuxtUiCategorizationRenderer.ts
|
|
758
|
-
var
|
|
759
|
-
var
|
|
803
|
+
var import_vue23 = require("@jsonforms/vue");
|
|
804
|
+
var import_vue24 = require("vue");
|
|
760
805
|
function createNuxtUiCategorizationRenderer(theme) {
|
|
761
|
-
return (0,
|
|
806
|
+
return (0, import_vue24.defineComponent)({
|
|
762
807
|
name: "NuxtUiCategorizationRenderer",
|
|
763
|
-
components: { DispatchRenderer:
|
|
764
|
-
props: (0,
|
|
808
|
+
components: { DispatchRenderer: import_vue23.DispatchRenderer },
|
|
809
|
+
props: (0, import_vue23.rendererProps)(),
|
|
765
810
|
setup(props) {
|
|
766
|
-
const { layout, categories } = (0,
|
|
811
|
+
const { layout, categories } = (0, import_vue23.useJsonFormsCategorization)(
|
|
767
812
|
props
|
|
768
813
|
);
|
|
769
814
|
return () => {
|
|
770
815
|
if (!layout.value.visible) return null;
|
|
771
|
-
return (0,
|
|
816
|
+
return (0, import_vue24.h)(
|
|
772
817
|
"div",
|
|
773
818
|
{ class: theme.layoutVerticalWide },
|
|
774
819
|
categories.map((categoryRef, catIndex) => {
|
|
775
820
|
const category = categoryRef.value;
|
|
776
821
|
const elements = category.uischema.elements ?? [];
|
|
777
|
-
return (0,
|
|
822
|
+
return (0, import_vue24.h)(
|
|
778
823
|
"div",
|
|
779
824
|
{
|
|
780
825
|
key: `${layout.value.path}-cat-${catIndex}`,
|
|
781
826
|
class: theme.layoutVertical
|
|
782
827
|
},
|
|
783
828
|
[
|
|
784
|
-
category.label ? (0,
|
|
785
|
-
(0,
|
|
829
|
+
category.label ? (0, import_vue24.h)("div", { class: theme.labelSection }, category.label) : null,
|
|
830
|
+
(0, import_vue24.h)(
|
|
786
831
|
"div",
|
|
787
832
|
{ class: theme.layoutVertical },
|
|
788
833
|
elements.map(
|
|
789
|
-
(element, index) => (0,
|
|
834
|
+
(element, index) => (0, import_vue24.h)(
|
|
790
835
|
"div",
|
|
791
836
|
{ key: `${category.path}-${index}` },
|
|
792
|
-
(0,
|
|
837
|
+
(0, import_vue24.h)(import_vue23.DispatchRenderer, {
|
|
793
838
|
schema: category.schema,
|
|
794
839
|
uischema: element,
|
|
795
840
|
path: category.path,
|
|
@@ -810,30 +855,30 @@ function createNuxtUiCategorizationRenderer(theme) {
|
|
|
810
855
|
}
|
|
811
856
|
|
|
812
857
|
// src/renderers/layouts/NuxtUiCategoryRenderer.ts
|
|
813
|
-
var
|
|
814
|
-
var
|
|
858
|
+
var import_vue25 = require("@jsonforms/vue");
|
|
859
|
+
var import_vue26 = require("vue");
|
|
815
860
|
function createNuxtUiCategoryRenderer(theme) {
|
|
816
|
-
return (0,
|
|
861
|
+
return (0, import_vue26.defineComponent)({
|
|
817
862
|
name: "NuxtUiCategoryRenderer",
|
|
818
|
-
components: { DispatchRenderer:
|
|
819
|
-
props: (0,
|
|
863
|
+
components: { DispatchRenderer: import_vue25.DispatchRenderer },
|
|
864
|
+
props: (0, import_vue25.rendererProps)(),
|
|
820
865
|
setup(props) {
|
|
821
|
-
const { layout } = (0,
|
|
866
|
+
const { layout } = (0, import_vue25.useJsonFormsLayout)(
|
|
822
867
|
props
|
|
823
868
|
);
|
|
824
869
|
return () => {
|
|
825
870
|
if (!layout.value.visible) return null;
|
|
826
871
|
const elements = layout.value.uischema.elements ?? [];
|
|
827
|
-
return (0,
|
|
828
|
-
layout.value.label ? (0,
|
|
829
|
-
(0,
|
|
872
|
+
return (0, import_vue26.h)("div", { class: theme.layoutVertical }, [
|
|
873
|
+
layout.value.label ? (0, import_vue26.h)("div", { class: theme.labelSection }, layout.value.label) : null,
|
|
874
|
+
(0, import_vue26.h)(
|
|
830
875
|
"div",
|
|
831
876
|
{ class: theme.layoutVertical },
|
|
832
877
|
elements.map(
|
|
833
|
-
(element, index) => (0,
|
|
878
|
+
(element, index) => (0, import_vue26.h)(
|
|
834
879
|
"div",
|
|
835
880
|
{ key: `${layout.value.path}-${index}` },
|
|
836
|
-
(0,
|
|
881
|
+
(0, import_vue26.h)(import_vue25.DispatchRenderer, {
|
|
837
882
|
schema: layout.value.schema,
|
|
838
883
|
uischema: element,
|
|
839
884
|
path: layout.value.path,
|
|
@@ -851,15 +896,15 @@ function createNuxtUiCategoryRenderer(theme) {
|
|
|
851
896
|
}
|
|
852
897
|
|
|
853
898
|
// src/renderers/layouts/NuxtUiGroupRenderer.ts
|
|
854
|
-
var
|
|
855
|
-
var
|
|
899
|
+
var import_vue27 = require("@jsonforms/vue");
|
|
900
|
+
var import_vue28 = require("vue");
|
|
856
901
|
function createNuxtUiGroupRenderer(theme) {
|
|
857
|
-
return (0,
|
|
902
|
+
return (0, import_vue28.defineComponent)({
|
|
858
903
|
name: "NuxtUiGroupRenderer",
|
|
859
|
-
components: { DispatchRenderer:
|
|
860
|
-
props: (0,
|
|
904
|
+
components: { DispatchRenderer: import_vue27.DispatchRenderer },
|
|
905
|
+
props: (0, import_vue27.rendererProps)(),
|
|
861
906
|
setup(props) {
|
|
862
|
-
const { layout } = (0,
|
|
907
|
+
const { layout } = (0, import_vue27.useJsonFormsLayout)(
|
|
863
908
|
props
|
|
864
909
|
);
|
|
865
910
|
return () => {
|
|
@@ -867,19 +912,19 @@ function createNuxtUiGroupRenderer(theme) {
|
|
|
867
912
|
const elements = layout.value.uischema.elements ?? [];
|
|
868
913
|
const isNested = layout.value.path?.includes(".") ?? false;
|
|
869
914
|
const containerClass = isNested ? theme.groupNested : theme.panel;
|
|
870
|
-
return (0,
|
|
915
|
+
return (0, import_vue28.h)(
|
|
871
916
|
"div",
|
|
872
917
|
{ class: containerClass },
|
|
873
918
|
[
|
|
874
|
-
layout.value.label ? (0,
|
|
875
|
-
(0,
|
|
919
|
+
layout.value.label ? (0, import_vue28.h)("div", { class: theme.labelSectionSpaced }, layout.value.label) : null,
|
|
920
|
+
(0, import_vue28.h)(
|
|
876
921
|
"div",
|
|
877
922
|
{ class: theme.layoutVertical },
|
|
878
923
|
elements.map(
|
|
879
|
-
(element, index) => (0,
|
|
924
|
+
(element, index) => (0, import_vue28.h)(
|
|
880
925
|
"div",
|
|
881
926
|
{ key: `${layout.value.path}-${index}` },
|
|
882
|
-
(0,
|
|
927
|
+
(0, import_vue28.h)(import_vue27.DispatchRenderer, {
|
|
883
928
|
schema: layout.value.schema,
|
|
884
929
|
uischema: element,
|
|
885
930
|
path: layout.value.path,
|
|
@@ -898,31 +943,31 @@ function createNuxtUiGroupRenderer(theme) {
|
|
|
898
943
|
}
|
|
899
944
|
|
|
900
945
|
// src/renderers/layouts/NuxtUiHorizontalLayoutRenderer.ts
|
|
901
|
-
var
|
|
902
|
-
var
|
|
946
|
+
var import_vue29 = require("@jsonforms/vue");
|
|
947
|
+
var import_vue30 = require("vue");
|
|
903
948
|
function createNuxtUiHorizontalLayoutRenderer(theme) {
|
|
904
|
-
return (0,
|
|
949
|
+
return (0, import_vue30.defineComponent)({
|
|
905
950
|
name: "NuxtUiHorizontalLayoutRenderer",
|
|
906
|
-
components: { DispatchRenderer:
|
|
907
|
-
props: (0,
|
|
951
|
+
components: { DispatchRenderer: import_vue29.DispatchRenderer },
|
|
952
|
+
props: (0, import_vue29.rendererProps)(),
|
|
908
953
|
setup(props) {
|
|
909
|
-
const { layout } = (0,
|
|
954
|
+
const { layout } = (0, import_vue29.useJsonFormsLayout)(
|
|
910
955
|
props
|
|
911
956
|
);
|
|
912
957
|
return () => {
|
|
913
958
|
if (!layout.value.visible) return null;
|
|
914
959
|
const elements = layout.value.uischema.elements ?? [];
|
|
915
|
-
return (0,
|
|
960
|
+
return (0, import_vue30.h)(
|
|
916
961
|
"div",
|
|
917
962
|
{ class: theme.layoutHorizontal },
|
|
918
963
|
elements.map(
|
|
919
|
-
(element, index) => (0,
|
|
964
|
+
(element, index) => (0, import_vue30.h)(
|
|
920
965
|
"div",
|
|
921
966
|
{
|
|
922
967
|
key: `${layout.value.path}-${index}`,
|
|
923
968
|
class: theme.layoutHorizontalItem
|
|
924
969
|
},
|
|
925
|
-
(0,
|
|
970
|
+
(0, import_vue30.h)(import_vue29.DispatchRenderer, {
|
|
926
971
|
schema: layout.value.schema,
|
|
927
972
|
uischema: element,
|
|
928
973
|
path: layout.value.path,
|
|
@@ -939,47 +984,47 @@ function createNuxtUiHorizontalLayoutRenderer(theme) {
|
|
|
939
984
|
}
|
|
940
985
|
|
|
941
986
|
// src/renderers/layouts/NuxtUiLabelRenderer.ts
|
|
942
|
-
var
|
|
943
|
-
var
|
|
987
|
+
var import_vue31 = require("@jsonforms/vue");
|
|
988
|
+
var import_vue32 = require("vue");
|
|
944
989
|
function createNuxtUiLabelRenderer(theme) {
|
|
945
|
-
return (0,
|
|
990
|
+
return (0, import_vue32.defineComponent)({
|
|
946
991
|
name: "NuxtUiLabelRenderer",
|
|
947
|
-
props: (0,
|
|
992
|
+
props: (0, import_vue31.rendererProps)(),
|
|
948
993
|
setup(props) {
|
|
949
|
-
const { label } = (0,
|
|
994
|
+
const { label } = (0, import_vue31.useJsonFormsLabel)(
|
|
950
995
|
props
|
|
951
996
|
);
|
|
952
997
|
return () => {
|
|
953
998
|
if (!label.value.visible) return null;
|
|
954
|
-
return (0,
|
|
999
|
+
return (0, import_vue32.h)("div", { class: theme.textLabel }, label.value.text);
|
|
955
1000
|
};
|
|
956
1001
|
}
|
|
957
1002
|
});
|
|
958
1003
|
}
|
|
959
1004
|
|
|
960
1005
|
// src/renderers/layouts/NuxtUiVerticalLayoutRenderer.ts
|
|
961
|
-
var
|
|
962
|
-
var
|
|
1006
|
+
var import_vue33 = require("@jsonforms/vue");
|
|
1007
|
+
var import_vue34 = require("vue");
|
|
963
1008
|
function createNuxtUiVerticalLayoutRenderer(theme) {
|
|
964
|
-
return (0,
|
|
1009
|
+
return (0, import_vue34.defineComponent)({
|
|
965
1010
|
name: "NuxtUiVerticalLayoutRenderer",
|
|
966
|
-
components: { DispatchRenderer:
|
|
967
|
-
props: (0,
|
|
1011
|
+
components: { DispatchRenderer: import_vue33.DispatchRenderer },
|
|
1012
|
+
props: (0, import_vue33.rendererProps)(),
|
|
968
1013
|
setup(props) {
|
|
969
|
-
const { layout } = (0,
|
|
1014
|
+
const { layout } = (0, import_vue33.useJsonFormsLayout)(
|
|
970
1015
|
props
|
|
971
1016
|
);
|
|
972
1017
|
return () => {
|
|
973
1018
|
if (!layout.value.visible) return null;
|
|
974
1019
|
const elements = layout.value.uischema.elements ?? [];
|
|
975
|
-
return (0,
|
|
1020
|
+
return (0, import_vue34.h)(
|
|
976
1021
|
"div",
|
|
977
1022
|
{ class: theme.layoutVertical },
|
|
978
1023
|
elements.map(
|
|
979
|
-
(element, index) => (0,
|
|
1024
|
+
(element, index) => (0, import_vue34.h)(
|
|
980
1025
|
"div",
|
|
981
1026
|
{ key: `${layout.value.path}-${index}` },
|
|
982
|
-
(0,
|
|
1027
|
+
(0, import_vue34.h)(import_vue33.DispatchRenderer, {
|
|
983
1028
|
schema: layout.value.schema,
|
|
984
1029
|
uischema: element,
|
|
985
1030
|
path: layout.value.path,
|
|
@@ -1067,89 +1112,92 @@ var isOneOfEnumControl = (uischema, schema, context) => {
|
|
|
1067
1112
|
};
|
|
1068
1113
|
function createNuxtUiRenderers(options) {
|
|
1069
1114
|
const theme = mergeTheme(options?.theme);
|
|
1115
|
+
const docsUrl = options?.docsUrl;
|
|
1070
1116
|
return [
|
|
1071
1117
|
// Layouts
|
|
1072
1118
|
{
|
|
1073
1119
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.uiTypeIs)("VerticalLayout")),
|
|
1074
|
-
renderer: (0,
|
|
1120
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiVerticalLayoutRenderer(theme))
|
|
1075
1121
|
},
|
|
1076
1122
|
{
|
|
1077
1123
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.uiTypeIs)("HorizontalLayout")),
|
|
1078
|
-
renderer: (0,
|
|
1124
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiHorizontalLayoutRenderer(theme))
|
|
1079
1125
|
},
|
|
1080
1126
|
{
|
|
1081
1127
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.uiTypeIs)("Group")),
|
|
1082
|
-
renderer: (0,
|
|
1128
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiGroupRenderer(theme))
|
|
1083
1129
|
},
|
|
1084
1130
|
{
|
|
1085
1131
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.uiTypeIs)("Categorization")),
|
|
1086
|
-
renderer: (0,
|
|
1132
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiCategorizationRenderer(theme))
|
|
1087
1133
|
},
|
|
1088
1134
|
{
|
|
1089
1135
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.uiTypeIs)("Category")),
|
|
1090
|
-
renderer: (0,
|
|
1136
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiCategoryRenderer(theme))
|
|
1091
1137
|
},
|
|
1092
1138
|
{
|
|
1093
1139
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.uiTypeIs)("Label")),
|
|
1094
|
-
renderer: (0,
|
|
1140
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiLabelRenderer(theme))
|
|
1095
1141
|
},
|
|
1096
1142
|
// Complex schemas
|
|
1097
1143
|
{
|
|
1098
1144
|
tester: (0, import_core3.rankWith)(RANK, (0, import_core3.schemaTypeIs)("array")),
|
|
1099
|
-
renderer: (0,
|
|
1145
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiArrayListRenderer(theme))
|
|
1100
1146
|
},
|
|
1101
1147
|
{
|
|
1102
1148
|
tester: (0, import_core3.rankWith)(RANK, import_core3.isObjectControl),
|
|
1103
|
-
renderer: (0,
|
|
1149
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiObjectRenderer)
|
|
1104
1150
|
},
|
|
1105
1151
|
// Primitive controls
|
|
1106
1152
|
{
|
|
1107
1153
|
tester: (0, import_core3.rankWith)(RANK, import_core3.isMultiLineControl),
|
|
1108
|
-
renderer: (0,
|
|
1154
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiTextareaControl)
|
|
1109
1155
|
},
|
|
1110
1156
|
{
|
|
1111
1157
|
tester: (0, import_core3.rankWith)(RANK, import_core3.isNumberControl),
|
|
1112
|
-
renderer: (0,
|
|
1158
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiNumberControl)
|
|
1113
1159
|
},
|
|
1114
1160
|
{
|
|
1115
1161
|
tester: (0, import_core3.rankWith)(RANK, import_core3.isIntegerControl),
|
|
1116
|
-
renderer: (0,
|
|
1162
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiIntegerControl)
|
|
1117
1163
|
},
|
|
1118
1164
|
{
|
|
1119
1165
|
tester: (0, import_core3.rankWith)(RANK, import_core3.isBooleanControl),
|
|
1120
|
-
renderer: (0,
|
|
1166
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiBooleanControl(theme))
|
|
1121
1167
|
},
|
|
1122
1168
|
{
|
|
1123
1169
|
// Multi-enum must outrank generic array renderer and string renderer.
|
|
1124
1170
|
tester: (0, import_core3.rankWith)(ENUM_RANK, isMultiEnumControl),
|
|
1125
|
-
renderer: (0,
|
|
1171
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiMultiEnumControl)
|
|
1126
1172
|
},
|
|
1127
1173
|
{
|
|
1128
1174
|
// oneOf with const+title (display labels) - same as enum for rendering.
|
|
1129
1175
|
tester: (0, import_core3.rankWith)(ENUM_RANK, isOneOfEnumControl),
|
|
1130
|
-
renderer: (0,
|
|
1176
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiEnumControl)
|
|
1131
1177
|
},
|
|
1132
1178
|
{
|
|
1133
1179
|
// Enum must outrank the generic string control, otherwise enums render
|
|
1134
1180
|
// as freeform text inputs.
|
|
1135
1181
|
tester: (0, import_core3.rankWith)(ENUM_RANK, import_core3.isEnumControl),
|
|
1136
|
-
renderer: (0,
|
|
1182
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiEnumControl)
|
|
1137
1183
|
},
|
|
1138
1184
|
{
|
|
1139
1185
|
tester: (0, import_core3.rankWith)(PASSWORD_RANK, (0, import_core3.and)(import_core3.isStringControl, (0, import_core3.formatIs)("password"))),
|
|
1140
|
-
renderer: (0,
|
|
1186
|
+
renderer: (0, import_vue35.markRaw)(NuxtUiPasswordControl)
|
|
1141
1187
|
},
|
|
1142
1188
|
{
|
|
1143
1189
|
tester: (0, import_core3.rankWith)(RANK, import_core3.isStringControl),
|
|
1144
|
-
renderer: (0,
|
|
1190
|
+
renderer: (0, import_vue35.markRaw)(createNuxtUiStringControl(docsUrl))
|
|
1145
1191
|
}
|
|
1146
1192
|
];
|
|
1147
1193
|
}
|
|
1148
1194
|
var nuxtUiRenderers = createNuxtUiRenderers();
|
|
1149
1195
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1150
1196
|
0 && (module.exports = {
|
|
1197
|
+
controlDescription,
|
|
1151
1198
|
createNuxtUiRenderers,
|
|
1152
1199
|
defaultTheme,
|
|
1200
|
+
getDocsPathFromSchema,
|
|
1153
1201
|
mergeTheme,
|
|
1154
1202
|
nuxtUiRenderers
|
|
1155
1203
|
});
|