@progress/kendo-react-scheduler 16.3.0-develop.9 → 16.4.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +19 -19
- package/Scheduler.d.ts +46 -0
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +322 -297
- package/components/EventOverviewPopover.d.ts +36 -0
- package/components/EventOverviewPopover.js +8 -0
- package/components/EventOverviewPopover.mjs +133 -0
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +40 -39
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +7 -6
- package/components/SchedulerQuickCreateForm.d.ts +63 -0
- package/components/SchedulerQuickCreateForm.js +8 -0
- package/components/SchedulerQuickCreateForm.mjs +144 -0
- package/components/ShowMoreItemsButton.js +1 -1
- package/components/ShowMoreItemsButton.mjs +1 -1
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/editors/KeepResetCustomEventsDialog.d.ts +19 -0
- package/editors/KeepResetCustomEventsDialog.js +8 -0
- package/editors/KeepResetCustomEventsDialog.mjs +34 -0
- package/editors/SchedulerFormEditor.d.ts +18 -4
- package/editors/SchedulerFormEditor.js +1 -1
- package/editors/SchedulerFormEditor.mjs +273 -238
- package/editors/SchedulerRecurrenceDialog.js +1 -1
- package/editors/SchedulerRecurrenceDialog.mjs +142 -135
- package/editors/ZonedSplitDateTime.d.ts +30 -0
- package/editors/ZonedSplitDateTime.js +1 -1
- package/editors/ZonedSplitDateTime.mjs +58 -47
- package/hooks/index.d.ts +4 -0
- package/hooks/useCloseOnAnchorScrollOut.d.ts +18 -0
- package/hooks/useCloseOnAnchorScrollOut.js +8 -0
- package/hooks/useCloseOnAnchorScrollOut.mjs +51 -0
- package/hooks/useDeferredClick.d.ts +26 -0
- package/hooks/useDeferredClick.js +8 -0
- package/hooks/useDeferredClick.mjs +24 -0
- package/hooks/useEventOverviewPlacement.d.ts +23 -0
- package/hooks/useEventOverviewPlacement.js +8 -0
- package/hooks/useEventOverviewPlacement.mjs +14 -0
- package/hooks/useQuickCreatePlacement.d.ts +26 -0
- package/hooks/useQuickCreatePlacement.js +8 -0
- package/hooks/useQuickCreatePlacement.mjs +28 -0
- package/hooks/useSlotExpand.d.ts +2 -1
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +107 -49
- package/index.d.mts +3 -1
- package/index.d.ts +3 -1
- package/index.js +1 -1
- package/index.mjs +112 -107
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +600 -509
- package/items/SchedulerItem.d.ts +2 -0
- package/items/SchedulerItem.js +1 -1
- package/items/SchedulerItem.mjs +137 -130
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +95 -91
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +168 -157
- package/items/hooks/use-drag-item.js +1 -1
- package/items/hooks/use-drag-item.mjs +46 -45
- package/items/hooks/use-resize-item.d.ts +1 -0
- package/items/hooks/use-resize-item.js +1 -1
- package/items/hooks/use-resize-item.mjs +84 -78
- package/messages/index.d.ts +33 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +158 -136
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
- package/recurrence/RecurrenceEditor.js +1 -1
- package/recurrence/RecurrenceEditor.mjs +64 -64
- package/recurrence/common.d.ts +10 -0
- package/recurrence/common.js +1 -1
- package/recurrence/common.mjs +48 -44
- package/services/itemsService.d.ts +5 -2
- package/services/itemsService.js +1 -1
- package/services/itemsService.mjs +36 -36
- package/slots/SchedulerEditSlot.d.ts +15 -0
- package/slots/SchedulerEditSlot.js +1 -1
- package/slots/SchedulerEditSlot.mjs +162 -92
- package/slots/SchedulerViewSlot.js +1 -1
- package/slots/SchedulerViewSlot.mjs +7 -7
- package/utils/index.d.ts +2 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +103 -99
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +32 -30
- package/views/common/SchedulerDrag.js +1 -1
- package/views/common/SchedulerDrag.mjs +26 -23
- package/views/common/SchedulerResize.js +1 -1
- package/views/common/SchedulerResize.mjs +29 -26
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +160 -152
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PopoverPosition, PopoverCollision } from '@progress/kendo-react-tooltip';
|
|
9
|
+
import { DataItem } from '../models/index.js';
|
|
10
|
+
import { Fields } from '../models/Fields';
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
export interface EventOverviewPopoverProps {
|
|
16
|
+
show: boolean;
|
|
17
|
+
anchor: HTMLElement | null;
|
|
18
|
+
dataItem: DataItem;
|
|
19
|
+
fields: Fields;
|
|
20
|
+
position: PopoverPosition;
|
|
21
|
+
collision: PopoverCollision;
|
|
22
|
+
isRecurring: boolean;
|
|
23
|
+
canEdit: boolean;
|
|
24
|
+
canRemove: boolean;
|
|
25
|
+
onEdit: () => void;
|
|
26
|
+
onEditOccurrence: () => void;
|
|
27
|
+
onEditSeries: () => void;
|
|
28
|
+
onDelete: () => void;
|
|
29
|
+
onDeleteOccurrence: () => void;
|
|
30
|
+
onDeleteSeries: () => void;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
export declare const EventOverviewPopover: React.FC<EventOverviewPopoverProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("react"),$=require("@progress/kendo-react-tooltip"),A=require("@progress/kendo-react-common"),k=require("@progress/kendo-react-buttons"),x=require("@progress/kendo-react-form"),z=require("@progress/kendo-react-labels"),N=require("@progress/kendo-react-intl"),B=require("@progress/kendo-date-math"),_=require("@progress/kendo-svg-icons"),f=require("../utils/index.js"),ne=require("../hooks/useCloseOnAnchorScrollOut.js"),t=require("../messages/index.js"),re=require("../context/SchedulerContext.js");function ce(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const s in i)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(c,s,l.get?l:{enumerable:!0,get:()=>i[s]})}}return c.default=i,Object.freeze(c)}const e=ce(oe),d={skeleton:"MMMMd"},S="t",se=360,j=i=>{const{show:c,anchor:s,dataItem:l,fields:g,position:K,collision:W,isRecurring:M,canEdit:v,canRemove:D,onEdit:H,onEditOccurrence:C,onEditSeries:P,onDelete:Y,onDeleteOccurrence:F,onDeleteSeries:I,onClose:p}=i,r=N.useInternationalization(),a=N.useLocalization(),{timezone:h}=re.useSchedulerPropsContext(),u=e.useRef(null);e.useEffect(()=>{if(!c)return;const o=n=>{const b=n.target,m=u.current&&u.current.element&&u.current.element.closest(".k-popover"),E=m?m.contains(b):!1,te=s?s.contains(b):!1;!E&&!te&&p()};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[c,s,p]),ne.useCloseOnAnchorScrollOut(c,s,p),e.useEffect(()=>{if(c&&(v||D)&&u.current&&u.current.element){const o=u.current.element.closest(".k-popover"),n=o&&(o.querySelector(".k-popover-actions .k-button-primary")||o.querySelector(".k-popover-actions .k-button"));n&&n.focus()}},[c,v,D]);const Z=e.useCallback(()=>{p()},[p]),L=a.toLanguageString(t.overviewPopoverEdit,t.messages[t.overviewPopoverEdit]),R=a.toLanguageString(t.overviewPopoverDelete,t.messages[t.overviewPopoverDelete]),V=f.getField(l,g.title)||a.toLanguageString(t.eventTitle,t.messages[t.eventTitle]),y=f.getField(l,g.start),O=f.getField(l,g.end),q=!!f.getField(l,g.isAllDay),T=f.getField(l,g.description),w=a.toLanguageString(t.allDay,t.messages[t.allDay]),G=e.useMemo(()=>{if(!y||!O)return"";const o=B.ZonedDate.fromLocalDate(y,h),n=B.ZonedDate.fromLocalDate(O,h),m=n.getHours()===0&&n.getMinutes()===0&&n.getSeconds()===0&&n.getMilliseconds()===0?n.addDays(-1):n,E=o.getFullYear()===m.getFullYear()&&o.getMonth()===m.getMonth()&&o.getDate()===m.getDate();return q?E?`${r.formatDate(o,d)}, ${w}`:`${r.formatDate(o,d)} - ${r.formatDate(m,d)}, ${w}`:E?`${r.formatDate(o,d)}, ${r.formatDate(o,S)} - ${r.formatDate(n,S)}`:`${r.formatDate(o,d)}, ${r.formatDate(o,S)} - ${r.formatDate(n,d)}, ${r.formatDate(n,S)}`},[r,y,O,q,w,h]),J=e.useMemo(()=>[{text:a.toLanguageString(t.editorOccurrence,t.messages[t.editorOccurrence]),scope:"occurrence"},{text:a.toLanguageString(t.editorSeries,t.messages[t.editorSeries]),scope:"series"}],[a]),Q=e.useMemo(()=>[{text:a.toLanguageString(t.deleteOccurrence,t.messages[t.deleteOccurrence]),scope:"occurrence"},{text:a.toLanguageString(t.deleteSeries,t.messages[t.deleteSeries]),scope:"series"}],[a]),U=e.useCallback(o=>{o.item.scope==="series"?P():C()},[C,P]),X=e.useCallback(o=>{o.item.scope==="series"?I():F()},[F,I]),ee=v||D;return e.createElement($.Popover,{anchor:s,show:c,position:K,collision:W,callout:!1,title:V,style:{width:se},onKeyDown:Z,autoFocus:!1,animate:{openDuration:1,closeDuration:1}},e.createElement(x.FormElement,{ref:u,horizontal:!0,className:"k-scheduler-edit-form"},e.createElement(x.FieldWrapper,null,e.createElement(z.Label,{className:"k-form-label"},e.createElement(A.SvgIcon,{icon:_.clockIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},G))),T&&e.createElement(x.FieldWrapper,null,e.createElement(z.Label,{className:"k-form-label"},e.createElement(A.SvgIcon,{icon:_.commentIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-edit-form-row"},T)))),ee&&e.createElement($.PopoverActionsBar,{alignment:"end"},D&&(M?e.createElement(k.DropDownButton,{text:R,items:Q,textField:"text",onItemClick:X}):e.createElement(k.Button,{type:"button",onClick:Y},R)),v&&(M?e.createElement(k.DropDownButton,{text:L,themeColor:"primary",items:J,textField:"text",onItemClick:U}):e.createElement(k.Button,{type:"button",themeColor:"primary",onClick:H},L))))};j.displayName="KendoReactSchedulerEventOverviewPopover";exports.EventOverviewPopover=j;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { Popover as se, PopoverActionsBar as ie } from "@progress/kendo-react-tooltip";
|
|
10
|
+
import { SvgIcon as P } from "@progress/kendo-react-common";
|
|
11
|
+
import { DropDownButton as F, Button as T } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { FormElement as le, FieldWrapper as z } from "@progress/kendo-react-form";
|
|
13
|
+
import { Label as R } from "@progress/kendo-react-labels";
|
|
14
|
+
import { useInternationalization as me, useLocalization as ue } from "@progress/kendo-react-intl";
|
|
15
|
+
import { ZonedDate as N } from "@progress/kendo-date-math";
|
|
16
|
+
import { clockIcon as de, commentIcon as fe } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { getField as p } from "../utils/index.mjs";
|
|
18
|
+
import { useCloseOnAnchorScrollOut as pe } from "../hooks/useCloseOnAnchorScrollOut.mjs";
|
|
19
|
+
import { overviewPopoverEdit as B, messages as a, overviewPopoverDelete as K, eventTitle as _, allDay as q, editorOccurrence as H, editorSeries as W, deleteOccurrence as Y, deleteSeries as V } from "../messages/index.mjs";
|
|
20
|
+
import { useSchedulerPropsContext as ge } from "../context/SchedulerContext.mjs";
|
|
21
|
+
const l = { skeleton: "MMMMd" }, v = "t", Ee = 360, De = (Z) => {
|
|
22
|
+
const {
|
|
23
|
+
show: i,
|
|
24
|
+
anchor: m,
|
|
25
|
+
dataItem: u,
|
|
26
|
+
fields: d,
|
|
27
|
+
position: j,
|
|
28
|
+
collision: G,
|
|
29
|
+
isRecurring: w,
|
|
30
|
+
canEdit: g,
|
|
31
|
+
canRemove: E,
|
|
32
|
+
onEdit: J,
|
|
33
|
+
onEditOccurrence: M,
|
|
34
|
+
onEditSeries: C,
|
|
35
|
+
onDelete: Q,
|
|
36
|
+
onDeleteOccurrence: L,
|
|
37
|
+
onDeleteSeries: I,
|
|
38
|
+
onClose: f
|
|
39
|
+
} = Z, n = me(), r = ue(), { timezone: k } = ge(), c = e.useRef(null);
|
|
40
|
+
e.useEffect(() => {
|
|
41
|
+
if (!i)
|
|
42
|
+
return;
|
|
43
|
+
const t = (o) => {
|
|
44
|
+
const y = o.target, s = c.current && c.current.element && c.current.element.closest(".k-popover"), D = s ? s.contains(y) : !1, ce = m ? m.contains(y) : !1;
|
|
45
|
+
!D && !ce && f();
|
|
46
|
+
};
|
|
47
|
+
return document.addEventListener("mousedown", t), () => {
|
|
48
|
+
document.removeEventListener("mousedown", t);
|
|
49
|
+
};
|
|
50
|
+
}, [i, m, f]), pe(i, m, f), e.useEffect(() => {
|
|
51
|
+
if (i && (g || E) && c.current && c.current.element) {
|
|
52
|
+
const t = c.current.element.closest(".k-popover"), o = t && (t.querySelector(".k-popover-actions .k-button-primary") || t.querySelector(".k-popover-actions .k-button"));
|
|
53
|
+
o && o.focus();
|
|
54
|
+
}
|
|
55
|
+
}, [i, g, E]);
|
|
56
|
+
const U = e.useCallback(() => {
|
|
57
|
+
f();
|
|
58
|
+
}, [f]), O = r.toLanguageString(B, a[B]), $ = r.toLanguageString(K, a[K]), X = p(u, d.title) || r.toLanguageString(_, a[_]), h = p(u, d.start), S = p(u, d.end), b = !!p(u, d.isAllDay), A = p(u, d.description), x = r.toLanguageString(q, a[q]), ee = e.useMemo(() => {
|
|
59
|
+
if (!h || !S)
|
|
60
|
+
return "";
|
|
61
|
+
const t = N.fromLocalDate(h, k), o = N.fromLocalDate(S, k), s = o.getHours() === 0 && o.getMinutes() === 0 && o.getSeconds() === 0 && o.getMilliseconds() === 0 ? o.addDays(-1) : o, D = t.getFullYear() === s.getFullYear() && t.getMonth() === s.getMonth() && t.getDate() === s.getDate();
|
|
62
|
+
return b ? D ? `${n.formatDate(t, l)}, ${x}` : `${n.formatDate(t, l)} - ${n.formatDate(
|
|
63
|
+
s,
|
|
64
|
+
l
|
|
65
|
+
)}, ${x}` : D ? `${n.formatDate(t, l)}, ${n.formatDate(
|
|
66
|
+
t,
|
|
67
|
+
v
|
|
68
|
+
)} - ${n.formatDate(o, v)}` : `${n.formatDate(t, l)}, ${n.formatDate(
|
|
69
|
+
t,
|
|
70
|
+
v
|
|
71
|
+
)} - ${n.formatDate(o, l)}, ${n.formatDate(o, v)}`;
|
|
72
|
+
}, [n, h, S, b, x, k]), te = e.useMemo(
|
|
73
|
+
() => [
|
|
74
|
+
{ text: r.toLanguageString(H, a[H]), scope: "occurrence" },
|
|
75
|
+
{ text: r.toLanguageString(W, a[W]), scope: "series" }
|
|
76
|
+
],
|
|
77
|
+
[r]
|
|
78
|
+
), oe = e.useMemo(
|
|
79
|
+
() => [
|
|
80
|
+
{ text: r.toLanguageString(Y, a[Y]), scope: "occurrence" },
|
|
81
|
+
{ text: r.toLanguageString(V, a[V]), scope: "series" }
|
|
82
|
+
],
|
|
83
|
+
[r]
|
|
84
|
+
), ne = e.useCallback(
|
|
85
|
+
(t) => {
|
|
86
|
+
t.item.scope === "series" ? C() : M();
|
|
87
|
+
},
|
|
88
|
+
[M, C]
|
|
89
|
+
), re = e.useCallback(
|
|
90
|
+
(t) => {
|
|
91
|
+
t.item.scope === "series" ? I() : L();
|
|
92
|
+
},
|
|
93
|
+
[L, I]
|
|
94
|
+
), ae = g || E;
|
|
95
|
+
return /* @__PURE__ */ e.createElement(
|
|
96
|
+
se,
|
|
97
|
+
{
|
|
98
|
+
anchor: m,
|
|
99
|
+
show: i,
|
|
100
|
+
position: j,
|
|
101
|
+
collision: G,
|
|
102
|
+
callout: !1,
|
|
103
|
+
title: X,
|
|
104
|
+
style: { width: Ee },
|
|
105
|
+
onKeyDown: U,
|
|
106
|
+
autoFocus: !1,
|
|
107
|
+
animate: { openDuration: 1, closeDuration: 1 }
|
|
108
|
+
},
|
|
109
|
+
/* @__PURE__ */ e.createElement(le, { ref: c, horizontal: !0, className: "k-scheduler-edit-form" }, /* @__PURE__ */ e.createElement(z, null, /* @__PURE__ */ e.createElement(R, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(P, { icon: de, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row k-color-subtle" }, ee))), A && /* @__PURE__ */ e.createElement(z, null, /* @__PURE__ */ e.createElement(R, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(P, { icon: fe, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row" }, A)))),
|
|
110
|
+
ae && /* @__PURE__ */ e.createElement(ie, { alignment: "end" }, E && (w ? /* @__PURE__ */ e.createElement(
|
|
111
|
+
F,
|
|
112
|
+
{
|
|
113
|
+
text: $,
|
|
114
|
+
items: oe,
|
|
115
|
+
textField: "text",
|
|
116
|
+
onItemClick: re
|
|
117
|
+
}
|
|
118
|
+
) : /* @__PURE__ */ e.createElement(T, { type: "button", onClick: Q }, $)), g && (w ? /* @__PURE__ */ e.createElement(
|
|
119
|
+
F,
|
|
120
|
+
{
|
|
121
|
+
text: O,
|
|
122
|
+
themeColor: "primary",
|
|
123
|
+
items: te,
|
|
124
|
+
textField: "text",
|
|
125
|
+
onItemClick: ne
|
|
126
|
+
}
|
|
127
|
+
) : /* @__PURE__ */ e.createElement(T, { type: "button", themeColor: "primary", onClick: J }, O)))
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
De.displayName = "KendoReactSchedulerEventOverviewPopover";
|
|
131
|
+
export {
|
|
132
|
+
De as EventOverviewPopover
|
|
133
|
+
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),w=require("@progress/kendo-react-tooltip"),P=require("@progress/kendo-react-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),w=require("@progress/kendo-react-tooltip"),P=require("@progress/kendo-react-common"),h=require("@progress/kendo-react-intl"),l=require("../messages/index.js"),q=require("../hooks/useCloseOnAnchorScrollOut.js");function A(c){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const n in c)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(c,n);Object.defineProperty(s,n,o.get?o:{enumerable:!0,get:()=>c[n]})}}return s.default=c,Object.freeze(s)}const t=A(R),_={skeleton:"MMM"},j={skeleton:"dd"},I="t",b=c=>{const{show:s,anchor:n,slot:o,itemsPerSlot:k,onDayClick:m,onItemDoubleClick:g,onClose:a}=c,v=h.useInternationalization(),p=h.useLocalization(),f=t.useMemo(()=>o?o.items.filter((e,d)=>d>=k):[],[o,k]),M=t.useCallback(e=>{o&&m&&m(o)},[o,m]);q.useCloseOnAnchorScrollOut(s,n,a),t.useEffect(()=>{if(!s)return;const e=d=>{const r=d.target,u=document.querySelector(".k-scheduler-popover");u&&!u.contains(r)&&n&&!n.contains(r)&&(a==null||a())};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[s,n,a]);const O=t.useCallback(e=>{e.key==="Escape"&&(a==null||a())},[a]);if(!o)return null;const E=new Date(o.zonedEnd.getTime()-(o.zonedEnd.getTime()-o.zonedStart.getTime())/2),S=v.formatDate(E,_),T=v.formatDate(E,j),N=p.toLanguageString(l.noEvents,l.messages[l.noEvents]),C=p.toLanguageString(l.popoverEvents,l.messages[l.popoverEvents]),z=p.toLanguageString(l.allDay,l.messages[l.allDay]),F=t.createElement(t.Fragment,null,t.createElement("div",{className:"k-month"},S),t.createElement("div",{className:"k-link k-day",onClick:M},T));return t.createElement(w.Popover,{anchor:n,show:s,popoverClass:"k-scheduler-popover",position:"right",collision:{horizontal:"flip",vertical:"fit"},callout:!1,title:F,style:{width:220},onKeyDown:O,animate:{openDuration:1,closeDuration:1}},f.length>0?t.createElement("div",{className:"k-popover-events",role:"list","aria-label":C},f.map((e,d)=>{var y,D;const r=(D=(y=e.group)==null?void 0:y.resources)==null?void 0:D.find(i=>!!(i.colorField&&i[i.colorField]!==""&&i[i.colorField]!==void 0)),u=(r==null?void 0:r.colorField)&&r[r.colorField],L=u?{"--kendo-scheduler-event-color":u}:void 0;return t.createElement("div",{key:e.uid||d,className:P.classNames("k-popover-event k-event",{"k-readonly":!!e.readonly}),role:"listitem",style:L,onDoubleClick:g?i=>g(e,i):void 0},t.createElement("div",{className:"k-event-title"},e.title||""),t.createElement("span",{className:"k-event-time"},e.isAllDay?z:v.formatDate(e.zonedStart,I)))})):t.createElement("span",{className:"k-no-data"},N))};b.displayName="KendoReactSchedulerMoreEventsPopover";exports.MoreEventsPopover=b;
|
|
@@ -5,73 +5,74 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { Popover as
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
import { Popover as O } from "@progress/kendo-react-tooltip";
|
|
10
10
|
import { classNames as R } from "@progress/kendo-react-common";
|
|
11
|
-
import { useInternationalization as
|
|
12
|
-
import { noEvents as h, messages as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import { useInternationalization as I, useLocalization as P } from "@progress/kendo-react-intl";
|
|
12
|
+
import { noEvents as h, messages as v, popoverEvents as y, allDay as M } from "../messages/index.mjs";
|
|
13
|
+
import { useCloseOnAnchorScrollOut as _ } from "../hooks/useCloseOnAnchorScrollOut.mjs";
|
|
14
|
+
const x = { skeleton: "MMM" }, K = { skeleton: "dd" }, q = "t", B = (N) => {
|
|
15
|
+
const { show: i, anchor: s, slot: o, itemsPerSlot: p, onDayClick: m, onItemDoubleClick: k, onClose: n } = N, d = I(), u = P(), f = t.useMemo(() => o ? o.items.filter((e, r) => r >= p) : [], [o, p]), T = t.useCallback(
|
|
16
|
+
(e) => {
|
|
16
17
|
o && m && m(o);
|
|
17
18
|
},
|
|
18
19
|
[o, m]
|
|
19
20
|
);
|
|
20
|
-
|
|
21
|
+
_(i, s, n), t.useEffect(() => {
|
|
21
22
|
if (!i)
|
|
22
23
|
return;
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const e = (r) => {
|
|
25
|
+
const l = r.target, c = document.querySelector(".k-scheduler-popover");
|
|
26
|
+
c && !c.contains(l) && s && !s.contains(l) && (n == null || n());
|
|
26
27
|
};
|
|
27
|
-
return document.addEventListener("mousedown",
|
|
28
|
-
document.removeEventListener("mousedown",
|
|
28
|
+
return document.addEventListener("mousedown", e), () => {
|
|
29
|
+
document.removeEventListener("mousedown", e);
|
|
29
30
|
};
|
|
30
|
-
}, [i,
|
|
31
|
-
const
|
|
32
|
-
(
|
|
33
|
-
|
|
31
|
+
}, [i, s, n]);
|
|
32
|
+
const F = t.useCallback(
|
|
33
|
+
(e) => {
|
|
34
|
+
e.key === "Escape" && (n == null || n());
|
|
34
35
|
},
|
|
35
36
|
[n]
|
|
36
37
|
);
|
|
37
38
|
if (!o)
|
|
38
39
|
return null;
|
|
39
|
-
const E = new Date(o.zonedEnd.getTime() - (o.zonedEnd.getTime() - o.zonedStart.getTime()) / 2),
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
40
|
+
const E = new Date(o.zonedEnd.getTime() - (o.zonedEnd.getTime() - o.zonedStart.getTime()) / 2), L = d.formatDate(E, x), S = d.formatDate(E, K), b = u.toLanguageString(h, v[h]), z = u.toLanguageString(y, v[y]), C = u.toLanguageString(M, v[M]), w = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("div", { className: "k-month" }, L), /* @__PURE__ */ t.createElement("div", { className: "k-link k-day", onClick: T }, S));
|
|
41
|
+
return /* @__PURE__ */ t.createElement(
|
|
42
|
+
O,
|
|
42
43
|
{
|
|
43
|
-
anchor:
|
|
44
|
+
anchor: s,
|
|
44
45
|
show: i,
|
|
45
46
|
popoverClass: "k-scheduler-popover",
|
|
46
47
|
position: "right",
|
|
47
|
-
collision: { horizontal: "flip", vertical: "
|
|
48
|
-
callout: !
|
|
48
|
+
collision: { horizontal: "flip", vertical: "fit" },
|
|
49
|
+
callout: !1,
|
|
49
50
|
title: w,
|
|
50
51
|
style: { width: 220 },
|
|
51
|
-
onKeyDown:
|
|
52
|
+
onKeyDown: F,
|
|
52
53
|
animate: { openDuration: 1, closeDuration: 1 }
|
|
53
54
|
},
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
const
|
|
57
|
-
(
|
|
58
|
-
),
|
|
59
|
-
return /* @__PURE__ */
|
|
55
|
+
f.length > 0 ? /* @__PURE__ */ t.createElement("div", { className: "k-popover-events", role: "list", "aria-label": z }, f.map((e, r) => {
|
|
56
|
+
var g, D;
|
|
57
|
+
const l = (D = (g = e.group) == null ? void 0 : g.resources) == null ? void 0 : D.find(
|
|
58
|
+
(a) => !!(a.colorField && a[a.colorField] !== "" && a[a.colorField] !== void 0)
|
|
59
|
+
), c = (l == null ? void 0 : l.colorField) && l[l.colorField], A = c ? { "--kendo-scheduler-event-color": c } : void 0;
|
|
60
|
+
return /* @__PURE__ */ t.createElement(
|
|
60
61
|
"div",
|
|
61
62
|
{
|
|
62
|
-
key:
|
|
63
|
-
className: R("k-popover-event k-event", { "k-readonly": !!
|
|
63
|
+
key: e.uid || r,
|
|
64
|
+
className: R("k-popover-event k-event", { "k-readonly": !!e.readonly }),
|
|
64
65
|
role: "listitem",
|
|
65
|
-
style:
|
|
66
|
-
onDoubleClick:
|
|
66
|
+
style: A,
|
|
67
|
+
onDoubleClick: k ? (a) => k(e, a) : void 0
|
|
67
68
|
},
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-event-title" }, e.title || ""),
|
|
70
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-event-time" }, e.isAllDay ? C : d.formatDate(e.zonedStart, q))
|
|
70
71
|
);
|
|
71
|
-
})) : /* @__PURE__ */
|
|
72
|
+
})) : /* @__PURE__ */ t.createElement("span", { className: "k-no-data" }, b)
|
|
72
73
|
);
|
|
73
74
|
};
|
|
74
|
-
|
|
75
|
+
B.displayName = "KendoReactSchedulerMoreEventsPopover";
|
|
75
76
|
export {
|
|
76
|
-
|
|
77
|
+
B as MoreEventsPopover
|
|
77
78
|
};
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),U=require("react-dom"),J=require("@progress/kendo-react-common"),b=require("@progress/kendo-react-buttons"),Q=require("@progress/kendo-react-form"),I=require("@progress/kendo-react-dialogs"),W=require("@progress/kendo-react-intl"),X=require("../editors/SchedulerFormEditor.js"),Y=require("@progress/kendo-svg-icons"),t=require("../messages/index.js"),Z=require("../context/SchedulerContext.js");function y(r){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(c,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}return c.default=r,Object.freeze(c)}const e=y(K),$=y(U),F=e.forwardRef((r,c)=>{const{onCancel:s,onClose:l,onSubmit:g,onDelete:u,editor:L,dialog:O=
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),U=require("react-dom"),J=require("@progress/kendo-react-common"),b=require("@progress/kendo-react-buttons"),Q=require("@progress/kendo-react-form"),I=require("@progress/kendo-react-dialogs"),W=require("@progress/kendo-react-intl"),X=require("../editors/SchedulerFormEditor.js"),Y=require("@progress/kendo-svg-icons"),t=require("../messages/index.js"),Z=require("../context/SchedulerContext.js");function y(r){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(c,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}return c.default=r,Object.freeze(c)}const e=y(K),$=y(U),F=e.forwardRef((r,c)=>{const{onCancel:s,onClose:l,onSubmit:g,onDelete:u,editor:L,dialog:O=M.dialog,validator:E=M.validator,...B}=r,d=e.useRef(null);e.useImperativeHandle(d,()=>({props:r})),e.useImperativeHandle(c,()=>d.current);const o=W.useLocalization(),n=Z.useSchedulerFieldsContext(),f=!!(r.dataItem&&r.dataItem[n.id]),h=e.useMemo(()=>o.toLanguageString(t.editorValidationRequired,t.messages[t.editorValidationRequired]),[o]),k=e.useMemo(()=>o.toLanguageString(t.editorValidationEnd,t.messages[t.editorValidationEnd]),[o]),w=e.useMemo(()=>o.toLanguageString(t.editorSave,t.messages[t.editorSave]),[o]),T=e.useMemo(()=>o.toLanguageString(t.editorCancel,t.messages[t.editorCancel]),[o]),V=e.useMemo(()=>o.toLanguageString(t.editorDelete,t.messages[t.editorDelete]),[o]),D=e.useMemo(()=>o.toLanguageString(t.editorValidationStart,t.messages[t.editorValidationStart]),[o]),j=e.useMemo(()=>o.toLanguageString(t.editorNewEvent,t.messages[t.editorNewEvent]),[o]),_=e.useMemo(()=>o.toLanguageString(t.editorEditEvent,t.messages[t.editorEditEvent]),[o]),N=f?_:j,P=e.useCallback(a=>{s&&s({value:null,syntheticEvent:a,target:d.current})},[s]),x=e.useCallback(({syntheticEvent:a})=>{l&&l({value:null,syntheticEvent:a,target:d.current})},[l]),z=e.useCallback((a,i)=>{g&&g({value:a,syntheticEvent:i,target:d.current})},[g]),A=e.useCallback(a=>{u&&u({value:r.dataItem,syntheticEvent:a,target:d.current})},[u,r.dataItem]),q=e.useCallback((a,i)=>a&&i(n.end)&&a.getTime()>i(n.end).getTime()?D:void 0,[n,D]),R=e.useCallback((a,i)=>a&&i(n.start)&&a.getTime()<i(n.start).getTime()?k:void 0,[n,k]),m=e.useCallback(a=>a?void 0:h,[h]),H=e.useCallback((a,i)=>{const S={};S[n.start]=[m(i(n.start)),q(i(n.start),i)].filter(Boolean).reduce((v,C)=>v||C,""),S[n.end]=[m(i(n.start)),R(i(n.start),i)].filter(Boolean).reduce((v,C)=>v||C,"");const p=E(a,i);return{...S,...p}},[R,n.end,n.start,m,q,E]);return J.canUseDOM?$.createPortal(e.createElement(Q.Form,{ignoreModified:!0,initialValues:r.dataItem,onSubmit:z,validator:H,render:a=>e.createElement(O,{title:N,width:650,onClose:x},e.createElement(X.SchedulerFormEditor,{...a,as:L}),e.createElement(I.DialogActionsBar,{layout:"end"},f&&u&&e.createElement(b.Button,{fillMode:"flat",themeColor:"primary",svgIcon:Y.trashIcon,onClick:A},V),e.createElement(b.Button,{onClick:P},T),e.createElement(b.Button,{themeColor:"primary",disabled:!a.allowSubmit,onClick:a.onSubmit},w))),...B}),document&&document.body):null}),M={dialog:I.Dialog,validator:()=>({})};F.displayName="KendoReactSchedulerForm";exports.SchedulerForm=F;exports.schedulerFormDefaultProps=M;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import * as Y from "react-dom";
|
|
10
10
|
import { canUseDOM as Z } from "@progress/kendo-react-common";
|
|
11
|
-
import { Button as
|
|
11
|
+
import { Button as S } from "@progress/kendo-react-buttons";
|
|
12
12
|
import { Form as _ } from "@progress/kendo-react-form";
|
|
13
13
|
import { Dialog as $, DialogActionsBar as G } from "@progress/kendo-react-dialogs";
|
|
14
14
|
import { useLocalization as ee } from "@progress/kendo-react-intl";
|
|
@@ -103,10 +103,10 @@ const ne = e.forwardRef((r, V) => {
|
|
|
103
103
|
g[o.start] = [
|
|
104
104
|
u(n(o.start)),
|
|
105
105
|
k(n(o.start), n)
|
|
106
|
-
].filter(Boolean).reduce((
|
|
106
|
+
].filter(Boolean).reduce((f, C) => f || C, ""), g[o.end] = [
|
|
107
107
|
u(n(o.start)),
|
|
108
108
|
D(n(o.start), n)
|
|
109
|
-
].filter(Boolean).reduce((
|
|
109
|
+
].filter(Boolean).reduce((f, C) => f || C, "");
|
|
110
110
|
const X = M(t, n);
|
|
111
111
|
return { ...g, ...X };
|
|
112
112
|
},
|
|
@@ -116,11 +116,12 @@ const ne = e.forwardRef((r, V) => {
|
|
|
116
116
|
/* @__PURE__ */ e.createElement(
|
|
117
117
|
_,
|
|
118
118
|
{
|
|
119
|
+
ignoreModified: !0,
|
|
119
120
|
initialValues: r.dataItem,
|
|
120
121
|
onSubmit: P,
|
|
121
122
|
validator: W,
|
|
122
123
|
render: (t) => /* @__PURE__ */ e.createElement(A, { title: U, width: 650, onClose: J }, /* @__PURE__ */ e.createElement(te, { ...t, as: q }), /* @__PURE__ */ e.createElement(G, { layout: "end" }, v && s && /* @__PURE__ */ e.createElement(
|
|
123
|
-
|
|
124
|
+
S,
|
|
124
125
|
{
|
|
125
126
|
fillMode: "flat",
|
|
126
127
|
themeColor: "primary",
|
|
@@ -128,8 +129,8 @@ const ne = e.forwardRef((r, V) => {
|
|
|
128
129
|
onClick: Q
|
|
129
130
|
},
|
|
130
131
|
N
|
|
131
|
-
), /* @__PURE__ */ e.createElement(
|
|
132
|
-
|
|
132
|
+
), /* @__PURE__ */ e.createElement(S, { onClick: j }, H), /* @__PURE__ */ e.createElement(
|
|
133
|
+
S,
|
|
133
134
|
{
|
|
134
135
|
themeColor: "primary",
|
|
135
136
|
disabled: !t.allowSubmit,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { FormProps } from '@progress/kendo-react-form';
|
|
9
|
+
import { DataItem } from '../models/index.js';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* Represents the event argument of the [SchedulerQuickCreateForm](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulerquickcreateform) callbacks.
|
|
13
|
+
*/
|
|
14
|
+
export interface SchedulerQuickCreateFormStateChangeEvent<T> {
|
|
15
|
+
/**
|
|
16
|
+
* The value associated with the event.
|
|
17
|
+
*/
|
|
18
|
+
value: T;
|
|
19
|
+
/**
|
|
20
|
+
* The React synthetic event object.
|
|
21
|
+
*/
|
|
22
|
+
syntheticEvent: React.SyntheticEvent | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents the props of the KendoReact [SchedulerQuickCreateForm](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulerquickcreateform) component.
|
|
26
|
+
*/
|
|
27
|
+
export interface SchedulerQuickCreateFormProps {
|
|
28
|
+
/**
|
|
29
|
+
* Specifies the draft `dataItem` created for the slot and visualized inside the quick-create popover.
|
|
30
|
+
*/
|
|
31
|
+
dataItem: DataItem;
|
|
32
|
+
/**
|
|
33
|
+
* Controls the visibility of the quick-create popover.
|
|
34
|
+
*/
|
|
35
|
+
show: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The anchor element the popover is positioned against.
|
|
38
|
+
*/
|
|
39
|
+
anchor: HTMLElement | null;
|
|
40
|
+
/**
|
|
41
|
+
* A validation function applied to the quick-create form values. Behaves like the `validator` of the [SchedulerForm](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulerform).
|
|
42
|
+
*/
|
|
43
|
+
validator?: FormProps['validator'];
|
|
44
|
+
/**
|
|
45
|
+
* Fires when the quick-create form is submitted through the `Save` button or the `Enter` key.
|
|
46
|
+
*/
|
|
47
|
+
onSubmit: (event: SchedulerQuickCreateFormStateChangeEvent<DataItem>) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Fires when the `More options` button is clicked to open the full editor.
|
|
50
|
+
*/
|
|
51
|
+
onMoreOptions?: (event: SchedulerQuickCreateFormStateChangeEvent<DataItem>) => void;
|
|
52
|
+
/**
|
|
53
|
+
* Fires when the quick-create form is cancelled.
|
|
54
|
+
*/
|
|
55
|
+
onCancel?: (event: SchedulerQuickCreateFormStateChangeEvent<null>) => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Represents the default `quickCreateForm` component rendered by the [SchedulerEditSlot](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulereditslot) inside the quick-create popover.
|
|
59
|
+
*
|
|
60
|
+
* Unlike the heavier [SchedulerForm](https://www.telerik.com/kendo-react-ui/components/scheduler/api/schedulerform), it is a lightweight popover with a single editable `title` field that supports a `validator`.
|
|
61
|
+
*/
|
|
62
|
+
export declare const SchedulerQuickCreateForm: React.FC<SchedulerQuickCreateFormProps>;
|
|
63
|
+
export declare const schedulerQuickCreateFormDefaultProps: {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),L=require("@progress/kendo-react-tooltip"),M=require("@progress/kendo-react-common"),h=require("@progress/kendo-react-buttons"),U=require("@progress/kendo-react-inputs"),d=require("@progress/kendo-react-form"),w=require("@progress/kendo-react-labels"),x=require("@progress/kendo-react-intl"),P=require("@progress/kendo-date-math"),R=require("@progress/kendo-svg-icons"),v=require("../utils/index.js"),X=require("../hooks/useQuickCreatePlacement.js"),Y=require("../hooks/useCloseOnAnchorScrollOut.js"),t=require("../messages/index.js"),I=require("../context/SchedulerContext.js");function ee(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const c in s)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(s,c);Object.defineProperty(a,c,r.get?r:{enumerable:!0,get:()=>s[c]})}}return a.default=s,Object.freeze(a)}const e=ee(J),N={skeleton:"MMMMd"},z="t",te=360,oe=s=>{const{value:a,onChange:c,onKeyDown:r,valid:E,placeholder:p,ariaLabel:m}=s;return e.createElement(U.TextBox,{"aria-label":m,placeholder:p,autoComplete:"off",value:a!=null?a:"",onChange:c,onKeyDown:r,valid:E})},A=s=>{const{show:a,anchor:c,dataItem:r,validator:E,onSubmit:p,onMoreOptions:m,onCancel:n}=s,g=x.useInternationalization(),u=x.useLocalization(),i=I.useSchedulerFieldsContext(),{timezone:b}=I.useSchedulerPropsContext(),S=X.useQuickCreatePlacement(),y=e.useRef(null),Q=e.useCallback(()=>{n==null||n({value:null,syntheticEvent:void 0})},[n]);Y.useCloseOnAnchorScrollOut(a,c,Q),e.useEffect(()=>{if(!a)return;const o=l=>{var F,T;const f=l.target,O=(T=(F=y.current)==null?void 0:F.element)==null?void 0:T.closest(".k-popover");(O?O.contains(f):!1)||n==null||n({value:null,syntheticEvent:void 0})};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[a,c,n]);const k=v.getField(r,i.start),C=v.getField(r,i.end),B=!!v.getField(r,i.isAllDay),_=u.toLanguageString(t.allDay,t.messages[t.allDay]);let D="";if(k&&C){const o=P.ZonedDate.fromLocalDate(k,b),l=P.ZonedDate.fromLocalDate(C,b);D=B?`${g.formatDate(o,N)}, ${_}`:`${g.formatDate(o,N)}, ${g.formatDate(o,z)} - ${g.formatDate(l,z)}`}const q=u.toLanguageString(t.editorNewEvent,t.messages[t.editorNewEvent]),$=u.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle]),j=u.toLanguageString(t.quickCreateSave,t.messages[t.quickCreateSave]),K=u.toLanguageString(t.quickCreateMoreOptions,t.messages[t.quickCreateMoreOptions]),W=u.toLanguageString(t.quickCreateCancel,t.messages[t.quickCreateCancel]),V=e.useCallback((o,l)=>{p({value:o,syntheticEvent:l})},[p]),Z=e.useCallback(o=>l=>{if(!m)return;const f={...r};v.setField(f,i.title,o.valueGetter(i.title)),m({value:f,syntheticEvent:l})},[m,r,i.title]),G=e.useCallback(o=>{n&&n({value:null,syntheticEvent:o})},[n]),H=e.useCallback(()=>{n==null||n({value:null,syntheticEvent:void 0})},[n]);return e.createElement(d.Form,{key:k?k.getTime():void 0,initialValues:r,validator:E,ignoreModified:!0,onSubmit:V,render:o=>e.createElement(L.Popover,{anchor:c,show:a,position:S.position,collision:S.collision,callout:!1,title:q,style:{width:te},onKeyDown:H,animate:{openDuration:1,closeDuration:1}},e.createElement(d.FormElement,{ref:y,horizontal:!0,className:"k-scheduler-edit-form"},e.createElement(d.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},e.createElement(M.SvgIcon,{icon:R.rightDoubleQuotesIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(d.Field,{name:i.title,component:oe,ariaLabel:$,placeholder:q,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o.onSubmit(l))}}))),e.createElement(d.FieldWrapper,null,e.createElement(w.Label,{className:"k-form-label"},e.createElement(M.SvgIcon,{icon:R.clockIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement("div",{className:"k-scheduler-edit-form-row k-color-subtle"},D)))),e.createElement(L.PopoverActionsBar,null,e.createElement(h.Button,{type:"button",fillMode:"flat",themeColor:"primary",onClick:Z(o)},K),e.createElement("span",{className:"k-spacer"}),e.createElement(h.Button,{type:"button",onClick:G},W),e.createElement(h.Button,{type:"button",themeColor:"primary",disabled:!o.allowSubmit,onClick:o.onSubmit},j)))})};A.displayName="KendoReactSchedulerQuickCreateForm";const ne={};exports.SchedulerQuickCreateForm=A;exports.schedulerQuickCreateFormDefaultProps=ne;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { Popover as U, PopoverActionsBar as X } from "@progress/kendo-react-tooltip";
|
|
10
|
+
import { SvgIcon as F } from "@progress/kendo-react-common";
|
|
11
|
+
import { Button as h } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { TextBox as Y } from "@progress/kendo-react-inputs";
|
|
13
|
+
import { Form as ee, FormElement as te, FieldWrapper as M, Field as oe } from "@progress/kendo-react-form";
|
|
14
|
+
import { Label as x } from "@progress/kendo-react-labels";
|
|
15
|
+
import { useInternationalization as ne, useLocalization as ae } from "@progress/kendo-react-intl";
|
|
16
|
+
import { ZonedDate as O } from "@progress/kendo-date-math";
|
|
17
|
+
import { rightDoubleQuotesIcon as le, clockIcon as re } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { getField as g, setField as ie } from "../utils/index.mjs";
|
|
19
|
+
import { useQuickCreatePlacement as ce } from "../hooks/useQuickCreatePlacement.mjs";
|
|
20
|
+
import { useCloseOnAnchorScrollOut as se } from "../hooks/useCloseOnAnchorScrollOut.mjs";
|
|
21
|
+
import { allDay as z, messages as c, editorNewEvent as N, editorEventTitle as A, quickCreateSave as I, quickCreateMoreOptions as P, quickCreateCancel as Q } from "../messages/index.mjs";
|
|
22
|
+
import { useSchedulerFieldsContext as me, useSchedulerPropsContext as ue } from "../context/SchedulerContext.mjs";
|
|
23
|
+
const K = { skeleton: "MMMMd" }, $ = "t", de = 360, pe = (E) => {
|
|
24
|
+
const { value: a, onChange: s, onKeyDown: l, valid: v, placeholder: u, ariaLabel: m } = E;
|
|
25
|
+
return /* @__PURE__ */ e.createElement(
|
|
26
|
+
Y,
|
|
27
|
+
{
|
|
28
|
+
"aria-label": m,
|
|
29
|
+
placeholder: u,
|
|
30
|
+
autoComplete: "off",
|
|
31
|
+
value: a != null ? a : "",
|
|
32
|
+
onChange: s,
|
|
33
|
+
onKeyDown: l,
|
|
34
|
+
valid: v
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}, fe = (E) => {
|
|
38
|
+
const { show: a, anchor: s, dataItem: l, validator: v, onSubmit: u, onMoreOptions: m, onCancel: o } = E, d = ne(), i = ae(), r = me(), { timezone: k } = ue(), b = ce(), y = e.useRef(null), B = e.useCallback(() => {
|
|
39
|
+
o == null || o({ value: null, syntheticEvent: void 0 });
|
|
40
|
+
}, [o]);
|
|
41
|
+
se(a, s, B), e.useEffect(() => {
|
|
42
|
+
if (!a)
|
|
43
|
+
return;
|
|
44
|
+
const t = (n) => {
|
|
45
|
+
var w, T;
|
|
46
|
+
const f = n.target, L = (T = (w = y.current) == null ? void 0 : w.element) == null ? void 0 : T.closest(".k-popover");
|
|
47
|
+
(L ? L.contains(f) : !1) || o == null || o({ value: null, syntheticEvent: void 0 });
|
|
48
|
+
};
|
|
49
|
+
return document.addEventListener("mousedown", t), () => {
|
|
50
|
+
document.removeEventListener("mousedown", t);
|
|
51
|
+
};
|
|
52
|
+
}, [a, s, o]);
|
|
53
|
+
const p = g(l, r.start), D = g(l, r.end), R = !!g(l, r.isAllDay), q = i.toLanguageString(z, c[z]);
|
|
54
|
+
let S = "";
|
|
55
|
+
if (p && D) {
|
|
56
|
+
const t = O.fromLocalDate(p, k), n = O.fromLocalDate(D, k);
|
|
57
|
+
S = R ? `${d.formatDate(t, K)}, ${q}` : `${d.formatDate(t, K)}, ${d.formatDate(
|
|
58
|
+
t,
|
|
59
|
+
$
|
|
60
|
+
)} - ${d.formatDate(n, $)}`;
|
|
61
|
+
}
|
|
62
|
+
const C = i.toLanguageString(N, c[N]), _ = i.toLanguageString(A, c[A]), V = i.toLanguageString(I, c[I]), W = i.toLanguageString(P, c[P]), G = i.toLanguageString(Q, c[Q]), H = e.useCallback(
|
|
63
|
+
(t, n) => {
|
|
64
|
+
u({ value: t, syntheticEvent: n });
|
|
65
|
+
},
|
|
66
|
+
[u]
|
|
67
|
+
), Z = e.useCallback(
|
|
68
|
+
(t) => (n) => {
|
|
69
|
+
if (!m)
|
|
70
|
+
return;
|
|
71
|
+
const f = { ...l };
|
|
72
|
+
ie(f, r.title, t.valueGetter(r.title)), m({ value: f, syntheticEvent: n });
|
|
73
|
+
},
|
|
74
|
+
[m, l, r.title]
|
|
75
|
+
), j = e.useCallback(
|
|
76
|
+
(t) => {
|
|
77
|
+
o && o({ value: null, syntheticEvent: t });
|
|
78
|
+
},
|
|
79
|
+
[o]
|
|
80
|
+
), J = e.useCallback(() => {
|
|
81
|
+
o == null || o({ value: null, syntheticEvent: void 0 });
|
|
82
|
+
}, [o]);
|
|
83
|
+
return /* @__PURE__ */ e.createElement(
|
|
84
|
+
ee,
|
|
85
|
+
{
|
|
86
|
+
key: p ? p.getTime() : void 0,
|
|
87
|
+
initialValues: l,
|
|
88
|
+
validator: v,
|
|
89
|
+
ignoreModified: !0,
|
|
90
|
+
onSubmit: H,
|
|
91
|
+
render: (t) => /* @__PURE__ */ e.createElement(
|
|
92
|
+
U,
|
|
93
|
+
{
|
|
94
|
+
anchor: s,
|
|
95
|
+
show: a,
|
|
96
|
+
position: b.position,
|
|
97
|
+
collision: b.collision,
|
|
98
|
+
callout: !1,
|
|
99
|
+
title: C,
|
|
100
|
+
style: { width: de },
|
|
101
|
+
onKeyDown: J,
|
|
102
|
+
animate: { openDuration: 1, closeDuration: 1 }
|
|
103
|
+
},
|
|
104
|
+
/* @__PURE__ */ e.createElement(te, { ref: y, horizontal: !0, className: "k-scheduler-edit-form" }, /* @__PURE__ */ e.createElement(M, null, /* @__PURE__ */ e.createElement(x, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(F, { icon: le, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
105
|
+
oe,
|
|
106
|
+
{
|
|
107
|
+
name: r.title,
|
|
108
|
+
component: pe,
|
|
109
|
+
ariaLabel: _,
|
|
110
|
+
placeholder: C,
|
|
111
|
+
onKeyDown: (n) => {
|
|
112
|
+
n.key === "Enter" && (n.preventDefault(), t.onSubmit(n));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
))), /* @__PURE__ */ e.createElement(M, null, /* @__PURE__ */ e.createElement(x, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(F, { icon: re, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-edit-form-row k-color-subtle" }, S)))),
|
|
116
|
+
/* @__PURE__ */ e.createElement(X, null, /* @__PURE__ */ e.createElement(
|
|
117
|
+
h,
|
|
118
|
+
{
|
|
119
|
+
type: "button",
|
|
120
|
+
fillMode: "flat",
|
|
121
|
+
themeColor: "primary",
|
|
122
|
+
onClick: Z(t)
|
|
123
|
+
},
|
|
124
|
+
W
|
|
125
|
+
), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement(h, { type: "button", onClick: j }, G), /* @__PURE__ */ e.createElement(
|
|
126
|
+
h,
|
|
127
|
+
{
|
|
128
|
+
type: "button",
|
|
129
|
+
themeColor: "primary",
|
|
130
|
+
disabled: !t.allowSubmit,
|
|
131
|
+
onClick: t.onSubmit
|
|
132
|
+
},
|
|
133
|
+
V
|
|
134
|
+
))
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
fe.displayName = "KendoReactSchedulerQuickCreateForm";
|
|
140
|
+
const xe = {};
|
|
141
|
+
export {
|
|
142
|
+
fe as SchedulerQuickCreateForm,
|
|
143
|
+
xe as schedulerQuickCreateFormDefaultProps
|
|
144
|
+
};
|