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