@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 17.5 kB
JavaScript
var Et=Object.create;var de=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var Ot=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var Lt=(e,t)=>{for(var o in t)de(e,o,{get:t[o],enumerable:!0})},Ve=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ot(t))!Ct.call(e,s)&&s!==o&&de(e,s,{get:()=>t[s],enumerable:!(n=gt(t,s))||n.enumerable});return e};var kt=(e,t,o)=>(o=e!=null?Et(yt(e)):{},Ve(t||!e||!e.__esModule?de(o,"default",{value:e,enumerable:!0}):o,e)),_t=e=>Ve(de({},"__esModule",{value:!0}),e);var Ho={};Lt(Ho,{ACTIONSHEET_CLASSNAME:()=>Fe,ActionSheet:()=>z,default:()=>Ro});module.exports=_t(Ho);var a=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?a(...t):typeof t=="object"?Object.keys(t).map((o,n)=>t[n]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var b=(e,t)=>a({[`${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"}),J=(e,t)=>{let{valid:o,invalid:n,hover:s,focus:c,checked:d,active:f,selected:m,disabled:x,indeterminate:h,loading:M,empty:K,readonly:y,highlighted:T,...g}=t;return a({"k-valid":o,"k-invalid":n,"k-hover":s,"k-focus":c,"k-checked":d,"k-active":f,"k-selected":m,"k-disabled":x,"k-indeterminate":h&&!d,"k-loading":M,"k-empty":K,"k-readonly":y,"k-highlighted":T},Object.keys(g).reduce((P,I)=>(I.startsWith("k-")?P[I]=g[I]:P[`k-${I}`]=g[I],P),{}))};function $e(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(n=>[`k-${n}`,!0]))}var r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},p={small:"small",medium:"medium",large:"large",full:"full"},u={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"},i={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 Se="popup",Xe=Se;var ve=require("react/jsx-runtime"),Je="k-animation-container",Rt=[],Ht={},qe={positionMode:"absolute"},L=e=>{let{positionMode:t=qe.positionMode,animationStyle:o,offset:n,...s}=e;return(0,ve.jsx)("div",{...s,style:{...n,...e.style},className:a(e.className,Je,"k-animation-container-shown",{"k-animation-container-fixed":t==="fixed"}),children:(0,ve.jsx)("div",{className:"k-child-animation-container",style:o,children:e.children})})};L.states=Rt;L.options=Ht;L.className=Je;L.defaultOptions=qe;L.moduleName=Se;L.folderName=Xe;var Me="action-buttons",Ge=Me;var We=require("react/jsx-runtime"),pe="k-actions",zt=[],Kt={},Ae={alignment:"start",orientation:"horizontal"},k=e=>{let{alignment:t=Ae.alignment,orientation:o=Ae.orientation,...n}=e;return(0,We.jsx)("div",{...n,className:a(pe,{[`${pe}-${t}`]:t,[`${pe}-${o}`]:o},e.className),children:e.children})};k.states=zt;k.options=Kt;k.className=pe;k.defaultOptions=Ae;k.moduleName=Me;k.folderName=Ge;var Ye=require("react/jsx-runtime"),Pt="k-actionsheet-footer",Qe={alignment:"stretched",orientation:"horizontal"},Ie=e=>{let{alignment:t=Qe.alignment,orientation:o=Qe.orientation,template:n,as:s=n?"div":k,...c}=e;return(0,Ye.jsx)(s,{...c,...!n&&{alignment:t,orientation:o},className:a(e.className,Pt),children:e.children})};var Z="input",me=Z;var Ze=require("react/jsx-runtime"),ue="k-input",Bt=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.loading,i.readonly],wt={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},fe={size:r.medium,rounded:r.medium,fillMode:u.solid},S=e=>{let{hover:t,focus:o,disabled:n,invalid:s,valid:c,loading:d,readonly:f,size:m=fe.size,rounded:x=fe.rounded,fillMode:h=fe.fillMode,...M}=e;return(0,Ze.jsx)("span",{...M,className:a(e.className,ue,b(ue,{size:m,rounded:x,fillMode:h}),J(ue,{hover:t,focus:o,disabled:n,invalid:s,valid:c,loading:d,readonly:f}))})};S.states=Bt;S.options=wt;S.className=ue;S.defaultOptions=fe;S.moduleName=Z;S.folderName=me;var je=require("react/jsx-runtime"),xe="k-picker",Dt=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.loading,i.readonly],Ft={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},Ne={size:r.medium,rounded:p.medium,fillMode:u.solid},q=e=>{let{hover:t,focus:o,disabled:n,invalid:s,valid:c,loading:d,readonly:f,size:m=Ne.size,rounded:x=Ne.rounded,fillMode:h=Ne.fillMode,...M}=e;return(0,je.jsx)("span",{...M,className:a(e.className,xe,b(xe,{size:m,rounded:x,fillMode:h}),J(xe,{hover:t,focus:o,disabled:n,invalid:s,valid:c,loading:d,readonly:f})),children:e.children})};q.states=Dt;q.options=Ft;q.className=xe;q.defaultOptions=Ne;q.moduleName=Z;q.folderName=me;var j=require("react/jsx-runtime"),Te="k-font-icon",Ut=[],Vt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},$t={},ee=e=>{let{size:t,themeColor:o,icon:n,rotate:s,flip:c,...d}=e;return n?(0,j.jsx)("span",{...d,className:a(e.className,Te,b(Te,{size:t}),{[`k-i-${n}`]:n,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,j.jsx)(j.Fragment,{})};ee.states=Ut;ee.options=Vt;ee.className=Te;ee.defaultOptions=$t;var et=ee;var B=require("react/jsx-runtime"),Ee="k-svg-icon",Xt=[],Jt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},tt={viewBox:"0 0 24 24"},te=e=>{let{size:t,themeColor:o,rotate:n,flip:s,viewBox:c=tt.viewBox,icon:d,...f}=e;if(!d)return(0,B.jsx)(B.Fragment,{});d==="none"&&{...f,className:a(e.className,Ee,"k-none")};let m=typeof d=="object"&&d.name&&d.name;return(0,B.jsx)("span",{...f,className:a(e.className,Ee,b("k-icon",{size:t}),{[`k-svg-i-${m}`]:m,[`k-color-${o}`]:o,[`k-rotate-${n}`]:n,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="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:e.children})})};te.states=Xt;te.options=Jt;te.className=Ee;te.defaultOptions=tt;var ge=te;var Oe=kt(require("@progress/kendo-svg-icons"));var ot="icon",nt="icons";var C=require("react/jsx-runtime"),he="k-icon",qt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Gt=[],Wt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},ye={viewBox:"0 0 24 24",type:"svg"},N=e=>{let{size:t,themeColor:o,icon:n,type:s=ye.type,rotate:c,flip:d,viewBox:f=ye.viewBox,...m}=e;if(!n)return(0,C.jsx)(C.Fragment,{});if(s==="svg"){if(n==="none")return(0,C.jsx)(ge,{...m,className:a(e.className,he),icon:n,size:t});let x=Oe[n]?n:qt(`${n}-icon`);return Oe[x]?(0,C.jsx)(ge,{...m,className:a(e.className,he),icon:Oe[x],size:t,themeColor:o,rotate:c,flip:d,viewBox:f}):(0,C.jsx)(C.Fragment,{})}return(0,C.jsx)(et,{...m,className:a(e.className,he),icon:n,size:t,themeColor:o,rotate:c,flip:d})};N.states=Gt;N.options=Wt;N.defaultOptions=ye;N.className=he;N.moduleName=ot;N.folderName=nt;var G=require("react/jsx-runtime"),at="k-clear-value",Qt=[i.disabled,i.loading,i.readonly],Yt={},w=e=>{let{disabled:t,loading:o,readonly:n,value:s}=e;return t||n||o||!s?(0,G.jsx)(G.Fragment,{}):(0,G.jsx)("span",{className:a(e.className,at),children:(0,G.jsx)(N,{icon:"x"})})};w.states=Qt;w.options=Yt;w.className=at;var st=require("react/jsx-runtime"),Ce="k-input-inner",Zt=[],jt={},be={type:"text",autocomplete:"off",value:"",placeholder:""},D=e=>{let{value:t=be.value,type:o=be.type,placeholder:n=be.placeholder,autocomplete:s=be.autocomplete,...c}=e;return(0,st.jsx)("input",{...c,type:o,className:a(e.className,Ce,b(Ce,e)),placeholder:n,autoComplete:s,defaultValue:t})};D.states=Zt;D.options=jt;D.className=Ce;var oe=require("react/jsx-runtime"),Le="k-input-inner",eo=[],to={},ke=e=>{let{value:t,placeholder:o,showValue:n,valueIcon:s,valueIconName:c,...d}=e;return(0,oe.jsxs)("span",{...d,className:a(e.className,Le,b(Le,e)),children:[s,!s&&c&&(0,oe.jsx)(N,{className:"k-input-value-icon",icon:c}),n&&!t&&o,n&&t&&(0,oe.jsx)("span",{className:"k-input-value-text",children:t})]})};ke.states=eo;ke.options=to;ke.className=Le;var rt=require("react/jsx-runtime"),_e="k-input-inner",oo=[],no={},it={value:"",placeholder:""},Re=e=>{let{value:t=it.value,placeholder:o=it.placeholder,rows:n,...s}=e;return(0,rt.jsx)("textarea",{...s,className:a(e.className,_e,b(_e,e)),placeholder:o,rows:n,defaultValue:t})};Re.states=oo;Re.options=no;Re.className=_e;var ne=require("react/jsx-runtime"),lt="k-input-loading-icon",ao=[i.disabled,i.loading],W=e=>{let{disabled:t,loading:o}=e;return t||!o?(0,ne.jsx)(ne.Fragment,{}):(0,ne.jsx)("span",{className:a(e.className,lt,"k-icon k-i-loading")})};W.states=ao;W.className=lt;var ae=require("react/jsx-runtime"),ct="k-input-validation-icon",so=[i.valid,i.invalid,i.disabled,i.loading],io={},F=e=>{let{valid:t,invalid:o,disabled:n,loading:s}=e,c=o?"warning-circle":"check-circle";return n||s||!!!(t||o)?(0,ae.jsx)(ae.Fragment,{}):(0,ae.jsx)(N,{className:a(ct),icon:c})};F.states=so;F.options=io;F.className=ct;var se=require("react/jsx-runtime"),ro="k-input-prefix",lo={direction:"horizontal"},dt=e=>{let{direction:t=lo.direction,...o}=e;return e.children?(0,se.jsx)("span",{...o,className:a(ro,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):(0,se.jsx)(se.Fragment,{})};var ie=require("react/jsx-runtime"),co="k-input-suffix",po={direction:"horizontal"},pt=e=>{let{direction:t=po.direction,...o}=e;return e.children?(0,ie.jsx)("span",{...o,className:a(co,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):(0,ie.jsx)(ie.Fragment,{})};var mo=require("react/jsx-runtime");var uo=require("react/jsx-runtime");var ut=require("react/jsx-runtime"),mt="k-input-separator",fo={direction:"vertical"},He=e=>{let{direction:t=fo.direction,...o}=e;return(0,ut.jsx)("span",{...o,className:a(mt,e.className,{[`${mt}-${t}`]:t})})};var ze="searchbox",ft=ze;var _=require("react/jsx-runtime"),xt="k-searchbox",xo=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.loading],No={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},Ke={showIcon:!0,icon:"search",size:S.defaultOptions.size,rounded:S.defaultOptions.rounded,fillMode:S.defaultOptions.fillMode},R=e=>{let{value:t,placeholder:o,size:n,rounded:s,fillMode:c,hover:d,focus:f,valid:m,invalid:x,required:h,loading:M,disabled:K,showIcon:y=Ke.showIcon,icon:T=Ke.icon,...g}=e;return(0,_.jsxs)(S,{...g,size:n,rounded:s,fillMode:c,hover:d,focus:f,valid:m,invalid:x,required:h,loading:M,disabled:K,className:a(e.className,xt),children:[y&&(0,_.jsx)(N,{className:"k-input-icon",icon:T}),(0,_.jsx)(D,{placeholder:o,value:t}),(0,_.jsx)(W,{...e}),(0,_.jsx)(F,{...e}),(0,_.jsx)(w,{...e})]})};R.states=xo;R.options=No;R.className=xt;R.defaultOptions=Ke;R.moduleName=ze;R.folderName=ft;var ho=require("react/jsx-runtime");var Pe="textbox",Nt=Pe;var v=require("react/jsx-runtime"),ht="k-textbox",bo=[i.hover,i.focus,i.valid,i.invalid,i.required,i.disabled,i.loading,i.readonly],So={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},U={showClearButton:!0,showValidationIcon:!0,size:S.defaultOptions.size,rounded:S.defaultOptions.rounded,fillMode:S.defaultOptions.fillMode,separators:!0},H=e=>{let{size:t=U.size,rounded:o=U.rounded,fillMode:n=U.fillMode,separators:s=U.separators,showClearButton:c=U.showClearButton,showValidationIcon:d=U.showValidationIcon,prefix:f,suffix:m,type:x,value:h,placeholder:M,hover:K,focus:y,valid:T,invalid:g,required:P,loading:I,disabled:X,readonly:Ue,...Tt}=e;return(0,v.jsxs)(S,{...Tt,size:t,rounded:o,fillMode:n,hover:K,focus:y,valid:T,invalid:g,required:P,loading:I,disabled:X,readonly:Ue,className:a(e.className,ht),children:[f&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(dt,{children:f}),s&&(0,v.jsx)(He,{})]}),(0,v.jsx)(D,{placeholder:M,value:h,type:x}),d&&(0,v.jsx)(F,{valid:T,invalid:g,loading:I,disabled:X}),(0,v.jsx)(W,{loading:I,disabled:X}),c&&(0,v.jsx)(w,{loading:I,disabled:X,readonly:Ue,value:h}),m&&(0,v.jsxs)(v.Fragment,{children:[s&&(0,v.jsx)(He,{}),(0,v.jsx)(pt,{children:m})]})]})};H.states=bo;H.options=So;H.className=ht;H.defaultOptions=U;H.moduleName=Pe;H.folderName=Nt;var vo=require("react/jsx-runtime");var St=require("react/jsx-runtime");var Be="button",vt=Be;var E=require("react/jsx-runtime"),re="k-button",Mo=["icon-button"],Ao=[i.hover,i.focus,i.active,i.selected,i.disabled,i.generating],Io={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark,l.inverse]},V={size:r.medium,rounded:p.medium,fillMode:u.solid,themeColor:l.base,showArrow:!1,arrowIconName:"caret-alt-down"},O=e=>{let{size:t=V.size,rounded:o=V.rounded,fillMode:n=V.fillMode,themeColor:s=V.themeColor,showArrow:c=V.showArrow,arrowIconName:d=V.arrowIconName,variant:f,hover:m,focus:x,active:h,selected:M,disabled:K,icon:y,text:T,iconClassName:g,...P}=e,I=y!==void 0,X=e.children!==void 0;return(0,E.jsxs)("button",{...P,className:a(e.className,re,$e(re,f),b(re,{size:t,rounded:o,fillMode:n,themeColor:s}),J(re,{hover:m,focus:x,active:h,disabled:K,selected:M}),{"k-icon-button":!T&&!X&&I}),children:[y&&(0,E.jsx)(N,{className:a(g,"k-button-icon"),icon:y}),T?(0,E.jsxs)(E.Fragment,{children:[T&&(0,E.jsx)("span",{className:"k-button-text",children:T}),e.children]}):e.children&&(0,E.jsx)("span",{className:"k-button-text",children:e.children}),c&&(0,E.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,E.jsx)(N,{icon:d})})]})};O.states=Ao;O.options=Io;O.variants=Mo;O.className=re;O.defaultOptions=V;O.moduleName=Be;O.folderName=vt;var To=require("react/jsx-runtime");var Eo=require("react/jsx-runtime");var go=require("react/jsx-runtime");var Mt=require("react/jsx-runtime");var A=require("react/jsx-runtime"),At="k-actionsheet-titlebar",Oo={},le=e=>{let{title:t,subtitle:o,actionsStart:n,actionsEnd:s,filter:c,input:d,inputValue:f,inputPlaceholder:m,adaptive:x,children:h,...M}=e;return(0,A.jsxs)("div",{...M,className:a(e.className,At),children:[(0,A.jsxs)("div",{className:"k-actionsheet-titlebar-group",children:[n&&(0,A.jsx)("div",{className:"k-actionsheet-actions",children:n}),!h&&(0,A.jsxs)("div",{className:"k-actionsheet-title",children:[t&&(0,A.jsx)("div",{className:"k-text-center",children:t}),o&&(0,A.jsx)("div",{className:"k-actionsheet-subtitle k-text-center",children:o})]}),h&&(0,A.jsx)("div",{className:"k-actionsheet-title",children:h}),s&&(0,A.jsx)("div",{className:"k-actionsheet-actions",children:s})]}),(d||c)&&(0,A.jsx)("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter",children:d?(0,A.jsx)(H,{value:f,placeholder:m,size:x?"large":"medium"}):(0,A.jsx)(R,{placeholder:"Filter",size:x?"large":"medium"})})]})};le.className=At;le.defaultOptions=Oo;var Q=require("react/jsx-runtime"),we="k-actionsheet-view",yo=[],Co={},Lo={},Y=e=>{let{adaptive:t,animated:o,children:n,header:s,footer:c,...d}=e,f=(s==null?void 0:s.type)===le&&(0,Q.jsx)(le,{adaptive:t,...s==null?void 0:s.props}),m=(c==null?void 0:c.type)===Ie&&(0,Q.jsx)(Ie,{...c==null?void 0:c.props});return(0,Q.jsxs)("div",{...d,className:a(e.className,we,{[`${we}-animated`]:o}),children:[f,(0,Q.jsx)("div",{className:"k-actionsheet-content",children:n}),m]})};Y.states=yo;Y.options=Co;Y.className=we;Y.defaultOptions=Lo;var De="action-sheet",It=De;var $=require("react/jsx-runtime"),Fe="k-actionsheet",ko=[],_o={},ce={side:"bottom",fullscreen:!1,adaptive:!1,overlay:!0},z=e=>{let{side:t=ce.side,fullscreen:o=ce.fullscreen,adaptive:n=ce.adaptive,overlay:s=ce.overlay,template:c,children:d,header:f,footer:m,...x}=e;return(0,$.jsxs)("div",{className:"k-actionsheet-container",children:[s&&(0,$.jsx)("div",{className:"k-overlay"}),(0,$.jsx)(L,{animationStyle:{[`${o===!0?"top":t}`]:0,[`${o===!0?"width":null}`]:"100%",[`${o===!0?"height":null}`]:"100%",[`${t==="top"||t==="bottom"?"width":null}`]:"100%",[`${t==="left"||t==="right"?"height":null}`]:"100%"},children:(0,$.jsx)("div",{...x,className:a(e.className,Fe,{[`k-actionsheet-${t}`]:o===!1,"k-actionsheet-fullscreen":o===!0,"k-adaptive-actionsheet":n}),children:c||(0,$.jsx)(Y,{header:f,footer:m,adaptive:n,...e,children:d})})})]})};z.states=ko;z.options=_o;z.className=Fe;z.defaultOptions=ce;z.moduleName=De;z.folderName=It;var Ro=z;