@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 1.1 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h,F as Fragment}from"./index-BTX696j0.js";import{c as clsx}from"./clsx-eK3rPvPS.js";import"./common-BXXICkFX.js";import{d as getDefaultProps,g as getMsgType,i as isMsgDefinedAndInputTouched}from"./FormFieldStateWrapper-D0MLneaJ.js";const InputFc=e=>{const{class:s,msg:a,required:i,disabled:t,touched:l,readonly:o,ariaDescribedBy:r,hideLabel:n,label:d,suggestions:u,value:p}=e,c=__rest(e,["class","msg","required","disabled","touched","readonly","ariaDescribedBy","hideLabel","label","suggestions","value"]),g={"kol-input--disabled":Boolean(t),"kol-input--required":Boolean(i),"kol-input--touched":Boolean(l),"kol-input--readonly":Boolean(o),[`kol-input--${getMsgType(a)}`]:isMsgDefinedAndInputTouched(a,l)},b=Object.assign(Object.assign({class:clsx("kol-input",g,s),required:i,disabled:t,readonly:o,type:"text",list:u?`${c.id}-list`:void 0},getDefaultProps({ariaDescribedBy:r,hideLabel:n,label:d})),c);return h(Fragment,null,h("input",Object.assign({},b,{value:p})),u)};export{InputFc as I};