@nutui/nutui-react-taro 1.4.12 → 1.4.13

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/esm/Address.js +2 -2
  3. package/dist/esm/Audio.js +2 -2
  4. package/dist/esm/DatePicker.js +4 -2
  5. package/dist/esm/Elevator.js +1 -1
  6. package/dist/esm/Input.js +1 -1
  7. package/dist/esm/Picker.js +3 -1
  8. package/dist/esm/PullToRefresh.js +4 -2
  9. package/dist/esm/Range.js +1 -1
  10. package/dist/esm/Sticky.js +3 -2
  11. package/dist/esm/{address.taro-f1acf8fb.js → address.taro-3a9b6396.js} +1 -1
  12. package/dist/esm/{audio.taro-7ba4b47e.js → audio.taro-87ec8bf2.js} +1 -1
  13. package/dist/esm/can-use-dom-3eeb5af4.js +6 -0
  14. package/dist/esm/{datepicker.taro-f8369e63.js → datepicker.taro-a86c6052.js} +1 -1
  15. package/dist/esm/{elevator.taro-c4ed99e4.js → elevator.taro-6019669e.js} +2 -21
  16. package/dist/esm/{get-scroll-parent-5d508382.js → get-scroll-parent-b4a07e65.js} +2 -5
  17. package/dist/esm/{input.taro-27e1262b.js → input.taro-851446b6.js} +1 -1
  18. package/dist/esm/nutui-react.es.js +12 -10
  19. package/dist/esm/{picker.taro-ab396b2d.js → picker.taro-f32ec88a.js} +3 -1
  20. package/dist/esm/{pulltorefresh.taro-dc15ab1a.js → pulltorefresh.taro-a294f656.js} +2 -16
  21. package/dist/esm/{range.taro-8688b321.js → range.taro-d8fc7656.js} +2 -2
  22. package/dist/esm/{sticky.taro-d5b6eabe.js → sticky.taro-218bda37.js} +1 -1
  23. package/dist/esm/supports-passive-c85ef996.js +18 -0
  24. package/dist/locales/base.js +1 -1
  25. package/dist/locales/en-US.js +1 -1
  26. package/dist/locales/id-ID.js +1 -1
  27. package/dist/locales/zh-CN.js +1 -1
  28. package/dist/locales/zh-TW.js +1 -1
  29. package/dist/locales/zh-UG.js +1 -1
  30. package/dist/nutui.react.mjs +21 -40
  31. package/dist/nutui.react.umd.js +21 -40
  32. package/dist/style.mjs +1 -1
  33. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v1.4.13
