@nutui/nutui-react 1.3.3 → 1.3.4-beta.0

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +3 -2
  3. package/dist/esm/Address.js +7 -5
  4. package/dist/esm/Audio.js +7 -5
  5. package/dist/esm/Avatar.js +5 -3
  6. package/dist/esm/BackTop.js +5 -3
  7. package/dist/esm/Badge.js +5 -3
  8. package/dist/esm/Barrage.js +1 -1
  9. package/dist/esm/Button.js +7 -5
  10. package/dist/esm/Cascader.js +1 -1
  11. package/dist/esm/Cell.js +7 -5
  12. package/dist/esm/Checkbox.js +2 -2
  13. package/dist/esm/Collapse.js +2 -1
  14. package/dist/esm/CollapseItem.js +13 -9
  15. package/dist/esm/FixedNav.js +5 -3
  16. package/dist/esm/GridItem.js +5 -3
  17. package/dist/esm/Infiniteloading.js +13 -11
  18. package/dist/esm/Input.js +9 -7
  19. package/dist/esm/InputNumber.js +7 -5
  20. package/dist/esm/Menu.js +5 -3
  21. package/dist/esm/MenuItem.js +5 -5
  22. package/dist/esm/NavBar.js +7 -5
  23. package/dist/esm/NoticeBar.js +9 -7
  24. package/dist/esm/Notify.js +1 -1
  25. package/dist/esm/Popover.js +5 -3
  26. package/dist/esm/Popup.js +5 -3
  27. package/dist/esm/Progress.js +5 -3
  28. package/dist/esm/PullToRefresh.js +1 -30
  29. package/dist/esm/Radio.js +5 -3
  30. package/dist/esm/Rate.js +10 -8
  31. package/dist/esm/SearchBar.js +5 -3
  32. package/dist/esm/ShortPassword.js +5 -3
  33. package/dist/esm/Step.js +5 -3
  34. package/dist/esm/Sticky/style/index.js +2 -0
  35. package/dist/esm/Sticky.js +209 -0
  36. package/dist/esm/TabbarItem.js +5 -3
  37. package/dist/esm/Table.js +5 -3
  38. package/dist/esm/Tabs.js +2 -2
  39. package/dist/esm/Tag.js +5 -3
  40. package/dist/esm/Toast.js +1 -1
  41. package/dist/esm/Uploader.js +121 -44
  42. package/dist/esm/get-scroll-parent-3dcd3f53.js +32 -0
  43. package/dist/esm/nutui-react.es.js +1 -0
  44. package/dist/esm/render-18227751.js +43 -0
  45. package/dist/esm/{tabs-41234c2c.js → tabs-0896a61b.js} +5 -3
  46. package/dist/esm/types/src/packages/button/demo.d.ts +1 -0
  47. package/dist/esm/types/src/packages/collapseitem/collapseitem.d.ts +1 -0
  48. package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
  49. package/dist/esm/types/src/packages/fixednav/fixednav.d.ts +1 -1
  50. package/dist/esm/types/src/packages/griditem/griditem.d.ts +1 -1
  51. package/dist/esm/types/src/packages/infiniteloading/infiniteloading.d.ts +3 -3
  52. package/dist/esm/types/src/packages/input/input.d.ts +1 -1
  53. package/dist/esm/types/src/packages/menuitem/menuitem.d.ts +1 -1
  54. package/dist/esm/types/src/packages/nutui.react.build.d.ts +2 -1
  55. package/dist/esm/types/src/packages/nutui.react.d.ts +3 -1
  56. package/dist/esm/types/src/packages/nutui.react.scss.d.ts +1 -0
  57. package/dist/esm/types/src/packages/nutui.react.taro.d.ts +3 -1
  58. package/dist/esm/types/src/packages/nutui.taro.react.build.d.ts +2 -1
  59. package/dist/esm/types/src/packages/popover/popover.d.ts +1 -1
  60. package/dist/esm/types/src/packages/progress/progress.d.ts +1 -1
  61. package/dist/esm/types/src/packages/radio/radio.d.ts +1 -1
  62. package/dist/esm/types/src/packages/sticky/__test__/sticky.spec.d.ts +1 -0
  63. package/dist/esm/types/src/packages/sticky/demo.d.ts +3 -0
  64. package/dist/esm/types/src/packages/sticky/index.d.ts +2 -0
  65. package/dist/esm/types/src/packages/sticky/index.taro.d.ts +2 -0
  66. package/dist/esm/types/src/packages/sticky/sticky.d.ts +13 -0
  67. package/dist/esm/types/src/packages/tabs/tabs.d.ts +1 -1
  68. package/dist/esm/types/src/packages/toast/index.taro.d.ts +1 -1
  69. package/dist/esm/types/src/packages/uploader/demo.d.ts +1 -0
  70. package/dist/esm/types/src/packages/uploader/upload.d.ts +4 -0
  71. package/dist/esm/types/src/packages/uploader/uploader.d.ts +16 -12
  72. package/dist/esm/types/src/utils/date.d.ts +1 -1
  73. package/dist/esm/types/src/utils/useWatch.d.ts +6 -0
  74. package/dist/locales/base.js +1 -1
  75. package/dist/locales/en-US.js +1 -1
  76. package/dist/locales/id-ID.js +1 -1
  77. package/dist/locales/zh-CN.js +1 -1
  78. package/dist/locales/zh-TW.js +1 -1
  79. package/dist/nutui.react.es.js +1002 -616
  80. package/dist/nutui.react.umd.js +1002 -615
  81. package/dist/packages/barrage/barrage.scss +7 -2
  82. package/dist/packages/circleprogress/circleprogress.scss +3 -0
  83. package/dist/packages/sticky/sticky.scss +0 -0
  84. package/dist/style.css +1 -1
  85. package/dist/style.es.js +1 -1
  86. package/dist/styles/themes/default.scss +1 -0
  87. package/dist/types/index.d.ts +37 -24
  88. package/dist/types/nutui.react.build.ts +3 -1
  89. package/package.json +10 -5
  90. package/dist/esm/render-4a3856cb.js +0 -32
