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

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 (61) hide show
  1. package/install.js +26 -25
  2. package/package.json +2 -2
  3. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +1 -1
  4. package/src/components/form-designer/index.vue.js +55 -54
  5. package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +62 -23
  6. package/src/components/form-designer/setting-panel/index.vue.js +4 -386
  7. package/src/components/form-designer/setting-panel/index.vue2.js +273 -0
  8. package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue2.js +5 -4
  9. package/src/components/form-designer/setting-panel/property-editor/container-data-table/customRowEvent/data-table-customRow-editor.vue.js +1 -0
  10. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +5 -4
  11. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +1 -0
  12. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue2.js +24 -24
  13. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +9 -8
  14. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +1 -1
  15. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +7 -6
  16. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue2.js +7 -6
  17. package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue.js +2 -40
  18. package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue2.js +41 -0
  19. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue.js +2 -47
  20. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue2.js +44 -0
  21. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue.js +2 -47
  22. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue2.js +43 -0
  23. package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue.js +2 -46
  24. package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue2.js +43 -0
  25. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue.js +2 -47
  26. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue2.js +44 -0
  27. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +2 -66
  28. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue2.js +42 -0
  29. package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue.js +5 -4
  30. package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +6 -5
  31. package/src/components/form-designer/setting-panel/property-editor/index.js +146 -152
  32. package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue.js +8 -7
  33. package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue.js +38 -35
  34. package/src/components/form-designer/setting-panel/propertyRegister.js +0 -12
  35. package/src/components/form-render/container-item/data-table-item.vue.js +149 -0
  36. package/src/components/form-render/container-item/grid-col-item.vue.js +149 -0
  37. package/src/components/form-render/container-item/grid-item.vue.js +92 -0
  38. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +319 -0
  39. package/src/components/form-render/container-item/index.js +24 -0
  40. package/src/components/form-render/container-item/sub-form-item.vue.js +429 -0
  41. package/src/components/form-render/container-item/tab-item.vue.js +160 -0
  42. package/src/components/form-render/container-item/table-cell-item.vue.js +95 -0
  43. package/src/components/form-render/container-item/table-item.vue.js +96 -0
  44. package/src/components/form-render/container-item/vf-collapse-item.vue.js +252 -0
  45. package/src/components/form-render/container-item/vf-dialog-item.vue.js +12 -0
  46. package/src/components/form-render/container-item/vf-drawer-item.vue.js +12 -0
  47. package/src/components/form-render/index.vue.js +12 -14
  48. package/src/components/http-editor/index.vue.js +10 -10
  49. package/src/components/public/ActionButtonListRender.vue.js +19 -24
  50. package/src/lang/en-US.js +1 -3
  51. package/src/lang/zh-CN.js +0 -3
  52. package/src/utils/useEmitter.js +57 -0
  53. package/src/utils/util.js +50 -49
  54. package/stats.html +1 -1
  55. package/styles/style.css +1 -1
  56. package/src/components/form-designer/setting-panel/property-editor/displayStyle-editor.vue.js +0 -46
  57. package/src/components/form-designer/setting-panel/property-editor/event-handler/onVformAdd-editor.vue.js +0 -49
  58. package/src/components/form-designer/setting-panel/property-editor/multipleSelect-editor.vue.js +0 -30
  59. package/src/components/form-designer/setting-panel/property-editor/uploadTip-editor.vue.js +0 -31
  60. package/src/components/form-designer/setting-panel/property-editor/uploadURL-editor.vue.js +0 -44
  61. package/src/components/form-designer/setting-panel/property-editor/withCredentials-editor.vue.js +0 -30
