antd-mobile 5.12.2 → 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.
@@ -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,
@@ -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
  });
@@ -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
 
@@ -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,
@@ -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
  });
@@ -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
 
package/2x/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.12.2",
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
- "@use-gesture/react": "^10.2.12",
7
+ "@use-gesture/react": "10.2.12",
8
8
  "ahooks": "^3.3.10",
9
9
  "antd-mobile-icons": "^0.2.2",
10
10
  "antd-mobile-v5-count": "^1.0.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;
@@ -9437,9 +9437,10 @@ const Badge$1 = (props) => {
9437
9437
  className: `${classPrefix$18}-wrap`
9438
9438
  }, children, element) : element;
9439
9439
  };
9440
- var Badge = attachPropertiesToComponent(Badge$1, {
9440
+ const properties = {
9441
9441
  dot
9442
- });
9442
+ };
9443
+ var Badge = attachPropertiesToComponent(Badge$1, properties);
9443
9444
  var calendar = "";
9444
9445
  const ArrowLeft = () => {
9445
9446
  return React__default["default"].createElement("svg", {
@@ -9661,10 +9662,10 @@ const Calendar = React$1.forwardRef((p2, ref) => {
9661
9662
  isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
9662
9663
  }
9663
9664
  const inThisMonth = d.month() === current.month();
9664
- 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");
9665
9666
  cells.push(React__default["default"].createElement("div", {
9666
9667
  key: d.valueOf(),
9667
- 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 && {
9668
9669
  [`${classPrefix$17}-cell-today`]: d.isSame(today, "day"),
9669
9670
  [`${classPrefix$17}-cell-selected`]: isSelect,
9670
9671
  [`${classPrefix$17}-cell-selected-begin`]: isBegin,
@@ -14923,9 +14924,6 @@ const ImageUploader = (p2) => {
14923
14924
  } = useConfig();
14924
14925
  const props = mergeProps(defaultProps$t, p2);
14925
14926
  const [value, setValue] = usePropsValue(props);
14926
- const updateValue = ahooks.useMemoizedFn((updater) => {
14927
- setValue(updater(value));
14928
- });
14929
14927
  const [tasks, setTasks] = React$1.useState([]);
14930
14928
  ahooks.useIsomorphicLayoutEffect(() => {
14931
14929
  setTasks((prev) => prev.filter((task) => {
@@ -14997,7 +14995,7 @@ const ImageUploader = (p2) => {
14997
14995
  return task;
14998
14996
  });
14999
14997
  });
15000
- updateValue((prev) => {
14998
+ setValue((prev) => {
15001
14999
  const newVal = Object.assign({}, result2);
15002
15000
  return [...prev, newVal];
15003
15001
  });
@@ -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;
@@ -9427,9 +9427,10 @@ const Badge$1 = (props) => {
9427
9427
  className: `${classPrefix$18}-wrap`
9428
9428
  }, children, element) : element;
9429
9429
  };
9430
- var Badge = attachPropertiesToComponent(Badge$1, {
9430
+ const properties = {
9431
9431
  dot
9432
- });
9432
+ };
9433
+ var Badge = attachPropertiesToComponent(Badge$1, properties);
9433
9434
  var calendar = "";
9434
9435
  const ArrowLeft = () => {
9435
9436
  return React$1.createElement("svg", {
@@ -9651,10 +9652,10 @@ const Calendar = forwardRef((p2, ref) => {
9651
9652
  isSelect = isBegin || isEnd || d.isAfter(begin, "day") && d.isBefore(end, "day");
9652
9653
  }
9653
9654
  const inThisMonth = d.month() === current.month();
9654
- 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");
9655
9656
  cells.push(React$1.createElement("div", {
9656
9657
  key: d.valueOf(),
9657
- className: classNames(`${classPrefix$17}-cell`, disabled && `${classPrefix$17}-cell-disabled`, inThisMonth && {
9658
+ className: classNames(`${classPrefix$17}-cell`, (disabled || !inThisMonth) && `${classPrefix$17}-cell-disabled`, inThisMonth && {
9658
9659
  [`${classPrefix$17}-cell-today`]: d.isSame(today, "day"),
9659
9660
  [`${classPrefix$17}-cell-selected`]: isSelect,
9660
9661
  [`${classPrefix$17}-cell-selected-begin`]: isBegin,
@@ -14913,9 +14914,6 @@ const ImageUploader = (p2) => {
14913
14914
  } = useConfig();
14914
14915
  const props = mergeProps(defaultProps$t, p2);
14915
14916
  const [value, setValue] = usePropsValue(props);
14916
- const updateValue = useMemoizedFn((updater) => {
14917
- setValue(updater(value));
14918
- });
14919
14917
  const [tasks, setTasks] = useState([]);
14920
14918
  useIsomorphicLayoutEffect(() => {
14921
14919
  setTasks((prev) => prev.filter((task) => {
@@ -14987,7 +14985,7 @@ const ImageUploader = (p2) => {
14987
14985
  return task;
14988
14986
  });
14989
14987
  });
14990
- updateValue((prev) => {
14988
+ setValue((prev) => {
14991
14989
  const newVal = Object.assign({}, result2);
14992
14990
  return [...prev, newVal];
14993
14991
  });
@@ -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,
@@ -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
  });
@@ -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
 
@@ -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,
@@ -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
  });
@@ -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
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.12.2",
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
- "@use-gesture/react": "^10.2.12",
7
+ "@use-gesture/react": "10.2.12",
8
8
  "ahooks": "^3.3.10",
9
9
  "antd-mobile-icons": "^0.2.2",
10
10
  "antd-mobile-v5-count": "^1.0.1",