@nutui/nutui-react 4.0.0-beta.6 → 4.0.0-beta.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 (100) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/packages/animate/style/style.css +27 -9
  3. package/dist/cjs/packages/animate/style-jmapp/style.css +27 -9
  4. package/dist/cjs/packages/animate/style-jrkf/style.css +27 -9
  5. package/dist/cjs/packages/audio/audio.js +8 -8
  6. package/dist/cjs/packages/badge/badge.js +9 -9
  7. package/dist/cjs/packages/button/style/style.css +20 -8
  8. package/dist/cjs/packages/button/style-jmapp/style.css +20 -8
  9. package/dist/cjs/packages/button/style-jrkf/style.css +20 -8
  10. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  11. package/dist/cjs/packages/indicator/indicator.js +6 -6
  12. package/dist/cjs/packages/infiniteloading/infiniteloading.js +9 -9
  13. package/dist/cjs/packages/navbar/style/style.css +3 -1
  14. package/dist/cjs/packages/navbar/style-jmapp/style.css +3 -1
  15. package/dist/cjs/packages/navbar/style-jrkf/style.css +3 -1
  16. package/dist/cjs/packages/noticebar/noticebar.js +115 -52
  17. package/dist/cjs/packages/noticebar/style/noticebar.scss +130 -10
  18. package/dist/cjs/packages/noticebar/style/style.css +138 -35
  19. package/dist/cjs/packages/noticebar/style-jmapp/noticebar.scss +130 -10
  20. package/dist/cjs/packages/noticebar/style-jmapp/style.css +113 -10
  21. package/dist/cjs/packages/noticebar/style-jrkf/noticebar.scss +130 -10
  22. package/dist/cjs/packages/noticebar/style-jrkf/style.css +113 -10
  23. package/dist/cjs/packages/notify/Notification.js +8 -8
  24. package/dist/cjs/packages/numberkeyboard/style/style.css +6 -6
  25. package/dist/cjs/packages/numberkeyboard/style-jmapp/style.css +6 -6
  26. package/dist/cjs/packages/numberkeyboard/style-jrkf/style.css +6 -6
  27. package/dist/cjs/packages/popover/popover.js +46 -37
  28. package/dist/cjs/packages/popover/style/popover.scss +79 -54
  29. package/dist/cjs/packages/popover/style/style.css +73 -61
  30. package/dist/cjs/packages/popover/style-jmapp/popover.scss +79 -54
  31. package/dist/cjs/packages/popover/style-jmapp/style.css +73 -61
  32. package/dist/cjs/packages/popover/style-jrkf/popover.scss +79 -54
  33. package/dist/cjs/packages/popover/style-jrkf/style.css +73 -61
  34. package/dist/cjs/packages/popup/style/style.css +12 -6
  35. package/dist/cjs/packages/popup/style-jmapp/style.css +12 -6
  36. package/dist/cjs/packages/popup/style-jrkf/style.css +12 -6
  37. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +35 -35
  38. package/dist/cjs/packages/skeleton/skeleton.js +15 -15
  39. package/dist/cjs/packages/swiper/swiper.js +11 -11
  40. package/dist/cjs/packages/toast/Notification.js +8 -8
  41. package/dist/cjs/packages/tour/tour.js +1 -1
  42. package/dist/cjs/types/spec/noticebar/base.d.ts +5 -1
  43. package/dist/cjs/types/spec/popover/base.d.ts +4 -0
  44. package/dist/cjs/utils/is-forward-ref-component.js +2 -2
  45. package/dist/cjs/utils/render.js +1 -1
  46. package/dist/es/packages/animate/style/style.css +27 -9
  47. package/dist/es/packages/animate/style-jmapp/style.css +27 -9
  48. package/dist/es/packages/animate/style-jrkf/style.css +27 -9
  49. package/dist/es/packages/audio/audio.js +8 -8
  50. package/dist/es/packages/badge/badge.js +9 -9
  51. package/dist/es/packages/button/style/style.css +20 -8
  52. package/dist/es/packages/button/style-jmapp/style.css +20 -8
  53. package/dist/es/packages/button/style-jrkf/style.css +20 -8
  54. package/dist/es/packages/configprovider/types.d.ts +1 -1
  55. package/dist/es/packages/indicator/indicator.js +6 -6
  56. package/dist/es/packages/infiniteloading/infiniteloading.js +9 -9
  57. package/dist/es/packages/navbar/style/style.css +3 -1
  58. package/dist/es/packages/navbar/style-jmapp/style.css +3 -1
  59. package/dist/es/packages/navbar/style-jrkf/style.css +3 -1
  60. package/dist/es/packages/noticebar/noticebar.js +117 -55
  61. package/dist/es/packages/noticebar/style/noticebar.scss +130 -10
  62. package/dist/es/packages/noticebar/style/style.css +138 -35
  63. package/dist/es/packages/noticebar/style-jmapp/noticebar.scss +130 -10
  64. package/dist/es/packages/noticebar/style-jmapp/style.css +113 -10
  65. package/dist/es/packages/noticebar/style-jrkf/noticebar.scss +130 -10
  66. package/dist/es/packages/noticebar/style-jrkf/style.css +113 -10
  67. package/dist/es/packages/notify/Notification.js +8 -8
  68. package/dist/es/packages/numberkeyboard/style/style.css +6 -6
  69. package/dist/es/packages/numberkeyboard/style-jmapp/style.css +6 -6
  70. package/dist/es/packages/numberkeyboard/style-jrkf/style.css +6 -6
  71. package/dist/es/packages/popover/popover.js +46 -37
  72. package/dist/es/packages/popover/style/popover.scss +79 -54
  73. package/dist/es/packages/popover/style/style.css +73 -61
  74. package/dist/es/packages/popover/style-jmapp/popover.scss +79 -54
  75. package/dist/es/packages/popover/style-jmapp/style.css +73 -61
  76. package/dist/es/packages/popover/style-jrkf/popover.scss +79 -54
  77. package/dist/es/packages/popover/style-jrkf/style.css +73 -61
  78. package/dist/es/packages/popup/style/style.css +12 -6
  79. package/dist/es/packages/popup/style-jmapp/style.css +12 -6
  80. package/dist/es/packages/popup/style-jrkf/style.css +12 -6
  81. package/dist/es/packages/pulltorefresh/pulltorefresh.js +35 -35
  82. package/dist/es/packages/skeleton/skeleton.js +15 -15
  83. package/dist/es/packages/swiper/swiper.js +11 -11
  84. package/dist/es/packages/toast/Notification.js +8 -8
  85. package/dist/es/packages/tour/tour.js +1 -1
  86. package/dist/es/types/spec/noticebar/base.d.ts +19 -3
  87. package/dist/es/types/spec/popover/base.d.ts +17 -1
  88. package/dist/es/utils/render.js +1 -1
  89. package/dist/nutui.react.umd.js +1614 -1254
  90. package/dist/style-jmapp.css +1 -1
  91. package/dist/style-jmapp.scss +31 -31
  92. package/dist/style-jrkf.css +1 -1
  93. package/dist/style-jrkf.scss +30 -30
  94. package/dist/style.css +1 -1
  95. package/dist/style.scss +31 -31
  96. package/dist/styles/variables-daojia.scss +55 -9
  97. package/dist/styles/variables-jmapp.scss +52 -6
  98. package/dist/styles/variables-jrkf.scss +52 -6
  99. package/dist/styles/variables.scss +123 -15
  100. package/package.json +1 -1
