@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.1.06",
3
+ "version": "1.1.08",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -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
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "tableHeadings": {
3
- "key": "Chave",
4
- "name": "Nome",
5
- "mecanographicNumber": "Número Mecanográfico",
6
- "store": "Loja",
7
- "role": "Posição",
8
- "type": "Tipo",
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": "Ação"
10
+ "action": "Action"
11
11
  },
12
12
  "userInfoColumn": {
13
- "Date": "Data",
14
- "Store": "Loja",
15
- "Team": "Equipa em Gestão",
13
+ "Date": "Date",
14
+ "Store": "Store",
15
+ "Team": "Team",
16
16
  "Supervisor": "Supervisor",
17
- "TypeOfContract": "Tipo de contrato",
18
- "Nationality": "Nacionalidade",
19
- "CivilStatus": "Estado Civil",
20
- "IdentificationDocument": "Doc.Identificação",
21
- "NTaxpayer": " Contribuinte",
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": "Nr Segurança Social",
24
- "NChildren": " Filhos",
25
- "Workload": "Carga horária",
26
- "Description": "Descrição",
27
- "Comments": "Comentários"
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": "Voltar Atrás ENG",
31
- "logout": "Terminar Sessão ENG",
32
- "home": "Início ENG"
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": "Adicionar questão",
41
- "placeholderInfo": "Informação da questão",
42
- "errorInfo": "Informação da questão em falta",
43
- "placeholderQuestion": "Questão",
44
- "errorQuestion": "Questão em falta",
45
- "placeholderGrade": "Ponderação",
46
- "errorGrade": "Ponderação em falta",
47
- "newCategory": "Nova categoria"
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": "Adicionar categoria",
51
- "removeCategory": "Remover categoria"
50
+ "addCategory": "Add Category",
51
+ "removeCategory": "Remove Category"
52
52
  },
53
53
  "categoryContent": {
54
- "message": "Por favor selecione uma categoria na barra lateral",
55
- "categoryName": "Nome da categoria",
56
- "categoryNameError": "Nome categoria em falta",
57
- "weighting": "Ponderação",
58
- "openAnswer": "Resposta aberta",
59
- "answerOption": "Opção de resposta",
60
- "answers": "Questões"
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": "Não Aplicável",
64
- "answer": "Resposta"
63
+ "notApplicable": "Not Applicable",
64
+ "answer": "Answer"
65
65
  },
66
66
  "categoryReadOnly": {
67
- "categories": "Categorias",
68
- "categoryAverage": "Ponderação da categoria",
69
- "userResponse": "Resposta Utilizador:",
70
- "supervisorResponse": "Resposta Supervisor:"
67
+ "categories": "Categories",
68
+ "categoryAverage": "Category Average",
69
+ "userResponse": "User Response:",
70
+ "supervisorResponse": "Supervisor Response:"
71
71
  },
72
72
  "analyticsBar": {
73
- "desc": "Decrescente",
74
- "asc": "Crescente"
73
+ "desc": "Descending",
74
+ "asc": "Ascending"
75
75
  },
76
76
  "tag": {
77
- "search": "Procurar",
78
- "advancedFields": "Filtros avançados"
77
+ "search": "Search",
78
+ "advancedFields": "Advanced Filters"
79
79
  },
80
80
  "table": {
81
- "selectAll": "Selecionar todos",
82
- "deselectAll": "Desselecionar Todos"
81
+ "selectAll": "Select All",
82
+ "deselectAll": "Deselect All"
83
83
  },
84
84
  "datePickerTag": {
85
- "placeholder": "Selecionar Data"
85
+ "placeholder": "Select Date"
86
86
  }
87
87
  }
88
88
  }