UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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