2
+ `2023-03-29`
3
+
4
+ * :bug: fix(dialog): 修复Dialog.confirm弹框关闭后dom没有移除问题 (#851) @拧巴的猫
5
+ * :bug: fix(Elevator): 组件瘦身+taro h5适配 (#858) @拧巴的猫
6
+ * :bug: fix(picker): 修复taro版本滚动报错问题 (#852) @拧巴的猫
7
+ * :bug: fix(range): 修复 a11y 属性并补全组件的单元测试 (#849) @AnteeHub
8
+ * :bug: fix: taro-v3.6.12 complier @junjun666
9
+ * :bug: fix: 修复input 的errorMessage显隐导致input失焦问题 (#827) @Penguin-Lin
10
+ * 📖 docs: imagepreview 组件增加点击缩略图切换示例 (#854) @oasis-cloud
11
+
12
+
1
13
  # v1.4.12
2
14
  `2023-03-22`
3
15
 
@@ -1,4 +1,4 @@
1
- import { A as Address } from './address.taro-f1acf8fb.js';
1
+ import { A as Address } from './address.taro-3a9b6396.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-c4ed99e4.js';
18
+ import './elevator.taro-6019669e.js';
19
19
  import './configprovider.taro-8d71eb49.js';
20
20
 
21
21
 
package/dist/esm/Audio.js CHANGED
@@ -1,10 +1,10 @@
1
- import { A as Audio } from './audio.taro-7ba4b47e.js';
1
+ import { A as Audio } from './audio.taro-87ec8bf2.js';
2
2
  import 'react';
3
3
  import '@tarojs/taro';
4
4
  import './icon.taro-296a1bec.js';
5
5
  import './bem-350c1702.js';
6
6
  import '@bem-react/classname';
7
- import './range.taro-8688b321.js';
7
+ import './range.taro-d8fc7656.js';
8
8
  import './useTouch-db24bb5c.js';
9
9
  import './useClientRect-1f8ed1fe.js';
10
10
  import './toast.taro-d6c14811.js';
@@ -1,6 +1,6 @@
1
- import { D as DatePicker } from './datepicker.taro-f8369e63.js';
1
+ import { D as DatePicker } from './datepicker.taro-a86c6052.js';
2
2
  import 'react';
3
- import './picker.taro-ab396b2d.js';
3
+ import './picker.taro-f32ec88a.js';
4
4
  import '@tarojs/components';
5
5
  import './popup.taro-01676bff.js';
6
6
  import 'react-dom';
@@ -13,6 +13,8 @@ import './icon.taro-296a1bec.js';
13
13
  import './typings-b9828dba.js';
14
14
  import './useTouch-db24bb5c.js';
15
15
  import './useClientRect-1f8ed1fe.js';
16
+ import './supports-passive-c85ef996.js';
17
+ import './can-use-dom-3eeb5af4.js';
16
18
  import './configprovider.taro-8d71eb49.js';
17
19
  import 'lodash.kebabcase';
18
20
  import './zh-CN-c779e6c1.js';
@@ -1,4 +1,4 @@
1
- import { E as Elevator } from './elevator.taro-c4ed99e4.js';
1
+ import { E as Elevator } from './elevator.taro-6019669e.js';
2
2
  import 'react';
3
3
  import '@tarojs/taro';
4
4
  import '@tarojs/components';
package/dist/esm/Input.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as Input } from './input.taro-27e1262b.js';
1
+ import { I as Input } from './input.taro-851446b6.js';
2
2
  import 'react';
3
3
  import './icon.taro-296a1bec.js';
4
4
  import './bem-350c1702.js';
@@ -1,4 +1,4 @@
1
- import { P as Picker } from './picker.taro-ab396b2d.js';
1
+ import { P as Picker } from './picker.taro-f32ec88a.js';
2
2
  import 'react';
3
3
  import '@tarojs/components';
4
4
  import './popup.taro-01676bff.js';
@@ -12,6 +12,8 @@ import './icon.taro-296a1bec.js';
12
12
  import './typings-b9828dba.js';
13
13
  import './useTouch-db24bb5c.js';
14
14
  import './useClientRect-1f8ed1fe.js';
15
+ import './supports-passive-c85ef996.js';
16
+ import './can-use-dom-3eeb5af4.js';
15
17
  import './configprovider.taro-8d71eb49.js';
16
18
  import 'lodash.kebabcase';
17
19
  import './zh-CN-c779e6c1.js';
@@ -1,11 +1,13 @@
1
- import { P as PullToRefresh } from './pulltorefresh.taro-dc15ab1a.js';
1
+ import { P as PullToRefresh } from './pulltorefresh.taro-a294f656.js';
2
2
  import 'react';
3
3
  import '@use-gesture/react';
4
4
  import '@react-spring/web';
5
5
  import './configprovider.taro-8d71eb49.js';
6
6
  import 'lodash.kebabcase';
7
7
  import './zh-CN-c779e6c1.js';
8
- import './get-scroll-parent-5d508382.js';
8
+ import './get-scroll-parent-b4a07e65.js';
9
+ import './can-use-dom-3eeb5af4.js';
10
+ import './supports-passive-c85ef996.js';
9
11
 
10
12
 
11
13
 
package/dist/esm/Range.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R as Range } from './range.taro-8688b321.js';
1
+ import { R as Range } from './range.taro-d8fc7656.js';
2
2
  import 'react';
3
3
  import './useTouch-db24bb5c.js';
4
4
  import './useClientRect-1f8ed1fe.js';
@@ -1,9 +1,10 @@
1
- import { S as Sticky } from './sticky.taro-d5b6eabe.js';
1
+ import { S as Sticky } from './sticky.taro-218bda37.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '@tarojs/taro';
5
5
  import './useClientRect-1f8ed1fe.js';
6
- import './get-scroll-parent-5d508382.js';
6
+ import './get-scroll-parent-b4a07e65.js';
7
+ import './can-use-dom-3eeb5af4.js';
7
8
  import './bem-350c1702.js';
8
9
  import '@bem-react/classname';
9
10
 
@@ -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-c4ed99e4.js';
8
+ import { E as Elevator } from './elevator.taro-6019669e.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,7 +1,7 @@
1
1
  import React__default, { useState, useRef } from 'react';
2
2
  import { createInnerAudioContext } from '@tarojs/taro';
3
3
  import { I as Icon } from './icon.taro-296a1bec.js';
4
- import { R as Range } from './range.taro-8688b321.js';
4
+ import { R as Range } from './range.taro-d8fc7656.js';
5
5
  import { B as Button } from './button.taro-9244d065.js';
6
6
  import { c as cn } from './bem-350c1702.js';
7
7
  import { u as useConfig } from './configprovider.taro-8d71eb49.js';
@@ -0,0 +1,6 @@
1
+ const canUseDom = !!(typeof window !== 'undefined' &&
2
+ typeof document !== 'undefined' &&
3
+ window.document &&
4
+ window.document.createElement);
5
+
6
+ export { canUseDom as c };
@@ -1,5 +1,5 @@
1
1
  import React__default, { useState, useRef, useEffect } from 'react';
2
- import { P as Picker } from './picker.taro-ab396b2d.js';
2
+ import { P as Picker } from './picker.taro-f32ec88a.js';
3
3
  import { u as useConfig } from './configprovider-67d19d3a.js';
4
4
 
5
5
  const currentYear = new Date().getFullYear();
@@ -25,14 +25,11 @@ const Elevator = (props) => {
25
25
  listHeight: [],
26
26
  listGroup: [],
27
27
  scrollY: 0,
28
- diff: -1,
29
- fixedTop: 0,
30
28
  };
31
29
  const touchState = useRef({
32
30
  y1: 0,
33
31
  y2: 0,
34
32
  });
35
- const [scrollY, setScrollY] = useState(0);
36
33
  const [currentData, setCurrentData] = useState({});
37
34
  const [currentKey, setCurrentKey] = useState('');
38
35
  const [currentIndex, setCurrentIndex] = useState(0);
@@ -44,9 +41,6 @@ const Elevator = (props) => {
44
41
  const resetScrollState = () => {
45
42
  setScrollStart(false);
46
43
  };
47
- const clientHeight = () => {
48
- return listview.current ? listview.current.clientHeight : 0;
49
- };
50
44
  const getData = (el) => {
51
45
  if (!el.dataset.index) {
52
46
  return '0';
@@ -136,13 +130,12 @@ const Elevator = (props) => {
136
130
  const target = e.target;
137
131
  const { scrollTop } = target;
138
132
  state.current.scrollY = Math.floor(scrollTop);
139
- setScrollY(scrollTop);
133
+ setScrollTop(scrollTop);
140
134
  for (let i = 0; i < listHeight.length - 1; i++) {
141
135
  const height1 = listHeight[i];
142
136
  const height2 = listHeight[i + 1];
143
137
  if (state.current.scrollY >= height1 && state.current.scrollY < height2) {
144
138
  setCurrentIndex(i);
145
- state.current.diff = height2 - state.current.scrollY;
146
139
  return;
147
140
  }
148
141
  }
@@ -155,20 +148,8 @@ const Elevator = (props) => {
155
148
  });
156
149
  }
157
150
  }, [listview]);
158
- useEffect(() => {
159
- const { listHeight, diff, scrollY } = state.current;
160
- let fixedTop = diff > 0 && diff < titleHeight ? diff - titleHeight : 0;
161
- if (scrollY + clientHeight() === listHeight[listHeight.length - 1]) {
162
- if (fixedTop !== 0) {
163
- fixedTop = 0;
164
- }
165
- }
166
- if (state.current.fixedTop === fixedTop)
167
- return;
168
- state.current.fixedTop = fixedTop;
169
- }, [state.current.diff, titleHeight]);
170
151
  return (React__default.createElement("div", { className: `${b()} ${className} `, ...rest },
171
- isSticky && scrollY > 0 ? (React__default.createElement("div", { className: b('list__fixed') },
152
+ isSticky && scrollTop > 0 ? (React__default.createElement("div", { className: b('list__fixed') },
172
153
  React__default.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey]))) : null,
173
154
  React__default.createElement("div", { className: b('list'), style: { height: Number.isNaN(+height) ? height : `${height}px` } },
174
155
  React__default.createElement(ScrollView, { scrollTop: scrollTop, scrollY: true, className: b('list__inner'), ref: listview, onScroll: listViewScroll }, indexList.map((item, idx) => {
@@ -1,7 +1,4 @@
1
- const canUseDom = !!(typeof window !== 'undefined' &&
2
- typeof document !== 'undefined' &&
3
- window.document &&
4
- window.document.createElement);
1
+ import { c as canUseDom } from './can-use-dom-3eeb5af4.js';
5
2
 
6
3
  const defaultRoot = canUseDom ? window : undefined;
7
4
  const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
@@ -25,4 +22,4 @@ function getScrollParent(el, root = defaultRoot) {
25
22
  return root;
26
23
  }
27
24
 
28
- export { canUseDom as c, getScrollParent as g };
25
+ export { getScrollParent as g };
@@ -235,7 +235,7 @@ const Input = forwardRef((props, ref) => {
235
235
  maxlength)) : null),
236
236
  errorMessage ? (React__default.createElement("div", { className: "nut-input-error-message", style: {
237
237
  textAlign: errorMessageAlign,
238
- } }, errorMessage)) : null)))));
238
+ } }, errorMessage)) : (React__default.createElement("div", null)))))));
239
239
  });