@@ -20,10 +20,17 @@
20
20
  .nut-noticebar-box-wrap {
21
21
  height: auto;
22
22
  }
23
+
24
+ .nut-noticebar-box-left-icon {
25
+ height: $noticebar-left-icon-wrap-width;
26
+ min-width: $noticebar-left-icon-wrap-width;
27
+ }
23
28
  }
24
29
 
25
30
  &-wrapable {
26
31
  .nut-noticebar-box-wrap {
32
+ flex: initial;
33
+
27
34
  .nut-noticebar-box-wrap-content {
28
35
  position: relative;
29
36
  white-space: normal;
@@ -51,26 +58,75 @@
51
58
 
52
59
  &-left-icon {
53
60
  display: flex;
61
+ align-items: center;
62
+ justify-content: center;
54
63
  height: $noticebar-left-icon-width;
55
64
  min-width: $noticebar-left-icon-width;
56
65
  margin-right: $noticebar-icon-gap;
57
66
  background-size: 100% 100%;
67
+
58
68
  .nut-icon {
59
- color: $noticebar-color;
69
+ color: $noticebar-icon-color;
60
70
  }
71
+
72
+ img {
73
+ border-radius: $noticebar-left-icon-border-radius;
74
+ }
75
+ }
76
+
77
+ &-content-wrapper {
78
+ flex: 1;
79
+ overflow: hidden;
80
+ min-width: 0;
81
+ }
82
+
83
+ &-content-main {
84
+ display: flex;
85
+ align-items: center;
86
+ }
87
+
88
+ &-description {
89
+ font-size: $noticebar-description-font-size;
90
+ color: $noticebar-description-color;
91
+ line-height: $noticebar-description-line-height;
92
+ white-space: nowrap;
93
+ overflow: hidden;
94
+ text-overflow: ellipsis;
95
+ }
96
+
97
+ &-tag {
98
+ display: flex;
99
+ align-items: center;
100
+ width: $noticebar-tag-size;
101
+ height: $noticebar-tag-size;
102
+ margin-left: $noticebar-tag-gap;
103
+ flex-shrink: 0;
104
+ }
105
+
106
+ &-action {
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ max-width: $noticebar-action-max-width;
111
+ margin-left: $noticebar-action-gap;
112
+ font-size: $noticebar-action-font-size;
113
+ color: $color-primary;
114
+ flex-shrink: 0;
115
+ white-space: nowrap;
61
116
  }
62
117
 
63
118
  &-right-icon {
64
119
  display: flex;
65
120
  align-items: center;
66
121
  justify-content: center;
67
- width: $noticebar-right-icon-width;
68
- margin-left: $noticebar-icon-gap;
122
+ width: $noticebar-close-size;
123
+ height: $noticebar-close-size;
124
+ margin-left: $noticebar-action-gap;
125
+ flex-shrink: 0;
126
+ cursor: pointer;
69
127
 
70
128
  .nut-icon {
71
- width: scale-px(12px);
72
- height: scale-px(12px);
73
- color: $noticebar-color;
129
+ color: $noticebar-close-color;
74
130
  }
75
131
  }
76
132
 
@@ -79,6 +135,49 @@
79
135
  height: $icon-size-12;
80
136
  }
81
137
 
138
+ &-close-countdown {
139
+ position: relative;
140
+ display: flex;
141
+ align-items: center;
142
+ justify-content: center;
143
+ width: $noticebar-close-size;
144
+ height: $noticebar-close-size;
145
+ background: conic-gradient(
146
+ $noticebar-close-ring-color 0% var(--progress),
147
+ $noticebar-close-ring-shadow-color var(--progress) 100%
148
+ );
149
+ border-radius: 50%;
150
+
151
+ &::before {
152
+ content: '';
153
+ position: absolute;
154
+ inset: scale-px(1px);
155
+ background: $noticebar-background;
156
+ border-radius: 50%;
157
+ }
158
+ }
159
+
160
+ &-close-icon {
161
+ position: relative;
162
+ width: $noticebar-close-icon-size;
163
+ height: $noticebar-close-icon-size;
164
+ color: $noticebar-close-color;
165
+ }
166
+
167
+ &-left-icon--product {
168
+ height: scale-px(32px);
169
+ min-width: scale-px(32px);
170
+
171
+ img {
172
+ background: $white;
173
+ border-radius: $noticebar-left-icon-border-radius;
174
+ }
175
+ }
176
+
177
+ &-right {
178
+ flex-shrink: 0;
179
+ }
180
+
82
181
  &-wrap {
83
182
  display: flex;
84
183
  flex: 1;
@@ -158,11 +257,12 @@
158
257
  flex-direction: column;
159
258
  }
160
259
 
260
+ .nut-noticebar-box-description {
261
+ white-space: normal;
262
+ }
263
+
161
264
  .nut-noticebar-box-right-icon {
162
265
  align-self: center;
163
- display: flex;
164
- justify-content: center;
165
- width: $noticebar-right-icon-width;
166
266
  margin-left: $noticebar-icon-gap;
167
267
  }
168
268
  }
@@ -196,7 +296,17 @@
196
296
 
197
297
  &-right-icon {
198
298
  margin-left: 0;
199
- margin-right: $noticebar-icon-gap;
299
+ margin-right: $noticebar-action-gap;
300
+ }
301
+
302
+ &-tag {
303
+ margin-left: 0;
304
+ margin-right: $noticebar-tag-gap;
305
+ }
306
+
307
+ &-action {
308
+ margin-left: 0;
309
+ margin-right: $noticebar-action-gap;
200
310
  }
201
311
 
202
312
  .play {
@@ -225,5 +335,15 @@
225
335
  margin-left: 0;
226
336
  margin-right: $noticebar-icon-gap;
227
337
  }
338
+
339
+ .nut-noticebar-box-tag {
340
+ margin-left: 0;
341
+ margin-right: $noticebar-tag-gap;
342
+ }
343
+
344
+ .nut-noticebar-box-action {
345
+ margin-left: 0;
346
+ margin-right: $noticebar-action-gap;
347
+ }
228
348
  }
