@nutui/nutui-react 0.1.0-beta.1 → 0.1.2

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 (167) hide show
  1. package/README.md +50 -135
  2. package/dist/esm/ActionSheet/style/index.js +1 -0
  3. package/dist/esm/Address/style/index.js +1 -0
  4. package/dist/esm/AnimatingNumbers/style/index.js +1 -0
  5. package/dist/esm/Avatar/style/index.js +1 -0
  6. package/dist/esm/BackTop/style/index.js +1 -0
  7. package/dist/esm/BackTop.js +1 -3
  8. package/dist/esm/Badge/style/index.js +1 -0
  9. package/dist/esm/Barrage/style/index.js +1 -0
  10. package/dist/esm/Button/style/index.js +1 -0
  11. package/dist/esm/Button.js +110 -4
  12. package/dist/esm/Calendar/style/index.js +1 -0
  13. package/dist/esm/Calendar.js +86 -0
  14. package/dist/esm/CalendarItem/style/index.js +1 -0
  15. package/dist/esm/CalendarItem.js +554 -0
  16. package/dist/esm/Cell/style/index.js +1 -0
  17. package/dist/esm/Cell.js +1 -1
  18. package/dist/esm/CellGroup/style/index.js +1 -0
  19. package/dist/esm/CellGroup.js +33 -0
  20. package/dist/esm/Checkbox/style/index.js +1 -0
  21. package/dist/esm/Checkbox.js +1 -1
  22. package/dist/esm/CheckboxGroup/style/index.js +1 -0
  23. package/dist/esm/CircleProgress/style/index.js +1 -0
  24. package/dist/esm/Col/style/index.js +1 -0
  25. package/dist/esm/Col.js +60 -0
  26. package/dist/esm/Collapse/style/index.js +1 -0
  27. package/dist/esm/CollapseItem/style/index.js +1 -0
  28. package/dist/esm/CollapseItem.js +142 -0
  29. package/dist/esm/Dialog/style/index.js +1 -0
  30. package/dist/esm/Dialog.js +327 -0
  31. package/dist/esm/Divider/style/index.js +1 -0
  32. package/dist/esm/Drag/style/index.js +1 -0
  33. package/dist/esm/Drag.js +83 -140
  34. package/dist/esm/Elevator/style/index.js +1 -0
  35. package/dist/esm/Elevator.js +3 -6
  36. package/dist/esm/FixedNav/style/index.js +1 -0
  37. package/dist/esm/FixedNav.js +2 -2
  38. package/dist/esm/Icon/style/index.js +1 -0
  39. package/dist/esm/Icon.js +70 -4
  40. package/dist/esm/Infiniteloading/style/index.js +1 -0
  41. package/dist/esm/Input/style/index.js +1 -0
  42. package/dist/esm/Input.js +1 -1
  43. package/dist/esm/InputNumber/style/index.js +1 -0
  44. package/dist/esm/Layout/style/index.js +1 -0
  45. package/dist/esm/NavBar/style/index.js +1 -0
  46. package/dist/esm/NavBar.js +1 -1
  47. package/dist/esm/NoticeBar/style/index.js +1 -0
  48. package/dist/esm/NoticeBar.js +1 -1
  49. package/dist/esm/Notify/style/index.js +1 -0
  50. package/dist/esm/Overlay/style/index.js +1 -0
  51. package/dist/esm/Pagination/style/index.js +1 -0
  52. package/dist/esm/Picker/style/index.js +1 -0
  53. package/dist/esm/Picker.js +397 -0
  54. package/dist/esm/Popover/style/index.js +1 -0
  55. package/dist/esm/Popover.js +299 -0
  56. package/dist/esm/Popup/style/index.js +1 -0
  57. package/dist/esm/Popup.js +0 -3
  58. package/dist/esm/Price/style/index.js +1 -0
  59. package/dist/esm/Radio/style/index.js +1 -0
  60. package/dist/esm/Radio.js +2 -3
  61. package/dist/esm/RadioGroup/style/index.js +1 -0
  62. package/dist/esm/Range/style/index.js +1 -0
  63. package/dist/esm/Range.js +1 -4
  64. package/dist/esm/Rate/style/index.js +1 -0
  65. package/dist/esm/Rate.js +1 -1
  66. package/dist/esm/Row/style/index.js +1 -0
  67. package/dist/esm/Row.js +48 -0
  68. package/dist/esm/ShortPassword/style/index.js +1 -0
  69. package/dist/esm/ShortPassword.js +203 -0
  70. package/dist/esm/Signature/style/index.js +1 -0
  71. package/dist/esm/Signature.js +1 -2
  72. package/dist/esm/Step/style/index.js +1 -0
  73. package/dist/esm/Steps/style/index.js +1 -0
  74. package/dist/esm/Swiper/style/index.js +1 -0
  75. package/dist/esm/Swiper.js +517 -0
  76. package/dist/esm/SwiperItem/style/index.js +1 -0
  77. package/dist/esm/SwiperItem.js +64 -0
  78. package/dist/esm/Switch/style/index.js +1 -0
  79. package/dist/esm/Switch.js +85 -0
  80. package/dist/esm/Tabbar/style/index.js +1 -0
  81. package/dist/esm/Tabbar.js +1 -4
  82. package/dist/esm/TabbarItem/style/index.js +1 -0
  83. package/dist/esm/TabbarItem.js +1 -1
  84. package/dist/esm/Tag/style/index.js +1 -0
  85. package/dist/esm/TextArea/style/index.js +1 -0
  86. package/dist/esm/Toast/style/index.js +1 -0
  87. package/dist/esm/Toast.js +294 -7
  88. package/dist/esm/Uploader/style/index.js +1 -0
  89. package/dist/esm/UserContext-b4181162.js +3 -0
  90. package/dist/esm/UserContext-be8097d2.js +3 -0
  91. package/dist/esm/date-649fe493.js +112 -0
  92. package/dist/esm/nutui-react.es.js +28 -15
  93. package/dist/esm/types/src/packages/calendar/calendar.d.ts +14 -0
  94. package/dist/esm/types/src/packages/calendar/index.d.ts +2 -0
  95. package/dist/esm/types/src/packages/calendaritem/calendaritem.d.ts +17 -0
  96. package/dist/esm/types/src/packages/calendaritem/index.d.ts +2 -0
  97. package/dist/esm/types/src/packages/dialog/Confirm.d.ts +7 -0
  98. package/dist/esm/types/src/packages/dialog/Content.d.ts +10 -0
  99. package/dist/esm/types/src/packages/dialog/DialogWrap.d.ts +11 -0
  100. package/dist/esm/types/src/packages/dialog/DialogWrapper.d.ts +8 -0
  101. package/dist/esm/types/src/packages/dialog/Mask.d.ts +3 -0
  102. package/dist/esm/types/src/packages/dialog/config.d.ts +46 -0
  103. package/dist/esm/types/src/packages/dialog/dialog.d.ts +2 -0
  104. package/dist/esm/types/src/packages/dialog/index.d.ts +2 -0
  105. package/dist/esm/types/src/packages/drag/drag.d.ts +1 -1
  106. package/dist/esm/types/src/packages/nutui.react.build.d.ts +29 -16
  107. package/dist/esm/types/src/packages/nutui.react.d.ts +29 -16
  108. package/dist/esm/types/src/packages/picker/index.d.ts +2 -0
  109. package/dist/esm/types/src/packages/picker/picker.d.ts +19 -0
  110. package/dist/esm/types/src/packages/picker/pickerSlot.d.ts +10 -0
  111. package/dist/esm/types/src/packages/popover/Trigger.d.ts +21 -0
  112. package/dist/esm/types/src/packages/popover/index.d.ts +2 -0
  113. package/dist/esm/types/src/packages/popover/popover.d.ts +13 -0
  114. package/dist/esm/types/src/packages/row/UserContext.d.ts +1 -0
  115. package/dist/esm/types/src/packages/shortpassword/index.d.ts +2 -0
  116. package/dist/esm/types/src/packages/shortpassword/shortpassword.d.ts +21 -0
  117. package/dist/esm/types/src/packages/steps/UserContext.d.ts +1 -0
  118. package/dist/esm/types/src/packages/swiper/UserContext.d.ts +2 -0
  119. package/dist/esm/types/src/packages/swiper/index.d.ts +2 -0
  120. package/dist/esm/types/src/packages/swiper/swiper.d.ts +26 -0
  121. package/dist/esm/types/src/packages/swiperitem/index.d.ts +2 -0
  122. package/dist/esm/types/src/packages/swiperitem/swiperitem.d.ts +7 -0
  123. package/dist/nutui.react.es.js +10683 -4344
  124. package/dist/nutui.react.umd.js +26 -17
  125. package/dist/packages/actionsheet/actionsheet.scss +1 -0
  126. package/dist/packages/address/address.scss +3 -0
  127. package/dist/packages/animatingnumbers/animatingnumbers.scss +1 -1
  128. package/dist/packages/backtop/backtop.scss +1 -0
  129. package/dist/packages/button/button.scss +1 -1
  130. package/dist/packages/calendar/calendar.scss +200 -0
  131. package/dist/packages/calendaritem/calendaritem.scss +191 -0
  132. package/dist/packages/cell/cell.scss +2 -0
  133. package/dist/packages/checkbox/checkbox.scss +1 -1
  134. package/dist/packages/collapse/collapse.scss +1 -1
  135. package/dist/packages/collapseitem/collapseitem.scss +2 -0
  136. package/dist/packages/dialog/dialog.scss +129 -0
  137. package/dist/packages/drag/drag.scss +2 -1
  138. package/dist/packages/fixednav/fixednav.scss +5 -0
  139. package/dist/packages/icon/icon.scss +1 -1
  140. package/dist/packages/infiniteloading/infiniteloading.scss +1 -0
  141. package/dist/packages/input/input.scss +1 -0
  142. package/dist/packages/inputnumber/inputnumber.scss +1 -0
  143. package/dist/packages/navbar/navbar.scss +2 -0
  144. package/dist/packages/noticebar/noticebar.scss +2 -0
  145. package/dist/packages/picker/picker.scss +104 -0
  146. package/dist/packages/popover/popover.scss +142 -0
  147. package/dist/packages/popup/popup.scss +2 -0
  148. package/dist/packages/radio/radio.scss +2 -0
  149. package/dist/packages/range/range.scss +1 -0
  150. package/dist/packages/rate/rate.scss +2 -0
  151. package/dist/packages/shortpassword/shortpassword.scss +115 -0
  152. package/dist/packages/signature/signature.scss +1 -0
  153. package/dist/packages/step/step.scss +1 -0
  154. package/dist/packages/swiper/swiper.scss +45 -0
  155. package/dist/packages/swiperitem/swiperitem.scss +3 -0
  156. package/dist/packages/tabbaritem/{tabbarItem.scss → tabbaritem.scss} +2 -0
  157. package/dist/packages/tag/tag.scss +1 -0
  158. package/dist/packages/toast/toast.scss +2 -0
  159. package/dist/packages/uploader/uploader.scss +2 -0
  160. package/dist/style.css +1 -1
  161. package/dist/style.es.js +1 -1
  162. package/dist/styles/themes/default.scss +26 -16
  163. package/dist/styles/variables.scss +25 -0
  164. package/package.json +16 -5
  165. package/dist/esm/button-345fb015.js +0 -110
  166. package/dist/esm/icon-63c0d58f.js +0 -70
  167. package/dist/esm/toast-420b65b7.js +0 -294
