| 1 |
import{_ as e,I as a}from"./descriptionToPlainText.js?ver=2.0.15";import{aO as l,S as t,Z as n,H as o,ax as i,a2 as r,T as s,a7 as u,a9 as p}from"./vendor.js?ver=2.0.15";const c=["aria-label"],d=["aria-pressed","title","aria-label","onClick"],m={key:1};const b=e({name:"SegmentedControl",components:{Icons:a},props:{modelValue:{type:[String,Number],default:null},options:{type:Array,required:!0},ariaLabel:{type:String,default:"View"}},emits:["update:modelValue"]},[["render",function(e,a,b,y,v,f){const g=l("Icons");return t(),n("div",{class:"fbs_report_segmented",role:"group","aria-label":e.$t(b.ariaLabel)},[(t(!0),n(o,null,i(b.options,a=>(t(),n("button",{key:a.value,type:"button",class:r(["fbs_report_segmented--btn",{"is-active":b.modelValue===a.value}]),"aria-pressed":b.modelValue===a.value?"true":"false",title:a.label?e.$t(a.label):null,"aria-label":a.label?e.$t(a.label):null,onClick:l=>e.$emit("update:modelValue",a.value)},[a.icon?(t(),s(g,{key:0,"icon-name":a.icon},null,8,["icon-name"])):u("",!0),a.label&&!a.iconOnly?(t(),n("span",m,p(e.$t(a.label)),1)):u("",!0)],10,d))),128))],8,c)}]]);const y=e({name:"ChartTypeToggle",components:{SegmentedControl:b},props:{modelValue:{type:String,default:"bar"},only:{type:Array,default:null}},emits:["update:modelValue"],data:()=>({types:[{value:"table",label:"Table view",icon:"table",iconOnly:!0},{value:"bar",label:"Bar chart",icon:"chart-bar",iconOnly:!0},{value:"line",label:"Line chart",icon:"chart-line",iconOnly:!0},{value:"pie",label:"Pie chart",icon:"chart-pie",iconOnly:!0}]}),computed:{visibleTypes(){const e=this.only||["bar","line","pie"];return this.types.filter(a=>e.includes(a.value))}}},[["render",function(e,a,n,o,i,r){const u=l("SegmentedControl");return t(),s(u,{"model-value":n.modelValue,options:r.visibleTypes,"aria-label":"Chart type","onUpdate:modelValue":a[0]||(a[0]=a=>e.$emit("update:modelValue",a))},null,8,["model-value","options"])}]]);export{y as C,b as S}; |