@douyinfe/semi-ui 2.1.4 → 2.2.0-beta.1
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/_base/_story/a11y.jsx +1302 -0
- package/_base/_story/a11y.scss +49 -0
- package/_base/_story/index.stories.js +3 -1
- package/_utils/index.ts +9 -4
- package/button/Button.tsx +1 -0
- package/cascader/__test__/cascader.test.js +221 -0
- package/cascader/_story/cascader.stories.js +138 -0
- package/cascader/index.tsx +37 -21
- package/cascader/item.tsx +4 -2
- package/checkbox/checkbox.tsx +2 -0
- package/checkbox/checkboxGroup.tsx +3 -2
- package/datePicker/__test__/datePicker.test.js +85 -2
- package/datePicker/_story/datePicker.stories.js +29 -1
- package/datePicker/_story/v2/YearButton.jsx +17 -0
- package/datePicker/_story/v2/index.js +1 -0
- package/datePicker/monthsGrid.tsx +12 -1
- package/datePicker/navigation.tsx +55 -29
- package/descriptions/__test__/descriptions.test.js +27 -1
- package/descriptions/_story/descriptions.stories.js +52 -2
- package/descriptions/item.tsx +1 -1
- package/dist/css/semi.css +56 -32
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +854 -258
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/empty/index.tsx +2 -2
- package/form/_story/form.stories.js +0 -67
- package/form/hoc/withField.tsx +1 -1
- package/gulpfile.js +2 -1
- package/lib/cjs/_base/base.css +2 -2
- package/lib/cjs/_utils/index.d.ts +1 -0
- package/lib/cjs/_utils/index.js +12 -5
- package/lib/cjs/button/Button.d.ts +1 -0
- package/lib/cjs/cascader/index.d.ts +7 -0
- package/lib/cjs/cascader/index.js +35 -22
- package/lib/cjs/cascader/item.d.ts +2 -0
- package/lib/cjs/cascader/item.js +4 -2
- package/lib/cjs/checkbox/checkbox.js +3 -1
- package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -0
- package/lib/cjs/checkbox/checkboxGroup.js +3 -1
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -0
- package/lib/cjs/datePicker/monthsGrid.js +6 -0
- package/lib/cjs/datePicker/navigation.js +47 -7
- package/lib/cjs/descriptions/item.js +1 -1
- package/lib/cjs/empty/index.d.ts +2 -2
- package/lib/cjs/empty/index.js +19 -18
- package/lib/cjs/form/baseForm.d.ts +6 -0
- package/lib/cjs/form/field.d.ts +6 -0
- package/lib/cjs/form/hoc/withField.js +3 -1
- package/lib/cjs/locale/source/es.d.ts +7 -0
- package/lib/cjs/locale/source/es.js +168 -0
- package/lib/cjs/modal/Modal.d.ts +2 -2
- package/lib/cjs/modal/Modal.js +2 -2
- package/lib/cjs/modal/confirm.d.ts +10 -10
- package/lib/cjs/navigation/index.d.ts +2 -2
- package/lib/cjs/pagination/index.js +9 -4
- package/lib/cjs/rating/item.js +1 -1
- package/lib/cjs/select/index.d.ts +10 -0
- package/lib/cjs/select/index.js +15 -9
- package/lib/cjs/timeline/item.d.ts +5 -2
- package/lib/cjs/timeline/item.js +13 -7
- package/lib/cjs/tree/treeNode.js +0 -2
- package/lib/cjs/upload/fileCard.d.ts +2 -0
- package/lib/cjs/upload/fileCard.js +70 -45
- package/lib/cjs/upload/index.d.ts +23 -2
- package/lib/cjs/upload/index.js +133 -25
- package/lib/cjs/upload/interface.d.ts +3 -0
- package/lib/es/_base/base.css +2 -2
- package/lib/es/_utils/index.d.ts +1 -0
- package/lib/es/_utils/index.js +12 -5
- package/lib/es/button/Button.d.ts +1 -0
- package/lib/es/cascader/index.d.ts +7 -0
- package/lib/es/cascader/index.js +34 -25
- package/lib/es/cascader/item.d.ts +2 -0
- package/lib/es/cascader/item.js +4 -2
- package/lib/es/checkbox/checkbox.js +3 -1
- package/lib/es/checkbox/checkboxGroup.d.ts +1 -0
- package/lib/es/checkbox/checkboxGroup.js +3 -1
- package/lib/es/datePicker/monthsGrid.d.ts +1 -0
- package/lib/es/datePicker/monthsGrid.js +6 -0
- package/lib/es/datePicker/navigation.js +48 -8
- package/lib/es/descriptions/item.js +1 -1
- package/lib/es/empty/index.d.ts +2 -2
- package/lib/es/empty/index.js +19 -18
- package/lib/es/form/baseForm.d.ts +6 -0
- package/lib/es/form/field.d.ts +6 -0
- package/lib/es/form/hoc/withField.js +3 -1
- package/lib/es/locale/source/es.d.ts +7 -0
- package/lib/es/locale/source/es.js +157 -0
- package/lib/es/modal/Modal.d.ts +2 -2
- package/lib/es/modal/Modal.js +2 -2
- package/lib/es/modal/confirm.d.ts +10 -10
- package/lib/es/navigation/index.d.ts +2 -2
- package/lib/es/pagination/index.js +8 -4
- package/lib/es/rating/item.js +1 -1
- package/lib/es/select/index.d.ts +10 -0
- package/lib/es/select/index.js +19 -9
- package/lib/es/timeline/item.d.ts +5 -2
- package/lib/es/timeline/item.js +12 -7
- package/lib/es/tree/treeNode.js +0 -2
- package/lib/es/upload/fileCard.d.ts +2 -0
- package/lib/es/upload/fileCard.js +69 -44
- package/lib/es/upload/index.d.ts +23 -2
- package/lib/es/upload/index.js +133 -24
- package/lib/es/upload/interface.d.ts +3 -0
- package/locale/source/es.ts +160 -0
- package/modal/Modal.tsx +4 -4
- package/navigation/__test__/navigation.test.js +4 -4
- package/navigation/_story/AutoOpen/index.js +1 -1
- package/navigation/_story/WithChildren/index.js +1 -1
- package/navigation/_story/navigation.stories.js +1 -1
- package/navigation/_story/navigation.stories.tsx +4 -4
- package/navigation/index.tsx +2 -2
- package/package.json +17 -9
- package/pagination/_story/pagination.stories.js +11 -0
- package/pagination/index.tsx +9 -4
- package/popover/Arrow.tsx +1 -1
- package/radio/_story/radio.stories.js +12 -1
- package/rating/item.tsx +1 -1
- package/select/_story/select.stories.js +39 -14
- package/select/index.tsx +21 -7
- package/table/_story/DynamicFilters/index.js +13 -16
- package/timeline/__test__/timeline.test.js +17 -1
- package/timeline/_story/timeline.stories.js +70 -6
- package/timeline/item.tsx +11 -6
- package/tooltip/_story/tooltip.stories.js +1 -1
- package/tree/_story/tree.stories.js +2 -2
- package/tree/treeNode.tsx +0 -2
- package/upload/__test__/upload.test.js +50 -1
- package/upload/fileCard.tsx +110 -95
- package/upload/index.tsx +147 -53
- package/upload/interface.ts +3 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { es } from 'date-fns/locale';
|
|
2
|
+
/**
|
|
3
|
+
* [i18n-Spanish(es)]
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const locale = {
|
|
8
|
+
code: 'es',
|
|
9
|
+
dateFnsLocale: es,
|
|
10
|
+
Pagination: {
|
|
11
|
+
item: 'objeto',
|
|
12
|
+
pageSize: ' objetos / página',
|
|
13
|
+
page: ' páginas',
|
|
14
|
+
total: '',
|
|
15
|
+
jumpTo: 'Ir a'
|
|
16
|
+
},
|
|
17
|
+
Modal: {
|
|
18
|
+
confirm: 'Aceptar',
|
|
19
|
+
cancel: 'Cancelar'
|
|
20
|
+
},
|
|
21
|
+
TimePicker: {
|
|
22
|
+
placeholder: {
|
|
23
|
+
time: 'Seleccionar hora',
|
|
24
|
+
timeRange: 'Seleccionar rango de tiempo'
|
|
25
|
+
},
|
|
26
|
+
begin: 'Hora inicial',
|
|
27
|
+
end: 'Hora final',
|
|
28
|
+
hour: '',
|
|
29
|
+
minute: '',
|
|
30
|
+
second: '',
|
|
31
|
+
AM: 'AM',
|
|
32
|
+
PM: 'PM'
|
|
33
|
+
},
|
|
34
|
+
DatePicker: {
|
|
35
|
+
placeholder: {
|
|
36
|
+
date: 'Seleccionar fecha',
|
|
37
|
+
dateTime: 'Seleccionar hora y fecha',
|
|
38
|
+
dateRange: ['Fecha inicial', 'Fecha final'],
|
|
39
|
+
dateTimeRange: ['Fecha inicial', 'Fecha final']
|
|
40
|
+
},
|
|
41
|
+
footer: {
|
|
42
|
+
confirm: 'Aceptar',
|
|
43
|
+
cancel: 'Cancelar'
|
|
44
|
+
},
|
|
45
|
+
selectDate: 'Seleccionar fecha',
|
|
46
|
+
selectTime: 'Seleccionar hora',
|
|
47
|
+
year: 'año',
|
|
48
|
+
month: 'mes',
|
|
49
|
+
day: 'día',
|
|
50
|
+
monthText: '${month} ${year}',
|
|
51
|
+
months: {
|
|
52
|
+
1: 'Ene',
|
|
53
|
+
2: 'Feb',
|
|
54
|
+
3: 'Mar',
|
|
55
|
+
4: 'Abr',
|
|
56
|
+
5: 'May',
|
|
57
|
+
6: 'Jun',
|
|
58
|
+
7: 'Jul',
|
|
59
|
+
8: 'Ago',
|
|
60
|
+
9: 'Sep',
|
|
61
|
+
10: 'Oct',
|
|
62
|
+
11: 'Nov',
|
|
63
|
+
12: 'Dic'
|
|
64
|
+
},
|
|
65
|
+
fullMonths: {
|
|
66
|
+
1: 'Enero',
|
|
67
|
+
2: 'Febrero',
|
|
68
|
+
3: 'Marzo',
|
|
69
|
+
4: 'Abril',
|
|
70
|
+
5: 'Mayo',
|
|
71
|
+
6: 'Junio',
|
|
72
|
+
7: 'Julio',
|
|
73
|
+
8: 'Agosto',
|
|
74
|
+
9: 'Septiembre',
|
|
75
|
+
10: 'Octubre',
|
|
76
|
+
11: 'Noviembre',
|
|
77
|
+
12: 'Diciembre'
|
|
78
|
+
},
|
|
79
|
+
weeks: {
|
|
80
|
+
Mon: 'Lun',
|
|
81
|
+
Tue: 'Mar',
|
|
82
|
+
Wed: 'Mie',
|
|
83
|
+
Thu: 'Jue',
|
|
84
|
+
Fri: 'Vie',
|
|
85
|
+
Sat: 'Sab',
|
|
86
|
+
Sun: 'Dom'
|
|
87
|
+
},
|
|
88
|
+
localeFormatToken: {
|
|
89
|
+
FORMAT_SWITCH_DATE: 'yyyy-MM-dd'
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
Popconfirm: {
|
|
93
|
+
confirm: 'Aceptar',
|
|
94
|
+
cancel: 'Cancelar'
|
|
95
|
+
},
|
|
96
|
+
Navigation: {
|
|
97
|
+
collapseText: 'Contraer barra lateral',
|
|
98
|
+
expandText: 'Expandir barra lateral'
|
|
99
|
+
},
|
|
100
|
+
Table: {
|
|
101
|
+
emptyText: 'Sin resultados',
|
|
102
|
+
pageText: 'Mostrando del ${currentStart} al ${currentEnd} de ${total}'
|
|
103
|
+
},
|
|
104
|
+
Select: {
|
|
105
|
+
emptyText: 'Sin resultados',
|
|
106
|
+
createText: 'Crear'
|
|
107
|
+
},
|
|
108
|
+
Tree: {
|
|
109
|
+
emptyText: 'Sin resultados',
|
|
110
|
+
searchPlaceholder: 'Búsqueda'
|
|
111
|
+
},
|
|
112
|
+
Cascader: {
|
|
113
|
+
emptyText: 'Sin resultados'
|
|
114
|
+
},
|
|
115
|
+
List: {
|
|
116
|
+
emptyText: 'Sin resultados'
|
|
117
|
+
},
|
|
118
|
+
Calendar: {
|
|
119
|
+
allDay: 'Todo el día',
|
|
120
|
+
AM: '${time} AM',
|
|
121
|
+
PM: '${time} PM',
|
|
122
|
+
datestring: '',
|
|
123
|
+
remaining: '${remained} mas'
|
|
124
|
+
},
|
|
125
|
+
Upload: {
|
|
126
|
+
mainText: 'Clic aquí para cargar archivo o arrastre aquí el archivo',
|
|
127
|
+
illegalTips: 'Este tipo de archivo no es compatible',
|
|
128
|
+
legalTips: 'Suelte y comience a cargar',
|
|
129
|
+
retry: 'Reintentar',
|
|
130
|
+
replace: 'Reemplazar archivo',
|
|
131
|
+
clear: 'Limpiar',
|
|
132
|
+
selectedFiles: 'Archivos seleccionados',
|
|
133
|
+
illegalSize: 'Tamaño de archivo inválido',
|
|
134
|
+
fail: 'Error al cargar'
|
|
135
|
+
},
|
|
136
|
+
TreeSelect: {
|
|
137
|
+
searchPlaceholder: 'Búsqueda'
|
|
138
|
+
},
|
|
139
|
+
Typography: {
|
|
140
|
+
copy: 'Copiar',
|
|
141
|
+
copied: 'Copiado',
|
|
142
|
+
expand: 'Expandir',
|
|
143
|
+
collapse: 'Contraer'
|
|
144
|
+
},
|
|
145
|
+
Transfer: {
|
|
146
|
+
emptyLeft: 'Sin datos',
|
|
147
|
+
emptySearch: 'Sin resultados de búsqueda',
|
|
148
|
+
emptyRight: 'Sin contenido, verifique desde la izquierda',
|
|
149
|
+
placeholder: 'Búsqueda',
|
|
150
|
+
clear: 'Limpiar',
|
|
151
|
+
selectAll: 'Seleccionar todo',
|
|
152
|
+
clearSelectAll: 'Deseleccionar todo',
|
|
153
|
+
total: 'Total ${total} objetos',
|
|
154
|
+
selected: '${total} objetos seleccionados'
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
export default locale;
|
package/lib/es/modal/Modal.d.ts
CHANGED
|
@@ -30,8 +30,8 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
|
|
|
30
30
|
closable: PropTypes.Requireable<boolean>;
|
|
31
31
|
centered: PropTypes.Requireable<boolean>;
|
|
32
32
|
visible: PropTypes.Requireable<boolean>;
|
|
33
|
-
width: PropTypes.Requireable<number>;
|
|
34
|
-
height: PropTypes.Requireable<number>;
|
|
33
|
+
width: PropTypes.Requireable<string | number>;
|
|
34
|
+
height: PropTypes.Requireable<string | number>;
|
|
35
35
|
confirmLoading: PropTypes.Requireable<boolean>;
|
|
36
36
|
cancelLoading: PropTypes.Requireable<boolean>;
|
|
37
37
|
okText: PropTypes.Requireable<string>;
|
package/lib/es/modal/Modal.js
CHANGED
|
@@ -304,8 +304,8 @@ Modal.propTypes = {
|
|
|
304
304
|
closable: PropTypes.bool,
|
|
305
305
|
centered: PropTypes.bool,
|
|
306
306
|
visible: PropTypes.bool,
|
|
307
|
-
width: PropTypes.number,
|
|
308
|
-
height: PropTypes.number,
|
|
307
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
308
|
+
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
309
309
|
confirmLoading: PropTypes.bool,
|
|
310
310
|
cancelLoading: PropTypes.bool,
|
|
311
311
|
okText: PropTypes.string,
|
|
@@ -30,7 +30,7 @@ export declare function withInfo(props: ModalReactProps): {
|
|
|
30
30
|
confirmLoading?: boolean;
|
|
31
31
|
cancelLoading?: boolean;
|
|
32
32
|
hasCancel?: boolean;
|
|
33
|
-
height?: number;
|
|
33
|
+
height?: string | number;
|
|
34
34
|
mask?: boolean;
|
|
35
35
|
maskClosable?: boolean;
|
|
36
36
|
maskFixed?: boolean;
|
|
@@ -38,7 +38,7 @@ export declare function withInfo(props: ModalReactProps): {
|
|
|
38
38
|
okText?: string;
|
|
39
39
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
40
40
|
visible?: boolean;
|
|
41
|
-
width?: number;
|
|
41
|
+
width?: string | number;
|
|
42
42
|
zIndex?: number;
|
|
43
43
|
getPopupContainer?: () => HTMLElement;
|
|
44
44
|
closeOnEsc?: boolean;
|
|
@@ -71,7 +71,7 @@ export declare function withSuccess(props: ModalReactProps): {
|
|
|
71
71
|
confirmLoading?: boolean;
|
|
72
72
|
cancelLoading?: boolean;
|
|
73
73
|
hasCancel?: boolean;
|
|
74
|
-
height?: number;
|
|
74
|
+
height?: string | number;
|
|
75
75
|
mask?: boolean;
|
|
76
76
|
maskClosable?: boolean;
|
|
77
77
|
maskFixed?: boolean;
|
|
@@ -79,7 +79,7 @@ export declare function withSuccess(props: ModalReactProps): {
|
|
|
79
79
|
okText?: string;
|
|
80
80
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
81
81
|
visible?: boolean;
|
|
82
|
-
width?: number;
|
|
82
|
+
width?: string | number;
|
|
83
83
|
zIndex?: number;
|
|
84
84
|
getPopupContainer?: () => HTMLElement;
|
|
85
85
|
closeOnEsc?: boolean;
|
|
@@ -112,7 +112,7 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
112
112
|
confirmLoading?: boolean;
|
|
113
113
|
cancelLoading?: boolean;
|
|
114
114
|
hasCancel?: boolean;
|
|
115
|
-
height?: number;
|
|
115
|
+
height?: string | number;
|
|
116
116
|
mask?: boolean;
|
|
117
117
|
maskClosable?: boolean;
|
|
118
118
|
maskFixed?: boolean;
|
|
@@ -120,7 +120,7 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
120
120
|
okText?: string;
|
|
121
121
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
122
122
|
visible?: boolean;
|
|
123
|
-
width?: number;
|
|
123
|
+
width?: string | number;
|
|
124
124
|
zIndex?: number;
|
|
125
125
|
getPopupContainer?: () => HTMLElement;
|
|
126
126
|
closeOnEsc?: boolean;
|
|
@@ -153,7 +153,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
153
153
|
confirmLoading?: boolean;
|
|
154
154
|
cancelLoading?: boolean;
|
|
155
155
|
hasCancel?: boolean;
|
|
156
|
-
height?: number;
|
|
156
|
+
height?: string | number;
|
|
157
157
|
mask?: boolean;
|
|
158
158
|
maskClosable?: boolean;
|
|
159
159
|
maskFixed?: boolean;
|
|
@@ -161,7 +161,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
161
161
|
okText?: string;
|
|
162
162
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
163
163
|
visible?: boolean;
|
|
164
|
-
width?: number;
|
|
164
|
+
width?: string | number;
|
|
165
165
|
zIndex?: number;
|
|
166
166
|
getPopupContainer?: () => HTMLElement;
|
|
167
167
|
closeOnEsc?: boolean;
|
|
@@ -194,7 +194,7 @@ export declare function withConfirm(props: ModalReactProps): {
|
|
|
194
194
|
confirmLoading?: boolean;
|
|
195
195
|
cancelLoading?: boolean;
|
|
196
196
|
hasCancel?: boolean;
|
|
197
|
-
height?: number;
|
|
197
|
+
height?: string | number;
|
|
198
198
|
mask?: boolean;
|
|
199
199
|
maskClosable?: boolean;
|
|
200
200
|
maskFixed?: boolean;
|
|
@@ -202,7 +202,7 @@ export declare function withConfirm(props: ModalReactProps): {
|
|
|
202
202
|
okText?: string;
|
|
203
203
|
okType?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").OKType;
|
|
204
204
|
visible?: boolean;
|
|
205
|
-
width?: number;
|
|
205
|
+
width?: string | number;
|
|
206
206
|
zIndex?: number;
|
|
207
207
|
getPopupContainer?: () => HTMLElement;
|
|
208
208
|
closeOnEsc?: boolean;
|
|
@@ -36,8 +36,8 @@ export interface NavProps extends BaseProps {
|
|
|
36
36
|
defaultIsCollapsed?: boolean;
|
|
37
37
|
defaultOpenKeys?: React.ReactText[];
|
|
38
38
|
defaultSelectedKeys?: React.ReactText[];
|
|
39
|
-
footer?: React.ReactNode |
|
|
40
|
-
header?: React.ReactNode |
|
|
39
|
+
footer?: React.ReactNode | NavFooterProps;
|
|
40
|
+
header?: React.ReactNode | NavHeaderProps;
|
|
41
41
|
isCollapsed?: boolean;
|
|
42
42
|
items?: NavItems;
|
|
43
43
|
limitIndent?: boolean;
|
|
@@ -15,6 +15,7 @@ import { cssClasses, numbers } from '@douyinfe/semi-foundation/lib/es/pagination
|
|
|
15
15
|
import '@douyinfe/semi-foundation/lib/es/pagination/pagination.css';
|
|
16
16
|
import { numbers as popoverNumbers } from '@douyinfe/semi-foundation/lib/es/popover/constants';
|
|
17
17
|
import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons';
|
|
18
|
+
import warning from '@douyinfe/semi-foundation/lib/es/utils/warning';
|
|
18
19
|
import ConfigContext from '../configProvider/context';
|
|
19
20
|
import LocaleConsumer from '../locale/localeConsumer';
|
|
20
21
|
import Select from '../select/index';
|
|
@@ -45,6 +46,7 @@ export default class Pagination extends BaseComponent {
|
|
|
45
46
|
this.foundation = new PaginationFoundation(this.adapter);
|
|
46
47
|
this.renderDefaultPage = _bindInstanceProperty(_context = this.renderDefaultPage).call(_context, this);
|
|
47
48
|
this.renderSmallPage = _bindInstanceProperty(_context2 = this.renderSmallPage).call(_context2, this);
|
|
49
|
+
warning(Boolean(props.showSizeChanger && props.hideOnSinglePage), '[Semi Pagination] You should not use showSizeChanger and hideOnSinglePage in ths same time. At this time, hideOnSinglePage no longer takes effect, otherwise there may be a problem that the switch entry disappears');
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
get adapter() {
|
|
@@ -338,7 +340,8 @@ export default class Pagination extends BaseComponent {
|
|
|
338
340
|
className,
|
|
339
341
|
style,
|
|
340
342
|
hideOnSinglePage,
|
|
341
|
-
hoverShowPageSelect
|
|
343
|
+
hoverShowPageSelect,
|
|
344
|
+
showSizeChanger
|
|
342
345
|
} = this.props;
|
|
343
346
|
const paginationCls = classNames("".concat(prefixCls, "-small"), prefixCls, className);
|
|
344
347
|
const {
|
|
@@ -348,7 +351,7 @@ export default class Pagination extends BaseComponent {
|
|
|
348
351
|
} = this.state;
|
|
349
352
|
const totalPageNum = Math.ceil(total / pageSize);
|
|
350
353
|
|
|
351
|
-
if (totalPageNum < 2 && hideOnSinglePage) {
|
|
354
|
+
if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
|
|
352
355
|
return null;
|
|
353
356
|
}
|
|
354
357
|
|
|
@@ -377,13 +380,14 @@ export default class Pagination extends BaseComponent {
|
|
|
377
380
|
showTotal,
|
|
378
381
|
className,
|
|
379
382
|
style,
|
|
380
|
-
hideOnSinglePage
|
|
383
|
+
hideOnSinglePage,
|
|
384
|
+
showSizeChanger
|
|
381
385
|
} = this.props;
|
|
382
386
|
const paginationCls = classNames(className, "".concat(prefixCls));
|
|
383
387
|
const showTotalCls = "".concat(prefixCls, "-total");
|
|
384
388
|
const totalPageNum = Math.ceil(total / pageSize);
|
|
385
389
|
|
|
386
|
-
if (totalPageNum < 2 && hideOnSinglePage) {
|
|
390
|
+
if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
|
|
387
391
|
return null;
|
|
388
392
|
}
|
|
389
393
|
|
package/lib/es/rating/item.js
CHANGED
|
@@ -71,7 +71,7 @@ export default class Item extends PureComponent {
|
|
|
71
71
|
height: size,
|
|
72
72
|
fontSize: size
|
|
73
73
|
} : {};
|
|
74
|
-
const iconSize = size === 'small' ? 'default' : 'extra-large';
|
|
74
|
+
const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
|
|
75
75
|
const content = character ? character : /*#__PURE__*/React.createElement(IconStar, {
|
|
76
76
|
size: iconSize
|
|
77
77
|
});
|
package/lib/es/select/index.d.ts
CHANGED
|
@@ -2,13 +2,20 @@ import React, { MouseEvent } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/lib/es/select/foundation';
|
|
4
4
|
import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
5
|
+
import { InputProps } from '../input/index';
|
|
5
6
|
import Option, { OptionProps } from './option';
|
|
6
7
|
import OptionGroup from './optionGroup';
|
|
8
|
+
import { Subtract } from 'utility-types';
|
|
7
9
|
import '@douyinfe/semi-foundation/lib/es/select/select.css';
|
|
8
10
|
import { Position, TooltipProps } from '../tooltip';
|
|
9
11
|
export { OptionProps } from './option';
|
|
10
12
|
export { OptionGroupProps } from './optionGroup';
|
|
11
13
|
export { VirtualRowProps } from './virtualRow';
|
|
14
|
+
declare type ExcludeInputType = {
|
|
15
|
+
value?: InputProps['value'];
|
|
16
|
+
onFocus?: InputProps['onFocus'];
|
|
17
|
+
onChange?: InputProps['onChange'];
|
|
18
|
+
};
|
|
12
19
|
export interface optionRenderProps {
|
|
13
20
|
key?: any;
|
|
14
21
|
label?: string | React.ReactNode | number;
|
|
@@ -48,6 +55,7 @@ export declare type RenderMultipleSelectedItemFn = (optionNode: Record<string, a
|
|
|
48
55
|
};
|
|
49
56
|
export declare type RenderSelectedItemFn = RenderSingleSelectedItemFn | RenderMultipleSelectedItemFn;
|
|
50
57
|
export declare type SelectProps = {
|
|
58
|
+
id?: string;
|
|
51
59
|
autoFocus?: boolean;
|
|
52
60
|
arrowIcon?: React.ReactNode;
|
|
53
61
|
defaultValue?: string | number | any[] | Record<string, any>;
|
|
@@ -84,6 +92,7 @@ export declare type SelectProps = {
|
|
|
84
92
|
suffix?: React.ReactNode;
|
|
85
93
|
prefix?: React.ReactNode;
|
|
86
94
|
insetLabel?: React.ReactNode;
|
|
95
|
+
inputProps?: Subtract<InputProps, ExcludeInputType>;
|
|
87
96
|
showClear?: boolean;
|
|
88
97
|
showArrow?: boolean;
|
|
89
98
|
renderSelectedItem?: RenderSelectedItemFn;
|
|
@@ -150,6 +159,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
|
|
|
150
159
|
dropdownStyle: PropTypes.Requireable<object>;
|
|
151
160
|
outerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
152
161
|
innerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
162
|
+
inputProps: PropTypes.Requireable<object>;
|
|
153
163
|
outerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
154
164
|
innerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
155
165
|
optionList: PropTypes.Requireable<any[]>;
|
package/lib/es/select/index.js
CHANGED
|
@@ -342,39 +342,44 @@ class Select extends BaseComponent {
|
|
|
342
342
|
const {
|
|
343
343
|
size,
|
|
344
344
|
multiple,
|
|
345
|
-
disabled
|
|
345
|
+
disabled,
|
|
346
|
+
inputProps
|
|
346
347
|
} = this.props;
|
|
348
|
+
|
|
349
|
+
const inputPropsCls = _get(inputProps, 'className');
|
|
350
|
+
|
|
347
351
|
const inputcls = cls("".concat(prefixcls, "-input"), {
|
|
348
352
|
["".concat(prefixcls, "-input-single")]: !multiple,
|
|
349
353
|
["".concat(prefixcls, "-input-multiple")]: multiple
|
|
350
|
-
});
|
|
354
|
+
}, inputPropsCls);
|
|
351
355
|
const {
|
|
352
356
|
inputValue
|
|
353
357
|
} = this.state;
|
|
354
|
-
|
|
358
|
+
|
|
359
|
+
const selectInputProps = _Object$assign({
|
|
355
360
|
value: inputValue,
|
|
356
361
|
disabled,
|
|
357
362
|
className: inputcls,
|
|
358
363
|
onChange: this.handleInputChange
|
|
359
|
-
};
|
|
364
|
+
}, inputProps);
|
|
365
|
+
|
|
360
366
|
let style = {}; // Multiple choice mode
|
|
361
367
|
|
|
362
368
|
if (multiple) {
|
|
363
369
|
style = {
|
|
364
370
|
width: inputValue ? "".concat(inputValue.length * 16, "px") : '2px'
|
|
365
371
|
};
|
|
366
|
-
|
|
372
|
+
selectInputProps.style = style;
|
|
367
373
|
}
|
|
368
374
|
|
|
369
375
|
return /*#__PURE__*/React.createElement(Input, _Object$assign({
|
|
370
376
|
ref: this.inputRef,
|
|
371
|
-
size: size
|
|
372
|
-
}, inputProps, {
|
|
377
|
+
size: size,
|
|
373
378
|
onFocus: e => {
|
|
374
379
|
// prevent event bubbling which will fire trigger onFocus event
|
|
375
380
|
e.stopPropagation(); // e.nativeEvent.stopImmediatePropagation();
|
|
376
381
|
}
|
|
377
|
-
}));
|
|
382
|
+
}, selectInputProps));
|
|
378
383
|
}
|
|
379
384
|
|
|
380
385
|
close() {
|
|
@@ -704,7 +709,9 @@ class Select extends BaseComponent {
|
|
|
704
709
|
key: value
|
|
705
710
|
}), content);
|
|
706
711
|
} else {
|
|
707
|
-
return
|
|
712
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
713
|
+
key: value
|
|
714
|
+
}, content);
|
|
708
715
|
}
|
|
709
716
|
});
|
|
710
717
|
|
|
@@ -818,6 +825,7 @@ class Select extends BaseComponent {
|
|
|
818
825
|
multiple,
|
|
819
826
|
filter,
|
|
820
827
|
style,
|
|
828
|
+
id,
|
|
821
829
|
size,
|
|
822
830
|
className,
|
|
823
831
|
validateStatus,
|
|
@@ -891,6 +899,7 @@ class Select extends BaseComponent {
|
|
|
891
899
|
ref: ref => this.triggerRef.current = ref,
|
|
892
900
|
onClick: e => this.foundation.handleClick(e),
|
|
893
901
|
style: style,
|
|
902
|
+
id: id,
|
|
894
903
|
tabIndex: tabIndex,
|
|
895
904
|
onMouseEnter: this.onMouseEnter,
|
|
896
905
|
onMouseLeave: this.onMouseLeave,
|
|
@@ -976,6 +985,7 @@ Select.propTypes = {
|
|
|
976
985
|
dropdownStyle: PropTypes.object,
|
|
977
986
|
outerTopSlot: PropTypes.node,
|
|
978
987
|
innerTopSlot: PropTypes.node,
|
|
988
|
+
inputProps: PropTypes.object,
|
|
979
989
|
outerBottomSlot: PropTypes.node,
|
|
980
990
|
innerBottomSlot: PropTypes.node,
|
|
981
991
|
optionList: PropTypes.array,
|
|
@@ -3,28 +3,31 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/timeline/timeline.css';
|
|
4
4
|
export interface TimelineItemProps {
|
|
5
5
|
color?: string;
|
|
6
|
-
time?:
|
|
6
|
+
time?: React.ReactNode;
|
|
7
7
|
type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
|
|
8
8
|
dot?: React.ReactNode;
|
|
9
9
|
extra?: React.ReactNode;
|
|
10
10
|
position?: 'left' | 'right';
|
|
11
11
|
className?: string;
|
|
12
12
|
style?: React.CSSProperties;
|
|
13
|
+
onClick?: React.MouseEventHandler<HTMLLIElement>;
|
|
13
14
|
}
|
|
14
15
|
export default class Item extends PureComponent<TimelineItemProps> {
|
|
15
16
|
static propTypes: {
|
|
16
17
|
color: PropTypes.Requireable<string>;
|
|
17
|
-
time: PropTypes.Requireable<
|
|
18
|
+
time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
18
19
|
type: PropTypes.Requireable<string>;
|
|
19
20
|
dot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
21
|
extra: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
21
22
|
position: PropTypes.Requireable<string>;
|
|
22
23
|
className: PropTypes.Requireable<string>;
|
|
23
24
|
style: PropTypes.Requireable<object>;
|
|
25
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
24
26
|
};
|
|
25
27
|
static defaultProps: {
|
|
26
28
|
type: string;
|
|
27
29
|
time: string;
|
|
30
|
+
onClick: (...args: any[]) => void;
|
|
28
31
|
};
|
|
29
32
|
render(): JSX.Element;
|
|
30
33
|
}
|
package/lib/es/timeline/item.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _noop from "lodash/noop";
|
|
1
2
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
2
3
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
3
4
|
import React, { PureComponent } from 'react';
|
|
@@ -18,7 +19,8 @@ export default class Item extends PureComponent {
|
|
|
18
19
|
type,
|
|
19
20
|
style,
|
|
20
21
|
time,
|
|
21
|
-
extra
|
|
22
|
+
extra,
|
|
23
|
+
onClick
|
|
22
24
|
} = this.props;
|
|
23
25
|
const itemCls = cls(prefixCls, className);
|
|
24
26
|
const dotCls = cls({
|
|
@@ -33,16 +35,17 @@ export default class Item extends PureComponent {
|
|
|
33
35
|
} : null;
|
|
34
36
|
return /*#__PURE__*/React.createElement("li", {
|
|
35
37
|
className: itemCls,
|
|
36
|
-
style: style
|
|
38
|
+
style: style,
|
|
39
|
+
onClick: onClick
|
|
37
40
|
}, /*#__PURE__*/React.createElement("div", {
|
|
38
41
|
className: "".concat(prefixCls, "-tail")
|
|
39
42
|
}), /*#__PURE__*/React.createElement("div", _Object$assign({
|
|
40
43
|
className: dotCls
|
|
41
44
|
}, dotStyle), dot), /*#__PURE__*/React.createElement("div", {
|
|
42
45
|
className: "".concat(prefixCls, "-content")
|
|
43
|
-
}, children, extra
|
|
46
|
+
}, children, extra && /*#__PURE__*/React.createElement("div", {
|
|
44
47
|
className: "".concat(prefixCls, "-content-extra")
|
|
45
|
-
}, extra)
|
|
48
|
+
}, extra), time && /*#__PURE__*/React.createElement("div", {
|
|
46
49
|
className: "".concat(prefixCls, "-content-time")
|
|
47
50
|
}, time)));
|
|
48
51
|
}
|
|
@@ -50,15 +53,17 @@ export default class Item extends PureComponent {
|
|
|
50
53
|
}
|
|
51
54
|
Item.propTypes = {
|
|
52
55
|
color: PropTypes.string,
|
|
53
|
-
time: PropTypes.
|
|
56
|
+
time: PropTypes.node,
|
|
54
57
|
type: PropTypes.oneOf(strings.ITEM_TYPE),
|
|
55
58
|
dot: PropTypes.node,
|
|
56
59
|
extra: PropTypes.node,
|
|
57
60
|
position: PropTypes.oneOf(strings.ITEM_POS),
|
|
58
61
|
className: PropTypes.string,
|
|
59
|
-
style: PropTypes.object
|
|
62
|
+
style: PropTypes.object,
|
|
63
|
+
onClick: PropTypes.func
|
|
60
64
|
};
|
|
61
65
|
Item.defaultProps = {
|
|
62
66
|
type: 'default',
|
|
63
|
-
time: ''
|
|
67
|
+
time: '',
|
|
68
|
+
onClick: _noop
|
|
64
69
|
};
|
package/lib/es/tree/treeNode.js
CHANGED
|
@@ -26,6 +26,7 @@ declare class FileCard extends PureComponent<FileCardProps> {
|
|
|
26
26
|
style: PropTypes.Requireable<object>;
|
|
27
27
|
url: PropTypes.Requireable<string>;
|
|
28
28
|
validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
29
|
+
index: PropTypes.Requireable<number>;
|
|
29
30
|
};
|
|
30
31
|
static defaultProps: {
|
|
31
32
|
listType: "list";
|
|
@@ -39,6 +40,7 @@ declare class FileCard extends PureComponent<FileCardProps> {
|
|
|
39
40
|
renderValidateMessage(): ReactNode;
|
|
40
41
|
renderPicValidateMsg(): ReactNode;
|
|
41
42
|
renderPic(locale: Locale['Upload']): ReactNode;
|
|
43
|
+
renderFile(locale: Locale["Upload"]): JSX.Element;
|
|
42
44
|
onRemove(e: MouseEvent): void;
|
|
43
45
|
onReplace(e: MouseEvent): void;
|
|
44
46
|
onRetry(e: MouseEvent): void;
|