@omniumretail/component-library 1.2.17 → 1.2.19
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/types/components/Notification/index.d.ts +2 -1
- package/dist/types/components/Table/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/CategoryResponse/index.tsx +1 -1
- package/src/components/Notification/Notification.stories.tsx +4 -1
- package/src/components/Notification/index.tsx +2 -1
- package/src/components/Table/index.tsx +11 -5
package/package.json
CHANGED
|
@@ -358,7 +358,7 @@ export const CategoryResponse = React.forwardRef((props: CategoryResponse, ref)
|
|
|
358
358
|
<span className={styles.note}>{t('components.categoryResponse.note')}: </span>
|
|
359
359
|
{isNoteVisible?.categoryIndex === currentKey && isNoteVisible?.questionIndex === index ? (
|
|
360
360
|
<Form.Item name={["Questions", index, "Note"]} className={styles.form}>
|
|
361
|
-
<TextArea
|
|
361
|
+
<TextArea onPressEnter={() => setIsNoteVisible(null)} />
|
|
362
362
|
</Form.Item>
|
|
363
363
|
) : (
|
|
364
364
|
<div className={styles.noteText}>{form.getFieldValue(`Questions`)?.[index].Note}</div>
|
|
@@ -11,6 +11,7 @@ const Template: Story<ErrorNotificationProps> = (args) => {
|
|
|
11
11
|
const { openNotificationWithIcon } = Notification({
|
|
12
12
|
message: args.message,
|
|
13
13
|
description: args.description,
|
|
14
|
+
showProgress: true
|
|
14
15
|
});
|
|
15
16
|
|
|
16
17
|
return (
|
|
@@ -22,7 +23,9 @@ const Template: Story<ErrorNotificationProps> = (args) => {
|
|
|
22
23
|
export const Primary = Template.bind({});
|
|
23
24
|
Primary.args = {
|
|
24
25
|
message: "Sucesso",
|
|
25
|
-
description: "Parabéns, conseguiste!"
|
|
26
|
+
description: "Parabéns, conseguiste!",
|
|
27
|
+
showProgress: true,
|
|
28
|
+
pauseOnHover: true
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
|
|
@@ -47,6 +47,7 @@ export interface TableCustomProps extends TableProps<any> {
|
|
|
47
47
|
columnsToSort?: string[];
|
|
48
48
|
fixedColumns?: { dataIndex: string; side: 'left' | 'right' }[];
|
|
49
49
|
customColumnWidths?: { columnName: string; width: string }[];
|
|
50
|
+
getRowActions?: (record: any) => any;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export const Table = (props: TableCustomProps) => {
|
|
@@ -71,7 +72,8 @@ export const Table = (props: TableCustomProps) => {
|
|
|
71
72
|
sortByColumns,
|
|
72
73
|
columnsToSort,
|
|
73
74
|
fixedColumns,
|
|
74
|
-
customColumnWidths
|
|
75
|
+
customColumnWidths,
|
|
76
|
+
getRowActions
|
|
75
77
|
} = props;
|
|
76
78
|
|
|
77
79
|
const [customFilters, setCustomFilters] = useState<any>([]);
|
|
@@ -194,12 +196,16 @@ export const Table = (props: TableCustomProps) => {
|
|
|
194
196
|
title: headingTranslationsKey ? t(`${headingTranslationsKey}.${'action'}`) : 'action',
|
|
195
197
|
dataIndex: 6,
|
|
196
198
|
ellipsis: false,
|
|
197
|
-
render: () => {
|
|
198
|
-
|
|
199
|
+
render: (_: any, record: any) => {
|
|
200
|
+
const rowActions = getRowActions ? getRowActions(record) : null;
|
|
201
|
+
|
|
202
|
+
if ((!items?.[0] && !rowActions)) return null;
|
|
203
|
+
|
|
204
|
+
const actions = rowActions ? rowActions : items;
|
|
199
205
|
|
|
200
206
|
return (
|
|
201
207
|
<Space size="middle">
|
|
202
|
-
<Dropdown menu={{ items }}>
|
|
208
|
+
<Dropdown menu={{ items: actions }}>
|
|
203
209
|
<a>
|
|
204
210
|
<MoreOutlined style={{ color: 'var(--color-blue)', transform: 'scale(1.6)' }} />
|
|
205
211
|
</a>
|
|
@@ -209,7 +215,7 @@ export const Table = (props: TableCustomProps) => {
|
|
|
209
215
|
},
|
|
210
216
|
};
|
|
211
217
|
|
|
212
|
-
items && columns.push(columnActions as any);
|
|
218
|
+
(items || getRowActions) && columns.push(columnActions as any);
|
|
213
219
|
|
|
214
220
|
if (fixedColumns) {
|
|
215
221
|
fixedColumns.forEach((column) => {
|