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