@arco-design/mobile-react 2.27.3 → 2.27.5

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 (92) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.en-US.md +2 -2
  3. package/README.md +2 -2
  4. package/cjs/_helpers/hooks.js +1 -1
  5. package/cjs/action-sheet/index.d.ts +2 -2
  6. package/cjs/badge/index.js +2 -1
  7. package/cjs/dialog/index.d.ts +2 -2
  8. package/cjs/form/type.js +2 -0
  9. package/cjs/image-preview/index.d.ts +2 -2
  10. package/cjs/image-preview/index.js +2 -1
  11. package/cjs/image-preview/style/css/index.css +3 -0
  12. package/cjs/image-preview/style/index.less +4 -0
  13. package/cjs/index-bar/utils.js +1 -3
  14. package/cjs/index.d.ts +12 -12
  15. package/cjs/index.js +46 -46
  16. package/cjs/load-more/index.d.ts +5 -0
  17. package/cjs/load-more/index.js +2 -1
  18. package/cjs/masking/index.d.ts +2 -2
  19. package/cjs/masking/index.js +4 -2
  20. package/cjs/notify/index.d.ts +8 -8
  21. package/cjs/popover/popover.js +10 -2
  22. package/cjs/popup/index.d.ts +2 -2
  23. package/cjs/popup-swiper/index.d.ts +2 -2
  24. package/cjs/show-monitor/index.js +4 -3
  25. package/cjs/slider/hooks/index.d.ts +1 -1
  26. package/cjs/slider/popover.js +6 -2
  27. package/cjs/stepper/hooks/useButtonClick.js +8 -9
  28. package/cjs/style.d.ts +13 -13
  29. package/cjs/style.js +24 -24
  30. package/cjs/toast/index.d.ts +12 -12
  31. package/cjs/toast/index.js +5 -2
  32. package/dist/index.js +13859 -13830
  33. package/dist/index.min.js +3 -3
  34. package/dist/style.css +3273 -3270
  35. package/dist/style.min.css +1 -1
  36. package/esm/_helpers/hooks.js +2 -2
  37. package/esm/action-sheet/index.d.ts +2 -2
  38. package/esm/badge/index.js +2 -1
  39. package/esm/dialog/index.d.ts +2 -2
  40. package/esm/form/type.js +2 -0
  41. package/esm/image-preview/index.d.ts +2 -2
  42. package/esm/image-preview/index.js +2 -1
  43. package/esm/image-preview/style/css/index.css +3 -0
  44. package/esm/image-preview/style/index.less +4 -0
  45. package/esm/index-bar/utils.js +1 -2
  46. package/esm/index.d.ts +12 -12
  47. package/esm/index.js +12 -12
  48. package/esm/load-more/index.d.ts +5 -0
  49. package/esm/load-more/index.js +2 -1
  50. package/esm/masking/index.d.ts +2 -2
  51. package/esm/masking/index.js +4 -2
  52. package/esm/notify/index.d.ts +8 -8
  53. package/esm/popover/popover.js +10 -2
  54. package/esm/popup/index.d.ts +2 -2
  55. package/esm/popup-swiper/index.d.ts +2 -2
  56. package/esm/show-monitor/index.js +4 -3
  57. package/esm/slider/hooks/index.d.ts +1 -1
  58. package/esm/slider/popover.js +7 -3
  59. package/esm/stepper/hooks/useButtonClick.js +8 -9
  60. package/esm/style.d.ts +13 -13
  61. package/esm/style.js +13 -13
  62. package/esm/toast/index.d.ts +12 -12
  63. package/esm/toast/index.js +5 -2
  64. package/package.json +3 -3
  65. package/umd/_helpers/hooks.js +1 -1
  66. package/umd/action-sheet/index.d.ts +2 -2
  67. package/umd/badge/index.js +2 -1
  68. package/umd/dialog/index.d.ts +2 -2
  69. package/umd/form/type.js +2 -0
  70. package/umd/image-preview/index.d.ts +2 -2
  71. package/umd/image-preview/index.js +2 -1
  72. package/umd/image-preview/style/css/index.css +3 -0
  73. package/umd/image-preview/style/index.less +4 -0
  74. package/umd/index-bar/utils.js +5 -5
  75. package/umd/index.d.ts +12 -12
  76. package/umd/index.js +28 -28
  77. package/umd/load-more/index.d.ts +5 -0
  78. package/umd/load-more/index.js +2 -1
  79. package/umd/masking/index.d.ts +2 -2
  80. package/umd/masking/index.js +4 -2
  81. package/umd/notify/index.d.ts +8 -8
  82. package/umd/popover/popover.js +10 -2
  83. package/umd/popup/index.d.ts +2 -2
  84. package/umd/popup-swiper/index.d.ts +2 -2
  85. package/umd/show-monitor/index.js +4 -3
  86. package/umd/slider/hooks/index.d.ts +1 -1
  87. package/umd/slider/popover.js +6 -2
  88. package/umd/stepper/hooks/useButtonClick.js +8 -9
  89. package/umd/style.d.ts +13 -13
  90. package/umd/style.js +2 -2
  91. package/umd/toast/index.d.ts +12 -12
  92. package/umd/toast/index.js +5 -2
