@kp-ui/lowcode 2.14.0-beta.2 → 2.14.0-beta.3
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.
- package/package.json +1 -1
- package/src/components/form-designer/setting-panel/index.vue.js +2 -2
- package/src/components/form-designer/setting-panel/index.vue2.js +50 -50
- package/src/components/form-designer/setting-panel/propertyRegister.js +6 -2
- package/stats.html +1 -1
- package/styles/style.css +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import t from "./index.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-5def8b02"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as ue, mergeModels as ce, useModel as B, inject as ve, ref as
|
|
1
|
+
import { defineComponent as ue, mergeModels as ce, useModel as B, inject as ve, ref as a, provide as I, computed as j, watchEffect as fe, watch as L, onBeforeMount as ge, resolveComponent as p, createElementBlock as P, openBlock as r, Fragment as w, createVNode as d, withCtx as u, createBlock as y, createCommentVNode as U, unref as E, createElementVNode as K, withModifiers as pe, renderList as z, normalizeClass as me, resolveDynamicComponent as ye } from "vue";
|
|
2
2
|
import D from "./property-editor/index.js";
|
|
3
|
-
import { TpfCodeEditor as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import be, { propertyRegistered as he } from "./propertyRegister.js";
|
|
3
|
+
import { TpfCodeEditor as Ee } from "tmgc2-share";
|
|
4
|
+
import _e from "./form-setting.vue.js";
|
|
5
|
+
import Ce from "./form-crud-setting.vue.js";
|
|
6
|
+
import be, { propertyRegistered as he, getPropertyEditor as Pe } from "./propertyRegister.js";
|
|
7
7
|
import { get as q } from "../../../utils/smart-vue-i18n/utils.js";
|
|
8
|
-
import { useEmitter as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
const
|
|
8
|
+
import { useEmitter as we } from "../../../utils/useEmitter.js";
|
|
9
|
+
import { useI18n as Me } from "../../../utils/i18n.js";
|
|
10
|
+
const He = { class: "setting-scrollbar" }, Se = { class: "setting-scrollbar" }, ke = { class: "ds-setting-scrollbar" }, We = /* @__PURE__ */ ue({
|
|
11
11
|
name: "SettingPanel",
|
|
12
12
|
componentName: "SettingPanel",
|
|
13
13
|
__name: "index",
|
|
@@ -27,9 +27,9 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
27
27
|
}),
|
|
28
28
|
emits: ["update:form-config", "update:selected-widget"],
|
|
29
29
|
setup(M, { expose: G }) {
|
|
30
|
-
const { i18nt: c } =
|
|
30
|
+
const { i18nt: c } = Me(), { COMMON_PROPERTIES: O, ADVANCED_PROPERTIES: R, EVENT_PROPERTIES: T } = be, v = M, H = B(M, "form-config"), _ = we(), Q = v.globalDsv || {}, X = ve("getDesignerConfig"), W = a(!1);
|
|
31
31
|
I("isSubFormChildWidget", () => W.value), I("getGlobalDsv", () => Q);
|
|
32
|
-
const
|
|
32
|
+
const S = a(), F = a(""), C = a("javascript"), k = a("2"), J = a(["1", "2", "3"]), f = a(""), m = a(""), $ = a(""), o = B(M, "selected-widget"), x = j(() => X()), l = j({
|
|
33
33
|
get() {
|
|
34
34
|
var e;
|
|
35
35
|
return ((e = o.value) == null ? void 0 : e.options) || {};
|
|
@@ -48,7 +48,7 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
48
48
|
const n = e.replace(o.value.type + "-", "");
|
|
49
49
|
return v.designer.hasConfig(o.value, n);
|
|
50
50
|
}, ee = (e, t) => {
|
|
51
|
-
const n = e.replace(o.value.type + "-", "")
|
|
51
|
+
const n = e.replace(o.value.type + "-", ""), s = Pe(n);
|
|
52
52
|
return D[s] ? D[s] : D[n];
|
|
53
53
|
}, V = (e) => {
|
|
54
54
|
let t = !1;
|
|
@@ -90,41 +90,41 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
90
90
|
}
|
|
91
91
|
].filter((s) => s.visible);
|
|
92
92
|
}), ne = () => {
|
|
93
|
-
|
|
93
|
+
_.off$("onChangeEventHandler"), _.on$("onChangeEventHandler", ({ title: e, attr: t, eventParams: n = [], mode: s }) => {
|
|
94
94
|
F.value = e || c("designer.setting.editWidgetEventHandler");
|
|
95
95
|
const g = s === "json";
|
|
96
|
-
m.value = t,
|
|
96
|
+
m.value = t, C.value = s;
|
|
97
97
|
const b = `${l.value.name}.${t}`;
|
|
98
|
-
|
|
98
|
+
$.value = g ? `${b}{` : `${b}(${n.join(", ")}) {`, f.value = q(o.value.options, t) || "", s === "json" && (f.value = JSON.stringify(l.value.menuList, null, " ")), t === "onValidate" && !l.value.onValidate && (f.value = ` /* sample code */
|
|
99
99
|
/*
|
|
100
100
|
if ((value > 100) || (value < 0)) {
|
|
101
101
|
return Promise.reject('error message') //fail
|
|
102
102
|
} else {
|
|
103
103
|
return Promise.resolve(); //pass
|
|
104
104
|
}
|
|
105
|
-
*/`),
|
|
105
|
+
*/`), S.value.open(f.value);
|
|
106
106
|
});
|
|
107
107
|
}, oe = (e, t, n = "javascript") => {
|
|
108
108
|
const s = n === "json";
|
|
109
|
-
m.value = e,
|
|
109
|
+
m.value = e, C.value = n;
|
|
110
110
|
const g = `${l.value.name}.${e}`;
|
|
111
|
-
|
|
111
|
+
$.value = s ? `${g}{` : `${g}(${t.join(", ")}) {`, f.value = q(o.value.options, e) || "", n === "json" && (f.value = JSON.stringify(l.value.menuList, null, " ")), e === "onValidate" && !l.value.onValidate && (f.value = ` /* sample code */
|
|
112
112
|
/*
|
|
113
113
|
if ((value > 100) || (value < 0)) {
|
|
114
114
|
return Promise.reject('error message') //fail
|
|
115
115
|
} else {
|
|
116
116
|
return Promise.resolve(); //pass
|
|
117
117
|
}
|
|
118
|
-
*/`),
|
|
118
|
+
*/`), S.value.open(f.value);
|
|
119
119
|
}, se = (e) => {
|
|
120
|
-
if (
|
|
120
|
+
if (C.value === "json" && (e = JSON.parse(e)), m.value.includes(".")) {
|
|
121
121
|
const [t, n] = m.value.split(".");
|
|
122
122
|
o.value.options[t][n] = e;
|
|
123
123
|
} else
|
|
124
124
|
o.value.options[m.value] = e;
|
|
125
125
|
};
|
|
126
126
|
return fe(() => {
|
|
127
|
-
o.value && (
|
|
127
|
+
o.value && (k.value = "1");
|
|
128
128
|
}), L(
|
|
129
129
|
() => {
|
|
130
130
|
var e;
|
|
@@ -141,7 +141,7 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
141
141
|
},
|
|
142
142
|
{ deep: !0 }
|
|
143
143
|
), ge(() => {
|
|
144
|
-
|
|
144
|
+
_.on$("editEventHandler", (e) => {
|
|
145
145
|
oe(e[0], e[1], e[2]);
|
|
146
146
|
}), ne(), v.designer.handleEvent("form-css-updated", (e) => {
|
|
147
147
|
v.designer.setCssClassList(e);
|
|
@@ -149,26 +149,26 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
149
149
|
W.value = !!e && e.type === "sub-form";
|
|
150
150
|
});
|
|
151
151
|
}), G({
|
|
152
|
-
emit$:
|
|
152
|
+
emit$: _.emit$
|
|
153
153
|
}), (e, t) => {
|
|
154
|
-
const n = p("a-collapse-panel"), s = p("a-collapse"), g = p("a-form"), b = p("a-empty"), N = p("a-tab-pane"), le = p("a-tabs"),
|
|
154
|
+
const n = p("a-collapse-panel"), s = p("a-collapse"), g = p("a-form"), b = p("a-empty"), N = p("a-tab-pane"), le = p("a-tabs"), ie = p("a-layout"), ae = p("a-config-provider");
|
|
155
155
|
return r(), P(w, null, [
|
|
156
|
-
d(
|
|
156
|
+
d(ae, { componentSize: "small" }, {
|
|
157
157
|
default: u(() => [
|
|
158
|
-
d(
|
|
158
|
+
d(ie, { class: "panel-container" }, {
|
|
159
159
|
default: u(() => [
|
|
160
160
|
d(le, {
|
|
161
|
-
activeKey:
|
|
162
|
-
"onUpdate:activeKey": t[4] || (t[4] = (
|
|
161
|
+
activeKey: k.value,
|
|
162
|
+
"onUpdate:activeKey": t[4] || (t[4] = (i) => k.value = i),
|
|
163
163
|
style: { height: "100%", width: "100%", overflow: "hidden" }
|
|
164
164
|
}, {
|
|
165
165
|
default: u(() => [
|
|
166
166
|
d(N, {
|
|
167
|
-
tab:
|
|
167
|
+
tab: E(c)("designer.hint.widgetSetting"),
|
|
168
168
|
key: "1"
|
|
169
169
|
}, {
|
|
170
170
|
default: u(() => [
|
|
171
|
-
K("div",
|
|
171
|
+
K("div", He, [
|
|
172
172
|
e.designer.selectedWidget ? (r(), y(g, {
|
|
173
173
|
key: 0,
|
|
174
174
|
model: l.value,
|
|
@@ -181,17 +181,17 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
181
181
|
default: u(() => [
|
|
182
182
|
d(s, {
|
|
183
183
|
activeKey: J.value,
|
|
184
|
-
"onUpdate:activeKey": t[1] || (t[1] = (
|
|
184
|
+
"onUpdate:activeKey": t[1] || (t[1] = (i) => J.value = i),
|
|
185
185
|
class: "setting-collapse"
|
|
186
186
|
}, {
|
|
187
187
|
default: u(() => [
|
|
188
|
-
(r(!0), P(w, null, z(te.value, (
|
|
189
|
-
key:
|
|
190
|
-
class: me(
|
|
191
|
-
header:
|
|
188
|
+
(r(!0), P(w, null, z(te.value, (i) => (r(), y(n, {
|
|
189
|
+
key: i.key,
|
|
190
|
+
class: me(i.className),
|
|
191
|
+
header: i.headerKey
|
|
192
192
|
}, {
|
|
193
193
|
default: u(() => [
|
|
194
|
-
(r(!0), P(w, null, z(
|
|
194
|
+
(r(!0), P(w, null, z(i.props, (re, h) => (r(), P(w, null, [
|
|
195
195
|
A(h, re) ? (r(), y(ye(ee(h)), {
|
|
196
196
|
key: h,
|
|
197
197
|
designer: e.designer,
|
|
@@ -211,36 +211,36 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
211
211
|
_: 1
|
|
212
212
|
}, 8, ["model"])) : (r(), y(b, {
|
|
213
213
|
key: 1,
|
|
214
|
-
description:
|
|
214
|
+
description: E(c)("designer.hint.noSelectedWidgetHint")
|
|
215
215
|
}, null, 8, ["description"]))
|
|
216
216
|
])
|
|
217
217
|
]),
|
|
218
218
|
_: 1
|
|
219
219
|
}, 8, ["tab"]),
|
|
220
220
|
e.designer ? (r(), y(N, {
|
|
221
|
-
tab:
|
|
221
|
+
tab: E(c)("designer.hint.表单设置"),
|
|
222
222
|
key: "2"
|
|
223
223
|
}, {
|
|
224
224
|
default: u(() => [
|
|
225
|
-
K("div",
|
|
226
|
-
d(
|
|
225
|
+
K("div", Se, [
|
|
226
|
+
d(_e, {
|
|
227
227
|
designer: e.designer,
|
|
228
|
-
"form-config":
|
|
228
|
+
"form-config": H.value
|
|
229
229
|
}, null, 8, ["designer", "form-config"])
|
|
230
230
|
])
|
|
231
231
|
]),
|
|
232
232
|
_: 1
|
|
233
233
|
}, 8, ["tab"])) : U("", !0),
|
|
234
234
|
d(N, {
|
|
235
|
-
tab:
|
|
235
|
+
tab: E(c)("designer.hint.表单api配置"),
|
|
236
236
|
key: "3"
|
|
237
237
|
}, {
|
|
238
238
|
default: u(() => [
|
|
239
|
-
K("div",
|
|
240
|
-
d(
|
|
239
|
+
K("div", ke, [
|
|
240
|
+
d(Ce, {
|
|
241
241
|
designer: e.designer,
|
|
242
|
-
"form-config":
|
|
243
|
-
"onUpdate:formConfig": t[3] || (t[3] = (
|
|
242
|
+
"form-config": H.value,
|
|
243
|
+
"onUpdate:formConfig": t[3] || (t[3] = (i) => H.value = i)
|
|
244
244
|
}, null, 8, ["designer", "form-config"])
|
|
245
245
|
])
|
|
246
246
|
]),
|
|
@@ -255,12 +255,12 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
255
255
|
]),
|
|
256
256
|
_: 1
|
|
257
257
|
}),
|
|
258
|
-
d(
|
|
259
|
-
eventHeader:
|
|
258
|
+
d(E(Ee), {
|
|
259
|
+
eventHeader: $.value,
|
|
260
260
|
ref_key: "CodeModalEditorRef",
|
|
261
|
-
ref:
|
|
261
|
+
ref: S,
|
|
262
262
|
title: F.value,
|
|
263
|
-
mode:
|
|
263
|
+
mode: C.value,
|
|
264
264
|
readonly: !1,
|
|
265
265
|
onSetCode: se
|
|
266
266
|
}, null, 8, ["eventHeader", "title", "mode"])
|
|
@@ -269,5 +269,5 @@ const Me = { class: "setting-scrollbar" }, $e = { class: "setting-scrollbar" },
|
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
export {
|
|
272
|
-
|
|
272
|
+
We as default
|
|
273
273
|
};
|
|
@@ -197,12 +197,16 @@ const e = {
|
|
|
197
197
|
function d(o) {
|
|
198
198
|
return !!e[o] || !!t[o] || !!i[o];
|
|
199
199
|
}
|
|
200
|
-
|
|
200
|
+
function r(o) {
|
|
201
|
+
return e[o] || t[o] || i[o];
|
|
202
|
+
}
|
|
203
|
+
const n = {
|
|
201
204
|
COMMON_PROPERTIES: e,
|
|
202
205
|
ADVANCED_PROPERTIES: t,
|
|
203
206
|
EVENT_PROPERTIES: i
|
|
204
207
|
};
|
|
205
208
|
export {
|
|
206
|
-
|
|
209
|
+
n as default,
|
|
210
|
+
r as getPropertyEditor,
|
|
207
211
|
d as propertyRegistered
|
|
208
212
|
};
|