fluenzymet-ui
Version:
WinUI3风格的Vue3组件库,包含按钮、输入框、开关、下拉框等常用组件
42 lines (41 loc) • 42.9 kB
JavaScript
(function(p,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(p=typeof globalThis<"u"?globalThis:p||self,e(p.FluenzymeTUI={},p.Vue))})(this,function(p,e){"use strict";var Kt=Object.defineProperty;var xt=(p,e,N)=>e in p?Kt(p,e,{enumerable:!0,configurable:!0,writable:!0,value:N}):p[e]=N;var I=(p,e,N)=>xt(p,typeof e!="symbol"?e+"":e,N);const N={name:"FButton",props:{type:{type:String,default:"button"},disabled:{type:Boolean,default:!1},buttonType:{type:String,default:"primary"}},emits:["click","focus","blur","mouseenter","mouseleave"],methods:{handleClick(t){this.disabled||this.$emit("click",t)},handleFocus(t){this.$emit("focus",t)},handleBlur(t){this.$emit("blur",t)},handleMouseEnter(t){this.$emit("mouseenter",t)},handleMouseLeave(t){this.$emit("mouseleave",t)}}},E=(t,o)=>{const l=t.__vccOpts||t;for(const[i,a]of o)l[i]=a;return l},Z=["type","disabled"];function q(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["winui-button",[l.buttonType,{disabled:l.disabled}]]),type:l.type,disabled:l.disabled,onClick:o[0]||(o[0]=(...n)=>s.handleClick&&s.handleClick(...n)),onFocus:o[1]||(o[1]=(...n)=>s.handleFocus&&s.handleFocus(...n)),onBlur:o[2]||(o[2]=(...n)=>s.handleBlur&&s.handleBlur(...n)),onMouseenter:o[3]||(o[3]=(...n)=>s.handleMouseEnter&&s.handleMouseEnter(...n)),onMouseleave:o[4]||(o[4]=(...n)=>s.handleMouseLeave&&s.handleMouseLeave(...n))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],42,Z)}const _=E(N,[["render",q],["__scopeId","data-v-7290208d"]]),J=e.defineComponent({name:"FInput",props:{modelValue:{type:String,default:""},label:{type:String,default:""},placeholder:{type:String,default:""}},emits:["update:modelValue","input","focus","blur","keydown","keyup","keypress","change"],setup(t,{emit:o}){const l=e.computed({get:()=>t.modelValue,set:r=>{o("update:modelValue",r)}});return{localValue:l,updateValue:r=>{const w=r.target;l.value=w.value,o("input",w.value)},handleFocus:r=>{o("focus",r)},handleBlur:r=>{o("blur",r)},handleKeydown:r=>{o("keydown",r)},handleKeyup:r=>{o("keyup",r)},handleKeypress:r=>{o("keypress",r)},handleChange:r=>{const w=r.target;o("change",w.value)}}}}),Q={class:"winui-input-container"},X={key:0,class:"winui-input-label"},Y=["placeholder"];function v(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("div",Q,[t.label?(e.openBlock(),e.createElementBlock("label",X,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{class:"winui-input",placeholder:t.placeholder,"onUpdate:modelValue":o[0]||(o[0]=n=>t.localValue=n),onInput:o[1]||(o[1]=(...n)=>t.updateValue&&t.updateValue(...n)),onFocus:o[2]||(o[2]=(...n)=>t.handleFocus&&t.handleFocus(...n)),onBlur:o[3]||(o[3]=(...n)=>t.handleBlur&&t.handleBlur(...n)),onKeydown:o[4]||(o[4]=(...n)=>t.handleKeydown&&t.handleKeydown(...n)),onKeyup:o[5]||(o[5]=(...n)=>t.handleKeyup&&t.handleKeyup(...n)),onKeypress:o[6]||(o[6]=(...n)=>t.handleKeypress&&t.handleKeypress(...n)),onChange:o[7]||(o[7]=(...n)=>t.handleChange&&t.handleChange(...n))},null,40,Y),[[e.vModelText,t.localValue]])])}const z=E(J,[["render",v],["__scopeId","data-v-d0f6feee"]]),ee=["checked","disabled"],te={class:"f-switch__track"},oe={class:"f-switch__thumb"},ne={key:0,class:"f-switch__on-content"},le={key:1,class:"f-switch__off-content"},ie={key:0,class:"f-switch__label"},P=E(e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},onContent:{},offContent:{},width:{default:44}},emits:["update:modelValue","change","focus","blur","click"],setup(t,{emit:o}){const l=t,i=o,a=e.computed(()=>l.modelValue),s=e.computed(()=>({"--switch-width":`${l.width}px`,"--switch-height":`${l.width*.48}px`,"--switch-thumb-size":`${l.width*.36}px`})),n=r=>{const w=r.target.checked;i("update:modelValue",w),i("change",w)},m=r=>{i("focus",r)},f=r=>{i("blur",r)},C=r=>{l.disabled||i("click",r)};return(r,w)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["f-switch",{"f-switch--checked":a.value,"f-switch--disabled":r.disabled,"f-switch--on-content":r.onContent,"f-switch--off-content":r.offContent}]),style:e.normalizeStyle(s.value)},[e.createElementVNode("input",{type:"checkbox",class:"f-switch__input",checked:a.value,disabled:r.disabled,onChange:n,onFocus:m,onBlur:f,onClick:C},null,40,ee),e.createElementVNode("div",te,[e.createElementVNode("div",oe,[a.value&&r.onContent?(e.openBlock(),e.createElementBlock("div",ne,e.toDisplayString(r.onContent),1)):e.createCommentVNode("",!0),!a.value&&r.offContent?(e.openBlock(),e.createElementBlock("div",le,e.toDisplayString(r.offContent),1)):e.createCommentVNode("",!0)])]),r.label?(e.openBlock(),e.createElementBlock("div",ie,e.toDisplayString(r.label),1)):e.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-8b2f76c2"]]);function se(t,o){const l=e.ref(!1),i=e.ref(""),a=e.ref(),s=e.ref(),n=e.ref(-1),m=e.computed(()=>t.options.find(d=>d.value===t.modelValue)),f=e.computed(()=>{var d;return l.value&&i.value?i.value:((d=m.value)==null?void 0:d.label)||""}),C=e.computed(()=>i.value?t.options.filter(d=>d.label.toLowerCase().includes(i.value.toLowerCase())&&!d.disabled):t.options),r=()=>{t.disabled||t.readonly||(l.value=!l.value,l.value?(i.value="",n.value=-1,e.nextTick(()=>{var d;(d=a.value)==null||d.focus()}),o("open")):o("close"))},w=d=>{d.disabled||(o("update:modelValue",d.value),o("change",d.value,d),l.value=!1,i.value="")},b=d=>{const k=d.target;i.value=k.value,o("search",k.value),l.value||(l.value=!0,o("open"))},u=d=>{if(!l.value){(d.key==="Enter"||d.key===" "||d.key==="ArrowDown")&&(d.preventDefault(),r());return}switch(d.key){case"Escape":l.value=!1;break;case"Enter":d.preventDefault(),n.value>=0&&C.value[n.value]&&w(C.value[n.value]);break;case"ArrowDown":d.preventDefault(),n.value=Math.min(n.value+1,C.value.length-1);break;case"ArrowUp":d.preventDefault(),n.value=Math.max(n.value-1,0);break}},B=d=>{o("focus",d)},S=d=>{setTimeout(()=>{var k;(k=s.value)!=null&&k.contains(document.activeElement)||(l.value=!1,i.value="")},100),o("blur",d)},y=d=>{var M,T;const k=d.target,$=(T=(M=a.value)==null?void 0:M.parentElement)==null?void 0:T.parentElement;$&&!$.contains(k)&&(l.value=!1,i.value="")};return e.onMounted(()=>{document.addEventListener("click",y)}),e.onUnmounted(()=>{document.removeEventListener("click",y)}),{isOpen:l,searchText:i,inputRef:a,dropdownRef:s,selectedIndex:n,displayText:f,filteredOptions:C,selectedOption:m,toggleDropdown:r,selectOption:w,handleInput:b,handleKeydown:u,handleFocus:B,handleBlur:S,handleClickOutside:y}}const ae={class:"combo-box-input-container"},re=["value","placeholder","disabled","readonly"],de=["disabled"],ce={class:"combo-box-list"},me=["onClick"],ue={class:"combo-box-option-label"},he={key:0,class:"combo-box-check-icon",viewBox:"0 0 16 16",fill:"none"},pe={key:0,class:"combo-box-no-results"},O=E(e.defineComponent({__name:"ComboBox",props:{modelValue:{},options:{},placeholder:{default:"请选择..."},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},width:{},maxHeight:{default:"200px"}},emits:["update:modelValue","change","focus","blur","click","keydown","keyup","search","open","close"],setup(t,{emit:o}){const l=t,i=o,{isOpen:a,inputRef:s,dropdownRef:n,selectedIndex:m,displayText:f,filteredOptions:C,toggleDropdown:r,selectOption:w,handleInput:b,handleKeydown:u,handleFocus:B,handleBlur:S}=se(l,i);return(y,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["combo-box",{"is-open":e.unref(a),"is-disabled":y.disabled,"is-readonly":y.readonly}]),style:e.normalizeStyle({width:y.width?typeof y.width=="number"?y.width+"px":y.width:"240px"})},[e.createElementVNode("div",ae,[e.createElementVNode("input",{ref_key:"inputRef",ref:s,type:"text",class:"combo-box-input",value:e.unref(f),placeholder:y.placeholder,disabled:y.disabled,readonly:y.readonly,onInput:d[0]||(d[0]=(...k)=>e.unref(b)&&e.unref(b)(...k)),onKeydown:d[1]||(d[1]=(...k)=>e.unref(u)&&e.unref(u)(...k)),onFocus:d[2]||(d[2]=(...k)=>e.unref(B)&&e.unref(B)(...k)),onBlur:d[3]||(d[3]=(...k)=>e.unref(S)&&e.unref(S)(...k))},null,40,re),e.createElementVNode("button",{class:"combo-box-toggle",type:"button",disabled:y.disabled,onClick:d[4]||(d[4]=(...k)=>e.unref(r)&&e.unref(r)(...k))},d[5]||(d[5]=[e.createElementVNode("svg",{class:"combo-box-icon",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]),8,de)]),e.createVNode(e.Transition,{name:"dropdown"},{default:e.withCtx(()=>[e.unref(a)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:n,class:"combo-box-dropdown",style:e.normalizeStyle({maxHeight:y.maxHeight?typeof y.maxHeight=="number"?y.maxHeight+"px":y.maxHeight:"200px"})},[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(C),(k,$)=>(e.openBlock(),e.createElementBlock("div",{key:k.value,class:e.normalizeClass(["combo-box-option",{"is-selected":k.value===y.modelValue,"is-highlighted":$===e.unref(m),"is-disabled":k.disabled}]),onClick:M=>e.unref(w)(k)},[d[7]||(d[7]=e.createElementVNode("div",{class:"combo-box-option-indicator"},null,-1)),e.createElementVNode("span",ue,e.toDisplayString(k.label),1),k.value===y.modelValue?(e.openBlock(),e.createElementBlock("svg",he,d[6]||(d[6]=[e.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):e.createCommentVNode("",!0)],10,me))),128)),e.unref(C).length===0?(e.openBlock(),e.createElementBlock("div",pe," 无匹配选项 ")):e.createCommentVNode("",!0)])],4)):e.createCommentVNode("",!0)]),_:1})],6))}}),[["__scopeId","data-v-00162f1b"]]),fe={key:0,class:"content-dialog-header"},ke=["aria-label"],ge={key:1,class:"content-dialog-footer"},ye={key:2,class:"content-dialog-footer"},H=E(e.defineComponent({name:"FContentDialog",__name:"ContentDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},content:{default:""},primaryButtonText:{default:""},secondaryButtonText:{default:""},closeButtonLabel:{default:"Close"},size:{default:"medium"},showCloseButton:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!0},fullSize:{type:Boolean,default:!1},preventCloseOnOverlay:{type:Boolean,default:!1},preventCloseOnEscape:{type:Boolean,default:!1}},emits:["update:modelValue","primary","secondary","close","opened","closed","click","keydown","overlayClick"],setup(t,{expose:o,emit:l}){const i=t,a=l,s=e.ref(i.modelValue),n="content-dialog-title-"+Math.random().toString(36).substr(2,9),m="content-dialog-content-"+Math.random().toString(36).substr(2,9);e.watch(()=>i.modelValue,u=>{s.value=u}),e.watch(s,u=>{a("update:modelValue",u),u?(a("opened"),document.body.style.overflow="hidden"):(a("closed"),document.body.style.overflow="")});const f=u=>{u.key==="Escape"&&!i.preventCloseOnEscape&&r()},C=()=>{a("overlayClick"),i.preventCloseOnOverlay||r()},r=()=>{s.value=!1,a("close")},w=()=>{a("primary")},b=()=>{a("secondary")};return e.onMounted(()=>{s.value&&(document.body.style.overflow="hidden"),document.addEventListener("keydown",f)}),e.onUnmounted(()=>{document.body.style.overflow="",document.removeEventListener("keydown",f)}),o({open:()=>{s.value=!0},close:()=>{s.value=!1}}),(u,B)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"content-dialog"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"content-dialog-overlay",onClick:C},[e.createElementVNode("div",{class:e.normalizeClass(["content-dialog",[`content-dialog--${u.size}`,u.fullSize&&"content-dialog--full-size"]]),role:"dialog","aria-modal":!0,"aria-labelledby":n,"aria-describedby":m,onClick:B[0]||(B[0]=e.withModifiers(()=>{},["stop"]))},[u.showTitle||u.$slots.header?(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",{class:"content-dialog-title",id:n},[e.renderSlot(u.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(u.title),1)],!0)]),u.showCloseButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"content-dialog-close",onClick:r,"aria-label":u.closeButtonLabel},B[1]||(B[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M2.22 2.22a.75.75 0 0 1 1.06 0L6 4.94 8.72 2.22a.75.75 0 1 1 1.06 1.06L7.06 6l2.72 2.72a.75.75 0 1 1-1.06 1.06L6 7.06l-2.72 2.72a.75.75 0 0 1-1.06-1.06L4.94 6 2.22 3.28a.75.75 0 0 1 0-1.06Z",fill:"currentColor"})],-1)]),8,ke)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"content-dialog-content",id:m},[e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(u.content),1)],!0)]),u.$slots.footer?(e.openBlock(),e.createElementBlock("div",ge,[e.renderSlot(u.$slots,"footer",{},void 0,!0)])):u.primaryButtonText||u.secondaryButtonText?(e.openBlock(),e.createElementBlock("div",ye,[u.secondaryButtonText?(e.openBlock(),e.createBlock(_,{key:0,"button-type":"standard",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.secondaryButtonText),1)]),_:1})):e.createCommentVNode("",!0),u.primaryButtonText?(e.openBlock(),e.createBlock(_,{key:1,"button-type":"primary",onClick:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.primaryButtonText),1)]),_:1})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0)]),_:3})]))}}),[["__scopeId","data-v-f03f7710"]]),Ce={name:"MenuFlyout",props:{visible:{type:Boolean,default:!1},items:{type:Array,default:()=>[],required:!0},x:{type:Number,default:0},y:{type:Number,default:0},trigger:{type:String,default:"click",validator:t=>["click","hover","manual"].includes(t)},placement:{type:String,default:"bottom-start",validator:t=>["top","top-start","top-end","bottom","bottom-start","bottom-end"].includes(t)}},emits:["update:visible","itemClick","show","hide","triggerClick","triggerEnter","triggerLeave","menuEnter","menuLeave"],data(){return{hoveredIndex:null,containerHeight:0,triggerHovered:!1,menuHovered:!1,internalVisible:!1}},computed:{computedVisible(){return this.trigger==="manual"?this.visible:this.internalVisible},flyoutStyle(){const t={};return this.placement.startsWith("top")?t.transformOrigin="bottom left":t.transformOrigin="top left",t}},methods:{isComponent(t){return typeof t=="object"},handleItemClick(t,o){t.disabled||t.separator||(t.onClick&&t.onClick(),this.$emit("itemClick",t,o),this.trigger==="click"&&(this.internalVisible=!1,this.$emit("update:visible",!1),this.$emit("hide")))},handleItemHover(t){this.hoveredIndex=t},handleItemLeave(){this.hoveredIndex=null},handleClickOutside(t){this.computedVisible&&this.$refs.menuWrapper&&!this.$refs.menuWrapper.contains(t.target)&&this.trigger!=="hover"&&(this.internalVisible=!1,this.$emit("update:visible",!1),this.$emit("hide"))},handleTriggerClick(){this.trigger==="click"&&(this.internalVisible=!this.internalVisible,this.$emit("update:visible",this.internalVisible),this.$emit("triggerClick"),this.internalVisible?this.$emit("show"):this.$emit("hide"))},handleTriggerMouseEnter(){this.trigger==="hover"&&(this.triggerHovered=!0,this.internalVisible=!0,this.$emit("update:visible",!0),this.$emit("triggerEnter"),this.$emit("show"))},handleTriggerMouseLeave(){this.trigger==="hover"&&(this.triggerHovered=!1,this.$emit("triggerLeave"),setTimeout(()=>{!this.menuHovered&&!this.triggerHovered&&(this.internalVisible=!1,this.$emit("update:visible",!1),this.$emit("hide"))},100))},handleMenuMouseEnter(){this.trigger==="hover"&&(this.menuHovered=!0,this.$emit("menuEnter"))},handleMenuMouseLeave(){this.trigger==="hover"&&(this.menuHovered=!1,this.$emit("menuLeave"),setTimeout(()=>{!this.menuHovered&&!this.triggerHovered&&(this.internalVisible=!1,this.$emit("update:visible",!1),this.$emit("hide"))},100))},setContainerHeight(){this.$refs.flyoutContainer&&(this.containerHeight=this.$refs.flyoutContainer.offsetHeight)},updatePosition(){if(this.$slots.trigger&&this.$refs.trigger&&this.$refs.flyoutContainer){const t=this.$refs.trigger.getBoundingClientRect(),o=this.$refs.flyoutContainer.parentElement;o.style.position="fixed",o.style.left=`${t.left}px`,o.style.top=`${t.bottom}px`,this.$nextTick(()=>{const l=o.getBoundingClientRect();let i,a;switch(this.placement){case"top":i=t.left+t.width/2-l.width/2,a=t.top-l.height;break;case"top-start":i=t.left,a=t.top-l.height;break;case"top-end":i=t.right-l.width,a=t.top-l.height;break;case"bottom":i=t.left+t.width/2-l.width/2,a=t.bottom;break;case"bottom-start":i=t.left,a=t.bottom;break;case"bottom-end":i=t.right-l.width,a=t.bottom;break;default:i=t.left,a=t.bottom}o.style.left=`${i}px`,o.style.top=`${a}px`})}this.$nextTick(()=>{this.setContainerHeight()})}},mounted(){document.addEventListener("click",this.handleClickOutside),this.$refs.flyoutContainer&&(this.$refs.flyoutContainer.addEventListener("mouseenter",this.handleMenuMouseEnter),this.$refs.flyoutContainer.addEventListener("mouseleave",this.handleMenuMouseLeave))},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside),this.$refs.flyoutContainer&&(this.$refs.flyoutContainer.removeEventListener("mouseenter",this.handleMenuMouseEnter),this.$refs.flyoutContainer.removeEventListener("mouseleave",this.handleMenuMouseLeave))},watch:{computedVisible(t){t&&this.$nextTick(()=>{this.updatePosition()})},items(){this.computedVisible&&this.$nextTick(()=>{this.updatePosition()})}}},we={class:"menu-wrapper",ref:"menuWrapper"},be={class:"menu-flyout-container",ref:"flyoutContainer"},Be=["onClick","onMouseenter","onMouseleave"],Ve={key:0,class:"menu-item-icon"},Ee={class:"menu-item-text"},$e={key:1,class:"menu-item-shortcut"};function Ne(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("div",we,[t.$slots.trigger?(e.openBlock(),e.createElementBlock("div",{key:0,class:"menu-trigger",ref:"trigger",onClick:o[0]||(o[0]=(...n)=>s.handleTriggerClick&&s.handleTriggerClick(...n)),onMouseenter:o[1]||(o[1]=(...n)=>s.handleTriggerMouseEnter&&s.handleTriggerMouseEnter(...n)),onMouseleave:o[2]||(o[2]=(...n)=>s.handleTriggerMouseLeave&&s.handleTriggerMouseLeave(...n))},[e.renderSlot(t.$slots,"trigger",{},void 0,!0)],544)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:"menu-flyout",style:e.normalizeStyle(s.flyoutStyle)},[e.createElementVNode("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,(n,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass({"menu-item":!n.separator,"menu-separator":n.separator}),onClick:f=>s.handleItemClick(n,m),onMouseenter:f=>s.handleItemHover(m),onMouseleave:f=>s.handleItemLeave(m)},[n.separator?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.icon?(e.openBlock(),e.createElementBlock("span",Ve,[s.isComponent(n.icon)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0})):(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(n.icon)},null,2))])):e.createCommentVNode("",!0),e.createElementVNode("span",Ee,e.toDisplayString(n.text),1),n.shortcut?(e.openBlock(),e.createElementBlock("span",$e,e.toDisplayString(n.shortcut),1)):e.createCommentVNode("",!0)],64))],42,Be))),128))],512)],4),[[e.vShow,s.computedVisible]])],512)}const R=E(Ce,[["render",Ne],["__scopeId","data-v-d97d0268"]]),_e={name:"NavigationView",props:{paneOpen:{type:Boolean,default:!0},compact:{type:Boolean,default:!1},showTopNav:{type:Boolean,default:!1},menuItems:{type:Array,default:()=>[]}},emits:["update:paneOpen","itemSelect","paneToggle","groupToggle","itemClick"],data(){return{isPaneOpen:this.paneOpen,isCompact:this.compact,currentItem:null}},mounted(){const t=this.findFirstSelectableItem(this.menuItems);t&&(this.currentItem=t)},methods:{togglePane(){this.isCompact=!this.isCompact,this.$emit("update:paneCompact",this.isCompact),this.$emit("paneToggle",this.isCompact)},selectItem(t,o){t.disabled||(this.currentItem=t,this.$emit("itemSelect",t,o),this.$emit("itemClick",t,o))},isActiveItem(t){return this.currentItem===t},toggleGroup(t){t.expanded=!t.expanded,this.$set(t,"expanded",t.expanded),this.$emit("groupToggle",t,t.expanded)},findFirstSelectableItem(t){for(const o of t)if(o.type==="group"&&o.children){const l=this.findFirstSelectableItem(o.children);if(l)return l}else if(!o.type&&!o.disabled)return o;return null}}},Se={class:"pane-header"},Fe=["aria-label"],Me={class:"pane-content"},Te={class:"navigation-menu"},Ie={class:"menu-list"},Le={key:0,class:"menu-separator"},De={key:1,class:"menu-header"},ze={class:"menu-header-content"},Pe={key:0,class:"menu-header-text"},Oe=["onClick"],He={class:"menu-item-content"},Re={class:"menu-item-icon"},Ke={key:0,class:"menu-item-text"},xe={key:0,class:"expand-icon"},Ae={key:0,class:"submenu-list"},Ge=["onClick"],Ue={class:"menu-item-content"},je={class:"menu-item-icon"},We={key:0,class:"menu-item-text"},Ze=["onClick"],qe={class:"menu-item-content"},Je={class:"menu-item-icon"},Qe={key:0,class:"menu-item-text"},Xe={key:0,class:"pane-footer"},Ye={style:{"border-radius":"12px",display:"flex",flex:"1",height:"calc(100% - 45px)","margin-top":"45px",width:"100%",position:"relative",top:"-8px","z-index":"999999"}},ve={class:"content-area"},et={class:"content"};function tt(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["navigation-view",{expanded:a.isPaneOpen,compact:!a.isPaneOpen}])},[e.createElementVNode("div",{class:e.normalizeClass(["navigation-pane",{open:a.isPaneOpen,closed:!a.isPaneOpen,compact:a.isCompact,expanded:!a.isCompact}])},[e.createElementVNode("div",Se,[e.createElementVNode("button",{class:"pane-toggle-button",onClick:o[0]||(o[0]=(...n)=>s.togglePane&&s.togglePane(...n)),"aria-label":a.isCompact?"收起导航面板":"展开导航面板"},o[1]||(o[1]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},[e.createElementVNode("g",{id:"menu_line",fill:"none"},[e.createElementVNode("path",{d:"M24 0v24H0V0zM12.593 23.258l-.011.002-.071.035-.02.004-.014-.004-.071-.035c-.01-.004-.019-.001-.024.005l-.004.01-.017.428.005.02.01.013.104.074.015.004.012-.004.104-.074.012-.016.004-.017-.017-.427c-.002-.01-.009-.017-.017-.018m.265-.113-.013.002-.185.093-.01.01-.003.011.018.43.005.012.008.007.201.093c.012.004.023 0 .029-.008l.004-.014-.034-.614c-.003-.012-.01-.02-.02-.022m-.715.002a.023.023 0 0 0-.027.006l-.006.014-.034.614c0 .012.007.02.017.024l.015-.002.201-.093.01-.008.004-.011.017-.43-.003-.012-.01-.01z"}),e.createElementVNode("path",{fill:"#09244BFF",d:"M20 18a1 1 0 0 1 .117 1.993L20 20H4a1 1 0 0 1-.117-1.993L4 18zm0-7a1 1 0 1 1 0 2H4a1 1 0 1 1 0-2zm0-7a1 1 0 1 1 0 2H4a1 1 0 0 1 0-2z"})])],-1)]),8,Fe),e.renderSlot(t.$slots,"title",{},void 0,!0)]),e.createElementVNode("div",Me,[e.createElementVNode("nav",Te,[e.createElementVNode("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.menuItems,(n,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[n.type==="separator"?(e.openBlock(),e.createElementBlock("li",Le)):n.type==="header"?(e.openBlock(),e.createElementBlock("li",De,[e.createElementVNode("div",ze,[a.isPaneOpen?(e.openBlock(),e.createElementBlock("span",Pe,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0)])])):n.type==="group"?(e.openBlock(),e.createElementBlock("li",{key:2,class:e.normalizeClass(["menu-group",{expanded:n.expanded}])},[e.createElementVNode("div",{class:"menu-group-header",onClick:f=>s.toggleGroup(n)},[e.createElementVNode("div",He,[e.createElementVNode("div",Re,[e.renderSlot(t.$slots,"icon",{item:n,index:m},()=>[n.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["menu-item-icon",n.icon])},null,2)):e.createCommentVNode("",!0)],!0)]),a.isPaneOpen?(e.openBlock(),e.createElementBlock("span",Ke,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0)]),a.isPaneOpen?(e.openBlock(),e.createElementBlock("div",xe,o[2]||(o[2]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[e.createElementVNode("path",{d:"M6 12L10 8L6 4",stroke:"#757575","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):e.createCommentVNode("",!0)],8,Oe),n.expanded&&n.children?(e.openBlock(),e.createElementBlock("ul",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.children,(f,C)=>(e.openBlock(),e.createElementBlock("li",{key:C,class:e.normalizeClass(["submenu-item",{active:s.isActiveItem(f),disabled:f.disabled}]),onClick:r=>s.selectItem(f,`${m}-${C}`)},[e.createElementVNode("div",Ue,[e.createElementVNode("div",je,[e.renderSlot(t.$slots,"icon",{item:f,index:`${m}-${C}`},()=>[f.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["menu-item-icon",f.icon])},null,2)):e.createCommentVNode("",!0)],!0)]),a.isPaneOpen?(e.openBlock(),e.createElementBlock("span",We,e.toDisplayString(f.title),1)):e.createCommentVNode("",!0)])],10,Ge))),128))])):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("li",{key:3,class:e.normalizeClass(["menu-item",{active:s.isActiveItem(n),disabled:n.disabled}]),onClick:f=>s.selectItem(n,m)},[e.createElementVNode("div",qe,[e.createElementVNode("div",Je,[e.renderSlot(t.$slots,"icon",{item:n,index:m},()=>[n.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["menu-item-icon",n.icon])},null,2)):e.createCommentVNode("",!0)],!0)]),a.isPaneOpen?(e.openBlock(),e.createElementBlock("span",Qe,e.toDisplayString(n.title),1)):e.createCommentVNode("",!0)])],10,Ze))],64))),128))])]),t.$slots.footer?(e.openBlock(),e.createElementBlock("div",Xe,[e.renderSlot(t.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)])],2),e.createElementVNode("div",Ye,[e.createElementVNode("div",ve,[e.createElementVNode("div",et,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])])],2)}const K=E(_e,[["render",tt],["__scopeId","data-v-17e24428"]]),ot=["onMouseenter","onMouseleave"],nt={class:"f-notification__header"},lt={class:"f-notification__icon"},it=["src"],st={class:"f-notification__content"},at={key:0,class:"f-notification__title"},rt=["onClick"],dt={key:0,class:"f-notification__body"},ct={key:1,class:"f-notification__progress"},mt={class:"f-notification__progress-text"},ut={key:2,class:"f-notification__actions"},L=E(e.defineComponent({__name:"FNotification",props:{position:{default:"top-right"},maxCount:{default:5}},emits:["show","close","closeAll","action","pause","resume"],setup(t,{expose:o,emit:l}){const i={template:`
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path
d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z"
stroke="currentColor"
stroke-width="1.5"
/>
<path d="M8 6V8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
<path d="M8 11V11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
</svg>
`},a={template:`
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path
d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z"
stroke="currentColor"
stroke-width="1.5"
/>
<path d="M5.5 8L7 9.5L10.5 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>
`},s={template:`
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path
d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z"
stroke="currentColor"
stroke-width="1.5"
/>
<path d="M8 5V9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
<path d="M8 12V12.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
</svg>
`},n={template:`
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<path
d="M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z"
stroke="currentColor"
stroke-width="1.5"
/>
<path d="M5.5 5.5L10.5 10.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
<path d="M10.5 5.5L5.5 10.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" />
</svg>
`},m=e.ref([]);let f=0;const C=t,r=l,w=g=>{const h=g.id||`notification-${++f}`,c=m.value.findIndex(F=>F.id===h);c!==-1&&m.value.splice(c,1);const V={...g,id:h,type:g.type||"info",variant:g.variant||"standard",duration:g.duration??4e3};if(m.value.unshift(V),m.value.length>C.maxCount&&(m.value=m.value.slice(0,C.maxCount)),V.duration>0){const F=setTimeout(()=>{b(h)},V.duration);V.timeoutId=F}return r("show",V),h},b=g=>{const h=m.value.findIndex(c=>c.id===g);if(h!==-1){const c=m.value[h];c.timeoutId&&clearTimeout(c.timeoutId),m.value.splice(h,1),r("close",c)}},u=()=>{m.value.forEach(g=>{g.timeoutId&&clearTimeout(g.timeoutId)}),r("closeAll"),m.value=[]},B=(g,h)=>{const c=m.value.find(V=>V.id===g);c&&(c.progress=Math.max(0,Math.min(100,h)),c.showProgress=!0)},S=g=>{const h=m.value.find(c=>c.id===g);h&&h.timeoutId&&(clearTimeout(h.timeoutId),delete h.timeoutId,r("pause",h))},y=g=>{const h=m.value.find(c=>c.id===g);if(h&&!h.timeoutId&&h.duration>0){const c=setTimeout(()=>{b(g)},h.duration);h.timeoutId=c,r("resume",h)}},d=(g,h)=>{r("action",{notification:g,action:h}),h.handler(),b(g.id)},k=g=>{switch(g){case"success":return a;case"warning":return s;case"error":return n;default:return i}};o({show:w,close:b,closeAll:u,updateProgress:B});let $=null;const T=($||($={show:w,close:b,closeAll:u,updateProgress:B}),$);return typeof window<"u"&&(window.$notification=T),e.onMounted(()=>{}),e.onUnmounted(()=>{u()}),(g,h)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.TransitionGroup,{name:"notification",tag:"div",class:e.normalizeClass(["f-notification-container",[`f-notification-container--${g.position}`]])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.id,class:e.normalizeClass(["f-notification",[`f-notification--${c.type}`,`f-notification--${c.variant}`,{"f-notification--has-action":c.action}]]),onMouseenter:V=>S(c.id),onMouseleave:V=>y(c.id)},[e.createElementVNode("div",nt,[e.createElementVNode("div",lt,[c.iconUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:c.iconUrl,class:"f-notification__icon-img",alt:""},null,8,it)):c.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.icon),{key:1})):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k(c.type)),{key:2}))]),e.createElementVNode("div",st,[c.title?(e.openBlock(),e.createElementBlock("div",at,e.toDisplayString(c.title),1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"f-notification__close",onClick:V=>b(c.id),"aria-label":"关闭通知"},h[0]||(h[0]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[e.createElementVNode("path",{d:"M2.25 2.25L9.75 9.75M9.75 2.25L2.25 9.75",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)]),8,rt)]),c.body?(e.openBlock(),e.createElementBlock("div",dt,e.toDisplayString(c.body),1)):e.createCommentVNode("",!0),c.showProgress&&typeof c.progress=="number"?(e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",{class:"f-notification__progress-bar",style:e.normalizeStyle({width:Math.max(0,Math.min(100,c.progress))+"%"})},null,4),e.createElementVNode("div",mt,e.toDisplayString(Math.round(c.progress))+"%",1)])):e.createCommentVNode("",!0),c.action||c.actions?(e.openBlock(),e.createElementBlock("div",ut,[c.action&&!c.actions?(e.openBlock(),e.createBlock(_,{key:0,"button-type":c.action.type||"standard",class:"f-notification__action-btn",onClick:V=>d(c,c.action)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.action.text),1)]),_:2},1032,["button-type","onClick"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.actions,(V,F)=>{var W;return e.openBlock(),e.createBlock(_,{key:F,"button-type":V.type||"standard",class:e.normalizeClass(["f-notification__action-btn",`f-notification__action-btn--${((W=c.actions)==null?void 0:W.length)||1}`]),onClick:Wt=>d(c,V)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.text),1)]),_:2},1032,["button-type","class","onClick"])}),128))])):e.createCommentVNode("",!0)],42,ot))),128))]),_:1},8,["class"])]))}}),[["__scopeId","data-v-1f4bf731"]]),ht={name:"FRadio",props:{value:{type:[String,Number],required:!0},groupName:{type:String,default:"defaultGroup"}},setup(t){const o=e.inject("updateValue");return{isChecked:e.computed(()=>e.inject("radioGroup",{value:null}).value===t.value),handleChange:()=>{o&&o(t.value)},handleFocus:m=>{},handleBlur:m=>{},handleClick:m=>{}}}},pt={class:"radio-container"},ft=["name","value","checked"],kt={class:"radio-label"};function gt(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("label",pt,[e.createElementVNode("input",{type:"radio",name:l.groupName,value:l.value,checked:i.isChecked,onChange:o[0]||(o[0]=(...n)=>i.handleChange&&i.handleChange(...n)),onFocus:o[1]||(o[1]=(...n)=>i.handleFocus&&i.handleFocus(...n)),onBlur:o[2]||(o[2]=(...n)=>i.handleBlur&&i.handleBlur(...n)),onClick:o[3]||(o[3]=(...n)=>i.handleClick&&i.handleClick(...n))},null,40,ft),o[4]||(o[4]=e.createElementVNode("span",{class:"radio-checkmark"},null,-1)),e.createElementVNode("span",kt,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])}const x=E(ht,[["render",gt],["__scopeId","data-v-050bfc6b"]]),yt={name:"FRadioGroup",props:{modelValue:{type:[String,Number],default:null}},setup(t,{slots:o,emit:l}){const i=e.ref(t.modelValue);e.watch(()=>t.modelValue,s=>{i.value=s});const a=s=>{i.value=s,l("update:modelValue",s),l("change",s)};return e.provide("updateValue",a),{localValue:i}}},Ct={class:"radio-group"};function wt(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("div",Ct,[e.renderSlot(t.$slots,"default",{},void 0,!0)])}const A=E(yt,[["render",wt],["__scopeId","data-v-9cc75180"]]),bt=e.defineComponent({name:"FSlider",props:{modelValue:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},disabled:{type:Boolean,default:!1},label:{type:String,default:""},showValue:{type:Boolean,default:!1},showThumbValue:{type:Boolean,default:!1},valuePosition:{type:String,default:"header"}},emits:["update:modelValue","change","input","focus","blur","mousedown","mouseup","keydown","keyup"],setup(t,{emit:o}){const l=e.ref(null),i=e.ref(!1),a=e.computed(()=>t.label||t.showValue&&t.valuePosition==="header"),s=e.computed(()=>`value-${t.valuePosition}`),n=e.computed(()=>{const b=(t.modelValue-t.min)/(t.max-t.min)*100;return Math.max(0,Math.min(100,b))}),m=b=>{o("update:modelValue",b)},f=b=>{const u=b.target,B=parseFloat(u.value);m(B),o("input",B)},C=b=>{const u=b.target,B=parseFloat(u.value);o("change",B)},r=()=>{i.value=!0},w=()=>{i.value=!1};return e.onMounted(()=>{l.value&&(l.value.addEventListener("mousedown",r),window.addEventListener("mouseup",w))}),e.onUnmounted(()=>{l.value&&l.value.removeEventListener("mousedown",r),window.removeEventListener("mouseup",w)}),{sliderRef:l,isDragging:i,fillPercentage:n,handleInput:f,handleChange:C,showHeader:a,valuePositionClass:s}}}),Bt={key:0,class:"winui-slider-header"},Vt={key:0,class:"winui-slider-label"},Et={key:1,class:"winui-slider-value"},$t={class:"winui-slider-wrapper"},Nt=["min","max","step","value","disabled"],_t={class:"winui-slider-track"},St={key:0,class:"winui-slider-thumb-value"},Ft={key:0,class:"winui-slider-value-below"},Mt={key:1,class:"winui-slider-value-above"},Tt={key:1,class:"winui-slider-value-left"},It={key:2,class:"winui-slider-value-right"};function Lt(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["winui-slider-container",t.valuePositionClass])},[t.showHeader?(e.openBlock(),e.createElementBlock("div",Bt,[t.label?(e.openBlock(),e.createElementBlock("label",Vt,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue&&t.valuePosition==="header"?(e.openBlock(),e.createElementBlock("span",Et,e.toDisplayString(t.modelValue),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.createElementVNode("input",{ref:"sliderRef",type:"range",class:"winui-slider",min:t.min,max:t.max,step:t.step,value:t.modelValue,disabled:t.disabled,onInput:o[0]||(o[0]=(...n)=>t.handleInput&&t.handleInput(...n)),onChange:o[1]||(o[1]=(...n)=>t.handleChange&&t.handleChange(...n)),onFocus:o[2]||(o[2]=(...n)=>t.handleFocus&&t.handleFocus(...n)),onBlur:o[3]||(o[3]=(...n)=>t.handleBlur&&t.handleBlur(...n)),onKeydown:o[4]||(o[4]=(...n)=>t.handleKeydown&&t.handleKeydown(...n)),onKeyup:o[5]||(o[5]=(...n)=>t.handleKeyup&&t.handleKeyup(...n))},null,40,Nt),e.createElementVNode("div",_t,[e.createElementVNode("div",{class:"winui-slider-track-fill",style:e.normalizeStyle({width:t.fillPercentage+"%"})},null,4)]),e.createElementVNode("div",{class:e.normalizeClass(["winui-slider-thumb",{active:t.isDragging}]),style:e.normalizeStyle({left:t.fillPercentage+"%"})},[t.showThumbValue?(e.openBlock(),e.createElementBlock("div",St,e.toDisplayString(t.modelValue),1)):e.createCommentVNode("",!0)],6),t.showValue&&t.valuePosition==="below"?(e.openBlock(),e.createElementBlock("div",Ft,e.toDisplayString(t.modelValue),1)):e.createCommentVNode("",!0),t.showValue&&t.valuePosition==="above"?(e.openBlock(),e.createElementBlock("div",Mt,e.toDisplayString(t.modelValue),1)):e.createCommentVNode("",!0)]),t.showValue&&t.valuePosition==="left"?(e.openBlock(),e.createElementBlock("div",Tt,e.toDisplayString(t.modelValue),1)):e.createCommentVNode("",!0),t.showValue&&t.valuePosition==="right"?(e.openBlock(),e.createElementBlock("div",It,e.toDisplayString(t.modelValue),1)):e.createCommentVNode("",!0)],2)}const G=E(bt,[["render",Lt],["__scopeId","data-v-f4303e86"]]),Dt={name:"FTooltips",props:{text:{type:String,default:""},position:{type:String,default:"top",validator:t=>["top","bottom","left","right"].includes(t)},delay:{type:Number,default:500},disabled:{type:Boolean,default:!1}},data(){return{visible:!1,timeoutId:null}},methods:{showTooltip(){this.disabled||(this.timeoutId=setTimeout(()=>{this.visible=!0,this.$emit("show"),this.$nextTick(()=>{this.calculatePosition()})},this.delay))},hideTooltip(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.visible=!1,this.$emit("hide")},calculatePosition(){const t=this.$refs.tooltipContainer.querySelector(".tooltip-trigger"),o=this.$refs.tooltip;if(!t||!o)return;const l=t.getBoundingClientRect(),i=o.getBoundingClientRect();this.$refs.tooltipContainer.getBoundingClientRect();let a,s;switch(this.position){case"top":a=-(i.height+8),s=(l.width-i.width)/2;break;case"bottom":a=l.height+8,s=(l.width-i.width)/2;break;case"left":a=(l.height-i.height)/2,s=-(i.width+8);break;case"right":a=(l.height-i.height)/2,s=l.width+8;break}o.style.top=`${a}px`,o.style.left=`${s}px`}},beforeUnmount(){this.timeoutId&&clearTimeout(this.timeoutId)}},zt={class:"tooltip-container",ref:"tooltipContainer"},Pt={class:"tooltip-content"};function Ot(t,o,l,i,a,s){return e.openBlock(),e.createElementBlock("div",zt,[e.createElementVNode("div",{class:"tooltip-trigger",onMouseenter:o[0]||(o[0]=(...n)=>s.showTooltip&&s.showTooltip(...n)),onMouseleave:o[1]||(o[1]=(...n)=>s.hideTooltip&&s.hideTooltip(...n)),onFocus:o[2]||(o[2]=(...n)=>s.showTooltip&&s.showTooltip(...n)),onBlur:o[3]||(o[3]=(...n)=>s.hideTooltip&&s.hideTooltip(...n))},[e.renderSlot(t.$slots,"trigger",{},void 0,!0)],32),e.createVNode(e.Transition,{name:"tooltip-fade",appear:""},{default:e.withCtx(()=>[a.visible?(e.openBlock(),e.createElementBlock("div",{key:0,ref:"tooltip",class:e.normalizeClass(["tooltip",`tooltip-${l.position}`])},[e.createElementVNode("div",Pt,[e.renderSlot(t.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(l.text),1)],!0)])],2)):e.createCommentVNode("",!0)]),_:3})],512)}const U=E(Dt,[["render",Ot],["__scopeId","data-v-f67517ab"]]);class Ht{constructor(){I(this,"instance",null);I(this,"container",null);I(this,"audioContext",null);this.init()}init(){if(typeof window>"u")return;this.container=document.createElement("div"),this.container.id="f-notification-root",document.body.appendChild(this.container);const o=e.createApp(L);this.instance=o.mount(this.container),(window.AudioContext||window.webkitAudioContext)&&(this.audioContext=new(window.AudioContext||window.webkitAudioContext))}playSound(o){if(!(!o||typeof window>"u"))try{this.audioContext?new Audio(o).play().catch(i=>{console.warn("Failed to play notification sound:",i)}):new Audio(o).play().catch(i=>{console.warn("Failed to play notification sound:",i)})}catch(l){console.warn("Failed to play notification sound:",l)}}show(o){if(!this.instance)return console.warn("NotificationManager not initialized"),"";if(o.sound)this.playSound(o.sound);else{const i={info:"/src/assets/Windows Notify System Generic.wav",success:"/src/assets/Windows Notify System Generic.wav",warning:"/src/assets/Windows Notify System Generic.wav",error:"/src/assets/Windows Notify System Generic.wav"}[o.type||"info"];i&&this.playSound(i)}return this.instance.show(o)}close(o){this.instance&&this.instance.close(o)}closeAll(){this.instance&&this.instance.closeAll()}updateProgress(o,l){this.instance&&this.instance.updateProgress(o,l)}info(o,l,i){return this.show({type:"info",title:l,body:o,duration:i??4e3})}success(o,l,i){return this.show({type:"success",title:l,body:o,duration:i??4e3})}warning(o,l,i){return this.show({type:"warning",title:l,body:o,duration:i??4e3})}error(o,l,i){return this.show({type:"error",title:l,body:o,duration:i??4e3})}destroy(){this.container&&this.instance&&(this.instance.closeAll(),this.container.remove(),this.instance=null,this.container=null)}}let D=null;const j=()=>(D||(D=new Ht),D);typeof window<"u"&&(window.$notification=j());const Rt={install(t){t.component("FButton",_),t.component("FInput",z),t.component("FSwitch",P),t.component("FComboBox",O),t.component("FContentDialog",H),t.component("FMenuFlyout",R),t.component("FNavigationView",K),t.component("FNotification",L),t.component("FRadio",x),t.component("FRadioGroup",A),t.component("FSilder",G),t.component("FTooltips",U)}};p.FButton=_,p.FComboBox=O,p.FContentDialog=H,p.FInput=z,p.FMenuFlyout=R,p.FNavigationView=K,p.FNotification=L,p.FRadio=x,p.FRadioGroup=A,p.FSilder=G,p.FSwitch=P,p.FTooltips=U,p.default=Rt,p.useNotification=j,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
//# sourceMappingURL=index.umd.js.map