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