@douyinfe/semi-ui 2.20.8 → 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.
Files changed (37) hide show
  1. package/dist/css/semi.css +7 -0
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +261 -219
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/autoComplete/index.d.ts +3 -0
  8. package/lib/cjs/autoComplete/index.js +6 -1
  9. package/lib/cjs/datePicker/month.js +5 -1
  10. package/lib/cjs/form/baseForm.d.ts +1 -1
  11. package/lib/cjs/form/field.d.ts +1 -1
  12. package/lib/cjs/locale/source/fr.js +1 -1
  13. package/lib/cjs/locale/source/ro.d.ts +156 -0
  14. package/lib/cjs/locale/source/ro.js +165 -0
  15. package/lib/cjs/modal/ModalContent.js +2 -2
  16. package/lib/cjs/table/HeadTable.js +12 -2
  17. package/lib/cjs/table/Table.js +10 -3
  18. package/lib/cjs/table/interface.d.ts +4 -0
  19. package/lib/cjs/typography/title.d.ts +1 -1
  20. package/lib/cjs/upload/index.d.ts +5 -0
  21. package/lib/cjs/upload/index.js +9 -0
  22. package/lib/es/autoComplete/index.d.ts +3 -0
  23. package/lib/es/autoComplete/index.js +6 -1
  24. package/lib/es/datePicker/month.js +5 -1
  25. package/lib/es/form/baseForm.d.ts +1 -1
  26. package/lib/es/form/field.d.ts +1 -1
  27. package/lib/es/locale/source/fr.js +1 -1
  28. package/lib/es/locale/source/ro.d.ts +156 -0
  29. package/lib/es/locale/source/ro.js +157 -0
  30. package/lib/es/modal/ModalContent.js +2 -2
  31. package/lib/es/table/HeadTable.js +13 -2
  32. package/lib/es/table/Table.js +10 -3
  33. package/lib/es/table/interface.d.ts +4 -0
  34. package/lib/es/typography/title.d.ts +1 -1
  35. package/lib/es/upload/index.d.ts +5 -0
  36. package/lib/es/upload/index.js +9 -0
  37. package/package.json +7 -7
