@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12 kB
JavaScript
var Re=Object.create;var Q=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var _e=(t,e)=>{for(var o in e)Q(t,o,{get:e[o],enumerable:!0})},he=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ke(e))!Fe.call(t,r)&&r!==o&&Q(t,r,{get:()=>e[r],enumerable:!(i=Ve(e,r))||i.enumerable});return t};var qe=(t,e,o)=>(o=t!=null?Re($e(t)):{},he(e||!t||!t.__esModule?Q(o,"default",{value:t,enumerable:!0}):o,t)),Ge=t=>he(Q({},"__esModule",{value:!0}),t);var Ct={};_e(Ct,{TextboxSuffix:()=>zt});module.exports=Ge(Ct);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((o,i)=>e[i]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var m=(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"}),O=(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 a={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},u={small:"small",medium:"medium",large:"large",full:"full"},p={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},n={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},s={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 ge=require("react/jsx-runtime"),W="k-input",Ue=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Xe={size:[a.small,a.medium,a.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[p.solid,p.flat,p.outline]},Y={size:a.medium,rounded:a.medium,fillMode:p.solid},y=t=>{let{hover:e,focus:o,disabled:i,invalid:r,valid:c,loading:d,readonly:h,size:x=Y.size,rounded:b=Y.rounded,fillMode:N=Y.fillMode,...S}=t;return(0,ge.jsx)("span",{...S,className:l(t.className,W,m(W,{size:x,rounded:b,fillMode:N}),O(W,{hover:e,focus:o,disabled:i,invalid:r,valid:c,loading:d,readonly:h}))})};y.states=Ue;y.options=Xe;y.className=W;y.defaultOptions=Y;var Ie=require("react/jsx-runtime"),Z="k-picker",Je=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],De={size:[a.small,a.medium,a.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[p.solid,p.flat,p.outline]},j={size:a.medium,rounded:u.medium,fillMode:p.solid},ee=t=>{let{hover:e,focus:o,disabled:i,invalid:r,valid:c,loading:d,readonly:h,size:x=j.size,rounded:b=j.rounded,fillMode:N=j.fillMode,...S}=t;return(0,Ie.jsx)("span",{...S,className:l(t.className,Z,m(Z,{size:x,rounded:b,fillMode:N}),O(Z,{hover:e,focus:o,disabled:i,invalid:r,valid:c,loading:d,readonly:h})),children:t.children})};ee.states=Je;ee.options=De;ee.className=Z;ee.defaultOptions=j;var H=require("react/jsx-runtime"),ae="k-icon k-font-icon",Qe=[],We={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},Ye={},P=t=>{let{size:e,themeColor:o,icon:i,rotate:r,flip:c,...d}=t;return i?(0,H.jsx)("span",{...d,className:l(t.className,ae,m(ae,{size:e}),{[`k-i-${i}`]:i,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,H.jsx)(H.Fragment,{})};P.states=Qe;P.options=We;P.className=ae;P.defaultOptions=Ye;var be=P;var M=require("react/jsx-runtime"),le="k-icon k-svg-icon",Ze=[],je={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},ye={viewBox:"0 0 24 24"},E=t=>{let{size:e,themeColor:o,rotate:i,flip:r,viewBox:c=ye.viewBox,icon:d,...h}=t;if(!d)return(0,M.jsx)(M.Fragment,{});d==="none"&&{...h,className:l(t.className,le,"k-none")};let x=typeof d=="object"&&d.name&&d.name;return(0,M.jsx)("span",{...h,className:l(t.className,le,m("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:(0,M.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof d=="object"?d.viewBox:c,dangerouslySetInnerHTML:typeof d=="object"?{__html:d.content}:void 0,children:d?void 0:t.children})})};E.states=Ze;E.options=je;E.className=le;E.defaultOptions=ye;var ie=E;var ve=qe(require("@progress/kendo-svg-icons")),v=require("react/jsx-runtime"),et=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),tt=[],ot={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},re={viewBox:"0 0 24 24",type:"svg"},g=t=>{let{size:e,themeColor:o,icon:i,type:r=re.type,rotate:c,flip:d,viewBox:h=re.viewBox,...x}=t;if(!i)return(0,v.jsx)(v.Fragment,{});if(r==="svg"){if(i==="none")return(0,v.jsx)(ie,{...x,icon:i,size:e});let b=et(`${i}-icon`);return ve[b]?(0,v.jsx)(ie,{...x,icon:ve[b],size:e,themeColor:o,rotate:c,flip:d,viewBox:h}):(0,v.jsx)(v.Fragment,{})}return(0,v.jsx)(be,{...x,icon:i,size:e,themeColor:o,rotate:c,flip:d})};g.states=tt;g.options=ot;g.defaultOptions=re;var L=require("react/jsx-runtime"),Ne="k-clear-value",nt=[s.disabled,s.loading,s.readonly],st={},R=t=>{let{disabled:e,loading:o,readonly:i,value:r}=t;return e||i||o||!r?(0,L.jsx)(L.Fragment,{}):(0,L.jsx)("span",{className:l(t.className,Ne),children:(0,L.jsx)(g,{icon:"x"})})};R.states=nt;R.options=st;R.className=Ne;var ke=require("react/jsx-runtime"),de="k-input-inner",at=[],lt={},te={type:"text",autocomplete:"off",value:"",placeholder:""},V=t=>{let{value:e=te.value,type:o=te.type,placeholder:i=te.placeholder,autocomplete:r=te.autocomplete,...c}=t;return(0,ke.jsx)("input",{...c,type:o,className:l(t.className,de,m(de,t)),placeholder:i,autoComplete:r,defaultValue:e})};V.states=at;V.options=lt;V.className=de;var K=require("react/jsx-runtime"),ce="k-input-inner",it=[],rt={},ue=t=>{let{value:e,placeholder:o,showValue:i,valueIcon:r,valueIconName:c,...d}=t;return(0,K.jsxs)("span",{...d,className:l(t.className,ce,m(ce,t)),children:[r,!r&&c&&(0,K.jsx)(g,{className:"k-input-value-icon",icon:c}),i&&!e&&o,i&&e&&(0,K.jsx)("span",{className:"k-input-value-text",children:e})]})};ue.states=it;ue.options=rt;ue.className=ce;var Me=require("react/jsx-runtime"),pe="k-input-inner",dt=[],ct={},Se={value:"",placeholder:""},me=t=>{let{value:e=Se.value,placeholder:o=Se.placeholder,rows:i,...r}=t;return(0,Me.jsx)("textarea",{...r,className:l(t.className,pe,m(pe,t)),placeholder:o,rows:i,defaultValue:e})};me.states=dt;me.options=ct;me.className=pe;var $=require("react/jsx-runtime"),Te="k-input-loading-icon",ut=[s.disabled,s.loading],oe=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,$.jsx)($.Fragment,{}):(0,$.jsx)("span",{className:l(t.className,Te,"k-icon k-i-loading")})};oe.states=ut;oe.className=Te;var F=require("react/jsx-runtime"),ze="k-input-validation-icon",pt=[s.valid,s.invalid,s.disabled,s.loading],mt={},_=t=>{let{valid:e,invalid:o,disabled:i,loading:r}=t,c=o?"warning-circle":"check-circle";return i||r||!!!(e||o)?(0,F.jsx)(F.Fragment,{}):(0,F.jsx)(g,{className:l(ze),icon:c})};_.states=pt;_.options=mt;_.className=ze;var q=require("react/jsx-runtime"),ft="k-input-prefix",xt={direction:"horizontal"},Ce=t=>{let{direction:e=xt.direction,...o}=t;return t.children?(0,q.jsx)("span",{...o,className:l(ft,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):(0,q.jsx)(q.Fragment,{})};var G=require("react/jsx-runtime"),ht="k-input-suffix",gt={direction:"horizontal"},we=t=>{let{direction:e=gt.direction,...o}=t;return t.children?(0,G.jsx)("span",{...o,className:l(ht,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,G.jsx)(G.Fragment,{})};var It=require("react/jsx-runtime");var bt=require("react/jsx-runtime");var Le=require("react/jsx-runtime"),Oe="k-input-separator",yt={direction:"vertical"},fe=t=>{let{direction:e=yt.direction,...o}=t;return(0,Le.jsx)("span",{...o,className:l(Oe,t.className,{[`${Oe}-${e}`]:e})})};var f=require("react/jsx-runtime"),Ae="k-textbox",vt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Nt={size:[a.small,a.medium,a.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[p.solid,p.flat,p.outline]},T={showClearButton:!0,showValidationIcon:!0,size:y.defaultOptions.size,rounded:y.defaultOptions.rounded,fillMode:y.defaultOptions.fillMode,separators:!0},U=t=>{let{size:e=T.size,rounded:o=T.rounded,fillMode:i=T.fillMode,separators:r=T.separators,showClearButton:c=T.showClearButton,showValidationIcon:d=T.showValidationIcon,prefix:h,suffix:x,type:b,value:N,placeholder:S,hover:B,focus:C,valid:X,invalid:J,required:se,loading:w,disabled:D,readonly:xe,...Ee}=t;return(0,f.jsxs)(y,{...Ee,size:e,rounded:o,fillMode:i,hover:B,focus:C,valid:X,invalid:J,required:se,loading:w,disabled:D,readonly:xe,className:l(t.className,Ae),children:[h&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ce,{children:h}),r&&(0,f.jsx)(fe,{})]}),(0,f.jsx)(V,{placeholder:S,value:N,type:b}),d&&(0,f.jsx)(_,{valid:X,invalid:J,loading:w,disabled:D}),(0,f.jsx)(oe,{loading:w,disabled:D}),c&&(0,f.jsx)(R,{loading:w,disabled:D,readonly:xe,value:N}),x&&(0,f.jsxs)(f.Fragment,{children:[r&&(0,f.jsx)(fe,{}),(0,f.jsx)(we,{children:x})]})]})};U.states=vt;U.options=Nt;U.className=Ae;U.defaultOptions=T;var Be=U;var I=require("react/jsx-runtime"),ne="k-button",kt=[s.hover,s.focus,s.active,s.selected,s.disabled],St={size:[a.small,a.medium,a.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[p.solid,p.flat,p.outline,p.clear,p.link],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark,n.inverse]},z={size:a.medium,rounded:u.medium,fillMode:p.solid,themeColor:n.base,showArrow:!1,arrowIconName:"caret-alt-down"},k=t=>{let{size:e=z.size,rounded:o=z.rounded,fillMode:i=z.fillMode,themeColor:r=z.themeColor,showArrow:c=z.showArrow,arrowIconName:d=z.arrowIconName,hover:h,focus:x,active:b,selected:N,disabled:S,icon:B,text:C,iconClassName:X,...J}=t,se=B!==void 0,w=t.children!==void 0;return(0,I.jsxs)("button",{...J,className:l(t.className,ne,m(ne,{size:e,rounded:o,fillMode:i,themeColor:r}),O(ne,{hover:h,focus:x,active:b,disabled:S,selected:N}),{"k-icon-button":!C&&!w&&se}),children:[B&&(0,I.jsx)(g,{className:l(X,"k-button-icon"),icon:B}),C?(0,I.jsxs)(I.Fragment,{children:[C&&(0,I.jsx)("span",{className:"k-button-text",children:C}),t.children]}):t.children&&(0,I.jsx)("span",{className:"k-button-text",children:t.children}),c&&(0,I.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,I.jsx)(g,{icon:d})})]})};k.states=kt;k.options=St;k.className=ne;k.defaultOptions=z;var Mt=require("react/jsx-runtime");var Tt=require("react/jsx-runtime");var Pe=require("react/jsx-runtime"),He=t=>(0,Pe.jsx)(k,{children:"Button",...t});var A=require("react/jsx-runtime"),zt=t=>(0,A.jsx)(Be,{suffix:(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(He,{fillMode:"clear",children:"Send"})}),...t});