240
240
  Input.defaultProps = defaultProps;
241
241
  Input.displayName = 'NutInput';
@@ -12,8 +12,8 @@ export { G as Grid } from './grid.taro-3503b82c.js';
12
12
  export { G as GridItem } from './griditem.taro-da155df6.js';
13
13
  export { L as Layout } from './layout.taro-9046d093.js';
14
14
  export { R as Row } from './row.taro-f64d4a13.js';
15
- export { S as Sticky } from './sticky.taro-d5b6eabe.js';
16
- export { E as Elevator } from './elevator.taro-c4ed99e4.js';
15
+ export { S as Sticky } from './sticky.taro-218bda37.js';
16
+ export { E as Elevator } from './elevator.taro-6019669e.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';
@@ -31,15 +31,15 @@ export { C as Calendar } from './calendar.taro-670842ea.js';
31
31
  export { C as CalendarItem } from './calendaritem.taro-2a603571.js';
32
32
  export { C as Cascader } from './cascader.taro-a824b371.js';
33
33
  export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-6120e3e3.js';
34
- export { D as DatePicker } from './datepicker.taro-f8369e63.js';
34
+ export { D as DatePicker } from './datepicker.taro-a86c6052.js';
35
35
  export { F as Form } from './form.taro-0c8e7a39.js';
