@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.97 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((n,i)=>e[i]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(t,e)=>a({[`${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)=>a({"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});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"},r={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},s={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"};import{jsx as Oe}from"react/jsx-runtime";var L="k-input",ze=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Te={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},C={size:o.medium,rounded:o.medium,fillMode:m.solid},I=t=>{let{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f,size:x=C.size,rounded:v=C.rounded,fillMode:y=C.fillMode,...N}=t;return Oe("span",{...N,className:a(t.className,L,u(L,{size:x,rounded:v,fillMode:y}),O(L,{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f}))})};I.states=ze;I.options=Te;I.className=L;I.defaultOptions=C;import{jsx as we}from"react/jsx-runtime";var w="k-picker",Le=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Ce={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},A={size:o.medium,rounded:p.medium,fillMode:m.solid},H=t=>{let{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f,size:x=A.size,rounded:v=A.rounded,fillMode:y=A.fillMode,...N}=t;return we("span",{...N,className:a(t.className,w,u(w,{size:x,rounded:v,fillMode:y}),O(w,{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f})),children:t.children})};H.states=Le;H.options=Ce;H.className=w;H.defaultOptions=A;import{Fragment as Ee,jsx as Y}from"react/jsx-runtime";var R="k-icon k-font-icon",Ae=[],He={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},Pe={},k=t=>{let{size:e,themeColor:n,icon:i,rotate:c,flip:d,...l}=t;return i?Y("span",{...l,className:a(t.className,R,u(R,{size:e}),{[`k-i-${i}`]:i,[`k-color-${n}`]:n,[`k-rotate-${c}`]:c,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):Y(Ee,{})};k.states=Ae;k.options=He;k.className=R;k.defaultOptions=Pe;var Z=k;import{Fragment as Ve,jsx as P}from"react/jsx-runtime";var $="k-icon k-svg-icon",Re=[],$e={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},j={viewBox:"0 0 24 24"},b=t=>{let{size:e,themeColor:n,rotate:i,flip:c,viewBox:d=j.viewBox,icon:l,...f}=t;if(!l)return P(Ve,{});l==="none"&&{...f,className:a(t.className,$,"k-none")};let x=typeof l=="object"&&l.name&&l.name;return P("span",{...f,className:a(t.className,$,u("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${n}`]:n,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:P("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:d,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};b.states=Re;b.options=$e;b.className=$;b.defaultOptions=j;var V=b;import*as ee from"@progress/kendo-svg-icons";import{Fragment as te,jsx as S}from"react/jsx-runtime";var Ke=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Be=[],Fe={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},K={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:n,icon:i,type:c=K.type,rotate:d,flip:l,viewBox:f=K.viewBox,...x}=t;if(!i)return S(te,{});if(c==="svg"){if(i==="none")return S(V,{...x,icon:i,size:e});let v=Ke(`${i}-icon`);return ee[v]?S(V,{...x,icon:ee[v],size:e,themeColor:n,rotate:d,flip:l,viewBox:f}):S(te,{})}return S(Z,{...x,icon:i,size:e,themeColor:n,rotate:d,flip:l})};h.states=Be;h.options=Fe;h.defaultOptions=K;import{Fragment as Ge,jsx as B}from"react/jsx-runtime";var oe="k-clear-value",_e=[s.disabled,s.loading,s.readonly],qe={},F=t=>{let{disabled:e,loading:n,readonly:i,value:c}=t;return e||i||n||!c?B(Ge,{}):B("span",{className:a(t.className,oe),children:B(h,{icon:"x"})})};F.states=_e;F.options=qe;F.className=oe;import{jsx as Je}from"react/jsx-runtime";var _="k-input-inner",Ue=[],Xe={},E={type:"text",autocomplete:"off",value:"",placeholder:""},q=t=>{let{value:e=E.value,type:n=E.type,placeholder:i=E.placeholder,autocomplete:c=E.autocomplete,...d}=t;return Je("input",{...d,type:n,className:a(t.className,_,u(_,t)),placeholder:i,autoComplete:c,defaultValue:e})};q.states=Ue;q.options=Xe;q.className=_;import{jsx as ne,jsxs as We}from"react/jsx-runtime";var G="k-input-inner",De=[],Qe={},U=t=>{let{value:e,placeholder:n,showValue:i,valueIcon:c,valueIconName:d,...l}=t;return We("span",{...l,className:a(t.className,G,u(G,t)),children:[c,!c&&d&&ne(h,{className:"k-input-value-icon",icon:d}),i&&!e&&n,i&&e&&ne("span",{className:"k-input-value-text",children:e})]})};U.states=De;U.options=Qe;U.className=G;import{jsx as je}from"react/jsx-runtime";var X="k-input-inner",Ye=[],Ze={},ae={value:"",placeholder:""},M=t=>{let{value:e=ae.value,placeholder:n=ae.placeholder,rows:i,...c}=t;return je("textarea",{...c,className:a(t.className,X,u(X,t)),placeholder:n,rows:i,defaultValue:e})};M.states=Ye;M.options=Ze;M.className=X;import{Fragment as tt,jsx as se}from"react/jsx-runtime";var re="k-input-loading-icon",et=[s.disabled,s.loading],ie=t=>{let{disabled:e,loading:n}=t;return e||!n?se(tt,{}):se("span",{className:a(t.className,re,"k-icon k-i-loading")})};ie.states=et;ie.className=re;import{Fragment as at,jsx as le}from"react/jsx-runtime";var ce="k-input-validation-icon",ot=[s.valid,s.invalid,s.disabled,s.loading],nt={},J=t=>{let{valid:e,invalid:n,disabled:i,loading:c}=t,d=n?"warning-circle":"check-circle";return i||c||!!!(e||n)?le(at,{}):le(h,{className:a(ce),icon:d})};J.states=ot;J.options=nt;J.className=ce;import{Fragment as it,jsx as de}from"react/jsx-runtime";var st="k-input-prefix",rt={direction:"horizontal"},pe=t=>{let{direction:e=rt.direction,...n}=t;return t.children?de("span",{...n,className:a(st,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):de(it,{})};import{Fragment as dt,jsx as ue}from"react/jsx-runtime";var lt="k-input-suffix",ct={direction:"horizontal"},me=t=>{let{direction:e=ct.direction,...n}=t;return t.children?ue("span",{...n,className:a(lt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):ue(dt,{})};import{jsx as No}from"react/jsx-runtime";import{jsx as Mo}from"react/jsx-runtime";import{jsx as ut}from"react/jsx-runtime";var fe="k-input-separator",pt={direction:"vertical"},D=t=>{let{direction:e=pt.direction,...n}=t;return ut("span",{...n,className:a(fe,t.className,{[`${fe}-${e}`]:e})})};import{Fragment as xe,jsx as z,jsxs as Q}from"react/jsx-runtime";var he="k-textarea",mt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled],ft={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},g={size:I.defaultOptions.size,rounded:I.defaultOptions.rounded,fillMode:I.defaultOptions.fillMode,flow:"vertical",affixesOrientation:"horizontal",resize:"both",separators:!0},T=t=>{let{size:e=g.size,rounded:n=g.rounded,fillMode:i=g.fillMode,separators:c=g.separators,affixesOrientation:d=g.affixesOrientation,flow:l=g.flow,resize:f=g.resize,prefix:x,suffix:v,rows:y,value:N,placeholder:Ie,hover:ge,focus:ye,valid:Ne,invalid:ke,required:be,disabled:Se,...Me}=t;return Q(I,{...Me,size:e,rounded:n,fillMode:i,hover:ge,focus:ye,valid:Ne,invalid:ke,required:be,disabled:Se,className:a(t.className,he,{"!k-flex-col":l==="vertical","!k-flex-row":l==="horizontal"}),children:[x&&Q(xe,{children:[z(pe,{className:a({"!k-align-items-start":l===d}),direction:d,children:x}),c&&z(D,{direction:l==="horizontal"?"vertical":"horizontal"})]}),z(M,{className:a("!k-overflow-auto",{"!k-flex-none":l==="vertical","k-resize-x":f==="x","k-resize-y":f==="y","k-resize":f==="both","k-resize-none":f==="none"}),value:N,placeholder:Ie,rows:y}),v&&Q(xe,{children:[c&&z(D,{direction:l==="horizontal"?"vertical":"horizontal"}),z(me,{className:a({"!k-align-items-start":l===d}),direction:d,children:v})]})]})};T.states=mt;T.options=ft;T.className=he;T.defaultOptions=g;var ve=T;import{Fragment as xt,jsx as W}from"react/jsx-runtime";var Wo=t=>W(ve,{prefix:W(xt,{children:W(h,{icon:"comment"})}),...t});export{Wo as TextareaPrefix};