@arco-design/mobile-react 2.30.4 → 2.30.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 (106) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/checkbox/style/css/index.css +3 -0
  5. package/cjs/checkbox/style/index.less +5 -0
  6. package/cjs/date-picker/index.js +46 -29
  7. package/cjs/dialog/style/css/index.css +88 -0
  8. package/cjs/dialog/style/index.less +16 -4
  9. package/cjs/dropdown-menu/helper.d.ts +1 -6
  10. package/cjs/dropdown-menu/helper.js +0 -10
  11. package/cjs/ellipsis/components/js-ellipsis.js +14 -17
  12. package/cjs/ellipsis/index.d.ts +2 -2
  13. package/cjs/ellipsis/index.js +2 -2
  14. package/cjs/image-preview/index.js +1 -0
  15. package/cjs/index-bar/style/css/index.css +28 -5
  16. package/cjs/index-bar/style/index.less +10 -10
  17. package/cjs/pagination/arrow.js +6 -3
  18. package/cjs/pagination/style/css/index.css +21 -6
  19. package/cjs/pagination/style/index.less +9 -9
  20. package/cjs/picker/style/css/index.css +8 -0
  21. package/cjs/picker/style/index.less +2 -2
  22. package/cjs/progress/style/css/index.css +20 -0
  23. package/cjs/progress/style/index.less +5 -5
  24. package/cjs/radio/style/css/index.css +3 -0
  25. package/cjs/radio/style/index.less +5 -0
  26. package/cjs/search-bar/style/css/index.css +18 -0
  27. package/cjs/search-bar/style/index.less +5 -5
  28. package/cjs/show-monitor/index.d.ts +5 -0
  29. package/cjs/show-monitor/index.js +1 -0
  30. package/cjs/slider/hooks/index.d.ts +1 -1
  31. package/cjs/slider/index.d.ts +10 -0
  32. package/cjs/slider/index.js +1 -0
  33. package/cjs/slider/thumb.d.ts +6 -5
  34. package/cjs/slider/thumb.js +19 -20
  35. package/dist/index.js +86 -57
  36. package/dist/index.min.js +2 -2
  37. package/dist/style.css +152 -11
  38. package/dist/style.min.css +1 -1
  39. package/esm/checkbox/style/css/index.css +3 -0
  40. package/esm/checkbox/style/index.less +5 -0
  41. package/esm/date-picker/index.js +44 -26
  42. package/esm/dialog/style/css/index.css +88 -0
  43. package/esm/dialog/style/index.less +16 -4
  44. package/esm/dropdown-menu/helper.d.ts +1 -6
  45. package/esm/dropdown-menu/helper.js +0 -8
  46. package/esm/ellipsis/components/js-ellipsis.js +14 -17
  47. package/esm/ellipsis/index.d.ts +2 -2
  48. package/esm/ellipsis/index.js +2 -2
  49. package/esm/image-preview/index.js +1 -0
  50. package/esm/index-bar/style/css/index.css +28 -5
  51. package/esm/index-bar/style/index.less +10 -10
  52. package/esm/pagination/arrow.js +6 -3
  53. package/esm/pagination/style/css/index.css +21 -6
  54. package/esm/pagination/style/index.less +9 -9
  55. package/esm/picker/style/css/index.css +8 -0
  56. package/esm/picker/style/index.less +2 -2
  57. package/esm/progress/style/css/index.css +20 -0
  58. package/esm/progress/style/index.less +5 -5
  59. package/esm/radio/style/css/index.css +3 -0
  60. package/esm/radio/style/index.less +5 -0
  61. package/esm/search-bar/style/css/index.css +18 -0
  62. package/esm/search-bar/style/index.less +5 -5
  63. package/esm/show-monitor/index.d.ts +5 -0
  64. package/esm/show-monitor/index.js +1 -0
  65. package/esm/slider/hooks/index.d.ts +1 -1
  66. package/esm/slider/index.d.ts +10 -0
  67. package/esm/slider/index.js +1 -0
  68. package/esm/slider/thumb.d.ts +6 -5
  69. package/esm/slider/thumb.js +19 -17
  70. package/package.json +3 -3
  71. package/tokens/app/arcodesign/default/css-variables.less +3 -4
  72. package/tokens/app/arcodesign/default/index.d.ts +0 -1
  73. package/tokens/app/arcodesign/default/index.js +3 -4
  74. package/tokens/app/arcodesign/default/index.json +9 -21
  75. package/tokens/app/arcodesign/default/index.less +3 -4
  76. package/umd/checkbox/style/css/index.css +3 -0
  77. package/umd/checkbox/style/index.less +5 -0
  78. package/umd/date-picker/index.js +47 -30
  79. package/umd/dialog/style/css/index.css +88 -0
  80. package/umd/dialog/style/index.less +16 -4
  81. package/umd/dropdown-menu/helper.d.ts +1 -6
  82. package/umd/dropdown-menu/helper.js +0 -10
  83. package/umd/ellipsis/components/js-ellipsis.js +14 -17
  84. package/umd/ellipsis/index.d.ts +2 -2
  85. package/umd/ellipsis/index.js +2 -2
  86. package/umd/image-preview/index.js +1 -0
  87. package/umd/index-bar/style/css/index.css +28 -5
  88. package/umd/index-bar/style/index.less +10 -10
  89. package/umd/pagination/arrow.js +6 -3
  90. package/umd/pagination/style/css/index.css +21 -6
  91. package/umd/pagination/style/index.less +9 -9
  92. package/umd/picker/style/css/index.css +8 -0
  93. package/umd/picker/style/index.less +2 -2
  94. package/umd/progress/style/css/index.css +20 -0
  95. package/umd/progress/style/index.less +5 -5
  96. package/umd/radio/style/css/index.css +3 -0
  97. package/umd/radio/style/index.less +5 -0
  98. package/umd/search-bar/style/css/index.css +18 -0
  99. package/umd/search-bar/style/index.less +5 -5
  100. package/umd/show-monitor/index.d.ts +5 -0
  101. package/umd/show-monitor/index.js +1 -0
  102. package/umd/slider/hooks/index.d.ts +1 -1
  103. package/umd/slider/index.d.ts +10 -0
  104. package/umd/slider/index.js +1 -0
  105. package/umd/slider/thumb.d.ts +6 -5
  106. package/umd/slider/thumb.js +23 -23
