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