@savvycal/calendar 0.7.0 → 0.8.0
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/README.md +4 -0
- package/dist/components/day-grid-view/AllDayEventChip.d.ts.map +1 -1
- package/dist/components/day-grid-view/AllDayEventChip.js +31 -30
- package/dist/components/day-grid-view/DayGridView.d.ts.map +1 -1
- package/dist/components/day-grid-view/DayGridView.js +153 -152
- package/dist/components/resource-grid-view/ResourceGridView.d.ts.map +1 -1
- package/dist/components/resource-grid-view/ResourceGridView.js +170 -169
- package/dist/components/shared/AllDayRow.d.ts.map +1 -1
- package/dist/components/shared/AllDayRow.js +23 -22
- package/dist/components/shared/EventChip.d.ts.map +1 -1
- package/dist/components/shared/EventChip.js +60 -59
- package/dist/lib/accessibility.d.ts +6 -0
- package/dist/lib/accessibility.d.ts.map +1 -0
- package/dist/lib/accessibility.js +11 -0
- package/dist/types/calendar.d.ts +3 -0
- package/dist/types/calendar.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -256,6 +256,7 @@ interface TimedCalendarEvent {
|
|
|
256
256
|
color?: string;
|
|
257
257
|
clientName?: string;
|
|
258
258
|
status?: 'confirmed' | 'canceled' | 'tentative';
|
|
259
|
+
ariaLabel?: string;
|
|
259
260
|
metadata?: Record<string, unknown>;
|
|
260
261
|
}
|
|
261
262
|
|
|
@@ -269,10 +270,13 @@ interface AllDayCalendarEvent {
|
|
|
269
270
|
color?: string;
|
|
270
271
|
clientName?: string;
|
|
271
272
|
status?: 'confirmed' | 'canceled' | 'tentative';
|
|
273
|
+
ariaLabel?: string;
|
|
272
274
|
metadata?: Record<string, unknown>;
|
|
273
275
|
}
|
|
274
276
|
```
|
|
275
277
|
|
|
278
|
+
The optional `ariaLabel` field provides a plain-text label used for `aria-label` attributes and screen reader announcements. When `title` or `clientName` are React elements (not plain strings), set `ariaLabel` to avoid `"[object Object]"` in accessible labels.
|
|
279
|
+
|
|
276
280
|
### AvailabilityRange
|
|
277
281
|
|
|
278
282
|
```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllDayEventChip.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/AllDayEventChip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AllDayEventChip.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/AllDayEventChip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,UAAU,oBAAoB;IAC5B,UAAU,EAAE,qBAAqB,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,qBAAqB,KAAK,MAAM,CAAC;IAClD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,eAAe,4DAmG1B,CAAC"}
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as D, Fragment as E, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { memo as L } from "react";
|
|
3
|
+
import { cn as g } from "../../lib/utils.js";
|
|
4
|
+
import { getEventLabel as x, getClientNameLabel as N } from "../../lib/accessibility.js";
|
|
5
|
+
const T = L(function({
|
|
6
|
+
positioned: b,
|
|
7
|
+
laneOffset: y,
|
|
7
8
|
cls: t,
|
|
8
9
|
onEventClick: a,
|
|
9
10
|
selectedEventId: h,
|
|
10
|
-
selectedEventRef:
|
|
11
|
+
selectedEventRef: v
|
|
11
12
|
}) {
|
|
12
13
|
const {
|
|
13
14
|
event: e,
|
|
14
|
-
gridColumnStart:
|
|
15
|
+
gridColumnStart: i,
|
|
15
16
|
gridColumnSpan: r,
|
|
16
|
-
lane:
|
|
17
|
+
lane: C,
|
|
17
18
|
continuesBefore: l,
|
|
18
19
|
continuesAfter: s
|
|
19
|
-
} =
|
|
20
|
-
|
|
21
|
-
const
|
|
20
|
+
} = b, R = e.id === h, d = C + 1 + y, o = [x(e), "all day"], c = N(e);
|
|
21
|
+
c && o.push(c);
|
|
22
|
+
const m = l ? 2 : 4, p = s ? 2 : 4, u = {
|
|
22
23
|
...l ? {
|
|
23
24
|
borderTopLeftRadius: 0,
|
|
24
25
|
borderBottomLeftRadius: 0,
|
|
25
26
|
paddingLeft: 4
|
|
26
27
|
} : {},
|
|
27
28
|
...s ? { borderTopRightRadius: 0, borderBottomRightRadius: 0 } : {}
|
|
28
|
-
},
|
|
29
|
+
}, f = /* @__PURE__ */ D(E, { children: [
|
|
29
30
|
e.color && !l && /* @__PURE__ */ n(
|
|
30
31
|
"div",
|
|
31
32
|
{
|
|
@@ -35,31 +36,31 @@ const B = x(function({
|
|
|
35
36
|
),
|
|
36
37
|
/* @__PURE__ */ n("span", { className: t("allDayEventTitle"), children: e.title })
|
|
37
38
|
] });
|
|
38
|
-
return
|
|
39
|
+
return R ? /* @__PURE__ */ n(
|
|
39
40
|
"div",
|
|
40
41
|
{
|
|
41
|
-
ref:
|
|
42
|
+
ref: v,
|
|
42
43
|
style: {
|
|
43
|
-
gridColumn: `${
|
|
44
|
+
gridColumn: `${i} / span ${r}`,
|
|
44
45
|
gridRow: d,
|
|
45
46
|
display: "flex",
|
|
46
47
|
minWidth: 0,
|
|
47
|
-
marginLeft:
|
|
48
|
-
marginRight:
|
|
48
|
+
marginLeft: m,
|
|
49
|
+
marginRight: p
|
|
49
50
|
},
|
|
50
51
|
children: /* @__PURE__ */ n(
|
|
51
52
|
"button",
|
|
52
53
|
{
|
|
53
54
|
type: "button",
|
|
54
|
-
"aria-label":
|
|
55
|
-
className:
|
|
55
|
+
"aria-label": o.join(", "),
|
|
56
|
+
className: g(
|
|
56
57
|
t("allDayEvent"),
|
|
57
58
|
t("allDayEventSelected"),
|
|
58
59
|
"relative flex items-center gap-1 w-full"
|
|
59
60
|
),
|
|
60
|
-
style:
|
|
61
|
+
style: u,
|
|
61
62
|
onClick: () => a?.(e),
|
|
62
|
-
children:
|
|
63
|
+
children: f
|
|
63
64
|
}
|
|
64
65
|
)
|
|
65
66
|
}
|
|
@@ -67,20 +68,20 @@ const B = x(function({
|
|
|
67
68
|
"button",
|
|
68
69
|
{
|
|
69
70
|
type: "button",
|
|
70
|
-
"aria-label":
|
|
71
|
-
className:
|
|
71
|
+
"aria-label": o.join(", "),
|
|
72
|
+
className: g(t("allDayEvent"), "relative flex items-center gap-1"),
|
|
72
73
|
style: {
|
|
73
|
-
gridColumn: `${
|
|
74
|
+
gridColumn: `${i} / span ${r}`,
|
|
74
75
|
gridRow: d,
|
|
75
|
-
marginLeft:
|
|
76
|
-
marginRight:
|
|
77
|
-
...
|
|
76
|
+
marginLeft: m,
|
|
77
|
+
marginRight: p,
|
|
78
|
+
...u
|
|
78
79
|
},
|
|
79
80
|
onClick: () => a?.(e),
|
|
80
|
-
children:
|
|
81
|
+
children: f
|
|
81
82
|
}
|
|
82
83
|
);
|
|
83
84
|
});
|
|
84
85
|
export {
|
|
85
|
-
|
|
86
|
+
T as AllDayEventChip
|
|
86
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DayGridView.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/DayGridView.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAKV,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"DayGridView.d.ts","sourceRoot":"","sources":["../../../src/components/day-grid-view/DayGridView.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAKV,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAc1B,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAe,EACf,cAAoB,EACpB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,iBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,WAAuB,EACvB,WAAe,GAChB,EAAE,gBAAgB,2CAgalB"}
|
|
@@ -1,143 +1,144 @@
|
|
|
1
1
|
import { jsxs as F, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as m, useCallback as
|
|
2
|
+
import { useMemo as m, useCallback as D, useRef as K, useState as Ht, useEffect as U } from "react";
|
|
3
3
|
import { Temporal as E } from "temporal-polyfill";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { generateDateRange as
|
|
6
|
-
import { layoutAllDayEvents as
|
|
7
|
-
import { computeUnavailableBlocks as
|
|
8
|
-
import { UnavailabilityOverlay as
|
|
9
|
-
import { dayGridViewDefaults as
|
|
10
|
-
import { DayHeader as
|
|
11
|
-
import { DayColumn as
|
|
12
|
-
import { TimeGutter as
|
|
13
|
-
import { SlotInteractionLayer as
|
|
14
|
-
import { SelectionOverlay as
|
|
15
|
-
import { NowIndicator as
|
|
16
|
-
import { AllDaySection as
|
|
17
|
-
import { useEffectiveHourHeight as
|
|
18
|
-
import { useAnnouncer as
|
|
19
|
-
|
|
4
|
+
import { cn as k } from "../../lib/utils.js";
|
|
5
|
+
import { generateDateRange as bt, generateTimeSlots as vt, formatDayOfWeek as q, formatTimeRange as J } from "../../lib/time.js";
|
|
6
|
+
import { layoutAllDayEvents as Ct, computePositionedEventsByDate as $t } from "../../lib/overlap.js";
|
|
7
|
+
import { computeUnavailableBlocks as xt } from "../../lib/availability.js";
|
|
8
|
+
import { UnavailabilityOverlay as Et } from "../shared/UnavailabilityOverlay.js";
|
|
9
|
+
import { dayGridViewDefaults as kt } from "./defaults.js";
|
|
10
|
+
import { DayHeader as Nt } from "./DayHeader.js";
|
|
11
|
+
import { DayColumn as It } from "./DayColumn.js";
|
|
12
|
+
import { TimeGutter as Lt } from "../shared/TimeGutter.js";
|
|
13
|
+
import { SlotInteractionLayer as jt } from "../shared/SlotInteractionLayer.js";
|
|
14
|
+
import { SelectionOverlay as Mt } from "../shared/SelectionOverlay.js";
|
|
15
|
+
import { NowIndicator as At } from "../shared/NowIndicator.js";
|
|
16
|
+
import { AllDaySection as Bt } from "./AllDaySection.js";
|
|
17
|
+
import { useEffectiveHourHeight as Gt } from "../shared/useEffectiveHourHeight.js";
|
|
18
|
+
import { useAnnouncer as Ot } from "../shared/useAnnouncer.js";
|
|
19
|
+
import { getEventLabel as Q, getClientNameLabel as X } from "../../lib/accessibility.js";
|
|
20
|
+
function nr({
|
|
20
21
|
activeRange: d,
|
|
21
|
-
timeZone:
|
|
22
|
-
events:
|
|
22
|
+
timeZone: n,
|
|
23
|
+
events: N,
|
|
23
24
|
availability: S,
|
|
24
25
|
unavailability: T,
|
|
25
26
|
defaultUnavailable: I,
|
|
26
27
|
timeAxis: w,
|
|
27
|
-
onEventClick:
|
|
28
|
-
snapDuration:
|
|
29
|
-
placeholderDuration:
|
|
28
|
+
onEventClick: L,
|
|
29
|
+
snapDuration: j,
|
|
30
|
+
placeholderDuration: Y,
|
|
30
31
|
selectedRange: f,
|
|
31
32
|
onSelect: s,
|
|
32
33
|
onSlotClick: H,
|
|
33
|
-
className:
|
|
34
|
-
classNames:
|
|
35
|
-
hourHeight:
|
|
36
|
-
columnMinWidth:
|
|
37
|
-
renderHeader:
|
|
34
|
+
className: _,
|
|
35
|
+
classNames: M,
|
|
36
|
+
hourHeight: Z = 60,
|
|
37
|
+
columnMinWidth: tt = 120,
|
|
38
|
+
renderHeader: rt,
|
|
38
39
|
renderEvent: b,
|
|
39
|
-
selectionAppearance:
|
|
40
|
-
dragPreviewAppearance:
|
|
41
|
-
selectionRef:
|
|
40
|
+
selectionAppearance: et,
|
|
41
|
+
dragPreviewAppearance: ot,
|
|
42
|
+
selectionRef: nt,
|
|
42
43
|
selectionLingerMs: v = 0,
|
|
43
|
-
selectedEventId:
|
|
44
|
-
selectedEventRef:
|
|
45
|
-
renderCorner:
|
|
46
|
-
eventGap:
|
|
47
|
-
eventLayout:
|
|
48
|
-
stackOffset:
|
|
44
|
+
selectedEventId: A,
|
|
45
|
+
selectedEventRef: B,
|
|
46
|
+
renderCorner: it,
|
|
47
|
+
eventGap: at,
|
|
48
|
+
eventLayout: lt = "columns",
|
|
49
|
+
stackOffset: st = 8
|
|
49
50
|
}) {
|
|
50
|
-
const l = w?.startHour ?? 0, c = w?.endHour ?? 24,
|
|
51
|
-
() =>
|
|
51
|
+
const l = w?.startHour ?? 0, c = w?.endHour ?? 24, C = w?.intervalMinutes ?? 60, o = m(
|
|
52
|
+
() => bt(d.startDate, d.endDate),
|
|
52
53
|
[d.startDate, d.endDate]
|
|
53
|
-
),
|
|
54
|
+
), G = m(() => E.Now.plainDateISO(n).toString(), [n]), {
|
|
54
55
|
effectiveHourHeight: u,
|
|
55
|
-
rootRef:
|
|
56
|
-
headerRef:
|
|
57
|
-
allDayRef:
|
|
58
|
-
gridRef:
|
|
59
|
-
headerHeight:
|
|
60
|
-
} =
|
|
61
|
-
(t) =>
|
|
62
|
-
[
|
|
63
|
-
), y = K(null), p = K(null), [
|
|
56
|
+
rootRef: ct,
|
|
57
|
+
headerRef: mt,
|
|
58
|
+
allDayRef: dt,
|
|
59
|
+
gridRef: ut,
|
|
60
|
+
headerHeight: O
|
|
61
|
+
} = Gt(Z, c - l), i = D(
|
|
62
|
+
(t) => k(kt[t], M?.[t]),
|
|
63
|
+
[M]
|
|
64
|
+
), y = K(null), p = K(null), [ft, P] = Ht(null);
|
|
64
65
|
U(() => {
|
|
65
66
|
if (f)
|
|
66
67
|
p.current !== null && (clearTimeout(p.current), p.current = null), y.current = f;
|
|
67
68
|
else if (y.current && v > 0) {
|
|
68
69
|
const t = y.current;
|
|
69
|
-
y.current = null,
|
|
70
|
-
p.current = null,
|
|
70
|
+
y.current = null, P(t), p.current = setTimeout(() => {
|
|
71
|
+
p.current = null, P(null);
|
|
71
72
|
}, v);
|
|
72
73
|
}
|
|
73
74
|
}, [f, v]);
|
|
74
|
-
const
|
|
75
|
-
() =>
|
|
76
|
-
[l, c,
|
|
77
|
-
), { allDayEvents:
|
|
75
|
+
const g = f ?? ft, $ = m(
|
|
76
|
+
() => vt({ startHour: l, endHour: c, intervalMinutes: C }),
|
|
77
|
+
[l, c, C]
|
|
78
|
+
), { allDayEvents: W, timedEvents: R } = m(() => {
|
|
78
79
|
const t = [], r = [];
|
|
79
|
-
for (const
|
|
80
|
-
|
|
80
|
+
for (const e of N)
|
|
81
|
+
e.allDay ? t.push(e) : r.push(e);
|
|
81
82
|
return { allDayEvents: t, timedEvents: r };
|
|
82
|
-
}, [
|
|
83
|
-
() =>
|
|
84
|
-
[
|
|
85
|
-
),
|
|
86
|
-
() =>
|
|
87
|
-
|
|
83
|
+
}, [N]), pt = m(
|
|
84
|
+
() => Ct(W, o),
|
|
85
|
+
[W, o]
|
|
86
|
+
), ht = m(
|
|
87
|
+
() => $t(
|
|
88
|
+
R,
|
|
89
|
+
n,
|
|
88
90
|
o,
|
|
89
|
-
e,
|
|
90
91
|
l,
|
|
91
92
|
c,
|
|
92
93
|
u
|
|
93
94
|
),
|
|
94
|
-
[
|
|
95
|
-
),
|
|
95
|
+
[R, n, o, l, c, u]
|
|
96
|
+
), x = m(
|
|
96
97
|
() => I ? S ?? [] : S,
|
|
97
98
|
[I, S]
|
|
98
|
-
),
|
|
99
|
-
if (
|
|
99
|
+
), yt = m(() => {
|
|
100
|
+
if (x === void 0 && !T)
|
|
100
101
|
return /* @__PURE__ */ new Map();
|
|
101
102
|
const t = /* @__PURE__ */ new Map();
|
|
102
|
-
for (const r of
|
|
103
|
-
const
|
|
104
|
-
|
|
103
|
+
for (const r of o) {
|
|
104
|
+
const e = xt(
|
|
105
|
+
x,
|
|
105
106
|
T,
|
|
106
|
-
|
|
107
|
+
n,
|
|
107
108
|
r,
|
|
108
109
|
l,
|
|
109
110
|
c,
|
|
110
111
|
u
|
|
111
112
|
);
|
|
112
|
-
|
|
113
|
+
e.length > 0 && t.set(r.toString(), e);
|
|
113
114
|
}
|
|
114
115
|
return t;
|
|
115
116
|
}, [
|
|
116
|
-
|
|
117
|
+
x,
|
|
117
118
|
T,
|
|
119
|
+
n,
|
|
118
120
|
o,
|
|
119
|
-
e,
|
|
120
121
|
l,
|
|
121
122
|
c,
|
|
122
123
|
u
|
|
123
|
-
]), { message:
|
|
124
|
+
]), { message: gt, announce: h } = Ot(), Dt = m(() => {
|
|
124
125
|
const t = q(d.startDate), r = q(d.endDate);
|
|
125
126
|
return `Schedule for ${t} to ${r}`;
|
|
126
|
-
}, [d.startDate, d.endDate]), V =
|
|
127
|
+
}, [d.startDate, d.endDate]), V = D(
|
|
127
128
|
(t) => {
|
|
128
|
-
if (s?.(null),
|
|
129
|
-
const r = [t
|
|
130
|
-
|
|
129
|
+
if (s?.(null), L?.(t), t.allDay) {
|
|
130
|
+
const r = [Q(t), "all day"], e = X(t);
|
|
131
|
+
e && r.push(e), h(`Selected: ${r.join(", ")}`);
|
|
131
132
|
} else {
|
|
132
133
|
const r = [
|
|
133
|
-
t
|
|
134
|
-
J(t.startTime, t.endTime,
|
|
135
|
-
];
|
|
136
|
-
|
|
134
|
+
Q(t),
|
|
135
|
+
J(t.startTime, t.endTime, n)
|
|
136
|
+
], e = X(t);
|
|
137
|
+
e && r.push(e), h(`Selected: ${r.join(", ")}`);
|
|
137
138
|
}
|
|
138
139
|
},
|
|
139
|
-
[s,
|
|
140
|
-
),
|
|
140
|
+
[s, L, n, h]
|
|
141
|
+
), St = D(
|
|
141
142
|
(t) => {
|
|
142
143
|
if (!t) {
|
|
143
144
|
s?.(null);
|
|
@@ -148,11 +149,11 @@ function rr({
|
|
|
148
149
|
endTime: t.endTime
|
|
149
150
|
};
|
|
150
151
|
s?.(r);
|
|
151
|
-
const
|
|
152
|
-
h(`Selected time: ${
|
|
152
|
+
const e = [J(t.startTime, t.endTime, n)];
|
|
153
|
+
h(`Selected time: ${e.join(", ")}`);
|
|
153
154
|
},
|
|
154
|
-
[s,
|
|
155
|
-
),
|
|
155
|
+
[s, n, h]
|
|
156
|
+
), Tt = D(
|
|
156
157
|
(t) => {
|
|
157
158
|
const r = E.PlainDate.from(t.columnId);
|
|
158
159
|
H?.({
|
|
@@ -170,68 +171,68 @@ function rr({
|
|
|
170
171
|
};
|
|
171
172
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
172
173
|
}, [f, s]);
|
|
173
|
-
const
|
|
174
|
-
return /* @__PURE__ */ F("div", { ref:
|
|
174
|
+
const wt = u * C / 60, z = o.find((t) => t.toString() === G);
|
|
175
|
+
return /* @__PURE__ */ F("div", { ref: ct, className: k(i("root"), _), children: [
|
|
175
176
|
/* @__PURE__ */ F(
|
|
176
177
|
"div",
|
|
177
178
|
{
|
|
178
|
-
ref:
|
|
179
|
+
ref: ut,
|
|
179
180
|
className: i("grid"),
|
|
180
181
|
role: "region",
|
|
181
182
|
"aria-roledescription": "calendar",
|
|
182
|
-
"aria-label":
|
|
183
|
+
"aria-label": Dt,
|
|
183
184
|
style: {
|
|
184
185
|
display: "grid",
|
|
185
|
-
gridTemplateColumns: `max-content repeat(${
|
|
186
|
-
gridTemplateRows: `auto auto repeat(${
|
|
186
|
+
gridTemplateColumns: `max-content repeat(${o.length}, minmax(${tt}px, 1fr))`,
|
|
187
|
+
gridTemplateRows: `auto auto repeat(${$.length}, ${wt}px)`
|
|
187
188
|
},
|
|
188
189
|
children: [
|
|
189
190
|
/* @__PURE__ */ a(
|
|
190
191
|
"div",
|
|
191
192
|
{
|
|
192
|
-
ref:
|
|
193
|
+
ref: mt,
|
|
193
194
|
className: i("cornerCell"),
|
|
194
195
|
style: { gridRow: 1, gridColumn: 1 },
|
|
195
|
-
children:
|
|
196
|
+
children: it?.({ timeZone: n })
|
|
196
197
|
}
|
|
197
198
|
),
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
o.map((t, r) => /* @__PURE__ */ a(
|
|
200
|
+
Nt,
|
|
200
201
|
{
|
|
201
202
|
date: t,
|
|
202
|
-
isToday: t.toString() ===
|
|
203
|
+
isToday: t.toString() === G,
|
|
203
204
|
column: r + 2,
|
|
204
205
|
cls: i,
|
|
205
|
-
renderHeader:
|
|
206
|
+
renderHeader: rt
|
|
206
207
|
},
|
|
207
208
|
t.toString()
|
|
208
209
|
)),
|
|
209
210
|
/* @__PURE__ */ a(
|
|
210
211
|
"div",
|
|
211
212
|
{
|
|
212
|
-
ref:
|
|
213
|
-
className:
|
|
213
|
+
ref: dt,
|
|
214
|
+
className: k(i("allDayCell"), "left-0 z-30"),
|
|
214
215
|
style: {
|
|
215
216
|
gridRow: 2,
|
|
216
217
|
gridColumn: 1,
|
|
217
|
-
top:
|
|
218
|
+
top: O
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
),
|
|
221
222
|
/* @__PURE__ */ a(
|
|
222
|
-
|
|
223
|
+
Bt,
|
|
223
224
|
{
|
|
224
|
-
positioned:
|
|
225
|
-
dates:
|
|
226
|
-
headerHeight:
|
|
225
|
+
positioned: pt,
|
|
226
|
+
dates: o,
|
|
227
|
+
headerHeight: O,
|
|
227
228
|
cls: i,
|
|
228
229
|
onEventClick: V,
|
|
229
|
-
selectedEventId:
|
|
230
|
-
selectedEventRef:
|
|
230
|
+
selectedEventId: A,
|
|
231
|
+
selectedEventRef: B
|
|
231
232
|
}
|
|
232
233
|
),
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
$.map((t) => /* @__PURE__ */ a(
|
|
235
|
+
Lt,
|
|
235
236
|
{
|
|
236
237
|
label: t.label,
|
|
237
238
|
row: t.index + 3,
|
|
@@ -241,97 +242,97 @@ function rr({
|
|
|
241
242
|
},
|
|
242
243
|
t.index
|
|
243
244
|
)),
|
|
244
|
-
|
|
245
|
-
(t) =>
|
|
245
|
+
$.map(
|
|
246
|
+
(t) => o.map((r, e) => /* @__PURE__ */ a(
|
|
246
247
|
"div",
|
|
247
248
|
{
|
|
248
249
|
className: i(t.isHourStart ? "bodyCell" : "bodyCellMinor"),
|
|
249
250
|
style: {
|
|
250
251
|
gridRow: t.index + 3,
|
|
251
|
-
gridColumn:
|
|
252
|
+
gridColumn: e + 2,
|
|
252
253
|
...t.isHourStart ? {} : { borderTopStyle: "dotted" },
|
|
253
254
|
...t.index === 0 ? { borderTopWidth: 0 } : {},
|
|
254
|
-
...
|
|
255
|
+
...e === o.length - 1 ? { borderRightWidth: 0 } : {}
|
|
255
256
|
}
|
|
256
257
|
},
|
|
257
258
|
`${t.index}-${r.toString()}`
|
|
258
259
|
))
|
|
259
260
|
),
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
return
|
|
263
|
-
|
|
261
|
+
o.map((t, r) => {
|
|
262
|
+
const e = yt.get(t.toString());
|
|
263
|
+
return e ? /* @__PURE__ */ a(
|
|
264
|
+
Et,
|
|
264
265
|
{
|
|
265
|
-
blocks:
|
|
266
|
+
blocks: e,
|
|
266
267
|
column: r + 2,
|
|
267
268
|
cls: i
|
|
268
269
|
},
|
|
269
270
|
`unavail-${t.toString()}`
|
|
270
271
|
) : null;
|
|
271
272
|
}),
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
j != null && o.map((t, r) => /* @__PURE__ */ a(
|
|
274
|
+
jt,
|
|
274
275
|
{
|
|
275
276
|
columnId: t.toString(),
|
|
276
277
|
column: r + 2,
|
|
277
278
|
date: t,
|
|
278
|
-
timeZone:
|
|
279
|
+
timeZone: n,
|
|
279
280
|
startHour: l,
|
|
280
281
|
endHour: c,
|
|
281
282
|
hourHeight: u,
|
|
282
|
-
snapDuration:
|
|
283
|
-
placeholderDuration:
|
|
283
|
+
snapDuration: j,
|
|
284
|
+
placeholderDuration: Y ?? 15,
|
|
284
285
|
cls: i,
|
|
285
|
-
onSlotClick: H ?
|
|
286
|
-
onSelect: s ?
|
|
287
|
-
dragPreviewAppearance:
|
|
286
|
+
onSlotClick: H ? Tt : void 0,
|
|
287
|
+
onSelect: s ? St : void 0,
|
|
288
|
+
dragPreviewAppearance: ot,
|
|
288
289
|
renderEvent: b
|
|
289
290
|
},
|
|
290
291
|
`slot-${t.toString()}`
|
|
291
292
|
)),
|
|
292
|
-
|
|
293
|
-
|
|
293
|
+
o.map((t, r) => /* @__PURE__ */ a(
|
|
294
|
+
It,
|
|
294
295
|
{
|
|
295
|
-
positionedEvents:
|
|
296
|
+
positionedEvents: ht.get(t.toString()) ?? [],
|
|
296
297
|
column: r + 2,
|
|
297
|
-
timeZone:
|
|
298
|
+
timeZone: n,
|
|
298
299
|
cls: i,
|
|
299
300
|
onEventClick: V,
|
|
300
301
|
renderEvent: b,
|
|
301
|
-
eventGap:
|
|
302
|
-
eventLayout:
|
|
303
|
-
stackOffset:
|
|
304
|
-
selectedEventId:
|
|
305
|
-
selectedEventRef:
|
|
302
|
+
eventGap: at,
|
|
303
|
+
eventLayout: lt,
|
|
304
|
+
stackOffset: st,
|
|
305
|
+
selectedEventId: A,
|
|
306
|
+
selectedEventRef: B
|
|
306
307
|
},
|
|
307
308
|
t.toString()
|
|
308
309
|
)),
|
|
309
|
-
|
|
310
|
-
const t =
|
|
311
|
-
(
|
|
310
|
+
g != null && (() => {
|
|
311
|
+
const t = g.startTime.withTimeZone(n).toPlainDate(), r = o.findIndex(
|
|
312
|
+
(e) => E.PlainDate.compare(e, t) === 0
|
|
312
313
|
);
|
|
313
314
|
return r === -1 ? null : /* @__PURE__ */ a(
|
|
314
|
-
|
|
315
|
+
Mt,
|
|
315
316
|
{
|
|
316
|
-
startTime:
|
|
317
|
-
endTime:
|
|
317
|
+
startTime: g.startTime,
|
|
318
|
+
endTime: g.endTime,
|
|
318
319
|
column: r + 2,
|
|
319
|
-
viewDate:
|
|
320
|
-
timeZone:
|
|
320
|
+
viewDate: o[r],
|
|
321
|
+
timeZone: n,
|
|
321
322
|
startHour: l,
|
|
322
323
|
hourHeight: u,
|
|
323
324
|
cls: i,
|
|
324
|
-
appearance:
|
|
325
|
-
selectionRef:
|
|
325
|
+
appearance: et,
|
|
326
|
+
selectionRef: nt,
|
|
326
327
|
renderEvent: b
|
|
327
328
|
}
|
|
328
329
|
);
|
|
329
330
|
})(),
|
|
330
331
|
z && /* @__PURE__ */ a(
|
|
331
|
-
|
|
332
|
+
At,
|
|
332
333
|
{
|
|
333
334
|
date: z,
|
|
334
|
-
timeZone:
|
|
335
|
+
timeZone: n,
|
|
335
336
|
startHour: l,
|
|
336
337
|
endHour: c,
|
|
337
338
|
hourHeight: u,
|
|
@@ -358,11 +359,11 @@ function rr({
|
|
|
358
359
|
whiteSpace: "nowrap",
|
|
359
360
|
borderWidth: 0
|
|
360
361
|
},
|
|
361
|
-
children:
|
|
362
|
+
children: gt
|
|
362
363
|
}
|
|
363
364
|
)
|
|
364
365
|
] });
|
|
365
366
|
}
|
|
366
367
|
export {
|
|
367
|
-
|
|
368
|
+
nr as DayGridView
|
|
368
369
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceGridView.d.ts","sourceRoot":"","sources":["../../../src/components/resource-grid-view/ResourceGridView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAIV,qBAAqB,EAGtB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ResourceGridView.d.ts","sourceRoot":"","sources":["../../../src/components/resource-grid-view/ResourceGridView.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAIV,qBAAqB,EAGtB,MAAM,kBAAkB,CAAC;AAc1B,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,MAAM,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAe,EACf,cAAoB,EACpB,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,iBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,WAAuB,EACvB,WAAe,GAChB,EAAE,qBAAqB,2CA+avB"}
|