antd-mobile 5.1.0 → 5.2.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/README.md +9 -1
- package/2x/cjs/components/calendar/calendar.d.ts +11 -2
- package/2x/cjs/components/calendar/calendar.js +32 -10
- package/2x/cjs/components/calendar/index.d.ts +1 -1
- package/2x/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/2x/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
- package/2x/cjs/components/cascade-picker/prompt.d.ts +2 -1
- package/2x/cjs/components/collapse/collapse.js +5 -3
- package/2x/cjs/components/date-picker/date-picker.js +11 -1
- package/2x/cjs/components/dialog/clear.d.ts +1 -0
- package/2x/cjs/components/dialog/clear.js +14 -0
- package/2x/cjs/components/dialog/dialog.css +27 -18
- package/2x/cjs/components/dialog/dialog.js +39 -42
- package/2x/cjs/components/dialog/index.d.ts +2 -0
- package/2x/cjs/components/dialog/index.js +4 -1
- package/2x/cjs/components/dialog/show.d.ts +1 -0
- package/2x/cjs/components/dialog/show.js +23 -11
- package/2x/cjs/components/dropdown/dropdown.css +2 -1
- package/2x/cjs/components/dropdown/item.js +2 -2
- package/2x/cjs/components/form/form.css +12 -0
- package/2x/cjs/components/form/form.d.ts +4 -4
- package/2x/cjs/components/form/index.css +12 -0
- package/2x/cjs/components/form/index.d.ts +3 -3
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +1 -1
- package/2x/cjs/components/image-viewer/index.d.ts +1 -1
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
- package/2x/cjs/components/mask/mask.js +2 -2
- package/2x/cjs/components/modal/clear.d.ts +1 -0
- package/2x/cjs/components/modal/clear.js +14 -0
- package/2x/cjs/components/modal/index.d.ts +2 -0
- package/2x/cjs/components/modal/index.js +4 -1
- package/2x/cjs/components/modal/modal.css +27 -21
- package/2x/cjs/components/modal/modal.js +39 -36
- package/2x/cjs/components/modal/show.d.ts +1 -0
- package/2x/cjs/components/modal/show.js +23 -11
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +1 -1
- package/2x/cjs/components/picker/prompt.d.ts +2 -2
- package/2x/cjs/components/picker-view/picker-view.css +0 -10
- package/2x/cjs/components/picker-view/wheel.js +7 -14
- package/2x/cjs/components/popover/arrow.js +1 -2
- package/2x/cjs/components/popover/index.d.ts +3 -3
- package/2x/cjs/components/popover/popover-menu.d.ts +1 -1
- package/2x/cjs/components/popover/popover.d.ts +1 -1
- package/2x/cjs/components/popup/popup.js +2 -2
- package/2x/cjs/components/search-bar/search-bar.js +1 -0
- package/2x/cjs/components/selector/selector.d.ts +3 -1
- package/2x/cjs/components/stepper/stepper.d.ts +12 -2
- package/2x/cjs/components/stepper/stepper.js +43 -16
- package/2x/cjs/components/swiper/index.d.ts +3 -3
- package/2x/cjs/components/swiper/swiper.d.ts +3 -3
- package/2x/cjs/components/switch/spin-icon.d.ts +3 -0
- package/2x/cjs/components/switch/spin-icon.js +37 -0
- package/2x/cjs/components/switch/switch.css +1 -1
- package/2x/cjs/components/switch/switch.js +4 -6
- package/2x/cjs/components/tabs/tabs.d.ts +1 -0
- package/2x/cjs/components/tabs/tabs.js +17 -19
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +2 -2
- package/2x/cjs/utils/measure-css-length.d.ts +1 -0
- package/2x/cjs/utils/measure-css-length.js +28 -0
- package/2x/cjs/utils/native-props.d.ts +1 -1
- package/2x/cjs/utils/render-to-container.d.ts +1 -1
- package/2x/cjs/utils/should-render.d.ts +10 -0
- package/{cjs/utils/use-should-render.js → 2x/cjs/utils/should-render.js} +8 -0
- package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -2
- package/2x/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
- package/2x/cjs/utils/use-props-value.d.ts +1 -1
- package/2x/cjs/utils/use-tab-list-scroll.js +3 -1
- package/2x/cjs/utils/use-touch.d.ts +0 -1
- package/2x/cjs/utils/validate.js +1 -1
- package/2x/cjs/utils/with-stop-propagation.d.ts +1 -1
- package/2x/es/components/calendar/calendar.d.ts +11 -2
- package/2x/es/components/calendar/calendar.js +33 -9
- package/2x/es/components/calendar/index.d.ts +1 -1
- package/2x/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/2x/es/components/capsule-tabs/capsule-tabs.js +13 -17
- package/2x/es/components/cascade-picker/prompt.d.ts +2 -1
- package/2x/es/components/collapse/collapse.js +4 -3
- package/2x/es/components/date-picker/date-picker.js +10 -1
- package/2x/es/components/dialog/clear.d.ts +1 -0
- package/2x/es/components/dialog/clear.js +6 -0
- package/2x/es/components/dialog/dialog.css +27 -18
- package/2x/es/components/dialog/dialog.js +37 -41
- package/2x/es/components/dialog/index.d.ts +2 -0
- package/2x/es/components/dialog/index.js +3 -1
- package/2x/es/components/dialog/show.d.ts +1 -0
- package/2x/es/components/dialog/show.js +20 -11
- package/2x/es/components/dropdown/dropdown.css +2 -1
- package/2x/es/components/dropdown/item.js +1 -1
- package/2x/es/components/form/form.css +12 -0
- package/2x/es/components/form/form.d.ts +4 -4
- package/2x/es/components/form/index.css +12 -0
- package/2x/es/components/form/index.d.ts +3 -3
- package/2x/es/components/image-viewer/image-viewer.d.ts +1 -1
- package/2x/es/components/image-viewer/index.d.ts +1 -1
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/2x/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
- package/2x/es/components/mask/mask.js +1 -1
- package/2x/es/components/modal/clear.d.ts +1 -0
- package/2x/es/components/modal/clear.js +6 -0
- package/2x/es/components/modal/index.d.ts +2 -0
- package/2x/es/components/modal/index.js +3 -1
- package/2x/es/components/modal/modal.css +27 -21
- package/2x/es/components/modal/modal.js +37 -36
- package/2x/es/components/modal/show.d.ts +1 -0
- package/2x/es/components/modal/show.js +20 -11
- package/2x/es/components/passcode-input/passcode-input.d.ts +1 -1
- package/2x/es/components/picker/prompt.d.ts +2 -2
- package/2x/es/components/picker-view/picker-view.css +0 -10
- package/2x/es/components/picker-view/wheel.js +7 -14
- package/2x/es/components/popover/arrow.js +1 -2
- package/2x/es/components/popover/index.d.ts +3 -3
- package/2x/es/components/popover/popover-menu.d.ts +1 -1
- package/2x/es/components/popover/popover.d.ts +1 -1
- package/2x/es/components/popup/popup.js +1 -1
- package/2x/es/components/search-bar/search-bar.js +1 -0
- package/2x/es/components/selector/selector.d.ts +3 -1
- package/2x/es/components/stepper/stepper.d.ts +12 -2
- package/2x/es/components/stepper/stepper.js +43 -16
- package/2x/es/components/swiper/index.d.ts +3 -3
- package/2x/es/components/swiper/swiper.d.ts +3 -3
- package/2x/es/components/switch/spin-icon.d.ts +3 -0
- package/2x/es/components/switch/spin-icon.js +23 -0
- package/2x/es/components/switch/switch.css +1 -1
- package/2x/es/components/switch/switch.js +3 -5
- package/2x/es/components/tabs/tabs.d.ts +1 -0
- package/2x/es/components/tabs/tabs.js +16 -20
- package/2x/es/components/virtual-input/virtual-input.d.ts +2 -2
- package/2x/es/utils/measure-css-length.d.ts +1 -0
- package/2x/es/utils/measure-css-length.js +19 -0
- package/2x/es/utils/native-props.d.ts +1 -1
- package/2x/es/utils/render-to-container.d.ts +1 -1
- package/2x/es/utils/should-render.d.ts +10 -0
- package/2x/es/utils/{use-should-render.js → should-render.js} +4 -0
- package/2x/es/utils/use-drag-and-pinch.d.ts +1 -2
- package/2x/es/utils/use-isomorphic-update-layout-effect.js +1 -2
- package/2x/es/utils/use-props-value.d.ts +1 -1
- package/2x/es/utils/use-tab-list-scroll.js +3 -2
- package/2x/es/utils/use-touch.d.ts +0 -1
- package/2x/es/utils/validate.js +1 -1
- package/2x/es/utils/with-stop-propagation.d.ts +1 -1
- package/2x/package.json +4 -4
- package/README.md +9 -1
- package/cjs/components/calendar/calendar.d.ts +11 -2
- package/cjs/components/calendar/calendar.js +32 -10
- package/cjs/components/calendar/index.d.ts +1 -1
- package/cjs/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/cjs/components/capsule-tabs/capsule-tabs.js +14 -17
- package/cjs/components/cascade-picker/prompt.d.ts +2 -1
- package/cjs/components/collapse/collapse.js +5 -3
- package/cjs/components/date-picker/date-picker.js +11 -1
- package/cjs/components/dialog/clear.d.ts +1 -0
- package/cjs/components/dialog/clear.js +14 -0
- package/cjs/components/dialog/dialog.css +26 -18
- package/cjs/components/dialog/dialog.js +39 -42
- package/cjs/components/dialog/index.d.ts +2 -0
- package/cjs/components/dialog/index.js +4 -1
- package/cjs/components/dialog/show.d.ts +1 -0
- package/cjs/components/dialog/show.js +23 -11
- package/cjs/components/dropdown/dropdown.css +2 -1
- package/cjs/components/dropdown/item.js +2 -2
- package/cjs/components/form/form.css +11 -0
- package/cjs/components/form/form.d.ts +4 -4
- package/cjs/components/form/index.css +11 -0
- package/cjs/components/form/index.d.ts +3 -3
- package/cjs/components/image-viewer/image-viewer.d.ts +1 -1
- package/cjs/components/image-viewer/index.d.ts +1 -1
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/cjs/components/jumbo-tabs/jumbo-tabs.js +14 -17
- package/cjs/components/mask/mask.js +2 -2
- package/cjs/components/modal/clear.d.ts +1 -0
- package/cjs/components/modal/clear.js +14 -0
- package/cjs/components/modal/index.d.ts +2 -0
- package/cjs/components/modal/index.js +4 -1
- package/cjs/components/modal/modal.css +26 -20
- package/cjs/components/modal/modal.js +39 -36
- package/cjs/components/modal/show.d.ts +1 -0
- package/cjs/components/modal/show.js +23 -11
- package/cjs/components/passcode-input/passcode-input.d.ts +1 -1
- package/cjs/components/picker/prompt.d.ts +2 -2
- package/cjs/components/picker-view/picker-view.css +0 -9
- package/cjs/components/picker-view/wheel.js +7 -14
- package/cjs/components/popover/arrow.js +1 -2
- package/cjs/components/popover/index.d.ts +3 -3
- package/cjs/components/popover/popover-menu.d.ts +1 -1
- package/cjs/components/popover/popover.d.ts +1 -1
- package/cjs/components/popup/popup.js +2 -2
- package/cjs/components/search-bar/search-bar.js +1 -0
- package/cjs/components/selector/selector.d.ts +3 -1
- package/cjs/components/stepper/stepper.d.ts +12 -2
- package/cjs/components/stepper/stepper.js +43 -16
- package/cjs/components/swiper/index.d.ts +3 -3
- package/cjs/components/swiper/swiper.d.ts +3 -3
- package/cjs/components/switch/spin-icon.d.ts +3 -0
- package/cjs/components/switch/spin-icon.js +37 -0
- package/cjs/components/switch/switch.css +1 -1
- package/cjs/components/switch/switch.js +4 -6
- package/cjs/components/tabs/tabs.d.ts +1 -0
- package/cjs/components/tabs/tabs.js +17 -19
- package/cjs/components/virtual-input/virtual-input.d.ts +2 -2
- package/cjs/utils/measure-css-length.d.ts +1 -0
- package/cjs/utils/measure-css-length.js +28 -0
- package/cjs/utils/native-props.d.ts +1 -1
- package/cjs/utils/render-to-container.d.ts +1 -1
- package/cjs/utils/should-render.d.ts +10 -0
- package/{2x/cjs/utils/use-should-render.js → cjs/utils/should-render.js} +8 -0
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -2
- package/cjs/utils/use-isomorphic-update-layout-effect.js +1 -3
- package/cjs/utils/use-props-value.d.ts +1 -1
- package/cjs/utils/use-tab-list-scroll.js +3 -1
- package/cjs/utils/use-touch.d.ts +0 -1
- package/cjs/utils/validate.js +1 -1
- package/cjs/utils/with-stop-propagation.d.ts +1 -1
- package/es/components/calendar/calendar.d.ts +11 -2
- package/es/components/calendar/calendar.js +33 -9
- package/es/components/calendar/index.d.ts +1 -1
- package/es/components/capsule-tabs/capsule-tabs.d.ts +1 -0
- package/es/components/capsule-tabs/capsule-tabs.js +13 -17
- package/es/components/cascade-picker/prompt.d.ts +2 -1
- package/es/components/collapse/collapse.js +4 -3
- package/es/components/date-picker/date-picker.js +10 -1
- package/es/components/dialog/clear.d.ts +1 -0
- package/es/components/dialog/clear.js +6 -0
- package/es/components/dialog/dialog.css +26 -18
- package/es/components/dialog/dialog.js +37 -41
- package/es/components/dialog/index.d.ts +2 -0
- package/es/components/dialog/index.js +3 -1
- package/es/components/dialog/show.d.ts +1 -0
- package/es/components/dialog/show.js +20 -11
- package/es/components/dropdown/dropdown.css +2 -1
- package/es/components/dropdown/item.js +1 -1
- package/es/components/form/form.css +11 -0
- package/es/components/form/form.d.ts +4 -4
- package/es/components/form/index.css +11 -0
- package/es/components/form/index.d.ts +3 -3
- package/es/components/image-viewer/image-viewer.d.ts +1 -1
- package/es/components/image-viewer/index.d.ts +1 -1
- package/es/components/input/input.d.ts +2 -2
- package/es/components/jumbo-tabs/jumbo-tabs.d.ts +1 -0
- package/es/components/jumbo-tabs/jumbo-tabs.js +13 -17
- package/es/components/mask/mask.js +1 -1
- package/es/components/modal/clear.d.ts +1 -0
- package/es/components/modal/clear.js +6 -0
- package/es/components/modal/index.d.ts +2 -0
- package/es/components/modal/index.js +3 -1
- package/es/components/modal/modal.css +26 -20
- package/es/components/modal/modal.js +37 -36
- package/es/components/modal/show.d.ts +1 -0
- package/es/components/modal/show.js +20 -11
- package/es/components/passcode-input/passcode-input.d.ts +1 -1
- package/es/components/picker/prompt.d.ts +2 -2
- package/es/components/picker-view/picker-view.css +0 -9
- package/es/components/picker-view/wheel.js +7 -14
- package/es/components/popover/arrow.js +1 -2
- package/es/components/popover/index.d.ts +3 -3
- package/es/components/popover/popover-menu.d.ts +1 -1
- package/es/components/popover/popover.d.ts +1 -1
- package/es/components/popup/popup.js +1 -1
- package/es/components/search-bar/search-bar.js +1 -0
- package/es/components/selector/selector.d.ts +3 -1
- package/es/components/stepper/stepper.d.ts +12 -2
- package/es/components/stepper/stepper.js +43 -16
- package/es/components/swiper/index.d.ts +3 -3
- package/es/components/swiper/swiper.d.ts +3 -3
- package/es/components/switch/spin-icon.d.ts +3 -0
- package/es/components/switch/spin-icon.js +23 -0
- package/es/components/switch/switch.css +1 -1
- package/es/components/switch/switch.js +3 -5
- package/es/components/tabs/tabs.d.ts +1 -0
- package/es/components/tabs/tabs.js +16 -20
- package/es/components/virtual-input/virtual-input.d.ts +2 -2
- package/es/utils/measure-css-length.d.ts +1 -0
- package/es/utils/measure-css-length.js +19 -0
- package/es/utils/native-props.d.ts +1 -1
- package/es/utils/render-to-container.d.ts +1 -1
- package/es/utils/should-render.d.ts +10 -0
- package/es/utils/{use-should-render.js → should-render.js} +4 -0
- package/es/utils/use-drag-and-pinch.d.ts +1 -2
- package/es/utils/use-isomorphic-update-layout-effect.js +1 -2
- package/es/utils/use-props-value.d.ts +1 -1
- package/es/utils/use-tab-list-scroll.js +3 -2
- package/es/utils/use-touch.d.ts +0 -1
- package/es/utils/validate.js +1 -1
- package/es/utils/with-stop-propagation.d.ts +1 -1
- package/package.json +4 -4
- package/umd/antd-mobile.js +1 -1
- package/2x/assets/spin.svg +0 -12
- package/2x/cjs/assets/spin.svg +0 -12
- package/2x/cjs/utils/use-should-render.d.ts +0 -1
- package/2x/es/assets/spin.svg +0 -12
- package/2x/es/utils/use-should-render.d.ts +0 -1
- package/assets/spin.svg +0 -12
- package/cjs/assets/spin.svg +0 -12
- package/cjs/utils/use-should-render.d.ts +0 -1
- package/es/assets/spin.svg +0 -12
- package/es/utils/use-should-render.d.ts +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import React, { useState } from 'react';
|
|
4
|
-
import SpinIcon from '../../assets/spin.svg';
|
|
5
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
6
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
7
6
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
|
+
import { SpinIcon } from './spin-icon';
|
|
8
8
|
const classPrefix = `adm-switch`;
|
|
9
9
|
const defaultProps = {
|
|
10
10
|
defaultChecked: false
|
|
@@ -54,10 +54,8 @@ export const Switch = p => {
|
|
|
54
54
|
className: `${classPrefix}-checkbox`
|
|
55
55
|
}, React.createElement("div", {
|
|
56
56
|
className: `${classPrefix}-handle`
|
|
57
|
-
}, (props.loading || changing) && React.createElement(
|
|
58
|
-
|
|
59
|
-
className: `${classPrefix}-icon`,
|
|
60
|
-
alt: 'switch-handle'
|
|
57
|
+
}, (props.loading || changing) && React.createElement(SpinIcon, {
|
|
58
|
+
className: `${classPrefix}-spin-icon`
|
|
61
59
|
})), React.createElement("div", {
|
|
62
60
|
className: `${classPrefix}-inner`
|
|
63
61
|
}, checked ? props.checkedText : props.uncheckedText))));
|
|
@@ -4,10 +4,12 @@ import { useSpring, animated } from '@react-spring/web';
|
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { bound } from '../../utils/bound';
|
|
7
|
-
import {
|
|
7
|
+
import { useThrottleFn, useIsomorphicLayoutEffect } from 'ahooks';
|
|
8
8
|
import { useMutationEffect } from '../../utils/use-mutation-effect';
|
|
9
9
|
import { useResizeEffect } from '../../utils/use-resize-effect';
|
|
10
10
|
import { mergeProps } from '../../utils/with-default-props';
|
|
11
|
+
import { useIsomorphicUpdateLayoutEffect } from '../../utils/use-isomorphic-update-layout-effect';
|
|
12
|
+
import { ShouldRender } from '../../utils/should-render';
|
|
11
13
|
const classPrefix = `adm-tabs`;
|
|
12
14
|
export const Tab = () => {
|
|
13
15
|
return null;
|
|
@@ -137,7 +139,7 @@ export const Tabs = p => {
|
|
|
137
139
|
useIsomorphicLayoutEffect(() => {
|
|
138
140
|
animate(!x.isAnimating);
|
|
139
141
|
}, []);
|
|
140
|
-
|
|
142
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
141
143
|
animate();
|
|
142
144
|
}, [activeKey]);
|
|
143
145
|
useResizeEffect(() => {
|
|
@@ -224,23 +226,17 @@ export const Tabs = p => {
|
|
|
224
226
|
return null;
|
|
225
227
|
}
|
|
226
228
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
display: 'none'
|
|
240
|
-
}
|
|
241
|
-
}, pane.props.children);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return null;
|
|
229
|
+
const active = pane.key === activeKey;
|
|
230
|
+
return React.createElement(ShouldRender, {
|
|
231
|
+
key: pane.key,
|
|
232
|
+
active: active,
|
|
233
|
+
forceRender: pane.props.forceRender,
|
|
234
|
+
destroyOnClose: pane.props.destroyOnClose
|
|
235
|
+
}, React.createElement("div", {
|
|
236
|
+
className: `${classPrefix}-content`,
|
|
237
|
+
style: {
|
|
238
|
+
display: active ? 'block' : 'none'
|
|
239
|
+
}
|
|
240
|
+
}, pane.props.children));
|
|
245
241
|
})));
|
|
246
242
|
};
|
|
@@ -18,7 +18,7 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
|
|
|
18
18
|
onFocus?: (() => void) | undefined;
|
|
19
19
|
onBlur?: (() => void) | undefined;
|
|
20
20
|
onClick?: ((e: React.MouseEvent<HTMLDivElement>) => void) | undefined;
|
|
21
|
-
keyboard?: React.ReactElement<NumberKeyboardProps, string |
|
|
21
|
+
keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
22
22
|
clearable?: boolean | undefined;
|
|
23
23
|
onClear?: (() => void) | undefined;
|
|
24
|
-
} & Pick<InputProps, "value" | "
|
|
24
|
+
} & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color"> & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function measureCSSLength(raw: string): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isDev } from './is-dev';
|
|
2
|
+
import { devError } from './dev-log';
|
|
3
|
+
export function measureCSSLength(raw) {
|
|
4
|
+
const withUnit = raw.trim();
|
|
5
|
+
|
|
6
|
+
if (withUnit.endsWith('px')) {
|
|
7
|
+
return parseFloat(withUnit);
|
|
8
|
+
} else if (withUnit.endsWith('rem')) {
|
|
9
|
+
return parseFloat(withUnit) * parseFloat(window.getComputedStyle(document.documentElement).fontSize);
|
|
10
|
+
} else if (withUnit.endsWith('vw')) {
|
|
11
|
+
return parseFloat(withUnit) * window.innerWidth / 100;
|
|
12
|
+
} else {
|
|
13
|
+
if (isDev) {
|
|
14
|
+
devError('Global', 'You are using a not supported CSS unit. Only `px` `rem` and `vw` are supported.');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -5,4 +5,4 @@ export interface NativeProps<S extends string = never> {
|
|
|
5
5
|
style?: CSSProperties & Partial<Record<S, string>>;
|
|
6
6
|
tabIndex?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare function withNativeProps<P extends NativeProps>(props: P, element: ReactElement): React.ReactElement<any, string |
|
|
8
|
+
export declare function withNativeProps<P extends NativeProps>(props: P, element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
export declare type GetContainer = HTMLElement | (() => HTMLElement) | null;
|
|
3
|
-
export declare function renderToContainer(getContainer: GetContainer, node: ReactElement): ReactElement<any, string |
|
|
3
|
+
export declare function renderToContainer(getContainer: GetContainer, node: ReactElement): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
active: boolean;
|
|
4
|
+
forceRender?: boolean;
|
|
5
|
+
destroyOnClose?: boolean;
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
}
|
|
8
|
+
export declare const ShouldRender: FC<Props>;
|
|
9
|
+
export declare function useShouldRender(active: boolean, forceRender?: boolean, destroyOnClose?: boolean): boolean;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { useInitialized } from './use-initialized';
|
|
2
|
+
export const ShouldRender = props => {
|
|
3
|
+
const shouldRender = useShouldRender(props.active, props.forceRender, props.destroyOnClose);
|
|
4
|
+
return shouldRender ? props.children : null;
|
|
5
|
+
};
|
|
2
6
|
export function useShouldRender(active, forceRender, destroyOnClose) {
|
|
3
7
|
const initialized = useInitialized(active);
|
|
4
8
|
if (forceRender) return true;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
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[]) => Pick<import("react").DOMAttributes<EventTarget>, "onClick" | "onChange" | "onPause" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">;
|
|
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;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { createUpdateEffect } from 'ahooks
|
|
2
|
-
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
1
|
+
import { createUpdateEffect, useIsomorphicLayoutEffect } from 'ahooks';
|
|
3
2
|
export const useIsomorphicUpdateLayoutEffect = createUpdateEffect(useIsomorphicLayoutEffect);
|
|
@@ -3,5 +3,5 @@ declare type Options<T> = {
|
|
|
3
3
|
defaultValue: T;
|
|
4
4
|
onChange?: (v: T) => void;
|
|
5
5
|
};
|
|
6
|
-
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: T) => void];
|
|
6
|
+
export declare function usePropsValue<T>(options: Options<T>): readonly [T, (this: unknown, v: T) => void];
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useSpring } from '@react-spring/web';
|
|
2
2
|
import { useMutationEffect } from './use-mutation-effect';
|
|
3
3
|
import { bound } from './bound';
|
|
4
|
-
import { useIsomorphicLayoutEffect
|
|
4
|
+
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
5
|
+
import { useIsomorphicUpdateLayoutEffect } from './use-isomorphic-update-layout-effect';
|
|
5
6
|
export const useTabListScroll = (targetRef, activeIndex) => {
|
|
6
7
|
const [{
|
|
7
8
|
scrollLeft
|
|
@@ -39,7 +40,7 @@ export const useTabListScroll = (targetRef, activeIndex) => {
|
|
|
39
40
|
useIsomorphicLayoutEffect(() => {
|
|
40
41
|
animate(true);
|
|
41
42
|
}, []);
|
|
42
|
-
|
|
43
|
+
useIsomorphicUpdateLayoutEffect(() => {
|
|
43
44
|
animate();
|
|
44
45
|
}, [activeIndex]);
|
|
45
46
|
useMutationEffect(() => {
|
package/2x/es/utils/validate.js
CHANGED
|
@@ -6,7 +6,7 @@ export function isObject(val) {
|
|
|
6
6
|
return val !== null && typeof val === 'object';
|
|
7
7
|
}
|
|
8
8
|
export function isPromise(obj) {
|
|
9
|
-
return obj && typeof obj === 'object' && typeof obj.then === 'function';
|
|
9
|
+
return !!obj && typeof obj === 'object' && typeof obj.then === 'function';
|
|
10
10
|
}
|
|
11
11
|
export function isDate(val) {
|
|
12
12
|
return Object.prototype.toString.call(val) === '[object Date]' && !Number.isNaN(val.getTime());
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
export declare type PropagationEvent = 'click';
|
|
3
|
-
export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string |
|
|
3
|
+
export declare function withStopPropagation(events: PropagationEvent[], element: ReactElement): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
package/2x/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@react-spring/web": "^9.4.3",
|
|
6
6
|
"@types/resize-observer-browser": "^0.1.7",
|
|
7
7
|
"@use-gesture/react": "^10.2.6",
|
|
8
|
-
"ahooks": "^3.1.
|
|
8
|
+
"ahooks": "^3.1.10",
|
|
9
9
|
"antd-mobile-icons": "^0.2.2",
|
|
10
10
|
"antd-mobile-v5-count": "^1.0.1",
|
|
11
11
|
"classnames": "^2.3.1",
|
|
12
12
|
"dayjs": "^1.10.7",
|
|
13
13
|
"lodash": "^4.17.21",
|
|
14
|
-
"rc-field-form": "^1.
|
|
14
|
+
"rc-field-form": "^1.23.0",
|
|
15
15
|
"rc-tooltip": "^5.1.1",
|
|
16
16
|
"staged-components": "^1.1.2",
|
|
17
|
-
"tslib": "^
|
|
17
|
+
"tslib": "^2.3.1",
|
|
18
18
|
"use-async-memo": "^1.2.3"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*hjjDS5Yy-ooAAAAAAAAAAAAAARQnAQ" alt="logo" width="100%" />
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://mobile.ant.design">English Doc</a>
|
|
5
|
+
|
|
|
6
|
+
<a href="https://mobile.ant.design/zh">中文文档</a>
|
|
7
|
+
|
|
|
8
|
+
<a href="https://discord.gg/jmNvw4WFYn">Discord</a>
|
|
9
|
+
|
|
|
10
|
+
<a href="https://gw.alipayobjects.com/mdn/rms_25513e/afts/img/A*hBjlR4nUWjkAAAAAAAAAAAAAARQnAQ">钉钉</a>
|
|
11
|
+
</p>
|
|
4
12
|
|
|
5
13
|

|
|
6
14
|

|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
declare type Page = {
|
|
4
|
+
month: number;
|
|
5
|
+
year: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type CalenderRef = {
|
|
8
|
+
jumpTo: (page: Page | ((page: Page) => Page)) => void;
|
|
9
|
+
jumpToToday: () => void;
|
|
10
|
+
};
|
|
3
11
|
export declare type CalendarProps = {
|
|
4
12
|
weekStartsOn?: 'Monday' | 'Sunday';
|
|
5
13
|
renderLabel?: (date: Date) => string | null | undefined;
|
|
@@ -20,4 +28,5 @@ export declare type CalendarProps = {
|
|
|
20
28
|
defaultValue?: [Date, Date] | null;
|
|
21
29
|
onChange?: (val: [Date, Date]) => void;
|
|
22
30
|
}) & NativeProps;
|
|
23
|
-
export declare const Calendar:
|
|
31
|
+
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<CalenderRef>>;
|
|
32
|
+
export {};
|
|
@@ -37,8 +37,7 @@ const classPrefix = 'adm-calendar';
|
|
|
37
37
|
const defaultProps = {
|
|
38
38
|
weekStartsOn: 'Sunday'
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
const Calendar = p => {
|
|
40
|
+
const Calendar = (0, _react.forwardRef)((p, ref) => {
|
|
42
41
|
const today = (0, _dayjs.default)();
|
|
43
42
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
44
43
|
const {
|
|
@@ -57,6 +56,25 @@ const Calendar = p => {
|
|
|
57
56
|
|
|
58
57
|
(_a = props.onPageChange) === null || _a === void 0 ? void 0 : _a.call(props, current.year(), current.month() + 1);
|
|
59
58
|
}, [current]);
|
|
59
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
60
|
+
jumpTo: pageOrPageGenerator => {
|
|
61
|
+
let page;
|
|
62
|
+
|
|
63
|
+
if (typeof pageOrPageGenerator === 'function') {
|
|
64
|
+
page = pageOrPageGenerator({
|
|
65
|
+
year: current.year(),
|
|
66
|
+
month: current.month() + 1
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
page = pageOrPageGenerator;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
setCurrent((0, _dayjs.default)().year(page.year).month(page.month - 1));
|
|
73
|
+
},
|
|
74
|
+
jumpToToday: () => {
|
|
75
|
+
setCurrent((0, _dayjs.default)().date(1));
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
60
78
|
|
|
61
79
|
const header = _react.default.createElement("div", {
|
|
62
80
|
className: `${classPrefix}-header`
|
|
@@ -144,13 +162,18 @@ const Calendar = p => {
|
|
|
144
162
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, d.toDate());
|
|
145
163
|
} else if (props.selectionMode === 'range') {
|
|
146
164
|
if (begin !== null && end === null) {
|
|
147
|
-
if (d.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, [d.toDate(), begin.toDate()]);
|
|
165
|
+
if (begin.isSame(d.toDate())) {
|
|
166
|
+
setBegin(null);
|
|
167
|
+
setEnd(null);
|
|
151
168
|
} else {
|
|
152
|
-
|
|
153
|
-
|
|
169
|
+
if (d.isBefore(begin)) {
|
|
170
|
+
setEnd(begin);
|
|
171
|
+
setBegin(d);
|
|
172
|
+
(_b = props.onChange) === null || _b === void 0 ? void 0 : _b.call(props, [d.toDate(), begin.toDate()]);
|
|
173
|
+
} else {
|
|
174
|
+
setEnd(d);
|
|
175
|
+
(_c = props.onChange) === null || _c === void 0 ? void 0 : _c.call(props, [begin.toDate(), d.toDate()]);
|
|
176
|
+
}
|
|
154
177
|
}
|
|
155
178
|
} else {
|
|
156
179
|
setBegin(d);
|
|
@@ -187,6 +210,5 @@ const Calendar = p => {
|
|
|
187
210
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
188
211
|
className: classPrefix
|
|
189
212
|
}, header, mark, body));
|
|
190
|
-
};
|
|
191
|
-
|
|
213
|
+
});
|
|
192
214
|
exports.Calendar = Calendar;
|
|
@@ -21,6 +21,8 @@ var _useTabListScroll = require("../../utils/use-tab-list-scroll");
|
|
|
21
21
|
|
|
22
22
|
var _scrollMask = _interopRequireDefault(require("../scroll-mask"));
|
|
23
23
|
|
|
24
|
+
var _shouldRender = require("../../utils/should-render");
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
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); }
|
|
@@ -110,23 +112,18 @@ const CapsuleTabs = props => {
|
|
|
110
112
|
return null;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
}, pane.props.children);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return null;
|
|
115
|
+
const active = pane.key === activeKey;
|
|
116
|
+
return _react.default.createElement(_shouldRender.ShouldRender, {
|
|
117
|
+
key: pane.key,
|
|
118
|
+
active: active,
|
|
119
|
+
forceRender: pane.props.forceRender,
|
|
120
|
+
destroyOnClose: pane.props.destroyOnClose
|
|
121
|
+
}, _react.default.createElement("div", {
|
|
122
|
+
className: `${classPrefix}-content`,
|
|
123
|
+
style: {
|
|
124
|
+
display: active ? 'block' : 'none'
|
|
125
|
+
}
|
|
126
|
+
}, pane.props.children));
|
|
130
127
|
})));
|
|
131
128
|
};
|
|
132
129
|
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { CascadePickerProps } from './cascade-picker';
|
|
2
|
-
|
|
2
|
+
import type { PickerValue } from '../picker';
|
|
3
|
+
export declare function prompt(props: Omit<CascadePickerProps, 'value' | 'visible' | 'children'>): Promise<PickerValue[] | null>;
|
|
@@ -21,7 +21,9 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
21
21
|
|
|
22
22
|
var _ahooks = require("ahooks");
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _shouldRender = require("../../utils/should-render");
|
|
25
|
+
|
|
26
|
+
var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
@@ -42,7 +44,7 @@ const CollapsePanelContent = props => {
|
|
|
42
44
|
visible
|
|
43
45
|
} = props;
|
|
44
46
|
const innerRef = (0, _react.useRef)(null);
|
|
45
|
-
const shouldRender = (0,
|
|
47
|
+
const shouldRender = (0, _shouldRender.useShouldRender)(visible, props.forceRender, props.destroyOnClose);
|
|
46
48
|
const [{
|
|
47
49
|
height
|
|
48
50
|
}, api] = (0, _web.useSpring)(() => ({
|
|
@@ -59,7 +61,7 @@ const CollapsePanelContent = props => {
|
|
|
59
61
|
immediate: true
|
|
60
62
|
});
|
|
61
63
|
});
|
|
62
|
-
(0,
|
|
64
|
+
(0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(() => {
|
|
63
65
|
const inner = innerRef.current;
|
|
64
66
|
if (!inner) return;
|
|
65
67
|
|
|
@@ -19,6 +19,8 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
19
19
|
|
|
20
20
|
var _datePickerUtils = require("./date-picker-utils");
|
|
21
21
|
|
|
22
|
+
var _bound = require("../../utils/bound");
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
24
26
|
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); }
|
|
@@ -47,7 +49,15 @@ const DatePicker = p => {
|
|
|
47
49
|
}
|
|
48
50
|
});
|
|
49
51
|
const now = (0, _react.useMemo)(() => new Date(), []);
|
|
50
|
-
const pickerValue = (0, _react.useMemo)(() =>
|
|
52
|
+
const pickerValue = (0, _react.useMemo)(() => {
|
|
53
|
+
let date = value;
|
|
54
|
+
|
|
55
|
+
if (date === null) {
|
|
56
|
+
date = new Date((0, _bound.bound)(now.getTime(), props.min.getTime(), props.max.getTime()));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (0, _datePickerUtils.convertDateToStringArray)(date, props.precision);
|
|
60
|
+
}, [value, props.precision]);
|
|
51
61
|
const onConfirm = (0, _react.useCallback)(val => {
|
|
52
62
|
setValue((0, _datePickerUtils.convertStringArrayToDate)(val, props.precision));
|
|
53
63
|
}, [setValue, props.precision]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function clear(): void;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
max-width: 500px;
|
|
16
16
|
transform: translate(-50%, -50%);
|
|
17
17
|
}
|
|
18
|
-
.adm-dialog-
|
|
18
|
+
.adm-dialog-body {
|
|
19
19
|
width: 100%;
|
|
20
20
|
max-height: 70vh;
|
|
21
21
|
font-size: 14px;
|
|
@@ -25,29 +25,33 @@
|
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
}
|
|
28
|
-
.adm-dialog-
|
|
28
|
+
.adm-dialog-body > * {
|
|
29
29
|
flex: none;
|
|
30
30
|
}
|
|
31
|
-
.adm-dialog-
|
|
31
|
+
.adm-dialog-body > .adm-dialog-content {
|
|
32
32
|
flex: auto;
|
|
33
33
|
}
|
|
34
|
-
.adm-dialog-
|
|
35
|
-
padding-top:
|
|
34
|
+
.adm-dialog-body:not(.adm-dialog-with-image) {
|
|
35
|
+
padding-top: 20px;
|
|
36
36
|
}
|
|
37
|
-
.adm-dialog-
|
|
38
|
-
|
|
37
|
+
.adm-dialog-body .adm-dialog-image-container {
|
|
38
|
+
margin-bottom: 12px;
|
|
39
|
+
max-height: 40vh;
|
|
39
40
|
}
|
|
40
|
-
.adm-dialog-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
.adm-dialog-body .adm-dialog-header {
|
|
42
|
+
margin-bottom: 8px;
|
|
43
|
+
padding: 0 12px;
|
|
43
44
|
}
|
|
44
|
-
.adm-dialog-
|
|
45
|
+
.adm-dialog-body .adm-dialog-title {
|
|
46
|
+
margin-bottom: 8px;
|
|
47
|
+
padding: 0 12px;
|
|
45
48
|
font-weight: bold;
|
|
46
49
|
font-size: 18px;
|
|
47
50
|
line-height: 25px;
|
|
48
51
|
text-align: center;
|
|
49
52
|
}
|
|
50
|
-
.adm-dialog-
|
|
53
|
+
.adm-dialog-body .adm-dialog-content {
|
|
54
|
+
padding: 0 12px 20px;
|
|
51
55
|
max-height: 70vh;
|
|
52
56
|
overflow-x: hidden;
|
|
53
57
|
overflow-y: auto;
|
|
@@ -55,28 +59,32 @@
|
|
|
55
59
|
line-height: 1.4;
|
|
56
60
|
color: #333;
|
|
57
61
|
}
|
|
58
|
-
.adm-dialog-
|
|
62
|
+
.adm-dialog-body .adm-dialog-content-empty {
|
|
63
|
+
padding: 0;
|
|
64
|
+
height: 12px;
|
|
65
|
+
}
|
|
66
|
+
.adm-dialog-body .adm-dialog-footer {
|
|
59
67
|
user-select: none;
|
|
60
68
|
}
|
|
61
|
-
.adm-dialog-
|
|
69
|
+
.adm-dialog-body .adm-dialog-footer .adm-dialog-action-row {
|
|
62
70
|
display: flex;
|
|
63
71
|
align-items: stretch;
|
|
64
72
|
border-top: 0.5px solid var(--adm-border-color);
|
|
65
73
|
}
|
|
66
|
-
.adm-dialog-
|
|
74
|
+
.adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > * {
|
|
67
75
|
flex: 1;
|
|
68
76
|
}
|
|
69
|
-
.adm-dialog-
|
|
77
|
+
.adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button {
|
|
70
78
|
padding: 10px;
|
|
71
79
|
font-size: 18px;
|
|
72
80
|
line-height: 25px;
|
|
73
81
|
border-radius: 0;
|
|
74
82
|
border-right: solid 0.5px var(--adm-border-color);
|
|
75
83
|
}
|
|
76
|
-
.adm-dialog-
|
|
84
|
+
.adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button-bold {
|
|
77
85
|
font-weight: bold;
|
|
78
86
|
}
|
|
79
|
-
.adm-dialog-
|
|
87
|
+
.adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button:last-child {
|
|
80
88
|
border-right: none;
|
|
81
89
|
}
|
|
82
90
|
.adm-dialog-image-container {
|