@nutui/nutui-react-taro 3.0.19-cpp.26-beta.1 → 3.0.19-cpp.26-beta.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 (134) hide show
  1. package/dist/cjs/locales/base.d.ts +3 -0
  2. package/dist/cjs/locales/en-US.js +4 -1
  3. package/dist/cjs/locales/id-ID.js +4 -1
  4. package/dist/cjs/locales/ja-JP.js +4 -1
  5. package/dist/cjs/locales/tr-TR.js +4 -1
  6. package/dist/cjs/locales/zh-CN.js +4 -1
  7. package/dist/cjs/locales/zh-TW.js +4 -1
  8. package/dist/cjs/locales/zh-UG.js +4 -1
  9. package/dist/cjs/packages/actionsheet/style/style.harmony.css +19 -7
  10. package/dist/cjs/packages/address/style/style.harmony.css +19 -7
  11. package/dist/cjs/packages/calendar/style/style.harmony.css +19 -7
  12. package/dist/cjs/packages/cascader/style/style.harmony.css +19 -7
  13. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  14. package/dist/cjs/packages/datepicker/style/style.harmony.css +19 -7
  15. package/dist/cjs/packages/imagepreview/style/style.harmony.css +19 -7
  16. package/dist/cjs/packages/numberkeyboard/style/style.harmony.css +19 -7
  17. package/dist/cjs/packages/nutui.react.build.d.ts +3 -1
  18. package/dist/cjs/packages/nutui.react.build.js +18 -14
  19. package/dist/cjs/packages/nutui.react.d.ts +4 -1
  20. package/dist/cjs/packages/nutui.react.js +19 -14
  21. package/dist/cjs/packages/nutui.react.scss.d.ts +1 -0
  22. package/dist/cjs/packages/nutui.react.scss.js +1 -0
  23. package/dist/cjs/packages/overlay/overlay.js +11 -17
  24. package/dist/cjs/packages/picker/style/style.harmony.css +19 -7
  25. package/dist/cjs/packages/popover/style/style.harmony.css +19 -7
  26. package/dist/cjs/packages/popup/popup.js +171 -99
  27. package/dist/cjs/packages/popup/style/popup.scss +19 -8
  28. package/dist/cjs/packages/popup/style/style.css +19 -7
  29. package/dist/cjs/packages/popup/style/style.harmony.css +19 -7
  30. package/dist/cjs/packages/popup/style-jmapp/popup.scss +19 -8
  31. package/dist/cjs/packages/popup/style-jmapp/style.css +19 -7
  32. package/dist/cjs/packages/popup/style-jrkf/popup.scss +19 -8
  33. package/dist/cjs/packages/popup/style-jrkf/style.css +19 -7
  34. package/dist/cjs/packages/quickenter/index.d.ts +3 -0
  35. package/dist/cjs/packages/quickenter/index.js +13 -0
  36. package/dist/cjs/packages/quickenter/quickenter.d.ts +4 -0
  37. package/dist/cjs/packages/quickenter/quickenter.js +147 -0
  38. package/dist/cjs/packages/quickenter/style/css.js +2 -0
  39. package/dist/cjs/packages/quickenter/style/index.js +2 -0
  40. package/dist/cjs/packages/quickenter/style/quickenter.scss +110 -0
  41. package/dist/cjs/packages/quickenter/style/style.css +99 -0
  42. package/dist/cjs/packages/quickenter/style/style.harmony.css +500 -0
  43. package/dist/cjs/packages/quickenter/style-jmapp/css.js +2 -0
  44. package/dist/cjs/packages/quickenter/style-jmapp/index.js +2 -0
  45. package/dist/cjs/packages/quickenter/style-jmapp/quickenter.scss +110 -0
  46. package/dist/cjs/packages/quickenter/style-jmapp/style.css +99 -0
  47. package/dist/cjs/packages/quickenter/style-jrkf/css.js +2 -0
  48. package/dist/cjs/packages/quickenter/style-jrkf/index.js +2 -0
  49. package/dist/cjs/packages/quickenter/style-jrkf/quickenter.scss +110 -0
  50. package/dist/cjs/packages/quickenter/style-jrkf/style.css +99 -0
  51. package/dist/cjs/packages/shortpassword/style/style.harmony.css +19 -7
  52. package/dist/cjs/packages/timeselect/style/style.harmony.css +19 -7
  53. package/dist/cjs/packages/tour/style/style.harmony.css +19 -7
  54. package/dist/cjs/types/index.d.ts +3 -0
  55. package/dist/cjs/types/index.js +3 -0
  56. package/dist/cjs/types/spec/quickenter/base.d.ts +26 -0
  57. package/dist/cjs/types/spec/quickenter/base.js +4 -0
  58. package/dist/cjs/types/spec/quickenter/h5.d.ts +5 -0
  59. package/dist/cjs/types/spec/quickenter/h5.js +4 -0
  60. package/dist/cjs/types/spec/quickenter/taro.d.ts +5 -0
  61. package/dist/cjs/types/spec/quickenter/taro.js +4 -0
  62. package/dist/cjs/utils/taro/ConfigurableCSSTransition.d.ts +15 -0
  63. package/dist/cjs/utils/taro/ConfigurableCSSTransition.js +90 -0
  64. package/dist/es/locales/base.d.ts +3 -0
  65. package/dist/es/locales/en-US.js +4 -1
  66. package/dist/es/locales/id-ID.js +4 -1
  67. package/dist/es/locales/ja-JP.js +4 -1
  68. package/dist/es/locales/tr-TR.js +4 -1
  69. package/dist/es/locales/zh-CN.js +4 -1
  70. package/dist/es/locales/zh-TW.js +4 -1
  71. package/dist/es/locales/zh-UG.js +4 -1
  72. package/dist/es/packages/actionsheet/style/style.harmony.css +19 -7
  73. package/dist/es/packages/address/style/style.harmony.css +19 -7
  74. package/dist/es/packages/calendar/style/style.harmony.css +19 -7
  75. package/dist/es/packages/cascader/style/style.harmony.css +19 -7
  76. package/dist/es/packages/configprovider/types.d.ts +1 -1
  77. package/dist/es/packages/datepicker/style/style.harmony.css +19 -7
  78. package/dist/es/packages/imagepreview/style/style.harmony.css +19 -7
  79. package/dist/es/packages/numberkeyboard/style/style.harmony.css +19 -7
  80. package/dist/es/packages/nutui.react.build.d.ts +3 -1
  81. package/dist/es/packages/nutui.react.build.js +3 -1
  82. package/dist/es/packages/overlay/overlay.js +11 -17
  83. package/dist/es/packages/picker/style/style.harmony.css +19 -7
  84. package/dist/es/packages/popover/style/style.harmony.css +19 -7
  85. package/dist/es/packages/popup/popup.js +172 -101
  86. package/dist/es/packages/popup/style/popup.scss +19 -8
  87. package/dist/es/packages/popup/style/style.css +19 -7
  88. package/dist/es/packages/popup/style/style.harmony.css +19 -7
  89. package/dist/es/packages/popup/style-jmapp/popup.scss +19 -8
  90. package/dist/es/packages/popup/style-jmapp/style.css +19 -7
  91. package/dist/es/packages/popup/style-jrkf/popup.scss +19 -8
  92. package/dist/es/packages/popup/style-jrkf/style.css +19 -7
  93. package/dist/es/packages/quickenter/index.d.ts +3 -0
  94. package/dist/es/packages/quickenter/index.js +2 -0
  95. package/dist/es/packages/quickenter/quickenter.d.ts +4 -0
  96. package/dist/es/packages/quickenter/quickenter.js +135 -0
  97. package/dist/es/packages/quickenter/style/css.js +2 -0
  98. package/dist/es/packages/quickenter/style/index.js +2 -0
  99. package/dist/es/packages/quickenter/style/quickenter.scss +110 -0
  100. package/dist/es/packages/quickenter/style/style.css +99 -0
  101. package/dist/es/packages/quickenter/style/style.harmony.css +500 -0
  102. package/dist/es/packages/quickenter/style-jmapp/css.js +2 -0
  103. package/dist/es/packages/quickenter/style-jmapp/index.js +2 -0
  104. package/dist/es/packages/quickenter/style-jmapp/quickenter.scss +110 -0
  105. package/dist/es/packages/quickenter/style-jmapp/style.css +99 -0
  106. package/dist/es/packages/quickenter/style-jrkf/css.js +2 -0
  107. package/dist/es/packages/quickenter/style-jrkf/index.js +2 -0
  108. package/dist/es/packages/quickenter/style-jrkf/quickenter.scss +110 -0
  109. package/dist/es/packages/quickenter/style-jrkf/style.css +99 -0
  110. package/dist/es/packages/shortpassword/style/style.harmony.css +19 -7
  111. package/dist/es/packages/timeselect/style/style.harmony.css +19 -7
  112. package/dist/es/packages/tour/style/style.harmony.css +19 -7
  113. package/dist/es/types/index.d.ts +3 -0
  114. package/dist/es/types/index.js +3 -0
  115. package/dist/es/types/spec/quickenter/base.d.ts +44 -0
  116. package/dist/es/types/spec/quickenter/base.js +1 -0
  117. package/dist/es/types/spec/quickenter/h5.d.ts +5 -0
  118. package/dist/es/types/spec/quickenter/h5.js +1 -0
  119. package/dist/es/types/spec/quickenter/taro.d.ts +5 -0
  120. package/dist/es/types/spec/quickenter/taro.js +1 -0
  121. package/dist/es/utils/taro/ConfigurableCSSTransition.d.ts +15 -0
  122. package/dist/es/utils/taro/ConfigurableCSSTransition.js +79 -0
  123. package/dist/nutui.react.umd.js +582 -295
  124. package/dist/style-jmapp.css +1 -1
  125. package/dist/style-jmapp.scss +31 -30
  126. package/dist/style-jrkf.css +1 -1
  127. package/dist/style-jrkf.scss +27 -26
  128. package/dist/style.css +1 -1
  129. package/dist/style.scss +30 -29
  130. package/dist/styles/variables-daojia.scss +36 -0
  131. package/dist/styles/variables-jmapp.scss +36 -0
  132. package/dist/styles/variables-jrkf.scss +36 -0
  133. package/dist/styles/variables.scss +36 -0
  134. package/package.json +1 -1
