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