@kp-ui/lowcode 2.14.0-beta.12 → 2.14.0-beta.13

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.
@@ -0,0 +1,4 @@
1
+ import f from "./PanelItemDrag.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,341 +1,7 @@
1
- import { SvgIcon as _ } from "tmgc2-share";
2
- import w from "../../../lib/vuedraggable/src/vuedraggable.js";
3
- import { containers as C, basicFields as T, advancedFields as D, customFields as N, businessFields as L } from "./widgetsConfig.js";
4
- import { formTemplates as B } from "./templatesConfig.js";
5
- import { generateId as c, addWindowResizeHandler as W } from "../../../utils/util.js";
6
- import x from "../../../utils/i18n.js";
7
- import H from "axios";
8
- import { TpfConfirm as M } from "../../../hooks/TpfConfirm.js";
9
- import { resolveComponent as r, createElementBlock as $, openBlock as F, createElementVNode as a, createVNode as t, withCtx as l, createCommentVNode as b, createBlock as E, createTextVNode as g, toDisplayString as m } from "vue";
1
+ import o from "./index.vue2.js";
10
2
  /* empty css */
11
- import K from "../../../../_virtual/_plugin-vue_export-helper.js";
12
- const j = {
13
- name: "FieldPanel",
14
- mixins: [x],
15
- components: { SvgIcon: _, Draggable: w },
16
- props: {
17
- designer: Object
18
- },
19
- inject: ["getBannedWidgets", "getDesignerConfig"],
20
- data() {
21
- return {
22
- designerConfig: this.getDesignerConfig(),
23
- firstTab: "componentLib",
24
- scrollerHeight: 0,
25
- activeNames: [
26
- "containerTitle",
27
- "basicFieldTitle",
28
- "advancedFieldTitle",
29
- "yyzj",
30
- "customFieldTitle"
31
- ],
32
- containers: [],
33
- basicFields: [],
34
- advancedFields: [],
35
- customFields: [],
36
- businessFields: [],
37
- formTemplates: B,
38
- ftImages: []
39
- };
40
- },
41
- computed: {
42
- //
43
- },
44
- created() {
45
- this.loadWidgets();
46
- },
47
- mounted() {
48
- this.scrollerHeight = window.innerHeight - 56 + "px", W(() => {
49
- this.$nextTick(() => {
50
- this.scrollerHeight = window.innerHeight - 56 + "px";
51
- });
52
- });
53
- },
54
- methods: {
55
- isBanned(e) {
56
- return this.getBannedWidgets().indexOf(e) > -1;
57
- },
58
- showFormTemplates() {
59
- return this.designerConfig.formTemplates === void 0 ? !0 : !!this.designerConfig.formTemplates;
60
- },
61
- loadWidgets() {
62
- this.containers = C.map((e) => ({
63
- key: c(),
64
- ...e,
65
- displayName: this.i18n2t(
66
- `designer.widgetLabel.${e.type}`,
67
- `extension.widgetLabel.${e.type}`
68
- )
69
- })).filter((e) => !e.internal && !this.isBanned(e.type)), this.basicFields = T.map((e) => ({
70
- key: c(),
71
- ...e,
72
- displayName: this.i18n2t(
73
- `designer.widgetLabel.${e.type}`,
74
- `extension.widgetLabel.${e.type}`
75
- )
76
- })).filter((e) => !this.isBanned(e.type)), this.advancedFields = D.map((e) => ({
77
- key: c(),
78
- ...e,
79
- displayName: this.i18n2t(
80
- `designer.widgetLabel.${e.type}`,
81
- `extension.widgetLabel.${e.type}`
82
- )
83
- })).filter((e) => !this.isBanned(e.type)), this.customFields = N.map((e) => ({
84
- key: c(),
85
- ...e,
86
- displayName: this.i18n2t(
87
- `designer.widgetLabel.${e.type}`,
88
- `extension.widgetLabel.${e.type}`
89
- )
90
- })).filter((e) => !this.isBanned(e.type)), this.businessFields = L.map((e) => ({
91
- key: c(),
92
- ...e,
93
- displayName: this.i18n2t(
94
- `designer.widgetLabel.${e.type}`,
95
- `extension.widgetLabel.${e.type}`
96
- )
97
- })).filter((e) => !this.isBanned(e.type));
98
- },
99
- handleContainerWidgetClone(e) {
100
- return this.designer.copyNewContainerWidget(e);
101
- },
102
- handleFieldWidgetClone(e) {
103
- return this.designer.copyNewFieldWidget(e);
104
- },
105
- /* draggable组件的move钩子是在内部子组件被拖放到其他draggable组件时触发!! */
106
- checkContainerMove(e) {
107
- return this.designer.checkWidgetMove(e);
108
- },
109
- /* draggable组件的move钩子是在内部子组件被拖放到其他draggable组件时触发!! */
110
- checkFieldMove(e) {
111
- return this.designer.checkFieldMove(e);
112
- },
113
- onContainerDragEnd(e) {
114
- },
115
- addContainerByDbClick(e) {
116
- this.designer.addContainerByDbClick(e);
117
- },
118
- addFieldByDbClick(e) {
119
- this.designer.addFieldByDbClick(e);
120
- },
121
- loadFormTemplate(e) {
122
- M({
123
- type: "confirm",
124
- content: this.i18nt("designer.setting.loadFormTemplateHint"),
125
- title: this.i18nt("render.hint.prompt"),
126
- okText: this.i18nt("render.hint.confirm"),
127
- cancelText: this.i18nt("render.hint.cancel")
128
- }).then(() => {
129
- H.get(e).then((n) => {
130
- let p = !1;
131
- typeof n.data == "string" ? p = this.designer.loadFormJson(JSON.parse(n.data)) : n.data.constructor === Object && (p = this.designer.loadFormJson(n.data)), p && this.designer.emitHistoryChange(), this.$message.success(
132
- this.i18nt("designer.hint.loadFormTemplateSuccess")
133
- );
134
- }).catch((n) => {
135
- this.$message.error(
136
- this.i18nt("designer.hint.loadFormTemplateFailed") + ":" + n
137
- );
138
- });
139
- }).catch((n) => {
140
- console.error(n);
141
- });
142
- }
143
- }
144
- }, G = { class: "side-scroll-bar" }, I = { class: "panel-container" }, O = ["title", "onDblclick"], S = ["title", "onDblclick"], V = ["title", "onDblclick"], J = ["title", "onDblclick"];
145
- function z(e, n, p, P, o, s) {
146
- const d = r("svg-icon"), h = r("draggable"), u = r("a-collapse-panel"), v = r("a-collapse"), k = r("a-tab-pane");
147
- r("a-popover"), r("a-button"), r("a-card");
148
- const f = r("a-tabs");
149
- return F(), $("div", G, [
150
- a("div", I, [
151
- t(f, {
152
- activeKey: o.firstTab,
153
- "onUpdate:activeKey": n[1] || (n[1] = (i) => o.firstTab = i),
154
- class: "no-bottom-margin indent-left-margin"
155
- }, {
156
- default: l(() => [
157
- t(k, { key: "componentLib" }, {
158
- tab: l(() => [
159
- a("span", null, [
160
- t(d, { "icon-class": "icon-el-set-up" }),
161
- g(" " + m(e.i18nt("designer.componentLib")), 1)
162
- ])
163
- ]),
164
- default: l(() => [
165
- t(v, {
166
- activeKey: o.activeNames,
167
- "onUpdate:activeKey": n[0] || (n[0] = (i) => o.activeNames = i),
168
- class: "widget-collapse"
169
- }, {
170
- default: l(() => [
171
- t(u, {
172
- key: "containerTitle",
173
- header: e.i18nt("designer.containerTitle")
174
- }, {
175
- default: l(() => [
176
- t(h, {
177
- tag: "ul",
178
- list: o.containers,
179
- "item-key": "key",
180
- group: { name: "dragGroup", pull: "clone", put: !1 },
181
- clone: s.handleContainerWidgetClone,
182
- "ghost-class": "ghost",
183
- sort: !1,
184
- move: s.checkContainerMove,
185
- onEnd: s.onContainerDragEnd
186
- }, {
187
- item: l(({ element: i }) => [
188
- a("li", {
189
- class: "container-widget-item",
190
- title: i.displayName,
191
- onDblclick: (y) => s.addContainerByDbClick(i)
192
- }, [
193
- a("span", null, [
194
- t(d, {
195
- "icon-class": "icon-" + i.icon,
196
- class: "color-svg-icon"
197
- }, null, 8, ["icon-class"]),
198
- g(" " + m(i.showName || e.i18n2t(
199
- `designer.widgetLabel.${i.type}`,
200
- `extension.widgetLabel.${i.type}`
201
- )), 1)
202
- ])
203
- ], 40, O)
204
- ]),
205
- _: 1
206
- }, 8, ["list", "clone", "move", "onEnd"])
207
- ]),
208
- _: 1
209
- }, 8, ["header"]),
210
- t(u, {
211
- key: "basicFieldTitle",
212
- header: e.i18nt("designer.basicFieldTitle")
213
- }, {
214
- default: l(() => [
215
- t(h, {
216
- tag: "ul",
217
- list: o.basicFields,
218
- "item-key": "key",
219
- group: { name: "dragGroup", pull: "clone", put: !1 },
220
- move: s.checkFieldMove,
221
- clone: s.handleFieldWidgetClone,
222
- "ghost-class": "ghost",
223
- sort: !1
224
- }, {
225
- item: l(({ element: i }) => [
226
- a("li", {
227
- class: "field-widget-item",
228
- title: i.displayName,
229
- onDblclick: (y) => s.addFieldByDbClick(i)
230
- }, [
231
- a("span", null, [
232
- t(d, {
233
- "icon-class": "icon-" + i.icon,
234
- class: "color-svg-icon"
235
- }, null, 8, ["icon-class"]),
236
- g(" " + m(i.showName || e.i18n2t(
237
- `designer.widgetLabel.${i.type}`,
238
- `extension.widgetLabel.${i.type}`
239
- )), 1)
240
- ])
241
- ], 40, S)
242
- ]),
243
- _: 1
244
- }, 8, ["list", "move", "clone"])
245
- ]),
246
- _: 1
247
- }, 8, ["header"]),
248
- t(u, {
249
- key: "advancedFieldTitle",
250
- header: e.i18nt("designer.advancedFieldTitle")
251
- }, {
252
- default: l(() => [
253
- t(h, {
254
- tag: "ul",
255
- list: o.advancedFields,
256
- "item-key": "key",
257
- group: { name: "dragGroup", pull: "clone", put: !1 },
258
- move: s.checkFieldMove,
259
- clone: s.handleFieldWidgetClone,
260
- "ghost-class": "ghost",
261
- sort: !1
262
- }, {
263
- item: l(({ element: i }) => [
264
- a("li", {
265
- class: "field-widget-item",
266
- title: i.displayName,
267
- onDblclick: (y) => s.addFieldByDbClick(i)
268
- }, [
269
- a("span", null, [
270
- t(d, {
271
- "icon-class": "icon-" + i.icon,
272
- class: "color-svg-icon"
273
- }, null, 8, ["icon-class"]),
274
- g(" " + m(i.showName || e.i18n2t(
275
- `designer.widgetLabel.${i.type}`,
276
- `extension.widgetLabel.${i.type}`
277
- )), 1)
278
- ])
279
- ], 40, V)
280
- ]),
281
- _: 1
282
- }, 8, ["list", "move", "clone"])
283
- ]),
284
- _: 1
285
- }, 8, ["header"]),
286
- b("", !0),
287
- o.customFields.length ? (F(), E(u, {
288
- key: "customFieldTitle",
289
- header: e.i18nt("designer.customFieldTitle")
290
- }, {
291
- default: l(() => [
292
- t(h, {
293
- tag: "ul",
294
- list: o.customFields,
295
- "item-key": "key",
296
- group: { name: "dragGroup", pull: "clone", put: !1 },
297
- move: s.checkFieldMove,
298
- clone: s.handleFieldWidgetClone,
299
- "ghost-class": "ghost",
300
- sort: !1
301
- }, {
302
- item: l(({ element: i }) => [
303
- a("li", {
304
- class: "field-widget-item",
305
- title: i.displayName,
306
- onDblclick: (y) => s.addFieldByDbClick(i)
307
- }, [
308
- a("span", null, [
309
- t(d, {
310
- "icon-class": i.icon,
311
- class: "color-svg-icon"
312
- }, null, 8, ["icon-class"]),
313
- g(" " + m(e.i18n2t(
314
- `designer.widgetLabel.${i.type}`,
315
- `extension.widgetLabel.${i.type}`
316
- )), 1)
317
- ])
318
- ], 40, J)
319
- ]),
320
- _: 1
321
- }, 8, ["list", "move", "clone"])
322
- ]),
323
- _: 1
324
- }, 8, ["header"])) : b("", !0)
325
- ]),
326
- _: 1
327
- }, 8, ["activeKey"])
328
- ]),
329
- _: 1
330
- }),
331
- b("", !0)
332
- ]),
333
- _: 1
334
- }, 8, ["activeKey"])
335
- ])
336
- ]);
337
- }
338
- const ne = /* @__PURE__ */ K(j, [["render", z], ["__scopeId", "data-v-bf88a5e1"]]);
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-195b815e"]]);
339
5
  export {
340
- ne as default
6
+ m as default
341
7
  };
