@kp-ui/lowcode 2.14.0-beta.1 → 2.14.0-beta.10

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 (112) hide show
  1. package/install.js +26 -25
  2. package/package.json +2 -2
  3. package/src/components/FormRender/useFormRender.js +18 -0
  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/index.js +6 -6
  7. package/src/components/form-designer/form-widget/container-widget/vf-box-item.vue.js +9 -9
  8. package/src/components/form-designer/form-widget/container-widget/vf-dialog-widget.vue.js +20 -19
  9. package/src/components/form-designer/form-widget/field-widget/cascader-widget.vue.js +32 -39
  10. package/src/components/form-designer/form-widget/field-widget/date-range-widget.vue.js +24 -31
  11. package/src/components/form-designer/form-widget/field-widget/date-widget.vue.js +26 -33
  12. package/src/components/form-designer/form-widget/field-widget/diy-compontent-widget.vue.js +1 -1
  13. package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +4 -1
  14. package/src/components/form-designer/form-widget/field-widget/form-item-wrapper.vue.js +84 -152
  15. package/src/components/form-designer/form-widget/field-widget/input-widget.vue.js +31 -38
  16. package/src/components/form-designer/form-widget/field-widget/number-widget.vue.js +23 -30
  17. package/src/components/form-designer/form-widget/field-widget/select-widget.vue.js +56 -63
  18. package/src/components/form-designer/form-widget/field-widget/switch-widget.vue.js +1 -1
  19. package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue.js +23 -32
  20. package/src/components/form-designer/form-widget/field-widget/treeSelect-widget.vue.js +26 -33
  21. package/src/components/form-designer/index.vue.js +55 -54
  22. package/src/components/form-designer/setting-panel/form-crud-setting.vue.js +62 -23
  23. package/src/components/form-designer/setting-panel/form-setting.vue.js +2 -2
  24. package/src/components/form-designer/setting-panel/form-setting.vue2.js +81 -94
  25. package/src/components/form-designer/setting-panel/index.vue.js +4 -323
  26. package/src/components/form-designer/setting-panel/index.vue2.js +273 -0
  27. package/src/components/form-designer/setting-panel/property-editor/button-list-editor.vue2.js +5 -4
  28. package/src/components/form-designer/setting-panel/property-editor/container-data-table/customRowEvent/data-table-customRow-editor.vue.js +1 -0
  29. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-colorRow-editor.vue2.js +8 -7
  30. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-dsEnabled-editor.vue.js +26 -24
  31. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-pagination-editor.vue.js +1 -0
  32. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-selections-editor.vue2.js +19 -18
  33. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-showButtonsColumn-editor.vue.js +9 -8
  34. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue.js +3 -3
  35. package/src/components/form-designer/setting-panel/property-editor/container-data-table/data-table-tableColumns-editor.vue2.js +13 -12
  36. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/bodyStyle-editor.vue2.js +7 -6
  37. package/src/components/form-designer/setting-panel/property-editor/container-vf-dialog/line-height-editor.vue2.js +7 -6
  38. package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue.js +2 -40
  39. package/src/components/form-designer/setting-panel/property-editor/customRender-editor.vue2.js +41 -0
  40. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue.js +2 -47
  41. package/src/components/form-designer/setting-panel/property-editor/event-handler/onClickIcon-editor.vue2.js +44 -0
  42. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue.js +2 -47
  43. package/src/components/form-designer/setting-panel/property-editor/event-handler/onCreated-editor.vue2.js +43 -0
  44. package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue.js +2 -46
  45. package/src/components/form-designer/setting-panel/property-editor/event-handler/onOkButtonClick-editor.vue2.js +43 -0
  46. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue.js +2 -47
  47. package/src/components/form-designer/setting-panel/property-editor/event-handler/onValidate-editor.vue2.js +44 -0
  48. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue.js +2 -66
  49. package/src/components/form-designer/setting-panel/property-editor/field-dropdown/dropdown-menuList-editor.vue2.js +42 -0
  50. package/src/components/form-designer/setting-panel/property-editor/field-html-text/htmlContent-editor.vue.js +5 -4
  51. package/src/components/form-designer/setting-panel/property-editor/hidden-editor.vue.js +6 -5
  52. package/src/components/form-designer/setting-panel/property-editor/index.js +100 -102
  53. package/src/components/form-designer/setting-panel/property-editor/labelIconClass-editor.vue.js +8 -7
  54. package/src/components/form-designer/setting-panel/property-editor/optionItems-editor.vue.js +38 -35
  55. package/src/components/form-designer/setting-panel/propertyRegister.js +3 -6
  56. package/src/components/form-designer/widget-panel/advanced/cascader.js +0 -1
  57. package/src/components/form-designer/widget-panel/advanced/data-table.js +1 -1
  58. package/src/components/form-designer/widget-panel/advanced/file-upload.js +0 -1
  59. package/src/components/form-designer/widget-panel/advanced/rich-editor.js +4 -5
  60. package/src/components/form-designer/widget-panel/advanced/tree-select.js +0 -1
  61. package/src/components/form-designer/widget-panel/basicFields/checkbox.js +2 -3
  62. package/src/components/form-designer/widget-panel/basicFields/color.js +0 -1
  63. package/src/components/form-designer/widget-panel/basicFields/date.js +0 -1
  64. package/src/components/form-designer/widget-panel/basicFields/dateRange.js +0 -1
  65. package/src/components/form-designer/widget-panel/basicFields/input.js +0 -1
  66. package/src/components/form-designer/widget-panel/basicFields/number.js +0 -1
  67. package/src/components/form-designer/widget-panel/basicFields/radio.js +0 -1
  68. package/src/components/form-designer/widget-panel/basicFields/rate.js +5 -6
  69. package/src/components/form-designer/widget-panel/basicFields/select.js +2 -3
  70. package/src/components/form-designer/widget-panel/basicFields/slider.js +0 -1
  71. package/src/components/form-designer/widget-panel/basicFields/switch.js +0 -1
  72. package/src/components/form-designer/widget-panel/basicFields/textarea.js +0 -1
  73. package/src/components/form-designer/widget-panel/basicFields/time.js +0 -1
  74. package/src/components/form-designer/widget-panel/basicFields/timeRange.js +0 -1
  75. package/src/components/form-designer/widget-panel/business/department-select.js +0 -1
  76. package/src/components/form-designer/widget-panel/business/material-select.js +0 -1
  77. package/src/components/form-designer/widget-panel/business/operation-select.js +2 -3
  78. package/src/components/form-designer/widget-panel/business/post-select.js +0 -1
  79. package/src/components/form-designer/widget-panel/business/project-group-select.js +2 -3
  80. package/src/components/form-designer/widget-panel/business/project-select.js +2 -3
  81. package/src/components/form-designer/widget-panel/business/user-select.js +0 -1
  82. package/src/components/form-render/RenderWigetList.vue.js +61 -0
  83. package/src/components/form-render/RenderWigetList.vue2.js +4 -0
  84. package/src/components/form-render/SubmitButtonRender.vue.js +33 -29
  85. package/src/components/form-render/container-item/container-item-wrapper.vue.js +2 -23
  86. package/src/components/form-render/container-item/container-item-wrapper.vue2.js +20 -0
  87. package/src/components/form-render/container-item/data-table-item.vue.js +135 -0
  88. package/src/components/form-render/container-item/grid-col-item.vue.js +149 -0
  89. package/src/components/form-render/container-item/grid-item.vue.js +92 -0
  90. package/src/components/form-render/container-item/grid-sub-form-item.vue.js +319 -0
  91. package/src/components/form-render/container-item/index.js +24 -0
  92. package/src/components/form-render/container-item/sub-form-item.vue.js +398 -0
  93. package/src/components/form-render/container-item/tab-item.vue.js +160 -0
  94. package/src/components/form-render/container-item/table-cell-item.vue.js +95 -0
  95. package/src/components/form-render/container-item/table-item.vue.js +96 -0
  96. package/src/components/form-render/container-item/vf-collapse-item.vue.js +252 -0
  97. package/src/components/form-render/container-item/vf-dialog-item.vue.js +12 -0
  98. package/src/components/form-render/container-item/vf-drawer-item.vue.js +12 -0
  99. package/src/components/form-render/dynamic-dialog.vue.js +66 -81
  100. package/src/components/form-render/index.vue.js +95 -110
  101. package/src/components/http-editor/index.vue.js +10 -10
  102. package/src/components/public/ActionButtonListRender.vue.js +19 -24
  103. package/src/hooks/useLowcode.js +40 -39
  104. package/src/lang/en-US.js +4 -4
  105. package/src/lang/zh-CN.js +3 -4
  106. package/src/mixins/useDataTableMixin.js +18 -23
  107. package/src/utils/useEmitter.js +57 -0
  108. package/src/utils/util.js +50 -49
  109. package/stats.html +1 -1
  110. package/styles/style.css +1 -1
  111. package/src/components/form-designer/setting-panel/property-editor/event-handler/onVformAdd-editor.vue.js +0 -49
  112. package/src/components/form-designer/setting-panel/property-editor/labelTooltip-editor.vue.js +0 -31
