@blueking/bkflow-canvas-editor 1.2.0-beta.5 → 1.2.0-beta.6
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 +96 -4
- package/dist/advanced.cjs.js +1 -1
- package/dist/advanced.d.ts +303 -28
- package/dist/advanced.esm.js +5 -2
- package/dist/context-CRk9vKJC.js +1621 -0
- package/dist/context-DhrPIIhQ.cjs +6 -0
- package/dist/index-6rNDFrb4.cjs +1 -0
- package/dist/index-8pQzq3Ur.js +73 -0
- package/dist/index-AG8VS7s1.js +63948 -0
- package/dist/index-B23-CKGW.js +137 -0
- package/dist/index-Bfi8TnAs.cjs +1 -0
- package/dist/index-BixpBxnO.cjs +1 -0
- package/dist/index-Bqf2hF4V.js +236 -0
- package/dist/index-BxgXAWVo.cjs +2 -0
- package/dist/index-C9br9kc6.js +127 -0
- package/dist/index-CKRWpad1.cjs +1 -0
- package/dist/index-CM38Ngjr.cjs +101 -0
- package/dist/index-CwRfChg0.cjs +1 -0
- package/dist/index-RHH-xjOH.js +647 -0
- package/dist/index-kieIlAaW.js +168 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +403 -27
- package/dist/index.esm.js +38 -28
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/context-Bj442dps.cjs +0 -1
- package/dist/context-CdSU0w5S.js +0 -633
- package/dist/index-C1XiYW6i.cjs +0 -93
- package/dist/index-ClFOndkK.js +0 -162
- package/dist/index-CoM_iLar.cjs +0 -1
- package/dist/index-D9tWoY5i.js +0 -514
- package/dist/index-DV2Z3oiJ.js +0 -58627
- package/dist/index-DwS9cgRG.cjs +0 -1
- package/dist/index-Dzam0n1k.js +0 -234
- package/dist/index-g6e2NJbw.cjs +0 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { defineComponent as A, ref as v, shallowRef as L, computed as C, watch as P, resolveComponent as _, resolveDirective as W, openBlock as r, createBlock as y, withCtx as u, withDirectives as G, createElementBlock as h, Fragment as H, renderList as K, createVNode as w, createCommentVNode as x, createElementVNode as F, createTextVNode as M, toDisplayString as b, unref as O } from "vue";
|
|
2
|
+
import "./context-CRk9vKJC.js";
|
|
3
|
+
import { InfoBox as Q } from "bkui-vue/lib";
|
|
4
|
+
import X from "bkui-vue/lib/message";
|
|
5
|
+
import { u as Y, c as Z, M as $, p as ee, m as te, h as oe, r as B, f as se, a as ae, _ as ne } from "./index-AG8VS7s1.js";
|
|
6
|
+
import { t as s } from "@blueking/flow-canvas";
|
|
7
|
+
const le = { class: "mock-data-sideslider__title" }, re = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "mock-data-sideslider__title-sep"
|
|
10
|
+
}, ce = ["title"], ie = { class: "mock-data-sideslider" }, ue = { class: "mock-data-sideslider__footer" }, de = /* @__PURE__ */ A({
|
|
11
|
+
__name: "index",
|
|
12
|
+
props: {
|
|
13
|
+
show: { type: Boolean },
|
|
14
|
+
node: { default: null },
|
|
15
|
+
outputs: { default: () => ({}) },
|
|
16
|
+
pending: { type: Boolean, default: !1 }
|
|
17
|
+
},
|
|
18
|
+
emits: ["confirm", "close", "update:show"],
|
|
19
|
+
setup(D, { emit: j }) {
|
|
20
|
+
const t = D, k = j, E = Y(), f = v(!1), d = L([]), m = v({}), g = v({}), p = v(!1), T = C(
|
|
21
|
+
() => p.value ? s("当前节点的输出不支持mock,是否需要在调试时跳过当前节点?") : s("暂无输出结果")
|
|
22
|
+
), N = C(
|
|
23
|
+
() => p.value ? s("跳过调试") : s("确定")
|
|
24
|
+
), R = async () => {
|
|
25
|
+
if (t.node) {
|
|
26
|
+
f.value = !0, g.value = {}, p.value = !1;
|
|
27
|
+
try {
|
|
28
|
+
const e = await ee(E, t.node.component);
|
|
29
|
+
d.value = te(e.outputs ?? []), p.value = oe(e.outputs);
|
|
30
|
+
const l = t.outputs ?? {}, a = {};
|
|
31
|
+
d.value.forEach((o) => {
|
|
32
|
+
const c = Object.prototype.hasOwnProperty.call(l, o.key) ? l[o.key] : o.type === "object" ? {} : void 0, n = B(o);
|
|
33
|
+
a[o.key] = n === "json-editor" || n === "data-table" ? se(c) : c;
|
|
34
|
+
}), m.value = a;
|
|
35
|
+
} catch (e) {
|
|
36
|
+
console.error(e), d.value = [], m.value = {}, p.value = !1, X({ theme: "error", message: s("加载输出结果失败") });
|
|
37
|
+
} finally {
|
|
38
|
+
f.value = !1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}, q = () => {
|
|
42
|
+
const e = {}, l = {};
|
|
43
|
+
return d.value.forEach((a) => {
|
|
44
|
+
const o = m.value[a.key], c = B(a);
|
|
45
|
+
if (c === "json-editor" || c === "data-table") {
|
|
46
|
+
const n = ae(o);
|
|
47
|
+
if (!n.valid) {
|
|
48
|
+
e[a.key] = n.message;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
n.value !== void 0 && (l[a.key] = n.value);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
o !== void 0 && o !== "" && (l[a.key] = o);
|
|
55
|
+
}), { errors: e, outputs: l };
|
|
56
|
+
}, I = (e) => {
|
|
57
|
+
Q({
|
|
58
|
+
title: s("确认 Mock 输出?"),
|
|
59
|
+
content: s("Mock 输出将覆盖当前输出结果,执行时跳过该节点并以 Mock 值替代实际输出"),
|
|
60
|
+
confirmText: s("确定"),
|
|
61
|
+
cancelText: s("取消"),
|
|
62
|
+
width: 400,
|
|
63
|
+
onConfirm: () => {
|
|
64
|
+
e();
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}, J = () => {
|
|
68
|
+
if (p.value) {
|
|
69
|
+
k("confirm", { outputs: {} });
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const { errors: e, outputs: l } = q();
|
|
73
|
+
g.value = e, !(Object.keys(e).length > 0) && I(() => k("confirm", { outputs: l }));
|
|
74
|
+
}, V = () => {
|
|
75
|
+
k("close"), k("update:show", !1);
|
|
76
|
+
};
|
|
77
|
+
return P(
|
|
78
|
+
() => [t.show, t.node?.id],
|
|
79
|
+
([e]) => {
|
|
80
|
+
e && t.node && (m.value = Z(t.outputs ?? {}), R());
|
|
81
|
+
},
|
|
82
|
+
{ immediate: !0 }
|
|
83
|
+
), (e, l) => {
|
|
84
|
+
const a = _("bk-form-item"), o = _("bk-form"), c = _("bk-exception"), n = _("bk-button"), S = _("bk-sideslider"), U = W("bkloading");
|
|
85
|
+
return r(), y(S, {
|
|
86
|
+
"is-show": t.show,
|
|
87
|
+
width: 960,
|
|
88
|
+
"quick-close": "",
|
|
89
|
+
"esc-close": !1,
|
|
90
|
+
onClosed: V
|
|
91
|
+
}, {
|
|
92
|
+
header: u(() => [
|
|
93
|
+
F("span", le, b(O(s)("Mock输出")), 1),
|
|
94
|
+
t.node?.name ? (r(), h("span", re, "-")) : x("", !0),
|
|
95
|
+
t.node?.name ? (r(), h("span", {
|
|
96
|
+
key: 1,
|
|
97
|
+
class: "mock-data-sideslider__title-node",
|
|
98
|
+
title: t.node.name
|
|
99
|
+
}, b(t.node.name), 9, ce)) : x("", !0)
|
|
100
|
+
]),
|
|
101
|
+
footer: u(() => [
|
|
102
|
+
F("div", ue, [
|
|
103
|
+
w(n, {
|
|
104
|
+
theme: "primary",
|
|
105
|
+
"data-test": "mock-confirm",
|
|
106
|
+
loading: t.pending,
|
|
107
|
+
onClick: J
|
|
108
|
+
}, {
|
|
109
|
+
default: u(() => [
|
|
110
|
+
M(b(N.value), 1)
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["loading"]),
|
|
114
|
+
w(n, {
|
|
115
|
+
disabled: t.pending,
|
|
116
|
+
onClick: V
|
|
117
|
+
}, {
|
|
118
|
+
default: u(() => [
|
|
119
|
+
M(b(O(s)("取消")), 1)
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["disabled"])
|
|
123
|
+
])
|
|
124
|
+
]),
|
|
125
|
+
default: u(() => [
|
|
126
|
+
G((r(), h("div", ie, [
|
|
127
|
+
d.value.length > 0 ? (r(), y(o, {
|
|
128
|
+
key: 0,
|
|
129
|
+
"form-type": "vertical",
|
|
130
|
+
"label-width": 120,
|
|
131
|
+
"data-test": "mock-outputs-form"
|
|
132
|
+
}, {
|
|
133
|
+
default: u(() => [
|
|
134
|
+
(r(!0), h(H, null, K(d.value, (i) => (r(), y(a, {
|
|
135
|
+
key: i.key,
|
|
136
|
+
label: i.name || i.key
|
|
137
|
+
}, {
|
|
138
|
+
default: u(() => [
|
|
139
|
+
w($, {
|
|
140
|
+
modelValue: m.value[i.key],
|
|
141
|
+
"onUpdate:modelValue": (z) => m.value[i.key] = z,
|
|
142
|
+
field: i,
|
|
143
|
+
error: g.value[i.key]
|
|
144
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "field", "error"])
|
|
145
|
+
]),
|
|
146
|
+
_: 2
|
|
147
|
+
}, 1032, ["label"]))), 128))
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
})) : f.value ? x("", !0) : (r(), y(c, {
|
|
151
|
+
key: 1,
|
|
152
|
+
class: "mock-data-sideslider__exception",
|
|
153
|
+
scene: "part",
|
|
154
|
+
type: "empty",
|
|
155
|
+
title: T.value
|
|
156
|
+
}, null, 8, ["title"]))
|
|
157
|
+
])), [
|
|
158
|
+
[U, { loading: f.value }]
|
|
159
|
+
])
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["is-show"]);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}), ye = /* @__PURE__ */ ne(de, [["__scopeId", "data-v-402876f9"]]);
|
|
166
|
+
export {
|
|
167
|
+
ye as default
|
|
168
|
+
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CM38Ngjr.cjs"),i=require("./context-DhrPIIhQ.cjs"),o=require("@blueking/flow-canvas");exports.BkFlowCanvas=e.BkFlowCanvas;exports.BkFlowModelAccessor=e.BkFlowModelAccessor;exports.BkFlowNodeAccessor=e.BkFlowNodeAccessor;exports.FlowCreateTask=e.FlowCreateTask;exports.FlowDebug=e.FlowDebug;exports.FlowDetail=e.index;exports.FlowEdit=e.edit;exports.FlowExecute=e.execute;exports.FlowMockDebug=e.mock;exports.FlowView=e.view;exports.applyBkuiLocale=e.applyBkuiLocale;exports.applyBkuiLocaleToTree=e.applyBkuiLocaleToTree;exports.bkflowConnectionValidator=e.bkflowConnectionValidator;exports.createBkflowPlugin=e.createBkflowPlugin;exports.createBkflowSchema=e.createBkflowSchema;exports.createExecutionStatusPlugin=e.createExecutionStatusPlugin;exports.default=e.index$1;exports.exportToPipelineTree=e.exportToPipelineTree;exports.getUniformApiPluginFormValue=e.getUniformApiPluginFormValue;exports.getVariableDefaultConfig=e.getVariableDefaultConfig;exports.importFromPipelineTree=e.importFromPipelineTree;exports.isMockableNode=e.isMockableNode;exports.mergeOutputs=e.mergeOutputs;exports.normalizePluginOutputItems=e.normalizePluginOutputItems;exports.provideFilterVariableConfig=e.provideFilterVariableConfig;exports.provideFlowApiConfig=e.provideFlowApiConfig;exports.provideMemberSelectorConfig=e.provideMemberSelectorConfig;exports.provideSelectPanelConfig=e.provideSelectPanelConfig;exports.provideSelectRelatedOptionConfig=e.provideSelectRelatedOptionConfig;exports.resolveBkuiLocale=e.resolveBkuiLocale;exports.resolveExecutionActions=e.resolveExecutionActions;exports.resolveMockFormControl=e.resolveMockFormControl;exports.useFlowApiConfig=e.useFlowApiConfig;exports.useFlowEditApiConfig=e.useFlowEditApiConfig;exports.useFlowViewApiConfig=e.useFlowViewApiConfig;exports.useMemberSelectorConfig=e.useMemberSelectorConfig;exports.useSelectPanelConfig=e.useSelectPanelConfig;exports.validatePipelineTree=e.validatePipelineTree;exports.generateId=i.generateId;exports.random4=i.random4;Object.defineProperty(exports,"getLocale",{enumerable:!0,get:()=>o.getLocale});Object.defineProperty(exports,"registerMessages",{enumerable:!0,get:()=>o.registerMessages});Object.defineProperty(exports,"setLocale",{enumerable:!0,get:()=>o.setLocale});Object.defineProperty(exports,"setTranslator",{enumerable:!0,get:()=>o.setTranslator});Object.defineProperty(exports,"t",{enumerable:!0,get:()=>o.t});
|