antd-mobile 5.2.0 → 5.2.1

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 (171) hide show
  1. package/2x/cjs/components/calendar/calendar.d.ts +1 -28
  2. package/2x/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  3. package/2x/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
  4. package/2x/cjs/components/cascade-picker/prompt.d.ts +2 -1
  5. package/2x/cjs/components/collapse/collapse.js +5 -3
  6. package/2x/cjs/components/date-picker/date-picker.js +11 -1
  7. package/2x/cjs/components/dropdown/item.js +2 -2
  8. package/2x/cjs/components/form/form.d.ts +2 -2
  9. package/2x/cjs/components/form/index.d.ts +2 -2
  10. package/2x/cjs/components/image-viewer/image-viewer.d.ts +1 -1
  11. package/2x/cjs/components/image-viewer/index.d.ts +1 -1
  12. package/2x/cjs/components/input/input.d.ts +2 -2
  13. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  14. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
  15. package/2x/cjs/components/mask/mask.js +2 -2
  16. package/2x/cjs/components/passcode-input/passcode-input.d.ts +1 -1
  17. package/2x/cjs/components/picker/prompt.d.ts +2 -2
  18. package/2x/cjs/components/popover/index.d.ts +3 -3
  19. package/2x/cjs/components/popover/popover-menu.d.ts +1 -1
  20. package/2x/cjs/components/popover/popover.d.ts +1 -1
  21. package/2x/cjs/components/popup/popup.js +2 -2
  22. package/2x/cjs/components/search-bar/search-bar.js +1 -0
  23. package/2x/cjs/components/selector/selector.d.ts +3 -1
  24. package/2x/cjs/components/stepper/stepper.d.ts +11 -2
  25. package/2x/cjs/components/swiper/index.d.ts +3 -3
  26. package/2x/cjs/components/swiper/swiper.d.ts +3 -3
  27. package/2x/cjs/components/tabs/tabs.d.ts +1 -0
  28. package/2x/cjs/components/tabs/tabs.js +17 -19
  29. package/2x/cjs/components/virtual-input/virtual-input.d.ts +2 -2
  30. package/2x/cjs/utils/measure-css-length.js +3 -1
  31. package/2x/cjs/utils/native-props.d.ts +1 -1
  32. package/2x/cjs/utils/render-to-container.d.ts +1 -1
  33. package/2x/cjs/utils/should-render.d.ts +10 -0
  34. package/{cjs/utils/use-should-render.js → 2x/cjs/utils/should-render.js} +8 -0
  35. package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -2
  36. package/2x/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
  37. package/2x/cjs/utils/use-props-value.d.ts +1 -1
  38. package/2x/cjs/utils/use-tab-list-scroll.js +3 -1
  39. package/2x/cjs/utils/use-touch.d.ts +0 -1
  40. package/2x/cjs/utils/validate.js +1 -1
  41. package/2x/cjs/utils/with-stop-propagation.d.ts +1 -1
  42. package/2x/es/components/calendar/calendar.d.ts +1 -28
  43. package/2x/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  44. package/2x/es/components/capsule-tabs/capsule-tabs.js +13 -17
  45. package/2x/es/components/cascade-picker/prompt.d.ts +2 -1
  46. package/2x/es/components/collapse/collapse.js +4 -3
  47. package/2x/es/components/date-picker/date-picker.js +10 -1
  48. package/2x/es/components/dropdown/item.js +1 -1
  49. package/2x/es/components/form/form.d.ts +2 -2
  50. package/2x/es/components/form/index.d.ts +2 -2
  51. package/2x/es/components/image-viewer/image-viewer.d.ts +1 -1
  52. package/2x/es/components/image-viewer/index.d.ts +1 -1
  53. package/2x/es/components/input/input.d.ts +2 -2
  54. package/2x/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  55. package/2x/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
  56. package/2x/es/components/mask/mask.js +1 -1
  57. package/2x/es/components/passcode-input/passcode-input.d.ts +1 -1
  58. package/2x/es/components/picker/prompt.d.ts +2 -2
  59. package/2x/es/components/popover/index.d.ts +3 -3
  60. package/2x/es/components/popover/popover-menu.d.ts +1 -1
  61. package/2x/es/components/popover/popover.d.ts +1 -1
  62. package/2x/es/components/popup/popup.js +1 -1
  63. package/2x/es/components/search-bar/search-bar.js +1 -0
  64. package/2x/es/components/selector/selector.d.ts +3 -1
  65. package/2x/es/components/stepper/stepper.d.ts +11 -2
  66. package/2x/es/components/swiper/index.d.ts +3 -3
  67. package/2x/es/components/swiper/swiper.d.ts +3 -3
  68. package/2x/es/components/tabs/tabs.d.ts +1 -0
  69. package/2x/es/components/tabs/tabs.js +16 -20
  70. package/2x/es/components/virtual-input/virtual-input.d.ts +2 -2
  71. package/2x/es/utils/measure-css-length.js +3 -1
  72. package/2x/es/utils/native-props.d.ts +1 -1
  73. package/2x/es/utils/render-to-container.d.ts +1 -1
  74. package/2x/es/utils/should-render.d.ts +10 -0
  75. package/{es/utils/use-should-render.js → 2x/es/utils/should-render.js} +4 -0
  76. package/2x/es/utils/use-drag-and-pinch.d.ts +1 -2
  77. package/2x/es/utils/use-isomorphic-update-layout-effect.js +1 -2
  78. package/2x/es/utils/use-props-value.d.ts +1 -1
  79. package/2x/es/utils/use-tab-list-scroll.js +3 -2
  80. package/2x/es/utils/use-touch.d.ts +0 -1
  81. package/2x/es/utils/validate.js +1 -1
  82. package/2x/es/utils/with-stop-propagation.d.ts +1 -1
  83. package/2x/package.json +4 -4
  84. package/cjs/components/calendar/calendar.d.ts +1 -28
  85. package/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  86. package/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
  87. package/cjs/components/cascade-picker/prompt.d.ts +2 -1
  88. package/cjs/components/collapse/collapse.js +5 -3
  89. package/cjs/components/date-picker/date-picker.js +11 -1
  90. package/cjs/components/dropdown/item.js +2 -2
  91. package/cjs/components/form/form.d.ts +2 -2
  92. package/cjs/components/form/index.d.ts +2 -2
  93. package/cjs/components/image-viewer/image-viewer.d.ts +1 -1
  94. package/cjs/components/image-viewer/index.d.ts +1 -1
  95. package/cjs/components/input/input.d.ts +2 -2
  96. package/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  97. package/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
  98. package/cjs/components/mask/mask.js +2 -2
  99. package/cjs/components/passcode-input/passcode-input.d.ts +1 -1
  100. package/cjs/components/picker/prompt.d.ts +2 -2
  101. package/cjs/components/popover/index.d.ts +3 -3
  102. package/cjs/components/popover/popover-menu.d.ts +1 -1
  103. package/cjs/components/popover/popover.d.ts +1 -1
  104. package/cjs/components/popup/popup.js +2 -2
  105. package/cjs/components/search-bar/search-bar.js +1 -0
  106. package/cjs/components/selector/selector.d.ts +3 -1
  107. package/cjs/components/stepper/stepper.d.ts +11 -2
  108. package/cjs/components/swiper/index.d.ts +3 -3
  109. package/cjs/components/swiper/swiper.d.ts +3 -3
  110. package/cjs/components/tabs/tabs.d.ts +1 -0
  111. package/cjs/components/tabs/tabs.js +17 -19
  112. package/cjs/components/virtual-input/virtual-input.d.ts +2 -2
  113. package/cjs/utils/measure-css-length.js +3 -1
  114. package/cjs/utils/native-props.d.ts +1 -1
  115. package/cjs/utils/render-to-container.d.ts +1 -1
  116. package/cjs/utils/should-render.d.ts +10 -0
  117. package/{2x/cjs/utils/use-should-render.js → cjs/utils/should-render.js} +8 -0
  118. package/cjs/utils/use-drag-and-pinch.d.ts +1 -2
  119. package/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
  120. package/cjs/utils/use-props-value.d.ts +1 -1
  121. package/cjs/utils/use-tab-list-scroll.js +3 -1
  122. package/cjs/utils/use-touch.d.ts +0 -1
  123. package/cjs/utils/validate.js +1 -1
  124. package/cjs/utils/with-stop-propagation.d.ts +1 -1
  125. package/es/components/calendar/calendar.d.ts +1 -28
  126. package/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
  127. package/es/components/capsule-tabs/capsule-tabs.js +13 -17
  128. package/es/components/cascade-picker/prompt.d.ts +2 -1
  129. package/es/components/collapse/collapse.js +4 -3
  130. package/es/components/date-picker/date-picker.js +10 -1
  131. package/es/components/dropdown/item.js +1 -1
  132. package/es/components/form/form.d.ts +2 -2
  133. package/es/components/form/index.d.ts +2 -2
  134. package/es/components/image-viewer/image-viewer.d.ts +1 -1
  135. package/es/components/image-viewer/index.d.ts +1 -1
  136. package/es/components/input/input.d.ts +2 -2
  137. package/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
  138. package/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
  139. package/es/components/mask/mask.js +1 -1
  140. package/es/components/passcode-input/passcode-input.d.ts +1 -1
  141. package/es/components/picker/prompt.d.ts +2 -2
  142. package/es/components/popover/index.d.ts +3 -3
  143. package/es/components/popover/popover-menu.d.ts +1 -1
  144. package/es/components/popover/popover.d.ts +1 -1
  145. package/es/components/popup/popup.js +1 -1
  146. package/es/components/search-bar/search-bar.js +1 -0
  147. package/es/components/selector/selector.d.ts +3 -1
  148. package/es/components/stepper/stepper.d.ts +11 -2
  149. package/es/components/swiper/index.d.ts +3 -3
  150. package/es/components/swiper/swiper.d.ts +3 -3
  151. package/es/components/tabs/tabs.d.ts +1 -0
  152. package/es/components/tabs/tabs.js +16 -20
  153. package/es/components/virtual-input/virtual-input.d.ts +2 -2
  154. package/es/utils/measure-css-length.js +3 -1
  155. package/es/utils/native-props.d.ts +1 -1
  156. package/es/utils/render-to-container.d.ts +1 -1
  157. package/es/utils/should-render.d.ts +10 -0
  158. package/{2x/es/utils/use-should-render.js → es/utils/should-render.js} +4 -0
  159. package/es/utils/use-drag-and-pinch.d.ts +1 -2
  160. package/es/utils/use-isomorphic-update-layout-effect.js +1 -2
  161. package/es/utils/use-props-value.d.ts +1 -1
  162. package/es/utils/use-tab-list-scroll.js +3 -2
  163. package/es/utils/use-touch.d.ts +0 -1
  164. package/es/utils/validate.js +1 -1
  165. package/es/utils/with-stop-propagation.d.ts +1 -1
  166. package/package.json +4 -4
  167. package/umd/antd-mobile.js +1 -1
  168. package/2x/cjs/utils/use-should-render.d.ts +0 -1
  169. package/2x/es/utils/use-should-render.d.ts +0 -1
  170. package/cjs/utils/use-should-render.d.ts +0 -1
  171. package/es/utils/use-should-render.d.ts +0 -1
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
- export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: {} | Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => Pick<import("react").DOMAttributes<EventTarget>, "onClick" | "onChange" | "onPause" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">;
1
+ export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: {} | Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react").ReactDOMAttributes;
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useIsomorphicUpdateLayoutEffect = void 0;
7
7
 
