@progress/kendo-react-scheduler 5.6.0-dev.202208291054 → 5.6.0-next.202208310638
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/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/dist/es/Scheduler.js +7 -8
- package/dist/es/components/ShowMoreItemsButton.js +1 -5
- package/dist/es/components/header/navigation/NavigationDatePicker.d.ts +2 -1
- package/dist/es/components/header/navigation/NavigationDatePicker.js +56 -19
- package/dist/es/components/header/view-selector/ViewSelectorList.js +1 -1
- package/dist/es/context/SchedulerContext.d.ts +1 -17
- package/dist/es/context/SchedulerContext.js +2 -15
- package/dist/es/items/SchedulerEditItem.js +3 -6
- package/dist/es/items/SchedulerItem.js +2 -2
- package/dist/es/items/SchedulerProportionalViewItem.js +1 -1
- package/dist/es/items/SchedulerViewItem.js +3 -3
- package/dist/es/messages/index.d.ts +0 -3
- package/dist/es/messages/index.js +0 -3
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/slots/SchedulerSlot.js +1 -1
- package/dist/es/tasks/SchedulerTask.js +2 -2
- package/dist/es/views/agenda/AgendaView.js +2 -2
- package/dist/npm/Scheduler.js +6 -7
- package/dist/npm/components/ShowMoreItemsButton.js +1 -5
- package/dist/npm/components/header/navigation/NavigationDatePicker.d.ts +2 -1
- package/dist/npm/components/header/navigation/NavigationDatePicker.js +55 -18
- package/dist/npm/components/header/view-selector/ViewSelectorList.js +1 -1
- package/dist/npm/context/SchedulerContext.d.ts +1 -17
- package/dist/npm/context/SchedulerContext.js +3 -17
- package/dist/npm/items/SchedulerEditItem.js +1 -4
- package/dist/npm/items/SchedulerItem.js +2 -2
- package/dist/npm/items/SchedulerProportionalViewItem.js +1 -1
- package/dist/npm/items/SchedulerViewItem.js +3 -3
- package/dist/npm/messages/index.d.ts +0 -3
- package/dist/npm/messages/index.js +1 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/slots/SchedulerSlot.js +1 -1
- package/dist/npm/tasks/SchedulerTask.js +2 -2
- package/dist/npm/views/agenda/AgendaView.js +2 -2
- package/dist/systemjs/kendo-react-scheduler.js +1 -1
- package/package.json +12 -12
package/dist/es/Scheduler.js
CHANGED
|
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
21
21
|
import * as React from 'react';
|
|
22
22
|
import * as PropTypes from 'prop-types';
|
|
23
23
|
import { getModelFields, getField, findMaster, setField, toSchedulerGroups, getToday } from './utils';
|
|
24
|
-
import { classNames, useRtl as useDir, clone } from '@progress/kendo-react-common';
|
|
24
|
+
import { classNames, useRtl as useDir, clone, Icon } from '@progress/kendo-react-common';
|
|
25
25
|
import { SchedulerContext } from './context/SchedulerContext';
|
|
26
26
|
import { useControlledState } from './hooks/useControlledState';
|
|
27
27
|
import { useInternationalization, useLocalization } from '@progress/kendo-react-intl';
|
|
@@ -269,7 +269,7 @@ export var Scheduler = React.forwardRef(function (props, ref) {
|
|
|
269
269
|
}
|
|
270
270
|
}, [element]);
|
|
271
271
|
var style = React.useMemo(function () { return (__assign(__assign({}, props.style), { height: props.height })); }, [props.height, props.style]);
|
|
272
|
-
var className = React.useMemo(function () { return classNames({ 'k-rtl': props.rtl !== undefined ? props.rtl : dir === 'rtl' }, 'k-widget k-scheduler k-
|
|
272
|
+
var className = React.useMemo(function () { return classNames({ 'k-rtl': props.rtl !== undefined ? props.rtl : dir === 'rtl' }, 'k-widget k-scheduler k-floatwrap', props.className); }, [props.className, props.rtl, dir]);
|
|
273
273
|
var todayText = localization.toLanguageString(today, messages[today]);
|
|
274
274
|
var previousText = localization.toLanguageString(previousTitle, messages[previousTitle]);
|
|
275
275
|
var nextText = localization.toLanguageString(nextTitle, messages[nextTitle]);
|
|
@@ -277,27 +277,26 @@ export var Scheduler = React.forwardRef(function (props, ref) {
|
|
|
277
277
|
var Footer = view.props.footer || props.footer || defaultProps.footer;
|
|
278
278
|
var Navigation = SchedulerNavigation;
|
|
279
279
|
var ViewSelector = SchedulerViewSelector;
|
|
280
|
-
var _d = React.useState(null), eventSelection = _d[0], setEventSelection = _d[1];
|
|
281
280
|
return (React.createElement(SchedulerContext
|
|
282
281
|
// Static
|
|
283
282
|
, {
|
|
284
283
|
// Static
|
|
285
284
|
element: element, props: props, views: views, fields: fields, groups: groups, dateRange: dateRange, orientation: orientation, dateFormat: { dateFormat: dateFormat, shortDateFormat: shortDateFormat },
|
|
286
285
|
// State
|
|
287
|
-
date: [date, handleDateChange], activeView: [activeViewName, handleActiveViewNameChange],
|
|
286
|
+
date: [date, handleDateChange], activeView: [activeViewName, handleActiveViewNameChange],
|
|
288
287
|
// Reducers
|
|
289
288
|
data: [data, handleDataAction] },
|
|
290
289
|
React.createElement("div", { ref: element, id: props.id, style: style, className: className, tabIndex: props.tabIndex,
|
|
291
290
|
// Aria
|
|
292
|
-
dir: dir, role: props.role, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledby,
|
|
291
|
+
dir: dir, role: props.role, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledby,
|
|
293
292
|
// Handlers
|
|
294
293
|
onFocus: handleFocus, onBlur: handleBlur },
|
|
295
294
|
React.createElement(Header, null,
|
|
296
295
|
React.createElement(Navigation, null,
|
|
297
296
|
React.createElement(ButtonGroup, { className: "k-scheduler-navigation" },
|
|
298
297
|
React.createElement(Button, { role: "button", tabIndex: -1, title: todayText, "aria-label": todayText, onClick: handleTodayClick }, todayText),
|
|
299
|
-
React.createElement(Button, { role: "button", tabIndex: -1, icon: '
|
|
300
|
-
React.createElement(Button, { role: "button", tabIndex: -1, icon: '
|
|
298
|
+
React.createElement(Button, { role: "button", tabIndex: -1, icon: 'caret-alt-left', title: previousText, "aria-label": previousText, onClick: handlePrevClick }),
|
|
299
|
+
React.createElement(Button, { role: "button", tabIndex: -1, icon: 'caret-alt-right', title: nextText, "aria-label": nextText, onClick: handleNextClick }))),
|
|
301
300
|
React.createElement(NavigationDatePicker, { value: date, onChange: handleDatePickerChange }),
|
|
302
301
|
React.createElement(ToolbarSpacer, null),
|
|
303
302
|
React.createElement(ViewSelector, null,
|
|
@@ -305,7 +304,7 @@ export var Scheduler = React.forwardRef(function (props, ref) {
|
|
|
305
304
|
view && (React.createElement(view.type, __assign({ editable: props.editable, key: view.props.name, item: props.item, viewItem: props.viewItem, editItem: props.editItem, task: props.task, viewTask: props.viewTask, editTask: props.viewTask, slot: props.slot, viewSlot: props.viewSlot, editSlot: props.editSlot, form: props.form, onDataAction: handleDataAction, showWorkHours: showWorkHours }, view.props))),
|
|
306
305
|
React.createElement(Footer, null, (slotDuration && slotDuration < (24 * 60)) && (React.createElement(BusinessHours, null,
|
|
307
306
|
React.createElement(Button, { tabIndex: -1, onClick: handleShowWorkHoursClick },
|
|
308
|
-
React.createElement(
|
|
307
|
+
React.createElement(Icon, { name: 'clock' }),
|
|
309
308
|
"\u00A0",
|
|
310
309
|
localization.toLanguageString(showWorkHours
|
|
311
310
|
? showFullDay
|
|
@@ -11,15 +11,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import { Button } from '@progress/kendo-react-buttons';
|
|
14
|
-
import { useLocalization } from '@progress/kendo-react-intl';
|
|
15
|
-
import { messages, moreEvents } from '../messages';
|
|
16
14
|
/**
|
|
17
15
|
* @hidden
|
|
18
16
|
*/
|
|
19
17
|
export var ShowMoreItemsButton = React.forwardRef(function (props, ref) {
|
|
20
18
|
var btn = React.useRef(null);
|
|
21
19
|
var element = React.useRef(null);
|
|
22
|
-
var localization = useLocalization();
|
|
23
20
|
React.useImperativeHandle(btn, function () { return (__assign({ element: element.current && element.current.element }, props)); });
|
|
24
21
|
React.useImperativeHandle(ref, function () { return btn.current; });
|
|
25
22
|
var handleClick = React.useCallback(function (syntheticEvent) {
|
|
@@ -35,8 +32,7 @@ export var ShowMoreItemsButton = React.forwardRef(function (props, ref) {
|
|
|
35
32
|
props.slot,
|
|
36
33
|
props.onClick
|
|
37
34
|
]);
|
|
38
|
-
|
|
39
|
-
return (React.createElement(Button, { ref: element, tabIndex: -1, className: "k-more-events", onClick: handleClick, "aria-label": moreEventsLabel },
|
|
35
|
+
return (React.createElement(Button, { ref: element, tabIndex: -1, className: "k-more-events", onClick: handleClick },
|
|
40
36
|
React.createElement("span", { className: "k-icon k-i-more-horizontal" })));
|
|
41
37
|
});
|
|
42
38
|
ShowMoreItemsButton.displayName = 'KendoReactSchedulerShowMoreItemsButton';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DatePickerProps } from '@progress/kendo-react-dateinputs';
|
|
3
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
4
|
/** @hidden */
|
|
4
|
-
export declare const NavigationDatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<
|
|
5
|
+
export declare const NavigationDatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<Button>>;
|
|
@@ -10,31 +10,31 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import * as React from 'react';
|
|
13
|
-
import {
|
|
13
|
+
import { Calendar } from '@progress/kendo-react-dateinputs';
|
|
14
14
|
import { useInternationalization } from '@progress/kendo-react-intl';
|
|
15
|
-
import { MS_PER_DAY } from '../../../constants';
|
|
16
15
|
import { Button } from '@progress/kendo-react-buttons';
|
|
17
|
-
import { useSchedulerDateFormatContext, useSchedulerDateRangeContext, useSchedulerDateContext, useSchedulerPropsContext } from '../../../context/SchedulerContext';
|
|
18
16
|
import { ZonedDate, getDate } from '@progress/kendo-date-math';
|
|
17
|
+
import { Popup } from '@progress/kendo-react-popup';
|
|
18
|
+
import { useAsyncFocusBlur, useWindow } from '@progress/kendo-react-common';
|
|
19
|
+
import { useSchedulerDateFormatContext, useSchedulerDateRangeContext, useSchedulerDateContext, useSchedulerPropsContext, useSchedulerElementContext } from '../../../context/SchedulerContext';
|
|
19
20
|
import { toUTCDateTime } from '../../../utils';
|
|
21
|
+
import { MS_PER_DAY } from '../../../constants';
|
|
20
22
|
/** @hidden */
|
|
21
23
|
export var NavigationDatePicker = React.forwardRef(function (props, ref) {
|
|
24
|
+
var _a;
|
|
25
|
+
var button = React.useRef(null);
|
|
26
|
+
var calendar = React.useRef(null);
|
|
27
|
+
React.useImperativeHandle(ref, function () { return button.current; });
|
|
22
28
|
var timezone = useSchedulerPropsContext().timezone;
|
|
23
29
|
var normalized = ZonedDate.fromLocalDate(props.value, timezone);
|
|
24
30
|
var value = getDate(normalized);
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, [props.onChange]);
|
|
31
|
-
return (React.createElement(DatePicker, __assign({ ref: ref, dateInput: EMPTY_DATE_INPUT, pickerWrap: EMPTY_PICKER_WRAP, toggleButton: SchedulerNavigationDatePickerToggleButton, width: "auto" }, props, { value: value, onChange: handleChange })));
|
|
32
|
-
});
|
|
33
|
-
var EMPTY_DATE_INPUT = function () { return null; };
|
|
34
|
-
var EMPTY_PICKER_WRAP = function (props) { return React.createElement(React.Fragment, null, props.children); };
|
|
35
|
-
var SchedulerNavigationDatePickerToggleButton = function (props) {
|
|
31
|
+
var element = useSchedulerElementContext();
|
|
32
|
+
var getWindow = useWindow(element);
|
|
33
|
+
var _b = React.useState('desktop'), media = _b[0], setMedia = _b[1];
|
|
34
|
+
var _c = React.useState(false), show = _c[0], setShow = _c[1];
|
|
35
|
+
var _d = React.useState(false), focused = _d[0], setFocused = _d[1];
|
|
36
36
|
var intl = useInternationalization();
|
|
37
|
-
var
|
|
37
|
+
var _e = useSchedulerDateFormatContext(), dateFormat = _e.dateFormat, shortDateFormat = _e.shortDateFormat;
|
|
38
38
|
var dateRange = useSchedulerDateRangeContext();
|
|
39
39
|
var date = useSchedulerDateContext()[0];
|
|
40
40
|
var isMonthView = dateRange.end.getTime() - dateRange.start.getTime() > MS_PER_DAY * 27;
|
|
@@ -48,8 +48,45 @@ var SchedulerNavigationDatePickerToggleButton = function (props) {
|
|
|
48
48
|
: dateRange.zonedStart, isMonthView
|
|
49
49
|
? date
|
|
50
50
|
: dateRange.zonedEnd.addDays(-1));
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
var handleClick = React.useCallback(function () { setShow(!show); }, [show]);
|
|
52
|
+
var handleFocus = React.useCallback(function () { setFocused(true); }, []);
|
|
53
|
+
var handleBlur = React.useCallback(function () {
|
|
54
|
+
setShow(false);
|
|
55
|
+
setFocused(false);
|
|
56
|
+
}, []);
|
|
57
|
+
var handleChange = React.useCallback(function (event) {
|
|
58
|
+
if (props.onChange) {
|
|
59
|
+
var normalizedValue = ZonedDate.fromUTCDate(toUTCDateTime(event.value), timezone);
|
|
60
|
+
props.onChange.call(undefined, __assign(__assign({}, event), { value: normalizedValue }));
|
|
61
|
+
}
|
|
62
|
+
setShow(false);
|
|
63
|
+
}, [props.onChange, timezone]);
|
|
64
|
+
var calculateMedia = React.useCallback(function () {
|
|
65
|
+
setMedia(getWindow().matchMedia('(min-width: 1024px)').matches
|
|
66
|
+
? 'desktop'
|
|
67
|
+
: 'mobile');
|
|
68
|
+
}, [getWindow]);
|
|
69
|
+
React.useEffect(function () {
|
|
70
|
+
calculateMedia();
|
|
71
|
+
var observer = new (getWindow().ResizeObserver)(calculateMedia);
|
|
72
|
+
observer.observe(element.current);
|
|
73
|
+
return function () {
|
|
74
|
+
observer.disconnect();
|
|
75
|
+
};
|
|
76
|
+
}, [calculateMedia, element, getWindow]);
|
|
77
|
+
React.useEffect(function () {
|
|
78
|
+
if (show && focused) {
|
|
79
|
+
if (calendar.current) {
|
|
80
|
+
calendar.current.focus();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, [focused, show]);
|
|
84
|
+
var _f = useAsyncFocusBlur({ onFocus: handleFocus, onBlur: handleBlur }), onFocus = _f.onFocus, onBlur = _f.onBlur;
|
|
85
|
+
return (React.createElement(React.Fragment, null,
|
|
86
|
+
React.createElement(Button, { ref: button, onFocus: onFocus, onBlur: onBlur, fillMode: 'flat', className: 'k-nav-current', icon: "calendar", tabIndex: -1, onClick: handleClick }, media === 'desktop'
|
|
87
|
+
? text
|
|
88
|
+
: shortText),
|
|
89
|
+
React.createElement(Popup, { anchor: (_a = button.current) === null || _a === void 0 ? void 0 : _a.element, show: show },
|
|
90
|
+
React.createElement(Calendar, { ref: calendar, onFocus: onFocus, onBlur: onBlur, onChange: handleChange, value: value }))));
|
|
91
|
+
});
|
|
55
92
|
NavigationDatePicker.displayName = 'KendoReactSchedulerNavigationDatePicker';
|
|
@@ -52,7 +52,7 @@ export var ViewSelectorList = React.forwardRef(function () {
|
|
|
52
52
|
typeof activeView.props.title === 'function'
|
|
53
53
|
? activeView.props.title.call(undefined, localization)
|
|
54
54
|
: activeView.props.title,
|
|
55
|
-
React.createElement("span", { className: "k-icon k-i-
|
|
55
|
+
React.createElement("span", { className: "k-icon k-i-caret-alt-down" }))) })),
|
|
56
56
|
(media === 'desktop') && (React.createElement(ButtonGroup, { className: "k-scheduler-views" }, views.map(function (view) { return (React.createElement(ViewSelectorItem, { key: view.props.name, view: view.props })); })))));
|
|
57
57
|
});
|
|
58
58
|
ViewSelectorList.displayName = 'KendoReactSchedulerViewSelectorList';
|
|
@@ -17,7 +17,6 @@ export interface SchedulerContextProps {
|
|
|
17
17
|
orientation: SchedulerOrientationContextType;
|
|
18
18
|
date: SchedulerDateContextType;
|
|
19
19
|
activeView: SchedulerActiveViewContextType;
|
|
20
|
-
selection: SchedulerItemSelectionContextType;
|
|
21
20
|
data: SchedulerDataContextType;
|
|
22
21
|
}
|
|
23
22
|
/** @hidden */
|
|
@@ -209,20 +208,5 @@ export declare const SchedulerActiveViewContext: React.Context<SchedulerActiveVi
|
|
|
209
208
|
* @returns
|
|
210
209
|
*/
|
|
211
210
|
export declare const useSchedulerActiveViewContext: () => SchedulerActiveViewContextType;
|
|
212
|
-
/**
|
|
213
|
-
* @hidden
|
|
214
|
-
*/
|
|
215
|
-
export declare type SchedulerItemSelectionContextType = [any, any];
|
|
216
|
-
/**
|
|
217
|
-
* @hidden
|
|
218
|
-
*/
|
|
219
|
-
export declare const SchedulerItemSelectionContext: React.Context<SchedulerItemSelectionContextType>;
|
|
220
|
-
/**
|
|
221
|
-
* @hidden
|
|
222
|
-
*/
|
|
223
|
-
export declare const useSchedulerItemSelectionContext: () => SchedulerItemSelectionContextType;
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
*/
|
|
227
211
|
/** @hidden */
|
|
228
|
-
export declare const SchedulerContext: ({ children, element, props, views, fields, groups, dateRange, dateFormat, orientation, date, data, activeView
|
|
212
|
+
export declare const SchedulerContext: ({ children, element, props, views, fields, groups, dateRange, dateFormat, orientation, date, data, activeView }: SchedulerContextProps) => JSX.Element;
|
|
@@ -157,21 +157,9 @@ export var SchedulerActiveViewContext = React.createContext(['day', noop]);
|
|
|
157
157
|
*/
|
|
158
158
|
export var useSchedulerActiveViewContext = function () { return React.useContext(SchedulerActiveViewContext); };
|
|
159
159
|
SchedulerActiveViewContext.displayName = 'SchedulerActiveViewContext';
|
|
160
|
-
/**
|
|
161
|
-
* @hidden
|
|
162
|
-
*/
|
|
163
|
-
export var SchedulerItemSelectionContext = React.createContext([null, function () { }]);
|
|
164
|
-
/**
|
|
165
|
-
* @hidden
|
|
166
|
-
*/
|
|
167
|
-
export var useSchedulerItemSelectionContext = function () { return React.useContext(SchedulerItemSelectionContext); };
|
|
168
|
-
SchedulerItemSelectionContext.displayName = 'SchedulerItemSelectionContext';
|
|
169
|
-
/**
|
|
170
|
-
*
|
|
171
|
-
*/
|
|
172
160
|
/** @hidden */
|
|
173
161
|
export var SchedulerContext = function (_a) {
|
|
174
|
-
var children = _a.children, element = _a.element, props = _a.props, views = _a.views, fields = _a.fields, groups = _a.groups, dateRange = _a.dateRange, dateFormat = _a.dateFormat, orientation = _a.orientation, date = _a.date, data = _a.data, activeView = _a.activeView
|
|
162
|
+
var children = _a.children, element = _a.element, props = _a.props, views = _a.views, fields = _a.fields, groups = _a.groups, dateRange = _a.dateRange, dateFormat = _a.dateFormat, orientation = _a.orientation, date = _a.date, data = _a.data, activeView = _a.activeView;
|
|
175
163
|
return (React.createElement(SchedulerElementContext.Provider, { value: element },
|
|
176
164
|
React.createElement(SchedulerPropsContext.Provider, { value: props },
|
|
177
165
|
React.createElement(SchedulerViewsContext.Provider, { value: views },
|
|
@@ -182,6 +170,5 @@ export var SchedulerContext = function (_a) {
|
|
|
182
170
|
React.createElement(SchedulerOrientationContext.Provider, { value: orientation },
|
|
183
171
|
React.createElement(SchedulerDateContext.Provider, { value: date },
|
|
184
172
|
React.createElement(SchedulerDataContext.Provider, { value: data },
|
|
185
|
-
React.createElement(SchedulerActiveViewContext.Provider, { value: activeView },
|
|
186
|
-
React.createElement(SchedulerItemSelectionContext.Provider, { value: selection }, children)))))))))))));
|
|
173
|
+
React.createElement(SchedulerActiveViewContext.Provider, { value: activeView }, children))))))))))));
|
|
187
174
|
};
|
|
@@ -13,12 +13,12 @@ import * as React from 'react';
|
|
|
13
13
|
import { SchedulerOccurrenceDialog } from '../components/SchedulerOccurrenceDialog';
|
|
14
14
|
import { SchedulerForm } from '../components/SchedulerForm';
|
|
15
15
|
import { SchedulerRemoveDialog } from '../components/SchedulerRemoveDialog';
|
|
16
|
-
import { Keys
|
|
16
|
+
import { Keys } from '@progress/kendo-react-common';
|
|
17
17
|
import { SchedulerDrag } from '../views/common/SchedulerDrag';
|
|
18
18
|
import { SchedulerResize } from '../views/common/SchedulerResize';
|
|
19
19
|
import { SchedulerViewItem } from './SchedulerViewItem';
|
|
20
20
|
import { ITEMS_FOCUS_ACTION, SLOTS_FOCUS_ACTION, useEditable } from '../hooks';
|
|
21
|
-
import { useSchedulerViewFocusedItemsContext, useSchedulerViewFocusedSlotsContext, useSchedulerViewSelectedItemsContext, useSchedulerViewItemsContext
|
|
21
|
+
import { useSchedulerViewFocusedItemsContext, useSchedulerViewFocusedSlotsContext, useSchedulerViewSelectedItemsContext, useSchedulerViewItemsContext } from '../context';
|
|
22
22
|
import { SchedulerEditItemContext } from '../context/SchedulerEditItemContext';
|
|
23
23
|
import { FORM_ITEM_ACTION, useFormItem } from './hooks/use-form-item';
|
|
24
24
|
import { SHOW_OCCURRENCE_DIALOG_ACTION, useShowOccurrenceDialog } from './hooks/use-show-occurrence-dialog';
|
|
@@ -39,7 +39,6 @@ export var SchedulerEditItem = React.forwardRef(function (props, ref) {
|
|
|
39
39
|
var _a = React.useState(props.tabIndex), tabIndex = _a[0], setTabIndex = _a[1];
|
|
40
40
|
var editItem = React.useRef(null);
|
|
41
41
|
var item = React.useRef(null);
|
|
42
|
-
var eventId = React.useMemo(function () { return guid(); }, []);
|
|
43
42
|
React.useImperativeHandle(editItem, function () { return ({ props: props, element: item.current && item.current.element }); });
|
|
44
43
|
React.useImperativeHandle(ref, function () { return editItem.current; });
|
|
45
44
|
React.useImperativeHandle(_ref, function () { return item.current; });
|
|
@@ -179,10 +178,8 @@ export var SchedulerEditItem = React.forwardRef(function (props, ref) {
|
|
|
179
178
|
onMouseUp.call(undefined, event);
|
|
180
179
|
}
|
|
181
180
|
}, [actionsReducerMap, onMouseUp, onMouseUpAction, props, state]);
|
|
182
|
-
var _m = React.useContext(SchedulerItemSelectionContext), setSelectedItem = _m[1];
|
|
183
181
|
var handleClick = React.useCallback(function (event) {
|
|
184
182
|
if (onClickAction) {
|
|
185
|
-
setSelectedItem(item.current);
|
|
186
183
|
var actions = onClickAction(event, props, state);
|
|
187
184
|
if (actions) {
|
|
188
185
|
Array.isArray(actions)
|
|
@@ -415,7 +412,7 @@ export var SchedulerEditItem = React.forwardRef(function (props, ref) {
|
|
|
415
412
|
: undefined);
|
|
416
413
|
}, [items, props.tabIndex, selectedItems.length]);
|
|
417
414
|
return (React.createElement(SchedulerEditItemContext, { props: props, form: [formItem, setFormItem, dispatchFormItem], drag: [dragItem, setDragItem, dispatchDragItem], resize: [resizeItem, setResizeItem, dispatchResizeItem], remove: [removeItem, setRemoveItem, dispatchRemoveItem], showRemoveDialog: [showRemoveDialog, setShowRemoveDialog, dispatchShowRemoveDialog], showOccurrenceDialog: [showOccurrenceDialog, setShowOccurrenceDialog, dispatchShowOccurrenceDialog] },
|
|
418
|
-
React.createElement(ViewItem, __assign({}, props, { _ref: item, itemRef: item, selected: selected, tabIndex: tabIndex,
|
|
415
|
+
React.createElement(ViewItem, __assign({}, props, { _ref: item, itemRef: item, selected: selected, tabIndex: tabIndex,
|
|
419
416
|
// Keyboard
|
|
420
417
|
onKeyDown: handleKeyDown, onKeyUp: handleKeyUp,
|
|
421
418
|
// Focus
|
|
@@ -290,7 +290,7 @@ export var SchedulerItem = React.forwardRef(function (props, ref) {
|
|
|
290
290
|
onDrag: handleResizeEndDrag,
|
|
291
291
|
onRelease: handleResizeRelease
|
|
292
292
|
});
|
|
293
|
-
return (React.createElement("div", { ref: element, id: props.id, style: style, tabIndex: tabIndex, className: className, "aria-label": eventLabel, "aria-selected": props.selected
|
|
293
|
+
return (React.createElement("div", { ref: element, id: props.id, style: style, tabIndex: tabIndex, className: className, "aria-label": eventLabel, "aria-selected": props.selected,
|
|
294
294
|
// Focus
|
|
295
295
|
onFocus: handleFocus, onBlur: handleBlur,
|
|
296
296
|
// Mouse
|
|
@@ -302,7 +302,7 @@ export var SchedulerItem = React.forwardRef(function (props, ref) {
|
|
|
302
302
|
editable.remove
|
|
303
303
|
&& (React.createElement("a", { tabIndex: -1, "aria-hidden": "true", className: "k-link k-event-delete", title: deleteMessage, "aria-label": deleteMessage, onClick: handleRemoveClick },
|
|
304
304
|
React.createElement("span", { className: "k-icon k-i-close" }))),
|
|
305
|
-
props.head && React.createElement("span", { className: "k-icon k-i-
|
|
305
|
+
props.head && React.createElement("span", { className: "k-icon k-i-caret-alt-right" })),
|
|
306
306
|
(editable.resize && props.vertical)
|
|
307
307
|
&& (React.createElement(React.Fragment, null,
|
|
308
308
|
React.createElement("span", { className: "k-resize-handle k-resize-n", ref: resizeNorth }),
|
|
@@ -210,7 +210,7 @@ export var SchedulerProportionalViewItem = React.forwardRef(function (props, ref
|
|
|
210
210
|
}, [handleResize, scheduler]);
|
|
211
211
|
return (React.createElement(Item, __assign({}, itemProps, { _ref: item, _maxSiblingsPerSlot: maxSiblingsPerSlot, itemRef: item, style: __assign({ visibility: visible ? undefined : 'hidden', display: display ? undefined : 'none' }, props.style) }),
|
|
212
212
|
(!props.resizeHint) && React.createElement("span", { className: "k-event-actions" },
|
|
213
|
-
props.tail && React.createElement("span", { className: "k-icon k-i-
|
|
213
|
+
props.tail && React.createElement("span", { className: "k-icon k-i-caret-alt-left" }),
|
|
214
214
|
(props.isRecurring && !props.isException) && React.createElement("span", { className: "k-icon k-i-reload" }),
|
|
215
215
|
(!props.isRecurring && props.isException) && React.createElement("span", { className: "k-icon k-i-non-recurrence" })),
|
|
216
216
|
(!props.resizeHint) && (React.createElement("div", { title: itemTitle },
|
|
@@ -200,9 +200,9 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
200
200
|
}, [handleResize, scheduler]);
|
|
201
201
|
return (React.createElement(Item, __assign({}, itemProps, { _ref: item, _maxSiblingsPerSlot: maxSiblingsPerSlot, itemRef: item, style: __assign({ visibility: visible ? undefined : 'hidden', display: display ? undefined : 'none' }, props.style) }),
|
|
202
202
|
(!props.resizeHint) && React.createElement("span", { className: "k-event-actions" },
|
|
203
|
-
props.tail && React.createElement("span", { className: "k-icon k-i-
|
|
204
|
-
(props.isRecurring && !props.isException) && React.createElement("span", { className: "k-icon k-i-
|
|
205
|
-
(!props.isRecurring && props.isException) && React.createElement("span", { className: "k-icon k-i-
|
|
203
|
+
props.tail && React.createElement("span", { className: "k-icon k-i-caret-alt-left" }),
|
|
204
|
+
(props.isRecurring && !props.isException) && React.createElement("span", { className: "k-icon k-i-arrow-rotate-cw" }),
|
|
205
|
+
(!props.isRecurring && props.isException) && React.createElement("span", { className: "k-icon k-i-arrows-no-repeat" })),
|
|
206
206
|
(!props.resizeHint) && (React.createElement("div", { title: itemTitle },
|
|
207
207
|
!props.isAllDay && (React.createElement(SchedulerItemContent, { className: "k-event-template k-event-time " }, itemTitle)),
|
|
208
208
|
React.createElement(SchedulerItemContent, { className: "k-event-template" }, props.title)))));
|
|
@@ -150,8 +150,6 @@ export declare const editorValidationStart = "scheduler.editorValidationStart";
|
|
|
150
150
|
export declare const editorValidationEnd = "scheduler.editorValidationEnd";
|
|
151
151
|
/** @hidden */
|
|
152
152
|
export declare const noEvents = "scheduler.noEvents";
|
|
153
|
-
/** @hidden */
|
|
154
|
-
export declare const moreEvents = "scheduler.moreEvents";
|
|
155
153
|
/**
|
|
156
154
|
* @hidden
|
|
157
155
|
*/
|
|
@@ -232,5 +230,4 @@ export declare const messages: {
|
|
|
232
230
|
"scheduler.timeTitle": string;
|
|
233
231
|
"scheduler.eventTitle": string;
|
|
234
232
|
"scheduler.noEvents": string;
|
|
235
|
-
"scheduler.moreEvents": string;
|
|
236
233
|
};
|
|
@@ -151,8 +151,6 @@ export var editorValidationStart = 'scheduler.editorValidationStart';
|
|
|
151
151
|
export var editorValidationEnd = 'scheduler.editorValidationEnd';
|
|
152
152
|
/** @hidden */
|
|
153
153
|
export var noEvents = 'scheduler.noEvents';
|
|
154
|
-
/** @hidden */
|
|
155
|
-
export var moreEvents = 'scheduler.moreEvents';
|
|
156
154
|
/**
|
|
157
155
|
* @hidden
|
|
158
156
|
*/
|
|
@@ -233,5 +231,4 @@ export var messages = (_a = {},
|
|
|
233
231
|
_a[timeTitle] = 'Time',
|
|
234
232
|
_a[eventTitle] = 'Event',
|
|
235
233
|
_a[noEvents] = 'no events',
|
|
236
|
-
_a[moreEvents] = 'More events',
|
|
237
234
|
_a);
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-scheduler',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1661927528,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -143,7 +143,7 @@ export var SchedulerSlot = React.forwardRef(function (props, ref) {
|
|
|
143
143
|
target: slot.current
|
|
144
144
|
});
|
|
145
145
|
}, [onKeyUp, slot]);
|
|
146
|
-
return (React.createElement("div", { ref: element, id: props.id, style: style, className: className, tabIndex: tabIndex, "aria-label": slotLabel, "aria-selected": props.selected
|
|
146
|
+
return (React.createElement("div", { ref: element, id: props.id, style: style, className: className, tabIndex: tabIndex, "aria-label": slotLabel, "aria-selected": props.selected,
|
|
147
147
|
// Focus
|
|
148
148
|
onFocus: handleFocus, onBlur: handleBlur,
|
|
149
149
|
// Mouse
|
|
@@ -32,8 +32,8 @@ export var SchedulerTask = React.forwardRef(function (props, ref) {
|
|
|
32
32
|
var className = React.useMemo(function () { return classNames('k-task', props.className); }, [props.className]);
|
|
33
33
|
return (React.createElement("div", { id: props.id, ref: element, style: props.style, className: className, tabIndex: props.tabIndex || undefined },
|
|
34
34
|
color && (React.createElement("span", { className: "k-scheduler-mark", style: { color: color, backgroundColor: color } })),
|
|
35
|
-
props.isRecurring && React.createElement("span", { className: "k-icon k-i-
|
|
36
|
-
props.isException && React.createElement("span", { className: "k-icon k-i-
|
|
35
|
+
props.isRecurring && React.createElement("span", { className: "k-icon k-i-arrow-rotate-cw" }),
|
|
36
|
+
props.isException && React.createElement("span", { className: "k-icon k-i-arrows-no-repeat" }),
|
|
37
37
|
props.title,
|
|
38
38
|
editable.remove && (React.createElement("a", { className: "k-link k-event-delete", title: deleteMessage, "aria-label": deleteMessage, onClick: handleRemoveClick },
|
|
39
39
|
React.createElement("span", { className: "k-icon k-i-close" })))));
|
|
@@ -88,11 +88,11 @@ export var AgendaView = function (props) {
|
|
|
88
88
|
? slot.items.map(function (item, itemIndex) { return (React.createElement("div", { className: "k-scheduler-row", key: itemIndex },
|
|
89
89
|
React.createElement("div", { className: "k-scheduler-cell k-scheduler-timecolumn" },
|
|
90
90
|
React.createElement("div", null,
|
|
91
|
-
item.tail && React.createElement("span", { className: "k-icon k-i-
|
|
91
|
+
item.tail && React.createElement("span", { className: "k-icon k-i-caret-alt-left" }),
|
|
92
92
|
item.isAllDay
|
|
93
93
|
? localization.toLanguageString(allDay, messages[allDay])
|
|
94
94
|
: getTimeFormat(intl, item),
|
|
95
|
-
item.head && React.createElement("span", { className: "k-icon k-i-
|
|
95
|
+
item.head && React.createElement("span", { className: "k-icon k-i-caret-alt-right" }))),
|
|
96
96
|
React.createElement("div", { className: "k-scheduler-cell" },
|
|
97
97
|
React.createElement(EditTask, __assign({ key: "".concat(slotIndex, ":").concat(itemIndex) }, item, { onDataAction: props.onDataAction, task: props.task, viewTask: props.viewTask, editable: props.editable }))))); })
|
|
98
98
|
: React.createElement("div", { className: "k-scheduler-cell k-heading-cell k-group-cell" }, localization.toLanguageString(noEvents, messages[noEvents])))));
|
package/dist/npm/Scheduler.js
CHANGED
|
@@ -272,7 +272,7 @@ exports.Scheduler = React.forwardRef(function (props, ref) {
|
|
|
272
272
|
}
|
|
273
273
|
}, [element]);
|
|
274
274
|
var style = React.useMemo(function () { return (__assign(__assign({}, props.style), { height: props.height })); }, [props.height, props.style]);
|
|
275
|
-
var className = React.useMemo(function () { return (0, kendo_react_common_1.classNames)({ 'k-rtl': props.rtl !== undefined ? props.rtl : dir === 'rtl' }, 'k-widget k-scheduler k-
|
|
275
|
+
var className = React.useMemo(function () { return (0, kendo_react_common_1.classNames)({ 'k-rtl': props.rtl !== undefined ? props.rtl : dir === 'rtl' }, 'k-widget k-scheduler k-floatwrap', props.className); }, [props.className, props.rtl, dir]);
|
|
276
276
|
var todayText = localization.toLanguageString(messages_1.today, messages_1.messages[messages_1.today]);
|
|
277
277
|
var previousText = localization.toLanguageString(messages_1.previousTitle, messages_1.messages[messages_1.previousTitle]);
|
|
278
278
|
var nextText = localization.toLanguageString(messages_1.nextTitle, messages_1.messages[messages_1.nextTitle]);
|
|
@@ -280,27 +280,26 @@ exports.Scheduler = React.forwardRef(function (props, ref) {
|
|
|
280
280
|
var Footer = view.props.footer || props.footer || defaultProps.footer;
|
|
281
281
|
var Navigation = SchedulerNavigation_1.SchedulerNavigation;
|
|
282
282
|
var ViewSelector = SchedulerViewSelector_1.SchedulerViewSelector;
|
|
283
|
-
var _d = React.useState(null), eventSelection = _d[0], setEventSelection = _d[1];
|
|
284
283
|
return (React.createElement(SchedulerContext_1.SchedulerContext
|
|
285
284
|
// Static
|
|
286
285
|
, {
|
|
287
286
|
// Static
|
|
288
287
|
element: element, props: props, views: views, fields: fields, groups: groups, dateRange: dateRange, orientation: orientation, dateFormat: { dateFormat: dateFormat, shortDateFormat: shortDateFormat },
|
|
289
288
|
// State
|
|
290
|
-
date: [date, handleDateChange], activeView: [activeViewName, handleActiveViewNameChange],
|
|
289
|
+
date: [date, handleDateChange], activeView: [activeViewName, handleActiveViewNameChange],
|
|
291
290
|
// Reducers
|
|
292
291
|
data: [data, handleDataAction] },
|
|
293
292
|
React.createElement("div", { ref: element, id: props.id, style: style, className: className, tabIndex: props.tabIndex,
|
|
294
293
|
// Aria
|
|
295
|
-
dir: dir, role: props.role, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledby,
|
|
294
|
+
dir: dir, role: props.role, "aria-label": props.ariaLabel, "aria-labelledby": props.ariaLabelledby,
|
|
296
295
|
// Handlers
|
|
297
296
|
onFocus: handleFocus, onBlur: handleBlur },
|
|
298
297
|
React.createElement(Header, null,
|
|
299
298
|
React.createElement(Navigation, null,
|
|
300
299
|
React.createElement(kendo_react_buttons_1.ButtonGroup, { className: "k-scheduler-navigation" },
|
|
301
300
|
React.createElement(kendo_react_buttons_1.Button, { role: "button", tabIndex: -1, title: todayText, "aria-label": todayText, onClick: handleTodayClick }, todayText),
|
|
302
|
-
React.createElement(kendo_react_buttons_1.Button, { role: "button", tabIndex: -1, icon: '
|
|
303
|
-
React.createElement(kendo_react_buttons_1.Button, { role: "button", tabIndex: -1, icon: '
|
|
301
|
+
React.createElement(kendo_react_buttons_1.Button, { role: "button", tabIndex: -1, icon: 'caret-alt-left', title: previousText, "aria-label": previousText, onClick: handlePrevClick }),
|
|
302
|
+
React.createElement(kendo_react_buttons_1.Button, { role: "button", tabIndex: -1, icon: 'caret-alt-right', title: nextText, "aria-label": nextText, onClick: handleNextClick }))),
|
|
304
303
|
React.createElement(NavigationDatePicker_1.NavigationDatePicker, { value: date, onChange: handleDatePickerChange }),
|
|
305
304
|
React.createElement(kendo_react_buttons_1.ToolbarSpacer, null),
|
|
306
305
|
React.createElement(ViewSelector, null,
|
|
@@ -308,7 +307,7 @@ exports.Scheduler = React.forwardRef(function (props, ref) {
|
|
|
308
307
|
view && (React.createElement(view.type, __assign({ editable: props.editable, key: view.props.name, item: props.item, viewItem: props.viewItem, editItem: props.editItem, task: props.task, viewTask: props.viewTask, editTask: props.viewTask, slot: props.slot, viewSlot: props.viewSlot, editSlot: props.editSlot, form: props.form, onDataAction: handleDataAction, showWorkHours: showWorkHours }, view.props))),
|
|
309
308
|
React.createElement(Footer, null, (slotDuration && slotDuration < (24 * 60)) && (React.createElement(BussinessHours_1.BusinessHours, null,
|
|
310
309
|
React.createElement(kendo_react_buttons_1.Button, { tabIndex: -1, onClick: handleShowWorkHoursClick },
|
|
311
|
-
React.createElement(
|
|
310
|
+
React.createElement(kendo_react_common_1.Icon, { name: 'clock' }),
|
|
312
311
|
"\u00A0",
|
|
313
312
|
localization.toLanguageString(showWorkHours
|
|
314
313
|
? messages_1.showFullDay
|
|
@@ -14,15 +14,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.ShowMoreItemsButton = void 0;
|
|
15
15
|
var React = require("react");
|
|
16
16
|
var kendo_react_buttons_1 = require("@progress/kendo-react-buttons");
|
|
17
|
-
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
18
|
-
var messages_1 = require("../messages");
|
|
19
17
|
/**
|
|
20
18
|
* @hidden
|
|
21
19
|
*/
|
|
22
20
|
exports.ShowMoreItemsButton = React.forwardRef(function (props, ref) {
|
|
23
21
|
var btn = React.useRef(null);
|
|
24
22
|
var element = React.useRef(null);
|
|
25
|
-
var localization = (0, kendo_react_intl_1.useLocalization)();
|
|
26
23
|
React.useImperativeHandle(btn, function () { return (__assign({ element: element.current && element.current.element }, props)); });
|
|
27
24
|
React.useImperativeHandle(ref, function () { return btn.current; });
|
|
28
25
|
var handleClick = React.useCallback(function (syntheticEvent) {
|
|
@@ -38,8 +35,7 @@ exports.ShowMoreItemsButton = React.forwardRef(function (props, ref) {
|
|
|
38
35
|
props.slot,
|
|
39
36
|
props.onClick
|
|
40
37
|
]);
|
|
41
|
-
|
|
42
|
-
return (React.createElement(kendo_react_buttons_1.Button, { ref: element, tabIndex: -1, className: "k-more-events", onClick: handleClick, "aria-label": moreEventsLabel },
|
|
38
|
+
return (React.createElement(kendo_react_buttons_1.Button, { ref: element, tabIndex: -1, className: "k-more-events", onClick: handleClick },
|
|
43
39
|
React.createElement("span", { className: "k-icon k-i-more-horizontal" })));
|
|
44
40
|
});
|
|
45
41
|
exports.ShowMoreItemsButton.displayName = 'KendoReactSchedulerShowMoreItemsButton';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DatePickerProps } from '@progress/kendo-react-dateinputs';
|
|
3
|
+
import { Button } from '@progress/kendo-react-buttons';
|
|
3
4
|
/** @hidden */
|
|
4
|
-
export declare const NavigationDatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<
|
|
5
|
+
export declare const NavigationDatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<Button>>;
|