UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 11.1 kB
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 N=(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((v,E)=>(E.startsWith("k-")?v[E]=K[E]:v[`k-${E}`]=K[E],v),{}))};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"};var I="list",S=I;import{jsx as Ke}from"react/jsx-runtime";var pe="k-list-container",Ae=[],Oe={},Te={},R=e=>{let{...t}=e;return Ke("div",{...t,className:s(e.className,pe),children:e.children})};R.states=Ae;R.options=Oe;R.className=pe;R.defaultOptions=Te;R.moduleName=I;R.folderName=S;import{jsx as He}from"react/jsx-runtime";var ze="k-no-data",P=e=>He("span",{className:s(ze,e.className),children:e.children});import{jsx as z,jsxs as Ge}from"react/jsx-runtime";var Y="k-list",_e=[],Re={size:[i.small,i.medium,i.large]},ce={size:i.medium},y=e=>{let{size:t=ce.size,virtualization:o,children:r,...p}=e,l,a,L,c=[];return r?r.map((d,h)=>{d.type===k?(d.props.root===!0?(l=d.props.label,d.props.children.map((x,f)=>{c.push(z(u,{...x.props},`optChild-${f}-${new Date().getTime()}`))})):(c.push(z(de,{...d.props,children:d.props.label},`listChild-${h}`)),d.props.children.map((x,f)=>{c.push(z(u,{...x.props},`fwOptChild-${f}-${new Date().getTime()}`))})),a=z(k,{label:l,virtualization:o,children:c})):d.type===u&&(c.push(z(u,{...d.props},`${d.type}-${h}`)),L=z(G,{virtualization:o,children:c}))}):L=z(P,{children:"No data found."}),Ge("div",{...p,className:s(e.className,Y,N(Y,{size:t}),{"k-virtual-list":o}),children:[a,L]})};y.states=_e;y.options=Re;y.className=Y;y.defaultOptions=ce;y.moduleName=I;y.folderName=S;var H="checkbox",D=H;import{jsx as ue}from"react/jsx-runtime";var F="k-checkbox",De=[m.hover,m.focus,m.valid,m.invalid,m.required,m.disabled,m.checked,m.indeterminate],$e={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,N(F,{size:h,rounded:x}),M(F,{hover:p,focus:l,disabled:a,invalid:L,valid:c,indeterminate:r,checked:o}))})})};g.states=De;g.options=$e;g.className=F;g.defaultOptions=Z;g.moduleName=H;g.folderName=D;import{jsx as Be}from"react/jsx-runtime";var Le="k-checkbox-list",Pe=[],we={},fe={layout:"vertical"},A=e=>{let{layout:t=fe.layout,...o}=e;return Be("ul",{...o,className:s(e.className,Le,{[`k-list-${t}`]:t}),children:e.children})};A.states=Pe;A.options=we;A.className=Le;A.defaultOptions=fe;A.moduleName=H;A.folderName=D;import{jsx as Ve}from"react/jsx-runtime";var xe="k-checkbox-list-item",Xe=[],Fe={},Ue={},O=e=>{let{...t}=e;return Ve("li",{...t,className:s(e.className,xe),children:e.children})};O.states=Xe;O.options=Fe;O.className=xe;O.defaultOptions=Ue;O.moduleName=H;O.folderName=D;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",Je=[],We={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]},qe={},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,N(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=Je;w.options=We;w.className=ee;w.defaultOptions=qe;var he=w;import{Fragment as je,jsx as U}from"react/jsx-runtime";var te="k-svg-icon",Ye=[],Ze={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(je,{});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,N("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=Ye;B.options=Ze;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",et=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),tt=[],ot={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:et(`${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=tt;T.options=ot;T.defaultOptions=ie;T.className=V;T.moduleName=Ne;T.folderName=ke;import{jsx as J,jsxs as rt}from"react/jsx-runtime";var ne="k-list-item",st=[m.hover,m.focus,m.selected,m.disabled],it={},nt={},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 rt("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=st;u.options=it;u.className=ne;u.defaultOptions=nt;u.moduleName=I;u.folderName=S;import{jsx as re,jsxs as lt}from"react/jsx-runtime";var at="k-list-content",G=e=>{let{virtualization:t,...o}=e;return lt("div",{...o,className:s(at,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 mt="k-list-group-sticky-header",Ie=e=>ve("div",{className:s(mt,e.className),children:ve("div",{className:"k-list-header-text",children:e.children})});import{Fragment as pt,jsx as ye,jsxs as ct}from"react/jsx-runtime";var k=e=>{let{virtualization:t,label:o}=e;return ct(pt,{children:[o&&ye(Ie,{children:o}),e.children&&ye(G,{virtualization:t,children:e.children})]})};import{jsx as Ee}from"react/jsx-runtime";var dt="k-list-group-item",de=e=>Ee("li",{className:s(dt,e.className),children:Ee("span",{className:"k-list-item-text",children:e.children})});import{jsx as xt}from"react/jsx-runtime";var ae="k-list-optionlabel",ut=[m.hover,m.focus,m.selected,m.disabled],Lt={},ft={},W=e=>{let{text:t,hover:o,focus:r,selected:p,disabled:l,...a}=e;return xt("div",{...a,className:s(ae,M(ae,{hover:o,focus:r,selected:p,disabled:l})),children:t})};W.states=ut;W.options=Lt;W.className=ae;W.defaultOptions=ft;import{jsx as Nt}from"react/jsx-runtime";var le="k-list-custom-value",bt=[m.hover,m.focus,m.selected,m.disabled],ht={},Ct={},q=e=>{let{text:t,hover:o,focus:r,selected:p,disabled:l,...a}=e;return Nt("div",{...a,className:s(le,M(le,{hover:o,focus:r,selected:p,disabled:l})),children:t})};q.states=bt;q.options=ht;q.className=le;q.defaultOptions=Ct;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 $,jsxs as Me}from"react/jsx-runtime";var me="k-list",kt=[],gt={size:[i.small,i.medium,i.large]},Se={size:i.medium},C=e=>{let{size:t=Se.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===k?(b.props.root===!0?(c=b.props.label,b.props.children.map((K,v)=>{f.push($(u,{...K.props},`optChild-${v}-${new Date().getTime()}`))})):b.props.children.forEach((K,v)=>{let E="";v===0&&(E=b.props.label),f.push($(u,{className:v===0?"k-first":"",...K.props,groupLabel:E},`groupLabel-${v}-${new Date().getTime()}`))}),d=$(k,{label:c,virtualization:o,children:f})):b.type===u&&(f.push($(u,{...b.props},`${b.type}-${Q}`)),h=$(G,{virtualization:o,children:f}),a&&(x=Me(P,{className:"k-sr-only",children:[f.length," items found."]})))}):x=$(P,{children:"No data found."}),Me("div",{...L,className:s(e.className,me,N(me,{size:t}),{"k-virtual-list":o}),children:[p,l,d,h,x]})};C.states=kt;C.options=gt;C.className=me;C.defaultOptions=Se;C.moduleName=I;C.folderName=S;var Ri=C;export{me as LIST_CLASSNAME,C as List,Ri as default};