jsonforms-nuxt-ui-renderers 0.1.7 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/index.cjs +560 -497
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -1
- package/dist/index.d.ts +63 -1
- package/dist/index.js +556 -497
- package/dist/index.js.map +1 -1
- package/dist/styles.css +138 -0
- package/dist/styles.css.map +1 -0
- package/dist/styles.d.cts +2 -0
- package/dist/styles.d.ts +2 -0
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -34,199 +34,204 @@ function trimmedOrUndefined(input) {
|
|
|
34
34
|
const v = input?.trim();
|
|
35
35
|
return v ? v : void 0;
|
|
36
36
|
}
|
|
37
|
+
function controlDescription(control) {
|
|
38
|
+
const d = control.description?.trim();
|
|
39
|
+
if (d) return d;
|
|
40
|
+
const sd = control.schema?.description;
|
|
41
|
+
return typeof sd === "string" && sd.trim() ? sd.trim() : void 0;
|
|
42
|
+
}
|
|
37
43
|
|
|
38
44
|
// src/renderers/complex/NuxtUiArrayListRenderer.ts
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
function createNuxtUiArrayListRenderer(theme) {
|
|
46
|
+
return defineComponent({
|
|
47
|
+
name: "NuxtUiArrayListRenderer",
|
|
48
|
+
components: { DispatchRenderer },
|
|
49
|
+
props: rendererProps(),
|
|
50
|
+
setup(props) {
|
|
51
|
+
const { control, addItem, removeItems, moveUp, moveDown } = useJsonFormsArrayControl(
|
|
52
|
+
props
|
|
53
|
+
);
|
|
54
|
+
const errorMessage = computed2(() => trimmedOrUndefined(control.value.errors));
|
|
55
|
+
const items = computed2(
|
|
56
|
+
() => Array.isArray(control.value.data) ? control.value.data : []
|
|
57
|
+
);
|
|
58
|
+
const arraySchema = computed2(() => {
|
|
59
|
+
try {
|
|
60
|
+
return Resolve.schema(
|
|
61
|
+
props.schema,
|
|
62
|
+
control.value.uischema.scope,
|
|
63
|
+
control.value.rootSchema
|
|
64
|
+
);
|
|
65
|
+
} catch {
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const maxItemsReached = computed2(() => {
|
|
70
|
+
const max = arraySchema.value?.maxItems;
|
|
71
|
+
return typeof max === "number" ? items.value.length >= max : false;
|
|
72
|
+
});
|
|
73
|
+
const minItemsReached = computed2(() => {
|
|
74
|
+
const min = arraySchema.value?.minItems;
|
|
75
|
+
return typeof min === "number" ? items.value.length <= min : false;
|
|
76
|
+
});
|
|
77
|
+
const childUiSchema = computed2(
|
|
78
|
+
() => findUISchema(
|
|
79
|
+
control.value.uischemas,
|
|
80
|
+
control.value.schema,
|
|
55
81
|
control.value.uischema.scope,
|
|
82
|
+
control.value.path,
|
|
83
|
+
void 0,
|
|
84
|
+
control.value.uischema,
|
|
56
85
|
control.value.rootSchema
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
function childLabelForIndex(index) {
|
|
89
|
+
const childLabelProp = getChildLabelPropFromUiSchemaOptions(control.value.uischema.options) ?? getFirstPrimitiveProp(control.value.schema);
|
|
90
|
+
if (!childLabelProp) return `${index}`;
|
|
91
|
+
const labelValue = Resolve.data(
|
|
92
|
+
control.value.data,
|
|
93
|
+
composePaths(`${index}`, childLabelProp)
|
|
57
94
|
);
|
|
58
|
-
|
|
59
|
-
|
|
95
|
+
if (labelValue === void 0 || labelValue === null || Number.isNaN(labelValue)) {
|
|
96
|
+
return "";
|
|
97
|
+
}
|
|
98
|
+
return String(labelValue);
|
|
60
99
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
const minItemsReached = computed2(() => {
|
|
67
|
-
const min = arraySchema.value?.minItems;
|
|
68
|
-
return typeof min === "number" ? items.value.length <= min : false;
|
|
69
|
-
});
|
|
70
|
-
const childUiSchema = computed2(
|
|
71
|
-
() => findUISchema(
|
|
72
|
-
control.value.uischemas,
|
|
73
|
-
control.value.schema,
|
|
74
|
-
control.value.uischema.scope,
|
|
75
|
-
control.value.path,
|
|
76
|
-
void 0,
|
|
77
|
-
control.value.uischema,
|
|
78
|
-
control.value.rootSchema
|
|
79
|
-
)
|
|
80
|
-
);
|
|
81
|
-
function childLabelForIndex(index) {
|
|
82
|
-
const childLabelProp = getChildLabelPropFromUiSchemaOptions(control.value.uischema.options) ?? getFirstPrimitiveProp(control.value.schema);
|
|
83
|
-
if (!childLabelProp) return `${index}`;
|
|
84
|
-
const labelValue = Resolve.data(
|
|
85
|
-
control.value.data,
|
|
86
|
-
composePaths(`${index}`, childLabelProp)
|
|
87
|
-
);
|
|
88
|
-
if (labelValue === void 0 || labelValue === null || Number.isNaN(labelValue)) {
|
|
89
|
-
return "";
|
|
100
|
+
function getChildLabelPropFromUiSchemaOptions(options) {
|
|
101
|
+
if (!options || typeof options !== "object") return void 0;
|
|
102
|
+
const value = options.childLabelProp;
|
|
103
|
+
return typeof value === "string" ? value : void 0;
|
|
90
104
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
h(DispatchRenderer, {
|
|
213
|
-
schema: control.value.schema,
|
|
214
|
-
uischema: childUiSchema.value,
|
|
215
|
-
path: composePaths(control.value.path, `${index}`),
|
|
216
|
-
enabled: control.value.enabled,
|
|
217
|
-
renderers: control.value.renderers,
|
|
218
|
-
cells: control.value.cells
|
|
219
|
-
})
|
|
220
|
-
]
|
|
105
|
+
function addButtonClick() {
|
|
106
|
+
addItem(
|
|
107
|
+
control.value.path,
|
|
108
|
+
createDefaultValue(control.value.schema, control.value.rootSchema)
|
|
109
|
+
)();
|
|
110
|
+
}
|
|
111
|
+
return () => {
|
|
112
|
+
if (!control.value.visible) return null;
|
|
113
|
+
const UFormField = resolveComponent("UFormField");
|
|
114
|
+
const UButton = resolveComponent("UButton");
|
|
115
|
+
return h(
|
|
116
|
+
"div",
|
|
117
|
+
{},
|
|
118
|
+
h(
|
|
119
|
+
UFormField,
|
|
120
|
+
{
|
|
121
|
+
label: control.value.label,
|
|
122
|
+
description: control.value.description,
|
|
123
|
+
required: control.value.required,
|
|
124
|
+
error: errorMessage.value
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
default: () => h("div", { class: theme.layoutVertical }, [
|
|
128
|
+
h("div", { class: theme.flexBetween }, [
|
|
129
|
+
h(
|
|
130
|
+
"div",
|
|
131
|
+
{ class: theme.textMutedXs },
|
|
132
|
+
`${items.value.length} items`
|
|
133
|
+
),
|
|
134
|
+
h(
|
|
135
|
+
UButton,
|
|
136
|
+
{
|
|
137
|
+
type: "button",
|
|
138
|
+
size: "xs",
|
|
139
|
+
variant: "soft",
|
|
140
|
+
color: "neutral",
|
|
141
|
+
disabled: !control.value.enabled || maxItemsReached.value,
|
|
142
|
+
onClick: addButtonClick
|
|
143
|
+
},
|
|
144
|
+
{ default: () => "Add" }
|
|
145
|
+
)
|
|
146
|
+
]),
|
|
147
|
+
items.value.length === 0 ? h("div", { class: theme.textMuted }, "No items.") : null,
|
|
148
|
+
...items.value.map(
|
|
149
|
+
(_item, index) => h(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
key: `${control.value.path}-${index}`,
|
|
153
|
+
class: theme.panel
|
|
154
|
+
},
|
|
155
|
+
[
|
|
156
|
+
h(
|
|
157
|
+
"div",
|
|
158
|
+
{ class: theme.arrayItemToolbar },
|
|
159
|
+
[
|
|
160
|
+
h("div", { class: "jf-min-w-0" }, [
|
|
161
|
+
h(
|
|
162
|
+
"div",
|
|
163
|
+
{ class: theme.textItemTitle },
|
|
164
|
+
[
|
|
165
|
+
`Item ${index + 1}`,
|
|
166
|
+
childLabelForIndex(index) ? h(
|
|
167
|
+
"span",
|
|
168
|
+
{ class: theme.textItemSuffix },
|
|
169
|
+
` \u2014 ${childLabelForIndex(index)}`
|
|
170
|
+
) : null
|
|
171
|
+
]
|
|
172
|
+
)
|
|
173
|
+
]),
|
|
174
|
+
h("div", { class: theme.flexActions }, [
|
|
175
|
+
h(
|
|
176
|
+
UButton,
|
|
177
|
+
{
|
|
178
|
+
type: "button",
|
|
179
|
+
size: "xs",
|
|
180
|
+
variant: "ghost",
|
|
181
|
+
color: "neutral",
|
|
182
|
+
disabled: !control.value.enabled || index === 0,
|
|
183
|
+
onClick: () => moveUp?.(control.value.path, index)()
|
|
184
|
+
},
|
|
185
|
+
{ default: () => "Up" }
|
|
186
|
+
),
|
|
187
|
+
h(
|
|
188
|
+
UButton,
|
|
189
|
+
{
|
|
190
|
+
type: "button",
|
|
191
|
+
size: "xs",
|
|
192
|
+
variant: "ghost",
|
|
193
|
+
color: "neutral",
|
|
194
|
+
disabled: !control.value.enabled || index >= items.value.length - 1,
|
|
195
|
+
onClick: () => moveDown?.(control.value.path, index)()
|
|
196
|
+
},
|
|
197
|
+
{ default: () => "Down" }
|
|
198
|
+
),
|
|
199
|
+
h(
|
|
200
|
+
UButton,
|
|
201
|
+
{
|
|
202
|
+
type: "button",
|
|
203
|
+
size: "xs",
|
|
204
|
+
variant: "ghost",
|
|
205
|
+
color: "error",
|
|
206
|
+
disabled: !control.value.enabled || minItemsReached.value,
|
|
207
|
+
onClick: () => removeItems?.(control.value.path, [
|
|
208
|
+
index
|
|
209
|
+
])()
|
|
210
|
+
},
|
|
211
|
+
{ default: () => "Remove" }
|
|
212
|
+
)
|
|
213
|
+
])
|
|
214
|
+
]
|
|
215
|
+
),
|
|
216
|
+
h(DispatchRenderer, {
|
|
217
|
+
schema: control.value.schema,
|
|
218
|
+
uischema: childUiSchema.value,
|
|
219
|
+
path: composePaths(control.value.path, `${index}`),
|
|
220
|
+
enabled: control.value.enabled,
|
|
221
|
+
renderers: control.value.renderers,
|
|
222
|
+
cells: control.value.cells
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
)
|
|
221
226
|
)
|
|
222
|
-
)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
227
|
+
])
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
230
235
|
|
|
231
236
|
// src/renderers/complex/NuxtUiObjectRenderer.ts
|
|
232
237
|
import { Generate, findUISchema as findUISchema2 } from "@jsonforms/core";
|
|
@@ -288,52 +293,54 @@ var NuxtUiObjectRenderer = defineComponent2({
|
|
|
288
293
|
// src/renderers/controls/NuxtUiBooleanControl.ts
|
|
289
294
|
import { rendererProps as rendererProps3, useJsonFormsControl } from "@jsonforms/vue";
|
|
290
295
|
import { computed as computed4, defineComponent as defineComponent3, h as h3, resolveComponent as resolveComponent2 } from "vue";
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
const errorMessage = computed4(() => trimmedOrUndefined(control.value.errors));
|
|
299
|
-
const modelValue = computed4({
|
|
300
|
-
get: () => Boolean(control.value.data),
|
|
301
|
-
set: (v) => handleChange(control.value.path, v)
|
|
302
|
-
});
|
|
303
|
-
return () => {
|
|
304
|
-
if (!control.value.visible) return null;
|
|
305
|
-
const UFormField = resolveComponent2("UFormField");
|
|
306
|
-
const USwitch = resolveComponent2("USwitch");
|
|
307
|
-
return h3(
|
|
308
|
-
"div",
|
|
309
|
-
{},
|
|
310
|
-
h3(
|
|
311
|
-
UFormField,
|
|
312
|
-
{
|
|
313
|
-
label: control.value.label,
|
|
314
|
-
description: control.value.description,
|
|
315
|
-
required: control.value.required,
|
|
316
|
-
error: errorMessage.value
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
default: () => h3(
|
|
320
|
-
"div",
|
|
321
|
-
{ class: "flex items-center justify-between gap-3" },
|
|
322
|
-
h3(USwitch, {
|
|
323
|
-
modelValue: modelValue.value,
|
|
324
|
-
disabled: !control.value.enabled,
|
|
325
|
-
"aria-invalid": Boolean(errorMessage.value),
|
|
326
|
-
"onUpdate:modelValue": (v) => {
|
|
327
|
-
modelValue.value = v;
|
|
328
|
-
}
|
|
329
|
-
})
|
|
330
|
-
)
|
|
331
|
-
}
|
|
332
|
-
)
|
|
296
|
+
function createNuxtUiBooleanControl(theme) {
|
|
297
|
+
return defineComponent3({
|
|
298
|
+
name: "NuxtUiBooleanControl",
|
|
299
|
+
props: rendererProps3(),
|
|
300
|
+
setup(props) {
|
|
301
|
+
const { control, handleChange } = useJsonFormsControl(
|
|
302
|
+
props
|
|
333
303
|
);
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
304
|
+
const errorMessage = computed4(() => trimmedOrUndefined(control.value.errors));
|
|
305
|
+
const modelValue = computed4({
|
|
306
|
+
get: () => Boolean(control.value.data),
|
|
307
|
+
set: (v) => handleChange(control.value.path, v)
|
|
308
|
+
});
|
|
309
|
+
return () => {
|
|
310
|
+
if (!control.value.visible) return null;
|
|
311
|
+
const UFormField = resolveComponent2("UFormField");
|
|
312
|
+
const USwitch = resolveComponent2("USwitch");
|
|
313
|
+
return h3(
|
|
314
|
+
"div",
|
|
315
|
+
{},
|
|
316
|
+
h3(
|
|
317
|
+
UFormField,
|
|
318
|
+
{
|
|
319
|
+
label: control.value.label,
|
|
320
|
+
description: controlDescription(control.value),
|
|
321
|
+
required: control.value.required,
|
|
322
|
+
error: errorMessage.value
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
default: () => h3(
|
|
326
|
+
"div",
|
|
327
|
+
{ class: theme.flexBetween },
|
|
328
|
+
h3(USwitch, {
|
|
329
|
+
modelValue: modelValue.value,
|
|
330
|
+
disabled: !control.value.enabled,
|
|
331
|
+
"aria-invalid": Boolean(errorMessage.value),
|
|
332
|
+
"onUpdate:modelValue": (v) => {
|
|
333
|
+
modelValue.value = v;
|
|
334
|
+
}
|
|
335
|
+
})
|
|
336
|
+
)
|
|
337
|
+
}
|
|
338
|
+
)
|
|
339
|
+
);
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}
|
|
337
344
|
|
|
338
345
|
// src/renderers/controls/NuxtUiEnumControl.ts
|
|
339
346
|
import { rendererProps as rendererProps4, useJsonFormsControl as useJsonFormsControl2 } from "@jsonforms/vue";
|
|
@@ -381,7 +388,7 @@ var NuxtUiEnumControl = defineComponent4({
|
|
|
381
388
|
UFormField,
|
|
382
389
|
{
|
|
383
390
|
label: control.value.label,
|
|
384
|
-
description: control.value
|
|
391
|
+
description: controlDescription(control.value),
|
|
385
392
|
required: control.value.required,
|
|
386
393
|
error: errorMessage.value
|
|
387
394
|
},
|
|
@@ -441,7 +448,7 @@ var NuxtUiIntegerControl = defineComponent5({
|
|
|
441
448
|
UFormField,
|
|
442
449
|
{
|
|
443
450
|
label: control.value.label,
|
|
444
|
-
description: control.value
|
|
451
|
+
description: controlDescription(control.value),
|
|
445
452
|
required: control.value.required,
|
|
446
453
|
error: errorMessage.value
|
|
447
454
|
},
|
|
@@ -517,7 +524,7 @@ var NuxtUiMultiEnumControl = defineComponent6({
|
|
|
517
524
|
UFormField,
|
|
518
525
|
{
|
|
519
526
|
label: control.value.label,
|
|
520
|
-
description: control.value
|
|
527
|
+
description: controlDescription(control.value),
|
|
521
528
|
required: control.value.required,
|
|
522
529
|
error: errorMessage.value
|
|
523
530
|
},
|
|
@@ -578,7 +585,7 @@ var NuxtUiNumberControl = defineComponent7({
|
|
|
578
585
|
UFormField,
|
|
579
586
|
{
|
|
580
587
|
label: control.value.label,
|
|
581
|
-
description: control.value
|
|
588
|
+
description: controlDescription(control.value),
|
|
582
589
|
required: control.value.required,
|
|
583
590
|
error: errorMessage.value
|
|
584
591
|
},
|
|
@@ -624,7 +631,7 @@ var NuxtUiPasswordControl = defineComponent8({
|
|
|
624
631
|
UFormField,
|
|
625
632
|
{
|
|
626
633
|
label: control.value.label,
|
|
627
|
-
description: control.value
|
|
634
|
+
description: controlDescription(control.value),
|
|
628
635
|
required: control.value.required,
|
|
629
636
|
error: errorMessage.value
|
|
630
637
|
},
|
|
@@ -691,7 +698,7 @@ var NuxtUiStringControl = defineComponent9({
|
|
|
691
698
|
UFormField,
|
|
692
699
|
{
|
|
693
700
|
label: control.value.label,
|
|
694
|
-
description: control.value
|
|
701
|
+
description: controlDescription(control.value),
|
|
695
702
|
required: control.value.required,
|
|
696
703
|
error: errorMessage.value
|
|
697
704
|
},
|
|
@@ -733,7 +740,7 @@ var NuxtUiTextareaControl = defineComponent10({
|
|
|
733
740
|
UFormField,
|
|
734
741
|
{
|
|
735
742
|
label: control.value.label,
|
|
736
|
-
description: control.value
|
|
743
|
+
description: controlDescription(control.value),
|
|
737
744
|
required: control.value.required,
|
|
738
745
|
error: errorMessage.value
|
|
739
746
|
},
|
|
@@ -757,116 +764,172 @@ var NuxtUiTextareaControl = defineComponent10({
|
|
|
757
764
|
// src/renderers/layouts/NuxtUiCategorizationRenderer.ts
|
|
758
765
|
import { DispatchRenderer as DispatchRenderer3, rendererProps as rendererProps11, useJsonFormsCategorization } from "@jsonforms/vue";
|
|
759
766
|
import { defineComponent as defineComponent11, h as h11 } from "vue";
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
767
|
+
function createNuxtUiCategorizationRenderer(theme) {
|
|
768
|
+
return defineComponent11({
|
|
769
|
+
name: "NuxtUiCategorizationRenderer",
|
|
770
|
+
components: { DispatchRenderer: DispatchRenderer3 },
|
|
771
|
+
props: rendererProps11(),
|
|
772
|
+
setup(props) {
|
|
773
|
+
const { layout, categories } = useJsonFormsCategorization(
|
|
774
|
+
props
|
|
775
|
+
);
|
|
776
|
+
return () => {
|
|
777
|
+
if (!layout.value.visible) return null;
|
|
778
|
+
return h11(
|
|
779
|
+
"div",
|
|
780
|
+
{ class: theme.layoutVerticalWide },
|
|
781
|
+
categories.map((categoryRef, catIndex) => {
|
|
782
|
+
const category = categoryRef.value;
|
|
783
|
+
const elements = category.uischema.elements ?? [];
|
|
784
|
+
return h11(
|
|
785
|
+
"div",
|
|
786
|
+
{
|
|
787
|
+
key: `${layout.value.path}-cat-${catIndex}`,
|
|
788
|
+
class: theme.layoutVertical
|
|
789
|
+
},
|
|
790
|
+
[
|
|
791
|
+
category.label ? h11("div", { class: theme.labelSection }, category.label) : null,
|
|
792
|
+
h11(
|
|
793
|
+
"div",
|
|
794
|
+
{ class: theme.layoutVertical },
|
|
795
|
+
elements.map(
|
|
796
|
+
(element, index) => h11(
|
|
797
|
+
"div",
|
|
798
|
+
{ key: `${category.path}-${index}` },
|
|
799
|
+
h11(DispatchRenderer3, {
|
|
800
|
+
schema: category.schema,
|
|
801
|
+
uischema: element,
|
|
802
|
+
path: category.path,
|
|
803
|
+
enabled: category.enabled,
|
|
804
|
+
renderers: category.renderers,
|
|
805
|
+
cells: category.cells
|
|
806
|
+
})
|
|
807
|
+
)
|
|
796
808
|
)
|
|
797
809
|
)
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
)
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}
|
|
810
|
+
]
|
|
811
|
+
);
|
|
812
|
+
})
|
|
813
|
+
);
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
}
|
|
806
818
|
|
|
807
819
|
// src/renderers/layouts/NuxtUiCategoryRenderer.ts
|
|
808
820
|
import { DispatchRenderer as DispatchRenderer4, rendererProps as rendererProps12, useJsonFormsLayout } from "@jsonforms/vue";
|
|
809
821
|
import { defineComponent as defineComponent12, h as h12 } from "vue";
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
822
|
+
function createNuxtUiCategoryRenderer(theme) {
|
|
823
|
+
return defineComponent12({
|
|
824
|
+
name: "NuxtUiCategoryRenderer",
|
|
825
|
+
components: { DispatchRenderer: DispatchRenderer4 },
|
|
826
|
+
props: rendererProps12(),
|
|
827
|
+
setup(props) {
|
|
828
|
+
const { layout } = useJsonFormsLayout(
|
|
829
|
+
props
|
|
830
|
+
);
|
|
831
|
+
return () => {
|
|
832
|
+
if (!layout.value.visible) return null;
|
|
833
|
+
const elements = layout.value.uischema.elements ?? [];
|
|
834
|
+
return h12("div", { class: theme.layoutVertical }, [
|
|
835
|
+
layout.value.label ? h12("div", { class: theme.labelSection }, layout.value.label) : null,
|
|
836
|
+
h12(
|
|
837
|
+
"div",
|
|
838
|
+
{ class: theme.layoutVertical },
|
|
839
|
+
elements.map(
|
|
840
|
+
(element, index) => h12(
|
|
841
|
+
"div",
|
|
842
|
+
{ key: `${layout.value.path}-${index}` },
|
|
843
|
+
h12(DispatchRenderer4, {
|
|
844
|
+
schema: layout.value.schema,
|
|
845
|
+
uischema: element,
|
|
846
|
+
path: layout.value.path,
|
|
847
|
+
enabled: layout.value.enabled,
|
|
848
|
+
renderers: layout.value.renderers,
|
|
849
|
+
cells: layout.value.cells
|
|
850
|
+
})
|
|
851
|
+
)
|
|
838
852
|
)
|
|
839
853
|
)
|
|
840
|
-
)
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
}
|
|
854
|
+
]);
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
845
859
|
|
|
846
860
|
// src/renderers/layouts/NuxtUiGroupRenderer.ts
|
|
847
861
|
import { DispatchRenderer as DispatchRenderer5, rendererProps as rendererProps13, useJsonFormsLayout as useJsonFormsLayout2 } from "@jsonforms/vue";
|
|
848
862
|
import { defineComponent as defineComponent13, h as h13 } from "vue";
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
layout.value.
|
|
862
|
-
|
|
863
|
+
function createNuxtUiGroupRenderer(theme) {
|
|
864
|
+
return defineComponent13({
|
|
865
|
+
name: "NuxtUiGroupRenderer",
|
|
866
|
+
components: { DispatchRenderer: DispatchRenderer5 },
|
|
867
|
+
props: rendererProps13(),
|
|
868
|
+
setup(props) {
|
|
869
|
+
const { layout } = useJsonFormsLayout2(
|
|
870
|
+
props
|
|
871
|
+
);
|
|
872
|
+
return () => {
|
|
873
|
+
if (!layout.value.visible) return null;
|
|
874
|
+
const elements = layout.value.uischema.elements ?? [];
|
|
875
|
+
const isNested = layout.value.path?.includes(".") ?? false;
|
|
876
|
+
const containerClass = isNested ? theme.groupNested : theme.panel;
|
|
877
|
+
return h13(
|
|
863
878
|
"div",
|
|
864
|
-
{ class:
|
|
879
|
+
{ class: containerClass },
|
|
880
|
+
[
|
|
881
|
+
layout.value.label ? h13("div", { class: theme.labelSectionSpaced }, layout.value.label) : null,
|
|
882
|
+
h13(
|
|
883
|
+
"div",
|
|
884
|
+
{ class: theme.layoutVertical },
|
|
885
|
+
elements.map(
|
|
886
|
+
(element, index) => h13(
|
|
887
|
+
"div",
|
|
888
|
+
{ key: `${layout.value.path}-${index}` },
|
|
889
|
+
h13(DispatchRenderer5, {
|
|
890
|
+
schema: layout.value.schema,
|
|
891
|
+
uischema: element,
|
|
892
|
+
path: layout.value.path,
|
|
893
|
+
enabled: layout.value.enabled,
|
|
894
|
+
renderers: layout.value.renderers,
|
|
895
|
+
cells: layout.value.cells
|
|
896
|
+
})
|
|
897
|
+
)
|
|
898
|
+
)
|
|
899
|
+
)
|
|
900
|
+
]
|
|
901
|
+
);
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// src/renderers/layouts/NuxtUiHorizontalLayoutRenderer.ts
|
|
908
|
+
import { DispatchRenderer as DispatchRenderer6, rendererProps as rendererProps14, useJsonFormsLayout as useJsonFormsLayout3 } from "@jsonforms/vue";
|
|
909
|
+
import { defineComponent as defineComponent14, h as h14 } from "vue";
|
|
910
|
+
function createNuxtUiHorizontalLayoutRenderer(theme) {
|
|
911
|
+
return defineComponent14({
|
|
912
|
+
name: "NuxtUiHorizontalLayoutRenderer",
|
|
913
|
+
components: { DispatchRenderer: DispatchRenderer6 },
|
|
914
|
+
props: rendererProps14(),
|
|
915
|
+
setup(props) {
|
|
916
|
+
const { layout } = useJsonFormsLayout3(
|
|
917
|
+
props
|
|
918
|
+
);
|
|
919
|
+
return () => {
|
|
920
|
+
if (!layout.value.visible) return null;
|
|
921
|
+
const elements = layout.value.uischema.elements ?? [];
|
|
922
|
+
return h14(
|
|
923
|
+
"div",
|
|
924
|
+
{ class: theme.layoutHorizontal },
|
|
865
925
|
elements.map(
|
|
866
|
-
(element, index) =>
|
|
926
|
+
(element, index) => h14(
|
|
867
927
|
"div",
|
|
868
|
-
{
|
|
869
|
-
|
|
928
|
+
{
|
|
929
|
+
key: `${layout.value.path}-${index}`,
|
|
930
|
+
class: theme.layoutHorizontalItem
|
|
931
|
+
},
|
|
932
|
+
h14(DispatchRenderer6, {
|
|
870
933
|
schema: layout.value.schema,
|
|
871
934
|
uischema: element,
|
|
872
935
|
path: layout.value.path,
|
|
@@ -876,104 +939,92 @@ var NuxtUiGroupRenderer = defineComponent13({
|
|
|
876
939
|
})
|
|
877
940
|
)
|
|
878
941
|
)
|
|
879
|
-
)
|
|
880
|
-
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
// src/renderers/layouts/NuxtUiHorizontalLayoutRenderer.ts
|
|
886
|
-
import { DispatchRenderer as DispatchRenderer6, rendererProps as rendererProps14, useJsonFormsLayout as useJsonFormsLayout3 } from "@jsonforms/vue";
|
|
887
|
-
import { defineComponent as defineComponent14, h as h14 } from "vue";
|
|
888
|
-
var NuxtUiHorizontalLayoutRenderer = defineComponent14({
|
|
889
|
-
name: "NuxtUiHorizontalLayoutRenderer",
|
|
890
|
-
components: { DispatchRenderer: DispatchRenderer6 },
|
|
891
|
-
props: rendererProps14(),
|
|
892
|
-
setup(props) {
|
|
893
|
-
const { layout } = useJsonFormsLayout3(
|
|
894
|
-
props
|
|
895
|
-
);
|
|
896
|
-
return () => {
|
|
897
|
-
if (!layout.value.visible) return null;
|
|
898
|
-
const elements = layout.value.uischema.elements ?? [];
|
|
899
|
-
return h14(
|
|
900
|
-
"div",
|
|
901
|
-
{ class: "flex flex-col gap-3 md:flex-row md:flex-wrap" },
|
|
902
|
-
elements.map(
|
|
903
|
-
(element, index) => h14(
|
|
904
|
-
"div",
|
|
905
|
-
{ key: `${layout.value.path}-${index}`, class: "min-w-0 flex-1" },
|
|
906
|
-
h14(DispatchRenderer6, {
|
|
907
|
-
schema: layout.value.schema,
|
|
908
|
-
uischema: element,
|
|
909
|
-
path: layout.value.path,
|
|
910
|
-
enabled: layout.value.enabled,
|
|
911
|
-
renderers: layout.value.renderers,
|
|
912
|
-
cells: layout.value.cells
|
|
913
|
-
})
|
|
914
|
-
)
|
|
915
|
-
)
|
|
916
|
-
);
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
});
|
|
942
|
+
);
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
}
|
|
920
947
|
|
|
921
948
|
// src/renderers/layouts/NuxtUiLabelRenderer.ts
|
|
922
949
|
import { rendererProps as rendererProps15, useJsonFormsLabel } from "@jsonforms/vue";
|
|
923
950
|
import { defineComponent as defineComponent15, h as h15 } from "vue";
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
return () => {
|
|
932
|
-
if (!label.value.visible) return null;
|
|
933
|
-
return h15(
|
|
934
|
-
"div",
|
|
935
|
-
{ class: "text-sm text-gray-600 dark:text-gray-300" },
|
|
936
|
-
label.value.text
|
|
951
|
+
function createNuxtUiLabelRenderer(theme) {
|
|
952
|
+
return defineComponent15({
|
|
953
|
+
name: "NuxtUiLabelRenderer",
|
|
954
|
+
props: rendererProps15(),
|
|
955
|
+
setup(props) {
|
|
956
|
+
const { label } = useJsonFormsLabel(
|
|
957
|
+
props
|
|
937
958
|
);
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
});
|
|
959
|
+
return () => {
|
|
960
|
+
if (!label.value.visible) return null;
|
|
961
|
+
return h15("div", { class: theme.textLabel }, label.value.text);
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
}
|
|
941
966
|
|
|
942
967
|
// src/renderers/layouts/NuxtUiVerticalLayoutRenderer.ts
|
|
943
968
|
import { DispatchRenderer as DispatchRenderer7, rendererProps as rendererProps16, useJsonFormsLayout as useJsonFormsLayout4 } from "@jsonforms/vue";
|
|
944
969
|
import { defineComponent as defineComponent16, h as h16 } from "vue";
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
return () => {
|
|
954
|
-
if (!layout.value.visible) return null;
|
|
955
|
-
const elements = layout.value.uischema.elements ?? [];
|
|
956
|
-
return h16(
|
|
957
|
-
"div",
|
|
958
|
-
{ class: "flex flex-col gap-3" },
|
|
959
|
-
elements.map(
|
|
960
|
-
(element, index) => h16(
|
|
961
|
-
"div",
|
|
962
|
-
{ key: `${layout.value.path}-${index}` },
|
|
963
|
-
h16(DispatchRenderer7, {
|
|
964
|
-
schema: layout.value.schema,
|
|
965
|
-
uischema: element,
|
|
966
|
-
path: layout.value.path,
|
|
967
|
-
enabled: layout.value.enabled,
|
|
968
|
-
renderers: layout.value.renderers,
|
|
969
|
-
cells: layout.value.cells
|
|
970
|
-
})
|
|
971
|
-
)
|
|
972
|
-
)
|
|
970
|
+
function createNuxtUiVerticalLayoutRenderer(theme) {
|
|
971
|
+
return defineComponent16({
|
|
972
|
+
name: "NuxtUiVerticalLayoutRenderer",
|
|
973
|
+
components: { DispatchRenderer: DispatchRenderer7 },
|
|
974
|
+
props: rendererProps16(),
|
|
975
|
+
setup(props) {
|
|
976
|
+
const { layout } = useJsonFormsLayout4(
|
|
977
|
+
props
|
|
973
978
|
);
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
979
|
+
return () => {
|
|
980
|
+
if (!layout.value.visible) return null;
|
|
981
|
+
const elements = layout.value.uischema.elements ?? [];
|
|
982
|
+
return h16(
|
|
983
|
+
"div",
|
|
984
|
+
{ class: theme.layoutVertical },
|
|
985
|
+
elements.map(
|
|
986
|
+
(element, index) => h16(
|
|
987
|
+
"div",
|
|
988
|
+
{ key: `${layout.value.path}-${index}` },
|
|
989
|
+
h16(DispatchRenderer7, {
|
|
990
|
+
schema: layout.value.schema,
|
|
991
|
+
uischema: element,
|
|
992
|
+
path: layout.value.path,
|
|
993
|
+
enabled: layout.value.enabled,
|
|
994
|
+
renderers: layout.value.renderers,
|
|
995
|
+
cells: layout.value.cells
|
|
996
|
+
})
|
|
997
|
+
)
|
|
998
|
+
)
|
|
999
|
+
);
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
// src/renderers/theme.ts
|
|
1006
|
+
var defaultTheme = {
|
|
1007
|
+
panel: "jf-panel",
|
|
1008
|
+
groupNested: "jf-group",
|
|
1009
|
+
layoutVertical: "jf-layout-vertical",
|
|
1010
|
+
layoutVerticalWide: "jf-layout-vertical-wide",
|
|
1011
|
+
layoutHorizontal: "jf-layout-horizontal",
|
|
1012
|
+
layoutHorizontalItem: "jf-layout-horizontal-item",
|
|
1013
|
+
arrayItemToolbar: "jf-array-item-toolbar",
|
|
1014
|
+
labelSection: "jf-label-section",
|
|
1015
|
+
labelSectionSpaced: "jf-label-section-spaced",
|
|
1016
|
+
textMuted: "jf-text-muted",
|
|
1017
|
+
textMutedXs: "jf-text-muted-xs",
|
|
1018
|
+
textItemTitle: "jf-text-item-title",
|
|
1019
|
+
textItemSuffix: "jf-text-item-suffix",
|
|
1020
|
+
textLabel: "jf-text-label",
|
|
1021
|
+
flexBetween: "jf-flex-between",
|
|
1022
|
+
flexBetweenStart: "jf-flex-between-start",
|
|
1023
|
+
flexActions: "jf-flex-actions"
|
|
1024
|
+
};
|
|
1025
|
+
function mergeTheme(overrides) {
|
|
1026
|
+
return overrides ? { ...defaultTheme, ...overrides } : { ...defaultTheme };
|
|
1027
|
+
}
|
|
977
1028
|
|
|
978
1029
|
// src/nuxtUiRenderers.ts
|
|
979
1030
|
var RANK = 10;
|
|
@@ -1021,84 +1072,92 @@ var isOneOfEnumControl = (uischema, schema, context) => {
|
|
|
1021
1072
|
}
|
|
1022
1073
|
return true;
|
|
1023
1074
|
};
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1075
|
+
function createNuxtUiRenderers(options) {
|
|
1076
|
+
const theme = mergeTheme(options?.theme);
|
|
1077
|
+
return [
|
|
1078
|
+
// Layouts
|
|
1079
|
+
{
|
|
1080
|
+
tester: rankWith(RANK, uiTypeIs("VerticalLayout")),
|
|
1081
|
+
renderer: markRaw(createNuxtUiVerticalLayoutRenderer(theme))
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
tester: rankWith(RANK, uiTypeIs("HorizontalLayout")),
|
|
1085
|
+
renderer: markRaw(createNuxtUiHorizontalLayoutRenderer(theme))
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
tester: rankWith(RANK, uiTypeIs("Group")),
|
|
1089
|
+
renderer: markRaw(createNuxtUiGroupRenderer(theme))
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
tester: rankWith(RANK, uiTypeIs("Categorization")),
|
|
1093
|
+
renderer: markRaw(createNuxtUiCategorizationRenderer(theme))
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
tester: rankWith(RANK, uiTypeIs("Category")),
|
|
1097
|
+
renderer: markRaw(createNuxtUiCategoryRenderer(theme))
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
tester: rankWith(RANK, uiTypeIs("Label")),
|
|
1101
|
+
renderer: markRaw(createNuxtUiLabelRenderer(theme))
|
|
1102
|
+
},
|
|
1103
|
+
// Complex schemas
|
|
1104
|
+
{
|
|
1105
|
+
tester: rankWith(RANK, schemaTypeIs("array")),
|
|
1106
|
+
renderer: markRaw(createNuxtUiArrayListRenderer(theme))
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
tester: rankWith(RANK, isObjectControl),
|
|
1110
|
+
renderer: markRaw(NuxtUiObjectRenderer)
|
|
1111
|
+
},
|
|
1112
|
+
// Primitive controls
|
|
1113
|
+
{
|
|
1114
|
+
tester: rankWith(RANK, isMultiLineControl),
|
|
1115
|
+
renderer: markRaw(NuxtUiTextareaControl)
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
tester: rankWith(RANK, isNumberControl),
|
|
1119
|
+
renderer: markRaw(NuxtUiNumberControl)
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
tester: rankWith(RANK, isIntegerControl),
|
|
1123
|
+
renderer: markRaw(NuxtUiIntegerControl)
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
tester: rankWith(RANK, isBooleanControl),
|
|
1127
|
+
renderer: markRaw(createNuxtUiBooleanControl(theme))
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
// Multi-enum must outrank generic array renderer and string renderer.
|
|
1131
|
+
tester: rankWith(ENUM_RANK, isMultiEnumControl),
|
|
1132
|
+
renderer: markRaw(NuxtUiMultiEnumControl)
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
// oneOf with const+title (display labels) - same as enum for rendering.
|
|
1136
|
+
tester: rankWith(ENUM_RANK, isOneOfEnumControl),
|
|
1137
|
+
renderer: markRaw(NuxtUiEnumControl)
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
// Enum must outrank the generic string control, otherwise enums render
|
|
1141
|
+
// as freeform text inputs.
|
|
1142
|
+
tester: rankWith(ENUM_RANK, isEnumControl),
|
|
1143
|
+
renderer: markRaw(NuxtUiEnumControl)
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
tester: rankWith(PASSWORD_RANK, and(isStringControl, formatIs("password"))),
|
|
1147
|
+
renderer: markRaw(NuxtUiPasswordControl)
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
tester: rankWith(RANK, isStringControl),
|
|
1151
|
+
renderer: markRaw(NuxtUiStringControl)
|
|
1152
|
+
}
|
|
1153
|
+
];
|
|
1154
|
+
}
|
|
1155
|
+
var nuxtUiRenderers = createNuxtUiRenderers();
|
|
1101
1156
|
export {
|
|
1157
|
+
controlDescription,
|
|
1158
|
+
createNuxtUiRenderers,
|
|
1159
|
+
defaultTheme,
|
|
1160
|
+
mergeTheme,
|
|
1102
1161
|
nuxtUiRenderers
|
|
1103
1162
|
};
|
|
1104
1163
|
//# sourceMappingURL=index.js.map
|