antd-mobile 5.31.1 → 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 +281 -252
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +282 -253
- package/2x/bundle/antd-mobile.es.js +4494 -4468
- package/2x/bundle/antd-mobile.umd.development.js +281 -252
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +1 -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/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/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/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/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/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/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 +281 -252
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +282 -253
- package/bundle/antd-mobile.es.js +4494 -4468
- package/bundle/antd-mobile.umd.development.js +281 -252
- 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/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/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/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/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/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/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
|
@@ -58,34 +58,28 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
58
58
|
const lower = minYear;
|
|
59
59
|
const upper = maxYear;
|
|
60
60
|
const years = generateColumn(lower, upper, 'year');
|
|
61
|
-
ret.push(years.map(v => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
};
|
|
66
|
-
}));
|
|
61
|
+
ret.push(years.map(v => ({
|
|
62
|
+
label: renderLabel('year', v),
|
|
63
|
+
value: v.toString()
|
|
64
|
+
})));
|
|
67
65
|
}
|
|
68
66
|
if (rank >= precisionRankRecord.week) {
|
|
69
67
|
const lower = isInMinYear ? minWeek : 1;
|
|
70
68
|
const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
|
|
71
69
|
const weeks = generateColumn(lower, upper, 'week');
|
|
72
|
-
ret.push(weeks.map(v => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
-
}));
|
|
70
|
+
ret.push(weeks.map(v => ({
|
|
71
|
+
label: renderLabel('week', v),
|
|
72
|
+
value: v.toString()
|
|
73
|
+
})));
|
|
78
74
|
}
|
|
79
75
|
if (rank >= precisionRankRecord['week-day']) {
|
|
80
76
|
const lower = isInMinWeek ? minWeekday : 1;
|
|
81
77
|
const upper = isInMaxWeek ? maxWeekday : 7;
|
|
82
78
|
const weeks = generateColumn(lower, upper, 'week-day');
|
|
83
|
-
ret.push(weeks.map(v => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};
|
|
88
|
-
}));
|
|
79
|
+
ret.push(weeks.map(v => ({
|
|
80
|
+
label: renderLabel('week-day', v),
|
|
81
|
+
value: v.toString()
|
|
82
|
+
})));
|
|
89
83
|
}
|
|
90
84
|
return ret;
|
|
91
85
|
}
|
|
@@ -2,15 +2,17 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { PickerViewProps } from '../picker-view';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from '../date-picker/date-picker-utils';
|
|
5
|
+
import type { PickerDate } from '../date-picker/util';
|
|
5
6
|
export declare type RenderLabel = (type: Precision | 'now', data: number) => ReactNode;
|
|
6
7
|
export declare type DatePickerViewProps = Pick<PickerViewProps, 'style' | 'mouseWheel' | 'loading' | 'loadingContent'> & {
|
|
7
|
-
value?:
|
|
8
|
-
defaultValue?:
|
|
9
|
-
onChange?: (value:
|
|
10
|
-
min?:
|
|
11
|
-
max?:
|
|
8
|
+
value?: PickerDate;
|
|
9
|
+
defaultValue?: PickerDate;
|
|
10
|
+
onChange?: (value: PickerDate) => void;
|
|
11
|
+
min?: PickerDate;
|
|
12
|
+
max?: PickerDate;
|
|
12
13
|
precision?: Precision;
|
|
13
14
|
renderLabel?: RenderLabel;
|
|
14
15
|
filter?: DatePickerFilter;
|
|
16
|
+
tillNow?: boolean;
|
|
15
17
|
} & NativeProps;
|
|
16
18
|
export declare const DatePickerView: FC<DatePickerViewProps>;
|
|
@@ -11,6 +11,7 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
11
11
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
12
12
|
var _datePickerUtils = require("../date-picker/date-picker-utils");
|
|
13
13
|
var _useRenderLabel = _interopRequireDefault(require("./useRenderLabel"));
|
|
14
|
+
var _util = require("../date-picker/util");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
16
|
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); }
|
|
16
17
|
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; }
|
|
@@ -31,7 +32,12 @@ const DatePickerView = p => {
|
|
|
31
32
|
defaultValue: (_a = props.defaultValue) !== null && _a !== void 0 ? _a : null
|
|
32
33
|
});
|
|
33
34
|
const mergedRenderLabel = (0, _useRenderLabel.default)(renderLabel);
|
|
34
|
-
const pickerValue = (0, _react.useMemo)(() =>
|
|
35
|
+
const pickerValue = (0, _react.useMemo)(() => {
|
|
36
|
+
if (value === null || value === void 0 ? void 0 : value.tillNow) {
|
|
37
|
+
return [_util.TILL_NOW, null, null];
|
|
38
|
+
}
|
|
39
|
+
return (0, _datePickerUtils.convertDateToStringArray)(value, props.precision);
|
|
40
|
+
}, [value, props.precision]);
|
|
35
41
|
const onChange = (0, _react.useCallback)(val => {
|
|
36
42
|
var _a;
|
|
37
43
|
const date = (0, _datePickerUtils.convertStringArrayToDate)(val, props.precision);
|
|
@@ -41,7 +47,7 @@ const DatePickerView = p => {
|
|
|
41
47
|
}
|
|
42
48
|
}, [props.onChange, props.precision]);
|
|
43
49
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement(_pickerView.default, {
|
|
44
|
-
columns: selected => (0, _datePickerUtils.generateDatePickerColumns)(selected, props.min, props.max, props.precision, mergedRenderLabel, props.filter),
|
|
50
|
+
columns: selected => (0, _datePickerUtils.generateDatePickerColumns)(selected, props.min, props.max, props.precision, mergedRenderLabel, props.filter, props.tillNow),
|
|
45
51
|
loading: props.loading,
|
|
46
52
|
loadingContent: props.loadingContent,
|
|
47
53
|
value: pickerValue,
|
|
@@ -58,7 +58,7 @@ const Dropdown = (0, _react.forwardRef)((p, ref) => {
|
|
|
58
58
|
let popupForceRender = false;
|
|
59
59
|
const items = [];
|
|
60
60
|
const navs = _react.default.Children.map(props.children, child => {
|
|
61
|
-
if (_react.
|
|
61
|
+
if ((0, _react.isValidElement)(child)) {
|
|
62
62
|
const childProps = Object.assign(Object.assign({}, child.props), {
|
|
63
63
|
onClick: () => {
|
|
64
64
|
changeActive(child.key);
|
|
@@ -42,30 +42,26 @@ const Footer = p => {
|
|
|
42
42
|
className: (0, _classnames.default)(classPrefix)
|
|
43
43
|
}, label && _react.default.createElement("div", {
|
|
44
44
|
className: `${classPrefix}-label`
|
|
45
|
-
}, _react.default.createElement(_divider.default, null, label)), links
|
|
45
|
+
}, _react.default.createElement(_divider.default, null, label)), !!(links === null || links === void 0 ? void 0 : links.length) && _react.default.createElement("div", {
|
|
46
46
|
className: `${classPrefix}-links`
|
|
47
|
-
}, links.map((link, index) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}));
|
|
57
|
-
})), content && _react.default.createElement("div", {
|
|
47
|
+
}, links.map((link, index) => _react.default.createElement(_react.default.Fragment, {
|
|
48
|
+
key: index
|
|
49
|
+
}, _react.default.createElement("a", {
|
|
50
|
+
href: link.href,
|
|
51
|
+
rel: 'noopener noreferrer',
|
|
52
|
+
onClick: event => clickLinkItem(link, index, event)
|
|
53
|
+
}, link.text), index !== links.length - 1 && _react.default.createElement(_divider.default, {
|
|
54
|
+
direction: 'vertical'
|
|
55
|
+
})))), content && _react.default.createElement("div", {
|
|
58
56
|
className: `${classPrefix}-content`
|
|
59
57
|
}, content), chips && chips.length > 0 && _react.default.createElement("div", {
|
|
60
58
|
className: `${classPrefix}-chips`
|
|
61
|
-
}, chips.map((chip, index) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}, chip.text);
|
|
69
|
-
}))));
|
|
59
|
+
}, chips.map((chip, index) => _react.default.createElement("div", {
|
|
60
|
+
key: index,
|
|
61
|
+
onClick: () => clickChipItem(chip, index),
|
|
62
|
+
className: (0, _classnames.default)(`${classPrefix}-chip`, {
|
|
63
|
+
[`${classPrefix}-chip-link`]: chip.type === 'link'
|
|
64
|
+
})
|
|
65
|
+
}, chip.text)))));
|
|
70
66
|
};
|
|
71
67
|
exports.Footer = Footer;
|
|
@@ -104,9 +104,7 @@ const ImageUploader = p => {
|
|
|
104
104
|
let files = [].slice.call(rawFiles);
|
|
105
105
|
e.target.value = ''; // HACK: fix the same file doesn't trigger onChange
|
|
106
106
|
if (props.beforeUpload) {
|
|
107
|
-
const postFiles = files.map(file =>
|
|
108
|
-
return processFile(file, files);
|
|
109
|
-
});
|
|
107
|
+
const postFiles = files.map(file => processFile(file, files));
|
|
110
108
|
yield Promise.all(postFiles).then(filesList => {
|
|
111
109
|
files = filesList.filter(Boolean);
|
|
112
110
|
});
|
|
@@ -66,7 +66,11 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
66
66
|
function checkValue() {
|
|
67
67
|
let nextValue = value;
|
|
68
68
|
if (props.type === 'number') {
|
|
69
|
-
|
|
69
|
+
const boundValue = nextValue && (0, _bound.bound)(parseFloat(nextValue), props.min, props.max).toString();
|
|
70
|
+
// fix the display issue of numbers starting with 0
|
|
71
|
+
if (Number(nextValue) !== Number(boundValue)) {
|
|
72
|
+
nextValue = boundValue;
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
if (nextValue !== value) {
|
|
72
76
|
setValue(nextValue);
|
|
@@ -30,7 +30,7 @@ const JumboTabs = props => {
|
|
|
30
30
|
let firstActiveKey = null;
|
|
31
31
|
const panes = [];
|
|
32
32
|
(0, _traverseReactNode.traverseReactNode)(props.children, (child, index) => {
|
|
33
|
-
if (!_react.
|
|
33
|
+
if (!(0, _react.isValidElement)(child)) return;
|
|
34
34
|
const key = child.key;
|
|
35
35
|
if (typeof key !== 'string') return;
|
|
36
36
|
if (index === 0) {
|
|
@@ -38,19 +38,17 @@ const Modal = p => {
|
|
|
38
38
|
direction: 'vertical',
|
|
39
39
|
block: true,
|
|
40
40
|
className: (0, _classnames.default)(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
|
|
41
|
-
}, props.actions.map((action, index) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
53
|
-
})));
|
|
41
|
+
}, props.actions.map((action, index) => _react.default.createElement(_modalActionButton.ModalActionButton, {
|
|
42
|
+
key: action.key,
|
|
43
|
+
action: action,
|
|
44
|
+
onAction: () => (0, _tslib.__awaiter)(void 0, void 0, void 0, function* () {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
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)]);
|
|
47
|
+
if (props.closeOnAction) {
|
|
48
|
+
(_c = props.onClose) === null || _c === void 0 ? void 0 : _c.call(props);
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}))));
|
|
54
52
|
return _react.default.createElement(_centerPopup.default, {
|
|
55
53
|
className: (0, _classnames.default)(cls(), props.className),
|
|
56
54
|
style: props.style,
|
|
@@ -40,13 +40,11 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
|
40
40
|
defaultValue: props.defaultVisible,
|
|
41
41
|
onChange: props.onVisibleChange
|
|
42
42
|
});
|
|
43
|
-
(0, _react.useImperativeHandle)(ref, () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
}, [visible]);
|
|
43
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
44
|
+
show: () => setVisible(true),
|
|
45
|
+
hide: () => setVisible(false),
|
|
46
|
+
visible
|
|
47
|
+
}), [visible]);
|
|
50
48
|
const targetRef = (0, _react.useRef)(null);
|
|
51
49
|
const floatingRef = (0, _react.useRef)(null);
|
|
52
50
|
const arrowRef = (0, _react.useRef)(null);
|
|
@@ -30,18 +30,18 @@ const defaultProps = Object.assign(Object.assign({}, _popupBaseProps.defaultPopu
|
|
|
30
30
|
});
|
|
31
31
|
const Popup = p => {
|
|
32
32
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
33
|
+
const bodyCls = (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
33
34
|
const {
|
|
34
35
|
locale
|
|
35
36
|
} = (0, _configProvider.useConfig)();
|
|
36
|
-
const bodyCls = (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
37
37
|
const [active, setActive] = (0, _react.useState)(props.visible);
|
|
38
|
+
const ref = (0, _react.useRef)(null);
|
|
39
|
+
(0, _useLockScroll.useLockScroll)(ref, props.disableBodyScroll && active ? 'strict' : false);
|
|
38
40
|
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
39
41
|
if (props.visible) {
|
|
40
42
|
setActive(true);
|
|
41
43
|
}
|
|
42
44
|
}, [props.visible]);
|
|
43
|
-
const ref = (0, _react.useRef)(null);
|
|
44
|
-
(0, _useLockScroll.useLockScroll)(ref, props.disableBodyScroll && active ? 'strict' : false);
|
|
45
45
|
const unmountedRef = (0, _ahooks.useUnmountedRef)();
|
|
46
46
|
const {
|
|
47
47
|
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>;
|
|
@@ -65,6 +65,7 @@ const Radio = p => {
|
|
|
65
65
|
}, checked && _react.default.createElement(_checkIcon.CheckIcon, null));
|
|
66
66
|
};
|
|
67
67
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("label", {
|
|
68
|
+
onClick: props.onClick,
|
|
68
69
|
className: (0, _classnames.default)(classPrefix, {
|
|
69
70
|
[`${classPrefix}-checked`]: checked,
|
|
70
71
|
[`${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;
|
|
@@ -37,8 +37,8 @@ const Result = p => {
|
|
|
37
37
|
className: `${classPrefix}-icon`
|
|
38
38
|
}, resultIcon), _react.default.createElement("div", {
|
|
39
39
|
className: `${classPrefix}-title`
|
|
40
|
-
}, title), description
|
|
40
|
+
}, title), !!description && _react.default.createElement("div", {
|
|
41
41
|
className: `${classPrefix}-description`
|
|
42
|
-
}, description)
|
|
42
|
+
}, description)));
|
|
43
43
|
};
|
|
44
44
|
exports.Result = Result;
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SafeArea = void 0;
|
|
7
|
-
var _nativeProps = require("../../utils/native-props");
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _nativeProps = require("../../utils/native-props");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const classPrefix = 'adm-safe-area';
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SideBarItem = exports.SideBar = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _badge = _interopRequireDefault(require("../badge"));
|
|
10
10
|
var _nativeProps = require("../../utils/native-props");
|
|
@@ -12,6 +12,8 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
12
12
|
var _corner = require("./corner");
|
|
13
13
|
var _traverseReactNode = require("../../utils/traverse-react-node");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
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); }
|
|
16
|
+
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
17
|
const classPrefix = `adm-side-bar`;
|
|
16
18
|
/* istanbul ignore next */
|
|
17
19
|
const SideBarItem = () => {
|
|
@@ -23,7 +25,7 @@ const SideBar = props => {
|
|
|
23
25
|
let firstActiveKey = null;
|
|
24
26
|
const items = [];
|
|
25
27
|
(0, _traverseReactNode.traverseReactNode)(props.children, (child, index) => {
|
|
26
|
-
if (!_react.
|
|
28
|
+
if (!(0, _react.isValidElement)(child)) return;
|
|
27
29
|
const key = child.key;
|
|
28
30
|
if (typeof key !== 'string') return;
|
|
29
31
|
if (index === 0) {
|
|
@@ -74,11 +74,7 @@ function InnerStepper(p, ref) {
|
|
|
74
74
|
};
|
|
75
75
|
const formatValue = value => {
|
|
76
76
|
if (value === null) return '';
|
|
77
|
-
|
|
78
|
-
return formatter(value);
|
|
79
|
-
} else {
|
|
80
|
-
return fixedValue(value);
|
|
81
|
-
}
|
|
77
|
+
return formatter ? formatter(value) : fixedValue(value);
|
|
82
78
|
};
|
|
83
79
|
// ======================== Value & InputValue ========================
|
|
84
80
|
const [mergedValue, setMergedValue] = (0, _useMergedState.default)(defaultValue, {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TabBarItem = exports.TabBar = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _nativeProps = require("../../utils/native-props");
|
|
10
10
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
@@ -13,6 +13,8 @@ var _safeArea = _interopRequireDefault(require("../safe-area"));
|
|
|
13
13
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
14
14
|
var _traverseReactNode = require("../../utils/traverse-react-node");
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
16
18
|
/* istanbul ignore next */
|
|
17
19
|
const TabBarItem = () => {
|
|
18
20
|
return null;
|
|
@@ -28,7 +30,7 @@ const TabBar = p => {
|
|
|
28
30
|
let firstActiveKey = null;
|
|
29
31
|
const items = [];
|
|
30
32
|
(0, _traverseReactNode.traverseReactNode)(props.children, (child, index) => {
|
|
31
|
-
if (!_react.
|
|
33
|
+
if (!(0, _react.isValidElement)(child)) return;
|
|
32
34
|
const key = child.key;
|
|
33
35
|
if (typeof key !== 'string') return;
|
|
34
36
|
if (index === 0) {
|
|
@@ -38,7 +38,7 @@ const Tabs = p => {
|
|
|
38
38
|
let firstActiveKey = null;
|
|
39
39
|
const panes = [];
|
|
40
40
|
(0, _traverseReactNode.traverseReactNode)(props.children, (child, index) => {
|
|
41
|
-
if (!_react.
|
|
41
|
+
if (!(0, _react.isValidElement)(child)) return;
|
|
42
42
|
const key = child.key;
|
|
43
43
|
if (typeof key !== 'string') return;
|
|
44
44
|
if (index === 0) {
|
|
@@ -233,13 +233,9 @@ const Multiple = p => {
|
|
|
233
233
|
}
|
|
234
234
|
const isLeaf = deep === index + 1;
|
|
235
235
|
if (isLeaf) {
|
|
236
|
-
return _react.default.createElement(_react.default.Fragment, null, renderSelectAllLeafItem(columnOptions, index), columnOptions.map(option =>
|
|
237
|
-
return renderLeafItem(option);
|
|
238
|
-
}));
|
|
236
|
+
return _react.default.createElement(_react.default.Fragment, null, renderSelectAllLeafItem(columnOptions, index), columnOptions.map(option => renderLeafItem(option)));
|
|
239
237
|
}
|
|
240
|
-
return _react.default.createElement(_react.default.Fragment, null, renderSelectAllItem(columnOptions, index), columnOptions.map(option =>
|
|
241
|
-
return renderItem(option);
|
|
242
|
-
}));
|
|
238
|
+
return _react.default.createElement(_react.default.Fragment, null, renderSelectAllItem(columnOptions, index), columnOptions.map(option => renderItem(option)));
|
|
243
239
|
};
|
|
244
240
|
const renderColumns = () => {
|
|
245
241
|
var _a;
|
|
@@ -115,7 +115,7 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
115
115
|
},
|
|
116
116
|
role: 'button',
|
|
117
117
|
"aria-label": locale.Input.clear
|
|
118
|
-
}, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null)),
|
|
118
|
+
}, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null)), [undefined, null, ''].includes(value) && _react.default.createElement("div", {
|
|
119
119
|
className: `${classPrefix}-placeholder`
|
|
120
120
|
}, props.placeholder), keyboardElement));
|
|
121
121
|
});
|
|
@@ -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;
|