@@ -42,14 +42,14 @@ var MenuItem = function MenuItem(props) {
42
42
  value = _defaultProps$props.value,
43
43
  columns = _defaultProps$props.columns,
44
44
  title = _defaultProps$props.title,
45
- iconClassPrefix = _defaultProps$props.iconClassPrefix,
46
- fontClassName = _defaultProps$props.fontClassName,
47
45
  optionsIcon = _defaultProps$props.optionsIcon,
48
46
  direction = _defaultProps$props.direction,
49
47
  onChange = _defaultProps$props.onChange,
50
48
  activeTitleClass = _defaultProps$props.activeTitleClass,
51
49
  inactiveTitleClass = _defaultProps$props.inactiveTitleClass,
52
- children = _defaultProps$props.children;
50
+ children = _defaultProps$props.children,
51
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
52
+ iconFontClassName = _defaultProps$props.iconFontClassName;
53
53
 
54
54
  var activeColor = mergedProps.activeColor,
55
55
  showPopup = mergedProps.showPopup,
@@ -180,8 +180,8 @@ var MenuItem = function MenuItem(props) {
180
180
  handleClick(item);
181
181
  }
182
182
  }, item.value === _value ? React__default.createElement(Icon, {
183
- classPrefix: props.iconClassPrefix,
184
- fontClassName: props.iconFontClassName,
183
+ classPrefix: iconClassPrefix,
184
+ fontClassName: iconFontClassName,
185
185
  className: getIconCName(item.value, value),
186
186
  name: optionsIcon,
187
187
  color: activeColor
@@ -45,7 +45,9 @@ var NavBar = function NavBar(props) {
45
45
  onClickTitle = _defaultProps$props.onClickTitle,
46
46
  onClickIcon = _defaultProps$props.onClickIcon,
47
47
  onClickBack = _defaultProps$props.onClickBack,
48
- onClickRight = _defaultProps$props.onClickRight;
48
+ onClickRight = _defaultProps$props.onClickRight,
49
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
50
+ iconFontClassName = _defaultProps$props.iconFontClassName;
49
51
 
50
52
  var b = cn('navbar');
51
53
  var children = Array.isArray(props.children) ? props.children : [props.children];
@@ -72,8 +74,8 @@ var NavBar = function NavBar(props) {
72
74
  return onClickBack(e);
73
75
  }
74
76
  }, leftShow && React__default.createElement(Icon, {
75
- classPrefix: props.iconClassPrefix,
76
- fontClassName: props.iconFontClassName,
77
+ classPrefix: iconClassPrefix,
78
+ fontClassName: iconFontClassName,
77
79
  name: "left",
78
80
  color: "#979797"
79
81
  }), leftText && React__default.createElement("div", {
@@ -94,8 +96,8 @@ var NavBar = function NavBar(props) {
94
96
  return onClickIcon(e);
95
97
  }
96
98
  }, React__default.createElement(Icon, {
97
- classPrefix: props.iconClassPrefix,
98
- fontClassName: props.iconFontClassName,
99
+ classPrefix: iconClassPrefix,
100
+ fontClassName: iconFontClassName,
99
101
  name: titIcon
100
102
  })), slot.content);
101
103
  };
