1import{c as d}from"./componentBase.7Bi982Qj.js";import{a as r}from"./InputSelect.NYs5wxxk.js";import{U as c,am as p,e as o,W as m,a7 as f,an as h,Z as i,bF as n,a0 as b}from"./entry.kc5avEVQ.js";const y={name:"JInputStepper",components:{JInputField:r},mixins:[d],props:{modelValue:{default:1,type:Number},min:{default:1,type:Number},max:{default:null,type:Number},step:{default:1,type:Number},label:{type:String,default:""},valueAsText:{type:[String,Number],default:""},labelIcon:{default:null,type:String},layout:{default:"default",type:String},disabled:{type:Boolean,required:!1,default:!1},canIncrease:{type:Boolean,default:null},canDecrease:{type:Boolean,default:null},testId:{type:String,required:!1,default:void 0}},emits:["update:modelValue"],computed:{inputClasses(){const e=this.componentClasses;return this.layout&&(e[`j-input-stepper--${this.layout}`]=!0),e},canDecreaseValue(){return this.canDecrease!==null?this.canDecrease:this.modelValue>this.min},canIncreaseValue(){return this.canIncrease!==null?this.canIncrease:this.modelValue<this.max||this.max===null}},methods:{sanitizeNumber(e){return e=Number.parseInt(e),e<this.min&&(e=this.min),e>this.max&&this.max!==null&&(e=this.max),e},increase(){this.$emit("update:modelValue",this.sanitizeNumber(this.sanitizeNumber(this.modelValue)+this.sanitizeNumber(this.step)))},decrease(){this.$emit("update:modelValue",this.sanitizeNumber(this.sanitizeNumber(this.modelValue)-this.sanitizeNumber(this.step)))}}},_=["data-cy-input-stepper-value"],I=["disabled"],x=["disabled"];function N(e,s,t,V,v,a){const u=p("JInputField");return o(),m("div",{class:b(["j-input-stepper",a.inputClasses]),"data-cy-input-stepper":"","data-cy-input-stepper-value":t.modelValue},[f(u,{"can-tab-focus":!1,class:"j-input","label-icon":t.labelIcon,label:t.label,"value-as-text":t.valueAsText,"toggle-type":"none",disabled:t.disabled,"test-id":t.testId},{default:h(()=>[i("button",{disabled:t.disabled||!a.canDecreaseValue,class:"j-input-stepper__decrease james-icon-minus","data-cy-input-stepper-decrease":"","data-testid":"decrease",onClick:s[0]||(s[0]=n((...l)=>a.decrease&&a.decrease(...l),["stop"]))},null,8,I),i("button",{disabled:t.disabled||!a.canIncreaseValue,class:"j-input-stepper__increase james-icon-plus","data-cy-input-stepper-increase":"","data-testid":"increase",onClick:s[1]||(s[1]=n((...l)=>a.increase&&a.increase(...l),["stop"]))},null,8,x)]),_:1},8,["label-icon","label","value-as-text","disabled","test-id"])],10,_)}const j=c(y,[["render",N],["__scopeId","data-v-29997967"]]);export{j as J};
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.