UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 16.4 kB
var Tt=Object.create;var ne=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var St=Object.getOwnPropertyNames;var It=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var bt=(e,t)=>{for(var o in t)ne(e,o,{get:t[o],enumerable:!0})},ze=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of St(t))!At.call(e,l)&&l!==o&&ne(e,l,{get:()=>t[l],enumerable:!(s=ht(t,l))||s.enumerable});return e};var kt=(e,t,o)=>(o=e!=null?Tt(It(e)):{},ze(t||!e||!e.__esModule?ne(o,"default",{value:e,enumerable:!0}):o,e)),vt=e=>ze(ne({},"__esModule",{value:!0}),e);var Ao={};bt(Ao,{TIMEDURATIONPICKER_CLASSNAME:()=>Be,TimeDurationPicker:()=>B,default:()=>Io});module.exports=vt(Ao);var n=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?n(...t):typeof t=="object"?Object.keys(t).map((o,s)=>t[s]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var M=(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"}),_=(e,t)=>{let{valid:o,invalid:s,hover:l,focus:m,checked:c,active:x,selected:p,disabled:S,indeterminate:I,loading:A,empty:$,readonly:O,highlighted:v,...P}=t;return n({"k-valid":o,"k-invalid":s,"k-hover":l,"k-focus":m,"k-checked":c,"k-active":x,"k-selected":p,"k-disabled":S,"k-indeterminate":I&&!c,"k-loading":A,"k-empty":$,"k-readonly":O,"k-highlighted":v},Object.keys(P).reduce((z,C)=>(C.startsWith("k-")?z[C]=P[C]:z[`k-${C}`]=P[C],z),{}))};function Ke(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.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 V="input",se=V;var De=require("react/jsx-runtime"),ae="k-input",gt=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],Et={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline]},re={size:a.medium,rounded:a.medium,fillMode:u.solid},g=e=>{let{hover:t,focus:o,disabled:s,invalid:l,valid:m,loading:c,readonly:x,size:p=re.size,rounded:S=re.rounded,fillMode:I=re.fillMode,...A}=e;return(0,De.jsx)("span",{...A,className:n(e.className,ae,M(ae,{size:p,rounded:S,fillMode:I}),_(ae,{hover:t,focus:o,disabled:s,invalid:l,valid:m,loading:c,readonly:x}))})};g.states=gt;g.options=Et;g.className=ae;g.defaultOptions=re;g.moduleName=V;g.folderName=se;var we=require("react/jsx-runtime"),ie="k-picker",yt=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],Ot={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline]},le={size:a.medium,rounded:d.medium,fillMode:u.solid},w=e=>{let{hover:t,focus:o,disabled:s,invalid:l,valid:m,loading:c,readonly:x,size:p=le.size,rounded:S=le.rounded,fillMode:I=le.fillMode,...A}=e;return(0,we.jsx)("span",{...A,className:n(e.className,ie,M(ie,{size:p,rounded:S,fillMode:I}),_(ie,{hover:t,focus:o,disabled:s,invalid:l,valid:m,loading:c,readonly:x})),children:e.children})};w.states=yt;w.options=Ot;w.className=ie;w.defaultOptions=le;w.moduleName=V;w.folderName=se;var q=require("react/jsx-runtime"),fe="k-font-icon",Ct=[],Lt={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]},Pt={},G=e=>{let{size:t,themeColor:o,icon:s,rotate:l,flip:m,...c}=e;return s?(0,q.jsx)("span",{...c,className:n(e.className,fe,M(fe,{size:t}),{[`k-i-${s}`]:s,[`k-color-${o}`]:o,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):(0,q.jsx)(q.Fragment,{})};G.states=Ct;G.options=Lt;G.className=fe;G.defaultOptions=Pt;var Ue=G;var K=require("react/jsx-runtime"),Ne="k-svg-icon",_t=[],Ht={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]},Fe={viewBox:"0 0 24 24"},J=e=>{let{size:t,themeColor:o,rotate:s,flip:l,viewBox:m=Fe.viewBox,icon:c,...x}=e;if(!c)return(0,K.jsx)(K.Fragment,{});c==="none"&&{...x,className:n(e.className,Ne,"k-none")};let p=typeof c=="object"&&c.name&&c.name;return(0,K.jsx)("span",{...x,className:n(e.className,Ne,M("k-icon",{size:t}),{[`k-svg-i-${p}`]:p,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:(0,K.jsx)("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})})};J.states=_t;J.options=Ht;J.className=Ne;J.defaultOptions=Fe;var xe=J;var Me=kt(require("@progress/kendo-svg-icons"));var $e="icon",Ve="icons";var L=require("react/jsx-runtime"),me="k-icon",Rt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Bt=[],zt={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]},Te={viewBox:"0 0 24 24",type:"svg"},h=e=>{let{size:t,themeColor:o,icon:s,type:l=Te.type,rotate:m,flip:c,viewBox:x=Te.viewBox,...p}=e;if(!s)return(0,L.jsx)(L.Fragment,{});if(l==="svg"){if(s==="none")return(0,L.jsx)(xe,{...p,className:n(e.className,me),icon:s,size:t});let S=Me[s]?s:Rt(`${s}-icon`);return Me[S]?(0,L.jsx)(xe,{...p,className:n(e.className,me),icon:Me[S],size:t,themeColor:o,rotate:m,flip:c,viewBox:x}):(0,L.jsx)(L.Fragment,{})}return(0,L.jsx)(Ue,{...p,className:n(e.className,me),icon:s,size:t,themeColor:o,rotate:m,flip:c})};h.states=Bt;h.options=zt;h.defaultOptions=Te;h.className=me;h.moduleName=$e;h.folderName=Ve;var U=require("react/jsx-runtime"),qe="k-clear-value",Kt=[r.disabled,r.loading,r.readonly],Dt={},X=e=>{let{disabled:t,loading:o,readonly:s,value:l}=e;return t||s||o||!l?(0,U.jsx)(U.Fragment,{}):(0,U.jsx)("span",{className:n(e.className,qe),children:(0,U.jsx)(h,{icon:"x"})})};X.states=Kt;X.options=Dt;X.className=qe;var Ge=require("react/jsx-runtime"),he="k-input-inner",wt=[],Ut={},ce={type:"text",autocomplete:"off",value:"",placeholder:""},W=e=>{let{value:t=ce.value,type:o=ce.type,placeholder:s=ce.placeholder,autocomplete:l=ce.autocomplete,...m}=e;return(0,Ge.jsx)("input",{...m,type:o,className:n(e.className,he,M(he,e)),placeholder:s,autoComplete:l,defaultValue:t})};W.states=wt;W.options=Ut;W.className=he;var Y=require("react/jsx-runtime"),Se="k-input-inner",Ft=[],$t={},Ie=e=>{let{value:t,placeholder:o,showValue:s,valueIcon:l,valueIconName:m,...c}=e;return(0,Y.jsxs)("span",{...c,className:n(e.className,Se,M(Se,e)),children:[l,!l&&m&&(0,Y.jsx)(h,{className:"k-input-value-icon",icon:m}),s&&!t&&o,s&&t&&(0,Y.jsx)("span",{className:"k-input-value-text",children:t})]})};Ie.states=Ft;Ie.options=$t;Ie.className=Se;var Xe=require("react/jsx-runtime"),Ae="k-input-inner",Vt=[],qt={},Je={value:"",placeholder:""},be=e=>{let{value:t=Je.value,placeholder:o=Je.placeholder,rows:s,...l}=e;return(0,Xe.jsx)("textarea",{...l,className:n(e.className,Ae,M(Ae,e)),placeholder:o,rows:s,defaultValue:t})};be.states=Vt;be.options=qt;be.className=Ae;var Q=require("react/jsx-runtime"),We="k-input-loading-icon",Gt=[r.disabled,r.loading],pe=e=>{let{disabled:t,loading:o}=e;return t||!o?(0,Q.jsx)(Q.Fragment,{}):(0,Q.jsx)("span",{className:n(e.className,We,"k-icon k-i-loading")})};pe.states=Gt;pe.className=We;var Z=require("react/jsx-runtime"),Ye="k-input-validation-icon",Jt=[r.valid,r.invalid,r.disabled,r.loading],Xt={},j=e=>{let{valid:t,invalid:o,disabled:s,loading:l}=e,m=o?"warning-circle":"check-circle";return s||l||!!!(t||o)?(0,Z.jsx)(Z.Fragment,{}):(0,Z.jsx)(h,{className:n(Ye),icon:m})};j.states=Jt;j.options=Xt;j.className=Ye;var ee=require("react/jsx-runtime"),Wt="k-input-prefix",Yt={direction:"horizontal"},Qe=e=>{let{direction:t=Yt.direction,...o}=e;return e.children?(0,ee.jsx)("span",{...o,className:n(Wt,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):(0,ee.jsx)(ee.Fragment,{})};var te=require("react/jsx-runtime"),Qt="k-input-suffix",Zt={direction:"horizontal"},Ze=e=>{let{direction:t=Zt.direction,...o}=e;return e.children?(0,te.jsx)("span",{...o,className:n(Qt,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):(0,te.jsx)(te.Fragment,{})};var jt=require("react/jsx-runtime");var eo=require("react/jsx-runtime");var to=require("react/jsx-runtime");var ke="button",je=ke;var E=require("react/jsx-runtime"),oe="k-button",oo=["icon-button"],no=[r.hover,r.focus,r.active,r.selected,r.disabled,r.generating],so={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]},D={size:a.medium,rounded:d.medium,fillMode:u.solid,themeColor:i.base,showArrow:!1,arrowIconName:"caret-alt-down"},f=e=>{let{size:t=D.size,rounded:o=D.rounded,fillMode:s=D.fillMode,themeColor:l=D.themeColor,showArrow:m=D.showArrow,arrowIconName:c=D.arrowIconName,variant:x,hover:p,focus:S,active:I,selected:A,disabled:$,icon:O,text:v,iconClassName:P,...z}=e,C=O!==void 0,Mt=e.children!==void 0;return(0,E.jsxs)("button",{...z,className:n(e.className,oe,Ke(oe,x),M(oe,{size:t,rounded:o,fillMode:s,themeColor:l}),_(oe,{hover:p,focus:S,active:I,disabled:$,selected:A}),{"k-icon-button":!v&&!Mt&&C}),children:[O&&(0,E.jsx)(h,{className:n(P,"k-button-icon"),icon:O}),v?(0,E.jsxs)(E.Fragment,{children:[v&&(0,E.jsx)("span",{className:"k-button-text",children:v}),e.children]}):e.children&&(0,E.jsx)("span",{className:"k-button-text",children:e.children}),m&&(0,E.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,E.jsx)(h,{icon:c})})]})};f.states=no;f.options=so;f.variants=oo;f.className=oe;f.defaultOptions=D;f.moduleName=ke;f.folderName=je;var ao=require("react/jsx-runtime");var ro=require("react/jsx-runtime");var io=require("react/jsx-runtime");var ve="popup",et=ve;var ge=require("react/jsx-runtime"),tt="k-animation-container",lo=[],mo={},ot={positionMode:"absolute"},H=e=>{let{positionMode:t=ot.positionMode,animationStyle:o,offset:s,...l}=e;return(0,ge.jsx)("div",{...l,style:{...s,...e.style},className:n(e.className,tt,"k-animation-container-shown",{"k-animation-container-fixed":t==="fixed"}),children:(0,ge.jsx)("div",{className:"k-child-animation-container",style:o,children:e.children})})};H.states=lo;H.options=mo;H.className=tt;H.defaultOptions=ot;H.moduleName=ve;H.folderName=et;var Ee="popup",nt=Ee;var ye=require("react/jsx-runtime"),st="k-popup",co=[],po={},at={positionMode:"absolute"},y=e=>{let{offset:t,positionMode:o=at.positionMode,animationStyle:s,...l}=e;return(0,ye.jsx)(H,{positionMode:o,offset:t,animationStyle:s,children:(0,ye.jsx)("div",{...l,className:n(e.className,st),children:e.children})})};y.states=co;y.options=po;y.className=st;y.defaultOptions=at;y.moduleName=Ee;y.folderName=nt;var rt="time-selector",it="timeselector";var b=require("react/jsx-runtime"),Oe="k-timeselector",uo=[],fo={size:[a.small,a.medium,a.large]},lt={size:a.medium},R=e=>{let{size:t=lt.size,header:o,fastSelection:s,columns:l,focusedColumn:m,...c}=e,x=l.map(function(p,S){let I=!1,A=!0;return p===m&&(I=!0),(S===0||p==="tt")&&(A=!1),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(Ce,{type:p,focus:I,separator:A})})});return(0,b.jsxs)("div",{...c,className:n(e.className,Oe,M(Oe,{size:t})),children:[(0,b.jsx)(b.Fragment,{children:o}),(0,b.jsx)(b.Fragment,{children:s}),(0,b.jsxs)("div",{className:"k-time-list-container",children:[(0,b.jsx)("span",{className:"k-time-highlight"}),x]})]})};R.states=uo;R.options=fo;R.className=Oe;R.defaultOptions=lt;R.moduleName=rt;R.folderName=it;var T=require("react/jsx-runtime"),No=[r.focus],Ce=e=>{let{type:t,focus:o,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 x=c.map(p=>(0,T.jsx)(T.Fragment,{children:(0,T.jsx)("li",{className:"k-item",children:(0,T.jsx)("span",{children:p})})}));return(0,T.jsxs)(T.Fragment,{children:[s&&(0,T.jsx)("div",{className:"k-time-separator",children:":"}),(0,T.jsxs)("div",{...l,className:n(e.className,"k-time-list-wrapper",_("k-time-list-wrapper",{focus:o})),children:[(0,T.jsx)("span",{className:"k-title",children:m}),(0,T.jsx)("div",{className:"k-time-list",children:(0,T.jsxs)("div",{className:"k-content k-scrollable k-time-container",children:[(0,T.jsx)("ul",{className:"k-reset",style:{transform:"translateY(97px)"},children:x}),(0,T.jsx)("div",{className:"k-scrollable-placeholder"})]})})]})]})};Ce.states=No;var mt=require("react/jsx-runtime");var Le="action-buttons",ct=Le;var pt=require("react/jsx-runtime"),de="k-actions",xo=[],Mo={},Pe={alignment:"start",orientation:"horizontal"},k=e=>{let{alignment:t=Pe.alignment,orientation:o=Pe.orientation,...s}=e;return(0,pt.jsx)("div",{...s,className:n(de,{[`${de}-${t}`]:t,[`${de}-${o}`]:o},e.className),children:e.children})};k.states=xo;k.options=Mo;k.className=de;k.defaultOptions=Pe;k.moduleName=Le;k.folderName=ct;var F=require("react/jsx-runtime"),To="k-time-fast-selection",dt=e=>{let{...t}=e;return(0,F.jsxs)(k,{...t,alignment:"start",className:n(e.className,To),children:[(0,F.jsx)(f,{children:"1 d"}),(0,F.jsx)(f,{children:"1 h"}),(0,F.jsx)(f,{children:"15 m"})]})};var _e=require("react/jsx-runtime");var He=require("react/jsx-runtime");var Re=require("react/jsx-runtime");var Nt="time-duration-picker",xt="timedurationpicker";var N=require("react/jsx-runtime"),Be="k-timedurationpicker",ho=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.readonly],So={size:[a.small,a.medium,a.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[u.solid,u.flat,u.outline]},ue={size:g.defaultOptions.size,rounded:g.defaultOptions.rounded,fillMode:g.defaultOptions.fillMode},B=e=>{let{size:t=ue.size,rounded:o=ue.rounded,fillMode:s=ue.fillMode,prefix:l,suffix:m,value:c,placeholder:x,hover:p,focus:S,valid:I,invalid:A,required:$,loading:O,disabled:v,readonly:P,opened:z,...C}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(g,{...C,size:t,rounded:o,fillMode:s,hover:p,focus:S,valid:I,invalid:A,required:$,loading:O,disabled:v,readonly:P,className:n(e.className,Be),children:[(0,N.jsx)(Qe,{children:l}),(0,N.jsx)(W,{placeholder:x,value:c}),(0,N.jsx)(j,{valid:I,invalid:A,loading:O,disabled:v}),(0,N.jsx)(pe,{loading:O,disabled:v}),(0,N.jsx)(X,{loading:O,disabled:v,readonly:P,value:c}),(0,N.jsx)(Ze,{children:m}),(0,N.jsx)(f,{className:"k-input-button",icon:"clock-arrow-rotate",rounded:null,size:t,fillMode:s})]}),z&&(0,N.jsxs)(y,{className:"k-timedurationpicker-popup",children:[(0,N.jsx)(R,{columns:["dd","HH","mm"],focusedColumn:"HH",fastSelection:(0,N.jsx)(dt,{})}),(0,N.jsxs)(k,{alignment:"stretched",className:"k-timeduration-footer",children:[(0,N.jsx)(f,{className:"k-time-cancel",children:"Cancel"}),(0,N.jsx)(f,{themeColor:"primary",className:"k-time-accept",children:"Set"})]})]})]})};B.states=ho;B.options=So;B.className=Be;B.defaultOptions=ue;B.moduleName=Nt;B.folderName=xt;var Io=B;