8
- var _createUpdateEffect = require("ahooks/lib/createUpdateEffect");
9
-
10
8
  var _ahooks = require("ahooks");
11
9
 
12
- const useIsomorphicUpdateLayoutEffect = (0, _createUpdateEffect.createUpdateEffect)(_ahooks.useIsomorphicLayoutEffect);
10
+ const useIsomorphicUpdateLayoutEffect = (0, _ahooks.createUpdateEffect)(_ahooks.useIsomorphicLayoutEffect);
13
11
  exports.useIsomorphicUpdateLayoutEffect = useIsomorphicUpdateLayoutEffect;
@@ -3,5 +3,5 @@ declare type Options<T> = {
3
3
  defaultValue: T;
4
4
  onChange?: (v: T) => void;
5
5
  };
6
- export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: T) => void];
6
+ export declare function usePropsValue<T>(options: Options<T>): readonly [T, (this: unknown, v: T) => void];
7
7
  export {};
@@ -13,6 +13,8 @@ var _bound = require("./bound");
13
13
 
14
14
  var _ahooks = require("ahooks");
15
15
 
16
+ var _useIsomorphicUpdateLayoutEffect = require("./use-isomorphic-update-layout-effect");
17
+
16
18
  const useTabListScroll = (targetRef, activeIndex) => {
17
19
  const [{
18
20
  scrollLeft
@@ -50,7 +52,7 @@ const useTabListScroll = (targetRef, activeIndex) => {
50
52
  (0, _ahooks.useIsomorphicLayoutEffect)(() => {
51
53
  animate(true);
52
54
  }, []);
53
- (0, _ahooks.useUpdateLayoutEffect)(() => {
55
+ (0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(() => {
54
56
  animate();
55
57
  }, [activeIndex]);
56
58
  (0, _useMutationEffect.useMutationEffect)(() => {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type Direction = '' | 'vertical' | 'horizontal';
3
2
  export declare function useTouch(): {
4
3
  move: EventListener;
@@ -23,7 +23,7 @@ function isObject(val) {
23
23
  }
24
24
 
25
25
  function isPromise(obj) {
26
- return obj && typeof obj === 'object' && typeof obj.then === 'function';
26
+ return !!obj && typeof obj === 'object' && typeof obj.then === 'function';
27
27
  }
28
28
 
29
29
  function isDate(val) {
@@ -1,3 +1,3 @@
1
1
  import React, { ReactElement } from 'react';
2
2
  export declare type PropagationEvent = 'click';
3
- export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
3
+ export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -28,32 +28,5 @@ export declare type CalendarProps = {
28
28
  defaultValue?: [Date, Date] | null;
29
29
  onChange?: (val: [Date, Date]) => void;
30
30
  }) & NativeProps;
31
- export declare const Calendar: React.ForwardRefExoticComponent<({
32
- weekStartsOn?: "Monday" | "Sunday" | undefined;
33
- renderLabel?: ((date: Date) => string | null | undefined) | undefined;
34
- onPageChange?: ((year: number, month: number) => void) | undefined;
35
- } & {
36
- selectionMode?: undefined;
37
- value?: undefined;
38
- defaultValue?: undefined;
39
- onChange?: undefined;
40
- } & NativeProps<never> & React.RefAttributes<CalenderRef>) | ({
41
- weekStartsOn?: "Monday" | "Sunday" | undefined;
42
- renderLabel?: ((date: Date) => string | null | undefined) | undefined;
43
- onPageChange?: ((year: number, month: number) => void) | undefined;
44
- } & {
45
- selectionMode: 'single';
46
- value?: Date | null | undefined;
47
- defaultValue?: Date | null | undefined;
48
- onChange?: ((val: Date) => void) | undefined;
49
- } & NativeProps<never> & React.RefAttributes<CalenderRef>) | ({
50
- weekStartsOn?: "Monday" | "Sunday" | undefined;
51
- renderLabel?: ((date: Date) => string | null | undefined) | undefined;
52
- onPageChange?: ((year: number, month: number) => void) | undefined;
53
- } & {
54
- selectionMode: 'range';
55
- value?: [Date, Date] | null | undefined;
56
- defaultValue?: [Date, Date] | null | undefined;
57
- onChange?: ((val: [Date, Date]) => void) | undefined;
58
- } & NativeProps<never> & React.RefAttributes<CalenderRef>)>;
31
+ export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<CalenderRef>>;
59
32
  export {};
@@ -4,6 +4,7 @@ export declare type CapsuleTabProps = {
4
4
  title: ReactNode;
5
5
  disabled?: boolean;
6
6
  forceRender?: boolean;
7
+ destroyOnClose?: boolean;
7
8
  } & NativeProps;
8
9
  export declare const CapsuleTab: FC<CapsuleTabProps>;
9
10
  export declare type CapsuleTabsProps = {
@@ -6,6 +6,7 @@ import { usePropsValue } from '../../utils/use-props-value';
6
6
  import { useResizeEffect } from '../../utils/use-resize-effect';
7
7
  import { useTabListScroll } from '../../utils/use-tab-list-scroll';
8
8
  import ScrollMask from '../scroll-mask';
9
+ import { ShouldRender } from '../../utils/should-render';
9
10
  const classPrefix = `adm-capsule-tabs`;
10
11
  export const CapsuleTab = () => {
11
12
  return null;
@@ -83,22 +84,17 @@ export const CapsuleTabs = props => {
83
84
  return null;
84
85
  }
85
86
 
86
- if (pane.key === activeKey) {
87
- return React.createElement("div", {
88
- key: pane.key,
89
- className: `${classPrefix}-content`
90
- }, pane.props.children);
91
- }
92
-
93
- if (pane.props.forceRender) {
94
- return React.createElement("div", {
95
- key: pane.key,
96
- style: {
97
- display: 'none'
98
- }
99
- }, pane.props.children);
100
- }
101
-
102
- return null;
87
+ const active = pane.key === activeKey;
88
+ return React.createElement(ShouldRender, {
89
+ key: pane.key,
90
+ active: active,
91
+ forceRender: pane.props.forceRender,
92
+ destroyOnClose: pane.props.destroyOnClose
93
+ }, React.createElement("div", {
94
+ className: `${classPrefix}-content`,
95
+ style: {
96
+ display: active ? 'block' : 'none'
97
+ }
98
+ }, pane.props.children));
103
99
  })));
104
100
  };
@@ -1,2 +1,3 @@
1
1
  import { CascadePickerProps } from './cascade-picker';
2
- export declare function prompt(props: Omit<CascadePickerProps, 'value' | 'visible' | 'children'>): Promise<(string | null)[] | null>;
2
+ import type { PickerValue } from '../picker';
3
+ export declare function prompt(props: Omit<CascadePickerProps, 'value' | 'visible' | 'children'>): Promise<PickerValue[] | null>;
@@ -5,8 +5,9 @@ import { DownOutline } from 'antd-mobile-icons';
5
5
  import classNames from 'classnames';
6
6
  import { useSpring, animated } from '@react-spring/web';
7
7
  import { usePropsValue } from '../../utils/use-props-value';
8
- import { useMount, useUpdateLayoutEffect } from 'ahooks';
9
- import { useShouldRender } from '../../utils/use-should-render';
8
+ import { useMount } from 'ahooks';
9
+ import { useShouldRender } from '../../utils/should-render';
10
+ import { useIsomorphicUpdateLayoutEffect } from '../../utils/use-isomorphic-update-layout-effect';
10
11
  const classPrefix = `adm-collapse`;
11
12
  export const CollapsePanel = () => {
12
13
  return null;
@@ -34,7 +35,7 @@ const CollapsePanelContent = props => {
34
35
  immediate: true
35
36
  });
36
37
  });
37
- useUpdateLayoutEffect(() => {
38
+ useIsomorphicUpdateLayoutEffect(() => {
38
39
  const inner = innerRef.current;
39
40
  if (!inner) return;
40
41
 
@@ -5,6 +5,7 @@ import { withNativeProps } from '../../utils/native-props';
5
5
  import { mergeProps } from '../../utils/with-default-props';
6
6
  import { usePropsValue } from '../../utils/use-props-value';
7
7
  import { convertDateToStringArray, convertStringArrayToDate, generateDatePickerColumns, defaultRenderLabel } from './date-picker-utils';
8
+ import { bound } from '../../utils/bound';
8
9
  const thisYear = new Date().getFullYear();
9
10
  const defaultProps = {
10
11
  min: new Date(new Date().setFullYear(thisYear - 10)),
@@ -26,7 +27,15 @@ export const DatePicker = p => {
26
27
  }
27
28
  });
28
29
  const now = useMemo(() => new Date(), []);
29
- const pickerValue = useMemo(() => convertDateToStringArray(value !== null && value !== void 0 ? value : now, props.precision), [value, props.precision]);
30
+ const pickerValue = useMemo(() => {
31
+ let date = value;
32
+
33
+ if (date === null) {
34
+ date = new Date(bound(now.getDate(), props.min.getDate(), props.max.getDate()));
35
+ }
36
+
37
+ return convertDateToStringArray(date, props.precision);
38
+ }, [value, props.precision]);
30
39
  const onConfirm = useCallback(val => {
31
40
  setValue(convertStringArrayToDate(val, props.precision));
32
41
  }, [setValue, props.precision]);
@@ -1,7 +1,7 @@
1
1
  import classNames from 'classnames';
2
2
  import React from 'react';
3
3
  import { withNativeProps } from '../../utils/native-props';
4
- import { useShouldRender } from '../../utils/use-should-render';
4
+ import { useShouldRender } from '../../utils/should-render';
5
5
  import { DownFill } from 'antd-mobile-icons';
6
6
  const classPrefix = `adm-dropdown-item`;
7
7
 
@@ -12,6 +12,6 @@ export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'na
12
12
  };
13
13
  export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<FormContextType> & {
14
14
  footer?: ReactNode;
15
- layout?: "horizontal" | "vertical" | undefined;
15
+ layout?: FormLayout | undefined;
16
16
  mode?: ListProps['mode'];
17
- } & React.RefAttributes<Pick<RCFormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>>;
17
+ } & React.RefAttributes<FormInstance>>;
@@ -8,9 +8,9 @@ export type { FormSubscribeProps } from './form-subscribe';
8
8
  export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
9
9
  declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & import("../../utils/native-props").NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<import("./context").FormContextType> & {
10
10
  footer?: import("react").ReactNode;
11
- layout?: "horizontal" | "vertical" | undefined;
11
+ layout?: FormLayout | undefined;
12
12
  mode?: "default" | "card" | undefined;
13
- } & import("react").RefAttributes<Pick<import("rc-field-form").FormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>> & {
13
+ } & import("react").RefAttributes<import("./form").FormInstance>> & {
14
14
  Item: import("react").FC<import("./form-item").FormItemProps>;
15
15
  Subscribe: import("react").VFC<import("./form-subscribe").FormSubscribeProps>;
16
16
  Header: import("react").FC<{}>;
@@ -16,7 +16,7 @@ export declare type MultiImageViewerProps = Omit<ImageViewerProps, 'image'> & {
16
16
  defaultIndex?: number;
17
17
  onIndexChange?: (index: number) => void;
18
18
  };
19
- export declare const MultiImageViewer: React.ForwardRefExoticComponent<Pick<ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
19
+ export declare const MultiImageViewer: React.ForwardRefExoticComponent<Omit<ImageViewerProps, "image"> & {
20
20
  images?: string[] | undefined;
21
21
  defaultIndex?: number | undefined;
22
22
  onIndexChange?: ((index: number) => void) | undefined;
@@ -4,7 +4,7 @@ import { showMultiImageViewer, showImageViewer, clearImageViewer } from './metho
4
4
  export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
5
5
  export type { ImageViewerHandler } from './methods';
6
6
  declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
7
- Multi: import("react").ForwardRefExoticComponent<Pick<import("./image-viewer").ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
7
+ Multi: import("react").ForwardRefExoticComponent<Omit<import("./image-viewer").ImageViewerProps, "image"> & {
8
8
  images?: string[] | undefined;
9
9
  defaultIndex?: number | undefined;
10
10
  onIndexChange?: ((index: number) => void) | undefined;
@@ -21,7 +21,7 @@ export declare type InputRef = {
21
21
  focus: () => void;
22
22
  blur: () => void;
23
23
  };
24
- export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
24
+ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
25
25
  value?: string | undefined;
26
26
  defaultValue?: string | undefined;
27
27
  onChange?: ((val: string) => void) | undefined;
@@ -32,7 +32,7 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedH
32
32
  onClear?: (() => void) | undefined;
33
33
  id?: string | undefined;
34
34
  onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
35
- enterKeyHint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send" | undefined;
35
+ enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
36
36
  min?: number | undefined;
37
37
  max?: number | undefined;
38
38
  } & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>;
@@ -5,6 +5,7 @@ export declare type JumboTabProps = {
5
5
  description: ReactNode;
6
6
  disabled?: boolean;
7
7
  forceRender?: boolean;
8
+ destroyOnClose?: boolean;
8
9
  } & NativeProps;
9
10
  export declare const JumboTab: FC<JumboTabProps>;
10
11
  export declare type JumboTabsProps = {
@@ -6,6 +6,7 @@ import { usePropsValue } from '../../utils/use-props-value';
6
6
  import { useResizeEffect } from '../../utils/use-resize-effect';
7
7
  import { useTabListScroll } from '../../utils/use-tab-list-scroll';
8
8
  import ScrollMask from '../scroll-mask';
9
+ import { ShouldRender } from '../../utils/should-render';
9
10
  const classPrefix = `adm-jumbo-tabs`;
10
11
  export const JumboTab = () => {
11
12
  return null;
@@ -87,22 +88,17 @@ export const JumboTabs = props => {
87
88
  return null;
88
89
  }
89
90
 
90
- if (pane.key === activeKey) {
91
- return React.createElement("div", {
92
- key: pane.key,
93
- className: `${classPrefix}-content`
94
- }, pane.props.children);
95
- }
96
-
97
- if (pane.props.forceRender) {
98
- return React.createElement("div", {
99
- key: pane.key,
100
- style: {
101
- display: 'none'
102
- }
103
- }, pane.props.children);
104
- }
105
-
106
- return null;
91
+ const active = pane.key === activeKey;
92
+ return React.createElement(ShouldRender, {
93
+ key: pane.key,
94
+ active: active,
95
+ forceRender: pane.props.forceRender,
96
+ destroyOnClose: pane.props.destroyOnClose
97
+ }, React.createElement("div", {
98
+ className: `${classPrefix}-content`,
99
+ style: {
100
+ display: active ? 'block' : 'none'
101
+ }
102
+ }, pane.props.children));
107
103
  })));
108
104
  };
@@ -6,7 +6,7 @@ import { useSpring, animated } from '@react-spring/web';
6
6
  import { renderToContainer } from '../../utils/render-to-container';
7
7
  import { mergeProps } from '../../utils/with-default-props';
8
8
  import { useConfig } from '../config-provider';
9
- import { useShouldRender } from '../../utils/use-should-render';
9
+ import { useShouldRender } from '../../utils/should-render';
10
10
  import { withStopPropagation } from '../../utils/with-stop-propagation';
11
11
  const classPrefix = `adm-mask`;
12
12
  const opacityRecord = {
@@ -30,6 +30,6 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
30
30
  seperated?: boolean | undefined;
31
31
  onBlur?: (() => void) | undefined;
32
32
  onFocus?: (() => void) | undefined;
33
- keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
33
+ keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
34
34
  onFill?: ((val: string) => void) | undefined;
35
35
  } & NativeProps<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
@@ -1,2 +1,2 @@
1
- import type { PickerProps } from './index';
2
- export declare function prompt(props: Omit<PickerProps, 'value' | 'visible' | 'children'>): Promise<(string | null)[] | null>;
1
+ import type { PickerProps, PickerValue } from './index';
2
+ export declare function prompt(props: Omit<PickerProps, 'value' | 'visible' | 'children'>): Promise<PickerValue[] | null>;
@@ -4,16 +4,16 @@ import './popover-menu.less';
4
4
  export type { PopoverProps, PopoverRef } from './popover';
5
5
  export type { PopoverMenuProps, Action } from './popover-menu';
6
6
  declare const _default: import("react").ForwardRefExoticComponent<{
7
- getContainer?: HTMLElement | (() => HTMLElement) | null | undefined;
7
+ getContainer?: import("../../utils/render-to-container").GetContainer | undefined;
8
8
  destroyOnHide?: boolean | undefined;
9
- children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
9
+ children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
10
10
  mode?: "dark" | "light" | undefined;
11
11
  trigger?: "click" | undefined;
12
12
  placement?: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
13
13
  stopPropagation?: "click"[] | undefined;
14
14
  content: import("react").ReactNode;
15
15
  } & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "align" | "defaultVisible" | "onVisibleChange"> & import("../../utils/native-props").NativeProps<"--z-index"> & import("react").RefAttributes<import("./popover").PopoverRef>> & {
16
- Menu: import("react").ForwardRefExoticComponent<Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
16
+ Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
17
17
  actions: import("./popover-menu").Action[];
18
18
  onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
19
19
  } & import("react").RefAttributes<import("./popover").PopoverRef>>;
@@ -11,7 +11,7 @@ export declare type PopoverMenuProps = Omit<PopoverProps, 'content'> & {
11
11
  actions: Action[];
12
12
  onAction?: (item: Action) => void;
13
13
  };
14
- export declare const PopoverMenu: React.ForwardRefExoticComponent<Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
14
+ export declare const PopoverMenu: React.ForwardRefExoticComponent<Omit<PopoverProps, "content"> & {
15
15
  actions: Action[];
16
16
  onAction?: ((item: Action) => void) | undefined;
17
17
  } & React.RefAttributes<PopoverRef>>;
@@ -19,7 +19,7 @@ export declare type PopoverRef = {
19
19
  visible: boolean;
20
20
  };
21
21
  export declare const Popover: React.ForwardRefExoticComponent<{
22
- getContainer?: HTMLElement | (() => HTMLElement) | null | undefined;
22
+ getContainer?: GetContainer | undefined;
23
23
  destroyOnHide?: boolean | undefined;
24
24
  children: ReactElement;
25
25
  mode?: "dark" | "light" | undefined;
@@ -7,7 +7,7 @@ import Mask from '../mask';
7
7
  import { useLockScroll } from '../../utils/use-lock-scroll';
8
8
  import { renderToContainer } from '../../utils/render-to-container';
9
9
  import { useSpring, animated } from '@react-spring/web';
10
- import { useShouldRender } from '../../utils/use-should-render';
10
+ import { useShouldRender } from '../../utils/should-render';
11
11
  import { withStopPropagation } from '../../utils/with-stop-propagation';
12
12
  const classPrefix = `adm-popup`;
13
13
  const defaultProps = {
@@ -45,6 +45,7 @@ export const SearchBar = forwardRef((p, ref) => {
45
45
 
46
46
  const renderCancelButton = () => {
47
47
  let isShowCancel = false;
48
+ const showCancelButton = props.showCancelButton;
48
49
 
49
50
  if (typeof props.showCancelButton === 'function') {
50
51
  isShowCancel = props.showCancelButton(hasFocus, value);
@@ -1,5 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
+ declare type SelectorValue = string | number;
3
4
  export interface SelectorOption<V> {
4
5
  label: ReactNode;
5
6
  description?: ReactNode;
@@ -18,4 +19,5 @@ export declare type SelectorProps<V> = {
18
19
  }) => void;
19
20
  showCheckMark?: boolean;
20
21
  } & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
21
- export declare const Selector: <V extends string | number>(p: SelectorProps<V>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
22
+ export declare const Selector: <V extends SelectorValue>(p: SelectorProps<V>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
23
+ export {};
@@ -1,16 +1,25 @@
1
1
  import { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  import { InputProps } from '../input';
4
- export declare type StepperProps = Pick<InputProps, 'onFocus' | 'onBlur'> & {
4
+ declare type ValueProps = {
5
+ allowEmpty: true;
5
6
  value?: number | null;
6
7
  defaultValue?: number | null;
7
8
  onChange?: (value: number | null) => void;
9
+ };
10
+ declare type ValuePropsWithNull = {
11
+ allowEmpty?: false;
12
+ value?: number;
13
+ defaultValue?: number;
14
+ onChange?: (value: number) => void;
15
+ };
16
+ export declare type StepperProps = Pick<InputProps, 'onFocus' | 'onBlur'> & (ValuePropsWithNull | ValueProps) & {
8
17
  min?: number;
9
18
  max?: number;
10
19
  step?: number;
11
20
  digits?: number;
12
21
  disabled?: boolean;
13
22
  inputReadOnly?: boolean;
14
- allowEmpty?: boolean;
15
23
  } & NativeProps<'--height' | '--input-width' | '--input-font-size' | '--input-background-color' | '--border-radius' | '--border' | '--border-inner' | '--active-border' | '--button-font-size' | '--button-background-color' | '--button-width' | '--input-font-color' | '--button-text-color'>;
16
24
  export declare const Stepper: FC<StepperProps>;
25
+ export {};
@@ -7,15 +7,15 @@ declare const _default: import("react").ForwardRefExoticComponent<{
7
7
  autoplay?: boolean | undefined;
8
8
  autoplayInterval?: number | undefined;
9
9
  loop?: boolean | undefined;
10
- direction?: "horizontal" | "vertical" | undefined;
10
+ direction?: "vertical" | "horizontal" | undefined;
11
11
  onIndexChange?: ((index: number) => void) | undefined;
12
- indicatorProps?: Pick<import("../page-indicator").PageIndicatorProps, "style" | "color" | "className"> | undefined;
12
+ indicatorProps?: Pick<import("../page-indicator").PageIndicatorProps, "style" | "className" | "color"> | undefined;
13
13
  indicator?: ((total: number, current: number) => import("react").ReactNode) | undefined;
14
14
  slideSize?: number | undefined;
15
15
  trackOffset?: number | undefined;
16
16
  stuckAtBoundary?: boolean | undefined;
17
17
  rubberband?: boolean | undefined;
18
- children?: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>[] | undefined;
18
+ children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
19
19
  } & import("../../utils/native-props").NativeProps<"--border-radius" | "--width" | "--height" | "--track-padding"> & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
20
20
  Item: import("react").FC<{
21
21
  onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
@@ -28,13 +28,13 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
28
28
  autoplay?: boolean | undefined;
29
29
  autoplayInterval?: number | undefined;
30
30
  loop?: boolean | undefined;
31
- direction?: "horizontal" | "vertical" | undefined;
31
+ direction?: "vertical" | "horizontal" | undefined;
32
32
  onIndexChange?: ((index: number) => void) | undefined;
33
- indicatorProps?: Pick<PageIndicatorProps, "style" | "color" | "className"> | undefined;
33
+ indicatorProps?: Pick<PageIndicatorProps, "style" | "className" | "color"> | undefined;
34
34
  indicator?: ((total: number, current: number) => ReactNode) | undefined;
35
35
  slideSize?: number | undefined;
36
36
  trackOffset?: number | undefined;
37
37
  stuckAtBoundary?: boolean | undefined;
38
38
  rubberband?: boolean | undefined;
39
- children?: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[] | undefined;
39
+ children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
40
40
  } & NativeProps<"--border-radius" | "--width" | "--height" | "--track-padding"> & React.RefAttributes<SwiperRef>>;
@@ -4,6 +4,7 @@ export declare type TabProps = {
4
4
  title: ReactNode;
5
5
  disabled?: boolean;
6
6
  forceRender?: boolean;
7
+ destroyOnClose?: boolean;
7
8
  } & NativeProps;
8
9
  export declare const Tab: FC<TabProps>;
9
10
  export declare type TabsProps = {
@@ -4,10 +4,12 @@ import { useSpring, animated } from '@react-spring/web';
4
4
  import { withNativeProps } from '../../utils/native-props';
5
5
  import { usePropsValue } from '../../utils/use-props-value';
6
6
  import { bound } from '../../utils/bound';
7
- import { useUpdateLayoutEffect, useThrottleFn, useIsomorphicLayoutEffect } from 'ahooks';
7
+ import { useThrottleFn, useIsomorphicLayoutEffect } from 'ahooks';
8
8
  import { useMutationEffect } from '../../utils/use-mutation-effect';
9
9
  import { useResizeEffect } from '../../utils/use-resize-effect';
10
10
  import { mergeProps } from '../../utils/with-default-props';
11
+ import { useIsomorphicUpdateLayoutEffect } from '../../utils/use-isomorphic-update-layout-effect';
12
+ import { ShouldRender } from '../../utils/should-render';
11
13
  const classPrefix = `adm-tabs`;
12
14
  export const Tab = () => {
13
15
  return null;
@@ -137,7 +139,7 @@ export const Tabs = p => {
137
139
  useIsomorphicLayoutEffect(() => {
138
140
  animate(!x.isAnimating);
139
141
  }, []);
140
- useUpdateLayoutEffect(() => {
142
+ useIsomorphicUpdateLayoutEffect(() => {
141
143
  animate();
142
144
  }, [activeKey]);
143
145
  useResizeEffect(() => {
@@ -224,23 +226,17 @@ export const Tabs = p => {
224
226
  return null;
225
227
  }
226
228
 
227
- if (pane.key === activeKey) {
228
- return React.createElement("div", {
229
- key: pane.key,
230
- className: `${classPrefix}-content`
231
- }, pane.props.children);
232
- }
233
-
234
- if (pane.props.forceRender) {
235
- return React.createElement("div", {
236
- key: pane.key,
237
- className: `${classPrefix}-content`,
238
- style: {
239
- display: 'none'
240
- }
241
- }, pane.props.children);
242
- }
243
-
244
- return null;
229
+ const active = pane.key === activeKey;
230
+ return React.createElement(ShouldRender, {
231
+ key: pane.key,
232
+ active: active,
233
+ forceRender: pane.props.forceRender,
234
+ destroyOnClose: pane.props.destroyOnClose
235
+ }, React.createElement("div", {
236
+ className: `${classPrefix}-content`,
237
+ style: {
238
+ display: active ? 'block' : 'none'
239
+ }
240
+ }, pane.props.children));
245
241
  })));
246
242
  };
@@ -18,7 +18,7 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
18
18
  onFocus?: (() => void) | undefined;
19
19
  onBlur?: (() => void) | undefined;
20
20
  onClick?: ((e: React.MouseEvent<HTMLDivElement>) => void) | undefined;
21
- keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
21
+ keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
22
22
  clearable?: boolean | undefined;
23
23
  onClear?: (() => void) | undefined;
24
- } & Pick<InputProps, "value" | "disabled" | "onChange" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
24
+ } & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
@@ -7,9 +7,11 @@ export function measureCSSLength(raw) {
7
7
  return parseFloat(withUnit);
8
8
  } else if (withUnit.endsWith('rem')) {
9
9
  return parseFloat(withUnit) * parseFloat(window.getComputedStyle(document.documentElement).fontSize);
10
+ } else if (withUnit.endsWith('vw')) {
11
+ return parseFloat(withUnit) * window.innerWidth / 100;
10
12
  } else {
11
13
  if (isDev) {
12
- devError('Global', 'You are using a not supported CSS unit. Only `px` and `rem` are supported.');
14
+ devError('Global', 'You are using a not supported CSS unit. Only `px` `rem` and `vw` are supported.');
13
15
  }
14
16
 
15
17
  return 0;