@progress/kendo-react-scheduler 16.3.0 → 16.4.0-develop.2
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/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 +137 -0
- package/components/MoreEventsPopover.js +1 -1
- package/components/MoreEventsPopover.mjs +42 -40
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +137 -104
- package/components/SchedulerQuickCreateForm.d.ts +63 -0
- package/components/SchedulerQuickCreateForm.js +8 -0
- package/components/SchedulerQuickCreateForm.mjs +148 -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/DiscardChangesDialog.d.ts +17 -0
- package/editors/DiscardChangesDialog.js +8 -0
- package/editors/DiscardChangesDialog.mjs +34 -0
- 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/index.d.mts +4 -1
- package/index.d.ts +4 -1
- package/index.js +1 -1
- package/index.mjs +123 -116
- 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 +45 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +174 -144
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- 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/utils/index.d.ts +2 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +103 -99
- 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
|
@@ -6,148 +6,181 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import * as
|
|
10
|
-
import { canUseDOM as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { Form as
|
|
13
|
-
import { Dialog as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import { SchedulerFormEditor as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
9
|
+
import * as ae from "react-dom";
|
|
10
|
+
import { canUseDOM as oe } from "@progress/kendo-react-common";
|
|
11
|
+
import { Button as h } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { Form as ne } from "@progress/kendo-react-form";
|
|
13
|
+
import { Dialog as ie, DialogActionsBar as le } from "@progress/kendo-react-dialogs";
|
|
14
|
+
import { useLocalization as re } from "@progress/kendo-react-intl";
|
|
15
|
+
import { SchedulerFormEditor as se } from "../editors/SchedulerFormEditor.mjs";
|
|
16
|
+
import { DiscardChangesDialog as ce } from "../editors/DiscardChangesDialog.mjs";
|
|
17
|
+
import { trashIcon as de } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { editorValidationRequired as F, messages as i, editorValidationEnd as w, editorSave as B, editorCancel as T, editorDelete as V, editorValidationStart as q, editorNewEvent as A, editorEditEvent as x } from "../messages/index.mjs";
|
|
19
|
+
import { useSchedulerFieldsContext as ue } from "../context/SchedulerContext.mjs";
|
|
20
|
+
const me = e.forwardRef((l, H) => {
|
|
20
21
|
const {
|
|
21
|
-
onCancel:
|
|
22
|
-
onClose:
|
|
23
|
-
onSubmit:
|
|
22
|
+
onCancel: g,
|
|
23
|
+
onClose: f,
|
|
24
|
+
onSubmit: C,
|
|
24
25
|
onDelete: s,
|
|
25
|
-
editor:
|
|
26
|
-
dialog:
|
|
27
|
-
validator:
|
|
28
|
-
...
|
|
29
|
-
} =
|
|
30
|
-
e.useImperativeHandle(
|
|
31
|
-
const
|
|
32
|
-
() =>
|
|
33
|
-
[
|
|
34
|
-
),
|
|
35
|
-
() =>
|
|
36
|
-
[
|
|
37
|
-
),
|
|
38
|
-
() =>
|
|
39
|
-
[
|
|
40
|
-
),
|
|
41
|
-
() =>
|
|
42
|
-
[
|
|
43
|
-
),
|
|
44
|
-
() =>
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
() =>
|
|
48
|
-
[
|
|
49
|
-
),
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
52
|
-
),
|
|
53
|
-
() =>
|
|
54
|
-
[
|
|
55
|
-
),
|
|
26
|
+
editor: N,
|
|
27
|
+
dialog: O = z.dialog,
|
|
28
|
+
validator: D = z.validator,
|
|
29
|
+
...K
|
|
30
|
+
} = l, r = e.useRef(null);
|
|
31
|
+
e.useImperativeHandle(r, () => ({ props: l })), e.useImperativeHandle(H, () => r.current);
|
|
32
|
+
const o = re(), n = ue(), k = !!(l.dataItem && l.dataItem[n.id]), I = e.useMemo(
|
|
33
|
+
() => o.toLanguageString(F, i[F]),
|
|
34
|
+
[o]
|
|
35
|
+
), L = e.useMemo(
|
|
36
|
+
() => o.toLanguageString(w, i[w]),
|
|
37
|
+
[o]
|
|
38
|
+
), P = e.useMemo(
|
|
39
|
+
() => o.toLanguageString(B, i[B]),
|
|
40
|
+
[o]
|
|
41
|
+
), U = e.useMemo(
|
|
42
|
+
() => o.toLanguageString(T, i[T]),
|
|
43
|
+
[o]
|
|
44
|
+
), j = e.useMemo(
|
|
45
|
+
() => o.toLanguageString(V, i[V]),
|
|
46
|
+
[o]
|
|
47
|
+
), R = e.useMemo(
|
|
48
|
+
() => o.toLanguageString(q, i[q]),
|
|
49
|
+
[o]
|
|
50
|
+
), J = e.useMemo(
|
|
51
|
+
() => o.toLanguageString(A, i[A]),
|
|
52
|
+
[o]
|
|
53
|
+
), Q = e.useMemo(
|
|
54
|
+
() => o.toLanguageString(x, i[x]),
|
|
55
|
+
[o]
|
|
56
|
+
), W = k ? Q : J, S = e.useRef(!1), [c, d] = e.useState(null), u = e.useCallback(
|
|
56
57
|
(t) => {
|
|
57
|
-
|
|
58
|
+
g && g({
|
|
58
59
|
value: null,
|
|
59
60
|
syntheticEvent: t,
|
|
60
|
-
target:
|
|
61
|
+
target: r.current
|
|
61
62
|
});
|
|
62
63
|
},
|
|
63
|
-
[
|
|
64
|
-
),
|
|
65
|
-
(
|
|
66
|
-
|
|
64
|
+
[g]
|
|
65
|
+
), m = e.useCallback(
|
|
66
|
+
(t) => {
|
|
67
|
+
f && f({
|
|
67
68
|
value: null,
|
|
68
69
|
syntheticEvent: t,
|
|
69
|
-
target:
|
|
70
|
+
target: r.current
|
|
70
71
|
});
|
|
71
72
|
},
|
|
72
|
-
[
|
|
73
|
-
),
|
|
74
|
-
(t
|
|
75
|
-
|
|
73
|
+
[f]
|
|
74
|
+
), X = e.useCallback(
|
|
75
|
+
(t) => {
|
|
76
|
+
if (S.current) {
|
|
77
|
+
d({ type: "cancel", syntheticEvent: t });
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
u(t);
|
|
81
|
+
},
|
|
82
|
+
[u]
|
|
83
|
+
), Y = e.useCallback(
|
|
84
|
+
({ syntheticEvent: t }) => {
|
|
85
|
+
if (S.current) {
|
|
86
|
+
d({ type: "close", syntheticEvent: t });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
m(t);
|
|
90
|
+
},
|
|
91
|
+
[m]
|
|
92
|
+
), Z = e.useCallback(() => {
|
|
93
|
+
if (c) {
|
|
94
|
+
const { type: t, syntheticEvent: a } = c;
|
|
95
|
+
d(null), t === "cancel" ? u(a) : m(a);
|
|
96
|
+
}
|
|
97
|
+
}, [c, u, m]), _ = e.useCallback(() => {
|
|
98
|
+
d(null);
|
|
99
|
+
}, []), $ = e.useCallback(
|
|
100
|
+
(t, a) => {
|
|
101
|
+
C && C({
|
|
76
102
|
value: t,
|
|
77
|
-
syntheticEvent:
|
|
78
|
-
target:
|
|
103
|
+
syntheticEvent: a,
|
|
104
|
+
target: r.current
|
|
79
105
|
});
|
|
80
106
|
},
|
|
81
|
-
[
|
|
82
|
-
),
|
|
107
|
+
[C]
|
|
108
|
+
), G = e.useCallback(
|
|
83
109
|
(t) => {
|
|
84
110
|
s && s({
|
|
85
|
-
value:
|
|
111
|
+
value: l.dataItem,
|
|
86
112
|
syntheticEvent: t,
|
|
87
|
-
target:
|
|
113
|
+
target: r.current
|
|
88
114
|
});
|
|
89
115
|
},
|
|
90
|
-
[s,
|
|
91
|
-
),
|
|
92
|
-
(t,
|
|
93
|
-
[
|
|
94
|
-
),
|
|
95
|
-
(t,
|
|
96
|
-
[
|
|
97
|
-
),
|
|
98
|
-
(t) => t ? void 0 :
|
|
99
|
-
[
|
|
100
|
-
),
|
|
101
|
-
(t,
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
].filter(Boolean).reduce((
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
].filter(Boolean).reduce((
|
|
110
|
-
const
|
|
111
|
-
return { ...
|
|
116
|
+
[s, l.dataItem]
|
|
117
|
+
), p = e.useCallback(
|
|
118
|
+
(t, a) => t && a(n.end) && t.getTime() > a(n.end).getTime() ? R : void 0,
|
|
119
|
+
[n, R]
|
|
120
|
+
), y = e.useCallback(
|
|
121
|
+
(t, a) => t && a(n.start) && t.getTime() < a(n.start).getTime() ? L : void 0,
|
|
122
|
+
[n, L]
|
|
123
|
+
), M = e.useCallback(
|
|
124
|
+
(t) => t ? void 0 : I,
|
|
125
|
+
[I]
|
|
126
|
+
), ee = e.useCallback(
|
|
127
|
+
(t, a) => {
|
|
128
|
+
const b = {};
|
|
129
|
+
b[n.start] = [
|
|
130
|
+
M(a(n.start)),
|
|
131
|
+
p(a(n.start), a)
|
|
132
|
+
].filter(Boolean).reduce((E, v) => E || v, ""), b[n.end] = [
|
|
133
|
+
M(a(n.start)),
|
|
134
|
+
y(a(n.start), a)
|
|
135
|
+
].filter(Boolean).reduce((E, v) => E || v, "");
|
|
136
|
+
const te = D(t, a);
|
|
137
|
+
return { ...b, ...te };
|
|
112
138
|
},
|
|
113
|
-
[
|
|
139
|
+
[y, n.end, n.start, M, p, D]
|
|
114
140
|
);
|
|
115
|
-
return
|
|
141
|
+
return oe ? ae.createPortal(
|
|
116
142
|
/* @__PURE__ */ e.createElement(
|
|
117
|
-
|
|
143
|
+
ne,
|
|
118
144
|
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
145
|
+
ignoreModified: !0,
|
|
146
|
+
initialValues: l.dataItem,
|
|
147
|
+
onSubmit: $,
|
|
148
|
+
validator: ee,
|
|
149
|
+
render: (t) => (S.current = t.modified, /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(O, { title: W, width: 650, onClose: Y }, /* @__PURE__ */ e.createElement(se, { ...t, as: N }), /* @__PURE__ */ e.createElement(le, { layout: "end" }, k && s && /* @__PURE__ */ e.createElement(
|
|
150
|
+
h,
|
|
124
151
|
{
|
|
125
152
|
fillMode: "flat",
|
|
126
153
|
themeColor: "primary",
|
|
127
|
-
svgIcon:
|
|
128
|
-
onClick:
|
|
154
|
+
svgIcon: de,
|
|
155
|
+
onClick: G
|
|
129
156
|
},
|
|
130
|
-
|
|
131
|
-
), /* @__PURE__ */ e.createElement(
|
|
132
|
-
|
|
157
|
+
j
|
|
158
|
+
), /* @__PURE__ */ e.createElement(h, { onClick: X }, U), /* @__PURE__ */ e.createElement(
|
|
159
|
+
h,
|
|
133
160
|
{
|
|
134
161
|
themeColor: "primary",
|
|
135
162
|
disabled: !t.allowSubmit,
|
|
136
163
|
onClick: t.onSubmit
|
|
137
164
|
},
|
|
138
|
-
|
|
165
|
+
P
|
|
166
|
+
))), c && /* @__PURE__ */ e.createElement(
|
|
167
|
+
ce,
|
|
168
|
+
{
|
|
169
|
+
onDiscard: Z,
|
|
170
|
+
onCancel: _
|
|
171
|
+
}
|
|
139
172
|
))),
|
|
140
|
-
...
|
|
173
|
+
...K
|
|
141
174
|
}
|
|
142
175
|
),
|
|
143
176
|
document && document.body
|
|
144
177
|
) : null;
|
|
145
|
-
}),
|
|
146
|
-
dialog:
|
|
178
|
+
}), z = {
|
|
179
|
+
dialog: ie,
|
|
147
180
|
validator: () => ({})
|
|
148
181
|
};
|
|
149
|
-
|
|
182
|
+
me.displayName = "KendoReactSchedulerForm";
|
|
150
183
|
export {
|
|
151
|
-
|
|
152
|
-
|
|
184
|
+
me as SchedulerForm,
|
|
185
|
+
z as schedulerFormDefaultProps
|
|
153
186
|
};
|
|
@@ -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 Y=require("react"),L=require("@progress/kendo-react-tooltip"),w=require("@progress/kendo-react-common"),b=require("@progress/kendo-react-buttons"),ee=require("@progress/kendo-react-inputs"),d=require("@progress/kendo-react-form"),P=require("@progress/kendo-react-labels"),x=require("@progress/kendo-react-intl"),R=require("@progress/kendo-date-math"),z=require("@progress/kendo-svg-icons"),E=require("../utils/index.js"),te=require("../hooks/useQuickCreatePlacement.js"),oe=require("../hooks/useCloseOnAnchorScrollOut.js"),t=require("../messages/index.js"),I=require("../context/SchedulerContext.js");function ne(i){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const c in i)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(i,c);Object.defineProperty(a,c,r.get?r:{enumerable:!0,get:()=>i[c]})}}return a.default=i,Object.freeze(a)}const e=ne(Y),N={skeleton:"MMMMd"},A="t",ae=360,Q=6,re=i=>{const{value:a,onChange:c,onKeyDown:r,valid:h,placeholder:p,ariaLabel:m}=i;return e.createElement(ee.TextBox,{"aria-label":m,placeholder:p,autoComplete:"off",value:a!=null?a:"",onChange:c,onKeyDown:r,valid:h})},B=i=>{const{show:a,anchor:c,dataItem:r,validator:h,onSubmit:p,onMoreOptions:m,onCancel:n}=i,g=x.useInternationalization(),u=x.useLocalization(),s=I.useSchedulerFieldsContext(),{timezone:S}=I.useSchedulerPropsContext(),k=te.useQuickCreatePlacement(),y=e.useRef(null),_=e.useCallback(()=>{n==null||n({value:null,syntheticEvent:void 0})},[n]);oe.useCloseOnAnchorScrollOut(a,c,_),e.useEffect(()=>{if(!a)return;const o=l=>{var M,T;const f=l.target,F=(T=(M=y.current)==null?void 0:M.element)==null?void 0:T.closest(".k-popover");(F?F.contains(f):!1)||n==null||n({value:null,syntheticEvent:void 0})};return document.addEventListener("mousedown",o),()=>{document.removeEventListener("mousedown",o)}},[a,c,n]);const v=E.getField(r,s.start),C=E.getField(r,s.end),$=!!E.getField(r,s.isAllDay),j=u.toLanguageString(t.allDay,t.messages[t.allDay]);let D="";if(v&&C){const o=R.ZonedDate.fromLocalDate(v,S),l=R.ZonedDate.fromLocalDate(C,S);D=$?`${g.formatDate(o,N)}, ${j}`:`${g.formatDate(o,N)}, ${g.formatDate(o,A)} - ${g.formatDate(l,A)}`}const O=u.toLanguageString(t.editorNewEvent,t.messages[t.editorNewEvent]),K=u.toLanguageString(t.editorEventTitle,t.messages[t.editorEventTitle]),V=u.toLanguageString(t.quickCreateSave,t.messages[t.quickCreateSave]),W=u.toLanguageString(t.quickCreateMoreOptions,t.messages[t.quickCreateMoreOptions]),G=u.toLanguageString(t.quickCreateCancel,t.messages[t.quickCreateCancel]),Z=e.useCallback((o,l)=>{p({value:o,syntheticEvent:l})},[p]),H=e.useCallback(o=>l=>{if(!m)return;const f={...r};E.setField(f,s.title,o.valueGetter(s.title)),m({value:f,syntheticEvent:l})},[m,r,s.title]),J=e.useCallback(o=>{n&&n({value:null,syntheticEvent:o})},[n]),U=e.useCallback(()=>{n==null||n({value:null,syntheticEvent:void 0})},[n]),q=k.position==="top"||k.position==="bottom",X={vertical:q?Q:0,horizontal:q?0:Q};return e.createElement(d.Form,{key:v?v.getTime():void 0,initialValues:r,validator:h,ignoreModified:!0,onSubmit:Z,render:o=>e.createElement(L.Popover,{anchor:c,show:a,position:k.position,collision:k.collision,callout:!1,title:O,style:{width:ae},onKeyDown:U,animate:{openDuration:1,closeDuration:1},margin:X},e.createElement(d.FormElement,{ref:y,horizontal:!0,className:"k-scheduler-edit-form"},e.createElement(d.FieldWrapper,null,e.createElement(P.Label,{className:"k-form-label"},e.createElement(w.SvgIcon,{icon:z.rightDoubleQuotesIcon,size:"xlarge"})),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(d.Field,{name:s.title,component:re,ariaLabel:K,placeholder:O,onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o.onSubmit(l))}}))),e.createElement(d.FieldWrapper,null,e.createElement(P.Label,{className:"k-form-label"},e.createElement(w.SvgIcon,{icon:z.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(b.Button,{type:"button",fillMode:"flat",themeColor:"primary",onClick:H(o)},W),e.createElement("span",{className:"k-spacer"}),e.createElement(b.Button,{type:"button",onClick:J},G),e.createElement(b.Button,{type:"button",themeColor:"primary",disabled:!o.allowSubmit,onClick:o.onSubmit},V)))})};B.displayName="KendoReactSchedulerQuickCreateForm";const le={};exports.SchedulerQuickCreateForm=B;exports.schedulerQuickCreateFormDefaultProps=le;
|
|
@@ -0,0 +1,148 @@
|
|
|
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 ee, PopoverActionsBar as te } from "@progress/kendo-react-tooltip";
|
|
10
|
+
import { SvgIcon as F } from "@progress/kendo-react-common";
|
|
11
|
+
import { Button as g } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { TextBox as oe } from "@progress/kendo-react-inputs";
|
|
13
|
+
import { Form as ne, FormElement as ae, FieldWrapper as O, Field as le } from "@progress/kendo-react-form";
|
|
14
|
+
import { Label as x } from "@progress/kendo-react-labels";
|
|
15
|
+
import { useInternationalization as re, useLocalization as ie } from "@progress/kendo-react-intl";
|
|
16
|
+
import { ZonedDate as P } from "@progress/kendo-date-math";
|
|
17
|
+
import { rightDoubleQuotesIcon as ce, clockIcon as se } from "@progress/kendo-svg-icons";
|
|
18
|
+
import { getField as k, setField as me } from "../utils/index.mjs";
|
|
19
|
+
import { useQuickCreatePlacement as ue } from "../hooks/useQuickCreatePlacement.mjs";
|
|
20
|
+
import { useCloseOnAnchorScrollOut as de } from "../hooks/useCloseOnAnchorScrollOut.mjs";
|
|
21
|
+
import { allDay as z, messages as c, editorNewEvent as A, editorEventTitle as N, quickCreateSave as I, quickCreateMoreOptions as Q, quickCreateCancel as K } from "../messages/index.mjs";
|
|
22
|
+
import { useSchedulerFieldsContext as pe, useSchedulerPropsContext as fe } from "../context/SchedulerContext.mjs";
|
|
23
|
+
const R = { skeleton: "MMMMd" }, $ = "t", Ee = 360, B = 6, ve = (v) => {
|
|
24
|
+
const { value: a, onChange: s, onKeyDown: l, valid: h, placeholder: u, ariaLabel: m } = v;
|
|
25
|
+
return /* @__PURE__ */ e.createElement(
|
|
26
|
+
oe,
|
|
27
|
+
{
|
|
28
|
+
"aria-label": m,
|
|
29
|
+
placeholder: u,
|
|
30
|
+
autoComplete: "off",
|
|
31
|
+
value: a != null ? a : "",
|
|
32
|
+
onChange: s,
|
|
33
|
+
onKeyDown: l,
|
|
34
|
+
valid: h
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}, he = (v) => {
|
|
38
|
+
const { show: a, anchor: s, dataItem: l, validator: h, onSubmit: u, onMoreOptions: m, onCancel: o } = v, d = re(), i = ie(), r = pe(), { timezone: b } = fe(), p = ue(), y = e.useRef(null), V = e.useCallback(() => {
|
|
39
|
+
o == null || o({ value: null, syntheticEvent: void 0 });
|
|
40
|
+
}, [o]);
|
|
41
|
+
de(a, s, V), e.useEffect(() => {
|
|
42
|
+
if (!a)
|
|
43
|
+
return;
|
|
44
|
+
const t = (n) => {
|
|
45
|
+
var M, T;
|
|
46
|
+
const E = n.target, w = (T = (M = y.current) == null ? void 0 : M.element) == null ? void 0 : T.closest(".k-popover");
|
|
47
|
+
(w ? w.contains(E) : !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 f = k(l, r.start), D = k(l, r.end), _ = !!k(l, r.isAllDay), q = i.toLanguageString(z, c[z]);
|
|
54
|
+
let S = "";
|
|
55
|
+
if (f && D) {
|
|
56
|
+
const t = P.fromLocalDate(f, b), n = P.fromLocalDate(D, b);
|
|
57
|
+
S = _ ? `${d.formatDate(t, R)}, ${q}` : `${d.formatDate(t, R)}, ${d.formatDate(
|
|
58
|
+
t,
|
|
59
|
+
$
|
|
60
|
+
)} - ${d.formatDate(n, $)}`;
|
|
61
|
+
}
|
|
62
|
+
const C = i.toLanguageString(A, c[A]), G = i.toLanguageString(N, c[N]), W = i.toLanguageString(I, c[I]), H = i.toLanguageString(Q, c[Q]), Z = i.toLanguageString(K, c[K]), j = e.useCallback(
|
|
63
|
+
(t, n) => {
|
|
64
|
+
u({ value: t, syntheticEvent: n });
|
|
65
|
+
},
|
|
66
|
+
[u]
|
|
67
|
+
), J = e.useCallback(
|
|
68
|
+
(t) => (n) => {
|
|
69
|
+
if (!m)
|
|
70
|
+
return;
|
|
71
|
+
const E = { ...l };
|
|
72
|
+
me(E, r.title, t.valueGetter(r.title)), m({ value: E, syntheticEvent: n });
|
|
73
|
+
},
|
|
74
|
+
[m, l, r.title]
|
|
75
|
+
), U = e.useCallback(
|
|
76
|
+
(t) => {
|
|
77
|
+
o && o({ value: null, syntheticEvent: t });
|
|
78
|
+
},
|
|
79
|
+
[o]
|
|
80
|
+
), X = e.useCallback(() => {
|
|
81
|
+
o == null || o({ value: null, syntheticEvent: void 0 });
|
|
82
|
+
}, [o]), L = p.position === "top" || p.position === "bottom", Y = {
|
|
83
|
+
vertical: L ? B : 0,
|
|
84
|
+
horizontal: L ? 0 : B
|
|
85
|
+
};
|
|
86
|
+
return /* @__PURE__ */ e.createElement(
|
|
87
|
+
ne,
|
|
88
|
+
{
|
|
89
|
+
key: f ? f.getTime() : void 0,
|
|
90
|
+
initialValues: l,
|
|
91
|
+
validator: h,
|
|
92
|
+
ignoreModified: !0,
|
|
93
|
+
onSubmit: j,
|
|
94
|
+
render: (t) => /* @__PURE__ */ e.createElement(
|
|
95
|
+
ee,
|
|
96
|
+
{
|
|
97
|
+
anchor: s,
|
|
98
|
+
show: a,
|
|
99
|
+
position: p.position,
|
|
100
|
+
collision: p.collision,
|
|
101
|
+
callout: !1,
|
|
102
|
+
title: C,
|
|
103
|
+
style: { width: Ee },
|
|
104
|
+
onKeyDown: X,
|
|
105
|
+
animate: { openDuration: 1, closeDuration: 1 },
|
|
106
|
+
margin: Y
|
|
107
|
+
},
|
|
108
|
+
/* @__PURE__ */ e.createElement(ae, { ref: y, horizontal: !0, className: "k-scheduler-edit-form" }, /* @__PURE__ */ e.createElement(O, null, /* @__PURE__ */ e.createElement(x, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(F, { icon: ce, size: "xlarge" })), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
109
|
+
le,
|
|
110
|
+
{
|
|
111
|
+
name: r.title,
|
|
112
|
+
component: ve,
|
|
113
|
+
ariaLabel: G,
|
|
114
|
+
placeholder: C,
|
|
115
|
+
onKeyDown: (n) => {
|
|
116
|
+
n.key === "Enter" && (n.preventDefault(), t.onSubmit(n));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
))), /* @__PURE__ */ e.createElement(O, null, /* @__PURE__ */ e.createElement(x, { className: "k-form-label" }, /* @__PURE__ */ e.createElement(F, { icon: se, 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)))),
|
|
120
|
+
/* @__PURE__ */ e.createElement(te, null, /* @__PURE__ */ e.createElement(
|
|
121
|
+
g,
|
|
122
|
+
{
|
|
123
|
+
type: "button",
|
|
124
|
+
fillMode: "flat",
|
|
125
|
+
themeColor: "primary",
|
|
126
|
+
onClick: J(t)
|
|
127
|
+
},
|
|
128
|
+
H
|
|
129
|
+
), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement(g, { type: "button", onClick: U }, Z), /* @__PURE__ */ e.createElement(
|
|
130
|
+
g,
|
|
131
|
+
{
|
|
132
|
+
type: "button",
|
|
133
|
+
themeColor: "primary",
|
|
134
|
+
disabled: !t.allowSubmit,
|
|
135
|
+
onClick: t.onSubmit
|
|
136
|
+
},
|
|
137
|
+
W
|
|
138
|
+
))
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
he.displayName = "KendoReactSchedulerQuickCreateForm";
|
|
144
|
+
const ze = {};
|
|
145
|
+
export {
|
|
146
|
+
he as SchedulerQuickCreateForm,
|
|
147
|
+
ze as schedulerQuickCreateFormDefaultProps
|
|
148
|
+
};
|
|
@@ -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 f=require("react"),g=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function C(e){const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),g=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function C(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const n=C(f),s=n.forwardRef((e,r)=>{const t=n.useRef(null),o=n.useRef(null),i=k.useLocalization();n.useImperativeHandle(t,()=>({element:o.current&&o.current.element,...e})),n.useImperativeHandle(r,()=>t.current);const d=n.useCallback(a=>{a.stopPropagation(),!(!e.onClick||!t.current)&&e.onClick.call(void 0,{target:t.current,syntheticEvent:a})},[t,e.slot,e.onClick]),m=n.useCallback(a=>{a.stopPropagation()},[]),b=n.useCallback(a=>{a.stopPropagation()},[]),c=i.toLanguageString(l.moreEvents,l.messages[l.moreEvents]),u=e.hiddenCount!==void 0?`${String(e.hiddenCount)} ${c}`:c;return n.createElement(g.Button,{ref:o,tabIndex:-1,size:"xs",fillMode:"flat",themeColor:"primary",className:"k-more-events",onClick:d,onDoubleClick:b,onFocus:m,"aria-label":u},u)});s.displayName="KendoReactSchedulerShowMoreItemsButton";exports.ShowMoreItemsButton=s;
|
|
@@ -18,7 +18,7 @@ const b = e.forwardRef(
|
|
|
18
18
|
})), e.useImperativeHandle(i, () => n.current);
|
|
19
19
|
const u = e.useCallback(
|
|
20
20
|
(o) => {
|
|
21
|
-
!t.onClick || !n.current
|
|
21
|
+
o.stopPropagation(), !(!t.onClick || !n.current) && t.onClick.call(void 0, {
|
|
22
22
|
target: n.current,
|
|
23
23
|
syntheticEvent: o
|
|
24
24
|
});
|