@nutui/nutui-react 3.0.5 → 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.
Files changed (182) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/dist/cjs/packages/actionsheet/style/style.css +4 -4
  3. package/dist/cjs/packages/address/style/style.css +4 -4
  4. package/dist/cjs/packages/audio/style/style.css +4 -16
  5. package/dist/cjs/packages/badge/badge.js +4 -3
  6. package/dist/cjs/packages/badge/style/badge.scss +4 -0
  7. package/dist/cjs/packages/badge/style/style.css +9 -6
  8. package/dist/cjs/packages/button/style/button.scss +4 -20
  9. package/dist/cjs/packages/button/style/style.css +4 -16
  10. package/dist/cjs/packages/calendar/style/style.css +4 -4
  11. package/dist/cjs/packages/cascader/style/style.css +4 -4
  12. package/dist/cjs/packages/collapse/style/style.css +22 -7
  13. package/dist/cjs/packages/collapseitem/collapseitem.js +46 -44
  14. package/dist/cjs/packages/collapseitem/style/collapseitem.scss +22 -5
  15. package/dist/cjs/packages/collapseitem/style/style.css +22 -7
  16. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  17. package/dist/cjs/packages/datepicker/style/style.css +7 -4
  18. package/dist/cjs/packages/datepickerview/style/style.css +3 -0
  19. package/dist/cjs/packages/dialog/confirm.d.ts +2 -3
  20. package/dist/cjs/packages/dialog/confirm.js +4 -18
  21. package/dist/cjs/packages/dialog/content.d.ts +11 -3
  22. package/dist/cjs/packages/dialog/dialog.d.ts +1 -1
  23. package/dist/cjs/packages/dialog/dialog.js +98 -69
  24. package/dist/cjs/packages/dialog/index.d.ts +1 -1
  25. package/dist/cjs/packages/dialog/style/style.css +4 -16
  26. package/dist/cjs/packages/empty/style/style.css +4 -16
  27. package/dist/cjs/packages/fixednav/style/style.css +9 -6
  28. package/dist/cjs/packages/imagepreview/style/style.css +4 -4
  29. package/dist/cjs/packages/indicator/indicator.js +1 -1
  30. package/dist/cjs/packages/lottie/index.d.ts +1 -1
  31. package/dist/cjs/packages/lottie/index.js +2 -2
  32. package/dist/cjs/packages/notify/Notification.d.ts +3 -9
  33. package/dist/cjs/packages/notify/Notification.js +27 -7
  34. package/dist/cjs/packages/notify/notify.d.ts +0 -4
  35. package/dist/cjs/packages/notify/notify.js +6 -34
  36. package/dist/cjs/packages/notify/style/notify.scss +39 -36
  37. package/dist/cjs/packages/notify/style/style.css +36 -31
  38. package/dist/cjs/packages/numberkeyboard/style/style.css +4 -4
  39. package/dist/cjs/packages/picker/style/style.css +7 -4
  40. package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -0
  41. package/dist/cjs/packages/pickerview/style/style.css +3 -0
  42. package/dist/cjs/packages/popover/popover.js +72 -65
  43. package/dist/cjs/packages/popover/style/popover.scss +48 -51
  44. package/dist/cjs/packages/popover/style/style.css +64 -70
  45. package/dist/cjs/packages/popup/style/popup.scss +4 -4
  46. package/dist/cjs/packages/popup/style/style.css +4 -4
  47. package/dist/cjs/packages/resultpage/style/style.css +4 -16
  48. package/dist/cjs/packages/shortpassword/style/style.css +4 -4
  49. package/dist/cjs/packages/skeleton/skeleton.js +64 -49
  50. package/dist/cjs/packages/skeleton/style/index.js +0 -1
  51. package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
  52. package/dist/cjs/packages/skeleton/style/style.css +32 -175
  53. package/dist/cjs/packages/switch/style/style.css +5 -0
  54. package/dist/cjs/packages/switch/style/switch.scss +5 -0
  55. package/dist/cjs/packages/switch/switch.js +22 -11
  56. package/dist/cjs/packages/tabbar/style/style.css +54 -45
  57. package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
  58. package/dist/cjs/packages/tabbar/tabbar.js +28 -10
  59. package/dist/cjs/packages/tabbaritem/style/style.css +30 -27
  60. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
  61. package/dist/cjs/packages/tabbaritem/tabbaritem.js +34 -13
  62. package/dist/cjs/packages/tabpane/tabpane.js +2 -2
  63. package/dist/cjs/packages/timeselect/style/style.css +4 -4
  64. package/dist/cjs/packages/tour/style/style.css +64 -70
  65. package/dist/cjs/types/spec/badge/base.d.ts +1 -0
  66. package/dist/cjs/types/spec/dialog/base.d.ts +50 -1
  67. package/dist/cjs/types/spec/dialog/base.js +7 -0
  68. package/dist/cjs/types/spec/dialog/h5.d.ts +4 -1
  69. package/dist/cjs/types/spec/dialog/taro.d.ts +8 -2
  70. package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
  71. package/dist/cjs/types/spec/notify/base.d.ts +7 -2
  72. package/dist/cjs/types/spec/popover/base.d.ts +7 -0
  73. package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
  74. package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
  75. package/dist/cjs/types/spec/switch/base.d.ts +3 -2
  76. package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
  77. package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
  78. package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
  79. package/dist/cjs/utils/get-rect-by-taro.js +10 -0
  80. package/dist/cjs/utils/lru.d.ts +8 -0
  81. package/dist/cjs/utils/lru.js +58 -0
  82. package/dist/es/packages/actionsheet/style/style.css +4 -4
  83. package/dist/es/packages/address/style/style.css +4 -4
  84. package/dist/es/packages/audio/style/style.css +4 -16
  85. package/dist/es/packages/badge/badge.js +4 -3
  86. package/dist/es/packages/badge/style/badge.scss +4 -0
  87. package/dist/es/packages/badge/style/style.css +9 -6
  88. package/dist/es/packages/button/style/button.scss +4 -20
  89. package/dist/es/packages/button/style/style.css +4 -16
  90. package/dist/es/packages/calendar/style/style.css +4 -4
  91. package/dist/es/packages/cascader/style/style.css +4 -4
  92. package/dist/es/packages/collapse/style/style.css +22 -7
  93. package/dist/es/packages/collapseitem/collapseitem.js +47 -45
  94. package/dist/es/packages/collapseitem/style/collapseitem.scss +22 -5
  95. package/dist/es/packages/collapseitem/style/style.css +22 -7
  96. package/dist/es/packages/configprovider/types.d.ts +1 -1
  97. package/dist/es/packages/datepicker/style/style.css +7 -4
  98. package/dist/es/packages/datepickerview/style/style.css +3 -0
  99. package/dist/es/packages/dialog/confirm.d.ts +2 -3
  100. package/dist/es/packages/dialog/confirm.js +1 -8
  101. package/dist/es/packages/dialog/content.d.ts +11 -3
  102. package/dist/es/packages/dialog/dialog.d.ts +1 -1
  103. package/dist/es/packages/dialog/dialog.js +98 -69
  104. package/dist/es/packages/dialog/index.d.ts +1 -1
  105. package/dist/es/packages/dialog/style/style.css +4 -16
  106. package/dist/es/packages/empty/style/style.css +4 -16
  107. package/dist/es/packages/fixednav/style/style.css +9 -6
  108. package/dist/es/packages/imagepreview/style/style.css +4 -4
  109. package/dist/es/packages/indicator/indicator.js +1 -1
  110. package/dist/es/packages/lottie/index.d.ts +1 -1
  111. package/dist/es/packages/lottie/index.js +1 -1
  112. package/dist/es/packages/notify/Notification.d.ts +3 -9
  113. package/dist/es/packages/notify/Notification.js +27 -7
  114. package/dist/es/packages/notify/notify.d.ts +0 -4
  115. package/dist/es/packages/notify/notify.js +6 -34
  116. package/dist/es/packages/notify/style/notify.scss +39 -36
  117. package/dist/es/packages/notify/style/style.css +36 -31
  118. package/dist/es/packages/numberkeyboard/style/style.css +4 -4
  119. package/dist/es/packages/picker/style/style.css +7 -4
  120. package/dist/es/packages/pickerview/style/pickerview.scss +3 -0
  121. package/dist/es/packages/pickerview/style/style.css +3 -0
  122. package/dist/es/packages/popover/popover.js +72 -65
  123. package/dist/es/packages/popover/style/popover.scss +48 -51
  124. package/dist/es/packages/popover/style/style.css +64 -70
  125. package/dist/es/packages/popup/style/popup.scss +4 -4
  126. package/dist/es/packages/popup/style/style.css +4 -4
  127. package/dist/es/packages/resultpage/style/style.css +4 -16
  128. package/dist/es/packages/shortpassword/style/style.css +4 -4
  129. package/dist/es/packages/skeleton/skeleton.js +63 -49
  130. package/dist/es/packages/skeleton/style/index.js +0 -1
  131. package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
  132. package/dist/es/packages/skeleton/style/style.css +32 -175
  133. package/dist/es/packages/switch/style/style.css +5 -0
  134. package/dist/es/packages/switch/style/switch.scss +5 -0
  135. package/dist/es/packages/switch/switch.js +21 -11
  136. package/dist/es/packages/tabbar/style/style.css +54 -45
  137. package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
  138. package/dist/es/packages/tabbar/tabbar.js +27 -10
  139. package/dist/es/packages/tabbaritem/style/style.css +30 -27
  140. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
  141. package/dist/es/packages/tabbaritem/tabbaritem.js +34 -13
  142. package/dist/es/packages/tabpane/tabpane.js +2 -2
  143. package/dist/es/packages/timeselect/style/style.css +4 -4
  144. package/dist/es/packages/tour/style/style.css +64 -70
  145. package/dist/es/types/spec/badge/base.d.ts +4 -0
  146. package/dist/es/types/spec/dialog/base.d.ts +83 -1
  147. package/dist/es/types/spec/dialog/base.js +1 -1
  148. package/dist/es/types/spec/dialog/h5.d.ts +4 -1
  149. package/dist/es/types/spec/dialog/taro.d.ts +8 -2
  150. package/dist/es/types/spec/indicator/base.d.ts +1 -1
  151. package/dist/es/types/spec/notify/base.d.ts +22 -5
  152. package/dist/es/types/spec/popover/base.d.ts +7 -0
  153. package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
  154. package/dist/es/types/spec/skeleton/base.d.ts +19 -14
  155. package/dist/es/types/spec/switch/base.d.ts +6 -2
  156. package/dist/es/types/spec/switch/h5.d.ts +1 -1
  157. package/dist/es/types/spec/switch/taro.d.ts +1 -4
  158. package/dist/es/types/spec/tabbar/base.d.ts +7 -4
  159. package/dist/es/utils/get-rect-by-taro.js +9 -0
  160. package/dist/es/utils/lru.d.ts +8 -0
  161. package/dist/es/utils/lru.js +49 -0
  162. package/dist/nutui.react.umd.js +557 -529
  163. package/dist/style.css +1 -1
  164. package/dist/style.scss +38 -38
  165. package/dist/styles/theme-jmapp.scss +1 -0
  166. package/dist/styles/themes/jmapp.css +1 -1
  167. package/dist/styles/variables-jmapp.scss +237 -50
  168. package/dist/styles/variables-jrkf.scss +25 -14
  169. package/dist/styles/variables.scss +38 -51
  170. package/package.json +1 -1
  171. package/dist/cjs/packages/dialog/dialogwrap.d.ts +0 -4
  172. package/dist/cjs/packages/dialog/dialogwrap.js +0 -79
  173. package/dist/cjs/packages/dialog/types.d.ts +0 -57
  174. package/dist/cjs/packages/dialog/types.js +0 -11
  175. package/dist/es/packages/dialog/dialogwrap.d.ts +0 -4
  176. package/dist/es/packages/dialog/dialogwrap.js +0 -60
  177. package/dist/es/packages/dialog/types.d.ts +0 -57
  178. package/dist/es/packages/dialog/types.js +0 -1
  179. /package/dist/cjs/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
  180. /package/dist/cjs/packages/lottie/{web.js → lottie.js} +0 -0
  181. /package/dist/es/packages/lottie/{web.d.ts → lottie.d.ts} +0 -0
  182. /package/dist/es/packages/lottie/{web.js → lottie.js} +0 -0
