@nutui/nutui-react 3.0.11-patch.0 → 3.0.12

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 (98) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  3. package/dist/cjs/packages/progress/progress.js +38 -17
  4. package/dist/cjs/packages/progress/style/progress.scss +5 -21
  5. package/dist/cjs/packages/progress/style/style.css +5 -19
  6. package/dist/cjs/packages/progress/style-jmapp/progress.scss +5 -21
  7. package/dist/cjs/packages/progress/style-jmapp/style.css +4 -18
  8. package/dist/cjs/packages/progress/style-jrkf/progress.scss +5 -21
  9. package/dist/cjs/packages/progress/style-jrkf/style.css +4 -18
  10. package/dist/cjs/packages/range/range.js +5 -11
  11. package/dist/cjs/packages/range/style/range.scss +6 -2
  12. package/dist/cjs/packages/range/style/style.css +3 -1
  13. package/dist/cjs/packages/range/style-jmapp/range.scss +6 -2
  14. package/dist/cjs/packages/range/style-jmapp/style.css +3 -1
  15. package/dist/cjs/packages/range/style-jrkf/range.scss +6 -2
  16. package/dist/cjs/packages/range/style-jrkf/style.css +3 -1
  17. package/dist/cjs/packages/range/utils.d.ts +3 -0
  18. package/dist/cjs/packages/range/utils.js +24 -0
  19. package/dist/cjs/packages/searchbar/searchbar.js +162 -87
  20. package/dist/cjs/packages/searchbar/style/searchbar.scss +99 -25
  21. package/dist/cjs/packages/searchbar/style/style.css +102 -38
  22. package/dist/cjs/packages/searchbar/style-jmapp/searchbar.scss +99 -25
  23. package/dist/cjs/packages/searchbar/style-jmapp/style.css +85 -21
  24. package/dist/cjs/packages/searchbar/style-jrkf/searchbar.scss +99 -25
  25. package/dist/cjs/packages/searchbar/style-jrkf/style.css +85 -21
  26. package/dist/cjs/packages/step/step.js +74 -33
  27. package/dist/cjs/packages/step/style/step.scss +104 -195
  28. package/dist/cjs/packages/step/style/style.css +85 -159
  29. package/dist/cjs/packages/step/style-jmapp/step.scss +104 -195
  30. package/dist/cjs/packages/step/style-jmapp/style.css +88 -162
  31. package/dist/cjs/packages/step/style-jrkf/step.scss +104 -195
  32. package/dist/cjs/packages/step/style-jrkf/style.css +88 -162
  33. package/dist/cjs/packages/steps/steps.js +23 -8
  34. package/dist/cjs/packages/steps/style/steps.scss +328 -4
  35. package/dist/cjs/packages/steps/style/style.css +219 -2
  36. package/dist/cjs/packages/steps/style-jmapp/steps.scss +328 -4
  37. package/dist/cjs/packages/steps/style-jmapp/style.css +219 -2
  38. package/dist/cjs/packages/steps/style-jrkf/steps.scss +328 -4
  39. package/dist/cjs/packages/steps/style-jrkf/style.css +219 -2
  40. package/dist/cjs/packages/uploader/uploader.js +20 -9
  41. package/dist/cjs/types/spec/progress/base.d.ts +6 -0
  42. package/dist/cjs/types/spec/progress/taro.d.ts +4 -0
  43. package/dist/cjs/types/spec/searchbar/base.d.ts +3 -0
  44. package/dist/cjs/types/spec/steps/base.d.ts +11 -2
  45. package/dist/es/packages/configprovider/types.d.ts +1 -1
  46. package/dist/es/packages/progress/progress.js +38 -17
  47. package/dist/es/packages/progress/style/progress.scss +5 -21
  48. package/dist/es/packages/progress/style/style.css +5 -19
  49. package/dist/es/packages/progress/style-jmapp/progress.scss +5 -21
  50. package/dist/es/packages/progress/style-jmapp/style.css +4 -18
  51. package/dist/es/packages/progress/style-jrkf/progress.scss +5 -21
  52. package/dist/es/packages/progress/style-jrkf/style.css +4 -18
  53. package/dist/es/packages/range/range.js +5 -11
  54. package/dist/es/packages/range/style/range.scss +6 -2
  55. package/dist/es/packages/range/style/style.css +3 -1
  56. package/dist/es/packages/range/style-jmapp/range.scss +6 -2
  57. package/dist/es/packages/range/style-jmapp/style.css +3 -1
  58. package/dist/es/packages/range/style-jrkf/range.scss +6 -2
  59. package/dist/es/packages/range/style-jrkf/style.css +3 -1
  60. package/dist/es/packages/range/utils.d.ts +3 -0
  61. package/dist/es/packages/range/utils.js +6 -0
  62. package/dist/es/packages/searchbar/searchbar.js +163 -89
  63. package/dist/es/packages/searchbar/style/searchbar.scss +99 -25
  64. package/dist/es/packages/searchbar/style/style.css +102 -38
  65. package/dist/es/packages/searchbar/style-jmapp/searchbar.scss +99 -25
  66. package/dist/es/packages/searchbar/style-jmapp/style.css +85 -21
  67. package/dist/es/packages/searchbar/style-jrkf/searchbar.scss +99 -25
  68. package/dist/es/packages/searchbar/style-jrkf/style.css +85 -21
  69. package/dist/es/packages/step/step.js +75 -34
  70. package/dist/es/packages/step/style/step.scss +104 -195
  71. package/dist/es/packages/step/style/style.css +85 -159
  72. package/dist/es/packages/step/style-jmapp/step.scss +104 -195
  73. package/dist/es/packages/step/style-jmapp/style.css +88 -162
  74. package/dist/es/packages/step/style-jrkf/step.scss +104 -195
  75. package/dist/es/packages/step/style-jrkf/style.css +88 -162
  76. package/dist/es/packages/steps/steps.js +23 -8
  77. package/dist/es/packages/steps/style/steps.scss +328 -4
  78. package/dist/es/packages/steps/style/style.css +219 -2
  79. package/dist/es/packages/steps/style-jmapp/steps.scss +328 -4
  80. package/dist/es/packages/steps/style-jmapp/style.css +219 -2
  81. package/dist/es/packages/steps/style-jrkf/steps.scss +328 -4
  82. package/dist/es/packages/steps/style-jrkf/style.css +219 -2
  83. package/dist/es/packages/uploader/uploader.js +20 -9
  84. package/dist/es/types/spec/progress/base.d.ts +24 -0
  85. package/dist/es/types/spec/progress/taro.d.ts +4 -0
  86. package/dist/es/types/spec/searchbar/base.d.ts +10 -1
  87. package/dist/es/types/spec/steps/base.d.ts +26 -5
  88. package/dist/nutui.react.umd.js +317 -167
  89. package/dist/style-jmapp.css +1 -1
  90. package/dist/style-jmapp.scss +39 -39
  91. package/dist/style-jrkf.css +1 -1
  92. package/dist/style-jrkf.scss +42 -42
  93. package/dist/style.css +1 -1
  94. package/dist/style.scss +41 -41
  95. package/dist/styles/variables-jmapp.scss +133 -79
  96. package/dist/styles/variables-jrkf.scss +134 -80
  97. package/dist/styles/variables.scss +148 -89
  98. package/package.json +1 -1
