UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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