UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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