@nutui/nutui-react 3.0.6 → 3.0.7
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/CHANGELOG.md +34 -15
- package/dist/cjs/packages/actionsheet/style/style.css +4 -4
- package/dist/cjs/packages/address/style/style.css +4 -4
- package/dist/cjs/packages/audio/style/style.css +4 -16
- package/dist/cjs/packages/button/style/button.scss +4 -20
- package/dist/cjs/packages/button/style/style.css +4 -16
- package/dist/cjs/packages/calendar/style/style.css +4 -4
- package/dist/cjs/packages/cascader/style/style.css +4 -4
- package/dist/cjs/packages/collapse/style/style.css +22 -7
- package/dist/cjs/packages/collapseitem/collapseitem.js +46 -44
- package/dist/cjs/packages/collapseitem/style/collapseitem.scss +22 -5
- package/dist/cjs/packages/collapseitem/style/style.css +22 -7
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +4 -4
- package/dist/cjs/packages/dialog/confirm.d.ts +2 -3
- package/dist/cjs/packages/dialog/confirm.js +4 -18
- package/dist/cjs/packages/dialog/content.d.ts +11 -3
- package/dist/cjs/packages/dialog/dialog.d.ts +1 -1
- package/dist/cjs/packages/dialog/dialog.js +98 -69
- package/dist/cjs/packages/dialog/index.d.ts +1 -1
- package/dist/cjs/packages/dialog/style/style.css +4 -16
- package/dist/cjs/packages/empty/style/style.css +4 -16
- package/dist/cjs/packages/imagepreview/style/style.css +4 -4
- package/dist/cjs/packages/numberkeyboard/style/style.css +4 -4
- package/dist/cjs/packages/picker/style/style.css +4 -4
- package/dist/cjs/packages/popover/popover.js +72 -65
- package/dist/cjs/packages/popover/style/popover.scss +48 -51
- package/dist/cjs/packages/popover/style/style.css +64 -70
- package/dist/cjs/packages/popup/style/popup.scss +4 -4
- package/dist/cjs/packages/popup/style/style.css +4 -4
- package/dist/cjs/packages/resultpage/style/style.css +4 -16
- package/dist/cjs/packages/shortpassword/style/style.css +4 -4
- package/dist/cjs/packages/switch/switch.js +2 -2
- package/dist/cjs/packages/tabpane/tabpane.js +2 -2
- package/dist/cjs/packages/timeselect/style/style.css +4 -4
- package/dist/cjs/packages/tour/style/style.css +64 -70
- package/dist/cjs/types/spec/dialog/base.d.ts +50 -1
- package/dist/cjs/types/spec/dialog/base.js +7 -0
- package/dist/cjs/types/spec/dialog/h5.d.ts +4 -1
- package/dist/cjs/types/spec/dialog/taro.d.ts +8 -2
- package/dist/cjs/types/spec/popover/base.d.ts +7 -0
- package/dist/cjs/utils/get-rect-by-taro.js +10 -0
- package/dist/cjs/utils/lru.d.ts +8 -0
- package/dist/cjs/utils/lru.js +58 -0
- package/dist/es/packages/actionsheet/style/style.css +4 -4
- package/dist/es/packages/address/style/style.css +4 -4
- package/dist/es/packages/audio/style/style.css +4 -16
- package/dist/es/packages/button/style/button.scss +4 -20
- package/dist/es/packages/button/style/style.css +4 -16
- package/dist/es/packages/calendar/style/style.css +4 -4
- package/dist/es/packages/cascader/style/style.css +4 -4
- package/dist/es/packages/collapse/style/style.css +22 -7
- package/dist/es/packages/collapseitem/collapseitem.js +47 -45
- package/dist/es/packages/collapseitem/style/collapseitem.scss +22 -5
- package/dist/es/packages/collapseitem/style/style.css +22 -7
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +4 -4
- package/dist/es/packages/dialog/confirm.d.ts +2 -3
- package/dist/es/packages/dialog/confirm.js +1 -8
- package/dist/es/packages/dialog/content.d.ts +11 -3
- package/dist/es/packages/dialog/dialog.d.ts +1 -1
- package/dist/es/packages/dialog/dialog.js +98 -69
- package/dist/es/packages/dialog/index.d.ts +1 -1
- package/dist/es/packages/dialog/style/style.css +4 -16
- package/dist/es/packages/empty/style/style.css +4 -16
- package/dist/es/packages/imagepreview/style/style.css +4 -4
- package/dist/es/packages/numberkeyboard/style/style.css +4 -4
- package/dist/es/packages/picker/style/style.css +4 -4
- package/dist/es/packages/popover/popover.js +72 -65
- package/dist/es/packages/popover/style/popover.scss +48 -51
- package/dist/es/packages/popover/style/style.css +64 -70
- package/dist/es/packages/popup/style/popup.scss +4 -4
- package/dist/es/packages/popup/style/style.css +4 -4
- package/dist/es/packages/resultpage/style/style.css +4 -16
- package/dist/es/packages/shortpassword/style/style.css +4 -4
- package/dist/es/packages/switch/switch.js +2 -2
- package/dist/es/packages/tabpane/tabpane.js +2 -2
- package/dist/es/packages/timeselect/style/style.css +4 -4
- package/dist/es/packages/tour/style/style.css +64 -70
- package/dist/es/types/spec/dialog/base.d.ts +83 -1
- package/dist/es/types/spec/dialog/base.js +1 -1
- package/dist/es/types/spec/dialog/h5.d.ts +4 -1
- package/dist/es/types/spec/dialog/taro.d.ts +8 -2
- package/dist/es/types/spec/popover/base.d.ts +7 -0
- package/dist/es/utils/get-rect-by-taro.js +9 -0
- package/dist/es/utils/lru.d.ts +8 -0
- package/dist/es/utils/lru.js +49 -0
- package/dist/nutui.react.umd.js +227 -249
- package/dist/style.css +1 -1
- package/dist/style.scss +42 -42
- package/dist/styles/theme-jmapp.scss +1 -0
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/variables-jmapp.scss +214 -49
- package/dist/styles/variables-jrkf.scss +2 -13
- package/dist/styles/variables.scss +3 -14
- package/package.json +1 -1
- package/dist/cjs/packages/dialog/dialogwrap.d.ts +0 -4
- package/dist/cjs/packages/dialog/dialogwrap.js +0 -79
- package/dist/cjs/packages/dialog/types.d.ts +0 -57
- package/dist/cjs/packages/dialog/types.js +0 -11
- package/dist/es/packages/dialog/dialogwrap.d.ts +0 -4
- package/dist/es/packages/dialog/dialogwrap.js +0 -60
- package/dist/es/packages/dialog/types.d.ts +0 -57
- package/dist/es/packages/dialog/types.js +0 -1
|
@@ -2,16 +2,11 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
|
2
2
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Dialog } from "./dialog";
|
|
5
|
-
import { destroyList } from "
|
|
5
|
+
import { destroyList } from "../../types";
|
|
6
6
|
import { render as reactRender, unmount } from "../../utils/render";
|
|
7
7
|
function ConfirmDialog(props) {
|
|
8
8
|
return /*#__PURE__*/ React.createElement(Dialog, props, props.content);
|
|
9
9
|
}
|
|
10
|
-
// 如果是消息提示型弹出框,那么只有确认按钮
|
|
11
|
-
export var normalizeConfig = function(config) {
|
|
12
|
-
config.hideCancelButton = config.isNotice;
|
|
13
|
-
return config;
|
|
14
|
-
};
|
|
15
10
|
var confirm = function(config, renderFunc) {
|
|
16
11
|
var div = document.createElement('div');
|
|
17
12
|
document.body.appendChild(div);
|
|
@@ -45,7 +40,6 @@ var confirm = function(config, renderFunc) {
|
|
|
45
40
|
};
|
|
46
41
|
// 如果是promise,那么处理loading和加载完成关闭
|
|
47
42
|
dialogConfig.onConfirm = onConfirm;
|
|
48
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
49
43
|
dialogConfig.visible = true;
|
|
50
44
|
renderFunction(dialogConfig);
|
|
51
45
|
var destroy = function() {
|
|
@@ -73,7 +67,6 @@ var confirm = function(config, renderFunc) {
|
|
|
73
67
|
};
|
|
74
68
|
var update = function(newConfig) {
|
|
75
69
|
dialogConfig = _object_spread({}, dialogConfig, newConfig);
|
|
76
|
-
dialogConfig = normalizeConfig(dialogConfig);
|
|
77
70
|
renderFunction(dialogConfig);
|
|
78
71
|
};
|
|
79
72
|
var close = function() {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { FunctionComponent, HTMLAttributes } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const defaultContentProps:
|
|
4
|
-
|
|
2
|
+
import { WebContentProps } from "../../types";
|
|
3
|
+
export declare const defaultContentProps: {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
header: string;
|
|
7
|
+
footer: string;
|
|
8
|
+
close: string;
|
|
9
|
+
footerDirection: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const Content: FunctionComponent<Partial<WebContentProps> & Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'content'>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DialogComponent } from
|
|
1
|
+
import { DialogComponent } from "../../types";
|
|
2
2
|
export declare const Dialog: DialogComponent;
|
|
@@ -2,20 +2,26 @@ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
|
|
|
2
2
|
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
3
3
|
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
4
4
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
5
|
-
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
6
5
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
7
6
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
8
7
|
import React, { forwardRef, useState } from "react";
|
|
9
8
|
import classNames from "classnames";
|
|
9
|
+
import { CSSTransition } from "react-transition-group";
|
|
10
10
|
import { Failure, Close } from "@nutui/icons-react";
|
|
11
11
|
import Button from "../button";
|
|
12
12
|
import confirm from "./confirm";
|
|
13
|
-
import
|
|
13
|
+
import Overlay from "../overlay";
|
|
14
|
+
import { Content, defaultContentProps } from "./content";
|
|
15
|
+
import { defaultOverlayProps } from "../overlay/overlay";
|
|
14
16
|
import { useConfig } from "../configprovider";
|
|
15
|
-
|
|
17
|
+
import { mergeProps } from "../../utils/merge-props";
|
|
18
|
+
var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps, defaultContentProps), {
|
|
19
|
+
title: '',
|
|
20
|
+
content: '',
|
|
21
|
+
header: '',
|
|
22
|
+
footer: '',
|
|
16
23
|
confirmText: '',
|
|
17
24
|
cancelText: '',
|
|
18
|
-
overlay: true,
|
|
19
25
|
closeOnOverlayClick: true,
|
|
20
26
|
hideConfirmButton: false,
|
|
21
27
|
hideCancelButton: false,
|
|
@@ -24,36 +30,26 @@ var defaultProps = _object_spread_props(_object_spread({}, defaultDialogWrapProp
|
|
|
24
30
|
lockScroll: true,
|
|
25
31
|
closeIconPosition: 'bottom',
|
|
26
32
|
closeIcon: false,
|
|
33
|
+
overlay: true,
|
|
34
|
+
overlayStyle: {},
|
|
35
|
+
overlayClassName: 'nut-dialog-overlay',
|
|
27
36
|
zIndex: 1200,
|
|
28
37
|
beforeCancel: function() {
|
|
29
38
|
return true;
|
|
30
39
|
},
|
|
31
40
|
beforeClose: function() {
|
|
32
41
|
return true;
|
|
42
|
+
},
|
|
43
|
+
onCancel: function() {},
|
|
44
|
+
onClose: function() {},
|
|
45
|
+
onOverlayClick: function() {
|
|
46
|
+
return true;
|
|
33
47
|
}
|
|
34
48
|
});
|
|
35
49
|
var BaseDialog = function(props, ref) {
|
|
36
|
-
var
|
|
37
|
-
var _ref = _object_spread({}, defaultProps, props), visible = _ref.visible, footer = _ref.footer, hideConfirmButton = _ref.hideConfirmButton, hideCancelButton = _ref.hideCancelButton, lockScroll = _ref.lockScroll, disableConfirmButton = _ref.disableConfirmButton, closeOnOverlayClick = _ref.closeOnOverlayClick, confirmText = _ref.confirmText, cancelText = _ref.cancelText, closeIconPosition = _ref.closeIconPosition, closeIcon = _ref.closeIcon, footerDirection = _ref.footerDirection, onClose = _ref.onClose, onCancel = _ref.onCancel, onConfirm = _ref.onConfirm, beforeCancel = _ref.beforeCancel, beforeClose = _ref.beforeClose, restProps = _object_without_properties(_ref, [
|
|
38
|
-
"visible",
|
|
39
|
-
"footer",
|
|
40
|
-
"hideConfirmButton",
|
|
41
|
-
"hideCancelButton",
|
|
42
|
-
"lockScroll",
|
|
43
|
-
"disableConfirmButton",
|
|
44
|
-
"closeOnOverlayClick",
|
|
45
|
-
"confirmText",
|
|
46
|
-
"cancelText",
|
|
47
|
-
"closeIconPosition",
|
|
48
|
-
"closeIcon",
|
|
49
|
-
"footerDirection",
|
|
50
|
-
"onClose",
|
|
51
|
-
"onCancel",
|
|
52
|
-
"onConfirm",
|
|
53
|
-
"beforeCancel",
|
|
54
|
-
"beforeClose"
|
|
55
|
-
]);
|
|
50
|
+
var _mergeProps = mergeProps(defaultProps, props), closeOnOverlayClick = _mergeProps.closeOnOverlayClick, confirmText = _mergeProps.confirmText, cancelText = _mergeProps.cancelText, children = _mergeProps.children, className = _mergeProps.className, closeIconPosition = _mergeProps.closeIconPosition, closeIcon = _mergeProps.closeIcon, content = _mergeProps.content, disableConfirmButton = _mergeProps.disableConfirmButton, footer = _mergeProps.footer, footerDirection = _mergeProps.footerDirection, header = _mergeProps.header, hideConfirmButton = _mergeProps.hideConfirmButton, hideCancelButton = _mergeProps.hideCancelButton, lockScroll = _mergeProps.lockScroll, overlay = _mergeProps.overlay, overlayStyle = _mergeProps.overlayStyle, overlayClassName = _mergeProps.overlayClassName, style = _mergeProps.style, title = _mergeProps.title, visible = _mergeProps.visible, zIndex = _mergeProps.zIndex, beforeCancel = _mergeProps.beforeCancel, beforeClose = _mergeProps.beforeClose, onClose = _mergeProps.onClose, onCancel = _mergeProps.onCancel, onConfirm = _mergeProps.onConfirm, onOverlayClick = _mergeProps.onOverlayClick;
|
|
56
51
|
var classPrefix = 'nut-dialog';
|
|
52
|
+
var locale = useConfig().locale;
|
|
57
53
|
var _useState = _sliced_to_array(useState(false), 2), loading = _useState[0], setLoading = _useState[1];
|
|
58
54
|
var renderFooter = function() {
|
|
59
55
|
if (footer === null) return '';
|
|
@@ -61,8 +57,8 @@ var BaseDialog = function(props, ref) {
|
|
|
61
57
|
e.stopPropagation();
|
|
62
58
|
if (!(beforeCancel === null || beforeCancel === void 0 ? void 0 : beforeCancel())) return;
|
|
63
59
|
if (!(beforeClose === null || beforeClose === void 0 ? void 0 : beforeClose())) return;
|
|
64
|
-
onClose
|
|
65
|
-
onCancel
|
|
60
|
+
onClose();
|
|
61
|
+
onCancel();
|
|
66
62
|
};
|
|
67
63
|
var handleOk = /*#__PURE__*/ function() {
|
|
68
64
|
var _ref = _async_to_generator(function(e) {
|
|
@@ -87,7 +83,7 @@ var BaseDialog = function(props, ref) {
|
|
|
87
83
|
case 2:
|
|
88
84
|
_state.sent();
|
|
89
85
|
setLoading(false);
|
|
90
|
-
onClose
|
|
86
|
+
onClose();
|
|
91
87
|
return [
|
|
92
88
|
3,
|
|
93
89
|
4
|
|
@@ -111,41 +107,50 @@ var BaseDialog = function(props, ref) {
|
|
|
111
107
|
};
|
|
112
108
|
}();
|
|
113
109
|
var btnClass = hideCancelButton || hideConfirmButton ? "".concat(classPrefix, "-footer-block") : '';
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
110
|
+
var renderCancelOfVertical = function() {
|
|
111
|
+
return !hideCancelButton && /*#__PURE__*/ React.createElement("div", {
|
|
112
|
+
style: {
|
|
113
|
+
order: 2
|
|
114
|
+
},
|
|
115
|
+
className: "".concat(classPrefix, "-footer-cancel ").concat(btnClass),
|
|
116
|
+
onClick: function(e) {
|
|
117
|
+
return handleCancel(e);
|
|
118
|
+
}
|
|
119
|
+
}, cancelText || locale.cancel);
|
|
120
|
+
};
|
|
121
|
+
var renderCancel = function() {
|
|
122
|
+
return !hideCancelButton && /*#__PURE__*/ React.createElement(Button, {
|
|
123
|
+
type: "default",
|
|
124
|
+
size: "large",
|
|
125
|
+
className: "".concat(classPrefix, "-footer-cancel ").concat(btnClass),
|
|
126
|
+
onClick: function(e) {
|
|
127
|
+
return handleCancel(e);
|
|
128
|
+
}
|
|
129
|
+
}, cancelText || locale.cancel);
|
|
130
|
+
};
|
|
131
|
+
var renderConfirm = function() {
|
|
132
|
+
return !hideConfirmButton && /*#__PURE__*/ React.createElement(Button, {
|
|
133
|
+
type: "primary",
|
|
134
|
+
size: "large",
|
|
135
|
+
className: classNames("".concat(classPrefix, "-footer-ok ").concat(btnClass), {
|
|
136
|
+
disabled: disableConfirmButton
|
|
137
|
+
}),
|
|
138
|
+
disabled: disableConfirmButton,
|
|
139
|
+
onClick: function(e) {
|
|
140
|
+
return handleOk(e);
|
|
141
|
+
},
|
|
142
|
+
loading: loading
|
|
143
|
+
}, confirmText || locale.confirm);
|
|
144
|
+
};
|
|
145
|
+
return footer || /*#__PURE__*/ React.createElement(React.Fragment, null, footerDirection === 'vertical' ? /*#__PURE__*/ React.createElement(React.Fragment, null, renderConfirm(), renderCancelOfVertical()) : /*#__PURE__*/ React.createElement(React.Fragment, null, renderCancel(), renderConfirm()));
|
|
141
146
|
};
|
|
142
147
|
var renderCloseIcon = function() {
|
|
143
148
|
if (!closeIcon) return null;
|
|
144
149
|
var handleCancel = function() {
|
|
145
150
|
if (!(beforeCancel === null || beforeCancel === void 0 ? void 0 : beforeCancel())) return;
|
|
146
151
|
if (!(beforeClose === null || beforeClose === void 0 ? void 0 : beforeClose())) return;
|
|
147
|
-
onClose
|
|
148
|
-
onCancel
|
|
152
|
+
onClose();
|
|
153
|
+
onCancel();
|
|
149
154
|
};
|
|
150
155
|
var _obj;
|
|
151
156
|
var closeClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-close"), true), _define_property(_obj, "".concat(classPrefix, "-close-").concat(closeIconPosition), true), _obj));
|
|
@@ -155,19 +160,46 @@ var BaseDialog = function(props, ref) {
|
|
|
155
160
|
onClick: handleCancel
|
|
156
161
|
}, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : systomIcon);
|
|
157
162
|
};
|
|
163
|
+
var onHandleClickOverlay = function(e) {
|
|
164
|
+
if (closeOnOverlayClick && visible && e.target === e.currentTarget) {
|
|
165
|
+
var closed = onOverlayClick && onOverlayClick(e);
|
|
166
|
+
closed && onClose();
|
|
167
|
+
closed && onCancel();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
var renderContent = function() {
|
|
171
|
+
return /*#__PURE__*/ React.createElement(CSSTransition, {
|
|
172
|
+
in: visible,
|
|
173
|
+
timeout: 300,
|
|
174
|
+
classNames: "fadeDialog",
|
|
175
|
+
unmountOnExit: true,
|
|
176
|
+
appear: true
|
|
177
|
+
}, /*#__PURE__*/ React.createElement(Content, {
|
|
178
|
+
className: className,
|
|
179
|
+
style: _object_spread({
|
|
180
|
+
zIndex: zIndex
|
|
181
|
+
}, style),
|
|
182
|
+
title: title,
|
|
183
|
+
header: header,
|
|
184
|
+
close: renderCloseIcon(),
|
|
185
|
+
footer: renderFooter(),
|
|
186
|
+
footerDirection: footerDirection,
|
|
187
|
+
visible: visible
|
|
188
|
+
}, content || children));
|
|
189
|
+
};
|
|
158
190
|
return /*#__PURE__*/ React.createElement("div", {
|
|
159
191
|
style: {
|
|
160
192
|
display: visible ? 'block' : 'none'
|
|
161
193
|
}
|
|
162
|
-
}, /*#__PURE__*/ React.createElement(
|
|
194
|
+
}, overlay && /*#__PURE__*/ React.createElement(Overlay, {
|
|
195
|
+
zIndex: zIndex,
|
|
163
196
|
visible: visible,
|
|
197
|
+
style: overlayStyle,
|
|
198
|
+
className: overlayClassName,
|
|
199
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
|
164
200
|
lockScroll: lockScroll,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
close: renderCloseIcon(),
|
|
168
|
-
onClose: onClose,
|
|
169
|
-
onCancel: onCancel
|
|
170
|
-
})));
|
|
201
|
+
onClick: onHandleClickOverlay
|
|
202
|
+
}), renderContent());
|
|
171
203
|
};
|
|
172
204
|
export var Dialog = /*#__PURE__*/ forwardRef(BaseDialog);
|
|
173
205
|
Dialog.confirm = function(props) {
|
|
@@ -175,13 +207,10 @@ Dialog.confirm = function(props) {
|
|
|
175
207
|
};
|
|
176
208
|
[
|
|
177
209
|
'alert'
|
|
178
|
-
].forEach(function(
|
|
210
|
+
].forEach(function() {
|
|
179
211
|
;
|
|
180
|
-
Dialog
|
|
181
|
-
return confirm(
|
|
182
|
-
isNotice: false,
|
|
183
|
-
noticeType: type
|
|
184
|
-
}));
|
|
212
|
+
Dialog.alert = function(props) {
|
|
213
|
+
return confirm(_object_spread({}, props));
|
|
185
214
|
};
|
|
186
215
|
});
|
|
187
216
|
Dialog.displayName = 'NutDialog';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Dialog } from './dialog';
|
|
2
|
-
export type { DialogConfigType, DialogCloseIconPosition, DialogFooterDirection, ContentProps, DialogWrapProps,
|
|
2
|
+
export type { DialogConfigType, DialogCloseIconPosition, DialogFooterDirection, WebContentProps as ContentProps, DialogWrapProps, WebDialogProps as DialogProps, DialogReturnProps, } from "../../types";
|
|
3
3
|
export default Dialog;
|
|
@@ -94,18 +94,6 @@
|
|
|
94
94
|
.nut-button-round {
|
|
95
95
|
border-radius: var(--nutui-button-border-radius, var(--nutui-radius-s, 6px));
|
|
96
96
|
}
|
|
97
|
-
.nut-button-round-xlarge {
|
|
98
|
-
border-radius: var(--nutui-button-xlarge-border-radius, var(--nutui-radius-base, 8px));
|
|
99
|
-
}
|
|
100
|
-
.nut-button-round-large {
|
|
101
|
-
border-radius: var(--nutui-button-large-border-radius, var(--nutui-radius-base, 8px));
|
|
102
|
-
}
|
|
103
|
-
.nut-button-round-small {
|
|
104
|
-
border-radius: var(--nutui-button-small-border-radius, var(--nutui-radius-s, 6px));
|
|
105
|
-
}
|
|
106
|
-
.nut-button-round-mini {
|
|
107
|
-
border-radius: var(--nutui-button-mini-border-radius, var(--nutui-radius-xs, 4px));
|
|
108
|
-
}
|
|
109
97
|
.nut-button-default {
|
|
110
98
|
padding: var(--nutui-button-default-padding, 0px 12px);
|
|
111
99
|
border-style: solid;
|
|
@@ -131,7 +119,7 @@
|
|
|
131
119
|
height: var(--nutui-button-xlarge-height, 48px);
|
|
132
120
|
padding: var(--nutui-button-xlarge-padding, 0px 24px);
|
|
133
121
|
font-size: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
134
|
-
border-radius: var(--nutui-radius-base, 8px);
|
|
122
|
+
border-radius: var(--nutui-button-xlarge-border-radius, var(--nutui-radius-base, 8px));
|
|
135
123
|
}
|
|
136
124
|
.nut-button-xlarge .nut-button-text {
|
|
137
125
|
margin-left: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
@@ -151,7 +139,7 @@
|
|
|
151
139
|
height: var(--nutui-button-large-height, 40px);
|
|
152
140
|
padding: var(--nutui-button-large-padding, 0px 16px);
|
|
153
141
|
font-size: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
154
|
-
border-radius: var(--nutui-radius-
|
|
142
|
+
border-radius: var(--nutui-button-large-border-radius, var(--nutui-radius-base, 8px));
|
|
155
143
|
}
|
|
156
144
|
.nut-button-large .nut-button-text {
|
|
157
145
|
margin-left: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
@@ -171,7 +159,7 @@
|
|
|
171
159
|
height: var(--nutui-button-small-height, 28px);
|
|
172
160
|
padding: var(--nutui-button-small-padding, 0px 8px);
|
|
173
161
|
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
174
|
-
border-radius: var(--nutui-radius-
|
|
162
|
+
border-radius: var(--nutui-button-small-border-radius, var(--nutui-radius-s, 6px));
|
|
175
163
|
}
|
|
176
164
|
.nut-button-small .nut-icon {
|
|
177
165
|
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
@@ -185,7 +173,7 @@
|
|
|
185
173
|
height: var(--nutui-button-mini-height, 24px);
|
|
186
174
|
padding: var(--nutui-button-mini-padding, 0px 8px);
|
|
187
175
|
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
188
|
-
border-radius: var(--nutui-radius-xs, 4px);
|
|
176
|
+
border-radius: var(--nutui-button-mini-border-radius, var(--nutui-radius-xs, 4px));
|
|
189
177
|
}
|
|
190
178
|
.nut-button-mini .nut-icon {
|
|
191
179
|
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
@@ -94,18 +94,6 @@
|
|
|
94
94
|
.nut-button-round {
|
|
95
95
|
border-radius: var(--nutui-button-border-radius, var(--nutui-radius-s, 6px));
|
|
96
96
|
}
|
|
97
|
-
.nut-button-round-xlarge {
|
|
98
|
-
border-radius: var(--nutui-button-xlarge-border-radius, var(--nutui-radius-base, 8px));
|
|
99
|
-
}
|
|
100
|
-
.nut-button-round-large {
|
|
101
|
-
border-radius: var(--nutui-button-large-border-radius, var(--nutui-radius-base, 8px));
|
|
102
|
-
}
|
|
103
|
-
.nut-button-round-small {
|
|
104
|
-
border-radius: var(--nutui-button-small-border-radius, var(--nutui-radius-s, 6px));
|
|
105
|
-
}
|
|
106
|
-
.nut-button-round-mini {
|
|
107
|
-
border-radius: var(--nutui-button-mini-border-radius, var(--nutui-radius-xs, 4px));
|
|
108
|
-
}
|
|
109
97
|
.nut-button-default {
|
|
110
98
|
padding: var(--nutui-button-default-padding, 0px 12px);
|
|
111
99
|
border-style: solid;
|
|
@@ -131,7 +119,7 @@
|
|
|
131
119
|
height: var(--nutui-button-xlarge-height, 48px);
|
|
132
120
|
padding: var(--nutui-button-xlarge-padding, 0px 24px);
|
|
133
121
|
font-size: var(--nutui-button-xlarge-font-size, var(--nutui-font-size-xl, 18px));
|
|
134
|
-
border-radius: var(--nutui-radius-base, 8px);
|
|
122
|
+
border-radius: var(--nutui-button-xlarge-border-radius, var(--nutui-radius-base, 8px));
|
|
135
123
|
}
|
|
136
124
|
.nut-button-xlarge .nut-button-text {
|
|
137
125
|
margin-left: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
@@ -151,7 +139,7 @@
|
|
|
151
139
|
height: var(--nutui-button-large-height, 40px);
|
|
152
140
|
padding: var(--nutui-button-large-padding, 0px 16px);
|
|
153
141
|
font-size: var(--nutui-button-large-font-size, var(--nutui-font-size-l, 16px));
|
|
154
|
-
border-radius: var(--nutui-radius-
|
|
142
|
+
border-radius: var(--nutui-button-large-border-radius, var(--nutui-radius-base, 8px));
|
|
155
143
|
}
|
|
156
144
|
.nut-button-large .nut-button-text {
|
|
157
145
|
margin-left: var(--nutui-button-xlarge-text-icon-margin, 6px);
|
|
@@ -171,7 +159,7 @@
|
|
|
171
159
|
height: var(--nutui-button-small-height, 28px);
|
|
172
160
|
padding: var(--nutui-button-small-padding, 0px 8px);
|
|
173
161
|
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
174
|
-
border-radius: var(--nutui-radius-
|
|
162
|
+
border-radius: var(--nutui-button-small-border-radius, var(--nutui-radius-s, 6px));
|
|
175
163
|
}
|
|
176
164
|
.nut-button-small .nut-icon {
|
|
177
165
|
font-size: var(--nutui-button-small-font-size, var(--nutui-font-size-s, 12px));
|
|
@@ -185,7 +173,7 @@
|
|
|
185
173
|
height: var(--nutui-button-mini-height, 24px);
|
|
186
174
|
padding: var(--nutui-button-mini-padding, 0px 8px);
|
|
187
175
|
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
188
|
-
border-radius: var(--nutui-radius-xs, 4px);
|
|
176
|
+
border-radius: var(--nutui-button-mini-border-radius, var(--nutui-radius-xs, 4px));
|
|
189
177
|
}
|
|
190
178
|
.nut-button-mini .nut-icon {
|
|
191
179
|
font-size: var(--nutui-button-mini-font-size, var(--nutui-font-size-xs, 11px));
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
.nut-popup {
|
|
62
62
|
position: fixed;
|
|
63
|
-
min-height:
|
|
63
|
+
min-height: 26%;
|
|
64
64
|
max-height: 100%;
|
|
65
65
|
background-color: var(--nutui-overlay-content-bg-color, var(--nutui-color-background-overlay, #ffffff));
|
|
66
66
|
-webkit-overflow-scrolling: touch;
|
|
@@ -198,12 +198,12 @@
|
|
|
198
198
|
transform: scale(0.8);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
.nut-popup-slide-
|
|
201
|
+
.nut-popup-slide-none-enter-active {
|
|
202
202
|
animation-fill-mode: both;
|
|
203
203
|
animation-name: popup-scale-fade-in;
|
|
204
204
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
205
205
|
}
|
|
206
|
-
.nut-popup-slide-
|
|
206
|
+
.nut-popup-slide-none-exit-active {
|
|
207
207
|
animation-fill-mode: both;
|
|
208
208
|
animation-name: popup-scale-fade-out;
|
|
209
209
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
animation-name: popup-slide-left-exit;
|
|
331
331
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
332
332
|
}
|
|
333
|
-
.nut-popup-slide-
|
|
333
|
+
.nut-popup-slide-none-exit-done.nut-popup, .nut-popup-slide-center-exit-done.nut-popup, .nut-popup-slide-left-exit-done.nut-popup, .nut-popup-slide-right-exit-done.nut-popup, .nut-popup-slide-top-exit-done.nut-popup, .nut-popup-slide-bottom-exit-done.nut-popup {
|
|
334
334
|
display: none;
|
|
335
335
|
}
|
|
336
336
|
.nut-popup .nut-overflow-hidden {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
.nut-popup {
|
|
62
62
|
position: fixed;
|
|
63
|
-
min-height:
|
|
63
|
+
min-height: 26%;
|
|
64
64
|
max-height: 100%;
|
|
65
65
|
background-color: var(--nutui-overlay-content-bg-color, var(--nutui-color-background-overlay, #ffffff));
|
|
66
66
|
-webkit-overflow-scrolling: touch;
|
|
@@ -198,12 +198,12 @@
|
|
|
198
198
|
transform: scale(0.8);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
.nut-popup-slide-
|
|
201
|
+
.nut-popup-slide-none-enter-active {
|
|
202
202
|
animation-fill-mode: both;
|
|
203
203
|
animation-name: popup-scale-fade-in;
|
|
204
204
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
205
205
|
}
|
|
206
|
-
.nut-popup-slide-
|
|
206
|
+
.nut-popup-slide-none-exit-active {
|
|
207
207
|
animation-fill-mode: both;
|
|
208
208
|
animation-name: popup-scale-fade-out;
|
|
209
209
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
animation-name: popup-slide-left-exit;
|
|
331
331
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
332
332
|
}
|
|
333
|
-
.nut-popup-slide-
|
|
333
|
+
.nut-popup-slide-none-exit-done.nut-popup, .nut-popup-slide-center-exit-done.nut-popup, .nut-popup-slide-left-exit-done.nut-popup, .nut-popup-slide-right-exit-done.nut-popup, .nut-popup-slide-top-exit-done.nut-popup, .nut-popup-slide-bottom-exit-done.nut-popup {
|
|
334
334
|
display: none;
|
|
335
335
|
}
|
|
336
336
|
.nut-popup .nut-overflow-hidden {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
.nut-popup {
|
|
62
62
|
position: fixed;
|
|
63
|
-
min-height:
|
|
63
|
+
min-height: 26%;
|
|
64
64
|
max-height: 100%;
|
|
65
65
|
background-color: var(--nutui-overlay-content-bg-color, var(--nutui-color-background-overlay, #ffffff));
|
|
66
66
|
-webkit-overflow-scrolling: touch;
|
|
@@ -198,12 +198,12 @@
|
|
|
198
198
|
transform: scale(0.8);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
.nut-popup-slide-
|
|
201
|
+
.nut-popup-slide-none-enter-active {
|
|
202
202
|
animation-fill-mode: both;
|
|
203
203
|
animation-name: popup-scale-fade-in;
|
|
204
204
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
205
205
|
}
|
|
206
|
-
.nut-popup-slide-
|
|
206
|
+
.nut-popup-slide-none-exit-active {
|
|
207
207
|
animation-fill-mode: both;
|
|
208
208
|
animation-name: popup-scale-fade-out;
|
|
209
209
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
animation-name: popup-slide-left-exit;
|
|
331
331
|
animation-duration: var(--nutui-popup-animation-duration, 0.3s);
|
|
332
332
|
}
|
|
333
|
-
.nut-popup-slide-
|
|
333
|
+
.nut-popup-slide-none-exit-done.nut-popup, .nut-popup-slide-center-exit-done.nut-popup, .nut-popup-slide-left-exit-done.nut-popup, .nut-popup-slide-right-exit-done.nut-popup, .nut-popup-slide-top-exit-done.nut-popup, .nut-popup-slide-bottom-exit-done.nut-popup {
|
|
334
334
|
display: none;
|
|
335
335
|
}
|
|
336
336
|
.nut-popup .nut-overflow-hidden {
|