antd-mobile 5.12.0 → 5.12.3

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 (82) hide show
  1. package/2x/cjs/components/badge/index.d.ts +4 -2
  2. package/2x/cjs/components/badge/index.js +4 -2
  3. package/2x/cjs/components/calendar/calendar.js +2 -2
  4. package/2x/cjs/components/dialog/dialog.d.ts +2 -1
  5. package/2x/cjs/components/dropdown/dropdown.css +1 -1
  6. package/2x/cjs/components/error-block/images/busy.d.ts +1 -0
  7. package/2x/cjs/components/error-block/images/default.d.ts +1 -0
  8. package/2x/cjs/components/error-block/images/disconnected.d.ts +1 -0
  9. package/2x/cjs/components/error-block/images/empty.d.ts +1 -0
  10. package/2x/cjs/components/image/image.d.ts +1 -1
  11. package/2x/cjs/components/image-uploader/image-uploader.js +1 -4
  12. package/2x/cjs/components/modal/modal.d.ts +2 -1
  13. package/2x/cjs/components/popup/popup.d.ts +2 -1
  14. package/2x/cjs/components/search-bar/search-bar.js +2 -8
  15. package/2x/cjs/components/tabs/tabs.css +4 -3
  16. package/2x/cjs/components/tabs/tabs.d.ts +1 -1
  17. package/2x/cjs/components/toast/toast.d.ts +2 -1
  18. package/2x/cjs/utils/get-scroll-parent.js +1 -1
  19. package/2x/cjs/utils/render.js +14 -2
  20. package/2x/es/components/badge/index.d.ts +4 -2
  21. package/2x/es/components/badge/index.js +3 -2
  22. package/2x/es/components/calendar/calendar.js +2 -2
  23. package/2x/es/components/dialog/dialog.d.ts +2 -1
  24. package/2x/es/components/dropdown/dropdown.css +1 -1
  25. package/2x/es/components/error-block/images/busy.d.ts +1 -0
  26. package/2x/es/components/error-block/images/default.d.ts +1 -0
  27. package/2x/es/components/error-block/images/disconnected.d.ts +1 -0
  28. package/2x/es/components/error-block/images/empty.d.ts +1 -0
  29. package/2x/es/components/image/image.d.ts +1 -1
  30. package/2x/es/components/image-uploader/image-uploader.js +2 -5
  31. package/2x/es/components/modal/modal.d.ts +2 -1
  32. package/2x/es/components/popup/popup.d.ts +2 -1
  33. package/2x/es/components/search-bar/search-bar.js +2 -8
  34. package/2x/es/components/tabs/tabs.css +4 -3
  35. package/2x/es/components/tabs/tabs.d.ts +1 -1
  36. package/2x/es/components/toast/toast.d.ts +2 -1
  37. package/2x/es/utils/get-scroll-parent.js +1 -1
  38. package/2x/es/utils/render.js +14 -2
  39. package/2x/package.json +3 -8
  40. package/bundle/antd-mobile.cjs.js +25 -23
  41. package/bundle/antd-mobile.es.js +25 -23
  42. package/bundle/style.css +5 -4
  43. package/cjs/components/badge/index.d.ts +4 -2
  44. package/cjs/components/badge/index.js +4 -2
  45. package/cjs/components/calendar/calendar.js +2 -2
  46. package/cjs/components/dialog/dialog.d.ts +2 -1
  47. package/cjs/components/dropdown/dropdown.css +1 -1
  48. package/cjs/components/error-block/images/busy.d.ts +1 -0
  49. package/cjs/components/error-block/images/default.d.ts +1 -0
  50. package/cjs/components/error-block/images/disconnected.d.ts +1 -0
  51. package/cjs/components/error-block/images/empty.d.ts +1 -0
  52. package/cjs/components/image/image.d.ts +1 -1
  53. package/cjs/components/image-uploader/image-uploader.js +1 -4
  54. package/cjs/components/modal/modal.d.ts +2 -1
  55. package/cjs/components/popup/popup.d.ts +2 -1
  56. package/cjs/components/search-bar/search-bar.js +2 -8
  57. package/cjs/components/tabs/tabs.css +4 -3
  58. package/cjs/components/tabs/tabs.d.ts +1 -1
  59. package/cjs/components/toast/toast.d.ts +2 -1
  60. package/cjs/utils/get-scroll-parent.js +1 -1
  61. package/cjs/utils/render.js +14 -2
  62. package/es/components/badge/index.d.ts +4 -2
  63. package/es/components/badge/index.js +3 -2
  64. package/es/components/calendar/calendar.js +2 -2
  65. package/es/components/dialog/dialog.d.ts +2 -1
  66. package/es/components/dropdown/dropdown.css +1 -1
  67. package/es/components/error-block/images/busy.d.ts +1 -0
  68. package/es/components/error-block/images/default.d.ts +1 -0
  69. package/es/components/error-block/images/disconnected.d.ts +1 -0
  70. package/es/components/error-block/images/empty.d.ts +1 -0
  71. package/es/components/image/image.d.ts +1 -1
  72. package/es/components/image-uploader/image-uploader.js +2 -5
  73. package/es/components/modal/modal.d.ts +2 -1
  74. package/es/components/popup/popup.d.ts +2 -1
  75. package/es/components/search-bar/search-bar.js +2 -8
  76. package/es/components/tabs/tabs.css +4 -3
  77. package/es/components/tabs/tabs.d.ts +1 -1
  78. package/es/components/toast/toast.d.ts +2 -1
  79. package/es/utils/get-scroll-parent.js +1 -1
  80. package/es/utils/render.js +14 -2
  81. package/package.json +3 -8
  82. package/umd/antd-mobile.js +1 -1
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import './badge.less';
3
+ import { dot } from './badge';
3
4
  export type { BadgeProps } from './badge';
