antd-mobile 5.14.2 → 5.14.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.
- package/2x/bundle/antd-mobile.cjs.js +23 -11
- package/2x/bundle/antd-mobile.es.js +24 -12
- package/2x/cjs/components/form/form-subscribe.d.ts +7 -2
- package/2x/cjs/components/form/form-subscribe.js +30 -12
- package/2x/cjs/components/form/index.d.ts +1 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +1 -0
- package/2x/cjs/components/toast/toast.js +6 -2
- package/2x/es/components/form/form-subscribe.d.ts +7 -2
- package/2x/es/components/form/form-subscribe.js +21 -11
- package/2x/es/components/form/index.d.ts +1 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +1 -0
- package/2x/es/components/toast/toast.js +6 -2
- package/2x/package.json +1 -1
- package/2x/umd/antd-mobile.js +1 -1
- package/bundle/antd-mobile.cjs.js +23 -11
- package/bundle/antd-mobile.es.js +24 -12
- package/cjs/components/form/form-subscribe.d.ts +7 -2
- package/cjs/components/form/form-subscribe.js +30 -12
- package/cjs/components/form/index.d.ts +1 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +1 -0
- package/cjs/components/toast/toast.js +6 -2
- package/es/components/form/form-subscribe.d.ts +7 -2
- package/es/components/form/form-subscribe.js +21 -11
- package/es/components/form/index.d.ts +1 -1
- package/es/components/infinite-scroll/infinite-scroll.js +1 -0
- package/es/components/toast/toast.js +6 -2
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -14471,18 +14471,25 @@ const FormItem = (props) => {
|
|
|
14471
14471
|
return renderLayout(childNode, fieldId, meta, isRequired);
|
|
14472
14472
|
});
|
|
14473
14473
|
};
|
|
14474
|
-
const FormSubscribe = ({
|
|
14475
|
-
|
|
14476
|
-
to
|
|
14477
|
-
}) => {
|
|
14474
|
+
const FormSubscribe = (props) => {
|
|
14475
|
+
const update = ahooks.useUpdate();
|
|
14478
14476
|
return React__default["default"].createElement(Form.Item, {
|
|
14479
14477
|
noStyle: true,
|
|
14480
|
-
dependencies: to
|
|
14481
|
-
}, (form) => {
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14478
|
+
dependencies: props.to
|
|
14479
|
+
}, (form) => React__default["default"].createElement(React__default["default"].Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map((namePath) => React__default["default"].createElement(Watcher, {
|
|
14480
|
+
key: namePath.toString(),
|
|
14481
|
+
form,
|
|
14482
|
+
namePath,
|
|
14483
|
+
onChange: update
|
|
14484
|
+
}))));
|
|
14485
14485
|
};
|
|
14486
|
+
const Watcher = React$1.memo((props) => {
|
|
14487
|
+
const value = RcForm.useWatch(props.namePath, props.form);
|
|
14488
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
14489
|
+
props.onChange();
|
|
14490
|
+
}, [value]);
|
|
14491
|
+
return null;
|
|
14492
|
+
});
|
|
14486
14493
|
var Form = attachPropertiesToComponent(Form$1, {
|
|
14487
14494
|
Item: FormItem,
|
|
14488
14495
|
Subscribe: FormSubscribe,
|
|
@@ -15500,6 +15507,7 @@ const InfiniteScroll = (p2) => {
|
|
|
15500
15507
|
function retry() {
|
|
15501
15508
|
setFailed(false);
|
|
15502
15509
|
doLoadMore(true);
|
|
15510
|
+
setFlag(nextFlagRef.current);
|
|
15503
15511
|
}
|
|
15504
15512
|
return withNativeProps(props, React__default["default"].createElement("div", {
|
|
15505
15513
|
className: classPrefix$y,
|
|
@@ -18229,9 +18237,13 @@ const InternalToast = (p2) => {
|
|
|
18229
18237
|
return null;
|
|
18230
18238
|
switch (icon) {
|
|
18231
18239
|
case "success":
|
|
18232
|
-
return React__default["default"].createElement(antdMobileIcons.CheckOutline,
|
|
18240
|
+
return React__default["default"].createElement(antdMobileIcons.CheckOutline, {
|
|
18241
|
+
className: `${classPrefix$4}-icon-success`
|
|
18242
|
+
});
|
|
18233
18243
|
case "fail":
|
|
18234
|
-
return React__default["default"].createElement(antdMobileIcons.CloseOutline,
|
|
18244
|
+
return React__default["default"].createElement(antdMobileIcons.CloseOutline, {
|
|
18245
|
+
className: `${classPrefix$4}-icon-fail`
|
|
18246
|
+
});
|
|
18235
18247
|
case "loading":
|
|
18236
18248
|
return React__default["default"].createElement(SpinLoading, {
|
|
18237
18249
|
color: "white",
|
|
@@ -8,7 +8,7 @@ import { isFragment, isMemo } from "react-is";
|
|
|
8
8
|
import { useDrag, useWheel, createUseGesture, dragAction, pinchAction } from "@use-gesture/react";
|
|
9
9
|
import { RightOutline, CheckOutline, DownOutline, DownFill, QuestionCircleOutline, CloseOutline, AddOutline, CloseCircleFill, LeftOutline, SoundOutline, TextDeletionOutline, StarFill, CheckCircleFill, InformationCircleFill, ClockCircleFill, ExclamationCircleFill, SearchOutline, MinusOutline } from "antd-mobile-icons";
|
|
10
10
|
import { staged } from "staged-components";
|
|
11
|
-
import RcForm, { List as List$2, Field,
|
|
11
|
+
import RcForm, { List as List$2, Field, useWatch, useForm } from "rc-field-form";
|
|
12
12
|
import { computePosition, offset, shift, limitShift, flip, hide, arrow, autoUpdate } from "@floating-ui/dom";
|
|
13
13
|
import Big from "big.js";
|
|
14
14
|
function _mergeNamespaces(n2, m2) {
|
|
@@ -14461,18 +14461,25 @@ const FormItem = (props) => {
|
|
|
14461
14461
|
return renderLayout(childNode, fieldId, meta, isRequired);
|
|
14462
14462
|
});
|
|
14463
14463
|
};
|
|
14464
|
-
const FormSubscribe = ({
|
|
14465
|
-
|
|
14466
|
-
to: to2
|
|
14467
|
-
}) => {
|
|
14464
|
+
const FormSubscribe = (props) => {
|
|
14465
|
+
const update = useUpdate();
|
|
14468
14466
|
return React$1.createElement(Form.Item, {
|
|
14469
14467
|
noStyle: true,
|
|
14470
|
-
dependencies:
|
|
14471
|
-
}, (form) => {
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14468
|
+
dependencies: props.to
|
|
14469
|
+
}, (form) => React$1.createElement(React$1.Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map((namePath) => React$1.createElement(Watcher, {
|
|
14470
|
+
key: namePath.toString(),
|
|
14471
|
+
form,
|
|
14472
|
+
namePath,
|
|
14473
|
+
onChange: update
|
|
14474
|
+
}))));
|
|
14475
14475
|
};
|
|
14476
|
+
const Watcher = memo((props) => {
|
|
14477
|
+
const value = useWatch(props.namePath, props.form);
|
|
14478
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
14479
|
+
props.onChange();
|
|
14480
|
+
}, [value]);
|
|
14481
|
+
return null;
|
|
14482
|
+
});
|
|
14476
14483
|
var Form = attachPropertiesToComponent(Form$1, {
|
|
14477
14484
|
Item: FormItem,
|
|
14478
14485
|
Subscribe: FormSubscribe,
|
|
@@ -15490,6 +15497,7 @@ const InfiniteScroll = (p2) => {
|
|
|
15490
15497
|
function retry() {
|
|
15491
15498
|
setFailed(false);
|
|
15492
15499
|
doLoadMore(true);
|
|
15500
|
+
setFlag(nextFlagRef.current);
|
|
15493
15501
|
}
|
|
15494
15502
|
return withNativeProps(props, React$1.createElement("div", {
|
|
15495
15503
|
className: classPrefix$y,
|
|
@@ -18219,9 +18227,13 @@ const InternalToast = (p2) => {
|
|
|
18219
18227
|
return null;
|
|
18220
18228
|
switch (icon) {
|
|
18221
18229
|
case "success":
|
|
18222
|
-
return React$1.createElement(CheckOutline,
|
|
18230
|
+
return React$1.createElement(CheckOutline, {
|
|
18231
|
+
className: `${classPrefix$4}-icon-success`
|
|
18232
|
+
});
|
|
18223
18233
|
case "fail":
|
|
18224
|
-
return React$1.createElement(CloseOutline,
|
|
18234
|
+
return React$1.createElement(CloseOutline, {
|
|
18235
|
+
className: `${classPrefix$4}-icon-fail`
|
|
18236
|
+
});
|
|
18225
18237
|
case "loading":
|
|
18226
18238
|
return React$1.createElement(SpinLoading, {
|
|
18227
18239
|
color: "white",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import type { FormInstance } from 'rc-field-form';
|
|
3
3
|
import type { NamePath } from 'rc-field-form/es/interface';
|
|
4
4
|
declare type RenderChildren<Values = any> = (changedValues: Record<string, any>, form: FormInstance<Values>) => React.ReactNode;
|
|
@@ -7,5 +7,10 @@ export interface FormSubscribeProps {
|
|
|
7
7
|
to: NamePath[];
|
|
8
8
|
children: ChildrenType;
|
|
9
9
|
}
|
|
10
|
-
export declare const FormSubscribe:
|
|
10
|
+
export declare const FormSubscribe: FC<FormSubscribeProps>;
|
|
11
|
+
export declare const Watcher: React.NamedExoticComponent<{
|
|
12
|
+
form: FormInstance;
|
|
13
|
+
namePath: NamePath;
|
|
14
|
+
onChange: () => void;
|
|
15
|
+
}>;
|
|
11
16
|
export {};
|
|
@@ -3,25 +3,43 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.FormSubscribe = void 0;
|
|
6
|
+
exports.Watcher = exports.FormSubscribe = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _rcFieldForm = require("rc-field-form");
|
|
11
|
+
|
|
12
|
+
var _ahooks = require("ahooks");
|
|
9
13
|
|
|
10
14
|
var _ = _interopRequireDefault(require("."));
|
|
11
15
|
|
|
16
|
+
var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
|
|
17
|
+
|
|
12
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
const FormSubscribe = props => {
|
|
25
|
+
const update = (0, _ahooks.useUpdate)();
|
|
18
26
|
return _react.default.createElement(_.default.Item, {
|
|
19
27
|
noStyle: true,
|
|
20
|
-
dependencies: to
|
|
21
|
-
}, form => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
dependencies: props.to
|
|
29
|
+
}, form => _react.default.createElement(_react.default.Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map(namePath => _react.default.createElement(Watcher, {
|
|
30
|
+
key: namePath.toString(),
|
|
31
|
+
form: form,
|
|
32
|
+
namePath: namePath,
|
|
33
|
+
onChange: update
|
|
34
|
+
}))));
|
|
25
35
|
};
|
|
26
36
|
|
|
27
|
-
exports.FormSubscribe = FormSubscribe;
|
|
37
|
+
exports.FormSubscribe = FormSubscribe;
|
|
38
|
+
const Watcher = (0, _react.memo)(props => {
|
|
39
|
+
const value = (0, _rcFieldForm.useWatch)(props.namePath, props.form);
|
|
40
|
+
(0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(() => {
|
|
41
|
+
props.onChange();
|
|
42
|
+
}, [value]);
|
|
43
|
+
return null;
|
|
44
|
+
});
|
|
45
|
+
exports.Watcher = Watcher;
|
|
@@ -12,7 +12,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<import("r
|
|
|
12
12
|
mode?: "default" | "card" | undefined;
|
|
13
13
|
} & import("react").RefAttributes<import("./form").FormInstance>> & {
|
|
14
14
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
15
|
-
Subscribe: import("react").
|
|
15
|
+
Subscribe: import("react").FC<import("./form-subscribe").FormSubscribeProps>;
|
|
16
16
|
Header: import("react").FC<{
|
|
17
17
|
children?: import("react").ReactNode;
|
|
18
18
|
}>;
|
|
@@ -44,10 +44,14 @@ const InternalToast = p => {
|
|
|
44
44
|
|
|
45
45
|
switch (icon) {
|
|
46
46
|
case 'success':
|
|
47
|
-
return _react.default.createElement(_antdMobileIcons.CheckOutline,
|
|
47
|
+
return _react.default.createElement(_antdMobileIcons.CheckOutline, {
|
|
48
|
+
className: `${classPrefix}-icon-success`
|
|
49
|
+
});
|
|
48
50
|
|
|
49
51
|
case 'fail':
|
|
50
|
-
return _react.default.createElement(_antdMobileIcons.CloseOutline,
|
|
52
|
+
return _react.default.createElement(_antdMobileIcons.CloseOutline, {
|
|
53
|
+
className: `${classPrefix}-icon-fail`
|
|
54
|
+
});
|
|
51
55
|
|
|
52
56
|
case 'loading':
|
|
53
57
|
return _react.default.createElement(_spinLoading.default, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import type { FormInstance } from 'rc-field-form';
|
|
3
3
|
import type { NamePath } from 'rc-field-form/es/interface';
|
|
4
4
|
declare type RenderChildren<Values = any> = (changedValues: Record<string, any>, form: FormInstance<Values>) => React.ReactNode;
|
|
@@ -7,5 +7,10 @@ export interface FormSubscribeProps {
|
|
|
7
7
|
to: NamePath[];
|
|
8
8
|
children: ChildrenType;
|
|
9
9
|
}
|
|
10
|
-
export declare const FormSubscribe:
|
|
10
|
+
export declare const FormSubscribe: FC<FormSubscribeProps>;
|
|
11
|
+
export declare const Watcher: React.NamedExoticComponent<{
|
|
12
|
+
form: FormInstance;
|
|
13
|
+
namePath: NamePath;
|
|
14
|
+
onChange: () => void;
|
|
15
|
+
}>;
|
|
11
16
|
export {};
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { useWatch } from 'rc-field-form';
|
|
3
|
+
import { useUpdate } from 'ahooks';
|
|
2
4
|
import Form from '.';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}) => {
|
|
5
|
+
import { useIsomorphicUpdateLayoutEffect } from '../../utils/use-isomorphic-update-layout-effect';
|
|
6
|
+
export const FormSubscribe = props => {
|
|
7
|
+
const update = useUpdate();
|
|
7
8
|
return React.createElement(Form.Item, {
|
|
8
9
|
noStyle: true,
|
|
9
|
-
dependencies: to
|
|
10
|
-
}, form => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
dependencies: props.to
|
|
11
|
+
}, form => React.createElement(React.Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map(namePath => React.createElement(Watcher, {
|
|
12
|
+
key: namePath.toString(),
|
|
13
|
+
form: form,
|
|
14
|
+
namePath: namePath,
|
|
15
|
+
onChange: update
|
|
16
|
+
}))));
|
|
17
|
+
};
|
|
18
|
+
export const Watcher = memo(props => {
|
|
19
|
+
const value = useWatch(props.namePath, props.form);
|
|
20
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
21
|
+
props.onChange();
|
|
22
|
+
}, [value]);
|
|
23
|
+
return null;
|
|
24
|
+
});
|
|
@@ -12,7 +12,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<import("r
|
|
|
12
12
|
mode?: "default" | "card" | undefined;
|
|
13
13
|
} & import("react").RefAttributes<import("./form").FormInstance>> & {
|
|
14
14
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
15
|
-
Subscribe: import("react").
|
|
15
|
+
Subscribe: import("react").FC<import("./form-subscribe").FormSubscribeProps>;
|
|
16
16
|
Header: import("react").FC<{
|
|
17
17
|
children?: import("react").ReactNode;
|
|
18
18
|
}>;
|
|
@@ -23,10 +23,14 @@ export const InternalToast = p => {
|
|
|
23
23
|
|
|
24
24
|
switch (icon) {
|
|
25
25
|
case 'success':
|
|
26
|
-
return React.createElement(CheckOutline,
|
|
26
|
+
return React.createElement(CheckOutline, {
|
|
27
|
+
className: `${classPrefix}-icon-success`
|
|
28
|
+
});
|
|
27
29
|
|
|
28
30
|
case 'fail':
|
|
29
|
-
return React.createElement(CloseOutline,
|
|
31
|
+
return React.createElement(CloseOutline, {
|
|
32
|
+
className: `${classPrefix}-icon-fail`
|
|
33
|
+
});
|
|
30
34
|
|
|
31
35
|
case 'loading':
|
|
32
36
|
return React.createElement(SpinLoading, {
|