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.16 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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react");function h(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const p=h(f);function a(t,n,e){const[i,o]=p.useState(n);return p.useEffect(()=>{i!==void 0&&t.current&&o(t.current.offsetWidth)},e),i}function d(t){return typeof t=="string"?Number(t.replace("px","")):t||void 0}function l(t,n,e,i){const o=d(n.popupSettings.width),c=(e.width!==void 0&&d(e.width))!==o,u=i.width!==void 0,s=c?e.width:u?i.width:o,r=d(a(t,s));return c||u?s:r&&o&&r>o?r:o}exports.useDropdownWidth=l;