@@ -269,9 +269,9 @@ declare const _default: React.ForwardRefExoticComponent<ImagePreviewProps & Reac
269
269
  * @param {ImagePreviewProps} config configuration
270
270
  * @returns {{ close: () => void; update: (newConfig: ImagePreviewProps) => void; }}
271
271
  */
272
- open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "getContainer" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
272
+ open: (config: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">, context?: import("../context-provider").GlobalContextParams | undefined) => {
273
273
  close: () => void;
274
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "getContainer" | "onClose" | "onTouchMove" | "fit" | "loadingArea" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "onChange" | "onTouchEnd" | "onTouchStart" | "animateDurationSlide" | "loop" | "swipeable" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "lazyloadCount" | "onAfterChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
274
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<ImagePreviewProps & React.RefAttributes<ImagePreviewRef>>, "style" | "ref" | "key" | "context" | "className" | "swipeable" | "lazyloadCount" | "onChange" | "onAfterChange" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "loadingArea" | "onClose" | "fit" | "errorArea" | "showLoading" | "showError" | "retryTime" | "staticLabel" | "animateDurationSlide" | "loop" | "renderIndicator" | "indicatorPos" | "showIndicator" | "hideSingleIndicator" | "spaceBetween" | "percentToChange" | "distanceToChange" | "speedToChange" | "images" | "openIndex" | "displayDuration" | "replaceFallbackWhenLoaded" | "noselect" | "scrollBezier" | "swipeToClose" | "getMinScale" | "getMaxScale" | "getDoubleClickScale" | "getThumbBounds" | "onImageClick" | "onImageDoubleClick" | "onImageLongTap">) => void;
275
275
  };
276
276
  };
