@douyinfe/semi-ui 2.20.1 → 2.21.0-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 +7 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +287 -3112
- 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/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/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/upload/index.d.ts +5 -0
- package/lib/cjs/upload/index.js +9 -0
- 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/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/upload/index.d.ts +5 -0
- package/lib/es/upload/index.js +9 -0
- package/package.json +7 -7
|
@@ -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
|
+
};
|
|
@@ -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:
|
|
79
|
+
className: headTableCls,
|
|
69
80
|
ref: forwardedRef,
|
|
70
81
|
onScroll: handleBodyScroll
|
|
71
82
|
}, /*#__PURE__*/React.createElement(Table, {
|
package/lib/es/table/Table.js
CHANGED
|
@@ -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 {};
|
package/lib/es/upload/index.d.ts
CHANGED
|
@@ -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/es/upload/index.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "2.21.0-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.
|
|
22
|
-
"@douyinfe/semi-foundation": "2.
|
|
23
|
-
"@douyinfe/semi-icons": "2.
|
|
21
|
+
"@douyinfe/semi-animation-react": "2.21.0-alpha.0",
|
|
22
|
+
"@douyinfe/semi-foundation": "2.21.0-alpha.0",
|
|
23
|
+
"@douyinfe/semi-icons": "2.21.0-alpha.0",
|
|
24
24
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
25
|
-
"@douyinfe/semi-theme-default": "2.
|
|
25
|
+
"@douyinfe/semi-theme-default": "2.21.0-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": "
|
|
72
|
+
"gitHead": "689c04c44cdfda8c477e77785f47c1be3743e11e",
|
|
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.
|
|
78
|
+
"@douyinfe/semi-scss-compile": "2.21.0-alpha.0",
|
|
79
79
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
80
|
"@types/lodash": "^4.14.176",
|
|
81
81
|
"@types/react": ">=16.0.0",
|