UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.41 kB
var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((s,i)=>e[i]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var f=(t,e)=>r({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),P=(t,e)=>r({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly,"k-highlighted":e.highlighted});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},y={small:"small",medium:"medium",large:"large",full:"full"},S={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},x={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"};import{Fragment as Q,jsx as h,jsxs as F}from"react/jsx-runtime";var he=[x.focus],D=t=>{let{type:e,focus:s,separator:i,...m}=t,l,a=["00","01","02","03","04","05","06","07","08","09"];switch(e){case"dd":l="Day";break;case"HH":l="Hour";break;case"mm":l="Minute";break;case"ss":l="Second";break;case"SSS":l="Millisecond",a=["000","001","002","003","004","005","006","007","008","009"];break;case"tt":l="AM/PM",a=["AM","PM"];break;default:l="Column Name";break}let u=a.map(c=>h(Q,{children:h("li",{className:"k-item",children:h("span",{children:c})})}));return F(Q,{children:[i&&h("div",{className:"k-time-separator",children:":"}),F("div",{...m,className:r(t.className,"k-time-list-wrapper",P("k-time-list-wrapper",{focus:s})),children:[h("span",{className:"k-title",children:l}),h("div",{className:"k-time-list",children:F("div",{className:"k-content k-scrollable k-time-container",children:[h("ul",{className:"k-reset",style:{transform:"translateY(97px)"},children:u}),h("div",{className:"k-scrollable-placeholder"})]})})]})]})};D.states=he;import{jsx as Se,jsxs as ge}from"react/jsx-runtime";var ke="k-time-header",L=t=>{let{title:e,...s}=t;return ge("div",{...s,className:r(t.className,ke),children:[e!=null&&Se("span",{className:"k-title",children:e}),t.children]})};import{jsx as ve}from"react/jsx-runtime";var K="k-actions",Ne=[],ye={},G={alignment:"start",orientation:"horizontal"},p=t=>{let{alignment:e=G.alignment,orientation:s=G.orientation,...i}=t;return ve("div",{...i,className:r(K,{[`${K}-${e}`]:e,[`${K}-${s}`]:s},t.className),children:t.children})};p.states=Ne;p.options=ye;p.className=K;p.defaultOptions=G;import{Fragment as Me,jsx as W}from"react/jsx-runtime";var V="k-icon k-font-icon",be=[],Te={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Ce={},C=t=>{let{size:e,themeColor:s,icon:i,rotate:m,flip:l,...a}=t;return i?W("span",{...a,className:r(t.className,V,f(V,{size:e}),{[`k-i-${i}`]:i,[`k-color-${s}`]:s,[`k-rotate-${m}`]:m,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):W(Me,{})};C.states=be;C.options=Te;C.className=V;C.defaultOptions=Ce;var Z=C;import{Fragment as we,jsx as $}from"react/jsx-runtime";var U="k-icon k-svg-icon",Be=[],Ae={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},j={viewBox:"0 0 24 24"},M=t=>{let{size:e,themeColor:s,rotate:i,flip:m,viewBox:l=j.viewBox,icon:a,...u}=t;if(!a)return $(we,{});a==="none"&&{...u,className:r(t.className,U,"k-none")};let c=typeof a=="object"&&a.name&&a.name;return $("span",{...u,className:r(t.className,U,f("k-icon",{size:e}),{[`k-svg-i-${c}`]:c,[`k-color-${s}`]:s,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:$("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:l,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:t.children})})};M.states=Be;M.options=Ae;M.className=U;M.defaultOptions=j;var q=M;import*as ee from"@progress/kendo-svg-icons";import{Fragment as te,jsx as B}from"react/jsx-runtime";var He=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ze=[],Oe={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},J={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:s,icon:i,type:m=J.type,rotate:l,flip:a,viewBox:u=J.viewBox,...c}=t;if(!i)return B(te,{});if(m==="svg"){if(i==="none")return B(q,{...c,icon:i,size:e});let N=He(`${i}-icon`);return ee[N]?B(q,{...c,icon:ee[N],size:e,themeColor:s,rotate:l,flip:a,viewBox:u}):B(te,{})}return B(Z,{...c,icon:i,size:e,themeColor:s,rotate:l,flip:a})};v.states=ze;v.options=Oe;v.defaultOptions=J;import{Fragment as Le,jsx as A,jsxs as oe}from"react/jsx-runtime";var E="k-button",Ie=[x.hover,x.focus,x.active,x.selected,x.disabled],Pe={size:[n.small,n.medium,n.large],rounded:[y.small,y.medium,y.large,y.full],fillMode:[S.solid,S.flat,S.outline,S.clear,S.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},g={size:n.medium,rounded:y.medium,fillMode:S.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=g.size,rounded:s=g.rounded,fillMode:i=g.fillMode,themeColor:m=g.themeColor,showArrow:l=g.showArrow,arrowIconName:a=g.arrowIconName,hover:u,focus:c,active:N,selected:z,disabled:O,icon:_,text:I,iconClassName:ue,...pe}=t,fe=_!==void 0,xe=t.children!==void 0;return oe("button",{...pe,className:r(t.className,E,f(E,{size:e,rounded:s,fillMode:i,themeColor:m}),P(E,{hover:u,focus:c,active:N,disabled:O,selected:z}),{"k-icon-button":!I&&!xe&&fe}),children:[_&&A(v,{className:r(ue,"k-button-icon"),icon:_}),I?oe(Le,{children:[I&&A("span",{className:"k-button-text",children:I}),t.children]}):t.children&&A("span",{className:"k-button-text",children:t.children}),l&&A("span",{className:"k-menu-button-arrow k-button-arrow",children:A(v,{icon:a})})]})};d.states=Ie;d.options=Pe;d.className=E;d.defaultOptions=g;import{jsx as wt}from"react/jsx-runtime";import{jsx as It}from"react/jsx-runtime";import{jsx as $t}from"react/jsx-runtime";import{jsx as Xt,jsxs as Yt}from"react/jsx-runtime";import{jsx as ne}from"react/jsx-runtime";var se="k-animation-container",Ke=[],$e={},ie={positionMode:"absolute"},b=t=>{let{positionMode:e=ie.positionMode,animationStyle:s,offset:i,...m}=t;return ne("div",{...m,style:{...i,...t.style},className:r(t.className,se,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:ne("div",{className:"k-child-animation-container",style:s,children:t.children})})};b.states=Ke;b.options=$e;b.className=se;b.defaultOptions=ie;import{jsx as re}from"react/jsx-runtime";var ae="k-popup",Ee=[],Re={},le={positionMode:"absolute"},k=t=>{let{offset:e,positionMode:s=le.positionMode,animationStyle:i,...m}=t;return re(b,{positionMode:s,offset:e,animationStyle:i,children:re("div",{...m,className:r(t.className,ae),children:t.children})})};k.states=Ee;k.options=Re;k.className=ae;k.defaultOptions=le;import{Fragment as ko,jsx as xo,jsxs as ho}from"react/jsx-runtime";import{Fragment as Bo,jsx as Co,jsxs as Mo}from"react/jsx-runtime";import{Fragment as X,jsx as w,jsxs as me}from"react/jsx-runtime";var Y="k-timeselector",_e=[],Fe={size:[n.small,n.medium,n.large]},ce={size:n.medium},H=t=>{let{size:e=ce.size,header:s,fastSelection:i,columns:m,focusedColumn:l,...a}=t,u=m.map(function(c,N){let z=!1,O=!0;return c===l&&(z=!0),(N===0||c==="tt")&&(O=!1),w(X,{children:w(D,{type:c,focus:z,separator:O})})});return me("div",{...a,className:r(t.className,Y,f(Y,{size:e})),children:[w(X,{children:s}),w(X,{children:i}),me("div",{className:"k-time-list-container",children:[w("span",{className:"k-time-highlight"}),u]})]})};H.states=_e;H.options=Fe;H.className=Y;H.defaultOptions=ce;var R=H;import{Fragment as De,jsx as T,jsxs as de}from"react/jsx-runtime";var qo=t=>T(k,{children:de(De,{children:[T(R,{columns:["HH","mm","ss","SSS","tt"],focusedColumn:"HH",header:T(L,{title:"13:14:07:189 PM",children:T(d,{fillMode:"flat",className:"k-time-now",children:"Now"})})}),de(p,{alignment:"stretched",className:"k-time-footer",children:[T(d,{className:"k-time-cancel",children:"Cancel"}),T(d,{themeColor:"primary",className:"k-time-accept",children:"Set"})]})]}),...t});export{qo as TimeSelectorAll};