@kp-ui/lowcode 2.15.0-alpha.11 → 2.15.0-alpha.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.
- package/package.json +1 -1
- package/src/components/form-designer/form-widget/field-widget/hooks/useSelect.js +55 -53
- package/src/components/form-designer/form-widget/field-widget/select-widget.vue2.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/textarea-widget.vue2.js +16 -16
- package/src/components/form-designer/form-widget/field-widget/time-range-widget.vue2.js +11 -11
- package/src/components/form-render/container-items/vf-box-widget.vue2.js +9 -9
- package/src/components/public/CustomerModal/useCustomerModal.js +12 -12
- package/stats.html +1 -1
- package/types/install.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { debounce as
|
|
3
|
-
import { translateOptionItems as
|
|
4
|
-
import { useExecFunction as
|
|
5
|
-
function
|
|
1
|
+
import { ref as m, computed as p, unref as F } from "vue";
|
|
2
|
+
import { debounce as N, isArray as O } from "lodash-es";
|
|
3
|
+
import { translateOptionItems as R } from "../../../../../utils/util.js";
|
|
4
|
+
import { useExecFunction as q } from "tmgc2-share";
|
|
5
|
+
function D(t, g) {
|
|
6
6
|
if (!Array.isArray(t))
|
|
7
7
|
return -1;
|
|
8
8
|
let l = -1;
|
|
9
9
|
return t.forEach((i, r) => {
|
|
10
|
-
i ===
|
|
10
|
+
i === g && (l = r);
|
|
11
11
|
}), l;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const i =
|
|
13
|
+
function U({ field: t, designState: g, fieldModel: l }) {
|
|
14
|
+
const i = m({
|
|
15
15
|
val: ""
|
|
16
|
-
}), r =
|
|
16
|
+
}), r = m(!1), s = m({
|
|
17
17
|
page: 1,
|
|
18
18
|
pageSize: 20,
|
|
19
19
|
totalPage: 0,
|
|
20
20
|
total: 0
|
|
21
|
-
}), { execHttpFunction:
|
|
21
|
+
}), { execHttpFunction: P } = q(), h = async () => {
|
|
22
22
|
var e;
|
|
23
|
-
if (!r.value) {
|
|
23
|
+
if (console.log(32321321), !r.value) {
|
|
24
24
|
if (r.value = !0, t.options.dsEnabled && ((e = t.options.http) != null && e.url))
|
|
25
25
|
try {
|
|
26
|
-
const { http: o, dataHandlerCode: n, dataReqHandlerCode: u } = t.options,
|
|
26
|
+
const { http: o, dataHandlerCode: n, dataReqHandlerCode: u } = t.options, a = await P(
|
|
27
27
|
{
|
|
28
28
|
http: o,
|
|
29
29
|
dataHandlerCode: n,
|
|
@@ -31,72 +31,72 @@ function J({ field: t, designState: v, fieldModel: l }) {
|
|
|
31
31
|
},
|
|
32
32
|
{}
|
|
33
33
|
);
|
|
34
|
-
if (!
|
|
34
|
+
if (!a) {
|
|
35
35
|
r.value = !1;
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
39
|
-
|
|
38
|
+
if (O(a)) {
|
|
39
|
+
c(a);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
O(a.list) && (t.options.loadingPage ? (s.value.total = a.total || 0, s.value.totalPage = a.totalPage || 0, c([...v(), ...a.list])) : c(a.list));
|
|
43
43
|
} catch (o) {
|
|
44
44
|
console.error("err: ", o);
|
|
45
45
|
}
|
|
46
46
|
else
|
|
47
|
-
|
|
47
|
+
c([...v()]);
|
|
48
48
|
r.value = !1;
|
|
49
49
|
}
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
}, 500),
|
|
50
|
+
}, w = N(function() {
|
|
51
|
+
s.value.page += 1, h();
|
|
52
|
+
}, 500), E = (e) => {
|
|
53
53
|
if (!t.options.loadingPage) return;
|
|
54
|
-
const { target: o } = e, { scrollTop: n, scrollHeight: u, clientHeight:
|
|
55
|
-
if (u - (n +
|
|
56
|
-
if (
|
|
54
|
+
const { target: o } = e, { scrollTop: n, scrollHeight: u, clientHeight: a } = o;
|
|
55
|
+
if (u - (n + a) <= 30 && s.value.totalPage > s.value.page) {
|
|
56
|
+
if (s.value.totalPage === s.value.page)
|
|
57
57
|
return;
|
|
58
|
-
|
|
58
|
+
w();
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, x = p(() => (t == null ? void 0 : t.options.labelKey) || "label"), b = p(() => (t == null ? void 0 : t.options.valueKey) || "value"), H = p(() => (t == null ? void 0 : t.options.childrenKey) || "children"), y = p(() => ({
|
|
61
61
|
label: (t == null ? void 0 : t.options.labelKey) || "label",
|
|
62
62
|
value: (t == null ? void 0 : t.options.valueKey) || "value",
|
|
63
63
|
options: "options"
|
|
64
|
-
})),
|
|
65
|
-
|
|
64
|
+
})), K = (e, o) => o[y.value.label].toLowerCase().indexOf(e.toLowerCase()) >= 0, C = () => {
|
|
65
|
+
s.value = { page: 1, pageSize: 20, total: 0, totalPage: 0 }, c([]);
|
|
66
66
|
}, L = (e) => {
|
|
67
|
-
t.options.showSearch && (
|
|
68
|
-
}, A =
|
|
67
|
+
t.options.showSearch && (g || (C(), i.value.val = e, h()));
|
|
68
|
+
}, A = p(() => {
|
|
69
69
|
var n;
|
|
70
70
|
const o = (n = t == null ? void 0 : t.options) == null ? void 0 : n.showSearch;
|
|
71
71
|
return {
|
|
72
72
|
loading: r.value,
|
|
73
|
-
fieldNames:
|
|
73
|
+
fieldNames: y.value,
|
|
74
74
|
showSearch: !0,
|
|
75
|
-
onPopupScroll:
|
|
75
|
+
onPopupScroll: E,
|
|
76
76
|
onSearch: L,
|
|
77
|
-
filterOption: !o &&
|
|
77
|
+
filterOption: !o && K,
|
|
78
78
|
listHeight: 240
|
|
79
79
|
};
|
|
80
|
-
}),
|
|
81
|
-
t.options.optionItems =
|
|
80
|
+
}), c = async (e) => {
|
|
81
|
+
t.options.optionItems = R(
|
|
82
82
|
e,
|
|
83
83
|
t.type,
|
|
84
84
|
t.options.labelKey || "label",
|
|
85
85
|
t.options.valueKey || "value"
|
|
86
86
|
);
|
|
87
|
-
},
|
|
87
|
+
}, v = () => t.options.optionItems, k = () => v().find((o) => o[b.value] === l.value), z = p(() => {
|
|
88
88
|
if (l.value === null)
|
|
89
89
|
return "";
|
|
90
90
|
{
|
|
91
91
|
let e = "";
|
|
92
92
|
const { valueKey: o, labelKey: n } = t.options;
|
|
93
93
|
return t.options.optionItems.forEach((u) => {
|
|
94
|
-
(u[o] === l.value ||
|
|
94
|
+
(u[o] === l.value || D(l.value, u[o]) !== -1) && (e = e === "" ? u[n] : e + " " + u[n]);
|
|
95
95
|
}), e;
|
|
96
96
|
}
|
|
97
|
-
}),
|
|
97
|
+
}), S = () => {
|
|
98
98
|
t.options.dsEnabled && t.options.optionItems.splice(0, t.options.optionItems.length);
|
|
99
|
-
},
|
|
99
|
+
}, I = (e) => {
|
|
100
100
|
const o = t.options.optionItems;
|
|
101
101
|
o && o.length > 0 && o.forEach((n) => {
|
|
102
102
|
n.value === e && (n.disabled = !0);
|
|
@@ -104,33 +104,35 @@ function J({ field: t, designState: v, fieldModel: l }) {
|
|
|
104
104
|
};
|
|
105
105
|
return {
|
|
106
106
|
selectDefineExpose: {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
getSelectedItem: k,
|
|
108
|
+
disableOption: I,
|
|
109
|
+
clearOptionItems: S,
|
|
109
110
|
enableOption: (e) => {
|
|
110
111
|
const o = t.options.optionItems;
|
|
111
112
|
o && o.length > 0 && o.forEach((n) => {
|
|
112
113
|
n.value === e && (n.disabled = !1);
|
|
113
114
|
});
|
|
114
115
|
},
|
|
115
|
-
|
|
116
|
+
getOptionItems: v,
|
|
117
|
+
keyword: F(i)
|
|
116
118
|
},
|
|
117
|
-
disableOption:
|
|
118
|
-
clearOptionItems:
|
|
119
|
+
disableOption: I,
|
|
120
|
+
clearOptionItems: S,
|
|
119
121
|
childrenKey: H,
|
|
120
|
-
valueKey:
|
|
121
|
-
labelKey:
|
|
122
|
-
optionLabel:
|
|
123
|
-
loadOptions:
|
|
124
|
-
filterOption:
|
|
122
|
+
valueKey: b,
|
|
123
|
+
labelKey: x,
|
|
124
|
+
optionLabel: z,
|
|
125
|
+
loadOptions: c,
|
|
126
|
+
filterOption: K,
|
|
125
127
|
keyword: i,
|
|
126
|
-
pager:
|
|
128
|
+
pager: s,
|
|
127
129
|
loading: r,
|
|
128
|
-
fieldNames:
|
|
130
|
+
fieldNames: y,
|
|
129
131
|
selectOps: A,
|
|
130
|
-
initOptionItems:
|
|
131
|
-
getOptionItems:
|
|
132
|
+
initOptionItems: h,
|
|
133
|
+
getOptionItems: v
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
136
|
export {
|
|
135
|
-
|
|
137
|
+
U as useSelect
|
|
136
138
|
};
|
|
@@ -41,7 +41,7 @@ const R = /* @__PURE__ */ S({
|
|
|
41
41
|
F(() => {
|
|
42
42
|
o();
|
|
43
43
|
}), u({
|
|
44
|
-
|
|
44
|
+
...s,
|
|
45
45
|
...i
|
|
46
46
|
});
|
|
47
47
|
const d = { props: e, rules: p, i18nt: a, field: t, fieldModel: r, isReadMode: m, size: f, designState: n, fieldEditor: c, handleHidden: b, handleDisabled: y, handleClickIcon: g, handleFocusCustomEvent: _, handleBlurCustomEvent: q, defineExposed: i, selectOps: I, optionLabel: x, initOptionItems: o, selectDefineExpose: s, FormItemWrapper: h, get SvgIcon() {
|
|
@@ -3,13 +3,13 @@ import { useEmitter as q } from "../../../../utils/useEmitter.js";
|
|
|
3
3
|
import F from "./form-item-wrapper.vue.js";
|
|
4
4
|
import { useField as x } from "./useField.js";
|
|
5
5
|
import { ComponentNameEnum as N, WidgetTypeEnum as h } from "../../../../constants/WidgetTypeEnum.js";
|
|
6
|
-
const
|
|
6
|
+
const I = /* @__PURE__ */ _({
|
|
7
7
|
name: h.textarea,
|
|
8
8
|
componentName: N.FieldWidget,
|
|
9
9
|
__name: "textarea-widget",
|
|
10
10
|
props: {
|
|
11
|
-
widget: { type:
|
|
12
|
-
field: { type:
|
|
11
|
+
widget: { type: null, required: !0 },
|
|
12
|
+
field: { type: null, required: !0 },
|
|
13
13
|
designer: { type: null, required: !1 },
|
|
14
14
|
parentWidget: { type: [Object, null], required: !1 },
|
|
15
15
|
parentList: { type: [Array, null], required: !1 },
|
|
@@ -19,32 +19,32 @@ const j = /* @__PURE__ */ _({
|
|
|
19
19
|
subFormColIndex: { type: Number, required: !1 }
|
|
20
20
|
},
|
|
21
21
|
setup(u, { expose: s }) {
|
|
22
|
-
const { dispatch:
|
|
23
|
-
rules:
|
|
22
|
+
const { dispatch: l } = q(), e = u, {
|
|
23
|
+
rules: a,
|
|
24
24
|
i18nt: r,
|
|
25
25
|
field: t,
|
|
26
26
|
fieldModel: i,
|
|
27
|
-
isReadMode:
|
|
28
|
-
size:
|
|
27
|
+
isReadMode: m,
|
|
28
|
+
size: p,
|
|
29
29
|
handleHidden: f,
|
|
30
30
|
handleDisabled: c,
|
|
31
|
-
handleFocusCustomEvent:
|
|
32
|
-
handleBlurCustomEvent:
|
|
33
|
-
getWidgetRef:
|
|
34
|
-
getFormRef:
|
|
35
|
-
getPropName:
|
|
31
|
+
handleFocusCustomEvent: y,
|
|
32
|
+
handleBlurCustomEvent: g,
|
|
33
|
+
getWidgetRef: n,
|
|
34
|
+
getFormRef: d,
|
|
35
|
+
getPropName: b
|
|
36
36
|
} = x(e);
|
|
37
37
|
s({
|
|
38
38
|
i18nt: r,
|
|
39
39
|
field: t,
|
|
40
40
|
fieldModel: i,
|
|
41
|
-
getFormRef:
|
|
42
|
-
getWidgetRef:
|
|
41
|
+
getFormRef: d,
|
|
42
|
+
getWidgetRef: n
|
|
43
43
|
});
|
|
44
|
-
const o = { dispatch:
|
|
44
|
+
const o = { dispatch: l, props: e, rules: a, i18nt: r, field: t, fieldModel: i, isReadMode: m, size: p, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: y, handleBlurCustomEvent: g, getWidgetRef: n, getFormRef: d, getPropName: b, FormItemWrapper: F };
|
|
45
45
|
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
export {
|
|
49
|
-
|
|
49
|
+
I as default
|
|
50
50
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as g, computed as q } from "vue";
|
|
2
2
|
import F from "./form-item-wrapper.vue.js";
|
|
3
3
|
import { useField as x } from "./useField.js";
|
|
4
|
-
import { ComponentNameEnum as E, WidgetTypeEnum as
|
|
5
|
-
const
|
|
6
|
-
name:
|
|
4
|
+
import { ComponentNameEnum as E, WidgetTypeEnum as v } from "../../../../constants/WidgetTypeEnum.js";
|
|
5
|
+
const w = /* @__PURE__ */ g({
|
|
6
|
+
name: v.timeRange,
|
|
7
7
|
componentName: E.FieldWidget,
|
|
8
8
|
__name: "time-range-widget",
|
|
9
9
|
props: {
|
|
10
|
-
widget: { type:
|
|
11
|
-
field: { type:
|
|
10
|
+
widget: { type: null, required: !0 },
|
|
11
|
+
field: { type: null, required: !0 },
|
|
12
12
|
designer: { type: null, required: !1 },
|
|
13
13
|
parentWidget: { type: [Object, null], required: !1 },
|
|
14
14
|
parentList: { type: [Array, null], required: !1 },
|
|
@@ -20,16 +20,16 @@ const R = /* @__PURE__ */ g({
|
|
|
20
20
|
setup(i, { expose: o }) {
|
|
21
21
|
const r = i, {
|
|
22
22
|
rules: u,
|
|
23
|
-
i18nt:
|
|
24
|
-
fieldEditor:
|
|
23
|
+
i18nt: l,
|
|
24
|
+
fieldEditor: s,
|
|
25
25
|
field: a,
|
|
26
26
|
fieldModel: e,
|
|
27
27
|
isReadMode: p,
|
|
28
28
|
size: m,
|
|
29
29
|
handleHidden: f,
|
|
30
30
|
handleDisabled: c,
|
|
31
|
-
handleFocusCustomEvent:
|
|
32
|
-
handleBlurCustomEvent:
|
|
31
|
+
handleFocusCustomEvent: y,
|
|
32
|
+
handleBlurCustomEvent: b,
|
|
33
33
|
defineExposed: t
|
|
34
34
|
} = x(r), _ = q(() => {
|
|
35
35
|
var d;
|
|
@@ -38,10 +38,10 @@ const R = /* @__PURE__ */ g({
|
|
|
38
38
|
o({
|
|
39
39
|
...t
|
|
40
40
|
});
|
|
41
|
-
const n = { props: r, rules: u, i18nt:
|
|
41
|
+
const n = { props: r, rules: u, i18nt: l, fieldEditor: s, field: a, fieldModel: e, isReadMode: p, size: m, handleHidden: f, handleDisabled: c, handleFocusCustomEvent: y, handleBlurCustomEvent: b, defineExposed: t, contentForReadMode: _, FormItemWrapper: F };
|
|
42
42
|
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
w as default
|
|
47
47
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as p, computed as a } from "vue";
|
|
2
2
|
import m from "../RenderWigetList.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import { ComponentNameEnum as
|
|
5
|
-
const
|
|
3
|
+
import g from "./container-wrapper.vue.js";
|
|
4
|
+
import { ComponentNameEnum as u, ContainerTypeEnum as s } from "../../../constants/WidgetTypeEnum.js";
|
|
5
|
+
const c = /* @__PURE__ */ p({
|
|
6
6
|
name: s.VfBoxWidget,
|
|
7
|
-
componentName:
|
|
7
|
+
componentName: u.VfBoxWidget,
|
|
8
8
|
__name: "vf-box-widget",
|
|
9
9
|
props: {
|
|
10
|
-
widget: { type:
|
|
11
|
-
field: { type:
|
|
12
|
-
parentWidget: { type: null, required: !0 },
|
|
10
|
+
widget: { type: Object, required: !0 },
|
|
11
|
+
field: { type: Object, required: !0 },
|
|
12
|
+
parentWidget: { type: [Object, null], required: !0 },
|
|
13
13
|
parentList: { type: Array, required: !0 },
|
|
14
14
|
indexOfParentList: { type: Number, required: !1 },
|
|
15
15
|
subFormRowIndex: { type: Number, required: !1 },
|
|
@@ -20,10 +20,10 @@ const y = /* @__PURE__ */ p({
|
|
|
20
20
|
const t = i, n = a(() => {
|
|
21
21
|
const e = t.widget.options.boxModel || {}, r = {};
|
|
22
22
|
return e.borderShow && (r.borderRadius = `${e.borderRadius}px`, r.border = `${e.borderStyle} ${e.borderWidth}px ${e.borderColor}`), (e.paddingTop !== void 0 || e.paddingRight !== void 0 || e.paddingBottom !== void 0 || e.paddingLeft !== void 0) && (r.padding = `${e.paddingTop || 0}px ${e.paddingRight || 0}px ${e.paddingBottom || 0}px ${e.paddingLeft || 0}px`), (e.marginTop !== void 0 || e.marginRight !== void 0 || e.marginBottom !== void 0 || e.marginLeft !== void 0) && (r.margin = `${e.marginTop || 0}px ${e.marginRight || 0}px ${e.marginBottom || 0}px ${e.marginLeft || 0}px`), r;
|
|
23
|
-
}), o = { props: t, boxStyle: n, RenderWigetList: m, ContainerWrapper:
|
|
23
|
+
}), o = { props: t, boxStyle: n, RenderWigetList: m, ContainerWrapper: g };
|
|
24
24
|
return Object.defineProperty(o, "__isScriptSetup", { enumerable: !1, value: !0 }), o;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
c as default
|
|
29
29
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineAsyncComponent as l, createApp as
|
|
2
|
-
const
|
|
1
|
+
import { defineAsyncComponent as l, createApp as i, createVNode as a, mergeProps as C } from "vue";
|
|
2
|
+
const g = (t, n) => {
|
|
3
3
|
const {
|
|
4
4
|
type: c,
|
|
5
5
|
formCode: m,
|
|
6
|
-
...
|
|
7
|
-
} =
|
|
8
|
-
document.body.appendChild(
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
},
|
|
6
|
+
...r
|
|
7
|
+
} = t, e = document.createElement("div");
|
|
8
|
+
document.body.appendChild(e);
|
|
9
|
+
const s = l(() => import("./CustomerModal.vue.js")), d = (p) => {
|
|
10
|
+
p.unmount(), e.remove();
|
|
11
|
+
}, o = i(a(s, C({
|
|
12
12
|
type: c,
|
|
13
13
|
formCode: m
|
|
14
14
|
}, {
|
|
15
15
|
onCancel: () => {
|
|
16
|
-
|
|
16
|
+
d(o);
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
18
|
+
}, r), null));
|
|
19
|
+
o._context.components = n._context.components, o._context.config.globalProperties = n._context.config.globalProperties, o.mount(e);
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
g as openCustomerModal
|
|
23
23
|
};
|