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
|
@@ -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>;
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
.adm-form-item-label-required {
|
|
14
14
|
position: absolute;
|
|
15
15
|
left: -0.6em;
|
|
16
|
-
top: 0
|
|
16
|
+
top: 0;
|
|
17
|
+
font-family: SimSun, sans-serif;
|
|
17
18
|
color: var(--adm-color-danger);
|
|
18
19
|
user-select: none;
|
|
19
20
|
}
|
|
@@ -27,8 +28,8 @@
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
.adm-form-vertical .adm-form-item-label {
|
|
30
|
-
margin-bottom: 8px;
|
|
31
31
|
font-size: 30px;
|
|
32
|
+
margin-bottom: 8px;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
.adm-form-vertical .adm-form-item-footer {
|
|
@@ -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: 32px;
|
|
3
|
+
--padding-right: 24px;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.adm-form-horizontal .adm-list.adm-list {
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.adm-form .adm-form-footer {
|
|
16
|
-
padding: 24px;
|
|
16
|
+
padding: 40px 24px;
|
|
17
17
|
}
|
|
@@ -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: 32px;
|
|
3
|
+
--padding-right: 24px;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.adm-form-horizontal .adm-list.adm-list {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.adm-form .adm-form-footer {
|
|
16
|
-
padding: 24px;
|
|
16
|
+
padding: 40px 24px;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.adm-form-item + .adm-form-item {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
.adm-form-item-label-required {
|
|
32
32
|
position: absolute;
|
|
33
33
|
left: -0.6em;
|
|
34
|
-
top: 0
|
|
34
|
+
top: 0;
|
|
35
|
+
font-family: SimSun, sans-serif;
|
|
35
36
|
color: var(--adm-color-danger);
|
|
36
37
|
user-select: none;
|
|
37
38
|
}
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
.adm-form-vertical .adm-form-item-label {
|
|
48
|
-
margin-bottom: 8px;
|
|
49
49
|
font-size: 30px;
|
|
50
|
+
margin-bottom: 8px;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
.adm-form-vertical .adm-form-item-footer {
|
|
@@ -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 => {
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
pointer-events: none;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
a.adm-list-item:active {
|
|
102
|
+
a.adm-list-item:active:not(.adm-list-item-disabled) {
|
|
103
103
|
background-color: var(--active-background-color);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
a.adm-list-item:active::after {
|
|
106
|
+
a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
107
107
|
content: ' ';
|
|
108
108
|
display: block;
|
|
109
109
|
position: absolute;
|
|
@@ -111,8 +111,4 @@ a.adm-list-item:active::after {
|
|
|
111
111
|
bottom: -2px;
|
|
112
112
|
left: 0;
|
|
113
113
|
border-bottom: var(--border-inner);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
a.adm-list-item.adm-list-item-disabled:active {
|
|
117
|
-
background-color: unset;
|
|
118
114
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
.adm-picker {
|
|
2
|
+
--header-button-font-size: 30px;
|
|
3
|
+
--title-font-size: 30px;
|
|
4
|
+
--item-font-size: 32px;
|
|
2
5
|
width: 100%;
|
|
3
6
|
height: 600px;
|
|
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
|
+
|
|
14
|
+
.adm-picker .adm-picker-view.adm-picker-view {
|
|
15
|
+
--item-font-size: var(---item-font-size);
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
.adm-picker-header {
|
|
@@ -17,14 +25,14 @@
|
|
|
17
25
|
}
|
|
18
26
|
|
|
19
27
|
.adm-picker-header-button {
|
|
20
|
-
font-size:
|
|
28
|
+
font-size: var(--header-button-font-size);
|
|
21
29
|
display: inline-block;
|
|
22
30
|
padding: 16px 16px;
|
|
23
31
|
}
|
|
24
32
|
|
|
25
33
|
.adm-picker-header-title {
|
|
26
34
|
padding: 8px 8px;
|
|
27
|
-
font-size:
|
|
35
|
+
font-size: var(--title-font-size);
|
|
28
36
|
color: var(--adm-color-text);
|
|
29
37
|
text-align: center;
|
|
30
38
|
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: 480px;
|
|
3
|
+
--item-font-size: 32px;
|
|
3
4
|
height: var(--height);
|
|
4
5
|
width: 100%;
|
|
5
6
|
display: flex;
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.adm-picker-view-column-item {
|
|
47
|
-
font-size:
|
|
48
|
+
font-size: var(--item-font-size);
|
|
48
49
|
padding: 0 12px;
|
|
49
50
|
height: 68px;
|
|
50
51
|
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
|
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.adm-popover-menu {
|
|
2
|
+
--border-color: var(--adm-border-color);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.adm-popover-menu.adm-popover {
|
|
6
|
+
--content-padding: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.adm-popover-menu-list {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
min-width: 240px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.adm-popover-menu-list-inner {
|
|
15
|
+
margin-top: -2px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.adm-popover-menu-item {
|
|
19
|
+
display: flex;
|
|
20
|
+
padding-left: 40px;
|
|
21
|
+
justify-content: flex-start;
|
|
22
|
+
align-items: center;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.adm-popover-menu-item-icon {
|
|
27
|
+
flex: none;
|
|
28
|
+
padding-right: 16px;
|
|
29
|
+
font-size: 40px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.adm-popover-menu-item-text {
|
|
33
|
+
flex: auto;
|
|
34
|
+
padding: 28px 40px 28px 0;
|
|
35
|
+
border-top: solid 2px var(--border-color);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.adm-popover-menu-item-disabled {
|
|
39
|
+
cursor: not-allowed;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.adm-popover-menu-item-disabled > * {
|
|
43
|
+
opacity: 0.4;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.adm-popover-menu-item:active:not(.adm-popover-menu-item-disabled) {
|
|
47
|
+
background-color: var(--border-color);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.adm-popover-menu-item:active:not(.adm-popover-menu-item-disabled)::after {
|
|
51
|
+
content: ' ';
|
|
52
|
+
display: block;
|
|
53
|
+
position: absolute;
|
|
54
|
+
width: 100%;
|
|
55
|
+
bottom: -2px;
|
|
56
|
+
left: 0;
|
|
57
|
+
border-bottom: solid 2px var(--border-color);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.adm-popover.adm-popover-dark.adm-popover-menu {
|
|
61
|
+
--border-color: #333333;
|
|
62
|
+
--background: rgba(0, 0, 0, 0.9);
|
|
63
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ReactElement, Ref } from 'react';
|
|
2
|
+
import { PopoverProps, PopoverRef } from './popover';
|
|
3
|
+
export declare type Action = {
|
|
4
|
+
text: React.ReactNode;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
key?: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
export declare type PopoverMenuProps<T> = Omit<PopoverProps, 'content'> & {
|
|
12
|
+
actions: T[];
|
|
13
|
+
onAction?: (text: T) => void;
|
|
14
|
+
};
|
|
15
|
+
export declare const PopoverMenu: <T extends Action = Action>(props: Pick<PopoverProps, "children" | "style" | "visible" | "className" | "tabIndex" | "mode" | "align" | "getContainer" | "stopPropagation" | "trigger" | "defaultVisible" | "onVisibleChange" | "placement" | "destroyOnHide"> & {
|
|
16
|
+
actions: T[];
|
|
17
|
+
onAction?: ((text: T) => void) | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
|
|
20
|
+
}) => ReactElement;
|