@@ -9,10 +9,13 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  function Arrow() {
11
11
  return /*#__PURE__*/_react.default.createElement("svg", {
12
- width: "8",
12
+ width: "2",
13
13
  height: "14",
14
- viewBox: "0 0 8 14",
15
- fill: "none"
14
+ viewBox: "3 0 2 14",
15
+ fill: "none",
16
+ style: {
17
+ overflow: 'visible'
18
+ }
16
19
  }, /*#__PURE__*/_react.default.createElement("path", {
17
20
  fillRule: "evenodd",
18
21
  clipRule: "evenodd",
@@ -527,6 +527,10 @@
527
527
  justify-content: flex-end;
528
528
  margin-right: 0.48rem ;
529
529
  }
530
+ [dir="rtl"] .arco-pagination-prev-field.flex-center {
531
+ margin-right: initial;
532
+ margin-left: 0.48rem ;
533
+ }
530
534
  .arco-pagination-next-field {
531
535
  -webkit-box-pack: end;
532
536
  -webkit-justify-content: flex-end;
@@ -538,6 +542,10 @@
538
542
  justify-content: flex-start;
539
543
  margin-left: 0.48rem ;
540
544
  }
545
+ [dir="rtl"] .arco-pagination-next-field.flex-center {
546
+ margin-left: initial;
547
+ margin-right: 0.48rem ;
548
+ }
541
549
  .arco-pagination-field {
542
550
  cursor: pointer;
543
551
  text-align: center;
@@ -572,10 +580,18 @@
572
580
  -webkit-align-items: center;
573
581
  align-items: center;
574
582
  }
583
+ [dir="rtl"] .arco-pagination-field .btn-icon {
584
+ -webkit-transform: scaleX(-1);
585
+ transform: scaleX(-1);
586
+ }
575
587
  .arco-pagination-field .btn-icon.next {
576
588
  -webkit-transform: rotateY(180deg);
577
589
  transform: rotateY(180deg);
578
590
  }
591
+ [dir="rtl"] .arco-pagination-field .btn-icon.next {
592
+ -webkit-transform: none;
593
+ transform: none;
594
+ }
579
595
  .arco-pagination-field.button {
580
596
  padding: 0.12rem 0.32rem ;
581
597
  border-radius: 0.04rem ;
@@ -592,13 +608,12 @@
592
608
  }
593
609
  .arco-pagination-field.button .btn-icon + .btn-text,
594
610
  .arco-pagination-field.button .btn-text + .btn-icon {
595
- margin-left: 0.16rem ;
596
- }
597
- .arco-pagination-field.button .btn-icon:first-child {
598
- margin-left: -0.06rem ;
611
+ margin-left: 0.22rem ;
599
612
  }
600
- .arco-pagination-field.button .btn-icon:last-child {
601
- margin-right: -0.06rem ;
613
+ [dir="rtl"] .arco-pagination-field.button .btn-icon + .btn-text,
614
+ [dir="rtl"] .arco-pagination-field.button .btn-text + .btn-icon {
615
+ margin-left: initial;
616
+ margin-right: 0.22rem ;
602
617
  }
603
618
  .arco-pagination.android .arco-pagination-field.button .btn-text {
604
619
  padding-top: 0.04rem;
@@ -16,14 +16,14 @@
16
16
  justify-content: flex-start;
17
17
  &.flex-center {
18
18
  justify-content: flex-end;
19
- .use-var(margin-right, pagination-center-field-gutter);
19
+ .use-var-with-rtl(margin-right, pagination-center-field-gutter);
20
20
  }
21
21
  }
22
22
  &-next-field {
23
23
  justify-content: flex-end;
24
24
  &.flex-center {
25
25
  justify-content: flex-start;
26
- .use-var(margin-left, pagination-center-field-gutter);
26
+ .use-var-with-rtl(margin-left, pagination-center-field-gutter);
27
27
  }
28
28
  }
29
29
 
@@ -41,8 +41,14 @@
41
41
  .btn-icon {
42
42
  display: inline-flex;
43
43
  align-items: center;
44
+ [dir="rtl"] & {
45
+ transform: scaleX(-1);
46
+ }
44
47
  &.next {
45
48
  transform: rotateY(180deg);
49
+ [dir="rtl"] & {
50
+ transform: none;
51
+ }
46
52
  }
47
53
  }
48
54
  }
@@ -61,13 +67,7 @@
61
67
  }
62
68
  .btn-icon + .btn-text,
63
69
  .btn-text + .btn-icon {
64
- .use-var(margin-left, pagination-field-btn-icon-text-gutter);
65
- }
66
- .btn-icon:first-child {
67
- .use-var(margin-left, pagination-field-btn-icon-side-margin);
68
- }
69
- .btn-icon:last-child {
70
- .use-var(margin-right, pagination-field-btn-icon-side-margin);
70
+ .use-var-with-rtl(margin-left, pagination-field-btn-icon-text-gutter);
71
71
  }
72
72
  }
73
73
  &.android &-field.button {
@@ -536,10 +536,18 @@
536
536
  left: 0;
537
537
  color: #165DFF ;
538
538
  }
539
+ [dir="rtl"] .arco-picker-header-btn.left {
540
+ left: initial;
541
+ right: 0;
542
+ }
539
543
  .arco-picker-header-btn.right {
540
544
  right: 0;
541
545
  color: #165DFF ;
542
546
  }
547
+ [dir="rtl"] .arco-picker-header-btn.right {
548
+ right: initial;
549
+ left: 0;
550
+ }
543
551
  /***************************************************
544
552
  * *
545
553
  * Arco Theme Style *
@@ -33,12 +33,12 @@
33
33
  .use-var(padding, picker-button-padding);
34
34
 
35
35
  &.left {
36
- left: 0;
36
+ .set-prop-with-rtl(left, 0);
37
37
  .use-var(color, picker-left-btn-color);
38
38
  }
39
39
 
40
40
  &.right {
41
- right: 0;
41
+ .set-prop-with-rtl(right, 0);
42
42
  .use-var(color, picker-right-btn-color);
43
43
  }
44
44
  }
@@ -500,6 +500,10 @@
500
500
  left: 0;
501
501
  z-index: 1001;
502
502
  }
503
+ [dir="rtl"] .arco-progress.progress-fixed {
504
+ left: initial;
505
+ right: 0;
506
+ }
503
507
  .arco-progress .progress-wrapper {
504
508
  position: relative;
505
509
  width: 100%;
@@ -540,6 +544,10 @@
540
544
  -webkit-transform: translateY(-50%);
541
545
  transform: translateY(-50%);
542
546
  }
547
+ [dir="rtl"] .arco-progress .progress-wrapper .progress-bar .wrapper {
548
+ right: initial;
549
+ left: 0;
550
+ }
543
551
  .arco-progress .progress-wrapper .filleted {
544
552
  border-radius: 100PX;
545
553
  }
@@ -548,10 +556,22 @@
548
556
  margin-left: 0.16rem ;
549
557
  color: #165DFF ;
550
558
  }
559
+ [dir="rtl"] .arco-progress .progress-wrapper .text {
560
+ margin-left: initial;
561
+ margin-right: 0.16rem ;
562
+ }
551
563
  .arco-progress .progress-wrapper .text-left {
552
564
  margin-left: 0;
553
565
  margin-right: 0.16rem ;
554
566
  }
567
+ [dir="rtl"] .arco-progress .progress-wrapper .text-left {
568
+ margin-left: initial;
569
+ margin-right: 0;
570
+ }
571
+ [dir="rtl"] .arco-progress .progress-wrapper .text-left {
572
+ margin-right: initial;
573
+ margin-left: 0.16rem ;
574
+ }
555
575
  .arco-progress .progress-wrapper .text-innerLeft {
556
576
  position: absolute;
557
577
  z-index: 1;
@@ -5,7 +5,7 @@
5
5
  &.progress-fixed {
6
6
  position: fixed;
7
7
  width: 100%;
8
- left: 0;
8
+ .set-prop-with-rtl(left, 0);
9
9
  z-index: @full-screen-z-index + 1;;
10
10
  }
11
11
 
@@ -39,7 +39,7 @@
39
39
 
40
40
  .wrapper {
41
41
  position: absolute;
42
- right: 0;
42
+ .set-prop-with-rtl(right, 0);
43
43
  top: 50%;
44
44
  transform: translateY(-50%);
45
45
  }
@@ -51,13 +51,13 @@
51
51
 
52
52
  .text {
53
53
  .use-var(font-size, progress-text-font-size);
54
- .use-var(margin-left, progress-text-gutter);
54
+ .use-var-with-rtl(margin-left, progress-text-gutter);
55
55
  .use-var(color, progress-primary-color);
56
56
  }
57
57
 
58
58
  .text-left {
59
- margin-left: 0;
60
- .use-var(margin-right, progress-text-gutter);
59
+ .set-prop-with-rtl(margin-left, 0);
60
+ .use-var-with-rtl(margin-right, progress-text-gutter);
61
61
  }
62
62
 
63
63
  .text-innerLeft {
@@ -502,6 +502,9 @@
502
502
  -webkit-align-items: center;
503
503
  align-items: center;
504
504
  }
505
+ .arco-radio:focus {
506
+ outline: none;
507
+ }
505
508
  .arco-radio .radio-icon {
506
509
  display: -webkit-inline-box;
507
510
  display: -webkit-inline-flex;
@@ -4,6 +4,11 @@
4
4
  display: inline-flex;
5
5
  align-items: center;
6
6
 
7
+ // iOS low-end machine style compatibility issues
8
+ &:focus {
9
+ outline: none;
10
+ }
11
+
7
12
  .radio-icon {
8
13
  display: inline-flex;
9
14
  align-items: center;
@@ -538,9 +538,15 @@
538
538
  .arco-search-bar-input-left {
539
539
  text-align: left;
540
540
  }
541
+ [dir="rtl"] .arco-search-bar-input-left {
542
+ text-align: right;
543
+ }
541
544
  .arco-search-bar-input-right {
542
545
  text-align: right;
543
546
  }
547
+ [dir="rtl"] .arco-search-bar-input-right {
548
+ text-align: left;
549
+ }
544
550
  .arco-search-bar-input-center {
545
551
  text-align: center;
546
552
  }
@@ -570,11 +576,19 @@
570
576
  .arco-search-bar-prefix {
571
577
  margin-right: 0.18rem ;
572
578
  }
579
+ [dir="rtl"] .arco-search-bar-prefix {
580
+ margin-right: initial;
581
+ margin-left: 0.18rem ;
582
+ }
573
583
  .arco-search-bar-clear {
574
584
  color: #c9cdd4 ;
575
585
  font-size: 16PX ;
576
586
  padding-left: 0.32rem ;
577
587
  }
588
+ [dir="rtl"] .arco-search-bar-clear {
589
+ padding-left: initial;
590
+ padding-right: 0.32rem ;
591
+ }
578
592
  .arco-search-bar-search-icon {
579
593
  color: #86909c ;
580
594
  font-size: 0.32rem ;
@@ -584,6 +598,10 @@
584
598
  color: #165DFF ;
585
599
  font-size: 0.3rem ;
586
600
  }
601
+ [dir="rtl"] .arco-search-bar-cancel-btn {
602
+ margin-left: initial;
603
+ margin-right: 0.32rem ;
604
+ }
587
605
  .arco-search-bar-association {
588
606
  position: absolute;
589
607
  left: 0;
@@ -34,10 +34,10 @@
34
34
  .use-var(height, search-bar-input-height);
35
35
  .use-var(caret-color, search-bar-input-caret-color);
36
36
  &-left {
37
- text-align: left;
37
+ .set-value-with-rtl(text-align, left);
38
38
  }
39
39
  &-right {
40
- text-align: right;
40
+ .set-value-with-rtl(text-align, right);
41
41
  }
42
42
  &-center {
43
43
  text-align: center;
@@ -62,13 +62,13 @@
62
62
  }
63
63
 
64
64
  &-prefix {
65
- .use-var(margin-right, search-bar-prefix-margin-right);
65
+ .use-var-with-rtl(margin-right, search-bar-prefix-margin-right);
66
66
  }
67
67
 
68
68
  &-clear {
69
69
  .use-var(color, search-bar-clear-icon-color);
70
70
  .use-var(font-size, search-bar-clear-icon-font-size);
71
- .use-var(padding-left, search-bar-clear-icon-padding-left);
71
+ .use-var-with-rtl(padding-left, search-bar-clear-icon-padding-left);
72
72
  }
73
73
 
74
74
  &-search-icon {
@@ -77,7 +77,7 @@
77
77
  }
78
78
 
79
79
  &-cancel-btn {
80
- .use-var(margin-left, search-bar-cancel-btn-margin-left);
80
+ .use-var-with-rtl(margin-left, search-bar-cancel-btn-margin-left);
81
81
  .use-var(color, search-bar-cancel-btn-color);
82
82
  .use-var(font-size, search-bar-cancel-btn-font-size);
83
83
  }
@@ -97,6 +97,11 @@ export interface ShowMonitorRef {
97
97
  * @en Ignore the state of the element before and after, manually check whether the element is in the viewport, trigger the onVisibleChange callback function
98
98
  */
99
99
  checkVisible: () => boolean;
100
+ /**
101
+ * 重置元素初始可见态为false,并重新对元素可见度发起检测,优先级低于disabled(通常用在对ShowMonitor内部元素变化时发起的重新监听)
102
+ * @en Reset the initial visible state of the element to false, and re-detect the visibility of the element, the priority is lower than 'disabled'(Usually used to re-listen when elements inside ShowMonitor change)
103
+ */
104
+ flushVisibleStatus: () => void;
100
105
  }
