antd-mobile 5.10.3 → 5.10.4

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.
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  .adm-form-item-child-position-right {
46
- justify-content: right;
46
+ justify-content: flex-end;
47
47
  }
48
48
 
49
49
  .adm-form-item-child-position-right > * {
@@ -121,7 +121,8 @@ const FormItemLayout = props => {
121
121
  extra: extra,
122
122
  description: description,
123
123
  className: (0, _classnames.default)(classPrefix, className, `${classPrefix}-${layout}`, {
124
- [`${classPrefix}-hidden`]: hidden
124
+ [`${classPrefix}-hidden`]: hidden,
125
+ [`${classPrefix}-has-error`]: props.errors.length
125
126
  }),
126
127
  disabled: disabled,
127
128
  onClick: props.onClick,
@@ -69,7 +69,7 @@
69
69
  }
70
70
 
71
71
  .adm-form-item-child-position-right {
72
- justify-content: right;
72
+ justify-content: flex-end;
73
73
  }
74
74
 
75
75
  .adm-form-item-child-position-right > * {
@@ -7,24 +7,27 @@ exports.getScrollParent = getScrollParent;
7
7
 
8
8
  var _canUseDom = require("./can-use-dom");
9
9
 
10
- const overflowScrollReg = /scroll|auto|overlay/i;
11
10
  const defaultRoot = _canUseDom.canUseDom ? window : undefined;
11
+ const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
12
12
 
13
13
  function isElement(node) {
14
14
  const ELEMENT_NODE_TYPE = 1;
15
15
  return node.nodeType === ELEMENT_NODE_TYPE;
16
- } // https://github.com/youzan/vant/issues/3823
17
-
16
+ }
18
17
 
19
18
  function getScrollParent(el, root = defaultRoot) {
20
19
  let node = el;
21
20
 
22
21
  while (node && node !== root && isElement(node)) {
22
+ if (node === document.body) {
23
+ return root;
24
+ }
25
+
23
26
  const {
24
27
  overflowY
25
28
  } = window.getComputedStyle(node);
26
29
 
27
- if (overflowScrollReg.test(overflowY)) {
30
+ if (overflowStylePatterns.includes(overflowY)) {
28
31
  return node;
29
32
  }
30
33
 
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  .adm-form-item-child-position-right {
46
- justify-content: right;
46
+ justify-content: flex-end;
47
47
  }
48
48
 
49
49
  .adm-form-item-child-position-right > * {
@@ -92,7 +92,8 @@ const FormItemLayout = props => {
92
92
  extra: extra,
93
93
  description: description,
94
94
  className: classNames(classPrefix, className, `${classPrefix}-${layout}`, {
95
- [`${classPrefix}-hidden`]: hidden
95
+ [`${classPrefix}-hidden`]: hidden,
96
+ [`${classPrefix}-has-error`]: props.errors.length
96
97
  }),
97
98
  disabled: disabled,
98
99
  onClick: props.onClick,
@@ -69,7 +69,7 @@
69
69
  }
70
70
 
71
71
  .adm-form-item-child-position-right {
72
- justify-content: right;
72
+ justify-content: flex-end;
73
73
  }
74
74
 
75
75
  .adm-form-item-child-position-right > * {
@@ -1,22 +1,25 @@
1
1
  import { canUseDom } from './can-use-dom';
2
- const overflowScrollReg = /scroll|auto|overlay/i;
3
2
  const defaultRoot = canUseDom ? window : undefined;
3
+ const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
4
4
 
5
5
  function isElement(node) {
6
6
  const ELEMENT_NODE_TYPE = 1;
7
7
  return node.nodeType === ELEMENT_NODE_TYPE;
8
- } // https://github.com/youzan/vant/issues/3823
9
-
8
+ }
10
9
 
11
10
  export function getScrollParent(el, root = defaultRoot) {
12
11
  let node = el;
13
12
 
14
13
  while (node && node !== root && isElement(node)) {
14
+ if (node === document.body) {
15
+ return root;
16
+ }
17
+
15
18
  const {
16
19
  overflowY
17
20
  } = window.getComputedStyle(node);
18
21
 
19
- if (overflowScrollReg.test(overflowY)) {
22
+ if (overflowStylePatterns.includes(overflowY)) {
20
23
  return node;
21
24
  }
22
25
 
package/2x/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.10.3",
3
+ "version": "5.10.4",
4
4
  "dependencies": {
5
5
  "@floating-ui/dom": "^0.4.2",
6
6
  "@react-spring/web": "^9.4.4",
@@ -1593,8 +1593,8 @@ function useTouch() {
1593
1593
  isHorizontal
1594
1594
  };
1595
1595
  }
1596
- const overflowScrollReg = /scroll|auto|overlay/i;
1597
1596
  const defaultRoot = canUseDom ? window : void 0;
1597
+ const overflowStylePatterns = ["scroll", "auto", "overlay"];
1598
1598
  function isElement(node) {
1599
1599
  const ELEMENT_NODE_TYPE = 1;
1600
1600
  return node.nodeType === ELEMENT_NODE_TYPE;
@@ -1602,10 +1602,13 @@ function isElement(node) {
1602
1602
  function getScrollParent(el, root2 = defaultRoot) {
1603
1603
  let node = el;
1604
1604
  while (node && node !== root2 && isElement(node)) {
1605
+ if (node === document.body) {
1606
+ return root2;
1607
+ }
1605
1608
  const {
1606
1609
  overflowY
1607
1610
  } = window.getComputedStyle(node);
1608
- if (overflowScrollReg.test(overflowY)) {
1611
+ if (overflowStylePatterns.includes(overflowY)) {
1609
1612
  return node;
1610
1613
  }
1611
1614
  node = node.parentNode;
@@ -13466,7 +13469,8 @@ const FormItemLayout = (props) => {
13466
13469
  extra,
13467
13470
  description,
13468
13471
  className: classNames__default["default"](classPrefix$H, className, `${classPrefix$H}-${layout}`, {
13469
- [`${classPrefix$H}-hidden`]: hidden
13472
+ [`${classPrefix$H}-hidden`]: hidden,
13473
+ [`${classPrefix$H}-has-error`]: props.errors.length
13470
13474
  }),
13471
13475
  disabled,
13472
13476
  onClick: props.onClick,
@@ -1583,8 +1583,8 @@ function useTouch() {
1583
1583
  isHorizontal
1584
1584
  };
1585
1585
  }
1586
- const overflowScrollReg = /scroll|auto|overlay/i;
1587
1586
  const defaultRoot = canUseDom ? window : void 0;
1587
+ const overflowStylePatterns = ["scroll", "auto", "overlay"];
1588
1588
  function isElement(node) {
1589
1589
  const ELEMENT_NODE_TYPE = 1;
1590
1590
  return node.nodeType === ELEMENT_NODE_TYPE;
@@ -1592,10 +1592,13 @@ function isElement(node) {
1592
1592
  function getScrollParent(el, root2 = defaultRoot) {
1593
1593
  let node = el;
1594
1594
  while (node && node !== root2 && isElement(node)) {
1595
+ if (node === document.body) {
1596
+ return root2;
1597
+ }
1595
1598
  const {
1596
1599
  overflowY
1597
1600
  } = window.getComputedStyle(node);
1598
- if (overflowScrollReg.test(overflowY)) {
1601
+ if (overflowStylePatterns.includes(overflowY)) {
1599
1602
  return node;
1600
1603
  }
1601
1604
  node = node.parentNode;
@@ -13456,7 +13459,8 @@ const FormItemLayout = (props) => {
13456
13459
  extra,
13457
13460
  description,
13458
13461
  className: classNames(classPrefix$H, className, `${classPrefix$H}-${layout}`, {
13459
- [`${classPrefix$H}-hidden`]: hidden
13462
+ [`${classPrefix$H}-hidden`]: hidden,
13463
+ [`${classPrefix$H}-has-error`]: props.errors.length
13460
13464
  }),
13461
13465
  disabled,
13462
13466
  onClick: props.onClick,
package/bundle/style.css CHANGED
@@ -1535,7 +1535,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
1535
1535
  flex: auto;
1536
1536
  }
1537
1537
  .adm-form-item-child-position-right {
1538
- justify-content: right;
1538
+ justify-content: flex-end;
1539
1539
  }
1540
1540
  .adm-form-item-child-position-right > * {
1541
1541
  flex: none;
@@ -35,7 +35,7 @@
35
35
  flex: auto;
36
36
  }
37
37
  .adm-form-item-child-position-right {
38
- justify-content: right;
38
+ justify-content: flex-end;
39
39
  }
40
40
  .adm-form-item-child-position-right > * {
41
41
  flex: none;
@@ -121,7 +121,8 @@ const FormItemLayout = props => {
121
121
  extra: extra,
122
122
  description: description,
123
123
  className: (0, _classnames.default)(classPrefix, className, `${classPrefix}-${layout}`, {
124
- [`${classPrefix}-hidden`]: hidden
124
+ [`${classPrefix}-hidden`]: hidden,
125
+ [`${classPrefix}-has-error`]: props.errors.length
125
126
  }),
126
127
  disabled: disabled,
127
128
  onClick: props.onClick,
@@ -57,7 +57,7 @@
57
57
  flex: auto;
58
58
  }
59
59
  .adm-form-item-child-position-right {
60
- justify-content: right;
60
+ justify-content: flex-end;
61
61
  }
62
62
  .adm-form-item-child-position-right > * {
63
63
  flex: none;
@@ -7,24 +7,27 @@ exports.getScrollParent = getScrollParent;
7
7
 
8
8
  var _canUseDom = require("./can-use-dom");
9
9
 
10
- const overflowScrollReg = /scroll|auto|overlay/i;
11
10
  const defaultRoot = _canUseDom.canUseDom ? window : undefined;
11
+ const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
12
12
 
13
13
  function isElement(node) {
14
14
  const ELEMENT_NODE_TYPE = 1;
15
15
  return node.nodeType === ELEMENT_NODE_TYPE;
16
- } // https://github.com/youzan/vant/issues/3823
17
-
16
+ }
18
17
 
19
18
  function getScrollParent(el, root = defaultRoot) {
20
19
  let node = el;
21
20
 
22
21
  while (node && node !== root && isElement(node)) {
22
+ if (node === document.body) {
23
+ return root;
24
+ }
25
+
23
26
  const {
24
27
  overflowY
25
28
  } = window.getComputedStyle(node);
26
29
 
27
- if (overflowScrollReg.test(overflowY)) {
30
+ if (overflowStylePatterns.includes(overflowY)) {
28
31
  return node;
29
32
  }
30
33
 
@@ -35,7 +35,7 @@
35
35
  flex: auto;
36
36
  }
37
37
  .adm-form-item-child-position-right {
38
- justify-content: right;
38
+ justify-content: flex-end;
39
39
  }
40
40
  .adm-form-item-child-position-right > * {
41
41
  flex: none;
@@ -92,7 +92,8 @@ const FormItemLayout = props => {
92
92
  extra: extra,
93
93
  description: description,
94
94
  className: classNames(classPrefix, className, `${classPrefix}-${layout}`, {
95
- [`${classPrefix}-hidden`]: hidden
95
+ [`${classPrefix}-hidden`]: hidden,
96
+ [`${classPrefix}-has-error`]: props.errors.length
96
97
  }),
97
98
  disabled: disabled,
98
99
  onClick: props.onClick,
@@ -57,7 +57,7 @@
57
57
  flex: auto;
58
58
  }
59
59
  .adm-form-item-child-position-right {
60
- justify-content: right;
60
+ justify-content: flex-end;
61
61
  }
62
62
  .adm-form-item-child-position-right > * {
63
63
  flex: none;
@@ -1,22 +1,25 @@
1
1
  import { canUseDom } from './can-use-dom';
2
- const overflowScrollReg = /scroll|auto|overlay/i;
3
2
  const defaultRoot = canUseDom ? window : undefined;
3
+ const overflowStylePatterns = ['scroll', 'auto', 'overlay'];
4
4
 
5
5
  function isElement(node) {
6
6
  const ELEMENT_NODE_TYPE = 1;
7
7
  return node.nodeType === ELEMENT_NODE_TYPE;
8
- } // https://github.com/youzan/vant/issues/3823
9
-
8
+ }
10
9
 
11
10
  export function getScrollParent(el, root = defaultRoot) {
12
11
  let node = el;
13
12
 
14
13
  while (node && node !== root && isElement(node)) {
14
+ if (node === document.body) {
15
+ return root;
16
+ }
17
+
15
18
  const {
16
19
  overflowY
17
20
  } = window.getComputedStyle(node);
18
21
 
19
- if (overflowScrollReg.test(overflowY)) {
22
+ if (overflowStylePatterns.includes(overflowY)) {
20
23
  return node;
21
24
  }
22
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.10.3",
3
+ "version": "5.10.4",
4
4
  "dependencies": {
5
5
  "@floating-ui/dom": "^0.4.2",
6
6
  "@react-spring/web": "^9.4.4",