@progress/kendo-react-scheduler 4.9.0-dev.202109140702 → 4.10.0-dev.202109210826
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 +2 -2
- package/dist/es/hooks/useSlotExpand.d.ts +2 -2
- package/dist/es/hooks/useSlotExpand.js +44 -8
- package/dist/es/items/SchedulerEditItem.d.ts +1 -1
- package/dist/es/items/SchedulerViewItem.js +35 -5
- package/dist/es/main.d.ts +2 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/slots/SchedulerViewSlot.d.ts +12 -4
- package/dist/es/utils/index.d.ts +4 -0
- package/dist/es/utils/index.js +6 -0
- package/dist/es/views/common/utils.js +1 -1
- package/dist/es/views/month/MonthView.js +2 -1
- package/dist/es/views/time/MultiDayTimelineView.js +4 -2
- package/dist/npm/hooks/useSlotExpand.d.ts +2 -2
- package/dist/npm/hooks/useSlotExpand.js +44 -8
- package/dist/npm/items/SchedulerEditItem.d.ts +1 -1
- package/dist/npm/items/SchedulerViewItem.js +35 -5
- package/dist/npm/main.d.ts +2 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/slots/SchedulerViewSlot.d.ts +12 -4
- package/dist/npm/utils/index.d.ts +4 -0
- package/dist/npm/utils/index.js +6 -0
- package/dist/npm/views/common/utils.js +1 -1
- package/dist/npm/views/month/MonthView.js +1 -0
- package/dist/npm/views/time/MultiDayTimelineView.js +3 -1
- package/dist/systemjs/kendo-react-scheduler.js +1 -1
- package/package.json +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SchedulerSlotHandle } from '../slots/SchedulerSlot';
|
|
3
|
-
import {
|
|
3
|
+
import { SchedulerSlotExpandableConfig } from '../slots/SchedulerViewSlot';
|
|
4
4
|
/** @hidden */
|
|
5
|
-
export declare const useSlotExpand: (slot: React.RefObject<SchedulerSlotHandle>, config?: boolean |
|
|
5
|
+
export declare const useSlotExpand: (slot: React.RefObject<SchedulerSlotHandle>, config?: boolean | SchedulerSlotExpandableConfig) => void;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getPadding, setRect, getRect } from '../views/common/utils';
|
|
3
3
|
import { BORDER_WIDTH } from '../constants';
|
|
4
|
+
import { useSchedulerElementContext } from '../context';
|
|
4
5
|
/** @hidden */
|
|
5
6
|
export var useSlotExpand = function (slot, config) {
|
|
7
|
+
var timeout = React.useRef();
|
|
6
8
|
var initialHeight = React.useRef(0);
|
|
9
|
+
var scheduler = useSchedulerElementContext();
|
|
7
10
|
var getInitialHeight = function () {
|
|
8
11
|
if (!slot.current) {
|
|
9
12
|
return;
|
|
@@ -14,7 +17,7 @@ export var useSlotExpand = function (slot, config) {
|
|
|
14
17
|
}
|
|
15
18
|
initialHeight.current = element.clientHeight;
|
|
16
19
|
};
|
|
17
|
-
var expand = function () {
|
|
20
|
+
var expand = React.useCallback(function () {
|
|
18
21
|
if (!config || !slot.current) {
|
|
19
22
|
return;
|
|
20
23
|
}
|
|
@@ -33,19 +36,52 @@ export var useSlotExpand = function (slot, config) {
|
|
|
33
36
|
return;
|
|
34
37
|
}
|
|
35
38
|
var height = getRect(item._ref.current.element).height;
|
|
36
|
-
|
|
37
|
-
highest = height;
|
|
38
|
-
}
|
|
39
|
+
highest += height;
|
|
39
40
|
});
|
|
40
|
-
var minHeight = ((
|
|
41
|
-
|
|
41
|
+
var minHeight = ((existing.length * BORDER_WIDTH * 2)
|
|
42
|
+
+ highest
|
|
42
43
|
- (slotPadding || 0)
|
|
43
44
|
+ (typeof config === 'object' && config.offsetTop ? config.offsetTop : 0)
|
|
44
45
|
+ (typeof config === 'object' && config.offsetBottom ? config.offsetBottom : 0));
|
|
45
|
-
if (minHeight > (initialHeight.current)) {
|
|
46
|
+
if (minHeight > (initialHeight.current - slotPadding)) {
|
|
46
47
|
setRect(element, { height: minHeight }, true);
|
|
47
48
|
}
|
|
48
|
-
};
|
|
49
|
+
}, [config, slot]);
|
|
50
|
+
var handleResize = React.useCallback(function () {
|
|
51
|
+
if (timeout.current !== undefined) {
|
|
52
|
+
window.cancelAnimationFrame(timeout.current);
|
|
53
|
+
}
|
|
54
|
+
timeout.current = window.requestAnimationFrame(function () {
|
|
55
|
+
expand();
|
|
56
|
+
});
|
|
57
|
+
}, [expand]);
|
|
58
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
59
|
React.useLayoutEffect(getInitialHeight, []);
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
61
|
React.useEffect(expand, [slot, slot.current && slot.current.props, config]);
|
|
62
|
+
React.useEffect(function () {
|
|
63
|
+
if (!slot.current) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
var props = slot.current.props;
|
|
67
|
+
var existing = props.items.filter(function (i) {
|
|
68
|
+
return i._ref.current;
|
|
69
|
+
});
|
|
70
|
+
var callbacks = existing.map(function (item) {
|
|
71
|
+
if (!item._ref.current || !item._ref.current.element) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!scheduler.current) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
var observer = new window.ResizeObserver(handleResize);
|
|
78
|
+
observer.observe(item._ref.current.element);
|
|
79
|
+
return function () {
|
|
80
|
+
observer.disconnect();
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
return function () {
|
|
84
|
+
callbacks.forEach(function (cb) { return cb && cb(); });
|
|
85
|
+
};
|
|
86
|
+
}, [handleResize, scheduler, slot]);
|
|
51
87
|
};
|
|
@@ -21,7 +21,7 @@ export interface SchedulerEditItemStateChangeEvent<T> {
|
|
|
21
21
|
value: T;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Represents the available SchedulerEditItem` actions.
|
|
25
25
|
*
|
|
26
26
|
* Can be one of:
|
|
27
27
|
* - [SchedulerItemDragItemAction]({% slug api_scheduler_scheduleritemdragitemaction %})
|
|
@@ -26,6 +26,7 @@ import { getRect, setRect } from '../views/common/utils';
|
|
|
26
26
|
import { BORDER_WIDTH } from '../constants';
|
|
27
27
|
import { useInternationalization } from '@progress/kendo-react-intl';
|
|
28
28
|
import { SchedulerItemContent } from './SchedulerItemContent';
|
|
29
|
+
var ITEMS_SPACING = 1;
|
|
29
30
|
/* eslint-disable max-len */
|
|
30
31
|
/**
|
|
31
32
|
* Represents the default `viewItem` component rendered by the [KendoReact Scheduler component]({% slug overview_scheduler %}).
|
|
@@ -35,6 +36,7 @@ import { SchedulerItemContent } from './SchedulerItemContent';
|
|
|
35
36
|
export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
36
37
|
// tslint:enable:max-line-length
|
|
37
38
|
var itemProp = props.item, _ref = props._ref, itemRef = props.itemRef, itemProps = __rest(props, ["item", "_ref", "itemRef"]);
|
|
39
|
+
var timeout = React.useRef();
|
|
38
40
|
var item = React.useRef(null);
|
|
39
41
|
var viewItem = React.useRef(null);
|
|
40
42
|
React.useImperativeHandle(viewItem, function () { return ({ props: props, element: item.current && item.current.element }); });
|
|
@@ -62,6 +64,12 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
62
64
|
});
|
|
63
65
|
return most;
|
|
64
66
|
};
|
|
67
|
+
var getSiblingsInAllSlots = function (slots, items) {
|
|
68
|
+
var siblings = slots.map(function (slot) {
|
|
69
|
+
return items.filter(function (i) { return inSlot(slot.current.props, i.props); });
|
|
70
|
+
});
|
|
71
|
+
return siblings;
|
|
72
|
+
};
|
|
65
73
|
var inSlot = function (slot, current) {
|
|
66
74
|
return intersects(slot.start, slot.end, current.start, current.end)
|
|
67
75
|
&& slot.group.index === current.group.index
|
|
@@ -116,11 +124,25 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
116
124
|
var mostSiblingsInSlot = props.dragHint || props.resizeHint
|
|
117
125
|
? calculateMostSiblings(slots, props.dragHint ? dragItems : resizeItems)
|
|
118
126
|
: calculateMostSiblings(slots, items);
|
|
127
|
+
var siblingsPerSlot = getSiblingsInAllSlots(slots, items);
|
|
128
|
+
var topOffset = 0;
|
|
129
|
+
var rect = getRect(element);
|
|
130
|
+
siblingsPerSlot.forEach(function (slot) {
|
|
131
|
+
var currentOffset = 0;
|
|
132
|
+
slot.forEach(function (current) {
|
|
133
|
+
var currentRect = getRect(current.element);
|
|
134
|
+
if (current.props.order !== null && current.props.order < order) {
|
|
135
|
+
currentOffset = ((currentRect.top + currentRect.height) - rect.top) - (BORDER_WIDTH * order) + ITEMS_SPACING;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
if (currentOffset > topOffset) {
|
|
139
|
+
topOffset = currentOffset;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
119
142
|
if (slots.length === 0) {
|
|
120
143
|
setDisplay(false);
|
|
121
144
|
return;
|
|
122
145
|
}
|
|
123
|
-
var rect = getRect(element);
|
|
124
146
|
var OFFSET = 20;
|
|
125
147
|
rect.width = (props.vertical
|
|
126
148
|
? ((rect.width / mostSiblingsInSlot) - BORDER_WIDTH - (OFFSET / mostSiblingsInSlot))
|
|
@@ -129,17 +151,25 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
129
151
|
? ((rect.height * slots.length) - (BORDER_WIDTH))
|
|
130
152
|
: ((props.resizeHint || props.dragHint) && mostSiblingsInSlot <= 1)
|
|
131
153
|
? rect.height
|
|
132
|
-
: 25;
|
|
154
|
+
: (props.style && props.style.height ? props.style.height : 25);
|
|
133
155
|
rect.left = props.vertical
|
|
134
156
|
? (rect.left + (order * rect.width) + (BORDER_WIDTH * order))
|
|
135
157
|
: rect.left;
|
|
136
158
|
rect.top = props.vertical
|
|
137
159
|
? rect.top
|
|
138
|
-
: (rect.top +
|
|
160
|
+
: (rect.top + topOffset + (BORDER_WIDTH * order));
|
|
139
161
|
setRect(element, rect);
|
|
140
162
|
setVisible(true);
|
|
141
163
|
};
|
|
142
|
-
var handleResize = React.useCallback(function () {
|
|
164
|
+
var handleResize = React.useCallback(function () {
|
|
165
|
+
if (timeout.current !== undefined) {
|
|
166
|
+
window.cancelAnimationFrame(timeout.current);
|
|
167
|
+
}
|
|
168
|
+
timeout.current = window.requestAnimationFrame(function () {
|
|
169
|
+
align();
|
|
170
|
+
position();
|
|
171
|
+
});
|
|
172
|
+
}, [align, position]);
|
|
143
173
|
React.useEffect(align);
|
|
144
174
|
React.useEffect(position);
|
|
145
175
|
React.useEffect(function () {
|
|
@@ -152,7 +182,7 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
152
182
|
observer.disconnect();
|
|
153
183
|
};
|
|
154
184
|
}, [handleResize, scheduler]);
|
|
155
|
-
return (React.createElement(Item, __assign({}, itemProps, { _ref: item, itemRef: item, style: __assign({ visibility: visible ? undefined : 'hidden', display: display ? undefined : 'none'
|
|
185
|
+
return (React.createElement(Item, __assign({}, itemProps, { _ref: item, itemRef: item, style: __assign({ visibility: visible ? undefined : 'hidden', display: display ? undefined : 'none' }, props.style) }),
|
|
156
186
|
(!props.resizeHint) && React.createElement("span", { className: "k-event-actions" },
|
|
157
187
|
props.tail && React.createElement("span", { className: "k-icon k-i-arrow-60-left" }),
|
|
158
188
|
(props.isRecurring && !props.isException) && React.createElement("span", { className: "k-icon k-i-reload" }),
|
package/dist/es/main.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { SchedulerItemContent, SchedulerItemContentProps } from './items/Schedul
|
|
|
10
10
|
import { SchedulerViewItem, SchedulerViewItemProps, SchedulerViewItemHandle } from './items/SchedulerViewItem';
|
|
11
11
|
import { SchedulerEditItem, SchedulerEditItemProps, SchedulerEditItemHandle, SchedulerEditItemAction, SchedulerEditItemState } from './items/SchedulerEditItem';
|
|
12
12
|
import { SchedulerSlot, SchedulerSlotProps, SchedulerSlotHandle } from './slots/SchedulerSlot';
|
|
13
|
-
import { SchedulerViewSlot, SchedulerViewSlotProps, SchedulerViewSlotHandle } from './slots/SchedulerViewSlot';
|
|
13
|
+
import { SchedulerViewSlot, SchedulerViewSlotProps, SchedulerSlotExpandableConfig, SchedulerViewSlotHandle } from './slots/SchedulerViewSlot';
|
|
14
14
|
import { SchedulerEditSlot, SchedulerEditSlotProps, SchedulerEditSlotHandle } from './slots/SchedulerEditSlot';
|
|
15
15
|
import { SchedulerTask, SchedulerTaskProps, SchedulerTaskHandle } from './tasks/SchedulerTask';
|
|
16
16
|
import { SchedulerViewTask, SchedulerViewTaskProps, SchedulerViewTaskHandle } from './tasks/SchedulerViewTask';
|
|
@@ -36,4 +36,4 @@ import { SchedulerItemShowOccurrenceDialogAction, SHOW_OCCURRENCE_DIALOG_ACTION
|
|
|
36
36
|
import { SchedulerItemShowRemoveDialogAction, SHOW_REMOVE_DIALOG_ACTION } from './items/hooks/use-show-remove-item-dialog';
|
|
37
37
|
import { SchedulerSlotsSelectAction, SLOTS_SELECT_ACTION } from './hooks/use-slots-selection';
|
|
38
38
|
import { SchedulerGroup, SchedulerResource } from './models';
|
|
39
|
-
export { Scheduler, SchedulerProps, AgendaView, TimelineView, DayView, WeekView, WorkWeekView, MonthView, SchedulerDataChangeEvent, SchedulerDateChangeEvent, SchedulerViewChangeEvent, DataAction, DATA_ACTION, SchedulerPropsContext, useSchedulerPropsContext, SchedulerPropsContextType, SchedulerViewsContext, useSchedulerViewsContext, SchedulerViewsContextType, SchedulerFieldsContext, useSchedulerFieldsContext, SchedulerFieldsContextType, SchedulerGroupsContext, useSchedulerGroupsContext, SchedulerGroupsContextType, SchedulerDateRangeContext, useSchedulerDateRangeContext, SchedulerDateRangeContextType, SchedulerOrientationContext, useSchedulerOrientationContext, SchedulerOrientationContextType, SchedulerDateContext, useSchedulerDateContext, SchedulerDateContextType, SchedulerActiveViewContext, useSchedulerActiveViewContext, SchedulerActiveViewContextType, SchedulerDataContext, useSchedulerDataContext, SchedulerDataContextType, SchedulerItem, SchedulerItemProps, SchedulerItemHandle, SchedulerItemContent, SchedulerItemContentProps, SchedulerViewItem, SchedulerViewItemProps, SchedulerViewItemHandle, SchedulerEditItem, SchedulerEditItemProps, SchedulerEditItemState, SchedulerEditItemAction, SchedulerEditItemHandle, SchedulerSlot, SchedulerSlotProps, SchedulerSlotHandle, SchedulerViewSlot, SchedulerViewSlotProps, SchedulerViewSlotHandle, SchedulerEditSlot, SchedulerEditSlotProps, SchedulerEditSlotHandle, SchedulerTask, SchedulerTaskProps, SchedulerTaskHandle, SchedulerViewTask, SchedulerViewTaskProps, SchedulerViewTaskHandle, SchedulerEditTask, SchedulerEditTaskProps, SchedulerEditTaskHandle, SchedulerDrag, SchedulerDragProps, SchedulerResize, SchedulerResizeProps, SchedulerForm, SchedulerFormHandle, SchedulerFormProps, SchedulerFormEditor, SchedulerFormEditorProps, SchedulerFormEditorHandle, SchedulerOccurrenceDialog, SchedulerOccurrenceDialogProps, SchedulerOccurrenceDialogHandle, SchedulerRemoveDialog, SchedulerRemoveDialogProps, SchedulerRemoveDialogHandle, SchedulerEditItemFormItemContext, useSchedulerEditItemFormItemContext, SchedulerEditItemFormItemContextType, SchedulerEditItemDragItemContext, useSchedulerEditItemDragItemContext, SchedulerEditItemDragItemContextType, SchedulerEditItemRemoveItemContext, useSchedulerEditItemRemoveItemContext, SchedulerEditItemRemoveItemContextType, SchedulerEditItemResizeItemContext, useSchedulerEditItemResizeItemContext, SchedulerEditItemResizeItemContextType, SchedulerEditItemShowRemoveDialogContext, useSchedulerEditItemShowRemoveDialogContext, SchedulerEditItemShowRemoveDialogContextType, SchedulerEditItemShowOccurrenceDialogContext, useSchedulerEditItemShowOccurrenceDialogContext, SchedulerEditItemShowOccurrenceDialogContextType, SchedulerEditItemPropsContext, useSchedulerEditItemPropsContext, SchedulerEditItemPropsContextType, SchedulerEditSlotFormItemContext, useSchedulerEditSlotFormItemContext, SchedulerEditSlotFormItemContextType, SchedulerEditSlotPropsContext, useSchedulerEditSlotPropsContext, SchedulerEditSlotPropsContextType, SchedulerHeader, SchedulerHeaderProps, SchedulerHeaderHandle, SchedulerFooter, SchedulerFooterProps, SchedulerFooterHandle, DateHeaderCell, DateHeaderCellHandle, DateHeaderCellProps, TimeHeaderCell, TimeHeaderCellHandle, TimeHeaderCellProps, DRAG_ITEM_ACTION, SchedulerItemDragItemAction, ITEMS_FOCUS_ACTION, SchedulerItemsFocusAction, ITEMS_SELECT_ACTION, SchedulerItemsSelectAction, REMOVE_ITEM_ACTION, SchedulerItemRemoveItemAction, RESIZE_ITEM_ACTION, SchedulerItemResizeItemAction, SERIES_ACTION, SchedulerItemSeriesAction, SHOW_OCCURRENCE_DIALOG_ACTION, SchedulerItemShowOccurrenceDialogAction, SHOW_REMOVE_DIALOG_ACTION, SchedulerItemShowRemoveDialogAction, SLOTS_FOCUS_ACTION, SchedulerSlotsFocusAction, SLOTS_SELECT_ACTION, SchedulerSlotsSelectAction, SchedulerResource, SchedulerGroup };
|
|
39
|
+
export { Scheduler, SchedulerProps, AgendaView, TimelineView, DayView, WeekView, WorkWeekView, MonthView, SchedulerDataChangeEvent, SchedulerDateChangeEvent, SchedulerViewChangeEvent, DataAction, DATA_ACTION, SchedulerPropsContext, useSchedulerPropsContext, SchedulerPropsContextType, SchedulerViewsContext, useSchedulerViewsContext, SchedulerViewsContextType, SchedulerFieldsContext, useSchedulerFieldsContext, SchedulerFieldsContextType, SchedulerGroupsContext, useSchedulerGroupsContext, SchedulerGroupsContextType, SchedulerDateRangeContext, useSchedulerDateRangeContext, SchedulerDateRangeContextType, SchedulerOrientationContext, useSchedulerOrientationContext, SchedulerOrientationContextType, SchedulerDateContext, useSchedulerDateContext, SchedulerDateContextType, SchedulerActiveViewContext, useSchedulerActiveViewContext, SchedulerActiveViewContextType, SchedulerDataContext, useSchedulerDataContext, SchedulerDataContextType, SchedulerItem, SchedulerItemProps, SchedulerItemHandle, SchedulerItemContent, SchedulerItemContentProps, SchedulerViewItem, SchedulerViewItemProps, SchedulerViewItemHandle, SchedulerEditItem, SchedulerEditItemProps, SchedulerEditItemState, SchedulerEditItemAction, SchedulerEditItemHandle, SchedulerSlot, SchedulerSlotProps, SchedulerSlotHandle, SchedulerViewSlot, SchedulerViewSlotProps, SchedulerViewSlotHandle, SchedulerSlotExpandableConfig, SchedulerEditSlot, SchedulerEditSlotProps, SchedulerEditSlotHandle, SchedulerTask, SchedulerTaskProps, SchedulerTaskHandle, SchedulerViewTask, SchedulerViewTaskProps, SchedulerViewTaskHandle, SchedulerEditTask, SchedulerEditTaskProps, SchedulerEditTaskHandle, SchedulerDrag, SchedulerDragProps, SchedulerResize, SchedulerResizeProps, SchedulerForm, SchedulerFormHandle, SchedulerFormProps, SchedulerFormEditor, SchedulerFormEditorProps, SchedulerFormEditorHandle, SchedulerOccurrenceDialog, SchedulerOccurrenceDialogProps, SchedulerOccurrenceDialogHandle, SchedulerRemoveDialog, SchedulerRemoveDialogProps, SchedulerRemoveDialogHandle, SchedulerEditItemFormItemContext, useSchedulerEditItemFormItemContext, SchedulerEditItemFormItemContextType, SchedulerEditItemDragItemContext, useSchedulerEditItemDragItemContext, SchedulerEditItemDragItemContextType, SchedulerEditItemRemoveItemContext, useSchedulerEditItemRemoveItemContext, SchedulerEditItemRemoveItemContextType, SchedulerEditItemResizeItemContext, useSchedulerEditItemResizeItemContext, SchedulerEditItemResizeItemContextType, SchedulerEditItemShowRemoveDialogContext, useSchedulerEditItemShowRemoveDialogContext, SchedulerEditItemShowRemoveDialogContextType, SchedulerEditItemShowOccurrenceDialogContext, useSchedulerEditItemShowOccurrenceDialogContext, SchedulerEditItemShowOccurrenceDialogContextType, SchedulerEditItemPropsContext, useSchedulerEditItemPropsContext, SchedulerEditItemPropsContextType, SchedulerEditSlotFormItemContext, useSchedulerEditSlotFormItemContext, SchedulerEditSlotFormItemContextType, SchedulerEditSlotPropsContext, useSchedulerEditSlotPropsContext, SchedulerEditSlotPropsContextType, SchedulerHeader, SchedulerHeaderProps, SchedulerHeaderHandle, SchedulerFooter, SchedulerFooterProps, SchedulerFooterHandle, DateHeaderCell, DateHeaderCellHandle, DateHeaderCellProps, TimeHeaderCell, TimeHeaderCellHandle, TimeHeaderCellProps, DRAG_ITEM_ACTION, SchedulerItemDragItemAction, ITEMS_FOCUS_ACTION, SchedulerItemsFocusAction, ITEMS_SELECT_ACTION, SchedulerItemsSelectAction, REMOVE_ITEM_ACTION, SchedulerItemRemoveItemAction, RESIZE_ITEM_ACTION, SchedulerItemResizeItemAction, SERIES_ACTION, SchedulerItemSeriesAction, SHOW_OCCURRENCE_DIALOG_ACTION, SchedulerItemShowOccurrenceDialogAction, SHOW_REMOVE_DIALOG_ACTION, SchedulerItemShowRemoveDialogAction, SLOTS_FOCUS_ACTION, SchedulerSlotsFocusAction, SLOTS_SELECT_ACTION, SchedulerSlotsSelectAction, SchedulerResource, SchedulerGroup };
|
|
@@ -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: 1632212547,
|
|
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
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SchedulerSlotProps } from './SchedulerSlot';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Represents the extended `expandable` configuration of a `SchedulerSlot`.
|
|
5
|
+
*
|
|
6
|
+
* Settings `offsetTop` or `offsetBottom` would provide an extra space in addition to the space taken by the `items` inside the `slot`.
|
|
7
|
+
*/
|
|
8
|
+
export declare type SchedulerSlotExpandableConfig = {
|
|
5
9
|
offsetTop?: number;
|
|
6
10
|
offsetBottom?: number;
|
|
7
11
|
};
|
|
@@ -15,8 +19,12 @@ export interface SchedulerViewSlotProps extends SchedulerSlotProps {
|
|
|
15
19
|
* The default Component is: [SchedulerSlot]({% slug api_scheduler_schedulerslot %}).
|
|
16
20
|
*/
|
|
17
21
|
slot?: React.ComponentType<SchedulerSlotProps>;
|
|
18
|
-
/**
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Set to `false` will render the `slot` as is, without expanding depending on the `items` inside it.
|
|
24
|
+
*
|
|
25
|
+
* For more information, please refer to the [Adaptive Slot Height]({% slug recurring_events_scheduler %}) article.
|
|
26
|
+
*/
|
|
27
|
+
expandable?: boolean | SchedulerSlotExpandableConfig;
|
|
20
28
|
}
|
|
21
29
|
/**
|
|
22
30
|
* Represents the object which is returned from the `ref` callback of the [SchedulerViewItem]({% slug api_scheduler_schedulerviewitem %}).
|
package/dist/es/utils/index.d.ts
CHANGED
|
@@ -163,3 +163,7 @@ export declare const noop: (..._args: any) => void;
|
|
|
163
163
|
export declare const findFirstItem: (current: SchedulerSlotHandle) => SchedulerItemHandle;
|
|
164
164
|
/** @hidden */
|
|
165
165
|
export declare const findNextItem: (ref: React.RefObject<SchedulerItemHandle>, all: React.RefObject<SchedulerItemHandle>[], ignoreIsAllDay?: boolean, backwards?: boolean) => React.RefObject<SchedulerItemHandle>;
|
|
166
|
+
/**
|
|
167
|
+
* @hidden
|
|
168
|
+
*/
|
|
169
|
+
export declare const orderSort: (a: Item, b: Item) => number;
|
package/dist/es/utils/index.js
CHANGED
|
@@ -533,3 +533,9 @@ export var findNextItem = function (ref, all, ignoreIsAllDay, backwards) {
|
|
|
533
533
|
var next = sorted[currentIndex + (backwards ? -1 : 1)];
|
|
534
534
|
return next;
|
|
535
535
|
};
|
|
536
|
+
/**
|
|
537
|
+
* @hidden
|
|
538
|
+
*/
|
|
539
|
+
export var orderSort = function (a, b) {
|
|
540
|
+
return (a.order || 0) - (b.order || 0);
|
|
541
|
+
};
|
|
@@ -171,7 +171,7 @@ export var setRect = function (el, rect, minHeightInsteadOfHeight) {
|
|
|
171
171
|
el.style.width = rect.width + "px";
|
|
172
172
|
}
|
|
173
173
|
if (rect.height !== undefined && !minHeightInsteadOfHeight) {
|
|
174
|
-
el.style.height = rect.height + "px";
|
|
174
|
+
el.style.height = typeof rect.height === 'number' ? rect.height + "px" : rect.height;
|
|
175
175
|
}
|
|
176
176
|
if (minHeightInsteadOfHeight) {
|
|
177
177
|
el.style.minHeight = rect.height !== undefined && rect.height > 0 ? rect.height + "px" : '';
|
|
@@ -16,7 +16,7 @@ import { MS_PER_DAY, firstDayInWeek, firstDayOfMonth, getDate, addDays, lastDayO
|
|
|
16
16
|
import { classNames } from '@progress/kendo-react-common';
|
|
17
17
|
import { VerticalResourceIterator } from '../common/VerticalResourceIterator';
|
|
18
18
|
import { HorizontalResourceIterator } from '../common/HorizontalResourceIterator';
|
|
19
|
-
import { mapItemsToSlots, mapSlotsToItems, toUTCDateTime } from '../../utils';
|
|
19
|
+
import { mapItemsToSlots, mapSlotsToItems, toUTCDateTime, orderSort } from '../../utils';
|
|
20
20
|
import { monthViewTitle, messages } from '../../messages';
|
|
21
21
|
import { SchedulerEditSlot } from '../../slots/SchedulerEditSlot';
|
|
22
22
|
import { useInternationalization } from '@progress/kendo-react-intl';
|
|
@@ -98,6 +98,7 @@ export var MonthView = function (props) {
|
|
|
98
98
|
: React.createElement(VerticalResourceIterator, { nested: true, resources: propResources, group: group }, body),
|
|
99
99
|
items
|
|
100
100
|
.filter(function (item) { return item.order === null || item.order < itemsPerSlot; })
|
|
101
|
+
.sort(orderSort)
|
|
101
102
|
.map(function (item) { return (React.createElement(EditItem, __assign({ item: props.item, viewItem: props.viewItem, form: props.form, key: item.isRecurring
|
|
102
103
|
? item.uid + ":" + item.group.index + ":" + item.range.index + ":" + item.originalStart
|
|
103
104
|
: item.uid + ":" + item.group.index + ":" + item.range.index }, item, { onDataAction: props.onDataAction, style: { transform: 'translateY(30px)' }, vertical: false, editable: props.editable, ignoreIsAllDay: true }))); }))));
|
|
@@ -17,7 +17,7 @@ import { HorizontalResourceIterator } from '../common/HorizontalResourceIterator
|
|
|
17
17
|
import { TimelineViewRowContent } from './TimelineViewRowContent';
|
|
18
18
|
import { TimelineViewAllEventsRowContent } from './TimelineViewAllEventsRowContent';
|
|
19
19
|
import { VerticalResourceIterator } from '../common/VerticalResourceIterator';
|
|
20
|
-
import { mapItemsToSlots, mapSlotsToItems, isInTimeRange, toUTCDateTime, intersects, first, last } from '../../utils';
|
|
20
|
+
import { mapItemsToSlots, mapSlotsToItems, isInTimeRange, toUTCDateTime, intersects, first, last, orderSort } from '../../utils';
|
|
21
21
|
import { classNames } from '@progress/kendo-react-common';
|
|
22
22
|
import { toRanges } from '../../services/rangeService';
|
|
23
23
|
import { toSlots } from '../../services/slotsService';
|
|
@@ -153,7 +153,9 @@ export var MultiDayTimelineView = function (props) {
|
|
|
153
153
|
&& props.currentTimeMarker
|
|
154
154
|
&& intersects(first(ranges).start, last(ranges).end, new Date(), new Date(), true))
|
|
155
155
|
&& (React.createElement(CurrentTimeMarker, { attachArrow: timeRef, vertical: true })),
|
|
156
|
-
items
|
|
156
|
+
items
|
|
157
|
+
.sort(orderSort)
|
|
158
|
+
.map(function (item) { return (React.createElement(EditItem, __assign({ key: item.isRecurring
|
|
157
159
|
? item.uid + ":" + item.group.index + ":" + item.range.index + ":" + item.originalStart
|
|
158
160
|
: item.uid + ":" + item.group.index + ":" + item.range.index }, item, { format: 't', form: props.form, onDataAction: props.onDataAction, item: props.item, viewItem: props.viewItem, editable: props.editable, ignoreIsAllDay: true, vertical: false }))); })))));
|
|
159
161
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SchedulerSlotHandle } from '../slots/SchedulerSlot';
|
|
3
|
-
import {
|
|
3
|
+
import { SchedulerSlotExpandableConfig } from '../slots/SchedulerViewSlot';
|
|
4
4
|
/** @hidden */
|
|
5
|
-
export declare const useSlotExpand: (slot: React.RefObject<SchedulerSlotHandle>, config?: boolean |
|
|
5
|
+
export declare const useSlotExpand: (slot: React.RefObject<SchedulerSlotHandle>, config?: boolean | SchedulerSlotExpandableConfig) => void;
|
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var React = require("react");
|
|
4
4
|
var utils_1 = require("../views/common/utils");
|
|
5
5
|
var constants_1 = require("../constants");
|
|
6
|
+
var context_1 = require("../context");
|
|
6
7
|
/** @hidden */
|
|
7
8
|
exports.useSlotExpand = function (slot, config) {
|
|
9
|
+
var timeout = React.useRef();
|
|
8
10
|
var initialHeight = React.useRef(0);
|
|
11
|
+
var scheduler = context_1.useSchedulerElementContext();
|
|
9
12
|
var getInitialHeight = function () {
|
|
10
13
|
if (!slot.current) {
|
|
11
14
|
return;
|
|
@@ -16,7 +19,7 @@ exports.useSlotExpand = function (slot, config) {
|
|
|
16
19
|
}
|
|
17
20
|
initialHeight.current = element.clientHeight;
|
|
18
21
|
};
|
|
19
|
-
var expand = function () {
|
|
22
|
+
var expand = React.useCallback(function () {
|
|
20
23
|
if (!config || !slot.current) {
|
|
21
24
|
return;
|
|
22
25
|
}
|
|
@@ -35,19 +38,52 @@ exports.useSlotExpand = function (slot, config) {
|
|
|
35
38
|
return;
|
|
36
39
|
}
|
|
37
40
|
var height = utils_1.getRect(item._ref.current.element).height;
|
|
38
|
-
|
|
39
|
-
highest = height;
|
|
40
|
-
}
|
|
41
|
+
highest += height;
|
|
41
42
|
});
|
|
42
|
-
var minHeight = ((
|
|
43
|
-
|
|
43
|
+
var minHeight = ((existing.length * constants_1.BORDER_WIDTH * 2)
|
|
44
|
+
+ highest
|
|
44
45
|
- (slotPadding || 0)
|
|
45
46
|
+ (typeof config === 'object' && config.offsetTop ? config.offsetTop : 0)
|
|
46
47
|
+ (typeof config === 'object' && config.offsetBottom ? config.offsetBottom : 0));
|
|
47
|
-
if (minHeight > (initialHeight.current)) {
|
|
48
|
+
if (minHeight > (initialHeight.current - slotPadding)) {
|
|
48
49
|
utils_1.setRect(element, { height: minHeight }, true);
|
|
49
50
|
}
|
|
50
|
-
};
|
|
51
|
+
}, [config, slot]);
|
|
52
|
+
var handleResize = React.useCallback(function () {
|
|
53
|
+
if (timeout.current !== undefined) {
|
|
54
|
+
window.cancelAnimationFrame(timeout.current);
|
|
55
|
+
}
|
|
56
|
+
timeout.current = window.requestAnimationFrame(function () {
|
|
57
|
+
expand();
|
|
58
|
+
});
|
|
59
|
+
}, [expand]);
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
61
|
React.useLayoutEffect(getInitialHeight, []);
|
|
62
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
52
63
|
React.useEffect(expand, [slot, slot.current && slot.current.props, config]);
|
|
64
|
+
React.useEffect(function () {
|
|
65
|
+
if (!slot.current) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
var props = slot.current.props;
|
|
69
|
+
var existing = props.items.filter(function (i) {
|
|
70
|
+
return i._ref.current;
|
|
71
|
+
});
|
|
72
|
+
var callbacks = existing.map(function (item) {
|
|
73
|
+
if (!item._ref.current || !item._ref.current.element) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!scheduler.current) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
var observer = new window.ResizeObserver(handleResize);
|
|
80
|
+
observer.observe(item._ref.current.element);
|
|
81
|
+
return function () {
|
|
82
|
+
observer.disconnect();
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
return function () {
|
|
86
|
+
callbacks.forEach(function (cb) { return cb && cb(); });
|
|
87
|
+
};
|
|
88
|
+
}, [handleResize, scheduler, slot]);
|
|
53
89
|
};
|
|
@@ -21,7 +21,7 @@ export interface SchedulerEditItemStateChangeEvent<T> {
|
|
|
21
21
|
value: T;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Represents the available SchedulerEditItem` actions.
|
|
25
25
|
*
|
|
26
26
|
* Can be one of:
|
|
27
27
|
* - [SchedulerItemDragItemAction]({% slug api_scheduler_scheduleritemdragitemaction %})
|
|
@@ -28,6 +28,7 @@ var utils_2 = require("../views/common/utils");
|
|
|
28
28
|
var constants_1 = require("../constants");
|
|
29
29
|
var kendo_react_intl_1 = require("@progress/kendo-react-intl");
|
|
30
30
|
var SchedulerItemContent_1 = require("./SchedulerItemContent");
|
|
31
|
+
var ITEMS_SPACING = 1;
|
|
31
32
|
/* eslint-disable max-len */
|
|
32
33
|
/**
|
|
33
34
|
* Represents the default `viewItem` component rendered by the [KendoReact Scheduler component]({% slug overview_scheduler %}).
|
|
@@ -37,6 +38,7 @@ var SchedulerItemContent_1 = require("./SchedulerItemContent");
|
|
|
37
38
|
exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
38
39
|
// tslint:enable:max-line-length
|
|
39
40
|
var itemProp = props.item, _ref = props._ref, itemRef = props.itemRef, itemProps = __rest(props, ["item", "_ref", "itemRef"]);
|
|
41
|
+
var timeout = React.useRef();
|
|
40
42
|
var item = React.useRef(null);
|
|
41
43
|
var viewItem = React.useRef(null);
|
|
42
44
|
React.useImperativeHandle(viewItem, function () { return ({ props: props, element: item.current && item.current.element }); });
|
|
@@ -64,6 +66,12 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
64
66
|
});
|
|
65
67
|
return most;
|
|
66
68
|
};
|
|
69
|
+
var getSiblingsInAllSlots = function (slots, items) {
|
|
70
|
+
var siblings = slots.map(function (slot) {
|
|
71
|
+
return items.filter(function (i) { return inSlot(slot.current.props, i.props); });
|
|
72
|
+
});
|
|
73
|
+
return siblings;
|
|
74
|
+
};
|
|
67
75
|
var inSlot = function (slot, current) {
|
|
68
76
|
return utils_1.intersects(slot.start, slot.end, current.start, current.end)
|
|
69
77
|
&& slot.group.index === current.group.index
|
|
@@ -118,11 +126,25 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
118
126
|
var mostSiblingsInSlot = props.dragHint || props.resizeHint
|
|
119
127
|
? calculateMostSiblings(slots, props.dragHint ? dragItems : resizeItems)
|
|
120
128
|
: calculateMostSiblings(slots, items);
|
|
129
|
+
var siblingsPerSlot = getSiblingsInAllSlots(slots, items);
|
|
130
|
+
var topOffset = 0;
|
|
131
|
+
var rect = utils_2.getRect(element);
|
|
132
|
+
siblingsPerSlot.forEach(function (slot) {
|
|
133
|
+
var currentOffset = 0;
|
|
134
|
+
slot.forEach(function (current) {
|
|
135
|
+
var currentRect = utils_2.getRect(current.element);
|
|
136
|
+
if (current.props.order !== null && current.props.order < order) {
|
|
137
|
+
currentOffset = ((currentRect.top + currentRect.height) - rect.top) - (constants_1.BORDER_WIDTH * order) + ITEMS_SPACING;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
if (currentOffset > topOffset) {
|
|
141
|
+
topOffset = currentOffset;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
121
144
|
if (slots.length === 0) {
|
|
122
145
|
setDisplay(false);
|
|
123
146
|
return;
|
|
124
147
|
}
|
|
125
|
-
var rect = utils_2.getRect(element);
|
|
126
148
|
var OFFSET = 20;
|
|
127
149
|
rect.width = (props.vertical
|
|
128
150
|
? ((rect.width / mostSiblingsInSlot) - constants_1.BORDER_WIDTH - (OFFSET / mostSiblingsInSlot))
|
|
@@ -131,17 +153,25 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
131
153
|
? ((rect.height * slots.length) - (constants_1.BORDER_WIDTH))
|
|
132
154
|
: ((props.resizeHint || props.dragHint) && mostSiblingsInSlot <= 1)
|
|
133
155
|
? rect.height
|
|
134
|
-
: 25;
|
|
156
|
+
: (props.style && props.style.height ? props.style.height : 25);
|
|
135
157
|
rect.left = props.vertical
|
|
136
158
|
? (rect.left + (order * rect.width) + (constants_1.BORDER_WIDTH * order))
|
|
137
159
|
: rect.left;
|
|
138
160
|
rect.top = props.vertical
|
|
139
161
|
? rect.top
|
|
140
|
-
: (rect.top +
|
|
162
|
+
: (rect.top + topOffset + (constants_1.BORDER_WIDTH * order));
|
|
141
163
|
utils_2.setRect(element, rect);
|
|
142
164
|
setVisible(true);
|
|
143
165
|
};
|
|
144
|
-
var handleResize = React.useCallback(function () {
|
|
166
|
+
var handleResize = React.useCallback(function () {
|
|
167
|
+
if (timeout.current !== undefined) {
|
|
168
|
+
window.cancelAnimationFrame(timeout.current);
|
|
169
|
+
}
|
|
170
|
+
timeout.current = window.requestAnimationFrame(function () {
|
|
171
|
+
align();
|
|
172
|
+
position();
|
|
173
|
+
});
|
|
174
|
+
}, [align, position]);
|
|
145
175
|
React.useEffect(align);
|
|
146
176
|
React.useEffect(position);
|
|
147
177
|
React.useEffect(function () {
|
|
@@ -154,7 +184,7 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
154
184
|
observer.disconnect();
|
|
155
185
|
};
|
|
156
186
|
}, [handleResize, scheduler]);
|
|
157
|
-
return (React.createElement(Item, __assign({}, itemProps, { _ref: item, itemRef: item, style: __assign({ visibility: visible ? undefined : 'hidden', display: display ? undefined : 'none'
|
|
187
|
+
return (React.createElement(Item, __assign({}, itemProps, { _ref: item, itemRef: item, style: __assign({ visibility: visible ? undefined : 'hidden', display: display ? undefined : 'none' }, props.style) }),
|
|
158
188
|
(!props.resizeHint) && React.createElement("span", { className: "k-event-actions" },
|
|
159
189
|
props.tail && React.createElement("span", { className: "k-icon k-i-arrow-60-left" }),
|
|
160
190
|
(props.isRecurring && !props.isException) && React.createElement("span", { className: "k-icon k-i-reload" }),
|
package/dist/npm/main.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { SchedulerItemContent, SchedulerItemContentProps } from './items/Schedul
|
|
|
10
10
|
import { SchedulerViewItem, SchedulerViewItemProps, SchedulerViewItemHandle } from './items/SchedulerViewItem';
|
|
11
11
|
import { SchedulerEditItem, SchedulerEditItemProps, SchedulerEditItemHandle, SchedulerEditItemAction, SchedulerEditItemState } from './items/SchedulerEditItem';
|
|
12
12
|
import { SchedulerSlot, SchedulerSlotProps, SchedulerSlotHandle } from './slots/SchedulerSlot';
|
|
13
|
-
import { SchedulerViewSlot, SchedulerViewSlotProps, SchedulerViewSlotHandle } from './slots/SchedulerViewSlot';
|
|
13
|
+
import { SchedulerViewSlot, SchedulerViewSlotProps, SchedulerSlotExpandableConfig, SchedulerViewSlotHandle } from './slots/SchedulerViewSlot';
|
|
14
14
|
import { SchedulerEditSlot, SchedulerEditSlotProps, SchedulerEditSlotHandle } from './slots/SchedulerEditSlot';
|
|
15
15
|
import { SchedulerTask, SchedulerTaskProps, SchedulerTaskHandle } from './tasks/SchedulerTask';
|
|
16
16
|
import { SchedulerViewTask, SchedulerViewTaskProps, SchedulerViewTaskHandle } from './tasks/SchedulerViewTask';
|
|
@@ -36,4 +36,4 @@ import { SchedulerItemShowOccurrenceDialogAction, SHOW_OCCURRENCE_DIALOG_ACTION
|
|
|
36
36
|
import { SchedulerItemShowRemoveDialogAction, SHOW_REMOVE_DIALOG_ACTION } from './items/hooks/use-show-remove-item-dialog';
|
|
37
37
|
import { SchedulerSlotsSelectAction, SLOTS_SELECT_ACTION } from './hooks/use-slots-selection';
|
|
38
38
|
import { SchedulerGroup, SchedulerResource } from './models';
|
|
39
|
-
export { Scheduler, SchedulerProps, AgendaView, TimelineView, DayView, WeekView, WorkWeekView, MonthView, SchedulerDataChangeEvent, SchedulerDateChangeEvent, SchedulerViewChangeEvent, DataAction, DATA_ACTION, SchedulerPropsContext, useSchedulerPropsContext, SchedulerPropsContextType, SchedulerViewsContext, useSchedulerViewsContext, SchedulerViewsContextType, SchedulerFieldsContext, useSchedulerFieldsContext, SchedulerFieldsContextType, SchedulerGroupsContext, useSchedulerGroupsContext, SchedulerGroupsContextType, SchedulerDateRangeContext, useSchedulerDateRangeContext, SchedulerDateRangeContextType, SchedulerOrientationContext, useSchedulerOrientationContext, SchedulerOrientationContextType, SchedulerDateContext, useSchedulerDateContext, SchedulerDateContextType, SchedulerActiveViewContext, useSchedulerActiveViewContext, SchedulerActiveViewContextType, SchedulerDataContext, useSchedulerDataContext, SchedulerDataContextType, SchedulerItem, SchedulerItemProps, SchedulerItemHandle, SchedulerItemContent, SchedulerItemContentProps, SchedulerViewItem, SchedulerViewItemProps, SchedulerViewItemHandle, SchedulerEditItem, SchedulerEditItemProps, SchedulerEditItemState, SchedulerEditItemAction, SchedulerEditItemHandle, SchedulerSlot, SchedulerSlotProps, SchedulerSlotHandle, SchedulerViewSlot, SchedulerViewSlotProps, SchedulerViewSlotHandle, SchedulerEditSlot, SchedulerEditSlotProps, SchedulerEditSlotHandle, SchedulerTask, SchedulerTaskProps, SchedulerTaskHandle, SchedulerViewTask, SchedulerViewTaskProps, SchedulerViewTaskHandle, SchedulerEditTask, SchedulerEditTaskProps, SchedulerEditTaskHandle, SchedulerDrag, SchedulerDragProps, SchedulerResize, SchedulerResizeProps, SchedulerForm, SchedulerFormHandle, SchedulerFormProps, SchedulerFormEditor, SchedulerFormEditorProps, SchedulerFormEditorHandle, SchedulerOccurrenceDialog, SchedulerOccurrenceDialogProps, SchedulerOccurrenceDialogHandle, SchedulerRemoveDialog, SchedulerRemoveDialogProps, SchedulerRemoveDialogHandle, SchedulerEditItemFormItemContext, useSchedulerEditItemFormItemContext, SchedulerEditItemFormItemContextType, SchedulerEditItemDragItemContext, useSchedulerEditItemDragItemContext, SchedulerEditItemDragItemContextType, SchedulerEditItemRemoveItemContext, useSchedulerEditItemRemoveItemContext, SchedulerEditItemRemoveItemContextType, SchedulerEditItemResizeItemContext, useSchedulerEditItemResizeItemContext, SchedulerEditItemResizeItemContextType, SchedulerEditItemShowRemoveDialogContext, useSchedulerEditItemShowRemoveDialogContext, SchedulerEditItemShowRemoveDialogContextType, SchedulerEditItemShowOccurrenceDialogContext, useSchedulerEditItemShowOccurrenceDialogContext, SchedulerEditItemShowOccurrenceDialogContextType, SchedulerEditItemPropsContext, useSchedulerEditItemPropsContext, SchedulerEditItemPropsContextType, SchedulerEditSlotFormItemContext, useSchedulerEditSlotFormItemContext, SchedulerEditSlotFormItemContextType, SchedulerEditSlotPropsContext, useSchedulerEditSlotPropsContext, SchedulerEditSlotPropsContextType, SchedulerHeader, SchedulerHeaderProps, SchedulerHeaderHandle, SchedulerFooter, SchedulerFooterProps, SchedulerFooterHandle, DateHeaderCell, DateHeaderCellHandle, DateHeaderCellProps, TimeHeaderCell, TimeHeaderCellHandle, TimeHeaderCellProps, DRAG_ITEM_ACTION, SchedulerItemDragItemAction, ITEMS_FOCUS_ACTION, SchedulerItemsFocusAction, ITEMS_SELECT_ACTION, SchedulerItemsSelectAction, REMOVE_ITEM_ACTION, SchedulerItemRemoveItemAction, RESIZE_ITEM_ACTION, SchedulerItemResizeItemAction, SERIES_ACTION, SchedulerItemSeriesAction, SHOW_OCCURRENCE_DIALOG_ACTION, SchedulerItemShowOccurrenceDialogAction, SHOW_REMOVE_DIALOG_ACTION, SchedulerItemShowRemoveDialogAction, SLOTS_FOCUS_ACTION, SchedulerSlotsFocusAction, SLOTS_SELECT_ACTION, SchedulerSlotsSelectAction, SchedulerResource, SchedulerGroup };
|
|
39
|
+
export { Scheduler, SchedulerProps, AgendaView, TimelineView, DayView, WeekView, WorkWeekView, MonthView, SchedulerDataChangeEvent, SchedulerDateChangeEvent, SchedulerViewChangeEvent, DataAction, DATA_ACTION, SchedulerPropsContext, useSchedulerPropsContext, SchedulerPropsContextType, SchedulerViewsContext, useSchedulerViewsContext, SchedulerViewsContextType, SchedulerFieldsContext, useSchedulerFieldsContext, SchedulerFieldsContextType, SchedulerGroupsContext, useSchedulerGroupsContext, SchedulerGroupsContextType, SchedulerDateRangeContext, useSchedulerDateRangeContext, SchedulerDateRangeContextType, SchedulerOrientationContext, useSchedulerOrientationContext, SchedulerOrientationContextType, SchedulerDateContext, useSchedulerDateContext, SchedulerDateContextType, SchedulerActiveViewContext, useSchedulerActiveViewContext, SchedulerActiveViewContextType, SchedulerDataContext, useSchedulerDataContext, SchedulerDataContextType, SchedulerItem, SchedulerItemProps, SchedulerItemHandle, SchedulerItemContent, SchedulerItemContentProps, SchedulerViewItem, SchedulerViewItemProps, SchedulerViewItemHandle, SchedulerEditItem, SchedulerEditItemProps, SchedulerEditItemState, SchedulerEditItemAction, SchedulerEditItemHandle, SchedulerSlot, SchedulerSlotProps, SchedulerSlotHandle, SchedulerViewSlot, SchedulerViewSlotProps, SchedulerViewSlotHandle, SchedulerSlotExpandableConfig, SchedulerEditSlot, SchedulerEditSlotProps, SchedulerEditSlotHandle, SchedulerTask, SchedulerTaskProps, SchedulerTaskHandle, SchedulerViewTask, SchedulerViewTaskProps, SchedulerViewTaskHandle, SchedulerEditTask, SchedulerEditTaskProps, SchedulerEditTaskHandle, SchedulerDrag, SchedulerDragProps, SchedulerResize, SchedulerResizeProps, SchedulerForm, SchedulerFormHandle, SchedulerFormProps, SchedulerFormEditor, SchedulerFormEditorProps, SchedulerFormEditorHandle, SchedulerOccurrenceDialog, SchedulerOccurrenceDialogProps, SchedulerOccurrenceDialogHandle, SchedulerRemoveDialog, SchedulerRemoveDialogProps, SchedulerRemoveDialogHandle, SchedulerEditItemFormItemContext, useSchedulerEditItemFormItemContext, SchedulerEditItemFormItemContextType, SchedulerEditItemDragItemContext, useSchedulerEditItemDragItemContext, SchedulerEditItemDragItemContextType, SchedulerEditItemRemoveItemContext, useSchedulerEditItemRemoveItemContext, SchedulerEditItemRemoveItemContextType, SchedulerEditItemResizeItemContext, useSchedulerEditItemResizeItemContext, SchedulerEditItemResizeItemContextType, SchedulerEditItemShowRemoveDialogContext, useSchedulerEditItemShowRemoveDialogContext, SchedulerEditItemShowRemoveDialogContextType, SchedulerEditItemShowOccurrenceDialogContext, useSchedulerEditItemShowOccurrenceDialogContext, SchedulerEditItemShowOccurrenceDialogContextType, SchedulerEditItemPropsContext, useSchedulerEditItemPropsContext, SchedulerEditItemPropsContextType, SchedulerEditSlotFormItemContext, useSchedulerEditSlotFormItemContext, SchedulerEditSlotFormItemContextType, SchedulerEditSlotPropsContext, useSchedulerEditSlotPropsContext, SchedulerEditSlotPropsContextType, SchedulerHeader, SchedulerHeaderProps, SchedulerHeaderHandle, SchedulerFooter, SchedulerFooterProps, SchedulerFooterHandle, DateHeaderCell, DateHeaderCellHandle, DateHeaderCellProps, TimeHeaderCell, TimeHeaderCellHandle, TimeHeaderCellProps, DRAG_ITEM_ACTION, SchedulerItemDragItemAction, ITEMS_FOCUS_ACTION, SchedulerItemsFocusAction, ITEMS_SELECT_ACTION, SchedulerItemsSelectAction, REMOVE_ITEM_ACTION, SchedulerItemRemoveItemAction, RESIZE_ITEM_ACTION, SchedulerItemResizeItemAction, SERIES_ACTION, SchedulerItemSeriesAction, SHOW_OCCURRENCE_DIALOG_ACTION, SchedulerItemShowOccurrenceDialogAction, SHOW_REMOVE_DIALOG_ACTION, SchedulerItemShowRemoveDialogAction, SLOTS_FOCUS_ACTION, SchedulerSlotsFocusAction, SLOTS_SELECT_ACTION, SchedulerSlotsSelectAction, SchedulerResource, SchedulerGroup };
|
|
@@ -7,7 +7,7 @@ exports.packageMetadata = {
|
|
|
7
7
|
name: '@progress/kendo-react-scheduler',
|
|
8
8
|
productName: 'KendoReact',
|
|
9
9
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
-
publishDate:
|
|
10
|
+
publishDate: 1632212547,
|
|
11
11
|
version: '',
|
|
12
12
|
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'
|
|
13
13
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SchedulerSlotProps } from './SchedulerSlot';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Represents the extended `expandable` configuration of a `SchedulerSlot`.
|
|
5
|
+
*
|
|
6
|
+
* Settings `offsetTop` or `offsetBottom` would provide an extra space in addition to the space taken by the `items` inside the `slot`.
|
|
7
|
+
*/
|
|
8
|
+
export declare type SchedulerSlotExpandableConfig = {
|
|
5
9
|
offsetTop?: number;
|
|
6
10
|
offsetBottom?: number;
|
|
7
11
|
};
|
|
@@ -15,8 +19,12 @@ export interface SchedulerViewSlotProps extends SchedulerSlotProps {
|
|
|
15
19
|
* The default Component is: [SchedulerSlot]({% slug api_scheduler_schedulerslot %}).
|
|
16
20
|
*/
|
|
17
21
|
slot?: React.ComponentType<SchedulerSlotProps>;
|
|
18
|
-
/**
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Set to `false` will render the `slot` as is, without expanding depending on the `items` inside it.
|
|
24
|
+
*
|
|
25
|
+
* For more information, please refer to the [Adaptive Slot Height]({% slug recurring_events_scheduler %}) article.
|
|
26
|
+
*/
|
|
27
|
+
expandable?: boolean | SchedulerSlotExpandableConfig;
|
|
20
28
|
}
|
|
21
29
|
/**
|
|
22
30
|
* Represents the object which is returned from the `ref` callback of the [SchedulerViewItem]({% slug api_scheduler_schedulerviewitem %}).
|
|
@@ -163,3 +163,7 @@ export declare const noop: (..._args: any) => void;
|
|
|
163
163
|
export declare const findFirstItem: (current: SchedulerSlotHandle) => SchedulerItemHandle;
|
|
164
164
|
/** @hidden */
|
|
165
165
|
export declare const findNextItem: (ref: React.RefObject<SchedulerItemHandle>, all: React.RefObject<SchedulerItemHandle>[], ignoreIsAllDay?: boolean, backwards?: boolean) => React.RefObject<SchedulerItemHandle>;
|
|
166
|
+
/**
|
|
167
|
+
* @hidden
|
|
168
|
+
*/
|
|
169
|
+
export declare const orderSort: (a: Item, b: Item) => number;
|
package/dist/npm/utils/index.js
CHANGED
|
@@ -542,3 +542,9 @@ exports.findNextItem = function (ref, all, ignoreIsAllDay, backwards) {
|
|
|
542
542
|
var next = sorted[currentIndex + (backwards ? -1 : 1)];
|
|
543
543
|
return next;
|
|
544
544
|
};
|
|
545
|
+
/**
|
|
546
|
+
* @hidden
|
|
547
|
+
*/
|
|
548
|
+
exports.orderSort = function (a, b) {
|
|
549
|
+
return (a.order || 0) - (b.order || 0);
|
|
550
|
+
};
|
|
@@ -175,7 +175,7 @@ exports.setRect = function (el, rect, minHeightInsteadOfHeight) {
|
|
|
175
175
|
el.style.width = rect.width + "px";
|
|
176
176
|
}
|
|
177
177
|
if (rect.height !== undefined && !minHeightInsteadOfHeight) {
|
|
178
|
-
el.style.height = rect.height + "px";
|
|
178
|
+
el.style.height = typeof rect.height === 'number' ? rect.height + "px" : rect.height;
|
|
179
179
|
}
|
|
180
180
|
if (minHeightInsteadOfHeight) {
|
|
181
181
|
el.style.minHeight = rect.height !== undefined && rect.height > 0 ? rect.height + "px" : '';
|