antd-mobile 5.6.1 → 5.7.2
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/calendar/calendar.d.ts +4 -3
- package/2x/cjs/components/calendar/calendar.js +67 -56
- package/2x/cjs/components/calendar/convert.d.ts +2 -0
- package/2x/cjs/components/calendar/convert.js +22 -0
- package/2x/cjs/components/collapse/collapse.js +7 -0
- package/2x/cjs/components/dialog/confirm.js +9 -1
- package/2x/cjs/components/form/form-item.js +6 -3
- package/2x/cjs/components/modal/confirm.js +9 -1
- package/2x/cjs/components/passcode-input/passcode-input.js +1 -1
- package/2x/cjs/components/picker/picker.js +6 -9
- package/2x/cjs/components/picker-view/columns-extend.d.ts +3 -0
- package/2x/cjs/components/picker-view/columns-extend.js +45 -0
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/2x/cjs/components/picker-view/picker-view.js +14 -16
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +11 -1
- package/2x/cjs/components/result/result.d.ts +2 -2
- package/2x/cjs/components/virtual-input/virtual-input.js +25 -14
- package/2x/cjs/locales/base.d.ts +6 -0
- package/2x/cjs/locales/base.js +7 -1
- package/2x/cjs/locales/en-US.d.ts +6 -0
- package/2x/cjs/locales/fa-IR.d.ts +101 -0
- package/2x/cjs/locales/fa-IR.js +108 -0
- package/2x/cjs/locales/zh-CN.d.ts +6 -0
- package/2x/cjs/locales/zh-CN.js +7 -1
- package/2x/cjs/locales/zh-HK.d.ts +101 -0
- package/2x/cjs/locales/zh-HK.js +58 -0
- package/2x/cjs/locales/zh-TW.d.ts +101 -0
- package/2x/cjs/locales/zh-TW.js +58 -0
- package/2x/cjs/utils/with-cache.d.ts +1 -0
- package/2x/cjs/utils/with-cache.js +17 -0
- package/2x/es/components/calendar/calendar.d.ts +4 -3
- package/2x/es/components/calendar/calendar.js +67 -58
- package/2x/es/components/calendar/convert.d.ts +2 -0
- package/2x/es/components/calendar/convert.js +15 -0
- package/2x/es/components/collapse/collapse.js +7 -0
- package/2x/es/components/dialog/confirm.js +8 -1
- package/2x/es/components/form/form-item.js +6 -3
- package/2x/es/components/modal/confirm.js +8 -1
- package/2x/es/components/passcode-input/passcode-input.js +1 -1
- package/2x/es/components/picker/picker.js +6 -8
- package/2x/es/components/picker-view/columns-extend.d.ts +3 -0
- package/2x/es/components/picker-view/columns-extend.js +34 -0
- package/2x/es/components/picker-view/picker-view.d.ts +1 -0
- package/2x/es/components/picker-view/picker-view.js +14 -15
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +10 -1
- package/2x/es/components/result/result.d.ts +2 -2
- package/2x/es/components/virtual-input/virtual-input.js +23 -14
- package/2x/es/locales/base.d.ts +6 -0
- package/2x/es/locales/base.js +7 -1
- package/2x/es/locales/en-US.d.ts +6 -0
- package/2x/es/locales/fa-IR.d.ts +101 -0
- package/2x/es/locales/fa-IR.js +98 -0
- package/2x/es/locales/zh-CN.d.ts +6 -0
- package/2x/es/locales/zh-CN.js +7 -1
- package/2x/es/locales/zh-HK.d.ts +101 -0
- package/2x/es/locales/zh-HK.js +48 -0
- package/2x/es/locales/zh-TW.d.ts +101 -0
- package/2x/es/locales/zh-TW.js +48 -0
- package/2x/es/utils/with-cache.d.ts +1 -0
- package/2x/es/utils/with-cache.js +10 -0
- package/2x/package.json +1 -1
- package/cjs/components/calendar/calendar.d.ts +4 -3
- package/cjs/components/calendar/calendar.js +67 -56
- package/cjs/components/calendar/convert.d.ts +2 -0
- package/cjs/components/calendar/convert.js +22 -0
- package/cjs/components/collapse/collapse.js +7 -0
- package/cjs/components/dialog/confirm.js +9 -1
- package/cjs/components/form/form-item.js +6 -3
- package/cjs/components/modal/confirm.js +9 -1
- package/cjs/components/passcode-input/passcode-input.js +1 -1
- package/cjs/components/picker/picker.js +6 -9
- package/cjs/components/picker-view/columns-extend.d.ts +3 -0
- package/cjs/components/picker-view/columns-extend.js +45 -0
- package/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/cjs/components/picker-view/picker-view.js +14 -16
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +11 -1
- package/cjs/components/result/result.d.ts +2 -2
- package/cjs/components/virtual-input/virtual-input.js +25 -14
- package/cjs/locales/base.d.ts +6 -0
- package/cjs/locales/base.js +7 -1
- package/cjs/locales/en-US.d.ts +6 -0
- package/cjs/locales/fa-IR.d.ts +101 -0
- package/cjs/locales/fa-IR.js +108 -0
- package/cjs/locales/zh-CN.d.ts +6 -0
- package/cjs/locales/zh-CN.js +7 -1
- package/cjs/locales/zh-HK.d.ts +101 -0
- package/cjs/locales/zh-HK.js +58 -0
- package/cjs/locales/zh-TW.d.ts +101 -0
- package/cjs/locales/zh-TW.js +58 -0
- package/cjs/utils/with-cache.d.ts +1 -0
- package/cjs/utils/with-cache.js +17 -0
- package/es/components/calendar/calendar.d.ts +4 -3
- package/es/components/calendar/calendar.js +67 -58
- package/es/components/calendar/convert.d.ts +2 -0
- package/es/components/calendar/convert.js +15 -0
- package/es/components/collapse/collapse.js +7 -0
- package/es/components/dialog/confirm.js +8 -1
- package/es/components/form/form-item.js +6 -3
- package/es/components/modal/confirm.js +8 -1
- package/es/components/passcode-input/passcode-input.js +1 -1
- package/es/components/picker/picker.js +6 -8
- package/es/components/picker-view/columns-extend.d.ts +3 -0
- package/es/components/picker-view/columns-extend.js +34 -0
- package/es/components/picker-view/picker-view.d.ts +1 -0
- package/es/components/picker-view/picker-view.js +14 -15
- package/es/components/pull-to-refresh/pull-to-refresh.js +10 -1
- package/es/components/result/result.d.ts +2 -2
- package/es/components/virtual-input/virtual-input.js +23 -14
- package/es/locales/base.d.ts +6 -0
- package/es/locales/base.js +7 -1
- package/es/locales/en-US.d.ts +6 -0
- package/es/locales/fa-IR.d.ts +101 -0
- package/es/locales/fa-IR.js +98 -0
- package/es/locales/zh-CN.d.ts +6 -0
- package/es/locales/zh-CN.js +7 -1
- package/es/locales/zh-HK.d.ts +101 -0
- package/es/locales/zh-HK.js +48 -0
- package/es/locales/zh-TW.d.ts +101 -0
- package/es/locales/zh-TW.js +48 -0
- package/es/utils/with-cache.d.ts +1 -0
- package/es/utils/with-cache.js +10 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/picker-view/use-columns.d.ts +0 -2
- package/2x/cjs/components/picker-view/use-columns.js +0 -18
- package/2x/cjs/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/2x/cjs/components/picker-view/use-picker-value-extend.js +0 -37
- package/2x/es/components/picker-view/use-columns.d.ts +0 -2
- package/2x/es/components/picker-view/use-columns.js +0 -10
- package/2x/es/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/2x/es/components/picker-view/use-picker-value-extend.js +0 -26
- package/cjs/components/picker-view/use-columns.d.ts +0 -2
- package/cjs/components/picker-view/use-columns.js +0 -18
- package/cjs/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/cjs/components/picker-view/use-picker-value-extend.js +0 -37
- package/es/components/picker-view/use-columns.d.ts +0 -2
- package/es/components/picker-view/use-columns.js +0 -10
- package/es/components/picker-view/use-picker-value-extend.d.ts +0 -2
- package/es/components/picker-view/use-picker-value-extend.js +0 -26
|
@@ -50,6 +50,13 @@ const CollapsePanelContent = props => {
|
|
|
50
50
|
}, api] = (0, _web.useSpring)(() => ({
|
|
51
51
|
from: {
|
|
52
52
|
height: 0
|
|
53
|
+
},
|
|
54
|
+
config: {
|
|
55
|
+
precision: 0.01,
|
|
56
|
+
mass: 1,
|
|
57
|
+
tension: 200,
|
|
58
|
+
friction: 25,
|
|
59
|
+
clamp: true
|
|
53
60
|
}
|
|
54
61
|
}));
|
|
55
62
|
(0, _ahooks.useMount)(() => {
|
|
@@ -11,13 +11,21 @@ var _show = require("./show");
|
|
|
11
11
|
|
|
12
12
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
13
13
|
|
|
14
|
+
var _configProvider = require("../config-provider");
|
|
15
|
+
|
|
14
16
|
const defaultProps = {
|
|
15
17
|
confirmText: '确认',
|
|
16
18
|
cancelText: '取消'
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
function confirm(p) {
|
|
20
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
locale
|
|
24
|
+
} = (0, _configProvider.getDefaultConfig)();
|
|
25
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, {
|
|
26
|
+
confirmText: locale.common.confirm,
|
|
27
|
+
cancelText: locale.common.cancel
|
|
28
|
+
}, p);
|
|
21
29
|
return new Promise(resolve => {
|
|
22
30
|
(0, _show.show)(Object.assign(Object.assign({}, props), {
|
|
23
31
|
closeOnAction: true,
|
|
@@ -93,12 +93,15 @@ const FormItemLayout = props => {
|
|
|
93
93
|
const labelElement = label ? _react.default.createElement("label", {
|
|
94
94
|
className: `${classPrefix}-label`,
|
|
95
95
|
htmlFor: htmlFor
|
|
96
|
-
}, label, requiredMark, help && _react.default.createElement(
|
|
97
|
-
className: `${classPrefix}-label-help`
|
|
98
|
-
}, _react.default.createElement(_popover.default, {
|
|
96
|
+
}, label, requiredMark, help && _react.default.createElement(_popover.default, {
|
|
99
97
|
content: help,
|
|
100
98
|
mode: 'dark',
|
|
101
99
|
trigger: 'click'
|
|
100
|
+
}, _react.default.createElement("span", {
|
|
101
|
+
className: `${classPrefix}-label-help`,
|
|
102
|
+
onClick: e => {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
}
|
|
102
105
|
}, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null)))) : null;
|
|
103
106
|
|
|
104
107
|
const description = _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
|
|
@@ -11,13 +11,21 @@ var _show = require("./show");
|
|
|
11
11
|
|
|
12
12
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
13
13
|
|
|
14
|
+
var _configProvider = require("../config-provider");
|
|
15
|
+
|
|
14
16
|
const defaultProps = {
|
|
15
17
|
confirmText: '确认',
|
|
16
18
|
cancelText: '取消'
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
function confirm(p) {
|
|
20
|
-
const
|
|
22
|
+
const {
|
|
23
|
+
locale
|
|
24
|
+
} = (0, _configProvider.getDefaultConfig)();
|
|
25
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, {
|
|
26
|
+
confirmText: locale.common.confirm,
|
|
27
|
+
cancelText: locale.common.cancel
|
|
28
|
+
}, p);
|
|
21
29
|
return new Promise(resolve => {
|
|
22
30
|
(0, _show.show)(Object.assign(Object.assign({}, props), {
|
|
23
31
|
closeOnAction: true,
|
|
@@ -46,7 +46,7 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
46
46
|
if (value.length >= cellLength) {
|
|
47
47
|
(_a = props.onFill) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
48
48
|
}
|
|
49
|
-
}, [
|
|
49
|
+
}, [value, cellLength]);
|
|
50
50
|
|
|
51
51
|
const onFocus = () => {
|
|
52
52
|
var _a, _b;
|
|
@@ -17,12 +17,10 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
17
17
|
|
|
18
18
|
var _pickerView = _interopRequireDefault(require("../picker-view"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _columnsExtend = require("../picker-view/columns-extend");
|
|
21
21
|
|
|
22
22
|
var _configProvider = require("../config-provider");
|
|
23
23
|
|
|
24
|
-
var _usePickerValueExtend = require("../picker-view/use-picker-value-extend");
|
|
25
|
-
|
|
26
24
|
var _ahooks = require("ahooks");
|
|
27
25
|
|
|
28
26
|
var _safeArea = _interopRequireDefault(require("../safe-area"));
|
|
@@ -52,12 +50,11 @@ const Picker = (0, _react.memo)(p => {
|
|
|
52
50
|
onChange: val => {
|
|
53
51
|
var _a;
|
|
54
52
|
|
|
55
|
-
|
|
53
|
+
const extend = (0, _columnsExtend.generateColumnsExtend)(props.columns, val);
|
|
54
|
+
(_a = props.onConfirm) === null || _a === void 0 ? void 0 : _a.call(props, val, extend);
|
|
56
55
|
}
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
const columns = (0, _useColumns.useColumns)(props.columns, value);
|
|
60
|
-
const generateValueExtend = (0, _usePickerValueExtend.usePickerValueExtend)(columns);
|
|
56
|
+
}));
|
|
57
|
+
const extend = (0, _columnsExtend.useColumnsExtend)(props.columns, value);
|
|
61
58
|
const [innerValue, setInnerValue] = (0, _react.useState)(value);
|
|
62
59
|
(0, _react.useEffect)(() => {
|
|
63
60
|
if (innerValue !== value) {
|
|
@@ -130,7 +127,7 @@ const Picker = (0, _react.memo)(p => {
|
|
|
130
127
|
position: 'bottom'
|
|
131
128
|
}));
|
|
132
129
|
|
|
133
|
-
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props,
|
|
130
|
+
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, extend.items));
|
|
134
131
|
});
|
|
135
132
|
exports.Picker = Picker;
|
|
136
133
|
Picker.displayName = 'Picker';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PickerViewProps, PickerValue, PickerValueExtend } from './picker-view';
|
|
2
|
+
export declare function generateColumnsExtend(rawColumns: PickerViewProps['columns'], val: PickerValue[]): PickerValueExtend;
|
|
3
|
+
export declare function useColumnsExtend(rawColumns: PickerViewProps['columns'], value: PickerValue[]): PickerValueExtend;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateColumnsExtend = generateColumnsExtend;
|
|
7
|
+
exports.useColumnsExtend = useColumnsExtend;
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
var _withCache = require("../../utils/with-cache");
|
|
12
|
+
|
|
13
|
+
function generateColumnsExtend(rawColumns, val) {
|
|
14
|
+
const columns = (0, _withCache.withCache)(() => {
|
|
15
|
+
const c = typeof rawColumns === 'function' ? rawColumns(val) : rawColumns;
|
|
16
|
+
return c.map(column => column.map(item => typeof item === 'string' ? {
|
|
17
|
+
label: item,
|
|
18
|
+
value: item
|
|
19
|
+
} : item));
|
|
20
|
+
});
|
|
21
|
+
const items = (0, _withCache.withCache)(() => {
|
|
22
|
+
return val.map((v, index) => {
|
|
23
|
+
var _a;
|
|
24
|
+
|
|
25
|
+
const column = columns()[index];
|
|
26
|
+
if (!column) return null;
|
|
27
|
+
return (_a = column.find(item => item.value === v)) !== null && _a !== void 0 ? _a : null;
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
const extend = {
|
|
31
|
+
get columns() {
|
|
32
|
+
return columns();
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
get items() {
|
|
36
|
+
return items();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
};
|
|
40
|
+
return extend;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function useColumnsExtend(rawColumns, value) {
|
|
44
|
+
return (0, _react.useMemo)(() => generateColumnsExtend(rawColumns, value), [rawColumns, value]);
|
|
45
|
+
}
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type PickerValue = string | null;
|
|
4
4
|
export declare type PickerValueExtend = {
|
|
5
|
+
columns: PickerColumnItem[][];
|
|
5
6
|
items: (PickerColumnItem | null)[];
|
|
6
7
|
};
|
|
7
8
|
export declare type PickerColumnItem = {
|
|
@@ -11,12 +11,10 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
11
11
|
|
|
12
12
|
var _wheel = require("./wheel");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _columnsExtend = require("./columns-extend");
|
|
15
15
|
|
|
16
16
|
var _nativeProps = require("../../utils/native-props");
|
|
17
17
|
|
|
18
|
-
var _usePickerValueExtend = require("./use-picker-value-extend");
|
|
19
|
-
|
|
20
18
|
var _ahooks = require("ahooks");
|
|
21
19
|
|
|
22
20
|
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); }
|
|
@@ -29,17 +27,7 @@ const defaultProps = {
|
|
|
29
27
|
};
|
|
30
28
|
const PickerView = (0, _react.memo)(p => {
|
|
31
29
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
32
|
-
const [innerValue, setInnerValue] = (0, _react.useState)(props.value === undefined ? props.defaultValue : props.value);
|
|
33
|
-
(0, _ahooks.useDebounceEffect)(() => {
|
|
34
|
-
var _a;
|
|
35
|
-
|
|
36
|
-
if (props.value === innerValue) return;
|
|
37
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerValue, generateValueExtend(innerValue));
|
|
38
|
-
}, [innerValue], {
|
|
39
|
-
wait: 0,
|
|
40
|
-
leading: false,
|
|
41
|
-
trailing: true
|
|
42
|
-
}); // Sync `value` to `innerValue`
|
|
30
|
+
const [innerValue, setInnerValue] = (0, _react.useState)(props.value === undefined ? props.defaultValue : props.value); // Sync `value` to `innerValue`
|
|
43
31
|
|
|
44
32
|
(0, _react.useEffect)(() => {
|
|
45
33
|
if (props.value === undefined) return; // Uncontrolled mode
|
|
@@ -58,8 +46,18 @@ const PickerView = (0, _react.memo)(p => {
|
|
|
58
46
|
window.clearTimeout(timeout);
|
|
59
47
|
};
|
|
60
48
|
}, [props.value, innerValue]);
|
|
61
|
-
const
|
|
62
|
-
const
|
|
49
|
+
const extend = (0, _columnsExtend.useColumnsExtend)(props.columns, innerValue);
|
|
50
|
+
const columns = extend.columns;
|
|
51
|
+
(0, _ahooks.useDebounceEffect)(() => {
|
|
52
|
+
var _a;
|
|
53
|
+
|
|
54
|
+
if (props.value === innerValue) return;
|
|
55
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerValue, extend);
|
|
56
|
+
}, [innerValue], {
|
|
57
|
+
wait: 0,
|
|
58
|
+
leading: false,
|
|
59
|
+
trailing: true
|
|
60
|
+
});
|
|
63
61
|
const handleSelect = (0, _react.useCallback)((val, index) => {
|
|
64
62
|
setInnerValue(prev => {
|
|
65
63
|
const next = [...prev];
|
|
@@ -23,6 +23,8 @@ var _convertPx = require("../../utils/convert-px");
|
|
|
23
23
|
|
|
24
24
|
var _rubberband = require("../../utils/rubberband");
|
|
25
25
|
|
|
26
|
+
var _configProvider = require("../config-provider");
|
|
27
|
+
|
|
26
28
|
var _sleep = require("../../utils/sleep");
|
|
27
29
|
|
|
28
30
|
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); }
|
|
@@ -44,7 +46,15 @@ exports.defaultProps = defaultProps;
|
|
|
44
46
|
const PullToRefresh = p => {
|
|
45
47
|
var _a, _b;
|
|
46
48
|
|
|
47
|
-
const
|
|
49
|
+
const {
|
|
50
|
+
locale
|
|
51
|
+
} = (0, _configProvider.useConfig)();
|
|
52
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, {
|
|
53
|
+
refreshingText: locale.common.loading,
|
|
54
|
+
pullingText: locale.PullToRefresh.pulling,
|
|
55
|
+
canReleaseText: locale.PullToRefresh.canRelease,
|
|
56
|
+
completeText: locale.PullToRefresh.complete
|
|
57
|
+
}, p);
|
|
48
58
|
const headHeight = (_a = props.headHeight) !== null && _a !== void 0 ? _a : (0, _convertPx.convertPx)(40);
|
|
49
59
|
const threshold = (_b = props.threshold) !== null && _b !== void 0 ? _b : (0, _convertPx.convertPx)(60);
|
|
50
60
|
const [status, setStatus] = (0, _react2.useState)('pulling');
|
|
@@ -2,8 +2,8 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ResultProps = {
|
|
4
4
|
status: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
5
|
-
title:
|
|
6
|
-
description?:
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
7
|
icon?: ReactNode;
|
|
8
8
|
} & NativeProps;
|
|
9
9
|
export declare const Result: FC<ResultProps>;
|
|
@@ -84,6 +84,30 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
84
84
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
const keyboard = props.keyboard;
|
|
88
|
+
|
|
89
|
+
const keyboardElement = keyboard && _react.default.cloneElement(keyboard, {
|
|
90
|
+
onInput: v => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
|
|
93
|
+
setValue(value + v);
|
|
94
|
+
(_b = (_a = keyboard.props).onInput) === null || _b === void 0 ? void 0 : _b.call(_a, v);
|
|
95
|
+
},
|
|
96
|
+
onDelete: () => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
|
|
99
|
+
setValue(value.slice(0, -1));
|
|
100
|
+
(_b = (_a = keyboard.props).onDelete) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
101
|
+
},
|
|
102
|
+
visible: hasFocus,
|
|
103
|
+
onClose: () => {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
|
|
106
|
+
(_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
107
|
+
(_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
87
111
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
88
112
|
ref: rootRef,
|
|
89
113
|
className: (0, _classnames.default)(classPrefix, {
|
|
@@ -111,19 +135,6 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
111
135
|
}
|
|
112
136
|
}, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null)), !value && _react.default.createElement("div", {
|
|
113
137
|
className: `${classPrefix}-placeholder`
|
|
114
|
-
}, props.placeholder),
|
|
115
|
-
onInput: v => {
|
|
116
|
-
setValue(value + v);
|
|
117
|
-
},
|
|
118
|
-
onDelete: () => {
|
|
119
|
-
setValue(value.slice(0, -1));
|
|
120
|
-
},
|
|
121
|
-
visible: hasFocus,
|
|
122
|
-
onClose: () => {
|
|
123
|
-
var _a;
|
|
124
|
-
|
|
125
|
-
(_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
126
|
-
}
|
|
127
|
-
})));
|
|
138
|
+
}, props.placeholder), keyboardElement));
|
|
128
139
|
});
|
|
129
140
|
exports.VirtualInput = VirtualInput;
|
package/cjs/locales/base.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const base: {
|
|
|
2
2
|
common: {
|
|
3
3
|
confirm: string;
|
|
4
4
|
cancel: string;
|
|
5
|
+
loading: string;
|
|
5
6
|
};
|
|
6
7
|
Calendar: {
|
|
7
8
|
markItems: string[];
|
|
@@ -91,5 +92,10 @@ export declare const base: {
|
|
|
91
92
|
Modal: {
|
|
92
93
|
ok: string;
|
|
93
94
|
};
|
|
95
|
+
PullToRefresh: {
|
|
96
|
+
pulling: string;
|
|
97
|
+
canRelease: string;
|
|
98
|
+
complete: string;
|
|
99
|
+
};
|
|
94
100
|
};
|
|
95
101
|
export declare type Locale = typeof base;
|
package/cjs/locales/base.js
CHANGED
|
@@ -8,7 +8,8 @@ const typeTemplate = '${label} is not a valid ${type}';
|
|
|
8
8
|
const base = {
|
|
9
9
|
common: {
|
|
10
10
|
confirm: 'Confirm',
|
|
11
|
-
cancel: 'Cancel'
|
|
11
|
+
cancel: 'Cancel',
|
|
12
|
+
loading: 'Loading...'
|
|
12
13
|
},
|
|
13
14
|
Calendar: {
|
|
14
15
|
markItems: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
@@ -97,6 +98,11 @@ const base = {
|
|
|
97
98
|
},
|
|
98
99
|
Modal: {
|
|
99
100
|
ok: 'OK'
|
|
101
|
+
},
|
|
102
|
+
PullToRefresh: {
|
|
103
|
+
pulling: 'Scroll down to refresh',
|
|
104
|
+
canRelease: 'Release to refresh immediately',
|
|
105
|
+
complete: 'Refresh successful'
|
|
100
106
|
}
|
|
101
107
|
};
|
|
102
108
|
exports.base = base;
|
package/cjs/locales/en-US.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare const enUS: {
|
|
|
2
2
|
common: {
|
|
3
3
|
confirm: string;
|
|
4
4
|
cancel: string;
|
|
5
|
+
loading: string;
|
|
5
6
|
};
|
|
6
7
|
Calendar: {
|
|
7
8
|
markItems: string[];
|
|
@@ -91,5 +92,10 @@ declare const enUS: {
|
|
|
91
92
|
Modal: {
|
|
92
93
|
ok: string;
|
|
93
94
|
};
|
|
95
|
+
PullToRefresh: {
|
|
96
|
+
pulling: string;
|
|
97
|
+
canRelease: string;
|
|
98
|
+
complete: string;
|
|
99
|
+
};
|
|
94
100
|
};
|
|
95
101
|
export default enUS;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
declare const faIR: {
|
|
2
|
+
common: {
|
|
3
|
+
confirm: string;
|
|
4
|
+
cancel: string;
|
|
5
|
+
loading: string;
|
|
6
|
+
};
|
|
7
|
+
Calendar: {
|
|
8
|
+
markItems: string[];
|
|
9
|
+
renderYearAndMonth: (year: number, month: number) => string;
|
|
10
|
+
};
|
|
11
|
+
Cascader: {
|
|
12
|
+
placeholder: string;
|
|
13
|
+
};
|
|
14
|
+
Dialog: {
|
|
15
|
+
ok: string;
|
|
16
|
+
};
|
|
17
|
+
ErrorBlock: {
|
|
18
|
+
default: {
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
busy: {
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
disconnected: {
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
empty: {
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
Form: {
|
|
36
|
+
required: string;
|
|
37
|
+
optional: string;
|
|
38
|
+
defaultValidateMessages: {
|
|
39
|
+
default: string;
|
|
40
|
+
required: string;
|
|
41
|
+
enum: string;
|
|
42
|
+
whitespace: string;
|
|
43
|
+
date: {
|
|
44
|
+
format: string;
|
|
45
|
+
parse: string;
|
|
46
|
+
invalid: string;
|
|
47
|
+
};
|
|
48
|
+
types: {
|
|
49
|
+
string: string;
|
|
50
|
+
method: string;
|
|
51
|
+
array: string;
|
|
52
|
+
object: string;
|
|
53
|
+
number: string;
|
|
54
|
+
date: string;
|
|
55
|
+
boolean: string;
|
|
56
|
+
integer: string;
|
|
57
|
+
float: string;
|
|
58
|
+
regexp: string;
|
|
59
|
+
email: string;
|
|
60
|
+
url: string;
|
|
61
|
+
hex: string;
|
|
62
|
+
};
|
|
63
|
+
string: {
|
|
64
|
+
len: string;
|
|
65
|
+
min: string;
|
|
66
|
+
max: string;
|
|
67
|
+
range: string;
|
|
68
|
+
};
|
|
69
|
+
number: {
|
|
70
|
+
len: string;
|
|
71
|
+
min: string;
|
|
72
|
+
max: string;
|
|
73
|
+
range: string;
|
|
74
|
+
};
|
|
75
|
+
array: {
|
|
76
|
+
len: string;
|
|
77
|
+
min: string;
|
|
78
|
+
max: string;
|
|
79
|
+
range: string;
|
|
80
|
+
};
|
|
81
|
+
pattern: {
|
|
82
|
+
mismatch: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
ImageUploader: {
|
|
87
|
+
uploading: string;
|
|
88
|
+
};
|
|
89
|
+
Mask: {
|
|
90
|
+
name: string;
|
|
91
|
+
};
|
|
92
|
+
Modal: {
|
|
93
|
+
ok: string;
|
|
94
|
+
};
|
|
95
|
+
PullToRefresh: {
|
|
96
|
+
pulling: string;
|
|
97
|
+
canRelease: string;
|
|
98
|
+
complete: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export default faIR;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _mergeLocale = require("../utils/merge-locale");
|
|
9
|
+
|
|
10
|
+
var _base = require("./base");
|
|
11
|
+
|
|
12
|
+
const typeTemplate = '${label} یک ${type} معتبر نیست';
|
|
13
|
+
const faIR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
14
|
+
common: {
|
|
15
|
+
confirm: 'تایید',
|
|
16
|
+
cancel: 'لغو'
|
|
17
|
+
},
|
|
18
|
+
Calendar: {
|
|
19
|
+
markItems: ['شنبه', 'یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجنشبه', 'جمعه'],
|
|
20
|
+
renderYearAndMonth: (year, month) => `${year}/${month}`
|
|
21
|
+
},
|
|
22
|
+
Cascader: {
|
|
23
|
+
placeholder: 'انتخاب کنید'
|
|
24
|
+
},
|
|
25
|
+
Dialog: {
|
|
26
|
+
ok: 'باشه'
|
|
27
|
+
},
|
|
28
|
+
ErrorBlock: {
|
|
29
|
+
default: {
|
|
30
|
+
title: 'اوه، مشکلی پیش آمد',
|
|
31
|
+
description: 'لطفاً یک دقیقه صبر کنید و دوباره امتحان کنید'
|
|
32
|
+
},
|
|
33
|
+
busy: {
|
|
34
|
+
title: 'اوه، بارگیری نمی شود',
|
|
35
|
+
description: 'سعی کنید صفحه را به روز کنید'
|
|
36
|
+
},
|
|
37
|
+
disconnected: {
|
|
38
|
+
title: 'شبکه مشغول است',
|
|
39
|
+
description: 'سعی کنید صفحه را به روز کنید'
|
|
40
|
+
},
|
|
41
|
+
empty: {
|
|
42
|
+
title: 'هوم، نتونستم پیداش کنم...',
|
|
43
|
+
description: 'آیا می خواهید یک جستجوی جدید را امتحان کنید؟'
|
|
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: 'طول آیتمهای ${label} باید برابر با ${len} باشد',
|
|
88
|
+
min: 'آیتمهای ${label} باید حداقل ${min} باشد',
|
|
89
|
+
max: 'آیتمهای ${label} باید حداکثر ${max} باشد',
|
|
90
|
+
range: 'آیتمهای ${label} باید بین ${min}-${max} باشد'
|
|
91
|
+
},
|
|
92
|
+
pattern: {
|
|
93
|
+
mismatch: '${label} با الگوی ${pattern} مطابقت ندارد'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
ImageUploader: {
|
|
98
|
+
uploading: 'در حال آپلود...'
|
|
99
|
+
},
|
|
100
|
+
Mask: {
|
|
101
|
+
name: 'ماسک'
|
|
102
|
+
},
|
|
103
|
+
Modal: {
|
|
104
|
+
ok: 'باشه'
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
var _default = faIR;
|
|
108
|
+
exports.default = _default;
|
package/cjs/locales/zh-CN.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare const zhCN: {
|
|
|
2
2
|
common: {
|
|
3
3
|
confirm: string;
|
|
4
4
|
cancel: string;
|
|
5
|
+
loading: string;
|
|
5
6
|
};
|
|
6
7
|
Calendar: {
|
|
7
8
|
markItems: string[];
|
|
@@ -91,5 +92,10 @@ declare const zhCN: {
|
|
|
91
92
|
Modal: {
|
|
92
93
|
ok: string;
|
|
93
94
|
};
|
|
95
|
+
PullToRefresh: {
|
|
96
|
+
pulling: string;
|
|
97
|
+
canRelease: string;
|
|
98
|
+
complete: string;
|
|
99
|
+
};
|
|
94
100
|
};
|
|
95
101
|
export default zhCN;
|
package/cjs/locales/zh-CN.js
CHANGED
|
@@ -13,7 +13,8 @@ const typeTemplate = '${label}不是一个有效的${type}';
|
|
|
13
13
|
const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
14
14
|
common: {
|
|
15
15
|
confirm: '确定',
|
|
16
|
-
cancel: '取消'
|
|
16
|
+
cancel: '取消',
|
|
17
|
+
loading: '加载中……'
|
|
17
18
|
},
|
|
18
19
|
Calendar: {
|
|
19
20
|
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
@@ -102,6 +103,11 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
102
103
|
},
|
|
103
104
|
Modal: {
|
|
104
105
|
ok: '我知道了'
|
|
106
|
+
},
|
|
107
|
+
PullToRefresh: {
|
|
108
|
+
pulling: '下拉刷新',
|
|
109
|
+
canRelease: '释放立即刷新',
|
|
110
|
+
complete: '刷新成功'
|
|
105
111
|
}
|
|
106
112
|
});
|
|
107
113
|
var _default = zhCN;
|