@nutui/nutui-react-taro 3.0.4 → 3.0.6

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 (140) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/cjs/packages/badge/badge.js +4 -3
  3. package/dist/cjs/packages/badge/style/badge.scss +7 -8
  4. package/dist/cjs/packages/badge/style/style.css +13 -15
  5. package/dist/cjs/packages/badge/style/style.harmony.css +7 -9
  6. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  7. package/dist/cjs/packages/datepicker/style/style.css +3 -1
  8. package/dist/cjs/packages/datepickerview/style/style.css +3 -1
  9. package/dist/cjs/packages/empty/style/index.js +1 -0
  10. package/dist/cjs/packages/empty/style/style.css +389 -0
  11. package/dist/cjs/packages/fixednav/fixednav.js +3 -3
  12. package/dist/cjs/packages/fixednav/style/fixednav.scss +43 -39
  13. package/dist/cjs/packages/fixednav/style/style.css +56 -51
  14. package/dist/cjs/packages/fixednav/style/style.harmony.css +43 -36
  15. package/dist/cjs/packages/imagepreview/imagepreview.js +58 -91
  16. package/dist/cjs/packages/imagepreview/style/imagepreview.scss +2 -1
  17. package/dist/cjs/packages/imagepreview/style/style.css +2 -1
  18. package/dist/cjs/packages/imagepreview/style/style.harmony.css +2 -1
  19. package/dist/cjs/packages/indicator/indicator.js +1 -1
  20. package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
  21. package/dist/cjs/packages/lottie/index.js +5 -5
  22. package/dist/cjs/packages/lottie/{mp.js → lottiemp.js} +1 -1
  23. package/dist/cjs/packages/notify/notify.js +44 -13
  24. package/dist/cjs/packages/notify/style/notify.scss +39 -36
  25. package/dist/cjs/packages/notify/style/style.css +36 -31
  26. package/dist/cjs/packages/notify/style/style.harmony.css +36 -31
  27. package/dist/cjs/packages/nutui.react.d.ts +1 -0
  28. package/dist/cjs/packages/nutui.react.js +1 -0
  29. package/dist/cjs/packages/picker/style/style.css +3 -1
  30. package/dist/cjs/packages/pickerview/pickerroller.js +81 -11
  31. package/dist/cjs/packages/pickerview/style/pickerview.scss +3 -1
  32. package/dist/cjs/packages/pickerview/style/style.css +3 -1
  33. package/dist/cjs/packages/pickerview/style/style.harmony.css +3 -0
  34. package/dist/cjs/packages/resultpage/style/index.js +1 -0
  35. package/dist/cjs/packages/resultpage/style/style.css +389 -0
  36. package/dist/cjs/packages/searchbar/searchbar.js +8 -2
  37. package/dist/cjs/packages/skeleton/skeleton.js +63 -52
  38. package/dist/cjs/packages/skeleton/style/index.js +0 -1
  39. package/dist/cjs/packages/skeleton/style/skeleton.scss +40 -46
  40. package/dist/cjs/packages/skeleton/style/style.css +32 -175
  41. package/dist/cjs/packages/skeleton/style/style.harmony.css +32 -42
  42. package/dist/cjs/packages/switch/style/style.css +5 -0
  43. package/dist/cjs/packages/switch/style/style.harmony.css +5 -0
  44. package/dist/cjs/packages/switch/style/switch.scss +5 -0
  45. package/dist/cjs/packages/switch/switch.js +22 -11
  46. package/dist/cjs/packages/tabbar/style/style.css +58 -54
  47. package/dist/cjs/packages/tabbar/style/style.harmony.css +24 -18
  48. package/dist/cjs/packages/tabbar/style/tabbar.scss +28 -19
  49. package/dist/cjs/packages/tabbar/tabbar.js +28 -10
  50. package/dist/cjs/packages/tabbaritem/style/style.css +34 -36
  51. package/dist/cjs/packages/tabbaritem/style/style.harmony.css +21 -21
  52. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +32 -29
  53. package/dist/cjs/packages/tabbaritem/tabbaritem.js +38 -14
  54. package/dist/cjs/types/spec/badge/base.d.ts +1 -0
  55. package/dist/cjs/types/spec/indicator/base.d.ts +1 -1
  56. package/dist/cjs/types/spec/notify/base.d.ts +7 -2
  57. package/dist/cjs/types/spec/searchbar/taro.d.ts +10 -7
  58. package/dist/cjs/types/spec/skeleton/base.d.ts +7 -5
  59. package/dist/cjs/types/spec/switch/base.d.ts +3 -2
  60. package/dist/cjs/types/spec/switch/h5.d.ts +1 -1
  61. package/dist/cjs/types/spec/switch/taro.d.ts +1 -4
  62. package/dist/cjs/types/spec/tabbar/base.d.ts +7 -4
  63. package/dist/es/packages/badge/badge.js +4 -3
  64. package/dist/es/packages/badge/style/badge.scss +7 -8
  65. package/dist/es/packages/badge/style/style.css +13 -15
  66. package/dist/es/packages/badge/style/style.harmony.css +7 -9
  67. package/dist/es/packages/configprovider/types.d.ts +1 -1
  68. package/dist/es/packages/datepicker/style/style.css +3 -1
  69. package/dist/es/packages/datepickerview/style/style.css +3 -1
  70. package/dist/es/packages/empty/style/index.js +1 -0
  71. package/dist/es/packages/empty/style/style.css +389 -0
  72. package/dist/es/packages/fixednav/fixednav.js +4 -4
  73. package/dist/es/packages/fixednav/style/fixednav.scss +43 -39
  74. package/dist/es/packages/fixednav/style/style.css +56 -51
  75. package/dist/es/packages/fixednav/style/style.harmony.css +43 -36
  76. package/dist/es/packages/imagepreview/imagepreview.js +58 -91
  77. package/dist/es/packages/imagepreview/style/imagepreview.scss +2 -1
  78. package/dist/es/packages/imagepreview/style/style.css +2 -1
  79. package/dist/es/packages/imagepreview/style/style.harmony.css +2 -1
  80. package/dist/es/packages/indicator/indicator.js +1 -1
  81. package/dist/es/packages/inputnumber/inputnumber.js +2 -2
  82. package/dist/es/packages/lottie/index.js +3 -3
  83. package/dist/es/packages/lottie/{mp.js → lottiemp.js} +1 -1
  84. package/dist/es/packages/notify/notify.js +45 -14
  85. package/dist/es/packages/notify/style/notify.scss +39 -36
  86. package/dist/es/packages/notify/style/style.css +36 -31
  87. package/dist/es/packages/notify/style/style.harmony.css +36 -31
  88. package/dist/es/packages/picker/style/style.css +3 -1
  89. package/dist/es/packages/pickerview/pickerroller.js +80 -11
  90. package/dist/es/packages/pickerview/style/pickerview.scss +3 -1
  91. package/dist/es/packages/pickerview/style/style.css +3 -1
  92. package/dist/es/packages/pickerview/style/style.harmony.css +3 -0
  93. package/dist/es/packages/resultpage/style/index.js +1 -0
  94. package/dist/es/packages/resultpage/style/style.css +389 -0
  95. package/dist/es/packages/searchbar/searchbar.js +7 -2
  96. package/dist/es/packages/skeleton/skeleton.js +62 -52
  97. package/dist/es/packages/skeleton/style/index.js +0 -1
  98. package/dist/es/packages/skeleton/style/skeleton.scss +40 -46
  99. package/dist/es/packages/skeleton/style/style.css +32 -175
  100. package/dist/es/packages/skeleton/style/style.harmony.css +32 -42
  101. package/dist/es/packages/switch/style/style.css +5 -0
  102. package/dist/es/packages/switch/style/style.harmony.css +5 -0
  103. package/dist/es/packages/switch/style/switch.scss +5 -0
  104. package/dist/es/packages/switch/switch.js +21 -11
  105. package/dist/es/packages/tabbar/style/style.css +58 -54
  106. package/dist/es/packages/tabbar/style/style.harmony.css +24 -18
  107. package/dist/es/packages/tabbar/style/tabbar.scss +28 -19
  108. package/dist/es/packages/tabbar/tabbar.js +27 -10
  109. package/dist/es/packages/tabbaritem/style/style.css +34 -36
  110. package/dist/es/packages/tabbaritem/style/style.harmony.css +21 -21
  111. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +32 -29
  112. package/dist/es/packages/tabbaritem/tabbaritem.js +38 -14
  113. package/dist/es/types/spec/badge/base.d.ts +4 -0
  114. package/dist/es/types/spec/indicator/base.d.ts +1 -1
  115. package/dist/es/types/spec/notify/base.d.ts +22 -5
  116. package/dist/es/types/spec/searchbar/taro.d.ts +10 -7
  117. package/dist/es/types/spec/skeleton/base.d.ts +19 -14
  118. package/dist/es/types/spec/switch/base.d.ts +6 -2
  119. package/dist/es/types/spec/switch/h5.d.ts +1 -1
  120. package/dist/es/types/spec/switch/taro.d.ts +1 -4
  121. package/dist/es/types/spec/tabbar/base.d.ts +7 -4
  122. package/dist/nutui.react.umd.js +549 -395
  123. package/dist/style.css +1 -1
  124. package/dist/style.scss +51 -51
  125. package/dist/styles/theme-dark.scss +2 -0
  126. package/dist/styles/theme-default.scss +2 -0
  127. package/dist/styles/themes/dark.css +1 -1
  128. package/dist/styles/themes/default.css +1 -1
  129. package/dist/styles/themes/jmapp.css +1 -1
  130. package/dist/styles/themes/jrkf.css +1 -1
  131. package/dist/styles/variables-jmapp.scss +24 -1
  132. package/dist/styles/variables-jrkf.scss +24 -1
  133. package/dist/styles/variables.scss +37 -38
  134. package/package.json +1 -1
  135. /package/dist/cjs/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
  136. /package/dist/cjs/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
  137. /package/dist/cjs/packages/lottie/{web.js → lottieweb.js} +0 -0
  138. /package/dist/es/packages/lottie/{mp.d.ts → lottiemp.d.ts} +0 -0
  139. /package/dist/es/packages/lottie/{web.d.ts → lottieweb.d.ts} +0 -0
  140. /package/dist/es/packages/lottie/{web.js → lottieweb.js} +0 -0