package/dist/esm/Drag.js CHANGED
@@ -1,17 +1,20 @@
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 = ["attract", "direction", "boundary", "children", "className"];
4
+ var _excluded = ["attract", "direction", "boundary", "children", "className", "style"];
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, { useRef, useEffect } from 'react';
10
+ import React__default, { useState, useRef, useEffect } from 'react';
10
11
  import { c as cn } from './bem-893ad28d.js';
12
+ import { useDrag } from '@use-gesture/react';
13
+ import { useSpring, animated } from '@react-spring/web';
11
14
  import '@bem-react/classname';
12
15
  var defaultProps = {
13
16
  attract: false,
14
- direction: 'all',
17
+ direction: undefined,
15
18
  boundary: {
16
19
  top: 0,
17
20
  left: 0,
@@ -28,163 +31,103 @@ var Drag = function Drag(props) {
28
31
  boundary = _defaultProps$props.boundary,
29
32
  children = _defaultProps$props.children,
30
33
  className = _defaultProps$props.className,
34
+ style = _defaultProps$props.style,
31
35
  reset = _objectWithoutProperties(_defaultProps$props, _excluded);
32
36
 
33
37
  var b = cn('drag');
34
- var elWidth = useRef(0);
35
- var elHeight = useRef(0);
36
- var screenWidth = useRef(0);
37
- var screenHeight = useRef(0);
38
- var startTop = useRef(0);
39
- var startLeft = useRef(0);
40
- useRef(0);
41
- useRef(0);
42
- var xPum = useRef(0);
43
- var yPum = useRef(0);
44
- var position = useRef({
45
- x: 0,
46
- y: 0
47
- });
48
- useRef({
49
- top: 0,
50
- left: 0,
51
- right: 0,
52
- bottom: 0
53
- });
38
+
39
+ var _useState = useState(boundary),
40
+ _useState2 = _slicedToArray(_useState, 2),
41
+ boundaryState = _useState2[0],
42
+ setBoundaryState = _useState2[1];
43
+
54
44
  var myDrag = useRef(null);
55
45
 
46
+ var _useSpring = useSpring(function () {
47
+ return {
48
+ x: 0,
49
+ y: 0
50
+ };
51
+ }),
52
+ _useSpring2 = _slicedToArray(_useSpring, 2),
53
+ currstyle = _useSpring2[0],
54
+ api = _useSpring2[1];
55
+
56
+ var middleLine = useRef(0);
57
+
56
58
  var getInfo = function getInfo() {
57
59
  var el = myDrag.current;
58
60
 
59
61
  if (el) {
60
- var domElem = document.documentElement;
61
- elWidth.current = el.offsetWidth;
62
- elHeight.current = el.offsetHeight;
63
- screenWidth.current = domElem.clientWidth;
64
- screenHeight.current = domElem.clientHeight;
65
- }
66
- };
67
-
68
- var goLeft = function goLeft(target) {
69
- if (boundary.left) {
70
- if (+target.style.left.split('px')[0] > boundary.left) {
71
- target.style.left = +target.style.left.split('px')[0] - 10 + 'px';
72
- window.requestAnimationFrame(function () {
73
- goLeft(target);
74
- });
75
- } else {
76
- target.style.left = "".concat(boundary.left, "px");
77
- }
78
- } else {
79
- if (+target.style.left.split('px')[0] > 10) {
80
- target.style.left = +target.style.left.split('px')[0] - 10 + 'px';
81
- window.requestAnimationFrame(function () {
82
- goLeft(target);
83
- });
84
- } else {
85
- target.style.left = '0px';
86
- }
87
- }
88
- };
89
-
90
- var goRight = function goRight(target, rightLocation) {
91
- if (rightLocation - parseInt(target.style.left.split('px')[0]) > 10) {
92
- target.style.left = parseInt(target.style.left.split('px')[0]) + 10 + 'px';
93
- window.requestAnimationFrame(function () {
94
- goRight(target, rightLocation);
62
+ var offsetWidth = el.offsetWidth,
63
+ offsetHeight = el.offsetHeight,
64
+ offsetTop = el.offsetTop,
65
+ offsetLeft = el.offsetLeft;
66
+ var _document$documentEle = document.documentElement,
67
+ clientWidth = _document$documentEle.clientWidth,
68
+ clientHeight = _document$documentEle.clientHeight;
69
+ var top = boundary.top,
70
+ left = boundary.left,
71
+ bottom = boundary.bottom,
72
+ right = boundary.right;
73
+ setBoundaryState({
74
+ top: -offsetTop + top,
75
+ left: -offsetLeft + left,
76
+ bottom: clientHeight - offsetHeight - offsetTop - bottom,
77
+ right: clientWidth - offsetWidth - offsetLeft - right
95
78
  });
96
- } else {
97
- target.style.left = rightLocation + 'px';
79
+ middleLine.current = clientWidth - offsetWidth - offsetLeft - (clientWidth - offsetWidth) / 2;
98
80
  }
99
81
  };
100
82
 
101
- var touchMove = function touchMove(e) {
102
- e.preventDefault();
103
- var target = e.currentTarget;
104
-
105
- if (e.targetTouches.length === 1) {
106
- var touch = e.targetTouches[0];
107
- var x = touch.clientX - position.current.x;
108
- var y = touch.clientY - position.current.y;
109
- xPum.current = startLeft.current + x;
110
- yPum.current = startTop.current + y;
111
- var rightLocation = screenWidth.current - elWidth.current - boundary.right;
112
-
113
- if (Math.abs(xPum.current) > rightLocation) {
114
- xPum.current = rightLocation;
115
- } else if (xPum.current <= boundary.left) {
116
- xPum.current = boundary.left;
83
+ var bind = useDrag(function (_ref) {
84
+ var down = _ref.down,
85
+ last = _ref.last,
86
+ _ref$offset = _slicedToArray(_ref.offset, 2),
87
+ x = _ref$offset[0],
88
+ y = _ref$offset[1];
89
+
90
+ api.start({
91
+ x: x,
92
+ y: y,
93
+ immediate: down
94
+ });
95
+
96
+ if (last) {
97
+ if (props.direction != 'y' && props.attract) {
98
+ if (x < middleLine.current) {
99
+ api.start({
100
+ x: boundaryState.left,
101
+ y: y,
102
+ immediate: down
103
+ });
104
+ } else {
105
+ api.start({
106
+ x: boundaryState.right,
107
+ y: y,
108
+ immediate: down
109
+ });
110
+ }
117
111
  }
118
-
119
- if (yPum.current < boundary.top) {
120
- yPum.current = boundary.top;
121
- } else if (yPum.current > screenHeight.current - elHeight.current - boundary.bottom) {
122
- yPum.current = screenHeight.current - elHeight.current - boundary.bottom;
123
- }
124
-
125
- if (props.direction != 'y') {
126
- target.style.left = "".concat(xPum.current, "px");
127
- }
128
-
129
- if (props.direction != 'x') {
130
- target.style.top = "".concat(yPum.current, "px");
131
- }
132
- }
133
- };
134
-
135
- var touchEnd = function touchEnd(e) {
136
- var target = e.currentTarget;
137
- var touch = e.changedTouches[0];
138
- var currX = touch.clientX;
139
- var rightLocation = screenWidth.current - elWidth.current - boundary.right;
140
-
141
- if (currX > rightLocation) {
142
- currX = rightLocation;
143
- } else if (currX < boundary.left) {
144
- currX = boundary.left;
145
- } else {
146
- currX = currX < screenWidth.current / 2 ? boundary.left : rightLocation;
147
112
  }
148
-
149
- if (props.direction != 'y' && props.attract) {
150
- if (currX < screenWidth.current / 2) {
151
- window.requestAnimationFrame(function () {
152
- goLeft(target);
153
- });
154
- } else {
155
- window.requestAnimationFrame(function () {
156
- goRight(target, rightLocation);
157
- });
158
- }
159
- }
160
- };
161
-
162
- var touchStart = function touchStart(e) {
163
- var target = e.currentTarget;
164
- var touches = e.touches[0];
165
- startTop.current = target.offsetTop;
166
- startLeft.current = target.offsetLeft;
167
- position.current = {
168
- x: touches.clientX,
169
- y: touches.clientY
170
- };
171
- target.removeEventListener('touchmove', touchMove, false);
172
- target.removeEventListener('touchend', touchEnd, false);
173
- target.addEventListener('touchmove', touchMove, false);
174
- target.addEventListener('touchend', touchEnd, false);
175
- };
176
-
113
+ }, {
114
+ from: function from() {
115
+ return [currstyle.x.get(), currstyle.y.get()];
116
+ },
117
+ axis: direction,
118
+ bounds: boundaryState
119
+ });
177
120
  useEffect(function () {
178
121
  getInfo();
179
- }, []);
122
+ }, [myDrag]);
180
123
  return React__default.createElement("div", _objectSpread(_objectSpread({
124
+ style: style,
181
125
  className: "".concat(b(), " ").concat(className)
182
126
  }, reset), {}, {
183
- ref: myDrag,
184
- onTouchStart: function onTouchStart(event) {
185
- return touchStart(event);
186
- }
187
- }), children);
127
+ ref: myDrag
128
+ }), React__default.createElement(animated.div, _objectSpread({
129
+ style: currstyle
130
+ }, bind()), children));
188
131
  };
189
132
 
190
133
  Drag.defaultProps = defaultProps;
@@ -0,0 +1 @@
1
+ import '../../../packages/elevator/elevator.scss'
@@ -120,13 +120,7 @@ var Elevator = function Elevator(props) {
120
120
  });
