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