@douyinfe/semi-ui 2.20.7 → 2.20.9-alpha.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/dist/css/semi.css +14 -7
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +264 -222
- 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/lib/cjs/autoComplete/index.d.ts +3 -0
- package/lib/cjs/autoComplete/index.js +6 -1
- package/lib/cjs/datePicker/month.js +5 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/form/interface.d.ts +1 -1
- package/lib/cjs/locale/source/fr.js +1 -1
- package/lib/cjs/locale/source/ro.d.ts +156 -0
- package/lib/cjs/locale/source/ro.js +165 -0
- package/lib/cjs/modal/ModalContent.js +2 -2
- package/lib/cjs/select/index.d.ts +2 -2
- package/lib/cjs/select/index.js +2 -2
- package/lib/cjs/table/HeadTable.js +12 -2
- package/lib/cjs/table/Table.js +10 -3
- package/lib/cjs/table/interface.d.ts +4 -0
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/index.d.ts +5 -0
- package/lib/cjs/upload/index.js +9 -0
- package/lib/es/autoComplete/index.d.ts +3 -0
- package/lib/es/autoComplete/index.js +6 -1
- package/lib/es/datePicker/month.js +5 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/form/interface.d.ts +1 -1
- package/lib/es/locale/source/fr.js +1 -1
- package/lib/es/locale/source/ro.d.ts +156 -0
- package/lib/es/locale/source/ro.js +157 -0
- package/lib/es/modal/ModalContent.js +2 -2
- package/lib/es/select/index.d.ts +2 -2
- package/lib/es/select/index.js +2 -2
- package/lib/es/table/HeadTable.js +13 -2
- package/lib/es/table/Table.js +10 -3
- package/lib/es/table/interface.d.ts +4 -0
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/index.d.ts +5 -0
- package/lib/es/upload/index.js +9 -0
- package/package.json +7 -7
|
@@ -55,6 +55,7 @@ export interface AutoCompleteProps<T extends AutoCompleteItems> {
|
|
|
55
55
|
onChangeWithObject?: boolean;
|
|
56
56
|
onSelectWithObject?: boolean;
|
|
57
57
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
58
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
58
59
|
prefix?: React.ReactNode;
|
|
59
60
|
placeholder?: string;
|
|
60
61
|
position?: Position;
|
|
@@ -113,6 +114,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
113
114
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
114
115
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
115
116
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
117
|
+
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
116
118
|
position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
|
|
117
119
|
placeholder: PropTypes.Requireable<string>;
|
|
118
120
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -159,6 +161,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
159
161
|
validateStatus: "default";
|
|
160
162
|
autoFocus: boolean;
|
|
161
163
|
emptyContent: null;
|
|
164
|
+
onKeyDown: (...args: any[]) => void;
|
|
162
165
|
};
|
|
163
166
|
triggerRef: React.RefObject<HTMLDivElement> | null;
|
|
164
167
|
optionsRef: React.RefObject<HTMLDivElement> | null;
|
|
@@ -158,6 +158,9 @@ class AutoComplete extends _baseComponent.default {
|
|
|
158
158
|
notifyBlur: event => {
|
|
159
159
|
this.props.onBlur(event);
|
|
160
160
|
},
|
|
161
|
+
notifyKeyDown: e => {
|
|
162
|
+
this.props.onKeyDown(e);
|
|
163
|
+
},
|
|
161
164
|
rePositionDropdown: () => {
|
|
162
165
|
let {
|
|
163
166
|
rePosKey
|
|
@@ -380,6 +383,7 @@ AutoComplete.propTypes = {
|
|
|
380
383
|
onBlur: _propTypes.default.func,
|
|
381
384
|
onFocus: _propTypes.default.func,
|
|
382
385
|
onChange: _propTypes.default.func,
|
|
386
|
+
onKeyDown: _propTypes.default.func,
|
|
383
387
|
position: _propTypes.default.oneOf(positionSet),
|
|
384
388
|
placeholder: _propTypes.default.string,
|
|
385
389
|
prefix: _propTypes.default.node,
|
|
@@ -425,7 +429,8 @@ AutoComplete.defaultProps = {
|
|
|
425
429
|
maxHeight: 300,
|
|
426
430
|
validateStatus: 'default',
|
|
427
431
|
autoFocus: false,
|
|
428
|
-
emptyContent: null
|
|
432
|
+
emptyContent: null,
|
|
433
|
+
onKeyDown: _noop2.default // onPressEnter: () => undefined,
|
|
429
434
|
// defaultOpen: false,
|
|
430
435
|
|
|
431
436
|
};
|
|
@@ -85,6 +85,9 @@ class Month extends _baseComponent.default {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
getSingleDayStatus(options) {
|
|
88
|
+
const {
|
|
89
|
+
rangeInputFocus
|
|
90
|
+
} = this.props;
|
|
88
91
|
const {
|
|
89
92
|
fullDate,
|
|
90
93
|
todayText,
|
|
@@ -95,7 +98,8 @@ class Month extends _baseComponent.default {
|
|
|
95
98
|
} = options;
|
|
96
99
|
const disabledOptions = {
|
|
97
100
|
rangeStart,
|
|
98
|
-
rangeEnd
|
|
101
|
+
rangeEnd,
|
|
102
|
+
rangeInputFocus
|
|
99
103
|
};
|
|
100
104
|
const isToday = fullDate === todayText;
|
|
101
105
|
const isSelected = selected.has(fullDate);
|
|
@@ -126,7 +126,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
128
|
preventScroll?: boolean;
|
|
129
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
129
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
130
130
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
131
131
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
132
132
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
76
|
preventScroll?: boolean;
|
|
77
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
77
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
78
78
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
79
79
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
80
80
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
@@ -10,7 +10,7 @@ import { CheckboxProps } from '../checkbox/index';
|
|
|
10
10
|
import { RadioProps } from '../radio/index';
|
|
11
11
|
import { ReactFieldError as FieldError } from './errorMessage';
|
|
12
12
|
import { LabelProps } from './label';
|
|
13
|
-
export { FormState, FormApi, WithFieldOption };
|
|
13
|
+
export { FormState, FormApi, WithFieldOption, RuleItem };
|
|
14
14
|
export declare type CommonFieldProps = {
|
|
15
15
|
/** Field is required (except Form. Checkbox within the Group, Form. Radio) */
|
|
16
16
|
field: string;
|
|
@@ -128,7 +128,7 @@ const local = {
|
|
|
128
128
|
Upload: {
|
|
129
129
|
mainText: 'Cliquez pour télécharger le fichier ou faites glisser le fichier vers ici',
|
|
130
130
|
illegalTips: 'Ce type de fichier n\'est pas pris en charge',
|
|
131
|
-
legalTips: 'Libérer et commencer le
|
|
131
|
+
legalTips: 'Libérer et commencer le chargement',
|
|
132
132
|
retry: 'Réessayer',
|
|
133
133
|
replace: 'Remplacer le fichier',
|
|
134
134
|
clear: 'Supprimer',
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
code: string;
|
|
3
|
+
dateFnsLocale: Locale;
|
|
4
|
+
Pagination: {
|
|
5
|
+
item: string;
|
|
6
|
+
pageSize: string;
|
|
7
|
+
page: string;
|
|
8
|
+
total: string;
|
|
9
|
+
jumpTo: string;
|
|
10
|
+
};
|
|
11
|
+
Modal: {
|
|
12
|
+
confirm: string;
|
|
13
|
+
cancel: string;
|
|
14
|
+
};
|
|
15
|
+
TimePicker: {
|
|
16
|
+
placeholder: {
|
|
17
|
+
time: string;
|
|
18
|
+
timeRange: string;
|
|
19
|
+
};
|
|
20
|
+
begin: string;
|
|
21
|
+
end: string;
|
|
22
|
+
hour: string;
|
|
23
|
+
minute: string;
|
|
24
|
+
second: string;
|
|
25
|
+
AM: string;
|
|
26
|
+
PM: string;
|
|
27
|
+
};
|
|
28
|
+
DatePicker: {
|
|
29
|
+
placeholder: {
|
|
30
|
+
date: string;
|
|
31
|
+
dateTime: string;
|
|
32
|
+
dateRange: string[];
|
|
33
|
+
dateTimeRange: string[];
|
|
34
|
+
};
|
|
35
|
+
footer: {
|
|
36
|
+
confirm: string;
|
|
37
|
+
cancel: string;
|
|
38
|
+
};
|
|
39
|
+
selectDate: string;
|
|
40
|
+
selectTime: string;
|
|
41
|
+
year: string;
|
|
42
|
+
month: string;
|
|
43
|
+
day: string;
|
|
44
|
+
monthText: string;
|
|
45
|
+
months: {
|
|
46
|
+
1: string;
|
|
47
|
+
2: string;
|
|
48
|
+
3: string;
|
|
49
|
+
4: string;
|
|
50
|
+
5: string;
|
|
51
|
+
6: string;
|
|
52
|
+
7: string;
|
|
53
|
+
8: string;
|
|
54
|
+
9: string;
|
|
55
|
+
10: string;
|
|
56
|
+
11: string;
|
|
57
|
+
12: string;
|
|
58
|
+
};
|
|
59
|
+
fullMonths: {
|
|
60
|
+
1: string;
|
|
61
|
+
2: string;
|
|
62
|
+
3: string;
|
|
63
|
+
4: string;
|
|
64
|
+
5: string;
|
|
65
|
+
6: string;
|
|
66
|
+
7: string;
|
|
67
|
+
8: string;
|
|
68
|
+
9: string;
|
|
69
|
+
10: string;
|
|
70
|
+
11: string;
|
|
71
|
+
12: string;
|
|
72
|
+
};
|
|
73
|
+
weeks: {
|
|
74
|
+
Mon: string;
|
|
75
|
+
Tue: string;
|
|
76
|
+
Wed: string;
|
|
77
|
+
Thu: string;
|
|
78
|
+
Fri: string;
|
|
79
|
+
Sat: string;
|
|
80
|
+
Sun: string;
|
|
81
|
+
};
|
|
82
|
+
localeFormatToken: {
|
|
83
|
+
FORMAT_SWITCH_DATE: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
Popconfirm: {
|
|
87
|
+
confirm: string;
|
|
88
|
+
cancel: string;
|
|
89
|
+
};
|
|
90
|
+
Navigation: {
|
|
91
|
+
collapseText: string;
|
|
92
|
+
expandText: string;
|
|
93
|
+
};
|
|
94
|
+
Table: {
|
|
95
|
+
emptyText: string;
|
|
96
|
+
pageText: string;
|
|
97
|
+
};
|
|
98
|
+
Select: {
|
|
99
|
+
emptyText: string;
|
|
100
|
+
createText: string;
|
|
101
|
+
};
|
|
102
|
+
Tree: {
|
|
103
|
+
emptyText: string;
|
|
104
|
+
};
|
|
105
|
+
Cascader: {
|
|
106
|
+
emptyText: string;
|
|
107
|
+
};
|
|
108
|
+
List: {
|
|
109
|
+
emptyText: string;
|
|
110
|
+
};
|
|
111
|
+
Calendar: {
|
|
112
|
+
allDay: string;
|
|
113
|
+
AM: string;
|
|
114
|
+
PM: string;
|
|
115
|
+
datestring: string;
|
|
116
|
+
remaining: string;
|
|
117
|
+
};
|
|
118
|
+
Upload: {
|
|
119
|
+
mainText: string;
|
|
120
|
+
illegalTips: string;
|
|
121
|
+
legalTips: string;
|
|
122
|
+
retry: string;
|
|
123
|
+
replace: string;
|
|
124
|
+
clear: string;
|
|
125
|
+
selectedFiles: string;
|
|
126
|
+
illegalSize: string;
|
|
127
|
+
fail: string;
|
|
128
|
+
};
|
|
129
|
+
TreeSelect: {
|
|
130
|
+
searchPlaceholder: string;
|
|
131
|
+
};
|
|
132
|
+
Typography: {
|
|
133
|
+
copy: string;
|
|
134
|
+
copied: string;
|
|
135
|
+
expand: string;
|
|
136
|
+
collapse: string;
|
|
137
|
+
};
|
|
138
|
+
Transfer: {
|
|
139
|
+
emptyLeft: string;
|
|
140
|
+
emptySearch: string;
|
|
141
|
+
emptyRight: string;
|
|
142
|
+
placeholder: string;
|
|
143
|
+
clear: string;
|
|
144
|
+
selectAll: string;
|
|
145
|
+
clearSelectAll: string;
|
|
146
|
+
total: string;
|
|
147
|
+
selected: string;
|
|
148
|
+
};
|
|
149
|
+
Form: {
|
|
150
|
+
optional: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* [i18n-Romanian]
|
|
155
|
+
*/
|
|
156
|
+
export default _default;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _locale = require("date-fns/locale");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* [i18n-Romanian]
|
|
12
|
+
*/
|
|
13
|
+
var _default = {
|
|
14
|
+
code: 'ro',
|
|
15
|
+
dateFnsLocale: _locale.ro,
|
|
16
|
+
Pagination: {
|
|
17
|
+
item: 'articol',
|
|
18
|
+
pageSize: 'articole/pagină',
|
|
19
|
+
page: ' pagini',
|
|
20
|
+
total: '',
|
|
21
|
+
jumpTo: 'Treci la'
|
|
22
|
+
},
|
|
23
|
+
Modal: {
|
|
24
|
+
confirm: 'Confirmă',
|
|
25
|
+
cancel: 'Anulează'
|
|
26
|
+
},
|
|
27
|
+
TimePicker: {
|
|
28
|
+
placeholder: {
|
|
29
|
+
time: 'Selectează timpul',
|
|
30
|
+
timeRange: 'Selectează o perioadă de timp'
|
|
31
|
+
},
|
|
32
|
+
begin: 'Ora de începere',
|
|
33
|
+
end: 'Ora de încheiere',
|
|
34
|
+
hour: '',
|
|
35
|
+
minute: '',
|
|
36
|
+
second: '',
|
|
37
|
+
AM: 'AM',
|
|
38
|
+
PM: 'PM'
|
|
39
|
+
},
|
|
40
|
+
DatePicker: {
|
|
41
|
+
placeholder: {
|
|
42
|
+
date: 'Selectează data',
|
|
43
|
+
dateTime: 'Selectează data și ora',
|
|
44
|
+
dateRange: ['Data de început', 'Data de sfârșit'],
|
|
45
|
+
dateTimeRange: ['Data de început', 'Data de sfârșit']
|
|
46
|
+
},
|
|
47
|
+
footer: {
|
|
48
|
+
confirm: 'Confirmă',
|
|
49
|
+
cancel: 'Anulează'
|
|
50
|
+
},
|
|
51
|
+
selectDate: 'Selectează data',
|
|
52
|
+
selectTime: 'Selectează timpul',
|
|
53
|
+
year: 'an',
|
|
54
|
+
month: 'lună',
|
|
55
|
+
day: 'zi',
|
|
56
|
+
monthText: '${month} ${year}',
|
|
57
|
+
months: {
|
|
58
|
+
1: 'Ian',
|
|
59
|
+
2: 'Feb',
|
|
60
|
+
3: 'Mar',
|
|
61
|
+
4: 'Apr',
|
|
62
|
+
5: 'Mai',
|
|
63
|
+
6: 'Iun',
|
|
64
|
+
7: 'Iul',
|
|
65
|
+
8: 'Aug',
|
|
66
|
+
9: 'Sep',
|
|
67
|
+
10: 'Oct',
|
|
68
|
+
11: 'Noi',
|
|
69
|
+
12: 'Dec'
|
|
70
|
+
},
|
|
71
|
+
fullMonths: {
|
|
72
|
+
1: 'Ianuarie',
|
|
73
|
+
2: 'Februarie',
|
|
74
|
+
3: 'Martie',
|
|
75
|
+
4: 'Aprilie',
|
|
76
|
+
5: 'Mai',
|
|
77
|
+
6: 'Iunie',
|
|
78
|
+
7: 'Iulie',
|
|
79
|
+
8: 'August',
|
|
80
|
+
9: 'Septembrie',
|
|
81
|
+
10: 'Octombrie',
|
|
82
|
+
11: 'Noiembrie',
|
|
83
|
+
12: 'Decembrie'
|
|
84
|
+
},
|
|
85
|
+
weeks: {
|
|
86
|
+
Mon: 'Lun',
|
|
87
|
+
Tue: 'Mar',
|
|
88
|
+
Wed: 'Mie',
|
|
89
|
+
Thu: 'Joi',
|
|
90
|
+
Fri: 'Vin',
|
|
91
|
+
Sat: 'Sâm',
|
|
92
|
+
Sun: 'dum'
|
|
93
|
+
},
|
|
94
|
+
localeFormatToken: {
|
|
95
|
+
FORMAT_SWITCH_DATE: 'yyyy-MM-dd'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
Popconfirm: {
|
|
99
|
+
confirm: 'Confirmă',
|
|
100
|
+
cancel: 'Anulează'
|
|
101
|
+
},
|
|
102
|
+
Navigation: {
|
|
103
|
+
collapseText: 'Comprimă bara laterală',
|
|
104
|
+
expandText: 'Extinde bara laterală'
|
|
105
|
+
},
|
|
106
|
+
Table: {
|
|
107
|
+
emptyText: 'Nici un rezultat',
|
|
108
|
+
pageText: 'Arată ${currentStart} la ${currentEnd} de ${total}'
|
|
109
|
+
},
|
|
110
|
+
Select: {
|
|
111
|
+
emptyText: 'Nici un rezultat',
|
|
112
|
+
createText: 'Creează'
|
|
113
|
+
},
|
|
114
|
+
Tree: {
|
|
115
|
+
emptyText: 'Nici un rezultat'
|
|
116
|
+
},
|
|
117
|
+
Cascader: {
|
|
118
|
+
emptyText: 'Nici un rezultat'
|
|
119
|
+
},
|
|
120
|
+
List: {
|
|
121
|
+
emptyText: 'Nici un rezultat'
|
|
122
|
+
},
|
|
123
|
+
Calendar: {
|
|
124
|
+
allDay: 'Toată ziua',
|
|
125
|
+
AM: '${time} AM',
|
|
126
|
+
PM: '${time} PM',
|
|
127
|
+
datestring: '',
|
|
128
|
+
remaining: '${remained} plus'
|
|
129
|
+
},
|
|
130
|
+
Upload: {
|
|
131
|
+
mainText: 'Dă clic pentru a descărca fișierul sau trage fișierul aici',
|
|
132
|
+
illegalTips: 'Acest tip de fișier nu este acceptat',
|
|
133
|
+
legalTips: 'Eliberează și începe încărcarea',
|
|
134
|
+
retry: 'Încearcă din nou',
|
|
135
|
+
replace: 'Înlocuiește fișierul',
|
|
136
|
+
clear: 'Șterge',
|
|
137
|
+
selectedFiles: 'Fișiere selectate',
|
|
138
|
+
illegalSize: 'Dimensiunea greșită a fișierului',
|
|
139
|
+
fail: 'Eșec de încărcare'
|
|
140
|
+
},
|
|
141
|
+
TreeSelect: {
|
|
142
|
+
searchPlaceholder: 'Căutare'
|
|
143
|
+
},
|
|
144
|
+
Typography: {
|
|
145
|
+
copy: 'Copiază',
|
|
146
|
+
copied: 'Copiat',
|
|
147
|
+
expand: 'Extinde',
|
|
148
|
+
collapse: 'Comprimare'
|
|
149
|
+
},
|
|
150
|
+
Transfer: {
|
|
151
|
+
emptyLeft: 'Nu există date',
|
|
152
|
+
emptySearch: 'Nu s-au găsit rezultate',
|
|
153
|
+
emptyRight: 'Fără conținut, verifică la stânga',
|
|
154
|
+
placeholder: 'Căutare',
|
|
155
|
+
clear: 'Șterge',
|
|
156
|
+
selectAll: 'Selectează toate',
|
|
157
|
+
clearSelectAll: 'Deselectează toate',
|
|
158
|
+
total: 'Total ${total} articole',
|
|
159
|
+
selected: '${total} articole selectate'
|
|
160
|
+
},
|
|
161
|
+
Form: {
|
|
162
|
+
optional: '(opțional)'
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
exports.default = _default;
|
|
@@ -267,12 +267,12 @@ class ModalContent extends _baseComponent.default {
|
|
|
267
267
|
},
|
|
268
268
|
addKeyDownEventListener: () => {
|
|
269
269
|
if (this.props.closeOnEsc) {
|
|
270
|
-
document.addEventListener('keydown', this.foundation.handleKeyDown
|
|
270
|
+
document.addEventListener('keydown', this.foundation.handleKeyDown);
|
|
271
271
|
}
|
|
272
272
|
},
|
|
273
273
|
removeKeyDownEventListener: () => {
|
|
274
274
|
if (this.props.closeOnEsc) {
|
|
275
|
-
document.removeEventListener('keydown', this.foundation.handleKeyDown
|
|
275
|
+
document.removeEventListener('keydown', this.foundation.handleKeyDown);
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
278
|
getMouseState: () => this.state.dialogMouseDown,
|
|
@@ -6,9 +6,9 @@ import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
|
|
|
6
6
|
import { InputProps } from '../input/index';
|
|
7
7
|
import Option, { OptionProps } from './option';
|
|
8
8
|
import OptionGroup from './optionGroup';
|
|
9
|
-
import { Subtract } from 'utility-types';
|
|
10
9
|
import '@douyinfe/semi-foundation/lib/cjs/select/select.css';
|
|
11
|
-
import { Position, TooltipProps } from '../tooltip';
|
|
10
|
+
import type { Position, TooltipProps } from '../tooltip';
|
|
11
|
+
import type { Subtract } from 'utility-types';
|
|
12
12
|
export type { OptionProps } from './option';
|
|
13
13
|
export type { OptionGroupProps } from './optionGroup';
|
|
14
14
|
export type { VirtualRowProps } from './virtualRow';
|
package/lib/cjs/select/index.js
CHANGED
|
@@ -679,7 +679,7 @@ class Select extends _baseComponent.default {
|
|
|
679
679
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
680
680
|
_react.default.createElement("div", {
|
|
681
681
|
id: "".concat(prefixcls, "-").concat(this.selectOptionListID),
|
|
682
|
-
className: dropdownClassName,
|
|
682
|
+
className: (0, _classnames.default)("".concat(prefixcls, "-option-list-wrapper"), dropdownClassName),
|
|
683
683
|
style: style,
|
|
684
684
|
ref: this.setOptionContainerEl,
|
|
685
685
|
onKeyDown: e => this.foundation.handleContainerKeyDown(e)
|
|
@@ -1190,7 +1190,7 @@ Select.defaultProps = {
|
|
|
1190
1190
|
onBlur: _noop2.default,
|
|
1191
1191
|
onClear: _noop2.default,
|
|
1192
1192
|
onListScroll: _noop2.default,
|
|
1193
|
-
maxHeight:
|
|
1193
|
+
maxHeight: _constants.numbers.LIST_HEIGHT,
|
|
1194
1194
|
dropdownMatchSelectWidth: true,
|
|
1195
1195
|
defaultActiveFirstOption: true,
|
|
1196
1196
|
showArrow: true,
|
|
@@ -46,7 +46,8 @@ class HeadTable extends _react.default.PureComponent {
|
|
|
46
46
|
onDidUpdate,
|
|
47
47
|
showHeader,
|
|
48
48
|
anyColumnFixed,
|
|
49
|
-
bodyHasScrollBar
|
|
49
|
+
bodyHasScrollBar,
|
|
50
|
+
sticky
|
|
50
51
|
} = this.props;
|
|
51
52
|
|
|
52
53
|
if (!showHeader) {
|
|
@@ -77,10 +78,19 @@ class HeadTable extends _react.default.PureComponent {
|
|
|
77
78
|
onDidUpdate: onDidUpdate
|
|
78
79
|
}));
|
|
79
80
|
|
|
81
|
+
const headTableCls = (0, _classnames.default)("".concat(prefixCls, "-header"), {
|
|
82
|
+
["".concat(prefixCls, "-header-sticky")]: sticky
|
|
83
|
+
});
|
|
84
|
+
const stickyTop = (0, _get2.default)(sticky, 'top', 0);
|
|
85
|
+
|
|
86
|
+
if (typeof stickyTop === 'number') {
|
|
87
|
+
headStyle.top = stickyTop;
|
|
88
|
+
}
|
|
89
|
+
|
|
80
90
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
81
91
|
key: "headTable",
|
|
82
92
|
style: headStyle,
|
|
83
|
-
className:
|
|
93
|
+
className: headTableCls,
|
|
84
94
|
ref: forwardedRef,
|
|
85
95
|
onScroll: handleBodyScroll
|
|
86
96
|
}, /*#__PURE__*/_react.default.createElement(Table, {
|
package/lib/cjs/table/Table.js
CHANGED
|
@@ -701,7 +701,8 @@ class Table extends _baseComponent.default {
|
|
|
701
701
|
rowSelection,
|
|
702
702
|
dataSource,
|
|
703
703
|
bodyHasScrollBar,
|
|
704
|
-
disabledRowKeysSet
|
|
704
|
+
disabledRowKeysSet,
|
|
705
|
+
sticky
|
|
705
706
|
} = props;
|
|
706
707
|
const selectedRowKeysSet = (0, _get2.default)(rowSelection, 'selectedRowKeysSet', new Set());
|
|
707
708
|
const headTable = fixed || useFixedHeader ? /*#__PURE__*/_react.default.createElement(_HeadTable.default, {
|
|
@@ -718,7 +719,8 @@ class Table extends _baseComponent.default {
|
|
|
718
719
|
selectedRowKeysSet: selectedRowKeysSet,
|
|
719
720
|
onHeaderRow: onHeaderRow,
|
|
720
721
|
dataSource: dataSource,
|
|
721
|
-
bodyHasScrollBar: bodyHasScrollBar
|
|
722
|
+
bodyHasScrollBar: bodyHasScrollBar,
|
|
723
|
+
sticky: sticky
|
|
722
724
|
}) : null;
|
|
723
725
|
|
|
724
726
|
const bodyTable = /*#__PURE__*/_react.default.createElement(_Body.default, Object.assign({}, (0, _omit2.default)(props, ['rowSelection', 'headWidths']), {
|
|
@@ -1037,13 +1039,18 @@ class Table extends _baseComponent.default {
|
|
|
1037
1039
|
isAnyColumnFixed: columns => (0, _some2.default)(this.getColumns(columns || this.props.columns, this.props.children), column => Boolean(column.fixed)),
|
|
1038
1040
|
useFixedHeader: () => {
|
|
1039
1041
|
const {
|
|
1040
|
-
scroll
|
|
1042
|
+
scroll,
|
|
1043
|
+
sticky
|
|
1041
1044
|
} = this.props;
|
|
1042
1045
|
|
|
1043
1046
|
if ((0, _get2.default)(scroll, 'y')) {
|
|
1044
1047
|
return true;
|
|
1045
1048
|
}
|
|
1046
1049
|
|
|
1050
|
+
if (sticky) {
|
|
1051
|
+
return true;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1047
1054
|
return false;
|
|
1048
1055
|
},
|
|
1049
1056
|
setHeadWidths: function (headWidths) {
|
|
@@ -55,6 +55,7 @@ export interface TableProps<RecordType extends Record<string, any> = any> extend
|
|
|
55
55
|
onGroupedRow?: OnGroupedRow<RecordType>;
|
|
56
56
|
onHeaderRow?: OnHeaderRow<RecordType>;
|
|
57
57
|
onRow?: OnRow<RecordType>;
|
|
58
|
+
sticky?: Sticky;
|
|
58
59
|
}
|
|
59
60
|
export interface ColumnProps<RecordType extends Record<string, any> = any> {
|
|
60
61
|
[x: string]: any;
|
|
@@ -288,4 +289,7 @@ export declare type BodyScrollPosition = 'both' | 'middle' | 'left' | 'right';
|
|
|
288
289
|
export declare type TableLocale = Locale['Table'];
|
|
289
290
|
export declare type Direction = CSSDirection;
|
|
290
291
|
export declare type IncludeGroupRecord<RecordType> = BaseIncludeGroupRecord<RecordType>;
|
|
292
|
+
export declare type Sticky = boolean | {
|
|
293
|
+
top?: number;
|
|
294
|
+
};
|
|
291
295
|
export {};
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 6 | 5>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -184,6 +184,11 @@ declare class Upload extends BaseComponent<UploadProps, UploadState> {
|
|
|
184
184
|
* manual upload by user
|
|
185
185
|
*/
|
|
186
186
|
upload: () => void;
|
|
187
|
+
/**
|
|
188
|
+
* ref method
|
|
189
|
+
* manual open file select dialog
|
|
190
|
+
*/
|
|
191
|
+
openFileDialog: () => void;
|
|
187
192
|
renderFile: (file: FileItem, index: number, locale: Locale['Upload']) => ReactNode;
|
|
188
193
|
renderFileList: () => ReactNode;
|
|
189
194
|
renderFileListPic: () => JSX.Element;
|
package/lib/cjs/upload/index.js
CHANGED
|
@@ -114,6 +114,15 @@ class Upload extends _baseComponent.default {
|
|
|
114
114
|
} = this.state;
|
|
115
115
|
this.foundation.startUpload(fileList);
|
|
116
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* ref method
|
|
119
|
+
* manual open file select dialog
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
this.openFileDialog = () => {
|
|
124
|
+
this.onClick();
|
|
125
|
+
};
|
|
117
126
|
|
|
118
127
|
this.renderFile = (file, index, locale) => {
|
|
119
128
|
const {
|
|
@@ -55,6 +55,7 @@ export interface AutoCompleteProps<T extends AutoCompleteItems> {
|
|
|
55
55
|
onChangeWithObject?: boolean;
|
|
56
56
|
onSelectWithObject?: boolean;
|
|
57
57
|
onDropdownVisibleChange?: (visible: boolean) => void;
|
|
58
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
58
59
|
prefix?: React.ReactNode;
|
|
59
60
|
placeholder?: string;
|
|
60
61
|
position?: Position;
|
|
@@ -113,6 +114,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
113
114
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
114
115
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
115
116
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
117
|
+
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
|
|
116
118
|
position: PropTypes.Requireable<"left" | "top" | "right" | "bottom" | "topLeft" | "topRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | "bottomLeft" | "bottomRight" | "leftTopOver" | "rightTopOver" | "leftBottomOver" | "rightBottomOver">;
|
|
117
119
|
placeholder: PropTypes.Requireable<string>;
|
|
118
120
|
prefix: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
@@ -159,6 +161,7 @@ declare class AutoComplete<T extends AutoCompleteItems> extends BaseComponent<Au
|
|
|
159
161
|
validateStatus: "default";
|
|
160
162
|
autoFocus: boolean;
|
|
161
163
|
emptyContent: null;
|
|
164
|
+
onKeyDown: (...args: any[]) => void;
|
|
162
165
|
};
|
|
163
166
|
triggerRef: React.RefObject<HTMLDivElement> | null;
|
|
164
167
|
optionsRef: React.RefObject<HTMLDivElement> | null;
|
|
@@ -134,6 +134,9 @@ class AutoComplete extends BaseComponent {
|
|
|
134
134
|
notifyBlur: event => {
|
|
135
135
|
this.props.onBlur(event);
|
|
136
136
|
},
|
|
137
|
+
notifyKeyDown: e => {
|
|
138
|
+
this.props.onKeyDown(e);
|
|
139
|
+
},
|
|
137
140
|
rePositionDropdown: () => {
|
|
138
141
|
let {
|
|
139
142
|
rePosKey
|
|
@@ -356,6 +359,7 @@ AutoComplete.propTypes = {
|
|
|
356
359
|
onBlur: PropTypes.func,
|
|
357
360
|
onFocus: PropTypes.func,
|
|
358
361
|
onChange: PropTypes.func,
|
|
362
|
+
onKeyDown: PropTypes.func,
|
|
359
363
|
position: PropTypes.oneOf(positionSet),
|
|
360
364
|
placeholder: PropTypes.string,
|
|
361
365
|
prefix: PropTypes.node,
|
|
@@ -401,7 +405,8 @@ AutoComplete.defaultProps = {
|
|
|
401
405
|
maxHeight: 300,
|
|
402
406
|
validateStatus: 'default',
|
|
403
407
|
autoFocus: false,
|
|
404
|
-
emptyContent: null
|
|
408
|
+
emptyContent: null,
|
|
409
|
+
onKeyDown: _noop // onPressEnter: () => undefined,
|
|
405
410
|
// defaultOpen: false,
|
|
406
411
|
|
|
407
412
|
};
|