antd-mobile 5.29.1 → 5.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/README.md +1 -1
- package/2x/bundle/antd-mobile.cjs.development.js +3919 -3845
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +3907 -3833
- package/2x/bundle/antd-mobile.es.js +7782 -7731
- package/2x/bundle/antd-mobile.umd.development.js +3919 -3845
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +4 -2
- package/2x/cjs/components/avatar/avatar.js +1 -1
- package/2x/cjs/components/button/button.d.ts +2 -2
- package/2x/cjs/components/cascader/cascader.js +1 -6
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
- package/2x/cjs/components/collapse/collapse.js +3 -1
- package/2x/cjs/components/date-picker/date-picker-date-utils.d.ts +1 -1
- package/2x/cjs/components/date-picker/date-picker-utils.d.ts +1 -1
- package/2x/cjs/components/date-picker/date-picker-week-utils.d.ts +1 -1
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/2x/cjs/components/date-picker/index.d.ts +1 -1
- package/2x/cjs/components/dropdown/dropdown.d.ts +3 -0
- package/2x/cjs/components/dropdown/dropdown.js +4 -1
- package/2x/cjs/components/dropdown/index.d.ts +1 -0
- package/2x/cjs/components/ellipsis/ellipsis.d.ts +2 -2
- package/2x/cjs/components/ellipsis/ellipsis.js +18 -18
- package/2x/cjs/components/footer/footer.css +1 -1
- package/2x/cjs/components/form/form-subscribe.js +4 -1
- package/2x/cjs/components/form/form.js +1 -1
- package/2x/cjs/components/form/index.d.ts +1 -1
- package/2x/cjs/components/image/image.d.ts +1 -1
- package/2x/cjs/components/image/image.js +10 -0
- package/2x/cjs/components/image-uploader/image-uploader.js +4 -5
- package/2x/cjs/components/input/input.d.ts +2 -4
- package/2x/cjs/components/list/list-item.d.ts +1 -1
- package/2x/cjs/components/notice-bar/notice-bar.d.ts +2 -0
- package/2x/cjs/components/notice-bar/notice-bar.js +2 -1
- package/2x/cjs/components/page-indicator/page-indicator.css +1 -1
- package/2x/cjs/components/picker-view/picker-view.d.ts +2 -2
- package/2x/cjs/components/popup/popup.d.ts +1 -0
- package/2x/cjs/components/popup/popup.js +29 -16
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +4 -2
- package/2x/cjs/components/search-bar/search-bar.d.ts +2 -2
- package/2x/cjs/components/search-bar/search-bar.js +6 -2
- package/2x/cjs/components/slider/slider.js +6 -4
- package/2x/cjs/components/steps/steps.css +2 -0
- package/2x/cjs/components/swiper/swiper.js +21 -15
- package/2x/cjs/components/text-area/text-area.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.js +5 -3
- package/2x/cjs/utils/reduce-and-restore-motion.js +1 -1
- package/2x/es/components/avatar/avatar.js +1 -1
- package/2x/es/components/button/button.d.ts +2 -2
- package/2x/es/components/cascader/cascader.js +1 -6
- package/2x/es/components/cascader-view/cascader-view.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.js +2 -1
- package/2x/es/components/collapse/collapse.js +3 -1
- package/2x/es/components/date-picker/date-picker-date-utils.d.ts +1 -1
- package/2x/es/components/date-picker/date-picker-utils.d.ts +1 -1
- package/2x/es/components/date-picker/date-picker-week-utils.d.ts +1 -1
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- package/2x/es/components/date-picker/index.d.ts +1 -1
- package/2x/es/components/dropdown/dropdown.d.ts +3 -0
- package/2x/es/components/dropdown/dropdown.js +4 -1
- package/2x/es/components/dropdown/index.d.ts +1 -0
- package/2x/es/components/ellipsis/ellipsis.d.ts +2 -2
- package/2x/es/components/ellipsis/ellipsis.js +18 -18
- package/2x/es/components/footer/footer.css +1 -1
- package/2x/es/components/form/form-subscribe.js +4 -1
- package/2x/es/components/form/form.js +1 -1
- package/2x/es/components/form/index.d.ts +1 -1
- package/2x/es/components/image/image.d.ts +1 -1
- package/2x/es/components/image/image.js +11 -1
- package/2x/es/components/image-uploader/image-uploader.js +4 -5
- package/2x/es/components/input/input.d.ts +2 -4
- package/2x/es/components/list/list-item.d.ts +1 -1
- package/2x/es/components/notice-bar/notice-bar.d.ts +2 -0
- package/2x/es/components/notice-bar/notice-bar.js +2 -1
- package/2x/es/components/page-indicator/page-indicator.css +1 -1
- package/2x/es/components/picker-view/picker-view.d.ts +2 -2
- package/2x/es/components/popup/popup.d.ts +1 -0
- package/2x/es/components/popup/popup.js +29 -16
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +4 -2
- package/2x/es/components/search-bar/search-bar.d.ts +2 -2
- package/2x/es/components/search-bar/search-bar.js +6 -2
- package/2x/es/components/slider/slider.js +6 -4
- package/2x/es/components/steps/steps.css +2 -0
- package/2x/es/components/swiper/swiper.js +22 -16
- package/2x/es/components/text-area/text-area.d.ts +1 -1
- package/2x/es/components/text-area/text-area.js +4 -3
- package/2x/es/utils/reduce-and-restore-motion.js +1 -1
- package/2x/package.json +10 -10
- package/README.md +1 -1
- package/bundle/antd-mobile.cjs.development.js +3919 -3845
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +3907 -3833
- package/bundle/antd-mobile.es.js +7782 -7731
- package/bundle/antd-mobile.umd.development.js +3919 -3845
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/style.css +1 -1
- package/cjs/components/avatar/avatar.js +1 -1
- package/cjs/components/button/button.d.ts +2 -2
- package/cjs/components/cascader/cascader.js +1 -6
- package/cjs/components/cascader-view/cascader-view.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.js +2 -1
- package/cjs/components/collapse/collapse.js +3 -1
- package/cjs/components/date-picker/date-picker-date-utils.d.ts +1 -1
- package/cjs/components/date-picker/date-picker-utils.d.ts +1 -1
- package/cjs/components/date-picker/date-picker-week-utils.d.ts +1 -1
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/cjs/components/date-picker/index.d.ts +1 -1
- package/cjs/components/dropdown/dropdown.d.ts +3 -0
- package/cjs/components/dropdown/dropdown.js +4 -1
- package/cjs/components/dropdown/index.d.ts +1 -0
- package/cjs/components/ellipsis/ellipsis.d.ts +2 -2
- package/cjs/components/ellipsis/ellipsis.js +18 -18
- package/cjs/components/footer/footer.css +1 -1
- package/cjs/components/form/form-subscribe.js +4 -1
- package/cjs/components/form/form.js +1 -1
- package/cjs/components/form/index.d.ts +1 -1
- package/cjs/components/image/image.d.ts +1 -1
- package/cjs/components/image/image.js +10 -0
- package/cjs/components/image-uploader/image-uploader.js +4 -5
- package/cjs/components/input/input.d.ts +2 -4
- package/cjs/components/list/list-item.d.ts +1 -1
- package/cjs/components/notice-bar/notice-bar.d.ts +2 -0
- package/cjs/components/notice-bar/notice-bar.js +2 -1
- package/cjs/components/page-indicator/page-indicator.css +1 -1
- package/cjs/components/picker-view/picker-view.d.ts +2 -2
- package/cjs/components/popup/popup.d.ts +1 -0
- package/cjs/components/popup/popup.js +29 -16
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +4 -2
- package/cjs/components/search-bar/search-bar.d.ts +2 -2
- package/cjs/components/search-bar/search-bar.js +6 -2
- package/cjs/components/slider/slider.js +6 -4
- package/cjs/components/steps/steps.css +2 -0
- package/cjs/components/swiper/swiper.js +21 -15
- package/cjs/components/text-area/text-area.d.ts +1 -1
- package/cjs/components/text-area/text-area.js +5 -3
- package/cjs/utils/reduce-and-restore-motion.js +1 -1
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/button/button.d.ts +2 -2
- package/es/components/cascader/cascader.js +1 -6
- package/es/components/cascader-view/cascader-view.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.js +2 -1
- package/es/components/collapse/collapse.js +3 -1
- package/es/components/date-picker/date-picker-date-utils.d.ts +1 -1
- package/es/components/date-picker/date-picker-utils.d.ts +1 -1
- package/es/components/date-picker/date-picker-week-utils.d.ts +1 -1
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/dropdown/dropdown.d.ts +3 -0
- package/es/components/dropdown/dropdown.js +4 -1
- package/es/components/dropdown/index.d.ts +1 -0
- package/es/components/ellipsis/ellipsis.d.ts +2 -2
- package/es/components/ellipsis/ellipsis.js +18 -18
- package/es/components/footer/footer.css +1 -1
- package/es/components/form/form-subscribe.js +4 -1
- package/es/components/form/form.js +1 -1
- package/es/components/form/index.d.ts +1 -1
- package/es/components/image/image.d.ts +1 -1
- package/es/components/image/image.js +11 -1
- package/es/components/image-uploader/image-uploader.js +4 -5
- package/es/components/input/input.d.ts +2 -4
- package/es/components/list/list-item.d.ts +1 -1
- package/es/components/notice-bar/notice-bar.d.ts +2 -0
- package/es/components/notice-bar/notice-bar.js +2 -1
- package/es/components/page-indicator/page-indicator.css +1 -1
- package/es/components/picker-view/picker-view.d.ts +2 -2
- package/es/components/popup/popup.d.ts +1 -0
- package/es/components/popup/popup.js +29 -16
- package/es/components/pull-to-refresh/pull-to-refresh.js +4 -2
- package/es/components/search-bar/search-bar.d.ts +2 -2
- package/es/components/search-bar/search-bar.js +6 -2
- package/es/components/slider/slider.js +6 -4
- package/es/components/steps/steps.css +2 -0
- package/es/components/swiper/swiper.js +22 -16
- package/es/components/text-area/text-area.d.ts +1 -1
- package/es/components/text-area/text-area.js +4 -3
- package/es/utils/reduce-and-restore-motion.js +1 -1
- package/package.json +10 -10
- package/umd/antd-mobile.js +1 -1
|
@@ -5,8 +5,8 @@ export declare type EllipsisProps = {
|
|
|
5
5
|
content: string;
|
|
6
6
|
direction?: 'start' | 'end' | 'middle';
|
|
7
7
|
rows?: number;
|
|
8
|
-
expandText?:
|
|
9
|
-
collapseText?:
|
|
8
|
+
expandText?: React.ReactNode;
|
|
9
|
+
collapseText?: React.ReactNode;
|
|
10
10
|
stopPropagationForActionButtons?: PropagationEvent[];
|
|
11
11
|
onContentClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
12
12
|
defaultExpanded?: boolean;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Ellipsis = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _runes = _interopRequireDefault(require("
|
|
8
|
+
var _runes = _interopRequireDefault(require("runes2"));
|
|
9
9
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
10
10
|
var _nativeProps = require("../../utils/native-props");
|
|
11
11
|
var _useResizeEffect = require("../../utils/use-resize-effect");
|
|
@@ -28,6 +28,8 @@ const defaultProps = {
|
|
|
28
28
|
const Ellipsis = p => {
|
|
29
29
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
30
30
|
const rootRef = (0, _react.useRef)(null);
|
|
31
|
+
const expandElRef = (0, _react.useRef)(null);
|
|
32
|
+
const collapseElRef = (0, _react.useRef)(null);
|
|
31
33
|
const [ellipsised, setEllipsised] = (0, _react.useState)({});
|
|
32
34
|
const [expanded, setExpanded] = (0, _react.useState)(props.defaultExpanded);
|
|
33
35
|
const [exceeded, setExceeded] = (0, _react.useState)(false);
|
|
@@ -36,19 +38,18 @@ const Ellipsis = p => {
|
|
|
36
38
|
return chars.slice(start, end).join('');
|
|
37
39
|
}
|
|
38
40
|
function calcEllipsised() {
|
|
41
|
+
var _a, _b;
|
|
39
42
|
const root = rootRef.current;
|
|
40
43
|
if (!root) return;
|
|
41
|
-
|
|
44
|
+
const originDisplay = root.style.display;
|
|
45
|
+
root.style.display = 'block';
|
|
42
46
|
const originStyle = window.getComputedStyle(root);
|
|
43
47
|
const container = document.createElement('div');
|
|
44
48
|
const styleNames = Array.prototype.slice.apply(originStyle);
|
|
45
49
|
styleNames.forEach(name => {
|
|
46
50
|
container.style.setProperty(name, originStyle.getPropertyValue(name));
|
|
47
51
|
});
|
|
48
|
-
|
|
49
|
-
container.style.left = '999999px';
|
|
50
|
-
container.style.top = '999999px';
|
|
51
|
-
container.style.zIndex = '-1000';
|
|
52
|
+
root.style.display = originDisplay;
|
|
52
53
|
container.style.height = 'auto';
|
|
53
54
|
container.style.minHeight = 'auto';
|
|
54
55
|
container.style.maxHeight = 'auto';
|
|
@@ -65,7 +66,9 @@ const Ellipsis = p => {
|
|
|
65
66
|
} else {
|
|
66
67
|
setExceeded(true);
|
|
67
68
|
const end = props.content.length;
|
|
68
|
-
const
|
|
69
|
+
const collapseEl = typeof props.collapseText === 'string' ? props.collapseText : (_a = collapseElRef.current) === null || _a === void 0 ? void 0 : _a.innerHTML;
|
|
70
|
+
const expandEl = typeof props.expandText === 'string' ? props.expandText : (_b = expandElRef.current) === null || _b === void 0 ? void 0 : _b.innerHTML;
|
|
71
|
+
const actionText = expanded ? collapseEl : expandEl;
|
|
69
72
|
function check(left, right) {
|
|
70
73
|
if (right - left <= 1) {
|
|
71
74
|
if (props.direction === 'end') {
|
|
@@ -80,9 +83,9 @@ const Ellipsis = p => {
|
|
|
80
83
|
}
|
|
81
84
|
const middle = Math.round((left + right) / 2);
|
|
82
85
|
if (props.direction === 'end') {
|
|
83
|
-
container.
|
|
86
|
+
container.innerHTML = getSubString(0, middle) + '...' + actionText;
|
|
84
87
|
} else {
|
|
85
|
-
container.
|
|
88
|
+
container.innerHTML = actionText + '...' + getSubString(middle, end);
|
|
86
89
|
}
|
|
87
90
|
if (container.offsetHeight <= maxHeight) {
|
|
88
91
|
if (props.direction === 'end') {
|
|
@@ -107,7 +110,7 @@ const Ellipsis = p => {
|
|
|
107
110
|
}
|
|
108
111
|
const leftPartMiddle = Math.floor((leftPart[0] + leftPart[1]) / 2);
|
|
109
112
|
const rightPartMiddle = Math.ceil((rightPart[0] + rightPart[1]) / 2);
|
|
110
|
-
container.
|
|
113
|
+
container.innerHTML = getSubString(0, leftPartMiddle) + '...' + actionText + '...' + getSubString(rightPartMiddle, end);
|
|
111
114
|
if (container.offsetHeight <= maxHeight) {
|
|
112
115
|
return checkMiddle([leftPartMiddle, leftPart[1]], [rightPart[0], rightPartMiddle]);
|
|
113
116
|
} else {
|
|
@@ -125,24 +128,21 @@ const Ellipsis = p => {
|
|
|
125
128
|
calcEllipsised();
|
|
126
129
|
}, [props.content, props.direction, props.rows, props.expandText, props.collapseText]);
|
|
127
130
|
const expandActionElement = exceeded && props.expandText ? (0, _withStopPropagation.withStopPropagation)(props.stopPropagationForActionButtons, _react.default.createElement("a", {
|
|
131
|
+
ref: expandElRef,
|
|
128
132
|
onClick: () => {
|
|
129
133
|
setExpanded(true);
|
|
130
134
|
}
|
|
131
135
|
}, props.expandText)) : null;
|
|
132
136
|
const collapseActionElement = exceeded && props.collapseText ? (0, _withStopPropagation.withStopPropagation)(props.stopPropagationForActionButtons, _react.default.createElement("a", {
|
|
137
|
+
ref: collapseElRef,
|
|
133
138
|
onClick: () => {
|
|
134
139
|
setExpanded(false);
|
|
135
140
|
}
|
|
136
141
|
}, props.collapseText)) : null;
|
|
137
142
|
const renderContent = () => {
|
|
138
|
-
if (!exceeded)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (expanded) {
|
|
142
|
-
return _react.default.createElement(_react.default.Fragment, null, props.content, collapseActionElement);
|
|
143
|
-
} else {
|
|
144
|
-
return _react.default.createElement(_react.default.Fragment, null, ellipsised.leading, expandActionElement, ellipsised.tailing);
|
|
145
|
-
}
|
|
143
|
+
if (!exceeded) return props.content;
|
|
144
|
+
if (expanded) return _react.default.createElement(_react.default.Fragment, null, props.content, collapseActionElement);
|
|
145
|
+
return _react.default.createElement(_react.default.Fragment, null, ellipsised.leading, expandActionElement, ellipsised.tailing);
|
|
146
146
|
};
|
|
147
147
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
148
148
|
ref: rootRef,
|
|
@@ -13,7 +13,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
13
13
|
const FormSubscribe = props => {
|
|
14
14
|
const update = (0, _ahooks.useUpdate)();
|
|
15
15
|
const form = (0, _react.useContext)(_rcFieldForm.FieldContext);
|
|
16
|
-
|
|
16
|
+
const value = form.getFieldsValue(props.to);
|
|
17
|
+
// Memo to avoid useless render
|
|
18
|
+
const childNode = _react.default.useMemo(() => props.children(value, form), [JSON.stringify(value)]);
|
|
19
|
+
return _react.default.createElement(_react.default.Fragment, null, childNode, props.to.map(namePath => _react.default.createElement(Watcher, {
|
|
17
20
|
key: namePath.toString(),
|
|
18
21
|
form: form,
|
|
19
22
|
namePath: namePath,
|
|
@@ -4,7 +4,7 @@ export declare type FormLayout = 'vertical' | 'horizontal';
|
|
|
4
4
|
export type { FormProps, FormInstance } from './form';
|
|
5
5
|
export type { FormItemProps } from './form-item';
|
|
6
6
|
export type { FormSubscribeProps } from './form-subscribe';
|
|
7
|
-
export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
|
|
7
|
+
export type { ValidateMessages, FieldData, NamePath, Rule, RuleObject, RuleRender, } from 'rc-field-form/es/interface';
|
|
8
8
|
export type { FormArrayField, FormArrayOperation, FormArrayProps, } from './form-array';
|
|
9
9
|
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
|
|
10
10
|
className?: string | undefined;
|
|
@@ -14,5 +14,5 @@ export declare type ImageProps = {
|
|
|
14
14
|
onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
15
15
|
onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
16
16
|
onContainerClick?: (event: React.MouseEvent<HTMLDivElement, Event>) => void;
|
|
17
|
-
} & NativeProps<'--width' | '--height'> & Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'crossOrigin' | 'decoding' | 'loading' | 'referrerPolicy' | 'sizes' | 'srcSet' | 'useMap'>;
|
|
17
|
+
} & NativeProps<'--width' | '--height'> & Pick<React.ImgHTMLAttributes<HTMLImageElement>, 'crossOrigin' | 'decoding' | 'loading' | 'referrerPolicy' | 'sizes' | 'srcSet' | 'useMap' | 'id'>;
|
|
18
18
|
export declare const Image: React.FC<ImageProps>;
|
|
@@ -32,6 +32,7 @@ const Image = (0, _stagedComponents.staged)(p => {
|
|
|
32
32
|
const [loaded, setLoaded] = (0, _react.useState)(false);
|
|
33
33
|
const [failed, setFailed] = (0, _react.useState)(false);
|
|
34
34
|
const ref = (0, _react.useRef)(null);
|
|
35
|
+
const imgRef = (0, _react.useRef)(null);
|
|
35
36
|
let src = props.src;
|
|
36
37
|
let srcSet = props.srcSet;
|
|
37
38
|
const [initialized, setInitialized] = (0, _react.useState)(!props.lazy);
|
|
@@ -41,11 +42,20 @@ const Image = (0, _stagedComponents.staged)(p => {
|
|
|
41
42
|
setLoaded(false);
|
|
42
43
|
setFailed(false);
|
|
43
44
|
}, [src]);
|
|
45
|
+
(0, _react.useEffect)(() => {
|
|
46
|
+
var _a;
|
|
47
|
+
// for nextjs ssr
|
|
48
|
+
if ((_a = imgRef.current) === null || _a === void 0 ? void 0 : _a.complete) {
|
|
49
|
+
setLoaded(true);
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
44
52
|
function renderInner() {
|
|
45
53
|
if (failed) {
|
|
46
54
|
return _react.default.createElement(_react.default.Fragment, null, props.fallback);
|
|
47
55
|
}
|
|
48
56
|
const img = _react.default.createElement("img", {
|
|
57
|
+
ref: imgRef,
|
|
58
|
+
id: props.id,
|
|
49
59
|
className: `${classPrefix}-img`,
|
|
50
60
|
src: src,
|
|
51
61
|
alt: props.alt,
|
|
@@ -127,9 +127,11 @@ const ImageUploader = p => {
|
|
|
127
127
|
file
|
|
128
128
|
}));
|
|
129
129
|
setTasks(prev => [...getFinalTasks(prev), ...newTasks]);
|
|
130
|
-
|
|
130
|
+
const newVal = [];
|
|
131
|
+
yield Promise.all(newTasks.map((currentTask, index) => (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
131
132
|
try {
|
|
132
133
|
const result = yield props.upload(currentTask.file);
|
|
134
|
+
newVal[index] = result;
|
|
133
135
|
setTasks(prev => {
|
|
134
136
|
return prev.map(task => {
|
|
135
137
|
if (task.id === currentTask.id) {
|
|
@@ -141,10 +143,6 @@ const ImageUploader = p => {
|
|
|
141
143
|
return task;
|
|
142
144
|
});
|
|
143
145
|
});
|
|
144
|
-
setValue(prev => {
|
|
145
|
-
const newVal = Object.assign({}, result);
|
|
146
|
-
return [...prev, newVal];
|
|
147
|
-
});
|
|
148
146
|
} catch (e) {
|
|
149
147
|
setTasks(prev => {
|
|
150
148
|
return prev.map(task => {
|
|
@@ -159,6 +157,7 @@ const ImageUploader = p => {
|
|
|
159
157
|
throw e;
|
|
160
158
|
}
|
|
161
159
|
}))).catch(error => console.error(error));
|
|
160
|
+
setValue(prev => prev.concat(newVal));
|
|
162
161
|
});
|
|
163
162
|
}
|
|
164
163
|
const imageViewerHandlerRef = (0, _react.useRef)(null);
|
|
@@ -4,7 +4,7 @@ declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttribute
|
|
|
4
4
|
declare type AriaProps = {
|
|
5
5
|
role?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step'> & {
|
|
7
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step' | 'id'> & {
|
|
8
8
|
value?: string;
|
|
9
9
|
defaultValue?: string;
|
|
10
10
|
onChange?: (val: string) => void;
|
|
@@ -14,7 +14,6 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
14
14
|
clearable?: boolean;
|
|
15
15
|
onlyShowClearWhenFocus?: boolean;
|
|
16
16
|
onClear?: () => void;
|
|
17
|
-
id?: string;
|
|
18
17
|
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
19
18
|
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
20
19
|
min?: number;
|
|
@@ -26,7 +25,7 @@ export declare type InputRef = {
|
|
|
26
25
|
blur: () => void;
|
|
27
26
|
nativeElement: HTMLInputElement | null;
|
|
28
27
|
};
|
|
29
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "
|
|
28
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "id" | "onClick" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "type" | "step" | "autoFocus" | "autoCapitalize" | "autoCorrect" | "inputMode" | "name" | "autoComplete" | "maxLength" | "minLength"> & {
|
|
30
29
|
value?: string | undefined;
|
|
31
30
|
defaultValue?: string | undefined;
|
|
32
31
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -36,7 +35,6 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
36
35
|
clearable?: boolean | undefined;
|
|
37
36
|
onlyShowClearWhenFocus?: boolean | undefined;
|
|
38
37
|
onClear?: (() => void) | undefined;
|
|
39
|
-
id?: string | undefined;
|
|
40
38
|
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
41
39
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
42
40
|
min?: number | undefined;
|
|
@@ -9,6 +9,6 @@ export declare type ListItemProps = {
|
|
|
9
9
|
clickable?: boolean;
|
|
10
10
|
arrow?: boolean | ReactNode;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
-
onClick?: (e: React.MouseEvent) => void;
|
|
12
|
+
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
13
13
|
} & NativeProps<'--prefix-width' | '--align-items' | '--active-background-color'>;
|
|
14
14
|
export declare const ListItem: FC<ListItemProps>;
|
|
@@ -13,6 +13,8 @@ export declare type NoticeBarProps = {
|
|
|
13
13
|
closeable?: boolean;
|
|
14
14
|
/** Callback when closed */
|
|
15
15
|
onClose?: () => void;
|
|
16
|
+
/** Event when click */
|
|
17
|
+
onClick?: () => void;
|
|
16
18
|
/** Additional operating area, displayed to the left of the close button */
|
|
17
19
|
extra?: React.ReactNode;
|
|
18
20
|
/** Radio icon on the left */
|
|
@@ -73,7 +73,8 @@ const NoticeBar = (0, _react.memo)(p => {
|
|
|
73
73
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
74
74
|
className: (0, _classnames.default)(classPrefix, `${classPrefix}-${props.color}`, {
|
|
75
75
|
[`${classPrefix}-wrap`]: props.wrap
|
|
76
|
-
})
|
|
76
|
+
}),
|
|
77
|
+
onClick: props.onClick
|
|
77
78
|
}, props.icon && _react.default.createElement("span", {
|
|
78
79
|
className: `${classPrefix}-left`
|
|
79
80
|
}, props.icon), _react.default.createElement("span", {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { PickerProps } from '../picker';
|
|
4
|
-
export declare type PickerValue = string | null;
|
|
4
|
+
export declare type PickerValue = string | number | null;
|
|
5
5
|
export declare type PickerValueExtend = {
|
|
6
6
|
columns: PickerColumnItem[][];
|
|
7
7
|
items: (PickerColumnItem | null)[];
|
|
8
8
|
};
|
|
9
9
|
export declare type PickerColumnItem = {
|
|
10
10
|
label: ReactNode;
|
|
11
|
-
value: string;
|
|
11
|
+
value: string | number;
|
|
12
12
|
key?: string | number;
|
|
13
13
|
};
|
|
14
14
|
export declare type PickerColumn = (string | PickerColumnItem)[];
|
|
@@ -3,5 +3,6 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
import { PopupBaseProps } from './popup-base-props';
|
|
4
4
|
export declare type PopupProps = PopupBaseProps & PropsWithChildren<{
|
|
5
5
|
position?: 'bottom' | 'top' | 'left' | 'right';
|
|
6
|
+
closeOnSwipe?: boolean;
|
|
6
7
|
}> & NativeProps<'--z-index'>;
|
|
7
8
|
export declare const Popup: FC<PopupProps>;
|
|
@@ -19,11 +19,13 @@ var _antdMobileIcons = require("antd-mobile-icons");
|
|
|
19
19
|
var _popupBaseProps = require("./popup-base-props");
|
|
20
20
|
var _useInnerVisible = require("../../utils/use-inner-visible");
|
|
21
21
|
var _configProvider = require("../config-provider");
|
|
22
|
+
var _react2 = require("@use-gesture/react");
|
|
22
23
|
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); }
|
|
23
24
|
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; }
|
|
24
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
26
|
const classPrefix = `adm-popup`;
|
|
26
27
|
const defaultProps = Object.assign(Object.assign({}, _popupBaseProps.defaultPopupBaseProps), {
|
|
28
|
+
closeOnSwipe: false,
|
|
27
29
|
position: 'bottom'
|
|
28
30
|
});
|
|
29
31
|
const Popup = p => {
|
|
@@ -62,14 +64,27 @@ const Popup = p => {
|
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
});
|
|
67
|
+
const bind = (0, _react2.useDrag)(({
|
|
68
|
+
swipe: [, swipeY]
|
|
69
|
+
}) => {
|
|
70
|
+
var _a;
|
|
71
|
+
if (!props.closeOnSwipe) return;
|
|
72
|
+
if (swipeY === 1 && props.position === 'bottom' || swipeY === -1 && props.position === 'top') {
|
|
73
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
axis: 'y',
|
|
77
|
+
enabled: ['top', 'bottom'].includes(props.position)
|
|
78
|
+
});
|
|
65
79
|
const maskVisible = (0, _useInnerVisible.useInnerVisible)(active && props.visible);
|
|
66
|
-
const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
80
|
+
const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", Object.assign({
|
|
67
81
|
className: classPrefix,
|
|
68
82
|
onClick: props.onClick,
|
|
69
83
|
style: {
|
|
70
|
-
display: active ? undefined : 'none'
|
|
84
|
+
display: active ? undefined : 'none',
|
|
85
|
+
touchAction: ['top', 'bottom'].includes(props.position) ? 'none' : 'auto'
|
|
71
86
|
}
|
|
72
|
-
}, props.mask && _react.default.createElement(_mask.default, {
|
|
87
|
+
}, bind()), props.mask && _react.default.createElement(_mask.default, {
|
|
73
88
|
visible: maskVisible,
|
|
74
89
|
forceRender: props.forceRender,
|
|
75
90
|
destroyOnClose: props.destroyOnClose,
|
|
@@ -88,19 +103,17 @@ const Popup = p => {
|
|
|
88
103
|
className: bodyCls,
|
|
89
104
|
style: Object.assign(Object.assign({}, props.bodyStyle), {
|
|
90
105
|
transform: percent.to(v => {
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return `translate(${v}%, 0)`;
|
|
103
|
-
}
|
|
106
|
+
if (props.position === 'bottom') {
|
|
107
|
+
return `translate(0, ${v}%)`;
|
|
108
|
+
}
|
|
109
|
+
if (props.position === 'top') {
|
|
110
|
+
return `translate(0, -${v}%)`;
|
|
111
|
+
}
|
|
112
|
+
if (props.position === 'left') {
|
|
113
|
+
return `translate(-${v}%, 0)`;
|
|
114
|
+
}
|
|
115
|
+
if (props.position === 'right') {
|
|
116
|
+
return `translate(${v}%, 0)`;
|
|
104
117
|
}
|
|
105
118
|
return 'none';
|
|
106
119
|
})
|
|
@@ -49,6 +49,7 @@ const PullToRefresh = p => {
|
|
|
49
49
|
config: {
|
|
50
50
|
tension: 300,
|
|
51
51
|
friction: 30,
|
|
52
|
+
round: true,
|
|
52
53
|
clamp: true
|
|
53
54
|
}
|
|
54
55
|
}));
|
|
@@ -108,7 +109,8 @@ const PullToRefresh = p => {
|
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
111
|
const [, y] = state.movement;
|
|
111
|
-
|
|
112
|
+
const parsedY = Math.ceil(y);
|
|
113
|
+
if (state.first && parsedY > 0) {
|
|
112
114
|
const target = state.event.target;
|
|
113
115
|
if (!target || !(target instanceof Element)) return;
|
|
114
116
|
let scrollParent = (0, _getScrollParent.getScrollParent)(target);
|
|
@@ -133,7 +135,7 @@ const PullToRefresh = p => {
|
|
|
133
135
|
event.preventDefault();
|
|
134
136
|
}
|
|
135
137
|
event.stopPropagation();
|
|
136
|
-
const height = Math.max((0, _rubberband.rubberbandIfOutOfBounds)(
|
|
138
|
+
const height = Math.max((0, _rubberband.rubberbandIfOutOfBounds)(parsedY, 0, 0, headHeight * 5, 0.5), 0);
|
|
137
139
|
api.start({
|
|
138
140
|
height
|
|
139
141
|
});
|
|
@@ -2,7 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { InputRef, InputProps } from '../input';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
export declare type SearchBarRef = InputRef;
|
|
5
|
-
export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'onClear'> & {
|
|
5
|
+
export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'onClear' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
8
8
|
maxLength?: number;
|
|
@@ -17,7 +17,7 @@ export declare type SearchBarProps = Pick<InputProps, 'onFocus' | 'onBlur' | 'on
|
|
|
17
17
|
onChange?: (val: string) => void;
|
|
18
18
|
onCancel?: () => void;
|
|
19
19
|
} & NativeProps<'--background' | '--border-radius' | '--placeholder-color' | '--height' | '--padding-left'>;
|
|
20
|
-
export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps, "onFocus" | "onBlur" | "onClear"> & {
|
|
20
|
+
export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps, "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onClear"> & {
|
|
21
21
|
value?: string | undefined;
|
|
22
22
|
defaultValue?: string | undefined;
|
|
23
23
|
maxLength?: number | undefined;
|
|
@@ -119,11 +119,15 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
"aria-label": locale.SearchBar.name,
|
|
122
|
-
onCompositionStart:
|
|
122
|
+
onCompositionStart: e => {
|
|
123
|
+
var _a;
|
|
123
124
|
composingRef.current = true;
|
|
125
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
124
126
|
},
|
|
125
|
-
onCompositionEnd:
|
|
127
|
+
onCompositionEnd: e => {
|
|
128
|
+
var _a;
|
|
126
129
|
composingRef.current = false;
|
|
130
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
127
131
|
}
|
|
128
132
|
})), renderCancelButton()));
|
|
129
133
|
});
|
|
@@ -87,13 +87,14 @@ const Slider = p => {
|
|
|
87
87
|
const pointList = (0, _react.useMemo)(() => {
|
|
88
88
|
if (marks) {
|
|
89
89
|
return Object.keys(marks).map(parseFloat).sort((a, b) => a - b);
|
|
90
|
-
} else {
|
|
90
|
+
} else if (ticks) {
|
|
91
91
|
const points = [];
|
|
92
92
|
for (let i = (0, _miniDecimal.default)(min); i.lessEquals((0, _miniDecimal.default)(max)); i = i.add(step)) {
|
|
93
93
|
points.push(i.toNumber());
|
|
94
94
|
}
|
|
95
95
|
return points;
|
|
96
96
|
}
|
|
97
|
+
return [];
|
|
97
98
|
}, [marks, ticks, step, min, max]);
|
|
98
99
|
function getValueByPosition(position) {
|
|
99
100
|
const newPosition = position < min ? min : position > max ? max : position;
|
|
@@ -102,9 +103,10 @@ const Slider = p => {
|
|
|
102
103
|
if (pointList.length) {
|
|
103
104
|
value = (0, _nearest.nearest)(pointList, newPosition);
|
|
104
105
|
} else {
|
|
105
|
-
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
// 使用 MiniDecimal 避免精度问题
|
|
107
|
+
const cell = Math.round((newPosition - min) / step);
|
|
108
|
+
const nextVal = (0, _miniDecimal.default)(cell).multi(step);
|
|
109
|
+
value = (0, _miniDecimal.default)(min).add(nextVal.toString()).toNumber();
|
|
108
110
|
}
|
|
109
111
|
return value;
|
|
110
112
|
}
|
|
@@ -44,6 +44,7 @@ let currentUid;
|
|
|
44
44
|
const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) => {
|
|
45
45
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
46
46
|
const [uid] = (0, _react.useState)({});
|
|
47
|
+
const timeoutRef = (0, _react.useRef)(null);
|
|
47
48
|
const isVertical = props.direction === 'vertical';
|
|
48
49
|
const slideRatio = props.slideSize / 100;
|
|
49
50
|
const offsetRatio = props.trackOffset / 100;
|
|
@@ -82,11 +83,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
82
83
|
const trackPixels = isVertical ? track.offsetHeight : track.offsetWidth;
|
|
83
84
|
return trackPixels * props.slideSize / 100;
|
|
84
85
|
}
|
|
85
|
-
const [current, setCurrent] = (0,
|
|
86
|
-
(0, _ahooks.useUpdateEffect)(() => {
|
|
87
|
-
var _a;
|
|
88
|
-
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, current);
|
|
89
|
-
}, [current]);
|
|
86
|
+
const [current, setCurrent, getCurrent] = (0, _ahooks.useGetState)(props.defaultIndex);
|
|
90
87
|
const [dragging, setDragging, draggingRef] = (0, _useRefState.useRefState)(false);
|
|
91
88
|
function boundIndex(current) {
|
|
92
89
|
let min = 0;
|
|
@@ -181,9 +178,13 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
181
178
|
}
|
|
182
179
|
});
|
|
183
180
|
function swipeTo(index, immediate = false) {
|
|
181
|
+
var _a;
|
|
184
182
|
const roundedIndex = Math.round(index);
|
|
185
183
|
const targetIndex = loop ? modulus(roundedIndex, count) : (0, _bound.bound)(roundedIndex, 0, count - 1);
|
|
186
184
|
setCurrent(targetIndex);
|
|
185
|
+
if (targetIndex !== getCurrent()) {
|
|
186
|
+
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, targetIndex);
|
|
187
|
+
}
|
|
187
188
|
api.start({
|
|
188
189
|
position: (loop ? roundedIndex : boundIndex(roundedIndex)) * 100,
|
|
189
190
|
immediate
|
|
@@ -210,16 +211,17 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
210
211
|
autoplay,
|
|
211
212
|
autoplayInterval
|
|
212
213
|
} = props;
|
|
214
|
+
const runTimeSwiper = () => {
|
|
215
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
216
|
+
swipeNext();
|
|
217
|
+
runTimeSwiper();
|
|
218
|
+
}, autoplayInterval);
|
|
219
|
+
};
|
|
213
220
|
(0, _react.useEffect)(() => {
|
|
214
221
|
if (!autoplay || dragging) return;
|
|
215
|
-
|
|
216
|
-
function tick() {
|
|
217
|
-
interval = window.setTimeout(tick, autoplayInterval);
|
|
218
|
-
swipeNext();
|
|
219
|
-
}
|
|
220
|
-
interval = window.setTimeout(tick, autoplayInterval);
|
|
222
|
+
runTimeSwiper();
|
|
221
223
|
return () => {
|
|
222
|
-
if (
|
|
224
|
+
if (timeoutRef.current) window.clearTimeout(timeoutRef.current);
|
|
223
225
|
};
|
|
224
226
|
}, [autoplay, autoplayInterval, dragging, count]);
|
|
225
227
|
function renderTrackInner() {
|
|
@@ -228,7 +230,9 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
228
230
|
className: `${classPrefix}-track-inner`
|
|
229
231
|
}, _react.default.Children.map(validChildren, (child, index) => {
|
|
230
232
|
return _react.default.createElement(_web.animated.div, {
|
|
231
|
-
className: `${classPrefix}-slide`,
|
|
233
|
+
className: (0, _classnames.default)(`${classPrefix}-slide`, {
|
|
234
|
+
[`${classPrefix}-slide-active`]: current === index
|
|
235
|
+
}),
|
|
232
236
|
style: {
|
|
233
237
|
[isVertical ? 'y' : 'x']: position.to(position => {
|
|
234
238
|
let finalPosition = -position + index * 100;
|
|
@@ -247,9 +251,11 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
247
251
|
style: {
|
|
248
252
|
[isVertical ? 'y' : 'x']: position.to(position => `${-position}%`)
|
|
249
253
|
}
|
|
250
|
-
}, _react.default.Children.map(validChildren, child => {
|
|
254
|
+
}, _react.default.Children.map(validChildren, (child, index) => {
|
|
251
255
|
return _react.default.createElement("div", {
|
|
252
|
-
className: `${classPrefix}-slide
|
|
256
|
+
className: (0, _classnames.default)(`${classPrefix}-slide`, {
|
|
257
|
+
[`${classPrefix}-slide-active`]: current === index
|
|
258
|
+
})
|
|
253
259
|
}, child);
|
|
254
260
|
}));
|
|
255
261
|
}
|
|
@@ -21,7 +21,7 @@ export declare type TextAreaRef = {
|
|
|
21
21
|
blur: () => void;
|
|
22
22
|
nativeElement: HTMLTextAreaElement | null;
|
|
23
23
|
};
|
|
24
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "
|
|
24
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoFocus" | "name" | "readOnly" | "autoComplete"> & {
|
|
25
25
|
onChange?: ((val: string) => void) | undefined;
|
|
26
26
|
value?: string | undefined;
|
|
27
27
|
defaultValue?: string | undefined;
|