UNPKG

@public-ui/components

Version:

Contains all web components that belong to KoliBri - The accessible HTML-Standard.

4 lines 1.1 kB
/*! * KoliBri - The accessible HTML-Standard */ import{_ as __rest}from"./tslib.es6-CxX45GIN.js";import{h,F as Fragment}from"./index-DyUiyxj3.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-COm9oJpc.js";const InputFc=e=>{const{class:s,msg:i,required:a,disabled:t,touched:l,readonly:o,ariaDescribedBy:r,hideLabel:d,label:n,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(a),"kol-input--touched":Boolean(l),"kol-input--readonly":Boolean(o),[`kol-input--${getMsgType(i)}`]:isMsgDefinedAndInputTouched(i,l)},b=Object.assign(Object.assign({class:clsx("kol-input",g,s),required:a,disabled:t,readonly:o,type:"text",list:u?`${c.id}-list`:void 0},getDefaultProps({ariaDescribedBy:r,hideLabel:d,label:n})),c);return h(Fragment,null,h("input",Object.assign({},b,{value:p})),u)};export{InputFc as I};