antd-mobile 5.0.0-rc.23 → 5.0.0-rc.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/README.md +6 -6
- package/2x/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/cjs/components/form/form-item.css +3 -2
- package/2x/cjs/components/form/form-item.d.ts +2 -2
- package/2x/cjs/components/form/form-item.js +9 -5
- package/2x/cjs/components/form/form.css +3 -3
- package/2x/cjs/components/form/form.d.ts +5 -4
- package/2x/cjs/components/form/index.css +6 -5
- package/2x/cjs/components/form/index.d.ts +5 -4
- package/2x/cjs/components/input/input.d.ts +2 -2
- package/2x/cjs/components/input/input.js +3 -1
- package/2x/cjs/components/list/list.css +2 -6
- package/2x/cjs/components/picker/picker.css +10 -2
- package/2x/cjs/components/picker/picker.d.ts +1 -1
- package/2x/cjs/components/picker-view/picker-view.css +2 -1
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/2x/cjs/components/popover/arrow.d.ts +3 -0
- package/2x/cjs/components/popover/arrow.js +26 -0
- package/2x/cjs/components/popover/index.d.ts +7 -15
- package/2x/cjs/components/popover/index.js +4 -2
- package/2x/cjs/components/popover/popover-menu.css +63 -0
- package/2x/cjs/components/popover/popover-menu.d.ts +20 -0
- package/{cjs/components/popover/pop-menu.js → 2x/cjs/components/popover/popover-menu.js} +23 -26
- package/2x/cjs/components/popover/popover.css +90 -318
- package/2x/cjs/components/popover/popover.d.ts +9 -8
- package/2x/cjs/components/popover/popover.js +11 -17
- package/2x/cjs/components/text-area/text-area.css +9 -9
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +40 -32
- package/2x/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/2x/es/components/form/form-item.css +3 -2
- package/2x/es/components/form/form-item.d.ts +2 -2
- package/2x/es/components/form/form-item.js +9 -5
- package/2x/es/components/form/form.css +3 -3
- package/2x/es/components/form/form.d.ts +5 -4
- package/2x/es/components/form/index.css +6 -5
- package/2x/es/components/form/index.d.ts +5 -4
- package/2x/es/components/input/input.d.ts +2 -2
- package/2x/es/components/input/input.js +3 -1
- package/2x/es/components/list/list.css +2 -6
- package/2x/es/components/picker/picker.css +10 -2
- package/2x/es/components/picker/picker.d.ts +1 -1
- package/2x/es/components/picker-view/picker-view.css +2 -1
- package/2x/es/components/picker-view/picker-view.d.ts +1 -1
- package/2x/es/components/popover/arrow.d.ts +3 -0
- package/2x/es/components/popover/arrow.js +12 -0
- package/2x/es/components/popover/index.d.ts +7 -15
- package/2x/es/components/popover/index.js +3 -2
- package/2x/es/components/popover/popover-menu.css +63 -0
- package/2x/es/components/popover/popover-menu.d.ts +20 -0
- package/2x/es/components/popover/popover-menu.js +52 -0
- package/2x/es/components/popover/popover.css +90 -318
- package/2x/es/components/popover/popover.d.ts +9 -8
- package/2x/es/components/popover/popover.js +10 -17
- package/2x/es/components/text-area/text-area.css +9 -9
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +40 -31
- package/2x/package.json +1 -1
- package/README.md +6 -6
- package/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/cjs/components/form/form-item.css +3 -2
- package/cjs/components/form/form-item.d.ts +2 -2
- package/cjs/components/form/form-item.js +9 -5
- package/cjs/components/form/form.css +3 -3
- package/cjs/components/form/form.d.ts +5 -4
- package/cjs/components/form/index.css +6 -5
- package/cjs/components/form/index.d.ts +5 -4
- package/cjs/components/input/input.d.ts +2 -2
- package/cjs/components/input/input.js +3 -1
- package/cjs/components/list/list.css +2 -5
- package/cjs/components/picker/picker.css +9 -2
- package/cjs/components/picker/picker.d.ts +1 -1
- package/cjs/components/picker-view/picker-view.css +2 -1
- package/cjs/components/picker-view/picker-view.d.ts +1 -1
- package/cjs/components/popover/arrow.d.ts +3 -0
- package/cjs/components/popover/arrow.js +26 -0
- package/cjs/components/popover/index.d.ts +7 -15
- package/cjs/components/popover/index.js +4 -2
- package/cjs/components/popover/popover-menu.css +52 -0
- package/cjs/components/popover/popover-menu.d.ts +20 -0
- package/{2x/cjs/components/popover/pop-menu.js → cjs/components/popover/popover-menu.js} +23 -26
- package/cjs/components/popover/popover.css +83 -276
- package/cjs/components/popover/popover.d.ts +9 -8
- package/cjs/components/popover/popover.js +11 -17
- package/cjs/components/text-area/text-area.css +9 -9
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +40 -32
- package/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker-view/date-picker-view.d.ts +3 -2
- package/es/components/form/form-item.css +3 -2
- package/es/components/form/form-item.d.ts +2 -2
- package/es/components/form/form-item.js +9 -5
- package/es/components/form/form.css +3 -3
- package/es/components/form/form.d.ts +5 -4
- package/es/components/form/index.css +6 -5
- package/es/components/form/index.d.ts +5 -4
- package/es/components/input/input.d.ts +2 -2
- package/es/components/input/input.js +3 -1
- package/es/components/list/list.css +2 -5
- package/es/components/picker/picker.css +9 -2
- package/es/components/picker/picker.d.ts +1 -1
- package/es/components/picker-view/picker-view.css +2 -1
- package/es/components/picker-view/picker-view.d.ts +1 -1
- package/es/components/popover/arrow.d.ts +3 -0
- package/es/components/popover/arrow.js +12 -0
- package/es/components/popover/index.d.ts +7 -15
- package/es/components/popover/index.js +3 -2
- package/es/components/popover/popover-menu.css +52 -0
- package/es/components/popover/popover-menu.d.ts +20 -0
- package/es/components/popover/popover-menu.js +52 -0
- package/es/components/popover/popover.css +83 -276
- package/es/components/popover/popover.d.ts +9 -8
- package/es/components/popover/popover.js +10 -17
- package/es/components/text-area/text-area.css +9 -9
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +40 -31
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/popover/animation.css +0 -111
- package/2x/cjs/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/animation.css +0 -111
- package/2x/es/components/popover/pop-menu.d.ts +0 -28
- package/2x/es/components/popover/pop-menu.js +0 -54
- package/cjs/components/popover/animation.css +0 -96
- package/cjs/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/animation.css +0 -96
- package/es/components/popover/pop-menu.d.ts +0 -28
- package/es/components/popover/pop-menu.js +0 -54
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
|
-
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
5
5
|
onChange?: (val: string) => void;
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
|
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
22
|
};
|
|
23
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
2
1
|
import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
4
3
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
5
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
6
5
|
const classPrefix = 'adm-text-area';
|
|
@@ -12,19 +11,11 @@ const defaultProps = {
|
|
|
12
11
|
};
|
|
13
12
|
export const TextArea = forwardRef((p, ref) => {
|
|
14
13
|
const props = mergeProps(defaultProps, p);
|
|
15
|
-
|
|
16
14
|
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onChange: outerOnChange,
|
|
22
|
-
rows: rows,
|
|
23
|
-
autoSize: autoSize,
|
|
24
|
-
showCount
|
|
25
|
-
} = props,
|
|
26
|
-
textAreaProps = __rest(props, ["className", "style", "defaultValue", "value", "onChange", "rows", "autoSize", "showCount"]);
|
|
27
|
-
|
|
15
|
+
autoSize,
|
|
16
|
+
showCount,
|
|
17
|
+
maxLength
|
|
18
|
+
} = props;
|
|
28
19
|
const [value, setValue] = usePropsValue(props);
|
|
29
20
|
const nativeTextAreaRef = useRef(null);
|
|
30
21
|
useImperativeHandle(ref, () => ({
|
|
@@ -64,39 +55,57 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
64
55
|
|
|
65
56
|
textArea.style.height = `${height}px`;
|
|
66
57
|
}, [value, autoSize]);
|
|
58
|
+
const compositingRef = useRef(false);
|
|
67
59
|
let count;
|
|
60
|
+
const valueLength = [...value].length;
|
|
68
61
|
|
|
69
62
|
if (typeof showCount === 'function') {
|
|
70
|
-
count = showCount(
|
|
63
|
+
count = showCount(valueLength, maxLength);
|
|
71
64
|
} else if (showCount) {
|
|
72
65
|
count = React.createElement("div", {
|
|
73
66
|
className: `${classPrefix}-count`
|
|
74
|
-
},
|
|
67
|
+
}, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
|
|
75
68
|
}
|
|
76
69
|
|
|
77
|
-
return React.createElement("div", {
|
|
78
|
-
className:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
className: classPrefix,
|
|
84
|
-
rows: rows,
|
|
70
|
+
return withNativeProps(props, React.createElement("div", {
|
|
71
|
+
className: classPrefix
|
|
72
|
+
}, React.createElement("textarea", {
|
|
73
|
+
ref: nativeTextAreaRef,
|
|
74
|
+
className: `${classPrefix}-element`,
|
|
75
|
+
rows: props.rows,
|
|
85
76
|
value: value,
|
|
86
77
|
onChange: e => {
|
|
87
|
-
|
|
78
|
+
let v = e.target.value;
|
|
79
|
+
|
|
80
|
+
if (maxLength && !compositingRef.current) {
|
|
81
|
+
v = [...v].slice(0, maxLength).join('');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
setValue(v);
|
|
88
85
|
},
|
|
89
|
-
|
|
86
|
+
id: props.id,
|
|
87
|
+
onCompositionStart: e => {
|
|
90
88
|
var _a;
|
|
91
89
|
|
|
92
|
-
|
|
90
|
+
compositingRef.current = true;
|
|
91
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
93
92
|
},
|
|
94
|
-
|
|
93
|
+
onCompositionEnd: e => {
|
|
95
94
|
var _a;
|
|
96
95
|
|
|
97
|
-
|
|
96
|
+
compositingRef.current = false;
|
|
97
|
+
|
|
98
|
+
if (maxLength) {
|
|
99
|
+
setValue([...value].slice(0, maxLength).join(''));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
98
103
|
},
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
autoComplete: props.autoComplete,
|
|
105
|
+
disabled: props.disabled,
|
|
106
|
+
readOnly: props.readOnly,
|
|
107
|
+
onFocus: props.onFocus,
|
|
108
|
+
onBlur: props.onBlur
|
|
109
|
+
}), count));
|
|
101
110
|
});
|
|
102
111
|
TextArea.defaultProps = defaultProps;
|
package/2x/package.json
CHANGED
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*
|
|
1
|
+
<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*8HtNS4uMKkAAAAAAAAAAAAAAARQnAQ" alt="logo" width="100%" />
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|

|
|
5
|
-

|
|
6
|
+

|
|
6
7
|

|
|
7
8
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Average time to resolve an issue')
|
|
8
9
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Percentage of issues still open')
|
|
@@ -21,17 +22,16 @@ $ yarn add antd-mobile@next
|
|
|
21
22
|
- **Atomic**: The function of each component, neither more nor less, is exactly what you need.
|
|
22
23
|
- **Fluent**: With smooth gestures and delicate animation, it helps the product create the ultimate experience.
|
|
23
24
|
|
|
24
|
-
v5(Poplar) is the next major version of antd-mobile, we recommend using it instead of v2.
|
|
25
|
-
|
|
26
25
|
You can also play with antd-mobile just in browser with [Codesandbox](https://codesandbox.io/s/antd-mobile-snrxr?file=/package.json). No need to prepare development environment.
|
|
27
26
|
|
|
28
27
|
If you found bugs or would like to request some new features, please consider opening an [issue](https://github.com/ant-design/ant-design-mobile/issues/new).
|
|
29
28
|
|
|
30
29
|
If you have some question about how to use ant-mobile, you can start a [discussion thread](https://github.com/ant-design/ant-design-mobile/discussions).
|
|
31
30
|
|
|
32
|
-
Feel free to join
|
|
31
|
+
And we also have some community groups here. Feel free to join us:
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
- [DingDing](https://gw.alipayobjects.com/mdn/rms_25513e/afts/img/A*hBjlR4nUWjkAAAAAAAAAAAAAARQnAQ)
|
|
34
|
+
- [Discord](https://discord.gg/jmNvw4WFYn)
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { NativeProps } from '../../utils/native-props';
|
|
3
2
|
import type { PickerViewProps } from '../picker-view';
|
|
4
3
|
import type { CascadePickerOption } from '../cascade-picker';
|
|
5
4
|
export declare type CascadePickerViewProps = Omit<PickerViewProps, 'columns'> & {
|
|
6
5
|
options: CascadePickerOption[];
|
|
7
|
-
}
|
|
6
|
+
};
|
|
8
7
|
export declare const CascadePickerView: FC<CascadePickerViewProps>;
|
|
@@ -2,7 +2,7 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { PickerProps } from '../picker';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
|
-
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation'> & {
|
|
5
|
+
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style'> & {
|
|
6
6
|
value?: Date | null;
|
|
7
7
|
defaultValue?: Date | null;
|
|
8
8
|
onSelect?: (value: Date) => void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { PickerViewProps } from '../picker-view';
|
|
2
3
|
import { NativeProps } from '../../utils/native-props';
|
|
3
4
|
import type { Precision, DatePickerFilter } from '../date-picker/date-picker-utils';
|
|
4
|
-
export declare type DatePickerViewProps = {
|
|
5
|
+
export declare type DatePickerViewProps = Pick<PickerViewProps, 'style'> & {
|
|
5
6
|
value?: Date;
|
|
6
7
|
defaultValue?: Date;
|
|
7
8
|
onChange?: (value: Date) => void;
|
|
@@ -10,5 +11,5 @@ export declare type DatePickerViewProps = {
|
|
|
10
11
|
precision?: Precision;
|
|
11
12
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
12
13
|
filter?: DatePickerFilter;
|
|
13
|
-
} & NativeProps
|
|
14
|
+
} & NativeProps;
|
|
14
15
|
export declare const DatePickerView: FC<DatePickerViewProps>;
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
.adm-form-item-label-required {
|
|
12
12
|
position: absolute;
|
|
13
13
|
left: -0.6em;
|
|
14
|
-
top: 0
|
|
14
|
+
top: 0;
|
|
15
|
+
font-family: SimSun, sans-serif;
|
|
15
16
|
color: var(--adm-color-danger);
|
|
16
17
|
user-select: none;
|
|
17
18
|
}
|
|
@@ -22,8 +23,8 @@
|
|
|
22
23
|
display: none;
|
|
23
24
|
}
|
|
24
25
|
.adm-form-vertical .adm-form-item-label {
|
|
25
|
-
margin-bottom: 4px;
|
|
26
26
|
font-size: 15px;
|
|
27
|
+
margin-bottom: 4px;
|
|
27
28
|
}
|
|
28
29
|
.adm-form-vertical .adm-form-item-footer {
|
|
29
30
|
margin-top: 4px;
|
|
@@ -7,7 +7,7 @@ import type { FormLayout } from './index';
|
|
|
7
7
|
declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
|
8
8
|
declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
|
|
9
9
|
declare type RcFieldProps = Omit<FieldProps, 'children'>;
|
|
10
|
-
export declare type FormItemProps = RcFieldProps
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate'> & Pick<ListItemProps, 'style' | 'onClick' | 'extra' | 'arrow'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|
|
@@ -17,6 +17,6 @@ export declare type FormItemProps = RcFieldProps & NativeProps & Pick<ListItemPr
|
|
|
17
17
|
hidden?: boolean;
|
|
18
18
|
layout?: FormLayout;
|
|
19
19
|
children: ChildrenType;
|
|
20
|
-
};
|
|
20
|
+
} & NativeProps;
|
|
21
21
|
export declare const FormItem: FC<FormItemProps>;
|
|
22
22
|
export {};
|
|
@@ -48,7 +48,8 @@ const FormItemLayout = props => {
|
|
|
48
48
|
children,
|
|
49
49
|
htmlFor,
|
|
50
50
|
hidden,
|
|
51
|
-
errors
|
|
51
|
+
errors,
|
|
52
|
+
arrow
|
|
52
53
|
} = props;
|
|
53
54
|
const context = (0, _react.useContext)(_context.FormContext);
|
|
54
55
|
const hasFeedback = props.hasFeedback !== undefined ? props.hasFeedback : context.hasFeedback;
|
|
@@ -77,7 +78,8 @@ const FormItemLayout = props => {
|
|
|
77
78
|
[`${classPrefix}-hidden`]: hidden
|
|
78
79
|
}),
|
|
79
80
|
disabled: disabled,
|
|
80
|
-
onClick: props.onClick
|
|
81
|
+
onClick: props.onClick,
|
|
82
|
+
arrow: arrow
|
|
81
83
|
}, children);
|
|
82
84
|
};
|
|
83
85
|
|
|
@@ -105,9 +107,10 @@ const FormItem = props => {
|
|
|
105
107
|
validateTrigger,
|
|
106
108
|
onClick,
|
|
107
109
|
shouldUpdate,
|
|
108
|
-
dependencies
|
|
110
|
+
dependencies,
|
|
111
|
+
arrow
|
|
109
112
|
} = props,
|
|
110
|
-
fieldProps = (0, _tslib.__rest)(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies"]);
|
|
113
|
+
fieldProps = (0, _tslib.__rest)(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "arrow"]);
|
|
111
114
|
|
|
112
115
|
const {
|
|
113
116
|
validateTrigger: contextValidateTrigger
|
|
@@ -166,7 +169,8 @@ const FormItem = props => {
|
|
|
166
169
|
errors: errors,
|
|
167
170
|
onClick: onClick,
|
|
168
171
|
hidden: hidden,
|
|
169
|
-
layout: layout
|
|
172
|
+
layout: layout,
|
|
173
|
+
arrow: arrow
|
|
170
174
|
}, _react.default.createElement(_context.NoStyleItemContext.Provider, {
|
|
171
175
|
value: onSubMetaChange
|
|
172
176
|
}, baseChildren));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.adm-form .adm-list.adm-list {
|
|
2
|
-
--padding-left:
|
|
3
|
-
--padding-right:
|
|
2
|
+
--padding-left: 16px;
|
|
3
|
+
--padding-right: 12px;
|
|
4
4
|
}
|
|
5
5
|
.adm-form-horizontal .adm-list.adm-list {
|
|
6
6
|
--prefix-width: 6em;
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
align-self: center;
|
|
11
11
|
}
|
|
12
12
|
.adm-form .adm-form-footer {
|
|
13
|
-
padding: 12px;
|
|
13
|
+
padding: 20px 12px;
|
|
14
14
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { ListProps } from '../list';
|
|
4
|
-
import type { FormProps as RcFormProps, FormInstance } from 'rc-field-form';
|
|
4
|
+
import type { FormProps as RcFormProps, FormInstance as RCFormInstance } from 'rc-field-form';
|
|
5
5
|
import { FormContextType } from './context';
|
|
6
6
|
import type { FormLayout } from '.';
|
|
7
|
-
export declare type
|
|
7
|
+
export declare type FormInstance = Pick<RCFormInstance, 'getFieldValue' | 'getFieldsValue' | 'getFieldError' | 'getFieldsError' | 'isFieldTouched' | 'isFieldsTouched' | 'resetFields' | 'setFields' | 'setFieldsValue' | 'submit' | 'validateFields'>;
|
|
8
|
+
export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'name' | 'preserve' | 'validateMessages' | 'validateTrigger' | 'onFieldsChange' | 'onFinish' | 'onFinishFailed' | 'onValuesChange' | 'children'> & NativeProps & Partial<FormContextType> & {
|
|
8
9
|
footer?: ReactNode;
|
|
9
10
|
layout?: FormLayout;
|
|
10
11
|
mode?: ListProps['mode'];
|
|
11
12
|
};
|
|
12
|
-
export declare const Form: React.ForwardRefExoticComponent<RcFormProps<any> & NativeProps<never> & Partial<FormContextType> & {
|
|
13
|
+
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & NativeProps<never> & Partial<FormContextType> & {
|
|
13
14
|
footer?: ReactNode;
|
|
14
15
|
layout?: "horizontal" | "vertical" | undefined;
|
|
15
16
|
mode?: ListProps['mode'];
|
|
16
|
-
} & React.RefAttributes<
|
|
17
|
+
} & React.RefAttributes<Pick<RCFormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.adm-form .adm-list.adm-list {
|
|
2
|
-
--padding-left:
|
|
3
|
-
--padding-right:
|
|
2
|
+
--padding-left: 16px;
|
|
3
|
+
--padding-right: 12px;
|
|
4
4
|
}
|
|
5
5
|
.adm-form-horizontal .adm-list.adm-list {
|
|
6
6
|
--prefix-width: 6em;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
align-self: center;
|
|
11
11
|
}
|
|
12
12
|
.adm-form .adm-form-footer {
|
|
13
|
-
padding: 12px;
|
|
13
|
+
padding: 20px 12px;
|
|
14
14
|
}
|
|
15
15
|
.adm-form-item + .adm-form-item {
|
|
16
16
|
border-top: none;
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
.adm-form-item-label-required {
|
|
26
26
|
position: absolute;
|
|
27
27
|
left: -0.6em;
|
|
28
|
-
top: 0
|
|
28
|
+
top: 0;
|
|
29
|
+
font-family: SimSun, sans-serif;
|
|
29
30
|
color: var(--adm-color-danger);
|
|
30
31
|
user-select: none;
|
|
31
32
|
}
|
|
@@ -36,8 +37,8 @@
|
|
|
36
37
|
display: none;
|
|
37
38
|
}
|
|
38
39
|
.adm-form-vertical .adm-form-item-label {
|
|
39
|
-
margin-bottom: 4px;
|
|
40
40
|
font-size: 15px;
|
|
41
|
+
margin-bottom: 4px;
|
|
41
42
|
}
|
|
42
43
|
.adm-form-vertical .adm-form-item-footer {
|
|
43
44
|
margin-top: 4px;
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
import './index.less';
|
|
3
3
|
import { useForm } from 'rc-field-form';
|
|
4
4
|
export declare type FormLayout = 'vertical' | 'horizontal';
|
|
5
|
-
export type { FormProps } from './form';
|
|
6
|
-
export type {
|
|
7
|
-
|
|
5
|
+
export type { FormProps, FormInstance } from './form';
|
|
6
|
+
export type { FormItemProps } from './form-item';
|
|
7
|
+
export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
|
|
8
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & import("../../utils/native-props").NativeProps<never> & Partial<import("./context").FormContextType> & {
|
|
8
9
|
footer?: import("react").ReactNode;
|
|
9
10
|
layout?: "horizontal" | "vertical" | undefined;
|
|
10
11
|
mode?: "default" | "card" | undefined;
|
|
11
|
-
} & import("react").RefAttributes<import("rc-field-form").FormInstance<any>>> & {
|
|
12
|
+
} & import("react").RefAttributes<Pick<import("rc-field-form").FormInstance<any>, "submit" | "getFieldValue" | "getFieldsValue" | "getFieldError" | "getFieldsError" | "isFieldTouched" | "isFieldsTouched" | "resetFields" | "setFields" | "setFieldsValue" | "validateFields">>> & {
|
|
12
13
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
13
14
|
Header: import("react").FC<{}>;
|
|
14
15
|
useForm: typeof useForm;
|
|
@@ -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' | 'inputMode' | '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' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
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" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
22
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "pattern" | "max" | "min" | "type" | "onCompositionEnd" | "onCompositionStart" | "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;
|
|
@@ -105,7 +105,9 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
105
105
|
autoCapitalize: props.autoCapitalize,
|
|
106
106
|
autoCorrect: props.autoCorrect,
|
|
107
107
|
onKeyDown: handleKeydown,
|
|
108
|
-
onKeyUp: props.onKeyUp
|
|
108
|
+
onKeyUp: props.onKeyUp,
|
|
109
|
+
onCompositionStart: props.onCompositionStart,
|
|
110
|
+
onCompositionEnd: props.onCompositionEnd
|
|
109
111
|
}), props.clearable && !!value && _react.default.createElement("div", {
|
|
110
112
|
className: `${classPrefix}-clear`,
|
|
111
113
|
onMouseDown: e => {
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
opacity: 0.4;
|
|
84
84
|
pointer-events: none;
|
|
85
85
|
}
|
|
86
|
-
a.adm-list-item:active {
|
|
86
|
+
a.adm-list-item:active:not(.adm-list-item-disabled) {
|
|
87
87
|
background-color: var(--active-background-color);
|
|
88
88
|
}
|
|
89
|
-
a.adm-list-item:active::after {
|
|
89
|
+
a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
90
90
|
content: ' ';
|
|
91
91
|
display: block;
|
|
92
92
|
position: absolute;
|
|
@@ -95,6 +95,3 @@ a.adm-list-item:active::after {
|
|
|
95
95
|
left: 0;
|
|
96
96
|
border-bottom: var(--border-inner);
|
|
97
97
|
}
|
|
98
|
-
a.adm-list-item.adm-list-item-disabled:active {
|
|
99
|
-
background-color: unset;
|
|
100
|
-
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
.adm-picker {
|
|
2
|
+
--header-button-font-size: 15px;
|
|
3
|
+
--title-font-size: 15px;
|
|
4
|
+
--item-font-size: 16px;
|
|
2
5
|
width: 100%;
|
|
3
6
|
height: 300px;
|
|
4
7
|
overflow: hidden;
|
|
5
8
|
position: relative;
|
|
6
9
|
display: flex;
|
|
7
10
|
flex-direction: column;
|
|
11
|
+
---item-font-size: var(--item-font-size);
|
|
12
|
+
}
|
|
13
|
+
.adm-picker .adm-picker-view.adm-picker-view {
|
|
14
|
+
--item-font-size: var(---item-font-size);
|
|
8
15
|
}
|
|
9
16
|
.adm-picker-header {
|
|
10
17
|
flex: none;
|
|
@@ -15,13 +22,13 @@
|
|
|
15
22
|
padding: 4px 4px;
|
|
16
23
|
}
|
|
17
24
|
.adm-picker-header-button {
|
|
18
|
-
font-size:
|
|
25
|
+
font-size: var(--header-button-font-size);
|
|
19
26
|
display: inline-block;
|
|
20
27
|
padding: 8px 8px;
|
|
21
28
|
}
|
|
22
29
|
.adm-picker-header-title {
|
|
23
30
|
padding: 4px 4px;
|
|
24
|
-
font-size:
|
|
31
|
+
font-size: var(--title-font-size);
|
|
25
32
|
color: var(--adm-color-text);
|
|
26
33
|
text-align: center;
|
|
27
34
|
flex: 1;
|
|
@@ -15,5 +15,5 @@ export declare type PickerProps = {
|
|
|
15
15
|
confirmText?: ReactNode;
|
|
16
16
|
cancelText?: ReactNode;
|
|
17
17
|
children?: (items: (PickerColumnItem | null)[]) => ReactNode;
|
|
18
|
-
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps
|
|
18
|
+
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size'>;
|
|
19
19
|
export declare const Picker: React.NamedExoticComponent<PickerProps>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.adm-picker-view {
|
|
2
2
|
--height: 240px;
|
|
3
|
+
--item-font-size: 16px;
|
|
3
4
|
height: var(--height);
|
|
4
5
|
width: 100%;
|
|
5
6
|
display: flex;
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
bottom: -100vh;
|
|
40
41
|
}
|
|
41
42
|
.adm-picker-view-column-item {
|
|
42
|
-
font-size:
|
|
43
|
+
font-size: var(--item-font-size);
|
|
43
44
|
padding: 0 6px;
|
|
44
45
|
height: 34px;
|
|
45
46
|
display: flex;
|
|
@@ -14,5 +14,5 @@ export declare type PickerViewProps = {
|
|
|
14
14
|
value?: PickerValue[];
|
|
15
15
|
defaultValue?: PickerValue[];
|
|
16
16
|
onChange?: (value: PickerValue[], extend: PickerValueExtend) => void;
|
|
17
|
-
} & NativeProps<'--height'>;
|
|
17
|
+
} & NativeProps<'--height' | '--item-font-size'>;
|
|
18
18
|
export declare const PickerView: React.NamedExoticComponent<PickerViewProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Arrow = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
|
|
12
|
+
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
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
const Arrow = (0, _react.memo)(props => {
|
|
17
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
18
|
+
viewBox: '0 0 30 16'
|
|
19
|
+
}, _react.default.createElement("g", {
|
|
20
|
+
transform: 'translate(-1300.000000, -841.000000)',
|
|
21
|
+
fill: 'currentColor'
|
|
22
|
+
}, _react.default.createElement("path", {
|
|
23
|
+
d: 'M1300,841 L1330,841 L1318.07289,855.312538 C1316.65863,857.009645 1314.13637,857.238942 1312.43926,855.824685 C1312.25341,855.669808 1312.08199,855.49839 1311.92711,855.312538 L1300,841 L1300,841 Z'
|
|
24
|
+
}))));
|
|
25
|
+
});
|
|
26
|
+
exports.Arrow = Arrow;
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './popover.less';
|
|
3
|
-
|
|
4
|
-
export type {
|
|
3
|
+
import './popover-menu.less';
|
|
4
|
+
export type { PopoverProps, PopoverRef } from './popover';
|
|
5
|
+
export type { PopoverMenuProps, Action } from './popover-menu';
|
|
5
6
|
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
-
getContainer?: (() => HTMLElement) | undefined;
|
|
7
|
+
getContainer?: HTMLElement | (() => HTMLElement) | null | undefined;
|
|
7
8
|
destroyOnHide?: boolean | undefined;
|
|
8
9
|
children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
9
10
|
mode?: "dark" | "light" | undefined;
|
|
10
11
|
trigger?: "click" | undefined;
|
|
11
|
-
placement
|
|
12
|
+
placement?: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
|
|
12
13
|
stopPropagation?: "click"[] | undefined;
|
|
13
|
-
} & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & import("../../utils/native-props").NativeProps<"--z-index"> & {
|
|
14
14
|
content: import("react").ReactNode;
|
|
15
|
-
} & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
16
|
-
Menu: <T extends import("./
|
|
17
|
-
getContainer?: (() => HTMLElement) | undefined;
|
|
18
|
-
destroyOnHide?: boolean | undefined;
|
|
19
|
-
children: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
20
|
-
mode?: "dark" | "light" | undefined;
|
|
21
|
-
trigger?: "click" | undefined;
|
|
22
|
-
placement: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
|
|
23
|
-
stopPropagation?: "click"[] | undefined;
|
|
24
|
-
} & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & import("../../utils/native-props").NativeProps<"--z-index"> & {
|
|
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: <T extends import("./popover-menu").Action = import("./popover-menu").Action>(props: Pick<import("./popover").PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "trigger" | "defaultVisible" | "onVisibleChange" | "placement" | "destroyOnHide"> & {
|
|
25
17
|
actions: T[];
|
|
26
18
|
onAction?: ((text: T) => void) | undefined;
|
|
27
19
|
} & {
|
|
@@ -7,14 +7,16 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
require("./popover.css");
|
|
9
9
|
|
|
10
|
+
require("./popover-menu.css");
|
|
11
|
+
|
|
10
12
|
var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
|
|
11
13
|
|
|
12
|
-
var
|
|
14
|
+
var _popoverMenu2 = require("./popover-menu");
|
|
13
15
|
|
|
14
16
|
var _popover2 = require("./popover");
|
|
15
17
|
|
|
16
18
|
var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_popover2.Popover, {
|
|
17
|
-
Menu:
|
|
19
|
+
Menu: _popoverMenu2.PopoverMenu
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
exports.default = _default;
|