1import{au as v,aw as m,b3 as S,aE as O,aI as p,aS as d,aT as B,e as b,o as c,F as w,X as L,g as A,aW as V,j as K,ac as T,k as I,a9 as y,t as k}from"./ClacqbRY.js";import D from"./CNZkw_hu.js";var E=` 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`,R={root:function(n){var t=n.props,l=n.instance;return["p-selectbutton p-component",{"p-invalid":l.$invalid,"p-selectbutton-fluid":t.fluid}]}},C=v.extend({name:"selectbutton",style:E,classes:R}),x={name:"BaseSelectButton",extends:S,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 l=0,s=function(){};return{s,n:function(){return l>=e.length?{done:!0}:{done:!1,value:e[l++]}},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 r,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var u=t.next();return i=u.done,u},e:function(u){a=!0,r=u},f:function(){try{i||t.return==null||t.return()}finally{if(a)throw r}}}}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,l=Array(n);t<n;t++)l[t]=e[t];return l}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,l){var s=this;if(!(this.disabled||this.isOptionDisabled(t)||this.isOptionReadonly(t))){var r=this.isSelected(t),i=this.getOptionValue(t),a;if(this.multiple)if(r){if(a=this.d_value.filter(function(o){return!p(o,i,s.equalityKey)}),!this.allowEmpty&&a.length===0)return}else a=this.d_value?[].concat($(this.d_value),[i]):[i];else{if(r&&!this.allowEmpty)return;a=r?null:i}this.writeValue(a,n),this.$emit("change",{event:n,value:a})}},isSelected:function(n){var t=!1,l=this.getOptionValue(n);if(this.multiple){if(this.d_value){var s=_(this.d_value),r;try{for(s.s();!(r=s.n()).done;){var i=r.value;if(p(i,l,this.equalityKey)){t=!0;break}}}catch(a){s.e(a)}finally{s.f()}}}else t=p(this.d_value,l,this.equalityKey);return t}}
45,computed:{equalityKey:function(){return this.optionValue?null:this.dataKey},dataP:function(){return O({invalid:this.$invalid})}},directives:{ripple:m},components:{ToggleButton:D}},F=["aria-labelledby","data-p"];function H(e,n,t,l,s,r){var i=B("ToggleButton");return c(),b("div",y({class:e.cx("root"),role:"group","aria-labelledby":e.ariaLabelledby},e.ptmi("root"),{"data-p":r.dataP}),[(c(!0),b(w,null,L(e.options,function(a,o){return c(),A(i,{key:r.getOptionRenderKey(a),modelValue:r.isSelected(a),onLabel:r.getOptionLabel(a),offLabel:r.getOptionLabel(a),disabled:e.disabled||r.isOptionDisabled(a),unstyled:e.unstyled,size:e.size,readonly:r.isOptionReadonly(a),onChange:function(g){return r.onOptionSelect(g,a,o)},pt:e.ptm("pcToggleButton")},V({_:2},[e.$slots.option?{name:"default",fn:K(function(){return[T(e.$slots,"option",{option:a,index:o},function(){return[I("span",y({ref_for:!0},e.ptm("pcToggleButton").label),k(r.getOptionLabel(a)),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.