@progress/kendo-react-scheduler 15.2.0-develop.4 → 15.2.0-develop.6
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 +2 -2
- package/Scheduler.js +1 -1
- package/Scheduler.mjs +394 -302
- package/components/DateHeaderCell.js +1 -1
- package/components/DateHeaderCell.mjs +23 -20
- package/components/MoreEventsPopover.d.ts +25 -0
- package/components/MoreEventsPopover.js +8 -0
- package/components/MoreEventsPopover.mjs +59 -0
- package/components/SchedulerForm.d.ts +4 -0
- package/components/SchedulerForm.js +1 -1
- package/components/SchedulerForm.mjs +113 -100
- package/components/SchedulerRemoveDialog.d.ts +4 -0
- package/components/SchedulerRemoveDialog.js +1 -1
- package/components/SchedulerRemoveDialog.mjs +29 -29
- package/components/ShowMoreItemsButton.d.ts +1 -0
- package/components/ShowMoreItemsButton.js +1 -1
- package/components/ShowMoreItemsButton.mjs +33 -26
- package/components/header/navigation/NavigationDatePicker.d.ts +9 -1
- package/components/header/navigation/NavigationDatePicker.js +1 -1
- package/components/header/navigation/NavigationDatePicker.mjs +65 -71
- package/components/header/view-selector/ViewSelectorList.d.ts +9 -1
- package/components/header/view-selector/ViewSelectorList.js +1 -1
- package/components/header/view-selector/ViewSelectorList.mjs +35 -51
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/editors/RemoveRecurrenceConfirmDialog.d.ts +17 -0
- package/editors/RemoveRecurrenceConfirmDialog.js +8 -0
- package/editors/RemoveRecurrenceConfirmDialog.mjs +28 -0
- package/editors/ResourceEditor.d.ts +1 -0
- package/editors/ResourceEditor.js +1 -1
- package/editors/ResourceEditor.mjs +18 -17
- package/editors/SchedulerFormEditor.d.ts +69 -356
- package/editors/SchedulerFormEditor.js +1 -1
- package/editors/SchedulerFormEditor.mjs +360 -227
- package/editors/SchedulerRecurrenceDialog.d.ts +30 -0
- package/editors/SchedulerRecurrenceDialog.js +8 -0
- package/editors/SchedulerRecurrenceDialog.mjs +463 -0
- package/editors/{FilterableComboBox.d.ts → TimezoneDropDownList.d.ts} +2 -2
- package/editors/TimezoneDropDownList.js +8 -0
- package/editors/TimezoneDropDownList.mjs +42 -0
- package/editors/ZonedDateTime.d.ts +2 -0
- package/editors/ZonedDateTime.js +1 -1
- package/editors/ZonedDateTime.mjs +11 -18
- package/editors/ZonedSplitDateTime.d.ts +34 -0
- package/editors/ZonedSplitDateTime.js +8 -0
- package/editors/ZonedSplitDateTime.mjs +72 -0
- package/hooks/index.d.ts +2 -0
- package/hooks/useGroupRowHeightSync.d.ts +10 -0
- package/hooks/useGroupRowHeightSync.js +8 -0
- package/hooks/useGroupRowHeightSync.mjs +84 -0
- package/hooks/useRecurrenceSummary.d.ts +10 -0
- package/hooks/useRecurrenceSummary.js +8 -0
- package/hooks/useRecurrenceSummary.mjs +69 -0
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +55 -45
- package/hooks/useToolbarResponsive.d.ts +22 -0
- package/hooks/useToolbarResponsive.js +8 -0
- package/hooks/useToolbarResponsive.mjs +37 -0
- package/index.d.mts +5 -2
- package/index.d.ts +5 -2
- package/index.js +1 -1
- package/index.mjs +83 -79
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +361 -347
- package/items/SchedulerItem.d.ts +4 -0
- package/items/SchedulerItem.js +1 -1
- package/items/SchedulerItem.mjs +171 -185
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +111 -94
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +175 -142
- package/messages/index.d.ts +75 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +147 -97
- package/models/Item.d.ts +2 -0
- package/models/Occurrence.d.ts +2 -0
- package/models/SchedulerModelFields.d.ts +5 -0
- package/models/SchedulerResource.d.ts +6 -0
- package/models/SchedulerView.d.ts +3 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -11
- package/services/itemsService.js +1 -1
- package/services/itemsService.mjs +34 -32
- package/services/occurrenceService.js +1 -1
- package/services/occurrenceService.mjs +27 -26
- package/tasks/SchedulerTask.js +1 -1
- package/tasks/SchedulerTask.mjs +26 -26
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +7 -6
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +7 -7
- package/views/day/DayView.js +1 -1
- package/views/day/DayView.mjs +2 -2
- package/views/day/MultiDayView.js +1 -1
- package/views/day/MultiDayView.mjs +2 -2
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +111 -82
- package/views/time/MultiDayTimelineView.js +1 -1
- package/views/time/MultiDayTimelineView.mjs +23 -23
- package/views/time/TimelineView.js +1 -1
- package/views/time/TimelineView.mjs +2 -2
- package/views/week/WeekView.js +1 -1
- package/views/week/WeekView.mjs +5 -5
- package/views/week/WorkWeekView.js +1 -1
- package/views/week/WorkWeekView.mjs +15 -15
- package/editors/FilterableComboBox.js +0 -8
- package/editors/FilterableComboBox.mjs +0 -30
|
@@ -6,41 +6,48 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { useLocalization as
|
|
11
|
-
import { moreEvents as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
element: n.current && n.current.element,
|
|
9
|
+
import { Button as C } from "@progress/kendo-react-buttons";
|
|
10
|
+
import { useLocalization as f } from "@progress/kendo-react-intl";
|
|
11
|
+
import { moreEvents as c, messages as k } from "../messages/index.mjs";
|
|
12
|
+
const b = e.forwardRef(
|
|
13
|
+
(t, i) => {
|
|
14
|
+
const n = e.useRef(null), a = e.useRef(null), s = f();
|
|
15
|
+
e.useImperativeHandle(n, () => ({
|
|
16
|
+
element: a.current && a.current.element,
|
|
18
17
|
...t
|
|
19
|
-
})), e.useImperativeHandle(
|
|
20
|
-
const
|
|
21
|
-
(
|
|
22
|
-
!t.onClick || !
|
|
23
|
-
target:
|
|
24
|
-
syntheticEvent:
|
|
18
|
+
})), e.useImperativeHandle(i, () => n.current);
|
|
19
|
+
const u = e.useCallback(
|
|
20
|
+
(o) => {
|
|
21
|
+
!t.onClick || !n.current || t.onClick.call(void 0, {
|
|
22
|
+
target: n.current,
|
|
23
|
+
syntheticEvent: o
|
|
25
24
|
});
|
|
26
25
|
},
|
|
27
|
-
[
|
|
28
|
-
), m =
|
|
26
|
+
[n, t.slot, t.onClick]
|
|
27
|
+
), m = e.useCallback((o) => {
|
|
28
|
+
o.stopPropagation();
|
|
29
|
+
}, []), d = e.useCallback((o) => {
|
|
30
|
+
o.stopPropagation();
|
|
31
|
+
}, []), l = s.toLanguageString(c, k[c]), r = t.hiddenCount !== void 0 ? `${String(t.hiddenCount)} ${l}` : l;
|
|
29
32
|
return /* @__PURE__ */ e.createElement(
|
|
30
|
-
|
|
33
|
+
C,
|
|
31
34
|
{
|
|
32
|
-
ref:
|
|
35
|
+
ref: a,
|
|
33
36
|
tabIndex: -1,
|
|
37
|
+
size: "xs",
|
|
38
|
+
fillMode: "flat",
|
|
39
|
+
themeColor: "primary",
|
|
34
40
|
className: "k-more-events",
|
|
35
|
-
onClick:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
41
|
+
onClick: u,
|
|
42
|
+
onDoubleClick: d,
|
|
43
|
+
onFocus: m,
|
|
44
|
+
"aria-label": r
|
|
45
|
+
},
|
|
46
|
+
r
|
|
40
47
|
);
|
|
41
48
|
}
|
|
42
49
|
);
|
|
43
|
-
|
|
50
|
+
b.displayName = "KendoReactSchedulerShowMoreItemsButton";
|
|
44
51
|
export {
|
|
45
|
-
|
|
52
|
+
b as ShowMoreItemsButton
|
|
46
53
|
};
|
|
@@ -9,4 +9,12 @@ import { DatePickerProps } from '@progress/kendo-react-dateinputs';
|
|
|
9
9
|
import { ButtonHandle } from '@progress/kendo-react-buttons';
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
/** @hidden */
|
|
12
|
-
export
|
|
12
|
+
export interface NavigationDatePickerProps extends DatePickerProps {
|
|
13
|
+
/**
|
|
14
|
+
* Responsive collapse level from the parent toolbar.
|
|
15
|
+
* When >= 2 the short date format is used.
|
|
16
|
+
*/
|
|
17
|
+
level?: number;
|
|
18
|
+
}
|
|
19
|
+
/** @hidden */
|
|
20
|
+
export declare const NavigationDatePicker: React.ForwardRefExoticComponent<NavigationDatePickerProps & React.RefAttributes<ButtonHandle>>;
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react"),O=require("@progress/kendo-react-dateinputs"),j=require("@progress/kendo-react-intl"),w=require("@progress/kendo-react-buttons"),g=require("@progress/kendo-date-math"),M=require("@progress/kendo-react-popup"),_=require("@progress/kendo-react-common"),U=require("@progress/kendo-svg-icons"),u=require("../../../context/SchedulerContext.js"),V=require("../../../utils/index.js");function Z(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return r.default=t,Object.freeze(r)}const e=Z(N),v=e.forwardRef((t,r)=>{var b;const{level:o=0,...n}=t,i=e.useRef(null),d=e.useRef(null);e.useImperativeHandle(r,()=>i.current);const{timezone:f}=u.useSchedulerPropsContext(),R=g.ZonedDate.fromLocalDate(n.value,f),P=g.getDate(R),[c,m]=e.useState(!1),[h,k]=e.useState(!1),C=j.useInternationalization(),{dateFormat:q,shortDateFormat:x}=u.useSchedulerDateFormatContext(),a=u.useSchedulerDateRangeContext(),[s]=u.useSchedulerDateContext(),l=a.end.getTime()-a.start.getTime()>864e5*27,y=C.format(q,l?s:a.zonedStart,l?s:a.zonedEnd.addDays(-1)),z=C.format(x,l?s:a.zonedStart,l?s:a.zonedEnd.addDays(-1)),F=e.useCallback(()=>{m(!c)},[c]),T=e.useCallback(()=>{k(!0)},[]),E=e.useCallback(()=>{m(!1),k(!1)},[]),I=e.useCallback(S=>{if(n.onChange){const B=g.ZonedDate.fromUTCDate(V.toUTCDateTime(S.value),f);n.onChange({...S,value:B})}m(!1)},[n,f]);e.useEffect(()=>{c&&h&&d.current&&d.current.focus()},[h,c]);const{onFocus:D,onBlur:p}=_.useAsyncFocusBlur({onFocus:T,onBlur:E});return e.createElement(e.Fragment,null,e.createElement(w.Button,{ref:i,onFocus:D,onBlur:p,fillMode:"flat",className:"k-nav-current k-toolbar-button",icon:"calendar",svgIcon:U.calendarIcon,"aria-live":"polite",tabIndex:-1,onClick:F},o>=2?z:y),e.createElement(M.Popup,{anchor:(b=i.current)==null?void 0:b.element,show:c},e.createElement(O.Calendar,{ref:d,onFocus:D,onBlur:p,onChange:I,value:P})))});v.displayName="KendoReactSchedulerNavigationDatePicker";exports.NavigationDatePicker=v;
|
|
@@ -6,76 +6,70 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import { Calendar as
|
|
10
|
-
import { useInternationalization as
|
|
11
|
-
import { Button as
|
|
12
|
-
import { ZonedDate as
|
|
13
|
-
import { Popup as
|
|
14
|
-
import {
|
|
15
|
-
import { calendarIcon as
|
|
16
|
-
import { useSchedulerPropsContext as
|
|
17
|
-
import { toUTCDateTime as
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
onClick: B
|
|
74
|
-
},
|
|
75
|
-
E === "desktop" ? M : T
|
|
76
|
-
), /* @__PURE__ */ e.createElement(W, { anchor: (k = u.current) == null ? void 0 : k.element, show: n }, /* @__PURE__ */ e.createElement(N, { ref: i, onFocus: v, onBlur: D, onChange: y, value: z })));
|
|
77
|
-
});
|
|
78
|
-
J.displayName = "KendoReactSchedulerNavigationDatePicker";
|
|
9
|
+
import { Calendar as w } from "@progress/kendo-react-dateinputs";
|
|
10
|
+
import { useInternationalization as y } from "@progress/kendo-react-intl";
|
|
11
|
+
import { Button as N } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { ZonedDate as g, getDate as M } from "@progress/kendo-date-math";
|
|
13
|
+
import { Popup as U } from "@progress/kendo-react-popup";
|
|
14
|
+
import { useAsyncFocusBlur as V } from "@progress/kendo-react-common";
|
|
15
|
+
import { calendarIcon as A } from "@progress/kendo-svg-icons";
|
|
16
|
+
import { useSchedulerPropsContext as H, useSchedulerDateFormatContext as K, useSchedulerDateRangeContext as L, useSchedulerDateContext as Z } from "../../../context/SchedulerContext.mjs";
|
|
17
|
+
import { toUTCDateTime as j } from "../../../utils/index.mjs";
|
|
18
|
+
const q = e.forwardRef(
|
|
19
|
+
(D, k) => {
|
|
20
|
+
var p;
|
|
21
|
+
const { level: v = 0, ...a } = D, s = e.useRef(null), c = e.useRef(null);
|
|
22
|
+
e.useImperativeHandle(k, () => s.current);
|
|
23
|
+
const { timezone: l } = H(), S = g.fromLocalDate(a.value, l), F = M(S), [o, u] = e.useState(!1), [m, i] = e.useState(!1), d = y(), { dateFormat: b, shortDateFormat: x } = K(), t = L(), [n] = Z(), r = t.end.getTime() - t.start.getTime() > 864e5 * 27, z = d.format(
|
|
24
|
+
b,
|
|
25
|
+
r ? n : t.zonedStart,
|
|
26
|
+
r ? n : t.zonedEnd.addDays(-1)
|
|
27
|
+
), E = d.format(
|
|
28
|
+
x,
|
|
29
|
+
r ? n : t.zonedStart,
|
|
30
|
+
r ? n : t.zonedEnd.addDays(-1)
|
|
31
|
+
), R = e.useCallback(() => {
|
|
32
|
+
u(!o);
|
|
33
|
+
}, [o]), P = e.useCallback(() => {
|
|
34
|
+
i(!0);
|
|
35
|
+
}, []), T = e.useCallback(() => {
|
|
36
|
+
u(!1), i(!1);
|
|
37
|
+
}, []), B = e.useCallback(
|
|
38
|
+
(C) => {
|
|
39
|
+
if (a.onChange) {
|
|
40
|
+
const I = g.fromUTCDate(j(C.value), l);
|
|
41
|
+
a.onChange({
|
|
42
|
+
...C,
|
|
43
|
+
value: I
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
u(!1);
|
|
47
|
+
},
|
|
48
|
+
[a, l]
|
|
49
|
+
);
|
|
50
|
+
e.useEffect(() => {
|
|
51
|
+
o && m && c.current && c.current.focus();
|
|
52
|
+
}, [m, o]);
|
|
53
|
+
const { onFocus: f, onBlur: h } = V({ onFocus: P, onBlur: T });
|
|
54
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
55
|
+
N,
|
|
56
|
+
{
|
|
57
|
+
ref: s,
|
|
58
|
+
onFocus: f,
|
|
59
|
+
onBlur: h,
|
|
60
|
+
fillMode: "flat",
|
|
61
|
+
className: "k-nav-current k-toolbar-button",
|
|
62
|
+
icon: "calendar",
|
|
63
|
+
svgIcon: A,
|
|
64
|
+
"aria-live": "polite",
|
|
65
|
+
tabIndex: -1,
|
|
66
|
+
onClick: R
|
|
67
|
+
},
|
|
68
|
+
v >= 2 ? E : z
|
|
69
|
+
), /* @__PURE__ */ e.createElement(U, { anchor: (p = s.current) == null ? void 0 : p.element, show: o }, /* @__PURE__ */ e.createElement(w, { ref: c, onFocus: f, onBlur: h, onChange: B, value: F })));
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
q.displayName = "KendoReactSchedulerNavigationDatePicker";
|
|
79
73
|
export {
|
|
80
|
-
|
|
74
|
+
q as NavigationDatePicker
|
|
81
75
|
};
|
|
@@ -7,4 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
/** @hidden */
|
|
10
|
-
export
|
|
10
|
+
export interface ViewSelectorListProps {
|
|
11
|
+
/**
|
|
12
|
+
* Responsive collapse level from the parent toolbar.
|
|
13
|
+
* When >= 1 the SegmentedControl collapses to a MenuButton.
|
|
14
|
+
*/
|
|
15
|
+
level?: number;
|
|
16
|
+
}
|
|
17
|
+
/** @hidden */
|
|
18
|
+
export declare const ViewSelectorList: React.ForwardRefExoticComponent<ViewSelectorListProps & React.RefAttributes<unknown>>;
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),S=require("@progress/kendo-react-intl"),u=require("@progress/kendo-react-buttons"),k=require("@progress/kendo-react-common"),h=require("@progress/kendo-svg-icons"),m=require("../../../context/SchedulerContext.js");function C(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const n in o)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(o,n);Object.defineProperty(c,n,s.get?s:{enumerable:!0,get:()=>o[n]})}}return c.default=o,Object.freeze(c)}const t=C(w),d=t.forwardRef((o,c)=>{const n=o,{level:s=0}=n,i=m.useSchedulerViewsContext(),[p,r]=m.useSchedulerActiveViewContext(),l=i.find(e=>e.props.name===p),a=S.useLocalization(),f=t.useCallback(e=>{r&&(e.syntheticEvent.preventDefault(),r(e.item.name))},[r]),b=t.useCallback(e=>{r&&r(e)},[r]),g=t.useMemo(()=>i.map(e=>({value:e.props.name,text:typeof e.props.title=="function"?e.props.title(a):e.props.title,tabIndex:-1})),[i,a]);return s>=1&&l?t.createElement(u.DropDownButton,{className:"k-toolbar-menu-button",fillMode:"flat",onItemClick:f,popupSettings:{popupClass:"k-scheduler-toolbar"},textField:"title",items:i.map(e=>({...e.props,selected:e.props.name===p,title:typeof e.props.title=="function"?e.props.title(a):e.props.title})),text:typeof l.props.title=="function"?l.props.title(a):l.props.title,endIcon:t.createElement("span",{className:"k-menu-button-arrow k-button-arrow"},t.createElement(k.SvgIcon,{icon:h.chevronDownIcon}))}):t.createElement(u.SegmentedControl,{className:"k-scheduler-views",role:"group",value:p,onChange:b,items:g})});d.displayName="KendoReactSchedulerViewSelectorList";exports.ViewSelectorList=d;
|
|
@@ -6,74 +6,58 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
|
-
import { useLocalization as
|
|
10
|
-
import { DropDownButton as
|
|
11
|
-
import {
|
|
9
|
+
import { useLocalization as f } from "@progress/kendo-react-intl";
|
|
10
|
+
import { DropDownButton as d, SegmentedControl as w } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { SvgIcon as h } from "@progress/kendo-react-common";
|
|
12
12
|
import { chevronDownIcon as C } from "@progress/kendo-svg-icons";
|
|
13
|
-
import { useSchedulerViewsContext as
|
|
14
|
-
const
|
|
15
|
-
const
|
|
13
|
+
import { useSchedulerViewsContext as k, useSchedulerActiveViewContext as S } from "../../../context/SchedulerContext.mjs";
|
|
14
|
+
const b = t.forwardRef((l, g) => {
|
|
15
|
+
const p = l, { level: a = 0 } = p, n = k(), [i, o] = S(), r = n.find((e) => e.props.name === i), s = f(), c = t.useCallback(
|
|
16
16
|
(e) => {
|
|
17
17
|
o && (e.syntheticEvent.preventDefault(), o(e.item.name));
|
|
18
18
|
},
|
|
19
19
|
[o]
|
|
20
|
-
),
|
|
20
|
+
), m = t.useCallback(
|
|
21
21
|
(e) => {
|
|
22
22
|
o && o(e);
|
|
23
23
|
},
|
|
24
24
|
[o]
|
|
25
|
-
),
|
|
26
|
-
() =>
|
|
25
|
+
), u = t.useMemo(
|
|
26
|
+
() => n.map((e) => ({
|
|
27
27
|
value: e.props.name,
|
|
28
|
-
text: typeof e.props.title == "function" ? e.props.title(
|
|
28
|
+
text: typeof e.props.title == "function" ? e.props.title(s) : e.props.title,
|
|
29
29
|
tabIndex: -1
|
|
30
30
|
})),
|
|
31
|
-
[
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return t.useEffect(() => {
|
|
36
|
-
m();
|
|
37
|
-
const e = l().ResizeObserver, c = e && new e(m);
|
|
38
|
-
return c && c.observe(n.current), () => {
|
|
39
|
-
c && c.disconnect();
|
|
40
|
-
};
|
|
41
|
-
}, []), /* @__PURE__ */ t.createElement(t.Fragment, null, r && p === "mobile" && /* @__PURE__ */ t.createElement(
|
|
42
|
-
"div",
|
|
31
|
+
[n, s]
|
|
32
|
+
);
|
|
33
|
+
return a >= 1 && r ? /* @__PURE__ */ t.createElement(
|
|
34
|
+
d,
|
|
43
35
|
{
|
|
44
|
-
className: "k-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
text: /* @__PURE__ */ t.createElement(t.Fragment, null, typeof r.props.title == "function" ? r.props.title(i) : r.props.title, /* @__PURE__ */ t.createElement(v, { name: "chevron-down", icon: C }))
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
), p === "desktop" && /* @__PURE__ */ t.createElement(
|
|
63
|
-
b,
|
|
36
|
+
className: "k-toolbar-menu-button",
|
|
37
|
+
fillMode: "flat",
|
|
38
|
+
onItemClick: c,
|
|
39
|
+
popupSettings: { popupClass: "k-scheduler-toolbar" },
|
|
40
|
+
textField: "title",
|
|
41
|
+
items: n.map((e) => ({
|
|
42
|
+
...e.props,
|
|
43
|
+
selected: e.props.name === i,
|
|
44
|
+
title: typeof e.props.title == "function" ? e.props.title(s) : e.props.title
|
|
45
|
+
})),
|
|
46
|
+
text: typeof r.props.title == "function" ? r.props.title(s) : r.props.title,
|
|
47
|
+
endIcon: /* @__PURE__ */ t.createElement("span", { className: "k-menu-button-arrow k-button-arrow" }, /* @__PURE__ */ t.createElement(h, { icon: C }))
|
|
48
|
+
}
|
|
49
|
+
) : /* @__PURE__ */ t.createElement(
|
|
50
|
+
w,
|
|
64
51
|
{
|
|
65
|
-
ref: (e) => {
|
|
66
|
-
e && (n.current = e.element);
|
|
67
|
-
},
|
|
68
52
|
className: "k-scheduler-views",
|
|
69
53
|
role: "group",
|
|
70
|
-
value:
|
|
71
|
-
onChange:
|
|
72
|
-
items:
|
|
54
|
+
value: i,
|
|
55
|
+
onChange: m,
|
|
56
|
+
items: u
|
|
73
57
|
}
|
|
74
|
-
)
|
|
58
|
+
);
|
|
75
59
|
});
|
|
76
|
-
|
|
60
|
+
b.displayName = "KendoReactSchedulerViewSelectorList";
|
|
77
61
|
export {
|
|
78
|
-
|
|
62
|
+
b as ViewSelectorList
|
|
79
63
|
};
|