UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 11.1 kB
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 C=(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:p,focus:l,checked:a,active:L,selected:c,disabled:d,indeterminate:h,loading:x,empty:f,readonly:b,highlighted:Q,...K}=t;return s({"k-valid":o,"k-invalid":r,"k-hover":p,"k-focus":l,"k-checked":a,"k-active":L,"k-selected":c,"k-disabled":d,"k-indeterminate":h&&!a,"k-loading":x,"k-empty":f,"k-readonly":b,"k-highlighted":Q},Object.keys(K).reduce((v,E)=>(E.startsWith("k-")?v[E]=K[E]:v[`k-${E}`]=K[E],v),{}))};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"},m={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 Oe}from"react/jsx-runtime";var Ae="k-no-data",P=e=>Oe("span",{className:s(Ae,e.className),children:e.children});var I="list",S=I;import{jsx as R,jsxs as pe}from"react/jsx-runtime";var Y="k-list",Te=[],Ke={size:[i.small,i.medium,i.large]},ce={size:i.medium},k=e=>{let{size:t=ce.size,virtualization:o,children:r,optionLabel:p,customValue:l,screenReaders:a,...L}=e,c,d,h,x,f=[];return r?r.map((b,Q)=>{b.type===N?(b.props.root===!0?(c=b.props.label,b.props.children.map((K,v)=>{f.push(R(u,{...K.props},`optChild-${v}-${new Date().getTime()}`))})):b.props.children.forEach((K,v)=>{let E="";v===0&&(E=b.props.label),f.push(R(u,{className:v===0?"k-first":"",...K.props,groupLabel:E},`groupLabel-${v}-${new Date().getTime()}`))}),d=R(N,{label:c,virtualization:o,children:f})):b.type===u&&(f.push(R(u,{...b.props},`${b.type}-${Q}`)),h=R(G,{virtualization:o,children:f}),a&&(x=pe(P,{className:"k-sr-only",children:[f.length," items found."]})))}):x=R(P,{children:"No data found."}),pe("div",{...L,className:s(e.className,Y,C(Y,{size:t}),{"k-virtual-list":o}),children:[p,l,d,h,x]})};k.states=Te;k.options=Ke;k.className=Y;k.defaultOptions=ce;k.moduleName=I;k.folderName=S;import{jsx as Re}from"react/jsx-runtime";var de="k-list-container",ze=[],He={},_e={},D=e=>{let{...t}=e;return Re("div",{...t,className:s(e.className,de),children:e.children})};D.states=ze;D.options=He;D.className=de;D.defaultOptions=_e;D.moduleName=I;D.folderName=S;import{jsx as z,jsxs as $e}from"react/jsx-runtime";var Z="k-list",Ge=[],De={size:[i.small,i.medium,i.large]},ue={size:i.medium},y=e=>{let{size:t=ue.size,virtualization:o,children:r,...p}=e,l,a,L,c=[];return r?r.map((d,h)=>{d.type===N?(d.props.root===!0?(l=d.props.label,d.props.children.map((x,f)=>{c.push(z(u,{...x.props},`optChild-${f}-${new Date().getTime()}`))})):(c.push(z(Le,{...d.props,children:d.props.label},`listChild-${h}`)),d.props.children.map((x,f)=>{c.push(z(u,{...x.props},`fwOptChild-${f}-${new Date().getTime()}`))})),a=z(N,{label:l,virtualization:o,children:c})):d.type===u&&(c.push(z(u,{...d.props},`${d.type}-${h}`)),L=z(G,{virtualization:o,children:c}))}):L=z(P,{children:"No data found."}),$e("div",{...p,className:s(e.className,Z,C(Z,{size:t}),{"k-virtual-list":o}),children:[a,L]})};y.states=Ge;y.options=De;y.className=Z;y.defaultOptions=ue;y.moduleName=I;y.folderName=S;var H="checkbox",$=H;import{jsx as fe}from"react/jsx-runtime";var F="k-checkbox",Pe=[m.hover,m.focus,m.valid,m.invalid,m.required,m.disabled,m.checked,m.indeterminate],we={size:[i.small,i.medium,i.large],rounded:[_.small,_.medium,_.large,_.full]},j={size:i.medium,rounded:_.medium},g=e=>{let{id:t,checked:o,indeterminate:r,hover:p,focus:l,disabled:a,invalid:L,valid:c,required:d,size:h=j.size,rounded:x=j.rounded,...f}=e;return fe("span",{className:"k-checkbox-wrap",children:fe("input",{...f,id:t,type:"checkbox",defaultChecked:o,required:d,className:s(e.className,F,C(F,{size:h,rounded:x}),M(F,{hover:p,focus:l,disabled:a,invalid:L,valid:c,indeterminate:r,checked:o}))})})};g.states=Pe;g.options=we;g.className=F;g.defaultOptions=j;g.moduleName=H;g.folderName=$;import{jsx as Fe}from"react/jsx-runtime";var xe="k-checkbox-list",Be=[],Xe={},be={layout:"vertical"},A=e=>{let{layout:t=be.layout,...o}=e;return Fe("ul",{...o,className:s(e.className,xe,{[`k-list-${t}`]:t}),children:e.children})};A.states=Be;A.options=Xe;A.className=xe;A.defaultOptions=be;A.moduleName=H;A.folderName=$;import{jsx as We}from"react/jsx-runtime";var he="k-checkbox-list-item",Ue=[],Ve={},Je={},O=e=>{let{...t}=e;return We("li",{...t,className:s(e.className,he),children:e.children})};O.states=Ue;O.options=Ve;O.className=he;O.defaultOptions=Je;O.moduleName=H;O.folderName=$;import{Fragment as xo,jsx as fo,jsxs as bo}from"react/jsx-runtime";import{Fragment as go,jsx as ko,jsxs as vo}from"react/jsx-runtime";import{Fragment as So,jsx as Mo,jsxs as Ao}from"react/jsx-runtime";import{Fragment as Ho,jsx as zo,jsxs as _o}from"react/jsx-runtime";import{jsx as $o}from"react/jsx-runtime";import{jsx as Xo}from"react/jsx-runtime";import{Fragment as Ze,jsx as Ce}from"react/jsx-runtime";var te="k-font-icon",qe=[],Qe={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]},Ye={},w=e=>{let{size:t,themeColor:o,icon:r,rotate:p,flip:l,...a}=e;return r?Ce("span",{...a,className:s(e.className,te,C(te,{size:t}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${p}`]:p,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):Ce(Ze,{})};w.states=qe;w.options=Qe;w.className=te;w.defaultOptions=Ye;var Ne=w;import{Fragment as tt,jsx as U}from"react/jsx-runtime";var oe="k-svg-icon",je=[],et={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]},ke={viewBox:"0 0 24 24"},B=e=>{let{size:t,themeColor:o,rotate:r,flip:p,viewBox:l=ke.viewBox,icon:a,...L}=e;if(!a)return U(tt,{});a==="none"&&{...L,className:s(e.className,oe,"k-none")};let c=typeof a=="object"&&a.name&&a.name;return U("span",{...L,className:s(e.className,oe,C("k-icon",{size:t}),{[`k-svg-i-${c}`]:c,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"}),children:U("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:l,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:e.children})})};B.states=je;B.options=et;B.className=oe;B.defaultOptions=ke;var se=B;import*as ie from"@progress/kendo-svg-icons";var ge="icon",ve="icons";import{Fragment as Ie,jsx as X}from"react/jsx-runtime";var V="k-icon",ot=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),st=[],it={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]},ne={viewBox:"0 0 24 24",type:"svg"},T=e=>{let{size:t,themeColor:o,icon:r,type:p=ne.type,rotate:l,flip:a,viewBox:L=ne.viewBox,...c}=e;if(!r)return X(Ie,{});if(p==="svg"){if(r==="none")return X(se,{...c,className:s(e.className,V),icon:r,size:t});let d=ie[r]?r:ot(`${r}-icon`);return ie[d]?X(se,{...c,className:s(e.className,V),icon:ie[d],size:t,themeColor:o,rotate:l,flip:a,viewBox:L}):X(Ie,{})}return X(Ne,{...c,className:s(e.className,V),icon:r,size:t,themeColor:o,rotate:l,flip:a})};T.states=st;T.options=it;T.defaultOptions=ne;T.className=V;T.moduleName=ge;T.folderName=ve;import{jsx as J,jsxs as lt}from"react/jsx-runtime";var re="k-list-item",nt=[m.hover,m.focus,m.selected,m.disabled],rt={},at={},u=e=>{let{text:t,groupLabel:o,group:r,showIcon:p,iconName:l,showCheckbox:a,checked:L,hover:c,focus:d,selected:h,disabled:x,...f}=e,b=t||e.children;return lt("li",{...f,className:s(e.className,r?"k-list-group-item":re,M(re,{hover:c,focus:d,disabled:x,selected:h})),children:[a&&J(g,{checked:L}),p&&J(T,{icon:l}),J("span",{className:"k-list-item-text",children:b}),o&&o!==""&&J("div",{className:"k-list-item-group-label",children:o})]})};u.states=nt;u.options=rt;u.className=re;u.defaultOptions=at;u.moduleName=I;u.folderName=S;import{jsx as ae,jsxs as pt}from"react/jsx-runtime";var mt="k-list-content",G=e=>{let{virtualization:t,...o}=e;return pt("div",{...o,className:s(mt,e.className),children:[ae("ul",{className:s("k-list-ul"),children:e.children}),t&&ae("div",{className:"k-height-container",children:ae("div",{})})]})};import{jsx as ye}from"react/jsx-runtime";var ct="k-list-group-sticky-header",Ee=e=>ye("div",{className:s(ct,e.className),children:ye("div",{className:"k-list-header-text",children:e.children})});import{jsx as Me}from"react/jsx-runtime";var dt="k-list-group-item",Le=e=>Me("li",{className:s(dt,e.className),children:Me("span",{className:"k-list-item-text",children:e.children})});import{jsx as xt}from"react/jsx-runtime";var le="k-list-optionlabel",ut=[m.hover,m.focus,m.selected,m.disabled],Lt={},ft={},W=e=>{let{text:t,hover:o,focus:r,selected:p,disabled:l,...a}=e;return xt("div",{...a,className:s(le,M(le,{hover:o,focus:r,selected:p,disabled:l})),children:t})};W.states=ut;W.options=Lt;W.className=le;W.defaultOptions=ft;import{jsx as Nt}from"react/jsx-runtime";var me="k-list-custom-value",bt=[m.hover,m.focus,m.selected,m.disabled],ht={},Ct={},q=e=>{let{text:t,hover:o,focus:r,selected:p,disabled:l,...a}=e;return Nt("div",{...a,className:s(me,M(me,{hover:o,focus:r,selected:p,disabled:l})),children:t})};q.states=bt;q.options=ht;q.className=me;q.defaultOptions=Ct;import{jsx as ws}from"react/jsx-runtime";import{jsx as Us}from"react/jsx-runtime";import{jsx as qs,jsxs as Qs}from"react/jsx-runtime";import{jsx as ei,jsxs as ti}from"react/jsx-runtime";import{jsx as ni}from"react/jsx-runtime";import{jsx as mi,jsxs as pi}from"react/jsx-runtime";import{jsx as Li,jsxs as fi}from"react/jsx-runtime";import{Fragment as kt,jsx as Se,jsxs as gt}from"react/jsx-runtime";var N=e=>{let{virtualization:t,label:o}=e;return gt(kt,{children:[o&&Se(Ee,{children:o}),e.children&&Se(G,{virtualization:t,children:e.children})]})};export{N as ListGroup};