@blueking/bkflow-canvas-editor 1.1.0-beta.25 → 1.1.0-beta.26
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/dist/{index-D1gfWLEN.cjs → index-3EhFYqPl.cjs} +1 -1
- package/dist/{index-kyiTQM-H.cjs → index-COolLM_E.cjs} +18 -18
- package/dist/{index-CworBtmf.js → index-COuP8C6j.js} +3773 -3774
- package/dist/{index-W-ba8TCv.js → index-Co0dagB-.js} +1 -1
- package/dist/{index-DWQE5TXS.js → index-Ctav2u7Z.js} +1 -1
- package/dist/{index-B8i9R8_S.cjs → index-D63TsQgD.cjs} +1 -1
- package/dist/{index-Bm-xq3rx.js → index-DFrYIFvG.js} +1 -1
- package/dist/{index-4fPGfnI-.cjs → index-wCGsKTXS.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("lodash"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("lodash"),r=require("./index-COolLM_E.cjs");require("bkui-vue/lib/message");require("bkui-vue/lib/icon");require("monaco-editor");const F={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"},g=l=>l.replace(/^\$\{(.+)\}$/,"$1"),V=l=>`\${${g(l)}}`;function D(l,c){const a=V(l.key),n=c?p.cloneDeep(c):{},d=l.custom_type??n.custom_type??F[l.type]??"input";return{...n,key:a,name:l.name??n.name??g(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 j(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 s=V(d.key);return n[s]=D(d,c[s]),n},{}):{}}const q={class:"global-debug-input"},R={key:0,class:"global-debug-input__params","data-test":"input-params"},L={key:0},O=["title"],T={class:"col-value"},I={key:1,class:"global-debug-input__value"},P={key:1,class:"form-params-wrapper"},$={class:"sideslider-footer-buttons"},S=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=r.useFlowApiConfig(),s=e.ref({}),f=e.shallowRef([]),m=e.shallowRef([]),y=e.shallowRef(!1),v=e.ref(),k=e.ref(),b=e.computed(()=>f.value.filter(t=>r.isBuiltinUsageVariable(t))),w=e.computed(()=>b.value.length>0||m.value.length>0),_=e.computed(()=>[...f.value].sort((t,o)=>(t.index??0)-(o.index??0)).map(t=>{const o=Object.prototype.hasOwnProperty.call(s.value,t.key)?s.value[t.key]:t.value;return{key:t.key,name:t.name||t.key,value:o,display:r.formatDebugValue(o),isComplex:r.isComplexDebugValue(o)}}));e.watch(()=>a.show,t=>{t&&(s.value=p.cloneDeep(a.initialValues??{}),B())});const B=async()=>{const t=j(a.schema,a.pipelineConstants),o=Object.values(t).filter(i=>typeof i=="object"&&i!==null&&i.show_type==="show");if(f.value=o,a.readonly||Object.keys(t).length<1){m.value=[];return}y.value=!0;try{m.value=await r.getInputFormsFromConstants(d,t)}catch(i){console.error("Failed to build debug input forms from schema:",i),m.value=[]}finally{y.value=!1}},C=t=>{s.value={...s.value,...p.cloneDeep(t)}},x=async()=>{const[t,o]=await Promise.all([Promise.resolve(typeof k.value?.validate=="function"?k.value.validate():!0),Promise.resolve(typeof v.value?.validate=="function"?v.value.validate():!0)]);!t||!o||n("confirm",p.cloneDeep(s.value))},h=()=>{n("close"),n("update:show",!1)};return(t,o)=>{const i=e.resolveComponent("bk-button"),E=e.resolveComponent("bk-sideslider"),N=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(E,{title:"调试参数","is-show":a.show,width:960,"quick-close":!0,"esc-close":!1,onClosed:h},e.createSlots({default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",q,[a.readonly?(e.openBlock(),e.createElementBlock("table",R,[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,[_.value.length===0?(e.openBlock(),e.createElementBlock("tr",L,[...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(_.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,O),e.createElementVNode("td",T,[u.isComplex?(e.openBlock(),e.createBlock(r.DebugJsonViewer,{key:0,value:u.value,"data-test":"json-viewer"},null,8,["value"])):(e.openBlock(),e.createElementBlock("pre",I,e.toDisplayString(u.display),1))])]))),128))])])):(e.openBlock(),e.createElementBlock("div",P,[b.value.length>0?(e.openBlock(),e.createBlock(e.unref(r.BuiltinVariableUsageForm),{key:0,ref_key:"builtinVariableFormRef",ref:k,modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=u=>s.value=u),variables:b.value},null,8,["modelValue","variables"])):e.createCommentVNode("",!0),m.value.length>0?(e.openBlock(),e.createBlock(r.RenderForm,{key:1,ref_key:"renderFormRef",ref:v,scheme:m.value,editable:"","form-option":{showRequired:!0,showGroup:!0,showLabel:!1,showHook:!1,showDesc:!0,formEdit:!0},"form-data":s.value,onChange:C},null,8,["scheme","form-data"])):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r.EmptyException,{key:2,title:"暂无参数"}))]))])),[[N,{loading:y.value}]])]),_:2},[a.readonly?void 0:{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",$,[e.createVNode(i,{theme:"primary","data-test":"save-and-run",loading:a.pending,onClick:x},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode(" 保存并执行 ",-1)])]),_:1},8,["loading"]),e.createVNode(i,{disabled:a.pending,onClick:h},{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("取消",-1)])]),_:1},8,["disabled"])])]),key:"0"}]),1032,["is-show"])}}}),A=r._export_sfc(S,[["__scopeId","data-v-95858958"]]);exports.default=A;
|