@lazerlen/legend-calendar 1.2.0 → 1.3.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/.turbo/turbo-build.log +9 -9
- package/.turbo/turbo-test.log +87 -87
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +52 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/CalendarItemDay.tsx +22 -0
package/package.json
CHANGED
|
@@ -304,6 +304,12 @@ interface CalendarItemDayContainerTheme {
|
|
|
304
304
|
/** An absolute positioned filler to join the active days together in a single
|
|
305
305
|
* complete range. */
|
|
306
306
|
activeDayFiller?: ViewStyle | ((params: CalendarDayMetadata) => ViewStyle);
|
|
307
|
+
/** An absolutely-positioned background view rendered inside the spacer,
|
|
308
|
+
* behind the day button. Useful for rendering a range band that doesn't
|
|
309
|
+
* extend behind the circular edge days. */
|
|
310
|
+
activeDayRangeBackground?:
|
|
311
|
+
| ViewStyle
|
|
312
|
+
| ((params: CalendarDayMetadata) => ViewStyle | undefined);
|
|
307
313
|
}
|
|
308
314
|
|
|
309
315
|
export interface CalendarItemDayContainerProps {
|
|
@@ -361,8 +367,24 @@ export const CalendarItemDayContainer = memo(function CalendarItemDayContainer({
|
|
|
361
367
|
: theme?.activeDayFiller),
|
|
362
368
|
};
|
|
363
369
|
|
|
370
|
+
const rangeBackgroundTheme =
|
|
371
|
+
typeof theme?.activeDayRangeBackground === "function" && metadata
|
|
372
|
+
? theme.activeDayRangeBackground(metadata)
|
|
373
|
+
: theme?.activeDayRangeBackground;
|
|
374
|
+
const rangeBackground: ViewStyle | null = rangeBackgroundTheme
|
|
375
|
+
? {
|
|
376
|
+
position: "absolute",
|
|
377
|
+
top: 0,
|
|
378
|
+
bottom: 0,
|
|
379
|
+
left: 0,
|
|
380
|
+
right: 0,
|
|
381
|
+
...rangeBackgroundTheme,
|
|
382
|
+
}
|
|
383
|
+
: null;
|
|
384
|
+
|
|
364
385
|
return (
|
|
365
386
|
<View style={spacerStyles}>
|
|
387
|
+
{rangeBackground ? <View style={rangeBackground} /> : null}
|
|
366
388
|
{activeDayFiller ? <View style={activeDayFiller} /> : null}
|
|
367
389
|
{children}
|
|
368
390
|
</View>
|