@nutui/nutui-react-taro 1.5.8 → 1.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v1.5.9
2
+ `2023-06-13`
3
+
4
+
5
+ * :sparkles: feat: countdown 支持剩余时间 (#1120) @xiaoyatong
6
+ * :bug: fix: input 在 taro h5 下clearable 失效问题修复 (#1112) @xiaoyatong
7
+ * :bug: fix: menu 组件被使用 transform 的组件嵌套后,遮罩层发生偏移 (#1094) @oasis-cloud
8
+
9
+
1
10
  # v1.5.8
2
11
  `2023-06-07`
3
12
 
@@ -1,4 +1,4 @@
1
- import { C as CountDown } from './countdown.taro-5b17c607.js';
1
+ import { C as CountDown } from './countdown.taro-9d970dbe.js';
2
2
  import 'react';
3
3
  import './bem-350c1702.js';
4
4
  import '@bem-react/classname';
package/dist/esm/Input.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as Input } from './input.taro-77dcb8d9.js';
1
+ import { I as Input } from './input.taro-4c33409b.js';
2
2
  import 'react';
3
3
  import './icon.taro-296a1bec.js';
4
4
  import './bem-350c1702.js';
@@ -1,10 +1,8 @@
1
- import { M as MenuItem } from './menuitem.taro-96cc4f15.js';
1
+ import { M as MenuItem } from './menuitem.taro-fed68a19.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import 'react-transition-group';
5
- import './configprovider.taro-8d71eb49.js';
6
- import 'lodash.kebabcase';
7
- import './zh-CN-c779e6c1.js';
5
+ import '@tarojs/taro';
8
6
  import './icon.taro-296a1bec.js';
9
7
  import './bem-350c1702.js';
10
8
  import '@bem-react/classname';
@@ -6,6 +6,7 @@ const defaultProps = {
6
6
  paused: false,
7
7
  startTime: Date.now(),
8
8
  endTime: Date.now(),
9
+ remainingTime: 0,
9
10
  millisecond: false,
10
11
  format: 'HH:mm:ss',
11
12
  autoStart: true,
@@ -14,7 +15,7 @@ const defaultProps = {
14
15
  };
15
16
  const InternalCountDown = (props, ref) => {
16
17
  useConfig();
17
- const { paused, startTime, endTime, millisecond, format, autoStart, time, destroy, className, style, onEnd, onPaused, onRestart, onUpdate, children, ...rest } = { ...defaultProps, ...props };
18
+ const { paused, startTime, endTime, remainingTime, millisecond, format, autoStart, time, destroy, className, style, onEnd, onPaused, onRestart, onUpdate, children, ...rest } = { ...defaultProps, ...props };
18
19
  const b = cn('countdown');
19
20
  const [restTimeStamp, setRestTime] = useState(0);
20
21
  const stateRef = useRef({
@@ -38,8 +39,13 @@ const InternalCountDown = (props, ref) => {
38
39
  };
39
40
  // 倒计时 interval
40
41
  const initTime = () => {
41
- stateRef.current.handleEndTime = endTime;
42
- stateRef.current.diffTime = Date.now() - getTimeStamp(startTime); // 时间差
42
+ if (remainingTime) {
43
+ stateRef.current.handleEndTime = Date.now() + Number(remainingTime);
44
+ }
45
+ else {
46
+ stateRef.current.handleEndTime = endTime;
47
+ stateRef.current.diffTime = Date.now() - getTimeStamp(startTime); // 时间差
48
+ }
43
49
  if (!stateRef.current.counting)
44
50
  stateRef.current.counting = true;
45
51
  tick();
@@ -192,7 +198,7 @@ const InternalCountDown = (props, ref) => {
192
198
  if (stateRef.current.isIninted) {
193
199
  initTime();
194
200
  }
195
- }, [endTime, startTime]);
201
+ }, [endTime, startTime, remainingTime]);
196
202
  // 初始化
197
203
  useEffect(() => {
198
204
  if (autoStart) {
@@ -147,7 +147,9 @@ const Input = forwardRef((props, ref) => {
147
147
  onChange && onChange(val, event);
148
148
  };
149
149
  const handleBlur = (event) => {
150
- SetActive(false);
150
+ setTimeout(() => {
151
+ SetActive(false);
152
+ }, 200);
151
153
  let val = event.target.value;
152
154
  if (maxlength && val.length > Number(maxlength)) {
153
155
  val = val.slice(0, Number(maxlength));
@@ -1,7 +1,7 @@
1
1
  import React__default, { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { CSSTransition } from 'react-transition-group';
4
- import { u as useConfig } from './configprovider.taro-8d71eb49.js';
4
+ import { getSystemInfoSync } from '@tarojs/taro';
5
5
  import { I as Icon } from './icon.taro-296a1bec.js';
6
6
  import { O as Overlay } from './overlay.taro-21e87fb1.js';
7
7
  import { C as ComponentDefaults } from './typings-b9828dba.js';
@@ -20,7 +20,6 @@ const defaultProps = {
20
20
  onChange: (value) => undefined,
21
21
  };
22
22
  const MenuItem = forwardRef((props, ref) => {
23
- useConfig();
24
23
  const mergedProps = { ...defaultProps, ...props };
25
24
  const { style, options, value, columns, title, optionsIcon, direction, onChange, activeTitleClass, inactiveTitleClass, children, iconClassPrefix, iconFontClassName, } = {
26
25
  ...defaultProps,
@@ -76,25 +75,31 @@ const MenuItem = forwardRef((props, ref) => {
76
75
  };
77
76
  const getPosition = () => {
78
77
  return direction === 'down'
79
- ? { top: `${position.top + position.height}px` }
80
- : { bottom: `${window.innerHeight - position.top}px`, top: 'auto' };
78
+ ? { position: 'absolute', height: `${window.innerHeight}px` }
79
+ : {
80
+ position: 'absolute',
81
+ bottom: '100%',
82
+ top: 'auto',
83
+ height: `${window.innerHeight}px`,
84
+ };
81
85
  };
82
86
  const placeholderStyle = () => {
83
87
  if (direction === 'down') {
84
88
  return {
85
89
  height: `${position.top + position.height}px`,
90
+ top: 'auto',
91
+ bottom: '-100%',
86
92
  ...isShow(),
87
- ...style,
88
93
  };
89
94
  }
90
95
  return {
91
- height: `${window.innerHeight - position.top}px`,
92
- top: 'auto',
96
+ height: `${getSystemInfoSync().windowHeight - position.top}px`,
97
+ bottom: `auto`,
98
+ top: '0',
93
99
  ...isShow(),
94
- ...style,
95
100
  };
96
101
  };
97
- return (React__default.createElement(React__default.Fragment, null,
102
+ return (React__default.createElement("div", { className: "nut-menu-item-container", style: { position: 'absolute', left: 0, right: 0 } },
98
103
  React__default.createElement("div", { className: `placeholder-element ${classNames({
99
104
  up: direction === 'up',
100
105
  })}`, style: placeholderStyle(), onClick: () => parent.toggleItemShow(orderKey) }),
@@ -17,7 +17,7 @@ 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';
20
- export { M as MenuItem } from './menuitem.taro-96cc4f15.js';
20
+ export { M as MenuItem } from './menuitem.taro-fed68a19.js';
21
21
  export { N as NavBar } from './navbar.taro-777c4705.js';
22
22
  export { P as Pagination } from './pagination.taro-715a173b.js';
23
23
  export { S as SideNavBar } from './sidenavbar.taro-c307b35e.js';
@@ -34,7 +34,7 @@ export { C as Checkbox, a as CheckboxGroup } from './checkbox.taro-6120e3e3.js';
34
34
  export { D as DatePicker } from './datepicker.taro-94aca24a.js';
35
35
  export { F as Form } from './form.taro-0b399b30.js';
36
36
  export { F as FormItem } from './formitem.taro-190a3326.js';
37
- export { I as Input } from './input.taro-77dcb8d9.js';
37
+ export { I as Input } from './input.taro-4c33409b.js';
38
38
  export { I as InputNumber } from './inputnumber.taro-91f65d17.js';
39
39
  export { N as NumberKeyboard } from './numberkeyboard.taro-1bc24744.js';
40
40
  export { P as Picker } from './picker.taro-6bb0a2a4.js';
@@ -64,7 +64,7 @@ export { B as Badge } from './badge.taro-a4e59c11.js';
64
64
  export { C as CircleProgress } from './circleprogress.taro-79854448.js';
65
65
  export { C as Collapse } from './collapse.taro-1a9e4ba2.js';
66
66
  export { C as CollapseItem } from './collapseitem-4d0bc55d.js';
67
- export { C as CountDown } from './countdown.taro-5b17c607.js';
67
+ export { C as CountDown } from './countdown.taro-9d970dbe.js';
68
68
  export { E as Ellipsis } from './ellipsis.taro-f15f26da.js';
69
69
  export { E as Empty } from './empty.taro-04ae4389.js';
70
70
  export { I as ImagePreview } from './imagepreview.taro-c50bb0a3.js';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react-taro v1.5.8 Wed Jun 07 2023 14:45:25 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.5.9 Tue Jun 13 2023 15:54:08 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.5.8 Wed Jun 07 2023 14:45:25 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.5.9 Tue Jun 13 2023 15:54:08 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.5.8 Wed Jun 07 2023 14:45:25 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.5.9 Tue Jun 13 2023 15:54:08 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.5.8 Wed Jun 07 2023 14:45:25 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.5.9 Tue Jun 13 2023 15:54:08 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.5.8 Wed Jun 07 2023 14:45:25 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.5.9 Tue Jun 13 2023 15:54:08 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.5.8 Wed Jun 07 2023 14:45:25 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react-taro v1.5.9 Tue Jun 13 2023 15:54:08 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */