antd-mobile 5.2.1 → 5.3.1
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/avatar/avatar.js +1 -0
- package/2x/cjs/components/calendar/calendar.js +23 -20
- package/2x/cjs/components/date-picker/date-picker.js +3 -7
- package/2x/cjs/components/dialog/dialog.css +27 -18
- package/2x/cjs/components/dialog/dialog.js +39 -42
- package/2x/cjs/components/dropdown/dropdown.css +2 -1
- package/2x/cjs/components/ellipsis/ellipsis.d.ts +2 -0
- package/2x/cjs/components/ellipsis/ellipsis.js +8 -5
- package/2x/cjs/components/form/context.d.ts +2 -1
- package/2x/cjs/components/form/context.js +6 -5
- package/2x/cjs/components/form/form-item.css +27 -1
- package/2x/cjs/components/form/form-item.d.ts +1 -0
- package/2x/cjs/components/form/form-item.js +44 -13
- package/2x/cjs/components/form/form.js +18 -9
- package/2x/cjs/components/form/index.css +27 -1
- package/2x/cjs/components/input/input.js +2 -2
- package/2x/cjs/components/modal/modal.css +27 -21
- package/2x/cjs/components/modal/modal.js +39 -36
- package/2x/cjs/components/popover/arrow.js +1 -2
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/2x/cjs/components/switch/spin-icon.d.ts +3 -0
- package/2x/cjs/components/switch/spin-icon.js +37 -0
- package/2x/cjs/components/switch/switch.css +1 -1
- package/2x/cjs/components/switch/switch.js +4 -6
- package/2x/cjs/locales/base.d.ts +51 -0
- package/2x/cjs/locales/base.js +52 -0
- package/2x/cjs/locales/en-US.d.ts +51 -0
- package/2x/cjs/locales/zh-CN.d.ts +51 -0
- package/2x/cjs/locales/zh-CN.js +52 -0
- package/2x/es/components/avatar/avatar.js +1 -0
- package/2x/es/components/calendar/calendar.js +23 -19
- package/2x/es/components/date-picker/date-picker.js +3 -7
- package/2x/es/components/dialog/dialog.css +27 -18
- package/2x/es/components/dialog/dialog.js +37 -41
- package/2x/es/components/dropdown/dropdown.css +2 -1
- package/2x/es/components/ellipsis/ellipsis.d.ts +2 -0
- package/2x/es/components/ellipsis/ellipsis.js +7 -5
- package/2x/es/components/form/context.d.ts +2 -1
- package/2x/es/components/form/context.js +4 -3
- package/2x/es/components/form/form-item.css +27 -1
- package/2x/es/components/form/form-item.d.ts +1 -0
- package/2x/es/components/form/form-item.js +43 -13
- package/2x/es/components/form/form.js +18 -11
- package/2x/es/components/form/index.css +27 -1
- package/2x/es/components/input/input.js +2 -2
- package/2x/es/components/modal/modal.css +27 -21
- package/2x/es/components/modal/modal.js +37 -36
- package/2x/es/components/popover/arrow.js +1 -2
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/2x/es/components/switch/spin-icon.d.ts +3 -0
- package/2x/es/components/switch/spin-icon.js +23 -0
- package/2x/es/components/switch/switch.css +1 -1
- package/2x/es/components/switch/switch.js +3 -5
- package/2x/es/locales/base.d.ts +51 -0
- package/2x/es/locales/base.js +52 -0
- package/2x/es/locales/en-US.d.ts +51 -0
- package/2x/es/locales/zh-CN.d.ts +51 -0
- package/2x/es/locales/zh-CN.js +52 -0
- package/2x/package.json +4 -4
- package/cjs/components/avatar/avatar.js +1 -0
- package/cjs/components/calendar/calendar.js +23 -20
- package/cjs/components/date-picker/date-picker.js +3 -7
- package/cjs/components/dialog/dialog.css +26 -18
- package/cjs/components/dialog/dialog.js +39 -42
- package/cjs/components/dropdown/dropdown.css +2 -1
- package/cjs/components/ellipsis/ellipsis.d.ts +2 -0
- package/cjs/components/ellipsis/ellipsis.js +8 -5
- package/cjs/components/form/context.d.ts +2 -1
- package/cjs/components/form/context.js +6 -5
- package/cjs/components/form/form-item.css +21 -1
- package/cjs/components/form/form-item.d.ts +1 -0
- package/cjs/components/form/form-item.js +44 -13
- package/cjs/components/form/form.js +18 -9
- package/cjs/components/form/index.css +21 -1
- package/cjs/components/input/input.js +2 -2
- package/cjs/components/modal/modal.css +26 -20
- package/cjs/components/modal/modal.js +39 -36
- package/cjs/components/popover/arrow.js +1 -2
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/cjs/components/switch/spin-icon.d.ts +3 -0
- package/cjs/components/switch/spin-icon.js +37 -0
- package/cjs/components/switch/switch.css +1 -1
- package/cjs/components/switch/switch.js +4 -6
- package/cjs/locales/base.d.ts +51 -0
- package/cjs/locales/base.js +52 -0
- package/cjs/locales/en-US.d.ts +51 -0
- package/cjs/locales/zh-CN.d.ts +51 -0
- package/cjs/locales/zh-CN.js +52 -0
- package/es/components/avatar/avatar.js +1 -0
- package/es/components/calendar/calendar.js +23 -19
- package/es/components/date-picker/date-picker.js +3 -7
- package/es/components/dialog/dialog.css +26 -18
- package/es/components/dialog/dialog.js +37 -41
- package/es/components/dropdown/dropdown.css +2 -1
- package/es/components/ellipsis/ellipsis.d.ts +2 -0
- package/es/components/ellipsis/ellipsis.js +7 -5
- package/es/components/form/context.d.ts +2 -1
- package/es/components/form/context.js +4 -3
- package/es/components/form/form-item.css +21 -1
- package/es/components/form/form-item.d.ts +1 -0
- package/es/components/form/form-item.js +43 -13
- package/es/components/form/form.js +18 -11
- package/es/components/form/index.css +21 -1
- package/es/components/input/input.js +2 -2
- package/es/components/modal/modal.css +26 -20
- package/es/components/modal/modal.js +37 -36
- package/es/components/popover/arrow.js +1 -2
- package/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/es/components/switch/spin-icon.d.ts +3 -0
- package/es/components/switch/spin-icon.js +23 -0
- package/es/components/switch/switch.css +1 -1
- package/es/components/switch/switch.js +3 -5
- package/es/locales/base.d.ts +51 -0
- package/es/locales/base.js +52 -0
- package/es/locales/en-US.d.ts +51 -0
- package/es/locales/zh-CN.d.ts +51 -0
- package/es/locales/zh-CN.js +52 -0
- package/package.json +4 -4
- package/umd/antd-mobile.js +1 -1
- package/umd/antd-mobile.js.LICENSE.txt +0 -24
- package/2x/assets/spin.svg +0 -12
- package/2x/cjs/assets/spin.svg +0 -12
- package/2x/es/assets/spin.svg +0 -12
- package/assets/spin.svg +0 -12
- package/cjs/assets/spin.svg +0 -12
- package/es/assets/spin.svg +0 -12
|
@@ -16,48 +16,53 @@
|
|
|
16
16
|
max-width: 75vw;
|
|
17
17
|
transform: translate(-50%, -50%);
|
|
18
18
|
}
|
|
19
|
-
.adm-modal-
|
|
19
|
+
.adm-modal-body {
|
|
20
20
|
width: 100%;
|
|
21
21
|
max-height: 70vh;
|
|
22
22
|
box-sizing: border-box;
|
|
23
23
|
font-size: 14px;
|
|
24
24
|
background-color: white;
|
|
25
25
|
border-radius: 8px;
|
|
26
|
-
overflow
|
|
27
|
-
overflow-y: auto;
|
|
26
|
+
overflow: hidden;
|
|
28
27
|
display: flex;
|
|
29
28
|
flex-direction: column;
|
|
30
29
|
}
|
|
31
|
-
.adm-modal-
|
|
30
|
+
.adm-modal-body > * {
|
|
32
31
|
flex: none;
|
|
33
32
|
}
|
|
34
|
-
.adm-modal-
|
|
33
|
+
.adm-modal-body > .adm-modal-content {
|
|
35
34
|
flex: auto;
|
|
36
35
|
}
|
|
37
|
-
.adm-modal-
|
|
38
|
-
padding: 20px
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
36
|
+
.adm-modal-body:not(.adm-modal-with-image) {
|
|
37
|
+
padding-top: 20px;
|
|
41
38
|
}
|
|
42
|
-
.adm-modal-
|
|
43
|
-
margin-
|
|
39
|
+
.adm-modal-body .adm-modal-image-container {
|
|
40
|
+
margin-bottom: 12px;
|
|
41
|
+
max-height: 40vh;
|
|
42
|
+
overflow-y: scroll;
|
|
44
43
|
}
|
|
45
|
-
.adm-modal-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
.adm-modal-body .adm-modal-header {
|
|
45
|
+
margin-bottom: 8px;
|
|
46
|
+
padding: 0 12px;
|
|
48
47
|
}
|
|
49
|
-
.adm-modal-
|
|
48
|
+
.adm-modal-body .adm-modal-title {
|
|
49
|
+
margin-bottom: 8px;
|
|
50
|
+
padding: 0 12px;
|
|
50
51
|
font-weight: bold;
|
|
51
52
|
font-size: 18px;
|
|
52
53
|
line-height: 25px;
|
|
53
54
|
text-align: center;
|
|
54
55
|
}
|
|
55
|
-
.adm-modal-
|
|
56
|
+
.adm-modal-body .adm-modal-content {
|
|
57
|
+
padding: 0 12px 12px;
|
|
58
|
+
max-height: 70vh;
|
|
59
|
+
overflow-x: hidden;
|
|
60
|
+
overflow-y: auto;
|
|
56
61
|
font-size: 15px;
|
|
57
62
|
line-height: 1.4;
|
|
58
63
|
color: #333;
|
|
59
64
|
}
|
|
60
|
-
.adm-modal-
|
|
65
|
+
.adm-modal-body .adm-modal-close {
|
|
61
66
|
position: absolute;
|
|
62
67
|
right: 8px;
|
|
63
68
|
top: 8px;
|
|
@@ -69,6 +74,10 @@
|
|
|
69
74
|
user-select: none;
|
|
70
75
|
padding: 8px 12px 12px;
|
|
71
76
|
}
|
|
77
|
+
.adm-modal-footer-empty {
|
|
78
|
+
padding: 0;
|
|
79
|
+
height: 8px;
|
|
80
|
+
}
|
|
72
81
|
.adm-modal-footer.adm-space {
|
|
73
82
|
--gap-vertical: 20px;
|
|
74
83
|
}
|
|
@@ -86,6 +95,3 @@
|
|
|
86
95
|
.adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
|
|
87
96
|
opacity: 0.7;
|
|
88
97
|
}
|
|
89
|
-
.adm-modal-image-container {
|
|
90
|
-
overflow-y: auto;
|
|
91
|
-
}
|
|
@@ -81,49 +81,29 @@ const Modal = p => {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
const [active, setActive] = (0, _react.useState)(props.visible);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
}, _react.default.createElement(_mask.default, {
|
|
90
|
-
visible: props.visible,
|
|
91
|
-
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
92
|
-
style: props.maskStyle,
|
|
93
|
-
className: (0, _classnames.default)(`${classPrefix}-mask`, props.maskClassName)
|
|
94
|
-
}), _react.default.createElement("div", {
|
|
95
|
-
className: `${classPrefix}-wrap`,
|
|
96
|
-
style: {
|
|
97
|
-
pointerEvents: props.visible ? 'unset' : 'none'
|
|
98
|
-
}
|
|
99
|
-
}, _react.default.createElement(_web.animated.div, {
|
|
100
|
-
style: Object.assign({}, style),
|
|
101
|
-
onClick: e => e.stopPropagation(),
|
|
102
|
-
className: `${classPrefix}-main`
|
|
84
|
+
|
|
85
|
+
const body = _react.default.createElement("div", {
|
|
86
|
+
className: (0, _classnames.default)(cls('body'), props.image && cls('with-image'), props.bodyClassName),
|
|
87
|
+
style: props.bodyStyle
|
|
103
88
|
}, props.showCloseButton && _react.default.createElement("a", {
|
|
104
|
-
className: (0, _classnames.default)(
|
|
89
|
+
className: (0, _classnames.default)(cls('close'), 'adm-plain-anchor'),
|
|
105
90
|
onClick: props.onClose
|
|
106
91
|
}, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), !!props.image && _react.default.createElement("div", {
|
|
107
|
-
className:
|
|
92
|
+
className: cls('image-container')
|
|
108
93
|
}, _react.default.createElement(_image.default, {
|
|
109
94
|
src: props.image,
|
|
110
95
|
alt: 'modal header image',
|
|
111
96
|
width: '100%'
|
|
112
|
-
})), _react.default.createElement("div", {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, props.header)), !!props.title && _react.default.createElement("div", {
|
|
120
|
-
className: `${classPrefix}-body-title`
|
|
121
|
-
}, props.title), !!props.content && _react.default.createElement("div", {
|
|
122
|
-
className: `${classPrefix}-body-content`
|
|
123
|
-
}, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content)), _react.default.createElement(_space.default, {
|
|
97
|
+
})), !!props.header && _react.default.createElement("div", {
|
|
98
|
+
className: cls('header')
|
|
99
|
+
}, _react.default.createElement(_autoCenter.default, null, props.header)), !!props.title && _react.default.createElement("div", {
|
|
100
|
+
className: cls('title')
|
|
101
|
+
}, props.title), _react.default.createElement("div", {
|
|
102
|
+
className: cls('content')
|
|
103
|
+
}, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content), _react.default.createElement(_space.default, {
|
|
124
104
|
direction: 'vertical',
|
|
125
105
|
block: true,
|
|
126
|
-
className:
|
|
106
|
+
className: (0, _classnames.default)(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
|
|
127
107
|
}, props.actions.map((action, index) => {
|
|
128
108
|
return _react.default.createElement(_modalActionButton.ModalActionButton, {
|
|
129
109
|
key: action.key,
|
|
@@ -138,8 +118,31 @@ const Modal = p => {
|
|
|
138
118
|
}
|
|
139
119
|
})
|
|
140
120
|
});
|
|
141
|
-
})))
|
|
121
|
+
})));
|
|
122
|
+
|
|
123
|
+
const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
124
|
+
className: cls(),
|
|
125
|
+
style: {
|
|
126
|
+
display: active ? 'unset' : 'none'
|
|
127
|
+
}
|
|
128
|
+
}, _react.default.createElement(_mask.default, {
|
|
129
|
+
visible: props.visible,
|
|
130
|
+
onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
|
|
131
|
+
style: props.maskStyle,
|
|
132
|
+
className: (0, _classnames.default)(cls('mask'), props.maskClassName)
|
|
133
|
+
}), _react.default.createElement("div", {
|
|
134
|
+
className: cls('wrap'),
|
|
135
|
+
style: {
|
|
136
|
+
pointerEvents: props.visible ? 'unset' : 'none'
|
|
137
|
+
}
|
|
138
|
+
}, _react.default.createElement(_web.animated.div, {
|
|
139
|
+
style: style
|
|
140
|
+
}, body)))));
|
|
142
141
|
return (0, _renderToContainer.renderToContainer)(props.getContainer, node);
|
|
143
142
|
};
|
|
144
143
|
|
|
145
|
-
exports.Modal = Modal;
|
|
144
|
+
exports.Modal = Modal;
|
|
145
|
+
|
|
146
|
+
function cls(name = '') {
|
|
147
|
+
return 'adm-modal' + (name && '-') + name;
|
|
148
|
+
}
|
|
@@ -17,10 +17,9 @@ const Arrow = (0, _react.memo)(props => {
|
|
|
17
17
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
18
18
|
viewBox: '0 0 30 16'
|
|
19
19
|
}, _react.default.createElement("g", {
|
|
20
|
-
transform: 'translate(-1300.000000, -841.000000)',
|
|
21
20
|
fill: 'currentColor'
|
|
22
21
|
}, _react.default.createElement("path", {
|
|
23
|
-
d: '
|
|
22
|
+
d: 'M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z'
|
|
24
23
|
}))));
|
|
25
24
|
});
|
|
26
25
|
exports.Arrow = Arrow;
|
|
@@ -131,7 +131,7 @@ const PullToRefresh = p => {
|
|
|
131
131
|
if (!element) return;
|
|
132
132
|
const scrollParent = (0, _getScrollParent.getScrollParent)(element);
|
|
133
133
|
if (!scrollParent) return;
|
|
134
|
-
const top = 'scrollTop' in scrollParent ? scrollParent.scrollTop : scrollParent.
|
|
134
|
+
const top = 'scrollTop' in scrollParent ? scrollParent.scrollTop : scrollParent.scrollY;
|
|
135
135
|
|
|
136
136
|
if (top <= 0 && y > 0) {
|
|
137
137
|
pullingRef.current = true;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SpinIcon = 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 SpinIcon = (0, _react.memo)(props => {
|
|
17
|
+
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
|
|
18
|
+
width: '28px',
|
|
19
|
+
height: '28px',
|
|
20
|
+
viewBox: '0 0 28 28'
|
|
21
|
+
}, _react.default.createElement("g", {
|
|
22
|
+
stroke: 'none',
|
|
23
|
+
strokeWidth: '1',
|
|
24
|
+
fill: 'none',
|
|
25
|
+
fillRule: 'evenodd'
|
|
26
|
+
}, _react.default.createElement("g", {
|
|
27
|
+
transform: 'translate(-137.000000, -840.000000)',
|
|
28
|
+
fill: '#1576FE'
|
|
29
|
+
}, _react.default.createElement("g", {
|
|
30
|
+
transform: 'translate(80.000000, 823.000000)'
|
|
31
|
+
}, _react.default.createElement("g", {
|
|
32
|
+
transform: 'translate(53.000000, 13.000000)'
|
|
33
|
+
}, _react.default.createElement("path", {
|
|
34
|
+
d: 'M17.9996753,31.5 C10.5556724,31.5 4.5,25.4443275 4.5,18.0003247 C4.5,10.5563219 10.5556724,4.5 17.9996753,4.5 C18.5355492,4.5 18.9702974,4.93474816 18.9702974,5.47062208 C18.9702974,6.006496 18.5355492,6.44124416 17.9996753,6.44124416 C11.6261524,6.44124416 6.44124416,11.6267709 6.44124416,18.0002938 C6.44124416,24.3738167 11.6261524,29.5587249 17.9996753,29.5587249 C24.3731982,29.5587249 29.5587249,24.3738167 29.5587249,18.0002938 C29.5587249,14.7964616 28.2778291,11.8169616 25.9523687,9.61220279 C25.5637302,9.24317094 25.5473089,8.62893223 25.9157222,8.23967523 C26.2841356,7.84976878 26.8989928,7.83461537 27.2882498,8.20302872 C30.0042351,10.7787368 31.5,14.2580826 31.5,18.0002938 C31.5,25.4443275 25.4436781,31.5 17.9996753,31.5 Z'
|
|
35
|
+
})))))));
|
|
36
|
+
});
|
|
37
|
+
exports.SpinIcon = SpinIcon;
|
|
@@ -11,14 +11,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var _spin = _interopRequireDefault(require("../../assets/spin.svg"));
|
|
15
|
-
|
|
16
14
|
var _nativeProps = require("../../utils/native-props");
|
|
17
15
|
|
|
18
16
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
19
17
|
|
|
20
18
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
21
19
|
|
|
20
|
+
var _spinIcon = require("./spin-icon");
|
|
21
|
+
|
|
22
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
23
|
|
|
24
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; }
|
|
@@ -75,10 +75,8 @@ const Switch = p => {
|
|
|
75
75
|
className: `${classPrefix}-checkbox`
|
|
76
76
|
}, _react.default.createElement("div", {
|
|
77
77
|
className: `${classPrefix}-handle`
|
|
78
|
-
}, (props.loading || changing) && _react.default.createElement(
|
|
79
|
-
|
|
80
|
-
className: `${classPrefix}-icon`,
|
|
81
|
-
alt: 'switch-handle'
|
|
78
|
+
}, (props.loading || changing) && _react.default.createElement(_spinIcon.SpinIcon, {
|
|
79
|
+
className: `${classPrefix}-spin-icon`
|
|
82
80
|
})), _react.default.createElement("div", {
|
|
83
81
|
className: `${classPrefix}-inner`
|
|
84
82
|
}, checked ? props.checkedText : props.uncheckedText))));
|
package/cjs/locales/base.d.ts
CHANGED
|
@@ -31,6 +31,57 @@ export declare const base: {
|
|
|
31
31
|
description: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
Form: {
|
|
35
|
+
required: string;
|
|
36
|
+
optional: string;
|
|
37
|
+
defaultValidateMessages: {
|
|
38
|
+
default: string;
|
|
39
|
+
required: string;
|
|
40
|
+
enum: string;
|
|
41
|
+
whitespace: string;
|
|
42
|
+
date: {
|
|
43
|
+
format: string;
|
|
44
|
+
parse: string;
|
|
45
|
+
invalid: string;
|
|
46
|
+
};
|
|
47
|
+
types: {
|
|
48
|
+
string: string;
|
|
49
|
+
method: string;
|
|
50
|
+
array: string;
|
|
51
|
+
object: string;
|
|
52
|
+
number: string;
|
|
53
|
+
date: string;
|
|
54
|
+
boolean: string;
|
|
55
|
+
integer: string;
|
|
56
|
+
float: string;
|
|
57
|
+
regexp: string;
|
|
58
|
+
email: string;
|
|
59
|
+
url: string;
|
|
60
|
+
hex: string;
|
|
61
|
+
};
|
|
62
|
+
string: {
|
|
63
|
+
len: string;
|
|
64
|
+
min: string;
|
|
65
|
+
max: string;
|
|
66
|
+
range: string;
|
|
67
|
+
};
|
|
68
|
+
number: {
|
|
69
|
+
len: string;
|
|
70
|
+
min: string;
|
|
71
|
+
max: string;
|
|
72
|
+
range: string;
|
|
73
|
+
};
|
|
74
|
+
array: {
|
|
75
|
+
len: string;
|
|
76
|
+
min: string;
|
|
77
|
+
max: string;
|
|
78
|
+
range: string;
|
|
79
|
+
};
|
|
80
|
+
pattern: {
|
|
81
|
+
mismatch: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
34
85
|
ImageUploader: {
|
|
35
86
|
uploading: string;
|
|
36
87
|
};
|
package/cjs/locales/base.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.base = void 0;
|
|
7
|
+
const typeTemplate = '${label} is not a valid ${type}';
|
|
7
8
|
const base = {
|
|
8
9
|
common: {
|
|
9
10
|
confirm: 'Confirm',
|
|
@@ -37,6 +38,57 @@ const base = {
|
|
|
37
38
|
description: 'Want to try a new search?'
|
|
38
39
|
}
|
|
39
40
|
},
|
|
41
|
+
Form: {
|
|
42
|
+
required: 'Required',
|
|
43
|
+
optional: 'Optional',
|
|
44
|
+
defaultValidateMessages: {
|
|
45
|
+
default: 'Field validation error for ${label}',
|
|
46
|
+
required: 'Please enter ${label}',
|
|
47
|
+
enum: '${label} must be one of [${enum}]',
|
|
48
|
+
whitespace: '${label} cannot be a blank character',
|
|
49
|
+
date: {
|
|
50
|
+
format: '${label} date format is invalid',
|
|
51
|
+
parse: '${label} cannot be converted to a date',
|
|
52
|
+
invalid: '${label} is an invalid date'
|
|
53
|
+
},
|
|
54
|
+
types: {
|
|
55
|
+
string: typeTemplate,
|
|
56
|
+
method: typeTemplate,
|
|
57
|
+
array: typeTemplate,
|
|
58
|
+
object: typeTemplate,
|
|
59
|
+
number: typeTemplate,
|
|
60
|
+
date: typeTemplate,
|
|
61
|
+
boolean: typeTemplate,
|
|
62
|
+
integer: typeTemplate,
|
|
63
|
+
float: typeTemplate,
|
|
64
|
+
regexp: typeTemplate,
|
|
65
|
+
email: typeTemplate,
|
|
66
|
+
url: typeTemplate,
|
|
67
|
+
hex: typeTemplate
|
|
68
|
+
},
|
|
69
|
+
string: {
|
|
70
|
+
len: '${label} must be ${len} characters',
|
|
71
|
+
min: '${label} must be at least ${min} characters',
|
|
72
|
+
max: '${label} must be up to ${max} characters',
|
|
73
|
+
range: '${label} must be between ${min}-${max} characters'
|
|
74
|
+
},
|
|
75
|
+
number: {
|
|
76
|
+
len: '${label} must be equal to ${len}',
|
|
77
|
+
min: '${label} must be minimum ${min}',
|
|
78
|
+
max: '${label} must be maximum ${max}',
|
|
79
|
+
range: '${label} must be between ${min}-${max}'
|
|
80
|
+
},
|
|
81
|
+
array: {
|
|
82
|
+
len: 'Must be ${len} ${label}',
|
|
83
|
+
min: 'At least ${min} ${label}',
|
|
84
|
+
max: 'At most ${max} ${label}',
|
|
85
|
+
range: 'The amount of ${label} must be between ${min}-${max}'
|
|
86
|
+
},
|
|
87
|
+
pattern: {
|
|
88
|
+
mismatch: '${label} does not match the pattern ${pattern}'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
40
92
|
ImageUploader: {
|
|
41
93
|
uploading: 'Uploading...'
|
|
42
94
|
},
|
package/cjs/locales/en-US.d.ts
CHANGED
|
@@ -31,6 +31,57 @@ declare const enUS: {
|
|
|
31
31
|
description: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
Form: {
|
|
35
|
+
required: string;
|
|
36
|
+
optional: string;
|
|
37
|
+
defaultValidateMessages: {
|
|
38
|
+
default: string;
|
|
39
|
+
required: string;
|
|
40
|
+
enum: string;
|
|
41
|
+
whitespace: string;
|
|
42
|
+
date: {
|
|
43
|
+
format: string;
|
|
44
|
+
parse: string;
|
|
45
|
+
invalid: string;
|
|
46
|
+
};
|
|
47
|
+
types: {
|
|
48
|
+
string: string;
|
|
49
|
+
method: string;
|
|
50
|
+
array: string;
|
|
51
|
+
object: string;
|
|
52
|
+
number: string;
|
|
53
|
+
date: string;
|
|
54
|
+
boolean: string;
|
|
55
|
+
integer: string;
|
|
56
|
+
float: string;
|
|
57
|
+
regexp: string;
|
|
58
|
+
email: string;
|
|
59
|
+
url: string;
|
|
60
|
+
hex: string;
|
|
61
|
+
};
|
|
62
|
+
string: {
|
|
63
|
+
len: string;
|
|
64
|
+
min: string;
|
|
65
|
+
max: string;
|
|
66
|
+
range: string;
|
|
67
|
+
};
|
|
68
|
+
number: {
|
|
69
|
+
len: string;
|
|
70
|
+
min: string;
|
|
71
|
+
max: string;
|
|
72
|
+
range: string;
|
|
73
|
+
};
|
|
74
|
+
array: {
|
|
75
|
+
len: string;
|
|
76
|
+
min: string;
|
|
77
|
+
max: string;
|
|
78
|
+
range: string;
|
|
79
|
+
};
|
|
80
|
+
pattern: {
|
|
81
|
+
mismatch: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
34
85
|
ImageUploader: {
|
|
35
86
|
uploading: string;
|
|
36
87
|
};
|
package/cjs/locales/zh-CN.d.ts
CHANGED
|
@@ -31,6 +31,57 @@ declare const zhCN: {
|
|
|
31
31
|
description: string;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
Form: {
|
|
35
|
+
required: string;
|
|
36
|
+
optional: string;
|
|
37
|
+
defaultValidateMessages: {
|
|
38
|
+
default: string;
|
|
39
|
+
required: string;
|
|
40
|
+
enum: string;
|
|
41
|
+
whitespace: string;
|
|
42
|
+
date: {
|
|
43
|
+
format: string;
|
|
44
|
+
parse: string;
|
|
45
|
+
invalid: string;
|
|
46
|
+
};
|
|
47
|
+
types: {
|
|
48
|
+
string: string;
|
|
49
|
+
method: string;
|
|
50
|
+
array: string;
|
|
51
|
+
object: string;
|
|
52
|
+
number: string;
|
|
53
|
+
date: string;
|
|
54
|
+
boolean: string;
|
|
55
|
+
integer: string;
|
|
56
|
+
float: string;
|
|
57
|
+
regexp: string;
|
|
58
|
+
email: string;
|
|
59
|
+
url: string;
|
|
60
|
+
hex: string;
|
|
61
|
+
};
|
|
62
|
+
string: {
|
|
63
|
+
len: string;
|
|
64
|
+
min: string;
|
|
65
|
+
max: string;
|
|
66
|
+
range: string;
|
|
67
|
+
};
|
|
68
|
+
number: {
|
|
69
|
+
len: string;
|
|
70
|
+
min: string;
|
|
71
|
+
max: string;
|
|
72
|
+
range: string;
|
|
73
|
+
};
|
|
74
|
+
array: {
|
|
75
|
+
len: string;
|
|
76
|
+
min: string;
|
|
77
|
+
max: string;
|
|
78
|
+
range: string;
|
|
79
|
+
};
|
|
80
|
+
pattern: {
|
|
81
|
+
mismatch: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
34
85
|
ImageUploader: {
|
|
35
86
|
uploading: string;
|
|
36
87
|
};
|
package/cjs/locales/zh-CN.js
CHANGED
|
@@ -9,6 +9,7 @@ var _mergeLocale = require("../utils/merge-locale");
|
|
|
9
9
|
|
|
10
10
|
var _base = require("./base");
|
|
11
11
|
|
|
12
|
+
const typeTemplate = '${label}不是一个有效的${type}';
|
|
12
13
|
const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
13
14
|
common: {
|
|
14
15
|
confirm: '确定',
|
|
@@ -42,6 +43,57 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
42
43
|
description: '找找其他的吧'
|
|
43
44
|
}
|
|
44
45
|
},
|
|
46
|
+
Form: {
|
|
47
|
+
required: '必填',
|
|
48
|
+
optional: '选填',
|
|
49
|
+
defaultValidateMessages: {
|
|
50
|
+
default: '字段验证错误${label}',
|
|
51
|
+
required: '请输入${label}',
|
|
52
|
+
enum: '${label}必须是其中一个[${enum}]',
|
|
53
|
+
whitespace: '${label}不能为空字符',
|
|
54
|
+
date: {
|
|
55
|
+
format: '${label}日期格式无效',
|
|
56
|
+
parse: '${label}不能转换为日期',
|
|
57
|
+
invalid: '${label}是一个无效日期'
|
|
58
|
+
},
|
|
59
|
+
types: {
|
|
60
|
+
string: typeTemplate,
|
|
61
|
+
method: typeTemplate,
|
|
62
|
+
array: typeTemplate,
|
|
63
|
+
object: typeTemplate,
|
|
64
|
+
number: typeTemplate,
|
|
65
|
+
date: typeTemplate,
|
|
66
|
+
boolean: typeTemplate,
|
|
67
|
+
integer: typeTemplate,
|
|
68
|
+
float: typeTemplate,
|
|
69
|
+
regexp: typeTemplate,
|
|
70
|
+
email: typeTemplate,
|
|
71
|
+
url: typeTemplate,
|
|
72
|
+
hex: typeTemplate
|
|
73
|
+
},
|
|
74
|
+
string: {
|
|
75
|
+
len: '${label}须为${len}个字符',
|
|
76
|
+
min: '${label}最少${min}个字符',
|
|
77
|
+
max: '${label}最多${max}个字符',
|
|
78
|
+
range: '${label}须在${min}-${max}字符之间'
|
|
79
|
+
},
|
|
80
|
+
number: {
|
|
81
|
+
len: '${label}必须等于${len}',
|
|
82
|
+
min: '${label}最小值为${min}',
|
|
83
|
+
max: '${label}最大值为${max}',
|
|
84
|
+
range: '${label}须在${min}-${max}之间'
|
|
85
|
+
},
|
|
86
|
+
array: {
|
|
87
|
+
len: '须为${len}个${label}',
|
|
88
|
+
min: '最少${min}个${label}',
|
|
89
|
+
max: '最多${max}个${label}',
|
|
90
|
+
range: '${label}数量须在${min}-${max}之间'
|
|
91
|
+
},
|
|
92
|
+
pattern: {
|
|
93
|
+
mismatch: '${label}与模式不匹配${pattern}'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
45
97
|
ImageUploader: {
|
|
46
98
|
uploading: '上传中...'
|
|
47
99
|
},
|
|
@@ -26,7 +26,29 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
26
26
|
if (item) markItems.unshift(item);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const dateRange = useMemo(() => {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
|
|
32
|
+
if (props.selectionMode === 'single') {
|
|
33
|
+
const value = (_b = (_a = props.value) !== null && _a !== void 0 ? _a : props.defaultValue) !== null && _b !== void 0 ? _b : null;
|
|
34
|
+
return [value, value];
|
|
35
|
+
} else if (props.selectionMode === 'range') {
|
|
36
|
+
return (_d = (_c = props.value) !== null && _c !== void 0 ? _c : props.defaultValue) !== null && _d !== void 0 ? _d : [null, null];
|
|
37
|
+
} else {
|
|
38
|
+
return [null, null];
|
|
39
|
+
}
|
|
40
|
+
}, [props.selectionMode, props.value, props.defaultValue]);
|
|
41
|
+
const [begin, setBegin] = useState(null);
|
|
42
|
+
const [end, setEnd] = useState(null);
|
|
43
|
+
useIsomorphicLayoutEffect(() => {
|
|
44
|
+
setBegin(dateRange[0] ? dayjs(dateRange[0]) : null);
|
|
45
|
+
setEnd(dateRange[1] ? dayjs(dateRange[1]) : null);
|
|
46
|
+
}, [dateRange[0], dateRange[1]]);
|
|
47
|
+
const [current, setCurrent] = useState(() => {
|
|
48
|
+
var _a;
|
|
49
|
+
|
|
50
|
+
return dayjs((_a = dateRange[0]) !== null && _a !== void 0 ? _a : today).date(1);
|
|
51
|
+
});
|
|
30
52
|
useUpdateEffect(() => {
|
|
31
53
|
var _a;
|
|
32
54
|
|
|
@@ -76,24 +98,6 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
76
98
|
setCurrent(current.add(1, 'year'));
|
|
77
99
|
}
|
|
78
100
|
}, React.createElement(ArrowLeftDouble, null)));
|
|
79
|
-
const dateRange = useMemo(() => {
|
|
80
|
-
var _a, _b, _c, _d;
|
|
81
|
-
|
|
82
|
-
if (props.selectionMode === 'single') {
|
|
83
|
-
const value = (_b = (_a = props.value) !== null && _a !== void 0 ? _a : props.defaultValue) !== null && _b !== void 0 ? _b : null;
|
|
84
|
-
return [value, value];
|
|
85
|
-
} else if (props.selectionMode === 'range') {
|
|
86
|
-
return (_d = (_c = props.value) !== null && _c !== void 0 ? _c : props.defaultValue) !== null && _d !== void 0 ? _d : [null, null];
|
|
87
|
-
} else {
|
|
88
|
-
return [null, null];
|
|
89
|
-
}
|
|
90
|
-
}, [props.selectionMode, props.value, props.defaultValue]);
|
|
91
|
-
const [begin, setBegin] = useState(null);
|
|
92
|
-
const [end, setEnd] = useState(null);
|
|
93
|
-
useIsomorphicLayoutEffect(() => {
|
|
94
|
-
setBegin(dateRange[0] ? dayjs(dateRange[0]) : null);
|
|
95
|
-
setEnd(dateRange[1] ? dayjs(dateRange[1]) : null);
|
|
96
|
-
}, [dateRange[0], dateRange[1]]);
|
|
97
101
|
|
|
98
102
|
function renderCells() {
|
|
99
103
|
var _a;
|