@omniumretail/component-library 1.0.50 → 1.0.52

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/main.css CHANGED
@@ -535,6 +535,7 @@
535
535
  .adDQP_uvIYgNFVC4VdHj {
536
536
  background: white;
537
537
  padding: 20px;
538
+ overflow: auto;
538
539
  }
539
540
  /*!*********************************************************************************************************************************************************************************!*\
540
541
  !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/Category/CategorySidebar/styles.module.scss ***!
@@ -813,10 +814,12 @@ Label {
813
814
 
814
815
  .Q4flbvKEPN6Jx9Cob22I {
815
816
  background: #EBECED;
817
+ overflow: auto;
816
818
  }
817
819
 
818
820
  .hK3soC6m563VuiLnNutq {
819
821
  background: var(--color-white);
822
+ overflow: auto;
820
823
  }
821
824
 
822
825
  .Q4flbvKEPN6Jx9Cob22I,
@@ -958,3 +961,176 @@ Label {
958
961
  font-weight: var(--font-weight-regular);
959
962
  font-size: var(--font-size-label);
960
963
  }
964
+ /*!*************************************************************************************************************************************************************************!*\
965
+ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!./node_modules/sass-loader/dist/cjs.js!./src/components/CategoryReadOnly/styles.module.scss ***!
966
+ \*************************************************************************************************************************************************************************/
967
+ .zsvRMmfrmqBj9iRjtQpO {
968
+ display: grid;
969
+ grid-template-columns: 300px auto;
970
+ gap: 16px;
971
+ height: 100%;
972
+ }
973
+
974
+ .pb4QP8qfuDG2T6wfXkUC {
975
+ overflow: auto;
976
+ background: #EBECED;
977
+ }
978
+
979
+ .gP05vt1R1r67eWteznvr {
980
+ overflow: auto;
981
+ background: var(--color-white);
982
+ }
983
+
984
+ .pb4QP8qfuDG2T6wfXkUC,
985
+ .gP05vt1R1r67eWteznvr {
986
+ padding: 20px;
987
+ }
988
+
989
+ .btRPAI8631Q2XXYP6nZ7 {
990
+ font-size: var(--font-size-body-4);
991
+ color: var(--color-blue);
992
+ margin-bottom: 36px;
993
+ font-weight: var(--font-weight-semibold);
994
+ text-transform: uppercase;
995
+ }
996
+
997
+ .SbA9dHRh1JSG4xp1Aqie {
998
+ padding-bottom: 15px;
999
+ font-weight: var(--font-weight-bold);
1000
+ font-size: var(--font-size-body-4);
1001
+ }
1002
+
1003
+ .ZsQJQ__gMgYGYau95r8U {
1004
+ cursor: pointer;
1005
+ }
1006
+
1007
+ .PPF4FGgo1aDsBm13cNj8 {
1008
+ padding-left: 16px;
1009
+ }
1010
+ .PPF4FGgo1aDsBm13cNj8 .SbA9dHRh1JSG4xp1Aqie {
1011
+ font-weight: var(--font-weight-semibold);
1012
+ }
1013
+ .PPF4FGgo1aDsBm13cNj8 .QEsWraNRLBQux4k4KNAE .PPF4FGgo1aDsBm13cNj8 .SbA9dHRh1JSG4xp1Aqie {
1014
+ font-weight: var(--font-weight-light);
1015
+ }
1016
+
1017
+ .QEsWraNRLBQux4k4KNAE {
1018
+ display: block;
1019
+ }
1020
+
1021
+ .VQ09MnwMcIzpW1iabb4A {
1022
+ color: var(--color-orange);
1023
+ }
1024
+
1025
+ .cmcMqdZJEUjlu34ag1Md {
1026
+ margin-bottom: 32px;
1027
+ display: flex;
1028
+ justify-content: space-between;
1029
+ align-items: center;
1030
+ }
1031
+
1032
+ .i_U4mKg0Sxl4EvVzgv0L {
1033
+ font-size: var(--font-size-body-4);
1034
+ color: var(--color-blue);
1035
+ font-weight: var(--font-weight-semibold);
1036
+ margin-bottom: 8px;
1037
+ }
1038
+
1039
+ .Tnut0v2OeSU0e7XwrCXI {
1040
+ font-size: var(--font-size-body-3);
1041
+ font-weight: var(--font-weight-light);
1042
+ color: var(--color-black);
1043
+ }
1044
+
1045
+ .W2hZQFsItdqKPcBu4UrA {
1046
+ display: flex;
1047
+ flex-direction: row;
1048
+ gap: 36px;
1049
+ margin-bottom: 36px;
1050
+ border-bottom: 1px solid rgba(var(--color-blue-rgb), 0.2);
1051
+ padding-bottom: 4px;
1052
+ }
1053
+
1054
+ .tIVLagS5XxibJ4PBCNpp {
1055
+ flex-direction: column;
1056
+ border-bottom: 1px solid rgba(var(--color-blue-rgb), 0.2);
1057
+ margin-bottom: 24px;
1058
+ }
1059
+ .tIVLagS5XxibJ4PBCNpp .RenA6EOwu2sFJGoqYbYz {
1060
+ width: 100%;
1061
+ border-bottom: none;
1062
+ }
1063
+ .tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 {
1064
+ width: 100%;
1065
+ height: auto;
1066
+ }
1067
+ .tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 .ant-input {
1068
+ min-height: 140px;
1069
+ }
1070
+ .tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 .ant-form-item {
1071
+ margin-bottom: 16px;
1072
+ }
1073
+
1074
+ .RenA6EOwu2sFJGoqYbYz {
1075
+ width: calc(100% - 149px);
1076
+ display: flex;
1077
+ align-items: center;
1078
+ }
1079
+
1080
+ .N0_FbFF8bLYtEcr8_2B9 {
1081
+ width: 130px;
1082
+ min-width: 130px;
1083
+ align-self: flex-end;
1084
+ display: flex;
1085
+ justify-content: space-between;
1086
+ padding-right: 15px;
1087
+ }
1088
+
1089
+ .GaBbmrXh2G03hz6ha5vB {
1090
+ display: none;
1091
+ }
1092
+
1093
+ .QYrBVtDmfSFNxJFztXVl {
1094
+ width: 130px;
1095
+ min-width: 130px;
1096
+ align-self: flex-end;
1097
+ display: flex;
1098
+ justify-content: space-between;
1099
+ gap: 34px;
1100
+ }
1101
+
1102
+ .V_qOYQwuQ9mXa8aniYgl {
1103
+ font-size: var(--font-size-body-3);
1104
+ font-weight: var(--font-weight-medium);
1105
+ }
1106
+
1107
+ .pvSzNydRHp3dkh3WrOeA {
1108
+ font-weight: var(--font-weight-light);
1109
+ margin-bottom: 4px;
1110
+ }
1111
+
1112
+ .Ehgx39o1k8blh7IDJ2mg {
1113
+ padding: 6px;
1114
+ font-size: var(--font-size-body-4);
1115
+ font-weight: var(--font-weight-medium);
1116
+ color: var(--color-white);
1117
+ border-radius: 5px;
1118
+ display: inline-flex;
1119
+ letter-spacing: 3px;
1120
+ }
1121
+
1122
+ .ifR0bkZtK7yVHD6YZ_Zz {
1123
+ background-color: rgba(217, 217, 217, 0.5);
1124
+ border-radius: 5px;
1125
+ padding: 8px 15px;
1126
+ display: flex;
1127
+ flex-direction: row;
1128
+ gap: 50px;
1129
+ align-items: center;
1130
+ }
1131
+
1132
+ .NL5HeemkTIg0oPHDXVtO {
1133
+ font-size: var(--font-size-body-3);
1134
+ font-weight: var(--font-weight-medium);
1135
+ color: var(--color-black);
1136
+ }
@@ -0,0 +1,4 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ declare const _default: Meta<import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Primary: Story<any>;
@@ -0,0 +1,10 @@
1
+ export type EvaluationOption = {
2
+ value: string;
3
+ label: string;
4
+ };
5
+ export type EvaluationOptions = {
6
+ scale_0: EvaluationOption[];
7
+ scale_1: EvaluationOption[];
8
+ scale_2: EvaluationOption[];
9
+ };
10
+ export declare const evaluationOptions: EvaluationOptions;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface CategoryResponse {
3
+ data: any;
4
+ serverReadyData: any;
5
+ onNextCategoryAvailabilityChange: (hasNext: boolean) => void;
6
+ onPreviousCategoryAvailabilityChange: (hasPrevious: boolean) => void;
7
+ }
8
+ export declare const CategoryReadOnly: React.ForwardRefExoticComponent<CategoryResponse & React.RefAttributes<unknown>>;
9
+ export {};
@@ -21,3 +21,4 @@ export * from './AnalyticsBar';
21
21
  export * from './CategoryResponse';