@@ -52,7 +52,9 @@ var NoticeBar = function NoticeBar(props) {
52
52
  speed = _defaultProps$props.speed,
53
53
  rightIcon = _defaultProps$props.rightIcon,
54
54
  close = _defaultProps$props.close,
55
- click = _defaultProps$props.click;
55
+ click = _defaultProps$props.click,
56
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
57
+ iconFontClassName = _defaultProps$props.iconFontClassName;
56
58
 
57
59
  var wrap = useRef(null);
58
60
  var content = useRef(null);
@@ -322,8 +324,8 @@ var NoticeBar = function NoticeBar(props) {
322
324
  backgroundImage: "url(".concat(iconBg() || '', ")")
323
325
  }
324
326
  }, !iconBg() ? React__default.createElement(Icon, {
325
- classPrefix: props.iconClassPrefix,
326
- fontClassName: props.iconFontClassName,
327
+ classPrefix: iconClassPrefix,
328
+ fontClassName: iconFontClassName,
327
329
  name: "notice",
328
330
  size: "16",
329
331
  color: color
@@ -339,8 +341,8 @@ var NoticeBar = function NoticeBar(props) {
339
341
  className: "right-icon",
340
342
  onClick: onClickIcon
341
343
  }, React__default.createElement(Icon, {
342
- classPrefix: props.iconClassPrefix,
343
- fontClassName: props.iconFontClassName,
344
+ classPrefix: iconClassPrefix,
345
+ fontClassName: iconFontClassName,
344
346
  name: rightIcon || 'close',
345
347
  color: color
346
348
  })) : null) : null, scrollList.current.length > 0 && direction === 'vertical' ? React__default.createElement("div", {
@@ -373,8 +375,8 @@ var NoticeBar = function NoticeBar(props) {
373
375
  handleClickIcon();
374
376
  }
375
377
  }, rightIcon || (closeMode ? React__default.createElement(Icon, {
376
- classPrefix: props.iconClassPrefix,
377
- fontClassName: props.iconFontClassName,
378
+ classPrefix: iconClassPrefix,
379
+ fontClassName: iconFontClassName,
378
380
  name: "cross",
379
381
  color: color,
380
382
  size: "11px"
@@ -19,7 +19,7 @@ import * as ReactDOM from 'react-dom';
19
19
  import classNames from 'classnames';
20
20
  import { CSSTransition } from 'react-transition-group';
21
21
  import { c as cn } from './bem-893ad28d.js';
22
- import { r as render } from './render-4a3856cb.js';
22
+ import { r as render } from './render-18227751.js';
23
23
  import '@bem-react/classname';
24
24
 
25
25
  var Notification = /*#__PURE__*/function (_React$PureComponent) {
@@ -7,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _typeof from "@babel/runtime/helpers/typeof";
10
- var _excluded = ["children", "list", "theme", "location", "visible", "offset", "className", "style", "onClick", "onChoose"];
10
+ var _excluded = ["children", "list", "theme", "location", "visible", "offset", "className", "style", "onClick", "onChoose", "iconClassPrefix", "iconFontClassName"];
11
11
 
12
12
  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
13
 
@@ -126,6 +126,8 @@ var Popover = function Popover(props) {
126
126
  style = _defaultProps$props.style,
127
127
  onClick = _defaultProps$props.onClick,
128
128
  onChoose = _defaultProps$props.onChoose,
129
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
130
+ iconFontClassName = _defaultProps$props.iconFontClassName,
129
131
  reset = _objectWithoutProperties(_defaultProps$props, _excluded);
130
132
 
131
133
  var goodItem = useRef(null);
@@ -240,8 +242,8 @@ var Popover = function Popover(props) {
240
242
  handleChoose(item, i);
241
243
  }
242
244
  }, item.icon ? React__default.createElement(Icon, {
243
- classPrefix: props.iconClassPrefix,
244
- fontClassName: props.iconFontClassName,
245
+ classPrefix: iconClassPrefix,
246
+ fontClassName: iconFontClassName,
245
247
  className: "popover-menu-item-img",
246
248
  name: item.icon
247
249
  }) : '', React__default.createElement("div", {
package/dist/esm/Popup.js CHANGED
@@ -68,7 +68,9 @@ var Popup = function Popup(props) {
68
68
  onClickCloseIcon = props.onClickCloseIcon,
69
69
  onOpened = props.onOpened,
70
70
  onClosed = props.onClosed,
71
- onClick = props.onClick;
71
+ onClick = props.onClick,
72
+ iconClassPrefix = props.iconClassPrefix,
73
+ iconFontClassName = props.iconFontClassName;
72
74
 
73
75
  var _useState = useState(zIndex || _zIndex),
74
76
  _useState2 = _slicedToArray(_useState, 2),
@@ -187,8 +189,8 @@ var Popup = function Popup(props) {
187
189
  className: closeClasses,
188
190
  onClick: onHandleClickCloseIcon
189
191
  }, React__default.createElement(Icon, {
190
- classPrefix: props.iconClassPrefix,
191
- fontClassName: props.iconFontClassName,
192
+ classPrefix: iconClassPrefix,
193
+ fontClassName: iconFontClassName,
192
194
  name: closeIcon,
193
195
  size: "12px"
194
196
  })) : ''));
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["name", "size", "classPrefix", "color", "tag", "children", "className", "fontClassName", "style", "onClick"],
4
- _excluded2 = ["className", "style", "isShowPercentage", "percentage", "fillColor", "strokeColor", "strokeWidth", "size", "textColor", "textWidth", "showText", "textInside", "textBackground", "textType", "status", "iconName", "iconColor", "iconSize", "rounded", "children"];
4
+ _excluded2 = ["className", "style", "isShowPercentage", "percentage", "fillColor", "strokeColor", "strokeWidth", "size", "textColor", "textWidth", "showText", "textInside", "textBackground", "textType", "status", "iconName", "iconColor", "iconSize", "rounded", "children", "iconClassPrefix", "iconFontClassName"];
5
5
 
6
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; }
7
7
 
@@ -120,6 +120,8 @@ var Progress = function Progress(props) {
120
120
  iconSize = _defaultProps$props.iconSize,
121
121
  rounded = _defaultProps$props.rounded,
122
122
  children = _defaultProps$props.children,
123
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
124
+ iconFontClassName = _defaultProps$props.iconFontClassName,
123
125
  rest = _objectWithoutProperties(_defaultProps$props, _excluded2);
124
126
 
125
127
  var b = cn('progress');
@@ -182,8 +184,8 @@ var Progress = function Progress(props) {
182
184
  color: textColor || '#333'
183
185
  }
184
186
  }, percentage, isShowPercentage ? '%' : ''), textType === 'icon' && React__default.createElement(Icon, {
185
- classPrefix: props.iconClassPrefix,
186
- fontClassName: props.iconFontClassName,
187
+ classPrefix: iconClassPrefix,
188
+ fontClassName: iconFontClassName,
187
189
  size: iconSize,
188
190
  name: iconName,
189
191
  color: iconColor
@@ -11,36 +11,7 @@ import React__default, { useState, useRef, useEffect } from 'react';
11
11
  import { useDrag } from '@use-gesture/react';
12
12
  import { useSpring, animated } from '@react-spring/web';
13
13
  import { useConfig } from './ConfigProvider.js';
14
- var canUseDom = !!(typeof window !== 'undefined' && typeof document !== 'undefined' && window.document && window.document.createElement);
15
- var defaultRoot = canUseDom ? window : undefined;
16
- var overflowStylePatterns = ['scroll', 'auto', 'overlay'];
17
-
18
- function isElement(node) {
19
- var ELEMENT_NODE_TYPE = 1;
20
- return node.nodeType === ELEMENT_NODE_TYPE;
21
- }
22
-
23
- function getScrollParent(el) {
24
- var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultRoot;
25
- var node = el;
26
-
27
- while (node && node !== root && isElement(node)) {
28
- if (node === document.body) {
29
- return root;
30
- }
31
-
32
- var _window$getComputedSt = window.getComputedStyle(node),
33
- overflowY = _window$getComputedSt.overflowY;
34
-
35
- if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
36
- return node;
37
- }
38
-
39
- node = node.parentNode;
40
- }
41
-
42
- return root;
43
- }
14
+ import { c as canUseDom, g as getScrollParent } from './get-scroll-parent-3dcd3f53.js';
44
15
 
45
16
  function bound(position, min, max) {
46
17
  var ret = position;
package/dist/esm/Radio.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 = ["className", "disabled", "checked", "shape", "textPosition", "value", "iconName", "iconActiveName", "iconSize", "onChange"];
4
+ var _excluded = ["className", "disabled", "checked", "shape", "textPosition", "value", "iconName", "iconActiveName", "iconSize", "onChange", "iconClassPrefix", "iconFontClassName"];
5
5
 
6
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; }
7
7
 
@@ -41,6 +41,8 @@ var Radio = function Radio(props) {
41
41
  iconActiveName = props.iconActiveName,
42
42
  iconSize = props.iconSize,
43
43
  onChange = props.onChange,
44
+ iconClassPrefix = props.iconClassPrefix,
45
+ iconFontClassName = props.iconFontClassName,
44
46
  rest = _objectWithoutProperties(props, _excluded);
45
47
 
46
48
  var componentName = 'nut-radio';
@@ -96,8 +98,8 @@ var Radio = function Radio(props) {
96
98
  iconSize = props.iconSize,
97
99
  iconActiveName = props.iconActiveName;
98
100
  return React__default.createElement(Icon, {
99
- classPrefix: props.iconClassPrefix,
100
- fontClassName: props.iconFontClassName,
101
+ classPrefix: iconClassPrefix,
102
+ fontClassName: iconFontClassName,
101
103
  name: checkedStatement ? iconActiveName : iconName,
102
104
  size: iconSize,
103
105
  className: color()
package/dist/esm/Rate.js CHANGED
@@ -40,7 +40,9 @@ var Rate = function Rate(props) {
40
40
  readonly = _defaultProps$props.readonly,
41
41
  allowHalf = _defaultProps$props.allowHalf,
42
42
  spacing = _defaultProps$props.spacing,
43
- onChange = _defaultProps$props.onChange;
43
+ onChange = _defaultProps$props.onChange,
44
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
45
+ iconFontClassName = _defaultProps$props.iconFontClassName;
44
46
 
45
47
  var b = cn('rate');
46
48
  var bi = cn('rate-item');
@@ -81,7 +83,7 @@ var Rate = function Rate(props) {
81
83
  value = index;
82
84
 
83
85
  if (allowHalf) {
84
- if (e !== null && e !== void 0 && e.target.className.includes('__icon--half')) {
86
+ if ((e === null || e === void 0 ? void 0 : e.target).className.includes('__icon--half')) {
85
87
  value -= 0.5;
86
88
  }
87
89
  }
@@ -104,22 +106,22 @@ var Rate = function Rate(props) {
104
106
  marginRight: pxCheck(spacing)
105
107
  }
106
108
  }, React__default.createElement(Icon, {
107
- classPrefix: props.iconClassPrefix,
108
- fontClassName: props.iconFontClassName,
109
+ classPrefix: iconClassPrefix,
110
+ fontClassName: iconFontClassName,
109
111
  size: iconSize,
110
112
  className: "".concat(bi('icon'), " ").concat(disabled || n > score ? bi('icon--disabled') : ''),
111
113
  name: n <= score ? checkedIcon : uncheckedIcon,
112
114
  color: n <= score ? activeColor : voidColor
113
115
  }), allowHalf && score > n - 1 && React__default.createElement(Icon, {
114
- classPrefix: props.iconClassPrefix,
115
- fontClassName: props.iconFontClassName,
116
+ classPrefix: iconClassPrefix,
117
+ fontClassName: iconFontClassName,
116
118
  className: "".concat(bi('icon'), " ").concat(bi('icon--half')),
117
119
  color: n <= score ? activeColor : voidColor,
118
120
  size: iconSize,
119
121
  name: checkedIcon
120
122
  }), allowHalf && score < n - 1 && React__default.createElement(Icon, {
121
- classPrefix: props.iconClassPrefix,
122
- fontClassName: props.iconFontClassName,
123
+ classPrefix: iconClassPrefix,
124
+ fontClassName: iconFontClassName,
123
125
  className: "".concat(bi('icon'), " ").concat(bi('icon--disabled'), " ").concat(bi('icon--half')),
124
126
  color: voidColor,
125
127
  size: iconSize,
@@ -68,7 +68,9 @@ var SearchBar = function SearchBar(props) {
68
68
  onClickLeftinIcon = _defaultProps$props.onClickLeftinIcon,
69
69
  onClickLeftoutIcon = _defaultProps$props.onClickLeftoutIcon,
70
70
  onClickRightinIcon = _defaultProps$props.onClickRightinIcon,
71
- onClickRightoutIcon = _defaultProps$props.onClickRightoutIcon;
71
+ onClickRightoutIcon = _defaultProps$props.onClickRightoutIcon,
72
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
73
+ iconFontClassName = _defaultProps$props.iconFontClassName;
72
74
 
73
75
  var alignClass = "".concat(align);
74
76
 
@@ -194,8 +196,8 @@ var SearchBar = function SearchBar(props) {
194
196
  return clearaVal(e);
195
197
  }
196
198
  }, React__default.createElement(Icon, {
197
- classPrefix: props.iconClassPrefix,
198
- fontClassName: props.iconFontClassName,
199
+ classPrefix: iconClassPrefix,
200
+ fontClassName: iconFontClassName,
199
201
  name: "circle-close",
200
202
  size: "12",
201
203
  color: "#555"
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "onChange", "onOk", "onTips", "onCancel", "onClose", "onComplete"];
5
+ var _excluded = ["title", "desc", "tips", "visible", "modelValue", "errorMsg", "noButton", "closeOnClickOverlay", "length", "style", "className", "onChange", "onOk", "onTips", "onCancel", "onClose", "onComplete", "iconClassPrefix", "iconFontClassName"];
6
6
 
7
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; }
8
8
 
@@ -56,6 +56,8 @@ var ShortPassword = function ShortPassword(props) {
56
56
  onCancel = props.onCancel,
57
57
  onClose = props.onClose,
58
58
  onComplete = props.onComplete,
59
+ iconClassPrefix = props.iconClassPrefix,
60
+ iconFontClassName = props.iconFontClassName,
59
61
  reset = _objectWithoutProperties(props, _excluded);
60
62
 
61
63
  var b = cn('shortpassword');
@@ -191,8 +193,8 @@ var ShortPassword = function ShortPassword(props) {
191
193
  }, errorMsg), tips || locale.shortpassword.tips ? React__default.createElement("div", {
192
194
  className: b('message__forget')
193
195
  }, React__default.createElement(Icon, {
194
- classPrefix: props.iconClassPrefix,
195
- fontClassName: props.iconFontClassName,
196
+ classPrefix: iconClassPrefix,
197
+ fontClassName: iconFontClassName,
196
198
  className: "icon",
197
199
  size: "11px",
198
200
  name: "tips"
package/dist/esm/Step.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", "title", "content", "activeIndex", "icon", "iconColor", "size", "className", "renderContent"];
3
+ var _excluded = ["children", "title", "content", "activeIndex", "icon", "iconColor", "size", "className", "renderContent", "iconClassPrefix", "iconFontClassName"];
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
 
@@ -34,6 +34,8 @@ var Step = function Step(props) {
34
34
  size = _defaultProps$props.size,
35
35
  className = _defaultProps$props.className,
36
36
  renderContent = _defaultProps$props.renderContent,
37
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
38
+ iconFontClassName = _defaultProps$props.iconFontClassName,
37
39
  restProps = _objectWithoutProperties(_defaultProps$props, _excluded);
38
40
 
39
41
  var parent = useContext(DataContext);
@@ -81,8 +83,8 @@ var Step = function Step(props) {
81
83
  }), React__default.createElement("div", {
82
84
  className: renderIconClass()
83
85
  }, icon ? React__default.createElement(Icon, {
84
- classPrefix: props.iconClassPrefix,
85
- fontClassName: props.iconFontClassName,
86
+ classPrefix: iconClassPrefix,
87
+ fontClassName: iconFontClassName,
86
88
  className: "nut-step-icon-inner",
87
89
  color: iconColor,
88
90
  name: icon,
@@ -0,0 +1,2 @@
1
+
2
+ import '../../../packages/sticky/sticky.scss'
@@ -0,0 +1,209 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["position", "top", "bottom", "zIndex", "children", "container", "className", "onChange"];
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; }
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; }
9
+
10
+ import React__default, { useRef, useEffect, useState, useCallback } from 'react';
11
+ import { g as getScrollParent } from './get-scroll-parent-3dcd3f53.js';
12
+ import { g as getRect } from './useClientRect-839d18c5.js';
13
+
14
+ function useWatch(dep, callback) {
15
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
16
+ immediate: false
17
+ };
18
+ var immediate = config.immediate;
19
+ var prev = useRef();
20
+ var inited = useRef(false);
21
+ var stop = useRef(false);
22
+ useEffect(function () {
23
+ var execute = function execute() {
24
+ return callback(prev.current);
25
+ };
26
+
27
+ if (!stop.current) {
28
+ if (!inited.current) {
29
+ inited.current = true;
30
+
31
+ if (immediate) {
32
+ execute();
33
+ }
34
+ } else {
35
+ execute();
36
+ }
37
+
38
+ prev.current = dep;
39
+ }
40
+ }, [dep]);
41
+ return function () {
42
+ stop.current = true;
43
+ };
44
+ }
45
+
46
+ var Sticky = function Sticky(props) {
47
+ var _useState5;
48
+
49
+ var _props$position = props.position,
50
+ position = _props$position === void 0 ? 'top' : _props$position,
51
+ _props$top = props.top,
52
+ top = _props$top === void 0 ? 0 : _props$top,
53
+ _props$bottom = props.bottom,
54
+ bottom = _props$bottom === void 0 ? 0 : _props$bottom,
55
+ _props$zIndex = props.zIndex,
56
+ zIndex = _props$zIndex === void 0 ? 2000 : _props$zIndex,
57
+ children = props.children,
58
+ container = props.container,
59
+ className = props.className,
60
+ onChange = props.onChange,
61
+ rest = _objectWithoutProperties(props, _excluded); // const { locale } = useConfig()
62
+
63
+
64
+ var stickyRef = useRef(null);
65
+ var rootRef = useRef(null);
66
+ var offset = position === 'top' ? top : bottom;
67
+
68
+ var _useState = useState(false),
69
+ _useState2 = _slicedToArray(_useState, 2),
70
+ isFixed = _useState2[0],
71
+ setIsFixed = _useState2[1];
72
+
73
+ var _useState3 = useState((_useState5 = {}, _defineProperty(_useState5, position, "".concat(offset, "px")), _defineProperty(_useState5, "zIndex", zIndex), _useState5)),
74
+ _useState4 = _slicedToArray(_useState3, 2),
75
+ stickyStyle = _useState4[0],
76
+ setStickyStyle = _useState4[1];
77
+
78
+ var _useState6 = useState({}),
79
+ _useState7 = _slicedToArray(_useState6, 2),
80
+ rootStyle = _useState7[0],
81
+ setRootStyle = _useState7[1];
82
+
83
+ var getElement = useCallback(function () {
84
+ // if (!rootRef.current) return Window
85
+ return getScrollParent(rootRef.current);
86
+ }, []);
87
+ useEffect(function () {
88
+ if (position === 'top') return;
89
+ var containerEle = container === null || container === void 0 ? void 0 : container.current;
90
+ if (!rootRef.current && !containerEle) return;
91
+ var rootRect = getRect(rootRef.current);
92
+ var containerRect = getRect(containerEle);
93
+ var clientHeight = document.documentElement.clientHeight;
94
+ var stCurrent = stickyRef.current;
95
+ var stickyRect = getRect(stCurrent);
96
+ var fixed = clientHeight - bottom < rootRect.bottom;
97
+
98
+ if (containerEle) {
99
+ fixed = containerRect.bottom > clientHeight - bottom - stickyRect.height && clientHeight - bottom - stickyRect.height > containerRect.top;
100
+ }
101
+
102
+ var defaultPostVal = fixed ? 'fixed' : 'inherit';
103
+ setStickyStyle(function (prev) {
104
+ return _objectSpread(_objectSpread({}, prev), {}, {
105
+ position: defaultPostVal
106
+ });
107
+ });
108
+ setIsFixed(fixed);
109
+ }, [position, container, bottom]);
110
+ var handleScroll = useCallback(function () {
111
+ var containerEle = container === null || container === void 0 ? void 0 : container.current;
112
+ if (!rootRef.current && !containerEle) return;
113
+ var rootRect = getRect(rootRef.current);
114
+ var stCurrent = stickyRef.current;
115
+ var stickyRect = getRect(stCurrent);
116
+ var containerRect = getRect(containerEle);
117
+
118
+ if (rootRect.height) {
119
+ setRootStyle(function (prev) {
120
+ return _objectSpread(_objectSpread({}, prev), {}, {
121
+ height: rootRect.height
122
+ });
123
+ });
124
+ }
125
+
126
+ if (position === 'top') {
127
+ // containerRect.bottom > top + stickyRect.height
128
+ if (containerEle) {
129
+ var fixed = top > rootRect.top && containerRect.bottom > 0;
130
+ var positionVal = fixed ? 'fixed' : 'inherit';
131
+ var diff = containerRect.bottom - top - stickyRect.height;
132
+ var transform = diff < 0 ? diff : 0;
133
+ setStickyStyle(function (prev) {
134
+ return _objectSpread(_objectSpread({}, prev), {}, {
135
+ position: positionVal,
136
+ transform: "translate3d(0, ".concat(transform, "px, 0)")
137
+ });
138
+ });
139
+ setIsFixed(fixed);
140
+ } else {
141
+ var _fixed = top > rootRect.top;
142
+
143
+ var _positionVal = _fixed ? 'fixed' : 'inherit';
144
+
145
+ setStickyStyle(function (prev) {
146
+ return _objectSpread(_objectSpread({}, prev), {}, {
147
+ position: _positionVal
148
+ });
149
+ });
150
+ setIsFixed(_fixed);
151
+ }
152
+ } else {
153
+ var clientHeight = document.documentElement.clientHeight;
154
+
155
+ if (containerEle) {
156
+ // clientHeight - bottom - stickyRect.height
157
+ var _fixed2 = containerRect.bottom > 0 && clientHeight - bottom - stickyRect.height > containerRect.top;
158
+
159
+ var _positionVal2 = _fixed2 ? 'fixed' : 'inherit';
160
+
161
+ var _diff = containerRect.bottom - (clientHeight - bottom);
162
+
163
+ var _transform = _diff < 0 ? _diff : 0;
164
+
165
+ setStickyStyle(function (prev) {
166
+ return _objectSpread(_objectSpread({}, prev), {}, {
167
+ position: _positionVal2,
168
+ transform: "translate3d(0, ".concat(_transform, "px, 0)")
169
+ });
170
+ });
171
+ setIsFixed(_fixed2);
172
+ } else {
173
+ var _fixed3 = clientHeight - bottom < rootRect.bottom;
174
+
175
+ var _positionVal3 = _fixed3 ? 'fixed' : 'inherit';
176
+
177
+ setStickyStyle(function (prev) {
178
+ return _objectSpread(_objectSpread({}, prev), {}, {
179
+ position: _positionVal3
180
+ });
181
+ });
182
+ setIsFixed(_fixed3);
183
+ }
184
+ }
185
+ }, [position, bottom, container, top]);
186
+ useWatch(isFixed, function () {
187
+ onChange && onChange(isFixed);
188
+ });
189
+ useEffect(function () {
190
+ var el = getElement();
191
+ el.addEventListener('scroll', handleScroll, false);
192
+ return function () {
193
+ el.removeEventListener('tap', handleScroll);
194
+ };
195
+ }, [getElement, handleScroll]);
196
+ return React__default.createElement("div", _objectSpread({
197
+ ref: rootRef,
198
+ style: rootStyle,
199
+ className: "nut-sticky ".concat(className)
200
+ }, rest), React__default.createElement("div", {
201
+ className: "nut-sticky-box",
202
+ ref: stickyRef,
203
+ style: stickyStyle
204
+ }, children));
205
+ }; // Sticky.defaultProps = defaultProps
206
+
207
+
208
+ Sticky.displayName = 'NutSticky';
209
+ export { Sticky as default };
@@ -41,7 +41,9 @@ var TabbarItem = function TabbarItem(props) {
41
41
  activeColor = _defaultProps$props.activeColor,
42
42
  unactiveColor = _defaultProps$props.unactiveColor,
43
43
  index = _defaultProps$props.index,
44
- handleClick = _defaultProps$props.handleClick;
44
+ handleClick = _defaultProps$props.handleClick,
45
+ iconClassPrefix = _defaultProps$props.iconClassPrefix,
46
+ iconFontClassName = _defaultProps$props.iconFontClassName;
45
47
 
46
48
  var b = cn('tabbar-item');
47
49
  var bIcon = cn('tabbar-item__icon-box');
@@ -75,8 +77,8 @@ var TabbarItem = function TabbarItem(props) {
75
77
  }, "99+")) : React__default.createElement("div", {
76
78
  className: "".concat(bIcon('dot'))
77
79
  }), icon && React__default.createElement("div", null, React__default.createElement(Icon, {
78
- classPrefix: props.iconClassPrefix,
79
- fontClassName: props.iconFontClassName,
80
+ classPrefix: iconClassPrefix,
81
+ fontClassName: iconFontClassName,
80
82
  size: size,
81
83
  name: icon
82
84
  })), React__default.createElement("div", {