@@ -0,0 +1,82 @@
1
+ import { defineComponent as T, ref as d, computed as k, resolveComponent as o, createElementBlock as m, openBlock as l, createElementVNode as p, createVNode as t, withCtx as n, Fragment as F, renderList as K, createBlock as x, createTextVNode as L, unref as _, toDisplayString as N } from "vue";
2
+ import { SvgIcon as B } from "tmgc2-share";
3
+ import C from "./PanelItemDrag.vue.js";
4
+ import { containers as I, basicFields as V, advancedFields as h } from "./widgetsConfig.js";
5
+ import { useI18n as w } from "../../../utils/i18n.js";
6
+ const E = { class: "side-scroll-bar" }, S = { class: "panel-container" }, W = /* @__PURE__ */ T({
7
+ name: "WidgetPanel",
8
+ __name: "index",
9
+ props: {
10
+ designer: Object
11
+ },
12
+ setup(u) {
13
+ const { i18nt: a } = w(), s = d(["containerTitle", "basicFieldTitle", "advancedFieldTitle"]), c = d("componentLib"), v = k(() => [
14
+ {
15
+ title: a("designer.containerTitle"),
16
+ key: "containerTitle",
17
+ items: I.filter((r) => !r.internal)
18
+ },
19
+ {
20
+ title: a("designer.basicFieldTitle"),
21
+ key: "basicFieldTitle",
22
+ items: V
23
+ },
24
+ {
25
+ title: a("designer.advancedFieldTitle"),
26
+ key: "advancedFieldTitle",
27
+ items: h
28
+ }
29
+ ]);
30
+ return (r, i) => {
31
+ const f = o("a-collapse-panel"), b = o("a-collapse"), g = o("a-tab-pane"), y = o("a-tabs");
32
+ return l(), m("div", E, [
33
+ p("div", S, [
34
+ t(y, {
35
+ activeKey: c.value,
36
+ "onUpdate:activeKey": i[1] || (i[1] = (e) => c.value = e),
37
+ class: "no-bottom-margin indent-left-margin"
38
+ }, {
39
+ default: n(() => [
40
+ t(g, { key: "componentLib" }, {
41
+ tab: n(() => [
42
+ p("span", null, [
43
+ t(_(B), { "icon-class": "icon-el-set-up" }),
44
+ L(" " + N(_(a)("designer.componentLib")), 1)
45
+ ])
46
+ ]),
47
+ default: n(() => [
48
+ t(b, {
49
+ activeKey: s.value,
50
+ "onUpdate:activeKey": i[0] || (i[0] = (e) => s.value = e),
51
+ class: "widget-collapse"
52
+ }, {
53
+ default: n(() => [
54
+ (l(!0), m(F, null, K(v.value, (e) => (l(), x(f, {
55
+ key: e.key,
56
+ header: e.title
57
+ }, {
58
+ default: n(() => [
59
+ t(C, {
60
+ designer: u.designer,
61
+ items: e.items
62
+ }, null, 8, ["designer", "items"])
63
+ ]),
64
+ _: 2
65
+ }, 1032, ["header"]))), 128))
66
+ ]),
67
+ _: 1
68
+ }, 8, ["activeKey"])
69
+ ]),
70
+ _: 1
71
+ })
72
+ ]),
73
+ _: 1
74
+ }, 8, ["activeKey"])
75
+ ])
76
+ ]);
77
+ };
78
+ }
79
+ });
80
+ export {
81
+ W as default
82
+ };
@@ -1,28 +1,29 @@
1
- import { basicFieldsEnums as e } from "./basicFieldsEnums.js";
2
- import * as a from "./business/index.js";
1
+ import { basicFieldsEnums as a } from "./basicFieldsEnums.js";
2
+ import * as s from "./business/index.js";
3
3
  import * as d from "./containers/index.js";
