@nutui/nutui-react 1.1.4-beta.0 → 1.1.4-beta.3
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/dist/esm/Avatar/style/index.js +1 -1
- package/dist/esm/Avatar.js +97 -20
- package/dist/esm/AvatarContext-7153ad2b.js +3 -0
- package/dist/esm/AvatarGroup/style/index.js +2 -0
- package/dist/esm/AvatarGroup.js +50 -0
- package/dist/esm/Barrage.js +0 -1
- package/dist/esm/CircleProgress.js +93 -56
- package/dist/esm/Skeleton.js +20 -12
- package/dist/esm/Step.js +14 -3
- package/dist/esm/Steps.js +4 -1
- package/dist/esm/Swiper.js +2 -1
- package/dist/esm/TabbarItem.js +9 -0
- package/dist/esm/Uploader/style/index.js +2 -1
- package/dist/esm/Uploader.js +84 -18
- package/dist/esm/nutui-react.es.js +1 -0
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/nutui.react.es.js +459 -239
- package/dist/nutui.react.umd.js +12 -12
- package/dist/packages/avatar/avatar.scss +16 -6
- package/dist/packages/avatargroup/avatargroup.scss +14 -0
- package/dist/packages/circleprogress/circleprogress.scss +12 -53
- package/dist/packages/configprovider/configprovider.scss +0 -2
- package/dist/packages/skeleton/skeleton.scss +1 -3
- package/dist/packages/step/step.scss +29 -29
- package/dist/packages/uploader/uploader.scss +97 -14
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +1 -0
- package/dist/styles/variables.scss +36 -4
- package/dist/types/avatar/__tests__/avatar.spec.d.ts +1 -0
- package/dist/types/avatar/avatar.d.ts +6 -3
- package/dist/types/avatargroup/AvatarContext.d.ts +2 -0
- package/dist/types/avatargroup/__tests__/avatargroup.spec.d.ts +1 -0
- package/dist/types/avatargroup/avatargroup.d.ts +14 -0
- package/dist/types/avatargroup/index.d.ts +2 -0
- package/dist/types/barrage/__tests__/barrage.spec.d.ts +1 -0
- package/dist/types/button/button.d.ts +2 -2
- package/dist/types/checkbox/__test__/checkbox.spec.d.ts +1 -0
- package/dist/types/circleprogress/__tests__/circleprogress.spec.d.ts +1 -0
- package/dist/types/circleprogress/circleprogress.d.ts +11 -5
- package/dist/types/icon/__test__/icon.spec.d.ts +1 -0
- package/dist/types/infiniteloading/__tests__/infiniteloading.spec.d.ts +1 -0
- package/dist/types/inputnumber/__tests__/inputnumber.spec.d.ts +1 -0
- package/dist/types/nutui.react.d.ts +2 -1
- package/dist/types/overlay/__tests__/overlay.spec.d.ts +1 -0
- package/dist/types/skeleton/__test__/skeleton.spec.d.ts +1 -0
- package/dist/types/skeleton/skeleton.d.ts +2 -2
- package/dist/types/step/step.d.ts +1 -0
- package/dist/types/steps/__tests__/steps.spec.d.ts +1 -0
- package/dist/types/steps/steps.d.ts +1 -0
- package/dist/types/tabbaritem/tabbaritem.d.ts +1 -0
- package/dist/types/uploader/__tests__/uploader.spec.d.ts +1 -0
- package/dist/types/uploader/uploader.d.ts +9 -1
- package/package.json +6 -3
- package/dist/styles/variables-jdw.scss +0 -376
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../AvatarGroup/style')
|
|
2
2
|
require('../../../packages/avatar/avatar.scss')
|
package/dist/esm/Avatar.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "prefixCls", "size", "shape", "bgColor", "
|
|
4
|
+
var _excluded = ["children", "prefixCls", "size", "shape", "bgColor", "color", "url", "alt", "icon", "className", "style", "activeAvatar", "onError"];
|
|
4
5
|
|
|
5
6
|
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
7
|
|
|
7
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; }
|
|
8
9
|
|
|
9
|
-
import React__default from 'react';
|
|
10
|
+
import React__default, { useState, useRef, useContext, useEffect } from 'react';
|
|
11
|
+
import { A as AvatarContext } from './AvatarContext-7153ad2b.js';
|
|
12
|
+
import { c as cn } from './bem-893ad28d.js';
|
|
10
13
|
import classNames from 'classnames';
|
|
11
14
|
import Icon from './Icon.js';
|
|
15
|
+
import '@bem-react/classname';
|
|
12
16
|
var defaultProps = {
|
|
13
|
-
size: '
|
|
17
|
+
size: '',
|
|
14
18
|
icon: '',
|
|
15
|
-
shape: 'round',
|
|
16
19
|
bgColor: '#eee',
|
|
20
|
+
color: '#666',
|
|
17
21
|
prefixCls: 'nut-avatar',
|
|
18
|
-
|
|
22
|
+
url: '',
|
|
23
|
+
alt: ''
|
|
19
24
|
};
|
|
20
25
|
|
|
21
26
|
var Avatar = function Avatar(props) {
|
|
22
|
-
var _classNames;
|
|
27
|
+
var _parent$propAvatarGro, _parent$propAvatarGro2, _classNames, _parent$propAvatarGro3, _parent$propAvatarGro4, _parent$propAvatarGro5, _parent$propAvatarGro6, _parent$propAvatarGro7, _parent$propAvatarGro9, _parent$propAvatarGro10, _parent$propAvatarGro11, _parent$propAvatarGro12, _parent$propAvatarGro13, _parent$propAvatarGro14, _parent$propAvatarGro15;
|
|
23
28
|
|
|
24
29
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
25
30
|
children = _defaultProps$props.children,
|
|
@@ -27,42 +32,114 @@ var Avatar = function Avatar(props) {
|
|
|
27
32
|
size = _defaultProps$props.size,
|
|
28
33
|
shape = _defaultProps$props.shape,
|
|
29
34
|
bgColor = _defaultProps$props.bgColor,
|
|
30
|
-
|
|
35
|
+
color = _defaultProps$props.color,
|
|
36
|
+
url = _defaultProps$props.url,
|
|
37
|
+
alt = _defaultProps$props.alt,
|
|
31
38
|
icon = _defaultProps$props.icon,
|
|
32
39
|
className = _defaultProps$props.className,
|
|
33
40
|
style = _defaultProps$props.style,
|
|
41
|
+
activeAvatar = _defaultProps$props.activeAvatar,
|
|
42
|
+
onError = _defaultProps$props.onError,
|
|
34
43
|
rest = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
35
44
|
|
|
45
|
+
var _useState = useState(0),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
maxSum = _useState2[0],
|
|
48
|
+
setMaxSum = _useState2[1]; // avatarGroup里的avatar的个数
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var _useState3 = useState(false),
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
showMax = _useState4[0],
|
|
54
|
+
setShowMax = _useState4[1]; // 是否显示的最大头像个数
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
var _useState5 = useState(1),
|
|
58
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
+
avatarIndex = _useState6[0],
|
|
60
|
+
setAvatarIndex = _useState6[1]; // avatar的索引
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
var avatarRef = useRef(null);
|
|
64
|
+
var parent = useContext(AvatarContext);
|
|
65
|
+
var b = cn('avatar');
|
|
66
|
+
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "nut-avatar-".concat(size || (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro = parent.propAvatarGroup) === null || _parent$propAvatarGro === void 0 ? void 0 : _parent$propAvatarGro.size) || 'normal'), true), _defineProperty(_classNames, "nut-avatar-".concat(shape || (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro2 = parent.propAvatarGroup) === null || _parent$propAvatarGro2 === void 0 ? void 0 : _parent$propAvatarGro2.shape) || 'round'), true), _classNames));
|
|
67
|
+
var cls = classNames(b(''), classes, className);
|
|
36
68
|
var sizeValue = ['large', 'normal', 'small'];
|
|
37
|
-
var classes = classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls), true), _defineProperty(_classNames, "avatar-".concat(size), true), _defineProperty(_classNames, "avatar-".concat(shape), true), _classNames));
|
|
38
|
-
var cls = classNames(classes, className);
|
|
39
69
|
|
|
40
70
|
var styles = _objectSpread({
|
|
41
71
|
width: sizeValue.indexOf(size) > -1 ? '' : "".concat(size, "px"),
|
|
42
72
|
height: sizeValue.indexOf(size) > -1 ? '' : "".concat(size, "px"),
|
|
43
|
-
|
|
44
|
-
|
|
73
|
+
backgroundColor: "".concat(bgColor),
|
|
74
|
+
color: "".concat(color),
|
|
75
|
+
marginLeft: avatarIndex != 1 && parent !== null && parent !== void 0 && (_parent$propAvatarGro3 = parent.propAvatarGroup) !== null && _parent$propAvatarGro3 !== void 0 && _parent$propAvatarGro3.span ? "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro4 = parent.propAvatarGroup) === null || _parent$propAvatarGro4 === void 0 ? void 0 : _parent$propAvatarGro4.span, "px") : '',
|
|
76
|
+
zIndex: (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro5 = parent.propAvatarGroup) === null || _parent$propAvatarGro5 === void 0 ? void 0 : _parent$propAvatarGro5.zIndex) == 'right' ? "".concat(Math.abs(maxSum - avatarIndex)) : ''
|
|
45
77
|
}, style);
|
|
46
78
|
|
|
47
|
-
var
|
|
79
|
+
var maxStyles = {
|
|
80
|
+
backgroundColor: "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro6 = parent.propAvatarGroup) === null || _parent$propAvatarGro6 === void 0 ? void 0 : _parent$propAvatarGro6.maxBgColor),
|
|
81
|
+
color: "".concat(parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro7 = parent.propAvatarGroup) === null || _parent$propAvatarGro7 === void 0 ? void 0 : _parent$propAvatarGro7.maxColor)
|
|
82
|
+
};
|
|
83
|
+
var iconStyles = !!icon ? icon : '';
|
|
84
|
+
useEffect(function () {
|
|
85
|
+
var _parent$avatarGroupRe;
|
|
86
|
+
|
|
87
|
+
var avatarChildren = parent === null || parent === void 0 ? void 0 : (_parent$avatarGroupRe = parent.avatarGroupRef) === null || _parent$avatarGroupRe === void 0 ? void 0 : _parent$avatarGroupRe.current.children;
|
|
88
|
+
|
|
89
|
+
if (avatarChildren) {
|
|
90
|
+
avatarLength(avatarChildren);
|
|
91
|
+
}
|
|
92
|
+
}, []);
|
|
93
|
+
|
|
94
|
+
var avatarLength = function avatarLength(children) {
|
|
95
|
+
var _avatarRef$current, _avatarRef$current$da, _parent$propAvatarGro8;
|
|
48
96
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
97
|
+
for (var i = 0; i < children.length; i++) {
|
|
98
|
+
if (children[i] && children[i].classList && children[i].classList[0] == 'nut-avatar') {
|
|
99
|
+
children[i].setAttribute('data-index', i + 1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
var index = avatarRef === null || avatarRef === void 0 ? void 0 : (_avatarRef$current = avatarRef.current) === null || _avatarRef$current === void 0 ? void 0 : (_avatarRef$current$da = _avatarRef$current.dataset) === null || _avatarRef$current$da === void 0 ? void 0 : _avatarRef$current$da.index;
|
|
104
|
+
var maxCount = parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro8 = parent.propAvatarGroup) === null || _parent$propAvatarGro8 === void 0 ? void 0 : _parent$propAvatarGro8.maxCount;
|
|
105
|
+
setMaxSum(children.length);
|
|
106
|
+
setAvatarIndex(index);
|
|
107
|
+
|
|
108
|
+
if (index == children.length && index != maxCount && children.length > maxCount) {
|
|
109
|
+
setShowMax(true);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var errorEvent = function errorEvent(e) {
|
|
114
|
+
if (props.onError) {
|
|
115
|
+
props.onError(e);
|
|
52
116
|
}
|
|
53
117
|
};
|
|
54
118
|
|
|
55
|
-
|
|
119
|
+
var clickAvatar = function clickAvatar(e) {
|
|
120
|
+
if (props.activeAvatar) {
|
|
121
|
+
props.activeAvatar(e);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
return React__default.createElement(React__default.Fragment, null, (showMax || !(parent !== null && parent !== void 0 && (_parent$propAvatarGro9 = parent.propAvatarGroup) !== null && _parent$propAvatarGro9 !== void 0 && _parent$propAvatarGro9.maxCount) || avatarIndex <= (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro10 = parent.propAvatarGroup) === null || _parent$propAvatarGro10 === void 0 ? void 0 : _parent$propAvatarGro10.maxCount)) && React__default.createElement("div", _objectSpread(_objectSpread({
|
|
56
126
|
className: cls
|
|
57
127
|
}, rest), {}, {
|
|
58
|
-
style: styles,
|
|
59
|
-
onClick:
|
|
60
|
-
|
|
128
|
+
style: !showMax ? styles : maxStyles,
|
|
129
|
+
onClick: clickAvatar,
|
|
130
|
+
ref: avatarRef
|
|
131
|
+
}), (!(parent !== null && parent !== void 0 && (_parent$propAvatarGro11 = parent.propAvatarGroup) !== null && _parent$propAvatarGro11 !== void 0 && _parent$propAvatarGro11.maxCount) || avatarIndex <= (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro12 = parent.propAvatarGroup) === null || _parent$propAvatarGro12 === void 0 ? void 0 : _parent$propAvatarGro12.maxCount)) && React__default.createElement(React__default.Fragment, null, url && React__default.createElement("img", {
|
|
132
|
+
src: url,
|
|
133
|
+
alt: alt,
|
|
134
|
+
onError: errorEvent
|
|
135
|
+
}), icon && React__default.createElement(Icon, {
|
|
61
136
|
className: "icon",
|
|
62
137
|
name: iconStyles
|
|
63
138
|
}), children && React__default.createElement("span", {
|
|
64
139
|
className: "text"
|
|
65
|
-
}, children))
|
|
140
|
+
}, children)), showMax && React__default.createElement("div", {
|
|
141
|
+
className: "text"
|
|
142
|
+
}, parent !== null && parent !== void 0 && (_parent$propAvatarGro13 = parent.propAvatarGroup) !== null && _parent$propAvatarGro13 !== void 0 && _parent$propAvatarGro13.maxContent ? parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro14 = parent.propAvatarGroup) === null || _parent$propAvatarGro14 === void 0 ? void 0 : _parent$propAvatarGro14.maxContent : "+ ".concat(avatarIndex - (parent === null || parent === void 0 ? void 0 : (_parent$propAvatarGro15 = parent.propAvatarGroup) === null || _parent$propAvatarGro15 === void 0 ? void 0 : _parent$propAvatarGro15.maxCount)))));
|
|
66
143
|
};
|
|
67
144
|
|
|
68
145
|
Avatar.defaultProps = defaultProps;
|
|
@@ -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 };
|
package/dist/esm/Barrage.js
CHANGED
|
@@ -74,7 +74,6 @@ var InternalBarrage = function InternalBarrage(props, ref) {
|
|
|
74
74
|
barrageContainer.current.appendChild(el);
|
|
75
75
|
var width = el.offsetWidth;
|
|
76
76
|
var height = el.offsetHeight;
|
|
77
|
-
console.log(el.offsetWidth, el.offsetHeight);
|
|
78
77
|
el.classList.add('move');
|
|
79
78
|
el.style.animationDuration = "".concat(speeds, "ms");
|
|
80
79
|
el.style.top = "".concat(_index % rows * (height + top) + 20, "px");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
|
|
3
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
|
+
var _excluded = ["children", "progress", "className", "radius", "pathColor", "clockwise", "circleColor", "strokeWidth", "style", "strokeLinecap"];
|
|
4
5
|
|
|
5
6
|
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
7
|
|
|
@@ -10,88 +11,124 @@ import React__default from 'react';
|
|
|
10
11
|
import classNames from 'classnames';
|
|
11
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
12
13
|
import '@bem-react/classname';
|
|
14
|
+
|
|
15
|
+
var isObject = function isObject(val) {
|
|
16
|
+
return val !== null && _typeof(val) === 'object';
|
|
17
|
+
};
|
|
18
|
+
|
|
13
19
|
var defaultProps = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
strokeWidth: 5,
|
|
21
|
+
radius: 50,
|
|
22
|
+
strokeLinecap: 'round',
|
|
23
|
+
circleColor: '',
|
|
24
|
+
pathColor: '',
|
|
25
|
+
clockwise: true
|
|
18
26
|
};
|
|
19
27
|
|
|
20
28
|
var CircleProgress = function CircleProgress(props) {
|
|
29
|
+
var _stop;
|
|
30
|
+
|
|
21
31
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
22
32
|
children = _defaultProps$props.children,
|
|
23
|
-
strokeInnerWidth = _defaultProps$props.strokeInnerWidth,
|
|
24
33
|
progress = _defaultProps$props.progress,
|
|
25
|
-
isAuto = _defaultProps$props.isAuto,
|
|
26
|
-
progressOption = _defaultProps$props.progressOption,
|
|
27
34
|
className = _defaultProps$props.className,
|
|
35
|
+
radius = _defaultProps$props.radius,
|
|
36
|
+
pathColor = _defaultProps$props.pathColor,
|
|
37
|
+
clockwise = _defaultProps$props.clockwise,
|
|
38
|
+
circleColor = _defaultProps$props.circleColor,
|
|
39
|
+
strokeWidth = _defaultProps$props.strokeWidth,
|
|
28
40
|
style = _defaultProps$props.style,
|
|
41
|
+
strokeLinecap = _defaultProps$props.strokeLinecap,
|
|
29
42
|
restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
|
|
30
43
|
|
|
31
44
|
var b = cn('circleprogress');
|
|
32
45
|
var classes = classNames(className, b(''));
|
|
46
|
+
var refRandomId = Math.random().toString(36).slice(-8);
|
|
47
|
+
|
|
48
|
+
var styles = _objectSpread({
|
|
49
|
+
height: "".concat(Number(radius) * 2, "px"),
|
|
50
|
+
width: "".concat(Number(radius) * 2, "px")
|
|
51
|
+
}, style);
|
|
52
|
+
|
|
53
|
+
var pathStyle = {
|
|
54
|
+
stroke: pathColor
|
|
55
|
+
};
|
|
33
56
|
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
progressColor: 'red',
|
|
41
|
-
cy: 1,
|
|
42
|
-
cx: 1,
|
|
43
|
-
size: 1,
|
|
44
|
-
startPosition: ''
|
|
57
|
+
var hoverStyle = function hoverStyle() {
|
|
58
|
+
var perimeter = 283;
|
|
59
|
+
var offset = perimeter * Number(progress) / 100;
|
|
60
|
+
return {
|
|
61
|
+
stroke: isObject(circleColor) ? "url(#".concat(refRandomId, ")") : circleColor,
|
|
62
|
+
strokeDasharray: "".concat(offset, "px ").concat(perimeter, "px")
|
|
45
63
|
};
|
|
46
|
-
|
|
64
|
+
};
|
|
47
65
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return baseOption;
|
|
66
|
+
var path = function path() {
|
|
67
|
+
var isWise = clockwise ? 1 : 0;
|
|
68
|
+
return "M 50 50 m -45 0 a 45 45 0 1 ".concat(isWise, " 90 0 a 45 45 0 1 ").concat(isWise, " -90 0");
|
|
52
69
|
};
|
|
53
70
|
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, style);
|
|
71
|
+
var hoverColor = function hoverColor() {
|
|
72
|
+
return isObject(circleColor) ? "url(#".concat(refRandomId, ")") : circleColor;
|
|
73
|
+
};
|
|
58
74
|
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
75
|
+
var stop = function stop() {
|
|
76
|
+
if (!isObject(circleColor)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var color = circleColor;
|
|
81
|
+
var colorArr = Object.keys(color).sort(function (a, b) {
|
|
82
|
+
return parseFloat(a) - parseFloat(b);
|
|
83
|
+
});
|
|
84
|
+
var stopArr = [];
|
|
85
|
+
colorArr.map(function (item) {
|
|
86
|
+
var obj = {
|
|
87
|
+
key: '',
|
|
88
|
+
value: ''
|
|
89
|
+
};
|
|
90
|
+
obj.key = item;
|
|
91
|
+
obj.value = color[item];
|
|
92
|
+
stopArr.push(obj);
|
|
93
|
+
});
|
|
94
|
+
return stopArr;
|
|
63
95
|
};
|
|
64
96
|
|
|
65
97
|
return React__default.createElement("div", _objectSpread({
|
|
66
98
|
className: classes,
|
|
67
99
|
style: styles
|
|
68
100
|
}, restProps), React__default.createElement("svg", {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
transform: option().startPosition,
|
|
101
|
+
viewBox: "0 0 100 100"
|
|
102
|
+
}, React__default.createElement("defs", null, React__default.createElement("linearGradient", {
|
|
103
|
+
id: refRandomId,
|
|
104
|
+
x1: "100%",
|
|
105
|
+
y1: "0%",
|
|
106
|
+
x2: "0%",
|
|
107
|
+
y2: "0%"
|
|
108
|
+
}, (_stop = stop()) === null || _stop === void 0 ? void 0 : _stop.map(function (item, index) {
|
|
109
|
+
return React__default.createElement("stop", {
|
|
110
|
+
key: index,
|
|
111
|
+
offset: item.key,
|
|
112
|
+
stopColor: item.value
|
|
113
|
+
});
|
|
114
|
+
}))), React__default.createElement("path", {
|
|
115
|
+
className: "nut-circleprogress-path",
|
|
116
|
+
style: pathStyle,
|
|
117
|
+
d: path(),
|
|
87
118
|
fill: "none",
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
119
|
+
strokeWidth: strokeWidth
|
|
120
|
+
}), React__default.createElement("path", {
|
|
121
|
+
className: "nut-circleprogress-hover",
|
|
122
|
+
style: hoverStyle(),
|
|
123
|
+
d: path(),
|
|
124
|
+
fill: "none",
|
|
125
|
+
stroke: hoverColor(),
|
|
126
|
+
strokeLinecap: strokeLinecap,
|
|
127
|
+
transform: "rotate(90,50,50)",
|
|
128
|
+
strokeWidth: strokeWidth
|
|
92
129
|
})), React__default.createElement("div", {
|
|
93
|
-
className: "nut-circleprogress-
|
|
94
|
-
},
|
|
130
|
+
className: "nut-circleprogress-text"
|
|
131
|
+
}, children ? children : React__default.createElement("div", null, progress, "%")));
|
|
95
132
|
};
|
|
96
133
|
|
|
97
134
|
CircleProgress.defaultProps = defaultProps;
|
package/dist/esm/Skeleton.js
CHANGED
|
@@ -12,8 +12,8 @@ import Avatar from './Avatar.js';
|
|
|
12
12
|
import { c as cn } from './bem-893ad28d.js';
|
|
13
13
|
import '@bem-react/classname';
|
|
14
14
|
var defaultProps = {
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
15
|
+
width: '100px',
|
|
16
|
+
height: '100px',
|
|
17
17
|
row: 1,
|
|
18
18
|
animated: false,
|
|
19
19
|
title: false,
|
|
@@ -59,39 +59,47 @@ var Skeleton = function Skeleton(props) {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
var getStyle = function getStyle() {
|
|
62
|
+
if (avatarSize) {
|
|
63
|
+
return {
|
|
64
|
+
width: avatarSize,
|
|
65
|
+
height: avatarSize
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
return {
|
|
63
|
-
width:
|
|
64
|
-
height:
|
|
70
|
+
width: '50px',
|
|
71
|
+
height: '50px'
|
|
65
72
|
};
|
|
66
73
|
};
|
|
67
74
|
|
|
68
75
|
return React__default.createElement(React__default.Fragment, null, loading ? React__default.createElement("div", null, children) : React__default.createElement("div", _objectSpread({
|
|
69
76
|
className: classes
|
|
70
|
-
}, restProps), React__default.createElement("div", {
|
|
77
|
+
}, restProps), animated && React__default.createElement("div", {
|
|
71
78
|
className: "skeleton-animation"
|
|
72
79
|
}), React__default.createElement("div", {
|
|
73
80
|
className: "nut-skeleton-content"
|
|
74
81
|
}, avatar && React__default.createElement(Avatar, {
|
|
75
82
|
className: avatarClass,
|
|
76
83
|
bgColor: "rgb(239, 239, 239)",
|
|
84
|
+
shape: avatarShape,
|
|
77
85
|
style: getStyle()
|
|
78
|
-
}), row === 1
|
|
86
|
+
}), row === 1 && React__default.createElement("div", {
|
|
79
87
|
className: blockClass,
|
|
80
88
|
style: {
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
89
|
+
width: width,
|
|
90
|
+
height: height
|
|
83
91
|
}
|
|
84
|
-
})
|
|
92
|
+
}), React__default.createElement("div", {
|
|
85
93
|
className: "skeleton-content-line"
|
|
86
94
|
}, title && React__default.createElement("div", {
|
|
87
95
|
className: "skeleton-title"
|
|
88
96
|
}), repeatLines(row).map(function (item, index) {
|
|
89
97
|
return React__default.createElement("div", {
|
|
90
|
-
className:
|
|
98
|
+
className: blockClass,
|
|
91
99
|
key: index,
|
|
92
100
|
style: {
|
|
93
|
-
width:
|
|
94
|
-
height:
|
|
101
|
+
width: width,
|
|
102
|
+
height: height
|
|
95
103
|
}
|
|
96
104
|
});
|
|
97
105
|
})))));
|
package/dist/esm/Step.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "title", "content", "activeIndex", "icon", "size", "className", "renderContent"];
|
|
3
|
+
var _excluded = ["children", "title", "content", "activeIndex", "icon", "iconColor", "size", "className", "renderContent"];
|
|
4
4
|
|
|
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
|
|
|
@@ -17,6 +17,7 @@ var defaultProps = {
|
|
|
17
17
|
content: '',
|
|
18
18
|
activeIndex: 0,
|
|
19
19
|
icon: '',
|
|
20
|
+
iconColor: '',
|
|
20
21
|
size: '12px'
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -27,6 +28,7 @@ var Step = function Step(props) {
|
|
|
27
28
|
content = _defaultProps$props.content,
|
|
28
29
|
activeIndex = _defaultProps$props.activeIndex,
|
|
29
30
|
icon = _defaultProps$props.icon,
|
|
31
|
+
iconColor = _defaultProps$props.iconColor,
|
|
30
32
|
size = _defaultProps$props.size,
|
|
31
33
|
className = _defaultProps$props.className,
|
|
32
34
|
renderContent = _defaultProps$props.renderContent,
|
|
@@ -41,11 +43,19 @@ var Step = function Step(props) {
|
|
|
41
43
|
return index === +parent.propSteps.current ? 'process' : 'wait';
|
|
42
44
|
};
|
|
43
45
|
|
|
46
|
+
var handleClickStep = function handleClickStep() {
|
|
47
|
+
var _parent$propSteps;
|
|
48
|
+
|
|
49
|
+
(_parent$propSteps = parent.propSteps) === null || _parent$propSteps === void 0 ? void 0 : _parent$propSteps.clickStep(activeIndex);
|
|
50
|
+
};
|
|
51
|
+
|
|
44
52
|
var b = cn('step');
|
|
45
53
|
var classes = classNames(_defineProperty({}, "".concat(b(''), "-").concat(getCurrentStatus()), true), className, b(''));
|
|
46
|
-
return React__default.createElement("div", _objectSpread({
|
|
54
|
+
return React__default.createElement("div", _objectSpread(_objectSpread({
|
|
47
55
|
className: classes
|
|
48
|
-
}, restProps),
|
|
56
|
+
}, restProps), {}, {
|
|
57
|
+
onClick: handleClickStep
|
|
58
|
+
}), React__default.createElement("div", {
|
|
49
59
|
className: "nut-step-head"
|
|
50
60
|
}, React__default.createElement("div", {
|
|
51
61
|
className: "nut-step-line"
|
|
@@ -53,6 +63,7 @@ var Step = function Step(props) {
|
|
|
53
63
|
className: "nut-step-icon ".concat(!dot ? icon ? 'is-icon' : 'is-text' : '')
|
|
54
64
|
}, icon ? React__default.createElement(Icon, {
|
|
55
65
|
className: "nut-step-icon-inner",
|
|
66
|
+
color: iconColor,
|
|
56
67
|
name: icon,
|
|
57
68
|
size: size
|
|
58
69
|
}) : dot ? React__default.createElement("span", null) : React__default.createElement("span", {
|
package/dist/esm/Steps.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
var _excluded = ["children", "direction", "className"];
|
|
3
|
+
var _excluded = ["children", "current", "direction", "className", "progressDot", "clickStep"];
|
|
4
4
|
|
|
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
|
|
|
@@ -23,8 +23,11 @@ var Steps = function Steps(props) {
|
|
|
23
23
|
var propSteps = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
24
24
|
|
|
25
25
|
var children = propSteps.children,
|
|
26
|
+
current = propSteps.current,
|
|
26
27
|
direction = propSteps.direction,
|
|
27
28
|
className = propSteps.className,
|
|
29
|
+
progressDot = propSteps.progressDot,
|
|
30
|
+
clickStep = propSteps.clickStep,
|
|
28
31
|
restProps = _objectWithoutProperties(propSteps, _excluded);
|
|
29
32
|
|
|
30
33
|
var parentSteps = {
|
package/dist/esm/Swiper.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
5
|
var _excluded = ["children", "direction", "className", "pageContent", "onChange", "initPage", "paginationColor", "paginationVisible", "touchable", "isPreventDefault", "isStopPropagation", "autoPlay"];
|
|
5
6
|
|
|
6
7
|
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; }
|
|
@@ -13,7 +14,7 @@ import { D as DataContext } from './UserContext-b4181162.js';
|
|
|
13
14
|
import { c as cn } from './bem-893ad28d.js';
|
|
14
15
|
import '@bem-react/classname';
|
|
15
16
|
var defaultProps = {
|
|
16
|
-
width: window.innerWidth,
|
|
17
|
+
width: (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' ? window.innerWidth : 375,
|
|
17
18
|
height: 0,
|
|
18
19
|
duration: 500,
|
|
19
20
|
initPage: 0,
|
package/dist/esm/TabbarItem.js
CHANGED
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
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
6
|
|
|
7
7
|
import React__default, { useEffect } from 'react';
|
|
8
|
+
import { useHistory } from 'react-router-dom';
|
|
8
9
|
import { c as cn } from './bem-893ad28d.js';
|
|
9
10
|
import Icon from './Icon.js';
|
|
10
11
|
import '@bem-react/classname';
|
|
@@ -12,6 +13,7 @@ var defaultProps = {
|
|
|
12
13
|
tabTitle: '',
|
|
13
14
|
icon: '',
|
|
14
15
|
href: '',
|
|
16
|
+
to: '',
|
|
15
17
|
num: '',
|
|
16
18
|
active: false,
|
|
17
19
|
activeColor: '',
|
|
@@ -25,6 +27,7 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
25
27
|
tabTitle = _defaultProps$props.tabTitle,
|
|
26
28
|
icon = _defaultProps$props.icon,
|
|
27
29
|
href = _defaultProps$props.href,
|
|
30
|
+
to = _defaultProps$props.to,
|
|
28
31
|
num = _defaultProps$props.num,
|
|
29
32
|
active = _defaultProps$props.active,
|
|
30
33
|
activeColor = _defaultProps$props.activeColor,
|
|
@@ -34,9 +37,15 @@ var TabbarItem = function TabbarItem(props) {
|
|
|
34
37
|
|
|
35
38
|
var b = cn('tabbar-item');
|
|
36
39
|
var bIcon = cn('tabbar-item__icon-box');
|
|
40
|
+
var history = useHistory();
|
|
37
41
|
useEffect(function () {
|
|
38
42
|
if (active && href) {
|
|
39
43
|
window.location.href = href;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (active && to) {
|
|
48
|
+
history.push(to);
|
|
40
49
|
}
|
|
41
50
|
}, [active]);
|
|
42
51
|
return React__default.createElement("div", {
|