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.
- package/2x/cjs/components/form/form-item.css +1 -1
- package/2x/cjs/components/form/form-item.js +2 -1
- package/2x/cjs/components/form/index.css +1 -1
- package/2x/cjs/utils/get-scroll-parent.js +7 -4
- package/2x/es/components/form/form-item.css +1 -1
- package/2x/es/components/form/form-item.js +2 -1
- package/2x/es/components/form/index.css +1 -1
- package/2x/es/utils/get-scroll-parent.js +7 -4
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.js +7 -3
- package/bundle/antd-mobile.es.js +7 -3
- package/bundle/style.css +1 -1
- package/cjs/components/form/form-item.css +1 -1
- package/cjs/components/form/form-item.js +2 -1
- package/cjs/components/form/index.css +1 -1
- package/cjs/utils/get-scroll-parent.js +7 -4
- package/es/components/form/form-item.css +1 -1
- package/es/components/form/form-item.js +2 -1
- package/es/components/form/index.css +1 -1
- package/es/utils/get-scroll-parent.js +7 -4
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -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,
|
|
@@ -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
|
-
}
|
|
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 (
|
|
30
|
+
if (overflowStylePatterns.includes(overflowY)) {
|
|
28
31
|
return node;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -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,
|
|
@@ -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
|
-
}
|
|
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 (
|
|
22
|
+
if (overflowStylePatterns.includes(overflowY)) {
|
|
20
23
|
return node;
|
|
21
24
|
}
|
|
22
25
|
|
package/2x/package.json
CHANGED
|
@@ -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 (
|
|
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,
|
package/bundle/antd-mobile.es.js
CHANGED
|
@@ -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 (
|
|
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:
|
|
1538
|
+
justify-content: flex-end;
|
|
1539
1539
|
}
|
|
1540
1540
|
.adm-form-item-child-position-right > * {
|
|
1541
1541
|
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,
|
|
@@ -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
|
-
}
|
|
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 (
|
|
30
|
+
if (overflowStylePatterns.includes(overflowY)) {
|
|
28
31
|
return node;
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -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,
|
|
@@ -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
|
-
}
|
|
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 (
|
|
22
|
+
if (overflowStylePatterns.includes(overflowY)) {
|
|
20
23
|
return node;
|
|
21
24
|
}
|
|
22
25
|
|