@kp-ui/lowcode 2.14.0-alpha.4 → 2.14.0-beta

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 (57) hide show
  1. package/install.js +24 -45
  2. package/package.json +1 -1
  3. package/src/components/form-designer/form-widget/container-widget/container-wrapper.vue.js +17 -17
  4. package/src/components/form-designer/form-widget/container-widget/grid-col-widget.vue.js +10 -10
  5. package/src/components/form-designer/form-widget/container-widget/index.js +6 -7
  6. package/src/components/form-designer/form-widget/container-widget/table-cell-widget.vue.js +9 -9
  7. package/src/components/form-designer/form-widget/field-widget/button-widget.vue.js +2 -2
  8. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +1 -1
  9. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +32 -32
  10. package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +3 -3
  11. package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +7 -7
  12. package/src/components/form-designer/form-widget/field-widget/static-content-wrapper.vue.js +18 -18
  13. package/src/components/form-designer/index.vue.js +21 -25
  14. package/src/components/form-designer/setting-panel/index.vue.js +55 -54
  15. package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue2.js +10 -10
  16. package/src/components/form-designer/setting-panel/property-editor/buttonIcon-editor.vue.js +14 -11
  17. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +2 -2
  18. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +116 -118
  19. package/src/components/form-designer/setting-panel/property-editor/container-grid/gutter-editor.vue.js +11 -11
  20. package/src/components/form-designer/setting-panel/property-editor/field-button/danger-editor.vue.js +13 -11
  21. package/src/components/form-designer/setting-panel/property-editor/field-button/ghost-editor.vue.js +15 -13
  22. package/src/components/form-designer/setting-panel/property-editor/field-button/icon-editor.vue.js +17 -14
  23. package/src/components/form-designer/setting-panel/property-editor/field-button/shape-editor.vue.js +14 -12
  24. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +15 -11
  25. package/src/components/form-designer/setting-panel/property-editor/field-file-upload/file-upload-fileTypes-editor.vue.js +2 -2
  26. package/src/components/form-designer/setting-panel/property-editor/field-picture-upload/picture-upload-fileTypes-editor.vue.js +2 -2
  27. package/src/components/form-designer/setting-panel/property-editor/field-treeSelect/treeSelect-treeDefaultExpandAll-editor.vue.js +16 -14
  28. package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue.js +16 -13
  29. package/src/components/form-designer/setting-panel/property-editor/name-editor.vue.js +7 -3
  30. package/src/components/form-designer/setting-panel/property-editor/placement-editor.vue.js +24 -22
  31. package/src/components/form-designer/setting-panel/property-editor/validation-editor.vue.js +15 -12
  32. package/src/components/form-designer/toolbar-panel/index.vue.js +2 -2
  33. package/src/components/form-designer/toolbar-panel/index.vue2.js +66 -67
  34. package/src/components/form-designer/widget-panel/advanced/data-table.js +6 -1
  35. package/src/components/form-designer/widget-panel/basicFields/color.js +2 -7
  36. package/src/components/form-designer/widget-panel/index.vue.js +16 -16
  37. package/src/components/form-render/index.vue.js +10 -10
  38. package/src/components/http-editor/index.vue.js +27 -23
  39. package/src/components/public/ActionButtonListRender.vue.js +24 -19
  40. package/src/components/public/ActionButtonListRender.vue2.js +1 -1
  41. package/src/lang/en-US.js +17 -0
  42. package/src/lang/zh-CN.js +17 -0
  43. package/stats.html +1 -1
  44. package/styles/style.css +1 -1
  45. package/types/install.d.ts +3 -14
  46. package/src/components/form-render/container-item/data-table-item.vue.js +0 -149
  47. package/src/components/form-render/container-item/grid-col-item.vue.js +0 -149
  48. package/src/components/form-render/container-item/grid-item.vue.js +0 -92
  49. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +0 -319
  50. package/src/components/form-render/container-item/index.js +0 -24
  51. package/src/components/form-render/container-item/sub-form-item.vue.js +0 -429
  52. package/src/components/form-render/container-item/tab-item.vue.js +0 -160
  53. package/src/components/form-render/container-item/table-cell-item.vue.js +0 -95
  54. package/src/components/form-render/container-item/table-item.vue.js +0 -96
  55. package/src/components/form-render/container-item/vf-collapse-item.vue.js +0 -252
  56. package/src/components/form-render/container-item/vf-dialog-item.vue.js +0 -12
  57. package/src/components/form-render/container-item/vf-drawer-item.vue.js +0 -12
