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