import{r as e,j as t}from"./app-eaa32a4a.js";import{I as s}from"./index-4abfb1b1.js";class n extends e.Component{constructor(e){super(e),this.onSet=e=>{this.setState({value:e})},this.onReduce=()=>{this.onSet(this.state.value-1),this.inputChange(this.state.value-1)},this.onAdd=()=>{this.onSet(this.state.value+1),this.inputChange(this.state.value+1)},this.inputChange=e=>{"number"==typeof e&&this.props.onChange&&this.props.onChange(e,this.name)},this.state={value:0},this.name=e.name??""}render(){const{align:e,addAndSubtract:n,onChange:a}=this.props,i=e??"left",h=n??!0;return t.jsxs("div",{className:["c-reset-input-number-box",h?"c-reset-input-number-add":""].join(" "),children:[h&&t.jsx("div",{className:"reduce",onClick:this.onReduce,children:"-"}),t.jsx(s,{className:"c-reset-input-number",align:i,onChange:this.inputChange,theme:"normal",defaultValue:1,value:this.props.value}),h&&t.jsx("div",{className:"add",onClick:this.onAdd,children:"+"})]})}}export{n as I};