36
36
  export { F as FormItem } from './formitem.taro-190a3326.js';
37
- export { I as Input } from './input.taro-27e1262b.js';
37
+ export { I as Input } from './input.taro-851446b6.js';
38
38
  export { I as InputNumber } from './inputnumber.taro-7c2d7e85.js';
39
39
  export { N as NumberKeyboard } from './numberkeyboard.taro-1bc24744.js';
40
- export { P as Picker } from './picker.taro-ab396b2d.js';
40
+ export { P as Picker } from './picker.taro-f32ec88a.js';
41
41
  export { R as Radio, a as RadioGroup } from './radio.taro-a6eff96c.js';
42
- export { R as Range } from './range.taro-8688b321.js';
42
+ export { R as Range } from './range.taro-d8fc7656.js';
43
43
  export { R as Rate } from './rate.taro-6cdf03bd.js';
44
44
  export { S as SearchBar } from './searchbar.taro-0c25927b.js';
45
45
  export { S as ShortPassword } from './shortpassword.taro-9ee034f7.js';
@@ -51,13 +51,13 @@ export { B as Dialog } from './dialog.taro-a3267d29.js';
51
51
  export { D as Drag } from './drag.taro-79bb8744.js';
52
52
  export { I as Infiniteloading } from './infiniteloading.taro-e66e3746.js';
53
53
  export { N as Notify } from './notify.taro-e17c6f82.js';
54
- export { P as PullToRefresh } from './pulltorefresh.taro-dc15ab1a.js';
54
+ export { P as PullToRefresh } from './pulltorefresh.taro-a294f656.js';
55
55
  export { S as Swipe } from './swipe.taro-ea35f07f.js';
56
56
  export { S as Switch } from './switch.taro-34ca8228.js';
57
57
  export { T as Toast } from './toast.taro-d6c14811.js';
58
58
  export { A as Animate } from './animate.taro-fb7986d6.js';
59
59
  export { A as AnimatingNumbers } from './animatingnumbers.taro-03e5d61d.js';
60
- export { A as Audio } from './audio.taro-7ba4b47e.js';
60
+ export { A as Audio } from './audio.taro-87ec8bf2.js';
61
61
  export { A as Avatar } from './avatar.taro-3676f38f.js';
62
62
  export { A as AvatarGroup } from './avatargroup-f3574510.js';
63
63
  export { B as Badge } from './badge.taro-a4e59c11.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-f1acf8fb.js';
86
+ export { A as Address } from './address.taro-3a9b6396.js';
87
87
  export { B as Barrage } from './barrage.taro-80df08d3.js';
88
88
  export { C as Card } from './card.taro-e4c76dad.js';
89
89
  export { S as Signature } from './signature.taro-ec4e713b.js';
@@ -104,10 +104,12 @@ import 'react-transition-group';
104
104
  import './UserContext-0aac9a82.js';
105
105
  import './grid.taro.context-c2bbfb4f.js';
106
106
  import './useClientRect-1f8ed1fe.js';
107
- import './get-scroll-parent-5d508382.js';
107
+ import './get-scroll-parent-b4a07e65.js';
108
+ import './can-use-dom-3eeb5af4.js';
108
109
  import './offsetContext-c2a746fa.js';
109
110
  import './configprovider-67d19d3a.js';
110
111
  import './useTouch-db24bb5c.js';
112
+ import './supports-passive-c85ef996.js';
111
113
  import './icon-296a1bec.js';
112
114
  import './index-5bcb0ff8.js';
113
115
  import '@use-gesture/react';
@@ -3,6 +3,7 @@ import { View } from '@tarojs/components';
3
3
  import { P as Popup } from './popup.taro-01676bff.js';
4
4
  import { u as useTouch } from './useTouch-db24bb5c.js';
5
5
  import { g as getRectByTaro } from './useClientRect-1f8ed1fe.js';
6
+ import { p as passiveSupported } from './supports-passive-c85ef996.js';
6
7
  import { u as useConfig } from './configprovider.taro-8d71eb49.js';
7
8
  import { c as cn } from './bem-350c1702.js';
8
9
 
