@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
28 lines (27 loc) • 1.23 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { getPadding as h, getBorders as p } from "../views/common/utils.mjs";
import { useIsomorphicLayoutEffect as b } from "@progress/kendo-react-common";
const x = (e, f) => {
const { element: u } = e;
b(() => {
if (!u || !u.current)
return;
const o = [], r = [], c = [], s = u.current.querySelectorAll(e.selector);
s.forEach((i) => {
const n = i.getBoundingClientRect().width, t = e.explicitDepth && e.attribute !== void 0 ? i.getAttribute(e.attribute) : 0, d = h(i, !0), l = p(i, !0);
t !== null && ((!c[t] || l > c[t]) && (c[t] = l), (!r[t] || d > r[t]) && (r[t] = d), (!o[t] || n > o[t]) && (o[t] = n));
}), s.forEach((i) => {
const n = e.explicitDepth ? i.getAttribute(e.attribute) : 0;
n !== null && (i.style.minWidth = `${o[n] - r[n] - c[n]}px`);
});
}, f);
};
export {
x as useCellSync
};