@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.
@@ -1,4 +1,5 @@
1
- export interface ErrorNotificationProps {
1
+ import { ArgsProps } from 'antd/lib/notification';
2
+ export interface ErrorNotificationProps extends ArgsProps {
2
3
  message: string;
3
4
  description: string;
4
5
  }
@@ -41,5 +41,6 @@ export interface TableCustomProps extends TableProps<any> {
41
41
  columnName: string;
42
42
  width: string;
43
43
  }[];
44
+ getRowActions?: (record: any) => any;
44
45
  }
45
46
  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.2.17",
3
+ "version": "1.2.19",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -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 onBlur={() => setIsNoteVisible(null)} />
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
 
@@ -1,6 +1,7 @@
1
1
  import { notification } from 'antd';
2
+ import { ArgsProps } from 'antd/lib/notification';
2
3
 
3
- export interface ErrorNotificationProps {
4
+ export interface ErrorNotificationProps extends ArgsProps {
4
5
  message: string;
5
6
  description: string;
6
7
  }
@@ -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
- if (!items?.[0]) return null; // Verifica se o array items é nulo
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) => {