@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 5.89 kB
JavaScript
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((i,s)=>e[s]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(t,e)=>l({[`${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"}),B=(t,e)=>{let{valid:i,invalid:s,hover:r,focus:d,checked:c,active:a,selected:x,disabled:p,indeterminate:m,loading:N,empty:g,readonly:j,highlighted:D,...O}=e;return l({"k-valid":i,"k-invalid":s,"k-hover":r,"k-focus":d,"k-checked":c,"k-active":a,"k-selected":x,"k-disabled":p,"k-indeterminate":m&&!c,"k-loading":N,"k-empty":g,"k-readonly":j,"k-highlighted":D},Object.keys(O).reduce((w,v)=>(v.startsWith("k-")?w[v]=O[v]:w[`k-${v}`]=O[v],w),{}))};var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var u={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},z={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{Fragment as J,jsx as R}from"react/jsx-runtime";var M="k-font-icon",U=[],q={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},W={},y=t=>{let{size:e,themeColor:i,icon:s,rotate:r,flip:d,...c}=t;return s?R("span",{...c,className:l(t.className,M,h(M,{size:e}),{[`k-i-${s}`]:s,[`k-color-${i}`]:i,[`k-rotate-${r}`]:r,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):R(J,{})};y.states=U;y.options=q;y.className=M;y.defaultOptions=W;var G=y;import{Fragment as Y,jsx as I}from"react/jsx-runtime";var $="k-svg-icon",Q=[],X={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[u.outline,u.solid,u.duotone]},A={viewBox:"0 0 24 24",variant:u.outline},C=t=>{let{size:e,themeColor:i,rotate:s,flip:r,viewBox:d=A.viewBox,variant:c=A.variant,icon:a,...x}=t;if(!a)return I(Y,{});if(a==="none")return I("span",{...x,className:l(t.className,$,h("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let p=typeof a=="object"&&a.name&&a.name,m=typeof a=="object"?c&&a.variants?.[c]||a.variants?.outline||a.content:void 0;return I("span",{...x,className:l(t.className,$,h("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${i}`]:i,[`k-rotate-${s}`]:s,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:I("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:d,dangerouslySetInnerHTML:m!==void 0?{__html:m}:void 0,children:a?void 0:t.children})})};C.states=Q;C.options=X;C.className=$;C.defaultOptions=A;var L=C;import*as E from"@progress/kendo-svg-icons";var H="icon",F="icons";import{useContext as ee}from"react";import{createContext as Z}from"react";var V=Z({iconsType:"svg"});import{Fragment as K,jsx as k}from"react/jsx-runtime";var S="k-icon",te=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),oe=[],ne={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[u.outline,u.solid,u.duotone]},T={viewBox:"0 0 24 24",type:"svg",variant:u.outline},f=t=>{let{iconsType:e}=ee(V),{size:i,themeColor:s,icon:r,type:d=e||T.type,rotate:c,flip:a,viewBox:x=T.viewBox,variant:p=T.variant,...m}=t;if(!r)return k(K,{});if((e||d)==="svg"){if(r==="none")return k(L,{...m,className:l(t.className,S),icon:r,size:i,variant:p});let g=E[r]?r:te(`${r}-icon`);return E[g]?k(L,{...m,className:l(t.className,S),icon:E[g],size:i,themeColor:s,rotate:c,flip:a,viewBox:x,variant:p}):k(K,{})}return k(G,{...m,className:l(t.className,S),icon:r,size:i,themeColor:s,rotate:c,flip:a})};f.states=oe;f.options=ne;f.defaultOptions=T;f.className=S;f.moduleName=H;f.folderName=F;f.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};import{jsx as _,jsxs as se}from"react/jsx-runtime";var P="k-pivotgrid-cell",re=[z.focus,z.selected],ie={},ae={},b=t=>{let{as:e="td",toggle:i,headerTitle:s,content:r,headerRootCell:d,totalCell:c,headerTotalCell:a,rowTotalCell:x,focus:p,selected:m,...N}=t,g={up:"up",down:"down"};return se(e,{...N,className:l(t.className,P,{"k-pivotgrid-expanded":i==="up","k-pivotgrid-header-root":d,"k-pivotgrid-total":c,"k-pivotgrid-header-total":a,"k-pivotgrid-row-total":x},B(P,{focus:p,selected:m})),children:[i&&_(f,{className:"k-pivotgrid-toggle",icon:`chevron-${g[i]}`}),s&&_("span",{className:"k-pivotgrid-header-title",children:s}),(r||r==="")&&_("span",{className:"k-pivotgrid-content",children:r})]})};b.states=re;b.options=ie;b.className=P;b.defaultOptions=ae;var Fe=b;export{P as PIVOTGRIDCELL_CLASSNAME,b as PivotGridCell,Fe as default};