@kp-ui/lowcode 1.0.31 → 1.0.32
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/_virtual/virtual_svg-icons-register.js +2 -2
- package/package.json +1 -1
- package/render.js +13 -14
- package/src/components/CustomRender/components/AttachmentRender.vue.js +1 -1
- package/src/components/CustomRender/components/AttachmentRender.vue2.js +25 -12
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +1 -0
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue3.js +2 -3
- package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +4 -3
- package/src/components/form-designer/form-widget/container-widget/vf-box-widget.vue.js +4 -3
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +2 -0
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue4.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +5 -3
- package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +87 -122
- package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue2.js +25 -19
- package/src/components/form-designer/toolbar-panel/index.vue.js +4 -6
- package/src/components/form-designer/widget-panel/advanced/diy-compontent.js +1 -0
- package/src/components/form-render/container-item/vf-collapse-item.vue.js +4 -3
- package/src/components/form-render/dynamic-dialog.vue.js +236 -241
- package/src/components/form-render/dynamic-drawer.vue.js +206 -2
- package/src/utils/i18n.js +1 -14
- package/styles/style.css +1 -1
- package/types/src/components/CustomRender/components/AttachmentRender.d.ts.map +1 -1
- package/types/src/components/form-designer/widget-panel/advanced/diy-compontent.d.ts.map +1 -1
- package/types/src/components/form-render/index.d.ts.map +1 -1
- package/src/components/form-render/dynamic-dialog.vue3.js +0 -5
- package/src/components/form-render/dynamic-drawer.vue2.js +0 -247
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
if (typeof window !== "undefined") {
|
|
2
2
|
let loadSvg = function() {
|
|
3
3
|
var body = document.body;
|
|
4
|
-
var svgDom = document.getElementById("
|
|
4
|
+
var svgDom = document.getElementById("__svg__icons__dom__1746594346672__");
|
|
5
5
|
if (!svgDom) {
|
|
6
6
|
svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
7
7
|
svgDom.style.position = "absolute";
|
|
8
8
|
svgDom.style.width = "0";
|
|
9
9
|
svgDom.style.height = "0";
|
|
10
|
-
svgDom.id = "
|
|
10
|
+
svgDom.id = "__svg__icons__dom__1746594346672__";
|
|
11
11
|
svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
|
|
12
12
|
svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
|
|
13
13
|
}
|
package/package.json
CHANGED
package/render.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveComponent, createBlock, openBlock, withCtx, createVNode, createElementVNode, withModifiers, normalizeClass, createElementBlock, Fragment, renderList, resolveDynamicComponent, createSlots, renderSlot, normalizeProps, guardReactiveProps, render, h } from "vue";
|
|
2
2
|
import emitter from "./src/utils/emitter.js";
|
|
3
3
|
import comps from "./src/components/form-designer/form-widget/field-widget/index.js";
|
|
4
4
|
import { buildDefaultFormJson, getContainerWidgetByName, cloneFormConfigWithoutEventHandler, deepClone, getDSByName, overwriteObj, runDataSourceRequest, getAllContainerWidgets, getAllFieldWidgets, getDefaultFormConfig, traverseFieldWidgets, getFieldWidgetByName, traverseFieldWidgetsOfContainer, insertCustomCssToHead, insertGlobalFunctionsToHtml, generateId } from "./src/utils/util.js";
|
|
5
5
|
import i18n, { changeLocale } from "./src/utils/i18n.js";
|
|
6
|
-
import
|
|
7
|
-
/* empty css */
|
|
6
|
+
import DynamicDialog from "./src/components/form-render/dynamic-dialog.vue.js";
|
|
8
7
|
import DynamicDrawer from "./src/components/form-render/dynamic-drawer.vue.js";
|
|
9
8
|
import { fmtHttpParams } from "./src/utils/request/fmtHttpParams.js";
|
|
10
9
|
/* empty css */
|
|
@@ -845,7 +844,7 @@ const _sfc_main = {
|
|
|
845
844
|
formConfig: cloneFormConfigWithoutEventHandler(topFormRef.formConfig)
|
|
846
845
|
};
|
|
847
846
|
const wrapperDivId = generateId() + "";
|
|
848
|
-
const
|
|
847
|
+
const dialogInstance = h(DynamicDialog, {
|
|
849
848
|
options: dialogCon.options,
|
|
850
849
|
formJson: dFormJson,
|
|
851
850
|
formData: { ...formData },
|
|
@@ -856,13 +855,13 @@ const _sfc_main = {
|
|
|
856
855
|
wrapperId: wrapperDivId,
|
|
857
856
|
vfCtx: { ...formData }
|
|
858
857
|
});
|
|
859
|
-
|
|
858
|
+
dialogInstance.appContext = this.$root.$.appContext;
|
|
860
859
|
const wrapperDiv = document.createElement("div");
|
|
861
860
|
wrapperDiv.id = "vf-dynamic-dialog-wrapper" + wrapperDivId;
|
|
862
861
|
document.body.appendChild(wrapperDiv);
|
|
863
|
-
render(
|
|
864
|
-
document.body.appendChild(
|
|
865
|
-
|
|
862
|
+
render(dialogInstance, wrapperDiv);
|
|
863
|
+
document.body.appendChild(dialogInstance.el);
|
|
864
|
+
dialogInstance.component.ctx.show();
|
|
866
865
|
},
|
|
867
866
|
showDrawer(drawerName, formData = {}, extraData = {}) {
|
|
868
867
|
const topFormRef = this.getTopFormRef();
|
|
@@ -892,7 +891,7 @@ const _sfc_main = {
|
|
|
892
891
|
document.body.appendChild(wrapperDiv);
|
|
893
892
|
render(drawerInstance, wrapperDiv);
|
|
894
893
|
document.body.appendChild(drawerInstance.el);
|
|
895
|
-
|
|
894
|
+
drawerInstance.component.ctx.show();
|
|
896
895
|
},
|
|
897
896
|
/**
|
|
898
897
|
* 判断表单是否处于设计器预览状态
|
|
@@ -928,13 +927,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
928
927
|
}, ["prevent"]))
|
|
929
928
|
}, {
|
|
930
929
|
default: withCtx(() => [
|
|
931
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($options.widgetList, (widget,
|
|
930
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($options.widgetList, (widget, index2) => {
|
|
932
931
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
933
932
|
"container" === widget.category ? (openBlock(), createBlock(resolveDynamicComponent($options.getContainerWidgetName(widget)), {
|
|
934
933
|
widget,
|
|
935
934
|
key: widget.id,
|
|
936
935
|
"parent-list": $options.widgetList,
|
|
937
|
-
"index-of-parent-list":
|
|
936
|
+
"index-of-parent-list": index2,
|
|
938
937
|
"parent-widget": null
|
|
939
938
|
}, createSlots({ _: 2 }, [
|
|
940
939
|
renderList(Object.keys(_ctx.$slots), (slot) => {
|
|
@@ -951,7 +950,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
951
950
|
designer: null,
|
|
952
951
|
key: widget.id,
|
|
953
952
|
"parent-list": $options.widgetList,
|
|
954
|
-
"index-of-parent-list":
|
|
953
|
+
"index-of-parent-list": index2,
|
|
955
954
|
"parent-widget": null
|
|
956
955
|
}, createSlots({ _: 2 }, [
|
|
957
956
|
renderList(Object.keys(_ctx.$slots), (slot) => {
|
|
@@ -976,7 +975,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
976
975
|
_: 3
|
|
977
976
|
}, 8, ["component-size"]);
|
|
978
977
|
}
|
|
979
|
-
const
|
|
978
|
+
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-20edc56d"]]);
|
|
980
979
|
export {
|
|
981
|
-
|
|
980
|
+
index as default
|
|
982
981
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _sfc_main from "./AttachmentRender.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const AttachmentRender = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
4
|
+
const AttachmentRender = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-412620ec"]]);
|
|
5
5
|
export {
|
|
6
6
|
AttachmentRender as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref,
|
|
1
|
+
import { defineComponent, ref, watch, computed, onMounted, resolveComponent, createElementBlock, createCommentVNode, openBlock, createElementVNode, createVNode, withCtx, Fragment, renderList, createBlock, unref, toDisplayString } from "vue";
|
|
2
2
|
import { Image, Button } from "ant-design-vue";
|
|
3
3
|
import { DownloadOutlined, EyeOutlined } from "@ant-design/icons-vue";
|
|
4
4
|
import { useFilePreview } from "../../../hooks/useFilePreview.js";
|
|
@@ -20,17 +20,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
const { getPreviewData, handlePreview, handleDownload } = useFilePreview();
|
|
21
21
|
const attachmentList = ref([]);
|
|
22
22
|
ref(false);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
data =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
watch(
|
|
24
|
+
() => props.data,
|
|
25
|
+
async (newData) => {
|
|
26
|
+
let data = newData || [];
|
|
27
|
+
if (typeof data === "string") {
|
|
28
|
+
try {
|
|
29
|
+
data = JSON.parse(data);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error("Failed to parse props.data:", error);
|
|
32
|
+
attachmentList.value = [];
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!Array.isArray(data) || data.length === 0) {
|
|
37
|
+
attachmentList.value = [];
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
attachmentList.value = await getPreviewData(data);
|
|
41
|
+
},
|
|
42
|
+
{ immediate: true }
|
|
43
|
+
);
|
|
34
44
|
const isImageFile = (file) => {
|
|
35
45
|
const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"];
|
|
36
46
|
return imageExtensions.some((ext) => file.fileType.toLowerCase().endsWith(ext));
|
|
@@ -41,6 +51,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
41
51
|
const imageList = computed(() => {
|
|
42
52
|
return attachmentList.value.filter((file) => isImageFile(file));
|
|
43
53
|
});
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
console.log(121212121);
|
|
56
|
+
});
|
|
44
57
|
return (_ctx, _cache) => {
|
|
45
58
|
const _component_a_image_preview_group = resolveComponent("a-image-preview-group");
|
|
46
59
|
return attachmentList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -36,7 +36,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
36
36
|
"row-class-name": _ctx.rowClassName,
|
|
37
37
|
rowSelection: _ctx.handleRowSelection(),
|
|
38
38
|
pagination: _ctx.fmtPagination,
|
|
39
|
-
rowClassName: _ctx.rowClassName,
|
|
40
39
|
onChange: _ctx.handleTablePageChange,
|
|
41
40
|
customRow: _ctx.handleCustomRow,
|
|
42
41
|
onResizeColumn: _ctx.handleResizeColumn
|
|
@@ -94,13 +93,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
94
93
|
}, 8, ["title", "width"])) : createCommentVNode("", true)
|
|
95
94
|
]),
|
|
96
95
|
_: 1
|
|
97
|
-
}, 8, ["dataSource", "rowKey", "scroll", "class", "size", "bordered", "style", "row-class-name", "rowSelection", "pagination", "
|
|
96
|
+
}, 8, ["dataSource", "rowKey", "scroll", "class", "size", "bordered", "style", "row-class-name", "rowSelection", "pagination", "onChange", "customRow", "onResizeColumn"])
|
|
98
97
|
], 2))
|
|
99
98
|
]),
|
|
100
99
|
_: 1
|
|
101
100
|
}, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list", "style"]);
|
|
102
101
|
}
|
|
103
|
-
const dataTableWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
102
|
+
const dataTableWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a667e0af"]]);
|
|
104
103
|
export {
|
|
105
104
|
dataTableWidget as default
|
|
106
105
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import ContainerItemWrapper from "../../../form-render/container-item/container-item-wrapper.vue.js";
|
|
2
2
|
import emitter from "../../../../utils/emitter.js";
|
|
3
|
+
import { defineAsyncComponent, resolveComponent, withDirectives, createBlock, openBlock, withCtx, createElementBlock, normalizeClass, createCommentVNode, Fragment, renderList, resolveDynamicComponent, createSlots, renderSlot, normalizeProps, guardReactiveProps, vShow } from "vue";
|
|
3
4
|
import i18n from "../../../../utils/i18n.js";
|
|
4
5
|
import comps from "../field-widget/index.js";
|
|
5
6
|
import refMixin from "../../../form-render/refMixin.js";
|
|
6
7
|
import containerItemMixin from "../../../form-render/container-item/containerItemMixin.js";
|
|
7
8
|
import SvgIcon from "../../../svg-icon/index.vue.js";
|
|
8
|
-
import { resolveComponent, withDirectives, createBlock, openBlock, withCtx, createElementBlock, normalizeClass, createCommentVNode, Fragment, renderList, resolveDynamicComponent, createSlots, renderSlot, normalizeProps, guardReactiveProps, vShow } from "vue";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
11
11
|
const _sfc_main = {
|
|
@@ -16,7 +16,8 @@ const _sfc_main = {
|
|
|
16
16
|
components: {
|
|
17
17
|
ContainerItemWrapper,
|
|
18
18
|
SvgIcon,
|
|
19
|
-
...comps
|
|
19
|
+
...comps,
|
|
20
|
+
VFormRender: defineAsyncComponent(() => import("../../../../../render.js"))
|
|
20
21
|
},
|
|
21
22
|
props: {
|
|
22
23
|
widget: Object,
|
|
@@ -181,7 +182,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
181
182
|
[vShow, !$props.widget.options.hidden]
|
|
182
183
|
]);
|
|
183
184
|
}
|
|
184
|
-
const vfBoxItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
185
|
+
const vfBoxItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-b302cb7e"]]);
|
|
185
186
|
export {
|
|
186
187
|
vfBoxItem as default
|
|
187
188
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { defineAsyncComponent, resolveComponent, createBlock, openBlock, withCtx, createElementBlock, withModifiers, normalizeClass, createCommentVNode, createVNode, mergeProps, createElementVNode, resolveDynamicComponent } from "vue";
|
|
1
2
|
import i18n from "../../../../utils/i18n.js";
|
|
2
3
|
import refMixinDesign from "../../refMixinDesign.js";
|
|
3
4
|
import comps from "../field-widget/index.js";
|
|
4
5
|
import ContainerWrapper from "./container-wrapper.vue.js";
|
|
5
6
|
import draggableComponent from "../../../../lib/vuedraggable/src/vuedraggable.js";
|
|
6
|
-
import { resolveComponent, createBlock, openBlock, withCtx, createElementBlock, withModifiers, normalizeClass, createCommentVNode, createVNode, mergeProps, createElementVNode, resolveDynamicComponent } from "vue";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
9
9
|
const _sfc_main = {
|
|
@@ -14,7 +14,8 @@ const _sfc_main = {
|
|
|
14
14
|
components: {
|
|
15
15
|
Draggable: draggableComponent,
|
|
16
16
|
ContainerWrapper,
|
|
17
|
-
...comps
|
|
17
|
+
...comps,
|
|
18
|
+
VFormRender: defineAsyncComponent(() => import("../../../../../render.js"))
|
|
18
19
|
},
|
|
19
20
|
props: {
|
|
20
21
|
widget: Object,
|
|
@@ -177,7 +178,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
177
178
|
_: 1
|
|
178
179
|
}, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
|
|
179
180
|
}
|
|
180
|
-
const vfBoxWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
181
|
+
const vfBoxWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6e190b21"]]);
|
|
181
182
|
export {
|
|
182
183
|
vfBoxWidget as default
|
|
183
184
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defineAsyncComponent } from "vue";
|
|
1
2
|
import ContainerWrapper from "./container-wrapper.vue.js";
|
|
2
3
|
import emitter from "../../../../utils/emitter.js";
|
|
3
4
|
import i18n from "../../../../utils/i18n.js";
|
|
@@ -18,6 +19,7 @@ const _sfc_main = {
|
|
|
18
19
|
TpfCollapseTitle,
|
|
19
20
|
SvgIcon,
|
|
20
21
|
gridWidget,
|
|
22
|
+
VFormRender: defineAsyncComponent(() => import("../../../../../render.js")),
|
|
21
23
|
...comps
|
|
22
24
|
},
|
|
23
25
|
data() {
|
package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue4.js
CHANGED
|
@@ -152,7 +152,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
152
|
_: 1
|
|
153
153
|
}, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
|
|
154
154
|
}
|
|
155
|
-
const vfCollapseWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
155
|
+
const vfCollapseWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4278dc9a"]]);
|
|
156
156
|
export {
|
|
157
157
|
vfCollapseWidget as default
|
|
158
158
|
};
|
|
@@ -39,7 +39,9 @@ const _sfc_main = {
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
data() {
|
|
42
|
-
return {
|
|
42
|
+
return {
|
|
43
|
+
fieldModel: null
|
|
44
|
+
};
|
|
43
45
|
},
|
|
44
46
|
components: {
|
|
45
47
|
StaticContentWrapper
|
|
@@ -86,7 +88,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
86
88
|
}, [
|
|
87
89
|
!!$props.designState ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.i18nt("designer.widgetLabel.diy-compontent")) + " " + toDisplayString($props.field.options.diyCompontent), 1)) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
88
90
|
(openBlock(), createBlock(resolveDynamicComponent($options.renderComponent($props.field.options.diyCompontent)), normalizeProps(guardReactiveProps({
|
|
89
|
-
data:
|
|
91
|
+
data: $data.fieldModel,
|
|
90
92
|
...$props.field.options.props
|
|
91
93
|
})), null, 16))
|
|
92
94
|
]))
|
|
@@ -95,7 +97,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
95
97
|
_: 1
|
|
96
98
|
}, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
|
|
97
99
|
}
|
|
98
|
-
const diyCompontentWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
100
|
+
const diyCompontentWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e35ce93b"]]);
|
|
99
101
|
export {
|
|
100
102
|
diyCompontentWidget as default
|
|
101
103
|
};
|