antd-mobile 5.0.0-rc.22 → 5.0.0-rc.23
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 -0
- package/2x/cjs/components/badge/badge.css +18 -10
- package/2x/cjs/components/badge/badge.d.ts +1 -0
- package/2x/cjs/components/badge/badge.js +4 -5
- package/2x/cjs/components/button/button.css +1 -1
- package/2x/cjs/components/checkbox/check-icon.js +4 -13
- package/2x/cjs/components/checkbox/checkbox.css +5 -14
- package/2x/cjs/components/checkbox/checkbox.js +3 -5
- package/2x/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/2x/cjs/components/checkbox/indeterminate-icon.js +24 -0
- package/2x/cjs/components/image-viewer/image-viewer.d.ts +8 -2
- package/2x/cjs/components/image-viewer/image-viewer.js +8 -5
- package/2x/cjs/components/image-viewer/index.d.ts +6 -2
- package/2x/cjs/components/image-viewer/slides.d.ts +7 -3
- package/2x/cjs/components/image-viewer/slides.js +18 -11
- package/2x/cjs/components/modal/modal.css +25 -20
- package/2x/cjs/components/modal/modal.js +8 -12
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +2 -2
- package/2x/cjs/components/picker-view/picker-view.css +2 -1
- package/2x/cjs/components/picker-view/wheel.js +1 -1
- package/2x/cjs/components/radio/radio.css +4 -7
- package/2x/cjs/components/radio/radio.js +1 -3
- package/2x/cjs/components/search-bar/search-bar.css +1 -1
- package/2x/cjs/components/switch/switch.css +8 -3
- package/2x/es/components/badge/badge.css +18 -10
- package/2x/es/components/badge/badge.d.ts +1 -0
- package/2x/es/components/badge/badge.js +4 -5
- package/2x/es/components/button/button.css +1 -1
- package/2x/es/components/checkbox/check-icon.js +4 -13
- package/2x/es/components/checkbox/checkbox.css +5 -14
- package/2x/es/components/checkbox/checkbox.js +2 -5
- package/2x/es/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/2x/es/components/checkbox/indeterminate-icon.js +10 -0
- package/2x/es/components/image-viewer/image-viewer.d.ts +8 -2
- package/2x/es/components/image-viewer/image-viewer.js +4 -3
- package/2x/es/components/image-viewer/index.d.ts +6 -2
- package/2x/es/components/image-viewer/slides.d.ts +7 -3
- package/2x/es/components/image-viewer/slides.js +19 -10
- package/2x/es/components/modal/modal.css +25 -20
- package/2x/es/components/modal/modal.js +8 -12
- package/2x/es/components/passcode-input/passcode-input.d.ts +2 -2
- package/2x/es/components/picker-view/picker-view.css +2 -1
- package/2x/es/components/picker-view/wheel.js +1 -1
- package/2x/es/components/radio/radio.css +4 -7
- package/2x/es/components/radio/radio.js +1 -3
- package/2x/es/components/search-bar/search-bar.css +1 -1
- package/2x/es/components/switch/switch.css +8 -3
- package/2x/package.json +1 -1
- package/README.md +1 -0
- package/cjs/components/badge/badge.css +16 -10
- package/cjs/components/badge/badge.d.ts +1 -0
- package/cjs/components/badge/badge.js +4 -5
- package/cjs/components/button/button.css +1 -1
- package/cjs/components/checkbox/check-icon.js +4 -13
- package/cjs/components/checkbox/checkbox.css +5 -13
- package/cjs/components/checkbox/checkbox.js +3 -5
- package/cjs/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/cjs/components/checkbox/indeterminate-icon.js +24 -0
- package/cjs/components/image-viewer/image-viewer.d.ts +8 -2
- package/cjs/components/image-viewer/image-viewer.js +8 -5
- package/cjs/components/image-viewer/index.d.ts +6 -2
- package/cjs/components/image-viewer/slides.d.ts +7 -3
- package/cjs/components/image-viewer/slides.js +18 -11
- package/cjs/components/modal/modal.css +23 -19
- package/cjs/components/modal/modal.js +8 -12
- package/cjs/components/passcode-input/passcode-input.d.ts +2 -2
- package/cjs/components/picker-view/picker-view.css +2 -1
- package/cjs/components/picker-view/wheel.js +1 -1
- package/cjs/components/radio/radio.css +4 -7
- package/cjs/components/radio/radio.js +1 -3
- package/cjs/components/search-bar/search-bar.css +1 -1
- package/cjs/components/switch/switch.css +8 -3
- package/es/components/badge/badge.css +16 -10
- package/es/components/badge/badge.d.ts +1 -0
- package/es/components/badge/badge.js +4 -5
- package/es/components/button/button.css +1 -1
- package/es/components/checkbox/check-icon.js +4 -13
- package/es/components/checkbox/checkbox.css +5 -13
- package/es/components/checkbox/checkbox.js +2 -5
- package/es/components/checkbox/indeterminate-icon.d.ts +3 -0
- package/es/components/checkbox/indeterminate-icon.js +10 -0
- package/es/components/image-viewer/image-viewer.d.ts +8 -2
- package/es/components/image-viewer/image-viewer.js +4 -3
- package/es/components/image-viewer/index.d.ts +6 -2
- package/es/components/image-viewer/slides.d.ts +7 -3
- package/es/components/image-viewer/slides.js +19 -10
- package/es/components/modal/modal.css +23 -19
- package/es/components/modal/modal.js +8 -12
- package/es/components/passcode-input/passcode-input.d.ts +2 -2
- package/es/components/picker-view/picker-view.css +2 -1
- package/es/components/picker-view/wheel.js +1 -1
- package/es/components/radio/radio.css +4 -7
- package/es/components/radio/radio.js +1 -3
- package/es/components/search-bar/search-bar.css +1 -1
- package/es/components/switch/switch.css +8 -3
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
package/2x/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Average time to resolve an issue')
|
|
8
8
|
[](http://isitmaintained.com/project/ant-design/ant-design-mobile 'Percentage of issues still open')
|
|
9
9
|

|
|
10
|
+
[](https://codecov.io/gh/ant-design/ant-design-mobile)
|
|
10
11
|

|
|
11
12
|
|
|
12
13
|
```bash
|
|
@@ -4,24 +4,28 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.adm-badge {
|
|
7
|
-
display: inline-
|
|
8
|
-
color: #fff;
|
|
9
|
-
font-weight: normal;
|
|
10
|
-
text-align: center;
|
|
7
|
+
display: inline-flex;
|
|
11
8
|
vertical-align: middle;
|
|
12
|
-
box-sizing:
|
|
13
|
-
min-width: 32px;
|
|
9
|
+
box-sizing: content-box;
|
|
14
10
|
border-radius: 200px;
|
|
15
|
-
padding: 0 8px;
|
|
16
|
-
font-size: 18px;
|
|
17
|
-
line-height: 28px;
|
|
18
|
-
white-space: nowrap;
|
|
19
11
|
background-color: var(--color);
|
|
20
12
|
--right: 0;
|
|
21
13
|
--top: 0;
|
|
22
14
|
--color: var(--adm-badge-color, #ff411c);
|
|
23
15
|
}
|
|
24
16
|
|
|
17
|
+
.adm-badge-content {
|
|
18
|
+
color: #fff;
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
min-width: 16px;
|
|
21
|
+
padding: 2px 8px;
|
|
22
|
+
font-size: 18px;
|
|
23
|
+
line-height: 24px;
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
font-weight: normal;
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
25
29
|
.adm-badge-fixed {
|
|
26
30
|
position: absolute;
|
|
27
31
|
right: var(--right);
|
|
@@ -34,4 +38,8 @@
|
|
|
34
38
|
width: 20px;
|
|
35
39
|
height: 20px;
|
|
36
40
|
border-radius: 10px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.adm-badge-bordered {
|
|
44
|
+
border: solid 2px var(--adm-color-white);
|
|
37
45
|
}
|
|
@@ -24,16 +24,15 @@ const Badge = props => {
|
|
|
24
24
|
children
|
|
25
25
|
} = props;
|
|
26
26
|
const isDot = content === dot;
|
|
27
|
-
const badgeCls = (0, _classnames.default)(classPrefix, {
|
|
28
|
-
[`${classPrefix}-fixed`]: !!children,
|
|
29
|
-
[`${classPrefix}-dot`]: isDot
|
|
30
|
-
});
|
|
27
|
+
const badgeCls = (0, _classnames.default)(classPrefix, !!children && `${classPrefix}-fixed`, isDot && `${classPrefix}-dot`, props.bordered && `${classPrefix}-bordered`);
|
|
31
28
|
const element = content ? (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
32
29
|
className: badgeCls,
|
|
33
30
|
style: {
|
|
34
31
|
'--color': color
|
|
35
32
|
}
|
|
36
|
-
}, !isDot &&
|
|
33
|
+
}, !isDot && _react.default.createElement("div", {
|
|
34
|
+
className: `${classPrefix}-content`
|
|
35
|
+
}, content))) : null;
|
|
37
36
|
return children ? _react.default.createElement("div", {
|
|
38
37
|
className: `${classPrefix}-wrap`
|
|
39
38
|
}, children, element) : element;
|
|
@@ -15,19 +15,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15
15
|
|
|
16
16
|
const CheckIcon = (0, _react.memo)(props => {
|
|
17
17
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
18
|
-
viewBox: '0 0
|
|
19
|
-
}, _react.default.createElement("g", {
|
|
20
|
-
stroke: 'none',
|
|
21
|
-
strokeWidth: '1',
|
|
22
|
-
fill: 'none',
|
|
23
|
-
fillRule: 'evenodd'
|
|
24
|
-
}, _react.default.createElement("g", {
|
|
25
|
-
transform: 'translate(-35.000000, -40.000000)',
|
|
26
|
-
fill: 'currentColor'
|
|
27
|
-
}, _react.default.createElement("g", {
|
|
28
|
-
transform: 'translate(24.000000, 26.000000)'
|
|
18
|
+
viewBox: '0 0 40 40'
|
|
29
19
|
}, _react.default.createElement("path", {
|
|
30
|
-
d: '
|
|
31
|
-
|
|
20
|
+
d: 'M31.5541766,15 L28.0892433,15 L28.0892434,15 C27.971052,15 27.8576674,15.044522 27.7740471,15.1239792 L18.2724722,24.1625319 L13.2248725,19.3630279 L13.2248725,19.3630279 C13.1417074,19.2834412 13.0287551,19.2384807 12.9107898,19.2380079 L9.44474455,19.2380079 L9.44474454,19.2380079 C9.19869815,19.2384085 8.99957935,19.4284738 9,19.66253 C9,19.7747587 9.04719253,19.8823283 9.13066188,19.9616418 L17.0907466,27.5338228 C17.4170809,27.8442545 17.8447695,28 18.2713393,28 L18.2980697,28 C18.7168464,27.993643 19.133396,27.8378975 19.4530492,27.5338228 L31.8693384,15.7236361 L31.8693384,15.7236361 C32.0434167,15.5582251 32.0435739,15.2898919 31.8696892,15.1242941 C31.7860402,15.0446329 31.6725052,15 31.5541421,15 L31.5541766,15 Z',
|
|
21
|
+
fill: 'currentColor'
|
|
22
|
+
})));
|
|
32
23
|
});
|
|
33
24
|
exports.CheckIcon = CheckIcon;
|
|
@@ -18,17 +18,15 @@
|
|
|
18
18
|
border: 2px solid var(--adm-color-light);
|
|
19
19
|
border-radius: var(--icon-size);
|
|
20
20
|
box-sizing: border-box;
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
align-items: center;
|
|
24
21
|
width: var(--icon-size);
|
|
25
22
|
height: var(--icon-size);
|
|
26
|
-
color:
|
|
23
|
+
color: var(--adm-color-white);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
.adm-checkbox .adm-checkbox-icon
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
.adm-checkbox .adm-checkbox-icon > svg {
|
|
27
|
+
display: block;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
.adm-checkbox.adm-checkbox-block {
|
|
@@ -63,13 +61,6 @@
|
|
|
63
61
|
color: var(--adm-color-primary);
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
.adm-checkbox.adm-checkbox-indeterminate .adm-checkbox-indeterminate-checked {
|
|
67
|
-
width: 60%;
|
|
68
|
-
height: 60%;
|
|
69
|
-
border-radius: 100%;
|
|
70
|
-
background-color: currentColor;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
64
|
.adm-checkbox-content {
|
|
74
65
|
flex: 0 1 auto;
|
|
75
66
|
font-size: var(--font-size);
|
|
@@ -21,6 +21,8 @@ var _devLog = require("../../utils/dev-log");
|
|
|
21
21
|
|
|
22
22
|
var _checkIcon = require("./check-icon");
|
|
23
23
|
|
|
24
|
+
var _indeterminateIcon = require("./indeterminate-icon");
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
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); }
|
|
@@ -85,11 +87,7 @@ const Checkbox = p => {
|
|
|
85
87
|
|
|
86
88
|
return _react.default.createElement("div", {
|
|
87
89
|
className: `${classPrefix}-icon`
|
|
88
|
-
}, props.indeterminate ? _react.default.createElement(
|
|
89
|
-
className: `${classPrefix}-indeterminate-checked`
|
|
90
|
-
}) : checked && _react.default.createElement(_checkIcon.CheckIcon, {
|
|
91
|
-
className: `${classPrefix}-icon-checked`
|
|
92
|
-
}));
|
|
90
|
+
}, props.indeterminate ? _react.default.createElement(_indeterminateIcon.IndeterminateIcon, null) : checked && _react.default.createElement(_checkIcon.CheckIcon, null));
|
|
93
91
|
};
|
|
94
92
|
|
|
95
93
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.IndeterminateIcon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _nativeProps = require("../../utils/native-props");
|
|
11
|
+
|
|
12
|
+
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); }
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
16
|
+
const IndeterminateIcon = (0, _react.memo)(props => {
|
|
17
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
18
|
+
viewBox: '0 0 40 40'
|
|
19
|
+
}, _react.default.createElement("path", {
|
|
20
|
+
d: 'M20,9 C26.0752953,9 31,13.9247047 31,20 C31,26.0752953 26.0752953,31 20,31 C13.9247047,31 9,26.0752953 9,20 C9,13.9247047 13.9247047,9 20,9 Z',
|
|
21
|
+
fill: 'currentColor'
|
|
22
|
+
})));
|
|
23
|
+
});
|
|
24
|
+
exports.IndeterminateIcon = IndeterminateIcon;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { GetContainer } from '../../utils/render-to-container';
|
|
3
|
+
import { SlidesRef } from './slides';
|
|
3
4
|
export declare type ImageViewerProps = {
|
|
4
5
|
image?: string;
|
|
5
6
|
maxZoom?: number;
|
|
@@ -9,9 +10,14 @@ export declare type ImageViewerProps = {
|
|
|
9
10
|
afterClose?: () => void;
|
|
10
11
|
};
|
|
11
12
|
export declare const ImageViewer: FC<ImageViewerProps>;
|
|
13
|
+
export declare type MultiImageViewerRef = SlidesRef;
|
|
12
14
|
export declare type MultiImageViewerProps = Omit<ImageViewerProps, 'image'> & {
|
|
13
15
|
images?: string[];
|
|
14
16
|
defaultIndex?: number;
|
|
15
17
|
onIndexChange?: (index: number) => void;
|
|
16
18
|
};
|
|
17
|
-
export declare const MultiImageViewer:
|
|
19
|
+
export declare const MultiImageViewer: React.ForwardRefExoticComponent<Pick<ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
|
|
20
|
+
images?: string[] | undefined;
|
|
21
|
+
defaultIndex?: number | undefined;
|
|
22
|
+
onIndexChange?: ((index: number) => void) | undefined;
|
|
23
|
+
} & React.RefAttributes<SlidesRef>>;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MultiImageViewer = exports.ImageViewer = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
11
11
|
|
|
@@ -19,6 +19,10 @@ var _slides = require("./slides");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
|
+
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; }
|
|
25
|
+
|
|
22
26
|
const classPrefix = `adm-image-viewer`;
|
|
23
27
|
const defaultProps = {
|
|
24
28
|
maxZoom: 3,
|
|
@@ -53,8 +57,7 @@ exports.ImageViewer = ImageViewer;
|
|
|
53
57
|
const multiDefaultProps = Object.assign(Object.assign({}, defaultProps), {
|
|
54
58
|
defaultIndex: 0
|
|
55
59
|
});
|
|
56
|
-
|
|
57
|
-
const MultiImageViewer = p => {
|
|
60
|
+
const MultiImageViewer = (0, _react.forwardRef)((p, ref) => {
|
|
58
61
|
const props = (0, _withDefaultProps.mergeProps)(multiDefaultProps, p);
|
|
59
62
|
|
|
60
63
|
const node = _react.default.createElement(_mask.default, {
|
|
@@ -65,6 +68,7 @@ const MultiImageViewer = p => {
|
|
|
65
68
|
}, _react.default.createElement("div", {
|
|
66
69
|
className: `${classPrefix}-content`
|
|
67
70
|
}, props.images && _react.default.createElement(_slides.Slides, {
|
|
71
|
+
ref: ref,
|
|
68
72
|
defaultIndex: props.defaultIndex,
|
|
69
73
|
onIndexChange: props.onIndexChange,
|
|
70
74
|
images: props.images,
|
|
@@ -77,6 +81,5 @@ const MultiImageViewer = p => {
|
|
|
77
81
|
})));
|
|
78
82
|
|
|
79
83
|
return (0, _renderToContainer.renderToContainer)(props.getContainer, node);
|
|
80
|
-
};
|
|
81
|
-
|
|
84
|
+
});
|
|
82
85
|
exports.MultiImageViewer = MultiImageViewer;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './image-viewer.less';
|
|
3
3
|
import { showMultiImageViewer, showImageViewer, clearImageViewer } from './methods';
|
|
4
|
-
export type { ImageViewerProps, MultiImageViewerProps } from './image-viewer';
|
|
4
|
+
export type { ImageViewerProps, MultiImageViewerProps, MultiImageViewerRef, } from './image-viewer';
|
|
5
5
|
export type { ImageViewerHandler } from './methods';
|
|
6
6
|
declare const _default: import("react").FC<import("./image-viewer").ImageViewerProps> & {
|
|
7
|
-
Multi: import("react").
|
|
7
|
+
Multi: import("react").ForwardRefExoticComponent<Pick<import("./image-viewer").ImageViewerProps, "visible" | "onClose" | "afterClose" | "getContainer" | "maxZoom"> & {
|
|
8
|
+
images?: string[] | undefined;
|
|
9
|
+
defaultIndex?: number | undefined;
|
|
10
|
+
onIndexChange?: ((index: number) => void) | undefined;
|
|
11
|
+
} & import("react").RefAttributes<import("./slides").SlidesRef>> & {
|
|
8
12
|
show: typeof showMultiImageViewer;
|
|
9
13
|
};
|
|
10
14
|
show: typeof showImageViewer;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type SlidesType = {
|
|
3
3
|
images: string[];
|
|
4
4
|
onTap: () => void;
|
|
5
5
|
maxZoom: number;
|
|
6
6
|
defaultIndex: number;
|
|
7
7
|
onIndexChange?: (index: number) => void;
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
export declare type SlidesRef = {
|
|
10
|
+
swipeTo: (index: number, immediate: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const Slides: React.ForwardRefExoticComponent<SlidesType & React.RefAttributes<SlidesRef>>;
|
|
@@ -22,8 +22,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
24
|
const classPrefix = `adm-image-viewer`;
|
|
25
|
-
|
|
26
|
-
const Slides = props => {
|
|
25
|
+
const Slides = (0, _react.forwardRef)((props, ref) => {
|
|
27
26
|
const slideWidth = window.innerWidth + (0, _convertPx.convertPx)(16);
|
|
28
27
|
const [{
|
|
29
28
|
x
|
|
@@ -35,10 +34,23 @@ const Slides = props => {
|
|
|
35
34
|
}
|
|
36
35
|
}));
|
|
37
36
|
const count = props.images.length;
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
|
|
38
|
+
function swipeTo(index, immediate = false) {
|
|
40
39
|
var _a;
|
|
41
40
|
|
|
41
|
+
const i = (0, _bound.bound)(index, 0, count - 1);
|
|
42
|
+
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, i);
|
|
43
|
+
api.start({
|
|
44
|
+
x: i * slideWidth,
|
|
45
|
+
immediate
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
50
|
+
swipeTo
|
|
51
|
+
}));
|
|
52
|
+
const dragLockRef = (0, _react.useRef)(false);
|
|
53
|
+
const bind = (0, _react2.useDrag)(state => {
|
|
42
54
|
if (dragLockRef.current) return;
|
|
43
55
|
const [offsetX] = state.offset;
|
|
44
56
|
|
|
@@ -46,11 +58,7 @@ const Slides = props => {
|
|
|
46
58
|
const minIndex = Math.floor(offsetX / slideWidth);
|
|
47
59
|
const maxIndex = minIndex + 1;
|
|
48
60
|
const velocityOffset = Math.min(state.velocity[0] * 2000, slideWidth) * state.direction[0];
|
|
49
|
-
|
|
50
|
-
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, index);
|
|
51
|
-
api.start({
|
|
52
|
-
x: index * slideWidth
|
|
53
|
-
});
|
|
61
|
+
swipeTo((0, _bound.bound)(Math.round((offsetX + velocityOffset) / slideWidth), minIndex, maxIndex));
|
|
54
62
|
} else {
|
|
55
63
|
api.start({
|
|
56
64
|
x: offsetX,
|
|
@@ -99,6 +107,5 @@ const Slides = props => {
|
|
|
99
107
|
},
|
|
100
108
|
dragLockRef: dragLockRef
|
|
101
109
|
}))));
|
|
102
|
-
};
|
|
103
|
-
|
|
110
|
+
});
|
|
104
111
|
exports.Slides = Slides;
|
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
.adm-modal-main {
|
|
23
23
|
width: 100%;
|
|
24
24
|
max-height: 70vh;
|
|
25
|
+
box-sizing: border-box;
|
|
25
26
|
font-size: 28px;
|
|
26
27
|
background-color: white;
|
|
27
28
|
border-radius: 16px;
|
|
28
|
-
overflow: hidden;
|
|
29
|
+
overflow-x: hidden;
|
|
30
|
+
overflow-y: auto;
|
|
29
31
|
display: flex;
|
|
30
32
|
flex-direction: column;
|
|
31
33
|
}
|
|
@@ -40,14 +42,12 @@
|
|
|
40
42
|
|
|
41
43
|
.adm-modal-main .adm-modal-body {
|
|
42
44
|
padding: 40px 24px 24px;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
.adm-modal-main .adm-modal-body
|
|
46
|
-
|
|
47
|
-
right: 24px;
|
|
48
|
-
top: 24px;
|
|
49
|
-
color: var(--adm-color-weak);
|
|
50
|
-
padding: 4px;
|
|
49
|
+
.adm-modal-main .adm-modal-body > * + * {
|
|
50
|
+
margin-top: 16px;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.adm-modal-main .adm-modal-body-header-wrapper {
|
|
@@ -63,39 +63,44 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.adm-modal-main .adm-modal-body-content {
|
|
66
|
-
max-height: 70vh;
|
|
67
|
-
overflow-x: hidden;
|
|
68
|
-
overflow-y: auto;
|
|
69
66
|
font-size: 30px;
|
|
70
67
|
line-height: 1.4;
|
|
71
68
|
color: #333;
|
|
72
69
|
}
|
|
73
70
|
|
|
74
|
-
.adm-modal-main .adm-modal-
|
|
71
|
+
.adm-modal-main .adm-modal-close {
|
|
72
|
+
position: absolute;
|
|
73
|
+
right: 16px;
|
|
74
|
+
top: 16px;
|
|
75
|
+
color: var(--adm-color-weak);
|
|
76
|
+
padding: 8px;
|
|
77
|
+
font-size: 36px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.adm-modal-footer {
|
|
75
81
|
user-select: none;
|
|
76
82
|
padding: 16px 24px 24px;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
.adm-modal-
|
|
80
|
-
|
|
81
|
-
line-height: 50px;
|
|
82
|
-
border-right: solid 1px var(--adm-border-color);
|
|
85
|
+
.adm-modal-footer.adm-space {
|
|
86
|
+
--gap-vertical: 40px;
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
.adm-modal-
|
|
86
|
-
|
|
89
|
+
.adm-modal-footer .adm-modal-button {
|
|
90
|
+
font-size: 36px;
|
|
91
|
+
line-height: 50px;
|
|
87
92
|
}
|
|
88
93
|
|
|
89
|
-
.adm-modal-
|
|
94
|
+
.adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary) {
|
|
90
95
|
padding-top: 0;
|
|
91
96
|
padding-bottom: 0;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
.adm-modal-
|
|
99
|
+
.adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary)::before {
|
|
95
100
|
display: none;
|
|
96
101
|
}
|
|
97
102
|
|
|
98
|
-
.adm-modal-
|
|
103
|
+
.adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
|
|
99
104
|
opacity: 0.7;
|
|
100
105
|
}
|
|
101
106
|
|
|
@@ -100,7 +100,10 @@ const Modal = p => {
|
|
|
100
100
|
style: Object.assign({}, style),
|
|
101
101
|
onClick: e => e.stopPropagation(),
|
|
102
102
|
className: `${classPrefix}-main`
|
|
103
|
-
},
|
|
103
|
+
}, props.showCloseButton && _react.default.createElement("a", {
|
|
104
|
+
className: (0, _classnames.default)(`${classPrefix}-close`, 'adm-plain-anchor'),
|
|
105
|
+
onClick: props.onClose
|
|
106
|
+
}, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), !!props.image && _react.default.createElement("div", {
|
|
104
107
|
className: `${classPrefix}-image-container`
|
|
105
108
|
}, _react.default.createElement(_image.default, {
|
|
106
109
|
src: props.image,
|
|
@@ -109,12 +112,6 @@ const Modal = p => {
|
|
|
109
112
|
})), _react.default.createElement("div", {
|
|
110
113
|
style: props.bodyStyle,
|
|
111
114
|
className: (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName)
|
|
112
|
-
}, props.showCloseButton && _react.default.createElement("a", {
|
|
113
|
-
className: (0, _classnames.default)(`${classPrefix}-close`, 'adm-plain-anchor'),
|
|
114
|
-
onClick: props.onClose
|
|
115
|
-
}, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), _react.default.createElement(_space.default, {
|
|
116
|
-
direction: 'vertical',
|
|
117
|
-
block: true
|
|
118
115
|
}, !!props.header && _react.default.createElement("div", {
|
|
119
116
|
className: `${classPrefix}-body-header-wrapper`
|
|
120
117
|
}, _react.default.createElement("div", {
|
|
@@ -123,11 +120,10 @@ const Modal = p => {
|
|
|
123
120
|
className: `${classPrefix}-body-title`
|
|
124
121
|
}, props.title), !!props.content && _react.default.createElement("div", {
|
|
125
122
|
className: `${classPrefix}-body-content`
|
|
126
|
-
}, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content))
|
|
127
|
-
className: `${classPrefix}-footer`
|
|
128
|
-
}, _react.default.createElement(_space.default, {
|
|
123
|
+
}, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content)), _react.default.createElement(_space.default, {
|
|
129
124
|
direction: 'vertical',
|
|
130
|
-
block: true
|
|
125
|
+
block: true,
|
|
126
|
+
className: `${classPrefix}-footer`
|
|
131
127
|
}, props.actions.map((action, index) => {
|
|
132
128
|
return _react.default.createElement(_modalActionButton.ModalActionButton, {
|
|
133
129
|
key: action.key,
|
|
@@ -142,7 +138,7 @@ const Modal = p => {
|
|
|
142
138
|
}
|
|
143
139
|
})
|
|
144
140
|
});
|
|
145
|
-
})))))))
|
|
141
|
+
})))))));
|
|
146
142
|
return (0, _renderToContainer.renderToContainer)(props.getContainer, node);
|
|
147
143
|
};
|
|
148
144
|
|
|
@@ -14,7 +14,7 @@ export declare type PasscodeInputProps = {
|
|
|
14
14
|
onFocus?: () => void;
|
|
15
15
|
keyboard?: ReactElement<NumberKeyboardProps>;
|
|
16
16
|
onFill?: (val: string) => void;
|
|
17
|
-
} & NativeProps<'--cell-gap' | '--cell-size'>;
|
|
17
|
+
} & NativeProps<'--cell-gap' | '--cell-size' | '--dot-size' | '--border-color' | '--border-radius'>;
|
|
18
18
|
export declare type PasscodeInputRef = {
|
|
19
19
|
focus: () => void;
|
|
20
20
|
blur: () => void;
|
|
@@ -32,4 +32,4 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
|
|
|
32
32
|
onFocus?: (() => void) | undefined;
|
|
33
33
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | undefined;
|
|
34
34
|
onFill?: ((val: string) => void) | undefined;
|
|
35
|
-
} & NativeProps<"--cell-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
|
|
35
|
+
} & NativeProps<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap"> & React.RefAttributes<PasscodeInputRef>>;
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: column;
|
|
68
68
|
position: relative;
|
|
69
|
+
z-index: 0;
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
.adm-picker-view-column-accessible > * {
|
|
@@ -86,7 +87,7 @@
|
|
|
86
87
|
|
|
87
88
|
.adm-picker-view-mask {
|
|
88
89
|
position: absolute;
|
|
89
|
-
z-index:
|
|
90
|
+
z-index: 10000;
|
|
90
91
|
left: 0;
|
|
91
92
|
top: 0;
|
|
92
93
|
width: 100%;
|
|
@@ -146,7 +146,7 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
146
146
|
className: `${classPrefix}-column`
|
|
147
147
|
}, bind()), _react.default.createElement(_web.animated.div, {
|
|
148
148
|
style: {
|
|
149
|
-
y
|
|
149
|
+
translateY: y
|
|
150
150
|
},
|
|
151
151
|
className: `${classPrefix}-column-wheel`,
|
|
152
152
|
"aria-hidden": true
|
|
@@ -18,18 +18,15 @@
|
|
|
18
18
|
border: 2px solid var(--adm-color-light);
|
|
19
19
|
border-radius: var(--icon-size);
|
|
20
20
|
box-sizing: border-box;
|
|
21
|
-
display: flex;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
align-items: center;
|
|
24
21
|
width: var(--icon-size);
|
|
25
22
|
height: var(--icon-size);
|
|
26
|
-
color:
|
|
23
|
+
color: var(--adm-color-white);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
.adm-radio .adm-radio-icon
|
|
26
|
+
.adm-radio .adm-radio-icon > svg {
|
|
30
27
|
display: block;
|
|
31
|
-
width:
|
|
32
|
-
height:
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
.adm-radio.adm-radio-block {
|
|
@@ -70,9 +70,7 @@ const Radio = p => {
|
|
|
70
70
|
|
|
71
71
|
return _react.default.createElement("div", {
|
|
72
72
|
className: `${classPrefix}-icon`
|
|
73
|
-
}, checked && _react.default.createElement(_checkIcon.CheckIcon,
|
|
74
|
-
className: `${classPrefix}-icon-checked`
|
|
75
|
-
}));
|
|
73
|
+
}, checked && _react.default.createElement(_checkIcon.CheckIcon, null));
|
|
76
74
|
};
|
|
77
75
|
|
|
78
76
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
.adm-switch {
|
|
8
8
|
--checked-color: var(--adm-color-primary);
|
|
9
|
-
--height:
|
|
10
|
-
--width:
|
|
9
|
+
--height: 62px;
|
|
10
|
+
--width: 102px;
|
|
11
11
|
--border-width: 4px;
|
|
12
12
|
display: inline-block;
|
|
13
13
|
vertical-align: middle;
|
|
@@ -69,9 +69,14 @@
|
|
|
69
69
|
.adm-switch-inner {
|
|
70
70
|
position: relative;
|
|
71
71
|
z-index: 1;
|
|
72
|
-
|
|
72
|
+
display: flex;
|
|
73
|
+
justify-content: center;
|
|
74
|
+
align-items: center;
|
|
75
|
+
margin: 0 16px 0 calc(var(--height) - var(--border-width) + 8px);
|
|
76
|
+
height: 100%;
|
|
73
77
|
color: var(--adm-color-weak);
|
|
74
78
|
transition: margin 200ms;
|
|
79
|
+
font-size: 30px;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
.adm-switch.adm-switch-checked .adm-switch-checkbox {
|