229
349
  }
@@ -23,6 +23,13 @@
23
23
  .nut-noticebar .nut-noticebar-box-wrapable .nut-noticebar-box-wrap, .nut-noticebar .nut-noticebar-box-center .nut-noticebar-box-wrap {
24
24
  height: auto;
25
25
  }
26
+ .nut-noticebar .nut-noticebar-box-wrapable .nut-noticebar-box-left-icon, .nut-noticebar .nut-noticebar-box-center .nut-noticebar-box-left-icon {
27
+ height: var(--nutui-noticebar-left-icon-wrap-width, 32px);
28
+ min-width: var(--nutui-noticebar-left-icon-wrap-width, 32px);
29
+ }
30
+ .nut-noticebar .nut-noticebar-box-wrapable .nut-noticebar-box-wrap {
31
+ flex: initial;
32
+ }
26
33
  .nut-noticebar .nut-noticebar-box-wrapable .nut-noticebar-box-wrap .nut-noticebar-box-wrap-content {
27
34
  position: relative;
28
35
  white-space: normal;
@@ -44,30 +51,106 @@
44
51
  }
45
52
  .nut-noticebar .nut-noticebar-box-left-icon {
46
53
  display: flex;
54
+ align-items: center;
55
+ justify-content: center;
47
56
  height: var(--nutui-noticebar-left-icon-width, 16px);
48
57
  min-width: var(--nutui-noticebar-left-icon-width, 16px);
49
58
  margin-right: var(--nutui-noticebar-icon-gap, 4px);
50
59
  background-size: 100% 100%;
51
60
  }
