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