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