22
22
  export * from './Upload';
23
23
  export * from './UserInfo';
24
+ export * from './CategoryReadOnly';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -8,5 +8,6 @@
8
8
  .contentWrapper {
9
9
  background: white;
10
10
  padding: 20px;
11
+ overflow: auto;
11
12
  }
12
13
 
@@ -0,0 +1,270 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ import { Button } from "components/Button";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { CategoryReadOnly } from '.';
5
+
6
+ export default {
7
+ title: 'CategoryReadOnly',
8
+ component: CategoryReadOnly,
9
+ } as Meta;
10
+
11
+ const Template: Story<any> = (args) => {
12
+ const [serverData, setServerData] = useState<any>();
13
+ const categoryResponseRef = useRef(null);
14
+ const [hasNext, setHasNext] = useState(true);
15
+ const [hasPrevious, setHasPrevious] = useState(false);
16
+
17
+ const handleNextCategoryAvailabilityChange = (hasNext: boolean) => {
18
+ setHasNext(hasNext);
19
+ };
20
+
21
+ const handlePreviousCategoryAvailabilityChange = (hasPrevious: boolean) => {
22
+ setHasPrevious(hasPrevious);
23
+ };
24
+
25
+ const handleNextClickOutside = () => {
26
+ (categoryResponseRef.current as any).handleNextClick();
27
+ }
28
+
29
+ const handlePreviousClickOutside = () => {
30
+ (categoryResponseRef.current as any).handlePreviousClick();
31
+ }
32
+
33
+ useEffect(() => {
34
+ console.log(serverData);
35
+ }, [serverData])
36
+
37
+ return (
38
+ <div style={{ height: '600px' }}>
39
+ <div>
40
+ <CategoryReadOnly
41
+ {...args}
42
+ serverReadyData={setServerData}
43
+ ref={categoryResponseRef}
44
+ onNextCategoryAvailabilityChange={handleNextCategoryAvailabilityChange}
45
+ onPreviousCategoryAvailabilityChange={handlePreviousCategoryAvailabilityChange}
46
+ >
47
+ </CategoryReadOnly>
48
+ </div>
49
+ <div>
50
+
51
+ {hasPrevious && (
52
+ <Button onClick={handlePreviousClickOutside}>Previous on Parent</Button>
53
+ )}
54
+
55
+ {hasNext && (
56
+ <Button onClick={handleNextClickOutside}>Next on Parent</Button>
57
+ )}
58
+ </div>
59
+ </div>
60
+ )
61
+ };
62
+
63
+ export const Primary = Template.bind({});
64
+ Primary.args = {
65
+ data: {
66
+ "Id": "E985B66B-5EA4-4A6F-81B9-0B12CAA99343",
67
+ "EvaluationCycleId": "A3FE0C73-E771-40BB-B87D-1E40597841A6",
68
+ "QuestionnaireId": "4C15A0A0-7DDF-4952-810C-B46105807CB7",
69
+ "UserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
70
+ "TargetUserId": "A200F4C5-8E41-41D4-A90C-B15EEC448517",
71
+ "StartDate": 1678707055,
72
+ "EndDate": 1679707055,
73
+ "Status": "A",
74
+ "UserFinalScore": "4",
75
+ "SupervisorFinalScore": "3.6",
76
+ "UserColor": "#09168B",
77
+ "SupervisorColor": "#FF674C",
78
+ "CategoryAnswers": [
79
+ {
80
+ "Title": "Competências",
81
+ "Key": "1",
82
+ "Data": {
83
+ "Id": "57A06838-67F9-4726-BC36-719A0C797484",
84
+ "CategoryId": "CATEGORYID1",
85
+ "CategoryName": "Competências",
86
+ "OpenAnswer": false,
87
+ "GeneralEvaluationLevel": 2,
88
+ "Grade": "0",
89
+ "Description": "Inserir resposta numa escala numérica entre 1 e 5, sendo que 1 corresponde a “Mau” e 5 corresponde a “Excelente”",
90
+ "Score": "3.4",
91
+ "SupervisorScore": "3.4",
92
+ "Questions": [
93
+ {
94
+ "Id": "65562A64-A24B-425A-A345-560238CA2468",
95
+ "QuestionId": "7D17A8A5-E299-47D3-AB49-684135DB23A3",
96
+ "Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit",
97
+ "Description": "This is a description",
98
+ "Grade": "0",
99
+ "UserAnswer": "3.4",
100
+ "SupervisorAnswer": "3.4",
101
+ },
102
+ {
103
+ "Id": "85562A64-A24B-425A-A345-560238CA2468",
104
+ "QuestionId": "8D17A8A5-E299-47D3-AB49-684135DB23A3",
105
+ "Subject": "Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elitLorem ipsum dolor sit amet, consectetur adipiscing elit",
106
+ "Description": "This is a description ",
107
+ "Grade": "0",
108
+ "UserAnswer": "3.4",
109
+ "SupervisorAnswer": "3.4",
110
+ }
111
+ ]
112
+ }
113
+ },
114
+ {
115
+ "Title": "Category 2",
116
+ "Key": "2",
117
+ "Data": {
118
+ "Id": "57A06838-67F9-4726-BC36-719A0C797484",
119
+ "CategoryId": "CATEGORYID2",
120
+ "CategoryName": "Category 2",
121
+ "OpenAnswer": false,
122
+ "GeneralEvaluationLevel": 0,
123
+ "Grade": "100",
124
+ "Description": "This is a description",
125
+ "Score": "3.4",
126
+ "SupervisorScore": "3.4",
127
+ "Questions": []
128
+ },
129
+ "Children": [
130
+ {
131
+ "Title": "Category 2.1",
132
+ "Key": "2.1",
133
+ "Data": {
134
+ "Id": "57A06838-67F9-4726-BC36-719A0C797484",
135
+ "CategoryId": "1CDED10D-0984-46D4-A9B3-7EC518D74A63",
136
+ "CategoryName": "Category 2.1",
137
+ "OpenAnswer": false,
138
+ "GeneralEvaluationLevel": 0,
139
+ "Grade": "50",
140
+ "Description": "This is a description",
141
+ "Score": "0.000",
142
+ "SupervisorScore": "0.000",
143
+ "Questions": []
144
+ },
145
+ "Children": [
146
+ {
147
+ "Title": "Category 2.1.1",
148
+ "Key": "2.1.1",
149
+ "Data": {
150
+ "Id": "37A06838-67F9-4726-BC36-719A0C797484",
151
+ "CategoryId": "3CDED10D-0984-46D4-A9B3-7EC518D74A63",
152
+ "CategoryName": "Category 2.1.1",
153
+ "OpenAnswer": false,
154
+ "GeneralEvaluationLevel": 0,
155
+ "Grade": "50",
156
+ "Description": "This is a description",
157
+ "Score": "3.4",
158
+ "SupervisorScore": "3.4",
159
+ "Questions": [
160
+ {
161
+ "Id": "365562A64-A24B-425A-A345-560238CA2468",
162
+ "QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
163
+ "Subject": "This is a Subject",
164
+ "Description": "This is a description",
165
+ "Grade": "50",
166
+ "UserAnswer": "3.4",
167
+ "SupervisorAnswer": "3.4",
168
+ },
169
+ {
170
+ "Id": "35562A64-A24B-425A-A345-560238CA2468",
171
+ "QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
172
+ "Subject": "This is a Subject",
173
+ "Description": "This is a description",
174
+ "Grade": "25",
175
+ "UserAnswer": "3.4",
176
+ "SupervisorAnswer": "3.4",
177
+ },
178
+ {
179
+ "Id": "35562A64-A24B-425A-A345-560238CA2468",
180
+ "QuestionId": "3D17A8A5-E299-47D3-AB49-684135DB23A3",
181
+ "Subject": "This is a Subject",
182
+ "Description": "This is a description",
183
+ "Grade": "25",
184
+ "UserAnswer": "3.4",
185
+ "SupervisorAnswer": "3.4",
186
+ }
187
+ ]
188
+ }
189
+ }
190
+ ]
191
+ },
192
+ {
193
+ "Title": "Category 2.2",
194
+ "Key": "2.2",
195
+ "Data": {
196
+ "Id": "57A06838-67F9-4726-BC36-719A0C797484",
197
+ "CategoryId": "PCDED10D-0984-46D4-A9B3-7EC518D74A63",
198
+ "CategoryName": "Category 2.2",
199
+ "OpenAnswer": false,
200
+ "GeneralEvaluationLevel": 0,
201
+ "Grade": "50",
202
+ "Description": "This is a description",
203
+ "Score": "3.4",
204
+ "SupervisorScore": "3.4",
205
+ "Questions": [
206
+ {
207
+ "Id": "P5562A64-A24B-425A-A345-560238CA2468",
208
+ "QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
209
+ "Subject": "This is a Subject",
210
+ "Description": "This is a description",
211
+ "Grade": "50",
212
+ "UserAnswer": "3.4",
213
+ "SupervisorAnswer": "3.4",
214
+ },
215
+ {
216
+ "Id": "P5562A64-A24B-425A-A345-560238CA2468",
217
+ "QuestionId": "PD17A8A5-E299-47D3-AB49-684135DB23A3",
218
+ "Subject": "This is a Subject",
219
+ "Description": "This is a description",
220
+ "Grade": "50",
221
+ "UserAnswer": "3.4",
222
+ "SupervisorAnswer": "3.4",
223
+ }
224
+ ]
225
+ },
226
+ "Children": []
227
+ }
228
+ ]
229
+ },
230
+ {
231
+ "Title": "Category 3",
232
+ "Key": "3",
233
+ "Data": {
234
+ "Id": "97A06838-67F9-4726-BC36-719A0C797484",
235
+ "CategoryId": "CATEGORYID3",
236
+ "CategoryName": "Category 3",
237
+ "OpenAnswer": true,
238
+ "GeneralEvaluationLevel": 0,
239
+ "Grade": "0",
240
+ "Description": "This is a description",
241
+ "Score": "3.4",
242
+ "SupervisorScore": "3.4",
243
+ "Questions": [
244
+ {
245
+ "Id": "95562A64-A24B-425A-A345-560238CA2468",
246
+ "QuestionId": "9D17A8A5-E299-47D3-AB49-684135DB23A3",
247
+ "Subject": "This is a Subject",
248
+ "Description": "This is a description",
249
+ "Grade": "0",
250
+ "UserAnswer": "3.4",
251
+ "SupervisorAnswer": "3.4",
252
+ },
253
+ {
254
+ "Id": "93862A64-A24B-425A-A345-560238CA2468",
255
+ "QuestionId": "9D38A8A5-E299-47D3-AB49-684135DB23A3",
256
+ "Subject": "This is a Subject",
257
+ "Description": "This is a description",
258
+ "Grade": "0",
259
+ "UserAnswer": "3.4",
260
+ "SupervisorAnswer": "3.4",
261
+ }
262
+ ]
263
+ }
264
+ },
265
+ ]
266
+ }
267
+ };
268
+
269
+
270
+
@@ -0,0 +1,81 @@
1
+ import translate from '../../constants/translationHelper';
2
+
3
+ export type EvaluationOption = {
4
+ value: string;
5
+ label: string;
6
+ };
7
+
8
+ export type EvaluationOptions = {
9
+ scale_0: EvaluationOption[];
10
+ scale_1: EvaluationOption[];
11
+ scale_2: EvaluationOption[];
12
+ };
13
+
14
+ export const evaluationOptions: EvaluationOptions = {
15
+ scale_0: [
16
+ {
17
+ value: '1',
18
+ label: '1',
19
+ },
20
+ {
21
+ value: '2',
22
+ label: '2',
23
+ },
24
+ {
25
+ value: '3',
26
+ label: '3',
27
+ },
28
+ {
29
+ value: '4',
30
+ label: '4',
31
+ },
32
+ {
33
+ value: '5',
34
+ label: '5',
35
+ }
36
+ ],
37
+ scale_1: [
38
+ {
39
+ value: '1',
40
+ label: '1',
41
+ },
42
+ {
43
+ value: '2',
44
+ label: '2',
45
+ },
46
+ {
47
+ value: '3',
48
+ label: '3',
49
+ },
50
+ {
51
+ value: '4',
52
+ label: '4',
53
+ },
54
+ ],
55
+ scale_2: [
56
+ {
57
+ value: '1',
58
+ label: '1',
59
+ },
60
+ {
61
+ value: '2',
62
+ label: '2',
63
+ },
64
+ {
65
+ value: '3',
66
+ label: '3',
67
+ },
68
+ {
69
+ value: '4',
70
+ label: '4',
71
+ },
72
+ {
73
+ value: '5',
74
+ label: '5',
75
+ },
76
+ {
77
+ value: 'na',
78
+ label: translate('components.categoryResponse.notApplicable')
79
+ }
80
+ ]
81
+ }