@nutui/nutui-react 3.0.0-beta.1 → 3.0.0-beta.2

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.
@@ -7,12 +7,20 @@
7
7
  }
8
8
  }
9
9
  .nut-toast {
10
+ /* #ifdef rn */
11
+ position: absolute;
12
+ /* #endif */
13
+ /* #ifndef rn */
10
14
  position: fixed;
15
+ /* #endif */
11
16
  left: 0;
12
17
  top: 0;
18
+ display: flex;
19
+ flex-direction: row;
20
+ justify-content: center;
21
+ align-items: center;
13
22
  width: 100%;
14
23
  height: 100%;
15
- text-align: center;
16
24
  pointer-events: none;
17
25
  z-index: 1300;
18
26
  }
@@ -20,18 +28,24 @@
20
28
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
21
29
  --nutui-overlay-zIndex: 1300;
22
30
  }
23
- .nut-toast-small .nut-toast-inner {
24
- font-size: var(--nutui-font-size-s, 12px);
25
- }
26
- .nut-toast-large .nut-toast-inner {
27
- font-size: var(--nutui-font-size-l, 16px);
31
+ .nut-toast-overlay-default-taro {
32
+ /* #ifdef harmony */
33
+ background-color: rgba(0, 0, 0, 0);
34
+ z-index: 1300;
35
+ /* #endif */
36
+ /* #ifndef harmony */
37
+ --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
38
+ --nutui-overlay-zIndex: 1300;
39
+ /* #endif */
28
40
  }
29
41
  .nut-toast-inner {
30
- display: flex;
31
- flex-direction: column;
32
42
  position: absolute;
33
- left: 50%;
34
43
  top: var(--nutui-toast-inner-top, 50%);
44
+ transform: translate(0, -50%);
45
+ display: flex;
46
+ flex-direction: column;
47
+ justify-content: center;
48
+ align-items: center;
35
49
  min-width: 30%;
36
50
  max-width: 95.7%;
37
51
  font-size: var(--nutui-toast-text-font-size, 14px);
@@ -41,18 +55,28 @@
41
55
  background: var(--nutui-toast-inner-bg-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
42
56
  border-radius: var(--nutui-toast-inner-border-radius, 16px);
43
57
  color: var(--nutui-toast-font-color, #ffffff);
44
- transform: translate(-50%, -50%);
45
58
  }
46
- .nut-toast-inner.normal {
59
+ .nut-toast-inner-normal {
47
60
  word-break: normal;
48
61
  word-wrap: normal;
49
62
  }
50
- .nut-toast-inner.break-word {
63
+ .nut-toast-inner-break-word {
51
64
  word-break: normal;
52
65
  word-wrap: break-word;
53
66
  }
67
+ .nut-toast-inner-small {
68
+ font-size: var(--nutui-font-size-s, 12px);
69
+ }
70
+ .nut-toast-inner-large {
71
+ font-size: var(--nutui-font-size-l, 16px);
72
+ }
54
73
  .nut-toast-center {
55
- top: var(--nutui-toast-inner-top, 50%);
74
+ /* #ifdef rn */
75
+ top: var(--nutui-toast-inner-top, 38%);
76
+ /* #endif */
77
+ /* #ifndef rn */
78
+ top: var(--nutui-toast-inner-top, 48%);
79
+ /* #endif */
56
80
  }
57
81
  .nut-toast-bottom {
58
82
  top: var(--nutui-toast-inner-top, 80%);
@@ -60,40 +84,43 @@
60
84
  .nut-toast-top {
61
85
  top: var(--nutui-toast-inner-top, 20%);
62
86
  }
63
- .nut-toast-text:empty {
87
+ .nut-toast-text {
88
+ color: #ffffff;
89
+ text-align: var(--nutui-toast-inner-text-align, center);
90
+ }
91
+ .nut-toast-text-empty {
64
92
  margin-bottom: -8px;
65
93
  }
66
94
  .nut-toast-title {
67
95
  color: #ffffff;
68
96
  font-size: var(--nutui-toast-title-font-size, 16px);
69
97
  font-weight: 500;
98
+ text-align: var(--nutui-toast-inner-text-align, center);
70
99
  }
71
- .nut-toast-title:empty {
72
- margin-bottom: -8px;
100
+ .nut-toast-icon {
101
+ width: 24px;
102
+ height: 24px;
103
+ color: #ffffff;
73
104
  }
74
- .nut-toast-has-icon .nut-toast-icon-wrapper {
105
+ .nut-toast-icon-wrapper {
75
106
  width: 100%;
76
107
  display: flex;
77
108
  align-items: center;
78
109
  justify-content: center;
79
110
  margin-bottom: 8px;
111
+ color: #ffffff;
80
112
  }
81
- .nut-toast-has-icon .nut-toast-icon-wrapper .nut-icon {
113
+ .nut-toast-icon-wrapper-icon {
82
114
  width: 24px;
83
115
  height: 24px;
84
116
  }
85
- .nut-toast-loading .nut-toast-inner {
86
- display: inline-flex;
87
- flex-direction: column;
88
- justify-content: center;
89
- align-items: center;
90
- }
91
- .nut-toast-loading .nut-toast-icon-wrapper {
92
- animation: rotation 2s linear infinite;
117
+ .nut-toast-rtl {
118
+ left: auto;
119
+ right: 0;
93
120
  }
94
- .nut-toast-loading .nut-toast-icon-wrapper .nut-icon {
95
- width: 24px;
96
- height: 24px;
121
+ .nut-toast-rtl-inner {
122
+ left: auto;
123
+ right: 50%;
97
124
  }
98
125
 
99
126
  [dir=rtl] .nut-toast,
@@ -105,7 +132,6 @@
105
132
  .nut-rtl .nut-toast-inner {
106
133
  left: auto;
107
134
  right: 50%;
108
- transform: translate(50%, -50%);
109
135
  }
110
136
 
111
137
  .toast-fade-enter-active {
@@ -9,12 +9,20 @@
9
9
  }
10
10
 
11
11
  .nut-toast {
12
+ /* #ifdef rn */
13
+ position: absolute;
14
+ /* #endif */
15
+ /* #ifndef rn */
12
16
  position: fixed;
17
+ /* #endif */
13
18
  left: 0;
14
19
  top: 0;
20
+ display: flex;
21
+ flex-direction: row;
22
+ justify-content: center;
23
+ align-items: center;
15
24
  width: 100%;
16
25
  height: 100%;
17
- text-align: center;
18
26
  pointer-events: none;
19
27
  z-index: 1300;
20
28
 
@@ -23,24 +31,25 @@
23
31
  --nutui-overlay-zIndex: 1300;
24
32
  }
25
33
 
26
- &-small {
27
- .nut-toast-inner {
28
- font-size: $font-size-s;
29
- }
30
- }
31
-
32
- &-large {
33
- .nut-toast-inner {
34
- font-size: $font-size-l;
35
- }
34
+ &-overlay-default-taro {
35
+ /* #ifdef harmony */
36
+ background-color: rgba(0, 0, 0, 0);
37
+ z-index: 1300;
38
+ /* #endif */
39
+ /* #ifndef harmony */
40
+ --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
41
+ --nutui-overlay-zIndex: 1300;
42
+ /* #endif */
36
43
  }
37
44
 
38
45
  &-inner {
39
- display: flex;
40
- flex-direction: column;
41
46
  position: absolute;
42
- left: 50%;
43
47
  top: $toast-inner-top;
48
+ transform: translate(-0, -50%);
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: center;
52
+ align-items: center;
44
53
  min-width: 30%;
45
54
  max-width: 95.7%;
46
55
  font-size: $toast-text-font-size;
@@ -50,21 +59,33 @@
50
59
  background: $toast-inner-bg-color;
51
60
  border-radius: $toast-inner-border-radius;
52
61
  color: $toast-font-color;
53
- transform: translate(-50%, -50%);
54
62
 
55
- &.normal {
63
+ &-normal {
56
64
  word-break: normal;
57
65
  word-wrap: normal;
58
66
  }
59
67
 
60
- &.break-word {
68
+ &-break-word {
61
69
  word-break: normal;
62
70
  word-wrap: break-word;
63
71
  }
72
+
73
+ &-small {
74
+ font-size: $font-size-s;
75
+ }
76
+
77
+ &-large {
78
+ font-size: $font-size-l;
79
+ }
64
80
  }
65
81
 
66
82
  &-center {
67
- top: var(--nutui-toast-inner-top, 50%);
83
+ /* #ifdef rn */
84
+ top: var(--nutui-toast-inner-top, 38%);
85
+ /* #endif */
86
+ /* #ifndef rn */
87
+ top: var(--nutui-toast-inner-top, 48%);
88
+ /* #endif */
68
89
  }
69
90
 
70
91
  &-bottom {
@@ -76,7 +97,9 @@
76
97
  }
77
98
 
78
99
  &-text {
79
- &:empty {
100
+ color: #ffffff;
101
+ text-align: $toast-inner-text-align;
102
+ &-empty {
80
103
  margin-bottom: -8px;
81
104
  }
82
105
  }
@@ -85,42 +108,36 @@
85
108
  color: #ffffff;
86
109
  font-size: $toast-title-font-size;
87
110
  font-weight: 500;
88
-
89
- &:empty {
90
- margin-bottom: -8px;
91
- }
111
+ text-align: $toast-inner-text-align;
92
112
  }
93
113
 
94
- &-has-icon {
95
- .nut-toast-icon-wrapper {
96
- width: 100%;
97
- display: flex;
98
- align-items: center;
99
- justify-content: center;
100
- margin-bottom: 8px;
101
-
102
- .nut-icon {
103
- width: 24px;
104
- height: 24px;
105
- }
106
- }
114
+ &-icon {
115
+ width: 24px;
116
+ height: 24px;
117
+ color: #ffffff;
107
118
  }
108
119
 
109
- &-loading {
110
- .nut-toast-inner {
111
- display: inline-flex;
112
- flex-direction: column;
113
- justify-content: center;
114
- align-items: center;
120
+ &-icon-wrapper {
121
+ width: 100%;
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ margin-bottom: 8px;
126
+ color: #ffffff;
127
+
128
+ &-icon {
129
+ width: 24px;
130
+ height: 24px;
115
131
  }
132
+ }
116
133
 
117
- .nut-toast-icon-wrapper {
118
- animation: rotation 2s linear infinite;
134
+ &-rtl {
135
+ left: auto;
136
+ right: 0;
119
137
 
120
- .nut-icon {
121
- width: 24px;
122
- height: 24px;
123
- }
138
+ &-inner {
139
+ left: auto;
140
+ right: 50%;
124
141
  }
125
142
  }
126
143
  }
@@ -133,7 +150,6 @@
133
150
  &-inner {
134
151
  left: auto;
135
152
  right: 50%;
136
- transform: translate(50%, -50%);
137
153
  }
138
154
  }
139
155
 
@@ -5,66 +5,18 @@ export type ToastIcon = 'success' | 'fail' | 'loading' | 'warn' | React.ReactNod
5
5
  export type ToastWordBreak = 'normal' | 'break-all' | 'break-word';
6
6
  export interface ToastProps extends BasicComponent {
7
7
  id?: string;
8
- /**
9
- * 展示时长(秒),值为 0 时,toast 不会自动消失
10
- * @default 2
11
- */
12
- duration?: number
13
- /**
14
- * toast展示位置
15
- * @default center
16
- */
17
- position?: ToastPosition
18
- /**
19
- * 标题
20
- * @default -
21
- */
22
- title?: string
23
- /**
24
- * 是否在点击遮罩层后关闭提示
25
- * @default false
26
- */
27
- closeOnOverlayClick?: boolean
28
- /**
29
- * 背景是否锁定
30
- * @default false
31
- */
32
- lockScroll?: boolean
33
- /**
34
- * 文案尺寸,三选一
35
- * @default base
36
- */
37
- size?: string | number
38
- /**
39
- * 自定义图标
40
- * @default -
41
- */
42
- icon?: ToastIcon
43
- /**
44
- * 消息文本内容
45
- * @default -
46
- */
47
- content?: React.ReactNode
48
- /**
49
- * 关闭时触发的事件
50
- * @default () => void
51
- */
52
- onClose?: () => void
53
- /**
54
- * 自定义内容区类名
55
- * @default -
56
- */
57
- contentClassName?: string
58
- /**
59
- * 自定义内容区样式
60
- * @default -
61
- */
62
- contentStyle?: React.CSSProperties
63
- /**
64
- * 换行截断方式
65
- * @default break-all
66
- */
67
- wordBreak?: ToastWordBreak
8
+ duration?: number;
9
+ position?: ToastPosition;
10
+ title?: string;
11
+ closeOnOverlayClick?: boolean;
12
+ lockScroll?: boolean;
13
+ size?: string | number;
14
+ icon?: ToastIcon;
15
+ content?: React.ReactNode;
16
+ onClose?: () => void;
17
+ contentClassName?: string;
18
+ contentStyle?: React.CSSProperties;
19
+ wordBreak?: ToastWordBreak;
68
20
  }
69
21
  declare function show(option: ToastProps | string): void;
70
22
  declare function config(config: ToastProps): void;
@@ -11,11 +11,11 @@ var options = _object_spread_props(_object_spread({}, ComponentDefaults), {
11
11
  title: '',
12
12
  size: 'base',
13
13
  icon: null,
14
- onClose: function() {},
15
14
  closeOnOverlayClick: false,
16
15
  lockScroll: false,
17
16
  contentClassName: '',
18
- wordBreak: 'break-all'
17
+ wordBreak: 'break-all',
18
+ onClose: function() {}
19
19
  });
20
20
  function getInstance(props, callback) {
21
21
  if (messageInstance) {
@@ -1,5 +1,6 @@
1
1
  .nut-trendarrow {
2
- display: inline-flex;
2
+ display: flex;
3
+ flex-direction: row;
3
4
  align-items: center;
4
5
  color: var(--nutui-color-title, #1a1a1a);
5
6
  font-size: var(--nutui-trendarrow-font-size, 14px);
@@ -1,5 +1,6 @@
1
1
  .nut-trendarrow {
2
- display: inline-flex;
2
+ display: flex;
3
+ flex-direction: row;
3
4
  align-items: center;
4
5
  color: $color-title;
5
6
  font-size: $trendarrow-font-size;
@@ -1,60 +1,16 @@
1
1
  import React, { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from "../../utils/typings";
3
3
  export interface TrendArrowProps extends BasicComponent {
4
- /**
5
- * 数值,大于0时箭头向上,小于0时箭头向下
6
- * @default -
7
- */
8
- value: number
9
- /**
10
- * 小数位精度
11
- * @default 2
12
- */
13
- digits: number
14
- /**
15
- * 是否显示加减号
16
- * @default false
17
- */
18
- symbol: boolean
19
- /**
20
- * 是否显示 0
21
- * @default false
22
- */
23
- zero: boolean
24
- /**
25
- * 是否在数字左侧显示箭头
26
- * @default false
27
- */
28
- left: boolean
29
- /**
30
- * 文字颜色是否与箭头同步
31
- * @default true
32
- */
33
- sync: boolean
34
- /**
35
- * 文字颜色
36
- * @default #333333
37
- */
38
- color: string
39
- /**
40
- * 向上箭头颜色
41
- * @default #FF0F23
42
- */
43
- riseColor: string
44
- /**
45
- * 向下箭头颜色
46
- * @default #64b578
47
- */
48
- dropColor: string
49
- /**
50
- * 自定义向上箭头icon
51
- * @default <TriangleUp/>
52
- */
53
- riseIcon: React.ReactNode
54
- /**
55
- * 自定义向下箭头icon
56
- * @default <TriangleDown/>
57
- */
58
- dropIcon: React.ReactNode
4
+ value: number;
5
+ digits: number;
6
+ symbol: boolean;
7
+ zero: boolean;
8
+ left: boolean;
9
+ sync: boolean;
10
+ color: string;
11
+ riseColor: string;
12
+ dropColor: string;
13
+ riseIcon: React.ReactNode;
14
+ dropIcon: React.ReactNode;
59
15
  }
60
16
  export declare const TrendArrow: FunctionComponent<Partial<TrendArrowProps> & React.HTMLAttributes<HTMLDivElement>>;