Skip to content

The only tool you need to know what is happening and how to fix it.

1.4 KB
Raw Blame
import"./DsnmJJEf.js";import{p as L,e as f,h as _,g as u,m as v,r as g,d as m,f as R,o as T,q,a as A}from"./BKFspo1J.js";import{e as N,i as V}from"./DpeZtIXD.js";import{p as d}from"./CARHnQ8P.js";import{B as b}from"./DY5VVhnr.js";import{I as y}from"./DGTs9ijT.js";import{T as j}from"./CMd3siY9.js";import{P as C}from"./MS5-RPlv.js";var D=f('<div class="flex gap-2"><!> <!> <!></div>'),E=f("<!> ",1),F=f('<div class="space-y-2"><!> <!></div>');function X(P,e){L(e,!0);let l=d(e,"rows",15),k=d(e,"keyPlaceholder",3,"Name"),x=d(e,"valuePlaceholder",3,"Value"),w=d(e,"addLabel",3,"Add"),i=d(e,"disabled",3,!1);function z(){l([...l(),{key:"",value:""}])}function B(s){l(l().filter((a,t)=>t!==s))}var c=F(),h=_(c);N(h,17,l,V,(s,a,t)=>{var r=D(),n=_(r);y(n,{get placeholder(){return k()},class:"flex-1",get disabled(){return i()},get value(){return u(a).key},set value(o){u(a).key=o}});var p=v(n,2);y(p,{get placeholder(){return x()},class:"flex-1",get disabled(){return i()},get value(){return u(a).value},set value(o){u(a).value=o}});var K=v(p,2);b(K,{variant:"ghost",size:"icon",type:"button",onclick:()=>B(t),get disabled(){return i()},children:(o,G)=>{j(o,{class:"h-4 w-4"})},$$slots:{default:!0}}),g(r),m(s,r)});var I=v(h,2);b(I,{variant:"outline",size:"sm",type:"button",onclick:z,get disabled(){return i()},children:(s,a)=>{var t=E(),r=R(t);C(r,{class:"mr-1 h-3 w-3"});var n=v(r);T(()=>q(n,` ${w()??""}`)),m(s,t)},$$slots:{default:!0}}),g(c),m(P,c),A()}export{X as K};