antd-mobile 5.0.0-rc.24 → 5.0.0-rc.28
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 +1 -1
- package/2x/cjs/components/button/button.css +2 -2
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +8 -1
- package/2x/cjs/components/checkbox/checkbox.js +12 -12
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- 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 +17 -10
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +17 -8
- package/2x/cjs/components/form/form.css +0 -9
- package/2x/cjs/components/form/form.js +1 -1
- package/2x/cjs/components/form/index.css +17 -19
- package/2x/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +2 -2
- 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.css +1 -0
- package/2x/cjs/components/input/input.d.ts +6 -2
- package/2x/cjs/components/input/input.js +20 -2
- package/2x/cjs/components/list/list.css +6 -4
- package/2x/cjs/components/picker/picker.d.ts +1 -0
- package/2x/cjs/components/picker/picker.js +3 -1
- package/2x/cjs/components/picker-view/wheel.js +4 -2
- package/2x/cjs/components/popover/index.d.ts +4 -6
- package/2x/cjs/components/popover/popover-menu.d.ts +9 -12
- package/2x/cjs/components/progress-bar/progress-bar.css +1 -1
- package/2x/cjs/components/progress-circle/progress-circle.css +4 -4
- package/2x/cjs/components/progress-circle/progress-circle.js +1 -2
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +7 -1
- package/2x/cjs/components/radio/radio.js +16 -3
- package/2x/cjs/components/rate/rate.css +2 -1
- package/2x/cjs/components/rate/rate.d.ts +1 -1
- 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/slider/slider.css +12 -7
- package/2x/cjs/components/slider/thumb-icon.d.ts +3 -0
- package/2x/cjs/components/slider/thumb-icon.js +38 -0
- package/2x/cjs/components/slider/thumb.js +5 -1
- package/2x/cjs/components/swiper/swiper.js +1 -1
- package/2x/cjs/components/tabs/tabs.js +5 -5
- package/2x/cjs/components/text-area/text-area.js +11 -1
- 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/is-dev.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.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +8 -2
- package/2x/es/components/checkbox/checkbox.js +11 -12
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- 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 +17 -10
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +15 -6
- package/2x/es/components/form/form.css +0 -9
- package/2x/es/components/form/form.js +1 -1
- package/2x/es/components/form/index.css +17 -19
- package/2x/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +4 -4
- 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.css +1 -0
- package/2x/es/components/input/input.d.ts +6 -2
- package/2x/es/components/input/input.js +19 -3
- package/2x/es/components/list/list.css +6 -4
- package/2x/es/components/picker/picker.d.ts +1 -0
- package/2x/es/components/picker/picker.js +3 -1
- package/2x/es/components/picker-view/wheel.js +4 -3
- package/2x/es/components/popover/index.d.ts +4 -6
- package/2x/es/components/popover/popover-menu.d.ts +9 -12
- package/2x/es/components/progress-bar/progress-bar.css +1 -1
- package/2x/es/components/progress-circle/progress-circle.css +4 -4
- package/2x/es/components/progress-circle/progress-circle.js +1 -2
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +8 -2
- package/2x/es/components/radio/radio.js +14 -3
- package/2x/es/components/rate/rate.css +2 -1
- package/2x/es/components/rate/rate.d.ts +1 -1
- 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/slider/slider.css +12 -7
- package/2x/es/components/slider/thumb-icon.d.ts +3 -0
- package/2x/es/components/slider/thumb-icon.js +25 -0
- package/2x/es/components/slider/thumb.js +4 -1
- package/2x/es/components/swiper/swiper.js +3 -3
- package/2x/es/components/tabs/tabs.js +7 -7
- package/2x/es/components/text-area/text-area.js +10 -1
- 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/is-dev.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 +7 -6
- package/README.md +1 -1
- package/cjs/components/button/button.css +2 -2
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +8 -1
- package/cjs/components/checkbox/checkbox.js +12 -12
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- 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 +15 -9
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +17 -8
- package/cjs/components/form/form.css +0 -7
- package/cjs/components/form/form.js +1 -1
- package/cjs/components/form/index.css +15 -16
- package/cjs/components/image-uploader/image-uploader.d.ts +1 -1
- package/cjs/components/image-uploader/image-uploader.js +2 -2
- 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.css +1 -0
- package/cjs/components/input/input.d.ts +6 -2
- package/cjs/components/input/input.js +20 -2
- package/cjs/components/list/list.css +5 -4
- package/cjs/components/picker/picker.d.ts +1 -0
- package/cjs/components/picker/picker.js +3 -1
- package/cjs/components/picker-view/wheel.js +4 -2
- package/cjs/components/popover/index.d.ts +4 -6
- package/cjs/components/popover/popover-menu.d.ts +9 -12
- package/cjs/components/progress-bar/progress-bar.css +1 -1
- package/cjs/components/progress-circle/progress-circle.css +4 -4
- package/cjs/components/progress-circle/progress-circle.js +1 -2
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +7 -1
- package/cjs/components/radio/radio.js +16 -3
- package/cjs/components/rate/rate.css +2 -1
- package/cjs/components/rate/rate.d.ts +1 -1
- 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/slider/slider.css +11 -7
- package/cjs/components/slider/thumb-icon.d.ts +3 -0
- package/cjs/components/slider/thumb-icon.js +38 -0
- package/cjs/components/slider/thumb.js +5 -1
- package/cjs/components/swiper/swiper.js +1 -1
- package/cjs/components/tabs/tabs.js +5 -5
- package/cjs/components/text-area/text-area.js +11 -1
- package/cjs/components/virtual-input/virtual-input.js +3 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/cjs/utils/is-dev.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.d.ts +1 -0
- package/es/components/calendar/calendar.js +8 -2
- package/es/components/checkbox/checkbox.js +11 -12
- package/es/components/date-picker/date-picker.d.ts +1 -1
- 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 +15 -9
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +15 -6
- package/es/components/form/form.css +0 -7
- package/es/components/form/form.js +1 -1
- package/es/components/form/index.css +15 -16
- package/es/components/image-uploader/image-uploader.d.ts +1 -1
- package/es/components/image-uploader/image-uploader.js +4 -4
- 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.css +1 -0
- package/es/components/input/input.d.ts +6 -2
- package/es/components/input/input.js +19 -3
- package/es/components/list/list.css +5 -4
- package/es/components/picker/picker.d.ts +1 -0
- package/es/components/picker/picker.js +3 -1
- package/es/components/picker-view/wheel.js +4 -3
- package/es/components/popover/index.d.ts +4 -6
- package/es/components/popover/popover-menu.d.ts +9 -12
- package/es/components/progress-bar/progress-bar.css +1 -1
- package/es/components/progress-circle/progress-circle.css +4 -4
- package/es/components/progress-circle/progress-circle.js +1 -2
- package/es/components/pull-to-refresh/pull-to-refresh.js +8 -2
- package/es/components/radio/radio.js +14 -3
- package/es/components/rate/rate.css +2 -1
- package/es/components/rate/rate.d.ts +1 -1
- 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/slider/slider.css +11 -7
- package/es/components/slider/thumb-icon.d.ts +3 -0
- package/es/components/slider/thumb-icon.js +25 -0
- package/es/components/slider/thumb.js +4 -1
- package/es/components/swiper/swiper.js +3 -3
- package/es/components/tabs/tabs.js +7 -7
- package/es/components/text-area/text-area.js +10 -1
- package/es/components/virtual-input/virtual-input.js +3 -2
- package/es/utils/get-scroll-parent.js +1 -1
- package/es/utils/is-dev.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 +7 -6
- package/umd/antd-mobile.js +1 -1
- package/2x/assets/slider-thumb.svg +0 -14
- package/2x/cjs/assets/slider-thumb.svg +0 -14
- package/2x/es/assets/slider-thumb.svg +0 -14
- package/assets/slider-thumb.svg +0 -14
- package/cjs/assets/slider-thumb.svg +0 -14
- package/es/assets/slider-thumb.svg +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
4
|
-
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | '
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
onChange?: (val: string) => void;
|
|
@@ -13,13 +13,15 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
13
13
|
id?: string;
|
|
14
14
|
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
15
15
|
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
16
18
|
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'>;
|
|
17
19
|
export declare type InputRef = {
|
|
18
20
|
clear: () => void;
|
|
19
21
|
focus: () => void;
|
|
20
22
|
blur: () => void;
|
|
21
23
|
};
|
|
22
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "
|
|
24
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
23
25
|
value?: string | undefined;
|
|
24
26
|
defaultValue?: string | undefined;
|
|
25
27
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -31,5 +33,7 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedH
|
|
|
31
33
|
id?: string | undefined;
|
|
32
34
|
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
33
35
|
enterKeyHint?: "enter" | "search" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
36
|
+
min?: number | undefined;
|
|
37
|
+
max?: number | undefined;
|
|
34
38
|
} & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>;
|
|
35
39
|
export {};
|
|
@@ -17,6 +17,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
17
17
|
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
|
|
20
|
+
var _ahooks = require("ahooks");
|
|
21
|
+
|
|
22
|
+
var _bound = require("../../utils/bound");
|
|
23
|
+
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
22
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); }
|
|
@@ -58,7 +62,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
58
62
|
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
59
63
|
};
|
|
60
64
|
|
|
61
|
-
(0,
|
|
65
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
62
66
|
var _a;
|
|
63
67
|
|
|
64
68
|
if (!props.enterKeyHint) return;
|
|
@@ -69,6 +73,19 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
69
73
|
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.removeAttribute('enterkeyhint');
|
|
70
74
|
};
|
|
71
75
|
}, [props.enterKeyHint]);
|
|
76
|
+
|
|
77
|
+
function checkValue() {
|
|
78
|
+
let nextValue = value;
|
|
79
|
+
|
|
80
|
+
if (props.type === 'number') {
|
|
81
|
+
nextValue = (0, _bound.bound)(parseFloat(nextValue), props.min, props.max).toString();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (nextValue !== value) {
|
|
85
|
+
setValue(nextValue);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
72
89
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
73
90
|
className: (0, _classnames.default)(`${classPrefix}`, props.disabled && `${classPrefix}-disabled`)
|
|
74
91
|
}, _react.default.createElement("input", {
|
|
@@ -88,6 +105,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
88
105
|
var _a;
|
|
89
106
|
|
|
90
107
|
setHasFocus(false);
|
|
108
|
+
checkValue();
|
|
91
109
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
92
110
|
},
|
|
93
111
|
id: props.id,
|
|
@@ -108,7 +126,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
108
126
|
onKeyUp: props.onKeyUp,
|
|
109
127
|
onCompositionStart: props.onCompositionStart,
|
|
110
128
|
onCompositionEnd: props.onCompositionEnd
|
|
111
|
-
}), props.clearable && !!value && _react.default.createElement("div", {
|
|
129
|
+
}), props.clearable && !!value && !props.readOnly && _react.default.createElement("div", {
|
|
112
130
|
className: `${classPrefix}-clear`,
|
|
113
131
|
onMouseDown: e => {
|
|
114
132
|
e.preventDefault();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.adm-list {
|
|
2
|
-
--header-font-size:
|
|
2
|
+
--header-font-size: 30px;
|
|
3
3
|
--prefix-width: 'auto';
|
|
4
4
|
--prefix-padding-right: 24px;
|
|
5
5
|
--align-items: center;
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
.adm-list-header {
|
|
16
16
|
color: var(--adm-color-weak);
|
|
17
17
|
font-size: var(--header-font-size);
|
|
18
|
-
padding
|
|
19
|
-
padding-right: var(--padding-right);
|
|
20
|
-
margin: 32px 0 8px;
|
|
18
|
+
padding: 16px var(--padding-right) 16px var(--padding-left);
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
.adm-list-body {
|
|
@@ -43,6 +41,10 @@
|
|
|
43
41
|
border-radius: 16px;
|
|
44
42
|
}
|
|
45
43
|
|
|
44
|
+
.adm-list-card .adm-list-header {
|
|
45
|
+
padding-left: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
46
48
|
.adm-list-item {
|
|
47
49
|
display: block;
|
|
48
50
|
padding-left: var(--padding-left);
|
|
@@ -10,6 +10,7 @@ export declare type PickerProps = {
|
|
|
10
10
|
onConfirm?: (value: PickerValue[], extend: PickerValueExtend) => void;
|
|
11
11
|
onCancel?: () => void;
|
|
12
12
|
onClose?: () => void;
|
|
13
|
+
closeOnMaskClick?: boolean;
|
|
13
14
|
visible?: boolean;
|
|
14
15
|
title?: ReactNode;
|
|
15
16
|
confirmText?: ReactNode;
|
|
@@ -35,7 +35,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
35
35
|
|
|
36
36
|
const classPrefix = `adm-picker`;
|
|
37
37
|
const defaultProps = {
|
|
38
|
-
defaultValue: []
|
|
38
|
+
defaultValue: [],
|
|
39
|
+
closeOnMaskClick: true
|
|
39
40
|
};
|
|
40
41
|
const Picker = (0, _react.memo)(p => {
|
|
41
42
|
var _a;
|
|
@@ -114,6 +115,7 @@ const Picker = (0, _react.memo)(p => {
|
|
|
114
115
|
onMaskClick: () => {
|
|
115
116
|
var _a, _b;
|
|
116
117
|
|
|
118
|
+
if (!props.closeOnMaskClick) return;
|
|
117
119
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
118
120
|
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
119
121
|
},
|
|
@@ -19,6 +19,8 @@ var _bound = require("../../utils/bound");
|
|
|
19
19
|
|
|
20
20
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
21
21
|
|
|
22
|
+
var _ahooks = require("ahooks");
|
|
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); }
|
|
@@ -49,7 +51,7 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
49
51
|
}
|
|
50
52
|
}));
|
|
51
53
|
const draggingRef = (0, _react.useRef)(false);
|
|
52
|
-
(0,
|
|
54
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
53
55
|
if (draggingRef.current) return;
|
|
54
56
|
if (!value) return;
|
|
55
57
|
const targetIndex = column.findIndex(item => item.value === value);
|
|
@@ -60,7 +62,7 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
60
62
|
immediate: y.goal !== finalPosition
|
|
61
63
|
});
|
|
62
64
|
}, [value, column]);
|
|
63
|
-
(0,
|
|
65
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
64
66
|
if (column.length === 0) {
|
|
65
67
|
if (value !== null) {
|
|
66
68
|
onSelect(null);
|
|
@@ -13,11 +13,9 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
13
13
|
stopPropagation?: "click"[] | undefined;
|
|
14
14
|
content: import("react").ReactNode;
|
|
15
15
|
} & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "align" | "defaultVisible" | "onVisibleChange"> & import("../../utils/native-props").NativeProps<"--z-index"> & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
16
|
-
Menu:
|
|
17
|
-
actions:
|
|
18
|
-
onAction?: ((
|
|
19
|
-
} &
|
|
20
|
-
ref?: ((instance: import("./popover").PopoverRef | null) => void) | import("react").RefObject<import("./popover").PopoverRef> | null | undefined;
|
|
21
|
-
}) => import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
16
|
+
Menu: import("react").ForwardRefExoticComponent<Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
|
|
17
|
+
actions: import("./popover-menu").Action[];
|
|
18
|
+
onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
|
|
19
|
+
} & import("react").RefAttributes<import("./popover").PopoverRef>>;
|
|
22
20
|
};
|
|
23
21
|
export default _default;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { PopoverProps, PopoverRef } from './popover';
|
|
3
3
|
export declare type Action = {
|
|
4
4
|
text: React.ReactNode;
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
key?: string;
|
|
7
|
+
key?: string | number;
|
|
8
8
|
onClick?: () => void;
|
|
9
|
-
[key: string]: any;
|
|
10
9
|
};
|
|
11
|
-
export declare type PopoverMenuProps
|
|
12
|
-
actions:
|
|
13
|
-
onAction?: (
|
|
10
|
+
export declare type PopoverMenuProps = Omit<PopoverProps, 'content'> & {
|
|
11
|
+
actions: Action[];
|
|
12
|
+
onAction?: (item: Action) => void;
|
|
14
13
|
};
|
|
15
|
-
export declare const PopoverMenu: <
|
|
16
|
-
actions:
|
|
17
|
-
onAction?: ((
|
|
18
|
-
} &
|
|
19
|
-
ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
|
|
20
|
-
}) => ReactElement;
|
|
14
|
+
export declare const PopoverMenu: React.ForwardRefExoticComponent<Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "defaultVisible" | "onVisibleChange" | "trigger" | "placement" | "destroyOnHide"> & {
|
|
15
|
+
actions: Action[];
|
|
16
|
+
onAction?: ((item: Action) => void) | undefined;
|
|
17
|
+
} & React.RefAttributes<PopoverRef>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
2
|
--track-width: var(--adm-progress-bar-track-width, 6px);
|
|
3
3
|
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
4
|
-
--fill-color: var(--adm-progress-bar-fill-color,
|
|
4
|
+
--fill-color: var(--adm-progress-bar-fill-color, var(--adm-color-primary));
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.adm-progress-bar-trail {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*进度圈*/
|
|
2
2
|
|
|
3
3
|
.adm-progress-circle {
|
|
4
|
-
--track-width: 6px;
|
|
5
|
-
--size: 100px;
|
|
6
|
-
--track-color: #e5e5e5;
|
|
7
|
-
--fill-color:
|
|
4
|
+
--track-width: var(--adm-progress-circle-track-width, 6px);
|
|
5
|
+
--size: var(--adm-progress-circle-size, 100px);
|
|
6
|
+
--track-color: var(--adm-progress-circle-track-color, #e5e5e5);
|
|
7
|
+
--fill-color: var(--adm-progress-circle-fill-color, var(--adm-color-primary));
|
|
8
8
|
--percent: 0;
|
|
9
9
|
--pi: 3.14159265;
|
|
10
10
|
--radius: calc(var(--size) / 2 - var(--track-width) / 2);
|
|
@@ -59,7 +59,13 @@ const PullToRefresh = p => {
|
|
|
59
59
|
}
|
|
60
60
|
}));
|
|
61
61
|
const elementRef = (0, _react2.useRef)(null);
|
|
62
|
-
const pullingRef = (0, _react2.useRef)(false);
|
|
62
|
+
const pullingRef = (0, _react2.useRef)(false); //防止下拉时抖动
|
|
63
|
+
|
|
64
|
+
(0, _react2.useEffect)(() => {
|
|
65
|
+
var _a;
|
|
66
|
+
|
|
67
|
+
(_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('touchmove', () => {});
|
|
68
|
+
}, []);
|
|
63
69
|
|
|
64
70
|
function doRefresh() {
|
|
65
71
|
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
@@ -19,6 +19,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
19
19
|
|
|
20
20
|
var _checkIcon = require("../checkbox/check-icon");
|
|
21
21
|
|
|
22
|
+
var _devLog = require("../../utils/dev-log");
|
|
23
|
+
|
|
24
|
+
var _isDev = require("../../utils/is-dev");
|
|
25
|
+
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
27
|
|
|
24
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); }
|
|
@@ -44,6 +48,16 @@ const Radio = p => {
|
|
|
44
48
|
} = props;
|
|
45
49
|
|
|
46
50
|
if (groupContext && value !== undefined) {
|
|
51
|
+
if (_isDev.isDev) {
|
|
52
|
+
if (p.checked !== undefined) {
|
|
53
|
+
(0, _devLog.devWarning)('Radio', 'When used within `Radio.Group`, the `checked` prop of `Radio` will not work.');
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (p.defaultChecked !== undefined) {
|
|
57
|
+
(0, _devLog.devWarning)('Radio', 'When used within `Radio.Group`, the `defaultChecked` prop of `Radio` will not work.');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
47
61
|
checked = groupContext.value.includes(value);
|
|
48
62
|
|
|
49
63
|
setChecked = checked => {
|
|
@@ -74,12 +88,11 @@ const Radio = p => {
|
|
|
74
88
|
};
|
|
75
89
|
|
|
76
90
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
77
|
-
className: (0, _classnames.default)(classPrefix,
|
|
91
|
+
className: (0, _classnames.default)(classPrefix, {
|
|
78
92
|
[`${classPrefix}-checked`]: checked,
|
|
79
93
|
[`${classPrefix}-disabled`]: disabled,
|
|
80
94
|
[`${classPrefix}-block`]: props.block
|
|
81
|
-
})
|
|
82
|
-
style: props.style
|
|
95
|
+
})
|
|
83
96
|
}, _react.default.createElement("input", {
|
|
84
97
|
type: 'radio',
|
|
85
98
|
checked: checked,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
.adm-rate {
|
|
2
2
|
--star-size: 48px;
|
|
3
3
|
--active-color: #ffd21e;
|
|
4
|
+
--inactive-color: var(--adm-color-light);
|
|
4
5
|
display: inline-flex;
|
|
5
6
|
}
|
|
6
7
|
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
padding: calc(var(--star-size) / 8);
|
|
13
14
|
line-height: var(--star-size);
|
|
14
15
|
font-size: var(--star-size);
|
|
15
|
-
color: var(--
|
|
16
|
+
color: var(--inactive-color);
|
|
16
17
|
text-align: center;
|
|
17
18
|
overflow: hidden;
|
|
18
19
|
cursor: pointer;
|
|
@@ -9,5 +9,5 @@ export declare type RateProps = {
|
|
|
9
9
|
readOnly?: boolean;
|
|
10
10
|
value?: number;
|
|
11
11
|
onChange?: (value: number) => void;
|
|
12
|
-
} & NativeProps<'--star-size' | '--active-color'>;
|
|
12
|
+
} & NativeProps<'--star-size' | '--active-color' | '--inactive-color'>;
|
|
13
13
|
export declare const Rate: FC<RateProps>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
.adm-selector {
|
|
2
|
-
--color:
|
|
2
|
+
--color: #f5f5f5;
|
|
3
3
|
--checked-color: #e7f1ff;
|
|
4
|
+
--text-color: var(--adm-color-text);
|
|
5
|
+
--checked-text-color: var(--adm-color-primary);
|
|
6
|
+
--border: none;
|
|
7
|
+
--checked-border: none;
|
|
8
|
+
--border-radius: 4px;
|
|
9
|
+
--padding: 16px 32px;
|
|
4
10
|
overflow: hidden;
|
|
5
11
|
font-size: 30px;
|
|
6
12
|
line-height: 1.4;
|
|
@@ -11,11 +17,12 @@
|
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
.adm-selector-item {
|
|
14
|
-
padding:
|
|
20
|
+
padding: var(--padding);
|
|
15
21
|
position: relative;
|
|
16
|
-
background-color:
|
|
17
|
-
border
|
|
18
|
-
|
|
22
|
+
background-color: var(--color);
|
|
23
|
+
border: var(--border);
|
|
24
|
+
border-radius: var(--border-radius);
|
|
25
|
+
color: var(--text-color);
|
|
19
26
|
opacity: 1;
|
|
20
27
|
cursor: pointer;
|
|
21
28
|
display: inline-block;
|
|
@@ -31,8 +38,9 @@
|
|
|
31
38
|
|
|
32
39
|
.adm-selector-item-active,
|
|
33
40
|
.adm-selector-item-multiple-active {
|
|
34
|
-
color: var(--
|
|
41
|
+
color: var(--checked-text-color);
|
|
35
42
|
background-color: var(--checked-color);
|
|
43
|
+
border: var(--checked-border);
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
.adm-selector-item .adm-selector-check-mark-wrapper {
|
|
@@ -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>)>;
|
|
@@ -28,7 +28,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
28
28
|
const classPrefix = `adm-selector`;
|
|
29
29
|
const defaultProps = {
|
|
30
30
|
multiple: false,
|
|
31
|
-
defaultValue: []
|
|
31
|
+
defaultValue: [],
|
|
32
|
+
showCheckMark: true
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const Selector = p => {
|
|
@@ -74,7 +75,7 @@ const Selector = p => {
|
|
|
74
75
|
}
|
|
75
76
|
}, option.label, option.description && _react.default.createElement("div", {
|
|
76
77
|
className: `${classPrefix}-item-description`
|
|
77
|
-
}, option.description), active && _react.default.createElement("div", {
|
|
78
|
+
}, option.description), active && props.showCheckMark && _react.default.createElement("div", {
|
|
78
79
|
className: `${classPrefix}-check-mark-wrapper`
|
|
79
80
|
}, _react.default.createElement(_checkMark.CheckMark, null)));
|
|
80
81
|
});
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
.adm-slider-fill {
|
|
20
20
|
position: absolute;
|
|
21
|
+
z-index: 1;
|
|
21
22
|
height: 8px;
|
|
22
23
|
background-color: var(--fill-color);
|
|
23
24
|
}
|
|
@@ -44,16 +45,11 @@
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.adm-slider-thumb {
|
|
47
|
-
touch-action: none;
|
|
48
|
-
position: absolute;
|
|
49
48
|
width: 44px;
|
|
50
49
|
height: 44px;
|
|
50
|
+
margin: 10px;
|
|
51
51
|
border-radius: 50%;
|
|
52
|
-
|
|
53
|
-
top: 50%;
|
|
54
|
-
transform: translate(-50%, -50%);
|
|
55
|
-
background: #fff url('../../assets/slider-thumb.svg') no-repeat center center;
|
|
56
|
-
background-size: 20px 20px;
|
|
52
|
+
background: var(--adm-color-white);
|
|
57
53
|
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.12), 0 3px 6px -4px rgba(0, 0, 0, 0.25);
|
|
58
54
|
}
|
|
59
55
|
|
|
@@ -61,9 +57,18 @@
|
|
|
61
57
|
outline: none;
|
|
62
58
|
}
|
|
63
59
|
|
|
60
|
+
.adm-slider-thumb-icon {
|
|
61
|
+
width: 20px;
|
|
62
|
+
height: 20px;
|
|
63
|
+
margin: 12px;
|
|
64
|
+
user-select: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
64
67
|
.adm-slider-thumb-container {
|
|
68
|
+
cursor: grab;
|
|
65
69
|
touch-action: none;
|
|
66
70
|
position: absolute;
|
|
71
|
+
z-index: 2;
|
|
67
72
|
width: 64px;
|
|
68
73
|
height: 64px;
|
|
69
74
|
border-radius: 50%;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ThumbIcon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
const ThumbIcon = props => {
|
|
15
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
16
|
+
viewBox: '0 0 20 20'
|
|
17
|
+
}, _react.default.createElement("g", {
|
|
18
|
+
stroke: 'none',
|
|
19
|
+
strokeWidth: '1',
|
|
20
|
+
fill: 'none',
|
|
21
|
+
fillRule: 'evenodd'
|
|
22
|
+
}, _react.default.createElement("g", {
|
|
23
|
+
transform: 'translate(-604.000000, -656.000000)',
|
|
24
|
+
fill: '#999999'
|
|
25
|
+
}, _react.default.createElement("g", {
|
|
26
|
+
transform: 'translate(592.000000, 644.000000)'
|
|
27
|
+
}, _react.default.createElement("g", {
|
|
28
|
+
transform: 'translate(12.000000, 12.000000)'
|
|
29
|
+
}, _react.default.createElement("polygon", {
|
|
30
|
+
points: '0 3.33333333 2.22222222 3.33333333 2.22222222 17.7777778 0 17.7777778'
|
|
31
|
+
}), _react.default.createElement("polygon", {
|
|
32
|
+
points: '17.7777778 3.33333333 20 3.33333333 20 17.7777778 17.7777778 17.7777778'
|
|
33
|
+
}), _react.default.createElement("path", {
|
|
34
|
+
d: 'M10.8888889,0 L9.11111111,0 C8.98888889,0 8.88888889,0.107142857 8.88888889,0.238095238 L8.88888889,19.7619048 C8.88888889,19.8928571 8.98888889,20 9.11111111,20 L10.8888889,20 C11.0111111,20 11.1111111,19.8928571 11.1111111,19.7619048 L11.1111111,0.238095238 C11.1111111,0.107142857 11.0111111,0 10.8888889,0 Z'
|
|
35
|
+
})))))));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.ThumbIcon = ThumbIcon;
|
|
@@ -9,6 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _react2 = require("@use-gesture/react");
|
|
11
11
|
|
|
12
|
+
var _thumbIcon = require("./thumb-icon");
|
|
13
|
+
|
|
12
14
|
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); }
|
|
13
15
|
|
|
14
16
|
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; }
|
|
@@ -57,7 +59,9 @@ const Thumb = props => {
|
|
|
57
59
|
style: currentPosition()
|
|
58
60
|
}, bind()), _react.default.createElement("div", {
|
|
59
61
|
className: `${classPrefix}-thumb`
|
|
60
|
-
}
|
|
62
|
+
}, _react.default.createElement(_thumbIcon.ThumbIcon, {
|
|
63
|
+
className: `${classPrefix}-thumb-icon`
|
|
64
|
+
})));
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
var _default = Thumb;
|
|
@@ -212,7 +212,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
212
212
|
swipeNext,
|
|
213
213
|
swipePrev
|
|
214
214
|
}));
|
|
215
|
-
(0,
|
|
215
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
216
216
|
const maxIndex = validChildren.length - 1;
|
|
217
217
|
|
|
218
218
|
if (current > maxIndex) {
|
|
@@ -163,17 +163,17 @@ const Tabs = p => {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
(0,
|
|
167
|
-
animate(
|
|
166
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
167
|
+
animate(!x.isAnimating);
|
|
168
168
|
}, []);
|
|
169
169
|
(0, _ahooks.useUpdateLayoutEffect)(() => {
|
|
170
170
|
animate();
|
|
171
171
|
}, [activeKey]);
|
|
172
172
|
(0, _useResizeEffect.useResizeEffect)(() => {
|
|
173
|
-
animate(
|
|
173
|
+
animate(!x.isAnimating);
|
|
174
174
|
}, tabListContainerRef);
|
|
175
175
|
(0, _useMutationEffect.useMutationEffect)(() => {
|
|
176
|
-
animate(
|
|
176
|
+
animate(!x.isAnimating);
|
|
177
177
|
}, tabListContainerRef, {
|
|
178
178
|
subtree: true,
|
|
179
179
|
childList: true,
|
|
@@ -197,7 +197,7 @@ const Tabs = p => {
|
|
|
197
197
|
trailing: true,
|
|
198
198
|
leading: true
|
|
199
199
|
});
|
|
200
|
-
(0,
|
|
200
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
201
201
|
updateMask(true);
|
|
202
202
|
}, []);
|
|
203
203
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
@@ -13,6 +13,8 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
13
13
|
|
|
14
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
15
15
|
|
|
16
|
+
var _devLog = require("../../utils/dev-log");
|
|
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; }
|
|
@@ -31,7 +33,14 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
31
33
|
showCount,
|
|
32
34
|
maxLength
|
|
33
35
|
} = props;
|
|
34
|
-
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props)
|
|
36
|
+
const [value, setValue] = (0, _usePropsValue.usePropsValue)(Object.assign(Object.assign({}, props), {
|
|
37
|
+
value: props.value === null ? '' : props.value
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
if (props.value === null) {
|
|
41
|
+
(0, _devLog.devError)('TextArea', '`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.');
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
const nativeTextAreaRef = (0, _react.useRef)(null);
|
|
36
45
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
37
46
|
clear: () => {
|
|
@@ -89,6 +98,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
89
98
|
className: `${classPrefix}-element`,
|
|
90
99
|
rows: props.rows,
|
|
91
100
|
value: value,
|
|
101
|
+
placeholder: props.placeholder,
|
|
92
102
|
onChange: e => {
|
|
93
103
|
let v = e.target.value;
|
|
94
104
|
|
|
@@ -17,6 +17,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
17
17
|
|
|
18
18
|
var _antdMobileIcons = require("antd-mobile-icons");
|
|
19
19
|
|
|
20
|
+
var _ahooks = require("ahooks");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
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); }
|
|
@@ -47,7 +49,7 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
47
49
|
content.scrollLeft = content.clientWidth;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
(0,
|
|
52
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
51
53
|
scrollToEnd();
|
|
52
54
|
}, [value]);
|
|
53
55
|
(0, _react.useEffect)(() => {
|
|
@@ -12,7 +12,7 @@ const defaultRoot = _canUseDom.canUseDom ? window : undefined;
|
|
|
12
12
|
|
|
13
13
|
function isElement(node) {
|
|
14
14
|
const ELEMENT_NODE_TYPE = 1;
|
|
15
|
-
return node.
|
|
15
|
+
return node.nodeType === ELEMENT_NODE_TYPE;
|
|
16
16
|
} // https://github.com/youzan/vant/issues/3823
|
|
17
17
|
|
|
18
18
|
|
package/2x/cjs/utils/is-dev.js
CHANGED