@kp-ui/lowcode 2.14.0-beta.2 → 2.14.0-beta.21

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.
Files changed (90) hide show
  1. package/package.json +1 -1
  2. package/src/components/FormRender/useFormRender.js +18 -0
  3. package/src/components/form-designer/designer.js +78 -75
  4. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +18 -18
  5. package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +18 -20
  6. package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +9 -9
  7. package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +29 -21
  8. package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +32 -39
  9. package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +24 -31
  10. package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +26 -33
  11. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +4 -4
  12. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
  13. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +84 -152
  14. package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +31 -38
  15. package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +23 -30
  16. package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +56 -63
  17. package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
  18. package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +23 -32
  19. package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +26 -33
  20. package/src/components/form-designer/setting-panel/form-setting.vue.js +2 -2
  21. package/src/components/form-designer/setting-panel/form-setting.vue2.js +81 -94
  22. package/src/components/form-designer/setting-panel/index.vue.js +2 -2
  23. package/src/components/form-designer/setting-panel/index.vue2.js +135 -135
  24. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-colorRow-editor.vue2.js +8 -7
  25. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +23 -22
  26. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
  27. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +7 -7
  28. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/formCode-editor.vue.js +25 -19
  29. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/line-height-editor.vue2.js +7 -6
  30. package/src/components/form-designer/setting-panel/property-editor/index.js +41 -42
  31. package/src/components/form-designer/setting-panel/propertyRegister.js +3 -6
  32. package/src/components/form-designer/widget-panel/PanelItemDrag.vue.js +50 -0
  33. package/src/components/form-designer/widget-panel/PanelItemDrag.vue2.js +4 -0
  34. package/src/components/form-designer/widget-panel/advanced/cascader.js +0 -1
  35. package/src/components/form-designer/widget-panel/advanced/data-table.js +1 -1
  36. package/src/components/form-designer/widget-panel/advanced/file-upload.js +0 -1
  37. package/src/components/form-designer/widget-panel/advanced/rich-editor.js +4 -5
  38. package/src/components/form-designer/widget-panel/advanced/tree-select.js +0 -1
  39. package/src/components/form-designer/widget-panel/basicFields/checkbox.js +2 -3
  40. package/src/components/form-designer/widget-panel/basicFields/color.js +0 -1
  41. package/src/components/form-designer/widget-panel/basicFields/date.js +0 -1
  42. package/src/components/form-designer/widget-panel/basicFields/dateRange.js +0 -1
  43. package/src/components/form-designer/widget-panel/basicFields/input.js +0 -1
  44. package/src/components/form-designer/widget-panel/basicFields/number.js +0 -1
  45. package/src/components/form-designer/widget-panel/basicFields/radio.js +0 -1
  46. package/src/components/form-designer/widget-panel/basicFields/rate.js +5 -6
  47. package/src/components/form-designer/widget-panel/basicFields/select.js +2 -3
  48. package/src/components/form-designer/widget-panel/basicFields/slider.js +0 -1
  49. package/src/components/form-designer/widget-panel/basicFields/switch.js +0 -1
  50. package/src/components/form-designer/widget-panel/basicFields/textarea.js +0 -1
  51. package/src/components/form-designer/widget-panel/basicFields/time.js +0 -1
  52. package/src/components/form-designer/widget-panel/basicFields/timeRange.js +0 -1
  53. package/src/components/form-designer/widget-panel/business/department-select.js +0 -1
  54. package/src/components/form-designer/widget-panel/business/material-select.js +0 -1
  55. package/src/components/form-designer/widget-panel/business/operation-select.js +2 -3
  56. package/src/components/form-designer/widget-panel/business/post-select.js +0 -1
  57. package/src/components/form-designer/widget-panel/business/project-group-select.js +2 -3
  58. package/src/components/form-designer/widget-panel/business/project-select.js +2 -3
  59. package/src/components/form-designer/widget-panel/business/user-select.js +0 -1
  60. package/src/components/form-designer/widget-panel/containers/vf-dialog.js +3 -2
  61. package/src/components/form-designer/widget-panel/index.vue.js +4 -338
  62. package/src/components/form-designer/widget-panel/index.vue2.js +82 -0
  63. package/src/components/form-designer/widget-panel/widgetsConfig.js +19 -18
  64. package/src/components/form-render/RenderWigetList.vue.js +61 -0
  65. package/src/components/form-render/RenderWigetList.vue2.js +4 -0
  66. package/src/components/form-render/SubmitButtonRender.vue.js +41 -29
  67. package/src/components/form-render/container-item/container-item-wrapper.vue.js +2 -23
  68. package/src/components/form-render/container-item/container-item-wrapper.vue2.js +20 -0
  69. package/src/components/form-render/container-item/data-table-item.vue.js +22 -36
  70. package/src/components/form-render/container-item/grid-item.vue.js +7 -7
  71. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +1 -1
  72. package/src/components/form-render/container-item/sub-form-item.vue.js +115 -146
  73. package/src/components/form-render/container-item/tab-item.vue.js +19 -19
  74. package/src/components/form-render/container-item/table-item.vue.js +7 -7
  75. package/src/components/form-render/container-item/vf-collapse-item.vue.js +27 -27
  76. package/src/components/form-render/dynamic-dialog.vue.js +87 -86
  77. package/src/components/form-render/index.vue.js +94 -110
  78. package/src/components/public/ActionButtonListDialog.vue.js +82 -75
  79. package/src/components/public/ActionButtonListDialog.vue2.js +16 -10
  80. package/src/components/public/ActionButtonListRender.vue.js +12 -11
  81. package/src/components/public/CustomerModal/CustomerModal.vue2.js +49 -42
  82. package/src/hooks/useLowcode.js +40 -39
  83. package/src/lang/en-US.js +5 -1
  84. package/src/lang/zh-CN.js +5 -1
  85. package/src/mixins/useDataTableMixin.js +29 -31
  86. package/src/utils/asyncExecuteFunction.js +4 -0
  87. package/stats.html +1 -1
  88. package/styles/style.css +1 -1
  89. package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
  90. package/src/components/form-designer/widget-panel/templatesConfig.js +0 -53
