@nutui/nutui-react-taro 1.4.5-beta.0 → 1.4.6-beta.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/CHANGELOG.md +8 -8
- package/dist/esm/ActionSheet.js +6 -5
- package/dist/esm/Address.js +8 -8
- package/dist/esm/Audio.js +8 -8
- package/dist/esm/Avatar.js +3 -3
- package/dist/esm/BackTop.js +3 -3
- package/dist/esm/Badge.js +3 -3
- package/dist/esm/Barrage.js +2 -2
- package/dist/esm/Button.js +3 -3
- package/dist/esm/Calendar.js +8 -7
- package/dist/esm/CalendarItem.js +3 -3
- package/dist/esm/Card.js +4 -4
- package/dist/esm/Cascader.js +7 -6
- package/dist/esm/Cell.js +3 -3
- package/dist/esm/Checkbox.js +3 -3
- package/dist/esm/CheckboxGroup.js +3 -3
- package/dist/esm/CollapseItem.js +3 -3
- package/dist/esm/DatePicker.js +8 -7
- package/dist/esm/Dialog.js +4 -4
- package/dist/esm/Drag.js +2 -2
- package/dist/esm/Elevator.js +2 -2
- package/dist/esm/Ellipsis.js +3 -3
- package/dist/esm/FixedNav.js +5 -4
- package/dist/esm/Form.js +5 -5
- package/dist/esm/FormItem.js +4 -4
- package/dist/esm/GridItem.js +3 -3
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Image.js +3 -3
- package/dist/esm/ImagePreview.js +6 -5
- package/dist/esm/Infiniteloading.js +3 -3
- package/dist/esm/Input.js +3 -3
- package/dist/esm/InputNumber.js +3 -3
- package/dist/esm/Menu.js +3 -3
- package/dist/esm/MenuItem.js +5 -4
- package/dist/esm/NavBar.js +3 -3
- package/dist/esm/NoticeBar.js +4 -4
- package/dist/esm/NumberKeyboard.js +6 -5
- package/dist/esm/Overlay.js +3 -2
- package/dist/esm/Picker.js +7 -6
- package/dist/esm/Popover.js +6 -5
- package/dist/esm/Popup.js +5 -4
- package/dist/esm/Progress.js +3 -3
- package/dist/esm/PullToRefresh.js +3 -2
- package/dist/esm/Radio.js +2 -2
- package/dist/esm/RadioGroup.js +3 -3
- package/dist/esm/Range.js +5 -5
- package/dist/esm/Rate.js +3 -3
- package/dist/esm/SearchBar.js +3 -3
- package/dist/esm/ShortPassword.js +6 -5
- package/dist/esm/SideNavBar.js +6 -5
- package/dist/esm/Signature.js +4 -4
- package/dist/esm/Skeleton.js +4 -4
- package/dist/esm/Step.js +3 -3
- package/dist/esm/Sticky.js +5 -5
- package/dist/esm/Swipe.js +3 -3
- package/dist/esm/TabbarItem.js +3 -3
- package/dist/esm/Table.js +3 -3
- package/dist/esm/Tabs.js +3 -3
- package/dist/esm/Tag.js +3 -3
- package/dist/esm/TimeSelect.js +6 -5
- package/dist/esm/Toast.js +3 -3
- package/dist/esm/TrendArrow.js +3 -3
- package/dist/esm/Uploader.js +7 -7
- package/dist/esm/VirtualList.js +2 -2
- package/dist/esm/{actionsheet.taro-a58d3d12.js → actionsheet.taro-27121a38.js} +1 -1
- package/dist/esm/{address.taro-79cc7c96.js → address.taro-dd602937.js} +12 -12
- package/dist/esm/{audio.taro-4fadc583.js → audio.taro-cf530b91.js} +5 -5
- package/dist/esm/{avatar.taro-85ced995.js → avatar.taro-1d2bf09a.js} +1 -2
- package/dist/esm/{backtop.taro-99107c30.js → backtop.taro-e53236c7.js} +3 -3
- package/dist/esm/{badge.taro-fe9171ec.js → badge.taro-11e2ec95.js} +1 -1
- package/dist/esm/{barrage.taro-0e157b5e.js → barrage.taro-e4fe81ae.js} +2 -2
- package/dist/esm/{button.taro-4ce133b9.js → button.taro-b7c5f5a7.js} +1 -1
- package/dist/esm/{calendar.taro-4ed72058.js → calendar.taro-05c40d76.js} +2 -2
- package/dist/esm/{calendaritem.taro-1ebe428d.js → calendaritem.taro-3cfd4186.js} +1 -1
- package/dist/esm/{card.taro-39055e82.js → card.taro-7e85c3da.js} +1 -1
- package/dist/esm/{cascader.taro-d8cb1c3e.js → cascader.taro-66462c03.js} +3 -3
- package/dist/esm/{cell.taro-9a04a92e.js → cell.taro-e877cf12.js} +3 -3
- package/dist/esm/{checkbox.taro-0bda9796.js → checkbox.taro-04da7151.js} +1 -1
- package/dist/esm/{collapseitem-ce1849d2.js → collapseitem-2e864527.js} +1 -1
- package/dist/esm/{datepicker.taro-7220e495.js → datepicker.taro-8507d826.js} +1 -1
- package/dist/esm/{dialog.taro-1c03960e.js → dialog.taro-0f64e21a.js} +1 -1
- package/dist/esm/{drag.taro-82b6b27a.js → drag.taro-703560c4.js} +3 -3
- package/dist/esm/{elevator.taro-d7d65470.js → elevator.taro-68cfaaee.js} +4 -4
- package/dist/esm/{ellipsis.taro-49b6db0c.js → ellipsis.taro-71021671.js} +1 -1
- package/dist/esm/{fixednav.taro-5ad15202.js → fixednav.taro-84930e08.js} +2 -2
- package/dist/esm/{form.taro-71d32671.js → form.taro-ce791a58.js} +1 -1
- package/dist/esm/{formitem.taro-3089489b.js → formitem.taro-f2ed02d4.js} +1 -1
- package/dist/esm/get-scroll-parent-3dcd3f53.js +28 -0
- package/dist/esm/{griditem.taro-4cade72e.js → griditem.taro-5406bd2c.js} +1 -1
- package/dist/esm/{icon-8dc4de10.js → icon-2242973e.js} +13 -4
- package/dist/esm/{icon.taro-1d0d4fb7.js → icon.taro-c9254a81.js} +13 -4
- package/dist/esm/{image.taro-e6dc5867.js → image.taro-1d867416.js} +1 -1
- package/dist/esm/{imagepreview.taro-3400ea03.js → imagepreview.taro-83481e13.js} +1 -1
- package/dist/esm/{index.taro-a36f96fb.js → index.taro-cd52b23f.js} +1 -1
- package/dist/esm/{infiniteloading.taro-6c2a2e95.js → infiniteloading.taro-e5be6795.js} +1 -1
- package/dist/esm/{input.taro-fd566407.js → input.taro-991945d1.js} +1 -1
- package/dist/esm/{inputnumber.taro-dc39b853.js → inputnumber.taro-e909d932.js} +1 -1
- package/dist/esm/{menu.taro-4abed328.js → menu.taro-e5b84501.js} +1 -1
- package/dist/esm/{menuitem.taro-6e8b27c3.js → menuitem.taro-f2129be6.js} +2 -2
- package/dist/esm/{navbar.taro-c931c078.js → navbar.taro-70514adf.js} +1 -1
- package/dist/esm/{noticebar.taro-69ea7673.js → noticebar.taro-22486646.js} +2 -4
- package/dist/esm/{numberkeyboard.taro-194519e4.js → numberkeyboard.taro-d2ccbce5.js} +1 -1
- package/dist/esm/nutui-react.es.js +66 -65
- package/dist/esm/{overlay.taro-98367bc1.js → overlay.taro-1e74a71d.js} +5 -4
- package/dist/esm/{picker.taro-2a8ded7c.js → picker.taro-6128297f.js} +2 -2
- package/dist/esm/{popover.taro-46d813e8.js → popover.taro-fc7b9a73.js} +3 -3
- package/dist/esm/{popup.taro-cb777e09.js → popup.taro-89809b25.js} +6 -7
- package/dist/esm/{progress.taro-623bc807.js → progress.taro-18e015e4.js} +1 -1
- package/dist/esm/{pulltorefresh.taro-cab7b51c.js → pulltorefresh.taro-2b50fdf3.js} +1 -27
- package/dist/esm/{range.taro-5d6ff217.js → range.taro-b628f1ed.js} +2 -2
- package/dist/esm/{rate.taro-10197384.js → rate.taro-17b84a51.js} +1 -1
- package/dist/esm/{searchbar.taro-839dd622.js → searchbar.taro-141827e2.js} +5 -5
- package/dist/esm/{shortpassword.taro-182d46f7.js → shortpassword.taro-e1f53ee7.js} +2 -2
- package/dist/esm/{sidenavbar.taro-006cf38b.js → sidenavbar.taro-f44d12ac.js} +1 -1
- package/dist/esm/{signature.taro-33632585.js → signature.taro-d3416fcd.js} +1 -1
- package/dist/esm/{skeleton.taro-853ce460.js → skeleton.taro-6821b2c6.js} +1 -1
- package/dist/esm/{step.taro-1c94e067.js → step.taro-891c020b.js} +1 -1
- package/dist/esm/sticky.taro-2d9b2804.js +133 -0
- package/dist/esm/{swipe.taro-83bc248f.js → swipe.taro-e6c2b808.js} +1 -1
- package/dist/esm/{tabbaritem.taro-8dfb8055.js → tabbaritem.taro-f4a91070.js} +1 -1
- package/dist/esm/{table.taro-cb4dd2c3.js → table.taro-d9b2794b.js} +1 -1
- package/dist/esm/{tabs.taro-e71875fa.js → tabs.taro-5030ce68.js} +1 -1
- package/dist/esm/{tag.taro-00fe554d.js → tag.taro-213ec444.js} +1 -1
- package/dist/esm/{timeselect.taro-3ecce65d.js → timeselect.taro-b04b1538.js} +1 -1
- package/dist/esm/{toast.taro-0804b6b4.js → toast.taro-0f972a92.js} +1 -1
- package/dist/esm/{trendarrow.taro-5a7153e4.js → trendarrow.taro-d79fc8e2.js} +1 -1
- package/dist/esm/types/src/packages/audio/audio.taro.d.ts +6 -6
- package/dist/esm/types/src/packages/image/image.d.ts +3 -0
- package/dist/esm/types/src/packages/overlay/overlay.taro.d.ts +3 -1
- package/dist/esm/types/src/packages/popover/popover.taro.d.ts +2 -1
- package/dist/esm/types/src/packages/popup/popup.taro.d.ts +3 -3
- package/dist/esm/types/src/packages/sticky/sticky.taro.d.ts +11 -2
- package/dist/esm/types/src/packages/uploader/uploader.taro.d.ts +1 -1
- package/dist/esm/{uploader.taro-f80d76d9.js → uploader.taro-1d745f4a.js} +17 -17
- package/dist/esm/{useClientRect-bf69d7b3.js → useClientRect-4506e52f.js} +5 -2
- package/dist/esm/{virtuallist.taro-e3345ced.js → virtuallist.taro-1688484f.js} +7 -8
- 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/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 +256 -111
- package/dist/nutui.react.umd.js +252 -107
- package/dist/packages/calendar/calendar.scss +19 -1
- package/dist/packages/image/image.scss +2 -0
- package/dist/packages/input/input.scss +3 -18
- package/dist/packages/notify/notify.scss +23 -19
- package/dist/packages/popup/popup.scss +130 -93
- package/dist/packages/searchbar/searchbar.scss +6 -20
- package/dist/packages/sticky/sticky.scss +3 -0
- package/dist/packages/tag/tag.scss +6 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +1 -3
- package/dist/types/index.d.ts +22 -15
- package/package.json +2 -2
- package/dist/esm/sticky.taro-d0553f48.js +0 -13
package/dist/nutui.react.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui-react-taro v1.4.
|
|
2
|
+
* @nutui/nutui-react-taro v1.4.6-beta.0 Wed Feb 08 2023 14:26:14 GMT+0800 (China Standard Time)
|
|
3
3
|
* (c) 2023 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -100,7 +100,13 @@
|
|
|
100
100
|
className: ""
|
|
101
101
|
};
|
|
102
102
|
function pxCheck$3(value) {
|
|
103
|
-
|
|
103
|
+
if (value === "") {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
if (Number.isNaN(Number(value))) {
|
|
107
|
+
return String(value);
|
|
108
|
+
}
|
|
109
|
+
return `${value}px`;
|
|
104
110
|
}
|
|
105
111
|
function Icon$1(props) {
|
|
106
112
|
const {
|
|
@@ -132,15 +138,18 @@
|
|
|
132
138
|
return { src: name };
|
|
133
139
|
return {};
|
|
134
140
|
};
|
|
141
|
+
const styles = {};
|
|
142
|
+
const checkedSize = pxCheck$3(size);
|
|
143
|
+
if (checkedSize) {
|
|
144
|
+
styles.width = styles.height = styles.fontSize = checkedSize;
|
|
145
|
+
}
|
|
135
146
|
return React__default["default"].createElement(
|
|
136
147
|
type,
|
|
137
148
|
{
|
|
138
149
|
className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
|
|
139
150
|
style: {
|
|
140
151
|
color,
|
|
141
|
-
|
|
142
|
-
width: pxCheck$3(size),
|
|
143
|
-
height: pxCheck$3(size),
|
|
152
|
+
...styles,
|
|
144
153
|
...style
|
|
145
154
|
},
|
|
146
155
|
...rest,
|
|
@@ -324,7 +333,7 @@
|
|
|
324
333
|
onClick(event);
|
|
325
334
|
const link = to2 || url;
|
|
326
335
|
if (link) {
|
|
327
|
-
replace ?
|
|
336
|
+
replace ? Taro.redirectTo({ url: link }) : Taro.navigateTo({ url: link });
|
|
328
337
|
}
|
|
329
338
|
};
|
|
330
339
|
const baseStyle = {
|
|
@@ -985,6 +994,11 @@
|
|
|
985
994
|
})();
|
|
986
995
|
})(classnames);
|
|
987
996
|
var classNames = classnames.exports;
|
|
997
|
+
var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
998
|
+
__proto__: null
|
|
999
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1000
|
+
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index_cjs$1);
|
|
1001
|
+
var index_cjs = require$$0;
|
|
988
1002
|
const defaultOverlayProps = {
|
|
989
1003
|
zIndex: 2e3,
|
|
990
1004
|
duration: 0.3,
|
|
@@ -1004,6 +1018,7 @@
|
|
|
1004
1018
|
visible,
|
|
1005
1019
|
lockScroll,
|
|
1006
1020
|
overlayStyle,
|
|
1021
|
+
onClick,
|
|
1007
1022
|
...rest
|
|
1008
1023
|
} = {
|
|
1009
1024
|
...defaultOverlayProps,
|
|
@@ -1045,9 +1060,9 @@
|
|
|
1045
1060
|
document.body.classList.remove("nut-overflow-hidden");
|
|
1046
1061
|
}
|
|
1047
1062
|
};
|
|
1048
|
-
const handleClick = (
|
|
1063
|
+
const handleClick = (event) => {
|
|
1049
1064
|
if (closeOnClickOverlay) {
|
|
1050
|
-
|
|
1065
|
+
onClick && onClick(event);
|
|
1051
1066
|
renderRef.current = false;
|
|
1052
1067
|
const id = window.setTimeout(() => {
|
|
1053
1068
|
setShow(!visible);
|
|
@@ -1055,10 +1070,11 @@
|
|
|
1055
1070
|
intervalRef.current = id;
|
|
1056
1071
|
}
|
|
1057
1072
|
};
|
|
1058
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(
|
|
1073
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(index_cjs.View, {
|
|
1059
1074
|
className: classes,
|
|
1060
1075
|
style: styles,
|
|
1061
1076
|
...rest,
|
|
1077
|
+
catchMove: lockScroll,
|
|
1062
1078
|
onClick: handleClick
|
|
1063
1079
|
}, children));
|
|
1064
1080
|
};
|
|
@@ -1545,8 +1561,6 @@
|
|
|
1545
1561
|
},
|
|
1546
1562
|
onClose: () => {
|
|
1547
1563
|
},
|
|
1548
|
-
onClick: (e2) => {
|
|
1549
|
-
},
|
|
1550
1564
|
onOpened: (e2) => {
|
|
1551
1565
|
},
|
|
1552
1566
|
onClosed: (e2) => {
|
|
@@ -1610,15 +1624,15 @@
|
|
|
1610
1624
|
const classes = classNames(
|
|
1611
1625
|
{
|
|
1612
1626
|
round,
|
|
1613
|
-
[`popup-${position}`]: true,
|
|
1627
|
+
[`nut-popup-${position}`]: true,
|
|
1614
1628
|
[`${popClass}`]: true,
|
|
1615
1629
|
[`${className}`]: true
|
|
1616
1630
|
},
|
|
1617
1631
|
b2("")
|
|
1618
1632
|
);
|
|
1619
1633
|
const closeClasses = classNames({
|
|
1620
|
-
"
|
|
1621
|
-
[`
|
|
1634
|
+
"nut-popup__close-icon": true,
|
|
1635
|
+
[`nut-popup__close-icon--${closeIconPosition}`]: true
|
|
1622
1636
|
});
|
|
1623
1637
|
const open = () => {
|
|
1624
1638
|
if (!innerVisible) {
|
|
@@ -1710,7 +1724,7 @@
|
|
|
1710
1724
|
!visible && close();
|
|
1711
1725
|
}, [visible]);
|
|
1712
1726
|
React.useEffect(() => {
|
|
1713
|
-
setTransitionName(transition || `popup-slide-${position}`);
|
|
1727
|
+
setTransitionName(transition || `nut-popup-slide-${position}`);
|
|
1714
1728
|
}, [position]);
|
|
1715
1729
|
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, renderToContainer(teleport, renderNode()));
|
|
1716
1730
|
};
|
|
@@ -2058,34 +2072,173 @@
|
|
|
2058
2072
|
};
|
|
2059
2073
|
Row.defaultProps = defaultProps$1j;
|
|
2060
2074
|
Row.displayName = "NutRow";
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2075
|
+
function useWatch(dep, callback, config2 = { immediate: false }) {
|
|
2076
|
+
const { immediate } = config2;
|
|
2077
|
+
const prev = React.useRef();
|
|
2078
|
+
const inited = React.useRef(false);
|
|
2079
|
+
const stop2 = React.useRef(false);
|
|
2080
|
+
React.useEffect(() => {
|
|
2081
|
+
const execute = () => callback(prev.current);
|
|
2082
|
+
if (!stop2.current) {
|
|
2083
|
+
if (!inited.current) {
|
|
2084
|
+
inited.current = true;
|
|
2085
|
+
if (immediate) {
|
|
2086
|
+
execute();
|
|
2087
|
+
}
|
|
2088
|
+
} else {
|
|
2089
|
+
execute();
|
|
2090
|
+
}
|
|
2091
|
+
prev.current = dep;
|
|
2092
|
+
}
|
|
2093
|
+
}, [dep]);
|
|
2094
|
+
return () => {
|
|
2095
|
+
stop2.current = true;
|
|
2096
|
+
};
|
|
2097
|
+
}
|
|
2098
|
+
const getRectByTaro = async (element) => {
|
|
2099
|
+
if (element) {
|
|
2100
|
+
const res = await element.getBoundingClientRect();
|
|
2101
|
+
return res;
|
|
2064
2102
|
}
|
|
2103
|
+
return Promise.resolve({});
|
|
2065
2104
|
};
|
|
2066
|
-
const
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2105
|
+
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
2106
|
+
const defaultRoot = canUseDom ? window : void 0;
|
|
2107
|
+
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
2108
|
+
function isElement(node) {
|
|
2109
|
+
const ELEMENT_NODE_TYPE = 1;
|
|
2110
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
2111
|
+
}
|
|
2112
|
+
function getScrollParent(el, root2 = defaultRoot) {
|
|
2113
|
+
let node = el;
|
|
2114
|
+
while (node && node !== root2 && isElement(node)) {
|
|
2115
|
+
if (node === document.body) {
|
|
2116
|
+
return root2;
|
|
2117
|
+
}
|
|
2118
|
+
const { overflowY } = window.getComputedStyle(node);
|
|
2119
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
2120
|
+
return node;
|
|
2121
|
+
}
|
|
2122
|
+
node = node.parentNode;
|
|
2123
|
+
}
|
|
2124
|
+
return root2;
|
|
2125
|
+
}
|
|
2126
|
+
const defaultProps$1i = {
|
|
2127
|
+
position: "top",
|
|
2128
|
+
top: 0,
|
|
2129
|
+
bottom: 0,
|
|
2130
|
+
zIndex: 2e3
|
|
2073
2131
|
};
|
|
2074
|
-
const defaultProps$1i = {};
|
|
2075
2132
|
const Sticky = (props) => {
|
|
2076
|
-
|
|
2077
|
-
|
|
2133
|
+
const {
|
|
2134
|
+
position = "top",
|
|
2135
|
+
top = 0,
|
|
2136
|
+
bottom = 0,
|
|
2137
|
+
zIndex = 2e3,
|
|
2138
|
+
children,
|
|
2139
|
+
container,
|
|
2140
|
+
className,
|
|
2141
|
+
onChange,
|
|
2142
|
+
...rest
|
|
2143
|
+
} = props;
|
|
2144
|
+
const stickyRef = React.useRef(null);
|
|
2145
|
+
const rootRef = React.useRef(null);
|
|
2146
|
+
const offset = position === "top" ? top : bottom;
|
|
2147
|
+
const [rootRect, setRootRect] = React.useState({});
|
|
2148
|
+
const [fixed, setFixed] = React.useState(false);
|
|
2149
|
+
const [transform, setTransform] = React.useState(0);
|
|
2150
|
+
useWatch(fixed, () => {
|
|
2151
|
+
onChange && onChange(fixed);
|
|
2152
|
+
});
|
|
2153
|
+
const rootStyle = React.useMemo(() => {
|
|
2154
|
+
if (!fixed) {
|
|
2155
|
+
return {
|
|
2156
|
+
height: "",
|
|
2157
|
+
width: ""
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
const style = {};
|
|
2161
|
+
if (rootRect.height) {
|
|
2162
|
+
style.height = rootRect.height;
|
|
2163
|
+
}
|
|
2164
|
+
if (rootRect.width) {
|
|
2165
|
+
style.width = rootRect.width;
|
|
2166
|
+
}
|
|
2167
|
+
return style;
|
|
2168
|
+
}, [fixed, rootRect.height, rootRect.width]);
|
|
2169
|
+
const stickyStyle = React.useMemo(() => {
|
|
2170
|
+
if (!fixed) {
|
|
2171
|
+
return {
|
|
2172
|
+
height: "",
|
|
2173
|
+
width: "",
|
|
2174
|
+
[position]: ""
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
let style = {};
|
|
2178
|
+
if (rootRect.height)
|
|
2179
|
+
style.height = rootRect.height;
|
|
2180
|
+
if (rootRect.width)
|
|
2181
|
+
style.width = rootRect.width;
|
|
2182
|
+
style.transform = `translate3d(0, ${transform}px, 0)`;
|
|
2183
|
+
style[position] = offset;
|
|
2184
|
+
style.zIndex = zIndex;
|
|
2185
|
+
return style;
|
|
2186
|
+
}, [fixed, rootRect.height, rootRect.width, transform, position]);
|
|
2187
|
+
const handleScroll = async (scrollTop) => {
|
|
2188
|
+
const curRootRect = await getRectByTaro(rootRef.current);
|
|
2189
|
+
const stickyRect = await getRectByTaro(stickyRef.current);
|
|
2190
|
+
if (curRootRect && stickyRect) {
|
|
2191
|
+
setRootRect(curRootRect);
|
|
2192
|
+
if (position === "top") {
|
|
2193
|
+
if (container) {
|
|
2194
|
+
const containerRect = await getRectByTaro(container.current);
|
|
2195
|
+
const difference = containerRect.bottom - top - curRootRect.height;
|
|
2196
|
+
const curTransform = difference < 0 ? difference : 0;
|
|
2197
|
+
setTransform(curTransform);
|
|
2198
|
+
const curFixed = top > curRootRect.top && containerRect.bottom > 0;
|
|
2199
|
+
setFixed(curFixed);
|
|
2200
|
+
} else {
|
|
2201
|
+
setFixed(top > curRootRect.top);
|
|
2202
|
+
}
|
|
2203
|
+
} else {
|
|
2204
|
+
const windowHeight = Taro.getSystemInfoSync().windowHeight;
|
|
2205
|
+
setFixed(windowHeight - offset < curRootRect.bottom);
|
|
2206
|
+
}
|
|
2207
|
+
} else {
|
|
2208
|
+
console.log("getRectByTaro\u83B7\u53D6\u5931\u8D25", { stickyRect, curRootRect });
|
|
2209
|
+
}
|
|
2210
|
+
};
|
|
2211
|
+
const getElement = React.useCallback(() => {
|
|
2212
|
+
return getScrollParent(rootRef.current);
|
|
2213
|
+
}, []);
|
|
2214
|
+
React.useEffect(() => {
|
|
2215
|
+
if (Taro.getEnv() === "WEB" && getElement() !== window) {
|
|
2216
|
+
window.addEventListener("touchmove", handleScroll, true);
|
|
2217
|
+
window.addEventListener("scroll", handleScroll, true);
|
|
2218
|
+
return () => {
|
|
2219
|
+
window.removeEventListener("touchmove", handleScroll);
|
|
2220
|
+
window.removeEventListener("scroll", handleScroll);
|
|
2221
|
+
};
|
|
2222
|
+
}
|
|
2223
|
+
}, []);
|
|
2224
|
+
Taro.usePageScroll((res) => {
|
|
2225
|
+
if (Taro.getEnv() === "WEAPP") {
|
|
2226
|
+
handleScroll(res.scrollTop);
|
|
2227
|
+
}
|
|
2228
|
+
});
|
|
2078
2229
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2079
|
-
|
|
2080
|
-
|
|
2230
|
+
ref: rootRef,
|
|
2231
|
+
style: rootStyle,
|
|
2232
|
+
className: `nut-sticky ${className}`,
|
|
2233
|
+
...rest
|
|
2234
|
+
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
2235
|
+
className: `nut-sticky-box ${fixed ? "nut-sticky-fixed" : ""}`,
|
|
2236
|
+
ref: stickyRef,
|
|
2237
|
+
style: stickyStyle
|
|
2238
|
+
}, children));
|
|
2081
2239
|
};
|
|
2082
2240
|
Sticky.defaultProps = defaultProps$1i;
|
|
2083
2241
|
Sticky.displayName = "NutSticky";
|
|
2084
|
-
var index_cjs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2085
|
-
__proto__: null
|
|
2086
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2087
|
-
var require$$0 = /* @__PURE__ */ getAugmentedNamespace(index_cjs$1);
|
|
2088
|
-
var index_cjs = require$$0;
|
|
2089
2242
|
const elevatorContext = React.createContext({});
|
|
2090
2243
|
const defaultProps$1h = {
|
|
2091
2244
|
height: "200px",
|
|
@@ -2153,7 +2306,7 @@
|
|
|
2153
2306
|
let height2 = 0;
|
|
2154
2307
|
state.current.listHeight.push(height2);
|
|
2155
2308
|
for (let i = 0; i < state.current.listGroup.length; i++) {
|
|
2156
|
-
const query =
|
|
2309
|
+
const query = Taro.createSelectorQuery();
|
|
2157
2310
|
query.selectAll(`.${className} .elevator__item__${i}`).boundingClientRect();
|
|
2158
2311
|
query.exec((res) => {
|
|
2159
2312
|
if (res[0][0])
|
|
@@ -2211,7 +2364,7 @@
|
|
|
2211
2364
|
};
|
|
2212
2365
|
const setListGroup = () => {
|
|
2213
2366
|
if (listview.current) {
|
|
2214
|
-
|
|
2367
|
+
Taro.createSelectorQuery().selectAll(`.${className} .nut-elevator__list__item`).node((el) => {
|
|
2215
2368
|
state.current.listGroup = [...Object.keys(el)];
|
|
2216
2369
|
calculateHeight();
|
|
2217
2370
|
}).exec();
|
|
@@ -2239,7 +2392,7 @@
|
|
|
2239
2392
|
};
|
|
2240
2393
|
React.useEffect(() => {
|
|
2241
2394
|
if (listview.current) {
|
|
2242
|
-
|
|
2395
|
+
Taro.nextTick(() => {
|
|
2243
2396
|
setListGroup();
|
|
2244
2397
|
});
|
|
2245
2398
|
}
|
|
@@ -3534,10 +3687,6 @@
|
|
|
3534
3687
|
};
|
|
3535
3688
|
}
|
|
3536
3689
|
var requestAniFrame$1 = requestAniFrame();
|
|
3537
|
-
const getRectByTaro = async (element) => {
|
|
3538
|
-
const res = await element.getBoundingClientRect();
|
|
3539
|
-
return res;
|
|
3540
|
-
};
|
|
3541
3690
|
const defaultProps$14 = {
|
|
3542
3691
|
type: "one",
|
|
3543
3692
|
isAutoBackFill: false,
|
|
@@ -6762,7 +6911,13 @@
|
|
|
6762
6911
|
className: ""
|
|
6763
6912
|
};
|
|
6764
6913
|
function pxCheck(value) {
|
|
6765
|
-
|
|
6914
|
+
if (value === "") {
|
|
6915
|
+
return value;
|
|
6916
|
+
}
|
|
6917
|
+
if (Number.isNaN(Number(value))) {
|
|
6918
|
+
return String(value);
|
|
6919
|
+
}
|
|
6920
|
+
return `${value}px`;
|
|
6766
6921
|
}
|
|
6767
6922
|
function Icon(props) {
|
|
6768
6923
|
const {
|
|
@@ -6794,15 +6949,18 @@
|
|
|
6794
6949
|
return { src: name };
|
|
6795
6950
|
return {};
|
|
6796
6951
|
};
|
|
6952
|
+
const styles = {};
|
|
6953
|
+
const checkedSize = pxCheck(size);
|
|
6954
|
+
if (checkedSize) {
|
|
6955
|
+
styles.width = styles.height = styles.fontSize = checkedSize;
|
|
6956
|
+
}
|
|
6797
6957
|
return React__default["default"].createElement(
|
|
6798
6958
|
type,
|
|
6799
6959
|
{
|
|
6800
6960
|
className: isImage ? `${b2("img")} ${className || ""} ` : `${fontClassName} ${b2(null)} ${classPrefix}-${name} ${className || ""}`,
|
|
6801
6961
|
style: {
|
|
6802
6962
|
color,
|
|
6803
|
-
|
|
6804
|
-
width: pxCheck(size),
|
|
6805
|
-
height: pxCheck(size),
|
|
6963
|
+
...styles,
|
|
6806
6964
|
...style
|
|
6807
6965
|
},
|
|
6808
6966
|
...rest,
|
|
@@ -7526,7 +7684,7 @@
|
|
|
7526
7684
|
return /* @__PURE__ */ React__default["default"].createElement("input", {
|
|
7527
7685
|
className: `${searchbarBem("input")} ${searchbarBem(alignClass)} ${shape === "round" ? searchbarBem("round") : ""} ${clearable ? searchbarBem("input-clear") : ""}`,
|
|
7528
7686
|
ref: searchRef,
|
|
7529
|
-
style: { ...props.style
|
|
7687
|
+
style: { ...props.style },
|
|
7530
7688
|
value: value || "",
|
|
7531
7689
|
placeholder: placeholder || locale.placeholder,
|
|
7532
7690
|
disabled,
|
|
@@ -7636,13 +7794,14 @@
|
|
|
7636
7794
|
return null;
|
|
7637
7795
|
};
|
|
7638
7796
|
const envClass = () => {
|
|
7639
|
-
return
|
|
7797
|
+
return Taro.getEnv() === "WEB" ? "nut-searchbar-taro" : "";
|
|
7640
7798
|
};
|
|
7641
7799
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7642
7800
|
className: `${searchbarBem()} ${envClass()} ${disabled ? searchbarBem("disabled") : ""} ${className || ""}`,
|
|
7643
7801
|
style: { ...props.style, background: props.background }
|
|
7644
7802
|
}, renderLeftoutIcon(), renderLabel(), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7645
|
-
className: `${searchbarBem("content")}
|
|
7803
|
+
className: `${searchbarBem("content")}`,
|
|
7804
|
+
style: { background: props.inputBackground }
|
|
7646
7805
|
}, renderLeftinIcon(), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
7647
7806
|
className: "nut-searchbar__input-box"
|
|
7648
7807
|
}, renderField()), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
@@ -8223,7 +8382,7 @@
|
|
|
8223
8382
|
React.useImperativeHandle(ref, () => ({
|
|
8224
8383
|
submit: () => {
|
|
8225
8384
|
Promise.all(uploadQueue).then((res) => {
|
|
8226
|
-
res.forEach((i) => i.uploadTaro(
|
|
8385
|
+
res.forEach((i) => i.uploadTaro(Taro.uploadFile, Taro.getEnv()));
|
|
8227
8386
|
});
|
|
8228
8387
|
}
|
|
8229
8388
|
}));
|
|
@@ -8235,11 +8394,11 @@
|
|
|
8235
8394
|
setUploadQueue([]);
|
|
8236
8395
|
}
|
|
8237
8396
|
};
|
|
8238
|
-
const
|
|
8397
|
+
const _chooseImage = () => {
|
|
8239
8398
|
if (disabled) {
|
|
8240
8399
|
return;
|
|
8241
8400
|
}
|
|
8242
|
-
|
|
8401
|
+
Taro.chooseImage({
|
|
8243
8402
|
count: maximum * 1 - fileList.length,
|
|
8244
8403
|
sizeType,
|
|
8245
8404
|
sourceType,
|
|
@@ -8317,7 +8476,7 @@
|
|
|
8317
8476
|
};
|
|
8318
8477
|
const task = new Upload(uploadOption);
|
|
8319
8478
|
if (props.autoUpload) {
|
|
8320
|
-
task.uploadTaro(
|
|
8479
|
+
task.uploadTaro(Taro.uploadFile, Taro.getEnv());
|
|
8321
8480
|
} else {
|
|
8322
8481
|
uploadQueue.push(
|
|
8323
8482
|
new Promise((resolve, reject) => {
|
|
@@ -8342,7 +8501,7 @@
|
|
|
8342
8501
|
fileItem.status = "ready";
|
|
8343
8502
|
fileItem.message = locale.uploader.readyUpload;
|
|
8344
8503
|
fileItem.type = fileType;
|
|
8345
|
-
if (
|
|
8504
|
+
if (Taro.getEnv() === "WEB") {
|
|
8346
8505
|
const formData = new FormData();
|
|
8347
8506
|
for (const [key, value] of Object.entries(data)) {
|
|
8348
8507
|
formData.append(key, value);
|
|
@@ -8376,7 +8535,7 @@
|
|
|
8376
8535
|
if (oversizes.length) {
|
|
8377
8536
|
onOversize && onOversize(files);
|
|
8378
8537
|
}
|
|
8379
|
-
|
|
8538
|
+
const currentFileLength = filterFile.length + fileList.length;
|
|
8380
8539
|
if (currentFileLength > maximum2) {
|
|
8381
8540
|
filterFile.splice(filterFile.length - (currentFileLength - maximum2));
|
|
8382
8541
|
}
|
|
@@ -8415,12 +8574,12 @@
|
|
|
8415
8574
|
className: "nut-uploader__slot"
|
|
8416
8575
|
}, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children, maximum > fileList.length && /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
8417
8576
|
className: "nut-uploader__input",
|
|
8418
|
-
onClick:
|
|
8577
|
+
onClick: _chooseImage
|
|
8419
8578
|
}))), fileList.length !== 0 && fileList.map((item, index) => {
|
|
8420
8579
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8421
8580
|
className: `nut-uploader__preview ${listType}`,
|
|
8422
8581
|
key: item.uid
|
|
8423
|
-
}, listType
|
|
8582
|
+
}, listType === "picture" && !children && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8424
8583
|
className: "nut-uploader__preview-img"
|
|
8425
8584
|
}, item.status === "ready" ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8426
8585
|
className: "nut-uploader__preview__progress"
|
|
@@ -8432,7 +8591,7 @@
|
|
|
8432
8591
|
classPrefix: props.iconClassPrefix,
|
|
8433
8592
|
fontClassName: props.iconFontClassName,
|
|
8434
8593
|
color: "#fff",
|
|
8435
|
-
name: `${item.status
|
|
8594
|
+
name: `${item.status === "error" ? "failure" : "loading"}`
|
|
8436
8595
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8437
8596
|
className: "nut-uploader__preview__progress__msg"
|
|
8438
8597
|
}, item.message)), isDeletable && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
@@ -8445,10 +8604,12 @@
|
|
|
8445
8604
|
}), item.type.includes("image") ? /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, item.url && /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
8446
8605
|
className: "nut-uploader__preview-img__c",
|
|
8447
8606
|
src: item.url,
|
|
8607
|
+
alt: "",
|
|
8448
8608
|
onClick: () => handleItemClick(item)
|
|
8449
8609
|
})) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, defaultImg ? /* @__PURE__ */ React__default["default"].createElement("img", {
|
|
8450
8610
|
className: "nut-uploader__preview-img__c",
|
|
8451
8611
|
src: defaultImg,
|
|
8612
|
+
alt: "",
|
|
8452
8613
|
onClick: () => handleItemClick(item)
|
|
8453
8614
|
}) : /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
8454
8615
|
className: "nut-uploader__preview-img__file"
|
|
@@ -8494,7 +8655,7 @@
|
|
|
8494
8655
|
name: uploadIcon
|
|
8495
8656
|
}), /* @__PURE__ */ React__default["default"].createElement(Button, {
|
|
8496
8657
|
className: "nut-uploader__input",
|
|
8497
|
-
onClick:
|
|
8658
|
+
onClick: _chooseImage
|
|
8498
8659
|
})));
|
|
8499
8660
|
};
|
|
8500
8661
|
const Uploader = React__default["default"].forwardRef(InternalUploader);
|
|
@@ -8616,7 +8777,7 @@
|
|
|
8616
8777
|
});
|
|
8617
8778
|
const goTop = (e2) => {
|
|
8618
8779
|
onClick && onClick(e2);
|
|
8619
|
-
|
|
8780
|
+
Taro.pageScrollTo({
|
|
8620
8781
|
scrollTop: 0,
|
|
8621
8782
|
duration: isAnimation && duration > 0 ? duration : 0
|
|
8622
8783
|
});
|
|
@@ -8851,8 +9012,8 @@
|
|
|
8851
9012
|
const el = myDrag.current;
|
|
8852
9013
|
if (el) {
|
|
8853
9014
|
const { top, left, bottom, right } = boundary;
|
|
8854
|
-
const { screenWidth, windowHeight } =
|
|
8855
|
-
|
|
9015
|
+
const { screenWidth, windowHeight } = Taro.getSystemInfoSync();
|
|
9016
|
+
Taro.createSelectorQuery().select(`.${className}`).boundingClientRect((rec) => {
|
|
8856
9017
|
setBoundaryState({
|
|
8857
9018
|
top: -rec.top + top,
|
|
8858
9019
|
left: -rec.left + left,
|
|
@@ -13669,27 +13830,6 @@
|
|
|
13669
13830
|
}
|
|
13670
13831
|
});
|
|
13671
13832
|
const animated = host.animated;
|
|
13672
|
-
const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
|
|
13673
|
-
const defaultRoot = canUseDom ? window : void 0;
|
|
13674
|
-
const overflowStylePatterns = ["scroll", "auto", "overlay"];
|
|
13675
|
-
function isElement(node) {
|
|
13676
|
-
const ELEMENT_NODE_TYPE = 1;
|
|
13677
|
-
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
13678
|
-
}
|
|
13679
|
-
function getScrollParent(el, root2 = defaultRoot) {
|
|
13680
|
-
let node = el;
|
|
13681
|
-
while (node && node !== root2 && isElement(node)) {
|
|
13682
|
-
if (node === document.body) {
|
|
13683
|
-
return root2;
|
|
13684
|
-
}
|
|
13685
|
-
const { overflowY } = window.getComputedStyle(node);
|
|
13686
|
-
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
13687
|
-
return node;
|
|
13688
|
-
}
|
|
13689
|
-
node = node.parentNode;
|
|
13690
|
-
}
|
|
13691
|
-
return root2;
|
|
13692
|
-
}
|
|
13693
13833
|
function bound(position, min, max) {
|
|
13694
13834
|
let ret = position;
|
|
13695
13835
|
if (min !== void 0) {
|
|
@@ -14324,7 +14464,7 @@
|
|
|
14324
14464
|
currentDuration: "00:00:00",
|
|
14325
14465
|
percent: 0
|
|
14326
14466
|
});
|
|
14327
|
-
const audioRef = React.useRef(
|
|
14467
|
+
const audioRef = React.useRef(Taro.createInnerAudioContext());
|
|
14328
14468
|
const audioCtx = audioRef.current;
|
|
14329
14469
|
audioCtx.src = url;
|
|
14330
14470
|
audioCtx.autoplay = autoplay || false;
|
|
@@ -14489,7 +14629,7 @@
|
|
|
14489
14629
|
url: ""
|
|
14490
14630
|
};
|
|
14491
14631
|
const Avatar = (props) => {
|
|
14492
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n
|
|
14632
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
14493
14633
|
const {
|
|
14494
14634
|
children,
|
|
14495
14635
|
prefixCls,
|
|
@@ -14569,18 +14709,13 @@
|
|
|
14569
14709
|
activeAvatar && activeAvatar(e2);
|
|
14570
14710
|
onActiveAvatar && onActiveAvatar(e2);
|
|
14571
14711
|
};
|
|
14572
|
-
|
|
14573
|
-
"!parent?.propAvatarGroup?.maxCount",
|
|
14574
|
-
!((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount),
|
|
14575
|
-
showMax
|
|
14576
|
-
);
|
|
14577
|
-
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, (showMax || !((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount) || avatarIndex <= ((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.maxCount)) && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14712
|
+
return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, (showMax || !((_h = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _h.maxCount) || avatarIndex <= ((_i = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _i.maxCount)) && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14578
14713
|
className: cls,
|
|
14579
14714
|
...rest,
|
|
14580
14715
|
style: !showMax ? styles : maxStyles,
|
|
14581
14716
|
onClick: clickAvatar,
|
|
14582
14717
|
ref: avatarRef
|
|
14583
|
-
}, (!((
|
|
14718
|
+
}, (!((_j = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _j.maxCount) || avatarIndex <= ((_k = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _k.maxCount)) && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, url && /* @__PURE__ */ React__default["default"].createElement(index_cjs.Image, {
|
|
14584
14719
|
className: "avatar-img",
|
|
14585
14720
|
src: url,
|
|
14586
14721
|
onError: errorEvent
|
|
@@ -14594,10 +14729,23 @@
|
|
|
14594
14729
|
className: "text"
|
|
14595
14730
|
}, children)), showMax && /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
14596
14731
|
className: "text"
|
|
14597
|
-
}, ((
|
|
14732
|
+
}, ((_l = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _l.maxContent) ? (_m = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _m.maxContent : `+ ${avatarIndex - ((_n = parent == null ? void 0 : parent.propAvatarGroup) == null ? void 0 : _n.maxCount)}`)));
|
|
14598
14733
|
};
|
|
14599
14734
|
Avatar.defaultProps = defaultProps$w;
|
|
14600
14735
|
Avatar.displayName = "NutAvatar";
|
|
14736
|
+
const defaultConfigRef = {
|
|
14737
|
+
current: {
|
|
14738
|
+
locale: zhCN
|
|
14739
|
+
}
|
|
14740
|
+
};
|
|
14741
|
+
const getDefaultConfig = () => {
|
|
14742
|
+
return defaultConfigRef.current;
|
|
14743
|
+
};
|
|
14744
|
+
const ConfigContext = React.createContext(null);
|
|
14745
|
+
const useConfig = () => {
|
|
14746
|
+
var _a;
|
|
14747
|
+
return (_a = React.useContext(ConfigContext)) != null ? _a : getDefaultConfig();
|
|
14748
|
+
};
|
|
14601
14749
|
const defaultProps$v = {
|
|
14602
14750
|
maxContent: "",
|
|
14603
14751
|
maxCount: "",
|
|
@@ -16331,8 +16479,6 @@
|
|
|
16331
16479
|
}
|
|
16332
16480
|
return () => {
|
|
16333
16481
|
clearInterval(timer);
|
|
16334
|
-
startRoll();
|
|
16335
|
-
startRollEasy();
|
|
16336
16482
|
};
|
|
16337
16483
|
}, []);
|
|
16338
16484
|
React.useEffect(() => {
|
|
@@ -17658,8 +17804,8 @@
|
|
|
17658
17804
|
itemEqualSize: true,
|
|
17659
17805
|
overscan: 2
|
|
17660
17806
|
};
|
|
17661
|
-
const clientHeight =
|
|
17662
|
-
|
|
17807
|
+
const clientHeight = Taro.getSystemInfoSync().windowHeight - 5 || 667;
|
|
17808
|
+
Taro.getSystemInfoSync().windowWidth || 375;
|
|
17663
17809
|
const VirtualList = (props) => {
|
|
17664
17810
|
const {
|
|
17665
17811
|
sourceData = [],
|
|
@@ -17719,8 +17865,7 @@
|
|
|
17719
17865
|
}, [itemSize, sourceData]);
|
|
17720
17866
|
const getContainerHeight = () => {
|
|
17721
17867
|
const initH = itemSize * sourceData.length;
|
|
17722
|
-
|
|
17723
|
-
return containerH;
|
|
17868
|
+
return initH < clientHeight ? initH + overscan * itemSize - 5 : Math.min(containerSize, clientHeight);
|
|
17724
17869
|
};
|
|
17725
17870
|
const visibleCount = () => {
|
|
17726
17871
|
return Math.ceil(getContainerHeight() / itemSize) + overscan;
|
|
@@ -17936,7 +18081,7 @@
|
|
|
17936
18081
|
defaultIcon: "location2",
|
|
17937
18082
|
selectedIcon: "Check",
|
|
17938
18083
|
isShowCustomAddress: true,
|
|
17939
|
-
customAndExistTitle: "
|
|
18084
|
+
customAndExistTitle: ""
|
|
17940
18085
|
};
|
|
17941
18086
|
const ExistRender = (props) => {
|
|
17942
18087
|
const { locale } = useConfig();
|
|
@@ -18011,7 +18156,7 @@
|
|
|
18011
18156
|
onClick: switchModule
|
|
18012
18157
|
}, /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18013
18158
|
className: b2("choose-other-btn")
|
|
18014
|
-
}, locale.address.chooseAnotherAddress
|
|
18159
|
+
}, customAndExistTitle || locale.address.chooseAnotherAddress)));
|
|
18015
18160
|
};
|
|
18016
18161
|
const defaultProps$7 = {
|
|
18017
18162
|
modelValue: [],
|
|
@@ -18288,15 +18433,15 @@
|
|
|
18288
18433
|
modelValue: false,
|
|
18289
18434
|
modelSelect: [],
|
|
18290
18435
|
type: "custom",
|
|
18291
|
-
customAddressTitle: "
|
|
18436
|
+
customAddressTitle: "",
|
|
18292
18437
|
province: [],
|
|
18293
18438
|
city: [],
|
|
18294
18439
|
country: [],
|
|
18295
18440
|
town: [],
|
|
18296
18441
|
isShowCustomAddress: true,
|
|
18297
18442
|
existAddress: [],
|
|
18298
|
-
existAddressTitle: "
|
|
18299
|
-
customAndExistTitle: "
|
|
18443
|
+
existAddressTitle: "",
|
|
18444
|
+
customAndExistTitle: "",
|
|
18300
18445
|
height: "200px",
|
|
18301
18446
|
defaultIcon: "location2",
|
|
18302
18447
|
selectedIcon: "Check",
|
|
@@ -18437,7 +18582,7 @@
|
|
|
18437
18582
|
color: "#cccccc"
|
|
18438
18583
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18439
18584
|
className: b2("header__title")
|
|
18440
|
-
}, privateType === "custom" ? locale.address.selectRegion
|
|
18585
|
+
}, privateType === "custom" ? customAddressTitle || locale.address.selectRegion : existAddressTitle || locale.address.deliveryTo), /* @__PURE__ */ React__default["default"].createElement("div", {
|
|
18441
18586
|
onClick: () => handClose()
|
|
18442
18587
|
}, closeBtnIcon && /* @__PURE__ */ React__default["default"].createElement(Icon$1, {
|
|
18443
18588
|
classPrefix: iconClassPrefix,
|
|
@@ -18487,7 +18632,7 @@
|
|
|
18487
18632
|
selectedIcon,
|
|
18488
18633
|
defaultIcon,
|
|
18489
18634
|
isShowCustomAddress,
|
|
18490
|
-
customAndExistTitle: locale.address.chooseAnotherAddress
|
|
18635
|
+
customAndExistTitle: customAndExistTitle || locale.address.chooseAnotherAddress,
|
|
18491
18636
|
onSelected: selectedExist,
|
|
18492
18637
|
onSwitchModule
|
|
18493
18638
|
}))));
|
|
@@ -18547,7 +18692,7 @@
|
|
|
18547
18692
|
el.innerHTML = barrageList[_index];
|
|
18548
18693
|
el.classList.add("barrage-item");
|
|
18549
18694
|
barrageContainer.current.appendChild(el);
|
|
18550
|
-
|
|
18695
|
+
Taro.createSelectorQuery().select(".barrage-item").boundingClientRect((res) => {
|
|
18551
18696
|
console.log("res", res);
|
|
18552
18697
|
const height = res == null ? void 0 : res.height;
|
|
18553
18698
|
el.classList.add("move");
|