antd-mobile 5.12.3 → 5.12.6
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/cjs/components/action-sheet/action-sheet.css +22 -7
- package/2x/cjs/components/action-sheet/action-sheet.js +8 -16
- package/2x/cjs/components/badge/badge.d.ts +1 -1
- package/2x/cjs/components/badge/badge.js +3 -1
- package/2x/cjs/components/badge/index.d.ts +2 -4
- package/2x/cjs/components/badge/index.js +2 -4
- package/2x/cjs/components/button/button.d.ts +6 -4
- package/2x/cjs/components/button/button.js +5 -1
- package/2x/cjs/components/calendar/calendar.css +4 -0
- package/2x/cjs/components/calendar/calendar.d.ts +1 -0
- package/2x/cjs/components/calendar/calendar.js +1 -1
- package/2x/cjs/components/form/form-item.js +1 -4
- package/2x/cjs/components/image/broken-image-icon.d.ts +1 -0
- package/2x/cjs/components/image/broken-image-icon.js +21 -0
- package/2x/cjs/components/image/image-icon.d.ts +1 -0
- package/2x/cjs/components/image/image-icon.js +21 -0
- package/2x/cjs/components/image/image.css +4 -2
- package/2x/cjs/components/image/image.d.ts +1 -0
- package/2x/cjs/components/image/image.js +10 -6
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +8 -6
- package/2x/cjs/components/popover/popover.css +1 -0
- package/2x/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/2x/cjs/components/search-bar/search-bar.js +3 -0
- package/2x/cjs/components/side-bar/side-bar.d.ts +2 -1
- package/2x/cjs/components/swiper/index.d.ts +1 -1
- package/2x/cjs/components/swiper/swiper.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.js +2 -1
- package/2x/cjs/components/toast/toast.css +1 -1
- package/2x/es/components/action-sheet/action-sheet.css +22 -7
- package/2x/es/components/action-sheet/action-sheet.js +8 -15
- package/2x/es/components/badge/badge.d.ts +1 -1
- package/2x/es/components/badge/badge.js +1 -1
- package/2x/es/components/badge/index.d.ts +2 -4
- package/2x/es/components/badge/index.js +2 -3
- package/2x/es/components/button/button.d.ts +6 -4
- package/2x/es/components/button/button.js +5 -1
- package/2x/es/components/calendar/calendar.css +4 -0
- package/2x/es/components/calendar/calendar.d.ts +1 -0
- package/2x/es/components/calendar/calendar.js +1 -1
- package/2x/es/components/form/form-item.js +1 -4
- package/2x/es/components/image/broken-image-icon.d.ts +1 -0
- package/2x/es/components/image/broken-image-icon.js +9 -0
- package/2x/es/components/image/image-icon.d.ts +1 -0
- package/2x/es/components/image/image-icon.js +9 -0
- package/2x/es/components/image/image.css +4 -2
- package/2x/es/components/image/image.d.ts +1 -0
- package/2x/es/components/image/image.js +8 -5
- package/2x/es/components/infinite-scroll/infinite-scroll.js +8 -6
- package/2x/es/components/popover/popover.css +1 -0
- package/2x/es/components/search-bar/search-bar.d.ts +1 -1
- package/2x/es/components/search-bar/search-bar.js +3 -0
- package/2x/es/components/side-bar/side-bar.d.ts +2 -1
- package/2x/es/components/swiper/index.d.ts +1 -1
- package/2x/es/components/swiper/swiper.d.ts +1 -1
- package/2x/es/components/text-area/text-area.js +2 -1
- package/2x/es/components/toast/toast.css +1 -1
- package/2x/package.json +4 -4
- package/bundle/antd-mobile.cjs.js +195 -177
- package/bundle/antd-mobile.es.js +197 -179
- package/bundle/style.css +99 -81
- package/cjs/components/action-sheet/action-sheet.css +19 -7
- package/cjs/components/action-sheet/action-sheet.js +8 -16
- package/cjs/components/badge/badge.d.ts +1 -1
- package/cjs/components/badge/badge.js +3 -1
- package/cjs/components/badge/index.d.ts +2 -4
- package/cjs/components/badge/index.js +2 -4
- package/cjs/components/button/button.d.ts +6 -4
- package/cjs/components/button/button.js +5 -1
- package/cjs/components/calendar/calendar.css +3 -0
- package/cjs/components/calendar/calendar.d.ts +1 -0
- package/cjs/components/calendar/calendar.js +1 -1
- package/cjs/components/form/form-item.js +1 -4
- package/cjs/components/image/broken-image-icon.d.ts +1 -0
- package/cjs/components/image/broken-image-icon.js +21 -0
- package/cjs/components/image/image-icon.d.ts +1 -0
- package/cjs/components/image/image-icon.js +21 -0
- package/cjs/components/image/image.css +4 -2
- package/cjs/components/image/image.d.ts +1 -0
- package/cjs/components/image/image.js +10 -6
- package/cjs/components/infinite-scroll/infinite-scroll.js +8 -6
- package/cjs/components/popover/popover.css +1 -0
- package/cjs/components/search-bar/search-bar.d.ts +1 -1
- package/cjs/components/search-bar/search-bar.js +3 -0
- package/cjs/components/side-bar/side-bar.d.ts +2 -1
- package/cjs/components/swiper/index.d.ts +1 -1
- package/cjs/components/swiper/swiper.d.ts +1 -1
- package/cjs/components/text-area/text-area.js +2 -1
- package/cjs/components/toast/toast.css +1 -1
- package/es/components/action-sheet/action-sheet.css +19 -7
- package/es/components/action-sheet/action-sheet.js +8 -15
- package/es/components/badge/badge.d.ts +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/index.d.ts +2 -4
- package/es/components/badge/index.js +2 -3
- package/es/components/button/button.d.ts +6 -4
- package/es/components/button/button.js +5 -1
- package/es/components/calendar/calendar.css +3 -0
- package/es/components/calendar/calendar.d.ts +1 -0
- package/es/components/calendar/calendar.js +1 -1
- package/es/components/form/form-item.js +1 -4
- package/es/components/image/broken-image-icon.d.ts +1 -0
- package/es/components/image/broken-image-icon.js +9 -0
- package/es/components/image/image-icon.d.ts +1 -0
- package/es/components/image/image-icon.js +9 -0
- package/es/components/image/image.css +4 -2
- package/es/components/image/image.d.ts +1 -0
- package/es/components/image/image.js +8 -5
- package/es/components/infinite-scroll/infinite-scroll.js +8 -6
- package/es/components/popover/popover.css +1 -0
- package/es/components/search-bar/search-bar.d.ts +1 -1
- package/es/components/search-bar/search-bar.js +3 -0
- package/es/components/side-bar/side-bar.d.ts +2 -1
- package/es/components/swiper/index.d.ts +1 -1
- package/es/components/swiper/swiper.d.ts +1 -1
- package/es/components/text-area/text-area.js +2 -1
- package/es/components/toast/toast.css +1 -1
- package/package.json +4 -4
- package/umd/antd-mobile.js +1 -1
|
@@ -9,22 +9,37 @@
|
|
|
9
9
|
justify-content: center;
|
|
10
10
|
color: var(--adm-color-weak);
|
|
11
11
|
font-size: 30px;
|
|
12
|
-
padding: 36px
|
|
12
|
+
padding: 36px 24px;
|
|
13
|
+
border-bottom: 2px solid var(--adm-border-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.adm-action-sheet-button-list {
|
|
13
17
|
border-bottom: 2px solid var(--adm-border-color);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
.adm-action-sheet-button-item-wrapper {
|
|
17
|
-
|
|
18
|
-
border-top: 2px solid var(--adm-border-color);
|
|
21
|
+
border-bottom: 2px solid var(--adm-border-color);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
.adm-action-sheet-button-item-wrapper:
|
|
22
|
-
border-
|
|
24
|
+
.adm-action-sheet-button-item-wrapper:last-child {
|
|
25
|
+
border-bottom: none;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
.adm-action-sheet-button-item {
|
|
26
|
-
padding: 28px;
|
|
27
29
|
text-align: center;
|
|
30
|
+
display: block;
|
|
31
|
+
background-color: #ffffff;
|
|
32
|
+
padding: 32px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.adm-action-sheet-button-item:active {
|
|
36
|
+
background-color: #eeeeee;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.adm-action-sheet-button-item-disabled {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
opacity: 0.4;
|
|
28
43
|
}
|
|
29
44
|
|
|
30
45
|
.adm-action-sheet-button-item-name {
|
|
@@ -35,7 +50,7 @@
|
|
|
35
50
|
.adm-action-sheet-button-item-description {
|
|
36
51
|
font-size: 24px;
|
|
37
52
|
color: var(--adm-color-weak);
|
|
38
|
-
padding-top:
|
|
53
|
+
padding-top: 4px;
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
@@ -16,8 +16,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
16
16
|
|
|
17
17
|
var _popup = _interopRequireDefault(require("../popup"));
|
|
18
18
|
|
|
19
|
-
var _button = _interopRequireDefault(require("../button"));
|
|
20
|
-
|
|
21
19
|
var _safeArea = _interopRequireDefault(require("../safe-area"));
|
|
22
20
|
|
|
23
21
|
var _renderImperatively = require("../../utils/render-imperatively");
|
|
@@ -60,11 +58,11 @@ const ActionSheet = p => {
|
|
|
60
58
|
}, props.actions.map((action, index) => _react.default.createElement("div", {
|
|
61
59
|
key: action.key,
|
|
62
60
|
className: `${classPrefix}-button-item-wrapper`
|
|
63
|
-
}, _react.default.createElement(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
}, _react.default.createElement("a", {
|
|
62
|
+
className: (0, _classnames.default)('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
63
|
+
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
64
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
65
|
+
}),
|
|
68
66
|
onClick: () => {
|
|
69
67
|
var _a, _b, _c;
|
|
70
68
|
|
|
@@ -74,10 +72,7 @@ const ActionSheet = p => {
|
|
|
74
72
|
if (props.closeOnAction) {
|
|
75
73
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
76
74
|
}
|
|
77
|
-
}
|
|
78
|
-
className: (0, _classnames.default)(`${classPrefix}-button-item`, {
|
|
79
|
-
[`${classPrefix}-button-item-danger`]: action.danger
|
|
80
|
-
})
|
|
75
|
+
}
|
|
81
76
|
}, _react.default.createElement("div", {
|
|
82
77
|
className: `${classPrefix}-button-item-name`
|
|
83
78
|
}, action.text), action.description && _react.default.createElement("div", {
|
|
@@ -86,11 +81,8 @@ const ActionSheet = p => {
|
|
|
86
81
|
className: `${classPrefix}-cancel`
|
|
87
82
|
}, _react.default.createElement("div", {
|
|
88
83
|
className: `${classPrefix}-button-item-wrapper`
|
|
89
|
-
}, _react.default.createElement(
|
|
90
|
-
|
|
91
|
-
fill: 'none',
|
|
92
|
-
shape: 'rectangular',
|
|
93
|
-
className: `${classPrefix}-button-item`,
|
|
84
|
+
}, _react.default.createElement("a", {
|
|
85
|
+
className: (0, _classnames.default)('adm-plain-anchor', `${classPrefix}-button-item`),
|
|
94
86
|
onClick: () => {
|
|
95
87
|
var _a;
|
|
96
88
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
export declare const dot:
|
|
3
|
+
export declare const dot: JSX.Element;
|
|
4
4
|
export declare type BadgeProps = {
|
|
5
5
|
content?: React.ReactNode | typeof dot;
|
|
6
6
|
color?: string;
|
|
@@ -14,7 +14,9 @@ var _nativeProps = require("../../utils/native-props");
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
const classPrefix = `adm-badge`;
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
const dot = _react.default.createElement(_react.default.Fragment, null);
|
|
19
|
+
|
|
18
20
|
exports.dot = dot;
|
|
19
21
|
|
|
20
22
|
const Badge = props => {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './badge.less';
|
|
3
|
-
import { dot } from './badge';
|
|
4
3
|
export type { BadgeProps } from './badge';
|
|
5
|
-
declare
|
|
6
|
-
dot:
|
|
4
|
+
declare const _default: import("react").FC<import("./badge").BadgeProps> & {
|
|
5
|
+
dot: JSX.Element;
|
|
7
6
|
};
|
|
8
|
-
declare const _default: import("react").FC<import("./badge").BadgeProps> & Properties;
|
|
9
7
|
export default _default;
|
|
@@ -11,10 +11,8 @@ var _badge2 = require("./badge");
|
|
|
11
11
|
|
|
12
12
|
var _attachPropertiesToComponent = require("../../utils/attach-properties-to-component");
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_badge2.Badge, {
|
|
15
15
|
dot: _badge2.dot
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
var _default = (0, _attachPropertiesToComponent.attachPropertiesToComponent)(_badge2.Badge, properties);
|
|
16
|
+
});
|
|
19
17
|
|
|
20
18
|
exports.default = _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
declare type NativeButtonProps = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
3
4
|
export declare type ButtonProps = {
|
|
4
5
|
color?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
5
6
|
fill?: 'solid' | 'outline' | 'none';
|
|
@@ -9,11 +10,11 @@ export declare type ButtonProps = {
|
|
|
9
10
|
loadingText?: string;
|
|
10
11
|
loadingIcon?: React.ReactNode;
|
|
11
12
|
disabled?: boolean;
|
|
12
|
-
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void
|
|
13
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown;
|
|
13
14
|
type?: 'submit' | 'reset' | 'button';
|
|
14
15
|
shape?: 'default' | 'rounded' | 'rectangular';
|
|
15
16
|
children?: React.ReactNode;
|
|
16
|
-
} & NativeProps<'--text-color' | '--background-color' | '--border-radius' | '--border-width' | '--border-style' | '--border-color'>;
|
|
17
|
+
} & Pick<NativeButtonProps, 'onMouseDown' | 'onMouseUp' | 'onTouchStart' | 'onTouchEnd'> & NativeProps<'--text-color' | '--background-color' | '--border-radius' | '--border-width' | '--border-style' | '--border-color'>;
|
|
17
18
|
export declare type ButtonRef = {
|
|
18
19
|
nativeElement: HTMLButtonElement | null;
|
|
19
20
|
};
|
|
@@ -26,8 +27,9 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
26
27
|
loadingText?: string | undefined;
|
|
27
28
|
loadingIcon?: React.ReactNode;
|
|
28
29
|
disabled?: boolean | undefined;
|
|
29
|
-
onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void>) | undefined;
|
|
30
|
+
onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown) | undefined;
|
|
30
31
|
type?: "reset" | "submit" | "button" | undefined;
|
|
31
32
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
|
32
33
|
children?: React.ReactNode;
|
|
33
|
-
} & NativeProps<"--
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
35
|
+
export {};
|
|
@@ -81,7 +81,11 @@ const Button = (0, _react.forwardRef)((p, ref) => {
|
|
|
81
81
|
[`${classPrefix}-large`]: props.size === 'large',
|
|
82
82
|
[`${classPrefix}-loading`]: loading
|
|
83
83
|
}, `${classPrefix}-shape-${props.shape}`),
|
|
84
|
-
disabled: disabled
|
|
84
|
+
disabled: disabled,
|
|
85
|
+
onMouseDown: props.onMouseDown,
|
|
86
|
+
onMouseUp: props.onMouseUp,
|
|
87
|
+
onTouchStart: props.onTouchStart,
|
|
88
|
+
onTouchEnd: props.onTouchEnd
|
|
85
89
|
}, loading ? _react.default.createElement("div", {
|
|
86
90
|
className: `${classPrefix}-loading-wrapper`
|
|
87
91
|
}, props.loadingIcon, props.loadingText) : props.children));
|
|
@@ -86,6 +86,10 @@
|
|
|
86
86
|
border-bottom-right-radius: 8px;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
.adm-calendar-cell.adm-calendar-cell-disabled.adm-calendar-cell.adm-calendar-cell-selected {
|
|
90
|
+
color: var(--adm-color-light);
|
|
91
|
+
}
|
|
92
|
+
|
|
89
93
|
.adm-calendar-cell .adm-calendar-cell-top {
|
|
90
94
|
flex: none;
|
|
91
95
|
font-size: 36px;
|
|
@@ -153,7 +153,7 @@ const Calendar = (0, _react.forwardRef)((p, ref) => {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const inThisMonth = d.month() === current.month();
|
|
156
|
-
const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
156
|
+
const disabled = props.shouldDisableDate ? props.shouldDisableDate(d.toDate()) : maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
157
157
|
cells.push(_react.default.createElement("div", {
|
|
158
158
|
key: d.valueOf(),
|
|
159
159
|
className: (0, _classnames.default)(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
@@ -256,10 +256,7 @@ const FormItem = props => {
|
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
let Variables = {};
|
|
259
|
-
|
|
260
|
-
if (typeof label === 'string') {
|
|
261
|
-
Variables.label = label;
|
|
262
|
-
}
|
|
259
|
+
Variables.label = typeof label === 'string' ? label : '';
|
|
263
260
|
|
|
264
261
|
if (messageVariables) {
|
|
265
262
|
Variables = Object.assign(Object.assign({}, Variables), messageVariables);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BrokenImageIcon: () => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BrokenImageIcon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const BrokenImageIcon = () => _react.default.createElement("svg", {
|
|
13
|
+
viewBox: '0 0 48 48',
|
|
14
|
+
xmlns: 'http://www.w3.org/2000/svg'
|
|
15
|
+
}, _react.default.createElement("path", {
|
|
16
|
+
d: 'M19.233 6.233 17.42 9.08l-10.817.001a.665.665 0 0 0-.647.562l-.007.096V34.9l5.989-8.707a2.373 2.373 0 0 1 1.801-1.005 2.415 2.415 0 0 1 1.807.625l.126.127 4.182 4.525 2.267-3.292 5.461 7.841-4.065 7.375H6.604c-1.86 0-3.382-1.47-3.482-3.317l-.005-.192V9.744c0-1.872 1.461-3.405 3.296-3.505l.19-.005h12.63Zm22.163 0c1.86 0 3.382 1.472 3.482 3.314l.005.192v29.14a3.507 3.507 0 0 1-3.3 3.505l-.191.006H27.789l3.63-6.587.06-.119a1.87 1.87 0 0 0-.163-1.853l-6.928-9.949 3.047-4.422a2.374 2.374 0 0 1 1.96-1.01 2.4 2.4 0 0 1 1.86.87l.106.14L42.05 34.89V9.74a.664.664 0 0 0-.654-.658H21.855l1.812-2.848h17.73Zm-28.305 5.611c.794 0 1.52.298 2.07.788l-.843 1.325-.067.114a1.87 1.87 0 0 0 .11 1.959l.848 1.217c-.556.515-1.3.83-2.118.83a3.122 3.122 0 0 1-3.117-3.116 3.119 3.119 0 0 1 3.117-3.117Z',
|
|
17
|
+
fill: '#DBDBDB',
|
|
18
|
+
fillRule: 'nonzero'
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
exports.BrokenImageIcon = BrokenImageIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ImageIcon: () => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ImageIcon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const ImageIcon = () => _react.default.createElement("svg", {
|
|
13
|
+
viewBox: '0 0 48 48',
|
|
14
|
+
xmlns: 'http://www.w3.org/2000/svg'
|
|
15
|
+
}, _react.default.createElement("path", {
|
|
16
|
+
d: 'M41.396 6.234c1.923 0 3.487 1.574 3.487 3.505v29.14c0 1.937-1.568 3.51-3.491 3.51H6.604c-1.923 0-3.487-1.573-3.487-3.51V9.745c0-1.936 1.564-3.51 3.487-3.51Zm0 2.847H6.604c-.355 0-.654.3-.654.658V34.9l5.989-8.707a2.373 2.373 0 0 1 1.801-1.005 2.405 2.405 0 0 1 1.933.752l4.182 4.525 7.58-11.005a2.374 2.374 0 0 1 1.96-1.01c.79 0 1.532.38 1.966 1.01L42.05 34.89V9.74a.664.664 0 0 0-.654-.658Zm-28.305 2.763a3.119 3.119 0 0 1 3.117 3.117 3.119 3.119 0 0 1-3.117 3.117 3.122 3.122 0 0 1-3.117-3.117 3.119 3.119 0 0 1 3.117-3.117Z',
|
|
17
|
+
fill: '#DBDBDB',
|
|
18
|
+
fillRule: 'nonzero'
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
exports.ImageIcon = ImageIcon;
|
|
@@ -14,13 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
.adm-image-tip {
|
|
16
16
|
position: relative;
|
|
17
|
-
background-color: #
|
|
17
|
+
background-color: #f5f5f5;
|
|
18
18
|
height: 100%;
|
|
19
19
|
min-height: 48px;
|
|
20
20
|
min-width: 48px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.adm-image-tip >
|
|
23
|
+
.adm-image-tip > svg {
|
|
24
|
+
width: 48px;
|
|
25
|
+
height: 48px;
|
|
24
26
|
position: absolute;
|
|
25
27
|
left: 50%;
|
|
26
28
|
top: 50%;
|
|
@@ -9,6 +9,7 @@ export declare type ImageProps = {
|
|
|
9
9
|
placeholder?: ReactNode;
|
|
10
10
|
fallback?: ReactNode;
|
|
11
11
|
lazy?: boolean;
|
|
12
|
+
draggable?: boolean;
|
|
12
13
|
onClick?: (event: React.MouseEvent<HTMLImageElement, Event>) => void;
|
|
13
14
|
onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
14
15
|
onLoad?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
@@ -11,8 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _nativeProps = require("../../utils/native-props");
|
|
13
13
|
|
|
14
|
-
var _antdMobileIcons = require("antd-mobile-icons");
|
|
15
|
-
|
|
16
14
|
var _stagedComponents = require("staged-components");
|
|
17
15
|
|
|
18
16
|
var _toCssLength = require("../../utils/to-css-length");
|
|
@@ -21,6 +19,10 @@ var _lazyDetector = require("./lazy-detector");
|
|
|
21
19
|
|
|
22
20
|
var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
|
|
23
21
|
|
|
22
|
+
var _imageIcon = require("./image-icon");
|
|
23
|
+
|
|
24
|
+
var _brokenImageIcon = require("./broken-image-icon");
|
|
25
|
+
|
|
24
26
|
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); }
|
|
25
27
|
|
|
26
28
|
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; }
|
|
@@ -30,11 +32,12 @@ const defaultProps = {
|
|
|
30
32
|
fit: 'fill',
|
|
31
33
|
placeholder: _react.default.createElement("div", {
|
|
32
34
|
className: `${classPrefix}-tip`
|
|
33
|
-
}, _react.default.createElement(
|
|
35
|
+
}, _react.default.createElement(_imageIcon.ImageIcon, null)),
|
|
34
36
|
fallback: _react.default.createElement("div", {
|
|
35
37
|
className: `${classPrefix}-tip`
|
|
36
|
-
}, _react.default.createElement(
|
|
37
|
-
lazy: false
|
|
38
|
+
}, _react.default.createElement(_brokenImageIcon.BrokenImageIcon, null)),
|
|
39
|
+
lazy: false,
|
|
40
|
+
draggable: false
|
|
38
41
|
};
|
|
39
42
|
const Image = (0, _stagedComponents.staged)(p => {
|
|
40
43
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
@@ -83,7 +86,8 @@ const Image = (0, _stagedComponents.staged)(p => {
|
|
|
83
86
|
referrerPolicy: props.referrerPolicy,
|
|
84
87
|
sizes: props.sizes,
|
|
85
88
|
srcSet: srcSet,
|
|
86
|
-
useMap: props.useMap
|
|
89
|
+
useMap: props.useMap,
|
|
90
|
+
draggable: props.draggable
|
|
87
91
|
});
|
|
88
92
|
|
|
89
93
|
return _react.default.createElement(_react.default.Fragment, null, !loaded && props.placeholder, img);
|
|
@@ -47,9 +47,11 @@ const InfiniteScroll = p => {
|
|
|
47
47
|
threshold: 250
|
|
48
48
|
}, p);
|
|
49
49
|
const doLoadMore = (0, _ahooks.useLockFn)(() => props.loadMore());
|
|
50
|
-
const elementRef = (0, _react.useRef)(null);
|
|
50
|
+
const elementRef = (0, _react.useRef)(null); // Prevent duplicated trigger of `check` function
|
|
51
|
+
|
|
51
52
|
const [flag, setFlag] = (0, _react.useState)({});
|
|
52
53
|
const nextFlagRef = (0, _react.useRef)(flag);
|
|
54
|
+
const [scrollParent, setScrollParent] = (0, _react.useState)();
|
|
53
55
|
const check = (0, _ahooks.useMemoizedFn)(() => (0, _tslib.__awaiter)(void 0, void 0, void 0, function* () {
|
|
54
56
|
if (nextFlagRef.current !== flag) return;
|
|
55
57
|
if (!props.hasMore) return;
|
|
@@ -57,6 +59,7 @@ const InfiniteScroll = p => {
|
|
|
57
59
|
if (!element) return;
|
|
58
60
|
if (!element.offsetParent) return;
|
|
59
61
|
const parent = (0, _getScrollParent.getScrollParent)(element);
|
|
62
|
+
setScrollParent(parent);
|
|
60
63
|
if (!parent) return;
|
|
61
64
|
const rect = element.getBoundingClientRect();
|
|
62
65
|
const elementTop = rect.top;
|
|
@@ -76,18 +79,17 @@ const InfiniteScroll = p => {
|
|
|
76
79
|
(0, _react.useEffect)(() => {
|
|
77
80
|
const element = elementRef.current;
|
|
78
81
|
if (!element) return;
|
|
79
|
-
|
|
80
|
-
if (!parent) return;
|
|
82
|
+
if (!scrollParent) return;
|
|
81
83
|
|
|
82
84
|
function onScroll() {
|
|
83
85
|
check();
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
scrollParent.addEventListener('scroll', onScroll);
|
|
87
89
|
return () => {
|
|
88
|
-
|
|
90
|
+
scrollParent.removeEventListener('scroll', onScroll);
|
|
89
91
|
};
|
|
90
|
-
}, []);
|
|
92
|
+
}, [scrollParent]);
|
|
91
93
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
92
94
|
className: classPrefix,
|
|
93
95
|
ref: elementRef
|
|
@@ -31,4 +31,4 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
31
31
|
onSearch?: ((val: string) => void) | undefined;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
33
|
onCancel?: (() => void) | undefined;
|
|
34
|
-
} & NativeProps<"--
|
|
34
|
+
} & NativeProps<"--height" | "--border-radius" | "--padding-left" | "--background" | "--placeholder-color"> & React.RefAttributes<InputRef>>;
|
|
@@ -96,6 +96,9 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
96
96
|
|
|
97
97
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
98
98
|
(_c = props.onCancel) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
99
|
+
},
|
|
100
|
+
onMouseDown: e => {
|
|
101
|
+
e.preventDefault();
|
|
99
102
|
}
|
|
100
103
|
}, props.cancelText));
|
|
101
104
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { BadgeProps } from '../badge';
|
|
3
4
|
import { NativeProps } from '../../utils/native-props';
|
|
4
5
|
export declare type SideBarItemProps = {
|
|
5
6
|
title?: ReactNode;
|
|
6
7
|
disabled?: boolean;
|
|
7
|
-
badge?:
|
|
8
|
+
badge?: BadgeProps['content'];
|
|
8
9
|
} & NativeProps;
|
|
9
10
|
export declare const SideBarItem: FC<SideBarItemProps>;
|
|
10
11
|
export declare type SideBarProps = {
|
|
@@ -16,7 +16,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
|
-
} & import("../../utils/native-props").NativeProps<"--
|
|
19
|
+
} & import("../../utils/native-props").NativeProps<"--width" | "--height" | "--border-radius" | "--track-padding"> & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
20
|
Item: import("react").FC<{
|
|
21
21
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
22
22
|
children?: import("react").ReactNode;
|
|
@@ -37,4 +37,4 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
39
|
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
|
-
} & NativeProps<"--
|
|
40
|
+
} & NativeProps<"--width" | "--height" | "--border-radius" | "--track-padding"> & React.RefAttributes<SwiperRef>>;
|
|
@@ -123,7 +123,8 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
123
123
|
compositingRef.current = false;
|
|
124
124
|
|
|
125
125
|
if (maxLength) {
|
|
126
|
-
|
|
126
|
+
const v = e.target.value;
|
|
127
|
+
setValue([...v].slice(0, maxLength).join(''));
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
@@ -9,22 +9,37 @@
|
|
|
9
9
|
justify-content: center;
|
|
10
10
|
color: var(--adm-color-weak);
|
|
11
11
|
font-size: 30px;
|
|
12
|
-
padding: 36px
|
|
12
|
+
padding: 36px 24px;
|
|
13
|
+
border-bottom: 2px solid var(--adm-border-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.adm-action-sheet-button-list {
|
|
13
17
|
border-bottom: 2px solid var(--adm-border-color);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
.adm-action-sheet-button-item-wrapper {
|
|
17
|
-
|
|
18
|
-
border-top: 2px solid var(--adm-border-color);
|
|
21
|
+
border-bottom: 2px solid var(--adm-border-color);
|
|
19
22
|
}
|
|
20
23
|
|
|
21
|
-
.adm-action-sheet-button-item-wrapper:
|
|
22
|
-
border-
|
|
24
|
+
.adm-action-sheet-button-item-wrapper:last-child {
|
|
25
|
+
border-bottom: none;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
.adm-action-sheet-button-item {
|
|
26
|
-
padding: 28px;
|
|
27
29
|
text-align: center;
|
|
30
|
+
display: block;
|
|
31
|
+
background-color: #ffffff;
|
|
32
|
+
padding: 32px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.adm-action-sheet-button-item:active {
|
|
36
|
+
background-color: #eeeeee;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.adm-action-sheet-button-item-disabled {
|
|
40
|
+
cursor: not-allowed;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
opacity: 0.4;
|
|
28
43
|
}
|
|
29
44
|
|
|
30
45
|
.adm-action-sheet-button-item-name {
|
|
@@ -35,7 +50,7 @@
|
|
|
35
50
|
.adm-action-sheet-button-item-description {
|
|
36
51
|
font-size: 24px;
|
|
37
52
|
color: var(--adm-color-weak);
|
|
38
|
-
padding-top:
|
|
53
|
+
padding-top: 4px;
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
@@ -3,7 +3,6 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import Popup from '../popup';
|
|
6
|
-
import Button from '../button';
|
|
7
6
|
import SafeArea from '../safe-area';
|
|
8
7
|
import { renderImperatively } from '../../utils/render-imperatively';
|
|
9
8
|
const classPrefix = `adm-action-sheet`;
|
|
@@ -41,11 +40,11 @@ export const ActionSheet = p => {
|
|
|
41
40
|
}, props.actions.map((action, index) => React.createElement("div", {
|
|
42
41
|
key: action.key,
|
|
43
42
|
className: `${classPrefix}-button-item-wrapper`
|
|
44
|
-
}, React.createElement(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
}, React.createElement("a", {
|
|
44
|
+
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
45
|
+
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
46
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
47
|
+
}),
|
|
49
48
|
onClick: () => {
|
|
50
49
|
var _a, _b, _c;
|
|
51
50
|
|
|
@@ -55,10 +54,7 @@ export const ActionSheet = p => {
|
|
|
55
54
|
if (props.closeOnAction) {
|
|
56
55
|
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
57
56
|
}
|
|
58
|
-
}
|
|
59
|
-
className: classNames(`${classPrefix}-button-item`, {
|
|
60
|
-
[`${classPrefix}-button-item-danger`]: action.danger
|
|
61
|
-
})
|
|
57
|
+
}
|
|
62
58
|
}, React.createElement("div", {
|
|
63
59
|
className: `${classPrefix}-button-item-name`
|
|
64
60
|
}, action.text), action.description && React.createElement("div", {
|
|
@@ -67,11 +63,8 @@ export const ActionSheet = p => {
|
|
|
67
63
|
className: `${classPrefix}-cancel`
|
|
68
64
|
}, React.createElement("div", {
|
|
69
65
|
className: `${classPrefix}-button-item-wrapper`
|
|
70
|
-
}, React.createElement(
|
|
71
|
-
|
|
72
|
-
fill: 'none',
|
|
73
|
-
shape: 'rectangular',
|
|
74
|
-
className: `${classPrefix}-button-item`,
|
|
66
|
+
}, React.createElement("a", {
|
|
67
|
+
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`),
|
|
75
68
|
onClick: () => {
|
|
76
69
|
var _a;
|
|
77
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
export declare const dot:
|
|
3
|
+
export declare const dot: JSX.Element;
|
|
4
4
|
export declare type BadgeProps = {
|
|
5
5
|
content?: React.ReactNode | typeof dot;
|
|
6
6
|
color?: string;
|
|
@@ -2,7 +2,7 @@ import classNames from 'classnames';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { withNativeProps } from '../../utils/native-props';
|
|
4
4
|
const classPrefix = `adm-badge`;
|
|
5
|
-
export const dot =
|
|
5
|
+
export const dot = React.createElement(React.Fragment, null);
|
|
6
6
|
export const Badge = props => {
|
|
7
7
|
const {
|
|
8
8
|
content,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './badge.less';
|
|
3
|
-
import { dot } from './badge';
|
|
4
3
|
export type { BadgeProps } from './badge';
|
|
5
|
-
declare
|
|
6
|
-
dot:
|
|
4
|
+
declare const _default: import("react").FC<import("./badge").BadgeProps> & {
|
|
5
|
+
dot: JSX.Element;
|
|
7
6
|
};
|
|
8
|
-
declare const _default: import("react").FC<import("./badge").BadgeProps> & Properties;
|
|
9
7
|
export default _default;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "./badge.css";
|
|
2
2
|
import { Badge, dot } from './badge';
|
|
3
3
|
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component';
|
|
4
|
-
|
|
4
|
+
export default attachPropertiesToComponent(Badge, {
|
|
5
5
|
dot
|
|
6
|
-
};
|
|
7
|
-
export default attachPropertiesToComponent(Badge, properties);
|
|
6
|
+
});
|