@progress/kendo-react-scheduler 14.5.0-develop.8 → 15.0.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/README.md +4 -4
- package/Scheduler.d.ts +17 -0
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +128 -128
- package/components/header/view-selector/ViewSelectorList.js +1 -1
- package/components/header/view-selector/ViewSelectorList.mjs +48 -30
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/items/SchedulerItem.js +1 -1
- package/items/SchedulerItem.mjs +110 -110
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +11 -11
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +71 -66
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -12
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +37 -37
- package/components/header/view-selector/ViewSelectorItem.js +0 -8
- package/components/header/view-selector/ViewSelectorItem.mjs +0 -35
|
@@ -6,117 +6,122 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as i from "react";
|
|
9
|
-
import { SchedulerItem as
|
|
10
|
-
import { first as
|
|
11
|
-
import { getRect as
|
|
12
|
-
import { BORDER_WIDTH as
|
|
9
|
+
import { SchedulerItem as oe } from "./SchedulerItem.mjs";
|
|
10
|
+
import { first as se, calculateOrder as ce, intersects as z } from "../utils/index.mjs";
|
|
11
|
+
import { getRect as q, setRect as ae } from "../views/common/utils.mjs";
|
|
12
|
+
import { BORDER_WIDTH as S } from "../constants/index.mjs";
|
|
13
13
|
import { useInternationalization as de } from "@progress/kendo-react-intl";
|
|
14
|
-
import { SchedulerItemContent as
|
|
14
|
+
import { SchedulerItemContent as B } from "./SchedulerItemContent.mjs";
|
|
15
15
|
import { useDir as ue, IconWrap as x } from "@progress/kendo-react-common";
|
|
16
|
-
import {
|
|
16
|
+
import { chevronRightIcon as me, chevronLeftIcon as fe, arrowRotateCwIcon as he, arrowsNoRepeatIcon as ge } from "@progress/kendo-svg-icons";
|
|
17
17
|
import { useRowSync as we } from "../hooks/useRowSync.mjs";
|
|
18
|
-
import { useEditable as
|
|
19
|
-
import { useSchedulerViewItemsContext as
|
|
18
|
+
import { useEditable as ve } from "../hooks/useEditable.mjs";
|
|
19
|
+
import { useSchedulerViewItemsContext as Se, useSchedulerViewSlotsContext as Ie } from "../context/SchedulerViewContext.mjs";
|
|
20
20
|
import { useSchedulerElementContext as ye } from "../context/SchedulerContext.mjs";
|
|
21
|
-
const
|
|
21
|
+
const G = 1, W = 25, Re = i.forwardRef(
|
|
22
22
|
(e, $) => {
|
|
23
|
-
const { item: K, _ref: U, itemRef: j, ...J } = e, b = i.useRef(void 0),
|
|
24
|
-
i.useImperativeHandle(O, () => ({ props: e, element:
|
|
25
|
-
const X = K || Ee.item,
|
|
23
|
+
const { item: K, _ref: U, itemRef: j, ...J } = e, b = i.useRef(void 0), u = i.useRef(null), O = i.useRef(null), T = i.useRef(null), Q = ve(e.editable);
|
|
24
|
+
i.useImperativeHandle(O, () => ({ props: e, element: u.current && u.current.element })), i.useImperativeHandle($, () => O.current), i.useImperativeHandle(U, () => u.current), i.useImperativeHandle(j, () => u.current);
|
|
25
|
+
const X = K || Ee.item, _ = de(), [Z] = Se(), [p] = Ie(), R = ye(), [ee, D] = i.useState(!0), [te, re] = i.useState(!1), f = i.useRef(e.order), F = i.useRef(0), M = ue(R), P = i.useMemo(
|
|
26
26
|
() => {
|
|
27
27
|
var t, r;
|
|
28
|
-
return e.isAllDay ? (t = e.title) != null ? t : "" : `(${
|
|
28
|
+
return e.isAllDay ? (t = e.title) != null ? t : "" : `(${_.format("{0:t} - {1:t}", e.zonedStart, e.zonedEnd)}): ${(r = e.title) != null ? r : ""}`;
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[_, e.isAllDay, e.title, e.zonedEnd, e.zonedStart]
|
|
31
31
|
), k = (t, r) => {
|
|
32
|
-
let
|
|
32
|
+
let d = 1;
|
|
33
33
|
return t.forEach((l) => {
|
|
34
|
-
const a = r.filter((m) =>
|
|
35
|
-
a.length >
|
|
36
|
-
}),
|
|
37
|
-
}, ne = (t, r) => t.map((l) => r.filter((a) =>
|
|
34
|
+
const a = r.filter((m) => H(l.current.props, m.props));
|
|
35
|
+
a.length > d && (d = a.length);
|
|
36
|
+
}), d;
|
|
37
|
+
}, ne = (t, r) => t.map((l) => r.filter((a) => H(l.current.props, a.props))), ie = (t, r) => {
|
|
38
38
|
var E;
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const d = r.filter((n) => n.props.order !== null && n.props.order !== void 0).map((n) => {
|
|
40
|
+
let o = n.props.start, s = n.props.end;
|
|
41
|
+
if (n.props.isAllDay) {
|
|
42
|
+
o = new Date(o.getFullYear(), o.getMonth(), o.getDate());
|
|
43
|
+
const h = new Date(s.getFullYear(), s.getMonth(), s.getDate());
|
|
44
|
+
s = h.getTime() <= o.getTime() ? new Date(o.getFullYear(), o.getMonth(), o.getDate() + 1) : h;
|
|
45
|
+
}
|
|
46
|
+
return { order: n.props.order, start: o, end: s };
|
|
47
|
+
}), l = Array.from(new Set(d.map((n) => n.order))).sort((n, o) => n - o), a = /* @__PURE__ */ new Map();
|
|
48
|
+
for (const n of d)
|
|
44
49
|
a.has(n.order) || a.set(n.order, []), a.get(n.order).push({ start: n.start, end: n.end });
|
|
45
|
-
const m = [],
|
|
50
|
+
const m = [], v = /* @__PURE__ */ new Map();
|
|
46
51
|
for (const n of l) {
|
|
47
|
-
const
|
|
52
|
+
const o = a.get(n);
|
|
48
53
|
let s = -1;
|
|
49
|
-
for (let
|
|
50
|
-
if (
|
|
51
|
-
(I) => m[
|
|
54
|
+
for (let h = 0; h < m.length; h++)
|
|
55
|
+
if (o.every(
|
|
56
|
+
(I) => m[h].every(
|
|
52
57
|
(y) => !z(y.start, y.end, I.start, I.end, !0)
|
|
53
58
|
)
|
|
54
59
|
)) {
|
|
55
|
-
s =
|
|
60
|
+
s = h;
|
|
56
61
|
break;
|
|
57
62
|
}
|
|
58
|
-
s === -1 && (s = m.length, m.push([])), m[s].push(...
|
|
63
|
+
s === -1 && (s = m.length, m.push([])), m[s].push(...o), v.set(n, s);
|
|
59
64
|
}
|
|
60
|
-
return (E =
|
|
61
|
-
},
|
|
65
|
+
return (E = v.get(t)) != null ? E : t;
|
|
66
|
+
}, H = (t, r) => z(t.start, t.end, r.start, r.end) && t.group.index === r.group.index && t.range.index === r.range.index && // When slotDuration equals a full day, both daySlots and timeSlots have isAllDay=true,
|
|
62
67
|
// so we need to also check range.isAllDay to distinguish between them.
|
|
63
68
|
(t.range.isAllDay === void 0 || r.range.isAllDay === void 0 || t.range.isAllDay === r.range.isAllDay) && (e.ignoreIsAllDay || t.isAllDay === r.isAllDay), A = () => {
|
|
64
69
|
var I, y, N, L;
|
|
65
|
-
const t = (p || []).filter((
|
|
70
|
+
const t = (p || []).filter((c) => c.current && H(c.current.props, e)), r = u.current && u.current.element, d = se(t);
|
|
66
71
|
if (t.length === 0) {
|
|
67
|
-
|
|
72
|
+
D(!1);
|
|
68
73
|
return;
|
|
69
74
|
}
|
|
70
|
-
if (!
|
|
75
|
+
if (!d.current || !r)
|
|
71
76
|
return;
|
|
72
|
-
const l =
|
|
73
|
-
(Z || []).forEach((
|
|
74
|
-
|
|
77
|
+
const l = q(d.current.element), a = [], m = [], v = [];
|
|
78
|
+
(Z || []).forEach((c) => {
|
|
79
|
+
c.current && (c.current.props.dragHint ? m.push(c.current) : c.current.props.resizeHint ? v.push(c.current) : a.push(c.current));
|
|
75
80
|
});
|
|
76
81
|
const E = e.dragHint || e.resizeHint ? ce(
|
|
77
|
-
|
|
78
|
-
e.dragHint ? m :
|
|
82
|
+
u.current,
|
|
83
|
+
e.dragHint ? m : v,
|
|
79
84
|
t,
|
|
80
85
|
e.ignoreIsAllDay
|
|
81
86
|
) : (I = e.order) != null ? I : 0;
|
|
82
87
|
if (!e.vertical && !(e.dragHint || e.resizeHint) && e.order !== null && e.order !== void 0) {
|
|
83
|
-
const
|
|
84
|
-
f.current = ie(e.order,
|
|
88
|
+
const c = e.ignoreIsAllDay ? a : a.filter((w) => w.props.isAllDay);
|
|
89
|
+
f.current = ie(e.order, c);
|
|
85
90
|
} else
|
|
86
91
|
f.current = E;
|
|
87
|
-
let n = e.dragHint || e.resizeHint ? k(t, e.dragHint ? m :
|
|
88
|
-
const
|
|
92
|
+
let n = e.dragHint || e.resizeHint ? k(t, e.dragHint ? m : v) : k(t, a);
|
|
93
|
+
const o = ne(t, a);
|
|
89
94
|
let s = 0;
|
|
90
|
-
const
|
|
91
|
-
if (
|
|
95
|
+
const h = !e.vertical && f.current !== null;
|
|
96
|
+
if (o.forEach((c) => {
|
|
92
97
|
let w = 0;
|
|
93
|
-
|
|
94
|
-
if (z(
|
|
95
|
-
const
|
|
96
|
-
|
|
98
|
+
c.forEach((g) => {
|
|
99
|
+
if (z(g.props.start, g.props.end, e.start, e.end) && !(e.dragHint || e.resizeHint) && g._maxSiblingsPerSlot && g._maxSiblingsPerSlot > n && g.element !== r && (n = g._maxSiblingsPerSlot), !h) {
|
|
100
|
+
const Y = q(g.element);
|
|
101
|
+
g.props.order !== null && g.props.order !== void 0 && g.props.order < f.current && (w = Y.top + Y.height - l.top - S * f.current + G);
|
|
97
102
|
}
|
|
98
103
|
}), w > s && (s = w);
|
|
99
|
-
}),
|
|
100
|
-
const
|
|
101
|
-
s = f.current * (w +
|
|
104
|
+
}), h) {
|
|
105
|
+
const c = (y = e.style) == null ? void 0 : y.height, w = typeof c == "number" ? c : W;
|
|
106
|
+
s = f.current * (w + G);
|
|
102
107
|
}
|
|
103
108
|
if (t.length === 0) {
|
|
104
|
-
|
|
109
|
+
D(!1);
|
|
105
110
|
return;
|
|
106
111
|
}
|
|
107
112
|
const V = Q.add ? 20 : 0;
|
|
108
|
-
l.width = e.vertical ? l.width / n -
|
|
113
|
+
l.width = e.vertical ? l.width / n - S - V / n : l.width * t.length - S, e.vertical ? l.height = l.height * t.length - S : (e.resizeHint || e.dragHint) && n <= 1 || (l.height = (L = (N = e.style) == null ? void 0 : N.height) != null ? L : W), l.left = e.vertical ? l.left + f.current * l.width + S * f.current : l.left, l.top = e.vertical ? l.top : l.top + s + S * f.current, F.current = n, ae(r, l), re(!0), D(!0);
|
|
109
114
|
}, C = i.useCallback(
|
|
110
115
|
(t) => {
|
|
111
|
-
const r = t && t[0],
|
|
112
|
-
b.current !== void 0 && window.cancelAnimationFrame(b.current),
|
|
116
|
+
const r = t && t[0], d = T.current;
|
|
117
|
+
b.current !== void 0 && window.cancelAnimationFrame(b.current), d && r && (d.width !== r.contentRect.width || d.height !== r.contentRect.height) && (b.current = window.requestAnimationFrame(() => {
|
|
113
118
|
A();
|
|
114
|
-
})),
|
|
119
|
+
})), T.current = { width: r.contentRect.width, height: r.contentRect.height };
|
|
115
120
|
},
|
|
116
121
|
[A]
|
|
117
122
|
);
|
|
118
123
|
i.useEffect(A);
|
|
119
|
-
const le =
|
|
124
|
+
const le = u.current && u.current.element ? u.current.element.closest(".k-scheduler-layout") : null;
|
|
120
125
|
return we({
|
|
121
126
|
element: le,
|
|
122
127
|
selector: ".k-resource-row",
|
|
@@ -135,10 +140,10 @@ const W = 1, Y = 25, Re = i.forwardRef(
|
|
|
135
140
|
X,
|
|
136
141
|
{
|
|
137
142
|
...J,
|
|
138
|
-
_ref:
|
|
143
|
+
_ref: u,
|
|
139
144
|
_maxSiblingsPerSlot: F,
|
|
140
145
|
_order: f,
|
|
141
|
-
itemRef:
|
|
146
|
+
itemRef: u,
|
|
142
147
|
style: {
|
|
143
148
|
visibility: te ? void 0 : "hidden",
|
|
144
149
|
display: ee ? void 0 : "none",
|
|
@@ -148,15 +153,15 @@ const W = 1, Y = 25, Re = i.forwardRef(
|
|
|
148
153
|
!e.resizeHint && /* @__PURE__ */ i.createElement("span", { className: "k-event-actions" }, e.tail && /* @__PURE__ */ i.createElement(
|
|
149
154
|
x,
|
|
150
155
|
{
|
|
151
|
-
name:
|
|
152
|
-
icon:
|
|
156
|
+
name: M === "rtl" ? "chevron-right" : "chevron-left",
|
|
157
|
+
icon: M === "rtl" ? me : fe
|
|
153
158
|
}
|
|
154
159
|
), e.isRecurring && !e.isException && /* @__PURE__ */ i.createElement(x, { name: "arrow-rotate-cw", icon: he }), !e.isRecurring && e.isException && /* @__PURE__ */ i.createElement(x, { name: "arrows-no-repeat", icon: ge })),
|
|
155
|
-
!e.resizeHint && /* @__PURE__ */ i.createElement("div", { title:
|
|
160
|
+
!e.resizeHint && /* @__PURE__ */ i.createElement("div", { title: P }, !e.isAllDay && /* @__PURE__ */ i.createElement(B, { className: "k-event-time" }, P), /* @__PURE__ */ i.createElement(B, null, e.title))
|
|
156
161
|
);
|
|
157
162
|
}
|
|
158
163
|
), Ee = {
|
|
159
|
-
item:
|
|
164
|
+
item: oe
|
|
160
165
|
};
|
|
161
166
|
Re.displayName = "KendoReactSchedulerViewItem";
|
|
162
167
|
export {
|
package/package-metadata.js
CHANGED
|
@@ -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 e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-scheduler",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1779199914,version:"15.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui"});exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export const packageMetadata = Object.freeze({
|
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCode: 'KENDOUIREACT',
|
|
8
8
|
productCodes: ['KENDOUIREACT'],
|
|
9
|
-
publishDate:
|
|
10
|
-
version: '
|
|
9
|
+
publishDate: 1779199914,
|
|
10
|
+
version: '15.0.0-develop.1',
|
|
11
11
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui'
|
|
12
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-scheduler",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-develop.1",
|
|
4
4
|
"description": "React Scheduler brings the functionality of Outlook's Calendar to a single UI component. KendoReact Scheduler package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@progress/kendo-date-math": "^1.4.1",
|
|
30
30
|
"@progress/kendo-drawing": "^1.21.2",
|
|
31
31
|
"@progress/kendo-licensing": "^1.7.2",
|
|
32
|
-
"@progress/kendo-react-buttons": "
|
|
33
|
-
"@progress/kendo-react-common": "
|
|
34
|
-
"@progress/kendo-react-dateinputs": "
|
|
35
|
-
"@progress/kendo-react-dialogs": "
|
|
36
|
-
"@progress/kendo-react-dropdowns": "
|
|
37
|
-
"@progress/kendo-react-form": "
|
|
38
|
-
"@progress/kendo-react-inputs": "
|
|
39
|
-
"@progress/kendo-react-intl": "
|
|
40
|
-
"@progress/kendo-react-popup": "
|
|
41
|
-
"@progress/kendo-svg-icons": "^4.0.0",
|
|
32
|
+
"@progress/kendo-react-buttons": "15.0.0-develop.1",
|
|
33
|
+
"@progress/kendo-react-common": "15.0.0-develop.1",
|
|
34
|
+
"@progress/kendo-react-dateinputs": "15.0.0-develop.1",
|
|
35
|
+
"@progress/kendo-react-dialogs": "15.0.0-develop.1",
|
|
36
|
+
"@progress/kendo-react-dropdowns": "15.0.0-develop.1",
|
|
37
|
+
"@progress/kendo-react-form": "15.0.0-develop.1",
|
|
38
|
+
"@progress/kendo-react-inputs": "15.0.0-develop.1",
|
|
39
|
+
"@progress/kendo-react-intl": "15.0.0-develop.1",
|
|
40
|
+
"@progress/kendo-react-popup": "15.0.0-develop.1",
|
|
41
|
+
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
42
42
|
"react": "^18.0.0 || ^19.0.0",
|
|
43
43
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
44
44
|
},
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"package": {
|
|
68
68
|
"productName": "KendoReact",
|
|
69
69
|
"productCode": "KENDOUIREACT",
|
|
70
|
-
"publishDate":
|
|
70
|
+
"publishDate": 1779199914,
|
|
71
71
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui"
|
|
72
72
|
}
|
|
73
73
|
},
|
|
@@ -77,5 +77,10 @@
|
|
|
77
77
|
"repository": {
|
|
78
78
|
"type": "git",
|
|
79
79
|
"url": "git+https://github.com/telerik/kendo-react.git"
|
|
80
|
+
},
|
|
81
|
+
"peerDependenciesMeta": {
|
|
82
|
+
"@progress/kendo-svg-icons": {
|
|
83
|
+
"optional": true
|
|
84
|
+
}
|
|
80
85
|
}
|
|
81
86
|
}
|
|
@@ -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 P=require("react"),U=require("prop-types"),$=require("../../components/BaseView.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),U=require("prop-types"),$=require("../../components/BaseView.js"),A=require("../common/VerticalResourceIterator.js"),n=require("../../messages/index.js"),L=require("../../constants/index.js"),l=require("@progress/kendo-date-math"),N=require("@progress/kendo-react-common"),V=require("@progress/kendo-react-intl"),j=require("../../services/rangeService.js"),W=require("../../services/occurrenceService.js"),F=require("../../services/itemsService.js"),R=require("../../utils/index.js"),Y=require("../../tasks/SchedulerEditTask.js"),G=require("../../slots/SchedulerEditSlot.js"),D=require("../../context/SchedulerContext.js"),M=require("../../context/SchedulerResourceIteratorContext.js"),w=require("@progress/kendo-svg-icons"),K=require("../../services/slotsService.js"),z=require("../../hooks/useCellSync.js");function Z(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(c,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return c.default=t,Object.freeze(c)}const e=Z(P),q=t=>{const{group:c,timezone:a,resources:r}=D.useSchedulerPropsContext(),T=t.editTask||Y.SchedulerEditTask,v=t.editSlot||G.SchedulerEditSlot,m=e.useRef(null),i=N.useDir(m),u=V.useInternationalization(),d=V.useLocalization(),[f]=D.useSchedulerDataContext(),y=D.useSchedulerGroupsContext(),_=D.useSchedulerFieldsContext(),s=D.useSchedulerDateRangeContext(),g=e.useMemo(()=>j.toRanges(s,{step:l.MS_PER_DAY,timezone:a}),[s.start.getTime(),s.end.getTime(),a]),h=e.useMemo(()=>K.toSlots(s,{step:l.MS_PER_DAY},{groups:y,ranges:g}),[s.start.getTime(),s.end.getTime(),a,y,g]),I=e.useMemo(()=>W.toOccurrences(f,{dateRange:s,fields:_,timezone:a}),[f,s.start.getTime(),s.end.getTime(),_,a]),k=e.useMemo(()=>F.toItems(I,{timezone:a},{groups:y,ranges:g}),[I,a,y,g]),p=e.useMemo(()=>N.classNames("k-scheduler-agendaview",t.className),[t.className]);return z.useCellSync({element:m,selector:".k-scheduler-datecolumn",explicitDepth:!1}),z.useCellSync({element:m,selector:".k-scheduler-timecolumn",explicitDepth:!1}),e.useMemo(()=>R.mapItemsToSlots(k,h,!0),[k,h]),e.useMemo(()=>R.mapSlotsToItems(k,h,!0),[k,h]),e.createElement($.BaseView,{ref:m,id:t.id,style:t.style,className:p,props:t,slots:k,ranges:g},e.createElement("div",{className:"k-scheduler-head"},e.createElement(A.VerticalResourceIterator,{resources:r,group:c},e.createElement(M.SchedulerResourceIteratorContext.Consumer,null,({groupIndex:S})=>e.createElement("div",{className:"k-scheduler-row",key:S},e.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn"},d.toLanguageString(n.dateTitle,n.messages[n.dateTitle])),e.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell k-scheduler-timecolumn"},d.toLanguageString(n.timeTitle,n.messages[n.timeTitle])),e.createElement("div",{className:"k-scheduler-cell k-heading-cell k-scheduler-eventcolumn"},d.toLanguageString(n.eventTitle,n.messages[n.eventTitle])))))),e.createElement("div",{className:"k-scheduler-body"},e.createElement(A.VerticalResourceIterator,{resources:r,group:c,nested:!0},e.createElement(M.SchedulerResourceIteratorContext.Consumer,null,({groupIndex:S})=>h.filter(o=>o.group.index===(S||0)).map((o,C,O)=>e.createElement("div",{className:"k-scheduler-row k-scheduler-content",key:`${S}:${C}`},e.createElement(v,{...o,editable:t.editable,row:O.length*(S||0)+C,col:0,slot:t.slot,viewSlot:t.viewSlot,className:"k-scheduler-datecolumn k-group-cell"},e.createElement("div",null,e.createElement("strong",{className:"k-scheduler-agendaday"},u.formatDate(o.zonedStart,"dd")),e.createElement("em",{className:"k-scheduler-agendaweek"},u.formatDate(o.zonedStart,"EEEE")),e.createElement("span",{className:"k-scheduler-agendadate"},u.formatDate(o.zonedStart,"y")))),e.createElement("div",{className:"k-scheduler-cell k-group-content"},o.items.length?o.items.map((E,b)=>e.createElement("div",{className:"k-scheduler-row",key:b},e.createElement("div",{className:"k-scheduler-cell k-scheduler-timecolumn"},e.createElement("div",null,E.tail&&e.createElement(N.IconWrap,{name:i==="rtl"?"chevron-right":"chevron-left",icon:i==="rtl"?w.chevronRightIcon:w.chevronLeftIcon}),E.isAllDay?d.toLanguageString(n.allDay,n.messages[n.allDay]):B(u,E),E.head&&e.createElement(N.IconWrap,{name:i==="rtl"?"chevron-left":"chevron-right",icon:i==="rtl"?w.chevronLeftIcon:w.chevronRightIcon}))),e.createElement("div",{className:"k-scheduler-cell"},e.createElement(T,{key:`${C}:${b}`,...E,onDataAction:t.onDataAction,task:t.task,viewTask:t.viewTask,editable:t.editable})))):e.createElement("div",{className:"k-scheduler-cell k-heading-cell k-group-cell"},d.toLanguageString(n.noEvents,n.messages[n.noEvents])))))))))},B=(t,c)=>{let a="{0:t}-{1:t}";return c.head?a="{0:t}":c.tail&&(a="{1:t}"),t.format(a,c.zonedStart,c.zonedEnd)},x=t=>l.getDate(t),H=(t,c)=>l.getDate(l.addDays(t,c||1)),J=({intl:t,date:c,numberOfDays:a=1,timezone:r})=>{const T=l.ZonedDate.fromLocalDate(c,r),v=a===L.DAYS_IN_WEEK_COUNT?x(l.firstDayInWeek(T,t.firstDay())):x(T),m=H(v,a),i=l.ZonedDate.fromUTCDate(R.toUTCDateTime(v),r),u=l.ZonedDate.fromUTCDate(R.toUTCDateTime(m),r),d=new Date(i.getTime()),f=new Date(u.getTime());return{start:d,end:f,zonedStart:i,zonedEnd:u}},Q={name:"agenda",title:t=>t.toLanguageString(n.agendaViewTitle,n.messages[n.agendaViewTitle]),dateRange:J,selectedDateFormat:"{0:D} - {1:D}",selectedShortDateFormat:"{0:d} - {1:d}",slotDuration:1440,slotDivision:1,numberOfDays:L.DAYS_IN_WEEK_COUNT},X={title:U.any};q.propTypes=X;q.displayName="KendoReactSchedulerAgendaView";exports.AgendaView=q;exports.agendaViewDefaultProps=Q;
|
|
@@ -9,37 +9,37 @@ import * as e from "react";
|
|
|
9
9
|
import B from "prop-types";
|
|
10
10
|
import { BaseView as Z } from "../../components/BaseView.mjs";
|
|
11
11
|
import { VerticalResourceIterator as R } from "../common/VerticalResourceIterator.mjs";
|
|
12
|
-
import { dateTitle as C, messages as d, timeTitle as
|
|
12
|
+
import { dateTitle as C, messages as d, timeTitle as z, eventTitle as A, allDay as L, noEvents as _, agendaViewTitle as M } from "../../messages/index.mjs";
|
|
13
13
|
import { DAYS_IN_WEEK_COUNT as G } from "../../constants/index.mjs";
|
|
14
|
-
import { ZonedDate as
|
|
14
|
+
import { ZonedDate as N, firstDayInWeek as j, MS_PER_DAY as V, getDate as W, addDays as q } from "@progress/kendo-date-math";
|
|
15
15
|
import { useDir as H, classNames as J, IconWrap as I } from "@progress/kendo-react-common";
|
|
16
16
|
import { useInternationalization as Q, useLocalization as X } from "@progress/kendo-react-intl";
|
|
17
17
|
import { toRanges as ee } from "../../services/rangeService.mjs";
|
|
18
18
|
import { toOccurrences as te } from "../../services/occurrenceService.mjs";
|
|
19
19
|
import { toItems as ae } from "../../services/itemsService.mjs";
|
|
20
|
-
import { mapItemsToSlots as
|
|
21
|
-
import { SchedulerEditTask as
|
|
22
|
-
import { SchedulerEditSlot as
|
|
23
|
-
import { useSchedulerPropsContext as
|
|
20
|
+
import { mapItemsToSlots as re, mapSlotsToItems as le, toUTCDateTime as b } from "../../utils/index.mjs";
|
|
21
|
+
import { SchedulerEditTask as oe } from "../../tasks/SchedulerEditTask.mjs";
|
|
22
|
+
import { SchedulerEditSlot as ce } from "../../slots/SchedulerEditSlot.mjs";
|
|
23
|
+
import { useSchedulerPropsContext as ne, useSchedulerDataContext as se, useSchedulerGroupsContext as me, useSchedulerFieldsContext as ie, useSchedulerDateRangeContext as de } from "../../context/SchedulerContext.mjs";
|
|
24
24
|
import { SchedulerResourceIteratorContext as x } from "../../context/SchedulerResourceIteratorContext.mjs";
|
|
25
|
-
import {
|
|
25
|
+
import { chevronRightIcon as F, chevronLeftIcon as P } from "@progress/kendo-svg-icons";
|
|
26
26
|
import { toSlots as ue } from "../../services/slotsService.mjs";
|
|
27
27
|
import { useCellSync as U } from "../../hooks/useCellSync.mjs";
|
|
28
28
|
const K = (t) => {
|
|
29
|
-
const { group:
|
|
30
|
-
() => ee(
|
|
31
|
-
[
|
|
29
|
+
const { group: r, timezone: a, resources: m } = ne(), f = t.editTask || oe, D = t.editSlot || ce, i = e.useRef(null), c = H(i), n = Q(), s = X(), [T] = se(), S = me(), p = ie(), l = de(), u = e.useMemo(
|
|
30
|
+
() => ee(l, { step: V, timezone: a }),
|
|
31
|
+
[l.start.getTime(), l.end.getTime(), a]
|
|
32
32
|
), g = e.useMemo(
|
|
33
|
-
() => ue(
|
|
34
|
-
[
|
|
33
|
+
() => ue(l, { step: V }, { groups: S, ranges: u }),
|
|
34
|
+
[l.start.getTime(), l.end.getTime(), a, S, u]
|
|
35
35
|
), y = e.useMemo(
|
|
36
|
-
() => te(T, { dateRange:
|
|
37
|
-
[T,
|
|
36
|
+
() => te(T, { dateRange: l, fields: p, timezone: a }),
|
|
37
|
+
[T, l.start.getTime(), l.end.getTime(), p, a]
|
|
38
38
|
), h = e.useMemo(
|
|
39
39
|
() => ae(y, { timezone: a }, { groups: S, ranges: u }),
|
|
40
40
|
[y, a, S, u]
|
|
41
41
|
), O = e.useMemo(() => J("k-scheduler-agendaview", t.className), [t.className]);
|
|
42
|
-
return U({ element: i, selector: ".k-scheduler-datecolumn", explicitDepth: !1 }), U({ element: i, selector: ".k-scheduler-timecolumn", explicitDepth: !1 }), e.useMemo(() =>
|
|
42
|
+
return U({ element: i, selector: ".k-scheduler-datecolumn", explicitDepth: !1 }), U({ element: i, selector: ".k-scheduler-timecolumn", explicitDepth: !1 }), e.useMemo(() => re(h, g, !0), [h, g]), e.useMemo(() => le(h, g, !0), [h, g]), /* @__PURE__ */ e.createElement(
|
|
43
43
|
Z,
|
|
44
44
|
{
|
|
45
45
|
ref: i,
|
|
@@ -50,64 +50,64 @@ const K = (t) => {
|
|
|
50
50
|
slots: h,
|
|
51
51
|
ranges: u
|
|
52
52
|
},
|
|
53
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-head" }, /* @__PURE__ */ e.createElement(R, { resources: m, group:
|
|
54
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-body" }, /* @__PURE__ */ e.createElement(R, { resources: m, group:
|
|
53
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-head" }, /* @__PURE__ */ e.createElement(R, { resources: m, group: r }, /* @__PURE__ */ e.createElement(x.Consumer, null, ({ groupIndex: k }) => /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-row", key: k }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-heading-cell k-group-cell k-scheduler-datecolumn" }, s.toLanguageString(C, d[C])), /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-heading-cell k-group-cell k-scheduler-timecolumn" }, s.toLanguageString(z, d[z])), /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-heading-cell k-scheduler-eventcolumn" }, s.toLanguageString(A, d[A])))))),
|
|
54
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-body" }, /* @__PURE__ */ e.createElement(R, { resources: m, group: r, nested: !0 }, /* @__PURE__ */ e.createElement(x.Consumer, null, ({ groupIndex: k }) => g.filter((o) => o.group.index === (k || 0)).map((o, v, Y) => /* @__PURE__ */ e.createElement(
|
|
55
55
|
"div",
|
|
56
56
|
{
|
|
57
57
|
className: "k-scheduler-row k-scheduler-content",
|
|
58
|
-
key: `${k}:${
|
|
58
|
+
key: `${k}:${v}`
|
|
59
59
|
},
|
|
60
60
|
/* @__PURE__ */ e.createElement(
|
|
61
61
|
D,
|
|
62
62
|
{
|
|
63
|
-
...
|
|
63
|
+
...o,
|
|
64
64
|
editable: t.editable,
|
|
65
|
-
row: Y.length * (k || 0) +
|
|
65
|
+
row: Y.length * (k || 0) + v,
|
|
66
66
|
col: 0,
|
|
67
67
|
slot: t.slot,
|
|
68
68
|
viewSlot: t.viewSlot,
|
|
69
69
|
className: "k-scheduler-datecolumn k-group-cell"
|
|
70
70
|
},
|
|
71
|
-
/* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", { className: "k-scheduler-agendaday" },
|
|
71
|
+
/* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("strong", { className: "k-scheduler-agendaday" }, n.formatDate(o.zonedStart, "dd")), /* @__PURE__ */ e.createElement("em", { className: "k-scheduler-agendaweek" }, n.formatDate(o.zonedStart, "EEEE")), /* @__PURE__ */ e.createElement("span", { className: "k-scheduler-agendadate" }, n.formatDate(o.zonedStart, "y")))
|
|
72
72
|
),
|
|
73
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-group-content" },
|
|
73
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-group-content" }, o.items.length ? o.items.map((E, w) => /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-row", key: w }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-scheduler-timecolumn" }, /* @__PURE__ */ e.createElement("div", null, E.tail && /* @__PURE__ */ e.createElement(
|
|
74
74
|
I,
|
|
75
75
|
{
|
|
76
|
-
name:
|
|
77
|
-
icon:
|
|
76
|
+
name: c === "rtl" ? "chevron-right" : "chevron-left",
|
|
77
|
+
icon: c === "rtl" ? F : P
|
|
78
78
|
}
|
|
79
|
-
), E.isAllDay ?
|
|
79
|
+
), E.isAllDay ? s.toLanguageString(
|
|
80
80
|
L,
|
|
81
81
|
d[L]
|
|
82
|
-
) : ge(
|
|
82
|
+
) : ge(n, E), E.head && /* @__PURE__ */ e.createElement(
|
|
83
83
|
I,
|
|
84
84
|
{
|
|
85
|
-
name:
|
|
86
|
-
icon:
|
|
85
|
+
name: c === "rtl" ? "chevron-left" : "chevron-right",
|
|
86
|
+
icon: c === "rtl" ? P : F
|
|
87
87
|
}
|
|
88
88
|
))), /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell" }, /* @__PURE__ */ e.createElement(
|
|
89
89
|
f,
|
|
90
90
|
{
|
|
91
|
-
key: `${
|
|
91
|
+
key: `${v}:${w}`,
|
|
92
92
|
...E,
|
|
93
93
|
onDataAction: t.onDataAction,
|
|
94
94
|
task: t.task,
|
|
95
95
|
viewTask: t.viewTask,
|
|
96
96
|
editable: t.editable
|
|
97
97
|
}
|
|
98
|
-
)))) : /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-heading-cell k-group-cell" },
|
|
98
|
+
)))) : /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-cell k-heading-cell k-group-cell" }, s.toLanguageString(_, d[_])))
|
|
99
99
|
)))))
|
|
100
100
|
);
|
|
101
|
-
}, ge = (t,
|
|
101
|
+
}, ge = (t, r) => {
|
|
102
102
|
let a = "{0:t}-{1:t}";
|
|
103
|
-
return
|
|
104
|
-
}, $ = (t) => W(t), he = (t,
|
|
105
|
-
const f =
|
|
103
|
+
return r.head ? a = "{0:t}" : r.tail && (a = "{1:t}"), t.format(a, r.zonedStart, r.zonedEnd);
|
|
104
|
+
}, $ = (t) => W(t), he = (t, r) => W(q(t, r || 1)), ke = ({ intl: t, date: r, numberOfDays: a = 1, timezone: m }) => {
|
|
105
|
+
const f = N.fromLocalDate(r, m), D = $(a === G ? j(f, t.firstDay()) : f), i = he(D, a), c = N.fromUTCDate(b(D), m), n = N.fromUTCDate(b(i), m), s = new Date(c.getTime()), T = new Date(n.getTime());
|
|
106
106
|
return {
|
|
107
|
-
start:
|
|
107
|
+
start: s,
|
|
108
108
|
end: T,
|
|
109
|
-
zonedStart:
|
|
110
|
-
zonedEnd:
|
|
109
|
+
zonedStart: c,
|
|
110
|
+
zonedEnd: n
|
|
111
111
|
};
|
|
112
112
|
}, xe = {
|
|
113
113
|
name: "agenda",
|
|
@@ -1,8 +0,0 @@
|
|
|
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 a=require("react"),u=require("@progress/kendo-react-buttons"),r=require("@progress/kendo-react-intl"),s=require("../../../context/SchedulerContext.js");function m(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const i=m(a),b=e=>{const[n,t]=s.useSchedulerActiveViewContext(),c=r.useLocalization(),o=i.useMemo(()=>typeof e.view.title=="function"?e.view.title.call(void 0,c):e.view.title,[e.view.title,c]),l=i.useCallback(()=>{e.view.name&&t(e.view.name)},[t,e.view.name]);return i.createElement(u.Button,{className:"k-toolbar-button",role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===n,onClick:l},o)};exports.ViewSelectorItem=b;
|
|
@@ -1,35 +0,0 @@
|
|
|
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 t from "react";
|
|
9
|
-
import { Button as c } from "@progress/kendo-react-buttons";
|
|
10
|
-
import { useLocalization as m } from "@progress/kendo-react-intl";
|
|
11
|
-
import { useSchedulerActiveViewContext as u } from "../../../context/SchedulerContext.mjs";
|
|
12
|
-
const b = (e) => {
|
|
13
|
-
const [l, i] = u(), o = m(), a = t.useMemo(
|
|
14
|
-
() => typeof e.view.title == "function" ? e.view.title.call(void 0, o) : e.view.title,
|
|
15
|
-
[e.view.title, o]
|
|
16
|
-
), n = t.useCallback(() => {
|
|
17
|
-
e.view.name && i(e.view.name);
|
|
18
|
-
}, [i, e.view.name]);
|
|
19
|
-
return /* @__PURE__ */ t.createElement(
|
|
20
|
-
c,
|
|
21
|
-
{
|
|
22
|
-
className: "k-toolbar-button",
|
|
23
|
-
role: "button",
|
|
24
|
-
type: "button",
|
|
25
|
-
tabIndex: -1,
|
|
26
|
-
togglable: !0,
|
|
27
|
-
selected: e.view.name === l,
|
|
28
|
-
onClick: n
|
|
29
|
-
},
|
|
30
|
-
a
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
export {
|
|
34
|
-
b as ViewSelectorItem
|
|
35
|
-
};
|