UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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