@progress/kendo-react-scheduler
Version:
React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package
46 lines (45 loc) • 1.61 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 { clone as n } from "@progress/kendo-react-common";
import { useControlledState as d } from "../../hooks/useControlledState.mjs";
import { findMaster as M } from "../../utils/index.mjs";
import { DATA_ACTION as c } from "../../constants/index.mjs";
import { useSchedulerFieldsContext as T, useSchedulerDataContext as p } from "../../context/SchedulerContext.mjs";
var _ = /* @__PURE__ */ ((e) => (e.set = "FORM_ITEM_SET", e.setMaster = "FORM_ITEM_SET_MASTER", e.reset = "FORM_ITEM_RESET", e.complete = "FORM_ITEM_COMPLETE", e))(_ || {});
const f = (e, s) => {
const [o, a] = d(...s), m = T(), [l] = p();
return [o, a, (r, E) => {
let t;
switch (r.type) {
case "FORM_ITEM_SET":
t = r.payload;
break;
case "FORM_ITEM_RESET":
t = null;
break;
case "FORM_ITEM_SET_MASTER":
t = n(M(r.payload, m, l));
break;
case "FORM_ITEM_COMPLETE":
e.onDataAction && o && (e.onDataAction.call(void 0, {
type: c.update,
series: e.series,
dataItem: r.payload
}), t = null);
break;
default:
t = o;
break;
}
a(t, E);
}];
};
export {
_ as FORM_ITEM_ACTION,
f as useFormItem
};