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