@nutui/nutui-react 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,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["paused", "startTime", "endTime", "millisecond", "format", "autoStart", "time", "destroy", "className", "style", "onEnd", "onPaused", "onRestart", "onUpdate", "children"];
4
+ var _excluded = ["paused", "startTime", "endTime", "remainingTime", "millisecond", "format", "autoStart", "time", "destroy", "className", "style", "onEnd", "onPaused", "onRestart", "onUpdate", "children"];
5
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
  import React__default, { useState, useRef, useImperativeHandle, useEffect } from 'react';
@@ -12,6 +12,7 @@ var defaultProps = {
12
12
  paused: false,
13
13
  startTime: Date.now(),
14
14
  endTime: Date.now(),
15
+ remainingTime: 0,
15
16
  millisecond: false,
16
17
  format: 'HH:mm:ss',
17
18
  autoStart: true,
@@ -24,6 +25,7 @@ var InternalCountDown = function InternalCountDown(props, ref) {
24
25
  paused = _defaultProps$props.paused,
25
26
  startTime = _defaultProps$props.startTime,
26
27
  endTime = _defaultProps$props.endTime,
28
+ remainingTime = _defaultProps$props.remainingTime,
27
29
  millisecond = _defaultProps$props.millisecond,
28
30
  format = _defaultProps$props.format,
29
31
  autoStart = _defaultProps$props.autoStart,
@@ -62,8 +64,13 @@ var InternalCountDown = function InternalCountDown(props, ref) {
62
64
  };
63
65
  // 倒计时 interval
64
66
  var initTime = function initTime() {
65
- stateRef.current.handleEndTime = endTime;
66
- stateRef.current.diffTime = Date.now() - getTimeStamp(startTime); // 时间差
67
+ if (remainingTime) {
68
+ stateRef.current.handleEndTime = Date.now() + Number(remainingTime);
69
+ } else {
70
+ stateRef.current.handleEndTime = endTime;
71
+ stateRef.current.diffTime = Date.now() - getTimeStamp(startTime); // 时间差
72
+ }
73
+
67
74
  if (!stateRef.current.counting) stateRef.current.counting = true;
68
75
  tick();
69
76
  };
@@ -212,7 +219,7 @@ var InternalCountDown = function InternalCountDown(props, ref) {
212
219
  if (stateRef.current.isIninted) {
213
220
  initTime();
214
221
  }
215
- }, [endTime, startTime]);
222
+ }, [endTime, startTime, remainingTime]);
216
223
  // 初始化
217
224
  useEffect(function () {
218
225
  if (autoStart) {
package/dist/esm/Form.js CHANGED
@@ -19,14 +19,16 @@ import './Cell.js';
19
19
  /**
20
20
  * 用于存储表单的数据
21
21
  */
22
- var FormStore = /*#__PURE__*/_createClass(function FormStore() {
22
+ var FormStore = /*#__PURE__*/_createClass(
23
+ // 存放表单中所有的数据 eg. {password: "ddd",username: "123"}
24
+ // 所有的组件实例
25
+ // 成功和失败的回调
26
+
27
+ function FormStore() {
23
28
  var _this = this;
24
29
  _classCallCheck(this, FormStore);
25
30
  _defineProperty(this, "store", {});
26
- // 存放表单中所有的数据 eg. {password: "ddd",username: "123"}
27
31
  _defineProperty(this, "fieldEntities", []);
28
- // 所有的组件实例
29
- // 成功和失败的回调
30
32
  _defineProperty(this, "callbacks", {});
31
33
  _defineProperty(this, "errList", []);
32
34
  /**
@@ -103,24 +103,37 @@ var MenuItem = forwardRef(function (props, ref) {
103
103
  };
104
104
  var getPosition = function getPosition() {
105
105
  return direction === 'down' ? {
106
- top: "".concat(position.top + position.height, "px")
106
+ position: 'absolute',
107
+ height: "".concat(window.innerHeight, "px")
107
108
  } : {
108
- bottom: "".concat(window.innerHeight - position.top, "px"),
109
- top: 'auto'
109
+ position: 'absolute',
110
+ bottom: '100%',
111
+ top: 'auto',
112
+ height: "".concat(window.innerHeight, "px")
110
113
  };
111
114
  };
112
115
  var placeholderStyle = function placeholderStyle() {
113
116
  if (direction === 'down') {
114
117
  return _objectSpread(_objectSpread({
115
- height: "".concat(position.top + position.height, "px")
118
+ height: "".concat(position.top + position.height, "px"),
119
+ top: 'auto',
120
+ bottom: '-100%'
116
121
  }, isShow()), style);
117
122
  }
118
123
  return _objectSpread(_objectSpread({
119
124
  height: "".concat(window.innerHeight - position.top, "px"),
120
- top: 'auto'
125
+ bottom: "auto",
126
+ top: '0'
121
127
  }, isShow()), style);
122
128
  };
123
- return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
129
+ return React__default.createElement("div", {
130
+ className: "nut-menu-item-container",
131
+ style: {
132
+ position: 'absolute',
133
+ left: 0,
134
+ right: 0
135
+ }
136
+ }, React__default.createElement("div", {
124
137
  className: "placeholder-element ".concat(classNames({
125
138
  up: direction === 'up'
126
139
  })),
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.5.8 Wed Jun 07 2023 14:43:04 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.5.9 Tue Jun 13 2023 15:52:38 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 v1.5.8 Wed Jun 07 2023 14:43:04 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.5.9 Tue Jun 13 2023 15:52:38 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 v1.5.8 Wed Jun 07 2023 14:43:04 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.5.9 Tue Jun 13 2023 15:52:38 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 v1.5.8 Wed Jun 07 2023 14:43:04 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.5.9 Tue Jun 13 2023 15:52:38 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 v1.5.8 Wed Jun 07 2023 14:43:04 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.5.9 Tue Jun 13 2023 15:52:38 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 v1.5.8 Wed Jun 07 2023 14:43:04 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v1.5.9 Tue Jun 13 2023 15:52:38 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */