@omniumretail/component-library 1.2.71 → 1.2.73
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/package.json +6 -3
- package/NPMPUBLISH.md +0 -29
- package/bitbucket-pipelines.yml +0 -95
- package/dist/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -5
- package/dist/components/BellNotifications/BellNotifications.stories.d.ts +0 -5
- package/dist/components/Button/Button.stories.d.ts +0 -6
- package/dist/components/Category/Category.stories.d.ts +0 -3
- package/dist/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -3
- package/dist/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -3
- package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -5
- package/dist/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -5
- package/dist/components/DropdownButton/DropdownButton.stories.d.ts +0 -5
- package/dist/components/ExportTableData/ExportTableData.stories.d.ts +0 -3
- package/dist/components/Footer/Footer.stories.d.ts +0 -5
- package/dist/components/Footer2/Footer.stories.d.ts +0 -6
- package/dist/components/Header/Header.stories.d.ts +0 -5
- package/dist/components/Input/Input.stories.d.ts +0 -5
- package/dist/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -5
- package/dist/components/Label/Label.stories.d.ts +0 -6
- package/dist/components/Link/Link.stories.d.ts +0 -7
- package/dist/components/Menu/Menu.stories.d.ts +0 -5
- package/dist/components/MobileTable/MobileTable.stories.d.ts +0 -5
- package/dist/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -5
- package/dist/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -5
- package/dist/components/Navigation/Navigation.stories.d.ts +0 -5
- package/dist/components/Notification/Notification.stories.d.ts +0 -5
- package/dist/components/Questions/Questions.stories.d.ts +0 -3
- package/dist/components/Radio/Radio.stories.d.ts +0 -5
- package/dist/components/ResponseType/ResponseType.stories.d.ts +0 -3
- package/dist/components/ResponsiveTable/ResponsiveTable.stories.d.ts +0 -9
- package/dist/components/Select/Select.stories.d.ts +0 -6
- package/dist/components/Separator/Separator.stories.d.ts +0 -6
- package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -6
- package/dist/components/Switch/Switch.stories.d.ts +0 -5
- package/dist/components/Table/Table.stories.d.ts +0 -9
- package/dist/components/Tag/Tag.stories.d.ts +0 -5
- package/dist/components/Upload/Upload.stories.d.ts +0 -3
- package/dist/components/UserInfo/UserInfo.stories.d.ts +0 -3
- package/dist/components/WebCam/WebCam.stories.d.ts +0 -3
- package/dist/types/index.d.ts +0 -2
- package/public/index.ts +0 -0
- package/src/assets/code-brackets.svg +0 -1
- package/src/assets/colors.svg +0 -1
- package/src/assets/comments.svg +0 -1
- package/src/assets/direction.svg +0 -1
- package/src/assets/flow.svg +0 -1
- package/src/assets/fonts/Silka-Bold.woff2 +0 -0
- package/src/assets/fonts/Silka-Regular.woff2 +0 -0
- package/src/assets/images/A2AI-logo.png +0 -0
- package/src/assets/images/omnium-retail-logo-white.png +0 -0
- package/src/assets/images/omnium-retail-logo.png +0 -0
- package/src/assets/images/omnium-retail_icon.png +0 -0
- package/src/assets/plugin.svg +0 -1
- package/src/assets/repo.svg +0 -1
- package/src/assets/scss/_combinations.scss +0 -0
- package/src/assets/scss/_global.scss +0 -89
- package/src/assets/scss/index.scss +0 -2
- package/src/assets/stackalt.svg +0 -1
- package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +0 -236
- package/src/components/AnalyticsBar/helpers/codeMutation.tsx +0 -19
- package/src/components/AnalyticsBar/index.tsx +0 -76
- package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +0 -13
- package/src/components/AnalyticsBar/styles.module.scss +0 -137
- package/src/components/BellNotifications/BellNotifications.stories.tsx +0 -200
- package/src/components/BellNotifications/index.tsx +0 -154
- package/src/components/BellNotifications/styles.module.scss +0 -239
- package/src/components/Button/Button.stories.tsx +0 -26
- package/src/components/Button/index.tsx +0 -24
- package/src/components/Button/styles.module.scss +0 -70
- package/src/components/Category/Category.stories.tsx +0 -371
- package/src/components/Category/CategoryContent/index.tsx +0 -255
- package/src/components/Category/CategoryContent/styles.module.scss +0 -69
- package/src/components/Category/CategorySidebar/index.tsx +0 -344
- package/src/components/Category/CategorySidebar/styles.module.scss +0 -28
- package/src/components/Category/index.tsx +0 -58
- package/src/components/Category/styles.module.scss +0 -13
- package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +0 -274
- package/src/components/CategoryReadOnly/evaluationOptions.tsx +0 -81
- package/src/components/CategoryReadOnly/index.tsx +0 -328
- package/src/components/CategoryReadOnly/styles.module.scss +0 -214
- package/src/components/CategoryResponse/CategoryResponse.stories.tsx +0 -311
- package/src/components/CategoryResponse/evaluationOptions.tsx +0 -81
- package/src/components/CategoryResponse/index.tsx +0 -502
- package/src/components/CategoryResponse/styles.module.scss +0 -365
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -16
- package/src/components/DatePicker/index.tsx +0 -38
- package/src/components/DatePicker/styles.module.scss +0 -3
- package/src/components/DatePickerTag/DatePickerTag.stories.tsx +0 -19
- package/src/components/DatePickerTag/index.tsx +0 -91
- package/src/components/DatePickerTag/styles.module.scss +0 -32
- package/src/components/DropdownButton/DropdownButton.stories.tsx +0 -24
- package/src/components/DropdownButton/index.tsx +0 -36
- package/src/components/DropdownButton/styles.module.scss +0 -9
- package/src/components/ExportTableData/ExportTableData.stories.tsx +0 -43
- package/src/components/ExportTableData/index.tsx +0 -37
- package/src/components/ExportTableData/styles.module.scss +0 -4
- package/src/components/Footer/Footer.stories.tsx +0 -15
- package/src/components/Footer/index.tsx +0 -45
- package/src/components/Footer/styles.module.scss +0 -38
- package/src/components/Footer2/Footer.stories.tsx +0 -184
- package/src/components/Footer2/index.tsx +0 -322
- package/src/components/Footer2/styles.module.scss +0 -292
- package/src/components/Header/Header.data.ts +0 -26
- package/src/components/Header/Header.stories.tsx +0 -236
- package/src/components/Header/Header.types.ts +0 -32
- package/src/components/Header/README.md +0 -38
- package/src/components/Header/index.tsx +0 -200
- package/src/components/Header/styles.module.scss +0 -216
- package/src/components/Input/Input.stories.tsx +0 -13
- package/src/components/Input/index.tsx +0 -31
- package/src/components/Input/styles.module.scss +0 -8
- package/src/components/InputCountryCode/index.tsx +0 -79
- package/src/components/InputCountryCode/inputCountryCode.stories.tsx +0 -55
- package/src/components/InputCountryCode/styles.module.scss +0 -3
- package/src/components/Label/Label.stories.tsx +0 -21
- package/src/components/Label/index.tsx +0 -19
- package/src/components/Label/styles.module.scss +0 -17
- package/src/components/Link/Link.stories.tsx +0 -30
- package/src/components/Link/index.tsx +0 -21
- package/src/components/Link/styles.module.scss +0 -24
- package/src/components/Menu/Menu.stories.tsx +0 -178
- package/src/components/Menu/helpers/codeMutation.tsx +0 -19
- package/src/components/Menu/index.tsx +0 -24
- package/src/components/Menu/styles.module.scss +0 -0
- package/src/components/MobileTable/MobileTable.stories.tsx +0 -27
- package/src/components/MobileTable/index.tsx +0 -102
- package/src/components/MobileTable/styles.module.scss +0 -75
- package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +0 -40
- package/src/components/ModalConfirmation/ModalStatusList.tsx +0 -5
- package/src/components/ModalConfirmation/index.tsx +0 -71
- package/src/components/ModalConfirmation/styles.module.scss +0 -62
- package/src/components/ModalWithTable/ModalWithTable.stories.tsx +0 -99
- package/src/components/ModalWithTable/index.tsx +0 -238
- package/src/components/ModalWithTable/styles.module.scss +0 -77
- package/src/components/Navigation/Navigation.stories.tsx +0 -21
- package/src/components/Navigation/index.tsx +0 -91
- package/src/components/Navigation/styles.module.scss +0 -91
- package/src/components/Notification/Notification.stories.tsx +0 -32
- package/src/components/Notification/index.tsx +0 -28
- package/src/components/Questions/Questions.stories.tsx +0 -37
- package/src/components/Questions/SingleQuestion/index.tsx +0 -337
- package/src/components/Questions/SingleQuestion/styles.module.scss +0 -142
- package/src/components/Questions/index.tsx +0 -124
- package/src/components/Questions/styles.modules.scss +0 -0
- package/src/components/Radio/Radio.stories.tsx +0 -43
- package/src/components/Radio/index.tsx +0 -26
- package/src/components/Radio/styles.module.scss +0 -24
- package/src/components/ResponseType/ResponseType.stories.tsx +0 -393
- package/src/components/ResponseType/index.tsx +0 -100
- package/src/components/ResponseType/styles.module.scss +0 -31
- package/src/components/ResponsiveTable/ResponsiveTable.stories.tsx +0 -386
- package/src/components/ResponsiveTable/index.tsx +0 -389
- package/src/components/ResponsiveTable/styles.module.scss +0 -153
- package/src/components/Select/Select.stories.tsx +0 -39
- package/src/components/Select/index.tsx +0 -27
- package/src/components/Select/styles.module.scss +0 -19
- package/src/components/Separator/Separator.stories.tsx +0 -22
- package/src/components/Separator/index.tsx +0 -27
- package/src/components/Separator/styles.module.scss +0 -25
- package/src/components/Sidebar/Sidebar.stories.tsx +0 -85
- package/src/components/Sidebar/index.tsx +0 -127
- package/src/components/Sidebar/styles.module.scss +0 -141
- package/src/components/Switch/Switch.stories.tsx +0 -14
- package/src/components/Switch/index.tsx +0 -18
- package/src/components/Switch/styles.module.scss +0 -7
- package/src/components/Table/Table.stories.tsx +0 -337
- package/src/components/Table/index.tsx +0 -313
- package/src/components/Table/styles.module.scss +0 -97
- package/src/components/Tag/Tag.stories.tsx +0 -32
- package/src/components/Tag/index.tsx +0 -295
- package/src/components/Tag/styles.module.scss +0 -104
- package/src/components/Upload/Upload.stories.tsx +0 -45
- package/src/components/Upload/index.tsx +0 -112
- package/src/components/Upload/styles.module.scss +0 -29
- package/src/components/UserInfo/UserInfo.stories.tsx +0 -38
- package/src/components/UserInfo/index.tsx +0 -77
- package/src/components/UserInfo/styles.module.scss +0 -35
- package/src/components/WebCam/WebCam.stories.tsx +0 -24
- package/src/components/WebCam/index.tsx +0 -73
- package/src/components/WebCam/styles.module.scss +0 -37
- package/src/components/index.tsx +0 -34
- package/src/constants/i18n.ts +0 -25
- package/src/constants/logoCompanyHelper.ts +0 -52
- package/src/constants/translationHelper.ts +0 -7
- package/src/index.ts +0 -3
- package/src/locales/en.json +0 -142
- package/src/locales/es.json +0 -142
- package/src/locales/pt.json +0 -142
- package/src/types/Global.d.ts +0 -4
- package/tsconfig.json +0 -24
- package/vite.config.js +0 -51
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Button as AntButton, ButtonProps } from 'antd';
|
|
2
|
-
import styles from './styles.module.scss';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
export interface CustomLinkProps extends ButtonProps {
|
|
6
|
-
iconAlignRight?: boolean;
|
|
7
|
-
linkSecondary?: boolean;
|
|
8
|
-
customClass?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Link = ({customClass, iconAlignRight, linkSecondary, ...props}: CustomLinkProps) => {
|
|
12
|
-
const linkClasses = classNames({
|
|
13
|
-
[styles.iconAlignRight]: iconAlignRight,
|
|
14
|
-
[styles.linkSecondary]: linkSecondary,
|
|
15
|
-
[`${customClass}`]: customClass,
|
|
16
|
-
}, [styles.link]);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<AntButton { ...props } className={ linkClasses } type={'link'} />
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
.link {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
text-decoration: none;
|
|
4
|
-
height: auto;
|
|
5
|
-
|
|
6
|
-
color: var(--color-black);
|
|
7
|
-
font-size: var(--font-size-body-3);
|
|
8
|
-
line-height: 100%;
|
|
9
|
-
font-weight: 300;
|
|
10
|
-
font-style: var(--font-style-italic);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.linkSecondary {
|
|
14
|
-
color: var(--color-orange);
|
|
15
|
-
font-style: var(--font-style-normal);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.iconAlignRight {
|
|
19
|
-
span:nth-child(2) {
|
|
20
|
-
margin-inline-end: 8px;
|
|
21
|
-
margin-inline-start: 0;
|
|
22
|
-
order: -1;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react-vite";
|
|
2
|
-
import { Menu } from '.';
|
|
3
|
-
import { MenuProps } from 'antd';
|
|
4
|
-
import { getItem } from './helpers/codeMutation';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Menu',
|
|
8
|
-
component: Menu,
|
|
9
|
-
} as Meta;
|
|
10
|
-
|
|
11
|
-
const Template: StoryFn<MenuProps> = (args: any) => {
|
|
12
|
-
const data = [
|
|
13
|
-
{
|
|
14
|
-
"Year": 2023,
|
|
15
|
-
"EvaluationCycles": [
|
|
16
|
-
{
|
|
17
|
-
"Id": "D5A77A3B-1163-4590-9C98-2E6D62442F62",
|
|
18
|
-
"Type": "Permanent",
|
|
19
|
-
"Name": "EV1",
|
|
20
|
-
"Year": 2023,
|
|
21
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
22
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
23
|
-
"Users": [
|
|
24
|
-
{
|
|
25
|
-
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
26
|
-
"UserAnswer": null,
|
|
27
|
-
"UserScore": null,
|
|
28
|
-
"SupervisorId": null,
|
|
29
|
-
"SupervisorAnswer": null,
|
|
30
|
-
"SupervisorScore": null
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"UserId": "9D361E92-A748-4E4A-BC5E-0134CE62328E",
|
|
34
|
-
"UserAnswer": "982FF376-56AD-4E3F-B0D0-5BD4282A7F78",
|
|
35
|
-
"UserScore": 3.333,
|
|
36
|
-
"SupervisorId": null,
|
|
37
|
-
"SupervisorAnswer": null,
|
|
38
|
-
"SupervisorScore": null
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"UserId": "594A4DD5-12B1-4ED0-B00C-EDF729B85C57",
|
|
42
|
-
"UserAnswer": null,
|
|
43
|
-
"UserScore": null,
|
|
44
|
-
"SupervisorId": null,
|
|
45
|
-
"SupervisorAnswer": null,
|
|
46
|
-
"SupervisorScore": null
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
50
|
-
"State": "Started",
|
|
51
|
-
"Notifications": [],
|
|
52
|
-
"NotificationAgenda": null,
|
|
53
|
-
"Status": "A",
|
|
54
|
-
"IsOnlyForUsers": false,
|
|
55
|
-
"CreateDate": "2023-02-27T10:50:41.737Z",
|
|
56
|
-
"UpdateDate": "2023-02-27T10:52:50.661Z",
|
|
57
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
58
|
-
"UpdateUserId": null,
|
|
59
|
-
"InitiatDate": "2023-02-27T10:51:00Z",
|
|
60
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"Id": "42A6EFDD-6D74-4905-94AE-5B5588967BE6",
|
|
64
|
-
"Type": "Permanent",
|
|
65
|
-
"Name": "EV1",
|
|
66
|
-
"Year": 2023,
|
|
67
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
68
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
69
|
-
"Users": [],
|
|
70
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
71
|
-
"State": "Draft",
|
|
72
|
-
"Notifications": [],
|
|
73
|
-
"NotificationAgenda": null,
|
|
74
|
-
"Status": "A",
|
|
75
|
-
"IsOnlyForUsers": false,
|
|
76
|
-
"CreateDate": "2023-02-27T14:52:16.523Z",
|
|
77
|
-
"UpdateDate": "2023-02-27T14:53:04.987Z",
|
|
78
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
79
|
-
"UpdateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
80
|
-
"InitiatDate": "0001-01-01T00:00:00Z",
|
|
81
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"Year": 2024,
|
|
87
|
-
"EvaluationCycles": [
|
|
88
|
-
{
|
|
89
|
-
"Id": "D5A77A3B-1163-4590-9C98-2E6D62442F62",
|
|
90
|
-
"Type": "Permanent",
|
|
91
|
-
"Name": "EV2",
|
|
92
|
-
"Year": 2024,
|
|
93
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
94
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
95
|
-
"Users": [
|
|
96
|
-
{
|
|
97
|
-
"UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
98
|
-
"UserAnswer": null,
|
|
99
|
-
"UserScore": null,
|
|
100
|
-
"SupervisorId": null,
|
|
101
|
-
"SupervisorAnswer": null,
|
|
102
|
-
"SupervisorScore": null
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"UserId": "9D361E92-A748-4E4A-BC5E-0134CE62328E",
|
|
106
|
-
"UserAnswer": "982FF376-56AD-4E3F-B0D0-5BD4282A7F78",
|
|
107
|
-
"UserScore": 3.333,
|
|
108
|
-
"SupervisorId": null,
|
|
109
|
-
"SupervisorAnswer": null,
|
|
110
|
-
"SupervisorScore": null
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"UserId": "594A4DD5-12B1-4ED0-B00C-EDF729B85C57",
|
|
114
|
-
"UserAnswer": null,
|
|
115
|
-
"UserScore": null,
|
|
116
|
-
"SupervisorId": null,
|
|
117
|
-
"SupervisorAnswer": null,
|
|
118
|
-
"SupervisorScore": null
|
|
119
|
-
}
|
|
120
|
-
],
|
|
121
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
122
|
-
"State": "Started",
|
|
123
|
-
"Notifications": [],
|
|
124
|
-
"NotificationAgenda": null,
|
|
125
|
-
"Status": "A",
|
|
126
|
-
"IsOnlyForUsers": false,
|
|
127
|
-
"CreateDate": "2023-02-27T10:50:41.737Z",
|
|
128
|
-
"UpdateDate": "2023-02-27T10:52:50.661Z",
|
|
129
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
130
|
-
"UpdateUserId": null,
|
|
131
|
-
"InitiatDate": "2023-02-27T10:51:00Z",
|
|
132
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"Id": "42A6EFDD-6D74-4905-94AE-5B5588967BE6",
|
|
136
|
-
"Type": "Permanent",
|
|
137
|
-
"Name": "EV2",
|
|
138
|
-
"Year": 2024,
|
|
139
|
-
"StartDate": "2023-03-01T00:00:00Z",
|
|
140
|
-
"EndDate": "2023-05-31T23:00:00Z",
|
|
141
|
-
"Users": [],
|
|
142
|
-
"QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
|
|
143
|
-
"State": "Draft",
|
|
144
|
-
"Notifications": [],
|
|
145
|
-
"NotificationAgenda": null,
|
|
146
|
-
"Status": "A",
|
|
147
|
-
"IsOnlyForUsers": false,
|
|
148
|
-
"CreateDate": "2023-02-27T14:52:16.523Z",
|
|
149
|
-
"UpdateDate": "2023-02-27T14:53:04.987Z",
|
|
150
|
-
"CreateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
151
|
-
"UpdateUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
|
|
152
|
-
"InitiatDate": "0001-01-01T00:00:00Z",
|
|
153
|
-
"CancelDate": "0001-01-01T00:00:00Z"
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
const items = data.map((el: any, index: any) => {
|
|
160
|
-
return (
|
|
161
|
-
getItem(
|
|
162
|
-
el.Year,
|
|
163
|
-
index,
|
|
164
|
-
<></>,
|
|
165
|
-
el.EvaluationCycles?.map((evCycle: any, subIndex: any) => {
|
|
166
|
-
return getItem(evCycle.Name, `${index}-${subIndex}`);
|
|
167
|
-
})
|
|
168
|
-
)
|
|
169
|
-
)
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return <Menu {...args} items={items}></Menu>;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export const Primary = Template.bind({});
|
|
177
|
-
Primary.args = {
|
|
178
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { MenuProps } from 'antd';
|
|
2
|
-
|
|
3
|
-
export type MenuItem = Required<MenuProps>['items'][number];
|
|
4
|
-
|
|
5
|
-
export function getItem(
|
|
6
|
-
label: React.ReactNode,
|
|
7
|
-
key: React.Key,
|
|
8
|
-
icon?: React.ReactNode,
|
|
9
|
-
children?: MenuItem[],
|
|
10
|
-
type?: 'group',
|
|
11
|
-
): MenuItem {
|
|
12
|
-
return {
|
|
13
|
-
key,
|
|
14
|
-
icon,
|
|
15
|
-
children,
|
|
16
|
-
label,
|
|
17
|
-
type,
|
|
18
|
-
} as MenuItem;
|
|
19
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import styles from './styles.module.scss';
|
|
2
|
-
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
|
3
|
-
import type { MenuProps } from 'antd';
|
|
4
|
-
import { Menu as MenuAntd} from 'antd';
|
|
5
|
-
|
|
6
|
-
export const Menu = (props: MenuProps) => {
|
|
7
|
-
const {
|
|
8
|
-
items,
|
|
9
|
-
mode
|
|
10
|
-
} = props;
|
|
11
|
-
|
|
12
|
-
const onClick: MenuProps['onClick'] = (e) => {
|
|
13
|
-
// console.log('click ', e);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<MenuAntd
|
|
18
|
-
onClick={onClick}
|
|
19
|
-
mode={mode || "inline"}
|
|
20
|
-
items={items}
|
|
21
|
-
expandIcon={({ isOpen }) => (isOpen ? <MinusOutlined /> : <PlusOutlined />)}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
File without changes
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react-vite";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { MobileTable, MobileTableProps } from '.';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'MobileTable',
|
|
7
|
-
component: MobileTable,
|
|
8
|
-
} as Meta;
|
|
9
|
-
|
|
10
|
-
const Template: StoryFn<MobileTableProps> = (args: any) => {
|
|
11
|
-
const [modalData, setModalData] = useState<any>({});
|
|
12
|
-
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<MobileTable {...args}></MobileTable>
|
|
20
|
-
</>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const Primary = Template.bind({});
|
|
25
|
-
Primary.args = {
|
|
26
|
-
|
|
27
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import styles from './styles.module.scss';
|
|
2
|
-
import { Descriptions, Dropdown, Menu, Modal } from 'antd';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
5
|
-
LeftCircleOutlined,
|
|
6
|
-
RightCircleOutlined,
|
|
7
|
-
} from "@ant-design/icons";
|
|
8
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { Button } from '../Button';
|
|
11
|
-
|
|
12
|
-
interface Action {
|
|
13
|
-
key: string;
|
|
14
|
-
label: string;
|
|
15
|
-
onClick: () => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface MobileTableProps {
|
|
19
|
-
data: Record<string, any>;
|
|
20
|
-
translation: string;
|
|
21
|
-
modalVisible: boolean;
|
|
22
|
-
setModalVisible: Dispatch<SetStateAction<boolean>>;
|
|
23
|
-
title: string;
|
|
24
|
-
hasArrows?: boolean;
|
|
25
|
-
actions?: Action[];
|
|
26
|
-
handlePrev?: () => void;
|
|
27
|
-
handleNext?: () => void;
|
|
28
|
-
hiddenColumns?: string[];
|
|
29
|
-
modalTableData?: any;
|
|
30
|
-
currentIndex?: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const MobileTable = (
|
|
34
|
-
{
|
|
35
|
-
data, title, translation, modalVisible, setModalVisible, actions = [], hiddenColumns = [], hasArrows = true, handleNext, handlePrev, modalTableData, currentIndex
|
|
36
|
-
}: MobileTableProps) => {
|
|
37
|
-
|
|
38
|
-
const { t } = useTranslation();
|
|
39
|
-
|
|
40
|
-
const menu = (
|
|
41
|
-
<Menu>
|
|
42
|
-
{actions?.map((action, index) => (
|
|
43
|
-
<React.Fragment key={action.key}>
|
|
44
|
-
<Menu.Item key={action.key} onClick={action.onClick}>
|
|
45
|
-
{action.label}
|
|
46
|
-
</Menu.Item>
|
|
47
|
-
|
|
48
|
-
{index < actions.length - 1 && <Menu.Divider />}
|
|
49
|
-
</React.Fragment>
|
|
50
|
-
)) || []}
|
|
51
|
-
</Menu>
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<Modal
|
|
56
|
-
title={title}
|
|
57
|
-
open={modalVisible}
|
|
58
|
-
onCancel={() => setModalVisible(false)}
|
|
59
|
-
className={styles.fullScreenModal}
|
|
60
|
-
wrapClassName={styles.wrapModal}
|
|
61
|
-
centered
|
|
62
|
-
footer={(
|
|
63
|
-
<div className={`${styles.footer} ${hasArrows ? styles.center : ""}`}>
|
|
64
|
-
{hasArrows &&
|
|
65
|
-
<LeftCircleOutlined
|
|
66
|
-
className={`${styles.arrowIcons} ${currentIndex === 0 ? styles.disabledIcon : ""}`}
|
|
67
|
-
onClick={handlePrev}
|
|
68
|
-
disabled={currentIndex === 0}
|
|
69
|
-
/>
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
{actions?.length > 0 &&
|
|
73
|
-
<Dropdown overlay={menu}>
|
|
74
|
-
<Button>{t("tableHeadings.action")}</Button>
|
|
75
|
-
</Dropdown>
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{hasArrows &&
|
|
80
|
-
<RightCircleOutlined
|
|
81
|
-
className={`${styles.arrowIcons} ${currentIndex === modalTableData?.length! - 1 ? styles.disabledIcon : ""}`}
|
|
82
|
-
onClick={handleNext}
|
|
83
|
-
disabled={currentIndex === modalTableData?.length! - 1}
|
|
84
|
-
/>
|
|
85
|
-
}
|
|
86
|
-
</div>
|
|
87
|
-
)}
|
|
88
|
-
>
|
|
89
|
-
<div className={styles.details}>
|
|
90
|
-
<Descriptions bordered column={{ xs: 1, sm: 1, md: 1 }}>
|
|
91
|
-
{Object.entries(data)
|
|
92
|
-
.filter(([key]) => !hiddenColumns.includes(key))
|
|
93
|
-
.map(([key, value]) => (
|
|
94
|
-
<Descriptions.Item key={key} label={t(`${translation}.${key}`, key)}>
|
|
95
|
-
{Array.isArray(value) ? value.join(", ") : value ?? "-"}
|
|
96
|
-
</Descriptions.Item>
|
|
97
|
-
))}
|
|
98
|
-
</Descriptions>
|
|
99
|
-
</div>
|
|
100
|
-
</Modal>
|
|
101
|
-
);
|
|
102
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
.details {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
width: 100%;
|
|
5
|
-
margin: 16px 0;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
|
|
8
|
-
:global {
|
|
9
|
-
.ant-descriptions {
|
|
10
|
-
width: calc(100vw - 24px);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.ant-descriptions-item-label {
|
|
14
|
-
max-width: 140px !important;
|
|
15
|
-
padding: 8px 16px !important;
|
|
16
|
-
color: var(--color-blue) !important;
|
|
17
|
-
font-weight: 700 !important;
|
|
18
|
-
font-size: 12px !important;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.ant-descriptions-item-content {
|
|
22
|
-
padding: 8px 16px !important;
|
|
23
|
-
font-size: 12px !important;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.fullScreenModal {
|
|
29
|
-
width: 100vw !important;
|
|
30
|
-
max-width: 100vw !important;
|
|
31
|
-
padding: 0px 12px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.wrapModal {
|
|
35
|
-
overflow: hidden !important;
|
|
36
|
-
|
|
37
|
-
:global {
|
|
38
|
-
.ant-modal .ant-modal-body {
|
|
39
|
-
overflow-y: auto;
|
|
40
|
-
overflow-x: hidden;
|
|
41
|
-
max-height: 80vh;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.ant-modal .ant-modal-content {
|
|
45
|
-
padding: 20px 12px !important;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.ant-modal-header {
|
|
49
|
-
text-align: center !important;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.ant-modal-close {
|
|
53
|
-
color: var(--button-default-background-hover-color);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.footer {
|
|
59
|
-
display: flex;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
|
|
62
|
-
&.center {
|
|
63
|
-
justify-content: space-between;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.arrowIcons {
|
|
68
|
-
color: var(--button-default-background);
|
|
69
|
-
font-size: 26px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.disabledIcon {
|
|
73
|
-
color: #c7cac9;
|
|
74
|
-
pointer-events: none;
|
|
75
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react-vite";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { ModalConfirmation, ModalConfirmationProps } from '.';
|
|
4
|
-
import { ModalStatus } from './ModalStatusList';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'ModalConfirmation',
|
|
8
|
-
component: ModalConfirmation,
|
|
9
|
-
} as Meta;
|
|
10
|
-
|
|
11
|
-
const Template: StoryFn<ModalConfirmationProps> = (args: any) => {
|
|
12
|
-
const [modalData, setModalData] = useState<any>({});
|
|
13
|
-
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
|
14
|
-
|
|
15
|
-
console.log(modalData);
|
|
16
|
-
|
|
17
|
-
const onClickMe = () => {
|
|
18
|
-
setIsModalOpen(true);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
setIsModalOpen(modalData.status === ModalStatus.OPEN);
|
|
23
|
-
}, [modalData])
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<>
|
|
28
|
-
<button onClick={() => onClickMe()}> Button </button>
|
|
29
|
-
<ModalConfirmation {...args} isOpen={isModalOpen} modalData={setModalData}></ModalConfirmation>
|
|
30
|
-
</>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const Primary = Template.bind({});
|
|
35
|
-
Primary.args = {
|
|
36
|
-
closeText: 'cancelar',
|
|
37
|
-
title: 'Tem a certeza que deseja alterar o tipo de ciclo?',
|
|
38
|
-
description: 'Ao alterar, todos os dados inseridos serão eliminados.',
|
|
39
|
-
buttonText: 'Alterar',
|
|
40
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { Button } from '../Button';
|
|
2
|
-
import { Modal } from 'antd';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { CloseOutlined } from '@ant-design/icons';
|
|
5
|
-
import styles from './styles.module.scss';
|
|
6
|
-
import { ModalStatus } from './ModalStatusList';
|
|
7
|
-
|
|
8
|
-
export interface ModalConfirmationProps {
|
|
9
|
-
closeText: string;
|
|
10
|
-
title: string;
|
|
11
|
-
description: string;
|
|
12
|
-
buttonText: string;
|
|
13
|
-
isOpen: boolean;
|
|
14
|
-
modalData?: any;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const ModalConfirmation = (props: ModalConfirmationProps) => {
|
|
18
|
-
const {
|
|
19
|
-
closeText,
|
|
20
|
-
title,
|
|
21
|
-
description,
|
|
22
|
-
buttonText,
|
|
23
|
-
isOpen = false,
|
|
24
|
-
modalData,
|
|
25
|
-
} = props;
|
|
26
|
-
|
|
27
|
-
const [status, setStatus] = useState<string>('');
|
|
28
|
-
|
|
29
|
-
useEffect(()=> {
|
|
30
|
-
isOpen &&
|
|
31
|
-
setStatus(ModalStatus.OPEN);
|
|
32
|
-
}, [isOpen])
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const closeAndChangeStatus = (status: string) => {
|
|
36
|
-
setStatus(status);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
modalData({
|
|
41
|
-
"status": status,
|
|
42
|
-
});
|
|
43
|
-
}, [status]);
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<>
|
|
47
|
-
<Modal
|
|
48
|
-
destroyOnClose={true}
|
|
49
|
-
closeIcon={
|
|
50
|
-
<div className={styles.closeButton}>
|
|
51
|
-
<p>{closeText}</p><CloseOutlined />
|
|
52
|
-
</div>
|
|
53
|
-
}
|
|
54
|
-
open={status === ModalStatus.OPEN}
|
|
55
|
-
onCancel={() => closeAndChangeStatus(ModalStatus.CANCELED)}
|
|
56
|
-
centered
|
|
57
|
-
width={'742px'}
|
|
58
|
-
footer={[
|
|
59
|
-
<Button key="submit" onClick={() => closeAndChangeStatus(ModalStatus.REQUESTED_CHANGES)}>
|
|
60
|
-
{buttonText}
|
|
61
|
-
</Button>
|
|
62
|
-
]}
|
|
63
|
-
className={styles.modal}
|
|
64
|
-
maskClosable={false}
|
|
65
|
-
>
|
|
66
|
-
<h2 className={styles.title}>{title}</h2>
|
|
67
|
-
<p className={styles.description}>{description}</p>
|
|
68
|
-
</Modal>
|
|
69
|
-
</>
|
|
70
|
-
)
|
|
71
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
.modal {
|
|
2
|
-
:global {
|
|
3
|
-
.ant-modal-close {
|
|
4
|
-
width: auto;
|
|
5
|
-
color: var(--button-default-background);
|
|
6
|
-
|
|
7
|
-
&:hover {
|
|
8
|
-
background-color: transparent;
|
|
9
|
-
color: var(--button-default-background-hover-color);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.ant-modal-content {
|
|
14
|
-
padding: 36px 24px;
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
text-align: center;
|
|
20
|
-
|
|
21
|
-
@media(min-width: 742px) {
|
|
22
|
-
padding: 64px;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.ant-modal-close {
|
|
28
|
-
&:hover {
|
|
29
|
-
.closeButton {
|
|
30
|
-
color: red;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.closeButton {
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
flex-direction: row;
|
|
40
|
-
gap: 8px;
|
|
41
|
-
color: inherit;
|
|
42
|
-
font-size: var(--font-size-body-3);
|
|
43
|
-
line-height: 100%;
|
|
44
|
-
font-weight: var(--font-weight-light);
|
|
45
|
-
text-transform: capitalize;
|
|
46
|
-
letter-spacing: .6px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.title {
|
|
50
|
-
color: var(--color-blue);
|
|
51
|
-
font-weight: var(--font-weight-semibold);
|
|
52
|
-
font-size: var(--font-size-body-6);
|
|
53
|
-
line-height: 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.description {
|
|
57
|
-
color: var(--color-black);
|
|
58
|
-
font-size: var(--font-size-body-4);
|
|
59
|
-
margin: 12px 0 24px 0;
|
|
60
|
-
padding: 0;
|
|
61
|
-
}
|
|
62
|
-
}
|