react-native-ll-calendar 0.16.0 → 0.17.1
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 +101 -12
- package/lib/module/calendar/week-resources-calendar/WeekPanel.js +428 -0
- package/lib/module/calendar/week-resources-calendar/WeekPanel.js.map +1 -0
- package/lib/module/calendar/week-resources-calendar/WeekResourcesCalendar.js +119 -0
- package/lib/module/calendar/week-resources-calendar/WeekResourcesCalendar.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/calendar/week-resources-calendar/WeekPanel.d.ts +33 -0
- package/lib/typescript/src/calendar/week-resources-calendar/WeekPanel.d.ts.map +1 -0
- package/lib/typescript/src/calendar/week-resources-calendar/WeekResourcesCalendar.d.ts +39 -0
- package/lib/typescript/src/calendar/week-resources-calendar/WeekResourcesCalendar.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/calendar/week-resources-calendar/WeekPanel.tsx +590 -0
- package/src/calendar/week-resources-calendar/WeekResourcesCalendar.tsx +174 -0
- package/src/index.tsx +2 -0
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# react-native-ll-calendar
|
|
2
2
|
|
|
3
|
-
A horizontally scrollable
|
|
3
|
+
A collection of horizontally scrollable calendar components for React Native with event support.
|
|
4
|
+
|
|
5
|
+
- **MonthCalendar** — month view, swipe left/right to change months
|
|
6
|
+
- **ResourcesCalendar** — resource × date grid, horizontal scroll across a date range
|
|
7
|
+
- **WeekResourcesCalendar** — resource × date grid, swipe left/right to change weeks
|
|
4
8
|
|
|
5
9
|
<img src="assets/screen-shot.png" width="320px">
|
|
6
10
|
|
|
@@ -138,26 +142,111 @@ You can access these methods by passing a `ref` to the `MonthCalendar` component
|
|
|
138
142
|
| `borderWidth` | `number` | No | Border width |
|
|
139
143
|
| `borderRadius` | `number` | No | Border radius |
|
|
140
144
|
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### ResourcesCalendar Props
|
|
148
|
+
|
|
149
|
+
| Prop | Type | Required | Default | Description |
|
|
150
|
+
| --- | --- | --- | --- | --- |
|
|
151
|
+
| `fromDate` | `Date` | Yes | - | Start of the displayed date range |
|
|
152
|
+
| `toDate` | `Date` | Yes | - | End of the displayed date range |
|
|
153
|
+
| `resources` | `CalendarResource[]` | Yes | - | List of resources (rows) |
|
|
154
|
+
| `events` | `ResourcesCalendarEvent[]` | Yes | - | Array of resource events |
|
|
155
|
+
| `renderDateLabel` | `(date: Date) => JSX.Element` | No | - | Custom header date cell content |
|
|
156
|
+
| `renderMonthLabel` | `(year: number, month: number) => JSX.Element` | No | - | Custom month label content |
|
|
157
|
+
| `renderResourceNameLabel` | `(resource: CalendarResource) => JSX.Element` | No | - | Custom resource name cell content |
|
|
158
|
+
| `resourceColumnWidth` | `number` | No | `80` | Width of the resource name column |
|
|
159
|
+
| `dateColumnWidth` | `number` | No | `60` | Width of each date column |
|
|
160
|
+
| `onRefresh` | `() => void` | No | - | Callback for pull-to-refresh |
|
|
161
|
+
| `refreshing` | `boolean` | No | - | Whether the calendar is refreshing |
|
|
162
|
+
| `fixedRowCount` | `number` | No | `0` | Number of resource rows pinned above the scroll area |
|
|
163
|
+
| `onPressCell` | `(resource: CalendarResource, date: Date) => void` | No | - | Callback when a cell is pressed |
|
|
164
|
+
| `onLongPressCell` | `(resource: CalendarResource, date: Date) => void` | No | - | Callback when a cell is long pressed |
|
|
165
|
+
| `delayLongPressCell` | `number` | No | - | Delay in ms before long press is triggered |
|
|
166
|
+
| `onPressEvent` | `(event: ResourcesCalendarEvent) => void` | No | - | Callback when an event is pressed |
|
|
167
|
+
| `onLongPressEvent` | `(event: ResourcesCalendarEvent) => void` | No | - | Callback when an event is long pressed |
|
|
168
|
+
| `delayLongPressEvent` | `number` | No | - | Delay in ms before long press is triggered |
|
|
169
|
+
| `eventHeight` | `number` | No | `22` | Height of event items in pixels |
|
|
170
|
+
| `bottomSpacing` | `number` | No | - | Bottom spacing in pixels for scrollable content |
|
|
171
|
+
| `eventTextStyle` | `(event: ResourcesCalendarEvent) => TextStyle` | No | - | Style function for event text |
|
|
172
|
+
| `eventEllipsizeMode` | `'head' \| 'middle' \| 'tail' \| 'clip'` | No | `'tail'` | Ellipsize mode for event text |
|
|
173
|
+
| `renderEventOverlay` | `(event: ResourcesCalendarEvent) => ReactNode` | No | - | Optional overlay above each event |
|
|
174
|
+
| `dateCellContainerStyle` | `(date: Date) => ViewStyle` | No | - | Style for header date cells |
|
|
175
|
+
| `cellContainerStyle` | `(resource: CalendarResource, date: Date) => ViewStyle` | No | - | Style for resource day cell background |
|
|
176
|
+
| `hiddenMonth` | `boolean` | No | `false` | Hide the month header row |
|
|
177
|
+
| `allowFontScaling` | `boolean` | No | - | Enable font scaling for text elements |
|
|
178
|
+
| `resourceNameLayout` | `'fixed-column' \| 'inline-band'` | No | `'fixed-column'` | Layout mode for the resource name |
|
|
179
|
+
| `prioritizeCellInteraction` | `boolean` | No | `false` | Overlay to prioritize cell taps over events |
|
|
180
|
+
|
|
181
|
+
### CalendarResource
|
|
182
|
+
|
|
183
|
+
| Property | Type | Required | Description |
|
|
184
|
+
| --- | --- | --- | --- |
|
|
185
|
+
| `id` | `string` | Yes | Unique identifier |
|
|
186
|
+
| `name` | `string` | Yes | Display name |
|
|
187
|
+
|
|
188
|
+
### ResourcesCalendarEvent
|
|
189
|
+
|
|
190
|
+
Same fields as `CalendarEvent` with the addition of:
|
|
191
|
+
|
|
192
|
+
| Property | Type | Required | Description |
|
|
193
|
+
| --- | --- | --- | --- |
|
|
194
|
+
| `resourceId` | `string` | Yes | ID of the resource this event belongs to |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### WeekResourcesCalendar Props
|
|
199
|
+
|
|
200
|
+
| Prop | Type | Required | Default | Description |
|
|
201
|
+
| --- | --- | --- | --- | --- |
|
|
202
|
+
| `defaultDate` | `Date` | Yes | - | Initial date to display |
|
|
203
|
+
| `weekStartsOn` | `0 \| 1` | No | `0` | Week start day (0 = Sunday, 1 = Monday) |
|
|
204
|
+
| `onChangeDate` | `(date: Date) => void` | No | - | Callback when the displayed week changes |
|
|
205
|
+
| `resources` | `CalendarResource[]` | Yes | - | List of resources (rows) |
|
|
206
|
+
| `events` | `ResourcesCalendarEvent[]` | Yes | - | Array of resource events |
|
|
207
|
+
| `eventHeight` | `number` | No | `22` | Height of event items in pixels |
|
|
208
|
+
| `onPressCell` | `(resource: CalendarResource, date: Date) => void` | No | - | Callback when a cell is pressed |
|
|
209
|
+
| `onLongPressCell` | `(resource: CalendarResource, date: Date) => void` | No | - | Callback when a cell is long pressed |
|
|
210
|
+
| `delayLongPressCell` | `number` | No | - | Delay in ms before long press is triggered |
|
|
211
|
+
| `onPressEvent` | `(event: ResourcesCalendarEvent) => void` | No | - | Callback when an event is pressed |
|
|
212
|
+
| `onLongPressEvent` | `(event: ResourcesCalendarEvent) => void` | No | - | Callback when an event is long pressed |
|
|
213
|
+
| `delayLongPressEvent` | `number` | No | - | Delay in ms before long press is triggered |
|
|
214
|
+
| `prioritizeCellInteraction` | `boolean` | No | `false` | Overlay to prioritize cell taps over events |
|
|
215
|
+
| `eventTextStyle` | `(event: ResourcesCalendarEvent) => TextStyle` | No | - | Style function for event text |
|
|
216
|
+
| `eventEllipsizeMode` | `'head' \| 'middle' \| 'tail' \| 'clip'` | No | `'tail'` | Ellipsize mode for event text |
|
|
217
|
+
| `allowFontScaling` | `boolean` | No | - | Enable font scaling for text elements |
|
|
218
|
+
| `renderEventOverlay` | `(event: ResourcesCalendarEvent) => ReactNode` | No | - | Optional overlay above each event |
|
|
219
|
+
| `dateCellContainerStyle` | `(date: Date) => ViewStyle` | No | - | Style for header date cells |
|
|
220
|
+
| `cellContainerStyle` | `(resource: CalendarResource, date: Date) => ViewStyle` | No | - | Style for resource day cell background |
|
|
221
|
+
| `renderDateLabel` | `(date: Date) => JSX.Element` | No | - | Custom header date cell content |
|
|
222
|
+
| `renderResourceNameLabel` | `(resource: CalendarResource) => JSX.Element` | No | - | Custom resource name cell content |
|
|
223
|
+
| `onRefresh` | `() => void` | No | - | Callback for pull-to-refresh |
|
|
224
|
+
| `refreshing` | `boolean` | No | - | Whether the calendar is refreshing |
|
|
225
|
+
| `bottomSpacing` | `number` | No | - | Bottom spacing in pixels for scrollable content |
|
|
226
|
+
| `fixedRowCount` | `number` | No | `0` | Number of resource rows pinned above the scroll area |
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
141
230
|
## Features
|
|
142
231
|
|
|
143
|
-
- Horizontally scrollable month view
|
|
144
|
-
-
|
|
232
|
+
- Horizontally scrollable month view (±10 years)
|
|
233
|
+
- Horizontally scrollable week resource view (±120 weeks)
|
|
234
|
+
- Resource × date grid view across a custom date range
|
|
235
|
+
- Multi-day event support with overlap stacking
|
|
145
236
|
- Customizable event colors and border styles
|
|
146
237
|
- Event press handlers (tap and long press)
|
|
147
|
-
-
|
|
238
|
+
- Cell press handlers (tap and long press)
|
|
239
|
+
- `prioritizeCellInteraction` to route taps to cells over events
|
|
148
240
|
- Configurable week start day (Sunday or Monday)
|
|
149
|
-
- Customizable styling for day cells, weekday cells, and today's cell
|
|
150
241
|
- Pull-to-refresh support
|
|
242
|
+
- Fixed row pinning for resource calendars
|
|
243
|
+
- Custom render props for date labels, month labels, and resource names
|
|
244
|
+
- Event overlay support (e.g. badge counts)
|
|
151
245
|
- Locale support for internationalization
|
|
152
|
-
- Optional month header visibility control
|
|
153
|
-
- Custom month format display
|
|
154
|
-
- Sticky header support for month and week rows
|
|
155
|
-
- Customizable cell border colors
|
|
156
246
|
- Font scaling control for text elements
|
|
157
247
|
- Customizable event height and text styles
|
|
158
|
-
-
|
|
159
|
-
- **
|
|
160
|
-
- **Dynamic row height retrieval via Ref**
|
|
248
|
+
- **Programmatic scroll control via Ref** (MonthCalendar)
|
|
249
|
+
- **Dynamic row height retrieval via Ref** (MonthCalendar)
|
|
161
250
|
|
|
162
251
|
## License
|
|
163
252
|
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { memo, useMemo } from 'react';
|
|
4
|
+
import { FlatList, Platform, RefreshControl, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import ResourcesCalendarEventPosition from "../../utils/resources-calendar-event-position.js";
|
|
7
|
+
import { EVENT_GAP } from "../../constants/size.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
export const CELL_BORDER_WIDTH = 0.5;
|
|
10
|
+
export const BORDER_COLOR = 'lightslategrey';
|
|
11
|
+
const DEFAULT_EVENT_HEIGHT = 22;
|
|
12
|
+
const DayCell = /*#__PURE__*/memo(function DayCell({
|
|
13
|
+
resource,
|
|
14
|
+
date,
|
|
15
|
+
dateIndex,
|
|
16
|
+
columnWidth,
|
|
17
|
+
eventHeight,
|
|
18
|
+
cellEvents,
|
|
19
|
+
onPressCell,
|
|
20
|
+
onLongPressCell,
|
|
21
|
+
delayLongPressCell,
|
|
22
|
+
onPressEvent,
|
|
23
|
+
onLongPressEvent,
|
|
24
|
+
delayLongPressEvent,
|
|
25
|
+
prioritizeCellInteraction,
|
|
26
|
+
eventTextStyle,
|
|
27
|
+
eventEllipsizeMode,
|
|
28
|
+
allowFontScaling,
|
|
29
|
+
renderEventOverlay,
|
|
30
|
+
cellContainerStyle
|
|
31
|
+
}) {
|
|
32
|
+
const showPrioritizedCellOverlay = prioritizeCellInteraction === true && (onPressCell != null || onLongPressCell != null);
|
|
33
|
+
const cellWrapperStyle = [styles.dayCell, {
|
|
34
|
+
width: columnWidth,
|
|
35
|
+
zIndex: 7 - dateIndex
|
|
36
|
+
}];
|
|
37
|
+
const cellInner = /*#__PURE__*/_jsxs(_Fragment, {
|
|
38
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
39
|
+
style: [styles.dayCellBackground, cellContainerStyle?.(resource, date.toDate())]
|
|
40
|
+
}), cellEvents.map((event, rowIndex) => {
|
|
41
|
+
if (typeof event === 'number') {
|
|
42
|
+
return /*#__PURE__*/_jsx(View, {
|
|
43
|
+
style: {
|
|
44
|
+
height: eventHeight,
|
|
45
|
+
marginBottom: EVENT_GAP
|
|
46
|
+
}
|
|
47
|
+
}, `spacer-${rowIndex}`);
|
|
48
|
+
}
|
|
49
|
+
const rawStartDjs = dayjs(event.start);
|
|
50
|
+
const startDjs = dateIndex === 0 ? date : rawStartDjs;
|
|
51
|
+
const endDjs = dayjs(event.end);
|
|
52
|
+
const diffDays = endDjs.startOf('day').diff(startDjs.startOf('day'), 'day');
|
|
53
|
+
const isPrevDateEvent = dateIndex === 0 && rawStartDjs.isBefore(date);
|
|
54
|
+
const remainingDaysInWeek = 6 - dateIndex;
|
|
55
|
+
const isNextWeekEvent = diffDays > remainingDaysInWeek;
|
|
56
|
+
const effectiveDiffDays = isNextWeekEvent ? remainingDaysInWeek : diffDays;
|
|
57
|
+
let width = (effectiveDiffDays + 1) * columnWidth - EVENT_GAP * 2 - CELL_BORDER_WIDTH * 2;
|
|
58
|
+
if (isPrevDateEvent) {
|
|
59
|
+
width += EVENT_GAP + 1;
|
|
60
|
+
}
|
|
61
|
+
if (isNextWeekEvent) {
|
|
62
|
+
width += EVENT_GAP + CELL_BORDER_WIDTH;
|
|
63
|
+
}
|
|
64
|
+
const eventOverlayNode = renderEventOverlay?.(event);
|
|
65
|
+
const showEventOverlay = renderEventOverlay != null && eventOverlayNode != null && eventOverlayNode !== false;
|
|
66
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
67
|
+
pointerEvents: showPrioritizedCellOverlay ? 'none' : 'auto',
|
|
68
|
+
style: [styles.eventOuter, {
|
|
69
|
+
width,
|
|
70
|
+
height: eventHeight
|
|
71
|
+
}, isPrevDateEvent && styles.prevDateEvent],
|
|
72
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
73
|
+
style: [styles.event, {
|
|
74
|
+
backgroundColor: event.backgroundColor,
|
|
75
|
+
borderColor: event.borderColor,
|
|
76
|
+
...(event.borderStyle !== undefined && {
|
|
77
|
+
borderStyle: event.borderStyle
|
|
78
|
+
}),
|
|
79
|
+
...(event.borderWidth !== undefined && {
|
|
80
|
+
borderWidth: event.borderWidth
|
|
81
|
+
}),
|
|
82
|
+
...(event.borderRadius !== undefined && {
|
|
83
|
+
borderRadius: event.borderRadius
|
|
84
|
+
})
|
|
85
|
+
}, isPrevDateEvent && styles.prevDateEventInner, isNextWeekEvent && styles.nextWeekEventInner],
|
|
86
|
+
activeOpacity: 0.8,
|
|
87
|
+
onPress: () => onPressEvent?.(event),
|
|
88
|
+
onLongPress: () => onLongPressEvent?.(event),
|
|
89
|
+
delayLongPress: delayLongPressEvent,
|
|
90
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
91
|
+
numberOfLines: 1,
|
|
92
|
+
ellipsizeMode: eventEllipsizeMode ?? 'tail',
|
|
93
|
+
allowFontScaling: allowFontScaling,
|
|
94
|
+
style: [styles.eventTitle, {
|
|
95
|
+
color: event.color
|
|
96
|
+
}, eventTextStyle?.(event)],
|
|
97
|
+
children: event.title
|
|
98
|
+
})
|
|
99
|
+
}), showEventOverlay ? /*#__PURE__*/_jsx(View, {
|
|
100
|
+
style: styles.eventOverlayHost,
|
|
101
|
+
pointerEvents: "box-none",
|
|
102
|
+
children: eventOverlayNode
|
|
103
|
+
}) : null]
|
|
104
|
+
}, event.id);
|
|
105
|
+
})]
|
|
106
|
+
});
|
|
107
|
+
return showPrioritizedCellOverlay ? /*#__PURE__*/_jsxs(View, {
|
|
108
|
+
style: cellWrapperStyle,
|
|
109
|
+
children: [cellInner, /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
110
|
+
accessible: false,
|
|
111
|
+
style: styles.cellInteractionOverlay,
|
|
112
|
+
activeOpacity: 1,
|
|
113
|
+
onPress: () => onPressCell?.(resource, date.toDate()),
|
|
114
|
+
onLongPress: () => onLongPressCell?.(resource, date.toDate()),
|
|
115
|
+
delayLongPress: delayLongPressCell
|
|
116
|
+
})]
|
|
117
|
+
}) : /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
118
|
+
activeOpacity: 1,
|
|
119
|
+
style: cellWrapperStyle,
|
|
120
|
+
onPress: () => onPressCell?.(resource, date.toDate()),
|
|
121
|
+
onLongPress: () => onLongPressCell?.(resource, date.toDate()),
|
|
122
|
+
delayLongPress: delayLongPressCell,
|
|
123
|
+
children: cellInner
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
export function WeekPanel({
|
|
127
|
+
weekKey,
|
|
128
|
+
width,
|
|
129
|
+
resources,
|
|
130
|
+
events,
|
|
131
|
+
eventHeight,
|
|
132
|
+
onPressCell,
|
|
133
|
+
onLongPressCell,
|
|
134
|
+
delayLongPressCell,
|
|
135
|
+
onPressEvent,
|
|
136
|
+
onLongPressEvent,
|
|
137
|
+
delayLongPressEvent,
|
|
138
|
+
prioritizeCellInteraction,
|
|
139
|
+
eventTextStyle,
|
|
140
|
+
eventEllipsizeMode,
|
|
141
|
+
allowFontScaling,
|
|
142
|
+
renderEventOverlay,
|
|
143
|
+
dateCellContainerStyle,
|
|
144
|
+
cellContainerStyle,
|
|
145
|
+
renderDateLabel,
|
|
146
|
+
renderResourceNameLabel,
|
|
147
|
+
onRefresh,
|
|
148
|
+
refreshing,
|
|
149
|
+
bottomSpacing,
|
|
150
|
+
fixedRowCount
|
|
151
|
+
}) {
|
|
152
|
+
const columnWidth = width / 8;
|
|
153
|
+
const resolvedEventHeight = eventHeight ?? DEFAULT_EVENT_HEIGHT;
|
|
154
|
+
const resolvedFixedRowCount = fixedRowCount ?? 0;
|
|
155
|
+
const days = useMemo(() => {
|
|
156
|
+
const start = dayjs(weekKey);
|
|
157
|
+
return Array.from({
|
|
158
|
+
length: 7
|
|
159
|
+
}, (_, i) => start.add(i, 'day'));
|
|
160
|
+
}, [weekKey]);
|
|
161
|
+
const eventsByResourceId = useMemo(() => {
|
|
162
|
+
const deduped = new Map();
|
|
163
|
+
for (const event of events) {
|
|
164
|
+
deduped.set(event.id, event);
|
|
165
|
+
}
|
|
166
|
+
const map = new Map();
|
|
167
|
+
for (const event of deduped.values()) {
|
|
168
|
+
const list = map.get(event.resourceId) ?? [];
|
|
169
|
+
list.push(event);
|
|
170
|
+
map.set(event.resourceId, list);
|
|
171
|
+
}
|
|
172
|
+
return map;
|
|
173
|
+
}, [events]);
|
|
174
|
+
const cellDataMap = useMemo(() => {
|
|
175
|
+
const ep = new ResourcesCalendarEventPosition();
|
|
176
|
+
const map = new Map();
|
|
177
|
+
for (const resource of resources) {
|
|
178
|
+
for (let dateIndex = 0; dateIndex < days.length; dateIndex++) {
|
|
179
|
+
const date = days[dateIndex];
|
|
180
|
+
const resourceEvents = eventsByResourceId.get(resource.id) ?? [];
|
|
181
|
+
const filteredEvents = resourceEvents.filter(event => {
|
|
182
|
+
const startDjs = dayjs(event.start);
|
|
183
|
+
const endDjs = dayjs(event.end);
|
|
184
|
+
return startDjs.format('YYYY-MM-DD') === date.format('YYYY-MM-DD') || dateIndex === 0 && startDjs.isBefore(date) && !endDjs.startOf('day').isBefore(date.startOf('day'));
|
|
185
|
+
}).sort((a, b) => {
|
|
186
|
+
const aStartDjs = dateIndex === 0 ? date : dayjs(a.start);
|
|
187
|
+
const bStartDjs = dateIndex === 0 ? date : dayjs(b.start);
|
|
188
|
+
const aDiffDays = dayjs(a.end).startOf('day').diff(aStartDjs.startOf('day'), 'day');
|
|
189
|
+
const bDiffDays = dayjs(b.end).startOf('day').diff(bStartDjs.startOf('day'), 'day');
|
|
190
|
+
if (aDiffDays !== bDiffDays) return bDiffDays - aDiffDays;
|
|
191
|
+
return dayjs(a.start).diff(dayjs(b.start));
|
|
192
|
+
});
|
|
193
|
+
const rowNums = ep.getRowNums({
|
|
194
|
+
resourceId: resource.id,
|
|
195
|
+
date: date.toDate()
|
|
196
|
+
});
|
|
197
|
+
const cellEvents = [];
|
|
198
|
+
const rowsLength = rowNums.length + filteredEvents.length;
|
|
199
|
+
let eventIndex = 0;
|
|
200
|
+
for (let ii = 1; ii <= rowsLength; ii++) {
|
|
201
|
+
if (rowNums.includes(ii)) {
|
|
202
|
+
cellEvents.push(ii);
|
|
203
|
+
} else {
|
|
204
|
+
const event = filteredEvents[eventIndex];
|
|
205
|
+
if (event) cellEvents.push(event);
|
|
206
|
+
eventIndex++;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
for (let rowIndex = 0; rowIndex < cellEvents.length; rowIndex++) {
|
|
210
|
+
const item = cellEvents[rowIndex];
|
|
211
|
+
if (item !== undefined && typeof item !== 'number') {
|
|
212
|
+
const rawStartDjs = dayjs(item.start);
|
|
213
|
+
const startDjs = dateIndex === 0 ? date : rawStartDjs;
|
|
214
|
+
const endDjs = dayjs(item.end);
|
|
215
|
+
const diffDays = endDjs.startOf('day').diff(startDjs.startOf('day'), 'day');
|
|
216
|
+
const remainingDaysInWeek = 6 - dateIndex;
|
|
217
|
+
const isNextWeekEvent = diffDays > remainingDaysInWeek;
|
|
218
|
+
const effectiveDiffDays = isNextWeekEvent ? remainingDaysInWeek : diffDays;
|
|
219
|
+
ep.push({
|
|
220
|
+
resourceId: resource.id,
|
|
221
|
+
startDate: startDjs.toDate(),
|
|
222
|
+
days: effectiveDiffDays + 1,
|
|
223
|
+
rowNum: rowIndex + 1
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
map.set(`${resource.id}-${date.format('YYYY-MM-DD')}`, cellEvents);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return map;
|
|
231
|
+
}, [resources, days, eventsByResourceId]);
|
|
232
|
+
const fixedResources = useMemo(() => resources.slice(0, resolvedFixedRowCount), [resources, resolvedFixedRowCount]);
|
|
233
|
+
const scrollableResources = useMemo(() => resources.slice(resolvedFixedRowCount), [resources, resolvedFixedRowCount]);
|
|
234
|
+
const renderResourceRow = (resource, showTopBorder) => /*#__PURE__*/_jsxs(View, {
|
|
235
|
+
style: [styles.resourceRow, showTopBorder && styles.resourceRowFirst],
|
|
236
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
237
|
+
style: [styles.resourceNameCell, {
|
|
238
|
+
width: columnWidth
|
|
239
|
+
}],
|
|
240
|
+
children: renderResourceNameLabel ? renderResourceNameLabel(resource) : /*#__PURE__*/_jsx(Text, {
|
|
241
|
+
style: styles.resourceNameText,
|
|
242
|
+
numberOfLines: 2,
|
|
243
|
+
allowFontScaling: allowFontScaling,
|
|
244
|
+
children: resource.name
|
|
245
|
+
})
|
|
246
|
+
}), days.map((day, dateIndex) => /*#__PURE__*/_jsx(DayCell, {
|
|
247
|
+
resource: resource,
|
|
248
|
+
date: day,
|
|
249
|
+
dateIndex: dateIndex,
|
|
250
|
+
columnWidth: columnWidth,
|
|
251
|
+
eventHeight: resolvedEventHeight,
|
|
252
|
+
cellEvents: cellDataMap.get(`${resource.id}-${day.format('YYYY-MM-DD')}`) ?? [],
|
|
253
|
+
onPressCell: onPressCell,
|
|
254
|
+
onLongPressCell: onLongPressCell,
|
|
255
|
+
delayLongPressCell: delayLongPressCell,
|
|
256
|
+
onPressEvent: onPressEvent,
|
|
257
|
+
onLongPressEvent: onLongPressEvent,
|
|
258
|
+
delayLongPressEvent: delayLongPressEvent,
|
|
259
|
+
prioritizeCellInteraction: prioritizeCellInteraction,
|
|
260
|
+
eventTextStyle: eventTextStyle,
|
|
261
|
+
eventEllipsizeMode: eventEllipsizeMode,
|
|
262
|
+
allowFontScaling: allowFontScaling,
|
|
263
|
+
renderEventOverlay: renderEventOverlay,
|
|
264
|
+
cellContainerStyle: cellContainerStyle
|
|
265
|
+
}, day.format('YYYY-MM-DD')))]
|
|
266
|
+
}, resource.id);
|
|
267
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
268
|
+
style: [styles.panel, {
|
|
269
|
+
width
|
|
270
|
+
}],
|
|
271
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
272
|
+
style: styles.headerRow,
|
|
273
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
274
|
+
style: [styles.headerCell, styles.resourceNameHeaderCell, {
|
|
275
|
+
width: columnWidth
|
|
276
|
+
}]
|
|
277
|
+
}), days.map(day => /*#__PURE__*/_jsx(View, {
|
|
278
|
+
style: [styles.headerCell, {
|
|
279
|
+
width: columnWidth
|
|
280
|
+
}, dateCellContainerStyle?.(day.toDate())],
|
|
281
|
+
children: renderDateLabel ? renderDateLabel(day.toDate()) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
282
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
283
|
+
style: styles.headerDayOfWeekText,
|
|
284
|
+
children: day.format('ddd')
|
|
285
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
286
|
+
style: styles.headerDateText,
|
|
287
|
+
children: day.format('M/D')
|
|
288
|
+
})]
|
|
289
|
+
})
|
|
290
|
+
}, day.format('YYYY-MM-DD')))]
|
|
291
|
+
}), fixedResources.map((resource, index) => renderResourceRow(resource, index === 0)), /*#__PURE__*/_jsx(FlatList, {
|
|
292
|
+
data: scrollableResources,
|
|
293
|
+
keyExtractor: item => item.id,
|
|
294
|
+
renderItem: ({
|
|
295
|
+
item,
|
|
296
|
+
index
|
|
297
|
+
}) => renderResourceRow(item, fixedResources.length === 0 && index === 0),
|
|
298
|
+
showsVerticalScrollIndicator: false,
|
|
299
|
+
nestedScrollEnabled: true,
|
|
300
|
+
refreshControl: /*#__PURE__*/_jsx(RefreshControl, {
|
|
301
|
+
refreshing: refreshing ?? false,
|
|
302
|
+
onRefresh: onRefresh
|
|
303
|
+
}),
|
|
304
|
+
ListFooterComponent: /*#__PURE__*/_jsx(View, {
|
|
305
|
+
style: {
|
|
306
|
+
height: bottomSpacing
|
|
307
|
+
}
|
|
308
|
+
}),
|
|
309
|
+
removeClippedSubviews: false
|
|
310
|
+
})]
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
const styles = StyleSheet.create({
|
|
314
|
+
panel: {
|
|
315
|
+
flex: 1,
|
|
316
|
+
overflow: 'hidden'
|
|
317
|
+
},
|
|
318
|
+
headerRow: {
|
|
319
|
+
flexDirection: 'row',
|
|
320
|
+
backgroundColor: 'white',
|
|
321
|
+
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
322
|
+
borderBottomColor: BORDER_COLOR
|
|
323
|
+
},
|
|
324
|
+
headerCell: {
|
|
325
|
+
alignItems: 'center',
|
|
326
|
+
justifyContent: 'center',
|
|
327
|
+
paddingVertical: 6,
|
|
328
|
+
borderRightWidth: CELL_BORDER_WIDTH,
|
|
329
|
+
borderRightColor: BORDER_COLOR
|
|
330
|
+
},
|
|
331
|
+
resourceNameHeaderCell: {
|
|
332
|
+
borderRightWidth: CELL_BORDER_WIDTH,
|
|
333
|
+
borderRightColor: BORDER_COLOR
|
|
334
|
+
},
|
|
335
|
+
headerDayOfWeekText: {
|
|
336
|
+
fontSize: 11,
|
|
337
|
+
color: '#666'
|
|
338
|
+
},
|
|
339
|
+
headerDateText: {
|
|
340
|
+
fontSize: 13,
|
|
341
|
+
fontWeight: '600',
|
|
342
|
+
color: '#222'
|
|
343
|
+
},
|
|
344
|
+
resourceRow: {
|
|
345
|
+
flexDirection: 'row',
|
|
346
|
+
minHeight: 30,
|
|
347
|
+
borderBottomWidth: CELL_BORDER_WIDTH,
|
|
348
|
+
borderBottomColor: BORDER_COLOR,
|
|
349
|
+
backgroundColor: 'white'
|
|
350
|
+
},
|
|
351
|
+
resourceRowFirst: {
|
|
352
|
+
borderTopWidth: CELL_BORDER_WIDTH,
|
|
353
|
+
borderTopColor: BORDER_COLOR
|
|
354
|
+
},
|
|
355
|
+
resourceNameCell: {
|
|
356
|
+
justifyContent: 'center',
|
|
357
|
+
paddingHorizontal: 4,
|
|
358
|
+
borderRightWidth: CELL_BORDER_WIDTH,
|
|
359
|
+
borderRightColor: BORDER_COLOR,
|
|
360
|
+
backgroundColor: '#fafafa'
|
|
361
|
+
},
|
|
362
|
+
resourceNameText: {
|
|
363
|
+
fontSize: 11,
|
|
364
|
+
color: '#333'
|
|
365
|
+
},
|
|
366
|
+
dayCell: {
|
|
367
|
+
borderRightWidth: CELL_BORDER_WIDTH,
|
|
368
|
+
borderRightColor: BORDER_COLOR,
|
|
369
|
+
minHeight: 30,
|
|
370
|
+
paddingBottom: EVENT_GAP,
|
|
371
|
+
position: 'relative'
|
|
372
|
+
},
|
|
373
|
+
dayCellBackground: {
|
|
374
|
+
...StyleSheet.absoluteFillObject
|
|
375
|
+
},
|
|
376
|
+
cellInteractionOverlay: {
|
|
377
|
+
...StyleSheet.absoluteFillObject,
|
|
378
|
+
zIndex: 1000,
|
|
379
|
+
backgroundColor: 'transparent',
|
|
380
|
+
...Platform.select({
|
|
381
|
+
android: {
|
|
382
|
+
elevation: 12
|
|
383
|
+
},
|
|
384
|
+
default: {}
|
|
385
|
+
})
|
|
386
|
+
},
|
|
387
|
+
eventOuter: {
|
|
388
|
+
position: 'relative',
|
|
389
|
+
marginTop: EVENT_GAP,
|
|
390
|
+
marginLeft: EVENT_GAP
|
|
391
|
+
},
|
|
392
|
+
prevDateEvent: {
|
|
393
|
+
marginLeft: -1
|
|
394
|
+
},
|
|
395
|
+
prevDateEventInner: {
|
|
396
|
+
borderTopStartRadius: 0,
|
|
397
|
+
borderBottomStartRadius: 0
|
|
398
|
+
},
|
|
399
|
+
nextWeekEventInner: {
|
|
400
|
+
borderTopEndRadius: 0,
|
|
401
|
+
borderBottomEndRadius: 0,
|
|
402
|
+
paddingRight: 0
|
|
403
|
+
},
|
|
404
|
+
event: {
|
|
405
|
+
flex: 1,
|
|
406
|
+
width: '100%',
|
|
407
|
+
height: '100%',
|
|
408
|
+
borderWidth: 0.5,
|
|
409
|
+
borderRadius: 4,
|
|
410
|
+
paddingHorizontal: 4,
|
|
411
|
+
flexDirection: 'row',
|
|
412
|
+
alignItems: 'center',
|
|
413
|
+
...Platform.select({
|
|
414
|
+
android: {
|
|
415
|
+
elevation: 2
|
|
416
|
+
},
|
|
417
|
+
default: {}
|
|
418
|
+
})
|
|
419
|
+
},
|
|
420
|
+
eventTitle: {
|
|
421
|
+
fontSize: 11
|
|
422
|
+
},
|
|
423
|
+
eventOverlayHost: {
|
|
424
|
+
...StyleSheet.absoluteFillObject,
|
|
425
|
+
pointerEvents: 'box-none'
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
//# sourceMappingURL=WeekPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","memo","useMemo","FlatList","Platform","RefreshControl","StyleSheet","Text","TouchableOpacity","View","dayjs","ResourcesCalendarEventPosition","EVENT_GAP","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CELL_BORDER_WIDTH","BORDER_COLOR","DEFAULT_EVENT_HEIGHT","DayCell","resource","date","dateIndex","columnWidth","eventHeight","cellEvents","onPressCell","onLongPressCell","delayLongPressCell","onPressEvent","onLongPressEvent","delayLongPressEvent","prioritizeCellInteraction","eventTextStyle","eventEllipsizeMode","allowFontScaling","renderEventOverlay","cellContainerStyle","showPrioritizedCellOverlay","cellWrapperStyle","styles","dayCell","width","zIndex","cellInner","children","style","dayCellBackground","toDate","map","event","rowIndex","height","marginBottom","rawStartDjs","start","startDjs","endDjs","end","diffDays","startOf","diff","isPrevDateEvent","isBefore","remainingDaysInWeek","isNextWeekEvent","effectiveDiffDays","eventOverlayNode","showEventOverlay","pointerEvents","eventOuter","prevDateEvent","backgroundColor","borderColor","borderStyle","undefined","borderWidth","borderRadius","prevDateEventInner","nextWeekEventInner","activeOpacity","onPress","onLongPress","delayLongPress","numberOfLines","ellipsizeMode","eventTitle","color","title","eventOverlayHost","id","accessible","cellInteractionOverlay","WeekPanel","weekKey","resources","events","dateCellContainerStyle","renderDateLabel","renderResourceNameLabel","onRefresh","refreshing","bottomSpacing","fixedRowCount","resolvedEventHeight","resolvedFixedRowCount","days","Array","from","length","_","i","add","eventsByResourceId","deduped","Map","set","values","list","get","resourceId","push","cellDataMap","ep","resourceEvents","filteredEvents","filter","format","sort","a","b","aStartDjs","bStartDjs","aDiffDays","bDiffDays","rowNums","getRowNums","rowsLength","eventIndex","ii","includes","item","startDate","rowNum","fixedResources","slice","scrollableResources","renderResourceRow","showTopBorder","resourceRow","resourceRowFirst","resourceNameCell","resourceNameText","name","day","panel","headerRow","headerCell","resourceNameHeaderCell","headerDayOfWeekText","headerDateText","index","data","keyExtractor","renderItem","showsVerticalScrollIndicator","nestedScrollEnabled","refreshControl","ListFooterComponent","removeClippedSubviews","create","flex","overflow","flexDirection","borderBottomWidth","borderBottomColor","alignItems","justifyContent","paddingVertical","borderRightWidth","borderRightColor","fontSize","fontWeight","minHeight","borderTopWidth","borderTopColor","paddingHorizontal","paddingBottom","position","absoluteFillObject","select","android","elevation","default","marginTop","marginLeft","borderTopStartRadius","borderBottomStartRadius","borderTopEndRadius","borderBottomEndRadius","paddingRight"],"sourceRoot":"../../../../src","sources":["calendar/week-resources-calendar/WeekPanel.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,OAAO,QAAwB,OAAO;AAC5D,SACEC,QAAQ,EACRC,QAAQ,EACRC,cAAc,EACdC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,IAAI,QAGC,cAAc;AACrB,OAAOC,KAAK,MAAM,OAAO;AAKzB,OAAOC,8BAA8B,MAAM,kDAA+C;AAC1F,SAASC,SAAS,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEjD,OAAO,MAAMC,iBAAiB,GAAG,GAAG;AACpC,OAAO,MAAMC,YAAY,GAAG,gBAAgB;AAC5C,MAAMC,oBAAoB,GAAG,EAAE;AAkD/B,MAAMC,OAAO,gBAAGrB,IAAI,CAAC,SAASqB,OAAOA,CAAC;EACpCC,QA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