101
106
  /**
102
107
  * 通过滚动事件监测 children 是否进入视口或离开视口。
@@ -202,6 +202,7 @@ var ShowMonitor = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
202
202
 
203
203
 
204
204
  curVisible !== preVisible && handleCheckChildrenExist() && onCompVisibleChange(curVisible, node);
205
+ component.isVisible = curVisible;
205
206
  var key = wrapperKey.current;
206
207
  /**
207
208
  * 监听一次后加入 pendingList 队列,随后被 listeners 过滤掉
@@ -5,7 +5,7 @@ export declare type LinePosition = {
5
5
  length: number;
6
6
  start: number;
7
7
  };
8
- export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "onAfterChange" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks">>;
8
+ export declare const SliderContext: React.Context<Required<Pick<SliderProps, "max" | "disabled" | "style" | "size" | "step" | "type" | "className" | "onChange" | "onAfterChange" | "min" | "suffixLabel" | "prefixLabel" | "useRange" | "useAnimation" | "showTooltip" | "showMarks" | "useMarkOnly" | "draggableTrackOnly" | "formatTooltip" | "renderThumb">> & Pick<SliderProps, "value" | "defaultValue" | "marks" | "renderThumbPopover">>;
9
9
  export * from './useSliderIcon';
10
10
  export * from './useSliderInit';
11
11
  export * from './useSliderStyle';
@@ -130,6 +130,16 @@ export interface SliderProps {
130
130
  * @en Custom slider
131
131
  */
