UNPKG

@progress/kendo-react-scheduler

Version:

React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package

48 lines (47 loc) 2.01 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import * as t from "react"; import { SchedulerItem as h } from "../../items/SchedulerItem.mjs"; import { SchedulerViewItem as g } from "../../items/SchedulerViewItem.mjs"; import { useSchedulerPropsContext as w, useSchedulerGroupsContext as R, useSchedulerFieldsContext as p, useSchedulerDateRangeContext as x } from "../../context/SchedulerContext.mjs"; import { mapItemsToSlots as v } from "../../utils/index.mjs"; import { useSchedulerViewRangesContext as C, useSchedulerViewSlotsContext as z } from "../../context/SchedulerViewContext.mjs"; import { toOccurrences as y } from "../../services/occurrenceService.mjs"; import { toItems as D } from "../../services/itemsService.mjs"; const V = (e) => { const s = C(), { timezone: o } = w(), c = R(), i = p(), r = x(), [d] = z(), S = e.viewItem || u.viewItem, n = t.useMemo( () => y([e.dataItem], { dateRange: r, fields: i, timezone: o }), [e.dataItem, r.start.getTime(), r.end.getTime(), i, o] ), a = t.useMemo( () => D(n, { timezone: o }, { groups: c, ranges: s }), [n, o, c, s] ), f = (d || []).map((m) => m.current.props); return v(a, f), /* @__PURE__ */ t.createElement(t.Fragment, null, a.map((m, I) => { var l; return /* @__PURE__ */ t.createElement( S, { key: I, ...m, format: e.format, item: (l = e.item) != null ? l : u.item, resizeHint: !0, vertical: e.vertical, ignoreIsAllDay: e.ignoreIsAllDay } ); })); }, u = { viewItem: g, item: h }; V.displayName = "KendoReactSchedulerResize"; export { V as SchedulerResize, u as schedulerResizeDefaultProps };