@douyinfe/semi-ui 2.20.3 → 2.21.0-beta.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.
@@ -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 // onPressEnter: () => undefined,
432
+ emptyContent: null,
433
+ onKeyDown: _noop2.default // onPressEnter: () => undefined,
429
434
  // defaultOpen: false,
430
435
 
431
436
  };
@@ -238,7 +238,7 @@ class Dropdown extends _baseComponent.default {
238
238
  onKeyDown: e => {
239
239
  this.foundation.handleKeyDown(e);
240
240
  const childrenKeyDown = (0, _get2.default)(children, 'props.onKeyDown');
241
- childrenKeyDown && childrenKeyDown();
241
+ childrenKeyDown && childrenKeyDown(e);
242
242
  }
243
243
  }) : children);
244
244
  }
@@ -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 téléchargement',
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;
@@ -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: "".concat(prefixCls, "-header"),
93
+ className: headTableCls,
84
94
  ref: forwardedRef,
85
95
  onScroll: handleBodyScroll
86
96
  }, /*#__PURE__*/_react.default.createElement(Table, {
@@ -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 {};
@@ -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;
@@ -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 // onPressEnter: () => undefined,
408
+ emptyContent: null,
409
+ onKeyDown: _noop // onPressEnter: () => undefined,
405
410
  // defaultOpen: false,
406
411
 
407
412
  };
@@ -216,7 +216,7 @@ class Dropdown extends BaseComponent {
216
216
 
217
217
  const childrenKeyDown = _get(children, 'props.onKeyDown');
218
218
 
219
- childrenKeyDown && childrenKeyDown();
219
+ childrenKeyDown && childrenKeyDown(e);
220
220
  }
221
221
  }) : children);
222
222
  }
@@ -120,7 +120,7 @@ const local = {
120
120
  Upload: {
121
121
  mainText: 'Cliquez pour télécharger le fichier ou faites glisser le fichier vers ici',
122
122
  illegalTips: 'Ce type de fichier n\'est pas pris en charge',
123
- legalTips: 'Libérer et commencer le téléchargement',
123
+ legalTips: 'Libérer et commencer le chargement',
124
124
  retry: 'Réessayer',
125
125
  replace: 'Remplacer le fichier',
126
126
  clear: 'Supprimer',