@nutui/nutui-react-taro 3.0.0-beta.1 → 3.0.0-beta.3

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.
Files changed (126) hide show
  1. package/dist/cjs/packages/avatar/avatar.js +14 -16
  2. package/dist/cjs/packages/avatar/style/avatar.scss +7 -60
  3. package/dist/cjs/packages/avatar/style/style.css +5 -43
  4. package/dist/cjs/packages/avatar/style/style.harmony.css +5 -43
  5. package/dist/cjs/packages/badge/badge.js +67 -12
  6. package/dist/cjs/packages/badge/style/badge.scss +18 -24
  7. package/dist/cjs/packages/badge/style/style.css +17 -15
  8. package/dist/cjs/packages/badge/style/style.harmony.css +22 -17
  9. package/dist/cjs/packages/button/button.js +1 -1
  10. package/dist/cjs/packages/calendarcard/calendarcard.js +8 -3
  11. package/dist/cjs/packages/calendarcard/icon.js +14 -2
  12. package/dist/cjs/packages/calendarcard/style/calendarcard.scss +25 -4
  13. package/dist/cjs/packages/calendarcard/style/style.css +27 -2
  14. package/dist/cjs/packages/image/image.js +5 -5
  15. package/dist/cjs/packages/input/input.js +3 -5
  16. package/dist/cjs/packages/input/style/input.scss +4 -0
  17. package/dist/cjs/packages/input/style/style.css +4 -0
  18. package/dist/cjs/packages/input/style/style.harmony.css +4 -0
  19. package/dist/cjs/packages/navbar/navbar.js +17 -8
  20. package/dist/cjs/packages/navbar/style/navbar.scss +46 -101
  21. package/dist/cjs/packages/navbar/style/style.css +44 -89
  22. package/dist/cjs/packages/navbar/style/style.harmony.css +45 -93
  23. package/dist/cjs/packages/overlay/style/style.harmony.css +5 -3
  24. package/dist/cjs/packages/pagination/pagination.js +2 -0
  25. package/dist/cjs/packages/pagination/style/pagination.scss +6 -12
  26. package/dist/cjs/packages/pagination/style/style.css +8 -14
  27. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +1 -1
  28. package/dist/cjs/packages/radio/index.d.ts +8 -2
  29. package/dist/cjs/packages/radio/index.js +6 -1
  30. package/dist/cjs/packages/radio/radio.d.ts +2 -5
  31. package/dist/cjs/packages/radio/radio.js +2 -4
  32. package/dist/cjs/packages/radio/style/radio.scss +1 -0
  33. package/dist/cjs/packages/radiogroup/radiogroup.d.ts +2 -1
  34. package/dist/cjs/packages/radiogroup/radiogroup.js +3 -2
  35. package/dist/cjs/packages/safearea/style/safearea.scss +1 -1
  36. package/dist/cjs/packages/safearea/style/style.css +1 -1
  37. package/dist/cjs/packages/safearea/style/style.harmony.css +1 -1
  38. package/dist/cjs/packages/searchbar/searchbar.d.ts +1 -1
  39. package/dist/cjs/packages/searchbar/searchbar.js +31 -33
  40. package/dist/cjs/packages/searchbar/style/searchbar.scss +10 -7
  41. package/dist/cjs/packages/searchbar/style/style.css +11 -8
  42. package/dist/cjs/packages/searchbar/style/style.harmony.css +25 -12
  43. package/dist/cjs/packages/skeleton/style/style.css +5 -43
  44. package/dist/cjs/packages/tabbar/style/style.css +17 -15
  45. package/dist/cjs/packages/tabbaritem/style/style.css +17 -15
  46. package/dist/cjs/packages/tag/tag.d.ts +1 -1
  47. package/dist/cjs/packages/tag/tag.js +5 -11
  48. package/dist/cjs/packages/toast/style/style.css +56 -30
  49. package/dist/cjs/packages/toast/style/style.harmony.css +51 -62
  50. package/dist/cjs/packages/toast/style/toast.scss +65 -49
  51. package/dist/cjs/packages/toast/toast.d.ts +7 -7
  52. package/dist/cjs/packages/toast/toast.js +24 -19
  53. package/dist/cjs/packages/trendarrow/style/style.css +2 -1
  54. package/dist/cjs/packages/trendarrow/style/style.harmony.css +3 -2
  55. package/dist/cjs/packages/trendarrow/style/trendarrow.scss +2 -1
  56. package/dist/cjs/packages/trendarrow/trendarrow.js +6 -4
  57. package/dist/cjs/packages/video/video.js +3 -3
  58. package/dist/es/packages/avatar/avatar.js +14 -16
  59. package/dist/es/packages/avatar/style/avatar.scss +7 -60
  60. package/dist/es/packages/avatar/style/style.css +5 -43
  61. package/dist/es/packages/avatar/style/style.harmony.css +5 -43
  62. package/dist/es/packages/badge/badge.d.ts +7 -35
  63. package/dist/es/packages/badge/badge.js +66 -12
  64. package/dist/es/packages/badge/style/badge.scss +18 -24
  65. package/dist/es/packages/badge/style/style.css +17 -15
  66. package/dist/es/packages/badge/style/style.harmony.css +22 -17
  67. package/dist/es/packages/button/button.js +1 -1
  68. package/dist/es/packages/calendarcard/calendarcard.d.ts +13 -65
  69. package/dist/es/packages/calendarcard/calendarcard.js +9 -4
  70. package/dist/es/packages/calendarcard/icon.js +15 -3
  71. package/dist/es/packages/calendarcard/style/calendarcard.scss +25 -4
  72. package/dist/es/packages/calendarcard/style/style.css +27 -2
  73. package/dist/es/packages/image/image.js +5 -5
  74. package/dist/es/packages/input/input.js +3 -5
  75. package/dist/es/packages/input/style/input.scss +4 -0
  76. package/dist/es/packages/input/style/style.css +4 -0
  77. package/dist/es/packages/input/style/style.harmony.css +4 -0
  78. package/dist/es/packages/loading/loading.d.ts +3 -15
  79. package/dist/es/packages/navbar/navbar.js +17 -8
  80. package/dist/es/packages/navbar/style/navbar.scss +46 -101
  81. package/dist/es/packages/navbar/style/style.css +44 -89
  82. package/dist/es/packages/navbar/style/style.harmony.css +45 -93
  83. package/dist/es/packages/overlay/style/style.harmony.css +5 -3
  84. package/dist/es/packages/pagination/pagination.js +2 -0
  85. package/dist/es/packages/pagination/style/pagination.scss +6 -12
  86. package/dist/es/packages/pagination/style/style.css +8 -14
  87. package/dist/es/packages/pulltorefresh/pulltorefresh.js +2 -2
  88. package/dist/es/packages/radio/index.d.ts +8 -2
  89. package/dist/es/packages/radio/index.js +5 -1
  90. package/dist/es/packages/radio/radio.d.ts +11 -50
  91. package/dist/es/packages/radio/radio.js +3 -5
  92. package/dist/es/packages/radio/style/radio.scss +1 -0
  93. package/dist/es/packages/radiogroup/radiogroup.d.ts +9 -36
  94. package/dist/es/packages/radiogroup/radiogroup.js +3 -2
  95. package/dist/es/packages/safearea/safearea.d.ts +1 -5
  96. package/dist/es/packages/safearea/style/safearea.scss +1 -1
  97. package/dist/es/packages/safearea/style/style.css +1 -1
  98. package/dist/es/packages/safearea/style/style.harmony.css +1 -1
  99. package/dist/es/packages/searchbar/searchbar.d.ts +19 -95
  100. package/dist/es/packages/searchbar/searchbar.js +32 -34
  101. package/dist/es/packages/searchbar/style/searchbar.scss +10 -7
  102. package/dist/es/packages/searchbar/style/style.css +11 -8
  103. package/dist/es/packages/searchbar/style/style.harmony.css +25 -12
  104. package/dist/es/packages/skeleton/style/style.css +5 -43
  105. package/dist/es/packages/tabbar/style/style.css +17 -15
  106. package/dist/es/packages/tabbaritem/style/style.css +17 -15
  107. package/dist/es/packages/tag/tag.d.ts +1 -1
  108. package/dist/es/packages/tag/tag.js +6 -14
  109. package/dist/es/packages/toast/style/style.css +56 -30
  110. package/dist/es/packages/toast/style/style.harmony.css +51 -62
  111. package/dist/es/packages/toast/style/toast.scss +65 -49
  112. package/dist/es/packages/toast/toast.d.ts +15 -71
  113. package/dist/es/packages/toast/toast.js +25 -20
  114. package/dist/es/packages/trendarrow/style/style.css +2 -1
  115. package/dist/es/packages/trendarrow/style/style.harmony.css +3 -2
  116. package/dist/es/packages/trendarrow/style/trendarrow.scss +2 -1
  117. package/dist/es/packages/trendarrow/trendarrow.d.ts +11 -55
  118. package/dist/es/packages/trendarrow/trendarrow.js +6 -4
  119. package/dist/es/packages/video/video.d.ts +5 -25
  120. package/dist/es/packages/video/video.js +3 -3
  121. package/dist/nutui.react.umd.js +533 -437
  122. package/dist/style.css +1 -1
  123. package/dist/styles/themes/default.scss +28 -28
  124. package/dist/styles/variables-jrkf.scss +21 -27
  125. package/dist/styles/variables.scss +7 -4
  126. package/package.json +2 -2
