@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.
- package/dist/component-library.umd.js +1154 -0
- package/dist/{types/components → components}/AnalyticsBar/helpers/codeMutation.d.ts +2 -2
- package/dist/{types/components → components}/AnalyticsBar/index.d.ts +2 -1
- package/dist/{types/components → components}/Button/index.d.ts +2 -1
- package/dist/{types/components → components}/Category/index.d.ts +2 -1
- package/dist/{types/components → components}/CategoryReadOnly/index.d.ts +2 -1
- package/dist/{types/components → components}/CategoryResponse/index.d.ts +3 -2
- package/dist/{types/components → components}/DatePicker/index.d.ts +2 -1
- package/dist/{types/components → components}/DatePickerTag/index.d.ts +2 -1
- package/dist/{types/components → components}/DropdownButton/index.d.ts +3 -2
- package/dist/{types/components → components}/Footer2/index.d.ts +2 -1
- package/dist/{types/components → components}/Header/Header.data.d.ts +2 -1
- package/dist/{types/components → components}/Header/Header.types.d.ts +2 -1
- package/dist/{types/components → components}/Header/index.d.ts +2 -1
- package/dist/{types/components → components}/Input/index.d.ts +2 -1
- package/dist/{types/components → components}/InputCountryCode/index.d.ts +2 -1
- package/dist/{types/components → components}/Link/index.d.ts +2 -1
- package/dist/{types/components → components}/Menu/helpers/codeMutation.d.ts +2 -2
- package/dist/{types/components → components}/Menu/index.d.ts +2 -1
- package/dist/{types/components → components}/MobileTable/index.d.ts +2 -1
- package/dist/{types/components → components}/ModalWithTable/index.d.ts +2 -1
- package/dist/{types/components → components}/Notification/index.d.ts +2 -1
- package/dist/{types/components → components}/Radio/index.d.ts +3 -2
- package/dist/{types/components → components}/ResponsiveTable/index.d.ts +2 -1
- package/dist/{types/components → components}/Select/index.d.ts +2 -1
- package/dist/{types/components → components}/Switch/index.d.ts +2 -1
- package/dist/{types/components → components}/Table/index.d.ts +2 -1
- package/dist/{types/components → components}/Tag/index.d.ts +3 -2
- package/dist/{types/components → components}/Upload/index.d.ts +3 -2
- package/dist/{types/components → components}/WebCam/index.d.ts +2 -1
- package/{src/locales/en.json → dist/locales/en.json.d.ts} +4 -2
- package/{src/locales/es.json → dist/locales/es.json.d.ts} +4 -2
- package/{src/locales/pt.json → dist/locales/pt.json.d.ts} +4 -1
- package/package.json +98 -183
- package/NPMPUBLISH.md +0 -29
- package/bitbucket-pipelines.yml +0 -95
- package/dist/780.bundle.js +0 -1
- package/dist/838.bundle.js +0 -2
- package/dist/838.bundle.js.LICENSE.txt +0 -1
- package/dist/bundle.js +0 -2
- package/dist/bundle.js.LICENSE.txt +0 -451
- package/dist/main.css +0 -36
- package/dist/types/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -4
- package/dist/types/components/BellNotifications/BellNotifications.stories.d.ts +0 -4
- package/dist/types/components/Button/Button.stories.d.ts +0 -5
- package/dist/types/components/Category/Category.stories.d.ts +0 -3
- package/dist/types/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -3
- package/dist/types/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -3
- package/dist/types/components/DatePicker/DatePicker.stories.d.ts +0 -4
- package/dist/types/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -4
- package/dist/types/components/DropdownButton/DropdownButton.stories.d.ts +0 -4
- package/dist/types/components/ExportTableData/ExportTableData.stories.d.ts +0 -3
- package/dist/types/components/Footer/Footer.stories.d.ts +0 -4
- package/dist/types/components/Footer2/Footer.stories.d.ts +0 -5
- package/dist/types/components/Header/Header.stories.d.ts +0 -4
- package/dist/types/components/Input/Input.stories.d.ts +0 -4
- package/dist/types/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -4
- package/dist/types/components/Label/Label.stories.d.ts +0 -5
- package/dist/types/components/Link/Link.stories.d.ts +0 -6
- package/dist/types/components/Menu/Menu.stories.d.ts +0 -4
- package/dist/types/components/MobileTable/MobileTable.stories.d.ts +0 -4
- package/dist/types/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -4
- package/dist/types/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -4
- package/dist/types/components/Navigation/Navigation.stories.d.ts +0 -4
- package/dist/types/components/Notification/Notification.stories.d.ts +0 -4
- package/dist/types/components/Questions/Questions.stories.d.ts +0 -3
- package/dist/types/components/Radio/Radio.stories.d.ts +0 -4
- package/dist/types/components/ResponseType/ResponseType.stories.d.ts +0 -3
- package/dist/types/components/ResponsiveTable/ResponsiveTable.stories.d.ts +0 -8
- package/dist/types/components/Select/Select.stories.d.ts +0 -5
- package/dist/types/components/Separator/Separator.stories.d.ts +0 -5
- package/dist/types/components/Sidebar/Sidebar.stories.d.ts +0 -5
- package/dist/types/components/Switch/Switch.stories.d.ts +0 -4
- package/dist/types/components/Table/Table.stories.d.ts +0 -8
- package/dist/types/components/Tag/Tag.stories.d.ts +0 -4
- package/dist/types/components/Upload/Upload.stories.d.ts +0 -3
- package/dist/types/components/UserInfo/UserInfo.stories.d.ts +0 -3
- package/dist/types/components/WebCam/WebCam.stories.d.ts +0 -3
- 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 -312
- 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/types/Global.d.ts +0 -4
- package/tsconfig.json +0 -29
- package/webpack.config.js +0 -51
- /package/dist/{types/components → components}/AnalyticsBar/interfaces/analyticsBar.d.ts +0 -0
- /package/dist/{types/components → components}/BellNotifications/index.d.ts +0 -0
- /package/dist/{types/components → components}/Category/CategoryContent/index.d.ts +0 -0
- /package/dist/{types/components → components}/Category/CategorySidebar/index.d.ts +0 -0
- /package/dist/{types/components → components}/CategoryReadOnly/evaluationOptions.d.ts +0 -0
- /package/dist/{types/components → components}/CategoryResponse/evaluationOptions.d.ts +0 -0
- /package/dist/{types/components → components}/ExportTableData/index.d.ts +0 -0
- /package/dist/{types/components → components}/Footer/index.d.ts +0 -0
- /package/dist/{types/components → components}/Label/index.d.ts +0 -0
- /package/dist/{types/components → components}/ModalConfirmation/ModalStatusList.d.ts +0 -0
- /package/dist/{types/components → components}/ModalConfirmation/index.d.ts +0 -0
- /package/dist/{types/components → components}/Navigation/index.d.ts +0 -0
- /package/dist/{types/components → components}/Questions/SingleQuestion/index.d.ts +0 -0
- /package/dist/{types/components → components}/Questions/index.d.ts +0 -0
- /package/dist/{types/components → components}/ResponseType/index.d.ts +0 -0
- /package/dist/{types/components → components}/Separator/index.d.ts +0 -0
- /package/dist/{types/components → components}/Sidebar/index.d.ts +0 -0
- /package/dist/{types/components → components}/UserInfo/index.d.ts +0 -0
- /package/dist/{types/components → components}/index.d.ts +0 -0
- /package/dist/{types/constants → constants}/i18n.d.ts +0 -0
- /package/dist/{types/constants → constants}/logoCompanyHelper.d.ts +0 -0
- /package/dist/{types/constants → constants}/translationHelper.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/{public → dist}/index.ts +0 -0
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from "@storybook/react-webpack5";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { Category } from '.';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Category',
|
|
7
|
-
component: Category,
|
|
8
|
-
} as Meta;
|
|
9
|
-
|
|
10
|
-
const Template: StoryFn<any> = (args: any) => {
|
|
11
|
-
const [serverData, setServerData] = useState<any>();
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
console.log(serverData);
|
|
15
|
-
}, [serverData])
|
|
16
|
-
|
|
17
|
-
const getAnswerTypeOptions = [
|
|
18
|
-
{
|
|
19
|
-
"Id": "CD8D0F30-6229-4BA9-9888-4398CB21D392",
|
|
20
|
-
"Name": "Resposta Numérica",
|
|
21
|
-
"IsOpenAnswer": false,
|
|
22
|
-
"IsCheckBox": false,
|
|
23
|
-
"IsNumerical": true,
|
|
24
|
-
"IsDate": false,
|
|
25
|
-
"HasGrade": true,
|
|
26
|
-
"IsEmphasis": false,
|
|
27
|
-
"IsMultipleChoise": false,
|
|
28
|
-
"State": "Deleted",
|
|
29
|
-
"Grade": 4,
|
|
30
|
-
"Rank": 1,
|
|
31
|
-
"Options": [
|
|
32
|
-
{
|
|
33
|
-
"Value": "string",
|
|
34
|
-
"Grade": 5,
|
|
35
|
-
"Color": "string",
|
|
36
|
-
"NeedsAction": true
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"CreateDate": "2024-02-29T10:21:18.448Z",
|
|
40
|
-
"UpdateDate": "2024-08-09T10:48:32.487Z",
|
|
41
|
-
"StartDate": "2024-06-04T14:51:29.942Z",
|
|
42
|
-
"Status": "A",
|
|
43
|
-
"ShowAnswerType": false
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"Id": "DF873E84-1941-45E1-84C5-D2D12A0E305D",
|
|
47
|
-
"Name": "Sim ou Não",
|
|
48
|
-
"IsOpenAnswer": false,
|
|
49
|
-
"IsCheckBox": false,
|
|
50
|
-
"IsNumerical": false,
|
|
51
|
-
"IsDate": false,
|
|
52
|
-
"HasGrade": false,
|
|
53
|
-
"IsEmphasis": true,
|
|
54
|
-
"IsMultipleChoise": true,
|
|
55
|
-
"State": "Finished",
|
|
56
|
-
"Grade": 0,
|
|
57
|
-
"Rank": 0,
|
|
58
|
-
"UseName": true,
|
|
59
|
-
"Options": [
|
|
60
|
-
{
|
|
61
|
-
"Value": "Sim",
|
|
62
|
-
"Grade": 5,
|
|
63
|
-
"Color": "#b75959",
|
|
64
|
-
"NeedsAction": false
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"Value": "Nao",
|
|
68
|
-
"Grade": 10,
|
|
69
|
-
"Color": "#00000",
|
|
70
|
-
"NeedsAction": true
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"Value": "xpto",
|
|
74
|
-
"Grade": 10,
|
|
75
|
-
"Color": "#00000",
|
|
76
|
-
"NeedsAction": true
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"CreateDate": "2024-04-12T14:58:32.085Z",
|
|
80
|
-
"UpdateDate": "2024-08-23T15:27:35.196Z",
|
|
81
|
-
"StartDate": "2024-08-23T15:27:35.196Z",
|
|
82
|
-
"Status": "A",
|
|
83
|
-
"ShowAnswerType": true
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"Id": "058D4541-8739-49C2-85D0-A6BF3BA19E4E",
|
|
87
|
-
"Name": "Verdade ou mentira",
|
|
88
|
-
"IsOpenAnswer": false,
|
|
89
|
-
"IsCheckBox": false,
|
|
90
|
-
"IsNumerical": false,
|
|
91
|
-
"IsDate": false,
|
|
92
|
-
"HasGrade": false,
|
|
93
|
-
"IsEmphasis": true,
|
|
94
|
-
"IsMultipleChoise": true,
|
|
95
|
-
"State": "Draft",
|
|
96
|
-
"Grade": 0,
|
|
97
|
-
"Rank": 4,
|
|
98
|
-
"Options": [
|
|
99
|
-
{
|
|
100
|
-
"Value": "Verdadeiro",
|
|
101
|
-
"Grade": 1,
|
|
102
|
-
"Color": "#00ff12",
|
|
103
|
-
"NeedsAction": false
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"Value": "Mentira",
|
|
107
|
-
"Grade": 0,
|
|
108
|
-
"Color": "5B95E5D8-6E78-4B53-8196-CD6996BB824A",
|
|
109
|
-
"NeedsAction": true
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
"CreateDate": "2024-04-18T16:11:59.622Z",
|
|
113
|
-
"UpdateDate": "2024-07-17T13:26:55.766Z",
|
|
114
|
-
"StartDate": "2024-04-18T16:12:13.135Z",
|
|
115
|
-
"Status": "A",
|
|
116
|
-
"ShowAnswerType": true
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"Id": "65E6051B-E9D1-46BA-9486-4099D470613F",
|
|
120
|
-
"Name": "Sim/Não/Não Sei",
|
|
121
|
-
"IsOpenAnswer": false,
|
|
122
|
-
"IsCheckBox": false,
|
|
123
|
-
"IsNumerical": false,
|
|
124
|
-
"IsDate": false,
|
|
125
|
-
"HasGrade": false,
|
|
126
|
-
"IsEmphasis": false,
|
|
127
|
-
"IsMultipleChoise": true,
|
|
128
|
-
"State": "Draft",
|
|
129
|
-
"Grade": 0,
|
|
130
|
-
"Rank": 5,
|
|
131
|
-
"Options": [
|
|
132
|
-
{
|
|
133
|
-
"Value": "Sim",
|
|
134
|
-
"Grade": 2,
|
|
135
|
-
"Color": "#14f116",
|
|
136
|
-
"NeedsAction": false
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"Value": "Não",
|
|
140
|
-
"Grade": 1,
|
|
141
|
-
"Color": "#ef0f0f",
|
|
142
|
-
"NeedsAction": true
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"Value": "Não sei",
|
|
146
|
-
"Grade": 0,
|
|
147
|
-
"Color": "#0003f7",
|
|
148
|
-
"NeedsAction": false
|
|
149
|
-
}
|
|
150
|
-
],
|
|
151
|
-
"CreateDate": "2024-07-02T10:31:08.974Z",
|
|
152
|
-
"UpdateDate": "2024-07-17T13:27:17.646Z",
|
|
153
|
-
"StartDate": "0001-01-01T00:00:00Z",
|
|
154
|
-
"Status": "A",
|
|
155
|
-
"ShowAnswerType": true
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"Id": "93AF03D8-07B4-4622-A45C-D0206AB2A98D",
|
|
159
|
-
"Name": "Verdadeiro e falso",
|
|
160
|
-
"IsOpenAnswer": false,
|
|
161
|
-
"IsCheckBox": false,
|
|
162
|
-
"IsNumerical": false,
|
|
163
|
-
"IsDate": false,
|
|
164
|
-
"HasGrade": false,
|
|
165
|
-
"IsEmphasis": false,
|
|
166
|
-
"IsMultipleChoise": true,
|
|
167
|
-
"State": "Finished",
|
|
168
|
-
"Grade": 0,
|
|
169
|
-
"Rank": 6,
|
|
170
|
-
"Options": [
|
|
171
|
-
{
|
|
172
|
-
"Value": "V",
|
|
173
|
-
"Grade": 1,
|
|
174
|
-
"Color": "#12e662",
|
|
175
|
-
"NeedsAction": false
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"Value": "F",
|
|
179
|
-
"Grade": 0,
|
|
180
|
-
"Color": "#d91818",
|
|
181
|
-
"NeedsAction": true
|
|
182
|
-
}
|
|
183
|
-
],
|
|
184
|
-
"CreateDate": "2024-07-02T16:29:26.101Z",
|
|
185
|
-
"UpdateDate": "2024-07-02T16:29:27.755Z",
|
|
186
|
-
"StartDate": "2024-07-02T16:29:27.755Z",
|
|
187
|
-
"Status": "A",
|
|
188
|
-
"ShowAnswerType": true
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
"Id": "F0CCAFB5-A9E7-42A3-9E9D-3827C1461065",
|
|
192
|
-
"Name": "Sim / Não / N/A",
|
|
193
|
-
"IsOpenAnswer": false,
|
|
194
|
-
"IsCheckBox": false,
|
|
195
|
-
"IsNumerical": false,
|
|
196
|
-
"IsDate": false,
|
|
197
|
-
"HasGrade": false,
|
|
198
|
-
"IsEmphasis": false,
|
|
199
|
-
"IsMultipleChoise": true,
|
|
200
|
-
"State": "Finished",
|
|
201
|
-
"Grade": 0,
|
|
202
|
-
"Rank": 7,
|
|
203
|
-
"Options": [
|
|
204
|
-
{
|
|
205
|
-
"Value": "Sim",
|
|
206
|
-
"Grade": 2,
|
|
207
|
-
"Color": "#02e235",
|
|
208
|
-
"NeedsAction": false
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
"Value": "Não",
|
|
212
|
-
"Grade": 0,
|
|
213
|
-
"Color": "#f40000",
|
|
214
|
-
"NeedsAction": false
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
"Value": "N/A",
|
|
218
|
-
"Grade": 0,
|
|
219
|
-
"Color": "#00000",
|
|
220
|
-
"NeedsAction": false
|
|
221
|
-
}
|
|
222
|
-
],
|
|
223
|
-
"CreateDate": "2024-07-04T10:02:07.001Z",
|
|
224
|
-
"UpdateDate": "2024-07-04T10:02:08.783Z",
|
|
225
|
-
"StartDate": "2024-07-04T10:02:08.783Z",
|
|
226
|
-
"Status": "A",
|
|
227
|
-
"ShowAnswerType": true
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"Id": "57859452-4B79-4005-BB6C-3695C78270FD",
|
|
231
|
-
"Name": "Lojas",
|
|
232
|
-
"IsOpenAnswer": false,
|
|
233
|
-
"IsCheckBox": false,
|
|
234
|
-
"IsNumerical": false,
|
|
235
|
-
"IsDate": false,
|
|
236
|
-
"HasGrade": false,
|
|
237
|
-
"IsEmphasis": false,
|
|
238
|
-
"IsMultipleChoise": true,
|
|
239
|
-
"State": "Finished",
|
|
240
|
-
"Grade": 0,
|
|
241
|
-
"Rank": 8,
|
|
242
|
-
"Options": [
|
|
243
|
-
{
|
|
244
|
-
"Value": "NorteShopping",
|
|
245
|
-
"Grade": 0,
|
|
246
|
-
"Color": "#f12a2a",
|
|
247
|
-
"NeedsAction": true
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
"Value": "GaiaShopping",
|
|
251
|
-
"Grade": 0,
|
|
252
|
-
"Color": "#191be7",
|
|
253
|
-
"NeedsAction": false
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"Value": "CatarinaShopping",
|
|
257
|
-
"Grade": 0,
|
|
258
|
-
"Color": "#00000",
|
|
259
|
-
"NeedsAction": false
|
|
260
|
-
}
|
|
261
|
-
],
|
|
262
|
-
"CreateDate": "2024-07-04T11:32:36.118Z",
|
|
263
|
-
"UpdateDate": "2024-08-23T15:28:07.14Z",
|
|
264
|
-
"StartDate": "2024-08-23T15:28:07.14Z",
|
|
265
|
-
"Status": "A",
|
|
266
|
-
"ShowAnswerType": true
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"Id": "90DA4D64-9DB6-4D7D-A9C6-5E128905B71C",
|
|
270
|
-
"Name": "teste",
|
|
271
|
-
"IsOpenAnswer": false,
|
|
272
|
-
"IsCheckBox": false,
|
|
273
|
-
"IsNumerical": false,
|
|
274
|
-
"IsDate": false,
|
|
275
|
-
"HasGrade": false,
|
|
276
|
-
"IsEmphasis": false,
|
|
277
|
-
"IsMultipleChoise": true,
|
|
278
|
-
"State": "Draft",
|
|
279
|
-
"Grade": 0,
|
|
280
|
-
"Rank": 8,
|
|
281
|
-
"Options": [
|
|
282
|
-
{
|
|
283
|
-
"Value": "teste",
|
|
284
|
-
"Grade": 0,
|
|
285
|
-
"Color": "#00000",
|
|
286
|
-
"NeedsAction": true
|
|
287
|
-
}
|
|
288
|
-
],
|
|
289
|
-
"CreateDate": "2024-08-23T08:35:24.04Z",
|
|
290
|
-
"UpdateDate": "2024-08-23T08:35:24.041Z",
|
|
291
|
-
"StartDate": "0001-01-01T00:00:00Z",
|
|
292
|
-
"Status": "A",
|
|
293
|
-
"ShowAnswerType": true
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"Id": "CD8D0F30-6229-4BA9-9888-4398CB333392",
|
|
297
|
-
"Name": "Data",
|
|
298
|
-
"IsOpenAnswer": false,
|
|
299
|
-
"IsCheckBox": false,
|
|
300
|
-
"IsNumerical": true,
|
|
301
|
-
"IsDate": true,
|
|
302
|
-
"HasGrade": true,
|
|
303
|
-
"IsEmphasis": false,
|
|
304
|
-
"IsMultipleChoise": false,
|
|
305
|
-
"State": "Finished",
|
|
306
|
-
"Grade": 4,
|
|
307
|
-
"Rank": 2,
|
|
308
|
-
"Options": [
|
|
309
|
-
{
|
|
310
|
-
"Value": "string",
|
|
311
|
-
"Grade": 5,
|
|
312
|
-
"Color": "string",
|
|
313
|
-
"NeedsAction": true
|
|
314
|
-
}
|
|
315
|
-
],
|
|
316
|
-
"CreateDate": "2024-02-29T10:21:18.448Z",
|
|
317
|
-
"UpdateDate": "2024-08-09T10:48:32.487Z",
|
|
318
|
-
"StartDate": "2024-06-04T14:51:29.942Z",
|
|
319
|
-
"Status": "A",
|
|
320
|
-
"ShowAnswerType": false
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
"Id": "A45656EF-27D3-42C0-AE91-550289415357",
|
|
324
|
-
"Name": "Horas de inspeção",
|
|
325
|
-
"IsOpenAnswer": false,
|
|
326
|
-
"IsCheckBox": false,
|
|
327
|
-
"IsNumerical": false,
|
|
328
|
-
"IsDate": false,
|
|
329
|
-
"HasGrade": false,
|
|
330
|
-
"IsEmphasis": false,
|
|
331
|
-
"IsMultipleChoise": true,
|
|
332
|
-
"State": "Finished",
|
|
333
|
-
"Grade": 0,
|
|
334
|
-
"Rank": 8,
|
|
335
|
-
"Options": [
|
|
336
|
-
{
|
|
337
|
-
"Value": "1",
|
|
338
|
-
"Grade": 1,
|
|
339
|
-
"Color": "#00000",
|
|
340
|
-
"NeedsAction": false
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"Value": "2",
|
|
344
|
-
"Grade": 0,
|
|
345
|
-
"Color": "#00000",
|
|
346
|
-
"NeedsAction": false
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
"Value": "3+",
|
|
350
|
-
"Grade": 0,
|
|
351
|
-
"Color": "#00000",
|
|
352
|
-
"NeedsAction": false
|
|
353
|
-
}
|
|
354
|
-
],
|
|
355
|
-
"CreateDate": "2024-08-27T16:18:45.76Z",
|
|
356
|
-
"UpdateDate": "2024-08-27T16:18:46.187Z",
|
|
357
|
-
"StartDate": "2024-08-27T16:18:46.187Z",
|
|
358
|
-
"Status": "A",
|
|
359
|
-
"ShowAnswerType": true
|
|
360
|
-
}
|
|
361
|
-
]
|
|
362
|
-
|
|
363
|
-
return <Category {...args} serverReadyData={setServerData} responseTypeOptions={getAnswerTypeOptions} data={[]}></Category>
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
export const Primary = Template.bind({});
|
|
367
|
-
Primary.args = {
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { Form, Select } from 'antd';
|
|
2
|
-
import { useForm } from 'antd/es/form/Form';
|
|
3
|
-
import { Button } from '../../Button';
|
|
4
|
-
import { InputField } from '../../Input';
|
|
5
|
-
import { Label } from '../../Label';
|
|
6
|
-
import { Questions } from '../../Questions';
|
|
7
|
-
import { Switch } from '../../Switch';
|
|
8
|
-
import { SetStateAction, useCallback, useEffect, useState } from 'react';
|
|
9
|
-
import styles from './styles.module.scss';
|
|
10
|
-
import { t } from 'i18next';
|
|
11
|
-
|
|
12
|
-
interface categoryContent {
|
|
13
|
-
categoryContentShow: boolean;
|
|
14
|
-
categoryContentInfo: any;
|
|
15
|
-
categorySidebarData: any;
|
|
16
|
-
chooseResponseType?: boolean;
|
|
17
|
-
responseTypeOptions?: any;
|
|
18
|
-
hasHeader?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const defaultInitialValues = {
|
|
22
|
-
generalEvaluationLevel: "0",
|
|
23
|
-
questions: [],
|
|
24
|
-
openAnswer: false,
|
|
25
|
-
isYesOrNo: false,
|
|
26
|
-
emphasis: false
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const CategoryContent = (props: categoryContent) => {
|
|
30
|
-
const {
|
|
31
|
-
categoryContentShow,
|
|
32
|
-
categorySidebarData,
|
|
33
|
-
chooseResponseType,
|
|
34
|
-
responseTypeOptions,
|
|
35
|
-
hasHeader
|
|
36
|
-
} = props;
|
|
37
|
-
|
|
38
|
-
const [contentInfo, setContentInfo] = useState<any>(defaultInitialValues);
|
|
39
|
-
const [switchOpenAnswStatus, setSwitchOpenAnswStatus] = useState<boolean>(false);
|
|
40
|
-
const [switchYesOrNoAnswStatus, setSwitchYesOrNoAnswStatus] = useState<boolean>(false);
|
|
41
|
-
const [initialValues, setInitialValues] = useState<any>(categorySidebarData?.data || defaultInitialValues)
|
|
42
|
-
const [form] = useForm();
|
|
43
|
-
|
|
44
|
-
const onFinish = (values: any) => {
|
|
45
|
-
const combinedValues = { ...initialValues, ...values };
|
|
46
|
-
setContentInfo(combinedValues);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const openSwitchHandler = (enabled: boolean) => {
|
|
50
|
-
setSwitchOpenAnswStatus(enabled);
|
|
51
|
-
handleInputChange();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const yesNoSwitchHandler = (enabled: boolean) => {
|
|
55
|
-
setSwitchYesOrNoAnswStatus(enabled);
|
|
56
|
-
handleInputChange();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const handleInputChange = useCallback(() => {
|
|
60
|
-
// Check if all required fields are filled
|
|
61
|
-
const allRequiredFieldsFilled = form.getFieldsError().every(fieldError => !fieldError.errors.length);
|
|
62
|
-
|
|
63
|
-
if (allRequiredFieldsFilled) {
|
|
64
|
-
// Add a small delay before submitting the form
|
|
65
|
-
form.submit();
|
|
66
|
-
}
|
|
67
|
-
}, [form]);
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
props.categoryContentInfo(contentInfo);
|
|
71
|
-
}, [contentInfo]);
|
|
72
|
-
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
setInitialValues(categorySidebarData?.data?.data);
|
|
75
|
-
}, [categorySidebarData]);
|
|
76
|
-
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
form.resetFields();
|
|
79
|
-
form.setFieldsValue(initialValues);
|
|
80
|
-
setSwitchOpenAnswStatus(initialValues?.openAnswer || false);
|
|
81
|
-
setSwitchYesOrNoAnswStatus(initialValues?.isYesOrNo || false);
|
|
82
|
-
}, [form, initialValues]);
|
|
83
|
-
|
|
84
|
-
return (
|
|
85
|
-
<div className={styles.categoryContent}>
|
|
86
|
-
<div className={styles.title}>{t('components.categoryContent.editCategory')}</div>
|
|
87
|
-
|
|
88
|
-
{
|
|
89
|
-
!categoryContentShow
|
|
90
|
-
? <div className={styles.uncheckedCategory}>
|
|
91
|
-
{t('components.categoryContent.message')}
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
: <>
|
|
95
|
-
<Form
|
|
96
|
-
initialValues={defaultInitialValues}
|
|
97
|
-
name="dynamic_form_nest_item"
|
|
98
|
-
onFinish={onFinish}
|
|
99
|
-
autoComplete="off"
|
|
100
|
-
form={form}
|
|
101
|
-
>
|
|
102
|
-
<div className={styles.formHeader}>
|
|
103
|
-
<div className={styles.categoryNameContainer}>
|
|
104
|
-
<div className={styles.categoryName}>
|
|
105
|
-
<Label isUppercase>
|
|
106
|
-
{t('components.categoryContent.categoryName')}
|
|
107
|
-
</Label>
|
|
108
|
-
<Form.Item
|
|
109
|
-
name={['categoryName']}
|
|
110
|
-
rules={[{ required: true, message: t('components.categoryContent.categoryNameError')! }]}
|
|
111
|
-
validateTrigger="onMouseLeave"
|
|
112
|
-
>
|
|
113
|
-
<InputField
|
|
114
|
-
disabled={categorySidebarData?.data?.key === "0" && hasHeader}
|
|
115
|
-
placeholder={t('components.categoryContent.categoryName')!}
|
|
116
|
-
onMouseLeave={handleInputChange}
|
|
117
|
-
/>
|
|
118
|
-
</Form.Item>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
{ categorySidebarData?.data?.key === "0" && hasHeader &&
|
|
122
|
-
<div className={styles.categoryName}>
|
|
123
|
-
<Label isUppercase>
|
|
124
|
-
{t('components.categoryContent.tamplateName')}
|
|
125
|
-
</Label>
|
|
126
|
-
<Form.Item
|
|
127
|
-
name={['name']}
|
|
128
|
-
rules={[{ required: true, message: t('components.categoryContent.templateNameError')! }]}
|
|
129
|
-
validateTrigger="onMouseLeave"
|
|
130
|
-
>
|
|
131
|
-
<InputField
|
|
132
|
-
placeholder={t('components.categoryContent.tamplateName')!}
|
|
133
|
-
onMouseLeave={handleInputChange}
|
|
134
|
-
/>
|
|
135
|
-
</Form.Item>
|
|
136
|
-
</div>
|
|
137
|
-
}
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
{categorySidebarData?.data?.children?.length > 0 &&
|
|
141
|
-
<div className={styles.grade}>
|
|
142
|
-
<Label isUppercase>
|
|
143
|
-
{t('components.categoryContent.weighting')}
|
|
144
|
-
</Label>
|
|
145
|
-
<Form.Item
|
|
146
|
-
name={['grade']}
|
|
147
|
-
>
|
|
148
|
-
<InputField placeholder={'EX: 15%'} onMouseLeave={handleInputChange} />
|
|
149
|
-
</Form.Item>
|
|
150
|
-
</div>
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
{!categorySidebarData?.data?.children?.length &&
|
|
154
|
-
<>
|
|
155
|
-
{(!switchYesOrNoAnswStatus && !chooseResponseType) &&
|
|
156
|
-
<div className={styles.openAnswer}>
|
|
157
|
-
<Label isUppercase>
|
|
158
|
-
{t('components.categoryContent.openAnswer')}
|
|
159
|
-
</Label>
|
|
160
|
-
<Form.Item
|
|
161
|
-
name={['openAnswer']}
|
|
162
|
-
initialValue={switchOpenAnswStatus}
|
|
163
|
-
>
|
|
164
|
-
<Switch onChange={(enabled: boolean) => { openSwitchHandler(enabled) }} checked={switchOpenAnswStatus} />
|
|
165
|
-
</Form.Item>
|
|
166
|
-
</div>
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
{(!switchOpenAnswStatus && !chooseResponseType) &&
|
|
170
|
-
<div className={styles.yesNoAnswer}>
|
|
171
|
-
<Label isUppercase>
|
|
172
|
-
{t('components.categoryContent.yesNoAnswer')}
|
|
173
|
-
</Label>
|
|
174
|
-
<Form.Item
|
|
175
|
-
name={['isYesOrNo']}
|
|
176
|
-
initialValue={switchYesOrNoAnswStatus}
|
|
177
|
-
>
|
|
178
|
-
<Switch onChange={(enabled: boolean) => { yesNoSwitchHandler(enabled) }} checked={switchYesOrNoAnswStatus} />
|
|
179
|
-
</Form.Item>
|
|
180
|
-
</div>
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
{
|
|
184
|
-
(!switchOpenAnswStatus && !switchYesOrNoAnswStatus && !chooseResponseType) &&
|
|
185
|
-
<>
|
|
186
|
-
<div className={styles.generalEvaluationLevel}>
|
|
187
|
-
<Label isUppercase>
|
|
188
|
-
{t('components.categoryContent.answerOption')}
|
|
189
|
-
</Label>
|
|
190
|
-
<Form.Item
|
|
191
|
-
name={['generalEvaluationLevel']}
|
|
192
|
-
>
|
|
193
|
-
< Select
|
|
194
|
-
options={[
|
|
195
|
-
{
|
|
196
|
-
value: '0',
|
|
197
|
-
label: '1 a 5',
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
value: '1',
|
|
201
|
-
label: '1 a 4',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
value: '2',
|
|
205
|
-
label: '1 a 5 ou “Não Aplicável”',
|
|
206
|
-
},
|
|
207
|
-
]}
|
|
208
|
-
onBlur={handleInputChange}
|
|
209
|
-
/>
|
|
210
|
-
</Form.Item>
|
|
211
|
-
</div>
|
|
212
|
-
|
|
213
|
-
{!chooseResponseType &&
|
|
214
|
-
<div className={styles.grade}>
|
|
215
|
-
<Label isUppercase>
|
|
216
|
-
{t('components.categoryContent.weighting')}
|
|
217
|
-
</Label>
|
|
218
|
-
<Form.Item
|
|
219
|
-
name={['grade']}
|
|
220
|
-
>
|
|
221
|
-
<InputField placeholder={'EX: 15%'} onMouseLeave={handleInputChange} />
|
|
222
|
-
</Form.Item>
|
|
223
|
-
</div>
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
</>
|
|
227
|
-
}
|
|
228
|
-
</>
|
|
229
|
-
}
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
{!categorySidebarData?.data?.children?.length &&
|
|
233
|
-
<div className={styles.questionsWrapper}>
|
|
234
|
-
<Label isUppercase>
|
|
235
|
-
{t('components.categoryContent.answers')}
|
|
236
|
-
</Label>
|
|
237
|
-
<Form.Item>
|
|
238
|
-
<Questions
|
|
239
|
-
showGrade={(switchOpenAnswStatus || switchYesOrNoAnswStatus || chooseResponseType) === true ? false : true}
|
|
240
|
-
showCheckbox={chooseResponseType && true}
|
|
241
|
-
handleChanges={handleInputChange}
|
|
242
|
-
responseTypeOptions={responseTypeOptions}
|
|
243
|
-
hasHeader={hasHeader}
|
|
244
|
-
isTheHeader={categorySidebarData?.data?.key === "0" && hasHeader}
|
|
245
|
-
form={form}
|
|
246
|
-
/>
|
|
247
|
-
</Form.Item>
|
|
248
|
-
</div>
|
|
249
|
-
}
|
|
250
|
-
</Form>
|
|
251
|
-
</>
|
|
252
|
-
}
|
|
253
|
-
</div>
|
|
254
|
-
);
|
|
255
|
-
};
|