@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 1.13 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
;var Heading=require("./Heading-DNsjTrzP.js"),index=require("./index-DxCCX-ts.js"),clsx=require("./clsx-CkZlkaek.js");require("./common-BHv-S8J5.js");var FormFieldStateWrapper=require("./FormFieldStateWrapper-3kG9sQmm.js");const InputFc=e=>{const{class:r,msg:i,required:a,disabled:s,touched:l,readonly:t,ariaDescribedBy:d,hideLabel:n,label:o,suggestions:u,value:c}=e,p=Heading.__rest(e,["class","msg","required","disabled","touched","readonly","ariaDescribedBy","hideLabel","label","suggestions","value"]),b=FormFieldStateWrapper.checkHasMsg(i,l),g={"kol-input--disabled":Boolean(s),"kol-input--required":Boolean(a),"kol-input--touched":Boolean(l),"kol-input--readonly":Boolean(t),[`kol-input--${(null==i?void 0:i.type)||"error"}`]:b},x=Object.assign(Object.assign({class:clsx.clsx("kol-input",g,r),required:a,disabled:s,readonly:t,type:"text",list:u?`${p.id}-list`:void 0},FormFieldStateWrapper.getDefaultProps({ariaDescribedBy:d,hideLabel:n,label:o})),p);return index.h(index.Fragment,null,index.h("input",Object.assign({},x,{value:c})),u)};exports.InputFc=InputFc;