@blueking/bkflow-canvas-editor 1.1.0-beta.9 → 1.2.0-beta.0
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/README.md +14 -8
- package/dist/advanced.cjs.js +1 -1
- package/dist/advanced.d.ts +64 -35
- package/dist/advanced.esm.js +5 -3
- package/dist/context-B9wWQx6k.cjs +1 -0
- package/dist/{composable-Cf47ka9M.js → context-CVSZiSc9.js} +402 -350
- package/dist/index-Ac8oJo2D.js +512 -0
- package/dist/index-B0bs5G6n.cjs +1 -0
- package/dist/index-BUBxGOMp.cjs +74 -0
- package/dist/index-C5XXJX1_.cjs +1 -0
- package/dist/index-D_PNC9EL.cjs +1 -0
- package/dist/index-Ddt7hVPG.js +162 -0
- package/dist/index-FsDBMpW4.js +50941 -0
- package/dist/index-GVGs8lwh.js +234 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +258 -55
- package/dist/index.esm.js +28 -28
- package/dist/style.css +1 -1
- package/package.json +2 -3
- package/dist/composable-YlUVct40.cjs +0 -1
- package/dist/index-BUMqEAp_.cjs +0 -1
- package/dist/index-CHDpGBhL.cjs +0 -1
- package/dist/index-DDcO09tO.js +0 -502
- package/dist/index-DRd1hJ7R.js +0 -178
- package/dist/index-DY8COtuZ.cjs +0 -70
- package/dist/index-Dl8vD9_A.js +0 -46970
- package/dist/index-jvfjimMJ.cjs +0 -1
- package/dist/index-pO8VIoRB.js +0 -159
package/dist/index-DRd1hJ7R.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { defineComponent as $, ref as _, shallowRef as h, computed as V, watch as A, resolveComponent as C, resolveDirective as O, openBlock as c, createBlock as d, withCtx as m, withDirectives as P, createElementBlock as U, createElementVNode as F, unref as K, createCommentVNode as g, createVNode as x, createTextVNode as B } from "vue";
|
|
2
|
-
import { cloneDeep as p } from "lodash";
|
|
3
|
-
import { u as G, i as H, g as Y, B as z, R as J, E as M, _ as Q } from "./index-Dl8vD9_A.js";
|
|
4
|
-
import "bkui-vue/lib/message";
|
|
5
|
-
import "bkui-vue/lib/icon";
|
|
6
|
-
import "monaco-editor";
|
|
7
|
-
const S = {
|
|
8
|
-
string: "input",
|
|
9
|
-
text: "input",
|
|
10
|
-
textarea: "textarea",
|
|
11
|
-
int: "input",
|
|
12
|
-
integer: "input",
|
|
13
|
-
number: "input",
|
|
14
|
-
float: "input",
|
|
15
|
-
json: "json",
|
|
16
|
-
object: "json",
|
|
17
|
-
array: "array",
|
|
18
|
-
list: "array",
|
|
19
|
-
select: "select",
|
|
20
|
-
time: "timepicker",
|
|
21
|
-
datetime: "timepicker"
|
|
22
|
-
}, j = (e) => e.replace(/^\$\{(.+)\}$/, "$1"), E = (e) => `\${${j(e)}}`;
|
|
23
|
-
function W(e, i) {
|
|
24
|
-
const o = E(e.key), t = i ? p(i) : {}, l = e.custom_type ?? t.custom_type ?? S[e.type] ?? "input";
|
|
25
|
-
return {
|
|
26
|
-
...t,
|
|
27
|
-
key: o,
|
|
28
|
-
name: e.name ?? t.name ?? j(e.key),
|
|
29
|
-
custom_type: l,
|
|
30
|
-
desc: t.desc ?? "",
|
|
31
|
-
index: t.index ?? 0,
|
|
32
|
-
show_type: "show",
|
|
33
|
-
source_info: t.source_info ?? {},
|
|
34
|
-
source_tag: t.source_tag ?? "",
|
|
35
|
-
source_type: t.source_type ?? "custom",
|
|
36
|
-
validation: t.validation ?? "",
|
|
37
|
-
value: e.default ?? t.value,
|
|
38
|
-
meta: {
|
|
39
|
-
...t.meta ?? {},
|
|
40
|
-
required: e.required ?? t.meta?.required ?? !1
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function X(e, i = {}) {
|
|
45
|
-
if (!e) return {};
|
|
46
|
-
const o = e.constants;
|
|
47
|
-
return o && Object.keys(o).length > 0 ? { ...o } : Array.isArray(e.fields) && e.fields.length > 0 ? e.fields.reduce((t, l) => {
|
|
48
|
-
const s = E(l.key);
|
|
49
|
-
return t[s] = W(l, i[s]), t;
|
|
50
|
-
}, {}) : {};
|
|
51
|
-
}
|
|
52
|
-
const Z = { class: "global-debug-input" }, ee = { class: "form-params-wrapper" }, te = { class: "sideslider-footer-buttons" }, oe = /* @__PURE__ */ $({
|
|
53
|
-
__name: "index",
|
|
54
|
-
props: {
|
|
55
|
-
show: { type: Boolean },
|
|
56
|
-
schema: {},
|
|
57
|
-
pipelineConstants: { default: () => ({}) },
|
|
58
|
-
initialValues: { default: () => ({}) },
|
|
59
|
-
pending: { type: Boolean, default: !1 }
|
|
60
|
-
},
|
|
61
|
-
emits: ["confirm", "close", "update:show"],
|
|
62
|
-
setup(e, { emit: i }) {
|
|
63
|
-
const o = e, t = i, l = G(), s = _({}), k = h([]), u = h([]), f = h(!1), v = _(), b = _(), y = V(() => k.value.filter((a) => H(a))), R = V(() => y.value.length > 0 || u.value.length > 0);
|
|
64
|
-
A(
|
|
65
|
-
() => o.show,
|
|
66
|
-
(a) => {
|
|
67
|
-
a && (s.value = p(o.initialValues ?? {}), D());
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
const D = async () => {
|
|
71
|
-
const a = X(o.schema, o.pipelineConstants), n = Object.values(a).filter(
|
|
72
|
-
(r) => typeof r == "object" && r !== null && r.show_type === "show"
|
|
73
|
-
);
|
|
74
|
-
if (k.value = n, Object.keys(a).length < 1) {
|
|
75
|
-
u.value = [];
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
f.value = !0;
|
|
79
|
-
try {
|
|
80
|
-
u.value = await Y(l, a);
|
|
81
|
-
} catch (r) {
|
|
82
|
-
console.error("Failed to build debug input forms from schema:", r), u.value = [];
|
|
83
|
-
} finally {
|
|
84
|
-
f.value = !1;
|
|
85
|
-
}
|
|
86
|
-
}, I = (a) => {
|
|
87
|
-
s.value = { ...s.value, ...p(a) };
|
|
88
|
-
}, L = async () => {
|
|
89
|
-
const [a, n] = await Promise.all([
|
|
90
|
-
Promise.resolve(
|
|
91
|
-
typeof b.value?.validate == "function" ? b.value.validate() : !0
|
|
92
|
-
),
|
|
93
|
-
Promise.resolve(typeof v.value?.validate == "function" ? v.value.validate() : !0)
|
|
94
|
-
]);
|
|
95
|
-
!a || !n || t("confirm", p(s.value));
|
|
96
|
-
}, w = () => {
|
|
97
|
-
t("close"), t("update:show", !1);
|
|
98
|
-
};
|
|
99
|
-
return (a, n) => {
|
|
100
|
-
const r = C("bk-button"), q = C("bk-sideslider"), N = O("bkloading");
|
|
101
|
-
return c(), d(q, {
|
|
102
|
-
title: "调试参数",
|
|
103
|
-
"is-show": o.show,
|
|
104
|
-
width: 700,
|
|
105
|
-
"quick-close": !0,
|
|
106
|
-
"esc-close": !1,
|
|
107
|
-
onClosed: w
|
|
108
|
-
}, {
|
|
109
|
-
footer: m(() => [
|
|
110
|
-
F("div", te, [
|
|
111
|
-
x(r, {
|
|
112
|
-
theme: "primary",
|
|
113
|
-
"data-test": "save-and-run",
|
|
114
|
-
loading: o.pending,
|
|
115
|
-
onClick: L
|
|
116
|
-
}, {
|
|
117
|
-
default: m(() => [...n[1] || (n[1] = [
|
|
118
|
-
B(" 保存并执行 ", -1)
|
|
119
|
-
])]),
|
|
120
|
-
_: 1
|
|
121
|
-
}, 8, ["loading"]),
|
|
122
|
-
x(r, {
|
|
123
|
-
disabled: o.pending,
|
|
124
|
-
onClick: w
|
|
125
|
-
}, {
|
|
126
|
-
default: m(() => [...n[2] || (n[2] = [
|
|
127
|
-
B("取消", -1)
|
|
128
|
-
])]),
|
|
129
|
-
_: 1
|
|
130
|
-
}, 8, ["disabled"])
|
|
131
|
-
])
|
|
132
|
-
]),
|
|
133
|
-
default: m(() => [
|
|
134
|
-
P((c(), U("div", Z, [
|
|
135
|
-
F("div", ee, [
|
|
136
|
-
y.value.length > 0 ? (c(), d(K(z), {
|
|
137
|
-
key: 0,
|
|
138
|
-
ref_key: "builtinVariableFormRef",
|
|
139
|
-
ref: b,
|
|
140
|
-
modelValue: s.value,
|
|
141
|
-
"onUpdate:modelValue": n[0] || (n[0] = (T) => s.value = T),
|
|
142
|
-
variables: y.value,
|
|
143
|
-
editable: !0
|
|
144
|
-
}, null, 8, ["modelValue", "variables"])) : g("", !0),
|
|
145
|
-
u.value.length > 0 ? (c(), d(J, {
|
|
146
|
-
key: 1,
|
|
147
|
-
ref_key: "renderFormRef",
|
|
148
|
-
ref: v,
|
|
149
|
-
scheme: u.value,
|
|
150
|
-
editable: !0,
|
|
151
|
-
"form-option": {
|
|
152
|
-
showRequired: !0,
|
|
153
|
-
showGroup: !0,
|
|
154
|
-
showLabel: !1,
|
|
155
|
-
showHook: !1,
|
|
156
|
-
showDesc: !0,
|
|
157
|
-
formEdit: !0
|
|
158
|
-
},
|
|
159
|
-
"form-data": s.value,
|
|
160
|
-
onChange: I
|
|
161
|
-
}, null, 8, ["scheme", "form-data"])) : g("", !0),
|
|
162
|
-
R.value ? g("", !0) : (c(), d(M, {
|
|
163
|
-
key: 2,
|
|
164
|
-
title: "暂无参数"
|
|
165
|
-
}))
|
|
166
|
-
])
|
|
167
|
-
])), [
|
|
168
|
-
[N, { loading: f.value }]
|
|
169
|
-
])
|
|
170
|
-
]),
|
|
171
|
-
_: 1
|
|
172
|
-
}, 8, ["is-show"]);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}), ue = /* @__PURE__ */ Q(oe, [["__scopeId", "data-v-87de561f"]]);
|
|
176
|
-
export {
|
|
177
|
-
ue as default
|
|
178
|
-
};
|