@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
|
@@ -28,7 +28,7 @@ var _react = require("react");
|
|
|
28
28
|
var _reactfastcompare = /*#__PURE__*/ _interop_require_default._(require("react-fast-compare"));
|
|
29
29
|
var _taro = require("@tarojs/taro");
|
|
30
30
|
var _useforceupdate = require("../use-force-update");
|
|
31
|
-
var customEvents =
|
|
31
|
+
var customEvents = _taro.eventCenter;
|
|
32
32
|
function useCustomEventsPath(selector) {
|
|
33
33
|
var _getCurrentInstance_router;
|
|
34
34
|
selector = selector || '';
|
|
@@ -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;
|
|
@@ -285,6 +285,9 @@
|
|
|
285
285
|
.nut-popup-bottom.nut-popup-round {
|
|
286
286
|
border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
|
|
287
287
|
}
|
|
288
|
+
.nut-popup-bottom-top {
|
|
289
|
+
position: absolute;
|
|
290
|
+
}
|
|
288
291
|
.nut-popup-right {
|
|
289
292
|
top: 0;
|
|
290
293
|
right: 0;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
|
-
import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
|
|
4
3
|
import { BasicComponent } from "../../utils/typings";
|
|
5
|
-
type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style'>;
|
|
6
4
|
export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
7
5
|
export type ButtonSize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini';
|
|
8
6
|
export type ButtonShape = 'square' | 'round';
|
|
9
7
|
export type ButtonFill = 'solid' | 'outline' | 'dashed' | 'none';
|
|
10
|
-
export interface ButtonProps extends BasicComponent
|
|
8
|
+
export interface ButtonProps extends BasicComponent {
|
|
11
9
|
color: string;
|
|
12
10
|
shape: ButtonShape;
|
|
13
11
|
type: ButtonType;
|
|
@@ -21,5 +19,4 @@ export interface ButtonProps extends BasicComponent, OmitMiniProgramButtonProps
|
|
|
21
19
|
nativeType: 'submit' | 'reset';
|
|
22
20
|
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
23
21
|
}
|
|
24
|
-
export declare const Button: React.ForwardRefExoticComponent<
|
|
25
|
-
export {};
|
|
22
|
+
export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -18,7 +18,6 @@ var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
|
18
18
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
19
19
|
var _components = require("@tarojs/components");
|
|
20
20
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
21
|
-
var _taro = require("@tarojs/taro");
|
|
22
21
|
var _typings = require("../../utils/typings");
|
|
23
22
|
var _platform = require("../../utils/taro/platform");
|
|
24
23
|
var prefixCls = 'nut-button';
|
|
@@ -36,7 +35,7 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typing
|
|
|
36
35
|
onClick: function onClick(e) {}
|
|
37
36
|
});
|
|
38
37
|
var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
39
|
-
var _ref = (0, _object_spread._)({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style,
|
|
38
|
+
var _ref = (0, _object_spread._)({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style, nativeType = _ref.nativeType, onClick = _ref.onClick, rest = (0, _object_without_properties._)(_ref, [
|
|
40
39
|
"color",
|
|
41
40
|
"shape",
|
|
42
41
|
"fill",
|
|
@@ -50,7 +49,6 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
50
49
|
"children",
|
|
51
50
|
"className",
|
|
52
51
|
"style",
|
|
53
|
-
"formType",
|
|
54
52
|
"nativeType",
|
|
55
53
|
"onClick"
|
|
56
54
|
]);
|
|
@@ -104,16 +102,16 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
104
102
|
]);
|
|
105
103
|
var _obj;
|
|
106
104
|
var buttonClassNames = (0, _classnames.default)(prefixCls, "".concat(prefixCls, "-").concat(type), (_obj = {}, (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(type, "-solid"), type === 'primary' && !props.fill), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(fill), props.fill), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(type, "-").concat(fill), props.fill), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(size), size), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(shape), shape), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(shape, "-").concat(size), shape && size), (0, _define_property._)(_obj, "".concat(prefixCls, "-block"), block), (0, _define_property._)(_obj, "".concat(prefixCls, "-disabled"), disabled || loading), (0, _define_property._)(_obj, "".concat(prefixCls, "-").concat(type).concat(props.fill ? "-".concat(fill) : '', "-disabled"), disabled || loading), (0, _define_property._)(_obj, "".concat(prefixCls, "-loading"), loading), (0, _define_property._)(_obj, "".concat(prefixCls, "-icononly"), !children), _obj), className);
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
105
|
+
// if (getEnv() === 'WEB') {
|
|
106
|
+
// ;(rest as any).type = formType
|
|
107
|
+
// }
|
|
111
108
|
return(// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
112
109
|
// @ts-ignore
|
|
113
110
|
// eslint-disable-next-line react/button-has-type
|
|
114
|
-
|
|
111
|
+
// <TaroButton
|
|
112
|
+
/*#__PURE__*/ /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({}, rest), {
|
|
115
113
|
ref: ref,
|
|
116
|
-
|
|
114
|
+
// formType={formType || nativeType}
|
|
117
115
|
className: buttonClassNames,
|
|
118
116
|
style: (0, _object_spread._)({}, getStyle, style),
|
|
119
117
|
onClick: function onClick(e) {
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -21,6 +21,18 @@ var _utils = require("./utils");
|
|
|
21
21
|
var _index = require("../configprovider/index");
|
|
22
22
|
var _typings = require("../../utils/typings");
|
|
23
23
|
var _usepropsvalue = require("../../hooks/use-props-value");
|
|
24
|
+
var ENV_TYPE = {
|
|
25
|
+
WEAPP: 'WEAPP',
|
|
26
|
+
SWAN: 'SWAN',
|
|
27
|
+
ALIPAY: 'ALIPAY',
|
|
28
|
+
TT: 'TT',
|
|
29
|
+
QQ: 'QQ',
|
|
30
|
+
JD: 'JD',
|
|
31
|
+
WEB: 'WEB',
|
|
32
|
+
RN: 'RN',
|
|
33
|
+
HARMONY: 'HARMONY',
|
|
34
|
+
QUICKAPP: 'QUICKAPP'
|
|
35
|
+
};
|
|
24
36
|
var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
25
37
|
type: 'text',
|
|
26
38
|
name: '',
|
|
@@ -150,7 +162,7 @@ var Input = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
|
|
|
150
162
|
}, 200);
|
|
151
163
|
};
|
|
152
164
|
var inputType = function inputType(type) {
|
|
153
|
-
if ((0, _taro.getEnv)() ===
|
|
165
|
+
if ((0, _taro.getEnv)() === ENV_TYPE.WEB) {
|
|
154
166
|
if (type === 'digit') return 'text';
|
|
155
167
|
if (type === 'number') return 'tel';
|
|
156
168
|
} else if (type === 'password') {
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -17,6 +17,7 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
|
|
|
17
17
|
var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
|
|
18
18
|
var _ts_generator = require("@swc/helpers/_/_ts_generator");
|
|
19
19
|
var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
20
|
+
var _taro = require("@tarojs/taro");
|
|
20
21
|
var _reactdom = require("react-dom");
|
|
21
22
|
var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
|
|
22
23
|
var _iconsreacttaro = require("@nutui/icons-react-taro");
|
|
@@ -63,6 +64,7 @@ var Popup = function Popup(props) {
|
|
|
63
64
|
var _useState2 = (0, _sliced_to_array._)((0, _react.useState)(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
64
65
|
var _useState3 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
|
|
65
66
|
var nodeRef = (0, _uselockscoll.useLockScrollTaro)(innerVisible && lockScroll);
|
|
67
|
+
var topNodeRef = _react.default.useRef(null);
|
|
66
68
|
var rootRect = (0, _react.useRef)(null);
|
|
67
69
|
var touchStartRef = (0, _react.useRef)(0);
|
|
68
70
|
var touchMoveDistanceRef = (0, _react.useRef)(0);
|
|
@@ -80,6 +82,7 @@ var Popup = function Popup(props) {
|
|
|
80
82
|
var _obj;
|
|
81
83
|
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);
|
|
82
84
|
var _useState4 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), popupHeight = _useState4[0], setPopupHeight = _useState4[1];
|
|
85
|
+
var _useState5 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), topBottom = _useState5[0], setTopBottom = _useState5[1];
|
|
83
86
|
var resizeStyles = function resizeStyles() {
|
|
84
87
|
if (popupHeight !== '') {
|
|
85
88
|
return {
|
|
@@ -101,6 +104,41 @@ var Popup = function Popup(props) {
|
|
|
101
104
|
}
|
|
102
105
|
onOpen && onOpen();
|
|
103
106
|
};
|
|
107
|
+
var getPopupHeight = /*#__PURE__*/ function() {
|
|
108
|
+
var _ref = (0, _async_to_generator._)(function() {
|
|
109
|
+
var _nodeRef_current, rect, height;
|
|
110
|
+
return (0, _ts_generator._)(this, function(_state) {
|
|
111
|
+
switch(_state.label){
|
|
112
|
+
case 0:
|
|
113
|
+
return [
|
|
114
|
+
4,
|
|
115
|
+
(0, _getrect.getRectInMultiPlatformWithoutCache)(nodeRef.current)
|
|
116
|
+
];
|
|
117
|
+
case 1:
|
|
118
|
+
rect = _state.sent();
|
|
119
|
+
height = ((_nodeRef_current = nodeRef.current) === null || _nodeRef_current === void 0 ? void 0 : _nodeRef_current.offsetHeight) || (rect === null || rect === void 0 ? void 0 : rect.height);
|
|
120
|
+
setTopBottom((0, _pxtransform.pxTransform)(height));
|
|
121
|
+
return [
|
|
122
|
+
2
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
return function getPopupHeight() {
|
|
128
|
+
return _ref.apply(this, arguments);
|
|
129
|
+
};
|
|
130
|
+
}();
|
|
131
|
+
(0, _react.useEffect)(function() {
|
|
132
|
+
if (innerVisible && topNodeRef.current && nodeRef.current) {
|
|
133
|
+
(0, _taro.nextTick)(function() {
|
|
134
|
+
(0, _taro.nextTick)(function() {
|
|
135
|
+
getPopupHeight();
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}, [
|
|
140
|
+
innerVisible
|
|
141
|
+
]);
|
|
104
142
|
var close = function close() {
|
|
105
143
|
if (innerVisible) {
|
|
106
144
|
setInnerVisible(false);
|
|
@@ -128,6 +166,16 @@ var Popup = function Popup(props) {
|
|
|
128
166
|
onClick: handleCloseIconClick
|
|
129
167
|
}, /*#__PURE__*/ _react.default.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close, null)));
|
|
130
168
|
};
|
|
169
|
+
var renderTop = function renderTop() {
|
|
170
|
+
if (!top) return null;
|
|
171
|
+
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
172
|
+
className: "".concat(classPrefix, "-bottom-top"),
|
|
173
|
+
ref: topNodeRef,
|
|
174
|
+
style: {
|
|
175
|
+
bottom: topBottom
|
|
176
|
+
}
|
|
177
|
+
}, top);
|
|
178
|
+
};
|
|
131
179
|
var renderTitle = function renderTitle() {
|
|
132
180
|
if (left || title || description) {
|
|
133
181
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
@@ -221,7 +269,7 @@ var Popup = function Popup(props) {
|
|
|
221
269
|
onTouchMove: handleTouchMove,
|
|
222
270
|
onTouchEnd: handleTouchEnd,
|
|
223
271
|
onTouchCancel: handleTouchEnd
|
|
224
|
-
},
|
|
272
|
+
}, renderTop(), renderTitle(), showChildren ? children : null);
|
|
225
273
|
};
|
|
226
274
|
// const renderPop = () => {
|
|
227
275
|
// 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;
|
|
@@ -10,9 +10,21 @@ Object.defineProperty(exports, "getRectById", {
|
|
|
10
10
|
});
|
|
11
11
|
var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
var _taro = /*#__PURE__*/ _interop_require_wildcard._(require("@tarojs/taro"));
|
|
13
|
+
var ENV_TYPE = {
|
|
14
|
+
WEAPP: 'WEAPP',
|
|
15
|
+
SWAN: 'SWAN',
|
|
16
|
+
ALIPAY: 'ALIPAY',
|
|
17
|
+
TT: 'TT',
|
|
18
|
+
QQ: 'QQ',
|
|
19
|
+
JD: 'JD',
|
|
20
|
+
WEB: 'WEB',
|
|
21
|
+
RN: 'RN',
|
|
22
|
+
HARMONY: 'HARMONY',
|
|
23
|
+
QUICKAPP: 'QUICKAPP'
|
|
24
|
+
};
|
|
13
25
|
var getRectById = function getRectById(id) {
|
|
14
26
|
return new Promise(function(resolve, reject) {
|
|
15
|
-
if (_taro.default.getEnv() ===
|
|
27
|
+
if (_taro.default.getEnv() === ENV_TYPE.WEB) {
|
|
16
28
|
var t = document ? document.querySelector("#".concat(id)) : '';
|
|
17
29
|
if (t) {
|
|
18
30
|
resolve(t === null || t === void 0 ? void 0 : t.getBoundingClientRect());
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import isEqual from "react-fast-compare";
|
|
4
|
-
import {
|
|
4
|
+
import { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
5
5
|
import { useForceUpdate } from "../use-force-update";
|
|
6
|
-
export
|
|
6
|
+
// export const customEvents = new Events()
|
|
7
|
+
export var customEvents = eventCenter;
|
|
7
8
|
export function useCustomEventsPath(selector) {
|
|
8
9
|
var _getCurrentInstance_router;
|
|
9
10
|
selector = selector || '';
|
|
@@ -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;
|
|
@@ -285,6 +285,9 @@
|
|
|
285
285
|
.nut-popup-bottom.nut-popup-round {
|
|
286
286
|
border-radius: var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) var(--nutui-popup-border-radius, var(--nutui-radius-xl, 12px)) 0 0;
|
|
287
287
|
}
|
|
288
|
+
.nut-popup-bottom-top {
|
|
289
|
+
position: absolute;
|
|
290
|
+
}
|
|
288
291
|
.nut-popup-right {
|
|
289
292
|
top: 0;
|
|
290
293
|
right: 0;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MouseEvent } from 'react';
|
|
3
|
-
import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
|
|
4
3
|
import { BasicComponent } from "../../utils/typings";
|
|
5
|
-
type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style'>;
|
|
6
4
|
export type ButtonType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
7
5
|
export type ButtonSize = 'xlarge' | 'large' | 'normal' | 'small' | 'mini';
|
|
8
6
|
export type ButtonShape = 'square' | 'round';
|
|
9
7
|
export type ButtonFill = 'solid' | 'outline' | 'dashed' | 'none';
|
|
10
|
-
export interface ButtonProps extends BasicComponent
|
|
8
|
+
export interface ButtonProps extends BasicComponent {
|
|
11
9
|
color: string;
|
|
12
10
|
shape: ButtonShape;
|
|
13
11
|
type: ButtonType;
|
|
@@ -21,5 +19,4 @@ export interface ButtonProps extends BasicComponent, OmitMiniProgramButtonProps
|
|
|
21
19
|
nativeType: 'submit' | 'reset';
|
|
22
20
|
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
23
21
|
}
|
|
24
|
-
export declare const Button: React.ForwardRefExoticComponent<
|
|
25
|
-
export {};
|
|
22
|
+
export declare const Button: React.ForwardRefExoticComponent<Partial<ButtonProps> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,9 +4,9 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
4
4
|
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
5
|
import React, { useCallback, useMemo } from "react";
|
|
6
6
|
import classNames from "classnames";
|
|
7
|
-
import {
|
|
7
|
+
import { // ButtonProps as MiniProgramButtonProps,
|
|
8
|
+
View } from "@tarojs/components";
|
|
8
9
|
import { Loading } from "@nutui/icons-react-taro";
|
|
9
|
-
import { getEnv } from "@tarojs/taro";
|
|
10
10
|
import { ComponentDefaults } from "../../utils/typings";
|
|
11
11
|
import { harmony } from "../../utils/taro/platform";
|
|
12
12
|
var prefixCls = 'nut-button';
|
|
@@ -24,7 +24,8 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
24
24
|
onClick: function(e) {}
|
|
25
25
|
});
|
|
26
26
|
export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
27
|
-
var _ref = _object_spread({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style,
|
|
27
|
+
var _ref = _object_spread({}, defaultProps, props), color = _ref.color, shape = _ref.shape, fill = _ref.fill, loading = _ref.loading, disabled = _ref.disabled, type = _ref.type, size = _ref.size, block = _ref.block, icon = _ref.icon, rightIcon = _ref.rightIcon, children = _ref.children, className = _ref.className, style = _ref.style, // formType,
|
|
28
|
+
nativeType = _ref.nativeType, onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
28
29
|
"color",
|
|
29
30
|
"shape",
|
|
30
31
|
"fill",
|
|
@@ -38,7 +39,6 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
38
39
|
"children",
|
|
39
40
|
"className",
|
|
40
41
|
"style",
|
|
41
|
-
"formType",
|
|
42
42
|
"nativeType",
|
|
43
43
|
"onClick"
|
|
44
44
|
]);
|
|
@@ -92,17 +92,17 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
92
92
|
]);
|
|
93
93
|
var _obj;
|
|
94
94
|
var buttonClassNames = classNames(prefixCls, "".concat(prefixCls, "-").concat(type), (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-").concat(type, "-solid"), type === 'primary' && !props.fill), _define_property(_obj, "".concat(prefixCls, "-").concat(fill), props.fill), _define_property(_obj, "".concat(prefixCls, "-").concat(type, "-").concat(fill), props.fill), _define_property(_obj, "".concat(prefixCls, "-").concat(size), size), _define_property(_obj, "".concat(prefixCls, "-").concat(shape), shape), _define_property(_obj, "".concat(prefixCls, "-").concat(shape, "-").concat(size), shape && size), _define_property(_obj, "".concat(prefixCls, "-block"), block), _define_property(_obj, "".concat(prefixCls, "-disabled"), disabled || loading), _define_property(_obj, "".concat(prefixCls, "-").concat(type).concat(props.fill ? "-".concat(fill) : '', "-disabled"), disabled || loading), _define_property(_obj, "".concat(prefixCls, "-loading"), loading), _define_property(_obj, "".concat(prefixCls, "-icononly"), !children), _obj), className);
|
|
95
|
-
if (getEnv() === 'WEB') {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
95
|
+
// if (getEnv() === 'WEB') {
|
|
96
|
+
// ;(rest as any).type = formType
|
|
97
|
+
// }
|
|
99
98
|
return (
|
|
100
99
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
101
100
|
// @ts-ignore
|
|
102
101
|
// eslint-disable-next-line react/button-has-type
|
|
103
|
-
|
|
102
|
+
// <TaroButton
|
|
103
|
+
/*#__PURE__*/ (React.createElement(View, _object_spread_props(_object_spread({}, rest), {
|
|
104
104
|
ref: ref,
|
|
105
|
-
|
|
105
|
+
// formType={formType || nativeType}
|
|
106
106
|
className: buttonClassNames,
|
|
107
107
|
style: _object_spread({}, getStyle, style),
|
|
108
108
|
onClick: function(e) {
|
|
@@ -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;
|
|
@@ -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,11 +5,23 @@ import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
|
5
5
|
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from "react";
|
|
6
6
|
import { Input as TaroInput, View } from "@tarojs/components";
|
|
7
7
|
import { MaskClose } from "@nutui/icons-react-taro";
|
|
8
|
-
import Taro, {
|
|
8
|
+
import Taro, { getEnv } from "@tarojs/taro";
|
|
9
9
|
import { formatNumber } from "./utils";
|
|
10
10
|
import { useConfig, useRtl } from "../configprovider/index";
|
|
11
11
|
import { ComponentDefaults } from "../../utils/typings";
|
|
12
12
|
import { usePropsValue } from "../../hooks/use-props-value";
|
|
13
|
+
var ENV_TYPE = {
|
|
14
|
+
WEAPP: 'WEAPP',
|
|
15
|
+
SWAN: 'SWAN',
|
|
16
|
+
ALIPAY: 'ALIPAY',
|
|
17
|
+
TT: 'TT',
|
|
18
|
+
QQ: 'QQ',
|
|
19
|
+
JD: 'JD',
|
|
20
|
+
WEB: 'WEB',
|
|
21
|
+
RN: 'RN',
|
|
22
|
+
HARMONY: 'HARMONY',
|
|
23
|
+
QUICKAPP: 'QUICKAPP'
|
|
24
|
+
};
|
|
13
25
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
14
26
|
type: 'text',
|
|
15
27
|
name: '',
|
|
@@ -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;
|