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