@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.7 kB
JavaScript
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((s,i)=>e[i]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(t,e)=>l({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),O=(t,e)=>l({"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 o={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},p={small:"small",medium:"medium",large:"large",full:"full"},m={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},a={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},n={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 fe}from"react/jsx-runtime";var C="k-input",ue=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],me={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},H={size:o.medium,rounded:o.medium,fillMode:m.solid},g=t=>{let{hover:e,focus:s,disabled:i,invalid:r,valid:d,loading:c,readonly:h,size:f=H.size,rounded:I=H.rounded,fillMode:v=H.fillMode,...y}=t;return fe("span",{...y,className:l(t.className,C,u(C,{size:f,rounded:I,fillMode:v}),O(C,{hover:e,focus:s,disabled:i,invalid:r,valid:d,loading:c,readonly:h}))})};g.states=ue;g.options=me;g.className=C;g.defaultOptions=H;import{jsx as ge}from"react/jsx-runtime";var A="k-picker",xe=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],he={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},w={size:o.medium,rounded:p.medium,fillMode:m.solid},P=t=>{let{hover:e,focus:s,disabled:i,invalid:r,valid:d,loading:c,readonly:h,size:f=w.size,rounded:I=w.rounded,fillMode:v=w.fillMode,...y}=t;return ge("span",{...y,className:l(t.className,A,u(A,{size:f,rounded:I,fillMode:v}),O(A,{hover:e,focus:s,disabled:i,invalid:r,valid:d,loading:c,readonly:h})),children:t.children})};P.states=xe;P.options=he;P.className=A;P.defaultOptions=w;import{Fragment as Ne,jsx as Q}from"react/jsx-runtime";var V="k-icon k-font-icon",Ie=[],ve={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},ye={},N=t=>{let{size:e,themeColor:s,icon:i,rotate:r,flip:d,...c}=t;return i?Q("span",{...c,className:l(t.className,V,u(V,{size:e}),{[`k-i-${i}`]:i,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):Q(Ne,{})};N.states=Ie;N.options=ve;N.className=V;N.defaultOptions=ye;var W=N;import{Fragment as Se,jsx as R}from"react/jsx-runtime";var K="k-icon k-svg-icon",be=[],ke={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},Y={viewBox:"0 0 24 24"},b=t=>{let{size:e,themeColor:s,rotate:i,flip:r,viewBox:d=Y.viewBox,icon:c,...h}=t;if(!c)return R(Se,{});c==="none"&&{...h,className:l(t.className,K,"k-none")};let f=typeof c=="object"&&c.name&&c.name;return R("span",{...h,className:l(t.className,K,u("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${s}`]:s,[`k-rotate-${i}`]:i,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:R("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:d,dangerouslySetInnerHTML:typeof c=="object"?{__html:c.content}:void 0,children:c?void 0:t.children})})};b.states=be;b.options=ke;b.className=K;b.defaultOptions=Y;var B=b;import*as Z from"@progress/kendo-svg-icons";import{Fragment as j,jsx as k}from"react/jsx-runtime";var Me=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ze=[],Te={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},F={viewBox:"0 0 24 24",type:"svg"},x=t=>{let{size:e,themeColor:s,icon:i,type:r=F.type,rotate:d,flip:c,viewBox:h=F.viewBox,...f}=t;if(!i)return k(j,{});if(r==="svg"){if(i==="none")return k(B,{...f,icon:i,size:e});let I=Me(`${i}-icon`);return Z[I]?k(B,{...f,icon:Z[I],size:e,themeColor:s,rotate:d,flip:c,viewBox:h}):k(j,{})}return k(W,{...f,icon:i,size:e,themeColor:s,rotate:d,flip:c})};x.states=ze;x.options=Te;x.defaultOptions=F;import{Fragment as Ce,jsx as _}from"react/jsx-runtime";var ee="k-clear-value",Le=[n.disabled,n.loading,n.readonly],Oe={},S=t=>{let{disabled:e,loading:s,readonly:i,value:r}=t;return e||i||s||!r?_(Ce,{}):_("span",{className:l(t.className,ee),children:_(x,{icon:"x"})})};S.states=Le;S.options=Oe;S.className=ee;import{jsx as we}from"react/jsx-runtime";var q="k-input-inner",He=[],Ae={},E={type:"text",autocomplete:"off",value:"",placeholder:""},M=t=>{let{value:e=E.value,type:s=E.type,placeholder:i=E.placeholder,autocomplete:r=E.autocomplete,...d}=t;return we("input",{...d,type:s,className:l(t.className,q,u(q,t)),placeholder:i,autoComplete:r,defaultValue:e})};M.states=He;M.options=Ae;M.className=q;import{jsx as te,jsxs as Ee}from"react/jsx-runtime";var G="k-input-inner",Pe=[],Re={},U=t=>{let{value:e,placeholder:s,showValue:i,valueIcon:r,valueIconName:d,...c}=t;return Ee("span",{...c,className:l(t.className,G,u(G,t)),children:[r,!r&&d&&te(x,{className:"k-input-value-icon",icon:d}),i&&!e&&s,i&&e&&te("span",{className:"k-input-value-text",children:e})]})};U.states=Pe;U.options=Re;U.className=G;import{jsx as Ke}from"react/jsx-runtime";var D="k-input-inner",$e=[],Ve={},oe={value:"",placeholder:""},X=t=>{let{value:e=oe.value,placeholder:s=oe.placeholder,rows:i,...r}=t;return Ke("textarea",{...r,className:l(t.className,D,u(D,t)),placeholder:s,rows:i,defaultValue:e})};X.states=$e;X.options=Ve;X.className=D;import{Fragment as Fe,jsx as ne}from"react/jsx-runtime";var ae="k-input-loading-icon",Be=[n.disabled,n.loading],$=t=>{let{disabled:e,loading:s}=t;return e||!s?ne(Fe,{}):ne("span",{className:l(t.className,ae,"k-icon k-i-loading")})};$.states=Be;$.className=ae;import{Fragment as Ge,jsx as se}from"react/jsx-runtime";var le="k-input-validation-icon",_e=[n.valid,n.invalid,n.disabled,n.loading],qe={},z=t=>{let{valid:e,invalid:s,disabled:i,loading:r}=t,d=s?"warning-circle":"check-circle";return i||r||!!!(e||s)?se(Ge,{}):se(x,{className:l(le),icon:d})};z.states=_e;z.options=qe;z.className=le;import{Fragment as Dt,jsx as Xt}from"react/jsx-runtime";import{Fragment as Yt,jsx as Zt}from"react/jsx-runtime";import{jsx as oo}from"react/jsx-runtime";import{jsx as lo}from"react/jsx-runtime";import{jsx as po}from"react/jsx-runtime";import{jsx as T,jsxs as Xe}from"react/jsx-runtime";var ie="k-searchbox",Ue=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading],De={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},J={showIcon:!0,icon:"search",size:g.defaultOptions.size,rounded:g.defaultOptions.rounded,fillMode:g.defaultOptions.fillMode},L=t=>{let{value:e,placeholder:s,size:i,rounded:r,fillMode:d,hover:c,focus:h,valid:f,invalid:I,required:v,loading:y,disabled:re,showIcon:ce=J.showIcon,icon:de=J.icon,...pe}=t;return Xe(g,{...pe,size:i,rounded:r,fillMode:d,hover:c,focus:h,valid:f,invalid:I,required:v,loading:y,disabled:re,className:l(t.className,ie),children:[ce&&T(x,{className:"k-input-icon",icon:de}),T(M,{placeholder:s,value:e}),T($,{...t}),T(z,{...t}),T(S,{...t})]})};L.states=Ue;L.options=De;L.className=ie;L.defaultOptions=J;var Co=L;export{ie as SEARCHBOX_CLASSNAME,L as Searchbox,Co as default};