UNPKG

@progress/kendo-react-dropdowns

Version:

React DropDowns offer an interface for users to select different items from a list and more. KendoReact Dropdowns package

9 lines (8 loc) 1.42 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";const f=require("react"),m=require("@progress/kendo-react-buttons");function g(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const s=g(f),v=e=>e.syntheticEvent.preventDefault(),h=e=>e.syntheticEvent.stopPropagation();class y extends s.Component{render(){const{data:o,guid:n,focused:r,tagRender:c,tag:i,onTagDelete:l,size:p}=this.props;return s.createElement(s.Fragment,null,o.map((t,a)=>{const u=i?s.createElement(i,{key:t.text+a,tagData:t,guid:n,focusedTag:r,onTagDelete:l}):s.createElement(m.Chip,{id:`tag-${n}-${t.text.replace(/\s+/g,"-")}`,"aria-selected":!0,role:"option","aria-setsize":o.length,key:t.text+a,text:t.text,removable:!0,onRemove:d=>l.call(void 0,t.data,d.syntheticEvent),onMouseDown:v,onClick:h,className:t===r?"k-focus":void 0,size:p});return c?c(t,u):u}),this.props.children)}}module.exports=y;