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