@progress/kendo-react-dateinputs
Version:
React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package
40 lines (39 loc) • 1.6 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 { domContainerFactory as s } from "../../utils.mjs";
import { canUseDOM as C, strippedClassNames as i, uTime as e } from "@progress/kendo-react-common";
class y {
constructor() {
this.itemHeight = 0, this.timeListHeight = 0, this.didCalculate = !1;
}
ensureHeights() {
this.timeListHeight === void 0 && this.calculateHeights();
}
calculateHeights(c, n) {
if (!C)
return;
const t = n && n.uTime, o = s("div"), p = s("span"), u = s("ul"), h = s("li"), m = () => h("<span>02</span>", i(e.li({ c: t }))), d = () => u([m()], i(e.ul({ c: t }))), f = () => o(
[d()],
i(
e.containerSelector({ c: t }),
e.container({ c: t, content: !0, scrollable: !0 })
)
), g = o(
[
p("minute", i(e.title({ c: t }))),
o([f()], i(e.list({ c: t })))
],
i(e.listWrapper({ c: t })),
{ left: "-10000px", position: "absolute" }
), l = `.${i(e.containerSelector({ c: t }))}`, a = c && c.querySelector(l) || document.body, r = a.appendChild(g);
this.timeListHeight = r.querySelector(l).offsetHeight, this.itemHeight = r.querySelector("li").offsetHeight, a.removeChild(r), this.didCalculate = !0;
}
}
export {
y as DOMService
};