121
121
  scrollTo(index);
122
122
  var target = e.currentTarget;
123
- target.removeEventListener('touchmove', function () {
124
- return touchMove(e);
125
- }, false);
126
123
  target.removeEventListener('touchend', touchEnd, false);
127
- target.addEventListener('touchmove', function () {
128
- return touchMove(e);
129
- }, false);
130
124
  target.addEventListener('touchend', touchEnd, false);
131
125
  };
132
126
 
@@ -185,6 +179,9 @@ var Elevator = function Elevator(props) {
185
179
  className: b('bars'),
186
180
  onTouchStart: function onTouchStart(event) {
187
181
  return touchStart(event);
182
+ },
183
+ onTouchMove: function onTouchMove(event) {
184
+ return touchMove(event);
188
185
  }
189
186
  }, React__default.createElement("div", {
190
187
  className: b('bars__inner')
@@ -0,0 +1 @@
1
+ import '../../../packages/fixednav/fixednav.scss'
@@ -7,10 +7,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
  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
8
 
9
9
  import React__default from 'react';
10
- import { I as Icon } from './icon-63c0d58f.js';
10
+ import Icon from './Icon.js';
11
+ import Overlay from './Overlay.js';
11
12
  import { c as cn } from './bem-893ad28d.js';
12
13
  import classNames from 'classnames';
13
- import { O as Overlay } from './overlay-418bcf84.js';
14
14
  import '@bem-react/classname';
15
15
  var defaultProps = {
16
16
  fixednavClass: 'nut-fixednav',
@@ -0,0 +1 @@
1
+ import '../../../packages/icon/icon.scss'
package/dist/esm/Icon.js CHANGED
@@ -1,5 +1,71 @@
1
- import { I as Icon } from './icon-63c0d58f.js';
2
- export { I as default } from './icon-63c0d58f.js';
3
- import 'react';
4
- import './bem-893ad28d.js';
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["name", "size", "classPrefix", "color", "tag", "children", "className", "style", "click"];
4
+
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
+
7
+ 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
+ import React__default from 'react';
10
+ import { c as cn } from './bem-893ad28d.js';
5
11
  import '@bem-react/classname';
12
+ var defaultProps = {
13
+ name: '',
14
+ size: '',
15
+ classPrefix: 'nutui-iconfont',
16
+ color: '',
17
+ tag: 'i',
18
+ click: function click(e) {},
19
+ className: ''
20
+ };
21
+
22
+ function pxCheck(value) {
23
+ return Number.isNaN(Number(value)) ? String(value) : "".concat(value, "px");
24
+ }
25
+
26
+ var Icon = function Icon(props) {
27
+ var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
28
+ name = _defaultProps$props.name,
29
+ size = _defaultProps$props.size,
30
+ classPrefix = _defaultProps$props.classPrefix,
31
+ color = _defaultProps$props.color,
32
+ tag = _defaultProps$props.tag,
33
+ children = _defaultProps$props.children,
34
+ className = _defaultProps$props.className,
35
+ style = _defaultProps$props.style,
36
+ click = _defaultProps$props.click,
37
+ rest = _objectWithoutProperties(_defaultProps$props, _excluded);
38
+
39
+ var isImage = name ? name.indexOf('/') !== -1 : false;
40
+ var type = isImage ? 'img' : tag;
41
+ var b = cn('icon');
42
+
43
+ var handleClick = function handleClick(e) {
44
+ if (props.click) {
45
+ props.click(e);
46
+ }
47
+ };
48
+
49
+ var hasSrc = function hasSrc() {
50
+ if (isImage) return {
51
+ src: name
52
+ };
53
+ return {};
54
+ };
55
+
56
+ return React__default.createElement(type, _objectSpread(_objectSpread({
57
+ className: isImage ? "".concat(className || '', " ").concat(b('img')) : "".concat(className || '', " ").concat(b(null, [classPrefix]), " nut-icon-").concat(name, " "),
58
+ style: _objectSpread({
59
+ color: color,
60
+ fontSize: pxCheck(size),
61
+ width: pxCheck(size),
62
+ height: pxCheck(size)
63
+ }, style)
64
+ }, rest), {}, {
65
+ onClick: handleClick
66
+ }, hasSrc()), children);
67
+ };
68
+
69
+ Icon.defaultProps = defaultProps;
70
+ Icon.displayName = 'NutIcon';
71
+ export { Icon as default };
@@ -0,0 +1 @@
1
+ import '../../../packages/infiniteloading/infiniteloading.scss'
@@ -0,0 +1 @@
1
+ import '../../../packages/input/input.scss'
package/dist/esm/Input.js CHANGED
@@ -7,7 +7,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
7
 
8
8
  import React__default, { useState, useEffect } from 'react';
9
9
  import { c as cn } from './bem-893ad28d.js';
10
- import { I as Icon } from './icon-63c0d58f.js';
10
+ import Icon from './Icon.js';
11
11
  import '@bem-react/classname';
12
12
 
13
13
  function trimExtraChar(value, _char, regExp) {
@@ -0,0 +1 @@
1
+ import '../../../packages/inputnumber/inputnumber.scss'
@@ -0,0 +1 @@
1
+ import '../../../packages/layout/layout.scss'
@@ -0,0 +1 @@
1
+ import '../../../packages/navbar/navbar.scss'
@@ -5,7 +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 from 'react';
8
- import { I as Icon } from './icon-63c0d58f.js';
8
+ import Icon from './Icon.js';
9
9
  import { c as cn } from './bem-893ad28d.js';
10
10
  import '@bem-react/classname';
11
11
  var defaultProps = {
@@ -0,0 +1 @@
1
+ import '../../../packages/noticebar/noticebar.scss'
@@ -6,7 +6,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
7
 
8
8
  import React__default, { useRef, useState, useEffect } from 'react';
9
- import { I as Icon } from './icon-63c0d58f.js';
9
+ import Icon from './Icon.js';
10
10
  import { c as cn } from './bem-893ad28d.js';
11
11
  import classNames from 'classnames';
12
12
  import '@bem-react/classname';
@@ -0,0 +1 @@
1
+ import '../../../packages/notify/notify.scss'
@@ -0,0 +1 @@
1
+ import '../../../packages/overlay/overlay.scss'
@@ -0,0 +1 @@
1
+ import '../../../packages/pagination/pagination.scss'
@@ -0,0 +1 @@
1
+ import '../../../packages/picker/picker.scss'