@lazerlen/legend-calendar 1.4.1 → 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 +106 -106
- package/dist/index.d.mts +58 -13
- package/dist/index.d.ts +58 -13
- package/dist/index.js +592 -317
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +588 -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/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ __export(index_exports, {
|
|
|
58
58
|
toDateId: () => toDateId,
|
|
59
59
|
useCalendar: () => useCalendar,
|
|
60
60
|
useCalendarList: () => useCalendarList,
|
|
61
|
+
useCalendarListConfig: () => useCalendarListConfig,
|
|
61
62
|
useDateRange: () => useDateRange,
|
|
62
63
|
useOptimizedDayMetadata: () => useOptimizedDayMetadata
|
|
63
64
|
});
|
|
@@ -65,11 +66,10 @@ module.exports = __toCommonJS(index_exports);
|
|
|
65
66
|
|
|
66
67
|
// src/components/Calendar.tsx
|
|
67
68
|
var import_compiler_runtime10 = require("react/compiler-runtime");
|
|
68
|
-
var
|
|
69
|
+
var import_react5 = require("react");
|
|
69
70
|
|
|
70
71
|
// src/components/CalendarItemDay.tsx
|
|
71
72
|
var import_compiler_runtime3 = require("react/compiler-runtime");
|
|
72
|
-
var import_react4 = require("react");
|
|
73
73
|
var import_react_native2 = require("react-native");
|
|
74
74
|
|
|
75
75
|
// src/components/Text.tsx
|
|
@@ -623,7 +623,7 @@ var buildBaseStyles = (theme) => {
|
|
|
623
623
|
}
|
|
624
624
|
};
|
|
625
625
|
};
|
|
626
|
-
var CalendarItemDay =
|
|
626
|
+
var CalendarItemDay = function CalendarItemDay2(t0) {
|
|
627
627
|
const $ = (0, import_compiler_runtime3.c)(22);
|
|
628
628
|
const {
|
|
629
629
|
onPress,
|
|
@@ -789,8 +789,8 @@ var CalendarItemDay = /* @__PURE__ */ (0, import_react4.memo)(function CalendarI
|
|
|
789
789
|
t7 = $[21];
|
|
790
790
|
}
|
|
791
791
|
return t7;
|
|
792
|
-
}
|
|
793
|
-
var CalendarItemDayContainer =
|
|
792
|
+
};
|
|
793
|
+
var CalendarItemDayContainer = function CalendarItemDayContainer2(t0) {
|
|
794
794
|
const $ = (0, import_compiler_runtime3.c)(29);
|
|
795
795
|
const {
|
|
796
796
|
children,
|
|
@@ -917,8 +917,8 @@ var CalendarItemDayContainer = /* @__PURE__ */ (0, import_react4.memo)(function
|
|
|
917
917
|
t10 = $[28];
|
|
918
918
|
}
|
|
919
919
|
return t10;
|
|
920
|
-
}
|
|
921
|
-
var CalendarItemDayWithContainer =
|
|
920
|
+
};
|
|
921
|
+
var CalendarItemDayWithContainer = function CalendarItemDayWithContainer2(t0) {
|
|
922
922
|
const $ = (0, import_compiler_runtime3.c)(14);
|
|
923
923
|
const {
|
|
924
924
|
children,
|
|
@@ -975,11 +975,10 @@ var CalendarItemDayWithContainer = /* @__PURE__ */ (0, import_react4.memo)(funct
|
|
|
975
975
|
t3 = $[13];
|
|
976
976
|
}
|
|
977
977
|
return t3;
|
|
978
|
-
}
|
|
978
|
+
};
|
|
979
979
|
|
|
980
980
|
// src/components/CalendarItemEmpty.tsx
|
|
981
981
|
var import_compiler_runtime4 = require("react/compiler-runtime");
|
|
982
|
-
var import_react5 = require("react");
|
|
983
982
|
var import_react_native3 = require("react-native");
|
|
984
983
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
985
984
|
var styles2 = import_react_native3.StyleSheet.create({
|
|
@@ -988,7 +987,7 @@ var styles2 = import_react_native3.StyleSheet.create({
|
|
|
988
987
|
flex: 1
|
|
989
988
|
}
|
|
990
989
|
});
|
|
991
|
-
var CalendarItemEmpty =
|
|
990
|
+
var CalendarItemEmpty = function CalendarItemEmpty2(props) {
|
|
992
991
|
const $ = (0, import_compiler_runtime4.c)(5);
|
|
993
992
|
const {
|
|
994
993
|
height,
|
|
@@ -1018,11 +1017,10 @@ var CalendarItemEmpty = /* @__PURE__ */ (0, import_react5.memo)(function Calenda
|
|
|
1018
1017
|
t2 = $[4];
|
|
1019
1018
|
}
|
|
1020
1019
|
return t2;
|
|
1021
|
-
}
|
|
1020
|
+
};
|
|
1022
1021
|
|
|
1023
1022
|
// src/components/CalendarItemWeekName.tsx
|
|
1024
1023
|
var import_compiler_runtime5 = require("react/compiler-runtime");
|
|
1025
|
-
var import_react6 = require("react");
|
|
1026
1024
|
var import_react_native4 = require("react-native");
|
|
1027
1025
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1028
1026
|
var styles3 = import_react_native4.StyleSheet.create({
|
|
@@ -1034,7 +1032,7 @@ var styles3 = import_react_native4.StyleSheet.create({
|
|
|
1034
1032
|
},
|
|
1035
1033
|
content: {}
|
|
1036
1034
|
});
|
|
1037
|
-
var CalendarItemWeekName =
|
|
1035
|
+
var CalendarItemWeekName = function CalendarItemWeekName2(t0) {
|
|
1038
1036
|
const $ = (0, import_compiler_runtime5.c)(18);
|
|
1039
1037
|
const {
|
|
1040
1038
|
children,
|
|
@@ -1115,11 +1113,18 @@ var CalendarItemWeekName = /* @__PURE__ */ (0, import_react6.memo)(function Cale
|
|
|
1115
1113
|
t9 = $[17];
|
|
1116
1114
|
}
|
|
1117
1115
|
return t9;
|
|
1118
|
-
}
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
// src/components/CalendarListConfigContext.tsx
|
|
1119
|
+
var import_react4 = require("react");
|
|
1120
|
+
var CalendarListConfigContext = /* @__PURE__ */ (0, import_react4.createContext)(null);
|
|
1121
|
+
var CalendarListConfigProvider = CalendarListConfigContext.Provider;
|
|
1122
|
+
var useCalendarListConfig = () => {
|
|
1123
|
+
return (0, import_react4.useContext)(CalendarListConfigContext);
|
|
1124
|
+
};
|
|
1119
1125
|
|
|
1120
1126
|
// src/components/CalendarRowMonth.tsx
|
|
1121
1127
|
var import_compiler_runtime6 = require("react/compiler-runtime");
|
|
1122
|
-
var import_react7 = require("react");
|
|
1123
1128
|
var import_react_native5 = require("react-native");
|
|
1124
1129
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1125
1130
|
var styles4 = import_react_native5.StyleSheet.create({
|
|
@@ -1133,7 +1138,7 @@ var styles4 = import_react_native5.StyleSheet.create({
|
|
|
1133
1138
|
width: "100%"
|
|
1134
1139
|
}
|
|
1135
1140
|
});
|
|
1136
|
-
var CalendarRowMonth =
|
|
1141
|
+
var CalendarRowMonth = function CalendarRowMonth2(t0) {
|
|
1137
1142
|
const $ = (0, import_compiler_runtime6.c)(16);
|
|
1138
1143
|
const {
|
|
1139
1144
|
children,
|
|
@@ -1208,11 +1213,10 @@ var CalendarRowMonth = /* @__PURE__ */ (0, import_react7.memo)(function Calendar
|
|
|
1208
1213
|
t8 = $[15];
|
|
1209
1214
|
}
|
|
1210
1215
|
return t8;
|
|
1211
|
-
}
|
|
1216
|
+
};
|
|
1212
1217
|
|
|
1213
1218
|
// src/components/CalendarRowWeek.tsx
|
|
1214
1219
|
var import_compiler_runtime8 = require("react/compiler-runtime");
|
|
1215
|
-
var import_react8 = require("react");
|
|
1216
1220
|
var import_react_native7 = require("react-native");
|
|
1217
1221
|
|
|
1218
1222
|
// src/components/HStack.tsx
|
|
@@ -1376,7 +1380,7 @@ var styles6 = import_react_native7.StyleSheet.create({
|
|
|
1376
1380
|
width: "100%"
|
|
1377
1381
|
}
|
|
1378
1382
|
});
|
|
1379
|
-
var CalendarRowWeek =
|
|
1383
|
+
var CalendarRowWeek = function CalendarRowWeek2(t0) {
|
|
1380
1384
|
var _a;
|
|
1381
1385
|
const $ = (0, import_compiler_runtime8.c)(8);
|
|
1382
1386
|
const {
|
|
@@ -1420,7 +1424,7 @@ var CalendarRowWeek = /* @__PURE__ */ (0, import_react8.memo)(function CalendarR
|
|
|
1420
1424
|
t4 = $[7];
|
|
1421
1425
|
}
|
|
1422
1426
|
return t4;
|
|
1423
|
-
}
|
|
1427
|
+
};
|
|
1424
1428
|
|
|
1425
1429
|
// src/components/VStack.tsx
|
|
1426
1430
|
var import_compiler_runtime9 = require("react/compiler-runtime");
|
|
@@ -1479,7 +1483,7 @@ var uppercaseFirstLetter = (value) => value.charAt(0).toUpperCase() + value.slic
|
|
|
1479
1483
|
|
|
1480
1484
|
// src/components/Calendar.tsx
|
|
1481
1485
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1482
|
-
var BaseCalendar =
|
|
1486
|
+
var BaseCalendar = function BaseCalendar2(props) {
|
|
1483
1487
|
var _a;
|
|
1484
1488
|
const $ = (0, import_compiler_runtime10.c)(51);
|
|
1485
1489
|
let CalendarPressableComponent;
|
|
@@ -1682,17 +1686,28 @@ var BaseCalendar = /* @__PURE__ */ (0, import_react9.memo)(function BaseCalendar
|
|
|
1682
1686
|
t13 = $[50];
|
|
1683
1687
|
}
|
|
1684
1688
|
return t13;
|
|
1685
|
-
}
|
|
1686
|
-
var Calendar =
|
|
1689
|
+
};
|
|
1690
|
+
var Calendar = function Calendar2(props) {
|
|
1687
1691
|
var _a;
|
|
1688
|
-
const $ = (0, import_compiler_runtime10.c)(
|
|
1692
|
+
const $ = (0, import_compiler_runtime10.c)(23);
|
|
1693
|
+
const listConfig = useCalendarListConfig();
|
|
1694
|
+
let t0;
|
|
1695
|
+
if ($[0] !== listConfig || $[1] !== props) {
|
|
1696
|
+
t0 = listConfig ? __spreadValues(__spreadValues({}, listConfig), props) : props;
|
|
1697
|
+
$[0] = listConfig;
|
|
1698
|
+
$[1] = props;
|
|
1699
|
+
$[2] = t0;
|
|
1700
|
+
} else {
|
|
1701
|
+
t0 = $[2];
|
|
1702
|
+
}
|
|
1703
|
+
const resolvedProps = t0;
|
|
1689
1704
|
let calendarActiveDateRanges;
|
|
1690
1705
|
let calendarColorScheme;
|
|
1691
1706
|
let calendarInstanceId;
|
|
1692
1707
|
let calendarMonthId;
|
|
1693
1708
|
let otherProps;
|
|
1694
|
-
if ($[
|
|
1695
|
-
_a =
|
|
1709
|
+
if ($[3] !== resolvedProps) {
|
|
1710
|
+
_a = resolvedProps, {
|
|
1696
1711
|
calendarInstanceId,
|
|
1697
1712
|
calendarActiveDateRanges,
|
|
1698
1713
|
calendarMonthId,
|
|
@@ -1703,81 +1718,81 @@ var Calendar = /* @__PURE__ */ (0, import_react9.memo)(function Calendar2(props)
|
|
|
1703
1718
|
"calendarMonthId",
|
|
1704
1719
|
"calendarColorScheme"
|
|
1705
1720
|
]);
|
|
1706
|
-
$[
|
|
1707
|
-
$[
|
|
1708
|
-
$[
|
|
1709
|
-
$[
|
|
1710
|
-
$[
|
|
1711
|
-
$[
|
|
1712
|
-
} else {
|
|
1713
|
-
calendarActiveDateRanges = $[
|
|
1714
|
-
calendarColorScheme = $[
|
|
1715
|
-
calendarInstanceId = $[
|
|
1716
|
-
calendarMonthId = $[
|
|
1717
|
-
otherProps = $[
|
|
1721
|
+
$[3] = resolvedProps;
|
|
1722
|
+
$[4] = calendarActiveDateRanges;
|
|
1723
|
+
$[5] = calendarColorScheme;
|
|
1724
|
+
$[6] = calendarInstanceId;
|
|
1725
|
+
$[7] = calendarMonthId;
|
|
1726
|
+
$[8] = otherProps;
|
|
1727
|
+
} else {
|
|
1728
|
+
calendarActiveDateRanges = $[4];
|
|
1729
|
+
calendarColorScheme = $[5];
|
|
1730
|
+
calendarInstanceId = $[6];
|
|
1731
|
+
calendarMonthId = $[7];
|
|
1732
|
+
otherProps = $[8];
|
|
1718
1733
|
}
|
|
1719
|
-
let
|
|
1720
|
-
if ($[
|
|
1721
|
-
|
|
1734
|
+
let t1;
|
|
1735
|
+
if ($[9] !== calendarActiveDateRanges || $[10] !== calendarInstanceId) {
|
|
1736
|
+
t1 = () => {
|
|
1722
1737
|
if (calendarActiveDateRanges === void 0) {
|
|
1723
1738
|
return;
|
|
1724
1739
|
}
|
|
1725
1740
|
activeDateRangesStore.setRanges(calendarInstanceId != null ? calendarInstanceId : "legend-calendar-default-instance", calendarActiveDateRanges);
|
|
1726
1741
|
};
|
|
1727
|
-
$[6] = calendarActiveDateRanges;
|
|
1728
|
-
$[7] = calendarInstanceId;
|
|
1729
|
-
$[8] = t0;
|
|
1730
|
-
} else {
|
|
1731
|
-
t0 = $[8];
|
|
1732
|
-
}
|
|
1733
|
-
let t1;
|
|
1734
|
-
if ($[9] !== calendarActiveDateRanges || $[10] !== calendarInstanceId || $[11] !== calendarMonthId) {
|
|
1735
|
-
t1 = [calendarActiveDateRanges, calendarInstanceId, calendarMonthId];
|
|
1736
1742
|
$[9] = calendarActiveDateRanges;
|
|
1737
1743
|
$[10] = calendarInstanceId;
|
|
1738
|
-
$[11] =
|
|
1739
|
-
$[12] = t1;
|
|
1744
|
+
$[11] = t1;
|
|
1740
1745
|
} else {
|
|
1741
|
-
t1 = $[
|
|
1746
|
+
t1 = $[11];
|
|
1742
1747
|
}
|
|
1743
|
-
(0, import_react9.useEffect)(t0, t1);
|
|
1744
1748
|
let t2;
|
|
1745
|
-
if ($[
|
|
1746
|
-
t2 =
|
|
1747
|
-
|
|
1748
|
-
calendarMonthId
|
|
1749
|
-
}));
|
|
1749
|
+
if ($[12] !== calendarActiveDateRanges || $[13] !== calendarInstanceId || $[14] !== calendarMonthId) {
|
|
1750
|
+
t2 = [calendarActiveDateRanges, calendarInstanceId, calendarMonthId];
|
|
1751
|
+
$[12] = calendarActiveDateRanges;
|
|
1750
1752
|
$[13] = calendarInstanceId;
|
|
1751
1753
|
$[14] = calendarMonthId;
|
|
1752
|
-
$[15] =
|
|
1753
|
-
$[16] = t2;
|
|
1754
|
+
$[15] = t2;
|
|
1754
1755
|
} else {
|
|
1755
|
-
t2 = $[
|
|
1756
|
+
t2 = $[15];
|
|
1756
1757
|
}
|
|
1758
|
+
(0, import_react5.useEffect)(t1, t2);
|
|
1757
1759
|
let t3;
|
|
1758
|
-
if ($[17] !==
|
|
1759
|
-
t3 = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
});
|
|
1763
|
-
$[
|
|
1764
|
-
$[
|
|
1760
|
+
if ($[16] !== calendarInstanceId || $[17] !== calendarMonthId || $[18] !== otherProps) {
|
|
1761
|
+
t3 = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BaseCalendar, __spreadProps(__spreadValues({}, otherProps), {
|
|
1762
|
+
calendarInstanceId,
|
|
1763
|
+
calendarMonthId
|
|
1764
|
+
}));
|
|
1765
|
+
$[16] = calendarInstanceId;
|
|
1766
|
+
$[17] = calendarMonthId;
|
|
1767
|
+
$[18] = otherProps;
|
|
1765
1768
|
$[19] = t3;
|
|
1766
1769
|
} else {
|
|
1767
1770
|
t3 = $[19];
|
|
1768
1771
|
}
|
|
1769
|
-
|
|
1770
|
-
|
|
1772
|
+
let t4;
|
|
1773
|
+
if ($[20] !== calendarColorScheme || $[21] !== t3) {
|
|
1774
|
+
t4 = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CalendarThemeProvider, {
|
|
1775
|
+
colorScheme: calendarColorScheme,
|
|
1776
|
+
children: t3
|
|
1777
|
+
});
|
|
1778
|
+
$[20] = calendarColorScheme;
|
|
1779
|
+
$[21] = t3;
|
|
1780
|
+
$[22] = t4;
|
|
1781
|
+
} else {
|
|
1782
|
+
t4 = $[22];
|
|
1783
|
+
}
|
|
1784
|
+
return t4;
|
|
1785
|
+
};
|
|
1771
1786
|
|
|
1772
1787
|
// src/components/CalendarList.tsx
|
|
1773
1788
|
var import_compiler_runtime12 = require("react/compiler-runtime");
|
|
1774
1789
|
var import_react_native9 = require("@legendapp/list/react-native");
|
|
1775
|
-
var
|
|
1790
|
+
var import_react7 = require("react");
|
|
1776
1791
|
var import_react_native10 = require("react-native");
|
|
1777
1792
|
|
|
1778
1793
|
// src/hooks/useCalendarList.tsx
|
|
1779
1794
|
var import_compiler_runtime11 = require("react/compiler-runtime");
|
|
1780
|
-
var
|
|
1795
|
+
var import_react6 = require("react");
|
|
1781
1796
|
|
|
1782
1797
|
// src/helpers/functions.ts
|
|
1783
1798
|
function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
@@ -1895,7 +1910,7 @@ var useCalendarList = (t0) => {
|
|
|
1895
1910
|
} else {
|
|
1896
1911
|
t2 = $[9];
|
|
1897
1912
|
}
|
|
1898
|
-
const [monthList, setMonthList] = (0,
|
|
1913
|
+
const [monthList, setMonthList] = (0, import_react6.useState)(t2);
|
|
1899
1914
|
let t3;
|
|
1900
1915
|
if ($[10] !== calendarFirstDayOfWeek || $[11] !== calendarMaxDateId || $[12] !== monthList) {
|
|
1901
1916
|
t3 = (numberOfMonths) => {
|
|
@@ -2028,14 +2043,261 @@ var getHeightForMonth = ({
|
|
|
2028
2043
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2029
2044
|
var LegendList = import_react_native9.LegendList;
|
|
2030
2045
|
var keyExtractor = (month) => month.id;
|
|
2031
|
-
function
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2046
|
+
function buildCalendarConfig(calendarColorScheme, calendarDayHeight, calendarDisabledDateIds, calendarFirstDayOfWeek, calendarFormatLocale, calendarInstanceId, calendarMaxDateId, calendarMinDateId, calendarMonthHeaderHeight, calendarRowHorizontalSpacing, calendarRowVerticalSpacing, calendarWeekHeaderHeightProp, getCalendarDayFormat, getCalendarMonthFormat, getCalendarWeekDayFormat, onCalendarDayPress, theme, CalendarPressableComponent) {
|
|
2047
|
+
const calendarWeekHeaderHeight = calendarWeekHeaderHeightProp != null ? calendarWeekHeaderHeightProp : calendarDayHeight;
|
|
2048
|
+
return {
|
|
2049
|
+
calendarColorScheme,
|
|
2050
|
+
calendarDayHeight,
|
|
2051
|
+
calendarDisabledDateIds,
|
|
2052
|
+
calendarFirstDayOfWeek,
|
|
2053
|
+
calendarFormatLocale,
|
|
2054
|
+
calendarInstanceId,
|
|
2055
|
+
calendarMaxDateId,
|
|
2056
|
+
calendarMinDateId,
|
|
2057
|
+
calendarMonthHeaderHeight,
|
|
2058
|
+
calendarRowHorizontalSpacing,
|
|
2059
|
+
calendarRowVerticalSpacing,
|
|
2060
|
+
calendarWeekHeaderHeight,
|
|
2061
|
+
getCalendarDayFormat,
|
|
2062
|
+
getCalendarMonthFormat,
|
|
2063
|
+
getCalendarWeekDayFormat,
|
|
2064
|
+
onCalendarDayPress,
|
|
2065
|
+
theme,
|
|
2066
|
+
CalendarPressableComponent
|
|
2067
|
+
};
|
|
2068
|
+
}
|
|
2069
|
+
function CalendarList(props) {
|
|
2070
|
+
var _a;
|
|
2071
|
+
const $ = (0, import_compiler_runtime12.c)(62);
|
|
2072
|
+
let CalendarPressableComponent;
|
|
2073
|
+
let calendarActiveDateRanges;
|
|
2074
|
+
let calendarAdditionalHeight;
|
|
2075
|
+
let calendarColorScheme;
|
|
2076
|
+
let calendarDayHeight;
|
|
2077
|
+
let calendarDisabledDateIds;
|
|
2078
|
+
let calendarFirstDayOfWeek;
|
|
2079
|
+
let calendarFormatLocale;
|
|
2080
|
+
let calendarFutureScrollRangeInMonths;
|
|
2081
|
+
let calendarInitialMonthId;
|
|
2082
|
+
let calendarInitialScrollToActiveRange;
|
|
2083
|
+
let calendarInstanceId;
|
|
2084
|
+
let calendarMaxDateId;
|
|
2085
|
+
let calendarMinDateId;
|
|
2086
|
+
let calendarMonthHeaderHeight;
|
|
2087
|
+
let calendarPastScrollRangeInMonths;
|
|
2088
|
+
let calendarRowHorizontalSpacing;
|
|
2089
|
+
let calendarRowVerticalSpacing;
|
|
2090
|
+
let calendarSpacing;
|
|
2091
|
+
let calendarWeekHeaderHeight;
|
|
2092
|
+
let flatListProps;
|
|
2093
|
+
let getCalendarDayFormat;
|
|
2094
|
+
let getCalendarMonthFormat;
|
|
2095
|
+
let getCalendarWeekDayFormat;
|
|
2096
|
+
let onCalendarDayPress;
|
|
2097
|
+
let onEndReached;
|
|
2098
|
+
let onStartReached;
|
|
2099
|
+
let ref;
|
|
2100
|
+
let renderItem;
|
|
2101
|
+
let theme;
|
|
2102
|
+
if ($[0] !== props) {
|
|
2103
|
+
_a = props, {
|
|
2104
|
+
ref,
|
|
2105
|
+
calendarInitialMonthId,
|
|
2106
|
+
calendarInitialScrollToActiveRange,
|
|
2107
|
+
calendarPastScrollRangeInMonths,
|
|
2108
|
+
calendarFutureScrollRangeInMonths,
|
|
2109
|
+
calendarFirstDayOfWeek,
|
|
2110
|
+
calendarFormatLocale,
|
|
2111
|
+
calendarSpacing,
|
|
2112
|
+
calendarRowHorizontalSpacing,
|
|
2113
|
+
calendarRowVerticalSpacing,
|
|
2114
|
+
calendarMonthHeaderHeight,
|
|
2115
|
+
calendarDayHeight,
|
|
2116
|
+
calendarWeekHeaderHeight,
|
|
2117
|
+
calendarAdditionalHeight,
|
|
2118
|
+
calendarColorScheme,
|
|
2119
|
+
theme,
|
|
2120
|
+
onEndReached,
|
|
2121
|
+
onStartReached,
|
|
2122
|
+
calendarActiveDateRanges,
|
|
2123
|
+
calendarDisabledDateIds,
|
|
2124
|
+
calendarInstanceId,
|
|
2125
|
+
calendarMaxDateId,
|
|
2126
|
+
calendarMinDateId,
|
|
2127
|
+
getCalendarDayFormat,
|
|
2128
|
+
getCalendarMonthFormat,
|
|
2129
|
+
getCalendarWeekDayFormat,
|
|
2130
|
+
onCalendarDayPress,
|
|
2131
|
+
CalendarPressableComponent,
|
|
2132
|
+
renderItem
|
|
2133
|
+
} = _a, flatListProps = __objRest(_a, [
|
|
2134
|
+
"ref",
|
|
2135
|
+
"calendarInitialMonthId",
|
|
2136
|
+
"calendarInitialScrollToActiveRange",
|
|
2137
|
+
"calendarPastScrollRangeInMonths",
|
|
2138
|
+
"calendarFutureScrollRangeInMonths",
|
|
2139
|
+
"calendarFirstDayOfWeek",
|
|
2140
|
+
"calendarFormatLocale",
|
|
2141
|
+
"calendarSpacing",
|
|
2142
|
+
"calendarRowHorizontalSpacing",
|
|
2143
|
+
"calendarRowVerticalSpacing",
|
|
2144
|
+
"calendarMonthHeaderHeight",
|
|
2145
|
+
"calendarDayHeight",
|
|
2146
|
+
"calendarWeekHeaderHeight",
|
|
2147
|
+
"calendarAdditionalHeight",
|
|
2148
|
+
"calendarColorScheme",
|
|
2149
|
+
"theme",
|
|
2150
|
+
"onEndReached",
|
|
2151
|
+
"onStartReached",
|
|
2152
|
+
"calendarActiveDateRanges",
|
|
2153
|
+
"calendarDisabledDateIds",
|
|
2154
|
+
"calendarInstanceId",
|
|
2155
|
+
"calendarMaxDateId",
|
|
2156
|
+
"calendarMinDateId",
|
|
2157
|
+
"getCalendarDayFormat",
|
|
2158
|
+
"getCalendarMonthFormat",
|
|
2159
|
+
"getCalendarWeekDayFormat",
|
|
2160
|
+
"onCalendarDayPress",
|
|
2161
|
+
"CalendarPressableComponent",
|
|
2162
|
+
"renderItem"
|
|
2163
|
+
]);
|
|
2164
|
+
$[0] = props;
|
|
2165
|
+
$[1] = CalendarPressableComponent;
|
|
2166
|
+
$[2] = calendarActiveDateRanges;
|
|
2167
|
+
$[3] = calendarAdditionalHeight;
|
|
2168
|
+
$[4] = calendarColorScheme;
|
|
2169
|
+
$[5] = calendarDayHeight;
|
|
2170
|
+
$[6] = calendarDisabledDateIds;
|
|
2171
|
+
$[7] = calendarFirstDayOfWeek;
|
|
2172
|
+
$[8] = calendarFormatLocale;
|
|
2173
|
+
$[9] = calendarFutureScrollRangeInMonths;
|
|
2174
|
+
$[10] = calendarInitialMonthId;
|
|
2175
|
+
$[11] = calendarInitialScrollToActiveRange;
|
|
2176
|
+
$[12] = calendarInstanceId;
|
|
2177
|
+
$[13] = calendarMaxDateId;
|
|
2178
|
+
$[14] = calendarMinDateId;
|
|
2179
|
+
$[15] = calendarMonthHeaderHeight;
|
|
2180
|
+
$[16] = calendarPastScrollRangeInMonths;
|
|
2181
|
+
$[17] = calendarRowHorizontalSpacing;
|
|
2182
|
+
$[18] = calendarRowVerticalSpacing;
|
|
2183
|
+
$[19] = calendarSpacing;
|
|
2184
|
+
$[20] = calendarWeekHeaderHeight;
|
|
2185
|
+
$[21] = flatListProps;
|
|
2186
|
+
$[22] = getCalendarDayFormat;
|
|
2187
|
+
$[23] = getCalendarMonthFormat;
|
|
2188
|
+
$[24] = getCalendarWeekDayFormat;
|
|
2189
|
+
$[25] = onCalendarDayPress;
|
|
2190
|
+
$[26] = onEndReached;
|
|
2191
|
+
$[27] = onStartReached;
|
|
2192
|
+
$[28] = ref;
|
|
2193
|
+
$[29] = renderItem;
|
|
2194
|
+
$[30] = theme;
|
|
2195
|
+
} else {
|
|
2196
|
+
CalendarPressableComponent = $[1];
|
|
2197
|
+
calendarActiveDateRanges = $[2];
|
|
2198
|
+
calendarAdditionalHeight = $[3];
|
|
2199
|
+
calendarColorScheme = $[4];
|
|
2200
|
+
calendarDayHeight = $[5];
|
|
2201
|
+
calendarDisabledDateIds = $[6];
|
|
2202
|
+
calendarFirstDayOfWeek = $[7];
|
|
2203
|
+
calendarFormatLocale = $[8];
|
|
2204
|
+
calendarFutureScrollRangeInMonths = $[9];
|
|
2205
|
+
calendarInitialMonthId = $[10];
|
|
2206
|
+
calendarInitialScrollToActiveRange = $[11];
|
|
2207
|
+
calendarInstanceId = $[12];
|
|
2208
|
+
calendarMaxDateId = $[13];
|
|
2209
|
+
calendarMinDateId = $[14];
|
|
2210
|
+
calendarMonthHeaderHeight = $[15];
|
|
2211
|
+
calendarPastScrollRangeInMonths = $[16];
|
|
2212
|
+
calendarRowHorizontalSpacing = $[17];
|
|
2213
|
+
calendarRowVerticalSpacing = $[18];
|
|
2214
|
+
calendarSpacing = $[19];
|
|
2215
|
+
calendarWeekHeaderHeight = $[20];
|
|
2216
|
+
flatListProps = $[21];
|
|
2217
|
+
getCalendarDayFormat = $[22];
|
|
2218
|
+
getCalendarMonthFormat = $[23];
|
|
2219
|
+
getCalendarWeekDayFormat = $[24];
|
|
2220
|
+
onCalendarDayPress = $[25];
|
|
2221
|
+
onEndReached = $[26];
|
|
2222
|
+
onStartReached = $[27];
|
|
2223
|
+
ref = $[28];
|
|
2224
|
+
renderItem = $[29];
|
|
2225
|
+
theme = $[30];
|
|
2226
|
+
}
|
|
2227
|
+
let t0;
|
|
2228
|
+
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) {
|
|
2229
|
+
t0 = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CalendarListInner, {
|
|
2230
|
+
CalendarPressableComponent,
|
|
2231
|
+
calendarActiveDateRanges,
|
|
2232
|
+
calendarAdditionalHeight,
|
|
2233
|
+
calendarColorScheme,
|
|
2234
|
+
calendarDayHeight,
|
|
2235
|
+
calendarDisabledDateIds,
|
|
2236
|
+
calendarFirstDayOfWeek,
|
|
2237
|
+
calendarFormatLocale,
|
|
2238
|
+
calendarFutureScrollRangeInMonths,
|
|
2239
|
+
calendarInitialMonthId,
|
|
2240
|
+
calendarInitialScrollToActiveRange,
|
|
2241
|
+
calendarInstanceId,
|
|
2242
|
+
calendarMaxDateId,
|
|
2243
|
+
calendarMinDateId,
|
|
2244
|
+
calendarMonthHeaderHeight,
|
|
2245
|
+
calendarPastScrollRangeInMonths,
|
|
2246
|
+
calendarRowHorizontalSpacing,
|
|
2247
|
+
calendarRowVerticalSpacing,
|
|
2248
|
+
calendarSpacing,
|
|
2249
|
+
calendarWeekHeaderHeight,
|
|
2250
|
+
flatListProps,
|
|
2251
|
+
getCalendarDayFormat,
|
|
2252
|
+
getCalendarMonthFormat,
|
|
2253
|
+
getCalendarWeekDayFormat,
|
|
2254
|
+
onCalendarDayPress,
|
|
2255
|
+
onEndReached,
|
|
2256
|
+
onStartReached,
|
|
2257
|
+
ref,
|
|
2258
|
+
renderItem,
|
|
2259
|
+
theme
|
|
2260
|
+
});
|
|
2261
|
+
$[31] = CalendarPressableComponent;
|
|
2262
|
+
$[32] = calendarActiveDateRanges;
|
|
2263
|
+
$[33] = calendarAdditionalHeight;
|
|
2264
|
+
$[34] = calendarColorScheme;
|
|
2265
|
+
$[35] = calendarDayHeight;
|
|
2266
|
+
$[36] = calendarDisabledDateIds;
|
|
2267
|
+
$[37] = calendarFirstDayOfWeek;
|
|
2268
|
+
$[38] = calendarFormatLocale;
|
|
2269
|
+
$[39] = calendarFutureScrollRangeInMonths;
|
|
2270
|
+
$[40] = calendarInitialMonthId;
|
|
2271
|
+
$[41] = calendarInitialScrollToActiveRange;
|
|
2272
|
+
$[42] = calendarInstanceId;
|
|
2273
|
+
$[43] = calendarMaxDateId;
|
|
2274
|
+
$[44] = calendarMinDateId;
|
|
2275
|
+
$[45] = calendarMonthHeaderHeight;
|
|
2276
|
+
$[46] = calendarPastScrollRangeInMonths;
|
|
2277
|
+
$[47] = calendarRowHorizontalSpacing;
|
|
2278
|
+
$[48] = calendarRowVerticalSpacing;
|
|
2279
|
+
$[49] = calendarSpacing;
|
|
2280
|
+
$[50] = calendarWeekHeaderHeight;
|
|
2281
|
+
$[51] = flatListProps;
|
|
2282
|
+
$[52] = getCalendarDayFormat;
|
|
2283
|
+
$[53] = getCalendarMonthFormat;
|
|
2284
|
+
$[54] = getCalendarWeekDayFormat;
|
|
2285
|
+
$[55] = onCalendarDayPress;
|
|
2286
|
+
$[56] = onEndReached;
|
|
2287
|
+
$[57] = onStartReached;
|
|
2288
|
+
$[58] = ref;
|
|
2289
|
+
$[59] = renderItem;
|
|
2290
|
+
$[60] = theme;
|
|
2291
|
+
$[61] = t0;
|
|
2292
|
+
} else {
|
|
2293
|
+
t0 = $[61];
|
|
2294
|
+
}
|
|
2295
|
+
return t0;
|
|
2296
|
+
}
|
|
2297
|
+
function CalendarListInner(t0) {
|
|
2298
|
+
const $ = (0, import_compiler_runtime12.c)(85);
|
|
2299
|
+
const {
|
|
2300
|
+
ref,
|
|
2039
2301
|
calendarInitialMonthId,
|
|
2040
2302
|
calendarInitialScrollToActiveRange: t1,
|
|
2041
2303
|
calendarPastScrollRangeInMonths: t2,
|
|
@@ -2047,42 +2309,12 @@ function CalendarList(t0) {
|
|
|
2047
2309
|
calendarRowVerticalSpacing: t6,
|
|
2048
2310
|
calendarMonthHeaderHeight: t7,
|
|
2049
2311
|
calendarDayHeight: t8,
|
|
2050
|
-
calendarWeekHeaderHeight:
|
|
2051
|
-
calendarAdditionalHeight:
|
|
2312
|
+
calendarWeekHeaderHeight: calendarWeekHeaderHeightProp,
|
|
2313
|
+
calendarAdditionalHeight: t9,
|
|
2052
2314
|
calendarColorScheme,
|
|
2053
2315
|
theme,
|
|
2054
2316
|
onEndReached,
|
|
2055
|
-
onStartReached
|
|
2056
|
-
} = _b, otherProps = __objRest(_b, [
|
|
2057
|
-
"calendarInitialMonthId",
|
|
2058
|
-
"calendarInitialScrollToActiveRange",
|
|
2059
|
-
"calendarPastScrollRangeInMonths",
|
|
2060
|
-
"calendarFutureScrollRangeInMonths",
|
|
2061
|
-
"calendarFirstDayOfWeek",
|
|
2062
|
-
"calendarFormatLocale",
|
|
2063
|
-
"calendarSpacing",
|
|
2064
|
-
"calendarRowHorizontalSpacing",
|
|
2065
|
-
"calendarRowVerticalSpacing",
|
|
2066
|
-
"calendarMonthHeaderHeight",
|
|
2067
|
-
"calendarDayHeight",
|
|
2068
|
-
"calendarWeekHeaderHeight",
|
|
2069
|
-
"calendarAdditionalHeight",
|
|
2070
|
-
"calendarColorScheme",
|
|
2071
|
-
"theme",
|
|
2072
|
-
"onEndReached",
|
|
2073
|
-
"onStartReached"
|
|
2074
|
-
]);
|
|
2075
|
-
const calendarInitialScrollToActiveRange = t1 === void 0 ? true : t1;
|
|
2076
|
-
const calendarPastScrollRangeInMonths = t2 === void 0 ? 12 : t2;
|
|
2077
|
-
const calendarFutureScrollRangeInMonths = t3 === void 0 ? 12 : t3;
|
|
2078
|
-
const calendarFirstDayOfWeek = t4 === void 0 ? "sunday" : t4;
|
|
2079
|
-
const calendarSpacing = t5 === void 0 ? 20 : t5;
|
|
2080
|
-
const calendarRowVerticalSpacing = t6 === void 0 ? 8 : t6;
|
|
2081
|
-
const calendarMonthHeaderHeight = t7 === void 0 ? 20 : t7;
|
|
2082
|
-
const calendarDayHeight = t8 === void 0 ? 32 : t8;
|
|
2083
|
-
const calendarWeekHeaderHeight = t9 === void 0 ? calendarDayHeight : t9;
|
|
2084
|
-
const calendarAdditionalHeight = t10 === void 0 ? 0 : t10;
|
|
2085
|
-
const _c14 = otherProps, {
|
|
2317
|
+
onStartReached,
|
|
2086
2318
|
calendarActiveDateRanges,
|
|
2087
2319
|
calendarDisabledDateIds,
|
|
2088
2320
|
calendarInstanceId,
|
|
@@ -2092,127 +2324,158 @@ function CalendarList(t0) {
|
|
|
2092
2324
|
getCalendarMonthFormat,
|
|
2093
2325
|
getCalendarWeekDayFormat,
|
|
2094
2326
|
onCalendarDayPress,
|
|
2095
|
-
CalendarPressableComponent
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
getCalendarWeekDayFormat,
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2327
|
+
CalendarPressableComponent,
|
|
2328
|
+
renderItem: customRenderItem,
|
|
2329
|
+
flatListProps
|
|
2330
|
+
} = t0;
|
|
2331
|
+
const calendarInitialScrollToActiveRange = t1 === void 0 ? true : t1;
|
|
2332
|
+
const calendarPastScrollRangeInMonths = t2 === void 0 ? 12 : t2;
|
|
2333
|
+
const calendarFutureScrollRangeInMonths = t3 === void 0 ? 12 : t3;
|
|
2334
|
+
const calendarFirstDayOfWeek = t4 === void 0 ? "sunday" : t4;
|
|
2335
|
+
const calendarSpacing = t5 === void 0 ? 20 : t5;
|
|
2336
|
+
const calendarRowVerticalSpacing = t6 === void 0 ? 8 : t6;
|
|
2337
|
+
const calendarMonthHeaderHeight = t7 === void 0 ? 20 : t7;
|
|
2338
|
+
const calendarDayHeight = t8 === void 0 ? 32 : t8;
|
|
2339
|
+
const calendarAdditionalHeight = t9 === void 0 ? 0 : t9;
|
|
2340
|
+
let t10;
|
|
2341
|
+
let t11;
|
|
2342
|
+
if ($[0] !== calendarActiveDateRanges || $[1] !== calendarInstanceId) {
|
|
2343
|
+
t10 = () => {
|
|
2344
|
+
activeDateRangesStore.setRanges(calendarInstanceId != null ? calendarInstanceId : "legend-calendar-default-instance", calendarActiveDateRanges != null ? calendarActiveDateRanges : []);
|
|
2345
|
+
};
|
|
2346
|
+
t11 = [calendarActiveDateRanges, calendarInstanceId];
|
|
2347
|
+
$[0] = calendarActiveDateRanges;
|
|
2348
|
+
$[1] = calendarInstanceId;
|
|
2349
|
+
$[2] = t10;
|
|
2350
|
+
$[3] = t11;
|
|
2351
|
+
} else {
|
|
2352
|
+
t10 = $[2];
|
|
2353
|
+
t11 = $[3];
|
|
2354
|
+
}
|
|
2355
|
+
(0, import_react7.useEffect)(t10, t11);
|
|
2356
|
+
let t12;
|
|
2357
|
+
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) {
|
|
2358
|
+
t12 = buildCalendarConfig(calendarColorScheme, calendarDayHeight, calendarDisabledDateIds, calendarFirstDayOfWeek, calendarFormatLocale, calendarInstanceId, calendarMaxDateId, calendarMinDateId, calendarMonthHeaderHeight, calendarRowHorizontalSpacing, calendarRowVerticalSpacing, calendarWeekHeaderHeightProp, getCalendarDayFormat, getCalendarMonthFormat, getCalendarWeekDayFormat, onCalendarDayPress, theme, CalendarPressableComponent);
|
|
2359
|
+
$[4] = CalendarPressableComponent;
|
|
2360
|
+
$[5] = calendarColorScheme;
|
|
2361
|
+
$[6] = calendarDayHeight;
|
|
2362
|
+
$[7] = calendarDisabledDateIds;
|
|
2363
|
+
$[8] = calendarFirstDayOfWeek;
|
|
2364
|
+
$[9] = calendarFormatLocale;
|
|
2365
|
+
$[10] = calendarInstanceId;
|
|
2366
|
+
$[11] = calendarMaxDateId;
|
|
2367
|
+
$[12] = calendarMinDateId;
|
|
2368
|
+
$[13] = calendarMonthHeaderHeight;
|
|
2369
|
+
$[14] = calendarRowHorizontalSpacing;
|
|
2370
|
+
$[15] = calendarRowVerticalSpacing;
|
|
2371
|
+
$[16] = calendarWeekHeaderHeightProp;
|
|
2372
|
+
$[17] = getCalendarDayFormat;
|
|
2373
|
+
$[18] = getCalendarMonthFormat;
|
|
2374
|
+
$[19] = getCalendarWeekDayFormat;
|
|
2375
|
+
$[20] = onCalendarDayPress;
|
|
2376
|
+
$[21] = theme;
|
|
2377
|
+
$[22] = t12;
|
|
2378
|
+
} else {
|
|
2379
|
+
t12 = $[22];
|
|
2380
|
+
}
|
|
2381
|
+
const calendarProps = t12;
|
|
2382
|
+
const calendarWeekHeaderHeight = calendarWeekHeaderHeightProp != null ? calendarWeekHeaderHeightProp : calendarDayHeight;
|
|
2383
|
+
let t13;
|
|
2384
|
+
if ($[23] !== calendarFirstDayOfWeek || $[24] !== calendarFutureScrollRangeInMonths || $[25] !== calendarInitialMonthId || $[26] !== calendarMaxDateId || $[27] !== calendarMinDateId || $[28] !== calendarPastScrollRangeInMonths) {
|
|
2385
|
+
t13 = {
|
|
2386
|
+
calendarFirstDayOfWeek,
|
|
2387
|
+
calendarFutureScrollRangeInMonths,
|
|
2388
|
+
calendarPastScrollRangeInMonths,
|
|
2389
|
+
calendarInitialMonthId,
|
|
2390
|
+
calendarMaxDateId,
|
|
2391
|
+
calendarMinDateId
|
|
2392
|
+
};
|
|
2393
|
+
$[23] = calendarFirstDayOfWeek;
|
|
2394
|
+
$[24] = calendarFutureScrollRangeInMonths;
|
|
2395
|
+
$[25] = calendarInitialMonthId;
|
|
2396
|
+
$[26] = calendarMaxDateId;
|
|
2397
|
+
$[27] = calendarMinDateId;
|
|
2398
|
+
$[28] = calendarPastScrollRangeInMonths;
|
|
2399
|
+
$[29] = t13;
|
|
2400
|
+
} else {
|
|
2401
|
+
t13 = $[29];
|
|
2402
|
+
}
|
|
2131
2403
|
const {
|
|
2132
2404
|
initialMonthIndex,
|
|
2133
2405
|
monthList,
|
|
2134
2406
|
appendMonths,
|
|
2135
2407
|
prependMonths,
|
|
2136
2408
|
addMissingMonths
|
|
2137
|
-
} = useCalendarList(
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
if ($[0] !== firstRange.startId) {
|
|
2151
|
-
const startDate = fromDateId(firstRange.startId);
|
|
2152
|
-
t112 = toDateId(startOfMonth(startDate));
|
|
2153
|
-
$[0] = firstRange.startId;
|
|
2154
|
-
$[1] = t112;
|
|
2155
|
-
} else {
|
|
2156
|
-
t112 = $[1];
|
|
2157
|
-
}
|
|
2158
|
-
const monthId = t112;
|
|
2159
|
-
let t122;
|
|
2160
|
-
if ($[2] !== monthId || $[3] !== monthList) {
|
|
2161
|
-
let t132;
|
|
2162
|
-
if ($[5] !== monthId) {
|
|
2163
|
-
t132 = (month) => month.id === monthId;
|
|
2164
|
-
$[5] = monthId;
|
|
2165
|
-
$[6] = t132;
|
|
2166
|
-
} else {
|
|
2167
|
-
t132 = $[6];
|
|
2409
|
+
} = useCalendarList(t13);
|
|
2410
|
+
let t14;
|
|
2411
|
+
if ($[30] !== calendarActiveDateRanges || $[31] !== calendarInitialScrollToActiveRange || $[32] !== initialMonthIndex || $[33] !== monthList) {
|
|
2412
|
+
t14 = () => {
|
|
2413
|
+
if (calendarInitialScrollToActiveRange && calendarActiveDateRanges) {
|
|
2414
|
+
const firstRange = calendarActiveDateRanges[0];
|
|
2415
|
+
if (firstRange == null ? void 0 : firstRange.startId) {
|
|
2416
|
+
const startDate = fromDateId(firstRange.startId);
|
|
2417
|
+
const monthId = toDateId(startOfMonth(startDate));
|
|
2418
|
+
const monthIndex = monthList.findIndex((month) => month.id === monthId);
|
|
2419
|
+
if (monthIndex !== -1) {
|
|
2420
|
+
return monthIndex;
|
|
2421
|
+
}
|
|
2168
2422
|
}
|
|
2169
|
-
t122 = monthList.findIndex(t132);
|
|
2170
|
-
$[2] = monthId;
|
|
2171
|
-
$[3] = monthList;
|
|
2172
|
-
$[4] = t122;
|
|
2173
|
-
} else {
|
|
2174
|
-
t122 = $[4];
|
|
2175
|
-
}
|
|
2176
|
-
const monthIndex = t122;
|
|
2177
|
-
if (monthIndex !== -1) {
|
|
2178
|
-
computedInitialScrollIndex = monthIndex;
|
|
2179
2423
|
}
|
|
2180
|
-
|
|
2424
|
+
return initialMonthIndex;
|
|
2425
|
+
};
|
|
2426
|
+
$[30] = calendarActiveDateRanges;
|
|
2427
|
+
$[31] = calendarInitialScrollToActiveRange;
|
|
2428
|
+
$[32] = initialMonthIndex;
|
|
2429
|
+
$[33] = monthList;
|
|
2430
|
+
$[34] = t14;
|
|
2431
|
+
} else {
|
|
2432
|
+
t14 = $[34];
|
|
2181
2433
|
}
|
|
2182
|
-
const
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2434
|
+
const [computedInitialScrollIndex] = (0, import_react7.useState)(t14);
|
|
2435
|
+
let t15;
|
|
2436
|
+
if ($[35] !== calendarProps || $[36] !== customRenderItem || $[37] !== monthList) {
|
|
2437
|
+
t15 = customRenderItem ? monthList.map((month_0) => __spreadProps(__spreadValues({}, month_0), {
|
|
2438
|
+
calendarProps
|
|
2439
|
+
})) : monthList;
|
|
2440
|
+
$[35] = calendarProps;
|
|
2441
|
+
$[36] = customRenderItem;
|
|
2442
|
+
$[37] = monthList;
|
|
2443
|
+
$[38] = t15;
|
|
2444
|
+
} else {
|
|
2445
|
+
t15 = $[38];
|
|
2446
|
+
}
|
|
2447
|
+
const listData = t15;
|
|
2448
|
+
let t16;
|
|
2449
|
+
if ($[39] !== appendMonths || $[40] !== calendarFutureScrollRangeInMonths || $[41] !== onEndReached) {
|
|
2450
|
+
t16 = (info) => {
|
|
2188
2451
|
appendMonths(calendarFutureScrollRangeInMonths);
|
|
2189
2452
|
onEndReached == null ? void 0 : onEndReached(info);
|
|
2190
2453
|
};
|
|
2191
|
-
$[
|
|
2192
|
-
$[
|
|
2193
|
-
$[
|
|
2194
|
-
$[
|
|
2454
|
+
$[39] = appendMonths;
|
|
2455
|
+
$[40] = calendarFutureScrollRangeInMonths;
|
|
2456
|
+
$[41] = onEndReached;
|
|
2457
|
+
$[42] = t16;
|
|
2195
2458
|
} else {
|
|
2196
|
-
|
|
2459
|
+
t16 = $[42];
|
|
2197
2460
|
}
|
|
2198
|
-
const handleOnEndReached =
|
|
2199
|
-
let
|
|
2200
|
-
if ($[
|
|
2201
|
-
|
|
2461
|
+
const handleOnEndReached = t16;
|
|
2462
|
+
let t17;
|
|
2463
|
+
if ($[43] !== calendarPastScrollRangeInMonths || $[44] !== onStartReached || $[45] !== prependMonths) {
|
|
2464
|
+
t17 = (info_0) => {
|
|
2202
2465
|
prependMonths(calendarPastScrollRangeInMonths);
|
|
2203
2466
|
onStartReached == null ? void 0 : onStartReached(info_0);
|
|
2204
2467
|
};
|
|
2205
|
-
$[
|
|
2206
|
-
$[
|
|
2207
|
-
$[
|
|
2208
|
-
$[
|
|
2468
|
+
$[43] = calendarPastScrollRangeInMonths;
|
|
2469
|
+
$[44] = onStartReached;
|
|
2470
|
+
$[45] = prependMonths;
|
|
2471
|
+
$[46] = t17;
|
|
2209
2472
|
} else {
|
|
2210
|
-
|
|
2473
|
+
t17 = $[46];
|
|
2211
2474
|
}
|
|
2212
|
-
const handleOnStartReached =
|
|
2213
|
-
let
|
|
2214
|
-
if ($[
|
|
2215
|
-
|
|
2475
|
+
const handleOnStartReached = t17;
|
|
2476
|
+
let t18;
|
|
2477
|
+
if ($[47] !== addMissingMonths || $[48] !== calendarAdditionalHeight || $[49] !== calendarDayHeight || $[50] !== calendarMonthHeaderHeight || $[51] !== calendarRowVerticalSpacing || $[52] !== calendarSpacing || $[53] !== calendarWeekHeaderHeight || $[54] !== monthList) {
|
|
2478
|
+
t18 = (date) => {
|
|
2216
2479
|
const monthId_0 = toDateId(startOfMonth(date));
|
|
2217
2480
|
let baseMonthList = monthList;
|
|
2218
2481
|
let index = baseMonthList.findIndex((month_1) => month_1.id === monthId_0);
|
|
@@ -2233,88 +2496,88 @@ function CalendarList(t0) {
|
|
|
2233
2496
|
return acc + currentHeight;
|
|
2234
2497
|
}, 0);
|
|
2235
2498
|
};
|
|
2236
|
-
$[
|
|
2237
|
-
$[
|
|
2238
|
-
$[
|
|
2239
|
-
$[
|
|
2240
|
-
$[
|
|
2241
|
-
$[
|
|
2242
|
-
$[
|
|
2243
|
-
$[
|
|
2244
|
-
$[
|
|
2245
|
-
} else {
|
|
2246
|
-
|
|
2247
|
-
}
|
|
2248
|
-
const getScrollOffsetForMonth =
|
|
2249
|
-
const legendListRef = (0,
|
|
2250
|
-
let
|
|
2251
|
-
if ($[
|
|
2252
|
-
|
|
2253
|
-
scrollToMonth(date_0, animated,
|
|
2499
|
+
$[47] = addMissingMonths;
|
|
2500
|
+
$[48] = calendarAdditionalHeight;
|
|
2501
|
+
$[49] = calendarDayHeight;
|
|
2502
|
+
$[50] = calendarMonthHeaderHeight;
|
|
2503
|
+
$[51] = calendarRowVerticalSpacing;
|
|
2504
|
+
$[52] = calendarSpacing;
|
|
2505
|
+
$[53] = calendarWeekHeaderHeight;
|
|
2506
|
+
$[54] = monthList;
|
|
2507
|
+
$[55] = t18;
|
|
2508
|
+
} else {
|
|
2509
|
+
t18 = $[55];
|
|
2510
|
+
}
|
|
2511
|
+
const getScrollOffsetForMonth = t18;
|
|
2512
|
+
const legendListRef = (0, import_react7.useRef)(null);
|
|
2513
|
+
let t19;
|
|
2514
|
+
if ($[56] !== calendarDayHeight || $[57] !== calendarFirstDayOfWeek || $[58] !== calendarRowVerticalSpacing || $[59] !== calendarWeekHeaderHeight || $[60] !== getScrollOffsetForMonth) {
|
|
2515
|
+
t19 = () => ({
|
|
2516
|
+
scrollToMonth(date_0, animated, t202) {
|
|
2254
2517
|
const {
|
|
2255
|
-
additionalOffset:
|
|
2256
|
-
} =
|
|
2518
|
+
additionalOffset: t212
|
|
2519
|
+
} = t202 === void 0 ? {
|
|
2257
2520
|
additionalOffset: 0
|
|
2258
|
-
} :
|
|
2259
|
-
const additionalOffset =
|
|
2521
|
+
} : t202;
|
|
2522
|
+
const additionalOffset = t212 === void 0 ? 0 : t212;
|
|
2260
2523
|
setTimeout(() => {
|
|
2261
|
-
var
|
|
2262
|
-
(
|
|
2524
|
+
var _a;
|
|
2525
|
+
(_a = legendListRef.current) == null ? void 0 : _a.scrollToOffset({
|
|
2263
2526
|
offset: getScrollOffsetForMonth(date_0) + additionalOffset,
|
|
2264
2527
|
animated
|
|
2265
2528
|
});
|
|
2266
2529
|
}, 0);
|
|
2267
2530
|
},
|
|
2268
|
-
scrollToDate(date_1, animated_0,
|
|
2269
|
-
var
|
|
2531
|
+
scrollToDate(date_1, animated_0, t222) {
|
|
2532
|
+
var _a;
|
|
2270
2533
|
const {
|
|
2271
|
-
additionalOffset:
|
|
2272
|
-
} =
|
|
2534
|
+
additionalOffset: t232
|
|
2535
|
+
} = t222 === void 0 ? {
|
|
2273
2536
|
additionalOffset: 0
|
|
2274
|
-
} :
|
|
2275
|
-
const additionalOffset_0 =
|
|
2537
|
+
} : t222;
|
|
2538
|
+
const additionalOffset_0 = t232 === void 0 ? 0 : t232;
|
|
2276
2539
|
const currentMonthOffset = getScrollOffsetForMonth(date_1);
|
|
2277
2540
|
const weekOfMonthIndex = getWeekOfMonth(date_1, calendarFirstDayOfWeek);
|
|
2278
2541
|
const rowHeight = calendarDayHeight + calendarRowVerticalSpacing;
|
|
2279
2542
|
let weekOffset = calendarWeekHeaderHeight + rowHeight * weekOfMonthIndex;
|
|
2280
2543
|
weekOffset = weekOffset - calendarRowVerticalSpacing;
|
|
2281
|
-
(
|
|
2544
|
+
(_a = legendListRef.current) == null ? void 0 : _a.scrollToOffset({
|
|
2282
2545
|
offset: currentMonthOffset + weekOffset + additionalOffset_0,
|
|
2283
2546
|
animated: animated_0
|
|
2284
2547
|
});
|
|
2285
2548
|
},
|
|
2286
2549
|
scrollToOffset(offset, animated_1) {
|
|
2287
|
-
var
|
|
2288
|
-
(
|
|
2550
|
+
var _a;
|
|
2551
|
+
(_a = legendListRef.current) == null ? void 0 : _a.scrollToOffset({
|
|
2289
2552
|
offset,
|
|
2290
2553
|
animated: animated_1
|
|
2291
2554
|
});
|
|
2292
2555
|
}
|
|
2293
2556
|
});
|
|
2294
|
-
$[
|
|
2295
|
-
$[
|
|
2296
|
-
$[
|
|
2297
|
-
$[
|
|
2298
|
-
$[
|
|
2299
|
-
$[
|
|
2300
|
-
} else {
|
|
2301
|
-
|
|
2302
|
-
}
|
|
2303
|
-
(0,
|
|
2304
|
-
let
|
|
2305
|
-
if ($[
|
|
2306
|
-
|
|
2557
|
+
$[56] = calendarDayHeight;
|
|
2558
|
+
$[57] = calendarFirstDayOfWeek;
|
|
2559
|
+
$[58] = calendarRowVerticalSpacing;
|
|
2560
|
+
$[59] = calendarWeekHeaderHeight;
|
|
2561
|
+
$[60] = getScrollOffsetForMonth;
|
|
2562
|
+
$[61] = t19;
|
|
2563
|
+
} else {
|
|
2564
|
+
t19 = $[61];
|
|
2565
|
+
}
|
|
2566
|
+
(0, import_react7.useImperativeHandle)(ref, t19);
|
|
2567
|
+
let t20;
|
|
2568
|
+
if ($[62] !== calendarSpacing) {
|
|
2569
|
+
t20 = {
|
|
2307
2570
|
paddingBottom: calendarSpacing
|
|
2308
2571
|
};
|
|
2309
|
-
$[
|
|
2310
|
-
$[
|
|
2572
|
+
$[62] = calendarSpacing;
|
|
2573
|
+
$[63] = t20;
|
|
2311
2574
|
} else {
|
|
2312
|
-
|
|
2575
|
+
t20 = $[63];
|
|
2313
2576
|
}
|
|
2314
|
-
const calendarContainerStyle =
|
|
2315
|
-
let
|
|
2316
|
-
if ($[
|
|
2317
|
-
|
|
2577
|
+
const calendarContainerStyle = t20;
|
|
2578
|
+
let t21;
|
|
2579
|
+
if ($[64] !== calendarAdditionalHeight || $[65] !== calendarDayHeight || $[66] !== calendarMonthHeaderHeight || $[67] !== calendarRowVerticalSpacing || $[68] !== calendarSpacing || $[69] !== calendarWeekHeaderHeight) {
|
|
2580
|
+
t21 = (item) => getHeightForMonth({
|
|
2318
2581
|
calendarMonth: item,
|
|
2319
2582
|
calendarSpacing,
|
|
2320
2583
|
calendarDayHeight,
|
|
@@ -2323,41 +2586,43 @@ function CalendarList(t0) {
|
|
|
2323
2586
|
calendarWeekHeaderHeight,
|
|
2324
2587
|
calendarAdditionalHeight
|
|
2325
2588
|
});
|
|
2326
|
-
$[
|
|
2327
|
-
$[
|
|
2328
|
-
$[
|
|
2329
|
-
$[
|
|
2330
|
-
$[
|
|
2331
|
-
$[
|
|
2332
|
-
$[
|
|
2333
|
-
} else {
|
|
2334
|
-
|
|
2335
|
-
}
|
|
2336
|
-
const getFixedItemSize =
|
|
2337
|
-
let
|
|
2338
|
-
if ($[
|
|
2339
|
-
|
|
2589
|
+
$[64] = calendarAdditionalHeight;
|
|
2590
|
+
$[65] = calendarDayHeight;
|
|
2591
|
+
$[66] = calendarMonthHeaderHeight;
|
|
2592
|
+
$[67] = calendarRowVerticalSpacing;
|
|
2593
|
+
$[68] = calendarSpacing;
|
|
2594
|
+
$[69] = calendarWeekHeaderHeight;
|
|
2595
|
+
$[70] = t21;
|
|
2596
|
+
} else {
|
|
2597
|
+
t21 = $[70];
|
|
2598
|
+
}
|
|
2599
|
+
const getFixedItemSize = t21;
|
|
2600
|
+
let t22;
|
|
2601
|
+
if ($[71] !== calendarContainerStyle || $[72] !== onCalendarDayPress) {
|
|
2602
|
+
t22 = (t232) => {
|
|
2340
2603
|
const {
|
|
2341
2604
|
item: item_0
|
|
2342
|
-
} =
|
|
2605
|
+
} = t232;
|
|
2343
2606
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native10.View, {
|
|
2344
2607
|
style: calendarContainerStyle,
|
|
2345
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Calendar,
|
|
2346
|
-
calendarMonthId: item_0.id
|
|
2347
|
-
|
|
2608
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Calendar, {
|
|
2609
|
+
calendarMonthId: item_0.id,
|
|
2610
|
+
onCalendarDayPress
|
|
2611
|
+
})
|
|
2348
2612
|
});
|
|
2349
2613
|
};
|
|
2350
|
-
$[
|
|
2351
|
-
$[
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
const
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2614
|
+
$[71] = calendarContainerStyle;
|
|
2615
|
+
$[72] = onCalendarDayPress;
|
|
2616
|
+
$[73] = t22;
|
|
2617
|
+
} else {
|
|
2618
|
+
t22 = $[73];
|
|
2619
|
+
}
|
|
2620
|
+
const handleRenderItem = t22;
|
|
2621
|
+
const t23 = customRenderItem != null ? customRenderItem : handleRenderItem;
|
|
2622
|
+
let t24;
|
|
2623
|
+
if ($[74] !== computedInitialScrollIndex || $[75] !== flatListProps || $[76] !== getFixedItemSize || $[77] !== handleOnEndReached || $[78] !== handleOnStartReached || $[79] !== listData || $[80] !== t23) {
|
|
2624
|
+
t24 = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LegendList, __spreadValues({
|
|
2625
|
+
data: listData,
|
|
2361
2626
|
drawDistance: 560,
|
|
2362
2627
|
estimatedItemSize: 273,
|
|
2363
2628
|
getFixedItemSize,
|
|
@@ -2366,27 +2631,36 @@ function CalendarList(t0) {
|
|
|
2366
2631
|
maintainVisibleContentPosition: true,
|
|
2367
2632
|
onEndReached: handleOnEndReached,
|
|
2368
2633
|
onStartReached: handleOnStartReached,
|
|
2369
|
-
onViewableItemsChanged: handleViewableItemsChanged,
|
|
2370
2634
|
recycleItems: true,
|
|
2371
2635
|
ref: legendListRef,
|
|
2372
|
-
renderItem:
|
|
2636
|
+
renderItem: t23,
|
|
2373
2637
|
showsVerticalScrollIndicator: false,
|
|
2374
2638
|
style: styles8.container
|
|
2375
2639
|
}, flatListProps));
|
|
2376
|
-
$[
|
|
2377
|
-
$[
|
|
2378
|
-
$[
|
|
2379
|
-
$[
|
|
2380
|
-
$[
|
|
2381
|
-
$[
|
|
2382
|
-
$[
|
|
2383
|
-
$[
|
|
2384
|
-
} else {
|
|
2385
|
-
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2640
|
+
$[74] = computedInitialScrollIndex;
|
|
2641
|
+
$[75] = flatListProps;
|
|
2642
|
+
$[76] = getFixedItemSize;
|
|
2643
|
+
$[77] = handleOnEndReached;
|
|
2644
|
+
$[78] = handleOnStartReached;
|
|
2645
|
+
$[79] = listData;
|
|
2646
|
+
$[80] = t23;
|
|
2647
|
+
$[81] = t24;
|
|
2648
|
+
} else {
|
|
2649
|
+
t24 = $[81];
|
|
2650
|
+
}
|
|
2651
|
+
let t25;
|
|
2652
|
+
if ($[82] !== calendarProps || $[83] !== t24) {
|
|
2653
|
+
t25 = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CalendarListConfigProvider, {
|
|
2654
|
+
value: calendarProps,
|
|
2655
|
+
children: t24
|
|
2656
|
+
});
|
|
2657
|
+
$[82] = calendarProps;
|
|
2658
|
+
$[83] = t24;
|
|
2659
|
+
$[84] = t25;
|
|
2660
|
+
} else {
|
|
2661
|
+
t25 = $[84];
|
|
2662
|
+
}
|
|
2663
|
+
return t25;
|
|
2390
2664
|
}
|
|
2391
2665
|
var styles8 = import_react_native10.StyleSheet.create({
|
|
2392
2666
|
container: {
|
|
@@ -2415,7 +2689,7 @@ var Calendar3 = CalendarWithNamespace;
|
|
|
2415
2689
|
|
|
2416
2690
|
// src/hooks/useDateRange.ts
|
|
2417
2691
|
var import_compiler_runtime13 = require("react/compiler-runtime");
|
|
2418
|
-
var
|
|
2692
|
+
var import_react8 = require("react");
|
|
2419
2693
|
var useDateRange = (t0) => {
|
|
2420
2694
|
const $ = (0, import_compiler_runtime13.c)(10);
|
|
2421
2695
|
let t1;
|
|
@@ -2430,7 +2704,7 @@ var useDateRange = (t0) => {
|
|
|
2430
2704
|
t1 = $[1];
|
|
2431
2705
|
}
|
|
2432
2706
|
const initialDateRange = t1;
|
|
2433
|
-
const [dateRange, setDateRange] = (0,
|
|
2707
|
+
const [dateRange, setDateRange] = (0, import_react8.useState)(initialDateRange);
|
|
2434
2708
|
let t2;
|
|
2435
2709
|
if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
2436
2710
|
t2 = (dateId) => {
|
|
@@ -2523,6 +2797,7 @@ var useDateRange = (t0) => {
|
|
|
2523
2797
|
toDateId,
|
|
2524
2798
|
useCalendar,
|
|
2525
2799
|
useCalendarList,
|
|
2800
|
+
useCalendarListConfig,
|
|
2526
2801
|
useDateRange,
|
|
2527
2802
|
useOptimizedDayMetadata
|
|
2528
2803
|
});
|