@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 13.9 kB
JavaScript
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((s,a)=>e[a]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(t,e)=>i({[`${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.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),C=(t,e)=>{let{valid:s,invalid:a,hover:p,focus:m,checked:r,active:L,selected:c,disabled:d,indeterminate:N,loading:b,empty:f,readonly:x,highlighted:K,...O}=e;return i({"k-valid":s,"k-invalid":a,"k-hover":p,"k-focus":m,"k-checked":r,"k-active":L,"k-selected":c,"k-disabled":d,"k-indeterminate":N&&!r,"k-loading":b,"k-empty":f,"k-readonly":x,"k-highlighted":K},Object.keys(O).reduce((v,I)=>(I.startsWith("k-")?v[I]=O[I]:v[`k-${I}`]=O[I],v),{}))};function kt(t,e){if(!e)return{};let s=Array.isArray(e)?e:[e];return Object.fromEntries(s.map(a=>[`k-${a}`,!0]))}var o={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},k={small:"small",medium:"medium",large:"large",full:"full"},B={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},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",generating:"generating",expanded:"expanded"};import{Fragment as Wt,jsx as gt}from"react/jsx-runtime";var nt="k-font-icon",Ft=[],Vt={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},Jt={},F=t=>{let{size:e,themeColor:s,icon:a,rotate:p,flip:m,...r}=t;return a?gt("span",{...r,className:i(t.className,nt,h(nt,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${p}`]:p,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):gt(Wt,{})};F.states=Ft;F.options=Vt;F.className=nt;F.defaultOptions=Jt;var Mt=F;import{Fragment as Yt,jsx as Y}from"react/jsx-runtime";var rt="k-svg-icon",qt=[],Qt={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},vt={viewBox:"0 0 24 24"},V=t=>{let{size:e,themeColor:s,rotate:a,flip:p,viewBox:m=vt.viewBox,icon:r,...L}=t;if(!r)return Y(Yt,{});r==="none"&&{...L,className:i(t.className,rt,"k-none")};let c=typeof r=="object"&&r.name&&r.name;return Y("span",{...L,className:i(t.className,rt,h("k-icon",{size:e}),{[`k-svg-i-${c}`]:c,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"}),children:Y("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof r=="object"?r.viewBox:m,dangerouslySetInnerHTML:typeof r=="object"?{__html:r.content}:void 0,children:r?void 0:t.children})})};V.states=qt;V.options=Qt;V.className=rt;V.defaultOptions=vt;var at=V;import*as lt from"@progress/kendo-svg-icons";var Et="icon",It="icons";import{Fragment as yt,jsx as J}from"react/jsx-runtime";var Z="k-icon",Zt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),jt=[],te={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},mt={viewBox:"0 0 24 24",type:"svg"},E=t=>{let{size:e,themeColor:s,icon:a,type:p=mt.type,rotate:m,flip:r,viewBox:L=mt.viewBox,...c}=t;if(!a)return J(yt,{});if(p==="svg"){if(a==="none")return J(at,{...c,className:i(t.className,Z),icon:a,size:e});let d=lt[a]?a:Zt(`${a}-icon`);return lt[d]?J(at,{...c,className:i(t.className,Z),icon:lt[d],size:e,themeColor:s,rotate:m,flip:r,viewBox:L}):J(yt,{})}return J(Mt,{...c,className:i(t.className,Z),icon:a,size:e,themeColor:s,rotate:m,flip:r})};E.states=jt;E.options=te;E.defaultOptions=mt;E.className=Z;E.moduleName=Et;E.folderName=It;var pt="button",At=pt;import{Fragment as ie,jsx as W,jsxs as Ot}from"react/jsx-runtime";var q="k-button",ee=["icon-button"],oe=[l.hover,l.focus,l.active,l.selected,l.disabled,l.generating],se={size:[o.small,o.medium,o.large],rounded:[k.small,k.medium,k.large,k.full],fillMode:[B.solid,B.flat,B.outline,B.clear,B.link],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark,n.inverse]},R={size:o.medium,rounded:k.medium,fillMode:B.solid,themeColor:n.base,showArrow:!1,arrowIconName:"caret-alt-down"},g=t=>{let{size:e=R.size,rounded:s=R.rounded,fillMode:a=R.fillMode,themeColor:p=R.themeColor,showArrow:m=R.showArrow,arrowIconName:r=R.arrowIconName,variant:L,hover:c,focus:d,active:N,selected:b,disabled:f,icon:x,text:K,iconClassName:O,...v}=t,I=x!==void 0,Xt=t.children!==void 0;return Ot("button",{...v,className:i(t.className,q,kt(q,L),h(q,{size:e,rounded:s,fillMode:a,themeColor:p}),C(q,{hover:c,focus:d,active:N,disabled:f,selected:b}),{"k-icon-button":!K&&!Xt&&I}),children:[x&&W(E,{className:i(O,"k-button-icon"),icon:x}),K?Ot(ie,{children:[K&&W("span",{className:"k-button-text",children:K}),t.children]}):t.children&&W("span",{className:"k-button-text",children:t.children}),m&&W("span",{className:"k-menu-button-arrow k-button-arrow",children:W(E,{icon:r})})]})};g.states=oe;g.options=se;g.variants=ee;g.className=q;g.defaultOptions=R;g.moduleName=pt;g.folderName=At;import{jsx as Io}from"react/jsx-runtime";import{jsx as So}from"react/jsx-runtime";import{jsx as _o}from"react/jsx-runtime";import{jsx as re}from"react/jsx-runtime";var ne="k-no-data",Q=t=>re("span",{className:i(ne,t.className),children:t.children});var S="list",z=S;import{jsx as P,jsxs as St}from"react/jsx-runtime";var ct="k-list",ae=[],le={size:[o.small,o.medium,o.large]},Tt={size:o.medium},M=t=>{let{size:e=Tt.size,virtualization:s,children:a,optionLabel:p,customValue:m,screenReaders:r,...L}=t,c,d,N,b,f=[];return a?a.map((x,K)=>{x.type===y?(x.props.root===!0?(c=x.props.label,x.props.children.map((O,v)=>{f.push(P(u,{...O.props},`optChild-${v}-${new Date().getTime()}`))})):x.props.children.forEach((O,v)=>{let I="";v===0&&(I=x.props.label),f.push(P(u,{className:v===0?"k-first":"",...O.props,groupLabel:I},`groupLabel-${v}-${new Date().getTime()}`))}),d=P(y,{label:c,virtualization:s,children:f})):x.type===u&&(f.push(P(u,{...x.props},`${x.type}-${K}`)),N=P($,{virtualization:s,children:f}),r&&(b=St(Q,{className:"k-sr-only",children:[f.length," items found."]})))}):b=P(Q,{children:"No data found."}),St("div",{...L,className:i(t.className,ct,h(ct,{size:e}),{"k-virtual-list":s}),children:[p,m,d,N,b]})};M.states=ae;M.options=le;M.className=ct;M.defaultOptions=Tt;M.moduleName=S;M.folderName=z;import{jsx as de}from"react/jsx-runtime";var Kt="k-list-container",me=[],pe={},ce={},U=t=>{let{...e}=t;return de("div",{...e,className:i(t.className,Kt),children:t.children})};U.states=me;U.options=pe;U.className=Kt;U.defaultOptions=ce;U.moduleName=S;U.folderName=z;import{jsx as D,jsxs as fe}from"react/jsx-runtime";var dt="k-list",ue=[],Le={size:[o.small,o.medium,o.large]},zt={size:o.medium},T=t=>{let{size:e=zt.size,virtualization:s,children:a,...p}=t,m,r,L,c=[];return a?a.map((d,N)=>{d.type===y?(d.props.root===!0?(m=d.props.label,d.props.children.map((b,f)=>{c.push(D(u,{...b.props},`optChild-${f}-${new Date().getTime()}`))})):(c.push(D(_t,{...d.props,children:d.props.label},`listChild-${N}`)),d.props.children.map((b,f)=>{c.push(D(u,{...b.props},`fwOptChild-${f}-${new Date().getTime()}`))})),r=D(y,{label:m,virtualization:s,children:c})):d.type===u&&(c.push(D(u,{...d.props},`${d.type}-${N}`)),L=D($,{virtualization:s,children:c}))}):L=D(Q,{children:"No data found."}),fe("div",{...p,className:i(t.className,dt,h(dt,{size:e}),{"k-virtual-list":s}),children:[r,L]})};T.states=ue;T.options=Le;T.className=dt;T.defaultOptions=zt;T.moduleName=S;T.folderName=z;var G="checkbox",X=G;import{jsx as Ht}from"react/jsx-runtime";var j="k-checkbox",xe=[l.hover,l.focus,l.valid,l.invalid,l.required,l.disabled,l.checked,l.indeterminate],be={size:[o.small,o.medium,o.large],rounded:[k.small,k.medium,k.large,k.full]},ut={size:o.medium,rounded:k.medium},A=t=>{let{id:e,checked:s,indeterminate:a,hover:p,focus:m,disabled:r,invalid:L,valid:c,required:d,size:N=ut.size,rounded:b=ut.rounded,...f}=t;return Ht("span",{className:"k-checkbox-wrap",children:Ht("input",{...f,id:e,type:"checkbox",defaultChecked:s,required:d,className:i(t.className,j,h(j,{size:N,rounded:b}),C(j,{hover:p,focus:m,disabled:r,invalid:L,valid:c,indeterminate:a,checked:s}))})})};A.states=xe;A.options=be;A.className=j;A.defaultOptions=ut;A.moduleName=G;A.folderName=X;import{jsx as Ce}from"react/jsx-runtime";var Bt="k-checkbox-list",he=[],Ne={},Rt={layout:"vertical"},_=t=>{let{layout:e=Rt.layout,...s}=t;return Ce("ul",{...s,className:i(t.className,Bt,{[`k-list-${e}`]:e}),children:t.children})};_.states=he;_.options=Ne;_.className=Bt;_.defaultOptions=Rt;_.moduleName=G;_.folderName=X;import{jsx as ve}from"react/jsx-runtime";var Dt="k-checkbox-list-item",ke=[],ge={},Me={},H=t=>{let{...e}=t;return ve("li",{...e,className:i(t.className,Dt),children:t.children})};H.states=ke;H.options=ge;H.className=Dt;H.defaultOptions=Me;H.moduleName=G;H.folderName=X;import{Fragment as Es,jsx as vs,jsxs as Is}from"react/jsx-runtime";import{Fragment as Ts,jsx as Ss,jsxs as Ks}from"react/jsx-runtime";import{Fragment as Rs,jsx as Bs,jsxs as Ds}from"react/jsx-runtime";import{Fragment as Us,jsx as $s,jsxs as Xs}from"react/jsx-runtime";import{jsx as Ws}from"react/jsx-runtime";import{jsx as Zs}from"react/jsx-runtime";import{jsx as tt,jsxs as Ae}from"react/jsx-runtime";var ft="k-list-item",Ee=[l.hover,l.focus,l.selected,l.disabled],Ie={},ye={},u=t=>{let{text:e,groupLabel:s,group:a,showIcon:p,iconName:m,showCheckbox:r,checked:L,hover:c,focus:d,selected:N,disabled:b,...f}=t,x=e||t.children;return Ae("li",{...f,className:i(t.className,a?"k-list-group-item":ft,C(ft,{hover:c,focus:d,disabled:b,selected:N})),children:[r&&tt(A,{checked:L}),p&&tt(E,{icon:m}),tt("span",{className:"k-list-item-text",children:x}),s&&s!==""&&tt("div",{className:"k-list-item-group-label",children:s})]})};u.states=Ee;u.options=Ie;u.className=ft;u.defaultOptions=ye;u.moduleName=S;u.folderName=z;import{jsx as xt,jsxs as Se}from"react/jsx-runtime";var Oe="k-list-content",$=t=>{let{virtualization:e,...s}=t;return Se("div",{...s,className:i(Oe,t.className),children:[xt("ul",{className:i("k-list-ul"),children:t.children}),e&&xt("div",{className:"k-height-container",children:xt("div",{})})]})};import{jsx as Gt}from"react/jsx-runtime";var Te="k-list-group-sticky-header",wt=t=>Gt("div",{className:i(Te,t.className),children:Gt("div",{className:"k-list-header-text",children:t.children})});import{Fragment as Ke,jsx as Pt,jsxs as ze}from"react/jsx-runtime";var y=t=>{let{virtualization:e,label:s}=t;return ze(Ke,{children:[s&&Pt(wt,{children:s}),t.children&&Pt($,{virtualization:e,children:t.children})]})};import{jsx as $t}from"react/jsx-runtime";var _e="k-list-group-item",_t=t=>$t("li",{className:i(_e,t.className),children:$t("span",{className:"k-list-item-text",children:t.children})});import{jsx as De}from"react/jsx-runtime";var bt="k-list-optionlabel",He=[l.hover,l.focus,l.selected,l.disabled],Be={},Re={},et=t=>{let{text:e,hover:s,focus:a,selected:p,disabled:m,...r}=t;return De("div",{...r,className:i(bt,C(bt,{hover:s,focus:a,selected:p,disabled:m})),children:e})};et.states=He;et.options=Be;et.className=bt;et.defaultOptions=Re;import{jsx as $e}from"react/jsx-runtime";var ht="k-list-custom-value",Ge=[l.hover,l.focus,l.selected,l.disabled],we={},Pe={},ot=t=>{let{text:e,hover:s,focus:a,selected:p,disabled:m,...r}=t;return $e("div",{...r,className:i(ht,C(ht,{hover:s,focus:a,selected:p,disabled:m})),children:e})};ot.states=Ge;ot.options=we;ot.className=ht;ot.defaultOptions=Pe;import{jsx as Bi}from"react/jsx-runtime";import{jsx as wi}from"react/jsx-runtime";import{jsx as Xi,jsxs as Fi}from"react/jsx-runtime";import{jsx as qi,jsxs as Qi}from"react/jsx-runtime";import{jsx as tn}from"react/jsx-runtime";import{jsx as nn,jsxs as rn}from"react/jsx-runtime";import{jsx as pn,jsxs as cn}from"react/jsx-runtime";var Nt="listbox",Ut=Nt;import{jsx as st,jsxs as Fe}from"react/jsx-runtime";var it="k-listbox",Ue=[l.disabled],Xe={size:[o.small,o.medium,o.large]},Ct={size:o.medium,actionsPosition:"left"},w=t=>{let{size:e=Ct.size,disabled:s,children:a,actionsPosition:p=Ct.actionsPosition,actions:m,dir:r,...L}=t;return Fe("div",{...L,dir:r,className:i(t.className,it,h(it,{size:e}),C(it,{disabled:s}),{[`k-listbox-actions-${p}`]:p}),children:[m&&st("div",{className:"k-listbox-actions",children:m.map(c=>st(g,{icon:{left:r!=="rtl"?"caret-alt-left":"caret-alt-right",right:r!=="rtl"?"caret-alt-right":"caret-alt-left",to:r!=="rtl"?"caret-double-alt-right":"caret-double-alt-left",from:r!=="rtl"?"caret-double-alt-left":"caret-double-alt-right",up:"caret-alt-up",down:"caret-alt-down",x:"x"}[c],size:e},c))}),st("div",{className:i("k-list-scroller","k-selectable"),children:st(M,{size:e,children:a})})]})};w.states=Ue;w.options=Xe;w.className=it;w.defaultOptions=Ct;w.moduleName=Nt;w.folderName=Ut;var Bn=w;export{it as LISTBOX_CLASSNAME,w as ListBox,Bn as default};