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 it}from"react/jsx-runtime";var R="k-checkbox",Nt=[l.hover,l.focus,l.valid,l.invalid,l.required,l.disabled,l.checked,l.indeterminate],It={size:[s.small,s.medium,s.large],rounded:[S.small,S.medium,S.large,S.full]},X={size:s.medium,rounded:S.medium},C=e=>{let{id:t,checked:o,indeterminate:r,hover:c,focus:m,disabled:a,invalid:f,valid:p,required:u,size:g=X.size,rounded:x=X.rounded,...L}=e;return it("span",{className:"k-checkbox-wrap",children:it("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}))})})};C.states=Nt;C.options=It;C.className=R;C.defaultOptions=X;import{jsx as At}from"react/jsx-runtime";var nt="k-checkbox-list",St=[],zt={},rt={layout:"vertical"},M=e=>{let{layout:t=rt.layout,...o}=e;return At("ul",{...o,className:i(e.className,nt,{[`k-list-${t}`]:t}),children:e.children})};M.states=St;M.options=zt;M.className=nt;M.defaultOptions=rt;import{jsx as Gt}from"react/jsx-runtime";var at="k-checkbox-list-item",Mt=[],Ot={},Tt={},O=e=>{let{...t}=e;return Gt("li",{...t,className:i(e.className,at),children:e.children})};O.states=Mt;O.options=Ot;O.className=at;O.defaultOptions=Tt;import{Fragment as Be,jsx as Pe,jsxs as De}from"react/jsx-runtime";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{jsx as mo}from"react/jsx-runtime";import{jsx as fo}from"react/jsx-runtime";import{Fragment as $t,jsx as lt}from"react/jsx-runtime";var F="k-icon k-font-icon",Et=[],Kt={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]},Ht={},E=e=>{let{size:t,themeColor:o,icon:r,rotate:c,flip:m,...a}=e;return r?lt("span",{...a,className:i(e.className,F,b(F,{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"})}):lt($t,{})};E.states=Et;E.options=Kt;E.className=F;E.defaultOptions=Ht;var mt=E;import{Fragment as Pt,jsx as w}from"react/jsx-runtime";var U="k-icon k-svg-icon",Rt=[],wt={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]},ct={viewBox:"0 0 24 24"},K=e=>{let{size:t,themeColor:o,rotate:r,flip:c,viewBox:m=ct.viewBox,icon:a,...f}=e;if(!a)return w(Pt,{});a==="none"&&{...f,className:i(e.className,U,"k-none")};let p=typeof a=="object"&&a.name&&a.name;return w("span",{...f,className:i(e.className,U,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=Rt;K.options=wt;K.className=U;K.defaultOptions=ct;var W=K;import*as pt from"@progress/kendo-svg-icons";import{Fragment as ut,jsx as H}from"react/jsx-runtime";var Bt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Dt=[],Vt={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(ut,{});if(c==="svg"){if(r==="none")return H(W,{...p,icon:r,size:t});let u=Bt(`${r}-icon`);return pt[u]?H(W,{...p,icon:pt[u],size:t,themeColor:o,rotate:m,flip:a,viewBox:f}):H(ut,{})}return H(mt,{...p,icon:r,size:t,themeColor:o,rotate:m,flip:a})};$.states=Dt;$.options=Vt;$.defaultOptions=q;import{jsx as P,jsxs as Ft}from"react/jsx-runtime";var Q="k-list-item",_t=[l.hover,l.focus,l.selected,l.disabled],Xt={},Jt={},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 Ft("li",{...L,className:i(e.className,r?"k-list-group-item":Q,v(Q,{hover:p,focus:u,disabled:x,selected:g})),children:[a&&P(C,{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=_t;d.options=Xt;d.className=Q;d.defaultOptions=Jt;import{jsx as Y,jsxs as Wt}from"react/jsx-runtime";var Ut="k-list-content",A=e=>{let{virtualization:t,...o}=e;return Wt("div",{...o,className:i(Ut,e.className),children:[Y("ul",{className:i("k-list-ul"),children:e.children}),t&&Y("div",{className:"k-height-container",children:Y("div",{})})]})};import{jsx as dt}from"react/jsx-runtime";var qt="k-list-group-sticky-header",ft=e=>dt("div",{className:i(qt,e.className),children:dt("div",{className:"k-list-header-text",children:e.children})});import{Fragment as Qt,jsx as Lt,jsxs as Yt}from"react/jsx-runtime";var k=e=>{let{virtualization:t,label:o}=e;return Yt(Qt,{children:[o&&Lt(ft,{children:o}),e.children&&Lt(A,{virtualization:t,children:e.children})]})};import{jsx as xt}from"react/jsx-runtime";var Zt="k-list-group-item",ht=e=>xt("li",{className:i(Zt,e.className),children:xt("span",{className:"k-list-item-text",children:e.children})});import{jsx as oe}from"react/jsx-runtime";var Z="k-list-optionlabel",jt=[l.hover,l.focus,l.selected,l.disabled],te={},ee={},B=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:m,...a}=e;return oe("div",{...a,className:i(Z,v(Z,{hover:o,focus:r,selected:c,disabled:m})),children:t})};B.states=jt;B.options=te;B.className=Z;B.defaultOptions=ee;import{jsx as re}from"react/jsx-runtime";var j="k-list-custom-value",se=[l.hover,l.focus,l.selected,l.disabled],ie={},ne={},D=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:m,...a}=e;return re("div",{...a,className:i(j,v(j,{hover:o,focus:r,selected:c,disabled:m})),children:t})};D.states=se;D.options=ie;D.className=j;D.defaultOptions=ne;import{jsx as us}from"react/jsx-runtime";import{jsx as xs}from"react/jsx-runtime";import{jsx as gs,jsxs as vs}from"react/jsx-runtime";import{jsx as Is,jsxs as Ss}from"react/jsx-runtime";import{jsx as Os}from"react/jsx-runtime";import{jsx as Ks,jsxs as Hs}from"react/jsx-runtime";import{jsx as Ps,jsxs as Bs}from"react/jsx-runtime";import{jsx as I,jsxs as me}from"react/jsx-runtime";var tt="k-list",ae=[],le={size:[s.small,s.medium,s.large]},bt={size:s.medium},N=e=>{let{size:t=bt.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(ht,{...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."}),me("div",{...c,className:i(e.className,tt,b(tt,{size:t}),{"k-virtual-list":o}),children:[a,f]})};N.states=ae;N.options=le;N.className=tt;N.defaultOptions=bt;var li=N;export{tt as LISTANGULAR_CLASSNAME,N as ListAngular,li as default};