@nutui/nutui-react-taro 3.0.19-cpp.18 → 3.0.19-cpp.19
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/packages/button/button.js +1 -5
- package/dist/cjs/packages/dialog/content.js +2 -6
- package/dist/cjs/packages/dialog/dialog.js +3 -7
- package/dist/cjs/packages/overlay/overlay.js +4 -9
- package/dist/cjs/packages/popup/popup.js +1 -3
- package/dist/es/packages/button/button.js +1 -5
- package/dist/es/packages/dialog/content.js +2 -6
- package/dist/es/packages/dialog/dialog.js +3 -7
- package/dist/es/packages/overlay/overlay.js +4 -9
- package/dist/es/packages/popup/popup.js +1 -3
- package/dist/nutui.react.umd.js +11 -29
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +31 -31
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +33 -33
- package/dist/style.css +1 -1
- package/dist/style.scss +34 -34
- package/package.json +1 -1
|
@@ -52,7 +52,6 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
52
52
|
"nativeType",
|
|
53
53
|
"onClick"
|
|
54
54
|
]);
|
|
55
|
-
var role = 'button';
|
|
56
55
|
var getStyle = (0, _react.useMemo)(function() {
|
|
57
56
|
var style = {};
|
|
58
57
|
if (color) {
|
|
@@ -117,10 +116,7 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
|
|
|
117
116
|
style: (0, _object_spread._)({}, getStyle, style),
|
|
118
117
|
onClick: function onClick(e) {
|
|
119
118
|
return handleClick(e);
|
|
120
|
-
}
|
|
121
|
-
ariaRole: role,
|
|
122
|
-
// @ts-ignore
|
|
123
|
-
ariaDisabled: disabled
|
|
119
|
+
}
|
|
124
120
|
}), /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
125
121
|
className: "nut-button-wrap"
|
|
126
122
|
}, loading && /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading, {
|
|
@@ -32,7 +32,7 @@ var defaultContentProps = {
|
|
|
32
32
|
onClick: function onClick() {}
|
|
33
33
|
};
|
|
34
34
|
var Content = function Content(props) {
|
|
35
|
-
var _$_object_spread = (0, _object_spread._)({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick
|
|
35
|
+
var _$_object_spread = (0, _object_spread._)({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick;
|
|
36
36
|
var classPrefix = 'nut-dialog';
|
|
37
37
|
var renderHeader = function renderHeader() {
|
|
38
38
|
return title && /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
@@ -52,11 +52,7 @@ var Content = function Content(props) {
|
|
|
52
52
|
style: style,
|
|
53
53
|
onClick: function onClick(e) {
|
|
54
54
|
return handleClick(e);
|
|
55
|
-
}
|
|
56
|
-
ariaRole: ariaRole,
|
|
57
|
-
ariaLabel: ariaLabel,
|
|
58
|
-
// @ts-ignore
|
|
59
|
-
tabIndex: -1
|
|
55
|
+
}
|
|
60
56
|
}, close, header, /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
61
57
|
className: classPrefix,
|
|
62
58
|
style: {
|
|
@@ -70,15 +70,13 @@ var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _overla
|
|
|
70
70
|
onConfirm: function onConfirm() {},
|
|
71
71
|
onOverlayClick: function onOverlayClick() {
|
|
72
72
|
return true;
|
|
73
|
-
}
|
|
74
|
-
ariaLabel: 'dialog'
|
|
73
|
+
}
|
|
75
74
|
});
|
|
76
75
|
var BaseDialog = function BaseDialog(props) {
|
|
77
|
-
var _useParams = (0, _usecustomevent.useParams)((0, _mergeprops.mergeProps)(defaultProps, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick,
|
|
76
|
+
var _useParams = (0, _usecustomevent.useParams)((0, _mergeprops.mergeProps)(defaultProps, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick, setParams = _useParams.setParams;
|
|
78
77
|
var classPrefix = 'nut-dialog';
|
|
79
78
|
var locale = (0, _configprovider.useConfig)().locale;
|
|
80
79
|
var _useState = (0, _sliced_to_array._)((0, _react.useState)(false), 2), loading = _useState[0], setLoading = _useState[1];
|
|
81
|
-
var role = 'dialog';
|
|
82
80
|
(0, _usecustomevent.useCustomEvent)(id, function(param) {
|
|
83
81
|
var status = param.status, options = param.options;
|
|
84
82
|
setParams((0, _object_spread_props._)((0, _object_spread._)({}, options), {
|
|
@@ -243,9 +241,7 @@ var BaseDialog = function BaseDialog(props) {
|
|
|
243
241
|
close: renderCloseIcon(),
|
|
244
242
|
footer: renderFooter(),
|
|
245
243
|
footerDirection: footerDirection,
|
|
246
|
-
visible: visible
|
|
247
|
-
ariaRole: role,
|
|
248
|
-
ariaLabel: ariaLabel
|
|
244
|
+
visible: visible
|
|
249
245
|
}, content || children));
|
|
250
246
|
};
|
|
251
247
|
return /*#__PURE__*/ _react.default.createElement(_components.View, {
|
|
@@ -27,7 +27,6 @@ var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames")
|
|
|
27
27
|
var _components = require("@tarojs/components");
|
|
28
28
|
var _typings = require("../../utils/typings");
|
|
29
29
|
var _uselockscoll = require("../../hooks/taro/use-lock-scoll");
|
|
30
|
-
var _configprovider = require("../configprovider/configprovider");
|
|
31
30
|
var defaultOverlayProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
|
|
32
31
|
zIndex: 1000,
|
|
33
32
|
duration: 300,
|
|
@@ -39,7 +38,7 @@ var defaultOverlayProps = (0, _object_spread_props._)((0, _object_spread._)({},
|
|
|
39
38
|
afterClose: function afterClose() {}
|
|
40
39
|
});
|
|
41
40
|
var Overlay = function Overlay(props) {
|
|
42
|
-
var _ref = (0, _object_spread._)({}, defaultOverlayProps, props), children = _ref.children, zIndex = _ref.zIndex, duration = _ref.duration, className = _ref.className, closeOnOverlayClick = _ref.closeOnOverlayClick, visible = _ref.visible, lockScroll = _ref.lockScroll, style = _ref.style, afterShow = _ref.afterShow, afterClose = _ref.afterClose, onClick = _ref.onClick,
|
|
41
|
+
var _ref = (0, _object_spread._)({}, defaultOverlayProps, props), children = _ref.children, zIndex = _ref.zIndex, duration = _ref.duration, className = _ref.className, closeOnOverlayClick = _ref.closeOnOverlayClick, visible = _ref.visible, lockScroll = _ref.lockScroll, style = _ref.style, afterShow = _ref.afterShow, afterClose = _ref.afterClose, onClick = _ref.onClick, rest = (0, _object_without_properties._)(_ref, [
|
|
43
42
|
"children",
|
|
44
43
|
"zIndex",
|
|
45
44
|
"duration",
|
|
@@ -50,13 +49,11 @@ var Overlay = function Overlay(props) {
|
|
|
50
49
|
"style",
|
|
51
50
|
"afterShow",
|
|
52
51
|
"afterClose",
|
|
53
|
-
"onClick"
|
|
54
|
-
"ariaLabel"
|
|
52
|
+
"onClick"
|
|
55
53
|
]);
|
|
56
54
|
var classPrefix = 'nut-overlay';
|
|
57
55
|
var _useState = (0, _sliced_to_array._)((0, _react.useState)(visible), 2), innerVisible = _useState[0], setInnerVisible = _useState[1];
|
|
58
56
|
var nodeRef = (0, _uselockscoll.useLockScrollTaro)(!!lockScroll && innerVisible);
|
|
59
|
-
var locale = (0, _configprovider.useConfig)().locale;
|
|
60
57
|
(0, _react.useEffect)(function() {
|
|
61
58
|
setInnerVisible(visible);
|
|
62
59
|
}, [
|
|
@@ -72,7 +69,7 @@ var Overlay = function Overlay(props) {
|
|
|
72
69
|
}
|
|
73
70
|
};
|
|
74
71
|
var renderOverlay = function renderOverlay() {
|
|
75
|
-
return /*#__PURE__*/ _react.default.createElement(_components.View, (0,
|
|
72
|
+
return /*#__PURE__*/ _react.default.createElement(_components.View, (0, _object_spread_props._)((0, _object_spread._)({
|
|
76
73
|
ref: nodeRef,
|
|
77
74
|
className: classes,
|
|
78
75
|
style: (0, _object_spread_props._)((0, _object_spread._)({}, styles), {
|
|
@@ -81,9 +78,7 @@ var Overlay = function Overlay(props) {
|
|
|
81
78
|
}, rest), {
|
|
82
79
|
catchMove: lockScroll,
|
|
83
80
|
onClick: handleClick
|
|
84
|
-
}),
|
|
85
|
-
ariaLabel: ariaLabel || locale.mask
|
|
86
|
-
} : {}), children);
|
|
81
|
+
}), children);
|
|
87
82
|
};
|
|
88
83
|
return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, renderOverlay());
|
|
89
84
|
// return (
|
|
@@ -85,7 +85,6 @@ var Popup = function Popup(props) {
|
|
|
85
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
86
|
var _useState4 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), popupHeight = _useState4[0], setPopupHeight = _useState4[1];
|
|
87
87
|
var _useState5 = (0, _sliced_to_array._)((0, _react.useState)(''), 2), topBottom = _useState5[0], setTopBottom = _useState5[1];
|
|
88
|
-
var role = 'dialog';
|
|
89
88
|
var resizeStyles = function resizeStyles() {
|
|
90
89
|
if (popupHeight !== '') {
|
|
91
90
|
return {
|
|
@@ -267,8 +266,7 @@ var Popup = function Popup(props) {
|
|
|
267
266
|
onTouchStart: handleTouchStart,
|
|
268
267
|
onTouchMove: handleTouchMove,
|
|
269
268
|
onTouchEnd: handleTouchEnd,
|
|
270
|
-
onTouchCancel: handleTouchEnd
|
|
271
|
-
ariaRole: role
|
|
269
|
+
onTouchCancel: handleTouchEnd
|
|
272
270
|
}, renderTop(), renderTitle(), showChildren ? children : null);
|
|
273
271
|
};
|
|
274
272
|
// const renderPop = () => {
|
|
@@ -42,7 +42,6 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
42
42
|
"nativeType",
|
|
43
43
|
"onClick"
|
|
44
44
|
]);
|
|
45
|
-
var role = 'button';
|
|
46
45
|
var getStyle = useMemo(function() {
|
|
47
46
|
var style = {};
|
|
48
47
|
if (color) {
|
|
@@ -108,10 +107,7 @@ export var Button = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
|
108
107
|
style: _object_spread({}, getStyle, style),
|
|
109
108
|
onClick: function(e) {
|
|
110
109
|
return handleClick(e);
|
|
111
|
-
}
|
|
112
|
-
ariaRole: role,
|
|
113
|
-
// @ts-ignore
|
|
114
|
-
ariaDisabled: disabled
|
|
110
|
+
}
|
|
115
111
|
}), /*#__PURE__*/ React.createElement(View, {
|
|
116
112
|
className: "nut-button-wrap"
|
|
117
113
|
}, loading && /*#__PURE__*/ React.createElement(Loading, {
|
|
@@ -13,7 +13,7 @@ export var defaultContentProps = {
|
|
|
13
13
|
onClick: function() {}
|
|
14
14
|
};
|
|
15
15
|
export var Content = function(props) {
|
|
16
|
-
var _$_object_spread = _object_spread({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick
|
|
16
|
+
var _$_object_spread = _object_spread({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick;
|
|
17
17
|
var classPrefix = 'nut-dialog';
|
|
18
18
|
var renderHeader = function() {
|
|
19
19
|
return title && /*#__PURE__*/ React.createElement(View, {
|
|
@@ -33,11 +33,7 @@ export var Content = function(props) {
|
|
|
33
33
|
style: style,
|
|
34
34
|
onClick: function(e) {
|
|
35
35
|
return handleClick(e);
|
|
36
|
-
}
|
|
37
|
-
ariaRole: ariaRole,
|
|
38
|
-
ariaLabel: ariaLabel,
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
tabIndex: -1
|
|
36
|
+
}
|
|
41
37
|
}, close, header, /*#__PURE__*/ React.createElement(View, {
|
|
42
38
|
className: classPrefix,
|
|
43
39
|
style: {
|
|
@@ -47,15 +47,13 @@ var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps,
|
|
|
47
47
|
onConfirm: function() {},
|
|
48
48
|
onOverlayClick: function() {
|
|
49
49
|
return true;
|
|
50
|
-
}
|
|
51
|
-
ariaLabel: 'dialog'
|
|
50
|
+
}
|
|
52
51
|
});
|
|
53
52
|
export var BaseDialog = function(props) {
|
|
54
|
-
var _useParams = useParams(mergeProps(defaultProps, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick,
|
|
53
|
+
var _useParams = useParams(mergeProps(defaultProps, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick, setParams = _useParams.setParams;
|
|
55
54
|
var classPrefix = 'nut-dialog';
|
|
56
55
|
var locale = useConfig().locale;
|
|
57
56
|
var _useState = _sliced_to_array(useState(false), 2), loading = _useState[0], setLoading = _useState[1];
|
|
58
|
-
var role = 'dialog';
|
|
59
57
|
useCustomEvent(id, function(param) {
|
|
60
58
|
var status = param.status, options = param.options;
|
|
61
59
|
setParams(_object_spread_props(_object_spread({}, options), {
|
|
@@ -221,9 +219,7 @@ export var BaseDialog = function(props) {
|
|
|
221
219
|
close: renderCloseIcon(),
|
|
222
220
|
footer: renderFooter(),
|
|
223
221
|
footerDirection: footerDirection,
|
|
224
|
-
visible: visible
|
|
225
|
-
ariaRole: role,
|
|
226
|
-
ariaLabel: ariaLabel
|
|
222
|
+
visible: visible
|
|
227
223
|
}, content || children))
|
|
228
224
|
);
|
|
229
225
|
};
|
|
@@ -7,7 +7,6 @@ import classNames from "classnames";
|
|
|
7
7
|
import { View } from "@tarojs/components";
|
|
8
8
|
import { ComponentDefaults } from "../../utils/typings";
|
|
9
9
|
import { useLockScrollTaro } from "../../hooks/taro/use-lock-scoll";
|
|
10
|
-
import { useConfig } from "../configprovider/configprovider";
|
|
11
10
|
export var defaultOverlayProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
11
|
zIndex: 1000,
|
|
13
12
|
duration: 300,
|
|
@@ -19,7 +18,7 @@ export var defaultOverlayProps = _object_spread_props(_object_spread({}, Compone
|
|
|
19
18
|
afterClose: function() {}
|
|
20
19
|
});
|
|
21
20
|
export var Overlay = function(props) {
|
|
22
|
-
var _ref = _object_spread({}, defaultOverlayProps, props), children = _ref.children, zIndex = _ref.zIndex, duration = _ref.duration, className = _ref.className, closeOnOverlayClick = _ref.closeOnOverlayClick, visible = _ref.visible, lockScroll = _ref.lockScroll, style = _ref.style, afterShow = _ref.afterShow, afterClose = _ref.afterClose, onClick = _ref.onClick,
|
|
21
|
+
var _ref = _object_spread({}, defaultOverlayProps, props), children = _ref.children, zIndex = _ref.zIndex, duration = _ref.duration, className = _ref.className, closeOnOverlayClick = _ref.closeOnOverlayClick, visible = _ref.visible, lockScroll = _ref.lockScroll, style = _ref.style, afterShow = _ref.afterShow, afterClose = _ref.afterClose, onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
23
22
|
"children",
|
|
24
23
|
"zIndex",
|
|
25
24
|
"duration",
|
|
@@ -30,13 +29,11 @@ export var Overlay = function(props) {
|
|
|
30
29
|
"style",
|
|
31
30
|
"afterShow",
|
|
32
31
|
"afterClose",
|
|
33
|
-
"onClick"
|
|
34
|
-
"ariaLabel"
|
|
32
|
+
"onClick"
|
|
35
33
|
]);
|
|
36
34
|
var classPrefix = 'nut-overlay';
|
|
37
35
|
var _useState = _sliced_to_array(useState(visible), 2), innerVisible = _useState[0], setInnerVisible = _useState[1];
|
|
38
36
|
var nodeRef = useLockScrollTaro(!!lockScroll && innerVisible);
|
|
39
|
-
var locale = useConfig().locale;
|
|
40
37
|
useEffect(function() {
|
|
41
38
|
setInnerVisible(visible);
|
|
42
39
|
}, [
|
|
@@ -52,7 +49,7 @@ export var Overlay = function(props) {
|
|
|
52
49
|
}
|
|
53
50
|
};
|
|
54
51
|
var renderOverlay = function() {
|
|
55
|
-
return /*#__PURE__*/ React.createElement(View,
|
|
52
|
+
return /*#__PURE__*/ React.createElement(View, _object_spread_props(_object_spread({
|
|
56
53
|
ref: nodeRef,
|
|
57
54
|
className: classes,
|
|
58
55
|
style: _object_spread_props(_object_spread({}, styles), {
|
|
@@ -61,9 +58,7 @@ export var Overlay = function(props) {
|
|
|
61
58
|
}, rest), {
|
|
62
59
|
catchMove: lockScroll,
|
|
63
60
|
onClick: handleClick
|
|
64
|
-
}),
|
|
65
|
-
ariaLabel: ariaLabel || locale.mask
|
|
66
|
-
} : {}), children);
|
|
61
|
+
}), children);
|
|
67
62
|
};
|
|
68
63
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, renderOverlay());
|
|
69
64
|
// return (
|
|
@@ -74,7 +74,6 @@ export var Popup = function(props) {
|
|
|
74
74
|
var popClassName = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), _define_property(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
|
|
75
75
|
var _useState4 = _sliced_to_array(useState(''), 2), popupHeight = _useState4[0], setPopupHeight = _useState4[1];
|
|
76
76
|
var _useState5 = _sliced_to_array(useState(''), 2), topBottom = _useState5[0], setTopBottom = _useState5[1];
|
|
77
|
-
var role = 'dialog';
|
|
78
77
|
var resizeStyles = function() {
|
|
79
78
|
if (popupHeight !== '') {
|
|
80
79
|
return {
|
|
@@ -256,8 +255,7 @@ export var Popup = function(props) {
|
|
|
256
255
|
onTouchStart: handleTouchStart,
|
|
257
256
|
onTouchMove: handleTouchMove,
|
|
258
257
|
onTouchEnd: handleTouchEnd,
|
|
259
|
-
onTouchCancel: handleTouchEnd
|
|
260
|
-
ariaRole: role
|
|
258
|
+
onTouchCancel: handleTouchEnd
|
|
261
259
|
}, renderTop(), renderTitle(), showChildren ? children : null);
|
|
262
260
|
};
|
|
263
261
|
// const renderPop = () => {
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -497,7 +497,6 @@
|
|
|
497
497
|
"nativeType",
|
|
498
498
|
"onClick"
|
|
499
499
|
]);
|
|
500
|
-
var role = "button";
|
|
501
500
|
var getStyle = React.useMemo(function() {
|
|
502
501
|
var style2 = {};
|
|
503
502
|
if (color) {
|
|
@@ -560,10 +559,7 @@
|
|
|
560
559
|
style: _object_spread({}, getStyle, style),
|
|
561
560
|
onClick: function(e) {
|
|
562
561
|
return handleClick(e);
|
|
563
|
-
}
|
|
564
|
-
ariaRole: role,
|
|
565
|
-
// @ts-ignore
|
|
566
|
-
ariaDisabled: disabled
|
|
562
|
+
}
|
|
567
563
|
}), /* @__PURE__ */ React.createElement(components.View, {
|
|
568
564
|
className: "nut-button-wrap"
|
|
569
565
|
}, loading && /* @__PURE__ */ React.createElement(IconSVG$i, {
|
|
@@ -1644,7 +1640,7 @@
|
|
|
1644
1640
|
var className = _ref.className, closeOnOverlayClick = _ref.closeOnOverlayClick, visible = _ref.visible, lockScroll = _ref.lockScroll, style = _ref.style;
|
|
1645
1641
|
_ref.afterShow;
|
|
1646
1642
|
_ref.afterClose;
|
|
1647
|
-
var onClick = _ref.onClick,
|
|
1643
|
+
var onClick = _ref.onClick, rest = _object_without_properties(_ref, [
|
|
1648
1644
|
"children",
|
|
1649
1645
|
"zIndex",
|
|
1650
1646
|
"duration",
|
|
@@ -1655,13 +1651,11 @@
|
|
|
1655
1651
|
"style",
|
|
1656
1652
|
"afterShow",
|
|
1657
1653
|
"afterClose",
|
|
1658
|
-
"onClick"
|
|
1659
|
-
"ariaLabel"
|
|
1654
|
+
"onClick"
|
|
1660
1655
|
]);
|
|
1661
1656
|
var classPrefix2 = "nut-overlay";
|
|
1662
1657
|
var _useState = _sliced_to_array(React.useState(visible), 2), innerVisible = _useState[0], setInnerVisible = _useState[1];
|
|
1663
1658
|
var nodeRef = useLockScrollTaro(!!lockScroll && innerVisible);
|
|
1664
|
-
var locale = useConfig().locale;
|
|
1665
1659
|
React.useEffect(function() {
|
|
1666
1660
|
setInnerVisible(visible);
|
|
1667
1661
|
}, [
|
|
@@ -1677,7 +1671,7 @@
|
|
|
1677
1671
|
}
|
|
1678
1672
|
};
|
|
1679
1673
|
var renderOverlay = function() {
|
|
1680
|
-
return /* @__PURE__ */ React.createElement(components.View,
|
|
1674
|
+
return /* @__PURE__ */ React.createElement(components.View, _object_spread_props(_object_spread({
|
|
1681
1675
|
ref: nodeRef,
|
|
1682
1676
|
className: classes,
|
|
1683
1677
|
style: _object_spread_props(_object_spread({}, styles), {
|
|
@@ -1686,9 +1680,7 @@
|
|
|
1686
1680
|
}, rest), {
|
|
1687
1681
|
catchMove: lockScroll,
|
|
1688
1682
|
onClick: handleClick
|
|
1689
|
-
}),
|
|
1690
|
-
ariaLabel: ariaLabel || locale.mask
|
|
1691
|
-
} : {}), children);
|
|
1683
|
+
}), children);
|
|
1692
1684
|
};
|
|
1693
1685
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, renderOverlay());
|
|
1694
1686
|
};
|
|
@@ -4461,7 +4453,6 @@
|
|
|
4461
4453
|
var popClassName = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-round"), round || position2 === "bottom"), _define_property(_obj, "".concat(classPrefix2, "-").concat(position2), true), _obj), className);
|
|
4462
4454
|
var _useState4 = _sliced_to_array(React.useState(""), 2), popupHeight = _useState4[0], setPopupHeight = _useState4[1];
|
|
4463
4455
|
var _useState5 = _sliced_to_array(React.useState(""), 2), topBottom = _useState5[0], setTopBottom = _useState5[1];
|
|
4464
|
-
var role = "dialog";
|
|
4465
4456
|
var resizeStyles = function() {
|
|
4466
4457
|
if (popupHeight !== "") {
|
|
4467
4458
|
return {
|
|
@@ -4637,8 +4628,7 @@
|
|
|
4637
4628
|
onTouchStart: handleTouchStart,
|
|
4638
4629
|
onTouchMove: handleTouchMove,
|
|
4639
4630
|
onTouchEnd: handleTouchEnd,
|
|
4640
|
-
onTouchCancel: handleTouchEnd
|
|
4641
|
-
ariaRole: role
|
|
4631
|
+
onTouchCancel: handleTouchEnd
|
|
4642
4632
|
}, renderTop(), renderTitle(), showChildren ? children : null);
|
|
4643
4633
|
};
|
|
4644
4634
|
var renderNode = function() {
|
|
@@ -15120,7 +15110,7 @@
|
|
|
15120
15110
|
}
|
|
15121
15111
|
};
|
|
15122
15112
|
var Content = function(props) {
|
|
15123
|
-
var _$_object_spread = _object_spread({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close2 = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick
|
|
15113
|
+
var _$_object_spread = _object_spread({}, defaultContentProps, props), visible = _$_object_spread.visible, title = _$_object_spread.title, header = _$_object_spread.header, footer = _$_object_spread.footer, close2 = _$_object_spread.close, footerDirection = _$_object_spread.footerDirection, children = _$_object_spread.children, style = _$_object_spread.style, className = _$_object_spread.className, onClick = _$_object_spread.onClick;
|
|
15124
15114
|
var classPrefix2 = "nut-dialog";
|
|
15125
15115
|
var renderHeader = function() {
|
|
15126
15116
|
return title && /* @__PURE__ */ React.createElement(components.View, {
|
|
@@ -15140,11 +15130,7 @@
|
|
|
15140
15130
|
style,
|
|
15141
15131
|
onClick: function(e) {
|
|
15142
15132
|
return handleClick(e);
|
|
15143
|
-
}
|
|
15144
|
-
ariaRole,
|
|
15145
|
-
ariaLabel,
|
|
15146
|
-
// @ts-ignore
|
|
15147
|
-
tabIndex: -1
|
|
15133
|
+
}
|
|
15148
15134
|
}, close2, header, /* @__PURE__ */ React.createElement(components.View, {
|
|
15149
15135
|
className: classPrefix2,
|
|
15150
15136
|
style: {
|
|
@@ -15188,15 +15174,13 @@
|
|
|
15188
15174
|
},
|
|
15189
15175
|
onOverlayClick: function() {
|
|
15190
15176
|
return true;
|
|
15191
|
-
}
|
|
15192
|
-
ariaLabel: "dialog"
|
|
15177
|
+
}
|
|
15193
15178
|
});
|
|
15194
15179
|
var BaseDialog = function(props) {
|
|
15195
|
-
var _useParams = useParams(mergeProps(defaultProps$H, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content2 = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick,
|
|
15180
|
+
var _useParams = useParams(mergeProps(defaultProps$H, props)), _useParams_params = _useParams.params, id = _useParams_params.id, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, confirmText = _useParams_params.confirmText, cancelText = _useParams_params.cancelText, children = _useParams_params.children, className = _useParams_params.className, closeIconPosition = _useParams_params.closeIconPosition, closeIcon = _useParams_params.closeIcon, content2 = _useParams_params.content, disableConfirmButton = _useParams_params.disableConfirmButton, footer = _useParams_params.footer, footerDirection = _useParams_params.footerDirection, header = _useParams_params.header, cancelBadge = _useParams_params.cancelBadge, confirmBadge = _useParams_params.confirmBadge, hideConfirmButton = _useParams_params.hideConfirmButton, hideCancelButton = _useParams_params.hideCancelButton, lockScroll = _useParams_params.lockScroll, overlay = _useParams_params.overlay, overlayStyle = _useParams_params.overlayStyle, overlayClassName = _useParams_params.overlayClassName, style = _useParams_params.style, title = _useParams_params.title, visible = _useParams_params.visible, zIndex = _useParams_params.zIndex, beforeCancel = _useParams_params.beforeCancel, beforeClose = _useParams_params.beforeClose, onClose = _useParams_params.onClose, onCancel = _useParams_params.onCancel, onConfirm = _useParams_params.onConfirm, onOverlayClick = _useParams_params.onOverlayClick, setParams = _useParams.setParams;
|
|
15196
15181
|
var classPrefix2 = "nut-dialog";
|
|
15197
15182
|
var locale = useConfig().locale;
|
|
15198
15183
|
var _useState = _sliced_to_array(React.useState(false), 2), loading = _useState[0], setLoading = _useState[1];
|
|
15199
|
-
var role = "dialog";
|
|
15200
15184
|
useCustomEvent(id, function(param) {
|
|
15201
15185
|
var status = param.status, options = param.options;
|
|
15202
15186
|
setParams(_object_spread_props(_object_spread({}, options), {
|
|
@@ -15360,9 +15344,7 @@
|
|
|
15360
15344
|
close: renderCloseIcon(),
|
|
15361
15345
|
footer: renderFooter(),
|
|
15362
15346
|
footerDirection,
|
|
15363
|
-
visible
|
|
15364
|
-
ariaRole: role,
|
|
15365
|
-
ariaLabel
|
|
15347
|
+
visible
|
|
15366
15348
|
}, content2 || children)
|
|
15367
15349
|
);
|
|
15368
15350
|
};
|