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,4 +1,4 @@
|
|
|
1
|
-
.adm-text-area
|
|
1
|
+
.adm-text-area {
|
|
2
2
|
--font-size: 17px;
|
|
3
3
|
--color: var(--adm-color-text);
|
|
4
4
|
--placeholder-color: var(--adm-color-light);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
max-width: 100%;
|
|
8
8
|
max-height: 100%;
|
|
9
9
|
}
|
|
10
|
-
.adm-text-area {
|
|
10
|
+
.adm-text-area-element {
|
|
11
11
|
font-family: var(--adm-font-family);
|
|
12
12
|
resize: none;
|
|
13
13
|
flex: auto;
|
|
@@ -27,29 +27,29 @@
|
|
|
27
27
|
appearance: none;
|
|
28
28
|
min-height: 1.5em;
|
|
29
29
|
}
|
|
30
|
-
.adm-text-area::placeholder {
|
|
30
|
+
.adm-text-area-element::placeholder {
|
|
31
31
|
color: var(--placeholder-color);
|
|
32
32
|
font-family: inherit;
|
|
33
33
|
}
|
|
34
|
-
.adm-text-area:-webkit-autofill {
|
|
34
|
+
.adm-text-area-element:-webkit-autofill {
|
|
35
35
|
background-color: transparent;
|
|
36
36
|
}
|
|
37
|
-
.adm-text-area:disabled {
|
|
37
|
+
.adm-text-area-element:disabled {
|
|
38
38
|
color: var(--disabled-color);
|
|
39
39
|
cursor: not-allowed;
|
|
40
40
|
opacity: 1;
|
|
41
41
|
-webkit-text-fill-color: var(--disabled-color);
|
|
42
42
|
}
|
|
43
|
-
.adm-text-area:read-only {
|
|
43
|
+
.adm-text-area-element:read-only {
|
|
44
44
|
cursor: default;
|
|
45
45
|
}
|
|
46
|
-
.adm-text-area:invalid {
|
|
46
|
+
.adm-text-area-element:invalid {
|
|
47
47
|
box-shadow: none;
|
|
48
48
|
}
|
|
49
|
-
.adm-text-area::-ms-clear {
|
|
49
|
+
.adm-text-area-element::-ms-clear {
|
|
50
50
|
display: none;
|
|
51
51
|
}
|
|
52
|
-
.adm-text-area[readonly] {
|
|
52
|
+
.adm-text-area-element[readonly] {
|
|
53
53
|
pointer-events: none;
|
|
54
54
|
}
|
|
55
55
|
.adm-text-area-count {
|
|
@@ -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;
|
|
@@ -5,18 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.TextArea = void 0;
|
|
7
7
|
|
|
8
|
-
var _tslib = require("tslib");
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
9
|
|
|
12
|
-
var
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
13
11
|
|
|
14
12
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
15
13
|
|
|
16
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
15
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
17
|
|
|
22
18
|
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,16 +27,10 @@ const defaultProps = {
|
|
|
31
27
|
const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
32
28
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
33
29
|
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onChange: outerOnChange,
|
|
39
|
-
rows: rows,
|
|
40
|
-
autoSize: autoSize,
|
|
41
|
-
showCount
|
|
42
|
-
} = props,
|
|
43
|
-
textAreaProps = (0, _tslib.__rest)(props, ["className", "style", "defaultValue", "value", "onChange", "rows", "autoSize", "showCount"]);
|
|
30
|
+
autoSize,
|
|
31
|
+
showCount,
|
|
32
|
+
maxLength
|
|
33
|
+
} = props;
|
|
44
34
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
45
35
|
const nativeTextAreaRef = (0, _react.useRef)(null);
|
|
46
36
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
@@ -80,40 +70,58 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
80
70
|
|
|
81
71
|
textArea.style.height = `${height}px`;
|
|
82
72
|
}, [value, autoSize]);
|
|
73
|
+
const compositingRef = (0, _react.useRef)(false);
|
|
83
74
|
let count;
|
|
75
|
+
const valueLength = [...value].length;
|
|
84
76
|
|
|
85
77
|
if (typeof showCount === 'function') {
|
|
86
|
-
count = showCount(
|
|
78
|
+
count = showCount(valueLength, maxLength);
|
|
87
79
|
} else if (showCount) {
|
|
88
80
|
count = _react.default.createElement("div", {
|
|
89
81
|
className: `${classPrefix}-count`
|
|
90
|
-
},
|
|
82
|
+
}, maxLength === undefined ? valueLength : valueLength + '/' + maxLength);
|
|
91
83
|
}
|
|
92
84
|
|
|
93
|
-
return _react.default.createElement("div", {
|
|
94
|
-
className:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
className: classPrefix,
|
|
100
|
-
rows: rows,
|
|
85
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
86
|
+
className: classPrefix
|
|
87
|
+
}, _react.default.createElement("textarea", {
|
|
88
|
+
ref: nativeTextAreaRef,
|
|
89
|
+
className: `${classPrefix}-element`,
|
|
90
|
+
rows: props.rows,
|
|
101
91
|
value: value,
|
|
102
92
|
onChange: e => {
|
|
103
|
-
|
|
93
|
+
let v = e.target.value;
|
|
94
|
+
|
|
95
|
+
if (maxLength && !compositingRef.current) {
|
|
96
|
+
v = [...v].slice(0, maxLength).join('');
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setValue(v);
|
|
104
100
|
},
|
|
105
|
-
|
|
101
|
+
id: props.id,
|
|
102
|
+
onCompositionStart: e => {
|
|
106
103
|
var _a;
|
|
107
104
|
|
|
108
|
-
|
|
105
|
+
compositingRef.current = true;
|
|
106
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
109
107
|
},
|
|
110
|
-
|
|
108
|
+
onCompositionEnd: e => {
|
|
111
109
|
var _a;
|
|
112
110
|
|
|
113
|
-
|
|
111
|
+
compositingRef.current = false;
|
|
112
|
+
|
|
113
|
+
if (maxLength) {
|
|
114
|
+
setValue([...value].slice(0, maxLength).join(''));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
114
118
|
},
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
autoComplete: props.autoComplete,
|
|
120
|
+
disabled: props.disabled,
|
|
121
|
+
readOnly: props.readOnly,
|
|
122
|
+
onFocus: props.onFocus,
|
|
123
|
+
onBlur: props.onBlur
|
|
124
|
+
}), count));
|
|
117
125
|
});
|
|
118
126
|
exports.TextArea = TextArea;
|
|
119
127
|
TextArea.defaultProps = defaultProps;
|
|
@@ -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 {};
|
|
@@ -25,7 +25,8 @@ const FormItemLayout = props => {
|
|
|
25
25
|
children,
|
|
26
26
|
htmlFor,
|
|
27
27
|
hidden,
|
|
28
|
-
errors
|
|
28
|
+
errors,
|
|
29
|
+
arrow
|
|
29
30
|
} = props;
|
|
30
31
|
const context = useContext(FormContext);
|
|
31
32
|
const hasFeedback = props.hasFeedback !== undefined ? props.hasFeedback : context.hasFeedback;
|
|
@@ -52,7 +53,8 @@ const FormItemLayout = props => {
|
|
|
52
53
|
[`${classPrefix}-hidden`]: hidden
|
|
53
54
|
}),
|
|
54
55
|
disabled: disabled,
|
|
55
|
-
onClick: props.onClick
|
|
56
|
+
onClick: props.onClick,
|
|
57
|
+
arrow: arrow
|
|
56
58
|
}, children);
|
|
57
59
|
};
|
|
58
60
|
|
|
@@ -80,9 +82,10 @@ export const FormItem = props => {
|
|
|
80
82
|
validateTrigger,
|
|
81
83
|
onClick,
|
|
82
84
|
shouldUpdate,
|
|
83
|
-
dependencies
|
|
85
|
+
dependencies,
|
|
86
|
+
arrow
|
|
84
87
|
} = props,
|
|
85
|
-
fieldProps = __rest(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies"]);
|
|
88
|
+
fieldProps = __rest(props, ["className", "style", "label", "help", "extra", "hasFeedback", "name", "required", "noStyle", "hidden", "layout", "disabled", "rules", "children", "messageVariables", "trigger", "validateTrigger", "onClick", "shouldUpdate", "dependencies", "arrow"]);
|
|
86
89
|
|
|
87
90
|
const {
|
|
88
91
|
validateTrigger: contextValidateTrigger
|
|
@@ -138,7 +141,8 @@ export const FormItem = props => {
|
|
|
138
141
|
errors: errors,
|
|
139
142
|
onClick: onClick,
|
|
140
143
|
hidden: hidden,
|
|
141
|
-
layout: layout
|
|
144
|
+
layout: layout,
|
|
145
|
+
arrow: arrow
|
|
142
146
|
}, React.createElement(NoStyleItemContext.Provider, {
|
|
143
147
|
value: onSubMetaChange
|
|
144
148
|
}, 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;
|
|
@@ -86,7 +86,9 @@ export const Input = forwardRef((p, ref) => {
|
|
|
86
86
|
autoCapitalize: props.autoCapitalize,
|
|
87
87
|
autoCorrect: props.autoCorrect,
|
|
88
88
|
onKeyDown: handleKeydown,
|
|
89
|
-
onKeyUp: props.onKeyUp
|
|
89
|
+
onKeyUp: props.onKeyUp,
|
|
90
|
+
onCompositionStart: props.onCompositionStart,
|
|
91
|
+
onCompositionEnd: props.onCompositionEnd
|
|
90
92
|
}), props.clearable && !!value && React.createElement("div", {
|
|
91
93
|
className: `${classPrefix}-clear`,
|
|
92
94
|
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,12 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
+
export const Arrow = memo(props => {
|
|
4
|
+
return withNativeProps(props, React.createElement("svg", {
|
|
5
|
+
viewBox: '0 0 30 16'
|
|
6
|
+
}, React.createElement("g", {
|
|
7
|
+
transform: 'translate(-1300.000000, -841.000000)',
|
|
8
|
+
fill: 'currentColor'
|
|
9
|
+
}, React.createElement("path", {
|
|
10
|
+
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'
|
|
11
|
+
}))));
|
|
12
|
+
});
|
|
@@ -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
|
} & {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./popover.css";
|
|
2
|
+
import "./popover-menu.css";
|
|
2
3
|
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component';
|
|
3
|
-
import {
|
|
4
|
+
import { PopoverMenu } from './popover-menu';
|
|
4
5
|
import { Popover } from './popover';
|
|
5
6
|
export default attachPropertiesToComponent(Popover, {
|
|
6
|
-
Menu:
|
|
7
|
+
Menu: PopoverMenu
|
|
7
8
|
});
|