@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.02 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 b=(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"}),E=(t,e)=>{let{valid:o,invalid:r,hover:m,focus:a,checked:l,active:d,selected:h,disabled:C,indeterminate:O,loading:S,empty:A,readonly:R,highlighted:B,...I}=e;return n({"k-valid":o,"k-invalid":r,"k-hover":m,"k-focus":a,"k-checked":l,"k-active":d,"k-selected":h,"k-disabled":C,"k-indeterminate":O&&!l,"k-loading":S,"k-empty":A,"k-readonly":R,"k-highlighted":B},Object.keys(I).reduce((T,y)=>(y.startsWith("k-")?T[y]=I[y]:T[`k-${y}`]=I[y],T),{}))};var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},g={small:"small",medium:"medium",large:"large",full:"full"};var 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"},c={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 N="checkbox",M=N;import{jsx as ie}from"react/jsx-runtime";var P="k-checkbox",Te=[c.hover,c.focus,c.valid,c.invalid,c.required,c.disabled,c.checked,c.indeterminate],ye={size:[i.small,i.medium,i.large],rounded:[g.small,g.medium,g.large,g.full]},J={size:i.medium,rounded:g.medium},u=t=>{let{id:e,checked:o,indeterminate:r,hover:m,focus:a,disabled:l,invalid:d,valid:h,required:C,size:O=J.size,rounded:S=J.rounded,...A}=t;return ie("span",{className:"k-checkbox-wrap",children:ie("input",{...A,id:e,type:"checkbox",defaultChecked:o,required:C,className:n(t.className,P,b(P,{size:O,rounded:S}),E(P,{hover:m,focus:a,disabled:l,invalid:d,valid:h,indeterminate:r,checked:o}))})})};u.states=Te;u.options=ye;u.className=P;u.defaultOptions=J;u.moduleName=N;u.folderName=M;import{jsx as Ie}from"react/jsx-runtime";var se="k-checkbox-list",Ee=[],Ne={},ne={layout:"vertical"},w=t=>{let{layout:e=ne.layout,...o}=t;return Ie("ul",{...o,className:n(t.className,se,{[`k-list-${e}`]:e}),children:t.children})};w.states=Ee;w.options=Ne;w.className=se;w.defaultOptions=ne;w.moduleName=N;w.folderName=M;import{jsx as Oe}from"react/jsx-runtime";var le="k-checkbox-list-item",ge=[],Me={},Le={},k=t=>{let{...e}=t;return Oe("li",{...e,className:n(t.className,le),children:t.children})};k.states=ge;k.options=Me;k.className=le;k.defaultOptions=Le;k.moduleName=N;k.folderName=M;import{Fragment as yt,jsx as Tt,jsxs as Et}from"react/jsx-runtime";import{Fragment as Lt,jsx as Mt,jsxs as Ot}from"react/jsx-runtime";import{Fragment as _t,jsx as Kt,jsxs as Ht}from"react/jsx-runtime";import{Fragment as $t,jsx as Pt,jsxs as Dt}from"react/jsx-runtime";import{jsx as Ut}from"react/jsx-runtime";import{jsx as Qt}from"react/jsx-runtime";import{Fragment as Ke,jsx as ae}from"react/jsx-runtime";var Q="k-font-icon",Se=[],Ae={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},Re={},K=t=>{let{size:e,themeColor:o,icon:r,rotate:m,flip:a,...l}=t;return r?ae("span",{...l,className:n(t.className,Q,b(Q,{size:e}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${m}`]:m,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"})}):ae(Ke,{})};K.states=Se;K.options=Ae;K.className=Q;K.defaultOptions=Re;var me=K;import{Fragment as ze,jsx as $}from"react/jsx-runtime";var Y="k-svg-icon",_e=[],He={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},ce={viewBox:"0 0 24 24"},_=t=>{let{size:e,themeColor:o,rotate:r,flip:m,viewBox:a=ce.viewBox,icon:l,...d}=t;if(!l)return $(ze,{});l==="none"&&{...d,className:n(t.className,Y,"k-none")};let h=typeof l=="object"&&l.name&&l.name;return $("span",{...d,className:n(t.className,Y,b("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:$("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:a,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};_.states=_e;_.options=He;_.className=Y;_.defaultOptions=ce;var Z=_;import*as j from"@progress/kendo-svg-icons";var pe="icon",de="icons";import{Fragment as xe,jsx as H}from"react/jsx-runtime";var D="k-icon",Ge=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Be=[],Pe={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},ee={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:o,icon:r,type:m=ee.type,rotate:a,flip:l,viewBox:d=ee.viewBox,...h}=t;if(!r)return H(xe,{});if(m==="svg"){if(r==="none")return H(Z,{...h,className:n(t.className,D),icon:r,size:e});let C=j[r]?r:Ge(`${r}-icon`);return j[C]?H(Z,{...h,className:n(t.className,D),icon:j[C],size:e,themeColor:o,rotate:a,flip:l,viewBox:d}):H(xe,{})}return H(me,{...h,className:n(t.className,D),icon:r,size:e,themeColor:o,rotate:a,flip:l})};v.states=Be;v.options=Pe;v.defaultOptions=ee;v.className=D;v.moduleName=pe;v.folderName=de;import{jsx as he}from"react/jsx-runtime";import{createElement as De}from"react";var $e="k-treeview-group",x=t=>{let{children:e,dir:o}=t,r=[];return e&&(Array.isArray(e)?e.map((m,a)=>{m.type===z&&r.push(De(z,{...m.props,dir:o,key:a}))}):e.type===z&&r.push(he(z,{...e.props,dir:o}))),he("ul",{className:n(t.className,$e),children:r})};import{jsx as fe,jsxs as Ve}from"react/jsx-runtime";var te="k-treeview-leaf",Fe=[c.hover,c.focus,c.selected],Xe={},F=t=>{let{text:e,showIcon:o,icon:r,hover:m,focus:a,selected:l,...d}=t;return Ve("span",{...d,className:n(t.className,te,E(te,{hover:m,focus:a,selected:l})),children:[o&&fe(v,{icon:r}),fe("span",{className:"k-treeview-leaf-text",children:e})]})};F.states=Fe;F.options=Xe;F.className=te;var ue=F;var G="treeview",X=G;import{Fragment as Qe,jsx as L,jsxs as ve}from"react/jsx-runtime";import{createElement as qe}from"react";var Ce="k-treeview-item",Ue=[c.hover,c.focus,c.selected,c.disabled],We={},Je={},p=t=>{let{leafClassName:e,children:o,hasChildren:r,expanded:m,text:a,showIcon:l,icon:d,showCheckbox:h,checked:C,hover:O,focus:S,selected:A,disabled:R,top:B,bottom:I,dir:T,...y}=t,re=r||o,U=[];return o&&(Array.isArray(o)?o.map((W,ke)=>{W.type===x&&U.push(qe(x,{...W.props,dir:T,key:ke},W.props.children))}):o.type===x&&U.push(L(x,{...o.props,dir:T,children:o.props.children}))),ve("li",{...y,className:n(t.className,Ce),children:[ve("span",{className:n({"k-treeview-top":B,"k-treeview-bot":I,"k-treeview-mid":!B&&!I}),children:[re&&L("span",{className:n("k-treeview-toggle",E("k-treeview-toggle",{disabled:R})),children:L(v,{icon:m?"caret-alt-down":T==="rtl"?"caret-alt-left":"caret-alt-right"})}),h&&L(u,{checked:C,disabled:R}),L(ue,{className:n(e,E(e,{disabled:R})),text:a,showIcon:l,icon:d,hover:O,focus:S,selected:A})]}),m&&re&&L(Qe,{children:U})]})};p.states=Ue;p.options=We;p.className=Ce;p.defaultOptions=Je;p.moduleName=G;p.folderName=X;var z=p;import{jsx as Wo}from"react/jsx-runtime";import{jsx as Yo,jsxs as Zo}from"react/jsx-runtime";import{jsx as or,jsxs as rr}from"react/jsx-runtime";import{jsx as lr,jsxs as ar}from"react/jsx-runtime";import{jsx as dr,jsxs as xr}from"react/jsx-runtime";import{jsx as V}from"react/jsx-runtime";import{createElement as be}from"react";var oe="k-treeview",Ye=[],Ze={size:[i.small,i.medium,i.large]},we={size:i.medium},f=t=>{let{size:e=we.size,children:o,dir:r,...m}=t,a=[];return o&&(Array.isArray(o)?o.map((l,d)=>{l.type===p&&a.push(be(p,{...l.props,dir:r,key:d})),l.type===x&&a.push(be(x,{...l.props,dir:r,key:d}))}):(o.type===p&&a.push(V(p,{...o.props,dir:r})),o.type===x&&a.push(V(x,{...o.props,dir:r})))),V("div",{...m,dir:r,className:n(t.className,oe,b(oe,{size:e})),children:V(x,{className:"k-treeview-lines",dir:r,children:a})})};f.states=Ye;f.options=Ze;f.className=oe;f.defaultOptions=we;f.moduleName=G;f.folderName=X;var Mr=f;export{oe as TREEVIEW_CLASSNAME,f as Treeview,Mr as default};