@nutui/nutui-react 1.1.4-beta.2 → 1.1.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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## v1.1.4
2
+ `2022-05-23`
3
+
4
+ * :zap: feat(upload): upload 组件上传失败时希望可以自定义是否显示图片(#114 ) @junjun666
5
+ * :zap: feat(tabbar): tabbar 组件支持路由跳转,文档更新(#123 ) @allan2coder
6
+ * :zap: feat(circleprogress): circleprogress 组件 strokeInnerWidth 属性重命名为 strokeWidth,移除 isAuto、progressOption 属性(#121 ) @junjun666
7
+ * :zap: feat(avatar): avatar 组件 src 属性重命名为 url,增加 avatargroup 子组件(#121 ) @junjun666
8
+ * :zap: feat(skeleton): skeleton 组件 width、height 属性的类型修改为 string(#121 ) @junjun666
9
+ * :bug: fix(dialog): 修复 swiper 组件在 Next.js 环境下提示 window not defined 问题 @oasis-cloud
10
+ * :bug: fix(backtop): 修复 backtop 组件在 Next.js 环境下提示 document not defined 的问题 @oasis-cloud
11
+ * :zap: feat: NutUI-React 官网增加 issue 入口,以及组件文档更新。
12
+
1
13
  ## v1.1.3
2
14
  `2022-04-18`
3
15
 
@@ -7,12 +7,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
 
8
8
  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; }
9
9
 
10
- import React__default, { createContext, useState, useRef, useContext, useEffect } from 'react';
10
+ import React__default, { useState, useRef, useContext, useEffect } from 'react';
11
+ import { A as AvatarContext } from './AvatarContext-7153ad2b.js';
11
12
  import { c as cn } from './bem-893ad28d.js';
12
13
  import classNames from 'classnames';
13
14
  import Icon from './Icon.js';
14
15
  import '@bem-react/classname';
15
- var AvatarContext = createContext({});
16
16
  var defaultProps = {
17
17
  size: '',
18
18
  icon: '',
@@ -0,0 +1,3 @@
1
+ import { createContext } from 'react';
2
+ var AvatarContext = createContext({});
3
+ export { AvatarContext as A };
@@ -0,0 +1,2 @@
1
+
2
+ require('../../../packages/avatargroup/avatargroup.scss')
@@ -0,0 +1,50 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ 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; }
4
+
5
+ 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; }
6
+
7
+ import React__default, { useRef } from 'react';
8
+ import { A as AvatarContext } from './AvatarContext-7153ad2b.js';
9
+ import { c as cn } from './bem-893ad28d.js';
10
+ import classNames from 'classnames';
11
+ import { useConfig } from './ConfigProvider.js';
12
+ import '@bem-react/classname';
13
+ var defaultProps = {
14
+ maxContent: '',
15
+ maxCount: '',
16
+ maxBgColor: '#eee',
17
+ maxColor: '#666',
18
+ size: '',
19
+ shape: '',
20
+ span: '-8',
21
+ zIndex: 'left'
22
+ };
23
+
24
+ var AvatarGroup = function AvatarGroup(props) {
25
+ useConfig();
26
+
27
+ var propAvatarGroup = _objectSpread(_objectSpread({}, defaultProps), props);
28
+
29
+ var className = propAvatarGroup.className,
30
+ style = propAvatarGroup.style,
31
+ children = propAvatarGroup.children;
32
+ var avatarGroupRef = useRef(null);
33
+ var b = cn('avatar-group');
34
+ var cls = classNames(b(''), className);
35
+ var parentAvatar = {
36
+ propAvatarGroup: propAvatarGroup,
37
+ avatarGroupRef: avatarGroupRef
38
+ };
39
+ return React__default.createElement(AvatarContext.Provider, {
40
+ value: parentAvatar
41
+ }, React__default.createElement("div", {
42
+ className: cls,
43
+ style: style,
44
+ ref: avatarGroupRef
45
+ }, children));
46
+ };
47
+
48
+ AvatarGroup.defaultProps = defaultProps;
49
+ AvatarGroup.displayName = 'NutAvatarGroup';
50
+ export { AvatarGroup as default };
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
 
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
 
8
- import React__default, { useState, useEffect } from 'react';
8
+ import React__default, { useState, useRef, useEffect } from 'react';
9
9
  import Icon from './Icon.js';
10
10
  var defaultProps = {
11
11
  bottom: 20,
@@ -42,7 +42,7 @@ var BackTop = function BackTop(props) {
42
42
  SetScrollTop = _useState4[1];
43
43
 
44
44
  var startTime = 0;
45
- var scrollEl = elId ? document.getElementById(elId) : window; // 初始化
45
+ var scrollEl = useRef(null); // 初始化
46
46
 
47
47
  useEffect(function () {
48
48
  init();
@@ -53,7 +53,7 @@ var BackTop = function BackTop(props) {
53
53
 
54
54
  var init = function init() {
55
55
  if (elId && document.getElementById(elId)) {
56
- scrollEl = document.getElementById(elId);
56
+ scrollEl.current = document.getElementById(elId);
57
57
  }
58
58
 
59
59
  addEventListener();
@@ -63,11 +63,11 @@ var BackTop = function BackTop(props) {
63
63
  var scrollListener = function scrollListener() {
64
64
  var top = null;
65
65
 
66
- if (scrollEl instanceof Window) {
67
- top = scrollEl.pageYOffset;
66
+ if (scrollEl.current instanceof Window) {
67
+ top = scrollEl.current.pageYOffset;
68
68
  SetScrollTop(top);
69
69
  } else {
70
- top = scrollEl.scrollTop;
70
+ top = scrollEl.current.scrollTop;
71
71
  SetScrollTop(top);
72
72
  }
73
73
 
@@ -78,10 +78,10 @@ var BackTop = function BackTop(props) {
78
78
  var scroll = function scroll() {
79
79
  var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
80
80
 
81
- if (scrollEl instanceof Window) {
81
+ if (scrollEl.current instanceof Window) {
82
82
  window.scrollTo(0, y);
83
83
  } else {
84
- scrollEl.scrollTop = y;
84
+ scrollEl.current.scrollTop = y;
85
85
  }
86
86
  };
87
87
 
@@ -111,14 +111,18 @@ var BackTop = function BackTop(props) {
111
111
 
112
112
 
113
113
  function addEventListener() {
114
- scrollEl.addEventListener('scroll', scrollListener, false);
115
- scrollEl.addEventListener('resize', scrollListener, false);
114
+ var _scrollEl$current, _scrollEl$current2;
115
+
116
+ (_scrollEl$current = scrollEl.current) === null || _scrollEl$current === void 0 ? void 0 : _scrollEl$current.addEventListener('scroll', scrollListener, false);
117
+ (_scrollEl$current2 = scrollEl.current) === null || _scrollEl$current2 === void 0 ? void 0 : _scrollEl$current2.addEventListener('resize', scrollListener, false);
116
118
  } // 移除监听事件
117
119
 
118
120
 
119
121
  function removeEventListener() {
120
- scrollEl.removeEventListener('scroll', scrollListener, false);
121
- scrollEl.removeEventListener('resize', scrollListener, false);
122
+ var _scrollEl$current3, _scrollEl$current4;
123
+
124
+ (_scrollEl$current3 = scrollEl.current) === null || _scrollEl$current3 === void 0 ? void 0 : _scrollEl$current3.removeEventListener('scroll', scrollListener, false);
125
+ (_scrollEl$current4 = scrollEl.current) === null || _scrollEl$current4 === void 0 ? void 0 : _scrollEl$current4.removeEventListener('resize', scrollListener, false);
122
126
  } // 返回顶部点击事件
123
127
 
124
128
 
@@ -46,6 +46,7 @@ export { default as Step } from './Step.js';
46
46
  export { default as Swiper } from './Swiper.js';
47
47
  export { default as SwiperItem } from './SwiperItem.js';
48
48
  export { default as Avatar } from './Avatar.js';
49
+ export { default as AvatarGroup } from './AvatarGroup.js';
49
50
  export { default as Price } from './Price.js';
50
51
  export { default as Badge } from './Badge.js';
51
52
  export { default as Tag } from './Tag.js';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.1.4-beta.2 Fri May 20 2022 09:39:16 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v1.1.4 Tue May 24 2022 15:09:46 GMT+0800 (China Standard Time)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.1.4-beta.2 Fri May 20 2022 09:39:16 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v1.1.4 Tue May 24 2022 15:09:46 GMT+0800 (China Standard Time)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.1.4-beta.2 Fri May 20 2022 09:39:16 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v1.1.4 Tue May 24 2022 15:09:46 GMT+0800 (China Standard Time)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v1.1.4-beta.2 Fri May 20 2022 09:39:16 GMT+0800 (China Standard Time)
2
+ * @nutui/nutui-react v1.1.4 Tue May 24 2022 15:09:46 GMT+0800 (China Standard Time)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */