@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 +9 -0
- package/dist/esm/CountDown.js +11 -4
- package/dist/esm/Form.js +6 -4
- package/dist/esm/MenuItem.js +19 -6
- 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 +201 -151
- package/dist/nutui.react.umd.js +201 -151
- package/dist/packages/menuitem/menuitem.scss +1 -1
- package/dist/style.css +1 -1
- package/dist/style.mjs +1 -1
- package/dist/styles/variables.scss +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
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
|
|
package/dist/esm/CountDown.js
CHANGED
|
@@ -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
|
-
|
|
66
|
-
|
|
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(
|
|
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
|
/**
|
package/dist/esm/MenuItem.js
CHANGED
|
@@ -103,24 +103,37 @@ var MenuItem = forwardRef(function (props, ref) {
|
|
|
103
103
|
};
|
|
104
104
|
var getPosition = function getPosition() {
|
|
105
105
|
return direction === 'down' ? {
|
|
106
|
-
|
|
106
|
+
position: 'absolute',
|
|
107
|
+
height: "".concat(window.innerHeight, "px")
|
|
107
108
|
} : {
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
125
|
+
bottom: "auto",
|
|
126
|
+
top: '0'
|
|
121
127
|
}, isShow()), style);
|
|
122
128
|
};
|
|
123
|
-
return React__default.createElement(
|
|
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
|
})),
|
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