@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.
- package/dist/cjs/hooks/taro/use-custom-event.js +1 -1
- package/dist/cjs/packages/actionsheet/style/style.harmony.css +3 -0
- package/dist/cjs/packages/address/style/style.harmony.css +3 -0
- package/dist/cjs/packages/button/button.d.ts +2 -5
- package/dist/cjs/packages/button/button.js +7 -9
- package/dist/cjs/packages/calendar/style/style.harmony.css +3 -0
- package/dist/cjs/packages/cascader/style/style.harmony.css +3 -0
- package/dist/cjs/packages/datepicker/style/style.harmony.css +3 -0
- package/dist/cjs/packages/imagepreview/style/style.harmony.css +3 -0
- package/dist/cjs/packages/input/input.js +13 -1
- package/dist/cjs/packages/numberkeyboard/style/style.harmony.css +3 -0
- package/dist/cjs/packages/picker/style/style.harmony.css +3 -0
- package/dist/cjs/packages/popover/style/style.harmony.css +3 -0
- package/dist/cjs/packages/popup/popup.js +49 -1
- package/dist/cjs/packages/popup/style/popup.scss +4 -0
- package/dist/cjs/packages/popup/style/style.css +3 -0
- package/dist/cjs/packages/popup/style/style.harmony.css +3 -0
- package/dist/cjs/packages/popup/style-jmapp/popup.scss +4 -0
- package/dist/cjs/packages/popup/style-jmapp/style.css +3 -0
- package/dist/cjs/packages/popup/style-jrkf/popup.scss +4 -0
- package/dist/cjs/packages/popup/style-jrkf/style.css +3 -0
- package/dist/cjs/packages/shortpassword/style/style.harmony.css +3 -0
- package/dist/cjs/packages/swipe/swipe.d.ts +1 -1
- package/dist/cjs/packages/timeselect/style/style.harmony.css +3 -0
- package/dist/cjs/packages/tour/style/style.harmony.css +3 -0
- package/dist/cjs/utils/taro/get-rect-by-id.js +13 -1
- package/dist/es/hooks/taro/use-custom-event.js +3 -2
- package/dist/es/packages/actionsheet/style/style.harmony.css +3 -0
- package/dist/es/packages/address/style/style.harmony.css +3 -0
- package/dist/es/packages/button/button.d.ts +2 -5
- package/dist/es/packages/button/button.js +10 -10
- package/dist/es/packages/calendar/style/style.harmony.css +3 -0
- package/dist/es/packages/cascader/style/style.harmony.css +3 -0
- package/dist/es/packages/datepicker/style/style.harmony.css +3 -0
- package/dist/es/packages/imagepreview/style/style.harmony.css +3 -0
- package/dist/es/packages/input/input.js +13 -1
- package/dist/es/packages/numberkeyboard/style/style.harmony.css +3 -0
- package/dist/es/packages/picker/style/style.harmony.css +3 -0
- package/dist/es/packages/popover/style/style.harmony.css +3 -0
- package/dist/es/packages/popup/popup.js +49 -1
- package/dist/es/packages/popup/style/popup.scss +4 -0
- package/dist/es/packages/popup/style/style.css +3 -0
- package/dist/es/packages/popup/style/style.harmony.css +3 -0
- package/dist/es/packages/popup/style-jmapp/popup.scss +4 -0
- package/dist/es/packages/popup/style-jmapp/style.css +3 -0
- package/dist/es/packages/popup/style-jrkf/popup.scss +4 -0
- package/dist/es/packages/popup/style-jrkf/style.css +3 -0
- package/dist/es/packages/shortpassword/style/style.harmony.css +3 -0
- package/dist/es/packages/swipe/swipe.d.ts +1 -1
- package/dist/es/packages/timeselect/style/style.harmony.css +3 -0
- package/dist/es/packages/tour/style/style.harmony.css +3 -0
- package/dist/es/utils/taro/get-rect-by-id.js +13 -1
- package/dist/nutui.react.umd.js +128 -54
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +39 -39
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +39 -39
- package/dist/style.css +1 -1
- package/dist/style.scss +37 -37
- 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
|
-
},
|
|
261
|
+
}, renderTop(), renderTitle(), showChildren ? children : null);
|
|
214
262
|
};
|
|
215
263
|
// const renderPop = () => {
|
|
216
264
|
// return (
|
|
@@ -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;
|
|
@@ -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>, "
|
|
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() ===
|
|
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());
|