4
- declare const _default: import("react").FC<import("./badge").BadgeProps> & {
5
- dot: symbol;
5
+ declare type Properties = {
6
+ dot: typeof dot;
6
7
  };
8
+ declare const _default: import("react").FC<import("./badge").BadgeProps> & Properties;
7
9
  export default _default;
@@ -11,8 +11,10 @@ var _badge2 = require("./badge");
11
11
 
12
12
  var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
13
13
 
14
- var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_badge2.Badge, {
14
+ const properties = {
15
15
  dot: _badge2.dot
16
- });
16
+ };
17
+
18
+ var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_badge2.Badge, properties);
17
19
 
18
20
  exports.default = _default;
@@ -153,10 +153,10 @@ const Calendar = (0, _react.forwardRef)((p, ref) => {
153
153
  }
154
154
 
155
155
  const inThisMonth = d.month() === current.month();
156
- const disabled = !inThisMonth || maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
156
+ const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
157
157
  cells.push(_react.default.createElement("div", {
158
158
  key: d.valueOf(),
159
- className: (0, _classnames.default)(`${classPrefix}-cell`, disabled && `${classPrefix}-cell-disabled`, inThisMonth && {
159
+ className: (0, _classnames.default)(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
160
160
  [`${classPrefix}-cell-today`]: d.isSame(today, 'day'),
161
161
  [`${classPrefix}-cell-selected`]: isSelect,
162
162
  [`${classPrefix}-cell-selected-begin`]: isBegin,
@@ -1,4 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { Action } from './dialog-action-button';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  import { PropagationEvent } from '../../utils/with-stop-propagation';
@@ -19,7 +20,7 @@ export declare type DialogProps = {
19
20
  getContainer?: GetContainer;
20
21
  bodyStyle?: React.CSSProperties;
21
22
  bodyClassName?: string;
22
- maskStyle?: React.CSSProperties;
23
+ maskStyle?: MaskProps['style'];
23
24
  maskClassName?: string;
24
25
  stopPropagation?: PropagationEvent[];
25
26
  disableBodyScroll?: boolean;
@@ -38,7 +38,7 @@
38
38
  .adm-dropdown-item .adm-dropdown-item-title-arrow {
39
39
  color: var(--adm-color-light);
40
40
  font-size: 18px;
41
- transform: rotate(0deg) translateY(-2px);
41
+ transform: rotate(0deg) translateY(2px);
42
42
  transition: all ease 0.2s;
43
43
  }
44
44
 
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const busyImage: JSX.Element;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const defaultImage: JSX.Element;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const disconnectedImage: JSX.Element;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const emptyImage: JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  export declare type ImageProps = {
4
- src: string;
4
+ src?: string;
5
5
  alt?: string;
6
6
  width?: number | string;
7
7
  height?: number | string;
@@ -53,9 +53,6 @@ const ImageUploader = p => {
53
53
  } = (0, _configProvider.useConfig)();
54
54
  const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
55
55
  const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
56
- const updateValue = (0, _ahooks.useMemoizedFn)(updater => {
57
- setValue(updater(value));
58
- });
59
56
  const [tasks, setTasks] = (0, _react.useState)([]);
60
57
  (0, _ahooks.useIsomorphicLayoutEffect)(() => {
61
58
  setTasks(prev => prev.filter(task => {
@@ -134,7 +131,7 @@ const ImageUploader = p => {
134
131
  return task;
135
132
  });
136
133
  });
137
- updateValue(prev => {
134
+ setValue(prev => {
138
135
  const newVal = Object.assign({}, result);
139
136
  return [...prev, newVal];
140
137
  });
@@ -1,4 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { Action } from './modal-action-button';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  import { PropagationEvent } from '../../utils/with-stop-propagation';
@@ -19,7 +20,7 @@ export declare type ModalProps = {
19
20
  getContainer?: GetContainer;
20
21
  bodyStyle?: React.CSSProperties;
21
22
  bodyClassName?: string;
22
- maskStyle?: React.CSSProperties;
23
+ maskStyle?: MaskProps['style'];
23
24
  maskClassName?: string;
24
25
  stopPropagation?: PropagationEvent[];
25
26
  showCloseButton?: boolean;
@@ -1,5 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
+ import type { MaskProps } from '../mask';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  import { PropagationEvent } from '../../utils/with-stop-propagation';
5
6
  export declare type PopupProps = {
@@ -15,7 +16,7 @@ export declare type PopupProps = {
15
16
  bodyClassName?: string;
16
17
  bodyStyle?: React.CSSProperties;
17
18
  maskClassName?: string;
18
- maskStyle?: React.CSSProperties;
19
+ maskStyle?: MaskProps['style'];
19
20
  onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
20
21
  stopPropagation?: PropagationEvent[];
21
22
  children?: React.ReactNode;
@@ -74,7 +74,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
74
74
  }));
75
75
 
76
76
  const renderCancelButton = () => {
77
- let isShowCancel = false;
77
+ let isShowCancel;
78
78
 
79
79
  if (typeof props.showCancelButton === 'function') {
80
80
  isShowCancel = props.showCancelButton(hasFocus, value);
@@ -83,13 +83,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
83
83
  }
84
84
 
85
85
  return isShowCancel && _react.default.createElement("div", {
86
- className: `${classPrefix}-suffix`,
87
- onMouseDown: e => {
88
- e.preventDefault();
89
- },
90
- onTouchStart: e => {
91
- e.preventDefault();
92
- }
86
+ className: `${classPrefix}-suffix`
93
87
  }, _react.default.createElement(_button.default, {
94
88
  fill: 'none',
95
89
  className: `${classPrefix}-cancel-button`,
@@ -3,6 +3,8 @@
3
3
  --content-padding: 24px;
4
4
  --active-line-height: 4px;
5
5
  --active-line-border-radius: var(--active-line-height);
6
+ --active-line-color: var(--adm-color-primary);
7
+ --active-title-color: var(--adm-color-primary);
6
8
  position: relative;
7
9
  min-width: 0;
8
10
  }
@@ -45,7 +47,7 @@
45
47
  }
46
48
 
47
49
  .adm-tabs-tab-active {
48
- color: var(--adm-color-primary);
50
+ color: var(--active-title-color);
49
51
  }
50
52
 
51
53
  .adm-tabs-tab-disabled {
@@ -57,8 +59,7 @@
57
59
  position: absolute;
58
60
  bottom: 0;
59
61
  height: var(--active-line-height);
60
- color: var(--adm-color-primary);
61
- background: var(--adm-color-primary);
62
+ background: var(--active-line-color);
62
63
  border-radius: var(--active-line-border-radius);
63
64
  }
64
65
 
@@ -15,5 +15,5 @@ export declare type TabsProps = {
15
15
  stretch?: boolean;
16
16
  onChange?: (key: string) => void;
17
17
  children?: React.ReactNode;
18
- } & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding'>;
18
+ } & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
19
19
  export declare const Tabs: FC<TabsProps>;
@@ -1,9 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { PropagationEvent } from '../../utils/with-stop-propagation';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  export interface ToastProps {
5
6
  afterClose?: () => void;
6
- maskStyle?: React.CSSProperties;
7
+ maskStyle?: MaskProps['style'];
7
8
  maskClassName?: string;
8
9
  maskClickable?: boolean;
9
10
  content?: ReactNode;
@@ -27,7 +27,7 @@ function getScrollParent(el, root = defaultRoot) {
27
27
  overflowY
28
28
  } = window.getComputedStyle(node);
29
29
 
30
- if (overflowStylePatterns.includes(overflowY)) {
30
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
31
31
  return node;
32
32
  }
33
33
 
@@ -26,13 +26,23 @@ let createRoot;
26
26
  try {
27
27
  const mainVersion = Number((version || '').split('.')[0]);
28
28
 
29
- if (mainVersion >= 18) {
29
+ if (mainVersion >= 18 && fullClone.createRoot) {
30
30
  // eslint-disable-next-line @typescript-eslint/no-var-requires
31
- createRoot = require('react-dom/client').createRoot;
31
+ createRoot = fullClone.createRoot;
32
32
  }
33
33
  } catch (e) {// Do nothing;
34
34
  }
35
35
 
36
+ function toggleWarning(skip) {
37
+ const {
38
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
39
+ } = fullClone;
40
+
41
+ if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
42
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
43
+ }
44
+ }
45
+
36
46
  const MARK = '__antd_mobile_root__';
37
47
 
38
48
  function legacyRender(node, container) {
@@ -40,7 +50,9 @@ function legacyRender(node, container) {
40
50
  }
41
51
 
42
52
  function concurrentRender(node, container) {
53
+ toggleWarning(true);
43
54
  const root = container[MARK] || createRoot(container);
55
+ toggleWarning(false);
44
56
  root.render(node);
45
57
  container[MARK] = root;
46
58
  }
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import './badge.less';
3
+ import { dot } from './badge';
3
4
  export type { BadgeProps } from './badge';
4
- declare const _default: import("react").FC<import("./badge").BadgeProps> & {
5
- dot: symbol;
5
+ declare type Properties = {
6
+ dot: typeof dot;
6
7
  };
8
+ declare const _default: import("react").FC<import("./badge").BadgeProps> & Properties;
7
9
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import "./badge.css";
2
2
  import { Badge, dot } from './badge';
3
3
  import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component';
4
- export default attachPropertiesToComponent(Badge, {
4
+ const properties = {
5
5
  dot
6
- });
6
+ };
7
+ export default attachPropertiesToComponent(Badge, properties);
@@ -125,10 +125,10 @@ export const Calendar = forwardRef((p, ref) => {
125
125
  }
126
126
 
127
127
  const inThisMonth = d.month() === current.month();
128
- const disabled = !inThisMonth || maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
128
+ const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
129
129
  cells.push(React.createElement("div", {
130
130
  key: d.valueOf(),
131
- className: classNames(`${classPrefix}-cell`, disabled && `${classPrefix}-cell-disabled`, inThisMonth && {
131
+ className: classNames(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
132
132
  [`${classPrefix}-cell-today`]: d.isSame(today, 'day'),
133
133
  [`${classPrefix}-cell-selected`]: isSelect,
134
134
  [`${classPrefix}-cell-selected-begin`]: isBegin,
@@ -1,4 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { Action } from './dialog-action-button';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  import { PropagationEvent } from '../../utils/with-stop-propagation';
@@ -19,7 +20,7 @@ export declare type DialogProps = {
19
20
  getContainer?: GetContainer;
20
21
  bodyStyle?: React.CSSProperties;
21
22
  bodyClassName?: string;
22
- maskStyle?: React.CSSProperties;
23
+ maskStyle?: MaskProps['style'];
23
24
  maskClassName?: string;
24
25
  stopPropagation?: PropagationEvent[];
25
26
  disableBodyScroll?: boolean;
@@ -38,7 +38,7 @@
38
38
  .adm-dropdown-item .adm-dropdown-item-title-arrow {
39
39
  color: var(--adm-color-light);
40
40
  font-size: 18px;
41
- transform: rotate(0deg) translateY(-2px);
41
+ transform: rotate(0deg) translateY(2px);
42
42
  transition: all ease 0.2s;
43
43
  }
44
44
 
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const busyImage: JSX.Element;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const defaultImage: JSX.Element;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const disconnectedImage: JSX.Element;
@@ -1 +1,2 @@
1
+ /// <reference types="react" />
1
2
  export declare const emptyImage: JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  export declare type ImageProps = {
4
- src: string;
4
+ src?: string;
5
5
  alt?: string;
6
6
  width?: number | string;
7
7
  height?: number | string;
@@ -5,7 +5,7 @@ import { mergeProps } from '../../utils/with-default-props';
5
5
  import ImageViewer from '../image-viewer';
6
6
  import PreviewItem from './preview-item';
7
7
  import { usePropsValue } from '../../utils/use-props-value';
8
- import { useIsomorphicLayoutEffect, useMemoizedFn, useUnmount } from 'ahooks';
8
+ import { useIsomorphicLayoutEffect, useUnmount } from 'ahooks';
9
9
  import Space from '../space';
10
10
  import { withNativeProps } from '../../utils/native-props';
11
11
  import { useConfig } from '../config-provider';
@@ -28,9 +28,6 @@ export const ImageUploader = p => {
28
28
  } = useConfig();
29
29
  const props = mergeProps(defaultProps, p);
30
30
  const [value, setValue] = usePropsValue(props);
31
- const updateValue = useMemoizedFn(updater => {
32
- setValue(updater(value));
33
- });
34
31
  const [tasks, setTasks] = useState([]);
35
32
  useIsomorphicLayoutEffect(() => {
36
33
  setTasks(prev => prev.filter(task => {
@@ -109,7 +106,7 @@ export const ImageUploader = p => {
109
106
  return task;
110
107
  });
111
108
  });
112
- updateValue(prev => {
109
+ setValue(prev => {
113
110
  const newVal = Object.assign({}, result);
114
111
  return [...prev, newVal];
115
112
  });
@@ -1,4 +1,5 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { Action } from './modal-action-button';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  import { PropagationEvent } from '../../utils/with-stop-propagation';
@@ -19,7 +20,7 @@ export declare type ModalProps = {
19
20
  getContainer?: GetContainer;
20
21
  bodyStyle?: React.CSSProperties;
21
22
  bodyClassName?: string;
22
- maskStyle?: React.CSSProperties;
23
+ maskStyle?: MaskProps['style'];
23
24
  maskClassName?: string;
24
25
  stopPropagation?: PropagationEvent[];
25
26
  showCloseButton?: boolean;
@@ -1,5 +1,6 @@
1
1
  import React, { FC } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
+ import type { MaskProps } from '../mask';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  import { PropagationEvent } from '../../utils/with-stop-propagation';
5
6
  export declare type PopupProps = {
@@ -15,7 +16,7 @@ export declare type PopupProps = {
15
16
  bodyClassName?: string;
16
17
  bodyStyle?: React.CSSProperties;
17
18
  maskClassName?: string;
18
- maskStyle?: React.CSSProperties;
19
+ maskStyle?: MaskProps['style'];
19
20
  onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
20
21
  stopPropagation?: PropagationEvent[];
21
22
  children?: React.ReactNode;
@@ -52,7 +52,7 @@ export const SearchBar = forwardRef((p, ref) => {
52
52
  }));
53
53
 
54
54
  const renderCancelButton = () => {
55
- let isShowCancel = false;
55
+ let isShowCancel;
56
56
 
57
57
  if (typeof props.showCancelButton === 'function') {
58
58
  isShowCancel = props.showCancelButton(hasFocus, value);
@@ -61,13 +61,7 @@ export const SearchBar = forwardRef((p, ref) => {
61
61
  }
62
62
 
63
63
  return isShowCancel && React.createElement("div", {
64
- className: `${classPrefix}-suffix`,
65
- onMouseDown: e => {
66
- e.preventDefault();
67
- },
68
- onTouchStart: e => {
69
- e.preventDefault();
70
- }
64
+ className: `${classPrefix}-suffix`
71
65
  }, React.createElement(Button, {
72
66
  fill: 'none',
73
67
  className: `${classPrefix}-cancel-button`,
@@ -3,6 +3,8 @@
3
3
  --content-padding: 24px;
4
4
  --active-line-height: 4px;
5
5
  --active-line-border-radius: var(--active-line-height);
6
+ --active-line-color: var(--adm-color-primary);
7
+ --active-title-color: var(--adm-color-primary);
6
8
  position: relative;
7
9
  min-width: 0;
8
10
  }
@@ -45,7 +47,7 @@
45
47
  }
46
48
 
47
49
  .adm-tabs-tab-active {
48
- color: var(--adm-color-primary);
50
+ color: var(--active-title-color);
49
51
  }
50
52
 
51
53
  .adm-tabs-tab-disabled {
@@ -57,8 +59,7 @@
57
59
  position: absolute;
58
60
  bottom: 0;
59
61
  height: var(--active-line-height);
60
- color: var(--adm-color-primary);
61
- background: var(--adm-color-primary);
62
+ background: var(--active-line-color);
62
63
  border-radius: var(--active-line-border-radius);
63
64
  }
64
65
 
@@ -15,5 +15,5 @@ export declare type TabsProps = {
15
15
  stretch?: boolean;
16
16
  onChange?: (key: string) => void;
17
17
  children?: React.ReactNode;
18
- } & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding'>;
18
+ } & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
19
19
  export declare const Tabs: FC<TabsProps>;
@@ -1,9 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { PropagationEvent } from '../../utils/with-stop-propagation';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  export interface ToastProps {
5
6
  afterClose?: () => void;
6
- maskStyle?: React.CSSProperties;
7
+ maskStyle?: MaskProps['style'];
7
8
  maskClassName?: string;
8
9
  maskClickable?: boolean;
9
10
  content?: ReactNode;
@@ -19,7 +19,7 @@ export function getScrollParent(el, root = defaultRoot) {
19
19
  overflowY
20
20
  } = window.getComputedStyle(node);
21
21
 
22
- if (overflowStylePatterns.includes(overflowY)) {
22
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
23
23
  return node;
24
24
  }
25
25
 
@@ -12,13 +12,23 @@ let createRoot;
12
12
  try {
13
13
  const mainVersion = Number((version || '').split('.')[0]);
14
14
 
15
- if (mainVersion >= 18) {
15
+ if (mainVersion >= 18 && fullClone.createRoot) {
16
16
  // eslint-disable-next-line @typescript-eslint/no-var-requires
17
- createRoot = require('react-dom/client').createRoot;
17
+ createRoot = fullClone.createRoot;
18
18
  }
19
19
  } catch (e) {// Do nothing;
20
20
  }
21
21
 
22
+ function toggleWarning(skip) {
23
+ const {
24
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
25
+ } = fullClone;
26
+
27
+ if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
28
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
29
+ }
30
+ }
31
+
22
32
  const MARK = '__antd_mobile_root__';
23
33
 
24
34
  function legacyRender(node, container) {
@@ -26,7 +36,9 @@ function legacyRender(node, container) {
26
36
  }
27
37
 
28
38
  function concurrentRender(node, container) {
39
+ toggleWarning(true);
29
40
  const root = container[MARK] || createRoot(container);
41
+ toggleWarning(false);
30
42
  root.render(node);
31
43
  container[MARK] = root;
32
44
  }
package/2x/package.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.12.0",
3
+ "version": "5.12.3",
4
4
  "dependencies": {
5
5
  "@floating-ui/dom": "^0.4.5",
6
6
  "@react-spring/web": "^9.4.5",
7
- "@types/big.js": "^6.1.3",
8
- "@types/react-is": "^17.0.3",
9
- "@types/react-virtualized": "^9.21.21",
10
- "@types/resize-observer-browser": "^0.1.7",
11
- "@use-gesture/react": "^10.2.12",
7
+ "@use-gesture/react": "10.2.12",
12
8
  "ahooks": "^3.3.10",
13
9
  "antd-mobile-icons": "^0.2.2",
14
10
  "antd-mobile-v5-count": "^1.0.1",
@@ -43,6 +39,5 @@
43
39
  "url": "git+https://github.com/ant-design/ant-design-mobile.git",
44
40
  "branch": "master",
45
41
  "platform": "github"
46
- },
47
- "packageManager": "yarn@3.2.0"
42
+ }
48
43
  }