@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 11.1 kB
JavaScript
var s=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?s(...t):typeof t=="object"?Object.keys(t).map((o,r)=>t[r]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var C=(e,t)=>s({[`${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"}),M=(e,t)=>{let{valid:o,invalid:r,hover:p,focus:l,checked:a,active:L,selected:c,disabled:d,indeterminate:h,loading:x,empty:f,readonly:b,highlighted:Q,...K}=t;return s({"k-valid":o,"k-invalid":r,"k-hover":p,"k-focus":l,"k-checked":a,"k-active":L,"k-selected":c,"k-disabled":d,"k-indeterminate":h&&!a,"k-loading":x,"k-empty":f,"k-readonly":b,"k-highlighted":Q},Object.keys(K).reduce((I,E)=>(E.startsWith("k-")?I[E]=K[E]:I[`k-${E}`]=K[E],I),{}))};var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},_={small:"small",medium:"medium",large:"large",full:"full"};var n={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",generating:"generating",expanded:"expanded"};import{jsx as Oe}from"react/jsx-runtime";var Ae="k-no-data",P=e=>Oe("span",{className:s(Ae,e.className),children:e.children});var y="list",S=y;import{jsx as R,jsxs as pe}from"react/jsx-runtime";var Y="k-list",Te=[],Ke={size:[i.small,i.medium,i.large]},ce={size:i.medium},k=e=>{let{size:t=ce.size,virtualization:o,children:r,optionLabel:p,customValue:l,screenReaders:a,...L}=e,c,d,h,x,f=[];return r?r.map((b,Q)=>{b.type===N?(b.props.root===!0?(c=b.props.label,b.props.children.map((K,I)=>{f.push(R(u,{...K.props},`optChild-${I}-${new Date().getTime()}`))})):b.props.children.forEach((K,I)=>{let E="";I===0&&(E=b.props.label),f.push(R(u,{className:I===0?"k-first":"",...K.props,groupLabel:E},`groupLabel-${I}-${new Date().getTime()}`))}),d=R(N,{label:c,virtualization:o,children:f})):b.type===u&&(f.push(R(u,{...b.props},`${b.type}-${Q}`)),h=R(G,{virtualization:o,children:f}),a&&(x=pe(P,{className:"k-sr-only",children:[f.length," items found."]})))}):x=R(P,{children:"No data found."}),pe("div",{...L,className:s(e.className,Y,C(Y,{size:t}),{"k-virtual-list":o}),children:[p,l,d,h,x]})};k.states=Te;k.options=Ke;k.className=Y;k.defaultOptions=ce;k.moduleName=y;k.folderName=S;import{jsx as Re}from"react/jsx-runtime";var de="k-list-container",ze=[],He={},_e={},D=e=>{let{...t}=e;return Re("div",{...t,className:s(e.className,de),children:e.children})};D.states=ze;D.options=He;D.className=de;D.defaultOptions=_e;D.moduleName=y;D.folderName=S;var z="checkbox",$=z;import{jsx as ue}from"react/jsx-runtime";var F="k-checkbox",Ge=[m.hover,m.focus,m.valid,m.invalid,m.required,m.disabled,m.checked,m.indeterminate],De={size:[i.small,i.medium,i.large],rounded:[_.small,_.medium,_.large,_.full]},Z={size:i.medium,rounded:_.medium},g=e=>{let{id:t,checked:o,indeterminate:r,hover:p,focus:l,disabled:a,invalid:L,valid:c,required:d,size:h=Z.size,rounded:x=Z.rounded,...f}=e;return ue("span",{className:"k-checkbox-wrap",children:ue("input",{...f,id:t,type:"checkbox",defaultChecked:o,required:d,className:s(e.className,F,C(F,{size:h,rounded:x}),M(F,{hover:p,focus:l,disabled:a,invalid:L,valid:c,indeterminate:r,checked:o}))})})};g.states=Ge;g.options=De;g.className=F;g.defaultOptions=Z;g.moduleName=z;g.folderName=$;import{jsx as we}from"react/jsx-runtime";var Le="k-checkbox-list",$e=[],Pe={},fe={layout:"vertical"},A=e=>{let{layout:t=fe.layout,...o}=e;return we("ul",{...o,className:s(e.className,Le,{[`k-list-${t}`]:t}),children:e.children})};A.states=$e;A.options=Pe;A.className=Le;A.defaultOptions=fe;A.moduleName=z;A.folderName=$;import{jsx as Ue}from"react/jsx-runtime";var xe="k-checkbox-list-item",Be=[],Xe={},Fe={},O=e=>{let{...t}=e;return Ue("li",{...t,className:s(e.className,xe),children:e.children})};O.states=Be;O.options=Xe;O.className=xe;O.defaultOptions=Fe;O.moduleName=z;O.folderName=$;import{Fragment as mo,jsx as lo,jsxs as po}from"react/jsx-runtime";import{Fragment as xo,jsx as fo,jsxs as bo}from"react/jsx-runtime";import{Fragment as go,jsx as ko,jsxs as vo}from"react/jsx-runtime";import{Fragment as So,jsx as Mo,jsxs as Ao}from"react/jsx-runtime";import{jsx as zo}from"react/jsx-runtime";import{jsx as Go}from"react/jsx-runtime";import{Fragment as qe,jsx as be}from"react/jsx-runtime";var ee="k-font-icon",Ve=[],Je={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},We={},w=e=>{let{size:t,themeColor:o,icon:r,rotate:p,flip:l,...a}=e;return r?be("span",{...a,className:s(e.className,ee,C(ee,{size:t}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${p}`]:p,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):be(qe,{})};w.states=Ve;w.options=Je;w.className=ee;w.defaultOptions=We;var he=w;import{Fragment as Ze,jsx as U}from"react/jsx-runtime";var te="k-svg-icon",Qe=[],Ye={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},Ce={viewBox:"0 0 24 24"},B=e=>{let{size:t,themeColor:o,rotate:r,flip:p,viewBox:l=Ce.viewBox,icon:a,...L}=e;if(!a)return U(Ze,{});a==="none"&&{...L,className:s(e.className,te,"k-none")};let c=typeof a=="object"&&a.name&&a.name;return U("span",{...L,className:s(e.className,te,C("k-icon",{size:t}),{[`k-svg-i-${c}`]:c,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"}),children:U("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:l,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:e.children})})};B.states=Qe;B.options=Ye;B.className=te;B.defaultOptions=Ce;var oe=B;import*as se from"@progress/kendo-svg-icons";var Ne="icon",ke="icons";import{Fragment as ge,jsx as X}from"react/jsx-runtime";var V="k-icon",je=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),et=[],tt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},ie={viewBox:"0 0 24 24",type:"svg"},T=e=>{let{size:t,themeColor:o,icon:r,type:p=ie.type,rotate:l,flip:a,viewBox:L=ie.viewBox,...c}=e;if(!r)return X(ge,{});if(p==="svg"){if(r==="none")return X(oe,{...c,className:s(e.className,V),icon:r,size:t});let d=se[r]?r:je(`${r}-icon`);return se[d]?X(oe,{...c,className:s(e.className,V),icon:se[d],size:t,themeColor:o,rotate:l,flip:a,viewBox:L}):X(ge,{})}return X(he,{...c,className:s(e.className,V),icon:r,size:t,themeColor:o,rotate:l,flip:a})};T.states=et;T.options=tt;T.defaultOptions=ie;T.className=V;T.moduleName=Ne;T.folderName=ke;import{jsx as J,jsxs as nt}from"react/jsx-runtime";var ne="k-list-item",ot=[m.hover,m.focus,m.selected,m.disabled],st={},it={},u=e=>{let{text:t,groupLabel:o,group:r,showIcon:p,iconName:l,showCheckbox:a,checked:L,hover:c,focus:d,selected:h,disabled:x,...f}=e,b=t||e.children;return nt("li",{...f,className:s(e.className,r?"k-list-group-item":ne,M(ne,{hover:c,focus:d,disabled:x,selected:h})),children:[a&&J(g,{checked:L}),p&&J(T,{icon:l}),J("span",{className:"k-list-item-text",children:b}),o&&o!==""&&J("div",{className:"k-list-item-group-label",children:o})]})};u.states=ot;u.options=st;u.className=ne;u.defaultOptions=it;u.moduleName=y;u.folderName=S;import{jsx as re,jsxs as at}from"react/jsx-runtime";var rt="k-list-content",G=e=>{let{virtualization:t,...o}=e;return at("div",{...o,className:s(rt,e.className),children:[re("ul",{className:s("k-list-ul"),children:e.children}),t&&re("div",{className:"k-height-container",children:re("div",{})})]})};import{jsx as ve}from"react/jsx-runtime";var lt="k-list-group-sticky-header",Ie=e=>ve("div",{className:s(lt,e.className),children:ve("div",{className:"k-list-header-text",children:e.children})});import{Fragment as mt,jsx as ye,jsxs as pt}from"react/jsx-runtime";var N=e=>{let{virtualization:t,label:o}=e;return pt(mt,{children:[o&&ye(Ie,{children:o}),e.children&&ye(G,{virtualization:t,children:e.children})]})};import{jsx as Ee}from"react/jsx-runtime";var ct="k-list-group-item",Me=e=>Ee("li",{className:s(ct,e.className),children:Ee("span",{className:"k-list-item-text",children:e.children})});import{jsx as ft}from"react/jsx-runtime";var ae="k-list-optionlabel",dt=[m.hover,m.focus,m.selected,m.disabled],ut={},Lt={},W=e=>{let{text:t,hover:o,focus:r,selected:p,disabled:l,...a}=e;return ft("div",{...a,className:s(ae,M(ae,{hover:o,focus:r,selected:p,disabled:l})),children:t})};W.states=dt;W.options=ut;W.className=ae;W.defaultOptions=Lt;import{jsx as Ct}from"react/jsx-runtime";var le="k-list-custom-value",xt=[m.hover,m.focus,m.selected,m.disabled],bt={},ht={},q=e=>{let{text:t,hover:o,focus:r,selected:p,disabled:l,...a}=e;return Ct("div",{...a,className:s(le,M(le,{hover:o,focus:r,selected:p,disabled:l})),children:t})};q.states=xt;q.options=bt;q.className=le;q.defaultOptions=ht;import{jsx as Ds}from"react/jsx-runtime";import{jsx as Bs}from"react/jsx-runtime";import{jsx as Vs,jsxs as Js}from"react/jsx-runtime";import{jsx as Ys,jsxs as Zs}from"react/jsx-runtime";import{jsx as oi}from"react/jsx-runtime";import{jsx as ri,jsxs as ai}from"react/jsx-runtime";import{jsx as ci,jsxs as di}from"react/jsx-runtime";import{jsx as H,jsxs as gt}from"react/jsx-runtime";var me="k-list",Nt=[],kt={size:[i.small,i.medium,i.large]},Se={size:i.medium},v=e=>{let{size:t=Se.size,virtualization:o,children:r,...p}=e,l,a,L,c=[];return r?r.map((d,h)=>{d.type===N?(d.props.root===!0?(l=d.props.label,d.props.children.map((x,f)=>{c.push(H(u,{...x.props},`optChild-${f}-${new Date().getTime()}`))})):(c.push(H(Me,{...d.props,children:d.props.label},`listChild-${h}`)),d.props.children.map((x,f)=>{c.push(H(u,{...x.props},`fwOptChild-${f}-${new Date().getTime()}`))})),a=H(N,{label:l,virtualization:o,children:c})):d.type===u&&(c.push(H(u,{...d.props},`${d.type}-${h}`)),L=H(G,{virtualization:o,children:c}))}):L=H(P,{children:"No data found."}),gt("div",{...p,className:s(e.className,me,C(me,{size:t}),{"k-virtual-list":o}),children:[a,L]})};v.states=Nt;v.options=kt;v.className=me;v.defaultOptions=Se;v.moduleName=y;v.folderName=S;var Ri=v;export{me as LISTANGULAR_CLASSNAME,v as ListAngular,Ri as default};