1import{B as c,aY as p,c3 as f,cz as a,cq as h,Q as v,j as d,o as g,l as u,a6 as s,q as m,s as y,C as i,p as k}from"./DZ7mik94.js";import{s as B}from"./Cu8igjOL.js";var S=` 2 .p-togglebutton { 3 display: inline-flex; 4 cursor: pointer; 5 user-select: none; 6 overflow: hidden; 7 position: relative; 8 color: dt('togglebutton.color'); 9 background: dt('togglebutton.background'); 10 border: 1px solid dt('togglebutton.border.color'); 11 padding: dt('togglebutton.padding'); 12 font-size: 1rem; 13 font-family: inherit; 14 font-feature-settings: inherit; 15 transition: 16 background dt('togglebutton.transition.duration'), 17 color dt('togglebutton.transition.duration'), 18 border-color dt('togglebutton.transition.duration'), 19 outline-color dt('togglebutton.transition.duration'), 20 box-shadow dt('togglebutton.transition.duration'); 21 border-radius: dt('togglebutton.border.radius'); 22 outline-color: transparent; 23 font-weight: dt('togglebutton.font.weight'); 24 } 25 26 .p-togglebutton-content { 27 display: inline-flex; 28 flex: 1 1 auto; 29 align-items: center; 30 justify-content: center; 31 gap: dt('togglebutton.gap'); 32 padding: dt('togglebutton.content.padding'); 33 background: transparent; 34 border-radius: dt('togglebutton.content.border.radius'); 35 transition: 36 background dt('togglebutton.transition.duration'), 37 color dt('togglebutton.transition.duration'), 38 border-color dt('togglebutton.transition.duration'), 39 outline-color dt('togglebutton.transition.duration'), 40 box-shadow dt('togglebutton.transition.duration'); 41 } 42 43 .p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover { 44 background: dt('togglebutton.hover.background'); 45 color: dt('togglebutton.hover.color'); 46 } 47 48 .p-togglebutton.p-togglebutton-checked { 49 background: dt('togglebutton.checked.background'); 50 border-color: dt('togglebutton.checked.border.color'); 51 color: dt('togglebutton.checked.color'); 52 } 53 54 .p-togglebutton-checked .p-togglebutton-content { 55 background: dt('togglebutton.content.checked.background'); 56 box-shadow: dt('togglebutton.content.checked.shadow'); 57 } 58 59 .p-togglebutton:focus-visible { 60 box-shadow: dt('togglebutton.focus.ring.shadow'); 61 outline: dt('togglebutton.focus.ring.width') dt('togglebutton.focus.ring.style') dt('togglebutton.focus.ring.color'); 62 outline-offset: dt('togglebutton.focus.ring.offset'); 63 } 64 65 .p-togglebutton.p-invalid { 66 border-color: dt('togglebutton.invalid.border.color'); 67 } 68 69 .p-togglebutton:disabled { 70 opacity: 1; 71 cursor: default; 72 background: dt('togglebutton.disabled.background'); 73 border-color: dt('togglebutton.disabled.border.color'); 74 color: dt('togglebutton.disabled.color'); 75 } 76 77 .p-togglebutton-label, 78 .p-togglebutton-icon { 79 position: relative; 80 transition: none; 81 } 82 83 .p-togglebutton-icon { 84 color: dt('togglebutton.icon.color'); 85 } 86 87 .p-togglebutton:not(:disabled):not(.p-togglebutton-checked):hover .p-togglebutton-icon { 88 color: dt('togglebutton.icon.hover.color'); 89 } 90 91 .p-togglebutton.p-togglebutton-checked .p-togglebutton-icon { 92 color: dt('togglebutton.icon.checked.color'); 93 } 94 95 .p-togglebutton:disabled .p-togglebutton-icon { 96 color: dt('togglebutton.icon.disabled.color'); 97 } 98 99 .p-togglebutton-sm { 100 padding: dt('togglebutton.sm.padding'); 101 font-size: dt('togglebutton.sm.font.size'); 102 } 103 104 .p-togglebutton-sm .p-togglebutton-content { 105 padding: dt('togglebutton.content.sm.padding'); 106 } 107 108 .p-togglebutton-lg { 109 padding: dt('togglebutton.lg.padding'); 110 font-size: dt('togglebutton.lg.font.size'); 111 } 112 113 .p-togglebutton-lg .p-togglebutton-content { 114 padding: dt('togglebutton.content.lg.padding'); 115 } 116 117 .p-togglebutton-fluid { 118 width: 100%; 119 } 120`,P={root:function(n){var o=n.instance,l=n.props;return["p-togglebutton p-component",{"p-togglebutton-checked":o.active,"p-invalid":o.$invalid,"p-togglebutton-fluid":l.fluid,"p-togglebutton-sm p-inputfield-sm":l.size==="small","p-togglebutton-lg p-inputfield-lg":l.size==="large"}]},content:"p-togglebutton-content",icon:"p-togglebutton-icon",label:"p-togglebutton-label"},w=c.extend({name:"togglebutton",style:S,classes:P}),L={name:"BaseToggleButton",extends:B,props:{onIcon:String,offIcon:String,onLabel:{type:String,default:"Yes"},offLabel:{type:String,default:"No"},readonly:{type:Boolean,default:!1},tabindex:{type:Number,default:null},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null},size:{type:String,default:null},fluid:{type:Boolean,default:null}},style:w,provide:function(){return{$pcToggleButton:this,$parentInstance:this}}};function r(t){"@babel/helpers - typeof";return r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r(t)}function z(t,n,o){return(n=T(n))in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function T(t){var n=C(t,"string");return r(n)=="symbol"?n:n+""}function C(t,n){if(r(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var l=o.call(t,n);if(r(l)!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}var I={name:"ToggleButton",extends:L,inheritAttrs:!1,emits:["change"],methods:{getPTOptions:function(n){var o=n==="root"?this.ptmi:this.ptm;return o(n,{context:{active:this.active,disabled:this.disabled}})},onChange:function(n){!this.disabled&&!this.readonly&&(this.writeValue(!this.d_value,n),this.$emit("change",n))},onBlur:function(n){var o,l;(o=(l=this.formField).onBlur)===null||o===void 0||o.call(l,n)}},computed:{active:function(){return this.d_value===!0},hasLabel:function(){return a(this.onLabel)&&a(this.offLabel)},label:function(){return this.hasLabel?this.d_value?this.onLabel:this.offLabel:"Â "}
120,dataP:function(){return f(z({checked:this.active,invalid:this.$invalid},this.size,this.size))}},directives:{ripple:p}},O=["tabindex","disabled","aria-pressed","aria-label","aria-labelledby","data-p-checked","data-p-disabled","data-p"],j=["data-p"];function x(t,n,o,l,N,e){var b=h("ripple");return v((g(),d("button",i({type:"button",class:t.cx("root"),tabindex:t.tabindex,disabled:t.disabled,"aria-pressed":t.d_value,onClick:n[0]||(n[0]=function(){return e.onChange&&e.onChange.apply(e,arguments)}),onBlur:n[1]||(n[1]=function(){return e.onBlur&&e.onBlur.apply(e,arguments)})},e.getPTOptions("root"),{"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"data-p-checked":e.active,"data-p-disabled":t.disabled,"data-p":e.dataP}),[u("span",i({class:t.cx("content")},e.getPTOptions("content"),{"data-p":e.dataP}),[s(t.$slots,"default",{},function(){return[s(t.$slots,"icon",{value:t.d_value,class:m(t.cx("icon"))},function(){return[t.onIcon||t.offIcon?(g(),d("span",i({key:0,class:[t.cx("icon"),t.d_value?t.onIcon:t.offIcon]},e.getPTOptions("icon")),null,16)):y("",!0)]}),u("span",i({class:t.cx("label")},e.getPTOptions("label")),k(e.label),17)]})],16,j)],16,O)),[[b]])}I.render=x;
120export{I 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.