antd-mobile 5.0.0-rc.6 → 5.0.0-rc.7
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 -1
- package/2x/cjs/components/form/form-item.css +1 -1
- package/2x/cjs/components/form/index.css +1 -1
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/notice-bar/notice-bar.css +1 -0
- package/2x/cjs/components/progress-bar/progress-bar.css +2 -1
- package/2x/cjs/components/progress-bar/progress-bar.d.ts +1 -1
- package/2x/cjs/components/rate/rate.css +1 -0
- package/2x/cjs/components/search-bar/search-bar.css +5 -0
- package/2x/cjs/components/search-bar/search-bar.d.ts +3 -1
- package/2x/cjs/components/search-bar/search-bar.js +6 -5
- package/2x/cjs/components/side-bar/side-bar.css +2 -0
- package/2x/cjs/components/tree-select/tree-select.css +1 -0
- package/2x/cjs/global/global.css +0 -4
- package/2x/es/components/form/form-item.css +1 -1
- package/2x/es/components/form/index.css +1 -1
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/notice-bar/notice-bar.css +1 -0
- package/2x/es/components/progress-bar/progress-bar.css +2 -1
- package/2x/es/components/progress-bar/progress-bar.d.ts +1 -1
- package/2x/es/components/rate/rate.css +1 -0
- package/2x/es/components/search-bar/search-bar.css +5 -0
- package/2x/es/components/search-bar/search-bar.d.ts +3 -1
- package/2x/es/components/search-bar/search-bar.js +6 -5
- package/2x/es/components/side-bar/side-bar.css +2 -0
- package/2x/es/components/tree-select/tree-select.css +1 -0
- package/2x/es/global/global.css +0 -4
- package/2x/package.json +1 -1
- package/README.md +6 -1
- package/cjs/components/form/form-item.css +1 -1
- package/cjs/components/form/index.css +1 -1
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/notice-bar/notice-bar.css +1 -0
- package/cjs/components/progress-bar/progress-bar.css +2 -1
- package/cjs/components/progress-bar/progress-bar.d.ts +1 -1
- package/cjs/components/rate/rate.css +1 -0
- package/cjs/components/search-bar/search-bar.css +4 -0
- package/cjs/components/search-bar/search-bar.d.ts +3 -1
- package/cjs/components/search-bar/search-bar.js +6 -5
- package/cjs/components/side-bar/side-bar.css +2 -0
- package/cjs/components/tree-select/tree-select.css +1 -0
- package/cjs/global/global.css +0 -3
- package/es/components/form/form-item.css +1 -1
- package/es/components/form/index.css +1 -1
- package/es/components/input/input.d.ts +2 -2
- package/es/components/notice-bar/notice-bar.css +1 -0
- package/es/components/progress-bar/progress-bar.css +2 -1
- package/es/components/progress-bar/progress-bar.d.ts +1 -1
- package/es/components/rate/rate.css +1 -0
- package/es/components/search-bar/search-bar.css +4 -0
- package/es/components/search-bar/search-bar.d.ts +3 -1
- package/es/components/search-bar/search-bar.js +6 -5
- package/es/components/side-bar/side-bar.css +2 -0
- package/es/components/tree-select/tree-select.css +1 -0
- package/es/global/global.css +0 -3
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
package/2x/README.md
CHANGED
|
@@ -15,7 +15,12 @@ $ npm install --save antd-mobile@next
|
|
|
15
15
|
$ yarn add antd-mobile@next
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
- **Fast**: It is carefully optimized for harsh scenes, without configuration, you can have the best package size and ultimate performance.
|
|
19
|
+
- **Customizable**: Based on CSS variables, you can reliably and efficiently adjust the appearance of components or create your own themes.
|
|
20
|
+
- **Atomic**: The function of each component, neither more nor less, is exactly what you need.
|
|
21
|
+
- **Fluent**: With smooth gestures and delicate animation, it helps the product create the ultimate experience.
|
|
22
|
+
|
|
23
|
+
v5(Poplar) is the next major version of antd-mobile, we recommend using it instead of v2.
|
|
19
24
|
|
|
20
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.
|
|
21
26
|
|
|
@@ -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' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp'> & {
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
onChange?: (val: string) => void;
|
|
@@ -19,7 +19,7 @@ export declare type InputRef = {
|
|
|
19
19
|
focus: () => void;
|
|
20
20
|
blur: () => void;
|
|
21
21
|
};
|
|
22
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
22
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
23
23
|
value?: string | undefined;
|
|
24
24
|
defaultValue?: string | undefined;
|
|
25
25
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
2
|
--track-width: var(--adm-progress-bar-track-width, 6px);
|
|
3
|
+
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
3
4
|
--fill-color: var(--adm-progress-bar-fill-color, #1677ff);
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.adm-progress-bar-trail {
|
|
7
|
-
background:
|
|
8
|
+
background: var(--track-color);
|
|
8
9
|
overflow: hidden;
|
|
9
10
|
height: var(--track-width);
|
|
10
11
|
border-radius: var(--track-width);
|
|
@@ -2,5 +2,5 @@ import { FC } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ProgressBarProps = {
|
|
4
4
|
percent?: number;
|
|
5
|
-
} & NativeProps<'--track-width' | '--fill-color'>;
|
|
5
|
+
} & NativeProps<'--track-width' | '--track-color' | '--fill-color'>;
|
|
6
6
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
flex: auto;
|
|
30
30
|
padding: 8px 16px 8px 8px;
|
|
31
31
|
height: 56px;
|
|
32
|
+
box-sizing: border-box;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-input-wrapper {
|
|
@@ -40,6 +41,10 @@
|
|
|
40
41
|
line-height: 38px;
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-search-bar-input-without-icon {
|
|
45
|
+
padding-left: 16px;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
.adm-search-bar .adm-search-bar-suffix {
|
|
44
49
|
flex: none;
|
|
45
50
|
margin-left: 32px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { InputRef, InputProps } from '../input';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
export declare type SearchBarRef = InputRef;
|
|
@@ -10,6 +10,7 @@ export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'on
|
|
|
10
10
|
clearable?: boolean;
|
|
11
11
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean);
|
|
12
12
|
cancelText?: string;
|
|
13
|
+
icon?: ReactNode;
|
|
13
14
|
clearOnCancel?: boolean;
|
|
14
15
|
onSearch?: (val: string) => void;
|
|
15
16
|
onChange?: (val: string) => void;
|
|
@@ -23,6 +24,7 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
23
24
|
clearable?: boolean | undefined;
|
|
24
25
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean) | undefined;
|
|
25
26
|
cancelText?: string | undefined;
|
|
27
|
+
icon?: ReactNode;
|
|
26
28
|
clearOnCancel?: boolean | undefined;
|
|
27
29
|
onSearch?: ((val: string) => void) | undefined;
|
|
28
30
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -32,10 +32,11 @@ var defaultProps = {
|
|
|
32
32
|
clearable: true,
|
|
33
33
|
showCancelButton: false,
|
|
34
34
|
defaultValue: '',
|
|
35
|
-
clearOnCancel: true
|
|
35
|
+
clearOnCancel: true,
|
|
36
|
+
icon: /*#__PURE__*/_react["default"].createElement(_antdMobileIcons.SearchOutline, null)
|
|
36
37
|
};
|
|
37
38
|
var SearchBar = /*#__PURE__*/(0, _react.forwardRef)(function (p, ref) {
|
|
38
|
-
var _classNames;
|
|
39
|
+
var _classNames, _classNames2;
|
|
39
40
|
|
|
40
41
|
var _useConfig = (0, _configProvider.useConfig)(),
|
|
41
42
|
locale = _useConfig.locale;
|
|
@@ -108,11 +109,11 @@ var SearchBar = /*#__PURE__*/(0, _react.forwardRef)(function (p, ref) {
|
|
|
108
109
|
className: (0, _classnames["default"])(classPrefix, (_classNames = {}, _classNames[classPrefix + "-active"] = hasFocus, _classNames))
|
|
109
110
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
111
|
className: classPrefix + "-input-box"
|
|
111
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
|
+
}, props.icon && /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
113
|
className: classPrefix + "-input-box-icon"
|
|
113
|
-
},
|
|
114
|
+
}, props.icon), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
114
115
|
ref: inputRef,
|
|
115
|
-
className: classPrefix + "-input",
|
|
116
|
+
className: (0, _classnames["default"])(classPrefix + "-input", (_classNames2 = {}, _classNames2[classPrefix + "-input-without-icon"] = !props.icon, _classNames2)),
|
|
116
117
|
value: value,
|
|
117
118
|
onChange: setValue,
|
|
118
119
|
maxLength: props.maxLength,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--item-border-radius: 16px;
|
|
5
5
|
width: var(--width);
|
|
6
6
|
height: var(--height);
|
|
7
|
+
box-sizing: border-box;
|
|
7
8
|
font-size: 30px;
|
|
8
9
|
overflow-y: auto;
|
|
9
10
|
transform: translateZ(0);
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
display: flex;
|
|
15
16
|
align-items: center;
|
|
16
17
|
min-height: 100px;
|
|
18
|
+
box-sizing: border-box;
|
|
17
19
|
padding: 12px 44px;
|
|
18
20
|
position: relative;
|
|
19
21
|
cursor: pointer;
|
package/2x/cjs/global/global.css
CHANGED
|
@@ -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' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp'> & {
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
onChange?: (val: string) => void;
|
|
@@ -19,7 +19,7 @@ export declare type InputRef = {
|
|
|
19
19
|
focus: () => void;
|
|
20
20
|
blur: () => void;
|
|
21
21
|
};
|
|
22
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
22
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
23
23
|
value?: string | undefined;
|
|
24
24
|
defaultValue?: string | undefined;
|
|
25
25
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
2
|
--track-width: var(--adm-progress-bar-track-width, 6px);
|
|
3
|
+
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
3
4
|
--fill-color: var(--adm-progress-bar-fill-color, #1677ff);
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.adm-progress-bar-trail {
|
|
7
|
-
background:
|
|
8
|
+
background: var(--track-color);
|
|
8
9
|
overflow: hidden;
|
|
9
10
|
height: var(--track-width);
|
|
10
11
|
border-radius: var(--track-width);
|
|
@@ -2,5 +2,5 @@ import { FC } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ProgressBarProps = {
|
|
4
4
|
percent?: number;
|
|
5
|
-
} & NativeProps<'--track-width' | '--fill-color'>;
|
|
5
|
+
} & NativeProps<'--track-width' | '--track-color' | '--fill-color'>;
|
|
6
6
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
flex: auto;
|
|
30
30
|
padding: 8px 16px 8px 8px;
|
|
31
31
|
height: 56px;
|
|
32
|
+
box-sizing: border-box;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-input-wrapper {
|
|
@@ -40,6 +41,10 @@
|
|
|
40
41
|
line-height: 38px;
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-search-bar-input-without-icon {
|
|
45
|
+
padding-left: 16px;
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
.adm-search-bar .adm-search-bar-suffix {
|
|
44
49
|
flex: none;
|
|
45
50
|
margin-left: 32px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { InputRef, InputProps } from '../input';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
export declare type SearchBarRef = InputRef;
|
|
@@ -10,6 +10,7 @@ export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'on
|
|
|
10
10
|
clearable?: boolean;
|
|
11
11
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean);
|
|
12
12
|
cancelText?: string;
|
|
13
|
+
icon?: ReactNode;
|
|
13
14
|
clearOnCancel?: boolean;
|
|
14
15
|
onSearch?: (val: string) => void;
|
|
15
16
|
onChange?: (val: string) => void;
|
|
@@ -23,6 +24,7 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
23
24
|
clearable?: boolean | undefined;
|
|
24
25
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean) | undefined;
|
|
25
26
|
cancelText?: string | undefined;
|
|
27
|
+
icon?: ReactNode;
|
|
26
28
|
clearOnCancel?: boolean | undefined;
|
|
27
29
|
onSearch?: ((val: string) => void) | undefined;
|
|
28
30
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -11,10 +11,11 @@ var defaultProps = {
|
|
|
11
11
|
clearable: true,
|
|
12
12
|
showCancelButton: false,
|
|
13
13
|
defaultValue: '',
|
|
14
|
-
clearOnCancel: true
|
|
14
|
+
clearOnCancel: true,
|
|
15
|
+
icon: /*#__PURE__*/React.createElement(SearchOutline, null)
|
|
15
16
|
};
|
|
16
17
|
export var SearchBar = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
17
|
-
var _classNames;
|
|
18
|
+
var _classNames, _classNames2;
|
|
18
19
|
|
|
19
20
|
var _useConfig = useConfig(),
|
|
20
21
|
locale = _useConfig.locale;
|
|
@@ -87,11 +88,11 @@ export var SearchBar = /*#__PURE__*/forwardRef(function (p, ref) {
|
|
|
87
88
|
className: classNames(classPrefix, (_classNames = {}, _classNames[classPrefix + "-active"] = hasFocus, _classNames))
|
|
88
89
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
90
|
className: classPrefix + "-input-box"
|
|
90
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
}, props.icon && /*#__PURE__*/React.createElement("div", {
|
|
91
92
|
className: classPrefix + "-input-box-icon"
|
|
92
|
-
},
|
|
93
|
+
}, props.icon), /*#__PURE__*/React.createElement(Input, {
|
|
93
94
|
ref: inputRef,
|
|
94
|
-
className: classPrefix + "-input",
|
|
95
|
+
className: classNames(classPrefix + "-input", (_classNames2 = {}, _classNames2[classPrefix + "-input-without-icon"] = !props.icon, _classNames2)),
|
|
95
96
|
value: value,
|
|
96
97
|
onChange: setValue,
|
|
97
98
|
maxLength: props.maxLength,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--item-border-radius: 16px;
|
|
5
5
|
width: var(--width);
|
|
6
6
|
height: var(--height);
|
|
7
|
+
box-sizing: border-box;
|
|
7
8
|
font-size: 30px;
|
|
8
9
|
overflow-y: auto;
|
|
9
10
|
transform: translateZ(0);
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
display: flex;
|
|
15
16
|
align-items: center;
|
|
16
17
|
min-height: 100px;
|
|
18
|
+
box-sizing: border-box;
|
|
17
19
|
padding: 12px 44px;
|
|
18
20
|
position: relative;
|
|
19
21
|
cursor: pointer;
|
package/2x/es/global/global.css
CHANGED
package/2x/package.json
CHANGED
package/README.md
CHANGED
|
@@ -15,7 +15,12 @@ $ npm install --save antd-mobile@next
|
|
|
15
15
|
$ yarn add antd-mobile@next
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
- **Fast**: It is carefully optimized for harsh scenes, without configuration, you can have the best package size and ultimate performance.
|
|
19
|
+
- **Customizable**: Based on CSS variables, you can reliably and efficiently adjust the appearance of components or create your own themes.
|
|
20
|
+
- **Atomic**: The function of each component, neither more nor less, is exactly what you need.
|
|
21
|
+
- **Fluent**: With smooth gestures and delicate animation, it helps the product create the ultimate experience.
|
|
22
|
+
|
|
23
|
+
v5(Poplar) is the next major version of antd-mobile, we recommend using it instead of v2.
|
|
19
24
|
|
|
20
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.
|
|
21
26
|
|
|
@@ -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' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp'> & {
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'max' | 'min' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
onChange?: (val: string) => void;
|
|
@@ -19,7 +19,7 @@ export declare type InputRef = {
|
|
|
19
19
|
focus: () => void;
|
|
20
20
|
blur: () => void;
|
|
21
21
|
};
|
|
22
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
22
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
23
23
|
value?: string | undefined;
|
|
24
24
|
defaultValue?: string | undefined;
|
|
25
25
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
2
|
--track-width: var(--adm-progress-bar-track-width, 3px);
|
|
3
|
+
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
3
4
|
--fill-color: var(--adm-progress-bar-fill-color, #1677ff);
|
|
4
5
|
}
|
|
5
6
|
.adm-progress-bar-trail {
|
|
6
|
-
background:
|
|
7
|
+
background: var(--track-color);
|
|
7
8
|
overflow: hidden;
|
|
8
9
|
height: var(--track-width);
|
|
9
10
|
border-radius: var(--track-width);
|
|
@@ -2,5 +2,5 @@ import { FC } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ProgressBarProps = {
|
|
4
4
|
percent?: number;
|
|
5
|
-
} & NativeProps<'--track-width' | '--fill-color'>;
|
|
5
|
+
} & NativeProps<'--track-width' | '--track-color' | '--fill-color'>;
|
|
6
6
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
flex: auto;
|
|
27
27
|
padding: 4px 8px 4px 4px;
|
|
28
28
|
height: 28px;
|
|
29
|
+
box-sizing: border-box;
|
|
29
30
|
}
|
|
30
31
|
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-input-wrapper {
|
|
31
32
|
--placeholder-color: var(---placeholder-color);
|
|
@@ -34,6 +35,9 @@
|
|
|
34
35
|
font-size: 13px;
|
|
35
36
|
line-height: 19px;
|
|
36
37
|
}
|
|
38
|
+
.adm-search-bar .adm-search-bar-input-box .adm-search-bar-input.adm-search-bar-input-without-icon {
|
|
39
|
+
padding-left: 8px;
|
|
40
|
+
}
|
|
37
41
|
.adm-search-bar .adm-search-bar-suffix {
|
|
38
42
|
flex: none;
|
|
39
43
|
margin-left: 16px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { InputRef, InputProps } from '../input';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
export declare type SearchBarRef = InputRef;
|
|
@@ -10,6 +10,7 @@ export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'on
|
|
|
10
10
|
clearable?: boolean;
|
|
11
11
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean);
|
|
12
12
|
cancelText?: string;
|
|
13
|
+
icon?: ReactNode;
|
|
13
14
|
clearOnCancel?: boolean;
|
|
14
15
|
onSearch?: (val: string) => void;
|
|
15
16
|
onChange?: (val: string) => void;
|
|
@@ -23,6 +24,7 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
23
24
|
clearable?: boolean | undefined;
|
|
24
25
|
showCancelButton?: boolean | ((focus: boolean, value: string) => boolean) | undefined;
|
|
25
26
|
cancelText?: string | undefined;
|
|
27
|
+
icon?: ReactNode;
|
|
26
28
|
clearOnCancel?: boolean | undefined;
|
|
27
29
|
onSearch?: ((val: string) => void) | undefined;
|
|
28
30
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -32,10 +32,11 @@ var defaultProps = {
|
|
|
32
32
|
clearable: true,
|
|
33
33
|
showCancelButton: false,
|
|
34
34
|
defaultValue: '',
|
|
35
|
-
clearOnCancel: true
|
|
35
|
+
clearOnCancel: true,
|
|
36
|
+
icon: /*#__PURE__*/_react["default"].createElement(_antdMobileIcons.SearchOutline, null)
|
|
36
37
|
};
|
|
37
38
|
var SearchBar = /*#__PURE__*/(0, _react.forwardRef)(function (p, ref) {
|
|
38
|
-
var _classNames;
|
|
39
|
+
var _classNames, _classNames2;
|
|
39
40
|
|
|
40
41
|
var _useConfig = (0, _configProvider.useConfig)(),
|
|
41
42
|
locale = _useConfig.locale;
|
|
@@ -108,11 +109,11 @@ var SearchBar = /*#__PURE__*/(0, _react.forwardRef)(function (p, ref) {
|
|
|
108
109
|
className: (0, _classnames["default"])(classPrefix, (_classNames = {}, _classNames[classPrefix + "-active"] = hasFocus, _classNames))
|
|
109
110
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
111
|
className: classPrefix + "-input-box"
|
|
111
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
|
+
}, props.icon && /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
113
|
className: classPrefix + "-input-box-icon"
|
|
113
|
-
},
|
|
114
|
+
}, props.icon), /*#__PURE__*/_react["default"].createElement(_input["default"], {
|
|
114
115
|
ref: inputRef,
|
|
115
|
-
className: classPrefix + "-input",
|
|
116
|
+
className: (0, _classnames["default"])(classPrefix + "-input", (_classNames2 = {}, _classNames2[classPrefix + "-input-without-icon"] = !props.icon, _classNames2)),
|
|
116
117
|
value: value,
|
|
117
118
|
onChange: setValue,
|
|
118
119
|
maxLength: props.maxLength,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
--item-border-radius: 8px;
|
|
5
5
|
width: var(--width);
|
|
6
6
|
height: var(--height);
|
|
7
|
+
box-sizing: border-box;
|
|
7
8
|
font-size: 15px;
|
|
8
9
|
overflow-y: auto;
|
|
9
10
|
transform: translateZ(0);
|
|
@@ -13,6 +14,7 @@
|
|
|
13
14
|
display: flex;
|
|
14
15
|
align-items: center;
|
|
15
16
|
min-height: 50px;
|
|
17
|
+
box-sizing: border-box;
|
|
16
18
|
padding: 6px 22px;
|
|
17
19
|
position: relative;
|
|
18
20
|
cursor: pointer;
|
package/cjs/global/global.css
CHANGED