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
@@ -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: 12px;
4
4
  --active-line-height: 2px;
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
  }
@@ -38,7 +40,7 @@
38
40
  cursor: pointer;
39
41
  }
40
42
  .adm-tabs-tab-active {
41
- color: var(--adm-color-primary);
43
+ color: var(--active-title-color);
42
44
  }
43
45
  .adm-tabs-tab-disabled {
44
46
  opacity: 0.5;
@@ -48,8 +50,7 @@
48
50
  position: absolute;
49
51
  bottom: 0;
50
52
  height: var(--active-line-height);
51
- color: var(--adm-color-primary);
52
- background: var(--adm-color-primary);
53
+ background: var(--active-line-color);
53
54
  border-radius: var(--active-line-border-radius);
54
55
  }
55
56
  .adm-tabs-content {
@@ -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/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
  }