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
@@ -1489,11 +1489,11 @@ function useConfig() {
1489
1489
  return (_a = React$1.useContext(ConfigContext)) !== null && _a !== void 0 ? _a : getDefaultConfig();
1490
1490
  }
1491
1491
  var actionSheet = "";
1492
- function attachPropertiesToComponent(component, properties) {
1492
+ function attachPropertiesToComponent(component, properties2) {
1493
1493
  const ret = component;
1494
- for (const key in properties) {
1495
- if (properties.hasOwnProperty(key)) {
1496
- ret[key] = properties[key];
1494
+ for (const key in properties2) {
1495
+ if (properties2.hasOwnProperty(key)) {
1496
+ ret[key] = properties2[key];
1497
1497
  }
1498
1498
  }
1499
1499
  return ret;
@@ -1626,7 +1626,7 @@ function getScrollParent(el2, root2 = defaultRoot) {
1626
1626
  const {
1627
1627
  overflowY
1628
1628
  } = window.getComputedStyle(node);
1629
- if (overflowStylePatterns.includes(overflowY)) {
1629
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
1630
1630
  return node;
1631
1631
  }
1632
1632
  node = node.parentNode;
@@ -9165,17 +9165,27 @@ const {
9165
9165
  let createRoot;
9166
9166
  try {
9167
9167
  const mainVersion = Number((version || "").split(".")[0]);
9168
- if (mainVersion >= 18) {
9169
- createRoot = require("react-dom/client").createRoot;
9168
+ if (mainVersion >= 18 && fullClone.createRoot) {
9169
+ createRoot = fullClone.createRoot;
9170
9170
  }
9171
9171
  } catch (e) {
9172
9172
  }
9173
+ function toggleWarning(skip) {
9174
+ const {
9175
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
9176
+ } = fullClone;
9177
+ if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
9178
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
9179
+ }
9180
+ }
9173
9181
  const MARK = "__antd_mobile_root__";
9174
9182
  function legacyRender(node, container) {
9175
9183
  reactRender(node, container);
9176
9184
  }
9177
9185
  function concurrentRender(node, container) {
9186
+ toggleWarning(true);
9178
9187
  const root2 = container[MARK] || createRoot(container);
9188
+ toggleWarning(false);
9179
9189
  root2.render(node);
9180
9190
  container[MARK] = root2;
9181
9191
  }
@@ -9427,9 +9437,10 @@ const Badge$1 = (props) => {
9427
9437
  className: `${classPrefix$18}-wrap`
9428
9438
  }, children, element) : element;
9429
9439
  };
9430
- var Badge = attachPropertiesToComponent(Badge$1, {
9440
+ const properties = {
9431
9441
  dot
9432
- });
9442
+ };
9443
+ var Badge = attachPropertiesToComponent(Badge$1, properties);
9433
9444
  var calendar = "";
9434
9445
  const ArrowLeft = () => {
9435
9446
  return React__default["default"].createElement("svg", {
@@ -9651,10 +9662,10 @@ const Calendar = React$1.forwardRef((p2, ref) => {
9651
9662
  isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
9652
9663
  }
9653
9664
  const inThisMonth = d.month() === current.month();
9654
- const disabled = !inThisMonth || maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
9665
+ const disabled = maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
9655
9666
  cells.push(React__default["default"].createElement("div", {
9656
9667
  key: d.valueOf(),
9657
- className: classNames__default["default"](`${classPrefix$17}-cell`, disabled && `${classPrefix$17}-cell-disabled`, inThisMonth && {
9668
+ className: classNames__default["default"](`${classPrefix$17}-cell`, (disabled || !inThisMonth) && `${classPrefix$17}-cell-disabled`, inThisMonth && {
9658
9669
  [`${classPrefix$17}-cell-today`]: d.isSame(today, "day"),
9659
9670
  [`${classPrefix$17}-cell-selected`]: isSelect,
9660
9671
  [`${classPrefix$17}-cell-selected-begin`]: isBegin,
@@ -14913,9 +14924,6 @@ const ImageUploader = (p2) => {
14913
14924
  } = useConfig();
14914
14925
  const props = mergeProps(defaultProps$t, p2);
14915
14926
  const [value, setValue] = usePropsValue(props);
14916
- const updateValue = ahooks.useMemoizedFn((updater) => {
14917
- setValue(updater(value));
14918
- });
14919
14927
  const [tasks, setTasks] = React$1.useState([]);
14920
14928
  ahooks.useIsomorphicLayoutEffect(() => {
14921
14929
  setTasks((prev) => prev.filter((task) => {
@@ -14987,7 +14995,7 @@ const ImageUploader = (p2) => {
14987
14995
  return task;
14988
14996
  });
14989
14997
  });
14990
- updateValue((prev) => {
14998
+ setValue((prev) => {
14991
14999
  const newVal = Object.assign({}, result2);
14992
15000
  return [...prev, newVal];
14993
15001
  });
@@ -16552,20 +16560,14 @@ const SearchBar = React$1.forwardRef((p2, ref) => {
16552
16560
  }
16553
16561
  }));
16554
16562
  const renderCancelButton = () => {
16555
- let isShowCancel = false;
16563
+ let isShowCancel;
16556
16564
  if (typeof props.showCancelButton === "function") {
16557
16565
  isShowCancel = props.showCancelButton(hasFocus, value);
16558
16566
  } else {
16559
16567
  isShowCancel = props.showCancelButton && hasFocus;
16560
16568
  }
16561
16569
  return isShowCancel && React__default["default"].createElement("div", {
16562
- className: `${classPrefix$i}-suffix`,
16563
- onMouseDown: (e) => {
16564
- e.preventDefault();
16565
- },
16566
- onTouchStart: (e) => {
16567
- e.preventDefault();
16568
- }
16570
+ className: `${classPrefix$i}-suffix`
16569
16571
  }, React__default["default"].createElement(Button, {
16570
16572
  fill: "none",
16571
16573
  className: `${classPrefix$i}-cancel-button`,
@@ -1479,11 +1479,11 @@ function useConfig() {
1479
1479
  return (_a = useContext(ConfigContext)) !== null && _a !== void 0 ? _a : getDefaultConfig();
1480
1480
  }
1481
1481
  var actionSheet = "";
1482
- function attachPropertiesToComponent(component, properties) {
1482
+ function attachPropertiesToComponent(component, properties2) {
1483
1483
  const ret = component;
1484
- for (const key in properties) {
1485
- if (properties.hasOwnProperty(key)) {
1486
- ret[key] = properties[key];
1484
+ for (const key in properties2) {
1485
+ if (properties2.hasOwnProperty(key)) {
1486
+ ret[key] = properties2[key];
1487
1487
  }
1488
1488
  }
1489
1489
  return ret;
@@ -1616,7 +1616,7 @@ function getScrollParent(el2, root2 = defaultRoot) {
1616
1616
  const {
1617
1617
  overflowY
1618
1618
  } = window.getComputedStyle(node);
1619
- if (overflowStylePatterns.includes(overflowY)) {
1619
+ if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
1620
1620
  return node;
1621
1621
  }
1622
1622
  node = node.parentNode;
@@ -9155,17 +9155,27 @@ const {
9155
9155
  let createRoot;
9156
9156
  try {
9157
9157
  const mainVersion = Number((version || "").split(".")[0]);
9158
- if (mainVersion >= 18) {
9159
- createRoot = require("react-dom/client").createRoot;
9158
+ if (mainVersion >= 18 && fullClone.createRoot) {
9159
+ createRoot = fullClone.createRoot;
9160
9160
  }
9161
9161
  } catch (e) {
9162
9162
  }
9163
+ function toggleWarning(skip) {
9164
+ const {
9165
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
9166
+ } = fullClone;
9167
+ if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === "object") {
9168
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
9169
+ }
9170
+ }
9163
9171
  const MARK = "__antd_mobile_root__";
9164
9172
  function legacyRender(node, container) {
9165
9173
  reactRender(node, container);
9166
9174
  }
9167
9175
  function concurrentRender(node, container) {
9176
+ toggleWarning(true);
9168
9177
  const root2 = container[MARK] || createRoot(container);
9178
+ toggleWarning(false);
9169
9179
  root2.render(node);
9170
9180
  container[MARK] = root2;
9171
9181
  }
@@ -9417,9 +9427,10 @@ const Badge$1 = (props) => {
9417
9427
  className: `${classPrefix$18}-wrap`
9418
9428
  }, children, element) : element;
9419
9429
  };
9420
- var Badge = attachPropertiesToComponent(Badge$1, {
9430
+ const properties = {
9421
9431
  dot
9422
- });
9432
+ };
9433
+ var Badge = attachPropertiesToComponent(Badge$1, properties);
9423
9434
  var calendar = "";
9424
9435
  const ArrowLeft = () => {
9425
9436
  return React$1.createElement("svg", {
@@ -9641,10 +9652,10 @@ const Calendar = forwardRef((p2, ref) => {
9641
9652
  isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
9642
9653
  }
9643
9654
  const inThisMonth = d.month() === current.month();
9644
- const disabled = !inThisMonth || maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
9655
+ const disabled = maxDay && d.isAfter(maxDay, "day") || minDay && d.isBefore(minDay, "day");
9645
9656
  cells.push(React$1.createElement("div", {
9646
9657
  key: d.valueOf(),
9647
- className: classNames(`${classPrefix$17}-cell`, disabled && `${classPrefix$17}-cell-disabled`, inThisMonth && {
9658
+ className: classNames(`${classPrefix$17}-cell`, (disabled || !inThisMonth) && `${classPrefix$17}-cell-disabled`, inThisMonth && {
9648
9659
  [`${classPrefix$17}-cell-today`]: d.isSame(today, "day"),
9649
9660
  [`${classPrefix$17}-cell-selected`]: isSelect,
9650
9661
  [`${classPrefix$17}-cell-selected-begin`]: isBegin,
@@ -14903,9 +14914,6 @@ const ImageUploader = (p2) => {
14903
14914
  } = useConfig();
14904
14915
  const props = mergeProps(defaultProps$t, p2);
14905
14916
  const [value, setValue] = usePropsValue(props);
14906
- const updateValue = useMemoizedFn((updater) => {
14907
- setValue(updater(value));
14908
- });
14909
14917
  const [tasks, setTasks] = useState([]);
14910
14918
  useIsomorphicLayoutEffect(() => {
14911
14919
  setTasks((prev) => prev.filter((task) => {
@@ -14977,7 +14985,7 @@ const ImageUploader = (p2) => {
14977
14985
  return task;
14978
14986
  });
14979
14987
  });
14980
- updateValue((prev) => {
14988
+ setValue((prev) => {
14981
14989
  const newVal = Object.assign({}, result2);
14982
14990
  return [...prev, newVal];
14983
14991
  });
@@ -16542,20 +16550,14 @@ const SearchBar = forwardRef((p2, ref) => {
16542
16550
  }
16543
16551
  }));
16544
16552
  const renderCancelButton = () => {
16545
- let isShowCancel = false;
16553
+ let isShowCancel;
16546
16554
  if (typeof props.showCancelButton === "function") {
16547
16555
  isShowCancel = props.showCancelButton(hasFocus, value);
16548
16556
  } else {
16549
16557
  isShowCancel = props.showCancelButton && hasFocus;
16550
16558
  }
16551
16559
  return isShowCancel && React$1.createElement("div", {
16552
- className: `${classPrefix$i}-suffix`,
16553
- onMouseDown: (e) => {
16554
- e.preventDefault();
16555
- },
16556
- onTouchStart: (e) => {
16557
- e.preventDefault();
16558
- }
16560
+ className: `${classPrefix$i}-suffix`
16559
16561
  }, React$1.createElement(Button, {
16560
16562
  fill: "none",
16561
16563
  className: `${classPrefix$i}-cancel-button`,
package/bundle/style.css CHANGED
@@ -757,6 +757,8 @@ div.adm-px-tester {
757
757
  --content-padding: 12px;
758
758
  --active-line-height: 2px;
759
759
  --active-line-border-radius: var(--active-line-height);
760
+ --active-line-color: var(--adm-color-primary);
761
+ --active-title-color: var(--adm-color-primary);
760
762
  position: relative;
761
763
  min-width: 0;
762
764
  }
@@ -792,7 +794,7 @@ div.adm-px-tester {
792
794
  cursor: pointer;
793
795
  }
794
796
  .adm-tabs-tab-active {
795
- color: var(--adm-color-primary);
797
+ color: var(--active-title-color);
796
798
  }
797
799
  .adm-tabs-tab-disabled {
798
800
  opacity: 0.5;
@@ -802,8 +804,7 @@ div.adm-px-tester {
802
804
  position: absolute;
803
805
  bottom: 0;
804
806
  height: var(--active-line-height);
805
- color: var(--adm-color-primary);
806
- background: var(--adm-color-primary);
807
+ background: var(--active-line-color);
807
808
  border-radius: var(--active-line-border-radius);
808
809
  }
809
810
  .adm-tabs-content {
@@ -1270,7 +1271,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
1270
1271
  .adm-dropdown-item .adm-dropdown-item-title-arrow {
1271
1272
  color: var(--adm-color-light);
1272
1273
  font-size: 9px;
1273
- transform: rotate(0deg) translateY(-1px);
1274
+ transform: rotate(0deg) translateY(1px);
1274
1275
  transition: all ease 0.2s;
1275
1276
  }
1276
1277
  .adm-dropdown-item .adm-dropdown-item-title-arrow-active {
@@ -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;
@@ -32,7 +32,7 @@
32
32
  .adm-dropdown-item .adm-dropdown-item-title-arrow {
33
33
  color: var(--adm-color-light);
34
34
  font-size: 9px;
35
- transform: rotate(0deg) translateY(-1px);
35
+ transform: rotate(0deg) translateY(1px);
36
36
  transition: all ease 0.2s;
37
37
  }
38
38
  .adm-dropdown-item .adm-dropdown-item-title-arrow-active {
@@ -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: 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;
@@ -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;
@@ -32,7 +32,7 @@
32
32
  .adm-dropdown-item .adm-dropdown-item-title-arrow {
33
33
  color: var(--adm-color-light);
34
34
  font-size: 9px;
35
- transform: rotate(0deg) translateY(-1px);
35
+ transform: rotate(0deg) translateY(1px);
36
36
  transition: all ease 0.2s;
37
37
  }
38
38
  .adm-dropdown-item .adm-dropdown-item-title-arrow-active {
@@ -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;