@@ -1,327 +1,8 @@
1
- import { TpfCodeEditor as F } from "tmgc2-share";
2
- import V from "./property-editor/index.js";
3
- import K from "./form-setting.vue.js";
4
- import O from "./form-crud-setting.vue.js";
5
- import R, { propertyRegistered as D } from "./propertyRegister.js";
6
- import { addWindowResizeHandler as A } from "../../../utils/util.js";
7
- import j from "../../../utils/i18n.js";
8
- import { get as x } from "../../../utils/smart-vue-i18n/utils.js";
9
- import z from "../../../utils/emitter.js";
10
- import I from "../../code-editor/code-modal-editor.vue.js";
11
- import { resolveComponent as n, createElementBlock as p, openBlock as s, Fragment as h, createVNode as r, withCtx as l, createBlock as g, createCommentVNode as _, createElementVNode as u, normalizeStyle as v, withModifiers as U, renderList as E, normalizeClass as B, resolveDynamicComponent as L } from "vue";
1
+ import t from "./index.vue2.js";
12
2
  /* empty css */
13
3
  /* empty css */
14
- import q from "../../../../_virtual/_plugin-vue_export-helper.js";
15
- const { COMMON_PROPERTIES: G, ADVANCED_PROPERTIES: J, EVENT_PROPERTIES: Q } = R, X = {
16
- name: "SettingPanel",
17
- componentName: "SettingPanel",
18
- mixins: [j, z],
19
- components: {
20
- TpfCodeEditor: F,
21
- FormSetting: K,
22
- CodeModalEditor: I,
23
- FormCrudSetting: O,
24
- ...V
25
- },
26
- props: {
27
- designer: Object,
28
- selectedWidget: Object,
29
- formConfig: Object,
30
- globalDsv: {
31
- type: Object,
32
- default: () => ({})
33
- }
34
- },
35
- provide() {
36
- return {
37
- isSubFormChildWidget: () => this.subFormChildWidgetFlag,
38
- getGlobalDsv: () => this.globalDsv
39
- // 全局数据源变量
40
- };
41
- },
42
- inject: ["getDesignerConfig"],
43
- data() {
44
- return {
45
- designerConfig: this.getDesignerConfig(),
46
- scrollerHeight: 0,
47
- activeTab: "2",
48
- widgetActiveCollapseNames: ["1", "2", "3"],
49
- formActiveCollapseNames: ["1", "2"],
50
- commonProps: G,
51
- advProps: J,
52
- eventProps: Q,
53
- showWidgetEventDialogFlag: !1,
54
- eventHandlerCode: "",
55
- curEventName: "",
56
- eventHeader: "",
57
- subFormChildWidgetFlag: !1
58
- };
59
- },
60
- computed: {
61
- optionModel: {
62
- get() {
63
- return this.selectedWidget.options;
64
- },
65
- set(e) {
66
- this.selectedWidget.options = e;
67
- }
68
- },
69
- /**
70
- * 构建折叠面板配置列表,用于循环渲染面板
71
- * 将常见/高级/事件属性的差异抽象为配置,减少模板重复
72
- */
73
- collapsePanels() {
74
- const e = this.showCollapse(this.commonProps), t = this.showCollapse(this.advProps), i = this.showEventCollapse() && this.showCollapse(this.eventProps);
75
- return [
76
- {
77
- key: "1",
78
- headerKey: this.i18nt("designer.setting.常见属性"),
79
- props: this.commonProps,
80
- className: "",
81
- visible: e,
82
- useVModel: !0,
83
- isEvent: !1
84
- },
85
- {
86
- key: "2",
87
- headerKey: this.i18nt("designer.setting.高级属性"),
88
- props: this.advProps,
89
- className: "",
90
- visible: t,
91
- useVModel: !1,
92
- isEvent: !1
93
- },
94
- {
95
- key: "3",
96
- headerKey: this.i18nt("designer.setting.事件属性"),
97
- props: this.eventProps,
98
- className: "eventPanel",
99
- visible: i,
100
- useVModel: !1,
101
- isEvent: !0
102
- }
103
- ].filter((d) => d.visible);
104
- }
105
- },
106
- watch: {
107
- "designer.selectedWidget": {
108
- handler(e) {
109
- e && (this.activeTab = "1");
110
- }
111
- },
112
- "selectedWidget.options": {
113
- //组件属性变动后,立即保存表单JSON!!
114
- deep: !0,
115
- handler() {
116
- this.designer.saveCurrentHistoryStep();
117
- }
118
- },
119
- formConfig: {
120
- deep: !0,
121
- handler() {
122
- this.designer.saveCurrentHistoryStep();
123
- }
124
- }
125
- },
126
- created() {
127
- this.on$("editEventHandler", (e) => {
128
- this.editEventHandler(e[0], e[1]);
129
- }), this.designer.handleEvent("form-css-updated", (e) => {
130
- this.designer.setCssClassList(e);
131
- }), this.designer.handleEvent("field-selected", (e) => {
132
- this.subFormChildWidgetFlag = !!e && e.type === "sub-form";
133
- });
134
- },
135
- mounted() {
136
- this.designer.selectedWidget ? this.activeTab = "1" : this.activeTab = "2", this.scrollerHeight = window.innerHeight - 56 - 48 + "px", A(() => {
137
- this.$nextTick(() => {
138
- this.scrollerHeight = window.innerHeight - 56 - 48 + "px";
139
- });
140
- });
141
- },
142
- methods: {
143
- /**
144
- * 处理 option-model 的双向绑定更新
145
- * 与 v-model:option-model 等效,实现通用事件绑定方式
146
- */
147
- onUpdateOptionModel(e) {
148
- this.optionModel = e;
149
- },
150
- getEventHandled(e) {
151
- return !!this.optionModel[e] && this.optionModel[e].length > 0;
152
- },
153
- showEventCollapse() {
154
- return this.designerConfig.eventCollapse === void 0 ? !0 : !!this.designerConfig.eventCollapse;
155
- },
156
- hasPropEditor(e, t) {
157
- if (!t)
158
- return !1;
159
- if (e.indexOf("-") <= -1) {
160
- const o = this.selectedWidget.type + "-" + e;
161
- if (D(o))
162
- return !1;
163
- }
164
- const i = e.replace(this.selectedWidget.type + "-", "");
165
- return this.designer.hasConfig(this.selectedWidget, i);
166
- },
167
- getPropEditor(e, t) {
168
- const i = e.replace(this.selectedWidget.type + "-", ""), d = `${this.selectedWidget.type}-${i}-editor`;
169
- return this.$options.components[d] || this.$root.$.appContext.components[d] ? d : t;
170
- },
171
- showCollapse(e) {
172
- let t = !1;
173
- for (const i in e)
174
- if (e.hasOwnProperty(i) && this.hasPropEditor(i, e[i])) {
175
- t = !0;
176
- break;
177
- }
178
- return t;
179
- },
180
- editEventHandler(e, t) {
181
- this.curEventName = e, this.eventHeader = `${this.optionModel.name}.${e}(${t.join(
182
- ", "
183
- )}) {`, this.eventHandlerCode = x(this.selectedWidget.options, e) || "", console.log({ eventName: e, eventHandlerCode: this.eventHandlerCode }), e === "onValidate" && !this.optionModel.onValidate && (this.eventHandlerCode = ` /* sample code */
184
- /*
185
- if ((value > 100) || (value < 0)) {
186
- return Promise.reject('error message') //fail
187
- } else {
188
- return Promise.resolve(); //pass
189
- }
190
- */`), this.$refs.CodeModalEditorRef.open(this.eventHandlerCode);
191
- },
192
- saveEventHandler(e) {
193
- if (this.curEventName.includes(".")) {
194
- const [t, i] = this.curEventName.split(".");
195
- this.selectedWidget.options[t][i] = e;
196
- } else
197
- this.selectedWidget.options[this.curEventName] = e;
198
- }
199
- }
200
- };
201
- function Y(e, t, i, d, o, a) {
202
- const b = n("a-collapse-panel"), y = n("a-collapse"), P = n("a-form"), H = n("a-empty"), f = n("a-tab-pane"), w = n("form-setting"), W = n("FormCrudSetting"), M = n("a-tabs"), S = n("a-layout"), k = n("a-config-provider"), N = n("TpfCodeEditor");
203
- return s(), p(h, null, [
204
- r(k, { componentSize: "small" }, {
205
- default: l(() => [
206
- r(S, { class: "panel-container" }, {
207
- default: l(() => [
208
- r(M, {
209
- activeKey: o.activeTab,
210
- "onUpdate:activeKey": t[3] || (t[3] = (c) => o.activeTab = c),
211
- style: { height: "100%", width: "100%", overflow: "hidden" }
212
- }, {
213
- default: l(() => [
214
- r(f, {
215
- tab: e.i18nt("designer.hint.widgetSetting"),
216
- key: "1"
217
- }, {
218
- default: l(() => [
219
- u("div", {
220
- class: "setting-scrollbar",
221
- style: v({ height: o.scrollerHeight })
222
- }, [
223
- i.designer.selectedWidget ? (s(), g(P, {
224
- key: 0,
225
- model: a.optionModel,
226
- labelAlign: "left",
227
- "label-width": "120px",
228
- class: "setting-form tpf-form",
229
- onSubmit: t[2] || (t[2] = U(() => {
230
- }, ["prevent"]))
231
- }, {
232
- default: l(() => [
233
- r(y, {
234
- activeKey: o.widgetActiveCollapseNames,
235
- "onUpdate:activeKey": t[1] || (t[1] = (c) => o.widgetActiveCollapseNames = c),
236
- class: "setting-collapse"
237
- }, {
238
- default: l(() => [
239
- (s(!0), p(h, null, E(a.collapsePanels, (c) => (s(), g(b, {
240
- key: c.key,
241
- class: B(c.className),
242
- header: c.headerKey
243
- }, {
244
- default: l(() => [
245
- (s(!0), p(h, null, E(c.props, (C, m) => (s(), p(h, null, [
246
- a.hasPropEditor(m, C) ? (s(), g(L(a.getPropEditor(m, C)), {
247
- key: m,
248
- designer: i.designer,
249
- "selected-widget": i.selectedWidget,
250
- "option-model": a.optionModel,
251
- "onUpdate:optionModel": t[0] || (t[0] = (T) => a.optionModel = T),
252
- "event-handled": a.getEventHandled(m)
253
- }, null, 40, ["designer", "selected-widget", "option-model", "event-handled"])) : _("", !0)
254
- ], 64))), 256))
255
- ]),
256
- _: 2
257
- }, 1032, ["class", "header"]))), 128))
258
- ]),
259
- _: 1
260
- }, 8, ["activeKey"])
261
- ]),
262
- _: 1
263
- }, 8, ["model"])) : (s(), g(H, {
264
- key: 1,
265
- description: e.i18nt("designer.hint.noSelectedWidgetHint")
266
- }, null, 8, ["description"]))
267
- ], 4)
268
- ]),
269
- _: 1
270
- }, 8, ["tab"]),
271
- i.designer ? (s(), g(f, {
272
- tab: e.i18nt("designer.hint.表单设置"),
273
- key: "2"
274
- }, {
275
- default: l(() => [
276
- u("div", {
277
- class: "setting-scrollbar",
278
- style: v({ height: o.scrollerHeight })
279
- }, [
280
- r(w, {
281
- designer: i.designer,
282
- "form-config": i.formConfig
283
- }, null, 8, ["designer", "form-config"])
284
- ], 4)
285
- ]),
286
- _: 1
287
- }, 8, ["tab"])) : _("", !0),
288
- r(f, {
289
- tab: e.i18nt("designer.hint.表单api配置"),
290
- key: "3"
291
- }, {
292
- default: l(() => [
293
- u("div", {
294
- class: "ds-setting-scrollbar",
295
- style: v({ height: o.scrollerHeight })
296
- }, [
297
- r(W, {
298
- designer: i.designer,
299
- "form-config": i.formConfig
300
- }, null, 8, ["designer", "form-config"])
301
- ], 4)
302
- ]),
303
- _: 1
304
- }, 8, ["tab"])
305
- ]),
306
- _: 1
307
- }, 8, ["activeKey"])
308
- ]),
309
- _: 1
310
- })
311
- ]),
312
- _: 1
313
- }),
314
- r(N, {
315
- eventHeader: o.eventHeader,
316
- ref: "CodeModalEditorRef",
317
- title: e.i18nt("designer.setting.editWidgetEventHandler"),
318
- mode: "javascript",
319
- readonly: !1,
320
- onSetCode: a.saveEventHandler
321
- }, null, 8, ["eventHeader", "title", "onSetCode"])
322
- ], 64);
323
- }
324
- const me = /* @__PURE__ */ q(X, [["render", Y], ["__scopeId", "data-v-b6c5eb4a"]]);
4
+ import o from "../../../../_virtual/_plugin-vue_export-helper.js";
5
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-f4273f12"]]);
325
6
  export {
326
- me as default
7
+ a as default
327
8
  };
