antd-mobile 5.19.0 → 5.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/bundle/antd-mobile.cjs.development.js +25724 -0
- package/2x/bundle/antd-mobile.cjs.js +8 -32
- package/2x/bundle/antd-mobile.compatible.umd.js +10464 -10860
- package/2x/bundle/antd-mobile.es.development.js +25704 -0
- package/2x/bundle/antd-mobile.es.js +8381 -8615
- package/2x/bundle/antd-mobile.umd.development.js +25726 -0
- package/2x/bundle/antd-mobile.umd.js +8 -32
- package/2x/bundle/style.css +153 -7
- package/2x/cjs/components/action-sheet/action-sheet.css +6 -2
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -0
- package/2x/cjs/components/action-sheet/action-sheet.js +2 -1
- package/2x/cjs/components/check-list/check-list.css +1 -1
- package/2x/cjs/components/ellipsis/ellipsis.js +1 -0
- package/2x/cjs/components/floating-panel/floating-panel.js +2 -2
- package/2x/cjs/components/form/context.d.ts +1 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +3 -0
- package/2x/cjs/components/image/test/image.test.js +57 -8
- package/2x/cjs/components/image-viewer/image-viewer.js +4 -2
- package/2x/cjs/components/index-bar/index-bar.css +1 -1
- package/2x/cjs/components/page-indicator/page-indicator.css +1 -1
- package/2x/cjs/components/picker-view/wheel.js +2 -0
- package/2x/cjs/components/rate/rate.css +4 -0
- package/2x/cjs/components/rate/rate.js +42 -13
- package/2x/cjs/components/result-page/index.d.ts +7 -0
- package/2x/cjs/components/result-page/index.js +20 -0
- package/2x/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/2x/cjs/components/result-page/result-page-card.js +24 -0
- package/2x/cjs/components/result-page/result-page.css +130 -0
- package/2x/cjs/components/result-page/result-page.d.ts +23 -0
- package/2x/cjs/components/result-page/result-page.js +108 -0
- package/2x/cjs/components/selector/selector.css +10 -0
- package/2x/cjs/components/selector/selector.d.ts +3 -2
- package/2x/cjs/components/selector/selector.js +1 -4
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/cjs/components/swipe-action/swipe-action.js +34 -6
- package/2x/cjs/components/swiper/swiper.js +15 -1
- package/2x/cjs/components/tab-bar/tab-bar.css +2 -2
- package/2x/cjs/index.d.ts +1 -0
- package/2x/cjs/index.js +8 -0
- package/2x/cjs/locales/id-ID.js +13 -0
- package/2x/cjs/utils/use-resize-effect.js +3 -1
- package/2x/es/components/action-sheet/action-sheet.css +6 -2
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -0
- package/2x/es/components/action-sheet/action-sheet.js +2 -1
- package/2x/es/components/check-list/check-list.css +1 -1
- package/2x/es/components/ellipsis/ellipsis.js +1 -0
- package/2x/es/components/floating-panel/floating-panel.js +2 -2
- package/2x/es/components/form/context.d.ts +1 -1
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +3 -0
- package/2x/es/components/image/test/image.test.js +54 -8
- package/2x/es/components/image-viewer/image-viewer.js +4 -2
- package/2x/es/components/index-bar/index-bar.css +1 -1
- package/2x/es/components/page-indicator/page-indicator.css +1 -1
- package/2x/es/components/picker-view/wheel.js +2 -0
- package/2x/es/components/rate/rate.css +4 -0
- package/2x/es/components/rate/rate.js +36 -13
- package/2x/es/components/result-page/index.d.ts +7 -0
- package/2x/es/components/result-page/index.js +7 -0
- package/2x/es/components/result-page/result-page-card.d.ts +6 -0
- package/2x/es/components/result-page/result-page-card.js +9 -0
- package/2x/es/components/result-page/result-page.css +130 -0
- package/2x/es/components/result-page/result-page.d.ts +23 -0
- package/2x/es/components/result-page/result-page.js +83 -0
- package/2x/es/components/selector/selector.css +10 -0
- package/2x/es/components/selector/selector.d.ts +3 -2
- package/2x/es/components/selector/selector.js +1 -3
- package/2x/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/2x/es/components/swipe-action/swipe-action.js +34 -6
- package/2x/es/components/swiper/swiper.js +15 -1
- package/2x/es/components/tab-bar/tab-bar.css +2 -2
- package/2x/es/index.d.ts +1 -0
- package/2x/es/index.js +1 -0
- package/2x/es/locales/id-ID.js +13 -0
- package/2x/es/utils/use-resize-effect.js +3 -1
- package/2x/package.json +6 -6
- package/2x/umd/antd-mobile.js +10464 -10860
- package/bundle/antd-mobile.cjs.development.js +25724 -0
- package/bundle/antd-mobile.cjs.js +8 -32
- package/bundle/antd-mobile.compatible.umd.js +10464 -10860
- package/bundle/antd-mobile.es.development.js +25704 -0
- package/bundle/antd-mobile.es.js +8381 -8615
- package/bundle/antd-mobile.umd.development.js +25726 -0
- package/bundle/antd-mobile.umd.js +8 -32
- package/bundle/style.css +1 -1
- package/cjs/components/action-sheet/action-sheet.css +5 -2
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -0
- package/cjs/components/action-sheet/action-sheet.js +2 -1
- package/cjs/components/check-list/check-list.css +1 -1
- package/cjs/components/ellipsis/ellipsis.js +1 -0
- package/cjs/components/floating-panel/floating-panel.js +2 -2
- package/cjs/components/form/context.d.ts +1 -1
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +3 -0
- package/cjs/components/image/test/image.test.js +57 -8
- package/cjs/components/image-viewer/image-viewer.js +4 -2
- package/cjs/components/index-bar/index-bar.css +1 -1
- package/cjs/components/page-indicator/page-indicator.css +1 -1
- package/cjs/components/picker-view/wheel.js +2 -0
- package/cjs/components/rate/rate.css +4 -0
- package/cjs/components/rate/rate.js +42 -13
- package/cjs/components/result-page/index.d.ts +7 -0
- package/cjs/components/result-page/index.js +20 -0
- package/cjs/components/result-page/result-page-card.d.ts +6 -0
- package/cjs/components/result-page/result-page-card.js +24 -0
- package/cjs/components/result-page/result-page.css +113 -0
- package/cjs/components/result-page/result-page.d.ts +23 -0
- package/cjs/components/result-page/result-page.js +108 -0
- package/cjs/components/selector/selector.css +9 -0
- package/cjs/components/selector/selector.d.ts +3 -2
- package/cjs/components/selector/selector.js +1 -4
- package/cjs/components/swipe-action/swipe-action.d.ts +2 -0
- package/cjs/components/swipe-action/swipe-action.js +34 -6
- package/cjs/components/swiper/swiper.js +15 -1
- package/cjs/components/tab-bar/tab-bar.css +2 -2
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +8 -0
- package/cjs/locales/id-ID.js +13 -0
- package/cjs/utils/use-resize-effect.js +3 -1
- package/es/components/action-sheet/action-sheet.css +5 -2
- package/es/components/action-sheet/action-sheet.d.ts +1 -0
- package/es/components/action-sheet/action-sheet.js +2 -1
- package/es/components/check-list/check-list.css +1 -1
- package/es/components/ellipsis/ellipsis.js +1 -0
- package/es/components/floating-panel/floating-panel.js +2 -2
- package/es/components/form/context.d.ts +1 -1
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +3 -0
- package/es/components/image/test/image.test.js +54 -8
- package/es/components/image-viewer/image-viewer.js +4 -2
- package/es/components/index-bar/index-bar.css +1 -1
- package/es/components/page-indicator/page-indicator.css +1 -1
- package/es/components/picker-view/wheel.js +2 -0
- package/es/components/rate/rate.css +4 -0
- package/es/components/rate/rate.js +36 -13
- package/es/components/result-page/index.d.ts +7 -0
- package/es/components/result-page/index.js +7 -0
- package/es/components/result-page/result-page-card.d.ts +6 -0
- package/es/components/result-page/result-page-card.js +9 -0
- package/es/components/result-page/result-page.css +113 -0
- package/es/components/result-page/result-page.d.ts +23 -0
- package/es/components/result-page/result-page.js +83 -0
- package/es/components/selector/selector.css +9 -0
- package/es/components/selector/selector.d.ts +3 -2
- package/es/components/selector/selector.js +1 -3
- package/es/components/swipe-action/swipe-action.d.ts +2 -0
- package/es/components/swipe-action/swipe-action.js +34 -6
- package/es/components/swiper/swiper.js +15 -1
- package/es/components/tab-bar/tab-bar.css +2 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/id-ID.js +13 -0
- package/es/utils/use-resize-effect.js +3 -1
- package/package.json +6 -6
- package/umd/antd-mobile.js +1 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
.adm-result-page {
|
|
2
|
+
--background-color: var(--adm-color-primary);
|
|
3
|
+
position: relative;
|
|
4
|
+
background-color: var(--adm-color-box);
|
|
5
|
+
min-height: 100vh;
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.adm-result-page-header {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
position: relative;
|
|
15
|
+
padding: 40px;
|
|
16
|
+
padding-bottom: 200px;
|
|
17
|
+
z-index: 1;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.adm-result-page-icon {
|
|
22
|
+
color: var(--adm-color-background);
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
padding: 4px;
|
|
25
|
+
margin-bottom: 16px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.adm-result-page-icon .antd-mobile-icon {
|
|
29
|
+
font-size: 64px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.adm-result-page-title {
|
|
33
|
+
font-size: var(--adm-font-size-10);
|
|
34
|
+
color: var(--adm-color-background);
|
|
35
|
+
line-height: 1.4;
|
|
36
|
+
text-align: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.adm-result-page-description {
|
|
40
|
+
margin-top: 16px;
|
|
41
|
+
margin-bottom: 48px;
|
|
42
|
+
font-size: var(--adm-font-size-6);
|
|
43
|
+
color: rgba(255, 255, 255, 0.6);
|
|
44
|
+
line-height: 1.4;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.adm-result-page-details {
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.adm-result-page-detail {
|
|
53
|
+
width: 100%;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
margin-bottom: 10px;
|
|
58
|
+
color: var(--adm-color-background);
|
|
59
|
+
font-size: var(--adm-font-size-6);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.adm-result-page-detail-bold {
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.adm-result-page-collapse {
|
|
67
|
+
opacity: 0.6;
|
|
68
|
+
width: 20px;
|
|
69
|
+
height: 20px;
|
|
70
|
+
margin: auto;
|
|
71
|
+
margin-bottom: 10px;
|
|
72
|
+
border-top: 4px solid var(--adm-color-background);
|
|
73
|
+
border-right: 4px solid var(--adm-color-background);
|
|
74
|
+
transform: rotate(135deg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.adm-result-page-collapse-active {
|
|
78
|
+
transform: rotate(-45deg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.adm-result-page-bgWrapper {
|
|
82
|
+
position: relative;
|
|
83
|
+
align-self: flex-start;
|
|
84
|
+
top: 108px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.adm-result-page-bg {
|
|
88
|
+
--width: 440vw;
|
|
89
|
+
position: absolute;
|
|
90
|
+
height: var(--width);
|
|
91
|
+
width: var(--width);
|
|
92
|
+
left: calc((var(--width) - 100vw) * -1 / 2 - 40px);
|
|
93
|
+
top: calc(var(--width) * -1 + 1vw);
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
background-color: var(--background-color);
|
|
96
|
+
z-index: -1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.adm-result-page-content {
|
|
100
|
+
position: relative;
|
|
101
|
+
padding: 24px;
|
|
102
|
+
top: -208px;
|
|
103
|
+
z-index: 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.adm-result-page-footer {
|
|
107
|
+
position: fixed;
|
|
108
|
+
bottom: 0;
|
|
109
|
+
width: 100%;
|
|
110
|
+
padding: 24px;
|
|
111
|
+
padding-bottom: 48px;
|
|
112
|
+
display: flex;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
background-color: var(--adm-color-box);
|
|
115
|
+
z-index: 3;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.adm-result-page-footer-btn {
|
|
119
|
+
flex: 1;
|
|
120
|
+
max-width: calc((100vw - 72px) / 2);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.adm-result-page-footer-space {
|
|
124
|
+
width: 24px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.adm-result-page-card {
|
|
128
|
+
border-radius: 16px;
|
|
129
|
+
background-color: var(--adm-color-background);
|
|
130
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
interface ResultPageDetail {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare type ResultPageDetails = ResultPageDetail[];
|
|
9
|
+
declare type OnClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void> | unknown;
|
|
10
|
+
export declare type ResultPageProps = {
|
|
11
|
+
status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
details?: ResultPageDetails;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
primaryButtonText?: ReactNode;
|
|
18
|
+
secondaryButtonText?: ReactNode;
|
|
19
|
+
onPrimaryButtonClick?: OnClick;
|
|
20
|
+
onSecondaryButtonClick?: OnClick;
|
|
21
|
+
} & NativeProps<'--background-color'>;
|
|
22
|
+
export declare const ResultPage: FC<ResultPageProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ResultPage = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _antdMobileIcons = require("antd-mobile-icons");
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _nativeProps = require("../../utils/native-props");
|
|
15
|
+
|
|
16
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
|
+
|
|
18
|
+
var _isNodeWithContent = require("../../utils/is-node-with-content");
|
|
19
|
+
|
|
20
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
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
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
const classPrefix = `adm-result-page`;
|
|
29
|
+
const iconRecord = {
|
|
30
|
+
success: _antdMobileIcons.CheckCircleFill,
|
|
31
|
+
error: _antdMobileIcons.CloseCircleFill,
|
|
32
|
+
info: _antdMobileIcons.InformationCircleFill,
|
|
33
|
+
waiting: _antdMobileIcons.ClockCircleFill,
|
|
34
|
+
warning: _antdMobileIcons.ExclamationCircleFill
|
|
35
|
+
};
|
|
36
|
+
const defaultProps = {
|
|
37
|
+
status: 'info',
|
|
38
|
+
details: []
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const ResultPage = p => {
|
|
42
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
43
|
+
const {
|
|
44
|
+
status,
|
|
45
|
+
title,
|
|
46
|
+
description,
|
|
47
|
+
details,
|
|
48
|
+
icon,
|
|
49
|
+
primaryButtonText,
|
|
50
|
+
secondaryButtonText,
|
|
51
|
+
onPrimaryButtonClick,
|
|
52
|
+
onSecondaryButtonClick
|
|
53
|
+
} = props;
|
|
54
|
+
|
|
55
|
+
const resultIcon = icon || _react.default.createElement(iconRecord[status]);
|
|
56
|
+
|
|
57
|
+
const [collapse, setCollapse] = (0, _react.useState)(true);
|
|
58
|
+
const showSecondaryButton = (0, _isNodeWithContent.isNodeWithContent)(secondaryButtonText);
|
|
59
|
+
const showPrimaryButton = (0, _isNodeWithContent.isNodeWithContent)(primaryButtonText);
|
|
60
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
61
|
+
className: classPrefix
|
|
62
|
+
}, _react.default.createElement("div", {
|
|
63
|
+
className: `${classPrefix}-header`
|
|
64
|
+
}, _react.default.createElement("div", {
|
|
65
|
+
className: `${classPrefix}-icon`
|
|
66
|
+
}, resultIcon), _react.default.createElement("div", {
|
|
67
|
+
className: `${classPrefix}-title`
|
|
68
|
+
}, title), (0, _isNodeWithContent.isNodeWithContent)(description) ? _react.default.createElement("div", {
|
|
69
|
+
className: `${classPrefix}-description`
|
|
70
|
+
}, description) : null, details.length ? _react.default.createElement("div", {
|
|
71
|
+
className: `${classPrefix}-details`
|
|
72
|
+
}, (collapse ? details.slice(0, 3) : details).map((detail, index) => {
|
|
73
|
+
return _react.default.createElement("div", {
|
|
74
|
+
className: (0, _classnames.default)(`${classPrefix}-detail`, detail.bold && `${classPrefix}-detail-bold`),
|
|
75
|
+
key: index
|
|
76
|
+
}, _react.default.createElement("span", null, detail.label), _react.default.createElement("span", null, detail.value));
|
|
77
|
+
}), details.length > 3 && _react.default.createElement("div", {
|
|
78
|
+
onClick: () => setCollapse(prev => !prev)
|
|
79
|
+
}, _react.default.createElement("div", {
|
|
80
|
+
className: (0, _classnames.default)(`${classPrefix}-collapse`, !collapse && `${classPrefix}-collapse-active`)
|
|
81
|
+
}))) : null, _react.default.createElement("div", {
|
|
82
|
+
className: `${classPrefix}-bgWrapper`
|
|
83
|
+
}, _react.default.createElement("div", {
|
|
84
|
+
className: `${classPrefix}-bg`
|
|
85
|
+
}))), _react.default.createElement("div", {
|
|
86
|
+
className: `${classPrefix}-content`
|
|
87
|
+
}, props.children), _react.default.createElement("div", {
|
|
88
|
+
className: `${classPrefix}-footer`
|
|
89
|
+
}, showSecondaryButton && _react.default.createElement(_button.default, {
|
|
90
|
+
block: true,
|
|
91
|
+
color: 'default',
|
|
92
|
+
fill: 'solid',
|
|
93
|
+
size: 'large',
|
|
94
|
+
onClick: onSecondaryButtonClick,
|
|
95
|
+
className: `${classPrefix}-footer-btn`
|
|
96
|
+
}, secondaryButtonText), showPrimaryButton && showSecondaryButton && _react.default.createElement("div", {
|
|
97
|
+
className: `${classPrefix}-footer-space`
|
|
98
|
+
}), showPrimaryButton && _react.default.createElement(_button.default, {
|
|
99
|
+
block: true,
|
|
100
|
+
color: 'primary',
|
|
101
|
+
fill: 'solid',
|
|
102
|
+
size: 'large',
|
|
103
|
+
onClick: onPrimaryButtonClick,
|
|
104
|
+
className: `${classPrefix}-footer-btn`
|
|
105
|
+
}, primaryButtonText))));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.ResultPage = ResultPage;
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
--checked-border: none;
|
|
8
8
|
--border-radius: 4px;
|
|
9
9
|
--padding: 16px 32px;
|
|
10
|
+
--gap: 16px;
|
|
11
|
+
---gap: var(--gap);
|
|
12
|
+
---gap-horizontal: var(--gap-horizontal, var(--gap));
|
|
13
|
+
---gap-vertical: var(--gap-vertical, var(--gap));
|
|
10
14
|
overflow: hidden;
|
|
11
15
|
font-size: var(--adm-font-size-7);
|
|
12
16
|
line-height: 1.4;
|
|
@@ -16,6 +20,12 @@
|
|
|
16
20
|
--gap: 24px;
|
|
17
21
|
}
|
|
18
22
|
|
|
23
|
+
.adm-selector .adm-grid {
|
|
24
|
+
--gap: var(---gap);
|
|
25
|
+
--gap-horizontal: var(---gap-horizontal);
|
|
26
|
+
--gap-vertical: var(---gap-vertical);
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
.adm-selector-item {
|
|
20
30
|
padding: var(--padding);
|
|
21
31
|
position: relative;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
+
import { GridProps } from '../grid';
|
|
3
4
|
declare type SelectorValue = string | number;
|
|
4
5
|
export interface SelectorOption<V> {
|
|
5
6
|
label: ReactNode;
|
|
@@ -9,7 +10,7 @@ export interface SelectorOption<V> {
|
|
|
9
10
|
}
|
|
10
11
|
export declare type SelectorProps<V> = {
|
|
11
12
|
options: SelectorOption<V>[];
|
|
12
|
-
columns?:
|
|
13
|
+
columns?: GridProps['columns'];
|
|
13
14
|
multiple?: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
defaultValue?: V[];
|
|
@@ -18,6 +19,6 @@ export declare type SelectorProps<V> = {
|
|
|
18
19
|
items: SelectorOption<V>[];
|
|
19
20
|
}) => void;
|
|
20
21
|
showCheckMark?: boolean;
|
|
21
|
-
} & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding'>;
|
|
22
|
+
} & NativeProps<'--color' | '--checked-color' | '--text-color' | '--checked-text-color' | '--border' | '--checked-border' | '--border-radius' | '--padding' | '--gap' | '--gap-vertical' | '--gap-horizontal'>;
|
|
22
23
|
export declare const Selector: <V extends SelectorValue>(p: SelectorProps<V>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
23
24
|
export {};
|
|
@@ -17,8 +17,6 @@ var _space = _interopRequireDefault(require("../space"));
|
|
|
17
17
|
|
|
18
18
|
var _grid = _interopRequireDefault(require("../grid"));
|
|
19
19
|
|
|
20
|
-
var _convertPx = require("../../utils/convert-px");
|
|
21
|
-
|
|
22
20
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
23
21
|
|
|
24
22
|
var _checkMark = require("./check-mark");
|
|
@@ -84,8 +82,7 @@ const Selector = p => {
|
|
|
84
82
|
}, !props.columns && _react.default.createElement(_space.default, {
|
|
85
83
|
wrap: true
|
|
86
84
|
}, items), props.columns && _react.default.createElement(_grid.default, {
|
|
87
|
-
columns: props.columns
|
|
88
|
-
gap: (0, _convertPx.convertPx)(8)
|
|
85
|
+
columns: props.columns
|
|
89
86
|
}, items)));
|
|
90
87
|
};
|
|
91
88
|
|
|
@@ -20,6 +20,7 @@ export declare type SwipeActionProps = {
|
|
|
20
20
|
closeOnAction?: boolean;
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
stopPropagation?: PropagationEvent[];
|
|
23
|
+
onActionsReveal?: (side: 'left' | 'right') => void;
|
|
23
24
|
} & NativeProps<'--background'>;
|
|
24
25
|
export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
25
26
|
rightActions?: Action[] | undefined;
|
|
@@ -29,6 +30,7 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
29
30
|
closeOnAction?: boolean | undefined;
|
|
30
31
|
children: ReactNode;
|
|
31
32
|
stopPropagation?: "click"[] | undefined;
|
|
33
|
+
onActionsReveal?: ((side: 'left' | 'right') => void) | undefined;
|
|
32
34
|
} & {
|
|
33
35
|
className?: string | undefined;
|
|
34
36
|
style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
|
|
@@ -65,8 +65,26 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
65
65
|
}
|
|
66
66
|
}), []);
|
|
67
67
|
const draggingRef = (0, _react.useRef)(false);
|
|
68
|
+
const dragCancelRef = (0, _react.useRef)(null);
|
|
69
|
+
|
|
70
|
+
function forceCancelDrag() {
|
|
71
|
+
var _a;
|
|
72
|
+
|
|
73
|
+
(_a = dragCancelRef.current) === null || _a === void 0 ? void 0 : _a.call(dragCancelRef);
|
|
74
|
+
draggingRef.current = false;
|
|
75
|
+
}
|
|
76
|
+
|
|
68
77
|
const bind = (0, _react2.useDrag)(state => {
|
|
69
|
-
|
|
78
|
+
var _a;
|
|
79
|
+
|
|
80
|
+
dragCancelRef.current = state.cancel;
|
|
81
|
+
if (!state.intentional) return;
|
|
82
|
+
|
|
83
|
+
if (state.down) {
|
|
84
|
+
draggingRef.current = true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!draggingRef.current) return;
|
|
70
88
|
const [offsetX] = state.offset;
|
|
71
89
|
|
|
72
90
|
if (state.last) {
|
|
@@ -82,9 +100,15 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
82
100
|
position = 0;
|
|
83
101
|
}
|
|
84
102
|
|
|
103
|
+
const targetX = (0, _nearest.nearest)([-rightWidth, 0, leftWidth], position);
|
|
85
104
|
api.start({
|
|
86
|
-
x:
|
|
105
|
+
x: targetX
|
|
87
106
|
});
|
|
107
|
+
|
|
108
|
+
if (targetX !== 0) {
|
|
109
|
+
(_a = p.onActionsReveal) === null || _a === void 0 ? void 0 : _a.call(p, targetX > 0 ? 'left' : 'right');
|
|
110
|
+
}
|
|
111
|
+
|
|
88
112
|
window.setTimeout(() => {
|
|
89
113
|
draggingRef.current = false;
|
|
90
114
|
});
|
|
@@ -109,17 +133,21 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
109
133
|
preventScroll: true,
|
|
110
134
|
pointer: {
|
|
111
135
|
touch: true
|
|
112
|
-
}
|
|
136
|
+
},
|
|
137
|
+
triggerAllEvents: true
|
|
113
138
|
});
|
|
114
139
|
|
|
115
140
|
function close() {
|
|
116
141
|
api.start({
|
|
117
142
|
x: 0
|
|
118
143
|
});
|
|
144
|
+
forceCancelDrag();
|
|
119
145
|
}
|
|
120
146
|
|
|
121
147
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
122
148
|
show: (side = 'right') => {
|
|
149
|
+
var _a;
|
|
150
|
+
|
|
123
151
|
if (side === 'right') {
|
|
124
152
|
api.start({
|
|
125
153
|
x: -getRightWidth()
|
|
@@ -129,6 +157,8 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
129
157
|
x: getLeftWidth()
|
|
130
158
|
});
|
|
131
159
|
}
|
|
160
|
+
|
|
161
|
+
(_a = p.onActionsReveal) === null || _a === void 0 ? void 0 : _a.call(p, side);
|
|
132
162
|
},
|
|
133
163
|
close
|
|
134
164
|
}));
|
|
@@ -200,9 +230,7 @@ const SwipeAction = (0, _react.forwardRef)((p, ref) => {
|
|
|
200
230
|
if (x.goal !== 0) {
|
|
201
231
|
e.preventDefault();
|
|
202
232
|
e.stopPropagation();
|
|
203
|
-
|
|
204
|
-
x: 0
|
|
205
|
-
});
|
|
233
|
+
close();
|
|
206
234
|
}
|
|
207
235
|
}
|
|
208
236
|
}, _react.default.createElement(_web.animated.div, {
|
|
@@ -141,7 +141,18 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
}), [count]);
|
|
144
|
+
const dragCancelRef = (0, _react.useRef)(null);
|
|
145
|
+
|
|
146
|
+
function forceCancelDrag() {
|
|
147
|
+
var _a;
|
|
148
|
+
|
|
149
|
+
(_a = dragCancelRef.current) === null || _a === void 0 ? void 0 : _a.call(dragCancelRef);
|
|
150
|
+
draggingRef.current = false;
|
|
151
|
+
}
|
|
152
|
+
|
|
144
153
|
const bind = (0, _react2.useDrag)(state => {
|
|
154
|
+
dragCancelRef.current = state.cancel;
|
|
155
|
+
if (!state.intentional) return;
|
|
145
156
|
const slidePixels = getSlidePixels();
|
|
146
157
|
if (!slidePixels) return;
|
|
147
158
|
const paramIndex = isVertical ? 1 : 0;
|
|
@@ -170,6 +181,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
170
181
|
const slidePixels = getSlidePixels();
|
|
171
182
|
return [position.get() / 100 * slidePixels, position.get() / 100 * slidePixels];
|
|
172
183
|
},
|
|
184
|
+
triggerAllEvents: true,
|
|
173
185
|
bounds: () => {
|
|
174
186
|
if (loop) return {};
|
|
175
187
|
const slidePixels = getSlidePixels();
|
|
@@ -233,7 +245,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
233
245
|
return () => {
|
|
234
246
|
window.clearInterval(interval);
|
|
235
247
|
};
|
|
236
|
-
}, [autoplay, autoplayInterval, dragging]);
|
|
248
|
+
}, [autoplay, autoplayInterval, dragging, count]);
|
|
237
249
|
|
|
238
250
|
function renderTrackInner() {
|
|
239
251
|
if (loop) {
|
|
@@ -284,6 +296,8 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
284
296
|
if (draggingRef.current) {
|
|
285
297
|
e.stopPropagation();
|
|
286
298
|
}
|
|
299
|
+
|
|
300
|
+
forceCancelDrag();
|
|
287
301
|
}
|
|
288
302
|
}, props.allowTouchMove ? bind() : {}), renderTrackInner()), props.indicator === undefined ? _react.default.createElement("div", {
|
|
289
303
|
className: `${classPrefix}-indicator`
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
.adm-tab-bar-item {
|
|
11
11
|
flex: 1;
|
|
12
|
-
color: var(--adm-color-
|
|
12
|
+
color: var(--adm-color-text-secondary);
|
|
13
13
|
white-space: nowrap;
|
|
14
14
|
padding: 8px 16px;
|
|
15
15
|
width: -webkit-min-content;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.adm-tab-bar-item-title {
|
|
32
|
-
font-size: var(--adm-font-size-
|
|
32
|
+
font-size: var(--adm-font-size-2);
|
|
33
33
|
line-height: 30px;
|
|
34
34
|
}
|
|
35
35
|
|
package/2x/cjs/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export { default as PullToRefresh } from './components/pull-to-refresh';
|
|
|
56
56
|
export { default as Radio } from './components/radio';
|
|
57
57
|
export { default as Rate } from './components/rate';
|
|
58
58
|
export { default as Result } from './components/result';
|
|
59
|
+
export { default as ResultPage } from './components/result-page';
|
|
59
60
|
export { default as SafeArea } from './components/safe-area';
|
|
60
61
|
export { default as ScrollMask } from './components/scroll-mask';
|
|
61
62
|
export { default as SearchBar } from './components/search-bar';
|
package/2x/cjs/index.js
CHANGED
|
@@ -339,6 +339,12 @@ Object.defineProperty(exports, "Result", {
|
|
|
339
339
|
return _result.default;
|
|
340
340
|
}
|
|
341
341
|
});
|
|
342
|
+
Object.defineProperty(exports, "ResultPage", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return _resultPage.default;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
342
348
|
Object.defineProperty(exports, "SafeArea", {
|
|
343
349
|
enumerable: true,
|
|
344
350
|
get: function () {
|
|
@@ -610,6 +616,8 @@ var _rate = _interopRequireDefault(require("./components/rate"));
|
|
|
610
616
|
|
|
611
617
|
var _result = _interopRequireDefault(require("./components/result"));
|
|
612
618
|
|
|
619
|
+
var _resultPage = _interopRequireDefault(require("./components/result-page"));
|
|
620
|
+
|
|
613
621
|
var _safeArea = _interopRequireDefault(require("./components/safe-area"));
|
|
614
622
|
|
|
615
623
|
var _scrollMask = _interopRequireDefault(require("./components/scroll-mask"));
|
package/2x/cjs/locales/id-ID.js
CHANGED
|
@@ -115,6 +115,19 @@ const idID = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
115
115
|
pulling: 'Tarik ke bawah untuk menyegarkan',
|
|
116
116
|
canRelease: 'Lepaskan untuk menyegarkan segera',
|
|
117
117
|
complete: 'Segarkan berhasil'
|
|
118
|
+
},
|
|
119
|
+
SearchBar: {
|
|
120
|
+
name: 'Bilah Pencarian'
|
|
121
|
+
},
|
|
122
|
+
Slider: {
|
|
123
|
+
name: 'Penggeser'
|
|
124
|
+
},
|
|
125
|
+
Stepper: {
|
|
126
|
+
decrease: 'mengurangi',
|
|
127
|
+
increase: 'meningkat'
|
|
128
|
+
},
|
|
129
|
+
Switch: {
|
|
130
|
+
name: 'Mengalihkan'
|
|
118
131
|
}
|
|
119
132
|
});
|
|
120
133
|
var _default = idID;
|
|
@@ -14,11 +14,13 @@ function useResizeEffect(effect, targetRef) {
|
|
|
14
14
|
if (!target) return;
|
|
15
15
|
|
|
16
16
|
if (window.ResizeObserver) {
|
|
17
|
+
let animationFrame;
|
|
17
18
|
const observer = new ResizeObserver(() => {
|
|
18
|
-
fn(target);
|
|
19
|
+
animationFrame = window.requestAnimationFrame(() => fn(target));
|
|
19
20
|
});
|
|
20
21
|
observer.observe(target);
|
|
21
22
|
return () => {
|
|
23
|
+
window.cancelAnimationFrame(animationFrame);
|
|
22
24
|
observer.disconnect();
|
|
23
25
|
};
|
|
24
26
|
} else {
|
|
@@ -48,15 +48,19 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.adm-action-sheet-button-item-description {
|
|
51
|
-
font-size: var(--adm-font-size-
|
|
51
|
+
font-size: var(--adm-font-size-6);
|
|
52
52
|
color: var(--adm-color-weak);
|
|
53
|
-
padding-top:
|
|
53
|
+
padding-top: 8px;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.adm-action-sheet-button-item-danger .adm-action-sheet-button-item-name {
|
|
57
57
|
color: var(--adm-color-danger);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
.adm-action-sheet-button-item-bold .adm-action-sheet-button-item-name {
|
|
61
|
+
font-weight: bold;
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
.adm-action-sheet-cancel {
|
|
61
65
|
background-color: var(--adm-color-box);
|
|
62
66
|
padding-top: 16px;
|
|
@@ -47,7 +47,8 @@ export const ActionSheet = p => {
|
|
|
47
47
|
}, React.createElement("a", {
|
|
48
48
|
className: classNames('adm-plain-anchor', `${classPrefix}-button-item`, {
|
|
49
49
|
[`${classPrefix}-button-item-danger`]: action.danger,
|
|
50
|
-
[`${classPrefix}-button-item-disabled`]: action.disabled
|
|
50
|
+
[`${classPrefix}-button-item-disabled`]: action.disabled,
|
|
51
|
+
[`${classPrefix}-button-item-bold`]: action.bold
|
|
51
52
|
}),
|
|
52
53
|
onClick: () => {
|
|
53
54
|
var _a, _b, _c;
|
|
@@ -23,6 +23,7 @@ export const Ellipsis = p => {
|
|
|
23
23
|
function calcEllipsised() {
|
|
24
24
|
const root = rootRef.current;
|
|
25
25
|
if (!root) return;
|
|
26
|
+
if (!root.offsetParent) return;
|
|
26
27
|
const originStyle = window.getComputedStyle(root);
|
|
27
28
|
const container = document.createElement('div');
|
|
28
29
|
const styleNames = Array.prototype.slice.apply(originStyle);
|
|
@@ -113,8 +113,8 @@ export const FloatingPanel = forwardRef((p, ref) => {
|
|
|
113
113
|
ref: elementRef,
|
|
114
114
|
className: 'adm-floating-panel',
|
|
115
115
|
style: {
|
|
116
|
-
height: maxHeight,
|
|
117
|
-
translateY: y.to(y => `calc(100% + (${y}px))`)
|
|
116
|
+
height: Math.round(maxHeight),
|
|
117
|
+
translateY: y.to(y => `calc(100% + (${Math.round(y)}px))`)
|
|
118
118
|
}
|
|
119
119
|
}, React.createElement("div", {
|
|
120
120
|
className: 'adm-floating-panel-mask',
|
|
@@ -5,7 +5,7 @@ export declare type FormContextType = {
|
|
|
5
5
|
name?: string;
|
|
6
6
|
hasFeedback: boolean;
|
|
7
7
|
layout: FormLayout;
|
|
8
|
-
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional';
|
|
8
|
+
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional' | 'none';
|
|
9
9
|
disabled: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const defaultFormContext: FormContextType;
|
|
@@ -7,7 +7,7 @@ import type { FormLayout } from './index';
|
|
|
7
7
|
declare type RenderChildren<Values = any> = (form: FormInstance<Values>) => React.ReactNode;
|
|
8
8
|
declare type ChildrenType<Values = any> = RenderChildren<Values> | React.ReactNode;
|
|
9
9
|
declare type RcFieldProps = Omit<FieldProps, 'children'>;
|
|
10
|
-
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue'> & Pick<ListItemProps, 'style' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
10
|
+
export declare type FormItemProps = Pick<RcFieldProps, 'dependencies' | 'valuePropName' | 'name' | 'rules' | 'messageVariables' | 'trigger' | 'validateTrigger' | 'shouldUpdate' | 'initialValue' | 'getValueFromEvent' | 'getValueProps' | 'normalize' | 'preserve' | 'validateFirst'> & Pick<ListItemProps, 'style' | 'extra' | 'clickable' | 'arrow' | 'description'> & {
|
|
11
11
|
label?: React.ReactNode;
|
|
12
12
|
help?: React.ReactNode;
|
|
13
13
|
hasFeedback?: boolean;
|