UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 10.3 kB
var i=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?i(...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 b=(e,t)=>i({[`${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"}),v=(e,t)=>i({"k-valid":t.valid,"k-invalid":t.invalid,"k-hover":t.hover,"k-focus":t.focus,"k-checked":t.checked,"k-active":t.active,"k-selected":t.selected,"k-disabled":t.disabled,"k-indeterminate":t.indeterminate&&!t.checked,"k-loading":t.loading,"k-empty":t.empty,"k-readonly":t.readonly,"k-highlighted":t.highlighted});var s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},S={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"},l={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 vt}from"react/jsx-runtime";var gt="k-no-data",G=e=>vt("span",{className:i(gt,e.className),children:e.children});import{jsx as z,jsxs as ot}from"react/jsx-runtime";var _="k-list",yt=[],Ct={size:[s.small,s.medium,s.large]},st={size:s.medium},y=e=>{let{size:t=st.size,virtualization:o,children:r,optionLabel:c,customValue:m,screenReaders:a,...f}=e,p,u,g,x,L=[];return r?r.map((h,kt)=>{h.type===k?(h.props.root===!0?(p=h.props.label,h.props.children.map((V,T)=>{L.push(z(d,{...V.props},`optChild-${T}-${new Date().getTime()}`))})):h.props.children.forEach((V,T)=>{let et="";T===0&&(et=h.props.label),L.push(z(d,{className:T===0?"k-first":"",...V.props,groupLabel:et},`groupLabel-${T}-${new Date().getTime()}`))}),u=z(k,{label:p,virtualization:o,children:L})):h.type===d&&(L.push(z(d,{...h.props},`${h.type}-${kt}`)),g=z(A,{virtualization:o,children:L}),a&&(x=ot(G,{className:"k-sr-only",children:[L.length," items found."]})))}):x=z(G,{children:"No data found."}),ot("div",{...f,className:i(e.className,_,b(_,{size:t}),{"k-virtual-list":o}),children:[c,m,u,g,x]})};y.states=yt;y.options=Ct;y.className=_;y.defaultOptions=st;import{jsx as I,jsxs as St}from"react/jsx-runtime";var X="k-list",Nt=[],It={size:[s.small,s.medium,s.large]},it={size:s.medium},C=e=>{let{size:t=it.size,virtualization:o,children:r,...c}=e,m,a,f,p=[];return r?r.map((u,g)=>{u.type===k?(u.props.root===!0?(m=u.props.label,u.props.children.map((x,L)=>{p.push(I(d,{...x.props},`optChild-${L}-${new Date().getTime()}`))})):(p.push(I(nt,{...u.props,children:u.props.label},`listChild-${g}`)),u.props.children.map((x,L)=>{p.push(I(d,{...x.props},`fwOptChild-${L}-${new Date().getTime()}`))})),a=I(k,{label:m,virtualization:o,children:p})):u.type===d&&(p.push(I(d,{...u.props},`${u.type}-${g}`)),f=I(A,{virtualization:o,children:p}))}):f=I(G,{children:"No data found."}),St("div",{...c,className:i(e.className,X,b(X,{size:t}),{"k-virtual-list":o}),children:[a,f]})};C.states=Nt;C.options=It;C.className=X;C.defaultOptions=it;import{jsx as rt}from"react/jsx-runtime";var R="k-checkbox",zt=[l.hover,l.focus,l.valid,l.invalid,l.required,l.disabled,l.checked,l.indeterminate],At={size:[s.small,s.medium,s.large],rounded:[S.small,S.medium,S.large,S.full]},J={size:s.medium,rounded:S.medium},N=e=>{let{id:t,checked:o,indeterminate:r,hover:c,focus:m,disabled:a,invalid:f,valid:p,required:u,size:g=J.size,rounded:x=J.rounded,...L}=e;return rt("span",{className:"k-checkbox-wrap",children:rt("input",{...L,id:t,type:"checkbox",defaultChecked:o,required:u,className:i(e.className,R,b(R,{size:g,rounded:x}),v(R,{hover:c,focus:m,disabled:a,invalid:f,valid:p,indeterminate:r,checked:o}))})})};N.states=zt;N.options=At;N.className=R;N.defaultOptions=J;import{jsx as Tt}from"react/jsx-runtime";var at="k-checkbox-list",Mt=[],Ot={},lt={layout:"vertical"},M=e=>{let{layout:t=lt.layout,...o}=e;return Tt("ul",{...o,className:i(e.className,at,{[`k-list-${t}`]:t}),children:e.children})};M.states=Mt;M.options=Ot;M.className=at;M.defaultOptions=lt;import{jsx as Ht}from"react/jsx-runtime";var mt="k-checkbox-list-item",Gt=[],Et={},Kt={},O=e=>{let{...t}=e;return Ht("li",{...t,className:i(e.className,mt),children:e.children})};O.states=Gt;O.options=Et;O.className=mt;O.defaultOptions=Kt;import{Fragment as Fe,jsx as Je,jsxs as Ue}from"react/jsx-runtime";import{Fragment as Ze,jsx as Ye,jsxs as je}from"react/jsx-runtime";import{Fragment as io,jsx as so,jsxs as no}from"react/jsx-runtime";import{Fragment as co,jsx as mo,jsxs as po}from"react/jsx-runtime";import{jsx as xo}from"react/jsx-runtime";import{jsx as go}from"react/jsx-runtime";import{Fragment as Pt,jsx as ct}from"react/jsx-runtime";var U="k-icon k-font-icon",$t=[],Rt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},wt={},E=e=>{let{size:t,themeColor:o,icon:r,rotate:c,flip:m,...a}=e;return r?ct("span",{...a,className:i(e.className,U,b(U,{size:t}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${c}`]:c,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):ct(Pt,{})};E.states=$t;E.options=Rt;E.className=U;E.defaultOptions=wt;var pt=E;import{Fragment as Vt,jsx as w}from"react/jsx-runtime";var W="k-icon k-svg-icon",Bt=[],Dt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},ut={viewBox:"0 0 24 24"},K=e=>{let{size:t,themeColor:o,rotate:r,flip:c,viewBox:m=ut.viewBox,icon:a,...f}=e;if(!a)return w(Vt,{});a==="none"&&{...f,className:i(e.className,W,"k-none")};let p=typeof a=="object"&&a.name&&a.name;return w("span",{...f,className:i(e.className,W,b("k-icon",{size:t}),{[`k-svg-i-${p}`]:p,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:w("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:m,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:e.children})})};K.states=Bt;K.options=Dt;K.className=W;K.defaultOptions=ut;var q=K;import*as dt from"@progress/kendo-svg-icons";import{Fragment as ft,jsx as H}from"react/jsx-runtime";var _t=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Xt=[],Jt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},Q={viewBox:"0 0 24 24",type:"svg"},$=e=>{let{size:t,themeColor:o,icon:r,type:c=Q.type,rotate:m,flip:a,viewBox:f=Q.viewBox,...p}=e;if(!r)return H(ft,{});if(c==="svg"){if(r==="none")return H(q,{...p,icon:r,size:t});let u=_t(`${r}-icon`);return dt[u]?H(q,{...p,icon:dt[u],size:t,themeColor:o,rotate:m,flip:a,viewBox:f}):H(ft,{})}return H(pt,{...p,icon:r,size:t,themeColor:o,rotate:m,flip:a})};$.states=Xt;$.options=Jt;$.defaultOptions=Q;import{jsx as P,jsxs as qt}from"react/jsx-runtime";var Y="k-list-item",Ft=[l.hover,l.focus,l.selected,l.disabled],Ut={},Wt={},d=e=>{let{text:t,groupLabel:o,group:r,showIcon:c,iconName:m,showCheckbox:a,checked:f,hover:p,focus:u,selected:g,disabled:x,...L}=e,h=t||e.children;return qt("li",{...L,className:i(e.className,r?"k-list-group-item":Y,v(Y,{hover:p,focus:u,disabled:x,selected:g})),children:[a&&P(N,{checked:f}),c&&P($,{icon:m}),P("span",{className:"k-list-item-text",children:h}),o&&o!==""&&P("div",{className:"k-list-item-group-label",children:o})]})};d.states=Ft;d.options=Ut;d.className=Y;d.defaultOptions=Wt;import{jsx as Z,jsxs as Yt}from"react/jsx-runtime";var Qt="k-list-content",A=e=>{let{virtualization:t,...o}=e;return Yt("div",{...o,className:i(Qt,e.className),children:[Z("ul",{className:i("k-list-ul"),children:e.children}),t&&Z("div",{className:"k-height-container",children:Z("div",{})})]})};import{jsx as Lt}from"react/jsx-runtime";var Zt="k-list-group-sticky-header",xt=e=>Lt("div",{className:i(Zt,e.className),children:Lt("div",{className:"k-list-header-text",children:e.children})});import{Fragment as jt,jsx as ht,jsxs as te}from"react/jsx-runtime";var k=e=>{let{virtualization:t,label:o}=e;return te(jt,{children:[o&&ht(xt,{children:o}),e.children&&ht(A,{virtualization:t,children:e.children})]})};import{jsx as bt}from"react/jsx-runtime";var ee="k-list-group-item",nt=e=>bt("li",{className:i(ee,e.className),children:bt("span",{className:"k-list-item-text",children:e.children})});import{jsx as ne}from"react/jsx-runtime";var j="k-list-optionlabel",oe=[l.hover,l.focus,l.selected,l.disabled],se={},ie={},B=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:m,...a}=e;return ne("div",{...a,className:i(j,v(j,{hover:o,focus:r,selected:c,disabled:m})),children:t})};B.states=oe;B.options=se;B.className=j;B.defaultOptions=ie;import{jsx as me}from"react/jsx-runtime";var tt="k-list-custom-value",re=[l.hover,l.focus,l.selected,l.disabled],ae={},le={},D=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:m,...a}=e;return me("div",{...a,className:i(tt,v(tt,{hover:o,focus:r,selected:c,disabled:m})),children:t})};D.states=re;D.options=ae;D.className=tt;D.defaultOptions=le;import{jsx as bs}from"react/jsx-runtime";import{jsx as ys}from"react/jsx-runtime";import{jsx as Ss,jsxs as zs}from"react/jsx-runtime";import{jsx as Ts,jsxs as Gs}from"react/jsx-runtime";import{jsx as $s,jsxs as Rs}from"react/jsx-runtime";import{jsx as Ds,jsxs as Vs}from"react/jsx-runtime";import{jsx as ce}from"react/jsx-runtime";var li=e=>ce(C,{virtualization:!0,...e});export{li as AngularListVirtualization};