@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 5.95 kB
JavaScript
var c=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?c(...e):typeof e=="object"?Object.keys(e).map((a,l)=>e[l]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var k=(t,e)=>c({[`${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"}),A=(t,e)=>c({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly,"k-highlighted":e.highlighted});var i={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"},N={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"};import{jsx as J}from"react/jsx-runtime";var f="k-pane",G=[],V={},P={resizable:!0,flex:!1},x=t=>{let{scrollable:e,flexBasis:a,flex:l=P.flex,collapsible:r,resizable:s=P.resizable,pinned:n,unpinned:p,tabbed:d,...m}=t;return J("div",{...m,style:{flexBasis:a,...t.style},className:c(t.className,f,{[`${f}-static`]:a,[`${f}-flex`]:l,"k-scrollable":e,[`${f}-pinned`]:n,[`${f}-unpinned`]:p,[`${f}-tabbed`]:d}),children:t.children})};x.states=G;x.options=V;x.className=f;x.defaultOptions=P;import{Fragment as j,jsx as L}from"react/jsx-runtime";var C="k-icon k-font-icon",X=[],D={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},q={},v=t=>{let{size:e,themeColor:a,icon:l,rotate:r,flip:s,...n}=t;return l?L("span",{...n,className:c(t.className,C,k(C,{size:e}),{[`k-i-${l}`]:l,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"})}):L(j,{})};v.states=X;v.options=D;v.className=C;v.defaultOptions=q;var E=v;import{Fragment as W,jsx as z}from"react/jsx-runtime";var I="k-icon k-svg-icon",U=[],Q={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},B={viewBox:"0 0 24 24"},S=t=>{let{size:e,themeColor:a,rotate:l,flip:r,viewBox:s=B.viewBox,icon:n,...p}=t;if(!n)return z(W,{});n==="none"&&{...p,className:c(t.className,I,"k-none")};let d=typeof n=="object"&&n.name&&n.name;return z("span",{...p,className:c(t.className,I,k("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${a}`]:a,[`k-rotate-${l}`]:l,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:z("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof n=="object"?n.viewBox:s,dangerouslySetInnerHTML:typeof n=="object"?{__html:n.content}:void 0,children:n?void 0:t.children})})};S.states=U;S.options=Q;S.className=I;S.defaultOptions=B;var M=S;import*as K from"@progress/kendo-svg-icons";import{Fragment as R,jsx as y}from"react/jsx-runtime";var Y=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Z=[],ee={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},T={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:a,icon:l,type:r=T.type,rotate:s,flip:n,viewBox:p=T.viewBox,...d}=t;if(!l)return y(R,{});if(r==="svg"){if(l==="none")return y(M,{...d,icon:l,size:e});let m=Y(`${l}-icon`);return K[m]?y(M,{...d,icon:K[m],size:e,themeColor:a,rotate:s,flip:n,viewBox:p}):y(R,{})}return y(E,{...d,icon:l,size:e,themeColor:a,rotate:s,flip:n})};h.states=Z;h.options=ee;h.defaultOptions=T;import{Fragment as H,jsx as u,jsxs as le}from"react/jsx-runtime";var b="k-splitbar",te=[N.hover,N.focus],oe={},w={orientation:"horizontal",draggable:!0},g=t=>{let{hover:e,focus:a,orientation:l=w.orientation,draggable:r=w.draggable,collapsePrev:s,collapseNext:n,...p}=t;return le("div",{...p,className:c(t.className,b,A(b,{hover:e,focus:a}),{[`${b}-${l}`]:l,[`${b}-draggable-${l}`]:r,[`${b}-static-${l}`]:!r&&!s&&!n}),children:[s&&u(H,{children:u("div",{className:"k-collapse-prev",children:u(h,{icon:`caret-alt-${l==="horizontal"?"left":"up"}`,size:"xsmall"})})}),u("div",{className:"k-resize-handle"}),n&&u(H,{children:u("div",{className:"k-collapse-next",children:u(h,{icon:`caret-alt-${l==="horizontal"?"right":"down"}`,size:"xsmall"})})})]})};g.states=te;g.options=oe;g.className=b;g.defaultOptions=w;import{jsx as _}from"react/jsx-runtime";import{createElement as ie}from"react";var O="k-splitter",ne={},F={orientation:"horizontal"},$=t=>{let{orientation:e=F.orientation,children:a,...l}=t,r=[];return a&&Array.isArray(a)&&a.map((s,n)=>{if(s.type===x){let p=a[n+1],d=s.props,m=p?.props;r.push(ie(x,{...d,key:n}),p&&_(g,{draggable:d.resizable!==!1&&m.resizable!==!1,collapsePrev:d.collapsible,collapseNext:m.collapsible,orientation:e},`splitbar-${n}`))}else r.push(s)}),_("div",{...l,className:c(t.className,O,{[`${O}-${e}`]:e},"k-splitter-flex"),children:r})};$.options=ne;$.className=O;$.defaultOptions=F;var _e=$;export{$ as Splitter,_e as default};