@@ -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
  }
@@ -12,7 +12,7 @@
12
12
  /*入场动画过程*/
13
13
  .fade-enter-active {
14
14
  opacity: 1;
15
- transition: opacity 1s;
15
+ transition: opacity 300ms ease-in;
16
16
  }
17
17
 
18
18
  /*入场动画结束*/
@@ -28,7 +28,7 @@
28
28
  /*离场动画过程*/
29
29
  .fade-exit-active {
30
30
  opacity: 0;
31
- transition: opacity 1s;
31
+ transition: opacity 300ms ease-out;
32
32
  }
33
33
 
34
34
  /*离场动画结束*/
@@ -44,47 +44,52 @@
44
44
  /*页面第一次加载时的动画过程*/
45
45
  .fade-appear-active {
46
46
  opacity: 1;
47
- transition: opacity 1s;
47
+ transition: opacity 300ms;
48
48
  }
49
49
 
50
50
  .nut-notify {
51
+ position: fixed;
52
+ left: 8px;
53
+ right: 8px;
54
+ z-index: 1000;
51
55
  display: flex;
52
- justify-content: center;
53
56
  align-items: center;
54
57
  box-sizing: border-box;
55
- padding: 0px 10px;
56
- color: #ffffff;
57
- font-size: 14px;
58
- white-space: pre-wrap;
59
- word-wrap: break-word;
60
58
  height: 40px;
59
+ padding: 0px 12px;
60
+ border-radius: 8px;
61
+ box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.06);
62
+ background-color: #ffffff;
63
+ }
64
+ .nut-notify-content {
65
+ flex: 1;
66
+ text-align: center;
67
+ min-width: 0;
68
+ font-size: 14px;
69
+ color: #1a1a1a;
70
+ white-space: nowrap;
71
+ overflow: hidden;
61
72
  }
