@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 1.62 kB
JavaScript
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((l,n)=>e[n]||e[l]&&l||null).filter(l=>l!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(t,e)=>i({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly,"k-highlighted":e.highlighted});var f={open:"open",hover:"hover",focus:"focus",active:"active",selected:"selected",disabled:"disabled",valid:"valid",invalid:"invalid",loading:"loading",required:"required",empty:"empty",indeterminate:"indeterminate",checked:"checked",readonly:"readonly",highlighted:"highlighted"};import{jsx as a,jsxs as r}from"react/jsx-runtime";var d="k-form-field",v=[f.disabled],o=t=>{let{label:e,orientation:l,optional:n,editor:x,hint:s,error:m,info:k,disabled:h,dir:g,colSpan:c}=t;return r("div",{className:i(d,t.className,u(d,{disabled:h}),{[`k-col-span-${c}`]:c}),dir:g,children:[e&&r("label",{className:i("k-label","k-form-label"),children:[e,n&&a("span",{className:"k-label-optional",children:"(Optional)"}),k&&a("span",{className:"k-field-info",children:"(field info)"})]}),l==="horizontal"&&!e&&a("span",{className:"k-label k-form-label k-label-empty"}),r("div",{className:"k-form-field-wrap",children:[x,s&&a("div",{className:"k-form-hint",children:s}),m&&a("div",{className:"k-form-error",children:m})]})]})};o.states=v;o.className=d;var K=o;export{d as FORMFIELD_CLASSNAME,o as FormField,K as default};