@nutui/nutui-react 3.0.4 → 3.0.6
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 +48 -0
- package/dist/cjs/packages/badge/badge.js +4 -3
- package/dist/cjs/packages/badge/style/badge.scss +7 -8
- package/dist/cjs/packages/badge/style/style.css +13 -15
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/datepicker/style/style.css +3 -1
- package/dist/cjs/packages/datepickerview/style/style.css +3 -1
- package/dist/cjs/packages/empty/style/index.js +1 -0
- package/dist/cjs/packages/empty/style/style.css +389 -0
- package/dist/cjs/packages/fixednav/fixednav.js +3 -2
- package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/cjs/packages/fixednav/style/style.css +56 -51
- package/dist/cjs/packages/imagepreview/imagepreview.js +49 -84
- package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/cjs/packages/imagepreview/style/style.css +2 -1
- package/dist/cjs/packages/indicator/indicator.js +1 -1
- package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
- package/dist/cjs/packages/lottie/index.d.ts +1 -1
- package/dist/cjs/packages/lottie/index.js +2 -2
- package/dist/cjs/packages/notify/Notification.d.ts +3 -9
- package/dist/cjs/packages/notify/Notification.js +28 -8
- package/dist/cjs/packages/notify/notify.d.ts +0 -4
- package/dist/cjs/packages/notify/notify.js +6 -34
- package/dist/cjs/packages/notify/style/notify.scss +39 -36
- package/dist/cjs/packages/notify/style/style.css +36 -31
- package/dist/cjs/packages/nutui.react.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.js +1 -0
- package/dist/cjs/packages/picker/style/style.css +3 -1
- package/dist/cjs/packages/pickerview/pickerroller.js +11 -6
- package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/cjs/packages/pickerview/style/style.css +3 -1
- package/dist/cjs/packages/resultpage/style/index.js +1 -0
- package/dist/cjs/packages/resultpage/style/style.css +389 -0
- package/dist/cjs/packages/skeleton/skeleton.js +64 -49
- package/dist/cjs/packages/skeleton/style/index.js +0 -1
- package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/cjs/packages/skeleton/style/style.css +32 -175
- package/dist/cjs/packages/switch/style/style.css +5 -0
- package/dist/cjs/packages/switch/style/switch.scss +5 -0
- package/dist/cjs/packages/switch/switch.js +22 -11
- package/dist/cjs/packages/tabbar/style/style.css +58 -54
- package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/cjs/packages/tabbar/tabbar.js +28 -10
- package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/cjs/packages/toast/Notification.js +1 -1
- package/dist/cjs/types/spec/badge/base.d.ts +1 -0
- package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
- package/dist/cjs/types/spec/notify/base.d.ts +7 -2
- package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
- package/dist/cjs/types/spec/switch/base.d.ts +3 -2
- package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
- package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
- package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
- package/dist/es/packages/badge/badge.js +4 -3
- package/dist/es/packages/badge/style/badge.scss +7 -8
- package/dist/es/packages/badge/style/style.css +13 -15
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/datepicker/style/style.css +3 -1
- package/dist/es/packages/datepickerview/style/style.css +3 -1
- package/dist/es/packages/empty/style/index.js +1 -0
- package/dist/es/packages/empty/style/style.css +389 -0
- package/dist/es/packages/fixednav/fixednav.js +3 -2
- package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
- package/dist/es/packages/fixednav/style/style.css +56 -51
- package/dist/es/packages/imagepreview/imagepreview.js +49 -84
- package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
- package/dist/es/packages/imagepreview/style/style.css +2 -1
- package/dist/es/packages/indicator/indicator.js +1 -1
- package/dist/es/packages/inputnumber/inputnumber.js +2 -2
- package/dist/es/packages/lottie/index.d.ts +1 -1
- package/dist/es/packages/lottie/index.js +1 -1
- package/dist/es/packages/notify/Notification.d.ts +3 -9
- package/dist/es/packages/notify/Notification.js +28 -8
- package/dist/es/packages/notify/notify.d.ts +0 -4
- package/dist/es/packages/notify/notify.js +6 -34
- package/dist/es/packages/notify/style/notify.scss +39 -36
- package/dist/es/packages/notify/style/style.css +36 -31
- package/dist/es/packages/picker/style/style.css +3 -1
- package/dist/es/packages/pickerview/pickerroller.js +10 -6
- package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
- package/dist/es/packages/pickerview/style/style.css +3 -1
- package/dist/es/packages/resultpage/style/index.js +1 -0
- package/dist/es/packages/resultpage/style/style.css +389 -0
- package/dist/es/packages/skeleton/skeleton.js +63 -49
- package/dist/es/packages/skeleton/style/index.js +0 -1
- package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
- package/dist/es/packages/skeleton/style/style.css +32 -175
- package/dist/es/packages/switch/style/style.css +5 -0
- package/dist/es/packages/switch/style/switch.scss +5 -0
- package/dist/es/packages/switch/switch.js +21 -11
- package/dist/es/packages/tabbar/style/style.css +58 -54
- package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
- package/dist/es/packages/tabbar/tabbar.js +27 -10
- package/dist/es/packages/tabbaritem/style/style.css +34 -36
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
- package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
- package/dist/es/packages/toast/Notification.js +1 -1
- package/dist/es/types/spec/badge/base.d.ts +4 -0
- package/dist/es/types/spec/indicator/base.d.ts +1 -1
- package/dist/es/types/spec/notify/base.d.ts +22 -5
- package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
- package/dist/es/types/spec/skeleton/base.d.ts +19 -14
- package/dist/es/types/spec/switch/base.d.ts +6 -2
- package/dist/es/types/spec/switch/h5.d.ts +1 -1
- package/dist/es/types/spec/switch/taro.d.ts +1 -4
- package/dist/es/types/spec/tabbar/base.d.ts +7 -4
- package/dist/nutui.react.umd.js +394 -373
- package/dist/style.css +1 -1
- package/dist/style.scss +49 -49
- package/dist/styles/theme-dark.scss +2 -0
- package/dist/styles/theme-default.scss +2 -0
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -1
- package/dist/styles/themes/jrkf.css +1 -1
- package/dist/styles/variables-jmapp.scss +24 -1
- package/dist/styles/variables-jrkf.scss +24 -1
- package/dist/styles/variables.scss +37 -38
- package/package.json +1 -1
- /package/dist/cjs/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
- /package/dist/cjs/packages/lottie/{web.js → lottie.js} +0 -0
- /package/dist/es/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
- /package/dist/es/packages/lottie/{web.js → lottie.js} +0 -0
|
@@ -13,7 +13,7 @@ var defaultProps = {
|
|
|
13
13
|
var classPrefix = "nut-indicator";
|
|
14
14
|
export var Indicator = function(props) {
|
|
15
15
|
var maybeFixedWidth = function maybeFixedWidth() {
|
|
16
|
-
if (
|
|
16
|
+
if (type === 'dualScreen' || type === 'slide') {
|
|
17
17
|
return "".concat(classPrefix, "-fixed-width");
|
|
18
18
|
}
|
|
19
19
|
return '';
|
|
@@ -236,7 +236,7 @@ export var InputNumber = function(props) {
|
|
|
236
236
|
className: "".concat(classPrefix, "-minus"),
|
|
237
237
|
onClick: handleReduce
|
|
238
238
|
}, /*#__PURE__*/ React.createElement(Minus, {
|
|
239
|
-
className: classNames("".concat(classPrefix, "-icon ").concat(classPrefix, "-icon-minus"), _define_property({}, "".concat(classPrefix, "-icon-disabled"), shadowValue
|
|
239
|
+
className: classNames("".concat(classPrefix, "-icon ").concat(classPrefix, "-icon-minus"), _define_property({}, "".concat(classPrefix, "-icon-disabled"), Number(shadowValue) <= Number(min) || disabled))
|
|
240
240
|
})), /*#__PURE__*/ React.createElement("input", {
|
|
241
241
|
className: classNames("".concat(classPrefix, "-input"), _define_property({}, "".concat(classPrefix, "-input-disabled"), disabled)),
|
|
242
242
|
ref: inputRef,
|
|
@@ -251,7 +251,7 @@ export var InputNumber = function(props) {
|
|
|
251
251
|
className: "".concat(classPrefix, "-add"),
|
|
252
252
|
onClick: handlePlus
|
|
253
253
|
}, /*#__PURE__*/ React.createElement(Plus, {
|
|
254
|
-
className: classNames("".concat(classPrefix, "-icon ").concat(classPrefix, "-icon-plus"), _define_property({}, "".concat(classPrefix, "-icon-disabled"), shadowValue
|
|
254
|
+
className: classNames("".concat(classPrefix, "-icon ").concat(classPrefix, "-icon-plus"), _define_property({}, "".concat(classPrefix, "-icon-disabled"), Number(shadowValue) >= Number(max) || disabled))
|
|
255
255
|
})));
|
|
256
256
|
};
|
|
257
257
|
InputNumber.displayName = 'NutInputNumber';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Lottie } from "./
|
|
1
|
+
import { Lottie } from "./lottie";
|
|
2
2
|
export default Lottie;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export interface NotificationProps extends
|
|
4
|
-
|
|
5
|
-
message: string | React.ReactNode;
|
|
6
|
-
duration: number;
|
|
7
|
-
type: string;
|
|
8
|
-
position: string;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
onClick: () => void;
|
|
2
|
+
import { WebNotifyProps } from "../../types";
|
|
3
|
+
export interface NotificationProps extends WebNotifyProps {
|
|
4
|
+
message: React.ReactNode;
|
|
11
5
|
}
|
|
12
6
|
interface State {
|
|
13
7
|
show: boolean;
|
|
@@ -8,6 +8,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import classNames from "classnames";
|
|
10
10
|
import { CSSTransition } from "react-transition-group";
|
|
11
|
+
import { Close } from "@nutui/icons-react";
|
|
11
12
|
import { render as reactRender, unmount } from "../../utils/render";
|
|
12
13
|
var classPrefix = 'nut-notify';
|
|
13
14
|
var _React_PureComponent;
|
|
@@ -33,6 +34,7 @@ var Notification = /*#__PURE__*/ function(_superClass) {
|
|
|
33
34
|
{
|
|
34
35
|
key: "close",
|
|
35
36
|
value: function close() {
|
|
37
|
+
var _this_props;
|
|
36
38
|
this.setState({
|
|
37
39
|
show: false
|
|
38
40
|
});
|
|
@@ -41,7 +43,7 @@ var Notification = /*#__PURE__*/ function(_superClass) {
|
|
|
41
43
|
var element = document.getElementById(this.props.id);
|
|
42
44
|
element && element.parentNode && element.parentNode.removeChild(element);
|
|
43
45
|
}
|
|
44
|
-
this.props.onClose();
|
|
46
|
+
(_this_props = this.props) === null || _this_props === void 0 ? void 0 : _this_props.onClose();
|
|
45
47
|
}
|
|
46
48
|
},
|
|
47
49
|
{
|
|
@@ -86,22 +88,40 @@ var Notification = /*#__PURE__*/ function(_superClass) {
|
|
|
86
88
|
{
|
|
87
89
|
key: "render",
|
|
88
90
|
value: function render() {
|
|
89
|
-
var _this_props = this.props, style = _this_props.style, message = _this_props.message,
|
|
91
|
+
var _this_props = this.props, id = _this_props.id, style = _this_props.style, message = _this_props.message, leftIcon = _this_props.leftIcon, rightIcon = _this_props.rightIcon, closeable = _this_props.closeable, className = _this_props.className, position = _this_props.position, distance = _this_props.distance, navHeight = _this_props.navHeight;
|
|
90
92
|
var show = this.state.show;
|
|
93
|
+
var classes = classNames(classPrefix, className);
|
|
94
|
+
var getDistance = function() {
|
|
95
|
+
if (position === 'top') {
|
|
96
|
+
return {
|
|
97
|
+
top: "".concat(distance + navHeight, "px")
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
bottom: "".concat(distance, "px")
|
|
102
|
+
};
|
|
103
|
+
};
|
|
91
104
|
var _obj;
|
|
92
|
-
var classes = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-popup-top"), position === 'top'), _define_property(_obj, "".concat(classPrefix, "-popup-bottom"), position === 'bottom'), _define_property(_obj, "".concat(classPrefix), true), _define_property(_obj, "".concat(classPrefix, "-").concat(type), true), _obj));
|
|
93
105
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(CSSTransition, {
|
|
94
106
|
in: show,
|
|
95
107
|
timeout: 300,
|
|
96
108
|
classNames: "fade",
|
|
97
109
|
unmountOnExit: true,
|
|
98
110
|
appear: true,
|
|
99
|
-
position: position
|
|
111
|
+
position: position,
|
|
112
|
+
id: id
|
|
100
113
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
101
|
-
className:
|
|
102
|
-
style: style,
|
|
114
|
+
className: classes,
|
|
115
|
+
style: _object_spread({}, style, getDistance()),
|
|
103
116
|
onClick: this.clickCover
|
|
104
|
-
},
|
|
117
|
+
}, leftIcon ? /*#__PURE__*/ React.createElement("div", {
|
|
118
|
+
className: "".concat(classPrefix, "-left-icon")
|
|
119
|
+
}, leftIcon) : null, /*#__PURE__*/ React.createElement("div", {
|
|
120
|
+
className: classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix, "-content"), true), _define_property(_obj, "".concat(classPrefix, "-ellipsis"), closeable || rightIcon), _define_property(_obj, "".concat(classPrefix, "-layout-left"), leftIcon || rightIcon), _obj))
|
|
121
|
+
}, message), rightIcon || closeable ? /*#__PURE__*/ React.createElement("div", {
|
|
122
|
+
className: "".concat(classPrefix, "-right-icon"),
|
|
123
|
+
onClick: this.close
|
|
124
|
+
}, rightIcon || (closeable ? /*#__PURE__*/ React.createElement(Close, null) : null)) : null)));
|
|
105
125
|
}
|
|
106
126
|
}
|
|
107
127
|
]);
|
|
@@ -126,7 +146,7 @@ Notification.newInstance = function(properties, callback) {
|
|
|
126
146
|
});
|
|
127
147
|
};
|
|
128
148
|
var element = document.createElement('div');
|
|
129
|
-
var id = properties.id ? properties.id : "".concat(
|
|
149
|
+
var id = properties.id ? properties.id : "".concat(Date.now());
|
|
130
150
|
element.id = id;
|
|
131
151
|
properties.id = id;
|
|
132
152
|
document.body.appendChild(element);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
text(message: string | React.ReactNode, option?: {}): void;
|
|
4
|
-
success(message: string | React.ReactNode, option?: {}): void;
|
|
5
|
-
primary(message: string | React.ReactNode, option?: {}): void;
|
|
6
|
-
danger(message: string | React.ReactNode, option?: {}): void;
|
|
7
|
-
warn(message: string | React.ReactNode, option?: {}): void;
|
|
8
4
|
hide(): void;
|
|
9
5
|
};
|
|
10
6
|
export default _default;
|
|
@@ -6,9 +6,13 @@ import { ComponentDefaults } from "../../utils/typings";
|
|
|
6
6
|
var messageInstance = null;
|
|
7
7
|
var options = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
8
8
|
id: '',
|
|
9
|
-
duration: 3000,
|
|
10
|
-
type: 'danger',
|
|
11
9
|
position: 'top',
|
|
10
|
+
distance: 8,
|
|
11
|
+
navHeight: 57,
|
|
12
|
+
closeable: false,
|
|
13
|
+
leftIcon: null,
|
|
14
|
+
rightIcon: null,
|
|
15
|
+
duration: 3000,
|
|
12
16
|
onClose: function() {},
|
|
13
17
|
onClick: function() {}
|
|
14
18
|
});
|
|
@@ -41,38 +45,6 @@ export default {
|
|
|
41
45
|
type: 'base'
|
|
42
46
|
}, option));
|
|
43
47
|
},
|
|
44
|
-
success: function success(message) {
|
|
45
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
46
|
-
errorMsg(message);
|
|
47
|
-
return notice(_object_spread({
|
|
48
|
-
message: message,
|
|
49
|
-
type: 'success'
|
|
50
|
-
}, option));
|
|
51
|
-
},
|
|
52
|
-
primary: function primary(message) {
|
|
53
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
54
|
-
errorMsg(message);
|
|
55
|
-
return notice(_object_spread({
|
|
56
|
-
message: message,
|
|
57
|
-
type: 'primary'
|
|
58
|
-
}, option));
|
|
59
|
-
},
|
|
60
|
-
danger: function danger(message) {
|
|
61
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
62
|
-
errorMsg(message);
|
|
63
|
-
return notice(_object_spread({
|
|
64
|
-
message: message,
|
|
65
|
-
type: 'danger'
|
|
66
|
-
}, option));
|
|
67
|
-
},
|
|
68
|
-
warn: function warn(message) {
|
|
69
|
-
var option = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
70
|
-
errorMsg(message);
|
|
71
|
-
return notice(_object_spread({
|
|
72
|
-
message: message,
|
|
73
|
-
type: 'warning'
|
|
74
|
-
}, option));
|
|
75
|
-
},
|
|
76
48
|
hide: function hide() {
|
|
77
49
|
if (messageInstance) {
|
|
78
50
|
messageInstance.destroy();
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/*入场动画过程*/
|
|
7
7
|
.fade-enter-active {
|
|
8
8
|
opacity: 1;
|
|
9
|
-
transition: opacity
|
|
9
|
+
transition: opacity 300ms ease-in;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/*入场动画结束*/
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/*离场动画过程*/
|
|
23
23
|
.fade-exit-active {
|
|
24
24
|
opacity: 0;
|
|
25
|
-
transition: opacity
|
|
25
|
+
transition: opacity 300ms ease-out;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/*离场动画结束*/
|
|
@@ -38,56 +38,59 @@
|
|
|
38
38
|
/*页面第一次加载时的动画过程*/
|
|
39
39
|
.fade-appear-active {
|
|
40
40
|
opacity: 1;
|
|
41
|
-
transition: opacity
|
|
41
|
+
transition: opacity 300ms;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.nut-notify {
|
|
45
|
+
position: fixed;
|
|
46
|
+
left: 8px;
|
|
47
|
+
right: 8px;
|
|
48
|
+
z-index: $notify-z-index;
|
|
45
49
|
display: flex;
|
|
46
|
-
justify-content: center;
|
|
47
50
|
align-items: center;
|
|
48
51
|
box-sizing: border-box;
|
|
49
|
-
padding: $notify-padding;
|
|
50
|
-
color: $notify-text-color;
|
|
51
|
-
font-size: $notify-font-size;
|
|
52
|
-
white-space: pre-wrap;
|
|
53
|
-
word-wrap: break-word;
|
|
54
52
|
height: $notify-height;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&-popup-bottom {
|
|
71
|
-
bottom: 0;
|
|
53
|
+
padding: $notify-padding;
|
|
54
|
+
border-radius: $notify-border-radius;
|
|
55
|
+
box-shadow: $notify-box-shadow;
|
|
56
|
+
background-color: $notify-background-color;
|
|
57
|
+
|
|
58
|
+
&-content {
|
|
59
|
+
flex: 1;
|
|
60
|
+
text-align: center;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
font-size: $notify-font-size;
|
|
63
|
+
color: $notify-text-color;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
overflow: hidden;
|
|
72
66
|
}
|
|
73
67
|
|
|
74
|
-
&-
|
|
75
|
-
|
|
68
|
+
&-ellipsis {
|
|
69
|
+
text-overflow: ellipsis;
|
|
76
70
|
}
|
|
77
71
|
|
|
78
|
-
&-
|
|
79
|
-
|
|
72
|
+
&-layout-left {
|
|
73
|
+
text-align: left;
|
|
80
74
|
}
|
|
81
75
|
|
|
82
|
-
&-
|
|
83
|
-
|
|
76
|
+
&-left-icon,
|
|
77
|
+
&-right-icon {
|
|
78
|
+
display: inline-flex;
|
|
84
79
|
}
|
|
85
80
|
|
|
86
|
-
&-
|
|
87
|
-
|
|
81
|
+
&-left-icon {
|
|
82
|
+
margin-right: 6px;
|
|
83
|
+
.nut-icon {
|
|
84
|
+
height: 16px;
|
|
85
|
+
width: 16px;
|
|
86
|
+
}
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
&-
|
|
91
|
-
|
|
89
|
+
&-right-icon {
|
|
90
|
+
margin-left: 6px;
|
|
91
|
+
.nut-icon {
|
|
92
|
+
height: 12px;
|
|
93
|
+
width: 12px;
|
|
94
|
+
}
|
|
92
95
|
}
|
|
93
96
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
/*入场动画过程*/
|
|
12
12
|
.fade-enter-active {
|
|
13
13
|
opacity: 1;
|
|
14
|
-
transition: opacity
|
|
14
|
+
transition: opacity 300ms ease-in;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/*入场动画结束*/
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/*离场动画过程*/
|
|
28
28
|
.fade-exit-active {
|
|
29
29
|
opacity: 0;
|
|
30
|
-
transition: opacity
|
|
30
|
+
transition: opacity 300ms ease-out;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/*离场动画结束*/
|
|
@@ -43,47 +43,52 @@
|
|
|
43
43
|
/*页面第一次加载时的动画过程*/
|
|
44
44
|
.fade-appear-active {
|
|
45
45
|
opacity: 1;
|
|
46
|
-
transition: opacity
|
|
46
|
+
transition: opacity 300ms;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.nut-notify {
|
|
50
|
+
position: fixed;
|
|
51
|
+
left: 8px;
|
|
52
|
+
right: 8px;
|
|
53
|
+
z-index: var(--nutui-notify-z-index, 1000);
|
|
50
54
|
display: flex;
|
|
51
|
-
justify-content: center;
|
|
52
55
|
align-items: center;
|
|
53
56
|
box-sizing: border-box;
|
|
54
|
-
padding: var(--nutui-notify-padding, 0px 10px);
|
|
55
|
-
color: var(--nutui-notify-text-color, #ffffff);
|
|
56
|
-
font-size: var(--nutui-notify-font-size, var(--nutui-font-size-base, 14px));
|
|
57
|
-
white-space: pre-wrap;
|
|
58
|
-
word-wrap: break-word;
|
|
59
57
|
height: var(--nutui-notify-height, 40px);
|
|
58
|
+
padding: var(--nutui-notify-padding, 0px 12px);
|
|
59
|
+
border-radius: var(--nutui-notify-border-radius, 8px);
|
|
60
|
+
box-shadow: var(--nutui-notify-box-shadow, 0px 4px 12px 0px rgba(0, 0, 0, 0.06));
|
|
61
|
+
background-color: var(--nutui-notify-background-color, #ffffff);
|
|
62
|
+
}
|
|
63
|
+
.nut-notify-content {
|
|
64
|
+
flex: 1;
|
|
65
|
+
text-align: center;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
font-size: var(--nutui-notify-font-size, var(--nutui-font-size-base, 14px));
|
|
68
|
+
color: var(--nutui-notify-text-color, var(--nutui-color-title, #1a1a1a));
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
60
71
|
}
|
|
61
|
-
.nut-notify-
|
|
62
|
-
|
|
63
|
-
left: 0;
|
|
64
|
-
right: 0;
|
|
65
|
-
overflow-y: auto;
|
|
66
|
-
transition: transform 0.3s;
|
|
67
|
-
z-index: 9999;
|
|
68
|
-
}
|
|
69
|
-
.nut-notify-popup-top {
|
|
70
|
-
top: 0;
|
|
72
|
+
.nut-notify-ellipsis {
|
|
73
|
+
text-overflow: ellipsis;
|
|
71
74
|
}
|
|
72
|
-
.nut-notify-
|
|
73
|
-
|
|
75
|
+
.nut-notify-layout-left {
|
|
76
|
+
text-align: left;
|
|
74
77
|
}
|
|
75
|
-
.nut-notify-
|
|
76
|
-
|
|
78
|
+
.nut-notify-left-icon, .nut-notify-right-icon {
|
|
79
|
+
display: inline-flex;
|
|
77
80
|
}
|
|
78
|
-
.nut-notify-
|
|
79
|
-
|
|
81
|
+
.nut-notify-left-icon {
|
|
82
|
+
margin-right: 6px;
|
|
80
83
|
}
|
|
81
|
-
.nut-notify-
|
|
82
|
-
|
|
84
|
+
.nut-notify-left-icon .nut-icon {
|
|
85
|
+
height: 16px;
|
|
86
|
+
width: 16px;
|
|
83
87
|
}
|
|
84
|
-
.nut-notify-
|
|
85
|
-
|
|
88
|
+
.nut-notify-right-icon {
|
|
89
|
+
margin-left: 6px;
|
|
86
90
|
}
|
|
87
|
-
.nut-notify-
|
|
88
|
-
|
|
91
|
+
.nut-notify-right-icon .nut-icon {
|
|
92
|
+
height: 12px;
|
|
93
|
+
width: 12px;
|
|
89
94
|
}
|
|
@@ -384,7 +384,6 @@
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
.nut-pickerview {
|
|
387
|
-
--nutui-picker-item-height: 36px;
|
|
388
387
|
position: relative;
|
|
389
388
|
display: flex;
|
|
390
389
|
width: 100%;
|
|
@@ -430,6 +429,9 @@
|
|
|
430
429
|
z-index: 1;
|
|
431
430
|
transform-style: preserve-3d;
|
|
432
431
|
}
|
|
432
|
+
.nut-pickerview-roller-placeholder {
|
|
433
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
434
|
+
}
|
|
433
435
|
.nut-pickerview-roller-item {
|
|
434
436
|
position: absolute;
|
|
435
437
|
top: 0;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
1
2
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
2
3
|
import React, { useState, useEffect, useRef, useImperativeHandle } from "react";
|
|
4
|
+
import classNames from "classnames";
|
|
3
5
|
import { useTouch } from "../../hooks/use-touch";
|
|
4
6
|
import { passiveSupported } from "../../utils/supports-passive";
|
|
5
7
|
import { preventDefault } from "../../utils";
|
|
@@ -8,12 +10,13 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
8
10
|
var _props_keyIndex = props.keyIndex, keyIndex = _props_keyIndex === void 0 ? 0 : _props_keyIndex, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_threeDimensional = props.threeDimensional, threeDimensional = _props_threeDimensional === void 0 ? true : _props_threeDimensional, _props_duration = props.duration, duration = _props_duration === void 0 ? 1000 : _props_duration, onSelect = props.onSelect, _props_renderLabel = props.renderLabel, renderLabel = _props_renderLabel === void 0 ? function(item) {
|
|
9
11
|
return item.label;
|
|
10
12
|
} : _props_renderLabel;
|
|
13
|
+
var classPrefix = 'nut-pickerview-roller';
|
|
11
14
|
var DEFAULT_DURATION = 200;
|
|
12
15
|
var INERTIA_TIME = 300;
|
|
13
16
|
var INERTIA_DISTANCE = 15;
|
|
14
17
|
var ROTATION = 20;
|
|
15
18
|
var touch = useTouch();
|
|
16
|
-
var _useState = _sliced_to_array(useState(
|
|
19
|
+
var _useState = _sliced_to_array(useState(0), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
|
|
17
20
|
var lineSpacing = useRef(36);
|
|
18
21
|
var _useState1 = _sliced_to_array(useState(0), 2), touchTime = _useState1[0], setTouchTime = _useState1[1];
|
|
19
22
|
var _useState2 = _sliced_to_array(useState('0deg'), 2), touchDeg = _useState2[0], setTouchDeg = _useState2[1];
|
|
@@ -48,7 +51,7 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
48
51
|
var deg1 = Math.min(Math.max(currentDeg, 0), (options.length + 1) * ROTATION);
|
|
49
52
|
if (deg1 >= 0 && deg1 < (options.length + 1) * ROTATION) {
|
|
50
53
|
applyTransform('', "".concat(deg1, "deg"), undefined, updatedMove);
|
|
51
|
-
setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
|
|
54
|
+
deg1 > 0 && setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
};
|
|
@@ -89,7 +92,7 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
89
92
|
var index = options.findIndex(function(item) {
|
|
90
93
|
return item.value === selectedValue;
|
|
91
94
|
});
|
|
92
|
-
setCurrentIndex(index === -1 ?
|
|
95
|
+
setCurrentIndex(index === -1 ? 0 : index + 1);
|
|
93
96
|
var move = index * lineSpacing.current;
|
|
94
97
|
shouldSelect && selectValue(-move);
|
|
95
98
|
handleMove(-move);
|
|
@@ -149,21 +152,22 @@ var InternalPickerRoller = function(props, ref) {
|
|
|
149
152
|
className: "nut-pickerview-list",
|
|
150
153
|
ref: pickerRollerRef
|
|
151
154
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
152
|
-
className:
|
|
155
|
+
className: classPrefix,
|
|
153
156
|
ref: rollerRef,
|
|
154
157
|
style: threeDimensional ? touchRollerStyle() : touchTiledStyle(),
|
|
155
158
|
onTransitionEnd: stopMomentumScroll
|
|
156
159
|
}, threeDimensional && options.map(function(item, index) {
|
|
157
160
|
var _item_value;
|
|
161
|
+
var _obj;
|
|
158
162
|
return /*#__PURE__*/ React.createElement("div", {
|
|
159
|
-
className: "
|
|
163
|
+
className: classNames("".concat(classPrefix, "-item"), (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-item-hidden"), isItemHidden(index + 1)), _define_property(_obj, "".concat(classPrefix, "-item-active"), index + 1 === currentIndex), _obj)),
|
|
160
164
|
style: rollerStyle(index),
|
|
161
165
|
key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
|
|
162
166
|
}, renderLabel(item));
|
|
163
167
|
}), !threeDimensional && options.map(function(item, index) {
|
|
164
168
|
var _item_value;
|
|
165
169
|
return /*#__PURE__*/ React.createElement("div", {
|
|
166
|
-
className: "
|
|
170
|
+
className: classNames("".concat(classPrefix, "-item-tiled"), _define_property({}, "".concat(classPrefix, "-item-active"), index + 1 === currentIndex)),
|
|
167
171
|
key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
|
|
168
172
|
}, renderLabel(item));
|
|
169
173
|
})));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.nut-pickerview {
|
|
2
|
-
--nutui-picker-item-height: 36px;
|
|
3
2
|
position: relative;
|
|
4
3
|
display: flex;
|
|
5
4
|
width: 100%;
|
|
@@ -50,6 +49,9 @@
|
|
|
50
49
|
height: $picker-item-height;
|
|
51
50
|
z-index: 1;
|
|
52
51
|
transform-style: preserve-3d;
|
|
52
|
+
&-placeholder {
|
|
53
|
+
height: $picker-item-height;
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
&-roller-item {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
/* #ifndef harmony */
|
|
4
4
|
/* #endif */
|
|
5
5
|
.nut-pickerview {
|
|
6
|
-
--nutui-picker-item-height: 36px;
|
|
7
6
|
position: relative;
|
|
8
7
|
display: flex;
|
|
9
8
|
width: 100%;
|
|
@@ -49,6 +48,9 @@
|
|
|
49
48
|
z-index: 1;
|
|
50
49
|
transform-style: preserve-3d;
|
|
51
50
|
}
|
|
51
|
+
.nut-pickerview-roller-placeholder {
|
|
52
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
53
|
+
}
|
|
52
54
|
.nut-pickerview-roller-item {
|
|
53
55
|
position: absolute;
|
|
54
56
|
top: 0;
|