import{k as e}from"./vendor-element-plus.js?ver=3.1.10";import{W as t,Y as a,a5 as o,X as n,a8 as s,a9 as d,aa as r}from"./vendor.js?ver=3.1.10";import{_ as i}from"./fc-bits-ui.js?ver=3.1.10";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,y,c){const v=e;return t(),a(v,{type:"primary",size:"small",onClick:l[0]||(l[0]=e=>i.$emit("save")),loading:u.loading},{default:o(()=>[u.loading?s("",!0):(t(),n("span",m,"⌘s")),d(" "+r(u.loading&&u.loadingText?u.loadingText:c.displayText),1)],void 0),_:1},8,["loading"])}]]);export{u as S};
