@nutui/nutui-react-taro 2.7.7 → 2.7.9
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/CHANGELOG.md +26 -10
- package/dist/esm/Animate/style/style.css +1 -1
- package/dist/esm/Animate.js +1 -1
- package/dist/esm/AvatarCropper.js +1 -1
- package/dist/esm/Calendar/style/style.css +1 -1
- package/dist/esm/Calendar.js +1 -1
- package/dist/esm/CalendarCard.js +1 -1
- package/dist/esm/CalendarItem.js +1 -1
- package/dist/esm/Drag.js +1 -1
- package/dist/esm/ImagePreview/style/style.css +1 -1
- package/dist/esm/Menu.js +1 -1
- package/dist/esm/MenuItem.js +1 -1
- package/dist/esm/PullToRefresh.js +1 -1
- package/dist/esm/Sticky.js +1 -1
- package/dist/esm/Swiper/style/style.css +1 -1
- package/dist/esm/VirtualList.js +1 -1
- package/dist/esm/{animate.taro-CQVEyDKL.js → animate.taro-BHDZMzJF.js} +9 -12
- package/dist/esm/{avatarcropper.taro-meD2sizv.js → avatarcropper.taro-5JSFH7Q9.js} +2 -1
- package/dist/esm/{calendar.taro-CM4yWFlF.js → calendar.taro-CUDVpJBa.js} +3 -3
- package/dist/esm/{calendarcard.taro-CvWyBqnr.js → calendarcard.taro-BiOnui_b.js} +4 -4
- package/dist/esm/{calendaritem.taro-BGbbuJOS.js → calendaritem.taro-DveeC4_t.js} +237 -219
- package/dist/esm/date-BmUWlDuN.js +147 -0
- package/dist/esm/{drag.taro-r5Lmncrq.js → drag.taro-CHPSfySz.js} +2 -2
- package/dist/esm/get-system-info-D27xNglo.js +11 -0
- package/dist/esm/{menu.taro-2APk--BX.js → menu.taro-9N8A5UoN.js} +1 -1
- package/dist/esm/{menuitem.taro-BMlSqBSc.js → menuitem.taro-CnsORm5-.js} +5 -4
- package/dist/esm/nutui-react.es.js +11 -11
- package/dist/esm/{pulltorefresh.taro-BiSDwLpA.js → pulltorefresh.taro-DAFv7upo.js} +2 -1
- package/dist/esm/{sticky.taro-DtUAawu_.js → sticky.taro-l66r7WFn.js} +3 -2
- package/dist/esm/{virtuallist.taro-BlPW8ibd.js → virtuallist.taro-CQDtOwWn.js} +2 -2
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +384 -465
- package/dist/nutui.react.umd.js +383 -464
- package/dist/packages/animate/animate.scss +63 -105
- package/dist/packages/calendar/calendar.scss +9 -9
- package/dist/packages/swiper/swiper.scss +11 -0
- package/dist/style.css +1 -1
- package/dist/types/packages/animate/animate.taro.d.ts +2 -1
- package/dist/types/utils/date.d.ts +54 -52
- package/dist/types/utils/get-system-info.d.ts +19 -0
- package/package.json +1 -1
- package/dist/esm/date-CYwRNlGq.js +0 -219
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
const isLeapYear = (y) => {
|
|
2
|
+
return y % 4 === 0 && y % 100 !== 0 || y % 400 === 0;
|
|
3
|
+
};
|
|
4
|
+
const getWhatDay = (year, month, day) => {
|
|
5
|
+
const date = new Date(year, month - 1, day);
|
|
6
|
+
const dayNames = [
|
|
7
|
+
"星期日",
|
|
8
|
+
"星期一",
|
|
9
|
+
"星期二",
|
|
10
|
+
"星期三",
|
|
11
|
+
"星期四",
|
|
12
|
+
"星期五",
|
|
13
|
+
"星期六"
|
|
14
|
+
];
|
|
15
|
+
return dayNames[date.getDay()];
|
|
16
|
+
};
|
|
17
|
+
const getMonthPreDay = (year, month) => {
|
|
18
|
+
const day = new Date(year, month - 1, 1).getDay();
|
|
19
|
+
return day === 0 ? 7 : day;
|
|
20
|
+
};
|
|
21
|
+
const getMonthDays = (year, month) => {
|
|
22
|
+
if (/^0/.test(month)) {
|
|
23
|
+
month = month.split("")[1];
|
|
24
|
+
}
|
|
25
|
+
return [
|
|
26
|
+
0,
|
|
27
|
+
31,
|
|
28
|
+
isLeapYear(Number(year)) ? 29 : 28,
|
|
29
|
+
31,
|
|
30
|
+
30,
|
|
31
|
+
31,
|
|
32
|
+
30,
|
|
33
|
+
31,
|
|
34
|
+
31,
|
|
35
|
+
30,
|
|
36
|
+
31,
|
|
37
|
+
30,
|
|
38
|
+
31
|
|
39
|
+
][month];
|
|
40
|
+
};
|
|
41
|
+
const getNumTwoBit = (n) => {
|
|
42
|
+
return n > 9 ? `${n}` : `0${n}`;
|
|
43
|
+
};
|
|
44
|
+
const date2Str = (date, split = "-") => {
|
|
45
|
+
const y = date.getFullYear();
|
|
46
|
+
const m = getNumTwoBit(date.getMonth() + 1);
|
|
47
|
+
const d = getNumTwoBit(date.getDate());
|
|
48
|
+
return [y, m, d].join(split);
|
|
49
|
+
};
|
|
50
|
+
const getDateString = (offset = 0) => {
|
|
51
|
+
const date = /* @__PURE__ */ new Date();
|
|
52
|
+
date.setDate(date.getDate() + offset);
|
|
53
|
+
return date2Str(date, "-");
|
|
54
|
+
};
|
|
55
|
+
const compareDate = (date1, date2) => {
|
|
56
|
+
const startTime = new Date(date1.replace("-", "/").replace("-", "/"));
|
|
57
|
+
const endTime = new Date(date2.replace("-", "/").replace("-", "/"));
|
|
58
|
+
return startTime < endTime;
|
|
59
|
+
};
|
|
60
|
+
const isEqual = (date1, date2) => {
|
|
61
|
+
const startTime = new Date((date1 || "").replace(/-/g, "/")).getTime();
|
|
62
|
+
const endTime = new Date(date2.replace(/-/g, "/")).getTime();
|
|
63
|
+
return startTime === endTime;
|
|
64
|
+
};
|
|
65
|
+
const getWeekDate = (year, month, date, firstDayOfWeek = 0) => {
|
|
66
|
+
const dateNow = new Date(Number(year), parseInt(month) - 1, Number(date));
|
|
67
|
+
const nowTime = dateNow.getTime();
|
|
68
|
+
let day = dateNow.getDay();
|
|
69
|
+
if (firstDayOfWeek === 0) {
|
|
70
|
+
const oneDayTime2 = 24 * 60 * 60 * 1e3;
|
|
71
|
+
const SundayTime2 = nowTime - day * oneDayTime2;
|
|
72
|
+
const SaturdayTime = nowTime + (6 - day) * oneDayTime2;
|
|
73
|
+
const sunday2 = date2Str(new Date(SundayTime2));
|
|
74
|
+
const saturday = date2Str(new Date(SaturdayTime));
|
|
75
|
+
return [sunday2, saturday];
|
|
76
|
+
}
|
|
77
|
+
day = day === 0 ? 7 : day;
|
|
78
|
+
const oneDayTime = 24 * 60 * 60 * 1e3;
|
|
79
|
+
const MondayTime = nowTime - (day - 1) * oneDayTime;
|
|
80
|
+
const SundayTime = nowTime + (7 - day) * oneDayTime;
|
|
81
|
+
const monday = date2Str(new Date(MondayTime));
|
|
82
|
+
const sunday = date2Str(new Date(SundayTime));
|
|
83
|
+
return [monday, sunday];
|
|
84
|
+
};
|
|
85
|
+
const formatResultDate = (date) => {
|
|
86
|
+
const [year, month, day] = [...date.split("-")];
|
|
87
|
+
const formatterDay = getNumTwoBit(Number(day));
|
|
88
|
+
const formatterDate = `${year}-${month}-${day}`;
|
|
89
|
+
const dayOfWeek = getWhatDay(Number(year), Number(month), Number(day));
|
|
90
|
+
return [year, month, formatterDay, formatterDate, dayOfWeek];
|
|
91
|
+
};
|
|
92
|
+
const getCurrMonthData = (type, year, month) => {
|
|
93
|
+
{
|
|
94
|
+
month === 12 && (year += 1);
|
|
95
|
+
month = month === 12 ? 1 : ++month;
|
|
96
|
+
}
|
|
97
|
+
return [year, getNumTwoBit(month), getMonthDays(String(year), String(month))];
|
|
98
|
+
};
|
|
99
|
+
const getDaysStatus = (type, year, month) => {
|
|
100
|
+
let days = getMonthDays(`${year}`, `${month}`);
|
|
101
|
+
return Array.from(Array(days), (v, k) => {
|
|
102
|
+
return {
|
|
103
|
+
day: k + 1,
|
|
104
|
+
type,
|
|
105
|
+
year,
|
|
106
|
+
month
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
const getPreMonthDates = (type, year, month, firstDayOfWeek) => {
|
|
111
|
+
let preMonth = +month - 1;
|
|
112
|
+
let preYear = year;
|
|
113
|
+
if (preMonth <= 0) {
|
|
114
|
+
preMonth = 12;
|
|
115
|
+
preYear += 1;
|
|
116
|
+
}
|
|
117
|
+
let days = getMonthPreDay(+year, +month);
|
|
118
|
+
days -= firstDayOfWeek;
|
|
119
|
+
if (days >= 7) {
|
|
120
|
+
days -= 7;
|
|
121
|
+
}
|
|
122
|
+
const preDates = getMonthDays(`${preYear}`, `${preMonth}`);
|
|
123
|
+
const months = Array.from(Array(preDates), (v, k) => {
|
|
124
|
+
return {
|
|
125
|
+
day: k + 1,
|
|
126
|
+
type,
|
|
127
|
+
preYear,
|
|
128
|
+
preMonth
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
return months.slice(preDates - days);
|
|
132
|
+
};
|
|
133
|
+
export {
|
|
134
|
+
getNumTwoBit as a,
|
|
135
|
+
getPreMonthDates as b,
|
|
136
|
+
compareDate as c,
|
|
137
|
+
date2Str as d,
|
|
138
|
+
getDaysStatus as e,
|
|
139
|
+
getMonthDays as f,
|
|
140
|
+
getDateString as g,
|
|
141
|
+
getCurrMonthData as h,
|
|
142
|
+
isEqual as i,
|
|
143
|
+
getWeekDate as j,
|
|
144
|
+
getWhatDay as k,
|
|
145
|
+
formatResultDate as l,
|
|
146
|
+
getMonthPreDay as m
|
|
147
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as __rest, a as __awaiter } from "./tslib.es6-iWu3F_1J.js";
|
|
2
2
|
import React__default, { useState, useRef, useEffect } from "react";
|
|
3
|
-
import { getSystemInfoSync } from "@tarojs/taro";
|
|
4
3
|
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
5
4
|
import { g as getRectByTaro } from "./get-rect-by-taro-D0h6aiDr.js";
|
|
5
|
+
import { g as getWindowInfo } from "./get-system-info-D27xNglo.js";
|
|
6
6
|
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { attract: false, direction: void 0, boundary: {
|
|
7
7
|
top: 0,
|
|
8
8
|
left: 0,
|
|
@@ -26,7 +26,7 @@ const Drag = (props) => {
|
|
|
26
26
|
const el = myDrag.current;
|
|
27
27
|
if (el) {
|
|
28
28
|
const { top, left, bottom, right } = boundary;
|
|
29
|
-
const { screenWidth, windowHeight } =
|
|
29
|
+
const { screenWidth, windowHeight } = getWindowInfo();
|
|
30
30
|
const { width, height, top: dragTop, left: dragLeft } = yield getRectByTaro(dragRef.current);
|
|
31
31
|
setBoundaryState({
|
|
32
32
|
top: -dragTop + top,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Taro from "@tarojs/taro";
|
|
2
|
+
const getDeviceInfo = () => {
|
|
3
|
+
return Taro.canIUse("getDeviceInfo") ? Taro.getDeviceInfo() : Taro.getSystemInfoSync();
|
|
4
|
+
};
|
|
5
|
+
const getWindowInfo = () => {
|
|
6
|
+
return Taro.canIUse("getWindowInfo") ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
getDeviceInfo as a,
|
|
10
|
+
getWindowInfo as g
|
|
11
|
+
};
|
|
@@ -2,7 +2,7 @@ import { _ as __rest } from "./tslib.es6-iWu3F_1J.js";
|
|
|
2
2
|
import React__default, { useRef, useState, useCallback, useEffect } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { ArrowUp, ArrowDown } from "@nutui/icons-react-taro";
|
|
5
|
-
import { M as MenuItem } from "./menuitem.taro-
|
|
5
|
+
import { M as MenuItem } from "./menuitem.taro-CnsORm5-.js";
|
|
6
6
|
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
7
7
|
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { activeColor: "", closeOnOverlayClick: true, scrollFixed: false, lockScroll: true, overlay: true, icon: null, onOpen: (index, from) => {
|
|
8
8
|
}, onClose: (index, from) => {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { a as __awaiter } from "./tslib.es6-iWu3F_1J.js";
|
|
2
2
|
import React__default, { forwardRef, useState, useRef, useEffect, useCallback, useMemo, useImperativeHandle } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import { usePageScroll } from "@tarojs/taro";
|
|
5
5
|
import { View } from "@tarojs/components";
|
|
6
6
|
import { CSSTransition } from "react-transition-group";
|
|
7
7
|
import { Check } from "@nutui/icons-react-taro";
|
|
8
|
+
import { g as getWindowInfo } from "./get-system-info-D27xNglo.js";
|
|
8
9
|
import { O as Overlay } from "./overlay.taro-C8eXSsJH.js";
|
|
9
10
|
import { g as getRectByTaro } from "./get-rect-by-taro-D0h6aiDr.js";
|
|
10
11
|
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
@@ -39,7 +40,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
39
40
|
useEffect(() => {
|
|
40
41
|
getParentOffset();
|
|
41
42
|
}, [showPopup, getParentOffset]);
|
|
42
|
-
const windowHeight = useMemo(() =>
|
|
43
|
+
const windowHeight = useMemo(() => getWindowInfo().windowHeight, []);
|
|
43
44
|
const updateItemOffset = useCallback(() => {
|
|
44
45
|
if (!parent.lockScroll)
|
|
45
46
|
return;
|
|
@@ -91,7 +92,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
91
92
|
bottom: "0",
|
|
92
93
|
height: "initial"
|
|
93
94
|
} : {
|
|
94
|
-
bottom: `${
|
|
95
|
+
bottom: `${getWindowInfo().windowHeight - position.top}px`,
|
|
95
96
|
top: "0",
|
|
96
97
|
height: "initial"
|
|
97
98
|
};
|
|
@@ -100,7 +101,7 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
100
101
|
if (direction === "down") {
|
|
101
102
|
return Object.assign({ height: `${position.top + position.height}px` }, isShow());
|
|
102
103
|
}
|
|
103
|
-
return Object.assign({ height: `${
|
|
104
|
+
return Object.assign({ height: `${getWindowInfo().windowHeight - position.top}px`, top: "auto" }, isShow());
|
|
104
105
|
};
|
|
105
106
|
return React__default.createElement(
|
|
106
107
|
View,
|
|
@@ -11,7 +11,7 @@ import { G as G2 } from "./griditem.taro-DMvds46i.js";
|
|
|
11
11
|
import { L } from "./layout.taro-DpiuZLLE.js";
|
|
12
12
|
import { R } from "./row.taro-ItEq1Bi5.js";
|
|
13
13
|
import { S } from "./space.taro-B1KsEPZL.js";
|
|
14
|
-
import { S as S2 } from "./sticky.taro-
|
|
14
|
+
import { S as S2 } from "./sticky.taro-l66r7WFn.js";
|
|
15
15
|
import { S as S3 } from "./safearea.taro-BJpvFsMf.js";
|
|
16
16
|
import { B as B2 } from "./backtop.taro-D3Lo3jFO.js";
|
|
17
17
|
import { E } from "./elevator.taro-C0Gs93x7.js";
|
|
@@ -25,9 +25,9 @@ import { T as T2 } from "./tabbaritem.taro-BiIVucQz.js";
|
|
|
25
25
|
import { T as T3 } from "./tabpane.taro-BAihO3w8.js";
|
|
26
26
|
import { T as T4 } from "./tabs.taro-sp_DNWis.js";
|
|
27
27
|
import { A } from "./address.taro-Ck0ZmxRg.js";
|
|
28
|
-
import { C as C5 } from "./calendar.taro-
|
|
29
|
-
import { C as C6 } from "./calendaritem.taro-
|
|
30
|
-
import { C as C7 } from "./calendarcard.taro-
|
|
28
|
+
import { C as C5 } from "./calendar.taro-CUDVpJBa.js";
|
|
29
|
+
import { C as C6 } from "./calendaritem.taro-DveeC4_t.js";
|
|
30
|
+
import { C as C7 } from "./calendarcard.taro-BiOnui_b.js";
|
|
31
31
|
import { C as C8 } from "./cascader.taro-DUJvcGw0.js";
|
|
32
32
|
import { C as C9, a as a2 } from "./checkbox.taro-CgqJyhrh.js";
|
|
33
33
|
import { D as D2 } from "./datepicker.taro-Dwh8sKhJ.js";
|
|
@@ -35,8 +35,8 @@ import { default as default2 } from "./Form.js";
|
|
|
35
35
|
import { F as F2 } from "./formitem.taro-Bee3MWwq.js";
|
|
36
36
|
import { I as I2 } from "./input.taro-CA9ZpM9a.js";
|
|
37
37
|
import { I as I3 } from "./inputnumber.taro-CZourWz-.js";
|
|
38
|
-
import { M } from "./menu.taro-
|
|
39
|
-
import { M as M2 } from "./menuitem.taro-
|
|
38
|
+
import { M } from "./menu.taro-9N8A5UoN.js";
|
|
39
|
+
import { M as M2 } from "./menuitem.taro-CnsORm5-.js";
|
|
40
40
|
import { N as N2 } from "./numberkeyboard.taro-BvVO_MyJ.js";
|
|
41
41
|
import { P } from "./picker.taro-B7EE52qf.js";
|
|
42
42
|
import { R as R2, a as a3 } from "./radio.taro-M2in687s.js";
|
|
@@ -51,7 +51,7 @@ import { U } from "./uploader.taro-BBJsHrew.js";
|
|
|
51
51
|
import { A as A2 } from "./actionsheet.taro-kMhbV73n.js";
|
|
52
52
|
import { B as B3 } from "./badge.taro-B42_7q8v.js";
|
|
53
53
|
import { B as B4 } from "./dialog.taro-yjDaaRHA.js";
|
|
54
|
-
import { D as D3 } from "./drag.taro-
|
|
54
|
+
import { D as D3 } from "./drag.taro-CHPSfySz.js";
|
|
55
55
|
import { E as E2 } from "./empty.taro-ChtnK90s.js";
|
|
56
56
|
import { I as I4 } from "./infiniteloading.taro-DzIrZvc0.js";
|
|
57
57
|
import { L as L2 } from "./loading.taro-n_qoNgCW.js";
|
|
@@ -59,11 +59,11 @@ import { N as N3 } from "./noticebar.taro-B0qm66Cu.js";
|
|
|
59
59
|
import { N as N4 } from "./notify.taro-BVXg7xTI.js";
|
|
60
60
|
import { P as P2 } from "./popover.taro-C9qhPJCb.js";
|
|
61
61
|
import { P as P3 } from "./popup.taro-JynjcLCn.js";
|
|
62
|
-
import { P as P4 } from "./pulltorefresh.taro-
|
|
62
|
+
import { P as P4 } from "./pulltorefresh.taro-DAFv7upo.js";
|
|
63
63
|
import { S as S11 } from "./skeleton.taro-D9Vkgsyx.js";
|
|
64
64
|
import { S as S12 } from "./swipe.taro-CUZSZcIh.js";
|
|
65
65
|
import { T as T6 } from "./toast.taro-Tx0IHbsl.js";
|
|
66
|
-
import { A as A3 } from "./animate.taro-
|
|
66
|
+
import { A as A3 } from "./animate.taro-BHDZMzJF.js";
|
|
67
67
|
import { default as default3 } from "./AnimatingNumbers.js";
|
|
68
68
|
import { A as A4 } from "./audio.taro-DtIUjg89.js";
|
|
69
69
|
import { A as A5 } from "./avatar.taro-9dU2KeWv.js";
|
|
@@ -86,14 +86,14 @@ import { T as T7 } from "./table.taro-1nFkDxbh.js";
|
|
|
86
86
|
import { T as T8 } from "./tag.taro-CFt28RLm.js";
|
|
87
87
|
import { T as T9 } from "./tour.taro-BidQx8Fg.js";
|
|
88
88
|
import { V } from "./video.taro-CecLv4sr.js";
|
|
89
|
-
import { V as V2 } from "./virtuallist.taro-
|
|
89
|
+
import { V as V2 } from "./virtuallist.taro-CQDtOwWn.js";
|
|
90
90
|
import { B as B5 } from "./barrage.taro-Dc2Wz_3H.js";
|
|
91
91
|
import { C as C14 } from "./card.taro-DxcIi5qH.js";
|
|
92
92
|
import { T as T10 } from "./timedetail.taro-ya5JNy2L.js";
|
|
93
93
|
import { T as T11 } from "./timeselect.taro-FIl91wiO.js";
|
|
94
94
|
import { T as T12 } from "./trendarrow.taro-DKx5cGIh.js";
|
|
95
95
|
import { W } from "./watermark.taro-CbO7mKFD.js";
|
|
96
|
-
import { A as A7 } from "./avatarcropper.taro-
|
|
96
|
+
import { A as A7 } from "./avatarcropper.taro-5JSFH7Q9.js";
|
|
97
97
|
export {
|
|
98
98
|
A2 as ActionSheet,
|
|
99
99
|
A as Address,
|
|
@@ -7,6 +7,7 @@ import Taro from "@tarojs/taro";
|
|
|
7
7
|
import { u as useConfig } from "./configprovider.taro-C3WyeHSO.js";
|
|
8
8
|
import { u as useTouch } from "./use-touch-BeiLHDO9.js";
|
|
9
9
|
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
10
|
+
import { a as getDeviceInfo } from "./get-system-info-D27xNglo.js";
|
|
10
11
|
function bound(position, min, max) {
|
|
11
12
|
let ret = position;
|
|
12
13
|
{
|
|
@@ -126,7 +127,7 @@ const PullToRefresh = (p) => {
|
|
|
126
127
|
setStatus("pulling");
|
|
127
128
|
}
|
|
128
129
|
};
|
|
129
|
-
const isAndroidWeApp =
|
|
130
|
+
const isAndroidWeApp = getDeviceInfo().platform === "android" && Taro.getEnv() === "WEAPP";
|
|
130
131
|
const springStyles = Object.assign({ height: `${height}px` }, !pullingRef.current || isAndroidWeApp ? { transition: "height .3s ease" } : {});
|
|
131
132
|
return React__default.createElement(
|
|
132
133
|
View,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { _ as __rest, a as __awaiter } from "./tslib.es6-iWu3F_1J.js";
|
|
2
2
|
import React__default, { useRef, useEffect, useState, useMemo, useCallback } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import { getEnv, usePageScroll
|
|
4
|
+
import { getEnv, usePageScroll } from "@tarojs/taro";
|
|
5
5
|
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
6
|
+
import { g as getWindowInfo } from "./get-system-info-D27xNglo.js";
|
|
6
7
|
import { g as getRectByTaro } from "./get-rect-by-taro-D0h6aiDr.js";
|
|
7
8
|
import { g as getScrollParent } from "./get-scroll-parent-DB1VRg11.js";
|
|
8
9
|
function useWatch(dep, callback, config = { immediate: false }) {
|
|
@@ -100,7 +101,7 @@ const Sticky = (props) => {
|
|
|
100
101
|
setFixed(threshold > curRootRect.top);
|
|
101
102
|
}
|
|
102
103
|
} else {
|
|
103
|
-
const windowHeight =
|
|
104
|
+
const windowHeight = getWindowInfo().windowHeight;
|
|
104
105
|
setFixed(windowHeight - threshold < curRootRect.bottom);
|
|
105
106
|
}
|
|
106
107
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as __rest } from "./tslib.es6-iWu3F_1J.js";
|
|
2
2
|
import React__default, { useMemo, useState, useRef, useEffect, useCallback } from "react";
|
|
3
3
|
import { View, ScrollView } from "@tarojs/components";
|
|
4
|
-
import { getSystemInfoSync } from "@tarojs/taro";
|
|
5
4
|
import classNames from "classnames";
|
|
5
|
+
import { g as getWindowInfo } from "./get-system-info-D27xNglo.js";
|
|
6
6
|
import { C as ComponentDefaults } from "./typings-DV9RBfhj.js";
|
|
7
7
|
const initPositinoCache = (reaItemSize, length = 0) => {
|
|
8
8
|
let index = 0;
|
|
@@ -48,7 +48,7 @@ const updateItemSize = (positions, items, sizeKey, margin) => {
|
|
|
48
48
|
const defaultProps = Object.assign(Object.assign({}, ComponentDefaults), { list: [], itemHeight: 66, margin: 10, itemEqual: true, overscan: 2 });
|
|
49
49
|
const VirtualList = (props) => {
|
|
50
50
|
const _a = Object.assign(Object.assign({}, defaultProps), props), { list, itemRender, itemHeight, margin, itemEqual, overscan, key, onScroll, className, containerHeight: origContainerHeight } = _a, rest = __rest(_a, ["list", "itemRender", "itemHeight", "margin", "itemEqual", "overscan", "key", "onScroll", "className", "containerHeight"]);
|
|
51
|
-
const clientHeight = useMemo(() =>
|
|
51
|
+
const clientHeight = useMemo(() => getWindowInfo().windowHeight - 5 || 667, []);
|
|
52
52
|
const containerHeight = useMemo(() => origContainerHeight !== null && origContainerHeight !== void 0 ? origContainerHeight : clientHeight, [origContainerHeight, clientHeight]);
|
|
53
53
|
const [startOffset, setStartOffset] = useState(0);
|
|
54
54
|
const start = useRef(0);
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/tr-TR.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED