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