UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.75 kB
var n=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((o,s)=>e[s]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(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)=>n({"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 r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},C={small:"small",medium:"medium",large:"large",full:"full"};var i={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},m={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 M}from"react/jsx-runtime";import{createElement as Z}from"react";var _="k-treeview",ve=[],we={size:[r.small,r.medium,r.large]},j={size:r.medium},h=t=>{let{size:e=j.size,children:o,dir:s,...c}=t,a=[];return o&&(Array.isArray(o)?o.map((l,x)=>{l.type===d&&a.push(Z(d,{...l.props,dir:s,key:x})),l.type===p&&a.push(Z(p,{...l.props,dir:s,key:x}))}):(o.type===d&&a.push(M(d,{...o.props,dir:s})),o.type===p&&a.push(M(p,{...o.props,dir:s})))),M("div",{...c,dir:s,className:n(t.className,_,u(_,{size:e})),children:M(p,{className:"k-treeview-lines",dir:s,children:a})})};h.states=ve;h.options=we;h.className=_;h.defaultOptions=j;import{jsx as ee}from"react/jsx-runtime";var z="k-checkbox",be=[m.hover,m.focus,m.valid,m.invalid,m.required,m.disabled,m.checked,m.indeterminate],ke={size:[r.small,r.medium,r.large],rounded:[C.small,C.medium,C.large,C.full]},F={size:r.medium,rounded:C.medium},v=t=>{let{id:e,checked:o,indeterminate:s,hover:c,focus:a,disabled:l,invalid:x,valid:f,required:k,size:G=F.size,rounded:O=F.rounded,...K}=t;return ee("span",{className:"k-checkbox-wrap",children:ee("input",{...K,id:e,type:"checkbox",defaultChecked:o,required:k,className:n(t.className,z,u(z,{size:G,rounded:O}),w(z,{hover:c,focus:a,disabled:l,invalid:x,valid:f,indeterminate:s,checked:o}))})})};v.states=be;v.options=ke;v.className=z;v.defaultOptions=F;import{jsx as Te}from"react/jsx-runtime";var te="k-checkbox-list",Ce=[],ye={},oe={layout:"vertical"},y=t=>{let{layout:e=oe.layout,...o}=t;return Te("ul",{...o,className:n(t.className,te,{[`k-list-${e}`]:e}),children:t.children})};y.states=Ce;y.options=ye;y.className=te;y.defaultOptions=oe;import{jsx as Se}from"react/jsx-runtime";var re="k-checkbox-list-item",ge=[],Ie={},Ne={},T=t=>{let{...e}=t;return Se("li",{...e,className:n(t.className,re),children:t.children})};T.states=ge;T.options=Ie;T.className=re;T.defaultOptions=Ne;import{Fragment as Tt,jsx as yt,jsxs as gt}from"react/jsx-runtime";import{Fragment as Lt,jsx as Et,jsxs as Mt}from"react/jsx-runtime";import{Fragment as Ot,jsx as Gt,jsxs as Kt}from"react/jsx-runtime";import{Fragment as _t,jsx as Bt,jsxs as Ft}from"react/jsx-runtime";import{jsx as Wt}from"react/jsx-runtime";import{jsx as Qt}from"react/jsx-runtime";import{Fragment as ze,jsx as ie}from"react/jsx-runtime";var V="k-icon k-font-icon",Ee=[],Le={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},Me={},I=t=>{let{size:e,themeColor:o,icon:s,rotate:c,flip:a,...l}=t;return s?ie("span",{...l,className:n(t.className,V,u(V,{size:e}),{[`k-i-${s}`]:s,[`k-color-${o}`]:o,[`k-rotate-${c}`]:c,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"})}):ie(ze,{})};I.states=Ee;I.options=Le;I.className=V;I.defaultOptions=Me;var se=I;import{Fragment as Ge,jsx as A}from"react/jsx-runtime";var J="k-icon k-svg-icon",Ae=[],Re={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},ne={viewBox:"0 0 24 24"},N=t=>{let{size:e,themeColor:o,rotate:s,flip:c,viewBox:a=ne.viewBox,icon:l,...x}=t;if(!l)return A(Ge,{});l==="none"&&{...x,className:n(t.className,J,"k-none")};let f=typeof l=="object"&&l.name&&l.name;return A("span",{...x,className:n(t.className,J,u("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:A("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})})};N.states=Ae;N.options=Re;N.className=J;N.defaultOptions=ne;var W=N;import*as le from"@progress/kendo-svg-icons";import{Fragment as ae,jsx as S}from"react/jsx-runtime";var Oe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ke=[],He={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},q={viewBox:"0 0 24 24",type:"svg"},b=t=>{let{size:e,themeColor:o,icon:s,type:c=q.type,rotate:a,flip:l,viewBox:x=q.viewBox,...f}=t;if(!s)return S(ae,{});if(c==="svg"){if(s==="none")return S(W,{...f,icon:s,size:e});let k=Oe(`${s}-icon`);return le[k]?S(W,{...f,icon:le[k],size:e,themeColor:o,rotate:a,flip:l,viewBox:x}):S(ae,{})}return S(se,{...f,icon:s,size:e,themeColor:o,rotate:a,flip:l})};b.states=Ke;b.options=He;b.defaultOptions=q;import{jsx as ce}from"react/jsx-runtime";import{createElement as Pe}from"react";var $e="k-treeview-group",p=t=>{let{children:e,dir:o}=t,s=[];return e&&(Array.isArray(e)?e.map((c,a)=>{c.type===E&&s.push(Pe(E,{...c.props,dir:o,key:a}))}):e.type===E&&s.push(ce(E,{...e.props,dir:o}))),ce("ul",{className:n(t.className,$e),children:s})};import{jsx as me,jsxs as Fe}from"react/jsx-runtime";var U="k-treeview-leaf",Be=[m.hover,m.focus,m.selected],_e={},R=t=>{let{text:e,showIcon:o,icon:s,hover:c,focus:a,selected:l,...x}=t;return Fe("span",{...x,className:n(t.className,U,w(U,{hover:c,focus:a,selected:l})),children:[o&&me(b,{icon:s}),me("span",{className:"k-treeview-leaf-text",children:e})]})};R.states=Be;R.options=_e;R.className=U;var pe=R;import{Fragment as qe,jsx as g,jsxs as de}from"react/jsx-runtime";import{createElement as We}from"react";var xe="k-treeview-item",Xe=[m.hover,m.focus,m.selected,m.disabled],Ve={},Je={},d=t=>{let{leafClassName:e,children:o,hasChildren:s,expanded:c,text:a,showIcon:l,icon:x,showCheckbox:f,checked:k,hover:G,focus:O,selected:K,disabled:H,top:D,bottom:Q,dir:$,...fe}=t,Y=s||o,P=[];return o&&(Array.isArray(o)?o.map((B,ue)=>{B.type===p&&P.push(We(p,{...B.props,dir:$,key:ue},B.props.children))}):o.type===p&&P.push(g(p,{...o.props,dir:$,children:o.props.children}))),de("li",{...fe,className:n(t.className,xe),children:[de("span",{className:n({"k-treeview-top":D,"k-treeview-bot":Q,"k-treeview-mid":!D&&!Q}),children:[Y&&g("span",{className:n("k-treeview-toggle",w("k-treeview-toggle",{disabled:H})),children:g(b,{icon:c?"caret-alt-down":$==="rtl"?"caret-alt-left":"caret-alt-right"})}),f&&g(v,{checked:k,disabled:H}),g(pe,{className:n(e,w(e,{disabled:H})),text:a,showIcon:l,icon:x,hover:G,focus:O,selected:K})]}),c&&Y&&g(qe,{children:P})]})};d.states=Xe;d.options=Ve;d.className=xe;d.defaultOptions=Je;var E=d;import{jsx as Xo}from"react/jsx-runtime";import{jsx as qo,jsxs as Uo}from"react/jsx-runtime";import{jsx as Zo,jsxs as jo}from"react/jsx-runtime";import{jsx as rr,jsxs as ir}from"react/jsx-runtime";import{jsx as ar,jsxs as cr}from"react/jsx-runtime";import{jsx as Ye}from"react/jsx-runtime";var he="k-filemanager-treeview",Ue=[],De={},Qe={},L=t=>{let{children:e,...o}=t;return Ye(h,{className:n(t.className,he),...o,children:e})};L.states=Ue;L.options=De;L.className=he;L.defaultOptions=Qe;var gr=L;export{he as FILEMANAGERTREEVIEW_CLASSNAME,L as FileManagerTreeview,gr as default};