antd-mobile 5.11.2 → 5.12.2
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/calendar/calendar.d.ts +4 -0
- package/2x/cjs/components/calendar/calendar.js +13 -9
- package/2x/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
- package/2x/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/2x/cjs/components/cascade-picker/cascade-picker.js +8 -4
- package/2x/cjs/components/cascade-picker/index.d.ts +4 -2
- package/2x/cjs/components/date-picker/date-picker.d.ts +18 -4
- package/2x/cjs/components/date-picker/date-picker.js +5 -6
- package/2x/cjs/components/date-picker/index.d.ts +15 -2
- package/2x/cjs/components/dialog/dialog.d.ts +2 -1
- package/2x/cjs/components/dialog/dialog.js +2 -2
- package/2x/cjs/components/dropdown/dropdown.css +1 -1
- package/2x/cjs/components/error-block/images/busy.d.ts +1 -0
- package/2x/cjs/components/error-block/images/default.d.ts +1 -0
- package/2x/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/cjs/components/error-block/images/empty.d.ts +1 -0
- package/2x/cjs/components/form/form-item.d.ts +2 -1
- package/2x/cjs/components/form/form-item.js +21 -4
- package/2x/cjs/components/form/utils.d.ts +1 -0
- package/2x/cjs/components/form/utils.js +20 -0
- package/2x/cjs/components/image/image.d.ts +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -2
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/input/input.js +1 -0
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/2x/cjs/components/list/list.css +1 -0
- package/2x/cjs/components/mask/mask.js +1 -1
- package/2x/cjs/components/modal/modal.d.ts +2 -1
- package/2x/cjs/components/modal/modal.js +2 -2
- package/2x/cjs/components/picker/index.d.ts +44 -3
- package/2x/cjs/components/picker/picker.d.ts +32 -2
- package/2x/cjs/components/picker/picker.js +43 -16
- package/2x/cjs/components/popup/popup.d.ts +2 -1
- package/2x/cjs/components/popup/popup.js +1 -1
- package/2x/cjs/components/search-bar/search-bar.js +2 -8
- package/2x/cjs/components/swipe-action/swipe-action.js +1 -1
- package/2x/cjs/components/tabs/tabs.css +5 -3
- package/2x/cjs/components/tabs/tabs.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +4 -1
- package/2x/cjs/components/toast/methods.js +3 -7
- package/2x/cjs/components/toast/toast.d.ts +2 -1
- package/2x/cjs/utils/render-to-body.js +3 -6
- package/2x/cjs/utils/render.d.ts +9 -0
- package/2x/cjs/utils/render.js +92 -0
- package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/cjs/utils/use-props-value.d.ts +1 -1
- package/2x/es/components/calendar/calendar.d.ts +4 -0
- package/2x/es/components/calendar/calendar.js +13 -9
- package/2x/es/components/capsule-tabs/capsule-tabs.css +1 -0
- package/2x/es/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/2x/es/components/cascade-picker/cascade-picker.js +4 -3
- package/2x/es/components/cascade-picker/index.d.ts +4 -2
- package/2x/es/components/date-picker/date-picker.d.ts +18 -4
- package/2x/es/components/date-picker/date-picker.js +6 -5
- package/2x/es/components/date-picker/index.d.ts +15 -2
- package/2x/es/components/dialog/dialog.d.ts +2 -1
- package/2x/es/components/dialog/dialog.js +2 -2
- package/2x/es/components/dropdown/dropdown.css +1 -1
- package/2x/es/components/error-block/images/busy.d.ts +1 -0
- package/2x/es/components/error-block/images/default.d.ts +1 -0
- package/2x/es/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/es/components/error-block/images/empty.d.ts +1 -0
- package/2x/es/components/form/form-item.d.ts +2 -1
- package/2x/es/components/form/form-item.js +23 -4
- package/2x/es/components/form/utils.d.ts +1 -0
- package/2x/es/components/form/utils.js +17 -0
- package/2x/es/components/image/image.d.ts +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +1 -2
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/input/input.js +1 -0
- package/2x/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/2x/es/components/list/list.css +1 -0
- package/2x/es/components/mask/mask.js +1 -1
- package/2x/es/components/modal/modal.d.ts +2 -1
- package/2x/es/components/modal/modal.js +2 -2
- package/2x/es/components/picker/index.d.ts +44 -3
- package/2x/es/components/picker/picker.d.ts +32 -2
- package/2x/es/components/picker/picker.js +42 -17
- package/2x/es/components/popup/popup.d.ts +2 -1
- package/2x/es/components/popup/popup.js +1 -1
- package/2x/es/components/search-bar/search-bar.js +2 -8
- package/2x/es/components/swipe-action/swipe-action.js +1 -1
- package/2x/es/components/tabs/tabs.css +5 -3
- package/2x/es/components/tabs/tabs.d.ts +1 -1
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +4 -2
- package/2x/es/components/toast/methods.js +3 -3
- package/2x/es/components/toast/toast.d.ts +2 -1
- package/2x/es/utils/render-to-body.js +3 -3
- package/2x/es/utils/render.d.ts +9 -0
- package/2x/es/utils/render.js +77 -0
- package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/es/utils/use-props-value.d.ts +1 -1
- package/2x/package.json +9 -14
- package/bundle/antd-mobile.cjs.js +5053 -4310
- package/bundle/antd-mobile.es.js +5055 -4312
- package/bundle/style.css +9 -4
- package/cjs/components/calendar/calendar.d.ts +4 -0
- package/cjs/components/calendar/calendar.js +13 -9
- package/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
- package/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/cjs/components/cascade-picker/cascade-picker.js +8 -4
- package/cjs/components/cascade-picker/index.d.ts +4 -2
- package/cjs/components/date-picker/date-picker.d.ts +18 -4
- package/cjs/components/date-picker/date-picker.js +5 -6
- package/cjs/components/date-picker/index.d.ts +15 -2
- package/cjs/components/dialog/dialog.d.ts +2 -1
- package/cjs/components/dialog/dialog.js +2 -2
- package/cjs/components/dropdown/dropdown.css +1 -1
- package/cjs/components/error-block/images/busy.d.ts +1 -0
- package/cjs/components/error-block/images/default.d.ts +1 -0
- package/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/cjs/components/error-block/images/empty.d.ts +1 -0
- package/cjs/components/form/form-item.d.ts +2 -1
- package/cjs/components/form/form-item.js +21 -4
- package/cjs/components/form/utils.d.ts +1 -0
- package/cjs/components/form/utils.js +20 -0
- package/cjs/components/image/image.d.ts +1 -1
- package/cjs/components/image-uploader/image-uploader.js +1 -2
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/input/input.js +1 -0
- package/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/cjs/components/list/list.css +1 -0
- package/cjs/components/mask/mask.js +1 -1
- package/cjs/components/modal/modal.d.ts +2 -1
- package/cjs/components/modal/modal.js +2 -2
- package/cjs/components/picker/index.d.ts +44 -3
- package/cjs/components/picker/picker.d.ts +32 -2
- package/cjs/components/picker/picker.js +43 -16
- package/cjs/components/popup/popup.d.ts +2 -1
- package/cjs/components/popup/popup.js +1 -1
- package/cjs/components/search-bar/search-bar.js +2 -8
- package/cjs/components/swipe-action/swipe-action.js +1 -1
- package/cjs/components/tabs/tabs.css +5 -3
- package/cjs/components/tabs/tabs.d.ts +1 -1
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +4 -1
- package/cjs/components/toast/methods.js +3 -7
- package/cjs/components/toast/toast.d.ts +2 -1
- package/cjs/utils/render-to-body.js +3 -6
- package/cjs/utils/render.d.ts +9 -0
- package/cjs/utils/render.js +92 -0
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/cjs/utils/use-props-value.d.ts +1 -1
- package/es/components/calendar/calendar.d.ts +4 -0
- package/es/components/calendar/calendar.js +13 -9
- package/es/components/capsule-tabs/capsule-tabs.css +1 -0
- package/es/components/cascade-picker/cascade-picker.d.ts +6 -3
- package/es/components/cascade-picker/cascade-picker.js +4 -3
- package/es/components/cascade-picker/index.d.ts +4 -2
- package/es/components/date-picker/date-picker.d.ts +18 -4
- package/es/components/date-picker/date-picker.js +6 -5
- package/es/components/date-picker/index.d.ts +15 -2
- package/es/components/dialog/dialog.d.ts +2 -1
- package/es/components/dialog/dialog.js +2 -2
- package/es/components/dropdown/dropdown.css +1 -1
- package/es/components/error-block/images/busy.d.ts +1 -0
- package/es/components/error-block/images/default.d.ts +1 -0
- package/es/components/error-block/images/disconnected.d.ts +1 -0
- package/es/components/error-block/images/empty.d.ts +1 -0
- package/es/components/form/form-item.d.ts +2 -1
- package/es/components/form/form-item.js +23 -4
- package/es/components/form/utils.d.ts +1 -0
- package/es/components/form/utils.js +17 -0
- package/es/components/image/image.d.ts +1 -1
- package/es/components/image-uploader/image-uploader.js +1 -2
- package/es/components/input/input.d.ts +2 -2
- package/es/components/input/input.js +1 -0
- package/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
- package/es/components/list/list.css +1 -0
- package/es/components/mask/mask.js +1 -1
- package/es/components/modal/modal.d.ts +2 -1
- package/es/components/modal/modal.js +2 -2
- package/es/components/picker/index.d.ts +44 -3
- package/es/components/picker/picker.d.ts +32 -2
- package/es/components/picker/picker.js +42 -17
- package/es/components/popup/popup.d.ts +2 -1
- package/es/components/popup/popup.js +1 -1
- package/es/components/search-bar/search-bar.js +2 -8
- package/es/components/swipe-action/swipe-action.js +1 -1
- package/es/components/tabs/tabs.css +5 -3
- package/es/components/tabs/tabs.d.ts +1 -1
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +4 -2
- package/es/components/toast/methods.js +3 -3
- package/es/components/toast/toast.d.ts +2 -1
- package/es/utils/render-to-body.js +3 -3
- package/es/utils/render.d.ts +9 -0
- package/es/utils/render.js +77 -0
- package/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/es/utils/use-props-value.d.ts +1 -1
- package/package.json +9 -14
- package/umd/antd-mobile.js +1 -1
|
@@ -7,6 +7,8 @@ exports.Picker = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
10
12
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
11
13
|
|
|
12
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
@@ -27,6 +29,8 @@ var _safeArea = _interopRequireDefault(require("../safe-area"));
|
|
|
27
29
|
|
|
28
30
|
var _pickerUtils = require("./picker-utils");
|
|
29
31
|
|
|
32
|
+
var _shouldRender = require("../../utils/should-render");
|
|
33
|
+
|
|
30
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
35
|
|
|
32
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); }
|
|
@@ -39,7 +43,7 @@ const defaultProps = {
|
|
|
39
43
|
closeOnMaskClick: true,
|
|
40
44
|
renderLabel: _pickerUtils.defaultRenderLabel
|
|
41
45
|
};
|
|
42
|
-
const Picker = (0, _react.memo)(p => {
|
|
46
|
+
const Picker = (0, _react.memo)((0, _react.forwardRef)((p, ref) => {
|
|
43
47
|
var _a;
|
|
44
48
|
|
|
45
49
|
const {
|
|
@@ -49,6 +53,29 @@ const Picker = (0, _react.memo)(p => {
|
|
|
49
53
|
confirmText: locale.common.confirm,
|
|
50
54
|
cancelText: locale.common.cancel
|
|
51
55
|
}, p);
|
|
56
|
+
const [visible, setVisible] = (0, _usePropsValue.usePropsValue)({
|
|
57
|
+
value: props.visible,
|
|
58
|
+
defaultValue: false,
|
|
59
|
+
onChange: v => {
|
|
60
|
+
var _a;
|
|
61
|
+
|
|
62
|
+
if (v === false) {
|
|
63
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const actions = {
|
|
68
|
+
toggle: () => {
|
|
69
|
+
setVisible(v => !v);
|
|
70
|
+
},
|
|
71
|
+
open: () => {
|
|
72
|
+
setVisible(true);
|
|
73
|
+
},
|
|
74
|
+
close: () => {
|
|
75
|
+
setVisible(false);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
(0, _react.useImperativeHandle)(ref, () => actions);
|
|
52
79
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(Object.assign(Object.assign({}, props), {
|
|
53
80
|
onChange: val => {
|
|
54
81
|
var _a;
|
|
@@ -63,9 +90,9 @@ const Picker = (0, _react.memo)(p => {
|
|
|
63
90
|
if (innerValue !== value) {
|
|
64
91
|
setInnerValue(value);
|
|
65
92
|
}
|
|
66
|
-
}, [
|
|
93
|
+
}, [visible]);
|
|
67
94
|
(0, _react.useEffect)(() => {
|
|
68
|
-
if (!
|
|
95
|
+
if (!visible) {
|
|
69
96
|
setInnerValue(value);
|
|
70
97
|
}
|
|
71
98
|
}, [value]);
|
|
@@ -74,10 +101,11 @@ const Picker = (0, _react.memo)(p => {
|
|
|
74
101
|
|
|
75
102
|
setInnerValue(val);
|
|
76
103
|
|
|
77
|
-
if (
|
|
104
|
+
if (visible) {
|
|
78
105
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, val, ext);
|
|
79
106
|
}
|
|
80
107
|
});
|
|
108
|
+
const shouldRender = (0, _shouldRender.useShouldRender)(visible, props.forceRender, props.destroyOnClose);
|
|
81
109
|
const pickerElement = (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
82
110
|
className: classPrefix
|
|
83
111
|
}, _react.default.createElement("div", {
|
|
@@ -85,20 +113,18 @@ const Picker = (0, _react.memo)(p => {
|
|
|
85
113
|
}, _react.default.createElement("a", {
|
|
86
114
|
className: `${classPrefix}-header-button`,
|
|
87
115
|
onClick: () => {
|
|
88
|
-
var _a
|
|
116
|
+
var _a;
|
|
89
117
|
|
|
90
118
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
91
|
-
(
|
|
119
|
+
setVisible(false);
|
|
92
120
|
}
|
|
93
121
|
}, props.cancelText), _react.default.createElement("div", {
|
|
94
122
|
className: `${classPrefix}-header-title`
|
|
95
123
|
}, props.title), _react.default.createElement("a", {
|
|
96
124
|
className: `${classPrefix}-header-button`,
|
|
97
125
|
onClick: () => {
|
|
98
|
-
var _a;
|
|
99
|
-
|
|
100
126
|
setValue(innerValue);
|
|
101
|
-
(
|
|
127
|
+
setVisible(false);
|
|
102
128
|
}
|
|
103
129
|
}, props.confirmText)), _react.default.createElement("div", {
|
|
104
130
|
className: `${classPrefix}-body`
|
|
@@ -111,15 +137,16 @@ const Picker = (0, _react.memo)(p => {
|
|
|
111
137
|
}))));
|
|
112
138
|
|
|
113
139
|
const popupElement = _react.default.createElement(_popup.default, {
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
style: props.popupStyle,
|
|
141
|
+
className: (0, _classnames.default)(`${classPrefix}-popup`, props.popupClassName),
|
|
142
|
+
visible: visible,
|
|
116
143
|
position: 'bottom',
|
|
117
144
|
onMaskClick: () => {
|
|
118
|
-
var _a
|
|
145
|
+
var _a;
|
|
119
146
|
|
|
120
147
|
if (!props.closeOnMaskClick) return;
|
|
121
148
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
122
|
-
(
|
|
149
|
+
setVisible(false);
|
|
123
150
|
},
|
|
124
151
|
getContainer: props.getContainer,
|
|
125
152
|
destroyOnClose: true,
|
|
@@ -128,11 +155,11 @@ const Picker = (0, _react.memo)(p => {
|
|
|
128
155
|
onClick: props.onClick,
|
|
129
156
|
forceRender: true,
|
|
130
157
|
stopPropagation: props.stopPropagation
|
|
131
|
-
}, pickerElement, _react.default.createElement(_safeArea.default, {
|
|
158
|
+
}, shouldRender && pickerElement, _react.default.createElement(_safeArea.default, {
|
|
132
159
|
position: 'bottom'
|
|
133
160
|
}));
|
|
134
161
|
|
|
135
|
-
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, extend.items));
|
|
136
|
-
});
|
|
162
|
+
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, extend.items, actions));
|
|
163
|
+
}));
|
|
137
164
|
exports.Picker = Picker;
|
|
138
165
|
Picker.displayName = 'Picker';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import type { MaskProps } from '../mask';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
5
6
|
export declare type PopupProps = {
|
|
@@ -15,7 +16,7 @@ export declare type PopupProps = {
|
|
|
15
16
|
bodyClassName?: string;
|
|
16
17
|
bodyStyle?: React.CSSProperties;
|
|
17
18
|
maskClassName?: string;
|
|
18
|
-
maskStyle?:
|
|
19
|
+
maskStyle?: MaskProps['style'];
|
|
19
20
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
21
|
stopPropagation?: PropagationEvent[];
|
|
21
22
|
children?: React.ReactNode;
|
|
@@ -80,7 +80,7 @@ const Popup = p => {
|
|
|
80
80
|
className: classPrefix,
|
|
81
81
|
onClick: props.onClick,
|
|
82
82
|
style: {
|
|
83
|
-
display: active ?
|
|
83
|
+
display: active ? undefined : 'none'
|
|
84
84
|
}
|
|
85
85
|
}, props.mask && _react.default.createElement(_mask.default, {
|
|
86
86
|
visible: props.visible,
|
|
@@ -74,7 +74,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
74
74
|
}));
|
|
75
75
|
|
|
76
76
|
const renderCancelButton = () => {
|
|
77
|
-
let isShowCancel
|
|
77
|
+
let isShowCancel;
|
|
78
78
|
|
|
79
79
|
if (typeof props.showCancelButton === 'function') {
|
|
80
80
|
isShowCancel = props.showCancelButton(hasFocus, value);
|
|
@@ -83,13 +83,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
return isShowCancel && _react.default.createElement("div", {
|
|
86
|
-
className: `${classPrefix}-suffix
|
|
87
|
-
onMouseDown: e => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
},
|
|
90
|
-
onTouchStart: e => {
|
|
91
|
-
e.preventDefault();
|
|
92
|
-
}
|
|
86
|
+
className: `${classPrefix}-suffix`
|
|
93
87
|
}, _react.default.createElement(_button.default, {
|
|
94
88
|
fill: 'none',
|
|
95
89
|
className: `${classPrefix}-cancel-button`,
|
|
@@ -206,7 +206,7 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
206
206
|
}
|
|
207
207
|
}, _react.default.createElement(_web.animated.div, {
|
|
208
208
|
style: {
|
|
209
|
-
pointerEvents: x.to(v => v !== 0 && x.goal !== 0 ? 'none' : '
|
|
209
|
+
pointerEvents: x.to(v => v !== 0 && x.goal !== 0 ? 'none' : 'auto')
|
|
210
210
|
}
|
|
211
211
|
}, props.children)), (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, _react.default.createElement("div", {
|
|
212
212
|
className: 'adm-swipe-action-actions adm-swipe-action-actions-right',
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
--content-padding: 24px;
|
|
4
4
|
--active-line-height: 4px;
|
|
5
5
|
--active-line-border-radius: var(--active-line-height);
|
|
6
|
+
--active-line-color: var(--adm-color-primary);
|
|
7
|
+
--active-title-color: var(--adm-color-primary);
|
|
6
8
|
position: relative;
|
|
9
|
+
min-width: 0;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
.adm-tabs-header {
|
|
@@ -44,7 +47,7 @@
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
.adm-tabs-tab-active {
|
|
47
|
-
color: var(--
|
|
50
|
+
color: var(--active-title-color);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.adm-tabs-tab-disabled {
|
|
@@ -56,8 +59,7 @@
|
|
|
56
59
|
position: absolute;
|
|
57
60
|
bottom: 0;
|
|
58
61
|
height: var(--active-line-height);
|
|
59
|
-
|
|
60
|
-
background: var(--adm-color-primary);
|
|
62
|
+
background: var(--active-line-color);
|
|
61
63
|
border-radius: var(--active-line-border-radius);
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -15,5 +15,5 @@ export declare type TabsProps = {
|
|
|
15
15
|
stretch?: boolean;
|
|
16
16
|
onChange?: (key: string) => void;
|
|
17
17
|
children?: React.ReactNode;
|
|
18
|
-
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding'>;
|
|
18
|
+
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
|
|
19
19
|
export declare const Tabs: FC<TabsProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
|
-
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'name' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
|
|
5
5
|
onChange?: (val: string) => void;
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
|
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
22
|
};
|
|
23
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -7,6 +7,8 @@ exports.TextArea = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
|
|
10
12
|
var _nativeProps = require("../../utils/native-props");
|
|
11
13
|
|
|
12
14
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
@@ -57,7 +59,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
57
59
|
(_a = nativeTextAreaRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
58
60
|
}
|
|
59
61
|
}));
|
|
60
|
-
(0,
|
|
62
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
61
63
|
if (!autoSize) return;
|
|
62
64
|
const textArea = nativeTextAreaRef.current;
|
|
63
65
|
if (!textArea) return;
|
|
@@ -130,6 +132,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
130
132
|
autoFocus: props.autoFocus,
|
|
131
133
|
disabled: props.disabled,
|
|
132
134
|
readOnly: props.readOnly,
|
|
135
|
+
name: props.name,
|
|
133
136
|
onFocus: props.onFocus,
|
|
134
137
|
onBlur: props.onBlur,
|
|
135
138
|
onClick: props.onClick
|
|
@@ -11,13 +11,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _getContainer = require("../../utils/get-container");
|
|
13
13
|
|
|
14
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
|
-
|
|
16
14
|
var _toast = require("./toast");
|
|
17
15
|
|
|
18
16
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
var _render = require("../../utils/render");
|
|
21
19
|
|
|
22
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); }
|
|
23
21
|
|
|
@@ -26,7 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
24
|
const containers = [];
|
|
27
25
|
|
|
28
26
|
function unmount(container) {
|
|
29
|
-
const unmountResult =
|
|
27
|
+
const unmountResult = (0, _render.unmount)(container);
|
|
30
28
|
|
|
31
29
|
if (unmountResult && container.parentNode) {
|
|
32
30
|
container.parentNode.removeChild(container);
|
|
@@ -85,11 +83,9 @@ function show(p) {
|
|
|
85
83
|
}));
|
|
86
84
|
});
|
|
87
85
|
const ref = (0, _react.createRef)();
|
|
88
|
-
|
|
89
|
-
_reactDom.default.render(_react.default.createElement(TempToast, {
|
|
86
|
+
(0, _render.render)(_react.default.createElement(TempToast, {
|
|
90
87
|
ref: ref
|
|
91
88
|
}), container);
|
|
92
|
-
|
|
93
89
|
return {
|
|
94
90
|
close: () => {
|
|
95
91
|
var _a;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { MaskProps } from '../mask';
|
|
2
3
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
export interface ToastProps {
|
|
5
6
|
afterClose?: () => void;
|
|
6
|
-
maskStyle?:
|
|
7
|
+
maskStyle?: MaskProps['style'];
|
|
7
8
|
maskClassName?: string;
|
|
8
9
|
maskClickable?: boolean;
|
|
9
10
|
content?: ReactNode;
|
|
@@ -5,23 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.renderToBody = renderToBody;
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
+
var _render = require("./render");
|
|
11
9
|
|
|
12
10
|
function renderToBody(element) {
|
|
13
11
|
const container = document.createElement('div');
|
|
14
12
|
document.body.appendChild(container);
|
|
15
13
|
|
|
16
14
|
function unmount() {
|
|
17
|
-
const unmountResult =
|
|
15
|
+
const unmountResult = (0, _render.unmount)(container);
|
|
18
16
|
|
|
19
17
|
if (unmountResult && container.parentNode) {
|
|
20
18
|
container.parentNode.removeChild(container);
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
(0, _render.render)(element, container);
|
|
26
23
|
return unmount;
|
|
27
24
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import type { Root } from 'react-dom/client';
|
|
3
|
+
declare const MARK = "__antd_mobile_root__";
|
|
4
|
+
declare type ContainerType = (Element | DocumentFragment) & {
|
|
5
|
+
[MARK]?: Root;
|
|
6
|
+
};
|
|
7
|
+
export declare function render(node: ReactElement, container: ContainerType): void;
|
|
8
|
+
export declare function unmount(container: ContainerType): boolean | Promise<void>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.render = render;
|
|
7
|
+
exports.unmount = unmount;
|
|
8
|
+
|
|
9
|
+
var _tslib = require("tslib");
|
|
10
|
+
|
|
11
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
12
|
+
|
|
13
|
+
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); }
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
// Let compiler not to search module usage
|
|
18
|
+
const fullClone = Object.assign({}, ReactDOM);
|
|
19
|
+
const {
|
|
20
|
+
version,
|
|
21
|
+
render: reactRender,
|
|
22
|
+
unmountComponentAtNode
|
|
23
|
+
} = fullClone;
|
|
24
|
+
let createRoot;
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const mainVersion = Number((version || '').split('.')[0]);
|
|
28
|
+
|
|
29
|
+
if (mainVersion >= 18 && fullClone.createRoot) {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
31
|
+
createRoot = fullClone.createRoot;
|
|
32
|
+
}
|
|
33
|
+
} catch (e) {// Do nothing;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function toggleWarning(skip) {
|
|
37
|
+
const {
|
|
38
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
39
|
+
} = fullClone;
|
|
40
|
+
|
|
41
|
+
if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
|
|
42
|
+
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const MARK = '__antd_mobile_root__';
|
|
47
|
+
|
|
48
|
+
function legacyRender(node, container) {
|
|
49
|
+
reactRender(node, container);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function concurrentRender(node, container) {
|
|
53
|
+
toggleWarning(true);
|
|
54
|
+
const root = container[MARK] || createRoot(container);
|
|
55
|
+
toggleWarning(false);
|
|
56
|
+
root.render(node);
|
|
57
|
+
container[MARK] = root;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function render(node, container) {
|
|
61
|
+
if (createRoot) {
|
|
62
|
+
concurrentRender(node, container);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
legacyRender(node, container);
|
|
67
|
+
} // ========================== Unmount =========================
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
function legacyUnmount(container) {
|
|
71
|
+
return unmountComponentAtNode(container);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function concurrentUnmount(container) {
|
|
75
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
76
|
+
// Delay to unmount to avoid React 18 sync warning
|
|
77
|
+
return Promise.resolve().then(() => {
|
|
78
|
+
var _a;
|
|
79
|
+
|
|
80
|
+
(_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
|
|
81
|
+
delete container[MARK];
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function unmount(container) {
|
|
87
|
+
if (createRoot) {
|
|
88
|
+
return concurrentUnmount(container);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return legacyUnmount(container);
|
|
92
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?:
|
|
1
|
+
export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react").ReactDOMAttributes;
|
|
@@ -4,5 +4,5 @@ declare type Options<T> = {
|
|
|
4
4
|
defaultValue: T;
|
|
5
5
|
onChange?: (v: T) => void;
|
|
6
6
|
};
|
|
7
|
-
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (
|
|
7
|
+
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: SetStateAction<T>) => void];
|
|
8
8
|
export {};
|
|
@@ -9,6 +9,10 @@ export declare type CalenderRef = {
|
|
|
9
9
|
jumpToToday: () => void;
|
|
10
10
|
};
|
|
11
11
|
export declare type CalendarProps = {
|
|
12
|
+
prevMonthButton?: React.ReactNode;
|
|
13
|
+
prevYearButton?: React.ReactNode;
|
|
14
|
+
nextMonthButton?: React.ReactNode;
|
|
15
|
+
nextYearButton?: React.ReactNode;
|
|
12
16
|
onPageChange?: (year: number, month: number) => void;
|
|
13
17
|
weekStartsOn?: 'Monday' | 'Sunday';
|
|
14
18
|
renderLabel?: (date: Date) => string | null | undefined;
|
|
@@ -15,7 +15,11 @@ const classPrefix = 'adm-calendar';
|
|
|
15
15
|
const defaultProps = {
|
|
16
16
|
weekStartsOn: 'Sunday',
|
|
17
17
|
defaultValue: null,
|
|
18
|
-
allowClear: true
|
|
18
|
+
allowClear: true,
|
|
19
|
+
prevMonthButton: React.createElement(ArrowLeft, null),
|
|
20
|
+
prevYearButton: React.createElement(ArrowLeftDouble, null),
|
|
21
|
+
nextMonthButton: React.createElement(ArrowLeft, null),
|
|
22
|
+
nextYearButton: React.createElement(ArrowLeftDouble, null)
|
|
19
23
|
};
|
|
20
24
|
export const Calendar = forwardRef((p, ref) => {
|
|
21
25
|
const today = dayjs();
|
|
@@ -72,28 +76,28 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
72
76
|
const header = React.createElement("div", {
|
|
73
77
|
className: `${classPrefix}-header`
|
|
74
78
|
}, React.createElement("a", {
|
|
75
|
-
className: `${classPrefix}-arrow-button`,
|
|
79
|
+
className: `${classPrefix}-arrow-button ${classPrefix}-arrow-button-year`,
|
|
76
80
|
onClick: () => {
|
|
77
81
|
setCurrent(current.subtract(1, 'year'));
|
|
78
82
|
}
|
|
79
|
-
},
|
|
80
|
-
className: `${classPrefix}-arrow-button`,
|
|
83
|
+
}, props.prevYearButton), React.createElement("a", {
|
|
84
|
+
className: `${classPrefix}-arrow-button ${classPrefix}-arrow-button-month`,
|
|
81
85
|
onClick: () => {
|
|
82
86
|
setCurrent(current.subtract(1, 'month'));
|
|
83
87
|
}
|
|
84
|
-
},
|
|
88
|
+
}, props.prevMonthButton), React.createElement("div", {
|
|
85
89
|
className: `${classPrefix}-title`
|
|
86
90
|
}, locale.Calendar.renderYearAndMonth(current.year(), current.month() + 1)), React.createElement("a", {
|
|
87
|
-
className: `${classPrefix}-arrow-button
|
|
91
|
+
className: classNames(`${classPrefix}-arrow-button`, `${classPrefix}-arrow-button-right`, `${classPrefix}-arrow-button-right-month`),
|
|
88
92
|
onClick: () => {
|
|
89
93
|
setCurrent(current.add(1, 'month'));
|
|
90
94
|
}
|
|
91
|
-
},
|
|
92
|
-
className: `${classPrefix}-arrow-button
|
|
95
|
+
}, props.nextMonthButton), React.createElement("a", {
|
|
96
|
+
className: classNames(`${classPrefix}-arrow-button`, `${classPrefix}-arrow-button-right`, `${classPrefix}-arrow-button-right-year`),
|
|
93
97
|
onClick: () => {
|
|
94
98
|
setCurrent(current.add(1, 'year'));
|
|
95
99
|
}
|
|
96
|
-
},
|
|
100
|
+
}, props.nextYearButton));
|
|
97
101
|
const maxDay = useMemo(() => props.max && dayjs(props.max), [props.max]);
|
|
98
102
|
const minDay = useMemo(() => props.min && dayjs(props.min), [props.min]);
|
|
99
103
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PickerProps } from '../picker';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PickerProps, PickerRef } from '../picker';
|
|
3
|
+
export declare type CascadePickerRef = PickerRef;
|
|
3
4
|
export declare type CascadePickerOption = {
|
|
4
5
|
label: string;
|
|
5
6
|
value: string;
|
|
@@ -8,4 +9,6 @@ export declare type CascadePickerOption = {
|
|
|
8
9
|
export declare type CascadePickerProps = Omit<PickerProps, 'columns'> & {
|
|
9
10
|
options: CascadePickerOption[];
|
|
10
11
|
};
|
|
11
|
-
export declare const CascadePicker:
|
|
12
|
+
export declare const CascadePicker: React.ForwardRefExoticComponent<Omit<PickerProps, "columns"> & {
|
|
13
|
+
options: CascadePickerOption[];
|
|
14
|
+
} & React.RefAttributes<import("../picker").PickerActions>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
3
|
import Picker from '../picker';
|
|
4
4
|
import { useColumnsFn } from './cascade-picker-utils';
|
|
5
|
-
export const CascadePicker = props => {
|
|
5
|
+
export const CascadePicker = forwardRef((props, ref) => {
|
|
6
6
|
const {
|
|
7
7
|
options
|
|
8
8
|
} = props,
|
|
@@ -10,6 +10,7 @@ export const CascadePicker = props => {
|
|
|
10
10
|
|
|
11
11
|
const columnsFn = useColumnsFn(options);
|
|
12
12
|
return React.createElement(Picker, Object.assign({}, pickerProps, {
|
|
13
|
+
ref: ref,
|
|
13
14
|
columns: columnsFn
|
|
14
15
|
}));
|
|
15
|
-
};
|
|
16
|
+
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { prompt } from './prompt';
|
|
3
|
-
export type { CascadePickerProps, CascadePickerOption } from './cascade-picker';
|
|
4
|
-
declare const _default: import("react").
|
|
3
|
+
export type { CascadePickerProps, CascadePickerRef, CascadePickerOption, } from './cascade-picker';
|
|
4
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<import("../picker").PickerProps, "columns"> & {
|
|
5
|
+
options: import("./cascade-picker").CascadePickerOption[];
|
|
6
|
+
} & import("react").RefAttributes<import("../picker").PickerActions>> & {
|
|
5
7
|
prompt: typeof prompt;
|
|
6
8
|
};
|
|
7
9
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { PickerProps } from '../picker';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { PickerProps, PickerRef, PickerActions } from '../picker';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
|
+
export declare type DatePickerRef = PickerRef;
|
|
5
6
|
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel'> & {
|
|
6
7
|
value?: Date | null;
|
|
7
8
|
defaultValue?: Date | null;
|
|
@@ -10,8 +11,21 @@ export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' |
|
|
|
10
11
|
min?: Date;
|
|
11
12
|
max?: Date;
|
|
12
13
|
precision?: Precision;
|
|
13
|
-
children?: (value: Date | null) => ReactNode;
|
|
14
|
+
children?: (value: Date | null, actions: PickerActions) => ReactNode;
|
|
14
15
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
15
16
|
filter?: DatePickerFilter;
|
|
16
17
|
} & NativeProps;
|
|
17
|
-
export declare const DatePicker:
|
|
18
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "cancelText" | "closeOnMaskClick" | "mouseWheel" | "confirmText"> & {
|
|
19
|
+
value?: Date | null | undefined;
|
|
20
|
+
defaultValue?: Date | null | undefined;
|
|
21
|
+
onSelect?: ((value: Date) => void) | undefined;
|
|
22
|
+
onConfirm?: ((value: Date) => void) | undefined;
|
|
23
|
+
min?: Date | undefined;
|
|
24
|
+
max?: Date | undefined;
|
|
25
|
+
precision?: Precision | undefined;
|
|
26
|
+
children?: ((value: Date | null, actions: PickerActions) => ReactNode) | undefined;
|
|
27
|
+
renderLabel?: ((type: Precision, data: number) => ReactNode) | undefined;
|
|
28
|
+
filter?: Partial<Record<Precision, (val: number, extend: {
|
|
29
|
+
date: Date;
|
|
30
|
+
}) => boolean>> | undefined;
|
|
31
|
+
} & NativeProps<never> & React.RefAttributes<PickerActions>>;
|