@@ -1,429 +0,0 @@
1
- import M from "../../../utils/emitter.js";
2
- import N from "../../../utils/i18n.js";
3
- import { deepClone as A, generateId as y } from "../../../utils/util.js";
4
- import E from "../refMixin.js";
5
- import V from "./container-item-wrapper.vue.js";
6
- import z from "./containerItemMixin.js";
7
- import B from "../../form-designer/form-widget/field-widget/index.js";
8
- import H from "../../svg-icon/index.vue.js";
9
- import { TpfConfirm as j } from "../../../hooks/TpfConfirm.js";
10
- import { resolveComponent as S, createBlock as g, openBlock as n, withCtx as r, withDirectives as R, createElementBlock as s, createVNode as a, createElementVNode as u, createCommentVNode as b, toDisplayString as c, createTextVNode as D, Fragment as h, renderList as C, normalizeStyle as T, normalizeClass as q, vShow as _, resolveDynamicComponent as O } from "vue";
11
- /* empty css */
12
- import P from "../../../../_virtual/_plugin-vue_export-helper.js";
13
- const U = {
14
- name: "sub-form-item",
15
- componentName: "ContainerItem",
16
- mixins: [M, N, E, z],
17
- components: {
18
- ContainerItemWrapper: V,
19
- ...B,
20
- SvgIcon: H
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
- fieldSchemaData: [],
36
- actionDisabled: !1,
37
- insertDisabled: !1,
38
- //是否禁止新增、插入记录
39
- deleteDisabled: !1
40
- //是否禁止删除记录
41
- };
42
- },
43
- computed: {
44
- isReadMode() {
45
- return this.getReadMode();
46
- }
47
- },
48
- created() {
49
- this.initRefList(), this.registerSubFormToRefList(), this.initRowIdData(!0), this.initFieldSchemaData(), this.initEventHandler();
50
- },
51
- mounted() {
52
- this.handleSubFormFirstRowAdd();
53
- },
54
- beforeUnmount() {
55
- this.unregisterFromRefList();
56
- },
57
- methods: {
58
- getLabelAlign(e, t) {
59
- return t.options.labelAlign || e.options.labelAlign;
60
- },
61
- registerSubFormToRefList() {
62
- this.widget.type === "sub-form" && (this.sfRefList[this.widget.options.name] = this);
63
- },
64
- initRowIdData(e) {
65
- if (this.widget.type === "sub-form") {
66
- this.rowIdData.splice(0, this.rowIdData.length);
67
- const t = this.formModel[this.widget.options.name];
68
- t && t.length > 0 && (t.forEach(() => {
69
- this.rowIdData.push("id" + y());
70
- }), e && setTimeout(() => {
71
- this.handleSubFormRowChange(t);
72
- }, 800));
73
- }
74
- },
75
- addToRowIdData() {
76
- this.rowIdData.push("id" + y());
77
- },
78
- insertToRowIdData(e) {
79
- this.rowIdData.splice(e, 0, "id" + y());
80
- },
81
- deleteFromRowIdData(e) {
82
- this.rowIdData.splice(e, 1);
83
- },
84
- getRowIdData() {
85
- return this.rowIdData;
86
- },
87
- getWidgetRefOfSubForm(e, t) {
88
- const i = e + "@row" + this.rowIdData[t];
89
- return this.getWidgetRef(i);
90
- },
91
- initFieldSchemaData() {
92
- if (this.widget.type !== "sub-form")
93
- return;
94
- const e = this.rowIdData.length;
95
- if (this.fieldSchemaData.splice(0, this.fieldSchemaData.length), e > 0)
96
- for (let t = 0; t < e; t++) {
97
- const i = [];
98
- this.widget.widgetList.forEach((f) => {
99
- i.push(this.cloneFieldSchema(f));
100
- }), this.fieldSchemaData.push(i);
101
- }
102
- },
103
- addToFieldSchemaData(e) {
104
- const t = [];
105
- this.widget.widgetList.forEach((i) => {
106
- t.push(this.cloneFieldSchema(i));
107
- }), e === void 0 ? this.fieldSchemaData.push(t) : this.fieldSchemaData.splice(e, 0, t);
108
- },
109
- deleteFromFieldSchemaData(e) {
110
- this.fieldSchemaData.splice(e, 1);
111
- },
112
- cloneFieldSchema(e) {
113
- const t = A(e);
114
- return t.id = e.type + y(), t;
115
- },
116
- initEventHandler() {
117
- this.widget.type === "sub-form" && this.on$("setFormData", (e) => {
118
- this.initRowIdData(!1), this.initFieldSchemaData();
119
- const t = e[this.widget.options.name] || [];
120
- setTimeout(() => {
121
- this.handleSubFormRowChange(t);
122
- }, 800);
123
- });
124
- },
125
- handleSubFormFirstRowAdd() {
126
- if (this.widget.type === "sub-form" && this.widget.options.showBlankRow && this.rowIdData.length === 1) {
127
- const e = this.formModel[this.widget.options.name] || [];
128
- this.handleSubFormRowAdd(e, this.rowIdData[0]), this.handleSubFormRowChange(e);
129
- }
130
- },
131
- addSubFormRow() {
132
- const e = {};
133
- this.widget.widgetList.forEach((i) => {
134
- i.formItemFlag && (e[i.options.name] = i.options.defaultValue);
135
- });
136
- const t = this.formModel[this.widget.options.name] || [];
137
- t.push(e), this.addToRowIdData(), this.addToFieldSchemaData(), this.handleSubFormRowAdd(t, this.rowIdData[t.length - 1]), this.handleSubFormRowChange(t);
138
- },
139
- insertSubFormRow(e) {
140
- const t = {};
141
- this.widget.widgetList.forEach((f) => {
142
- f.formItemFlag && (t[f.options.name] = f.options.defaultValue);
143
- });
144
- const i = this.formModel[this.widget.options.name] || [];
145
- i.splice(e, 0, t), this.insertToRowIdData(e), this.addToFieldSchemaData(e), this.handleSubFormRowInsert(i, this.rowIdData[e]), this.handleSubFormRowChange(i);
146
- },
147
- deleteSubFormRow(e) {
148
- j({
149
- type: "confirm",
150
- content: this.i18nt("render.hint.deleteSubFormRow") + "?",
151
- title: this.i18nt("render.hint.prompt"),
152
- okText: this.i18nt("render.hint.confirm"),
153
- cancelText: this.i18nt("render.hint.cancel")
154
- }).then(() => {
155
- const t = this.formModel[this.widget.options.name] || [], i = A(t[e]);
156
- t.splice(e, 1), this.deleteFromRowIdData(e), this.deleteFromFieldSchemaData(e), this.handleSubFormRowDelete(t, i), this.handleSubFormRowChange(t);
157
- }).catch(() => {
158
- });
159
- },
160
- handleSubFormRowChange(e) {
161
- this.widget.options.onSubFormRowChange && new Function(
162
- "subFormData",
163
- this.widget.options.onSubFormRowChange
164
- ).call(this, e);
165
- },
166
- handleSubFormRowAdd(e, t) {
167
- this.widget.options.onSubFormRowAdd && new Function(
168
- "subFormData",
169
- "newRowId",
170
- this.widget.options.onSubFormRowAdd
171
- ).call(this, e, t);
172
- },
173
- handleSubFormRowInsert(e, t) {
174
- this.widget.options.onSubFormRowInsert && new Function(
175
- "subFormData",
176
- "newRowId",
177
- this.widget.options.onSubFormRowInsert
178
- ).call(this, e, t);
179
- },
180
- handleSubFormRowDelete(e, t) {
181
- this.widget.options.onSubFormRowDelete && new Function(
182
- "subFormData",
183
- "deletedDataRow",
184
- this.widget.options.onSubFormRowDelete
185
- ).call(this, e, t);
186
- },
187
- setDisabled(e) {
188
- e ? this.disableSubForm() : this.enableSubForm();
189
- },
190
- /**
191
- * 设置单行子表单是否禁止新增、插入记录
192
- * @param flag
193
- */
194
- setInsertDisabled(e) {
195
- this.insertDisabled = e;
196
- },
197
- /**
198
- * 设置单行子表单是否禁止删除记录
199
- * @param flag
200
- */
201
- setDeleteDisabled(e) {
202
- this.deleteDisabled = e;
203
- }
204
- }
205
- }, G = { class: "action-header-column" }, J = { class: "action-label" }, K = {
206
- key: 0,
207
- class: "row-no-header-column"
208
- }, Q = {
209
- key: 0,
210
- class: "custom-label"
211
- }, X = ["title"], Y = { class: "action-header-column" }, Z = { class: "action-label" }, x = { class: "sub-form-action-column hide-label" }, W = { class: "action-button-column" }, $ = {
212
- key: 0,
213
- class: "row-no-column"
214
- }, ee = {
215
- key: 0,
216
- class: "row-number-span"
217
- }, te = { class: "sub-form-action-column hide-label" }, ie = { class: "action-button-column" };
218
- function oe(e, t, i, f, l, d) {
219
- const m = S("svg-icon"), F = S("a-button"), v = S("a-tooltip"), I = S("a-row"), L = S("container-item-wrapper");
220
- return n(), g(L, { widget: i.widget }, {
221
- default: r(() => [
222
- R((n(), s("div", {
223
- key: i.widget.id,
224
- class: "sub-form-container"
225
- }, [
226
- a(I, { class: "header-row" }, {
227
- default: r(() => [
228
- u("div", G, [
229
- u("span", J, c(e.i18nt("render.hint.subFormAction")), 1),
230
- d.isReadMode ? b("", !0) : (n(), g(F, {
231
- key: 0,
232
- disabled: l.actionDisabled || l.insertDisabled,
233
- shape: "round",
234
- type: "primary",
235
- size: "small",
236
- class: "action-button",
237
- onClick: d.addSubFormRow,
238
- title: e.i18nt("render.hint.subFormAddActionHint")
239
- }, {
240
- default: r(() => [
241
- D(c(e.i18nt("render.hint.subFormAddAction")), 1),
242
- a(m, { "icon-class": "el-plus" })
243
- ]),
244
- _: 1
245
- }, 8, ["disabled", "onClick", "title"]))
246
- ]),
247
- i.widget.options.showRowNumber ? (n(), s("div", K, [
248
- u("span", null, c(e.i18nt("render.hint.subFormRowNo")), 1)
249
- ])) : b("", !0),
250
- (n(!0), s(h, null, C(i.widget.widgetList, (o) => (n(), s(h, {
251
- key: o.id + "thc"
252
- }, [
253
- o.options.hidden ? b("", !0) : (n(), s("div", {
254
- key: 0,
255
- class: q(["field-header-column", [
256
- d.getLabelAlign(i.widget, o),
257
- o.options.required ? "is-required" : ""
258
- ]]),
259
- style: T({ width: o.options.columnWidth })
260
- }, [
261
- o.options.labelIconClass ? (n(), s("span", Q, [
262
- o.options.labelIconPosition === "front" ? (n(), s(h, { key: 0 }, [
263
- o.options.labelTooltip ? (n(), s(h, { key: 0 }, [
264
- a(v, {
265
- title: o.options.labelTooltip
266
- }, {
267
- default: r(() => [
268
- a(m, {
269
- "icon-class": o.options.labelIconClass
270
- }, null, 8, ["icon-class"])
271
- ]),
272
- _: 2
273
- }, 1032, ["title"]),
274
- D(" " + c(o.options.label), 1)
275
- ], 64)) : (n(), s(h, { key: 1 }, [
276
- a(m, {
277
- "icon-class": o.options.labelIconClass
278
- }, null, 8, ["icon-class"]),
279
- D(" " + c(o.options.label), 1)
280
- ], 64))
281
- ], 64)) : o.options.labelIconPosition === "rear" ? (n(), s(h, { key: 1 }, [
282
- o.options.labelTooltip ? (n(), s(h, { key: 0 }, [
283
- D(c(o.options.label) + " ", 1),
284
- a(v, {
285
- title: o.options.labelTooltip
286
- }, {
287
- default: r(() => [
288
- a(m, {
289
- "icon-class": o.options.labelIconClass
290
- }, null, 8, ["icon-class"])
291
- ]),
292
- _: 2
293
- }, 1032, ["title"])
294
- ], 64)) : (n(), s(h, { key: 1 }, [
295
- D(c(o.options.label) + " ", 1),
296
- a(m, {
297
- "icon-class": o.options.labelIconClass
298
- }, null, 8, ["icon-class"])
299
- ], 64))
300
- ], 64)) : b("", !0)
301
- ])) : (n(), s("span", {
302
- key: 1,
303
- title: o.options.labelTooltip
304
- }, c(o.options.label), 9, X))
305
- ], 6))
306
- ], 64))), 128)),
307
- u("div", Y, [
308
- u("span", Z, c(e.i18nt("render.hint.subFormAction")), 1),
309
- d.isReadMode ? b("", !0) : (n(), g(F, {
310
- key: 0,
311
- disabled: l.actionDisabled || l.insertDisabled,
312
- shape: "round",
313
- type: "primary",
314
- size: "small",
315
- class: "action-button",
316
- onClick: d.addSubFormRow,
317
- title: e.i18nt("render.hint.subFormAddActionHint")
318
- }, {
319
- default: r(() => [
320
- D(c(e.i18nt("render.hint.subFormAddAction")) + " ", 1),
321
- a(m, { "icon-class": "el-plus" })
322
- ]),
323
- _: 1
324
- }, 8, ["disabled", "onClick", "title"]))
325
- ])
326
- ]),
327
- _: 1
328
- }),
329
- (n(!0), s(h, null, C(l.rowIdData, (o, w) => (n(), g(I, {
330
- class: "sub-form-row",
331
- key: o
332
- }, {
333
- default: r(() => [
334
- u("div", x, [
335
- u("div", W, [
336
- R(a(F, {
337
- disabled: l.actionDisabled || l.insertDisabled,
338
- shape: "circle",
339
- onClick: (p) => d.insertSubFormRow(w),
340
- title: e.i18nt("render.hint.insertSubFormRow")
341
- }, {
342
- default: r(() => [
343
- a(m, { "icon-class": "el-plus" })
344
- ]),
345
- _: 2
346
- }, 1032, ["disabled", "onClick", "title"]), [
347
- [_, !d.isReadMode]
348
- ]),
349
- R(a(F, {
350
- disabled: l.actionDisabled || l.deleteDisabled,
351
- shape: "circle",
352
- onClick: (p) => d.deleteSubFormRow(w),
353
- title: e.i18nt("render.hint.deleteSubFormRow")
354
- }, {
355
- default: r(() => [
356
- a(m, { "icon-class": "el-delete" })
357
- ]),
358
- _: 2
359
- }, 1032, ["disabled", "onClick", "title"]), [
360
- [_, !d.isReadMode]
361
- ])
362
- ])
363
- ]),
364
- i.widget.options.showRowNumber ? (n(), s("div", $, [
365
- i.widget.options.showRowNumber ? (n(), s("span", ee, "#" + c(w + 1), 1)) : b("", !0)
366
- ])) : b("", !0),
367
- (n(!0), s(h, null, C(i.widget.widgetList, (p, k) => (n(), s(h, {
368
- key: l.fieldSchemaData[w][k].id
369
- }, [
370
- p.options.hidden ? b("", !0) : (n(), s("div", {
371
- key: 0,
372
- class: "sub-form-table-column hide-label",
373
- style: T({ width: p.options.columnWidth })
374
- }, [
375
- (n(), g(O(p.type + "-widget"), {
376
- field: l.fieldSchemaData[w][k],
377
- "parent-list": i.widget.widgetList,
378
- "index-of-parent-list": k,
379
- "parent-widget": i.widget,
380
- "sub-form-row-id": o,
381
- "sub-form-row-index": w,
382
- "sub-form-col-index": k
383
- }, null, 8, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
384
- ], 4))
385
- ], 64))), 128)),
386
- u("div", te, [
387
- u("div", ie, [
388
- R(a(F, {
389
- disabled: l.actionDisabled || l.insertDisabled,
390
- shape: "circle",
391
- onClick: (p) => d.insertSubFormRow(w),
392
- title: e.i18nt("render.hint.insertSubFormRow")
393
- }, {
394
- default: r(() => [
395
- a(m, { "icon-class": "el-plus" })
396
- ]),
397
- _: 2
398
- }, 1032, ["disabled", "onClick", "title"]), [
399
- [_, !d.isReadMode]
400
- ]),
401
- R(a(F, {
402
- disabled: l.actionDisabled || l.deleteDisabled,
403
- shape: "circle",
404
- onClick: (p) => d.deleteSubFormRow(w),
405
- title: e.i18nt("render.hint.deleteSubFormRow")
406
- }, {
407
- default: r(() => [
408
- a(m, { "icon-class": "el-delete" })
409
- ]),
410
- _: 2
411
- }, 1032, ["disabled", "onClick", "title"]), [
412
- [_, !d.isReadMode]
413
- ])
414
- ])
415
- ])
416
- ]),
417
- _: 2
418
- }, 1024))), 128))
419
- ])), [
420
- [_, !i.widget.options.hidden]
421
- ])
422
- ]),
423
- _: 1
424
- }, 8, ["widget"]);
425
- }
426
- const pe = /* @__PURE__ */ P(U, [["render", oe], ["__scopeId", "data-v-3c5336d4"]]);
427
- export {
428
- pe as default
429
- };
@@ -1,160 +0,0 @@
1
- import _ from "../../../utils/emitter.js";
2
- import x from "../../../utils/i18n.js";
3
- import k from "../refMixin.js";
4
- import I from "./container-item-wrapper.vue.js";
5
- import R from "./containerItemMixin.js";
6
- import L from "../../form-designer/form-widget/field-widget/index.js";
7
- import { resolveComponent as f, createBlock as l, openBlock as o, withCtx as s, withDirectives as N, createElementBlock as m, createVNode as B, normalizeClass as M, Fragment as w, renderList as c, resolveDynamicComponent as g, createSlots as h, renderSlot as v, mergeProps as C, vShow as O } from "vue";
8
- /* empty css */
9
- import P from "../../../../_virtual/_plugin-vue_export-helper.js";
10
- const S = {
11
- name: "tab-item",
12
- componentName: "ContainerItem",
13
- mixins: [_, x, k, R],
14
- components: {
15
- ContainerItemWrapper: I,
16
- ...L
17
- },
18
- props: {
19
- widget: Object,
20
- subFormRowIndex: {
21
- /* 子表单组件行索引,从0开始计数 */
22
- type: Number,
23
- default: -1
24
- },
25
- subFormColIndex: {
26
- /* 子表单组件列索引,从0开始计数 */
27
- type: Number,
28
- default: -1
29
- },
30
- subFormRowId: {
31
- /* 子表单组件行Id,唯一id且不可变 */
32
- type: String,
33
- default: ""
34
- }
35
- },
36
- inject: ["refList", "sfRefList", "globalModel"],
37
- data() {
38
- return {
39
- activeTabName: ""
40
- };
41
- },
42
- computed: {
43
- visibleTabs() {
44
- return this.widget.tabs.filter((e) => !e.options.hidden);
45
- }
46
- },
47
- created() {
48
- this.initRefList(), this.initActiveTab(), this.handleOnCreated();
49
- },
50
- mounted() {
51
- this.handleOnMounted();
52
- },
53
- beforeUnmount() {
54
- this.unregisterFromRefList();
55
- },
56
- methods: {
57
- handleOnCreated() {
58
- this.widget.options.onCreated && new Function(this.widget.options.onCreated).call(this);
59
- },
60
- handleOnMounted() {
61
- this.designState || this.widget.options.onMounted && new Function(this.widget.options.onMounted).call(this);
62
- },
63
- changeCurrentTab(e) {
64
- var t, u;
65
- const i = ((u = (t = this.widget.tabs[e]) == null ? void 0 : t.options) == null ? void 0 : u.label) || "";
66
- this.onTabClick(i), this.widget.options.activeTab = i;
67
- },
68
- initActiveTab() {
69
- if (this.widget.type === "tab" && this.widget.tabs.length > 0) {
70
- const e = this.widget.tabs.filter((i) => i.options.active === !0);
71
- if (this.widget.options.activeTab) {
72
- this.activeTabName = this.widget.options.activeTab;
73
- return;
74
- }
75
- e.length > 0 ? this.activeTabName = e[0].options.label : this.activeTabName = this.widget.tabs[0].options.label;
76
- }
77
- },
78
- onTabClick(e) {
79
- const i = this.widget.tabs.findIndex((t) => t.options.label === e);
80
- this.widget.options.onTabClick && new Function("tab", "index", this.widget.options.onTabClick).call(this, e, i);
81
- }
82
- }
83
- };
84
- function j(e, i, t, u, G, p) {
85
- const T = f("a-tab-pane"), y = f("a-tabs"), F = f("container-item-wrapper");
86
- return o(), l(F, { widget: t.widget }, {
87
- default: s(() => [
88
- N((o(), m("div", {
89
- key: t.widget.id,
90
- class: "tab-container"
91
- }, [
92
- B(y, {
93
- ref: "fieldEditor",
94
- activeKey: t.widget.options.activeTab,
95
- "onUpdate:activeKey": i[0] || (i[0] = (n) => t.widget.options.activeTab = n),
96
- type: t.widget.options.type,
97
- tabBarGutter: t.widget.options.tabBarGutter,
98
- tabPosition: t.widget.options.tabPosition,
99
- class: M([e.customClass]),
100
- onTabClick: p.onTabClick
101
- }, {
102
- default: s(() => [
103
- (o(!0), m(w, null, c(p.visibleTabs, (n) => (o(), l(T, {
104
- tab: n.options.label,
105
- disabled: n.options.disabled,
106
- key: n.options.label
107
- }, {
108
- default: s(() => [
109
- (o(!0), m(w, null, c(n.widgetList, (a, d) => (o(), m(w, null, [
110
- a.category === "container" ? (o(), l(g(e.getComponentByContainer(a)), {
111
- widget: a,
112
- key: d,
113
- "parent-list": n.widgetList,
114
- "index-of-parent-list": d,
115
- "parent-widget": t.widget,
116
- "sub-form-row-id": t.subFormRowId,
117
- "sub-form-row-index": t.subFormRowIndex,
118
- "sub-form-col-index": t.subFormColIndex
119
- }, h({ _: 2 }, [
120
- c(Object.keys(e.$slots), (r) => ({
121
- name: r,
122
- fn: s((b) => [
123
- v(e.$slots, r, C({ ref_for: !0 }, b), void 0, !0)
124
- ])
125
- }))
126
- ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (o(), l(g(a.type + "-widget"), {
127
- field: a,
128
- key: d,
129
- "parent-list": n.widgetList,
130
- "index-of-parent-list": d,
131
- "parent-widget": t.widget,
132
- "sub-form-row-id": t.subFormRowId,
133
- "sub-form-row-index": t.subFormRowIndex,
134
- "sub-form-col-index": t.subFormColIndex
135
- }, h({ _: 2 }, [
136
- c(Object.keys(e.$slots), (r) => ({
137
- name: r,
138
- fn: s((b) => [
139
- v(e.$slots, r, C({ ref_for: !0 }, b), void 0, !0)
140
- ])
141
- }))
142
- ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
143
- ], 64))), 256))
144
- ]),
145
- _: 2
146
- }, 1032, ["tab", "disabled"]))), 128))
147
- ]),
148
- _: 3
149
- }, 8, ["activeKey", "type", "tabBarGutter", "tabPosition", "class", "onTabClick"])
150
- ])), [
151
- [O, !t.widget.options.hidden]
152
- ])
153
- ]),
154
- _: 3
155
- }, 8, ["widget"]);
156
- }
157
- const J = /* @__PURE__ */ P(S, [["render", j], ["__scopeId", "data-v-7375c2f0"]]);
158
- export {
159
- J as default
160
- };
@@ -1,95 +0,0 @@
1
- import p from "../../../utils/emitter.js";
2
- import x from "../../../utils/i18n.js";
3
- import C from "../refMixin.js";
4
- import y from "../../form-designer/form-widget/field-widget/index.js";
5
- import { createElementBlock as m, openBlock as n, normalizeStyle as I, normalizeClass as _, Fragment as l, renderList as s, createBlock as a, resolveDynamicComponent as u, createSlots as f, withCtx as c, renderSlot as w, mergeProps as b } from "vue";
6
- /* empty css */
7
- import h from "../../../../_virtual/_plugin-vue_export-helper.js";
8
- const F = {
9
- name: "TableCellItem",
10
- componentName: "ContainerItem",
11
- mixins: [p, x, C],
12
- components: {
13
- ...y
14
- },
15
- props: {
16
- widget: Object,
17
- rowIndex: Number,
18
- colIndex: Number,
19
- subFormRowIndex: {
20
- /* 子表单组件行索引,从0开始计数 */
21
- type: Number,
22
- default: -1
23
- },
24
- subFormColIndex: {
25
- /* 子表单组件列索引,从0开始计数 */
26
- type: Number,
27
- default: -1
28
- },
29
- subFormRowId: {
30
- /* 子表单组件行Id,唯一id且不可变 */
31
- type: String,
32
- default: ""
33
- }
34
- },
35
- inject: ["refList", "globalModel"],
36
- computed: {
37
- customClass() {
38
- return this.widget.options.customClass || "";
39
- }
40
- },
41
- created() {
42
- },
43
- methods: {}
44
- }, k = ["colspan", "rowspan"];
45
- function R(t, L, e, N, j, g) {
46
- return n(), m("td", {
47
- class: _(["table-cell", [g.customClass]]),
48
- colspan: e.widget.options.colspan || 1,
49
- rowspan: e.widget.options.rowspan || 1,
50
- style: I({
51
- width: e.widget.options.cellWidth + " !important" || "",
52
- height: e.widget.options.cellHeight + " !important" || ""
53
- })
54
- }, [
55
- (n(!0), m(l, null, s(e.widget.widgetList, (o, i) => (n(), m(l, null, [
56
- o.category === "container" ? (n(), a(u(t.getComponentByContainer(o)), {
57
- widget: o,
58
- key: i,
59
- "parent-list": e.widget.widgetList,
60
- "index-of-parent-list": i,
61
- "parent-widget": e.widget,
62
- "sub-form-row-id": e.subFormRowId,
63
- "sub-form-row-index": e.subFormRowIndex,
64
- "sub-form-col-index": e.subFormColIndex
65
- }, f({ _: 2 }, [
66
- s(Object.keys(t.$slots), (r) => ({
67
- name: r,
68
- fn: c((d) => [
69
- w(t.$slots, r, b({ ref_for: !0 }, d), void 0, !0)
70
- ])
71
- }))
72
- ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (n(), a(u(o.type + "-widget"), {
73
- field: o,
74
- key: i,
75
- "parent-list": e.widget.widgetList,
76
- "index-of-parent-list": i,
77
- "parent-widget": e.widget,
78
- "sub-form-row-id": e.subFormRowId,
79
- "sub-form-row-index": e.subFormRowIndex,
80
- "sub-form-col-index": e.subFormColIndex
81
- }, f({ _: 2 }, [
82
- s(Object.keys(t.$slots), (r) => ({
83
- name: r,
84
- fn: c((d) => [
85
- w(t.$slots, r, b({ ref_for: !0 }, d), void 0, !0)
86
- ])
87
- }))
88
- ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
89
- ], 64))), 256))
90
- ], 14, k);
91
- }
92
- const D = /* @__PURE__ */ h(F, [["render", R], ["__scopeId", "data-v-ae7f3b63"]]);
93
- export {
94
- D as default
95
- };