52
61
  .nut-noticebar .nut-noticebar-box-left-icon .nut-icon {
53
- color: var(--nutui-noticebar-color, #d9500b);
62
+ color: var(--nutui-noticebar-icon-color, var(--nutui-color-primary, #ff6666));
63
+ }
64
+ .nut-noticebar .nut-noticebar-box-left-icon img {
65
+ border-radius: var(--nutui-noticebar-left-icon-border-radius, 4px);
66
+ }
67
+ .nut-noticebar .nut-noticebar-box-content-wrapper {
68
+ flex: 1;
69
+ overflow: hidden;
70
+ min-width: 0;
71
+ }
72
+ .nut-noticebar .nut-noticebar-box-content-main {
73
+ display: flex;
74
+ align-items: center;
75
+ }
76
+ .nut-noticebar .nut-noticebar-box-description {
77
+ font-size: var(--nutui-noticebar-description-font-size, 11px);
78
+ color: var(--nutui-noticebar-description-color, var(--nutui-color-text));
79
+ line-height: var(--nutui-noticebar-description-line-height, 16px);
80
+ white-space: nowrap;
81
+ overflow: hidden;
82
+ text-overflow: ellipsis;
83
+ }
84
+ .nut-noticebar .nut-noticebar-box-tag {
85
+ display: flex;
86
+ align-items: center;
87
+ width: var(--nutui-noticebar-tag-size, 12px);
88
+ height: var(--nutui-noticebar-tag-size, 12px);
89
+ margin-left: var(--nutui-noticebar-tag-gap, 4px);
90
+ flex-shrink: 0;
91
+ }
92
+ .nut-noticebar .nut-noticebar-box-action {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ max-width: var(--nutui-noticebar-action-max-width, 99px);
97
+ margin-left: var(--nutui-noticebar-action-gap, 12px);
98
+ font-size: var(--nutui-noticebar-action-font-size, var(--nutui-font-text-xs));
99
+ color: var(--nutui-color-primary, #ff6666);
100
+ flex-shrink: 0;
101
+ white-space: nowrap;
54
102
  }
55
103
  .nut-noticebar .nut-noticebar-box-right-icon {
56
104
  display: flex;
57
105
  align-items: center;
58
106
  justify-content: center;
59
- width: var(--nutui-noticebar-right-icon-width, 16px);
60
- margin-left: var(--nutui-noticebar-icon-gap, 4px);
107
+ width: var(--nutui-noticebar-close-size, 20px);
108
+ height: var(--nutui-noticebar-close-size, 20px);
109
+ margin-left: var(--nutui-noticebar-action-gap, 12px);
110
+ flex-shrink: 0;
111
+ cursor: pointer;
61
112
  }
62
113
  .nut-noticebar .nut-noticebar-box-right-icon .nut-icon {
63
- width: scale-px(12px);
64
- height: scale-px(12px);
65
- color: var(--nutui-noticebar-color, #d9500b);
114
+ color: var(--nutui-noticebar-close-color, var(--nutui-color-text-help));
66
115
  }
67
116
  .nut-noticebar .nut-noticebar-box-right-icon-default {
68
117
  width: var(--nutui-icon-size-12, 12px);
69
118
  height: var(--nutui-icon-size-12, 12px);
70
119
  }
120
+ .nut-noticebar .nut-noticebar-box-close-countdown {
121
+ position: relative;
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ width: var(--nutui-noticebar-close-size, 20px);
126
+ height: var(--nutui-noticebar-close-size, 20px);
127
+ background: conic-gradient(var(--nutui-noticebar-close-ring-color, var(--nutui-color-text-help)) 0% var(--progress), var(--nutui-noticebar-close-ring-shadow-color, var(--nutui-color-border)) var(--progress) 100%);
128
+ border-radius: 50%;
129
+ }
130
+ .nut-noticebar .nut-noticebar-box-close-countdown::before {
131
+ content: "";
132
+ position: absolute;
133
+ inset: scale-px(1px);
134
+ background: var(--nutui-noticebar-background, rgb(251, 248, 220));
135
+ border-radius: 50%;
136
+ }
137
+ .nut-noticebar .nut-noticebar-box-close-icon {
138
+ position: relative;
139
+ width: var(--nutui-noticebar-close-icon-size, 10px);
140
+ height: var(--nutui-noticebar-close-icon-size, 10px);
141
+ color: var(--nutui-noticebar-close-color, var(--nutui-color-text-help));
142
+ }
143
+ .nut-noticebar .nut-noticebar-box-left-icon--product {
144
+ height: scale-px(32px);
145
+ min-width: scale-px(32px);
146
+ }
147
+ .nut-noticebar .nut-noticebar-box-left-icon--product img {
148
+ background: #ffffff;
149
+ border-radius: var(--nutui-noticebar-left-icon-border-radius, 4px);
150
+ }
151
+ .nut-noticebar .nut-noticebar-box-right {
152
+ flex-shrink: 0;
153
+ }
71
154
  .nut-noticebar .nut-noticebar-box-wrap {
72
155
  display: flex;
73
156
  flex: 1;
@@ -136,11 +219,11 @@
136
219
  -webkit-box-direction: normal;
137
220
  flex-direction: column;
138
221
  }
222
+ .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-description {
223
+ white-space: normal;
224
+ }
139
225
  .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-right-icon {
140
226
  align-self: center;
141
- display: flex;
142
- justify-content: center;
143
- width: var(--nutui-noticebar-right-icon-width, 16px);
144
227
  margin-left: var(--nutui-noticebar-icon-gap, 4px);
145
228
  }
146
229
  @keyframes nut-notice-bar-play {
@@ -167,7 +250,17 @@
167
250
  [dir=rtl] .nut-noticebar .nut-noticebar-box-right-icon,
168
251
  .nut-rtl .nut-noticebar .nut-noticebar-box-right-icon {
169
252
  margin-left: 0;
170
- margin-right: var(--nutui-noticebar-icon-gap, 4px);
253
+ margin-right: var(--nutui-noticebar-action-gap, 12px);
254
+ }
255
+ [dir=rtl] .nut-noticebar .nut-noticebar-box-tag,
256
+ .nut-rtl .nut-noticebar .nut-noticebar-box-tag {
257
+ margin-left: 0;
258
+ margin-right: var(--nutui-noticebar-tag-gap, 4px);
259
+ }
260
+ [dir=rtl] .nut-noticebar .nut-noticebar-box-action,
261
+ .nut-rtl .nut-noticebar .nut-noticebar-box-action {
262
+ margin-left: 0;
263
+ margin-right: var(--nutui-noticebar-action-gap, 12px);
171
264
  }
172
265
  [dir=rtl] .nut-noticebar .nut-noticebar-box .play,
173
266
  .nut-rtl .nut-noticebar .nut-noticebar-box .play {
@@ -191,4 +284,14 @@
191
284
  .nut-rtl .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-right-icon {
192
285
  margin-left: 0;
193
286
  margin-right: var(--nutui-noticebar-icon-gap, 4px);
287
+ }
288
+ [dir=rtl] .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-tag,
289
+ .nut-rtl .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-tag {
290
+ margin-left: 0;
291
+ margin-right: var(--nutui-noticebar-tag-gap, 4px);
292
+ }
293
+ [dir=rtl] .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-action,
294
+ .nut-rtl .nut-noticebar .nut-noticebar-vertical .nut-noticebar-box-action {
295
+ margin-left: 0;
296
+ margin-right: var(--nutui-noticebar-action-gap, 12px);
194
297
  }
@@ -130,7 +130,13 @@ var Notification = /*#__PURE__*/ function(_superClass) {
130
130
  _define_property(Notification, "newInstance", void 0);
131
131
  export { Notification as default };
132
132
  Notification.newInstance = function(properties, callback) {
133
- var ref = function ref(instance) {
133
+ var element = document.createElement('div');
134
+ var id = properties.id ? properties.id : "".concat(Date.now());
135
+ element.id = id;
136
+ properties.id = id;
137
+ document.body.appendChild(element);
138
+ var called = false;
139
+ function ref(instance) {
134
140
  if (called) {
135
141
  return;
136
142
  }
@@ -144,13 +150,7 @@ Notification.newInstance = function(properties, callback) {
144
150
  }, 300);
145
151
  }
146
152
  });
147
- };
148
- var element = document.createElement('div');
149
- var id = properties.id ? properties.id : "".concat(Date.now());
150
- element.id = id;
151
- properties.id = id;
152
- document.body.appendChild(element);
153
- var called = false;
153
+ }
154
154
  reactRender(/*#__PURE__*/ React.createElement(Notification, _object_spread_props(_object_spread({}, properties), {
155
155
  ref: ref
156
156
  })), element);
@@ -8,12 +8,6 @@ page {
8
8
  --nut-icon-line-height: calc(16px * var(--nut-scale-icon, var(--nut-scale-f, 1))) !important;
9
9
  }
10
10
 
11
- .nut-numberkeyboard {
12
- width: 100%;
13
- padding: var(--nutui-numberkeyboard-padding, 0 0 calc(22px * var(--nut-scale-f, 1)) 0);
14
- user-select: none;
15
- background-color: var(--nutui-numberkeyboard-background-color, var(--nutui-color-background, #f2f3f5));
16
- }
17
11
  .nut-numberkeyboard-close-icon {
18
12
  width: var(--nutui-icon-size-18, calc(18px * var(--nut-scale-icon, var(--nut-scale-f, 1))));
19
13
  height: var(--nutui-icon-size-18, calc(18px * var(--nut-scale-icon, var(--nut-scale-f, 1))));
@@ -22,6 +16,12 @@ page {
22
16
  width: calc(28px * var(--nut-scale-f, 1));
23
17
  height: calc(28px * var(--nut-scale-f, 1));
24
18
  }
19
+ .nut-numberkeyboard {
20
+ width: 100%;
21
+ padding: var(--nutui-numberkeyboard-padding, 0 0 calc(22px * var(--nut-scale-f, 1)) 0);
22
+ user-select: none;
23
+ background-color: var(--nutui-numberkeyboard-background-color, var(--nutui-color-background, #f2f3f5));
24
+ }
25
25
  .nut-numberkeyboard-header {
26
26
  position: relative;
27
27
  display: flex;
@@ -2,12 +2,6 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
- .nut-numberkeyboard {
6
- width: 100%;
7
- padding: var(--nutui-numberkeyboard-padding, 0 0 22px 0);
8
- user-select: none;
9
- background-color: var(--nutui-numberkeyboard-background-color, var(--nutui-color-surface-1));
10
- }
11
5
  .nut-numberkeyboard-close-icon {
12
6
  width: var(--nutui-icon-size-18, 18px);
13
7
  height: var(--nutui-icon-size-18, 18px);
@@ -16,6 +10,12 @@
16
10
  width: scale-px(28px);
17
11
  height: scale-px(28px);
18
12
  }
13
+ .nut-numberkeyboard {
14
+ width: 100%;
15
+ padding: var(--nutui-numberkeyboard-padding, 0 0 22px 0);
16
+ user-select: none;
17
+ background-color: var(--nutui-numberkeyboard-background-color, var(--nutui-color-surface-1));
18
+ }
19
19
  .nut-numberkeyboard-header {
20
20
  position: relative;
21
21
  display: flex;
@@ -2,12 +2,6 @@
2
2
  /* #endif */
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
- .nut-numberkeyboard {
6
- width: 100%;
7
- padding: var(--nutui-numberkeyboard-padding, 0 0 22px 0);
8
- user-select: none;
9
- background-color: var(--nutui-numberkeyboard-background-color, var(--nutui-color-surface-1));
10
- }
11
5
  .nut-numberkeyboard-close-icon {
12
6
  width: var(--nutui-icon-size-18, 18px);
13
7
  height: var(--nutui-icon-size-18, 18px);
@@ -16,6 +10,12 @@
16
10
  width: scale-px(28px);
17
11
  height: scale-px(28px);
18
12
  }
13
+ .nut-numberkeyboard {
14
+ width: 100%;
15
+ padding: var(--nutui-numberkeyboard-padding, 0 0 22px 0);
16
+ user-select: none;
17
+ background-color: var(--nutui-numberkeyboard-background-color, var(--nutui-color-surface-1));
18
+ }
19
19
  .nut-numberkeyboard-header {
20
20
  position: relative;
21
21
  display: flex;
@@ -16,18 +16,21 @@ import { getAllScrollableParents } from "../../utils/get-scroll-parent";
16
16
  import { useRtl } from "../configprovider";
17
17
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
18
18
  list: [],
19
- theme: 'light',
19
+ type: 'status',
20
+ theme: 'dark',
20
21
  location: 'bottom',
21
22
  visible: false,
22
23
  offset: [
23
24
  0,
24
25
  8
25
26
  ],
26
- arrowOffset: 0,
27
+ arrowOffset: 20,
27
28
  targetId: '',
28
29
  showArrow: true,
29
30
  closeOnOutsideClick: true,
30
31
  closeOnActionClick: true,
32
+ autoShow: false,
33
+ duration: 0,
31
34
  overlay: false,
32
35
  onClick: function onClick() {},
33
36
  onOpen: function onOpen() {},
@@ -36,9 +39,10 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
36
39
  var classPrefix = "nut-popover";
37
40
  export var Popover = function Popover(props) {
38
41
  var rtl = useRtl();
39
- var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, list = _$_object_spread.list, theme = _$_object_spread.theme, location = _$_object_spread.location, visible = _$_object_spread.visible, offset = _$_object_spread.offset, arrowOffset = _$_object_spread.arrowOffset, targetId = _$_object_spread.targetId, overlay = _$_object_spread.overlay, closeOnOutsideClick = _$_object_spread.closeOnOutsideClick, closeOnActionClick = _$_object_spread.closeOnActionClick, className = _$_object_spread.className, showArrow = _$_object_spread.showArrow, style = _$_object_spread.style, onClick = _$_object_spread.onClick, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onSelect = _$_object_spread.onSelect, rest = _object_without_properties(_$_object_spread, [
42
+ var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, list = _$_object_spread.list, type = _$_object_spread.type, theme = _$_object_spread.theme, location = _$_object_spread.location, visible = _$_object_spread.visible, offset = _$_object_spread.offset, arrowOffset = _$_object_spread.arrowOffset, targetId = _$_object_spread.targetId, overlay = _$_object_spread.overlay, closeOnOutsideClick = _$_object_spread.closeOnOutsideClick, closeOnActionClick = _$_object_spread.closeOnActionClick, autoShow = _$_object_spread.autoShow, duration = _$_object_spread.duration, className = _$_object_spread.className, showArrow = _$_object_spread.showArrow, style = _$_object_spread.style, onClick = _$_object_spread.onClick, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onSelect = _$_object_spread.onSelect, rest = _object_without_properties(_$_object_spread, [
40
43
  "children",
41
44
  "list",
45
+ "type",
42
46
  "theme",
43
47
  "location",
44
48
  "visible",
@@ -48,6 +52,8 @@ export var Popover = function Popover(props) {
48
52
  "overlay",
49
53
  "closeOnOutsideClick",
50
54
  "closeOnActionClick",
55
+ "autoShow",
56
+ "duration",
51
57
  "className",
52
58
  "showArrow",
53
59
  "style",
@@ -71,6 +77,27 @@ export var Popover = function Popover(props) {
71
77
  visible,
72
78
  location
73
79
  ]);
80
+ useEffect(function() {
81
+ if (autoShow) {
82
+ onOpen === null || onOpen === void 0 ? void 0 : onOpen();
83
+ }
84
+ }, []);
85
+ useEffect(function() {
86
+ if (visible && duration > 0) {
87
+ var timer = setTimeout(function() {
88
+ onClick === null || onClick === void 0 ? void 0 : onClick();
89
+ onClose === null || onClose === void 0 ? void 0 : onClose();
90
+ }, duration);
91
+ return function() {
92
+ return clearTimeout(timer);
93
+ };
94
+ }
95
+ }, [
96
+ visible,
97
+ duration,
98
+ onClick,
99
+ onClose
100
+ ]);
74
101
  var update = useRef(function(e) {
75
102
  getWrapperPosition();
76
103
  });
@@ -125,7 +152,7 @@ export var Popover = function Popover(props) {
125
152
  right: rtl ? left : right
126
153
  });
127
154
  };
128
- var classes = classNames(classPrefix, _define_property({}, "".concat(classPrefix, "-").concat(theme), theme === 'dark'), className);
155
+ var classes = classNames(classPrefix, "".concat(classPrefix, "--").concat(type), _define_property({}, "".concat(classPrefix, "-light"), theme === 'light'), className);
129
156
  var popoverArrow = function popoverArrow() {
130
157
  var prefixCls = 'nut-popover-arrow';
131
158
  var direction = location.split('-')[0];
@@ -152,6 +179,7 @@ export var Popover = function Popover(props) {
152
179
  }
153
180
  if (width) {
154
181
  var dir = rtl ? 'right' : 'left';
182
+ var edgeOffset = arrowOffset;
155
183
  if ([
156
184
  'bottom',
157
185
  'top'
@@ -162,10 +190,10 @@ export var Popover = function Popover(props) {
162
190
  styles[dir] = "".concat(-(popWidth - width) / 2 + wrapperPosition[dir] + parallel, "px");
163
191
  }
164
192
  if (skew === 'left') {
165
- styles.left = "".concat(left + parallel, "px");
193
+ styles.left = "".concat(left + width / 2 - edgeOffset + parallel, "px");
166
194
  }
167
195
  if (skew === 'right') {
168
- styles.left = "".concat(right + parallel, "px");
196
+ styles.left = "".concat(left + width / 2 + edgeOffset + parallel, "px");
169
197
  }
170
198
  }
171
199
  if ([
@@ -175,7 +203,7 @@ export var Popover = function Popover(props) {
175
203
  var contentW = direction === 'left' ? -(popWidth + cross) : width + cross;
176
204
  styles.left = "".concat(left + contentW, "px");
177
205
  if (!skew) {
178
- styles.top = "".concat(top - popHeight / 2 + height / 2 - 4 + parallel, "px");
206
+ styles.top = "".concat(top - popHeight / 2 + height / 2 + parallel, "px");
179
207
  }
180
208
  if (skew === 'top') {
181
209
  styles.top = "".concat(top + parallel, "px");
@@ -192,37 +220,18 @@ export var Popover = function Popover(props) {
192
220
  var styles = {};
193
221
  var direction = location.split('-')[0];
194
222
  var skew = location.split('-')[1];
195
- var base = 16;
196
- if (arrowOffset !== 0) {
197
- var dir = rtl ? 'right' : 'left';
198
- var dir2 = rtl ? 'left' : 'right';
199
- if ([
200
- 'bottom',
201
- 'top'
202
- ].includes(direction)) {
203
- if (!skew) {
204
- styles[dir] = "calc(50% + ".concat(arrowOffset, "px)");
205
- }
206
- if (skew === 'left') {
207
- styles[dir] = "".concat(base + arrowOffset, "px");
208
- }
209
- if (skew === 'right') {
210
- styles[dir2] = "".concat(base - arrowOffset, "px");
211
- }
223
+ var dir = rtl ? 'right' : 'left';
224
+ var dir2 = rtl ? 'left' : 'right';
225
+ var edgeOffset = arrowOffset;
226
+ if ([
227
+ 'bottom',
228
+ 'top'
229
+ ].includes(direction)) {
230
+ if (skew === 'left') {
231
+ styles[dir] = "".concat(edgeOffset, "px");
212
232
  }
213
- if ([
214
- 'left',
215
- 'right'
216
- ].includes(direction)) {
217
- if (!skew) {
218
- styles.top = "calc(50% - ".concat(arrowOffset, "px)");
219
- }
220
- if (skew === 'top') {
221
- styles.top = "".concat(base - arrowOffset, "px");
222
- }
223
- if (skew === 'bottom') {
224
- styles.bottom = "".concat(base + arrowOffset, "px");
225
- }
233
+ if (skew === 'right') {
234
+ styles[dir2] = "".concat(edgeOffset, "px");
226
235
  }
227
236
  }
228
237
  return styles;