62
- .nut-notify-popup-top, .nut-notify-popup-bottom {
63
- position: fixed;
64
- left: 0;
65
- right: 0;
66
- overflow-y: auto;
67
- transition: transform 0.3s;
68
- z-index: 9999;
69
- }
70
- .nut-notify-popup-top {
71
- top: 0;
73
+ .nut-notify-ellipsis {
74
+ text-overflow: ellipsis;
72
75
  }
73
- .nut-notify-popup-bottom {
74
- bottom: 0;
76
+ .nut-notify-layout-left {
77
+ text-align: left;
75
78
  }
76
- .nut-notify-base {
77
- background: #ff0f23;
79
+ .nut-notify-left-icon, .nut-notify-right-icon {
80
+ display: inline-flex;
78
81
  }
79
- .nut-notify-primary {
80
- background: #0073ff;
82
+ .nut-notify-left-icon {
83
+ margin-right: 6px;
81
84
  }
82
- .nut-notify-success {
83
- background: #00d900;
85
+ .nut-notify-left-icon .nut-icon {
86
+ height: 16px;
87
+ width: 16px;
84
88
  }
85
- .nut-notify-danger {
86
- background: #ff0f23;
89
+ .nut-notify-right-icon {
90
+ margin-left: 6px;
87
91
  }
88
- .nut-notify-warning {
89
- background: #ffbf00;
92
+ .nut-notify-right-icon .nut-icon {
93
+ height: 12px;
94
+ width: 12px;
90
95
  }
@@ -384,7 +384,6 @@
384
384
  }
385
385
 
386
386
  .nut-pickerview {
387
- --nutui-picker-item-height: 36px;
388
387
  position: relative;
389
388
  display: flex;
390
389
  width: 100%;
@@ -430,6 +429,9 @@
430
429
  z-index: 1;
431
430
  transform-style: preserve-3d;
432
431
  }
432
+ .nut-pickerview-roller-placeholder {
433
+ height: var(--nutui-picker-item-height, 36px);
434
+ }
433
435
  .nut-pickerview-roller-item {
434
436
  position: absolute;
435
437
  top: 0;
@@ -1,31 +1,41 @@
1
+ import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
2
+ import { _ as _define_property } from "@swc/helpers/_/_define_property";
1
3
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
4
+ import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
2
5
  import React, { useState, useEffect, useRef, useImperativeHandle } from "react";
6
+ import classNames from "classnames";
3
7
  import { View } from "@tarojs/components";
4
8
  import { useTouch } from "../../hooks/use-touch";
5
9
  import { passiveSupported } from "../../utils/supports-passive";
6
10
  import { web } from "../../utils/platform-taro";
7
11
  import { preventDefault } from "../../utils";
8
12
  import { momentum, useStyles } from "./utils";
13
+ import useUuid from "../../hooks/use-uuid";
14
+ import { getRectByTaro } from "../../utils/get-rect-by-taro";
9
15
  var InternalPickerRoller = function(props, ref) {
10
16
  var _props_keyIndex = props.keyIndex, keyIndex = _props_keyIndex === void 0 ? 0 : _props_keyIndex, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_threeDimensional = props.threeDimensional, threeDimensional = _props_threeDimensional === void 0 ? true : _props_threeDimensional, _props_duration = props.duration, duration = _props_duration === void 0 ? 1000 : _props_duration, onSelect = props.onSelect, _props_renderLabel = props.renderLabel, renderLabel = _props_renderLabel === void 0 ? function(item) {
11
17
  return item.label;
12
18
  } : _props_renderLabel;
19
+ var classPrefix = 'nut-pickerview-roller';
20
+ var uuid = useUuid();
13
21
  var DEFAULT_DURATION = 200;
14
22
  var INERTIA_TIME = 300;
15
23
  var INERTIA_DISTANCE = 15;
16
24
  var ROTATION = 20;
17
25
  var touch = useTouch();
18
- var _useState = _sliced_to_array(useState(1), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
26
+ var _useState = _sliced_to_array(useState(0), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
19
27
  var lineSpacing = useRef(36);
20
28
  var _useState1 = _sliced_to_array(useState(0), 2), touchTime = _useState1[0], setTouchTime = _useState1[1];
21
29
  var _useState2 = _sliced_to_array(useState('0deg'), 2), touchDeg = _useState2[0], setTouchDeg = _useState2[1];
22
30
  var isMoving = useRef(false);
23
31
  var rollerRef = useRef(null);
24
32
  var pickerRollerRef = useRef(null);
33
+ var placeholderRef = useRef(null);
25
34
  var _useState3 = _sliced_to_array(useState(0), 2), startTime = _useState3[0], setStartTime = _useState3[1];
26
35
  var _useState4 = _sliced_to_array(useState(0), 2), startY = _useState4[0], setStartY = _useState4[1];
27
36
  var transformY = useRef(0);
28
37
  var _useState5 = _sliced_to_array(useState(0), 2), scrollDistance = _useState5[0], setScrollDistance = _useState5[1];
38
+ var _useState6 = _sliced_to_array(useState(web()), 2), isGetLineSpacing = _useState6[0], setGetStatus = _useState6[1];
29
39
  var _useStyles = useStyles(touchTime, touchDeg, scrollDistance, lineSpacing, ROTATION), touchRollerStyle = _useStyles.touchRollerStyle, touchTiledStyle = _useStyles.touchTiledStyle, rollerStyle = _useStyles.rollerStyle;
30
40
  var isItemHidden = function(index) {
31
41
  return index >= currentIndex + 8 || index <= currentIndex - 8;
@@ -50,7 +60,7 @@ var InternalPickerRoller = function(props, ref) {
50
60
  var deg1 = Math.min(Math.max(currentDeg, 0), (options.length + 1) * ROTATION);
51
61
  if (deg1 >= 0 && deg1 < (options.length + 1) * ROTATION) {
52
62
  applyTransform('', "".concat(deg1, "deg"), undefined, updatedMove);
53
- setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
63
+ deg1 > 0 && setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
54
64
  }
55
65
  }
56
66
  };
@@ -91,7 +101,7 @@ var InternalPickerRoller = function(props, ref) {
91
101
  var index = options.findIndex(function(item) {
92
102
  return item.value === selectedValue;
93
103
  });
94
- setCurrentIndex(index === -1 ? 1 : index + 1);
104
+ setCurrentIndex(index === -1 ? 0 : index + 1);
95
105
  var move = index * lineSpacing.current;
96
106
  shouldSelect && selectValue(-move);
97
107
  handleMove(-move);
@@ -101,16 +111,69 @@ var InternalPickerRoller = function(props, ref) {
101
111
  setTouchTime(0);
102
112
  selectValue(scrollDistance);
103
113
  };
114
+ var getReactHeight = /*#__PURE__*/ function() {
115
+ var _ref = _async_to_generator(function() {
116
+ var placeholder, placeholderHeight, error;
117
+ return _ts_generator(this, function(_state) {
118
+ switch(_state.label){
119
+ case 0:
120
+ _state.trys.push([
121
+ 0,
122
+ 2,
123
+ ,
124
+ 3
125
+ ]);
126
+ return [
127
+ 4,
128
+ getRectByTaro(placeholderRef.current)
129
+ ];
130
+ case 1:
131
+ placeholder = _state.sent();
132
+ placeholderHeight = placeholder.height || 0;
133
+ return [
134
+ 2,
135
+ placeholderHeight
136
+ ];
137
+ case 2:
138
+ error = _state.sent();
139
+ console.error('获取高度失败:', error);
140
+ return [
141
+ 2,
142
+ 0
143
+ ];
144
+ case 3:
145
+ return [
146
+ 2
147
+ ];
148
+ }
149
+ });
150
+ });
151
+ return function getReactHeight() {
152
+ return _ref.apply(this, arguments);
153
+ };
154
+ }();
104
155
  // lineSpacing.current CSS variable
105
156
  useEffect(function() {
106
157
  var element = pickerRollerRef.current;
158
+ var currentLineSpacing;
107
159
  if (element && web()) {
108
160
  var computedStyle = getComputedStyle(element);
109
- var currentLineSpacing = computedStyle.getPropertyValue('--nutui-picker-item-height');
110
- !!currentLineSpacing && (lineSpacing.current = parseFloat(currentLineSpacing));
161
+ currentLineSpacing = computedStyle.getPropertyValue('--nutui-picker-item-height');
162
+ if (currentLineSpacing) {
163
+ lineSpacing.current = parseFloat(currentLineSpacing);
164
+ }
165
+ } else {
166
+ getReactHeight().then(function(height) {
167
+ currentLineSpacing = height;
168
+ if (currentLineSpacing) {
169
+ lineSpacing.current = currentLineSpacing;
170
+ setGetStatus(true);
171
+ }
172
+ });
111
173
  }
112
174
  }, [
113
- pickerRollerRef.current
175
+ pickerRollerRef.current,
176
+ placeholderRef.current
114
177
  ]);
115
178
  useEffect(function() {
116
179
  isMoving.current = false;
@@ -152,21 +215,27 @@ var InternalPickerRoller = function(props, ref) {
152
215
  className: "nut-pickerview-list",
153
216
  ref: pickerRollerRef
154
217
  }, /*#__PURE__*/ React.createElement(View, {
155
- className: "nut-pickerview-roller",
218
+ className: "".concat(classPrefix, "-placeholder"),
219
+ ref: placeholderRef,
220
+ id: "".concat(classPrefix, "-placeholder-").concat(uuid)
221
+ }), /*#__PURE__*/ React.createElement(View, {
222
+ className: classPrefix,
223
+ id: "".concat(classPrefix, "-").concat(uuid),
156
224
  ref: rollerRef,
157
225
  style: threeDimensional ? touchRollerStyle() : touchTiledStyle(),
158
226
  onTransitionEnd: stopMomentumScroll
159
227
  }, threeDimensional && options.map(function(item, index) {
160
228
  var _item_value;
161
- return /*#__PURE__*/ React.createElement(View, {
162
- className: "nut-pickerview-roller-item ".concat(isItemHidden(index + 1) && 'nut-pickerview-roller-item-hidden'),
229
+ var _obj;
230
+ return /*#__PURE__*/ React.createElement(React.Fragment, null, isGetLineSpacing ? /*#__PURE__*/ React.createElement(View, {
231
+ className: classNames("".concat(classPrefix, "-item"), (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-item-hidden"), isItemHidden(index + 1)), _define_property(_obj, "".concat(classPrefix, "-item-active"), index + 1 === currentIndex), _obj)),
163
232
  style: rollerStyle(index),
164
233
  key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
165
- }, renderLabel(item));
234
+ }, renderLabel(item)) : null);
166
235
  }), !threeDimensional && options.map(function(item, index) {
167
236
  var _item_value;
168
237
  return /*#__PURE__*/ React.createElement(View, {
169
- className: "nut-pickerview-roller-item-tiled",
238
+ className: classNames("".concat(classPrefix, "-item-tiled"), _define_property({}, "".concat(classPrefix, "-item-active"), index + 1 === currentIndex)),
170
239
  key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
171
240
  }, renderLabel(item));
172
241
  })));
@@ -1,5 +1,4 @@
1
1
  .nut-pickerview {
2
- --nutui-picker-item-height: 36px;
3
2
  position: relative;
4
3
  display: flex;
5
4
  width: 100%;
@@ -50,6 +49,9 @@
50
49
  height: $picker-item-height;
51
50
  z-index: 1;
52
51
  transform-style: preserve-3d;
52
+ &-placeholder {
53
+ height: $picker-item-height;
54
+ }
53
55
  }
54
56
 
55
57
  &-roller-item {
@@ -3,7 +3,6 @@
3
3
  /* #ifndef harmony */
4
4
  /* #endif */
5
5
  .nut-pickerview {
6
- --nutui-picker-item-height: 36px;
7
6
  position: relative;
8
7
  display: flex;
9
8
  width: 100%;
@@ -49,6 +48,9 @@
49
48
  z-index: 1;
50
49
  transform-style: preserve-3d;
51
50
  }
51
+ .nut-pickerview-roller-placeholder {
52
+ height: var(--nutui-picker-item-height, 36px);
53
+ }
52
54
  .nut-pickerview-roller-item {
53
55
  position: absolute;
54
56
  top: 0;
@@ -48,6 +48,9 @@
48
48
  z-index: 1;
49
49
  transform-style: preserve-3d;
50
50
  }
51
+ .nut-pickerview-roller-placeholder {
52
+ height: 36px;
53
+ }
51
54
  .nut-pickerview-roller-item {
52
55
  position: absolute;
53
56
  top: 0;
@@ -1 +1,2 @@
1
+ import '../../button/style';
1
2
  import './resultpage.scss';