@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12.7 kB
JavaScript
var r=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?r(...t):typeof t=="object"?Object.keys(t).map((o,i)=>t[i]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var f=(e,t)=>r({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.fillMode}-${t.themeColor}`]:t.fillMode&&t.themeColor},{[`${e}-${t.themeColor}`]:t.themeColor&&t.fillMode===void 0},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full"}),z=(e,t)=>{let{valid:o,invalid:i,hover:l,focus:d,checked:p,active:x,selected:m,disabled:h,indeterminate:T,loading:S,empty:_,readonly:O,highlighted:v,...E}=t;return r({"k-valid":o,"k-invalid":i,"k-hover":l,"k-focus":d,"k-checked":p,"k-active":x,"k-selected":m,"k-disabled":h,"k-indeterminate":T&&!p,"k-loading":S,"k-empty":_,"k-readonly":O,"k-highlighted":v},Object.keys(E).reduce((g,I)=>(I.startsWith("k-")?g[I]=E[I]:g[`k-${I}`]=E[I],g),{}))};function Ne(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(i=>[`k-${i}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},u={small:"small",medium:"medium",large:"large",full:"full"},c={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},s={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},a={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 P="input",X=P;import{jsx as Je}from"react/jsx-runtime";var q="k-input",qe=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],Ge={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline]},G={size:n.medium,rounded:n.medium,fillMode:c.solid},b=e=>{let{hover:t,focus:o,disabled:i,invalid:l,valid:d,loading:p,readonly:x,size:m=G.size,rounded:h=G.rounded,fillMode:T=G.fillMode,...S}=e;return Je("span",{...S,className:r(e.className,q,f(q,{size:m,rounded:h,fillMode:T}),z(q,{hover:t,focus:o,disabled:i,invalid:l,valid:d,loading:p,readonly:x}))})};b.states=qe;b.options=Ge;b.className=q;b.defaultOptions=G;b.moduleName=P;b.folderName=X;import{jsx as Ye}from"react/jsx-runtime";var J="k-picker",We=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],Qe={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline]},W={size:n.medium,rounded:u.medium,fillMode:c.solid},B=e=>{let{hover:t,focus:o,disabled:i,invalid:l,valid:d,loading:p,readonly:x,size:m=W.size,rounded:h=W.rounded,fillMode:T=W.fillMode,...S}=e;return Ye("span",{...S,className:r(e.className,J,f(J,{size:m,rounded:h,fillMode:T}),z(J,{hover:t,focus:o,disabled:i,invalid:l,valid:d,loading:p,readonly:x})),children:e.children})};B.states=We;B.options=Qe;B.className=J;B.defaultOptions=W;B.moduleName=P;B.folderName=X;import{Fragment as tt,jsx as he}from"react/jsx-runtime";var ee="k-font-icon",Ze=[],je={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},et={},R=e=>{let{size:t,themeColor:o,icon:i,rotate:l,flip:d,...p}=e;return i?he("span",{...p,className:r(e.className,ee,f(ee,{size:t}),{[`k-i-${i}`]:i,[`k-color-${o}`]:o,[`k-rotate-${l}`]:l,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):he(tt,{})};R.states=Ze;R.options=je;R.className=ee;R.defaultOptions=et;var Me=R;import{Fragment as st,jsx as Q}from"react/jsx-runtime";var te="k-svg-icon",ot=[],nt={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},Ie={viewBox:"0 0 24 24"},w=e=>{let{size:t,themeColor:o,rotate:i,flip:l,viewBox:d=Ie.viewBox,icon:p,...x}=e;if(!p)return Q(st,{});p==="none"&&{...x,className:r(e.className,te,"k-none")};let m=typeof p=="object"&&p.name&&p.name;return Q("span",{...x,className:r(e.className,te,f("k-icon",{size:t}),{[`k-svg-i-${m}`]:m,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:Q("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:e.children})})};w.states=ot;w.options=nt;w.className=te;w.defaultOptions=Ie;var oe=w;import*as ne from"@progress/kendo-svg-icons";var be="icon",ge="icons";import{Fragment as Te,jsx as H}from"react/jsx-runtime";var Y="k-icon",at=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),rt=[],it={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},se={viewBox:"0 0 24 24",type:"svg"},N=e=>{let{size:t,themeColor:o,icon:i,type:l=se.type,rotate:d,flip:p,viewBox:x=se.viewBox,...m}=e;if(!i)return H(Te,{});if(l==="svg"){if(i==="none")return H(oe,{...m,className:r(e.className,Y),icon:i,size:t});let h=ne[i]?i:at(`${i}-icon`);return ne[h]?H(oe,{...m,className:r(e.className,Y),icon:ne[h],size:t,themeColor:o,rotate:d,flip:p,viewBox:x}):H(Te,{})}return H(Me,{...m,className:r(e.className,Y),icon:i,size:t,themeColor:o,rotate:d,flip:p})};N.states=rt;N.options=it;N.defaultOptions=se;N.className=Y;N.moduleName=be;N.folderName=ge;import{Fragment as ct,jsx as ae}from"react/jsx-runtime";var Se="k-clear-value",lt=[a.disabled,a.loading,a.readonly],pt={},K=e=>{let{disabled:t,loading:o,readonly:i,value:l}=e;return t||i||o||!l?ae(ct,{}):ae("span",{className:r(e.className,Se),children:ae(N,{icon:"x"})})};K.states=lt;K.options=pt;K.className=Se;import{jsx as mt}from"react/jsx-runtime";var re="k-input-inner",dt=[],ut={},Z={type:"text",autocomplete:"off",value:"",placeholder:""},U=e=>{let{value:t=Z.value,type:o=Z.type,placeholder:i=Z.placeholder,autocomplete:l=Z.autocomplete,...d}=e;return mt("input",{...d,type:o,className:r(e.className,re,f(re,e)),placeholder:i,autoComplete:l,defaultValue:t})};U.states=dt;U.options=ut;U.className=re;import{jsx as ve,jsxs as Nt}from"react/jsx-runtime";var ie="k-input-inner",ft=[],xt={},le=e=>{let{value:t,placeholder:o,showValue:i,valueIcon:l,valueIconName:d,...p}=e;return Nt("span",{...p,className:r(e.className,ie,f(ie,e)),children:[l,!l&&d&&ve(N,{className:"k-input-value-icon",icon:d}),i&&!t&&o,i&&t&&ve("span",{className:"k-input-value-text",children:t})]})};le.states=ft;le.options=xt;le.className=ie;import{jsx as It}from"react/jsx-runtime";var pe="k-input-inner",ht=[],Mt={},ye={value:"",placeholder:""},ce=e=>{let{value:t=ye.value,placeholder:o=ye.placeholder,rows:i,...l}=e;return It("textarea",{...l,className:r(e.className,pe,f(pe,e)),placeholder:o,rows:i,defaultValue:t})};ce.states=ht;ce.options=Mt;ce.className=pe;import{Fragment as gt,jsx as Oe}from"react/jsx-runtime";var ke="k-input-loading-icon",bt=[a.disabled,a.loading],j=e=>{let{disabled:t,loading:o}=e;return t||!o?Oe(gt,{}):Oe("span",{className:r(e.className,ke,"k-icon k-i-loading")})};j.states=bt;j.className=ke;import{Fragment as vt,jsx as Ee}from"react/jsx-runtime";var Ce="k-input-validation-icon",Tt=[a.valid,a.invalid,a.disabled,a.loading],St={},$=e=>{let{valid:t,invalid:o,disabled:i,loading:l}=e,d=o?"warning-circle":"check-circle";return i||l||!!!(t||o)?Ee(vt,{}):Ee(N,{className:r(Ce),icon:d})};$.states=Tt;$.options=St;$.className=Ce;import{Fragment as kt,jsx as Le}from"react/jsx-runtime";var yt="k-input-prefix",Ot={direction:"horizontal"},Ae=e=>{let{direction:t=Ot.direction,...o}=e;return e.children?Le("span",{...o,className:r(yt,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):Le(kt,{})};import{Fragment as Lt,jsx as ze}from"react/jsx-runtime";var Et="k-input-suffix",Ct={direction:"horizontal"},Be=e=>{let{direction:t=Ct.direction,...o}=e;return e.children?ze("span",{...o,className:r(Et,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):ze(Lt,{})};import{jsx as nn}from"react/jsx-runtime";import{jsx as zt}from"react/jsx-runtime";var At="k-input-suffix-text",_e=e=>{let{children:t,...o}=e;return zt("span",{...o,className:r(At,e.className),children:t})};import{jsx as _t}from"react/jsx-runtime";var Pe="k-input-separator",Bt={direction:"vertical"},de=e=>{let{direction:t=Bt.direction,...o}=e;return _t("span",{...o,className:r(Pe,e.className,{[`${Pe}-${t}`]:t})})};var ue="button",Re=ue;import{Fragment as Ht,jsx as D,jsxs as we}from"react/jsx-runtime";var F="k-button",Pt=["icon-button"],Rt=[a.hover,a.focus,a.active,a.selected,a.disabled,a.generating],wt={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline,c.clear,c.link],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark,s.inverse]},C={size:n.medium,rounded:u.medium,fillMode:c.solid,themeColor:s.base,showArrow:!1,arrowIconName:"caret-alt-down"},M=e=>{let{size:t=C.size,rounded:o=C.rounded,fillMode:i=C.fillMode,themeColor:l=C.themeColor,showArrow:d=C.showArrow,arrowIconName:p=C.arrowIconName,variant:x,hover:m,focus:h,active:T,selected:S,disabled:_,icon:O,text:v,iconClassName:E,...g}=e,I=O!==void 0,V=e.children!==void 0;return we("button",{...g,className:r(e.className,F,Ne(F,x),f(F,{size:t,rounded:o,fillMode:i,themeColor:l}),z(F,{hover:m,focus:h,active:T,disabled:_,selected:S}),{"k-icon-button":!v&&!V&&I}),children:[O&&D(N,{className:r(E,"k-button-icon"),icon:O}),v?we(Ht,{children:[v&&D("span",{className:"k-button-text",children:v}),e.children]}):e.children&&D("span",{className:"k-button-text",children:e.children}),d&&D("span",{className:"k-menu-button-arrow k-button-arrow",children:D(N,{icon:p})})]})};M.states=Rt;M.options=wt;M.variants=Pt;M.className=F;M.defaultOptions=C;M.moduleName=ue;M.folderName=Re;import{jsx as _n}from"react/jsx-runtime";import{jsx as Hn}from"react/jsx-runtime";import{jsx as Dn}from"react/jsx-runtime";import{jsx as He,jsxs as Ft}from"react/jsx-runtime";var Ke="k-spin-button",$t=[],Dt={size:[n.small,n.medium,n.large],fillMode:[c.solid,c.flat,c.outline,c.clear,c.link]},me={size:n.medium,fillMode:c.solid},k=e=>{let{size:t=me.size,fillMode:o=me.fillMode,...i}=e;return Ft("span",{...i,className:r(Ke,e.className),children:[He(M,{className:"k-spinner-increase",icon:"caret-alt-up",rounded:null,size:t,fillMode:o}),He(M,{className:"k-spinner-decrease",icon:"caret-alt-down",rounded:null,size:t,fillMode:o})]})};k.states=$t;k.options=Dt;k.className=Ke;k.defaultOptions=me;k.moduleName=null;k.folderName=null;var Ue="numeric-textbox",$e="numerictextbox";import{Fragment as De,jsx as y,jsxs as fe}from"react/jsx-runtime";var Fe="k-numerictextbox",Vt=[a.hover,a.focus,a.valid,a.invalid,a.loading,a.required,a.disabled,a.readonly],Xt={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline]},L={showSpinButton:!0,showClearButton:!0,size:b.defaultOptions.size,rounded:b.defaultOptions.rounded,fillMode:b.defaultOptions.fillMode,separators:!0},A=e=>{let{size:t=L.size,rounded:o=L.rounded,fillMode:i=L.fillMode,separators:l=L.separators,showClearButton:d=L.showClearButton,showSpinButton:p=L.showSpinButton,prefix:x,suffix:m,value:h,placeholder:T,hover:S,focus:_,valid:O,invalid:v,required:E,loading:g,disabled:I,readonly:V,...Xe}=e;return fe(b,{...Xe,size:t,rounded:o,fillMode:i,hover:S,focus:_,valid:O,invalid:v,required:E,loading:g,disabled:I,readonly:V,className:r(e.className,Fe),children:[x&&fe(De,{children:[y(Ae,{children:x}),l&&y(de,{})]}),y(U,{placeholder:T,value:h}),y($,{valid:O,invalid:v,loading:g,disabled:I}),y(j,{loading:g,disabled:I}),d&&y(K,{loading:g,disabled:I,readonly:V,value:h}),m&&fe(De,{children:[l&&y(de,{}),y(Be,{children:m})]}),p&&y(k,{className:"k-input-spinner",size:t,fillMode:i})]})};A.states=Vt;A.options=Xt;A.className=Fe;A.defaultOptions=L;A.moduleName=Ue;A.folderName=$e;var Ve=A;import{Fragment as qt,jsx as xe}from"react/jsx-runtime";var us=e=>xe(Ve,{suffix:xe(qt,{children:xe(_e,{children:"mm"})}),...e});export{us as NumericTextboxSuffix};