@@ -22,6 +22,7 @@ var _reactdom = require("react-dom");
22
22
  var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
23
23
  var _iconsreacttaro = require("@nutui/icons-react-taro");
24
24
  var _components = require("@tarojs/components");
25
+ var _ConfigurableCSSTransition = /*#__PURE__*/ _interop_require_default._(require("../../utils/taro/ConfigurableCSSTransition"));
25
26
  var _getrect = require("../../utils/taro/get-rect");
26
27
  var _overlay = require("../overlay/overlay");
27
28
  var _index = /*#__PURE__*/ _interop_require_default._(require("../overlay/index"));
@@ -59,54 +60,57 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _overla
59
60
  var _zIndex = 1100;
60
61
  var Popup = function Popup(props) {
61
62
  var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel;
62
- var innerIndex = zIndex || _zIndex;
63
- var _useState = (0, _sliced_to_array._)((0, _react.useState)(innerIndex), 2), index = _useState[0], setIndex = _useState[1];
63
+ var locale = (0, _configprovider.useConfig)().locale;
64
+ var _useState = (0, _sliced_to_array._)((0, _react.useState)(zIndex || _zIndex), 2), index = _useState[0], setIndex = _useState[1];
64
65
  var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
65
66
  var _useState2 = (0, _sliced_to_array._)((0, _react.useState)(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
66
- var _useState3 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
67
67
  var nodeRef = (0, _uselockscoll.useLockScrollTaro)(innerVisible && lockScroll);
68
- var topNodeRef = _react.default.useRef(null);
68
+ var topNodeRef = (0, _react.useRef)(null);
69
69
  var rootRect = (0, _react.useRef)(null);
70
70
  var touchStartRef = (0, _react.useRef)(0);
71
71
  var touchMoveDistanceRef = (0, _react.useRef)(0);
72
72
  var heightRef = (0, _react.useRef)(0);
73
73
  var defaultHeightRef = (0, _react.useRef)(0);
74
74
  var isTouching = (0, _react.useRef)(false);
75
- var locale = (0, _configprovider.useConfig)().locale;
76
75
  var classPrefix = 'nut-popup';
77
- var overlayStyles = (0, _object_spread._)({}, overlayStyle);
78
- var contentZIndex = (0, _platform.harmony)() ? index + 1 : index // 解决harmony层级问题
79
- ;
80
- var popStyles = (0, _object_spread._)({
81
- zIndex: contentZIndex,
82
- minHeight: minHeight
83
- }, style);
84
- var _obj;
85
- var popClassName = (0, _classnames.default)(classPrefix, (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), (0, _define_property._)(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
86
- var _useState4 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), popupHeight = _useState4[0], setPopupHeight = _useState4[1];
87
- var _useState5 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), topBottom = _useState5[0], setTopBottom = _useState5[1];
88
- var resizeStyles = function resizeStyles() {
89
- if (popupHeight !== '') {
90
- return {
91
- height: popupHeight
92
- };
93
- }
94
- };
95
- var open = function open() {
96
- if (!innerVisible) {
97
- // 当高度改变后,再次打开时,将高度置为初始高度
98
- if (position === 'bottom' && resizable && nodeRef.current && heightRef.current) {
99
- setPopupHeight((0, _pxtransform.pxTransform)(defaultHeightRef.current));
100
- }
101
- setInnerVisible(true);
102
- setIndex(++innerIndex);
103
- }
104
- if (destroyOnClose) {
105
- setShowChildren(true);
106
- }
107
- onOpen && onOpen();
108
- };
109
- var getPopupHeight = function getPopupHeight() {
76
+ var transitionName = (0, _react.useMemo)(function() {
77
+ return transition || "".concat(classPrefix, "-slide-").concat(position);
78
+ }, [
79
+ transition,
80
+ position
81
+ ]);
82
+ var overlayStyles = (0, _react.useMemo)(function() {
83
+ return (0, _object_spread._)({}, overlayStyle);
84
+ }, [
85
+ overlayStyle
86
+ ]);
87
+ var contentZIndex = (0, _react.useMemo)(function() {
88
+ return (0, _platform.harmony)() ? index + 1 : index // 解决harmony层级问题
89
+ ;
90
+ }, [
91
+ index
92
+ ]);
93
+ var popStyles = (0, _react.useMemo)(function() {
94
+ return (0, _object_spread._)({
95
+ zIndex: contentZIndex,
96
+ minHeight: minHeight
97
+ }, style);
98
+ }, [
99
+ contentZIndex,
100
+ minHeight,
101
+ style
102
+ ]);
103
+ var popClassName = (0, _react.useMemo)(function() {
104
+ var _obj;
105
+ return (0, _classnames.default)(classPrefix, (_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), (0, _define_property._)(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
106
+ }, [
107
+ round,
108
+ position,
109
+ className
110
+ ]);
111
+ var _useState3 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), popupHeight = _useState3[0], setPopupHeight = _useState3[1];
112
+ var _useState4 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), topBottom = _useState4[0], setTopBottom = _useState4[1];
113
+ var getPopupHeight = (0, _react.useCallback)(function() {
110
114
  return (0, _async_to_generator._)(function() {
111
115
  var _nodeRef_current, rect, height;
112
116
  return (0, _ts_generator._)(this, function(_state) {
@@ -126,19 +130,36 @@ var Popup = function Popup(props) {
126
130
  }
127
131
  });
128
132
  })();
129
- };
130
- (0, _react.useEffect)(function() {
131
- if (innerVisible && topNodeRef.current && nodeRef.current) {
132
- (0, _taro.nextTick)(function() {
133
- (0, _taro.nextTick)(function() {
134
- getPopupHeight();
135
- });
133
+ }, [
134
+ nodeRef
135
+ ]);
136
+ var open = (0, _react.useCallback)(function() {
137
+ if (!innerVisible) {
138
+ // 当高度改变后,再次打开时,将高度置为初始高度
139
+ if (position === 'bottom' && resizable && nodeRef.current && heightRef.current) {
140
+ setPopupHeight((0, _pxtransform.pxTransform)(defaultHeightRef.current));
141
+ }
142
+ setInnerVisible(true);
143
+ setIndex(function(prev) {
144
+ return prev + 1;
136
145
  });
137
146
  }
147
+ if (destroyOnClose) {
148
+ setShowChildren(true);
149
+ }
150
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
138
151
  }, [
139
- innerVisible
152
+ innerVisible,
153
+ position,
154
+ resizable,
155
+ destroyOnClose,
156
+ onOpen,
157
+ nodeRef,
158
+ setInnerVisible,
159
+ setIndex,
160
+ setShowChildren
140
161
  ]);
141
- var close = function close() {
162
+ var close = (0, _react.useCallback)(function() {
142
163
  if (innerVisible) {
143
164
  setInnerVisible(false);
144
165
  if (destroyOnClose) {
@@ -146,28 +167,70 @@ var Popup = function Popup(props) {
146
167
  setShowChildren(false);
147
168
  }, Number(duration));
148
169
  }
149
- onClose && onClose();
170
+ onClose === null || onClose === void 0 ? void 0 : onClose();
150
171
  }
151
- };
152
- var handleOverlayClick = function handleOverlayClick(e) {
172
+ }, [
173
+ innerVisible,
174
+ destroyOnClose,
175
+ duration,
176
+ onClose,
177
+ setInnerVisible,
178
+ setShowChildren
179
+ ]);
180
+ (0, _react.useEffect)(function() {
181
+ visible ? open() : close();
182
+ }, [
183
+ visible,
184
+ open,
185
+ close
186
+ ]);
187
+ (0, _react.useEffect)(function() {
188
+ if (innerVisible && topNodeRef.current && nodeRef.current) {
189
+ (0, _taro.nextTick)(function() {
190
+ (0, _taro.nextTick)(function() {
191
+ getPopupHeight();
192
+ });
193
+ });
194
+ }
195
+ }, [
196
+ innerVisible,
197
+ getPopupHeight,
198
+ nodeRef
199
+ ]);
200
+ var handleOverlayClick = (0, _react.useCallback)(function(e) {
153
201
  e.stopPropagation();
154
202
  if (closeOnOverlayClick && onOverlayClick(e)) {
155
203
  close();
156
204
  }
157
- };
158
- var handleCloseIconClick = function handleCloseIconClick(e) {
205
+ }, [
206
+ closeOnOverlayClick,
207
+ onOverlayClick,
208
+ close
209
+ ]);
210
+ var handleCloseIconClick = (0, _react.useCallback)(function(e) {
159
211
  onCloseIconClick(e) && close();
160
- };
161
- var renderCloseIcon = function renderCloseIcon() {
212
+ }, [
213
+ onCloseIconClick,
214
+ close
215
+ ]);
216
+ var renderCloseIcon = (0, _react.useCallback)(function() {
217
+ if (!closeable) return null;
162
218
  var closeClasses = (0, _classnames.default)("".concat(classPrefix, "-title-right"), "".concat(classPrefix, "-title-right-").concat(closeIconPosition));
163
- return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, closeable && /*#__PURE__*/ _react.default.createElement(_components.View, {
219
+ return /*#__PURE__*/ _react.default.createElement(_components.View, {
164
220
  className: closeClasses,
165
221
  onClick: handleCloseIconClick,
166
222
  ariaRole: "button",
167
223
  ariaLabel: closeAriaLabel || locale.close
168
- }, /*#__PURE__*/ _react.default.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close, null)));
169
- };
170
- var renderTop = function renderTop() {
224
+ }, /*#__PURE__*/ _react.default.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close, null));
225
+ }, [
226
+ closeable,
227
+ closeIconPosition,
228
+ handleCloseIconClick,
229
+ closeAriaLabel,
230
+ locale.close,
231
+ closeIcon
232
+ ]);
233
+ var renderTop = (0, _react.useCallback)(function() {
171
234
  if (!top) return null;
172
235
  return /*#__PURE__*/ _react.default.createElement(_components.View, {
173
236
  className: "".concat(classPrefix, "-bottom-top"),
@@ -176,8 +239,11 @@ var Popup = function Popup(props) {
176
239
  bottom: topBottom
177
240
  }
178
241
  }, top);
179
- };
180
- var renderTitle = function renderTitle() {
242
+ }, [
243
+ top,
244
+ topBottom
245
+ ]);
246
+ var renderTitle = (0, _react.useCallback)(function() {
181
247
  if (left || title || description) {
182
248
  return /*#__PURE__*/ _react.default.createElement(_components.View, {
183
249
  className: "".concat(classPrefix, "-title")
@@ -194,8 +260,15 @@ var Popup = function Popup(props) {
194
260
  if (closeable) {
195
261
  return renderCloseIcon();
196
262
  }
197
- };
198
- var handleTouchStart = function handleTouchStart(event) {
263
+ }, [
264
+ left,
265
+ title,
266
+ description,
267
+ position,
268
+ closeable,
269
+ renderCloseIcon
270
+ ]);
271
+ var handleTouchStart = (0, _react.useCallback)(function(event) {
199
272
  return (0, _async_to_generator._)(function() {
200
273
  var _nodeRef_current, _rootRect_current, e, rect;
201
274
  return (0, _ts_generator._)(this, function(_state) {
@@ -225,8 +298,13 @@ var Popup = function Popup(props) {
225
298
  }
226
299
  });
227
300
  })();
228
- };
229
- var handleTouchMove = function handleTouchMove(event) {
301
+ }, [
302
+ position,
303
+ resizable,
304
+ onTouchStart,
305
+ nodeRef
306
+ ]);
307
+ var handleTouchMove = (0, _react.useCallback)(function(event) {
230
308
  if (position !== 'bottom' || !resizable || !nodeRef.current || !rootRect.current) return;
231
309
  var e = event;
232
310
  e.stopPropagation();
@@ -245,21 +323,42 @@ var Popup = function Popup(props) {
245
323
  }
246
324
  };
247
325
  requestAnimationFrame(handleMove);
248
- };
249
- var handleTouchEnd = function handleTouchEnd(event) {
326
+ }, [
327
+ position,
328
+ resizable,
329
+ minHeight,
330
+ onTouchMove,
331
+ nodeRef
332
+ ]);
333
+ var handleTouchEnd = (0, _react.useCallback)(function(event) {
250
334
  if (position !== 'bottom' || !resizable || !nodeRef.current || !rootRect.current) return;
251
335
  var e = event;
252
336
  isTouching.current = false;
253
337
  var min = typeof minHeight === 'number' ? minHeight : parseInt(String(minHeight || 0), 10) || 0;
254
338
  var currentHeight = Math.max(min, heightRef.current - touchMoveDistanceRef.current);
255
339
  onTouchEnd === null || onTouchEnd === void 0 ? void 0 : onTouchEnd(currentHeight, e);
256
- };
340
+ }, [
341
+ position,
342
+ resizable,
343
+ minHeight,
344
+ onTouchEnd,
345
+ nodeRef
346
+ ]);
257
347
  var renderPop = function renderPop() {
258
- return /*#__PURE__*/ _react.default.createElement(_components.View, {
348
+ return /*#__PURE__*/ _react.default.createElement(_ConfigurableCSSTransition.default, {
349
+ nodeRef: nodeRef,
350
+ classNames: transitionName,
351
+ mountOnEnter: true,
352
+ unmountOnExit: destroyOnClose,
353
+ timeout: Number(duration),
354
+ in: innerVisible,
355
+ onEntered: afterShow,
356
+ onExited: afterClose
357
+ }, /*#__PURE__*/ _react.default.createElement(_components.View, {
259
358
  ref: nodeRef,
260
- style: (0, _object_spread._)((0, _object_spread_props._)((0, _object_spread._)({}, popStyles), {
261
- display: innerVisible ? (popStyles === null || popStyles === void 0 ? void 0 : popStyles.display) || 'block' : 'none'
262
- }), resizeStyles()),
359
+ style: (0, _object_spread._)({}, popStyles, popupHeight ? {
360
+ height: popupHeight
361
+ } : {}),
263
362
  className: popClassName,
264
363
  onClick: onClick,
265
364
  catchMove: lockScroll,
@@ -267,24 +366,8 @@ var Popup = function Popup(props) {
267
366
  onTouchMove: handleTouchMove,
268
367
  onTouchEnd: handleTouchEnd,
269
368
  onTouchCancel: handleTouchEnd
270
- }, renderTop(), renderTitle(), showChildren ? children : null);
369
+ }, renderTop(), renderTitle(), showChildren ? children : null));
271
370
  };
272
- // const renderPop = () => {
273
- // return (
274
- // <CSSTransition
275
- // nodeRef={nodeRef}
276
- // classNames={transitionName}
277
- // mountOnEnter
278
- // unmountOnExit={destroyOnClose}
279
- // timeout={duration}
280
- // in={innerVisible}
281
- // onEntered={afterShow}
282
- // onExited={afterClose}
283
- // >
284
- // {renderContent()}
285
- // </CSSTransition>
286
- // )
287
- // }
288
371
  var renderNode = function renderNode() {
289
372
  return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, overlay ? /*#__PURE__*/ _react.default.createElement(_index.default, {
290
373
  zIndex: index,
@@ -297,17 +380,6 @@ var Popup = function Popup(props) {
297
380
  onClick: handleOverlayClick
298
381
  }) : null, renderPop());
299
382
  };
300
- (0, _react.useEffect)(function() {
301
- visible ? open() : close();
302
- }, [
303
- visible
304
- ]);
305
- (0, _react.useEffect)(function() {
306
- setTransitionName(transition || "".concat(classPrefix, "-slide-").concat(position));
307
- }, [
308
- position,
309
- transition
310
- ]);
311
383
  var resolveContainer = function resolveContainer(getContainer) {
312
384
  return (typeof getContainer === 'function' ? getContainer() : getContainer) || document.body;
313
385
  };
@@ -219,6 +219,9 @@
219
219
  }
220
220
 
221
221
  @keyframes popup-slide-top-exit {
222
+ from {
223
+ transform: translate3d(0, 0%, 0);
224
+ }
222
225
  to {
223
226
  transform: translate3d(0, -100%, 0);
224
227
  }
@@ -249,6 +252,9 @@
249
252
  }
250
253
 
251
254
  @keyframes popup-slide-right-exit {
255
+ from {
256
+ transform: translate3d(0%, 0, 0);
257
+ }
252
258
  to {
253
259
  transform: translate3d(100%, 0, 0);
254
260
  }
@@ -262,7 +268,7 @@
262
268
  animation-duration: $popup-animation-duration;
263
269
  }
264
270
 
265
- &-right-exit {
271
+ &-right-exit-active {
266
272
  animation-fill-mode: both;
267
273
  animation-name: popup-slide-right-exit;
268
274
  animation-duration: $popup-animation-duration;
@@ -278,7 +284,10 @@
278
284
  }
279
285
  }
280
286
 
281
- @keyframes slide-bottom-exit {
287
+ @keyframes popup-slide-bottom-exit {
288
+ from {
289
+ transform: translate3d(0, 0%, 0);
290
+ }
282
291
  to {
283
292
  transform: translate3d(0, 100%, 0);
284
293
  }
@@ -286,15 +295,15 @@
286
295
 
287
296
  &-bottom-enter-active,
288
297
  &-bottom-appear-active {
289
- transform: translate(0, 0);
298
+ transform: translate3d(0, 0, 0);
290
299
  animation-fill-mode: both;
291
300
  animation-name: popup-slide-bottom-enter;
292
301
  animation-duration: $popup-animation-duration;
293
302
  }
294
303
 
295
- &-bottom-exit {
304
+ &-bottom-exit-active {
296
305
  animation-fill-mode: both;
297
- animation-name: slide-bottom-exit;
306
+ animation-name: popup-slide-bottom-exit;
298
307
  animation-duration: $popup-animation-duration;
299
308
  }
300
309
 
@@ -309,6 +318,9 @@
309
318
  }
310
319
 
311
320
  @keyframes popup-slide-left-exit {
321
+ from {
322
+ transform: translate3d(0%, 0, 0);
323
+ }
312
324
  to {
313
325
  transform: translate3d(-100%, 0, 0);
314
326
  }
@@ -316,14 +328,13 @@
316
328
 
317
329
  &-left-enter-active,
318
330
  &-left-appear-active {
319
- transform: translate(0, 0);
331
+ transform: translate3d(0, 0, 0);
320
332
  animation-fill-mode: both;
321
333
  animation-name: popup-slide-left-enter;
322
334
  animation-duration: $popup-animation-duration;
323
335
  }
324
336
 
325
- &-left-exit-active,
326
- &-left-exit-done {
337
+ &-left-exit-active {
327
338
  animation-fill-mode: both;
328
339
  animation-name: popup-slide-left-exit;
329
340
  animation-duration: $popup-animation-duration;
@@ -197,6 +197,9 @@
197
197
  }
198
198
  }
199
199
  @keyframes popup-slide-top-exit {
200
+ from {
201
+ transform: translate3d(0, 0%, 0);
202
+ }
200
203
  to {
201
204
  transform: translate3d(0, -100%, 0);
202
205
  }
@@ -221,6 +224,9 @@
221
224
  }
222
225
  }
223
226
  @keyframes popup-slide-right-exit {
227
+ from {
228
+ transform: translate3d(0%, 0, 0);
229
+ }
224
230
  to {
225
231
  transform: translate3d(100%, 0, 0);
226
232
  }
@@ -231,7 +237,7 @@
231
237
  animation-name: popup-slide-right-enter;
232
238
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
233
239
  }
234
- .nut-popup-slide-right-exit {
240
+ .nut-popup-slide-right-exit-active {
235
241
  animation-fill-mode: both;
236
242
  animation-name: popup-slide-right-exit;
237
243
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
@@ -244,20 +250,23 @@
244
250
  transform: translate3d(0, 0%, 0);
245
251
  }
246
252
  }
247
- @keyframes slide-bottom-exit {
253
+ @keyframes popup-slide-bottom-exit {
254
+ from {
255
+ transform: translate3d(0, 0%, 0);
256
+ }
248
257
  to {
249
258
  transform: translate3d(0, 100%, 0);
250
259
  }
251
260
  }
252
261
  .nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
253
- transform: translate(0, 0);
262
+ transform: translate3d(0, 0, 0);
254
263
  animation-fill-mode: both;
255
264
  animation-name: popup-slide-bottom-enter;
256
265
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
257
266
  }
258
- .nut-popup-slide-bottom-exit {
267
+ .nut-popup-slide-bottom-exit-active {
259
268
  animation-fill-mode: both;
260
- animation-name: slide-bottom-exit;
269
+ animation-name: popup-slide-bottom-exit;
261
270
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
262
271
  }
263
272
  @keyframes popup-slide-left-enter {
@@ -269,17 +278,20 @@
269
278
  }
270
279
  }
271
280
  @keyframes popup-slide-left-exit {
281
+ from {
282
+ transform: translate3d(0%, 0, 0);
283
+ }
272
284
  to {
273
285
  transform: translate3d(-100%, 0, 0);
274
286
  }
275
287
  }
276
288
  .nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
277
- transform: translate(0, 0);
289
+ transform: translate3d(0, 0, 0);
278
290
  animation-fill-mode: both;
279
291
  animation-name: popup-slide-left-enter;
280
292
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
281
293
  }
282
- .nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
294
+ .nut-popup-slide-left-exit-active {
283
295
  animation-fill-mode: both;
284
296
  animation-name: popup-slide-left-exit;
285
297
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
@@ -251,6 +251,9 @@
251
251
  }
252
252
  }
253
253
  @keyframes popup-slide-top-exit {
254
+ from {
255
+ transform: translate3d(0, 0%, 0);
256
+ }
254
257
  to {
255
258
  transform: translate3d(0, -100%, 0);
256
259
  }
@@ -275,6 +278,9 @@
275
278
  }
276
279
  }
277
280
  @keyframes popup-slide-right-exit {
281
+ from {
282
+ transform: translate3d(0%, 0, 0);
283
+ }
278
284
  to {
279
285
  transform: translate3d(100%, 0, 0);
280
286
  }
@@ -285,7 +291,7 @@
285
291
  animation-name: popup-slide-right-enter;
286
292
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
287
293
  }
288
- .nut-popup-slide-right-exit {
294
+ .nut-popup-slide-right-exit-active {
289
295
  animation-fill-mode: both;
290
296
  animation-name: popup-slide-right-exit;
291
297
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
@@ -298,20 +304,23 @@
298
304
  transform: translate3d(0, 0%, 0);
299
305
  }
300
306
  }
301
- @keyframes slide-bottom-exit {
307
+ @keyframes popup-slide-bottom-exit {
308
+ from {
309
+ transform: translate3d(0, 0%, 0);
310
+ }
302
311
  to {
303
312
  transform: translate3d(0, 100%, 0);
304
313
  }
305
314
  }
306
315
  .nut-popup-slide-bottom-enter-active, .nut-popup-slide-bottom-appear-active {
307
- transform: translate(0, 0);
316
+ transform: translate3d(0, 0, 0);
308
317
  animation-fill-mode: both;
309
318
  animation-name: popup-slide-bottom-enter;
310
319
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
311
320
  }
312
- .nut-popup-slide-bottom-exit {
321
+ .nut-popup-slide-bottom-exit-active {
313
322
  animation-fill-mode: both;
314
- animation-name: slide-bottom-exit;
323
+ animation-name: popup-slide-bottom-exit;
315
324
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
316
325
  }
317
326
  @keyframes popup-slide-left-enter {
@@ -323,17 +332,20 @@
323
332
  }
324
333
  }
325
334
  @keyframes popup-slide-left-exit {
335
+ from {
336
+ transform: translate3d(0%, 0, 0);
337
+ }
326
338
  to {
327
339
  transform: translate3d(-100%, 0, 0);
328
340
  }
329
341
  }
330
342
  .nut-popup-slide-left-enter-active, .nut-popup-slide-left-appear-active {
331
- transform: translate(0, 0);
343
+ transform: translate3d(0, 0, 0);
332
344
  animation-fill-mode: both;
333
345
  animation-name: popup-slide-left-enter;
334
346
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);
335
347
  }
336
- .nut-popup-slide-left-exit-active, .nut-popup-slide-left-exit-done {
348
+ .nut-popup-slide-left-exit-active {
337
349
  animation-fill-mode: both;
338
350
  animation-name: popup-slide-left-exit;
339
351
  animation-duration: var(--nutui-popup-animation-duration, 0.3s);