@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 13.4 kB
JavaScript
var je=Object.create;var ee=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var at=(e,t)=>{for(var o in t)ee(e,o,{get:t[o],enumerable:!0})},Se=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tt(t))!nt.call(e,i)&&i!==o&&ee(e,i,{get:()=>t[i],enumerable:!(s=et(t,i))||s.enumerable});return e};var st=(e,t,o)=>(o=e!=null?je(ot(e)):{},Se(t||!e||!e.__esModule?ee(o,"default",{value:e,enumerable:!0}):o,e)),lt=e=>Se(ee({},"__esModule",{value:!0}),e);var Qt={};at(Qt,{FloatingLabelInputValue:()=>Wt});module.exports=lt(Qt);var l=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?l(...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 x=(e,t)=>l({[`${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"}),k=(e,t)=>{let{valid:o,invalid:s,hover:i,focus:d,checked:p,active:f,selected:u,disabled:h,indeterminate:T,loading:y,empty:K,readonly:A,highlighted:L,...O}=t;return l({"k-valid":o,"k-invalid":s,"k-hover":i,"k-focus":d,"k-checked":p,"k-active":f,"k-selected":u,"k-disabled":h,"k-indeterminate":T&&!p,"k-loading":y,"k-empty":K,"k-readonly":A,"k-highlighted":L},Object.keys(O).reduce((C,g)=>(g.startsWith("k-")?C[g]=O[g]:C[`k-${g}`]=O[g],C),{}))};function Oe(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(s=>[`k-${s}`,!0]))}var r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},c={small:"small",medium:"medium",large:"large",full:"full"},m={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},a={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",generating:"generating",expanded:"expanded"};var pe="floating-label",ke=pe;var F=require("react/jsx-runtime"),de="k-floating-label-container",rt=[n.hover,n.focus,n.valid,n.invalid,n.empty,n.disabled],it={},pt={},_=e=>{let{hover:t,focus:o,disabled:s,invalid:i,valid:d,empty:p,label:f,optional:u,...h}=e;return(0,F.jsxs)("span",{...h,className:l(e.className,de,k(de,{hover:t,focus:o,disabled:s,empty:p,valid:d,invalid:i})),children:[e.children,f&&(0,F.jsxs)("label",{className:"k-floating-label",children:[f,u&&(0,F.jsx)("span",{className:"k-label-optional",children:"(Optional)"})]})]})};_.states=rt;_.options=it;_.className=de;_.defaultOptions=pt;_.moduleName=pe;_.folderName=ke;var Ee=_;var ce="textbox",Ae=ce;var V="input",te=V;var Ce=require("react/jsx-runtime"),oe="k-input",dt=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],ct={size:[r.small,r.medium,r.large],rounded:[c.small,c.medium,c.large,c.full],fillMode:[m.solid,m.flat,m.outline]},ne={size:r.medium,rounded:r.medium,fillMode:m.solid},I=e=>{let{hover:t,focus:o,disabled:s,invalid:i,valid:d,loading:p,readonly:f,size:u=ne.size,rounded:h=ne.rounded,fillMode:T=ne.fillMode,...y}=e;return(0,Ce.jsx)("span",{...y,className:l(e.className,oe,x(oe,{size:u,rounded:h,fillMode:T}),k(oe,{hover:t,focus:o,disabled:s,invalid:i,valid:d,loading:p,readonly:f}))})};I.states=dt;I.options=ct;I.className=oe;I.defaultOptions=ne;I.moduleName=V;I.folderName=te;var _e=require("react/jsx-runtime"),ae="k-picker",mt=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],ut={size:[r.small,r.medium,r.large],rounded:[c.small,c.medium,c.large,c.full],fillMode:[m.solid,m.flat,m.outline]},se={size:r.medium,rounded:c.medium,fillMode:m.solid},P=e=>{let{hover:t,focus:o,disabled:s,invalid:i,valid:d,loading:p,readonly:f,size:u=se.size,rounded:h=se.rounded,fillMode:T=se.fillMode,...y}=e;return(0,_e.jsx)("span",{...y,className:l(e.className,ae,x(ae,{size:u,rounded:h,fillMode:T}),k(ae,{hover:t,focus:o,disabled:s,invalid:i,valid:d,loading:p,readonly:f})),children:e.children})};P.states=mt;P.options=ut;P.className=ae;P.defaultOptions=se;P.moduleName=V;P.folderName=te;var U=require("react/jsx-runtime"),me="k-font-icon",ft=[],xt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},Nt={},$=e=>{let{size:t,themeColor:o,icon:s,rotate:i,flip:d,...p}=e;return s?(0,U.jsx)("span",{...p,className:l(e.className,me,x(me,{size:t}),{[`k-i-${s}`]:s,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):(0,U.jsx)(U.Fragment,{})};$.states=ft;$.options=xt;$.className=me;$.defaultOptions=Nt;var ze=$;var z=require("react/jsx-runtime"),ue="k-svg-icon",bt=[],ht={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},Be={viewBox:"0 0 24 24"},D=e=>{let{size:t,themeColor:o,rotate:s,flip:i,viewBox:d=Be.viewBox,icon:p,...f}=e;if(!p)return(0,z.jsx)(z.Fragment,{});p==="none"&&{...f,className:l(e.className,ue,"k-none")};let u=typeof p=="object"&&p.name&&p.name;return(0,z.jsx)("span",{...f,className:l(e.className,ue,x("k-icon",{size:t}),{[`k-svg-i-${u}`]:u,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,z.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof p=="object"?p.viewBox:d,dangerouslySetInnerHTML:typeof p=="object"?{__html:p.content}:void 0,children:p?void 0:e.children})})};D.states=bt;D.options=ht;D.className=ue;D.defaultOptions=Be;var fe=D;var xe=st(require("@progress/kendo-svg-icons"));var we="icon",He="icons";var S=require("react/jsx-runtime"),le="k-icon",gt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),It=[],Mt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},Ne={viewBox:"0 0 24 24",type:"svg"},N=e=>{let{size:t,themeColor:o,icon:s,type:i=Ne.type,rotate:d,flip:p,viewBox:f=Ne.viewBox,...u}=e;if(!s)return(0,S.jsx)(S.Fragment,{});if(i==="svg"){if(s==="none")return(0,S.jsx)(fe,{...u,className:l(e.className,le),icon:s,size:t});let h=xe[s]?s:gt(`${s}-icon`);return xe[h]?(0,S.jsx)(fe,{...u,className:l(e.className,le),icon:xe[h],size:t,themeColor:o,rotate:d,flip:p,viewBox:f}):(0,S.jsx)(S.Fragment,{})}return(0,S.jsx)(ze,{...u,className:l(e.className,le),icon:s,size:t,themeColor:o,rotate:d,flip:p})};N.states=It;N.options=Mt;N.defaultOptions=Ne;N.className=le;N.moduleName=we;N.folderName=He;var R=require("react/jsx-runtime"),Pe="k-clear-value",Tt=[n.disabled,n.loading,n.readonly],vt={},G=e=>{let{disabled:t,loading:o,readonly:s,value:i}=e;return t||s||o||!i?(0,R.jsx)(R.Fragment,{}):(0,R.jsx)("span",{className:l(e.className,Pe),children:(0,R.jsx)(N,{icon:"x"})})};G.states=Tt;G.options=vt;G.className=Pe;var Re=require("react/jsx-runtime"),be="k-input-inner",yt=[],Lt={},re={type:"text",autocomplete:"off",value:"",placeholder:""},X=e=>{let{value:t=re.value,type:o=re.type,placeholder:s=re.placeholder,autocomplete:i=re.autocomplete,...d}=e;return(0,Re.jsx)("input",{...d,type:o,className:l(e.className,be,x(be,e)),placeholder:s,autoComplete:i,defaultValue:t})};X.states=yt;X.options=Lt;X.className=be;var q=require("react/jsx-runtime"),he="k-input-inner",St=[],Ot={},ge=e=>{let{value:t,placeholder:o,showValue:s,valueIcon:i,valueIconName:d,...p}=e;return(0,q.jsxs)("span",{...p,className:l(e.className,he,x(he,e)),children:[i,!i&&d&&(0,q.jsx)(N,{className:"k-input-value-icon",icon:d}),s&&!t&&o,s&&t&&(0,q.jsx)("span",{className:"k-input-value-text",children:t})]})};ge.states=St;ge.options=Ot;ge.className=he;var Fe=require("react/jsx-runtime"),Ie="k-input-inner",kt=[],Et={},Ke={value:"",placeholder:""},Me=e=>{let{value:t=Ke.value,placeholder:o=Ke.placeholder,rows:s,...i}=e;return(0,Fe.jsx)("textarea",{...i,className:l(e.className,Ie,x(Ie,e)),placeholder:o,rows:s,defaultValue:t})};Me.states=kt;Me.options=Et;Me.className=Ie;var J=require("react/jsx-runtime"),Ve="k-input-loading-icon",At=[n.disabled,n.loading],ie=e=>{let{disabled:t,loading:o}=e;return t||!o?(0,J.jsx)(J.Fragment,{}):(0,J.jsx)("span",{className:l(e.className,Ve,"k-icon k-i-loading")})};ie.states=At;ie.className=Ve;var W=require("react/jsx-runtime"),Ue="k-input-validation-icon",Ct=[n.valid,n.invalid,n.disabled,n.loading],_t={},Q=e=>{let{valid:t,invalid:o,disabled:s,loading:i}=e,d=o?"warning-circle":"check-circle";return s||i||!!!(t||o)?(0,W.jsx)(W.Fragment,{}):(0,W.jsx)(N,{className:l(Ue),icon:d})};Q.states=Ct;Q.options=_t;Q.className=Ue;var Y=require("react/jsx-runtime"),zt="k-input-prefix",Bt={direction:"horizontal"},$e=e=>{let{direction:t=Bt.direction,...o}=e;return e.children?(0,Y.jsx)("span",{...o,className:l(zt,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):(0,Y.jsx)(Y.Fragment,{})};var Z=require("react/jsx-runtime"),wt="k-input-suffix",Ht={direction:"horizontal"},De=e=>{let{direction:t=Ht.direction,...o}=e;return e.children?(0,Z.jsx)("span",{...o,className:l(wt,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):(0,Z.jsx)(Z.Fragment,{})};var Pt=require("react/jsx-runtime");var Rt=require("react/jsx-runtime");var Xe=require("react/jsx-runtime"),Ge="k-input-separator",Kt={direction:"vertical"},Te=e=>{let{direction:t=Kt.direction,...o}=e;return(0,Xe.jsx)("span",{...o,className:l(Ge,e.className,{[`${Ge}-${t}`]:t})})};var b=require("react/jsx-runtime"),qe="k-textbox",Ft=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],Vt={size:[r.small,r.medium,r.large],rounded:[c.small,c.medium,c.large,c.full],fillMode:[m.solid,m.flat,m.outline]},B={showClearButton:!0,showValidationIcon:!0,size:I.defaultOptions.size,rounded:I.defaultOptions.rounded,fillMode:I.defaultOptions.fillMode,separators:!0},E=e=>{let{size:t=B.size,rounded:o=B.rounded,fillMode:s=B.fillMode,separators:i=B.separators,showClearButton:d=B.showClearButton,showValidationIcon:p=B.showValidationIcon,prefix:f,suffix:u,type:h,value:T,placeholder:y,hover:K,focus:A,valid:L,invalid:O,required:C,loading:g,disabled:H,readonly:Le,...Ze}=e;return(0,b.jsxs)(I,{...Ze,size:t,rounded:o,fillMode:s,hover:K,focus:A,valid:L,invalid:O,required:C,loading:g,disabled:H,readonly:Le,className:l(e.className,qe),children:[f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($e,{children:f}),i&&(0,b.jsx)(Te,{})]}),(0,b.jsx)(X,{placeholder:y,value:T,type:h}),p&&(0,b.jsx)(Q,{valid:L,invalid:O,loading:g,disabled:H}),(0,b.jsx)(ie,{loading:g,disabled:H}),d&&(0,b.jsx)(G,{loading:g,disabled:H,readonly:Le,value:T}),u&&(0,b.jsxs)(b.Fragment,{children:[i&&(0,b.jsx)(Te,{}),(0,b.jsx)(De,{children:u})]})]})};E.states=Ft;E.options=Vt;E.className=qe;E.defaultOptions=B;E.moduleName=ce;E.folderName=Ae;var Ut=require("react/jsx-runtime");var We=require("react/jsx-runtime");var ve="button",Qe=ve;var M=require("react/jsx-runtime"),j="k-button",$t=["icon-button"],Dt=[n.hover,n.focus,n.active,n.selected,n.disabled,n.generating],Gt={size:[r.small,r.medium,r.large],rounded:[c.small,c.medium,c.large,c.full],fillMode:[m.solid,m.flat,m.outline,m.clear,m.link],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark,a.inverse]},w={size:r.medium,rounded:c.medium,fillMode:m.solid,themeColor:a.base,showArrow:!1,arrowIconName:"caret-alt-down"},v=e=>{let{size:t=w.size,rounded:o=w.rounded,fillMode:s=w.fillMode,themeColor:i=w.themeColor,showArrow:d=w.showArrow,arrowIconName:p=w.arrowIconName,variant:f,hover:u,focus:h,active:T,selected:y,disabled:K,icon:A,text:L,iconClassName:O,...C}=e,g=A!==void 0,H=e.children!==void 0;return(0,M.jsxs)("button",{...C,className:l(e.className,j,Oe(j,f),x(j,{size:t,rounded:o,fillMode:s,themeColor:i}),k(j,{hover:u,focus:h,active:T,disabled:K,selected:y}),{"k-icon-button":!L&&!H&&g}),children:[A&&(0,M.jsx)(N,{className:l(O,"k-button-icon"),icon:A}),L?(0,M.jsxs)(M.Fragment,{children:[L&&(0,M.jsx)("span",{className:"k-button-text",children:L}),e.children]}):e.children&&(0,M.jsx)("span",{className:"k-button-text",children:e.children}),d&&(0,M.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,M.jsx)(N,{icon:p})})]})};v.states=Dt;v.options=Gt;v.variants=$t;v.className=j;v.defaultOptions=w;v.moduleName=ve;v.folderName=Qe;var Xt=require("react/jsx-runtime");var qt=require("react/jsx-runtime");var Jt=require("react/jsx-runtime");var Ye=require("react/jsx-runtime");var ye=require("react/jsx-runtime"),Wt=e=>(0,ye.jsx)(Ee,{label:"Label",children:(0,ye.jsx)(E,{showClearButton:!1,value:"Value"}),...e});