@nutui/nutui-react-taro 3.0.19-cpp-beta.2 → 3.0.19-cpp-beta.ios.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 (60) hide show
  1. package/dist/cjs/hooks/taro/use-custom-event.js +1 -1
  2. package/dist/cjs/packages/actionsheet/style/style.harmony.css +3 -0
  3. package/dist/cjs/packages/address/style/style.harmony.css +3 -0
  4. package/dist/cjs/packages/button/button.d.ts +2 -5
  5. package/dist/cjs/packages/button/button.js +7 -9
  6. package/dist/cjs/packages/calendar/style/style.harmony.css +3 -0
  7. package/dist/cjs/packages/cascader/style/style.harmony.css +3 -0
  8. package/dist/cjs/packages/datepicker/style/style.harmony.css +3 -0
  9. package/dist/cjs/packages/imagepreview/style/style.harmony.css +3 -0
  10. package/dist/cjs/packages/input/input.js +13 -1
  11. package/dist/cjs/packages/numberkeyboard/style/style.harmony.css +3 -0
  12. package/dist/cjs/packages/picker/style/style.harmony.css +3 -0
  13. package/dist/cjs/packages/popover/style/style.harmony.css +3 -0
  14. package/dist/cjs/packages/popup/popup.js +49 -1
  15. package/dist/cjs/packages/popup/style/popup.scss +4 -0
  16. package/dist/cjs/packages/popup/style/style.css +3 -0
  17. package/dist/cjs/packages/popup/style/style.harmony.css +3 -0
  18. package/dist/cjs/packages/popup/style-jmapp/popup.scss +4 -0
  19. package/dist/cjs/packages/popup/style-jmapp/style.css +3 -0
  20. package/dist/cjs/packages/popup/style-jrkf/popup.scss +4 -0
  21. package/dist/cjs/packages/popup/style-jrkf/style.css +3 -0
  22. package/dist/cjs/packages/shortpassword/style/style.harmony.css +3 -0
  23. package/dist/cjs/packages/swipe/swipe.d.ts +1 -1
  24. package/dist/cjs/packages/timeselect/style/style.harmony.css +3 -0
  25. package/dist/cjs/packages/tour/style/style.harmony.css +3 -0
  26. package/dist/cjs/utils/taro/get-rect-by-id.js +13 -1
  27. package/dist/es/hooks/taro/use-custom-event.js +3 -2
  28. package/dist/es/packages/actionsheet/style/style.harmony.css +3 -0
  29. package/dist/es/packages/address/style/style.harmony.css +3 -0
  30. package/dist/es/packages/button/button.d.ts +2 -5
  31. package/dist/es/packages/button/button.js +10 -10
  32. package/dist/es/packages/calendar/style/style.harmony.css +3 -0
  33. package/dist/es/packages/cascader/style/style.harmony.css +3 -0
  34. package/dist/es/packages/datepicker/style/style.harmony.css +3 -0
  35. package/dist/es/packages/imagepreview/style/style.harmony.css +3 -0
  36. package/dist/es/packages/input/input.js +13 -1
  37. package/dist/es/packages/numberkeyboard/style/style.harmony.css +3 -0
  38. package/dist/es/packages/picker/style/style.harmony.css +3 -0
  39. package/dist/es/packages/popover/style/style.harmony.css +3 -0
  40. package/dist/es/packages/popup/popup.js +49 -1
  41. package/dist/es/packages/popup/style/popup.scss +4 -0
  42. package/dist/es/packages/popup/style/style.css +3 -0
  43. package/dist/es/packages/popup/style/style.harmony.css +3 -0
  44. package/dist/es/packages/popup/style-jmapp/popup.scss +4 -0
  45. package/dist/es/packages/popup/style-jmapp/style.css +3 -0
  46. package/dist/es/packages/popup/style-jrkf/popup.scss +4 -0
  47. package/dist/es/packages/popup/style-jrkf/style.css +3 -0
  48. package/dist/es/packages/shortpassword/style/style.harmony.css +3 -0
  49. package/dist/es/packages/swipe/swipe.d.ts +1 -1
  50. package/dist/es/packages/timeselect/style/style.harmony.css +3 -0
  51. package/dist/es/packages/tour/style/style.harmony.css +3 -0
  52. package/dist/es/utils/taro/get-rect-by-id.js +13 -1
  53. package/dist/nutui.react.umd.js +128 -54
  54. package/dist/style-jmapp.css +1 -1
  55. package/dist/style-jmapp.scss +39 -39
  56. package/dist/style-jrkf.css +1 -1
  57. package/dist/style-jrkf.scss +39 -39
  58. package/dist/style.css +1 -1
  59. package/dist/style.scss +37 -37
  60. package/package.json +1 -1
