@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 5.92 kB
JavaScript
var i=(...s)=>s.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((l,a)=>e[a]||e[l]&&l||null).filter(l=>l!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(s,e)=>i({[`${s}-xs`]:e.size==="xsmall",[`${s}-sm`]:e.size==="small",[`${s}-md`]:e.size==="medium",[`${s}-lg`]:e.size==="large",[`${s}-xl`]:e.size==="xlarge",[`${s}-xxl`]:e.size==="xxlarge",[`${s}-xxxl`]:e.size==="xxxlarge"},{[`${s}-${e.fillMode}`]:e.fillMode},{[`${s}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${s}-${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"});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"};import{Fragment as W,jsx as _}from"react/jsx-runtime";var O="k-font-icon",D=[],K={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},G={},g=s=>{let{size:e,themeColor:l,icon:a,rotate:c,flip:m,...r}=s;return a?_("span",{...r,className:i(s.className,O,y(O,{size:e}),{[`k-i-${a}`]:a,[`k-color-${l}`]:l,[`k-rotate-${c}`]:c,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):_(W,{})};g.states=D;g.options=K;g.className=O;g.defaultOptions=G;var $=g;import{Fragment as q,jsx as w}from"react/jsx-runtime";var I="k-svg-icon",j=[],U={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},V={viewBox:"0 0 24 24"},h=s=>{let{size:e,themeColor:l,rotate:a,flip:c,viewBox:m=V.viewBox,icon:r,...d}=s;if(!r)return w(q,{});r==="none"&&{...d,className:i(s.className,I,"k-none")};let f=typeof r=="object"&&r.name&&r.name;return w("span",{...d,className:i(s.className,I,y("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${l}`]:l,[`k-rotate-${a}`]:a,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:w("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:s.children})})};h.states=j;h.options=U;h.className=I;h.defaultOptions=V;var M=h;import*as E from"@progress/kendo-svg-icons";var R="icon",T="icons";import{Fragment as B,jsx as N}from"react/jsx-runtime";var b="k-icon",J=s=>s.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),X=[],Q={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},L={viewBox:"0 0 24 24",type:"svg"},p=s=>{let{size:e,themeColor:l,icon:a,type:c=L.type,rotate:m,flip:r,viewBox:d=L.viewBox,...f}=s;if(!a)return N(B,{});if(c==="svg"){if(a==="none")return N(M,{...f,className:i(s.className,b),icon:a,size:e});let v=E[a]?a:J(`${a}-icon`);return E[v]?N(M,{...f,className:i(s.className,b),icon:E[v],size:e,themeColor:l,rotate:m,flip:r,viewBox:d}):N(B,{})}return N($,{...f,className:i(s.className,b),icon:a,size:e,themeColor:l,rotate:m,flip:r})};p.states=X;p.options=Q;p.defaultOptions=L;p.className=b;p.moduleName=R;p.folderName=T;var z="scrollview",F=z;import{Fragment as C,jsx as t,jsxs as u}from"react/jsx-runtime";var A="k-scrollview",Y=[],Z={},k={mode:"normal",views:9,currentView:5,animate:!0,arrows:!0,pager:!0,rtl:!1},x=s=>{let{mode:e=k.mode,views:l=k.views,currentView:a=k.currentView,animate:c=k.animate,arrows:m=k.arrows,pager:r=k.pager,rtl:d=k.rtl,...f}=s,v=[],H=d?"chevron-right":"chevron-left",P=d?"chevron-left":"chevron-right";for(let S=0;S<l;S++)v.push(t("div",{className:"k-scrollview-view"},S));return u("div",{...f,className:i(A,s.className,{[`${A}-${e}`]:e!=="normal","k-rtl":d}),children:[t("div",{className:i("k-scrollview-wrap",{"k-scrollview-animate":c}),style:{"--kendo-scrollview-views":l,"--kendo-scrollview-current":a},children:v}),u("div",{className:"k-scrollview-elements",children:[m&&u(C,{children:[t("span",{className:"k-scrollview-prev",children:t(p,{icon:H,size:"xxxlarge"})}),t("span",{className:"k-scrollview-next",children:t(p,{icon:P,size:"xxxlarge"})})]}),r&&t("div",{className:"k-scrollview-nav-wrap",children:u("div",{className:"k-scrollview-nav",children:[e==="light"&&u(C,{children:[t("span",{className:"k-link"}),t("span",{className:"k-link k-primary"}),t("span",{className:"k-link k-primary k-focus"}),t("span",{className:"k-link k-focus"}),t("span",{className:"k-link"})]}),e==="normal"&&u(C,{children:[t("span",{className:"k-link",style:{transform:"scale(0.5)"}}),t("span",{className:"k-link",style:{transform:"scale(0.65)"}}),t("span",{className:"k-link",style:{transform:"scale(0.8)"}}),t("span",{className:"k-link"}),t("span",{className:"k-link k-primary"}),t("span",{className:"k-link"}),t("span",{className:"k-link",style:{transform:"scale(0.8)"}}),t("span",{className:"k-link",style:{transform:"scale(0.65)"}}),t("span",{className:"k-link",style:{transform:"scale(0.5)"}})]}),e==="dark"&&u(C,{children:[t("span",{className:"k-link",style:{transform:"scale(0.5)"}}),t("span",{className:"k-link",style:{transform:"scale(0.65)"}}),t("span",{className:"k-link"}),t("span",{className:"k-link k-primary"}),t("span",{className:"k-link"}),t("span",{className:"k-link",style:{transform:"scale(0.65)"}}),t("span",{className:"k-link",style:{transform:"scale(0.5)"}})]})]})})]}),t("div",{className:"k-sr-only"})]})};x.states=Y;x.options=Z;x.className=A;x.defaultOptions=k;x.moduleName=z;x.folderName=F;var Ee=x;export{x as ScrollView,Ee as default};