UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 13.5 kB
var Qe=Object.create;var te=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},Se=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ze(t))!et.call(e,l)&&l!==o&&te(e,l,{get:()=>t[l],enumerable:!(r=Ye(t,l))||r.enumerable});return e};var ot=(e,t,o)=>(o=e!=null?Qe(je(e)):{},Se(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e)),nt=e=>Se(te({},"__esModule",{value:!0}),e);var Gt={};tt(Gt,{NumericTextboxSuffix:()=>qt});module.exports=nt(Gt);var i=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?i(...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 x=(e,t)=>i({[`${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"}),P=(e,t)=>{let{valid:o,invalid:r,hover:l,focus:d,checked:p,active:N,selected:m,disabled:M,indeterminate:v,loading:y,empty:K,readonly:E,highlighted:O,...L}=t;return i({"k-valid":o,"k-invalid":r,"k-hover":l,"k-focus":d,"k-checked":p,"k-active":N,"k-selected":m,"k-disabled":M,"k-indeterminate":v&&!p,"k-loading":y,"k-empty":K,"k-readonly":E,"k-highlighted":O},Object.keys(L).reduce((S,b)=>(b.startsWith("k-")?S[b]=L[b]:S[`k-${b}`]=L[b],S),{}))};function ve(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(r=>[`k-${r}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},u={small:"small",medium:"medium",large:"large",full:"full"},c={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},s={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",generating:"generating",expanded:"expanded"};var U="input",oe=U;var ye=require("react/jsx-runtime"),ne="k-input",st=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],at={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline]},se={size:n.medium,rounded:n.medium,fillMode:c.solid},g=e=>{let{hover:t,focus:o,disabled:r,invalid:l,valid:d,loading:p,readonly:N,size:m=se.size,rounded:M=se.rounded,fillMode:v=se.fillMode,...y}=e;return(0,ye.jsx)("span",{...y,className:i(e.className,ne,x(ne,{size:m,rounded:M,fillMode:v}),P(ne,{hover:t,focus:o,disabled:r,invalid:l,valid:d,loading:p,readonly:N}))})};g.states=st;g.options=at;g.className=ne;g.defaultOptions=se;g.moduleName=U;g.folderName=oe;var Oe=require("react/jsx-runtime"),ae="k-picker",rt=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],it={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline]},re={size:n.medium,rounded:u.medium,fillMode:c.solid},R=e=>{let{hover:t,focus:o,disabled:r,invalid:l,valid:d,loading:p,readonly:N,size:m=re.size,rounded:M=re.rounded,fillMode:v=re.fillMode,...y}=e;return(0,Oe.jsx)("span",{...y,className:i(e.className,ae,x(ae,{size:m,rounded:M,fillMode:v}),P(ae,{hover:t,focus:o,disabled:r,invalid:l,valid:d,loading:p,readonly:N})),children:e.children})};R.states=rt;R.options=it;R.className=ae;R.defaultOptions=re;R.moduleName=U;R.folderName=oe;var $=require("react/jsx-runtime"),ce="k-font-icon",lt=[],pt={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},ct={},D=e=>{let{size:t,themeColor:o,icon:r,rotate:l,flip:d,...p}=e;return r?(0,$.jsx)("span",{...p,className:i(e.className,ce,x(ce,{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,$.jsx)($.Fragment,{})};D.states=lt;D.options=pt;D.className=ce;D.defaultOptions=ct;var ke=D;var A=require("react/jsx-runtime"),de="k-svg-icon",dt=[],ut={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},Ee={viewBox:"0 0 24 24"},F=e=>{let{size:t,themeColor:o,rotate:r,flip:l,viewBox:d=Ee.viewBox,icon:p,...N}=e;if(!p)return(0,A.jsx)(A.Fragment,{});p==="none"&&{...N,className:i(e.className,de,"k-none")};let m=typeof p=="object"&&p.name&&p.name;return(0,A.jsx)("span",{...N,className:i(e.className,de,x("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,A.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})})};F.states=dt;F.options=ut;F.className=de;F.defaultOptions=Ee;var ue=F;var me=ot(require("@progress/kendo-svg-icons"));var Ce="icon",Le="icons";var k=require("react/jsx-runtime"),ie="k-icon",mt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),ft=[],xt={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},fe={viewBox:"0 0 24 24",type:"svg"},h=e=>{let{size:t,themeColor:o,icon:r,type:l=fe.type,rotate:d,flip:p,viewBox:N=fe.viewBox,...m}=e;if(!r)return(0,k.jsx)(k.Fragment,{});if(l==="svg"){if(r==="none")return(0,k.jsx)(ue,{...m,className:i(e.className,ie),icon:r,size:t});let M=me[r]?r:mt(`${r}-icon`);return me[M]?(0,k.jsx)(ue,{...m,className:i(e.className,ie),icon:me[M],size:t,themeColor:o,rotate:d,flip:p,viewBox:N}):(0,k.jsx)(k.Fragment,{})}return(0,k.jsx)(ke,{...m,className:i(e.className,ie),icon:r,size:t,themeColor:o,rotate:d,flip:p})};h.states=ft;h.options=xt;h.defaultOptions=fe;h.className=ie;h.moduleName=Ce;h.folderName=Le;var w=require("react/jsx-runtime"),Ae="k-clear-value",Nt=[a.disabled,a.loading,a.readonly],ht={},V=e=>{let{disabled:t,loading:o,readonly:r,value:l}=e;return t||r||o||!l?(0,w.jsx)(w.Fragment,{}):(0,w.jsx)("span",{className:i(e.className,Ae),children:(0,w.jsx)(h,{icon:"x"})})};V.states=Nt;V.options=ht;V.className=Ae;var ze=require("react/jsx-runtime"),xe="k-input-inner",Mt=[],It={},le={type:"text",autocomplete:"off",value:"",placeholder:""},X=e=>{let{value:t=le.value,type:o=le.type,placeholder:r=le.placeholder,autocomplete:l=le.autocomplete,...d}=e;return(0,ze.jsx)("input",{...d,type:o,className:i(e.className,xe,x(xe,e)),placeholder:r,autoComplete:l,defaultValue:t})};X.states=Mt;X.options=It;X.className=xe;var q=require("react/jsx-runtime"),Ne="k-input-inner",bt=[],gt={},he=e=>{let{value:t,placeholder:o,showValue:r,valueIcon:l,valueIconName:d,...p}=e;return(0,q.jsxs)("span",{...p,className:i(e.className,Ne,x(Ne,e)),children:[l,!l&&d&&(0,q.jsx)(h,{className:"k-input-value-icon",icon:d}),r&&!t&&o,r&&t&&(0,q.jsx)("span",{className:"k-input-value-text",children:t})]})};he.states=bt;he.options=gt;he.className=Ne;var _e=require("react/jsx-runtime"),Me="k-input-inner",Tt=[],St={},Be={value:"",placeholder:""},Ie=e=>{let{value:t=Be.value,placeholder:o=Be.placeholder,rows:r,...l}=e;return(0,_e.jsx)("textarea",{...l,className:i(e.className,Me,x(Me,e)),placeholder:o,rows:r,defaultValue:t})};Ie.states=Tt;Ie.options=St;Ie.className=Me;var G=require("react/jsx-runtime"),Pe="k-input-loading-icon",vt=[a.disabled,a.loading],pe=e=>{let{disabled:t,loading:o}=e;return t||!o?(0,G.jsx)(G.Fragment,{}):(0,G.jsx)("span",{className:i(e.className,Pe,"k-icon k-i-loading")})};pe.states=vt;pe.className=Pe;var J=require("react/jsx-runtime"),Re="k-input-validation-icon",yt=[a.valid,a.invalid,a.disabled,a.loading],Ot={},W=e=>{let{valid:t,invalid:o,disabled:r,loading:l}=e,d=o?"warning-circle":"check-circle";return r||l||!!!(t||o)?(0,J.jsx)(J.Fragment,{}):(0,J.jsx)(h,{className:i(Re),icon:d})};W.states=yt;W.options=Ot;W.className=Re;var Q=require("react/jsx-runtime"),kt="k-input-prefix",Et={direction:"horizontal"},we=e=>{let{direction:t=Et.direction,...o}=e;return e.children?(0,Q.jsx)("span",{...o,className:i(kt,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):(0,Q.jsx)(Q.Fragment,{})};var Y=require("react/jsx-runtime"),Ct="k-input-suffix",Lt={direction:"horizontal"},He=e=>{let{direction:t=Lt.direction,...o}=e;return e.children?(0,Y.jsx)("span",{...o,className:i(Ct,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):(0,Y.jsx)(Y.Fragment,{})};var At=require("react/jsx-runtime");var Ue=require("react/jsx-runtime"),zt="k-input-suffix-text",Ke=e=>{let{children:t,...o}=e;return(0,Ue.jsx)("span",{...o,className:i(zt,e.className),children:t})};var De=require("react/jsx-runtime"),$e="k-input-separator",Bt={direction:"vertical"},be=e=>{let{direction:t=Bt.direction,...o}=e;return(0,De.jsx)("span",{...o,className:i($e,e.className,{[`${$e}-${t}`]:t})})};var ge="button",Fe=ge;var T=require("react/jsx-runtime"),Z="k-button",_t=["icon-button"],Pt=[a.hover,a.focus,a.active,a.selected,a.disabled,a.generating],Rt={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline,c.clear,c.link],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark,s.inverse]},z={size:n.medium,rounded:u.medium,fillMode:c.solid,themeColor:s.base,showArrow:!1,arrowIconName:"caret-alt-down"},I=e=>{let{size:t=z.size,rounded:o=z.rounded,fillMode:r=z.fillMode,themeColor:l=z.themeColor,showArrow:d=z.showArrow,arrowIconName:p=z.arrowIconName,variant:N,hover:m,focus:M,active:v,selected:y,disabled:K,icon:E,text:O,iconClassName:L,...S}=e,b=E!==void 0,ee=e.children!==void 0;return(0,T.jsxs)("button",{...S,className:i(e.className,Z,ve(Z,N),x(Z,{size:t,rounded:o,fillMode:r,themeColor:l}),P(Z,{hover:m,focus:M,active:v,disabled:K,selected:y}),{"k-icon-button":!O&&!ee&&b}),children:[E&&(0,T.jsx)(h,{className:i(L,"k-button-icon"),icon:E}),O?(0,T.jsxs)(T.Fragment,{children:[O&&(0,T.jsx)("span",{className:"k-button-text",children:O}),e.children]}):e.children&&(0,T.jsx)("span",{className:"k-button-text",children:e.children}),d&&(0,T.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,T.jsx)(h,{icon:p})})]})};I.states=Pt;I.options=Rt;I.variants=_t;I.className=Z;I.defaultOptions=z;I.moduleName=ge;I.folderName=Fe;var wt=require("react/jsx-runtime");var Ht=require("react/jsx-runtime");var Kt=require("react/jsx-runtime");var j=require("react/jsx-runtime"),Ve="k-spin-button",Dt=[],Ft={size:[n.small,n.medium,n.large],fillMode:[c.solid,c.flat,c.outline,c.clear,c.link]},Te={size:n.medium,fillMode:c.solid},C=e=>{let{size:t=Te.size,fillMode:o=Te.fillMode,...r}=e;return(0,j.jsxs)("span",{...r,className:i(Ve,e.className),children:[(0,j.jsx)(I,{className:"k-spinner-increase",icon:"caret-alt-up",rounded:null,size:t,fillMode:o}),(0,j.jsx)(I,{className:"k-spinner-decrease",icon:"caret-alt-down",rounded:null,size:t,fillMode:o})]})};C.states=Dt;C.options=Ft;C.className=Ve;C.defaultOptions=Te;C.moduleName=null;C.folderName=null;var Xe="numeric-textbox",qe="numerictextbox";var f=require("react/jsx-runtime"),Ge="k-numerictextbox",Vt=[a.hover,a.focus,a.valid,a.invalid,a.loading,a.required,a.disabled,a.readonly],Xt={size:[n.small,n.medium,n.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[c.solid,c.flat,c.outline]},B={showSpinButton:!0,showClearButton:!0,size:g.defaultOptions.size,rounded:g.defaultOptions.rounded,fillMode:g.defaultOptions.fillMode,separators:!0},_=e=>{let{size:t=B.size,rounded:o=B.rounded,fillMode:r=B.fillMode,separators:l=B.separators,showClearButton:d=B.showClearButton,showSpinButton:p=B.showSpinButton,prefix:N,suffix:m,value:M,placeholder:v,hover:y,focus:K,valid:E,invalid:O,required:L,loading:S,disabled:b,readonly:ee,...We}=e;return(0,f.jsxs)(g,{...We,size:t,rounded:o,fillMode:r,hover:y,focus:K,valid:E,invalid:O,required:L,loading:S,disabled:b,readonly:ee,className:i(e.className,Ge),children:[N&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(we,{children:N}),l&&(0,f.jsx)(be,{})]}),(0,f.jsx)(X,{placeholder:v,value:M}),(0,f.jsx)(W,{valid:E,invalid:O,loading:S,disabled:b}),(0,f.jsx)(pe,{loading:S,disabled:b}),d&&(0,f.jsx)(V,{loading:S,disabled:b,readonly:ee,value:M}),m&&(0,f.jsxs)(f.Fragment,{children:[l&&(0,f.jsx)(be,{}),(0,f.jsx)(He,{children:m})]}),p&&(0,f.jsx)(C,{className:"k-input-spinner",size:t,fillMode:r})]})};_.states=Vt;_.options=Xt;_.className=Ge;_.defaultOptions=B;_.moduleName=Xe;_.folderName=qe;var Je=_;var H=require("react/jsx-runtime"),qt=e=>(0,H.jsx)(Je,{suffix:(0,H.jsx)(H.Fragment,{children:(0,H.jsx)(Ke,{children:"mm"})}),...e});