@@ -9,7 +9,7 @@
9
9
  width: 100%;
10
10
  }
11
11
  .nut-progress-outer {
12
- flex: auto;
12
+ flex: 1;
13
13
  border-radius: var(--nutui-progress-border-radius, 12px);
14
14
  height: var(--nutui-progress-height, 10px);
15
15
  background: var(--nutui-progress-background, var(--nutui-color-background, #f2f3f5));
@@ -36,25 +36,11 @@
36
36
  .nut-progress-text {
37
37
  display: flex;
38
38
  align-items: center;
39
- position: absolute;
40
- top: var(--nutui-progress-text-position-top, -4px);
41
- bottom: var(--nutui-progress-text-position-bottom, -4px);
42
39
  transition: all 0.4s;
43
- transform: translate(-50%);
44
- }
45
- .nut-progress-text-inner {
46
- display: flex;
47
- flex-direction: row;
48
- justify-content: center;
49
- align-items: center;
50
- height: 100%;
51
- width: 100%;
52
- color: var(--nutui-progress-text-color, #ffffff);
53
- padding: var(--nutui-progress-text-padding, 0 5px);
54
- border-radius: var(--nutui-progress-text-border-radius, 5px);
55
- font-size: var(--nutui-progress-text-font-size, 9px);
56
- line-height: 1;
57
- background: var(--nutui-progress-text-background, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
40
+ margin-left: 12px;
41
+ color: var(--nutui-color-text-help, #888b94);
42
+ font-family: PingFang SC;
43
+ font-size: var(--nutui-progress-text-font-size, 13px);
58
44
  }
59
45
  @keyframes progressActive {
60
46
  0% {
@@ -5,11 +5,10 @@
5
5
  width: 100%;
6
6
 
7
7
  &-outer {
8
- flex: auto;
8
+ flex: 1;
9
9
  border-radius: $progress-border-radius;
10
10
  height: $progress-height;
11
11
  background: $progress-background;
12
-
13
12
  .nut-progress-active:before {
14
13
  content: '';
15
14
  position: absolute;
@@ -35,26 +34,11 @@
35
34
  &-text {
36
35
  display: flex;
37
36
  align-items: center;
38
- position: absolute;
39
- top: $progress-text-position-top;
40
- bottom: $progress-text-position-bottom;
41
37
  transition: all 0.4s;
42
- transform: translate(-50%);
43
-
44
- &-inner {
45
- display: flex;
46
- flex-direction: row;
47
- justify-content: center;
48
- align-items: center;
49
- height: 100%;
50
- width: 100%;
51
- color: $progress-text-color;
52
- padding: $progress-text-padding;
53
- border-radius: $progress-text-border-radius;
54
- font-size: $progress-text-font-size;
55
- line-height: 1;
56
- background: $progress-text-background;
57
- }
38
+ margin-left: 12px;
39
+ color: $color-text-help;
40
+ font-family: PingFang SC;
41
+ font-size: $progress-text-font-size;
58
42
  }
59
43
 
60
44
  @keyframes progressActive {
@@ -9,7 +9,7 @@
9
9
  width: 100%;
10
10
  }
11
11
  .nut-progress-outer {
12
- flex: auto;
12
+ flex: 1;
13
13
  border-radius: var(--nutui-progress-border-radius, 12px);
14
14
  height: var(--nutui-progress-height, 10px);
15
15
  background: var(--nutui-progress-background, var(--nutui-color-surface-1));
@@ -36,25 +36,11 @@
36
36
  .nut-progress-text {
37
37
  display: flex;
38
38
  align-items: center;
39
- position: absolute;
40
- top: var(--nutui-progress-text-position-top, -4px);
41
- bottom: var(--nutui-progress-text-position-bottom, -4px);
42
39
  transition: all 0.4s;
43
- transform: translate(-50%);
44
- }
45
- .nut-progress-text-inner {
46
- display: flex;
47
- flex-direction: row;
48
- justify-content: center;
49
- align-items: center;
50
- height: 100%;
51
- width: 100%;
52
- color: var(--nutui-progress-text-color, var(--nutui-color-text-dark));
53
- padding: var(--nutui-progress-text-padding, 0 5px);
54
- border-radius: var(--nutui-progress-text-border-radius, 5px);
40
+ margin-left: 12px;
41
+ color: var(--nutui-color-text-help);
42
+ font-family: PingFang SC;
55
43
  font-size: var(--nutui-progress-text-font-size, 9px);
56
- line-height: 1;
57
- background: var(--nutui-progress-text-background, #ff0f23);
58
44
  }
59
45
  @keyframes progressActive {
60
46
  0% {
@@ -5,11 +5,10 @@
5
5
  width: 100%;
6
6
 
7
7
  &-outer {
8
- flex: auto;
8
+ flex: 1;
9
9
  border-radius: $progress-border-radius;
10
10
  height: $progress-height;
11
11
  background: $progress-background;
12
-
13
12
  .nut-progress-active:before {
14
13
  content: '';
15
14
  position: absolute;
@@ -35,26 +34,11 @@
35
34
  &-text {
36
35
  display: flex;
37
36
  align-items: center;
38
- position: absolute;
39
- top: $progress-text-position-top;
40
- bottom: $progress-text-position-bottom;
41
37
  transition: all 0.4s;
42
- transform: translate(-50%);
43
-
44
- &-inner {
45
- display: flex;
46
- flex-direction: row;
47
- justify-content: center;
48
- align-items: center;
49
- height: 100%;
50
- width: 100%;
51
- color: $progress-text-color;
52
- padding: $progress-text-padding;
53
- border-radius: $progress-text-border-radius;
54
- font-size: $progress-text-font-size;
55
- line-height: 1;
56
- background: $progress-text-background;
57
- }
38
+ margin-left: 12px;
39
+ color: $color-text-help;
40
+ font-family: PingFang SC;
41
+ font-size: $progress-text-font-size;
58
42
  }
59
43
 
60
44
  @keyframes progressActive {
@@ -9,7 +9,7 @@
9
9
  width: 100%;
10
10
  }
11
11
  .nut-progress-outer {
12
- flex: auto;
12
+ flex: 1;
13
13
  border-radius: var(--nutui-progress-border-radius, 12px);
14
14
  height: var(--nutui-progress-height, 10px);
15
15
  background: var(--nutui-progress-background, var(--nutui-color-surface-1));
@@ -36,25 +36,11 @@
36
36
  .nut-progress-text {
37
37
  display: flex;
38
38
  align-items: center;
39
- position: absolute;
40
- top: var(--nutui-progress-text-position-top, -4px);
41
- bottom: var(--nutui-progress-text-position-bottom, -4px);
42
39
  transition: all 0.4s;
43
- transform: translate(-50%);
44
- }
45
- .nut-progress-text-inner {
46
- display: flex;
47
- flex-direction: row;
48
- justify-content: center;
49
- align-items: center;
50
- height: 100%;
51
- width: 100%;
52
- color: var(--nutui-progress-text-color, var(--nutui-color-text-dark));
53
- padding: var(--nutui-progress-text-padding, 0 5px);
54
- border-radius: var(--nutui-progress-text-border-radius, 5px);
40
+ margin-left: 12px;
41
+ color: var(--nutui-color-text-help);
42
+ font-family: PingFang SC;
55
43
  font-size: var(--nutui-progress-text-font-size, 9px);
56
- line-height: 1;
57
- background: var(--nutui-progress-text-background, var(--nutui-progress-color, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff9999) 0%, var(--nutui-color-primary-stop-2, #ff6666) 100%)));
58
44
  }
59
45
  @keyframes progressActive {
60
46
  0% {
@@ -221,10 +221,8 @@ export var Range = function(props) {
221
221
  onEnd,
222
222
  setCurrent
223
223
  ]);
224
- var click = useCallback(function(event) {
225
- if (disabled || !root.current) {
226
- return;
227
- }
224
+ var handleClick = useCallback(function(event) {
225
+ if (disabled || !root.current) return;
228
226
  setDragStatus('');
229
227
  var rect = getRect(root.current);
230
228
  var delta = event.clientX - rect.left;
@@ -262,9 +260,7 @@ export var Range = function(props) {
262
260
  vertical
263
261
  ]);
264
262
  var onTouchStart = useCallback(function(event) {
265
- if (disabled) {
266
- return;
267
- }
263
+ if (disabled) return;
268
264
  touch.start(event);
269
265
  setExactValue(current);
270
266
  if (isRange(current)) {
@@ -477,11 +473,9 @@ export var Range = function(props) {
477
473
  }, minDescription || min), /*#__PURE__*/ React.createElement("div", {
478
474
  ref: root,
479
475
  className: classes,
480
- onClick: function(e) {
481
- return click(e);
482
- }
476
+ onClick: handleClick
483
477
  }, renderMarks(), /*#__PURE__*/ React.createElement("div", {
484
- className: "".concat(classPrefix, "-bar"),
478
+ className: "".concat(classPrefix, "-bar ").concat(classPrefix, "-bar-animate"),
485
479
  style: barStyle()
486
480
  }, renderButtonWrapper())), maxDescription !== null && /*#__PURE__*/ React.createElement("div", {
487
481
  className: "".concat(classPrefix, "-max")
@@ -46,7 +46,10 @@
46
46
  max-height: 100%;
47
47
  background: $range-active-color;
48
48
  border-radius: 2px;
49
- transition: all 0.2s;
49
+
50
+ &-animate {
51
+ transition: all 0.2s;
52
+ }
50
53
  }
51
54
 
52
55
  &-button {
@@ -204,7 +207,8 @@
204
207
  position: absolute;
205
208
  width: 36px;
206
209
  height: 100%;
207
- top: initial;
210
+ // top: initial;
211
+ top: 0px;
208
212
  right: 50%;
209
213
  overflow: visible;
210
214
  font-size: 12px;
@@ -45,6 +45,8 @@
45
45
  max-height: 100%;
46
46
  background: var(--nutui-range-active-color, var(--nutui-color-primary, #ff0f23));
47
47
  border-radius: 2px;
48
+ }
49
+ .nut-range-bar-animate {
48
50
  transition: all 0.2s;
49
51
  }
50
52
  .nut-range-button {
@@ -173,7 +175,7 @@
173
175
  position: absolute;
174
176
  width: 36px;
175
177
  height: 100%;
176
- top: initial;
178
+ top: 0px;
177
179
  right: 50%;
178
180
  overflow: visible;
179
181
  font-size: 12px;
@@ -46,7 +46,10 @@
46
46
  max-height: 100%;
47
47
  background: $range-active-color;
48
48
  border-radius: 2px;
49
- transition: all 0.2s;
49
+
50
+ &-animate {
51
+ transition: all 0.2s;
52
+ }
50
53
  }
51
54
 
52
55
  &-button {
@@ -204,7 +207,8 @@
204
207
  position: absolute;
205
208
  width: 36px;
206
209
  height: 100%;
207
- top: initial;
210
+ // top: initial;
211
+ top: 0px;
208
212
  right: 50%;
209
213
  overflow: visible;
210
214
  font-size: 12px;
@@ -45,6 +45,8 @@
45
45
  max-height: 100%;
46
46
  background: var(--nutui-range-active-color, var(--nutui-color-primary));
47
47
  border-radius: 2px;
48
+ }
49
+ .nut-range-bar-animate {
48
50
  transition: all 0.2s;
49
51
  }
50
52
  .nut-range-button {
@@ -173,7 +175,7 @@
173
175
  position: absolute;
174
176
  width: 36px;
175
177
  height: 100%;
176
- top: initial;
178
+ top: 0px;
177
179
  right: 50%;
178
180
  overflow: visible;
179
181
  font-size: 12px;
@@ -46,7 +46,10 @@
46
46
  max-height: 100%;
47
47
  background: $range-active-color;
48
48
  border-radius: 2px;
49
- transition: all 0.2s;
49
+
50
+ &-animate {
51
+ transition: all 0.2s;
52
+ }
50
53
  }
51
54
 
52
55
  &-button {
@@ -204,7 +207,8 @@
204
207
  position: absolute;
205
208
  width: 36px;
206
209
  height: 100%;
207
- top: initial;
210
+ // top: initial;
211
+ top: 0px;
208
212
  right: 50%;
209
213
  overflow: visible;
210
214
  font-size: 12px;
@@ -45,6 +45,8 @@
45
45
  max-height: 100%;
46
46
  background: var(--nutui-range-active-color, var(--nutui-color-primary, #ff6666));
47
47
  border-radius: 2px;
48
+ }
49
+ .nut-range-bar-animate {
48
50
  transition: all 0.2s;
49
51
  }
50
52
  .nut-range-button {
@@ -173,7 +175,7 @@
173
175
  position: absolute;
174
176
  width: 36px;
175
177
  height: 100%;
176
- top: initial;
178
+ top: 0px;
177
179
  right: 50%;
178
180
  overflow: visible;
179
181
  font-size: 12px;
@@ -0,0 +1,3 @@
1
+ import { RangeValue } from "../../types";
2
+ export declare const isSameValue: (newValue: RangeValue, oldValue: RangeValue) => boolean;
3
+ export declare const handleOverlap: (value: number[]) => number[];
@@ -0,0 +1,6 @@
1
+ export var isSameValue = function(newValue, oldValue) {
2
+ return JSON.stringify(newValue) === JSON.stringify(oldValue);
3
+ };
4
+ export var handleOverlap = function(value) {
5
+ return value[0] > value[1] ? value.slice(0).reverse() : value;
6
+ };