@@ -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',
@@ -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,157 @@
1
+ import { ro } from 'date-fns/locale';
2
+ /**
3
+ * [i18n-Romanian]
4
+ */
5
+
6
+ export default {
7
+ code: 'ro',
8
+ dateFnsLocale: ro,
9
+ Pagination: {
10
+ item: 'articol',
11
+ pageSize: 'articole/pagină',
12
+ page: ' pagini',
13
+ total: '',
14
+ jumpTo: 'Treci la'
15
+ },
16
+ Modal: {
17
+ confirm: 'Confirmă',
18
+ cancel: 'Anulează'
19
+ },
20
+ TimePicker: {
21
+ placeholder: {
22
+ time: 'Selectează timpul',
23
+ timeRange: 'Selectează o perioadă de timp'
24
+ },
25
+ begin: 'Ora de începere',
26
+ end: 'Ora de încheiere',
27
+ hour: '',
28
+ minute: '',
29
+ second: '',
30
+ AM: 'AM',
31
+ PM: 'PM'
32
+ },
33
+ DatePicker: {
34
+ placeholder: {
35
+ date: 'Selectează data',
36
+ dateTime: 'Selectează data și ora',
37
+ dateRange: ['Data de început', 'Data de sfârșit'],
38
+ dateTimeRange: ['Data de început', 'Data de sfârșit']
39
+ },
40
+ footer: {
41
+ confirm: 'Confirmă',
42
+ cancel: 'Anulează'
43
+ },
44
+ selectDate: 'Selectează data',
45
+ selectTime: 'Selectează timpul',
46
+ year: 'an',
47
+ month: 'lună',
48
+ day: 'zi',
49
+ monthText: '${month} ${year}',
50
+ months: {
51
+ 1: 'Ian',
52
+ 2: 'Feb',
53
+ 3: 'Mar',
54
+ 4: 'Apr',
55
+ 5: 'Mai',
56
+ 6: 'Iun',
57
+ 7: 'Iul',
58
+ 8: 'Aug',
59
+ 9: 'Sep',
60
+ 10: 'Oct',
61
+ 11: 'Noi',
62
+ 12: 'Dec'
63
+ },
64
+ fullMonths: {
65
+ 1: 'Ianuarie',
66
+ 2: 'Februarie',
67
+ 3: 'Martie',
68
+ 4: 'Aprilie',
69
+ 5: 'Mai',
70
+ 6: 'Iunie',
71
+ 7: 'Iulie',
72
+ 8: 'August',
73
+ 9: 'Septembrie',
74
+ 10: 'Octombrie',
75
+ 11: 'Noiembrie',
76
+ 12: 'Decembrie'
77
+ },
78
+ weeks: {
79
+ Mon: 'Lun',
80
+ Tue: 'Mar',
81
+ Wed: 'Mie',
82
+ Thu: 'Joi',
83
+ Fri: 'Vin',
84
+ Sat: 'Sâm',
85
+ Sun: 'dum'
86
+ },
87
+ localeFormatToken: {
88
+ FORMAT_SWITCH_DATE: 'yyyy-MM-dd'
89
+ }
90
+ },
91
+ Popconfirm: {
92
+ confirm: 'Confirmă',
93
+ cancel: 'Anulează'
94
+ },
95
+ Navigation: {
96
+ collapseText: 'Comprimă bara laterală',
97
+ expandText: 'Extinde bara laterală'
98
+ },
99
+ Table: {
100
+ emptyText: 'Nici un rezultat',
101
+ pageText: 'Arată ${currentStart} la ${currentEnd} de ${total}'
102
+ },
103
+ Select: {
104
+ emptyText: 'Nici un rezultat',
105
+ createText: 'Creează'
106
+ },
107
+ Tree: {
108
+ emptyText: 'Nici un rezultat'
109
+ },
110
+ Cascader: {
111
+ emptyText: 'Nici un rezultat'
112
+ },
113
+ List: {
114
+ emptyText: 'Nici un rezultat'
115
+ },
116
+ Calendar: {
117
+ allDay: 'Toată ziua',
118
+ AM: '${time} AM',
119
+ PM: '${time} PM',
120
+ datestring: '',
121
+ remaining: '${remained} plus'
122
+ },
123
+ Upload: {
124
+ mainText: 'Dă clic pentru a descărca fișierul sau trage fișierul aici',
125
+ illegalTips: 'Acest tip de fișier nu este acceptat',
126
+ legalTips: 'Eliberează și începe încărcarea',
127
+ retry: 'Încearcă din nou',
128
+ replace: 'Înlocuiește fișierul',
129
+ clear: 'Șterge',
130
+ selectedFiles: 'Fișiere selectate',
131
+ illegalSize: 'Dimensiunea greșită a fișierului',
132
+ fail: 'Eșec de încărcare'
133
+ },
134
+ TreeSelect: {
135
+ searchPlaceholder: 'Căutare'
136
+ },
137
+ Typography: {
138
+ copy: 'Copiază',
139
+ copied: 'Copiat',
140
+ expand: 'Extinde',
141
+ collapse: 'Comprimare'
142
+ },
143
+ Transfer: {
144
+ emptyLeft: 'Nu există date',
145
+ emptySearch: 'Nu s-au găsit rezultate',
146
+ emptyRight: 'Fără conținut, verifică la stânga',
147
+ placeholder: 'Căutare',
148
+ clear: 'Șterge',
149
+ selectAll: 'Selectează toate',
150
+ clearSelectAll: 'Deselectează toate',
151
+ total: 'Total ${total} articole',
152
+ selected: '${total} articole selectate'
153
+ },
154
+ Form: {
155
+ optional: '(opțional)'
156
+ }
157
+ };
@@ -242,12 +242,12 @@ export default class ModalContent extends BaseComponent {
242
242
  },
243
243
  addKeyDownEventListener: () => {
244
244
  if (this.props.closeOnEsc) {
245
- document.addEventListener('keydown', this.foundation.handleKeyDown.bind(this.foundation));
245
+ document.addEventListener('keydown', this.foundation.handleKeyDown);
246
246
  }
247
247
  },
248
248
  removeKeyDownEventListener: () => {
249
249
  if (this.props.closeOnEsc) {
250
- document.removeEventListener('keydown', this.foundation.handleKeyDown.bind(this.foundation));
250
+ document.removeEventListener('keydown', this.foundation.handleKeyDown);
251
251
  }
252
252
  },
253
253
  getMouseState: () => this.state.dialogMouseDown,
@@ -31,7 +31,8 @@ class HeadTable extends React.PureComponent {
31
31
  onDidUpdate,
32
32
  showHeader,
33
33
  anyColumnFixed,
34
- bodyHasScrollBar
34
+ bodyHasScrollBar,
35
+ sticky
35
36
  } = this.props;
36
37
 
37
38
  if (!showHeader) {
@@ -62,10 +63,20 @@ class HeadTable extends React.PureComponent {
62
63
  components: components,
63
64
  onDidUpdate: onDidUpdate
64
65
  }));