@@ -0,0 +1,319 @@
1
+ import v from "../../../utils/emitter.js";
2
+ import I from "../../../utils/i18n.js";
3
+ import { deepClone as F, generateId as m, traverseFieldWidgetsOfContainer as T } from "../../../utils/util.js";
4
+ import y from "../refMixin.js";
5
+ import A from "./container-item-wrapper.vue.js";
6
+ import M from "./containerItemMixin.js";
7
+ import E from "../../form-designer/form-widget/field-widget/index.js";
8
+ import { TpfConfirm as B } from "../../../hooks/TpfConfirm.js";
9
+ import { SvgIcon as N } from "tmgc2-share";
10
+ import { resolveComponent as f, createBlock as p, openBlock as s, withCtx as l, withDirectives as S, createElementBlock as u, createElementVNode as r, Fragment as R, renderList as C, normalizeClass as _, createVNode as h, vShow as W, toDisplayString as L, resolveDynamicComponent as O, createCommentVNode as V, createTextVNode as H } from "vue";
11
+ /* empty css */
12
+ import j from "../../../../_virtual/_plugin-vue_export-helper.js";
13
+ const x = {
14
+ name: "grid-sub-form-item",
15
+ componentName: "ContainerItem",
16
+ mixins: [v, I, y, M],
17
+ components: {
18
+ SvgIcon: N,
19
+ ContainerItemWrapper: A,
20
+ ...E
21
+ },
22
+ props: {
23
+ widget: Object
24
+ },
25
+ provide() {
26
+ return {
27
+ getSubFormFieldFlag: () => !0,
28
+ getSubFormName: () => this.widget.options.name
29
+ };
30
+ },
31
+ inject: ["refList", "sfRefList", "globalModel", "getReadMode"],
32
+ data() {
33
+ return {
34
+ rowIdData: [],
35
+ widgetSchemaData: [],
36
+ actionDisabled: !1,
37
+ insertDisabled: !1,
38
+ //是否禁止新增、插入记录
39
+ deleteDisabled: !1,
40
+ //是否禁止删除记录
41
+ fieldWidgetList: []
42
+ };
43
+ },
44
+ computed: {
45
+ isReadMode() {
46
+ return this.getReadMode();
47
+ },
48
+ actionBtnsClass() {
49
+ return this.widget.options.actionColumnPosition, "right-action-column";
50
+ }
51
+ },
52
+ created() {
53
+ this.initRefList(), this.registerSubFormToRefList(), this.initRowIdData(!0), this.initWidgetSchemaData(), this.initEventHandler();
54
+ },
55
+ mounted() {
56
+ this.extractFieldWidgetList(), this.handleSubFormFirstRowAdd();
57
+ },
58
+ beforeUnmount() {
59
+ this.unregisterFromRefList();
60
+ },
61
+ methods: {
62
+ extractFieldWidgetList() {
63
+ this.fieldWidgetList.splice(0, this.fieldWidgetList.length);
64
+ const t = (e) => {
65
+ this.fieldWidgetList.push(e);
66
+ };
67
+ T(this.widget, t);
68
+ },
69
+ getLabelAlign(t, e) {
70
+ return e.options.labelAlign || t.options.labelAlign;
71
+ },
72
+ registerSubFormToRefList() {
73
+ this.widget.type === "grid-sub-form" && (this.sfRefList[this.widget.options.name] = this);
74
+ },
75
+ initRowIdData(t) {
76
+ if (this.widget.type === "grid-sub-form") {
77
+ this.rowIdData.splice(0, this.rowIdData.length);
78
+ const e = this.formModel[this.widget.options.name];
79
+ e && e.length > 0 && (e.forEach(() => {
80
+ this.rowIdData.push("id" + m());
81
+ }), t && setTimeout(() => {
82
+ this.handleSubFormRowChange(e);
83
+ }, 800));
84
+ }
85
+ },
86
+ addToRowIdData() {
87
+ this.rowIdData.push("id" + m());
88
+ },
89
+ insertToRowIdData(t) {
90
+ this.rowIdData.splice(t, 0, "id" + m());
91
+ },
92
+ deleteFromRowIdData(t) {
93
+ this.rowIdData.splice(t, 1);
94
+ },
95
+ getRowIdData() {
96
+ return this.rowIdData;
97
+ },
98
+ getWidgetRefOfSubForm(t, e) {
99
+ const i = t + "@row" + this.rowIdData[e];
100
+ return this.getWidgetRef(i);
101
+ },
102
+ initWidgetSchemaData() {
103
+ if (this.widget.type !== "grid-sub-form")
104
+ return;
105
+ const t = this.rowIdData.length;
106
+ if (this.widgetSchemaData.splice(0, this.widgetSchemaData.length), t > 0)
107
+ for (let e = 0; e < t; e++) {
108
+ const i = [];
109
+ this.widget.widgetList.forEach((a) => {
110
+ i.push(this.cloneSchemaOfWidget(a));
111
+ }), this.widgetSchemaData.push(i);
112
+ }
113
+ },
114
+ addToWidgetSchemaData(t) {
115
+ const e = [];
116
+ this.widget.widgetList.forEach((i) => {
117
+ e.push(this.cloneSchemaOfWidget(i));
118
+ }), t === void 0 ? this.widgetSchemaData.push(e) : this.widgetSchemaData.splice(t, 0, e);
119
+ },
120
+ deleteFromWidgetSchemaData(t) {
121
+ this.widgetSchemaData.splice(t, 1);
122
+ },
123
+ cloneSchemaOfWidget(t) {
124
+ const e = F(t);
125
+ return e.id = t.type + m(), e;
126
+ },
127
+ initEventHandler() {
128
+ this.widget.type === "grid-sub-form" && this.on$("setFormData", (t) => {
129
+ this.initRowIdData(!1), this.initWidgetSchemaData();
130
+ const e = t[this.widget.options.name] || [];
131
+ setTimeout(() => {
132
+ this.handleSubFormRowChange(e);
133
+ }, 800);
134
+ });
135
+ },
136
+ handleSubFormFirstRowAdd() {
137
+ if (this.widget.type === "grid-sub-form" && this.widget.options.showBlankRow && this.rowIdData.length === 1) {
138
+ const t = this.formModel[this.widget.options.name] || [];
139
+ this.$nextTick(() => {
140
+ this.handleSubFormRowAdd(t, this.rowIdData[0]), this.handleSubFormRowChange(t);
141
+ });
142
+ }
143
+ },
144
+ addSubFormRow() {
145
+ const t = {};
146
+ this.fieldWidgetList.forEach((i) => {
147
+ i.formItemFlag && (t[i.options.name] = i.options.defaultValue);
148
+ });
149
+ const e = this.formModel[this.widget.options.name] || [];
150
+ e.push(t), this.addToRowIdData(), this.addToWidgetSchemaData(), this.$nextTick(() => {
151
+ this.handleSubFormRowAdd(
152
+ e,
153
+ this.rowIdData[e.length - 1]
154
+ ), this.handleSubFormRowChange(e);
155
+ });
156
+ },
157
+ insertSubFormRow(t) {
158
+ const e = {};
159
+ this.fieldWidgetList.forEach((a) => {
160
+ a.formItemFlag && (e[a.options.name] = a.options.defaultValue);
161
+ });
162
+ const i = this.formModel[this.widget.options.name] || [];
163
+ i.splice(t, 0, e), this.insertToRowIdData(t), this.addToWidgetSchemaData(t), this.$nextTick(() => {
164
+ this.handleSubFormRowInsert(i, this.rowIdData[t]), this.handleSubFormRowChange(i);
165
+ });
166
+ },
167
+ deleteSubFormRow(t) {
168
+ B({
169
+ type: "confirm",
170
+ content: this.i18nt("render.hint.deleteSubFormRow") + "?",
171
+ title: this.i18nt("render.hint.prompt"),
172
+ okText: this.i18nt("render.hint.confirm"),
173
+ cancelText: this.i18nt("render.hint.cancel")
174
+ }).then(() => {
175
+ const e = this.formModel[this.widget.options.name] || [], i = F(e[t]);
176
+ e.splice(t, 1), this.deleteFromRowIdData(t), this.deleteFromWidgetSchemaData(t), this.$nextTick(() => {
177
+ this.handleSubFormRowDelete(e, i), this.handleSubFormRowChange(e);
178
+ });
179
+ }).catch(() => {
180
+ });
181
+ },
182
+ handleSubFormRowChange(t) {
183
+ this.widget.options.onSubFormRowChange && new Function(
184
+ "subFormData",
185
+ this.widget.options.onSubFormRowChange
186
+ ).call(this, t);
187
+ },
188
+ handleSubFormRowAdd(t, e) {
189
+ this.widget.options.onSubFormRowAdd && new Function(
190
+ "subFormData",
191
+ "newRowId",
192
+ this.widget.options.onSubFormRowAdd
193
+ ).call(this, t, e);
194
+ },
195
+ handleSubFormRowInsert(t, e) {
196
+ this.widget.options.onSubFormRowInsert && new Function(
197
+ "subFormData",
198
+ "newRowId",
199
+ this.widget.options.onSubFormRowInsert
200
+ ).call(this, t, e);
201
+ },
202
+ handleSubFormRowDelete(t, e) {
203
+ this.widget.options.onSubFormRowDelete && new Function(
204
+ "subFormData",
205
+ "deletedDataRow",
206
+ this.widget.options.onSubFormRowDelete
207
+ ).call(this, t, e);
208
+ },
209
+ setDisabled(t) {
210
+ t ? this.disableGridSubForm() : this.enableGridSubForm();
211
+ },
212
+ /**
213
+ * 设置单行子表单是否禁止新增、插入记录
214
+ * @param flag
215
+ */
216
+ setInsertDisabled(t) {
217
+ this.insertDisabled = t;
218
+ },
219
+ /**
220
+ * 设置单行子表单是否禁止删除记录
221
+ * @param flag
222
+ */
223
+ setDeleteDisabled(t) {
224
+ this.deleteDisabled = t;
225
+ }
226
+ }
227
+ }, z = { class: "row-no-column" }, G = { class: "row-number-span" }, P = { class: "grid-sub-form-data-row" }, U = { class: "header-row" };
228
+ function q(t, e, i, a, o, n) {
229
+ const w = f("svg-icon"), g = f("a-button"), k = f("container-item-wrapper");
230
+ return s(), p(k, { widget: i.widget }, {
231
+ default: l(() => [
232
+ S((s(), u("div", {
233
+ key: i.widget.id,
234
+ class: "sub-form-container"
235
+ }, [
236
+ (s(!0), u(R, null, C(o.rowIdData, (D, d) => (s(), u("div", {
237
+ class: "sub-form-row",
238
+ key: D
239
+ }, [
240
+ r("div", {
241
+ class: _(["sub-form-action-column hide-label", n.actionBtnsClass])
242
+ }, [
243
+ S(r("div", {
244
+ class: _(["action-button-column", n.actionBtnsClass])
245
+ }, [
246
+ h(g, {
247
+ type: "link",
248
+ title: t.i18nt("render.hint.insertSubFormRow"),
249
+ disabled: o.actionDisabled || o.deleteDisabled,
250
+ onClick: (b) => n.insertSubFormRow(d)
251
+ }, {
252
+ icon: l(() => [
253
+ h(w, { "icon-class": "icon-el-plus" })
254
+ ]),
255
+ _: 2
256
+ }, 1032, ["title", "disabled", "onClick"]),
257
+ h(g, {
258
+ type: "link",
259
+ title: t.i18nt("render.hint.deleteSubFormRow"),
260
+ disabled: o.actionDisabled || o.deleteDisabled,
261
+ onClick: (b) => n.deleteSubFormRow(d)
262
+ }, {
263
+ icon: l(() => [
264
+ h(w, { "icon-class": "icon-el-delete" })
265
+ ]),
266
+ _: 2
267
+ }, 1032, ["title", "disabled", "onClick"])
268
+ ], 2), [
269
+ [W, !n.isReadMode]
270
+ ])
271
+ ], 2),
272
+ r("div", z, [
273
+ r("span", G, "#" + L(d + 1), 1)
274
+ ]),
275
+ r("div", P, [
276
+ (s(!0), u(R, null, C(i.widget.widgetList, (b, c) => (s(), p(O(t.getComponentByContainer(b)), {
277
+ key: o.widgetSchemaData[d][c].id,
278
+ widget: o.widgetSchemaData[d][c],
279
+ "parent-list": i.widget.widgetList,
280
+ "index-of-parent-list": c,
281
+ "parent-widget": i.widget,
282
+ "sub-form-row-id": D,
283
+ "sub-form-row-index": d,
284
+ "sub-form-col-index": c
285
+ }, null, 8, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))), 128))
286
+ ])
287
+ ]))), 128)),
288
+ r("div", U, [
289
+ n.isReadMode ? V("", !0) : (s(), p(g, {
290
+ key: 0,
291
+ block: "",
292
+ disabled: o.actionDisabled || o.insertDisabled,
293
+ shape: "round",
294
+ type: "dashed",
295
+ size: "small",
296
+ class: "action-button",
297
+ onClick: n.addSubFormRow,
298
+ title: t.i18nt("render.hint.subFormAddActionHint")
299
+ }, {
300
+ icon: l(() => [
301
+ h(w, { "icon-class": "icon-el-plus" })
302
+ ]),
303
+ default: l(() => [
304
+ H(" " + L(t.i18nt("render.hint.subFormAddAction")), 1)
305
+ ]),
306
+ _: 1
307
+ }, 8, ["disabled", "onClick", "title"]))
308
+ ])
309
+ ])), [
310
+ [W, !i.widget.options.hidden]
311
+ ])
312
+ ]),
313
+ _: 1
314
+ }, 8, ["widget"]);
315
+ }
316
+ const st = /* @__PURE__ */ j(x, [["render", q], ["__scopeId", "data-v-5f0ac14f"]]);
317
+ export {
318
+ st as default
319
+ };
@@ -0,0 +1,24 @@
1
+ import * as a from "./container-item-wrapper.vue.js";
2
+ import * as o from "./data-table-item.vue.js";
3
+ import * as i from "./grid-col-item.vue.js";
4
+ import * as s from "./grid-item.vue.js";
5
+ import * as f from "./grid-sub-form-item.vue.js";
6
+ import * as l from "./sub-form-item.vue.js";
7
+ import * as p from "./tab-item.vue.js";
8
+ import * as u from "./table-cell-item.vue.js";
9
+ import * as n from "./table-item.vue.js";
10
+ import * as v from "./vf-collapse-item.vue.js";
11
+ import * as d from "./vf-dialog-item.vue.js";
12
+ import * as b from "./vf-drawer-item.vue.js";
13
+ const e = /* @__PURE__ */ Object.assign({ "./container-item-wrapper.vue": a, "./data-table-item.vue": o, "./grid-col-item.vue": i, "./grid-item.vue": s, "./grid-sub-form-item.vue": f, "./sub-form-item.vue": l, "./tab-item.vue": p, "./table-cell-item.vue": u, "./table-item.vue": n, "./vf-collapse-item.vue": v, "./vf-dialog-item.vue": d, "./vf-drawer-item.vue": b }), I = {
14
+ install(m) {
15
+ for (const t in e) {
16
+ const r = e[t].default.name;
17
+ m.component(r, e[t].default);
18
+ }
19
+ }
20
+ };
21
+ export {
22
+ e as ContainerWidgetMap,
23
+ I as default
24
+ };