antd-mobile 5.9.4-dev.1 → 5.9.5
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/dialog/dialog.d.ts +1 -0
- package/2x/cjs/components/dialog/dialog.js +4 -2
- package/2x/cjs/components/form/form-item.js +3 -1
- package/2x/cjs/components/modal/modal.d.ts +1 -0
- package/2x/cjs/components/modal/modal.js +4 -2
- package/2x/cjs/components/number-keyboard/number-keyboard.js +0 -5
- package/2x/cjs/utils/undefined-fallback.d.ts +3 -0
- package/2x/cjs/utils/undefined-fallback.js +16 -0
- package/2x/es/components/dialog/dialog.d.ts +1 -0
- package/2x/es/components/dialog/dialog.js +4 -2
- package/2x/es/components/form/form-item.js +2 -1
- package/2x/es/components/modal/modal.d.ts +1 -0
- package/2x/es/components/modal/modal.js +4 -2
- package/2x/es/components/number-keyboard/number-keyboard.js +0 -5
- package/2x/es/utils/undefined-fallback.d.ts +3 -0
- package/2x/es/utils/undefined-fallback.js +9 -0
- package/2x/package.json +1 -1
- package/bundle/antd-mobile.cjs.js +17 -10
- package/bundle/antd-mobile.es.js +17 -10
- package/cjs/components/dialog/dialog.d.ts +1 -0
- package/cjs/components/dialog/dialog.js +4 -2
- package/cjs/components/form/form-item.js +3 -1
- package/cjs/components/modal/modal.d.ts +1 -0
- package/cjs/components/modal/modal.js +4 -2
- package/cjs/components/number-keyboard/number-keyboard.js +0 -5
- package/cjs/utils/undefined-fallback.d.ts +3 -0
- package/cjs/utils/undefined-fallback.js +16 -0
- package/es/components/dialog/dialog.d.ts +1 -0
- package/es/components/dialog/dialog.js +4 -2
- package/es/components/form/form-item.js +2 -1
- package/es/components/modal/modal.d.ts +1 -0
- package/es/components/modal/modal.js +4 -2
- package/es/components/number-keyboard/number-keyboard.js +0 -5
- package/es/utils/undefined-fallback.d.ts +3 -0
- package/es/utils/undefined-fallback.js +9 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -43,7 +43,8 @@ const defaultProps = {
|
|
|
43
43
|
closeOnAction: false,
|
|
44
44
|
closeOnMaskClick: false,
|
|
45
45
|
stopPropagation: ['click'],
|
|
46
|
-
getContainer: null
|
|
46
|
+
getContainer: null,
|
|
47
|
+
disableBodyScroll: true
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
const Dialog = p => {
|
|
@@ -122,7 +123,8 @@ const Dialog = p => {
|
|
|
122
123
|
visible: props.visible,
|
|
123
124
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
124
125
|
style: props.maskStyle,
|
|
125
|
-
className: (0, _classnames.default)(cls('mask'), props.maskClassName)
|
|
126
|
+
className: (0, _classnames.default)(cls('mask'), props.maskClassName),
|
|
127
|
+
disableBodyScroll: props.disableBodyScroll
|
|
126
128
|
}), _react.default.createElement("div", {
|
|
127
129
|
className: cls('wrap'),
|
|
128
130
|
style: {
|
|
@@ -29,6 +29,8 @@ var _antdMobileIcons = require("antd-mobile-icons");
|
|
|
29
29
|
|
|
30
30
|
var _configProvider = require("../config-provider");
|
|
31
31
|
|
|
32
|
+
var _undefinedFallback = require("../../utils/undefined-fallback");
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -169,7 +171,7 @@ const FormItem = props => {
|
|
|
169
171
|
const {
|
|
170
172
|
validateTrigger: contextValidateTrigger
|
|
171
173
|
} = (0, _react.useContext)(_FieldContext.default);
|
|
172
|
-
const mergedValidateTrigger =
|
|
174
|
+
const mergedValidateTrigger = (0, _undefinedFallback.undefinedFallback)(validateTrigger, contextValidateTrigger, trigger);
|
|
173
175
|
|
|
174
176
|
const updateRef = _react.default.useRef(0);
|
|
175
177
|
|
|
@@ -48,7 +48,8 @@ const defaultProps = {
|
|
|
48
48
|
closeOnMaskClick: false,
|
|
49
49
|
stopPropagation: ['click'],
|
|
50
50
|
showCloseButton: false,
|
|
51
|
-
getContainer: null
|
|
51
|
+
getContainer: null,
|
|
52
|
+
disableBodyScroll: true
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
const Modal = p => {
|
|
@@ -128,7 +129,8 @@ const Modal = p => {
|
|
|
128
129
|
visible: props.visible,
|
|
129
130
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
130
131
|
style: props.maskStyle,
|
|
131
|
-
className: (0, _classnames.default)(cls('mask'), props.maskClassName)
|
|
132
|
+
className: (0, _classnames.default)(cls('mask'), props.maskClassName),
|
|
133
|
+
disableBodyScroll: props.disableBodyScroll
|
|
132
134
|
}), _react.default.createElement("div", {
|
|
133
135
|
className: cls('wrap'),
|
|
134
136
|
style: {
|
|
@@ -157,9 +157,6 @@ const NumberKeyboard = p => {
|
|
|
157
157
|
onBackspacePressEnd();
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
-
onMouseUp: e => {
|
|
161
|
-
onKeyPress(e, key);
|
|
162
|
-
},
|
|
163
160
|
title: key,
|
|
164
161
|
role: 'button'
|
|
165
162
|
}, key === 'BACKSPACE' ? _react.default.createElement(_antdMobileIcons.TextDeletionOutline, null) : key);
|
|
@@ -196,13 +193,11 @@ const NumberKeyboard = p => {
|
|
|
196
193
|
onKeyPress(e, 'BACKSPACE');
|
|
197
194
|
onBackspacePressEnd();
|
|
198
195
|
},
|
|
199
|
-
onMouseUp: e => onKeyPress(e, 'BACKSPACE'),
|
|
200
196
|
title: 'BACKSPACE',
|
|
201
197
|
role: 'button'
|
|
202
198
|
}, _react.default.createElement(_antdMobileIcons.TextDeletionOutline, null)), _react.default.createElement("div", {
|
|
203
199
|
className: `${classPrefix}-key extra-key ok-key`,
|
|
204
200
|
onTouchEnd: e => onKeyPress(e, 'OK'),
|
|
205
|
-
onMouseUp: e => onKeyPress(e, 'OK'),
|
|
206
201
|
role: 'button'
|
|
207
202
|
}, confirmText))), props.safeArea && _react.default.createElement("div", {
|
|
208
203
|
className: `${classPrefix}-footer`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T): T;
|
|
2
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T): T;
|
|
3
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T | undefined, d: T): T;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.undefinedFallback = undefinedFallback;
|
|
7
|
+
|
|
8
|
+
function undefinedFallback(...items) {
|
|
9
|
+
let i;
|
|
10
|
+
|
|
11
|
+
for (i = 0; i < items.length; i++) {
|
|
12
|
+
if (items[i] !== undefined) break;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return items[i];
|
|
16
|
+
}
|
|
@@ -17,7 +17,8 @@ const defaultProps = {
|
|
|
17
17
|
closeOnAction: false,
|
|
18
18
|
closeOnMaskClick: false,
|
|
19
19
|
stopPropagation: ['click'],
|
|
20
|
-
getContainer: null
|
|
20
|
+
getContainer: null,
|
|
21
|
+
disableBodyScroll: true
|
|
21
22
|
};
|
|
22
23
|
export const Dialog = p => {
|
|
23
24
|
const props = mergeProps(defaultProps, p);
|
|
@@ -93,7 +94,8 @@ export const Dialog = p => {
|
|
|
93
94
|
visible: props.visible,
|
|
94
95
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
95
96
|
style: props.maskStyle,
|
|
96
|
-
className: classNames(cls('mask'), props.maskClassName)
|
|
97
|
+
className: classNames(cls('mask'), props.maskClassName),
|
|
98
|
+
disableBodyScroll: props.disableBodyScroll
|
|
97
99
|
}), React.createElement("div", {
|
|
98
100
|
className: cls('wrap'),
|
|
99
101
|
style: {
|
|
@@ -10,6 +10,7 @@ import List from '../list';
|
|
|
10
10
|
import Popover from '../popover';
|
|
11
11
|
import { QuestionCircleOutline } from 'antd-mobile-icons';
|
|
12
12
|
import { useConfig } from '../config-provider';
|
|
13
|
+
import { undefinedFallback } from '../../utils/undefined-fallback';
|
|
13
14
|
const NAME_SPLIT = '__SPLIT__';
|
|
14
15
|
const classPrefix = `adm-form-item`;
|
|
15
16
|
const MemoInput = React.memo(({
|
|
@@ -142,7 +143,7 @@ export const FormItem = props => {
|
|
|
142
143
|
const {
|
|
143
144
|
validateTrigger: contextValidateTrigger
|
|
144
145
|
} = useContext(FieldContext);
|
|
145
|
-
const mergedValidateTrigger = validateTrigger
|
|
146
|
+
const mergedValidateTrigger = undefinedFallback(validateTrigger, contextValidateTrigger, trigger);
|
|
146
147
|
const updateRef = React.useRef(0);
|
|
147
148
|
updateRef.current += 1;
|
|
148
149
|
const [subMetas, setSubMetas] = useState({});
|
|
@@ -20,7 +20,8 @@ const defaultProps = {
|
|
|
20
20
|
closeOnMaskClick: false,
|
|
21
21
|
stopPropagation: ['click'],
|
|
22
22
|
showCloseButton: false,
|
|
23
|
-
getContainer: null
|
|
23
|
+
getContainer: null,
|
|
24
|
+
disableBodyScroll: true
|
|
24
25
|
};
|
|
25
26
|
export const Modal = p => {
|
|
26
27
|
const props = mergeProps(defaultProps, p);
|
|
@@ -97,7 +98,8 @@ export const Modal = p => {
|
|
|
97
98
|
visible: props.visible,
|
|
98
99
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
99
100
|
style: props.maskStyle,
|
|
100
|
-
className: classNames(cls('mask'), props.maskClassName)
|
|
101
|
+
className: classNames(cls('mask'), props.maskClassName),
|
|
102
|
+
disableBodyScroll: props.disableBodyScroll
|
|
101
103
|
}), React.createElement("div", {
|
|
102
104
|
className: cls('wrap'),
|
|
103
105
|
style: {
|
|
@@ -134,9 +134,6 @@ export const NumberKeyboard = p => {
|
|
|
134
134
|
onBackspacePressEnd();
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
onMouseUp: e => {
|
|
138
|
-
onKeyPress(e, key);
|
|
139
|
-
},
|
|
140
137
|
title: key,
|
|
141
138
|
role: 'button'
|
|
142
139
|
}, key === 'BACKSPACE' ? React.createElement(TextDeletionOutline, null) : key);
|
|
@@ -173,13 +170,11 @@ export const NumberKeyboard = p => {
|
|
|
173
170
|
onKeyPress(e, 'BACKSPACE');
|
|
174
171
|
onBackspacePressEnd();
|
|
175
172
|
},
|
|
176
|
-
onMouseUp: e => onKeyPress(e, 'BACKSPACE'),
|
|
177
173
|
title: 'BACKSPACE',
|
|
178
174
|
role: 'button'
|
|
179
175
|
}, React.createElement(TextDeletionOutline, null)), React.createElement("div", {
|
|
180
176
|
className: `${classPrefix}-key extra-key ok-key`,
|
|
181
177
|
onTouchEnd: e => onKeyPress(e, 'OK'),
|
|
182
|
-
onMouseUp: e => onKeyPress(e, 'OK'),
|
|
183
178
|
role: 'button'
|
|
184
179
|
}, confirmText))), props.safeArea && React.createElement("div", {
|
|
185
180
|
className: `${classPrefix}-footer`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T): T;
|
|
2
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T): T;
|
|
3
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T | undefined, d: T): T;
|
package/2x/package.json
CHANGED
|
@@ -11556,7 +11556,8 @@ const defaultProps$G = {
|
|
|
11556
11556
|
closeOnAction: false,
|
|
11557
11557
|
closeOnMaskClick: false,
|
|
11558
11558
|
stopPropagation: ["click"],
|
|
11559
|
-
getContainer: null
|
|
11559
|
+
getContainer: null,
|
|
11560
|
+
disableBodyScroll: true
|
|
11560
11561
|
};
|
|
11561
11562
|
const Dialog = (p) => {
|
|
11562
11563
|
const props = mergeProps(defaultProps$G, p);
|
|
@@ -11629,7 +11630,8 @@ const Dialog = (p) => {
|
|
|
11629
11630
|
visible: props.visible,
|
|
11630
11631
|
onMaskClick: props.closeOnMaskClick ? props.onClose : void 0,
|
|
11631
11632
|
style: props.maskStyle,
|
|
11632
|
-
className: classNames__default["default"](cls$1("mask"), props.maskClassName)
|
|
11633
|
+
className: classNames__default["default"](cls$1("mask"), props.maskClassName),
|
|
11634
|
+
disableBodyScroll: props.disableBodyScroll
|
|
11633
11635
|
}), React__default["default"].createElement("div", {
|
|
11634
11636
|
className: cls$1("wrap"),
|
|
11635
11637
|
style: {
|
|
@@ -13329,6 +13331,14 @@ const PopoverMenu = React$1.forwardRef((props, ref) => {
|
|
|
13329
13331
|
var Popover = attachPropertiesToComponent(Popover$1, {
|
|
13330
13332
|
Menu: PopoverMenu
|
|
13331
13333
|
});
|
|
13334
|
+
function undefinedFallback(...items) {
|
|
13335
|
+
let i;
|
|
13336
|
+
for (i = 0; i < items.length; i++) {
|
|
13337
|
+
if (items[i] !== void 0)
|
|
13338
|
+
break;
|
|
13339
|
+
}
|
|
13340
|
+
return items[i];
|
|
13341
|
+
}
|
|
13332
13342
|
const NAME_SPLIT = "__SPLIT__";
|
|
13333
13343
|
const classPrefix$H = `adm-form-item`;
|
|
13334
13344
|
const MemoInput = React__default["default"].memo(({
|
|
@@ -13448,7 +13458,7 @@ const FormItem = (props) => {
|
|
|
13448
13458
|
const {
|
|
13449
13459
|
validateTrigger: contextValidateTrigger
|
|
13450
13460
|
} = React$1.useContext(default_1);
|
|
13451
|
-
const mergedValidateTrigger = validateTrigger
|
|
13461
|
+
const mergedValidateTrigger = undefinedFallback(validateTrigger, contextValidateTrigger, trigger);
|
|
13452
13462
|
const updateRef = React__default["default"].useRef(0);
|
|
13453
13463
|
updateRef.current += 1;
|
|
13454
13464
|
const [subMetas, setSubMetas] = React$1.useState({});
|
|
@@ -14725,7 +14735,8 @@ const defaultProps$q = {
|
|
|
14725
14735
|
closeOnMaskClick: false,
|
|
14726
14736
|
stopPropagation: ["click"],
|
|
14727
14737
|
showCloseButton: false,
|
|
14728
|
-
getContainer: null
|
|
14738
|
+
getContainer: null,
|
|
14739
|
+
disableBodyScroll: true
|
|
14729
14740
|
};
|
|
14730
14741
|
const Modal = (p) => {
|
|
14731
14742
|
const props = mergeProps(defaultProps$q, p);
|
|
@@ -14799,7 +14810,8 @@ const Modal = (p) => {
|
|
|
14799
14810
|
visible: props.visible,
|
|
14800
14811
|
onMaskClick: props.closeOnMaskClick ? props.onClose : void 0,
|
|
14801
14812
|
style: props.maskStyle,
|
|
14802
|
-
className: classNames__default["default"](cls("mask"), props.maskClassName)
|
|
14813
|
+
className: classNames__default["default"](cls("mask"), props.maskClassName),
|
|
14814
|
+
disableBodyScroll: props.disableBodyScroll
|
|
14803
14815
|
}), React__default["default"].createElement("div", {
|
|
14804
14816
|
className: cls("wrap"),
|
|
14805
14817
|
style: {
|
|
@@ -15131,9 +15143,6 @@ const NumberKeyboard = (p) => {
|
|
|
15131
15143
|
onBackspacePressEnd();
|
|
15132
15144
|
}
|
|
15133
15145
|
},
|
|
15134
|
-
onMouseUp: (e) => {
|
|
15135
|
-
onKeyPress(e, key);
|
|
15136
|
-
},
|
|
15137
15146
|
title: key,
|
|
15138
15147
|
role: "button"
|
|
15139
15148
|
}, key === "BACKSPACE" ? React__default["default"].createElement(antdMobileIcons.TextDeletionOutline, null) : key);
|
|
@@ -15169,13 +15178,11 @@ const NumberKeyboard = (p) => {
|
|
|
15169
15178
|
onKeyPress(e, "BACKSPACE");
|
|
15170
15179
|
onBackspacePressEnd();
|
|
15171
15180
|
},
|
|
15172
|
-
onMouseUp: (e) => onKeyPress(e, "BACKSPACE"),
|
|
15173
15181
|
title: "BACKSPACE",
|
|
15174
15182
|
role: "button"
|
|
15175
15183
|
}, React__default["default"].createElement(antdMobileIcons.TextDeletionOutline, null)), React__default["default"].createElement("div", {
|
|
15176
15184
|
className: `${classPrefix$r}-key extra-key ok-key`,
|
|
15177
15185
|
onTouchEnd: (e) => onKeyPress(e, "OK"),
|
|
15178
|
-
onMouseUp: (e) => onKeyPress(e, "OK"),
|
|
15179
15186
|
role: "button"
|
|
15180
15187
|
}, confirmText))), props.safeArea && React__default["default"].createElement("div", {
|
|
15181
15188
|
className: `${classPrefix$r}-footer`
|
package/bundle/antd-mobile.es.js
CHANGED
|
@@ -11547,7 +11547,8 @@ const defaultProps$G = {
|
|
|
11547
11547
|
closeOnAction: false,
|
|
11548
11548
|
closeOnMaskClick: false,
|
|
11549
11549
|
stopPropagation: ["click"],
|
|
11550
|
-
getContainer: null
|
|
11550
|
+
getContainer: null,
|
|
11551
|
+
disableBodyScroll: true
|
|
11551
11552
|
};
|
|
11552
11553
|
const Dialog = (p) => {
|
|
11553
11554
|
const props = mergeProps(defaultProps$G, p);
|
|
@@ -11620,7 +11621,8 @@ const Dialog = (p) => {
|
|
|
11620
11621
|
visible: props.visible,
|
|
11621
11622
|
onMaskClick: props.closeOnMaskClick ? props.onClose : void 0,
|
|
11622
11623
|
style: props.maskStyle,
|
|
11623
|
-
className: classNames(cls$1("mask"), props.maskClassName)
|
|
11624
|
+
className: classNames(cls$1("mask"), props.maskClassName),
|
|
11625
|
+
disableBodyScroll: props.disableBodyScroll
|
|
11624
11626
|
}), React$1.createElement("div", {
|
|
11625
11627
|
className: cls$1("wrap"),
|
|
11626
11628
|
style: {
|
|
@@ -13320,6 +13322,14 @@ const PopoverMenu = forwardRef((props, ref) => {
|
|
|
13320
13322
|
var Popover = attachPropertiesToComponent(Popover$1, {
|
|
13321
13323
|
Menu: PopoverMenu
|
|
13322
13324
|
});
|
|
13325
|
+
function undefinedFallback(...items) {
|
|
13326
|
+
let i;
|
|
13327
|
+
for (i = 0; i < items.length; i++) {
|
|
13328
|
+
if (items[i] !== void 0)
|
|
13329
|
+
break;
|
|
13330
|
+
}
|
|
13331
|
+
return items[i];
|
|
13332
|
+
}
|
|
13323
13333
|
const NAME_SPLIT = "__SPLIT__";
|
|
13324
13334
|
const classPrefix$H = `adm-form-item`;
|
|
13325
13335
|
const MemoInput = React$1.memo(({
|
|
@@ -13439,7 +13449,7 @@ const FormItem = (props) => {
|
|
|
13439
13449
|
const {
|
|
13440
13450
|
validateTrigger: contextValidateTrigger
|
|
13441
13451
|
} = useContext(default_1);
|
|
13442
|
-
const mergedValidateTrigger = validateTrigger
|
|
13452
|
+
const mergedValidateTrigger = undefinedFallback(validateTrigger, contextValidateTrigger, trigger);
|
|
13443
13453
|
const updateRef = React$1.useRef(0);
|
|
13444
13454
|
updateRef.current += 1;
|
|
13445
13455
|
const [subMetas, setSubMetas] = useState({});
|
|
@@ -14716,7 +14726,8 @@ const defaultProps$q = {
|
|
|
14716
14726
|
closeOnMaskClick: false,
|
|
14717
14727
|
stopPropagation: ["click"],
|
|
14718
14728
|
showCloseButton: false,
|
|
14719
|
-
getContainer: null
|
|
14729
|
+
getContainer: null,
|
|
14730
|
+
disableBodyScroll: true
|
|
14720
14731
|
};
|
|
14721
14732
|
const Modal = (p) => {
|
|
14722
14733
|
const props = mergeProps(defaultProps$q, p);
|
|
@@ -14790,7 +14801,8 @@ const Modal = (p) => {
|
|
|
14790
14801
|
visible: props.visible,
|
|
14791
14802
|
onMaskClick: props.closeOnMaskClick ? props.onClose : void 0,
|
|
14792
14803
|
style: props.maskStyle,
|
|
14793
|
-
className: classNames(cls("mask"), props.maskClassName)
|
|
14804
|
+
className: classNames(cls("mask"), props.maskClassName),
|
|
14805
|
+
disableBodyScroll: props.disableBodyScroll
|
|
14794
14806
|
}), React$1.createElement("div", {
|
|
14795
14807
|
className: cls("wrap"),
|
|
14796
14808
|
style: {
|
|
@@ -15122,9 +15134,6 @@ const NumberKeyboard = (p) => {
|
|
|
15122
15134
|
onBackspacePressEnd();
|
|
15123
15135
|
}
|
|
15124
15136
|
},
|
|
15125
|
-
onMouseUp: (e) => {
|
|
15126
|
-
onKeyPress(e, key);
|
|
15127
|
-
},
|
|
15128
15137
|
title: key,
|
|
15129
15138
|
role: "button"
|
|
15130
15139
|
}, key === "BACKSPACE" ? React$1.createElement(TextDeletionOutline, null) : key);
|
|
@@ -15160,13 +15169,11 @@ const NumberKeyboard = (p) => {
|
|
|
15160
15169
|
onKeyPress(e, "BACKSPACE");
|
|
15161
15170
|
onBackspacePressEnd();
|
|
15162
15171
|
},
|
|
15163
|
-
onMouseUp: (e) => onKeyPress(e, "BACKSPACE"),
|
|
15164
15172
|
title: "BACKSPACE",
|
|
15165
15173
|
role: "button"
|
|
15166
15174
|
}, React$1.createElement(TextDeletionOutline, null)), React$1.createElement("div", {
|
|
15167
15175
|
className: `${classPrefix$r}-key extra-key ok-key`,
|
|
15168
15176
|
onTouchEnd: (e) => onKeyPress(e, "OK"),
|
|
15169
|
-
onMouseUp: (e) => onKeyPress(e, "OK"),
|
|
15170
15177
|
role: "button"
|
|
15171
15178
|
}, confirmText))), props.safeArea && React$1.createElement("div", {
|
|
15172
15179
|
className: `${classPrefix$r}-footer`
|
|
@@ -43,7 +43,8 @@ const defaultProps = {
|
|
|
43
43
|
closeOnAction: false,
|
|
44
44
|
closeOnMaskClick: false,
|
|
45
45
|
stopPropagation: ['click'],
|
|
46
|
-
getContainer: null
|
|
46
|
+
getContainer: null,
|
|
47
|
+
disableBodyScroll: true
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
const Dialog = p => {
|
|
@@ -122,7 +123,8 @@ const Dialog = p => {
|
|
|
122
123
|
visible: props.visible,
|
|
123
124
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
124
125
|
style: props.maskStyle,
|
|
125
|
-
className: (0, _classnames.default)(cls('mask'), props.maskClassName)
|
|
126
|
+
className: (0, _classnames.default)(cls('mask'), props.maskClassName),
|
|
127
|
+
disableBodyScroll: props.disableBodyScroll
|
|
126
128
|
}), _react.default.createElement("div", {
|
|
127
129
|
className: cls('wrap'),
|
|
128
130
|
style: {
|
|
@@ -29,6 +29,8 @@ var _antdMobileIcons = require("antd-mobile-icons");
|
|
|
29
29
|
|
|
30
30
|
var _configProvider = require("../config-provider");
|
|
31
31
|
|
|
32
|
+
var _undefinedFallback = require("../../utils/undefined-fallback");
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -169,7 +171,7 @@ const FormItem = props => {
|
|
|
169
171
|
const {
|
|
170
172
|
validateTrigger: contextValidateTrigger
|
|
171
173
|
} = (0, _react.useContext)(_FieldContext.default);
|
|
172
|
-
const mergedValidateTrigger =
|
|
174
|
+
const mergedValidateTrigger = (0, _undefinedFallback.undefinedFallback)(validateTrigger, contextValidateTrigger, trigger);
|
|
173
175
|
|
|
174
176
|
const updateRef = _react.default.useRef(0);
|
|
175
177
|
|
|
@@ -48,7 +48,8 @@ const defaultProps = {
|
|
|
48
48
|
closeOnMaskClick: false,
|
|
49
49
|
stopPropagation: ['click'],
|
|
50
50
|
showCloseButton: false,
|
|
51
|
-
getContainer: null
|
|
51
|
+
getContainer: null,
|
|
52
|
+
disableBodyScroll: true
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
const Modal = p => {
|
|
@@ -128,7 +129,8 @@ const Modal = p => {
|
|
|
128
129
|
visible: props.visible,
|
|
129
130
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
130
131
|
style: props.maskStyle,
|
|
131
|
-
className: (0, _classnames.default)(cls('mask'), props.maskClassName)
|
|
132
|
+
className: (0, _classnames.default)(cls('mask'), props.maskClassName),
|
|
133
|
+
disableBodyScroll: props.disableBodyScroll
|
|
132
134
|
}), _react.default.createElement("div", {
|
|
133
135
|
className: cls('wrap'),
|
|
134
136
|
style: {
|
|
@@ -157,9 +157,6 @@ const NumberKeyboard = p => {
|
|
|
157
157
|
onBackspacePressEnd();
|
|
158
158
|
}
|
|
159
159
|
},
|
|
160
|
-
onMouseUp: e => {
|
|
161
|
-
onKeyPress(e, key);
|
|
162
|
-
},
|
|
163
160
|
title: key,
|
|
164
161
|
role: 'button'
|
|
165
162
|
}, key === 'BACKSPACE' ? _react.default.createElement(_antdMobileIcons.TextDeletionOutline, null) : key);
|
|
@@ -196,13 +193,11 @@ const NumberKeyboard = p => {
|
|
|
196
193
|
onKeyPress(e, 'BACKSPACE');
|
|
197
194
|
onBackspacePressEnd();
|
|
198
195
|
},
|
|
199
|
-
onMouseUp: e => onKeyPress(e, 'BACKSPACE'),
|
|
200
196
|
title: 'BACKSPACE',
|
|
201
197
|
role: 'button'
|
|
202
198
|
}, _react.default.createElement(_antdMobileIcons.TextDeletionOutline, null)), _react.default.createElement("div", {
|
|
203
199
|
className: `${classPrefix}-key extra-key ok-key`,
|
|
204
200
|
onTouchEnd: e => onKeyPress(e, 'OK'),
|
|
205
|
-
onMouseUp: e => onKeyPress(e, 'OK'),
|
|
206
201
|
role: 'button'
|
|
207
202
|
}, confirmText))), props.safeArea && _react.default.createElement("div", {
|
|
208
203
|
className: `${classPrefix}-footer`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T): T;
|
|
2
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T): T;
|
|
3
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T | undefined, d: T): T;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.undefinedFallback = undefinedFallback;
|
|
7
|
+
|
|
8
|
+
function undefinedFallback(...items) {
|
|
9
|
+
let i;
|
|
10
|
+
|
|
11
|
+
for (i = 0; i < items.length; i++) {
|
|
12
|
+
if (items[i] !== undefined) break;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return items[i];
|
|
16
|
+
}
|
|
@@ -17,7 +17,8 @@ const defaultProps = {
|
|
|
17
17
|
closeOnAction: false,
|
|
18
18
|
closeOnMaskClick: false,
|
|
19
19
|
stopPropagation: ['click'],
|
|
20
|
-
getContainer: null
|
|
20
|
+
getContainer: null,
|
|
21
|
+
disableBodyScroll: true
|
|
21
22
|
};
|
|
22
23
|
export const Dialog = p => {
|
|
23
24
|
const props = mergeProps(defaultProps, p);
|
|
@@ -93,7 +94,8 @@ export const Dialog = p => {
|
|
|
93
94
|
visible: props.visible,
|
|
94
95
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
95
96
|
style: props.maskStyle,
|
|
96
|
-
className: classNames(cls('mask'), props.maskClassName)
|
|
97
|
+
className: classNames(cls('mask'), props.maskClassName),
|
|
98
|
+
disableBodyScroll: props.disableBodyScroll
|
|
97
99
|
}), React.createElement("div", {
|
|
98
100
|
className: cls('wrap'),
|
|
99
101
|
style: {
|
|
@@ -10,6 +10,7 @@ import List from '../list';
|
|
|
10
10
|
import Popover from '../popover';
|
|
11
11
|
import { QuestionCircleOutline } from 'antd-mobile-icons';
|
|
12
12
|
import { useConfig } from '../config-provider';
|
|
13
|
+
import { undefinedFallback } from '../../utils/undefined-fallback';
|
|
13
14
|
const NAME_SPLIT = '__SPLIT__';
|
|
14
15
|
const classPrefix = `adm-form-item`;
|
|
15
16
|
const MemoInput = React.memo(({
|
|
@@ -142,7 +143,7 @@ export const FormItem = props => {
|
|
|
142
143
|
const {
|
|
143
144
|
validateTrigger: contextValidateTrigger
|
|
144
145
|
} = useContext(FieldContext);
|
|
145
|
-
const mergedValidateTrigger = validateTrigger
|
|
146
|
+
const mergedValidateTrigger = undefinedFallback(validateTrigger, contextValidateTrigger, trigger);
|
|
146
147
|
const updateRef = React.useRef(0);
|
|
147
148
|
updateRef.current += 1;
|
|
148
149
|
const [subMetas, setSubMetas] = useState({});
|
|
@@ -20,7 +20,8 @@ const defaultProps = {
|
|
|
20
20
|
closeOnMaskClick: false,
|
|
21
21
|
stopPropagation: ['click'],
|
|
22
22
|
showCloseButton: false,
|
|
23
|
-
getContainer: null
|
|
23
|
+
getContainer: null,
|
|
24
|
+
disableBodyScroll: true
|
|
24
25
|
};
|
|
25
26
|
export const Modal = p => {
|
|
26
27
|
const props = mergeProps(defaultProps, p);
|
|
@@ -97,7 +98,8 @@ export const Modal = p => {
|
|
|
97
98
|
visible: props.visible,
|
|
98
99
|
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
99
100
|
style: props.maskStyle,
|
|
100
|
-
className: classNames(cls('mask'), props.maskClassName)
|
|
101
|
+
className: classNames(cls('mask'), props.maskClassName),
|
|
102
|
+
disableBodyScroll: props.disableBodyScroll
|
|
101
103
|
}), React.createElement("div", {
|
|
102
104
|
className: cls('wrap'),
|
|
103
105
|
style: {
|
|
@@ -134,9 +134,6 @@ export const NumberKeyboard = p => {
|
|
|
134
134
|
onBackspacePressEnd();
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
onMouseUp: e => {
|
|
138
|
-
onKeyPress(e, key);
|
|
139
|
-
},
|
|
140
137
|
title: key,
|
|
141
138
|
role: 'button'
|
|
142
139
|
}, key === 'BACKSPACE' ? React.createElement(TextDeletionOutline, null) : key);
|
|
@@ -173,13 +170,11 @@ export const NumberKeyboard = p => {
|
|
|
173
170
|
onKeyPress(e, 'BACKSPACE');
|
|
174
171
|
onBackspacePressEnd();
|
|
175
172
|
},
|
|
176
|
-
onMouseUp: e => onKeyPress(e, 'BACKSPACE'),
|
|
177
173
|
title: 'BACKSPACE',
|
|
178
174
|
role: 'button'
|
|
179
175
|
}, React.createElement(TextDeletionOutline, null)), React.createElement("div", {
|
|
180
176
|
className: `${classPrefix}-key extra-key ok-key`,
|
|
181
177
|
onTouchEnd: e => onKeyPress(e, 'OK'),
|
|
182
|
-
onMouseUp: e => onKeyPress(e, 'OK'),
|
|
183
178
|
role: 'button'
|
|
184
179
|
}, confirmText))), props.safeArea && React.createElement("div", {
|
|
185
180
|
className: `${classPrefix}-footer`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T): T;
|
|
2
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T): T;
|
|
3
|
+
export declare function undefinedFallback<T>(a: T | undefined, b: T | undefined, c: T | undefined, d: T): T;
|