@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
4 lines • 2.4 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import{_ as o}from"./tslib.es6-CxX45GIN.js";import{h as l,F as e}from"./index-Biu4X4Y_.js";import{c as t}from"./clsx-eK3rPvPS.js";import"./common-Dd0zJQbD.js";import{b as i,s as r}from"./reuse-CX4AQDkS.js";import{a as s,K as n,b as a,c as d}from"./FormFieldStateWrapper-BJBSoSm4.js";const c=(e,s)=>{var{class:i}=e,r=o(e,["class"]);return l("div",Object.assign({class:t("kol-field-control__input",i)},r),s)},b=(b,p)=>{const{class:f,id:u,disabled:h,label:_,hideLabel:g,labelAlign:m,renderNoTooltip:y,hint:K,renderNoHint:j,tooltipAlign:k,accessKey:C,shortKey:B,msg:P,touched:v,required:O,readonly:A,fieldControlInputProps:N,fieldControlLabelProps:q,fieldControlTooltipProps:x,fieldControlHintProps:L}=b,S=o(b,["class","id","disabled","label","hideLabel","labelAlign","renderNoTooltip","hint","renderNoHint","tooltipAlign","accessKey","shortKey","msg","touched","required","readonly","fieldControlInputProps","fieldControlLabelProps","fieldControlTooltipProps","fieldControlHintProps"]),T=!j,F=!y,H=d(P,v),D=r(_),I=F&&!D&&g,X=i(C,B),J="string"==typeof P?"error":null==P?void 0:P._type,Q=[l(e,null,l(c,Object.assign({},N),p),I&&l(s,Object.assign({},x||{},{id:u,label:_,align:k,badgeText:X}))),l(n,Object.assign({},q||{},{id:u,baseClassName:"kol-field-control",class:t(null==q?void 0:q.class,{"kol-field-control__label--visually-hidden":Boolean(g)}),hasExpertSlot:D,label:_,accessKey:C,shortKey:B}))];"left"===m&&Q.reverse();const $={"kol-field-control--disabled":Boolean(h),"kol-field-control--required":Boolean(O),"kol-field-control--touched":Boolean(v),"kol-field-control--hide-label":Boolean(g),"kol-field-control--read-only":Boolean(A),[`kol-field-control--${J||"error"}`]:Boolean(H),[`kol-field-control--label-align-${m}`]:Boolean(m)};return l("div",Object.assign({class:t("kol-field-control",$,f)},S),Q,T&&l(a,Object.assign({},L||{},{baseClassName:"kol-field-control",id:u,hint:K})))};function f(l){const e={id:l._id,disabled:l._disabled,msg:l._msg,hint:l._hint,label:l._label,hideLabel:l._hideLabel,touched:l._touched};return"_required"in l&&(e.required=l._required),"_readOnly"in l&&(e.readonly=l._readOnly),"_labelAlign"in l&&(e.labelAlign=l._labelAlign),"_accessKey"in l&&(e.accessKey=l._accessKey),"_shortKey"in l&&(e.shortKey=l._shortKey),e}const p=(e,s)=>{var{state:i}=e,r=o(e,["state"]);return l(b,Object.assign({},f(i),r),s)};export{p as F};