@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 15.6 kB
JavaScript
var o=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?o(...t):typeof t=="object"?Object.keys(t).map((n,s)=>t[s]||t[n]&&n||null).filter(n=>n!==null).join(" "):t).filter(t=>!!t).join(" ");var x=(e,t)=>o({[`${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"}),O=(e,t)=>{let{valid:n,invalid:s,hover:l,focus:m,checked:c,active:N,selected:p,disabled:T,indeterminate:h,loading:S,empty:z,readonly:g,highlighted:A,...y}=t;return o({"k-valid":n,"k-invalid":s,"k-hover":l,"k-focus":m,"k-checked":c,"k-active":N,"k-selected":p,"k-disabled":T,"k-indeterminate":h&&!c,"k-loading":S,"k-empty":z,"k-readonly":g,"k-highlighted":A},Object.keys(y).reduce((_,E)=>(E.startsWith("k-")?_[E]=y[E]:_[`k-${E}`]=y[E],_),{}))};function Ee(e,t){if(!t)return{};let n=Array.isArray(t)?t:[t];return Object.fromEntries(n.map(s=>[`k-${s}`,!0]))}var a={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},d={small:"small",medium:"medium",large:"large",full:"full"},u={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},i={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},r={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 K="input",X=K;import{jsx as xt}from"react/jsx-runtime";var W="k-input",ft=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],Nt={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline]},Y={size:a.medium,rounded:a.medium,fillMode:u.solid},b=e=>{let{hover:t,focus:n,disabled:s,invalid:l,valid:m,loading:c,readonly:N,size:p=Y.size,rounded:T=Y.rounded,fillMode:h=Y.fillMode,...S}=e;return xt("span",{...S,className:o(e.className,W,x(W,{size:p,rounded:T,fillMode:h}),O(W,{hover:t,focus:n,disabled:s,invalid:l,valid:m,loading:c,readonly:N}))})};b.states=ft;b.options=Nt;b.className=W;b.defaultOptions=Y;b.moduleName=K;b.folderName=X;import{jsx as ht}from"react/jsx-runtime";var Q="k-picker",Mt=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],Tt={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline]},Z={size:a.medium,rounded:d.medium,fillMode:u.solid},B=e=>{let{hover:t,focus:n,disabled:s,invalid:l,valid:m,loading:c,readonly:N,size:p=Z.size,rounded:T=Z.rounded,fillMode:h=Z.fillMode,...S}=e;return ht("span",{...S,className:o(e.className,Q,x(Q,{size:p,rounded:T,fillMode:h}),O(Q,{hover:t,focus:n,disabled:s,invalid:l,valid:m,loading:c,readonly:N})),children:e.children})};B.states=Mt;B.options=Tt;B.className=Q;B.defaultOptions=Z;B.moduleName=K;B.folderName=X;import{Fragment as bt,jsx as ye}from"react/jsx-runtime";var re="k-font-icon",St=[],It={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},At={},D=e=>{let{size:t,themeColor:n,icon:s,rotate:l,flip:m,...c}=e;return s?ye("span",{...c,className:o(e.className,re,x(re,{size:t}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):ye(bt,{})};D.states=St;D.options=It;D.className=re;D.defaultOptions=At;var Oe=D;import{Fragment as gt,jsx as j}from"react/jsx-runtime";var ie="k-svg-icon",kt=[],vt={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},Ce={viewBox:"0 0 24 24"},w=e=>{let{size:t,themeColor:n,rotate:s,flip:l,viewBox:m=Ce.viewBox,icon:c,...N}=e;if(!c)return j(gt,{});c==="none"&&{...N,className:o(e.className,ie,"k-none")};let p=typeof c=="object"&&c.name&&c.name;return j("span",{...N,className:o(e.className,ie,x("k-icon",{size:t}),{[`k-svg-i-${p}`]:p,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:j("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:m,dangerouslySetInnerHTML:typeof c=="object"?{__html:c.content}:void 0,children:c?void 0:e.children})})};w.states=kt;w.options=vt;w.className=ie;w.defaultOptions=Ce;var le=w;import*as me from"@progress/kendo-svg-icons";var Le="icon",Pe="icons";import{Fragment as _e,jsx as U}from"react/jsx-runtime";var ee="k-icon",Et=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),yt=[],Ot={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},ce={viewBox:"0 0 24 24",type:"svg"},M=e=>{let{size:t,themeColor:n,icon:s,type:l=ce.type,rotate:m,flip:c,viewBox:N=ce.viewBox,...p}=e;if(!s)return U(_e,{});if(l==="svg"){if(s==="none")return U(le,{...p,className:o(e.className,ee),icon:s,size:t});let T=me[s]?s:Et(`${s}-icon`);return me[T]?U(le,{...p,className:o(e.className,ee),icon:me[T],size:t,themeColor:n,rotate:m,flip:c,viewBox:N}):U(_e,{})}return U(Oe,{...p,className:o(e.className,ee),icon:s,size:t,themeColor:n,rotate:m,flip:c})};M.states=yt;M.options=Ot;M.defaultOptions=ce;M.className=ee;M.moduleName=Le;M.folderName=Pe;import{Fragment as Pt,jsx as pe}from"react/jsx-runtime";var He="k-clear-value",Ct=[r.disabled,r.loading,r.readonly],Lt={},F=e=>{let{disabled:t,loading:n,readonly:s,value:l}=e;return t||s||n||!l?pe(Pt,{}):pe("span",{className:o(e.className,He),children:pe(M,{icon:"x"})})};F.states=Ct;F.options=Lt;F.className=He;import{jsx as Rt}from"react/jsx-runtime";var de="k-input-inner",_t=[],Ht={},te={type:"text",autocomplete:"off",value:"",placeholder:""},$=e=>{let{value:t=te.value,type:n=te.type,placeholder:s=te.placeholder,autocomplete:l=te.autocomplete,...m}=e;return Rt("input",{...m,type:n,className:o(e.className,de,x(de,e)),placeholder:s,autoComplete:l,defaultValue:t})};$.states=_t;$.options=Ht;$.className=de;import{jsx as Re,jsxs as Kt}from"react/jsx-runtime";var ue="k-input-inner",Bt=[],zt={},fe=e=>{let{value:t,placeholder:n,showValue:s,valueIcon:l,valueIconName:m,...c}=e;return Kt("span",{...c,className:o(e.className,ue,x(ue,e)),children:[l,!l&&m&&Re(M,{className:"k-input-value-icon",icon:m}),s&&!t&&n,s&&t&&Re("span",{className:"k-input-value-text",children:t})]})};fe.states=Bt;fe.options=zt;fe.className=ue;import{jsx as Ut}from"react/jsx-runtime";var Ne="k-input-inner",Dt=[],wt={},Be={value:"",placeholder:""},xe=e=>{let{value:t=Be.value,placeholder:n=Be.placeholder,rows:s,...l}=e;return Ut("textarea",{...l,className:o(e.className,Ne,x(Ne,e)),placeholder:n,rows:s,defaultValue:t})};xe.states=Dt;xe.options=wt;xe.className=Ne;import{Fragment as $t,jsx as ze}from"react/jsx-runtime";var Ke="k-input-loading-icon",Ft=[r.disabled,r.loading],oe=e=>{let{disabled:t,loading:n}=e;return t||!n?ze($t,{}):ze("span",{className:o(e.className,Ke,"k-icon k-i-loading")})};oe.states=Ft;oe.className=Ke;import{Fragment as Gt,jsx as De}from"react/jsx-runtime";var we="k-input-validation-icon",Vt=[r.valid,r.invalid,r.disabled,r.loading],qt={},V=e=>{let{valid:t,invalid:n,disabled:s,loading:l}=e,m=n?"warning-circle":"check-circle";return s||l||!!!(t||n)?De(Gt,{}):De(M,{className:o(we),icon:m})};V.states=Vt;V.options=qt;V.className=we;import{Fragment as Wt,jsx as Ue}from"react/jsx-runtime";var Jt="k-input-prefix",Xt={direction:"horizontal"},Fe=e=>{let{direction:t=Xt.direction,...n}=e;return e.children?Ue("span",{...n,className:o(Jt,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):Ue(Wt,{})};import{Fragment as Zt,jsx as $e}from"react/jsx-runtime";var Yt="k-input-suffix",Qt={direction:"horizontal"},Ve=e=>{let{direction:t=Qt.direction,...n}=e;return e.children?$e("span",{...n,className:o(Yt,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):$e(Zt,{})};import{jsx as On}from"react/jsx-runtime";import{jsx as _n}from"react/jsx-runtime";import{jsx as zn}from"react/jsx-runtime";var Me="button",qe=Me;import{Fragment as oo,jsx as q,jsxs as Ge}from"react/jsx-runtime";var G="k-button",jt=["icon-button"],eo=[r.hover,r.focus,r.active,r.selected,r.disabled,r.generating],to={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark,i.inverse]},H={size:a.medium,rounded:d.medium,fillMode:u.solid,themeColor:i.base,showArrow:!1,arrowIconName:"caret-alt-down"},f=e=>{let{size:t=H.size,rounded:n=H.rounded,fillMode:s=H.fillMode,themeColor:l=H.themeColor,showArrow:m=H.showArrow,arrowIconName:c=H.arrowIconName,variant:N,hover:p,focus:T,active:h,selected:S,disabled:z,icon:g,text:A,iconClassName:y,..._}=e,E=g!==void 0,ut=e.children!==void 0;return Ge("button",{..._,className:o(e.className,G,Ee(G,N),x(G,{size:t,rounded:n,fillMode:s,themeColor:l}),O(G,{hover:p,focus:T,active:h,disabled:z,selected:S}),{"k-icon-button":!A&&!ut&&E}),children:[g&&q(M,{className:o(y,"k-button-icon"),icon:g}),A?Ge(oo,{children:[A&&q("span",{className:"k-button-text",children:A}),e.children]}):e.children&&q("span",{className:"k-button-text",children:e.children}),m&&q("span",{className:"k-menu-button-arrow k-button-arrow",children:q(M,{icon:c})})]})};f.states=eo;f.options=to;f.variants=jt;f.className=G;f.defaultOptions=H;f.moduleName=Me;f.folderName=qe;import{jsx as is}from"react/jsx-runtime";import{jsx as ps}from"react/jsx-runtime";import{jsx as Ns}from"react/jsx-runtime";var Te="popup",Je=Te;import{jsx as Xe}from"react/jsx-runtime";var We="k-animation-container",no=[],so={},Ye={positionMode:"absolute"},C=e=>{let{positionMode:t=Ye.positionMode,animationStyle:n,offset:s,...l}=e;return Xe("div",{...l,style:{...s,...e.style},className:o(e.className,We,"k-animation-container-shown",{"k-animation-container-fixed":t==="fixed"}),children:Xe("div",{className:"k-child-animation-container",style:n,children:e.children})})};C.states=no;C.options=so;C.className=We;C.defaultOptions=Ye;C.moduleName=Te;C.folderName=Je;var he="popup",Qe=he;import{jsx as Ze}from"react/jsx-runtime";var je="k-popup",ao=[],ro={},et={positionMode:"absolute"},k=e=>{let{offset:t,positionMode:n=et.positionMode,animationStyle:s,...l}=e;return Ze(C,{positionMode:n,offset:t,animationStyle:s,children:Ze("div",{...l,className:o(e.className,je),children:e.children})})};k.states=ao;k.options=ro;k.className=je;k.defaultOptions=et;k.moduleName=he;k.folderName=Qe;var tt="time-selector",ot="timeselector";import{Fragment as Se,jsx as J,jsxs as nt}from"react/jsx-runtime";var Ie="k-timeselector",io=[],lo={size:[a.small,a.medium,a.large]},st={size:a.medium},L=e=>{let{size:t=st.size,header:n,fastSelection:s,columns:l,focusedColumn:m,...c}=e,N=l.map(function(p,T){let h=!1,S=!0;return p===m&&(h=!0),(T===0||p==="tt")&&(S=!1),J(Se,{children:J(Ae,{type:p,focus:h,separator:S})})});return nt("div",{...c,className:o(e.className,Ie,x(Ie,{size:t})),children:[J(Se,{children:n}),J(Se,{children:s}),nt("div",{className:"k-time-list-container",children:[J("span",{className:"k-time-highlight"}),N]})]})};L.states=io;L.options=lo;L.className=Ie;L.defaultOptions=st;L.moduleName=tt;L.folderName=ot;import{Fragment as at,jsx as P,jsxs as be}from"react/jsx-runtime";var mo=[r.focus],Ae=e=>{let{type:t,focus:n,separator:s,...l}=e,m,c=["00","01","02","03","04","05","06","07","08","09"];switch(t){case"dd":m="Day";break;case"HH":m="Hour";break;case"mm":m="Minute";break;case"ss":m="Second";break;case"SSS":m="Millisecond",c=["000","001","002","003","004","005","006","007","008","009"];break;case"tt":m="AM/PM",c=["AM","PM"];break;default:m="Column Name";break}let N=c.map(p=>P(at,{children:P("li",{className:"k-item",children:P("span",{children:p})})}));return be(at,{children:[s&&P("div",{className:"k-time-separator",children:":"}),be("div",{...l,className:o(e.className,"k-time-list-wrapper",O("k-time-list-wrapper",{focus:n})),children:[P("span",{className:"k-title",children:m}),P("div",{className:"k-time-list",children:be("div",{className:"k-content k-scrollable k-time-container",children:[P("ul",{className:"k-reset",style:{transform:"translateY(97px)"},children:N}),P("div",{className:"k-scrollable-placeholder"})]})})]})]})};Ae.states=mo;import{jsx as Xs,jsxs as Ws}from"react/jsx-runtime";var ke="action-buttons",rt=ke;import{jsx as uo}from"react/jsx-runtime";var ne="k-actions",co=[],po={},ve={alignment:"start",orientation:"horizontal"},I=e=>{let{alignment:t=ve.alignment,orientation:n=ve.orientation,...s}=e;return uo("div",{...s,className:o(ne,{[`${ne}-${t}`]:t,[`${ne}-${n}`]:n},e.className),children:e.children})};I.states=co;I.options=po;I.className=ne;I.defaultOptions=ve;I.moduleName=ke;I.folderName=rt;import{jsx as ge,jsxs as No}from"react/jsx-runtime";var fo="k-time-fast-selection",it=e=>{let{...t}=e;return No(I,{...t,alignment:"start",className:o(e.className,fo),children:[ge(f,{children:"1 d"}),ge(f,{children:"1 h"}),ge(f,{children:"15 m"})]})};import{Fragment as Ma,jsx as Na,jsxs as xa}from"react/jsx-runtime";import{Fragment as Ea,jsx as va,jsxs as ga}from"react/jsx-runtime";import{Fragment as za,jsx as Ra,jsxs as Ba}from"react/jsx-runtime";var ct="time-duration-picker",pt="timedurationpicker";import{Fragment as To,jsx as v,jsxs as se}from"react/jsx-runtime";var dt="k-timedurationpicker",xo=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],Mo={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline]},ae={size:b.defaultOptions.size,rounded:b.defaultOptions.rounded,fillMode:b.defaultOptions.fillMode},R=e=>{let{size:t=ae.size,rounded:n=ae.rounded,fillMode:s=ae.fillMode,prefix:l,suffix:m,value:c,placeholder:N,hover:p,focus:T,valid:h,invalid:S,required:z,loading:g,disabled:A,readonly:y,opened:_,...E}=e;return se(To,{children:[se(b,{...E,size:t,rounded:n,fillMode:s,hover:p,focus:T,valid:h,invalid:S,required:z,loading:g,disabled:A,readonly:y,className:o(e.className,dt),children:[v(Fe,{children:l}),v($,{placeholder:N,value:c}),v(V,{valid:h,invalid:S,loading:g,disabled:A}),v(oe,{loading:g,disabled:A}),v(F,{loading:g,disabled:A,readonly:y,value:c}),v(Ve,{children:m}),v(f,{className:"k-input-button",icon:"clock-arrow-rotate",rounded:null,size:t,fillMode:s})]}),_&&se(k,{className:"k-timedurationpicker-popup",children:[v(L,{columns:["dd","HH","mm"],focusedColumn:"HH",fastSelection:v(it,{})}),se(I,{alignment:"stretched",className:"k-timeduration-footer",children:[v(f,{className:"k-time-cancel",children:"Cancel"}),v(f,{themeColor:"primary",className:"k-time-accept",children:"Set"})]})]})]})};R.states=xo;R.options=Mo;R.className=dt;R.defaultOptions=ae;R.moduleName=ct;R.folderName=pt;var tr=R;export{dt as TIMEDURATIONPICKER_CLASSNAME,R as TimeDurationPicker,tr as default};