@@ -154,7 +155,8 @@ const InternalPickerSlot = (props, ref) => {
154
155
  // 阻止默认事件
155
156
  const preventDefault = (event, isStopPropagation) => {
156
157
  /* istanbul ignore else */
157
- if (typeof event.cancelable !== 'boolean' || event.cancelable) {
158
+ if (!passiveSupported &&
159
+ (typeof event.cancelable !== 'boolean' || event.cancelable)) {
158
160
  event.preventDefault();
159
161
  }
160
162
  if (isStopPropagation) {
@@ -2,7 +2,8 @@ import React__default, { useState, useRef, useEffect } from 'react';
2
2
  import { useDrag } from '@use-gesture/react';
3
3
  import { useSpring, animated } from '@react-spring/web';
4
4
  import { u as useConfig } from './configprovider.taro-8d71eb49.js';
5
- import { c as canUseDom, g as getScrollParent } from './get-scroll-parent-5d508382.js';
5
+ import { g as getScrollParent } from './get-scroll-parent-b4a07e65.js';
6
+ import { p as passiveSupported } from './supports-passive-c85ef996.js';
6
7
 
7
8
  function bound(position, min, max) {
8
9
  let ret = position;
@@ -30,21 +31,6 @@ function rubberbandIfOutOfBounds(position, min, max, dimension, constant = 0.15)
30
31
 
31
32
  const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time));
32
33
 
33
- let passiveSupported = false;
34
- if (canUseDom) {
35
- try {
36
- const opts = Object.defineProperty({}, 'passive', {
37
- get() {
38
- passiveSupported = true;
39
- },
40
- });
41
- window.addEventListener('test-passive-supported', null, opts);
42
- }
43
- catch (e) {
44
- console.log(e);
45
- }
46
- }
47
-
48
34
  const defaultProps = {
49
35
  pullingText: '',
50
36
  canReleaseText: '',
@@ -295,7 +295,7 @@ const Range = (props) => {
295
295
  }))) : null,
296
296
  React__default.createElement("div", { className: "nut-range-bar", style: barStyle() }, range ? ([0, 1].map((item, index) => {
297
297
  return (React__default.createElement("div", { role: "slider", key: index, className: `${index === 0 ? 'nut-range-button-wrapper-left' : ''}
298
- ${index === 1 ? 'nut-range-button-wrapper-right' : ''}`, tabIndex: disabled ? -1 : 0, "aria-valuemin": +min, "aria-valuenow": curValue(index), "aria-valuemax": +max, "aria-orientation": "horizontal", onTouchStart: (e) => {
298
+ ${index === 1 ? 'nut-range-button-wrapper-right' : ''}`, tabIndex: disabled ? -1 : 0, "aria-valuemin": +min, "aria-valuenow": curValue(index), "aria-valuemax": +max, "aria-orientation": vertical ? 'vertical' : 'horizontal', onTouchStart: (e) => {
299
299
  if (typeof index === 'number') {
300
300
  // 实时更新当前拖动的按钮索引
301
301
  SetButtonIndex(index);
@@ -310,7 +310,7 @@ const Range = (props) => {
310
310
  }, onClick: (e) => {
311
311
  e.stopPropagation();
312
312
  } }, button || (React__default.createElement("div", { className: "nut-range-button", style: buttonStyle() }, !hiddenTag ? (React__default.createElement("div", { className: "number" }, curValueDesc || curValue(index))) : null))));
313
- })) : (React__default.createElement("div", { role: "slider", className: "nut-range-button-wrapper", tabIndex: disabled ? -1 : 0, "aria-valuemin": +min, "aria-valuenow": curValue(), "aria-valuemax": +max, "aria-orientation": "horizontal", onTouchStart: (e) => {
313
+ })) : (React__default.createElement("div", { role: "slider", className: "nut-range-button-wrapper", tabIndex: disabled ? -1 : 0, "aria-valuemin": +min, "aria-valuenow": curValue(), "aria-valuemax": +max, "aria-orientation": vertical ? 'vertical' : 'horizontal', onTouchStart: (e) => {
314
314
  onTouchStart(e);
315
315
  }, onTouchMove: (e) => {
316
316
  onTouchMove(e);
@@ -2,7 +2,7 @@ import React__default, { useRef, useEffect, useState, useMemo, useCallback } fro
2
2
  import classNames from 'classnames';
3
3
  import { getEnv, usePageScroll, getSystemInfoSync } from '@tarojs/taro';
4
4
  import { g as getRectByTaro } from './useClientRect-1f8ed1fe.js';
5
- import { g as getScrollParent } from './get-scroll-parent-5d508382.js';
5
+ import { g as getScrollParent } from './get-scroll-parent-b4a07e65.js';
6
6
  import { c as cn } from './bem-350c1702.js';
7
7
 
8
8
  function useWatch(dep, callback, config = { immediate: false }) {
@@ -0,0 +1,18 @@
1
+ import { c as canUseDom } from './can-use-dom-3eeb5af4.js';
2
+
3
+ let passiveSupported = false;
4
+ if (canUseDom) {
5
+ try {
6
+ const opts = Object.defineProperty({}, 'passive', {
7
+ get() {
8
+ passiveSupported = true;
9
+ },
10
+ });
11
+ window.addEventListener('test-passive-supported', null, opts);
12
+ }
13
+ catch (e) {
14
+ console.log(e);
15
+ }
16
+ }
17
+
18
+ export { passiveSupported as p };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:55 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:55 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:55 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:55 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:55 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:55 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  /*!
8
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:03 GMT+0800 (中国标准时间)
8
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:15 GMT+0800 (China Standard Time)
9
9
  * (c) 2023 @jdf2e.
10
10
  * Released under the MIT License.
11
11
  */
@@ -3627,15 +3627,12 @@ const Elevator = (props) => {
3627
3627
  anchorIndex: 0,
3628
3628
  listHeight: [],
3629
3629
  listGroup: [],
3630
- scrollY: 0,
3631
- diff: -1,
3632
- fixedTop: 0
3630
+ scrollY: 0
3633
3631
  };
3634
3632
  const touchState = useRef({
3635
3633
  y1: 0,
3636
3634
  y2: 0
3637
3635
  });
3638
- const [scrollY, setScrollY] = useState(0);
3639
3636
  const [currentData, setCurrentData] = useState(
3640
3637
  {}
3641
3638
  );
@@ -3648,9 +3645,6 @@ const Elevator = (props) => {
3648
3645
  const resetScrollState = () => {
3649
3646
  setScrollStart(false);
3650
3647
  };
3651
- const clientHeight2 = () => {
3652
- return listview.current ? listview.current.clientHeight : 0;
3653
- };
3654
3648
  const getData = (el) => {
3655
3649
  if (!el.dataset.index) {
3656
3650
  return "0";
@@ -3733,13 +3727,12 @@ const Elevator = (props) => {
3733
3727
  const target = e.target;
3734
3728
  const { scrollTop: scrollTop2 } = target;
3735
3729
  state.current.scrollY = Math.floor(scrollTop2);
3736
- setScrollY(scrollTop2);
3730
+ setScrollTop(scrollTop2);
3737
3731
  for (let i = 0; i < listHeight.length - 1; i++) {
3738
3732
  const height1 = listHeight[i];
3739
3733
  const height2 = listHeight[i + 1];
3740
3734
  if (state.current.scrollY >= height1 && state.current.scrollY < height2) {
3741
3735
  setCurrentIndex(i);
3742
- state.current.diff = height2 - state.current.scrollY;
3743
3736
  return;
3744
3737
  }
3745
3738
  }
@@ -3752,19 +3745,7 @@ const Elevator = (props) => {
3752
3745
  });
3753
3746
  }
3754
3747
  }, [listview]);
3755
- useEffect(() => {
3756
- const { listHeight, diff, scrollY: scrollY2 } = state.current;
3757
- let fixedTop = diff > 0 && diff < titleHeight ? diff - titleHeight : 0;
3758
- if (scrollY2 + clientHeight2() === listHeight[listHeight.length - 1]) {
3759
- if (fixedTop !== 0) {
3760
- fixedTop = 0;
3761
- }
3762
- }
3763
- if (state.current.fixedTop === fixedTop)
3764
- return;
3765
- state.current.fixedTop = fixedTop;
3766
- }, [state.current.diff, titleHeight]);
3767
- return /* @__PURE__ */ React__default.createElement("div", { className: `${b2()} ${className} `, ...rest }, isSticky && scrollY > 0 ? /* @__PURE__ */ React__default.createElement("div", { className: b2("list__fixed") }, /* @__PURE__ */ React__default.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey])) : null, /* @__PURE__ */ React__default.createElement(
3748
+ return /* @__PURE__ */ React__default.createElement("div", { className: `${b2()} ${className} `, ...rest }, isSticky && scrollTop > 0 ? /* @__PURE__ */ React__default.createElement("div", { className: b2("list__fixed") }, /* @__PURE__ */ React__default.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey])) : null, /* @__PURE__ */ React__default.createElement(
3768
3749
  "div",
3769
3750
  {
3770
3751
  className: b2("list"),
@@ -6709,6 +6690,19 @@ function useTouch() {
6709
6690
  isHorizontal
6710
6691
  };
6711
6692
  }
6693
+ let passiveSupported = false;
6694
+ if (canUseDom) {
6695
+ try {
6696
+ const opts = Object.defineProperty({}, "passive", {
6697
+ get() {
6698
+ passiveSupported = true;
6699
+ }
6700
+ });
6701
+ window.addEventListener("test-passive-supported", null, opts);
6702
+ } catch (e) {
6703
+ console.log(e);
6704
+ }
6705
+ }
6712
6706
  const InternalPickerSlot = (props, ref) => {
6713
6707
  const {
6714
6708
  keyIndex = 0,
@@ -6845,7 +6839,7 @@ const InternalPickerSlot = (props, ref) => {
6845
6839
  setChooseValue(scrollDistance);
6846
6840
  };
6847
6841
  const preventDefault2 = (event, isStopPropagation) => {
6848
- if (typeof event.cancelable !== "boolean" || event.cancelable) {
6842
+ if (!passiveSupported && (typeof event.cancelable !== "boolean" || event.cancelable)) {
6849
6843
  event.preventDefault();
6850
6844
  }
6851
6845
  if (isStopPropagation) {
@@ -8134,7 +8128,7 @@ const Input = forwardRef((props, ref) => {
8134
8128
  }
8135
8129
  },
8136
8130
  errorMessage
8137
- ) : null))
8131
+ ) : /* @__PURE__ */ React__default.createElement("div", null)))
8138
8132
  );
8139
8133
  });
8140
8134
  Input.defaultProps = defaultProps$X;
@@ -9291,7 +9285,7 @@ const Range = (props) => {
9291
9285
  "aria-valuemin": +min,
9292
9286
  "aria-valuenow": curValue(index),
9293
9287
  "aria-valuemax": +max,
9294
- "aria-orientation": "horizontal",
9288
+ "aria-orientation": vertical ? "vertical" : "horizontal",
9295
9289
  onTouchStart: (e) => {
9296
9290
  if (typeof index === "number") {
9297
9291
  SetButtonIndex(index);
@@ -9322,7 +9316,7 @@ const Range = (props) => {
9322
9316
  "aria-valuemin": +min,
9323
9317
  "aria-valuenow": curValue(),
9324
9318
  "aria-valuemax": +max,
9325
- "aria-orientation": "horizontal",
9319
+ "aria-orientation": vertical ? "vertical" : "horizontal",
9326
9320
  onTouchStart: (e) => {
9327
9321
  onTouchStart(e);
9328
9322
  },
@@ -16002,19 +15996,6 @@ function rubberbandIfOutOfBounds(position, min, max, dimension, constant = 0.15)
16002
15996
  return position;
16003
15997
  }
16004
15998
  const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time));
16005
- let passiveSupported = false;
16006
- if (canUseDom) {
16007
- try {
16008
- const opts = Object.defineProperty({}, "passive", {
16009
- get() {
16010
- passiveSupported = true;
16011
- }
16012
- });
16013
- window.addEventListener("test-passive-supported", null, opts);
16014
- } catch (e) {
16015
- console.log(e);
16016
- }
16017
- }
16018
15999
  const defaultProps$D = {
16019
16000
  pullingText: "",
16020
16001
  canReleaseText: "",
@@ -8,7 +8,7 @@ var __publicField = (obj, key, value) => {
8
8
  return value;
9
9
  };
10
10
  /*!
11
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:03 GMT+0800 (中国标准时间)
11
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:15 GMT+0800 (China Standard Time)
12
12
  * (c) 2023 @jdf2e.
13
13
  * Released under the MIT License.
14
14
  */
@@ -3643,15 +3643,12 @@ var __publicField = (obj, key, value) => {
3643
3643
  anchorIndex: 0,
3644
3644
  listHeight: [],
3645
3645
  listGroup: [],
3646
- scrollY: 0,
3647
- diff: -1,
3648
- fixedTop: 0
3646
+ scrollY: 0
3649
3647
  };
3650
3648
  const touchState = React.useRef({
3651
3649
  y1: 0,
3652
3650
  y2: 0
3653
3651
  });
3654
- const [scrollY, setScrollY] = React.useState(0);
3655
3652
  const [currentData, setCurrentData] = React.useState(
3656
3653
  {}
3657
3654
  );
@@ -3664,9 +3661,6 @@ var __publicField = (obj, key, value) => {
3664
3661
  const resetScrollState = () => {
3665
3662
  setScrollStart(false);
3666
3663
  };
3667
- const clientHeight2 = () => {
3668
- return listview.current ? listview.current.clientHeight : 0;
3669
- };
3670
3664
  const getData = (el) => {
3671
3665
  if (!el.dataset.index) {
3672
3666
  return "0";
@@ -3749,13 +3743,12 @@ var __publicField = (obj, key, value) => {
3749
3743
  const target = e.target;
3750
3744
  const { scrollTop: scrollTop2 } = target;
3751
3745
  state.current.scrollY = Math.floor(scrollTop2);
3752
- setScrollY(scrollTop2);
3746
+ setScrollTop(scrollTop2);
3753
3747
  for (let i = 0; i < listHeight.length - 1; i++) {
3754
3748
  const height1 = listHeight[i];
3755
3749
  const height2 = listHeight[i + 1];
3756
3750
  if (state.current.scrollY >= height1 && state.current.scrollY < height2) {
3757
3751
  setCurrentIndex(i);
3758
- state.current.diff = height2 - state.current.scrollY;
3759
3752
  return;
3760
3753
  }
3761
3754
  }
@@ -3768,19 +3761,7 @@ var __publicField = (obj, key, value) => {
3768
3761
  });
3769
3762
  }
3770
3763
  }, [listview]);
3771
- React.useEffect(() => {
3772
- const { listHeight, diff, scrollY: scrollY2 } = state.current;
3773
- let fixedTop = diff > 0 && diff < titleHeight ? diff - titleHeight : 0;
3774
- if (scrollY2 + clientHeight2() === listHeight[listHeight.length - 1]) {
3775
- if (fixedTop !== 0) {
3776
- fixedTop = 0;
3777
- }
3778
- }
3779
- if (state.current.fixedTop === fixedTop)
3780
- return;
3781
- state.current.fixedTop = fixedTop;
3782
- }, [state.current.diff, titleHeight]);
3783
- return /* @__PURE__ */ React.createElement("div", { className: `${b2()} ${className} `, ...rest }, isSticky && scrollY > 0 ? /* @__PURE__ */ React.createElement("div", { className: b2("list__fixed") }, /* @__PURE__ */ React.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey])) : null, /* @__PURE__ */ React.createElement(
3764
+ return /* @__PURE__ */ React.createElement("div", { className: `${b2()} ${className} `, ...rest }, isSticky && scrollTop > 0 ? /* @__PURE__ */ React.createElement("div", { className: b2("list__fixed") }, /* @__PURE__ */ React.createElement("span", { className: "fixed-title" }, indexList[currentIndex][acceptKey])) : null, /* @__PURE__ */ React.createElement(
3784
3765
  "div",
3785
3766
  {
3786
3767
  className: b2("list"),
@@ -6725,6 +6706,19 @@ var __publicField = (obj, key, value) => {
6725
6706
  isHorizontal
6726
6707
  };
6727
6708
  }
6709
+ let passiveSupported = false;
6710
+ if (canUseDom) {
6711
+ try {
6712
+ const opts = Object.defineProperty({}, "passive", {
6713
+ get() {
6714
+ passiveSupported = true;
6715
+ }
6716
+ });
6717
+ window.addEventListener("test-passive-supported", null, opts);
6718
+ } catch (e) {
6719
+ console.log(e);
6720
+ }
6721
+ }
6728
6722
  const InternalPickerSlot = (props, ref) => {
6729
6723
  const {
6730
6724
  keyIndex = 0,
@@ -6861,7 +6855,7 @@ var __publicField = (obj, key, value) => {
6861
6855
  setChooseValue(scrollDistance);
6862
6856
  };
6863
6857
  const preventDefault2 = (event, isStopPropagation) => {
6864
- if (typeof event.cancelable !== "boolean" || event.cancelable) {
6858
+ if (!passiveSupported && (typeof event.cancelable !== "boolean" || event.cancelable)) {
6865
6859
  event.preventDefault();
6866
6860
  }
6867
6861
  if (isStopPropagation) {
@@ -8150,7 +8144,7 @@ var __publicField = (obj, key, value) => {
8150
8144
  }
8151
8145
  },
8152
8146
  errorMessage
8153
- ) : null))
8147
+ ) : /* @__PURE__ */ React.createElement("div", null)))
8154
8148
  );
8155
8149
  });
8156
8150
  Input.defaultProps = defaultProps$X;
@@ -9307,7 +9301,7 @@ var __publicField = (obj, key, value) => {
9307
9301
  "aria-valuemin": +min,
9308
9302
  "aria-valuenow": curValue(index),
9309
9303
  "aria-valuemax": +max,
9310
- "aria-orientation": "horizontal",
9304
+ "aria-orientation": vertical ? "vertical" : "horizontal",
9311
9305
  onTouchStart: (e) => {
9312
9306
  if (typeof index === "number") {
9313
9307
  SetButtonIndex(index);
@@ -9338,7 +9332,7 @@ var __publicField = (obj, key, value) => {
9338
9332
  "aria-valuemin": +min,
9339
9333
  "aria-valuenow": curValue(),
9340
9334
  "aria-valuemax": +max,
9341
- "aria-orientation": "horizontal",
9335
+ "aria-orientation": vertical ? "vertical" : "horizontal",
9342
9336
  onTouchStart: (e) => {
9343
9337
  onTouchStart(e);
9344
9338
  },
@@ -16018,19 +16012,6 @@ This message will only show in development mode. It won't appear in production.
16018
16012
  return position;
16019
16013
  }
16020
16014
  const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time));
16021
- let passiveSupported = false;
16022
- if (canUseDom) {
16023
- try {
16024
- const opts = Object.defineProperty({}, "passive", {
16025
- get() {
16026
- passiveSupported = true;
16027
- }
16028
- });
16029
- window.addEventListener("test-passive-supported", null, opts);
16030
- } catch (e) {
16031
- console.log(e);
16032
- }
16033
- }
16034
16015
  const defaultProps$D = {
16035
16016
  pullingText: "",
16036
16017
  canReleaseText: "",
package/dist/style.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.4.12 Wed Mar 22 2023 16:08:26 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.4.13 Wed Mar 29 2023 16:05:37 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",