antd-mobile 5.7.2 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/cjs/components/dialog/dialog.js +2 -2
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/input/input.d.ts +3 -2
- package/2x/cjs/components/input/input.js +6 -0
- package/2x/cjs/components/modal/modal.js +2 -2
- package/2x/cjs/components/popover/popover.js +6 -6
- package/2x/cjs/components/search-bar/search-bar.js +7 -0
- package/2x/cjs/components/slider/slider.css +2 -0
- package/2x/cjs/components/slider/slider.d.ts +2 -1
- package/2x/cjs/components/slider/slider.js +3 -1
- package/2x/cjs/components/slider/thumb.d.ts +2 -1
- package/2x/cjs/components/slider/thumb.js +3 -2
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +1 -0
- package/2x/cjs/locales/base.d.ts +1 -0
- package/2x/cjs/locales/base.js +1 -0
- package/2x/cjs/locales/en-US.d.ts +1 -0
- package/2x/cjs/locales/fa-IR.d.ts +1 -0
- package/2x/cjs/locales/fa-IR.js +1 -0
- package/2x/cjs/locales/zh-CN.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.js +1 -0
- package/2x/cjs/locales/zh-HK.d.ts +1 -0
- package/2x/cjs/locales/zh-HK.js +1 -0
- package/2x/cjs/locales/zh-TW.d.ts +1 -0
- package/2x/cjs/locales/zh-TW.js +1 -0
- package/2x/es/components/dialog/dialog.js +2 -2
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/input/input.d.ts +3 -2
- package/2x/es/components/input/input.js +6 -0
- package/2x/es/components/modal/modal.js +2 -2
- package/2x/es/components/popover/popover.js +1 -1
- package/2x/es/components/search-bar/search-bar.js +7 -0
- package/2x/es/components/slider/slider.css +2 -0
- package/2x/es/components/slider/slider.d.ts +2 -1
- package/2x/es/components/slider/slider.js +3 -1
- package/2x/es/components/slider/thumb.d.ts +2 -1
- package/2x/es/components/slider/thumb.js +3 -2
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +1 -0
- package/2x/es/locales/base.d.ts +1 -0
- package/2x/es/locales/base.js +1 -0
- package/2x/es/locales/en-US.d.ts +1 -0
- package/2x/es/locales/fa-IR.d.ts +1 -0
- package/2x/es/locales/fa-IR.js +1 -0
- package/2x/es/locales/zh-CN.d.ts +1 -0
- package/2x/es/locales/zh-CN.js +1 -0
- package/2x/es/locales/zh-HK.d.ts +1 -0
- package/2x/es/locales/zh-HK.js +1 -0
- package/2x/es/locales/zh-TW.d.ts +1 -0
- package/2x/es/locales/zh-TW.js +1 -0
- package/2x/package.json +1 -1
- package/cjs/components/dialog/dialog.js +2 -2
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/input/input.d.ts +3 -2
- package/cjs/components/input/input.js +6 -0
- package/cjs/components/modal/modal.js +2 -2
- package/cjs/components/popover/popover.js +6 -6
- package/cjs/components/search-bar/search-bar.js +7 -0
- package/cjs/components/slider/slider.css +2 -0
- package/cjs/components/slider/slider.d.ts +2 -1
- package/cjs/components/slider/slider.js +3 -1
- package/cjs/components/slider/thumb.d.ts +2 -1
- package/cjs/components/slider/thumb.js +3 -2
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +1 -0
- package/cjs/locales/base.d.ts +1 -0
- package/cjs/locales/base.js +1 -0
- package/cjs/locales/en-US.d.ts +1 -0
- package/cjs/locales/fa-IR.d.ts +1 -0
- package/cjs/locales/fa-IR.js +1 -0
- package/cjs/locales/zh-CN.d.ts +1 -0
- package/cjs/locales/zh-CN.js +1 -0
- package/cjs/locales/zh-HK.d.ts +1 -0
- package/cjs/locales/zh-HK.js +1 -0
- package/cjs/locales/zh-TW.d.ts +1 -0
- package/cjs/locales/zh-TW.js +1 -0
- package/es/components/dialog/dialog.js +2 -2
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/input/input.d.ts +3 -2
- package/es/components/input/input.js +6 -0
- package/es/components/modal/modal.js +2 -2
- package/es/components/popover/popover.js +1 -1
- package/es/components/search-bar/search-bar.js +7 -0
- package/es/components/slider/slider.css +2 -0
- package/es/components/slider/slider.d.ts +2 -1
- package/es/components/slider/slider.js +3 -1
- package/es/components/slider/thumb.d.ts +2 -1
- package/es/components/slider/thumb.js +3 -2
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +1 -0
- package/es/locales/base.d.ts +1 -0
- package/es/locales/base.js +1 -0
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/fa-IR.d.ts +1 -0
- package/es/locales/fa-IR.js +1 -0
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-HK.d.ts +1 -0
- package/es/locales/zh-HK.js +1 -0
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +1 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/2x/cjs/components/popover/temp-floating-ui.min.js +0 -1
- package/2x/es/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/2x/es/components/popover/temp-floating-ui.min.js +0 -1
- package/cjs/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/cjs/components/popover/temp-floating-ui.min.js +0 -1
- package/es/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/es/components/popover/temp-floating-ui.min.js +0 -1
|
@@ -17,7 +17,7 @@ export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePr
|
|
|
17
17
|
hidden?: boolean;
|
|
18
18
|
layout?: FormLayout;
|
|
19
19
|
childElementPosition?: 'normal' | 'right';
|
|
20
|
-
children
|
|
20
|
+
children?: ChildrenType;
|
|
21
21
|
} & NativeProps;
|
|
22
22
|
export declare const FormItem: FC<FormItemProps>;
|
|
23
23
|
export {};
|
|
@@ -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' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | '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;
|
|
@@ -20,8 +20,9 @@ export declare type InputRef = {
|
|
|
20
20
|
clear: () => void;
|
|
21
21
|
focus: () => void;
|
|
22
22
|
blur: () => void;
|
|
23
|
+
nativeElement: HTMLInputElement | null;
|
|
23
24
|
};
|
|
24
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
25
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
25
26
|
value?: string | undefined;
|
|
26
27
|
defaultValue?: string | undefined;
|
|
27
28
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -49,7 +49,12 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
49
49
|
var _a;
|
|
50
50
|
|
|
51
51
|
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
get nativeElement() {
|
|
55
|
+
return nativeInputRef.current;
|
|
52
56
|
}
|
|
57
|
+
|
|
53
58
|
}));
|
|
54
59
|
|
|
55
60
|
const handleKeydown = e => {
|
|
@@ -117,6 +122,7 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
117
122
|
max: props.max,
|
|
118
123
|
min: props.min,
|
|
119
124
|
autoComplete: props.autoComplete,
|
|
125
|
+
autoFocus: props.autoFocus,
|
|
120
126
|
pattern: props.pattern,
|
|
121
127
|
inputMode: props.inputMode,
|
|
122
128
|
type: props.type,
|
|
@@ -23,7 +23,7 @@ var _arrow = require("./arrow");
|
|
|
23
23
|
|
|
24
24
|
var _renderToContainer = require("../../utils/render-to-container");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _dom = require("@floating-ui/dom");
|
|
27
27
|
|
|
28
28
|
var _wrapper = require("./wrapper");
|
|
29
29
|
|
|
@@ -98,13 +98,13 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
|
98
98
|
y,
|
|
99
99
|
placement: realPlacement,
|
|
100
100
|
middlewareData
|
|
101
|
-
} = yield (0,
|
|
101
|
+
} = yield (0, _dom.computePosition)(target, floating, {
|
|
102
102
|
placement,
|
|
103
|
-
middleware: [(0,
|
|
103
|
+
middleware: [(0, _dom.offset)((0, _convertPx.convertPx)(12)), (0, _dom.shift)({
|
|
104
104
|
padding: (0, _convertPx.convertPx)(4),
|
|
105
105
|
crossAxis: false,
|
|
106
|
-
limiter: (0,
|
|
107
|
-
}), (0,
|
|
106
|
+
limiter: (0, _dom.limitShift)()
|
|
107
|
+
}), (0, _dom.flip)(), (0, _dom.hide)(), (0, _dom.arrow)({
|
|
108
108
|
element: arrowElement,
|
|
109
109
|
padding: (0, _convertPx.convertPx)(12)
|
|
110
110
|
})]
|
|
@@ -161,7 +161,7 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
|
161
161
|
(0, _react.useEffect)(() => {
|
|
162
162
|
const floatingElement = floatingRef.current;
|
|
163
163
|
if (!targetElement || !floatingElement) return;
|
|
164
|
-
return (0,
|
|
164
|
+
return (0, _dom.autoUpdate)(targetElement, floatingElement, update);
|
|
165
165
|
}, [targetElement]);
|
|
166
166
|
(0, _ahooks.useClickAway)(() => {
|
|
167
167
|
if (!props.trigger) return;
|
|
@@ -62,7 +62,14 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
62
62
|
var _a;
|
|
63
63
|
|
|
64
64
|
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
get nativeElement() {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
|
|
70
|
+
return (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) !== null && _b !== void 0 ? _b : null;
|
|
65
71
|
}
|
|
72
|
+
|
|
66
73
|
}));
|
|
67
74
|
|
|
68
75
|
const renderCancelButton = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { SliderMarks } from './marks';
|
|
4
4
|
export declare type SliderValue = number | [number, number];
|
|
@@ -12,6 +12,7 @@ export declare type SliderProps = {
|
|
|
12
12
|
ticks?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
range?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
15
16
|
onChange?: (value: SliderValue) => void;
|
|
16
17
|
onAfterChange?: (value: SliderValue) => void;
|
|
17
18
|
} & NativeProps<'--fill-color'>;
|
|
@@ -49,7 +49,8 @@ const Slider = p => {
|
|
|
49
49
|
disabled,
|
|
50
50
|
marks,
|
|
51
51
|
ticks,
|
|
52
|
-
step
|
|
52
|
+
step,
|
|
53
|
+
icon
|
|
53
54
|
} = props;
|
|
54
55
|
|
|
55
56
|
function sortValue(val) {
|
|
@@ -149,6 +150,7 @@ const Slider = p => {
|
|
|
149
150
|
|
|
150
151
|
const renderThumb = index => {
|
|
151
152
|
return _react.default.createElement(_thumb.default, {
|
|
153
|
+
icon: icon,
|
|
152
154
|
key: index,
|
|
153
155
|
value: sliderValue[index],
|
|
154
156
|
min: min,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, RefObject } from 'react';
|
|
1
|
+
import React, { FC, RefObject } from 'react';
|
|
2
2
|
declare type ThumbProps = {
|
|
3
3
|
value: number;
|
|
4
4
|
min: number;
|
|
@@ -6,6 +6,7 @@ declare type ThumbProps = {
|
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
onDrag: (value: number, first: boolean, last: boolean) => void;
|
|
8
8
|
trackRef: RefObject<HTMLDivElement>;
|
|
9
|
+
icon?: React.ReactNode;
|
|
9
10
|
};
|
|
10
11
|
declare const Thumb: FC<ThumbProps>;
|
|
11
12
|
export default Thumb;
|
|
@@ -23,7 +23,8 @@ const Thumb = props => {
|
|
|
23
23
|
min,
|
|
24
24
|
max,
|
|
25
25
|
disabled,
|
|
26
|
-
onDrag
|
|
26
|
+
onDrag,
|
|
27
|
+
icon
|
|
27
28
|
} = props;
|
|
28
29
|
const prevValue = (0, _react.useRef)(value);
|
|
29
30
|
|
|
@@ -59,7 +60,7 @@ const Thumb = props => {
|
|
|
59
60
|
style: currentPosition()
|
|
60
61
|
}, bind()), _react.default.createElement("div", {
|
|
61
62
|
className: `${classPrefix}-thumb`
|
|
62
|
-
}, _react.default.createElement(_thumbIcon.ThumbIcon, {
|
|
63
|
+
}, icon ? icon : _react.default.createElement(_thumbIcon.ThumbIcon, {
|
|
63
64
|
className: `${classPrefix}-thumb-icon`
|
|
64
65
|
})));
|
|
65
66
|
};
|
|
@@ -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' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | '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" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -127,6 +127,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
127
127
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
128
128
|
},
|
|
129
129
|
autoComplete: props.autoComplete,
|
|
130
|
+
autoFocus: props.autoFocus,
|
|
130
131
|
disabled: props.disabled,
|
|
131
132
|
readOnly: props.readOnly,
|
|
132
133
|
onFocus: props.onFocus,
|
package/2x/cjs/locales/base.d.ts
CHANGED
package/2x/cjs/locales/base.js
CHANGED
package/2x/cjs/locales/fa-IR.js
CHANGED
package/2x/cjs/locales/zh-CN.js
CHANGED
package/2x/cjs/locales/zh-HK.js
CHANGED
package/2x/cjs/locales/zh-TW.js
CHANGED
|
@@ -17,7 +17,7 @@ export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePr
|
|
|
17
17
|
hidden?: boolean;
|
|
18
18
|
layout?: FormLayout;
|
|
19
19
|
childElementPosition?: 'normal' | 'right';
|
|
20
|
-
children
|
|
20
|
+
children?: ChildrenType;
|
|
21
21
|
} & NativeProps;
|
|
22
22
|
export declare const FormItem: FC<FormItemProps>;
|
|
23
23
|
export {};
|
|
@@ -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' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | '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;
|
|
@@ -20,8 +20,9 @@ export declare type InputRef = {
|
|
|
20
20
|
clear: () => void;
|
|
21
21
|
focus: () => void;
|
|
22
22
|
blur: () => void;
|
|
23
|
+
nativeElement: HTMLInputElement | null;
|
|
23
24
|
};
|
|
24
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
25
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
25
26
|
value?: string | undefined;
|
|
26
27
|
defaultValue?: string | undefined;
|
|
27
28
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -28,7 +28,12 @@ export const Input = forwardRef((p, ref) => {
|
|
|
28
28
|
var _a;
|
|
29
29
|
|
|
30
30
|
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
get nativeElement() {
|
|
34
|
+
return nativeInputRef.current;
|
|
31
35
|
}
|
|
36
|
+
|
|
32
37
|
}));
|
|
33
38
|
|
|
34
39
|
const handleKeydown = e => {
|
|
@@ -96,6 +101,7 @@ export const Input = forwardRef((p, ref) => {
|
|
|
96
101
|
max: props.max,
|
|
97
102
|
min: props.min,
|
|
98
103
|
autoComplete: props.autoComplete,
|
|
104
|
+
autoFocus: props.autoFocus,
|
|
99
105
|
pattern: props.pattern,
|
|
100
106
|
inputMode: props.inputMode,
|
|
101
107
|
type: props.type,
|
|
@@ -7,7 +7,7 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
7
7
|
import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
8
8
|
import { Arrow } from './arrow';
|
|
9
9
|
import { renderToContainer } from '../../utils/render-to-container';
|
|
10
|
-
import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from '
|
|
10
|
+
import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from '@floating-ui/dom';
|
|
11
11
|
import { Wrapper } from './wrapper';
|
|
12
12
|
import { useShouldRender } from '../../utils/should-render';
|
|
13
13
|
import { useClickAway, useIsomorphicLayoutEffect } from 'ahooks';
|
|
@@ -40,7 +40,14 @@ export const SearchBar = forwardRef((p, ref) => {
|
|
|
40
40
|
var _a;
|
|
41
41
|
|
|
42
42
|
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
get nativeElement() {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
|
|
48
|
+
return (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) !== null && _b !== void 0 ? _b : null;
|
|
43
49
|
}
|
|
50
|
+
|
|
44
51
|
}));
|
|
45
52
|
|
|
46
53
|
const renderCancelButton = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { SliderMarks } from './marks';
|
|
4
4
|
export declare type SliderValue = number | [number, number];
|
|
@@ -12,6 +12,7 @@ export declare type SliderProps = {
|
|
|
12
12
|
ticks?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
range?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
15
16
|
onChange?: (value: SliderValue) => void;
|
|
16
17
|
onAfterChange?: (value: SliderValue) => void;
|
|
17
18
|
} & NativeProps<'--fill-color'>;
|
|
@@ -26,7 +26,8 @@ export const Slider = p => {
|
|
|
26
26
|
disabled,
|
|
27
27
|
marks,
|
|
28
28
|
ticks,
|
|
29
|
-
step
|
|
29
|
+
step,
|
|
30
|
+
icon
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
function sortValue(val) {
|
|
@@ -126,6 +127,7 @@ export const Slider = p => {
|
|
|
126
127
|
|
|
127
128
|
const renderThumb = index => {
|
|
128
129
|
return React.createElement(Thumb, {
|
|
130
|
+
icon: icon,
|
|
129
131
|
key: index,
|
|
130
132
|
value: sliderValue[index],
|
|
131
133
|
min: min,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, RefObject } from 'react';
|
|
1
|
+
import React, { FC, RefObject } from 'react';
|
|
2
2
|
declare type ThumbProps = {
|
|
3
3
|
value: number;
|
|
4
4
|
min: number;
|
|
@@ -6,6 +6,7 @@ declare type ThumbProps = {
|
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
onDrag: (value: number, first: boolean, last: boolean) => void;
|
|
8
8
|
trackRef: RefObject<HTMLDivElement>;
|
|
9
|
+
icon?: React.ReactNode;
|
|
9
10
|
};
|
|
10
11
|
declare const Thumb: FC<ThumbProps>;
|
|
11
12
|
export default Thumb;
|
|
@@ -9,7 +9,8 @@ const Thumb = props => {
|
|
|
9
9
|
min,
|
|
10
10
|
max,
|
|
11
11
|
disabled,
|
|
12
|
-
onDrag
|
|
12
|
+
onDrag,
|
|
13
|
+
icon
|
|
13
14
|
} = props;
|
|
14
15
|
const prevValue = useRef(value);
|
|
15
16
|
|
|
@@ -45,7 +46,7 @@ const Thumb = props => {
|
|
|
45
46
|
style: currentPosition()
|
|
46
47
|
}, bind()), React.createElement("div", {
|
|
47
48
|
className: `${classPrefix}-thumb`
|
|
48
|
-
}, React.createElement(ThumbIcon, {
|
|
49
|
+
}, icon ? icon : React.createElement(ThumbIcon, {
|
|
49
50
|
className: `${classPrefix}-thumb-icon`
|
|
50
51
|
})));
|
|
51
52
|
};
|
|
@@ -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' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | '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" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -111,6 +111,7 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
111
111
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
112
112
|
},
|
|
113
113
|
autoComplete: props.autoComplete,
|
|
114
|
+
autoFocus: props.autoFocus,
|
|
114
115
|
disabled: props.disabled,
|
|
115
116
|
readOnly: props.readOnly,
|
|
116
117
|
onFocus: props.onFocus,
|
package/2x/es/locales/base.d.ts
CHANGED
package/2x/es/locales/base.js
CHANGED
package/2x/es/locales/en-US.d.ts
CHANGED
package/2x/es/locales/fa-IR.d.ts
CHANGED
package/2x/es/locales/fa-IR.js
CHANGED
package/2x/es/locales/zh-CN.d.ts
CHANGED
package/2x/es/locales/zh-CN.js
CHANGED
package/2x/es/locales/zh-HK.d.ts
CHANGED
package/2x/es/locales/zh-HK.js
CHANGED
package/2x/es/locales/zh-TW.d.ts
CHANGED
package/2x/es/locales/zh-TW.js
CHANGED