@progress/kendo-react-scheduler 16.1.0-develop.17 → 16.1.0-develop.19
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/constants/index.d.ts +2 -0
- package/constants/index.js +1 -1
- package/constants/index.mjs +6 -5
- package/dist/cdn/js/kendo-react-scheduler.js +1 -1
- package/hooks/index.d.ts +1 -1
- package/hooks/useSlotExpand.js +1 -1
- package/hooks/useSlotExpand.mjs +42 -54
- package/items/SchedulerEditItem.js +1 -1
- package/items/SchedulerEditItem.mjs +206 -206
- package/items/SchedulerProportionalViewItem.js +1 -1
- package/items/SchedulerProportionalViewItem.mjs +37 -37
- package/items/SchedulerViewItem.js +1 -1
- package/items/SchedulerViewItem.mjs +17 -17
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/views/agenda/AgendaView.js +1 -1
- package/views/agenda/AgendaView.mjs +2 -2
- package/views/month/MonthView.js +1 -1
- package/views/month/MonthView.mjs +149 -109
- package/hooks/useGroupRowHeightSync.js +0 -8
- package/hooks/useGroupRowHeightSync.mjs +0 -84
|
@@ -6,164 +6,204 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import
|
|
10
|
-
import { BaseView as
|
|
11
|
-
import { ZonedDate as
|
|
12
|
-
import { classNames as
|
|
9
|
+
import oe from "prop-types";
|
|
10
|
+
import { BaseView as re } from "../../components/BaseView.mjs";
|
|
11
|
+
import { ZonedDate as b, firstDayInWeek as $, firstDayOfMonth as ae, getDate as G, addDays as ne, lastDayOfMonth as se, MS_PER_DAY as B } from "@progress/kendo-date-math";
|
|
12
|
+
import { classNames as R } from "@progress/kendo-react-common";
|
|
13
13
|
import { VerticalResourceIterator as I } from "../common/VerticalResourceIterator.mjs";
|
|
14
|
-
import { HorizontalResourceIterator as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { toRanges as
|
|
22
|
-
import { toSlots as
|
|
23
|
-
import { toOccurrences as
|
|
24
|
-
import { toItems as
|
|
25
|
-
import { ShowMoreItemsButton as
|
|
26
|
-
import { MoreEventsPopover as
|
|
27
|
-
import { SchedulerEditItem as
|
|
28
|
-
import { useSchedulerPropsContext as
|
|
29
|
-
import { SchedulerResourceIteratorContext as
|
|
30
|
-
import { DateHeaderCell as
|
|
31
|
-
const
|
|
32
|
-
const { group:
|
|
33
|
-
() =>
|
|
34
|
-
[
|
|
35
|
-
),
|
|
36
|
-
() =>
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
() =>
|
|
40
|
-
[
|
|
41
|
-
),
|
|
42
|
-
() =>
|
|
43
|
-
[
|
|
44
|
-
), [
|
|
45
|
-
|
|
14
|
+
import { HorizontalResourceIterator as U } from "../common/HorizontalResourceIterator.mjs";
|
|
15
|
+
import { mapItemsToSlots as le, mapSlotsToItems as me, orderSort as ce, toUTCDateTime as Y } from "../../utils/index.mjs";
|
|
16
|
+
import { monthViewTitle as F, messages as ie } from "../../messages/index.mjs";
|
|
17
|
+
import { SchedulerEditSlot as de } from "../../slots/SchedulerEditSlot.mjs";
|
|
18
|
+
import { useInternationalization as ue } from "@progress/kendo-react-intl";
|
|
19
|
+
import { MORE_BUTTON_HEIGHT as L, DAY_SLOT_HEADER_HEIGHT as N, DAYS_IN_WEEK_COUNT as Z } from "../../constants/index.mjs";
|
|
20
|
+
import { toGroupResources as he, expandResources as fe } from "../common/utils.mjs";
|
|
21
|
+
import { toRanges as ge } from "../../services/rangeService.mjs";
|
|
22
|
+
import { toSlots as Se } from "../../services/slotsService.mjs";
|
|
23
|
+
import { toOccurrences as De } from "../../services/occurrenceService.mjs";
|
|
24
|
+
import { toItems as Ee } from "../../services/itemsService.mjs";
|
|
25
|
+
import { ShowMoreItemsButton as K } from "../../components/ShowMoreItemsButton.mjs";
|
|
26
|
+
import { MoreEventsPopover as ke } from "../../components/MoreEventsPopover.mjs";
|
|
27
|
+
import { SchedulerEditItem as pe } from "../../items/SchedulerEditItem.mjs";
|
|
28
|
+
import { useSchedulerPropsContext as we, useSchedulerDataContext as ye, useSchedulerDateContext as Ce, useSchedulerActiveViewContext as Te, useSchedulerViewsContext as ve, useSchedulerGroupsContext as Me, useSchedulerOrientationContext as Re, useSchedulerDateRangeContext as Ne, useSchedulerFieldsContext as ze } from "../../context/SchedulerContext.mjs";
|
|
29
|
+
import { SchedulerResourceIteratorContext as z } from "../../context/SchedulerResourceIteratorContext.mjs";
|
|
30
|
+
import { DateHeaderCell as be } from "../../components/DateHeaderCell.mjs";
|
|
31
|
+
const W = { skeleton: "dd" }, j = (t) => {
|
|
32
|
+
const { group: m, timezone: l, resources: i } = we(), C = t.editItem || pe, g = t.editSlot || de, [S] = ye(), [E, k] = Ce(), [, T] = Te(), A = ve(), p = Me(), D = Re(), c = Ne(), P = ue(), _ = ze(), q = e.useRef(null), h = t.itemsPerSlot || Pe.itemsPerSlot, d = e.useMemo(
|
|
33
|
+
() => ge(c, { step: B * Z, timezone: l }),
|
|
34
|
+
[c.start.getTime(), c.end.getTime(), l]
|
|
35
|
+
), u = e.useMemo(
|
|
36
|
+
() => Se(c, { step: B }, { groups: p, ranges: d }),
|
|
37
|
+
[c.start.getTime(), c.end.getTime(), p, d]
|
|
38
|
+
), x = e.useMemo(
|
|
39
|
+
() => De(S, { dateRange: c, fields: _, timezone: l }),
|
|
40
|
+
[S, c.start.getTime(), c.end.getTime(), _, l]
|
|
41
|
+
), f = e.useMemo(
|
|
42
|
+
() => Ee(x, { timezone: l }, { groups: p, ranges: d }),
|
|
43
|
+
[x, l, p, d]
|
|
44
|
+
), [v, M] = e.useState({ show: !1, anchor: null, slot: null }), O = e.useCallback((o) => {
|
|
45
|
+
M({
|
|
46
46
|
show: !0,
|
|
47
|
-
anchor:
|
|
48
|
-
slot:
|
|
47
|
+
anchor: o.target.element,
|
|
48
|
+
slot: o.target.slot || null
|
|
49
49
|
});
|
|
50
|
-
}, []),
|
|
51
|
-
|
|
52
|
-
}, []),
|
|
53
|
-
(
|
|
54
|
-
const r =
|
|
55
|
-
!
|
|
50
|
+
}, []), J = e.useCallback(() => {
|
|
51
|
+
M({ show: !1, anchor: null, slot: null });
|
|
52
|
+
}, []), Q = e.useCallback(
|
|
53
|
+
(o) => {
|
|
54
|
+
const r = A.find((s) => s.props.name === "day");
|
|
55
|
+
!T || !r || !r.props.name || (T(r.props.name), k(o.start), M({ show: !1, anchor: null, slot: null }));
|
|
56
56
|
},
|
|
57
|
-
[
|
|
57
|
+
[T, k, A]
|
|
58
58
|
);
|
|
59
|
-
e.useMemo(() =>
|
|
60
|
-
const
|
|
61
|
-
|
|
59
|
+
e.useMemo(() => le(f, u, !0), [f, u]), e.useMemo(() => me(f, u, !0), [f, u]);
|
|
60
|
+
const w = e.useMemo(() => he(m, i), [m, i]), X = e.useMemo(
|
|
61
|
+
() => fe(w, w.length - 1),
|
|
62
|
+
[w]
|
|
63
|
+
), ee = w.length > 0, V = /* @__PURE__ */ e.createElement(z.Consumer, null, ({ groupIndex: o }) => /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-row", key: o }, u.filter((r) => r.group.index === o && r.range.index === 0).map((r, s) => /* @__PURE__ */ e.createElement(
|
|
64
|
+
be,
|
|
62
65
|
{
|
|
63
|
-
as:
|
|
64
|
-
key:
|
|
65
|
-
"data-dayslot-index":
|
|
66
|
-
date:
|
|
66
|
+
as: t.dateHeaderCell,
|
|
67
|
+
key: s,
|
|
68
|
+
"data-dayslot-index": s,
|
|
69
|
+
date: b.fromLocalDate(
|
|
67
70
|
new Date(
|
|
68
71
|
r.zonedEnd.getTime() - (r.zonedEnd.getTime() - r.zonedStart.getTime()) / 2
|
|
69
72
|
),
|
|
70
|
-
|
|
73
|
+
l
|
|
71
74
|
),
|
|
72
75
|
start: r.start,
|
|
73
76
|
end: r.end,
|
|
74
77
|
format: { skeleton: "EEEE" }
|
|
75
78
|
}
|
|
76
|
-
)))),
|
|
79
|
+
)))), H = /* @__PURE__ */ e.createElement(z.Consumer, null, ({ groupIndex: o }) => d.map((r, s) => /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-row", key: s }, u.filter((a) => a.group.index === o && a.range.index === s).map((a, n, y) => /* @__PURE__ */ e.createElement(
|
|
77
80
|
g,
|
|
78
81
|
{
|
|
79
|
-
slot:
|
|
80
|
-
viewSlot:
|
|
81
|
-
key:
|
|
82
|
-
form:
|
|
82
|
+
slot: t.slot,
|
|
83
|
+
viewSlot: t.viewSlot,
|
|
84
|
+
key: n,
|
|
85
|
+
form: t.form,
|
|
83
86
|
...a,
|
|
84
87
|
expandable: {
|
|
85
|
-
offsetTop:
|
|
86
|
-
offsetBottom:
|
|
88
|
+
offsetTop: N,
|
|
89
|
+
offsetBottom: L
|
|
87
90
|
},
|
|
88
|
-
onDataAction:
|
|
89
|
-
col:
|
|
90
|
-
row:
|
|
91
|
-
editable:
|
|
92
|
-
className:
|
|
93
|
-
"k-other-month": a.zonedStart.getMonth() !==
|
|
91
|
+
onDataAction: t.onDataAction,
|
|
92
|
+
col: D === "horizontal" ? y.length * (o || 0) + n : n,
|
|
93
|
+
row: D === "horizontal" ? s : d.length * (o || 0) + s,
|
|
94
|
+
editable: t.editable,
|
|
95
|
+
className: R({
|
|
96
|
+
"k-other-month": a.zonedStart.getMonth() !== E.getMonth()
|
|
94
97
|
})
|
|
95
98
|
},
|
|
96
|
-
/* @__PURE__ */ e.createElement("span", { className: "k-link k-nav-day" },
|
|
97
|
-
|
|
98
|
-
|
|
99
|
+
/* @__PURE__ */ e.createElement("span", { className: "k-link k-nav-day" }, P.formatDate(a.zonedStart, W)),
|
|
100
|
+
h < a.items.length && /* @__PURE__ */ e.createElement(
|
|
101
|
+
K,
|
|
99
102
|
{
|
|
100
103
|
slot: a,
|
|
101
|
-
hiddenCount: a.items.length -
|
|
102
|
-
onClick:
|
|
104
|
+
hiddenCount: a.items.length - h,
|
|
105
|
+
onClick: O
|
|
103
106
|
}
|
|
104
107
|
)
|
|
105
108
|
)))));
|
|
106
109
|
return /* @__PURE__ */ e.createElement(
|
|
107
|
-
|
|
110
|
+
re,
|
|
108
111
|
{
|
|
109
|
-
props:
|
|
110
|
-
slots:
|
|
111
|
-
ranges:
|
|
112
|
-
className:
|
|
112
|
+
props: t,
|
|
113
|
+
slots: u,
|
|
114
|
+
ranges: d,
|
|
115
|
+
className: R("k-scheduler-monthview", t.className)
|
|
113
116
|
},
|
|
114
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-head" },
|
|
115
|
-
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-body", ref:
|
|
116
|
-
|
|
117
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-head" }, D === "horizontal" ? /* @__PURE__ */ e.createElement(U, { nested: !0, resources: i, group: m }, V) : /* @__PURE__ */ e.createElement(I, { resources: i, group: m }, V)),
|
|
118
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-body", ref: q }, D === "horizontal" && ee ? d.map((o, r) => /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-group k-group-horizontal", key: r }, /* @__PURE__ */ e.createElement("div", { className: "k-scheduler-row" }, X.map((s, a) => /* @__PURE__ */ e.createElement("div", { key: a, className: "k-scheduler-cell k-group-cell" }, /* @__PURE__ */ e.createElement(
|
|
119
|
+
z.Provider,
|
|
117
120
|
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
value: { resource: s, groupIndex: a }
|
|
122
|
+
},
|
|
123
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-scheduler-row" }, u.filter(
|
|
124
|
+
(n) => n.group.index === a && n.range.index === r
|
|
125
|
+
).map((n, y, te) => /* @__PURE__ */ e.createElement(
|
|
126
|
+
g,
|
|
127
|
+
{
|
|
128
|
+
slot: t.slot,
|
|
129
|
+
viewSlot: t.viewSlot,
|
|
130
|
+
key: y,
|
|
131
|
+
form: t.form,
|
|
132
|
+
...n,
|
|
133
|
+
expandable: {
|
|
134
|
+
offsetTop: N,
|
|
135
|
+
offsetBottom: L
|
|
136
|
+
},
|
|
137
|
+
onDataAction: t.onDataAction,
|
|
138
|
+
col: te.length * a + y,
|
|
139
|
+
row: r,
|
|
140
|
+
editable: t.editable,
|
|
141
|
+
className: R({
|
|
142
|
+
"k-other-month": n.zonedStart.getMonth() !== E.getMonth()
|
|
143
|
+
})
|
|
144
|
+
},
|
|
145
|
+
/* @__PURE__ */ e.createElement("span", { className: "k-link k-nav-day" }, P.formatDate(n.zonedStart, W)),
|
|
146
|
+
h < n.items.length && /* @__PURE__ */ e.createElement(
|
|
147
|
+
K,
|
|
148
|
+
{
|
|
149
|
+
slot: n,
|
|
150
|
+
hiddenCount: n.items.length - h,
|
|
151
|
+
onClick: O
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
)))
|
|
155
|
+
)))))) : D === "horizontal" ? /* @__PURE__ */ e.createElement(U, { resources: i, group: m }, H) : /* @__PURE__ */ e.createElement(I, { nested: !0, resources: i, group: m }, H), f.filter((o) => o.order === null || o.order < h).sort(ce).map((o) => /* @__PURE__ */ e.createElement(
|
|
156
|
+
C,
|
|
157
|
+
{
|
|
158
|
+
item: t.item,
|
|
159
|
+
viewItem: t.viewItem,
|
|
160
|
+
form: t.form,
|
|
161
|
+
key: o.isRecurring ? `${o.uid}:${o.group.index}:${o.range.index}:${o.originalStart}` : `${o.uid}:${o.group.index}:${o.range.index}`,
|
|
162
|
+
...o,
|
|
163
|
+
onDataAction: t.onDataAction,
|
|
164
|
+
slotHeaderOffset: N,
|
|
125
165
|
vertical: !1,
|
|
126
|
-
editable:
|
|
166
|
+
editable: t.editable,
|
|
127
167
|
ignoreIsAllDay: !0
|
|
128
168
|
}
|
|
129
169
|
))),
|
|
130
170
|
/* @__PURE__ */ e.createElement(
|
|
131
|
-
|
|
171
|
+
ke,
|
|
132
172
|
{
|
|
133
|
-
show:
|
|
134
|
-
anchor:
|
|
135
|
-
slot:
|
|
136
|
-
items:
|
|
137
|
-
itemsPerSlot:
|
|
138
|
-
onDayClick:
|
|
139
|
-
onClose:
|
|
173
|
+
show: v.show,
|
|
174
|
+
anchor: v.anchor,
|
|
175
|
+
slot: v.slot,
|
|
176
|
+
items: f,
|
|
177
|
+
itemsPerSlot: h,
|
|
178
|
+
onDayClick: Q,
|
|
179
|
+
onClose: J
|
|
140
180
|
}
|
|
141
181
|
)
|
|
142
182
|
);
|
|
143
|
-
},
|
|
144
|
-
const
|
|
183
|
+
}, Ae = ({ intl: t, date: m, timezone: l }) => {
|
|
184
|
+
const i = $(ae(G(m)), t.firstDay()), C = ne($(se(G(m)), t.firstDay()), Z), g = b.fromUTCDate(Y(i), l), S = b.fromUTCDate(Y(C), l), E = new Date(g.getTime()), k = new Date(S.getTime());
|
|
145
185
|
return {
|
|
146
|
-
start:
|
|
147
|
-
end:
|
|
186
|
+
start: E,
|
|
187
|
+
end: k,
|
|
148
188
|
zonedStart: g,
|
|
149
|
-
zonedEnd:
|
|
189
|
+
zonedEnd: S
|
|
150
190
|
};
|
|
151
|
-
},
|
|
191
|
+
}, Pe = {
|
|
152
192
|
name: "month",
|
|
153
|
-
dateRange:
|
|
193
|
+
dateRange: Ae,
|
|
154
194
|
slotDuration: 1440,
|
|
155
195
|
slotDivision: 1,
|
|
156
196
|
itemsPerSlot: 2,
|
|
157
197
|
numberOfDays: 31,
|
|
158
|
-
title: (
|
|
198
|
+
title: (t) => t.toLanguageString(F, ie[F]),
|
|
159
199
|
selectedDateFormat: "{0:Y}",
|
|
160
200
|
selectedShortDateFormat: "{0:y}"
|
|
161
|
-
},
|
|
162
|
-
itemsPerSlot:
|
|
201
|
+
}, _e = {
|
|
202
|
+
itemsPerSlot: oe.number
|
|
163
203
|
};
|
|
164
|
-
|
|
165
|
-
|
|
204
|
+
j.propTypes = _e;
|
|
205
|
+
j.displayName = "KendoReactSchedulerMonthView";
|
|
166
206
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
207
|
+
j as MonthView,
|
|
208
|
+
Pe as monthViewDefaultProps
|
|
169
209
|
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),O=require("@progress/kendo-react-common");function H(r){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(l,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return l.default=r,Object.freeze(l)}const c=H(v),R=(r,l)=>{const n=c.useRef(0),o=c.useRef(null),[,y]=c.useReducer(e=>e+1,0),m=c.useCallback(()=>{const e=o.current,t=r.current;e&&t&&e.observe(t,{attributes:!0,attributeFilter:["style"],subtree:!0})},[r]),d=c.useCallback(()=>{const e=r.current;if(!e)return null;const t=e.querySelectorAll(":scope > .k-scheduler-group > .k-scheduler-row > .k-group-cell");return t.length<2?null:Array.from(t).map(u=>Array.from(u.querySelectorAll(":scope > .k-scheduler-row")))},[r]),k=c.useCallback(e=>{var p,a,w;(p=o.current)==null||p.disconnect();let t=!1;const u=(w=(a=e[0])==null?void 0:a.length)!=null?w:0;for(let i=0;i<u;i++){for(const f of e){const s=f[i];if(!s)continue;s.querySelectorAll(":scope > .k-slot-cell").forEach(b=>{b.style.removeProperty("height")})}let g=0;for(const f of e){const s=f[i];s&&(g=Math.max(g,s.offsetHeight))}for(const f of e){const s=f[i];if(!s)continue;s.querySelectorAll(":scope > .k-slot-cell").forEach(b=>{b.offsetHeight!==g&&(t=!0),b.style.height=`${g}px`})}}return m(),t},[m]),h=c.useCallback(()=>{const e=d();e&&k(e)&&y()},[d,k,y]);O.useIsomorphicLayoutEffect(h,l);const C=c.useCallback(()=>{clearTimeout(n.current),n.current=window.setTimeout(h,50)},[h]);c.useEffect(()=>{const e=r.current;if(!e)return;o.current&&o.current.disconnect();const t=new MutationObserver(u=>{u.some(a=>a.target instanceof HTMLElement&&a.target.classList.contains("k-slot-cell"))&&C()});return o.current=t,t.observe(e,{attributes:!0,attributeFilter:["style"],subtree:!0}),C(),()=>{clearTimeout(n.current),t.disconnect(),o.current=null}},l)};exports.useGroupRowHeightSync=R;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
import * as r from "react";
|
|
9
|
-
import { useIsomorphicLayoutEffect as S } from "@progress/kendo-react-common";
|
|
10
|
-
const A = (c, b) => {
|
|
11
|
-
const h = r.useRef(0), s = r.useRef(null), [, m] = r.useReducer((e) => e + 1, 0), y = r.useCallback(() => {
|
|
12
|
-
const e = s.current, t = c.current;
|
|
13
|
-
e && t && e.observe(t, {
|
|
14
|
-
attributes: !0,
|
|
15
|
-
attributeFilter: ["style"],
|
|
16
|
-
subtree: !0
|
|
17
|
-
});
|
|
18
|
-
}, [c]), C = r.useCallback(() => {
|
|
19
|
-
const e = c.current;
|
|
20
|
-
if (!e)
|
|
21
|
-
return null;
|
|
22
|
-
const t = e.querySelectorAll(":scope > .k-scheduler-group > .k-scheduler-row > .k-group-cell");
|
|
23
|
-
return t.length < 2 ? null : Array.from(t).map(
|
|
24
|
-
(n) => Array.from(n.querySelectorAll(":scope > .k-scheduler-row"))
|
|
25
|
-
);
|
|
26
|
-
}, [c]), k = r.useCallback((e) => {
|
|
27
|
-
var p, l, w;
|
|
28
|
-
(p = s.current) == null || p.disconnect();
|
|
29
|
-
let t = !1;
|
|
30
|
-
const n = (w = (l = e[0]) == null ? void 0 : l.length) != null ? w : 0;
|
|
31
|
-
for (let u = 0; u < n; u++) {
|
|
32
|
-
for (const a of e) {
|
|
33
|
-
const o = a[u];
|
|
34
|
-
if (!o)
|
|
35
|
-
continue;
|
|
36
|
-
o.querySelectorAll(":scope > .k-slot-cell").forEach((f) => {
|
|
37
|
-
f.style.removeProperty("height");
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
let i = 0;
|
|
41
|
-
for (const a of e) {
|
|
42
|
-
const o = a[u];
|
|
43
|
-
o && (i = Math.max(i, o.offsetHeight));
|
|
44
|
-
}
|
|
45
|
-
for (const a of e) {
|
|
46
|
-
const o = a[u];
|
|
47
|
-
if (!o)
|
|
48
|
-
continue;
|
|
49
|
-
o.querySelectorAll(":scope > .k-slot-cell").forEach((f) => {
|
|
50
|
-
f.offsetHeight !== i && (t = !0), f.style.height = `${i}px`;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return y(), t;
|
|
55
|
-
}, [y]), g = r.useCallback(() => {
|
|
56
|
-
const e = C();
|
|
57
|
-
e && k(e) && m();
|
|
58
|
-
}, [C, k, m]);
|
|
59
|
-
S(g, b);
|
|
60
|
-
const d = r.useCallback(() => {
|
|
61
|
-
clearTimeout(h.current), h.current = window.setTimeout(g, 50);
|
|
62
|
-
}, [g]);
|
|
63
|
-
r.useEffect(() => {
|
|
64
|
-
const e = c.current;
|
|
65
|
-
if (!e)
|
|
66
|
-
return;
|
|
67
|
-
s.current && s.current.disconnect();
|
|
68
|
-
const t = new MutationObserver((n) => {
|
|
69
|
-
n.some(
|
|
70
|
-
(l) => l.target instanceof HTMLElement && l.target.classList.contains("k-slot-cell")
|
|
71
|
-
) && d();
|
|
72
|
-
});
|
|
73
|
-
return s.current = t, t.observe(e, {
|
|
74
|
-
attributes: !0,
|
|
75
|
-
attributeFilter: ["style"],
|
|
76
|
-
subtree: !0
|
|
77
|
-
}), d(), () => {
|
|
78
|
-
clearTimeout(h.current), t.disconnect(), s.current = null;
|
|
79
|
-
};
|
|
80
|
-
}, b);
|
|
81
|
-
};
|
|
82
|
-
export {
|
|
83
|
-
A as useGroupRowHeightSync
|
|
84
|
-
};
|