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