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