@blueking/bkflow-canvas-editor 1.1.0-beta.41 → 1.1.0-beta.43
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 +0 -40
- package/dist/advanced.cjs.js +1 -1
- package/dist/advanced.esm.js +1 -1
- package/dist/context-Bg6nsbrK.js +688 -0
- package/dist/context-iqnF_HqS.cjs +1 -0
- package/dist/index-B0DQFaEe.cjs +82 -0
- package/dist/index-BBNwbryo.cjs +1 -0
- package/dist/index-BSJC2Tb-.js +512 -0
- package/dist/{index-B1ybORjU.js → index-Bqm08e7H.js} +28707 -28167
- package/dist/index-BycpBKMO.cjs +1 -0
- package/dist/index-Ckij2Mxn.cjs +1 -0
- package/dist/index-D7t1wcMU.js +234 -0
- package/dist/index-DgQ-ScE5.js +162 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -26
- package/dist/index.es.min-BpHMrg2Y.cjs +2 -0
- package/dist/index.es.min-DYp0DL9J.js +3543 -0
- package/dist/index.esm.js +34 -43
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/bkflow-canvas-editor_false-B70uLuHL.cjs +0 -1
- package/dist/bkflow-canvas-editor_false-BlC281Zg.cjs +0 -1
- package/dist/bkflow-canvas-editor_false-Casww7p4.js +0 -5
- package/dist/bkflow-canvas-editor_false-i9G8sqQi.js +0 -5
- package/dist/context-C3QIuIf6.cjs +0 -5
- package/dist/context-De9a4Qek.js +0 -1507
- package/dist/index-9BCO-loN.js +0 -533
- package/dist/index-A1xVRjtJ.cjs +0 -1
- package/dist/index-BwF4LXst.cjs +0 -1
- package/dist/index-CjCy-0c0.js +0 -236
- package/dist/index-RacKW0MR.js +0 -168
- package/dist/index-bzXGuf5c.cjs +0 -1
- package/dist/index-iB9uV7YQ.cjs +0 -85
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-B0DQFaEe.cjs"),L={class:"debug-result-node-list"},D=["data-node-id","aria-selected","onClick","onKeydown"],z=["title"],A={key:0,class:"debug-result-node-list__mock","data-test":"node-mock-flag"},P={key:1,class:"debug-result-node-list__empty"},I=e.defineComponent({__name:"node-list",props:{nodes:{},modelValue:{default:""}},emits:["update:modelValue"],setup(c,{emit:g}){const t=c,s=g,r=e.ref(""),m=e.ref("all"),_=e.ref(null),p={not_run:"未执行",finished:"成功",failed:"失败",running:"正在调试",suspended:"挂起",skipped:"跳过",revoked:"终止"},k=[{value:"all",label:"全部"},{value:"finished",icon:"bkflow-canvas-dark-circle-checkbox",iconColor:"#5fb8ac",tooltip:p.finished},{value:"failed",icon:"bkflow-canvas-dark-circle-close",iconColor:"#fa4e41",tooltip:p.failed},{value:"revoked",icon:"bkflow-canvas-stop-fill",iconColor:"#fa4e41",tooltip:p.revoked},{value:"running",iconComponent:d.LoadingStatusIcon,iconColor:"#3a84ff",tooltip:p.running},{value:"not_run",icon:"bkflow-canvas-weizhixing2",iconColor:"#b8bbc4",tooltip:p.not_run},{value:"suspended",icon:"bkflow-canvas-zanting",iconColor:"#f59500",tooltip:p.suspended},{value:"skipped",icon:"bkflow-canvas-tiaoguo2",iconColor:"#6e89af",tooltip:p.skipped}],w=e.computed(()=>k.map(a=>({...a,count:a.value==="all"?t.nodes.length:t.nodes.filter(n=>n.status===a.value).length}))),V=e.computed(()=>{const a=r.value.trim().toLowerCase();return t.nodes.filter(n=>m.value!=="all"&&n.status!==m.value?!1:a?n.name.toLowerCase().includes(a)||n.type.toLowerCase().includes(a)||(n.typeName??"").toLowerCase().includes(a):!0)}),C=e.computed(()=>r.value.trim()?"搜索结果为空":m.value!=="all"?`暂无${p[m.value]}状态节点`:"暂无节点"),x=()=>{r.value="",m.value="all"},y=a=>{const n=_.value,v=n?.querySelector(`[data-node-id="${CSS.escape(a)}"]`);if(!n||!v)return;const o=n.getBoundingClientRect(),b=v.getBoundingClientRect();b.top<o.top?n.scrollTop-=o.top-b.top:b.bottom>o.bottom&&(n.scrollTop+=b.bottom-o.bottom)};return e.watch(()=>t.modelValue,async a=>{if(!a)return;!V.value.some(v=>v.id===a)&&t.nodes.some(v=>v.id===a)&&(r.value="",m.value="all"),await e.nextTick(),y(a)},{flush:"post"}),(a,n)=>{const v=e.resolveComponent("bk-input");return e.openBlock(),e.createElementBlock("aside",L,[e.createVNode(v,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=o=>r.value=o),class:"debug-result-node-list__search",placeholder:"搜索节点名称 / 类型",type:"search",clearable:"","data-test":"node-search"},null,8,["modelValue"]),e.createVNode(d.SegmentTabs,{modelValue:m.value,"onUpdate:modelValue":n[1]||(n[1]=o=>m.value=o),class:"debug-result-node-list__filters","data-test":"status-filters",items:w.value},null,8,["modelValue","items"]),V.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"itemsRef",ref:_,class:"debug-result-node-list__items",role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,class:e.normalizeClass(["debug-result-node-list__item",`is-${o.status}`,{"is-active":o.id===t.modelValue,"is-unconfigured":!o.isConfigured}]),role:"option","data-test":"node-item","data-node-id":o.id,"aria-selected":o.id===t.modelValue,tabindex:"0",onClick:b=>s("update:modelValue",o.id),onKeydown:e.withKeys(e.withModifiers(b=>s("update:modelValue",o.id),["prevent"]),["enter","space"])},[e.createElementVNode("span",{class:e.normalizeClass(["debug-result-node-list__status",`is-${o.status}`,{"is-placeholder":!o.isConfigured}])},[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(o.icon),"data-test":"node-icon"},null,2)):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:"debug-result-node-list__name",title:o.isConfigured?`${o.name} ${o.typeName||o.type}`:o.name},e.toDisplayString(o.name),9,z),o.isMock?(e.openBlock(),e.createElementBlock("span",A,"MOCK")):e.createCommentVNode("",!0)],42,D))),128))],512)):(e.openBlock(),e.createElementBlock("div",P,[e.createVNode(d.EmptyException,{"is-search":!1,title:C.value,onClear:x},null,8,["title"])]))])}}}),H=d._export_sfc(I,[["__scopeId","data-v-db0cb31c"]]);function U(c){if(c==null)return"";if(typeof c=="string")return c;if(typeof c=="object"){const g=c,t=g.message;if(typeof t=="string"&&t){const s=g.type;return typeof s=="string"&&s?`${s}: ${t}`:t}try{return JSON.stringify(c)}catch{return String(c)}}return String(c)}const O={class:"debug-result-tabs"},F={class:"debug-result-tabs__failed-actions","data-test":"output-error-actions"},G={class:"debug-result-tabs__execution","data-test":"tab-execution"},K={class:"debug-result-tabs__row"},j={class:"value"},q={class:"debug-result-tabs__row"},Y={class:"value"},J={key:0,class:"debug-result-tabs__row is-error"},Q={class:"value"},W={class:"debug-result-tabs__mock-hint","data-test":"mock-banner"},X={class:"debug-result-tabs__logs","data-test":"tab-logs"},Z=e.defineComponent({__name:"result-tabs",props:{result:{},component:{},isMock:{type:Boolean,default:!1},canRunNodeDebug:{type:Boolean,default:!1}},emits:["reEditMock","runReal","runMock","logsTabActive"],setup(c,{emit:g}){const t=c,s=g,r=e.ref("execution");e.watch(r,f=>s("logsTabActive",f==="logs"),{immediate:!0});const m={not_run:"未调试",running:"正在调试",finished:"成功",failed:"失败",suspended:"挂起",skipped:"跳过",revoked:"已终止"},_=e.computed(()=>m[t.result.execution.status]??t.result.execution.status),p=e.computed(()=>d.formatSummaryDuration(t.result.execution.durationMs)),k=e.computed(()=>U(t.result.error||t.result.execution.errorDetail)),w=e.computed(()=>t.result.execution.status==="revoked"),V=e.computed(()=>d.isDebugAbnormalStatus(t.result.execution.status)),C=e.computed(()=>w.value?"该节点调试已终止,可":"该节点执行失败,可"),{loading:x,error:y,visibleInputs:a,visibleOutputs:n,outputNameMap:v}=d.usePluginParamMeta({component:()=>t.component}),o=e.computed(()=>t.result.loading||x.value),b=e.computed(()=>t.result.detailError||y.value),h=e.computed(()=>a.value.filter(({key:f})=>Object.prototype.hasOwnProperty.call(t.result.inputs,f)).map(({key:f,name:l})=>({key:f,name:l,value:t.result.inputs[f]}))),B=e.computed(()=>d.orderDebugRowsByDeclaredKeys(d.toDebugOutputValueRows(t.result.outputs,v.value),n.value.map(f=>f.key))),R=e.computed(()=>d.shouldShowMockReEditHint(t.isMock,n.value)),T=e.computed(()=>t.result.logs==null?"":d.normalizeLogText(t.result.logs));return(f,l)=>{const i=e.resolveComponent("bk-button"),u=e.resolveComponent("bk-tab-panel"),S=e.resolveComponent("bk-tab");return e.openBlock(),e.createElementBlock("div",O,[e.createVNode(S,{active:r.value,"onUpdate:active":l[3]||(l[3]=E=>r.value=E),type:"card-grid"},e.createSlots({default:e.withCtx(()=>[e.createVNode(u,{name:"execution",label:"执行信息"},{default:e.withCtx(()=>[e.createElementVNode("div",G,[e.createElementVNode("div",K,[l[8]||(l[8]=e.createElementVNode("span",{class:"label"},"执行状态",-1)),e.createElementVNode("span",j,e.toDisplayString(_.value),1)]),e.createElementVNode("div",q,[l[9]||(l[9]=e.createElementVNode("span",{class:"label"},"调试用时",-1)),e.createElementVNode("span",Y,e.toDisplayString(p.value),1)]),k.value?(e.openBlock(),e.createElementBlock("div",J,[l[10]||(l[10]=e.createElementVNode("span",{class:"label"},"错误信息",-1)),e.createElementVNode("span",Q,e.toDisplayString(k.value),1)])):e.createCommentVNode("",!0)])]),_:1}),e.createVNode(u,{name:"inputs",label:"输入参数"},{default:e.withCtx(()=>[e.createVNode(d.DebugValueTable,{rows:h.value,loading:o.value,error:b.value,"empty-text":"暂无输入参数"},null,8,["rows","loading","error"])]),_:1}),e.createVNode(u,{name:"outputs",label:"输出结果"},{default:e.withCtx(()=>[e.createVNode(d.DebugValueTable,{rows:B.value,loading:o.value,error:b.value,"empty-text":"暂无输出结果"},e.createSlots({_:2},[R.value?{name:"toolbar",fn:e.withCtx(()=>[e.createElementVNode("div",W,[l[12]||(l[12]=e.createElementVNode("i",{class:"bkflow-canvas-icon bkflow-canvas-info debug-result-tabs__mock-info","aria-hidden":"true"},null,-1)),l[13]||(l[13]=e.createElementVNode("span",null,"当前为 Mock 数据",-1)),e.createVNode(i,{text:"",theme:"primary",size:"small","data-test":"re-edit-mock",onClick:l[2]||(l[2]=E=>s("reEditMock"))},{default:e.withCtx(()=>[...l[11]||(l[11]=[e.createTextVNode(" 重新编辑 ",-1)])]),_:1})])]),key:"0"}:void 0]),1032,["rows","loading","error"])]),_:1}),e.createVNode(u,{name:"logs",label:"调用日志"},{default:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(d.CallLogsViewer,{"log-text":T.value,loading:t.result.logLoading,error:t.result.logError},null,8,["log-text","loading","error"])])]),_:1})]),_:2},[V.value&&t.canRunNodeDebug?{name:"setting",fn:e.withCtx(()=>[e.createElementVNode("div",F,[l[6]||(l[6]=e.createElementVNode("i",{class:"bkflow-canvas-icon bkflow-canvas-alert"},null,-1)),e.createElementVNode("span",null,e.toDisplayString(C.value),1),e.createVNode(i,{text:"",theme:"primary","data-test":"rerun-real",onClick:l[0]||(l[0]=E=>s("runReal"))},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("重新调试",-1)])]),_:1}),l[7]||(l[7]=e.createElementVNode("span",null,"或直接",-1)),e.createVNode(i,{text:"",theme:"primary","data-test":"run-mock",onClick:l[1]||(l[1]=E=>s("runMock"))},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("Mock 输出",-1)])]),_:1})])]),key:"0"}:void 0]),1032,["active"])])}}}),ee=d._export_sfc(Z,[["__scopeId","data-v-2a925689"]]),te={class:"debug-result-drawer__header"},oe={class:"debug-result-drawer__header-left"},le={class:"debug-result-drawer__body"},se={class:"debug-result-drawer__content"},ne={class:"debug-result-drawer__result"},ae={key:1,class:"debug-result-drawer__unselected","data-test":"node-unselected"},N=44,$=420,ue=e.defineComponent({__name:"index",props:{open:{type:Boolean},context:{},pipelineTree:{},mockNodeIds:{},modelValue:{default:""},result:{},hasGlobalRun:{type:Boolean,default:!1},viewParamsPending:{type:Boolean,default:!1},offsetLeft:{default:0}},emits:["update:open","update:modelValue","reEditMock","runReal","runMock","viewParams","logsTabActive"],setup(c,{emit:g}){const t=c,s=g,r=e.ref($),m=e.ref(!1);let _=0,p=0,k="",w="";const V=e.computed(()=>({left:`${t.offsetLeft}px`,height:`${t.open?r.value:N}px`})),C=()=>{t.open||(r.value=$),s("update:open",!t.open)},x=i=>{const u=i>N;u!==t.open&&s("update:open",u)},y=i=>{const u=p-(i.clientY-_);r.value=Math.max(N,Math.min(window.innerHeight*.8,u)),x(r.value)},a=()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",a),document.body.style.cursor=k,document.body.style.userSelect=w,m.value=!1,r.value<=N&&(r.value=$,s("update:open",!1))},n=i=>{i.preventDefault(),m.value=!0,_=i.clientY,t.open?p=r.value:(s("update:open",!0),r.value=N,p=N),k=document.body.style.cursor,w=document.body.style.userSelect,document.body.style.cursor="ns-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",y),document.addEventListener("mouseup",a)};e.onBeforeUnmount(a);const v=e.computed({get:()=>t.modelValue,set:i=>s("update:modelValue",i)});e.watch(()=>t.modelValue,i=>{i||s("logsTabActive",!1)},{immediate:!0});const o=e.computed(()=>d.buildDebugResultNodeItems(t.pipelineTree,t.context?.nodes,t.mockNodeIds)),b=e.computed(()=>t.mockNodeIds.has(t.modelValue)),h=e.computed(()=>t.pipelineTree?.activities?.[t.modelValue]?.component),B=e.computed(()=>{const i=o.value.find(u=>u.id===t.modelValue);return i?.type==="ServiceActivity"&&i.isConfigured}),R=()=>{!t.hasGlobalRun||t.viewParamsPending||s("viewParams")},T=()=>{t.modelValue&&s("reEditMock",t.modelValue)},f=()=>{t.modelValue&&s("runReal",t.modelValue)},l=()=>{t.modelValue&&s("runMock",t.modelValue)};return(i,u)=>{const S=e.resolveComponent("bk-button"),E=e.resolveDirective("bk-tooltips");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["debug-result-drawer-wrapper",{"is-resizing":m.value}]),style:e.normalizeStyle(V.value)},[e.createElementVNode("div",{class:"debug-result-drawer__resize",onMousedown:n},null,32),e.createElementVNode("section",{class:e.normalizeClass(["debug-result-drawer",{"is-collapsed":!t.open}])},[e.createElementVNode("header",te,[e.createElementVNode("div",oe,[u[3]||(u[3]=e.createElementVNode("span",{class:"debug-result-drawer__title"},"调试结果",-1)),u[4]||(u[4]=e.createElementVNode("span",{class:"debug-result-drawer__divider"},null,-1)),e.withDirectives((e.openBlock(),e.createBlock(S,{text:"",theme:"primary",disabled:!t.hasGlobalRun,loading:t.viewParamsPending,onClick:R},{default:e.withCtx(()=>[...u[2]||(u[2]=[e.createElementVNode("i",{class:"bkflow-canvas-icon bkflow-canvas-audit view-params-icon"},null,-1),e.createTextVNode(" 查看参数 ",-1)])]),_:1},8,["disabled","loading"])),[[E,{content:"请先进行调试",disabled:t.hasGlobalRun}]])]),e.createElementVNode("span",{class:"debug-result-drawer__collapse",onClick:C},[e.createElementVNode("span",null,e.toDisplayString(t.open?"收起":"展开"),1),e.createElementVNode("i",{class:e.normalizeClass(["bkflow-canvas-icon bkflow-canvas-arrows-down debug-result-drawer__collapse-icon",{"is-expanded":t.open}])},null,2)])]),e.createElementVNode("div",le,[e.createElementVNode("div",se,[e.createVNode(H,{modelValue:v.value,"onUpdate:modelValue":u[0]||(u[0]=M=>v.value=M),nodes:o.value},null,8,["modelValue","nodes"]),e.createElementVNode("div",ne,[t.modelValue?(e.openBlock(),e.createBlock(ee,{key:0,result:t.result,component:h.value,"is-mock":b.value,"can-run-node-debug":B.value,onReEditMock:T,onRunReal:f,onRunMock:l,onLogsTabActive:u[1]||(u[1]=M=>s("logsTabActive",M))},null,8,["result","component","is-mock","can-run-node-debug"])):(e.openBlock(),e.createElementBlock("div",ae," 请先选择节点查看调试详情 "))])])])],2)],6)}}}),re=d._export_sfc(ue,[["__scopeId","data-v-84a5277a"]]);exports.default=re;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-B0DQFaEe.cjs");require("bkui-vue/lib/message");require("bkui-vue/lib/icon");require("monaco-editor");const N={string:"input",text:"input",textarea:"textarea",int:"input",integer:"input",number:"input",float:"input",json:"json",object:"json",array:"array",list:"array",select:"select",time:"timepicker",datetime:"timepicker"},h=l=>l.replace(/^\$\{(.+)\}$/,"$1"),g=l=>`\${${h(l)}}`;function F(l,c){const a=g(l.key),n=c?s.cloneDeep(c):{},d=l.custom_type??n.custom_type??N[l.type]??"input";return{...n,key:a,name:l.name??n.name??h(l.key),custom_type:d,desc:n.desc??"",index:n.index??0,show_type:"show",source_info:n.source_info??{},source_tag:n.source_tag??"",source_type:n.source_type??"custom",validation:n.validation??"",value:l.default??n.value,meta:{...n.meta??{},required:l.required??n.meta?.required??!1}}}function D(l,c={}){if(!l)return{};const a=l.constants;return a&&Object.keys(a).length>0?{...a}:Array.isArray(l.fields)&&l.fields.length>0?l.fields.reduce((n,d)=>{const r=g(d.key);return n[r]=F(d,c[r]),n},{}):{}}const j={class:"global-debug-input"},q={key:0,class:"global-debug-input__params","data-test":"input-params"},R={key:0},L=["title"],O={class:"col-value"},T={key:1,class:"global-debug-input__value"},I={key:1,class:"form-params-wrapper"},P={class:"sideslider-footer-buttons"},$=e.defineComponent({__name:"index",props:{show:{type:Boolean},schema:{},pipelineConstants:{default:()=>({})},initialValues:{default:()=>({})},pending:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["confirm","close","update:show"],setup(l,{emit:c}){const a=l,n=c,d=s.useFlowApiConfig(),r=e.ref({}),p=e.shallowRef([]),m=e.shallowRef([]),f=e.shallowRef(!1),y=e.ref(),v=e.ref(),k=e.computed(()=>p.value.filter(t=>s.isBuiltinUsageVariable(t))),V=e.computed(()=>k.value.length>0||m.value.length>0),b=e.computed(()=>[...p.value].sort((t,o)=>(t.index??0)-(o.index??0)).map(t=>{const o=Object.prototype.hasOwnProperty.call(r.value,t.key)?r.value[t.key]:t.value;return{key:t.key,name:t.name||t.key,value:o,display:s.formatDebugValue(o),isComplex:s.isComplexDebugValue(o)}}));e.watch(()=>a.show,t=>{t&&(r.value=s.cloneDeep(a.initialValues??{}),w())});const w=async()=>{const t=D(a.schema,a.pipelineConstants),o=Object.values(t).filter(i=>typeof i=="object"&&i!==null&&i.show_type==="show");if(p.value=o,a.readonly||Object.keys(t).length<1){m.value=[];return}f.value=!0;try{m.value=await s.getInputFormsFromConstants(d,t)}catch(i){console.error("Failed to build debug input forms from schema:",i),m.value=[]}finally{f.value=!1}},B=t=>{r.value={...r.value,...s.cloneDeep(t)}},C=async()=>{const[t,o]=await Promise.all([Promise.resolve(typeof v.value?.validate=="function"?v.value.validate():!0),Promise.resolve(typeof y.value?.validate=="function"?y.value.validate():!0)]);!t||!o||n("confirm",s.cloneDeep(r.value))},_=()=>{n("close"),n("update:show",!1)};return(t,o)=>{const i=e.resolveComponent("bk-button"),x=e.resolveComponent("bk-sideslider"),E=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(x,{title:"调试参数","is-show":a.show,width:960,"quick-close":!0,"esc-close":!1,onClosed:_},e.createSlots({default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",j,[a.readonly?(e.openBlock(),e.createElementBlock("table",q,[o[2]||(o[2]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",{class:"col-name"},"参数名"),e.createElementVNode("th",{class:"col-value"},"参数值")])],-1)),e.createElementVNode("tbody",null,[b.value.length===0?(e.openBlock(),e.createElementBlock("tr",R,[...o[1]||(o[1]=[e.createElementVNode("td",{class:"global-debug-input__empty",colspan:"2"},"暂无参数",-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,u=>(e.openBlock(),e.createElementBlock("tr",{key:u.key,"data-test":"input-row"},[e.createElementVNode("td",{class:"col-name",title:u.key},e.toDisplayString(u.name),9,L),e.createElementVNode("td",O,[u.isComplex?(e.openBlock(),e.createBlock(s.DebugJsonViewer,{key:0,value:u.value,"data-test":"json-viewer"},null,8,["value"])):(e.openBlock(),e.createElementBlock("pre",T,e.toDisplayString(u.display),1))])]))),128))])])):(e.openBlock(),e.createElementBlock("div",I,[k.value.length>0?(e.openBlock(),e.createBlock(e.unref(s.BuiltinVariableUsageForm),{key:0,ref_key:"builtinVariableFormRef",ref:v,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=u=>r.value=u),variables:k.value},null,8,["modelValue","variables"])):e.createCommentVNode("",!0),m.value.length>0?(e.openBlock(),e.createBlock(s.RenderForm,{key:1,ref_key:"renderFormRef",ref:y,scheme:m.value,editable:"","form-option":{showRequired:!0,showGroup:!0,showLabel:!1,showHook:!1,showDesc:!0,formEdit:!0},"form-data":r.value,onChange:B},null,8,["scheme","form-data"])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s.EmptyException,{key:2,title:"暂无参数"}))]))])),[[E,{loading:f.value}]])]),_:2},[a.readonly?void 0:{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",P,[e.createVNode(i,{theme:"primary","data-test":"save-and-run",loading:a.pending,onClick:C},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode(" 保存并执行 ",-1)])]),_:1},8,["loading"]),e.createVNode(i,{disabled:a.pending,onClick:_},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled"])])]),key:"0"}]),1032,["is-show"])}}}),S=s._export_sfc($,[["__scopeId","data-v-01a33593"]]);exports.default=S;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { defineComponent as A, ref as V, shallowRef as x, computed as C, watch as U, resolveComponent as j, resolveDirective as K, openBlock as l, createBlock as f, createSlots as S, withCtx as y, withDirectives as G, createElementBlock as d, createElementVNode as i, createCommentVNode as v, Fragment as H, renderList as J, toDisplayString as B, unref as Y, createVNode as R, createTextVNode as E } from "vue";
|
|
2
|
+
import { c as _, u as z, i as M, b as Q, d as W, g as X, D as Z, B as ee, R as te, E as ae, _ as oe } from "./index-Bqm08e7H.js";
|
|
3
|
+
import "bkui-vue/lib/message";
|
|
4
|
+
import "bkui-vue/lib/icon";
|
|
5
|
+
import "monaco-editor";
|
|
6
|
+
const se = {
|
|
7
|
+
string: "input",
|
|
8
|
+
text: "input",
|
|
9
|
+
textarea: "textarea",
|
|
10
|
+
int: "input",
|
|
11
|
+
integer: "input",
|
|
12
|
+
number: "input",
|
|
13
|
+
float: "input",
|
|
14
|
+
json: "json",
|
|
15
|
+
object: "json",
|
|
16
|
+
array: "array",
|
|
17
|
+
list: "array",
|
|
18
|
+
select: "select",
|
|
19
|
+
time: "timepicker",
|
|
20
|
+
datetime: "timepicker"
|
|
21
|
+
}, L = (a) => a.replace(/^\$\{(.+)\}$/, "$1"), I = (a) => `\${${L(a)}}`;
|
|
22
|
+
function ne(a, c) {
|
|
23
|
+
const s = I(a.key), o = c ? _(c) : {}, p = a.custom_type ?? o.custom_type ?? se[a.type] ?? "input";
|
|
24
|
+
return {
|
|
25
|
+
...o,
|
|
26
|
+
key: s,
|
|
27
|
+
name: a.name ?? o.name ?? L(a.key),
|
|
28
|
+
custom_type: p,
|
|
29
|
+
desc: o.desc ?? "",
|
|
30
|
+
index: o.index ?? 0,
|
|
31
|
+
show_type: "show",
|
|
32
|
+
source_info: o.source_info ?? {},
|
|
33
|
+
source_tag: o.source_tag ?? "",
|
|
34
|
+
source_type: o.source_type ?? "custom",
|
|
35
|
+
validation: o.validation ?? "",
|
|
36
|
+
value: a.default ?? o.value,
|
|
37
|
+
meta: {
|
|
38
|
+
...o.meta ?? {},
|
|
39
|
+
required: a.required ?? o.meta?.required ?? !1
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function le(a, c = {}) {
|
|
44
|
+
if (!a) return {};
|
|
45
|
+
const s = a.constants;
|
|
46
|
+
return s && Object.keys(s).length > 0 ? { ...s } : Array.isArray(a.fields) && a.fields.length > 0 ? a.fields.reduce((o, p) => {
|
|
47
|
+
const n = I(p.key);
|
|
48
|
+
return o[n] = ne(p, c[n]), o;
|
|
49
|
+
}, {}) : {};
|
|
50
|
+
}
|
|
51
|
+
const ie = { class: "global-debug-input" }, re = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "global-debug-input__params",
|
|
54
|
+
"data-test": "input-params"
|
|
55
|
+
}, ue = { key: 0 }, de = ["title"], ce = { class: "col-value" }, pe = {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: "global-debug-input__value"
|
|
58
|
+
}, me = {
|
|
59
|
+
key: 1,
|
|
60
|
+
class: "form-params-wrapper"
|
|
61
|
+
}, fe = { class: "sideslider-footer-buttons" }, ye = /* @__PURE__ */ A({
|
|
62
|
+
__name: "index",
|
|
63
|
+
props: {
|
|
64
|
+
show: { type: Boolean },
|
|
65
|
+
schema: {},
|
|
66
|
+
pipelineConstants: { default: () => ({}) },
|
|
67
|
+
initialValues: { default: () => ({}) },
|
|
68
|
+
pending: { type: Boolean, default: !1 },
|
|
69
|
+
readonly: { type: Boolean, default: !1 }
|
|
70
|
+
},
|
|
71
|
+
emits: ["confirm", "close", "update:show"],
|
|
72
|
+
setup(a, { emit: c }) {
|
|
73
|
+
const s = a, o = c, p = z(), n = V({}), b = x([]), m = x([]), g = x(!1), h = V(), k = V(), w = C(() => b.value.filter((e) => M(e))), O = C(() => w.value.length > 0 || m.value.length > 0), F = C(
|
|
74
|
+
() => [...b.value].sort((e, t) => (e.index ?? 0) - (t.index ?? 0)).map((e) => {
|
|
75
|
+
const t = Object.prototype.hasOwnProperty.call(n.value, e.key) ? n.value[e.key] : e.value;
|
|
76
|
+
return {
|
|
77
|
+
key: e.key,
|
|
78
|
+
name: e.name || e.key,
|
|
79
|
+
value: t,
|
|
80
|
+
display: W(t),
|
|
81
|
+
isComplex: Q(t)
|
|
82
|
+
};
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
U(
|
|
86
|
+
() => s.show,
|
|
87
|
+
(e) => {
|
|
88
|
+
e && (n.value = _(s.initialValues ?? {}), q());
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
const q = async () => {
|
|
92
|
+
const e = le(s.schema, s.pipelineConstants), t = Object.values(e).filter(
|
|
93
|
+
(r) => typeof r == "object" && r !== null && r.show_type === "show"
|
|
94
|
+
);
|
|
95
|
+
if (b.value = t, s.readonly || Object.keys(e).length < 1) {
|
|
96
|
+
m.value = [];
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
g.value = !0;
|
|
100
|
+
try {
|
|
101
|
+
m.value = await X(p, e);
|
|
102
|
+
} catch (r) {
|
|
103
|
+
console.error("Failed to build debug input forms from schema:", r), m.value = [];
|
|
104
|
+
} finally {
|
|
105
|
+
g.value = !1;
|
|
106
|
+
}
|
|
107
|
+
}, N = (e) => {
|
|
108
|
+
n.value = { ...n.value, ..._(e) };
|
|
109
|
+
}, P = async () => {
|
|
110
|
+
const [e, t] = await Promise.all([
|
|
111
|
+
Promise.resolve(
|
|
112
|
+
typeof k.value?.validate == "function" ? k.value.validate() : !0
|
|
113
|
+
),
|
|
114
|
+
Promise.resolve(typeof h.value?.validate == "function" ? h.value.validate() : !0)
|
|
115
|
+
]);
|
|
116
|
+
!e || !t || o("confirm", _(n.value));
|
|
117
|
+
}, D = () => {
|
|
118
|
+
o("close"), o("update:show", !1);
|
|
119
|
+
};
|
|
120
|
+
return (e, t) => {
|
|
121
|
+
const r = j("bk-button"), T = j("bk-sideslider"), $ = K("bkloading");
|
|
122
|
+
return l(), f(T, {
|
|
123
|
+
title: "调试参数",
|
|
124
|
+
"is-show": s.show,
|
|
125
|
+
width: 960,
|
|
126
|
+
"quick-close": !0,
|
|
127
|
+
"esc-close": !1,
|
|
128
|
+
onClosed: D
|
|
129
|
+
}, S({
|
|
130
|
+
default: y(() => [
|
|
131
|
+
G((l(), d("div", ie, [
|
|
132
|
+
s.readonly ? (l(), d("table", re, [
|
|
133
|
+
t[2] || (t[2] = i("thead", null, [
|
|
134
|
+
i("tr", null, [
|
|
135
|
+
i("th", { class: "col-name" }, "参数名"),
|
|
136
|
+
i("th", { class: "col-value" }, "参数值")
|
|
137
|
+
])
|
|
138
|
+
], -1)),
|
|
139
|
+
i("tbody", null, [
|
|
140
|
+
F.value.length === 0 ? (l(), d("tr", ue, [...t[1] || (t[1] = [
|
|
141
|
+
i("td", {
|
|
142
|
+
class: "global-debug-input__empty",
|
|
143
|
+
colspan: "2"
|
|
144
|
+
}, "暂无参数", -1)
|
|
145
|
+
])])) : v("", !0),
|
|
146
|
+
(l(!0), d(H, null, J(F.value, (u) => (l(), d("tr", {
|
|
147
|
+
key: u.key,
|
|
148
|
+
"data-test": "input-row"
|
|
149
|
+
}, [
|
|
150
|
+
i("td", {
|
|
151
|
+
class: "col-name",
|
|
152
|
+
title: u.key
|
|
153
|
+
}, B(u.name), 9, de),
|
|
154
|
+
i("td", ce, [
|
|
155
|
+
u.isComplex ? (l(), f(Z, {
|
|
156
|
+
key: 0,
|
|
157
|
+
value: u.value,
|
|
158
|
+
"data-test": "json-viewer"
|
|
159
|
+
}, null, 8, ["value"])) : (l(), d("pre", pe, B(u.display), 1))
|
|
160
|
+
])
|
|
161
|
+
]))), 128))
|
|
162
|
+
])
|
|
163
|
+
])) : (l(), d("div", me, [
|
|
164
|
+
w.value.length > 0 ? (l(), f(Y(ee), {
|
|
165
|
+
key: 0,
|
|
166
|
+
ref_key: "builtinVariableFormRef",
|
|
167
|
+
ref: k,
|
|
168
|
+
modelValue: n.value,
|
|
169
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => n.value = u),
|
|
170
|
+
variables: w.value
|
|
171
|
+
}, null, 8, ["modelValue", "variables"])) : v("", !0),
|
|
172
|
+
m.value.length > 0 ? (l(), f(te, {
|
|
173
|
+
key: 1,
|
|
174
|
+
ref_key: "renderFormRef",
|
|
175
|
+
ref: h,
|
|
176
|
+
scheme: m.value,
|
|
177
|
+
editable: "",
|
|
178
|
+
"form-option": {
|
|
179
|
+
showRequired: !0,
|
|
180
|
+
showGroup: !0,
|
|
181
|
+
showLabel: !1,
|
|
182
|
+
showHook: !1,
|
|
183
|
+
showDesc: !0,
|
|
184
|
+
formEdit: !0
|
|
185
|
+
},
|
|
186
|
+
"form-data": n.value,
|
|
187
|
+
onChange: N
|
|
188
|
+
}, null, 8, ["scheme", "form-data"])) : v("", !0),
|
|
189
|
+
O.value ? v("", !0) : (l(), f(ae, {
|
|
190
|
+
key: 2,
|
|
191
|
+
title: "暂无参数"
|
|
192
|
+
}))
|
|
193
|
+
]))
|
|
194
|
+
])), [
|
|
195
|
+
[$, { loading: g.value }]
|
|
196
|
+
])
|
|
197
|
+
]),
|
|
198
|
+
_: 2
|
|
199
|
+
}, [
|
|
200
|
+
s.readonly ? void 0 : {
|
|
201
|
+
name: "footer",
|
|
202
|
+
fn: y(() => [
|
|
203
|
+
i("div", fe, [
|
|
204
|
+
R(r, {
|
|
205
|
+
theme: "primary",
|
|
206
|
+
"data-test": "save-and-run",
|
|
207
|
+
loading: s.pending,
|
|
208
|
+
onClick: P
|
|
209
|
+
}, {
|
|
210
|
+
default: y(() => [...t[3] || (t[3] = [
|
|
211
|
+
E(" 保存并执行 ", -1)
|
|
212
|
+
])]),
|
|
213
|
+
_: 1
|
|
214
|
+
}, 8, ["loading"]),
|
|
215
|
+
R(r, {
|
|
216
|
+
disabled: s.pending,
|
|
217
|
+
onClick: D
|
|
218
|
+
}, {
|
|
219
|
+
default: y(() => [...t[4] || (t[4] = [
|
|
220
|
+
E("取消", -1)
|
|
221
|
+
])]),
|
|
222
|
+
_: 1
|
|
223
|
+
}, 8, ["disabled"])
|
|
224
|
+
])
|
|
225
|
+
]),
|
|
226
|
+
key: "0"
|
|
227
|
+
}
|
|
228
|
+
]), 1032, ["is-show"]);
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}), ke = /* @__PURE__ */ oe(ye, [["__scopeId", "data-v-01a33593"]]);
|
|
232
|
+
export {
|
|
233
|
+
ke as default
|
|
234
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { defineComponent as q, ref as f, shallowRef as J, computed as x, watch as P, resolveComponent as p, resolveDirective as U, openBlock as l, createBlock as v, withCtx as i, withDirectives as z, createElementBlock as y, Fragment as A, renderList as W, createVNode as b, createCommentVNode as g, createElementVNode as V, createTextVNode as C, toDisplayString as M } from "vue";
|
|
2
|
+
import { InfoBox as X } from "bkui-vue/lib";
|
|
3
|
+
import G from "bkui-vue/lib/message";
|
|
4
|
+
import { u as H, c as K, M as Q, p as Z, m as $, h as ee, r as T, f as te, a as oe, _ as se } from "./index-Bqm08e7H.js";
|
|
5
|
+
const ae = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "mock-data-sideslider__title-sep"
|
|
8
|
+
}, ne = ["title"], le = { class: "mock-data-sideslider" }, re = { class: "mock-data-sideslider__footer" }, ce = "当前节点的输出不支持mock,是否需要在调试时跳过当前节点?", ie = "跳过调试", ue = /* @__PURE__ */ q({
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: {
|
|
11
|
+
show: { type: Boolean },
|
|
12
|
+
node: { default: null },
|
|
13
|
+
outputs: { default: () => ({}) },
|
|
14
|
+
pending: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["confirm", "close", "update:show"],
|
|
17
|
+
setup(O, { emit: E }) {
|
|
18
|
+
const t = O, _ = E, F = H(), k = f(!1), u = J([]), d = f({}), h = f({}), m = f(!1), B = x(() => m.value ? ce : "暂无输出结果"), N = x(() => m.value ? ie : "确定"), D = async () => {
|
|
19
|
+
if (t.node) {
|
|
20
|
+
k.value = !0, h.value = {}, m.value = !1;
|
|
21
|
+
try {
|
|
22
|
+
const e = await Z(F, t.node.component);
|
|
23
|
+
u.value = $(e.outputs ?? []), m.value = ee(e.outputs);
|
|
24
|
+
const o = t.outputs ?? {}, a = {};
|
|
25
|
+
u.value.forEach((s) => {
|
|
26
|
+
const r = Object.prototype.hasOwnProperty.call(o, s.key) ? o[s.key] : s.type === "object" ? {} : void 0, n = T(s);
|
|
27
|
+
a[s.key] = n === "json-editor" || n === "data-table" ? te(r) : r;
|
|
28
|
+
}), d.value = a;
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error(e), u.value = [], d.value = {}, m.value = !1, G({ theme: "error", message: "加载输出结果失败" });
|
|
31
|
+
} finally {
|
|
32
|
+
k.value = !1;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, S = () => {
|
|
36
|
+
const e = {}, o = {};
|
|
37
|
+
return u.value.forEach((a) => {
|
|
38
|
+
const s = d.value[a.key], r = T(a);
|
|
39
|
+
if (r === "json-editor" || r === "data-table") {
|
|
40
|
+
const n = oe(s);
|
|
41
|
+
if (!n.valid) {
|
|
42
|
+
e[a.key] = n.message;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
n.value !== void 0 && (o[a.key] = n.value);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
s !== void 0 && s !== "" && (o[a.key] = s);
|
|
49
|
+
}), { errors: e, outputs: o };
|
|
50
|
+
}, j = (e) => {
|
|
51
|
+
X({
|
|
52
|
+
title: "确认 Mock 输出?",
|
|
53
|
+
content: "Mock 输出将覆盖当前输出结果,执行时跳过该节点并以 Mock 值替代实际输出",
|
|
54
|
+
confirmText: "确定",
|
|
55
|
+
cancelText: "取消",
|
|
56
|
+
width: 400,
|
|
57
|
+
onConfirm: () => {
|
|
58
|
+
e();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}, Y = () => {
|
|
62
|
+
if (m.value) {
|
|
63
|
+
_("confirm", { outputs: {} });
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const { errors: e, outputs: o } = S();
|
|
67
|
+
h.value = e, !(Object.keys(e).length > 0) && j(() => _("confirm", { outputs: o }));
|
|
68
|
+
}, w = () => {
|
|
69
|
+
_("close"), _("update:show", !1);
|
|
70
|
+
};
|
|
71
|
+
return P(
|
|
72
|
+
() => [t.show, t.node?.id],
|
|
73
|
+
([e]) => {
|
|
74
|
+
e && t.node && (d.value = K(t.outputs ?? {}), D());
|
|
75
|
+
},
|
|
76
|
+
{ immediate: !0 }
|
|
77
|
+
), (e, o) => {
|
|
78
|
+
const a = p("bk-form-item"), s = p("bk-form"), r = p("bk-exception"), n = p("bk-button"), I = p("bk-sideslider"), L = U("bkloading");
|
|
79
|
+
return l(), v(I, {
|
|
80
|
+
"is-show": t.show,
|
|
81
|
+
width: 960,
|
|
82
|
+
"quick-close": "",
|
|
83
|
+
"esc-close": !1,
|
|
84
|
+
onClosed: w
|
|
85
|
+
}, {
|
|
86
|
+
header: i(() => [
|
|
87
|
+
o[0] || (o[0] = V("span", { class: "mock-data-sideslider__title" }, "Mock输出", -1)),
|
|
88
|
+
t.node?.name ? (l(), y("span", ae, "-")) : g("", !0),
|
|
89
|
+
t.node?.name ? (l(), y("span", {
|
|
90
|
+
key: 1,
|
|
91
|
+
class: "mock-data-sideslider__title-node",
|
|
92
|
+
title: t.node.name
|
|
93
|
+
}, M(t.node.name), 9, ne)) : g("", !0)
|
|
94
|
+
]),
|
|
95
|
+
footer: i(() => [
|
|
96
|
+
V("div", re, [
|
|
97
|
+
b(n, {
|
|
98
|
+
theme: "primary",
|
|
99
|
+
"data-test": "mock-confirm",
|
|
100
|
+
loading: t.pending,
|
|
101
|
+
onClick: Y
|
|
102
|
+
}, {
|
|
103
|
+
default: i(() => [
|
|
104
|
+
C(M(N.value), 1)
|
|
105
|
+
]),
|
|
106
|
+
_: 1
|
|
107
|
+
}, 8, ["loading"]),
|
|
108
|
+
b(n, {
|
|
109
|
+
disabled: t.pending,
|
|
110
|
+
onClick: w
|
|
111
|
+
}, {
|
|
112
|
+
default: i(() => [...o[1] || (o[1] = [
|
|
113
|
+
C("取消", -1)
|
|
114
|
+
])]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["disabled"])
|
|
117
|
+
])
|
|
118
|
+
]),
|
|
119
|
+
default: i(() => [
|
|
120
|
+
z((l(), y("div", le, [
|
|
121
|
+
u.value.length > 0 ? (l(), v(s, {
|
|
122
|
+
key: 0,
|
|
123
|
+
"form-type": "vertical",
|
|
124
|
+
"label-width": 120,
|
|
125
|
+
"data-test": "mock-outputs-form"
|
|
126
|
+
}, {
|
|
127
|
+
default: i(() => [
|
|
128
|
+
(l(!0), y(A, null, W(u.value, (c) => (l(), v(a, {
|
|
129
|
+
key: c.key,
|
|
130
|
+
label: c.name || c.key
|
|
131
|
+
}, {
|
|
132
|
+
default: i(() => [
|
|
133
|
+
b(Q, {
|
|
134
|
+
modelValue: d.value[c.key],
|
|
135
|
+
"onUpdate:modelValue": (R) => d.value[c.key] = R,
|
|
136
|
+
field: c,
|
|
137
|
+
error: h.value[c.key]
|
|
138
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "field", "error"])
|
|
139
|
+
]),
|
|
140
|
+
_: 2
|
|
141
|
+
}, 1032, ["label"]))), 128))
|
|
142
|
+
]),
|
|
143
|
+
_: 1
|
|
144
|
+
})) : k.value ? g("", !0) : (l(), v(r, {
|
|
145
|
+
key: 1,
|
|
146
|
+
class: "mock-data-sideslider__exception",
|
|
147
|
+
scene: "part",
|
|
148
|
+
type: "empty",
|
|
149
|
+
title: B.value
|
|
150
|
+
}, null, 8, ["title"]))
|
|
151
|
+
])), [
|
|
152
|
+
[L, { loading: k.value }]
|
|
153
|
+
])
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["is-show"]);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}), ke = /* @__PURE__ */ se(ue, [["__scopeId", "data-v-c4e2476a"]]);
|
|
160
|
+
export {
|
|
161
|
+
ke as default
|
|
162
|
+
};
|
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-B0DQFaEe.cjs"),o=require("./context-iqnF_HqS.cjs");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.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.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=o.generateId;exports.random4=o.random4;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { Component, ComputedRef, Ref
|
|
2
|
+
import { Component, ComputedRef, Ref } from 'vue';
|
|
3
3
|
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
4
4
|
import * as _blueking_flow_canvas from '@blueking/flow-canvas';
|
|
5
5
|
import { ZoomToFitOptions, CanvasUiEvent, QuickAddConfig, CanvasSchema, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CanvasToolbarItem, CommandEnvelope } from '@blueking/flow-canvas';
|
|
6
|
-
export { Locale, MessageTree, Translator, getLocale, registerMessages, setLocale, setTranslator, t } from '@blueking/flow-canvas';
|
|
7
|
-
import { defaultRootConfig } from 'bkui-vue/lib/config-provider';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Flow API 配置接口
|
|
@@ -2471,28 +2469,6 @@ declare function createExecutionStatusPlugin(stateRef: Ref<TaskExecutionStates>)
|
|
|
2471
2469
|
*/
|
|
2472
2470
|
declare function resolveExecutionActions(state: NodeExecutionState | undefined, nodeType: string): ExecutionNodeAction[];
|
|
2473
2471
|
|
|
2474
|
-
type BkuiLocale = typeof defaultRootConfig.locale;
|
|
2475
|
-
/** 取当前语言对应的 bkui-vue 语言包;消费方注册的第三语言从 registry 取。 */
|
|
2476
|
-
declare function resolveBkuiLocale(locale: string): BkuiLocale | undefined;
|
|
2477
|
-
/**
|
|
2478
|
-
* 顶层 Flow 组件 setup 内调用:在本组件子树内应用语言(含 Teleport 弹层),
|
|
2479
|
-
* 并改写 defaultRootConfig 覆盖脱离组件树的命令式 Message / InfoBox。
|
|
2480
|
-
*
|
|
2481
|
-
* 约束 1:必须先读 useGlobalConfig() 再合并。provideGlobalConfig 内部是
|
|
2482
|
-
* merge(defaultRootConfig, config),直接传 { locale } 会拿 defaultRootConfig.prefix
|
|
2483
|
-
* 覆盖宿主自定义的 prefix。
|
|
2484
|
-
* 约束 2:zh-cn 时整段跳过,保证现有消费方零行为变化,也不会把已设为英文的宿主拽回中文。
|
|
2485
|
-
* 代价是不会把 defaultRootConfig 改回中文——语言切换本就要求宿主刷新页面。
|
|
2486
|
-
*
|
|
2487
|
-
* 注意 defaultRootConfig 是 bkui-vue 的模块级单例,这一行的**影响范围是整个宿主应用**,
|
|
2488
|
-
* 不限于本组件子树:宿主在别处调用的 bkui-vue 命令式弹窗语言也会随之变化。
|
|
2489
|
-
* 这是覆盖命令式组件的唯一手段(它们没有组件上下文可供 inject),已在
|
|
2490
|
-
* docs/usage.md「对宿主 bkui-vue 全局配置的影响」中对消费方说明。
|
|
2491
|
-
*/
|
|
2492
|
-
declare function applyBkuiLocaleToTree(): void;
|
|
2493
|
-
/** 自建 createApp 调用:该 app 脱离宿主 provide 链,从 defaultRootConfig 起步合并。 */
|
|
2494
|
-
declare function applyBkuiLocale(app: App): void;
|
|
2495
|
-
|
|
2496
2472
|
declare const _default: {
|
|
2497
2473
|
FlowView: () => Promise<typeof __view_vue>;
|
|
2498
2474
|
FlowEdit: () => Promise<typeof __edit_vue>;
|
|
@@ -2506,5 +2482,5 @@ declare const _default: {
|
|
|
2506
2482
|
FlowMockDebug: () => Promise<typeof __mock_vue>;
|
|
2507
2483
|
};
|
|
2508
2484
|
|
|
2509
|
-
export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$5 as FlowCreateTask, _default$7 as FlowDebug, _default$2 as FlowDetail, _default$4 as FlowEdit, _default$6 as FlowExecute, _default$8 as FlowMockDebug, _default$3 as FlowView,
|
|
2485
|
+
export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$5 as FlowCreateTask, _default$7 as FlowDebug, _default$2 as FlowDetail, _default$4 as FlowEdit, _default$6 as FlowExecute, _default$8 as FlowMockDebug, _default$3 as FlowView, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, isMockableNode, mergeOutputs, normalizePluginOutputItems, provideFilterVariableConfig, provideFlowApiConfig, provideMemberSelectorConfig, provideSelectPanelConfig, provideSelectRelatedOptionConfig, random4, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
|
|
2510
2486
|
export type { Activity, CanvasViewportExpose, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FilterCandidateQuery, FilterConditionOptions, FilterConditionValue, FilterVariableConfig, FilterVariableSourceContext, FilterVariableSourceNodeComponent, FilterWhereItem, FilterWhereValue, FlowApiConfig, FlowDetailExpose, FlowDetailPermissions, FlowEditExpose, FlowTaskExecuteSuccessResult, FlowTemplate, FlowViewExpose, Gateway, GatewayCondition, GlobalVariableCreateExpose, MemberSelectorConfig, MockOutputField, NodeExecutionState, NodeExecutionStatus, NodeMockConfig, NotifyConfig, OpenFilterVariableCreateRequest, OpenGlobalVariableCreateRequest, OpenStandardVariableCreateRequest, PipelineTree, PluginDetailCommon, PluginInputDataItem, RetrievalFilterField, SelectPanelConfig, SelectRelatedOptionConfig, SelectRelatedOptionItem, SelectRelatedOptionSource, SelectRelatedOptionSourceRef, SelectRelatedSourceContext, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };
|