antd-mobile 5.28.1 → 5.29.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 +549 -317
- package/2x/bundle/antd-mobile.cjs.js +10 -9
- package/2x/bundle/antd-mobile.es.development.js +549 -317
- package/2x/bundle/antd-mobile.es.js +7650 -7398
- package/2x/bundle/antd-mobile.umd.development.js +549 -317
- package/2x/bundle/antd-mobile.umd.js +10 -9
- package/2x/bundle/css-vars-patch.css +1 -0
- package/2x/bundle/style.css +45 -34
- package/2x/cjs/components/action-sheet/action-sheet.css +1 -1
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -2
- package/2x/cjs/components/avatar/avatar.d.ts +1 -1
- package/2x/cjs/components/avatar/avatar.js +2 -1
- package/2x/cjs/components/badge/badge.css +2 -2
- package/2x/cjs/components/button/button.css +2 -2
- package/2x/cjs/components/capsule-tabs/capsule-tabs.css +2 -2
- package/2x/cjs/components/check-list/check-list-item.js +3 -1
- package/2x/cjs/components/check-list/check-list.d.ts +1 -0
- package/2x/cjs/components/check-list/check-list.js +2 -0
- package/2x/cjs/components/check-list/context.d.ts +1 -0
- package/2x/cjs/components/checkbox/checkbox.css +2 -2
- package/2x/cjs/components/ellipsis/ellipsis.js +1 -1
- package/2x/cjs/components/image/image.css +1 -1
- package/2x/cjs/components/index-bar/index-bar.css +4 -4
- package/2x/cjs/components/input/input.d.ts +1 -1
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/2x/cjs/components/notice-bar/notice-bar.css +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +10 -6
- package/2x/cjs/components/popover/index.d.ts +1 -1
- package/2x/cjs/components/popover/popover.css +2 -2
- package/2x/cjs/components/popover/popover.d.ts +2 -2
- package/2x/cjs/components/popover/popover.js +1 -1
- package/2x/cjs/components/popover/popover.patch.css +1 -0
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/2x/cjs/components/radio/radio.css +2 -2
- package/2x/cjs/components/search-bar/search-bar.css +1 -1
- package/2x/cjs/components/selector/selector.css +1 -1
- package/2x/cjs/components/selector/selector.js +10 -2
- package/2x/cjs/components/side-bar/side-bar.css +1 -1
- package/2x/cjs/components/slider/slider.css +3 -3
- package/2x/cjs/components/stepper/index.d.ts +1 -1
- package/2x/cjs/components/stepper/stepper.css +2 -2
- package/2x/cjs/components/stepper/stepper.d.ts +4 -2
- package/2x/cjs/components/stepper/stepper.js +21 -3
- package/2x/cjs/components/swipe-action/swipe-action.css +1 -1
- package/2x/cjs/components/switch/switch.css +2 -2
- package/2x/cjs/components/tabs/tabs.js +5 -2
- package/2x/cjs/components/text-area/text-area.css +8 -0
- package/2x/cjs/components/text-area/text-area.d.ts +1 -1
- package/2x/cjs/components/text-area/text-area.js +12 -2
- package/2x/cjs/components/virtual-input/virtual-input.js +12 -2
- package/2x/cjs/global/css-vars-patch.css +1 -0
- package/2x/cjs/global/global.css +5 -2
- package/2x/cjs/global/theme-default.css +5 -2
- package/2x/cjs/index.d.ts +1 -1
- package/2x/cjs/locales/base.d.ts +3 -0
- package/2x/cjs/locales/base.js +3 -0
- package/2x/cjs/locales/en-US.d.ts +3 -0
- package/2x/cjs/locales/es-ES.d.ts +3 -0
- package/2x/cjs/locales/fa-IR.d.ts +3 -0
- package/2x/cjs/locales/fr-FR.d.ts +3 -0
- package/2x/cjs/locales/id-ID.d.ts +3 -0
- package/2x/cjs/locales/ja-JP.d.ts +3 -0
- package/2x/cjs/locales/kk-KZ.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.js +31 -2
- package/2x/cjs/locales/zh-CN.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.js +3 -0
- package/2x/cjs/locales/zh-HK.d.ts +3 -0
- package/2x/cjs/locales/zh-TW.d.ts +3 -0
- package/2x/cjs/utils/reduce-and-restore-motion.js +7 -6
- package/2x/cjs/utils/render-imperatively.js +9 -3
- package/2x/es/components/action-sheet/action-sheet.css +1 -1
- package/2x/es/components/action-sheet/action-sheet.js +6 -2
- package/2x/es/components/avatar/avatar.d.ts +1 -1
- package/2x/es/components/avatar/avatar.js +2 -1
- package/2x/es/components/badge/badge.css +2 -2
- package/2x/es/components/button/button.css +2 -2
- package/2x/es/components/capsule-tabs/capsule-tabs.css +2 -2
- package/2x/es/components/check-list/check-list-item.js +3 -1
- package/2x/es/components/check-list/check-list.d.ts +1 -0
- package/2x/es/components/check-list/check-list.js +2 -0
- package/2x/es/components/check-list/context.d.ts +1 -0
- package/2x/es/components/checkbox/checkbox.css +2 -2
- package/2x/es/components/ellipsis/ellipsis.js +1 -1
- package/2x/es/components/image/image.css +1 -1
- package/2x/es/components/index-bar/index-bar.css +4 -4
- package/2x/es/components/input/input.d.ts +1 -1
- package/2x/es/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/2x/es/components/notice-bar/notice-bar.css +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +10 -6
- package/2x/es/components/popover/index.d.ts +1 -1
- package/2x/es/components/popover/popover.css +2 -2
- package/2x/es/components/popover/popover.d.ts +2 -2
- package/2x/es/components/popover/popover.js +1 -1
- package/2x/es/components/popover/popover.patch.css +1 -0
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/2x/es/components/radio/radio.css +2 -2
- package/2x/es/components/search-bar/search-bar.css +1 -1
- package/2x/es/components/selector/selector.css +1 -1
- package/2x/es/components/selector/selector.js +10 -2
- package/2x/es/components/side-bar/side-bar.css +1 -1
- package/2x/es/components/slider/slider.css +3 -3
- package/2x/es/components/stepper/index.d.ts +1 -1
- package/2x/es/components/stepper/stepper.css +2 -2
- package/2x/es/components/stepper/stepper.d.ts +4 -2
- package/2x/es/components/stepper/stepper.js +19 -3
- package/2x/es/components/swipe-action/swipe-action.css +1 -1
- package/2x/es/components/switch/switch.css +2 -2
- package/2x/es/components/tabs/tabs.js +5 -2
- package/2x/es/components/text-area/text-area.css +8 -0
- package/2x/es/components/text-area/text-area.d.ts +1 -1
- package/2x/es/components/text-area/text-area.js +12 -2
- package/2x/es/components/virtual-input/virtual-input.js +12 -2
- package/2x/es/global/css-vars-patch.css +1 -0
- package/2x/es/global/global.css +5 -2
- package/2x/es/global/theme-default.css +5 -2
- package/2x/es/index.d.ts +1 -1
- package/2x/es/locales/base.d.ts +3 -0
- package/2x/es/locales/base.js +3 -0
- package/2x/es/locales/en-US.d.ts +3 -0
- package/2x/es/locales/es-ES.d.ts +3 -0
- package/2x/es/locales/fa-IR.d.ts +3 -0
- package/2x/es/locales/fr-FR.d.ts +3 -0
- package/2x/es/locales/id-ID.d.ts +3 -0
- package/2x/es/locales/ja-JP.d.ts +3 -0
- package/2x/es/locales/kk-KZ.d.ts +3 -0
- package/2x/es/locales/ko-KR.d.ts +3 -0
- package/2x/es/locales/ko-KR.js +31 -2
- package/2x/es/locales/zh-CN.d.ts +3 -0
- package/2x/es/locales/zh-CN.js +3 -0
- package/2x/es/locales/zh-HK.d.ts +3 -0
- package/2x/es/locales/zh-TW.d.ts +3 -0
- package/2x/es/utils/reduce-and-restore-motion.js +7 -6
- package/2x/es/utils/render-imperatively.js +9 -3
- package/2x/package.json +2 -2
- package/bundle/antd-mobile.cjs.development.js +549 -317
- package/bundle/antd-mobile.cjs.js +10 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +549 -317
- package/bundle/antd-mobile.es.js +7650 -7398
- package/bundle/antd-mobile.umd.development.js +549 -317
- package/bundle/antd-mobile.umd.js +10 -9
- package/bundle/css-vars-patch.css +1 -0
- package/bundle/style.css +1 -1
- package/cjs/components/action-sheet/action-sheet.css +1 -1
- package/cjs/components/action-sheet/action-sheet.js +6 -2
- package/cjs/components/avatar/avatar.d.ts +1 -1
- package/cjs/components/avatar/avatar.js +2 -1
- package/cjs/components/badge/badge.css +2 -2
- package/cjs/components/button/button.css +2 -2
- package/cjs/components/capsule-tabs/capsule-tabs.css +2 -2
- package/cjs/components/check-list/check-list-item.js +3 -1
- package/cjs/components/check-list/check-list.d.ts +1 -0
- package/cjs/components/check-list/check-list.js +2 -0
- package/cjs/components/check-list/context.d.ts +1 -0
- package/cjs/components/checkbox/checkbox.css +2 -2
- package/cjs/components/ellipsis/ellipsis.js +1 -1
- package/cjs/components/image/image.css +1 -1
- package/cjs/components/index-bar/index-bar.css +4 -4
- package/cjs/components/input/input.d.ts +1 -1
- package/cjs/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/cjs/components/notice-bar/notice-bar.css +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +10 -6
- package/cjs/components/popover/index.d.ts +1 -1
- package/cjs/components/popover/popover.css +2 -2
- package/cjs/components/popover/popover.d.ts +2 -2
- package/cjs/components/popover/popover.js +1 -1
- package/cjs/components/popover/popover.patch.css +1 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/cjs/components/radio/radio.css +2 -2
- package/cjs/components/search-bar/search-bar.css +1 -1
- package/cjs/components/selector/selector.css +1 -1
- package/cjs/components/selector/selector.js +10 -2
- package/cjs/components/side-bar/side-bar.css +1 -1
- package/cjs/components/slider/slider.css +3 -3
- package/cjs/components/stepper/index.d.ts +1 -1
- package/cjs/components/stepper/stepper.css +2 -2
- package/cjs/components/stepper/stepper.d.ts +4 -2
- package/cjs/components/stepper/stepper.js +21 -3
- package/cjs/components/swipe-action/swipe-action.css +1 -1
- package/cjs/components/switch/switch.css +2 -2
- package/cjs/components/tabs/tabs.js +5 -2
- package/cjs/components/text-area/text-area.css +7 -0
- package/cjs/components/text-area/text-area.d.ts +1 -1
- package/cjs/components/text-area/text-area.js +12 -2
- package/cjs/components/virtual-input/virtual-input.js +12 -2
- package/cjs/global/css-vars-patch.css +1 -0
- package/cjs/global/global.css +5 -2
- package/cjs/global/theme-default.css +5 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/locales/base.d.ts +3 -0
- package/cjs/locales/base.js +3 -0
- package/cjs/locales/en-US.d.ts +3 -0
- package/cjs/locales/es-ES.d.ts +3 -0
- package/cjs/locales/fa-IR.d.ts +3 -0
- package/cjs/locales/fr-FR.d.ts +3 -0
- package/cjs/locales/id-ID.d.ts +3 -0
- package/cjs/locales/ja-JP.d.ts +3 -0
- package/cjs/locales/kk-KZ.d.ts +3 -0
- package/cjs/locales/ko-KR.d.ts +3 -0
- package/cjs/locales/ko-KR.js +31 -2
- package/cjs/locales/zh-CN.d.ts +3 -0
- package/cjs/locales/zh-CN.js +3 -0
- package/cjs/locales/zh-HK.d.ts +3 -0
- package/cjs/locales/zh-TW.d.ts +3 -0
- package/cjs/utils/reduce-and-restore-motion.js +7 -6
- package/cjs/utils/render-imperatively.js +9 -3
- package/es/components/action-sheet/action-sheet.css +1 -1
- package/es/components/action-sheet/action-sheet.js +6 -2
- package/es/components/avatar/avatar.d.ts +1 -1
- package/es/components/avatar/avatar.js +2 -1
- package/es/components/badge/badge.css +2 -2
- package/es/components/button/button.css +2 -2
- package/es/components/capsule-tabs/capsule-tabs.css +2 -2
- package/es/components/check-list/check-list-item.js +3 -1
- package/es/components/check-list/check-list.d.ts +1 -0
- package/es/components/check-list/check-list.js +2 -0
- package/es/components/check-list/context.d.ts +1 -0
- package/es/components/checkbox/checkbox.css +2 -2
- package/es/components/ellipsis/ellipsis.js +1 -1
- package/es/components/image/image.css +1 -1
- package/es/components/index-bar/index-bar.css +4 -4
- package/es/components/input/input.d.ts +1 -1
- package/es/components/jumbo-tabs/jumbo-tabs.css +2 -2
- package/es/components/notice-bar/notice-bar.css +1 -1
- package/es/components/number-keyboard/number-keyboard.js +10 -6
- package/es/components/popover/index.d.ts +1 -1
- package/es/components/popover/popover.css +2 -2
- package/es/components/popover/popover.d.ts +2 -2
- package/es/components/popover/popover.js +1 -1
- package/es/components/popover/popover.patch.css +1 -0
- package/es/components/pull-to-refresh/pull-to-refresh.js +15 -16
- package/es/components/radio/radio.css +2 -2
- package/es/components/search-bar/search-bar.css +1 -1
- package/es/components/selector/selector.css +1 -1
- package/es/components/selector/selector.js +10 -2
- package/es/components/side-bar/side-bar.css +1 -1
- package/es/components/slider/slider.css +3 -3
- package/es/components/stepper/index.d.ts +1 -1
- package/es/components/stepper/stepper.css +2 -2
- package/es/components/stepper/stepper.d.ts +4 -2
- package/es/components/stepper/stepper.js +19 -3
- package/es/components/swipe-action/swipe-action.css +1 -1
- package/es/components/switch/switch.css +2 -2
- package/es/components/tabs/tabs.js +5 -2
- package/es/components/text-area/text-area.css +7 -0
- package/es/components/text-area/text-area.d.ts +1 -1
- package/es/components/text-area/text-area.js +12 -2
- package/es/components/virtual-input/virtual-input.js +12 -2
- package/es/global/css-vars-patch.css +1 -0
- package/es/global/global.css +5 -2
- package/es/global/theme-default.css +5 -2
- package/es/index.d.ts +1 -1
- package/es/locales/base.d.ts +3 -0
- package/es/locales/base.js +3 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/es-ES.d.ts +3 -0
- package/es/locales/fa-IR.d.ts +3 -0
- package/es/locales/fr-FR.d.ts +3 -0
- package/es/locales/id-ID.d.ts +3 -0
- package/es/locales/ja-JP.d.ts +3 -0
- package/es/locales/kk-KZ.d.ts +3 -0
- package/es/locales/ko-KR.d.ts +3 -0
- package/es/locales/ko-KR.js +31 -2
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +3 -0
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/utils/reduce-and-restore-motion.js +7 -6
- package/es/utils/render-imperatively.js +9 -3
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
- package/umd/antd-mobile.js.LICENSE.txt +5 -4
|
@@ -108,7 +108,7 @@ const Popover = (0, _react.forwardRef)((p, ref) => {
|
|
|
108
108
|
top: arrowY != null ? `${arrowY}px` : '',
|
|
109
109
|
right: '',
|
|
110
110
|
bottom: '',
|
|
111
|
-
[arrowSide]:
|
|
111
|
+
[arrowSide]: 'calc(var(--arrow-size) * -1)'
|
|
112
112
|
});
|
|
113
113
|
const arrowRotate = {
|
|
114
114
|
top: '0deg',
|
|
@@ -59,6 +59,19 @@ const PullToRefresh = p => {
|
|
|
59
59
|
var _a;
|
|
60
60
|
(_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('touchmove', () => {});
|
|
61
61
|
}, []);
|
|
62
|
+
const reset = () => {
|
|
63
|
+
return new Promise(resolve => {
|
|
64
|
+
api.start({
|
|
65
|
+
to: {
|
|
66
|
+
height: 0
|
|
67
|
+
},
|
|
68
|
+
onResolve() {
|
|
69
|
+
setStatus('pulling');
|
|
70
|
+
resolve();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
62
75
|
function doRefresh() {
|
|
63
76
|
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
64
77
|
api.start({
|
|
@@ -69,27 +82,13 @@ const PullToRefresh = p => {
|
|
|
69
82
|
yield props.onRefresh();
|
|
70
83
|
setStatus('complete');
|
|
71
84
|
} catch (e) {
|
|
72
|
-
|
|
73
|
-
to: next => (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
74
|
-
yield next({
|
|
75
|
-
height: 0
|
|
76
|
-
});
|
|
77
|
-
setStatus('pulling');
|
|
78
|
-
})
|
|
79
|
-
});
|
|
85
|
+
reset();
|
|
80
86
|
throw e;
|
|
81
87
|
}
|
|
82
88
|
if (props.completeDelay > 0) {
|
|
83
89
|
yield (0, _sleep.sleep)(props.completeDelay);
|
|
84
90
|
}
|
|
85
|
-
|
|
86
|
-
to: next => (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
87
|
-
yield next({
|
|
88
|
-
height: 0
|
|
89
|
-
});
|
|
90
|
-
setStatus('pulling');
|
|
91
|
-
})
|
|
92
|
-
});
|
|
91
|
+
reset();
|
|
93
92
|
});
|
|
94
93
|
}
|
|
95
94
|
(0, _react.useDrag)(state => {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
width: var(--icon-size);
|
|
22
22
|
height: var(--icon-size);
|
|
23
|
-
color: var(--adm-color-
|
|
23
|
+
color: var(--adm-color-text-light-solid);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.adm-radio .adm-radio-icon > svg {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
.adm-radio.adm-radio-disabled .adm-radio-icon {
|
|
50
50
|
color: #b7b7b7;
|
|
51
51
|
border-color: var(--adm-color-light);
|
|
52
|
-
background-color: var(--adm-color-
|
|
52
|
+
background-color: var(--adm-color-fill-content);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.adm-radio .adm-radio-custom-icon {
|
|
@@ -12,6 +12,7 @@ var _space = _interopRequireDefault(require("../space"));
|
|
|
12
12
|
var _grid = _interopRequireDefault(require("../grid"));
|
|
13
13
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
14
14
|
var _checkMark = require("./check-mark");
|
|
15
|
+
var _configProvider = require("../config-provider");
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
const classPrefix = `adm-selector`;
|
|
17
18
|
const defaultProps = {
|
|
@@ -34,6 +35,9 @@ const Selector = p => {
|
|
|
34
35
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, val, extend);
|
|
35
36
|
}
|
|
36
37
|
});
|
|
38
|
+
const {
|
|
39
|
+
locale
|
|
40
|
+
} = (0, _configProvider.useConfig)();
|
|
37
41
|
const items = props.options.map(option => {
|
|
38
42
|
const active = (value || []).includes(option.value);
|
|
39
43
|
const disabled = option.disabled || props.disabled;
|
|
@@ -56,7 +60,9 @@ const Selector = p => {
|
|
|
56
60
|
const val = active ? [] : [option.value];
|
|
57
61
|
setValue(val);
|
|
58
62
|
}
|
|
59
|
-
}
|
|
63
|
+
},
|
|
64
|
+
role: 'option',
|
|
65
|
+
"aria-selected": active && !props.multiple || active && props.multiple
|
|
60
66
|
}, option.label, option.description && _react.default.createElement("div", {
|
|
61
67
|
className: `${classPrefix}-item-description`
|
|
62
68
|
}, option.description), active && props.showCheckMark && _react.default.createElement("div", {
|
|
@@ -64,7 +70,9 @@ const Selector = p => {
|
|
|
64
70
|
}, _react.default.createElement(_checkMark.CheckMark, null)));
|
|
65
71
|
});
|
|
66
72
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
67
|
-
className: classPrefix
|
|
73
|
+
className: classPrefix,
|
|
74
|
+
role: 'listbox',
|
|
75
|
+
"aria-label": locale.Selector.name
|
|
68
76
|
}, !props.columns && _react.default.createElement(_space.default, {
|
|
69
77
|
wrap: true
|
|
70
78
|
}, items), props.columns && _react.default.createElement(_grid.default, {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
position: relative;
|
|
15
15
|
width: 100%;
|
|
16
16
|
height: 6px;
|
|
17
|
-
background-color: var(--adm-color-
|
|
17
|
+
background-color: var(--adm-color-fill-content);
|
|
18
18
|
border-radius: 6px;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
width: 14px;
|
|
40
40
|
height: 14px;
|
|
41
41
|
margin-left: -6px;
|
|
42
|
-
background-color: var(--adm-color-
|
|
42
|
+
background-color: var(--adm-color-fill-content);
|
|
43
43
|
border-radius: 50%;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
border-radius: 50%;
|
|
55
55
|
text-align: center;
|
|
56
56
|
line-height: 56px;
|
|
57
|
-
background: var(--adm-color-
|
|
57
|
+
background: var(--adm-color-text-light-solid);
|
|
58
58
|
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.12);
|
|
59
59
|
color: var(--fill-color);
|
|
60
60
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
--input-width: 88px;
|
|
4
4
|
--input-font-size: var(--adm-font-size-main);
|
|
5
5
|
--input-font-color: var(--adm-color-text);
|
|
6
|
-
--input-background-color: var(--adm-color-
|
|
6
|
+
--input-background-color: var(--adm-color-fill-content);
|
|
7
7
|
--border-radius: 4px;
|
|
8
8
|
--border: none;
|
|
9
9
|
--border-inner: solid 4px transparent;
|
|
10
10
|
--active-border: var(--border);
|
|
11
11
|
--button-font-size: var(--adm-font-size-7);
|
|
12
12
|
--button-text-color: var(--adm-color-primary);
|
|
13
|
-
--button-background-color: var(--adm-color-
|
|
13
|
+
--button-background-color: var(--adm-color-fill-content);
|
|
14
14
|
--button-width: var(--height);
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
import { InputProps } from '../input';
|
|
3
|
+
import { InputProps, InputRef } from '../input';
|
|
4
4
|
declare type ValueProps<ValueType> = {
|
|
5
5
|
allowEmpty: true;
|
|
6
6
|
value?: ValueType | null;
|
|
@@ -30,5 +30,7 @@ export declare type StringStepperProps = BaseStepperProps<string> & {
|
|
|
30
30
|
stringMode: true;
|
|
31
31
|
};
|
|
32
32
|
export declare type StepperProps = NumberStepperProps | StringStepperProps;
|
|
33
|
-
export declare
|
|
33
|
+
export declare type StepperRef = Pick<InputRef, 'blur' | 'focus' | 'nativeElement'>;
|
|
34
|
+
export declare function InnerStepper<ValueType extends number | string>(p: StepperProps, ref: React.ForwardedRef<StepperRef>): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
35
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<StepperRef>>;
|
|
34
36
|
export {};
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.InnerStepper = InnerStepper;
|
|
7
|
+
exports.Stepper = void 0;
|
|
7
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _antdMobileIcons = require("antd-mobile-icons");
|
|
@@ -23,7 +24,7 @@ const defaultProps = {
|
|
|
23
24
|
disabled: false,
|
|
24
25
|
allowEmpty: false
|
|
25
26
|
};
|
|
26
|
-
function
|
|
27
|
+
function InnerStepper(p, ref) {
|
|
27
28
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
28
29
|
const {
|
|
29
30
|
defaultValue = 0,
|
|
@@ -42,6 +43,21 @@ function Stepper(p) {
|
|
|
42
43
|
const {
|
|
43
44
|
locale
|
|
44
45
|
} = (0, _configProvider.useConfig)();
|
|
46
|
+
// ========================== Ref ==========================
|
|
47
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
48
|
+
focus: () => {
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
51
|
+
},
|
|
52
|
+
blur: () => {
|
|
53
|
+
var _a;
|
|
54
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
55
|
+
},
|
|
56
|
+
get nativeElement() {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
return (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) !== null && _b !== void 0 ? _b : null;
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
45
61
|
// ========================== Parse / Format ==========================
|
|
46
62
|
const fixedValue = value => {
|
|
47
63
|
const fixedValue = digits !== undefined ? (0, _miniDecimal.toFixed)(value.toString(), '.', digits) : value;
|
|
@@ -209,4 +225,6 @@ function Stepper(p) {
|
|
|
209
225
|
color: 'primary',
|
|
210
226
|
"aria-label": locale.Stepper.increase
|
|
211
227
|
}, _react.default.createElement(_antdMobileIcons.AddOutline, null))));
|
|
212
|
-
}
|
|
228
|
+
}
|
|
229
|
+
const Stepper = (0, _react.forwardRef)(InnerStepper);
|
|
230
|
+
exports.Stepper = Stepper;
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
width: calc(var(--height) - 2 * var(--border-width));
|
|
58
58
|
height: calc(var(--height) - 2 * var(--border-width));
|
|
59
59
|
border-radius: calc(var(--height) - 2 * var(--border-width));
|
|
60
|
-
background: var(--adm-color-
|
|
60
|
+
background: var(--adm-color-text-light-solid);
|
|
61
61
|
position: absolute;
|
|
62
62
|
z-index: 2;
|
|
63
63
|
top: var(--border-width);
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
|
|
94
94
|
.adm-switch.adm-switch-checked .adm-switch-inner {
|
|
95
95
|
margin: 0 calc(var(--height) - var(--border-width) + 10px) 0 20px;
|
|
96
|
-
color: var(--adm-color-
|
|
96
|
+
color: var(--adm-color-text-light-solid);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.adm-switch.adm-switch-disabled {
|
|
@@ -192,7 +192,8 @@ const Tabs = p => {
|
|
|
192
192
|
className: `${classPrefix}-tab-list`,
|
|
193
193
|
ref: tabListContainerRef,
|
|
194
194
|
scrollLeft: scrollLeft,
|
|
195
|
-
onScroll: updateMask
|
|
195
|
+
onScroll: updateMask,
|
|
196
|
+
role: 'tablist'
|
|
196
197
|
}, _react.default.createElement(_web.animated.div, {
|
|
197
198
|
ref: activeLineRef,
|
|
198
199
|
className: `${classPrefix}-tab-line`,
|
|
@@ -219,7 +220,9 @@ const Tabs = p => {
|
|
|
219
220
|
className: (0, _classnames.default)(`${classPrefix}-tab`, {
|
|
220
221
|
[`${classPrefix}-tab-active`]: pane.key === activeKey,
|
|
221
222
|
[`${classPrefix}-tab-disabled`]: pane.props.disabled
|
|
222
|
-
})
|
|
223
|
+
}),
|
|
224
|
+
role: 'tab',
|
|
225
|
+
"aria-selected": pane.key === activeKey
|
|
223
226
|
}, pane.props.title)))))), panes.map(pane => {
|
|
224
227
|
if (pane.props.children === undefined) {
|
|
225
228
|
return null;
|
|
@@ -70,6 +70,14 @@
|
|
|
70
70
|
pointer-events: none;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
.adm-text-area-element-hidden {
|
|
74
|
+
visibility: hidden;
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
z-index: -1000;
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
.adm-text-area-count {
|
|
74
82
|
text-align: var(--count-text-align);
|
|
75
83
|
color: var(--adm-color-weak);
|
|
@@ -21,7 +21,7 @@ export declare type TextAreaRef = {
|
|
|
21
21
|
blur: () => void;
|
|
22
22
|
nativeElement: HTMLTextAreaElement | null;
|
|
23
23
|
};
|
|
24
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "
|
|
24
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoFocus" | "autoComplete" | "readOnly"> & {
|
|
25
25
|
onChange?: ((val: string) => void) | undefined;
|
|
26
26
|
value?: string | undefined;
|
|
27
27
|
defaultValue?: string | undefined;
|
|
@@ -35,6 +35,8 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
35
35
|
const nativeTextAreaRef = (0, _react.useRef)(null);
|
|
36
36
|
// https://github.com/ant-design/ant-design-mobile/issues/5961
|
|
37
37
|
const heightRef = (0, _react.useRef)('auto');
|
|
38
|
+
// https://github.com/ant-design/ant-design-mobile/issues/6051
|
|
39
|
+
const hiddenTextAreaRef = (0, _react.useRef)(null);
|
|
38
40
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
39
41
|
clear: () => {
|
|
40
42
|
setValue('');
|
|
@@ -54,9 +56,11 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
54
56
|
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
55
57
|
if (!autoSize) return;
|
|
56
58
|
const textArea = nativeTextAreaRef.current;
|
|
59
|
+
const hiddenTextArea = hiddenTextAreaRef.current;
|
|
57
60
|
if (!textArea) return;
|
|
58
61
|
textArea.style.height = heightRef.current;
|
|
59
|
-
|
|
62
|
+
if (!hiddenTextArea) return;
|
|
63
|
+
let height = hiddenTextArea.scrollHeight;
|
|
60
64
|
if (typeof autoSize === 'object') {
|
|
61
65
|
const computedStyle = window.getComputedStyle(textArea);
|
|
62
66
|
const lineHeight = parseFloat(computedStyle.lineHeight);
|
|
@@ -118,7 +122,13 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
118
122
|
onFocus: props.onFocus,
|
|
119
123
|
onBlur: props.onBlur,
|
|
120
124
|
onClick: props.onClick
|
|
121
|
-
}), count
|
|
125
|
+
}), count, autoSize && _react.default.createElement("textarea", {
|
|
126
|
+
ref: hiddenTextAreaRef,
|
|
127
|
+
className: `${classPrefix}-element ${classPrefix}-element-hidden`,
|
|
128
|
+
value: value,
|
|
129
|
+
"aria-hidden": true,
|
|
130
|
+
readOnly: true
|
|
131
|
+
})));
|
|
122
132
|
});
|
|
123
133
|
exports.TextArea = TextArea;
|
|
124
134
|
TextArea.defaultProps = defaultProps;
|
|
@@ -11,6 +11,7 @@ var _usePropsValue = require("../../utils/use-props-value");
|
|
|
11
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
12
|
var _antdMobileIcons = require("antd-mobile-icons");
|
|
13
13
|
var _ahooks = require("ahooks");
|
|
14
|
+
var _configProvider = require("../config-provider");
|
|
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; }
|
|
@@ -24,6 +25,9 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
24
25
|
const rootRef = (0, _react.useRef)(null);
|
|
25
26
|
const contentRef = (0, _react.useRef)(null);
|
|
26
27
|
const [hasFocus, setHasFocus] = (0, _react.useState)(false);
|
|
28
|
+
const {
|
|
29
|
+
locale
|
|
30
|
+
} = (0, _configProvider.useConfig)();
|
|
27
31
|
function scrollToEnd() {
|
|
28
32
|
const root = rootRef.current;
|
|
29
33
|
if (!root) return;
|
|
@@ -93,7 +97,11 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
93
97
|
onClick: props.onClick
|
|
94
98
|
}, _react.default.createElement("div", {
|
|
95
99
|
className: `${classPrefix}-content`,
|
|
96
|
-
ref: contentRef
|
|
100
|
+
ref: contentRef,
|
|
101
|
+
role: 'option',
|
|
102
|
+
tabIndex: props.disabled ? undefined : 0,
|
|
103
|
+
"aria-disabled": props.disabled,
|
|
104
|
+
"aria-label": props.placeholder
|
|
97
105
|
}, value, _react.default.createElement("div", {
|
|
98
106
|
className: `${classPrefix}-caret-container`
|
|
99
107
|
}, hasFocus && _react.default.createElement("div", {
|
|
@@ -105,7 +113,9 @@ const VirtualInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
105
113
|
e.stopPropagation();
|
|
106
114
|
setValue('');
|
|
107
115
|
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
108
|
-
}
|
|
116
|
+
},
|
|
117
|
+
role: 'button',
|
|
118
|
+
"aria-label": locale.Input.clear
|
|
109
119
|
}, _react.default.createElement(_antdMobileIcons.CloseCircleFill, null)), !value && _react.default.createElement("div", {
|
|
110
120
|
className: `${classPrefix}-placeholder`
|
|
111
121
|
}, props.placeholder), keyboardElement));
|
package/2x/cjs/global/global.css
CHANGED
|
@@ -16,14 +16,17 @@
|
|
|
16
16
|
--adm-color-success: #00b578;
|
|
17
17
|
--adm-color-warning: #ff8f1f;
|
|
18
18
|
--adm-color-danger: #ff3141;
|
|
19
|
-
--adm-color-white: #ffffff;
|
|
20
19
|
--adm-color-text: #333333;
|
|
21
20
|
--adm-color-text-secondary: #666666;
|
|
22
21
|
--adm-color-weak: #999999;
|
|
23
22
|
--adm-color-light: #cccccc;
|
|
24
23
|
--adm-color-border: #eeeeee;
|
|
25
|
-
--adm-color-box: #f5f5f5;
|
|
26
24
|
--adm-color-background: #ffffff;
|
|
25
|
+
--adm-color-white: #ffffff;
|
|
26
|
+
--adm-color-box: #f5f5f5;
|
|
27
|
+
--adm-color-text-light-solid: var(--adm-color-white);
|
|
28
|
+
--adm-color-text-dark-solid: #000000;
|
|
29
|
+
--adm-color-fill-content: var(--adm-color-box);
|
|
27
30
|
--adm-font-size-main: var(--adm-font-size-5);
|
|
28
31
|
--adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
|
|
29
32
|
helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
|
|
@@ -16,14 +16,17 @@
|
|
|
16
16
|
--adm-color-success: #00b578;
|
|
17
17
|
--adm-color-warning: #ff8f1f;
|
|
18
18
|
--adm-color-danger: #ff3141;
|
|
19
|
-
--adm-color-white: #ffffff;
|
|
20
19
|
--adm-color-text: #333333;
|
|
21
20
|
--adm-color-text-secondary: #666666;
|
|
22
21
|
--adm-color-weak: #999999;
|
|
23
22
|
--adm-color-light: #cccccc;
|
|
24
23
|
--adm-color-border: #eeeeee;
|
|
25
|
-
--adm-color-box: #f5f5f5;
|
|
26
24
|
--adm-color-background: #ffffff;
|
|
25
|
+
--adm-color-white: #ffffff;
|
|
26
|
+
--adm-color-box: #f5f5f5;
|
|
27
|
+
--adm-color-text-light-solid: var(--adm-color-white);
|
|
28
|
+
--adm-color-text-dark-solid: #000000;
|
|
29
|
+
--adm-color-fill-content: var(--adm-color-box);
|
|
27
30
|
--adm-font-size-main: var(--adm-font-size-5);
|
|
28
31
|
--adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
|
|
29
32
|
helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
|
package/2x/cjs/index.d.ts
CHANGED
|
@@ -133,7 +133,7 @@ export type { SpaceProps } from './components/space';
|
|
|
133
133
|
export { default as SpinLoading } from './components/spin-loading';
|
|
134
134
|
export type { SpinLoadingProps } from './components/spin-loading';
|
|
135
135
|
export { default as Stepper } from './components/stepper';
|
|
136
|
-
export type { StepperProps } from './components/stepper';
|
|
136
|
+
export type { StepperProps, StepperRef } from './components/stepper';
|
|
137
137
|
export { default as Steps } from './components/steps';
|
|
138
138
|
export type { StepsProps, StepProps } from './components/steps';
|
|
139
139
|
export { default as SwipeAction } from './components/swipe-action';
|
package/2x/cjs/locales/base.d.ts
CHANGED
package/2x/cjs/locales/base.js
CHANGED
package/2x/cjs/locales/ko-KR.js
CHANGED
|
@@ -12,7 +12,8 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
12
12
|
common: {
|
|
13
13
|
confirm: '확인',
|
|
14
14
|
cancel: '취소',
|
|
15
|
-
loading: '로딩중'
|
|
15
|
+
loading: '로딩중',
|
|
16
|
+
close: '닫기'
|
|
16
17
|
},
|
|
17
18
|
Calendar: {
|
|
18
19
|
markItems: ['월', '화', '수', '목', '금', '토', '일'],
|
|
@@ -24,6 +25,9 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
24
25
|
Dialog: {
|
|
25
26
|
ok: '확인'
|
|
26
27
|
},
|
|
28
|
+
DatePicker: {
|
|
29
|
+
tillNow: '지금까지'
|
|
30
|
+
},
|
|
27
31
|
ErrorBlock: {
|
|
28
32
|
default: {
|
|
29
33
|
title: '문제가 발생했습니다',
|
|
@@ -94,7 +98,16 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
94
98
|
}
|
|
95
99
|
},
|
|
96
100
|
ImageUploader: {
|
|
97
|
-
uploading: '업로드 중...'
|
|
101
|
+
uploading: '업로드 중...',
|
|
102
|
+
upload: '업로드'
|
|
103
|
+
},
|
|
104
|
+
InfiniteScroll: {
|
|
105
|
+
noMore: '불러올 데이터 없음',
|
|
106
|
+
failedToLoad: '불러오기 실패',
|
|
107
|
+
retry: '재시도'
|
|
108
|
+
},
|
|
109
|
+
Input: {
|
|
110
|
+
clear: '지우기'
|
|
98
111
|
},
|
|
99
112
|
Mask: {
|
|
100
113
|
name: '마스크'
|
|
@@ -102,10 +115,26 @@ const koKR = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
102
115
|
Modal: {
|
|
103
116
|
ok: '확인'
|
|
104
117
|
},
|
|
118
|
+
PasscodeInput: {
|
|
119
|
+
name: '비밀번호 입력'
|
|
120
|
+
},
|
|
105
121
|
PullToRefresh: {
|
|
106
122
|
pulling: '스크롤을 당겨서 새로고침하십시오',
|
|
107
123
|
canRelease: '새로고침 하려면 놓으십시오',
|
|
108
124
|
complete: '새로고침 완료'
|
|
125
|
+
},
|
|
126
|
+
SearchBar: {
|
|
127
|
+
name: '검색바'
|
|
128
|
+
},
|
|
129
|
+
Slider: {
|
|
130
|
+
name: '슬라이더'
|
|
131
|
+
},
|
|
132
|
+
Stepper: {
|
|
133
|
+
decrease: '감소',
|
|
134
|
+
increase: '증가'
|
|
135
|
+
},
|
|
136
|
+
Switch: {
|
|
137
|
+
name: '스위치'
|
|
109
138
|
}
|
|
110
139
|
});
|
|
111
140
|
var _default = koKR;
|