@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 7.64 kB
JavaScript
var D=Object.create;var $=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var Y=(t,e)=>{for(var l in e)$(t,l,{get:e[l],enumerable:!0})},R=(t,e,l,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of U(e))!W.call(t,r)&&r!==l&&$(t,r,{get:()=>e[r],enumerable:!(n=q(e,r))||n.enumerable});return t};var Z=(t,e,l)=>(l=t!=null?D(Q(t)):{},R(e||!t||!t.__esModule?$(l,"default",{value:t,enumerable:!0}):l,t)),j=t=>R($({},"__esModule",{value:!0}),t);var ue={};Y(ue,{Splitter:()=>b,SplitterNormal:()=>fe,SplitterPane:()=>c,SplitterSplitbar:()=>y,SplitterVertical:()=>xe});module.exports=j(ue);var p=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?p(...e):typeof e=="object"?Object.keys(e).map((l,n)=>e[n]||e[l]&&l||null).filter(l=>l!==null).join(" "):e).filter(e=>!!e).join(" ");var I=(t,e)=>p({[`${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"}),H=(t,e)=>p({"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 a={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"},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"};var _=require("react/jsx-runtime"),S="k-pane",ee=[],te={},T={resizable:!0,flex:!1},c=t=>{let{scrollable:e,flexBasis:l,flex:n=T.flex,collapsible:r,resizable:s=T.resizable,pinned:i,unpinned:d,tabbed:f,...g}=t;return(0,_.jsx)("div",{...g,style:{flexBasis:l,...t.style},className:p(t.className,S,{[`${S}-static`]:l,[`${S}-flex`]:n,"k-scrollable":e,[`${S}-pinned`]:i,[`${S}-unpinned`]:d,[`${S}-tabbed`]:f}),children:t.children})};c.states=ee;c.options=te;c.className=S;c.defaultOptions=T;var P=require("react/jsx-runtime"),w="k-icon k-font-icon",oe=[],le={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ne={},C=t=>{let{size:e,themeColor:l,icon:n,rotate:r,flip:s,...i}=t;return n?(0,P.jsx)("span",{...i,className:p(t.className,w,I(w,{size:e}),{[`k-i-${n}`]:n,[`k-color-${l}`]:l,[`k-rotate-${r}`]:r,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"})}):(0,P.jsx)(P.Fragment,{})};C.states=oe;C.options=le;C.className=w;C.defaultOptions=ne;var F=C;var v=require("react/jsx-runtime"),O="k-icon k-svg-icon",ie=[],ae={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.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"},N=t=>{let{size:e,themeColor:l,rotate:n,flip:r,viewBox:s=V.viewBox,icon:i,...d}=t;if(!i)return(0,v.jsx)(v.Fragment,{});i==="none"&&{...d,className:p(t.className,O,"k-none")};let f=typeof i=="object"&&i.name&&i.name;return(0,v.jsx)("span",{...d,className:p(t.className,O,I("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${l}`]:l,[`k-rotate-${n}`]:n,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:(0,v.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:s,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};N.states=ie;N.options=ae;N.className=O;N.defaultOptions=V;var A=N;var G=Z(require("@progress/kendo-svg-icons")),h=require("react/jsx-runtime"),re=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),se=[],ce={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.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"},k=t=>{let{size:e,themeColor:l,icon:n,type:r=L.type,rotate:s,flip:i,viewBox:d=L.viewBox,...f}=t;if(!n)return(0,h.jsx)(h.Fragment,{});if(r==="svg"){if(n==="none")return(0,h.jsx)(A,{...f,icon:n,size:e});let g=re(`${n}-icon`);return G[g]?(0,h.jsx)(A,{...f,icon:G[g],size:e,themeColor:l,rotate:s,flip:i,viewBox:d}):(0,h.jsx)(h.Fragment,{})}return(0,h.jsx)(F,{...f,icon:n,size:e,themeColor:l,rotate:s,flip:i})};k.states=se;k.options=ce;k.defaultOptions=L;var m=require("react/jsx-runtime"),z="k-splitbar",pe=[M.hover,M.focus],de={},B={orientation:"horizontal",draggable:!0},y=t=>{let{hover:e,focus:l,orientation:n=B.orientation,draggable:r=B.draggable,collapsePrev:s,collapseNext:i,...d}=t;return(0,m.jsxs)("div",{...d,className:p(t.className,z,H(z,{hover:e,focus:l}),{[`${z}-${n}`]:n,[`${z}-draggable-${n}`]:r,[`${z}-static-${n}`]:!r&&!s&&!i}),children:[s&&(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"k-collapse-prev",children:(0,m.jsx)(k,{icon:`caret-alt-${n==="horizontal"?"left":"up"}`,size:"xsmall"})})}),(0,m.jsx)("div",{className:"k-resize-handle"}),i&&(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{className:"k-collapse-next",children:(0,m.jsx)(k,{icon:`caret-alt-${n==="horizontal"?"right":"down"}`,size:"xsmall"})})})]})};y.states=pe;y.options=de;y.className=z;y.defaultOptions=B;var K=require("react/jsx-runtime"),X=require("react"),E="k-splitter",me={},J={orientation:"horizontal"},b=t=>{let{orientation:e=J.orientation,children:l,...n}=t,r=[];return l&&Array.isArray(l)&&l.map((s,i)=>{if(s.type===c){let d=l[i+1],f=s.props,g=d==null?void 0:d.props;r.push((0,X.createElement)(c,{...f,key:i}),d&&(0,K.jsx)(y,{draggable:f.resizable!==!1&&g.resizable!==!1,collapsePrev:f.collapsible,collapseNext:g.collapsible,orientation:e},`splitbar-${i}`))}else r.push(s)}),(0,K.jsx)("div",{...n,className:p(t.className,E,{[`${E}-${e}`]:e},"k-splitter-flex"),children:r})};b.options=me;b.className=E;b.defaultOptions=J;var x=require("react/jsx-runtime"),fe=t=>(0,x.jsx)(b,{children:[(0,x.jsx)(c,{flexBasis:"20%",collapsible:!0,children:(0,x.jsx)("p",{children:"Collapsible pane - 20%"})},"pane-1"),(0,x.jsxs)(c,{children:[(0,x.jsx)("p",{children:"Content"}),(0,x.jsx)("p",{children:"Content"}),(0,x.jsx)("p",{children:"Content"})]},"pane-2"),(0,x.jsx)(c,{flexBasis:"30%",collapsible:!0,children:(0,x.jsx)("p",{children:"Collapsible pane - 30%"})},"pane-3")],...t});var u=require("react/jsx-runtime"),xe=t=>(0,u.jsx)(b,{children:[(0,u.jsx)(c,{flexBasis:"20%",collapsible:!0,children:(0,u.jsx)("p",{children:"Collapsible pane - 20%"})},"pane-1"),(0,u.jsxs)(c,{children:[(0,u.jsx)("p",{children:"Content"}),(0,u.jsx)("p",{children:"Content"}),(0,u.jsx)("p",{children:"Content"})]},"pane-2"),(0,u.jsx)(c,{flexBasis:"30%",collapsible:!0,children:(0,u.jsx)("p",{children:"Collapsible pane - 30%"})},"pane-3")],orientation:"vertical",...t});