@nutui/nutui-react 1.3.10 → 1.3.11
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 +24 -0
- package/README.md +54 -46
- package/dist/esm/Avatar.js +6 -2
- package/dist/esm/Badge.js +4 -1
- package/dist/esm/Button.js +23 -20
- package/dist/esm/CheckboxGroup.js +1 -1
- package/dist/esm/Col.js +5 -2
- package/dist/esm/Input.js +1 -3
- package/dist/esm/MenuItem.js +8 -3
- package/dist/esm/RadioGroup.js +1 -1
- package/dist/esm/Rate.js +4 -1
- package/dist/esm/Row.js +5 -1
- package/dist/esm/SwiperItem.js +6 -4
- package/dist/esm/Tag.js +1 -1
- package/dist/esm/types/src/packages/avatar/avatar.d.ts +1 -0
- package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +2 -2
- 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/nutui.react.es.js +65 -36
- package/dist/nutui.react.umd.js +65 -36
- package/dist/packages/avatar/avatar.scss +1 -1
- package/dist/packages/button/button.scss +6 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
# v1.3.11
|
|
2
|
+
`2022-11-16`
|
|
3
|
+
|
|
4
|
+
* :bug: fix: CheckboxGroup和RadioGroup组件动态改变options没有导致子组件更新问题 (#464) @cuicuiworld
|
|
5
|
+
* :sparkles: feat: avatar组件支持iconSize自定义图标大小 (#461) @cuicuiworld
|
|
6
|
+
* :bug: fix: avatar img 标签增加 avatar-img (#462) @oasis-cloud
|
|
7
|
+
* :bug: fix: button 组件中 icon 单独使用不居中 @oasis-cloud
|
|
8
|
+
* :bug: fix: tag组件去除多余标签元素 (#459) @cuicuiworld
|
|
9
|
+
* :bug: fix: calendar 今日标签样式错误 (#460) @Phyzait
|
|
10
|
+
* :sparkles: feat: infiniteloading 组件适配 taro (#458) @junjun666
|
|
11
|
+
* :bug: fix: 修复taro原生img标签无法重新渲染的问题 (#455) @junjun666
|
|
12
|
+
* :sparkles: feat: swiperItem组件支持className和style属性 (#454) @cuicuiworld
|
|
13
|
+
* :bug: fix: 修复TabBar组件demo演示页路由跳转失败问题 (#451) @cuicuiworld
|
|
14
|
+
* :bug: fix: 修复Row组件的文档示例错误 (#453) @simpleStyle
|
|
15
|
+
* 📖 docs: 修复 datepicker 文档中示例代码错误 (#449) @xxxnine
|
|
16
|
+
* :sparkles: feat: 补全button的关于小程序API的typescript支持 (#447) @simpleStyle
|
|
17
|
+
* :bug: fix: input组件defaultvalue值为空时不可清除问题修复 (#452) vickyYe*
|
|
18
|
+
* :sparkles: feat: menuitem 支持 ref (#450) @oasis-cloud
|
|
19
|
+
* :sparkles: feat: badge组件支持className和style属性 (#444) @cuicuiworld
|
|
20
|
+
* :bug: fix: 引入样式文件运行报错(#439) (#441) @hydeia
|
|
21
|
+
* :sparkles: feat: button组件支持原生小程序和H5的button特性 (#433) @simpleStyle
|
|
22
|
+
* :sparkles: feat: row和col组件支持className和style属性 (#440) @cuicuiworld
|
|
23
|
+
* :sparkles: feat: rate组件添加className和style属性 (#438) @cuicuiworld
|
|
24
|
+
|
|
1
25
|
# v1.3.10
|
|
2
26
|
`2022-11-09`
|
|
3
27
|
|
package/README.md
CHANGED
|
@@ -3,54 +3,52 @@
|
|
|
3
3
|
<img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;">
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
|
-
<p align="center">京东风格的轻量级移动端 React
|
|
6
|
+
<p align="center">京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<a href="http://makeapullrequest.com">
|
|
10
10
|
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome" />
|
|
11
11
|
</a>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<a href="https://github.com/jdf2e/nutui">
|
|
25
|
-
|
|
26
|
-
</a>
|
|
12
|
+
<a href="https://github.com/jdf2e/nutui-react">
|
|
13
|
+
<img src="https://img.shields.io/npm/l/@nutui/nutui-react.svg" alt="license"/>
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@nutui/nutui-react">
|
|
16
|
+
<img src="https://img.shields.io/npm/v/@nutui/nutui-react.svg?style=flat-square">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://www.npmjs.com/package/@nutui/nutui-react">
|
|
19
|
+
<img src="https://img.shields.io/npm/dt/@nutui/nutui-react.svg?style=flat-square">
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://github.com/jdf2e/nutui-react">
|
|
22
|
+
<img src="https://img.shields.io/github/contributors/jdf2e/nutui-react" alt="GitHub contributors">
|
|
23
|
+
</a>
|
|
24
|
+
<a href="https://github.com/jdf2e/nutui-react">
|
|
25
|
+
<img src="https://img.shields.io/github/release-date/jdf2e/nutui-react" alt="GitHub Release Date">
|
|
26
|
+
</a>
|
|
27
|
+
<a href="https://github.com/jdf2e/nutui-react">
|
|
28
|
+
<img src="https://img.shields.io/github/commit-activity/w/jdf2e/nutui-react" alt="GitHub commit activity">
|
|
29
|
+
</a>
|
|
27
30
|
</p>
|
|
28
31
|
|
|
32
|
+
<p align='center'>
|
|
33
|
+
<img src="https://img12.360buyimg.com/imagetools/jfs/t1/202336/18/18586/7437/61b832ccE0b13d53d/18605da7232a5a0e.png" height="180" alt="NutUI-React" />
|
|
34
|
+
<img src="https://img13.360buyimg.com/imagetools/jfs/t1/102323/22/33163/27773/632a7855E75c9fa02/8c351778f47d24f5.jpg" width="200" alt="NutUI-React" />
|
|
35
|
+
</p>
|
|
29
36
|
|
|
30
|
-
> Nut[nʌt],源自电影《冰河世纪》里松鼠 Scrat "执迷不悟",一生追求,即便引发大灾难也绝不松手的坚果。
|
|
31
37
|
---
|
|
32
|
-
|
|
38
|
+
> Nut[nʌt],源自电影《冰河世纪》里松鼠 Scrat "执迷不悟",一生追求,即便引发大灾难也绝不松手的坚果。
|
|
33
39
|
|
|
34
40
|
## 特性
|
|
35
41
|
|
|
36
|
-
* 🚀
|
|
42
|
+
* 🚀 60+ 高质量组件, 覆盖移动端主流场景
|
|
37
43
|
* 📖 基于京东APP 10.0 视觉规范
|
|
38
44
|
* 🍭 支持按需引用
|
|
39
45
|
* 📖 详尽的文档和示例
|
|
40
46
|
* 💪 支持 TypeScript
|
|
41
47
|
* 💪 支持服务端渲染(测试阶段)
|
|
42
48
|
* 🍭 支持定制主题
|
|
43
|
-
* 🍭
|
|
49
|
+
* 🍭 单元测试覆盖率超过80%, 保障稳定性
|
|
44
50
|
* 📖 提供 Sketch 设计资源
|
|
45
51
|
|
|
46
|
-
## 示例 H5 & 小程序
|
|
47
|
-
|
|
48
|
-
<p>
|
|
49
|
-
<img src="https://img12.360buyimg.com/imagetools/jfs/t1/202336/18/18586/7437/61b832ccE0b13d53d/18605da7232a5a0e.png" height="250" alt="NutUI" />
|
|
50
|
-
</p>
|
|
51
|
-
<p>
|
|
52
|
-
<img src="https://img13.360buyimg.com/imagetools/jfs/t1/102323/22/33163/27773/632a7855E75c9fa02/8c351778f47d24f5.jpg" width="200" alt="NutUI-React" />
|
|
53
|
-
</p>
|
|
54
52
|
## 构建版本
|
|
55
53
|
|
|
56
54
|
> AMD 环境、Webpack、Vite 等构建工具环境、服务端建议使用 es 版,非模块化环境(如通过 `<script>` 标签直接引用)建议使用 umd 压缩版。
|
|
@@ -85,39 +83,49 @@
|
|
|
85
83
|
</li>
|
|
86
84
|
</ul>
|
|
87
85
|
|
|
88
|
-
|
|
86
|
+
## 开发交流
|
|
87
|
+
| 版本 | 微信群 |内部咚咚群 |
|
|
88
|
+
| --- | --- |--- |
|
|
89
|
+
| [NutUI React](https://github.com/jdf2e/nutui-react/issues) | <img src="https://storage.360buyimg.com/imgtools/17c67beff6-4acf07c0-609c-11ed-a6ef-69df15b605e4.png" width="100" /> 关注后回复「NutUI-React」 | 1025679314 |
|
|
90
|
+
| [NutUI x Taro](https://github.com/jdf2e/nutui/issues) | <img src="https://camo.githubusercontent.com/db4276b4ee4b443158195e943e9e678cb4d2afb7580f70d4d817ef0a90413aec/687474703a2f2f73746f726167652e333630627579696d672e636f6d2f7461726f2d6a642d636f6d2f7374617469632f636f6e746163745f7461726f5f6e757475695f71722e706e67" width="100" /> 关注后回复「NutUI-React」 | 1022545110 |
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
[//]: # (| 版本 | 微信群 |内部咚咚群 |)
|
|
92
|
+
## 参与共建
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
#### NutUI 社区共建倡议
|
|
94
95
|
|
|
95
|
-
[
|
|
96
|
+
[NutUI-React 邀您共建,Contributor 您好](https://github.com/jdf2e/nutui-react/discussions/348)
|
|
96
97
|
|
|
97
|
-
|
|
98
|
+
#### 为 NutUI 贡献代码
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
NutUI 的共建方向主要分为:解决 issue、修复 bug、新增组件、增加国际化、UI 定制、平台适配、跨端扩展等。
|
|
100
101
|
|
|
101
|
-
[
|
|
102
|
+
欢迎社区开发者参与共建,在贡献您的代码之前请先阅读 [《NutUI 贡献指南》](https://github.com/jdf2e/nutui-react/discussions/348)。
|
|
102
103
|
|
|
104
|
+
## 问题反馈与建议
|
|
103
105
|
|
|
104
|
-
[
|
|
106
|
+
[给 NutUI 提 Issue](https://nutui.jd.com/nutui-issue-helper/?repo=jdf2e/nutui-react&lang=zh-cn)
|
|
105
107
|
|
|
106
|
-
[
|
|
107
|
-
[//]: # (感谢以下小伙伴们为 NutUI 发展做出的贡献:)
|
|
108
|
+
> 在反馈问题之前,推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545)和[《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html),这样您能够更容易获得理解和帮助。
|
|
108
109
|
|
|
109
|
-
[
|
|
110
|
-
[//]: # (<a href="https://github.com/jdf2e/nutui/graphs/contributors">)
|
|
110
|
+
[参与 NutUI 社区讨论](https://github.com/jdf2e/nutui-react/discussions)
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
如果您有任何想法、疑问或建议,都可以参与社区讨论分享您的观点。
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
## 贡献者们
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
感谢以下所有给 NutUI 贡献过代码的 [开发者](https://github.com/jdf2e/nutui-react/graphs/contributors)。
|
|
117
|
+
|
|
118
|
+
<a href="https://github.com/jdf2e/nutui-react/graphs/contributors">
|
|
119
|
+
<img src="https://contrib.rocks/image?repo=jdf2e/nutui-react" />
|
|
120
|
+
</a>
|
|
121
|
+
|
|
122
|
+
## Stargazers
|
|
123
|
+
|
|
124
|
+
[](https://github.com/jdf2e/nutui-react/stargazers)
|
|
117
125
|
|
|
118
|
-
|
|
126
|
+
## Forkers
|
|
119
127
|
|
|
120
|
-
|
|
128
|
+
[](https://github.com/jdf2e/nutui-react/network/members)
|
|
121
129
|
|
|
122
130
|
## 开发计划
|
|
123
131
|
|
package/dist/esm/Avatar.js
CHANGED
|
@@ -1,7 +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
|
-
var _excluded = ["children", "prefixCls", "size", "shape", "bgColor", "color", "url", "alt", "icon", "className", "style", "activeAvatar", "onActiveAvatar", "onError", "iconClassPrefix", "iconFontClassName"];
|
|
4
|
+
var _excluded = ["children", "prefixCls", "size", "shape", "bgColor", "color", "url", "alt", "icon", "iconSize", "className", "style", "activeAvatar", "onActiveAvatar", "onError", "iconClassPrefix", "iconFontClassName"];
|
|
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, useContext, useEffect } from 'react';
|
|
@@ -14,6 +14,7 @@ import '@bem-react/classname';
|
|
|
14
14
|
var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
15
15
|
size: '',
|
|
16
16
|
icon: '',
|
|
17
|
+
iconSize: '',
|
|
17
18
|
bgColor: '#eee',
|
|
18
19
|
color: '#666',
|
|
19
20
|
prefixCls: 'nut-avatar',
|
|
@@ -32,6 +33,7 @@ var Avatar = function Avatar(props) {
|
|
|
32
33
|
url = _defaultProps$props.url,
|
|
33
34
|
alt = _defaultProps$props.alt,
|
|
34
35
|
icon = _defaultProps$props.icon,
|
|
36
|
+
iconSize = _defaultProps$props.iconSize,
|
|
35
37
|
className = _defaultProps$props.className,
|
|
36
38
|
style = _defaultProps$props.style,
|
|
37
39
|
activeAvatar = _defaultProps$props.activeAvatar,
|
|
@@ -109,6 +111,7 @@ var Avatar = function Avatar(props) {
|
|
|
109
111
|
onClick: clickAvatar,
|
|
110
112
|
ref: avatarRef
|
|
111
113
|
}), (!(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", {
|
|
114
|
+
className: "avatar-img",
|
|
112
115
|
src: url,
|
|
113
116
|
alt: alt,
|
|
114
117
|
onError: errorEvent
|
|
@@ -116,7 +119,8 @@ var Avatar = function Avatar(props) {
|
|
|
116
119
|
classPrefix: iconClassPrefix,
|
|
117
120
|
fontClassName: iconFontClassName,
|
|
118
121
|
className: "icon",
|
|
119
|
-
name: iconStyles
|
|
122
|
+
name: iconStyles,
|
|
123
|
+
size: iconSize
|
|
120
124
|
}), children && React__default.createElement("span", {
|
|
121
125
|
className: "text"
|
|
122
126
|
}, children)), showMax && React__default.createElement("div", {
|
package/dist/esm/Badge.js
CHANGED
|
@@ -16,6 +16,8 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
16
16
|
});
|
|
17
17
|
var Badge = function Badge(props) {
|
|
18
18
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
19
|
+
className = _defaultProps$props.className,
|
|
20
|
+
style = _defaultProps$props.style,
|
|
19
21
|
children = _defaultProps$props.children,
|
|
20
22
|
dot = _defaultProps$props.dot,
|
|
21
23
|
top = _defaultProps$props.top,
|
|
@@ -43,7 +45,8 @@ var Badge = function Badge(props) {
|
|
|
43
45
|
return style;
|
|
44
46
|
};
|
|
45
47
|
return React__default.createElement("div", {
|
|
46
|
-
className: "nut-badge"
|
|
48
|
+
className: "nut-badge ".concat(className),
|
|
49
|
+
style: style
|
|
47
50
|
}, icons !== '' && React__default.createElement("div", {
|
|
48
51
|
className: "slot-icons"
|
|
49
52
|
}, React__default.createElement(Icon, {
|
package/dist/esm/Button.js
CHANGED
|
@@ -77,26 +77,29 @@ var Button = function Button(props) {
|
|
|
77
77
|
onClick(e);
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
return (
|
|
81
|
+
// eslint-disable-next-line react/button-has-type
|
|
82
|
+
React__default.createElement("button", _objectSpread(_objectSpread({
|
|
83
|
+
className: "".concat(btnName, " ").concat(className),
|
|
84
|
+
style: _objectSpread(_objectSpread({}, btnStyle), style)
|
|
85
|
+
}, rest), {}, {
|
|
86
|
+
onClick: function onClick(e) {
|
|
87
|
+
return handleClick(e);
|
|
88
|
+
}
|
|
89
|
+
}), React__default.createElement("div", {
|
|
90
|
+
className: "nut-button__warp"
|
|
91
|
+
}, loading && React__default.createElement(Icon, {
|
|
92
|
+
classPrefix: iconClassPrefix,
|
|
93
|
+
fontClassName: iconFontClassName,
|
|
94
|
+
name: "loading"
|
|
95
|
+
}), !loading && icon ? React__default.createElement(Icon, {
|
|
96
|
+
classPrefix: iconClassPrefix,
|
|
97
|
+
fontClassName: iconFontClassName,
|
|
98
|
+
name: icon
|
|
99
|
+
}) : '', children && React__default.createElement("div", {
|
|
100
|
+
className: icon || loading ? 'text' : ''
|
|
101
|
+
}, children)))
|
|
102
|
+
);
|
|
100
103
|
};
|
|
101
104
|
Button.defaultProps = defaultProps;
|
|
102
105
|
Button.displayName = 'NutButton';
|
|
@@ -132,7 +132,7 @@ var CheckboxGroup = React__default.forwardRef(function (props, ref) {
|
|
|
132
132
|
checked: childChecked
|
|
133
133
|
}));
|
|
134
134
|
});
|
|
135
|
-
}, [innerValue]);
|
|
135
|
+
}, [innerValue, options]);
|
|
136
136
|
return React__default.createElement("div", _objectSpread({
|
|
137
137
|
className: "".concat(b(), " ").concat(className || '')
|
|
138
138
|
}, rest), options !== null && options !== void 0 && options.length ? renderOptionsChildren() : cloneChildren());
|
package/dist/esm/Col.js
CHANGED
|
@@ -11,6 +11,9 @@ var defaultProps = {
|
|
|
11
11
|
};
|
|
12
12
|
var Col = function Col(props) {
|
|
13
13
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
14
|
+
className = _defaultProps$props.className,
|
|
15
|
+
_defaultProps$props$s = _defaultProps$props.style,
|
|
16
|
+
style = _defaultProps$props$s === void 0 ? {} : _defaultProps$props$s,
|
|
14
17
|
span = _defaultProps$props.span,
|
|
15
18
|
offset = _defaultProps$props.offset,
|
|
16
19
|
children = _defaultProps$props.children,
|
|
@@ -42,8 +45,8 @@ var Col = function Col(props) {
|
|
|
42
45
|
setColStyle(getStyle);
|
|
43
46
|
}, [span, offset, gutter]);
|
|
44
47
|
return React__default.createElement("div", {
|
|
45
|
-
className: "".concat(colName),
|
|
46
|
-
style: _objectSpread({}, colStyle),
|
|
48
|
+
className: "".concat(colName, " ").concat(className),
|
|
49
|
+
style: _objectSpread(_objectSpread({}, style), colStyle),
|
|
47
50
|
onClick: function onClick(e) {
|
|
48
51
|
_onClick && _onClick(e, 'col');
|
|
49
52
|
}
|
package/dist/esm/Input.js
CHANGED
|
@@ -152,9 +152,7 @@ var Input = forwardRef(function (props, ref) {
|
|
|
152
152
|
});
|
|
153
153
|
useEffect(function () {
|
|
154
154
|
setClasses(inputClass);
|
|
155
|
-
|
|
156
|
-
SetInputValue(defaultValue);
|
|
157
|
-
}
|
|
155
|
+
SetInputValue(defaultValue);
|
|
158
156
|
}, [defaultValue]);
|
|
159
157
|
useEffect(function () {
|
|
160
158
|
if (inputValue) {
|
package/dist/esm/MenuItem.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
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
4
|
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; }
|
|
5
|
-
import React__default, { useState, useEffect } from 'react';
|
|
5
|
+
import React__default, { forwardRef, useState, useEffect, useImperativeHandle } from 'react';
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import { CSSTransition } from 'react-transition-group';
|
|
8
8
|
import { useConfig } from './ConfigProvider.js';
|
|
@@ -25,7 +25,7 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
var MenuItem = function
|
|
28
|
+
var MenuItem = forwardRef(function (props, ref) {
|
|
29
29
|
useConfig();
|
|
30
30
|
var mergedProps = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
31
31
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
@@ -60,6 +60,11 @@ var MenuItem = function MenuItem(props) {
|
|
|
60
60
|
useEffect(function () {
|
|
61
61
|
getParentOffset();
|
|
62
62
|
}, [_showPopup]);
|
|
63
|
+
useImperativeHandle(ref, function () {
|
|
64
|
+
return {
|
|
65
|
+
toggle: parent.toggleItemShow
|
|
66
|
+
};
|
|
67
|
+
});
|
|
63
68
|
var getIconCName = function getIconCName(optionVal, value) {
|
|
64
69
|
var _classNames;
|
|
65
70
|
return classNames((_classNames = {}, _defineProperty(_classNames, activeTitleClass, optionVal === value), _defineProperty(_classNames, inactiveTitleClass, optionVal !== value), _classNames));
|
|
@@ -168,7 +173,7 @@ var MenuItem = function MenuItem(props) {
|
|
|
168
173
|
}
|
|
169
174
|
}, item.text));
|
|
170
175
|
}), children))));
|
|
171
|
-
};
|
|
176
|
+
});
|
|
172
177
|
MenuItem.defaultProps = defaultProps;
|
|
173
178
|
MenuItem.displayName = 'NutMenuItem';
|
|
174
179
|
export { MenuItem as default };
|
package/dist/esm/RadioGroup.js
CHANGED
|
@@ -106,7 +106,7 @@ var RadioGroup = React__default.forwardRef(function (props, ref) {
|
|
|
106
106
|
checked: childChecked
|
|
107
107
|
}));
|
|
108
108
|
});
|
|
109
|
-
}, [val2State]);
|
|
109
|
+
}, [val2State, options]);
|
|
110
110
|
return React__default.createElement(RadioContext.Provider, {
|
|
111
111
|
value: {
|
|
112
112
|
onChange: function onChange(val) {
|
package/dist/esm/Rate.js
CHANGED
|
@@ -23,6 +23,8 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
23
23
|
});
|
|
24
24
|
var Rate = function Rate(props) {
|
|
25
25
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
26
|
+
className = _defaultProps$props.className,
|
|
27
|
+
style = _defaultProps$props.style,
|
|
26
28
|
count = _defaultProps$props.count,
|
|
27
29
|
modelValue = _defaultProps$props.modelValue,
|
|
28
30
|
minimizeValue = _defaultProps$props.minimizeValue,
|
|
@@ -79,7 +81,8 @@ var Rate = function Rate(props) {
|
|
|
79
81
|
onChange && onChange(value);
|
|
80
82
|
};
|
|
81
83
|
return React__default.createElement("div", {
|
|
82
|
-
className: b()
|
|
84
|
+
className: "".concat(b(), " ").concat(className),
|
|
85
|
+
style: style
|
|
83
86
|
}, countArray.map(function (n) {
|
|
84
87
|
return React__default.createElement("div", {
|
|
85
88
|
className: bi(),
|
package/dist/esm/Row.js
CHANGED
|
@@ -12,6 +12,9 @@ var defaultProps = {
|
|
|
12
12
|
};
|
|
13
13
|
var Row = function Row(props) {
|
|
14
14
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
15
|
+
className = _defaultProps$props.className,
|
|
16
|
+
_defaultProps$props$s = _defaultProps$props.style,
|
|
17
|
+
style = _defaultProps$props$s === void 0 ? {} : _defaultProps$props$s,
|
|
15
18
|
children = _defaultProps$props.children,
|
|
16
19
|
type = _defaultProps$props.type,
|
|
17
20
|
justify = _defaultProps$props.justify,
|
|
@@ -34,7 +37,8 @@ var Row = function Row(props) {
|
|
|
34
37
|
return React__default.createElement(DataContext.Provider, {
|
|
35
38
|
value: parentRow
|
|
36
39
|
}, React__default.createElement('div', {
|
|
37
|
-
className: getClasses(),
|
|
40
|
+
className: "".concat(getClasses(), " ").concat(className),
|
|
41
|
+
style: style,
|
|
38
42
|
onClick: function onClick(e) {
|
|
39
43
|
_onClick && _onClick(e, 'row');
|
|
40
44
|
}
|
package/dist/esm/SwiperItem.js
CHANGED
|
@@ -11,13 +11,15 @@ var defaultProps = {
|
|
|
11
11
|
};
|
|
12
12
|
var SwiperItem = React__default.forwardRef(function (props, ref) {
|
|
13
13
|
var _props = _objectSpread(_objectSpread({}, defaultProps), props);
|
|
14
|
-
var
|
|
14
|
+
var className = _props.className,
|
|
15
|
+
style = _props.style,
|
|
16
|
+
children = _props.children,
|
|
15
17
|
direction = _props.direction,
|
|
16
18
|
size = _props.size;
|
|
17
19
|
var parent = useContext(DataContext);
|
|
18
20
|
var b = cn('swiper-item');
|
|
19
|
-
var classes = classNames(b(''));
|
|
20
|
-
var
|
|
21
|
+
var classes = classNames(b(''), className);
|
|
22
|
+
var getStyle = function getStyle() {
|
|
21
23
|
var style = {};
|
|
22
24
|
var _direction = (parent === null || parent === void 0 ? void 0 : parent.propSwiper.direction) || direction;
|
|
23
25
|
var _size = (parent === null || parent === void 0 ? void 0 : parent.size) || size;
|
|
@@ -28,7 +30,7 @@ var SwiperItem = React__default.forwardRef(function (props, ref) {
|
|
|
28
30
|
};
|
|
29
31
|
return React__default.createElement("div", {
|
|
30
32
|
className: classes,
|
|
31
|
-
style: style()
|
|
33
|
+
style: _objectSpread(_objectSpread({}, style), getStyle())
|
|
32
34
|
}, children);
|
|
33
35
|
});
|
|
34
36
|
SwiperItem.defaultProps = defaultProps;
|
package/dist/esm/Tag.js
CHANGED
|
@@ -69,7 +69,7 @@ var Tag = function Tag(props) {
|
|
|
69
69
|
}
|
|
70
70
|
return style;
|
|
71
71
|
};
|
|
72
|
-
return React__default.createElement(
|
|
72
|
+
return React__default.createElement(React__default.Fragment, null, closeable ? isTagShow && React__default.createElement("div", {
|
|
73
73
|
className: "".concat(btnName, " ").concat(className),
|
|
74
74
|
style: _objectSpread(_objectSpread({}, style), getStyle()),
|
|
75
75
|
onClick: function onClick(e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { IComponent } from '@/utils/typings';
|
|
3
3
|
export interface OptionItem {
|
|
4
4
|
text: string;
|
|
@@ -21,4 +21,4 @@ export interface MenuItemProps extends IComponent {
|
|
|
21
21
|
onChange: (event: any) => void;
|
|
22
22
|
children: React.ReactNode;
|
|
23
23
|
}
|
|
24
|
-
export declare const MenuItem:
|
|
24
|
+
export declare const MenuItem: React.ForwardRefExoticComponent<Partial<MenuItemProps> & React.RefAttributes<unknown>>;
|
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