@@ -1,6 +1,8 @@
1
- import { defineComponent as S, ref as m, computed as a, resolveComponent as B, createBlock as u, openBlock as r, withCtx as s, createCommentVNode as k, createTextVNode as v, toDisplayString as C } from "vue";
1
+ import { defineComponent as D, ref as p, computed as a, resolveComponent as m, createBlock as u, openBlock as r, withCtx as s, createCommentVNode as B, createTextVNode as k, toDisplayString as v } from "vue";
2
+ import { asyncExecuteFunction as y } from "../../utils/asyncExecuteFunction.js";
3
+ import { executeFunction as C } from "../../utils/executeFunction.js";
2
4
  import { useI18n as L } from "../../utils/i18n.js";
3
- const W = /* @__PURE__ */ S({
5
+ const E = /* @__PURE__ */ D({
4
6
  __name: "SubmitButtonRender",
5
7
  props: {
6
8
  goBack: { type: Function },
@@ -10,39 +12,47 @@ const W = /* @__PURE__ */ S({
10
12
  ctx: {}
11
13
  },
12
14
  emits: ["update:dialogVisible"],
13
- setup(g, { emit: _ }) {
14
- const e = g, y = _, l = m(!1), c = m(!1), { i18nt: d } = L(), i = a(() => (e == null ? void 0 : e.options) ?? {}), h = a(() => i.value.cancelButtonHidden != null ? i.value.cancelButtonHidden === 0 : 0), b = a(() => i.value.okButtonHidden != null ? i.value.okButtonHidden === 0 : 0), x = a(
15
+ setup(b, { emit: g }) {
16
+ const e = b, h = g, l = p(!1), i = p(!1), { i18nt: d } = L(), c = a(() => (e == null ? void 0 : e.options) ?? {}), _ = a(() => c.value.cancelButtonHidden != null ? c.value.cancelButtonHidden === 0 : 1), x = a(() => c.value.okButtonHidden != null ? c.value.okButtonHidden === 0 : 1), w = a(
15
17
  () => {
16
18
  var t;
17
19
  return ((t = e.options) == null ? void 0 : t.cancelButtonLabel) || d("designer.hint.cancel");
18
20
  }
19
- ), w = a(
21
+ ), H = a(
20
22
  () => {
21
23
  var t;
22
24
  return ((t = e.options) == null ? void 0 : t.okButtonLabel) || d("designer.hint.confirm");
23
25
  }
24
- ), f = async (t, n) => n ? (console.log("functionBody", n), await new Function(n).call(t)) : !0, p = () => {
25
- y("update:dialogVisible", !1), e.deleteWrapperNode && setTimeout(e.deleteWrapperNode, 150);
26
+ ), f = () => {
27
+ h("update:dialogVisible", !1), e.deleteWrapperNode && setTimeout(e.deleteWrapperNode, 150);
26
28
  }, F = async () => {
27
29
  var t, n;
28
- if (!c.value)
30
+ if (!i.value)
29
31
  try {
30
- if (c.value = !0, e.handleBeforeClose && !((t = e == null ? void 0 : e.handleBeforeClose) != null && t.call(e)) || await f(
31
- e.ctx,
32
- (n = e.options) == null ? void 0 : n.onCancelButtonClick
33
- ) === !1) return;
34
- e.goBack ? e.goBack() : p();
32
+ if (i.value = !0, e.handleBeforeClose && !((t = e == null ? void 0 : e.handleBeforeClose) != null && t.call(e)))
33
+ return;
34
+ const o = await C({
35
+ context: e.ctx,
36
+ functionBody: ((n = e.options) == null ? void 0 : n.onCancelButtonClick) || ""
37
+ });
38
+ if (await y(o) === !1) return;
39
+ e.goBack ? e.goBack() : f();
35
40
  } catch (o) {
36
41
  console.error("取消操作失败:", o);
37
42
  } finally {
38
- c.value = !1;
43
+ i.value = !1;
39
44
  }
40
- }, H = async () => {
45
+ }, N = async () => {
41
46
  var t;
42
47
  if (!l.value)
43
48
  try {
44
- if (l.value = !0, await f(e.ctx, (t = e.options) == null ? void 0 : t.onOkButtonClick) === !1) return;
45
- p();
49
+ l.value = !0;
50
+ const n = C({
51
+ context: e.ctx,
52
+ functionBody: ((t = e.options) == null ? void 0 : t.onOkButtonClick) || ""
53
+ });
54
+ if (await y(n) === !1) return;
55
+ f();
46
56
  } catch (n) {
47
57
  console.error("提交操作失败:", n);
48
58
  } finally {
@@ -50,30 +60,32 @@ const W = /* @__PURE__ */ S({
50
60
  }
51
61
  };
52
62
  return (t, n) => {
53
- const o = B("a-button"), N = B("a-space");
54
- return r(), u(N, { x: 8 }, {
63
+ const o = m("a-button"), S = m("a-space");
64
+ return r(), u(S, { x: 8 }, {
55
65
  default: s(() => [
56
- h.value ? (r(), u(o, {
66
+ _.value ? (r(), u(o, {
57
67
  key: "cancelButtonHidden",
58
- loading: c.value,
59
- onClick: F
68
+ loading: i.value,
69
+ onClick: F,
70
+ disabled: t.handleDisabled
60
71
  }, {
61
72
  default: s(() => [
62
- v(C(x.value), 1)
73
+ k(v(w.value), 1)
63
74
  ]),
64
75
  _: 1
65
- }, 8, ["loading"])) : k("", !0),
66
- b.value ? (r(), u(o, {
76
+ }, 8, ["loading", "disabled"])) : B("", !0),
77
+ x.value ? (r(), u(o, {
67
78
  type: "primary",
68
79
  key: "okButtonHidden",
69
80
  loading: l.value,
70
- onClick: H
81
+ onClick: N,
82
+ disabled: t.handleDisabled
71
83
  }, {
72
84
  default: s(() => [
73
- v(C(w.value), 1)
85
+ k(v(H.value), 1)
74
86
  ]),
75
87
  _: 1
76
- }, 8, ["loading"])) : k("", !0)
88
+ }, 8, ["loading", "disabled"])) : B("", !0)
77
89
  ]),
78
90
  _: 1
79
91
  });
@@ -81,5 +93,5 @@ const W = /* @__PURE__ */ S({
81
93
  }
82
94
  });
83
95
  export {
84
- W as default
96
+ E as default
85
97
  };
@@ -1,25 +1,4 @@
1
- import { createElementBlock as s, openBlock as o, normalizeStyle as r, normalizeClass as n, renderSlot as a } from "vue";
2
- import c from "../../../../_virtual/_plugin-vue_export-helper.js";
3
- const i = {
4
- name: "container-item-wrapper",
5
- props: {
6
- widget: Object
7
- },
8
- computed: {
9
- customClass() {
10
- return this.widget.options.customClass ? this.widget.options.customClass.join(" ") : "";
11
- }
12
- }
13
- };
14
- function p(t, l, m, d, u, e) {
15
- return o(), s("div", {
16
- class: n(["container-wrapper", [e.customClass]]),
17
- style: r(t.$attrs.containerStyle)
18
- }, [
19
- a(t.$slots, "default")
20
- ], 6);
21
- }
22
- const _ = /* @__PURE__ */ c(i, [["render", p]]);
1
+ import f from "./container-item-wrapper.vue2.js";
23
2
  export {
24
- _ as default
3
+ f as default
25
4
  };
@@ -0,0 +1,20 @@
1
+ import { defineComponent as r, computed as s, createElementBlock as a, openBlock as i, normalizeStyle as l, normalizeClass as p, renderSlot as c } from "vue";
2
+ const d = /* @__PURE__ */ r({
3
+ name: "container-item-wrapper",
4
+ __name: "container-item-wrapper",
5
+ props: {
6
+ widget: {}
7
+ },
8
+ setup(o) {
9
+ const e = o, n = s(() => e.widget.options.customClass ? e.widget.options.customClass.join(" ") : "");
10
+ return (t, m) => (i(), a("div", {
11
+ class: p(["container-wrapper", [n.value]]),
12
+ style: l(t.$attrs.containerStyle)
13
+ }, [
14
+ c(t.$slots, "default")
15
+ ], 6));
16
+ }
17
+ });
18
+ export {
19
+ d as default
20
+ };
@@ -1,46 +1,28 @@
1
- import p from "./container-item-wrapper.vue.js";
1
+ import p from "./container-item-wrapper.vue2.js";
2
2
  import h from "../../../utils/emitter.js";
3
3
  import g from "../../../utils/i18n.js";
4
4
  import w from "../../form-designer/form-widget/field-widget/index.js";
5
5
  import f from "../refMixin.js";
6
- import b from "./containerItemMixin.js";
7
- import C from "../../../mixins/useDataTableMixin.js";
8
- import { resolveComponent as n, withDirectives as y, createBlock as a, openBlock as r, normalizeStyle as s, withCtx as i, createVNode as l, normalizeClass as R, createCommentVNode as F, vShow as S } from "vue";
6
+ import C from "./containerItemMixin.js";
7
+ import b from "../../../mixins/useDataTableMixin.js";
8
+ import { resolveComponent as n, withDirectives as y, createBlock as a, openBlock as s, normalizeStyle as l, withCtx as i, createVNode as r, normalizeClass as R, createCommentVNode as S, vShow as F } from "vue";
9
9
  /* empty css */
10
10
  /* empty css */
11
- import I from "../../../../_virtual/_plugin-vue_export-helper.js";
12
- const T = {
11
+ import z from "../../../../_virtual/_plugin-vue_export-helper.js";
12
+ const _ = {
13
13
  name: "DataTableItem",
14
14
  componentName: "ContainerItem",
15
15
  // 必须固定为ContainerItem,用于接收父级组件的broadcast事件
16
- mixins: [h, g, f, b, C],
16
+ mixins: [h, g, f, C, b],
17
17
  components: {
18
18
  ContainerItemWrapper: p,
19
19
  ...w
20
20
  },
21
21
  props: {
22
22
  widget: Object,
23
- parentWidget: Object,
24
- parentList: Array,
25
- indexOfParentList: Number,
26
23
  data: {
27
24
  type: Array,
28
25
  default: () => []
29
- },
30
- subFormRowIndex: {
31
- /* 子表单组件行索引,从0开始计数 */
32
- type: Number,
33
- default: -1
34
- },
35
- subFormColIndex: {
36
- /* 子表单组件列索引,从0开始计数 */
37
- type: Number,
38
- default: -1
39
- },
40
- subFormRowId: {
41
- /* 子表单组件行Id,唯一id且不可变 */
42
- type: String,
43
- default: ""
44
26
  }
45
27
  },
46
28
  inject: ["refList", "sfRefList", "globalModel", "getFormConfig", "getGlobalDsv"],
@@ -56,7 +38,11 @@ const T = {
56
38
  this.initRefList(), this.handleOnCreated();
57
39
  },
58
40
  mounted() {
59
- this.loadDataTableDataSource(), this.$nextTick(() => {
41
+ this.setPagination({
42
+ pageSize: this.widget.options.pagination.pageSize,
43
+ page: 1,
44
+ total: 1
45
+ }), this.$nextTick(() => {
60
46
  this.handleOnMounted();
61
47
  });
62
48
  },
@@ -98,14 +84,14 @@ const T = {
98
84
  // --------------------- 以上为组件支持外部调用的API方法 end ------------------//
99
85
  }
100
86
  };
101
- function z(e, M, t, _, D, N) {
87
+ function I(e, T, t, M, v, B) {
102
88
  const d = n("a-empty"), m = n("RenderBodyCell"), c = n("s-table"), u = n("container-item-wrapper");
103
- return y((r(), a(u, {
104
- style: s({ display: "flex", minWidth: 0, height: parseFloat(e.tableHeight || 0) + "px" }),
89
+ return y((s(), a(u, {
90
+ style: l({ display: "flex", minWidth: 0, height: parseFloat(e.tableHeight || 0) + "px" }),
105
91
  widget: t.widget
106
92
  }, {
107
93
  default: i(() => [
108
- l(c, {
94
+ r(c, {
109
95
  class: R(["tpf-surely-table", [e.customClass]]),
110
96
  ref: "dataTable2",
111
97
  columns: e.columns.columns,
@@ -115,7 +101,7 @@ function z(e, M, t, _, D, N) {
115
101
  rowKey: (o) => o[t.widget.options.rowKey],
116
102
  scroll: { y: parseFloat(e.tableHeight || 0), x: 300 },
117
103
  bordered: t.widget.options.border,
118
- style: s({ width: t.widget.options.tableWidth }),
104
+ style: l({ width: t.widget.options.tableWidth }),
119
105
  "row-class-name": e.rowClassName,
120
106
  rowSelection: e.handleRowSelection(),
121
107
  pagination: e.fmtPagination,
@@ -126,24 +112,24 @@ function z(e, M, t, _, D, N) {
126
112
  "row-height": e.lineHeight
127
113
  }, {
128
114
  emptyText: i(() => [
129
- l(d)
115
+ r(d)
130
116
  ]),
131
117
  bodyCell: i((o) => [
132
- e.isShowBodyCell(o.column.dataIndex) ? (r(), a(m, {
118
+ e.isShowBodyCell(o.column.dataIndex) ? (s(), a(m, {
133
119
  key: 0,
134
120
  bodyCell: e.columns.bodyCell,
135
121
  scope: o
136
- }, null, 8, ["bodyCell", "scope"])) : F("", !0)
122
+ }, null, 8, ["bodyCell", "scope"])) : S("", !0)
137
123
  ]),
138
124
  _: 1
139
125
  }, 8, ["columns", "class", "size", "dataSource", "rowKey", "scroll", "bordered", "style", "row-class-name", "rowSelection", "pagination", "customRow", "onChange", "onResizeColumn", "loading", "row-height"])
140
126
  ]),
141
127
  _: 1
142
128
  }, 8, ["style", "widget"])), [
143
- [S, !e.handleHidden()]
129
+ [F, !e.handleHidden()]
144
130
  ]);
145
131
  }
146
- const A = /* @__PURE__ */ I(T, [["render", z], ["__scopeId", "data-v-8e1059ce"]]);
132
+ const A = /* @__PURE__ */ z(_, [["render", I], ["__scopeId", "data-v-de3544fc"]]);
147
133
  export {
148
134
  A as default
149
135
  };
@@ -1,7 +1,7 @@
1
1
  import g from "../../../utils/emitter.js";
2
2
  import w from "../../../utils/i18n.js";
3
- import b from "../refMixin.js";
4
- import _ from "./container-item-wrapper.vue.js";
3
+ import _ from "../refMixin.js";
4
+ import b from "./container-item-wrapper.vue2.js";
5
5
  import p from "./grid-col-item.vue.js";
6
6
  import h from "./containerItemMixin.js";
7
7
  import { resolveComponent as i, createBlock as r, openBlock as t, withCtx as n, withDirectives as x, normalizeClass as I, createElementBlock as C, Fragment as F, renderList as a, createSlots as R, renderSlot as k, mergeProps as y, vShow as j } from "vue";
@@ -10,9 +10,9 @@ const v = {
10
10
  name: "vf-grid-item",
11
11
  //grid-item跟VueGridLayout全局注册组件重名,故特殊处理!!
12
12
  componentName: "ContainerItem",
13
- mixins: [g, w, b, h],
13
+ mixins: [g, w, _, h],
14
14
  components: {
15
- ContainerItemWrapper: _,
15
+ ContainerItemWrapper: b,
16
16
  GridColItem: p
17
17
  },
18
18
  props: {
@@ -47,10 +47,10 @@ const v = {
47
47
  methods: {}
48
48
  };
49
49
  function O(o, S, e, B, M, N) {
50
- const s = i("grid-col-item"), l = i("a-row"), c = i("container-item-wrapper");
51
- return t(), r(c, { widget: e.widget }, {
50
+ const s = i("grid-col-item"), c = i("a-row"), l = i("container-item-wrapper");
51
+ return t(), r(l, { widget: e.widget }, {
52
52
  default: n(() => [
53
- x((t(), r(l, {
53
+ x((t(), r(c, {
54
54
  key: e.widget.id,
55
55
  gutter: e.widget.options.gutter,
56
56
  class: I(["grid-container", [o.customClass]]),
@@ -2,7 +2,7 @@ import v from "../../../utils/emitter.js";
2
2
  import I from "../../../utils/i18n.js";
3
3
  import { deepClone as F, generateId as m, traverseFieldWidgetsOfContainer as T } from "../../../utils/util.js";
4
4
  import y from "../refMixin.js";
5
- import A from "./container-item-wrapper.vue.js";
5
+ import A from "./container-item-wrapper.vue2.js";
6
6
  import M from "./containerItemMixin.js";
7
7
  import E from "../../form-designer/form-widget/field-widget/index.js";
8
8
  import { TpfConfirm as B } from "../../../hooks/TpfConfirm.js";