antd-mobile 5.4.0 → 5.6.0
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/action-sheet/action-sheet.d.ts +5 -5
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -46
- package/2x/cjs/components/action-sheet/index.d.ts +1 -1
- package/2x/cjs/components/badge/badge.js +1 -1
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.js +7 -0
- package/2x/cjs/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/2x/cjs/components/check-list/check-list-item.js +1 -1
- package/2x/cjs/components/checkbox/checkbox.js +4 -8
- package/2x/cjs/components/checkbox/native-input.d.ts +10 -0
- package/2x/cjs/components/checkbox/native-input.js +42 -0
- package/2x/cjs/components/dialog/index.d.ts +1 -1
- package/2x/cjs/components/dialog/show.d.ts +2 -4
- package/2x/cjs/components/dialog/show.js +9 -47
- package/2x/cjs/components/dot-loading/dot-loading.js +1 -2
- package/2x/cjs/components/error-block/error-block.js +4 -2
- package/2x/cjs/components/floating-bubble/floating-bubble.css +2 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.js +14 -5
- package/2x/cjs/components/form/form-array.d.ts +19 -0
- package/2x/cjs/components/form/form-array.js +52 -0
- package/2x/cjs/components/form/form-item.css +6 -1
- package/2x/cjs/components/form/form-item.js +24 -8
- package/2x/cjs/components/form/form.css +5 -0
- package/2x/cjs/components/form/form.js +16 -5
- package/2x/cjs/components/form/index.css +11 -1
- package/2x/cjs/components/form/index.d.ts +2 -0
- package/2x/cjs/components/form/index.js +3 -0
- package/2x/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +17 -1
- package/2x/cjs/components/image-viewer/index.d.ts +1 -1
- package/2x/cjs/components/image-viewer/methods.d.ts +3 -4
- package/2x/cjs/components/image-viewer/methods.js +41 -56
- package/2x/cjs/components/modal/index.d.ts +1 -1
- package/2x/cjs/components/modal/show.d.ts +2 -4
- package/2x/cjs/components/modal/show.js +9 -47
- package/2x/cjs/components/popover/index.d.ts +7 -2
- package/2x/cjs/components/popover/normalize-placement.d.ts +2 -0
- package/2x/cjs/components/popover/normalize-placement.js +22 -0
- package/2x/cjs/components/popover/popover.css +0 -104
- package/2x/cjs/components/popover/popover.d.ts +11 -5
- package/2x/cjs/components/popover/popover.js +127 -22
- package/2x/cjs/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/2x/cjs/components/popover/temp-floating-ui.min.js +1 -0
- package/2x/cjs/components/popover/wrapper.d.ts +7 -0
- package/2x/cjs/components/popover/wrapper.js +41 -0
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/2x/cjs/components/radio/radio.js +4 -8
- package/2x/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.d.ts +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.js +1 -1
- package/2x/cjs/components/tree-select/tree-select.js +2 -2
- package/2x/cjs/utils/render-imperatively.d.ts +10 -0
- package/2x/cjs/utils/render-imperatively.js +58 -0
- package/2x/cjs/utils/use-props-value.d.ts +2 -1
- package/2x/cjs/utils/use-props-value.js +4 -2
- package/2x/es/components/action-sheet/action-sheet.d.ts +5 -5
- package/2x/es/components/action-sheet/action-sheet.js +5 -41
- package/2x/es/components/action-sheet/index.d.ts +1 -1
- package/2x/es/components/badge/badge.js +1 -1
- package/2x/es/components/cascader-view/cascader-view.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.js +7 -0
- package/2x/es/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/2x/es/components/check-list/check-list-item.js +1 -1
- package/2x/es/components/checkbox/checkbox.js +3 -8
- package/2x/es/components/checkbox/native-input.d.ts +10 -0
- package/2x/es/components/checkbox/native-input.js +28 -0
- package/2x/es/components/dialog/index.d.ts +1 -1
- package/2x/es/components/dialog/show.d.ts +2 -4
- package/2x/es/components/dialog/show.js +8 -44
- package/2x/es/components/dot-loading/dot-loading.js +1 -2
- package/2x/es/components/error-block/error-block.js +4 -2
- package/2x/es/components/floating-bubble/floating-bubble.css +2 -1
- package/2x/es/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/2x/es/components/floating-bubble/floating-bubble.js +14 -5
- package/2x/es/components/form/form-array.d.ts +19 -0
- package/2x/es/components/form/form-array.js +38 -0
- package/2x/es/components/form/form-item.css +6 -1
- package/2x/es/components/form/form-item.js +22 -8
- package/2x/es/components/form/form.css +5 -0
- package/2x/es/components/form/form.js +15 -5
- package/2x/es/components/form/index.css +11 -1
- package/2x/es/components/form/index.d.ts +2 -0
- package/2x/es/components/form/index.js +2 -0
- package/2x/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +17 -1
- package/2x/es/components/image-viewer/index.d.ts +1 -1
- package/2x/es/components/image-viewer/methods.d.ts +3 -4
- package/2x/es/components/image-viewer/methods.js +38 -57
- package/2x/es/components/modal/index.d.ts +1 -1
- package/2x/es/components/modal/show.d.ts +2 -4
- package/2x/es/components/modal/show.js +8 -44
- package/2x/es/components/popover/index.d.ts +7 -2
- package/2x/es/components/popover/normalize-placement.d.ts +2 -0
- package/2x/es/components/popover/normalize-placement.js +15 -0
- package/2x/es/components/popover/popover.css +0 -104
- package/2x/es/components/popover/popover.d.ts +11 -5
- package/2x/es/components/popover/popover.js +119 -22
- package/2x/es/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/2x/es/components/popover/temp-floating-ui.min.js +1 -0
- package/2x/es/components/popover/wrapper.d.ts +7 -0
- package/2x/es/components/popover/wrapper.js +28 -0
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/2x/es/components/radio/radio.js +3 -8
- package/2x/es/components/search-bar/search-bar.d.ts +1 -1
- package/2x/es/components/tab-bar/tab-bar.d.ts +1 -1
- package/2x/es/components/tab-bar/tab-bar.js +1 -1
- package/2x/es/components/tree-select/tree-select.js +2 -2
- package/2x/es/utils/render-imperatively.d.ts +10 -0
- package/2x/es/utils/render-imperatively.js +45 -0
- package/2x/es/utils/use-props-value.d.ts +2 -1
- package/2x/es/utils/use-props-value.js +4 -2
- package/2x/package.json +3 -4
- package/cjs/components/action-sheet/action-sheet.d.ts +5 -5
- package/cjs/components/action-sheet/action-sheet.js +6 -46
- package/cjs/components/action-sheet/index.d.ts +1 -1
- package/cjs/components/badge/badge.js +1 -1
- package/cjs/components/cascader-view/cascader-view.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.js +7 -0
- package/cjs/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/cjs/components/check-list/check-list-item.js +1 -1
- package/cjs/components/checkbox/checkbox.js +4 -8
- package/cjs/components/checkbox/native-input.d.ts +10 -0
- package/cjs/components/checkbox/native-input.js +42 -0
- package/cjs/components/dialog/index.d.ts +1 -1
- package/cjs/components/dialog/show.d.ts +2 -4
- package/cjs/components/dialog/show.js +9 -47
- package/cjs/components/dot-loading/dot-loading.js +1 -2
- package/cjs/components/error-block/error-block.js +4 -2
- package/cjs/components/floating-bubble/floating-bubble.css +2 -1
- package/cjs/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/cjs/components/floating-bubble/floating-bubble.js +14 -5
- package/cjs/components/form/form-array.d.ts +19 -0
- package/cjs/components/form/form-array.js +52 -0
- package/cjs/components/form/form-item.css +5 -1
- package/cjs/components/form/form-item.js +24 -8
- package/cjs/components/form/form.css +4 -0
- package/cjs/components/form/form.js +16 -5
- package/cjs/components/form/index.css +9 -1
- package/cjs/components/form/index.d.ts +2 -0
- package/cjs/components/form/index.js +3 -0
- package/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/cjs/components/image-uploader/image-uploader.js +17 -1
- package/cjs/components/image-viewer/index.d.ts +1 -1
- package/cjs/components/image-viewer/methods.d.ts +3 -4
- package/cjs/components/image-viewer/methods.js +41 -56
- package/cjs/components/modal/index.d.ts +1 -1
- package/cjs/components/modal/show.d.ts +2 -4
- package/cjs/components/modal/show.js +9 -47
- package/cjs/components/popover/index.d.ts +7 -2
- package/cjs/components/popover/normalize-placement.d.ts +2 -0
- package/cjs/components/popover/normalize-placement.js +22 -0
- package/cjs/components/popover/popover.css +0 -84
- package/cjs/components/popover/popover.d.ts +11 -5
- package/cjs/components/popover/popover.js +127 -22
- package/cjs/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/cjs/components/popover/temp-floating-ui.min.js +1 -0
- package/cjs/components/popover/wrapper.d.ts +7 -0
- package/cjs/components/popover/wrapper.js +41 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/cjs/components/radio/radio.js +4 -8
- package/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/cjs/components/tab-bar/tab-bar.d.ts +1 -1
- package/cjs/components/tab-bar/tab-bar.js +1 -1
- package/cjs/components/tree-select/tree-select.js +2 -2
- package/cjs/utils/render-imperatively.d.ts +10 -0
- package/cjs/utils/render-imperatively.js +58 -0
- package/cjs/utils/use-props-value.d.ts +2 -1
- package/cjs/utils/use-props-value.js +4 -2
- package/es/components/action-sheet/action-sheet.d.ts +5 -5
- package/es/components/action-sheet/action-sheet.js +5 -41
- package/es/components/action-sheet/index.d.ts +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/cascader-view/cascader-view.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.js +7 -0
- package/es/components/cascader-view/use-cascader-value-extend.js +23 -0
- package/es/components/check-list/check-list-item.js +1 -1
- package/es/components/checkbox/checkbox.js +3 -8
- package/es/components/checkbox/native-input.d.ts +10 -0
- package/es/components/checkbox/native-input.js +28 -0
- package/es/components/dialog/index.d.ts +1 -1
- package/es/components/dialog/show.d.ts +2 -4
- package/es/components/dialog/show.js +8 -44
- package/es/components/dot-loading/dot-loading.js +1 -2
- package/es/components/error-block/error-block.js +4 -2
- package/es/components/floating-bubble/floating-bubble.css +2 -1
- package/es/components/floating-bubble/floating-bubble.d.ts +1 -1
- package/es/components/floating-bubble/floating-bubble.js +14 -5
- package/es/components/form/form-array.d.ts +19 -0
- package/es/components/form/form-array.js +38 -0
- package/es/components/form/form-item.css +5 -1
- package/es/components/form/form-item.js +22 -8
- package/es/components/form/form.css +4 -0
- package/es/components/form/form.js +15 -5
- package/es/components/form/index.css +9 -1
- package/es/components/form/index.d.ts +2 -0
- package/es/components/form/index.js +2 -0
- package/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/es/components/image-uploader/image-uploader.js +17 -1
- package/es/components/image-viewer/index.d.ts +1 -1
- package/es/components/image-viewer/methods.d.ts +3 -4
- package/es/components/image-viewer/methods.js +38 -57
- package/es/components/modal/index.d.ts +1 -1
- package/es/components/modal/show.d.ts +2 -4
- package/es/components/modal/show.js +8 -44
- package/es/components/popover/index.d.ts +7 -2
- package/es/components/popover/normalize-placement.d.ts +2 -0
- package/es/components/popover/normalize-placement.js +15 -0
- package/es/components/popover/popover.css +0 -84
- package/es/components/popover/popover.d.ts +11 -5
- package/es/components/popover/popover.js +119 -22
- package/es/components/popover/temp-floating-ui.min.d.ts +1 -0
- package/es/components/popover/temp-floating-ui.min.js +1 -0
- package/es/components/popover/wrapper.d.ts +7 -0
- package/es/components/popover/wrapper.js +28 -0
- package/es/components/pull-to-refresh/pull-to-refresh.js +24 -9
- package/es/components/radio/radio.js +3 -8
- package/es/components/search-bar/search-bar.d.ts +1 -1
- package/es/components/tab-bar/tab-bar.d.ts +1 -1
- package/es/components/tab-bar/tab-bar.js +1 -1
- package/es/components/tree-select/tree-select.js +2 -2
- package/es/utils/render-imperatively.d.ts +10 -0
- package/es/utils/render-imperatively.js +45 -0
- package/es/utils/use-props-value.d.ts +2 -1
- package/es/utils/use-props-value.js +4 -2
- package/package.json +3 -4
- package/umd/antd-mobile.js +1 -1
|
@@ -47,15 +47,15 @@ const FloatingBubble = p => {
|
|
|
47
47
|
let nextX = state.offset[0];
|
|
48
48
|
let nextY = state.offset[1];
|
|
49
49
|
|
|
50
|
-
if (state.last) {
|
|
50
|
+
if (state.last && props.magnetic) {
|
|
51
51
|
const boundary = boundaryRef.current;
|
|
52
52
|
const button = buttonRef.current;
|
|
53
53
|
if (!boundary || !button) return;
|
|
54
|
+
const boundaryRect = boundary.getBoundingClientRect();
|
|
55
|
+
const buttonRect = button.getBoundingClientRect();
|
|
54
56
|
|
|
55
57
|
if (props.magnetic === 'x') {
|
|
56
58
|
const compensation = x.goal - x.get();
|
|
57
|
-
const boundaryRect = boundary.getBoundingClientRect();
|
|
58
|
-
const buttonRect = button.getBoundingClientRect();
|
|
59
59
|
const leftDistance = buttonRect.left + compensation - boundaryRect.left;
|
|
60
60
|
const rightDistance = boundaryRect.right - (buttonRect.right + compensation);
|
|
61
61
|
|
|
@@ -64,13 +64,22 @@ const FloatingBubble = p => {
|
|
|
64
64
|
} else {
|
|
65
65
|
nextX -= leftDistance;
|
|
66
66
|
}
|
|
67
|
+
} else if (props.magnetic === 'y') {
|
|
68
|
+
const compensation = y.goal - y.get();
|
|
69
|
+
const topDistance = buttonRect.top + compensation - boundaryRect.top;
|
|
70
|
+
const bottomDistance = boundaryRect.bottom - (buttonRect.bottom + compensation);
|
|
71
|
+
|
|
72
|
+
if (bottomDistance <= topDistance) {
|
|
73
|
+
nextY += bottomDistance;
|
|
74
|
+
} else {
|
|
75
|
+
nextY -= topDistance;
|
|
76
|
+
}
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
api.start({
|
|
71
81
|
x: nextX,
|
|
72
|
-
y: nextY
|
|
73
|
-
|
|
82
|
+
y: nextY
|
|
74
83
|
}); // active status
|
|
75
84
|
|
|
76
85
|
api.start({
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { StoreValue } from 'rc-field-form/es/interface';
|
|
3
|
+
export interface FormArrayField {
|
|
4
|
+
index: number;
|
|
5
|
+
key: number;
|
|
6
|
+
}
|
|
7
|
+
export interface FormArrayOperation {
|
|
8
|
+
add: (defaultValue?: StoreValue, insertIndex?: number) => void;
|
|
9
|
+
remove: (index: number | number[]) => void;
|
|
10
|
+
move: (from: number, to: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface FormArrayProps {
|
|
13
|
+
name: string | number | (string | number)[];
|
|
14
|
+
initialValue?: any[];
|
|
15
|
+
renderHeader?: (field: FormArrayField, operation: FormArrayOperation) => ReactNode;
|
|
16
|
+
renderAdd?: () => ReactNode;
|
|
17
|
+
children: (fields: FormArrayField[], operation: FormArrayOperation) => ReactElement[];
|
|
18
|
+
}
|
|
19
|
+
export declare const FormArray: React.FC<FormArrayProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FormArray = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _rcFieldForm = require("rc-field-form");
|
|
11
|
+
|
|
12
|
+
var _list = _interopRequireDefault(require("../list"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
const FormArray = props => {
|
|
17
|
+
return _react.default.createElement(_rcFieldForm.List, {
|
|
18
|
+
name: props.name,
|
|
19
|
+
initialValue: props.initialValue
|
|
20
|
+
}, (rcFields, operation) => {
|
|
21
|
+
const fields = rcFields.map(field => ({
|
|
22
|
+
index: field.name,
|
|
23
|
+
key: field.key
|
|
24
|
+
}));
|
|
25
|
+
const children = props.children(fields, operation).map((child, index) => {
|
|
26
|
+
var _a;
|
|
27
|
+
|
|
28
|
+
return _react.default.createElement(_list.default, {
|
|
29
|
+
key: fields[index].key,
|
|
30
|
+
mode: 'card',
|
|
31
|
+
header: (_a = props.renderHeader) === null || _a === void 0 ? void 0 : _a.call(props, fields[index], operation)
|
|
32
|
+
}, child);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (props.renderAdd) {
|
|
36
|
+
children.push(_react.default.createElement(_list.default, {
|
|
37
|
+
key: 'add',
|
|
38
|
+
mode: 'card'
|
|
39
|
+
}, _react.default.createElement(_list.default.Item, {
|
|
40
|
+
className: 'adm-form-list-operation',
|
|
41
|
+
onClick: () => {
|
|
42
|
+
operation.add();
|
|
43
|
+
},
|
|
44
|
+
arrow: false
|
|
45
|
+
}, props.renderAdd())));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return _react.default.createElement(_react.default.Fragment, null, children);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.FormArray = FormArray;
|
|
@@ -40,10 +40,14 @@
|
|
|
40
40
|
.adm-form-item-child-position-right > * {
|
|
41
41
|
flex: none;
|
|
42
42
|
}
|
|
43
|
-
.adm-form-item-
|
|
43
|
+
.adm-form-item-feedback-error {
|
|
44
44
|
color: var(--adm-color-danger);
|
|
45
45
|
margin-top: 4px;
|
|
46
46
|
}
|
|
47
|
+
.adm-form-item-feedback-warning {
|
|
48
|
+
color: var(--adm-color-warning);
|
|
49
|
+
margin-top: 4px;
|
|
50
|
+
}
|
|
47
51
|
.adm-form-item.adm-form-item-hidden {
|
|
48
52
|
display: none;
|
|
49
53
|
}
|
|
@@ -54,9 +54,7 @@ const FormItemLayout = props => {
|
|
|
54
54
|
children,
|
|
55
55
|
htmlFor,
|
|
56
56
|
hidden,
|
|
57
|
-
errors,
|
|
58
57
|
arrow,
|
|
59
|
-
description,
|
|
60
58
|
childElementPosition = 'normal'
|
|
61
59
|
} = props;
|
|
62
60
|
const context = (0, _react.useContext)(_context.FormContext);
|
|
@@ -65,7 +63,6 @@ const FormItemLayout = props => {
|
|
|
65
63
|
} = (0, _configProvider.useConfig)();
|
|
66
64
|
const hasFeedback = props.hasFeedback !== undefined ? props.hasFeedback : context.hasFeedback;
|
|
67
65
|
const layout = props.layout || context.layout;
|
|
68
|
-
const feedback = hasFeedback && errors && errors.length > 0 ? errors[0] : null;
|
|
69
66
|
|
|
70
67
|
const requiredMark = (() => {
|
|
71
68
|
const {
|
|
@@ -103,15 +100,21 @@ const FormItemLayout = props => {
|
|
|
103
100
|
mode: 'dark',
|
|
104
101
|
trigger: 'click'
|
|
105
102
|
}, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null)))) : null;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
|
|
104
|
+
const description = _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
|
|
105
|
+
key: `error-${index}`,
|
|
106
|
+
className: `${classPrefix}-feedback-error`
|
|
107
|
+
}, error)), props.warnings.map((warning, index) => _react.default.createElement("div", {
|
|
108
|
+
key: `warning-${index}`,
|
|
109
|
+
className: `${classPrefix}-feedback-warning`
|
|
110
|
+
}, warning))));
|
|
111
|
+
|
|
109
112
|
return _react.default.createElement(_list.default.Item, {
|
|
110
113
|
style: style,
|
|
111
114
|
title: layout === 'vertical' && labelElement,
|
|
112
115
|
prefix: layout === 'horizontal' && labelElement,
|
|
113
116
|
extra: extra,
|
|
114
|
-
description:
|
|
117
|
+
description: description,
|
|
115
118
|
className: (0, _classnames.default)(classPrefix, className, `${classPrefix}-${layout}`, {
|
|
116
119
|
[`${classPrefix}-hidden`]: hidden
|
|
117
120
|
}),
|
|
@@ -182,7 +185,7 @@ const FormItem = props => {
|
|
|
182
185
|
}, [setSubMetas]);
|
|
183
186
|
|
|
184
187
|
function renderLayout(baseChildren, fieldId, meta, isRequired) {
|
|
185
|
-
var _a;
|
|
188
|
+
var _a, _b;
|
|
186
189
|
|
|
187
190
|
if (noStyle && !hidden) {
|
|
188
191
|
return baseChildren;
|
|
@@ -200,6 +203,18 @@ const FormItem = props => {
|
|
|
200
203
|
|
|
201
204
|
return subErrors;
|
|
202
205
|
}, curErrors);
|
|
206
|
+
const curWarnings = (_b = meta === null || meta === void 0 ? void 0 : meta.warnings) !== null && _b !== void 0 ? _b : [];
|
|
207
|
+
const warnings = Object.keys(subMetas).reduce((subWarnings, key) => {
|
|
208
|
+
var _a, _b;
|
|
209
|
+
|
|
210
|
+
const warnings = (_b = (_a = subMetas[key]) === null || _a === void 0 ? void 0 : _a.warnings) !== null && _b !== void 0 ? _b : [];
|
|
211
|
+
|
|
212
|
+
if (warnings.length) {
|
|
213
|
+
subWarnings = [...subWarnings, ...warnings];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return subWarnings;
|
|
217
|
+
}, curWarnings);
|
|
203
218
|
return _react.default.createElement(FormItemLayout, {
|
|
204
219
|
className: className,
|
|
205
220
|
style: style,
|
|
@@ -212,6 +227,7 @@ const FormItem = props => {
|
|
|
212
227
|
hasFeedback: hasFeedback,
|
|
213
228
|
htmlFor: fieldId,
|
|
214
229
|
errors: errors,
|
|
230
|
+
warnings: warnings,
|
|
215
231
|
onClick: onClick,
|
|
216
232
|
hidden: hidden,
|
|
217
233
|
layout: layout,
|
|
@@ -25,6 +25,8 @@ var _configProvider = require("../config-provider");
|
|
|
25
25
|
|
|
26
26
|
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
27
27
|
|
|
28
|
+
var _formArray = require("./form-array");
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
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); }
|
|
@@ -67,12 +69,21 @@ const Form = (0, _react.forwardRef)((p, ref) => {
|
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
_react.default.Children.forEach(props.children, child => {
|
|
70
|
-
if (_react.default.isValidElement(child)
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
if (_react.default.isValidElement(child)) {
|
|
73
|
+
if (child.type === _header.Header) {
|
|
74
|
+
collect();
|
|
75
|
+
currentHeader = child.props.children;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (child.type === _formArray.FormArray) {
|
|
80
|
+
collect();
|
|
81
|
+
lists.push(child);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
75
84
|
}
|
|
85
|
+
|
|
86
|
+
items.push(child);
|
|
76
87
|
});
|
|
77
88
|
|
|
78
89
|
collect();
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
.adm-form .adm-form-footer {
|
|
17
17
|
padding: 20px 12px;
|
|
18
18
|
}
|
|
19
|
+
.adm-form-list-operation {
|
|
20
|
+
text-align: center;
|
|
21
|
+
color: #1677ff;
|
|
22
|
+
}
|
|
19
23
|
.adm-form-item + .adm-form-item {
|
|
20
24
|
border-top: none;
|
|
21
25
|
}
|
|
@@ -58,10 +62,14 @@
|
|
|
58
62
|
.adm-form-item-child-position-right > * {
|
|
59
63
|
flex: none;
|
|
60
64
|
}
|
|
61
|
-
.adm-form-item-
|
|
65
|
+
.adm-form-item-feedback-error {
|
|
62
66
|
color: var(--adm-color-danger);
|
|
63
67
|
margin-top: 4px;
|
|
64
68
|
}
|
|
69
|
+
.adm-form-item-feedback-warning {
|
|
70
|
+
color: var(--adm-color-warning);
|
|
71
|
+
margin-top: 4px;
|
|
72
|
+
}
|
|
65
73
|
.adm-form-item.adm-form-item-hidden {
|
|
66
74
|
display: none;
|
|
67
75
|
}
|
|
@@ -6,6 +6,7 @@ export type { FormProps, FormInstance } from './form';
|
|
|
6
6
|
export type { FormItemProps } from './form-item';
|
|
7
7
|
export type { FormSubscribeProps } from './form-subscribe';
|
|
8
8
|
export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
|
|
9
|
+
export type { FormArrayField, FormArrayOperation, FormArrayProps, } from './form-array';
|
|
9
10
|
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & import("../../utils/native-props").NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<import("./context").FormContextType> & {
|
|
10
11
|
footer?: import("react").ReactNode;
|
|
11
12
|
layout?: FormLayout | undefined;
|
|
@@ -14,6 +15,7 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<import("r
|
|
|
14
15
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
15
16
|
Subscribe: import("react").VFC<import("./form-subscribe").FormSubscribeProps>;
|
|
16
17
|
Header: import("react").FC<{}>;
|
|
18
|
+
Array: import("react").FC<import("./form-array").FormArrayProps>;
|
|
17
19
|
useForm: typeof useForm;
|
|
18
20
|
};
|
|
19
21
|
export default _default;
|
|
@@ -19,10 +19,13 @@ var _rcFieldForm = require("rc-field-form");
|
|
|
19
19
|
|
|
20
20
|
var _formSubscribe = require("./form-subscribe");
|
|
21
21
|
|
|
22
|
+
var _formArray = require("./form-array");
|
|
23
|
+
|
|
22
24
|
var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_form.Form, {
|
|
23
25
|
Item: _formItem.FormItem,
|
|
24
26
|
Subscribe: _formSubscribe.FormSubscribe,
|
|
25
27
|
Header: _header.Header,
|
|
28
|
+
Array: _formArray.FormArray,
|
|
26
29
|
useForm: _rcFieldForm.useForm
|
|
27
30
|
});
|
|
28
31
|
|
|
@@ -20,7 +20,7 @@ export declare type ImageUploaderProps = {
|
|
|
20
20
|
deletable?: boolean;
|
|
21
21
|
capture?: InputHTMLAttributes<unknown>['capture'];
|
|
22
22
|
onPreview?: (index: number, item: ImageUploadItem) => void;
|
|
23
|
-
beforeUpload?: (file: File[]) => Promise<File
|
|
23
|
+
beforeUpload?: (file: File, files: File[]) => Promise<File | null> | File | null;
|
|
24
24
|
upload: (file: File) => Promise<ImageUploadItem>;
|
|
25
25
|
onDelete?: (item: ImageUploadItem) => boolean | Promise<boolean> | void;
|
|
26
26
|
preview?: boolean;
|
|
@@ -63,6 +63,17 @@ const ImageUploader = p => {
|
|
|
63
63
|
onPreview
|
|
64
64
|
} = props;
|
|
65
65
|
|
|
66
|
+
function processFile(file, fileList) {
|
|
67
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
68
|
+
const {
|
|
69
|
+
beforeUpload
|
|
70
|
+
} = props;
|
|
71
|
+
let transformedFile = file;
|
|
72
|
+
transformedFile = yield beforeUpload === null || beforeUpload === void 0 ? void 0 : beforeUpload(file, fileList);
|
|
73
|
+
return transformedFile;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
66
77
|
function onChange(e) {
|
|
67
78
|
var _a;
|
|
68
79
|
|
|
@@ -75,7 +86,12 @@ const ImageUploader = p => {
|
|
|
75
86
|
let files = [].slice.call(rawFiles);
|
|
76
87
|
|
|
77
88
|
if (props.beforeUpload) {
|
|
78
|
-
|
|
89
|
+
const postFiles = files.map(file => {
|
|
90
|
+
return processFile(file, files);
|
|
91
|
+
});
|
|
92
|
+
yield Promise.all(postFiles).then(filesList => {
|
|
93
|
+
files = filesList.filter(Boolean);
|
|
94
|
+
});
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
if (files.length === 0) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import './image-viewer.less';
|
|
3
3
|
import { showMultiImageViewer, showImageViewer, clearImageViewer } from './methods';
|
|
4
4
|
export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
|
|
5
|
-
export type {
|
|
5
|
+
export type { ImageViewerShowHandler } from './methods';
|
|
6
6
|
declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
|
|
7
7
|
Multi: import("react").ForwardRefExoticComponent<Omit<import("./image-viewer").ImageViewerProps, "image"> & {
|
|
8
8
|
images?: string[] | undefined;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { ImageViewerProps, MultiImageViewerProps } from './image-viewer';
|
|
2
|
-
export declare type
|
|
3
|
-
close: () => void;
|
|
4
|
-
};
|
|
5
|
-
export declare function showImageViewer(props: Omit<ImageViewerProps, 'visible'>): {
|
|
2
|
+
export declare type ImageViewerShowHandler = {
|
|
6
3
|
close: () => void;
|
|
7
4
|
};
|
|
5
|
+
export declare function showImageViewer(props: Omit<ImageViewerProps, 'visible'>): ImageViewerShowHandler;
|
|
8
6
|
export declare function showMultiImageViewer(props: Omit<MultiImageViewerProps, 'visible'>): {
|
|
9
7
|
close: () => void;
|
|
10
8
|
};
|
|
11
9
|
export declare function clearImageViewer(): void;
|
|
10
|
+
export declare const getH: () => void;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.clearImageViewer = clearImageViewer;
|
|
7
|
+
exports.getH = void 0;
|
|
7
8
|
exports.showImageViewer = showImageViewer;
|
|
8
9
|
exports.showMultiImageViewer = showMultiImageViewer;
|
|
9
10
|
|
|
@@ -13,7 +14,7 @@ var _renderToBody = require("../../utils/render-to-body");
|
|
|
13
14
|
|
|
14
15
|
var _imageViewer = require("./image-viewer");
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var _renderImperatively = require("../../utils/render-imperatively");
|
|
17
18
|
|
|
18
19
|
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); }
|
|
19
20
|
|
|
@@ -23,45 +24,14 @@ const handlerSet = new Set();
|
|
|
23
24
|
|
|
24
25
|
function showImageViewer(props) {
|
|
25
26
|
clearImageViewer();
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
(0, _react.useEffect)(() => {
|
|
29
|
-
setVisible(true);
|
|
30
|
-
}, []);
|
|
31
|
-
const isUnmountedRef = (0, _ahooks.useUnmountedRef)();
|
|
32
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
33
|
-
close: () => {
|
|
34
|
-
if (isUnmountedRef.current) return;
|
|
35
|
-
setVisible(false);
|
|
36
|
-
}
|
|
37
|
-
}));
|
|
38
|
-
return _react.default.createElement(_imageViewer.ImageViewer, Object.assign({}, props, {
|
|
39
|
-
visible: visible,
|
|
40
|
-
onClose: () => {
|
|
41
|
-
var _a;
|
|
42
|
-
|
|
43
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
44
|
-
setVisible(false);
|
|
45
|
-
},
|
|
46
|
-
afterClose: () => {
|
|
47
|
-
var _a;
|
|
48
|
-
|
|
49
|
-
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
50
|
-
unmount();
|
|
51
|
-
}
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
const ref = (0, _react.createRef)();
|
|
55
|
-
const unmount = (0, _renderToBody.renderToBody)(_react.default.createElement(Wrapper, {
|
|
56
|
-
ref: ref
|
|
57
|
-
}));
|
|
58
|
-
const handler = {
|
|
59
|
-
close: () => {
|
|
27
|
+
const handler = (0, _renderImperatively.renderImperatively)(_react.default.createElement(_imageViewer.ImageViewer, Object.assign({}, props, {
|
|
28
|
+
afterClose: () => {
|
|
60
29
|
var _a;
|
|
61
30
|
|
|
62
|
-
|
|
31
|
+
handlerSet.delete(handler);
|
|
32
|
+
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
63
33
|
}
|
|
64
|
-
};
|
|
34
|
+
})));
|
|
65
35
|
handlerSet.add(handler);
|
|
66
36
|
return handler;
|
|
67
37
|
}
|
|
@@ -70,30 +40,39 @@ function showMultiImageViewer(props) {
|
|
|
70
40
|
clearImageViewer();
|
|
71
41
|
const Wrapper = (0, _react.forwardRef)((_, ref) => {
|
|
72
42
|
const [visible, setVisible] = (0, _react.useState)(false);
|
|
43
|
+
const closedRef = (0, _react.useRef)(false);
|
|
73
44
|
(0, _react.useEffect)(() => {
|
|
74
|
-
|
|
45
|
+
if (!closedRef.current) {
|
|
46
|
+
setVisible(true);
|
|
47
|
+
} else {
|
|
48
|
+
handleAfterClose();
|
|
49
|
+
}
|
|
75
50
|
}, []);
|
|
76
|
-
|
|
51
|
+
|
|
52
|
+
function handleClose() {
|
|
53
|
+
var _a;
|
|
54
|
+
|
|
55
|
+
closedRef.current = true;
|
|
56
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
57
|
+
setVisible(false);
|
|
58
|
+
}
|
|
59
|
+
|
|
77
60
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
78
|
-
close:
|
|
79
|
-
if (isUnmountedRef.current) return;
|
|
80
|
-
setVisible(false);
|
|
81
|
-
}
|
|
61
|
+
close: handleClose
|
|
82
62
|
}));
|
|
83
|
-
return _react.default.createElement(_imageViewer.MultiImageViewer, Object.assign({}, props, {
|
|
84
|
-
visible: visible,
|
|
85
|
-
onClose: () => {
|
|
86
|
-
var _a;
|
|
87
63
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
afterClose: () => {
|
|
92
|
-
var _a;
|
|
64
|
+
function handleAfterClose() {
|
|
65
|
+
var _a;
|
|
93
66
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
67
|
+
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
68
|
+
unmount();
|
|
69
|
+
handlerSet.delete(handler);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return _react.default.createElement(_imageViewer.MultiImageViewer, Object.assign({}, props, {
|
|
73
|
+
visible: visible,
|
|
74
|
+
onClose: handleClose,
|
|
75
|
+
afterClose: handleAfterClose
|
|
97
76
|
}));
|
|
98
77
|
});
|
|
99
78
|
const ref = (0, _react.createRef)();
|
|
@@ -116,4 +95,10 @@ function clearImageViewer() {
|
|
|
116
95
|
handler.close();
|
|
117
96
|
});
|
|
118
97
|
handlerSet.clear();
|
|
119
|
-
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const getH = () => {
|
|
101
|
+
console.log(handlerSet);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
exports.getH = getH;
|
|
@@ -6,7 +6,7 @@ import { confirm } from './confirm';
|
|
|
6
6
|
import { clear } from './clear';
|
|
7
7
|
export type { ModalProps } from './modal';
|
|
8
8
|
export type { Action } from './modal-action-button';
|
|
9
|
-
export type { ModalShowProps,
|
|
9
|
+
export type { ModalShowProps, ModalShowHandler } from './show';
|
|
10
10
|
export type { ModalAlertProps } from './alert';
|
|
11
11
|
export type { ModalConfirmProps } from './confirm';
|
|
12
12
|
declare const _default: import("react").FC<import("./modal").ModalProps> & {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ModalProps } from './modal';
|
|
2
2
|
export declare type ModalShowProps = Omit<ModalProps, 'visible'>;
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type ModalShowHandler = {
|
|
4
4
|
close: () => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const closeFnSet: Set<() => void>;
|
|
7
|
-
export declare function show(props: ModalShowProps):
|
|
8
|
-
close: () => void;
|
|
9
|
-
};
|
|
7
|
+
export declare function show(props: ModalShowProps): ModalShowHandler;
|
|
@@ -6,64 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.closeFnSet = void 0;
|
|
7
7
|
exports.show = show;
|
|
8
8
|
|
|
9
|
-
var _react =
|
|
10
|
-
|
|
11
|
-
var _renderToBody = require("../../utils/render-to-body");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
10
|
|
|
13
11
|
var _modal = require("./modal");
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
var _renderImperatively = require("../../utils/render-imperatively");
|
|
16
14
|
|
|
17
|
-
function
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
16
|
|
|
19
17
|
const closeFnSet = new Set();
|
|
20
18
|
exports.closeFnSet = closeFnSet;
|
|
21
19
|
|
|
22
20
|
function show(props) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
(0, _react.useEffect)(() => {
|
|
26
|
-
setVisible(true);
|
|
27
|
-
}, []);
|
|
28
|
-
|
|
29
|
-
function handleClose() {
|
|
30
|
-
var _a;
|
|
31
|
-
|
|
32
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
33
|
-
setVisible(false);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
37
|
-
close: handleClose
|
|
38
|
-
}));
|
|
39
|
-
|
|
40
|
-
function handleAfterClose() {
|
|
21
|
+
const handler = (0, _renderImperatively.renderImperatively)(_react.default.createElement(_modal.Modal, Object.assign({}, props, {
|
|
22
|
+
afterClose: () => {
|
|
41
23
|
var _a;
|
|
42
24
|
|
|
25
|
+
closeFnSet.delete(handler.close);
|
|
43
26
|
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
44
|
-
unmount();
|
|
45
|
-
closeFnSet.delete(close);
|
|
46
27
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
onClose: handleClose,
|
|
51
|
-
afterClose: handleAfterClose
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
const ref = (0, _react.createRef)();
|
|
55
|
-
const unmount = (0, _renderToBody.renderToBody)(_react.default.createElement(Wrapper, {
|
|
56
|
-
ref: ref
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
const close = () => {
|
|
60
|
-
var _a;
|
|
61
|
-
|
|
62
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
closeFnSet.add(close);
|
|
66
|
-
return {
|
|
67
|
-
close
|
|
68
|
-
};
|
|
28
|
+
})));
|
|
29
|
+
closeFnSet.add(handler.close);
|
|
30
|
+
return handler;
|
|
69
31
|
}
|
|
@@ -3,16 +3,21 @@ import './popover.less';
|
|
|
3
3
|
import './popover-menu.less';
|
|
4
4
|
export type { PopoverProps, PopoverRef } from './popover';
|
|
5
5
|
export type { PopoverMenuProps, Action } from './popover-menu';
|
|
6
|
+
export declare type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
7
|
+
export declare type DeprecatedPlacement = 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
6
8
|
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
9
|
+
defaultVisible?: boolean | undefined;
|
|
10
|
+
visible?: boolean | undefined;
|
|
11
|
+
onVisibleChange?: ((visible: boolean) => void) | undefined;
|
|
7
12
|
getContainer?: import("../../utils/render-to-container").GetContainer | undefined;
|
|
8
13
|
destroyOnHide?: boolean | undefined;
|
|
9
14
|
children: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
10
15
|
mode?: "dark" | "light" | undefined;
|
|
11
16
|
trigger?: "click" | undefined;
|
|
12
|
-
placement?:
|
|
17
|
+
placement?: DeprecatedPlacement | Placement | undefined;
|
|
13
18
|
stopPropagation?: "click"[] | undefined;
|
|
14
19
|
content: import("react").ReactNode;
|
|
15
|
-
} &
|
|
20
|
+
} & import("../../utils/native-props").NativeProps<"--z-index"> & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
16
21
|
Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
|
|
17
22
|
actions: import("./popover-menu").Action[];
|
|
18
23
|
onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
|