@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 13.2 kB
JavaScript
var wt=Object.create;var X=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Gt=Object.getPrototypeOf,Dt=Object.prototype.hasOwnProperty;var $t=(e,t)=>{for(var r in t)X(e,r,{get:t[r],enumerable:!0})},ut=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Rt(t))!Dt.call(e,s)&&s!==r&&X(e,s,{get:()=>t[s],enumerable:!(a=It(t,s))||a.enumerable});return e};var Pt=(e,t,r)=>(r=e!=null?wt(Gt(e)):{},ut(t||!e||!e.__esModule?X(r,"default",{value:e,enumerable:!0}):r,e)),_t=e=>ut(X({},"__esModule",{value:!0}),e);var Oe={};$t(Oe,{OrgchartNormal:()=>Ae});module.exports=_t(Oe);var n=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?n(...t):typeof t=="object"?Object.keys(t).map((r,a)=>t[a]||t[r]&&r||null).filter(r=>r!==null).join(" "):t).filter(t=>!!t).join(" ");var v=(e,t)=>n({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.fillMode}-${t.themeColor}`]:t.fillMode&&t.themeColor},{[`${e}-${t.themeColor}`]:t.themeColor&&t.fillMode===void 0},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full"}),S=(e,t)=>n({"k-valid":t.valid,"k-invalid":t.invalid,"k-hover":t.hover,"k-focus":t.focus,"k-checked":t.checked,"k-active":t.active,"k-selected":t.selected,"k-disabled":t.disabled,"k-indeterminate":t.indeterminate&&!t.checked,"k-loading":t.loading,"k-empty":t.empty,"k-readonly":t.readonly});var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},f={small:"small",medium:"medium",large:"large",full:"full"},g={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},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"},d={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"},B={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var tt=require("react/jsx-runtime"),pt="k-orgchart",Ft=[],Vt={},j={width:"100%",height:"300px"},k=e=>{let{width:t=j.width,height:r=j.height,...a}=e;return(0,tt.jsx)("div",{...a,className:n(e.className,pt),children:(0,tt.jsx)("div",{className:"k-orgchart-container",style:{width:t,height:r},children:e.children})})};k.states=Ft;k.options=Vt;k.className=pt;k.defaultOptions=j;var ft=require("react/jsx-runtime"),Ut="k-card-callout",ht=e=>{let{callout:t,...r}=e;return(0,ft.jsx)("span",{...r,className:n(e.className,Ut,{[`k-callout-${B.calloutMap[t]||t}`]:t})})};var K=require("react/jsx-runtime"),q="k-card",Xt=[d.hover,d.focus,d.selected,d.disabled],qt={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Jt={},M=e=>{let{orientation:t,themeColor:r,callout:a,hover:s,focus:c,selected:l,disabled:m,...u}=e;return(0,K.jsxs)("div",{...u,className:n(e.className,q,v(q,{themeColor:r}),S(q,{hover:s,focus:c,disabled:m,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":a}),children:[a&&a!=="true"&&(0,K.jsx)(ht,{callout:a}),(0,K.jsx)(K.Fragment,{children:e.children})]})};M.states=Xt;M.options=qt;M.className=q;M.defaultOptions=Jt;var gt=require("react/jsx-runtime"),et="k-card-title",Yt=[d.hover,d.focus],L=e=>{let{hover:t,focus:r,...a}=e;return(0,gt.jsx)("div",{...a,className:n(e.className,et,S(et,{hover:t,focus:r})),children:e.children})};L.states=Yt;L.className=et;var bt=require("react/jsx-runtime"),Qt="k-card-subtitle",D=e=>{let{...t}=e;return(0,bt.jsx)("div",{...t,className:n(e.className,Qt),children:e.children})};var vt=require("react/jsx-runtime");var $=require("react/jsx-runtime"),ot="k-icon k-font-icon",Wt=[],Zt={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]},jt={},P=e=>{let{size:t,themeColor:r,icon:a,rotate:s,flip:c,...l}=e;return a?(0,$.jsx)("span",{...l,className:n(e.className,ot,v(ot,{size:t}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,$.jsx)($.Fragment,{})};P.states=Wt;P.options=Zt;P.className=ot;P.defaultOptions=jt;var xt=P;var z=require("react/jsx-runtime"),rt="k-icon k-svg-icon",te=[],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]},Ct={viewBox:"0 0 24 24"},_=e=>{let{size:t,themeColor:r,rotate:a,flip:s,viewBox:c=Ct.viewBox,icon:l,...m}=e;if(!l)return(0,z.jsx)(z.Fragment,{});l==="none"&&{...m,className:n(e.className,rt,"k-none")};let u=typeof l=="object"&&l.name&&l.name;return(0,z.jsx)("span",{...m,className:n(e.className,rt,v("k-icon",{size:t}),{[`k-svg-i-${u}`]:u,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),children:(0,z.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:c,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:e.children})})};_.states=te;_.options=ee;_.className=rt;_.defaultOptions=Ct;var at=_;var Nt=Pt(require("@progress/kendo-svg-icons")),T=require("react/jsx-runtime"),oe=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),re=[],ae={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]},nt={viewBox:"0 0 24 24",type:"svg"},I=e=>{let{size:t,themeColor:r,icon:a,type:s=nt.type,rotate:c,flip:l,viewBox:m=nt.viewBox,...u}=e;if(!a)return(0,T.jsx)(T.Fragment,{});if(s==="svg"){if(a==="none")return(0,T.jsx)(at,{...u,icon:a,size:t});let y=oe(`${a}-icon`);return Nt[y]?(0,T.jsx)(at,{...u,icon:Nt[y],size:t,themeColor:r,rotate:c,flip:l,viewBox:m}):(0,T.jsx)(T.Fragment,{})}return(0,T.jsx)(xt,{...u,icon:a,size:t,themeColor:r,rotate:c,flip:l})};I.states=re;I.options=ae;I.defaultOptions=nt;var b=require("react/jsx-runtime"),J="k-button",ne=[d.hover,d.focus,d.active,d.selected,d.disabled],ie={size:[i.small,i.medium,i.large],rounded:[f.small,f.medium,f.large,f.full],fillMode:[g.solid,g.flat,g.outline,g.clear,g.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},E={size:i.medium,rounded:f.medium,fillMode:g.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=E.size,rounded:r=E.rounded,fillMode:a=E.fillMode,themeColor:s=E.themeColor,showArrow:c=E.showArrow,arrowIconName:l=E.arrowIconName,hover:m,focus:u,active:y,selected:V,disabled:W,icon:Z,text:U,iconClassName:Lt,...zt}=e,Et=Z!==void 0,Ht=e.children!==void 0;return(0,b.jsxs)("button",{...zt,className:n(e.className,J,v(J,{size:t,rounded:r,fillMode:a,themeColor:s}),S(J,{hover:m,focus:u,active:y,disabled:W,selected:V}),{"k-icon-button":!U&&!Ht&&Et}),children:[Z&&(0,b.jsx)(I,{className:n(Lt,"k-button-icon"),icon:Z}),U?(0,b.jsxs)(b.Fragment,{children:[U&&(0,b.jsx)("span",{className:"k-button-text",children:U}),e.children]}):e.children&&(0,b.jsx)("span",{className:"k-button-text",children:e.children}),c&&(0,b.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,b.jsx)(I,{icon:l})})]})};p.states=ne;p.options=ie;p.className=J;p.defaultOptions=E;var se=require("react/jsx-runtime");var le=require("react/jsx-runtime");var ce=require("react/jsx-runtime");var it=require("react/jsx-runtime");var de=require("react/jsx-runtime");var x=require("react/jsx-runtime"),me="k-card-body",Y=e=>{let{title:t,subtitle:r,details:a,...s}=e;return(0,x.jsxs)("div",{...s,className:n(e.className,me),children:[t&&(0,x.jsx)(L,{children:t}),r&&(0,x.jsx)(D,{children:r}),(0,x.jsx)(x.Fragment,{children:e.children}),a&&(0,x.jsx)("span",{className:"k-card-header-actions",children:(0,x.jsx)(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var ue=require("react/jsx-runtime");var yt=require("react/jsx-runtime"),Q="k-actions",pe=[],he={},st={alignment:"start",orientation:"horizontal"},R=e=>{let{alignment:t=st.alignment,orientation:r=st.orientation,...a}=e;return(0,yt.jsx)("div",{...a,className:n(Q,{[`${Q}-${t}`]:t,[`${Q}-${r}`]:r},e.className),children:e.children})};R.states=pe;R.options=he;R.className=Q;R.defaultOptions=st;var lt=require("react/jsx-runtime");var ct=require("react/jsx-runtime");var dt=require("react/jsx-runtime"),F="k-avatar";var fe=[d.hover,d.focus,d.active,d.selected,d.disabled],ge={size:[i.small,i.medium,i.large],rounded:[f.small,f.medium,f.large,f.full],fillMode:[g.solid,g.flat,g.outline],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},H={type:"text",size:i.medium,rounded:f.full,fillMode:g.solid,themeColor:o.primary,border:!1},G=e=>{let{size:t=H.size,rounded:r=H.rounded,fillMode:a=H.fillMode,themeColor:s=H.themeColor,type:c=H.type,border:l=H.border,...m}=e;return(0,dt.jsx)("div",{...m,className:n(e.className,F,v(F,{size:t,rounded:r,fillMode:a,themeColor:s}),{[`${F}-bordered`]:l}),children:(0,dt.jsx)("span",{className:`${F}-${c}`,children:e.children})})};G.states=fe;G.options=ge;G.className=F;G.defaultOptions=H;var be=require("react/jsx-runtime");var ve=require("react/jsx-runtime");var xe=require("react/jsx-runtime");var h=require("react/jsx-runtime"),Ce="k-orgchart-node",Tt={buttonIcon:"plus",details:!0},C=e=>{let{title:t,subtitle:r,details:a=Tt.details,color:s,lineBottom:c,lineTop:l,button:m,buttonIcon:u=Tt.buttonIcon,avatar:y,avatarType:V,...W}=e;return(0,h.jsxs)("div",{...W,className:n(e.className,Ce,"k-vstack","k-align-items-center"),children:[l&&(0,h.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,h.jsx)(M,{className:"k-orgchart-card",children:(0,h.jsxs)(Y,{className:"k-hstack",details:a,style:{borderTopColor:s},children:[(0,h.jsx)(G,{type:V,themeColor:"secondary",children:V==="image"?(0,h.jsx)("img",{src:y}):y}),(0,h.jsxs)("div",{className:"k-card-title-wrap k-vstack",children:[(0,h.jsx)(L,{className:"k-text-ellipsis",children:t}),(0,h.jsx)("span",{className:"k-spacer"}),(0,h.jsx)(D,{className:"k-text-ellipsis",children:r})]}),(0,h.jsx)("span",{className:"k-spacer"})]})}),c&&(0,h.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),m&&(0,h.jsx)(p,{className:"k-orgchart-button",icon:u})]})};var A=require("react/jsx-runtime"),At="k-orgchart-group",Ne=[],ye={},Ot={orientation:"horizontal"},O=e=>{let{children:t,orientation:r=Ot.orientation,justifyContent:a,...s}=e,c=[],l=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===C?c.push(m):l.push(m)}):t.type===C?c.push(t):l.push(t)),(0,A.jsxs)("div",{...s,className:n(At,"k-pos-absolute",{[`k-${B.orientationMap[r]||r}`]:r,[`k-justify-content-${a}`]:a}),style:{width:"100%"},children:[c.length>0&&(0,A.jsx)("div",{className:n("k-orgchart-node-container","k-justify-content-around",{[`k-${B.orientationMap[r]||r}`]:r}),children:(0,A.jsx)(A.Fragment,{children:c})}),(0,A.jsx)(A.Fragment,{children:l})]})};O.states=Ne;O.options=ye;O.className=At;O.defaultOptions=Ot;var N=require("react/jsx-runtime"),ke="k-orgchart-node-group",Te=[d.focus],St={orientation:"horizontal",buttonIcon:"plus"},mt=e=>{let{title:t,subtitle:r,lineBottom:a,lineTop:s,button:c,buttonIcon:l=St.buttonIcon,focus:m,orientation:u=St.orientation,...y}=e;return(0,N.jsxs)("div",{...y,className:n(e.className,ke,"k-vstack","k-align-items-center"),children:[s&&(0,N.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,N.jsxs)("div",{className:n("k-orgchart-node-group-container","k-vstack",S("k-orgchart-node-group-container",{focus:m})),children:[t&&(0,N.jsx)("div",{className:"k-orgchart-node-group-title",children:t}),r&&(0,N.jsx)("div",{className:"k-orgchart-node-group-subtitle",children:r}),(0,N.jsx)("div",{className:n("k-orgchart-node-container",{[`k-${B.orientationMap[u]||u}`]:u}),children:e.children})]}),a&&(0,N.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),c&&(0,N.jsx)(p,{className:"k-orgchart-button",icon:l})]})};mt.states=Te;var Mt=require("react/jsx-runtime");var Bt=require("react/jsx-runtime");var Kt=require("react/jsx-runtime");var w=require("react/jsx-runtime"),Ae=({details:e,justifyContent:t,...r})=>(0,w.jsx)(k,{children:(0,w.jsxs)(O,{justifyContent:t,children:[(0,w.jsx)(C,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#0275d8",lineBottom:!0,button:!0}),(0,w.jsx)(C,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#0275d8",lineBottom:!0,button:!0}),(0,w.jsx)(C,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#0275d8",lineBottom:!0,button:!0})]}),...r});