UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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