4
- import { advancedFieldsEnums as i } from "./advancedFieldsEnums.js";
5
- const c = Object.values(d).map((s) => s()), n = Object.values(e).map((s) => s()), p = Object.values(a).map((s) => s()), t = Object.values(i).map((s) => s()), o = [];
6
- function l(s) {
7
- c.push(s);
4
+ import { advancedFieldsEnums as c } from "./advancedFieldsEnums.js";
5
+ const i = Object.values(d).map((e) => e()), n = Object.values(a).map((e) => e());
6
+ Object.values(s).map((e) => e());
7
+ const t = Object.values(c).map((e) => e()), o = [];
8
+ function p(e) {
9
+ i.push(e);
8
10
  }
9
- function r(s) {
10
- n.push(s);
11
+ function l(e) {
12
+ n.push(e);
11
13
  }
12
- function f(s) {
13
- t.push(s);
14
+ function r(e) {
15
+ t.push(e);
14
16
  }
15
- function h(s) {
16
- o.push(s);
17
+ function f(e) {
18
+ o.push(e);
17
19
  }
18
20
  export {
19
- f as addAdvancedFieldSchema,
20
- r as addBasicFieldSchema,
21
- l as addContainerWidgetSchema,
22
- h as addCustomWidgetSchema,
21
+ r as addAdvancedFieldSchema,
22
+ l as addBasicFieldSchema,
23
+ p as addContainerWidgetSchema,
24
+ f as addCustomWidgetSchema,
23
25
  t as advancedFields,
24
26
  n as basicFields,
25
- p as businessFields,
26
- c as containers,
27
+ i as containers,
27
28
  o as customFields
28
29
  };