@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 2.14 kB
JavaScript
import d from"react";var o=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?o(...e):typeof e=="object"?Object.keys(e).map((n,i)=>e[i]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var x=(t,e)=>o({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"});var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};import{jsx as h}from"react/jsx-runtime";var M="k-list-group-sticky-header",g=t=>h("div",{className:o(M,t.className),children:h("div",{className:"k-list-header-text",children:t.children})});import{jsx as D}from"react/jsx-runtime";var z="k-no-data",s=t=>{let{live:e,...n}=t;return D("span",{...n,className:o(z,t.className),"aria-live":e?"polite":void 0,children:t.children})};var l="list",p=l;import{jsx as k,jsxs as v}from"react/jsx-runtime";var c="k-list",E=[],S={size:[r.undefined,r.small,r.medium,r.large]},T={},a=t=>{let{size:e,virtualization:n,children:i,header:u,selectAll:N,optionLabel:y,customValue:L,noData:m,screenReaders:R,...b}=t,f=d.Children.toArray(i)[0],A=f?.props?.children?d.Children.count(f.props.children):d.Children.count(i);return v("div",{...b,className:o(t.className,c,x(c,{size:e}),{"k-virtual-list":n}),children:[y,N,L,u&&k(g,{children:u}),i||(m!==void 0?m:k(s,{live:!0,children:"No data found."})),R&&i&&v(s,{className:"k-sr-only",live:!0,children:[A," items found."]})]})};a.states=E;a.options=S;a.className=c;a.defaultOptions=T;a.moduleName=l;a.folderName=p;a.ariaSpec={selector:".k-list",rules:[{selector:".k-list .k-no-data",attribute:"aria-live=polite",usage:'Announces "No data found" to screen readers.'}]};var ne=a;export{c as LIST_CLASSNAME,a as List,ne as default};