antd-mobile 5.31.0 → 5.32.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 +283 -254
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +284 -255
- package/2x/bundle/antd-mobile.es.js +4494 -4468
- package/2x/bundle/antd-mobile.umd.development.js +283 -254
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +3 -0
- package/2x/cjs/components/calendar/convert.js +1 -6
- package/2x/cjs/components/capsule-tabs/capsule-tabs.js +2 -4
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/checkbox/checkbox.d.ts +2 -0
- package/2x/cjs/components/checkbox/checkbox.js +1 -0
- package/2x/cjs/components/checkbox/index.d.ts +1 -0
- package/2x/cjs/components/collapse/collapse.js +1 -1
- package/2x/cjs/components/date-picker/date-picker-date-utils.js +24 -36
- package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -18
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/2x/cjs/components/date-picker-view/date-picker-view.js +8 -2
- package/2x/cjs/components/dropdown/dropdown.js +1 -1
- package/2x/cjs/components/footer/footer.js +17 -21
- package/2x/cjs/components/form/form-subscribe.js +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -3
- package/2x/cjs/components/input/input.js +5 -1
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +1 -1
- package/2x/cjs/components/modal/modal.js +11 -13
- package/2x/cjs/components/notice-bar/notice-bar.css +2 -0
- package/2x/cjs/components/popover/popover.js +5 -7
- package/2x/cjs/components/popup/popup.js +3 -3
- package/2x/cjs/components/radio/radio.d.ts +1 -0
- package/2x/cjs/components/radio/radio.js +1 -0
- package/2x/cjs/components/rate/star.d.ts +1 -1
- package/2x/cjs/components/result/result.js +2 -2
- package/2x/cjs/components/safe-area/safe-area.d.ts +1 -1
- package/2x/cjs/components/safe-area/safe-area.js +1 -1
- package/2x/cjs/components/side-bar/side-bar.d.ts +1 -2
- package/2x/cjs/components/side-bar/side-bar.js +4 -2
- package/2x/cjs/components/skeleton/skeleton.d.ts +1 -1
- package/2x/cjs/components/stepper/stepper.js +1 -5
- package/2x/cjs/components/swiper/swiper.js +1 -1
- package/2x/cjs/components/tab-bar/tab-bar.d.ts +1 -2
- package/2x/cjs/components/tab-bar/tab-bar.js +4 -2
- package/2x/cjs/components/tabs/tabs.js +1 -1
- package/2x/cjs/components/text-area/text-area.css +1 -0
- package/2x/cjs/components/tree-select/multiple.js +2 -6
- package/2x/cjs/components/virtual-input/virtual-input.js +1 -1
- package/2x/cjs/locales/ru-RU.d.ts +134 -0
- package/2x/cjs/locales/ru-RU.js +144 -0
- package/2x/es/components/calendar/convert.js +1 -6
- package/2x/es/components/capsule-tabs/capsule-tabs.js +3 -5
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/checkbox/checkbox.d.ts +2 -0
- package/2x/es/components/checkbox/checkbox.js +1 -0
- package/2x/es/components/checkbox/index.d.ts +1 -0
- package/2x/es/components/collapse/collapse.js +2 -2
- package/2x/es/components/date-picker/date-picker-date-utils.js +24 -36
- package/2x/es/components/date-picker/date-picker-week-utils.js +12 -18
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/2x/es/components/date-picker-view/date-picker-view.js +8 -2
- package/2x/es/components/dropdown/dropdown.js +2 -2
- package/2x/es/components/footer/footer.js +17 -21
- package/2x/es/components/form/form-subscribe.js +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +1 -3
- package/2x/es/components/input/input.js +5 -1
- package/2x/es/components/jumbo-tabs/jumbo-tabs.js +2 -2
- package/2x/es/components/modal/modal.js +11 -13
- package/2x/es/components/notice-bar/notice-bar.css +2 -0
- package/2x/es/components/popover/popover.js +5 -7
- package/2x/es/components/popup/popup.js +3 -3
- package/2x/es/components/radio/radio.d.ts +1 -0
- package/2x/es/components/radio/radio.js +1 -0
- package/2x/es/components/rate/star.d.ts +1 -1
- package/2x/es/components/result/result.js +2 -2
- package/2x/es/components/safe-area/safe-area.d.ts +1 -1
- package/2x/es/components/safe-area/safe-area.js +1 -1
- package/2x/es/components/side-bar/side-bar.d.ts +1 -2
- package/2x/es/components/side-bar/side-bar.js +2 -2
- package/2x/es/components/skeleton/skeleton.d.ts +1 -1
- package/2x/es/components/stepper/stepper.js +1 -5
- package/2x/es/components/swiper/swiper.js +1 -1
- package/2x/es/components/tab-bar/tab-bar.d.ts +1 -2
- package/2x/es/components/tab-bar/tab-bar.js +2 -2
- package/2x/es/components/tabs/tabs.js +2 -2
- package/2x/es/components/text-area/text-area.css +1 -0
- package/2x/es/components/tree-select/multiple.js +2 -6
- package/2x/es/components/virtual-input/virtual-input.js +1 -1
- package/2x/es/locales/ru-RU.d.ts +134 -0
- package/2x/es/locales/ru-RU.js +137 -0
- package/2x/package.json +2 -2
- package/bundle/antd-mobile.cjs.development.js +283 -254
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +284 -255
- package/bundle/antd-mobile.es.js +4494 -4468
- package/bundle/antd-mobile.umd.development.js +283 -254
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/style.css +1 -1
- package/cjs/components/calendar/convert.js +1 -6
- package/cjs/components/capsule-tabs/capsule-tabs.js +2 -4
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/checkbox/checkbox.d.ts +2 -0
- package/cjs/components/checkbox/checkbox.js +1 -0
- package/cjs/components/checkbox/index.d.ts +1 -0
- package/cjs/components/collapse/collapse.js +1 -1
- package/cjs/components/date-picker/date-picker-date-utils.js +24 -36
- package/cjs/components/date-picker/date-picker-week-utils.js +12 -18
- package/cjs/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/cjs/components/date-picker-view/date-picker-view.js +8 -2
- package/cjs/components/dropdown/dropdown.js +1 -1
- package/cjs/components/footer/footer.js +17 -21
- package/cjs/components/form/form-subscribe.js +1 -1
- package/cjs/components/image-uploader/image-uploader.js +1 -3
- package/cjs/components/input/input.js +5 -1
- package/cjs/components/jumbo-tabs/jumbo-tabs.js +1 -1
- package/cjs/components/modal/modal.js +11 -13
- package/cjs/components/notice-bar/notice-bar.css +2 -0
- package/cjs/components/popover/popover.js +5 -7
- package/cjs/components/popup/popup.js +3 -3
- package/cjs/components/radio/radio.d.ts +1 -0
- package/cjs/components/radio/radio.js +1 -0
- package/cjs/components/rate/star.d.ts +1 -1
- package/cjs/components/result/result.js +2 -2
- package/cjs/components/safe-area/safe-area.d.ts +1 -1
- package/cjs/components/safe-area/safe-area.js +1 -1
- package/cjs/components/side-bar/side-bar.d.ts +1 -2
- package/cjs/components/side-bar/side-bar.js +4 -2
- package/cjs/components/skeleton/skeleton.d.ts +1 -1
- package/cjs/components/stepper/stepper.js +1 -5
- package/cjs/components/swiper/swiper.js +1 -1
- package/cjs/components/tab-bar/tab-bar.d.ts +1 -2
- package/cjs/components/tab-bar/tab-bar.js +4 -2
- package/cjs/components/tabs/tabs.js +1 -1
- package/cjs/components/text-area/text-area.css +1 -0
- package/cjs/components/tree-select/multiple.js +2 -6
- package/cjs/components/virtual-input/virtual-input.js +1 -1
- package/cjs/locales/ru-RU.d.ts +134 -0
- package/cjs/locales/ru-RU.js +144 -0
- package/es/components/calendar/convert.js +1 -6
- package/es/components/capsule-tabs/capsule-tabs.js +3 -5
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/checkbox/checkbox.d.ts +2 -0
- package/es/components/checkbox/checkbox.js +1 -0
- package/es/components/checkbox/index.d.ts +1 -0
- package/es/components/collapse/collapse.js +2 -2
- package/es/components/date-picker/date-picker-date-utils.js +24 -36
- package/es/components/date-picker/date-picker-week-utils.js +12 -18
- package/es/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/es/components/date-picker-view/date-picker-view.js +8 -2
- package/es/components/dropdown/dropdown.js +2 -2
- package/es/components/footer/footer.js +17 -21
- package/es/components/form/form-subscribe.js +1 -1
- package/es/components/image-uploader/image-uploader.js +1 -3
- package/es/components/input/input.js +5 -1
- package/es/components/jumbo-tabs/jumbo-tabs.js +2 -2
- package/es/components/modal/modal.js +11 -13
- package/es/components/notice-bar/notice-bar.css +2 -0
- package/es/components/popover/popover.js +5 -7
- package/es/components/popup/popup.js +3 -3
- package/es/components/radio/radio.d.ts +1 -0
- package/es/components/radio/radio.js +1 -0
- package/es/components/rate/star.d.ts +1 -1
- package/es/components/result/result.js +2 -2
- package/es/components/safe-area/safe-area.d.ts +1 -1
- package/es/components/safe-area/safe-area.js +1 -1
- package/es/components/side-bar/side-bar.d.ts +1 -2
- package/es/components/side-bar/side-bar.js +2 -2
- package/es/components/skeleton/skeleton.d.ts +1 -1
- package/es/components/stepper/stepper.js +1 -5
- package/es/components/swiper/swiper.js +1 -1
- package/es/components/tab-bar/tab-bar.d.ts +1 -2
- package/es/components/tab-bar/tab-bar.js +2 -2
- package/es/components/tabs/tabs.js +2 -2
- package/es/components/text-area/text-area.css +1 -0
- package/es/components/tree-select/multiple.js +2 -6
- package/es/components/virtual-input/virtual-input.js +1 -1
- package/es/locales/ru-RU.d.ts +134 -0
- package/es/locales/ru-RU.js +137 -0
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -5,6 +5,7 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { generateDatePickerColumns, convertDateToStringArray, convertStringArrayToDate } from '../date-picker/date-picker-utils';
|
|
7
7
|
import useRenderLabel from './useRenderLabel';
|
|
8
|
+
import { TILL_NOW } from '../date-picker/util';
|
|
8
9
|
const thisYear = new Date().getFullYear();
|
|
9
10
|
const defaultProps = {
|
|
10
11
|
min: new Date(new Date().setFullYear(thisYear - 10)),
|
|
@@ -22,7 +23,12 @@ export const DatePickerView = p => {
|
|
|
22
23
|
defaultValue: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null
|
|
23
24
|
});
|
|
24
25
|
const mergedRenderLabel = useRenderLabel(renderLabel);
|
|
25
|
-
const pickerValue = useMemo(() =>
|
|
26
|
+
const pickerValue = useMemo(() => {
|
|
27
|
+
if (value === null || value === void 0 ? void 0 : value.tillNow) {
|
|
28
|
+
return [TILL_NOW, null, null];
|
|
29
|
+
}
|
|
30
|
+
return convertDateToStringArray(value, props.precision);
|
|
31
|
+
}, [value, props.precision]);
|
|
26
32
|
const onChange = useCallback(val => {
|
|
27
33
|
var _a;
|
|
28
34
|
const date = convertStringArrayToDate(val, props.precision);
|
|
@@ -32,7 +38,7 @@ export const DatePickerView = p => {
|
|
|
32
38
|
}
|
|
33
39
|
}, [props.onChange, props.precision]);
|
|
34
40
|
return withNativeProps(props, React.createElement(PickerView, {
|
|
35
|
-
columns: selected => generateDatePickerColumns(selected, props.min, props.max, props.precision, mergedRenderLabel, props.filter),
|
|
41
|
+
columns: selected => generateDatePickerColumns(selected, props.min, props.max, props.precision, mergedRenderLabel, props.filter, props.tillNow),
|
|
36
42
|
loading: props.loading,
|
|
37
43
|
loadingContent: props.loadingContent,
|
|
38
44
|
value: pickerValue,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useClickAway } from 'ahooks';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import React, { cloneElement, useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import React, { cloneElement, useEffect, useRef, useState, forwardRef, useImperativeHandle, isValidElement } from 'react';
|
|
4
4
|
import Popup from '../popup';
|
|
5
5
|
import { ItemChildrenWrap } from './item';
|
|
6
6
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -49,7 +49,7 @@ const Dropdown = forwardRef((p, ref) => {
|
|
|
49
49
|
let popupForceRender = false;
|
|
50
50
|
const items = [];
|
|
51
51
|
const navs = React.Children.map(props.children, child => {
|
|
52
|
-
if (
|
|
52
|
+
if (isValidElement(child)) {
|
|
53
53
|
const childProps = Object.assign(Object.assign({}, child.props), {
|
|
54
54
|
onClick: () => {
|
|
55
55
|
changeActive(child.key);
|
|
@@ -35,29 +35,25 @@ export const Footer = p => {
|
|
|
35
35
|
className: classNames(classPrefix)
|
|
36
36
|
}, label && React.createElement("div", {
|
|
37
37
|
className: `${classPrefix}-label`
|
|
38
|
-
}, React.createElement(Divider, null, label)), links
|
|
38
|
+
}, React.createElement(Divider, null, label)), !!(links === null || links === void 0 ? void 0 : links.length) && React.createElement("div", {
|
|
39
39
|
className: `${classPrefix}-links`
|
|
40
|
-
}, links.map((link, index) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}));
|
|
50
|
-
})), content && React.createElement("div", {
|
|
40
|
+
}, links.map((link, index) => React.createElement(React.Fragment, {
|
|
41
|
+
key: index
|
|
42
|
+
}, React.createElement("a", {
|
|
43
|
+
href: link.href,
|
|
44
|
+
rel: 'noopener noreferrer',
|
|
45
|
+
onClick: event => clickLinkItem(link, index, event)
|
|
46
|
+
}, link.text), index !== links.length - 1 && React.createElement(Divider, {
|
|
47
|
+
direction: 'vertical'
|
|
48
|
+
})))), content && React.createElement("div", {
|
|
51
49
|
className: `${classPrefix}-content`
|
|
52
50
|
}, content), chips && chips.length > 0 && React.createElement("div", {
|
|
53
51
|
className: `${classPrefix}-chips`
|
|
54
|
-
}, chips.map((chip, index) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, chip.text);
|
|
62
|
-
}))));
|
|
52
|
+
}, chips.map((chip, index) => React.createElement("div", {
|
|
53
|
+
key: index,
|
|
54
|
+
onClick: () => clickChipItem(chip, index),
|
|
55
|
+
className: classNames(`${classPrefix}-chip`, {
|
|
56
|
+
[`${classPrefix}-chip-link`]: chip.type === 'link'
|
|
57
|
+
})
|
|
58
|
+
}, chip.text)))));
|
|
63
59
|
};
|
|
@@ -7,7 +7,7 @@ export const FormSubscribe = props => {
|
|
|
7
7
|
const form = useContext(FieldContext);
|
|
8
8
|
const value = form.getFieldsValue(props.to);
|
|
9
9
|
// Memo to avoid useless render
|
|
10
|
-
const childNode = React.useMemo(() => props.children(value, form), [JSON.stringify(value)]);
|
|
10
|
+
const childNode = React.useMemo(() => props.children(value, form), [JSON.stringify(value), props.children]);
|
|
11
11
|
return React.createElement(React.Fragment, null, childNode, props.to.map(namePath => React.createElement(Watcher, {
|
|
12
12
|
key: namePath.toString(),
|
|
13
13
|
form: form,
|
|
@@ -95,9 +95,7 @@ export const ImageUploader = p => {
|
|
|
95
95
|
let files = [].slice.call(rawFiles);
|
|
96
96
|
e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
|
|
97
97
|
if (props.beforeUpload) {
|
|
98
|
-
const postFiles = files.map(file =>
|
|
99
|
-
return processFile(file, files);
|
|
100
|
-
});
|
|
98
|
+
const postFiles = files.map(file => processFile(file, files));
|
|
101
99
|
yield Promise.all(postFiles).then(filesList => {
|
|
102
100
|
files = filesList.filter(Boolean);
|
|
103
101
|
});
|
|
@@ -57,7 +57,11 @@ export const Input = forwardRef((p, ref) => {
|
|
|
57
57
|
function checkValue() {
|
|
58
58
|
let nextValue = value;
|
|
59
59
|
if (props.type === 'number') {
|
|
60
|
-
|
|
60
|
+
const boundValue = nextValue && bound(parseFloat(nextValue), props.min, props.max).toString();
|
|
61
|
+
// fix the display issue of numbers starting with 0
|
|
62
|
+
if (Number(nextValue) !== Number(boundValue)) {
|
|
63
|
+
nextValue = boundValue;
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
if (nextValue !== value) {
|
|
63
67
|
setValue(nextValue);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
1
|
+
import React, { isValidElement, useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { animated } from '@react-spring/web';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -20,7 +20,7 @@ export const JumboTabs = props => {
|
|
|
20
20
|
let firstActiveKey = null;
|
|
21
21
|
const panes = [];
|
|
22
22
|
traverseReactNode(props.children, (child, index) => {
|
|
23
|
-
if (!
|
|
23
|
+
if (!isValidElement(child)) return;
|
|
24
24
|
const key = child.key;
|
|
25
25
|
if (typeof key !== 'string') return;
|
|
26
26
|
if (index === 0) {
|
|
@@ -31,19 +31,17 @@ export const Modal = p => {
|
|
|
31
31
|
direction: 'vertical',
|
|
32
32
|
block: true,
|
|
33
33
|
className: classNames(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
|
|
34
|
-
}, props.actions.map((action, index) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
})));
|
|
34
|
+
}, props.actions.map((action, index) => React.createElement(ModalActionButton, {
|
|
35
|
+
key: action.key,
|
|
36
|
+
action: action,
|
|
37
|
+
onAction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
yield Promise.all([(_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action), (_b = props.onAction) === null || _b === void 0 ? void 0 : _b.call(props, action, index)]);
|
|
40
|
+
if (props.closeOnAction) {
|
|
41
|
+
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
}))));
|
|
47
45
|
return React.createElement(CenterPopup, {
|
|
48
46
|
className: classNames(cls(), props.className),
|
|
49
47
|
style: props.style,
|
|
@@ -31,13 +31,11 @@ export const Popover = forwardRef((p, ref) => {
|
|
|
31
31
|
defaultValue: props.defaultVisible,
|
|
32
32
|
onChange: props.onVisibleChange
|
|
33
33
|
});
|
|
34
|
-
useImperativeHandle(ref, () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
}, [visible]);
|
|
34
|
+
useImperativeHandle(ref, () => ({
|
|
35
|
+
show: () => setVisible(true),
|
|
36
|
+
hide: () => setVisible(false),
|
|
37
|
+
visible
|
|
38
|
+
}), [visible]);
|
|
41
39
|
const targetRef = useRef(null);
|
|
42
40
|
const floatingRef = useRef(null);
|
|
43
41
|
const arrowRef = useRef(null);
|
|
@@ -21,18 +21,18 @@ const defaultProps = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
|
21
21
|
});
|
|
22
22
|
export const Popup = p => {
|
|
23
23
|
const props = mergeProps(defaultProps, p);
|
|
24
|
+
const bodyCls = classNames(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
24
25
|
const {
|
|
25
26
|
locale
|
|
26
27
|
} = useConfig();
|
|
27
|
-
const bodyCls = classNames(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
28
28
|
const [active, setActive] = useState(props.visible);
|
|
29
|
+
const ref = useRef(null);
|
|
30
|
+
useLockScroll(ref, props.disableBodyScroll && active ? 'strict' : false);
|
|
29
31
|
useIsomorphicLayoutEffect(() => {
|
|
30
32
|
if (props.visible) {
|
|
31
33
|
setActive(true);
|
|
32
34
|
}
|
|
33
35
|
}, [props.visible]);
|
|
34
|
-
const ref = useRef(null);
|
|
35
|
-
useLockScroll(ref, props.disableBodyScroll && active ? 'strict' : false);
|
|
36
36
|
const unmountedRef = useUnmountedRef();
|
|
37
37
|
const {
|
|
38
38
|
percent
|
|
@@ -11,5 +11,6 @@ export declare type RadioProps = {
|
|
|
11
11
|
id?: string;
|
|
12
12
|
icon?: (checked: boolean) => React.ReactNode;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
|
+
onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
|
|
14
15
|
} & NativeProps<'--icon-size' | '--font-size' | '--gap'>;
|
|
15
16
|
export declare const Radio: FC<RadioProps>;
|
|
@@ -56,6 +56,7 @@ export const Radio = p => {
|
|
|
56
56
|
}, checked && React.createElement(CheckIcon, null));
|
|
57
57
|
};
|
|
58
58
|
return withNativeProps(props, React.createElement("label", {
|
|
59
|
+
onClick: props.onClick,
|
|
59
60
|
className: classNames(classPrefix, {
|
|
60
61
|
[`${classPrefix}-checked`]: checked,
|
|
61
62
|
[`${classPrefix}-disabled`]: disabled,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import type { FC } from 'react';
|
|
2
2
|
export declare const Star: FC;
|
|
@@ -30,7 +30,7 @@ export const Result = p => {
|
|
|
30
30
|
className: `${classPrefix}-icon`
|
|
31
31
|
}, resultIcon), React.createElement("div", {
|
|
32
32
|
className: `${classPrefix}-title`
|
|
33
|
-
}, title), description
|
|
33
|
+
}, title), !!description && React.createElement("div", {
|
|
34
34
|
className: `${classPrefix}-description`
|
|
35
|
-
}, description)
|
|
35
|
+
}, description)));
|
|
36
36
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { isValidElement } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import Badge from '../badge';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -15,7 +15,7 @@ export const SideBar = props => {
|
|
|
15
15
|
let firstActiveKey = null;
|
|
16
16
|
const items = [];
|
|
17
17
|
traverseReactNode(props.children, (child, index) => {
|
|
18
|
-
if (!
|
|
18
|
+
if (!isValidElement(child)) return;
|
|
19
19
|
const key = child.key;
|
|
20
20
|
if (typeof key !== 'string') return;
|
|
21
21
|
if (index === 0) {
|
|
@@ -64,11 +64,7 @@ export function InnerStepper(p, ref) {
|
|
|
64
64
|
};
|
|
65
65
|
const formatValue = value => {
|
|
66
66
|
if (value === null) return '';
|
|
67
|
-
|
|
68
|
-
return formatter(value);
|
|
69
|
-
} else {
|
|
70
|
-
return fixedValue(value);
|
|
71
|
-
}
|
|
67
|
+
return formatter ? formatter(value) : fixedValue(value);
|
|
72
68
|
};
|
|
73
69
|
// ======================== Value & InputValue ========================
|
|
74
70
|
const [mergedValue, setMergedValue] = useMergedState(defaultValue, {
|
|
@@ -172,10 +172,10 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
172
172
|
var _a;
|
|
173
173
|
const roundedIndex = Math.round(index);
|
|
174
174
|
const targetIndex = loop ? modulus(roundedIndex, count) : bound(roundedIndex, 0, count - 1);
|
|
175
|
-
setCurrent(targetIndex);
|
|
176
175
|
if (targetIndex !== getCurrent()) {
|
|
177
176
|
(_a = props.onIndexChange) === null || _a === void 0 ? void 0 : _a.call(props, targetIndex);
|
|
178
177
|
}
|
|
178
|
+
setCurrent(targetIndex);
|
|
179
179
|
api.start({
|
|
180
180
|
position: (loop ? roundedIndex : boundIndex(roundedIndex)) * 100,
|
|
181
181
|
immediate
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { isValidElement } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { withNativeProps } from '../../utils/native-props';
|
|
4
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
@@ -20,7 +20,7 @@ export const TabBar = p => {
|
|
|
20
20
|
let firstActiveKey = null;
|
|
21
21
|
const items = [];
|
|
22
22
|
traverseReactNode(props.children, (child, index) => {
|
|
23
|
-
if (!
|
|
23
|
+
if (!isValidElement(child)) return;
|
|
24
24
|
const key = child.key;
|
|
25
25
|
if (typeof key !== 'string') return;
|
|
26
26
|
if (index === 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
1
|
+
import React, { isValidElement, useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useSpring, animated } from '@react-spring/web';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -28,7 +28,7 @@ export const Tabs = p => {
|
|
|
28
28
|
let firstActiveKey = null;
|
|
29
29
|
const panes = [];
|
|
30
30
|
traverseReactNode(props.children, (child, index) => {
|
|
31
|
-
if (!
|
|
31
|
+
if (!isValidElement(child)) return;
|
|
32
32
|
const key = child.key;
|
|
33
33
|
if (typeof key !== 'string') return;
|
|
34
34
|
if (index === 0) {
|
|
@@ -224,13 +224,9 @@ export const Multiple = p => {
|
|
|
224
224
|
}
|
|
225
225
|
const isLeaf = deep === index + 1;
|
|
226
226
|
if (isLeaf) {
|
|
227
|
-
return React.createElement(React.Fragment, null, renderSelectAllLeafItem(columnOptions, index), columnOptions.map(option =>
|
|
228
|
-
return renderLeafItem(option);
|
|
229
|
-
}));
|
|
227
|
+
return React.createElement(React.Fragment, null, renderSelectAllLeafItem(columnOptions, index), columnOptions.map(option => renderLeafItem(option)));
|
|
230
228
|
}
|
|
231
|
-
return React.createElement(React.Fragment, null, renderSelectAllItem(columnOptions, index), columnOptions.map(option =>
|
|
232
|
-
return renderItem(option);
|
|
233
|
-
}));
|
|
229
|
+
return React.createElement(React.Fragment, null, renderSelectAllItem(columnOptions, index), columnOptions.map(option => renderItem(option)));
|
|
234
230
|
};
|
|
235
231
|
const renderColumns = () => {
|
|
236
232
|
var _a;
|
|
@@ -106,7 +106,7 @@ export const VirtualInput = forwardRef((p, ref) => {
|
|
|
106
106
|
},
|
|
107
107
|
role: 'button',
|
|
108
108
|
"aria-label": locale.Input.clear
|
|
109
|
-
}, React.createElement(CloseCircleFill, null)),
|
|
109
|
+
}, React.createElement(CloseCircleFill, null)), [undefined, null, ''].includes(value) && React.createElement("div", {
|
|
110
110
|
className: `${classPrefix}-placeholder`
|
|
111
111
|
}, props.placeholder), keyboardElement));
|
|
112
112
|
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
declare const ruRU: {
|
|
2
|
+
locale: string;
|
|
3
|
+
common: {
|
|
4
|
+
confirm: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
loading: string;
|
|
7
|
+
close: string;
|
|
8
|
+
};
|
|
9
|
+
Calendar: {
|
|
10
|
+
markItems: string[];
|
|
11
|
+
renderYearAndMonth: (year: number, month: number) => string;
|
|
12
|
+
};
|
|
13
|
+
Cascader: {
|
|
14
|
+
placeholder: string;
|
|
15
|
+
};
|
|
16
|
+
Dialog: {
|
|
17
|
+
ok: string;
|
|
18
|
+
};
|
|
19
|
+
DatePicker: {
|
|
20
|
+
tillNow: string;
|
|
21
|
+
};
|
|
22
|
+
ErrorBlock: {
|
|
23
|
+
default: {
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
busy: {
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
disconnected: {
|
|
32
|
+
title: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
empty: {
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
Form: {
|
|
41
|
+
required: string;
|
|
42
|
+
optional: string;
|
|
43
|
+
defaultValidateMessages: {
|
|
44
|
+
default: string;
|
|
45
|
+
required: string;
|
|
46
|
+
enum: string;
|
|
47
|
+
whitespace: string;
|
|
48
|
+
date: {
|
|
49
|
+
format: string;
|
|
50
|
+
parse: string;
|
|
51
|
+
invalid: string;
|
|
52
|
+
};
|
|
53
|
+
types: {
|
|
54
|
+
string: string;
|
|
55
|
+
method: string;
|
|
56
|
+
array: string;
|
|
57
|
+
object: string;
|
|
58
|
+
number: string;
|
|
59
|
+
date: string;
|
|
60
|
+
boolean: string;
|
|
61
|
+
integer: string;
|
|
62
|
+
float: string;
|
|
63
|
+
regexp: string;
|
|
64
|
+
email: string;
|
|
65
|
+
url: string;
|
|
66
|
+
hex: string;
|
|
67
|
+
};
|
|
68
|
+
string: {
|
|
69
|
+
len: string;
|
|
70
|
+
min: string;
|
|
71
|
+
max: string;
|
|
72
|
+
range: string;
|
|
73
|
+
};
|
|
74
|
+
number: {
|
|
75
|
+
len: string;
|
|
76
|
+
min: string;
|
|
77
|
+
max: string;
|
|
78
|
+
range: string;
|
|
79
|
+
};
|
|
80
|
+
array: {
|
|
81
|
+
len: string;
|
|
82
|
+
min: string;
|
|
83
|
+
max: string;
|
|
84
|
+
range: string;
|
|
85
|
+
};
|
|
86
|
+
pattern: {
|
|
87
|
+
mismatch: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
ImageUploader: {
|
|
92
|
+
uploading: string;
|
|
93
|
+
upload: string;
|
|
94
|
+
};
|
|
95
|
+
InfiniteScroll: {
|
|
96
|
+
noMore: string;
|
|
97
|
+
failedToLoad: string;
|
|
98
|
+
retry: string;
|
|
99
|
+
};
|
|
100
|
+
Input: {
|
|
101
|
+
clear: string;
|
|
102
|
+
};
|
|
103
|
+
Mask: {
|
|
104
|
+
name: string;
|
|
105
|
+
};
|
|
106
|
+
Modal: {
|
|
107
|
+
ok: string;
|
|
108
|
+
};
|
|
109
|
+
PasscodeInput: {
|
|
110
|
+
name: string;
|
|
111
|
+
};
|
|
112
|
+
PullToRefresh: {
|
|
113
|
+
pulling: string;
|
|
114
|
+
canRelease: string;
|
|
115
|
+
complete: string;
|
|
116
|
+
};
|
|
117
|
+
SearchBar: {
|
|
118
|
+
name: string;
|
|
119
|
+
};
|
|
120
|
+
Slider: {
|
|
121
|
+
name: string;
|
|
122
|
+
};
|
|
123
|
+
Stepper: {
|
|
124
|
+
decrease: string;
|
|
125
|
+
increase: string;
|
|
126
|
+
};
|
|
127
|
+
Switch: {
|
|
128
|
+
name: string;
|
|
129
|
+
};
|
|
130
|
+
Selector: {
|
|
131
|
+
name: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export default ruRU;
|