1import{at as g,bb as p,bi as d,Z as v,b as c,c as b,F as S,l as O,j as B,N as L,k as w,X as A,e as V,ab as y,t as K}from"./Tu_9qqDy.js";import{R as T}from"./Bz_7BURO.js";import k from"./BrENwlRC.js";import{s as I}from"./BsgItenP.js";import{f as R}from"./ZhWAdK_X.js";import"./CvMi1f2b.js";import"./jc0MLXVe.js";import"./CzocND4P.js";var D=` 2 .p-selectbutton { 3 display: inline-flex; 4 user-select: none; 5 vertical-align: bottom; 6 outline-color: transparent; 7 border-radius: dt('selectbutton.border.radius'); 8 } 9 10 .p-selectbutton .p-togglebutton { 11 border-radius: 0; 12 border-width: 1px 1px 1px 0; 13 } 14 15 .p-selectbutton .p-togglebutton:focus-visible { 16 position: relative; 17 z-index: 1; 18 } 19 20 .p-selectbutton .p-togglebutton:first-child { 21 border-inline-start-width: 1px; 22 border-start-start-radius: dt('selectbutton.border.radius'); 23 border-end-start-radius: dt('selectbutton.border.radius'); 24 } 25 26 .p-selectbutton .p-togglebutton:last-child { 27 border-start-end-radius: dt('selectbutton.border.radius'); 28 border-end-end-radius: dt('selectbutton.border.radius'); 29 } 30 31 .p-selectbutton.p-invalid { 32 outline: 1px solid dt('selectbutton.invalid.border.color'); 33 outline-offset: 0; 34 } 35 36 .p-selectbutton-fluid { 37 width: 100%; 38 } 39 40 .p-selectbutton-fluid .p-togglebutton { 41 flex: 1 1 0; 42 } 43`,E={root:function(n){var t=n.props,i=n.instance;return["p-selectbutton p-component",{"p-invalid":i.$invalid,"p-selectbutton-fluid":t.fluid}]}},C=g.extend({name:"selectbutton",style:D,classes:E}),x={name:"BaseSelectButton",extends:I,props:{options:Array,optionLabel:null,optionValue:null,optionDisabled:null,multiple:Boolean,allowEmpty:{type:Boolean,default:!0},dataKey:null,ariaLabelledby:{type:String,default:null},size:{type:String,default:null},fluid:{type:Boolean,default:null}},style:C,provide:function(){return{$pcSelectButton:this,$parentInstance:this}}};function _(e,n){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=h(e))||n){t&&(e=t);var i=0,s=function(){};return{s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(u){throw u},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 44In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,a=!0,r=!1;return{s:function(){t=t.call(e)},n:function(){var u=t.next();return a=u.done,u},e:function(u){r=!0,l=u},f:function(){try{a||t.return==null||t.return()}finally{if(r)throw l}}}}function $(e){return j(e)||z(e)||h(e)||q()}function q(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 45In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h(e,n){if(e){if(typeof e=="string")return f(e,n);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,n):void 0}}function z(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function j(e){if(Array.isArray(e))return f(e)}function f(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,i=Array(n);t<n;t++)i[t]=e[t];return i}var P={name:"SelectButton",extends:x,inheritAttrs:!1,emits:["change"],methods:{getOptionLabel:function(n){return this.optionLabel?d(n,this.optionLabel):n},getOptionValue:function(n){return this.optionValue?d(n,this.optionValue):n},getOptionRenderKey:function(n){return this.dataKey?d(n,this.dataKey):this.getOptionLabel(n)},isOptionDisabled:function(n){return this.optionDisabled?d(n,this.optionDisabled):!1},isOptionReadonly:function(n){if(this.allowEmpty)return!1;var t=this.isSelected(n);return this.multiple?t&&this.d_value.length===1:t},onOptionSelect:function(n,t,i){var s=this;if(!(this.disabled||this.isOptionDisabled(t)||this.isOptionReadonly(t))){var l=this.isSelected(t),a=this.getOptionValue(t),r;if(this.multiple)if(l){if(r=this.d_value.filter(function(o){return!p(o,a,s.equalityKey)}),!this.allowEmpty&&r.length===0)return}else r=this.d_value?[].concat($(this.d_value),[a]):[a];else{if(l&&!this.allowEmpty)return;r=l?null:a}this.writeValue(r,n),this.$emit("change",{originalEvent:n,value:r})}},isSelected:function(n){var t=!1,i=this.getOptionValue(n);if(this.multiple){if(this.d_value){var s=_(this.d_value),l;try{for(s.s();!(l=s.n()).done;){var a=l.value;if(p(a,i,this.equalityKey)){t=!0;break}}}catch(r){s.e(r)}finally{s.f()}}}else t=p(this.d_value,i,this.equalityKey);return t}}
45,computed:{equalityKey:function(){return this.optionValue?null:this.dataKey},dataP:function(){return R({invalid:this.$invalid})}},directives:{ripple:T},components:{ToggleButton:k}},F=["aria-labelledby","data-p"];function H(e,n,t,i,s,l){var a=v("ToggleButton");return c(),b("div",y({class:e.cx("root"),role:"group","aria-labelledby":e.ariaLabelledby},e.ptmi("root"),{"data-p":l.dataP}),[(c(!0),b(S,null,O(e.options,function(r,o){return c(),B(a,{key:l.getOptionRenderKey(r),modelValue:l.isSelected(r),onLabel:l.getOptionLabel(r),offLabel:l.getOptionLabel(r),disabled:e.disabled||l.isOptionDisabled(r),unstyled:e.unstyled,size:e.size,readonly:l.isOptionReadonly(r),onChange:function(m){return l.onOptionSelect(m,r,o)},pt:e.ptm("pcToggleButton")},L({_:2},[e.$slots.option?{name:"default",fn:w(function(){return[A(e.$slots,"option",{option:r,index:o},function(){return[V("span",y({ref_for:!0},e.ptm("pcToggleButton").label),K(l.getOptionLabel(r)),17)]})]}),key:"0"}:void 0]),1032,["modelValue","onLabel","offLabel","disabled","unstyled","size","readonly","onChange","pt"])}),128))],16,F)}P.render=H;export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.