@nutui/nutui-react 1.4.5 → 1.4.6
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 +36 -9
- package/dist/esm/Address.js +7 -7
- package/dist/esm/Cascader.js +1 -1
- package/dist/esm/Form.js +1 -1
- package/dist/esm/FormItem.js +2 -2
- package/dist/esm/Icon.js +2 -2
- package/dist/esm/Image.js +76 -11
- package/dist/esm/NoticeBar.js +0 -2
- package/dist/esm/Notify.js +2 -2
- package/dist/esm/Picker.js +0 -1
- package/dist/esm/Popup.js +4 -4
- package/dist/esm/Progress.js +15 -7
- package/dist/esm/SearchBar.js +5 -4
- package/dist/esm/Sticky.js +7 -1
- package/dist/esm/{formitem-5a7034ff.js → formitem-9d18eb24.js} +4 -0
- package/dist/esm/{icon-8dc4de10.js → icon-2242973e.js} +15 -7
- package/dist/esm/types/src/packages/image/image.d.ts +3 -0
- 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.es.js +158 -75
- package/dist/nutui.react.umd.js +158 -75
- package/dist/packages/calendar/calendar.scss +19 -1
- package/dist/packages/fixednav/fixednav.scss +1 -1
- package/dist/packages/image/image.scss +2 -0
- package/dist/packages/input/input.scss +3 -18
- package/dist/packages/notify/notify.scss +23 -19
- package/dist/packages/popup/popup.scss +130 -93
- package/dist/packages/searchbar/searchbar.scss +6 -20
- package/dist/packages/sticky/sticky.scss +3 -0
- package/dist/packages/tag/tag.scss +6 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/variables.scss +1 -3
- package/dist/types/index.d.ts +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# v1.4.6
|
|
2
|
+
`2023-02-08`
|
|
3
|
+
|
|
4
|
+
* :sparkles: feat: image 组件增加懒加载 (#615) @vickyYe
|
|
5
|
+
* :sparkles: feat: sticky 适配 taro (#613) @libin0824
|
|
6
|
+
* :bug: fix: 修复 fixednav 组件的 zIndex (#643) @oasis-cloud
|
|
7
|
+
* :bug: fix: 修复 taro h5 有些 api 未导出导致报错 (#642) @oasis-cloud
|
|
8
|
+
* :bug: fix: 修复 overlay 组件 style 不生效的问题 (#641) @oasis-cloud
|
|
9
|
+
* :bug: fix: 修复获取元素的大小和位置信息未判断元素是否存在 (#640) @oasis-cloud
|
|
10
|
+
* :bug: fix: 修复 taro h5 virtualList 组件demo中的字号 (#639) @oasis-cloud
|
|
11
|
+
* :bug: fix: 修复 taro h5 有些 api 未导出导致报错 (#637) @oasis-cloud
|
|
12
|
+
* :bug: fix: 修复 address 组件无法设置标题 (#622) @yangxiaolu1993
|
|
13
|
+
* :bug: fix: 修复小程序环境下 overlay 组件滚动穿透的问题 (#621) @junjun666
|
|
14
|
+
* :bug: fix: 修复 docs 在线调试问题。 (#631) @xiaoyatong
|
|
15
|
+
* :bug: fix: 修复 FormItem 代理子元素 onChange 后忽略了原属性的问题 (#619) @sun
|
|
16
|
+
* :bug: fix: SearchBar 组件样式修改,排版错误问题处理 (#632) @Ymm
|
|
17
|
+
* :bug: fix: 补充 tag 组件缺少的样式变量,修复在线调试问题 (#635) @eiinu
|
|
18
|
+
* :bug: fix: image 组件 demo 优化 (#636) @vickyYe
|
|
19
|
+
* :bug: fix: noticebar 组件在卸载时不应该初始化动画 (#634) @oasis-cloud
|
|
20
|
+
* :bug: fix: icon 组件未设置 width、height 时,不应出现在 style 上 (#628) @oasis-cloud
|
|
21
|
+
* :bug: fix: input 组件在暗黑模式下 label 颜色错误 (#627) @oasis-cloud
|
|
22
|
+
* :bug: fix: popup 动效优化 (#620) @xiaoyatong
|
|
23
|
+
* :bug: fix: image 组件更新后无法移除 loading 状态 (#625) @oasis-cloud
|
|
24
|
+
* 🔨 chore: 删除 avatar 不必要的打印日志 (#623) @Antee
|
|
25
|
+
* 🔨 chore: 开发环境优化 (#626) @oasis-cloud
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# v.1.4.5
|
|
2
29
|
`2023-02-01`
|
|
3
30
|
|
|
4
|
-
* :sparkles: feat:
|
|
5
|
-
* :bug: fix: 修复 plain 与 type 同时使用时的样式错误 (#606) @eiinu
|
|
6
|
-
* :bug: fix: noticebar
|
|
7
|
-
* :bug: fix: uploader 组件 beforeUpload
|
|
8
|
-
* :bug: fix:
|
|
9
|
-
* :bug: fix: radio 组件横向排列选中后页面抖动 (#600) @oasis-cloud
|
|
10
|
-
* 🔨 chore: nutui
|
|
31
|
+
* :sparkles: feat: virtuallist 组件适配 taro (#602) @vickyYe
|
|
32
|
+
* :bug: fix: 修复 tag 组件 plain 与 type 同时使用时的样式错误 (#606) @eiinu
|
|
33
|
+
* :bug: fix: 修复 noticebar 组件垂直滚动自定义内容点击问题,增加onClickItem事件 (#596) @vickyYe
|
|
34
|
+
* :bug: fix: 修复 uploader 组件 beforeUpload 方法的 ts 类型 (#601) @junjun666
|
|
35
|
+
* :bug: fix: 修复 cell 组件 descTextAlign 相关代码的注入时机和使用文档 (#598) @irisSong
|
|
36
|
+
* :bug: fix: 修复 radio 组件横向排列选中后页面抖动 (#600) @oasis-cloud
|
|
37
|
+
* 🔨 chore: nutui-react-taro 在 iOS 11 下和 taro 的 regenerator-runtime 冲突 (#604) @oasis-cloud
|
|
38
|
+
* 🔨 chore: nutui-react-taro 版本移除 image 和 audio (#609) @oasis-cloud
|
|
11
39
|
* 🔨 chore: 在线主题定制启动后默认打开基础样式 (#603) @oasis-cloud
|
|
12
|
-
* 🔨 chore: taro 版本移除 image 和 audio (#609) @oasis-cloud
|
|
13
40
|
* 🔨 chore: 开发环境文档预览增加最小宽度 (#608) @oasis-cloud
|
|
14
41
|
* 🔨 chore: 提取组件的 CSS Variables (#605) @oasis-cloud
|
|
15
42
|
|
package/dist/esm/Address.js
CHANGED
|
@@ -21,7 +21,7 @@ var defaultProps$2 = {
|
|
|
21
21
|
defaultIcon: 'location2',
|
|
22
22
|
selectedIcon: 'Check',
|
|
23
23
|
isShowCustomAddress: true,
|
|
24
|
-
customAndExistTitle: '
|
|
24
|
+
customAndExistTitle: ''
|
|
25
25
|
};
|
|
26
26
|
var ExistRender = function ExistRender(props) {
|
|
27
27
|
var _useConfig = useConfig(),
|
|
@@ -101,7 +101,7 @@ var ExistRender = function ExistRender(props) {
|
|
|
101
101
|
onClick: switchModule
|
|
102
102
|
}, React__default.createElement("div", {
|
|
103
103
|
className: b('choose-other-btn')
|
|
104
|
-
}, locale.address.chooseAnotherAddress
|
|
104
|
+
}, customAndExistTitle || locale.address.chooseAnotherAddress)));
|
|
105
105
|
};
|
|
106
106
|
var defaultProps$1 = {
|
|
107
107
|
modelValue: [],
|
|
@@ -395,15 +395,15 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
395
395
|
modelValue: false,
|
|
396
396
|
modelSelect: [],
|
|
397
397
|
type: 'custom',
|
|
398
|
-
customAddressTitle: '
|
|
398
|
+
customAddressTitle: '',
|
|
399
399
|
province: [],
|
|
400
400
|
city: [],
|
|
401
401
|
country: [],
|
|
402
402
|
town: [],
|
|
403
403
|
isShowCustomAddress: true,
|
|
404
404
|
existAddress: [],
|
|
405
|
-
existAddressTitle: '
|
|
406
|
-
customAndExistTitle: '
|
|
405
|
+
existAddressTitle: '',
|
|
406
|
+
customAndExistTitle: '',
|
|
407
407
|
height: '200px',
|
|
408
408
|
defaultIcon: 'location2',
|
|
409
409
|
selectedIcon: 'Check',
|
|
@@ -561,7 +561,7 @@ var Address = function Address(props) {
|
|
|
561
561
|
color: "#cccccc"
|
|
562
562
|
})), React__default.createElement("div", {
|
|
563
563
|
className: b('header__title')
|
|
564
|
-
}, privateType === 'custom' ? locale.address.selectRegion
|
|
564
|
+
}, privateType === 'custom' ? customAddressTitle || locale.address.selectRegion : existAddressTitle || locale.address.deliveryTo), React__default.createElement("div", {
|
|
565
565
|
onClick: function onClick() {
|
|
566
566
|
return handClose();
|
|
567
567
|
}
|
|
@@ -612,7 +612,7 @@ var Address = function Address(props) {
|
|
|
612
612
|
selectedIcon: selectedIcon,
|
|
613
613
|
defaultIcon: defaultIcon,
|
|
614
614
|
isShowCustomAddress: isShowCustomAddress,
|
|
615
|
-
customAndExistTitle: locale.address.chooseAnotherAddress
|
|
615
|
+
customAndExistTitle: customAndExistTitle || locale.address.chooseAnotherAddress,
|
|
616
616
|
onSelected: selectedExist,
|
|
617
617
|
onSwitchModule: onSwitchModule
|
|
618
618
|
}))));
|
package/dist/esm/Cascader.js
CHANGED
|
@@ -15,7 +15,7 @@ import classNames from 'classnames';
|
|
|
15
15
|
import Popup from './Popup.js';
|
|
16
16
|
import { T as Tabs } from './tabs-ee05fd2f.js';
|
|
17
17
|
import { T as TabPane } from './tabpane-9b8ca8a8.js';
|
|
18
|
-
import { I as Icon } from './icon-
|
|
18
|
+
import { I as Icon } from './icon-2242973e.js';
|
|
19
19
|
import { c as cn } from './bem-893ad28d.js';
|
|
20
20
|
import './Icon.js';
|
|
21
21
|
import './typings-1c5f2628.js';
|
package/dist/esm/Form.js
CHANGED
|
@@ -9,7 +9,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
9
9
|
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; }
|
|
10
10
|
import React__default, { useRef } from 'react';
|
|
11
11
|
import { C as CellGroup } from './cellgroup-3402f96c.js';
|
|
12
|
-
import { F as FormItemContext, a as FormItem } from './formitem-
|
|
12
|
+
import { F as FormItemContext, a as FormItem } from './formitem-9d18eb24.js';
|
|
13
13
|
import Schema from 'async-validator';
|
|
14
14
|
import { C as ComponentDefaults } from './typings-1c5f2628.js';
|
|
15
15
|
import './bem-893ad28d.js';
|
package/dist/esm/FormItem.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as FormItem } from './formitem-
|
|
2
|
-
export { a as default } from './formitem-
|
|
1
|
+
import { a as FormItem } from './formitem-9d18eb24.js';
|
|
2
|
+
export { a as default } from './formitem-9d18eb24.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './Cell.js';
|
|
5
5
|
import './typings-1c5f2628.js';
|
package/dist/esm/Icon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as Icon } from './icon-
|
|
2
|
-
export { I as default } from './icon-
|
|
1
|
+
import { I as Icon } from './icon-2242973e.js';
|
|
2
|
+
export { I as default } from './icon-2242973e.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './bem-893ad28d.js';
|
|
5
5
|
import '@bem-react/classname';
|
package/dist/esm/Image.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, { useState, useEffect, useRef } from 'react';
|
|
6
6
|
import { useConfig } from './ConfigProvider.js';
|
|
7
7
|
import Icon from './Icon.js';
|
|
8
8
|
var defaultProps = {
|
|
@@ -13,7 +13,8 @@ var defaultProps = {
|
|
|
13
13
|
height: '',
|
|
14
14
|
round: false,
|
|
15
15
|
showError: true,
|
|
16
|
-
showLoading: true
|
|
16
|
+
showLoading: true,
|
|
17
|
+
isLazy: false
|
|
17
18
|
};
|
|
18
19
|
var Image = function Image(props) {
|
|
19
20
|
useConfig();
|
|
@@ -33,6 +34,9 @@ var Image = function Image(props) {
|
|
|
33
34
|
showLoading = _defaultProps$props.showLoading,
|
|
34
35
|
slotError = _defaultProps$props.slotError,
|
|
35
36
|
slotLoding = _defaultProps$props.slotLoding,
|
|
37
|
+
isLazy = _defaultProps$props.isLazy,
|
|
38
|
+
loadingImg = _defaultProps$props.loadingImg,
|
|
39
|
+
errorImg = _defaultProps$props.errorImg,
|
|
36
40
|
onClick = _defaultProps$props.onClick,
|
|
37
41
|
onLoad = _defaultProps$props.onLoad,
|
|
38
42
|
onError = _defaultProps$props.onError;
|
|
@@ -44,8 +48,13 @@ var Image = function Image(props) {
|
|
|
44
48
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
49
|
isError = _useState4[0],
|
|
46
50
|
setIsError = _useState4[1];
|
|
51
|
+
var _useState5 = useState(''),
|
|
52
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
53
|
+
_src = _useState6[0],
|
|
54
|
+
setSrc = _useState6[1];
|
|
47
55
|
useEffect(function () {
|
|
48
56
|
if (src) {
|
|
57
|
+
setSrc(src);
|
|
49
58
|
setIsError(false);
|
|
50
59
|
setLoading(true);
|
|
51
60
|
}
|
|
@@ -74,6 +83,52 @@ var Image = function Image(props) {
|
|
|
74
83
|
objectFit: fit,
|
|
75
84
|
objectPosition: position
|
|
76
85
|
}, style);
|
|
86
|
+
// 图片懒加载
|
|
87
|
+
var observer = useRef(null);
|
|
88
|
+
var initObserver = function initObserver() {
|
|
89
|
+
var imgs = document.querySelectorAll('.nut-img.lazyload');
|
|
90
|
+
var options = {
|
|
91
|
+
threshold: [0],
|
|
92
|
+
rootMargin: '0px' // 对视口进行收缩和扩张
|
|
93
|
+
};
|
|
94
|
+
// 监听dom是否在视口内
|
|
95
|
+
observer.current = new IntersectionObserver(function (entires, self) {
|
|
96
|
+
// entires为监听的节点数组对象
|
|
97
|
+
entires.forEach(function (item) {
|
|
98
|
+
// isIntersecting是当前监听元素交叉区域是否在可视区域指定的阈值内返回的是一个布尔值
|
|
99
|
+
if (item.isIntersecting) {
|
|
100
|
+
setTimeout(function () {
|
|
101
|
+
var img = item.target;
|
|
102
|
+
if (img.dataset.src) {
|
|
103
|
+
img.src = img.dataset.src;
|
|
104
|
+
img.removeAttribute('data-src');
|
|
105
|
+
}
|
|
106
|
+
// 资源加载后停止监听
|
|
107
|
+
observer.current.unobserve(item.target);
|
|
108
|
+
}, 300);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}, options);
|
|
112
|
+
imgs.forEach(function (item) {
|
|
113
|
+
observer.current.observe(item);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
// 使用disconnect将取消的Observer实例中的所有监听
|
|
117
|
+
var resetObserver = function resetObserver() {
|
|
118
|
+
observer.current.disconnect && observer.current.disconnect();
|
|
119
|
+
};
|
|
120
|
+
useEffect(function () {
|
|
121
|
+
isLazy && initObserver();
|
|
122
|
+
return function () {
|
|
123
|
+
isLazy && resetObserver();
|
|
124
|
+
};
|
|
125
|
+
}, [isLazy]);
|
|
126
|
+
var loadingBg = {
|
|
127
|
+
backgroundImage: loadingImg ? "url('".concat(loadingImg, "')") : ''
|
|
128
|
+
};
|
|
129
|
+
var errorBg = {
|
|
130
|
+
backgroundImage: errorImg ? "url('".concat(errorImg, "')") : ''
|
|
131
|
+
};
|
|
77
132
|
var imageClick = function imageClick(event) {
|
|
78
133
|
onClick && onClick(event);
|
|
79
134
|
};
|
|
@@ -83,22 +138,32 @@ var Image = function Image(props) {
|
|
|
83
138
|
onClick: function onClick(e) {
|
|
84
139
|
imageClick(e);
|
|
85
140
|
}
|
|
86
|
-
}, React__default.createElement("img", {
|
|
141
|
+
}, isLazy ? React__default.createElement("img", {
|
|
142
|
+
className: "nut-img lazyload",
|
|
143
|
+
style: styles,
|
|
144
|
+
"data-src": _src,
|
|
145
|
+
alt: alt,
|
|
146
|
+
loading: "lazy",
|
|
147
|
+
onLoad: load,
|
|
148
|
+
onError: error
|
|
149
|
+
}) : React__default.createElement("img", {
|
|
87
150
|
className: "nut-img",
|
|
88
151
|
style: styles,
|
|
89
|
-
src:
|
|
152
|
+
src: _src,
|
|
90
153
|
alt: alt,
|
|
91
154
|
onLoad: load,
|
|
92
155
|
onError: error
|
|
93
|
-
}),
|
|
94
|
-
className: "nut-img-loading"
|
|
95
|
-
|
|
156
|
+
}), loading && showLoading ? React__default.createElement("div", {
|
|
157
|
+
className: "nut-img-loading",
|
|
158
|
+
style: loadingBg
|
|
159
|
+
}, !loadingImg && (slotLoding || children || React__default.createElement(Icon, {
|
|
96
160
|
name: "image"
|
|
97
|
-
})) : null,
|
|
98
|
-
className: "nut-img-error"
|
|
99
|
-
|
|
161
|
+
}))) : null, isError && showError && !loading ? React__default.createElement("div", {
|
|
162
|
+
className: "nut-img-error",
|
|
163
|
+
style: errorBg
|
|
164
|
+
}, !errorImg && (slotError || children || React__default.createElement(Icon, {
|
|
100
165
|
name: "image-error"
|
|
101
|
-
})) : null);
|
|
166
|
+
}))) : null);
|
|
102
167
|
};
|
|
103
168
|
Image.defaultProps = defaultProps;
|
|
104
169
|
Image.displayName = 'NutImage';
|
package/dist/esm/NoticeBar.js
CHANGED
package/dist/esm/Notify.js
CHANGED
|
@@ -96,8 +96,8 @@ var Notification = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
96
96
|
this.state;
|
|
97
97
|
cn('notify');
|
|
98
98
|
var classes = classNames(_defineProperty({
|
|
99
|
-
'popup-top': position === 'top',
|
|
100
|
-
'popup-bottom': position === 'bottom',
|
|
99
|
+
'nut-notify--popup-top': position === 'top',
|
|
100
|
+
'nut-notify--popup-bottom': position === 'bottom',
|
|
101
101
|
'nut-notify': true
|
|
102
102
|
}, "nut-notify--".concat(type), true));
|
|
103
103
|
return React.createElement(React.Fragment, null, React.createElement(CSSTransition, {
|
package/dist/esm/Picker.js
CHANGED
|
@@ -307,7 +307,6 @@ var InternalPicker = function InternalPicker(props, ref) {
|
|
|
307
307
|
}, [defaultValueData]);
|
|
308
308
|
// 选中值进行修改
|
|
309
309
|
useEffect(function () {
|
|
310
|
-
console.log('修改');
|
|
311
310
|
onChange && onChange(columnIndex, chooseValueData, selectedOptions());
|
|
312
311
|
if (isConfirmEvent.current) {
|
|
313
312
|
isConfirmEvent.current = false;
|
package/dist/esm/Popup.js
CHANGED
|
@@ -90,10 +90,10 @@ var Popup = function Popup(props) {
|
|
|
90
90
|
var popStyles = _objectSpread(_objectSpread({}, style), baseStyle);
|
|
91
91
|
var classes = classNames((_classNames = {
|
|
92
92
|
round: round
|
|
93
|
-
}, _defineProperty(_classNames, "popup-".concat(position), true), _defineProperty(_classNames, "".concat(popClass), true), _defineProperty(_classNames, "".concat(className), true), _classNames), b(''));
|
|
93
|
+
}, _defineProperty(_classNames, "nut-popup-".concat(position), true), _defineProperty(_classNames, "".concat(popClass), true), _defineProperty(_classNames, "".concat(className), true), _classNames), b(''));
|
|
94
94
|
var closeClasses = classNames(_defineProperty({
|
|
95
|
-
'
|
|
96
|
-
}, "
|
|
95
|
+
'nut-popup__close-icon': true
|
|
96
|
+
}, "nut-popup__close-icon--".concat(closeIconPosition), true));
|
|
97
97
|
var open = function open() {
|
|
98
98
|
if (!innerVisible) {
|
|
99
99
|
setInnerVisible(true);
|
|
@@ -184,7 +184,7 @@ var Popup = function Popup(props) {
|
|
|
184
184
|
!visible && close();
|
|
185
185
|
}, [visible]);
|
|
186
186
|
useEffect(function () {
|
|
187
|
-
setTransitionName(transition || "popup-slide-".concat(position));
|
|
187
|
+
setTransitionName(transition || "nut-popup-slide-".concat(position));
|
|
188
188
|
}, [position]);
|
|
189
189
|
return React__default.createElement(React__default.Fragment, null, renderToContainer(teleport, renderNode()));
|
|
190
190
|
};
|
package/dist/esm/Progress.js
CHANGED
|
@@ -20,7 +20,13 @@ var defaultProps$1 = {
|
|
|
20
20
|
className: ''
|
|
21
21
|
};
|
|
22
22
|
function pxCheck(value) {
|
|
23
|
-
|
|
23
|
+
if (value === '') {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
if (Number.isNaN(Number(value))) {
|
|
27
|
+
return String(value);
|
|
28
|
+
}
|
|
29
|
+
return "".concat(value, "px");
|
|
24
30
|
}
|
|
25
31
|
function Icon(props) {
|
|
26
32
|
var _defaultProps$1$props = _objectSpread(_objectSpread({}, defaultProps$1), props),
|
|
@@ -49,14 +55,16 @@ function Icon(props) {
|
|
|
49
55
|
};
|
|
50
56
|
return {};
|
|
51
57
|
};
|
|
58
|
+
var styles = {};
|
|
59
|
+
var checkedSize = pxCheck(size);
|
|
60
|
+
if (checkedSize) {
|
|
61
|
+
styles.width = styles.height = styles.fontSize = checkedSize;
|
|
62
|
+
}
|
|
52
63
|
return React__default.createElement(type, _objectSpread(_objectSpread({
|
|
53
64
|
className: isImage ? "".concat(b('img'), " ").concat(className || '', " ") : "".concat(fontClassName, " ").concat(b(null), " ").concat(classPrefix, "-").concat(name, " ").concat(className || ''),
|
|
54
|
-
style: _objectSpread({
|
|
55
|
-
color: color
|
|
56
|
-
|
|
57
|
-
width: pxCheck(size),
|
|
58
|
-
height: pxCheck(size)
|
|
59
|
-
}, style)
|
|
65
|
+
style: _objectSpread(_objectSpread({
|
|
66
|
+
color: color
|
|
67
|
+
}, styles), style)
|
|
60
68
|
}, rest), {}, {
|
|
61
69
|
onClick: handleClick
|
|
62
70
|
}, hasSrc()), children);
|
package/dist/esm/SearchBar.js
CHANGED
|
@@ -92,9 +92,7 @@ var SearchBar = function SearchBar(props) {
|
|
|
92
92
|
return React__default.createElement("input", {
|
|
93
93
|
className: "".concat(searchbarBem('input'), " ").concat(searchbarBem(alignClass), " ").concat(shape === 'round' ? searchbarBem('round') : '', " ").concat(clearable ? searchbarBem('input-clear') : ''),
|
|
94
94
|
ref: searchRef,
|
|
95
|
-
style: _objectSpread(
|
|
96
|
-
background: props.inputBackground
|
|
97
|
-
}),
|
|
95
|
+
style: _objectSpread({}, props.style),
|
|
98
96
|
value: value || '',
|
|
99
97
|
placeholder: placeholder || locale.placeholder,
|
|
100
98
|
disabled: disabled,
|
|
@@ -224,7 +222,10 @@ var SearchBar = function SearchBar(props) {
|
|
|
224
222
|
background: props.background
|
|
225
223
|
})
|
|
226
224
|
}, renderLeftoutIcon(), renderLabel(), React__default.createElement("div", {
|
|
227
|
-
className: "".concat(searchbarBem('content'))
|
|
225
|
+
className: "".concat(searchbarBem('content')),
|
|
226
|
+
style: {
|
|
227
|
+
background: props.inputBackground
|
|
228
|
+
}
|
|
228
229
|
}, renderLeftinIcon(), renderField(), renderRightinIcon(), clearable && value && handleClear()), renderRightoutIcon(), renderRightLabel());
|
|
229
230
|
};
|
|
230
231
|
SearchBar.defaultProps = defaultProps;
|
package/dist/esm/Sticky.js
CHANGED
|
@@ -35,6 +35,12 @@ function useWatch(dep, callback) {
|
|
|
35
35
|
stop.current = true;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
var defaultProps = {
|
|
39
|
+
position: 'top',
|
|
40
|
+
top: 0,
|
|
41
|
+
bottom: 0,
|
|
42
|
+
zIndex: 2000
|
|
43
|
+
};
|
|
38
44
|
var Sticky = function Sticky(props) {
|
|
39
45
|
var _useState5;
|
|
40
46
|
var _props$position = props.position,
|
|
@@ -176,6 +182,6 @@ var Sticky = function Sticky(props) {
|
|
|
176
182
|
style: stickyStyle
|
|
177
183
|
}, children));
|
|
178
184
|
};
|
|
179
|
-
|
|
185
|
+
Sticky.defaultProps = defaultProps;
|
|
180
186
|
Sticky.displayName = 'NutSticky';
|
|
181
187
|
export { Sticky as default };
|
|
@@ -47,6 +47,10 @@ var FormItem = /*#__PURE__*/function (_React__default$Compo) {
|
|
|
47
47
|
return {
|
|
48
48
|
value: getFieldValue(name),
|
|
49
49
|
onChange: function onChange(event) {
|
|
50
|
+
var originOnChange = children.props.onChange;
|
|
51
|
+
if (originOnChange) {
|
|
52
|
+
originOnChange(event);
|
|
53
|
+
}
|
|
50
54
|
var newValue = event;
|
|
51
55
|
switch (type) {
|
|
52
56
|
case 'checkbox':
|
|
@@ -16,7 +16,13 @@ var defaultProps = {
|
|
|
16
16
|
className: ''
|
|
17
17
|
};
|
|
18
18
|
function pxCheck(value) {
|
|
19
|
-
|
|
19
|
+
if (value === '') {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
if (Number.isNaN(Number(value))) {
|
|
23
|
+
return String(value);
|
|
24
|
+
}
|
|
25
|
+
return "".concat(value, "px");
|
|
20
26
|
}
|
|
21
27
|
function Icon(props) {
|
|
22
28
|
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
@@ -45,14 +51,16 @@ function Icon(props) {
|
|
|
45
51
|
};
|
|
46
52
|
return {};
|
|
47
53
|
};
|
|
54
|
+
var styles = {};
|
|
55
|
+
var checkedSize = pxCheck(size);
|
|
56
|
+
if (checkedSize) {
|
|
57
|
+
styles.width = styles.height = styles.fontSize = checkedSize;
|
|
58
|
+
}
|
|
48
59
|
return React__default.createElement(type, _objectSpread(_objectSpread({
|
|
49
60
|
className: isImage ? "".concat(b('img'), " ").concat(className || '', " ") : "".concat(fontClassName, " ").concat(b(null), " ").concat(classPrefix, "-").concat(name, " ").concat(className || ''),
|
|
50
|
-
style: _objectSpread({
|
|
51
|
-
color: color
|
|
52
|
-
|
|
53
|
-
width: pxCheck(size),
|
|
54
|
-
height: pxCheck(size)
|
|
55
|
-
}, style)
|
|
61
|
+
style: _objectSpread(_objectSpread({
|
|
62
|
+
color: color
|
|
63
|
+
}, styles), style)
|
|
56
64
|
}, rest), {}, {
|
|
57
65
|
onClick: handleClick
|
|
58
66
|
}, hasSrc()), children);
|
|
@@ -14,6 +14,9 @@ export interface ImageProps {
|
|
|
14
14
|
showLoading: boolean;
|
|
15
15
|
slotLoding: React.ReactNode;
|
|
16
16
|
slotError: React.ReactNode | string;
|
|
17
|
+
isLazy?: boolean;
|
|
18
|
+
loadingImg?: string;
|
|
19
|
+
errorImg?: string;
|
|
17
20
|
onClick?: (e: MouseEvent) => void;
|
|
18
21
|
onLoad?: () => void;
|
|
19
22
|
onError?: () => void;
|
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