@omniumretail/component-library 1.2.70 → 1.2.72

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.
Files changed (249) hide show
  1. package/dist/component-library.umd.js +1154 -0
  2. package/dist/{types/components → components}/AnalyticsBar/helpers/codeMutation.d.ts +2 -2
  3. package/dist/{types/components → components}/AnalyticsBar/index.d.ts +2 -1
  4. package/dist/{types/components → components}/Button/index.d.ts +2 -1
  5. package/dist/{types/components → components}/Category/index.d.ts +2 -1
  6. package/dist/{types/components → components}/CategoryReadOnly/index.d.ts +2 -1
  7. package/dist/{types/components → components}/CategoryResponse/index.d.ts +3 -2
  8. package/dist/{types/components → components}/DatePicker/index.d.ts +2 -1
  9. package/dist/{types/components → components}/DatePickerTag/index.d.ts +2 -1
  10. package/dist/{types/components → components}/DropdownButton/index.d.ts +3 -2
  11. package/dist/{types/components → components}/Footer2/index.d.ts +2 -1
  12. package/dist/{types/components → components}/Header/Header.data.d.ts +2 -1
  13. package/dist/{types/components → components}/Header/Header.types.d.ts +2 -1
  14. package/dist/{types/components → components}/Header/index.d.ts +2 -1
  15. package/dist/{types/components → components}/Input/index.d.ts +2 -1
  16. package/dist/{types/components → components}/InputCountryCode/index.d.ts +2 -1
  17. package/dist/{types/components → components}/Link/index.d.ts +2 -1
  18. package/dist/{types/components → components}/Menu/helpers/codeMutation.d.ts +2 -2
  19. package/dist/{types/components → components}/Menu/index.d.ts +2 -1
  20. package/dist/{types/components → components}/MobileTable/index.d.ts +2 -1
  21. package/dist/{types/components → components}/ModalWithTable/index.d.ts +2 -1
  22. package/dist/{types/components → components}/Notification/index.d.ts +2 -1
  23. package/dist/{types/components → components}/Radio/index.d.ts +3 -2
  24. package/dist/{types/components → components}/ResponsiveTable/index.d.ts +2 -1
  25. package/dist/{types/components → components}/Select/index.d.ts +2 -1
  26. package/dist/{types/components → components}/Switch/index.d.ts +2 -1
  27. package/dist/{types/components → components}/Table/index.d.ts +2 -1
  28. package/dist/{types/components → components}/Tag/index.d.ts +3 -2
  29. package/dist/{types/components → components}/Upload/index.d.ts +3 -2
  30. package/dist/{types/components → components}/WebCam/index.d.ts +2 -1
  31. package/{src/locales/en.json → dist/locales/en.json.d.ts} +4 -2
  32. package/{src/locales/es.json → dist/locales/es.json.d.ts} +4 -2
  33. package/{src/locales/pt.json → dist/locales/pt.json.d.ts} +4 -1
  34. package/package.json +98 -183
  35. package/NPMPUBLISH.md +0 -29
  36. package/bitbucket-pipelines.yml +0 -95
  37. package/dist/780.bundle.js +0 -1
  38. package/dist/838.bundle.js +0 -2
  39. package/dist/838.bundle.js.LICENSE.txt +0 -1
  40. package/dist/bundle.js +0 -2
  41. package/dist/bundle.js.LICENSE.txt +0 -451
  42. package/dist/main.css +0 -36
  43. package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -4
  44. package/dist/types/components/BellNotifications/BellNotifications.stories.d.ts +0 -4
  45. package/dist/types/components/Button/Button.stories.d.ts +0 -5
  46. package/dist/types/components/Category/Category.stories.d.ts +0 -3
  47. package/dist/types/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -3
  48. package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -3
  49. package/dist/types/components/DatePicker/DatePicker.stories.d.ts +0 -4
  50. package/dist/types/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -4
  51. package/dist/types/components/DropdownButton/DropdownButton.stories.d.ts +0 -4
  52. package/dist/types/components/ExportTableData/ExportTableData.stories.d.ts +0 -3
  53. package/dist/types/components/Footer/Footer.stories.d.ts +0 -4
  54. package/dist/types/components/Footer2/Footer.stories.d.ts +0 -5
  55. package/dist/types/components/Header/Header.stories.d.ts +0 -4
  56. package/dist/types/components/Input/Input.stories.d.ts +0 -4
  57. package/dist/types/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -4
  58. package/dist/types/components/Label/Label.stories.d.ts +0 -5
  59. package/dist/types/components/Link/Link.stories.d.ts +0 -6
  60. package/dist/types/components/Menu/Menu.stories.d.ts +0 -4
  61. package/dist/types/components/MobileTable/MobileTable.stories.d.ts +0 -4
  62. package/dist/types/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -4
  63. package/dist/types/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -4
  64. package/dist/types/components/Navigation/Navigation.stories.d.ts +0 -4
  65. package/dist/types/components/Notification/Notification.stories.d.ts +0 -4
  66. package/dist/types/components/Questions/Questions.stories.d.ts +0 -3
  67. package/dist/types/components/Radio/Radio.stories.d.ts +0 -4
  68. package/dist/types/components/ResponseType/ResponseType.stories.d.ts +0 -3
  69. package/dist/types/components/ResponsiveTable/ResponsiveTable.stories.d.ts +0 -8
  70. package/dist/types/components/Select/Select.stories.d.ts +0 -5
  71. package/dist/types/components/Separator/Separator.stories.d.ts +0 -5
  72. package/dist/types/components/Sidebar/Sidebar.stories.d.ts +0 -5
  73. package/dist/types/components/Switch/Switch.stories.d.ts +0 -4
  74. package/dist/types/components/Table/Table.stories.d.ts +0 -8
  75. package/dist/types/components/Tag/Tag.stories.d.ts +0 -4
  76. package/dist/types/components/Upload/Upload.stories.d.ts +0 -3
  77. package/dist/types/components/UserInfo/UserInfo.stories.d.ts +0 -3
  78. package/dist/types/components/WebCam/WebCam.stories.d.ts +0 -3
  79. package/src/assets/code-brackets.svg +0 -1
  80. package/src/assets/colors.svg +0 -1
  81. package/src/assets/comments.svg +0 -1
  82. package/src/assets/direction.svg +0 -1
  83. package/src/assets/flow.svg +0 -1
  84. package/src/assets/fonts/Silka-Bold.woff2 +0 -0
  85. package/src/assets/fonts/Silka-Regular.woff2 +0 -0
  86. package/src/assets/images/A2AI-logo.png +0 -0
  87. package/src/assets/images/omnium-retail-logo-white.png +0 -0
  88. package/src/assets/images/omnium-retail-logo.png +0 -0
  89. package/src/assets/images/omnium-retail_icon.png +0 -0
  90. package/src/assets/plugin.svg +0 -1
  91. package/src/assets/repo.svg +0 -1
  92. package/src/assets/scss/_combinations.scss +0 -0
  93. package/src/assets/scss/_global.scss +0 -89
  94. package/src/assets/scss/index.scss +0 -2
  95. package/src/assets/stackalt.svg +0 -1
  96. package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +0 -236
  97. package/src/components/AnalyticsBar/helpers/codeMutation.tsx +0 -19
  98. package/src/components/AnalyticsBar/index.tsx +0 -76
  99. package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +0 -13
  100. package/src/components/AnalyticsBar/styles.module.scss +0 -137
  101. package/src/components/BellNotifications/BellNotifications.stories.tsx +0 -200
  102. package/src/components/BellNotifications/index.tsx +0 -154
  103. package/src/components/BellNotifications/styles.module.scss +0 -239
  104. package/src/components/Button/Button.stories.tsx +0 -26
  105. package/src/components/Button/index.tsx +0 -24
  106. package/src/components/Button/styles.module.scss +0 -70
  107. package/src/components/Category/Category.stories.tsx +0 -371
  108. package/src/components/Category/CategoryContent/index.tsx +0 -255
  109. package/src/components/Category/CategoryContent/styles.module.scss +0 -69
  110. package/src/components/Category/CategorySidebar/index.tsx +0 -344
  111. package/src/components/Category/CategorySidebar/styles.module.scss +0 -28
  112. package/src/components/Category/index.tsx +0 -58
  113. package/src/components/Category/styles.module.scss +0 -13
  114. package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +0 -274
  115. package/src/components/CategoryReadOnly/evaluationOptions.tsx +0 -81
  116. package/src/components/CategoryReadOnly/index.tsx +0 -328
  117. package/src/components/CategoryReadOnly/styles.module.scss +0 -214
  118. package/src/components/CategoryResponse/CategoryResponse.stories.tsx +0 -312
  119. package/src/components/CategoryResponse/evaluationOptions.tsx +0 -81
  120. package/src/components/CategoryResponse/index.tsx +0 -502
  121. package/src/components/CategoryResponse/styles.module.scss +0 -365
  122. package/src/components/DatePicker/DatePicker.stories.tsx +0 -16
  123. package/src/components/DatePicker/index.tsx +0 -38
  124. package/src/components/DatePicker/styles.module.scss +0 -3
  125. package/src/components/DatePickerTag/DatePickerTag.stories.tsx +0 -19
  126. package/src/components/DatePickerTag/index.tsx +0 -91
  127. package/src/components/DatePickerTag/styles.module.scss +0 -32
  128. package/src/components/DropdownButton/DropdownButton.stories.tsx +0 -24
  129. package/src/components/DropdownButton/index.tsx +0 -36
  130. package/src/components/DropdownButton/styles.module.scss +0 -9
  131. package/src/components/ExportTableData/ExportTableData.stories.tsx +0 -43
  132. package/src/components/ExportTableData/index.tsx +0 -37
  133. package/src/components/ExportTableData/styles.module.scss +0 -4
  134. package/src/components/Footer/Footer.stories.tsx +0 -15
  135. package/src/components/Footer/index.tsx +0 -45
  136. package/src/components/Footer/styles.module.scss +0 -38
  137. package/src/components/Footer2/Footer.stories.tsx +0 -184
  138. package/src/components/Footer2/index.tsx +0 -322
  139. package/src/components/Footer2/styles.module.scss +0 -292
  140. package/src/components/Header/Header.data.ts +0 -26
  141. package/src/components/Header/Header.stories.tsx +0 -236
  142. package/src/components/Header/Header.types.ts +0 -32
  143. package/src/components/Header/README.md +0 -38
  144. package/src/components/Header/index.tsx +0 -200
  145. package/src/components/Header/styles.module.scss +0 -216
  146. package/src/components/Input/Input.stories.tsx +0 -13
  147. package/src/components/Input/index.tsx +0 -31
  148. package/src/components/Input/styles.module.scss +0 -8
  149. package/src/components/InputCountryCode/index.tsx +0 -79
  150. package/src/components/InputCountryCode/inputCountryCode.stories.tsx +0 -55
  151. package/src/components/InputCountryCode/styles.module.scss +0 -3
  152. package/src/components/Label/Label.stories.tsx +0 -21
  153. package/src/components/Label/index.tsx +0 -19
  154. package/src/components/Label/styles.module.scss +0 -17
  155. package/src/components/Link/Link.stories.tsx +0 -30
  156. package/src/components/Link/index.tsx +0 -21
  157. package/src/components/Link/styles.module.scss +0 -24
  158. package/src/components/Menu/Menu.stories.tsx +0 -178
  159. package/src/components/Menu/helpers/codeMutation.tsx +0 -19
  160. package/src/components/Menu/index.tsx +0 -24
  161. package/src/components/Menu/styles.module.scss +0 -0
  162. package/src/components/MobileTable/MobileTable.stories.tsx +0 -27
  163. package/src/components/MobileTable/index.tsx +0 -102
  164. package/src/components/MobileTable/styles.module.scss +0 -75
  165. package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +0 -40
  166. package/src/components/ModalConfirmation/ModalStatusList.tsx +0 -5
  167. package/src/components/ModalConfirmation/index.tsx +0 -71
  168. package/src/components/ModalConfirmation/styles.module.scss +0 -62
  169. package/src/components/ModalWithTable/ModalWithTable.stories.tsx +0 -99
  170. package/src/components/ModalWithTable/index.tsx +0 -238
  171. package/src/components/ModalWithTable/styles.module.scss +0 -77
  172. package/src/components/Navigation/Navigation.stories.tsx +0 -21
  173. package/src/components/Navigation/index.tsx +0 -91
  174. package/src/components/Navigation/styles.module.scss +0 -91
  175. package/src/components/Notification/Notification.stories.tsx +0 -32
  176. package/src/components/Notification/index.tsx +0 -28
  177. package/src/components/Questions/Questions.stories.tsx +0 -37
  178. package/src/components/Questions/SingleQuestion/index.tsx +0 -337
  179. package/src/components/Questions/SingleQuestion/styles.module.scss +0 -142
  180. package/src/components/Questions/index.tsx +0 -124
  181. package/src/components/Questions/styles.modules.scss +0 -0
  182. package/src/components/Radio/Radio.stories.tsx +0 -43
  183. package/src/components/Radio/index.tsx +0 -26
  184. package/src/components/Radio/styles.module.scss +0 -24
  185. package/src/components/ResponseType/ResponseType.stories.tsx +0 -393
  186. package/src/components/ResponseType/index.tsx +0 -100
  187. package/src/components/ResponseType/styles.module.scss +0 -31
  188. package/src/components/ResponsiveTable/ResponsiveTable.stories.tsx +0 -386
  189. package/src/components/ResponsiveTable/index.tsx +0 -389
  190. package/src/components/ResponsiveTable/styles.module.scss +0 -153
  191. package/src/components/Select/Select.stories.tsx +0 -39
  192. package/src/components/Select/index.tsx +0 -27
  193. package/src/components/Select/styles.module.scss +0 -19
  194. package/src/components/Separator/Separator.stories.tsx +0 -22
  195. package/src/components/Separator/index.tsx +0 -27
  196. package/src/components/Separator/styles.module.scss +0 -25
  197. package/src/components/Sidebar/Sidebar.stories.tsx +0 -85
  198. package/src/components/Sidebar/index.tsx +0 -127
  199. package/src/components/Sidebar/styles.module.scss +0 -141
  200. package/src/components/Switch/Switch.stories.tsx +0 -14
  201. package/src/components/Switch/index.tsx +0 -18
  202. package/src/components/Switch/styles.module.scss +0 -7
  203. package/src/components/Table/Table.stories.tsx +0 -337
  204. package/src/components/Table/index.tsx +0 -313
  205. package/src/components/Table/styles.module.scss +0 -97
  206. package/src/components/Tag/Tag.stories.tsx +0 -32
  207. package/src/components/Tag/index.tsx +0 -295
  208. package/src/components/Tag/styles.module.scss +0 -104
  209. package/src/components/Upload/Upload.stories.tsx +0 -45
  210. package/src/components/Upload/index.tsx +0 -112
  211. package/src/components/Upload/styles.module.scss +0 -29
  212. package/src/components/UserInfo/UserInfo.stories.tsx +0 -38
  213. package/src/components/UserInfo/index.tsx +0 -77
  214. package/src/components/UserInfo/styles.module.scss +0 -35
  215. package/src/components/WebCam/WebCam.stories.tsx +0 -24
  216. package/src/components/WebCam/index.tsx +0 -73
  217. package/src/components/WebCam/styles.module.scss +0 -37
  218. package/src/components/index.tsx +0 -34
  219. package/src/constants/i18n.ts +0 -25
  220. package/src/constants/logoCompanyHelper.ts +0 -52
  221. package/src/constants/translationHelper.ts +0 -7
  222. package/src/index.ts +0 -3
  223. package/src/types/Global.d.ts +0 -4
  224. package/tsconfig.json +0 -29
  225. package/webpack.config.js +0 -51
  226. /package/dist/{types/components → components}/AnalyticsBar/interfaces/analyticsBar.d.ts +0 -0
  227. /package/dist/{types/components → components}/BellNotifications/index.d.ts +0 -0
  228. /package/dist/{types/components → components}/Category/CategoryContent/index.d.ts +0 -0
  229. /package/dist/{types/components → components}/Category/CategorySidebar/index.d.ts +0 -0
  230. /package/dist/{types/components → components}/CategoryReadOnly/evaluationOptions.d.ts +0 -0
  231. /package/dist/{types/components → components}/CategoryResponse/evaluationOptions.d.ts +0 -0
  232. /package/dist/{types/components → components}/ExportTableData/index.d.ts +0 -0
  233. /package/dist/{types/components → components}/Footer/index.d.ts +0 -0
  234. /package/dist/{types/components → components}/Label/index.d.ts +0 -0
  235. /package/dist/{types/components → components}/ModalConfirmation/ModalStatusList.d.ts +0 -0
  236. /package/dist/{types/components → components}/ModalConfirmation/index.d.ts +0 -0
  237. /package/dist/{types/components → components}/Navigation/index.d.ts +0 -0
  238. /package/dist/{types/components → components}/Questions/SingleQuestion/index.d.ts +0 -0
  239. /package/dist/{types/components → components}/Questions/index.d.ts +0 -0
  240. /package/dist/{types/components → components}/ResponseType/index.d.ts +0 -0
  241. /package/dist/{types/components → components}/Separator/index.d.ts +0 -0
  242. /package/dist/{types/components → components}/Sidebar/index.d.ts +0 -0
  243. /package/dist/{types/components → components}/UserInfo/index.d.ts +0 -0
  244. /package/dist/{types/components → components}/index.d.ts +0 -0
  245. /package/dist/{types/constants → constants}/i18n.d.ts +0 -0
  246. /package/dist/{types/constants → constants}/logoCompanyHelper.d.ts +0 -0
  247. /package/dist/{types/constants → constants}/translationHelper.d.ts +0 -0
  248. /package/dist/{types/index.d.ts → index.d.ts} +0 -0
  249. /package/{public → dist}/index.ts +0 -0
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import * as XLSX from 'xlsx';
3
- import { FileExcelOutlined } from '@ant-design/icons';
4
- import styles from './styles.module.scss';
5
- import classNames from 'classnames';
6
-
7
- interface TableExportButtonProps {
8
- data: Record<string, any>[];
9
- fileName: string;
10
- customClass?: string;
11
- columnTranslations: Record<string, string>;
12
- }
13
-
14
- export const TableExportButton = (props: TableExportButtonProps) => {
15
- const exportToXLS = () => {
16
- const wb = XLSX.utils.book_new();
17
- const ws = XLSX.utils.json_to_sheet(props.data);
18
-
19
- // Aplicar estilos às células do cabeçalho
20
- const headerKeys = Object.keys(props.columnTranslations);
21
- headerKeys.forEach((key, index) => {
22
- const cellAddress = XLSX.utils.encode_cell({ c: index, r: 0 });
23
- ws[cellAddress].v = props.columnTranslations[key]; // Substituir o valor pela tradução
24
- });
25
-
26
- XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
27
- XLSX.writeFile(wb, `${props.fileName}.xlsx`);
28
- };
29
-
30
- const linkClasses = classNames({
31
- [`${props.customClass}`]: props.customClass,
32
- }, [styles.iconStyle]);
33
-
34
- return (
35
- <FileExcelOutlined onClick={exportToXLS} className={linkClasses} />
36
- );
37
- };
@@ -1,4 +0,0 @@
1
-
2
- .iconStyle {
3
- font-size: 32px;
4
- }
@@ -1,15 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react-webpack5";
2
- import { Footer, FooterProps } from '.';
3
-
4
- export default {
5
- title: 'Footer',
6
- component: Footer,
7
- } as Meta;
8
-
9
- const Template: StoryFn<FooterProps> = (args: any) => <Footer {...args}></Footer>;
10
-
11
- export const Primary = Template.bind({});
12
- Primary.args = {
13
- storeName: 'Levis',
14
- favIcon: true
15
- };
@@ -1,45 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import moment from 'moment';
3
- import styles from './styles.module.scss';
4
- import omniumLogo from '../../assets/images/omnium-retail-logo-white.png';
5
- import omniumIcon from '../../assets/images/omnium-retail_icon.png';
6
-
7
- export interface FooterProps {
8
- storeName: string;
9
- favIcon?: boolean;
10
- }
11
-
12
- export const Footer = (props: FooterProps) => {
13
- const [date, setDate] = useState(moment());
14
- const { storeName = 'Missing Store Name' } = props;
15
-
16
- useEffect(() => {
17
- const time = (function updateDate() {
18
- const nextMinute = moment().add(1, 'minute');
19
- return setTimeout(() => {
20
- setDate(moment());
21
- updateDate();
22
- }, nextMinute.valueOf() - moment().valueOf());
23
- }());
24
-
25
- return () => clearTimeout(time);
26
- });
27
-
28
- return (
29
- <div className={styles.footer}>
30
- <div className={styles.content}>
31
- <div className={styles.brand}>{storeName}</div>
32
- <div className={styles.date}>{date.format('DD/MM/yyyy')}</div>
33
- <div className={styles.time}>{date.format('HH:mm')}</div>
34
- </div>
35
-
36
- <div>
37
- {props.favIcon && <img src={omniumIcon} className={styles.omniumLogoImg} alt="omnium icon" />}
38
-
39
- <img src={omniumLogo} className={styles.omniumLogoImg} alt="omnium logo" />
40
- </div>
41
- </div>
42
- );
43
- };
44
-
45
-
@@ -1,38 +0,0 @@
1
- .footer {
2
- display: flex;
3
- justify-content: space-between;
4
- align-items: center;
5
- flex-wrap: nowrap;
6
- gap: 0 16px;
7
- background-color: var(--color-black);
8
- position: fixed;
9
- bottom: 0;
10
- width: 100%;
11
- padding: 12px 24px;
12
- font-size: var(--font-size-body-1);
13
- color: var(--color-grey-light);
14
- height: 60px;
15
- flex-direction: row;
16
- text-align: left;
17
- box-sizing: border-box;
18
-
19
- .brand {
20
- color: var(--grey2);
21
- width: 100%;
22
- margin-bottom: 4px;
23
- }
24
-
25
- .time {
26
- margin-left: 8px;
27
- }
28
-
29
- .date,
30
- .time {
31
- display: inline-block;
32
- }
33
-
34
- .omniumLogoImg {
35
- height: 25px;
36
- align-self: flex-end;
37
- }
38
- }
@@ -1,184 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react-webpack5";
2
- import { Footer2, Footer2Props, ActionType } from '.';
3
- import {
4
- SettingOutlined,
5
- FileTextOutlined,
6
- TableOutlined,
7
- FilePdfOutlined,
8
- PrinterOutlined,
9
- EyeOutlined,
10
- UserOutlined,
11
- FileOutlined,
12
- BarChartOutlined,
13
- } from '@ant-design/icons';
14
-
15
- export default {
16
- title: 'Footer2',
17
- component: Footer2,
18
- } as Meta;
19
-
20
- const Template: StoryFn<Footer2Props> = (args: any) => <Footer2 {...args}></Footer2>;
21
-
22
- const notifications = [
23
- {
24
- "Id": "662C390B-A38F-45AB-B97C-2D00F0A8ACAD",
25
- "Title": "Creation of an Evaluation Cycle",
26
- "Description": "A new evaluation cycle was created. You must answer it.",
27
- "RedirectURL": "https://www.google.pt",
28
- "Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
29
- "ExpirationDate": 1736899200,
30
- "Criticality": {
31
- "Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
32
- "Name": "High",
33
- "ColorHex": "#E05151"
34
- },
35
- "IsRead": true
36
- },
37
- {
38
- "Id": "0AF18720-1C94-48CD-8DF3-D254077E8363",
39
- "Title": "Creation of an Evaluation Cycle",
40
- "Description": "A new evaluation cycle was created. You must answer it.",
41
- "RedirectURL": "https://www.google.pt",
42
- "Icon": "https://omniumfont.s3.eu-west-1.amazonaws.com/Assets/images/aacp-image.png",
43
- "ExpirationDate": 1736899200,
44
- "Criticality": {
45
- "Id": "F133ED4C-6C72-4CDC-86A1-27A76E6BDE7F",
46
- "Name": "High",
47
- "ColorHex": "#E05151"
48
- },
49
- "IsRead": true
50
- },
51
- ];
52
-
53
- const customActions = [
54
- {
55
- key: 'definicoes',
56
- label: 'Definições',
57
- icon: <SettingOutlined />,
58
- onClick: () => console.log('Definições'),
59
- disabled: true
60
- },
61
- {
62
- key: 'relatorios',
63
- label: 'Relatórios Relatórios',
64
- icon: <BarChartOutlined />,
65
- subItems: [
66
- {
67
- key: 'relatorio-mensal',
68
- label: 'Relatório Mensal',
69
- icon: <FileTextOutlined />,
70
- onClick: () => console.log('Relatório Mensal')
71
- },
72
- {
73
- key: 'relatorio-anual',
74
- label: 'Relatório Anual',
75
- icon: <FileTextOutlined />,
76
- onClick: () => console.log('Relatório Anual')
77
- }
78
- ]
79
- }
80
- ];
81
-
82
- // Ações padrão com submenus
83
- const handleCreate = () => console.log('Criar novo item');
84
- const handleEdit = () => console.log('Editar item');
85
- const handleDelete = () => console.log('Excluir item');
86
- const handleExport = () => console.log('Exportar item');
87
-
88
- const actions2 = [
89
- {
90
- type: ActionType.CREATE,
91
- subItems: [
92
- {
93
- key: 'create-user',
94
- label: 'Criar Usuário',
95
- icon: <UserOutlined />,
96
- onClick: () => console.log('Criar Usuário')
97
- },
98
- {
99
- key: 'create-document',
100
- label: 'Criar Documento',
101
- icon: <FileOutlined />,
102
- onClick: () => console.log('Criar Documento')
103
- }
104
- ]
105
- },
106
- {
107
- type: ActionType.EDIT,
108
- onClick: handleEdit,
109
- disabled: true
110
- },
111
- {
112
- type: ActionType.DELETE,
113
- onClick: handleDelete
114
- },
115
- {
116
- type: ActionType.EXPORT,
117
- subItems: [
118
- {
119
- key: 'export-pdf',
120
- label: 'Exportar PDF',
121
- icon: <FilePdfOutlined />,
122
- onClick: () => console.log('Exportar PDF')
123
- },
124
- {
125
- key: 'export-excel',
126
- label: 'Exportar Excel',
127
- icon: <TableOutlined />,
128
- onClick: () => console.log('Exportar Excel')
129
- }
130
- ]
131
- },
132
- {
133
- type: ActionType.PRINT,
134
- subItems: [
135
- {
136
- key: 'print-preview',
137
- label: 'Visualizar',
138
- icon: <EyeOutlined />,
139
- onClick: () => console.log('Visualizar Impressão')
140
- },
141
- {
142
- key: 'print-direct',
143
- label: 'Imprimir',
144
- icon: <PrinterOutlined />,
145
- onClick: () => console.log('Imprimir Diretamente')
146
- }
147
- ]
148
- }
149
- ];
150
-
151
- export const Primary = Template.bind({});
152
- Primary.args = {
153
- notifications: notifications,
154
- customActions: customActions,
155
- actions: actions2,
156
- disableBackButton: true,
157
- companyName: 'a2ai',
158
- footerName: 'Minha Aplicação',
159
- onBackClick: () => console.log('Voltar'),
160
- onFilterChange: (filter: any) => console.log('Filtro:', filter),
161
- onNotificationClick: (id: any, url: any) => console.log('Notificação:', id, url),
162
- handleMarkAllAsRead: () => console.log('Marcar todas como lidas'),
163
- };
164
-
165
- export const WithoutSubmenus = Template.bind({});
166
- WithoutSubmenus.args = {
167
- notifications: notifications,
168
- customActions: [
169
- {
170
- key: 'definicoes',
171
- label: 'Definições',
172
- icon: <SettingOutlined />,
173
- onClick: () => console.log('Definições')
174
- }
175
- ],
176
- actions: [
177
- { type: ActionType.CREATE, onClick: handleCreate },
178
- { type: ActionType.EDIT, onClick: handleEdit },
179
- { type: ActionType.DELETE, onClick: handleDelete }
180
- ],
181
- disableBackButton: false,
182
- companyName: 'omnium',
183
- footerName: 'Sem Submenus',
184
- };
@@ -1,322 +0,0 @@
1
- import { BellNotifications } from '../BellNotifications';
2
- import styles from './styles.module.scss';
3
- import {
4
- ArrowLeftOutlined,
5
- PlusOutlined,
6
- DeleteOutlined,
7
- ReloadOutlined,
8
- EditOutlined,
9
- ExportOutlined,
10
- PrinterOutlined,
11
- RightOutlined,
12
- LeftCircleOutlined
13
- } from '@ant-design/icons';
14
- import moment from 'moment';
15
- import React, { useEffect, useRef, useState } from 'react';
16
- import { useTranslation } from 'react-i18next';
17
- import { getCompanyLogos } from '../../constants/logoCompanyHelper';
18
-
19
- interface SubAction {
20
- key: string;
21
- label: string;
22
- icon: React.ReactNode;
23
- onClick: () => void;
24
- disabled?: boolean;
25
- }
26
-
27
- interface Action {
28
- key: string;
29
- label: string;
30
- icon: React.ReactNode;
31
- onClick?: () => void;
32
- disabled?: boolean;
33
- subItems?: SubAction[];
34
- }
35
-
36
- interface Criticality {
37
- Id: string;
38
- Name: string;
39
- ColorHex: string;
40
- }
41
-
42
- interface BellNotification {
43
- Id: string;
44
- Title: string;
45
- Description: string;
46
- RedirectURL: string;
47
- Icon: string;
48
- ExpirationDate: number;
49
- Criticality: Criticality;
50
- IsRead: boolean;
51
- }
52
-
53
- // Definindo ações padrão disponíveis
54
- export enum ActionType {
55
- DELETE = 'delete',
56
- UPDATE = 'update',
57
- CREATE = 'create',
58
- EDIT = 'edit',
59
- EXPORT = 'export',
60
- PRINT = 'print'
61
- }
62
-
63
- export interface ActionConfig {
64
- type: ActionType | string;
65
- onClick?: () => void;
66
- disabled?: boolean;
67
- subItems?: SubAction[];
68
- }
69
-
70
- export interface Footer2Props {
71
- onBackClick?: () => void;
72
- notifications: BellNotification[];
73
- onFilterChange: (filter: 'all' | 'unread') => void;
74
- onNotificationClick: (id: string, url: string) => void;
75
- handleMarkAllAsRead: () => void;
76
- customActions?: Action[];
77
- actions?: ActionConfig[];
78
- footerName: string;
79
- disableBackButton?: boolean;
80
- disableNotifications?: boolean;
81
- companyName?: string;
82
- }
83
-
84
- export const Footer2 = (props: Footer2Props) => {
85
- const {
86
- onBackClick,
87
- notifications,
88
- onFilterChange,
89
- onNotificationClick,
90
- handleMarkAllAsRead,
91
- customActions = [],
92
- actions = [],
93
- footerName = '',
94
- disableBackButton = false,
95
- disableNotifications = false,
96
- companyName = 'omnium',
97
- } = props;
98
-
99
- const [date, setDate] = useState(moment());
100
- const [isMenuOpen, setIsMenuOpen] = useState(false);
101
- const [currentSubmenu, setCurrentSubmenu] = useState<string | null>(null);
102
- const menuRef = useRef<HTMLDivElement>(null);
103
- const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
104
- const { t } = useTranslation();
105
- const companyLogos = getCompanyLogos(companyName);
106
-
107
- // Mapeamento de tipos de ações para seus ícones e labels padrão
108
- const defaultActionProps: Record<string, { icon: React.ReactNode; label: string }> = {
109
- [ActionType.DELETE]: { icon: <DeleteOutlined />, label: t('navigation.delete') },
110
- [ActionType.UPDATE]: { icon: <ReloadOutlined />, label: t('navigation.update') },
111
- [ActionType.CREATE]: { icon: <PlusOutlined />, label: t('navigation.create') },
112
- [ActionType.EDIT]: { icon: <EditOutlined />, label: t('navigation.edit') },
113
- [ActionType.EXPORT]: { icon: <ExportOutlined />, label: t('navigation.export') },
114
- [ActionType.PRINT]: { icon: <PrinterOutlined />, label: t('navigation.print') },
115
- };
116
-
117
- useEffect(() => {
118
- const time = (function updateDate() {
119
- const nextMinute = moment().add(1, 'minute');
120
- return setTimeout(() => {
121
- setDate(moment());
122
- updateDate();
123
- }, nextMinute.valueOf() - moment().valueOf());
124
- }());
125
-
126
- return () => clearTimeout(time);
127
- });
128
-
129
- useEffect(() => {
130
- const handleResize = () => {
131
- setIsMobile(window.innerWidth < 768);
132
- };
133
-
134
- window.addEventListener('resize', handleResize);
135
- return () => {
136
- window.removeEventListener('resize', handleResize);
137
- };
138
- }, []);
139
-
140
- const getAllActions = (): Action[] => {
141
- // Converter ActionConfig para Action
142
- const standardActions = actions.map(actionConfig => {
143
- const actionType = actionConfig.type;
144
- const defaultProps = defaultActionProps[actionType] || {
145
- label: String(actionType),
146
- icon: <PlusOutlined />
147
- };
148
-
149
- return {
150
- key: actionType,
151
- label: defaultProps.label,
152
- icon: defaultProps.icon,
153
- onClick: actionConfig.onClick,
154
- disabled: actionConfig.disabled || false,
155
- subItems: actionConfig.subItems
156
- };
157
- });
158
-
159
- // Combinar com ações personalizadas
160
- const combinedActions = [...standardActions, ...customActions];
161
-
162
- // Ordenar por label
163
- return combinedActions.sort((a, b) => a.label.localeCompare(b.label));
164
- };
165
-
166
- const allActions = getAllActions();
167
-
168
- const toggleMenu = () => {
169
- if (isMenuOpen) {
170
- setCurrentSubmenu(null);
171
- }
172
- setIsMenuOpen(!isMenuOpen);
173
- };
174
-
175
- const handleActionClick = (action: Action) => {
176
- if (action.subItems && action.subItems.length > 0) {
177
- setCurrentSubmenu(action.key);
178
- } else {
179
- if (action.onClick && !action.disabled) {
180
- action.onClick();
181
- setIsMenuOpen(false);
182
- setCurrentSubmenu(null);
183
- }
184
- }
185
- };
186
-
187
- const handleBackToMain = () => {
188
- setCurrentSubmenu(null);
189
- };
190
-
191
- const handleSubActionClick = (subAction: SubAction) => {
192
- if (subAction.onClick && !subAction.disabled) {
193
- subAction.onClick();
194
- setIsMenuOpen(false);
195
- setCurrentSubmenu(null);
196
- }
197
- };
198
-
199
- // Handle click outside to close menu
200
- useEffect(() => {
201
- const handleClickOutside = (event: MouseEvent) => {
202
- if (
203
- isMenuOpen &&
204
- menuRef.current &&
205
- !menuRef.current.contains(event.target as Node) &&
206
- !(event.target as Element).closest(`.${styles.addButton}`)
207
- ) {
208
- setIsMenuOpen(false);
209
- setCurrentSubmenu(null);
210
- }
211
- };
212
-
213
- document.addEventListener('mousedown', handleClickOutside);
214
-
215
- return () => {
216
- document.removeEventListener('mousedown', handleClickOutside);
217
- };
218
- }, [isMenuOpen]);
219
-
220
- const plusIconClass = isMenuOpen ? `${styles.addIcon} ${styles.rotateIcon}` : styles.addIcon;
221
-
222
- const getCurrentActions = () => {
223
- if (currentSubmenu) {
224
- const parentAction = allActions.find(action => action.key === currentSubmenu);
225
- return parentAction?.subItems || [];
226
- }
227
- return allActions;
228
- };
229
-
230
- const currentActions = getCurrentActions();
231
-
232
- return (
233
- <div className={`${styles.footer}`}>
234
- {!isMobile &&
235
- <div className={styles.content}>
236
- <div className={styles.brand}>{footerName}</div>
237
- <div className={styles.date}>{date.format('DD/MM/yyyy')}</div>
238
- <div className={styles.time}>{date.format('HH:mm')}</div>
239
- </div>
240
- }
241
-
242
- <div className={styles.navigation}>
243
- {onBackClick && (
244
- <div
245
- className={`${styles.navItem} ${disableBackButton ? styles.disabled : ''}`}
246
- onClick={disableBackButton ? undefined : onBackClick}
247
- >
248
- <ArrowLeftOutlined className={styles.navIcon} />
249
- <span className={styles.navText}>{t('navigation.back')}</span>
250
- </div>
251
- )}
252
-
253
- <div className={styles.addButtonContainer}>
254
- <div className={styles.addButton} onClick={toggleMenu}>
255
- <PlusOutlined className={plusIconClass} />
256
- </div>
257
-
258
- {isMenuOpen && (
259
- <div className={`${styles.circularMenu}`} ref={menuRef}>
260
- {currentSubmenu && (
261
-
262
- <div
263
- className={styles.backButton}
264
- onClick={handleBackToMain}
265
- >
266
- <LeftCircleOutlined className={styles.backIcon} />
267
- </div>
268
- )}
269
-
270
- {currentActions.map((action, index) => (
271
- <div
272
- key={action.key}
273
- className={`${styles.circleMenuItem} ${action.disabled ? styles.disabled : ''}`}
274
- onClick={() => {
275
- if (currentSubmenu) {
276
- handleSubActionClick(action as SubAction);
277
- } else {
278
- handleActionClick(action as Action);
279
- }
280
- }}
281
- >
282
- <div className={styles.circleMenuIcon}>
283
- {action.icon}
284
- </div>
285
-
286
- <div className={styles.circleMenuLabel}>
287
- {action.label}
288
- </div>
289
-
290
- {!currentSubmenu && (action as Action).subItems && (action as Action).subItems!.length > 0 && (
291
- <div className={styles.submenuIndicator}>
292
- <RightOutlined />
293
- </div>
294
- )}
295
- </div>
296
- ))}
297
- </div>
298
- )}
299
- </div>
300
-
301
- {!disableNotifications && (
302
- <div className={styles.navItem}>
303
- <BellNotifications
304
- notifications={notifications}
305
- onFilterChange={onFilterChange}
306
- onNotificationClick={onNotificationClick}
307
- handleMarkAllAsRead={handleMarkAllAsRead}
308
- />
309
-
310
- <span className={styles.navText}>{t('navigation.notifications')}</span>
311
- </div>
312
- )}
313
- </div>
314
-
315
- {!isMobile &&
316
- <div>
317
- <img src={companyLogos.white} alt={companyLogos.alt} className={companyName === 'omnium' ? styles.omniumLogoImg : styles.a2aiLogoImg} />
318
- </div>
319
- }
320
- </div>
321
- );
322
- };