@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.38 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 P=(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"}),L=(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 X}from"react/jsx-runtime";var u="k-pane",G=[],J={},$={resizable:!0,flex:!1},d=t=>{let{scrollable:e,flexBasis:a,flex:l=$.flex,collapsible:r,resizable:s=$.resizable,pinned:n,unpinned:m,tabbed:p,...x}=t;return X("div",{...x,style:{flexBasis:a,...t.style},className:c(t.className,u,{[`${u}-static`]:a,[`${u}-flex`]:l,"k-scrollable":e,[`${u}-pinned`]:n,[`${u}-unpinned`]:m,[`${u}-tabbed`]:p}),children:t.children})};d.states=G;d.options=J;d.className=u;d.defaultOptions=$;import{Fragment as Q,jsx as B}from"react/jsx-runtime";var I="k-icon k-font-icon",D=[],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]},U={},y=t=>{let{size:e,themeColor:a,icon:l,rotate:r,flip:s,...n}=t;return l?B("span",{...n,className:c(t.className,I,P(I,{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"})}):B(Q,{})};y.states=D;y.options=q;y.className=I;y.defaultOptions=U;var E=y;import{Fragment as Z,jsx as C}from"react/jsx-runtime";var M="k-icon k-svg-icon",W=[],Y={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]},K={viewBox:"0 0 24 24"},k=t=>{let{size:e,themeColor:a,rotate:l,flip:r,viewBox:s=K.viewBox,icon:n,...m}=t;if(!n)return C(Z,{});n==="none"&&{...m,className:c(t.className,M,"k-none")};let p=typeof n=="object"&&n.name&&n.name;return C("span",{...m,className:c(t.className,M,P("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${a}`]:a,[`k-rotate-${l}`]:l,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:C("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})})};k.states=W;k.options=Y;k.className=M;k.defaultOptions=K;var T=k;import*as R from"@progress/kendo-svg-icons";import{Fragment as H,jsx as z}from"react/jsx-runtime";var j=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ee=[],te={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]},w={viewBox:"0 0 24 24",type:"svg"},b=t=>{let{size:e,themeColor:a,icon:l,type:r=w.type,rotate:s,flip:n,viewBox:m=w.viewBox,...p}=t;if(!l)return z(H,{});if(r==="svg"){if(l==="none")return z(T,{...p,icon:l,size:e});let x=j(`${l}-icon`);return R[x]?z(T,{...p,icon:R[x],size:e,themeColor:a,rotate:s,flip:n,viewBox:m}):z(H,{})}return z(E,{...p,icon:l,size:e,themeColor:a,rotate:s,flip:n})};b.states=ee;b.options=te;b.defaultOptions=w;import{Fragment as _,jsx as h,jsxs as ne}from"react/jsx-runtime";var g="k-splitbar",oe=[N.hover,N.focus],le={},O={orientation:"horizontal",draggable:!0},S=t=>{let{hover:e,focus:a,orientation:l=O.orientation,draggable:r=O.draggable,collapsePrev:s,collapseNext:n,...m}=t;return ne("div",{...m,className:c(t.className,g,L(g,{hover:e,focus:a}),{[`${g}-${l}`]:l,[`${g}-draggable-${l}`]:r,[`${g}-static-${l}`]:!r&&!s&&!n}),children:[s&&h(_,{children:h("div",{className:"k-collapse-prev",children:h(b,{icon:`caret-alt-${l==="horizontal"?"left":"up"}`,size:"xsmall"})})}),h("div",{className:"k-resize-handle"}),n&&h(_,{children:h("div",{className:"k-collapse-next",children:h(b,{icon:`caret-alt-${l==="horizontal"?"right":"down"}`,size:"xsmall"})})})]})};S.states=oe;S.options=le;S.className=g;S.defaultOptions=O;import{jsx as F}from"react/jsx-runtime";import{createElement as ae}from"react";var A="k-splitter",ie={},V={orientation:"horizontal"},v=t=>{let{orientation:e=V.orientation,children:a,...l}=t,r=[];return a&&Array.isArray(a)&&a.map((s,n)=>{if(s.type===d){let m=a[n+1],p=s.props,x=m?.props;r.push(ae(d,{...p,key:n}),m&&F(S,{draggable:p.resizable!==!1&&x.resizable!==!1,collapsePrev:p.collapsible,collapseNext:x.collapsible,orientation:e},`splitbar-${n}`))}else r.push(s)}),F("div",{...l,className:c(t.className,A,{[`${A}-${e}`]:e},"k-splitter-flex"),children:r})};v.options=ie;v.className=A;v.defaultOptions=V;import{jsx as qe,jsxs as Ue}from"react/jsx-runtime";import{jsx as f,jsxs as re}from"react/jsx-runtime";var lt=t=>f(v,{children:[f(d,{flexBasis:"20%",collapsible:!0,children:f("p",{children:"Collapsible pane - 20%"})},"pane-1"),re(d,{children:[f("p",{children:"Content"}),f("p",{children:"Content"}),f("p",{children:"Content"})]},"pane-2"),f(d,{flexBasis:"30%",collapsible:!0,children:f("p",{children:"Collapsible pane - 30%"})},"pane-3")],...t});export{lt as SplitterNormal};