import{r as i,c as n,h as t,H as a}from"./p-cb5076d4.js";const r={small:{size:14,strokeWidth:2},medium:{size:16,strokeWidth:2},large:{size:18,strokeWidth:2}},e=({scale:i="medium"})=>r[i],o=class{constructor(t){i(this,t),this.change=n(this,"change",7),this.blur=n(this,"blur",7),this.focus=n(this,"focus",7),this.leaned=!1,this.scale="medium",this.type="text",this.disabled=!1,this.progressing=!1,this.readonly=!1,this.autoComplete="on",this.long=!1,this.overrideStyle={}}focusOnInput(){this.textInput.focus()}render(){const{disabled:i,enableClear:n,feedback:r,leaned:o,name:s,placeholder:l,progressing:d,scale:c,type:p,value:u}=this,v=this.overrideStyle||{};return this.width&&(v["--width"]=this.width,v["--min-width"]=this.width),t(a,{class:{leaned:o,[c]:!0,[r]:!!r,progressing:d,disabled:i},style:v},t(this.long?"textarea":"input",{ref:i=>this.textInput=i,type:p,name:s,placeholder:l,disabled:i,value:u,onFocus:i=>{i.stopPropagation(),this.focus.emit(i)},onBlur:i=>{i.stopPropagation(),this.blur.emit(i)},onInput:i=>{i.stopPropagation(),this.change.emit(i.target.value)},onChange:i=>i.stopPropagation(),readonly:this.readonly,autocomplete:this.autoComplete,style:this.overrideStyle}),d&&t("div",{class:"progress-container"},t("dvn-progress",{indefinite:!0,leaned:!0,tint:"neutral",size:e(this).size,strokeWidth:e(this).strokeWidth})),n&&u&&t("div",{class:"progress-container"},t("dvn-icon-button",{onClick:()=>this.change.emit(void 0),iconName:"uil uil-times",leaned:!0,scale:"small",tint:"neutral",view:"flat"})))}};o.style="dvn-input{--width:inherit;--min-width:256px;--base-color:var(--color-primary);--border-color:var(--color-border);--margin:var(--spacing-unit) calc(1.5 * var(--spacing-unit));position:relative;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;margin:var(--margin);width:var(--width);min-width:var(--min-width);}dvn-input.leaned{--margin:0}dvn-input.disabled{opacity:0.6;cursor:default}dvn-input.warning{--base-color:var(--color-warning);--border-color:var(--color-warning)}dvn-input.error{--base-color:var(--color-danger);--border-color:var(--color-danger)}dvn-input.small{--font-size:var(--font-size-small);--height:24px;--padding:calc(var(--spacing-unit) * 0.75) calc(1.5 * var(--spacing-unit))}dvn-input.medium{--font-size:var(--font-size-medium);--height:32px;--padding:var(--spacing-unit) calc(2 * var(--spacing-unit))}dvn-input.large{--font-size:var(--font-size-large);--height:40px;--padding:calc(1.5 * var(--spacing-unit)) calc(2.5 * var(--spacing-unit))}dvn-input.progressing.small{--padding:calc(var(--spacing-unit) * 0.75) calc(6 * var(--spacing-unit)) calc(var(--spacing-unit) * 0.75) calc(1.5 * var(--spacing-unit))}dvn-input.progressing.medium{--padding:var(--spacing-unit) calc(7 * var(--spacing-unit)) var(--spacing-unit) calc(2 * var(--spacing-unit))}dvn-input.progressing.large{--padding:calc(1.5 * var(--spacing-unit)) calc(8 * var(--spacing-unit)) calc(1.5 * var(--spacing-unit)) calc(2.5 * var(--spacing-unit))}dvn-input .progress-container{position:absolute;right:calc(2 * var(--spacing-unit));top:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}dvn-input input,dvn-input textarea{outline:none;width:var(--width);min-width:var(--min-width);-webkit-transition:all 0.3s;transition:all 0.3s;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--color-text);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--corner-radius);background-color:var(--color-input-background);vertical-align:top;font-size:var(--font-size);height:var(--height);padding:var(--padding);-webkit-appearance:none}dvn-input textarea{height:unset;border-bottom-right-radius:3px}dvn-input input:disabled,dvn-input textarea:disabled{cursor:unset}dvn-input input:hover:enabled,dvn-input textarea:hover:enabled{border-color:var(--base-color)}dvn-input input:focus:enabled,dvn-input textarea:focus:enabled{border-color:var(--base-color);-webkit-box-shadow:0px 0px 0px 1px var(--base-color);box-shadow:0px 0px 0px 1px var(--base-color)}dvn-input input::-webkit-input-placeholder,dvn-input textarea::-webkit-input-placeholder{color:var(--color-text-secondary)}dvn-input input::-moz-placeholder,dvn-input textarea::-moz-placeholder{color:var(--color-text-secondary)}dvn-input input:-ms-input-placeholder,dvn-input textarea:-ms-input-placeholder{color:var(--color-text-secondary)}dvn-input input::-ms-input-placeholder,dvn-input textarea::-ms-input-placeholder{color:var(--color-text-secondary)}dvn-input input::placeholder,dvn-input textarea::placeholder{color:var(--color-text-secondary)}";export{o as dvn_input}