277
277
  /**
@@ -875,7 +875,8 @@ var ImagePreview = /*#__PURE__*/forwardRef(function (props, ref) {
875
875
  timeout: displayDuration,
876
876
  type: "fade",
877
877
  mountOnEnter: true,
878
- unmountOnExit: true
878
+ unmountOnExit: true,
879
+ nodeRef: domRef
879
880
  }, /*#__PURE__*/React.createElement("div", {
880
881
  className: cls(prefixCls + "-image-preview", 'all-border-box', {
881
882
  noselect: noselect
@@ -46,6 +46,9 @@
46
46
  height: 100%;
47
47
  will-change: transform;
48
48
  }
49
+ .arco-image-preview .preview-image .image-container {
50
+ overflow: visible;
51
+ }
49
52
  .arco-image-preview .preview-image.preview-hidden {
50
53
  pointer-events: none;
51
54
  }
@@ -41,6 +41,10 @@
41
41
  height: 100%;
42
42
  will-change: transform;
43
43
 
44
+ .image-container {
45
+ overflow: visible;
46
+ }
47
+
44
48
  &.preview-hidden {
45
49
  pointer-events: none;
46
50
 
@@ -1,9 +1,8 @@
1
1
  import { Children, isValidElement } from 'react';
2
- import { IndexBarGroup } from './group';
3
2
  export function filterValidIndexBarChild(children) {
4
3
  var validChildren = [];
5
4
  Children.forEach(children, function (child) {
6
- if (! /*#__PURE__*/isValidElement(child) || child.type !== IndexBarGroup) {
5
+ if (! /*#__PURE__*/isValidElement(child)) {
7
6
  console.warn('<IndexBar /> only accept <IndexBar.Group /> as the children');
8
7
  return;
9
8
  }
package/esm/index.d.ts CHANGED
@@ -1,34 +1,31 @@
1
- export { default as Button } from './button';
1
+ export { default as Tabs } from './tabs';
2
+ export { default as Sticky } from './sticky';
3
+ export { default as LoadMore } from './load-more';
4
+ export { default as Cell } from './cell';
2
5
  export { default as ActionSheet } from './action-sheet';
3
6
  export { default as Avatar } from './avatar';
4
7
  export { default as Badge } from './badge';
8
+ export { default as Button } from './button';
5
9
  export { default as Carousel } from './carousel';
6
- export { default as Cell } from './cell';
7
10
  export { default as Checkbox } from './checkbox';
8
11
  export { default as CircleProgress } from './circle-progress';
9
12
  export { default as Collapse } from './collapse';
10
13
  export { default as ContextProvider } from './context-provider';
11
14
  export { default as CountDown } from './count-down';
12
15
  export { default as DatePicker } from './date-picker';
13
- export { default as Divider } from './divider';
14
16
  export { default as Dialog } from './dialog';
17
+ export { default as Divider } from './divider';
15
18
  export { default as Dropdown } from './dropdown';
16
19
  export { default as DropdownMenu } from './dropdown-menu';
17
20
  export { default as Ellipsis } from './ellipsis';
18
21
  export { default as Form } from './form';
19
- export { default as Input } from './input';
20
- export { default as Textarea } from './textarea';
21
- export { default as Radio } from './radio';
22
- export { default as Rate } from './rate';
23
- export { default as Slider } from './slider';
24
22
  export { default as Grid } from './grid';
25
23
  export { default as Image } from './image';
26
- export { default as ShowMonitor } from './show-monitor';
27
24
  export { default as ImagePicker } from './image-picker';
28
25
  export { default as ImagePreview } from './image-preview';
29
26
  export { default as IndexBar } from './index-bar';
27
+ export { default as Input } from './input';
30
28
  export { default as Keyboard } from './keyboard';
31
- export { default as LoadMore } from './load-more';
32
29
  export { default as Loading } from './loading';
33
30
  export { default as Masking } from './masking';
34
31
  export { default as NavBar } from './nav-bar';
@@ -43,15 +40,18 @@ export { default as PopupSwiper } from './popup-swiper';
43
40
  export { default as Portal } from './portal';
44
41
  export { default as Progress } from './progress';
45
42
  export { default as PullRefresh } from './pull-refresh';
43
+ export { default as Radio } from './radio';
44
+ export { default as Rate } from './rate';
46
45
  export { default as SearchBar } from './search-bar';
46
+ export { default as ShowMonitor } from './show-monitor';
47
+ export { default as Slider } from './slider';
47
48
  export { default as Stepper } from './stepper';
48
49
  export { default as Steps } from './steps';
49
- export { default as Sticky } from './sticky';
50
50
  export { default as SwipeAction } from './swipe-action';
51
51
  export { default as SwipeLoad } from './swipe-load';
52
52
  export { default as Switch } from './switch';
53
53
  export { default as TabBar } from './tab-bar';
54
- export { default as Tabs } from './tabs';
55
54
  export { default as Tag } from './tag';
55
+ export { default as Textarea } from './textarea';
56
56
  export { default as Toast } from './toast';
57
57
  export { default as Transition } from './transition';
package/esm/index.js CHANGED
@@ -1,34 +1,31 @@
1
- export { default as Button } from './button';
1
+ export { default as Tabs } from './tabs';
2
+ export { default as Sticky } from './sticky';
3
+ export { default as LoadMore } from './load-more';
4
+ export { default as Cell } from './cell';
2
5
  export { default as ActionSheet } from './action-sheet';
3
6
  export { default as Avatar } from './avatar';
4
7
  export { default as Badge } from './badge';
8
+ export { default as Button } from './button';
5
9
  export { default as Carousel } from './carousel';
6
- export { default as Cell } from './cell';
7
10
  export { default as Checkbox } from './checkbox';
8
11
  export { default as CircleProgress } from './circle-progress';
9
12
  export { default as Collapse } from './collapse';
10
13
  export { default as ContextProvider } from './context-provider';
11
14
  export { default as CountDown } from './count-down';
12
15
  export { default as DatePicker } from './date-picker';
13
- export { default as Divider } from './divider';
14
16
  export { default as Dialog } from './dialog';
17
+ export { default as Divider } from './divider';
15
18
  export { default as Dropdown } from './dropdown';
16
19
  export { default as DropdownMenu } from './dropdown-menu';
17
20
  export { default as Ellipsis } from './ellipsis';
18
21
  export { default as Form } from './form';
19
- export { default as Input } from './input';
20
- export { default as Textarea } from './textarea';
21
- export { default as Radio } from './radio';
22
- export { default as Rate } from './rate';
23
- export { default as Slider } from './slider';
24
22
  export { default as Grid } from './grid';
25
23
  export { default as Image } from './image';
26
- export { default as ShowMonitor } from './show-monitor';
27
24
  export { default as ImagePicker } from './image-picker';
28
25
  export { default as ImagePreview } from './image-preview';
29
26
  export { default as IndexBar } from './index-bar';
27
+ export { default as Input } from './input';
30
28
  export { default as Keyboard } from './keyboard';
31
- export { default as LoadMore } from './load-more';
32
29
  export { default as Loading } from './loading';
33
30
  export { default as Masking } from './masking';
34
31
  export { default as NavBar } from './nav-bar';
@@ -43,15 +40,18 @@ export { default as PopupSwiper } from './popup-swiper';
43
40
  export { default as Portal } from './portal';
44
41
  export { default as Progress } from './progress';
45
42
  export { default as PullRefresh } from './pull-refresh';
43
+ export { default as Radio } from './radio';
44
+ export { default as Rate } from './rate';
46
45
  export { default as SearchBar } from './search-bar';
46
+ export { default as ShowMonitor } from './show-monitor';
47
+ export { default as Slider } from './slider';
47
48
  export { default as Stepper } from './stepper';
48
49
  export { default as Steps } from './steps';
49
- export { default as Sticky } from './sticky';
50
50
  export { default as SwipeAction } from './swipe-action';
51
51
  export { default as SwipeLoad } from './swipe-load';
52
52
  export { default as Switch } from './switch';
53
53
  export { default as TabBar } from './tab-bar';
54
- export { default as Tabs } from './tabs';
55
54
  export { default as Tag } from './tag';
55
+ export { default as Textarea } from './textarea';
56
56
  export { default as Toast } from './toast';
57
57
  export { default as Transition } from './transition';
@@ -62,6 +62,11 @@ export interface LoadMoreProps {
62
62
  * @default () => window
63
63
  */
64
64
  getScrollContainer?: () => HTMLElement | Window | null;
65
+ /**
66
+ * 当多个 loadmore 在同一页面时,通过传入节点的 offsetHeight + offsetTop 代替 scrollHeight
67
+ * @en When multiple loadmores are on the same page, pass in the offsetHeight + offsetTop of the node instead of scrollHeight
68
+ */
69
+ getOffsetNode?: () => HTMLElement | Window | null;
65
70
  /**
66
71
  * 触发loading的时机,当为click时,点击后将触发getData
67
72
  * @en The timing of triggering loading, when it is click, getData will be triggered after clicking
@@ -25,6 +25,7 @@ var LoadMore = /*#__PURE__*/forwardRef(function (props, ref) {
25
25
  defaultStatus = _props$defaultStatus === void 0 ? 'prepare' : _props$defaultStatus,
26
26
  status = props.status,
27
27
  getScrollContainer = props.getScrollContainer,
28
+ getOffsetNode = props.getOffsetNode,
28
29
  _props$trigger = props.trigger,
29
30
  trigger = _props$trigger === void 0 ? 'scroll' : _props$trigger,
30
31
  _props$threshold = props.threshold,
@@ -127,7 +128,7 @@ var LoadMore = /*#__PURE__*/forwardRef(function (props, ref) {
127
128
  }, [changeStatus]);
128
129
 
129
130
  function checkNeedTrigger(top, ths) {
130
- var scrollHeight = getScrollContainerAttribute('scrollHeight', getScrollContainer);
131
+ var scrollHeight = getOffsetNode ? getScrollContainerAttribute('offsetHeight', getOffsetNode) + getScrollContainerAttribute('offsetTop', getOffsetNode) : getScrollContainerAttribute('scrollHeight', getScrollContainer);
131
132
  var clientHeight = getScrollContainerAttribute('clientHeight', getScrollContainer);
132
133
  return scrollHeight - top - clientHeight <= ths;
133
134
  }
@@ -205,11 +205,11 @@ declare const _default: React.ForwardRefExoticComponent<MaskingProps & React.Ref
205
205
  * @param {MaskingProps} config Configuration
206
206
  * @returns {{ close: () => void; update: (newConfig: MaskingProps) => void; }}
207
207
  */
208
- open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
208
+ open: (config: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove"> & {
209
209
  key?: string | undefined;
210
210
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
211
211
  close: () => void;
212
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer"> & {
212
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<MaskingProps & React.RefAttributes<MaskingRef>>, "children" | "ref" | "key" | "context" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "contentAtCenter" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove"> & {
213
213
  key?: string | undefined;
214
214
  }) => void;
215
215
  };
@@ -156,7 +156,8 @@ var Masking = /*#__PURE__*/forwardRef(function (props, ref) {
156
156
  timeout: maskTransitionTimeout,
157
157
  type: maskTransitionType,
158
158
  mountOnEnter: mountOnEnter,
159
- unmountOnExit: unmountOnExit
159
+ unmountOnExit: unmountOnExit,
160
+ nodeRef: maskRef
160
161
  }, /*#__PURE__*/React.createElement("div", {
161
162
  ref: maskRef,
162
163
  className: cls(prefixCls + "-masking-mask", extraClass, maskClass),
@@ -167,7 +168,8 @@ var Masking = /*#__PURE__*/forwardRef(function (props, ref) {
167
168
  timeout: contentTransitionTimeout,
168
169
  type: contentTransitionType,
169
170
  mountOnEnter: mountOnEnter,
170
- unmountOnExit: unmountOnExit
171
+ unmountOnExit: unmountOnExit,
172
+ nodeRef: contentRef
171
173
  }, /*#__PURE__*/React.createElement("div", {
172
174
  ref: contentRef,
173
175
  className: cls(prefixCls + "-masking-content", {
@@ -51,8 +51,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
51
51
  * @param {string | NotifyProps} config
52
52
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
53
53
  */
54
- info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
54
+ info: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
55
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
56
56
  close: () => void;
57
57
  };
58
58
  /**
@@ -61,8 +61,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
61
61
  * @param {string | NotifyProps} config
62
62
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
63
63
  */
64
- success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
64
+ success: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
65
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
66
66
  close: () => void;
67
67
  };
68
68
  /**
@@ -71,8 +71,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
71
71
  * @param {string | NotifyProps} config
72
72
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
73
73
  */
74
- error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
74
+ error: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
75
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
76
76
  close: () => void;
77
77
  };
78
78
  /**
@@ -81,8 +81,8 @@ declare const _default: React.ForwardRefExoticComponent<NotifyProps & React.RefA
81
81
  * @param {string | NotifyProps} config
82
82
  * @returns {{ update: (config: NotifyProps) => void; close: () => void }}
83
83
  */
84
- warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "className" | "duration" | "getContainer" | "onClose">) => void;
84
+ warn: (originConfig: string | Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">, context?: import("../context-provider").GlobalContextParams | undefined) => {
85
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<NotifyProps & React.RefAttributes<NotifyRef>>, "style" | "content" | "transitionDuration" | "ref" | "key" | "type" | "context" | "duration" | "className" | "getContainer" | "onClose">) => void;
86
86
  close: () => void;
87
87
  };
88
88
  };
@@ -66,6 +66,8 @@ export var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
66
66
  var wrapperRef = useRef(null);
67
67
  var childRef = useRef(null);
68
68
  var popoverRef = useRef(null);
69
+ var transitionNodeRef = useRef(null);
70
+ var maskRef = useRef(null);
69
71
 
70
72
  var _usePosition = usePosition(props, popoverRef, childRef, wrapperRef),
71
73
  direction = _usePosition.direction,
@@ -197,7 +199,10 @@ export var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
197
199
  className: cls(theme + "-theme", innerPopoverClassName, {
198
200
  bordered: bordered
199
201
  }),
200
- ref: popoverRef,
202
+ ref: function ref(ele) {
203
+ popoverRef.current = ele;
204
+ transitionNodeRef.current = ele == null ? void 0 : ele.dom;
205
+ },
201
206
  direction: direction,
202
207
  minWidth: minWidth,
203
208
  maxWidth: maxWidth,
@@ -225,6 +230,7 @@ export var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
225
230
  in: visibleState && !isCalcPosition,
226
231
  timeout: transitionTimeout,
227
232
  type: transitionName,
233
+ nodeRef: transitionNodeRef,
228
234
  mountOnEnter: true,
229
235
  unmountOnExit: true
230
236
  }, renderInnerPopover()));
@@ -233,12 +239,14 @@ export var Popover = /*#__PURE__*/forwardRef(function (props, ref) {
233
239
  return /*#__PURE__*/React.createElement(React.Fragment, null, showMask && /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Transition, {
234
240
  in: visibleState && !isCalcPosition,
235
241
  timeout: maskTransitionTimeout,
242
+ nodeRef: maskRef,
236
243
  type: "fade",
237
244
  mountOnEnter: true,
238
245
  unmountOnExit: true
239
246
  }, /*#__PURE__*/React.createElement("div", {
240
247
  className: prefixCls + "-popover-mask",
241
- onClick: onClickMask
248
+ onClick: onClickMask,
249
+ ref: maskRef
242
250
  }))), /*#__PURE__*/React.createElement("div", {
243
251
  className: cls(prefixCls + "-popover", className, theme + "-theme", mode + "-mode", {
244
252
  bordered: bordered,
@@ -66,11 +66,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupProps & React.RefAt
66
66
  * @param {PopupProps} config Configuration
67
67
  * @returns {{ close: () => void; update: (newConfig: PopupProps) => void; }}
68
68
  */
69
- open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
69
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
70
70
  key?: string | undefined;
71
71
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
72
72
  close: () => void;
73
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ"> & {
73
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupProps & React.RefAttributes<PopupRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchMove" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset"> & {
74
74
  key?: string | undefined;
75
75
  }) => void;
76
76
  };
@@ -76,11 +76,11 @@ declare const _default: React.ForwardRefExoticComponent<PopupSwiperProps & React
76
76
  * @param {string | PopupSwiperProps} config Configuration
77
77
  * @returns {{ close: () => void; update: (newConfig: PopupSwiperProps) => void; }}
78
78
  */
79
- open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ" | "onTouchEnd" | "onTouchStart" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
79
+ open: (config: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
80
80
  key?: string | undefined;
81
81
  }, context?: import("../context-provider").GlobalContextParams | undefined) => {
82
82
  close: () => void;
83
- update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "className" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onTouchMove" | "onPreventTouchMove" | "getScrollContainer" | "needBottomOffset" | "translateZ" | "onTouchEnd" | "onTouchStart" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
83
+ update: (newConfig: Pick<import("../context-provider").WithGlobalContext<PopupSwiperProps & React.RefAttributes<PopupSwiperRef>>, "direction" | "children" | "ref" | "key" | "context" | "translateZ" | "className" | "getScrollContainer" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "getContainer" | "mountOnEnter" | "unmountOnExit" | "onClose" | "maskClass" | "maskStyle" | "contentClass" | "contentStyle" | "maskTransitionType" | "contentTransitionType" | "maskTransitionTimeout" | "contentTransitionTimeout" | "maskClosable" | "animatingClosable" | "orientationDirection" | "preventBodyScroll" | "initialBodyOverflow" | "gestureOutOfControl" | "onOpen" | "onMaskClick" | "onPreventTouchMove" | "needBottomOffset" | "percentToClose" | "distanceToClose" | "speedToClose" | "allowSwipeDirections" | "exitDirection"> & {
84
84
  key?: string | undefined;
85
85
  }) => void; /**
86
86
  * 内容面板 touchstart 事件,返回true时表示阻止本组件内部处理事件
@@ -217,8 +217,9 @@ var ShowMonitor = /*#__PURE__*/forwardRef(function (props, ref) {
217
217
  onOnceEmittedListeners[key] = [];
218
218
  }, []);
219
219
 
220
- function handleCheckChildrenExist() {
221
- return isChildrenExist.current && domRef.current && domRef.current.children.length;
220
+ function handleCheckChildrenExist(target) {
221
+ var dom = target || domRef.current;
222
+ return isChildrenExist.current && (dom == null ? void 0 : dom.children.length);
222
223
  }
223
224
 
224
225
  function handleObserverStatusChange(entries) {
@@ -238,7 +239,7 @@ var ShowMonitor = /*#__PURE__*/forwardRef(function (props, ref) {
238
239
  * @en Callback when the visible status of current element changes before the comparison
239
240
  */
240
241
 
241
- isIntersecting !== curVisible && handleCheckChildrenExist() && onCompVisibleChange(isIntersecting, target);
242
+ isIntersecting !== curVisible && handleCheckChildrenExist(target) && onCompVisibleChange(isIntersecting, target);
242
243
  /**
243
244
  * 当前元素状态由不可见变为可见,且只触发一次
244
245
  * @en The current element is invisible -> visible, and once, triggers the callback
@@ -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" | "min" | "onAfterChange" | "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">>;
9
9
  export * from './useSliderIcon';
10
10
  export * from './useSliderInit';
11
11
  export * from './useSliderStyle';
@@ -1,4 +1,4 @@
1
- import React, { useContext } from 'react';
1
+ import React, { useContext, useRef } from 'react';
2
2
  import Transition from '../transition';
3
3
  import { GlobalContext } from '../context-provider';
4
4
  export function Popover(_ref) {
@@ -10,15 +10,19 @@ export function Popover(_ref) {
10
10
  _useContext$prefixCls = _useContext.prefixCls,
11
11
  prefixCls = _useContext$prefixCls === void 0 ? '' : _useContext$prefixCls;
12
12
 
13
+ var domRef = useRef(null);
13
14
  return /*#__PURE__*/React.createElement("div", {
14
15
  className: prefixCls + "-slider-popover-wrapper"
15
16
  }, /*#__PURE__*/React.createElement(Transition, {
16
17
  in: visible,
17
18
  timeout: 300,
18
19
  type: "fade",
19
- mountOnEnter: true
20
+ mountOnEnter: true,
21
+ unmountOnExit: true,
22
+ nodeRef: domRef
20
23
  }, /*#__PURE__*/React.createElement("div", {
21
- className: prefixCls + "-slider-popover" + (content ? '' : ' no-content')
24
+ className: prefixCls + "-slider-popover" + (content ? '' : ' no-content'),
25
+ ref: domRef
22
26
  }, /*#__PURE__*/React.createElement("div", {
23
27
  className: prefixCls + "-slider-popover-content"
24
28
  }, content), /*#__PURE__*/React.createElement("div", {
@@ -17,16 +17,15 @@ export default function useButtonClick(params) {
17
17
  updateValue = params.updateValue,
18
18
  onAddButtonClick = params.onAddButtonClick,
19
19
  onMinusButtonClick = params.onMinusButtonClick;
20
+ var minusDisable = actualInputValue <= min || disabled;
20
21
 
21
- var _useState = useState(function () {
22
- return actualInputValue === min || disabled;
23
- }),
22
+ var _useState = useState(minusDisable),
24
23
  minusButtonDisable = _useState[0],
25
24
  setMinusButtonDisable = _useState[1];
26
25
 
27
- var _useState2 = useState(function () {
28
- return actualInputValue === max || disabled;
29
- }),
26
+ var addDisable = actualInputValue >= max || disabled;
27
+
28
+ var _useState2 = useState(addDisable),
30
29
  addButtonDisable = _useState2[0],
31
30
  setAddButtonDisable = _useState2[1];
32
31
 
@@ -57,9 +56,9 @@ export default function useButtonClick(params) {
57
56
 
58
57
 
59
58
  useEffect(function () {
60
- setMinusButtonDisable(actualInputValue <= min);
61
- setAddButtonDisable(actualInputValue >= max);
62
- }, [actualInputValue]);
59
+ setMinusButtonDisable(minusDisable);
60
+ setAddButtonDisable(addDisable);
61
+ }, [minusDisable, addDisable]);
63
62
  return {
64
63
  minusButtonDisable: minusButtonDisable,
65
64
  addButtonDisable: addButtonDisable,
package/esm/style.d.ts CHANGED
@@ -1,35 +1,32 @@
1
1
  import '../style/public.less';
2
- import './button/style';
2
+ import './tabs/style';
3
+ import './sticky/style';
4
+ import './load-more/style';
5
+ import './cell/style';
3
6
  import './action-sheet/style';
4
7
  import './avatar/style';
5
8
  import './badge/style';
9
+ import './button/style';
6
10
  import './carousel/style';
7
- import './cell/style';
8
11
  import './checkbox/style';
9
12
  import './circle-progress/style';
10
13
  import './collapse/style';
11
14
  import './context-provider/style';
12
15
  import './count-down/style';
13
16
  import './date-picker/style';
14
- import './divider/style';
15
17
  import './dialog/style';
18
+ import './divider/style';
16
19
  import './dropdown/style';
17
20
  import './dropdown-menu/style';
18
21
  import './ellipsis/style';
19
22
  import './form/style';
20
- import './input/style';
21
- import './textarea/style';
22
- import './radio/style';
23
- import './image-picker/style';
24
- import './rate/style';
25
- import './slider/style';
26
23
  import './grid/style';
27
24
  import './image/style';
28
- import './show-monitor/style';
25
+ import './image-picker/style';
29
26
  import './image-preview/style';
30
27
  import './index-bar/style';
28
+ import './input/style';
31
29
  import './keyboard/style';
32
- import './load-more/style';
33
30
  import './loading/style';
34
31
  import './masking/style';
35
32
  import './nav-bar/style';
@@ -44,15 +41,18 @@ import './popup-swiper/style';
44
41
  import './portal/style';
45
42
  import './progress/style';
46
43
  import './pull-refresh/style';
44
+ import './radio/style';
45
+ import './rate/style';
47
46
  import './search-bar/style';
47
+ import './show-monitor/style';
48
+ import './slider/style';
48
49
  import './stepper/style';
49
50
  import './steps/style';
50
- import './sticky/style';
51
51
  import './swipe-action/style';
52
52
  import './swipe-load/style';
53
53
  import './switch/style';
54
54
  import './tab-bar/style';
55
- import './tabs/style';
56
55
  import './tag/style';
56
+ import './textarea/style';
57
57
  import './toast/style';
58
58
  import './transition/style';