antd-mobile 5.34.0 → 5.36.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 +472 -1560
- package/2x/bundle/antd-mobile.cjs.js +7 -7
- package/2x/bundle/antd-mobile.es.development.js +473 -1561
- package/2x/bundle/antd-mobile.es.js +7287 -8011
- package/2x/bundle/antd-mobile.umd.development.js +472 -1560
- package/2x/bundle/antd-mobile.umd.js +7 -7
- package/2x/bundle/css-vars-patch.css +3 -3
- package/2x/bundle/style.css +6 -10
- package/2x/cjs/components/button/button.d.ts +3 -3
- package/2x/cjs/components/button/button.patch.css +3 -3
- package/2x/cjs/components/cascader-view/use-cascader-value-extend.js +10 -5
- package/2x/cjs/components/checkbox/native-input.js +1 -1
- package/2x/cjs/components/config-provider/config-provider.d.ts +3 -2
- package/2x/cjs/components/error-block/create-error-block.d.ts +1 -0
- package/2x/cjs/components/error-block/create-error-block.js +1 -0
- package/2x/cjs/components/error-block/index.d.ts +0 -1
- package/2x/cjs/components/error-block/index.js +2 -3
- package/2x/cjs/components/form/form-item.js +1 -0
- package/2x/cjs/components/form/form.js +2 -2
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +8 -4
- package/2x/cjs/components/input/input.d.ts +2 -4
- package/2x/cjs/components/input/input.js +8 -17
- package/2x/cjs/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/2x/cjs/components/input/useInputHandleKeyDown.js +29 -0
- package/2x/cjs/components/picker-view/wheel.js +7 -4
- package/2x/cjs/components/popover/index.d.ts +1 -1
- package/2x/cjs/components/popover/popover.d.ts +1 -1
- package/2x/cjs/components/radio/radio.css +1 -1
- package/2x/cjs/components/radio/radio.d.ts +1 -1
- package/2x/cjs/components/radio/radio.js +5 -5
- package/2x/cjs/components/result-page/result-page.css +5 -5
- package/2x/cjs/components/result-page/result-page.d.ts +1 -1
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +1 -1
- package/2x/cjs/components/swiper/index.d.ts +1 -1
- package/2x/cjs/components/swiper/swiper.d.ts +2 -2
- package/2x/cjs/components/swiper/swiper.js +5 -1
- package/2x/cjs/components/text-area/text-area.css +0 -4
- package/2x/cjs/components/text-area/text-area.d.ts +6 -2
- package/2x/cjs/components/text-area/text-area.js +9 -1
- package/2x/cjs/global/css-vars-patch.css +3 -3
- package/2x/cjs/index.d.ts +1 -1
- package/2x/cjs/index.js +6 -0
- package/2x/cjs/locales/ar-SA.d.ts +139 -0
- package/2x/cjs/locales/ar-SA.js +149 -0
- package/2x/cjs/locales/de-DE.d.ts +139 -0
- package/2x/cjs/locales/de-DE.js +149 -0
- package/2x/cjs/locales/hu-HU.d.ts +139 -0
- package/2x/cjs/locales/hu-HU.js +148 -0
- package/2x/cjs/locales/ms-MY.d.ts +139 -0
- package/2x/cjs/locales/ms-MY.js +149 -0
- package/2x/cjs/locales/pt-BR.d.ts +139 -0
- package/2x/cjs/locales/pt-BR.js +144 -0
- package/2x/cjs/locales/th-TH.d.ts +139 -0
- package/2x/cjs/locales/th-TH.js +149 -0
- package/2x/cjs/locales/vi-VN.d.ts +139 -0
- package/2x/cjs/locales/vi-VN.js +149 -0
- package/2x/cjs/locales/zh-CN.d.ts +2 -138
- package/2x/cjs/locales/zh-CN.js +2 -4
- package/2x/cjs/locales/zh-CN.test.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.test.js +19 -0
- package/2x/cjs/utils/with-default-props.js +8 -9
- package/2x/cjs/utils/with-stop-propagation.d.ts +1 -1
- package/2x/cjs/utils/with-stop-propagation.js +2 -1
- package/2x/es/components/button/button.d.ts +3 -3
- package/2x/es/components/button/button.patch.css +3 -3
- package/2x/es/components/cascader-view/use-cascader-value-extend.js +8 -3
- package/2x/es/components/checkbox/native-input.js +1 -1
- package/2x/es/components/config-provider/config-provider.d.ts +3 -2
- package/2x/es/components/error-block/create-error-block.d.ts +1 -0
- package/2x/es/components/error-block/create-error-block.js +1 -0
- package/2x/es/components/error-block/index.d.ts +0 -1
- package/2x/es/components/error-block/index.js +0 -1
- package/2x/es/components/form/form-item.js +1 -0
- package/2x/es/components/form/form.js +2 -2
- package/2x/es/components/infinite-scroll/infinite-scroll.js +8 -4
- package/2x/es/components/input/input.d.ts +2 -4
- package/2x/es/components/input/input.js +8 -17
- package/2x/es/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/2x/es/components/input/useInputHandleKeyDown.js +23 -0
- package/2x/es/components/picker-view/wheel.js +6 -3
- package/2x/es/components/popover/index.d.ts +1 -1
- package/2x/es/components/popover/popover.d.ts +1 -1
- package/2x/es/components/radio/radio.css +1 -1
- package/2x/es/components/radio/radio.d.ts +1 -1
- package/2x/es/components/radio/radio.js +4 -4
- package/2x/es/components/result-page/result-page.css +5 -5
- package/2x/es/components/result-page/result-page.d.ts +1 -1
- package/2x/es/components/swipe-action/swipe-action.d.ts +1 -1
- package/2x/es/components/swiper/index.d.ts +1 -1
- package/2x/es/components/swiper/swiper.d.ts +2 -2
- package/2x/es/components/swiper/swiper.js +5 -1
- package/2x/es/components/text-area/text-area.css +0 -4
- package/2x/es/components/text-area/text-area.d.ts +6 -2
- package/2x/es/components/text-area/text-area.js +9 -1
- package/2x/es/global/css-vars-patch.css +3 -3
- package/2x/es/index.d.ts +1 -1
- package/2x/es/index.js +1 -1
- package/2x/es/locales/ar-SA.d.ts +139 -0
- package/2x/es/locales/ar-SA.js +142 -0
- package/2x/es/locales/de-DE.d.ts +139 -0
- package/2x/es/locales/de-DE.js +142 -0
- package/2x/es/locales/hu-HU.d.ts +139 -0
- package/2x/es/locales/hu-HU.js +140 -0
- package/2x/es/locales/ms-MY.d.ts +139 -0
- package/2x/es/locales/ms-MY.js +142 -0
- package/2x/es/locales/pt-BR.d.ts +139 -0
- package/2x/es/locales/pt-BR.js +137 -0
- package/2x/es/locales/th-TH.d.ts +139 -0
- package/2x/es/locales/th-TH.js +142 -0
- package/2x/es/locales/vi-VN.d.ts +139 -0
- package/2x/es/locales/vi-VN.js +142 -0
- package/2x/es/locales/zh-CN.d.ts +2 -138
- package/2x/es/locales/zh-CN.js +2 -4
- package/2x/es/locales/zh-CN.test.d.ts +1 -0
- package/2x/es/locales/zh-CN.test.js +16 -0
- package/2x/es/utils/with-default-props.js +8 -8
- package/2x/es/utils/with-stop-propagation.d.ts +1 -1
- package/2x/es/utils/with-stop-propagation.js +2 -1
- package/2x/package.json +38 -21
- package/bundle/antd-mobile.cjs.development.js +472 -1560
- package/bundle/antd-mobile.cjs.js +7 -7
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +473 -1561
- package/bundle/antd-mobile.es.js +7287 -8011
- package/bundle/antd-mobile.umd.development.js +472 -1560
- package/bundle/antd-mobile.umd.js +7 -7
- package/bundle/css-vars-patch.css +3 -3
- package/bundle/style.css +1 -1
- package/cjs/components/button/button.d.ts +3 -3
- package/cjs/components/button/button.patch.css +3 -3
- package/cjs/components/cascader-view/use-cascader-value-extend.js +10 -5
- package/cjs/components/checkbox/native-input.js +1 -1
- package/cjs/components/config-provider/config-provider.d.ts +3 -2
- package/cjs/components/error-block/create-error-block.d.ts +1 -0
- package/cjs/components/error-block/create-error-block.js +1 -0
- package/cjs/components/error-block/index.d.ts +0 -1
- package/cjs/components/error-block/index.js +2 -3
- package/cjs/components/form/form-item.js +1 -0
- package/cjs/components/form/form.js +2 -2
- package/cjs/components/infinite-scroll/infinite-scroll.js +8 -4
- package/cjs/components/input/input.d.ts +2 -4
- package/cjs/components/input/input.js +8 -17
- package/cjs/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/cjs/components/input/useInputHandleKeyDown.js +29 -0
- package/cjs/components/picker-view/wheel.js +7 -4
- package/cjs/components/popover/index.d.ts +1 -1
- package/cjs/components/popover/popover.d.ts +1 -1
- package/cjs/components/radio/radio.css +1 -1
- package/cjs/components/radio/radio.d.ts +1 -1
- package/cjs/components/radio/radio.js +5 -5
- package/cjs/components/result-page/result-page.css +5 -5
- package/cjs/components/result-page/result-page.d.ts +1 -1
- package/cjs/components/swipe-action/swipe-action.d.ts +1 -1
- package/cjs/components/swiper/index.d.ts +1 -1
- package/cjs/components/swiper/swiper.d.ts +2 -2
- package/cjs/components/swiper/swiper.js +5 -1
- package/cjs/components/text-area/text-area.css +0 -3
- package/cjs/components/text-area/text-area.d.ts +6 -2
- package/cjs/components/text-area/text-area.js +9 -1
- package/cjs/global/css-vars-patch.css +3 -3
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +6 -0
- package/cjs/locales/ar-SA.d.ts +139 -0
- package/cjs/locales/ar-SA.js +149 -0
- package/cjs/locales/de-DE.d.ts +139 -0
- package/cjs/locales/de-DE.js +149 -0
- package/cjs/locales/hu-HU.d.ts +139 -0
- package/cjs/locales/hu-HU.js +148 -0
- package/cjs/locales/ms-MY.d.ts +139 -0
- package/cjs/locales/ms-MY.js +149 -0
- package/cjs/locales/pt-BR.d.ts +139 -0
- package/cjs/locales/pt-BR.js +144 -0
- package/cjs/locales/th-TH.d.ts +139 -0
- package/cjs/locales/th-TH.js +149 -0
- package/cjs/locales/vi-VN.d.ts +139 -0
- package/cjs/locales/vi-VN.js +149 -0
- package/cjs/locales/zh-CN.d.ts +2 -138
- package/cjs/locales/zh-CN.js +2 -4
- package/cjs/locales/zh-CN.test.d.ts +1 -0
- package/cjs/locales/zh-CN.test.js +19 -0
- package/cjs/utils/with-default-props.js +8 -9
- package/cjs/utils/with-stop-propagation.d.ts +1 -1
- package/cjs/utils/with-stop-propagation.js +2 -1
- package/es/components/button/button.d.ts +3 -3
- package/es/components/button/button.patch.css +3 -3
- package/es/components/cascader-view/use-cascader-value-extend.js +8 -3
- package/es/components/checkbox/native-input.js +1 -1
- package/es/components/config-provider/config-provider.d.ts +3 -2
- package/es/components/error-block/create-error-block.d.ts +1 -0
- package/es/components/error-block/create-error-block.js +1 -0
- package/es/components/error-block/index.d.ts +0 -1
- package/es/components/error-block/index.js +0 -1
- package/es/components/form/form-item.js +1 -0
- package/es/components/form/form.js +2 -2
- package/es/components/infinite-scroll/infinite-scroll.js +8 -4
- package/es/components/input/input.d.ts +2 -4
- package/es/components/input/input.js +8 -17
- package/es/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/es/components/input/useInputHandleKeyDown.js +23 -0
- package/es/components/picker-view/wheel.js +6 -3
- package/es/components/popover/index.d.ts +1 -1
- package/es/components/popover/popover.d.ts +1 -1
- package/es/components/radio/radio.css +1 -1
- package/es/components/radio/radio.d.ts +1 -1
- package/es/components/radio/radio.js +4 -4
- package/es/components/result-page/result-page.css +5 -5
- package/es/components/result-page/result-page.d.ts +1 -1
- package/es/components/swipe-action/swipe-action.d.ts +1 -1
- package/es/components/swiper/index.d.ts +1 -1
- package/es/components/swiper/swiper.d.ts +2 -2
- package/es/components/swiper/swiper.js +5 -1
- package/es/components/text-area/text-area.css +0 -3
- package/es/components/text-area/text-area.d.ts +6 -2
- package/es/components/text-area/text-area.js +9 -1
- package/es/global/css-vars-patch.css +3 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/locales/ar-SA.d.ts +139 -0
- package/es/locales/ar-SA.js +142 -0
- package/es/locales/de-DE.d.ts +139 -0
- package/es/locales/de-DE.js +142 -0
- package/es/locales/hu-HU.d.ts +139 -0
- package/es/locales/hu-HU.js +140 -0
- package/es/locales/ms-MY.d.ts +139 -0
- package/es/locales/ms-MY.js +142 -0
- package/es/locales/pt-BR.d.ts +139 -0
- package/es/locales/pt-BR.js +137 -0
- package/es/locales/th-TH.d.ts +139 -0
- package/es/locales/th-TH.js +142 -0
- package/es/locales/vi-VN.d.ts +139 -0
- package/es/locales/vi-VN.js +142 -0
- package/es/locales/zh-CN.d.ts +2 -138
- package/es/locales/zh-CN.js +2 -4
- package/es/locales/zh-CN.test.d.ts +1 -0
- package/es/locales/zh-CN.test.js +16 -0
- package/es/utils/with-default-props.js +8 -8
- package/es/utils/with-stop-propagation.d.ts +1 -1
- package/es/utils/with-stop-propagation.js +2 -1
- package/package.json +38 -21
- package/umd/antd-mobile.js +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
2
|
+
export default function useInputHandleKeyDown({
|
|
3
|
+
onEnterPress,
|
|
4
|
+
onKeyDown,
|
|
5
|
+
nativeInputRef,
|
|
6
|
+
enterKeyHint
|
|
7
|
+
}) {
|
|
8
|
+
const handleKeydown = e => {
|
|
9
|
+
if (onEnterPress && (e.code === 'Enter' || e.keyCode === 13)) {
|
|
10
|
+
onEnterPress(e);
|
|
11
|
+
}
|
|
12
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
13
|
+
};
|
|
14
|
+
useIsomorphicLayoutEffect(() => {
|
|
15
|
+
const ele = nativeInputRef.current;
|
|
16
|
+
if (!enterKeyHint || !ele) return;
|
|
17
|
+
ele.setAttribute('enterkeyhint', enterKeyHint);
|
|
18
|
+
return () => {
|
|
19
|
+
ele.removeAttribute('enterkeyhint');
|
|
20
|
+
};
|
|
21
|
+
}, [enterKeyHint]);
|
|
22
|
+
return handleKeydown;
|
|
23
|
+
}
|
|
@@ -3,10 +3,11 @@ import { useSpring, animated } from '@react-spring/web';
|
|
|
3
3
|
import { useDrag, useWheel } from '@use-gesture/react';
|
|
4
4
|
import { rubberbandIfOutOfBounds } from '../../utils/rubberband';
|
|
5
5
|
import { bound } from '../../utils/bound';
|
|
6
|
-
import isEqual from '
|
|
6
|
+
import isEqual from 'react-fast-compare';
|
|
7
7
|
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
8
8
|
import { measureCSSLength } from '../../utils/measure-css-length';
|
|
9
9
|
import { supportsPassive } from '../../utils/supports-passive';
|
|
10
|
+
import classNames from 'classnames';
|
|
10
11
|
const classPrefix = `adm-picker-view`;
|
|
11
12
|
export const Wheel = memo(props => {
|
|
12
13
|
const {
|
|
@@ -214,8 +215,10 @@ export const Wheel = memo(props => {
|
|
|
214
215
|
}
|
|
215
216
|
return React.createElement("div", {
|
|
216
217
|
key: (_a = item.key) !== null && _a !== void 0 ? _a : item.value,
|
|
217
|
-
"data-selected":
|
|
218
|
-
className: `${classPrefix}-column-item`,
|
|
218
|
+
"data-selected": selected,
|
|
219
|
+
className: classNames(`${classPrefix}-column-item`, {
|
|
220
|
+
[`${classPrefix}-column-item-active`]: selected
|
|
221
|
+
}),
|
|
219
222
|
onClick: handleClick,
|
|
220
223
|
"aria-hidden": !selected,
|
|
221
224
|
"aria-label": selected ? 'active' : ''
|
|
@@ -14,7 +14,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
14
14
|
mode?: "dark" | "light" | undefined;
|
|
15
15
|
trigger?: "click" | undefined;
|
|
16
16
|
placement?: DeprecatedPlacement | Placement | undefined;
|
|
17
|
-
stopPropagation?: "
|
|
17
|
+
stopPropagation?: import("../../utils/with-stop-propagation").PropagationEvent[] | undefined;
|
|
18
18
|
content: import("react").ReactNode;
|
|
19
19
|
} & {
|
|
20
20
|
className?: string | undefined;
|
|
@@ -32,7 +32,7 @@ export declare const Popover: React.ForwardRefExoticComponent<{
|
|
|
32
32
|
mode?: "dark" | "light" | undefined;
|
|
33
33
|
trigger?: "click" | undefined;
|
|
34
34
|
placement?: DeprecatedPlacement | Placement | undefined;
|
|
35
|
-
stopPropagation?:
|
|
35
|
+
stopPropagation?: PropagationEvent[] | undefined;
|
|
36
36
|
content: ReactNode;
|
|
37
37
|
} & {
|
|
38
38
|
className?: string | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import classNames from 'classnames';
|
|
1
2
|
import React, { useContext } from 'react';
|
|
3
|
+
import { devWarning } from '../../utils/dev-log';
|
|
4
|
+
import { isDev } from '../../utils/is-dev';
|
|
2
5
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { RadioGroupContext } from './group-context';
|
|
5
6
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
7
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
8
|
import { CheckIcon } from '../checkbox/check-icon';
|
|
8
|
-
import { devWarning } from '../../utils/dev-log';
|
|
9
|
-
import { isDev } from '../../utils/is-dev';
|
|
10
9
|
import { NativeInput } from '../checkbox/native-input';
|
|
10
|
+
import { RadioGroupContext } from './group-context';
|
|
11
11
|
const classPrefix = `adm-radio`;
|
|
12
12
|
const defaultProps = {
|
|
13
13
|
defaultChecked: false
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.adm-result-page-icon {
|
|
22
|
-
color: var(--adm-color-
|
|
22
|
+
color: var(--adm-color-text-light-solid);
|
|
23
23
|
box-sizing: border-box;
|
|
24
24
|
padding: 4px;
|
|
25
25
|
margin-bottom: 16px;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
.adm-result-page-title {
|
|
33
33
|
font-size: var(--adm-font-size-10);
|
|
34
|
-
color: var(--adm-color-
|
|
34
|
+
color: var(--adm-color-text-light-solid);
|
|
35
35
|
line-height: 1.4;
|
|
36
36
|
text-align: center;
|
|
37
37
|
}
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
flex-direction: row;
|
|
56
56
|
justify-content: space-between;
|
|
57
57
|
margin-bottom: 10px;
|
|
58
|
-
color: var(--adm-color-
|
|
58
|
+
color: var(--adm-color-text-light-solid);
|
|
59
59
|
font-size: var(--adm-font-size-6);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
height: 20px;
|
|
70
70
|
margin: auto;
|
|
71
71
|
margin-bottom: 10px;
|
|
72
|
-
border-top: 4px solid var(--adm-color-
|
|
73
|
-
border-right: 4px solid var(--adm-color-
|
|
72
|
+
border-top: 4px solid var(--adm-color-text-light-solid);
|
|
73
|
+
border-right: 4px solid var(--adm-color-text-light-solid);
|
|
74
74
|
transform: rotate(135deg);
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -7,7 +7,7 @@ interface ResultPageDetail {
|
|
|
7
7
|
bold?: boolean;
|
|
8
8
|
}
|
|
9
9
|
declare type ResultPageDetails = ResultPageDetail[];
|
|
10
|
-
declare type OnClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void
|
|
10
|
+
declare type OnClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void>;
|
|
11
11
|
export declare type ResultPageProps = {
|
|
12
12
|
status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
13
13
|
title: ReactNode;
|
|
@@ -31,7 +31,7 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
31
31
|
closeOnTouchOutside?: boolean | undefined;
|
|
32
32
|
closeOnAction?: boolean | undefined;
|
|
33
33
|
children: ReactNode;
|
|
34
|
-
stopPropagation?:
|
|
34
|
+
stopPropagation?: PropagationEvent[] | undefined;
|
|
35
35
|
onActionsReveal?: ((side: SideType) => void) | undefined;
|
|
36
36
|
} & {
|
|
37
37
|
className?: string | undefined;
|
|
@@ -3,7 +3,7 @@ export type { SwiperProps, SwiperRef } from './swiper';
|
|
|
3
3
|
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
4
4
|
defaultIndex?: number | undefined;
|
|
5
5
|
allowTouchMove?: boolean | undefined;
|
|
6
|
-
autoplay?: boolean | undefined;
|
|
6
|
+
autoplay?: boolean | "reverse" | undefined;
|
|
7
7
|
autoplayInterval?: number | undefined;
|
|
8
8
|
loop?: boolean | undefined;
|
|
9
9
|
direction?: "vertical" | "horizontal" | undefined;
|
|
@@ -16,7 +16,7 @@ export declare type SwiperRef = {
|
|
|
16
16
|
export declare type SwiperProps = {
|
|
17
17
|
defaultIndex?: number;
|
|
18
18
|
allowTouchMove?: boolean;
|
|
19
|
-
autoplay?: boolean;
|
|
19
|
+
autoplay?: boolean | 'reverse';
|
|
20
20
|
autoplayInterval?: number;
|
|
21
21
|
loop?: boolean;
|
|
22
22
|
direction?: 'horizontal' | 'vertical';
|
|
@@ -40,7 +40,7 @@ export declare type SwiperProps = {
|
|
|
40
40
|
export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
41
41
|
defaultIndex?: number | undefined;
|
|
42
42
|
allowTouchMove?: boolean | undefined;
|
|
43
|
-
autoplay?: boolean | undefined;
|
|
43
|
+
autoplay?: boolean | "reverse" | undefined;
|
|
44
44
|
autoplayInterval?: number | undefined;
|
|
45
45
|
loop?: boolean | undefined;
|
|
46
46
|
direction?: "vertical" | "horizontal" | undefined;
|
|
@@ -219,7 +219,11 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
219
219
|
} = props;
|
|
220
220
|
const runTimeSwiper = () => {
|
|
221
221
|
timeoutRef.current = window.setTimeout(() => {
|
|
222
|
-
|
|
222
|
+
if (autoplay === 'reverse') {
|
|
223
|
+
swipePrev();
|
|
224
|
+
} else {
|
|
225
|
+
swipeNext();
|
|
226
|
+
}
|
|
223
227
|
runTimeSwiper();
|
|
224
228
|
}, autoplayInterval);
|
|
225
229
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
|
-
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'name' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'name' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'onKeyDown'> & {
|
|
5
5
|
onChange?: (val: string) => void;
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
@@ -14,6 +14,8 @@ export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaH
|
|
|
14
14
|
maxRows?: number;
|
|
15
15
|
};
|
|
16
16
|
id?: string;
|
|
17
|
+
onEnterPress?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
18
|
+
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
17
19
|
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--disabled-color' | '--text-align' | '--count-text-align'>;
|
|
18
20
|
export declare type TextAreaRef = {
|
|
19
21
|
clear: () => void;
|
|
@@ -21,7 +23,7 @@ export declare type TextAreaRef = {
|
|
|
21
23
|
blur: () => void;
|
|
22
24
|
nativeElement: HTMLTextAreaElement | null;
|
|
23
25
|
};
|
|
24
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoFocus" | "name" | "readOnly" | "autoComplete"> & {
|
|
26
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "autoFocus" | "name" | "readOnly" | "autoComplete"> & {
|
|
25
27
|
onChange?: ((val: string) => void) | undefined;
|
|
26
28
|
value?: string | undefined;
|
|
27
29
|
defaultValue?: string | undefined;
|
|
@@ -34,6 +36,8 @@ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.Detail
|
|
|
34
36
|
maxRows?: number | undefined;
|
|
35
37
|
} | undefined;
|
|
36
38
|
id?: string | undefined;
|
|
39
|
+
onEnterPress?: ((e: React.KeyboardEvent<HTMLTextAreaElement>) => void) | undefined;
|
|
40
|
+
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
37
41
|
} & {
|
|
38
42
|
className?: string | undefined;
|
|
39
43
|
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--count-text-align", string>>) | undefined;
|
|
@@ -5,6 +5,7 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { mergeProps } from '../../utils/with-default-props';
|
|
7
7
|
import { devError } from '../../utils/dev-log';
|
|
8
|
+
import useInputHandleKeyDown from '../../components/input/useInputHandleKeyDown';
|
|
8
9
|
const classPrefix = 'adm-text-area';
|
|
9
10
|
const defaultProps = {
|
|
10
11
|
rows: 2,
|
|
@@ -30,6 +31,12 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
30
31
|
const heightRef = useRef('auto');
|
|
31
32
|
// https://github.com/ant-design/ant-design-mobile/issues/6051
|
|
32
33
|
const hiddenTextAreaRef = useRef(null);
|
|
34
|
+
const handleKeydown = useInputHandleKeyDown({
|
|
35
|
+
onEnterPress: props.onEnterPress,
|
|
36
|
+
onKeyDown: props.onKeyDown,
|
|
37
|
+
nativeInputRef: nativeTextAreaRef,
|
|
38
|
+
enterKeyHint: props.enterKeyHint
|
|
39
|
+
});
|
|
33
40
|
useImperativeHandle(ref, () => ({
|
|
34
41
|
clear: () => {
|
|
35
42
|
setValue('');
|
|
@@ -123,7 +130,8 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
123
130
|
name: props.name,
|
|
124
131
|
onFocus: props.onFocus,
|
|
125
132
|
onBlur: props.onBlur,
|
|
126
|
-
onClick: props.onClick
|
|
133
|
+
onClick: props.onClick,
|
|
134
|
+
onKeyDown: handleKeydown
|
|
127
135
|
}), count, autoSize && React.createElement("textarea", {
|
|
128
136
|
ref: hiddenTextAreaRef,
|
|
129
137
|
className: `${classPrefix}-element ${classPrefix}-element-hidden`,
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.adm-button-danger {
|
|
62
|
-
background-color: #
|
|
63
|
-
border-color: #
|
|
62
|
+
background-color: #ff3141;
|
|
63
|
+
border-color: #ff3141;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.adm-button-danger.adm-button-fill-outline,
|
|
67
67
|
.adm-button-danger.adm-button-fill-none {
|
|
68
|
-
color: #
|
|
68
|
+
color: #ff3141;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.adm-button-warning {
|
package/2x/es/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export { default as Checkbox } from './components/checkbox';
|
|
|
36
36
|
export type { CheckboxProps, CheckboxGroupProps, CheckboxRef, } from './components/checkbox';
|
|
37
37
|
export { default as Collapse } from './components/collapse';
|
|
38
38
|
export type { CollapseProps, CollapsePanelProps } from './components/collapse';
|
|
39
|
-
export { default as ConfigProvider } from './components/config-provider';
|
|
39
|
+
export { default as ConfigProvider, useConfig } from './components/config-provider';
|
|
40
40
|
export type { ConfigProviderProps } from './components/config-provider';
|
|
41
41
|
export { default as DatePicker } from './components/date-picker';
|
|
42
42
|
export type { DatePickerProps, DatePickerRef } from './components/date-picker';
|
package/2x/es/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { default as CenterPopup } from './components/center-popup';
|
|
|
18
18
|
export { default as CheckList } from './components/check-list';
|
|
19
19
|
export { default as Checkbox } from './components/checkbox';
|
|
20
20
|
export { default as Collapse } from './components/collapse';
|
|
21
|
-
export { default as ConfigProvider } from './components/config-provider';
|
|
21
|
+
export { default as ConfigProvider, useConfig } from './components/config-provider';
|
|
22
22
|
export { default as DatePicker } from './components/date-picker';
|
|
23
23
|
export { default as DatePickerView } from './components/date-picker-view';
|
|
24
24
|
export { default as Dialog } from './components/dialog';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
declare const arSA: {
|
|
2
|
+
locale: string;
|
|
3
|
+
common: {
|
|
4
|
+
confirm: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
loading: string;
|
|
7
|
+
close: string;
|
|
8
|
+
};
|
|
9
|
+
Calendar: {
|
|
10
|
+
title: string;
|
|
11
|
+
confirm: string;
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
today: string;
|
|
15
|
+
markItems: string[];
|
|
16
|
+
yearAndMonth: string;
|
|
17
|
+
};
|
|
18
|
+
Cascader: {
|
|
19
|
+
placeholder: string;
|
|
20
|
+
};
|
|
21
|
+
Dialog: {
|
|
22
|
+
ok: string;
|
|
23
|
+
};
|
|
24
|
+
DatePicker: {
|
|
25
|
+
tillNow: string;
|
|
26
|
+
};
|
|
27
|
+
ErrorBlock: {
|
|
28
|
+
default: {
|
|
29
|
+
title: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
busy: {
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
disconnected: {
|
|
37
|
+
title: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
empty: {
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
Form: {
|
|
46
|
+
required: string;
|
|
47
|
+
optional: string;
|
|
48
|
+
defaultValidateMessages: {
|
|
49
|
+
default: string;
|
|
50
|
+
required: string;
|
|
51
|
+
enum: string;
|
|
52
|
+
whitespace: string;
|
|
53
|
+
date: {
|
|
54
|
+
format: string;
|
|
55
|
+
parse: string;
|
|
56
|
+
invalid: string;
|
|
57
|
+
};
|
|
58
|
+
types: {
|
|
59
|
+
string: string;
|
|
60
|
+
method: string;
|
|
61
|
+
array: string;
|
|
62
|
+
object: string;
|
|
63
|
+
number: string;
|
|
64
|
+
date: string;
|
|
65
|
+
boolean: string;
|
|
66
|
+
integer: string;
|
|
67
|
+
float: string;
|
|
68
|
+
regexp: string;
|
|
69
|
+
email: string;
|
|
70
|
+
url: string;
|
|
71
|
+
hex: string;
|
|
72
|
+
};
|
|
73
|
+
string: {
|
|
74
|
+
len: string;
|
|
75
|
+
min: string;
|
|
76
|
+
max: string;
|
|
77
|
+
range: string;
|
|
78
|
+
};
|
|
79
|
+
number: {
|
|
80
|
+
len: string;
|
|
81
|
+
min: string;
|
|
82
|
+
max: string;
|
|
83
|
+
range: string;
|
|
84
|
+
};
|
|
85
|
+
array: {
|
|
86
|
+
len: string;
|
|
87
|
+
min: string;
|
|
88
|
+
max: string;
|
|
89
|
+
range: string;
|
|
90
|
+
};
|
|
91
|
+
pattern: {
|
|
92
|
+
mismatch: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
ImageUploader: {
|
|
97
|
+
uploading: string;
|
|
98
|
+
upload: string;
|
|
99
|
+
};
|
|
100
|
+
InfiniteScroll: {
|
|
101
|
+
noMore: string;
|
|
102
|
+
failedToLoad: string;
|
|
103
|
+
retry: string;
|
|
104
|
+
};
|
|
105
|
+
Input: {
|
|
106
|
+
clear: string;
|
|
107
|
+
};
|
|
108
|
+
Mask: {
|
|
109
|
+
name: string;
|
|
110
|
+
};
|
|
111
|
+
Modal: {
|
|
112
|
+
ok: string;
|
|
113
|
+
};
|
|
114
|
+
PasscodeInput: {
|
|
115
|
+
name: string;
|
|
116
|
+
};
|
|
117
|
+
PullToRefresh: {
|
|
118
|
+
pulling: string;
|
|
119
|
+
canRelease: string;
|
|
120
|
+
complete: string;
|
|
121
|
+
};
|
|
122
|
+
SearchBar: {
|
|
123
|
+
name: string;
|
|
124
|
+
};
|
|
125
|
+
Slider: {
|
|
126
|
+
name: string;
|
|
127
|
+
};
|
|
128
|
+
Stepper: {
|
|
129
|
+
decrease: string;
|
|
130
|
+
increase: string;
|
|
131
|
+
};
|
|
132
|
+
Switch: {
|
|
133
|
+
name: string;
|
|
134
|
+
};
|
|
135
|
+
Selector: {
|
|
136
|
+
name: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
export default arSA;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { mergeLocale } from '../utils/merge-locale';
|
|
2
|
+
import { base } from './base';
|
|
3
|
+
const typeTemplate = '${label} غير صالح ${type}';
|
|
4
|
+
const arSA = mergeLocale(base, {
|
|
5
|
+
'locale': 'ar-SA',
|
|
6
|
+
'common': {
|
|
7
|
+
'confirm': 'نعم',
|
|
8
|
+
'cancel': 'إلغاء',
|
|
9
|
+
'loading': 'جار التحميل',
|
|
10
|
+
'close': 'إغلاق'
|
|
11
|
+
},
|
|
12
|
+
'Calendar': {
|
|
13
|
+
'title': 'اختيار التاريخ',
|
|
14
|
+
'confirm': 'تأكيد',
|
|
15
|
+
'start': 'يبدأ',
|
|
16
|
+
'end': 'ينهي',
|
|
17
|
+
'today': 'اليوم',
|
|
18
|
+
'markItems': ['واحد', 'اثنين', 'ثلاثة', 'أربعة', 'خمسة', 'ستة', 'يوم'],
|
|
19
|
+
'yearAndMonth': '${year} سنة ${month} شهر'
|
|
20
|
+
},
|
|
21
|
+
'Cascader': {
|
|
22
|
+
'placeholder': 'اختر من فضلك'
|
|
23
|
+
},
|
|
24
|
+
'Dialog': {
|
|
25
|
+
'ok': 'عرفت'
|
|
26
|
+
},
|
|
27
|
+
'DatePicker': {
|
|
28
|
+
'tillNow': 'إلى اليوم'
|
|
29
|
+
},
|
|
30
|
+
'ErrorBlock': {
|
|
31
|
+
'default': {
|
|
32
|
+
'title': 'تواجه الصفحة بعض المشكلات البسيطة',
|
|
33
|
+
'description': 'حاول لاحقًا'
|
|
34
|
+
},
|
|
35
|
+
'busy': {
|
|
36
|
+
'title': 'الازدحام في الأمام',
|
|
37
|
+
'description': 'حاول التجديد'
|
|
38
|
+
},
|
|
39
|
+
'disconnected': {
|
|
40
|
+
'title': 'شبكة مشغولة',
|
|
41
|
+
'description': 'مرر أصابعك وساعد ف الإصلاح'
|
|
42
|
+
},
|
|
43
|
+
'empty': {
|
|
44
|
+
'title': 'لم أتمكن من العثور على ما تحتاجه',
|
|
45
|
+
'description': 'البحث عن شيء آخر'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
'Form': {
|
|
49
|
+
'required': 'مطلوب',
|
|
50
|
+
'optional': 'اختياري',
|
|
51
|
+
'defaultValidateMessages': {
|
|
52
|
+
'default': 'خطأ في التحقق من صحة الكلمات ${label}',
|
|
53
|
+
'required': 'يرجى إدخال ${label}',
|
|
54
|
+
'enum': '${label} يجب أن يكون واحدًا منهم [ ${enum} ]',
|
|
55
|
+
'whitespace': '${label} لا يمكن أن يكون حرفًا فارغًا',
|
|
56
|
+
'date': {
|
|
57
|
+
'format': '${label} تنسيق التاريخ غير صالح',
|
|
58
|
+
'parse': '${label} لا يمكن تحويله إلى تاريخ',
|
|
59
|
+
'invalid': '${label} تاريخ غير صالح'
|
|
60
|
+
},
|
|
61
|
+
'types': {
|
|
62
|
+
'string': typeTemplate,
|
|
63
|
+
'method': typeTemplate,
|
|
64
|
+
'array': typeTemplate,
|
|
65
|
+
'object': typeTemplate,
|
|
66
|
+
'number': typeTemplate,
|
|
67
|
+
'date': typeTemplate,
|
|
68
|
+
'boolean': typeTemplate,
|
|
69
|
+
'integer': typeTemplate,
|
|
70
|
+
'float': typeTemplate,
|
|
71
|
+
'regexp': typeTemplate,
|
|
72
|
+
'email': typeTemplate,
|
|
73
|
+
'url': typeTemplate,
|
|
74
|
+
'hex': typeTemplate
|
|
75
|
+
},
|
|
76
|
+
'string': {
|
|
77
|
+
'len': '${label} يجب أن يكون عدد الأحرف ${len}',
|
|
78
|
+
'min': '${label} أحرف على الأقل ${min}',
|
|
79
|
+
'max': '${label} الحد الأقصى لعدد الأحرف ${max}',
|
|
80
|
+
'range': '${label} يجب أن يكون بين ${min} - ${max} حرفًا'
|
|
81
|
+
},
|
|
82
|
+
'number': {
|
|
83
|
+
'len': '${label} يجب أن يساوي ${len}',
|
|
84
|
+
'min': '${label}الحد الأدنى للقيمة هو ${min}',
|
|
85
|
+
'max': '${label}القيمة القصوى هي ${max}',
|
|
86
|
+
'range': '${label} يجب أن يكون بين ${min} - ${max}'
|
|
87
|
+
},
|
|
88
|
+
'array': {
|
|
89
|
+
'len': 'يجب أن يكون ${len} ${label}',
|
|
90
|
+
'min': 'على الأقل ${min} ${label}',
|
|
91
|
+
'max': 'الحد الأقصى ${max} ${label}',
|
|
92
|
+
'range': '${label} يجب أن تكون الكمية بين ${min} - ${max}'
|
|
93
|
+
},
|
|
94
|
+
'pattern': {
|
|
95
|
+
'mismatch': '${label} لا يتطابق مع النمط ${pattern}'
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
'ImageUploader': {
|
|
100
|
+
'uploading': 'جارٍ التحميل...',
|
|
101
|
+
'upload': 'تحميل'
|
|
102
|
+
},
|
|
103
|
+
'InfiniteScroll': {
|
|
104
|
+
'noMore': '-لا يوجد أكثر-',
|
|
105
|
+
'failedToLoad': 'فشل التحميل',
|
|
106
|
+
'retry': 'إعادة التحميل'
|
|
107
|
+
},
|
|
108
|
+
'Input': {
|
|
109
|
+
'clear': 'إزالة'
|
|
110
|
+
},
|
|
111
|
+
'Mask': {
|
|
112
|
+
'name': 'قناع الخلفية'
|
|
113
|
+
},
|
|
114
|
+
'Modal': {
|
|
115
|
+
'ok': 'عرفت'
|
|
116
|
+
},
|
|
117
|
+
'PasscodeInput': {
|
|
118
|
+
'name': 'مربع إدخال كلمة المرور'
|
|
119
|
+
},
|
|
120
|
+
'PullToRefresh': {
|
|
121
|
+
'pulling': 'اسحب إلى الأسفل للتحديث',
|
|
122
|
+
'canRelease': 'حرر للتحديث على الفور',
|
|
123
|
+
'complete': 'تم التحديث بنجاح'
|
|
124
|
+
},
|
|
125
|
+
'SearchBar': {
|
|
126
|
+
'name': 'شريط البحث'
|
|
127
|
+
},
|
|
128
|
+
'Slider': {
|
|
129
|
+
'name': 'شريط الإدخال المنزلق'
|
|
130
|
+
},
|
|
131
|
+
'Stepper': {
|
|
132
|
+
'decrease': 'يقلل',
|
|
133
|
+
'increase': 'يزيد'
|
|
134
|
+
},
|
|
135
|
+
'Switch': {
|
|
136
|
+
'name': 'زر الفتح والإغلاق'
|
|
137
|
+
},
|
|
138
|
+
'Selector': {
|
|
139
|
+
'name': 'اختر مجموعة'
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
export default arSA;
|