@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.53 kB
JavaScript
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((a,r)=>e[r]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(t,e)=>l({[`${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"}),N=(t,e)=>l({"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 s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},C={small:"small",medium:"medium",large:"large",full:"full"},k={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"},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"};import{Fragment as ne,jsx as D}from"react/jsx-runtime";var R="k-icon k-font-icon",te=[],se={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},re={},B=t=>{let{size:e,themeColor:a,icon:r,rotate:i,flip:c,...n}=t;return r?D("span",{...n,className:l(t.className,R,y(R,{size:e}),{[`k-i-${r}`]:r,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):D(ne,{})};B.states=te;B.options=se;B.className=R;B.defaultOptions=re;var q=B;import{Fragment as ie,jsx as I}from"react/jsx-runtime";var H="k-icon k-svg-icon",ae=[],le={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},J={viewBox:"0 0 24 24"},M=t=>{let{size:e,themeColor:a,rotate:r,flip:i,viewBox:c=J.viewBox,icon:n,...h}=t;if(!n)return I(ie,{});n==="none"&&{...h,className:l(t.className,H,"k-none")};let d=typeof n=="object"&&n.name&&n.name;return I("span",{...h,className:l(t.className,H,y("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:I("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof n=="object"?n.viewBox:c,dangerouslySetInnerHTML:typeof n=="object"?{__html:n.content}:void 0,children:n?void 0:t.children})})};M.states=ae;M.options=le;M.className=H;M.defaultOptions=J;var F=M;import*as Q from"@progress/kendo-svg-icons";import{Fragment as W,jsx as w}from"react/jsx-runtime";var ce=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),de=[],me={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},_={viewBox:"0 0 24 24",type:"svg"},x=t=>{let{size:e,themeColor:a,icon:r,type:i=_.type,rotate:c,flip:n,viewBox:h=_.viewBox,...d}=t;if(!r)return w(W,{});if(i==="svg"){if(r==="none")return w(F,{...d,icon:r,size:e});let p=ce(`${r}-icon`);return Q[p]?w(F,{...d,icon:Q[p],size:e,themeColor:a,rotate:c,flip:n,viewBox:h}):w(W,{})}return w(q,{...d,icon:r,size:e,themeColor:a,rotate:c,flip:n})};x.states=de;x.options=me;x.defaultOptions=_;import{Fragment as fe,jsx as z,jsxs as X}from"react/jsx-runtime";var A="k-button",ue=[m.hover,m.focus,m.active,m.selected,m.disabled],pe={size:[s.small,s.medium,s.large],rounded:[C.small,C.medium,C.large,C.full],fillMode:[k.solid,k.flat,k.outline,k.clear,k.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},v={size:s.medium,rounded:C.medium,fillMode:k.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},f=t=>{let{size:e=v.size,rounded:a=v.rounded,fillMode:r=v.fillMode,themeColor:i=v.themeColor,showArrow:c=v.showArrow,arrowIconName:n=v.arrowIconName,hover:h,focus:d,active:p,selected:L,disabled:K,icon:E,text:P,iconClassName:Z,...j}=t,ee=E!==void 0,oe=t.children!==void 0;return X("button",{...j,className:l(t.className,A,y(A,{size:e,rounded:a,fillMode:r,themeColor:i}),N(A,{hover:h,focus:d,active:p,disabled:K,selected:L}),{"k-icon-button":!P&&!oe&&ee}),children:[E&&z(x,{className:l(Z,"k-button-icon"),icon:E}),P?X(fe,{children:[P&&z("span",{className:"k-button-text",children:P}),t.children]}):t.children&&z("span",{className:"k-button-text",children:t.children}),c&&z("span",{className:"k-menu-button-arrow k-button-arrow",children:z(x,{icon:n})})]})};f.states=ue;f.options=pe;f.className=A;f.defaultOptions=v;import{jsx as Ye}from"react/jsx-runtime";import{jsx as oo}from"react/jsx-runtime";import{jsx as no}from"react/jsx-runtime";import{jsx as U,jsxs as G}from"react/jsx-runtime";var u="k-progressbar",he=[m.disabled,m.indeterminate],ge={},b={indeterminate:!1,label:!0,labelPosition:"start",orientation:"horizontal",reverse:!1,value:"0"},S=t=>{let{disabled:e,height:a,indeterminate:r=b.indeterminate,label:i=b.label,labelPosition:c=b.labelPosition,orientation:n=b.orientation,reverse:h=b.reverse,value:d=b.value,width:p,style:L,...K}=t;return G("div",{...K,className:l(t.className,u,N(u,{disabled:e}),{[`${u}-${n}`]:n,[`${u}-indeterminate`]:r,[`${u}-reverse`]:h}),style:{...L,"--kendo-progressbar-value":d,[n==="horizontal"?"height":"width"]:n==="horizontal"?a:p},children:[U("span",{className:l("k-progress-status-wrap",{[`k-progress-${c}`]:c&&!r}),children:i&&G("span",{className:"k-progress-status",children:[d,"%"]})}),!r&&U("div",{className:"k-progressbar-value k-selected",children:U("span",{className:l("k-progress-status-wrap",{[`k-progress-${c}`]:c}),children:i&&G("span",{className:"k-progress-status",children:[t.value,"%"]})})})]})};S.states=he;S.options=ge;S.className=u;S.defaultOptions=b;import{jsx as V}from"react/jsx-runtime";var Y="k-chunk-progressbar",xe=(t,e)=>e<=t-1,ke=[m.disabled,m.indeterminate],ve={},$={chunkCount:5,orientation:"horizontal",progress:0},O=t=>{let{disabled:e,chunkCount:a=$.chunkCount,indeterminate:r,orientation:i=$.orientation,progress:c=$.progress,reverse:n,...h}=t;return V("div",{...h,className:l(t.className,u,Y,N(u,{disabled:e}),{[`${u}-${i}`]:i,[`${u}-indeterminate`]:r,[`${u}-reverse`]:n}),children:V("ul",{className:"k-progressbar-chunks k-reset",children:[...Array(a)].map((d,p)=>V("li",{className:l("k-progressbar-chunk",{"k-first":p===0,"k-last":p===[...Array(a)].length-1,"k-selected":xe(c,p)})},p))})})};O.states=ke;O.options=ve;O.className=Y;O.defaultOptions=$;import{jsx as Co}from"react/jsx-runtime";import{jsx as zo}from"react/jsx-runtime";import{Fragment as ye,jsx as g,jsxs as T}from"react/jsx-runtime";var be="k-file",Ho=t=>{let{status:e,progress:a,validationMsg:r,fileSummary:i,...c}=t;return g("li",{...c,className:l(t.className,be,{[`k-file-${e}`]:e}),children:T("div",{className:"k-file-multiple",children:[g(S,{className:l({"k-hidden":e!=="progress"}),value:a,label:!1}),g("span",{className:"k-file-icon-wrapper",children:g(x,{className:"k-file-icon",icon:"copy",size:"xxlarge"})}),T("div",{className:"k-multiple-files-wrapper",children:[t.children,i&&g("span",{className:l("k-file-summary",{"k-hidden":e!=="progress"}),children:i}),r&&g("span",{className:"k-file-validation-message",children:r})]}),g("div",{className:"k-upload-actions",children:e==="progress"?T(ye,{children:[T("span",{className:"k-upload-pct",children:[a,"%"]}),g(f,{icon:"pause-sm",fillMode:"flat",className:"k-upload-action"}),g(f,{icon:"cancel",fillMode:"flat",className:"k-upload-action"})]}):g(f,{icon:"x",fillMode:"flat",className:"k-upload-action"})})]})})};export{be as UPLOADFILEMULTIPLE_CLASSNAME,Ho as UploadFileMultiple};