@lazerlen/legend-calendar 1.4.0 → 1.5.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 +100 -100
- package/dist/index.d.mts +58 -13
- package/dist/index.d.ts +58 -13
- package/dist/index.js +598 -317
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +594 -314
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/Calendar.tsx +14 -16
- package/src/components/CalendarItemDay.tsx +6 -8
- package/src/components/CalendarItemEmpty.tsx +2 -3
- package/src/components/CalendarItemWeekName.tsx +2 -3
- package/src/components/CalendarList.tsx +279 -92
- package/src/components/CalendarListConfigContext.tsx +29 -0
- package/src/components/CalendarRowMonth.tsx +2 -3
- package/src/components/CalendarRowWeek.tsx +2 -3
- package/src/components/index.ts +4 -0
- package/src/developer/decorators.tsx +4 -4
- package/src/hooks/useCalendarList.tsx +6 -0
- package/CHANGELOG.md +0 -127
package/dist/index.mjs
CHANGED
|
@@ -33,11 +33,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
33
33
|
|
|
34
34
|
// src/components/Calendar.tsx
|
|
35
35
|
import { c as _c10 } from "react/compiler-runtime";
|
|
36
|
-
import {
|
|
36
|
+
import { useEffect } from "react";
|
|
37
37
|
|
|
38
38
|
// src/components/CalendarItemDay.tsx
|
|
39
39
|
import { c as _c3 } from "react/compiler-runtime";
|
|
40
|
-
import { memo } from "react";
|
|
41
40
|
import { Pressable, StyleSheet, View } from "react-native";
|
|
42
41
|
|
|
43
42
|
// src/components/Text.tsx
|
|
@@ -591,7 +590,7 @@ var buildBaseStyles = (theme) => {
|
|
|
591
590
|
}
|
|
592
591
|
};
|
|
593
592
|
};
|
|
594
|
-
var CalendarItemDay =
|
|
593
|
+
var CalendarItemDay = function CalendarItemDay2(t0) {
|
|
595
594
|
const $ = _c3(22);
|
|
596
595
|
const {
|
|
597
596
|
onPress,
|
|
@@ -757,8 +756,8 @@ var CalendarItemDay = /* @__PURE__ */ memo(function CalendarItemDay2(t0) {
|
|
|
757
756
|
t7 = $[21];
|
|
758
757
|
}
|
|
759
758
|
return t7;
|
|
760
|
-
}
|
|
761
|
-
var CalendarItemDayContainer =
|
|
759
|
+
};
|
|
760
|
+
var CalendarItemDayContainer = function CalendarItemDayContainer2(t0) {
|
|
762
761
|
const $ = _c3(29);
|
|
763
762
|
const {
|
|
764
763
|
children,
|
|
@@ -885,8 +884,8 @@ var CalendarItemDayContainer = /* @__PURE__ */ memo(function CalendarItemDayCont
|
|
|
885
884
|
t10 = $[28];
|
|
886
885
|
}
|
|
887
886
|
return t10;
|
|
888
|
-
}
|
|
889
|
-
var CalendarItemDayWithContainer =
|
|
887
|
+
};
|
|
888
|
+
var CalendarItemDayWithContainer = function CalendarItemDayWithContainer2(t0) {
|
|
890
889
|
const $ = _c3(14);
|
|
891
890
|
const {
|
|
892
891
|
children,
|
|
@@ -943,11 +942,10 @@ var CalendarItemDayWithContainer = /* @__PURE__ */ memo(function CalendarItemDay
|
|
|
943
942
|
t3 = $[13];
|
|
944
943
|
}
|
|
945
944
|
return t3;
|
|
946
|
-
}
|
|
945
|
+
};
|
|
947
946
|
|
|
948
947
|
// src/components/CalendarItemEmpty.tsx
|
|
949
948
|
import { c as _c4 } from "react/compiler-runtime";
|
|
950
|
-
import { memo as memo2 } from "react";
|
|
951
949
|
import { StyleSheet as StyleSheet2, View as View2 } from "react-native";
|
|
952
950
|
import { jsx as _jsx3 } from "react/jsx-runtime";
|
|
953
951
|
var styles2 = StyleSheet2.create({
|
|
@@ -956,7 +954,7 @@ var styles2 = StyleSheet2.create({
|
|
|
956
954
|
flex: 1
|
|
957
955
|
}
|
|
958
956
|
});
|
|
959
|
-
var CalendarItemEmpty =
|
|
957
|
+
var CalendarItemEmpty = function CalendarItemEmpty2(props) {
|
|
960
958
|
const $ = _c4(5);
|
|
961
959
|
const {
|
|
962
960
|
height,
|
|
@@ -986,11 +984,10 @@ var CalendarItemEmpty = /* @__PURE__ */ memo2(function CalendarItemEmpty2(props)
|
|
|
986
984
|
t2 = $[4];
|
|
987
985
|
}
|
|
988
986
|
return t2;
|
|
989
|
-
}
|
|
987
|
+
};
|
|
990
988
|
|
|
991
989
|
// src/components/CalendarItemWeekName.tsx
|
|
992
990
|
import { c as _c5 } from "react/compiler-runtime";
|
|
993
|
-
import { memo as memo3 } from "react";
|
|
994
991
|
import { StyleSheet as StyleSheet3, View as View3 } from "react-native";
|
|
995
992
|
import { jsx as _jsx4 } from "react/jsx-runtime";
|
|
996
993
|
var styles3 = StyleSheet3.create({
|
|
@@ -1002,7 +999,7 @@ var styles3 = StyleSheet3.create({
|
|
|
1002
999
|
},
|
|
1003
1000
|
content: {}
|
|
1004
1001
|
});
|
|
1005
|
-
var CalendarItemWeekName =
|
|
1002
|
+
var CalendarItemWeekName = function CalendarItemWeekName2(t0) {
|
|
1006
1003
|
const $ = _c5(18);
|
|
1007
1004
|
const {
|
|
1008
1005
|
children,
|
|
@@ -1083,11 +1080,18 @@ var CalendarItemWeekName = /* @__PURE__ */ memo3(function CalendarItemWeekName2(
|
|
|
1083
1080
|
t9 = $[17];
|
|
1084
1081
|
}
|
|
1085
1082
|
return t9;
|
|
1086
|
-
}
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
// src/components/CalendarListConfigContext.tsx
|
|
1086
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
1087
|
+
var CalendarListConfigContext = /* @__PURE__ */ createContext2(null);
|
|
1088
|
+
var CalendarListConfigProvider = CalendarListConfigContext.Provider;
|
|
1089
|
+
var useCalendarListConfig = () => {
|
|
1090
|
+
return useContext2(CalendarListConfigContext);
|
|
1091
|
+
};
|
|
1087
1092
|
|
|
1088
1093
|
// src/components/CalendarRowMonth.tsx
|
|
1089
1094
|
import { c as _c6 } from "react/compiler-runtime";
|
|
1090
|
-
import { memo as memo4 } from "react";
|
|
1091
1095
|
import { StyleSheet as StyleSheet4, View as View4 } from "react-native";
|
|
1092
1096
|
import { jsx as _jsx5 } from "react/jsx-runtime";
|
|
1093
1097
|
var styles4 = StyleSheet4.create({
|
|
@@ -1101,7 +1105,7 @@ var styles4 = StyleSheet4.create({
|
|
|
1101
1105
|
width: "100%"
|
|
1102
1106
|
}
|
|
1103
1107
|
});
|
|
1104
|
-
var CalendarRowMonth =
|
|
1108
|
+
var CalendarRowMonth = function CalendarRowMonth2(t0) {
|
|
1105
1109
|
const $ = _c6(16);
|
|
1106
1110
|
const {
|
|
1107
1111
|
children,
|
|
@@ -1176,11 +1180,10 @@ var CalendarRowMonth = /* @__PURE__ */ memo4(function CalendarRowMonth2(t0) {
|
|
|
1176
1180
|
t8 = $[15];
|
|
1177
1181
|
}
|
|
1178
1182
|
return t8;
|
|
1179
|
-
}
|
|
1183
|
+
};
|
|
1180
1184
|
|
|
1181
1185
|
// src/components/CalendarRowWeek.tsx
|
|
1182
1186
|
import { c as _c8 } from "react/compiler-runtime";
|
|
1183
|
-
import { memo as memo5 } from "react";
|
|
1184
1187
|
import { StyleSheet as StyleSheet6 } from "react-native";
|
|
1185
1188
|
|
|
1186
1189
|
// src/components/HStack.tsx
|
|
@@ -1344,7 +1347,7 @@ var styles6 = StyleSheet6.create({
|
|
|
1344
1347
|
width: "100%"
|
|
1345
1348
|
}
|
|
1346
1349
|
});
|
|
1347
|
-
var CalendarRowWeek =
|
|
1350
|
+
var CalendarRowWeek = function CalendarRowWeek2(t0) {
|
|
1348
1351
|
var _a;
|
|
1349
1352
|
const $ = _c8(8);
|
|
1350
1353
|
const {
|
|
@@ -1388,7 +1391,7 @@ var CalendarRowWeek = /* @__PURE__ */ memo5(function CalendarRowWeek2(t0) {
|
|
|
1388
1391
|
t4 = $[7];
|
|
1389
1392
|
}
|
|
1390
1393
|
return t4;
|
|
1391
|
-
}
|
|
1394
|
+
};
|
|
1392
1395
|
|
|
1393
1396
|
// src/components/VStack.tsx
|
|
1394
1397
|
import { c as _c9 } from "react/compiler-runtime";
|
|
@@ -1447,7 +1450,7 @@ var uppercaseFirstLetter = (value) => value.charAt(0).toUpperCase() + value.slic
|
|
|
1447
1450
|
|
|
1448
1451
|
// src/components/Calendar.tsx
|
|
1449
1452
|
import { jsx as _jsx9, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
1450
|
-
var BaseCalendar =
|
|
1453
|
+
var BaseCalendar = function BaseCalendar2(props) {
|
|
1451
1454
|
var _a;
|
|
1452
1455
|
const $ = _c10(51);
|
|
1453
1456
|
let CalendarPressableComponent;
|
|
@@ -1650,17 +1653,28 @@ var BaseCalendar = /* @__PURE__ */ memo6(function BaseCalendar2(props) {
|
|
|
1650
1653
|
t13 = $[50];
|
|
1651
1654
|
}
|
|
1652
1655
|
return t13;
|
|
1653
|
-
}
|
|
1654
|
-
var Calendar =
|
|
1656
|
+
};
|
|
1657
|
+
var Calendar = function Calendar2(props) {
|
|
1655
1658
|
var _a;
|
|
1656
|
-
const $ = _c10(
|
|
1659
|
+
const $ = _c10(23);
|
|
1660
|
+
const listConfig = useCalendarListConfig();
|
|
1661
|
+
let t0;
|
|
1662
|
+
if ($[0] !== listConfig || $[1] !== props) {
|
|
1663
|
+
t0 = listConfig ? __spreadValues(__spreadValues({}, listConfig), props) : props;
|
|
1664
|
+
$[0] = listConfig;
|
|
1665
|
+
$[1] = props;
|
|
1666
|
+
$[2] = t0;
|
|
1667
|
+
} else {
|
|
1668
|
+
t0 = $[2];
|
|
1669
|
+
}
|
|
1670
|
+
const resolvedProps = t0;
|
|
1657
1671
|
let calendarActiveDateRanges;
|
|
1658
1672
|
let calendarColorScheme;
|
|
1659
1673
|
let calendarInstanceId;
|
|
1660
1674
|
let calendarMonthId;
|
|
1661
1675
|
let otherProps;
|
|
1662
|
-
if ($[
|
|
1663
|
-
_a =
|
|
1676
|
+
if ($[3] !== resolvedProps) {
|
|
1677
|
+
_a = resolvedProps, {
|
|
1664
1678
|
calendarInstanceId,
|
|
1665
1679
|
calendarActiveDateRanges,
|
|
1666
1680
|
calendarMonthId,
|
|
@@ -1671,76 +1685,76 @@ var Calendar = /* @__PURE__ */ memo6(function Calendar2(props) {
|
|
|
1671
1685
|
"calendarMonthId",
|
|
1672
1686
|
"calendarColorScheme"
|
|
1673
1687
|
]);
|
|
1674
|
-
$[
|
|
1675
|
-
$[
|
|
1676
|
-
$[
|
|
1677
|
-
$[
|
|
1678
|
-
$[
|
|
1679
|
-
$[
|
|
1680
|
-
} else {
|
|
1681
|
-
calendarActiveDateRanges = $[
|
|
1682
|
-
calendarColorScheme = $[
|
|
1683
|
-
calendarInstanceId = $[
|
|
1684
|
-
calendarMonthId = $[
|
|
1685
|
-
otherProps = $[
|
|
1688
|
+
$[3] = resolvedProps;
|
|
1689
|
+
$[4] = calendarActiveDateRanges;
|
|
1690
|
+
$[5] = calendarColorScheme;
|
|
1691
|
+
$[6] = calendarInstanceId;
|
|
1692
|
+
$[7] = calendarMonthId;
|
|
1693
|
+
$[8] = otherProps;
|
|
1694
|
+
} else {
|
|
1695
|
+
calendarActiveDateRanges = $[4];
|
|
1696
|
+
calendarColorScheme = $[5];
|
|
1697
|
+
calendarInstanceId = $[6];
|
|
1698
|
+
calendarMonthId = $[7];
|
|
1699
|
+
otherProps = $[8];
|
|
1686
1700
|
}
|
|
1687
|
-
let
|
|
1688
|
-
if ($[
|
|
1689
|
-
|
|
1701
|
+
let t1;
|
|
1702
|
+
if ($[9] !== calendarActiveDateRanges || $[10] !== calendarInstanceId) {
|
|
1703
|
+
t1 = () => {
|
|
1690
1704
|
if (calendarActiveDateRanges === void 0) {
|
|
1691
1705
|
return;
|
|
1692
1706
|
}
|
|
1693
1707
|
activeDateRangesStore.setRanges(calendarInstanceId != null ? calendarInstanceId : "legend-calendar-default-instance", calendarActiveDateRanges);
|
|
1694
1708
|
};
|
|
1695
|
-
$[6] = calendarActiveDateRanges;
|
|
1696
|
-
$[7] = calendarInstanceId;
|
|
1697
|
-
$[8] = t0;
|
|
1698
|
-
} else {
|
|
1699
|
-
t0 = $[8];
|
|
1700
|
-
}
|
|
1701
|
-
let t1;
|
|
1702
|
-
if ($[9] !== calendarActiveDateRanges || $[10] !== calendarInstanceId || $[11] !== calendarMonthId) {
|
|
1703
|
-
t1 = [calendarActiveDateRanges, calendarInstanceId, calendarMonthId];
|
|
1704
1709
|
$[9] = calendarActiveDateRanges;
|
|
1705
1710
|
$[10] = calendarInstanceId;
|
|
1706
|
-
$[11] =
|
|
1707
|
-
$[12] = t1;
|
|
1711
|
+
$[11] = t1;
|
|
1708
1712
|
} else {
|
|
1709
|
-
t1 = $[
|
|
1713
|
+
t1 = $[11];
|
|
1710
1714
|
}
|
|
1711
|
-
useEffect(t0, t1);
|
|
1712
1715
|
let t2;
|
|
1713
|
-
if ($[
|
|
1714
|
-
t2 =
|
|
1715
|
-
|
|
1716
|
-
calendarMonthId
|
|
1717
|
-
}));
|
|
1716
|
+
if ($[12] !== calendarActiveDateRanges || $[13] !== calendarInstanceId || $[14] !== calendarMonthId) {
|
|
1717
|
+
t2 = [calendarActiveDateRanges, calendarInstanceId, calendarMonthId];
|
|
1718
|
+
$[12] = calendarActiveDateRanges;
|
|
1718
1719
|
$[13] = calendarInstanceId;
|
|
1719
1720
|
$[14] = calendarMonthId;
|
|
1720
|
-
$[15] =
|
|
1721
|
-
$[16] = t2;
|
|
1721
|
+
$[15] = t2;
|
|
1722
1722
|
} else {
|
|
1723
|
-
t2 = $[
|
|
1723
|
+
t2 = $[15];
|
|
1724
1724
|
}
|
|
1725
|
+
useEffect(t1, t2);
|
|
1725
1726
|
let t3;
|
|
1726
|
-
if ($[17] !==
|
|
1727
|
-
t3 = /* @__PURE__ */ _jsx9(
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
});
|
|
1731
|
-
$[
|
|
1732
|
-
$[
|
|
1727
|
+
if ($[16] !== calendarInstanceId || $[17] !== calendarMonthId || $[18] !== otherProps) {
|
|
1728
|
+
t3 = /* @__PURE__ */ _jsx9(BaseCalendar, __spreadProps(__spreadValues({}, otherProps), {
|
|
1729
|
+
calendarInstanceId,
|
|
1730
|
+
calendarMonthId
|
|
1731
|
+
}));
|
|
1732
|
+
$[16] = calendarInstanceId;
|
|
1733
|
+
$[17] = calendarMonthId;
|
|
1734
|
+
$[18] = otherProps;
|
|
1733
1735
|
$[19] = t3;
|
|
1734
1736
|
} else {
|
|
1735
1737
|
t3 = $[19];
|
|
1736
1738
|
}
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
+
let t4;
|
|
1740
|
+
if ($[20] !== calendarColorScheme || $[21] !== t3) {
|
|
1741
|
+
t4 = /* @__PURE__ */ _jsx9(CalendarThemeProvider, {
|
|
1742
|
+
colorScheme: calendarColorScheme,
|
|
1743
|
+
children: t3
|
|
1744
|
+
});
|
|
1745
|
+
$[20] = calendarColorScheme;
|
|
1746
|
+
$[21] = t3;
|
|
1747
|
+
$[22] = t4;
|
|
1748
|
+
} else {
|
|
1749
|
+
t4 = $[22];
|
|
1750
|
+
}
|
|
1751
|
+
return t4;
|
|
1752
|
+
};
|
|
1739
1753
|
|
|
1740
1754
|
// src/components/CalendarList.tsx
|
|
1741
1755
|
import { c as _c12 } from "react/compiler-runtime";
|
|
1742
1756
|
import { LegendList as LegendListBase } from "@legendapp/list/react-native";
|
|
1743
|
-
import { useEffect as useEffect2, useImperativeHandle, useRef } from "react";
|
|
1757
|
+
import { useEffect as useEffect2, useImperativeHandle, useMemo, useRef, useState as useState2 } from "react";
|
|
1744
1758
|
import { StyleSheet as StyleSheet8, View as View7 } from "react-native";
|
|
1745
1759
|
|
|
1746
1760
|
// src/hooks/useCalendarList.tsx
|
|
@@ -1867,6 +1881,9 @@ var useCalendarList = (t0) => {
|
|
|
1867
1881
|
let t3;
|
|
1868
1882
|
if ($[10] !== calendarFirstDayOfWeek || $[11] !== calendarMaxDateId || $[12] !== monthList) {
|
|
1869
1883
|
t3 = (numberOfMonths) => {
|
|
1884
|
+
if (numberOfMonths <= 0) {
|
|
1885
|
+
return monthList;
|
|
1886
|
+
}
|
|
1870
1887
|
const startingMonth_0 = addMonths(monthList[monthList.length - 1].date, 1);
|
|
1871
1888
|
const endingMonth_0 = getEndingMonth(Math.max(numberOfMonths - 1, 0), calendarMaxDateId, startingMonth_0);
|
|
1872
1889
|
const hasReachedEndingMonth = monthList.find((m) => m.id === toDateId(endingMonth_0));
|
|
@@ -1892,6 +1909,9 @@ var useCalendarList = (t0) => {
|
|
|
1892
1909
|
let t4;
|
|
1893
1910
|
if ($[14] !== calendarFirstDayOfWeek || $[15] !== calendarMinDateId || $[16] !== monthList) {
|
|
1894
1911
|
t4 = (numberOfMonths_0) => {
|
|
1912
|
+
if (numberOfMonths_0 <= 0) {
|
|
1913
|
+
return monthList;
|
|
1914
|
+
}
|
|
1895
1915
|
const endingMonth_1 = subMonths(monthList[0].date, 1);
|
|
1896
1916
|
const startingMonth_1 = getStartingMonth(Math.max(numberOfMonths_0 - 1, 0), calendarMinDateId, endingMonth_1);
|
|
1897
1917
|
const hasReachedStartingMonth = monthList.find((m_0) => m_0.id === toDateId(startingMonth_1));
|
|
@@ -1990,14 +2010,261 @@ var getHeightForMonth = ({
|
|
|
1990
2010
|
import { jsx as _jsx10 } from "react/jsx-runtime";
|
|
1991
2011
|
var LegendList = LegendListBase;
|
|
1992
2012
|
var keyExtractor = (month) => month.id;
|
|
1993
|
-
function
|
|
1994
|
-
const
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2013
|
+
function buildCalendarConfig(calendarColorScheme, calendarDayHeight, calendarDisabledDateIds, calendarFirstDayOfWeek, calendarFormatLocale, calendarInstanceId, calendarMaxDateId, calendarMinDateId, calendarMonthHeaderHeight, calendarRowHorizontalSpacing, calendarRowVerticalSpacing, calendarWeekHeaderHeightProp, getCalendarDayFormat, getCalendarMonthFormat, getCalendarWeekDayFormat, onCalendarDayPress, theme, CalendarPressableComponent) {
|
|
2014
|
+
const calendarWeekHeaderHeight = calendarWeekHeaderHeightProp != null ? calendarWeekHeaderHeightProp : calendarDayHeight;
|
|
2015
|
+
return {
|
|
2016
|
+
calendarColorScheme,
|
|
2017
|
+
calendarDayHeight,
|
|
2018
|
+
calendarDisabledDateIds,
|
|
2019
|
+
calendarFirstDayOfWeek,
|
|
2020
|
+
calendarFormatLocale,
|
|
2021
|
+
calendarInstanceId,
|
|
2022
|
+
calendarMaxDateId,
|
|
2023
|
+
calendarMinDateId,
|
|
2024
|
+
calendarMonthHeaderHeight,
|
|
2025
|
+
calendarRowHorizontalSpacing,
|
|
2026
|
+
calendarRowVerticalSpacing,
|
|
2027
|
+
calendarWeekHeaderHeight,
|
|
2028
|
+
getCalendarDayFormat,
|
|
2029
|
+
getCalendarMonthFormat,
|
|
2030
|
+
getCalendarWeekDayFormat,
|
|
2031
|
+
onCalendarDayPress,
|
|
2032
|
+
theme,
|
|
2033
|
+
CalendarPressableComponent
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2036
|
+
function CalendarList(props) {
|
|
2037
|
+
var _a;
|
|
2038
|
+
const $ = _c12(62);
|
|
2039
|
+
let CalendarPressableComponent;
|
|
2040
|
+
let calendarActiveDateRanges;
|
|
2041
|
+
let calendarAdditionalHeight;
|
|
2042
|
+
let calendarColorScheme;
|
|
2043
|
+
let calendarDayHeight;
|
|
2044
|
+
let calendarDisabledDateIds;
|
|
2045
|
+
let calendarFirstDayOfWeek;
|
|
2046
|
+
let calendarFormatLocale;
|
|
2047
|
+
let calendarFutureScrollRangeInMonths;
|
|
2048
|
+
let calendarInitialMonthId;
|
|
2049
|
+
let calendarInitialScrollToActiveRange;
|
|
2050
|
+
let calendarInstanceId;
|
|
2051
|
+
let calendarMaxDateId;
|
|
2052
|
+
let calendarMinDateId;
|
|
2053
|
+
let calendarMonthHeaderHeight;
|
|
2054
|
+
let calendarPastScrollRangeInMonths;
|
|
2055
|
+
let calendarRowHorizontalSpacing;
|
|
2056
|
+
let calendarRowVerticalSpacing;
|
|
2057
|
+
let calendarSpacing;
|
|
2058
|
+
let calendarWeekHeaderHeight;
|
|
2059
|
+
let flatListProps;
|
|
2060
|
+
let getCalendarDayFormat;
|
|
2061
|
+
let getCalendarMonthFormat;
|
|
2062
|
+
let getCalendarWeekDayFormat;
|
|
2063
|
+
let onCalendarDayPress;
|
|
2064
|
+
let onEndReached;
|
|
2065
|
+
let onStartReached;
|
|
2066
|
+
let ref;
|
|
2067
|
+
let renderItem;
|
|
2068
|
+
let theme;
|
|
2069
|
+
if ($[0] !== props) {
|
|
2070
|
+
_a = props, {
|
|
2071
|
+
ref,
|
|
2072
|
+
calendarInitialMonthId,
|
|
2073
|
+
calendarInitialScrollToActiveRange,
|
|
2074
|
+
calendarPastScrollRangeInMonths,
|
|
2075
|
+
calendarFutureScrollRangeInMonths,
|
|
2076
|
+
calendarFirstDayOfWeek,
|
|
2077
|
+
calendarFormatLocale,
|
|
2078
|
+
calendarSpacing,
|
|
2079
|
+
calendarRowHorizontalSpacing,
|
|
2080
|
+
calendarRowVerticalSpacing,
|
|
2081
|
+
calendarMonthHeaderHeight,
|
|
2082
|
+
calendarDayHeight,
|
|
2083
|
+
calendarWeekHeaderHeight,
|
|
2084
|
+
calendarAdditionalHeight,
|
|
2085
|
+
calendarColorScheme,
|
|
2086
|
+
theme,
|
|
2087
|
+
onEndReached,
|
|
2088
|
+
onStartReached,
|
|
2089
|
+
calendarActiveDateRanges,
|
|
2090
|
+
calendarDisabledDateIds,
|
|
2091
|
+
calendarInstanceId,
|
|
2092
|
+
calendarMaxDateId,
|
|
2093
|
+
calendarMinDateId,
|
|
2094
|
+
getCalendarDayFormat,
|
|
2095
|
+
getCalendarMonthFormat,
|
|
2096
|
+
getCalendarWeekDayFormat,
|
|
2097
|
+
onCalendarDayPress,
|
|
2098
|
+
CalendarPressableComponent,
|
|
2099
|
+
renderItem
|
|
2100
|
+
} = _a, flatListProps = __objRest(_a, [
|
|
2101
|
+
"ref",
|
|
2102
|
+
"calendarInitialMonthId",
|
|
2103
|
+
"calendarInitialScrollToActiveRange",
|
|
2104
|
+
"calendarPastScrollRangeInMonths",
|
|
2105
|
+
"calendarFutureScrollRangeInMonths",
|
|
2106
|
+
"calendarFirstDayOfWeek",
|
|
2107
|
+
"calendarFormatLocale",
|
|
2108
|
+
"calendarSpacing",
|
|
2109
|
+
"calendarRowHorizontalSpacing",
|
|
2110
|
+
"calendarRowVerticalSpacing",
|
|
2111
|
+
"calendarMonthHeaderHeight",
|
|
2112
|
+
"calendarDayHeight",
|
|
2113
|
+
"calendarWeekHeaderHeight",
|
|
2114
|
+
"calendarAdditionalHeight",
|
|
2115
|
+
"calendarColorScheme",
|
|
2116
|
+
"theme",
|
|
2117
|
+
"onEndReached",
|
|
2118
|
+
"onStartReached",
|
|
2119
|
+
"calendarActiveDateRanges",
|
|
2120
|
+
"calendarDisabledDateIds",
|
|
2121
|
+
"calendarInstanceId",
|
|
2122
|
+
"calendarMaxDateId",
|
|
2123
|
+
"calendarMinDateId",
|
|
2124
|
+
"getCalendarDayFormat",
|
|
2125
|
+
"getCalendarMonthFormat",
|
|
2126
|
+
"getCalendarWeekDayFormat",
|
|
2127
|
+
"onCalendarDayPress",
|
|
2128
|
+
"CalendarPressableComponent",
|
|
2129
|
+
"renderItem"
|
|
2130
|
+
]);
|
|
2131
|
+
$[0] = props;
|
|
2132
|
+
$[1] = CalendarPressableComponent;
|
|
2133
|
+
$[2] = calendarActiveDateRanges;
|
|
2134
|
+
$[3] = calendarAdditionalHeight;
|
|
2135
|
+
$[4] = calendarColorScheme;
|
|
2136
|
+
$[5] = calendarDayHeight;
|
|
2137
|
+
$[6] = calendarDisabledDateIds;
|
|
2138
|
+
$[7] = calendarFirstDayOfWeek;
|
|
2139
|
+
$[8] = calendarFormatLocale;
|
|
2140
|
+
$[9] = calendarFutureScrollRangeInMonths;
|
|
2141
|
+
$[10] = calendarInitialMonthId;
|
|
2142
|
+
$[11] = calendarInitialScrollToActiveRange;
|
|
2143
|
+
$[12] = calendarInstanceId;
|
|
2144
|
+
$[13] = calendarMaxDateId;
|
|
2145
|
+
$[14] = calendarMinDateId;
|
|
2146
|
+
$[15] = calendarMonthHeaderHeight;
|
|
2147
|
+
$[16] = calendarPastScrollRangeInMonths;
|
|
2148
|
+
$[17] = calendarRowHorizontalSpacing;
|
|
2149
|
+
$[18] = calendarRowVerticalSpacing;
|
|
2150
|
+
$[19] = calendarSpacing;
|
|
2151
|
+
$[20] = calendarWeekHeaderHeight;
|
|
2152
|
+
$[21] = flatListProps;
|
|
2153
|
+
$[22] = getCalendarDayFormat;
|
|
2154
|
+
$[23] = getCalendarMonthFormat;
|
|
2155
|
+
$[24] = getCalendarWeekDayFormat;
|
|
2156
|
+
$[25] = onCalendarDayPress;
|
|
2157
|
+
$[26] = onEndReached;
|
|
2158
|
+
$[27] = onStartReached;
|
|
2159
|
+
$[28] = ref;
|
|
2160
|
+
$[29] = renderItem;
|
|
2161
|
+
$[30] = theme;
|
|
2162
|
+
} else {
|
|
2163
|
+
CalendarPressableComponent = $[1];
|
|
2164
|
+
calendarActiveDateRanges = $[2];
|
|
2165
|
+
calendarAdditionalHeight = $[3];
|
|
2166
|
+
calendarColorScheme = $[4];
|
|
2167
|
+
calendarDayHeight = $[5];
|
|
2168
|
+
calendarDisabledDateIds = $[6];
|
|
2169
|
+
calendarFirstDayOfWeek = $[7];
|
|
2170
|
+
calendarFormatLocale = $[8];
|
|
2171
|
+
calendarFutureScrollRangeInMonths = $[9];
|
|
2172
|
+
calendarInitialMonthId = $[10];
|
|
2173
|
+
calendarInitialScrollToActiveRange = $[11];
|
|
2174
|
+
calendarInstanceId = $[12];
|
|
2175
|
+
calendarMaxDateId = $[13];
|
|
2176
|
+
calendarMinDateId = $[14];
|
|
2177
|
+
calendarMonthHeaderHeight = $[15];
|
|
2178
|
+
calendarPastScrollRangeInMonths = $[16];
|
|
2179
|
+
calendarRowHorizontalSpacing = $[17];
|
|
2180
|
+
calendarRowVerticalSpacing = $[18];
|
|
2181
|
+
calendarSpacing = $[19];
|
|
2182
|
+
calendarWeekHeaderHeight = $[20];
|
|
2183
|
+
flatListProps = $[21];
|
|
2184
|
+
getCalendarDayFormat = $[22];
|
|
2185
|
+
getCalendarMonthFormat = $[23];
|
|
2186
|
+
getCalendarWeekDayFormat = $[24];
|
|
2187
|
+
onCalendarDayPress = $[25];
|
|
2188
|
+
onEndReached = $[26];
|
|
2189
|
+
onStartReached = $[27];
|
|
2190
|
+
ref = $[28];
|
|
2191
|
+
renderItem = $[29];
|
|
2192
|
+
theme = $[30];
|
|
2193
|
+
}
|
|
2194
|
+
let t0;
|
|
2195
|
+
if ($[31] !== CalendarPressableComponent || $[32] !== calendarActiveDateRanges || $[33] !== calendarAdditionalHeight || $[34] !== calendarColorScheme || $[35] !== calendarDayHeight || $[36] !== calendarDisabledDateIds || $[37] !== calendarFirstDayOfWeek || $[38] !== calendarFormatLocale || $[39] !== calendarFutureScrollRangeInMonths || $[40] !== calendarInitialMonthId || $[41] !== calendarInitialScrollToActiveRange || $[42] !== calendarInstanceId || $[43] !== calendarMaxDateId || $[44] !== calendarMinDateId || $[45] !== calendarMonthHeaderHeight || $[46] !== calendarPastScrollRangeInMonths || $[47] !== calendarRowHorizontalSpacing || $[48] !== calendarRowVerticalSpacing || $[49] !== calendarSpacing || $[50] !== calendarWeekHeaderHeight || $[51] !== flatListProps || $[52] !== getCalendarDayFormat || $[53] !== getCalendarMonthFormat || $[54] !== getCalendarWeekDayFormat || $[55] !== onCalendarDayPress || $[56] !== onEndReached || $[57] !== onStartReached || $[58] !== ref || $[59] !== renderItem || $[60] !== theme) {
|
|
2196
|
+
t0 = /* @__PURE__ */ _jsx10(CalendarListInner, {
|
|
2197
|
+
CalendarPressableComponent,
|
|
2198
|
+
calendarActiveDateRanges,
|
|
2199
|
+
calendarAdditionalHeight,
|
|
2200
|
+
calendarColorScheme,
|
|
2201
|
+
calendarDayHeight,
|
|
2202
|
+
calendarDisabledDateIds,
|
|
2203
|
+
calendarFirstDayOfWeek,
|
|
2204
|
+
calendarFormatLocale,
|
|
2205
|
+
calendarFutureScrollRangeInMonths,
|
|
2206
|
+
calendarInitialMonthId,
|
|
2207
|
+
calendarInitialScrollToActiveRange,
|
|
2208
|
+
calendarInstanceId,
|
|
2209
|
+
calendarMaxDateId,
|
|
2210
|
+
calendarMinDateId,
|
|
2211
|
+
calendarMonthHeaderHeight,
|
|
2212
|
+
calendarPastScrollRangeInMonths,
|
|
2213
|
+
calendarRowHorizontalSpacing,
|
|
2214
|
+
calendarRowVerticalSpacing,
|
|
2215
|
+
calendarSpacing,
|
|
2216
|
+
calendarWeekHeaderHeight,
|
|
2217
|
+
flatListProps,
|
|
2218
|
+
getCalendarDayFormat,
|
|
2219
|
+
getCalendarMonthFormat,
|
|
2220
|
+
getCalendarWeekDayFormat,
|
|
2221
|
+
onCalendarDayPress,
|
|
2222
|
+
onEndReached,
|
|
2223
|
+
onStartReached,
|
|
2224
|
+
ref,
|
|
2225
|
+
renderItem,
|
|
2226
|
+
theme
|
|
2227
|
+
});
|
|
2228
|
+
$[31] = CalendarPressableComponent;
|
|
2229
|
+
$[32] = calendarActiveDateRanges;
|
|
2230
|
+
$[33] = calendarAdditionalHeight;
|
|
2231
|
+
$[34] = calendarColorScheme;
|
|
2232
|
+
$[35] = calendarDayHeight;
|
|
2233
|
+
$[36] = calendarDisabledDateIds;
|
|
2234
|
+
$[37] = calendarFirstDayOfWeek;
|
|
2235
|
+
$[38] = calendarFormatLocale;
|
|
2236
|
+
$[39] = calendarFutureScrollRangeInMonths;
|
|
2237
|
+
$[40] = calendarInitialMonthId;
|
|
2238
|
+
$[41] = calendarInitialScrollToActiveRange;
|
|
2239
|
+
$[42] = calendarInstanceId;
|
|
2240
|
+
$[43] = calendarMaxDateId;
|
|
2241
|
+
$[44] = calendarMinDateId;
|
|
2242
|
+
$[45] = calendarMonthHeaderHeight;
|
|
2243
|
+
$[46] = calendarPastScrollRangeInMonths;
|
|
2244
|
+
$[47] = calendarRowHorizontalSpacing;
|
|
2245
|
+
$[48] = calendarRowVerticalSpacing;
|
|
2246
|
+
$[49] = calendarSpacing;
|
|
2247
|
+
$[50] = calendarWeekHeaderHeight;
|
|
2248
|
+
$[51] = flatListProps;
|
|
2249
|
+
$[52] = getCalendarDayFormat;
|
|
2250
|
+
$[53] = getCalendarMonthFormat;
|
|
2251
|
+
$[54] = getCalendarWeekDayFormat;
|
|
2252
|
+
$[55] = onCalendarDayPress;
|
|
2253
|
+
$[56] = onEndReached;
|
|
2254
|
+
$[57] = onStartReached;
|
|
2255
|
+
$[58] = ref;
|
|
2256
|
+
$[59] = renderItem;
|
|
2257
|
+
$[60] = theme;
|
|
2258
|
+
$[61] = t0;
|
|
2259
|
+
} else {
|
|
2260
|
+
t0 = $[61];
|
|
2261
|
+
}
|
|
2262
|
+
return t0;
|
|
2263
|
+
}
|
|
2264
|
+
function CalendarListInner(t0) {
|
|
2265
|
+
const $ = _c12(85);
|
|
2266
|
+
const {
|
|
2267
|
+
ref,
|
|
2001
2268
|
calendarInitialMonthId,
|
|
2002
2269
|
calendarInitialScrollToActiveRange: t1,
|
|
2003
2270
|
calendarPastScrollRangeInMonths: t2,
|
|
@@ -2009,42 +2276,12 @@ function CalendarList(t0) {
|
|
|
2009
2276
|
calendarRowVerticalSpacing: t6,
|
|
2010
2277
|
calendarMonthHeaderHeight: t7,
|
|
2011
2278
|
calendarDayHeight: t8,
|
|
2012
|
-
calendarWeekHeaderHeight:
|
|
2013
|
-
calendarAdditionalHeight:
|
|
2279
|
+
calendarWeekHeaderHeight: calendarWeekHeaderHeightProp,
|
|
2280
|
+
calendarAdditionalHeight: t9,
|
|
2014
2281
|
calendarColorScheme,
|
|
2015
2282
|
theme,
|
|
2016
2283
|
onEndReached,
|
|
2017
|
-
onStartReached
|
|
2018
|
-
} = _b, otherProps = __objRest(_b, [
|
|
2019
|
-
"calendarInitialMonthId",
|
|
2020
|
-
"calendarInitialScrollToActiveRange",
|
|
2021
|
-
"calendarPastScrollRangeInMonths",
|
|
2022
|
-
"calendarFutureScrollRangeInMonths",
|
|
2023
|
-
"calendarFirstDayOfWeek",
|
|
2024
|
-
"calendarFormatLocale",
|
|
2025
|
-
"calendarSpacing",
|
|
2026
|
-
"calendarRowHorizontalSpacing",
|
|
2027
|
-
"calendarRowVerticalSpacing",
|
|
2028
|
-
"calendarMonthHeaderHeight",
|
|
2029
|
-
"calendarDayHeight",
|
|
2030
|
-
"calendarWeekHeaderHeight",
|
|
2031
|
-
"calendarAdditionalHeight",
|
|
2032
|
-
"calendarColorScheme",
|
|
2033
|
-
"theme",
|
|
2034
|
-
"onEndReached",
|
|
2035
|
-
"onStartReached"
|
|
2036
|
-
]);
|
|
2037
|
-
const calendarInitialScrollToActiveRange = t1 === void 0 ? true : t1;
|
|
2038
|
-
const calendarPastScrollRangeInMonths = t2 === void 0 ? 12 : t2;
|
|
2039
|
-
const calendarFutureScrollRangeInMonths = t3 === void 0 ? 12 : t3;
|
|
2040
|
-
const calendarFirstDayOfWeek = t4 === void 0 ? "sunday" : t4;
|
|
2041
|
-
const calendarSpacing = t5 === void 0 ? 20 : t5;
|
|
2042
|
-
const calendarRowVerticalSpacing = t6 === void 0 ? 8 : t6;
|
|
2043
|
-
const calendarMonthHeaderHeight = t7 === void 0 ? 20 : t7;
|
|
2044
|
-
const calendarDayHeight = t8 === void 0 ? 32 : t8;
|
|
2045
|
-
const calendarWeekHeaderHeight = t9 === void 0 ? calendarDayHeight : t9;
|
|
2046
|
-
const calendarAdditionalHeight = t10 === void 0 ? 0 : t10;
|
|
2047
|
-
const _c14 = otherProps, {
|
|
2284
|
+
onStartReached,
|
|
2048
2285
|
calendarActiveDateRanges,
|
|
2049
2286
|
calendarDisabledDateIds,
|
|
2050
2287
|
calendarInstanceId,
|
|
@@ -2054,127 +2291,158 @@ function CalendarList(t0) {
|
|
|
2054
2291
|
getCalendarMonthFormat,
|
|
2055
2292
|
getCalendarWeekDayFormat,
|
|
2056
2293
|
onCalendarDayPress,
|
|
2057
|
-
CalendarPressableComponent
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
getCalendarWeekDayFormat,
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2294
|
+
CalendarPressableComponent,
|
|
2295
|
+
renderItem: customRenderItem,
|
|
2296
|
+
flatListProps
|
|
2297
|
+
} = t0;
|
|
2298
|
+
const calendarInitialScrollToActiveRange = t1 === void 0 ? true : t1;
|
|
2299
|
+
const calendarPastScrollRangeInMonths = t2 === void 0 ? 12 : t2;
|
|
2300
|
+
const calendarFutureScrollRangeInMonths = t3 === void 0 ? 12 : t3;
|
|
2301
|
+
const calendarFirstDayOfWeek = t4 === void 0 ? "sunday" : t4;
|
|
2302
|
+
const calendarSpacing = t5 === void 0 ? 20 : t5;
|
|
2303
|
+
const calendarRowVerticalSpacing = t6 === void 0 ? 8 : t6;
|
|
2304
|
+
const calendarMonthHeaderHeight = t7 === void 0 ? 20 : t7;
|
|
2305
|
+
const calendarDayHeight = t8 === void 0 ? 32 : t8;
|
|
2306
|
+
const calendarAdditionalHeight = t9 === void 0 ? 0 : t9;
|
|
2307
|
+
let t10;
|
|
2308
|
+
let t11;
|
|
2309
|
+
if ($[0] !== calendarActiveDateRanges || $[1] !== calendarInstanceId) {
|
|
2310
|
+
t10 = () => {
|
|
2311
|
+
activeDateRangesStore.setRanges(calendarInstanceId != null ? calendarInstanceId : "legend-calendar-default-instance", calendarActiveDateRanges != null ? calendarActiveDateRanges : []);
|
|
2312
|
+
};
|
|
2313
|
+
t11 = [calendarActiveDateRanges, calendarInstanceId];
|
|
2314
|
+
$[0] = calendarActiveDateRanges;
|
|
2315
|
+
$[1] = calendarInstanceId;
|
|
2316
|
+
$[2] = t10;
|
|
2317
|
+
$[3] = t11;
|
|
2318
|
+
} else {
|
|
2319
|
+
t10 = $[2];
|
|
2320
|
+
t11 = $[3];
|
|
2321
|
+
}
|
|
2322
|
+
useEffect2(t10, t11);
|
|
2323
|
+
let t12;
|
|
2324
|
+
if ($[4] !== CalendarPressableComponent || $[5] !== calendarColorScheme || $[6] !== calendarDayHeight || $[7] !== calendarDisabledDateIds || $[8] !== calendarFirstDayOfWeek || $[9] !== calendarFormatLocale || $[10] !== calendarInstanceId || $[11] !== calendarMaxDateId || $[12] !== calendarMinDateId || $[13] !== calendarMonthHeaderHeight || $[14] !== calendarRowHorizontalSpacing || $[15] !== calendarRowVerticalSpacing || $[16] !== calendarWeekHeaderHeightProp || $[17] !== getCalendarDayFormat || $[18] !== getCalendarMonthFormat || $[19] !== getCalendarWeekDayFormat || $[20] !== onCalendarDayPress || $[21] !== theme) {
|
|
2325
|
+
t12 = buildCalendarConfig(calendarColorScheme, calendarDayHeight, calendarDisabledDateIds, calendarFirstDayOfWeek, calendarFormatLocale, calendarInstanceId, calendarMaxDateId, calendarMinDateId, calendarMonthHeaderHeight, calendarRowHorizontalSpacing, calendarRowVerticalSpacing, calendarWeekHeaderHeightProp, getCalendarDayFormat, getCalendarMonthFormat, getCalendarWeekDayFormat, onCalendarDayPress, theme, CalendarPressableComponent);
|
|
2326
|
+
$[4] = CalendarPressableComponent;
|
|
2327
|
+
$[5] = calendarColorScheme;
|
|
2328
|
+
$[6] = calendarDayHeight;
|
|
2329
|
+
$[7] = calendarDisabledDateIds;
|
|
2330
|
+
$[8] = calendarFirstDayOfWeek;
|
|
2331
|
+
$[9] = calendarFormatLocale;
|
|
2332
|
+
$[10] = calendarInstanceId;
|
|
2333
|
+
$[11] = calendarMaxDateId;
|
|
2334
|
+
$[12] = calendarMinDateId;
|
|
2335
|
+
$[13] = calendarMonthHeaderHeight;
|
|
2336
|
+
$[14] = calendarRowHorizontalSpacing;
|
|
2337
|
+
$[15] = calendarRowVerticalSpacing;
|
|
2338
|
+
$[16] = calendarWeekHeaderHeightProp;
|
|
2339
|
+
$[17] = getCalendarDayFormat;
|
|
2340
|
+
$[18] = getCalendarMonthFormat;
|
|
2341
|
+
$[19] = getCalendarWeekDayFormat;
|
|
2342
|
+
$[20] = onCalendarDayPress;
|
|
2343
|
+
$[21] = theme;
|
|
2344
|
+
$[22] = t12;
|
|
2345
|
+
} else {
|
|
2346
|
+
t12 = $[22];
|
|
2347
|
+
}
|
|
2348
|
+
const calendarProps = t12;
|
|
2349
|
+
const calendarWeekHeaderHeight = calendarWeekHeaderHeightProp != null ? calendarWeekHeaderHeightProp : calendarDayHeight;
|
|
2350
|
+
let t13;
|
|
2351
|
+
if ($[23] !== calendarFirstDayOfWeek || $[24] !== calendarFutureScrollRangeInMonths || $[25] !== calendarInitialMonthId || $[26] !== calendarMaxDateId || $[27] !== calendarMinDateId || $[28] !== calendarPastScrollRangeInMonths) {
|
|
2352
|
+
t13 = {
|
|
2353
|
+
calendarFirstDayOfWeek,
|
|
2354
|
+
calendarFutureScrollRangeInMonths,
|
|
2355
|
+
calendarPastScrollRangeInMonths,
|
|
2356
|
+
calendarInitialMonthId,
|
|
2357
|
+
calendarMaxDateId,
|
|
2358
|
+
calendarMinDateId
|
|
2359
|
+
};
|
|
2360
|
+
$[23] = calendarFirstDayOfWeek;
|
|
2361
|
+
$[24] = calendarFutureScrollRangeInMonths;
|
|
2362
|
+
$[25] = calendarInitialMonthId;
|
|
2363
|
+
$[26] = calendarMaxDateId;
|
|
2364
|
+
$[27] = calendarMinDateId;
|
|
2365
|
+
$[28] = calendarPastScrollRangeInMonths;
|
|
2366
|
+
$[29] = t13;
|
|
2367
|
+
} else {
|
|
2368
|
+
t13 = $[29];
|
|
2369
|
+
}
|
|
2093
2370
|
const {
|
|
2094
2371
|
initialMonthIndex,
|
|
2095
2372
|
monthList,
|
|
2096
2373
|
appendMonths,
|
|
2097
2374
|
prependMonths,
|
|
2098
2375
|
addMissingMonths
|
|
2099
|
-
} = useCalendarList(
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
if ($[0] !== firstRange.startId) {
|
|
2113
|
-
const startDate = fromDateId(firstRange.startId);
|
|
2114
|
-
t112 = toDateId(startOfMonth(startDate));
|
|
2115
|
-
$[0] = firstRange.startId;
|
|
2116
|
-
$[1] = t112;
|
|
2117
|
-
} else {
|
|
2118
|
-
t112 = $[1];
|
|
2119
|
-
}
|
|
2120
|
-
const monthId = t112;
|
|
2121
|
-
let t122;
|
|
2122
|
-
if ($[2] !== monthId || $[3] !== monthList) {
|
|
2123
|
-
let t132;
|
|
2124
|
-
if ($[5] !== monthId) {
|
|
2125
|
-
t132 = (month) => month.id === monthId;
|
|
2126
|
-
$[5] = monthId;
|
|
2127
|
-
$[6] = t132;
|
|
2128
|
-
} else {
|
|
2129
|
-
t132 = $[6];
|
|
2376
|
+
} = useCalendarList(t13);
|
|
2377
|
+
let t14;
|
|
2378
|
+
if ($[30] !== calendarActiveDateRanges || $[31] !== calendarInitialScrollToActiveRange || $[32] !== initialMonthIndex || $[33] !== monthList) {
|
|
2379
|
+
t14 = () => {
|
|
2380
|
+
if (calendarInitialScrollToActiveRange && calendarActiveDateRanges) {
|
|
2381
|
+
const firstRange = calendarActiveDateRanges[0];
|
|
2382
|
+
if (firstRange == null ? void 0 : firstRange.startId) {
|
|
2383
|
+
const startDate = fromDateId(firstRange.startId);
|
|
2384
|
+
const monthId = toDateId(startOfMonth(startDate));
|
|
2385
|
+
const monthIndex = monthList.findIndex((month) => month.id === monthId);
|
|
2386
|
+
if (monthIndex !== -1) {
|
|
2387
|
+
return monthIndex;
|
|
2388
|
+
}
|
|
2130
2389
|
}
|
|
2131
|
-
t122 = monthList.findIndex(t132);
|
|
2132
|
-
$[2] = monthId;
|
|
2133
|
-
$[3] = monthList;
|
|
2134
|
-
$[4] = t122;
|
|
2135
|
-
} else {
|
|
2136
|
-
t122 = $[4];
|
|
2137
|
-
}
|
|
2138
|
-
const monthIndex = t122;
|
|
2139
|
-
if (monthIndex !== -1) {
|
|
2140
|
-
computedInitialScrollIndex = monthIndex;
|
|
2141
2390
|
}
|
|
2142
|
-
|
|
2391
|
+
return initialMonthIndex;
|
|
2392
|
+
};
|
|
2393
|
+
$[30] = calendarActiveDateRanges;
|
|
2394
|
+
$[31] = calendarInitialScrollToActiveRange;
|
|
2395
|
+
$[32] = initialMonthIndex;
|
|
2396
|
+
$[33] = monthList;
|
|
2397
|
+
$[34] = t14;
|
|
2398
|
+
} else {
|
|
2399
|
+
t14 = $[34];
|
|
2143
2400
|
}
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2401
|
+
const [computedInitialScrollIndex] = useState2(t14);
|
|
2402
|
+
let t15;
|
|
2403
|
+
if ($[35] !== calendarProps || $[36] !== customRenderItem || $[37] !== monthList) {
|
|
2404
|
+
t15 = customRenderItem ? monthList.map((month_0) => __spreadProps(__spreadValues({}, month_0), {
|
|
2405
|
+
calendarProps
|
|
2406
|
+
})) : monthList;
|
|
2407
|
+
$[35] = calendarProps;
|
|
2408
|
+
$[36] = customRenderItem;
|
|
2409
|
+
$[37] = monthList;
|
|
2410
|
+
$[38] = t15;
|
|
2411
|
+
} else {
|
|
2412
|
+
t15 = $[38];
|
|
2413
|
+
}
|
|
2414
|
+
const listData = t15;
|
|
2415
|
+
let t16;
|
|
2416
|
+
if ($[39] !== appendMonths || $[40] !== calendarFutureScrollRangeInMonths || $[41] !== onEndReached) {
|
|
2417
|
+
t16 = (info) => {
|
|
2150
2418
|
appendMonths(calendarFutureScrollRangeInMonths);
|
|
2151
2419
|
onEndReached == null ? void 0 : onEndReached(info);
|
|
2152
2420
|
};
|
|
2153
|
-
$[
|
|
2154
|
-
$[
|
|
2155
|
-
$[
|
|
2156
|
-
$[
|
|
2421
|
+
$[39] = appendMonths;
|
|
2422
|
+
$[40] = calendarFutureScrollRangeInMonths;
|
|
2423
|
+
$[41] = onEndReached;
|
|
2424
|
+
$[42] = t16;
|
|
2157
2425
|
} else {
|
|
2158
|
-
|
|
2426
|
+
t16 = $[42];
|
|
2159
2427
|
}
|
|
2160
|
-
const handleOnEndReached =
|
|
2161
|
-
let
|
|
2162
|
-
if ($[
|
|
2163
|
-
|
|
2428
|
+
const handleOnEndReached = t16;
|
|
2429
|
+
let t17;
|
|
2430
|
+
if ($[43] !== calendarPastScrollRangeInMonths || $[44] !== onStartReached || $[45] !== prependMonths) {
|
|
2431
|
+
t17 = (info_0) => {
|
|
2164
2432
|
prependMonths(calendarPastScrollRangeInMonths);
|
|
2165
2433
|
onStartReached == null ? void 0 : onStartReached(info_0);
|
|
2166
2434
|
};
|
|
2167
|
-
$[
|
|
2168
|
-
$[
|
|
2169
|
-
$[
|
|
2170
|
-
$[
|
|
2435
|
+
$[43] = calendarPastScrollRangeInMonths;
|
|
2436
|
+
$[44] = onStartReached;
|
|
2437
|
+
$[45] = prependMonths;
|
|
2438
|
+
$[46] = t17;
|
|
2171
2439
|
} else {
|
|
2172
|
-
|
|
2440
|
+
t17 = $[46];
|
|
2173
2441
|
}
|
|
2174
|
-
const handleOnStartReached =
|
|
2175
|
-
let
|
|
2176
|
-
if ($[
|
|
2177
|
-
|
|
2442
|
+
const handleOnStartReached = t17;
|
|
2443
|
+
let t18;
|
|
2444
|
+
if ($[47] !== addMissingMonths || $[48] !== calendarAdditionalHeight || $[49] !== calendarDayHeight || $[50] !== calendarMonthHeaderHeight || $[51] !== calendarRowVerticalSpacing || $[52] !== calendarSpacing || $[53] !== calendarWeekHeaderHeight || $[54] !== monthList) {
|
|
2445
|
+
t18 = (date) => {
|
|
2178
2446
|
const monthId_0 = toDateId(startOfMonth(date));
|
|
2179
2447
|
let baseMonthList = monthList;
|
|
2180
2448
|
let index = baseMonthList.findIndex((month_1) => month_1.id === monthId_0);
|
|
@@ -2195,88 +2463,88 @@ function CalendarList(t0) {
|
|
|
2195
2463
|
return acc + currentHeight;
|
|
2196
2464
|
}, 0);
|
|
2197
2465
|
};
|
|
2198
|
-
$[
|
|
2199
|
-
$[
|
|
2200
|
-
$[
|
|
2201
|
-
$[
|
|
2202
|
-
$[
|
|
2203
|
-
$[
|
|
2204
|
-
$[
|
|
2205
|
-
$[
|
|
2206
|
-
$[
|
|
2207
|
-
} else {
|
|
2208
|
-
|
|
2209
|
-
}
|
|
2210
|
-
const getScrollOffsetForMonth =
|
|
2466
|
+
$[47] = addMissingMonths;
|
|
2467
|
+
$[48] = calendarAdditionalHeight;
|
|
2468
|
+
$[49] = calendarDayHeight;
|
|
2469
|
+
$[50] = calendarMonthHeaderHeight;
|
|
2470
|
+
$[51] = calendarRowVerticalSpacing;
|
|
2471
|
+
$[52] = calendarSpacing;
|
|
2472
|
+
$[53] = calendarWeekHeaderHeight;
|
|
2473
|
+
$[54] = monthList;
|
|
2474
|
+
$[55] = t18;
|
|
2475
|
+
} else {
|
|
2476
|
+
t18 = $[55];
|
|
2477
|
+
}
|
|
2478
|
+
const getScrollOffsetForMonth = t18;
|
|
2211
2479
|
const legendListRef = useRef(null);
|
|
2212
|
-
let
|
|
2213
|
-
if ($[
|
|
2214
|
-
|
|
2215
|
-
scrollToMonth(date_0, animated,
|
|
2480
|
+
let t19;
|
|
2481
|
+
if ($[56] !== calendarDayHeight || $[57] !== calendarFirstDayOfWeek || $[58] !== calendarRowVerticalSpacing || $[59] !== calendarWeekHeaderHeight || $[60] !== getScrollOffsetForMonth) {
|
|
2482
|
+
t19 = () => ({
|
|
2483
|
+
scrollToMonth(date_0, animated, t202) {
|
|
2216
2484
|
const {
|
|
2217
|
-
additionalOffset:
|
|
2218
|
-
} =
|
|
2485
|
+
additionalOffset: t212
|
|
2486
|
+
} = t202 === void 0 ? {
|
|
2219
2487
|
additionalOffset: 0
|
|
2220
|
-
} :
|
|
2221
|
-
const additionalOffset =
|
|
2488
|
+
} : t202;
|
|
2489
|
+
const additionalOffset = t212 === void 0 ? 0 : t212;
|
|
2222
2490
|
setTimeout(() => {
|
|
2223
|
-
var
|
|
2224
|
-
(
|
|
2491
|
+
var _a;
|
|
2492
|
+
(_a = legendListRef.current) == null ? void 0 : _a.scrollToOffset({
|
|
2225
2493
|
offset: getScrollOffsetForMonth(date_0) + additionalOffset,
|
|
2226
2494
|
animated
|
|
2227
2495
|
});
|
|
2228
2496
|
}, 0);
|
|
2229
2497
|
},
|
|
2230
|
-
scrollToDate(date_1, animated_0,
|
|
2231
|
-
var
|
|
2498
|
+
scrollToDate(date_1, animated_0, t222) {
|
|
2499
|
+
var _a;
|
|
2232
2500
|
const {
|
|
2233
|
-
additionalOffset:
|
|
2234
|
-
} =
|
|
2501
|
+
additionalOffset: t232
|
|
2502
|
+
} = t222 === void 0 ? {
|
|
2235
2503
|
additionalOffset: 0
|
|
2236
|
-
} :
|
|
2237
|
-
const additionalOffset_0 =
|
|
2504
|
+
} : t222;
|
|
2505
|
+
const additionalOffset_0 = t232 === void 0 ? 0 : t232;
|
|
2238
2506
|
const currentMonthOffset = getScrollOffsetForMonth(date_1);
|
|
2239
2507
|
const weekOfMonthIndex = getWeekOfMonth(date_1, calendarFirstDayOfWeek);
|
|
2240
2508
|
const rowHeight = calendarDayHeight + calendarRowVerticalSpacing;
|
|
2241
2509
|
let weekOffset = calendarWeekHeaderHeight + rowHeight * weekOfMonthIndex;
|
|
2242
2510
|
weekOffset = weekOffset - calendarRowVerticalSpacing;
|
|
2243
|
-
(
|
|
2511
|
+
(_a = legendListRef.current) == null ? void 0 : _a.scrollToOffset({
|
|
2244
2512
|
offset: currentMonthOffset + weekOffset + additionalOffset_0,
|
|
2245
2513
|
animated: animated_0
|
|
2246
2514
|
});
|
|
2247
2515
|
},
|
|
2248
2516
|
scrollToOffset(offset, animated_1) {
|
|
2249
|
-
var
|
|
2250
|
-
(
|
|
2517
|
+
var _a;
|
|
2518
|
+
(_a = legendListRef.current) == null ? void 0 : _a.scrollToOffset({
|
|
2251
2519
|
offset,
|
|
2252
2520
|
animated: animated_1
|
|
2253
2521
|
});
|
|
2254
2522
|
}
|
|
2255
2523
|
});
|
|
2256
|
-
$[
|
|
2257
|
-
$[
|
|
2258
|
-
$[
|
|
2259
|
-
$[
|
|
2260
|
-
$[
|
|
2261
|
-
$[
|
|
2262
|
-
} else {
|
|
2263
|
-
|
|
2264
|
-
}
|
|
2265
|
-
useImperativeHandle(ref,
|
|
2266
|
-
let
|
|
2267
|
-
if ($[
|
|
2268
|
-
|
|
2524
|
+
$[56] = calendarDayHeight;
|
|
2525
|
+
$[57] = calendarFirstDayOfWeek;
|
|
2526
|
+
$[58] = calendarRowVerticalSpacing;
|
|
2527
|
+
$[59] = calendarWeekHeaderHeight;
|
|
2528
|
+
$[60] = getScrollOffsetForMonth;
|
|
2529
|
+
$[61] = t19;
|
|
2530
|
+
} else {
|
|
2531
|
+
t19 = $[61];
|
|
2532
|
+
}
|
|
2533
|
+
useImperativeHandle(ref, t19);
|
|
2534
|
+
let t20;
|
|
2535
|
+
if ($[62] !== calendarSpacing) {
|
|
2536
|
+
t20 = {
|
|
2269
2537
|
paddingBottom: calendarSpacing
|
|
2270
2538
|
};
|
|
2271
|
-
$[
|
|
2272
|
-
$[
|
|
2539
|
+
$[62] = calendarSpacing;
|
|
2540
|
+
$[63] = t20;
|
|
2273
2541
|
} else {
|
|
2274
|
-
|
|
2542
|
+
t20 = $[63];
|
|
2275
2543
|
}
|
|
2276
|
-
const calendarContainerStyle =
|
|
2277
|
-
let
|
|
2278
|
-
if ($[
|
|
2279
|
-
|
|
2544
|
+
const calendarContainerStyle = t20;
|
|
2545
|
+
let t21;
|
|
2546
|
+
if ($[64] !== calendarAdditionalHeight || $[65] !== calendarDayHeight || $[66] !== calendarMonthHeaderHeight || $[67] !== calendarRowVerticalSpacing || $[68] !== calendarSpacing || $[69] !== calendarWeekHeaderHeight) {
|
|
2547
|
+
t21 = (item) => getHeightForMonth({
|
|
2280
2548
|
calendarMonth: item,
|
|
2281
2549
|
calendarSpacing,
|
|
2282
2550
|
calendarDayHeight,
|
|
@@ -2285,41 +2553,43 @@ function CalendarList(t0) {
|
|
|
2285
2553
|
calendarWeekHeaderHeight,
|
|
2286
2554
|
calendarAdditionalHeight
|
|
2287
2555
|
});
|
|
2288
|
-
$[
|
|
2289
|
-
$[
|
|
2290
|
-
$[
|
|
2291
|
-
$[
|
|
2292
|
-
$[
|
|
2293
|
-
$[
|
|
2294
|
-
$[
|
|
2295
|
-
} else {
|
|
2296
|
-
|
|
2297
|
-
}
|
|
2298
|
-
const getFixedItemSize =
|
|
2299
|
-
let
|
|
2300
|
-
if ($[
|
|
2301
|
-
|
|
2556
|
+
$[64] = calendarAdditionalHeight;
|
|
2557
|
+
$[65] = calendarDayHeight;
|
|
2558
|
+
$[66] = calendarMonthHeaderHeight;
|
|
2559
|
+
$[67] = calendarRowVerticalSpacing;
|
|
2560
|
+
$[68] = calendarSpacing;
|
|
2561
|
+
$[69] = calendarWeekHeaderHeight;
|
|
2562
|
+
$[70] = t21;
|
|
2563
|
+
} else {
|
|
2564
|
+
t21 = $[70];
|
|
2565
|
+
}
|
|
2566
|
+
const getFixedItemSize = t21;
|
|
2567
|
+
let t22;
|
|
2568
|
+
if ($[71] !== calendarContainerStyle || $[72] !== onCalendarDayPress) {
|
|
2569
|
+
t22 = (t232) => {
|
|
2302
2570
|
const {
|
|
2303
2571
|
item: item_0
|
|
2304
|
-
} =
|
|
2572
|
+
} = t232;
|
|
2305
2573
|
return /* @__PURE__ */ _jsx10(View7, {
|
|
2306
2574
|
style: calendarContainerStyle,
|
|
2307
|
-
children: /* @__PURE__ */ _jsx10(Calendar,
|
|
2308
|
-
calendarMonthId: item_0.id
|
|
2309
|
-
|
|
2575
|
+
children: /* @__PURE__ */ _jsx10(Calendar, {
|
|
2576
|
+
calendarMonthId: item_0.id,
|
|
2577
|
+
onCalendarDayPress
|
|
2578
|
+
})
|
|
2310
2579
|
});
|
|
2311
2580
|
};
|
|
2312
|
-
$[
|
|
2313
|
-
$[
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
const
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2581
|
+
$[71] = calendarContainerStyle;
|
|
2582
|
+
$[72] = onCalendarDayPress;
|
|
2583
|
+
$[73] = t22;
|
|
2584
|
+
} else {
|
|
2585
|
+
t22 = $[73];
|
|
2586
|
+
}
|
|
2587
|
+
const handleRenderItem = t22;
|
|
2588
|
+
const t23 = customRenderItem != null ? customRenderItem : handleRenderItem;
|
|
2589
|
+
let t24;
|
|
2590
|
+
if ($[74] !== computedInitialScrollIndex || $[75] !== flatListProps || $[76] !== getFixedItemSize || $[77] !== handleOnEndReached || $[78] !== handleOnStartReached || $[79] !== listData || $[80] !== t23) {
|
|
2591
|
+
t24 = /* @__PURE__ */ _jsx10(LegendList, __spreadValues({
|
|
2592
|
+
data: listData,
|
|
2323
2593
|
drawDistance: 560,
|
|
2324
2594
|
estimatedItemSize: 273,
|
|
2325
2595
|
getFixedItemSize,
|
|
@@ -2328,27 +2598,36 @@ function CalendarList(t0) {
|
|
|
2328
2598
|
maintainVisibleContentPosition: true,
|
|
2329
2599
|
onEndReached: handleOnEndReached,
|
|
2330
2600
|
onStartReached: handleOnStartReached,
|
|
2331
|
-
onViewableItemsChanged: handleViewableItemsChanged,
|
|
2332
2601
|
recycleItems: true,
|
|
2333
2602
|
ref: legendListRef,
|
|
2334
|
-
renderItem:
|
|
2603
|
+
renderItem: t23,
|
|
2335
2604
|
showsVerticalScrollIndicator: false,
|
|
2336
2605
|
style: styles8.container
|
|
2337
2606
|
}, flatListProps));
|
|
2338
|
-
$[
|
|
2339
|
-
$[
|
|
2340
|
-
$[
|
|
2341
|
-
$[
|
|
2342
|
-
$[
|
|
2343
|
-
$[
|
|
2344
|
-
$[
|
|
2345
|
-
$[
|
|
2346
|
-
} else {
|
|
2347
|
-
|
|
2348
|
-
}
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2607
|
+
$[74] = computedInitialScrollIndex;
|
|
2608
|
+
$[75] = flatListProps;
|
|
2609
|
+
$[76] = getFixedItemSize;
|
|
2610
|
+
$[77] = handleOnEndReached;
|
|
2611
|
+
$[78] = handleOnStartReached;
|
|
2612
|
+
$[79] = listData;
|
|
2613
|
+
$[80] = t23;
|
|
2614
|
+
$[81] = t24;
|
|
2615
|
+
} else {
|
|
2616
|
+
t24 = $[81];
|
|
2617
|
+
}
|
|
2618
|
+
let t25;
|
|
2619
|
+
if ($[82] !== calendarProps || $[83] !== t24) {
|
|
2620
|
+
t25 = /* @__PURE__ */ _jsx10(CalendarListConfigProvider, {
|
|
2621
|
+
value: calendarProps,
|
|
2622
|
+
children: t24
|
|
2623
|
+
});
|
|
2624
|
+
$[82] = calendarProps;
|
|
2625
|
+
$[83] = t24;
|
|
2626
|
+
$[84] = t25;
|
|
2627
|
+
} else {
|
|
2628
|
+
t25 = $[84];
|
|
2629
|
+
}
|
|
2630
|
+
return t25;
|
|
2352
2631
|
}
|
|
2353
2632
|
var styles8 = StyleSheet8.create({
|
|
2354
2633
|
container: {
|
|
@@ -2377,7 +2656,7 @@ var Calendar3 = CalendarWithNamespace;
|
|
|
2377
2656
|
|
|
2378
2657
|
// src/hooks/useDateRange.ts
|
|
2379
2658
|
import { c as _c13 } from "react/compiler-runtime";
|
|
2380
|
-
import { useState as
|
|
2659
|
+
import { useState as useState3 } from "react";
|
|
2381
2660
|
var useDateRange = (t0) => {
|
|
2382
2661
|
const $ = _c13(10);
|
|
2383
2662
|
let t1;
|
|
@@ -2392,7 +2671,7 @@ var useDateRange = (t0) => {
|
|
|
2392
2671
|
t1 = $[1];
|
|
2393
2672
|
}
|
|
2394
2673
|
const initialDateRange = t1;
|
|
2395
|
-
const [dateRange, setDateRange] =
|
|
2674
|
+
const [dateRange, setDateRange] = useState3(initialDateRange);
|
|
2396
2675
|
let t2;
|
|
2397
2676
|
if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2398
2677
|
t2 = (dateId) => {
|
|
@@ -2484,6 +2763,7 @@ export {
|
|
|
2484
2763
|
toDateId,
|
|
2485
2764
|
useCalendar,
|
|
2486
2765
|
useCalendarList,
|
|
2766
|
+
useCalendarListConfig,
|
|
2487
2767
|
useDateRange,
|
|
2488
2768
|
useOptimizedDayMetadata
|
|
2489
2769
|
};
|