UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 2.67 kB
var r=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((t,n)=>e[n]||e[t]&&t||null).filter(t=>t!==null).join(" "):e).filter(e=>!!e).join(" ");var p=(o,e)=>{let{valid:t,invalid:n,hover:d,focus:m,checked:i,active:u,selected:g,disabled:h,indeterminate:L,loading:f,empty:k,readonly:R,highlighted:H,...N}=e;return r({"k-valid":t,"k-invalid":n,"k-hover":d,"k-focus":m,"k-checked":i,"k-active":u,"k-selected":g,"k-disabled":h,"k-indeterminate":L&&!i,"k-loading":f,"k-empty":k,"k-readonly":R,"k-highlighted":H},Object.keys(N).reduce((E,c)=>(c.startsWith("k-")?E[c]=N[c]:E[`k-${c}`]=N[c],E),{}))};var x={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",generating:"generating",expanded:"expanded"};var F="label",A="label";import{jsx as S,jsxs as P}from"react/jsx-runtime";var v="k-label",_=[x.disabled],T={},z={},l=o=>{let{disabled:e,optional:t,info:n,text:d,children:m,...i}=o;return P("label",{...i,className:r(o.className,v,p(v,{disabled:e})),children:[d||m,t&&S("span",{className:"k-label-optional",children:"(Optional)"}),n&&S("span",{className:"k-field-info",children:n})]})};l.states=_;l.options=T;l.className=v;l.defaultOptions=z;l.moduleName=F;l.folderName=A;import{jsx as I}from"react/jsx-runtime";var $="k-form-hint",C=[],D={},B={},s=o=>{let{text:e,children:t,...n}=o;return I("div",{...n,className:r(o.className,$),children:e||t})};s.states=C;s.options=D;s.className=$;s.defaultOptions=B;import{jsx as U}from"react/jsx-runtime";var K="k-form-error",w=[],j={},q={},a=o=>{let{text:e,children:t,...n}=o;return U("div",{...n,className:r(o.className,K),children:e||t})};a.states=w;a.options=j;a.className=K;a.defaultOptions=q;import{jsx as b,jsxs as O}from"react/jsx-runtime";var y="k-form-field",J=[x.disabled],M=o=>{let{editorId:e,label:t,orientation:n,optional:d,editor:m,hint:i,error:u,info:g,disabled:h,dir:L,colSpan:f,...k}=o;return O("div",{...k,className:r(y,o.className,p(y,{disabled:h}),{[`k-col-span-${f}`]:f}),dir:L,children:[t&&b(l,{className:"k-form-label",id:e?`${e}-label`:void 0,htmlFor:e||void 0,optional:d,info:g?"(field info)":void 0,children:t}),n==="horizontal"&&!t&&b("span",{className:"k-label k-form-label k-label-empty"}),O("div",{className:"k-form-field-wrap",children:[m,i&&b(s,{id:e?`${e}-hint`:void 0,children:i}),u&&b(a,{id:e?`${e}-error`:void 0,children:u})]})]})};M.states=J;M.className=y;var he=M;export{y as FORMFIELD_CLASSNAME,M as FormField,he as default};