@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12.1 kB
JavaScript
var ke=Object.create;var F=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Me=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var Te=(t,e)=>{for(var n in e)F(t,n,{get:e[n],enumerable:!0})},re=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Me(e))!Oe.call(t,a)&&a!==n&&F(t,a,{get:()=>e[a],enumerable:!(s=Se(e,a))||s.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?ke(Ce(t)):{},re(e||!t||!t.__esModule?F(n,"default",{value:t,enumerable:!0}):n,t)),Be=t=>re(F({},"__esModule",{value:!0}),t);var ot={};Te(ot,{MAP_CLASSNAME:()=>ne,Map:()=>O,default:()=>tt});module.exports=Be(ot);var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((n,s)=>e[s]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(t,e)=>i({[`${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.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"}),V=(t,e)=>{let{valid:n,invalid:s,hover:a,focus:u,checked:m,active:l,selected:C,disabled:N,indeterminate:x,loading:T,empty:g,readonly:G,highlighted:j,..._}=e;return i({"k-valid":n,"k-invalid":s,"k-hover":a,"k-focus":u,"k-checked":m,"k-active":l,"k-selected":C,"k-disabled":N,"k-indeterminate":x&&!m,"k-loading":T,"k-empty":g,"k-readonly":G,"k-highlighted":j},Object.keys(_).reduce((b,A)=>(A.startsWith("k-")?b[A]=_[A]:b[`k-${A}`]=_[A],b),{}))};function ae(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(s=>[`k-${s}`,!0]))}var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},B={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},p={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},v={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},k={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 R=require("react/jsx-runtime"),J="k-font-icon",Ee=[],ze={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},_e={},P=t=>{let{size:e,themeColor:n,icon:s,rotate:a,flip:u,...m}=t;return s?(0,R.jsx)("span",{...m,className:i(t.className,J,y(J,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"}),"aria-hidden":"true"}):(0,R.jsx)(R.Fragment,{})};P.states=Ee;P.options=ze;P.className=J;P.defaultOptions=_e;var se=P;var E=require("react/jsx-runtime"),W="k-svg-icon",we=[],Le={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[v.outline,v.solid,v.duotone]},X={viewBox:"0 0 24 24",variant:v.outline},K=t=>{var T,g;let{size:e,themeColor:n,rotate:s,flip:a,viewBox:u=X.viewBox,variant:m=X.variant,icon:l,...C}=t;if(!l)return(0,E.jsx)(E.Fragment,{});if(l==="none")return(0,E.jsx)("span",{...C,className:i(t.className,W,y("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let N=typeof l=="object"&&l.name&&l.name,x=typeof l=="object"?m&&((T=l.variants)==null?void 0:T[m])||((g=l.variants)==null?void 0:g.outline)||l.content:void 0;return(0,E.jsx)("span",{...C,className:i(t.className,W,y("k-icon",{size:e}),{[`k-svg-i-${N}`]:N,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:(0,E.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:u,dangerouslySetInnerHTML:x!==void 0?{__html:x}:void 0,children:l?void 0:t.children})})};K.states=we;K.options=Le;K.className=W;K.defaultOptions=X;var Q=K;var Y=Ae(require("@progress/kendo-svg-icons"));var ie="icon",le="icons";var ue=require("react");var ce=require("react"),de=(0,ce.createContext)({iconsType:"svg"});var S=require("react/jsx-runtime"),Z="k-icon",Ie=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Re=[],Pe={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[v.outline,v.solid,v.duotone]},q={viewBox:"0 0 24 24",type:"svg",variant:v.outline},h=t=>{let{iconsType:e}=(0,ue.useContext)(de),{size:n,themeColor:s,icon:a,type:u=e||q.type,rotate:m,flip:l,viewBox:C=q.viewBox,variant:N=q.variant,...x}=t;if(!a)return(0,S.jsx)(S.Fragment,{});if((e||u)==="svg"){if(a==="none")return(0,S.jsx)(Q,{...x,className:i(t.className,Z),icon:a,size:n,variant:N});let g=Y[a]?a:Ie(`${a}-icon`);return Y[g]?(0,S.jsx)(Q,{...x,className:i(t.className,Z),icon:Y[g],size:n,themeColor:s,rotate:m,flip:l,viewBox:C,variant:N}):(0,S.jsx)(S.Fragment,{})}return(0,S.jsx)(se,{...x,className:i(t.className,Z),icon:a,size:n,themeColor:s,rotate:m,flip:l})};h.states=Re;h.options=Pe;h.defaultOptions=q;h.className=Z;h.moduleName=ie;h.folderName=le;h.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};var ee="button",me=ee;var f=require("react/jsx-runtime"),U="k-button",Ke=["icon-button"],Ue=[k.hover,k.focus,k.active,k.selected,k.disabled,k.generating],He={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[B.undefined,B.none,B.small,B.medium,B.large,B.full],fillMode:[p.undefined,p.solid,p.flat,p.outline,p.clear,p.link],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.inverse]},te={showArrow:!1,arrowIconName:"chevron-down"},d=t=>{let{as:e="button",size:n,rounded:s,fillMode:a,themeColor:u,showArrow:m=te.showArrow,arrowIconName:l=te.arrowIconName,variant:C,hover:N,focus:x,active:T,selected:g,disabled:G,togglable:j,ariaDisabled:_,icon:b,iconSize:A,text:$,iconClassName:xe,className:ge,...ve}=t,Ne=b!=null,ye=t.children!==void 0;return(0,f.jsxs)(e,{className:i(ge,U,ae(U,C),y(U,{size:n,rounded:s,fillMode:a,themeColor:u}),V(U,{hover:N,focus:x,active:T,disabled:G||_,selected:g}),{"k-icon-button":!$&&!ye&&Ne}),"aria-pressed":j?g?"true":"false":void 0,...ve,"aria-disabled":_?"true":void 0,disabled:G||void 0,children:[typeof b=="string"&&b&&(0,f.jsx)(h,{className:i(xe,"k-button-icon"),icon:b,size:A}),b&&typeof b!="string"&&(0,f.jsx)(f.Fragment,{children:b}),$?(0,f.jsxs)(f.Fragment,{children:[$&&(0,f.jsx)("span",{className:"k-button-text",children:$}),t.children]}):t.children&&(0,f.jsx)("span",{className:"k-button-text",children:t.children}),m&&(0,f.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,f.jsx)(h,{icon:l})})]})};d.states=Ue;d.options=He;d.variants=Ke;d.className=U;d.defaultOptions=te;d.moduleName=ee;d.folderName=me;d.ariaSpec={selector:".k-button",rules:[{selector:".k-button",attribute:"role=button or nodeName=button",usage:"The button role is implicit from the native <button> element."},{selector:".k-button",attribute:"aria-label (when icon-only)",usage:"Required for icon-only buttons that have no visible text."},{selector:".k-button",attribute:"aria-pressed (when togglable)",usage:"Indicates the pressed state of a toggle button."},{selector:".k-button",attribute:"disabled (when disabled)",usage:"Rendered when the button is disabled."}]};var z=require("react/jsx-runtime"),pe="k-navigator",De=[],Ge={},$e={},w=t=>{let{...e}=t;return(0,z.jsxs)("div",{...e,className:i(t.className,pe),children:[(0,z.jsx)(d,{className:"k-navigator-n",icon:"chevron-up",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan north"}),(0,z.jsx)(d,{className:"k-navigator-e",icon:"chevron-right",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan east"}),(0,z.jsx)(d,{className:"k-navigator-s",icon:"chevron-down",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan south"}),(0,z.jsx)(d,{className:"k-navigator-w",icon:"chevron-left",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan west"})]})};w.states=De;w.options=Ge;w.className=pe;w.defaultOptions=$e;var oe="button",fe=oe;var be=require("react/jsx-runtime"),H="k-button-group",Fe=[k.disabled],Ve={fillMode:[p.undefined,p.solid,p.flat,p.outline,p.clear,p.link]},Ze={},M=t=>{let{fillMode:e,disabled:n,stretched:s,...a}=t;return(0,be.jsx)("div",{role:"group",...a,className:i(t.className,H,y(H,{fillMode:e}),V(H,{disabled:n}),{[`${H}-stretched`]:s}),...n&&{"aria-disabled":"true"},children:t.children})};M.states=Fe;M.options=Ve;M.className=H;M.defaultOptions=Ze;M.moduleName=oe;M.folderName=fe;M.ariaSpec={selector:".k-button-group",rules:[{selector:".k-button-group:not(.k-split-button)",attribute:"role=group",usage:"Sets the proper role for the group of buttons."},{selector:".k-button-group.k-disabled",attribute:"aria-disabled=true",usage:"The attribute is rendered only when the entire button group is disabled."},{selector:".k-button-group:not(.k-split-button):not(.k-scheduler-navigation):not(.k-zoom-control) .k-button",attribute:"aria-pressed (when selected)",usage:"Specifies the current state of the ButtonGroup. Only the selected button within the group will have this attribute set to true."}]};var D=require("react/jsx-runtime"),he="k-zoom-control",qe=[],je={},Je={},L=t=>{let{...e}=t;return(0,D.jsxs)(M,{...e,className:i(t.className,"k-group-horizontal",he),children:[(0,D.jsx)(d,{icon:"plus",className:"k-zoom-in","aria-label":"Zoom in"}),(0,D.jsx)(d,{icon:"minus",className:"k-zoom-out","aria-label":"Zoom out"})]})};L.states=qe;L.options=je;L.className=he;L.defaultOptions=Je;var c=require("react/jsx-runtime"),ne="k-map",Qe=[],Ye={},et=(0,c.jsxs)(c.Fragment,{children:["\xA9 ",(0,c.jsx)("a",{href:"#",children:"Attribution"})]}),I={attribution:et,markerStyle:{zIndex:"1000",left:"500px",top:"300px"},scrollContainerStyle:{transformOrigin:"left top 0px"},horizontalScrollbarStyle:{transformOrigin:"left top 0px",width:"24px"},verticalScrollbarStyle:{transformOrigin:"left top 0px",height:"239px"}},O=t=>{let{attribution:e=I.attribution,markerStyle:n=I.markerStyle,scrollContainerStyle:s=I.scrollContainerStyle,horizontalScrollbarStyle:a=I.horizontalScrollbarStyle,verticalScrollbarStyle:u=I.verticalScrollbarStyle,children:m,...l}=t;return(0,c.jsxs)("div",{...l,className:i(t.className,ne),children:[(0,c.jsxs)("div",{className:"km-scroll-wrapper",style:{overflow:"hidden"},children:[(0,c.jsx)("div",{className:"km-scroll-header"}),(0,c.jsxs)("div",{className:"km-scroll-container",style:s,children:[(0,c.jsx)("div",{className:"k-layer",style:{zIndex:"1000"},children:(0,c.jsx)(h,{className:"k-marker",icon:"map-marker-target",size:"xxlarge",style:n})}),(0,c.jsx)("div",{className:"k-layer",children:m})]}),(0,c.jsx)("div",{className:"km-touch-scrollbar km-horizontal-scrollbar",style:a}),(0,c.jsx)("div",{className:"km-touch-scrollbar km-vertical-scrollbar",style:u})]}),(0,c.jsx)("div",{className:"k-map-controls k-bottom-end",children:(0,c.jsx)("div",{className:"k-attribution",children:e})}),(0,c.jsxs)("div",{className:"k-map-controls k-top-start",children:[(0,c.jsx)(w,{}),(0,c.jsx)(L,{})]})]})};O.states=Qe;O.options=Ye;O.className=ne;O.defaultOptions=I;O.moduleName="map";O.folderName="map";var tt=O;