@omniumretail/component-library 1.1.56 → 1.1.58
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/bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/types/components/Category/CategoryContent/index.d.ts +1 -0
- package/dist/types/components/Category/CategorySidebar/index.d.ts +3 -1
- package/dist/types/components/Category/index.d.ts +1 -0
- package/dist/types/components/Questions/SingleQuestion/index.d.ts +1 -1
- package/dist/types/components/Questions/index.d.ts +1 -0
- package/dist/types/components/ResponsiveTable/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Category/Category.stories.tsx +110 -79
- package/src/components/Category/CategoryContent/index.tsx +41 -12
- package/src/components/Category/CategoryContent/styles.module.scss +9 -0
- package/src/components/Category/CategorySidebar/index.tsx +68 -16
- package/src/components/Category/index.tsx +5 -1
- package/src/components/Questions/SingleQuestion/index.tsx +29 -24
- package/src/components/Questions/index.tsx +5 -2
- package/src/components/ResponsiveTable/ResponsiveTable.stories.tsx +7 -3
- package/src/components/ResponsiveTable/index.tsx +9 -5
- package/src/locales/en.json +4 -1
- package/src/locales/es.json +4 -1
- package/src/locales/pt.json +4 -1
|
@@ -12,6 +12,7 @@ export interface QuestionsProps {
|
|
|
12
12
|
showCheckbox?: boolean;
|
|
13
13
|
handleChanges: any;
|
|
14
14
|
responseTypeOptions: any;
|
|
15
|
+
hasHeader?: boolean;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const Questions = (props: QuestionsProps) => {
|
|
@@ -19,7 +20,8 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
19
20
|
showGrade = true,
|
|
20
21
|
showCheckbox,
|
|
21
22
|
handleChanges,
|
|
22
|
-
responseTypeOptions
|
|
23
|
+
responseTypeOptions,
|
|
24
|
+
hasHeader
|
|
23
25
|
} = props;
|
|
24
26
|
|
|
25
27
|
const formContext = useContext(FieldContext);
|
|
@@ -60,7 +62,8 @@ export const Questions = (props: QuestionsProps) => {
|
|
|
60
62
|
showGrade={showGrade}
|
|
61
63
|
showCheckbox={showCheckbox}
|
|
62
64
|
handleChanges={handleChanges}
|
|
63
|
-
responseTypeOptions={responseTypeOptions}
|
|
65
|
+
responseTypeOptions={responseTypeOptions}
|
|
66
|
+
hasHeader={hasHeader}
|
|
64
67
|
/>
|
|
65
68
|
</>
|
|
66
69
|
)}
|
|
@@ -20,6 +20,10 @@ const Template: Story<ResponsiveTableCustomProps> = (args) => {
|
|
|
20
20
|
// For example, trigger an API call
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
const getButtonLabel = (record: any) => {
|
|
24
|
+
return (record as any)?.type === "Efetivo" ? "Pog" : "Nao";
|
|
25
|
+
};
|
|
26
|
+
|
|
23
27
|
return <ResponsiveTable
|
|
24
28
|
scroll={{ x: 4000 }}
|
|
25
29
|
columnsSortChange={handleSortByColumnChange} paginationInfo={setPageInfo} headingTranslationsKey={'tableHeadings'} rowSelectionInfo={setRowSelectionInfo}
|
|
@@ -34,7 +38,7 @@ const Template: Story<ResponsiveTableCustomProps> = (args) => {
|
|
|
34
38
|
key: '3', label: 'label 3'
|
|
35
39
|
}
|
|
36
40
|
]}
|
|
37
|
-
fixedColumns={[{ dataIndex: 'action', side: 'right' }]}
|
|
41
|
+
fixedColumns={[{ dataIndex: 'action', side: 'right' }]} buttonActionMethod={() => handleSortByColumnChange} buttonActionLabel={getButtonLabel} {...args}>
|
|
38
42
|
</ResponsiveTable>;
|
|
39
43
|
};
|
|
40
44
|
|
|
@@ -57,7 +61,7 @@ Primary.args = {
|
|
|
57
61
|
mecanographicNumber: "32",
|
|
58
62
|
store: `Levi's Sta Catarina`,
|
|
59
63
|
role: `Comercial`,
|
|
60
|
-
type: `
|
|
64
|
+
type: `NEfetivo`
|
|
61
65
|
},
|
|
62
66
|
{
|
|
63
67
|
id: `3`,
|
|
@@ -65,7 +69,7 @@ Primary.args = {
|
|
|
65
69
|
mecanographicNumber: "3212",
|
|
66
70
|
store: `Levi's Sta Catarina`,
|
|
67
71
|
role: `Funcionário`,
|
|
68
|
-
type: `
|
|
72
|
+
type: `NEfetivo`
|
|
69
73
|
},
|
|
70
74
|
{
|
|
71
75
|
id: `4`,
|
|
@@ -48,6 +48,7 @@ export interface ResponsiveTableCustomProps extends TableProps<any> {
|
|
|
48
48
|
fixedColumns?: { dataIndex: string; side: 'left' | 'right' }[];
|
|
49
49
|
customColumnWidths?: { columnName: string; width: string }[];
|
|
50
50
|
buttonActionName?: string;
|
|
51
|
+
buttonActionLabel?: (record: any) => string;
|
|
51
52
|
buttonActionMethod?: () => void;
|
|
52
53
|
buttonActionStyle?: string;
|
|
53
54
|
}
|
|
@@ -77,7 +78,8 @@ export const ResponsiveTable = (props: ResponsiveTableCustomProps) => {
|
|
|
77
78
|
customColumnWidths,
|
|
78
79
|
buttonActionName,
|
|
79
80
|
buttonActionMethod,
|
|
80
|
-
buttonActionStyle
|
|
81
|
+
buttonActionStyle,
|
|
82
|
+
buttonActionLabel
|
|
81
83
|
} = props;
|
|
82
84
|
|
|
83
85
|
const [customFilters, setCustomFilters] = useState<any>([]);
|
|
@@ -201,12 +203,14 @@ export const ResponsiveTable = (props: ResponsiveTableCustomProps) => {
|
|
|
201
203
|
dataIndex: 'action',
|
|
202
204
|
ellipsis: false,
|
|
203
205
|
align: 'right',
|
|
204
|
-
render: () => {
|
|
205
|
-
if (!items?.[0]) return null;
|
|
206
|
+
render: (_: any, record: any) => {
|
|
207
|
+
if (!items?.[0]) return null;
|
|
208
|
+
const buttonLabel = buttonActionLabel ? buttonActionLabel(record) : null;
|
|
209
|
+
|
|
206
210
|
return (
|
|
207
211
|
<Space size="middle">
|
|
208
|
-
{buttonActionName &&
|
|
209
|
-
<Button customClass={buttonActionStyle} onClick={() => buttonActionMethod?.()}>{buttonActionName}</Button>
|
|
212
|
+
{(buttonActionName || buttonActionLabel) &&
|
|
213
|
+
<Button customClass={buttonActionStyle} onClick={() => buttonActionMethod?.()}>{buttonActionName || buttonLabel}</Button>
|
|
210
214
|
}
|
|
211
215
|
|
|
212
216
|
<Dropdown menu={{ items }}>
|
package/src/locales/en.json
CHANGED
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"mandatoryAnswer": "Mandatory answer",
|
|
49
49
|
"emphasisAnswer": "Highlight",
|
|
50
50
|
"responseType": "Response Type",
|
|
51
|
-
"errorResponseType": "Response type missing"
|
|
51
|
+
"errorResponseType": "Response type missing",
|
|
52
|
+
"header": "Header"
|
|
52
53
|
},
|
|
53
54
|
"categorySidBar": {
|
|
54
55
|
"addCategory": "Add Category",
|
|
@@ -57,8 +58,10 @@
|
|
|
57
58
|
"categoryContent": {
|
|
58
59
|
"message": "Please select a category in the sidebar",
|
|
59
60
|
"categoryName": "Category Name",
|
|
61
|
+
"tamplateName": "Template Name",
|
|
60
62
|
"editCategory": "Edit Category",
|
|
61
63
|
"categoryNameError": "Error/Missing Category Name",
|
|
64
|
+
"templateNameError": "Error/Missing Template Name",
|
|
62
65
|
"weighting": "Weighting",
|
|
63
66
|
"openAnswer": "Open Answer",
|
|
64
67
|
"yesNoAnswer": "Yes/No Answer",
|
package/src/locales/es.json
CHANGED
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"mandatoryAnswer": "Respuesta obligatoria",
|
|
49
49
|
"emphasisAnswer": "Resaltar",
|
|
50
50
|
"responseType": "Tipo de respuesta",
|
|
51
|
-
"errorResponseType": "Tipo de respuesta faltante"
|
|
51
|
+
"errorResponseType": "Tipo de respuesta faltante",
|
|
52
|
+
"header": "Cabecera"
|
|
52
53
|
},
|
|
53
54
|
"categorySidBar": {
|
|
54
55
|
"addCategory": "Agregar Categoría",
|
|
@@ -57,8 +58,10 @@
|
|
|
57
58
|
"categoryContent": {
|
|
58
59
|
"message": "Por favor, seleccione una categoría en la barra lateral",
|
|
59
60
|
"categoryName": "Nombre de la Categoría",
|
|
61
|
+
"tamplateName": "Nome de la plantilla",
|
|
60
62
|
"editCategory": "Editar Categoría",
|
|
61
63
|
"categoryNameError": "Error/Nombre de Categoría Faltante",
|
|
64
|
+
"templateNameError": "Error/Nombre de la plantilla",
|
|
62
65
|
"weighting": "Ponderación",
|
|
63
66
|
"openAnswer": "Respuesta Abierta",
|
|
64
67
|
"yesNoAnswer": "Respuesta Si/No",
|
package/src/locales/pt.json
CHANGED
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"mandatoryAnswer": "Resposta obrigatória",
|
|
49
49
|
"emphasisAnswer": "Destaque",
|
|
50
50
|
"responseType": "Tipo de resposta",
|
|
51
|
-
"errorResponseType": "Tipo de resposta em falta"
|
|
51
|
+
"errorResponseType": "Tipo de resposta em falta",
|
|
52
|
+
"header": "Cabeçalho"
|
|
52
53
|
},
|
|
53
54
|
"categorySidBar": {
|
|
54
55
|
"addCategory": "Adicionar categoria",
|
|
@@ -57,8 +58,10 @@
|
|
|
57
58
|
"categoryContent": {
|
|
58
59
|
"message": "Por favor selecione uma categoria na barra lateral",
|
|
59
60
|
"categoryName": "Nome da categoria",
|
|
61
|
+
"tamplateName": "Nome do template",
|
|
60
62
|
"editCategory": "Editar Categoria",
|
|
61
63
|
"categoryNameError": "Nome categoria em falta",
|
|
64
|
+
"templateNameError": "Nome da template em falta",
|
|
62
65
|
"weighting": "Ponderação",
|
|
63
66
|
"openAnswer": "Resposta aberta",
|
|
64
67
|
"yesNoAnswer": "Resposta Sim/Não",
|