@@ -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 {
@@ -6,42 +6,40 @@
6
6
  -webkit-transform: rotate(360deg);
7
7
  }
8
8
  }
9
-
10
- .nut-toast-overlay-default {
11
- background: rgba(0, 0, 0, 0);
12
- z-index: 1300;
13
- }
14
-
15
9
  .nut-toast {
16
- display: flex;
17
- flex-direction: column;
10
+ /* #ifdef rn */
11
+ position: absolute;
12
+ /* #endif */
13
+ /* #ifndef rn */
18
14
  position: fixed;
19
- top: 0;
15
+ /* #endif */
20
16
  left: 0;
21
- height: 100%;
22
- width: 100%;
23
- align-items: center;
17
+ top: 0;
18
+ display: flex;
19
+ flex-direction: row;
24
20
  justify-content: center;
21
+ align-items: center;
22
+ width: 100%;
23
+ height: 100%;
24
+ pointer-events: none;
25
25
  z-index: 1300;
26
26
  }
27
-
28
-
29
- .nut-toast-small .nut-toast-inner {
30
- font-size: 12px;
31
- }
32
-
33
- .nut-toast-large .nut-toast-inner {
34
- font-size: 16px;
27
+ .nut-toast-overlay-default-taro {
28
+ /* #ifdef harmony */
29
+ background-color: rgba(0, 0, 0, 0);
30
+ z-index: 1300;
31
+ /* #endif */
32
+ /* #ifndef harmony */
33
+ /* #endif */
35
34
  }
36
-
37
35
  .nut-toast-inner {
36
+ position: absolute;
37
+ top: 50%;
38
+ transform: translate(0, -50%);
38
39
  display: flex;
39
40
  flex-direction: column;
40
41
  justify-content: center;
41
42
  align-items: center;
42
- position: absolute;
43
- left: 50%;
44
- top: 50%;
45
43
  min-width: 30%;
46
44
  max-width: 95.7%;
47
45
  font-size: 14px;
@@ -51,79 +49,72 @@
51
49
  background: rgba(0, 0, 0, 0.7);
52
50
  border-radius: 16px;
53
51
  color: #ffffff;
54
- transform: translate(-50%, -50%);
55
52
  }
56
-
57
- .nut-toast-inner.normal {
53
+ .nut-toast-inner-normal {
58
54
  word-break: normal;
59
55
  word-wrap: normal;
60
56
  }
61
-
62
- .nut-toast-inner.break-word {
57
+ .nut-toast-inner-break-word {
63
58
  word-break: normal;
64
59
  word-wrap: break-word;
65
60
  }
66
-
61
+ .nut-toast-inner-small {
62
+ font-size: 12px;
63
+ }
64
+ .nut-toast-inner-large {
65
+ font-size: 16px;
66
+ }
67
67
  .nut-toast-center {
68
- top: 50%;
68
+ /* #ifdef rn */
69
+ top: 38%;
70
+ /* #endif */
71
+ /* #ifndef rn */
72
+ top: 48%;
73
+ /* #endif */
69
74
  }
70
-
71
75
  .nut-toast-bottom {
72
76
  top: 80%;
73
77
  }
74
-
75
78
  .nut-toast-top {
76
79
  top: 20%;
77
80
  }
78
-
79
81
  .nut-toast-text {
80
- display: flex;
81
82
  color: #ffffff;
82
83
  text-align: center;
83
84
  }
84
-
85
- .nut-toast-text:empty {
85
+ .nut-toast-text-empty {
86
86
  margin-bottom: -8px;
87
87
  }
88
-
89
88
  .nut-toast-title {
90
- display: flex;
91
89
  color: #ffffff;
92
90
  font-size: 16px;
93
91
  font-weight: 500;
92
+ text-align: center;
94
93
  }
95
-
96
- .nut-toast-title:empty {
97
- margin-bottom: -8px;
94
+ .nut-toast-icon {
95
+ width: 24px;
96
+ height: 24px;
97
+ color: #ffffff;
98
98
  }
99
-
100
- .nut-toast-has-icon .nut-toast-icon-wrapper {
99
+ .nut-toast-icon-wrapper {
101
100
  width: 100%;
102
101
  display: flex;
103
102
  align-items: center;
104
103
  justify-content: center;
105
104
  margin-bottom: 8px;
105
+ color: #ffffff;
106
106
  }
107
-
108
- .nut-toast-has-icon .nut-toast-icon-wrapper .nut-icon {
107
+ .nut-toast-icon-wrapper-icon {
109
108
  width: 24px;
110
109
  height: 24px;
111
110
  }
112
-
113
- .nut-toast-loading .nut-toast-inner {
114
- display: inline-flex;
115
- flex-direction: column;
116
- justify-content: center;
117
- align-items: center;
118
- }
119
-
120
- .nut-toast-loading .nut-toast-icon-wrapper {
121
- animation: rotation 2s linear infinite;
111
+ .nut-toast-rtl {
112
+ left: auto;
113
+ right: 0;
122
114
  }
123
-
124
- .nut-toast-loading .nut-toast-icon-wrapper .nut-icon {
125
- width: 24px;
126
- height: 24px;
115
+ .nut-toast-rtl-inner {
116
+ left: auto;
117
+ right: 50%;
127
118
  }
128
119
 
129
120
  [dir=rtl] .nut-toast,
@@ -131,12 +122,10 @@
131
122
  left: auto;
132
123
  right: 0;
133
124
  }
134
-
135
125
  [dir=rtl] .nut-toast-inner,
136
126
  .nut-rtl .nut-toast-inner {
137
127
  left: auto;
138
128
  right: 50%;
139
- transform: translate(50%, -50%);
140
129
  }
141
130
 
142
131
  .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,19 +5,19 @@ export type ToastSize = 'small' | 'base' | 'large';
5
5
  export type ToastWordBreak = 'normal' | 'break-all' | 'break-word';
6
6
  export interface ToastProps extends BasicComponent {
7
7
  id?: string;
8
- maskClassName?: string;
9
- contentClassName?: string;
10
- contentStyle?: React.CSSProperties;
11
- icon: React.ReactNode;
12
- iconSize: string;
13
- content: React.ReactNode;
14
8
  duration: number;
15
9
  position?: ToastPosition;
16
- type: string;
17
10
  title: string;
18
11
  closeOnOverlayClick: boolean;
19
12
  lockScroll: boolean;
20
13
  size: ToastSize;
14
+ icon: React.ReactNode;
15
+ iconSize: string;
16
+ maskClassName?: string;
17
+ content: React.ReactNode;
18
+ contentClassName?: string;
19
+ contentStyle?: React.CSSProperties;
20
+ type: string;
21
21
  visible: boolean;
22
22
  wordBreak?: ToastWordBreak;
23
23
  onClose: () => void;
@@ -21,7 +21,6 @@ _export(exports, {
21
21
  });
22
22
  var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
23
23
  var _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
24
- var _define_property = require("@swc/helpers/_/_define_property");
25
24
  var _object_spread = require("@swc/helpers/_/_object_spread");
26
25
  var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
27
26
  var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
@@ -33,21 +32,23 @@ var _index = /*#__PURE__*/ _interop_require_default._(require("../overlay/index"
33
32
  var _typings = require("../../utils/typings");
34
33
  var _usecustomevent = require("../../utils/use-custom-event");
35
34
  var _usepropsvalue = require("../../utils/use-props-value");
35
+ var _index1 = require("../configprovider/index");
36
+ var _platformtaro = require("../../utils/platform-taro");
36
37
  var _mergeprops = require("../../utils/merge-props");
37
38
  var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
38
39
  id: '',
40
+ duration: 2,
41
+ position: 'center',
42
+ title: '',
43
+ size: 'base',
39
44
  icon: null,
40
45
  iconSize: '20',
41
46
  content: '',
42
47
  msg: '',
43
- duration: 2,
44
- position: 'center',
45
48
  type: 'text',
46
- title: '',
47
49
  closeOnOverlayClick: false,
48
50
  lockScroll: false,
49
51
  contentClassName: '',
50
- size: 'base',
51
52
  visible: false,
52
53
  wordBreak: 'break-all',
53
54
  onClose: function onClose() {}
@@ -56,6 +57,7 @@ var classPrefix = 'nut-toast';
56
57
  var Toast = function Toast(props) {
57
58
  var _useParams = (0, _usecustomevent.useParams)((0, _mergeprops.mergeProps)(defaultProps, props)), _useParams_params = _useParams.params, id = _useParams_params.id, position = _useParams_params.position, contentStyle = _useParams_params.contentStyle, icon = _useParams_params.icon, iconSize = _useParams_params.iconSize, content = _useParams_params.content, msg = _useParams_params.msg, duration = _useParams_params.duration, type = _useParams_params.type, title = _useParams_params.title, closeOnOverlayClick = _useParams_params.closeOnOverlayClick, lockScroll = _useParams_params.lockScroll, contentClassName = _useParams_params.contentClassName, visible = _useParams_params.visible, size = _useParams_params.size, className = _useParams_params.className, style = _useParams_params.style, onClose = _useParams_params.onClose, wordBreak = _useParams_params.wordBreak, setParams = _useParams.setParams;
58
59
  var timer = (0, _react.useRef)(-1);
60
+ var rtl = (0, _index1.useRtl)();
59
61
  var _usePropsValue = (0, _sliced_to_array._)((0, _usepropsvalue.usePropsValue)({
60
62
  value: visible,
61
63
  defaultValue: undefined,
@@ -115,10 +117,7 @@ var Toast = function Toast(props) {
115
117
  }
116
118
  };
117
119
  var hasIcon = function hasIcon() {
118
- if (type !== 'text') {
119
- return true;
120
- }
121
- return !!icon;
120
+ return type !== 'text' || !!icon;
122
121
  };
123
122
  var iconName = function iconName() {
124
123
  if (icon) {
@@ -126,6 +125,7 @@ var Toast = function Toast(props) {
126
125
  }
127
126
  return ({
128
127
  success: /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Success, {
128
+ className: "nut-toast-icon",
129
129
  color: "#ffffff",
130
130
  size: iconSize
131
131
  }),
@@ -143,13 +143,18 @@ var Toast = function Toast(props) {
143
143
  })
144
144
  })[type];
145
145
  };
146
- var classes = (0, _classnames.default)((0, _define_property._)({
147
- 'nut-toast-has-icon': icon
148
- }, "nut-toast-".concat(size), true));
146
+ var classes = (0, _classnames.default)({
147
+ 'nut-toast-has-icon': icon,
148
+ 'nut-toast-rtl': rtl
149
+ });
150
+ var styles = (0, _platformtaro.harmony)() ? {
151
+ left: '50%',
152
+ transform: 'translate(-50%, -50%)'
153
+ } : null;
149
154
  return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, innerVisible ? /*#__PURE__*/ _react.default.createElement(_index.default, {
150
155
  visible: innerVisible,
151
156
  style: style,
152
- className: "".concat(classPrefix, "-overlay-default ").concat(className),
157
+ className: "".concat(classPrefix, "-overlay-default-taro ").concat(className),
153
158
  closeOnOverlayClick: closeOnOverlayClick,
154
159
  lockScroll: lockScroll,
155
160
  onClick: function onClick() {
@@ -159,14 +164,14 @@ var Toast = function Toast(props) {
159
164
  className: "".concat(classPrefix, " ").concat(classes),
160
165
  id: id
161
166
  }, /*#__PURE__*/ _react.default.createElement(_components.View, {
162
- className: "".concat(classPrefix, "-inner ").concat(classPrefix, "-").concat(position, " ").concat(contentClassName, " ").concat(wordBreak),
163
- style: contentStyle
164
- }, hasIcon() ? /*#__PURE__*/ _react.default.createElement("p", {
167
+ className: "".concat(classPrefix, "-inner ").concat(classPrefix, "-").concat(position, " ").concat(contentClassName, " ").concat(classPrefix, "-inner-").concat(size, " ").concat(classPrefix, "-inner-").concat(wordBreak),
168
+ style: (0, _object_spread._)({}, styles, contentStyle)
169
+ }, hasIcon() ? /*#__PURE__*/ _react.default.createElement(_components.View, {
165
170
  className: "".concat(classPrefix, "-icon-wrapper")
166
- }, iconName()) : null, title ? /*#__PURE__*/ _react.default.createElement(_components.View, {
171
+ }, iconName()) : null, title ? /*#__PURE__*/ _react.default.createElement(_components.Text, {
167
172
  className: "".concat(classPrefix, "-title")
168
- }, title) : null, /*#__PURE__*/ _react.default.createElement("span", {
169
- className: "".concat(classPrefix, "-text")
173
+ }, title) : null, /*#__PURE__*/ _react.default.createElement(_components.Text, {
174
+ className: "".concat(classPrefix, "-text ").concat(content ? '' : "".concat(classPrefix, "-text-empty"))
170
175
  }, content || msg)))) : null);
171
176
  };
172
177
  function show(selector, options) {
@@ -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,7 +1,8 @@
1
1
  .nut-trendarrow {
2
- display: inline-flex;
2
+ display: flex;
3
+ flex-direction: row;
3
4
  align-items: center;
4
- color: #1A1A1A;
5
+ color: #1a1a1a;
5
6
  font-size: 14px;
6
7
  }
7
8
  .nut-trendarrow-icon-before {
@@ -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;