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