/*! third party licenses: js/vendor.LICENSE.txt */
import{h as k,o as i,c as a,a as s,t as o,b as u,m as r,bp as f,bq as C,r as p,H as _,f as m,n as V,E as b,p as v,g as x,_ as I}from"./store-BBMiux8F.chunk.mjs";const S={name:"CheckIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},$=["aria-hidden","aria-label"],z=["fill","width","height"],H={d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},L={key:0};function M(e,n,t,d,h,l){return i(),a("span",r(e.$attrs,{"aria-hidden":t.title?null:!0,"aria-label":t.title,class:"material-design-icon check-icon",role:"img",onClick:n[0]||(n[0]=c=>e.$emit("click",c))}),[(i(),a("svg",{fill:t.fillColor,class:"material-design-icon__svg",width:t.size,height:t.size,viewBox:"0 0 24 24"},[s("path",H,[t.title?(i(),a("title",L,o(t.title),1)):u("",!0)])],8,z))],16,$)}const w=k(S,[["render",M]]),B={name:"NcActionButton",components:{CheckIcon:w,ChevronRightIcon:f},mixins:[C],inject:{isInSemanticMenu:{from:"NcActions:isSemanticMenu",default:!1}},props:{ariaHidden:{type:Boolean,default:null},disabled:{type:Boolean,default:!1},isMenu:{type:Boolean,default:!1},type:{type:String,default:"button",validator:e=>["button","checkbox","radio","reset","submit"].includes(e)},modelValue:{type:[Boolean,String],default:null},value:{type:String,default:null}},emits:["update:modelValue"],computed:{isFocusable(){return!this.disabled},isChecked(){return this.type==="radio"&&typeof this.modelValue!="boolean"?this.modelValue===this.value:this.modelValue},nativeType(){return this.type==="submit"||this.type==="reset"?this.type:"button"},buttonAttributes(){const e={};return this.isInSemanticMenu?(e.role="menuitem",this.type==="radio"?(e.role="menuitemradio",e["aria-checked"]=this.isChecked?"true":"false"):(this.type==="checkbox"||this.nativeType==="button"&&this.modelValue!==null)&&(e.role="menuitemcheckbox",e["aria-checked"]=this.modelValue===null?"mixed":this.modelValue?"true":"false")):this.modelValue!==null&&this.nativeType==="button"&&(e["aria-pressed"]=this.modelValue?"true":"false"),e}},methods:{handleClick(e){this.onClick(e),(this.modelValue!==null||this.type!=="button")&&(this.type==="radio"?typeof this.modelValue!="boolean"?this.isChecked||this.$emit("update:modelValue",this.value):this.$emit("update:modelValue",!this.isChecked):this.$emit("update:modelValue",!this.isChecked))}}},N=e=>(v("data-v-033a4c57"),e=e(),x(),e),T=["role"],A=["aria-label","disabled","title","type"],F={key:0,class:"action-button__longtext-wrapper"},P={class:"action-button__name"},R=N(()=>s("br",null,null,-1)),U=["textContent"],Z=["textContent"],j={key:2,class:"action-button__text"},q={key:5,class:"action-button__pressed-icon material-design-icon"};function E(e,n,t,d,h,l){const c=p("ChevronRightIcon"),y=p("CheckIcon");return i(),a("li",{class:m(["action",{"action--disabled":t.disabled}]),role:l.isInSemanticMenu&&"presentation"},[s("button",r({"aria-label":e.ariaLabel,class:["action-button button-vue",{"action-button--active":l.isChecked,focusable:l.isFocusable}],disabled:t.disabled,title:e.title,type:l.nativeType},l.buttonAttributes,{onClick:n[0]||(n[0]=(...g)=>l.handleClick&&l.handleClick(...g))}),[_(e.$slots,"icon",{},()=>[s("span",{class:m([[e.isIconUrl?"action-button__icon--url":e.icon],"action-button__icon"]),style:V({backgroundImage:e.isIconUrl?`url(${e.icon})`:null}),"aria-hidden":"true"},null,6)],!0),e.name?(i(),a("span",F,[s("strong",P,o(e.name),1),R,s("span",{class:"action-button__longtext",textContent:o(e.text)},null,8,U)])):e.isLongText?(i(),a("span",{key:1,class:"action-button__longtext",textContent:o(e.text)},null,8,Z)):(i(),a("span",j,o(e.text),1)),t.isMenu?(i(),b(c,{key:3,size:20,class:"action-button__menu-icon"})):l.isChecked===!0?(i(),b(y,{key:4,size:20,class:"action-button__pressed-icon"})):l.isChecked===!1?(i(),a("span",q)):u("",!0),u("",!0)],16,A)],10,T)}const X=k(B,[["render",E],["__scopeId","data-v-033a4c57"]]),D={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},G=["aria-hidden","aria-label"],J=["fill","width","height"],K={d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"},O={key:0};function Q(e,n,t,d,h,l){return i(),a("span",r(e.$attrs,{"aria-hidden":t.title?null:!0,"aria-label":t.title,class:"material-design-icon plus-icon",role:"img",onClick:n[0]||(n[0]=c=>e.$emit("click",c))}),[(i(),a("svg",{fill:t.fillColor,class:"material-design-icon__svg",width:t.size,height:t.size,viewBox:"0 0 24 24"},[s("path",K,[t.title?(i(),a("title",O,o(t.title),1)):u("",!0)])],8,J))],16,G)}const Y=I(D,[["render",Q]]);export{w as C,X as N,Y as P};
