@ghentcdh/json-forms-vue 0.6.7 → 0.6.8
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/form-with-actions.component.vue.d.ts +17 -2
- package/form.component.vue.d.ts +2 -0
- package/form.store.d.ts +1 -1
- package/index.js +330 -312
- package/index.mjs +336 -318
- package/package.json +4 -4
- package/renderes/array/ArrayRenderer.vue.d.ts +71 -183
- package/renderes/array/index.d.ts +75 -2
- package/renderes/index.d.ts +149 -1
- package/renderes/layouts/CollapseLayout.vue.d.ts +73 -0
- package/renderes/layouts/HorizontalLayout.vue.d.ts +73 -0
- package/renderes/layouts/VerticalLayout.vue.d.ts +73 -0
- package/renderes/layouts/index.d.ts +75 -1
- package/renderes/tester.d.ts +0 -1
- package/renderes/array/FixedArrayRenderer.vue.d.ts +0 -127
package/index.js
CHANGED
|
@@ -6,10 +6,10 @@ const core = require("@jsonforms/core");
|
|
|
6
6
|
const vue = require("vue");
|
|
7
7
|
const vue$1 = require("@jsonforms/vue");
|
|
8
8
|
const vueVanilla = require("@jsonforms/vue-vanilla");
|
|
9
|
+
const lodashEs = require("lodash-es");
|
|
9
10
|
const testers = require("@jsonforms/core/src/testers/testers");
|
|
10
11
|
const jsonFormsCore = require("@ghentcdh/json-forms-core");
|
|
11
12
|
const vueRouter = require("vue-router");
|
|
12
|
-
const lodashEs = require("lodash-es");
|
|
13
13
|
const core$1 = require("@vueuse/core");
|
|
14
14
|
class FormStore {
|
|
15
15
|
constructor(schema) {
|
|
@@ -51,6 +51,7 @@ const useVanillaControlCustom = (input, adaptTarget = (v) => v.value) => {
|
|
|
51
51
|
const controlWrapper = vue.computed(() => {
|
|
52
52
|
return {
|
|
53
53
|
...vanillaControl.controlWrapper.value,
|
|
54
|
+
...lodashEs.omit(vanillaControl.appliedOptions.value, "styles"),
|
|
54
55
|
isFocused: isFocused.value,
|
|
55
56
|
isTouched: isTouched.value
|
|
56
57
|
};
|
|
@@ -65,7 +66,7 @@ const useVanillaControlCustom = (input, adaptTarget = (v) => v.value) => {
|
|
|
65
66
|
// handleChange,
|
|
66
67
|
};
|
|
67
68
|
};
|
|
68
|
-
const _sfc_main$
|
|
69
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
69
70
|
__name: "BooleanControlRenderer",
|
|
70
71
|
props: { ...vue$1.rendererProps() },
|
|
71
72
|
setup(__props) {
|
|
@@ -86,7 +87,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
86
87
|
};
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
|
-
const _sfc_main$
|
|
90
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
90
91
|
__name: "IntegerControlRenderer",
|
|
91
92
|
props: { ...vue$1.rendererProps() },
|
|
92
93
|
setup(__props) {
|
|
@@ -110,28 +111,36 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
|
-
const _sfc_main$
|
|
114
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
114
115
|
__name: "MarkdownControlRenderer",
|
|
115
116
|
props: { ...vue$1.rendererProps() },
|
|
116
117
|
setup(__props) {
|
|
117
118
|
const props = __props;
|
|
118
|
-
const {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
const {
|
|
120
|
+
control,
|
|
121
|
+
handleChange,
|
|
122
|
+
appliedOptions,
|
|
123
|
+
onFocus,
|
|
124
|
+
onBlur,
|
|
125
|
+
controlWrapper
|
|
126
|
+
} = useVanillaControlCustom(vue$1.useJsonFormsControl(props));
|
|
127
|
+
const changeValue = (value) => {
|
|
128
|
+
handleChange(control.value.path, value);
|
|
129
|
+
};
|
|
121
130
|
return (_ctx, _cache) => {
|
|
122
131
|
return vue.openBlock(), vue.createBlock(vue.unref(ui.Markdown), vue.mergeProps(vue.unref(controlWrapper), {
|
|
123
132
|
modelValue: vue.unref(control).data,
|
|
124
133
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.unref(control).data = $event),
|
|
125
134
|
enabled: vue.unref(control).enabled,
|
|
126
135
|
config: vue.unref(appliedOptions),
|
|
127
|
-
onChange:
|
|
136
|
+
onChange: changeValue,
|
|
128
137
|
onFocus: vue.unref(onFocus),
|
|
129
138
|
onBlur: vue.unref(onBlur)
|
|
130
|
-
}), null, 16, ["modelValue", "enabled", "config", "
|
|
139
|
+
}), null, 16, ["modelValue", "enabled", "config", "onFocus", "onBlur"]);
|
|
131
140
|
};
|
|
132
141
|
}
|
|
133
142
|
});
|
|
134
|
-
const _sfc_main$
|
|
143
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
135
144
|
__name: "NumberControlRenderer",
|
|
136
145
|
props: { ...vue$1.rendererProps() },
|
|
137
146
|
setup(__props) {
|
|
@@ -155,26 +164,35 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
155
164
|
};
|
|
156
165
|
}
|
|
157
166
|
});
|
|
158
|
-
const _sfc_main$
|
|
167
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
159
168
|
__name: "StringControlRenderer",
|
|
160
169
|
props: { ...vue$1.rendererProps() },
|
|
161
170
|
setup(__props) {
|
|
162
171
|
const props = __props;
|
|
163
|
-
const {
|
|
172
|
+
const {
|
|
173
|
+
control,
|
|
174
|
+
onChange,
|
|
175
|
+
appliedOptions,
|
|
176
|
+
onFocus,
|
|
177
|
+
onBlur,
|
|
178
|
+
controlWrapper,
|
|
179
|
+
styles
|
|
180
|
+
} = useVanillaControlCustom(vue$1.useJsonFormsControl(props));
|
|
164
181
|
return (_ctx, _cache) => {
|
|
165
182
|
return vue.openBlock(), vue.createBlock(vue.unref(ui.Input), vue.mergeProps(vue.unref(controlWrapper), {
|
|
166
183
|
modelValue: vue.unref(control).data,
|
|
167
184
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.unref(control).data = $event),
|
|
168
185
|
enabled: vue.unref(control).enabled,
|
|
169
186
|
config: vue.unref(appliedOptions),
|
|
187
|
+
styles: vue.unref(styles),
|
|
170
188
|
onChange: vue.unref(onChange),
|
|
171
189
|
onFocus: vue.unref(onFocus),
|
|
172
190
|
onBlur: vue.unref(onBlur)
|
|
173
|
-
}), null, 16, ["modelValue", "enabled", "config", "onChange", "onFocus", "onBlur"]);
|
|
191
|
+
}), null, 16, ["modelValue", "enabled", "config", "styles", "onChange", "onFocus", "onBlur"]);
|
|
174
192
|
};
|
|
175
193
|
}
|
|
176
194
|
});
|
|
177
|
-
const _sfc_main$
|
|
195
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
178
196
|
__name: "TextAreaControlRenderer",
|
|
179
197
|
props: { ...vue$1.rendererProps() },
|
|
180
198
|
setup(__props) {
|
|
@@ -209,10 +227,6 @@ const isMarkdownControl = testers.and(
|
|
|
209
227
|
core.uiTypeIs("Control"),
|
|
210
228
|
testers.optionIs("format", jsonFormsCore.ControlType.markdown)
|
|
211
229
|
);
|
|
212
|
-
const isFixedArray = testers.and(
|
|
213
|
-
testers.schemaTypeIs("array"),
|
|
214
|
-
testers.optionIs("format", jsonFormsCore.ControlType.fixedArray)
|
|
215
|
-
);
|
|
216
230
|
const isArrayRenderer = testers.and(
|
|
217
231
|
testers.schemaTypeIs("array")
|
|
218
232
|
// optionIs('format', ControlType.array),
|
|
@@ -223,15 +237,24 @@ const isCustomControl = (customType) => {
|
|
|
223
237
|
testers.optionIs("type", customType)
|
|
224
238
|
);
|
|
225
239
|
};
|
|
226
|
-
const _sfc_main$
|
|
240
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
227
241
|
__name: "AutocompleteControlRenderer",
|
|
228
242
|
props: { ...vue$1.rendererProps() },
|
|
229
243
|
setup(__props) {
|
|
230
244
|
const props = __props;
|
|
231
|
-
const {
|
|
232
|
-
|
|
233
|
-
|
|
245
|
+
const {
|
|
246
|
+
control,
|
|
247
|
+
handleChange: _handleChange,
|
|
248
|
+
appliedOptions,
|
|
249
|
+
onFocus,
|
|
250
|
+
onBlur,
|
|
251
|
+
controlWrapper
|
|
252
|
+
} = useVanillaControlCustom(vue$1.useJsonFormsControl(props));
|
|
234
253
|
const field = vue.computed(() => appliedOptions.value.field);
|
|
254
|
+
const handleChange = (result) => {
|
|
255
|
+
const { path } = control.value;
|
|
256
|
+
_handleChange(path, result);
|
|
257
|
+
};
|
|
235
258
|
return (_ctx, _cache) => {
|
|
236
259
|
return vue.openBlock(), vue.createBlock(vue.unref(ui.Autocomplete), vue.mergeProps(vue.unref(controlWrapper), {
|
|
237
260
|
modelValue: vue.unref(control).data,
|
|
@@ -240,10 +263,10 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
240
263
|
config: vue.unref(appliedOptions),
|
|
241
264
|
"label-key": field.value?.label,
|
|
242
265
|
"value-key": field.value?.id,
|
|
243
|
-
onChange:
|
|
266
|
+
onChange: handleChange,
|
|
244
267
|
onFocus: vue.unref(onFocus),
|
|
245
268
|
onBlur: vue.unref(onBlur)
|
|
246
|
-
}), null, 16, ["modelValue", "enabled", "config", "label-key", "value-key", "
|
|
269
|
+
}), null, 16, ["modelValue", "enabled", "config", "label-key", "value-key", "onFocus", "onBlur"]);
|
|
247
270
|
};
|
|
248
271
|
}
|
|
249
272
|
});
|
|
@@ -251,24 +274,24 @@ const controlRenderers = [
|
|
|
251
274
|
// First custom renderers on format
|
|
252
275
|
{
|
|
253
276
|
tester: core.rankWith(10, isMarkdownControl),
|
|
254
|
-
renderer: _sfc_main$
|
|
277
|
+
renderer: _sfc_main$e
|
|
255
278
|
},
|
|
256
279
|
{
|
|
257
280
|
tester: core.rankWith(10, isAutoCompleteControl),
|
|
258
|
-
renderer: _sfc_main$
|
|
281
|
+
renderer: _sfc_main$a
|
|
259
282
|
},
|
|
260
283
|
{
|
|
261
284
|
tester: core.rankWith(10, isTextAreaControl),
|
|
262
|
-
renderer: _sfc_main$
|
|
285
|
+
renderer: _sfc_main$b
|
|
263
286
|
},
|
|
264
287
|
// Renderers based on type if no format is provided
|
|
265
|
-
{ tester: core.rankWith(10, isStringFormat), renderer: _sfc_main$
|
|
266
|
-
{ tester: core.rankWith(10, core.isNumberControl), renderer: _sfc_main$
|
|
288
|
+
{ tester: core.rankWith(10, isStringFormat), renderer: _sfc_main$c },
|
|
289
|
+
{ tester: core.rankWith(10, core.isNumberControl), renderer: _sfc_main$d },
|
|
267
290
|
{
|
|
268
291
|
tester: core.rankWith(10, core.isIntegerControl),
|
|
269
|
-
renderer: _sfc_main$
|
|
292
|
+
renderer: _sfc_main$f
|
|
270
293
|
},
|
|
271
|
-
{ tester: core.rankWith(10, core.isBooleanControl), renderer: _sfc_main$
|
|
294
|
+
{ tester: core.rankWith(10, core.isBooleanControl), renderer: _sfc_main$g }
|
|
272
295
|
];
|
|
273
296
|
const actionMap = {
|
|
274
297
|
edit: (router, action) => ({
|
|
@@ -303,262 +326,233 @@ class FormState {
|
|
|
303
326
|
const useFormState = (form) => {
|
|
304
327
|
return FormState.getInstance();
|
|
305
328
|
};
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
setup(
|
|
329
|
+
const _hoisted_1$8 = ["title"];
|
|
330
|
+
const _hoisted_2$2 = { key: 0 };
|
|
331
|
+
const _hoisted_3$1 = {
|
|
332
|
+
key: 1,
|
|
333
|
+
class: "list-row"
|
|
334
|
+
};
|
|
335
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
336
|
+
__name: "ArrayRenderer",
|
|
337
|
+
props: { ...vue$1.rendererProps() },
|
|
338
|
+
setup(__props) {
|
|
339
|
+
const props = __props;
|
|
316
340
|
const vanillaArrayControl = vueVanilla.useVanillaArrayControl(
|
|
317
341
|
vue$1.useJsonFormsArrayControl(props)
|
|
318
342
|
);
|
|
319
|
-
const control = vanillaArrayControl
|
|
320
|
-
if (!control.data || control.data.length < 1) {
|
|
343
|
+
const { styles, childUiSchema, control, appliedOptions } = vanillaArrayControl;
|
|
344
|
+
if (!control.value.data || control.value.data.length < 1) {
|
|
321
345
|
vanillaArrayControl.addItem(
|
|
322
|
-
control.path,
|
|
323
|
-
core.createDefaultValue(control.schema, control.rootSchema)
|
|
346
|
+
control.value.path,
|
|
347
|
+
core.createDefaultValue(control.value.schema, control.value.rootSchema)
|
|
324
348
|
)();
|
|
325
349
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
const actions = this.uischema.options?.actions ?? [];
|
|
337
|
-
return mapArrayActions(vueRouter.useRouter(), actions);
|
|
338
|
-
},
|
|
339
|
-
showDelete() {
|
|
340
|
-
return this.control.data?.length > 1;
|
|
341
|
-
},
|
|
342
|
-
translations() {
|
|
343
|
-
const jsonforms = vue.inject("jsonforms");
|
|
344
|
-
return core.getArrayTranslations(
|
|
345
|
-
jsonforms?.i18n?.translate ?? core.defaultJsonFormsI18nState.translate,
|
|
346
|
-
core.arrayDefaultTranslations,
|
|
347
|
-
this.control.i18nKeyPrefix,
|
|
348
|
-
this.control.label
|
|
349
|
-
);
|
|
350
|
-
},
|
|
351
|
-
labelKey() {
|
|
352
|
-
const key = this.uischema?.options?.labelKey;
|
|
350
|
+
const noData = vue.computed(
|
|
351
|
+
() => !control.value.data || control.value.data.length === 0
|
|
352
|
+
);
|
|
353
|
+
const actions = vue.computed(() => {
|
|
354
|
+
const actions2 = props.uischema.options?.actions ?? [];
|
|
355
|
+
return mapArrayActions(vueRouter.useRouter(), actions2);
|
|
356
|
+
});
|
|
357
|
+
const showDelete = vue.computed(() => control.value.data?.length > 1);
|
|
358
|
+
vue.computed(() => {
|
|
359
|
+
const key = control.value.uischema?.options?.labelKey;
|
|
353
360
|
if (!key) return null;
|
|
354
361
|
return key;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
deleteButtonClick(index) {
|
|
361
|
-
this.removeItems(this.control.path, [index])();
|
|
362
|
-
},
|
|
363
|
-
dispatchEvent: (event, data) => {
|
|
362
|
+
});
|
|
363
|
+
const deleteButtonClick = (index) => {
|
|
364
|
+
vanillaArrayControl.removeItems(control.value.path, [index])();
|
|
365
|
+
};
|
|
366
|
+
const dispatchEvent = (event, data) => {
|
|
364
367
|
const form_id = "";
|
|
365
368
|
useFormState().dispatchEvent(form_id, event, data);
|
|
366
|
-
}
|
|
367
|
-
addButtonClick() {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
core.createDefaultValue(
|
|
369
|
+
};
|
|
370
|
+
const addButtonClick = () => {
|
|
371
|
+
vanillaArrayControl.addItem(
|
|
372
|
+
control.value.path,
|
|
373
|
+
core.createDefaultValue(control.value.schema, control.value.rootSchema)
|
|
371
374
|
)();
|
|
372
|
-
}
|
|
375
|
+
};
|
|
376
|
+
const showActions = vue.computed(() => {
|
|
377
|
+
return !appliedOptions.value.hideActions;
|
|
378
|
+
});
|
|
379
|
+
return (_ctx, _cache) => {
|
|
380
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
381
|
+
title: vue.unref(control).label
|
|
382
|
+
}, [
|
|
383
|
+
vue.createElementVNode("div", {
|
|
384
|
+
class: vue.normalizeClass([
|
|
385
|
+
"flex gap-2",
|
|
386
|
+
vue.unref(appliedOptions)?.layout === "row" ? "flex-row items-center" : "flex-col"
|
|
387
|
+
])
|
|
388
|
+
}, [
|
|
389
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(control).data, (element, index) => {
|
|
390
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
391
|
+
key: `${vue.unref(control).path}-${index}`,
|
|
392
|
+
class: "flex-1"
|
|
393
|
+
}, [
|
|
394
|
+
vue.createElementVNode("div", {
|
|
395
|
+
class: vue.normalizeClass([
|
|
396
|
+
"flex gap-2",
|
|
397
|
+
vue.unref(appliedOptions)?.layout === "row" ? "flex-col" : "flex-row items-center"
|
|
398
|
+
])
|
|
399
|
+
}, [
|
|
400
|
+
vue.createElementVNode("div", null, [
|
|
401
|
+
vue.createVNode(vue.unref(vue$1.DispatchRenderer), {
|
|
402
|
+
schema: vue.unref(control).schema,
|
|
403
|
+
uischema: vue.unref(childUiSchema),
|
|
404
|
+
path: vue.unref(core.composePaths)(vue.unref(control).path, `${index}`),
|
|
405
|
+
enabled: vue.unref(control).enabled,
|
|
406
|
+
renderers: vue.unref(control).renderers,
|
|
407
|
+
cells: vue.unref(control).cells
|
|
408
|
+
}, null, 8, ["schema", "uischema", "path", "enabled", "renderers", "cells"])
|
|
409
|
+
]),
|
|
410
|
+
showActions.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
|
|
411
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(actions.value, (action) => {
|
|
412
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
413
|
+
action.show(element) ? (vue.openBlock(), vue.createBlock(vue.unref(ui.Btn), {
|
|
414
|
+
key: action.label,
|
|
415
|
+
icon: action.icon,
|
|
416
|
+
outline: true,
|
|
417
|
+
onClick: ($event) => dispatchEvent(action.label, element)
|
|
418
|
+
}, null, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true)
|
|
419
|
+
], 64);
|
|
420
|
+
}), 256)),
|
|
421
|
+
showDelete.value ? (vue.openBlock(), vue.createBlock(vue.unref(ui.Btn), {
|
|
422
|
+
key: 0,
|
|
423
|
+
icon: vue.unref(ui.IconEnum).Delete,
|
|
424
|
+
outline: true,
|
|
425
|
+
onClick: ($event) => deleteButtonClick(index)
|
|
426
|
+
}, null, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true)
|
|
427
|
+
])) : vue.createCommentVNode("", true)
|
|
428
|
+
], 2)
|
|
429
|
+
]);
|
|
430
|
+
}), 128)),
|
|
431
|
+
noData.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
432
|
+
key: 0,
|
|
433
|
+
class: vue.normalizeClass(["list-row", vue.unref(styles).arrayList.noData])
|
|
434
|
+
}, " No data ", 2)) : vue.createCommentVNode("", true),
|
|
435
|
+
showActions.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
|
|
436
|
+
vue.createVNode(vue.unref(ui.Btn), {
|
|
437
|
+
icon: vue.unref(ui.IconEnum).Plus,
|
|
438
|
+
outline: true,
|
|
439
|
+
onClick: addButtonClick
|
|
440
|
+
}, {
|
|
441
|
+
default: vue.withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
442
|
+
vue.createTextVNode(" Add ", -1)
|
|
443
|
+
])]),
|
|
444
|
+
_: 1
|
|
445
|
+
}, 8, ["icon"])
|
|
446
|
+
])) : vue.createCommentVNode("", true)
|
|
447
|
+
], 2)
|
|
448
|
+
], 8, _hoisted_1$8);
|
|
449
|
+
};
|
|
373
450
|
}
|
|
374
451
|
});
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
const _export_sfc = (sfc, props) => {
|
|
380
|
-
const target = sfc.__vccOpts || sfc;
|
|
381
|
-
for (const [key, val] of props) {
|
|
382
|
-
target[key] = val;
|
|
452
|
+
const arrayRenderers = [
|
|
453
|
+
{
|
|
454
|
+
tester: core.rankWith(12, isArrayRenderer),
|
|
455
|
+
renderer: _sfc_main$9
|
|
383
456
|
}
|
|
384
|
-
|
|
385
|
-
};
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
class: vue.normalizeClass(_ctx.styles.arrayList.legend)
|
|
414
|
-
}, vue.toDisplayString(element[_ctx.labelKey]?.toLowerCase()), 3)) : vue.createCommentVNode("", true),
|
|
415
|
-
vue.createElementVNode("div", _hoisted_2$2, [
|
|
416
|
-
vue.createVNode(_component_dispatch_renderer, {
|
|
417
|
-
schema: _ctx.control.schema,
|
|
418
|
-
uischema: _ctx.childUiSchema,
|
|
419
|
-
path: _ctx.composePaths(_ctx.control.path, `${index}`),
|
|
420
|
-
enabled: _ctx.control.enabled,
|
|
421
|
-
renderers: _ctx.control.renderers,
|
|
422
|
-
cells: _ctx.control.cells
|
|
423
|
-
}, null, 8, ["schema", "uischema", "path", "enabled", "renderers", "cells"]),
|
|
424
|
-
vue.createElementVNode("div", _hoisted_3$2, [
|
|
425
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.actions, (action) => {
|
|
426
|
-
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
427
|
-
action.show(element) ? (vue.openBlock(), vue.createBlock(_component_Btn, {
|
|
428
|
-
key: action.label,
|
|
429
|
-
icon: action.icon,
|
|
430
|
-
outline: true,
|
|
431
|
-
onClick: ($event) => _ctx.dispatchEvent(action.label, element)
|
|
432
|
-
}, null, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true)
|
|
433
|
-
], 64);
|
|
434
|
-
}), 256)),
|
|
435
|
-
_ctx.showDelete ? (vue.openBlock(), vue.createBlock(_component_Btn, {
|
|
436
|
-
key: 0,
|
|
437
|
-
icon: _ctx.IconEnum.Delete,
|
|
438
|
-
outline: true,
|
|
439
|
-
onClick: ($event) => _ctx.deleteButtonClick(index)
|
|
440
|
-
}, null, 8, ["icon", "onClick"])) : vue.createCommentVNode("", true)
|
|
441
|
-
])
|
|
442
|
-
])
|
|
457
|
+
];
|
|
458
|
+
const _hoisted_1$7 = { class: "flex flex-col gap-4" };
|
|
459
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
460
|
+
__name: "CollapseLayout",
|
|
461
|
+
props: { ...vue$1.rendererProps() },
|
|
462
|
+
setup(__props) {
|
|
463
|
+
const props = __props;
|
|
464
|
+
const jsonLayout = vue$1.useJsonFormsLayout(props);
|
|
465
|
+
const { layout, renderers, cells } = jsonLayout;
|
|
466
|
+
const title = vue.computed(() => {
|
|
467
|
+
const { titleKey, title: title2 } = layout?.value.uischema?.options ?? {};
|
|
468
|
+
if (title2) return title2;
|
|
469
|
+
if (titleKey) return layout?.value.data[titleKey];
|
|
470
|
+
return layout?.value.uischema?.options?.titleKey;
|
|
471
|
+
});
|
|
472
|
+
return (_ctx, _cache) => {
|
|
473
|
+
return vue.openBlock(), vue.createBlock(vue.unref(ui.Collapse), { title: title.value }, {
|
|
474
|
+
default: vue.withCtx(() => [
|
|
475
|
+
vue.createElementVNode("div", _hoisted_1$7, [
|
|
476
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(layout).uischema.elements, (element, index) => {
|
|
477
|
+
return vue.openBlock(), vue.createBlock(vue.unref(vue$1.DispatchRenderer), {
|
|
478
|
+
key: index,
|
|
479
|
+
schema: vue.unref(layout).schema,
|
|
480
|
+
uischema: element,
|
|
481
|
+
path: vue.unref(layout).path,
|
|
482
|
+
renderers: vue.unref(renderers),
|
|
483
|
+
cells: vue.unref(cells)
|
|
484
|
+
}, null, 8, ["schema", "uischema", "path", "renderers", "cells"]);
|
|
485
|
+
}), 128))
|
|
443
486
|
])
|
|
444
|
-
])
|
|
445
|
-
}), 128))
|
|
446
|
-
]),
|
|
447
|
-
vue.createElementVNode("div", _hoisted_4$1, [
|
|
448
|
-
vue.createVNode(_component_Btn, {
|
|
449
|
-
icon: _ctx.IconEnum.Plus,
|
|
450
|
-
outline: true,
|
|
451
|
-
onClick: _ctx.addButtonClick
|
|
452
|
-
}, {
|
|
453
|
-
default: vue.withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
454
|
-
vue.createTextVNode(" Add ", -1)
|
|
455
|
-
])]),
|
|
487
|
+
]),
|
|
456
488
|
_: 1
|
|
457
|
-
}, 8, ["
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
489
|
+
}, 8, ["title"]);
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
const _hoisted_1$6 = { class: "flex flex-row gap-4 items-center" };
|
|
494
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
495
|
+
__name: "HorizontalLayout",
|
|
496
|
+
props: { ...vue$1.rendererProps() },
|
|
497
|
+
setup(__props) {
|
|
498
|
+
const props = __props;
|
|
499
|
+
const { layout, renderers, cells } = vue$1.useJsonFormsLayout(props);
|
|
500
|
+
return (_ctx, _cache) => {
|
|
501
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
502
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(layout).uischema.elements, (element, index) => {
|
|
503
|
+
return vue.openBlock(), vue.createBlock(vue.unref(vue$1.DispatchRenderer), {
|
|
504
|
+
key: index,
|
|
505
|
+
schema: vue.unref(layout).schema,
|
|
506
|
+
uischema: element,
|
|
507
|
+
path: vue.unref(layout).path,
|
|
508
|
+
renderers: vue.unref(renderers),
|
|
509
|
+
cells: vue.unref(cells)
|
|
510
|
+
}, null, 8, ["schema", "uischema", "path", "renderers", "cells"]);
|
|
511
|
+
}), 128))
|
|
512
|
+
]);
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
const _hoisted_1$5 = { class: "flex flex-col gap-4" };
|
|
517
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
518
|
+
__name: "VerticalLayout",
|
|
519
|
+
props: { ...vue$1.rendererProps() },
|
|
520
|
+
setup(__props) {
|
|
521
|
+
const props = __props;
|
|
522
|
+
const { layout, renderers, cells } = vue$1.useJsonFormsLayout(props);
|
|
523
|
+
return (_ctx, _cache) => {
|
|
524
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
525
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(layout).uischema.elements, (element, index) => {
|
|
526
|
+
return vue.openBlock(), vue.createBlock(vue.unref(vue$1.DispatchRenderer), {
|
|
527
|
+
key: index,
|
|
528
|
+
schema: vue.unref(layout).schema,
|
|
529
|
+
uischema: element,
|
|
530
|
+
path: vue.unref(layout).path,
|
|
531
|
+
renderers: vue.unref(renderers),
|
|
532
|
+
cells: vue.unref(cells)
|
|
533
|
+
}, null, 8, ["schema", "uischema", "path", "renderers", "cells"]);
|
|
534
|
+
}), 128))
|
|
535
|
+
]);
|
|
536
|
+
};
|
|
499
537
|
}
|
|
500
538
|
});
|
|
501
|
-
const entry = {
|
|
502
|
-
renderer: controlRenderer,
|
|
503
|
-
tester: core.rankWith(2, isFixedArray)
|
|
504
|
-
};
|
|
505
|
-
const _hoisted_1$5 = { class: "fieldset" };
|
|
506
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
507
|
-
const _component_dispatch_renderer = vue.resolveComponent("dispatch-renderer");
|
|
508
|
-
return _ctx.control.visible ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
509
|
-
key: 0,
|
|
510
|
-
class: vue.normalizeClass(_ctx.styles.arrayList.root)
|
|
511
|
-
}, [
|
|
512
|
-
!_ctx.labelKey ? (vue.openBlock(), vue.createElementBlock("legend", {
|
|
513
|
-
key: 0,
|
|
514
|
-
class: vue.normalizeClass(_ctx.styles.arrayList.legend)
|
|
515
|
-
}, [
|
|
516
|
-
vue.createElementVNode("label", {
|
|
517
|
-
class: vue.normalizeClass(_ctx.styles.arrayList.label)
|
|
518
|
-
}, vue.toDisplayString(_ctx.control.label), 3)
|
|
519
|
-
], 2)) : vue.createCommentVNode("", true),
|
|
520
|
-
vue.createElementVNode("div", {
|
|
521
|
-
class: vue.normalizeClass(_ctx.styles.fixedArrayList.root)
|
|
522
|
-
}, [
|
|
523
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.control.data, (element, index) => {
|
|
524
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
525
|
-
key: `${_ctx.control.path}-${index}`,
|
|
526
|
-
class: vue.normalizeClass(_ctx.styles.fixedArrayList.item)
|
|
527
|
-
}, [
|
|
528
|
-
vue.createElementVNode("fieldset", _hoisted_1$5, [
|
|
529
|
-
_ctx.labelKey ? (vue.openBlock(), vue.createElementBlock("legend", {
|
|
530
|
-
key: 0,
|
|
531
|
-
class: vue.normalizeClass(_ctx.styles.arrayList.legend)
|
|
532
|
-
}, vue.toDisplayString(element[_ctx.labelKey]?.toLowerCase()), 3)) : vue.createCommentVNode("", true),
|
|
533
|
-
vue.createVNode(_component_dispatch_renderer, {
|
|
534
|
-
schema: _ctx.control.schema,
|
|
535
|
-
uischema: _ctx.childUiSchema,
|
|
536
|
-
path: _ctx.composePaths(_ctx.control.path, `${index}`),
|
|
537
|
-
enabled: _ctx.control.enabled,
|
|
538
|
-
renderers: _ctx.control.renderers,
|
|
539
|
-
cells: _ctx.control.cells
|
|
540
|
-
}, null, 8, ["schema", "uischema", "path", "enabled", "renderers", "cells"])
|
|
541
|
-
])
|
|
542
|
-
], 2);
|
|
543
|
-
}), 128))
|
|
544
|
-
], 2),
|
|
545
|
-
_ctx.noData ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
546
|
-
key: 1,
|
|
547
|
-
class: vue.normalizeClass(_ctx.styles.arrayList.noData)
|
|
548
|
-
}, vue.toDisplayString(_ctx.translations.noDataMessage), 3)) : vue.createCommentVNode("", true)
|
|
549
|
-
], 2)) : vue.createCommentVNode("", true);
|
|
550
|
-
}
|
|
551
|
-
const FixedArrayRenderer = /* @__PURE__ */ _export_sfc(controlRenderer, [["render", _sfc_render]]);
|
|
552
|
-
const arrayRenderers = [
|
|
553
|
-
entry,
|
|
554
|
-
entry$1
|
|
555
|
-
];
|
|
556
539
|
const layoutRenderers = [
|
|
557
|
-
|
|
540
|
+
{
|
|
541
|
+
tester: core.rankWith(10, core.uiTypeIs(jsonFormsCore.LayoutTypes.VerticalLayout)),
|
|
542
|
+
renderer: _sfc_main$6
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
tester: core.rankWith(10, core.uiTypeIs(jsonFormsCore.LayoutTypes.HorizontalLayout)),
|
|
546
|
+
renderer: _sfc_main$7
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
tester: core.rankWith(10, core.uiTypeIs(jsonFormsCore.LayoutTypes.CollapseLayout)),
|
|
550
|
+
renderer: _sfc_main$8
|
|
551
|
+
}
|
|
558
552
|
];
|
|
559
553
|
const _hoisted_1$4 = { class: "" };
|
|
560
554
|
const _hoisted_2$1 = { class: "flex gap-2 items-center mb-2" };
|
|
561
|
-
const _hoisted_3
|
|
555
|
+
const _hoisted_3 = { class: "flex gap-2" };
|
|
562
556
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
563
557
|
__name: "table-filter",
|
|
564
558
|
props: {
|
|
@@ -602,7 +596,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
602
596
|
_: 1
|
|
603
597
|
})) : vue.createCommentVNode("", true)
|
|
604
598
|
]),
|
|
605
|
-
vue.createElementVNode("div", _hoisted_3
|
|
599
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
606
600
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.filters, (filter) => {
|
|
607
601
|
return vue.openBlock(), vue.createBlock(vue.unref(ui.BtnBadge), {
|
|
608
602
|
key: filter.key,
|
|
@@ -932,12 +926,12 @@ const customRenderers = [
|
|
|
932
926
|
const customRenderesName = customRenderers.map((c) => {
|
|
933
927
|
return c.renderer.name;
|
|
934
928
|
});
|
|
935
|
-
|
|
929
|
+
vueVanilla.vanillaRenderers.filter(
|
|
936
930
|
(v) => !customRenderesName.includes(v.renderer.name)
|
|
937
931
|
);
|
|
938
932
|
const tailwindRenderers = [
|
|
939
|
-
...
|
|
940
|
-
...
|
|
933
|
+
...vueVanilla.vanillaRenderers,
|
|
934
|
+
...customRenderers
|
|
941
935
|
];
|
|
942
936
|
const _hoisted_1$1 = ["id"];
|
|
943
937
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -953,7 +947,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
953
947
|
"modelValue": {},
|
|
954
948
|
"modelModifiers": {}
|
|
955
949
|
}),
|
|
956
|
-
emits: /* @__PURE__ */ vue.mergeModels(["valid", "change", "submit"], ["update:modelValue"]),
|
|
950
|
+
emits: /* @__PURE__ */ vue.mergeModels(["valid", "change", "submit", "errors"], ["update:modelValue"]),
|
|
957
951
|
setup(__props, { emit: __emit }) {
|
|
958
952
|
const properties = __props;
|
|
959
953
|
const _JSON_FORM_ID = `json-form-${Date.now()}`;
|
|
@@ -966,6 +960,8 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
966
960
|
valid.value = event.errors.length === 0;
|
|
967
961
|
emits("valid", valid.value);
|
|
968
962
|
emits("change", event.data);
|
|
963
|
+
emits("errors", event.errors);
|
|
964
|
+
toolsVue.Debugger.debug(event.errors);
|
|
969
965
|
};
|
|
970
966
|
const onSubmit = (event) => {
|
|
971
967
|
event.preventDefault();
|
|
@@ -1006,10 +1002,8 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1006
1002
|
};
|
|
1007
1003
|
}
|
|
1008
1004
|
});
|
|
1009
|
-
const _hoisted_1 = { class: "card
|
|
1010
|
-
const _hoisted_2 = { class: "
|
|
1011
|
-
const _hoisted_3 = { class: "card-title" };
|
|
1012
|
-
const _hoisted_4 = { class: "card-actions flex justify-end" };
|
|
1005
|
+
const _hoisted_1 = { class: "card-actions flex justify-between" };
|
|
1006
|
+
const _hoisted_2 = { class: "flex justify-end gap-2" };
|
|
1013
1007
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
1014
1008
|
__name: "form-with-actions.component",
|
|
1015
1009
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
@@ -1026,23 +1020,33 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1026
1020
|
const properties = __props;
|
|
1027
1021
|
const valid = vue.ref(false);
|
|
1028
1022
|
const formData = vue.useModel(__props, "modelValue");
|
|
1023
|
+
const submitted = vue.ref(false);
|
|
1029
1024
|
const store = new FormStore(properties.formSchema);
|
|
1030
1025
|
const emits = __emit;
|
|
1031
1026
|
const save = () => {
|
|
1027
|
+
submitted.value = true;
|
|
1028
|
+
if (!valid.value) {
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1032
1031
|
store.save(formData.value.id, formData.value).then(() => {
|
|
1033
1032
|
emits("success");
|
|
1034
1033
|
});
|
|
1035
1034
|
};
|
|
1036
1035
|
const clear = () => {
|
|
1037
1036
|
formData.value = { id: null };
|
|
1037
|
+
submitted.value = false;
|
|
1038
1038
|
};
|
|
1039
1039
|
const onValid = (v) => {
|
|
1040
|
+
submitted.value = false;
|
|
1040
1041
|
valid.value = v;
|
|
1041
1042
|
};
|
|
1043
|
+
const title = vue.computed(() => {
|
|
1044
|
+
if (!properties.updateTitle) return properties.createTitle;
|
|
1045
|
+
return formData.value?.id ? properties.updateTitle : properties.createTitle;
|
|
1046
|
+
});
|
|
1042
1047
|
return (_ctx, _cache) => {
|
|
1043
|
-
return vue.openBlock(), vue.
|
|
1044
|
-
vue.
|
|
1045
|
-
vue.createElementVNode("h1", _hoisted_3, vue.toDisplayString(formData.value?.id ? __props.updateTitle : __props.createTitle), 1),
|
|
1048
|
+
return vue.openBlock(), vue.createBlock(vue.unref(ui.Collapse), { title: title.value }, {
|
|
1049
|
+
default: vue.withCtx(() => [
|
|
1046
1050
|
vue.createVNode(_sfc_main$2, {
|
|
1047
1051
|
id: `form_${properties.id}`,
|
|
1048
1052
|
modelValue: formData.value,
|
|
@@ -1052,29 +1056,41 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1052
1056
|
onValid: _cache[1] || (_cache[1] = ($event) => onValid($event)),
|
|
1053
1057
|
onSubmit: save
|
|
1054
1058
|
}, null, 8, ["id", "modelValue", "schema", "uischema"]),
|
|
1055
|
-
vue.createElementVNode("div",
|
|
1056
|
-
vue.
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1059
|
+
vue.createElementVNode("div", _hoisted_1, [
|
|
1060
|
+
vue.createElementVNode("div", null, [
|
|
1061
|
+
!valid.value && submitted.value ? (vue.openBlock(), vue.createBlock(vue.unref(ui.Alert), {
|
|
1062
|
+
key: 0,
|
|
1063
|
+
message: "The form is not valid",
|
|
1064
|
+
type: "error"
|
|
1065
|
+
})) : vue.createCommentVNode("", true)
|
|
1066
|
+
]),
|
|
1067
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
1068
|
+
vue.renderSlot(_ctx.$slots, "actions"),
|
|
1069
|
+
!formData.value.id ? (vue.openBlock(), vue.createBlock(vue.unref(ui.Btn), {
|
|
1070
|
+
key: 0,
|
|
1071
|
+
outline: true,
|
|
1072
|
+
onClick: clear
|
|
1073
|
+
}, {
|
|
1074
|
+
default: vue.withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
1075
|
+
vue.createTextVNode(" Clear ", -1)
|
|
1076
|
+
])]),
|
|
1077
|
+
_: 1
|
|
1078
|
+
})) : vue.createCommentVNode("", true),
|
|
1079
|
+
vue.createVNode(vue.unref(ui.Btn), {
|
|
1080
|
+
color: vue.unref(ui.Color).primary,
|
|
1081
|
+
disabled: submitted.value,
|
|
1082
|
+
onClick: save
|
|
1083
|
+
}, {
|
|
1084
|
+
default: vue.withCtx(() => [..._cache[3] || (_cache[3] = [
|
|
1085
|
+
vue.createTextVNode(" Save ", -1)
|
|
1086
|
+
])]),
|
|
1087
|
+
_: 1
|
|
1088
|
+
}, 8, ["color", "disabled"])
|
|
1089
|
+
])
|
|
1075
1090
|
])
|
|
1076
|
-
])
|
|
1077
|
-
|
|
1091
|
+
]),
|
|
1092
|
+
_: 3
|
|
1093
|
+
}, 8, ["title"]);
|
|
1078
1094
|
};
|
|
1079
1095
|
}
|
|
1080
1096
|
});
|
|
@@ -1199,7 +1215,7 @@ const createRepository = (formSchemaModel, httpRequest, options = {}) => {
|
|
|
1199
1215
|
const create = (object, options2) => {
|
|
1200
1216
|
return httpRequest.post(getDataUri(), object, options2).then((response) => {
|
|
1201
1217
|
handleSuccess(`Created ${notificationEntity}`);
|
|
1202
|
-
return response;
|
|
1218
|
+
return response.data;
|
|
1203
1219
|
}).catch((response) => {
|
|
1204
1220
|
handleError(response, `Failed to create ${notificationEntity}`);
|
|
1205
1221
|
});
|
|
@@ -1207,13 +1223,17 @@ const createRepository = (formSchemaModel, httpRequest, options = {}) => {
|
|
|
1207
1223
|
const patch = (id, object, options2) => {
|
|
1208
1224
|
return httpRequest.patch(getDataUri(id), object, options2).then((response) => {
|
|
1209
1225
|
handleSuccess(`Saved ${notificationEntity}`);
|
|
1210
|
-
return response;
|
|
1226
|
+
return response.data;
|
|
1211
1227
|
}).catch((response) => {
|
|
1212
1228
|
handleError(response, `Failed to save ${notificationEntity}`);
|
|
1213
1229
|
});
|
|
1214
1230
|
};
|
|
1215
1231
|
const get = (id, options2) => {
|
|
1216
|
-
return httpRequest.get(getDataUri(id), options2)
|
|
1232
|
+
return httpRequest.get(getDataUri(id), options2).then((response) => {
|
|
1233
|
+
return response.data;
|
|
1234
|
+
}).catch((response) => {
|
|
1235
|
+
handleError(response, `Failed to load data`);
|
|
1236
|
+
});
|
|
1217
1237
|
};
|
|
1218
1238
|
const _delete = (id, options2) => {
|
|
1219
1239
|
return httpRequest.delete(getDataUri(id), options2).then((response) => {
|
|
@@ -1228,26 +1248,25 @@ const createRepository = (formSchemaModel, httpRequest, options = {}) => {
|
|
|
1228
1248
|
objects.map((object) => httpRequest.post(getDataUri(), object, options2))
|
|
1229
1249
|
).then((response) => {
|
|
1230
1250
|
handleSuccess(`Created ${notificationEntity}`);
|
|
1231
|
-
return response;
|
|
1251
|
+
return response.data;
|
|
1232
1252
|
}).catch((response) => {
|
|
1233
1253
|
handleError(response, `Failed to save ${notificationEntity}`);
|
|
1234
1254
|
});
|
|
1235
1255
|
};
|
|
1236
1256
|
return { create, patch, createMulti, delete: _delete, get };
|
|
1237
1257
|
};
|
|
1238
|
-
exports.ArrayRenderer =
|
|
1239
|
-
exports.AutocompleteControlRenderer = _sfc_main$
|
|
1240
|
-
exports.BooleanControlRenderer = _sfc_main$
|
|
1241
|
-
exports.FixedArrayRenderer = FixedArrayRenderer;
|
|
1258
|
+
exports.ArrayRenderer = _sfc_main$9;
|
|
1259
|
+
exports.AutocompleteControlRenderer = _sfc_main$a;
|
|
1260
|
+
exports.BooleanControlRenderer = _sfc_main$g;
|
|
1242
1261
|
exports.FormComponent = _sfc_main$2;
|
|
1243
1262
|
exports.FormModal = _sfc_main;
|
|
1244
1263
|
exports.FormModalService = FormModalService;
|
|
1245
1264
|
exports.FormStore = FormStore;
|
|
1246
1265
|
exports.FormWithActions = _sfc_main$1;
|
|
1247
1266
|
exports.FormWithTableComponent = _sfc_main$3;
|
|
1248
|
-
exports.IntegerControlRenderer = _sfc_main$
|
|
1249
|
-
exports.NumberControlRenderer = _sfc_main$
|
|
1250
|
-
exports.StringControlRenderer = _sfc_main$
|
|
1267
|
+
exports.IntegerControlRenderer = _sfc_main$f;
|
|
1268
|
+
exports.NumberControlRenderer = _sfc_main$d;
|
|
1269
|
+
exports.StringControlRenderer = _sfc_main$c;
|
|
1251
1270
|
exports.TableComponent = _sfc_main$4;
|
|
1252
1271
|
exports.arrayRenderers = arrayRenderers;
|
|
1253
1272
|
exports.controlRenderers = controlRenderers;
|
|
@@ -1255,10 +1274,9 @@ exports.createRepository = createRepository;
|
|
|
1255
1274
|
exports.isArrayRenderer = isArrayRenderer;
|
|
1256
1275
|
exports.isAutoCompleteControl = isAutoCompleteControl;
|
|
1257
1276
|
exports.isCustomControl = isCustomControl;
|
|
1258
|
-
exports.isFixedArray = isFixedArray;
|
|
1259
1277
|
exports.isMarkdownControl = isMarkdownControl;
|
|
1260
1278
|
exports.isStringFormat = isStringFormat;
|
|
1261
1279
|
exports.isTextAreaControl = isTextAreaControl;
|
|
1262
1280
|
exports.layoutRenderers = layoutRenderers;
|
|
1263
|
-
exports.markdownControlRenderer = _sfc_main$
|
|
1281
|
+
exports.markdownControlRenderer = _sfc_main$e;
|
|
1264
1282
|
exports.useFormState = useFormState;
|