@ghentcdh/json-forms-vue 0.6.0 → 0.6.5
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 +50 -63
- package/index.mjs +52 -65
- package/package.json +27 -4
- package/renderes/controls/BooleanControlRenderer.vue.d.ts +6 -6
- package/renderes/controls/IntegerControlRenderer.vue.d.ts +6 -6
- package/renderes/controls/MarkdownControlRenderer.vue.d.ts +19 -46
- package/renderes/controls/NumberControlRenderer.vue.d.ts +6 -6
- package/renderes/controls/StringControlRenderer.vue.d.ts +6 -6
- package/renderes/controls/TextAreaControlRenderer.vue.d.ts +6 -6
- package/renderes/controls/autocomplete/AutocompleteControlRenderer.vue.d.ts +2 -2
- package/repository/crud.repository.d.ts +1 -1
- package/table/table.store.d.ts +8 -15
- package/index.css +0 -1597
package/index.js
CHANGED
|
@@ -6,7 +6,6 @@ const core = require("@jsonforms/core");
|
|
|
6
6
|
const vue$1 = require("@jsonforms/vue");
|
|
7
7
|
const vue = require("vue");
|
|
8
8
|
const vueVanilla = require("@jsonforms/vue-vanilla");
|
|
9
|
-
const MdEditor = require("@toast-ui/editor");
|
|
10
9
|
const testers = require("@jsonforms/core/src/testers/testers");
|
|
11
10
|
const jsonFormsCore = require("@ghentcdh/json-forms-core");
|
|
12
11
|
const vueRouter = require("vue-router");
|
|
@@ -102,13 +101,13 @@ const _export_sfc = (sfc, props) => {
|
|
|
102
101
|
}
|
|
103
102
|
return target;
|
|
104
103
|
};
|
|
105
|
-
const _hoisted_1$
|
|
104
|
+
const _hoisted_1$a = { class: "flex justify-around flex-col h-full" };
|
|
106
105
|
const _hoisted_2$3 = { class: "fieldset-label" };
|
|
107
106
|
const _hoisted_3$3 = ["id", "checked", "disabled", "autofocus", "placeholder"];
|
|
108
107
|
const _hoisted_4$2 = { class: "font-bold text-gray-500 text-sm" };
|
|
109
108
|
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
110
109
|
const _component_control_wrapper = vue.resolveComponent("control-wrapper");
|
|
111
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
110
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
112
111
|
vue.createVNode(_component_control_wrapper, vue.mergeProps(_ctx.controlWrapper, {
|
|
113
112
|
styles: _ctx.styles,
|
|
114
113
|
"hide-label": true
|
|
@@ -177,7 +176,7 @@ const entry$7 = {
|
|
|
177
176
|
renderer: controlRenderer$7,
|
|
178
177
|
tester: core.rankWith(1, core.isIntegerControl)
|
|
179
178
|
};
|
|
180
|
-
const _hoisted_1$
|
|
179
|
+
const _hoisted_1$9 = ["id", "step", "value", "disabled", "autofocus", "placeholder"];
|
|
181
180
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
182
181
|
const _component_control_wrapper = vue.resolveComponent("control-wrapper");
|
|
183
182
|
return vue.openBlock(), vue.createBlock(_component_control_wrapper, vue.mergeProps(_ctx.controlWrapper, { styles: _ctx.styles }), {
|
|
@@ -195,7 +194,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
195
194
|
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
196
195
|
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
197
196
|
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
198
|
-
}, null, 42, _hoisted_1$
|
|
197
|
+
}, null, 42, _hoisted_1$9)
|
|
199
198
|
]),
|
|
200
199
|
_: 1
|
|
201
200
|
}, 16, ["styles"]);
|
|
@@ -234,51 +233,39 @@ const isCustomControl = (customType) => {
|
|
|
234
233
|
const controlRenderer$6 = vue.defineComponent({
|
|
235
234
|
name: "MarkdownControlRenderer",
|
|
236
235
|
components: {
|
|
237
|
-
|
|
236
|
+
Markdown: ui.Markdown
|
|
238
237
|
},
|
|
239
238
|
props: {
|
|
240
239
|
...vue$1.rendererProps()
|
|
241
240
|
},
|
|
242
|
-
setup(props
|
|
241
|
+
setup(props) {
|
|
243
242
|
const control = useVanillaControlCustom(
|
|
244
243
|
vue$1.useJsonFormsControl(props),
|
|
245
|
-
(target) => target.value
|
|
244
|
+
(target) => target.value ?? void 0
|
|
246
245
|
);
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
const { path
|
|
250
|
-
|
|
251
|
-
el: document.getElementById(mdId),
|
|
252
|
-
height: "500px",
|
|
253
|
-
initialEditType: "wysiwyg",
|
|
254
|
-
initialValue: data ?? "",
|
|
255
|
-
toolbarItems: [["bold", "italic", "strike"]],
|
|
256
|
-
events: {
|
|
257
|
-
change: () => {
|
|
258
|
-
control.handleChange(path, editor.getMarkdown());
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
return {
|
|
264
|
-
...control,
|
|
265
|
-
mdId
|
|
246
|
+
const field = control.appliedOptions.value.field;
|
|
247
|
+
const handleChange = (result) => {
|
|
248
|
+
const { path } = control.control.value;
|
|
249
|
+
control.handleChange(path, result);
|
|
266
250
|
};
|
|
251
|
+
return { ...control, field, handleChange };
|
|
267
252
|
}
|
|
268
253
|
});
|
|
269
254
|
const entry$6 = {
|
|
270
255
|
renderer: controlRenderer$6,
|
|
271
256
|
tester: core.rankWith(1, isMarkdownControl)
|
|
272
257
|
};
|
|
273
|
-
const _hoisted_1$9 = ["id"];
|
|
274
258
|
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
275
|
-
const
|
|
276
|
-
return vue.openBlock(), vue.createBlock(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
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"]);
|
|
282
269
|
}
|
|
283
270
|
const MarkdownControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$6, [["render", _sfc_render$5]]);
|
|
284
271
|
const controlRenderer$5 = vue.defineComponent({
|
|
@@ -830,14 +817,29 @@ class TableStore {
|
|
|
830
817
|
console.error(error);
|
|
831
818
|
return { data: [], request: { totalPages: 1, page: 1 } };
|
|
832
819
|
}).finally(() => this.loading.value = false);
|
|
833
|
-
|
|
834
|
-
|
|
820
|
+
const data = response.data;
|
|
821
|
+
if (data.request.totalPages < data.request.page) {
|
|
822
|
+
this.updateRequest({ page: data.request.totalPages });
|
|
835
823
|
}
|
|
836
|
-
return
|
|
824
|
+
return data;
|
|
825
|
+
});
|
|
826
|
+
this.pageData = vue.computed(() => {
|
|
827
|
+
const request = this.data.value?.request ?? {
|
|
828
|
+
count: 0,
|
|
829
|
+
pageSize: 1,
|
|
830
|
+
page: 1
|
|
831
|
+
};
|
|
832
|
+
return {
|
|
833
|
+
count: request.count,
|
|
834
|
+
pageSize: request.pageSize,
|
|
835
|
+
page: request.page
|
|
836
|
+
};
|
|
837
837
|
});
|
|
838
838
|
this.tableData = vue.computed(() => {
|
|
839
839
|
const d = this.data.value;
|
|
840
|
-
|
|
840
|
+
if (!d) return [];
|
|
841
|
+
if (this.loading.value) return [];
|
|
842
|
+
return d.data ?? [];
|
|
841
843
|
});
|
|
842
844
|
this.init = (url) => {
|
|
843
845
|
this.uri.value = url;
|
|
@@ -927,11 +929,11 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
927
929
|
},
|
|
928
930
|
{ immediate: true }
|
|
929
931
|
);
|
|
930
|
-
const edit = (
|
|
931
|
-
emit("edit",
|
|
932
|
+
const edit = (data) => {
|
|
933
|
+
emit("edit", data);
|
|
932
934
|
};
|
|
933
|
-
const deleteFn = (
|
|
934
|
-
emit("delete",
|
|
935
|
+
const deleteFn = (data) => {
|
|
936
|
+
emit("delete", data);
|
|
935
937
|
};
|
|
936
938
|
const components = {
|
|
937
939
|
TextCell: ui.TextCell
|
|
@@ -959,8 +961,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
959
961
|
const onChangeFilters = (filters) => {
|
|
960
962
|
store.updateFilters(filters);
|
|
961
963
|
};
|
|
962
|
-
const onUpdatePage = (
|
|
963
|
-
store.updatePage(
|
|
964
|
+
const onUpdatePage = (page) => {
|
|
965
|
+
store.updatePage(page);
|
|
964
966
|
};
|
|
965
967
|
const onSort = (id) => {
|
|
966
968
|
store.sort(id);
|
|
@@ -968,21 +970,6 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
968
970
|
const sort = vue.computed(() => {
|
|
969
971
|
return store.sorting.value ?? { orderBy: "", ascending: 1 };
|
|
970
972
|
});
|
|
971
|
-
const page = vue.computed(() => {
|
|
972
|
-
const request = store.data.value?.request ?? {
|
|
973
|
-
count: 0,
|
|
974
|
-
pageSize: 1,
|
|
975
|
-
page: 1
|
|
976
|
-
};
|
|
977
|
-
return {
|
|
978
|
-
count: request.count,
|
|
979
|
-
pageSize: request.pageSize,
|
|
980
|
-
page: request.page
|
|
981
|
-
};
|
|
982
|
-
});
|
|
983
|
-
const data = vue.computed(() => {
|
|
984
|
-
return store.data.value?.data ?? [];
|
|
985
|
-
});
|
|
986
973
|
return (_ctx, _cache) => {
|
|
987
974
|
return vue.openBlock(), vue.createElementBlock("div", null, [
|
|
988
975
|
__props.filterLayout ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
@@ -997,9 +984,9 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
997
984
|
vue.createVNode(vue.unref(ui.Table), {
|
|
998
985
|
"display-columns": displayColumns.value,
|
|
999
986
|
sort: sort.value,
|
|
1000
|
-
page:
|
|
987
|
+
page: vue.unref(store).pageData.value,
|
|
1001
988
|
loading: vue.unref(store).loading.value,
|
|
1002
|
-
data:
|
|
989
|
+
data: vue.unref(store).tableData.value,
|
|
1003
990
|
actions: __props.actions,
|
|
1004
991
|
onUpdatePage,
|
|
1005
992
|
onDelete: deleteFn,
|
|
@@ -1047,7 +1034,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1047
1034
|
};
|
|
1048
1035
|
const deleteFn = (data) => {
|
|
1049
1036
|
ui.ModalService.showConfirm({
|
|
1050
|
-
title: "Delete
|
|
1037
|
+
title: "Delete record",
|
|
1051
1038
|
message: "Are you sure to delete, the data will be lost?",
|
|
1052
1039
|
onClose: (result) => {
|
|
1053
1040
|
if (result.confirmed) {
|
package/index.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { useApi } from "@ghentcdh/tools-vue";
|
|
2
|
-
import { NotificationService, ControlWrapper, Autocomplete, IconEnum, Btn, BtnBadge, TextCell, Table, hasCustomEventListener, Card, ModalService, myStyles, Color, Modal } from "@ghentcdh/ui";
|
|
2
|
+
import { NotificationService, ControlWrapper, Markdown, Autocomplete, IconEnum, Btn, BtnBadge, TextCell, Table, hasCustomEventListener, Card, ModalService, myStyles, Color, Modal } from "@ghentcdh/ui";
|
|
3
3
|
import { rankWith, isBooleanControl, isIntegerControl, uiTypeIs, isNumberControl, createDefaultValue, composePaths, getArrayTranslations, defaultJsonFormsI18nState, arrayDefaultTranslations } from "@jsonforms/core";
|
|
4
4
|
import { useJsonFormsControl, rendererProps, DispatchRenderer, useJsonFormsArrayControl, JsonForms } from "@jsonforms/vue";
|
|
5
|
-
import { ref, computed, defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, mergeProps, withCtx, createElementVNode, normalizeClass, toDisplayString, createBlock,
|
|
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
|
-
import MdEditor from "@toast-ui/editor";
|
|
8
7
|
import { and, optionIs, or, schemaTypeIs } from "@jsonforms/core/src/testers/testers";
|
|
9
8
|
import { ControlType, RequestSchema, extractFilters, findColumnDef } from "@ghentcdh/json-forms-core";
|
|
10
9
|
import { useRouter, useRoute } from "vue-router";
|
|
@@ -100,13 +99,13 @@ const _export_sfc = (sfc, props) => {
|
|
|
100
99
|
}
|
|
101
100
|
return target;
|
|
102
101
|
};
|
|
103
|
-
const _hoisted_1$
|
|
102
|
+
const _hoisted_1$a = { class: "flex justify-around flex-col h-full" };
|
|
104
103
|
const _hoisted_2$3 = { class: "fieldset-label" };
|
|
105
104
|
const _hoisted_3$3 = ["id", "checked", "disabled", "autofocus", "placeholder"];
|
|
106
105
|
const _hoisted_4$2 = { class: "font-bold text-gray-500 text-sm" };
|
|
107
106
|
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
108
107
|
const _component_control_wrapper = resolveComponent("control-wrapper");
|
|
109
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
108
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
110
109
|
createVNode(_component_control_wrapper, mergeProps(_ctx.controlWrapper, {
|
|
111
110
|
styles: _ctx.styles,
|
|
112
111
|
"hide-label": true
|
|
@@ -175,7 +174,7 @@ const entry$7 = {
|
|
|
175
174
|
renderer: controlRenderer$7,
|
|
176
175
|
tester: rankWith(1, isIntegerControl)
|
|
177
176
|
};
|
|
178
|
-
const _hoisted_1$
|
|
177
|
+
const _hoisted_1$9 = ["id", "step", "value", "disabled", "autofocus", "placeholder"];
|
|
179
178
|
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
180
179
|
const _component_control_wrapper = resolveComponent("control-wrapper");
|
|
181
180
|
return openBlock(), createBlock(_component_control_wrapper, mergeProps(_ctx.controlWrapper, { styles: _ctx.styles }), {
|
|
@@ -193,7 +192,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
193
192
|
onChange: _cache[0] || (_cache[0] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
194
193
|
onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
|
|
195
194
|
onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.onBlur && _ctx.onBlur(...args))
|
|
196
|
-
}, null, 42, _hoisted_1$
|
|
195
|
+
}, null, 42, _hoisted_1$9)
|
|
197
196
|
]),
|
|
198
197
|
_: 1
|
|
199
198
|
}, 16, ["styles"]);
|
|
@@ -232,51 +231,39 @@ const isCustomControl = (customType) => {
|
|
|
232
231
|
const controlRenderer$6 = defineComponent({
|
|
233
232
|
name: "MarkdownControlRenderer",
|
|
234
233
|
components: {
|
|
235
|
-
|
|
234
|
+
Markdown
|
|
236
235
|
},
|
|
237
236
|
props: {
|
|
238
237
|
...rendererProps()
|
|
239
238
|
},
|
|
240
|
-
setup(props
|
|
239
|
+
setup(props) {
|
|
241
240
|
const control = useVanillaControlCustom(
|
|
242
241
|
useJsonFormsControl(props),
|
|
243
|
-
(target) => target.value
|
|
242
|
+
(target) => target.value ?? void 0
|
|
244
243
|
);
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
const { path
|
|
248
|
-
|
|
249
|
-
el: document.getElementById(mdId),
|
|
250
|
-
height: "500px",
|
|
251
|
-
initialEditType: "wysiwyg",
|
|
252
|
-
initialValue: data ?? "",
|
|
253
|
-
toolbarItems: [["bold", "italic", "strike"]],
|
|
254
|
-
events: {
|
|
255
|
-
change: () => {
|
|
256
|
-
control.handleChange(path, editor.getMarkdown());
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
return {
|
|
262
|
-
...control,
|
|
263
|
-
mdId
|
|
244
|
+
const field = control.appliedOptions.value.field;
|
|
245
|
+
const handleChange = (result) => {
|
|
246
|
+
const { path } = control.control.value;
|
|
247
|
+
control.handleChange(path, result);
|
|
264
248
|
};
|
|
249
|
+
return { ...control, field, handleChange };
|
|
265
250
|
}
|
|
266
251
|
});
|
|
267
252
|
const entry$6 = {
|
|
268
253
|
renderer: controlRenderer$6,
|
|
269
254
|
tester: rankWith(1, isMarkdownControl)
|
|
270
255
|
};
|
|
271
|
-
const _hoisted_1$9 = ["id"];
|
|
272
256
|
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
273
|
-
const
|
|
274
|
-
return openBlock(), createBlock(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
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"]);
|
|
280
267
|
}
|
|
281
268
|
const MarkdownControlRenderer = /* @__PURE__ */ _export_sfc(controlRenderer$6, [["render", _sfc_render$5]]);
|
|
282
269
|
const controlRenderer$5 = defineComponent({
|
|
@@ -828,14 +815,29 @@ class TableStore {
|
|
|
828
815
|
console.error(error);
|
|
829
816
|
return { data: [], request: { totalPages: 1, page: 1 } };
|
|
830
817
|
}).finally(() => this.loading.value = false);
|
|
831
|
-
|
|
832
|
-
|
|
818
|
+
const data = response.data;
|
|
819
|
+
if (data.request.totalPages < data.request.page) {
|
|
820
|
+
this.updateRequest({ page: data.request.totalPages });
|
|
833
821
|
}
|
|
834
|
-
return
|
|
822
|
+
return data;
|
|
823
|
+
});
|
|
824
|
+
this.pageData = computed(() => {
|
|
825
|
+
const request = this.data.value?.request ?? {
|
|
826
|
+
count: 0,
|
|
827
|
+
pageSize: 1,
|
|
828
|
+
page: 1
|
|
829
|
+
};
|
|
830
|
+
return {
|
|
831
|
+
count: request.count,
|
|
832
|
+
pageSize: request.pageSize,
|
|
833
|
+
page: request.page
|
|
834
|
+
};
|
|
835
835
|
});
|
|
836
836
|
this.tableData = computed(() => {
|
|
837
837
|
const d = this.data.value;
|
|
838
|
-
|
|
838
|
+
if (!d) return [];
|
|
839
|
+
if (this.loading.value) return [];
|
|
840
|
+
return d.data ?? [];
|
|
839
841
|
});
|
|
840
842
|
this.init = (url) => {
|
|
841
843
|
this.uri.value = url;
|
|
@@ -925,11 +927,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
925
927
|
},
|
|
926
928
|
{ immediate: true }
|
|
927
929
|
);
|
|
928
|
-
const edit = (
|
|
929
|
-
emit("edit",
|
|
930
|
+
const edit = (data) => {
|
|
931
|
+
emit("edit", data);
|
|
930
932
|
};
|
|
931
|
-
const deleteFn = (
|
|
932
|
-
emit("delete",
|
|
933
|
+
const deleteFn = (data) => {
|
|
934
|
+
emit("delete", data);
|
|
933
935
|
};
|
|
934
936
|
const components = {
|
|
935
937
|
TextCell
|
|
@@ -957,8 +959,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
957
959
|
const onChangeFilters = (filters) => {
|
|
958
960
|
store.updateFilters(filters);
|
|
959
961
|
};
|
|
960
|
-
const onUpdatePage = (
|
|
961
|
-
store.updatePage(
|
|
962
|
+
const onUpdatePage = (page) => {
|
|
963
|
+
store.updatePage(page);
|
|
962
964
|
};
|
|
963
965
|
const onSort = (id) => {
|
|
964
966
|
store.sort(id);
|
|
@@ -966,21 +968,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
966
968
|
const sort = computed(() => {
|
|
967
969
|
return store.sorting.value ?? { orderBy: "", ascending: 1 };
|
|
968
970
|
});
|
|
969
|
-
const page = computed(() => {
|
|
970
|
-
const request = store.data.value?.request ?? {
|
|
971
|
-
count: 0,
|
|
972
|
-
pageSize: 1,
|
|
973
|
-
page: 1
|
|
974
|
-
};
|
|
975
|
-
return {
|
|
976
|
-
count: request.count,
|
|
977
|
-
pageSize: request.pageSize,
|
|
978
|
-
page: request.page
|
|
979
|
-
};
|
|
980
|
-
});
|
|
981
|
-
const data = computed(() => {
|
|
982
|
-
return store.data.value?.data ?? [];
|
|
983
|
-
});
|
|
984
971
|
return (_ctx, _cache) => {
|
|
985
972
|
return openBlock(), createElementBlock("div", null, [
|
|
986
973
|
__props.filterLayout ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
@@ -995,9 +982,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
995
982
|
createVNode(unref(Table), {
|
|
996
983
|
"display-columns": displayColumns.value,
|
|
997
984
|
sort: sort.value,
|
|
998
|
-
page:
|
|
985
|
+
page: unref(store).pageData.value,
|
|
999
986
|
loading: unref(store).loading.value,
|
|
1000
|
-
data:
|
|
987
|
+
data: unref(store).tableData.value,
|
|
1001
988
|
actions: __props.actions,
|
|
1002
989
|
onUpdatePage,
|
|
1003
990
|
onDelete: deleteFn,
|
|
@@ -1045,7 +1032,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1045
1032
|
};
|
|
1046
1033
|
const deleteFn = (data) => {
|
|
1047
1034
|
ModalService.showConfirm({
|
|
1048
|
-
title: "Delete
|
|
1035
|
+
title: "Delete record",
|
|
1049
1036
|
message: "Are you sure to delete, the data will be lost?",
|
|
1050
1037
|
onClose: (result) => {
|
|
1051
1038
|
if (result.confirmed) {
|
package/package.json
CHANGED
|
@@ -1,16 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghentcdh/json-forms-vue",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"main": "./index.js",
|
|
5
|
+
"module": "./index.mjs",
|
|
5
6
|
"types": "./index.d.ts",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
8
10
|
"import": "./index.mjs",
|
|
9
11
|
"require": "./index.js"
|
|
10
12
|
},
|
|
11
|
-
"./index.css":
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
"./index.css": "./index.css"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@ghentcdh/json-forms-core": ">=0.0.1",
|
|
17
|
+
"@ghentcdh/tools-vue": ">=0.6.0",
|
|
18
|
+
"@ghentcdh/ui": ">=0.6.0",
|
|
19
|
+
"@jsonforms/core": "^3.4.0",
|
|
20
|
+
"@jsonforms/vue": "^3.4.0",
|
|
21
|
+
"@jsonforms/vue-vanilla": "^3.4.0",
|
|
22
|
+
"@vueuse/core": "^14.0.0",
|
|
23
|
+
"axios": "^1.0.0",
|
|
24
|
+
"lodash-es": "^4.17.0",
|
|
25
|
+
"vue": "^3.5.0",
|
|
26
|
+
"vue-router": "^5.0.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@jsonforms/core": "3.7.0",
|
|
30
|
+
"@jsonforms/vue": "3.7.0",
|
|
31
|
+
"@jsonforms/vue-vanilla": "3.7.0",
|
|
32
|
+
"@vueuse/core": "14.2.0",
|
|
33
|
+
"axios": "1.13.5",
|
|
34
|
+
"lodash-es": "4.17.23",
|
|
35
|
+
"vue": "3.5.27",
|
|
36
|
+
"vue-router": "5.0.2"
|
|
14
37
|
},
|
|
15
38
|
"repository": {
|
|
16
39
|
"type": "git",
|
|
@@ -57,11 +57,11 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
57
57
|
ControlWrapper: {
|
|
58
58
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
59
59
|
label: string;
|
|
60
|
-
errors: string;
|
|
61
60
|
id: string;
|
|
61
|
+
required: boolean;
|
|
62
62
|
description: string;
|
|
63
63
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
64
|
-
|
|
64
|
+
errors: string;
|
|
65
65
|
visible: boolean;
|
|
66
66
|
enabled: boolean;
|
|
67
67
|
isFocused: boolean;
|
|
@@ -76,11 +76,11 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
76
76
|
Defaults: {};
|
|
77
77
|
}, Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, {
|
|
78
78
|
label: string;
|
|
79
|
-
errors: string;
|
|
80
79
|
id: string;
|
|
80
|
+
required: boolean;
|
|
81
81
|
description: string;
|
|
82
82
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
83
|
-
|
|
83
|
+
errors: string;
|
|
84
84
|
visible: boolean;
|
|
85
85
|
enabled: boolean;
|
|
86
86
|
isFocused: boolean;
|
|
@@ -92,11 +92,11 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
92
92
|
__isSuspense?: never;
|
|
93
93
|
} & import('vue').ComponentOptionsBase<Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
94
94
|
label: string;
|
|
95
|
-
errors: string;
|
|
96
95
|
id: string;
|
|
96
|
+
required: boolean;
|
|
97
97
|
description: string;
|
|
98
98
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
99
|
-
|
|
99
|
+
errors: string;
|
|
100
100
|
visible: boolean;
|
|
101
101
|
enabled: boolean;
|
|
102
102
|
isFocused: boolean;
|
|
@@ -58,11 +58,11 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
58
58
|
ControlWrapper: {
|
|
59
59
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
60
60
|
label: string;
|
|
61
|
-
errors: string;
|
|
62
61
|
id: string;
|
|
62
|
+
required: boolean;
|
|
63
63
|
description: string;
|
|
64
64
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
65
|
-
|
|
65
|
+
errors: string;
|
|
66
66
|
visible: boolean;
|
|
67
67
|
enabled: boolean;
|
|
68
68
|
isFocused: boolean;
|
|
@@ -77,11 +77,11 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
77
77
|
Defaults: {};
|
|
78
78
|
}, Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, {
|
|
79
79
|
label: string;
|
|
80
|
-
errors: string;
|
|
81
80
|
id: string;
|
|
81
|
+
required: boolean;
|
|
82
82
|
description: string;
|
|
83
83
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
84
|
-
|
|
84
|
+
errors: string;
|
|
85
85
|
visible: boolean;
|
|
86
86
|
enabled: boolean;
|
|
87
87
|
isFocused: boolean;
|
|
@@ -93,11 +93,11 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
93
93
|
__isSuspense?: never;
|
|
94
94
|
} & import('vue').ComponentOptionsBase<Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
95
95
|
label: string;
|
|
96
|
-
errors: string;
|
|
97
96
|
id: string;
|
|
97
|
+
required: boolean;
|
|
98
98
|
description: string;
|
|
99
99
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
100
|
-
|
|
100
|
+
errors: string;
|
|
101
101
|
visible: boolean;
|
|
102
102
|
enabled: boolean;
|
|
103
103
|
isFocused: boolean;
|
|
@@ -8,7 +8,8 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
8
8
|
cells?: import('@jsonforms/core').JsonFormsCellRendererRegistryEntry[] | undefined;
|
|
9
9
|
config?: any;
|
|
10
10
|
}, {
|
|
11
|
-
|
|
11
|
+
field: any;
|
|
12
|
+
handleChange: (result: any) => void;
|
|
12
13
|
control: import('vue').ComputedRef<{
|
|
13
14
|
uischema: ControlElement;
|
|
14
15
|
schema: NonNullable<import('@jsonforms/core').JsonSchema>;
|
|
@@ -30,7 +31,6 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
30
31
|
id: string;
|
|
31
32
|
visible: boolean;
|
|
32
33
|
}>;
|
|
33
|
-
handleChange(path: string, value: any): void;
|
|
34
34
|
controlWrapper: import('vue').ComputedRef<any>;
|
|
35
35
|
isFocused: import('vue').Ref<boolean, boolean>;
|
|
36
36
|
isTouched: import('vue').Ref<boolean, boolean>;
|
|
@@ -53,59 +53,32 @@ declare const controlRenderer: import('vue').DefineComponent<{
|
|
|
53
53
|
renderers: JsonFormsRendererRegistryEntry[];
|
|
54
54
|
cells: import('@jsonforms/core').JsonFormsCellRendererRegistryEntry[];
|
|
55
55
|
}, {}, {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLFieldSetElement, import('vue').ComponentProvideOptions, {
|
|
70
|
-
P: {};
|
|
71
|
-
B: {};
|
|
72
|
-
D: {};
|
|
73
|
-
C: {};
|
|
74
|
-
M: {};
|
|
75
|
-
Defaults: {};
|
|
76
|
-
}, Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, {
|
|
77
|
-
label: string;
|
|
78
|
-
errors: string;
|
|
79
|
-
id: string;
|
|
80
|
-
description: string;
|
|
81
|
-
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
82
|
-
required: boolean;
|
|
83
|
-
visible: boolean;
|
|
84
|
-
enabled: boolean;
|
|
85
|
-
isFocused: boolean;
|
|
86
|
-
isTouched: boolean;
|
|
87
|
-
hideLabel: boolean;
|
|
88
|
-
}>;
|
|
89
|
-
__isFragment?: never;
|
|
90
|
-
__isTeleport?: never;
|
|
91
|
-
__isSuspense?: never;
|
|
92
|
-
} & import('vue').ComponentOptionsBase<Readonly<import('../../../../../ui/src/index.ts').ControlProperties> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
56
|
+
Markdown: import('vue').DefineComponent<{
|
|
57
|
+
modelValue?: any;
|
|
58
|
+
} & import('../../../../../ui/src/index.ts').ControlProperties & {
|
|
59
|
+
actions?: import('../../../../../ui/src/index.ts').ToolbarAction[];
|
|
60
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
61
|
+
"update:modelValue": (...args: unknown[]) => any;
|
|
62
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
63
|
+
modelValue?: any;
|
|
64
|
+
} & import('../../../../../ui/src/index.ts').ControlProperties & {
|
|
65
|
+
actions?: import('../../../../../ui/src/index.ts').ToolbarAction[];
|
|
66
|
+
}> & Readonly<{
|
|
67
|
+
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
68
|
+
}>, {
|
|
93
69
|
label: string;
|
|
94
|
-
errors: string;
|
|
95
70
|
id: string;
|
|
71
|
+
required: boolean;
|
|
96
72
|
description: string;
|
|
97
73
|
styles: import('../../../../../ui/src/index.ts').MyStyles;
|
|
98
|
-
|
|
74
|
+
actions: import('../../../../../ui/src/index.ts').ToolbarAction[];
|
|
75
|
+
errors: string;
|
|
99
76
|
visible: boolean;
|
|
100
77
|
enabled: boolean;
|
|
101
78
|
isFocused: boolean;
|
|
102
79
|
isTouched: boolean;
|
|
103
80
|
hideLabel: boolean;
|
|
104
|
-
}, {},
|
|
105
|
-
$slots: {
|
|
106
|
-
default?(_: {}): any;
|
|
107
|
-
};
|
|
108
|
-
});
|
|
81
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLFieldSetElement>;
|
|
109
82
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
110
83
|
export default controlRenderer;
|
|
111
84
|
export declare const entry: JsonFormsRendererRegistryEntry;
|