@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,319 +0,0 @@
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 N from "../../svg-icon/index.vue.js";
10
- import { resolveComponent as f, createBlock as p, openBlock as n, 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, s) {
229
- const w = f("svg-icon"), g = f("a-button"), k = f("container-item-wrapper");
230
- return n(), p(k, { widget: i.widget }, {
231
- default: l(() => [
232
- S((n(), u("div", {
233
- key: i.widget.id,
234
- class: "sub-form-container"
235
- }, [
236
- (n(!0), u(R, null, C(o.rowIdData, (D, d) => (n(), u("div", {
237
- class: "sub-form-row",
238
- key: D
239
- }, [
240
- r("div", {
241
- class: _(["sub-form-action-column hide-label", s.actionBtnsClass])
242
- }, [
243
- S(r("div", {
244
- class: _(["action-button-column", s.actionBtnsClass])
245
- }, [
246
- h(g, {
247
- type: "link",
248
- title: t.i18nt("render.hint.insertSubFormRow"),
249
- disabled: o.actionDisabled || o.deleteDisabled,
250
- onClick: (b) => s.insertSubFormRow(d)
251
- }, {
252
- icon: l(() => [
253
- h(w, { "icon-class": "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) => s.deleteSubFormRow(d)
262
- }, {
263
- icon: l(() => [
264
- h(w, { "icon-class": "el-delete" })
265
- ]),
266
- _: 2
267
- }, 1032, ["title", "disabled", "onClick"])
268
- ], 2), [
269
- [W, !s.isReadMode]
270
- ])
271
- ], 2),
272
- r("div", z, [
273
- r("span", G, "#" + L(d + 1), 1)
274
- ]),
275
- r("div", P, [
276
- (n(!0), u(R, null, C(i.widget.widgetList, (b, c) => (n(), 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
- s.isReadMode ? V("", !0) : (n(), 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: s.addSubFormRow,
298
- title: t.i18nt("render.hint.subFormAddActionHint")
299
- }, {
300
- icon: l(() => [
301
- h(w, { "icon-class": "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 nt = /* @__PURE__ */ j(x, [["render", q], ["__scopeId", "data-v-b0ed629c"]]);
317
- export {
318
- nt as default
319
- };
@@ -1,24 +0,0 @@
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
- };