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