@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.36 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"}),N=(t,e)=>{let{valid:o,invalid:r,hover:m,focus:a,checked:l,active:d,selected:f,disabled:C,indeterminate:O,loading:S,empty:R,readonly:_,highlighted:P,...g}=e;return n({"k-valid":o,"k-invalid":r,"k-hover":m,"k-focus":a,"k-checked":l,"k-active":d,"k-selected":f,"k-disabled":C,"k-indeterminate":O&&!l,"k-loading":S,"k-empty":R,"k-readonly":_,"k-highlighted":P},Object.keys(g).reduce((T,E)=>(E.startsWith("k-")?T[E]=g[E]:T[`k-${E}`]=g[E],T),{}))};var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},M={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 K="treeview",B=K;import{jsx as D}from"react/jsx-runtime";import{createElement as se}from"react";var q="k-treeview",Ie=[],ge={size:[i.small,i.medium,i.large]},ne={size:i.medium},h=t=>{let{size:e=ne.size,children:o,dir:r,...m}=t,a=[];return o&&(Array.isArray(o)?o.map((l,d)=>{l.type===p&&a.push(se(p,{...l.props,dir:r,key:d})),l.type===x&&a.push(se(x,{...l.props,dir:r,key:d}))}):(o.type===p&&a.push(D(p,{...o.props,dir:r})),o.type===x&&a.push(D(x,{...o.props,dir:r})))),D("div",{...m,dir:r,className:n(t.className,q,b(q,{size:e})),children:D(x,{className:"k-treeview-lines",dir:r,children:a})})};h.states=Ie;h.options=ge;h.className=q;h.defaultOptions=ne;h.moduleName=K;h.folderName=B;var y="checkbox",L=y;import{jsx as le}from"react/jsx-runtime";var $="k-checkbox",Me=[c.hover,c.focus,c.valid,c.invalid,c.required,c.disabled,c.checked,c.indeterminate],Le={size:[i.small,i.medium,i.large],rounded:[M.small,M.medium,M.large,M.full]},Q={size:i.medium,rounded:M.medium},u=t=>{let{id:e,checked:o,indeterminate:r,hover:m,focus:a,disabled:l,invalid:d,valid:f,required:C,size:O=Q.size,rounded:S=Q.rounded,...R}=t;return le("span",{className:"k-checkbox-wrap",children:le("input",{...R,id:e,type:"checkbox",defaultChecked:o,required:C,className:n(t.className,$,b($,{size:O,rounded:S}),N($,{hover:m,focus:a,disabled:l,invalid:d,valid:f,indeterminate:r,checked:o}))})})};u.states=Me;u.options=Le;u.className=$;u.defaultOptions=Q;u.moduleName=y;u.folderName=L;import{jsx as Se}from"react/jsx-runtime";var ae="k-checkbox-list",Ae=[],Oe={},me={layout:"vertical"},w=t=>{let{layout:e=me.layout,...o}=t;return Se("ul",{...o,className:n(t.className,ae,{[`k-list-${e}`]:e}),children:t.children})};w.states=Ae;w.options=Oe;w.className=ae;w.defaultOptions=me;w.moduleName=y;w.folderName=L;import{jsx as He}from"react/jsx-runtime";var ce="k-checkbox-list-item",Re=[],_e={},Ke={},k=t=>{let{...e}=t;return He("li",{...e,className:n(t.className,ce),children:t.children})};k.states=Re;k.options=_e;k.className=ce;k.defaultOptions=Ke;k.moduleName=y;k.folderName=L;import{Fragment as Gt,jsx as zt,jsxs as Ft}from"react/jsx-runtime";import{Fragment as Xt,jsx as $t,jsxs as Vt}from"react/jsx-runtime";import{Fragment as Qt,jsx as qt,jsxs as Yt}from"react/jsx-runtime";import{Fragment as oo,jsx as to,jsxs as ro}from"react/jsx-runtime";import{jsx as lo}from"react/jsx-runtime";import{jsx as po}from"react/jsx-runtime";import{Fragment as Pe,jsx as pe}from"react/jsx-runtime";var Z="k-font-icon",ze=[],Ge={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]},Fe={},H=t=>{let{size:e,themeColor:o,icon:r,rotate:m,flip:a,...l}=t;return r?pe("span",{...l,className:n(t.className,Z,b(Z,{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"})}):pe(Pe,{})};H.states=ze;H.options=Ge;H.className=Z;H.defaultOptions=Fe;var de=H;import{Fragment as $e,jsx as X}from"react/jsx-runtime";var j="k-svg-icon",Be=[],De={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]},xe={viewBox:"0 0 24 24"},z=t=>{let{size:e,themeColor:o,rotate:r,flip:m,viewBox:a=xe.viewBox,icon:l,...d}=t;if(!l)return X($e,{});l==="none"&&{...d,className:n(t.className,j,"k-none")};let f=typeof l=="object"&&l.name&&l.name;return X("span",{...d,className:n(t.className,j,b("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:X("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})})};z.states=Be;z.options=De;z.className=j;z.defaultOptions=xe;var ee=z;import*as te from"@progress/kendo-svg-icons";var he="icon",fe="icons";import{Fragment as ue,jsx as G}from"react/jsx-runtime";var V="k-icon",Xe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ve=[],Ue={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]},oe={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:o,icon:r,type:m=oe.type,rotate:a,flip:l,viewBox:d=oe.viewBox,...f}=t;if(!r)return G(ue,{});if(m==="svg"){if(r==="none")return G(ee,{...f,className:n(t.className,V),icon:r,size:e});let C=te[r]?r:Xe(`${r}-icon`);return te[C]?G(ee,{...f,className:n(t.className,V),icon:te[C],size:e,themeColor:o,rotate:a,flip:l,viewBox:d}):G(ue,{})}return G(de,{...f,className:n(t.className,V),icon:r,size:e,themeColor:o,rotate:a,flip:l})};v.states=Ve;v.options=Ue;v.defaultOptions=oe;v.className=V;v.moduleName=he;v.folderName=fe;import{jsx as ve}from"react/jsx-runtime";import{createElement as Je}from"react";var We="k-treeview-group",x=t=>{let{children:e,dir:o}=t,r=[];return e&&(Array.isArray(e)?e.map((m,a)=>{m.type===F&&r.push(Je(F,{...m.props,dir:o,key:a}))}):e.type===F&&r.push(ve(F,{...e.props,dir:o}))),ve("ul",{className:n(t.className,We),children:r})};import{jsx as Ce,jsxs as Ye}from"react/jsx-runtime";var re="k-treeview-leaf",qe=[c.hover,c.focus,c.selected],Qe={},U=t=>{let{text:e,showIcon:o,icon:r,hover:m,focus:a,selected:l,...d}=t;return Ye("span",{...d,className:n(t.className,re,N(re,{hover:m,focus:a,selected:l})),children:[o&&Ce(v,{icon:r}),Ce("span",{className:"k-treeview-leaf-text",children:e})]})};U.states=qe;U.options=Qe;U.className=re;var be=U;import{Fragment as ot,jsx as A,jsxs as we}from"react/jsx-runtime";import{createElement as tt}from"react";var ke="k-treeview-item",Ze=[c.hover,c.focus,c.selected,c.disabled],je={},et={},p=t=>{let{leafClassName:e,children:o,hasChildren:r,expanded:m,text:a,showIcon:l,icon:d,showCheckbox:f,checked:C,hover:O,focus:S,selected:R,disabled:_,top:P,bottom:g,dir:T,...E}=t,ie=r||o,W=[];return o&&(Array.isArray(o)?o.map((J,ye)=>{J.type===x&&W.push(tt(x,{...J.props,dir:T,key:ye},J.props.children))}):o.type===x&&W.push(A(x,{...o.props,dir:T,children:o.props.children}))),we("li",{...E,className:n(t.className,ke),children:[we("span",{className:n({"k-treeview-top":P,"k-treeview-bot":g,"k-treeview-mid":!P&&!g}),children:[ie&&A("span",{className:n("k-treeview-toggle",N("k-treeview-toggle",{disabled:_})),children:A(v,{icon:m?"caret-alt-down":T==="rtl"?"caret-alt-left":"caret-alt-right"})}),f&&A(u,{checked:C,disabled:_}),A(be,{className:n(e,N(e,{disabled:_})),text:a,showIcon:l,icon:d,hover:O,focus:S,selected:R})]}),m&&ie&&A(ot,{children:W})]})};p.states=Ze;p.options=je;p.className=ke;p.defaultOptions=et;p.moduleName=K;p.folderName=B;var F=p;import{jsx as lr}from"react/jsx-runtime";import{jsx as pr,jsxs as dr}from"react/jsx-runtime";import{jsx as ur,jsxs as vr}from"react/jsx-runtime";import{jsx as kr,jsxs as Tr}from"react/jsx-runtime";import{jsx as Ir,jsxs as gr}from"react/jsx-runtime";var Te="file-manager",Ee="filemanager";import{jsx as nt}from"react/jsx-runtime";var Ne="k-filemanager-treeview",rt=[],it={},st={},I=t=>{let{children:e,...o}=t;return nt(h,{className:n(t.className,Ne),...o,children:e})};I.states=rt;I.options=it;I.className=Ne;I.defaultOptions=st;I.moduleName=Te;I.folderName=Ee;var Xr=I;export{Ne as FILEMANAGERTREEVIEW_CLASSNAME,I as FileManagerTreeview,Xr as default};