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