132
132
  renderThumb?: (value: number) => ReactNode;
133
+ /**
134
+ * 自定义滑块的Popover,优先级高于formatTooltip。value表示当前滑动进度,visible表示气泡的可见性,index表示当前滑块索引,thumbEl表示当前滑块元素。
135
+ * @en Custom slider popover,priority is higher than formatTooltip. value - current sliding progress, visible - visibility of the bubble, index - current slider index, thumbEl - current slider element.
136
+ */
137
+ renderThumbPopover?: (config: {
138
+ value: number;
139
+ visible: boolean;
140
+ index: number;
141
+ thumbEl: React.ReactNode;
142
+ }) => ReactNode;
133
143
  }
134
144
  export interface SliderRef {
135
145
  /**
@@ -169,6 +169,7 @@ var Slider = /*#__PURE__*/(0, _react.forwardRef)(function (_, ref) {
169
169
  key: idx
170
170
  }, (0, _extends2.default)({
171
171
  value: Array.isArray(valueGroup) ? valueGroup[idx] : valueGroup,
172
+ idx: idx,
172
173
  min: min,
173
174
  max: max,
174
175
  isTouching: commonIsTouching === idx
@@ -1,8 +1,9 @@
1
- import React, { CSSProperties } from 'react';
2
- declare const Thumb: ({ className, value, style, isTouching, }: {
3
- className?: string | undefined;
1
+ import { CSSProperties } from 'react';
2
+ declare function Thumb({ className, value, style, isTouching, idx, }: {
3
+ className?: string;
4
4
  value: number;
5
5
  isTouching: boolean;
6
- style?: React.CSSProperties | undefined;
7
- }) => JSX.Element;
6
+ style?: CSSProperties;
7
+ idx: number;
8
+ }): JSX.Element;
8
9
  export default Thumb;
@@ -1,12 +1,8 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  exports.__esModule = true;
6
4
  exports.default = void 0;
7
5
 
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
-
10
6
  var _react = _interopRequireWildcard(require("react"));
11
7
 
12
8
  var _popover = require("./popover");
@@ -19,11 +15,13 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
15
 
20
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
17
 
22
- var Thumb = function Thumb(_ref) {
23
- var className = _ref.className,
18
+ function Thumb(_ref) {
19
+ var _ref$className = _ref.className,
20
+ className = _ref$className === void 0 ? '' : _ref$className,
24
21
  value = _ref.value,
25
22
  style = _ref.style,
26
- isTouching = _ref.isTouching;
23
+ isTouching = _ref.isTouching,
24
+ idx = _ref.idx;
27
25
 
28
26
  var _useContext = (0, _react.useContext)(_contextProvider.GlobalContext),
29
27
  _useContext$prefixCls = _useContext.prefixCls,
@@ -32,7 +30,8 @@ var Thumb = function Thumb(_ref) {
32
30
  var _useContext2 = (0, _react.useContext)(_hooks.SliderContext),
33
31
  showTooltip = _useContext2.showTooltip,
34
32
  renderThumb = _useContext2.renderThumb,
35
- formatTooltip = _useContext2.formatTooltip;
33
+ formatTooltip = _useContext2.formatTooltip,
34
+ renderThumbPopover = _useContext2.renderThumbPopover;
36
35
 
37
36
  var isHidden = showTooltip === 'never';
38
37
  var renderValue = (0, _react.useMemo)(function () {
@@ -43,21 +42,21 @@ var Thumb = function Thumb(_ref) {
43
42
  if (showTooltip === 'always') return true;
44
43
  return isTouching;
45
44
  }, [showTooltip, isTouching]);
46
-
47
- var renderWrapper = function renderWrapper(el) {
48
- return /*#__PURE__*/_react.default.createElement("div", {
49
- className: prefixCls + "-slider-thumb-wrapper " + className,
50
- style: (0, _extends2.default)({}, style)
51
- }, el);
52
- };
53
-
54
45
  var thumbEl = typeof renderThumb === 'function' ? renderThumb(value) : renderThumb;
55
- if (isHidden) return renderWrapper(thumbEl);
56
- return renderWrapper( /*#__PURE__*/_react.default.createElement(_popover.Popover, {
46
+ var popoverEl = typeof renderThumbPopover === 'function' ? renderThumbPopover({
47
+ value: value,
48
+ visible: isTooltipVisible,
49
+ thumbEl: thumbEl,
50
+ index: idx
51
+ }) : /*#__PURE__*/_react.default.createElement(_popover.Popover, {
57
52
  visible: isTooltipVisible,
58
53
  content: renderValue
59
- }, thumbEl));
60
- };
54
+ }, thumbEl);
55
+ return /*#__PURE__*/_react.default.createElement("div", {
56
+ className: prefixCls + "-slider-thumb-wrapper " + className,
57
+ style: style
58
+ }, isHidden ? thumbEl : popoverEl);
59
+ }
61
60
 
62
61
  var _default = Thumb;
63
62
  exports.default = _default;