@@ -142,6 +142,9 @@
142
142
  .nut-popup-bottom.nut-popup-round {
143
143
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
144
144
  }
145
+ .nut-popup-bottom-top {
146
+ position: absolute;
147
+ }
145
148
  .nut-popup-right {
146
149
  top: 0;
147
150
  right: 0;
@@ -142,6 +142,9 @@
142
142
  .nut-popup-bottom.nut-popup-round {
143
143
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
144
144
  }
145
+ .nut-popup-bottom-top {
146
+ position: absolute;
147
+ }
145
148
  .nut-popup-right {
146
149
  top: 0;
147
150
  right: 0;
@@ -5,6 +5,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
5
5
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
6
6
  import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
7
7
  import React, { useState, useEffect, useRef } from "react";
8
+ import { nextTick } from "@tarojs/taro";
8
9
  import { createPortal } from "react-dom";
9
10
  // import { CSSTransition } from 'react-transition-group'
10
11
  import classNames from "classnames";
@@ -52,6 +53,7 @@ export var Popup = function(props) {
52
53
  var _useState2 = _sliced_to_array(useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
53
54
  var _useState3 = _sliced_to_array(useState(''), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
54
55
  var nodeRef = useLockScrollTaro(innerVisible && lockScroll);
56
+ var topNodeRef = React.useRef(null);
55
57
  var rootRect = useRef(null);
56
58
  var touchStartRef = useRef(0);
57
59
  var touchMoveDistanceRef = useRef(0);
@@ -69,6 +71,7 @@ export var Popup = function(props) {
69
71
  var _obj;
70
72
  var popClassName = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), _define_property(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
71
73
  var _useState4 = _sliced_to_array(useState(''), 2), popupHeight = _useState4[0], setPopupHeight = _useState4[1];
74
+ var _useState5 = _sliced_to_array(useState(''), 2), topBottom = _useState5[0], setTopBottom = _useState5[1];
72
75
  var resizeStyles = function() {
73
76
  if (popupHeight !== '') {
74
77
  return {
@@ -90,6 +93,41 @@ export var Popup = function(props) {
90
93
  }
91
94
  onOpen && onOpen();
92
95
  };
96
+ var getPopupHeight = /*#__PURE__*/ function() {
97
+ var _ref = _async_to_generator(function() {
98
+ var _nodeRef_current, rect, height;
99
+ return _ts_generator(this, function(_state) {
100
+ switch(_state.label){
101
+ case 0:
102
+ return [
103
+ 4,
104
+ getRectInMultiPlatformWithoutCache(nodeRef.current)
105
+ ];
106
+ case 1:
107
+ rect = _state.sent();
108
+ height = ((_nodeRef_current = nodeRef.current) === null || _nodeRef_current === void 0 ? void 0 : _nodeRef_current.offsetHeight) || (rect === null || rect === void 0 ? void 0 : rect.height);
109
+ setTopBottom(pxTransform(height));
110
+ return [
111
+ 2
112
+ ];
113
+ }
114
+ });
115
+ });
116
+ return function getPopupHeight() {
117
+ return _ref.apply(this, arguments);
118
+ };
119
+ }();
120
+ useEffect(function() {
121
+ if (innerVisible && topNodeRef.current && nodeRef.current) {
122
+ nextTick(function() {
123
+ nextTick(function() {
124
+ getPopupHeight();
125
+ });
126
+ });
127
+ }
128
+ }, [
129
+ innerVisible
130
+ ]);
93
131
  var close = function() {
94
132
  if (innerVisible) {
95
133
  setInnerVisible(false);
@@ -117,6 +155,16 @@ export var Popup = function(props) {
117
155
  onClick: handleCloseIconClick
118
156
  }, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ React.createElement(Close, null)));
119
157
  };
158
+ var renderTop = function() {
159
+ if (!top) return null;
160
+ return /*#__PURE__*/ React.createElement(View, {
161
+ className: "".concat(classPrefix, "-bottom-top"),
162
+ ref: topNodeRef,
163
+ style: {
164
+ bottom: topBottom
165
+ }
166
+ }, top);
167
+ };
120
168
  var renderTitle = function() {
121
169
  if (left || title || description) {
122
170
  return /*#__PURE__*/ React.createElement(View, {
@@ -210,7 +258,7 @@ export var Popup = function(props) {
210
258
  onTouchMove: handleTouchMove,
211
259
  onTouchEnd: handleTouchEnd,
212
260
  onTouchCancel: handleTouchEnd
213
- }, top, renderTitle(), showChildren ? children : null);
261
+ }, renderTop(), renderTitle(), showChildren ? children : null);
214
262
  };
215
263
  // const renderPop = () => {
216
264
  // return (
@@ -96,6 +96,10 @@
96
96
  &.nut-popup-round {
97
97
  border-radius: $popup-border-radius $popup-border-radius 0 0;
98
98
  }
99
+
100
+ &-top {
101
+ position: absolute;
102
+ }
99
103
  }
100
104
 
101
105
  &-right {
@@ -88,6 +88,9 @@
88
88
  .nut-popup-bottom.nut-popup-round {
89
89
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
90
90
  }
91
+ .nut-popup-bottom-top {
92
+ position: absolute;
93
+ }
91
94
  .nut-popup-right {
92
95
  top: 0;
93
96
  right: 0;
@@ -142,6 +142,9 @@
142
142
  .nut-popup-bottom.nut-popup-round {
143
143
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
144
144
  }
145
+ .nut-popup-bottom-top {
146
+ position: absolute;
147
+ }
145
148
  .nut-popup-right {
146
149
  top: 0;
147
150
  right: 0;
@@ -96,6 +96,10 @@
96
96
  &.nut-popup-round {
97
97
  border-radius: $popup-border-radius $popup-border-radius 0 0;
98
98
  }
99
+
100
+ &-top {
101
+ position: absolute;
102
+ }
99
103
  }
100
104
 
101
105
  &-right {
@@ -88,6 +88,9 @@
88
88
  .nut-popup-bottom.nut-popup-round {
89
89
  border-radius: var(--nutui-popup-border-radius, 12px) var(--nutui-popup-border-radius, 12px) 0 0;
90
90
  }
91
+ .nut-popup-bottom-top {
92
+ position: absolute;
93
+ }
91
94
  .nut-popup-right {
92
95
  top: 0;
93
96
  right: 0;
@@ -96,6 +96,10 @@
96
96
  &.nut-popup-round {
97
97
  border-radius: $popup-border-radius $popup-border-radius 0 0;
98
98
  }
99
+
100
+ &-top {
101
+ position: absolute;
102
+ }
99
103
  }
100
104
 
101
105
  &-right {
@@ -88,6 +88,9 @@
88
88
  .nut-popup-bottom.nut-popup-round {
89
89
  border-radius: var(--nutui-popup-border-radius, 12px) var(--nutui-popup-border-radius, 12px) 0 0;
90
90
  }
91
+ .nut-popup-bottom-top {
92
+ position: absolute;
93
+ }
91
94
  .nut-popup-right {
92
95
  top: 0;
93
96
  right: 0;
@@ -142,6 +142,9 @@
142
142
  .nut-popup-bottom.nut-popup-round {
143
143
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
144
144
  }
145
+ .nut-popup-bottom-top {
146
+ position: absolute;
147
+ }
145
148
  .nut-popup-right {
146
149
  top: 0;
147
150
  right: 0;
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { SwipeRef, TaroSwipeProps } from "../../types";
3
- export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchStart" | "onTouchMove" | "onTouchEnd"> & React.RefAttributes<SwipeRef>>;
3
+ export declare const Swipe: React.ForwardRefExoticComponent<Partial<TaroSwipeProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onTouchEnd" | "onTouchMove" | "onTouchStart"> & React.RefAttributes<SwipeRef>>;
@@ -142,6 +142,9 @@
142
142
  .nut-popup-bottom.nut-popup-round {
143
143
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
144
144
  }
145
+ .nut-popup-bottom-top {
146
+ position: absolute;
147
+ }
145
148
  .nut-popup-right {
146
149
  top: 0;
147
150
  right: 0;
@@ -142,6 +142,9 @@
142
142
  .nut-popup-bottom.nut-popup-round {
143
143
  border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
144
144
  }
145
+ .nut-popup-bottom-top {
146
+ position: absolute;
147
+ }
145
148
  .nut-popup-right {
146
149
  top: 0;
147
150
  right: 0;
@@ -1,7 +1,19 @@
1
1
  import Taro, { createSelectorQuery } from "@tarojs/taro";
2
+ var ENV_TYPE = {
3
+ WEAPP: 'WEAPP',
4
+ SWAN: 'SWAN',
5
+ ALIPAY: 'ALIPAY',
6
+ TT: 'TT',
7
+ QQ: 'QQ',
8
+ JD: 'JD',
9
+ WEB: 'WEB',
10
+ RN: 'RN',
11
+ HARMONY: 'HARMONY',
12
+ QUICKAPP: 'QUICKAPP'
13
+ };
2
14
  export var getRectById = function(id) {
3
15
  return new Promise(function(resolve, reject) {
4
- if (Taro.getEnv() === Taro.ENV_TYPE.WEB) {
16
+ if (Taro.getEnv() === ENV_TYPE.WEB) {
5
17
  var t = document ? document.querySelector("#".concat(id)) : '';
6
18
  if (t) {
7
19
  resolve(t === null || t === void 0 ? void 0 : t.getBoundingClientRect());