@ghentcdh/json-forms-vue 0.6.5 → 0.6.7
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/index.js +174 -350
- package/index.mjs +176 -352
- package/package.json +1 -1
- package/renderes/controls/BooleanControlRenderer.vue.d.ts +71 -109
- package/renderes/controls/IntegerControlRenderer.vue.d.ts +71 -110
- package/renderes/controls/MarkdownControlRenderer.vue.d.ts +71 -81
- package/renderes/controls/NumberControlRenderer.vue.d.ts +71 -110
- package/renderes/controls/StringControlRenderer.vue.d.ts +71 -109
- package/renderes/controls/TextAreaControlRenderer.vue.d.ts +71 -107
- package/renderes/controls/autocomplete/AutocompleteControlRenderer.vue.d.ts +71 -96
- package/renderes/controls/index.d.ts +519 -1
- package/renderes/index.d.ts +519 -1
package/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useApi } from "@ghentcdh/tools-vue";
|
|
2
|
-
import { NotificationService,
|
|
3
|
-
import { rankWith,
|
|
2
|
+
import { NotificationService, Checkbox, InputNumber, Markdown, Input, Textarea, Autocomplete, IconEnum, Btn, BtnBadge, TextCell, Table, hasCustomEventListener, Card, ModalService, myStyles, Color, Modal } from "@ghentcdh/ui";
|
|
3
|
+
import { uiTypeIs, rankWith, isNumberControl, isIntegerControl, isBooleanControl, createDefaultValue, composePaths, getArrayTranslations, defaultJsonFormsI18nState, arrayDefaultTranslations } from "@jsonforms/core";
|
|
4
|
+
import { ref, computed, defineComponent, openBlock, createBlock, unref, mergeProps, inject, resolveComponent, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, createVNode, withCtx, createTextVNode, watch, useModel, provide, mergeModels, renderSlot } from "vue";
|
|
4
5
|
import { useJsonFormsControl, rendererProps, DispatchRenderer, useJsonFormsArrayControl, JsonForms } from "@jsonforms/vue";
|
|
5
|
-
import { ref, computed, defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, mergeProps, withCtx, createElementVNode, normalizeClass, toDisplayString, createBlock, inject, createCommentVNode, Fragment, renderList, createTextVNode, watch, unref, useModel, provide, mergeModels, renderSlot } from "vue";
|
|
6
6
|
import { useVanillaControl, useVanillaArrayControl, vanillaRenderers } from "@jsonforms/vue-vanilla";
|
|
7
7
|
import { and, optionIs, or, schemaTypeIs } from "@jsonforms/core/src/testers/testers";
|
|
8
8
|
import { ControlType, RequestSchema, extractFilters, findColumnDef } from "@ghentcdh/json-forms-core";
|
|
@@ -46,7 +46,7 @@ const useVanillaControlCustom = (input, adaptTarget = (v) => v.value) => {
|
|
|
46
46
|
isTouched.value = true;
|
|
47
47
|
isFocused.value = false;
|
|
48
48
|
};
|
|
49
|
-
const
|
|
49
|
+
const controlWrapper = computed(() => {
|
|
50
50
|
return {
|
|
51
51
|
...vanillaControl.controlWrapper.value,
|
|
52
52
|
isFocused: isFocused.value,
|
|
@@ -55,149 +55,142 @@ const useVanillaControlCustom = (input, adaptTarget = (v) => v.value) => {
|
|
|
55
55
|
});
|
|
56
56
|
return {
|
|
57
57
|
...vanillaControl,
|
|
58
|
-
controlWrapper
|
|
58
|
+
controlWrapper,
|
|
59
59
|
isFocused,
|
|
60
60
|
isTouched,
|
|
61
61
|
onFocus,
|
|
62
62
|
onBlur
|
|
63
|
+
// handleChange,
|
|
63
64
|
};
|
|
64
65
|
};
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
67
|
+
__name: "BooleanControlRenderer",
|
|
68
|
+
props: { ...rendererProps() },
|
|
69
|
+
setup(__props) {
|
|
70
|
+
const props = __props;
|
|
71
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(useJsonFormsControl(props), (target) => {
|
|
72
|
+
return Boolean(target.value) ?? false;
|
|
73
|
+
});
|
|
74
|
+
return (_ctx, _cache) => {
|
|
75
|
+
return openBlock(), createBlock(unref(Checkbox), mergeProps(unref(controlWrapper), {
|
|
76
|
+
modelValue: unref(control).data,
|
|
77
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
78
|
+
enabled: unref(control).enabled,
|
|
79
|
+
config: unref(appliedOptions),
|
|
80
|
+
onChange: unref(onChange),
|
|
81
|
+
onFocus: unref(onFocus),
|
|
82
|
+
onBlur: unref(onBlur)
|
|
83
|
+
}), null, 16, ["modelValue", "enabled", "config", "onChange", "onFocus", "onBlur"]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
88
|
+
__name: "IntegerControlRenderer",
|
|
89
|
+
props: { ...rendererProps() },
|
|
90
|
+
setup(__props) {
|
|
91
|
+
const props = __props;
|
|
92
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(
|
|
75
93
|
useJsonFormsControl(props),
|
|
76
|
-
(target) =>
|
|
77
|
-
return Boolean(target.value) ?? false;
|
|
78
|
-
}
|
|
94
|
+
(target) => target.value === "" ? void 0 : Number(target.value)
|
|
79
95
|
);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
96
|
+
const steps = computed(() => appliedOptions.value.steps ?? 1);
|
|
97
|
+
return (_ctx, _cache) => {
|
|
98
|
+
return openBlock(), createBlock(unref(InputNumber), mergeProps(unref(controlWrapper), {
|
|
99
|
+
modelValue: unref(control).data,
|
|
100
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
101
|
+
enabled: unref(control).enabled,
|
|
102
|
+
config: unref(appliedOptions),
|
|
103
|
+
steps: steps.value,
|
|
104
|
+
onChange: unref(onChange),
|
|
105
|
+
onFocus: unref(onFocus),
|
|
106
|
+
onBlur: unref(onBlur)
|
|
107
|
+
}), null, 16, ["modelValue", "enabled", "config", "steps", "onChange", "onFocus", "onBlur"]);
|
|
108
|
+
};
|
|
89
109
|
}
|
|
90
110
|
});
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
112
|
+
__name: "MarkdownControlRenderer",
|
|
113
|
+
props: { ...rendererProps() },
|
|
114
|
+
setup(__props) {
|
|
115
|
+
const props = __props;
|
|
116
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(useJsonFormsControl(props), (target) => {
|
|
117
|
+
return Boolean(target.value) ?? false;
|
|
118
|
+
});
|
|
119
|
+
return (_ctx, _cache) => {
|
|
120
|
+
return openBlock(), createBlock(unref(Markdown), mergeProps(unref(controlWrapper), {
|
|
121
|
+
modelValue: unref(control).data,
|
|
122
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
123
|
+
enabled: unref(control).enabled,
|
|
124
|
+
config: unref(appliedOptions),
|
|
125
|
+
onChange: unref(onChange),
|
|
126
|
+
onFocus: unref(onFocus),
|
|
127
|
+
onBlur: unref(onBlur)
|
|
128
|
+
}), null, 16, ["modelValue", "enabled", "config", "onChange", "onFocus", "onBlur"]);
|
|
129
|
+
};
|
|
99
130
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
const _component_control_wrapper = resolveComponent("control-wrapper");
|
|
108
|
-
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
109
|
-
createVNode(_component_control_wrapper, mergeProps(_ctx.controlWrapper, {
|
|
110
|
-
styles: _ctx.styles,
|
|
111
|
-
"hide-label": true
|
|
112
|
-
}), {
|
|
113
|
-
default: withCtx(() => [
|
|
114
|
-
createElementVNode("label", _hoisted_2$3, [
|
|
115
|
-
createElementVNode("input", {
|
|
116
|
-
id: _ctx.control.id + "-input",
|
|
117
|
-
type: "checkbox",
|
|
118
|
-
class: normalizeClass(["checkbox"]),
|
|
119
|
-
checked: _ctx.control.data,
|
|
120
|
-
disabled: !_ctx.control.enabled,
|
|
121
|
-
autofocus: _ctx.appliedOptions.focus,
|
|
122
|
-
placeholder: _ctx.appliedOptions.placeholder,
|
|
123
|
-
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
124
|
-
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
125
|
-
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
126
|
-
}, null, 40, _hoisted_3$3),
|
|
127
|
-
createElementVNode("span", _hoisted_4$2, toDisplayString(_ctx.control.label), 1)
|
|
128
|
-
])
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
}, 16, ["styles"])
|
|
132
|
-
]);
|
|
133
|
-
}
|
|
134
|
-
const BooleanControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$8, [["render", _sfc_render$7]]);
|
|
135
|
-
const showErrors = (isTouched, isFocused, errors) => {
|
|
136
|
-
return !!(isTouched && errors);
|
|
137
|
-
};
|
|
138
|
-
const inputClasses = (styles, isFocused, isTouched, errors) => {
|
|
139
|
-
return [
|
|
140
|
-
styles?.control.input,
|
|
141
|
-
{ "input-error": showErrors(isTouched, isFocused, errors) }
|
|
142
|
-
];
|
|
143
|
-
};
|
|
144
|
-
const controlRenderer$7 = defineComponent({
|
|
145
|
-
name: "IntegerControlRenderer",
|
|
146
|
-
components: {
|
|
147
|
-
ControlWrapper
|
|
148
|
-
},
|
|
149
|
-
props: {
|
|
150
|
-
...rendererProps()
|
|
151
|
-
},
|
|
152
|
-
setup(props) {
|
|
153
|
-
return useVanillaControlCustom(
|
|
131
|
+
});
|
|
132
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
133
|
+
__name: "NumberControlRenderer",
|
|
134
|
+
props: { ...rendererProps() },
|
|
135
|
+
setup(__props) {
|
|
136
|
+
const props = __props;
|
|
137
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(
|
|
154
138
|
useJsonFormsControl(props),
|
|
155
139
|
(target) => target.value === "" ? void 0 : Number(target.value)
|
|
156
140
|
);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
141
|
+
const steps = computed(() => appliedOptions.value.steps ?? 0.01);
|
|
142
|
+
return (_ctx, _cache) => {
|
|
143
|
+
return openBlock(), createBlock(unref(InputNumber), mergeProps(unref(controlWrapper), {
|
|
144
|
+
modelValue: unref(control).data,
|
|
145
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
146
|
+
enabled: unref(control).enabled,
|
|
147
|
+
config: unref(appliedOptions),
|
|
148
|
+
steps: steps.value,
|
|
149
|
+
onChange: unref(onChange),
|
|
150
|
+
onFocus: unref(onFocus),
|
|
151
|
+
onBlur: unref(onBlur)
|
|
152
|
+
}), null, 16, ["modelValue", "enabled", "config", "steps", "onChange", "onFocus", "onBlur"]);
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
157
|
+
__name: "StringControlRenderer",
|
|
158
|
+
props: { ...rendererProps() },
|
|
159
|
+
setup(__props) {
|
|
160
|
+
const props = __props;
|
|
161
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(useJsonFormsControl(props));
|
|
162
|
+
return (_ctx, _cache) => {
|
|
163
|
+
return openBlock(), createBlock(unref(Input), mergeProps(unref(controlWrapper), {
|
|
164
|
+
modelValue: unref(control).data,
|
|
165
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
166
|
+
enabled: unref(control).enabled,
|
|
167
|
+
config: unref(appliedOptions),
|
|
168
|
+
onChange: unref(onChange),
|
|
169
|
+
onFocus: unref(onFocus),
|
|
170
|
+
onBlur: unref(onBlur)
|
|
171
|
+
}), null, 16, ["modelValue", "enabled", "config", "onChange", "onFocus", "onBlur"]);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
176
|
+
__name: "TextAreaControlRenderer",
|
|
177
|
+
props: { ...rendererProps() },
|
|
178
|
+
setup(__props) {
|
|
179
|
+
const props = __props;
|
|
180
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(useJsonFormsControl(props));
|
|
181
|
+
return (_ctx, _cache) => {
|
|
182
|
+
return openBlock(), createBlock(unref(Textarea), mergeProps(unref(controlWrapper), {
|
|
183
|
+
modelValue: unref(control).data,
|
|
184
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
185
|
+
enabled: unref(control).enabled,
|
|
186
|
+
config: unref(appliedOptions),
|
|
187
|
+
onChange: unref(onChange),
|
|
188
|
+
onFocus: unref(onFocus),
|
|
189
|
+
onBlur: unref(onBlur)
|
|
190
|
+
}), null, 16, ["modelValue", "enabled", "config", "onChange", "onFocus", "onBlur"]);
|
|
191
|
+
};
|
|
171
192
|
}
|
|
172
193
|
});
|
|
173
|
-
const entry$7 = {
|
|
174
|
-
renderer: controlRenderer$7,
|
|
175
|
-
tester: rankWith(1, isIntegerControl)
|
|
176
|
-
};
|
|
177
|
-
const _hoisted_1$9 = ["id", "step", "value", "disabled", "autofocus", "placeholder"];
|
|
178
|
-
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
179
|
-
const _component_control_wrapper = resolveComponent("control-wrapper");
|
|
180
|
-
return openBlock(), createBlock(_component_control_wrapper, mergeProps(_ctx.controlWrapper, { styles: _ctx.styles }), {
|
|
181
|
-
default: withCtx(() => [
|
|
182
|
-
createElementVNode("input", {
|
|
183
|
-
id: _ctx.control.id + "-input",
|
|
184
|
-
autocomplete: "off",
|
|
185
|
-
type: "number",
|
|
186
|
-
step: _ctx.step,
|
|
187
|
-
class: normalizeClass(_ctx.inputClass),
|
|
188
|
-
value: _ctx.control.data,
|
|
189
|
-
disabled: !_ctx.control.enabled,
|
|
190
|
-
autofocus: _ctx.appliedOptions.focus,
|
|
191
|
-
placeholder: _ctx.appliedOptions.placeholder,
|
|
192
|
-
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
193
|
-
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
194
|
-
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
195
|
-
}, null, 42, _hoisted_1$9)
|
|
196
|
-
]),
|
|
197
|
-
_: 1
|
|
198
|
-
}, 16, ["styles"]);
|
|
199
|
-
}
|
|
200
|
-
const IntegerControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$7, [["render", _sfc_render$6]]);
|
|
201
194
|
const isAutoCompleteControl = and(
|
|
202
195
|
// uiTypeIs('Control'),
|
|
203
196
|
optionIs("format", ControlType.autocomplete)
|
|
@@ -228,228 +221,52 @@ const isCustomControl = (customType) => {
|
|
|
228
221
|
optionIs("type", customType)
|
|
229
222
|
);
|
|
230
223
|
};
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
224
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
225
|
+
__name: "AutocompleteControlRenderer",
|
|
226
|
+
props: { ...rendererProps() },
|
|
227
|
+
setup(__props) {
|
|
228
|
+
const props = __props;
|
|
229
|
+
const { control, onChange, appliedOptions, onFocus, onBlur, controlWrapper } = useVanillaControlCustom(useJsonFormsControl(props), (target) => {
|
|
230
|
+
return target?.value ?? void 0;
|
|
231
|
+
});
|
|
232
|
+
const field = computed(() => appliedOptions.value.field);
|
|
233
|
+
return (_ctx, _cache) => {
|
|
234
|
+
return openBlock(), createBlock(unref(Autocomplete), mergeProps(unref(controlWrapper), {
|
|
235
|
+
modelValue: unref(control).data,
|
|
236
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(control).data = $event),
|
|
237
|
+
enabled: unref(control).enabled,
|
|
238
|
+
config: unref(appliedOptions),
|
|
239
|
+
"label-key": field.value?.label,
|
|
240
|
+
"value-key": field.value?.id,
|
|
241
|
+
onChange: unref(onChange),
|
|
242
|
+
onFocus: unref(onFocus),
|
|
243
|
+
onBlur: unref(onBlur)
|
|
244
|
+
}), null, 16, ["modelValue", "enabled", "config", "label-key", "value-key", "onChange", "onFocus", "onBlur"]);
|
|
248
245
|
};
|
|
249
|
-
return { ...control, field, handleChange };
|
|
250
246
|
}
|
|
251
247
|
});
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
const _component_Markdown = resolveComponent("Markdown");
|
|
258
|
-
return openBlock(), createBlock(_component_Markdown, mergeProps(_ctx.controlWrapper, {
|
|
259
|
-
modelValue: _ctx.control.data,
|
|
260
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.control.data = $event),
|
|
261
|
-
enabled: _ctx.control.enabled,
|
|
262
|
-
config: _ctx.appliedOptions,
|
|
263
|
-
onChange: _ctx.handleChange,
|
|
264
|
-
onFocus: _ctx.onFocus,
|
|
265
|
-
onBlur: _ctx.onBlur
|
|
266
|
-
}), null, 16, ["modelValue", "enabled", "config", "onChange", "onFocus", "onBlur"]);
|
|
267
|
-
}
|
|
268
|
-
const MarkdownControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$6, [["render", _sfc_render$5]]);
|
|
269
|
-
const controlRenderer$5 = defineComponent({
|
|
270
|
-
name: "NumberControlRenderer",
|
|
271
|
-
components: {
|
|
272
|
-
ControlWrapper
|
|
273
|
-
},
|
|
274
|
-
props: {
|
|
275
|
-
...rendererProps()
|
|
276
|
-
},
|
|
277
|
-
setup(props) {
|
|
278
|
-
return useVanillaControlCustom(
|
|
279
|
-
useJsonFormsControl(props),
|
|
280
|
-
(target) => target.value === "" ? void 0 : Number(target.value)
|
|
281
|
-
);
|
|
282
|
-
},
|
|
283
|
-
computed: {
|
|
284
|
-
step() {
|
|
285
|
-
const options = this.appliedOptions;
|
|
286
|
-
return options.step ?? 0.1;
|
|
287
|
-
},
|
|
288
|
-
inputClass() {
|
|
289
|
-
return inputClasses(
|
|
290
|
-
this.styles,
|
|
291
|
-
this.isFocused,
|
|
292
|
-
this.isTouched,
|
|
293
|
-
this.controlWrapper?.errors
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
const entry$5 = {
|
|
299
|
-
renderer: controlRenderer$5,
|
|
300
|
-
tester: rankWith(1, isNumberControl)
|
|
301
|
-
};
|
|
302
|
-
const _hoisted_1$8 = ["id", "step", "value", "disabled", "autofocus", "placeholder"];
|
|
303
|
-
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
304
|
-
const _component_control_wrapper = resolveComponent("control-wrapper");
|
|
305
|
-
return openBlock(), createBlock(_component_control_wrapper, mergeProps(_ctx.controlWrapper, { styles: _ctx.styles }), {
|
|
306
|
-
default: withCtx(() => [
|
|
307
|
-
createElementVNode("input", {
|
|
308
|
-
id: _ctx.control.id + "-input",
|
|
309
|
-
autocomplete: "off",
|
|
310
|
-
type: "number",
|
|
311
|
-
step: _ctx.step,
|
|
312
|
-
class: normalizeClass(_ctx.inputClass),
|
|
313
|
-
value: _ctx.control.data,
|
|
314
|
-
disabled: !_ctx.control.enabled,
|
|
315
|
-
autofocus: _ctx.appliedOptions.focus,
|
|
316
|
-
placeholder: _ctx.appliedOptions.placeholder,
|
|
317
|
-
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
318
|
-
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
319
|
-
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
320
|
-
}, null, 42, _hoisted_1$8)
|
|
321
|
-
]),
|
|
322
|
-
_: 1
|
|
323
|
-
}, 16, ["styles"]);
|
|
324
|
-
}
|
|
325
|
-
const NumberControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$5, [["render", _sfc_render$4]]);
|
|
326
|
-
const controlRenderer$4 = defineComponent({
|
|
327
|
-
name: "StringControlRenderer",
|
|
328
|
-
components: {
|
|
329
|
-
ControlWrapper
|
|
330
|
-
},
|
|
331
|
-
props: {
|
|
332
|
-
...rendererProps()
|
|
333
|
-
},
|
|
334
|
-
setup(props) {
|
|
335
|
-
return useVanillaControlCustom(
|
|
336
|
-
useJsonFormsControl(props),
|
|
337
|
-
(target) => target.value ?? void 0
|
|
338
|
-
);
|
|
339
|
-
},
|
|
340
|
-
computed: {
|
|
341
|
-
inputClass() {
|
|
342
|
-
return inputClasses(
|
|
343
|
-
this.styles,
|
|
344
|
-
this.isFocused,
|
|
345
|
-
this.isTouched,
|
|
346
|
-
this.controlWrapper?.errors
|
|
347
|
-
);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
const entry$4 = {
|
|
352
|
-
renderer: controlRenderer$4,
|
|
353
|
-
tester: rankWith(1, isStringFormat)
|
|
354
|
-
};
|
|
355
|
-
const _hoisted_1$7 = ["id", "value", "disabled", "autofocus", "placeholder"];
|
|
356
|
-
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
357
|
-
const _component_ControlWrapper = resolveComponent("ControlWrapper");
|
|
358
|
-
return openBlock(), createBlock(_component_ControlWrapper, mergeProps(_ctx.controlWrapper, { styles: _ctx.styles }), {
|
|
359
|
-
default: withCtx(() => [
|
|
360
|
-
createElementVNode("input", {
|
|
361
|
-
id: _ctx.control.id + "-input",
|
|
362
|
-
type: "text",
|
|
363
|
-
class: normalizeClass(_ctx.inputClass),
|
|
364
|
-
value: _ctx.control.data,
|
|
365
|
-
disabled: !_ctx.control.enabled,
|
|
366
|
-
autofocus: _ctx.appliedOptions.focus,
|
|
367
|
-
placeholder: _ctx.appliedOptions.placeholder,
|
|
368
|
-
autocomplete: "off",
|
|
369
|
-
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
370
|
-
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
371
|
-
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
372
|
-
}, null, 42, _hoisted_1$7)
|
|
373
|
-
]),
|
|
374
|
-
_: 1
|
|
375
|
-
}, 16, ["styles"]);
|
|
376
|
-
}
|
|
377
|
-
const StringControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$4, [["render", _sfc_render$3]]);
|
|
378
|
-
const controlRenderer$3 = defineComponent({
|
|
379
|
-
name: "TextAreaControlRenderer",
|
|
380
|
-
components: {
|
|
381
|
-
ControlWrapper
|
|
248
|
+
const controlRenderers = [
|
|
249
|
+
// First custom renderers on format
|
|
250
|
+
{
|
|
251
|
+
tester: rankWith(10, isMarkdownControl),
|
|
252
|
+
renderer: _sfc_main$a
|
|
382
253
|
},
|
|
383
|
-
|
|
384
|
-
|
|
254
|
+
{
|
|
255
|
+
tester: rankWith(10, isAutoCompleteControl),
|
|
256
|
+
renderer: _sfc_main$6
|
|
385
257
|
},
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
(target) => target.value ?? void 0
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
const entry$3 = {
|
|
394
|
-
renderer: controlRenderer$3,
|
|
395
|
-
tester: rankWith(1, isTextAreaControl)
|
|
396
|
-
};
|
|
397
|
-
const controlRenderer$2 = defineComponent({
|
|
398
|
-
name: "AutocompleteControlRenderer",
|
|
399
|
-
components: {
|
|
400
|
-
Autocomplete
|
|
258
|
+
{
|
|
259
|
+
tester: rankWith(10, isTextAreaControl),
|
|
260
|
+
renderer: _sfc_main$7
|
|
401
261
|
},
|
|
402
|
-
props: {
|
|
403
|
-
...rendererProps()
|
|
404
|
-
},
|
|
405
|
-
setup(props) {
|
|
406
|
-
const control = useVanillaControlCustom(
|
|
407
|
-
useJsonFormsControl(props),
|
|
408
|
-
(target) => target.value ?? void 0
|
|
409
|
-
);
|
|
410
|
-
const field = control.appliedOptions.value.field;
|
|
411
|
-
const handleChange = (result) => {
|
|
412
|
-
const { path } = control.control.value;
|
|
413
|
-
control.handleChange(path, result);
|
|
414
|
-
};
|
|
415
|
-
return { ...control, field, handleChange };
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
const entry$2 = {
|
|
419
|
-
renderer: controlRenderer$2,
|
|
420
|
-
tester: rankWith(1, isAutoCompleteControl)
|
|
421
|
-
};
|
|
422
|
-
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
423
|
-
const _component_Autocomplete = resolveComponent("Autocomplete");
|
|
424
|
-
return openBlock(), createBlock(_component_Autocomplete, mergeProps(_ctx.controlWrapper, {
|
|
425
|
-
modelValue: _ctx.control.data,
|
|
426
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.control.data = $event),
|
|
427
|
-
enabled: _ctx.control.enabled,
|
|
428
|
-
config: _ctx.appliedOptions,
|
|
429
|
-
"label-key": _ctx.field?.label,
|
|
430
|
-
"value-key": _ctx.field?.id,
|
|
431
|
-
onChange: _ctx.handleChange,
|
|
432
|
-
onFocus: _ctx.onFocus,
|
|
433
|
-
onBlur: _ctx.onBlur
|
|
434
|
-
}), null, 16, ["modelValue", "enabled", "config", "label-key", "value-key", "onChange", "onFocus", "onBlur"]);
|
|
435
|
-
}
|
|
436
|
-
const AutocompleteControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$2, [["render", _sfc_render$2]]);
|
|
437
|
-
const controlRenderers = [
|
|
438
|
-
// First custom renderers on format
|
|
439
|
-
entry$6,
|
|
440
|
-
entry$2,
|
|
441
|
-
entry$3,
|
|
442
|
-
// multiStringControlRendererEntry,
|
|
443
|
-
// enumControlRendererEntry,
|
|
444
|
-
// oneOfEnumControlRendererEntry,
|
|
445
|
-
// dateControlRendererEntry,
|
|
446
|
-
// dateTimeControlRendererEntry,
|
|
447
|
-
// timeControlRendererEntry,
|
|
448
|
-
entry$8,
|
|
449
262
|
// Renderers based on type if no format is provided
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
263
|
+
{ tester: rankWith(10, isStringFormat), renderer: _sfc_main$8 },
|
|
264
|
+
{ tester: rankWith(10, isNumberControl), renderer: _sfc_main$9 },
|
|
265
|
+
{
|
|
266
|
+
tester: rankWith(10, isIntegerControl),
|
|
267
|
+
renderer: _sfc_main$b
|
|
268
|
+
},
|
|
269
|
+
{ tester: rankWith(10, isBooleanControl), renderer: _sfc_main$c }
|
|
453
270
|
];
|
|
454
271
|
const actionMap = {
|
|
455
272
|
edit: (router, action) => ({
|
|
@@ -557,6 +374,13 @@ const entry$1 = {
|
|
|
557
374
|
renderer: controlRenderer$1,
|
|
558
375
|
tester: rankWith(2, isArrayRenderer)
|
|
559
376
|
};
|
|
377
|
+
const _export_sfc = (sfc, props) => {
|
|
378
|
+
const target = sfc.__vccOpts || sfc;
|
|
379
|
+
for (const [key, val] of props) {
|
|
380
|
+
target[key] = val;
|
|
381
|
+
}
|
|
382
|
+
return target;
|
|
383
|
+
};
|
|
560
384
|
const _hoisted_1$6 = { class: "fieldset" };
|
|
561
385
|
const _hoisted_2$2 = { class: "flex gap-2 items-center" };
|
|
562
386
|
const _hoisted_3$2 = { class: "mt-3 flex gap-2" };
|
|
@@ -1411,8 +1235,8 @@ const createRepository = (formSchemaModel, httpRequest, options = {}) => {
|
|
|
1411
1235
|
};
|
|
1412
1236
|
export {
|
|
1413
1237
|
ArrayRenderer,
|
|
1414
|
-
AutocompleteControlRenderer,
|
|
1415
|
-
BooleanControlRenderer,
|
|
1238
|
+
_sfc_main$6 as AutocompleteControlRenderer,
|
|
1239
|
+
_sfc_main$c as BooleanControlRenderer,
|
|
1416
1240
|
FixedArrayRenderer,
|
|
1417
1241
|
_sfc_main$2 as FormComponent,
|
|
1418
1242
|
_sfc_main as FormModal,
|
|
@@ -1420,9 +1244,9 @@ export {
|
|
|
1420
1244
|
FormStore,
|
|
1421
1245
|
_sfc_main$1 as FormWithActions,
|
|
1422
1246
|
_sfc_main$3 as FormWithTableComponent,
|
|
1423
|
-
IntegerControlRenderer,
|
|
1424
|
-
NumberControlRenderer,
|
|
1425
|
-
StringControlRenderer,
|
|
1247
|
+
_sfc_main$b as IntegerControlRenderer,
|
|
1248
|
+
_sfc_main$9 as NumberControlRenderer,
|
|
1249
|
+
_sfc_main$8 as StringControlRenderer,
|
|
1426
1250
|
_sfc_main$4 as TableComponent,
|
|
1427
1251
|
arrayRenderers,
|
|
1428
1252
|
controlRenderers,
|
|
@@ -1435,6 +1259,6 @@ export {
|
|
|
1435
1259
|
isStringFormat,
|
|
1436
1260
|
isTextAreaControl,
|
|
1437
1261
|
layoutRenderers,
|
|
1438
|
-
|
|
1262
|
+
_sfc_main$a as markdownControlRenderer,
|
|
1439
1263
|
useFormState
|
|
1440
1264
|
};
|