UNPKG

@public-ui/components

Version:

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

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