@progress/kendo-react-scheduler 5.1.0 → 5.1.1-dev.202203301234
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/items/SchedulerViewItem.js +13 -5
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/services/slotsService.js +1 -1
- package/dist/npm/items/SchedulerViewItem.js +13 -5
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/services/slotsService.js +1 -1
- package/dist/systemjs/kendo-react-scheduler.js +1 -1
- package/package.json +12 -12
|
@@ -39,6 +39,7 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
39
39
|
var timeout = React.useRef();
|
|
40
40
|
var item = React.useRef(null);
|
|
41
41
|
var viewItem = React.useRef(null);
|
|
42
|
+
var schedulerRect = React.useRef(null);
|
|
42
43
|
React.useImperativeHandle(viewItem, function () { return ({ props: props, element: item.current && item.current.element }); });
|
|
43
44
|
React.useImperativeHandle(ref, function () { return viewItem.current; });
|
|
44
45
|
React.useImperativeHandle(_ref, function () { return item.current; });
|
|
@@ -167,14 +168,21 @@ export var SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
167
168
|
setVisible(true);
|
|
168
169
|
setDisplay(true);
|
|
169
170
|
};
|
|
170
|
-
var handleResize = React.useCallback(function () {
|
|
171
|
+
var handleResize = React.useCallback(function (entries) {
|
|
172
|
+
var entry = entries && entries[0];
|
|
173
|
+
var rect = schedulerRect.current;
|
|
171
174
|
if (timeout.current !== undefined) {
|
|
172
175
|
window.cancelAnimationFrame(timeout.current);
|
|
173
176
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
if (rect && entry &&
|
|
178
|
+
(rect.width !== entry.contentRect.width ||
|
|
179
|
+
rect.height !== entry.contentRect.height)) {
|
|
180
|
+
timeout.current = window.requestAnimationFrame(function () {
|
|
181
|
+
align();
|
|
182
|
+
position();
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
schedulerRect.current = { width: entry.contentRect.width, height: entry.contentRect.height };
|
|
178
186
|
}, [align, position]);
|
|
179
187
|
React.useEffect(align);
|
|
180
188
|
React.useEffect(position);
|
|
@@ -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: 1648643319,
|
|
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
|
};
|
|
@@ -16,7 +16,7 @@ export var toSlots = function (_dateRange, _a, _b) {
|
|
|
16
16
|
var zonedStart = current.clone();
|
|
17
17
|
var zonedEnd = current.addTime(step);
|
|
18
18
|
var difference = (zonedEnd.timezoneOffset - zonedStart.timezoneOffset) * MS_PER_MINUTE;
|
|
19
|
-
var canFill = step
|
|
19
|
+
var canFill = step <= Math.abs(difference);
|
|
20
20
|
if (deficiency && canFill) {
|
|
21
21
|
deficiency -= step;
|
|
22
22
|
current = current.addTime(-step);
|
|
@@ -41,6 +41,7 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
41
41
|
var timeout = React.useRef();
|
|
42
42
|
var item = React.useRef(null);
|
|
43
43
|
var viewItem = React.useRef(null);
|
|
44
|
+
var schedulerRect = React.useRef(null);
|
|
44
45
|
React.useImperativeHandle(viewItem, function () { return ({ props: props, element: item.current && item.current.element }); });
|
|
45
46
|
React.useImperativeHandle(ref, function () { return viewItem.current; });
|
|
46
47
|
React.useImperativeHandle(_ref, function () { return item.current; });
|
|
@@ -169,14 +170,21 @@ exports.SchedulerViewItem = React.forwardRef(function (props, ref) {
|
|
|
169
170
|
setVisible(true);
|
|
170
171
|
setDisplay(true);
|
|
171
172
|
};
|
|
172
|
-
var handleResize = React.useCallback(function () {
|
|
173
|
+
var handleResize = React.useCallback(function (entries) {
|
|
174
|
+
var entry = entries && entries[0];
|
|
175
|
+
var rect = schedulerRect.current;
|
|
173
176
|
if (timeout.current !== undefined) {
|
|
174
177
|
window.cancelAnimationFrame(timeout.current);
|
|
175
178
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
if (rect && entry &&
|
|
180
|
+
(rect.width !== entry.contentRect.width ||
|
|
181
|
+
rect.height !== entry.contentRect.height)) {
|
|
182
|
+
timeout.current = window.requestAnimationFrame(function () {
|
|
183
|
+
align();
|
|
184
|
+
position();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
schedulerRect.current = { width: entry.contentRect.width, height: entry.contentRect.height };
|
|
180
188
|
}, [align, position]);
|
|
181
189
|
React.useEffect(align);
|
|
182
190
|
React.useEffect(position);
|
|
@@ -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: 1648643319,
|
|
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
|
};
|
|
@@ -18,7 +18,7 @@ exports.toSlots = function (_dateRange, _a, _b) {
|
|
|
18
18
|
var zonedStart = current.clone();
|
|
19
19
|
var zonedEnd = current.addTime(step);
|
|
20
20
|
var difference = (zonedEnd.timezoneOffset - zonedStart.timezoneOffset) * constants_1.MS_PER_MINUTE;
|
|
21
|
-
var canFill = step
|
|
21
|
+
var canFill = step <= Math.abs(difference);
|
|
22
22
|
if (deficiency && canFill) {
|
|
23
23
|
deficiency -= step;
|
|
24
24
|
current = current.addTime(-step);
|