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