@@ -6,7 +6,7 @@
6
6
  /*入场动画过程*/
7
7
  .fade-enter-active {
8
8
  opacity: 1;
9
- transition: opacity 1s;
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 1s;
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 1s;
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
- &-popup-top,
57
- &-popup-bottom {
58
- position: fixed;
59
- left: 0;
60
- right: 0;
61
- overflow-y: auto;
62
- transition: transform 0.3s;
63
- z-index: 9999;
64
- }
65
-
66
- &-popup-top {
67
- top: 0;
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
- &-base {
75
- background: $notify-base-background-color;
68
+ &-ellipsis {
69
+ text-overflow: ellipsis;
76
70
  }
77
71
 
78
- &-primary {
79
- background: $notify-primary-background-color;
72
+ &-layout-left {
73
+ text-align: left;
80
74
  }
81
75
 
82
- &-success {
83
- background: $notify-success-background-color;
76
+ &-left-icon,
77
+ &-right-icon {
78
+ display: inline-flex;
84
79
  }
85
80
 
86
- &-danger {
87
- background: $notify-danger-background-color;
81
+ &-left-icon {
82
+ margin-right: 6px;
83
+ .nut-icon {
84
+ height: 16px;
85
+ width: 16px;
86
+ }
88
87
  }
89
88
 
90
- &-warning {
91
- background: $notify-warning-background-color;
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 1s;
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 1s;
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 1s;
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-popup-top, .nut-notify-popup-bottom {
62
- position: fixed;
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-popup-bottom {
73
- bottom: 0;
75
+ .nut-notify-layout-left {
76
+ text-align: left;
74
77
  }
75
- .nut-notify-base {
76
- background: var(--nutui-notify-base-background-color, var(--nutui-color-primary, #ff0f23));
78
+ .nut-notify-left-icon, .nut-notify-right-icon {
79
+ display: inline-flex;
77
80
  }
78
- .nut-notify-primary {
79
- background: var(--nutui-notify-primary-background-color, var(--nutui-color-info, #0073ff));
81
+ .nut-notify-left-icon {
82
+ margin-right: 6px;
80
83
  }
81
- .nut-notify-success {
82
- background: var(--nutui-notify-success-background-color, var(--nutui-color-success, #00d900));
84
+ .nut-notify-left-icon .nut-icon {
85
+ height: 16px;
86
+ width: 16px;
83
87
  }
84
- .nut-notify-danger {
85
- background: var(--nutui-notify-danger-background-color, var(--nutui-color-primary, #ff0f23));
88
+ .nut-notify-right-icon {
89
+ margin-left: 6px;
86
90
  }
87
- .nut-notify-warning {
88
- background: var(--nutui-notify-warning-background-color, var(--nutui-color-warning, #ffbf00));
91
+ .nut-notify-right-icon .nut-icon {
92
+ height: 12px;
93
+ width: 12px;
89
94
  }
@@ -60,7 +60,7 @@
60
60
 
61
61
  .nut-popup {
62
62
  position: fixed;
63
- min-height: 46%;
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-default-enter-active {
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-default-exit-active {
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-default-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 {
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: 46%;
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-default-enter-active {
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-default-exit-active {
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-default-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 {
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 {
@@ -429,6 +429,9 @@
429
429
  z-index: 1;
430
430
  transform-style: preserve-3d;
431
431
  }
432
+ .nut-pickerview-roller-placeholder {
433
+ height: var(--nutui-picker-item-height, 36px);
434
+ }
432
435
  .nut-pickerview-roller-item {
433
436
  position: absolute;
434
437
  top: 0;
@@ -49,6 +49,9 @@
49
49
  height: $picker-item-height;
50
50
  z-index: 1;
51
51
  transform-style: preserve-3d;
52
+ &-placeholder {
53
+ height: $picker-item-height;
54
+ }
52
55
  }
53
56
 
54
57
  &-roller-item {
@@ -48,6 +48,9 @@
48
48
  z-index: 1;
49
49
  transform-style: preserve-3d;
50
50
  }
51
+ .nut-pickerview-roller-placeholder {
52
+ height: var(--nutui-picker-item-height, 36px);
53
+ }
51
54
  .nut-pickerview-roller-item {
52
55
  position: absolute;
53
56
  top: 0;
@@ -71,12 +71,12 @@ var Popover = function Popover(props) {
71
71
  var popoverRef = (0, _react.useRef)(null);
72
72
  var popoverContentRef = (0, _react.useRef)(null);
73
73
  var _useState = (0, _sliced_to_array._)((0, _react.useState)(false), 2), showPopup = _useState[0], setShowPopup = _useState[1];
74
- var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(), 2), rootPosition = _useState1[0], setRootPosition = _useState1[1];
74
+ var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(), 2), wrapperPosition = _useState1[0], setWrapperPosition = _useState1[1];
75
75
  (0, _react.useEffect)(function() {
76
76
  setShowPopup(visible);
77
77
  if (visible) {
78
78
  setTimeout(function() {
79
- getContentWidth();
79
+ getWrapperPosition();
80
80
  }, 0);
81
81
  }
82
82
  }, [
@@ -84,25 +84,10 @@ var Popover = function Popover(props) {
84
84
  location
85
85
  ]);
86
86
  var update = (0, _react.useRef)(function(e) {
87
- getContentWidth();
87
+ getWrapperPosition();
88
88
  });
89
- (0, _react.useEffect)(function() {
90
- if (visible) {
91
- scrollableParents.forEach(function(parent) {
92
- parent.addEventListener('scroll', update.current, {
93
- passive: true
94
- });
95
- });
96
- } else {
97
- scrollableParents.forEach(function(parent) {
98
- return parent.removeEventListener('scroll', update.current);
99
- });
100
- }
101
- }, [
102
- visible
103
- ]);
104
- var element = null;
105
89
  var targetSet = [];
90
+ var element = null;
106
91
  if (_canusedom.canUseDom && targetId) {
107
92
  element = document.querySelector("#".concat(targetId));
108
93
  targetSet = [
@@ -115,39 +100,59 @@ var Popover = function Popover(props) {
115
100
  popoverContentRef.current
116
101
  ];
117
102
  }
118
- (0, _useclickaway.default)(function() {
119
- onClick === null || onClick === void 0 ? void 0 : onClick();
120
- onClose === null || onClose === void 0 ? void 0 : onClose();
121
- }, targetSet, 'touchstart', true, visible, closeOnOutsideClick);
122
103
  var scrollableParents = (0, _react.useMemo)(function() {
123
104
  return (0, _getscrollparent.getAllScrollableParents)(element || popoverRef.current);
124
105
  }, [
125
106
  element,
126
107
  popoverRef.current
127
108
  ]);
128
- var getContentWidth = function getContentWidth() {
109
+ (0, _react.useEffect)(function() {
110
+ if (visible) {
111
+ scrollableParents.forEach(function(parent) {
112
+ parent.addEventListener('scroll', update.current, {
113
+ passive: true
114
+ });
115
+ });
116
+ } else {
117
+ scrollableParents.forEach(function(parent) {
118
+ return parent.removeEventListener('scroll', update.current);
119
+ });
120
+ }
121
+ }, [
122
+ visible
123
+ ]);
124
+ (0, _useclickaway.default)(function() {
125
+ onClick === null || onClick === void 0 ? void 0 : onClick();
126
+ onClose === null || onClose === void 0 ? void 0 : onClose();
127
+ }, targetSet, 'touchstart', true, visible, closeOnOutsideClick);
128
+ var getWrapperPosition = function getWrapperPosition() {
129
129
  var rect = (0, _useclientrect.getRect)(targetId ? document.querySelector("#".concat(targetId)) : popoverRef.current);
130
- setRootPosition({
131
- width: rect.width,
132
- height: rect.height,
133
- left: rtl ? rect.right : rect.left,
134
- top: rect.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop),
135
- right: rtl ? rect.left : rect.right
130
+ var distance = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
131
+ var width = rect.width, height = rect.height, right = rect.right, left = rect.left, top = rect.top;
132
+ setWrapperPosition({
133
+ width: width,
134
+ height: height,
135
+ left: rtl ? right : left,
136
+ top: top + distance,
137
+ right: rtl ? left : right
136
138
  });
137
139
  };
138
- var _obj;
139
- var classes = (0, _classnames.default)((_obj = {}, (0, _define_property._)(_obj, "".concat(classPrefix), true), (0, _define_property._)(_obj, "".concat(classPrefix, "-").concat(theme), theme === 'dark'), _obj), className);
140
+ var classes = (0, _classnames.default)(classPrefix, (0, _define_property._)({}, "".concat(classPrefix, "-").concat(theme), theme === 'dark'), className);
140
141
  var popoverArrow = function popoverArrow() {
141
142
  var prefixCls = 'nut-popover-arrow';
142
- return "".concat(prefixCls, " ").concat(prefixCls, "-").concat(location.split('-')[0], " ").concat(prefixCls, "-").concat(location);
143
+ var direction = location.split('-')[0];
144
+ return "".concat(prefixCls, " ").concat(prefixCls, "-").concat(direction, " ").concat(prefixCls, "-").concat(location);
143
145
  };
144
- var getRootPosition = function getRootPosition() {
146
+ var getPopoverPosition = function getPopoverPosition() {
145
147
  var _popoverContentRef_current, _popoverContentRef_current1;
146
148
  var styles = {};
147
- if (!rootPosition) return {};
148
- var contentWidth = (_popoverContentRef_current = popoverContentRef.current) === null || _popoverContentRef_current === void 0 ? void 0 : _popoverContentRef_current.clientWidth;
149
- var contentHeight = (_popoverContentRef_current1 = popoverContentRef.current) === null || _popoverContentRef_current1 === void 0 ? void 0 : _popoverContentRef_current1.clientHeight;
150
- var width = rootPosition.width, height = rootPosition.height, left = rootPosition.left, top = rootPosition.top, right = rootPosition.right;
149
+ if (!wrapperPosition) {
150
+ styles.visibility = 'hidden';
151
+ return styles;
152
+ }
153
+ var popWidth = (_popoverContentRef_current = popoverContentRef.current) === null || _popoverContentRef_current === void 0 ? void 0 : _popoverContentRef_current.clientWidth;
154
+ var popHeight = (_popoverContentRef_current1 = popoverContentRef.current) === null || _popoverContentRef_current1 === void 0 ? void 0 : _popoverContentRef_current1.clientHeight;
155
+ var width = wrapperPosition.width, height = wrapperPosition.height, left = wrapperPosition.left, top = wrapperPosition.top, right = wrapperPosition.right;
151
156
  var direction = location.split('-')[0];
152
157
  var skew = location.split('-')[1];
153
158
  var cross = 0;
@@ -163,15 +168,15 @@ var Popover = function Popover(props) {
163
168
  'bottom',
164
169
  'top'
165
170
  ].includes(direction)) {
166
- var h = direction === 'bottom' ? height + cross : -(contentHeight + cross);
171
+ var h = direction === 'bottom' ? height + cross : -(popHeight + cross);
167
172
  styles.top = "".concat(top + h, "px");
168
173
  if (!skew) {
169
- styles[dir] = "".concat(-(contentWidth - width) / 2 + rootPosition[dir] + parallel, "px");
174
+ styles[dir] = "".concat(-(popWidth - width) / 2 + wrapperPosition[dir] + parallel, "px");
170
175
  }
171
- if (skew === 'start') {
176
+ if (skew === 'left') {
172
177
  styles.left = "".concat(left + parallel, "px");
173
178
  }
174
- if (skew === 'end') {
179
+ if (skew === 'right') {
175
180
  styles.left = "".concat(right + parallel, "px");
176
181
  }
177
182
  }
@@ -179,22 +184,23 @@ var Popover = function Popover(props) {
179
184
  'left',
180
185
  'right'
181
186
  ].includes(direction)) {
182
- var contentW = direction === 'left' ? -(contentWidth + cross) : width + cross;
187
+ var contentW = direction === 'left' ? -(popWidth + cross) : width + cross;
183
188
  styles.left = "".concat(left + contentW, "px");
184
189
  if (!skew) {
185
- styles.top = "".concat(top - contentHeight / 2 + height / 2 - 4 + parallel, "px");
190
+ styles.top = "".concat(top - popHeight / 2 + height / 2 - 4 + parallel, "px");
186
191
  }
187
- if (skew === 'start') {
192
+ if (skew === 'top') {
188
193
  styles.top = "".concat(top + parallel, "px");
189
194
  }
190
- if (skew === 'end') {
195
+ if (skew === 'bottom') {
191
196
  styles.top = "".concat(top + height + parallel, "px");
192
197
  }
193
198
  }
194
199
  }
200
+ styles.visibility = popWidth === 0 ? 'hidden' : 'initial';
195
201
  return styles;
196
202
  };
197
- var arrowStyle = function arrowStyle() {
203
+ var popoverArrowStyle = function popoverArrowStyle() {
198
204
  var styles = {};
199
205
  var direction = location.split('-')[0];
200
206
  var skew = location.split('-')[1];
@@ -209,10 +215,10 @@ var Popover = function Popover(props) {
209
215
  if (!skew) {
210
216
  styles[dir] = "calc(50% + ".concat(arrowOffset, "px)");
211
217
  }
212
- if (skew === 'start') {
218
+ if (skew === 'left') {
213
219
  styles[dir] = "".concat(base + arrowOffset, "px");
214
220
  }
215
- if (skew === 'end') {
221
+ if (skew === 'right') {
216
222
  styles[dir2] = "".concat(base - arrowOffset, "px");
217
223
  }
218
224
  }
@@ -223,10 +229,10 @@ var Popover = function Popover(props) {
223
229
  if (!skew) {
224
230
  styles.top = "calc(50% - ".concat(arrowOffset, "px)");
225
231
  }
226
- if (skew === 'start') {
232
+ if (skew === 'top') {
227
233
  styles.top = "".concat(base - arrowOffset, "px");
228
234
  }
229
- if (skew === 'end') {
235
+ if (skew === 'bottom') {
230
236
  styles.bottom = "".concat(base + arrowOffset, "px");
231
237
  }
232
238
  }
@@ -235,28 +241,28 @@ var Popover = function Popover(props) {
235
241
  };
236
242
  var handleSelect = function handleSelect(item, index) {
237
243
  if (!item.disabled) {
238
- onSelect && onSelect(item, index);
244
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(item, index);
239
245
  }
240
246
  if (closeOnActionClick) {
241
- onClick && onClick();
242
- onClose && onClose();
247
+ onClick === null || onClick === void 0 ? void 0 : onClick();
248
+ onClose === null || onClose === void 0 ? void 0 : onClose();
243
249
  }
244
250
  };
245
251
  return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !targetId && /*#__PURE__*/ _react.default.createElement("div", {
246
252
  className: "nut-popover-wrapper",
247
253
  ref: popoverRef,
248
254
  onClick: function onClick1() {
249
- onClick && onClick();
255
+ onClick === null || onClick === void 0 ? void 0 : onClick();
250
256
  if (!visible) {
251
- onOpen && onOpen();
257
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
252
258
  } else {
253
- onClose && onClose();
259
+ onClose === null || onClose === void 0 ? void 0 : onClose();
254
260
  }
255
261
  },
256
262
  style: style
257
263
  }, Array.isArray(children) ? children[0] : children), /*#__PURE__*/ (0, _reactdom.createPortal)(/*#__PURE__*/ _react.default.createElement("div", {
258
264
  className: classes,
259
- style: getRootPosition()
265
+ style: (0, _object_spread._)({}, getPopoverPosition(), style)
260
266
  }, /*#__PURE__*/ _react.default.createElement(_index.default, (0, _object_spread._)({
261
267
  className: "nut-popover-content nut-popover-content-".concat(location),
262
268
  visible: showPopup,
@@ -268,26 +274,27 @@ var Popover = function Popover(props) {
268
274
  ref: popoverContentRef
269
275
  }, showArrow && /*#__PURE__*/ _react.default.createElement("div", {
270
276
  className: popoverArrow(),
271
- style: arrowStyle()
277
+ style: popoverArrowStyle()
272
278
  }, /*#__PURE__*/ _react.default.createElement(_iconsreact.ArrowRadius, {
273
279
  width: 8,
274
280
  height: 4
275
281
  })), Array.isArray(children) ? children[1] : null, list.map(function(item, index) {
282
+ var _item_action;
276
283
  return /*#__PURE__*/ _react.default.createElement("div", {
277
284
  className: (0, _classnames.default)({
278
- 'nut-popover-menu-item': true,
279
- 'nut-popover-menu-disabled': item.disabled
285
+ 'nut-popover-item': true,
286
+ 'nut-popover-item-disabled': item.disabled
280
287
  }, item.className),
281
288
  key: item.key || index,
282
289
  onClick: function onClick() {
283
290
  return handleSelect(item, index);
284
291
  }
285
292
  }, item.icon && /*#__PURE__*/ _react.default.createElement("div", {
286
- className: "nut-popover-menu-item-icon"
293
+ className: "nut-popover-item-icon"
287
294
  }, item.icon), /*#__PURE__*/ _react.default.createElement("div", {
288
- className: "nut-popover-menu-item-name"
289
- }, item.name), item.action && item.action.icon && /*#__PURE__*/ _react.default.createElement("div", {
290
- className: "nut-popover-menu-item-action-icon",
295
+ className: "nut-popover-item-name"
296
+ }, item.name), ((_item_action = item.action) === null || _item_action === void 0 ? void 0 : _item_action.icon) && /*#__PURE__*/ _react.default.createElement("div", {
297
+ className: "nut-popover-item-action-icon",
291
298
  onClick: function onClick(e) {
292
299
  var _item_action_onClick, _item_action;
293
300
  return (_item_action = item.action) === null || _item_action === void 0 ? void 0 : (_item_action_onClick = _item_action.onClick) === null || _item_action_onClick === void 0 ? void 0 : _item_action_onClick.call(_item_action, e);