66
+ const headTableCls = classnames("".concat(prefixCls, "-header"), {
67
+ ["".concat(prefixCls, "-header-sticky")]: sticky
68
+ });
69
+
70
+ const stickyTop = _get(sticky, 'top', 0);
71
+
72
+ if (typeof stickyTop === 'number') {
73
+ headStyle.top = stickyTop;
74
+ }
75
+
65
76
  return /*#__PURE__*/React.createElement("div", {
66
77
  key: "headTable",
67
78
  style: headStyle,
68
- className: "".concat(prefixCls, "-header"),
79
+ className: headTableCls,
69
80
  ref: forwardedRef,
70
81
  onScroll: handleBodyScroll
71
82
  }, /*#__PURE__*/React.createElement(Table, {
@@ -655,7 +655,8 @@ class Table extends BaseComponent {
655
655
  rowSelection,
656
656
  dataSource,
657
657
  bodyHasScrollBar,
658
- disabledRowKeysSet
658
+ disabledRowKeysSet,
659
+ sticky
659
660
  } = props;
660
661
 
661
662
  const selectedRowKeysSet = _get(rowSelection, 'selectedRowKeysSet', new Set());
@@ -674,7 +675,8 @@ class Table extends BaseComponent {
674
675
  selectedRowKeysSet: selectedRowKeysSet,
675
676
  onHeaderRow: onHeaderRow,
676
677
  dataSource: dataSource,
677
- bodyHasScrollBar: bodyHasScrollBar
678
+ bodyHasScrollBar: bodyHasScrollBar,
679
+ sticky: sticky
678
680
  }) : null;
679
681
  const bodyTable = /*#__PURE__*/React.createElement(BodyTable, Object.assign({}, _omit(props, ['rowSelection', 'headWidths']), {
680
682
  key: "body",
@@ -993,13 +995,18 @@ class Table extends BaseComponent {
993
995
  isAnyColumnFixed: columns => _some(this.getColumns(columns || this.props.columns, this.props.children), column => Boolean(column.fixed)),
994
996
  useFixedHeader: () => {
995
997
  const {
996
- scroll
998
+ scroll,
999
+ sticky
997
1000
  } = this.props;
998
1001
 
999
1002
  if (_get(scroll, 'y')) {
1000
1003
  return true;
1001
1004
  }
1002
1005
 
1006
+ if (sticky) {
1007
+ return true;
1008
+ }
1009
+
1003
1010
  return false;
1004
1011
  },
1005
1012
  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<1 | 2 | 3 | 4 | 6 | 5>;
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;
@@ -94,6 +94,15 @@ class Upload extends BaseComponent {
94
94
  } = this.state;
95
95
  this.foundation.startUpload(fileList);
96
96
  };
97
+ /**
98
+ * ref method
99
+ * manual open file select dialog
100
+ */
101
+
102
+
103
+ this.openFileDialog = () => {
104
+ this.onClick();
105
+ };
97
106
 
98
107
  this.renderFile = (file, index, locale) => {
99
108
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.20.8",
3
+ "version": "2.20.9-alpha.0",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -18,11 +18,11 @@
18
18
  ],
19
19
  "dependencies": {
20
20
  "@douyinfe/semi-animation": "2.12.0",
21
- "@douyinfe/semi-animation-react": "2.20.8",
22
- "@douyinfe/semi-foundation": "2.20.8",
23
- "@douyinfe/semi-icons": "2.20.8",
21
+ "@douyinfe/semi-animation-react": "2.20.9-alpha.0",
22
+ "@douyinfe/semi-foundation": "2.20.9-alpha.0",
23
+ "@douyinfe/semi-icons": "2.20.9-alpha.0",
24
24
  "@douyinfe/semi-illustrations": "2.15.0",
25
- "@douyinfe/semi-theme-default": "2.20.8",
25
+ "@douyinfe/semi-theme-default": "2.20.9-alpha.0",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,13 +69,13 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "9e94c35ebc88ffd1ed06cc5057ed90f94132a8f2",
72
+ "gitHead": "023bcb9e58c4d547ac53ca44c6d093eeb9ada6e2",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",
76
76
  "@babel/preset-env": "^7.15.8",
77
77
  "@babel/preset-react": "^7.14.5",
78
- "@douyinfe/semi-scss-compile": "2.20.8",
78
+ "@douyinfe/semi-scss-compile": "2.20.9-alpha.0",
79
79
  "@storybook/addon-knobs": "^6.3.1",
80
80
  "@types/lodash": "^4.14.176",
81
81
  "@types/react": ">=16.0.0",