antd-mobile 5.12.1 → 5.12.4
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/badge/badge.d.ts +1 -1
- package/2x/cjs/components/badge/badge.js +3 -1
- package/2x/cjs/components/badge/index.d.ts +1 -1
- 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.js +2 -2
- package/2x/cjs/components/dialog/dialog.d.ts +2 -1
- package/2x/cjs/components/dropdown/dropdown.css +1 -1
- package/2x/cjs/components/error-block/images/busy.d.ts +1 -0
- package/2x/cjs/components/error-block/images/default.d.ts +1 -0
- package/2x/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/cjs/components/error-block/images/empty.d.ts +1 -0
- 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 -1
- package/2x/cjs/components/image/image.js +6 -4
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -4
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +8 -6
- package/2x/cjs/components/modal/modal.d.ts +2 -1
- package/2x/cjs/components/popup/popup.d.ts +2 -1
- package/2x/cjs/components/search-bar/search-bar.js +5 -8
- package/2x/cjs/components/side-bar/side-bar.d.ts +2 -1
- package/2x/cjs/components/tabs/tabs.css +4 -3
- package/2x/cjs/components/tabs/tabs.d.ts +1 -1
- package/2x/cjs/components/toast/toast.css +1 -1
- package/2x/cjs/components/toast/toast.d.ts +2 -1
- package/2x/cjs/utils/get-scroll-parent.js +1 -1
- 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 +1 -1
- 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.js +2 -2
- package/2x/es/components/dialog/dialog.d.ts +2 -1
- package/2x/es/components/dropdown/dropdown.css +1 -1
- package/2x/es/components/error-block/images/busy.d.ts +1 -0
- package/2x/es/components/error-block/images/default.d.ts +1 -0
- package/2x/es/components/error-block/images/disconnected.d.ts +1 -0
- package/2x/es/components/error-block/images/empty.d.ts +1 -0
- 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 -1
- package/2x/es/components/image/image.js +4 -3
- package/2x/es/components/image-uploader/image-uploader.js +2 -5
- package/2x/es/components/infinite-scroll/infinite-scroll.js +8 -6
- package/2x/es/components/modal/modal.d.ts +2 -1
- package/2x/es/components/popup/popup.d.ts +2 -1
- package/2x/es/components/search-bar/search-bar.js +5 -8
- package/2x/es/components/side-bar/side-bar.d.ts +2 -1
- package/2x/es/components/tabs/tabs.css +4 -3
- package/2x/es/components/tabs/tabs.d.ts +1 -1
- package/2x/es/components/toast/toast.css +1 -1
- package/2x/es/components/toast/toast.d.ts +2 -1
- package/2x/es/utils/get-scroll-parent.js +1 -1
- package/2x/package.json +3 -8
- package/bundle/antd-mobile.cjs.js +39 -24
- package/bundle/antd-mobile.es.js +40 -25
- package/bundle/style.css +10 -7
- package/cjs/components/badge/badge.d.ts +1 -1
- package/cjs/components/badge/badge.js +3 -1
- package/cjs/components/badge/index.d.ts +1 -1
- package/cjs/components/button/button.d.ts +6 -4
- package/cjs/components/button/button.js +5 -1
- package/cjs/components/calendar/calendar.js +2 -2
- package/cjs/components/dialog/dialog.d.ts +2 -1
- package/cjs/components/dropdown/dropdown.css +1 -1
- package/cjs/components/error-block/images/busy.d.ts +1 -0
- package/cjs/components/error-block/images/default.d.ts +1 -0
- package/cjs/components/error-block/images/disconnected.d.ts +1 -0
- package/cjs/components/error-block/images/empty.d.ts +1 -0
- 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 -1
- package/cjs/components/image/image.js +6 -4
- package/cjs/components/image-uploader/image-uploader.js +1 -4
- package/cjs/components/infinite-scroll/infinite-scroll.js +8 -6
- package/cjs/components/modal/modal.d.ts +2 -1
- package/cjs/components/popup/popup.d.ts +2 -1
- package/cjs/components/search-bar/search-bar.js +5 -8
- package/cjs/components/side-bar/side-bar.d.ts +2 -1
- package/cjs/components/tabs/tabs.css +4 -3
- package/cjs/components/tabs/tabs.d.ts +1 -1
- package/cjs/components/toast/toast.css +1 -1
- package/cjs/components/toast/toast.d.ts +2 -1
- package/cjs/utils/get-scroll-parent.js +1 -1
- package/es/components/badge/badge.d.ts +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/index.d.ts +1 -1
- package/es/components/button/button.d.ts +6 -4
- package/es/components/button/button.js +5 -1
- package/es/components/calendar/calendar.js +2 -2
- package/es/components/dialog/dialog.d.ts +2 -1
- package/es/components/dropdown/dropdown.css +1 -1
- package/es/components/error-block/images/busy.d.ts +1 -0
- package/es/components/error-block/images/default.d.ts +1 -0
- package/es/components/error-block/images/disconnected.d.ts +1 -0
- package/es/components/error-block/images/empty.d.ts +1 -0
- 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 -1
- package/es/components/image/image.js +4 -3
- package/es/components/image-uploader/image-uploader.js +2 -5
- package/es/components/infinite-scroll/infinite-scroll.js +8 -6
- package/es/components/modal/modal.d.ts +2 -1
- package/es/components/popup/popup.d.ts +2 -1
- package/es/components/search-bar/search-bar.js +5 -8
- package/es/components/side-bar/side-bar.d.ts +2 -1
- package/es/components/tabs/tabs.css +4 -3
- package/es/components/tabs/tabs.d.ts +1 -1
- package/es/components/toast/toast.css +1 -1
- package/es/components/toast/toast.d.ts +2 -1
- package/es/utils/get-scroll-parent.js +1 -1
- package/package.json +3 -8
- package/umd/antd-mobile.js +1 -1
package/bundle/style.css
CHANGED
|
@@ -757,6 +757,8 @@ div.adm-px-tester {
|
|
|
757
757
|
--content-padding: 12px;
|
|
758
758
|
--active-line-height: 2px;
|
|
759
759
|
--active-line-border-radius: var(--active-line-height);
|
|
760
|
+
--active-line-color: var(--adm-color-primary);
|
|
761
|
+
--active-title-color: var(--adm-color-primary);
|
|
760
762
|
position: relative;
|
|
761
763
|
min-width: 0;
|
|
762
764
|
}
|
|
@@ -792,7 +794,7 @@ div.adm-px-tester {
|
|
|
792
794
|
cursor: pointer;
|
|
793
795
|
}
|
|
794
796
|
.adm-tabs-tab-active {
|
|
795
|
-
color: var(--
|
|
797
|
+
color: var(--active-title-color);
|
|
796
798
|
}
|
|
797
799
|
.adm-tabs-tab-disabled {
|
|
798
800
|
opacity: 0.5;
|
|
@@ -802,8 +804,7 @@ div.adm-px-tester {
|
|
|
802
804
|
position: absolute;
|
|
803
805
|
bottom: 0;
|
|
804
806
|
height: var(--active-line-height);
|
|
805
|
-
|
|
806
|
-
background: var(--adm-color-primary);
|
|
807
|
+
background: var(--active-line-color);
|
|
807
808
|
border-radius: var(--active-line-border-radius);
|
|
808
809
|
}
|
|
809
810
|
.adm-tabs-content {
|
|
@@ -1185,12 +1186,14 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
1185
1186
|
}
|
|
1186
1187
|
.adm-image-tip {
|
|
1187
1188
|
position: relative;
|
|
1188
|
-
background-color: #
|
|
1189
|
+
background-color: #f5f5f5;
|
|
1189
1190
|
height: 100%;
|
|
1190
1191
|
min-height: 24px;
|
|
1191
1192
|
min-width: 24px;
|
|
1192
1193
|
}
|
|
1193
|
-
.adm-image-tip >
|
|
1194
|
+
.adm-image-tip > svg {
|
|
1195
|
+
width: 24px;
|
|
1196
|
+
height: 24px;
|
|
1194
1197
|
position: absolute;
|
|
1195
1198
|
left: 50%;
|
|
1196
1199
|
top: 50%;
|
|
@@ -1270,7 +1273,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
1270
1273
|
.adm-dropdown-item .adm-dropdown-item-title-arrow {
|
|
1271
1274
|
color: var(--adm-color-light);
|
|
1272
1275
|
font-size: 9px;
|
|
1273
|
-
transform: rotate(0deg) translateY(
|
|
1276
|
+
transform: rotate(0deg) translateY(1px);
|
|
1274
1277
|
transition: all ease 0.2s;
|
|
1275
1278
|
}
|
|
1276
1279
|
.adm-dropdown-item .adm-dropdown-item-title-arrow-active {
|
|
@@ -3755,7 +3758,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
3755
3758
|
transform: translate(-50%, -50%);
|
|
3756
3759
|
width: auto;
|
|
3757
3760
|
min-width: 96px;
|
|
3758
|
-
max-width:
|
|
3761
|
+
max-width: 200px;
|
|
3759
3762
|
max-height: 70%;
|
|
3760
3763
|
overflow: auto;
|
|
3761
3764
|
color: white;
|
|
@@ -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,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<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--text-color" | "--background-color" | "--border-radius" | "--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));
|
|
@@ -153,10 +153,10 @@ const Calendar = (0, _react.forwardRef)((p, ref) => {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const inThisMonth = d.month() === current.month();
|
|
156
|
-
const disabled =
|
|
156
|
+
const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
157
157
|
cells.push(_react.default.createElement("div", {
|
|
158
158
|
key: d.valueOf(),
|
|
159
|
-
className: (0, _classnames.default)(`${classPrefix}-cell`, disabled && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
159
|
+
className: (0, _classnames.default)(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
160
160
|
[`${classPrefix}-cell-today`]: d.isSame(today, 'day'),
|
|
161
161
|
[`${classPrefix}-cell-selected`]: isSelect,
|
|
162
162
|
[`${classPrefix}-cell-selected-begin`]: isBegin,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
import type { MaskProps } from '../mask';
|
|
2
3
|
import { Action } from './dialog-action-button';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
@@ -19,7 +20,7 @@ export declare type DialogProps = {
|
|
|
19
20
|
getContainer?: GetContainer;
|
|
20
21
|
bodyStyle?: React.CSSProperties;
|
|
21
22
|
bodyClassName?: string;
|
|
22
|
-
maskStyle?:
|
|
23
|
+
maskStyle?: MaskProps['style'];
|
|
23
24
|
maskClassName?: string;
|
|
24
25
|
stopPropagation?: PropagationEvent[];
|
|
25
26
|
disableBodyScroll?: boolean;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
.adm-dropdown-item .adm-dropdown-item-title-arrow {
|
|
33
33
|
color: var(--adm-color-light);
|
|
34
34
|
font-size: 9px;
|
|
35
|
-
transform: rotate(0deg) translateY(
|
|
35
|
+
transform: rotate(0deg) translateY(1px);
|
|
36
36
|
transition: all ease 0.2s;
|
|
37
37
|
}
|
|
38
38
|
.adm-dropdown-item .adm-dropdown-item-title-arrow-active {
|
|
@@ -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;
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
}
|
|
13
13
|
.adm-image-tip {
|
|
14
14
|
position: relative;
|
|
15
|
-
background-color: #
|
|
15
|
+
background-color: #f5f5f5;
|
|
16
16
|
height: 100%;
|
|
17
17
|
min-height: 24px;
|
|
18
18
|
min-width: 24px;
|
|
19
19
|
}
|
|
20
|
-
.adm-image-tip >
|
|
20
|
+
.adm-image-tip > svg {
|
|
21
|
+
width: 24px;
|
|
22
|
+
height: 24px;
|
|
21
23
|
position: absolute;
|
|
22
24
|
left: 50%;
|
|
23
25
|
top: 50%;
|
|
@@ -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,10 +32,10 @@ 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(
|
|
38
|
+
}, _react.default.createElement(_brokenImageIcon.BrokenImageIcon, null)),
|
|
37
39
|
lazy: false
|
|
38
40
|
};
|
|
39
41
|
const Image = (0, _stagedComponents.staged)(p => {
|
|
@@ -53,9 +53,6 @@ const ImageUploader = p => {
|
|
|
53
53
|
} = (0, _configProvider.useConfig)();
|
|
54
54
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
55
55
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
56
|
-
const updateValue = (0, _ahooks.useMemoizedFn)(updater => {
|
|
57
|
-
setValue(updater(value));
|
|
58
|
-
});
|
|
59
56
|
const [tasks, setTasks] = (0, _react.useState)([]);
|
|
60
57
|
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
61
58
|
setTasks(prev => prev.filter(task => {
|
|
@@ -134,7 +131,7 @@ const ImageUploader = p => {
|
|
|
134
131
|
return task;
|
|
135
132
|
});
|
|
136
133
|
});
|
|
137
|
-
|
|
134
|
+
setValue(prev => {
|
|
138
135
|
const newVal = Object.assign({}, result);
|
|
139
136
|
return [...prev, newVal];
|
|
140
137
|
});
|
|
@@ -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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
import type { MaskProps } from '../mask';
|
|
2
3
|
import { Action } from './modal-action-button';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
@@ -19,7 +20,7 @@ export declare type ModalProps = {
|
|
|
19
20
|
getContainer?: GetContainer;
|
|
20
21
|
bodyStyle?: React.CSSProperties;
|
|
21
22
|
bodyClassName?: string;
|
|
22
|
-
maskStyle?:
|
|
23
|
+
maskStyle?: MaskProps['style'];
|
|
23
24
|
maskClassName?: string;
|
|
24
25
|
stopPropagation?: PropagationEvent[];
|
|
25
26
|
showCloseButton?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import type { MaskProps } from '../mask';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
5
6
|
export declare type PopupProps = {
|
|
@@ -15,7 +16,7 @@ export declare type PopupProps = {
|
|
|
15
16
|
bodyClassName?: string;
|
|
16
17
|
bodyStyle?: React.CSSProperties;
|
|
17
18
|
maskClassName?: string;
|
|
18
|
-
maskStyle?:
|
|
19
|
+
maskStyle?: MaskProps['style'];
|
|
19
20
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
21
|
stopPropagation?: PropagationEvent[];
|
|
21
22
|
children?: React.ReactNode;
|
|
@@ -74,7 +74,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
74
74
|
}));
|
|
75
75
|
|
|
76
76
|
const renderCancelButton = () => {
|
|
77
|
-
let isShowCancel
|
|
77
|
+
let isShowCancel;
|
|
78
78
|
|
|
79
79
|
if (typeof props.showCancelButton === 'function') {
|
|
80
80
|
isShowCancel = props.showCancelButton(hasFocus, value);
|
|
@@ -83,13 +83,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
return isShowCancel && _react.default.createElement("div", {
|
|
86
|
-
className: `${classPrefix}-suffix
|
|
87
|
-
onMouseDown: e => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
},
|
|
90
|
-
onTouchStart: e => {
|
|
91
|
-
e.preventDefault();
|
|
92
|
-
}
|
|
86
|
+
className: `${classPrefix}-suffix`
|
|
93
87
|
}, _react.default.createElement(_button.default, {
|
|
94
88
|
fill: 'none',
|
|
95
89
|
className: `${classPrefix}-cancel-button`,
|
|
@@ -102,6 +96,9 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
102
96
|
|
|
103
97
|
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
|
|
104
98
|
(_c = props.onCancel) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
99
|
+
},
|
|
100
|
+
onMouseDown: e => {
|
|
101
|
+
e.preventDefault();
|
|
105
102
|
}
|
|
106
103
|
}, props.cancelText));
|
|
107
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 = {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
--content-padding: 12px;
|
|
4
4
|
--active-line-height: 2px;
|
|
5
5
|
--active-line-border-radius: var(--active-line-height);
|
|
6
|
+
--active-line-color: var(--adm-color-primary);
|
|
7
|
+
--active-title-color: var(--adm-color-primary);
|
|
6
8
|
position: relative;
|
|
7
9
|
min-width: 0;
|
|
8
10
|
}
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
cursor: pointer;
|
|
39
41
|
}
|
|
40
42
|
.adm-tabs-tab-active {
|
|
41
|
-
color: var(--
|
|
43
|
+
color: var(--active-title-color);
|
|
42
44
|
}
|
|
43
45
|
.adm-tabs-tab-disabled {
|
|
44
46
|
opacity: 0.5;
|
|
@@ -48,8 +50,7 @@
|
|
|
48
50
|
position: absolute;
|
|
49
51
|
bottom: 0;
|
|
50
52
|
height: var(--active-line-height);
|
|
51
|
-
|
|
52
|
-
background: var(--adm-color-primary);
|
|
53
|
+
background: var(--active-line-color);
|
|
53
54
|
border-radius: var(--active-line-border-radius);
|
|
54
55
|
}
|
|
55
56
|
.adm-tabs-content {
|
|
@@ -15,5 +15,5 @@ export declare type TabsProps = {
|
|
|
15
15
|
stretch?: boolean;
|
|
16
16
|
onChange?: (key: string) => void;
|
|
17
17
|
children?: React.ReactNode;
|
|
18
|
-
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding'>;
|
|
18
|
+
} & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
|
|
19
19
|
export declare const Tabs: FC<TabsProps>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
+
import type { MaskProps } from '../mask';
|
|
2
3
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
export interface ToastProps {
|
|
5
6
|
afterClose?: () => void;
|
|
6
|
-
maskStyle?:
|
|
7
|
+
maskStyle?: MaskProps['style'];
|
|
7
8
|
maskClassName?: string;
|
|
8
9
|
maskClickable?: boolean;
|
|
9
10
|
content?: ReactNode;
|
|
@@ -27,7 +27,7 @@ function getScrollParent(el, root = defaultRoot) {
|
|
|
27
27
|
overflowY
|
|
28
28
|
} = window.getComputedStyle(node);
|
|
29
29
|
|
|
30
|
-
if (overflowStylePatterns.includes(overflowY)) {
|
|
30
|
+
if (overflowStylePatterns.includes(overflowY) && node.scrollHeight > node.clientHeight) {
|
|
31
31
|
return node;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -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,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<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & NativeProps<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color"> & React.RefAttributes<ButtonRef>>;
|
|
35
|
+
export {};
|
|
@@ -61,7 +61,11 @@ export const Button = forwardRef((p, ref) => {
|
|
|
61
61
|
[`${classPrefix}-large`]: props.size === 'large',
|
|
62
62
|
[`${classPrefix}-loading`]: loading
|
|
63
63
|
}, `${classPrefix}-shape-${props.shape}`),
|
|
64
|
-
disabled: disabled
|
|
64
|
+
disabled: disabled,
|
|
65
|
+
onMouseDown: props.onMouseDown,
|
|
66
|
+
onMouseUp: props.onMouseUp,
|
|
67
|
+
onTouchStart: props.onTouchStart,
|
|
68
|
+
onTouchEnd: props.onTouchEnd
|
|
65
69
|
}, loading ? React.createElement("div", {
|
|
66
70
|
className: `${classPrefix}-loading-wrapper`
|
|
67
71
|
}, props.loadingIcon, props.loadingText) : props.children));
|
|
@@ -125,10 +125,10 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const inThisMonth = d.month() === current.month();
|
|
128
|
-
const disabled =
|
|
128
|
+
const disabled = maxDay && d.isAfter(maxDay, 'day') || minDay && d.isBefore(minDay, 'day');
|
|
129
129
|
cells.push(React.createElement("div", {
|
|
130
130
|
key: d.valueOf(),
|
|
131
|
-
className: classNames(`${classPrefix}-cell`, disabled && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
131
|
+
className: classNames(`${classPrefix}-cell`, (disabled || !inThisMonth) && `${classPrefix}-cell-disabled`, inThisMonth && {
|
|
132
132
|
[`${classPrefix}-cell-today`]: d.isSame(today, 'day'),
|
|
133
133
|
[`${classPrefix}-cell-selected`]: isSelect,
|
|
134
134
|
[`${classPrefix}-cell-selected-begin`]: isBegin,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
import type { MaskProps } from '../mask';
|
|
2
3
|
import { Action } from './dialog-action-button';
|
|
3
4
|
import { GetContainer } from '../../utils/render-to-container';
|
|
4
5
|
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
@@ -19,7 +20,7 @@ export declare type DialogProps = {
|
|
|
19
20
|
getContainer?: GetContainer;
|
|
20
21
|
bodyStyle?: React.CSSProperties;
|
|
21
22
|
bodyClassName?: string;
|
|
22
|
-
maskStyle?:
|
|
23
|
+
maskStyle?: MaskProps['style'];
|
|
23
24
|
maskClassName?: string;
|
|
24
25
|
stopPropagation?: PropagationEvent[];
|
|
25
26
|
disableBodyScroll?: boolean;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
.adm-dropdown-item .adm-dropdown-item-title-arrow {
|
|
33
33
|
color: var(--adm-color-light);
|
|
34
34
|
font-size: 9px;
|
|
35
|
-
transform: rotate(0deg) translateY(
|
|
35
|
+
transform: rotate(0deg) translateY(1px);
|
|
36
36
|
transition: all ease 0.2s;
|
|
37
37
|
}
|
|
38
38
|
.adm-dropdown-item .adm-dropdown-item-title-arrow-active {
|