UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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