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