antd-mobile 5.15.1 → 5.16.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/README.md +30 -16
- package/2x/bundle/antd-mobile.cjs.js +322 -193
- package/2x/bundle/antd-mobile.es.js +323 -194
- package/2x/bundle/style.css +66 -13
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -2
- package/2x/cjs/components/cascader/cascader.d.ts +29 -4
- package/2x/cjs/components/cascader/cascader.js +41 -19
- package/2x/cjs/components/cascader/index.d.ts +21 -2
- package/2x/cjs/components/center-popup/center-popup.css +11 -0
- package/2x/cjs/components/center-popup/center-popup.d.ts +3 -20
- package/2x/cjs/components/center-popup/center-popup.js +24 -13
- package/2x/cjs/components/date-picker/date-picker.d.ts +2 -2
- package/2x/cjs/components/date-picker/date-picker.js +3 -1
- package/2x/cjs/components/date-picker/index.d.ts +1 -1
- package/2x/cjs/components/input/input.css +4 -0
- package/2x/cjs/components/input/input.d.ts +7 -4
- package/2x/cjs/components/input/input.js +5 -1
- package/2x/cjs/components/list/index.d.ts +10 -2
- package/2x/cjs/components/list/list.d.ts +13 -2
- package/2x/cjs/components/list/list.js +16 -6
- package/2x/cjs/components/modal/modal-action-button.d.ts +2 -2
- package/2x/cjs/components/modal/modal.css +0 -9
- package/2x/cjs/components/modal/modal.js +4 -11
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/2x/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/2x/cjs/components/picker/index.d.ts +2 -6
- package/2x/cjs/components/picker/picker.d.ts +2 -6
- package/2x/cjs/components/picker/picker.js +8 -7
- package/2x/cjs/components/picker-view/picker-view.css +1 -0
- package/2x/cjs/components/picker-view/wheel.js +10 -8
- package/2x/cjs/components/popup/popup-base-props.d.ts +35 -0
- package/2x/cjs/components/popup/popup-base-props.js +18 -0
- package/2x/cjs/components/popup/popup.css +32 -0
- package/2x/cjs/components/popup/popup.d.ts +3 -19
- package/2x/cjs/components/popup/popup.js +43 -18
- package/2x/cjs/components/progress-bar/progress-bar.css +17 -3
- package/2x/cjs/components/progress-bar/progress-bar.d.ts +4 -2
- package/2x/cjs/components/progress-bar/progress-bar.js +27 -5
- package/2x/cjs/components/slider/slider.js +2 -1
- package/2x/cjs/components/slider/thumb.d.ts +2 -1
- package/2x/cjs/components/slider/thumb.js +13 -1
- package/2x/cjs/components/stepper/stepper.js +14 -3
- package/2x/cjs/components/steps/steps.css +1 -1
- package/2x/cjs/locales/base.d.ts +7 -0
- package/2x/cjs/locales/base.js +7 -0
- package/2x/cjs/locales/en-US.d.ts +7 -0
- package/2x/cjs/locales/es-ES.d.ts +7 -0
- package/2x/cjs/locales/fa-IR.d.ts +7 -0
- package/2x/cjs/locales/fr-FR.d.ts +7 -0
- package/2x/cjs/locales/id-ID.d.ts +118 -0
- package/2x/cjs/locales/id-ID.js +121 -0
- package/2x/cjs/locales/kk-KZ.d.ts +118 -0
- package/2x/cjs/locales/kk-KZ.js +124 -0
- package/2x/cjs/locales/ko-KR.d.ts +7 -0
- package/2x/cjs/locales/zh-CN.d.ts +7 -0
- package/2x/cjs/locales/zh-CN.js +7 -0
- package/2x/cjs/locales/zh-HK.d.ts +7 -0
- package/2x/cjs/locales/zh-TW.d.ts +7 -0
- package/2x/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/2x/es/components/action-sheet/action-sheet.js +6 -2
- package/2x/es/components/cascader/cascader.d.ts +29 -4
- package/2x/es/components/cascader/cascader.js +42 -18
- package/2x/es/components/cascader/index.d.ts +21 -2
- package/2x/es/components/center-popup/center-popup.css +11 -0
- package/2x/es/components/center-popup/center-popup.d.ts +3 -20
- package/2x/es/components/center-popup/center-popup.js +22 -13
- package/2x/es/components/date-picker/date-picker.d.ts +2 -2
- package/2x/es/components/date-picker/date-picker.js +3 -1
- package/2x/es/components/date-picker/index.d.ts +1 -1
- package/2x/es/components/input/input.css +4 -0
- package/2x/es/components/input/input.d.ts +7 -4
- package/2x/es/components/input/input.js +5 -1
- package/2x/es/components/list/index.d.ts +10 -2
- package/2x/es/components/list/list.d.ts +13 -2
- package/2x/es/components/list/list.js +12 -4
- package/2x/es/components/modal/modal-action-button.d.ts +2 -2
- package/2x/es/components/modal/modal.css +0 -9
- package/2x/es/components/modal/modal.js +4 -10
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/2x/es/components/number-keyboard/number-keyboard.js +13 -7
- package/2x/es/components/picker/index.d.ts +2 -6
- package/2x/es/components/picker/picker.d.ts +2 -6
- package/2x/es/components/picker/picker.js +8 -6
- package/2x/es/components/picker-view/picker-view.css +1 -0
- package/2x/es/components/picker-view/wheel.js +10 -8
- package/2x/es/components/popup/popup-base-props.d.ts +35 -0
- package/2x/es/components/popup/popup-base-props.js +11 -0
- package/2x/es/components/popup/popup.css +32 -0
- package/2x/es/components/popup/popup.d.ts +3 -19
- package/2x/es/components/popup/popup.js +41 -19
- package/2x/es/components/progress-bar/progress-bar.css +17 -3
- package/2x/es/components/progress-bar/progress-bar.d.ts +4 -2
- package/2x/es/components/progress-bar/progress-bar.js +25 -5
- package/2x/es/components/slider/slider.js +2 -1
- package/2x/es/components/slider/thumb.d.ts +2 -1
- package/2x/es/components/slider/thumb.js +12 -1
- package/2x/es/components/stepper/stepper.js +13 -3
- package/2x/es/components/steps/steps.css +1 -1
- package/2x/es/locales/base.d.ts +7 -0
- package/2x/es/locales/base.js +7 -0
- package/2x/es/locales/en-US.d.ts +7 -0
- package/2x/es/locales/es-ES.d.ts +7 -0
- package/2x/es/locales/fa-IR.d.ts +7 -0
- package/2x/es/locales/fr-FR.d.ts +7 -0
- package/2x/es/locales/id-ID.d.ts +118 -0
- package/2x/es/locales/id-ID.js +111 -0
- package/2x/es/locales/kk-KZ.d.ts +118 -0
- package/2x/es/locales/kk-KZ.js +114 -0
- package/2x/es/locales/ko-KR.d.ts +7 -0
- package/2x/es/locales/zh-CN.d.ts +7 -0
- package/2x/es/locales/zh-CN.js +7 -0
- package/2x/es/locales/zh-HK.d.ts +7 -0
- package/2x/es/locales/zh-TW.d.ts +7 -0
- package/2x/package.json +1 -1
- package/2x/umd/antd-mobile.js +1 -1
- package/README.md +30 -16
- package/bundle/antd-mobile.cjs.js +322 -193
- package/bundle/antd-mobile.es.js +323 -194
- package/bundle/style.css +56 -12
- package/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/cjs/components/action-sheet/action-sheet.js +6 -2
- package/cjs/components/cascader/cascader.d.ts +29 -4
- package/cjs/components/cascader/cascader.js +41 -19
- package/cjs/components/cascader/index.d.ts +21 -2
- package/cjs/components/center-popup/center-popup.css +10 -0
- package/cjs/components/center-popup/center-popup.d.ts +3 -20
- package/cjs/components/center-popup/center-popup.js +24 -13
- package/cjs/components/date-picker/date-picker.d.ts +2 -2
- package/cjs/components/date-picker/date-picker.js +3 -1
- package/cjs/components/date-picker/index.d.ts +1 -1
- package/cjs/components/input/input.css +3 -0
- package/cjs/components/input/input.d.ts +7 -4
- package/cjs/components/input/input.js +5 -1
- package/cjs/components/list/index.d.ts +10 -2
- package/cjs/components/list/list.d.ts +13 -2
- package/cjs/components/list/list.js +16 -6
- package/cjs/components/modal/modal-action-button.d.ts +2 -2
- package/cjs/components/modal/modal.css +0 -8
- package/cjs/components/modal/modal.js +4 -11
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/cjs/components/picker/index.d.ts +2 -6
- package/cjs/components/picker/picker.d.ts +2 -6
- package/cjs/components/picker/picker.js +8 -7
- package/cjs/components/picker-view/picker-view.css +1 -0
- package/cjs/components/picker-view/wheel.js +10 -8
- package/cjs/components/popup/popup-base-props.d.ts +35 -0
- package/cjs/components/popup/popup-base-props.js +18 -0
- package/cjs/components/popup/popup.css +26 -0
- package/cjs/components/popup/popup.d.ts +3 -19
- package/cjs/components/popup/popup.js +43 -18
- package/cjs/components/progress-bar/progress-bar.css +15 -3
- package/cjs/components/progress-bar/progress-bar.d.ts +4 -2
- package/cjs/components/progress-bar/progress-bar.js +27 -5
- package/cjs/components/slider/slider.js +2 -1
- package/cjs/components/slider/thumb.d.ts +2 -1
- package/cjs/components/slider/thumb.js +13 -1
- package/cjs/components/stepper/stepper.js +14 -3
- package/cjs/components/steps/steps.css +1 -1
- package/cjs/locales/base.d.ts +7 -0
- package/cjs/locales/base.js +7 -0
- package/cjs/locales/en-US.d.ts +7 -0
- package/cjs/locales/es-ES.d.ts +7 -0
- package/cjs/locales/fa-IR.d.ts +7 -0
- package/cjs/locales/fr-FR.d.ts +7 -0
- package/cjs/locales/id-ID.d.ts +118 -0
- package/cjs/locales/id-ID.js +121 -0
- package/cjs/locales/kk-KZ.d.ts +118 -0
- package/cjs/locales/kk-KZ.js +124 -0
- package/cjs/locales/ko-KR.d.ts +7 -0
- package/cjs/locales/zh-CN.d.ts +7 -0
- package/cjs/locales/zh-CN.js +7 -0
- package/cjs/locales/zh-HK.d.ts +7 -0
- package/cjs/locales/zh-TW.d.ts +7 -0
- package/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/es/components/action-sheet/action-sheet.js +6 -2
- package/es/components/cascader/cascader.d.ts +29 -4
- package/es/components/cascader/cascader.js +42 -18
- package/es/components/cascader/index.d.ts +21 -2
- package/es/components/center-popup/center-popup.css +10 -0
- package/es/components/center-popup/center-popup.d.ts +3 -20
- package/es/components/center-popup/center-popup.js +22 -13
- package/es/components/date-picker/date-picker.d.ts +2 -2
- package/es/components/date-picker/date-picker.js +3 -1
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/input/input.css +3 -0
- package/es/components/input/input.d.ts +7 -4
- package/es/components/input/input.js +5 -1
- package/es/components/list/index.d.ts +10 -2
- package/es/components/list/list.d.ts +13 -2
- package/es/components/list/list.js +12 -4
- package/es/components/modal/modal-action-button.d.ts +2 -2
- package/es/components/modal/modal.css +0 -8
- package/es/components/modal/modal.js +4 -10
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/es/components/number-keyboard/number-keyboard.js +13 -7
- package/es/components/picker/index.d.ts +2 -6
- package/es/components/picker/picker.d.ts +2 -6
- package/es/components/picker/picker.js +8 -6
- package/es/components/picker-view/picker-view.css +1 -0
- package/es/components/picker-view/wheel.js +10 -8
- package/es/components/popup/popup-base-props.d.ts +35 -0
- package/es/components/popup/popup-base-props.js +11 -0
- package/es/components/popup/popup.css +26 -0
- package/es/components/popup/popup.d.ts +3 -19
- package/es/components/popup/popup.js +41 -19
- package/es/components/progress-bar/progress-bar.css +15 -3
- package/es/components/progress-bar/progress-bar.d.ts +4 -2
- package/es/components/progress-bar/progress-bar.js +25 -5
- package/es/components/slider/slider.js +2 -1
- package/es/components/slider/thumb.d.ts +2 -1
- package/es/components/slider/thumb.js +12 -1
- package/es/components/stepper/stepper.js +13 -3
- package/es/components/steps/steps.css +1 -1
- package/es/locales/base.d.ts +7 -0
- package/es/locales/base.js +7 -0
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/es-ES.d.ts +7 -0
- package/es/locales/fa-IR.d.ts +7 -0
- package/es/locales/fr-FR.d.ts +7 -0
- package/es/locales/id-ID.d.ts +118 -0
- package/es/locales/id-ID.js +111 -0
- package/es/locales/kk-KZ.d.ts +118 -0
- package/es/locales/kk-KZ.js +114 -0
- package/es/locales/ko-KR.d.ts +7 -0
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +7 -0
- package/es/locales/zh-HK.d.ts +7 -0
- package/es/locales/zh-TW.d.ts +7 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
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 kkKZ = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
14
|
+
locale: 'kk-KZ',
|
|
15
|
+
common: {
|
|
16
|
+
confirm: 'OK',
|
|
17
|
+
cancel: 'Бастарту',
|
|
18
|
+
loading: 'Жүктелуде'
|
|
19
|
+
},
|
|
20
|
+
Calendar: {
|
|
21
|
+
markItems: ['Дү', 'Се', 'Сә', 'Бе', 'Жұ', 'Се', 'Же'],
|
|
22
|
+
renderYearAndMonth: (year, month) => `${year}жыл${month}-ші ай`
|
|
23
|
+
},
|
|
24
|
+
Cascader: {
|
|
25
|
+
placeholder: 'Таңдаңыз'
|
|
26
|
+
},
|
|
27
|
+
Dialog: {
|
|
28
|
+
ok: 'Мен түсіндім'
|
|
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
|
+
Mask: {
|
|
109
|
+
name: 'Маска қабаты'
|
|
110
|
+
},
|
|
111
|
+
Modal: {
|
|
112
|
+
ok: 'Мен түсіндім'
|
|
113
|
+
},
|
|
114
|
+
PullToRefresh: {
|
|
115
|
+
pulling: 'Төмен тартып жаңарту',
|
|
116
|
+
canRelease: 'Босатып бірден жаңарту',
|
|
117
|
+
complete: 'Сәтті жаңартылды'
|
|
118
|
+
},
|
|
119
|
+
Switch: {
|
|
120
|
+
name: 'Сөндіргіш'
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var _default = kkKZ;
|
|
124
|
+
exports.default = _default;
|
package/cjs/locales/ko-KR.d.ts
CHANGED
package/cjs/locales/zh-CN.d.ts
CHANGED
package/cjs/locales/zh-CN.js
CHANGED
|
@@ -116,6 +116,13 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
116
116
|
canRelease: '释放立即刷新',
|
|
117
117
|
complete: '刷新成功'
|
|
118
118
|
},
|
|
119
|
+
Slider: {
|
|
120
|
+
name: '滑动输入条'
|
|
121
|
+
},
|
|
122
|
+
Stepper: {
|
|
123
|
+
decrease: '减少',
|
|
124
|
+
increase: '增加'
|
|
125
|
+
},
|
|
119
126
|
Switch: {
|
|
120
127
|
name: '开关'
|
|
121
128
|
}
|
package/cjs/locales/zh-HK.d.ts
CHANGED
package/cjs/locales/zh-TW.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
import {
|
|
3
|
+
import { PopupProps } from '../popup';
|
|
4
4
|
export declare type Action = {
|
|
5
5
|
key: string | number;
|
|
6
6
|
text: ReactNode;
|
|
@@ -16,15 +16,13 @@ export declare type ActionSheetProps = {
|
|
|
16
16
|
cancelText?: React.ReactNode;
|
|
17
17
|
onAction?: (action: Action, index: number) => void;
|
|
18
18
|
onClose?: () => void;
|
|
19
|
-
afterClose?: () => void;
|
|
20
19
|
onMaskClick?: () => void;
|
|
21
20
|
closeOnAction?: boolean;
|
|
22
21
|
closeOnMaskClick?: boolean;
|
|
23
|
-
getContainer?: GetContainer;
|
|
24
22
|
safeArea?: boolean;
|
|
25
23
|
popupClassName?: string;
|
|
26
24
|
popupStyle?: React.CSSProperties;
|
|
27
|
-
} & NativeProps;
|
|
25
|
+
} & Pick<PopupProps, 'afterClose' | 'getContainer' | 'destroyOnClose' | 'forceRender'> & NativeProps;
|
|
28
26
|
export declare const ActionSheet: FC<ActionSheetProps>;
|
|
29
27
|
export declare type ActionSheetShowHandler = {
|
|
30
28
|
close: () => void;
|
|
@@ -12,7 +12,9 @@ const defaultProps = {
|
|
|
12
12
|
cancelText: '',
|
|
13
13
|
closeOnAction: false,
|
|
14
14
|
closeOnMaskClick: true,
|
|
15
|
-
safeArea: true
|
|
15
|
+
safeArea: true,
|
|
16
|
+
destroyOnClose: false,
|
|
17
|
+
forceRender: false
|
|
16
18
|
};
|
|
17
19
|
export const ActionSheet = p => {
|
|
18
20
|
const props = mergeProps(defaultProps, p);
|
|
@@ -30,7 +32,9 @@ export const ActionSheet = p => {
|
|
|
30
32
|
afterClose: props.afterClose,
|
|
31
33
|
className: classNames(`${classPrefix}-popup`, props.popupClassName),
|
|
32
34
|
style: props.popupStyle,
|
|
33
|
-
getContainer: props.getContainer
|
|
35
|
+
getContainer: props.getContainer,
|
|
36
|
+
destroyOnClose: props.destroyOnClose,
|
|
37
|
+
forceRender: props.forceRender
|
|
34
38
|
}, withNativeProps(props, React.createElement("div", {
|
|
35
39
|
className: classPrefix
|
|
36
40
|
}, props.extra && React.createElement("div", {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../popup';
|
|
3
3
|
import { CascaderValue, CascaderValueExtend, CascaderOption } from '../cascader-view';
|
|
4
4
|
import { NativeProps } from '../../utils/native-props';
|
|
5
|
+
export declare type CascaderActions = {
|
|
6
|
+
open: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare type CascaderRef = CascaderActions;
|
|
5
11
|
export declare type CascaderProps = {
|
|
6
12
|
options: CascaderOption[];
|
|
7
13
|
value?: CascaderValue[];
|
|
@@ -15,7 +21,26 @@ export declare type CascaderProps = {
|
|
|
15
21
|
title?: ReactNode;
|
|
16
22
|
confirmText?: ReactNode;
|
|
17
23
|
cancelText?: ReactNode;
|
|
18
|
-
children?: (items: (CascaderOption | null)[]) => ReactNode;
|
|
24
|
+
children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
|
|
19
25
|
onTabsChange?: (index: number) => void;
|
|
20
|
-
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps;
|
|
21
|
-
export declare const Cascader:
|
|
26
|
+
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'destroyOnClose' | 'forceRender'> & NativeProps;
|
|
27
|
+
export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
28
|
+
options: CascaderOption[];
|
|
29
|
+
value?: string[] | undefined;
|
|
30
|
+
defaultValue?: string[] | undefined;
|
|
31
|
+
placeholder?: string | undefined;
|
|
32
|
+
onSelect?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
|
|
33
|
+
onConfirm?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
|
|
34
|
+
onCancel?: (() => void) | undefined;
|
|
35
|
+
onClose?: (() => void) | undefined;
|
|
36
|
+
visible?: boolean | undefined;
|
|
37
|
+
title?: ReactNode;
|
|
38
|
+
confirmText?: ReactNode;
|
|
39
|
+
cancelText?: ReactNode;
|
|
40
|
+
children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
|
|
41
|
+
onTabsChange?: ((index: number) => void) | undefined;
|
|
42
|
+
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
43
|
+
className?: string | undefined;
|
|
44
|
+
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
45
|
+
tabIndex?: number | undefined;
|
|
46
|
+
} & React.AriaAttributes & React.RefAttributes<CascaderActions>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
2
2
|
import Popup from '../popup';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -8,9 +8,11 @@ import { useConfig } from '../config-provider';
|
|
|
8
8
|
import { useCascaderValueExtend } from '../cascader-view/use-cascader-value-extend';
|
|
9
9
|
const classPrefix = `adm-cascader`;
|
|
10
10
|
const defaultProps = {
|
|
11
|
-
defaultValue: []
|
|
11
|
+
defaultValue: [],
|
|
12
|
+
destroyOnClose: true,
|
|
13
|
+
forceRender: false
|
|
12
14
|
};
|
|
13
|
-
export const Cascader = p => {
|
|
15
|
+
export const Cascader = forwardRef((p, ref) => {
|
|
14
16
|
var _a;
|
|
15
17
|
|
|
16
18
|
const {
|
|
@@ -21,6 +23,29 @@ export const Cascader = p => {
|
|
|
21
23
|
cancelText: locale.common.cancel,
|
|
22
24
|
placeholder: locale.Cascader.placeholder
|
|
23
25
|
}, p);
|
|
26
|
+
const [visible, setVisible] = usePropsValue({
|
|
27
|
+
value: props.visible,
|
|
28
|
+
defaultValue: false,
|
|
29
|
+
onChange: v => {
|
|
30
|
+
var _a;
|
|
31
|
+
|
|
32
|
+
if (v === false) {
|
|
33
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const actions = {
|
|
38
|
+
toggle: () => {
|
|
39
|
+
setVisible(v => !v);
|
|
40
|
+
},
|
|
41
|
+
open: () => {
|
|
42
|
+
setVisible(true);
|
|
43
|
+
},
|
|
44
|
+
close: () => {
|
|
45
|
+
setVisible(false);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
useImperativeHandle(ref, () => actions);
|
|
24
49
|
const [value, setValue] = usePropsValue(Object.assign(Object.assign({}, props), {
|
|
25
50
|
onChange: val => {
|
|
26
51
|
var _a;
|
|
@@ -31,12 +56,12 @@ export const Cascader = p => {
|
|
|
31
56
|
const generateValueExtend = useCascaderValueExtend(props.options);
|
|
32
57
|
const [innerValue, setInnerValue] = useState(value);
|
|
33
58
|
useEffect(() => {
|
|
34
|
-
if (!
|
|
59
|
+
if (!visible) {
|
|
35
60
|
setInnerValue(value);
|
|
36
61
|
}
|
|
37
|
-
}, [
|
|
62
|
+
}, [visible]);
|
|
38
63
|
useEffect(() => {
|
|
39
|
-
if (!
|
|
64
|
+
if (!visible) {
|
|
40
65
|
setInnerValue(value);
|
|
41
66
|
}
|
|
42
67
|
}, [value]);
|
|
@@ -47,20 +72,18 @@ export const Cascader = p => {
|
|
|
47
72
|
}, React.createElement("a", {
|
|
48
73
|
className: `${classPrefix}-header-button`,
|
|
49
74
|
onClick: () => {
|
|
50
|
-
var _a
|
|
75
|
+
var _a;
|
|
51
76
|
|
|
52
77
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
53
|
-
(
|
|
78
|
+
setVisible(false);
|
|
54
79
|
}
|
|
55
80
|
}, props.cancelText), React.createElement("div", {
|
|
56
81
|
className: `${classPrefix}-header-title`
|
|
57
82
|
}, props.title), React.createElement("a", {
|
|
58
83
|
className: `${classPrefix}-header-button`,
|
|
59
84
|
onClick: () => {
|
|
60
|
-
var _a;
|
|
61
|
-
|
|
62
85
|
setValue(innerValue);
|
|
63
|
-
(
|
|
86
|
+
setVisible(false);
|
|
64
87
|
}
|
|
65
88
|
}, props.confirmText)), React.createElement("div", {
|
|
66
89
|
className: `${classPrefix}-body`
|
|
@@ -71,26 +94,27 @@ export const Cascader = p => {
|
|
|
71
94
|
|
|
72
95
|
setInnerValue(val);
|
|
73
96
|
|
|
74
|
-
if (
|
|
97
|
+
if (visible) {
|
|
75
98
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, val, ext);
|
|
76
99
|
}
|
|
77
100
|
}
|
|
78
101
|
})))));
|
|
79
102
|
const popupElement = React.createElement(Popup, {
|
|
80
|
-
visible:
|
|
103
|
+
visible: visible,
|
|
81
104
|
position: 'bottom',
|
|
82
105
|
onMaskClick: () => {
|
|
83
|
-
var _a
|
|
106
|
+
var _a;
|
|
84
107
|
|
|
85
108
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
86
|
-
(
|
|
109
|
+
setVisible(false);
|
|
87
110
|
},
|
|
88
111
|
getContainer: props.getContainer,
|
|
89
|
-
destroyOnClose:
|
|
112
|
+
destroyOnClose: props.destroyOnClose,
|
|
113
|
+
forceRender: props.forceRender,
|
|
90
114
|
afterShow: props.afterShow,
|
|
91
115
|
afterClose: props.afterClose,
|
|
92
116
|
onClick: props.onClick,
|
|
93
117
|
stopPropagation: props.stopPropagation
|
|
94
118
|
}, cascaderElement);
|
|
95
|
-
return React.createElement(React.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, generateValueExtend(value).items));
|
|
96
|
-
};
|
|
119
|
+
return React.createElement(React.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, generateValueExtend(value).items, actions));
|
|
120
|
+
});
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { prompt } from './prompt';
|
|
3
3
|
import './cascader.less';
|
|
4
|
-
export type { CascaderProps } from './cascader';
|
|
4
|
+
export type { CascaderProps, CascaderRef, CascaderActions } from './cascader';
|
|
5
5
|
export type { CascaderValue, CascaderValueExtend, CascaderOption, } from '../cascader-view';
|
|
6
|
-
declare const _default: import("react").
|
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
options: import("../cascader-view").CascaderOption[];
|
|
8
|
+
value?: string[] | undefined;
|
|
9
|
+
defaultValue?: string[] | undefined;
|
|
10
|
+
placeholder?: string | undefined;
|
|
11
|
+
onSelect?: ((value: string[], extend: import("../cascader-view").CascaderValueExtend) => void) | undefined;
|
|
12
|
+
onConfirm?: ((value: string[], extend: import("../cascader-view").CascaderValueExtend) => void) | undefined;
|
|
13
|
+
onCancel?: (() => void) | undefined;
|
|
14
|
+
onClose?: (() => void) | undefined;
|
|
15
|
+
visible?: boolean | undefined;
|
|
16
|
+
title?: import("react").ReactNode;
|
|
17
|
+
confirmText?: import("react").ReactNode;
|
|
18
|
+
cancelText?: import("react").ReactNode;
|
|
19
|
+
children?: ((items: (import("../cascader-view").CascaderOption | null)[], actions: import("./cascader").CascaderActions) => import("react").ReactNode) | undefined;
|
|
20
|
+
onTabsChange?: ((index: number) => void) | undefined;
|
|
21
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
24
|
+
tabIndex?: number | undefined;
|
|
25
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./cascader").CascaderActions>> & {
|
|
7
26
|
prompt: typeof prompt;
|
|
8
27
|
optionSkeleton: import("../cascader-view").CascaderOption[];
|
|
9
28
|
};
|
|
@@ -24,3 +24,13 @@
|
|
|
24
24
|
background-color: var(--background-color);
|
|
25
25
|
border-radius: var(--border-radius);
|
|
26
26
|
}
|
|
27
|
+
.adm-center-popup-close {
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: 100;
|
|
30
|
+
right: 8px;
|
|
31
|
+
top: 8px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
padding: 4px;
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
color: var(--adm-color-weak);
|
|
36
|
+
}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GetContainer } from '../../utils/render-to-container';
|
|
3
|
-
import { MaskProps } from '../mask';
|
|
4
|
-
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
5
2
|
import { NativeProps } from '../../utils/native-props';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
afterShow?: () => void;
|
|
9
|
-
bodyClassName?: string;
|
|
10
|
-
bodyStyle?: React.CSSProperties;
|
|
11
|
-
destroyOnClose?: boolean;
|
|
12
|
-
disableBodyScroll?: boolean;
|
|
13
|
-
forceRender?: boolean;
|
|
14
|
-
getContainer?: GetContainer;
|
|
15
|
-
mask?: boolean;
|
|
16
|
-
maskClassName?: string;
|
|
17
|
-
maskStyle?: MaskProps['style'];
|
|
18
|
-
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
19
|
-
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
|
-
stopPropagation?: PropagationEvent[];
|
|
21
|
-
visible?: boolean;
|
|
3
|
+
import { PopupBaseProps } from '../popup/popup-base-props';
|
|
4
|
+
export declare type CenterPopupProps = PopupBaseProps & PropsWithChildren<{
|
|
22
5
|
role?: string;
|
|
23
6
|
}> & NativeProps<'--background-color' | '--border-radius' | '--max-width' | '--min-width' | '--z-index'>;
|
|
24
7
|
export declare const CenterPopup: FC<CenterPopupProps>;
|
|
@@ -10,16 +10,9 @@ import classNames from 'classnames';
|
|
|
10
10
|
import { withNativeProps } from '../../utils/native-props';
|
|
11
11
|
import { ShouldRender } from '../../utils/should-render';
|
|
12
12
|
import { useLockScroll } from '../../utils/use-lock-scroll';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
forceRender: false,
|
|
17
|
-
getContainer: null,
|
|
18
|
-
mask: true,
|
|
19
|
-
showCloseButton: false,
|
|
20
|
-
stopPropagation: ['click'],
|
|
21
|
-
visible: false
|
|
22
|
-
};
|
|
13
|
+
import { CloseOutline } from 'antd-mobile-icons';
|
|
14
|
+
import { defaultPopupBaseProps } from '../popup/popup-base-props';
|
|
15
|
+
const defaultProps = defaultPopupBaseProps;
|
|
23
16
|
export const CenterPopup = p => {
|
|
24
17
|
const props = mergeProps(defaultProps, p);
|
|
25
18
|
const unmountedRef = useUnmountedRef();
|
|
@@ -68,10 +61,19 @@ export const CenterPopup = p => {
|
|
|
68
61
|
visible: maskVisible,
|
|
69
62
|
forceRender: props.forceRender,
|
|
70
63
|
destroyOnClose: props.destroyOnClose,
|
|
71
|
-
onMaskClick:
|
|
64
|
+
onMaskClick: e => {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
|
|
67
|
+
(_a = props.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
68
|
+
|
|
69
|
+
if (props.closeOnMaskClick) {
|
|
70
|
+
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
72
73
|
style: props.maskStyle,
|
|
73
74
|
className: classNames('adm-center-popup-mask', props.maskClassName),
|
|
74
|
-
disableBodyScroll: false
|
|
75
|
+
disableBodyScroll: false,
|
|
76
|
+
stopPropagation: props.stopPropagation
|
|
75
77
|
}), React.createElement("div", {
|
|
76
78
|
className: 'adm-center-popup-wrap',
|
|
77
79
|
role: props.role,
|
|
@@ -79,7 +81,14 @@ export const CenterPopup = p => {
|
|
|
79
81
|
}, React.createElement(animated.div, {
|
|
80
82
|
style: style,
|
|
81
83
|
ref: ref
|
|
82
|
-
},
|
|
84
|
+
}, props.showCloseButton && React.createElement("a", {
|
|
85
|
+
className: classNames('adm-center-popup-close', 'adm-plain-anchor'),
|
|
86
|
+
onClick: () => {
|
|
87
|
+
var _a;
|
|
88
|
+
|
|
89
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
90
|
+
}
|
|
91
|
+
}, React.createElement(CloseOutline, null)), body)))));
|
|
83
92
|
return React.createElement(ShouldRender, {
|
|
84
93
|
active: active,
|
|
85
94
|
forceRender: props.forceRender,
|
|
@@ -3,7 +3,7 @@ import type { PickerProps, PickerRef, PickerActions } from '../picker';
|
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
5
|
export declare type DatePickerRef = PickerRef;
|
|
6
|
-
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel'> & {
|
|
6
|
+
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel' | 'forceRender' | 'destroyOnClose'> & {
|
|
7
7
|
value?: Date | null;
|
|
8
8
|
defaultValue?: Date | null;
|
|
9
9
|
onSelect?: (value: Date) => void;
|
|
@@ -15,7 +15,7 @@ export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' |
|
|
|
15
15
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
16
16
|
filter?: DatePickerFilter;
|
|
17
17
|
} & NativeProps;
|
|
18
|
-
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "
|
|
18
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "closeOnMaskClick" | "cancelText" | "mouseWheel" | "confirmText"> & {
|
|
19
19
|
value?: Date | null | undefined;
|
|
20
20
|
defaultValue?: Date | null | undefined;
|
|
21
21
|
onSelect?: ((value: Date) => void) | undefined;
|
|
@@ -60,7 +60,9 @@ export const DatePicker = forwardRef((p, ref) => {
|
|
|
60
60
|
onClick: props.onClick,
|
|
61
61
|
title: props.title,
|
|
62
62
|
stopPropagation: props.stopPropagation,
|
|
63
|
-
mouseWheel: props.mouseWheel
|
|
63
|
+
mouseWheel: props.mouseWheel,
|
|
64
|
+
destroyOnClose: props.destroyOnClose,
|
|
65
|
+
forceRender: props.forceRender
|
|
64
66
|
}, (_, actions) => {
|
|
65
67
|
var _a;
|
|
66
68
|
|
|
@@ -3,7 +3,7 @@ import './date-picker.less';
|
|
|
3
3
|
import { prompt } from './prompt';
|
|
4
4
|
export type { DatePickerProps, DatePickerRef } from './date-picker';
|
|
5
5
|
export type { DatePickerFilter } from './date-picker-utils';
|
|
6
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("../picker").PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "
|
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("../picker").PickerProps, "style" | "title" | "onClick" | "visible" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "closeOnMaskClick" | "cancelText" | "mouseWheel" | "confirmText"> & {
|
|
7
7
|
value?: Date | null | undefined;
|
|
8
8
|
defaultValue?: Date | null | undefined;
|
|
9
9
|
onSelect?: ((value: Date) => void) | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
4
|
-
|
|
4
|
+
declare type AriaProps = {
|
|
5
|
+
role?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step'> & {
|
|
5
8
|
value?: string;
|
|
6
9
|
defaultValue?: string;
|
|
7
10
|
onChange?: (val: string) => void;
|
|
@@ -16,14 +19,14 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
16
19
|
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
17
20
|
min?: number;
|
|
18
21
|
max?: number;
|
|
19
|
-
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'
|
|
22
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'> & AriaProps;
|
|
20
23
|
export declare type InputRef = {
|
|
21
24
|
clear: () => void;
|
|
22
25
|
focus: () => void;
|
|
23
26
|
blur: () => void;
|
|
24
27
|
nativeElement: HTMLInputElement | null;
|
|
25
28
|
};
|
|
26
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
29
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength" | "step"> & {
|
|
27
30
|
value?: string | undefined;
|
|
28
31
|
defaultValue?: string | undefined;
|
|
29
32
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -42,5 +45,5 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
42
45
|
className?: string | undefined;
|
|
43
46
|
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
|
|
44
47
|
tabIndex?: number | undefined;
|
|
45
|
-
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
48
|
+
} & React.AriaAttributes & AriaProps & React.RefAttributes<InputRef>>;
|
|
46
49
|
export {};
|
|
@@ -135,7 +135,11 @@ export const Input = forwardRef((p, ref) => {
|
|
|
135
135
|
compositionStartRef.current = false;
|
|
136
136
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
137
137
|
},
|
|
138
|
-
onClick: props.onClick
|
|
138
|
+
onClick: props.onClick,
|
|
139
|
+
role: props.role,
|
|
140
|
+
"aria-valuenow": props['aria-valuenow'],
|
|
141
|
+
"aria-valuemax": props['aria-valuemax'],
|
|
142
|
+
"aria-valuemin": props['aria-valuemin']
|
|
139
143
|
}), shouldShowClear && React.createElement("div", {
|
|
140
144
|
className: `${classPrefix}-clear`,
|
|
141
145
|
onMouseDown: e => {
|