import{k as e}from"./vendor-element-plus.js?ver=3.1.0";import{a as t,o as a,w as o,c as n,L as s,O as d,P as r}from"./vendor.js?ver=3.1.0";import{_ as i}from"./fc-bits-ui.js?ver=3.1.0";const l={name:"SaveButton",props:{loading:{type:Boolean,default:!1},text:{type:String,default:""},loadingText:{type:String,default:""}},emits:["save"],computed:{displayText(){return""===this.text?this.$t("Save"):this.text}},methods:{handleKeyboardShortcut(e){(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),this.$emit("save"))}},mounted(){document.addEventListener("keydown",this.handleKeyboardShortcut)},beforeUnmount(){document.removeEventListener("keydown",this.handleKeyboardShortcut)}},m={key:0,class:"cmd"};const u=i(l,[["render",function(i,l,u,p,c,y){const v=e;return a(),t(v,{type:"primary",size:"small",onClick:l[0]||(l[0]=e=>i.$emit("save")),loading:u.loading},{default:o(()=>[u.loading?s("",!0):(a(),n("span",m,"⌘s")),d(" "+r(u.loading&&u.loadingText?u.loadingText:y.displayText),1)],void 0),_:1},8,["loading"])}]]);export{u as S};
