@nutui/nutui-react-taro 1.5.3 → 1.5.4
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 +7 -1
- package/dist/esm/Address.js +2 -2
- package/dist/esm/Elevator.js +1 -1
- package/dist/esm/{address.taro-3a9b6396.js → address.taro-d74c7760.js} +1 -1
- package/dist/esm/{elevator.taro-6019669e.js → elevator.taro-a883f7ad.js} +15 -8
- package/dist/esm/nutui-react.es.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/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.mjs +79 -98
- package/dist/nutui.react.umd.js +79 -98
- package/dist/style.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/esm/Address.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as Address } from './address.taro-
|
|
1
|
+
import { A as Address } from './address.taro-d74c7760.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './icon.taro-296a1bec.js';
|
|
4
4
|
import './bem-350c1702.js';
|
|
@@ -15,7 +15,7 @@ import './configprovider-67d19d3a.js';
|
|
|
15
15
|
import 'lodash.kebabcase';
|
|
16
16
|
import './zh-CN-c779e6c1.js';
|
|
17
17
|
import '@tarojs/taro';
|
|
18
|
-
import './elevator.taro-
|
|
18
|
+
import './elevator.taro-a883f7ad.js';
|
|
19
19
|
import './configprovider.taro-8d71eb49.js';
|
|
20
20
|
|
|
21
21
|
|
package/dist/esm/Elevator.js
CHANGED
|
@@ -5,7 +5,7 @@ import { c as cn } from './bem-350c1702.js';
|
|
|
5
5
|
import { I as Icon } from './icon-296a1bec.js';
|
|
6
6
|
import { u as useConfig } from './configprovider-67d19d3a.js';
|
|
7
7
|
import { createSelectorQuery } from '@tarojs/taro';
|
|
8
|
-
import { E as Elevator } from './elevator.taro-
|
|
8
|
+
import { E as Elevator } from './elevator.taro-a883f7ad.js';
|
|
9
9
|
import { u as useConfig$1 } from './configprovider.taro-8d71eb49.js';
|
|
10
10
|
import { C as ComponentDefaults } from './typings-b9828dba.js';
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { createContext, useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { nextTick, createSelectorQuery } from '@tarojs/taro';
|
|
2
|
+
import Taro, { nextTick, createSelectorQuery } from '@tarojs/taro';
|
|
3
3
|
import { ScrollView } from '@tarojs/components';
|
|
4
4
|
import { c as cn } from './bem-350c1702.js';
|
|
5
5
|
|
|
@@ -37,6 +37,7 @@ const Elevator = (props) => {
|
|
|
37
37
|
const [scrollStart, setScrollStart] = useState(false);
|
|
38
38
|
const state = useRef(initData);
|
|
39
39
|
const [scrollTop, setScrollTop] = useState(0);
|
|
40
|
+
const [scrollY, setScrollY] = useState(0);
|
|
40
41
|
// 重置滚动参数
|
|
41
42
|
const resetScrollState = () => {
|
|
42
43
|
setScrollStart(false);
|
|
@@ -79,7 +80,11 @@ const Elevator = (props) => {
|
|
|
79
80
|
cacheIndex = state.current.listHeight.length - 2;
|
|
80
81
|
}
|
|
81
82
|
setCodeIndex(cacheIndex);
|
|
82
|
-
|
|
83
|
+
const scrollTop = state.current.listHeight[cacheIndex];
|
|
84
|
+
setScrollTop(scrollTop);
|
|
85
|
+
if (isSticky && scrollY !== scrollTop) {
|
|
86
|
+
setScrollY(Math.floor(scrollTop) > 0 ? 1 : 0);
|
|
87
|
+
}
|
|
83
88
|
};
|
|
84
89
|
const touchMove = (e) => {
|
|
85
90
|
const firstTouch = e.touches[0];
|
|
@@ -130,7 +135,10 @@ const Elevator = (props) => {
|
|
|
130
135
|
const target = e.target;
|
|
131
136
|
const { scrollTop } = target;
|
|
132
137
|
state.current.scrollY = Math.floor(scrollTop);
|
|
133
|
-
setScrollTop(scrollTop);
|
|
138
|
+
Taro.getEnv() === 'WEB' && setScrollTop(scrollTop);
|
|
139
|
+
if (isSticky && scrollTop !== scrollY) {
|
|
140
|
+
setScrollY(Math.floor(scrollTop) > 0 ? 1 : 0);
|
|
141
|
+
}
|
|
134
142
|
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
135
143
|
const height1 = listHeight[i];
|
|
136
144
|
const height2 = listHeight[i + 1];
|
|
@@ -139,7 +147,6 @@ const Elevator = (props) => {
|
|
|
139
147
|
return;
|
|
140
148
|
}
|
|
141
149
|
}
|
|
142
|
-
setCurrentIndex(listHeight.length - 2);
|
|
143
150
|
};
|
|
144
151
|
useEffect(() => {
|
|
145
152
|
if (listview.current) {
|
|
@@ -149,10 +156,8 @@ const Elevator = (props) => {
|
|
|
149
156
|
}
|
|
150
157
|
}, [listview]);
|
|
151
158
|
return (React__default.createElement("div", { className: `${b()} ${className} `, ...rest },
|
|
152
|
-
isSticky && scrollTop > 0 ? (React__default.createElement("div", { className: b('list__fixed') },
|
|
153
|
-
React__default.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey]))) : null,
|
|
154
159
|
React__default.createElement("div", { className: b('list'), style: { height: Number.isNaN(+height) ? height : `${height}px` } },
|
|
155
|
-
React__default.createElement(ScrollView, { scrollTop: scrollTop, scrollY: true, className: b('list__inner'), ref: listview, onScroll: listViewScroll }, indexList.map((item, idx) => {
|
|
160
|
+
React__default.createElement(ScrollView, { scrollTop: scrollTop, scrollY: true, scrollWithAnimation: true, scrollAnchoring: true, className: b('list__inner'), ref: listview, onScroll: listViewScroll }, indexList.map((item, idx) => {
|
|
156
161
|
return (React__default.createElement("div", { className: `${b('list__item')} elevator__item__${idx}`, key: idx },
|
|
157
162
|
React__default.createElement("div", { className: b('list__item__code') }, item[acceptKey]),
|
|
158
163
|
React__default.createElement(React__default.Fragment, null, item.list.map((subitem) => {
|
|
@@ -169,7 +174,9 @@ const Elevator = (props) => {
|
|
|
169
174
|
return (React__default.createElement("div", { className: `${b('bars__inner__item', {
|
|
170
175
|
active: item[acceptKey] === indexList[currentIndex][acceptKey],
|
|
171
176
|
})} `, "data-index": index, key: index, onClick: () => handleClickIndex(item[acceptKey]) }, item[acceptKey]));
|
|
172
|
-
})))
|
|
177
|
+
}))),
|
|
178
|
+
isSticky && scrollY > 0 ? (React__default.createElement("div", { className: b('list__fixed') },
|
|
179
|
+
React__default.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey]))) : null));
|
|
173
180
|
};
|
|
174
181
|
Elevator.defaultProps = defaultProps;
|
|
175
182
|
Elevator.displayName = 'NutElevator';
|
|
@@ -13,7 +13,7 @@ export { G as GridItem } from './griditem.taro-cdb3f119.js';
|
|
|
13
13
|
export { L as Layout } from './layout.taro-9046d093.js';
|
|
14
14
|
export { R as Row } from './row.taro-f64d4a13.js';
|
|
15
15
|
export { S as Sticky } from './sticky.taro-218bda37.js';
|
|
16
|
-
export { E as Elevator } from './elevator.taro-
|
|
16
|
+
export { E as Elevator } from './elevator.taro-a883f7ad.js';
|
|
17
17
|
export { F as FixedNav } from './fixednav.taro-1f05acaf.js';
|
|
18
18
|
export { I as Indicator } from './indicator.taro-cba8b010.js';
|
|
19
19
|
export { M as Menu } from './menu.taro-7e4038a1.js';
|
|
@@ -83,7 +83,7 @@ export { T as TrendArrow } from './trendarrow.taro-b8c5ccd9.js';
|
|
|
83
83
|
export { V as Video } from './video-f1be8a91.js';
|
|
84
84
|
export { V as VirtualList } from './virtuallist.taro-f0b0270d.js';
|
|
85
85
|
export { W as WaterMark } from './watermark.taro-9ce2ae37.js';
|
|
86
|
-
export { A as Address } from './address.taro-
|
|
86
|
+
export { A as Address } from './address.taro-d74c7760.js';
|
|
87
87
|
export { B as Barrage } from './barrage.taro-0495a1b2.js';
|
|
88
88
|
export { C as Card } from './card.taro-e4c76dad.js';
|
|
89
89
|
export { S as Signature } from './signature.taro-ec4e713b.js';
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED
package/dist/nutui.react.mjs
CHANGED
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
/*!
|
|
8
|
-
* @nutui/nutui-react-taro v1.5.
|
|
8
|
+
* @nutui/nutui-react-taro v1.5.4 Wed May 10 2023 17:37:13 GMT+0800 (中国标准时间)
|
|
9
9
|
* (c) 2023 @jdf2e.
|
|
10
10
|
* Released under the MIT License.
|
|
11
11
|
*/
|
|
@@ -15,15 +15,10 @@ import Taro, { redirectTo, navigateTo, getEnv, usePageScroll, getSystemInfoSync,
|
|
|
15
15
|
import { View, ScrollView, PickerView, PickerViewColumn, Image as Image$2 } from "@tarojs/components";
|
|
16
16
|
import ReactDOM, { createPortal, unstable_batchedUpdates } from "react-dom";
|
|
17
17
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
set exports(v) {
|
|
24
|
-
classnameExports = v;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
18
|
+
function getDefaultExportFromCjs(x) {
|
|
19
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
20
|
+
}
|
|
21
|
+
var classname = { exports: {} };
|
|
27
22
|
var classname_production_min = {};
|
|
28
23
|
var hasRequiredClassname_production_min;
|
|
29
24
|
function requireClassname_production_min() {
|
|
@@ -127,13 +122,12 @@ function requireClassname_development() {
|
|
|
127
122
|
classname_development.withNaming = withNaming;
|
|
128
123
|
return classname_development;
|
|
129
124
|
}
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})(classname);
|
|
125
|
+
if (process.env.NODE_ENV === "production") {
|
|
126
|
+
classname.exports = requireClassname_production_min();
|
|
127
|
+
} else {
|
|
128
|
+
classname.exports = requireClassname_development();
|
|
129
|
+
}
|
|
130
|
+
var classnameExports = classname.exports;
|
|
137
131
|
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
138
132
|
const defaultProps$1v = {
|
|
139
133
|
name: "",
|
|
@@ -749,6 +743,7 @@ function words(string, pattern, guard) {
|
|
|
749
743
|
return string.match(pattern) || [];
|
|
750
744
|
}
|
|
751
745
|
var lodash_kebabcase = kebabCase;
|
|
746
|
+
const kebabCase$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_kebabcase);
|
|
752
747
|
const zhCN = {
|
|
753
748
|
save: "保存",
|
|
754
749
|
confirm: "确认",
|
|
@@ -896,7 +891,7 @@ const useConfig$1 = () => {
|
|
|
896
891
|
function convertThemeVarsToCSSVars(themeVars) {
|
|
897
892
|
const cssVars = {};
|
|
898
893
|
Object.keys(themeVars).forEach((key) => {
|
|
899
|
-
cssVars[`--${
|
|
894
|
+
cssVars[`--${kebabCase$1(key)}`] = themeVars[key];
|
|
900
895
|
});
|
|
901
896
|
return cssVars;
|
|
902
897
|
}
|
|
@@ -1013,15 +1008,7 @@ const Image$1 = (props) => {
|
|
|
1013
1008
|
};
|
|
1014
1009
|
Image$1.defaultProps = defaultProps$1q;
|
|
1015
1010
|
Image$1.displayName = "NutImage";
|
|
1016
|
-
var
|
|
1017
|
-
var classnames = {
|
|
1018
|
-
get exports() {
|
|
1019
|
-
return classnamesExports;
|
|
1020
|
-
},
|
|
1021
|
-
set exports(v) {
|
|
1022
|
-
classnamesExports = v;
|
|
1023
|
-
}
|
|
1024
|
-
};
|
|
1011
|
+
var classnames = { exports: {} };
|
|
1025
1012
|
/*!
|
|
1026
1013
|
Copyright (c) 2018 Jed Watson.
|
|
1027
1014
|
Licensed under the MIT License (MIT), see
|
|
@@ -1068,7 +1055,8 @@ var classnames = {
|
|
|
1068
1055
|
}
|
|
1069
1056
|
})();
|
|
1070
1057
|
})(classnames);
|
|
1071
|
-
|
|
1058
|
+
var classnamesExports = classnames.exports;
|
|
1059
|
+
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
1072
1060
|
const defaultOverlayProps = {
|
|
1073
1061
|
zIndex: 2e3,
|
|
1074
1062
|
duration: 0.3,
|
|
@@ -1194,24 +1182,8 @@ function _inheritsLoose(subClass, superClass) {
|
|
|
1194
1182
|
subClass.prototype.constructor = subClass;
|
|
1195
1183
|
_setPrototypeOf(subClass, superClass);
|
|
1196
1184
|
}
|
|
1197
|
-
var
|
|
1198
|
-
var
|
|
1199
|
-
get exports() {
|
|
1200
|
-
return propTypesExports;
|
|
1201
|
-
},
|
|
1202
|
-
set exports(v) {
|
|
1203
|
-
propTypesExports = v;
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
var reactIsExports = {};
|
|
1207
|
-
var reactIs = {
|
|
1208
|
-
get exports() {
|
|
1209
|
-
return reactIsExports;
|
|
1210
|
-
},
|
|
1211
|
-
set exports(v) {
|
|
1212
|
-
reactIsExports = v;
|
|
1213
|
-
}
|
|
1214
|
-
};
|
|
1185
|
+
var propTypes = { exports: {} };
|
|
1186
|
+
var reactIs = { exports: {} };
|
|
1215
1187
|
var reactIs_production_min = {};
|
|
1216
1188
|
/** @license React v16.13.1
|
|
1217
1189
|
* react-is.production.min.js
|
|
@@ -1482,16 +1454,14 @@ function requireReactIs_development() {
|
|
|
1482
1454
|
var hasRequiredReactIs;
|
|
1483
1455
|
function requireReactIs() {
|
|
1484
1456
|
if (hasRequiredReactIs)
|
|
1485
|
-
return
|
|
1457
|
+
return reactIs.exports;
|
|
1486
1458
|
hasRequiredReactIs = 1;
|
|
1487
|
-
(
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
})(reactIs);
|
|
1494
|
-
return reactIsExports;
|
|
1459
|
+
if (process.env.NODE_ENV === "production") {
|
|
1460
|
+
reactIs.exports = requireReactIs_production_min();
|
|
1461
|
+
} else {
|
|
1462
|
+
reactIs.exports = requireReactIs_development();
|
|
1463
|
+
}
|
|
1464
|
+
return reactIs.exports;
|
|
1495
1465
|
}
|
|
1496
1466
|
/*
|
|
1497
1467
|
object-assign
|
|
@@ -2158,6 +2128,8 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
2158
2128
|
} else {
|
|
2159
2129
|
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
2160
2130
|
}
|
|
2131
|
+
var propTypesExports = propTypes.exports;
|
|
2132
|
+
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
2161
2133
|
function hasClass(element, className) {
|
|
2162
2134
|
if (element.classList)
|
|
2163
2135
|
return !!className && element.classList.contains(className);
|
|
@@ -2187,22 +2159,22 @@ function removeClass$1(element, className) {
|
|
|
2187
2159
|
const config$1 = {
|
|
2188
2160
|
disabled: false
|
|
2189
2161
|
};
|
|
2190
|
-
var timeoutsShape = process.env.NODE_ENV !== "production" ?
|
|
2191
|
-
enter:
|
|
2192
|
-
exit:
|
|
2193
|
-
appear:
|
|
2162
|
+
var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
2163
|
+
enter: PropTypes.number,
|
|
2164
|
+
exit: PropTypes.number,
|
|
2165
|
+
appear: PropTypes.number
|
|
2194
2166
|
}).isRequired]) : null;
|
|
2195
|
-
var classNamesShape = process.env.NODE_ENV !== "production" ?
|
|
2196
|
-
enter:
|
|
2197
|
-
exit:
|
|
2198
|
-
active:
|
|
2199
|
-
}),
|
|
2200
|
-
enter:
|
|
2201
|
-
enterDone:
|
|
2202
|
-
enterActive:
|
|
2203
|
-
exit:
|
|
2204
|
-
exitDone:
|
|
2205
|
-
exitActive:
|
|
2167
|
+
var classNamesShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
2168
|
+
enter: PropTypes.string,
|
|
2169
|
+
exit: PropTypes.string,
|
|
2170
|
+
active: PropTypes.string
|
|
2171
|
+
}), PropTypes.shape({
|
|
2172
|
+
enter: PropTypes.string,
|
|
2173
|
+
enterDone: PropTypes.string,
|
|
2174
|
+
enterActive: PropTypes.string,
|
|
2175
|
+
exit: PropTypes.string,
|
|
2176
|
+
exitDone: PropTypes.string,
|
|
2177
|
+
exitActive: PropTypes.string
|
|
2206
2178
|
})]) : null;
|
|
2207
2179
|
const TransitionGroupContext = React__default.createContext(null);
|
|
2208
2180
|
var forceReflow = function forceReflow2(node) {
|
|
@@ -2452,10 +2424,10 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2452
2424
|
* (see
|
|
2453
2425
|
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
|
|
2454
2426
|
*/
|
|
2455
|
-
nodeRef:
|
|
2456
|
-
current: typeof Element === "undefined" ?
|
|
2427
|
+
nodeRef: PropTypes.shape({
|
|
2428
|
+
current: typeof Element === "undefined" ? PropTypes.any : function(propValue, key, componentName, location, propFullName, secret) {
|
|
2457
2429
|
var value = propValue[key];
|
|
2458
|
-
return
|
|
2430
|
+
return PropTypes.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
|
|
2459
2431
|
}
|
|
2460
2432
|
}),
|
|
2461
2433
|
/**
|
|
@@ -2472,23 +2444,23 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2472
2444
|
* </Transition>
|
|
2473
2445
|
* ```
|
|
2474
2446
|
*/
|
|
2475
|
-
children:
|
|
2447
|
+
children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
2476
2448
|
/**
|
|
2477
2449
|
* Show the component; triggers the enter or exit states
|
|
2478
2450
|
*/
|
|
2479
|
-
in:
|
|
2451
|
+
in: PropTypes.bool,
|
|
2480
2452
|
/**
|
|
2481
2453
|
* By default the child component is mounted immediately along with
|
|
2482
2454
|
* the parent `Transition` component. If you want to "lazy mount" the component on the
|
|
2483
2455
|
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
|
|
2484
2456
|
* mounted, even on "exited", unless you also specify `unmountOnExit`.
|
|
2485
2457
|
*/
|
|
2486
|
-
mountOnEnter:
|
|
2458
|
+
mountOnEnter: PropTypes.bool,
|
|
2487
2459
|
/**
|
|
2488
2460
|
* By default the child component stays mounted after it reaches the `'exited'` state.
|
|
2489
2461
|
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
|
|
2490
2462
|
*/
|
|
2491
|
-
unmountOnExit:
|
|
2463
|
+
unmountOnExit: PropTypes.bool,
|
|
2492
2464
|
/**
|
|
2493
2465
|
* By default the child component does not perform the enter transition when
|
|
2494
2466
|
* it first mounts, regardless of the value of `in`. If you want this
|
|
@@ -2500,15 +2472,15 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2500
2472
|
* > additional `.appear-*` classes, that way you can choose to style it
|
|
2501
2473
|
* > differently.
|
|
2502
2474
|
*/
|
|
2503
|
-
appear:
|
|
2475
|
+
appear: PropTypes.bool,
|
|
2504
2476
|
/**
|
|
2505
2477
|
* Enable or disable enter transitions.
|
|
2506
2478
|
*/
|
|
2507
|
-
enter:
|
|
2479
|
+
enter: PropTypes.bool,
|
|
2508
2480
|
/**
|
|
2509
2481
|
* Enable or disable exit transitions.
|
|
2510
2482
|
*/
|
|
2511
|
-
exit:
|
|
2483
|
+
exit: PropTypes.bool,
|
|
2512
2484
|
/**
|
|
2513
2485
|
* The duration of the transition, in milliseconds.
|
|
2514
2486
|
* Required unless `addEndListener` is provided.
|
|
@@ -2558,7 +2530,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2558
2530
|
* }}
|
|
2559
2531
|
* ```
|
|
2560
2532
|
*/
|
|
2561
|
-
addEndListener:
|
|
2533
|
+
addEndListener: PropTypes.func,
|
|
2562
2534
|
/**
|
|
2563
2535
|
* Callback fired before the "entering" status is applied. An extra parameter
|
|
2564
2536
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
@@ -2567,7 +2539,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2567
2539
|
*
|
|
2568
2540
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
2569
2541
|
*/
|
|
2570
|
-
onEnter:
|
|
2542
|
+
onEnter: PropTypes.func,
|
|
2571
2543
|
/**
|
|
2572
2544
|
* Callback fired after the "entering" status is applied. An extra parameter
|
|
2573
2545
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
@@ -2576,7 +2548,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2576
2548
|
*
|
|
2577
2549
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2578
2550
|
*/
|
|
2579
|
-
onEntering:
|
|
2551
|
+
onEntering: PropTypes.func,
|
|
2580
2552
|
/**
|
|
2581
2553
|
* Callback fired after the "entered" status is applied. An extra parameter
|
|
2582
2554
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
@@ -2585,7 +2557,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2585
2557
|
*
|
|
2586
2558
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
2587
2559
|
*/
|
|
2588
|
-
onEntered:
|
|
2560
|
+
onEntered: PropTypes.func,
|
|
2589
2561
|
/**
|
|
2590
2562
|
* Callback fired before the "exiting" status is applied.
|
|
2591
2563
|
*
|
|
@@ -2593,7 +2565,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2593
2565
|
*
|
|
2594
2566
|
* @type Function(node: HtmlElement) -> void
|
|
2595
2567
|
*/
|
|
2596
|
-
onExit:
|
|
2568
|
+
onExit: PropTypes.func,
|
|
2597
2569
|
/**
|
|
2598
2570
|
* Callback fired after the "exiting" status is applied.
|
|
2599
2571
|
*
|
|
@@ -2601,7 +2573,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2601
2573
|
*
|
|
2602
2574
|
* @type Function(node: HtmlElement) -> void
|
|
2603
2575
|
*/
|
|
2604
|
-
onExiting:
|
|
2576
|
+
onExiting: PropTypes.func,
|
|
2605
2577
|
/**
|
|
2606
2578
|
* Callback fired after the "exited" status is applied.
|
|
2607
2579
|
*
|
|
@@ -2609,7 +2581,7 @@ Transition.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
2609
2581
|
*
|
|
2610
2582
|
* @type Function(node: HtmlElement) -> void
|
|
2611
2583
|
*/
|
|
2612
|
-
onExited:
|
|
2584
|
+
onExited: PropTypes.func
|
|
2613
2585
|
} : {};
|
|
2614
2586
|
function noop$2() {
|
|
2615
2587
|
}
|
|
@@ -2848,7 +2820,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
2848
2820
|
*
|
|
2849
2821
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2850
2822
|
*/
|
|
2851
|
-
onEnter:
|
|
2823
|
+
onEnter: PropTypes.func,
|
|
2852
2824
|
/**
|
|
2853
2825
|
* A `<Transition>` callback fired immediately after the 'enter-active' or
|
|
2854
2826
|
* 'appear-active' class is applied.
|
|
@@ -2857,7 +2829,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
2857
2829
|
*
|
|
2858
2830
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2859
2831
|
*/
|
|
2860
|
-
onEntering:
|
|
2832
|
+
onEntering: PropTypes.func,
|
|
2861
2833
|
/**
|
|
2862
2834
|
* A `<Transition>` callback fired immediately after the 'enter' or
|
|
2863
2835
|
* 'appear' classes are **removed** and the `done` class is added to the DOM node.
|
|
@@ -2866,7 +2838,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
2866
2838
|
*
|
|
2867
2839
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2868
2840
|
*/
|
|
2869
|
-
onEntered:
|
|
2841
|
+
onEntered: PropTypes.func,
|
|
2870
2842
|
/**
|
|
2871
2843
|
* A `<Transition>` callback fired immediately after the 'exit' class is
|
|
2872
2844
|
* applied.
|
|
@@ -2875,7 +2847,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
2875
2847
|
*
|
|
2876
2848
|
* @type Function(node: HtmlElement)
|
|
2877
2849
|
*/
|
|
2878
|
-
onExit:
|
|
2850
|
+
onExit: PropTypes.func,
|
|
2879
2851
|
/**
|
|
2880
2852
|
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
|
|
2881
2853
|
*
|
|
@@ -2883,7 +2855,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
2883
2855
|
*
|
|
2884
2856
|
* @type Function(node: HtmlElement)
|
|
2885
2857
|
*/
|
|
2886
|
-
onExiting:
|
|
2858
|
+
onExiting: PropTypes.func,
|
|
2887
2859
|
/**
|
|
2888
2860
|
* A `<Transition>` callback fired immediately after the 'exit' classes
|
|
2889
2861
|
* are **removed** and the `exit-done` class is added to the DOM node.
|
|
@@ -2892,7 +2864,7 @@ CSSTransition.propTypes = process.env.NODE_ENV !== "production" ? _extends$3({},
|
|
|
2892
2864
|
*
|
|
2893
2865
|
* @type Function(node: HtmlElement)
|
|
2894
2866
|
*/
|
|
2895
|
-
onExited:
|
|
2867
|
+
onExited: PropTypes.func
|
|
2896
2868
|
}) : {};
|
|
2897
2869
|
const CSSTransition$1 = CSSTransition;
|
|
2898
2870
|
const defaultProps$1p = {
|
|
@@ -3654,6 +3626,7 @@ const Elevator = (props) => {
|
|
|
3654
3626
|
const [scrollStart, setScrollStart] = useState(false);
|
|
3655
3627
|
const state = useRef(initData);
|
|
3656
3628
|
const [scrollTop, setScrollTop] = useState(0);
|
|
3629
|
+
const [scrollY, setScrollY] = useState(0);
|
|
3657
3630
|
const resetScrollState = () => {
|
|
3658
3631
|
setScrollStart(false);
|
|
3659
3632
|
};
|
|
@@ -3691,7 +3664,11 @@ const Elevator = (props) => {
|
|
|
3691
3664
|
cacheIndex = state.current.listHeight.length - 2;
|
|
3692
3665
|
}
|
|
3693
3666
|
setCodeIndex(cacheIndex);
|
|
3694
|
-
|
|
3667
|
+
const scrollTop2 = state.current.listHeight[cacheIndex];
|
|
3668
|
+
setScrollTop(scrollTop2);
|
|
3669
|
+
if (isSticky && scrollY !== scrollTop2) {
|
|
3670
|
+
setScrollY(Math.floor(scrollTop2) > 0 ? 1 : 0);
|
|
3671
|
+
}
|
|
3695
3672
|
};
|
|
3696
3673
|
const touchMove = (e) => {
|
|
3697
3674
|
const firstTouch = e.touches[0];
|
|
@@ -3739,7 +3716,10 @@ const Elevator = (props) => {
|
|
|
3739
3716
|
const target = e.target;
|
|
3740
3717
|
const { scrollTop: scrollTop2 } = target;
|
|
3741
3718
|
state.current.scrollY = Math.floor(scrollTop2);
|
|
3742
|
-
setScrollTop(scrollTop2);
|
|
3719
|
+
Taro.getEnv() === "WEB" && setScrollTop(scrollTop2);
|
|
3720
|
+
if (isSticky && scrollTop2 !== scrollY) {
|
|
3721
|
+
setScrollY(Math.floor(scrollTop2) > 0 ? 1 : 0);
|
|
3722
|
+
}
|
|
3743
3723
|
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
3744
3724
|
const height1 = listHeight[i];
|
|
3745
3725
|
const height2 = listHeight[i + 1];
|
|
@@ -3748,7 +3728,6 @@ const Elevator = (props) => {
|
|
|
3748
3728
|
return;
|
|
3749
3729
|
}
|
|
3750
3730
|
}
|
|
3751
|
-
setCurrentIndex(listHeight.length - 2);
|
|
3752
3731
|
};
|
|
3753
3732
|
useEffect(() => {
|
|
3754
3733
|
if (listview.current) {
|
|
@@ -3757,7 +3736,7 @@ const Elevator = (props) => {
|
|
|
3757
3736
|
});
|
|
3758
3737
|
}
|
|
3759
3738
|
}, [listview]);
|
|
3760
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: `${b2()} ${className} `, ...rest },
|
|
3739
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: `${b2()} ${className} `, ...rest }, /* @__PURE__ */ React__default.createElement(
|
|
3761
3740
|
"div",
|
|
3762
3741
|
{
|
|
3763
3742
|
className: b2("list"),
|
|
@@ -3768,6 +3747,8 @@ const Elevator = (props) => {
|
|
|
3768
3747
|
{
|
|
3769
3748
|
scrollTop,
|
|
3770
3749
|
scrollY: true,
|
|
3750
|
+
scrollWithAnimation: true,
|
|
3751
|
+
scrollAnchoring: true,
|
|
3771
3752
|
className: b2("list__inner"),
|
|
3772
3753
|
ref: listview,
|
|
3773
3754
|
onScroll: listViewScroll
|
|
@@ -3819,7 +3800,7 @@ const Elevator = (props) => {
|
|
|
3819
3800
|
item[acceptKey]
|
|
3820
3801
|
);
|
|
3821
3802
|
})
|
|
3822
|
-
)));
|
|
3803
|
+
)), isSticky && scrollY > 0 ? /* @__PURE__ */ React__default.createElement("div", { className: b2("list__fixed") }, /* @__PURE__ */ React__default.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey])) : null);
|
|
3823
3804
|
};
|
|
3824
3805
|
Elevator.defaultProps = defaultProps$1h;
|
|
3825
3806
|
Elevator.displayName = "NutElevator";
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
};
|
|
10
10
|
/*!
|
|
11
|
-
* @nutui/nutui-react-taro v1.5.
|
|
11
|
+
* @nutui/nutui-react-taro v1.5.4 Wed May 10 2023 17:37:13 GMT+0800 (中国标准时间)
|
|
12
12
|
* (c) 2023 @jdf2e.
|
|
13
13
|
* Released under the MIT License.
|
|
14
14
|
*/
|
|
@@ -31,15 +31,10 @@ var __publicField = (obj, key, value) => {
|
|
|
31
31
|
}
|
|
32
32
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
33
33
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
set exports(v) {
|
|
40
|
-
classnameExports = v;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
34
|
+
function getDefaultExportFromCjs(x) {
|
|
35
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
36
|
+
}
|
|
37
|
+
var classname = { exports: {} };
|
|
43
38
|
var classname_production_min = {};
|
|
44
39
|
var hasRequiredClassname_production_min;
|
|
45
40
|
function requireClassname_production_min() {
|
|
@@ -143,13 +138,12 @@ var __publicField = (obj, key, value) => {
|
|
|
143
138
|
classname_development.withNaming = withNaming;
|
|
144
139
|
return classname_development;
|
|
145
140
|
}
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
})(classname);
|
|
141
|
+
if (process.env.NODE_ENV === "production") {
|
|
142
|
+
classname.exports = requireClassname_production_min();
|
|
143
|
+
} else {
|
|
144
|
+
classname.exports = requireClassname_development();
|
|
145
|
+
}
|
|
146
|
+
var classnameExports = classname.exports;
|
|
153
147
|
const cn = classnameExports.withNaming({ n: "nut-", e: "__", m: "--", v: "-" });
|
|
154
148
|
const defaultProps$1v = {
|
|
155
149
|
name: "",
|
|
@@ -765,6 +759,7 @@ var __publicField = (obj, key, value) => {
|
|
|
765
759
|
return string.match(pattern) || [];
|
|
766
760
|
}
|
|
767
761
|
var lodash_kebabcase = kebabCase;
|
|
762
|
+
const kebabCase$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_kebabcase);
|
|
768
763
|
const zhCN = {
|
|
769
764
|
save: "保存",
|
|
770
765
|
confirm: "确认",
|
|
@@ -912,7 +907,7 @@ var __publicField = (obj, key, value) => {
|
|
|
912
907
|
function convertThemeVarsToCSSVars(themeVars) {
|
|
913
908
|
const cssVars = {};
|
|
914
909
|
Object.keys(themeVars).forEach((key) => {
|
|
915
|
-
cssVars[`--${
|
|
910
|
+
cssVars[`--${kebabCase$1(key)}`] = themeVars[key];
|
|
916
911
|
});
|
|
917
912
|
return cssVars;
|
|
918
913
|
}
|
|
@@ -1029,15 +1024,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1029
1024
|
};
|
|
1030
1025
|
Image$1.defaultProps = defaultProps$1q;
|
|
1031
1026
|
Image$1.displayName = "NutImage";
|
|
1032
|
-
var
|
|
1033
|
-
var classnames = {
|
|
1034
|
-
get exports() {
|
|
1035
|
-
return classnamesExports;
|
|
1036
|
-
},
|
|
1037
|
-
set exports(v) {
|
|
1038
|
-
classnamesExports = v;
|
|
1039
|
-
}
|
|
1040
|
-
};
|
|
1027
|
+
var classnames = { exports: {} };
|
|
1041
1028
|
/*!
|
|
1042
1029
|
Copyright (c) 2018 Jed Watson.
|
|
1043
1030
|
Licensed under the MIT License (MIT), see
|
|
@@ -1084,7 +1071,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1084
1071
|
}
|
|
1085
1072
|
})();
|
|
1086
1073
|
})(classnames);
|
|
1087
|
-
|
|
1074
|
+
var classnamesExports = classnames.exports;
|
|
1075
|
+
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
1088
1076
|
const defaultOverlayProps = {
|
|
1089
1077
|
zIndex: 2e3,
|
|
1090
1078
|
duration: 0.3,
|
|
@@ -1210,24 +1198,8 @@ var __publicField = (obj, key, value) => {
|
|
|
1210
1198
|
subClass.prototype.constructor = subClass;
|
|
1211
1199
|
_setPrototypeOf(subClass, superClass);
|
|
1212
1200
|
}
|
|
1213
|
-
var
|
|
1214
|
-
var
|
|
1215
|
-
get exports() {
|
|
1216
|
-
return propTypesExports;
|
|
1217
|
-
},
|
|
1218
|
-
set exports(v) {
|
|
1219
|
-
propTypesExports = v;
|
|
1220
|
-
}
|
|
1221
|
-
};
|
|
1222
|
-
var reactIsExports = {};
|
|
1223
|
-
var reactIs = {
|
|
1224
|
-
get exports() {
|
|
1225
|
-
return reactIsExports;
|
|
1226
|
-
},
|
|
1227
|
-
set exports(v) {
|
|
1228
|
-
reactIsExports = v;
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1201
|
+
var propTypes = { exports: {} };
|
|
1202
|
+
var reactIs = { exports: {} };
|
|
1231
1203
|
var reactIs_production_min = {};
|
|
1232
1204
|
/** @license React v16.13.1
|
|
1233
1205
|
* react-is.production.min.js
|
|
@@ -1498,16 +1470,14 @@ var __publicField = (obj, key, value) => {
|
|
|
1498
1470
|
var hasRequiredReactIs;
|
|
1499
1471
|
function requireReactIs() {
|
|
1500
1472
|
if (hasRequiredReactIs)
|
|
1501
|
-
return
|
|
1473
|
+
return reactIs.exports;
|
|
1502
1474
|
hasRequiredReactIs = 1;
|
|
1503
|
-
(
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
})(reactIs);
|
|
1510
|
-
return reactIsExports;
|
|
1475
|
+
if (process.env.NODE_ENV === "production") {
|
|
1476
|
+
reactIs.exports = requireReactIs_production_min();
|
|
1477
|
+
} else {
|
|
1478
|
+
reactIs.exports = requireReactIs_development();
|
|
1479
|
+
}
|
|
1480
|
+
return reactIs.exports;
|
|
1511
1481
|
}
|
|
1512
1482
|
/*
|
|
1513
1483
|
object-assign
|
|
@@ -2174,6 +2144,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2174
2144
|
} else {
|
|
2175
2145
|
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
2176
2146
|
}
|
|
2147
|
+
var propTypesExports = propTypes.exports;
|
|
2148
|
+
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
|
|
2177
2149
|
function hasClass(element, className) {
|
|
2178
2150
|
if (element.classList)
|
|
2179
2151
|
return !!className && element.classList.contains(className);
|
|
@@ -2203,22 +2175,22 @@ var __publicField = (obj, key, value) => {
|
|
|
2203
2175
|
const config$1 = {
|
|
2204
2176
|
disabled: false
|
|
2205
2177
|
};
|
|
2206
|
-
var timeoutsShape = process.env.NODE_ENV !== "production" ?
|
|
2207
|
-
enter:
|
|
2208
|
-
exit:
|
|
2209
|
-
appear:
|
|
2178
|
+
var timeoutsShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
2179
|
+
enter: PropTypes.number,
|
|
2180
|
+
exit: PropTypes.number,
|
|
2181
|
+
appear: PropTypes.number
|
|
2210
2182
|
}).isRequired]) : null;
|
|
2211
|
-
var classNamesShape = process.env.NODE_ENV !== "production" ?
|
|
2212
|
-
enter:
|
|
2213
|
-
exit:
|
|
2214
|
-
active:
|
|
2215
|
-
}),
|
|
2216
|
-
enter:
|
|
2217
|
-
enterDone:
|
|
2218
|
-
enterActive:
|
|
2219
|
-
exit:
|
|
2220
|
-
exitDone:
|
|
2221
|
-
exitActive:
|
|
2183
|
+
var classNamesShape = process.env.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
2184
|
+
enter: PropTypes.string,
|
|
2185
|
+
exit: PropTypes.string,
|
|
2186
|
+
active: PropTypes.string
|
|
2187
|
+
}), PropTypes.shape({
|
|
2188
|
+
enter: PropTypes.string,
|
|
2189
|
+
enterDone: PropTypes.string,
|
|
2190
|
+
enterActive: PropTypes.string,
|
|
2191
|
+
exit: PropTypes.string,
|
|
2192
|
+
exitDone: PropTypes.string,
|
|
2193
|
+
exitActive: PropTypes.string
|
|
2222
2194
|
})]) : null;
|
|
2223
2195
|
const TransitionGroupContext = React.createContext(null);
|
|
2224
2196
|
var forceReflow = function forceReflow2(node) {
|
|
@@ -2468,10 +2440,10 @@ var __publicField = (obj, key, value) => {
|
|
|
2468
2440
|
* (see
|
|
2469
2441
|
* [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
|
|
2470
2442
|
*/
|
|
2471
|
-
nodeRef:
|
|
2472
|
-
current: typeof Element === "undefined" ?
|
|
2443
|
+
nodeRef: PropTypes.shape({
|
|
2444
|
+
current: typeof Element === "undefined" ? PropTypes.any : function(propValue, key, componentName, location, propFullName, secret) {
|
|
2473
2445
|
var value = propValue[key];
|
|
2474
|
-
return
|
|
2446
|
+
return PropTypes.instanceOf(value && "ownerDocument" in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);
|
|
2475
2447
|
}
|
|
2476
2448
|
}),
|
|
2477
2449
|
/**
|
|
@@ -2488,23 +2460,23 @@ var __publicField = (obj, key, value) => {
|
|
|
2488
2460
|
* </Transition>
|
|
2489
2461
|
* ```
|
|
2490
2462
|
*/
|
|
2491
|
-
children:
|
|
2463
|
+
children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,
|
|
2492
2464
|
/**
|
|
2493
2465
|
* Show the component; triggers the enter or exit states
|
|
2494
2466
|
*/
|
|
2495
|
-
in:
|
|
2467
|
+
in: PropTypes.bool,
|
|
2496
2468
|
/**
|
|
2497
2469
|
* By default the child component is mounted immediately along with
|
|
2498
2470
|
* the parent `Transition` component. If you want to "lazy mount" the component on the
|
|
2499
2471
|
* first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
|
|
2500
2472
|
* mounted, even on "exited", unless you also specify `unmountOnExit`.
|
|
2501
2473
|
*/
|
|
2502
|
-
mountOnEnter:
|
|
2474
|
+
mountOnEnter: PropTypes.bool,
|
|
2503
2475
|
/**
|
|
2504
2476
|
* By default the child component stays mounted after it reaches the `'exited'` state.
|
|
2505
2477
|
* Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
|
|
2506
2478
|
*/
|
|
2507
|
-
unmountOnExit:
|
|
2479
|
+
unmountOnExit: PropTypes.bool,
|
|
2508
2480
|
/**
|
|
2509
2481
|
* By default the child component does not perform the enter transition when
|
|
2510
2482
|
* it first mounts, regardless of the value of `in`. If you want this
|
|
@@ -2516,15 +2488,15 @@ var __publicField = (obj, key, value) => {
|
|
|
2516
2488
|
* > additional `.appear-*` classes, that way you can choose to style it
|
|
2517
2489
|
* > differently.
|
|
2518
2490
|
*/
|
|
2519
|
-
appear:
|
|
2491
|
+
appear: PropTypes.bool,
|
|
2520
2492
|
/**
|
|
2521
2493
|
* Enable or disable enter transitions.
|
|
2522
2494
|
*/
|
|
2523
|
-
enter:
|
|
2495
|
+
enter: PropTypes.bool,
|
|
2524
2496
|
/**
|
|
2525
2497
|
* Enable or disable exit transitions.
|
|
2526
2498
|
*/
|
|
2527
|
-
exit:
|
|
2499
|
+
exit: PropTypes.bool,
|
|
2528
2500
|
/**
|
|
2529
2501
|
* The duration of the transition, in milliseconds.
|
|
2530
2502
|
* Required unless `addEndListener` is provided.
|
|
@@ -2574,7 +2546,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2574
2546
|
* }}
|
|
2575
2547
|
* ```
|
|
2576
2548
|
*/
|
|
2577
|
-
addEndListener:
|
|
2549
|
+
addEndListener: PropTypes.func,
|
|
2578
2550
|
/**
|
|
2579
2551
|
* Callback fired before the "entering" status is applied. An extra parameter
|
|
2580
2552
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
@@ -2583,7 +2555,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2583
2555
|
*
|
|
2584
2556
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
2585
2557
|
*/
|
|
2586
|
-
onEnter:
|
|
2558
|
+
onEnter: PropTypes.func,
|
|
2587
2559
|
/**
|
|
2588
2560
|
* Callback fired after the "entering" status is applied. An extra parameter
|
|
2589
2561
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
@@ -2592,7 +2564,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2592
2564
|
*
|
|
2593
2565
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2594
2566
|
*/
|
|
2595
|
-
onEntering:
|
|
2567
|
+
onEntering: PropTypes.func,
|
|
2596
2568
|
/**
|
|
2597
2569
|
* Callback fired after the "entered" status is applied. An extra parameter
|
|
2598
2570
|
* `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
|
|
@@ -2601,7 +2573,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2601
2573
|
*
|
|
2602
2574
|
* @type Function(node: HtmlElement, isAppearing: bool) -> void
|
|
2603
2575
|
*/
|
|
2604
|
-
onEntered:
|
|
2576
|
+
onEntered: PropTypes.func,
|
|
2605
2577
|
/**
|
|
2606
2578
|
* Callback fired before the "exiting" status is applied.
|
|
2607
2579
|
*
|
|
@@ -2609,7 +2581,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2609
2581
|
*
|
|
2610
2582
|
* @type Function(node: HtmlElement) -> void
|
|
2611
2583
|
*/
|
|
2612
|
-
onExit:
|
|
2584
|
+
onExit: PropTypes.func,
|
|
2613
2585
|
/**
|
|
2614
2586
|
* Callback fired after the "exiting" status is applied.
|
|
2615
2587
|
*
|
|
@@ -2617,7 +2589,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2617
2589
|
*
|
|
2618
2590
|
* @type Function(node: HtmlElement) -> void
|
|
2619
2591
|
*/
|
|
2620
|
-
onExiting:
|
|
2592
|
+
onExiting: PropTypes.func,
|
|
2621
2593
|
/**
|
|
2622
2594
|
* Callback fired after the "exited" status is applied.
|
|
2623
2595
|
*
|
|
@@ -2625,7 +2597,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2625
2597
|
*
|
|
2626
2598
|
* @type Function(node: HtmlElement) -> void
|
|
2627
2599
|
*/
|
|
2628
|
-
onExited:
|
|
2600
|
+
onExited: PropTypes.func
|
|
2629
2601
|
} : {};
|
|
2630
2602
|
function noop$2() {
|
|
2631
2603
|
}
|
|
@@ -2864,7 +2836,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2864
2836
|
*
|
|
2865
2837
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2866
2838
|
*/
|
|
2867
|
-
onEnter:
|
|
2839
|
+
onEnter: PropTypes.func,
|
|
2868
2840
|
/**
|
|
2869
2841
|
* A `<Transition>` callback fired immediately after the 'enter-active' or
|
|
2870
2842
|
* 'appear-active' class is applied.
|
|
@@ -2873,7 +2845,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2873
2845
|
*
|
|
2874
2846
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2875
2847
|
*/
|
|
2876
|
-
onEntering:
|
|
2848
|
+
onEntering: PropTypes.func,
|
|
2877
2849
|
/**
|
|
2878
2850
|
* A `<Transition>` callback fired immediately after the 'enter' or
|
|
2879
2851
|
* 'appear' classes are **removed** and the `done` class is added to the DOM node.
|
|
@@ -2882,7 +2854,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2882
2854
|
*
|
|
2883
2855
|
* @type Function(node: HtmlElement, isAppearing: bool)
|
|
2884
2856
|
*/
|
|
2885
|
-
onEntered:
|
|
2857
|
+
onEntered: PropTypes.func,
|
|
2886
2858
|
/**
|
|
2887
2859
|
* A `<Transition>` callback fired immediately after the 'exit' class is
|
|
2888
2860
|
* applied.
|
|
@@ -2891,7 +2863,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2891
2863
|
*
|
|
2892
2864
|
* @type Function(node: HtmlElement)
|
|
2893
2865
|
*/
|
|
2894
|
-
onExit:
|
|
2866
|
+
onExit: PropTypes.func,
|
|
2895
2867
|
/**
|
|
2896
2868
|
* A `<Transition>` callback fired immediately after the 'exit-active' is applied.
|
|
2897
2869
|
*
|
|
@@ -2899,7 +2871,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2899
2871
|
*
|
|
2900
2872
|
* @type Function(node: HtmlElement)
|
|
2901
2873
|
*/
|
|
2902
|
-
onExiting:
|
|
2874
|
+
onExiting: PropTypes.func,
|
|
2903
2875
|
/**
|
|
2904
2876
|
* A `<Transition>` callback fired immediately after the 'exit' classes
|
|
2905
2877
|
* are **removed** and the `exit-done` class is added to the DOM node.
|
|
@@ -2908,7 +2880,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2908
2880
|
*
|
|
2909
2881
|
* @type Function(node: HtmlElement)
|
|
2910
2882
|
*/
|
|
2911
|
-
onExited:
|
|
2883
|
+
onExited: PropTypes.func
|
|
2912
2884
|
}) : {};
|
|
2913
2885
|
const CSSTransition$1 = CSSTransition;
|
|
2914
2886
|
const defaultProps$1p = {
|
|
@@ -3670,6 +3642,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3670
3642
|
const [scrollStart, setScrollStart] = React.useState(false);
|
|
3671
3643
|
const state = React.useRef(initData);
|
|
3672
3644
|
const [scrollTop, setScrollTop] = React.useState(0);
|
|
3645
|
+
const [scrollY, setScrollY] = React.useState(0);
|
|
3673
3646
|
const resetScrollState = () => {
|
|
3674
3647
|
setScrollStart(false);
|
|
3675
3648
|
};
|
|
@@ -3707,7 +3680,11 @@ var __publicField = (obj, key, value) => {
|
|
|
3707
3680
|
cacheIndex = state.current.listHeight.length - 2;
|
|
3708
3681
|
}
|
|
3709
3682
|
setCodeIndex(cacheIndex);
|
|
3710
|
-
|
|
3683
|
+
const scrollTop2 = state.current.listHeight[cacheIndex];
|
|
3684
|
+
setScrollTop(scrollTop2);
|
|
3685
|
+
if (isSticky && scrollY !== scrollTop2) {
|
|
3686
|
+
setScrollY(Math.floor(scrollTop2) > 0 ? 1 : 0);
|
|
3687
|
+
}
|
|
3711
3688
|
};
|
|
3712
3689
|
const touchMove = (e) => {
|
|
3713
3690
|
const firstTouch = e.touches[0];
|
|
@@ -3755,7 +3732,10 @@ var __publicField = (obj, key, value) => {
|
|
|
3755
3732
|
const target = e.target;
|
|
3756
3733
|
const { scrollTop: scrollTop2 } = target;
|
|
3757
3734
|
state.current.scrollY = Math.floor(scrollTop2);
|
|
3758
|
-
setScrollTop(scrollTop2);
|
|
3735
|
+
Taro.getEnv() === "WEB" && setScrollTop(scrollTop2);
|
|
3736
|
+
if (isSticky && scrollTop2 !== scrollY) {
|
|
3737
|
+
setScrollY(Math.floor(scrollTop2) > 0 ? 1 : 0);
|
|
3738
|
+
}
|
|
3759
3739
|
for (let i = 0; i < listHeight.length - 1; i++) {
|
|
3760
3740
|
const height1 = listHeight[i];
|
|
3761
3741
|
const height2 = listHeight[i + 1];
|
|
@@ -3764,7 +3744,6 @@ var __publicField = (obj, key, value) => {
|
|
|
3764
3744
|
return;
|
|
3765
3745
|
}
|
|
3766
3746
|
}
|
|
3767
|
-
setCurrentIndex(listHeight.length - 2);
|
|
3768
3747
|
};
|
|
3769
3748
|
React.useEffect(() => {
|
|
3770
3749
|
if (listview.current) {
|
|
@@ -3773,7 +3752,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3773
3752
|
});
|
|
3774
3753
|
}
|
|
3775
3754
|
}, [listview]);
|
|
3776
|
-
return /* @__PURE__ */ React.createElement("div", { className: `${b2()} ${className} `, ...rest },
|
|
3755
|
+
return /* @__PURE__ */ React.createElement("div", { className: `${b2()} ${className} `, ...rest }, /* @__PURE__ */ React.createElement(
|
|
3777
3756
|
"div",
|
|
3778
3757
|
{
|
|
3779
3758
|
className: b2("list"),
|
|
@@ -3784,6 +3763,8 @@ var __publicField = (obj, key, value) => {
|
|
|
3784
3763
|
{
|
|
3785
3764
|
scrollTop,
|
|
3786
3765
|
scrollY: true,
|
|
3766
|
+
scrollWithAnimation: true,
|
|
3767
|
+
scrollAnchoring: true,
|
|
3787
3768
|
className: b2("list__inner"),
|
|
3788
3769
|
ref: listview,
|
|
3789
3770
|
onScroll: listViewScroll
|
|
@@ -3835,7 +3816,7 @@ var __publicField = (obj, key, value) => {
|
|
|
3835
3816
|
item[acceptKey]
|
|
3836
3817
|
);
|
|
3837
3818
|
})
|
|
3838
|
-
)));
|
|
3819
|
+
)), isSticky && scrollY > 0 ? /* @__PURE__ */ React.createElement("div", { className: b2("list__fixed") }, /* @__PURE__ */ React.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey])) : null);
|
|
3839
3820
|
};
|
|
3840
3821
|
Elevator.defaultProps = defaultProps$1h;
|
|
3841
3822
|
Elevator.displayName = "NutElevator";
|
package/dist/style.mjs
CHANGED