@@ -0,0 +1,273 @@
1
+ import { defineComponent as ie, mergeModels as re, useModel as B, inject as de, ref as i, provide as I, computed as M, watchEffect as ue, watch as L, onBeforeMount as ce, resolveComponent as f, createElementBlock as T, openBlock as g, Fragment as V, createVNode as r, withCtx as d, createBlock as C, createCommentVNode as ve, unref as h, createElementVNode as K, withModifiers as pe, renderList as U, normalizeClass as fe, resolveDynamicComponent as ge } from "vue";
2
+ import $ from "./property-editor/index.js";
3
+ import { TpfCodeEditor as me } from "tmgc2-share";
4
+ import ye from "./form-setting.vue.js";
5
+ import Ee from "./form-crud-setting.vue.js";
6
+ import _e, { PROPERTY_TYPE as R } from "./propertyRegister.js";
7
+ import { get as x } from "../../../utils/smart-vue-i18n/utils.js";
8
+ import { useEmitter as be } from "../../../utils/useEmitter.js";
9
+ import { useI18n as Ce } from "../../../utils/i18n.js";
10
+ const he = { class: "setting-scrollbar" }, Pe = { class: "setting-scrollbar" }, ke = { class: "ds-setting-scrollbar" }, Ve = /* @__PURE__ */ ie({
11
+ name: "SettingPanel",
12
+ componentName: "SettingPanel",
13
+ __name: "index",
14
+ props: /* @__PURE__ */ re({
15
+ designer: { default: () => {
16
+ } },
17
+ globalDsv: {}
18
+ }, {
19
+ "form-config": {
20
+ default: () => ({})
21
+ },
22
+ "form-configModifiers": {},
23
+ "selected-widget": {
24
+ default: () => ({})
25
+ },
26
+ "selected-widgetModifiers": {}
27
+ }),
28
+ emits: ["update:form-config", "update:selected-widget"],
29
+ setup(j, { expose: z }) {
30
+ const { i18nt: u } = Ce(), { COMMON_PROPERTIES: Y, ADVANCED_PROPERTIES: G, EVENT_PROPERTIES: q } = _e, m = j, H = B(j, "form-config"), P = be(), Q = m.globalDsv || {}, X = de("getDesignerConfig"), D = i(!1);
31
+ I("isSubFormChildWidget", () => D.value), I("getGlobalDsv", () => Q);
32
+ const S = i(), W = i(""), k = i("javascript"), w = i("2"), A = i(["1", "2", "3"]), c = i(""), E = i(""), N = i(""), o = B(j, "selected-widget");
33
+ M(() => X());
34
+ const s = M({
35
+ get() {
36
+ var e;
37
+ return ((e = o.value) == null ? void 0 : e.options) || {};
38
+ },
39
+ set(e) {
40
+ o.value.options = e;
41
+ }
42
+ }), Z = (e) => !!s.value[e] && s.value[e].length > 0, F = M(
43
+ () => {
44
+ var e;
45
+ return Object.keys(((e = o.value) == null ? void 0 : e.options) || {});
46
+ }
47
+ ), O = (e) => {
48
+ const t = o.value.type;
49
+ let n = {};
50
+ return Object.entries(e).map(([l, v]) => {
51
+ for (let p = 0; p < F.value.length; p++) {
52
+ const _ = F.value[p];
53
+ if (l === _) {
54
+ const y = v, b = `${t}-${y}`;
55
+ $[b] ? n[b] = $[b] : $[y] && (n[y] = $[y]);
56
+ break;
57
+ }
58
+ }
59
+ }), n;
60
+ }, ee = M(() => {
61
+ const e = O(Y), t = O(G), n = O(q);
62
+ return console.log(e, t, n), [
63
+ {
64
+ key: "1",
65
+ headerKey: u("designer.setting.常见属性"),
66
+ props: e,
67
+ type: R.Common,
68
+ className: "",
69
+ visible: Object.keys(e).length > 0,
70
+ useVModel: !0,
71
+ isEvent: !1
72
+ },
73
+ {
74
+ key: "2",
75
+ headerKey: u("designer.setting.高级属性"),
76
+ props: t,
77
+ type: R.Advanced,
78
+ className: "",
79
+ visible: Object.keys(t).length > 0,
80
+ useVModel: !1,
81
+ isEvent: !1
82
+ },
83
+ {
84
+ key: "3",
85
+ headerKey: u("designer.setting.事件属性"),
86
+ props: n,
87
+ type: R.Event,
88
+ className: "eventPanel",
89
+ visible: Object.keys(n).length > 0,
90
+ useVModel: !1,
91
+ isEvent: !0
92
+ }
93
+ ].filter((l) => l.visible);
94
+ }), te = () => {
95
+ P.off$("onChangeEventHandler"), P.on$("onChangeEventHandler", ({ title: e, attr: t, eventParams: n = [], mode: l }) => {
96
+ W.value = e || u("designer.setting.editWidgetEventHandler");
97
+ const v = l === "json";
98
+ E.value = t, k.value = l;
99
+ const p = `${s.value.name}.${t}`;
100
+ N.value = v ? `${p}{` : `${p}(${n.join(", ")}) {`, c.value = x(o.value.options, t) || "", l === "json" && (c.value = JSON.stringify(s.value.menuList, null, " ")), t === "onValidate" && !s.value.onValidate && (c.value = ` /* sample code */
101
+ /*
102
+ if ((value > 100) || (value < 0)) {
103
+ return Promise.reject('error message') //fail
104
+ } else {
105
+ return Promise.resolve(); //pass
106
+ }
107
+ */`), S.value.open(c.value);
108
+ });
109
+ }, ne = (e, t, n = "javascript") => {
110
+ const l = n === "json";
111
+ E.value = e, k.value = n;
112
+ const v = `${s.value.name}.${e}`;
113
+ N.value = l ? `${v}{` : `${v}(${t.join(", ")}) {`, c.value = x(o.value.options, e) || "", n === "json" && (c.value = JSON.stringify(s.value.menuList, null, " ")), e === "onValidate" && !s.value.onValidate && (c.value = ` /* sample code */
114
+ /*
115
+ if ((value > 100) || (value < 0)) {
116
+ return Promise.reject('error message') //fail
117
+ } else {
118
+ return Promise.resolve(); //pass
119
+ }
120
+ */`), S.value.open(c.value);
121
+ }, oe = (e) => {
122
+ if (k.value === "json" && (e = JSON.parse(e)), E.value.includes(".")) {
123
+ const [t, n] = E.value.split(".");
124
+ o.value.options[t][n] = e;
125
+ } else
126
+ o.value.options[E.value] = e;
127
+ };
128
+ return ue(() => {
129
+ o.value && (w.value = "1");
130
+ }), L(
131
+ () => {
132
+ var e;
133
+ return (e = o.value) == null ? void 0 : e.options;
134
+ },
135
+ () => {
136
+ m.designer.saveCurrentHistoryStep();
137
+ },
138
+ { deep: !0 }
139
+ ), L(
140
+ () => m.formConfig,
141
+ () => {
142
+ m.designer.saveCurrentHistoryStep();
143
+ },
144
+ { deep: !0 }
145
+ ), ce(() => {
146
+ P.on$("editEventHandler", (e) => {
147
+ ne(e[0], e[1], e[2]);
148
+ }), te(), m.designer.handleEvent("form-css-updated", (e) => {
149
+ m.designer.setCssClassList(e);
150
+ }), m.designer.handleEvent("field-selected", (e) => {
151
+ D.value = !!e && e.type === "sub-form";
152
+ });
153
+ }), z({
154
+ emit$: P.emit$
155
+ }), (e, t) => {
156
+ const n = f("a-collapse-panel"), l = f("a-collapse"), v = f("a-form"), p = f("a-empty"), _ = f("a-tab-pane"), y = f("a-tabs"), b = f("a-layout"), se = f("a-config-provider");
157
+ return g(), T(V, null, [
158
+ r(se, { componentSize: "small" }, {
159
+ default: d(() => [
160
+ r(b, { class: "panel-container" }, {
161
+ default: d(() => [
162
+ r(y, {
163
+ activeKey: w.value,
164
+ "onUpdate:activeKey": t[4] || (t[4] = (a) => w.value = a),
165
+ style: { height: "100%", width: "100%", overflow: "hidden" }
166
+ }, {
167
+ default: d(() => [
168
+ r(_, {
169
+ tab: h(u)("designer.hint.widgetSetting"),
170
+ key: "1"
171
+ }, {
172
+ default: d(() => [
173
+ K("div", he, [
174
+ e.designer.selectedWidget ? (g(), C(v, {
175
+ key: 0,
176
+ model: s.value,
177
+ labelAlign: "left",
178
+ "label-width": "120px",
179
+ class: "setting-form tpf-form",
180
+ onSubmit: t[2] || (t[2] = pe(() => {
181
+ }, ["prevent"]))
182
+ }, {
183
+ default: d(() => [
184
+ r(l, {
185
+ activeKey: A.value,
186
+ "onUpdate:activeKey": t[1] || (t[1] = (a) => A.value = a),
187
+ class: "setting-collapse"
188
+ }, {
189
+ default: d(() => [
190
+ (g(!0), T(V, null, U(ee.value, (a) => (g(), C(n, {
191
+ key: a.key,
192
+ class: fe(a.className),
193
+ header: a.headerKey
194
+ }, {
195
+ default: d(() => [
196
+ (g(!0), T(V, null, U(a.props, (le, J) => (g(), C(ge(le), {
197
+ key: J,
198
+ designer: e.designer,
199
+ "selected-widget": o.value,
200
+ "option-model": s.value,
201
+ "onUpdate:optionModel": t[0] || (t[0] = (ae) => s.value = ae),
202
+ "event-handled": Z(J)
203
+ }, null, 40, ["designer", "selected-widget", "option-model", "event-handled"]))), 128))
204
+ ]),
205
+ _: 2
206
+ }, 1032, ["class", "header"]))), 128))
207
+ ]),
208
+ _: 1
209
+ }, 8, ["activeKey"])
210
+ ]),
211
+ _: 1
212
+ }, 8, ["model"])) : (g(), C(p, {
213
+ key: 1,
214
+ description: h(u)("designer.hint.noSelectedWidgetHint")
215
+ }, null, 8, ["description"]))
216
+ ])
217
+ ]),
218
+ _: 1
219
+ }, 8, ["tab"]),
220
+ e.designer ? (g(), C(_, {
221
+ tab: h(u)("designer.hint.表单设置"),
222
+ key: "2"
223
+ }, {
224
+ default: d(() => [
225
+ K("div", Pe, [
226
+ r(ye, {
227
+ designer: e.designer,
228
+ "form-config": H.value
229
+ }, null, 8, ["designer", "form-config"])
230
+ ])
231
+ ]),
232
+ _: 1
233
+ }, 8, ["tab"])) : ve("", !0),
234
+ r(_, {
235
+ tab: h(u)("designer.hint.表单api配置"),
236
+ key: "3"
237
+ }, {
238
+ default: d(() => [
239
+ K("div", ke, [
240
+ r(Ee, {
241
+ designer: e.designer,
242
+ "form-config": H.value,
243
+ "onUpdate:formConfig": t[3] || (t[3] = (a) => H.value = a)
244
+ }, null, 8, ["designer", "form-config"])
245
+ ])
246
+ ]),
247
+ _: 1
248
+ }, 8, ["tab"])
249
+ ]),
250
+ _: 1
251
+ }, 8, ["activeKey"])
252
+ ]),
253
+ _: 1
254
+ })
255
+ ]),
256
+ _: 1
257
+ }),
258
+ r(h(me), {
259
+ eventHeader: N.value,
260
+ ref_key: "CodeModalEditorRef",
261
+ ref: S,
262
+ title: W.value,
263
+ mode: k.value,
264
+ readonly: !1,
265
+ onSetCode: oe
266
+ }, null, 8, ["eventHeader", "title", "mode"])
267
+ ], 64);
268
+ };
269
+ }
270
+ });
271
+ export {
272
+ Ve as default
273
+ };
@@ -1,9 +1,10 @@
1
- import { defineComponent as _, ref as u, watch as C, resolveComponent as p, createElementBlock as L, openBlock as h, Fragment as k, createVNode as e, unref as o, withCtx as n, createTextVNode as f, toDisplayString as c } from "vue";
1
+ import { defineComponent as _, ref as u, watch as C, resolveComponent as p, createElementBlock as h, openBlock as L, Fragment as k, createVNode as e, unref as o, withCtx as n, createTextVNode as f, toDisplayString as c } from "vue";
2
2
  import { useI18n as w } from "../../../../utils/i18n.js";
