antd-mobile 5.0.0-rc.23 → 5.0.0-rc.27
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 +6 -6
- package/2x/cjs/components/button/button.css +2 -2
- package/2x/cjs/components/calendar/calendar.js +3 -1
- package/2x/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/cjs/components/dialog/dialog.css +4 -0
- package/2x/cjs/components/dropdown/dropdown.css +0 -4
- package/2x/cjs/components/dropdown/item.js +3 -1
- package/2x/cjs/components/ellipsis/ellipsis.js +3 -1
- package/2x/cjs/components/empty/empty.css +1 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.css +1 -0
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +7 -5
- package/2x/cjs/components/floating-panel/floating-panel.js +11 -1
- package/2x/cjs/components/form/form-item.css +4 -6
- package/2x/cjs/components/form/form-item.d.ts +2 -2
- package/2x/cjs/components/form/form-item.js +9 -5
- package/2x/cjs/components/form/form.css +3 -3
- package/2x/cjs/components/form/form.d.ts +5 -4
- package/2x/cjs/components/form/index.css +7 -9
- package/2x/cjs/components/form/index.d.ts +5 -4
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -1
- package/2x/cjs/components/image-viewer/image-viewer.css +2 -0
- package/2x/cjs/components/image-viewer/image-viewer.js +12 -2
- package/2x/cjs/components/image-viewer/slide.js +11 -7
- package/2x/cjs/components/image-viewer/slides.d.ts +1 -1
- package/2x/cjs/components/index-bar/index-bar.css +2 -1
- package/2x/cjs/components/input/input.d.ts +6 -2
- package/2x/cjs/components/input/input.js +23 -3
- package/2x/cjs/components/list/list.css +8 -10
- package/2x/cjs/components/picker/picker.css +10 -2
- package/2x/cjs/components/picker/picker.d.ts +2 -1
- package/2x/cjs/components/picker/picker.js +3 -1
- package/2x/cjs/components/picker-view/picker-view.css +2 -1
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/2x/cjs/components/picker-view/wheel.js +4 -2
- package/2x/cjs/components/popover/arrow.d.ts +3 -0
- package/2x/cjs/components/popover/arrow.js +26 -0
- package/2x/cjs/components/popover/index.d.ts +10 -20
- package/2x/cjs/components/popover/index.js +4 -2
- package/2x/cjs/components/popover/popover-menu.css +63 -0
- package/2x/cjs/components/popover/popover-menu.d.ts +17 -0
- package/{cjs/components/popover/pop-menu.js → 2x/cjs/components/popover/popover-menu.js} +23 -26
- package/2x/cjs/components/popover/popover.css +90 -318
- package/2x/cjs/components/popover/popover.d.ts +9 -8
- package/2x/cjs/components/popover/popover.js +11 -17
- package/2x/cjs/components/radio/radio.js +2 -3
- package/2x/cjs/components/selector/selector.css +14 -6
- package/2x/cjs/components/selector/selector.d.ts +2 -1
- package/2x/cjs/components/selector/selector.js +3 -2
- package/2x/cjs/components/swiper/swiper.js +1 -1
- package/2x/cjs/components/tabs/tabs.js +2 -2
- package/2x/cjs/components/text-area/text-area.css +9 -9
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +41 -32
- package/2x/cjs/components/virtual-input/virtual-input.js +3 -1
- package/2x/cjs/utils/get-scroll-parent.js +1 -1
- package/2x/cjs/utils/use-ref-state.js +1 -1
- package/2x/cjs/utils/use-resize-effect.js +1 -3
- package/2x/cjs/utils/use-tab-list-scroll.js +1 -3
- package/2x/es/components/button/button.css +2 -2
- package/2x/es/components/calendar/calendar.js +3 -2
- package/2x/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/es/components/dialog/dialog.css +4 -0
- package/2x/es/components/dropdown/dropdown.css +0 -4
- package/2x/es/components/dropdown/item.js +3 -1
- package/2x/es/components/ellipsis/ellipsis.js +3 -2
- package/2x/es/components/empty/empty.css +1 -1
- package/2x/es/components/floating-bubble/floating-bubble.css +1 -0
- package/2x/es/components/floating-panel/floating-panel.d.ts +7 -5
- package/2x/es/components/floating-panel/floating-panel.js +9 -1
- package/2x/es/components/form/form-item.css +4 -6
- package/2x/es/components/form/form-item.d.ts +2 -2
- package/2x/es/components/form/form-item.js +9 -5
- package/2x/es/components/form/form.css +3 -3
- package/2x/es/components/form/form.d.ts +5 -4
- package/2x/es/components/form/index.css +7 -9
- package/2x/es/components/form/index.d.ts +5 -4
- package/2x/es/components/image-uploader/image-uploader.js +3 -3
- package/2x/es/components/image-viewer/image-viewer.css +2 -0
- package/2x/es/components/image-viewer/image-viewer.js +13 -3
- package/2x/es/components/image-viewer/slide.js +11 -7
- package/2x/es/components/image-viewer/slides.d.ts +1 -1
- package/2x/es/components/index-bar/index-bar.css +2 -1
- package/2x/es/components/input/input.d.ts +6 -2
- package/2x/es/components/input/input.js +22 -4
- package/2x/es/components/list/list.css +8 -10
- package/2x/es/components/picker/picker.css +10 -2
- package/2x/es/components/picker/picker.d.ts +2 -1
- package/2x/es/components/picker/picker.js +3 -1
- package/2x/es/components/picker-view/picker-view.css +2 -1
- package/2x/es/components/picker-view/picker-view.d.ts +1 -1
- package/2x/es/components/picker-view/wheel.js +4 -3
- package/2x/es/components/popover/arrow.d.ts +3 -0
- package/2x/es/components/popover/arrow.js +12 -0
- package/2x/es/components/popover/index.d.ts +10 -20
- package/2x/es/components/popover/index.js +3 -2
- package/2x/es/components/popover/popover-menu.css +63 -0
- package/2x/es/components/popover/popover-menu.d.ts +17 -0
- package/2x/es/components/popover/popover-menu.js +52 -0
- package/2x/es/components/popover/popover.css +90 -318
- package/2x/es/components/popover/popover.d.ts +9 -8
- package/2x/es/components/popover/popover.js +10 -17
- package/2x/es/components/radio/radio.js +2 -3
- package/2x/es/components/selector/selector.css +14 -6
- package/2x/es/components/selector/selector.d.ts +2 -1
- package/2x/es/components/selector/selector.js +3 -2
- package/2x/es/components/swiper/swiper.js +3 -3
- package/2x/es/components/tabs/tabs.js +4 -4
- package/2x/es/components/text-area/text-area.css +9 -9
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +41 -31
- package/2x/es/components/virtual-input/virtual-input.js +3 -2
- package/2x/es/utils/get-scroll-parent.js +1 -1
- package/2x/es/utils/use-ref-state.js +2 -2
- package/2x/es/utils/use-resize-effect.js +2 -3
- package/2x/es/utils/use-tab-list-scroll.js +2 -3
- package/2x/package.json +5 -5
- package/README.md +6 -6
- package/cjs/components/button/button.css +2 -2
- package/cjs/components/calendar/calendar.js +3 -1
- package/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/cjs/components/dialog/dialog.css +3 -0
- package/cjs/components/dropdown/dropdown.css +0 -3
- package/cjs/components/dropdown/item.js +3 -1
- package/cjs/components/ellipsis/ellipsis.js +3 -1
- package/cjs/components/empty/empty.css +1 -1
- package/cjs/components/floating-bubble/floating-bubble.css +1 -0
- package/cjs/components/floating-panel/floating-panel.d.ts +7 -5
- package/cjs/components/floating-panel/floating-panel.js +11 -1
- package/cjs/components/form/form-item.css +4 -5
- package/cjs/components/form/form-item.d.ts +2 -2
- package/cjs/components/form/form-item.js +9 -5
- package/cjs/components/form/form.css +3 -3
- package/cjs/components/form/form.d.ts +5 -4
- package/cjs/components/form/index.css +7 -8
- package/cjs/components/form/index.d.ts +5 -4
- package/cjs/components/image-uploader/image-uploader.js +1 -1
- package/cjs/components/image-viewer/image-viewer.css +2 -0
- package/cjs/components/image-viewer/image-viewer.js +12 -2
- package/cjs/components/image-viewer/slide.js +11 -7
- package/cjs/components/image-viewer/slides.d.ts +1 -1
- package/cjs/components/index-bar/index-bar.css +2 -1
- package/cjs/components/input/input.d.ts +6 -2
- package/cjs/components/input/input.js +23 -3
- package/cjs/components/list/list.css +7 -9
- package/cjs/components/picker/picker.css +9 -2
- package/cjs/components/picker/picker.d.ts +2 -1
- package/cjs/components/picker/picker.js +3 -1
- package/cjs/components/picker-view/picker-view.css +2 -1
- package/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/cjs/components/picker-view/wheel.js +4 -2
- package/cjs/components/popover/arrow.d.ts +3 -0
- package/cjs/components/popover/arrow.js +26 -0
- package/cjs/components/popover/index.d.ts +10 -20
- package/cjs/components/popover/index.js +4 -2
- package/cjs/components/popover/popover-menu.css +52 -0
- package/cjs/components/popover/popover-menu.d.ts +17 -0
- package/{2x/cjs/components/popover/pop-menu.js → cjs/components/popover/popover-menu.js} +23 -26
- package/cjs/components/popover/popover.css +83 -276
- package/cjs/components/popover/popover.d.ts +9 -8
- package/cjs/components/popover/popover.js +11 -17
- package/cjs/components/radio/radio.js +2 -3
- package/cjs/components/selector/selector.css +14 -6
- package/cjs/components/selector/selector.d.ts +2 -1
- package/cjs/components/selector/selector.js +3 -2
- package/cjs/components/swiper/swiper.js +1 -1
- package/cjs/components/tabs/tabs.js +2 -2
- package/cjs/components/text-area/text-area.css +9 -9
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +41 -32
- package/cjs/components/virtual-input/virtual-input.js +3 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/cjs/utils/use-ref-state.js +1 -1
- package/cjs/utils/use-resize-effect.js +1 -3
- package/cjs/utils/use-tab-list-scroll.js +1 -3
- package/es/components/button/button.css +2 -2
- package/es/components/calendar/calendar.js +3 -2
- package/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/es/components/dialog/dialog.css +3 -0
- package/es/components/dropdown/dropdown.css +0 -3
- package/es/components/dropdown/item.js +3 -1
- package/es/components/ellipsis/ellipsis.js +3 -2
- package/es/components/empty/empty.css +1 -1
- package/es/components/floating-bubble/floating-bubble.css +1 -0
- package/es/components/floating-panel/floating-panel.d.ts +7 -5
- package/es/components/floating-panel/floating-panel.js +9 -1
- package/es/components/form/form-item.css +4 -5
- package/es/components/form/form-item.d.ts +2 -2
- package/es/components/form/form-item.js +9 -5
- package/es/components/form/form.css +3 -3
- package/es/components/form/form.d.ts +5 -4
- package/es/components/form/index.css +7 -8
- package/es/components/form/index.d.ts +5 -4
- package/es/components/image-uploader/image-uploader.js +3 -3
- package/es/components/image-viewer/image-viewer.css +2 -0
- package/es/components/image-viewer/image-viewer.js +13 -3
- package/es/components/image-viewer/slide.js +11 -7
- package/es/components/image-viewer/slides.d.ts +1 -1
- package/es/components/index-bar/index-bar.css +2 -1
- package/es/components/input/input.d.ts +6 -2
- package/es/components/input/input.js +22 -4
- package/es/components/list/list.css +7 -9
- package/es/components/picker/picker.css +9 -2
- package/es/components/picker/picker.d.ts +2 -1
- package/es/components/picker/picker.js +3 -1
- package/es/components/picker-view/picker-view.css +2 -1
- package/es/components/picker-view/picker-view.d.ts +1 -1
- package/es/components/picker-view/wheel.js +4 -3
- package/es/components/popover/arrow.d.ts +3 -0
- package/es/components/popover/arrow.js +12 -0
- package/es/components/popover/index.d.ts +10 -20
- package/es/components/popover/index.js +3 -2
- package/es/components/popover/popover-menu.css +52 -0
- package/es/components/popover/popover-menu.d.ts +17 -0
- package/es/components/popover/popover-menu.js +52 -0
- package/es/components/popover/popover.css +83 -276
- package/es/components/popover/popover.d.ts +9 -8
- package/es/components/popover/popover.js +10 -17
- package/es/components/radio/radio.js +2 -3
- package/es/components/selector/selector.css +14 -6
- package/es/components/selector/selector.d.ts +2 -1
- package/es/components/selector/selector.js +3 -2
- package/es/components/swiper/swiper.js +3 -3
- package/es/components/tabs/tabs.js +4 -4
- package/es/components/text-area/text-area.css +9 -9
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +41 -31
- package/es/components/virtual-input/virtual-input.js +3 -2
- package/es/utils/get-scroll-parent.js +1 -1
- package/es/utils/use-ref-state.js +2 -2
- package/es/utils/use-resize-effect.js +2 -3
- package/es/utils/use-tab-list-scroll.js +2 -3
- package/package.json +5 -5
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/popover/animation.css +0 -111
- package/2x/cjs/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/animation.css +0 -111
- package/2x/es/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/pop-menu.js +0 -54
- package/cjs/components/popover/animation.css +0 -96
- package/cjs/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/animation.css +0 -96
- package/es/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/pop-menu.js +0 -54
|
@@ -16,5 +16,6 @@ export declare type SelectorProps<V> = {
|
|
|
16
16
|
onChange?: (v: V[], extend: {
|
|
17
17
|
items: SelectorOption<V>[];
|
|
18
18
|
}) => void;
|
|
19
|
-
|
|
19
|
+
showCheckMark?: boolean;
|
|
20
|
+
} & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
|
|
20
21
|
export declare const Selector: <V extends string | number>(p: SelectorProps<V>) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
|
|
@@ -10,7 +10,8 @@ import { CheckMark } from './check-mark';
|
|
|
10
10
|
const classPrefix = `adm-selector`;
|
|
11
11
|
const defaultProps = {
|
|
12
12
|
multiple: false,
|
|
13
|
-
defaultValue: []
|
|
13
|
+
defaultValue: [],
|
|
14
|
+
showCheckMark: true
|
|
14
15
|
};
|
|
15
16
|
export const Selector = p => {
|
|
16
17
|
const props = mergeProps(defaultProps, p);
|
|
@@ -55,7 +56,7 @@ export const Selector = p => {
|
|
|
55
56
|
}
|
|
56
57
|
}, option.label, option.description && React.createElement("div", {
|
|
57
58
|
className: `${classPrefix}-item-description`
|
|
58
|
-
}, option.description), active && React.createElement("div", {
|
|
59
|
+
}, option.description), active && props.showCheckMark && React.createElement("div", {
|
|
59
60
|
className: `${classPrefix}-check-mark-wrapper`
|
|
60
61
|
}, React.createElement(CheckMark, null)));
|
|
61
62
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef, useEffect, useImperativeHandle,
|
|
1
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import classNames from 'classnames';
|
|
@@ -10,7 +10,7 @@ import PageIndicator from '../page-indicator';
|
|
|
10
10
|
import { staged } from 'staged-components';
|
|
11
11
|
import { useRefState } from '../../utils/use-ref-state';
|
|
12
12
|
import { bound } from '../../utils/bound';
|
|
13
|
-
import { useUpdateEffect } from 'ahooks';
|
|
13
|
+
import { useIsomorphicLayoutEffect, useUpdateEffect } from 'ahooks';
|
|
14
14
|
const defaultProps = {
|
|
15
15
|
defaultIndex: 0,
|
|
16
16
|
allowTouchMove: true,
|
|
@@ -184,7 +184,7 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
184
184
|
swipeNext,
|
|
185
185
|
swipePrev
|
|
186
186
|
}));
|
|
187
|
-
|
|
187
|
+
useIsomorphicLayoutEffect(() => {
|
|
188
188
|
const maxIndex = validChildren.length - 1;
|
|
189
189
|
|
|
190
190
|
if (current > maxIndex) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useRef
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
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 { useUpdateLayoutEffect, useThrottleFn } from 'ahooks';
|
|
7
|
+
import { useUpdateLayoutEffect, 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';
|
|
@@ -134,7 +134,7 @@ export const Tabs = p => {
|
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
useIsomorphicLayoutEffect(() => {
|
|
138
138
|
animate(true);
|
|
139
139
|
}, []);
|
|
140
140
|
useUpdateLayoutEffect(() => {
|
|
@@ -168,7 +168,7 @@ export const Tabs = p => {
|
|
|
168
168
|
trailing: true,
|
|
169
169
|
leading: true
|
|
170
170
|
});
|
|
171
|
-
|
|
171
|
+
useIsomorphicLayoutEffect(() => {
|
|
172
172
|
updateMask(true);
|
|
173
173
|
}, []);
|
|
174
174
|
return withNativeProps(props, React.createElement("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.adm-text-area
|
|
1
|
+
.adm-text-area {
|
|
2
2
|
--font-size: 34px;
|
|
3
3
|
--color: var(--adm-color-text);
|
|
4
4
|
--placeholder-color: var(--adm-color-light);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
max-height: 100%;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.adm-text-area {
|
|
11
|
+
.adm-text-area-element {
|
|
12
12
|
font-family: var(--adm-font-family);
|
|
13
13
|
resize: none;
|
|
14
14
|
flex: auto;
|
|
@@ -29,35 +29,35 @@
|
|
|
29
29
|
min-height: 1.5em;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.adm-text-area::placeholder {
|
|
32
|
+
.adm-text-area-element::placeholder {
|
|
33
33
|
color: var(--placeholder-color);
|
|
34
34
|
font-family: inherit;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
.adm-text-area:-webkit-autofill {
|
|
37
|
+
.adm-text-area-element:-webkit-autofill {
|
|
38
38
|
background-color: transparent;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.adm-text-area:disabled {
|
|
41
|
+
.adm-text-area-element:disabled {
|
|
42
42
|
color: var(--disabled-color);
|
|
43
43
|
cursor: not-allowed;
|
|
44
44
|
opacity: 1;
|
|
45
45
|
-webkit-text-fill-color: var(--disabled-color);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.adm-text-area:read-only {
|
|
48
|
+
.adm-text-area-element:read-only {
|
|
49
49
|
cursor: default;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
.adm-text-area:invalid {
|
|
52
|
+
.adm-text-area-element:invalid {
|
|
53
53
|
box-shadow: none;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.adm-text-area::-ms-clear {
|
|
56
|
+
.adm-text-area-element::-ms-clear {
|
|
57
57
|
display: none;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.adm-text-area[readonly] {
|
|
60
|
+
.adm-text-area-element[readonly] {
|
|
61
61
|
pointer-events: none;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -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' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
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>, "disabled" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
4
3
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
5
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
5
|
const classPrefix = 'adm-text-area';
|
|
@@ -12,19 +11,11 @@ const defaultProps = {
|
|
|
12
11
|
};
|
|
13
12
|
export const TextArea = forwardRef((p, ref) => {
|
|
14
13
|
const props = mergeProps(defaultProps, p);
|
|
15
|
-
|
|
16
14
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onChange: outerOnChange,
|
|
22
|
-
rows: rows,
|
|
23
|
-
autoSize: autoSize,
|
|
24
|
-
showCount
|
|
25
|
-
} = props,
|
|
26
|
-
textAreaProps = __rest(props, ["className", "style", "defaultValue", "value", "onChange", "rows", "autoSize", "showCount"]);
|
|
27
|
-
|
|
15
|
+
autoSize,
|
|
16
|
+
showCount,
|
|
17
|
+
maxLength
|
|
18
|
+
} = props;
|
|
28
19
|
const [value, setValue] = usePropsValue(props);
|
|
29
20
|
const nativeTextAreaRef = useRef(null);
|
|
30
21
|
useImperativeHandle(ref, () => ({
|
|
@@ -64,39 +55,58 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
64
55
|
|
|
65
56
|
textArea.style.height = `${height}px`;
|
|
66
57
|
}, [value, autoSize]);
|
|
58
|
+
const compositingRef = useRef(false);
|
|
67
59
|
let count;
|
|
60
|
+
const valueLength = [...value].length;
|
|
68
61
|
|
|
69
62
|
if (typeof showCount === 'function') {
|
|
70
|
-
count = showCount(
|
|
63
|
+
count = showCount(valueLength, maxLength);
|
|
71
64
|
} else if (showCount) {
|
|
72
65
|
count = React.createElement("div", {
|
|
73
66
|
className: `${classPrefix}-count`
|
|
74
|
-
},
|
|
67
|
+
}, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
|
|
75
68
|
}
|
|
76
69
|
|
|
77
|
-
return React.createElement("div", {
|
|
78
|
-
className:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
className: classPrefix,
|
|
84
|
-
rows: rows,
|
|
70
|
+
return withNativeProps(props, React.createElement("div", {
|
|
71
|
+
className: classPrefix
|
|
72
|
+
}, React.createElement("textarea", {
|
|
73
|
+
ref: nativeTextAreaRef,
|
|
74
|
+
className: `${classPrefix}-element`,
|
|
75
|
+
rows: props.rows,
|
|
85
76
|
value: value,
|
|
77
|
+
placeholder: props.placeholder,
|
|
86
78
|
onChange: e => {
|
|
87
|
-
|
|
79
|
+
let v = e.target.value;
|
|
80
|
+
|
|
81
|
+
if (maxLength && !compositingRef.current) {
|
|
82
|
+
v = [...v].slice(0, maxLength).join('');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
setValue(v);
|
|
88
86
|
},
|
|
89
|
-
|
|
87
|
+
id: props.id,
|
|
88
|
+
onCompositionStart: e => {
|
|
90
89
|
var _a;
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
compositingRef.current = true;
|
|
92
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
93
93
|
},
|
|
94
|
-
|
|
94
|
+
onCompositionEnd: e => {
|
|
95
95
|
var _a;
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
compositingRef.current = false;
|
|
98
|
+
|
|
99
|
+
if (maxLength) {
|
|
100
|
+
setValue([...value].slice(0, maxLength).join(''));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
98
104
|
},
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
autoComplete: props.autoComplete,
|
|
106
|
+
disabled: props.disabled,
|
|
107
|
+
readOnly: props.readOnly,
|
|
108
|
+
onFocus: props.onFocus,
|
|
109
|
+
onBlur: props.onBlur
|
|
110
|
+
}), count));
|
|
101
111
|
});
|
|
102
112
|
TextArea.defaultProps = defaultProps;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { forwardRef, useEffect, useImperativeHandle,
|
|
1
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { CloseCircleFill } from 'antd-mobile-icons';
|
|
7
|
+
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
7
8
|
const classPrefix = 'adm-virtual-input';
|
|
8
9
|
const defaultProps = {
|
|
9
10
|
defaultValue: ''
|
|
@@ -28,7 +29,7 @@ export const VirtualInput = forwardRef((p, ref) => {
|
|
|
28
29
|
content.scrollLeft = content.clientWidth;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
useIsomorphicLayoutEffect(() => {
|
|
32
33
|
scrollToEnd();
|
|
33
34
|
}, [value]);
|
|
34
35
|
useEffect(() => {
|
|
@@ -4,7 +4,7 @@ const defaultRoot = canUseDom ? window : undefined;
|
|
|
4
4
|
|
|
5
5
|
function isElement(node) {
|
|
6
6
|
const ELEMENT_NODE_TYPE = 1;
|
|
7
|
-
return node.
|
|
7
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
8
8
|
} // https://github.com/youzan/vant/issues/3823
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
export function useRefState(initialState) {
|
|
3
3
|
const [state, setState] = useState(initialState);
|
|
4
4
|
const ref = useRef(state);
|
|
5
|
-
|
|
5
|
+
useEffect(() => {
|
|
6
6
|
ref.current = state;
|
|
7
7
|
}, [state]);
|
|
8
8
|
return [state, setState, ref];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemoizedFn } from 'ahooks';
|
|
1
|
+
import { useIsomorphicLayoutEffect, useMemoizedFn } from 'ahooks';
|
|
3
2
|
export function useResizeEffect(effect, targetRef) {
|
|
4
3
|
const fn = useMemoizedFn(effect);
|
|
5
|
-
|
|
4
|
+
useIsomorphicLayoutEffect(() => {
|
|
6
5
|
const target = targetRef.current;
|
|
7
6
|
if (!target) return;
|
|
8
7
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useLayoutEffect } from 'react';
|
|
2
1
|
import { useSpring } from '@react-spring/web';
|
|
3
2
|
import { useMutationEffect } from './use-mutation-effect';
|
|
4
3
|
import { bound } from './bound';
|
|
5
|
-
import { useUpdateLayoutEffect } from 'ahooks';
|
|
4
|
+
import { useIsomorphicLayoutEffect, useUpdateLayoutEffect } from 'ahooks';
|
|
6
5
|
export const useTabListScroll = (targetRef, activeIndex) => {
|
|
7
6
|
const [{
|
|
8
7
|
scrollLeft
|
|
@@ -37,7 +36,7 @@ export const useTabListScroll = (targetRef, activeIndex) => {
|
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
useIsomorphicLayoutEffect(() => {
|
|
41
40
|
animate(true);
|
|
42
41
|
}, []);
|
|
43
42
|
useUpdateLayoutEffect(() => {
|
package/2x/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.27",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@react-spring/web": "^9.4.
|
|
6
|
-
"@types/resize-observer-browser": "^0.1.
|
|
7
|
-
"@use-gesture/react": "^10.2.
|
|
8
|
-
"ahooks": "^3.1.
|
|
5
|
+
"@react-spring/web": "^9.4.3",
|
|
6
|
+
"@types/resize-observer-browser": "^0.1.7",
|
|
7
|
+
"@use-gesture/react": "^10.2.6",
|
|
8
|
+
"ahooks": "^3.1.9",
|
|
9
9
|
"antd-mobile-icons": "^0.2.2",
|
|
10
10
|
"antd-mobile-v5-count": "^1.0.1",
|
|
11
11
|
"classnames": "^2.3.1",
|
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*
|
|
1
|
+
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*8HtNS4uMKkAAAAAAAAAAAAAAARQnAQ" alt="logo" width="100%" />
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-

|
|
6
|
+

|
|
6
7
|

|
|
7
8
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Average time to resolve an issue')
|
|
8
9
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Percentage of issues still open')
|
|
@@ -21,17 +22,16 @@ $ yarn add antd-mobile@next
|
|
|
21
22
|
- **Atomic**: The function of each component, neither more nor less, is exactly what you need.
|
|
22
23
|
- **Fluent**: With smooth gestures and delicate animation, it helps the product create the ultimate experience.
|
|
23
24
|
|
|
24
|
-
v5(Poplar) is the next major version of antd-mobile, we recommend using it instead of v2.
|
|
25
|
-
|
|
26
25
|
You can also play with antd-mobile just in browser with [Codesandbox](https://codesandbox.io/s/antd-mobile-snrxr?file=/package.json). No need to prepare development environment.
|
|
27
26
|
|
|
28
27
|
If you found bugs or would like to request some new features, please consider opening an [issue](https://github.com/ant-design/ant-design-mobile/issues/new).
|
|
29
28
|
|
|
30
29
|
If you have some question about how to use ant-mobile, you can start a [discussion thread](https://github.com/ant-design/ant-design-mobile/discussions).
|
|
31
30
|
|
|
32
|
-
Feel free to join
|
|
31
|
+
And we also have some community groups here. Feel free to join us:
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
- [DingDing](https://gw.alipayobjects.com/mdn/rms_25513e/afts/img/A*hBjlR4nUWjkAAAAAAAAAAAAAARQnAQ)
|
|
34
|
+
- [Discord](https://discord.gg/jmNvw4WFYn)
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
display: inline-block;
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
height: auto;
|
|
15
|
-
padding:
|
|
15
|
+
padding: 7px 12px;
|
|
16
16
|
margin: 0;
|
|
17
|
-
font-size:
|
|
17
|
+
font-size: 17px;
|
|
18
18
|
line-height: 1.4;
|
|
19
19
|
text-align: center;
|
|
20
20
|
border: var(--border-width) var(--border-style) var(--border-color);
|
|
@@ -23,6 +23,8 @@ var _configProvider = require("../config-provider");
|
|
|
23
23
|
|
|
24
24
|
var _isoWeek = _interopRequireDefault(require("dayjs/plugin/isoWeek"));
|
|
25
25
|
|
|
26
|
+
var _ahooks = require("ahooks");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
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); }
|
|
@@ -91,7 +93,7 @@ const Calendar = p => {
|
|
|
91
93
|
}, [props.selectionMode, props.value, props.defaultValue]);
|
|
92
94
|
const [begin, setBegin] = (0, _react.useState)(null);
|
|
93
95
|
const [end, setEnd] = (0, _react.useState)(null);
|
|
94
|
-
(0,
|
|
96
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
95
97
|
setBegin(dateRange[0] ? (0, _dayjs.default)(dateRange[0]) : null);
|
|
96
98
|
setEnd(dateRange[1] ? (0, _dayjs.default)(dateRange[1]) : null);
|
|
97
99
|
}, [dateRange[0], dateRange[1]]);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { NativeProps } from '../../utils/native-props';
|
|
3
2
|
import type { PickerViewProps } from '../picker-view';
|
|
4
3
|
import type { CascadePickerOption } from '../cascade-picker';
|
|
5
4
|
export declare type CascadePickerViewProps = Omit<PickerViewProps, 'columns'> & {
|
|
6
5
|
options: CascadePickerOption[];
|
|
7
|
-
}
|
|
6
|
+
};
|
|
8
7
|
export declare const CascadePickerView: FC<CascadePickerViewProps>;
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { PickerProps } from '../picker';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
|
-
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation'> & {
|
|
5
|
+
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style'> & {
|
|
6
6
|
value?: Date | null;
|
|
7
7
|
defaultValue?: Date | null;
|
|
8
8
|
onSelect?: (value: Date) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { PickerViewProps } from '../picker-view';
|
|
2
3
|
import { NativeProps } from '../../utils/native-props';
|
|
3
4
|
import type { Precision, DatePickerFilter } from '../date-picker/date-picker-utils';
|
|
4
|
-
export declare type DatePickerViewProps = {
|
|
5
|
+
export declare type DatePickerViewProps = Pick<PickerViewProps, 'style'> & {
|
|
5
6
|
value?: Date;
|
|
6
7
|
defaultValue?: Date;
|
|
7
8
|
onChange?: (value: Date) => void;
|
|
@@ -10,5 +11,5 @@ export declare type DatePickerViewProps = {
|
|
|
10
11
|
precision?: Precision;
|
|
11
12
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
12
13
|
filter?: DatePickerFilter;
|
|
13
|
-
} & NativeProps
|
|
14
|
+
} & NativeProps;
|
|
14
15
|
export declare const DatePickerView: FC<DatePickerViewProps>;
|
|
@@ -43,9 +43,6 @@
|
|
|
43
43
|
.adm-dropdown-item-highlight {
|
|
44
44
|
color: var(--adm-color-primary);
|
|
45
45
|
}
|
|
46
|
-
.adm-dropdown-item-active {
|
|
47
|
-
color: var(--adm-color-primary);
|
|
48
|
-
}
|
|
49
46
|
.adm-dropdown-item-active .adm-dropdown-item-title:after {
|
|
50
47
|
margin-top: -1px;
|
|
51
48
|
transform: rotate(135deg);
|
|
@@ -20,9 +20,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
const classPrefix = `adm-dropdown-item`;
|
|
21
21
|
|
|
22
22
|
const Item = props => {
|
|
23
|
+
var _a;
|
|
24
|
+
|
|
23
25
|
const cls = (0, _classnames.default)(classPrefix, {
|
|
24
26
|
[`${classPrefix}-active`]: props.active,
|
|
25
|
-
[`${classPrefix}-highlight`]: props.highlight
|
|
27
|
+
[`${classPrefix}-highlight`]: (_a = props.highlight) !== null && _a !== void 0 ? _a : props.active
|
|
26
28
|
});
|
|
27
29
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
28
30
|
className: cls,
|
|
@@ -13,6 +13,8 @@ var _nativeProps = require("../../utils/native-props");
|
|
|
13
13
|
|
|
14
14
|
var _useResizeEffect = require("../../utils/use-resize-effect");
|
|
15
15
|
|
|
16
|
+
var _ahooks = require("ahooks");
|
|
17
|
+
|
|
16
18
|
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); }
|
|
17
19
|
|
|
18
20
|
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; }
|
|
@@ -129,7 +131,7 @@ const Ellipsis = p => {
|
|
|
129
131
|
}
|
|
130
132
|
|
|
131
133
|
(0, _useResizeEffect.useResizeEffect)(calcEllipsised, rootRef);
|
|
132
|
-
(0,
|
|
134
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
133
135
|
calcEllipsised();
|
|
134
136
|
}, [props.content, props.direction, props.rows, props.expandText, props.collapseText]);
|
|
135
137
|
const expandActionElement = exceeded && props.expandText ? _react.default.createElement("a", {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
export declare type FloatingPanelProps = {
|
|
4
|
-
anchors: number[];
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
onHeightChange?: (height: number, animating: boolean) => void;
|
|
7
|
-
} & NativeProps<'--border-radius' | '--z-index'>;
|
|
8
3
|
export declare type FloatingPanelRef = {
|
|
9
4
|
setHeight: (height: number, options?: {
|
|
10
5
|
immediate?: boolean;
|
|
11
6
|
}) => void;
|
|
12
7
|
};
|
|
8
|
+
export declare type FloatingPanelProps = {
|
|
9
|
+
anchors: number[];
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
onHeightChange?: (height: number, animating: boolean) => void;
|
|
12
|
+
handleDraggingOfContent?: boolean;
|
|
13
|
+
} & NativeProps<'--border-radius' | '--z-index'>;
|
|
13
14
|
export declare const FloatingPanel: React.ForwardRefExoticComponent<{
|
|
14
15
|
anchors: number[];
|
|
15
16
|
children: ReactNode;
|
|
16
17
|
onHeightChange?: ((height: number, animating: boolean) => void) | undefined;
|
|
18
|
+
handleDraggingOfContent?: boolean | undefined;
|
|
17
19
|
} & NativeProps<"--z-index" | "--border-radius"> & React.RefAttributes<FloatingPanelRef>>;
|
|
@@ -17,13 +17,21 @@ var _supportsPassive = require("../../utils/supports-passive");
|
|
|
17
17
|
|
|
18
18
|
var _nearest = require("../../utils/nearest");
|
|
19
19
|
|
|
20
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
21
|
+
|
|
22
|
+
var _useLockScroll = require("../../utils/use-lock-scroll");
|
|
23
|
+
|
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
25
|
|
|
22
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
27
|
|
|
24
|
-
const
|
|
28
|
+
const defaultProps = {
|
|
29
|
+
handleDraggingOfContent: true
|
|
30
|
+
};
|
|
31
|
+
const FloatingPanel = (0, _react.forwardRef)((p, ref) => {
|
|
25
32
|
var _a;
|
|
26
33
|
|
|
34
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
27
35
|
const {
|
|
28
36
|
anchors
|
|
29
37
|
} = props;
|
|
@@ -61,6 +69,7 @@ const FloatingPanel = (0, _react.forwardRef)((props, ref) => {
|
|
|
61
69
|
if (header === target || (header === null || header === void 0 ? void 0 : header.contains(target))) {
|
|
62
70
|
pullingRef.current = true;
|
|
63
71
|
} else {
|
|
72
|
+
if (!props.handleDraggingOfContent) return;
|
|
64
73
|
const reachedTop = y.goal <= bounds.top;
|
|
65
74
|
const content = contentRef.current;
|
|
66
75
|
if (!content) return;
|
|
@@ -118,6 +127,7 @@ const FloatingPanel = (0, _react.forwardRef)((props, ref) => {
|
|
|
118
127
|
});
|
|
119
128
|
}
|
|
120
129
|
}), [api]);
|
|
130
|
+
(0, _useLockScroll.useLockScroll)(elementRef, true);
|
|
121
131
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_web.animated.div, {
|
|
122
132
|
ref: elementRef,
|
|
123
133
|
className: 'adm-floating-panel',
|
|
@@ -11,22 +11,21 @@
|
|
|
11
11
|
.adm-form-item-label-required {
|
|
12
12
|
position: absolute;
|
|
13
13
|
left: -0.6em;
|
|
14
|
-
top: 0
|
|
14
|
+
top: 0;
|
|
15
|
+
font-family: SimSun, sans-serif;
|
|
15
16
|
color: var(--adm-color-danger);
|
|
16
17
|
user-select: none;
|
|
17
18
|
}
|
|
18
19
|
.adm-form-item-footer {
|
|
19
20
|
color: var(--adm-color-danger);
|
|
21
|
+
margin-top: 4px;
|
|
20
22
|
}
|
|
21
23
|
.adm-form-item.adm-form-item-hidden {
|
|
22
24
|
display: none;
|
|
23
25
|
}
|
|
24
26
|
.adm-form-vertical .adm-form-item-label {
|
|
25
|
-
margin-bottom: 4px;
|
|
26
27
|
font-size: 15px;
|
|
27
|
-
|
|
28
|
-
.adm-form-vertical .adm-form-item-footer {
|
|
29
|
-
margin-top: 4px;
|
|
28
|
+
margin-bottom: 4px;
|
|
30
29
|
}
|
|
31
30
|
.adm-form-horizontal .adm-list-item-content-prefix {
|
|
32
31
|
padding-top: 12px;
|