UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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