@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 11.4 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 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:c,focus:m,checked:a,active:L,selected:d,disabled:u,indeterminate:C,loading:x,empty:f,readonly:b,highlighted:Y,...K}=t;return s({"k-valid":o,"k-invalid":r,"k-hover":c,"k-focus":m,"k-checked":a,"k-active":L,"k-selected":d,"k-disabled":u,"k-indeterminate":C&&!a,"k-loading":x,"k-empty":f,"k-readonly":b,"k-highlighted":Y},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"},p={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 Ke}from"react/jsx-runtime";var Te="k-no-data",w=e=>Ke("span",{className:s(Te,e.className),children:e.children});var y="list",S=y;import{jsx as R,jsxs as de}from"react/jsx-runtime";var Z="k-list",ze=[],He={size:[i.small,i.medium,i.large]},ue={size:i.medium},k=e=>{let{size:t=ue.size,virtualization:o,children:r,optionLabel:c,customValue:m,screenReaders:a,...L}=e,d,u,C,x,f=[];return r?r.map((b,Y)=>{b.type===h?(b.props.root===!0?(d=b.props.label,b.props.children.map((K,I)=>{f.push(R(l,{...K.props},`optChild-${I}-${new Date().getTime()}`))})):b.props.children.forEach((K,I)=>{let E="";I===0&&(E=b.props.label),f.push(R(l,{className:I===0?"k-first":"",...K.props,groupLabel:E},`groupLabel-${I}-${new Date().getTime()}`))}),u=R(h,{label:d,virtualization:o,children:f})):b.type===l&&(f.push(R(l,{...b.props},`${b.type}-${Y}`)),C=R(G,{virtualization:o,children:f}),a&&(x=de(w,{className:"k-sr-only",children:[f.length," items found."]})))}):x=R(w,{children:"No data found."}),de("div",{...L,className:s(e.className,Z,N(Z,{size:t}),{"k-virtual-list":o}),children:[c,m,u,C,x]})};k.states=ze;k.options=He;k.className=Z;k.defaultOptions=ue;k.moduleName=y;k.folderName=S;import{jsx as De}from"react/jsx-runtime";var Le="k-list-container",_e=[],Re={},Ge={},D=e=>{let{...t}=e;return De("div",{...t,className:s(e.className,Le),children:e.children})};D.states=_e;D.options=Re;D.className=Le;D.defaultOptions=Ge;D.moduleName=y;D.folderName=S;import{jsx as z,jsxs as we}from"react/jsx-runtime";var j="k-list",$e=[],Pe={size:[i.small,i.medium,i.large]},fe={size:i.medium},g=e=>{let{size:t=fe.size,virtualization:o,children:r,...c}=e,m,a,L,d=[];return r?r.map((u,C)=>{u.type===h?(u.props.root===!0?(m=u.props.label,u.props.children.map((x,f)=>{d.push(z(l,{...x.props},`optChild-${f}-${new Date().getTime()}`))})):(d.push(z(xe,{...u.props,children:u.props.label},`listChild-${C}`)),u.props.children.map((x,f)=>{d.push(z(l,{...x.props},`fwOptChild-${f}-${new Date().getTime()}`))})),a=z(h,{label:m,virtualization:o,children:d})):u.type===l&&(d.push(z(l,{...u.props},`${u.type}-${C}`)),L=z(G,{virtualization:o,children:d}))}):L=z(w,{children:"No data found."}),we("div",{...c,className:s(e.className,j,N(j,{size:t}),{"k-virtual-list":o}),children:[a,L]})};g.states=$e;g.options=Pe;g.className=j;g.defaultOptions=fe;g.moduleName=y;g.folderName=S;var H="checkbox",$=H;import{jsx as be}from"react/jsx-runtime";var U="k-checkbox",Be=[p.hover,p.focus,p.valid,p.invalid,p.required,p.disabled,p.checked,p.indeterminate],Xe={size:[i.small,i.medium,i.large],rounded:[_.small,_.medium,_.large,_.full]},ee={size:i.medium,rounded:_.medium},v=e=>{let{id:t,checked:o,indeterminate:r,hover:c,focus:m,disabled:a,invalid:L,valid:d,required:u,size:C=ee.size,rounded:x=ee.rounded,...f}=e;return be("span",{className:"k-checkbox-wrap",children:be("input",{...f,id:t,type:"checkbox",defaultChecked:o,required:u,className:s(e.className,U,N(U,{size:C,rounded:x}),M(U,{hover:c,focus:m,disabled:a,invalid:L,valid:d,indeterminate:r,checked:o}))})})};v.states=Be;v.options=Xe;v.className=U;v.defaultOptions=ee;v.moduleName=H;v.folderName=$;import{jsx as Ve}from"react/jsx-runtime";var he="k-checkbox-list",Fe=[],Ue={},Ce={layout:"vertical"},A=e=>{let{layout:t=Ce.layout,...o}=e;return Ve("ul",{...o,className:s(e.className,he,{[`k-list-${t}`]:t}),children:e.children})};A.states=Fe;A.options=Ue;A.className=he;A.defaultOptions=Ce;A.moduleName=H;A.folderName=$;import{jsx as Qe}from"react/jsx-runtime";var Ne="k-checkbox-list-item",Je=[],We={},qe={},O=e=>{let{...t}=e;return Qe("li",{...t,className:s(e.className,Ne),children:e.children})};O.states=Je;O.options=We;O.className=Ne;O.defaultOptions=qe;O.moduleName=H;O.folderName=$;import{Fragment as ho,jsx as bo,jsxs as Co}from"react/jsx-runtime";import{Fragment as Io,jsx as vo,jsxs as yo}from"react/jsx-runtime";import{Fragment as Oo,jsx as Ao,jsxs as To}from"react/jsx-runtime";import{Fragment as Ro,jsx as _o,jsxs as Go}from"react/jsx-runtime";import{jsx as wo}from"react/jsx-runtime";import{jsx as Uo}from"react/jsx-runtime";import{Fragment as et,jsx as ke}from"react/jsx-runtime";var oe="k-font-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]},je={},B=e=>{let{size:t,themeColor:o,icon:r,rotate:c,flip:m,...a}=e;return r?ke("span",{...a,className:s(e.className,oe,N(oe,{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"})}):ke(et,{})};B.states=Ye;B.options=Ze;B.className=oe;B.defaultOptions=je;var ge=B;import{Fragment as st,jsx as V}from"react/jsx-runtime";var se="k-svg-icon",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]},ve={viewBox:"0 0 24 24"},X=e=>{let{size:t,themeColor:o,rotate:r,flip:c,viewBox:m=ve.viewBox,icon:a,...L}=e;if(!a)return V(st,{});a==="none"&&{...L,className:s(e.className,se,"k-none")};let d=typeof a=="object"&&a.name&&a.name;return V("span",{...L,className:s(e.className,se,N("k-icon",{size:t}),{[`k-svg-i-${d}`]:d,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:V("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})})};X.states=tt;X.options=ot;X.className=se;X.defaultOptions=ve;var ie=X;import*as ne from"@progress/kendo-svg-icons";var Ie="icon",ye="icons";import{Fragment as Ee,jsx as F}from"react/jsx-runtime";var J="k-icon",it=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),nt=[],rt={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]},re={viewBox:"0 0 24 24",type:"svg"},T=e=>{let{size:t,themeColor:o,icon:r,type:c=re.type,rotate:m,flip:a,viewBox:L=re.viewBox,...d}=e;if(!r)return F(Ee,{});if(c==="svg"){if(r==="none")return F(ie,{...d,className:s(e.className,J),icon:r,size:t});let u=ne[r]?r:it(`${r}-icon`);return ne[u]?F(ie,{...d,className:s(e.className,J),icon:ne[u],size:t,themeColor:o,rotate:m,flip:a,viewBox:L}):F(Ee,{})}return F(ge,{...d,className:s(e.className,J),icon:r,size:t,themeColor:o,rotate:m,flip:a})};T.states=nt;T.options=rt;T.defaultOptions=re;T.className=J;T.moduleName=Ie;T.folderName=ye;import{jsx as W,jsxs as pt}from"react/jsx-runtime";var ae="k-list-item",at=[p.hover,p.focus,p.selected,p.disabled],lt={},mt={},l=e=>{let{text:t,groupLabel:o,group:r,showIcon:c,iconName:m,showCheckbox:a,checked:L,hover:d,focus:u,selected:C,disabled:x,...f}=e,b=t||e.children;return pt("li",{...f,className:s(e.className,r?"k-list-group-item":ae,M(ae,{hover:d,focus:u,disabled:x,selected:C})),children:[a&&W(v,{checked:L}),c&&W(T,{icon:m}),W("span",{className:"k-list-item-text",children:b}),o&&o!==""&&W("div",{className:"k-list-item-group-label",children:o})]})};l.states=at;l.options=lt;l.className=ae;l.defaultOptions=mt;l.moduleName=y;l.folderName=S;import{jsx as le,jsxs as dt}from"react/jsx-runtime";var ct="k-list-content",G=e=>{let{virtualization:t,...o}=e;return dt("div",{...o,className:s(ct,e.className),children:[le("ul",{className:s("k-list-ul"),children:e.children}),t&&le("div",{className:"k-height-container",children:le("div",{})})]})};import{jsx as Me}from"react/jsx-runtime";var ut="k-list-group-sticky-header",Se=e=>Me("div",{className:s(ut,e.className),children:Me("div",{className:"k-list-header-text",children:e.children})});import{Fragment as Lt,jsx as Ae,jsxs as ft}from"react/jsx-runtime";var h=e=>{let{virtualization:t,label:o}=e;return ft(Lt,{children:[o&&Ae(Se,{children:o}),e.children&&Ae(G,{virtualization:t,children:e.children})]})};import{jsx as Oe}from"react/jsx-runtime";var xt="k-list-group-item",xe=e=>Oe("li",{className:s(xt,e.className),children:Oe("span",{className:"k-list-item-text",children:e.children})});import{jsx as Nt}from"react/jsx-runtime";var me="k-list-optionlabel",bt=[p.hover,p.focus,p.selected,p.disabled],ht={},Ct={},q=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:m,...a}=e;return Nt("div",{...a,className:s(me,M(me,{hover:o,focus:r,selected:c,disabled:m})),children:t})};q.states=bt;q.options=ht;q.className=me;q.defaultOptions=Ct;import{jsx as It}from"react/jsx-runtime";var pe="k-list-custom-value",kt=[p.hover,p.focus,p.selected,p.disabled],gt={},vt={},Q=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:m,...a}=e;return It("div",{...a,className:s(pe,M(pe,{hover:o,focus:r,selected:c,disabled:m})),children:t})};Q.states=kt;Q.options=gt;Q.className=pe;Q.defaultOptions=vt;import{jsx as Vs}from"react/jsx-runtime";import{jsx as Qs}from"react/jsx-runtime";import{jsx as ei,jsxs as ti}from"react/jsx-runtime";import{jsx as ni,jsxs as ri}from"react/jsx-runtime";import{jsx as pi}from"react/jsx-runtime";import{jsx as Li,jsxs as fi}from"react/jsx-runtime";import{jsx as P,jsxs as ce}from"react/jsx-runtime";var Ri=e=>ce(g,{...e,children:[ce(h,{label:"Group 1",root:!0,children:[P(l,{children:"List item 1.1"}),P(l,{children:"List item 1.2"}),P(l,{children:"List item 1.3"})]}),ce(h,{label:"Group 2",children:[P(l,{children:"List item 2.1"}),P(l,{children:"List item 2.2"}),P(l,{children:"List item 2.3"})]})]});export{Ri as AngularListWithGrouping};