@vue/devtools-ui 7.7.7 → 8.0.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/dist/index.cjs +2 -2
- package/dist/index.js +199 -201
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @unocss-include
|
|
2
2
|
|
|
3
|
-
"use strict";var
|
|
4
|
-
`),(c,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[e.createElementVNode("span",{class:"line",textContent:e.toDisplayString(c)},null,8,ae),l[0]||(l[0]=e.createElementVNode("br",null,null,-1))],64))),128))])])],2))}}),C=e.defineComponent({__name:"Overlay",props:{dim:{type:Boolean},blur:{type:Boolean},position:{default:"fixed"}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["left-0 top-0 $ui-z-max h-full w-full $ui-fcc transition-opacity transition-duration-300 $ui-bg-base",[t.dim?"bg-opacity-50!":"bg-opacity-0!",t.blur?"backdrop-blur-sm":"",t.position]])},[e.renderSlot(t.$slots,"default")],2))}}),le={class:"h7.5 w-full $ui-fbc"},se={class:"text-4.5"},ie={class:"content transition-all transition-duration-300"},de={class:"footer h8 w-full transition-all transition-duration-300 delay-250"},ce={class:"$ui-fcc"},N=e.defineComponent({__name:"Dialog",props:{modelValue:{type:Boolean,default:!1},autoClose:{type:Boolean,default:!0},title:{default:"Dialog"},width:{default:"32rem"},height:{default:"18rem"},closable:{type:Boolean,default:!0},mountTo:{default:"body"},dim:{type:Boolean},blur:{type:Boolean},position:{}},emits:["close","update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i,{passive:!0}),s=m.useScrollLock(()=>window.document.documentElement);e.watchEffect(()=>{r.value?s.value=!0:s.value=!1});function l(){r.value&&o.autoClose&&(r.value=!1)}m.onKeyStroke("Escape",()=>{l()});const c=e.ref(!1);return e.onMounted(()=>c.value=!0),(n,d)=>c.value||n.mountTo==="body"?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:n.mountTo},[e.createVNode(e.Transition,{"enter-from-class":"opacity-0 [&_.modal]:scale-95 [&_.content,&_.footer]:translate-y--2.5 [&_.content,&_.footer]:opacity-0","enter-to-class":"opacity-100 [&_.modal]:scale-100","leave-from-class":"opacity-100 [&_.modal]:scale-100","leave-to-class":"opacity-0 [&_.modal]:scale-95"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createBlock(C,{key:0,dim:n.dim,blur:n.blur,position:n.position},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"modal relative grid grid-rows-[1.875rem_1fr_2.5rem] $ui-base max-h-[calc(100vh-6.25rem)] max-w-[calc(100vw-6.25rem)] min-h-6.25rem min-w-12.5rem gap-2.5 rounded-md bg-white px6 py4.5 color-gray-800 shadow-2xl transition-transform transition-duration-300 dark:bg-gray-900 dark:color-gray-200",style:e.normalizeStyle({width:o.width,height:o.height})},[e.createElementVNode("div",le,[e.createElementVNode("div",se,[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])]),n.closable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h6 w6 $ui-fcc cursor-pointer rounded-full transition-colors hover:bg-primary-100 dark:hover:bg-gray-700",onClick:l},d[0]||(d[0]=[e.createElementVNode("div",{class:"i-carbon-close"},null,-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("div",ie,[e.renderSlot(n.$slots,"default")]),e.createElementVNode("div",de,[e.renderSlot(n.$slots,"footer",{},()=>[e.renderSlot(n.$slots,"footer",{},()=>[e.createElementVNode("div",ce,[e.createVNode(v,{type:"primary",onClick:l},{default:e.withCtx(()=>d[1]||(d[1]=[e.createTextVNode(" close ")])),_:1})])])])])],4)]),_:3},8,["dim","blur","position"])):e.createCommentVNode("",!0)]),_:3})],8,["to"])):e.createCommentVNode("",!0)}}),ue={class:"$ui-fec gap2.5"},pe=e.defineComponent({__name:"Confirm",props:{modelValue:{type:Boolean},content:{},cancelText:{default:"Cancel"},confirmText:{default:"Confirm"},width:{default:"20%"},height:{default:"9rem"},title:{default:"Warning"},loading:{type:Boolean,default:!1},autoClose:{type:Boolean,default:!0}},emits:["update:modelValue","confirm","cancel","close"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i);e.watchEffect(()=>{r.value||i("close")});function s(l=!1){(o.autoClose||l)&&(r.value=!1)}return(l,c)=>(e.openBlock(),e.createBlock(N,{modelValue:e.unref(r),"onUpdate:modelValue":c[2]||(c[2]=n=>e.isRef(r)?r.value=n:null),width:l.width,height:l.height,title:l.title,closable:!1},{footer:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createVNode(v,{onClick:c[0]||(c[0]=()=>{i("cancel"),s(!0)})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.cancelText),1)]),_:1}),e.createVNode(v,{loading:l.loading,type:"primary",onClick:c[1]||(c[1]=()=>{i("confirm"),s()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.confirmText),1)]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{class:"h-auto w-auto"},()=>[e.createTextVNode(e.toDisplayString(l.content),1)])]),_:3},8,["modelValue","width","height","title"]))}}),S=e.defineComponent({__name:"Notification",props:{message:{},type:{default:"info"},classes:{},duration:{default:3e3},placement:{default:"top-center"},onClose:{}},setup(a){const t=a,o={success:"i-carbon-checkmark",info:"i-material-symbols-light-info",warning:"i-carbon-warning",error:"i-carbon-close"},i={success:"text-primary-500 border-primary-200 dark:text-primary-200 dark:border-primary-500",info:"text-blue-4 border-blue-2 dark:text-blue-2 dark:border-blue-4",warning:"text-amber-4 border-amber-2 dark:border-amber-4",error:"text-red-4 border-red-2 dark:border-red-4"},r=e.ref(!1);e.onMounted(()=>{r.value=!0,setTimeout(()=>{r.value=!1},t.duration)});const s=e.computed(()=>t.placement.startsWith("top")?"translate-y--300%":"translate-y-300%");return(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["fixed left-0 right-0 $ui-z-max-override text-center",[{"top-0":l.placement.startsWith("top")},{"bottom-0":l.placement.startsWith("bottom")}]])},[e.createVNode(e.Transition,{"enter-from-class":s.value,"leave-to-class":s.value,onAfterLeave:c[0]||(c[0]=()=>{var n;r.value||(n=l.onClose)==null||n.call(l)})},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex transition-all duration-300",style:e.normalizeStyle({justifyContent:l.placement.includes("right")?"right":l.placement.includes("left")?"left":"center"})},[e.createElementVNode("div",{class:e.normalizeClass(["m3 flex-inline items-center gap2 b-1 b-1 rounded px4 py1 shadow transition-all duration-300 $ui-bg-base",[l.classes,i[l.type]]])},[e.createElementVNode("div",{class:e.normalizeClass(o[l.type])},null,2),e.createElementVNode("div",null,e.toDisplayString(l.message),1)],2)],4)):e.createCommentVNode("",!0)]),_:1},8,["enter-from-class","leave-to-class"])],2))}});function me(a){const t=document.createElement("div");t.classList.add("$ui-z-max-override","fixed"),document.body.appendChild(t);const o=a.onClose;function i(){e.render(null,t)}a.onClose=()=>{i(),o==null||o(),document.body.removeChild(t)};const r=e.h(S,a);e.render(r,t)}const _="__vue-devtools-theme__";function T(a={}){const t=m.useColorMode({...a,storageKey:_});return{colorMode:t,isDark:e.computed(()=>t.value==="dark")}}const fe={class:"$ui-dark-toggle-vtr"},ge=e.defineComponent({__name:"DarkToggle",props:{isDark:{type:Boolean,default:!1},animation:{type:Boolean,default:!0},animationDuration:{default:400}},setup(a){const t=a,o=m.useVModel(t,"isDark"),{colorMode:i}=T({initialValue:o.value?"dark":"light",onChanged:c=>{o.value=c==="dark"}}),r=e.computed({get:()=>i.value==="dark",set:c=>i.value=c?"dark":"light"}),s=!!document.startViewTransition&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;function l(c){if(!s||!c||!t.animation){r.value=!r.value;return}const n=c.clientX,d=c.clientY,p=Math.hypot(Math.max(n,innerWidth-n),Math.max(d,innerHeight-d));document.startViewTransition(async()=>{r.value=!r.value,await e.nextTick()}).ready.then(()=>{const g=[`circle(0px at ${n}px ${d}px)`,`circle(${p}px at ${n}px ${d}px)`];document.documentElement.animate({clipPath:r.value?[...g].reverse():g},{duration:t.animationDuration,easing:"ease-in",pseudoElement:r.value?"::view-transition-old(root)":"::view-transition-new(root)"})})}return(c,n)=>(e.openBlock(),e.createElementBlock("span",fe,[e.renderSlot(c.$slots,"default",e.normalizeProps(e.guardReactiveProps({mode:e.unref(i),isDark:r.value,toggle:l})))]))}}),ve=e.defineComponent({__name:"Drawer",props:{modelValue:{type:Boolean},mountTo:{default:"body"},placement:{default:"right"},closeOutside:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},contentClass:{},permanent:{type:Boolean,default:!1},contentBlur:{type:Boolean,default:!1},top:{},dim:{type:Boolean},blur:{type:Boolean},position:{}},emits:["update:modelValue","close"],setup(a,{emit:t}){const o=a,i=t,{height:r}=m.useElementSize(()=>typeof o.top=="string"?document.querySelector(o.top):o.top,void 0,{box:"border-box"}),s=m.useVModel(o,"modelValue",i),l={left:{class:"left-0 h-full b-r",transition:"[&_.drawer]:translate-x--100%"},right:{class:"right-0 h-full b-l",transition:"[&_.drawer]:translate-x-full"},top:{class:"w-full b-b",transition:"[&_.drawer]:translate-y--100%"},bottom:{class:"bottom-0 w-full b-t",transition:"[&_.drawer]:translate-y-100%"}};m.onKeyStroke("Escape",()=>{o.closable&&(s.value=!1)});const c=e.computed(()=>l[o.placement]),n=e.ref(!1);return e.onMounted(()=>n.value=!0),(d,p)=>n.value||d.mountTo==="body"?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:d.mountTo},[e.createVNode(e.Transition,{"enter-from-class":`${c.value.transition}`,"leave-to-class":`${c.value.transition}`},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(C,{key:0,class:e.normalizeClass({"pointer-events-none":d.permanent}),dim:d.dim,blur:d.blur,position:d.position,onClick:p[2]||(p[2]=u=>d.closeOutside&&d.closable&&(s.value=!1))},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([[c.value.class,d.contentClass??"",d.contentBlur?"$ui-glass-effect":"$ui-bg-base"],"drawer pointer-events-auto absolute min-w-25 of-auto $ui-border-base transition-transform transition-duration-300"]),style:e.normalizeStyle({top:d.placement==="bottom"?"auto":`${e.unref(r)}px`,height:["top","bottom"].includes(d.placement)?"auto":`calc(100% - ${e.unref(r)}px)`}),onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"]))},[d.closable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-carbon-close absolute right-1.5 top-1.5 $ui-z-max cursor-pointer p1 text-lg $ui-text",onClick:p[0]||(p[0]=u=>s.value=!1)})):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"default")],6)]),_:3},8,["class","dim","blur","position"])):e.createCommentVNode("",!0)]),_:3},8,["enter-from-class","leave-to-class"])],8,["to"])):e.createCommentVNode("",!0)}}),be={class:"overflow-hidden rounded-lg shadow-lg"},D=e.defineComponent({__name:"Dropdown",props:{label:{},buttonProps:{default:()=>({})},buttonClass:{default:""},trigger:{default:"click"},distance:{default:0},skidding:{},placement:{},disabled:{type:Boolean,default:!1},shown:{type:Boolean}},emits:["update:visible"],setup(a){const t=a;return e.provide("$ui-dropdown-disabled",e.computed(()=>t.disabled)),(o,i)=>(e.openBlock(),e.createBlock(e.unref(b.Dropdown),{disabled:o.disabled,class:"inline-block w-auto",shown:o.shown,triggers:[o.trigger],distance:o.distance+6,placement:o.placement,skidding:o.skidding,"onUpdate:shown":i[0]||(i[0]=r=>o.$emit("update:visible",r)),onClick:i[1]||(i[1]=r=>{r.stopPropagation()})},{popper:e.withCtx(({hide:r})=>[e.createElementVNode("div",be,[e.renderSlot(o.$slots,"popper",e.normalizeProps(e.guardReactiveProps({hide:r})),()=>[i[2]||(i[2]=e.createElementVNode("div",{class:"p2 opacity-40"}," Empty... ",-1))])])]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},()=>[e.createVNode(v,e.mergeProps({...o.buttonProps,disabled:o.disabled},{class:o.buttonClass}),e.createSlots({icon:e.withCtx(()=>[e.renderSlot(o.$slots,"button-icon")]),"icon-right":e.withCtx(()=>[e.renderSlot(o.$slots,"button-icon-right")]),_:2},[o.label?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),key:"0"}:void 0]),1040,["class"])])]),_:3},8,["disabled","shown","triggers","distance","placement","skidding"]))}}),he=e.defineComponent({__name:"DropdownButton",props:{type:{},round:{type:[String,Boolean]},loading:{type:Boolean},disabled:{type:Boolean},size:{},flat:{type:Boolean},outlined:{type:Boolean},keepOpen:{type:Boolean,default:!1}},setup(a){const t=a,o=e.inject("$ui-dropdown-disabled",void 0);return(i,r)=>e.withDirectives((e.openBlock(),e.createBlock(v,e.mergeProps({...t,round:!1},{disabled:e.unref(o),class:"w-full justify-start transition-colors not-action:bg-transparent!"}),{icon:e.withCtx(()=>[e.renderSlot(i.$slots,"icon")]),default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["disabled"])),[[e.unref(b.vClosePopper)]])}}),y=e.defineComponent({__name:"Icon",props:{icon:{},inline:{type:Boolean},action:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inline?"span":"div"),{class:e.normalizeClass(["$ui-base",[t.icon,t.action?"cursor-pointer hover:op50":""]])},null,8,["class"]))}}),ye=["type","placeholder","disabled"],ke={key:3,class:"pointer-events-none absolute bottom--0.25 left-50% right-50% z-9999 h-0.75 bg-primary-500 opacity-0 transition-all duration-240 group-[&.focused]:left-0 group-[&.focused]:right-0 group-[&.focused]:opacity-100 group-[&.accent.focused]:bg-accent-500"},k="transition-colors $ui-fcc color-gray-500 dark:color-gray-300 group-[&.focused]:color-primary-500; group-[&.accent.focused]:color-accent-500",M=e.defineComponent({__name:"Input",props:{modelValue:{},placeholder:{default:""},variant:{default:"normal"},disabled:{type:Boolean,default:!1},leftIcon:{},rightIcon:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},loadingDebounceTime:{default:0},readonly:{type:Boolean,default:!1},type:{default:"text"}},emits:["update:modelValue","updateFocused","keyTab"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i),s=m.refDebounced(e.computed(()=>o.loading),o.loadingDebounceTime),l=m.refWithControl(!1,{onChanged(u){i("updateFocused",u)}}),c=e.computed(()=>o.variant==="flat"||o.variant==="warning"||o.disabled||o.readonly),n=e.computed(()=>o.disabled||s.value),d=e.ref();let p=!1;return e.watchEffect(()=>{s.value&&l.value?p=!0:!s.value&&p&&(p=!1,e.nextTick(()=>{l.value=!0}))}),e.onMounted(()=>{o.autoFocus&&(l.value=!0)}),e.watchEffect(()=>{var u;l.value&&((u=d.value)==null||u.focus())}),(u,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["group relative w-50 w-auto flex items-center justify-between gap-0.5 overflow-hidden b-1 rounded-1 px3 py-0.75 color-gray-800 dark:color-gray-100",[{"border-none bg-transparent group":u.variant==="flat","cursor-not-allowed opacity-50":n.value,accent:u.variant==="accent",focused:e.unref(l)},[u.variant==="warning"?"border-warning-500 dark:border-warning-300":"border-primary-100 dark:border-gray-700"]]]),onClick:g[2]||(g[2]=()=>{l.value=!0})},[u.leftIcon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(k)},[e.createVNode(y,{icon:u.leftIcon},null,8,["icon"])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:d,"onUpdate:modelValue":g[0]||(g[0]=V=>e.isRef(r)?r.value=V:null),class:"$ui-base w-full bg-transparent color-inherit outline-none placeholder-color-gray-500 dark:placeholder-gray-300",type:u.type,placeholder:u.placeholder,disabled:n.value||u.readonly,onBlur:g[1]||(g[1]=V=>l.value=!1)},null,40,ye),[[e.vModelDynamic,e.unref(r)]]),e.unref(s)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(k)},[e.createVNode(B)])):u.rightIcon?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(k)},[e.createVNode(y,{icon:u.rightIcon},null,8,["icon"])])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ke))],2))}}),we={class:"$ui-base"},Be=e.defineComponent({__name:"FormField",props:{modelValue:{},status:{default:"normal"},showMessage:{type:Boolean,default:!0},message:{default:""},placeholder:{}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i),s=e.ref(!1),l=e.computed(()=>o.message&&o.message.length&&o.showMessage),c={normal:"color-gray-600 dark:color-gray-400",warning:"color-warning-500 dark:color-warning-200",danger:"color-danger-500 dark:color-danger-200",success:"color-primary-700 dark:color-primary-500"},n={warning:"i-bx:bxs-error",danger:"i-ic-round-error",success:"i-ep:success-filled"};return(d,p)=>(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(M,{modelValue:e.unref(r),"onUpdate:modelValue":p[0]||(p[0]=u=>e.isRef(r)?r.value=u:null),placeholder:d.placeholder,onUpdateFocused:p[1]||(p[1]=u=>s.value=u)},null,8,["modelValue","placeholder"]),e.createElementVNode("div",{class:e.normalizeClass(["mt2 $ui-base text-3.5",[c[d.status],{"opacity-65":!s.value}]])},[d.status!=="normal"&&l.value?(e.openBlock(),e.createBlock(y,{key:0,inline:"",icon:n[d.status]},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.value?d.message:""),1)],2)]))}}),Ce=["innerHTML"],Ve=e.defineComponent({__name:"IcIcon",props:{name:{}},setup(a){const t=a,o=e.computed(()=>j.icIcons[t.name]??"");return(i,r)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:"custom-svg h-1em w-1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",innerHTML:o.value},null,8,Ce))]))}}),$e={class:"m1 min-w-35 w-auto flex flex-col"},Ee=["onClick"],Ne=e.defineComponent({__name:"Select",props:{modelValue:{},multiple:{default:!1},options:{},placeholder:{default:"Select..."},autoClose:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},labelRenderer:{type:Function,default:a=>String(a)},buttonProps:{default:()=>({})}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=e.useSlots(),s=e.computed({get:()=>o.modelValue,set:n=>i("update:modelValue",n)}),l=e.computed(()=>{const n=o.options.find(d=>d.value===s.value);return n!=null&&n.label?o.labelRenderer(n.label):o.placeholder});function c(n){o.multiple?s.value=s.value.includes(n.value)?s.value.filter(d=>d!==n.value):[...s.value,n.value]:s.value=n.value}return(n,d)=>(e.openBlock(),e.createBlock(D,e.mergeProps({label:l.value},{buttonProps:n.buttonProps,disabled:n.disabled}),e.createSlots({popper:e.withCtx(()=>[e.createElementVNode("div",$e,[e.unref(r).item?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.options,p=>(e.openBlock(),e.createElementBlock("div",{key:p.value,class:"cursor-pointer",onClick:u=>c(p)},[e.renderSlot(n.$slots,"item",e.mergeProps({ref_for:!0},{item:p,active:n.multiple?s.value.includes(p.value):p.value===s.value,disabled:n.disabled}))],8,Ee))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.options,p=>e.withDirectives((e.openBlock(),e.createBlock(v,{key:p.value,disabled:n.disabled,round:"normal",class:e.normalizeClass(["flex-[auto_1_1] not-hover:[&:not(.active)]:bg-transparent!",{active:n.multiple?s.value.includes(p.value):p.value===s.value}]),onClick:u=>c(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["disabled","class","onClick"])),[[e.unref(b.vClosePopper),n.autoClose]])),128))])]),"button-icon-right":e.withCtx(()=>[d[0]||(d[0]=e.createElementVNode("div",{class:"i-mdi-chevron-down"},null,-1))]),_:2},[e.unref(r).button?{name:"default",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"button")]),key:"0"}:void 0]),1040,["label"]))}}),Se=e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i),s=m.useToggle(r);return(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[l.disabled?"cursor-not-allowed":"cursor-pointer"],"$ui-base $ui-if-sc cursor-pointer select-none gap1.25 vertical-mid text-3.5"]),role:"checkbox",onClick:c[0]||(c[0]=n=>!l.disabled&&e.unref(s)())},[e.renderSlot(l.$slots,"default"),e.createElementVNode("div",{class:e.normalizeClass([{selected:e.unref(r)},"group relative $ui-base h4 w8 rounded-2 bg-primary-100 transition-colors dark:bg-gray-700 [&.selected]:bg-primary-500!"])},[e.createElementVNode("div",{class:e.normalizeClass(["h4 w4 rounded-full bg-primary-800 transition-transform group-[&.selected]:transform-translate-x-4 dark:bg-white",[{"group-hover:opacity-75 group-active:scale-85":!l.disabled},{"opacity-65":l.disabled}]])},null,2)],2)],2))}}),_e=e.defineComponent({__name:"Tooltip",props:{trigger:{},distance:{},skidding:{},placement:{},disabled:{type:Boolean},shown:{type:Boolean}},setup(a){return(t,o)=>(e.openBlock(),e.createBlock(e.unref(b.Tooltip),e.mergeProps({disabled:t.disabled,placement:t.placement},t.$attrs),{popper:e.withCtx(()=>[e.renderSlot(t.$slots,"popper")]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["disabled","placement"]))}});Object.defineProperty(exports,"vTooltip",{enumerable:!0,get:()=>b.vTooltip});exports.THEME_KEY=_;exports.VueBadge=W;exports.VueButton=v;exports.VueCard=Z;exports.VueCheckbox=ee;exports.VueCodeBlock=ne;exports.VueConfirm=pe;exports.VueDarkToggle=ge;exports.VueDialog=N;exports.VueDrawer=ve;exports.VueDropdown=D;exports.VueDropdownButton=he;exports.VueFormField=Be;exports.VueIcIcon=Ve;exports.VueIcon=y;exports.VueInput=M;exports.VueLoadingIndicator=B;exports.VueNotification=S;exports.VueOverlay=C;exports.VueSelect=Ne;exports.VueSwitch=Se;exports.VueTooltip=_e;exports.showVueNotification=me;exports.useDevToolsColorMode=T;
|
|
3
|
+
"use strict";var M=Object.create;var $=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var R=(a,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of P(t))!L.call(a,r)&&r!==o&&$(a,r,{get:()=>t[r],enumerable:!(i=z(t,r))||i.enumerable});return a};var f=(a,t,o)=>(o=a!=null?M(I(a)):{},R(t||!a||!a.__esModule?$(o,"default",{value:a,enumerable:!0}):o,a));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("floating-vue");;/* empty css */;/* empty css */const e=require("vue"),m=require("@vueuse/core"),F=require("shiki/core"),H=require("shiki/engine/javascript"),O=require("./ic-icons-data-G1Zhc3L0.cjs"),w=(a,t)=>{const o=a.__vccOpts||a;for(const[i,r]of t)o[i]=r;return o},j={},q={class:"mx-0.5 $ui-base inline-block select-none whitespace-nowrap rounded px-1.5 py-0.5 text-xs"};function A(a,t){return e.openBlock(),e.createElementBlock("span",q,[e.renderSlot(a.$slots,"default")])}const W=w(j,[["render",A]]),K={},U={class:"h-3 w-3 $ui-inline-fcc"};function Y(a,t){return e.openBlock(),e.createElementBlock("div",U,t[0]||(t[0]=[e.createElementVNode("svg",{class:"animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)]))}const B=w(K,[["render",Y]]),J={key:2},v=e.defineComponent({inheritAttrs:!1,__name:"Button",props:{type:{default:"default"},round:{type:[String,Boolean],default:"normal"},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"normal"},flat:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1}},emits:["click"],setup(a,{emit:t}){const o=a,i=t,r=e.useAttrs(),s=e.computed(()=>r.to?"router-link":r.href?"a":"button"),n=e.computed(()=>o.loading||o.disabled);function c(u){if(n.value){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation();return}i("click",u)}const l={common:{default:"active:bg-primary-100-darker dark:active:bg-gray-800-darker",primary:"active:bg-primary-500-darker",accent:"active:bg-accent-500-darker",danger:"active:bg-danger-500-darker",warning:"active:bg-warning-500-darker",info:"active:bg-primary-100-darker dark:active:bg-gray-800-darker",success:"active:bg-primary-100-darker dark:active:bg-gray-800-darker"},normal:{default:"bg-primary-100 hover:bg-primary-100-lighter dark:bg-gray-800 dark:hover:bg-gray-800-lighter dark:hover:text-white",primary:" text-white bg-primary-500 hover:bg-primary-500-lighter dark:hover:bg-primary-500-darker",accent:"text-white bg-accent-500 hover:bg-accent-500-lighter dark:bg-accent-500-darker dark:bg-accent-300",danger:"text-white bg-danger-500 hover:bg-danger-500-lighter dark:hover:bg-danger-500-darker",warning:"text-white bg-warning-500 hover:bg-warning-500-lighter dark:hover:bg-warning-500-darker",info:"text-info-500 bg-primary-100 hover:bg-primary-100-lighter dark:bg-gray-800 dark:hover:bg-gray-800-lighter",success:"text-primary-500 bg-primary-100 hover:bg-primary-100-lighter dark:bg-gray-800 dark:hover:bg-gray-800-lighter"},flat:{default:"hover:bg-primary-100 hover:text-black !dark:text-white dark:hover:bg-primary-800",primary:"hover:bg-primary-500 hover:text-white",accent:"hover:bg-accent-500 hover:text-white",danger:"hover:bg-danger-500 hover:text-white",warning:"hover:bg-warning-500 hover:text-white",info:"hover:bg-primary-100 hover:text-info-500 dark:hover:bg-gray-800 dark:hover:text-info-400",success:"hover:bg-primary-100 hover:text-primary-500 dark:hover:bg-primary-800 dark:hover:text-primary-400"},outlined:{default:"hover:border-primary-100 hover:text-primary-300 hover:active:ring-primary-100:5 hover:active:bg-primary-100:5",primary:"hover:border-primary-500 hover:text-primary-500 active:ring-primary-500:5 active:bg-primary-500:5",accent:"hover:border-accent-500 hover:text-accent-500 active:ring-accent-500:5 active:bg-accent-500:5",danger:"hover:border-danger-500 hover:text-danger-500 active:ring-danger-500:5 active:bg-danger-500:5",warning:"hover:border-warning-500 hover:text-warning-500 active:ring-warning-500:5 active:bg-warning-500:5",info:"hover:border-info-500 hover:text-info-500 active:ring-info-500:5 active:bg-info-500:5",success:"hover:border-primary-500 hover:text-primary-500 active:ring-primary-500:5 active:bg-primary-500:5"}},d=e.useSlots(),p=e.computed(()=>o.flat?l.flat[o.type]:o.outlined?l.outlined[o.type]:l.normal[o.type]);return(u,g)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value),e.mergeProps(u.$attrs,{role:"button","aria-disabled":n.value,class:["$ui-base $ui-inline-fcc inline-flex cursor-pointer select-none gap1.25 py-0 no-underline $ui-transition",[[l.common[o.type]],{"rounded-full":o.round==="full","$ui-base-br":o.round==="normal","opacity-50 cursor-not-allowed":n.value,"bg-transparent":o.flat||o.outlined},[u.outlined?"b-1 $ui-border-base active:ring-3 shadow-sm":"border-none",u.size==="mini"?"px1 text-3 h5.5":"px3.5 text-3.5 h8",p.value]]],onClickCapture:c}),{default:e.withCtx(()=>[u.loading?(e.openBlock(),e.createBlock(B,{key:0,class:"mt0.5 h-full w3"})):e.renderSlot(u.$slots,"icon",{key:1,class:"h-full w3 $ui-inline-fcc"}),e.unref(d).default?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(u.$slots,"default")])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"icon-right")]),_:3},16,["aria-disabled","class"]))}}),X={},G={class:"$ui-base border $ui-border-base rounded shadow-sm"};function Q(a,t){return e.openBlock(),e.createElementBlock("div",G,[e.renderSlot(a.$slots,"default")])}const Z=w(X,[["render",Q]]),ee=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean},variant:{default:"normal"}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i);return(s,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative $ui-base h5 w5 $ui-inline-fcc cursor-pointer border-0.125rem rounded-1.25 transition-colors duration-200 ease-in-out",[e.unref(r)?s.variant==="normal"?"bg-primary-500 border-primary-200 dark:border-primary-100":"bg-accent-500 border-accent-200 dark:border-accent-100":""]]),onClick:n[0]||(n[0]=c=>r.value=!e.unref(r))},[e.createElementVNode("div",{class:e.normalizeClass([[e.unref(r)?"opacity-100":"opacity-0"],"h-60% w-35% transform-translate-y--0.25 transform-rotate-45 border-width-[0_0.125rem_0.125rem_0] border-white border-solid transition-opacity duration-200 ease-in-out"])},null,2)],2))}}),h=e.shallowRef();let E=null;function oe(a,t="text"){if(!E&&!h.value){const i=H.createJavaScriptRegexEngine();E=F.createHighlighterCore({themes:[import("shiki/themes/vitesse-dark.mjs"),import("shiki/themes/vitesse-light.mjs")],langs:[import("shiki/langs/json.mjs"),import("shiki/langs/yaml.mjs"),import("shiki/langs/css.mjs"),import("shiki/langs/javascript.mjs"),import("shiki/langs/typescript.mjs"),import("shiki/langs/vue.mjs"),import("shiki/langs/vue-html.mjs"),import("shiki/langs/html.mjs"),import("shiki/langs/diff.mjs"),import("shiki/langs/shellscript.mjs")],engine:i}).then(r=>{h.value=r})}const o=h.value?.getLoadedLanguages().includes(t);return o?{code:h.value.codeToHtml(a,{lang:t,themes:{dark:"vitesse-dark",light:"vitesse-light"}}),supported:!0}:{code:a,supported:o}}const te=["innerHTML"],re={class:"shiki"},ae=["textContent"],ne=e.defineComponent({__name:"CodeBlock",props:{code:{},lang:{},lines:{type:Boolean,default:!0},transformRendered:{}},emits:["loaded"],setup(a,{emit:t}){const o=a,i=t,r=e.computed(()=>{const s=o.lang==="text"?{code:o.code,supported:!1}:oe(o.code,o.lang)||{code:o.code,supported:!1};return s.supported&&o.transformRendered&&(s.code=o.transformRendered(s.code)),s.supported&&e.nextTick(()=>i("loaded")),s});return(s,n)=>s.lang&&r.value.supported?(e.openBlock(),e.createElementBlock("pre",{key:0,class:e.normalizeClass(["code-block",s.lines?"code-block-lines":""]),innerHTML:r.value.code},null,10,te)):(e.openBlock(),e.createElementBlock("pre",{key:1,class:e.normalizeClass(["code-block",s.lines?"code-block-lines":""])},[e.createElementVNode("pre",re,[e.createElementVNode("code",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.code.split(`
|
|
4
|
+
`),(c,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[e.createElementVNode("span",{class:"line",textContent:e.toDisplayString(c)},null,8,ae),n[0]||(n[0]=e.createElementVNode("br",null,null,-1))],64))),128))])])],2))}}),C=e.defineComponent({__name:"Overlay",props:{dim:{type:Boolean},blur:{type:Boolean},position:{default:"fixed"}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["left-0 top-0 $ui-z-max h-full w-full $ui-fcc $ui-bg-base transition-opacity transition-duration-300",[t.dim?"bg-opacity-50!":"bg-opacity-0!",t.blur?"backdrop-blur-sm":"",t.position]])},[e.renderSlot(t.$slots,"default")],2))}}),le={class:"h7.5 w-full $ui-fbc"},se={class:"text-4.5"},ie={class:"content transition-all transition-duration-300"},de={class:"footer h8 w-full transition-all transition-duration-300 delay-250"},ce={class:"$ui-fcc"},N=e.defineComponent({__name:"Dialog",props:{modelValue:{type:Boolean,default:!1},autoClose:{type:Boolean,default:!0},title:{default:"Dialog"},width:{default:"32rem"},height:{default:"18rem"},closable:{type:Boolean,default:!0},mountTo:{default:"body"},dim:{type:Boolean},blur:{type:Boolean},position:{}},emits:["close","update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i,{passive:!0}),s=m.useScrollLock(()=>window.document.documentElement);e.watchEffect(()=>{r.value?s.value=!0:s.value=!1});function n(){r.value&&o.autoClose&&(r.value=!1)}m.onKeyStroke("Escape",()=>{n()});const c=e.ref(!1);return e.onMounted(()=>c.value=!0),(l,d)=>c.value||l.mountTo==="body"?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:l.mountTo},[e.createVNode(e.Transition,{"enter-from-class":"opacity-0 [&_.modal]:scale-95 [&_.content,&_.footer]:translate-y--2.5 [&_.content,&_.footer]:opacity-0","enter-to-class":"opacity-100 [&_.modal]:scale-100","leave-from-class":"opacity-100 [&_.modal]:scale-100","leave-to-class":"opacity-0 [&_.modal]:scale-95"},{default:e.withCtx(()=>[e.unref(r)?(e.openBlock(),e.createBlock(C,{key:0,dim:l.dim,blur:l.blur,position:l.position},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"modal relative grid grid-rows-[1.875rem_1fr_2.5rem] $ui-base max-h-[calc(100vh-6.25rem)] max-w-[calc(100vw-6.25rem)] min-h-6.25rem min-w-12.5rem gap-2.5 rounded-md bg-white px6 py4.5 color-gray-800 shadow-2xl transition-transform transition-duration-300 dark:bg-gray-900 dark:color-gray-200",style:e.normalizeStyle({width:o.width,height:o.height})},[e.createElementVNode("div",le,[e.createElementVNode("div",se,[e.renderSlot(l.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])]),l.closable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h6 w6 $ui-fcc cursor-pointer rounded-full transition-colors hover:bg-primary-100 dark:hover:bg-gray-700",onClick:n},d[0]||(d[0]=[e.createElementVNode("div",{class:"i-carbon-close"},null,-1)]))):e.createCommentVNode("",!0)]),e.createElementVNode("div",ie,[e.renderSlot(l.$slots,"default")]),e.createElementVNode("div",de,[e.renderSlot(l.$slots,"footer",{},()=>[e.renderSlot(l.$slots,"footer",{},()=>[e.createElementVNode("div",ce,[e.createVNode(v,{type:"primary",onClick:n},{default:e.withCtx(()=>d[1]||(d[1]=[e.createTextVNode(" close ",-1)])),_:1,__:[1]})])])])])],4)]),_:3},8,["dim","blur","position"])):e.createCommentVNode("",!0)]),_:3})],8,["to"])):e.createCommentVNode("",!0)}}),ue={class:"$ui-fec gap2.5"},pe=e.defineComponent({__name:"Confirm",props:{modelValue:{type:Boolean},content:{},cancelText:{default:"Cancel"},confirmText:{default:"Confirm"},width:{default:"20%"},height:{default:"9rem"},title:{default:"Warning"},loading:{type:Boolean,default:!1},autoClose:{type:Boolean,default:!0}},emits:["update:modelValue","confirm","cancel","close"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i);e.watchEffect(()=>{r.value||i("close")});function s(n=!1){(o.autoClose||n)&&(r.value=!1)}return(n,c)=>(e.openBlock(),e.createBlock(N,{modelValue:e.unref(r),"onUpdate:modelValue":c[2]||(c[2]=l=>e.isRef(r)?r.value=l:null),width:n.width,height:n.height,title:n.title,closable:!1},{footer:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createVNode(v,{onClick:c[0]||(c[0]=()=>{i("cancel"),s(!0)})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.cancelText),1)]),_:1}),e.createVNode(v,{loading:n.loading,type:"primary",onClick:c[1]||(c[1]=()=>{i("confirm"),s()})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.confirmText),1)]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{class:"h-auto w-auto"},()=>[e.createTextVNode(e.toDisplayString(n.content),1)])]),_:3},8,["modelValue","width","height","title"]))}}),_=e.defineComponent({__name:"Notification",props:{message:{},type:{default:"info"},classes:{},duration:{default:3e3},placement:{default:"top-center"},onClose:{}},setup(a){const t=a,o={success:"i-carbon-checkmark",info:"i-material-symbols-light-info",warning:"i-carbon-warning",error:"i-carbon-close"},i={success:"text-primary-500 border-primary-200 dark:text-primary-200 dark:border-primary-500",info:"text-blue-4 border-blue-2 dark:text-blue-2 dark:border-blue-4",warning:"text-amber-4 border-amber-2 dark:border-amber-4",error:"text-red-4 border-red-2 dark:border-red-4"},r=e.ref(!1);e.onMounted(()=>{r.value=!0,setTimeout(()=>{r.value=!1},t.duration)});const s=e.computed(()=>t.placement.startsWith("top")?"translate-y--300%":"translate-y-300%");return(n,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["fixed left-0 right-0 $ui-z-max-override text-center",[{"top-0":n.placement.startsWith("top")},{"bottom-0":n.placement.startsWith("bottom")}]])},[e.createVNode(e.Transition,{"enter-from-class":s.value,"leave-to-class":s.value,onAfterLeave:c[0]||(c[0]=()=>{r.value||n.onClose?.()})},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex transition-all duration-300",style:e.normalizeStyle({justifyContent:n.placement.includes("right")?"right":n.placement.includes("left")?"left":"center"})},[e.createElementVNode("div",{class:e.normalizeClass(["m3 flex-inline items-center gap2 b-1 b-1 rounded $ui-bg-base px4 py1 shadow transition-all duration-300",[n.classes,i[n.type]]])},[e.createElementVNode("div",{class:e.normalizeClass(o[n.type])},null,2),e.createElementVNode("div",null,e.toDisplayString(n.message),1)],2)],4)):e.createCommentVNode("",!0)]),_:1},8,["enter-from-class","leave-to-class"])],2))}});function me(a){const t=document.createElement("div");t.classList.add("$ui-z-max-override","fixed"),document.body.appendChild(t);const o=a.onClose;function i(){e.render(null,t)}a.onClose=()=>{i(),o?.(),document.body.removeChild(t)};const r=e.h(_,a);e.render(r,t)}const S="__vue-devtools-theme__";function T(a={}){const t=m.useColorMode({...a,storageKey:S});return{colorMode:t,isDark:e.computed(()=>t.value==="dark")}}const fe={class:"$ui-dark-toggle-vtr"},ge=e.defineComponent({__name:"DarkToggle",props:{isDark:{type:Boolean,default:!1},animation:{type:Boolean,default:!0},animationDuration:{default:400}},setup(a){const t=a,o=m.useVModel(t,"isDark"),{colorMode:i}=T({initialValue:o.value?"dark":"light",onChanged:c=>{o.value=c==="dark"}}),r=e.computed({get:()=>i.value==="dark",set:c=>i.value=c?"dark":"light"}),s=!!document.startViewTransition&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;function n(c){if(!s||!c||!t.animation){r.value=!r.value;return}const l=c.clientX,d=c.clientY,p=Math.hypot(Math.max(l,innerWidth-l),Math.max(d,innerHeight-d));document.startViewTransition(async()=>{r.value=!r.value,await e.nextTick()}).ready.then(()=>{const g=[`circle(0px at ${l}px ${d}px)`,`circle(${p}px at ${l}px ${d}px)`];document.documentElement.animate({clipPath:r.value?[...g].reverse():g},{duration:t.animationDuration,easing:"ease-in",pseudoElement:r.value?"::view-transition-old(root)":"::view-transition-new(root)"})})}return(c,l)=>(e.openBlock(),e.createElementBlock("span",fe,[e.renderSlot(c.$slots,"default",e.normalizeProps(e.guardReactiveProps({mode:e.unref(i),isDark:r.value,toggle:n})))]))}}),ve=e.defineComponent({__name:"Drawer",props:{modelValue:{type:Boolean},mountTo:{default:"body"},placement:{default:"right"},closeOutside:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},contentClass:{},permanent:{type:Boolean,default:!1},contentBlur:{type:Boolean,default:!1},top:{},dim:{type:Boolean},blur:{type:Boolean},position:{}},emits:["update:modelValue","close"],setup(a,{emit:t}){const o=a,i=t,{height:r}=m.useElementSize(()=>typeof o.top=="string"?document.querySelector(o.top):o.top,void 0,{box:"border-box"}),s=m.useVModel(o,"modelValue",i),n={left:{class:"left-0 h-full b-r",transition:"[&_.drawer]:translate-x--100%"},right:{class:"right-0 h-full b-l",transition:"[&_.drawer]:translate-x-full"},top:{class:"w-full b-b",transition:"[&_.drawer]:translate-y--100%"},bottom:{class:"bottom-0 w-full b-t",transition:"[&_.drawer]:translate-y-100%"}};m.onKeyStroke("Escape",()=>{o.closable&&(s.value=!1)});const c=e.computed(()=>n[o.placement]),l=e.ref(!1);return e.onMounted(()=>l.value=!0),(d,p)=>l.value||d.mountTo==="body"?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:d.mountTo},[e.createVNode(e.Transition,{"enter-from-class":`${c.value.transition}`,"leave-to-class":`${c.value.transition}`},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(C,{key:0,class:e.normalizeClass({"pointer-events-none":d.permanent}),dim:d.dim,blur:d.blur,position:d.position,onClick:p[2]||(p[2]=u=>d.closeOutside&&d.closable&&(s.value=!1))},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([[c.value.class,d.contentClass??"",d.contentBlur?"$ui-glass-effect":"$ui-bg-base"],"drawer pointer-events-auto absolute min-w-25 of-auto $ui-border-base transition-transform transition-duration-300"]),style:e.normalizeStyle({top:d.placement==="bottom"?"auto":`${e.unref(r)}px`,height:["top","bottom"].includes(d.placement)?"auto":`calc(100% - ${e.unref(r)}px)`}),onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"]))},[d.closable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"i-carbon-close absolute right-1.5 top-1.5 $ui-z-max cursor-pointer p1 text-lg $ui-text",onClick:p[0]||(p[0]=u=>s.value=!1)})):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"default")],6)]),_:3},8,["class","dim","blur","position"])):e.createCommentVNode("",!0)]),_:3},8,["enter-from-class","leave-to-class"])],8,["to"])):e.createCommentVNode("",!0)}}),be={class:"overflow-hidden rounded-lg shadow-lg"},D=e.defineComponent({__name:"Dropdown",props:{label:{},buttonProps:{default:()=>({})},buttonClass:{default:""},trigger:{default:"click"},distance:{default:0},skidding:{},placement:{},disabled:{type:Boolean,default:!1},shown:{type:Boolean}},emits:["update:visible"],setup(a){const t=a;return e.provide("$ui-dropdown-disabled",e.computed(()=>t.disabled)),(o,i)=>(e.openBlock(),e.createBlock(e.unref(b.Dropdown),{disabled:o.disabled,class:"inline-block w-auto",shown:o.shown,triggers:[o.trigger],distance:o.distance+6,placement:o.placement,skidding:o.skidding,"onUpdate:shown":i[0]||(i[0]=r=>o.$emit("update:visible",r)),onClick:i[1]||(i[1]=r=>{r.stopPropagation()})},{popper:e.withCtx(({hide:r})=>[e.createElementVNode("div",be,[e.renderSlot(o.$slots,"popper",e.normalizeProps(e.guardReactiveProps({hide:r})),()=>[i[2]||(i[2]=e.createElementVNode("div",{class:"p2 opacity-40"}," Empty... ",-1))])])]),default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",{},()=>[e.createVNode(v,e.mergeProps({...o.buttonProps,disabled:o.disabled},{class:o.buttonClass}),e.createSlots({icon:e.withCtx(()=>[e.renderSlot(o.$slots,"button-icon")]),"icon-right":e.withCtx(()=>[e.renderSlot(o.$slots,"button-icon-right")]),_:2},[o.label?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),key:"0"}:void 0]),1040,["class"])])]),_:3},8,["disabled","shown","triggers","distance","placement","skidding"]))}}),he=e.defineComponent({__name:"DropdownButton",props:{type:{},round:{type:[String,Boolean]},loading:{type:Boolean},disabled:{type:Boolean},size:{},flat:{type:Boolean},outlined:{type:Boolean},keepOpen:{type:Boolean,default:!1}},setup(a){const t=a,o=e.inject("$ui-dropdown-disabled",void 0);return(i,r)=>e.withDirectives((e.openBlock(),e.createBlock(v,e.mergeProps({...t,round:!1},{disabled:e.unref(o),class:"w-full justify-start transition-colors not-action:bg-transparent!"}),{icon:e.withCtx(()=>[e.renderSlot(i.$slots,"icon")]),default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["disabled"])),[[e.unref(b.vClosePopper)]])}}),y=e.defineComponent({__name:"Icon",props:{icon:{},inline:{type:Boolean},action:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inline?"span":"div"),{class:e.normalizeClass(["$ui-base",[t.icon,t.action?"cursor-pointer hover:op50":""]])},null,8,["class"]))}}),ye=["type","placeholder","disabled"],ke={key:3,class:"pointer-events-none absolute bottom--0.25 left-50% right-50% z-9999 h-0.75 bg-primary-500 opacity-0 transition-all duration-240 group-[&.focused]:left-0 group-[&.focused]:right-0 group-[&.focused]:opacity-100 group-[&.accent.focused]:bg-accent-500"},k="transition-colors $ui-fcc color-gray-500 dark:color-gray-300 group-[&.focused]:color-primary-500; group-[&.accent.focused]:color-accent-500",x=e.defineComponent({__name:"Input",props:{modelValue:{},placeholder:{default:""},variant:{default:"normal"},disabled:{type:Boolean,default:!1},leftIcon:{},rightIcon:{},loading:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},loadingDebounceTime:{default:0},readonly:{type:Boolean,default:!1},type:{default:"text"}},emits:["update:modelValue","updateFocused","keyTab"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i),s=m.refDebounced(e.computed(()=>o.loading),o.loadingDebounceTime),n=m.refWithControl(!1,{onChanged(u){i("updateFocused",u)}}),c=e.computed(()=>o.variant==="flat"||o.variant==="warning"||o.disabled||o.readonly),l=e.computed(()=>o.disabled||s.value),d=e.ref();let p=!1;return e.watchEffect(()=>{s.value&&n.value?p=!0:!s.value&&p&&(p=!1,e.nextTick(()=>{n.value=!0}))}),e.onMounted(()=>{o.autoFocus&&(n.value=!0)}),e.watchEffect(()=>{n.value&&d.value?.focus()}),(u,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["group relative w-50 w-auto flex items-center justify-between gap-0.5 overflow-hidden b-1 rounded-1 px3 py-0.75 color-gray-800 dark:color-gray-100",[{"border-none bg-transparent group":u.variant==="flat","cursor-not-allowed opacity-50":l.value,accent:u.variant==="accent",focused:e.unref(n)},[u.variant==="warning"?"border-warning-500 dark:border-warning-300":"border-primary-100 dark:border-gray-700"]]]),onClick:g[2]||(g[2]=()=>{n.value=!0})},[u.leftIcon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(k)},[e.createVNode(y,{icon:u.leftIcon},null,8,["icon"])])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:d,"onUpdate:modelValue":g[0]||(g[0]=V=>e.isRef(r)?r.value=V:null),class:"$ui-base w-full bg-transparent color-inherit outline-none placeholder-color-gray-500 dark:placeholder-gray-300",type:u.type,placeholder:u.placeholder,disabled:l.value||u.readonly,onBlur:g[1]||(g[1]=V=>n.value=!1)},null,40,ye),[[e.vModelDynamic,e.unref(r)]]),e.unref(s)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(k)},[e.createVNode(B)])):u.rightIcon?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(k)},[e.createVNode(y,{icon:u.rightIcon},null,8,["icon"])])):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ke))],2))}}),we={class:"$ui-base"},Be=e.defineComponent({__name:"FormField",props:{modelValue:{},status:{default:"normal"},showMessage:{type:Boolean,default:!0},message:{default:""},placeholder:{}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i),s=e.ref(!1),n=e.computed(()=>o.message&&o.message.length&&o.showMessage),c={normal:"color-gray-600 dark:color-gray-400",warning:"color-warning-500 dark:color-warning-200",danger:"color-danger-500 dark:color-danger-200",success:"color-primary-700 dark:color-primary-500"},l={warning:"i-bx:bxs-error",danger:"i-ic-round-error",success:"i-ep:success-filled"};return(d,p)=>(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(x,{modelValue:e.unref(r),"onUpdate:modelValue":p[0]||(p[0]=u=>e.isRef(r)?r.value=u:null),placeholder:d.placeholder,onUpdateFocused:p[1]||(p[1]=u=>s.value=u)},null,8,["modelValue","placeholder"]),e.createElementVNode("div",{class:e.normalizeClass(["mt2 $ui-base text-3.5",[c[d.status],{"opacity-65":!s.value}]])},[d.status!=="normal"&&n.value?(e.openBlock(),e.createBlock(y,{key:0,inline:"",icon:l[d.status]},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.value?d.message:""),1)],2)]))}}),Ce=["innerHTML"],Ve=e.defineComponent({__name:"IcIcon",props:{name:{}},setup(a){const t=a,o=e.computed(()=>O.icIcons[t.name]??"");return(i,r)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createElementBlock("svg",{class:"custom-svg h-1em w-1em",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",innerHTML:o.value},null,8,Ce))]))}}),$e={class:"m1 min-w-35 w-auto flex flex-col"},Ee=["onClick"],Ne=e.defineComponent({__name:"Select",props:{modelValue:{},multiple:{default:!1},options:{},placeholder:{default:"Select..."},autoClose:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},labelRenderer:{type:Function,default:a=>String(a)},buttonProps:{default:()=>({})}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=e.useSlots(),s=e.computed({get:()=>o.modelValue,set:l=>i("update:modelValue",l)}),n=e.computed(()=>{const l=o.options.find(d=>d.value===s.value);return l?.label?o.labelRenderer(l.label):o.placeholder});function c(l){o.multiple?s.value=s.value.includes(l.value)?s.value.filter(d=>d!==l.value):[...s.value,l.value]:s.value=l.value}return(l,d)=>(e.openBlock(),e.createBlock(D,e.mergeProps({label:n.value},{buttonProps:l.buttonProps,disabled:l.disabled}),e.createSlots({popper:e.withCtx(()=>[e.createElementVNode("div",$e,[e.unref(r).item?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.options,p=>(e.openBlock(),e.createElementBlock("div",{key:p.value,class:"cursor-pointer",onClick:u=>c(p)},[e.renderSlot(l.$slots,"item",e.mergeProps({ref_for:!0},{item:p,active:l.multiple?s.value.includes(p.value):p.value===s.value,disabled:l.disabled}))],8,Ee))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.options,p=>e.withDirectives((e.openBlock(),e.createBlock(v,{key:p.value,disabled:l.disabled,round:"normal",class:e.normalizeClass(["flex-[auto_1_1] not-hover:[&:not(.active)]:bg-transparent!",{active:l.multiple?s.value.includes(p.value):p.value===s.value}]),onClick:u=>c(p)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),_:2},1032,["disabled","class","onClick"])),[[e.unref(b.vClosePopper),l.autoClose]])),128))])]),"button-icon-right":e.withCtx(()=>[d[0]||(d[0]=e.createElementVNode("div",{class:"i-mdi-chevron-down"},null,-1))]),_:2},[e.unref(r).button?{name:"default",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"button")]),key:"0"}:void 0]),1040,["label"]))}}),_e=e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean}},emits:["update:modelValue"],setup(a,{emit:t}){const o=a,i=t,r=m.useVModel(o,"modelValue",i),s=m.useToggle(r);return(n,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([[n.disabled?"cursor-not-allowed":"cursor-pointer"],"$ui-base $ui-if-sc cursor-pointer select-none gap1.25 vertical-mid text-3.5"]),role:"checkbox",onClick:c[0]||(c[0]=l=>!n.disabled&&e.unref(s)())},[e.renderSlot(n.$slots,"default"),e.createElementVNode("div",{class:e.normalizeClass([{selected:e.unref(r)},"group relative $ui-base h4 w8 rounded-2 bg-primary-100 transition-colors dark:bg-gray-700 [&.selected]:bg-primary-500!"])},[e.createElementVNode("div",{class:e.normalizeClass(["h4 w4 rounded-full bg-primary-800 transition-transform group-[&.selected]:transform-translate-x-4 dark:bg-white",[{"group-hover:opacity-75 group-active:scale-85":!n.disabled},{"opacity-65":n.disabled}]])},null,2)],2)],2))}}),Se=e.defineComponent({__name:"Tooltip",props:{trigger:{},distance:{},skidding:{},placement:{},disabled:{type:Boolean},shown:{type:Boolean}},setup(a){return(t,o)=>(e.openBlock(),e.createBlock(e.unref(b.Tooltip),e.mergeProps({disabled:t.disabled,placement:t.placement},t.$attrs),{popper:e.withCtx(()=>[e.renderSlot(t.$slots,"popper")]),default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["disabled","placement"]))}});Object.defineProperty(exports,"vTooltip",{enumerable:!0,get:()=>b.vTooltip});exports.THEME_KEY=S;exports.VueBadge=W;exports.VueButton=v;exports.VueCard=Z;exports.VueCheckbox=ee;exports.VueCodeBlock=ne;exports.VueConfirm=pe;exports.VueDarkToggle=ge;exports.VueDialog=N;exports.VueDrawer=ve;exports.VueDropdown=D;exports.VueDropdownButton=he;exports.VueFormField=Be;exports.VueIcIcon=Ve;exports.VueIcon=y;exports.VueInput=x;exports.VueLoadingIndicator=B;exports.VueNotification=_;exports.VueOverlay=C;exports.VueSelect=Ne;exports.VueSwitch=_e;exports.VueTooltip=Se;exports.showVueNotification=me;exports.useDevToolsColorMode=T;
|
package/dist/index.js
CHANGED
|
@@ -4,24 +4,24 @@ import { Dropdown as ae, vClosePopper as Y, Tooltip as re } from "floating-vue";
|
|
|
4
4
|
import { vTooltip as Bt } from "floating-vue";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import { createElementBlock as f, openBlock as u, renderSlot as v, createElementVNode as m, defineComponent as h, useAttrs as ne, computed as k, useSlots as q, createBlock as w, resolveDynamicComponent as J, mergeProps as D, withCtx as g, createCommentVNode as $, unref as b, normalizeClass as y, shallowRef as le, nextTick as
|
|
7
|
+
import { createElementBlock as f, openBlock as u, renderSlot as v, createElementVNode as m, defineComponent as h, useAttrs as ne, computed as k, useSlots as q, createBlock as w, resolveDynamicComponent as J, mergeProps as D, withCtx as g, createCommentVNode as $, unref as b, normalizeClass as y, shallowRef as le, nextTick as x, Fragment as E, renderList as R, toDisplayString as B, watchEffect as P, ref as S, onMounted as z, Teleport as X, createVNode as C, Transition as H, normalizeStyle as N, createTextVNode as _, isRef as O, h as se, render as U, normalizeProps as G, guardReactiveProps as Q, withModifiers as ie, provide as de, createSlots as Z, inject as ue, withDirectives as j, vModelDynamic as ce } from "vue";
|
|
8
8
|
import { useVModel as T, useScrollLock as pe, onKeyStroke as ee, useColorMode as me, useElementSize as fe, refDebounced as ge, refWithControl as ve, useToggle as be } from "@vueuse/core";
|
|
9
9
|
import { createHighlighterCore as ye } from "shiki/core";
|
|
10
10
|
import { createJavaScriptRegexEngine as he } from "shiki/engine/javascript";
|
|
11
11
|
import { i as ke } from "./ic-icons-data-B4q1VTSq.js";
|
|
12
|
-
const
|
|
13
|
-
const e =
|
|
12
|
+
const A = (n, t) => {
|
|
13
|
+
const e = n.__vccOpts || n;
|
|
14
14
|
for (const [s, o] of t)
|
|
15
15
|
e[s] = o;
|
|
16
16
|
return e;
|
|
17
17
|
}, we = {}, $e = { class: "mx-0.5 $ui-base inline-block select-none whitespace-nowrap rounded px-1.5 py-0.5 text-xs" };
|
|
18
|
-
function Ce(
|
|
18
|
+
function Ce(n, t) {
|
|
19
19
|
return u(), f("span", $e, [
|
|
20
|
-
v(
|
|
20
|
+
v(n.$slots, "default")
|
|
21
21
|
]);
|
|
22
22
|
}
|
|
23
|
-
const dt = /* @__PURE__ */
|
|
24
|
-
function _e(
|
|
23
|
+
const dt = /* @__PURE__ */ A(we, [["render", Ce]]), Ve = {}, Be = { class: "h-3 w-3 $ui-inline-fcc" };
|
|
24
|
+
function _e(n, t) {
|
|
25
25
|
return u(), f("div", Be, t[0] || (t[0] = [
|
|
26
26
|
m("svg", {
|
|
27
27
|
class: "animate-spin",
|
|
@@ -45,7 +45,7 @@ function _e(l, t) {
|
|
|
45
45
|
], -1)
|
|
46
46
|
]));
|
|
47
47
|
}
|
|
48
|
-
const te = /* @__PURE__ */
|
|
48
|
+
const te = /* @__PURE__ */ A(Ve, [["render", _e]]), Te = { key: 2 }, M = /* @__PURE__ */ h({
|
|
49
49
|
inheritAttrs: !1,
|
|
50
50
|
__name: "Button",
|
|
51
51
|
props: {
|
|
@@ -58,16 +58,16 @@ const te = /* @__PURE__ */ O(Ve, [["render", _e]]), Te = { key: 2 }, M = /* @__P
|
|
|
58
58
|
outlined: { type: Boolean, default: !1 }
|
|
59
59
|
},
|
|
60
60
|
emits: ["click"],
|
|
61
|
-
setup(
|
|
62
|
-
const e =
|
|
61
|
+
setup(n, { emit: t }) {
|
|
62
|
+
const e = n, s = t, o = ne(), l = k(() => o.to ? "router-link" : o.href ? "a" : "button"), a = k(() => e.loading || e.disabled);
|
|
63
63
|
function d(c) {
|
|
64
|
-
if (
|
|
64
|
+
if (a.value) {
|
|
65
65
|
c.preventDefault(), c.stopPropagation(), c.stopImmediatePropagation();
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
s("click", c);
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const r = {
|
|
71
71
|
common: {
|
|
72
72
|
default: "active:bg-primary-100-darker dark:active:bg-gray-800-darker",
|
|
73
73
|
primary: "active:bg-primary-500-darker",
|
|
@@ -104,16 +104,16 @@ const te = /* @__PURE__ */ O(Ve, [["render", _e]]), Te = { key: 2 }, M = /* @__P
|
|
|
104
104
|
info: "hover:border-info-500 hover:text-info-500 active:ring-info-500:5 active:bg-info-500:5",
|
|
105
105
|
success: "hover:border-primary-500 hover:text-primary-500 active:ring-primary-500:5 active:bg-primary-500:5"
|
|
106
106
|
}
|
|
107
|
-
}, i = q(), p = k(() => e.flat ?
|
|
108
|
-
return (c, V) => (u(), w(J(
|
|
107
|
+
}, i = q(), p = k(() => e.flat ? r.flat[e.type] : e.outlined ? r.outlined[e.type] : r.normal[e.type]);
|
|
108
|
+
return (c, V) => (u(), w(J(l.value), D(c.$attrs, {
|
|
109
109
|
role: "button",
|
|
110
|
-
"aria-disabled":
|
|
110
|
+
"aria-disabled": a.value,
|
|
111
111
|
class: ["$ui-base $ui-inline-fcc inline-flex cursor-pointer select-none gap1.25 py-0 no-underline $ui-transition", [
|
|
112
|
-
[
|
|
112
|
+
[r.common[e.type]],
|
|
113
113
|
{
|
|
114
114
|
"rounded-full": e.round === "full",
|
|
115
115
|
"$ui-base-br": e.round === "normal",
|
|
116
|
-
"opacity-50 cursor-not-allowed":
|
|
116
|
+
"opacity-50 cursor-not-allowed": a.value,
|
|
117
117
|
"bg-transparent": e.flat || e.outlined
|
|
118
118
|
},
|
|
119
119
|
[
|
|
@@ -141,25 +141,25 @@ const te = /* @__PURE__ */ O(Ve, [["render", _e]]), Te = { key: 2 }, M = /* @__P
|
|
|
141
141
|
}, 16, ["aria-disabled", "class"]));
|
|
142
142
|
}
|
|
143
143
|
}), De = {}, Me = { class: "$ui-base border $ui-border-base rounded shadow-sm" };
|
|
144
|
-
function Se(
|
|
144
|
+
function Se(n, t) {
|
|
145
145
|
return u(), f("div", Me, [
|
|
146
|
-
v(
|
|
146
|
+
v(n.$slots, "default")
|
|
147
147
|
]);
|
|
148
148
|
}
|
|
149
|
-
const ut = /* @__PURE__ */
|
|
149
|
+
const ut = /* @__PURE__ */ A(De, [["render", Se]]), ct = /* @__PURE__ */ h({
|
|
150
150
|
__name: "Checkbox",
|
|
151
151
|
props: {
|
|
152
152
|
modelValue: { type: Boolean },
|
|
153
153
|
variant: { default: "normal" }
|
|
154
154
|
},
|
|
155
155
|
emits: ["update:modelValue"],
|
|
156
|
-
setup(
|
|
157
|
-
const o = T(
|
|
158
|
-
return (
|
|
156
|
+
setup(n, { emit: t }) {
|
|
157
|
+
const o = T(n, "modelValue", t);
|
|
158
|
+
return (l, a) => (u(), f("div", {
|
|
159
159
|
class: y(["relative $ui-base h5 w5 $ui-inline-fcc cursor-pointer border-0.125rem rounded-1.25 transition-colors duration-200 ease-in-out", [
|
|
160
|
-
b(o) ?
|
|
160
|
+
b(o) ? l.variant === "normal" ? "bg-primary-500 border-primary-200 dark:border-primary-100" : "bg-accent-500 border-accent-200 dark:border-accent-100" : ""
|
|
161
161
|
]]),
|
|
162
|
-
onClick:
|
|
162
|
+
onClick: a[0] || (a[0] = (d) => o.value = !b(o))
|
|
163
163
|
}, [
|
|
164
164
|
m("div", {
|
|
165
165
|
class: y([[
|
|
@@ -170,10 +170,9 @@ const ut = /* @__PURE__ */ O(De, [["render", Se]]), ct = /* @__PURE__ */ h({
|
|
|
170
170
|
}
|
|
171
171
|
}), I = le();
|
|
172
172
|
let K = null;
|
|
173
|
-
function Ie(
|
|
174
|
-
var s;
|
|
173
|
+
function Ie(n, t = "text") {
|
|
175
174
|
if (!K && !I.value) {
|
|
176
|
-
const
|
|
175
|
+
const s = he();
|
|
177
176
|
K = ye({
|
|
178
177
|
themes: [
|
|
179
178
|
import("shiki/themes/vitesse-dark.mjs"),
|
|
@@ -191,14 +190,14 @@ function Ie(l, t = "text") {
|
|
|
191
190
|
import("shiki/langs/diff.mjs"),
|
|
192
191
|
import("shiki/langs/shellscript.mjs")
|
|
193
192
|
],
|
|
194
|
-
engine:
|
|
195
|
-
}).then((
|
|
196
|
-
I.value =
|
|
193
|
+
engine: s
|
|
194
|
+
}).then((o) => {
|
|
195
|
+
I.value = o;
|
|
197
196
|
});
|
|
198
197
|
}
|
|
199
|
-
const e =
|
|
198
|
+
const e = I.value?.getLoadedLanguages().includes(t);
|
|
200
199
|
return e ? {
|
|
201
|
-
code: I.value.codeToHtml(
|
|
200
|
+
code: I.value.codeToHtml(n, {
|
|
202
201
|
lang: t,
|
|
203
202
|
themes: {
|
|
204
203
|
dark: "vitesse-dark",
|
|
@@ -207,7 +206,7 @@ function Ie(l, t = "text") {
|
|
|
207
206
|
}),
|
|
208
207
|
supported: !0
|
|
209
208
|
} : {
|
|
210
|
-
code:
|
|
209
|
+
code: n,
|
|
211
210
|
supported: e
|
|
212
211
|
};
|
|
213
212
|
}
|
|
@@ -220,28 +219,28 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
220
219
|
transformRendered: {}
|
|
221
220
|
},
|
|
222
221
|
emits: ["loaded"],
|
|
223
|
-
setup(
|
|
224
|
-
const e =
|
|
225
|
-
const
|
|
226
|
-
return
|
|
222
|
+
setup(n, { emit: t }) {
|
|
223
|
+
const e = n, s = t, o = k(() => {
|
|
224
|
+
const l = e.lang === "text" ? { code: e.code, supported: !1 } : Ie(e.code, e.lang) || { code: e.code, supported: !1 };
|
|
225
|
+
return l.supported && e.transformRendered && (l.code = e.transformRendered(l.code)), l.supported && x(() => s("loaded")), l;
|
|
227
226
|
});
|
|
228
|
-
return (
|
|
227
|
+
return (l, a) => l.lang && o.value.supported ? (u(), f("pre", {
|
|
229
228
|
key: 0,
|
|
230
|
-
class: y(["code-block",
|
|
229
|
+
class: y(["code-block", l.lines ? "code-block-lines" : ""]),
|
|
231
230
|
innerHTML: o.value.code
|
|
232
231
|
}, null, 10, Ee)) : (u(), f("pre", {
|
|
233
232
|
key: 1,
|
|
234
|
-
class: y(["code-block",
|
|
233
|
+
class: y(["code-block", l.lines ? "code-block-lines" : ""])
|
|
235
234
|
}, [
|
|
236
235
|
m("pre", Pe, [
|
|
237
236
|
m("code", null, [
|
|
238
|
-
(u(!0), f(E, null, R(
|
|
239
|
-
`), (d,
|
|
237
|
+
(u(!0), f(E, null, R(l.code.split(`
|
|
238
|
+
`), (d, r) => (u(), f(E, { key: r }, [
|
|
240
239
|
m("span", {
|
|
241
240
|
class: "line",
|
|
242
241
|
textContent: B(d)
|
|
243
242
|
}, null, 8, ze),
|
|
244
|
-
|
|
243
|
+
a[0] || (a[0] = m("br", null, null, -1))
|
|
245
244
|
], 64))), 128))
|
|
246
245
|
])
|
|
247
246
|
])
|
|
@@ -254,9 +253,9 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
254
253
|
blur: { type: Boolean },
|
|
255
254
|
position: { default: "fixed" }
|
|
256
255
|
},
|
|
257
|
-
setup(
|
|
256
|
+
setup(n) {
|
|
258
257
|
return (t, e) => (u(), f("div", {
|
|
259
|
-
class: y(["left-0 top-0 $ui-z-max h-full w-full $ui-fcc transition-opacity transition-duration-300
|
|
258
|
+
class: y(["left-0 top-0 $ui-z-max h-full w-full $ui-fcc $ui-bg-base transition-opacity transition-duration-300", [
|
|
260
259
|
t.dim ? "bg-opacity-50!" : "bg-opacity-0!",
|
|
261
260
|
t.blur ? "backdrop-blur-sm" : "",
|
|
262
261
|
t.position
|
|
@@ -265,7 +264,7 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
265
264
|
v(t.$slots, "default")
|
|
266
265
|
], 2));
|
|
267
266
|
}
|
|
268
|
-
}), Le = { class: "h7.5 w-full $ui-fbc" }, Re = { class: "text-4.5" }, Fe = { class: "content transition-all transition-duration-300" },
|
|
267
|
+
}), Le = { class: "h7.5 w-full $ui-fbc" }, Re = { class: "text-4.5" }, Fe = { class: "content transition-all transition-duration-300" }, xe = { class: "footer h8 w-full transition-all transition-duration-300 delay-250" }, He = { class: "$ui-fcc" }, Ne = /* @__PURE__ */ h({
|
|
269
268
|
__name: "Dialog",
|
|
270
269
|
props: {
|
|
271
270
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -280,23 +279,23 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
280
279
|
position: {}
|
|
281
280
|
},
|
|
282
281
|
emits: ["close", "update:modelValue"],
|
|
283
|
-
setup(
|
|
284
|
-
const e =
|
|
282
|
+
setup(n, { emit: t }) {
|
|
283
|
+
const e = n, o = T(e, "modelValue", t, { passive: !0 }), l = pe(() => window.document.documentElement);
|
|
285
284
|
P(() => {
|
|
286
|
-
o.value ?
|
|
285
|
+
o.value ? l.value = !0 : l.value = !1;
|
|
287
286
|
});
|
|
288
|
-
function
|
|
287
|
+
function a() {
|
|
289
288
|
o.value && e.autoClose && (o.value = !1);
|
|
290
289
|
}
|
|
291
290
|
ee("Escape", () => {
|
|
292
|
-
|
|
291
|
+
a();
|
|
293
292
|
});
|
|
294
293
|
const d = S(!1);
|
|
295
|
-
return z(() => d.value = !0), (
|
|
294
|
+
return z(() => d.value = !0), (r, i) => d.value || r.mountTo === "body" ? (u(), w(X, {
|
|
296
295
|
key: 0,
|
|
297
|
-
to:
|
|
296
|
+
to: r.mountTo
|
|
298
297
|
}, [
|
|
299
|
-
C(
|
|
298
|
+
C(H, {
|
|
300
299
|
"enter-from-class": "opacity-0 [&_.modal]:scale-95 [&_.content,&_.footer]:translate-y--2.5 [&_.content,&_.footer]:opacity-0",
|
|
301
300
|
"enter-to-class": "opacity-100 [&_.modal]:scale-100",
|
|
302
301
|
"leave-from-class": "opacity-100 [&_.modal]:scale-100",
|
|
@@ -305,47 +304,48 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
305
304
|
default: g(() => [
|
|
306
305
|
b(o) ? (u(), w(oe, {
|
|
307
306
|
key: 0,
|
|
308
|
-
dim:
|
|
309
|
-
blur:
|
|
310
|
-
position:
|
|
307
|
+
dim: r.dim,
|
|
308
|
+
blur: r.blur,
|
|
309
|
+
position: r.position
|
|
311
310
|
}, {
|
|
312
311
|
default: g(() => [
|
|
313
312
|
m("div", {
|
|
314
313
|
class: "modal relative grid grid-rows-[1.875rem_1fr_2.5rem] $ui-base max-h-[calc(100vh-6.25rem)] max-w-[calc(100vw-6.25rem)] min-h-6.25rem min-w-12.5rem gap-2.5 rounded-md bg-white px6 py4.5 color-gray-800 shadow-2xl transition-transform transition-duration-300 dark:bg-gray-900 dark:color-gray-200",
|
|
315
|
-
style:
|
|
314
|
+
style: N({
|
|
316
315
|
width: e.width,
|
|
317
316
|
height: e.height
|
|
318
317
|
})
|
|
319
318
|
}, [
|
|
320
319
|
m("div", Le, [
|
|
321
320
|
m("div", Re, [
|
|
322
|
-
v(
|
|
321
|
+
v(r.$slots, "title", {}, () => [
|
|
323
322
|
_(B(e.title), 1)
|
|
324
323
|
])
|
|
325
324
|
]),
|
|
326
|
-
|
|
325
|
+
r.closable ? (u(), f("div", {
|
|
327
326
|
key: 0,
|
|
328
327
|
class: "h6 w6 $ui-fcc cursor-pointer rounded-full transition-colors hover:bg-primary-100 dark:hover:bg-gray-700",
|
|
329
|
-
onClick:
|
|
328
|
+
onClick: a
|
|
330
329
|
}, i[0] || (i[0] = [
|
|
331
330
|
m("div", { class: "i-carbon-close" }, null, -1)
|
|
332
331
|
]))) : $("", !0)
|
|
333
332
|
]),
|
|
334
333
|
m("div", Fe, [
|
|
335
|
-
v(
|
|
334
|
+
v(r.$slots, "default")
|
|
336
335
|
]),
|
|
337
|
-
m("div",
|
|
338
|
-
v(
|
|
339
|
-
v(
|
|
340
|
-
m("div",
|
|
336
|
+
m("div", xe, [
|
|
337
|
+
v(r.$slots, "footer", {}, () => [
|
|
338
|
+
v(r.$slots, "footer", {}, () => [
|
|
339
|
+
m("div", He, [
|
|
341
340
|
C(M, {
|
|
342
341
|
type: "primary",
|
|
343
|
-
onClick:
|
|
342
|
+
onClick: a
|
|
344
343
|
}, {
|
|
345
344
|
default: g(() => i[1] || (i[1] = [
|
|
346
|
-
_(" close ")
|
|
345
|
+
_(" close ", -1)
|
|
347
346
|
])),
|
|
348
|
-
_: 1
|
|
347
|
+
_: 1,
|
|
348
|
+
__: [1]
|
|
349
349
|
})
|
|
350
350
|
])
|
|
351
351
|
])
|
|
@@ -360,7 +360,7 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
360
360
|
})
|
|
361
361
|
], 8, ["to"])) : $("", !0);
|
|
362
362
|
}
|
|
363
|
-
}),
|
|
363
|
+
}), Oe = { class: "$ui-fec gap2.5" }, mt = /* @__PURE__ */ h({
|
|
364
364
|
__name: "Confirm",
|
|
365
365
|
props: {
|
|
366
366
|
modelValue: { type: Boolean },
|
|
@@ -374,57 +374,57 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
374
374
|
autoClose: { type: Boolean, default: !0 }
|
|
375
375
|
},
|
|
376
376
|
emits: ["update:modelValue", "confirm", "cancel", "close"],
|
|
377
|
-
setup(
|
|
378
|
-
const e =
|
|
377
|
+
setup(n, { emit: t }) {
|
|
378
|
+
const e = n, s = t, o = T(e, "modelValue", s);
|
|
379
379
|
P(() => {
|
|
380
380
|
o.value || s("close");
|
|
381
381
|
});
|
|
382
|
-
function
|
|
383
|
-
(e.autoClose ||
|
|
382
|
+
function l(a = !1) {
|
|
383
|
+
(e.autoClose || a) && (o.value = !1);
|
|
384
384
|
}
|
|
385
|
-
return (
|
|
385
|
+
return (a, d) => (u(), w(Ne, {
|
|
386
386
|
modelValue: b(o),
|
|
387
|
-
"onUpdate:modelValue": d[2] || (d[2] = (
|
|
388
|
-
width:
|
|
389
|
-
height:
|
|
390
|
-
title:
|
|
387
|
+
"onUpdate:modelValue": d[2] || (d[2] = (r) => O(o) ? o.value = r : null),
|
|
388
|
+
width: a.width,
|
|
389
|
+
height: a.height,
|
|
390
|
+
title: a.title,
|
|
391
391
|
closable: !1
|
|
392
392
|
}, {
|
|
393
393
|
footer: g(() => [
|
|
394
|
-
m("div",
|
|
394
|
+
m("div", Oe, [
|
|
395
395
|
C(M, {
|
|
396
396
|
onClick: d[0] || (d[0] = () => {
|
|
397
|
-
s("cancel"),
|
|
397
|
+
s("cancel"), l(!0);
|
|
398
398
|
})
|
|
399
399
|
}, {
|
|
400
400
|
default: g(() => [
|
|
401
|
-
_(B(
|
|
401
|
+
_(B(a.cancelText), 1)
|
|
402
402
|
]),
|
|
403
403
|
_: 1
|
|
404
404
|
}),
|
|
405
405
|
C(M, {
|
|
406
|
-
loading:
|
|
406
|
+
loading: a.loading,
|
|
407
407
|
type: "primary",
|
|
408
408
|
onClick: d[1] || (d[1] = () => {
|
|
409
|
-
s("confirm"),
|
|
409
|
+
s("confirm"), l();
|
|
410
410
|
})
|
|
411
411
|
}, {
|
|
412
412
|
default: g(() => [
|
|
413
|
-
_(B(
|
|
413
|
+
_(B(a.confirmText), 1)
|
|
414
414
|
]),
|
|
415
415
|
_: 1
|
|
416
416
|
}, 8, ["loading"])
|
|
417
417
|
])
|
|
418
418
|
]),
|
|
419
419
|
default: g(() => [
|
|
420
|
-
v(
|
|
421
|
-
_(B(
|
|
420
|
+
v(a.$slots, "default", { class: "h-auto w-auto" }, () => [
|
|
421
|
+
_(B(a.content), 1)
|
|
422
422
|
])
|
|
423
423
|
]),
|
|
424
424
|
_: 3
|
|
425
425
|
}, 8, ["modelValue", "width", "height", "title"]));
|
|
426
426
|
}
|
|
427
|
-
}),
|
|
427
|
+
}), je = /* @__PURE__ */ h({
|
|
428
428
|
__name: "Notification",
|
|
429
429
|
props: {
|
|
430
430
|
message: {},
|
|
@@ -434,8 +434,8 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
434
434
|
placement: { default: "top-center" },
|
|
435
435
|
onClose: {}
|
|
436
436
|
},
|
|
437
|
-
setup(
|
|
438
|
-
const t =
|
|
437
|
+
setup(n) {
|
|
438
|
+
const t = n, e = {
|
|
439
439
|
success: "i-carbon-checkmark",
|
|
440
440
|
info: "i-material-symbols-light-info",
|
|
441
441
|
warning: "i-carbon-warning",
|
|
@@ -451,34 +451,33 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
451
451
|
o.value = !1;
|
|
452
452
|
}, t.duration);
|
|
453
453
|
});
|
|
454
|
-
const
|
|
455
|
-
return (
|
|
454
|
+
const l = k(() => t.placement.startsWith("top") ? "translate-y--300%" : "translate-y-300%");
|
|
455
|
+
return (a, d) => (u(), f("div", {
|
|
456
456
|
class: y(["fixed left-0 right-0 $ui-z-max-override text-center", [
|
|
457
|
-
{ "top-0":
|
|
458
|
-
{ "bottom-0":
|
|
457
|
+
{ "top-0": a.placement.startsWith("top") },
|
|
458
|
+
{ "bottom-0": a.placement.startsWith("bottom") }
|
|
459
459
|
]])
|
|
460
460
|
}, [
|
|
461
|
-
C(
|
|
462
|
-
"enter-from-class":
|
|
463
|
-
"leave-to-class":
|
|
461
|
+
C(H, {
|
|
462
|
+
"enter-from-class": l.value,
|
|
463
|
+
"leave-to-class": l.value,
|
|
464
464
|
onAfterLeave: d[0] || (d[0] = () => {
|
|
465
|
-
|
|
466
|
-
o.value || (a = r.onClose) == null || a.call(r);
|
|
465
|
+
o.value || a.onClose?.();
|
|
467
466
|
})
|
|
468
467
|
}, {
|
|
469
468
|
default: g(() => [
|
|
470
469
|
o.value ? (u(), f("div", {
|
|
471
470
|
key: 0,
|
|
472
471
|
class: "flex transition-all duration-300",
|
|
473
|
-
style:
|
|
472
|
+
style: N({ justifyContent: a.placement.includes("right") ? "right" : a.placement.includes("left") ? "left" : "center" })
|
|
474
473
|
}, [
|
|
475
474
|
m("div", {
|
|
476
|
-
class: y(["m3 flex-inline items-center gap2 b-1 b-1 rounded px4 py1 shadow transition-all duration-300
|
|
475
|
+
class: y(["m3 flex-inline items-center gap2 b-1 b-1 rounded $ui-bg-base px4 py1 shadow transition-all duration-300", [a.classes, s[a.type]]])
|
|
477
476
|
}, [
|
|
478
477
|
m("div", {
|
|
479
|
-
class: y(e[
|
|
478
|
+
class: y(e[a.type])
|
|
480
479
|
}, null, 2),
|
|
481
|
-
m("div", null, B(
|
|
480
|
+
m("div", null, B(a.message), 1)
|
|
482
481
|
], 2)
|
|
483
482
|
], 4)) : $("", !0)
|
|
484
483
|
]),
|
|
@@ -487,24 +486,24 @@ const Ee = ["innerHTML"], Pe = { class: "shiki" }, ze = ["textContent"], pt = /*
|
|
|
487
486
|
], 2));
|
|
488
487
|
}
|
|
489
488
|
});
|
|
490
|
-
function ft(
|
|
489
|
+
function ft(n) {
|
|
491
490
|
const t = document.createElement("div");
|
|
492
491
|
t.classList.add("$ui-z-max-override", "fixed"), document.body.appendChild(t);
|
|
493
|
-
const e =
|
|
492
|
+
const e = n.onClose;
|
|
494
493
|
function s() {
|
|
495
494
|
U(null, t);
|
|
496
495
|
}
|
|
497
|
-
|
|
498
|
-
s(), e
|
|
496
|
+
n.onClose = () => {
|
|
497
|
+
s(), e?.(), document.body.removeChild(t);
|
|
499
498
|
};
|
|
500
|
-
const o = se(
|
|
499
|
+
const o = se(je, n);
|
|
501
500
|
U(o, t);
|
|
502
501
|
}
|
|
503
|
-
const
|
|
504
|
-
function We(
|
|
502
|
+
const Ae = "__vue-devtools-theme__";
|
|
503
|
+
function We(n = {}) {
|
|
505
504
|
const t = me({
|
|
506
|
-
...
|
|
507
|
-
storageKey:
|
|
505
|
+
...n,
|
|
506
|
+
storageKey: Ae
|
|
508
507
|
});
|
|
509
508
|
return {
|
|
510
509
|
colorMode: t,
|
|
@@ -518,8 +517,8 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
518
517
|
animation: { type: Boolean, default: !0 },
|
|
519
518
|
animationDuration: { default: 400 }
|
|
520
519
|
},
|
|
521
|
-
setup(
|
|
522
|
-
const t =
|
|
520
|
+
setup(n) {
|
|
521
|
+
const t = n, e = T(t, "isDark"), { colorMode: s } = We({
|
|
523
522
|
initialValue: e.value ? "dark" : "light",
|
|
524
523
|
onChanged: (d) => {
|
|
525
524
|
e.value = d === "dark";
|
|
@@ -527,22 +526,22 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
527
526
|
}), o = k({
|
|
528
527
|
get: () => s.value === "dark",
|
|
529
528
|
set: (d) => s.value = d ? "dark" : "light"
|
|
530
|
-
}),
|
|
531
|
-
function
|
|
532
|
-
if (!
|
|
529
|
+
}), l = !!document.startViewTransition && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
530
|
+
function a(d) {
|
|
531
|
+
if (!l || !d || !t.animation) {
|
|
533
532
|
o.value = !o.value;
|
|
534
533
|
return;
|
|
535
534
|
}
|
|
536
|
-
const
|
|
537
|
-
Math.max(
|
|
535
|
+
const r = d.clientX, i = d.clientY, p = Math.hypot(
|
|
536
|
+
Math.max(r, innerWidth - r),
|
|
538
537
|
Math.max(i, innerHeight - i)
|
|
539
538
|
);
|
|
540
539
|
document.startViewTransition(async () => {
|
|
541
|
-
o.value = !o.value, await
|
|
540
|
+
o.value = !o.value, await x();
|
|
542
541
|
}).ready.then(() => {
|
|
543
542
|
const V = [
|
|
544
|
-
`circle(0px at ${
|
|
545
|
-
`circle(${p}px at ${
|
|
543
|
+
`circle(0px at ${r}px ${i}px)`,
|
|
544
|
+
`circle(${p}px at ${r}px ${i}px)`
|
|
546
545
|
];
|
|
547
546
|
document.documentElement.animate(
|
|
548
547
|
{
|
|
@@ -556,8 +555,8 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
556
555
|
);
|
|
557
556
|
});
|
|
558
557
|
}
|
|
559
|
-
return (d,
|
|
560
|
-
v(d.$slots, "default", G(Q({ mode: b(s), isDark: o.value, toggle:
|
|
558
|
+
return (d, r) => (u(), f("span", Ue, [
|
|
559
|
+
v(d.$slots, "default", G(Q({ mode: b(s), isDark: o.value, toggle: a })))
|
|
561
560
|
]));
|
|
562
561
|
}
|
|
563
562
|
}), vt = /* @__PURE__ */ h({
|
|
@@ -577,8 +576,8 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
577
576
|
position: {}
|
|
578
577
|
},
|
|
579
578
|
emits: ["update:modelValue", "close"],
|
|
580
|
-
setup(
|
|
581
|
-
const e =
|
|
579
|
+
setup(n, { emit: t }) {
|
|
580
|
+
const e = n, s = t, { height: o } = fe(() => typeof e.top == "string" ? document.querySelector(e.top) : e.top, void 0, { box: "border-box" }), l = T(e, "modelValue", s), a = {
|
|
582
581
|
left: {
|
|
583
582
|
class: "left-0 h-full b-r",
|
|
584
583
|
transition: "[&_.drawer]:translate-x--100%"
|
|
@@ -597,19 +596,19 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
597
596
|
}
|
|
598
597
|
};
|
|
599
598
|
ee("Escape", () => {
|
|
600
|
-
e.closable && (
|
|
599
|
+
e.closable && (l.value = !1);
|
|
601
600
|
});
|
|
602
|
-
const d = k(() =>
|
|
603
|
-
return z(() =>
|
|
601
|
+
const d = k(() => a[e.placement]), r = S(!1);
|
|
602
|
+
return z(() => r.value = !0), (i, p) => r.value || i.mountTo === "body" ? (u(), w(X, {
|
|
604
603
|
key: 0,
|
|
605
604
|
to: i.mountTo
|
|
606
605
|
}, [
|
|
607
|
-
C(
|
|
606
|
+
C(H, {
|
|
608
607
|
"enter-from-class": `${d.value.transition}`,
|
|
609
608
|
"leave-to-class": `${d.value.transition}`
|
|
610
609
|
}, {
|
|
611
610
|
default: g(() => [
|
|
612
|
-
b(
|
|
611
|
+
b(l) ? (u(), w(oe, {
|
|
613
612
|
key: 0,
|
|
614
613
|
class: y({
|
|
615
614
|
"pointer-events-none": i.permanent
|
|
@@ -617,12 +616,12 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
617
616
|
dim: i.dim,
|
|
618
617
|
blur: i.blur,
|
|
619
618
|
position: i.position,
|
|
620
|
-
onClick: p[2] || (p[2] = (c) => i.closeOutside && i.closable && (
|
|
619
|
+
onClick: p[2] || (p[2] = (c) => i.closeOutside && i.closable && (l.value = !1))
|
|
621
620
|
}, {
|
|
622
621
|
default: g(() => [
|
|
623
622
|
m("div", {
|
|
624
623
|
class: y([[d.value.class, i.contentClass ?? "", i.contentBlur ? "$ui-glass-effect" : "$ui-bg-base"], "drawer pointer-events-auto absolute min-w-25 of-auto $ui-border-base transition-transform transition-duration-300"]),
|
|
625
|
-
style:
|
|
624
|
+
style: N({
|
|
626
625
|
top: i.placement === "bottom" ? "auto" : `${b(o)}px`,
|
|
627
626
|
height: ["top", "bottom"].includes(i.placement) ? "auto" : `calc(100% - ${b(o)}px)`
|
|
628
627
|
}),
|
|
@@ -632,7 +631,7 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
632
631
|
i.closable ? (u(), f("div", {
|
|
633
632
|
key: 0,
|
|
634
633
|
class: "i-carbon-close absolute right-1.5 top-1.5 $ui-z-max cursor-pointer p1 text-lg $ui-text",
|
|
635
|
-
onClick: p[0] || (p[0] = (c) =>
|
|
634
|
+
onClick: p[0] || (p[0] = (c) => l.value = !1)
|
|
636
635
|
})) : $("", !0),
|
|
637
636
|
v(i.$slots, "default")
|
|
638
637
|
], 6)
|
|
@@ -658,8 +657,8 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
658
657
|
shown: { type: Boolean }
|
|
659
658
|
},
|
|
660
659
|
emits: ["update:visible"],
|
|
661
|
-
setup(
|
|
662
|
-
const t =
|
|
660
|
+
setup(n) {
|
|
661
|
+
const t = n;
|
|
663
662
|
return de("$ui-dropdown-disabled", k(() => t.disabled)), (e, s) => (u(), w(b(ae), {
|
|
664
663
|
disabled: e.disabled,
|
|
665
664
|
class: "inline-block w-auto",
|
|
@@ -719,9 +718,9 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
719
718
|
outlined: { type: Boolean },
|
|
720
719
|
keepOpen: { type: Boolean, default: !1 }
|
|
721
720
|
},
|
|
722
|
-
setup(
|
|
723
|
-
const t =
|
|
724
|
-
return (s, o) =>
|
|
721
|
+
setup(n) {
|
|
722
|
+
const t = n, e = ue("$ui-dropdown-disabled", void 0);
|
|
723
|
+
return (s, o) => j((u(), w(M, D({
|
|
725
724
|
...t,
|
|
726
725
|
round: !1
|
|
727
726
|
}, {
|
|
@@ -746,7 +745,7 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
746
745
|
inline: { type: Boolean },
|
|
747
746
|
action: { type: Boolean, default: !1 }
|
|
748
747
|
},
|
|
749
|
-
setup(
|
|
748
|
+
setup(n) {
|
|
750
749
|
return (t, e) => (u(), w(J(t.inline ? "span" : "div"), {
|
|
751
750
|
class: y(["$ui-base", [t.icon, t.action ? "cursor-pointer hover:op50" : ""]])
|
|
752
751
|
}, null, 8, ["class"]));
|
|
@@ -770,36 +769,35 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
770
769
|
type: { default: "text" }
|
|
771
770
|
},
|
|
772
771
|
emits: ["update:modelValue", "updateFocused", "keyTab"],
|
|
773
|
-
setup(
|
|
774
|
-
const e =
|
|
772
|
+
setup(n, { emit: t }) {
|
|
773
|
+
const e = n, s = t, o = T(e, "modelValue", s), l = ge(k(() => e.loading), e.loadingDebounceTime), a = ve(!1, {
|
|
775
774
|
onChanged(c) {
|
|
776
775
|
s("updateFocused", c);
|
|
777
776
|
}
|
|
778
|
-
}), d = k(() => e.variant === "flat" || e.variant === "warning" || e.disabled || e.readonly),
|
|
777
|
+
}), d = k(() => e.variant === "flat" || e.variant === "warning" || e.disabled || e.readonly), r = k(() => e.disabled || l.value), i = S();
|
|
779
778
|
let p = !1;
|
|
780
779
|
return P(() => {
|
|
781
|
-
|
|
782
|
-
|
|
780
|
+
l.value && a.value ? p = !0 : !l.value && p && (p = !1, x(() => {
|
|
781
|
+
a.value = !0;
|
|
783
782
|
}));
|
|
784
783
|
}), z(() => {
|
|
785
|
-
e.autoFocus && (
|
|
784
|
+
e.autoFocus && (a.value = !0);
|
|
786
785
|
}), P(() => {
|
|
787
|
-
|
|
788
|
-
r.value && ((c = i.value) == null || c.focus());
|
|
786
|
+
a.value && i.value?.focus();
|
|
789
787
|
}), (c, V) => (u(), f("div", {
|
|
790
788
|
class: y(["group relative w-50 w-auto flex items-center justify-between gap-0.5 overflow-hidden b-1 rounded-1 px3 py-0.75 color-gray-800 dark:color-gray-100", [
|
|
791
789
|
{
|
|
792
790
|
"border-none bg-transparent group": c.variant === "flat",
|
|
793
|
-
"cursor-not-allowed opacity-50":
|
|
791
|
+
"cursor-not-allowed opacity-50": r.value,
|
|
794
792
|
accent: c.variant === "accent",
|
|
795
|
-
focused: b(
|
|
793
|
+
focused: b(a)
|
|
796
794
|
},
|
|
797
795
|
[
|
|
798
796
|
c.variant === "warning" ? "border-warning-500 dark:border-warning-300" : "border-primary-100 dark:border-gray-700"
|
|
799
797
|
]
|
|
800
798
|
]]),
|
|
801
799
|
onClick: V[2] || (V[2] = () => {
|
|
802
|
-
|
|
800
|
+
a.value = !0;
|
|
803
801
|
})
|
|
804
802
|
}, [
|
|
805
803
|
c.leftIcon ? (u(), f("div", {
|
|
@@ -808,19 +806,19 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
808
806
|
}, [
|
|
809
807
|
C(F, { icon: c.leftIcon }, null, 8, ["icon"])
|
|
810
808
|
])) : $("", !0),
|
|
811
|
-
|
|
809
|
+
j(m("input", {
|
|
812
810
|
ref_key: "inputRef",
|
|
813
811
|
ref: i,
|
|
814
|
-
"onUpdate:modelValue": V[0] || (V[0] = (W) =>
|
|
812
|
+
"onUpdate:modelValue": V[0] || (V[0] = (W) => O(o) ? o.value = W : null),
|
|
815
813
|
class: "$ui-base w-full bg-transparent color-inherit outline-none placeholder-color-gray-500 dark:placeholder-gray-300",
|
|
816
814
|
type: c.type,
|
|
817
815
|
placeholder: c.placeholder,
|
|
818
|
-
disabled:
|
|
819
|
-
onBlur: V[1] || (V[1] = (W) =>
|
|
816
|
+
disabled: r.value || c.readonly,
|
|
817
|
+
onBlur: V[1] || (V[1] = (W) => a.value = !1)
|
|
820
818
|
}, null, 40, qe), [
|
|
821
819
|
[ce, b(o)]
|
|
822
820
|
]),
|
|
823
|
-
b(
|
|
821
|
+
b(l) ? (u(), f("div", {
|
|
824
822
|
key: 1,
|
|
825
823
|
class: y(L)
|
|
826
824
|
}, [
|
|
@@ -844,13 +842,13 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
844
842
|
placeholder: {}
|
|
845
843
|
},
|
|
846
844
|
emits: ["update:modelValue"],
|
|
847
|
-
setup(
|
|
848
|
-
const e =
|
|
845
|
+
setup(n, { emit: t }) {
|
|
846
|
+
const e = n, o = T(e, "modelValue", t), l = S(!1), a = k(() => e.message && e.message.length && e.showMessage), d = {
|
|
849
847
|
normal: "color-gray-600 dark:color-gray-400",
|
|
850
848
|
warning: "color-warning-500 dark:color-warning-200",
|
|
851
849
|
danger: "color-danger-500 dark:color-danger-200",
|
|
852
850
|
success: "color-primary-700 dark:color-primary-500"
|
|
853
|
-
},
|
|
851
|
+
}, r = {
|
|
854
852
|
warning: "i-bx:bxs-error",
|
|
855
853
|
danger: "i-ic-round-error",
|
|
856
854
|
success: "i-ep:success-filled"
|
|
@@ -858,22 +856,22 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
858
856
|
return (i, p) => (u(), f("div", Ge, [
|
|
859
857
|
C(Xe, {
|
|
860
858
|
modelValue: b(o),
|
|
861
|
-
"onUpdate:modelValue": p[0] || (p[0] = (c) =>
|
|
859
|
+
"onUpdate:modelValue": p[0] || (p[0] = (c) => O(o) ? o.value = c : null),
|
|
862
860
|
placeholder: i.placeholder,
|
|
863
|
-
onUpdateFocused: p[1] || (p[1] = (c) =>
|
|
861
|
+
onUpdateFocused: p[1] || (p[1] = (c) => l.value = c)
|
|
864
862
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
865
863
|
m("div", {
|
|
866
864
|
class: y(["mt2 $ui-base text-3.5", [
|
|
867
865
|
d[i.status],
|
|
868
|
-
{ "opacity-65": !
|
|
866
|
+
{ "opacity-65": !l.value }
|
|
869
867
|
]])
|
|
870
868
|
}, [
|
|
871
|
-
i.status !== "normal" &&
|
|
869
|
+
i.status !== "normal" && a.value ? (u(), w(F, {
|
|
872
870
|
key: 0,
|
|
873
871
|
inline: "",
|
|
874
|
-
icon:
|
|
872
|
+
icon: r[i.status]
|
|
875
873
|
}, null, 8, ["icon"])) : $("", !0),
|
|
876
|
-
_(" " + B(
|
|
874
|
+
_(" " + B(a.value ? i.message : ""), 1)
|
|
877
875
|
], 2)
|
|
878
876
|
]));
|
|
879
877
|
}
|
|
@@ -882,8 +880,8 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
882
880
|
props: {
|
|
883
881
|
name: {}
|
|
884
882
|
},
|
|
885
|
-
setup(
|
|
886
|
-
const t =
|
|
883
|
+
setup(n) {
|
|
884
|
+
const t = n, e = k(() => ke[t.name] ?? "");
|
|
887
885
|
return (s, o) => (u(), f("div", null, [
|
|
888
886
|
(u(), f("svg", {
|
|
889
887
|
class: "custom-svg h-1em w-1em",
|
|
@@ -902,43 +900,43 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
902
900
|
placeholder: { default: "Select..." },
|
|
903
901
|
autoClose: { type: Boolean, default: !0 },
|
|
904
902
|
disabled: { type: Boolean, default: !1 },
|
|
905
|
-
labelRenderer: { type: Function, default: (
|
|
903
|
+
labelRenderer: { type: Function, default: (n) => String(n) },
|
|
906
904
|
buttonProps: { default: () => ({}) }
|
|
907
905
|
},
|
|
908
906
|
emits: ["update:modelValue"],
|
|
909
|
-
setup(
|
|
910
|
-
const e =
|
|
907
|
+
setup(n, { emit: t }) {
|
|
908
|
+
const e = n, s = t, o = q(), l = k({
|
|
911
909
|
get: () => e.modelValue,
|
|
912
|
-
set: (
|
|
913
|
-
}),
|
|
914
|
-
const
|
|
915
|
-
return
|
|
910
|
+
set: (r) => s("update:modelValue", r)
|
|
911
|
+
}), a = k(() => {
|
|
912
|
+
const r = e.options.find((i) => i.value === l.value);
|
|
913
|
+
return r?.label ? e.labelRenderer(r.label) : e.placeholder;
|
|
916
914
|
});
|
|
917
|
-
function d(
|
|
918
|
-
e.multiple ?
|
|
915
|
+
function d(r) {
|
|
916
|
+
e.multiple ? l.value = l.value.includes(r.value) ? l.value.filter((i) => i !== r.value) : [...l.value, r.value] : l.value = r.value;
|
|
919
917
|
}
|
|
920
|
-
return (
|
|
921
|
-
buttonProps:
|
|
922
|
-
disabled:
|
|
918
|
+
return (r, i) => (u(), w(Ye, D({ label: a.value }, {
|
|
919
|
+
buttonProps: r.buttonProps,
|
|
920
|
+
disabled: r.disabled
|
|
923
921
|
}), Z({
|
|
924
922
|
popper: g(() => [
|
|
925
923
|
m("div", Ze, [
|
|
926
|
-
b(o).item ? (u(!0), f(E, { key: 0 }, R(
|
|
924
|
+
b(o).item ? (u(!0), f(E, { key: 0 }, R(r.options, (p) => (u(), f("div", {
|
|
927
925
|
key: p.value,
|
|
928
926
|
class: "cursor-pointer",
|
|
929
927
|
onClick: (c) => d(p)
|
|
930
928
|
}, [
|
|
931
|
-
v(
|
|
929
|
+
v(r.$slots, "item", D({ ref_for: !0 }, {
|
|
932
930
|
item: p,
|
|
933
|
-
active:
|
|
934
|
-
disabled:
|
|
931
|
+
active: r.multiple ? l.value.includes(p.value) : p.value === l.value,
|
|
932
|
+
disabled: r.disabled
|
|
935
933
|
}))
|
|
936
|
-
], 8, et))), 128)) : (u(!0), f(E, { key: 1 }, R(
|
|
934
|
+
], 8, et))), 128)) : (u(!0), f(E, { key: 1 }, R(r.options, (p) => j((u(), w(M, {
|
|
937
935
|
key: p.value,
|
|
938
|
-
disabled:
|
|
936
|
+
disabled: r.disabled,
|
|
939
937
|
round: "normal",
|
|
940
938
|
class: y(["flex-[auto_1_1] not-hover:[&:not(.active)]:bg-transparent!", {
|
|
941
|
-
active:
|
|
939
|
+
active: r.multiple ? l.value.includes(p.value) : p.value === l.value
|
|
942
940
|
}]),
|
|
943
941
|
onClick: (c) => d(p)
|
|
944
942
|
}, {
|
|
@@ -947,7 +945,7 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
947
945
|
]),
|
|
948
946
|
_: 2
|
|
949
947
|
}, 1032, ["disabled", "class", "onClick"])), [
|
|
950
|
-
[b(Y),
|
|
948
|
+
[b(Y), r.autoClose]
|
|
951
949
|
])), 128))
|
|
952
950
|
])
|
|
953
951
|
]),
|
|
@@ -959,7 +957,7 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
959
957
|
b(o).button ? {
|
|
960
958
|
name: "default",
|
|
961
959
|
fn: g(() => [
|
|
962
|
-
v(
|
|
960
|
+
v(r.$slots, "button")
|
|
963
961
|
]),
|
|
964
962
|
key: "0"
|
|
965
963
|
} : void 0
|
|
@@ -972,16 +970,16 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
972
970
|
disabled: { type: Boolean }
|
|
973
971
|
},
|
|
974
972
|
emits: ["update:modelValue"],
|
|
975
|
-
setup(
|
|
976
|
-
const o = T(
|
|
977
|
-
return (
|
|
973
|
+
setup(n, { emit: t }) {
|
|
974
|
+
const o = T(n, "modelValue", t), l = be(o);
|
|
975
|
+
return (a, d) => (u(), f("div", {
|
|
978
976
|
class: y([[
|
|
979
|
-
|
|
977
|
+
a.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
980
978
|
], "$ui-base $ui-if-sc cursor-pointer select-none gap1.25 vertical-mid text-3.5"]),
|
|
981
979
|
role: "checkbox",
|
|
982
|
-
onClick: d[0] || (d[0] = (
|
|
980
|
+
onClick: d[0] || (d[0] = (r) => !a.disabled && b(l)())
|
|
983
981
|
}, [
|
|
984
|
-
v(
|
|
982
|
+
v(a.$slots, "default"),
|
|
985
983
|
m("div", {
|
|
986
984
|
class: y([{
|
|
987
985
|
selected: b(o)
|
|
@@ -989,8 +987,8 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
989
987
|
}, [
|
|
990
988
|
m("div", {
|
|
991
989
|
class: y(["h4 w4 rounded-full bg-primary-800 transition-transform group-[&.selected]:transform-translate-x-4 dark:bg-white", [
|
|
992
|
-
{ "group-hover:opacity-75 group-active:scale-85": !
|
|
993
|
-
{ "opacity-65":
|
|
990
|
+
{ "group-hover:opacity-75 group-active:scale-85": !a.disabled },
|
|
991
|
+
{ "opacity-65": a.disabled }
|
|
994
992
|
]])
|
|
995
993
|
}, null, 2)
|
|
996
994
|
], 2)
|
|
@@ -1006,7 +1004,7 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
1006
1004
|
disabled: { type: Boolean },
|
|
1007
1005
|
shown: { type: Boolean }
|
|
1008
1006
|
},
|
|
1009
|
-
setup(
|
|
1007
|
+
setup(n) {
|
|
1010
1008
|
return (t, e) => (u(), w(b(re), D({
|
|
1011
1009
|
disabled: t.disabled,
|
|
1012
1010
|
placement: t.placement
|
|
@@ -1022,7 +1020,7 @@ const Ue = { class: "$ui-dark-toggle-vtr" }, gt = /* @__PURE__ */ h({
|
|
|
1022
1020
|
}
|
|
1023
1021
|
});
|
|
1024
1022
|
export {
|
|
1025
|
-
|
|
1023
|
+
Ae as THEME_KEY,
|
|
1026
1024
|
dt as VueBadge,
|
|
1027
1025
|
M as VueButton,
|
|
1028
1026
|
ut as VueCard,
|
|
@@ -1030,7 +1028,7 @@ export {
|
|
|
1030
1028
|
pt as VueCodeBlock,
|
|
1031
1029
|
mt as VueConfirm,
|
|
1032
1030
|
gt as VueDarkToggle,
|
|
1033
|
-
|
|
1031
|
+
Ne as VueDialog,
|
|
1034
1032
|
vt as VueDrawer,
|
|
1035
1033
|
Ye as VueDropdown,
|
|
1036
1034
|
bt as VueDropdownButton,
|
|
@@ -1039,7 +1037,7 @@ export {
|
|
|
1039
1037
|
F as VueIcon,
|
|
1040
1038
|
Xe as VueInput,
|
|
1041
1039
|
te as VueLoadingIndicator,
|
|
1042
|
-
|
|
1040
|
+
je as VueNotification,
|
|
1043
1041
|
oe as VueOverlay,
|
|
1044
1042
|
kt as VueSelect,
|
|
1045
1043
|
wt as VueSwitch,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/devtools-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "8.0.0",
|
|
5
5
|
"author": "webfansplz",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
"vue": ">=3.0.0-0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@vueuse/components": "^
|
|
41
|
-
"@vueuse/core": "^
|
|
42
|
-
"@vueuse/integrations": "^
|
|
40
|
+
"@vueuse/components": "^13.5.0",
|
|
41
|
+
"@vueuse/core": "^13.5.0",
|
|
42
|
+
"@vueuse/integrations": "^13.5.0",
|
|
43
43
|
"colord": "^2.9.3",
|
|
44
|
-
"focus-trap": "^7.6.
|
|
45
|
-
"@vue/devtools-shared": "
|
|
44
|
+
"focus-trap": "^7.6.5",
|
|
45
|
+
"@vue/devtools-shared": "8.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@histoire/plugin-vue": "^0.17.17",
|
|
49
49
|
"@iconify-json/ic": "^1.2.2",
|
|
50
|
-
"@types/node": "^
|
|
51
|
-
"@unocss/reset": "^66.
|
|
52
|
-
"@vitejs/plugin-vue": "^
|
|
50
|
+
"@types/node": "^24.1.0",
|
|
51
|
+
"@unocss/reset": "^66.3.3",
|
|
52
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
53
53
|
"floating-vue": "5.2.2",
|
|
54
54
|
"histoire": "^0.17.17",
|
|
55
|
-
"unocss": "^66.
|
|
56
|
-
"vite-plugin-dts": "^4.5.
|
|
55
|
+
"unocss": "^66.3.3",
|
|
56
|
+
"vite-plugin-dts": "^4.5.4"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsx ./scripts/update-icons.ts && vite build",
|