3
3
  import { cloneDeep as x } from "lodash-es";
4
4
  import D from "../../../public/ActionButtonListDialog.vue.js";
5
5
  import { TpfModal as B } from "tmgc2-share";
6
- const U = /* @__PURE__ */ _({
6
+ const T = /* @__PURE__ */ _({
7
+ inheritAttrs: !1,
7
8
  name: "button-list-editor",
8
9
  __name: "button-list-editor",
9
10
  props: {
@@ -23,7 +24,7 @@ const U = /* @__PURE__ */ _({
23
24
  };
24
25
  return (M, s) => {
25
26
  const d = p("a-button"), v = p("a-form-item");
26
- return h(), L(k, null, [
27
+ return L(), h(k, null, [
27
28
  e(v, {
28
29
  label: o(i)("designer.setting.buttonList")
29
30
  }, {
@@ -72,5 +73,5 @@ const U = /* @__PURE__ */ _({
72
73
  }
73
74
  });
74
75
  export {
75
- U as default
76
+ T as default
76
77
  };
@@ -4,6 +4,7 @@ import { resolveComponent as c, createElementBlock as g, openBlock as v, Fragmen
4
4
  import w from "../../../../../../../_virtual/_plugin-vue_export-helper.js";
5
5
  const h = {
6
6
  name: "data-table-customRow-editor",
7
+ inheritAttrs: !1,
7
8
  mixins: [b, f],
8
9
  props: {
9
10
  designer: Object,
@@ -1,8 +1,9 @@
1
- import { defineComponent as i, mergeModels as s, useModel as a, resolveComponent as t, createBlock as p, openBlock as m, unref as u, withCtx as f, createVNode as _ } from "vue";
2
- import { useI18n as M } from "../../../../../utils/i18n.js";
3
- const h = /* @__PURE__ */ i({
1
+ import { defineComponent as a, mergeModels as i, useModel as s, resolveComponent as t, createBlock as p, openBlock as m, unref as u, withCtx as f, createVNode as _ } from "vue";
2
+ import { useI18n as w } from "../../../../../utils/i18n.js";
3
+ const g = /* @__PURE__ */ a({
4
+ name: "data-table-colorRow-editor",
4
5
  __name: "data-table-colorRow-editor",
5
- props: /* @__PURE__ */ s({
6
+ props: /* @__PURE__ */ i({
6
7
  designer: Object,
7
8
  selectedWidget: Object,
8
9
  optionModel: Object
@@ -17,8 +18,8 @@ const h = /* @__PURE__ */ i({
17
18
  }),
18
19
  emits: ["update:optionModel"],
19
20
  setup(n) {
20
- const { i18nt: l } = M(), e = a(n, "optionModel");
21
- return (w, o) => {
21
+ const { i18nt: l } = w(), e = s(n, "optionModel");
22
+ return (M, o) => {
22
23
  const c = t("a-switch"), d = t("a-form-item");
23
24
  return m(), p(d, {
24
25
  label: u(l)("designer.setting.selectRow")
@@ -35,5 +36,5 @@ const h = /* @__PURE__ */ i({
35
36
  }
36
37
  });
37
38
  export {
38
- h as default
39
+ g as default
39
40
  };