@omniumretail/component-library 1.1.6 → 1.1.8
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.
|
@@ -37,5 +37,9 @@ export interface TableCustomProps extends TableProps<any> {
|
|
|
37
37
|
dataIndex: string;
|
|
38
38
|
side: 'left' | 'right';
|
|
39
39
|
}[];
|
|
40
|
+
customColumnWidths?: {
|
|
41
|
+
columnName: string;
|
|
42
|
+
width: string;
|
|
43
|
+
}[];
|
|
40
44
|
}
|
|
41
45
|
export declare const Table: (props: TableCustomProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ const Template: Story<TableCustomProps> = (args) => {
|
|
|
23
23
|
return <Table scroll={{y: 1000, x: 3000}} fixedColumns={[
|
|
24
24
|
{ dataIndex: 'name', side: 'left' },
|
|
25
25
|
{ dataIndex: 'mecanographicNumber', side: 'left' },
|
|
26
|
-
]} columnsSortChange={handleSortByColumnChange} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} rowSelectionInfo={setRowSelectionInfo} actionsArray={
|
|
26
|
+
]} customColumnWidths={[{columnName: 'name', width: "2%"}]} columnsSortChange={handleSortByColumnChange} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} rowSelectionInfo={setRowSelectionInfo} actionsArray={
|
|
27
27
|
[
|
|
28
28
|
{ key: '1', label: `${t('actions.one')}`, onClick: () => {
|
|
29
29
|
console.log('onClick');
|
|
@@ -46,6 +46,7 @@ export interface TableCustomProps extends TableProps<any> {
|
|
|
46
46
|
sortByColumns?: boolean;
|
|
47
47
|
columnsToSort?: string[];
|
|
48
48
|
fixedColumns?: { dataIndex: string; side: 'left' | 'right' }[];
|
|
49
|
+
customColumnWidths?: { columnName: string; width: string }[];
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
export const Table = (props: TableCustomProps) => {
|
|
@@ -69,7 +70,8 @@ export const Table = (props: TableCustomProps) => {
|
|
|
69
70
|
tableMaxHeight,
|
|
70
71
|
sortByColumns,
|
|
71
72
|
columnsToSort,
|
|
72
|
-
fixedColumns
|
|
73
|
+
fixedColumns,
|
|
74
|
+
customColumnWidths
|
|
73
75
|
} = props;
|
|
74
76
|
|
|
75
77
|
const [customFilters, setCustomFilters] = useState<any>([]);
|
|
@@ -219,6 +221,16 @@ export const Table = (props: TableCustomProps) => {
|
|
|
219
221
|
});
|
|
220
222
|
}
|
|
221
223
|
|
|
224
|
+
if (customColumnWidths) {
|
|
225
|
+
customColumnWidths.forEach((column) => {
|
|
226
|
+
const { columnName, width } = column;
|
|
227
|
+
const foundColumn = columns.find((col: any) => col.dataIndex === columnName);
|
|
228
|
+
if (foundColumn) {
|
|
229
|
+
foundColumn.width = width;
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
|
|
222
234
|
setCustomColumns(columns);
|
|
223
235
|
|
|
224
236
|
// Filters
|
package/src/locales/en.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"tableHeadings": {
|
|
3
|
-
"key": "
|
|
4
|
-
"name": "
|
|
5
|
-
"mecanographicNumber": "
|
|
6
|
-
"store": "
|
|
7
|
-
"role": "
|
|
8
|
-
"type": "
|
|
3
|
+
"key": "Key",
|
|
4
|
+
"name": "Name",
|
|
5
|
+
"mecanographicNumber": "Employee Code",
|
|
6
|
+
"store": "Store",
|
|
7
|
+
"role": "Role",
|
|
8
|
+
"type": "Type",
|
|
9
9
|
"id": "Id",
|
|
10
|
-
"action": "
|
|
10
|
+
"action": "Action"
|
|
11
11
|
},
|
|
12
12
|
"userInfoColumn": {
|
|
13
|
-
"Date": "
|
|
14
|
-
"Store": "
|
|
15
|
-
"Team": "
|
|
13
|
+
"Date": "Date",
|
|
14
|
+
"Store": "Store",
|
|
15
|
+
"Team": "Team",
|
|
16
16
|
"Supervisor": "Supervisor",
|
|
17
|
-
"TypeOfContract": "
|
|
18
|
-
"Nationality": "
|
|
19
|
-
"CivilStatus": "
|
|
20
|
-
"IdentificationDocument": "
|
|
21
|
-
"NTaxpayer": "
|
|
17
|
+
"TypeOfContract": "Type Of Contract",
|
|
18
|
+
"Nationality": "Nationality",
|
|
19
|
+
"CivilStatus": "Civil Status",
|
|
20
|
+
"IdentificationDocument": "Identification Document",
|
|
21
|
+
"NTaxpayer": "Taxpayer Number",
|
|
22
22
|
"NIB": "NIB",
|
|
23
|
-
"SocialSecurity": "
|
|
24
|
-
"NChildren": "
|
|
25
|
-
"Workload": "
|
|
26
|
-
"Description": "
|
|
27
|
-
"Comments": "
|
|
23
|
+
"SocialSecurity": "Social Security",
|
|
24
|
+
"NChildren": "Number of Children",
|
|
25
|
+
"Workload": "Workload",
|
|
26
|
+
"Description": "Description",
|
|
27
|
+
"Comments": "Comments"
|
|
28
28
|
},
|
|
29
29
|
"navigation": {
|
|
30
|
-
"back": "
|
|
31
|
-
"logout": "
|
|
32
|
-
"home": "
|
|
30
|
+
"back": "Back",
|
|
31
|
+
"logout": "Logout",
|
|
32
|
+
"home": "Home"
|
|
33
33
|
},
|
|
34
34
|
"actions": {
|
|
35
35
|
"one": "one",
|
|
@@ -37,52 +37,52 @@
|
|
|
37
37
|
},
|
|
38
38
|
"components": {
|
|
39
39
|
"category": {
|
|
40
|
-
"addQuestion": "
|
|
41
|
-
"placeholderInfo": "
|
|
42
|
-
"errorInfo": "
|
|
43
|
-
"placeholderQuestion": "
|
|
44
|
-
"errorQuestion": "
|
|
45
|
-
"placeholderGrade": "
|
|
46
|
-
"errorGrade": "
|
|
47
|
-
"newCategory": "
|
|
40
|
+
"addQuestion": "Add Question",
|
|
41
|
+
"placeholderInfo": "Placeholder Info",
|
|
42
|
+
"errorInfo": "Error Info",
|
|
43
|
+
"placeholderQuestion": "Question",
|
|
44
|
+
"errorQuestion": "Error/Missing Question",
|
|
45
|
+
"placeholderGrade": "Grade",
|
|
46
|
+
"errorGrade": "Error/Missing Grade",
|
|
47
|
+
"newCategory": "New Category"
|
|
48
48
|
},
|
|
49
49
|
"categorySidBar": {
|
|
50
|
-
"addCategory": "
|
|
51
|
-
"removeCategory": "
|
|
50
|
+
"addCategory": "Add Category",
|
|
51
|
+
"removeCategory": "Remove Category"
|
|
52
52
|
},
|
|
53
53
|
"categoryContent": {
|
|
54
|
-
"message": "
|
|
55
|
-
"categoryName": "
|
|
56
|
-
"categoryNameError": "
|
|
57
|
-
"weighting": "
|
|
58
|
-
"openAnswer": "
|
|
59
|
-
"answerOption": "
|
|
60
|
-
"answers": "
|
|
54
|
+
"message": "Please select a category in the sidebar",
|
|
55
|
+
"categoryName": "Category Name",
|
|
56
|
+
"categoryNameError": "Category Name Error/Missing",
|
|
57
|
+
"weighting": "Weighting",
|
|
58
|
+
"openAnswer": "Open Answer",
|
|
59
|
+
"answerOption": "Answer Option",
|
|
60
|
+
"answers": "Answers"
|
|
61
61
|
},
|
|
62
62
|
"categoryResponse": {
|
|
63
|
-
"notApplicable": "
|
|
64
|
-
"answer": "
|
|
63
|
+
"notApplicable": "Not Applicable",
|
|
64
|
+
"answer": "Answer"
|
|
65
65
|
},
|
|
66
66
|
"categoryReadOnly": {
|
|
67
|
-
"categories": "
|
|
68
|
-
"categoryAverage": "
|
|
69
|
-
"userResponse": "
|
|
70
|
-
"supervisorResponse": "
|
|
67
|
+
"categories": "Categories",
|
|
68
|
+
"categoryAverage": "Category Average",
|
|
69
|
+
"userResponse": "User Response:",
|
|
70
|
+
"supervisorResponse": "Supervisor Response:"
|
|
71
71
|
},
|
|
72
72
|
"analyticsBar": {
|
|
73
|
-
"desc": "
|
|
74
|
-
"asc": "
|
|
73
|
+
"desc": "Descending",
|
|
74
|
+
"asc": "Ascending"
|
|
75
75
|
},
|
|
76
76
|
"tag": {
|
|
77
|
-
"search": "
|
|
78
|
-
"advancedFields": "
|
|
77
|
+
"search": "Search",
|
|
78
|
+
"advancedFields": "Advanced Filters"
|
|
79
79
|
},
|
|
80
80
|
"table": {
|
|
81
|
-
"selectAll": "
|
|
82
|
-
"deselectAll": "
|
|
81
|
+
"selectAll": "Select All",
|
|
82
|
+
"deselectAll": "Deselect All"
|
|
83
83
|
},
|
|
84
84
|
"datePickerTag": {
|
|
85
|
-
"placeholder": "
|
|
85
|
+
"placeholder": "Select Date"
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|